class authorshipByline{constructor(t,i){this.type=i,this.byline=t,this.valid=!0,this.names=[],this.links=[],this.href=this.byline.getAttribute("href"),this.url=new URL(decodeURIComponent(this.href)),this.params=new URLSearchParams(this.url.search),this.origin=this.url.origin,this.path=this.url.pathname,this.postId=0,this.params.has("mab_v3")&&(this.postId=this.params.get("mab_v3")),this.lang="",this.params.has("lang")&&(this.lang="?lang="+this.params.get("lang")),this.check()?this.parseData():this.valid=!1}check(){let t=!0;return""===(this.byline.textContent||"").trim()&&(this.params.has("m_main_disabled")?this.byline.removeAttribute("href"):this.byline.setAttribute("href",this.origin+this.path+this.lang),t=!1),t}parseData(){switch(this.type){case"v1":case"v2":var t=[molongui_authorship_byline_params.byline_separator,molongui_authorship_byline_params.byline_last_separator];this.names=this.byline.innerText.split(new RegExp(t.join("|"),"gi")),this.params.has("m_main_disabled")?(this.links=this.params.getAll("mca"),this.links.unshift("molongui-disabled-link")):(t=this.path.replace(/^\/|\/$/g,"").split("/").pop(),this.path.replace(/\/$/g,"").replace(t,""),this.links=this.params.getAll("mca"),this.links.unshift(this.origin+this.path+this.lang));break;case"v3":var t=window["molongui_authorship_byline_data_"+this.postId];Object.values(t).forEach(function(t){this.names.push(t.name),this.links.push(t.url)},this),this.names.length!==this.links.length&&(t="Byline for post #"+this.postId+" is probably wrong, names count doesn't match links count.",console.log("%c MOLONGUI AUTHORSHIP %c\n"+t+"\n"+this.byline,"background: #fdfdc6; font-weight: bold; color: #555",""))}}replace(){let e=[molongui_authorship_byline_params.byline_separator,molongui_authorship_byline_params.byline_last_separator],s="",n=this.names.length,t=this.byline.getAttribute("class"),i=this.byline.getAttribute("target"),a=this.byline.getAttribute("rel"),l=this.byline.getAttribute("itemprop");var r='class="'+(t?t+" ":"")+molongui_authorship_byline_params.byline_link_class+'"',o=i?'target="'+i+'"':"",h=a?'rel="'+a+'"':"",u=l?'itemprop="'+l+'"':"";s=molongui_authorship_byline_params.byline_dom_prepend;for(let i=0;i<n;i++){var m=this.names[i].trim();let t="";t=""!==molongui_authorship_byline_params.byline_dom_tree?molongui_authorship_byline_params.byline_dom_tree.replace("{%ma_authorName}",m):m,!this.links[i]||0===this.links[i].length||"molongui-disabled-link"===this.links[i]||i>=this.links.length?s+=t:s+='<a href="'+this.links[i]+'" '+r+" "+h+" "+u+" "+o+' title="'+molongui_authorship_byline_params.byline_link_title+" "+m+'">'+t+"</a>",i<n-1-1?s+=e[0]:i<n-1&&(s+=e[1])}s+=molongui_authorship_byline_params.byline_dom_append,this.byline.insertAdjacentHTML("afterend",s),this.byline.parentNode.removeChild(this.byline)}isValid(){return this.valid}getNames(){return this.names}getLinks(){return this.links}}let getBylines=function(t){let i;return i="v3"===t?document.querySelectorAll('a[href*="mab_v3="]'):document.querySelectorAll('a[href*="molongui_byline=old"]')};const __molonguiProcessedBylines=new WeakSet;let addBylineCoauthors=function(){let s=molongui_authorship_byline_params.byline_decoder;var t=getBylines(s);Array.prototype.forEach.call(t,function(t,i){var e;__molonguiProcessedBylines.has(t)||(e=new authorshipByline(t,s)).isValid()&&(e.replace(),__molonguiProcessedBylines.add(t))})},addBylineModifiers=function(){const e="?m_bm=true";var t=document.querySelectorAll('a[href$="'+e+'"]');Array.prototype.forEach.call(t,function(t,i){t.setAttribute("href",decodeURIComponent(t.getAttribute("href")).replace(e,"")),t.insertAdjacentHTML("beforebegin",molongui_authorship_byline_params.byline_prefix+" "),t.insertAdjacentHTML("afterend"," "+molongui_authorship_byline_params.byline_suffix)})},removeEmptyLinks=function(){var t=document.querySelectorAll('a[href="#molongui-disabled-link"]');Array.prototype.forEach.call(t,function(t,i){t.classList.add("molongui-disabled-link"),t.removeAttribute("href")})},initBylines=function(){addBylineModifiers(),addBylineCoauthors(),removeEmptyLinks()};document.addEventListener("DOMContentLoaded",function(){initBylines();var t=document.body;new MutationObserver(function(t){Array.prototype.forEach.call(t,function(t,i){void 0!==t.target.classList&&"m-a-box-container"===t.target.classList.value||initBylines()})}).observe(t,{attributes:!0,childList:!0,subtree:!0,characterData:!0})});
(function (e){
"use strict";
var n=window.AFTHRAMPES_JS||{};
n.lightDarkToggle=function (){
jQuery('#aft-dark-light-mode-btn').on('click', function (event){
event.preventDefault();
var DefaultSiteModeAttr=e(this).data('site-mode');
var DefaultSiteModeCls=e(this).attr('class');
if(DefaultSiteModeAttr===DefaultSiteModeCls){
n.lightDarkToggleFunction(DefaultSiteModeAttr);
}else{
n.lightDarkToggleFunction(DefaultSiteModeCls);
}});
},
n.lightDarkToggleFunction=function (DefaultSiteModeAttr){
jQuery.removeCookie('chromenews-stored-site-mode', { expires: 7, path: '/' });
var actualSiteModeAttr=e('#aft-dark-light-mode-btn').data('site-mode');
var switchSiteModeAttr='';
if(DefaultSiteModeAttr==='aft-dark-mode'){
switchSiteModeAttr='aft-light-mode';
}else{
switchSiteModeAttr='aft-dark-mode';
}
e('body').removeClass(DefaultSiteModeAttr);
e('body').addClass(switchSiteModeAttr);
e('#aft-dark-light-mode-btn').removeClass(DefaultSiteModeAttr);
e('#aft-dark-light-mode-btn').addClass(switchSiteModeAttr);
jQuery.cookie('chromenews-stored-site-mode', switchSiteModeAttr, { expires: 7, path: '/' });
},
e(document).ready(function (){
n.lightDarkToggle();
});
})(jQuery);
(function(){
var container, button, menu, links, i, len;
container=document.getElementById('site-navigation');
if(! container){
return;
}
button=container.getElementsByTagName('button')[0];
if('undefined'===typeof button){
return;
}
menu=container.getElementsByTagName('ul')[0];
if('undefined'===typeof menu){
button.style.display='none';
return;
}
menu.setAttribute('aria-expanded', 'false');
if(-1===menu.className.indexOf('nav-menu') ){
menu.className +=' nav-menu';
}
button.onclick=function(){
if(-1!==container.className.indexOf('toggled') ){
container.className=container.className.replace(' toggled', '');
button.setAttribute('aria-expanded', 'false');
menu.setAttribute('aria-expanded', 'false');
}else{
container.className +=' toggled';
button.setAttribute('aria-expanded', 'true');
menu.setAttribute('aria-expanded', 'true');
}};
links=menu.getElementsByTagName('a');
for(i=0, len=links.length; i < len; i++){
links[i].addEventListener('focus', toggleFocus, true);
links[i].addEventListener('blur', toggleFocus, true);
}
function toggleFocus(){
var self=this;
while(-1===self.className.indexOf('nav-menu') ){
if('li'===self.tagName.toLowerCase()){
if(-1!==self.className.indexOf('focus') ){
self.className=self.className.replace(' focus', '');
}else{
self.className +=' focus';
}}
self=self.parentElement;
}}
(function(container){
var touchStartFn, i,
parentLink=container.querySelectorAll('.menu-item-has-children > a, .page_item_has_children > a');
if('ontouchstart' in window){
touchStartFn=function(e){
var menuItem=this.parentNode, i;
if(! menuItem.classList.contains('focus') ){
e.preventDefault();
for(i=0; i < menuItem.parentNode.children.length; ++i){
if(menuItem===menuItem.parentNode.children[i]){
continue;
}
menuItem.parentNode.children[i].classList.remove('focus');
}
menuItem.classList.add('focus');
}else{
menuItem.classList.remove('focus');
}};
for(i=0; i < parentLink.length; ++i){
parentLink[i].addEventListener('touchstart', touchStartFn, false);
}}
}(container) );
})();
(function(){
var isIe=/(trident|msie)/i.test(navigator.userAgent);
if(isIe&&document.getElementById&&window.addEventListener){
window.addEventListener('hashchange', function(){
var id=location.hash.substring(1),
element;
if(!(/^[A-z0-9_-]+$/.test(id) )){
return;
}
element=document.getElementById(id);
if(element){
if(!(/^(?:a|select|input|button|textarea)$/i.test(element.tagName) )){
element.tabIndex=-1;
}
element.focus();
}}, false);
}})();