r(type,userStop,{capture:true,passive:true});}); function sample(){ if(stopped||location.pathname!==path){stop();return;} var now=performance.now(),target=document.getElementById(id); if(document.body&&document.body.classList.contains('siteScrollingBlocked')){stableSince=now;timer=setTimeout(sample,120);return;} if(!target){if(now-started>6000){stop();restore();root.setAttribute('data-fo-news-anchor-status','missing');return;}timer=setTimeout(sample,80);return;} var y=target.getBoundingClientRect().top+window.scrollY,height=document.documentElement.scrollHeight; if(lastY===null||Math.abs(y-lastY)>1||Math.abs(height-lastHeight)>1){lastY=y;lastHeight=height;stableSince=now;} var fontsReady=!document.fonts||document.fonts.status==='loaded'; if((now-started>=2200&&now-stableSince>=650&&fontsReady&&document.readyState==='complete')||now-started>7500){ stop(); var offset=parseFloat(getComputedStyle(target).scrollMarginTop)||0; var oldBehavior=root.style.scrollBehavior; root.style.scrollBehavior='auto'; window.scrollTo({top:Math.max(0,y-offset),behavior:'instant'}); root.style.scrollBehavior=oldBehavior; restore(); root.setAttribute('data-fo-news-anchor-status','settled'); return; } timer=setTimeout(sample,80); } sample(); } begin(); window.addEventListener('hashchange',begin); })();
top of page
bottom of page