svg-scroll-draw 2.17.1 → 2.18.1
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/README.md +3 -2
- package/dist/angular/index.cjs +2 -2
- package/dist/angular/index.mjs +1 -1
- package/dist/{chunk-HMSNYXKW.mjs → chunk-CTVQDBD3.mjs} +1 -1
- package/dist/chunk-TIRZOSQ4.mjs +1 -0
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +9 -2
- package/dist/horizontal/index.d.ts +9 -2
- package/dist/horizontal/index.mjs +1 -1
- package/dist/nuxt/index.cjs +2 -2
- package/dist/nuxt/index.mjs +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.mjs +1 -1
- package/dist/solid/index.cjs +2 -2
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +2 -2
- package/dist/svelte/index.mjs +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.mts +11 -0
- package/dist/video/index.d.ts +11 -0
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-JC5BD4RB.mjs +0 -1
package/README.md
CHANGED
|
@@ -219,6 +219,7 @@ import { ScrollVideo } from 'svg-scroll-draw/react';
|
|
|
219
219
|
| `easing` | `string \| fn` | `"linear"` | — |
|
|
220
220
|
| `once` | `boolean` | `false` | — |
|
|
221
221
|
| `preload` | `"auto" \| "metadata"` | `"auto"` | Sets `preload` attribute if not already present |
|
|
222
|
+
| `triggerElement` | `Element` | the video | Measure the trigger window from this element — the tall track behind a `position: sticky` stage, so a pinned film scrubs the length of the pin (2.18.0) |
|
|
222
223
|
| `onReady` | `() => void` | — | Fires when video metadata is loaded |
|
|
223
224
|
| `onProgress` | `(n: number) => void` | — | — |
|
|
224
225
|
| `onComplete` | `() => void` | — | — |
|
|
@@ -629,8 +630,8 @@ devtools.highlight('#my-element'); // outline for 2 seconds
|
|
|
629
630
|
| Entry | Gzipped |
|
|
630
631
|
|---|---|
|
|
631
632
|
| `svg-scroll-draw` (main, every core API) | 10.7 KB |
|
|
632
|
-
| `svg-scroll-draw/react` (includes the engine) | 12.
|
|
633
|
-
| `svg-scroll-draw` + `svg-scroll-draw/react` (together; the engine ships once) | 13.
|
|
633
|
+
| `svg-scroll-draw/react` (includes the engine) | 12.1 KB |
|
|
634
|
+
| `svg-scroll-draw` + `svg-scroll-draw/react` (together; the engine ships once) | 13.5 KB |
|
|
634
635
|
| `svg-scroll-draw/reveal` | 5.0 KB |
|
|
635
636
|
| `svg-scroll-draw/text` | 2.8 KB |
|
|
636
637
|
| `svg-scroll-draw/video` | 2.3 KB |
|
package/dist/angular/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';function Zt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let
|
|
1
|
+
'use strict';function Zt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let S=Math.pow(l,d);c.push(S),s+=S;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let S=0;S<r;S++)if(d<=u[S+1]){let z=(d-u[S])/(u[S+1]-u[S]);if(S===0)return z*(2-z);let L=1-Math.pow(t,S);return L+(1-L)*(2*z-1)*(2*z-1)}return 1}}function Jt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var te={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Zt(),elastic:Jt()};function ht(e,n,r){return Math.min(r,Math.max(n,e))}function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function bt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function wt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function J(e,n,r,t){return r===n?0:ht((e-n)/(r-n)*t,0,1)}function xe(e,n,r,t,l){let s=bt(e.top,e.height,n,t.element)-wt(t.viewport,r),c=bt(e.top,e.height,n,l.element)-wt(l.viewport,r);return {tStart:s,tEnd:c}}function Je(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function qe(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function vt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,n,r){let t=vt(e),l=vt(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var Et={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var je=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ge(e,...n){je&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var er="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",tr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function nr(e){let n=[];for(let r=0;r<St;r++){let t=r/(St-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return er;case "ease-out":return tr;case "ease-in-out":return rr()?nr(te["ease-in-out"]):null;default:return null}}var Tt=Symbol.for("svg-scroll-draw.registry");function xt(){let e=globalThis;return e[Tt]||(e[Tt]=new Map)}function $e(e,n){xt().set(e,n);}function Pe(e){xt().delete(e);}var or=0;function sr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Mt(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var At=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function ir(e){if(!je)return;let n=Mt(e,"stroke");if(!n||n==="none"){ge("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!At.has(r)&&!At.has(Mt(e,"fill"))&&ge("Element has a fill \u2014 it may obscure the stroke animation.",e);}function ar(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
|
|
2
2
|
<div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Lt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,$t=/[MmLlHhVvCcSsQqTtAaZz]/g;function lr(e,n,r){if(!je)return;let t=(e.match($t)??[]).join("").toUpperCase(),l=(n.match($t)??[]).join("").toUpperCase(),s=(e.match(Lt)??[]).length,c=(n.match(Lt)??[]).length;if(t!==l){he(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&he(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function it(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Pt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:z=0,direction:M="forward",once:ne=false,debug:$e=false,axis:B="y",scrollContainer:ee,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:P,fillOpacity:L,waypoints:w,velocityScale:O=false,threshold:F=0,rootMargin:C="0px",repeat:E=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:te=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:$,onLeave:S,onEnterBack:N,onLeaveBack:fe}=l,K=se===true?"left":typeof se=="string"?se:false,ve=typeof p=="function"?p:re[p]??re.linear,Pe=de(T.start??"top bottom"),Ve=de(T.end??"bottom top"),be=typeof ee=="string"?document.querySelector(ee):ee??null,we=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(P)?P[0]:null,j=Array.isArray(P)?P[1]:typeof P=="number"?P:null,pe=Array.isArray(L)?L[0]:null,Q=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Ce(o){let a=o*100;switch(K){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let V=K?[]:Array.from(e.querySelectorAll(c)),k=[],i=[],f=0,ge=0,R=false,_=false,q=0,xe=false,Ee=-1,Z=[],De=-1,U=false,ke=0,Ie=0,Ne,tt=null;function ct(){tt?.destroy(),tt=null;}let Re=new Set,ut=NaN,He=true,Ue=-1,mt=performance.now(),_e=NaN;function rt(){return be?B==="x"?be.scrollLeft:be.scrollTop:B==="x"?window.scrollX:window.scrollY}function ft(){return be?B==="x"?be.clientWidth:be.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function pt(){let o=Je(e,be,B);return Te(o,o.scroll,ft(),Pe,Ve)}function dt(){(({tStart:f,tEnd:ge}=pt())),$e&&je&&(ct(),tt=ar(f,ge,B));}function nt(o,a=pt){Ae(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),Le(e);},o}function Yt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),K){let b=a==="reverse"?1-o:o;e.style.clipPath=Ce(b);return}V.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${k[ue]*o}`:`${k[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),we&&le?b.style.stroke=We(we,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Q!==null?b.style.fillOpacity=`${pe+(Q-pe)*o}`:Q!==null&&(b.style.fillOpacity=`${Q}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",it(i[ue],D,o));});}function Ye(){if(e.style.setProperty("--scroll-draw-progress","0"),K){e.style.clipPath=Ce(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${k[a]}`,o.style.strokeDashoffset=M==="reverse"?"0":`${k[a]}`,m?o.style.opacity=M==="reverse"?"1":"0":o.style.opacity="",we&&(o.style.stroke=we),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{ir(o);let a=qe(o);k.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?lr(i[i.length-1],D,o):he(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=M==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Q!==null&&(o.style.fillOpacity=`${Q}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=M==="reverse"?"0":`${a}`,m?o.style.opacity=M==="reverse"?"1":"0":o.style.opacity="",we&&(o.style.stroke=we),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),K){if(s)return e.style.clipPath=Ce(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ce(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof p=="string"?et(p):null;function Xt(){return !(ae===false||!sr()||!V.length||!gt||K||B!=="y"||be||u!==1||z!==0||ne||X||O!==false||D||w||E||G>0||d||x||g||$||S||N||fe||A!=null||P!=null||L!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Kt(){let o=++or,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Fe=M==="reverse"?"0":"var(--ssd-len)",Oe=M==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${Fe};`,v=`stroke-dashoffset:${Oe};`;m&&(Me+=`opacity:${M==="reverse"?1:0};`,v+=`opacity:${M==="reverse"?0:1};`);let I=document.createElement("style");I.setAttribute("data-svg-scroll-draw",""),I.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(b);function me(y,Y){y.style.setProperty("--ssd-len",String(k[Y])),y.style.strokeDasharray=`${k[Y]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}V.forEach(me);let h=false,H=-1;function W(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:Y,tEnd:Se}=Te({top:y.top,height:y.height},rt(),ft(),Pe,Ve);return ve(J(rt(),Y,Se,u))}return {destroy(){e.classList.remove(b),V.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),I.remove();},replay(){h=false,H=-1,V.forEach(me);},pause(){h=true,V.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,V.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let Y=Math.min(1,Math.max(0,y));H=Y,h=true,V.forEach((Se,ye)=>{Se.classList.remove(a),Se.style.strokeDashoffset=M==="reverse"?`${k[ye]*Y}`:`${k[ye]*(1-Y)}`,m&&(Se.style.opacity=M==="reverse"?`${1-Y}`:`${Y}`);});},getProgress(){return W()},refresh(){V.forEach((y,Y)=>{k[Y]=qe(y),y.style.setProperty("--ssd-len",String(k[Y])),y.style.strokeDasharray=`${k[Y]}`;});}}}if(Xt())return nt(Kt());function Qt(){let o=Math.max(1,te),a=0,b=0,ue=false;function Fe(h){let H=true;if(K){let W=Math.min(1,Math.max(0,h/o)),y=ve(W);ke=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ce(M==="reverse"?1-y:y),d?.(y),W<1&&(H=false);}else V.forEach((W,y)=>{let Y=y*z*o,Se=Math.min(1,Math.max(0,(h-Y)/o)),ye=ve(Se);W.style.strokeDashoffset=M==="reverse"?`${k[y]*ye}`:`${k[y]*(1-ye)}`,m&&(W.style.opacity=M==="reverse"?`${1-ye}`:`${ye}`),we&&le?W.style.stroke=We(we,le,ye):le&&(W.style.stroke=le),ce!==null&&j!==null?W.style.strokeWidth=`${ce+(j-ce)*ye}`:j!==null&&(W.style.strokeWidth=`${j}`),pe!==null&&Q!==null?W.style.fillOpacity=`${pe+(Q-pe)*ye}`:Q!==null&&(W.style.fillOpacity=`${Q}`),D&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",it(i[y],D,ye)),y===0&&(ke=ye,d?.(ye),e.style.setProperty("--scroll-draw-progress",String(ye))),Se<1&&(H=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=ve(W);for(let Y in w){let Se=parseFloat(Y);y>=Se&&!Re.has(Se)&&(Re.add(Se),w[Y]?.());}}return H}function Oe(h){if(U)return;let H=h-a;_||(_=true,x?.());let W=Fe(H);if(W&&!R){R=true,Fe(o*(1+Math.max(0,V.length-1)*z)),g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{a=performance.now(),_=false,R=false,Re.clear(),Ye(),q=requestAnimationFrame(Oe);},oe));return}W||(q=requestAnimationFrame(Oe));}function Me(){cancelAnimationFrame(q),clearTimeout(Ne),a=performance.now(),b=0,U=false,_=false,R=false,Ie=0,ue=true,ke=0,Re.clear(),Ye(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(ne&&R)?Me():!H.isIntersecting&&!ne&&!R&&(cancelAnimationFrame(q),clearTimeout(Ne),ue=false);});},{root:be??null,threshold:F,rootMargin:C}),I;function me(){clearTimeout(I),I=setTimeout(()=>{V.forEach((h,H)=>{k[H]=qe(h),h.style.strokeDasharray=`${k[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Ne),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(I);},replay(){Ie=0,Me();},pause(){U||!ue||(U=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){U&&(U=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let H=Math.min(1,Math.max(0,h));ke=H,U=true,b=H*o,a=performance.now()-b,cancelAnimationFrame(q),Fe(b);},getProgress(){return ke},refresh(){clearTimeout(I),V.forEach((h,H)=>{k[H]=qe(h),h.style.strokeDasharray=`${k[H]}`;});}}}if(ie)return nt(Qt());dt();function Xe(){if(!xe||U)return;let o=performance.now(),a=rt();if(!He&&O===false&&a===ut){q=requestAnimationFrame(Xe);return}He=false,ut=a;let b=u;if(O!==false){let v=o-mt,I=v>0?Math.abs(a-(Ue<0?a:Ue))/v:0;b=u*Math.max(.2,1+I*(typeof O=="number"?O:1)*.04);}Ue=a,mt=o;let ue=X?De===-1||a>=De?"forward":"reverse":M;De=a;let Fe=ge-f,Oe=true,Me=Fe===0?0:(a-f)/Fe;if(isNaN(_e)||(_e<=0&&Me>0?$?.():_e>0&&Me<=0&&fe?.(),_e<1&&Me>=1?S?.():_e>=1&&Me<1&&N?.()),_e=Me,K){let v=ve(J(a,f,ge,b));ne&&!X&&(Ee=Math.max(Ee,v),v=Ee),ke=v,e.style.setProperty("--scroll-draw-progress",String(v));let I=ue==="reverse"?1-v:v;e.style.clipPath=Ce(I),d?.(v),!_&&J(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!R?(R=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{Ee=-1,_=false,R=false,e.style.clipPath=Ce(0);},oe))):v<1&&!ne&&(R=false),q=requestAnimationFrame(Xe);return}if(V.forEach((v,I)=>{let me=I*z*Fe,h=ve(J(a,f+me,ge+me,b));ne&&!X&&(h=Z[I]=Math.max(Z[I]??Ee,h)),ke=h,v.style.strokeDashoffset=ue==="reverse"?`${k[I]*h}`:`${k[I]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),we&&le?v.style.stroke=We(we,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Q!==null?v.style.fillOpacity=`${pe+(Q-pe)*h}`:Q!==null&&(v.style.fillOpacity=`${Q}`),D&&v.tagName.toLowerCase()==="path"&&i[I]&&v.setAttribute("d",it(i[I],D,h)),I===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=ve(J(a,f,ge,b));for(let I in w){let me=parseFloat(I);v>=me&&!Re.has(me)&&(Re.add(me),w[I]?.());}}!_&&J(a,f,ge,b)>0&&(_=true,x?.()),Oe&&!R?(R=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{Ee=-1,Z=[],_=false,R=false,Re.clear(),Ye(),He=true;},oe))):!Oe&&!ne&&(R=false),q=requestAnimationFrame(Xe);}let ot=false;function Ke(){ot||(ot=true,q=requestAnimationFrame(function(){Xe();}));}function Qe(){ot=false,cancelAnimationFrame(q);}let st=new IntersectionObserver(o=>{o.forEach(a=>{xe=a.isIntersecting,xe&&!U?(He=true,Ke()):Qe();});},{root:be??null,threshold:F,rootMargin:C});function yt(){V.forEach((o,a)=>{k[a]=qe(o),o.style.strokeDasharray=`${k[a]}`;}),dt(),He=true;}let Ze;function Be(){clearTimeout(Ze),Ze=setTimeout(yt,150);}window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be);let Ge;return typeof ResizeObserver<"u"&&(Ge=new ResizeObserver(()=>Be()),Ge.observe(document.body),Ge.observe(document.documentElement),Ge.observe(e)),G>0?setTimeout(()=>st.observe(e),G):st.observe(e),nt({destroy(){cancelAnimationFrame(q),clearTimeout(Ne),Qe(),st.disconnect(),Ge?.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ze),ct();},replay(){Ee=-1,Z=[],De=-1,Ue=-1,_=false,R=false,Ie=0,U=false,ke=0,Re.clear(),clearTimeout(Ne),Ye(),He=true,xe&&Ke();},pause(){U=true,Qe();},resume(){U&&(U=false,He=true,xe&&Ke());},seek(o){let a=Math.min(1,Math.max(0,o));ke=a,Ee=a,Z=[],U=true,Qe(),Yt(a,M),He=true;},getProgress(){return ke},refresh(){clearTimeout(Ze),yt(),xe&&!U&&Ke();}},()=>({tStart:f,tEnd:ge}))}var Ct=new WeakMap,cr=0;function at(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=Ct.get(r);return t===void 0&&Ct.set(r,t=++cr),`el#${t}`}return r})}function kt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...l)=>n()[t]?.(...l));return r}function ur(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ot(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function mr(e,n,r){let t=Ot(e),l=Ot(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function It(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(ur(t))return We(t,l,r);if(t.includes("("))return mr(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function fr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var pr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),dr=0,Ft="--scroll-draw-progress";function gr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Dt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:z=false,respectReducedMotion:M=true,triggerElement:ne,onProgress:$e,onComplete:B,onEnter:ee,onLeave:X,onEnterBack:G,onLeaveBack:A}=n,P=M&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:re[s]??re["ease-out"],w=de(l.start??"top bottom"),O=de(l.end??"bottom top"),F=ne??e,C=typeof p=="string"?document.querySelector(p):p??null,E=Object.entries(t).map(([i,f])=>({prop:fr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...E.map(f=>f.prop),Ft])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(P)return D(),B?.(),{...r,destroy:ie,getProgress:()=>1};oe();let te=typeof s=="string"?et(s):null;function ae(){if(!T||!gr()||!te||m!=="y"||C||F!==e||u||c!==1||$e||B||ee||X||G||A||z!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!pr.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++dr}`,f=E.map(Z=>`${Z.prop}:${Z.from}`).join(";"),ge=E.map(Z=>`${Z.prop}:${Z.to}`).join(";"),R=document.createElement("style");R.setAttribute("data-ssd-animate",""),R.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${te};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,xe=()=>{let Z=e.getBoundingClientRect();return Te({top:Z.top,height:Z.height},_(),q(),w,O)};Ae(e,{type:"animate",getProgress:()=>Ee.getProgress(),getTrigger:xe});let Ee={destroy(){e.classList.remove(i),R.remove(),e.style.animationPlayState="",ie(),Le(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(Z){let De=Math.min(1,Math.max(0,Z));e.classList.remove(i);for(let U of E)e.style.setProperty(U.prop,It(U.from,U.to,De));},getProgress(){let{tStart:Z,tEnd:De}=xe();return L(J(_(),Z,De,c))}};return Ee}if(ae())return d();let x=0,g=0,$=0,S=false,N=false,fe=-1,K=0,ve=false,Pe=NaN,Ve=-1,be=0,we=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Je(F,C,m),f=Te(i,i.scroll,le(),w,O);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Ft,String(i));for(let f of E)e.style.setProperty(f.prop,It(f.from,f.to,i));$e?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?ee?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Q(){if(!S||N)return;let i=performance.now(),f=we(),ge=c;if(z!==false){let q=i-be,xe=q>0?Math.abs(f-(Ve<0?f:Ve))/q:0;ge=c*Math.max(.2,1+xe*(typeof z=="number"?z:1)*.04);}Ve=f,be=i;let R=g===x?0:(f-x)/(g-x);pe(R);let _=L(J(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),K=_,j(_),_>=1&&!ve?(ve=true,B?.()):_<1&&!u&&(ve=false),$=requestAnimationFrame(Q);}ce(),g===x&&he("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=L(J(we(),x,g,c));u&&i>0&&(fe=i),K=i,j(i);}let Ce=new IntersectionObserver(i=>{i.forEach(f=>{S=f.isIntersecting,S&&!N?$=requestAnimationFrame(Q):cancelAnimationFrame($);});},{root:C??null}),V;function k(){clearTimeout(V),V=setTimeout(ce,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),Ce.observe(e),Ae(e,{type:"animate",getProgress:()=>K,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame($),Ce.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(V),ie(),Le(e);},replay(){fe=-1,ve=false,K=0,N=false,j(0);},pause(){N=true,cancelAnimationFrame($);},resume(){N&&(N=false,S&&($=requestAnimationFrame(Q)));},seek(i){let f=Math.min(1,Math.max(0,i));K=f,fe=f,N=true,cancelAnimationFrame($),j(f);},getProgress(){return K}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Nt(e,n){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return he("scrollCounter: element not found:",e),lt;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:z}=n,M=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],$e=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=M(s),z?.(),lt;let X=0,G=0,A=0,P=false,L=false,w=-1,O=0,F=false,C=()=>window.scrollY,E=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=Te({top:d.top,height:d.height},C(),E(),$e,B);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=M(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!P||L)return;let d=ne(J(C(),X,G,1));p&&(w=Math.max(w,d),d=w),O=d,D(d),d>=1&&!F?(F=true,z?.()):d<1&&!p&&(F=false),A=requestAnimationFrame(se);}oe();{let d=ne(J(C(),X,G,1));p&&d>0&&(w=d),O=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{P=x.isIntersecting,P&&!L?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),te;function ae(){clearTimeout(te),te=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Ae(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(te),Le(t);},replay(){w=-1,F=false,O=0,L=false,D(0);},pause(){L=true,cancelAnimationFrame(A);},resume(){L&&(L=false,P&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));O=x,w=x,L=true,cancelAnimationFrame(A),D(x);},getProgress(){return O}}}var Rt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ht(e,n={}){if(typeof window>"u")return Rt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return he("scrollVideo: <video> element not found:",e),Rt;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:z}=n,M=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,$e=de(l.start??"top top"),B=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let ee=n.from??0,X=n.to,G=0,A=0,P=0,L=false,w=false,O=-1,F=0,C=false,E=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let S=t.getBoundingClientRect(),N=u==="x"?S.left:S.top,fe=u==="x"?S.width:S.height,K=Te({top:N,height:fe},oe(),D(),$e,B);G=K.tStart,A=K.tEnd;}let ie=NaN;function te(S){if(!E)return;let N=X??t.duration??0,fe=ee+(N-ee)*S;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(S)),z?.(S);}function ae(){if(!L||w||!E||M)return;let S=ne(J(oe(),G,A,1));c&&(O=Math.max(O,S),S=O),F=S,te(S),S>=1&&!C?(C=true,T?.()):S<1&&!c&&(C=false),P=requestAnimationFrame(ae);}function d(){if(E=true,X===void 0&&(X=t.duration),M){te(1),p?.();return}se(),p?.(),L&&!w&&(P=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),E||se();let x=new IntersectionObserver(S=>{S.forEach(N=>{L=N.isIntersecting,L&&!w&&E?P=requestAnimationFrame(ae):cancelAnimationFrame(P);});}),g;function $(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),x.observe(t),Ae(t,{type:"video",getProgress:()=>F,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame(P),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(g),Le(t);},replay(){O=-1,C=false,F=0,w=false,ie=NaN,te(0);},pause(){w=true,cancelAnimationFrame(P);},resume(){w&&(w=false,L&&E&&(P=requestAnimationFrame(ae)));},seek(S){let N=Math.min(1,Math.max(0,S));F=N,O=N,w=true,cancelAnimationFrame(P),ie=NaN,te(N);},getProgress(){return F}}}function _t(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function yr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function zt(e){let n=_t(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function hr(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function br(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function qt(e,n={}){if(typeof window>"u")return Vt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return he("scrollText: element not found:",e),Vt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),$e=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;l==="chars"?ee=yr(t):l==="lines"?ee=zt(t):ee=_t(t);let X=ee.length;function G(g,$){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*$));let S=br($,u);S&&(g.style.transform=S);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),ee.forEach(($,S)=>{let N=M(hr(g,S,X,s));G($,N);});}if(z)return A(1),T?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let P=0,L=0,w=0,O=false,F=false,C=-1,E=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),$=Te({top:g.top,height:g.height},D(),se(),ne,$e);P=$.tStart,L=$.tEnd;}function te(){if(!O||F)return;let g=J(D(),P,L,1);p&&(C=Math.max(C,g),g=C),E=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(te);}ie();let ae=new IntersectionObserver(g=>{g.forEach($=>{O=$.isIntersecting,O&&!F?w=requestAnimationFrame(te):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),ee=zt(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Ae(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:P,tEnd:L})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=B,t.removeAttribute("aria-label"),Le(t);},replay(){C=-1,oe=false,E=0,F=false,A(0);},pause(){F=true,cancelAnimationFrame(w);},resume(){F&&(F=false,O&&(w=requestAnimationFrame(te)));},seek(g){let $=Math.min(1,Math.max(0,g));E=$,C=$,F=true,cancelAnimationFrame(w),A($);},getProgress(){return E}}}var ze=class{constructor(n){this.create=n;this.instance=null;this.el=null;this.key="";}init(n,r){return this.destroy(),this.el=n,this.latest=r,this.key=at(r),this.instance=this.create(n,kt(r,()=>this.latest)),this}update(n){return this.el?at(n)!==this.key?this.init(this.el,n):(this.latest=n,this):this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(n){return this.instance?.seek(n),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=this.el=null,this}},Wt=class extends ze{constructor(){super(Pt);}init(n,r={}){return super.init(n,r)}},Bt=class extends ze{constructor(){super(Dt);}},Gt=class extends ze{constructor(){super(Nt);}},jt=class extends ze{constructor(){super(Ht);}init(n,r={}){return super.init(n,r)}},Ut=class extends ze{constructor(){super(qt);}init(n,r={}){return super.init(n,r)}};exports.EngineRef=ze;exports.ScrollAnimateRef=Bt;exports.ScrollCounterRef=Gt;exports.ScrollDrawRef=Wt;exports.ScrollTextRef=Ut;exports.ScrollVideoRef=jt;
|
|
3
|
+
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Lt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,$t=/[MmLlHhVvCcSsQqTtAaZz]/g;function lr(e,n,r){if(!je)return;let t=(e.match($t)??[]).join("").toUpperCase(),l=(n.match($t)??[]).join("").toUpperCase(),s=(e.match(Lt)??[]).length,c=(n.match(Lt)??[]).length;if(t!==l){ge(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&ge(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function it(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function Pt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...Et[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:S={},stagger:z=0,direction:L="forward",once:re=false,debug:Me=false,axis:B="y",scrollContainer:ne,autoReverse:oe=false,delay:Y=0,strokeColor:M,strokeWidth:N,fillOpacity:$,waypoints:w,velocityScale:I=false,threshold:C=0,rootMargin:P="0px",repeat:T=0,repeatDelay:X=0,morphTo:x,clip:fe,autoplay:be=false,duration:se=1e3,native:ie=true,onProgress:p,onStart:E,onComplete:g,onEnter:k,onLeave:ae,onEnterBack:ee,onLeaveBack:A}=l,F=fe===true?"left":typeof fe=="string"?fe:false,K=typeof d=="function"?d:te[d]??te.linear,we=de(S.start??"top bottom"),Ve=de(S.end??"bottom top"),ve=typeof ne=="string"?document.querySelector(ne):ne??null,Ee=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray(N)?N[0]:null,G=Array.isArray(N)?N[1]:typeof N=="number"?N:null,pe=Array.isArray($)?$[0]:null,Q=Array.isArray($)?$[1]:typeof $=="number"?$:null;function Ce(o){let a=o*100;switch(F){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let V=F?[]:Array.from(e.querySelectorAll(c)),O=[],i=[],f=0,ye=0,R=false,_=false,q=0,Ae=false,Se=-1,Z=[],De=-1,j=false,ke=0,Ie=0,Ne,tt=null;function ct(){tt?.destroy(),tt=null;}let Re=new Set,ut=NaN,He=true,Ue=-1,mt=performance.now(),_e=NaN;function rt(){return ve?B==="x"?ve.scrollLeft:ve.scrollTop:B==="x"?window.scrollX:window.scrollY}function ft(){return ve?B==="x"?ve.clientWidth:ve.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function pt(){let o=Je(e,ve,B);return xe(o,o.scroll,ft(),we,Ve)}function dt(){(({tStart:f,tEnd:ye}=pt())),Me&&je&&(ct(),tt=ar(f,ye,B));}function nt(o,a=pt){$e(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),Pe(e);},o}function Yt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),F){let b=a==="reverse"?1-o:o;e.style.clipPath=Ce(b);return}V.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${O[ue]*o}`:`${O[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Ee&&le?b.style.stroke=We(Ee,le,o):le&&(b.style.stroke=le),ce!==null&&G!==null?b.style.strokeWidth=`${ce+(G-ce)*o}`:G!==null&&(b.style.strokeWidth=`${G}`),pe!==null&&Q!==null?b.style.fillOpacity=`${pe+(Q-pe)*o}`:Q!==null&&(b.style.fillOpacity=`${Q}`),x&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",it(i[ue],x,o));});}function Ye(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=Ce(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${O[a]}`,o.style.strokeDashoffset=L==="reverse"?"0":`${O[a]}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),x&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{ir(o);let a=qe(o);O.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),x&&(b?lr(i[i.length-1],x,o):ge(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=L==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),G!==null&&(o.style.strokeWidth=`${G}`),Q!==null&&(o.style.fillOpacity=`${Q}`),x&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",x)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=L==="reverse"?"0":`${a}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",Ee&&(o.style.stroke=Ee),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),F){if(s)return e.style.clipPath=Ce(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ce(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof d=="string"?et(d):null;function Xt(){return !(ie===false||!sr()||!V.length||!gt||F||B!=="y"||ve||u!==1||z!==0||re||oe||I!==false||x||w||T||Y>0||p||E||g||k||ae||ee||A||M!=null||N!=null||$!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function Kt(){let o=++or,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Fe=L==="reverse"?"0":"var(--ssd-len)",Oe=L==="reverse"?"var(--ssd-len)":"0",Le=`stroke-dashoffset:${Fe};`,v=`stroke-dashoffset:${Oe};`;m&&(Le+=`opacity:${L==="reverse"?1:0};`,v+=`opacity:${L==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${a}{from{${Le}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(O[U])),y.style.strokeDasharray=`${O[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}V.forEach(me);let h=false,H=-1;function W(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},rt(),ft(),we,Ve);return K(J(rt(),U,Te,u))}return {destroy(){e.classList.remove(b),V.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),D.remove();},replay(){h=false,H=-1,V.forEach(me);},pause(){h=true,V.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,V.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));H=U,h=true,V.forEach((Te,he)=>{Te.classList.remove(a),Te.style.strokeDashoffset=L==="reverse"?`${O[he]*U}`:`${O[he]*(1-U)}`,m&&(Te.style.opacity=L==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return W()},refresh(){V.forEach((y,U)=>{O[U]=qe(y),y.style.setProperty("--ssd-len",String(O[U])),y.style.strokeDasharray=`${O[U]}`;});}}}if(Xt())return nt(Kt());function Qt(){let o=Math.max(1,se),a=0,b=0,ue=false;function Fe(h){let H=true;if(F){let W=Math.min(1,Math.max(0,h/o)),y=K(W);ke=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ce(L==="reverse"?1-y:y),p?.(y),W<1&&(H=false);}else V.forEach((W,y)=>{let U=y*z*o,Te=Math.min(1,Math.max(0,(h-U)/o)),he=K(Te);W.style.strokeDashoffset=L==="reverse"?`${O[y]*he}`:`${O[y]*(1-he)}`,m&&(W.style.opacity=L==="reverse"?`${1-he}`:`${he}`),Ee&&le?W.style.stroke=We(Ee,le,he):le&&(W.style.stroke=le),ce!==null&&G!==null?W.style.strokeWidth=`${ce+(G-ce)*he}`:G!==null&&(W.style.strokeWidth=`${G}`),pe!==null&&Q!==null?W.style.fillOpacity=`${pe+(Q-pe)*he}`:Q!==null&&(W.style.fillOpacity=`${Q}`),x&&W.tagName.toLowerCase()==="path"&&i[y]&&W.setAttribute("d",it(i[y],x,he)),y===0&&(ke=he,p?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Te<1&&(H=false);});if(w){let W=Math.min(1,Math.max(0,h/o)),y=K(W);for(let U in w){let Te=parseFloat(U);y>=Te&&!Re.has(Te)&&(Re.add(Te),w[U]?.());}}return H}function Oe(h){if(j)return;let H=h-a;_||(_=true,E?.());let W=Fe(H);if(W&&!R){R=true,Fe(o*(1+Math.max(0,V.length-1)*z)),g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,Ne=setTimeout(()=>{a=performance.now(),_=false,R=false,Re.clear(),Ye(),q=requestAnimationFrame(Oe);},X));return}W||(q=requestAnimationFrame(Oe));}function Le(){cancelAnimationFrame(q),clearTimeout(Ne),a=performance.now(),b=0,j=false,_=false,R=false,Ie=0,ue=true,ke=0,Re.clear(),Ye(),q=requestAnimationFrame(Oe);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(re&&R)?Le():!H.isIntersecting&&!re&&!R&&(cancelAnimationFrame(q),clearTimeout(Ne),ue=false);});},{root:ve??null,threshold:C,rootMargin:P}),D;function me(){clearTimeout(D),D=setTimeout(()=>{V.forEach((h,H)=>{O[H]=qe(h),h.style.strokeDasharray=`${O[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),Y>0?setTimeout(()=>v.observe(e),Y):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(Ne),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(D);},replay(){Ie=0,Le();},pause(){j||!ue||(j=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){j&&(j=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(Oe));},seek(h){let H=Math.min(1,Math.max(0,h));ke=H,j=true,b=H*o,a=performance.now()-b,cancelAnimationFrame(q),Fe(b);},getProgress(){return ke},refresh(){clearTimeout(D),V.forEach((h,H)=>{O[H]=qe(h),h.style.strokeDasharray=`${O[H]}`;});}}}if(be)return nt(Qt());dt();function Xe(){if(!Ae||j)return;let o=performance.now(),a=rt();if(!He&&I===false&&a===ut){q=requestAnimationFrame(Xe);return}He=false,ut=a;let b=u;if(I!==false){let v=o-mt,D=v>0?Math.abs(a-(Ue<0?a:Ue))/v:0;b=u*Math.max(.2,1+D*(typeof I=="number"?I:1)*.04);}Ue=a,mt=o;let ue=oe?De===-1||a>=De?"forward":"reverse":L;De=a;let Fe=ye-f,Oe=true,Le=Fe===0?0:(a-f)/Fe;if(isNaN(_e)||(_e<=0&&Le>0?k?.():_e>0&&Le<=0&&A?.(),_e<1&&Le>=1?ae?.():_e>=1&&Le<1&&ee?.()),_e=Le,F){let v=K(J(a,f,ye,b));re&&!oe&&(Se=Math.max(Se,v),v=Se),ke=v,e.style.setProperty("--scroll-draw-progress",String(v));let D=ue==="reverse"?1-v:v;e.style.clipPath=Ce(D),p?.(v),!_&&J(a,f,ye,b)>0&&(_=true,E?.()),v>=1&&!R?(R=true,g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,Ne=setTimeout(()=>{Se=-1,_=false,R=false,e.style.clipPath=Ce(0);},X))):v<1&&!re&&(R=false),q=requestAnimationFrame(Xe);return}if(V.forEach((v,D)=>{let me=D*z*Fe,h=K(J(a,f+me,ye+me,b));re&&!oe&&(h=Z[D]=Math.max(Z[D]??Se,h)),ke=h,v.style.strokeDashoffset=ue==="reverse"?`${O[D]*h}`:`${O[D]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Ee&&le?v.style.stroke=We(Ee,le,h):le&&(v.style.stroke=le),ce!==null&&G!==null?v.style.strokeWidth=`${ce+(G-ce)*h}`:G!==null&&(v.style.strokeWidth=`${G}`),pe!==null&&Q!==null?v.style.fillOpacity=`${pe+(Q-pe)*h}`:Q!==null&&(v.style.fillOpacity=`${Q}`),x&&v.tagName.toLowerCase()==="path"&&i[D]&&v.setAttribute("d",it(i[D],x,h)),D===0&&(p?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Oe=false);}),w){let v=K(J(a,f,ye,b));for(let D in w){let me=parseFloat(D);v>=me&&!Re.has(me)&&(Re.add(me),w[D]?.());}}!_&&J(a,f,ye,b)>0&&(_=true,E?.()),Oe&&!R?(R=true,g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,Ne=setTimeout(()=>{Se=-1,Z=[],_=false,R=false,Re.clear(),Ye(),He=true;},X))):!Oe&&!re&&(R=false),q=requestAnimationFrame(Xe);}let ot=false;function Ke(){ot||(ot=true,q=requestAnimationFrame(function(){Xe();}));}function Qe(){ot=false,cancelAnimationFrame(q);}let st=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!j?(He=true,Ke()):Qe();});},{root:ve??null,threshold:C,rootMargin:P});function yt(){V.forEach((o,a)=>{O[a]=qe(o),o.style.strokeDasharray=`${O[a]}`;}),dt(),He=true;}let Ze;function Be(){clearTimeout(Ze),Ze=setTimeout(yt,150);}window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be);let Ge;return typeof ResizeObserver<"u"&&(Ge=new ResizeObserver(()=>Be()),Ge.observe(document.body),Ge.observe(document.documentElement),Ge.observe(e)),Y>0?setTimeout(()=>st.observe(e),Y):st.observe(e),nt({destroy(){cancelAnimationFrame(q),clearTimeout(Ne),Qe(),st.disconnect(),Ge?.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ze),ct();},replay(){Se=-1,Z=[],De=-1,Ue=-1,_=false,R=false,Ie=0,j=false,ke=0,Re.clear(),clearTimeout(Ne),Ye(),He=true,Ae&&Ke();},pause(){j=true,Qe();},resume(){j&&(j=false,He=true,Ae&&Ke());},seek(o){let a=Math.min(1,Math.max(0,o));ke=a,Se=a,Z=[],j=true,Qe(),Yt(a,L),He=true;},getProgress(){return ke},refresh(){clearTimeout(Ze),yt(),Ae&&!j&&Ke();}},()=>({tStart:f,tEnd:ye}))}var Ct=new WeakMap,cr=0;function at(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=Ct.get(r);return t===void 0&&Ct.set(r,t=++cr),`el#${t}`}return r})}function kt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...l)=>n()[t]?.(...l));return r}function ur(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ot(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function mr(e,n,r){let t=Ot(e),l=Ot(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function It(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(ur(t))return We(t,l,r);if(t.includes("("))return mr(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function fr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var pr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),dr=0,Ft="--scroll-draw-progress";function gr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Dt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:S=true,velocityScale:z=false,respectReducedMotion:L=true,triggerElement:re,onProgress:Me,onComplete:B,onEnter:ne,onLeave:oe,onEnterBack:Y,onLeaveBack:M}=n,N=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=typeof s=="function"?s:te[s]??te["ease-out"],w=de(l.start??"top bottom"),I=de(l.end??"bottom top"),C=re??e,P=typeof d=="string"?document.querySelector(d):d??null,T=Object.entries(t).map(([i,f])=>({prop:fr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function X(){let i=window.getComputedStyle(e);for(let f of T)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function x(){for(let i of T)e.style.setProperty(i.prop,String(i.to));}let fe=new Map;for(let i of [...T.map(f=>f.prop),Ft])fe.set(i,e.style.getPropertyValue(i));function be(){for(let[i,f]of fe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(N)return x(),B?.(),{...r,destroy:be,getProgress:()=>1};X();let se=typeof s=="string"?et(s):null;function ie(){if(!S||!gr()||!se||m!=="y"||P||C!==e||u||c!==1||Me||B||ne||oe||Y||M||z!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of T)if(!pr.has(i.prop))return false;return true}function p(){let i=`ssd-a-${++dr}`,f=T.map(Z=>`${Z.prop}:${Z.from}`).join(";"),ye=T.map(Z=>`${Z.prop}:${Z.to}`).join(";"),R=document.createElement("style");R.setAttribute("data-ssd-animate",""),R.textContent=`@keyframes ${i}{from{${f}}to{${ye}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${se};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let Z=e.getBoundingClientRect();return xe({top:Z.top,height:Z.height},_(),q(),w,I)};$e(e,{type:"animate",getProgress:()=>Se.getProgress(),getTrigger:Ae});let Se={destroy(){e.classList.remove(i),R.remove(),e.style.animationPlayState="",be(),Pe(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(Z){let De=Math.min(1,Math.max(0,Z));e.classList.remove(i);for(let j of T)e.style.setProperty(j.prop,It(j.from,j.to,De));},getProgress(){let{tStart:Z,tEnd:De}=Ae();return $(J(_(),Z,De,c))}};return Se}if(ie())return p();let E=0,g=0,k=0,ae=false,ee=false,A=-1,F=0,K=false,we=NaN,Ve=-1,ve=0,Ee=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=Je(C,P,m),f=xe(i,i.scroll,le(),w,I);E=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(Ft,String(i));for(let f of T)e.style.setProperty(f.prop,It(f.from,f.to,i));Me?.(i);}function pe(i){if(isNaN(we)){we=i;return}we<=0&&i>0?ne?.():we>0&&i<=0&&M?.(),we<1&&i>=1?oe?.():we>=1&&i<1&&Y?.(),we=i;}function Q(){if(!ae||ee)return;let i=performance.now(),f=Ee(),ye=c;if(z!==false){let q=i-ve,Ae=q>0?Math.abs(f-(Ve<0?f:Ve))/q:0;ye=c*Math.max(.2,1+Ae*(typeof z=="number"?z:1)*.04);}Ve=f,ve=i;let R=g===E?0:(f-E)/(g-E);pe(R);let _=$(J(f,E,g,ye));u&&(A=Math.max(A,_),_=A),F=_,G(_),_>=1&&!K?(K=true,B?.()):_<1&&!u&&(K=false),k=requestAnimationFrame(Q);}ce(),g===E&&ge("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=$(J(Ee(),E,g,c));u&&i>0&&(A=i),F=i,G(i);}let Ce=new IntersectionObserver(i=>{i.forEach(f=>{ae=f.isIntersecting,ae&&!ee?k=requestAnimationFrame(Q):cancelAnimationFrame(k);});},{root:P??null}),V;function O(){clearTimeout(V),V=setTimeout(ce,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Ce.observe(e),$e(e,{type:"animate",getProgress:()=>F,getTrigger:()=>({tStart:E,tEnd:g})}),{destroy(){cancelAnimationFrame(k),Ce.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(V),be(),Pe(e);},replay(){A=-1,K=false,F=0,ee=false,G(0);},pause(){ee=true,cancelAnimationFrame(k);},resume(){ee&&(ee=false,ae&&(k=requestAnimationFrame(Q)));},seek(i){let f=Math.min(1,Math.max(0,i));F=f,A=f,ee=true,cancelAnimationFrame(k),G(f);},getProgress(){return F}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Nt(e,n){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollCounter: element not found:",e),lt;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:S,onComplete:z}=n,L=S!==void 0?p=>p.toFixed(S):c??(p=>String(Math.round(p))),re=typeof u=="function"?u:te[u]??te["ease-out"],Me=de(m.start??"top 80%"),B=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(s),z?.(),lt;let oe=0,Y=0,M=0,N=false,$=false,w=-1,I=0,C=false,P=()=>window.scrollY,T=()=>window.innerHeight;function X(){let p=t.getBoundingClientRect(),E=xe({top:p.top,height:p.height},P(),T(),Me,B);oe=E.tStart,Y=E.tEnd;}function x(p){t.textContent=L(l+(s-l)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function fe(){if(!N||$)return;let p=re(J(P(),oe,Y,1));d&&(w=Math.max(w,p),p=w),I=p,x(p),p>=1&&!C?(C=true,z?.()):p<1&&!d&&(C=false),M=requestAnimationFrame(fe);}X();{let p=re(J(P(),oe,Y,1));d&&p>0&&(w=p),I=p,x(p);}let be=new IntersectionObserver(p=>{p.forEach(E=>{N=E.isIntersecting,N&&!$?M=requestAnimationFrame(fe):cancelAnimationFrame(M);});}),se;function ie(){clearTimeout(se),se=setTimeout(X,150);}return window.addEventListener("resize",ie),window.addEventListener("orientationchange",ie),be.observe(t),$e(t,{type:"counter",getProgress:()=>I,getTrigger:()=>({tStart:oe,tEnd:Y})}),{destroy(){cancelAnimationFrame(M),be.disconnect(),window.removeEventListener("resize",ie),window.removeEventListener("orientationchange",ie),clearTimeout(se),Pe(t);},replay(){w=-1,C=false,I=0,$=false,x(0);},pause(){$=true,cancelAnimationFrame(M);},resume(){$&&($=false,N&&(M=requestAnimationFrame(fe)));},seek(p){let E=Math.min(1,Math.max(0,p));I=E,w=E,$=true,cancelAnimationFrame(M),x(E);},getProgress(){return I}}}var Rt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ht(e,n={}){if(typeof window>"u")return Rt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ge("scrollVideo: <video> element not found:",e),Rt;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",triggerElement:d,onReady:S,onComplete:z,onProgress:L}=n,re=d??t,Me=window.matchMedia("(prefers-reduced-motion: reduce)").matches,B=typeof s=="function"?s:te[s]??te.linear,ne=de(l.start??"top top"),oe=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Y=n.from??0,M=n.to,N=0,$=0,w=0,I=false,C=false,P=-1,T=0,X=false,x=false,fe=()=>u==="x"?window.scrollX:window.scrollY,be=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let A=re.getBoundingClientRect(),F=u==="x"?A.left:A.top,K=u==="x"?A.width:A.height,we=xe({top:F,height:K},fe(),be(),ne,oe);N=we.tStart,$=we.tEnd,x&&$===N&&ge("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let ie=NaN;function p(A){if(!x)return;let F=M??t.duration??0,K=Y+(F-Y)*A;K!==ie&&(ie=K,t.currentTime=K),t.style.setProperty("--scroll-draw-progress",String(A)),L?.(A);}function E(){if(!I||C||!x||Me)return;let A=B(J(fe(),N,$,1));c&&(P=Math.max(P,A),A=P),T=A,p(A),A>=1&&!X?(X=true,z?.()):A<1&&!c&&(X=false),w=requestAnimationFrame(E);}function g(){if(x=true,M===void 0&&(M=t.duration),Me){p(1),S?.();return}se(),S?.(),I&&!C&&(w=requestAnimationFrame(E));}t.readyState>=1?g():t.addEventListener("loadedmetadata",g,{once:true}),x||se();let k=new IntersectionObserver(A=>{A.forEach(F=>{I=F.isIntersecting,I&&!C&&x?w=requestAnimationFrame(E):cancelAnimationFrame(w);});}),ae;function ee(){clearTimeout(ae),ae=setTimeout(se,150);}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),k.observe(t),$e(t,{type:"video",getProgress:()=>T,getTrigger:()=>({tStart:N,tEnd:$})}),{destroy(){cancelAnimationFrame(w),k.disconnect(),t.removeEventListener("loadedmetadata",g),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout(ae),Pe(t);},replay(){P=-1,X=false,T=0,C=false,ie=NaN,p(0);},pause(){C=true,cancelAnimationFrame(w);},resume(){C&&(C=false,I&&x&&(w=requestAnimationFrame(E)));},seek(A){let F=Math.min(1,Math.max(0,A));T=F,P=F,C=true,cancelAnimationFrame(w),ie=NaN,p(F);},getProgress(){return T}}}function _t(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function yr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function zt(e){let n=_t(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let S=m.nextElementSibling;u.appendChild(m),d<c.length-1&&S&&S.style.whiteSpace==="pre"&&u.appendChild(S);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function hr(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function br(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function qt(e,n={}){if(typeof window>"u")return Vt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollText: element not found:",e),Vt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:S}=n,z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof c=="function"?c:te[c]??te["ease-out"],re=de(m.start??"top 85%"),Me=de(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ne;l==="chars"?ne=yr(t):l==="lines"?ne=zt(t):ne=_t(t);let oe=ne.length;function Y(g,k){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*k));let ae=br(k,u);ae&&(g.style.transform=ae);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),ne.forEach((k,ae)=>{let ee=L(hr(g,ae,oe,s));Y(k,ee);});}if(z)return M(1),S?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let N=0,$=0,w=0,I=false,C=false,P=-1,T=0,X=false,x=()=>window.scrollY,fe=()=>window.innerHeight;function be(){let g=t.getBoundingClientRect(),k=xe({top:g.top,height:g.height},x(),fe(),re,Me);N=k.tStart,$=k.tEnd;}function se(){if(!I||C)return;let g=J(x(),N,$,1);d&&(P=Math.max(P,g),g=P),T=g,M(g),g>=1&&!X?(X=true,S?.()):g<1&&!d&&(X=false),w=requestAnimationFrame(se);}be();let ie=new IntersectionObserver(g=>{g.forEach(k=>{I=k.isIntersecting,I&&!C?w=requestAnimationFrame(se):cancelAnimationFrame(w);});}),p;function E(){clearTimeout(p),p=setTimeout(()=>{if(l==="lines"){let g=T;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),ne=zt(t),M(g);}be();},150);}return window.addEventListener("resize",E),window.addEventListener("orientationchange",E),ie.observe(t),$e(t,{type:"text",getProgress:()=>T,getTrigger:()=>({tStart:N,tEnd:$})}),{destroy(){cancelAnimationFrame(w),ie.disconnect(),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),clearTimeout(p),t.innerHTML=B,t.removeAttribute("aria-label"),Pe(t);},replay(){P=-1,X=false,T=0,C=false,M(0);},pause(){C=true,cancelAnimationFrame(w);},resume(){C&&(C=false,I&&(w=requestAnimationFrame(se)));},seek(g){let k=Math.min(1,Math.max(0,g));T=k,P=k,C=true,cancelAnimationFrame(w),M(k);},getProgress(){return T}}}var ze=class{constructor(n){this.create=n;this.instance=null;this.el=null;this.key="";}init(n,r){return this.destroy(),this.el=n,this.latest=r,this.key=at(r),this.instance=this.create(n,kt(r,()=>this.latest)),this}update(n){return this.el?at(n)!==this.key?this.init(this.el,n):(this.latest=n,this):this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(n){return this.instance?.seek(n),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=this.el=null,this}},Wt=class extends ze{constructor(){super(Pt);}init(n,r={}){return super.init(n,r)}},Bt=class extends ze{constructor(){super(Dt);}},Gt=class extends ze{constructor(){super(Nt);}},jt=class extends ze{constructor(){super(Ht);}init(n,r={}){return super.init(n,r)}},Ut=class extends ze{constructor(){super(qt);}init(n,r={}){return super.init(n,r)}};exports.EngineRef=ze;exports.ScrollAnimateRef=Bt;exports.ScrollCounterRef=Gt;exports.ScrollDrawRef=Wt;exports.ScrollTextRef=Ut;exports.ScrollVideoRef=jt;
|
package/dist/angular/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-
|
|
1
|
+
import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-TIRZOSQ4.mjs';import {a as a$4}from'../chunk-SNCRC6BA.mjs';import {a as a$2}from'../chunk-4MH5SQTH.mjs';import {a as a$1}from'../chunk-QJ4H2HW3.mjs';import {b as b$1}from'../chunk-LINFV2GK.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-PEFR3ZB7.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';var r=class{constructor(t){this.create=t;this.instance=null;this.el=null;this.key="";}init(t,e){return this.destroy(),this.el=t,this.latest=e,this.key=a(e),this.instance=this.create(t,b(e,()=>this.latest)),this}update(t){return this.el?a(t)!==this.key?this.init(this.el,t):(this.latest=t,this):this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(t){return this.instance?.seek(t),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=this.el=null,this}},u=class extends r{constructor(){super(b$1);}init(t,e={}){return super.init(t,e)}},h=class extends r{constructor(){super(a$1);}},m=class extends r{constructor(){super(a$2);}},O=class extends r{constructor(){super(a$3);}init(t,e={}){return super.init(t,e)}},d=class extends r{constructor(){super(a$4);}init(t,e={}){return super.init(t,e)}};export{r as EngineRef,h as ScrollAnimateRef,m as ScrollCounterRef,u as ScrollDrawRef,d as ScrollTextRef,O as ScrollVideoRef};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-
|
|
1
|
+
import {a,b}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-TIRZOSQ4.mjs';import {a as a$4}from'./chunk-SNCRC6BA.mjs';import {a as a$2}from'./chunk-4MH5SQTH.mjs';import {a as a$1}from'./chunk-QJ4H2HW3.mjs';import {b as b$1}from'./chunk-LINFV2GK.mjs';import {defineComponent,ref,h,onMounted,watch,onUnmounted,unref}from'vue';var c=e=>typeof e=="function"?e():unref(e);function r(e,t,n){let o=null,a$1=t(),S=()=>{o?.destroy(),o=e.value?n(e.value,b(a$1,()=>a$1)):null;};onMounted(S),watch(()=>a(a$1=t()),S),onUnmounted(()=>{o?.destroy(),o=null;});}function H(e={}){let t=ref(null);return r(t,()=>c(e),b$1),t}var L=defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:t}){let n=ref(null);return r(n,()=>{let o={};return e.selector!=null&&(o.selector=e.selector),e.speed!=null&&(o.speed=e.speed),e.fade!=null&&(o.fade=e.fade),e.stagger!=null&&(o.stagger=e.stagger),e.easing!=null&&(o.easing=e.easing),e.direction!=null&&(o.direction=e.direction),e.trigger!=null&&(o.trigger=e.trigger),e.once!=null&&(o.once=e.once),e.debug!=null&&(o.debug=e.debug),e.onProgress!=null&&(o.onProgress=e.onProgress),e.onStart!=null&&(o.onStart=e.onStart),e.onComplete!=null&&(o.onComplete=e.onComplete),o},b$1),()=>h("div",{ref:n},t.default?.())}});function V(e){let t=ref(null);return r(t,()=>c(e),a$1),t}var A=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let n=ref(null);return r(n,()=>e.options,a$1),()=>h("div",{ref:n},t.default?.())}});function F(e){let t=ref(null);return r(t,()=>c(e),a$2),t}var G=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return r(t,()=>{let n={to:e.to};return e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete),n},a$2),()=>h("span",{ref:t})}});function j(e={}){let t=ref(null);return r(t,()=>c(e),a$3),t}var B=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let t=ref(null);return r(t,()=>e.options??{},a$3),()=>h("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function N(e={}){let t=ref(null);return r(t,()=>c(e),a$4),t}var P=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let n=ref(null);return r(n,()=>e.options??{},a$4),()=>h(e.tag,{ref:n},t.default?.())}});export{H as a,L as b,V as c,A as d,F as e,G as f,j as g,B as h,N as i,P as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,c,b as b$2}from'./chunk-PEFR3ZB7.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$1,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var _={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function te(c$1,h={}){if(typeof window>"u")return _;let E=typeof c$1=="string"?document.querySelector(c$1):c$1;if(!E||E.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",c$1),_;let t=E,{trigger:P={},easing:b$3="linear",once:z=false,axis:m="y",preload:B="auto",triggerElement:G,onReady:C,onComplete:W,onProgress:X}=h,Y=G??t,I=window.matchMedia("(prefers-reduced-motion: reduce)").matches,j=typeof b$3=="function"?b$3:d[b$3]??d.linear,J=a(P.start??"top top"),K=a(P.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=B);let V=h.from??0,T=h.to,u=0,f=0,n=0,s=false,o=false,a$2=-1,l=0,g=false,i=false,M=()=>m==="x"?window.scrollX:window.scrollY,Q=()=>m==="x"?window.innerWidth:window.innerHeight;function A(){let e=Y.getBoundingClientRect(),r=m==="x"?e.left:e.top,d=m==="x"?e.width:e.height,q=c({top:r,height:d},M(),Q(),J,K);u=q.tStart,f=q.tEnd,i&&f===u&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let p=NaN;function w(e){if(!i)return;let r=T??t.duration??0,d=V+(r-V)*e;d!==p&&(p=d,t.currentTime=d),t.style.setProperty("--scroll-draw-progress",String(e)),X?.(e);}function v(){if(!s||o||!i||I)return;let e=j(b$2(M(),u,f,1));z&&(a$2=Math.max(a$2,e),e=a$2),l=e,w(e),e>=1&&!g?(g=true,W?.()):e<1&&!z&&(g=false),n=requestAnimationFrame(v);}function S(){if(i=true,T===void 0&&(T=t.duration),I){w(1),C?.();return}A(),C?.(),s&&!o&&(n=requestAnimationFrame(v));}t.readyState>=1?S():t.addEventListener("loadedmetadata",S,{once:true}),i||A();let R=new IntersectionObserver(e=>{e.forEach(r=>{s=r.isIntersecting,s&&!o&&i?n=requestAnimationFrame(v):cancelAnimationFrame(n);});}),x;function y(){clearTimeout(x),x=setTimeout(A,150);}return window.addEventListener("resize",y),window.addEventListener("orientationchange",y),R.observe(t),a$1(t,{type:"video",getProgress:()=>l,getTrigger:()=>({tStart:u,tEnd:f})}),{destroy(){cancelAnimationFrame(n),R.disconnect(),t.removeEventListener("loadedmetadata",S),window.removeEventListener("resize",y),window.removeEventListener("orientationchange",y),clearTimeout(x),b$1(t);},replay(){a$2=-1,g=false,l=0,o=false,p=NaN,w(0);},pause(){o=true,cancelAnimationFrame(n);},resume(){o&&(o=false,s&&i&&(n=requestAnimationFrame(v)));},seek(e){let r=Math.min(1,Math.max(0,e));l=r,a$2=r,o=true,cancelAnimationFrame(n),p=NaN,w(r);},getProgress(){return l}}}export{te as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _e({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),a=Math.sqrt(n),i=0,l=[];for(let c=0;c<r;c++){let f=Math.pow(a,c);l.push(f),i+=f;}let m=[0],u=0;for(let c=0;c<r;c++)u+=l[c]/i,m.push(u);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let f=0;f<r;f++)if(c<=m[f+1]){let g=(c-m[f])/(m[f+1]-m[f]);if(f===0)return g*(2-g);let E=1-Math.pow(n,f);return E+(1-E)*(2*g-1)*(2*g-1)}return 1}}function He({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),a=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-a)*(2*Math.PI)/n)+1}var C={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:_e(),elastic:He()};function pe(e,t,r){return Math.min(r,Math.max(t,e))}function Y(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function fe(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function ge(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function W(e,t,r,n){return r===t?0:pe((e-t)/(r-t)*n,0,1)}function K(e,t,r,n,a){let i=fe(e.top,e.height,t,n.element)-ge(n.viewport,r),l=fe(e.top,e.height,t,a.element)-ge(a.viewport,r);return {tStart:i,tEnd:l}}function de(e,t,r){let n=e.getBoundingClientRect(),a=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:a,scroll:0}:{top:r==="x"?n.left:n.top,height:a,scroll:r==="x"?window.scrollX:window.scrollY}}function be(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function ye(e,t,r){let n=be(e),a=be(t);return !n||!a?e:`rgb(${Math.round(n[0]+(a[0]-n[0])*r)},${Math.round(n[1]+(a[1]-n[1])*r)},${Math.round(n[2]+(a[2]-n[2])*r)})`}var Ne="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",ze="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",he=33;function De(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Fe(e){let t=[];for(let r=0;r<he;r++){let n=r/(he-1);t.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${t.join(",")})`}function Ee(e){switch(e){case "linear":return "linear";case "ease-in":return Ne;case "ease-out":return ze;case "ease-in-out":return De()?Fe(C["ease-in-out"]):null;default:return null}}var we=Symbol.for("svg-scroll-draw.registry");function Se(){let e=globalThis;return e[we]||(e[we]=new Map)}function Z(e,t){Se().set(e,t);}function J(e){Se().delete(e);}var Oe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function _(e,...t){Oe&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function Ve(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ve(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let a=[],i=[],l=n[2].trim();if(l)for(let m of l.split(/[\s,]+/)){let u=m.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"");}t.push({fn:n[1],nums:a,units:i});}return t}function We(e,t,r){let n=ve(e),a=ve(t);return n.length===0||n.length!==a.length?r<1?e:t:n.map((i,l)=>{let m=a[l];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((u,c)=>`${u}${i.units[c]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,c)=>`${u}${m.units[c]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,c)=>`${u+(m.nums[c]-u)*r}${i.units[c]}`).join(", ")})`}).join(" ")}function Me(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),a=String(t);if(Ve(n))return ye(n,a,r);if(n.includes("("))return We(n,a,r);let i=n.match(/^([-+]?[\d.]+)(.*)$/),l=a.match(/^([-+]?[\d.]+)(.*)$/);if(i&&l){let m=parseFloat(i[1]),u=parseFloat(l[1]);return `${m+(u-m)*r}${i[2]||l[2]}`}return r<1?n:a}function ke(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Be=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),qe=0,xe="--scroll-draw-progress";function je(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ee(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:a={},easing:i="ease-out",speed:l=1,once:m=false,axis:u="y",scrollContainer:c,native:f=true,velocityScale:g=false,respectReducedMotion:E=true,triggerElement:I,onProgress:b,onComplete:P,onEnter:p,onLeave:R,onEnterBack:te,onLeaveBack:ne}=t,Pe=E&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,k=typeof i=="function"?i:C[i]??C["ease-out"],re=Y(a.start??"top bottom"),oe=Y(a.end??"bottom top"),se=I??e,y=typeof c=="string"?document.querySelector(c):c??null,w=Object.entries(n).map(([o,s])=>({prop:ke(o),from:Array.isArray(s)?s[0]:"",to:Array.isArray(s)?s[1]:s}));function Le(){let o=window.getComputedStyle(e);for(let s of w)s.from===""&&(s.from=o.getPropertyValue(s.prop).trim()||"0");}function Ae(){for(let o of w)e.style.setProperty(o.prop,String(o.to));}let ie=new Map;for(let o of [...w.map(s=>s.prop),xe])ie.set(o,e.style.getPropertyValue(o));function B(){for(let[o,s]of ie)s?e.style.setProperty(o,s):e.style.removeProperty(o);}if(Pe)return Ae(),P?.(),{...r,destroy:B,getProgress:()=>1};Le();let ae=typeof i=="string"?Ee(i):null;function $e(){if(!f||!je()||!ae||u!=="y"||y||se!==e||m||l!==1||b||P||p||R||te||ne||g!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let o of w)if(!Be.has(o.prop))return false;return true}function Ie(){let o=`ssd-a-${++qe}`,s=w.map(d=>`${d.prop}:${d.from}`).join(";"),F=w.map(d=>`${d.prop}:${d.to}`).join(";"),$=document.createElement("style");$.setAttribute("data-ssd-animate",""),$.textContent=`@keyframes ${o}{from{${s}}to{${F}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${ae};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild($),e.classList.add(o);let h=()=>u==="x"?window.scrollX:window.scrollY,O=()=>u==="x"?window.innerWidth:window.innerHeight,V=()=>{let d=e.getBoundingClientRect();return K({top:d.top,height:d.height},h(),O(),re,oe)};Z(e,{type:"animate",getProgress:()=>X.getProgress(),getTrigger:V});let X={destroy(){e.classList.remove(o),$.remove(),e.style.animationPlayState="",B(),J(e);},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(d){let U=Math.min(1,Math.max(0,d));e.classList.remove(o);for(let Q of w)e.style.setProperty(Q.prop,Me(Q.from,Q.to,U));},getProgress(){let{tStart:d,tEnd:U}=V();return k(W(h(),d,U,l))}};return X}if($e())return Ie();let S=0,v=0,M=0,H=false,x=false,L=-1,A=0,N=false,T=NaN,q=-1,ue=0,le=()=>y?u==="x"?y.scrollLeft:y.scrollTop:u==="x"?window.scrollX:window.scrollY,Re=()=>y?u==="x"?y.clientWidth:y.clientHeight:u==="x"?window.innerWidth:window.innerHeight;function ce(){let o=de(se,y,u),s=K(o,o.scroll,Re(),re,oe);S=s.tStart,v=s.tEnd;}function z(o){e.style.setProperty(xe,String(o));for(let s of w)e.style.setProperty(s.prop,Me(s.from,s.to,o));b?.(o);}function Ce(o){if(isNaN(T)){T=o;return}T<=0&&o>0?p?.():T>0&&o<=0&&ne?.(),T<1&&o>=1?R?.():T>=1&&o<1&&te?.(),T=o;}function j(){if(!H||x)return;let o=performance.now(),s=le(),F=l;if(g!==false){let O=o-ue,V=O>0?Math.abs(s-(q<0?s:q))/O:0;F=l*Math.max(.2,1+V*(typeof g=="number"?g:1)*.04);}q=s,ue=o;let $=v===S?0:(s-S)/(v-S);Ce($);let h=k(W(s,S,v,F));m&&(L=Math.max(L,h),h=L),A=h,z(h),h>=1&&!N?(N=true,P?.()):h<1&&!m&&(N=false),M=requestAnimationFrame(j);}ce(),v===S&&_("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let o=k(W(le(),S,v,l));m&&o>0&&(L=o),A=o,z(o);}let me=new IntersectionObserver(o=>{o.forEach(s=>{H=s.isIntersecting,H&&!x?M=requestAnimationFrame(j):cancelAnimationFrame(M);});},{root:y??null}),G;function D(){clearTimeout(G),G=setTimeout(ce,150);}return window.addEventListener("resize",D),window.addEventListener("orientationchange",D),me.observe(e),Z(e,{type:"animate",getProgress:()=>A,getTrigger:()=>({tStart:S,tEnd:v})}),{destroy(){cancelAnimationFrame(M),me.disconnect(),window.removeEventListener("resize",D),window.removeEventListener("orientationchange",D),clearTimeout(G),B(),J(e);},replay(){L=-1,N=false,A=0,x=false,z(0);},pause(){x=true,cancelAnimationFrame(M);},resume(){x&&(x=false,H&&(M=requestAnimationFrame(j)));},seek(o){let s=Math.min(1,Math.max(0,o));A=s,L=s,x=true,cancelAnimationFrame(M),z(s);},getProgress(){return A}}}var Te={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function pt(e,t={}){if(typeof window>"u")return Te;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return _("scrollHorizontal: track element not found:",e),Te;let n=r,{easing:a="linear",trigger:i={start:"top top",end:"bottom bottom"},scrollContainer:l,respectReducedMotion:m=false,onProgress:u}=t;function c(){let p=typeof l=="string"?document.querySelector(l):l??null;return p?p.clientWidth:window.innerWidth}function f(){return t.distance??n.scrollWidth-c()}function g(){if(t.triggerElement!==void 0){let p=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(p)return p;_("scrollHorizontal: triggerElement not found:",t.triggerElement);}for(let p=n.parentElement;p;p=p.parentElement)if(window.getComputedStyle(p).position==="sticky")return p.parentElement??p;return n}let E=f(),I=g(),b=ee(n,P(E,I));function P(p,R){return {props:{transform:["translateX(0px)",`translateX(${-p}px)`]},trigger:i,easing:a,native:false,respectReducedMotion:m,...R!==n&&{triggerElement:R},...l!==void 0&&{scrollContainer:l},...u!==void 0&&{onProgress:u}}}return {destroy(){b.destroy();},replay(){b.replay();},pause(){b.pause();},resume(){b.resume();},seek(p){b.seek(p);},getProgress(){return b.getProgress()},refresh(){b.destroy(),E=f(),I=g(),b=ee(n,P(E,I));}}}exports.scrollHorizontal=pt;
|
|
1
|
+
'use strict';function _e({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),a=Math.sqrt(n),s=0,m=[];for(let u=0;u<r;u++){let g=Math.pow(a,u);m.push(g),s+=g;}let p=[0],c=0;for(let u=0;u<r;u++)c+=m[u]/s,p.push(c);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let g=0;g<r;g++)if(u<=p[g+1]){let h=(u-p[g])/(p[g+1]-p[g]);if(g===0)return h*(2-h);let M=1-Math.pow(n,g);return M+(1-M)*(2*h-1)*(2*h-1)}return 1}}function He({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),a=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-a)*(2*Math.PI)/n)+1}var V={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:_e(),elastic:He()};function de(e,t,r){return Math.min(r,Math.max(t,e))}function ie(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function be(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function ye(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function Q(e,t,r,n){return r===t?0:de((e-t)/(r-t)*n,0,1)}function se(e,t,r,n,a){let s=be(e.top,e.height,t,n.element)-ye(n.viewport,r),m=be(e.top,e.height,t,a.element)-ye(a.viewport,r);return {tStart:s,tEnd:m}}function he(e,t,r){let n=e.getBoundingClientRect(),a=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:a,scroll:0}:{top:r==="x"?n.left:n.top,height:a,scroll:r==="x"?window.scrollX:window.scrollY}}function Ee(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function we(e,t,r){let n=Ee(e),a=Ee(t);return !n||!a?e:`rgb(${Math.round(n[0]+(a[0]-n[0])*r)},${Math.round(n[1]+(a[1]-n[1])*r)},${Math.round(n[2]+(a[2]-n[2])*r)})`}var ze="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Ne="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",ve=33;function Oe(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Fe(e){let t=[];for(let r=0;r<ve;r++){let n=r/(ve-1);t.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${t.join(",")})`}function Se(e){switch(e){case "linear":return "linear";case "ease-in":return ze;case "ease-out":return Ne;case "ease-in-out":return Oe()?Fe(V["ease-in-out"]):null;default:return null}}var Me=Symbol.for("svg-scroll-draw.registry");function Te(){let e=globalThis;return e[Me]||(e[Me]=new Map)}function ae(e,t){Te().set(e,t);}function ue(e){Te().delete(e);}var De=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function W(e,...t){De&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function Ve(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function xe(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let a=[],s=[],m=n[2].trim();if(m)for(let p of m.split(/[\s,]+/)){let c=p.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:n[1],nums:a,units:s});}return t}function We(e,t,r){let n=xe(e),a=xe(t);return n.length===0||n.length!==a.length?r<1?e:t:n.map((s,m)=>{let p=a[m];return s.fn!==p.fn||s.nums.length!==p.nums.length?r<1?`${s.fn}(${s.nums.map((c,u)=>`${c}${s.units[u]}`).join(", ")})`:`${p.fn}(${p.nums.map((c,u)=>`${c}${p.units[u]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,u)=>`${c+(p.nums[u]-c)*r}${s.units[u]}`).join(", ")})`}).join(" ")}function Le(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),a=String(t);if(Ve(n))return we(n,a,r);if(n.includes("("))return We(n,a,r);let s=n.match(/^([-+]?[\d.]+)(.*)$/),m=a.match(/^([-+]?[\d.]+)(.*)$/);if(s&&m){let p=parseFloat(s[1]),c=parseFloat(m[1]);return `${p+(c-p)*r}${s[2]||m[2]}`}return r<1?n:a}function ke(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Be=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),qe=0,Pe="--scroll-draw-progress";function je(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function le(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:a={},easing:s="ease-out",speed:m=1,once:p=false,axis:c="y",scrollContainer:u,native:g=true,velocityScale:h=false,respectReducedMotion:M=true,triggerElement:N,onProgress:A,onComplete:E,onEnter:d,onLeave:O,onEnterBack:v,onLeaveBack:F}=t,D=M&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,I=typeof s=="function"?s:V[s]??V["ease-out"],C=ie(a.start??"top bottom"),k=ie(a.end??"bottom top"),T=N??e,b=typeof u=="string"?document.querySelector(u):u??null,w=Object.entries(n).map(([o,i])=>({prop:ke(o),from:Array.isArray(i)?i[0]:"",to:Array.isArray(i)?i[1]:i}));function l(){let o=window.getComputedStyle(e);for(let i of w)i.from===""&&(i.from=o.getPropertyValue(i.prop).trim()||"0");}function f(){for(let o of w)e.style.setProperty(o.prop,String(o.to));}let B=new Map;for(let o of [...w.map(i=>i.prop),Pe])B.set(o,e.style.getPropertyValue(o));function Z(){for(let[o,i]of B)i?e.style.setProperty(o,i):e.style.removeProperty(o);}if(D)return f(),E?.(),{...r,destroy:Z,getProgress:()=>1};l();let ce=typeof s=="string"?Se(s):null;function Re(){if(!g||!je()||!ce||c!=="y"||b||T!==e||p||m!==1||A||E||d||O||v||F||h!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let o of w)if(!Be.has(o.prop))return false;return true}function Ae(){let o=`ssd-a-${++qe}`,i=w.map(y=>`${y.prop}:${y.from}`).join(";"),U=w.map(y=>`${y.prop}:${y.to}`).join(";"),z=document.createElement("style");z.setAttribute("data-ssd-animate",""),z.textContent=`@keyframes ${o}{from{${i}}to{${U}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${ce};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(z),e.classList.add(o);let S=()=>c==="x"?window.scrollX:window.scrollY,Y=()=>c==="x"?window.innerWidth:window.innerHeight,K=()=>{let y=e.getBoundingClientRect();return se({top:y.top,height:y.height},S(),Y(),C,k)};ae(e,{type:"animate",getProgress:()=>ne.getProgress(),getTrigger:K});let ne={destroy(){e.classList.remove(o),z.remove(),e.style.animationPlayState="",Z(),ue(e);},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(y){let re=Math.min(1,Math.max(0,y));e.classList.remove(o);for(let oe of w)e.style.setProperty(oe.prop,Le(oe.from,oe.to,re));},getProgress(){let{tStart:y,tEnd:re}=K();return I(Q(S(),y,re,m))}};return ne}if(Re())return Ae();let x=0,L=0,P=0,q=false,$=false,_=-1,H=0,j=false,R=NaN,J=-1,me=0,pe=()=>b?c==="x"?b.scrollLeft:b.scrollTop:c==="x"?window.scrollX:window.scrollY,Ie=()=>b?c==="x"?b.clientWidth:b.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function fe(){let o=he(T,b,c),i=se(o,o.scroll,Ie(),C,k);x=i.tStart,L=i.tEnd;}function G(o){e.style.setProperty(Pe,String(o));for(let i of w)e.style.setProperty(i.prop,Le(i.from,i.to,o));A?.(o);}function Ce(o){if(isNaN(R)){R=o;return}R<=0&&o>0?d?.():R>0&&o<=0&&F?.(),R<1&&o>=1?O?.():R>=1&&o<1&&v?.(),R=o;}function ee(){if(!q||$)return;let o=performance.now(),i=pe(),U=m;if(h!==false){let Y=o-me,K=Y>0?Math.abs(i-(J<0?i:J))/Y:0;U=m*Math.max(.2,1+K*(typeof h=="number"?h:1)*.04);}J=i,me=o;let z=L===x?0:(i-x)/(L-x);Ce(z);let S=I(Q(i,x,L,U));p&&(_=Math.max(_,S),S=_),H=S,G(S),S>=1&&!j?(j=true,E?.()):S<1&&!p&&(j=false),P=requestAnimationFrame(ee);}fe(),L===x&&W("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let o=I(Q(pe(),x,L,m));p&&o>0&&(_=o),H=o,G(o);}let ge=new IntersectionObserver(o=>{o.forEach(i=>{q=i.isIntersecting,q&&!$?P=requestAnimationFrame(ee):cancelAnimationFrame(P);});},{root:b??null}),te;function X(){clearTimeout(te),te=setTimeout(fe,150);}return window.addEventListener("resize",X),window.addEventListener("orientationchange",X),ge.observe(e),ae(e,{type:"animate",getProgress:()=>H,getTrigger:()=>({tStart:x,tEnd:L})}),{destroy(){cancelAnimationFrame(P),ge.disconnect(),window.removeEventListener("resize",X),window.removeEventListener("orientationchange",X),clearTimeout(te),Z(),ue(e);},replay(){_=-1,j=false,H=0,$=false,G(0);},pause(){$=true,cancelAnimationFrame(P);},resume(){$&&($=false,q&&(P=requestAnimationFrame(ee)));},seek(o){let i=Math.min(1,Math.max(0,o));H=i,_=i,$=true,cancelAnimationFrame(P),G(i);},getProgress(){return H}}}var $e={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function pt(e,t={}){if(typeof window>"u")return $e;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return W("scrollHorizontal: track element not found:",e),$e;let n=r,{easing:a="linear",trigger:s={start:"top top",end:"bottom bottom"},scrollContainer:m,respectReducedMotion:p=false,onProgress:c}=t,u=typeof m=="string"?document.querySelector(m):m??null;function g(){for(let l=n.parentElement;l;l=l.parentElement)if(window.getComputedStyle(l).position==="sticky")return l;return null}function h(){let l=g();if(l){let f=window.getComputedStyle(l);return l.clientWidth-(parseFloat(f.paddingLeft)||0)-(parseFloat(f.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function M(){return t.distance??n.scrollWidth-h()}function N(){if(t.triggerElement!==void 0){let f=typeof t.triggerElement=="string"?document.querySelector(t.triggerElement):t.triggerElement;if(f)return f;W("scrollHorizontal: triggerElement not found:",t.triggerElement);}let l=g();return l?l.parentElement??l:n}let A=M(),E=N(),d=le(n,F(A,E)),O=D(),v=null;function F(l,f){return {props:{transform:["translateX(0px)",`translateX(${-l}px)`]},trigger:s,easing:a,native:false,respectReducedMotion:p,...f!==n&&{triggerElement:f},...m!==void 0&&{scrollContainer:m},...c!==void 0&&{onProgress:c}}}function D(){let l=E.getBoundingClientRect(),f=u?l.top-u.getBoundingClientRect().top+u.scrollTop:l.top+window.scrollY;return `${M()} ${Math.round(f)} ${Math.round(l.height)}`}function I(){d.destroy();let l=N(),f=l!==E;A=M(),E=l,d=le(n,F(A,E)),O=D(),v!==null&&d.seek(v),f&&w();}let C;function k(){(N()!==E||D()!==O)&&I();}function T(){clearTimeout(C),C=setTimeout(k,150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let b=typeof ResizeObserver<"u"?new ResizeObserver(T):void 0;function w(){if(!b)return;b.disconnect();let l=[document.body,document.documentElement,n,E];l.filter((f,B)=>f&&l.indexOf(f)===B).forEach(f=>b.observe(f));}return w(),{destroy(){clearTimeout(C),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),b?.disconnect(),d.destroy();},replay(){v=null,d.replay();},pause(){d.pause(),v=d.getProgress();},resume(){v=null,d.resume();},seek(l){d.seek(l),v=d.getProgress();},getProgress(){return d.getProgress()},refresh(){I();}}}exports.scrollHorizontal=pt;
|
|
@@ -5,7 +5,10 @@ interface ScrollHorizontalOptions {
|
|
|
5
5
|
* Total horizontal travel distance in pixels.
|
|
6
6
|
*
|
|
7
7
|
* Default: `track.scrollWidth` minus the width it is seen through — the
|
|
8
|
-
*
|
|
8
|
+
* content box of the sticky stage around the track; without one, the
|
|
9
|
+
* `scrollContainer`'s client width, or the viewport's with any scrollbar left
|
|
10
|
+
* out. Re-measured whenever the layout changes, so leave it out unless you
|
|
11
|
+
* want a fixed number: a number you pass is used as given.
|
|
9
12
|
*/
|
|
10
13
|
distance?: number;
|
|
11
14
|
/**
|
|
@@ -50,7 +53,11 @@ interface ScrollHorizontalOptions {
|
|
|
50
53
|
onProgress?: (progress: number) => void;
|
|
51
54
|
}
|
|
52
55
|
interface ScrollHorizontalInstance extends ScrollDrawInstance {
|
|
53
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Re-measure now. The strip already re-measures 150 ms after the window, the
|
|
58
|
+
* page, the track or its runway changes size; call this when something else
|
|
59
|
+
* moved it.
|
|
60
|
+
*/
|
|
54
61
|
refresh: () => void;
|
|
55
62
|
}
|
|
56
63
|
/**
|
|
@@ -5,7 +5,10 @@ interface ScrollHorizontalOptions {
|
|
|
5
5
|
* Total horizontal travel distance in pixels.
|
|
6
6
|
*
|
|
7
7
|
* Default: `track.scrollWidth` minus the width it is seen through — the
|
|
8
|
-
*
|
|
8
|
+
* content box of the sticky stage around the track; without one, the
|
|
9
|
+
* `scrollContainer`'s client width, or the viewport's with any scrollbar left
|
|
10
|
+
* out. Re-measured whenever the layout changes, so leave it out unless you
|
|
11
|
+
* want a fixed number: a number you pass is used as given.
|
|
9
12
|
*/
|
|
10
13
|
distance?: number;
|
|
11
14
|
/**
|
|
@@ -50,7 +53,11 @@ interface ScrollHorizontalOptions {
|
|
|
50
53
|
onProgress?: (progress: number) => void;
|
|
51
54
|
}
|
|
52
55
|
interface ScrollHorizontalInstance extends ScrollDrawInstance {
|
|
53
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Re-measure now. The strip already re-measures 150 ms after the window, the
|
|
58
|
+
* page, the track or its runway changes size; call this when something else
|
|
59
|
+
* moved it.
|
|
60
|
+
*/
|
|
54
61
|
refresh: () => void;
|
|
55
62
|
}
|
|
56
63
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunk-QJ4H2HW3.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-PEFR3ZB7.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var
|
|
1
|
+
import {a}from'../chunk-QJ4H2HW3.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-PEFR3ZB7.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function k(d,r={}){if(typeof window>"u")return x;let h=typeof d=="string"?document.querySelector(d):d;if(!h)return b("scrollHorizontal: track element not found:",d),x;let o=h,{easing:R="linear",trigger:C={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:L=false,onProgress:v}=r,c=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function O(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return c?c.clientWidth:document.documentElement.clientWidth||window.innerWidth}function g(){return r.distance??o.scrollWidth-O()}function m(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let f=g(),i=m(),n=a(o,z(f,i)),S=p(),l=null;function z(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:C,easing:R,native:false,respectReducedMotion:L,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function p(){let e=i.getBoundingClientRect(),t=c?e.top-c.getBoundingClientRect().top+c.scrollTop:e.top+window.scrollY;return `${g()} ${Math.round(t)} ${Math.round(e.height)}`}function T(){n.destroy();let e=m(),t=e!==i;f=g(),i=e,n=a(o,z(f,i)),S=p(),l!==null&&n.seek(l),t&&H();}let E;function P(){(m()!==i||p()!==S)&&T();}function u(){clearTimeout(E),E=setTimeout(P,150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let a$1=typeof ResizeObserver<"u"?new ResizeObserver(u):void 0;function H(){if(!a$1)return;a$1.disconnect();let e=[document.body,document.documentElement,o,i];e.filter((t,M)=>t&&e.indexOf(t)===M).forEach(t=>a$1.observe(t));}return H(),{destroy(){clearTimeout(E),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),a$1?.disconnect(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){T();}}}export{k as scrollHorizontal};
|
package/dist/nuxt/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var vue=require('vue');function rr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),a=Math.sqrt(t),s=0,c=[];for(let
|
|
1
|
+
'use strict';var vue=require('vue');function rr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),a=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let E=Math.pow(a,d);c.push(E),s+=E;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let E=0;E<r;E++)if(d<=u[E+1]){let V=(d-u[E])/(u[E+1]-u[E]);if(E===0)return V*(2-V);let C=1-Math.pow(t,E);return C+(1-C)*(2*V-1)*(2*V-1)}return 1}}function nr({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),a=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-a)*(2*Math.PI)/t)+1}var te={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:rr(),elastic:nr()};function Pt(e,n,r){return Math.min(r,Math.max(n,e))}function de(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function Ot(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function kt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function J(e,n,r,t){return r===n?0:Pt((e-n)/(r-n)*t,0,1)}function xe(e,n,r,t,a){let s=Ot(e.top,e.height,n,t.element)-kt(t.viewport,r),c=Ot(e.top,e.height,n,a.element)-kt(a.viewport,r);return {tStart:s,tEnd:c}}function nt(e,n,r){let t=e.getBoundingClientRect(),a=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:a,scroll:0}:{top:r==="x"?t.left:t.top,height:a,scroll:r==="x"?window.scrollX:window.scrollY}}function Be(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Rt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,n,r){let t=Rt(e),a=Rt(n);return !t||!a?e:`rgb(${Math.round(t[0]+(a[0]-t[0])*r)},${Math.round(t[1]+(a[1]-t[1])*r)},${Math.round(t[2]+(a[2]-t[2])*r)})`}var Ft={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ue=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ge(e,...n){Ue&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var or="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",sr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Dt=33;function ir(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function ar(e){let n=[];for(let r=0;r<Dt;r++){let t=r/(Dt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function ot(e){switch(e){case "linear":return "linear";case "ease-in":return or;case "ease-out":return sr;case "ease-in-out":return ir()?ar(te["ease-in-out"]):null;default:return null}}var It=Symbol.for("svg-scroll-draw.registry");function Nt(){let e=globalThis;return e[It]||(e[It]=new Map)}function Le(e,n){Nt().set(e,n);}function $e(e){Nt().delete(e);}var lr=0;function cr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ht(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function ur(e){if(!Ue)return;let n=Ht(e,"stroke");if(!n||n==="none"){ge("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Vt.has(r)&&!Vt.has(Ht(e,"fill"))&&ge("Element has a fill \u2014 it may obscure the stroke animation.",e);}function mr(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function a(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
|
|
2
2
|
<div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",a,{passive:true}),a(),{el:t,destroy(){window.removeEventListener("scroll",a),t.remove();}}}var zt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,_t=/[MmLlHhVvCcSsQqTtAaZz]/g;function fr(e,n,r){if(!Ue)return;let t=(e.match(_t)??[]).join("").toUpperCase(),a=(n.match(_t)??[]).join("").toUpperCase(),s=(e.match(zt)??[]).length,c=(n.match(zt)??[]).length;if(t!==a){he(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${a||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&he(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ut(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),a=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[a++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function mt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,a=r?{...Ft[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:A="forward",once:ne=false,debug:Le=false,axis:W="y",scrollContainer:ee,autoReverse:X=false,delay:G=0,strokeColor:M,strokeWidth:$,fillOpacity:C,waypoints:w,velocityScale:k=false,threshold:F=0,rootMargin:P="0px",repeat:v=0,repeatDelay:oe=0,morphTo:D,clip:se,autoplay:ie=false,duration:te=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:I,onLeaveBack:fe}=a,K=se===true?"left":typeof se=="string"?se:false,Se=typeof p=="function"?p:re[p]??re.linear,$e=de(T.start??"top bottom"),_e=de(T.end??"bottom top"),be=typeof ee=="string"?document.querySelector(ee):ee??null,we=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray($)?$[0]:null,j=Array.isArray($)?$[1]:typeof $=="number"?$:null,pe=Array.isArray(C)?C[0]:null,Q=Array.isArray(C)?C[1]:typeof C=="number"?C:null;function Pe(o){let l=o*100;switch(K){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let z=K?[]:Array.from(e.querySelectorAll(c)),O=[],i=[],f=0,ge=0,N=false,_=false,q=0,xe=false,ve=-1,Z=[],Ne=-1,U=false,Oe=0,De=0,He,st=null;function Et(){st?.destroy(),st=null;}let Ve=new Set,Tt=NaN,ze=true,Qe=-1,xt=performance.now(),qe=NaN;function it(){return be?W==="x"?be.scrollLeft:be.scrollTop:W==="x"?window.scrollX:window.scrollY}function At(){return be?W==="x"?be.clientWidth:be.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function Mt(){let o=nt(e,be,W);return Te(o,o.scroll,At(),$e,_e)}function Ct(){(({tStart:f,tEnd:ge}=Mt())),Le&&Ue&&(Et(),st=mr(f,ge,W));}function at(o,l=Mt){Me(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let b=o.destroy;return o.destroy=()=>{b.call(o),Ce(e);},o}function Zt(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),K){let b=l==="reverse"?1-o:o;e.style.clipPath=Pe(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=l==="reverse"?`${O[ue]*o}`:`${O[ue]*(1-o)}`,m&&(b.style.opacity=l==="reverse"?`${1-o}`:`${o}`),we&&le?b.style.stroke=We(we,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Q!==null?b.style.fillOpacity=`${pe+(Q-pe)*o}`:Q!==null&&(b.style.fillOpacity=`${Q}`),D&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ut(i[ue],D,o));});}function Ze(){if(e.style.setProperty("--scroll-draw-progress","0"),K){e.style.clipPath=Pe(0);return}z.forEach((o,l)=>{o.style.strokeDasharray=`${O[l]}`,o.style.strokeDashoffset=A==="reverse"?"0":`${O[l]}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",we&&(o.style.stroke=we),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),D&&o.tagName.toLowerCase()==="path"&&i[l]&&o.setAttribute("d",i[l]);});}if(z.forEach(o=>{ur(o);let l=Be(o);O.push(l);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),D&&(b?fr(i[i.length-1],D,o):he(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=A==="reverse"?`${l}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Q!==null&&(o.style.fillOpacity=`${Q}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=A==="reverse"?"0":`${l}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",we&&(o.style.stroke=we),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),K){if(s)return e.style.clipPath=Pe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Pe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Lt=typeof p=="string"?ot(p):null;function Jt(){return !(ae===false||!cr()||!z.length||!Lt||K||W!=="y"||be||u!==1||V!==0||ne||X||k!==false||D||w||v||G>0||d||x||g||L||E||I||fe||M!=null||$!=null||C!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function er(){let o=++lr,l=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Ie=A==="reverse"?"0":"var(--ssd-len)",ke=A==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Ie};`,S=`stroke-dashoffset:${ke};`;m&&(Ae+=`opacity:${A==="reverse"?1:0};`,S+=`opacity:${A==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${l}{from{${Ae}}to{${S}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(b);function me(y,Y){y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l);}z.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:Y,tEnd:Ee}=Te({top:y.top,height:y.height},it(),At(),$e,_e);return Se(J(it(),Y,Ee,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),R.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let Y=Math.min(1,Math.max(0,y));H=Y,h=true,z.forEach((Ee,ye)=>{Ee.classList.remove(l),Ee.style.strokeDashoffset=A==="reverse"?`${O[ye]*Y}`:`${O[ye]*(1-Y)}`,m&&(Ee.style.opacity=A==="reverse"?`${1-Y}`:`${Y}`);});},getProgress(){return B()},refresh(){z.forEach((y,Y)=>{O[Y]=Be(y),y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`;});}}}if(Jt())return at(er());function tr(){let o=Math.max(1,te),l=0,b=0,ue=false;function Ie(h){let H=true;if(K){let B=Math.min(1,Math.max(0,h/o)),y=Se(B);Oe=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Pe(A==="reverse"?1-y:y),d?.(y),B<1&&(H=false);}else z.forEach((B,y)=>{let Y=y*V*o,Ee=Math.min(1,Math.max(0,(h-Y)/o)),ye=Se(Ee);B.style.strokeDashoffset=A==="reverse"?`${O[y]*ye}`:`${O[y]*(1-ye)}`,m&&(B.style.opacity=A==="reverse"?`${1-ye}`:`${ye}`),we&&le?B.style.stroke=We(we,le,ye):le&&(B.style.stroke=le),ce!==null&&j!==null?B.style.strokeWidth=`${ce+(j-ce)*ye}`:j!==null&&(B.style.strokeWidth=`${j}`),pe!==null&&Q!==null?B.style.fillOpacity=`${pe+(Q-pe)*ye}`:Q!==null&&(B.style.fillOpacity=`${Q}`),D&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ut(i[y],D,ye)),y===0&&(Oe=ye,d?.(ye),e.style.setProperty("--scroll-draw-progress",String(ye))),Ee<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=Se(B);for(let Y in w){let Ee=parseFloat(Y);y>=Ee&&!Ve.has(Ee)&&(Ve.add(Ee),w[Y]?.());}}return H}function ke(h){if(U)return;let H=h-l;_||(_=true,x?.());let B=Ie(H);if(B&&!N){N=true,Ie(o*(1+Math.max(0,z.length-1)*V)),g?.(),De<(v==="infinite"?1/0:v??0)&&(De++,He=setTimeout(()=>{l=performance.now(),_=false,N=false,Ve.clear(),Ze(),q=requestAnimationFrame(ke);},oe));return}B||(q=requestAnimationFrame(ke));}function Ae(){cancelAnimationFrame(q),clearTimeout(He),l=performance.now(),b=0,U=false,_=false,N=false,De=0,ue=true,Oe=0,Ve.clear(),Ze(),q=requestAnimationFrame(ke);}let S=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(ne&&N)?Ae():!H.isIntersecting&&!ne&&!N&&(cancelAnimationFrame(q),clearTimeout(He),ue=false);});},{root:be??null,threshold:F,rootMargin:P}),R;function me(){clearTimeout(R),R=setTimeout(()=>{z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>S.observe(e),G):S.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(He),S.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(R);},replay(){De=0,Ae();},pause(){U||!ue||(U=true,b=performance.now()-l,cancelAnimationFrame(q));},resume(){U&&(U=false,ue=true,l=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));Oe=H,U=true,b=H*o,l=performance.now()-b,cancelAnimationFrame(q),Ie(b);},getProgress(){return Oe},refresh(){clearTimeout(R),z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});}}}if(ie)return at(tr());Ct();function Je(){if(!xe||U)return;let o=performance.now(),l=it();if(!ze&&k===false&&l===Tt){q=requestAnimationFrame(Je);return}ze=false,Tt=l;let b=u;if(k!==false){let S=o-xt,R=S>0?Math.abs(l-(Qe<0?l:Qe))/S:0;b=u*Math.max(.2,1+R*(typeof k=="number"?k:1)*.04);}Qe=l,xt=o;let ue=X?Ne===-1||l>=Ne?"forward":"reverse":A;Ne=l;let Ie=ge-f,ke=true,Ae=Ie===0?0:(l-f)/Ie;if(isNaN(qe)||(qe<=0&&Ae>0?L?.():qe>0&&Ae<=0&&fe?.(),qe<1&&Ae>=1?E?.():qe>=1&&Ae<1&&I?.()),qe=Ae,K){let S=Se(J(l,f,ge,b));ne&&!X&&(ve=Math.max(ve,S),S=ve),Oe=S,e.style.setProperty("--scroll-draw-progress",String(S));let R=ue==="reverse"?1-S:S;e.style.clipPath=Pe(R),d?.(S),!_&&J(l,f,ge,b)>0&&(_=true,x?.()),S>=1&&!N?(N=true,g?.(),De<(v==="infinite"?1/0:v??0)&&(De++,He=setTimeout(()=>{ve=-1,_=false,N=false,e.style.clipPath=Pe(0);},oe))):S<1&&!ne&&(N=false),q=requestAnimationFrame(Je);return}if(z.forEach((S,R)=>{let me=R*V*Ie,h=Se(J(l,f+me,ge+me,b));ne&&!X&&(h=Z[R]=Math.max(Z[R]??ve,h)),Oe=h,S.style.strokeDashoffset=ue==="reverse"?`${O[R]*h}`:`${O[R]*(1-h)}`,m&&(S.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),we&&le?S.style.stroke=We(we,le,h):le&&(S.style.stroke=le),ce!==null&&j!==null?S.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(S.style.strokeWidth=`${j}`),pe!==null&&Q!==null?S.style.fillOpacity=`${pe+(Q-pe)*h}`:Q!==null&&(S.style.fillOpacity=`${Q}`),D&&S.tagName.toLowerCase()==="path"&&i[R]&&S.setAttribute("d",ut(i[R],D,h)),R===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let S=Se(J(l,f,ge,b));for(let R in w){let me=parseFloat(R);S>=me&&!Ve.has(me)&&(Ve.add(me),w[R]?.());}}!_&&J(l,f,ge,b)>0&&(_=true,x?.()),ke&&!N?(N=true,g?.(),De<(v==="infinite"?1/0:v??0)&&(De++,He=setTimeout(()=>{ve=-1,Z=[],_=false,N=false,Ve.clear(),Ze(),ze=true;},oe))):!ke&&!ne&&(N=false),q=requestAnimationFrame(Je);}let lt=false;function et(){lt||(lt=true,q=requestAnimationFrame(function(){Je();}));}function tt(){lt=false,cancelAnimationFrame(q);}let ct=new IntersectionObserver(o=>{o.forEach(l=>{xe=l.isIntersecting,xe&&!U?(ze=true,et()):tt();});},{root:be??null,threshold:F,rootMargin:P});function $t(){z.forEach((o,l)=>{O[l]=Be(o),o.style.strokeDasharray=`${O[l]}`;}),Ct(),ze=true;}let rt;function Ge(){clearTimeout(rt),rt=setTimeout($t,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),G>0?setTimeout(()=>ct.observe(e),G):ct.observe(e),at({destroy(){cancelAnimationFrame(q),clearTimeout(He),tt(),ct.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(rt),Et();},replay(){ve=-1,Z=[],Ne=-1,Qe=-1,_=false,N=false,De=0,U=false,Oe=0,Ve.clear(),clearTimeout(He),Ze(),ze=true,xe&&et();},pause(){U=true,tt();},resume(){U&&(U=false,ze=true,xe&&et());},seek(o){let l=Math.min(1,Math.max(0,o));Oe=l,ve=l,Z=[],U=true,tt(),Zt(l,A),ze=true;},getProgress(){return Oe},refresh(){clearTimeout(rt),$t(),xe&&!U&&et();}},()=>({tStart:f,tEnd:ge}))}var qt=new WeakMap,pr=0;function Bt(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=qt.get(r);return t===void 0&&qt.set(r,t=++pr),`el#${t}`}return r})}function Wt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...a)=>n()[t]?.(...a));return r}function dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Gt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let a=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:a,units:s});}return n}function gr(e,n,r){let t=Gt(e),a=Gt(n);return t.length===0||t.length!==a.length?r<1?e:n:t.map((s,c)=>{let u=a[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function jt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),a=String(n);if(dr(t))return We(t,a,r);if(t.includes("("))return gr(t,a,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=a.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:a}function yr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var hr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),br=0,Ut="--scroll-draw-progress";function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ft(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:a={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:A=true,triggerElement:ne,onProgress:Le,onComplete:W,onEnter:ee,onLeave:X,onEnterBack:G,onLeaveBack:M}=n,$=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof s=="function"?s:re[s]??re["ease-out"],w=de(a.start??"top bottom"),k=de(a.end??"bottom top"),F=ne??e,P=typeof p=="string"?document.querySelector(p):p??null,v=Object.entries(t).map(([i,f])=>({prop:yr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of v)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of v)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...v.map(f=>f.prop),Ut])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if($)return D(),W?.(),{...r,destroy:ie,getProgress:()=>1};oe();let te=typeof s=="string"?ot(s):null;function ae(){if(!T||!wr()||!te||m!=="y"||P||F!==e||u||c!==1||Le||W||ee||X||G||M||V!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let i of v)if(!hr.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++br}`,f=v.map(Z=>`${Z.prop}:${Z.from}`).join(";"),ge=v.map(Z=>`${Z.prop}:${Z.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${te};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,xe=()=>{let Z=e.getBoundingClientRect();return Te({top:Z.top,height:Z.height},_(),q(),w,k)};Me(e,{type:"animate",getProgress:()=>ve.getProgress(),getTrigger:xe});let ve={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",ie(),Ce(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(Z){let Ne=Math.min(1,Math.max(0,Z));e.classList.remove(i);for(let U of v)e.style.setProperty(U.prop,jt(U.from,U.to,Ne));},getProgress(){let{tStart:Z,tEnd:Ne}=xe();return C(J(_(),Z,Ne,c))}};return ve}if(ae())return d();let x=0,g=0,L=0,E=false,I=false,fe=-1,K=0,Se=false,$e=NaN,_e=-1,be=0,we=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=nt(F,P,m),f=Te(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Ut,String(i));for(let f of v)e.style.setProperty(f.prop,jt(f.from,f.to,i));Le?.(i);}function pe(i){if(isNaN($e)){$e=i;return}$e<=0&&i>0?ee?.():$e>0&&i<=0&&M?.(),$e<1&&i>=1?X?.():$e>=1&&i<1&&G?.(),$e=i;}function Q(){if(!E||I)return;let i=performance.now(),f=we(),ge=c;if(V!==false){let q=i-be,xe=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ge=c*Math.max(.2,1+xe*(typeof V=="number"?V:1)*.04);}_e=f,be=i;let N=g===x?0:(f-x)/(g-x);pe(N);let _=C(J(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),K=_,j(_),_>=1&&!Se?(Se=true,W?.()):_<1&&!u&&(Se=false),L=requestAnimationFrame(Q);}ce(),g===x&&he("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=C(J(we(),x,g,c));u&&i>0&&(fe=i),K=i,j(i);}let Pe=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!I?L=requestAnimationFrame(Q):cancelAnimationFrame(L);});},{root:P??null}),z;function O(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Pe.observe(e),Me(e,{type:"animate",getProgress:()=>K,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Pe.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(z),ie(),Ce(e);},replay(){fe=-1,Se=false,K=0,I=false,j(0);},pause(){I=true,cancelAnimationFrame(L);},resume(){I&&(I=false,E&&(L=requestAnimationFrame(Q)));},seek(i){let f=Math.min(1,Math.max(0,i));K=f,fe=f,I=true,cancelAnimationFrame(L),j(f);},getProgress(){return K}}}var pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n){if(typeof window>"u")return pt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return he("scrollCounter: element not found:",e),pt;let t=r,{from:a=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=n,A=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),ne=typeof u=="function"?u:re[u]??re["ease-out"],Le=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=A(s),V?.(),pt;let X=0,G=0,M=0,$=false,C=false,w=-1,k=0,F=false,P=()=>window.scrollY,v=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=Te({top:d.top,height:d.height},P(),v(),Le,W);X=x.tStart,G=x.tEnd;}function D(d){t.textContent=A(a+(s-a)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!$||C)return;let d=ne(J(P(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,D(d),d>=1&&!F?(F=true,V?.()):d<1&&!p&&(F=false),M=requestAnimationFrame(se);}oe();{let d=ne(J(P(),X,G,1));p&&d>0&&(w=d),k=d,D(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{$=x.isIntersecting,$&&!C?M=requestAnimationFrame(se):cancelAnimationFrame(M);});}),te;function ae(){clearTimeout(te),te=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Me(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(te),Ce(t);},replay(){w=-1,F=false,k=0,C=false,D(0);},pause(){C=true,cancelAnimationFrame(M);},resume(){C&&(C=false,$&&(M=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,C=true,cancelAnimationFrame(M),D(x);},getProgress(){return k}}}var Yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return Yt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return he("scrollVideo: <video> element not found:",e),Yt;let t=r,{trigger:a={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=n,A=window.matchMedia("(prefers-reduced-motion: reduce)").matches,ne=typeof s=="function"?s:re[s]??re.linear,Le=de(a.start??"top top"),W=de(a.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let ee=n.from??0,X=n.to,G=0,M=0,$=0,C=false,w=false,k=-1,F=0,P=false,v=false,oe=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),I=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,K=Te({top:I,height:fe},oe(),D(),Le,W);G=K.tStart,M=K.tEnd;}let ie=NaN;function te(E){if(!v)return;let I=X??t.duration??0,fe=ee+(I-ee)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!C||w||!v||A)return;let E=ne(J(oe(),G,M,1));c&&(k=Math.max(k,E),E=k),F=E,te(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),$=requestAnimationFrame(ae);}function d(){if(v=true,X===void 0&&(X=t.duration),A){te(1),p?.();return}se(),p?.(),C&&!w&&($=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),v||se();let x=new IntersectionObserver(E=>{E.forEach(I=>{C=I.isIntersecting,C&&!w&&v?$=requestAnimationFrame(ae):cancelAnimationFrame($);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Me(t,{type:"video",getProgress:()=>F,getTrigger:()=>({tStart:G,tEnd:M})}),{destroy(){cancelAnimationFrame($),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),Ce(t);},replay(){k=-1,P=false,F=0,w=false,ie=NaN,te(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,C&&v&&($=requestAnimationFrame(ae)));},seek(E){let I=Math.min(1,Math.max(0,E));F=I,k=I,w=true,cancelAnimationFrame($),ie=NaN,te(I);},getProgress(){return F}}}function Qt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function Sr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Xt(e){let n=Qt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],a=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of a){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function vr(e,n,r,t){if(r<=1||t===0)return e;let a=(r-1)*t,s=n*t,c=s+(1-a);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function Er(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return Kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return he("scrollText: element not found:",e),Kt;let t=r,{split:a="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof c=="function"?c:re[c]??re["ease-out"],ne=de(m.start??"top 85%"),Le=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;a==="chars"?ee=Sr(t):a==="lines"?ee=Xt(t):ee=Qt(t);let X=ee.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=Er(L,u);E&&(g.style.transform=E);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),ee.forEach((L,E)=>{let I=A(vr(g,E,X,s));G(L,I);});}if(V)return M(1),T?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let $=0,C=0,w=0,k=false,F=false,P=-1,v=0,oe=false,D=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=Te({top:g.top,height:g.height},D(),se(),ne,Le);$=L.tStart,C=L.tEnd;}function te(){if(!k||F)return;let g=J(D(),$,C,1);p&&(P=Math.max(P,g),g=P),v=g,M(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(te);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{k=L.isIntersecting,k&&!F?w=requestAnimationFrame(te):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(a==="lines"){let g=v;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),ee=Xt(t),M(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Me(t,{type:"text",getProgress:()=>v,getTrigger:()=>({tStart:$,tEnd:C})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=W,t.removeAttribute("aria-label"),Ce(t);},replay(){P=-1,oe=false,v=0,F=false,M(0);},pause(){F=true,cancelAnimationFrame(w);},resume(){F&&(F=false,k&&(w=requestAnimationFrame(te)));},seek(g){let L=Math.min(1,Math.max(0,g));v=L,P=L,F=true,cancelAnimationFrame(w),M(L);},getProgress(){return v}}}var Ke=e=>typeof e=="function"?e():vue.unref(e);function Fe(e,n,r){let t=null,a=n(),s=()=>{t?.destroy(),t=e.value?r(e.value,Wt(a,()=>a)):null;};vue.onMounted(s),vue.watch(()=>Bt(a=n()),s),vue.onUnmounted(()=>{t?.destroy(),t=null;});}function Cr(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),mt),n}var ht=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>{let t={};return e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete),t},mt),()=>vue.h("div",{ref:r},n.default?.())}});function Lr(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),ft),n}var bt=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options,ft),()=>vue.h("div",{ref:r},n.default?.())}});function $r(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),dt),n}var wt=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return Fe(n,()=>{let r={to:e.to};return e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete),r},dt),()=>vue.h("span",{ref:n})}});function Pr(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),gt),n}var St=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let n=vue.ref(null);return Fe(n,()=>e.options??{},gt),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Or(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),yt),n}var vt=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options??{},yt),()=>vue.h(e.tag,{ref:r},n.default?.())}});function Fn(){return {install(e){e.component("ScrollDraw",ht),e.component("ScrollAnimate",bt),e.component("ScrollCounter",wt),e.component("ScrollVideo",St),e.component("ScrollText",vt);}}}exports.ScrollAnimate=bt;exports.ScrollCounter=wt;exports.ScrollDraw=ht;exports.ScrollText=vt;exports.ScrollVideo=St;exports.createScrollDrawPlugin=Fn;exports.useScrollAnimate=Lr;exports.useScrollCounter=$r;exports.useScrollDraw=Cr;exports.useScrollText=Or;exports.useScrollVideo=Pr;
|
|
3
|
+
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",a,{passive:true}),a(),{el:t,destroy(){window.removeEventListener("scroll",a),t.remove();}}}var zt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,_t=/[MmLlHhVvCcSsQqTtAaZz]/g;function fr(e,n,r){if(!Ue)return;let t=(e.match(_t)??[]).join("").toUpperCase(),a=(n.match(_t)??[]).join("").toUpperCase(),s=(e.match(zt)??[]).length,c=(n.match(zt)??[]).length;if(t!==a){ge(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${a||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&ge(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ut(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),a=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[a++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function mt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,a=r?{...Ft[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:E={},stagger:V=0,direction:C="forward",once:re=false,debug:Ae=false,axis:W="y",scrollContainer:ne,autoReverse:oe=false,delay:Y=0,strokeColor:A,strokeWidth:I,fillOpacity:L,waypoints:w,velocityScale:R=false,threshold:P=0,rootMargin:$="0px",repeat:T=0,repeatDelay:X=0,morphTo:x,clip:fe,autoplay:be=false,duration:se=1e3,native:ie=true,onProgress:p,onStart:v,onComplete:g,onEnter:O,onLeave:ae,onEnterBack:ee,onLeaveBack:M}=a,F=fe===true?"left":typeof fe=="string"?fe:false,K=typeof d=="function"?d:te[d]??te.linear,we=de(E.start??"top bottom"),_e=de(E.end??"bottom top"),Se=typeof ne=="string"?document.querySelector(ne):ne??null,ve=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray(I)?I[0]:null,G=Array.isArray(I)?I[1]:typeof I=="number"?I:null,pe=Array.isArray(L)?L[0]:null,Q=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Pe(o){let l=o*100;switch(F){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let z=F?[]:Array.from(e.querySelectorAll(c)),k=[],i=[],f=0,ye=0,N=false,_=false,q=0,Me=false,Ee=-1,Z=[],Ne=-1,j=false,Oe=0,De=0,He,st=null;function Et(){st?.destroy(),st=null;}let Ve=new Set,Tt=NaN,ze=true,Qe=-1,xt=performance.now(),qe=NaN;function it(){return Se?W==="x"?Se.scrollLeft:Se.scrollTop:W==="x"?window.scrollX:window.scrollY}function At(){return Se?W==="x"?Se.clientWidth:Se.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function Mt(){let o=nt(e,Se,W);return xe(o,o.scroll,At(),we,_e)}function Ct(){(({tStart:f,tEnd:ye}=Mt())),Ae&&Ue&&(Et(),st=mr(f,ye,W));}function at(o,l=Mt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Zt(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),F){let b=l==="reverse"?1-o:o;e.style.clipPath=Pe(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=l==="reverse"?`${k[ue]*o}`:`${k[ue]*(1-o)}`,m&&(b.style.opacity=l==="reverse"?`${1-o}`:`${o}`),ve&&le?b.style.stroke=We(ve,le,o):le&&(b.style.stroke=le),ce!==null&&G!==null?b.style.strokeWidth=`${ce+(G-ce)*o}`:G!==null&&(b.style.strokeWidth=`${G}`),pe!==null&&Q!==null?b.style.fillOpacity=`${pe+(Q-pe)*o}`:Q!==null&&(b.style.fillOpacity=`${Q}`),x&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ut(i[ue],x,o));});}function Ze(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=Pe(0);return}z.forEach((o,l)=>{o.style.strokeDasharray=`${k[l]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${k[l]}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),x&&o.tagName.toLowerCase()==="path"&&i[l]&&o.setAttribute("d",i[l]);});}if(z.forEach(o=>{ur(o);let l=Be(o);k.push(l);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),x&&(b?fr(i[i.length-1],x,o):ge(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=C==="reverse"?`${l}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),G!==null&&(o.style.strokeWidth=`${G}`),Q!==null&&(o.style.fillOpacity=`${Q}`),x&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",x)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=C==="reverse"?"0":`${l}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),F){if(s)return e.style.clipPath=Pe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Pe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Lt=typeof d=="string"?ot(d):null;function Jt(){return !(ie===false||!cr()||!z.length||!Lt||F||W!=="y"||Se||u!==1||V!==0||re||oe||R!==false||x||w||T||Y>0||p||v||g||O||ae||ee||M||A!=null||I!=null||L!=null||(E.start??"top bottom").trim()!=="top bottom"||(E.end??"bottom top").trim()!=="bottom top")}function er(){let o=++lr,l=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Ie=C==="reverse"?"0":"var(--ssd-len)",ke=C==="reverse"?"var(--ssd-len)":"0",Ce=`stroke-dashoffset:${Ie};`,S=`stroke-dashoffset:${ke};`;m&&(Ce+=`opacity:${C==="reverse"?1:0};`,S+=`opacity:${C==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${l}{from{${Ce}}to{${S}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(k[U])),y.style.strokeDasharray=`${k[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l);}z.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},it(),At(),we,_e);return K(J(it(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),D.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));H=U,h=true,z.forEach((Te,he)=>{Te.classList.remove(l),Te.style.strokeDashoffset=C==="reverse"?`${k[he]*U}`:`${k[he]*(1-U)}`,m&&(Te.style.opacity=C==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return B()},refresh(){z.forEach((y,U)=>{k[U]=Be(y),y.style.setProperty("--ssd-len",String(k[U])),y.style.strokeDasharray=`${k[U]}`;});}}}if(Jt())return at(er());function tr(){let o=Math.max(1,se),l=0,b=0,ue=false;function Ie(h){let H=true;if(F){let B=Math.min(1,Math.max(0,h/o)),y=K(B);Oe=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Pe(C==="reverse"?1-y:y),p?.(y),B<1&&(H=false);}else z.forEach((B,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),he=K(Te);B.style.strokeDashoffset=C==="reverse"?`${k[y]*he}`:`${k[y]*(1-he)}`,m&&(B.style.opacity=C==="reverse"?`${1-he}`:`${he}`),ve&&le?B.style.stroke=We(ve,le,he):le&&(B.style.stroke=le),ce!==null&&G!==null?B.style.strokeWidth=`${ce+(G-ce)*he}`:G!==null&&(B.style.strokeWidth=`${G}`),pe!==null&&Q!==null?B.style.fillOpacity=`${pe+(Q-pe)*he}`:Q!==null&&(B.style.fillOpacity=`${Q}`),x&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ut(i[y],x,he)),y===0&&(Oe=he,p?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Te<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=K(B);for(let U in w){let Te=parseFloat(U);y>=Te&&!Ve.has(Te)&&(Ve.add(Te),w[U]?.());}}return H}function ke(h){if(j)return;let H=h-l;_||(_=true,v?.());let B=Ie(H);if(B&&!N){N=true,Ie(o*(1+Math.max(0,z.length-1)*V)),g?.(),De<(T==="infinite"?1/0:T??0)&&(De++,He=setTimeout(()=>{l=performance.now(),_=false,N=false,Ve.clear(),Ze(),q=requestAnimationFrame(ke);},X));return}B||(q=requestAnimationFrame(ke));}function Ce(){cancelAnimationFrame(q),clearTimeout(He),l=performance.now(),b=0,j=false,_=false,N=false,De=0,ue=true,Oe=0,Ve.clear(),Ze(),q=requestAnimationFrame(ke);}let S=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(re&&N)?Ce():!H.isIntersecting&&!re&&!N&&(cancelAnimationFrame(q),clearTimeout(He),ue=false);});},{root:Se??null,threshold:P,rootMargin:$}),D;function me(){clearTimeout(D),D=setTimeout(()=>{z.forEach((h,H)=>{k[H]=Be(h),h.style.strokeDasharray=`${k[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),Y>0?setTimeout(()=>S.observe(e),Y):S.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(He),S.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(D);},replay(){De=0,Ce();},pause(){j||!ue||(j=true,b=performance.now()-l,cancelAnimationFrame(q));},resume(){j&&(j=false,ue=true,l=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));Oe=H,j=true,b=H*o,l=performance.now()-b,cancelAnimationFrame(q),Ie(b);},getProgress(){return Oe},refresh(){clearTimeout(D),z.forEach((h,H)=>{k[H]=Be(h),h.style.strokeDasharray=`${k[H]}`;});}}}if(be)return at(tr());Ct();function Je(){if(!Me||j)return;let o=performance.now(),l=it();if(!ze&&R===false&&l===Tt){q=requestAnimationFrame(Je);return}ze=false,Tt=l;let b=u;if(R!==false){let S=o-xt,D=S>0?Math.abs(l-(Qe<0?l:Qe))/S:0;b=u*Math.max(.2,1+D*(typeof R=="number"?R:1)*.04);}Qe=l,xt=o;let ue=oe?Ne===-1||l>=Ne?"forward":"reverse":C;Ne=l;let Ie=ye-f,ke=true,Ce=Ie===0?0:(l-f)/Ie;if(isNaN(qe)||(qe<=0&&Ce>0?O?.():qe>0&&Ce<=0&&M?.(),qe<1&&Ce>=1?ae?.():qe>=1&&Ce<1&&ee?.()),qe=Ce,F){let S=K(J(l,f,ye,b));re&&!oe&&(Ee=Math.max(Ee,S),S=Ee),Oe=S,e.style.setProperty("--scroll-draw-progress",String(S));let D=ue==="reverse"?1-S:S;e.style.clipPath=Pe(D),p?.(S),!_&&J(l,f,ye,b)>0&&(_=true,v?.()),S>=1&&!N?(N=true,g?.(),De<(T==="infinite"?1/0:T??0)&&(De++,He=setTimeout(()=>{Ee=-1,_=false,N=false,e.style.clipPath=Pe(0);},X))):S<1&&!re&&(N=false),q=requestAnimationFrame(Je);return}if(z.forEach((S,D)=>{let me=D*V*Ie,h=K(J(l,f+me,ye+me,b));re&&!oe&&(h=Z[D]=Math.max(Z[D]??Ee,h)),Oe=h,S.style.strokeDashoffset=ue==="reverse"?`${k[D]*h}`:`${k[D]*(1-h)}`,m&&(S.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),ve&&le?S.style.stroke=We(ve,le,h):le&&(S.style.stroke=le),ce!==null&&G!==null?S.style.strokeWidth=`${ce+(G-ce)*h}`:G!==null&&(S.style.strokeWidth=`${G}`),pe!==null&&Q!==null?S.style.fillOpacity=`${pe+(Q-pe)*h}`:Q!==null&&(S.style.fillOpacity=`${Q}`),x&&S.tagName.toLowerCase()==="path"&&i[D]&&S.setAttribute("d",ut(i[D],x,h)),D===0&&(p?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let S=K(J(l,f,ye,b));for(let D in w){let me=parseFloat(D);S>=me&&!Ve.has(me)&&(Ve.add(me),w[D]?.());}}!_&&J(l,f,ye,b)>0&&(_=true,v?.()),ke&&!N?(N=true,g?.(),De<(T==="infinite"?1/0:T??0)&&(De++,He=setTimeout(()=>{Ee=-1,Z=[],_=false,N=false,Ve.clear(),Ze(),ze=true;},X))):!ke&&!re&&(N=false),q=requestAnimationFrame(Je);}let lt=false;function et(){lt||(lt=true,q=requestAnimationFrame(function(){Je();}));}function tt(){lt=false,cancelAnimationFrame(q);}let ct=new IntersectionObserver(o=>{o.forEach(l=>{Me=l.isIntersecting,Me&&!j?(ze=true,et()):tt();});},{root:Se??null,threshold:P,rootMargin:$});function $t(){z.forEach((o,l)=>{k[l]=Be(o),o.style.strokeDasharray=`${k[l]}`;}),Ct(),ze=true;}let rt;function Ge(){clearTimeout(rt),rt=setTimeout($t,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),Y>0?setTimeout(()=>ct.observe(e),Y):ct.observe(e),at({destroy(){cancelAnimationFrame(q),clearTimeout(He),tt(),ct.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(rt),Et();},replay(){Ee=-1,Z=[],Ne=-1,Qe=-1,_=false,N=false,De=0,j=false,Oe=0,Ve.clear(),clearTimeout(He),Ze(),ze=true,Me&&et();},pause(){j=true,tt();},resume(){j&&(j=false,ze=true,Me&&et());},seek(o){let l=Math.min(1,Math.max(0,o));Oe=l,Ee=l,Z=[],j=true,tt(),Zt(l,C),ze=true;},getProgress(){return Oe},refresh(){clearTimeout(rt),$t(),Me&&!j&&et();}},()=>({tStart:f,tEnd:ye}))}var qt=new WeakMap,pr=0;function Bt(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=qt.get(r);return t===void 0&&qt.set(r,t=++pr),`el#${t}`}return r})}function Wt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...a)=>n()[t]?.(...a));return r}function dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Gt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let a=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:a,units:s});}return n}function gr(e,n,r){let t=Gt(e),a=Gt(n);return t.length===0||t.length!==a.length?r<1?e:n:t.map((s,c)=>{let u=a[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function jt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),a=String(n);if(dr(t))return We(t,a,r);if(t.includes("("))return gr(t,a,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=a.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:a}function yr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var hr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),br=0,Ut="--scroll-draw-progress";function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ft(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:a={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:E=true,velocityScale:V=false,respectReducedMotion:C=true,triggerElement:re,onProgress:Ae,onComplete:W,onEnter:ne,onLeave:oe,onEnterBack:Y,onLeaveBack:A}=n,I=C&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:te[s]??te["ease-out"],w=de(a.start??"top bottom"),R=de(a.end??"bottom top"),P=re??e,$=typeof d=="string"?document.querySelector(d):d??null,T=Object.entries(t).map(([i,f])=>({prop:yr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function X(){let i=window.getComputedStyle(e);for(let f of T)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function x(){for(let i of T)e.style.setProperty(i.prop,String(i.to));}let fe=new Map;for(let i of [...T.map(f=>f.prop),Ut])fe.set(i,e.style.getPropertyValue(i));function be(){for(let[i,f]of fe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(I)return x(),W?.(),{...r,destroy:be,getProgress:()=>1};X();let se=typeof s=="string"?ot(s):null;function ie(){if(!E||!wr()||!se||m!=="y"||$||P!==e||u||c!==1||Ae||W||ne||oe||Y||A||V!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let i of T)if(!hr.has(i.prop))return false;return true}function p(){let i=`ssd-a-${++br}`,f=T.map(Z=>`${Z.prop}:${Z.from}`).join(";"),ye=T.map(Z=>`${Z.prop}:${Z.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ye}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${se};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let Z=e.getBoundingClientRect();return xe({top:Z.top,height:Z.height},_(),q(),w,R)};Le(e,{type:"animate",getProgress:()=>Ee.getProgress(),getTrigger:Me});let Ee={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",be(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(Z){let Ne=Math.min(1,Math.max(0,Z));e.classList.remove(i);for(let j of T)e.style.setProperty(j.prop,jt(j.from,j.to,Ne));},getProgress(){let{tStart:Z,tEnd:Ne}=Me();return L(J(_(),Z,Ne,c))}};return Ee}if(ie())return p();let v=0,g=0,O=0,ae=false,ee=false,M=-1,F=0,K=false,we=NaN,_e=-1,Se=0,ve=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=nt(P,$,m),f=xe(i,i.scroll,le(),w,R);v=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(Ut,String(i));for(let f of T)e.style.setProperty(f.prop,jt(f.from,f.to,i));Ae?.(i);}function pe(i){if(isNaN(we)){we=i;return}we<=0&&i>0?ne?.():we>0&&i<=0&&A?.(),we<1&&i>=1?oe?.():we>=1&&i<1&&Y?.(),we=i;}function Q(){if(!ae||ee)return;let i=performance.now(),f=ve(),ye=c;if(V!==false){let q=i-Se,Me=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ye=c*Math.max(.2,1+Me*(typeof V=="number"?V:1)*.04);}_e=f,Se=i;let N=g===v?0:(f-v)/(g-v);pe(N);let _=L(J(f,v,g,ye));u&&(M=Math.max(M,_),_=M),F=_,G(_),_>=1&&!K?(K=true,W?.()):_<1&&!u&&(K=false),O=requestAnimationFrame(Q);}ce(),g===v&&ge("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=L(J(ve(),v,g,c));u&&i>0&&(M=i),F=i,G(i);}let Pe=new IntersectionObserver(i=>{i.forEach(f=>{ae=f.isIntersecting,ae&&!ee?O=requestAnimationFrame(Q):cancelAnimationFrame(O);});},{root:$??null}),z;function k(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),Pe.observe(e),Le(e,{type:"animate",getProgress:()=>F,getTrigger:()=>({tStart:v,tEnd:g})}),{destroy(){cancelAnimationFrame(O),Pe.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(z),be(),$e(e);},replay(){M=-1,K=false,F=0,ee=false,G(0);},pause(){ee=true,cancelAnimationFrame(O);},resume(){ee&&(ee=false,ae&&(O=requestAnimationFrame(Q)));},seek(i){let f=Math.min(1,Math.max(0,i));F=f,M=f,ee=true,cancelAnimationFrame(O),G(f);},getProgress(){return F}}}var pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n){if(typeof window>"u")return pt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollCounter: element not found:",e),pt;let t=r,{from:a=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:E,onComplete:V}=n,C=E!==void 0?p=>p.toFixed(E):c??(p=>String(Math.round(p))),re=typeof u=="function"?u:te[u]??te["ease-out"],Ae=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=C(s),V?.(),pt;let oe=0,Y=0,A=0,I=false,L=false,w=-1,R=0,P=false,$=()=>window.scrollY,T=()=>window.innerHeight;function X(){let p=t.getBoundingClientRect(),v=xe({top:p.top,height:p.height},$(),T(),Ae,W);oe=v.tStart,Y=v.tEnd;}function x(p){t.textContent=C(a+(s-a)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function fe(){if(!I||L)return;let p=re(J($(),oe,Y,1));d&&(w=Math.max(w,p),p=w),R=p,x(p),p>=1&&!P?(P=true,V?.()):p<1&&!d&&(P=false),A=requestAnimationFrame(fe);}X();{let p=re(J($(),oe,Y,1));d&&p>0&&(w=p),R=p,x(p);}let be=new IntersectionObserver(p=>{p.forEach(v=>{I=v.isIntersecting,I&&!L?A=requestAnimationFrame(fe):cancelAnimationFrame(A);});}),se;function ie(){clearTimeout(se),se=setTimeout(X,150);}return window.addEventListener("resize",ie),window.addEventListener("orientationchange",ie),be.observe(t),Le(t,{type:"counter",getProgress:()=>R,getTrigger:()=>({tStart:oe,tEnd:Y})}),{destroy(){cancelAnimationFrame(A),be.disconnect(),window.removeEventListener("resize",ie),window.removeEventListener("orientationchange",ie),clearTimeout(se),$e(t);},replay(){w=-1,P=false,R=0,L=false,x(0);},pause(){L=true,cancelAnimationFrame(A);},resume(){L&&(L=false,I&&(A=requestAnimationFrame(fe)));},seek(p){let v=Math.min(1,Math.max(0,p));R=v,w=v,L=true,cancelAnimationFrame(A),x(v);},getProgress(){return R}}}var Yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return Yt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ge("scrollVideo: <video> element not found:",e),Yt;let t=r,{trigger:a={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",triggerElement:d,onReady:E,onComplete:V,onProgress:C}=n,re=d??t,Ae=window.matchMedia("(prefers-reduced-motion: reduce)").matches,W=typeof s=="function"?s:te[s]??te.linear,ne=de(a.start??"top top"),oe=de(a.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Y=n.from??0,A=n.to,I=0,L=0,w=0,R=false,P=false,$=-1,T=0,X=false,x=false,fe=()=>u==="x"?window.scrollX:window.scrollY,be=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let M=re.getBoundingClientRect(),F=u==="x"?M.left:M.top,K=u==="x"?M.width:M.height,we=xe({top:F,height:K},fe(),be(),ne,oe);I=we.tStart,L=we.tEnd,x&&L===I&&ge("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let ie=NaN;function p(M){if(!x)return;let F=A??t.duration??0,K=Y+(F-Y)*M;K!==ie&&(ie=K,t.currentTime=K),t.style.setProperty("--scroll-draw-progress",String(M)),C?.(M);}function v(){if(!R||P||!x||Ae)return;let M=W(J(fe(),I,L,1));c&&($=Math.max($,M),M=$),T=M,p(M),M>=1&&!X?(X=true,V?.()):M<1&&!c&&(X=false),w=requestAnimationFrame(v);}function g(){if(x=true,A===void 0&&(A=t.duration),Ae){p(1),E?.();return}se(),E?.(),R&&!P&&(w=requestAnimationFrame(v));}t.readyState>=1?g():t.addEventListener("loadedmetadata",g,{once:true}),x||se();let O=new IntersectionObserver(M=>{M.forEach(F=>{R=F.isIntersecting,R&&!P&&x?w=requestAnimationFrame(v):cancelAnimationFrame(w);});}),ae;function ee(){clearTimeout(ae),ae=setTimeout(se,150);}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),O.observe(t),Le(t,{type:"video",getProgress:()=>T,getTrigger:()=>({tStart:I,tEnd:L})}),{destroy(){cancelAnimationFrame(w),O.disconnect(),t.removeEventListener("loadedmetadata",g),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout(ae),$e(t);},replay(){$=-1,X=false,T=0,P=false,ie=NaN,p(0);},pause(){P=true,cancelAnimationFrame(w);},resume(){P&&(P=false,R&&x&&(w=requestAnimationFrame(v)));},seek(M){let F=Math.min(1,Math.max(0,M));T=F,$=F,P=true,cancelAnimationFrame(w),ie=NaN,p(F);},getProgress(){return T}}}function Qt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function Sr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Xt(e){let n=Qt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],a=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of a){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let E=m.nextElementSibling;u.appendChild(m),d<c.length-1&&E&&E.style.whiteSpace==="pre"&&u.appendChild(E);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function vr(e,n,r,t){if(r<=1||t===0)return e;let a=(r-1)*t,s=n*t,c=s+(1-a);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function Er(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return Kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollText: element not found:",e),Kt;let t=r,{split:a="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:E}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof c=="function"?c:te[c]??te["ease-out"],re=de(m.start??"top 85%"),Ae=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ne;a==="chars"?ne=Sr(t):a==="lines"?ne=Xt(t):ne=Qt(t);let oe=ne.length;function Y(g,O){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*O));let ae=Er(O,u);ae&&(g.style.transform=ae);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),ne.forEach((O,ae)=>{let ee=C(vr(g,ae,oe,s));Y(O,ee);});}if(V)return A(1),E?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let I=0,L=0,w=0,R=false,P=false,$=-1,T=0,X=false,x=()=>window.scrollY,fe=()=>window.innerHeight;function be(){let g=t.getBoundingClientRect(),O=xe({top:g.top,height:g.height},x(),fe(),re,Ae);I=O.tStart,L=O.tEnd;}function se(){if(!R||P)return;let g=J(x(),I,L,1);d&&($=Math.max($,g),g=$),T=g,A(g),g>=1&&!X?(X=true,E?.()):g<1&&!d&&(X=false),w=requestAnimationFrame(se);}be();let ie=new IntersectionObserver(g=>{g.forEach(O=>{R=O.isIntersecting,R&&!P?w=requestAnimationFrame(se):cancelAnimationFrame(w);});}),p;function v(){clearTimeout(p),p=setTimeout(()=>{if(a==="lines"){let g=T;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),ne=Xt(t),A(g);}be();},150);}return window.addEventListener("resize",v),window.addEventListener("orientationchange",v),ie.observe(t),Le(t,{type:"text",getProgress:()=>T,getTrigger:()=>({tStart:I,tEnd:L})}),{destroy(){cancelAnimationFrame(w),ie.disconnect(),window.removeEventListener("resize",v),window.removeEventListener("orientationchange",v),clearTimeout(p),t.innerHTML=W,t.removeAttribute("aria-label"),$e(t);},replay(){$=-1,X=false,T=0,P=false,A(0);},pause(){P=true,cancelAnimationFrame(w);},resume(){P&&(P=false,R&&(w=requestAnimationFrame(se)));},seek(g){let O=Math.min(1,Math.max(0,g));T=O,$=O,P=true,cancelAnimationFrame(w),A(O);},getProgress(){return T}}}var Ke=e=>typeof e=="function"?e():vue.unref(e);function Fe(e,n,r){let t=null,a=n(),s=()=>{t?.destroy(),t=e.value?r(e.value,Wt(a,()=>a)):null;};vue.onMounted(s),vue.watch(()=>Bt(a=n()),s),vue.onUnmounted(()=>{t?.destroy(),t=null;});}function Cr(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),mt),n}var ht=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>{let t={};return e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete),t},mt),()=>vue.h("div",{ref:r},n.default?.())}});function Lr(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),ft),n}var bt=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options,ft),()=>vue.h("div",{ref:r},n.default?.())}});function $r(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),dt),n}var wt=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return Fe(n,()=>{let r={to:e.to};return e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete),r},dt),()=>vue.h("span",{ref:n})}});function Pr(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),gt),n}var St=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let n=vue.ref(null);return Fe(n,()=>e.options??{},gt),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Or(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),yt),n}var vt=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options??{},yt),()=>vue.h(e.tag,{ref:r},n.default?.())}});function Fn(){return {install(e){e.component("ScrollDraw",ht),e.component("ScrollAnimate",bt),e.component("ScrollCounter",wt),e.component("ScrollVideo",St),e.component("ScrollText",vt);}}}exports.ScrollAnimate=bt;exports.ScrollCounter=wt;exports.ScrollDraw=ht;exports.ScrollText=vt;exports.ScrollVideo=St;exports.createScrollDrawPlugin=Fn;exports.useScrollAnimate=Lr;exports.useScrollCounter=$r;exports.useScrollDraw=Cr;exports.useScrollText=Or;exports.useScrollVideo=Pr;
|