1function X({container:a,wrapperSelector:m,prevBtnSelector:M,nextBtnSelector:W,paginationSelector:w,fractionPaginationSelector:x,enableDotPagination:d=!1,enableFractionPagination:k=!1,clickablePagination:f=!1,dynamicPagination:A=!1}){const o=a.querySelector(m),n=Array.from(o.children),u=a.querySelector(M),p=a.querySelector(W),l=a.querySelector(w),$=a.querySelector(x);let i=0;const L=n.length,S=5;let r;function B(){o.scrollLeft=0,y(),n.forEach((t,e)=>{t.setAttribute("aria-label",`Slide ${e+1} of ${n.length}`)}),g(),F(),E(),D()}function h(t){const s=n[t].offsetWidth*t;o.scrollTo({left:s,behavior:"smooth"}),i=t,g(),j(),E(),y()}function P(){i<n.length-1&&h(i+1)}function T(){i>0&&h(i-1)}function g(){!u||!p||(u.disabled=i===0,p.disabled=i===n.length-1)}function F(){if(d){if(A){I();return}l.innerHTML="";for(let t=0;t<n.length;t++){const e=f?document.createElement("button"):document.createElement("div");f&&(e.setAttribute("aria-label",`Slide ${t+1}`),e.addEventListener("click",()=>h(t))),e.classList.add("dot"),t===0&&e.classList.add("is-active"),l.appendChild(e)}}}function j(){if(!d)return;if(A){C();return}l.querySelectorAll(".dot").forEach((e,s)=>{e.classList.toggle("is-active",s===i)})}function I(){if(d){l.innerHTML="",r=document.createElement("div"),r.classList.add("dots-container"),l.appendChild(r);for(let t=0;t<L;t++){const e=f?document.createElement("button"):document.createElement("div");f&&(e.setAttribute("aria-label",`Slide ${t+1}`),e.addEventListener("click",()=>{i=t,h(t)})),e.classList.add("dot"),t===0&&e.classList.add("is-active"),r.appendChild(e)}C()}}function C(){if(!d)return;const t=r.querySelectorAll(".dot"),e=Math.floor(S/2),s=Math.max(0,Math.min(i-e,L-S)),q=s+S;t.forEach((v,c)=>{v.classList.remove("is-active","is-in-view","is-at-edge"),c===i&&v.classList.add("is-active"),c>=s&&c<q&&v.classList.add("is-in-view"),(c===s&&s>0||c===q-1&&q<L)&&v.classList.add("is-at-edge")});const H=(t[0]?.offsetWidth||16)+6,V=-s*H;r.style.transform=`translateX(${V}px)`}function E(){!k&&!$||($.textContent=`${i+1} / ${n.length}`)}function y(){n.forEach(t=>t.classList.remove("active")),n[i].classList.add("active"),n[i].focus()}function D(){u&&p&&(u.addEventListener("click",T),p.addEventListener("click",P))}let b=!1;o.addEventListener("scroll",()=>{b||(requestAnimationFrame(()=>{const t=Math.round(o.scrollLeft/n[0].offsetWidth);t!==i&&(i=t,g(),j(),E(),y()),b=!1}),b=!0)},{passive:!0}),B()}function z(){document.querySelectorAll(".js-snap-slider").forEach(m=>{X({container:m,wrapperSelector:".js-snap-slider--track",prevBtnSelector:".js-snap-slider--prev",nextBtnSelector:".js-snap-slider--next",paginationSelector:".js-snap-slider--pagination",fractionPaginationSelector:".js-snap-slider--fraction-pagination",enableDotPagination:!0,enableFractionPagination:!1,clickablePagination:!1,dynamicPagination:!0})})}export{z 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.