lazer-slider 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var O=e=>e===1?1:1-Math.pow(2,-10*e),P=e=>1-Math.pow(1-e,3),Se=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,be=e=>1-(1-e)*(1-e),ve=e=>e;var Te=()=>`slider-${Math.random().toString(36).substring(2,9)}`,K=e=>{let{feed:r,prevSlideButton:o,nextSlideButton:t,thumbs:u,slides:n}=e;r.id||(r.id=Te()),r.setAttribute("role","region"),r.setAttribute("aria-label","Carousel"),r.setAttribute("aria-roledescription","carousel"),r.removeAttribute("tabindex"),n.forEach((f,i)=>{f.setAttribute("role","group"),f.setAttribute("aria-roledescription","slide"),f.setAttribute("aria-label",`Slide ${i+1} of ${n.length}`);}),o&&(o.setAttribute("aria-label","Previous slide"),o.setAttribute("aria-controls",r.id),o.setAttribute("tabindex","0"),o.tagName!=="BUTTON"&&o.setAttribute("role","button")),t&&(t.setAttribute("aria-label","Next slide"),t.setAttribute("aria-controls",r.id),t.setAttribute("tabindex","0"),t.tagName!=="BUTTON"&&t.setAttribute("role","button")),u?.length&&u.forEach((f,i)=>{f.tagName!=="BUTTON"&&f.setAttribute("role","button"),f.setAttribute("aria-label",`Go to slide ${i+1}`),f.setAttribute("tabindex","0"),f.setAttribute("aria-controls",r.id);});},C=(e,r,o)=>{if(!e)return;!r&&e===document.activeElement&&o&&o.focus();let t="opacity 0.3s ease",u=r?"1":"0";Object.assign(e.style,{opacity:u,transition:t,pointerEvents:r?"auto":"none"}),r?(e.removeAttribute("aria-hidden"),e.setAttribute("tabindex","0")):(e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1")),r?e.style.visibility="visible":setTimeout(()=>{e.style.opacity==="0"&&(e.style.visibility="hidden");},300);},D=(e,r,o="active")=>{e?.length&&e.forEach((t,u)=>{let n=u===r;t.classList.toggle(o,n),t.setAttribute("aria-selected",n.toString());});},Q=(e,r,o,t,u="horizontal")=>{let n=u==="vertical",f=n?"ArrowUp":"ArrowLeft",i=n?"ArrowDown":"ArrowRight";e.addEventListener("keydown",S=>{switch(S.key){case f:S.preventDefault(),r();break;case i:S.preventDefault(),o();break}},{signal:t}),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0");};var ye=()=>({isDragging:false,startX:0,startY:0,startScrollLeft:0,startScrollTop:0,velocity:0,lastX:0,lastY:0,lastTime:0,momentumId:null}),ee=(e,r,o="horizontal")=>{let t=e.getBoundingClientRect(),u=o==="vertical",n=u?t.top+t.height/2:t.left+t.width/2,f=null,i=1/0;for(let S of r){if(S.offsetParent===null)continue;let h=S.getBoundingClientRect(),p=u?h.top+h.height/2:h.left+h.width/2,b=Math.abs(n-p);b<i&&(i=b,f=S);}return f},Ee=(e,r,o,t,u,n="horizontal")=>{let S=n==="vertical",h=()=>{if(Math.abs(e.velocity)<.5){e.momentumId=null;let p=ee(r,o,n);if(p){let b=S?p.offsetTop:p.offsetLeft;t(b,P);}u?.();return}S?r.scrollTop+=e.velocity:r.scrollLeft+=e.velocity,e.velocity*=.95,e.momentumId=requestAnimationFrame(h);};e.momentumId=requestAnimationFrame(h);},J=e=>"touches"in e?e.touches[0]?.clientX??0:e.clientX,Z=e=>"touches"in e?e.touches[0]?.clientY??0:e.clientY,te=e=>{let{feed:r,slides:o,abortSignal:t,smoothScrollTo:u,onDragEnd:n,direction:f="horizontal"}=e,i=ye(),S=f==="vertical",h=m=>{i.momentumId!==null&&(cancelAnimationFrame(i.momentumId),i.momentumId=null),i.isDragging=true,i.startX=J(m),i.startY=Z(m),i.startScrollLeft=r.scrollLeft,i.startScrollTop=r.scrollTop,i.velocity=0,i.lastX=i.startX,i.lastY=i.startY,i.lastTime=performance.now(),r.style.userSelect="none",r.classList.add("is-dragging"),m.type==="mousedown"&&m.preventDefault();},p=m=>{if(!i.isDragging)return;let T=J(m),v=Z(m),A=performance.now(),E=A-i.lastTime;if(S){let x=i.startY-v;r.scrollTop=i.startScrollTop+x,E>0&&(i.velocity=(i.lastY-v)/E*16),i.lastY=v;}else {let x=i.startX-T;r.scrollLeft=i.startScrollLeft+x,E>0&&(i.velocity=(i.lastX-T)/E*16),i.lastX=T;}i.lastTime=A,m.type==="touchmove"&&m.preventDefault();},b=()=>{if(i.isDragging)if(i.isDragging=false,r.style.userSelect="",r.classList.remove("is-dragging"),Math.abs(i.velocity)>1)Ee(i,r,o,u,n,f);else {let m=ee(r,o,f);if(m){let T=S?m.offsetTop:m.offsetLeft;u(T,P);}n?.();}};return r.addEventListener("mousedown",h,{signal:t}),document.addEventListener("mousemove",p,{signal:t}),document.addEventListener("mouseup",b,{signal:t}),r.addEventListener("touchstart",h,{passive:true,signal:t}),r.addEventListener("touchmove",p,{passive:false,signal:t}),r.addEventListener("touchend",b,{signal:t}),document.addEventListener("mouseleave",b,{signal:t}),i},re=e=>{e.momentumId!==null&&(cancelAnimationFrame(e.momentumId),e.momentumId=null);};var k=({bulletsContainer:e,slides:r,bulletClass:o,bulletActiveClass:t,feedId:u})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid bulletsContainer: must be a valid HTMLElement");if(!Array.isArray(r)||r.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!u||typeof u!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid bulletClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide navigation");let n=r.map((i,S)=>({slide:i,originalIndex:S})).filter(({slide:i})=>i.offsetParent!==null);return n.length===0?(console.warn("No visible slides found"),[]):n.map(({slide:i,originalIndex:S},h)=>{let p=document.createElement("button");return p.type="button",p.classList.add(o),h===0&&p.classList.add(t),p.setAttribute("role","tab"),p.setAttribute("aria-selected",h===0?"true":"false"),p.setAttribute("aria-controls",u),p.setAttribute("aria-label",`Go to slide ${h+1}`),p.setAttribute("data-slide-index",String(h)),e.appendChild(p),p})};var $=({thumbsContainer:e,slides:r,thumbClass:o,thumbActiveClass:t,feedId:u,thumbImageSelector:n="img",thumbSize:f})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid thumbsContainer: must be a valid HTMLElement");if(!Array.isArray(r)||r.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!u||typeof u!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid thumbClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide thumbnails");let i=r.map((h,p)=>({slide:h,originalIndex:p})).filter(({slide:h})=>h.offsetParent!==null);return i.length===0?(console.warn("No visible slides found"),[]):i.map(({slide:h,originalIndex:p},b)=>{let m=document.createElement("button");m.type="button",m.classList.add(o),b===0&&m.classList.add(t);let T=h.querySelector(n);if(T?.src){let v=document.createElement("img");v.src=T.src,v.alt=T.alt||`Slide ${b+1} thumbnail`,v.draggable=false,f&&(v.style.width=`${f.width}px`,v.style.height=`${f.height}px`,v.style.objectFit="cover"),m.appendChild(v);}return m.setAttribute("role","tab"),m.setAttribute("aria-selected",b===0?"true":"false"),m.setAttribute("aria-controls",u),m.setAttribute("aria-label",`Go to slide ${b+1}`),m.setAttribute("data-slide-index",String(b)),e.appendChild(m),m})};var le=()=>({initialized:false,clonedSlides:[],styleElement:null}),oe=()=>{let e=document.getElementById("lazer-marquee-keyframes");if(e)return e;let r=document.createElement("style");return r.id="lazer-marquee-keyframes",r.textContent=`
1
+ 'use strict';var C={MIN_DURATION:400,MAX_DURATION:1e3,SPEED_FACTOR:1.5,SCROLL_END_DELAY:50,THUMB_UPDATE_DELAY:500},Ee="(min-width: 64rem)",O=()=>window.matchMedia(Ee).matches;var N=e=>e===1?1:1-Math.pow(2,-10*e),H=e=>1-Math.pow(1-e,3),ye=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,Le=e=>1-(1-e)*(1-e),ge=e=>e;var Ae=()=>`slider-${Math.random().toString(36).substring(2,9)}`,ee=e=>{let{feed:t,prevSlideButton:o,nextSlideButton:l,thumbs:r,slides:a}=e;t.id||(t.id=Ae()),t.setAttribute("role","region"),t.setAttribute("aria-label","Carousel"),t.setAttribute("aria-roledescription","carousel"),t.removeAttribute("tabindex"),a.forEach((i,s)=>{i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-label",`Slide ${s+1} of ${a.length}`);}),o&&(o.setAttribute("aria-label","Previous slide"),o.setAttribute("aria-controls",t.id),o.setAttribute("tabindex","0"),o.tagName!=="BUTTON"&&o.setAttribute("role","button")),l&&(l.setAttribute("aria-label","Next slide"),l.setAttribute("aria-controls",t.id),l.setAttribute("tabindex","0"),l.tagName!=="BUTTON"&&l.setAttribute("role","button")),r?.length&&r.forEach((i,s)=>{i.tagName!=="BUTTON"&&i.setAttribute("role","button"),i.setAttribute("aria-label",`Go to slide ${s+1}`),i.setAttribute("tabindex","0"),i.setAttribute("aria-controls",t.id);});},z=(e,t,o)=>{if(!e)return;!t&&e===document.activeElement&&o&&o.focus();let l="opacity 0.3s ease",r=t?"1":"0";Object.assign(e.style,{opacity:r,transition:l,pointerEvents:t?"auto":"none"}),t?(e.removeAttribute("aria-hidden"),e.setAttribute("tabindex","0")):(e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1")),t?e.style.visibility="visible":setTimeout(()=>{e.style.opacity==="0"&&(e.style.visibility="hidden");},300);},F=(e,t,o="active")=>{e?.length&&e.forEach((l,r)=>{let a=r===t;l.classList.toggle(o,a),l.setAttribute("aria-selected",a.toString());});},te=(e,t,o,l,r="horizontal")=>{let a=r==="vertical",i=a?"ArrowUp":"ArrowLeft",s=a?"ArrowDown":"ArrowRight";e.addEventListener("keydown",m=>{switch(m.key){case i:m.preventDefault(),t();break;case s:m.preventDefault(),o();break}},{signal:l}),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0");};var g={FRICTION:.94,MIN_VELOCITY:.3,MOMENTUM_RATIO:.8,VELOCITY_SMOOTHING:.4,EDGE_RESISTANCE:.3,MAX_EDGE_OVERSCROLL:100,SHORT_SWIPE_VELOCITY:.5,BOUNCE_DURATION:400},Me=()=>({isDragging:false,startX:0,startY:0,startScrollLeft:0,startScrollTop:0,velocity:0,lastX:0,lastY:0,lastTime:0,momentumId:null}),xe=()=>({...Me(),velocityHistory:[],dragDistance:0,dragStartTime:0}),$=(e,t,o="horizontal")=>{let l=e.getBoundingClientRect(),r=o==="vertical",a=r?l.top:l.left,i=null,s=1/0;for(let m of t){if(m.offsetParent===null)continue;let u=m.getBoundingClientRect(),h=r?u.top:u.left,n=Math.abs(a-h);n<s&&(s=n,i=m);}return i},Ie=(e,t,o,l="horizontal")=>{let r=e.getBoundingClientRect(),a=l==="vertical",i=a?r.top:r.left,s=t.filter(d=>d.offsetParent!==null);if(s.length===0)return null;let m=0,u=1/0;s.forEach((d,v)=>{let b=d.getBoundingClientRect(),P=a?b.top:b.left,I=Math.abs(i-P);I<u&&(u=I,m=v);});let h=2,n=m;return Math.abs(o)>h&&(o>0?n=Math.min(m+1,s.length-1):n=Math.max(m-1,0)),s[n]??null},De=e=>{if(e.length===0)return 0;let t=0,o=0;return e.forEach((l,r)=>{let a=r+1;t+=l*a,o+=a;}),t/o},Ce=(e,t,o,l,r,a="horizontal",i=false)=>{let s=a==="vertical",m=e.velocity*g.MOMENTUM_RATIO,u=()=>{if(Math.abs(m)<g.MIN_VELOCITY){e.momentumId=null;let v=$(t,o,a);if(v){let b=s?v.offsetTop:v.offsetLeft;l(b,H);}r?.(v);return}let h=s?t.scrollHeight-t.clientHeight:t.scrollWidth-t.clientWidth,d=(s?t.scrollTop:t.scrollLeft)+m;i||(d<0||d>h)&&(m*=.5),s?t.scrollTop=Math.max(0,Math.min(h,d)):t.scrollLeft=Math.max(0,Math.min(h,d)),m*=g.FRICTION,e.momentumId=requestAnimationFrame(u);};e.momentumId=requestAnimationFrame(u);},re=e=>"touches"in e?e.touches[0]?.clientX??0:e.clientX,oe=e=>"touches"in e?e.touches[0]?.clientY??0:e.clientY,He=(e,t)=>t==="vertical"?oe(e):re(e),le=e=>{let {feed:t,slides:o,abortSignal:l,smoothScrollTo:r,onDragEnd:a,direction:i="horizontal",loop:s=false,touchRatio:m=1,shortSwipeThreshold:u=300,swipeDistanceThreshold:h=10}=e,n=xe(),d=i==="vertical",v=0,P=()=>{v=d?t.scrollHeight-t.clientHeight:t.scrollWidth-t.clientWidth,d?t.clientHeight:t.clientWidth;},I=L=>{n.momentumId!==null&&(cancelAnimationFrame(n.momentumId),n.momentumId=null),P(),n.isDragging=true,n.startX=re(L),n.startY=oe(L),n.startScrollLeft=t.scrollLeft,n.startScrollTop=t.scrollTop,n.velocity=0,n.lastX=n.startX,n.lastY=n.startY,n.lastTime=performance.now(),n.velocityHistory=[],n.dragDistance=0,n.dragStartTime=performance.now(),t.style.userSelect="none",t.style.cursor="grabbing",t.classList.add("is-dragging"),L.type==="mousedown"&&L.preventDefault();},q=L=>{if(!n.isDragging)return;let A=He(L,i),R=d?n.startY:n.startX,y=d?n.lastY:n.lastX,M=d?n.startScrollTop:n.startScrollLeft,c=performance.now(),f=c-n.lastTime,T=(R-A)*m,p=M+T;if(n.dragDistance=Math.abs(T),!s){if(p<0){let S=Math.abs(p),E=1-Math.min(S/g.MAX_EDGE_OVERSCROLL,1)*(1-g.EDGE_RESISTANCE);p=-S*E;}else if(p>v){let S=p-v,E=1-Math.min(S/g.MAX_EDGE_OVERSCROLL,1)*(1-g.EDGE_RESISTANCE);p=v+S*E;}}if(d?t.scrollTop=p:t.scrollLeft=p,f>0){let S=(y-A)/f*16;if(n.velocityHistory.length>0){let E=n.velocity;n.velocity=E*(1-g.VELOCITY_SMOOTHING)+S*g.VELOCITY_SMOOTHING;}else n.velocity=S;n.velocityHistory.push(S),n.velocityHistory.length>5&&n.velocityHistory.shift();}d?n.lastY=A:n.lastX=A,n.lastTime=c,L.type==="touchmove"&&L.preventDefault();},w=()=>{if(!n.isDragging)return;n.isDragging=false,t.style.userSelect="",t.style.cursor="",t.classList.remove("is-dragging");let A=performance.now()-n.dragStartTime<u&&n.dragDistance>h,R=De(n.velocityHistory);if(!s){let y=d?t.scrollTop:t.scrollLeft;if(y<0||y>v){let M=y<0?0:v,c=y,f=performance.now(),T=()=>{let p=performance.now()-f,S=Math.min(p/g.BOUNCE_DURATION,1),E=H(S),B=c+(M-c)*E;if(d?t.scrollTop=B:t.scrollLeft=B,S<1)requestAnimationFrame(T);else {let D=$(t,o,i);if(D){let x=d?D.offsetTop:D.offsetLeft;r(x,H);}a?.(D);}};requestAnimationFrame(T);return}}if(A||Math.abs(R)>g.SHORT_SWIPE_VELOCITY){let y=Ie(t,o,R,i);if(y){let M=d?y.offsetTop:y.offsetLeft;r(M,H),a?.(y);}else a?.(null);}else if(Math.abs(n.velocity)>1)Ce(n,t,o,r,a,i,s);else {let y=$(t,o,i);if(y){let M=d?y.offsetTop:y.offsetLeft;r(M,H);}a?.(y);}};return t.addEventListener("mousedown",I,{signal:l}),document.addEventListener("mousemove",q,{signal:l}),document.addEventListener("mouseup",w,{signal:l}),t.addEventListener("touchstart",I,{passive:true,signal:l}),t.addEventListener("touchmove",q,{passive:false,signal:l}),t.addEventListener("touchend",w,{signal:l}),t.addEventListener("touchcancel",w,{signal:l}),document.addEventListener("mouseleave",w,{signal:l}),t.style.cursor="grab",n},ie=e=>{e.momentumId!==null&&(cancelAnimationFrame(e.momentumId),e.momentumId=null);};var G=({bulletsContainer:e,slides:t,bulletClass:o,bulletActiveClass:l,feedId:r})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid bulletsContainer: must be a valid HTMLElement");if(!Array.isArray(t)||t.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!r||typeof r!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid bulletClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide navigation");let a=t.map((s,m)=>({slide:s,originalIndex:m})).filter(({slide:s})=>s.offsetParent!==null);return a.length===0?(console.warn("No visible slides found"),[]):a.map(({slide:s,originalIndex:m},u)=>{let h=document.createElement("button");return h.type="button",h.classList.add(o),u===0&&h.classList.add(l),h.setAttribute("role","tab"),h.setAttribute("aria-selected",u===0?"true":"false"),h.setAttribute("aria-controls",r),h.setAttribute("aria-label",`Go to slide ${u+1}`),h.setAttribute("data-slide-index",String(u)),e.appendChild(h),h})};var X=({thumbsContainer:e,slides:t,thumbClass:o,thumbActiveClass:l,feedId:r,thumbImageSelector:a="img",thumbSize:i})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid thumbsContainer: must be a valid HTMLElement");if(!Array.isArray(t)||t.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!r||typeof r!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid thumbClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide thumbnails");let s=t.map((u,h)=>({slide:u,originalIndex:h})).filter(({slide:u})=>u.offsetParent!==null);return s.length===0?(console.warn("No visible slides found"),[]):s.map(({slide:u,originalIndex:h},n)=>{let d=document.createElement("button");d.type="button",d.classList.add(o),n===0&&d.classList.add(l);let v=u.querySelector(a);if(v?.src){let b=document.createElement("img");b.src=v.src,b.alt=v.alt||`Slide ${n+1} thumbnail`,b.draggable=false,i&&(b.style.width=`${i.width}px`,b.style.height=`${i.height}px`,b.style.objectFit="cover"),d.appendChild(b);}return d.setAttribute("role","tab"),d.setAttribute("aria-selected",n===0?"true":"false"),d.setAttribute("aria-controls",r),d.setAttribute("aria-label",`Go to slide ${n+1}`),d.setAttribute("data-slide-index",String(n)),e.appendChild(d),d})};var ne=()=>({initialized:false,clonedSlides:[],styleElement:null}),ae=()=>{let e=document.getElementById("lazer-marquee-keyframes");if(e)return e;let t=document.createElement("style");return t.id="lazer-marquee-keyframes",t.textContent=`
2
2
  @keyframes lazer-marquee-scroll {
3
3
  0% {
4
4
  transform: translateX(0);
@@ -7,4 +7,4 @@
7
7
  transform: translateX(-50%);
8
8
  }
9
9
  }
10
- `,document.head.appendChild(r),r},Le=(e,r)=>{r.initialized||(r.styleElement=oe(),e.feed.style.display="flex",e.feed.style.willChange="transform",e.slides.forEach(o=>{let t=o.cloneNode(true);t.setAttribute("data-lazer-marquee-clone","true"),t.setAttribute("aria-hidden","true"),e.feed.appendChild(t),r.clonedSlides.push(t);}),r.initialized=true);},ie=e=>{e.initialized&&(e.clonedSlides.forEach(r=>{r.remove();}),e.clonedSlides=[],e.initialized=false);},Ae=(e,r)=>{oe(),requestAnimationFrame(()=>{let o=e.feed.scrollWidth,t=e.marqueeSpeed??50,u=e.marqueeDirection??"left",n=o/2;if(n<=0||t<=0){console.warn("[lazer-slider] Invalid marquee values:",{distance:n,speed:t,scrollWidth:o});return}let S=`lazer-marquee-scroll ${n/t}s linear infinite ${u==="right"?"reverse":"normal"}`;e.feed.style.animation="none",e.feed.offsetWidth,e.feed.style.animation=S,e.feed.style.animationPlayState=r.marqueePaused?"paused":"running";});},F=(e,r)=>{Ae(e,r);},ne=(e,r)=>{r.feed.style.animation="",r.feed.style.animationPlayState="",r.feed.style.transform="",r.feed.style.willChange="";},R=(e,r)=>{e.marqueePaused=true,r.feed.style.animationPlayState="paused";},z=(e,r)=>{e.marqueePaused=false,r.feed.style.animationPlayState="running";},ae=(e,r,o)=>{e.marquee&&(Le(e,o),F(e,r));},de=(e,r,o)=>{!e.marquee||e.pauseOnHover===false||(e.feed.addEventListener("mouseenter",()=>R(r,e),{signal:o}),e.feed.addEventListener("mouseleave",()=>z(r,e),{signal:o}),e.feed.addEventListener("touchstart",()=>R(r,e),{passive:true,signal:o}),e.feed.addEventListener("touchend",()=>z(r,e),{signal:o}));};var H={MIN_DURATION:400,MAX_DURATION:1e3,SPEED_FACTOR:1.5,SCROLL_END_DELAY:50,THUMB_UPDATE_DELAY:500},xe="(min-width: 64rem)",Me=e=>{if(!e.feed)throw new Error("lazer-slider: feed element is required");if(!e.slides?.length)throw new Error("lazer-slider: slides array is required and must not be empty");if(e.feed.id||(e.feed.id=`lazer-slider-feed-${Math.random().toString(36).substr(2,9)}`),e.bulletsContainer&&!e.thumbs){let l=k({bulletsContainer:e.bulletsContainer,slides:e.slides,bulletClass:e.bulletsClass??"slider-bullet",bulletActiveClass:e.bulletsActiveClass??"active",feedId:e.feed.id});e.thumbs=l;}if(e.thumbsContainer&&!e.thumbs){let l=$({thumbsContainer:e.thumbsContainer,slides:e.slides,thumbClass:e.thumbsClass??"slider-thumb",thumbActiveClass:e.thumbsActiveClass??"active",feedId:e.feed.id,thumbImageSelector:e.thumbImageSelector??"img",thumbSize:e.thumbSize});e.thumbs=l;}let r=e.direction??"horizontal",o=r==="vertical",t={currentSlideIndex:0,isScrolling:false,ticking:false,cachedFeedRect:null,lastWidth:0,updateThumbTimeout:null,scrollEndTimeout:null,abortController:new AbortController,autoplayIntervalId:null,autoplayPaused:false,marqueePaused:false,isLoopRepositioning:false},u=null,n={initialized:false,clonedSlides:[],realSlides:[...e.slides],clonesPerSide:0},f=le(),i=e.easing??O,S=()=>{let l=o?e.feed.clientHeight:e.feed.clientWidth;return (!t.cachedFeedRect||t.lastWidth!==l)&&(t.cachedFeedRect=e.feed.getBoundingClientRect(),t.lastWidth=l),t.cachedFeedRect},h=()=>e.slides.filter(l=>l.offsetParent!==null),p=()=>window.matchMedia(xe).matches,b=()=>{let l=p()?e.desktopSlidesPerView:e.mobileSlidesPerView;return !l||l==="auto"?1:Math.ceil(l)},m=()=>{if(!e.loop||n.initialized)return;let l=n.realSlides,d=b();n.clonesPerSide=d;for(let c=l.length-d;c<l.length;c++){let a=l[c];if(!a)continue;let s=a.cloneNode(true);s.setAttribute("data-lazer-clone","prepend"),s.setAttribute("aria-hidden","true"),e.feed.insertBefore(s,e.feed.firstChild),n.clonedSlides.push(s);}for(let c=0;c<d;c++){let a=l[c];if(!a)continue;let s=a.cloneNode(true);s.setAttribute("data-lazer-clone","append"),s.setAttribute("aria-hidden","true"),e.feed.appendChild(s),n.clonedSlides.push(s);}requestAnimationFrame(()=>{let c=l[0];c&&(o?e.feed.scrollTop=c.offsetTop:e.feed.scrollLeft=c.offsetLeft);}),n.initialized=true;},T=l=>{if(!e.loop||!n.initialized)return;t.isLoopRepositioning=true;let d=n.realSlides,c=d.length;if(l==="next"){let a=d[0];a&&(o?e.feed.scrollTop=a.offsetTop:e.feed.scrollLeft=a.offsetLeft),t.currentSlideIndex=0;}else {let a=d[c-1];a&&(o?e.feed.scrollTop=a.offsetTop:e.feed.scrollLeft=a.offsetLeft),t.currentSlideIndex=c-1;}requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.isLoopRepositioning=false,q();});});},v=()=>{n.initialized&&(n.clonedSlides.forEach(l=>{l.remove();}),n.clonedSlides=[],n.initialized=false,n.clonesPerSide=0);},A=()=>{let l=p()?e.desktopSlidesPerView:e.mobileSlidesPerView,d=e.slideGap??0;if(d>0&&(e.feed.style.gap=`${d}px`),!l||l==="auto"){e.slides.forEach(s=>{s.style.flex="",s.style.minWidth="",s.style.minHeight="";});return}let a=`calc((100% - ${d*(l-1)}px) / ${l})`;o?e.slides.forEach(s=>{s.style.flex=`0 0 ${a}`,s.style.minHeight=a,s.style.minWidth="";}):e.slides.forEach(s=>{s.style.flex=`0 0 ${a}`,s.style.minWidth=a,s.style.minHeight="";});},E=()=>{if(!e.scrollbarThumb)return;let l=S();if(o){let d=l.height/e.feed.scrollHeight*100;e.scrollbarThumb.style.height=`${d}%`,e.scrollbarThumb.style.width="";}else {let d=l.width/e.feed.scrollWidth*100;e.scrollbarThumb.style.width=`${d}%`,e.scrollbarThumb.style.height="";}},x=()=>{if(!(!e.scrollbarThumb||!e.scrollbarTrack))if(o){let l=e.scrollbarTrack.getBoundingClientRect().height,d=e.scrollbarThumb.getBoundingClientRect().height,c=l-d,a=e.feed.scrollHeight-e.feed.clientHeight,s=a>0?e.feed.scrollTop/a:0;e.scrollbarThumb.style.transform=`translateY(${c*s}px)`;}else {let l=e.scrollbarTrack.getBoundingClientRect().width,d=e.scrollbarThumb.getBoundingClientRect().width,c=l-d,a=e.feed.scrollWidth-e.feed.clientWidth,s=a>0?e.feed.scrollLeft/a:0;e.scrollbarThumb.style.transform=`translateX(${c*s}px)`;}},q=()=>{if(t.isLoopRepositioning)return;let l=S(),d,c,a;if(o?(d=e.feed.scrollTop<=1,c=e.feed.scrollTop+l.height>=e.feed.scrollHeight-1,a=e.feed.scrollHeight<=l.height):(d=e.feed.scrollLeft<=1,c=e.feed.scrollLeft+l.width>=e.feed.scrollWidth-1,a=e.feed.scrollWidth<=l.width),e.scrollbarTrack&&(e.scrollbarTrack.style.display=a?"none":"block"),e.loop){C(e.prevSlideButton,!a,e.feed),C(e.nextSlideButton,!a,e.feed);return}C(e.prevSlideButton,!d&&!a,e.feed),C(e.nextSlideButton,!c&&!a,e.feed);},B=()=>{let l=S(),d=n.initialized?n.realSlides:h(),c=d.filter(a=>{let s=a.getBoundingClientRect(),y=20;return o?s.bottom>l.top+y&&s.top<l.bottom-y:s.right>l.left+y&&s.left<l.right-y});if(c.length&&c[0]){let a=d.indexOf(c[0]);if(a!==-1){t.currentSlideIndex=a;let s=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScroll?.({currentScroll:s,currentSlideIndex:t.currentSlideIndex});}}},M=(l,d=i,c)=>{let a=o?e.feed.scrollTop:e.feed.scrollLeft,s=Math.abs(l-a),y=Math.min(H.MAX_DURATION,Math.max(H.MIN_DURATION,s/H.SPEED_FACTOR)),N=performance.now(),g=I=>{let w=(I-N)/y,G=Math.min(w,1),he=d(G),j=a+(l-a)*he;o?e.feed.scrollTop=j:e.feed.scrollLeft=j,G<1?requestAnimationFrame(g):(o?e.feed.scrollTop=l:e.feed.scrollLeft=l,c?.());};requestAnimationFrame(g);},se=l=>{if(!e.thumbs)return;let d=e.thumbs.indexOf(l);if(d===-1||!e.slides[d])return;t.currentSlideIndex=d,D(e.thumbs,d),t.isScrolling=true,t.updateThumbTimeout&&clearTimeout(t.updateThumbTimeout),t.updateThumbTimeout=setTimeout(()=>{t.isScrolling=false;},H.THUMB_UPDATE_DELAY);let c=o?e.slides[d].offsetTop:e.slides[d].offsetLeft;M(c);},L=l=>{let d=n.initialized?n.realSlides:h(),c=p()?e.desktopSlidesPerScroll??1:e.mobileSlidesPerScroll??1,a=d.length;B();let s,y=false;if(l==="prev")if(e.loop&&n.initialized&&t.currentSlideIndex===0){let I=n.clonedSlides.filter(w=>w.getAttribute("data-lazer-clone")==="prepend");s=I[I.length-1],y=true;}else t.currentSlideIndex=Math.max(0,t.currentSlideIndex-c),s=d[t.currentSlideIndex];else e.loop&&n.initialized&&t.currentSlideIndex>=a-1?(s=n.clonedSlides.filter(w=>w.getAttribute("data-lazer-clone")==="append")[0],y=true):(t.currentSlideIndex=Math.min(a-1,t.currentSlideIndex+c),s=d[t.currentSlideIndex]);if(!s)return;let N=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollStart?.({currentScroll:N,target:s,direction:l});let g=o?s.offsetTop:s.offsetLeft;y?M(g,i,()=>{T(l);}):M(g);},ce=()=>{x(),q(),B(),t.isScrolling||D(e.thumbs,t.currentSlideIndex),t.scrollEndTimeout&&clearTimeout(t.scrollEndTimeout),t.scrollEndTimeout=setTimeout(()=>{t.isScrolling=false;let l=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollEnd?.({currentScroll:l,currentSlideIndex:t.currentSlideIndex});},H.SCROLL_END_DELAY);},ue=()=>{t.ticking||(requestAnimationFrame(()=>{ce(),t.ticking=false;}),t.ticking=true);},W=()=>{t.cachedFeedRect=null,U();},fe=()=>{let{signal:l}=t.abortController;window.addEventListener("resize",W),e.feed.addEventListener("scroll",ue,{passive:true,signal:l}),e.prevSlideButton&&e.prevSlideButton.addEventListener("click",()=>L("prev"),{signal:l}),e.nextSlideButton&&e.nextSlideButton.addEventListener("click",()=>L("next"),{signal:l}),e.thumbs?.length&&(e.thumbs[0]?.classList.add("active"),e.thumbs.forEach(d=>{d.addEventListener("click",()=>se(d),{signal:l});})),Q(e.feed,()=>L("prev"),()=>L("next"),l,r),e.enableDragToScroll!==false&&(u=te({feed:e.feed,slides:e.slides,abortSignal:l,smoothScrollTo:M,onDragEnd:()=>{B(),D(e.thumbs,t.currentSlideIndex);},direction:r})),e.autoplay&&e.pauseOnHover!==false&&(e.feed.addEventListener("mouseenter",Y,{signal:l}),e.feed.addEventListener("mouseleave",_,{signal:l}),e.feed.addEventListener("touchstart",Y,{passive:true,signal:l}),e.feed.addEventListener("touchend",_,{signal:l})),de(e,t,l);},V=()=>{if(t.autoplayIntervalId)return;let l=e.autoplayInterval??3e3;t.autoplayIntervalId=setInterval(()=>{t.autoplayPaused||L("next");},l);},X=()=>{t.autoplayIntervalId&&(clearInterval(t.autoplayIntervalId),t.autoplayIntervalId=null);},Y=()=>{t.autoplayPaused=true;},_=()=>{t.autoplayPaused=false;},me=l=>{let d=n.initialized?n.realSlides:h(),c=Math.max(0,Math.min(l,d.length-1)),a=d[c];if(!a)return;t.currentSlideIndex=c,D(e.thumbs,c);let s=o?a.offsetTop:a.offsetLeft;M(s);},U=()=>{t.cachedFeedRect=null,A(),E(),q(),e.marquee&&!t.marqueePaused&&F(e,t);},pe=()=>{X(),ne(t,e),t.abortController.abort(),window.removeEventListener("resize",W),t.updateThumbTimeout&&clearTimeout(t.updateThumbTimeout),t.scrollEndTimeout&&clearTimeout(t.scrollEndTimeout),u&&re(u),v(),ie(f),t.cachedFeedRect=null;};return K(e),A(),e.marquee?ae(e,t,f):(m(),e.autoplay&&V()),q(),fe(),E(),{goToIndex:me,refresh:U,unload:pe,play:()=>{e.marquee?t.marqueePaused?z(t,e):F(e,t):e.autoplay&&V();},pause:()=>{e.marquee?R(t,e):X();},next:()=>L("next"),prev:()=>L("prev")}};exports.createSlider=Me;exports.easeInOutCubic=Se;exports.easeOutCubic=P;exports.easeOutExpo=O;exports.easeOutQuad=be;exports.generateBullets=k;exports.generateThumbs=$;exports.linear=ve;
10
+ `,document.head.appendChild(t),t},we=(e,t)=>{t.initialized||(t.styleElement=ae(),e.feed.style.display="flex",e.feed.style.willChange="transform",e.slides.forEach(o=>{let l=o.cloneNode(true);l.setAttribute("data-lazer-marquee-clone","true"),l.setAttribute("aria-hidden","true"),e.feed.appendChild(l),t.clonedSlides.push(l);}),t.initialized=true);},se=e=>{e.initialized&&(e.clonedSlides.forEach(t=>{t.remove();}),e.clonedSlides=[],e.initialized=false);},Re=(e,t)=>{ae(),requestAnimationFrame(()=>{let o=e.feed.scrollWidth,l=e.marqueeSpeed??50,r=e.marqueeDirection??"left",a=o/2;if(a<=0||l<=0){console.warn("[lazer-slider] Invalid marquee values:",{distance:a,speed:l,scrollWidth:o});return}let m=`lazer-marquee-scroll ${a/l}s linear infinite ${r==="right"?"reverse":"normal"}`;e.feed.style.animation="none",e.feed.offsetWidth,e.feed.style.animation=m,e.feed.style.animationPlayState=t.marqueePaused?"paused":"running";});},V=(e,t)=>{Re(e,t);},ce=(e,t)=>{t.feed.style.animation="",t.feed.style.animationPlayState="",t.feed.style.transform="",t.feed.style.willChange="";},_=(e,t)=>{e.marqueePaused=true,t.feed.style.animationPlayState="paused";},k=(e,t)=>{e.marqueePaused=false,t.feed.style.animationPlayState="running";},de=(e,t,o)=>{e.marquee&&(we(e,o),V(e,t));},ue=(e,t,o)=>{!e.marquee||e.pauseOnHover===false||(e.feed.addEventListener("mouseenter",()=>_(t,e),{signal:o}),e.feed.addEventListener("mouseleave",()=>k(t,e),{signal:o}),e.feed.addEventListener("touchstart",()=>_(t,e),{passive:true,signal:o}),e.feed.addEventListener("touchend",()=>k(t,e),{signal:o}));};var me=e=>({initialized:false,clonedSlides:[],realSlides:[...e],clonesPerSide:0}),Oe=e=>{let t=O()?e.desktopSlidesPerView:e.mobileSlidesPerView;return !t||t==="auto"?1:Math.ceil(t)},fe=(e,t,o)=>{if(!e.loop||t.initialized)return;let l=t.realSlides,r=Oe(e);t.clonesPerSide=r;for(let a=l.length-r;a<l.length;a++){let i=l[a];if(!i)continue;let s=i.cloneNode(true);s.setAttribute("data-lazer-clone","prepend"),s.setAttribute("aria-hidden","true"),e.feed.insertBefore(s,e.feed.firstChild),t.clonedSlides.push(s);}for(let a=0;a<r;a++){let i=l[a];if(!i)continue;let s=i.cloneNode(true);s.setAttribute("data-lazer-clone","append"),s.setAttribute("aria-hidden","true"),e.feed.appendChild(s),t.clonedSlides.push(s);}requestAnimationFrame(()=>{let a=l[0];a&&(o?e.feed.scrollTop=a.offsetTop:e.feed.scrollLeft=a.offsetLeft);}),t.initialized=true;},U=(e,t,o,l,r,a,i)=>{if(!t.loop||!o.initialized)return;a(true);let s=o.realSlides,m=s.length;if(e==="next"){let u=s[0];u&&(l?t.feed.scrollTop=u.offsetTop:t.feed.scrollLeft=u.offsetLeft),r(0);}else {let u=s[m-1];u&&(l?t.feed.scrollTop=u.offsetTop:t.feed.scrollLeft=u.offsetLeft),r(m-1);}requestAnimationFrame(()=>{requestAnimationFrame(()=>{a(false),i();});});},pe=e=>{e.initialized&&(e.clonedSlides.forEach(t=>{t.remove();}),e.clonedSlides=[],e.initialized=false,e.clonesPerSide=0);};var j=(e,t,o)=>{if(t.autoplayIntervalId)return;let l=e.autoplayInterval??3e3;t.autoplayIntervalId=setInterval(()=>{t.autoplayPaused||o("next");},l);},K=e=>{e.autoplayIntervalId&&(clearInterval(e.autoplayIntervalId),e.autoplayIntervalId=null);},Se=e=>{e.autoplayPaused=true;},he=e=>{e.autoplayPaused=false;},be=(e,t,o)=>{!e.autoplay||e.pauseOnHover===false||(e.feed.addEventListener("mouseenter",()=>Se(t),{signal:o}),e.feed.addEventListener("mouseleave",()=>he(t),{signal:o}),e.feed.addEventListener("touchstart",()=>Se(t),{passive:true,signal:o}),e.feed.addEventListener("touchend",()=>he(t),{signal:o}));};var Q=(e,t,o)=>{if(e.scrollbarThumb)if(o){let l=t.height/e.feed.scrollHeight*100;e.scrollbarThumb.style.height=`${l}%`,e.scrollbarThumb.style.width="";}else {let l=t.width/e.feed.scrollWidth*100;e.scrollbarThumb.style.width=`${l}%`,e.scrollbarThumb.style.height="";}},Te=(e,t)=>{if(!(!e.scrollbarThumb||!e.scrollbarTrack))if(t){let o=e.scrollbarTrack.getBoundingClientRect().height,l=e.scrollbarThumb.getBoundingClientRect().height,r=o-l,a=e.feed.scrollHeight-e.feed.clientHeight,i=a>0?e.feed.scrollTop/a:0;e.scrollbarThumb.style.transform=`translateY(${r*i}px)`;}else {let o=e.scrollbarTrack.getBoundingClientRect().width,l=e.scrollbarThumb.getBoundingClientRect().width,r=o-l,a=e.feed.scrollWidth-e.feed.clientWidth,i=a>0?e.feed.scrollLeft/a:0;e.scrollbarThumb.style.transform=`translateX(${r*i}px)`;}};var J=(e,t,o,l=N,r)=>{let a=o?e.scrollTop:e.scrollLeft,i=Math.abs(t-a),s=Math.min(C.MAX_DURATION,Math.max(C.MIN_DURATION,i/C.SPEED_FACTOR)),m=performance.now(),u=h=>{let n=(h-m)/s,d=Math.min(n,1),v=l(d),b=a+(t-a)*v;o?e.scrollTop=b:e.scrollLeft=b,d<1?requestAnimationFrame(u):(o?e.scrollTop=t:e.scrollLeft=t,r?.());};requestAnimationFrame(u);},W=e=>e.filter(t=>t.offsetParent!==null),Z=(e,t,o)=>{let l=o?e.desktopSlidesPerView:e.mobileSlidesPerView,r=e.slideGap??0;if(r>0&&(e.feed.style.gap=`${r}px`),!l||l==="auto"){e.slides.forEach(s=>{s.style.flex="",s.style.minWidth="",s.style.minHeight="";});return}let i=`calc((100% - ${r*(l-1)}px) / ${l})`;t?e.slides.forEach(s=>{s.style.flex=`0 0 ${i}`,s.style.minHeight=i,s.style.minWidth="";}):e.slides.forEach(s=>{s.style.flex=`0 0 ${i}`,s.style.minWidth=i,s.style.minHeight="";});},ve=(e,t,o,l)=>{let r=l?e.clientHeight:e.clientWidth;return !t||o!==r?{rect:e.getBoundingClientRect(),size:r}:{rect:t,size:o}};var Pe=e=>{if(!e.feed)throw new Error("lazer-slider: feed element is required");if(!e.slides?.length)throw new Error("lazer-slider: slides array is required and must not be empty");if(e.feed.id||(e.feed.id=`lazer-slider-feed-${Math.random().toString(36).substr(2,9)}`),e.bulletsContainer&&!e.thumbs){let c=G({bulletsContainer:e.bulletsContainer,slides:e.slides,bulletClass:e.bulletsClass??"slider-bullet",bulletActiveClass:e.bulletsActiveClass??"active",feedId:e.feed.id});e.thumbs=c;}if(e.thumbsContainer&&!e.thumbs){let c=X({thumbsContainer:e.thumbsContainer,slides:e.slides,thumbClass:e.thumbsClass??"slider-thumb",thumbActiveClass:e.thumbsActiveClass??"active",feedId:e.feed.id,thumbImageSelector:e.thumbImageSelector??"img",thumbSize:e.thumbSize});e.thumbs=c;}let t=e.direction??"horizontal",o=t==="vertical",l=e.easing??N,r={currentSlideIndex:0,isScrolling:false,ticking:false,cachedFeedRect:null,lastWidth:0,updateThumbTimeout:null,scrollEndTimeout:null,abortController:new AbortController,autoplayIntervalId:null,autoplayPaused:false,marqueePaused:false,isLoopRepositioning:false},a=null,i=me(e.slides),s=ne(),m=()=>{let c=ve(e.feed,r.cachedFeedRect,r.lastWidth,o);return r.cachedFeedRect=c.rect,r.lastWidth=c.size,c.rect},u=(c,f)=>{J(e.feed,c,o,l,f);},h=(c,f)=>{J(e.feed,c,o,f??l);},n=()=>{if(r.isLoopRepositioning)return;let c=m(),f,T,p;if(o?(f=e.feed.scrollTop<=1,T=e.feed.scrollTop+c.height>=e.feed.scrollHeight-1,p=e.feed.scrollHeight<=c.height):(f=e.feed.scrollLeft<=1,T=e.feed.scrollLeft+c.width>=e.feed.scrollWidth-1,p=e.feed.scrollWidth<=c.width),e.scrollbarTrack&&(e.scrollbarTrack.style.display=p?"none":"block"),e.loop){z(e.prevSlideButton,!p,e.feed),z(e.nextSlideButton,!p,e.feed);return}z(e.prevSlideButton,!f&&!p,e.feed),z(e.nextSlideButton,!T&&!p,e.feed);},d=()=>{let c=m(),f=i.initialized?i.realSlides:W(e.slides),T=f.filter(p=>{let S=p.getBoundingClientRect(),E=20;return o?S.bottom>c.top+E&&S.top<c.bottom-E:S.right>c.left+E&&S.left<c.right-E});if(T.length&&T[0]){let p=f.indexOf(T[0]);if(p!==-1){r.currentSlideIndex=p;let S=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScroll?.({currentScroll:S,currentSlideIndex:r.currentSlideIndex});}}},v=c=>{if(!e.thumbs)return;let f=e.thumbs.indexOf(c);if(f===-1||!e.slides[f])return;r.currentSlideIndex=f,F(e.thumbs,f),r.isScrolling=true,r.updateThumbTimeout&&clearTimeout(r.updateThumbTimeout),r.updateThumbTimeout=setTimeout(()=>{r.isScrolling=false;},C.THUMB_UPDATE_DELAY);let T=o?e.slides[f].offsetTop:e.slides[f].offsetLeft;u(T);},b=c=>{let f=i.initialized?i.realSlides:W(e.slides),T=O()?e.desktopSlidesPerScroll??1:e.mobileSlidesPerScroll??1,p=f.length;d();let S,E=false;if(c==="prev")if(e.loop&&i.initialized&&r.currentSlideIndex===0){let x=i.clonedSlides.filter(Y=>Y.getAttribute("data-lazer-clone")==="prepend");S=x[x.length-1],E=true;}else r.currentSlideIndex=Math.max(0,r.currentSlideIndex-T),S=f[r.currentSlideIndex];else e.loop&&i.initialized&&r.currentSlideIndex>=p-1?(S=i.clonedSlides.filter(Y=>Y.getAttribute("data-lazer-clone")==="append")[0],E=true):(r.currentSlideIndex=Math.min(p-1,r.currentSlideIndex+T),S=f[r.currentSlideIndex]);if(!S)return;let B=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollStart?.({currentScroll:B,target:S,direction:c});let D=o?S.offsetTop:S.offsetLeft;E?u(D,()=>{U(c,e,i,o,x=>{r.currentSlideIndex=x;},x=>{r.isLoopRepositioning=x;},n);}):u(D);},P=()=>{Te(e,o),n(),d(),r.isScrolling||F(e.thumbs,r.currentSlideIndex),r.scrollEndTimeout&&clearTimeout(r.scrollEndTimeout),r.scrollEndTimeout=setTimeout(()=>{r.isScrolling=false;let c=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollEnd?.({currentScroll:c,currentSlideIndex:r.currentSlideIndex});},C.SCROLL_END_DELAY);},I=()=>{r.ticking||(requestAnimationFrame(()=>{P(),r.ticking=false;}),r.ticking=true);},q=()=>{r.cachedFeedRect=null,A();},w=()=>{let{signal:c}=r.abortController;if(window.addEventListener("resize",q),e.feed.addEventListener("scroll",I,{passive:true,signal:c}),e.prevSlideButton&&e.prevSlideButton.addEventListener("click",()=>b("prev"),{signal:c}),e.nextSlideButton&&e.nextSlideButton.addEventListener("click",()=>b("next"),{signal:c}),e.thumbs?.length&&(e.thumbs[0]?.classList.add("active"),e.thumbs.forEach(f=>{f.addEventListener("click",()=>v(f),{signal:c});})),te(e.feed,()=>b("prev"),()=>b("next"),c,t),e.enableDragToScroll!==false){let f=e.loop&&i.initialized?[...i.realSlides,...i.clonedSlides]:e.slides;a=le({feed:e.feed,slides:f,abortSignal:c,smoothScrollTo:h,onDragEnd:T=>{if(T&&e.loop&&i.initialized){let p=T.getAttribute("data-lazer-clone");if(p){let S=p==="append"?"next":"prev";setTimeout(()=>{U(S,e,i,o,E=>{r.currentSlideIndex=E;},E=>{r.isLoopRepositioning=E;},n);},50);}}d(),F(e.thumbs,r.currentSlideIndex);},direction:t,loop:e.loop});}be(e,r,c),ue(e,r,c);},L=c=>{let f=i.initialized?i.realSlides:W(e.slides),T=Math.max(0,Math.min(c,f.length-1)),p=f[T];if(!p)return;r.currentSlideIndex=T,F(e.thumbs,T);let S=o?p.offsetTop:p.offsetLeft;u(S);},A=()=>{r.cachedFeedRect=null,Z(e,o,O()),Q(e,m(),o),n(),e.marquee&&!r.marqueePaused&&V(e,r);},R=()=>{K(r),ce(r,e),r.abortController.abort(),window.removeEventListener("resize",q),r.updateThumbTimeout&&clearTimeout(r.updateThumbTimeout),r.scrollEndTimeout&&clearTimeout(r.scrollEndTimeout),a&&ie(a),pe(i),se(s),r.cachedFeedRect=null;},y=()=>{e.marquee?r.marqueePaused?k(r,e):V(e,r):e.autoplay&&j(e,r,b);},M=()=>{e.marquee?_(r,e):K(r);};return ee(e),Z(e,o,O()),e.marquee?de(e,r,s):(fe(e,i,o),e.autoplay&&j(e,r,b)),n(),w(),Q(e,m(),o),{goToIndex:L,refresh:A,unload:R,play:y,pause:M,next:()=>b("next"),prev:()=>b("prev")}};exports.createSlider=Pe;exports.easeInOutCubic=ye;exports.easeOutCubic=H;exports.easeOutExpo=N;exports.easeOutQuad=Le;exports.generateBullets=G;exports.generateThumbs=X;exports.linear=ge;
package/dist/index.d.cts CHANGED
@@ -18,20 +18,15 @@ type MarqueeDirection = 'left' | 'right';
18
18
  * Parameters passed to scroll start callback
