1var D=Object.defineProperty;var X=(t,i,e)=>i in t?D(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e;var o=(t,i,e)=>(X(t,typeof i!="symbol"?i+"":i,e),e);import{S as N,g as O}from"./app.js";var R="1.3.19";function _(t,i,e){return Math.max(t,Math.min(i,e))}function Y(t,i,e){return(1-e)*t+e*i}function P(t,i,e,r){return Y(t,i,1-Math.exp(-e*r))}function V(t,i){return(t%i+i)%i}var A=class{constructor(){o(this,"isRunning",!1);o(this,"value",0);o(this,"from",0);o(this,"to",0);o(this,"currentTime",0);o(this,"lerp");o(this,"duration");o(this,"easing");o(this,"onUpdate")}advance(t){var e;if(!this.isRunning)return;let i=!1;if(this.duration&&this.easing){this.currentTime+=t;const r=_(0,this.currentTime/this.duration,1);i=r>=1;const s=i?1:this.easing(r);this.value=this.from+(this.to-this.from)*s}else this.lerp?(this.value=P(this.value,this.to,this.lerp*60,t),Math.round(this.value)===this.to&&(this.value=this.to,i=!0)):(this.value=this.to,i=!0);i&&this.stop(),(e=this.onUpdate)==null||e.call(this,this.value,i)}stop(){this.isRunning=!1}fromTo(t,i,{lerp:e,duration:r,easing:s,onStart:n,onUpdate:h}){this.from=this.value=t,this.to=i,this.lerp=e,this.duration=r,this.easing=s,this.currentTime=0,this.isRunning=!0,n==null||n(),this.onUpdate=h}};function I(t,i){let e;return function(...r){clearTimeout(e),e=setTimeout(()=>{e=void 0,t.apply(this,r)},i)}}var U=class{constructor(t,i,{autoResize:e=!0,debounce:r=250}={}){o(this,"width",0);o(this,"height",0);o(this,"scrollHeight",0);o(this,"scrollWidth",0);o(this,"debouncedResize");o(this,"wrapperResizeObserver");o(this,"contentResizeObserver");o(this,"resize",()=>{this.onWrapperResize(),this.onContentResize()});o(this,"onWrapperResize",()=>{this.wrapper instanceof Window?(this.width=window.innerWidth,this.height=window.innerHeight):(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)});o(this,"onContentResize",()=>{this.wrapper instanceof Window?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)});this.wrapper=t,this.content=i,e&&(this.debouncedResize=I(this.resize,r),this.wrapper instanceof Window?window.addEventListener("resize",this.debouncedResize):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var t,i;(t=this.wrapperResizeObserver)==null||t.disconnect(),(i=this.contentResizeObserver)==null||i.disconnect(),this.wrapper===window&&this.debouncedResize&&window.removeEventListener("resize",this.debouncedResize)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},M=class{constructor(){o(this,"events",{})}emit(t,...i){var r;const e=this.events[t]||[];for(let s=0,n=e.length;s<n;s++)(r=e[s])==null||r.call(e,...i)}on(t,i){return this.events[t]?this.events[t].push(i):this.events[t]=[i],()=>{var e;this.events[t]=(e=this.events[t])==null?void 0:e.filter(r=>i!==r)}}off(t,i){var e;this.events[t]=(e=this.events[t])==null?void 0:e.filter(r=>i!==r)}destroy(){this.events={}}},B=100/6,b={passive:!1};function W(t,i){return t===1?B:t===2?i:1}var C=class{constructor(t,i={wheelMultiplier:1,touchMultiplier:1}){o(this,"touchStart",{x:0,y:0});o(this,"lastDelta",{x:0,y:0});o(this,"window",{width:0,height:0});o(this,"emitter",new M);o(this,"onTouchStart",t=>{const{clientX:i,clientY:e}=t.targetTouches?t.targetTouches[0]:t;this.touchStart.x=i,this.touchStart.y=e,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:t})});o(this,"onTouchMove",t=>{const{clientX:i,clientY:e}=t.targetTouches?t.targetTouches[0]:t,r=-(i-this.touchStart.x)*this.options.touchMultiplier,s=-(e-this.touchStart.y)*this.options.touchMultiplier;this.touchStart.x=i,this.touchStart.y=e,this.lastDelta={x:r,y:s},this.emitter.emit("scroll",{deltaX:r,deltaY:s,event:t})});o(this,"onTouchEnd",t=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:t})});o(this,"onWheel",t=>{let{deltaX:i,deltaY:e,deltaMode:r}=t;const s=W(r,this.window.width),n=W(r,this.window.height);i*=s,e*=n,i*=this.options.wheelMultiplier,e*=this.options.wheelMultiplier,this.emitter.emit("scroll",{deltaX:i,deltaY:e,event:t})});o(this,"onWindowResize",()=>{this.window={width:window.innerWidth,height:window.innerHeight}});this.element=t,this.options=i,window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,b),this.element.addEventListener("touchstart",this.onTouchStart,b),this.element.addEventListener("touchmove",this.onTouchMove,b),this.element.addEventListener("touchend",this.onTouchEnd,b)}on(t,i){return this.emitter.on(t,i)}destroy(){this.emitter.destroy(),window.removeEventListener("resize",this.onWindowResize),this.element.removeEventListener("wheel",this.onWheel,b),this.element.removeEventListener("touchstart",this.onTouchStart,b),this.element.removeEventListener("touchmove",this.onTouchMove,b),this.element.removeEventListener("touchend",this.onTouchEnd,b)}},H=t=>Math.min(1,1.001-2**(-10*t)),q=class{constructor({wrapper:t=window,content:i=document.documentElement,eventsTarget:e=t,smoothWheel:r=!0,syncTouch:s=!1,syncTouchLerp:n=.075,touchInertiaExponent:h=1.7,duration:d,easing:u,lerp:p=.1,infinite:w=!1,orientation:m="vertical",gestureOrientation:l=m==="horizontal"?"both":"vertical",touchMultiplier:f=1,wheelMultiplier:c=1,autoResize:S=!0,prevent:v,virtualScroll:a,overscroll:g=!0,autoRaf:y=!1,anchors:E=!1,autoToggle:T=!1,allowNestedScroll:L=!1,__experimental__naiveDimensions:z=!1,naiveDimensions:k=z,stopInertiaOnNavigate:x=!1}={}){o(this,"_isScrolling",!1);o(this,"_isStopped",!1);o(this,"_isLocked",!1);o(this,"_preventNextNativeScrollEvent",!1);o(this,"_resetVelocityTimeout",null);o(this,"_rafId",null);o(this,"isTouching");o(this,"time",0);o(this,"userData",{});o(this,"lastVelocity",0);o(this,"velocity",0);o(this,"direction",0);o(this,"options");o(this,"targetScroll");o(this,"animatedScroll");o(this,"animate",new A);o(this,"emitter",new M);o(this,"dimensions");o(this,"virtualScroll");o(this,"onScrollEnd",t=>{t instanceof CustomEvent||(this.isScrolling==="smooth"||this.isScrolling===!1)&&t.stopPropagation()});o(this,"dispatchScrollendEvent",()=>{this.options.wrapper.dispatchEvent(new CustomEvent("scrollend",{bubbles:this.options.wrapper===window,detail:{lenisScrollEnd:!0}}))});o(this,"onTransitionEnd",t=>{t.propertyName.includes("overflow")&&this.checkOverflow()});o(this,"onClick",t=>{const r=t.composedPath().filter(n=>n instanceof HTMLAnchorElement&&n.href).map(n=>
1new URL(n.href)),s=new URL(window.location.href);if(this.options.anchors){const n=r.find(h=>s.host===h.host&&s.pathname===h.pathname&&h.hash);if(n){const h=typeof this.options.anchors=="object"&&this.options.anchors?this.options.anchors:void 0,d=`#${n.hash.split("#")[1]}`;this.scrollTo(d,h);return}}if(this.options.stopInertiaOnNavigate&&r.some(h=>s.host===h.host&&s.pathname!==h.pathname)){this.reset();return}});o(this,"onPointerDown",t=>{t.button===1&&this.reset()});o(this,"onVirtualScroll",t=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(t)===!1)return;const{deltaX:i,deltaY:e,event:r}=t;if(this.emitter.emit("virtual-scroll",{deltaX:i,deltaY:e,event:r}),r.ctrlKey||r.lenisStopPropagation)return;const s=r.type.includes("touch"),n=r.type.includes("wheel");this.isTouching=r.type==="touchstart"||r.type==="touchmove";const h=i===0&&e===0;if(this.options.syncTouch&&s&&r.type==="touchstart"&&h&&!this.isStopped&&!this.isLocked){this.reset();return}const u=this.options.gestureOrientation==="vertical"&&e===0||this.options.gestureOrientation==="horizontal"&&i===0;if(h||u)return;let p=r.composedPath();p=p.slice(0,p.indexOf(this.rootElement));const w=this.options.prevent,m=Math.abs(i)>=Math.abs(e)?"horizontal":"vertical";if(p.find(a=>{var g,y,E,T,L;return a instanceof HTMLElement&&(typeof w=="function"&&(w==null?void 0:w(a))||((g=a.hasAttribute)==null?void 0:g.call(a,"data-lenis-prevent"))||m==="vertical"&&((y=a.hasAttribute)==null?void 0:y.call(a,"data-lenis-prevent-vertical"))||m==="horizontal"&&((E=a.hasAttribute)==null?void 0:E.call(a,"data-lenis-prevent-horizontal"))||s&&((T=a.hasAttribute)==null?void 0:T.call(a,"data-lenis-prevent-touch"))||n&&((L=a.hasAttribute)==null?void 0:L.call(a,"data-lenis-prevent-wheel"))||this.options.allowNestedScroll&&this.hasNestedScroll(a,{deltaX:i,deltaY:e}))}))return;if(this.isStopped||this.isLocked){r.cancelable&&r.preventDefault();return}if(!(this.options.syncTouch&&s||this.options.smoothWheel&&n)){this.isScrolling="native",this.animate.stop(),r.lenisStopPropagation=!0;return}let f=e;this.options.gestureOrientation==="both"?f=Math.abs(e)>Math.abs(i)?e:i:this.options.gestureOrientation==="horizontal"&&(f=i),(!this.options.overscroll||this.options.infinite||this.options.wrapper!==window&&this.limit>0&&(this.animatedScroll>0&&this.animatedScroll<this.limit||this.animatedScroll===0&&e>0||this.animatedScroll===this.limit&&e<0))&&(r.lenisStopPropagation=!0),r.cancelable&&r.preventDefault();const c=s&&this.options.syncTouch,v=s&&r.type==="touchend";v&&(f=Math.sign(this.velocity)*Math.abs(this.velocity)**this.options.touchInertiaExponent),this.scrollTo(this.targetScroll+f,{programmatic:!1,...c?{lerp:v?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}})});o(this,"onNativeScroll",()=>{if(this._resetVelocityTimeout!==null&&(clearTimeout(this._resetVelocityTimeout),this._resetVelocityTimeout=null),this._preventNextNativeScrollEvent){this._preventNextNativeScrollEvent=!1;return}if(this.isScrolling===!1||this.isScrolling==="native"){const t=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-t,this.direction=Math.sign(this.animatedScroll-t),this.isStopped||(this.isScrolling="native"),this.emit(),this.velocity!==0&&(this._resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}});o(this,"raf",t=>{const i=t-(this.time||t);this.time=t,this.animate.advance(i*.001),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))});window.lenisVersion=R,window.lenis||(window.lenis={}),window.lenis.version=R,m==="horizontal"&&(window.lenis.horizontal=!0),s===!0&&(window.lenis.touch=!0),(!t||t===document.documentElement)&&(t=window),typeof d=="number"&&typeof u!="function"?u=H:typeof u=="function"&&typeof d!="number"&&(d=1),this.options={wrapper:t,content:i,eventsTarget:e,smoothWheel:r,syncTouch:s,syncTouchLerp:n,touchInertiaExponent:h,duration:d,easing:u,lerp:p,infinite:w,gestureOrientation:l,orientation:m,touchMultiplier:f,
1wheelMultiplier:c,autoResize:S,prevent:v,virtualScroll:a,overscroll:g,autoRaf:y,anchors:E,autoToggle:T,allowNestedScroll:L,naiveDimensions:k,stopInertiaOnNavigate:x},this.dimensions=new U(t,i,{autoResize:S}),this.updateClassName(),this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll),this.options.wrapper.addEventListener("scrollend",this.onScrollEnd,{capture:!0}),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.addEventListener("click",this.onClick),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown),this.virtualScroll=new C(e,{touchMultiplier:f,wheelMultiplier:c}),this.virtualScroll.on("scroll",this.onVirtualScroll),this.options.autoToggle&&(this.checkOverflow(),this.rootElement.addEventListener("transitionend",this.onTransitionEnd)),this.options.autoRaf&&(this._rafId=requestAnimationFrame(this.raf))}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll),this.options.wrapper.removeEventListener("scrollend",this.onScrollEnd,{capture:!0}),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown),(this.options.anchors||this.options.stopInertiaOnNavigate)&&this.options.wrapper.removeEventListener("click",this.onClick),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName(),this._rafId&&cancelAnimationFrame(this._rafId)}on(t,i){return this.emitter.on(t,i)}off(t,i){return this.emitter.off(t,i)}get overflow(){const t=this.isHorizontal?"overflow-x":"overflow-y";return getComputedStyle(this.rootElement)[t]}checkOverflow(){["hidden","clip"].includes(this.overflow)?this.internalStop():this.internalStart()}setScroll(t){this.isHorizontal?this.options.wrapper.scrollTo({left:t,behavior:"instant"}):this.options.wrapper.scrollTo({top:t,behavior:"instant"})}resize(){this.dimensions.resize(),this.animatedScroll=this.targetScroll=this.actualScroll,this.emit()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){if(this.isStopped){if(this.options.autoToggle){this.rootElement.style.removeProperty("overflow");return}this.internalStart()}}internalStart(){this.isStopped&&(this.reset(),this.isStopped=!1,this.emit())}stop(){if(!this.isStopped){if(this.options.autoToggle){this.rootElement.style.setProperty("overflow","clip");return}this.internalStop()}}internalStop(){this.isStopped||(this.reset(),this.isStopped=!0,this.emit())}scrollTo(t,{offset:i=0,immediate:e=!1,lock:r=!1,programmatic:s=!0,lerp:n=s?this.options.lerp:void 0,duration:h=s?this.options.duration:void 0,easing:d=s?this.options.easing:void 0,onStart:u,onComplete:p,force:w=!1,userData:m}={}){if((this.isStopped||this.isLocked)&&!w)return;let l=t,f=i;if(typeof l=="string"&&["top","left","start","#"].includes(l))l=0;else if(typeof l=="string"&&["bottom","right","end"].includes(l))l=this.limit;else{let c=null;if(typeof l=="string"?(c=document.querySelector(l),c||(l==="#top"?l=0:console.warn("Lenis: Target not found",l))):l instanceof HTMLElement&&(l!=null&&l.nodeType)&&(c=l),c){if(this.options.wrapper!==window){const v=this.rootElement.getBoundingClientRect();f-=this.isHorizontal?v.left:v.top}const S=c.getBoundingClientRect();l=(this.isHorizontal?S.left:S.top)+this.animatedScroll}}if(typeof l=="number"){if(l+=f,l=Math.round(l),this.options.infinite){if(s){this.targetScroll=this.animatedScroll=this.scroll;const c=l-this.animatedScroll;c>this.limit/2?l-=this.limit:c<-this.limit/2&&(l+=this.limit)}}else l=_(0,l,this.limit);if(l===this.targetScroll){u==null||u(this),p==null||p(this);return}if(this.userData=m??{},e){this.animatedScroll=this.targetScroll=l,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),p==null||p(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()});return}s||(this.targetScroll=l),typeof h=="number"&&typeof d!="function"?d=H:typeof d=="function"&&typeof h!="number"&&(h=1),this.animate.fromTo(this.animatedScroll,l,{duration:h,easing:d,lerp:n,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling="smooth",u==null||u(this)},onUpdate:(c,S)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=c-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=c,this.setScroll(this.scroll),s&&(this.targetScroll=c),S||this.emit
1(),S&&(this.reset(),this.emit(),p==null||p(this),this.userData={},requestAnimationFrame(()=>{this.dispatchScrollendEvent()}),this.preventNextNativeScrollEvent())}})}}preventNextNativeScrollEvent(){this._preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{this._preventNextNativeScrollEvent=!1})}hasNestedScroll(t,{deltaX:i,deltaY:e}){const r=Date.now();t._lenis||(t._lenis={});const s=t._lenis;let n,h,d,u,p,w,m,l,f,c;if(r-(s.time??0)>2e3){s.time=Date.now();const z=window.getComputedStyle(t);if(s.computedStyle=z,n=["auto","overlay","scroll"].includes(z.overflowX),h=["auto","overlay","scroll"].includes(z.overflowY),p=["auto"].includes(z.overscrollBehaviorX),w=["auto"].includes(z.overscrollBehaviorY),s.hasOverflowX=n,s.hasOverflowY=h,!(n||h))return!1;m=t.scrollWidth,l=t.scrollHeight,f=t.clientWidth,c=t.clientHeight,d=m>f,u=l>c,s.isScrollableX=d,s.isScrollableY=u,s.scrollWidth=m,s.scrollHeight=l,s.clientWidth=f,s.clientHeight=c,s.hasOverscrollBehaviorX=p,s.hasOverscrollBehaviorY=w}else d=s.isScrollableX,u=s.isScrollableY,n=s.hasOverflowX,h=s.hasOverflowY,m=s.scrollWidth,l=s.scrollHeight,f=s.clientWidth,c=s.clientHeight,p=s.hasOverscrollBehaviorX,w=s.hasOverscrollBehaviorY;if(!(n&&d||h&&u))return!1;const S=Math.abs(i)>=Math.abs(e)?"horizontal":"vertical";let v,a,g,y,E,T;if(S==="horizontal")v=Math.round(t.scrollLeft),a=m-f,g=i,y=n,E=d,T=p;else if(S==="vertical")v=Math.round(t.scrollTop),a=l-c,g=e,y=h,E=u,T=w;else return!1;return!T&&(v>=a||v<=0)?!0:(g>0?v<a:v>0)&&y&&E}get rootElement(){return this.options.wrapper===window?document.documentElement:this.options.wrapper}get limit(){return this.options.naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){const t=this.options.wrapper;return this.isHorizontal?t.scrollX??t.scrollLeft:t.scrollY??t.scrollTop}get scroll(){return this.options.infinite?V(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this._isScrolling}set isScrolling(t){this._isScrolling!==t&&(this._isScrolling=t,this.updateClassName())}get isStopped(){return this._isStopped}set isStopped(t){this._isStopped!==t&&(this._isStopped=t,this.updateClassName())}get isLocked(){return this._isLocked}set isLocked(t){this._isLocked!==t&&(this._isLocked=t,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let t="lenis";return this.options.autoToggle&&(t+=" lenis-autoToggle"),this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isScrolling==="smooth"&&(t+=" lenis-smooth"),t}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};O.registerPlugin(N);class j{constructor(){this.lenis=new q({duration:1,easing:i=>i===1?1:1-Math.pow(2,-10*i),direction:"vertical",gestureDirection:"vertical",smoothWheel:!0,smoothTouch:!1,smoothTouch:!1}),N.addEventListener("refresh",()=>this.lenis.resize()),this.lenis.on("scroll",N.update),O.ticker.add(i=>this.lenis.raf(i*1e3)),O.ticker.lagSmoothing(0)}}export{j as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.