1var e=class extends HTMLElement{track=null;prevBtn=null;nextBtn=null;dotsContainer=null;items=[];scrollTimer=null;connectedCallback(){this.track=this.querySelector(`[data-slot="track"]`),this.prevBtn=this.querySelector(`[data-slot="prev"]`),this.nextBtn=this.querySelector(`[data-slot="next"]`),this.dotsContainer=this.querySelector(`[data-slot="dots"]`),this.track&&(this.items=Array.from(this.track.querySelectorAll(`[data-slot="item"]`)),this.items.length!==0&&(this.prevBtn&&(this.prevBtn.classList.remove(`hidden`),this.prevBtn.classList.add(`flex`)),this.nextBtn&&(this.nextBtn.classList.remove(`hidden`),this.nextBtn.classList.add(`flex`)),this.buildDots(),this.prevBtn?.addEventListener(`click`,this.scrollPrev),this.nextBtn?.addEventListener(`click`,this.scrollNext),this.track.addEventListener(`scroll`,this.onScroll,{passive:!0}),this.updateState()))}disconnectedCallback(){this.prevBtn?.removeEventListener(`click`,this.scrollPrev),this.nextBtn?.removeEventListener(`click`,this.scrollNext),this.track?.removeEventListener(`scroll`,this.onScroll),this.scrollTimer!==null&&clearTimeout(this.scrollTimer)}buildDots(){!this.dotsContainer||this.items.length<=1||this.items.forEach((e,t)=>{let n=document.createElement(`button`);n.type=`button`,n.setAttribute(`aria-label`,`Go to image ${t+1}`),n.style.cssText=`width:8px;height:8px;border-radius:50%;border:none;cursor:pointer;padding:0;transition:background-color 0.25s,transform 0.25s;flex-shrink:0;`,n.style.backgroundColor=t===0?`#678BC7`:`#d1d5db`,n.style.transform=t===0?`scale(1.25)`:`scale(1)`,n.addEventListener(`click`,()=>this.scrollToIndex(t)),this.dotsContainer.appendChild(n)})}getActiveIndex(){if(!this.track||this.items.length===0)return 0;let e=this.track.getBoundingClientRect().left,t=0,n=1/0;return this.items.forEach((r,i)=>{let a=Math.abs(r.getBoundingClientRect().left-e);a<n&&(n=a,t=i)}),t}scrollToIndex(e){if(!this.track||!this.items[e])return;let t=this.track.getBoundingClientRect().left,n=this.items[e].getBoundingClientRect().left;this.track.scrollBy({left:n-t,behavior:`smooth`})}scrollPrev=()=>{let e=this.getActiveIndex();this.scrollToIndex(e===0?this.items.length-1:e-1)};scrollNext=()=>{let e=this.getActiveIndex();this.scrollToIndex(e===this.items.length-1?0:e+1)};onScroll=()=>{this.scrollTimer!==null&&clearTimeout(this.scrollTimer),this.scrollTimer=setTimeout(()=>this.updateState(),60)};updateState(){let e=this.getActiveIndex();this.dotsContainer&&Array.from(this.dotsContainer.children).forEach((t,n)=>{let r=t;r.style.backgroundColor=n===e?`#678BC7`:`#d1d5db`,r.style.transform=n===e?`scale(1.25)`:`scale(1)`})}};customElements.get(`root-image-carousel`)||customElements.define(`root-image-carousel`,e);
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.