19
19
  */
20
20
  interface ScrollStartParams {
21
- /** Current scroll position in pixels */
22
21
  currentScroll: number;
23
- /** Target slide element being scrolled to */
24
22
  target: HTMLElement;
25
- /** Direction of the scroll */
26
23
  direction: SliderNavDirection;
27
24
  }
28
25
  /**
29
26
  * Parameters passed to scroll and scroll end callbacks
30
27
  */
31
28
  interface ScrollParams {
32
- /** Current scroll position in pixels */
33
29
  currentScroll: number;
34
- /** Index of the current/active slide */
35
30
  currentSlideIndex: number;
36
31
  }
37
32
  /**
package/dist/index.d.ts CHANGED
@@ -18,20 +18,15 @@ type MarqueeDirection = 'left' | 'right';
18
18
  * Parameters passed to scroll start callback
19
19
  */
20
20
  interface ScrollStartParams {
21
- /** Current scroll position in pixels */
22
21
  currentScroll: number;
23
- /** Target slide element being scrolled to */
24
22
  target: HTMLElement;
25
- /** Direction of the scroll */
26
23
  direction: SliderNavDirection;
27
24
  }
28
25
  /**
29
26
  * Parameters passed to scroll and scroll end callbacks
30
27
  */
31
28
  interface ScrollParams {
32
- /** Current scroll position in pixels */
33
29
  currentScroll: number;
34
- /** Index of the current/active slide */
35
30
  currentSlideIndex: number;
36
31
  }
