1var h=Object.defineProperty;var c=(s,i,e)=>i in s?h(s,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[i]=e;var t=(s,i,e)=>c(s,typeof i!="symbol"?i+"":i,e);import{C as d}from"./alzchem-B8Vlwgj5.js";class m extends d{constructor(){super(...arguments);t(this,"pageContent");t(this,"collapsableButton");t(this,"index",0);t(this,"position",0);t(this,"numberElement");t(this,"nameElement");t(this,"anchors",[]);t(this,"intersect",!0);t(this,"observer",null)}run(){this.initSidebarToggle(),this.initAnchorScrolling(),this.initObserver()}initSidebarToggle(){this.pageContent=document.querySelector(".page__content"),this.collapsableButton=this.element.querySelector(".brand-guidelines-sidebar__collapsable"),this.pageContent&&this.collapsableButton&&this.collapsableButton.addEventListener("click",this.toggleSidebar.bind(this))}toggleSidebar(){var e;(e=this.pageContent)==null||e.classList.toggle("page__content-sidebar--expanded")}initAnchorScrolling(){this.numberElement=this.element.querySelector(".brand-guidelines-sidebar__current-number"),this.nameElement=this.element.querySelector(".brand-guidelines-sidebar__current-name"),this.anchors=[...this.element.querySelectorAll(".anchor")],this.handlers.anchorScroll=this.onAnchorScroll.bind(this),this.element.addEventListener("anchor.scroll",this.handlers.anchorScroll),this.renderActiveAnchor()}onAnchorScroll(e){this.index=this.anchors.indexOf(e.detail.element),this.renderActiveAnchor()}renderActiveAnchor(){this.anchors.forEach((e,n)=>{n===this.index?(e.classList.add("brand-guidelines-sidebar__list-item-link--active"),this.nameElement&&(this.nameElement.innerText=e.dataset.title?e.dataset.title:"")):e.classList.remove("brand-guidelines-sidebar__list-item-link--active")}),this.numberElement&&(this.numberElement.innerText=this.index<9?"0"+(this.index+1):(this.index+1).toString())}initObserver(){if(this.handlers.targetIntersect=this.onTargetIntersect.bind(this),this.observer=new IntersectionObserver(this.handlers.targetIntersect,{rootMargin:"-50%"}),this.anchors)for(let e of this.anchors){const n=window.document.querySelector(e.getAttribute("href"));n&&this.observer.observe(n)}}onTargetIntersect(e){for(let n of e)if(this.intersect){const r=window.scrollY,l=`#${n.target.getAttribute("id")}`,o=this.anchors.find(a=>a.getAttribute("href")===l);o&&n.isIntersecting?this.index=this.anchors.indexOf(o):this.index>-1&&r<this.position&&this.index--,this.position=r,this.renderActiveAnchor()}}}export{m as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.