37
32
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var O=e=>e===1?1:1-Math.pow(2,-10*e),P=e=>1-Math.pow(1-e,3),Se=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,be=e=>1-(1-e)*(1-e),ve=e=>e;var Te=()=>`slider-${Math.random().toString(36).substring(2,9)}`,K=e=>{let{feed:r,prevSlideButton:o,nextSlideButton:t,thumbs:u,slides:n}=e;r.id||(r.id=Te()),r.setAttribute("role","region"),r.setAttribute("aria-label","Carousel"),r.setAttribute("aria-roledescription","carousel"),r.removeAttribute("tabindex"),n.forEach((f,i)=>{f.setAttribute("role","group"),f.setAttribute("aria-roledescription","slide"),f.setAttribute("aria-label",`Slide ${i+1} of ${n.length}`);}),o&&(o.setAttribute("aria-label","Previous slide"),o.setAttribute("aria-controls",r.id),o.setAttribute("tabindex","0"),o.tagName!=="BUTTON"&&o.setAttribute("role","button")),t&&(t.setAttribute("aria-label","Next slide"),t.setAttribute("aria-controls",r.id),t.setAttribute("tabindex","0"),t.tagName!=="BUTTON"&&t.setAttribute("role","button")),u?.length&&u.forEach((f,i)=>{f.tagName!=="BUTTON"&&f.setAttribute("role","button"),f.setAttribute("aria-label",`Go to slide ${i+1}`),f.setAttribute("tabindex","0"),f.setAttribute("aria-controls",r.id);});},C=(e,r,o)=>{if(!e)return;!r&&e===document.activeElement&&o&&o.focus();let t="opacity 0.3s ease",u=r?"1":"0";Object.assign(e.style,{opacity:u,transition:t,pointerEvents:r?"auto":"none"}),r?(e.removeAttribute("aria-hidden"),e.setAttribute("tabindex","0")):(e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1")),r?e.style.visibility="visible":setTimeout(()=>{e.style.opacity==="0"&&(e.style.visibility="hidden");},300);},D=(e,r,o="active")=>{e?.length&&e.forEach((t,u)=>{let n=u===r;t.classList.toggle(o,n),t.setAttribute("aria-selected",n.toString());});},Q=(e,r,o,t,u="horizontal")=>{let n=u==="vertical",f=n?"ArrowUp":"ArrowLeft",i=n?"ArrowDown":"ArrowRight";e.addEventListener("keydown",S=>{switch(S.key){case f:S.preventDefault(),r();break;case i:S.preventDefault(),o();break}},{signal:t}),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0");};var ye=()=>({isDragging:false,startX:0,startY:0,startScrollLeft:0,startScrollTop:0,velocity:0,lastX:0,lastY:0,lastTime:0,momentumId:null}),ee=(e,r,o="horizontal")=>{let t=e.getBoundingClientRect(),u=o==="vertical",n=u?t.top+t.height/2:t.left+t.width/2,f=null,i=1/0;for(let S of r){if(S.offsetParent===null)continue;let h=S.getBoundingClientRect(),p=u?h.top+h.height/2:h.left+h.width/2,b=Math.abs(n-p);b<i&&(i=b,f=S);}return f},Ee=(e,r,o,t,u,n="horizontal")=>{let S=n==="vertical",h=()=>{if(Math.abs(e.velocity)<.5){e.momentumId=null;let p=ee(r,o,n);if(p){let b=S?p.offsetTop:p.offsetLeft;t(b,P);}u?.();return}S?r.scrollTop+=e.velocity:r.scrollLeft+=e.velocity,e.velocity*=.95,e.momentumId=requestAnimationFrame(h);};e.momentumId=requestAnimationFrame(h);},J=e=>"touches"in e?e.touches[0]?.clientX??0:e.clientX,Z=e=>"touches"in e?e.touches[0]?.clientY??0:e.clientY,te=e=>{let{feed:r,slides:o,abortSignal:t,smoothScrollTo:u,onDragEnd:n,direction:f="horizontal"}=e,i=ye(),S=f==="vertical",h=m=>{i.momentumId!==null&&(cancelAnimationFrame(i.momentumId),i.momentumId=null),i.isDragging=true,i.startX=J(m),i.startY=Z(m),i.startScrollLeft=r.scrollLeft,i.startScrollTop=r.scrollTop,i.velocity=0,i.lastX=i.startX,i.lastY=i.startY,i.lastTime=performance.now(),r.style.userSelect="none",r.classList.add("is-dragging"),m.type==="mousedown"&&m.preventDefault();},p=m=>{if(!i.isDragging)return;let T=J(m),v=Z(m),A=performance.now(),E=A-i.lastTime;if(S){let x=i.startY-v;r.scrollTop=i.startScrollTop+x,E>0&&(i.velocity=(i.lastY-v)/E*16),i.lastY=v;}else {let x=i.startX-T;r.scrollLeft=i.startScrollLeft+x,E>0&&(i.velocity=(i.lastX-T)/E*16),i.lastX=T;}i.lastTime=A,m.type==="touchmove"&&m.preventDefault();},b=()=>{if(i.isDragging)if(i.isDragging=false,r.style.userSelect="",r.classList.remove("is-dragging"),Math.abs(i.velocity)>1)Ee(i,r,o,u,n,f);else {let m=ee(r,o,f);if(m){let T=S?m.offsetTop:m.offsetLeft;u(T,P);}n?.();}};return r.addEventListener("mousedown",h,{signal:t}),document.addEventListener("mousemove",p,{signal:t}),document.addEventListener("mouseup",b,{signal:t}),r.addEventListener("touchstart",h,{passive:true,signal:t}),r.addEventListener("touchmove",p,{passive:false,signal:t}),r.addEventListener("touchend",b,{signal:t}),document.addEventListener("mouseleave",b,{signal:t}),i},re=e=>{e.momentumId!==null&&(cancelAnimationFrame(e.momentumId),e.momentumId=null);};var k=({bulletsContainer:e,slides:r,bulletClass:o,bulletActiveClass:t,feedId:u})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid bulletsContainer: must be a valid HTMLElement");if(!Array.isArray(r)||r.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!u||typeof u!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid bulletClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide navigation");let n=r.map((i,S)=>({slide:i,originalIndex:S})).filter(({slide:i})=>i.offsetParent!==null);return n.length===0?(console.warn("No visible slides found"),[]):n.map(({slide:i,originalIndex:S},h)=>{let p=document.createElement("button");return p.type="button",p.classList.add(o),h===0&&p.classList.add(t),p.setAttribute("role","tab"),p.setAttribute("aria-selected",h===0?"true":"false"),p.setAttribute("aria-controls",u),p.setAttribute("aria-label",`Go to slide ${h+1}`),p.setAttribute("data-slide-index",String(h)),e.appendChild(p),p})};var $=({thumbsContainer:e,slides:r,thumbClass:o,thumbActiveClass:t,feedId:u,thumbImageSelector:n="img",thumbSize:f})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid thumbsContainer: must be a valid HTMLElement");if(!Array.isArray(r)||r.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!u||typeof u!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid thumbClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide thumbnails");let i=r.map((h,p)=>({slide:h,originalIndex:p})).filter(({slide:h})=>h.offsetParent!==null);return i.length===0?(console.warn("No visible slides found"),[]):i.map(({slide:h,originalIndex:p},b)=>{let m=document.createElement("button");m.type="button",m.classList.add(o),b===0&&m.classList.add(t);let T=h.querySelector(n);if(T?.src){let v=document.createElement("img");v.src=T.src,v.alt=T.alt||`Slide ${b+1} thumbnail`,v.draggable=false,f&&(v.style.width=`${f.width}px`,v.style.height=`${f.height}px`,v.style.objectFit="cover"),m.appendChild(v);}return m.setAttribute("role","tab"),m.setAttribute("aria-selected",b===0?"true":"false"),m.setAttribute("aria-controls",u),m.setAttribute("aria-label",`Go to slide ${b+1}`),m.setAttribute("data-slide-index",String(b)),e.appendChild(m),m})};var le=()=>({initialized:false,clonedSlides:[],styleElement:null}),oe=()=>{let e=document.getElementById("lazer-marquee-keyframes");if(e)return e;let r=document.createElement("style");return r.id="lazer-marquee-keyframes",r.textContent=`
1
+ var C={MIN_DURATION:400,MAX_DURATION:1e3,SPEED_FACTOR:1.5,SCROLL_END_DELAY:50,THUMB_UPDATE_DELAY:500},Ee="(min-width: 64rem)",O=()=>window.matchMedia(Ee).matches;var N=e=>e===1?1:1-Math.pow(2,-10*e),H=e=>1-Math.pow(1-e,3),ye=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,Le=e=>1-(1-e)*(1-e),ge=e=>e;var Ae=()=>`slider-${Math.random().toString(36).substring(2,9)}`,ee=e=>{let{feed:t,prevSlideButton:o,nextSlideButton:l,thumbs:r,slides:a}=e;t.id||(t.id=Ae()),t.setAttribute("role","region"),t.setAttribute("aria-label","Carousel"),t.setAttribute("aria-roledescription","carousel"),t.removeAttribute("tabindex"),a.forEach((i,s)=>{i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-label",`Slide ${s+1} of ${a.length}`);}),o&&(o.setAttribute("aria-label","Previous slide"),o.setAttribute("aria-controls",t.id),o.setAttribute("tabindex","0"),o.tagName!=="BUTTON"&&o.setAttribute("role","button")),l&&(l.setAttribute("aria-label","Next slide"),l.setAttribute("aria-controls",t.id),l.setAttribute("tabindex","0"),l.tagName!=="BUTTON"&&l.setAttribute("role","button")),r?.length&&r.forEach((i,s)=>{i.tagName!=="BUTTON"&&i.setAttribute("role","button"),i.setAttribute("aria-label",`Go to slide ${s+1}`),i.setAttribute("tabindex","0"),i.setAttribute("aria-controls",t.id);});},z=(e,t,o)=>{if(!e)return;!t&&e===document.activeElement&&o&&o.focus();let l="opacity 0.3s ease",r=t?"1":"0";Object.assign(e.style,{opacity:r,transition:l,pointerEvents:t?"auto":"none"}),t?(e.removeAttribute("aria-hidden"),e.setAttribute("tabindex","0")):(e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1")),t?e.style.visibility="visible":setTimeout(()=>{e.style.opacity==="0"&&(e.style.visibility="hidden");},300);},F=(e,t,o="active")=>{e?.length&&e.forEach((l,r)=>{let a=r===t;l.classList.toggle(o,a),l.setAttribute("aria-selected",a.toString());});},te=(e,t,o,l,r="horizontal")=>{let a=r==="vertical",i=a?"ArrowUp":"ArrowLeft",s=a?"ArrowDown":"ArrowRight";e.addEventListener("keydown",m=>{switch(m.key){case i:m.preventDefault(),t();break;case s:m.preventDefault(),o();break}},{signal:l}),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0");};var g={FRICTION:.94,MIN_VELOCITY:.3,MOMENTUM_RATIO:.8,VELOCITY_SMOOTHING:.4,EDGE_RESISTANCE:.3,MAX_EDGE_OVERSCROLL:100,SHORT_SWIPE_VELOCITY:.5,BOUNCE_DURATION:400},Me=()=>({isDragging:false,startX:0,startY:0,startScrollLeft:0,startScrollTop:0,velocity:0,lastX:0,lastY:0,lastTime:0,momentumId:null}),xe=()=>({...Me(),velocityHistory:[],dragDistance:0,dragStartTime:0}),$=(e,t,o="horizontal")=>{let l=e.getBoundingClientRect(),r=o==="vertical",a=r?l.top:l.left,i=null,s=1/0;for(let m of t){if(m.offsetParent===null)continue;let u=m.getBoundingClientRect(),h=r?u.top:u.left,n=Math.abs(a-h);n<s&&(s=n,i=m);}return i},Ie=(e,t,o,l="horizontal")=>{let r=e.getBoundingClientRect(),a=l==="vertical",i=a?r.top:r.left,s=t.filter(d=>d.offsetParent!==null);if(s.length===0)return null;let m=0,u=1/0;s.forEach((d,v)=>{let b=d.getBoundingClientRect(),P=a?b.top:b.left,I=Math.abs(i-P);I<u&&(u=I,m=v);});let h=2,n=m;return Math.abs(o)>h&&(o>0?n=Math.min(m+1,s.length-1):n=Math.max(m-1,0)),s[n]??null},De=e=>{if(e.length===0)return 0;let t=0,o=0;return e.forEach((l,r)=>{let a=r+1;t+=l*a,o+=a;}),t/o},Ce=(e,t,o,l,r,a="horizontal",i=false)=>{let s=a==="vertical",m=e.velocity*g.MOMENTUM_RATIO,u=()=>{if(Math.abs(m)<g.MIN_VELOCITY){e.momentumId=null;let v=$(t,o,a);if(v){let b=s?v.offsetTop:v.offsetLeft;l(b,H);}r?.(v);return}let h=s?t.scrollHeight-t.clientHeight:t.scrollWidth-t.clientWidth,d=(s?t.scrollTop:t.scrollLeft)+m;i||(d<0||d>h)&&(m*=.5),s?t.scrollTop=Math.max(0,Math.min(h,d)):t.scrollLeft=Math.max(0,Math.min(h,d)),m*=g.FRICTION,e.momentumId=requestAnimationFrame(u);};e.momentumId=requestAnimationFrame(u);},re=e=>"touches"in e?e.touches[0]?.clientX??0:e.clientX,oe=e=>"touches"in e?e.touches[0]?.clientY??0:e.clientY,He=(e,t)=>t==="vertical"?oe(e):re(e),le=e=>{let {feed:t,slides:o,abortSignal:l,smoothScrollTo:r,onDragEnd:a,direction:i="horizontal",loop:s=false,touchRatio:m=1,shortSwipeThreshold:u=300,swipeDistanceThreshold:h=10}=e,n=xe(),d=i==="vertical",v=0,P=()=>{v=d?t.scrollHeight-t.clientHeight:t.scrollWidth-t.clientWidth,d?t.clientHeight:t.clientWidth;},I=L=>{n.momentumId!==null&&(cancelAnimationFrame(n.momentumId),n.momentumId=null),P(),n.isDragging=true,n.startX=re(L),n.startY=oe(L),n.startScrollLeft=t.scrollLeft,n.startScrollTop=t.scrollTop,n.velocity=0,n.lastX=n.startX,n.lastY=n.startY,n.lastTime=performance.now(),n.velocityHistory=[],n.dragDistance=0,n.dragStartTime=performance.now(),t.style.userSelect="none",t.style.cursor="grabbing",t.classList.add("is-dragging"),L.type==="mousedown"&&L.preventDefault();},q=L=>{if(!n.isDragging)return;let A=He(L,i),R=d?n.startY:n.startX,y=d?n.lastY:n.lastX,M=d?n.startScrollTop:n.startScrollLeft,c=performance.now(),f=c-n.lastTime,T=(R-A)*m,p=M+T;if(n.dragDistance=Math.abs(T),!s){if(p<0){let S=Math.abs(p),E=1-Math.min(S/g.MAX_EDGE_OVERSCROLL,1)*(1-g.EDGE_RESISTANCE);p=-S*E;}else if(p>v){let S=p-v,E=1-Math.min(S/g.MAX_EDGE_OVERSCROLL,1)*(1-g.EDGE_RESISTANCE);p=v+S*E;}}if(d?t.scrollTop=p:t.scrollLeft=p,f>0){let S=(y-A)/f*16;if(n.velocityHistory.length>0){let E=n.velocity;n.velocity=E*(1-g.VELOCITY_SMOOTHING)+S*g.VELOCITY_SMOOTHING;}else n.velocity=S;n.velocityHistory.push(S),n.velocityHistory.length>5&&n.velocityHistory.shift();}d?n.lastY=A:n.lastX=A,n.lastTime=c,L.type==="touchmove"&&L.preventDefault();},w=()=>{if(!n.isDragging)return;n.isDragging=false,t.style.userSelect="",t.style.cursor="",t.classList.remove("is-dragging");let A=performance.now()-n.dragStartTime<u&&n.dragDistance>h,R=De(n.velocityHistory);if(!s){let y=d?t.scrollTop:t.scrollLeft;if(y<0||y>v){let M=y<0?0:v,c=y,f=performance.now(),T=()=>{let p=performance.now()-f,S=Math.min(p/g.BOUNCE_DURATION,1),E=H(S),B=c+(M-c)*E;if(d?t.scrollTop=B:t.scrollLeft=B,S<1)requestAnimationFrame(T);else {let D=$(t,o,i);if(D){let x=d?D.offsetTop:D.offsetLeft;r(x,H);}a?.(D);}};requestAnimationFrame(T);return}}if(A||Math.abs(R)>g.SHORT_SWIPE_VELOCITY){let y=Ie(t,o,R,i);if(y){let M=d?y.offsetTop:y.offsetLeft;r(M,H),a?.(y);}else a?.(null);}else if(Math.abs(n.velocity)>1)Ce(n,t,o,r,a,i,s);else {let y=$(t,o,i);if(y){let M=d?y.offsetTop:y.offsetLeft;r(M,H);}a?.(y);}};return t.addEventListener("mousedown",I,{signal:l}),document.addEventListener("mousemove",q,{signal:l}),document.addEventListener("mouseup",w,{signal:l}),t.addEventListener("touchstart",I,{passive:true,signal:l}),t.addEventListener("touchmove",q,{passive:false,signal:l}),t.addEventListener("touchend",w,{signal:l}),t.addEventListener("touchcancel",w,{signal:l}),document.addEventListener("mouseleave",w,{signal:l}),t.style.cursor="grab",n},ie=e=>{e.momentumId!==null&&(cancelAnimationFrame(e.momentumId),e.momentumId=null);};var G=({bulletsContainer:e,slides:t,bulletClass:o,bulletActiveClass:l,feedId:r})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid bulletsContainer: must be a valid HTMLElement");if(!Array.isArray(t)||t.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!r||typeof r!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid bulletClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide navigation");let a=t.map((s,m)=>({slide:s,originalIndex:m})).filter(({slide:s})=>s.offsetParent!==null);return a.length===0?(console.warn("No visible slides found"),[]):a.map(({slide:s,originalIndex:m},u)=>{let h=document.createElement("button");return h.type="button",h.classList.add(o),u===0&&h.classList.add(l),h.setAttribute("role","tab"),h.setAttribute("aria-selected",u===0?"true":"false"),h.setAttribute("aria-controls",r),h.setAttribute("aria-label",`Go to slide ${u+1}`),h.setAttribute("data-slide-index",String(u)),e.appendChild(h),h})};var X=({thumbsContainer:e,slides:t,thumbClass:o,thumbActiveClass:l,feedId:r,thumbImageSelector:a="img",thumbSize:i})=>{if(!e||!(e instanceof HTMLElement))throw new Error("Invalid thumbsContainer: must be a valid HTMLElement");if(!Array.isArray(t)||t.length===0)throw new Error("Invalid slides: must be a non-empty array");if(!r||typeof r!="string")throw new Error("Invalid feedId: must be a non-empty string");if(!o||typeof o!="string")throw new Error("Invalid thumbClass: must be a non-empty string");e.innerHTML="",e.setAttribute("role","tablist"),e.setAttribute("aria-label","Slide thumbnails");let s=t.map((u,h)=>({slide:u,originalIndex:h})).filter(({slide:u})=>u.offsetParent!==null);return s.length===0?(console.warn("No visible slides found"),[]):s.map(({slide:u,originalIndex:h},n)=>{let d=document.createElement("button");d.type="button",d.classList.add(o),n===0&&d.classList.add(l);let v=u.querySelector(a);if(v?.src){let b=document.createElement("img");b.src=v.src,b.alt=v.alt||`Slide ${n+1} thumbnail`,b.draggable=false,i&&(b.style.width=`${i.width}px`,b.style.height=`${i.height}px`,b.style.objectFit="cover"),d.appendChild(b);}return d.setAttribute("role","tab"),d.setAttribute("aria-selected",n===0?"true":"false"),d.setAttribute("aria-controls",r),d.setAttribute("aria-label",`Go to slide ${n+1}`),d.setAttribute("data-slide-index",String(n)),e.appendChild(d),d})};var ne=()=>({initialized:false,clonedSlides:[],styleElement:null}),ae=()=>{let e=document.getElementById("lazer-marquee-keyframes");if(e)return e;let t=document.createElement("style");return t.id="lazer-marquee-keyframes",t.textContent=`
2
2
  @keyframes lazer-marquee-scroll {
3
3
  0% {
4
4
  transform: translateX(0);
@@ -7,4 +7,4 @@ var O=e=>e===1?1:1-Math.pow(2,-10*e),P=e=>1-Math.pow(1-e,3),Se=e=>e<.5?4*e*e*e:1
7
7
  transform: translateX(-50%);
8
8
  }
9
9
  }
10
- `,document.head.appendChild(r),r},Le=(e,r)=>{r.initialized||(r.styleElement=oe(),e.feed.style.display="flex",e.feed.style.willChange="transform",e.slides.forEach(o=>{let t=o.cloneNode(true);t.setAttribute("data-lazer-marquee-clone","true"),t.setAttribute("aria-hidden","true"),e.feed.appendChild(t),r.clonedSlides.push(t);}),r.initialized=true);},ie=e=>{e.initialized&&(e.clonedSlides.forEach(r=>{r.remove();}),e.clonedSlides=[],e.initialized=false);},Ae=(e,r)=>{oe(),requestAnimationFrame(()=>{let o=e.feed.scrollWidth,t=e.marqueeSpeed??50,u=e.marqueeDirection??"left",n=o/2;if(n<=0||t<=0){console.warn("[lazer-slider] Invalid marquee values:",{distance:n,speed:t,scrollWidth:o});return}let S=`lazer-marquee-scroll ${n/t}s linear infinite ${u==="right"?"reverse":"normal"}`;e.feed.style.animation="none",e.feed.offsetWidth,e.feed.style.animation=S,e.feed.style.animationPlayState=r.marqueePaused?"paused":"running";});},F=(e,r)=>{Ae(e,r);},ne=(e,r)=>{r.feed.style.animation="",r.feed.style.animationPlayState="",r.feed.style.transform="",r.feed.style.willChange="";},R=(e,r)=>{e.marqueePaused=true,r.feed.style.animationPlayState="paused";},z=(e,r)=>{e.marqueePaused=false,r.feed.style.animationPlayState="running";},ae=(e,r,o)=>{e.marquee&&(Le(e,o),F(e,r));},de=(e,r,o)=>{!e.marquee||e.pauseOnHover===false||(e.feed.addEventListener("mouseenter",()=>R(r,e),{signal:o}),e.feed.addEventListener("mouseleave",()=>z(r,e),{signal:o}),e.feed.addEventListener("touchstart",()=>R(r,e),{passive:true,signal:o}),e.feed.addEventListener("touchend",()=>z(r,e),{signal:o}));};var H={MIN_DURATION:400,MAX_DURATION:1e3,SPEED_FACTOR:1.5,SCROLL_END_DELAY:50,THUMB_UPDATE_DELAY:500},xe="(min-width: 64rem)",Me=e=>{if(!e.feed)throw new Error("lazer-slider: feed element is required");if(!e.slides?.length)throw new Error("lazer-slider: slides array is required and must not be empty");if(e.feed.id||(e.feed.id=`lazer-slider-feed-${Math.random().toString(36).substr(2,9)}`),e.bulletsContainer&&!e.thumbs){let l=k({bulletsContainer:e.bulletsContainer,slides:e.slides,bulletClass:e.bulletsClass??"slider-bullet",bulletActiveClass:e.bulletsActiveClass??"active",feedId:e.feed.id});e.thumbs=l;}if(e.thumbsContainer&&!e.thumbs){let l=$({thumbsContainer:e.thumbsContainer,slides:e.slides,thumbClass:e.thumbsClass??"slider-thumb",thumbActiveClass:e.thumbsActiveClass??"active",feedId:e.feed.id,thumbImageSelector:e.thumbImageSelector??"img",thumbSize:e.thumbSize});e.thumbs=l;}let r=e.direction??"horizontal",o=r==="vertical",t={currentSlideIndex:0,isScrolling:false,ticking:false,cachedFeedRect:null,lastWidth:0,updateThumbTimeout:null,scrollEndTimeout:null,abortController:new AbortController,autoplayIntervalId:null,autoplayPaused:false,marqueePaused:false,isLoopRepositioning:false},u=null,n={initialized:false,clonedSlides:[],realSlides:[...e.slides],clonesPerSide:0},f=le(),i=e.easing??O,S=()=>{let l=o?e.feed.clientHeight:e.feed.clientWidth;return (!t.cachedFeedRect||t.lastWidth!==l)&&(t.cachedFeedRect=e.feed.getBoundingClientRect(),t.lastWidth=l),t.cachedFeedRect},h=()=>e.slides.filter(l=>l.offsetParent!==null),p=()=>window.matchMedia(xe).matches,b=()=>{let l=p()?e.desktopSlidesPerView:e.mobileSlidesPerView;return !l||l==="auto"?1:Math.ceil(l)},m=()=>{if(!e.loop||n.initialized)return;let l=n.realSlides,d=b();n.clonesPerSide=d;for(let c=l.length-d;c<l.length;c++){let a=l[c];if(!a)continue;let s=a.cloneNode(true);s.setAttribute("data-lazer-clone","prepend"),s.setAttribute("aria-hidden","true"),e.feed.insertBefore(s,e.feed.firstChild),n.clonedSlides.push(s);}for(let c=0;c<d;c++){let a=l[c];if(!a)continue;let s=a.cloneNode(true);s.setAttribute("data-lazer-clone","append"),s.setAttribute("aria-hidden","true"),e.feed.appendChild(s),n.clonedSlides.push(s);}requestAnimationFrame(()=>{let c=l[0];c&&(o?e.feed.scrollTop=c.offsetTop:e.feed.scrollLeft=c.offsetLeft);}),n.initialized=true;},T=l=>{if(!e.loop||!n.initialized)return;t.isLoopRepositioning=true;let d=n.realSlides,c=d.length;if(l==="next"){let a=d[0];a&&(o?e.feed.scrollTop=a.offsetTop:e.feed.scrollLeft=a.offsetLeft),t.currentSlideIndex=0;}else {let a=d[c-1];a&&(o?e.feed.scrollTop=a.offsetTop:e.feed.scrollLeft=a.offsetLeft),t.currentSlideIndex=c-1;}requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.isLoopRepositioning=false,q();});});},v=()=>{n.initialized&&(n.clonedSlides.forEach(l=>{l.remove();}),n.clonedSlides=[],n.initialized=false,n.clonesPerSide=0);},A=()=>{let l=p()?e.desktopSlidesPerView:e.mobileSlidesPerView,d=e.slideGap??0;if(d>0&&(e.feed.style.gap=`${d}px`),!l||l==="auto"){e.slides.forEach(s=>{s.style.flex="",s.style.minWidth="",s.style.minHeight="";});return}let a=`calc((100% - ${d*(l-1)}px) / ${l})`;o?e.slides.forEach(s=>{s.style.flex=`0 0 ${a}`,s.style.minHeight=a,s.style.minWidth="";}):e.slides.forEach(s=>{s.style.flex=`0 0 ${a}`,s.style.minWidth=a,s.style.minHeight="";});},E=()=>{if(!e.scrollbarThumb)return;let l=S();if(o){let d=l.height/e.feed.scrollHeight*100;e.scrollbarThumb.style.height=`${d}%`,e.scrollbarThumb.style.width="";}else {let d=l.width/e.feed.scrollWidth*100;e.scrollbarThumb.style.width=`${d}%`,e.scrollbarThumb.style.height="";}},x=()=>{if(!(!e.scrollbarThumb||!e.scrollbarTrack))if(o){let l=e.scrollbarTrack.getBoundingClientRect().height,d=e.scrollbarThumb.getBoundingClientRect().height,c=l-d,a=e.feed.scrollHeight-e.feed.clientHeight,s=a>0?e.feed.scrollTop/a:0;e.scrollbarThumb.style.transform=`translateY(${c*s}px)`;}else {let l=e.scrollbarTrack.getBoundingClientRect().width,d=e.scrollbarThumb.getBoundingClientRect().width,c=l-d,a=e.feed.scrollWidth-e.feed.clientWidth,s=a>0?e.feed.scrollLeft/a:0;e.scrollbarThumb.style.transform=`translateX(${c*s}px)`;}},q=()=>{if(t.isLoopRepositioning)return;let l=S(),d,c,a;if(o?(d=e.feed.scrollTop<=1,c=e.feed.scrollTop+l.height>=e.feed.scrollHeight-1,a=e.feed.scrollHeight<=l.height):(d=e.feed.scrollLeft<=1,c=e.feed.scrollLeft+l.width>=e.feed.scrollWidth-1,a=e.feed.scrollWidth<=l.width),e.scrollbarTrack&&(e.scrollbarTrack.style.display=a?"none":"block"),e.loop){C(e.prevSlideButton,!a,e.feed),C(e.nextSlideButton,!a,e.feed);return}C(e.prevSlideButton,!d&&!a,e.feed),C(e.nextSlideButton,!c&&!a,e.feed);},B=()=>{let l=S(),d=n.initialized?n.realSlides:h(),c=d.filter(a=>{let s=a.getBoundingClientRect(),y=20;return o?s.bottom>l.top+y&&s.top<l.bottom-y:s.right>l.left+y&&s.left<l.right-y});if(c.length&&c[0]){let a=d.indexOf(c[0]);if(a!==-1){t.currentSlideIndex=a;let s=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScroll?.({currentScroll:s,currentSlideIndex:t.currentSlideIndex});}}},M=(l,d=i,c)=>{let a=o?e.feed.scrollTop:e.feed.scrollLeft,s=Math.abs(l-a),y=Math.min(H.MAX_DURATION,Math.max(H.MIN_DURATION,s/H.SPEED_FACTOR)),N=performance.now(),g=I=>{let w=(I-N)/y,G=Math.min(w,1),he=d(G),j=a+(l-a)*he;o?e.feed.scrollTop=j:e.feed.scrollLeft=j,G<1?requestAnimationFrame(g):(o?e.feed.scrollTop=l:e.feed.scrollLeft=l,c?.());};requestAnimationFrame(g);},se=l=>{if(!e.thumbs)return;let d=e.thumbs.indexOf(l);if(d===-1||!e.slides[d])return;t.currentSlideIndex=d,D(e.thumbs,d),t.isScrolling=true,t.updateThumbTimeout&&clearTimeout(t.updateThumbTimeout),t.updateThumbTimeout=setTimeout(()=>{t.isScrolling=false;},H.THUMB_UPDATE_DELAY);let c=o?e.slides[d].offsetTop:e.slides[d].offsetLeft;M(c);},L=l=>{let d=n.initialized?n.realSlides:h(),c=p()?e.desktopSlidesPerScroll??1:e.mobileSlidesPerScroll??1,a=d.length;B();let s,y=false;if(l==="prev")if(e.loop&&n.initialized&&t.currentSlideIndex===0){let I=n.clonedSlides.filter(w=>w.getAttribute("data-lazer-clone")==="prepend");s=I[I.length-1],y=true;}else t.currentSlideIndex=Math.max(0,t.currentSlideIndex-c),s=d[t.currentSlideIndex];else e.loop&&n.initialized&&t.currentSlideIndex>=a-1?(s=n.clonedSlides.filter(w=>w.getAttribute("data-lazer-clone")==="append")[0],y=true):(t.currentSlideIndex=Math.min(a-1,t.currentSlideIndex+c),s=d[t.currentSlideIndex]);if(!s)return;let N=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollStart?.({currentScroll:N,target:s,direction:l});let g=o?s.offsetTop:s.offsetLeft;y?M(g,i,()=>{T(l);}):M(g);},ce=()=>{x(),q(),B(),t.isScrolling||D(e.thumbs,t.currentSlideIndex),t.scrollEndTimeout&&clearTimeout(t.scrollEndTimeout),t.scrollEndTimeout=setTimeout(()=>{t.isScrolling=false;let l=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollEnd?.({currentScroll:l,currentSlideIndex:t.currentSlideIndex});},H.SCROLL_END_DELAY);},ue=()=>{t.ticking||(requestAnimationFrame(()=>{ce(),t.ticking=false;}),t.ticking=true);},W=()=>{t.cachedFeedRect=null,U();},fe=()=>{let{signal:l}=t.abortController;window.addEventListener("resize",W),e.feed.addEventListener("scroll",ue,{passive:true,signal:l}),e.prevSlideButton&&e.prevSlideButton.addEventListener("click",()=>L("prev"),{signal:l}),e.nextSlideButton&&e.nextSlideButton.addEventListener("click",()=>L("next"),{signal:l}),e.thumbs?.length&&(e.thumbs[0]?.classList.add("active"),e.thumbs.forEach(d=>{d.addEventListener("click",()=>se(d),{signal:l});})),Q(e.feed,()=>L("prev"),()=>L("next"),l,r),e.enableDragToScroll!==false&&(u=te({feed:e.feed,slides:e.slides,abortSignal:l,smoothScrollTo:M,onDragEnd:()=>{B(),D(e.thumbs,t.currentSlideIndex);},direction:r})),e.autoplay&&e.pauseOnHover!==false&&(e.feed.addEventListener("mouseenter",Y,{signal:l}),e.feed.addEventListener("mouseleave",_,{signal:l}),e.feed.addEventListener("touchstart",Y,{passive:true,signal:l}),e.feed.addEventListener("touchend",_,{signal:l})),de(e,t,l);},V=()=>{if(t.autoplayIntervalId)return;let l=e.autoplayInterval??3e3;t.autoplayIntervalId=setInterval(()=>{t.autoplayPaused||L("next");},l);},X=()=>{t.autoplayIntervalId&&(clearInterval(t.autoplayIntervalId),t.autoplayIntervalId=null);},Y=()=>{t.autoplayPaused=true;},_=()=>{t.autoplayPaused=false;},me=l=>{let d=n.initialized?n.realSlides:h(),c=Math.max(0,Math.min(l,d.length-1)),a=d[c];if(!a)return;t.currentSlideIndex=c,D(e.thumbs,c);let s=o?a.offsetTop:a.offsetLeft;M(s);},U=()=>{t.cachedFeedRect=null,A(),E(),q(),e.marquee&&!t.marqueePaused&&F(e,t);},pe=()=>{X(),ne(t,e),t.abortController.abort(),window.removeEventListener("resize",W),t.updateThumbTimeout&&clearTimeout(t.updateThumbTimeout),t.scrollEndTimeout&&clearTimeout(t.scrollEndTimeout),u&&re(u),v(),ie(f),t.cachedFeedRect=null;};return K(e),A(),e.marquee?ae(e,t,f):(m(),e.autoplay&&V()),q(),fe(),E(),{goToIndex:me,refresh:U,unload:pe,play:()=>{e.marquee?t.marqueePaused?z(t,e):F(e,t):e.autoplay&&V();},pause:()=>{e.marquee?R(t,e):X();},next:()=>L("next"),prev:()=>L("prev")}};export{Me as createSlider,Se as easeInOutCubic,P as easeOutCubic,O as easeOutExpo,be as easeOutQuad,k as generateBullets,$ as generateThumbs,ve as linear};
10
+ `,document.head.appendChild(t),t},we=(e,t)=>{t.initialized||(t.styleElement=ae(),e.feed.style.display="flex",e.feed.style.willChange="transform",e.slides.forEach(o=>{let l=o.cloneNode(true);l.setAttribute("data-lazer-marquee-clone","true"),l.setAttribute("aria-hidden","true"),e.feed.appendChild(l),t.clonedSlides.push(l);}),t.initialized=true);},se=e=>{e.initialized&&(e.clonedSlides.forEach(t=>{t.remove();}),e.clonedSlides=[],e.initialized=false);},Re=(e,t)=>{ae(),requestAnimationFrame(()=>{let o=e.feed.scrollWidth,l=e.marqueeSpeed??50,r=e.marqueeDirection??"left",a=o/2;if(a<=0||l<=0){console.warn("[lazer-slider] Invalid marquee values:",{distance:a,speed:l,scrollWidth:o});return}let m=`lazer-marquee-scroll ${a/l}s linear infinite ${r==="right"?"reverse":"normal"}`;e.feed.style.animation="none",e.feed.offsetWidth,e.feed.style.animation=m,e.feed.style.animationPlayState=t.marqueePaused?"paused":"running";});},V=(e,t)=>{Re(e,t);},ce=(e,t)=>{t.feed.style.animation="",t.feed.style.animationPlayState="",t.feed.style.transform="",t.feed.style.willChange="";},_=(e,t)=>{e.marqueePaused=true,t.feed.style.animationPlayState="paused";},k=(e,t)=>{e.marqueePaused=false,t.feed.style.animationPlayState="running";},de=(e,t,o)=>{e.marquee&&(we(e,o),V(e,t));},ue=(e,t,o)=>{!e.marquee||e.pauseOnHover===false||(e.feed.addEventListener("mouseenter",()=>_(t,e),{signal:o}),e.feed.addEventListener("mouseleave",()=>k(t,e),{signal:o}),e.feed.addEventListener("touchstart",()=>_(t,e),{passive:true,signal:o}),e.feed.addEventListener("touchend",()=>k(t,e),{signal:o}));};var me=e=>({initialized:false,clonedSlides:[],realSlides:[...e],clonesPerSide:0}),Oe=e=>{let t=O()?e.desktopSlidesPerView:e.mobileSlidesPerView;return !t||t==="auto"?1:Math.ceil(t)},fe=(e,t,o)=>{if(!e.loop||t.initialized)return;let l=t.realSlides,r=Oe(e);t.clonesPerSide=r;for(let a=l.length-r;a<l.length;a++){let i=l[a];if(!i)continue;let s=i.cloneNode(true);s.setAttribute("data-lazer-clone","prepend"),s.setAttribute("aria-hidden","true"),e.feed.insertBefore(s,e.feed.firstChild),t.clonedSlides.push(s);}for(let a=0;a<r;a++){let i=l[a];if(!i)continue;let s=i.cloneNode(true);s.setAttribute("data-lazer-clone","append"),s.setAttribute("aria-hidden","true"),e.feed.appendChild(s),t.clonedSlides.push(s);}requestAnimationFrame(()=>{let a=l[0];a&&(o?e.feed.scrollTop=a.offsetTop:e.feed.scrollLeft=a.offsetLeft);}),t.initialized=true;},U=(e,t,o,l,r,a,i)=>{if(!t.loop||!o.initialized)return;a(true);let s=o.realSlides,m=s.length;if(e==="next"){let u=s[0];u&&(l?t.feed.scrollTop=u.offsetTop:t.feed.scrollLeft=u.offsetLeft),r(0);}else {let u=s[m-1];u&&(l?t.feed.scrollTop=u.offsetTop:t.feed.scrollLeft=u.offsetLeft),r(m-1);}requestAnimationFrame(()=>{requestAnimationFrame(()=>{a(false),i();});});},pe=e=>{e.initialized&&(e.clonedSlides.forEach(t=>{t.remove();}),e.clonedSlides=[],e.initialized=false,e.clonesPerSide=0);};var j=(e,t,o)=>{if(t.autoplayIntervalId)return;let l=e.autoplayInterval??3e3;t.autoplayIntervalId=setInterval(()=>{t.autoplayPaused||o("next");},l);},K=e=>{e.autoplayIntervalId&&(clearInterval(e.autoplayIntervalId),e.autoplayIntervalId=null);},Se=e=>{e.autoplayPaused=true;},he=e=>{e.autoplayPaused=false;},be=(e,t,o)=>{!e.autoplay||e.pauseOnHover===false||(e.feed.addEventListener("mouseenter",()=>Se(t),{signal:o}),e.feed.addEventListener("mouseleave",()=>he(t),{signal:o}),e.feed.addEventListener("touchstart",()=>Se(t),{passive:true,signal:o}),e.feed.addEventListener("touchend",()=>he(t),{signal:o}));};var Q=(e,t,o)=>{if(e.scrollbarThumb)if(o){let l=t.height/e.feed.scrollHeight*100;e.scrollbarThumb.style.height=`${l}%`,e.scrollbarThumb.style.width="";}else {let l=t.width/e.feed.scrollWidth*100;e.scrollbarThumb.style.width=`${l}%`,e.scrollbarThumb.style.height="";}},Te=(e,t)=>{if(!(!e.scrollbarThumb||!e.scrollbarTrack))if(t){let o=e.scrollbarTrack.getBoundingClientRect().height,l=e.scrollbarThumb.getBoundingClientRect().height,r=o-l,a=e.feed.scrollHeight-e.feed.clientHeight,i=a>0?e.feed.scrollTop/a:0;e.scrollbarThumb.style.transform=`translateY(${r*i}px)`;}else {let o=e.scrollbarTrack.getBoundingClientRect().width,l=e.scrollbarThumb.getBoundingClientRect().width,r=o-l,a=e.feed.scrollWidth-e.feed.clientWidth,i=a>0?e.feed.scrollLeft/a:0;e.scrollbarThumb.style.transform=`translateX(${r*i}px)`;}};var J=(e,t,o,l=N,r)=>{let a=o?e.scrollTop:e.scrollLeft,i=Math.abs(t-a),s=Math.min(C.MAX_DURATION,Math.max(C.MIN_DURATION,i/C.SPEED_FACTOR)),m=performance.now(),u=h=>{let n=(h-m)/s,d=Math.min(n,1),v=l(d),b=a+(t-a)*v;o?e.scrollTop=b:e.scrollLeft=b,d<1?requestAnimationFrame(u):(o?e.scrollTop=t:e.scrollLeft=t,r?.());};requestAnimationFrame(u);},W=e=>e.filter(t=>t.offsetParent!==null),Z=(e,t,o)=>{let l=o?e.desktopSlidesPerView:e.mobileSlidesPerView,r=e.slideGap??0;if(r>0&&(e.feed.style.gap=`${r}px`),!l||l==="auto"){e.slides.forEach(s=>{s.style.flex="",s.style.minWidth="",s.style.minHeight="";});return}let i=`calc((100% - ${r*(l-1)}px) / ${l})`;t?e.slides.forEach(s=>{s.style.flex=`0 0 ${i}`,s.style.minHeight=i,s.style.minWidth="";}):e.slides.forEach(s=>{s.style.flex=`0 0 ${i}`,s.style.minWidth=i,s.style.minHeight="";});},ve=(e,t,o,l)=>{let r=l?e.clientHeight:e.clientWidth;return !t||o!==r?{rect:e.getBoundingClientRect(),size:r}:{rect:t,size:o}};var Pe=e=>{if(!e.feed)throw new Error("lazer-slider: feed element is required");if(!e.slides?.length)throw new Error("lazer-slider: slides array is required and must not be empty");if(e.feed.id||(e.feed.id=`lazer-slider-feed-${Math.random().toString(36).substr(2,9)}`),e.bulletsContainer&&!e.thumbs){let c=G({bulletsContainer:e.bulletsContainer,slides:e.slides,bulletClass:e.bulletsClass??"slider-bullet",bulletActiveClass:e.bulletsActiveClass??"active",feedId:e.feed.id});e.thumbs=c;}if(e.thumbsContainer&&!e.thumbs){let c=X({thumbsContainer:e.thumbsContainer,slides:e.slides,thumbClass:e.thumbsClass??"slider-thumb",thumbActiveClass:e.thumbsActiveClass??"active",feedId:e.feed.id,thumbImageSelector:e.thumbImageSelector??"img",thumbSize:e.thumbSize});e.thumbs=c;}let t=e.direction??"horizontal",o=t==="vertical",l=e.easing??N,r={currentSlideIndex:0,isScrolling:false,ticking:false,cachedFeedRect:null,lastWidth:0,updateThumbTimeout:null,scrollEndTimeout:null,abortController:new AbortController,autoplayIntervalId:null,autoplayPaused:false,marqueePaused:false,isLoopRepositioning:false},a=null,i=me(e.slides),s=ne(),m=()=>{let c=ve(e.feed,r.cachedFeedRect,r.lastWidth,o);return r.cachedFeedRect=c.rect,r.lastWidth=c.size,c.rect},u=(c,f)=>{J(e.feed,c,o,l,f);},h=(c,f)=>{J(e.feed,c,o,f??l);},n=()=>{if(r.isLoopRepositioning)return;let c=m(),f,T,p;if(o?(f=e.feed.scrollTop<=1,T=e.feed.scrollTop+c.height>=e.feed.scrollHeight-1,p=e.feed.scrollHeight<=c.height):(f=e.feed.scrollLeft<=1,T=e.feed.scrollLeft+c.width>=e.feed.scrollWidth-1,p=e.feed.scrollWidth<=c.width),e.scrollbarTrack&&(e.scrollbarTrack.style.display=p?"none":"block"),e.loop){z(e.prevSlideButton,!p,e.feed),z(e.nextSlideButton,!p,e.feed);return}z(e.prevSlideButton,!f&&!p,e.feed),z(e.nextSlideButton,!T&&!p,e.feed);},d=()=>{let c=m(),f=i.initialized?i.realSlides:W(e.slides),T=f.filter(p=>{let S=p.getBoundingClientRect(),E=20;return o?S.bottom>c.top+E&&S.top<c.bottom-E:S.right>c.left+E&&S.left<c.right-E});if(T.length&&T[0]){let p=f.indexOf(T[0]);if(p!==-1){r.currentSlideIndex=p;let S=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScroll?.({currentScroll:S,currentSlideIndex:r.currentSlideIndex});}}},v=c=>{if(!e.thumbs)return;let f=e.thumbs.indexOf(c);if(f===-1||!e.slides[f])return;r.currentSlideIndex=f,F(e.thumbs,f),r.isScrolling=true,r.updateThumbTimeout&&clearTimeout(r.updateThumbTimeout),r.updateThumbTimeout=setTimeout(()=>{r.isScrolling=false;},C.THUMB_UPDATE_DELAY);let T=o?e.slides[f].offsetTop:e.slides[f].offsetLeft;u(T);},b=c=>{let f=i.initialized?i.realSlides:W(e.slides),T=O()?e.desktopSlidesPerScroll??1:e.mobileSlidesPerScroll??1,p=f.length;d();let S,E=false;if(c==="prev")if(e.loop&&i.initialized&&r.currentSlideIndex===0){let x=i.clonedSlides.filter(Y=>Y.getAttribute("data-lazer-clone")==="prepend");S=x[x.length-1],E=true;}else r.currentSlideIndex=Math.max(0,r.currentSlideIndex-T),S=f[r.currentSlideIndex];else e.loop&&i.initialized&&r.currentSlideIndex>=p-1?(S=i.clonedSlides.filter(Y=>Y.getAttribute("data-lazer-clone")==="append")[0],E=true):(r.currentSlideIndex=Math.min(p-1,r.currentSlideIndex+T),S=f[r.currentSlideIndex]);if(!S)return;let B=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollStart?.({currentScroll:B,target:S,direction:c});let D=o?S.offsetTop:S.offsetLeft;E?u(D,()=>{U(c,e,i,o,x=>{r.currentSlideIndex=x;},x=>{r.isLoopRepositioning=x;},n);}):u(D);},P=()=>{Te(e,o),n(),d(),r.isScrolling||F(e.thumbs,r.currentSlideIndex),r.scrollEndTimeout&&clearTimeout(r.scrollEndTimeout),r.scrollEndTimeout=setTimeout(()=>{r.isScrolling=false;let c=o?e.feed.scrollTop:e.feed.scrollLeft;e.onScrollEnd?.({currentScroll:c,currentSlideIndex:r.currentSlideIndex});},C.SCROLL_END_DELAY);},I=()=>{r.ticking||(requestAnimationFrame(()=>{P(),r.ticking=false;}),r.ticking=true);},q=()=>{r.cachedFeedRect=null,A();},w=()=>{let{signal:c}=r.abortController;if(window.addEventListener("resize",q),e.feed.addEventListener("scroll",I,{passive:true,signal:c}),e.prevSlideButton&&e.prevSlideButton.addEventListener("click",()=>b("prev"),{signal:c}),e.nextSlideButton&&e.nextSlideButton.addEventListener("click",()=>b("next"),{signal:c}),e.thumbs?.length&&(e.thumbs[0]?.classList.add("active"),e.thumbs.forEach(f=>{f.addEventListener("click",()=>v(f),{signal:c});})),te(e.feed,()=>b("prev"),()=>b("next"),c,t),e.enableDragToScroll!==false){let f=e.loop&&i.initialized?[...i.realSlides,...i.clonedSlides]:e.slides;a=le({feed:e.feed,slides:f,abortSignal:c,smoothScrollTo:h,onDragEnd:T=>{if(T&&e.loop&&i.initialized){let p=T.getAttribute("data-lazer-clone");if(p){let S=p==="append"?"next":"prev";setTimeout(()=>{U(S,e,i,o,E=>{r.currentSlideIndex=E;},E=>{r.isLoopRepositioning=E;},n);},50);}}d(),F(e.thumbs,r.currentSlideIndex);},direction:t,loop:e.loop});}be(e,r,c),ue(e,r,c);},L=c=>{let f=i.initialized?i.realSlides:W(e.slides),T=Math.max(0,Math.min(c,f.length-1)),p=f[T];if(!p)return;r.currentSlideIndex=T,F(e.thumbs,T);let S=o?p.offsetTop:p.offsetLeft;u(S);},A=()=>{r.cachedFeedRect=null,Z(e,o,O()),Q(e,m(),o),n(),e.marquee&&!r.marqueePaused&&V(e,r);},R=()=>{K(r),ce(r,e),r.abortController.abort(),window.removeEventListener("resize",q),r.updateThumbTimeout&&clearTimeout(r.updateThumbTimeout),r.scrollEndTimeout&&clearTimeout(r.scrollEndTimeout),a&&ie(a),pe(i),se(s),r.cachedFeedRect=null;},y=()=>{e.marquee?r.marqueePaused?k(r,e):V(e,r):e.autoplay&&j(e,r,b);},M=()=>{e.marquee?_(r,e):K(r);};return ee(e),Z(e,o,O()),e.marquee?de(e,r,s):(fe(e,i,o),e.autoplay&&j(e,r,b)),n(),w(),Q(e,m(),o),{goToIndex:L,refresh:A,unload:R,play:y,pause:M,next:()=>b("next"),prev:()=>b("prev")}};export{Pe as createSlider,ye as easeInOutCubic,H as easeOutCubic,N as easeOutExpo,Le as easeOutQuad,G as generateBullets,X as generateThumbs,ge as linear};
@@ -14,246 +14,285 @@
14
14
  /* ============================================
15
15
  CSS Custom Properties (Easy to Override)
16
16
  ============================================ */
17
- :root {
18
- /* Bullets / Dots */
19
- --lazer-bullet-size: 12px;
20
- --lazer-bullet-gap: 8px;
21
- --lazer-bullet-color: #cbd5e1;
22
- --lazer-bullet-active-color: #1e293b;
23
- --lazer-bullet-hover-scale: 1.2;
24
-
25
- /* Thumbnails */
26
- --lazer-thumb-gap: 8px;
27
- --lazer-thumb-opacity: 0.6;
28
- --lazer-thumb-hover-opacity: 0.8;
29
- --lazer-thumb-active-opacity: 1;
30
- --lazer-thumb-border-width: 2px;
31
- --lazer-thumb-border-color: transparent;
32
- --lazer-thumb-active-border-color: #3b82f6;
33
- --lazer-thumb-border-radius: 4px;
34
-
35
- /* Scrollbar */
36
- --lazer-track-height: 4px;
37
- --lazer-track-color: #e2e8f0;
38
- --lazer-thumb-color: #1e293b;
39
- --lazer-track-radius: 2px;
40
-
41
- /* Navigation Buttons */
42
- --lazer-nav-size: 40px;
43
- --lazer-nav-offset: 12px;
44
- --lazer-nav-bg: rgba(255, 255, 255, 0.9);
45
- --lazer-nav-hover-bg: white;
46
- --lazer-nav-radius: 50%;
47
- --lazer-nav-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
48
-
49
- /* Transitions */
50
- --lazer-duration: 0.3s;
51
- --lazer-easing: ease;
52
- }
53
-
54
- /* ============================================
55
- Feed (Scrollable Container)
56
- ============================================ */
57
- .lazer-feed {
58
- position: relative;
59
- display: flex;
60
- overflow-x: auto;
61
- overflow-y: hidden;
62
- -webkit-overflow-scrolling: touch;
63
- scrollbar-width: none;
64
- }
65
-
66
- .lazer-feed::-webkit-scrollbar {
67
- display: none;
68
- }
69
-
70
- /* Vertical slider variant */
71
- .lazer-feed.lazer-vertical {
72
- flex-direction: column;
73
- overflow-x: hidden;
74
- overflow-y: auto;
75
- }
76
-
77
- /* ============================================
78
- Slides
79
- ============================================ */
80
- .lazer-slide {
81
- flex-shrink: 0;
82
- }
83
-
84
- /* ============================================
85
- Drag State
86
- ============================================ */
87
- .lazer-feed.lazer-draggable {
88
- cursor: grab;
89
- }
90
-
91
- .lazer-feed.lazer-draggable.is-dragging {
92
- cursor: grabbing;
93
- user-select: none;
94
- }
95
-
96
- /* ============================================
97
- Bullets / Dots Navigation
98
- ============================================ */
99
- .lazer-bullets {
100
- display: flex;
101
- gap: var(--lazer-bullet-gap);
102
- justify-content: center;
103
- align-items: center;
104
- padding: 16px 0;
105
- }
106
-
107
- .lazer-bullet {
108
- width: var(--lazer-bullet-size);
109
- height: var(--lazer-bullet-size);
110
- padding: 0;
111
- border: none;
112
- border-radius: 50%;
113
- background: var(--lazer-bullet-color);
114
- cursor: pointer;
115
- transition:
116
- background var(--lazer-duration) var(--lazer-easing),
117
- transform var(--lazer-duration) var(--lazer-easing);
118
- }
119
-
120
- .lazer-bullet:hover {
121
- transform: scale(var(--lazer-bullet-hover-scale));
122
- }
123
-
124
- .lazer-bullet:focus-visible {
125
- outline: 2px solid var(--lazer-bullet-active-color);
126
- outline-offset: 2px;
127
- }
128
-
129
- .lazer-bullet.active {
130
- background: var(--lazer-bullet-active-color);
131
- }
132
-
133
- /* ============================================
134
- Thumbnails Gallery
135
- ============================================ */
136
- .lazer-thumbs {
137
- display: flex;
138
- gap: var(--lazer-thumb-gap);
139
- justify-content: center;
140
- align-items: center;
141
- padding: 16px 0;
142
- flex-wrap: wrap;
143
- }
144
-
145
- .lazer-thumb {
146
- padding: 0;
147
- border: var(--lazer-thumb-border-width) solid var(--lazer-thumb-border-color);
148
- border-radius: var(--lazer-thumb-border-radius);
149
- background: none;
150
- cursor: pointer;
151
- opacity: var(--lazer-thumb-opacity);
152
- transition:
153
- opacity var(--lazer-duration) var(--lazer-easing),
154
- border-color var(--lazer-duration) var(--lazer-easing);
155
- }
156
-
157
- .lazer-thumb:hover {
158
- opacity: var(--lazer-thumb-hover-opacity);
159
- }
160
-
161
- .lazer-thumb:focus-visible {
162
- outline: 2px solid var(--lazer-thumb-active-border-color);
163
- outline-offset: 2px;
164
- }
165
-
166
- .lazer-thumb.active {
167
- opacity: var(--lazer-thumb-active-opacity);
168
- border-color: var(--lazer-thumb-active-border-color);
169
- }
170
-
171
- .lazer-thumb img {
172
- display: block;
173
- border-radius: calc(var(--lazer-thumb-border-radius) - 2px);
174
- }
175
-
176
- /* ============================================
177
- Custom Scrollbar
178
- ============================================ */
179
- .lazer-track {
180
- width: 100%;
181
- height: var(--lazer-track-height);
182
- background: var(--lazer-track-color);
183
- border-radius: var(--lazer-track-radius);
184
- margin-top: 16px;
185
- position: relative;
186
- overflow: hidden;
187
- }
188
-
189
- .lazer-scrollbar {
190
- height: 100%;
191
- background: var(--lazer-thumb-color);
192
- border-radius: var(--lazer-track-radius);
193
- transition: transform 0.1s linear;
194
- }
195
-
196
- /* ============================================
197
- Navigation Buttons
198
- ============================================ */
199
- .lazer-nav {
200
- position: absolute;
201
- top: 50%;
202
- transform: translateY(-50%);
203
- z-index: 10;
204
- display: flex;
205
- align-items: center;
206
- justify-content: center;
207
- width: var(--lazer-nav-size);
208
- height: var(--lazer-nav-size);
209
- border: none;
210
- border-radius: var(--lazer-nav-radius);
211
- background: var(--lazer-nav-bg);
212
- box-shadow: var(--lazer-nav-shadow);
213
- cursor: pointer;
214
- transition:
215
- opacity var(--lazer-duration) var(--lazer-easing),
216
- background var(--lazer-duration) var(--lazer-easing);
217
- }
218
-
219
- .lazer-nav:hover {
220
- background: var(--lazer-nav-hover-bg);
221
- }
222
-
223
- .lazer-nav:focus-visible {
224
- outline: 2px solid var(--lazer-bullet-active-color);
225
- outline-offset: 2px;
226
- }
227
-
228
- .lazer-nav[aria-hidden="true"] {
229
- opacity: 0;
230
- pointer-events: none;
231
- }
232
-
233
- .lazer-prev {
234
- left: var(--lazer-nav-offset);
235
- }
236
-
237
- .lazer-next {
238
- right: var(--lazer-nav-offset);
239
- }
240
-
241
- /* ============================================
242
- Slider Container (Optional wrapper)
243
- ============================================ */
244
- .lazer-slider {
245
- position: relative;
246
- width: 100%;
247
- }
248
-
249
- /* ============================================
250
- Marquee Specific
251
- ============================================ */
252
- .lazer-feed.lazer-marquee {
253
- scroll-snap-type: none;
254
- cursor: default;
255
- }
256
-
257
- .lazer-feed.lazer-marquee:not(.is-dragging) {
258
- cursor: default;
259
- }
17
+ :root {
18
+ /* Bullets / Dots */
19
+ --lazer-bullet-size: 12px;
20
+ --lazer-bullet-gap: 8px;
21
+ --lazer-bullet-color: #cbd5e1;
22
+ --lazer-bullet-active-color: #1e293b;
23
+ --lazer-bullet-hover-scale: 1.2;
24
+
25
+ /* Thumbnails */
26
+ --lazer-thumb-gap: 8px;
27
+ --lazer-thumb-opacity: 0.6;
28
+ --lazer-thumb-hover-opacity: 0.8;
29
+ --lazer-thumb-active-opacity: 1;
30
+ --lazer-thumb-border-width: 2px;
31
+ --lazer-thumb-border-color: transparent;
32
+ --lazer-thumb-active-border-color: #3b82f6;
33
+ --lazer-thumb-border-radius: 4px;
34
+
35
+ /* Scrollbar */
36
+ --lazer-track-height: 4px;
37
+ --lazer-track-color: #e2e8f0;
38
+ --lazer-thumb-color: #1e293b;
39
+ --lazer-track-radius: 2px;
40
+
41
+ /* Navigation Buttons */
42
+ --lazer-nav-size: 40px;
43
+ --lazer-nav-offset: 12px;
44
+ --lazer-nav-bg: rgba(255, 255, 255, 0.9);
45
+ --lazer-nav-hover-bg: white;
46
+ --lazer-nav-radius: 50%;
47
+ --lazer-nav-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
48
+
49
+ /* Transitions */
50
+ --lazer-duration: 0.3s;
51
+ --lazer-easing: ease;
52
+ }
53
+
54
+ /* ============================================
55
+ Feed (Scrollable Container)
56
+ ============================================ */
57
+ .lazer-feed {
58
+ position: relative;
59
+ display: flex;
60
+ overflow-x: auto;
61
+ overflow-y: hidden;
62
+ -webkit-overflow-scrolling: touch;
63
+ scrollbar-width: none;
64
+ }
65
+
66
+ .lazer-feed::-webkit-scrollbar {
67
+ display: none;
68
+ }
69
+
70
+ /* Vertical slider variant */
71
+ .lazer-feed.lazer-vertical {
72
+ flex-direction: column;
73
+ overflow-x: hidden;
74
+ overflow-y: auto;
75
+ }
76
+
77
+ /* ============================================
78
+ Slides
79
+ ============================================ */
80
+ .lazer-slide {
81
+ flex: 0 0 calc(100% / var(--slides-per-view, 1));
82
+ scroll-snap-align: start;
83
+ scroll-snap-stop: always;
84
+ }
85
+
86
+ /* ============================================
87
+ Drag State
88
+ ============================================ */
89
+ .lazer-feed.lazer-draggable {
90
+ cursor: grab;
91
+ /* Hint for GPU acceleration during drag */
92
+ will-change: scroll-position;
93
+ }
94
+
95
+ .lazer-feed.lazer-draggable.is-dragging {
96
+ cursor: grabbing;
97
+ user-select: none;
98
+ /* Disable scroll snapping during drag for smoother experience */
99
+ scroll-snap-type: none;
100
+ }
101
+
102
+ .lazer-feed.lazer-draggable.is-dragging .lazer-slide {
103
+ scroll-snap-align: none;
104
+ }
105
+
106
+ /* Restore scroll snapping after drag ends */
107
+ .lazer-feed.lazer-draggable:not(.is-dragging) {
108
+ scroll-behavior: smooth;
109
+ }
110
+
111
+ /* ============================================
112
+ Bullets / Dots Navigation
113
+ ============================================ */
114
+ .lazer-bullets {
115
+ display: flex;
116
+ gap: var(--lazer-bullet-gap);
117
+ justify-content: center;
118
+ align-items: center;
119
+ padding: 16px 0;
120
+ }
121
+
122
+ .lazer-bullet {
123
+ width: var(--lazer-bullet-size);
124
+ height: var(--lazer-bullet-size);
125
+ padding: 0;
126
+ border: none;
127
+ border-radius: 50%;
128
+ background: var(--lazer-bullet-color);
129
+ cursor: pointer;
130
+ transition:
131
+ background var(--lazer-duration) var(--lazer-easing),
132
+ transform var(--lazer-duration) var(--lazer-easing);
133
+ }
134
+
135
+ .lazer-bullet:hover {
136
+ transform: scale(var(--lazer-bullet-hover-scale));
137
+ }
138
+
139
+ .lazer-bullet:focus-visible {
140
+ outline: 2px solid var(--lazer-bullet-active-color);
141
+ outline-offset: 2px;
142
+ }
143
+
144
+ .lazer-bullet.active {
145
+ background: var(--lazer-bullet-active-color);
146
+ }
147
+
148
+ /* ============================================
149
+ Thumbnails Gallery
150
+ ============================================ */
151
+ .lazer-thumbs {
152
+ display: flex;
153
+ gap: var(--lazer-thumb-gap);
154
+ justify-content: center;
155
+ align-items: center;
156
+ padding: 16px 0;
157
+ flex-wrap: wrap;
158
+ }
159
+
160
+ .lazer-thumb {
161
+ padding: 0;
162
+ border: var(--lazer-thumb-border-width) solid var(--lazer-thumb-border-color);
163
+ border-radius: var(--lazer-thumb-border-radius);
164
+ background: none;
165
+ cursor: pointer;
166
+ opacity: var(--lazer-thumb-opacity);
167
+ transition:
168
+ opacity var(--lazer-duration) var(--lazer-easing),
169
+ border-color var(--lazer-duration) var(--lazer-easing);
170
+ }
171
+
172
+ .lazer-thumb:hover {
173
+ opacity: var(--lazer-thumb-hover-opacity);
174
+ }
175
+
176
+ .lazer-thumb:focus-visible {
177
+ outline: 2px solid var(--lazer-thumb-active-border-color);
178
+ outline-offset: 2px;
179
+ }
180
+
181
+ .lazer-thumb.active {
182
+ opacity: var(--lazer-thumb-active-opacity);
183
+ border-color: var(--lazer-thumb-active-border-color);
184
+ }
185
+
186
+ .lazer-thumb img {
187
+ display: block;
188
+ border-radius: calc(var(--lazer-thumb-border-radius) - 2px);
189
+ }
190
+
191
+ /* ============================================
192
+ Custom Scrollbar
193
+ ============================================ */
194
+ .lazer-track {
195
+ position: relative;
196
+ width: 100%;
197
+ height: var(--lazer-track-height);
198
+ background-color: var(--lazer-track-color);
199
+ border-radius: var(--lazer-track-radius);
200
+ overflow: hidden;
201
+ margin-top: 16px;
202
+ }
203
+
204
+ .lazer-scrollbar {
205
+ position: absolute;
206
+ top: 0;
207
+ left: 0;
208
+ height: 100%;
209
+ width: 100%;
210
+ transition: transform 0.1s linear;
211
+ }
212
+
213
+ /* Scrollbar thumb indicator - override thumbnail styles */
214
+ .lazer-track .lazer-thumb,
215
+ .lazer-scrollbar .lazer-thumb {
216
+ position: absolute;
217
+ top: 0;
218
+ left: 0;
219
+ height: 100%;
220
+ min-width: 32px;
221
+ background-color: var(--lazer-thumb-color);
222
+ border-radius: var(--lazer-track-radius);
223
+ border: none;
224
+ opacity: 1;
225
+ cursor: grab;
226
+ transition: width 0.2s ease;
227
+ pointer-events: auto;
228
+ }
229
+
230
+ .lazer-track .lazer-thumb:active,
231
+ .lazer-scrollbar .lazer-thumb:active {
232
+ cursor: grabbing;
233
+ }
234
+
235
+ /* ============================================
236
+ Navigation Buttons
237
+ ============================================ */
238
+ .lazer-nav {
239
+ position: absolute;
240
+ top: 50%;
241
+ transform: translateY(-50%);
242
+ z-index: 10;
243
+ display: flex;
244
+ align-items: center;
245
+ justify-content: center;
246
+ width: var(--lazer-nav-size);
247
+ height: var(--lazer-nav-size);
248
+ border: none;
249
+ border-radius: var(--lazer-nav-radius);
250
+ background: var(--lazer-nav-bg);
251
+ box-shadow: var(--lazer-nav-shadow);
252
+ cursor: pointer;
253
+ transition:
254
+ opacity var(--lazer-duration) var(--lazer-easing),
255
+ background var(--lazer-duration) var(--lazer-easing);
256
+ }
257
+
258
+ .lazer-nav:hover {
259
+ background: var(--lazer-nav-hover-bg);
260
+ }
261
+
262
+ .lazer-nav:focus-visible {
263
+ outline: 2px solid var(--lazer-bullet-active-color);
264
+ outline-offset: 2px;
265
+ }
266
+
267
+ .lazer-nav[aria-hidden="true"] {
268
+ opacity: 0;
269
+ pointer-events: none;
270
+ }
271
+
272
+ .lazer-prev {
273
+ left: var(--lazer-nav-offset);
274
+ }
275
+
276
+ .lazer-next {
277
+ right: var(--lazer-nav-offset);
278
+ }
279
+
280
+ /* ============================================
281
+ Slider Container (Optional wrapper)
282
+ ============================================ */
283
+ .lazer-slider {
284
+ position: relative;
285
+ width: 100%;
286
+ }
287
+
288
+ /* ============================================
289
+ Marquee Specific
290
+ ============================================ */
291
+ .lazer-feed.lazer-marquee {
292
+ scroll-snap-type: none;
293
+ cursor: default;
294
+ }
295
+
296
+ .lazer-feed.lazer-marquee:not(.is-dragging) {
297
+ cursor: default;
298
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lazer-slider",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "description": "A lightweight, accessible slider with smooth scroll-to-snap animations and drag-to-scroll support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",