svg-scroll-draw 2.6.0 → 2.9.0

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.
Files changed (66) hide show
  1. package/dist/angular/index.cjs +3 -3
  2. package/dist/angular/index.d.mts +22 -0
  3. package/dist/angular/index.d.ts +22 -0
  4. package/dist/angular/index.mjs +3 -3
  5. package/dist/astro/index.cjs +3 -3
  6. package/dist/astro/index.d.mts +8 -0
  7. package/dist/astro/index.d.ts +8 -0
  8. package/dist/astro/index.mjs +3 -3
  9. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  10. package/dist/devtools/index.cjs +1 -1
  11. package/dist/devtools/index.mjs +1 -1
  12. package/dist/group/index.cjs +3 -3
  13. package/dist/group/index.d.mts +22 -0
  14. package/dist/group/index.d.ts +22 -0
  15. package/dist/group/index.mjs +3 -3
  16. package/dist/horizontal/index.cjs +1 -0
  17. package/dist/horizontal/index.d.mts +61 -0
  18. package/dist/horizontal/index.d.ts +61 -0
  19. package/dist/horizontal/index.mjs +1 -0
  20. package/dist/index.cjs +4 -4
  21. package/dist/index.d.mts +22 -0
  22. package/dist/index.d.ts +22 -0
  23. package/dist/index.mjs +4 -4
  24. package/dist/lenis/index.cjs +1 -0
  25. package/dist/lenis/index.d.mts +51 -0
  26. package/dist/lenis/index.d.ts +51 -0
  27. package/dist/lenis/index.mjs +1 -0
  28. package/dist/nuxt/index.cjs +2 -2
  29. package/dist/nuxt/index.d.mts +22 -0
  30. package/dist/nuxt/index.d.ts +22 -0
  31. package/dist/nuxt/index.mjs +2 -2
  32. package/dist/pin/index.cjs +1 -0
  33. package/dist/pin/index.d.mts +29 -0
  34. package/dist/pin/index.d.ts +29 -0
  35. package/dist/pin/index.mjs +1 -0
  36. package/dist/progress/index.cjs +1 -0
  37. package/dist/progress/index.d.mts +59 -0
  38. package/dist/progress/index.d.ts +59 -0
  39. package/dist/progress/index.mjs +1 -0
  40. package/dist/react/index.cjs +3 -3
  41. package/dist/react/index.d.mts +22 -0
  42. package/dist/react/index.d.ts +22 -0
  43. package/dist/react/index.mjs +3 -3
  44. package/dist/reveal/index.cjs +1 -0
  45. package/dist/reveal/index.d.mts +80 -0
  46. package/dist/reveal/index.d.ts +80 -0
  47. package/dist/reveal/index.mjs +1 -0
  48. package/dist/snap/index.cjs +1 -0
  49. package/dist/snap/index.d.mts +30 -0
  50. package/dist/snap/index.d.ts +30 -0
  51. package/dist/snap/index.mjs +1 -0
  52. package/dist/solid/index.cjs +3 -3
  53. package/dist/solid/index.d.mts +22 -0
  54. package/dist/solid/index.d.ts +22 -0
  55. package/dist/solid/index.mjs +3 -3
  56. package/dist/svelte/index.cjs +3 -3
  57. package/dist/svelte/index.d.mts +22 -0
  58. package/dist/svelte/index.d.ts +22 -0
  59. package/dist/svelte/index.mjs +3 -3
  60. package/dist/vue/index.cjs +2 -2
  61. package/dist/vue/index.d.mts +22 -0
  62. package/dist/vue/index.d.ts +22 -0
  63. package/dist/vue/index.mjs +2 -2
  64. package/dist/web-component/index.cjs +3 -3
  65. package/dist/web-component/index.mjs +3 -3
  66. package/package.json +31 -1
@@ -1,3 +1,3 @@
1
- 'use strict';function Et({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,m=[];for(let d=0;d<n;d++){let I=Math.pow(u,d);m.push(I),o+=I;}let l=[0],c=0;for(let d=0;d<n;d++)c+=m[d]/o,l.push(c);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let I=0;I<n;I++)if(d<=l[I+1]){let B=(d-l[I])/(l[I+1]-l[I]);if(I===0)return B*(2-B);let E=1-Math.pow(t,I);return E+(1-E)*(2*B-1)*(2*B-1)}return 1}}function St({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ae={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:Et(),elastic:St()};function le(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ye(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function je(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function Re(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function xt(e,r,n){return Math.min(n,Math.max(r,e))}function J(e,r,n,t){return n===r?0:xt((e-r)/(n-r)*t,0,1)}function fe(e,r,n,t,u){let o=Ye(e.top,e.height,r,t.element)-je(t.viewport,n),m=Ye(e.top,e.height,r,u.element)-je(u.viewport,n);return {tStart:o,tEnd:m}}function Ue(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Ce(e,r,n){let t=Ue(e),u=Ue(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var Ze={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}};function Je(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var Ke={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Tt=0;function At(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Mt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?Je("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&Je("Element has a fill \u2014 it may obscure the stroke animation.",e);}function $t(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,m=e-o,l=r-o,c=n==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${m}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;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function We(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let m=parseFloat(o),l=t[u++]??m;return String(+(m+(l-m)*n).toFixed(4))})}function Qe(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...Ze[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:d="linear",trigger:I={},stagger:B=0,direction:E="forward",once:re=false,debug:de=false,axis:q="y",scrollContainer:K,autoReverse:T=false,delay:N=0,strokeColor:A,strokeWidth:$,fillOpacity:P,waypoints:b,velocityScale:L=false,threshold:O=0,rootMargin:D="0px",repeat:M=0,repeatDelay:z=0,morphTo:C,clip:_,autoplay:Q=false,duration:j=1e3,native:oe=true,onProgress:f,onStart:k,onComplete:h}=u,p=_===true?"left":typeof _=="string"?_:false,F=typeof d=="function"?d:ae[d]??ae.linear,ge=le(I.start??"top bottom"),a=le(I.end??"bottom top"),g=typeof K=="string"?document.querySelector(K):K??null,ne=Array.isArray(A)?A[0]:null,V=Array.isArray(A)?A[1]:typeof A=="string"?A:null,U=Array.isArray($)?$[0]:null,se=Array.isArray($)?$[1]:typeof $=="number"?$:null,H=Array.isArray(P)?P[0]:null,G=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function me(s){let i=s*100;switch(p){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let ee=p?[]:Array.from(e.querySelectorAll(m)),X=[],ye=[],Ee=0,Se=0,ie=false,he=false,te=0,Ie=false,be=-1,Oe=-1,ce=false,$e=0,ve=0,xe,ze=null,Te=new Set,Fe=-1,Be=performance.now();function ke(){return g?q==="x"?g.scrollLeft:g.scrollTop:q==="x"?window.scrollX:window.scrollY}function Ge(){return g?q==="x"?g.clientWidth:g.clientHeight:q==="x"?window.innerWidth:window.innerHeight}function Xe(){let s=e.getBoundingClientRect(),i,v,Y;if(g){let ue=g.getBoundingClientRect();i=q==="x"?s.left-ue.left+g.scrollLeft:s.top-ue.top+g.scrollTop,v=q==="x"?s.width:s.height,Y=ke();}else i=q==="x"?s.left:s.top,v=q==="x"?s.width:s.height,Y=ke();let pe=fe({top:i,height:v},Y,Ge(),ge,a);Ee=pe.tStart,Se=pe.tEnd,de&&process.env.NODE_ENV!=="production"&&(ze?.remove(),ze=$t(Ee,Se,q));}function yt(s,i){if(e.style.setProperty("--scroll-draw-progress",String(s)),p){let v=i==="reverse"?1-s:s;e.style.clipPath=me(v);return}ee.forEach((v,Y)=>{v.style.strokeDashoffset=i==="reverse"?`${X[Y]*s}`:`${X[Y]*(1-s)}`,c&&(v.style.opacity=i==="reverse"?`${1-s}`:`${s}`),ne&&V?v.style.stroke=Ce(ne,V,s):V&&(v.style.stroke=V),U!==null&&se!==null?v.style.strokeWidth=`${U+(se-U)*s}`:se!==null&&(v.style.strokeWidth=`${se}`),H!==null&&G!==null?v.style.fillOpacity=`${H+(G-H)*s}`:G!==null&&(v.style.fillOpacity=`${G}`),C&&v.tagName.toLowerCase()==="path"&&ye[Y]&&v.setAttribute("d",We(ye[Y],C,s));});}function De(){if(e.style.setProperty("--scroll-draw-progress","0"),p){e.style.clipPath=me(0);return}ee.forEach((s,i)=>{s.style.strokeDasharray=`${X[i]}`,s.style.strokeDashoffset=E==="reverse"?"0":`${X[i]}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",ne&&(s.style.stroke=ne),U!==null&&(s.style.strokeWidth=`${U}`),H!==null&&(s.style.fillOpacity=`${H}`),C&&s.tagName.toLowerCase()==="path"&&ye[i]&&s.setAttribute("d",ye[i]);});}if(ee.forEach(s=>{Mt(s);let i=Re(s);X.push(i),s.tagName.toLowerCase()==="path"?ye.push(s.getAttribute("d")??""):ye.push(""),o?(s.style.strokeDasharray=`${i}`,s.style.strokeDashoffset=E==="reverse"?`${i}`:"0",c&&(s.style.opacity="1"),V&&(s.style.stroke=V),se!==null&&(s.style.strokeWidth=`${se}`),G!==null&&(s.style.fillOpacity=`${G}`),C&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",C)):(s.style.strokeDasharray=`${i}`,s.style.strokeDashoffset=E==="reverse"?"0":`${i}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",ne&&(s.style.stroke=ne),U!==null&&(s.style.strokeWidth=`${U}`),H!==null&&(s.style.fillOpacity=`${H}`));}),p){if(o)return e.style.clipPath=me(1),h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=me(0);}else if(o)return h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(oe===false||!At()||!ee.length||typeof d!="string"||!(d in Ke)||p||q!=="y"||g||l!==1||B!==0||re||T||L!==false||C||b||M||N>0||f||k||h||A!=null||$!=null||P!=null||(I.start??"top bottom").trim()!=="top bottom"||(I.end??"bottom top").trim()!=="bottom top")}function wt(){let s=`svg-scroll-draw-${++Tt}`,i=E==="reverse"?"0":"var(--ssd-len)",v=E==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${i};`,pe=`stroke-dashoffset:${v};`;c&&(Y+=`opacity:${E==="reverse"?1:0};`,pe+=`opacity:${E==="reverse"?0:1};`);let ue=document.createElement("style");ue.setAttribute("data-svg-scroll-draw",""),ue.textContent=`@keyframes ${s}{from{${Y}}to{${pe}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${Ke[d]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue);function w(y,x){y.style.setProperty("--ssd-len",String(X[x])),y.style.strokeDasharray=`${X[x]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(s);}ee.forEach(w);let R=false,Z=-1;function S(){if(Z>=0)return Z;let y=e.getBoundingClientRect(),{tStart:x,tEnd:W}=fe({top:y.top,height:y.height},ke(),Ge(),ge,a);return F(J(ke(),x,W,l))}return {destroy(){ee.forEach(y=>{y.classList.remove(s),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),ue.remove();},replay(){R=false,Z=-1,ee.forEach(w);},pause(){R=true,ee.forEach(y=>{y.style.animationPlayState="paused";});},resume(){R&&(R=false,ee.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let x=Math.min(1,Math.max(0,y));Z=x,R=true,ee.forEach((W,Pe)=>{W.classList.remove(s),W.style.strokeDashoffset=E==="reverse"?`${X[Pe]*x}`:`${X[Pe]*(1-x)}`,c&&(W.style.opacity=E==="reverse"?`${1-x}`:`${x}`);});},getProgress(){return S()}}}if(bt())return wt();function vt(){let s=Math.max(1,j),i=0,v=0;function Y(S){let y=true;if(p){let x=Math.min(1,Math.max(0,S/s)),W=F(x);$e=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=me(E==="reverse"?1-W:W),f?.(W),x<1&&(y=false);}else ee.forEach((x,W)=>{let Pe=W*B*s,Le=Math.min(1,Math.max(0,(S-Pe)/s)),we=F(Le);x.style.strokeDashoffset=E==="reverse"?`${X[W]*we}`:`${X[W]*(1-we)}`,c&&(x.style.opacity=E==="reverse"?`${1-we}`:`${we}`),ne&&V?x.style.stroke=Ce(ne,V,we):V&&(x.style.stroke=V),U!==null&&se!==null?x.style.strokeWidth=`${U+(se-U)*we}`:se!==null&&(x.style.strokeWidth=`${se}`),H!==null&&G!==null?x.style.fillOpacity=`${H+(G-H)*we}`:G!==null&&(x.style.fillOpacity=`${G}`),C&&x.tagName.toLowerCase()==="path"&&ye[W]&&x.setAttribute("d",We(ye[W],C,we)),W===0&&(f?.(we),e.style.setProperty("--scroll-draw-progress",String(we))),Le<1&&(y=false);});if(b){let x=Math.min(1,Math.max(0,S/s)),W=F(x);for(let Pe in b){let Le=parseFloat(Pe);W>=Le&&!Te.has(Le)&&(Te.add(Le),b[Pe]?.());}}return y}function pe(S){if(ce)return;let y=S-i;he||(he=true,k?.());let x=Y(y);if(x&&!ie){ie=true,Y(s*(1+Math.max(0,ee.length-1)*B)),h?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{i=performance.now(),he=false,ie=false,Te.clear(),De(),te=requestAnimationFrame(pe);},z));return}x||(te=requestAnimationFrame(pe));}function ue(){cancelAnimationFrame(te),clearTimeout(xe),i=performance.now(),v=0,ce=false,he=false,ie=false,ve=0,Te.clear(),De(),te=requestAnimationFrame(pe);}let w=new IntersectionObserver(S=>{S.forEach(y=>{y.isIntersecting&&!(re&&ie)?ue():!y.isIntersecting&&!re&&!ie&&(cancelAnimationFrame(te),clearTimeout(xe),i=null);});},{root:g??null,threshold:O,rootMargin:D}),R;function Z(){clearTimeout(R),R=setTimeout(()=>{ee.forEach((S,y)=>{X[y]=Re(S),S.style.strokeDasharray=`${X[y]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),N>0?setTimeout(()=>w.observe(e),N):w.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(xe),w.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(R);},replay(){ve=0,ue();},pause(){ce||(ce=true,v=performance.now()-i,cancelAnimationFrame(te));},resume(){ce&&(ce=false,i=performance.now()-v,te=requestAnimationFrame(pe));},seek(S){let y=Math.min(1,Math.max(0,S));$e=y,ce=true,v=y*s,i=performance.now()-v,cancelAnimationFrame(te),Y(v);},getProgress(){return $e}}}if(Q)return vt();Xe();function Ne(){if(!Ie||ce)return;let s=performance.now(),i=ke(),v=l;if(L!==false){let w=s-Be,R=w>0?Math.abs(i-(Fe<0?i:Fe))/w:0;v=l*Math.max(.2,1+R*(typeof L=="number"?L:1)*.04);}Fe=i,Be=s;let Y=T?Oe===-1||i>=Oe?"forward":"reverse":E;Oe=i;let pe=Se-Ee,ue=true;if(p){let w=F(J(i,Ee,Se,v));re&&!T&&(be=Math.max(be,w),w=be),$e=w,e.style.setProperty("--scroll-draw-progress",String(w));let R=Y==="reverse"?1-w:w;e.style.clipPath=me(R),f?.(w),!he&&J(i,Ee,Se,v)>0&&(he=true,k?.()),w>=1&&!ie?(ie=true,h?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{be=-1,he=false,ie=false,e.style.clipPath=me(0);},z))):w<1&&!re&&(ie=false),te=requestAnimationFrame(Ne);return}if(ee.forEach((w,R)=>{let Z=R*B*pe,S=F(J(i,Ee+Z,Se+Z,v));re&&!T&&(be=Math.max(be,S),S=be),$e=S,w.style.strokeDashoffset=Y==="reverse"?`${X[R]*S}`:`${X[R]*(1-S)}`,c&&(w.style.opacity=Y==="reverse"?`${1-S}`:`${S}`),ne&&V?w.style.stroke=Ce(ne,V,S):V&&(w.style.stroke=V),U!==null&&se!==null?w.style.strokeWidth=`${U+(se-U)*S}`:se!==null&&(w.style.strokeWidth=`${se}`),H!==null&&G!==null?w.style.fillOpacity=`${H+(G-H)*S}`:G!==null&&(w.style.fillOpacity=`${G}`),C&&w.tagName.toLowerCase()==="path"&&ye[R]&&w.setAttribute("d",We(ye[R],C,S)),R===0&&(f?.(S),e.style.setProperty("--scroll-draw-progress",String(S))),S<1&&(ue=false);}),b){let w=F(J(i,Ee,Se,v));for(let R in b){let Z=parseFloat(R);w>=Z&&!Te.has(Z)&&(Te.add(Z),b[R]?.());}}!he&&J(i,Ee,Se,v)>0&&(he=true,k?.()),ue&&!ie?(ie=true,h?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{be=-1,he=false,ie=false,Te.clear(),De();},z))):!ue&&!re&&(ie=false),te=requestAnimationFrame(Ne);}let Ve=new IntersectionObserver(s=>{s.forEach(i=>{Ie=i.isIntersecting,Ie&&!ce?te=requestAnimationFrame(Ne):cancelAnimationFrame(te);});},{root:g??null,threshold:O,rootMargin:D}),qe;function He(){clearTimeout(qe),qe=setTimeout(()=>{ee.forEach((s,i)=>{X[i]=Re(s),s.style.strokeDasharray=`${X[i]}`;}),Xe();},150);}return window.addEventListener("resize",He),window.addEventListener("orientationchange",He),N>0?setTimeout(()=>Ve.observe(e),N):Ve.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(xe),Ve.disconnect(),window.removeEventListener("resize",He),window.removeEventListener("orientationchange",He),clearTimeout(qe),ze?.remove();},replay(){be=-1,Oe=-1,Fe=-1,he=false,ie=false,ve=0,ce=false,Te.clear(),clearTimeout(xe),De();},pause(){ce=true,cancelAnimationFrame(te);},resume(){ce&&(ce=false,Ie&&(te=requestAnimationFrame(Ne)));},seek(s){let i=Math.min(1,Math.max(0,s));$e=i,be=i,ce=true,cancelAnimationFrame(te),yt(i,E);},getProgress(){return $e}}}var et=new Map;function Ae(e,r){et.set(e,r);}function Me(e){et.delete(e);}function Pt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function tt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],m=t[2].trim();if(m)for(let l of m.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Lt(e,r,n){let t=tt(e),u=tt(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,m)=>{let l=u[m];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,d)=>`${c}${o.units[d]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,d)=>`${c}${l.units[d]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,d)=>`${c+(l.nums[d]-c)*n}${o.units[d]}`).join(", ")})`}).join(" ")}function rt(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Pt(t))return Ce(t,u,n);if(t.includes("("))return Lt(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),m=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&m){let l=parseFloat(o[1]),c=parseFloat(m[1]);return `${l+(c-l)*n}${o[2]||m[2]}`}return n<1?t:u}function Ct(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},kt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),It=0;function Ot(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function st(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:m=1,once:l=false,axis:c="y",scrollContainer:d,native:I=true,onProgress:B,onComplete:E}=r,re=window.matchMedia("(prefers-reduced-motion: reduce)").matches,de=typeof o=="function"?o:ae[o]??ae["ease-out"],q=le(u.start??"top bottom"),K=le(u.end??"bottom top"),T=typeof d=="string"?document.querySelector(d):d??null,N=Object.entries(t).map(([a,g])=>({prop:Ct(a),from:Array.isArray(g)?g[0]:"",to:Array.isArray(g)?g[1]:g}));function A(){let a=window.getComputedStyle(e);for(let g of N)g.from===""&&(g.from=a.getPropertyValue(g.prop).trim()||"0");}function $(){for(let a of N)e.style.setProperty(a.prop,String(a.to));}if(re)return $(),E?.(),n;A();function P(){if(!I||!Ot()||typeof o!="string"||!(o in nt)||c!=="y"||T||l||m!==1||B||E||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let a of N)if(!kt.has(a.prop))return false;return true}function b(){let a=`ssd-a-${++It}`,g=N.map(H=>`${H.prop}:${H.from}`).join(";"),ne=N.map(H=>`${H.prop}:${H.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${a}{from{${g}}to{${ne}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${nt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(a);let U=()=>c==="x"?window.scrollX:window.scrollY,se=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),V.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(H){let G=Math.min(1,Math.max(0,H));e.classList.remove(a);for(let me of N)e.style.setProperty(me.prop,rt(me.from,me.to,G));},getProgress(){let H=e.getBoundingClientRect(),G=U(),me=se(),{tStart:ee,tEnd:X}=fe({top:H.top,height:H.height},G,me,q,K);return de(J(G,ee,X,m))}}}if(P())return b();let L=0,O=0,D=0,M=false,z=false,C=-1,_=0,Q=false,j=()=>T?c==="x"?T.scrollLeft:T.scrollTop:c==="x"?window.scrollX:window.scrollY,oe=()=>T?c==="x"?T.clientWidth:T.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function f(){let a=e.getBoundingClientRect(),g,ne;if(T){let U=T.getBoundingClientRect();g=c==="x"?a.left-U.left+T.scrollLeft:a.top-U.top+T.scrollTop,ne=c==="x"?a.width:a.height;}else g=c==="x"?a.left:a.top,ne=c==="x"?a.width:a.height;let V=fe({top:g,height:ne},j(),oe(),q,K);L=V.tStart,O=V.tEnd;}function k(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let g of N)e.style.setProperty(g.prop,rt(g.from,g.to,a));B?.(a);}function h(){if(!M||z)return;let a=de(J(j(),L,O,m));l&&(C=Math.max(C,a),a=C),_=a,k(a),a>=1&&!Q?(Q=true,E?.()):a<1&&!l&&(Q=false),D=requestAnimationFrame(h);}f();{let a=de(J(j(),L,O,m));l&&a>0&&(C=a),_=a,k(a);}let p=new IntersectionObserver(a=>{a.forEach(g=>{M=g.isIntersecting,M&&!z?D=requestAnimationFrame(h):cancelAnimationFrame(D);});},{root:T??null}),F;function ge(){clearTimeout(F),F=setTimeout(f,150);}return window.addEventListener("resize",ge),window.addEventListener("orientationchange",ge),p.observe(e),Ae(e,{type:"animate",getProgress:()=>_,getTrigger:()=>({tStart:L,tEnd:O})}),{destroy(){cancelAnimationFrame(D),p.disconnect(),window.removeEventListener("resize",ge),window.removeEventListener("orientationchange",ge),clearTimeout(F),Me(e);},replay(){C=-1,Q=false,_=0,z=false,k(0);},pause(){z=true,cancelAnimationFrame(D);},resume(){z&&(z=false,M&&(D=requestAnimationFrame(h)));},seek(a){let g=Math.min(1,Math.max(0,a));_=g,C=g,z=true,cancelAnimationFrame(D),k(g);},getProgress(){return _}}}var _e={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ot(e,r){if(typeof window>"u")return _e;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),_e;let t=n,{from:u=0,to:o,format:m,easing:l="ease-out",trigger:c={},once:d=true,decimals:I,onComplete:B}=r,E=I!==void 0?f=>f.toFixed(I):m??(f=>String(Math.round(f))),re=typeof l=="function"?l:ae[l]??ae["ease-out"],de=le(c.start??"top 80%"),q=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(o),B?.(),_e;t.textContent=E(u);let T=0,N=0,A=0,$=false,P=false,b=-1,L=0,O=false,D=()=>window.scrollY,M=()=>window.innerHeight;function z(){let f=t.getBoundingClientRect(),k=fe({top:f.top,height:f.height},D(),M(),de,q);T=k.tStart,N=k.tEnd;}function C(f){t.textContent=E(u+(o-u)*f),t.style.setProperty("--scroll-draw-progress",String(f));}function _(){if(!$||P)return;let f=re(J(D(),T,N,1));d&&(b=Math.max(b,f),f=b),L=f,C(f),f>=1&&!O?(O=true,B?.()):f<1&&!d&&(O=false),A=requestAnimationFrame(_);}z();{let f=re(J(D(),T,N,1));d&&f>0&&(b=f),L=f,C(f);}let Q=new IntersectionObserver(f=>{f.forEach(k=>{$=k.isIntersecting,$&&!P?A=requestAnimationFrame(_):cancelAnimationFrame(A);});}),j;function oe(){clearTimeout(j),j=setTimeout(z,150);}return window.addEventListener("resize",oe),window.addEventListener("orientationchange",oe),Q.observe(t),Ae(t,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:T,tEnd:N})}),{destroy(){cancelAnimationFrame(A),Q.disconnect(),window.removeEventListener("resize",oe),window.removeEventListener("orientationchange",oe),clearTimeout(j),Me(t);},replay(){b=-1,O=false,L=0,P=false,C(0);},pause(){P=true,cancelAnimationFrame(A);},resume(){P&&(P=false,$&&(A=requestAnimationFrame(_)));},seek(f){let k=Math.min(1,Math.max(0,f));L=k,b=k,P=true,cancelAnimationFrame(A),C(k);},getProgress(){return L}}}var it={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function at(e,r={}){if(typeof window>"u")return it;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),it;let t=n,{trigger:u={},easing:o="linear",once:m=false,axis:l="y",preload:c="auto",onReady:d,onComplete:I,onProgress:B}=r,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof o=="function"?o:ae[o]??ae.linear,de=le(u.start??"top top"),q=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let K=r.from??0,T=r.to,N=0,A=0,$=0,P=false,b=false,L=-1,O=0,D=false,M=false,z=()=>l==="x"?window.scrollX:window.scrollY,C=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let p=t.getBoundingClientRect(),F=l==="x"?p.left:p.top,ge=l==="x"?p.width:p.height,a=fe({top:F,height:ge},z(),C(),de,q);N=a.tStart,A=a.tEnd;}function Q(p){if(!M)return;let F=T??t.duration??0;t.currentTime=K+(F-K)*p,t.style.setProperty("--scroll-draw-progress",String(p)),B?.(p);}function j(){if(!P||b||!M)return;let p=re(J(z(),N,A,1));m&&(L=Math.max(L,p),p=L),O=p,Q(p),p>=1&&!D?(D=true,I?.()):p<1&&!m&&(D=false),$=requestAnimationFrame(j);}function oe(){if(M=true,T===void 0&&(T=t.duration),E){Q(1),d?.();return}_(),d?.(),P&&!b&&($=requestAnimationFrame(j));}t.readyState>=1?oe():t.addEventListener("loadedmetadata",oe,{once:true}),M||_();let f=new IntersectionObserver(p=>{p.forEach(F=>{P=F.isIntersecting,P&&!b&&M?$=requestAnimationFrame(j):cancelAnimationFrame($);});}),k;function h(){clearTimeout(k),k=setTimeout(_,150);}return window.addEventListener("resize",h),window.addEventListener("orientationchange",h),f.observe(t),Ae(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:N,tEnd:A})}),{destroy(){cancelAnimationFrame($),f.disconnect(),t.removeEventListener("loadedmetadata",oe),window.removeEventListener("resize",h),window.removeEventListener("orientationchange",h),clearTimeout(k),Me(t);},replay(){L=-1,D=false,O=0,b=false,Q(0);},pause(){b=true,cancelAnimationFrame($);},resume(){b&&(b=false,P&&M&&($=requestAnimationFrame(j)));},seek(p){let F=Math.min(1,Math.max(0,p));O=F,L=F,b=true,cancelAnimationFrame($),Q(F);},getProgress(){return O}}}function ut(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function Ft(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function lt(e){let r=ut(e),n=new Map;for(let o of r){let m=o.offsetTop;n.has(m)||n.set(m,[]),n.get(m).push(o);}let t=[],u=Array.from(n.keys()).sort((o,m)=>o-m);for(let o of u){let m=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of m)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Dt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,m=o+(1-u);return m<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(m-o)))}function Nt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function mt(e,r={}){if(typeof window>"u")return ct;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),ct;let t=n,{split:u="words",stagger:o=.04,easing:m="ease-out",from:l={opacity:0,y:24},trigger:c={},once:d=true,onComplete:I}=r,B=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof m=="function"?m:ae[m]??ae["ease-out"],re=le(c.start??"top 85%"),de=le(c.end??"top 40%"),q=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let K;u==="chars"?K=Ft(t):u==="lines"?K=lt(t):K=ut(t);let T=K.length;function N(h,p){l?.opacity!==void 0&&(h.style.opacity=String(l.opacity+(1-l.opacity)*p));let F=Nt(p,l);F&&(h.style.transform=F);}function A(h){t.style.setProperty("--scroll-draw-progress",String(h)),K.forEach((p,F)=>{let ge=E(Dt(h,F,T,o));N(p,ge);});}if(B)return A(1),I?.(),{destroy(){t.innerHTML=q,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let $=0,P=0,b=0,L=false,O=false,D=-1,M=0,z=false,C=()=>window.scrollY,_=()=>window.innerHeight;function Q(){let h=t.getBoundingClientRect(),p=fe({top:h.top,height:h.height},C(),_(),re,de);$=p.tStart,P=p.tEnd;}function j(){if(!L||O)return;let h=J(C(),$,P,1);d&&(D=Math.max(D,h),h=D),M=h,A(h),h>=1&&!z?(z=true,I?.()):h<1&&!d&&(z=false),b=requestAnimationFrame(j);}Q();let oe=new IntersectionObserver(h=>{h.forEach(p=>{L=p.isIntersecting,L&&!O?b=requestAnimationFrame(j):cancelAnimationFrame(b);});}),f;function k(){clearTimeout(f),f=setTimeout(()=>{if(u==="lines"){let h=M;t.innerHTML=q,t.setAttribute("aria-label",t.textContent??""),K=lt(t),A(h);}Q();},150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),oe.observe(t),Ae(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:$,tEnd:P})}),{destroy(){cancelAnimationFrame(b),oe.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(f),t.innerHTML=q,t.removeAttribute("aria-label"),Me(t);},replay(){D=-1,z=false,M=0,O=false,A(0);},pause(){O=true,cancelAnimationFrame(b);},resume(){O&&(O=false,L&&(b=requestAnimationFrame(j)));},seek(h){let p=Math.min(1,Math.max(0,h));M=p,D=p,O=true,cancelAnimationFrame(b),A(p);},getProgress(){return M}}}var pt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=Qe(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},ft=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},dt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ot(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},gt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=at(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},ht=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=mt(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};exports.ScrollAnimateRef=ft;exports.ScrollCounterRef=dt;exports.ScrollDrawRef=pt;exports.ScrollTextRef=ht;exports.ScrollVideoRef=gt;
1
+ 'use strict';function Mt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,f=[];for(let y=0;y<n;y++){let C=Math.pow(u,y);f.push(C),o+=C;}let l=[0],c=0;for(let y=0;y<n;y++)c+=f[y]/o,l.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let C=0;C<n;C++)if(y<=l[C+1]){let R=(y-l[C])/(l[C+1]-l[C]);if(C===0)return R*(2-R);let E=1-Math.pow(t,C);return E+(1-E)*(2*R-1)*(2*R-1)}return 1}}function Pt({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ae={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:Mt(),elastic:Pt()};function le(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ke(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Qe(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function _e(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function $t(e,r,n){return Math.min(n,Math.max(r,e))}function Q(e,r,n,t){return n===r?0:$t((e-r)/(n-r)*t,0,1)}function he(e,r,n,t,u){let o=Ke(e.top,e.height,r,t.element)-Qe(t.viewport,n),f=Ke(e.top,e.height,r,u.element)-Qe(u.viewport,n);return {tStart:o,tEnd:f}}function et(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Fe(e,r,n){let t=et(e),u=et(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var tt={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}};function rt(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function kt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?rt("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&rt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function It(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,f=e-o,l=r-o,c=n==="x";t.innerHTML=`
2
+ <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}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;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function Ye(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let f=parseFloat(o),l=t[u++]??f;return String(+(f+(l-f)*n).toFixed(4))})}function st(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...tt[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:y="linear",trigger:C={},stagger:R=0,direction:E="forward",once:j=false,debug:ye=false,axis:z="y",scrollContainer:ee,autoReverse:U=false,delay:Z=0,strokeColor:S,strokeWidth:M,fillOpacity:P,waypoints:g,velocityScale:x=false,threshold:I=0,rootMargin:G="0px",repeat:k=0,repeatDelay:oe=0,morphTo:$,clip:_,autoplay:B=false,duration:X=1e3,native:V=true,onProgress:p,onStart:T,onComplete:b,onEnter:h,onLeave:q,onEnterBack:Se,onLeaveBack:xe}=u,be=_===true?"left":typeof _=="string"?_:false,we=typeof y=="function"?y:ae[y]??ae.linear,Le=le(C.start??"top bottom"),De=le(C.end??"bottom top"),te=typeof ee=="string"?document.querySelector(ee):ee??null,pe=Array.isArray(S)?S[0]:null,J=Array.isArray(S)?S[1]:typeof S=="string"?S:null,K=Array.isArray(M)?M[0]:null,i=Array.isArray(M)?M[1]:typeof M=="number"?M:null,d=Array.isArray(P)?P[0]:null,O=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function re(s){let a=s*100;switch(be){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let L=be?[]:Array.from(e.querySelectorAll(f)),H=[],F=[],ie=0,ce=0,ne=false,de=false,se=0,He=false,ve=-1,Re=-1,ue=false,Ce=0,Te=0,Ae,Be=null,Me=new Set,ze=-1,Ue=performance.now(),Ie=NaN;function Ne(){return te?z==="x"?te.scrollLeft:te.scrollTop:z==="x"?window.scrollX:window.scrollY}function Ze(){return te?z==="x"?te.clientWidth:te.clientHeight:z==="x"?window.innerWidth:window.innerHeight}function Je(){let s=e.getBoundingClientRect(),a,v,Y;if(te){let fe=te.getBoundingClientRect();a=z==="x"?s.left-fe.left+te.scrollLeft:s.top-fe.top+te.scrollTop,v=z==="x"?s.width:s.height,Y=Ne();}else a=z==="x"?s.left:s.top,v=z==="x"?s.width:s.height,Y=Ne();let me=he({top:a,height:v},Y,Ze(),Le,De);ie=me.tStart,ce=me.tEnd,ye&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=It(ie,ce,z));}function St(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),be){let v=a==="reverse"?1-s:s;e.style.clipPath=re(v);return}L.forEach((v,Y)=>{v.style.strokeDashoffset=a==="reverse"?`${H[Y]*s}`:`${H[Y]*(1-s)}`,c&&(v.style.opacity=a==="reverse"?`${1-s}`:`${s}`),pe&&J?v.style.stroke=Fe(pe,J,s):J&&(v.style.stroke=J),K!==null&&i!==null?v.style.strokeWidth=`${K+(i-K)*s}`:i!==null&&(v.style.strokeWidth=`${i}`),d!==null&&O!==null?v.style.fillOpacity=`${d+(O-d)*s}`:O!==null&&(v.style.fillOpacity=`${O}`),$&&v.tagName.toLowerCase()==="path"&&F[Y]&&v.setAttribute("d",Ye(F[Y],$,s));});}function Ve(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=re(0);return}L.forEach((s,a)=>{s.style.strokeDasharray=`${H[a]}`,s.style.strokeDashoffset=E==="reverse"?"0":`${H[a]}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`),$&&s.tagName.toLowerCase()==="path"&&F[a]&&s.setAttribute("d",F[a]);});}if(L.forEach(s=>{kt(s);let a=_e(s);H.push(a),s.tagName.toLowerCase()==="path"?F.push(s.getAttribute("d")??""):F.push(""),o?(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?`${a}`:"0",c&&(s.style.opacity="1"),J&&(s.style.stroke=J),i!==null&&(s.style.strokeWidth=`${i}`),O!==null&&(s.style.fillOpacity=`${O}`),$&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",$)):(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?"0":`${a}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`));}),be){if(o)return e.style.clipPath=re(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=re(0);}else if(o)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function xt(){return !(V===false||!Ct()||!L.length||typeof y!="string"||!(y in nt)||be||z!=="y"||te||l!==1||R!==0||j||U||x!==false||$||g||k||Z>0||p||T||b||h||q||Se||xe||S!=null||M!=null||P!=null||(C.start??"top bottom").trim()!=="top bottom"||(C.end??"bottom top").trim()!=="bottom top")}function Tt(){let s=`svg-scroll-draw-${++Lt}`,a=E==="reverse"?"0":"var(--ssd-len)",v=E==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${a};`,me=`stroke-dashoffset:${v};`;c&&(Y+=`opacity:${E==="reverse"?1:0};`,me+=`opacity:${E==="reverse"?0:1};`);let fe=document.createElement("style");fe.setAttribute("data-svg-scroll-draw",""),fe.textContent=`@keyframes ${s}{from{${Y}}to{${me}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${nt[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe);function ge(m,A){m.style.setProperty("--ssd-len",String(H[A])),m.style.strokeDasharray=`${H[A]}`,m.style.strokeDashoffset="",m.style.opacity="",m.style.animationPlayState="",m.classList.add(s);}L.forEach(ge);let w=false,N=-1;function D(){if(N>=0)return N;let m=e.getBoundingClientRect(),{tStart:A,tEnd:W}=he({top:m.top,height:m.height},Ne(),Ze(),Le,De);return we(Q(Ne(),A,W,l))}return {destroy(){L.forEach(m=>{m.classList.remove(s),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),fe.remove();},replay(){w=false,N=-1,L.forEach(ge);},pause(){w=true,L.forEach(m=>{m.style.animationPlayState="paused";});},resume(){w&&(w=false,L.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let A=Math.min(1,Math.max(0,m));N=A,w=true,L.forEach((W,ke)=>{W.classList.remove(s),W.style.strokeDashoffset=E==="reverse"?`${H[ke]*A}`:`${H[ke]*(1-A)}`,c&&(W.style.opacity=E==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return D()}}}if(xt())return Tt();function At(){let s=Math.max(1,X),a=0,v=0;function Y(D){let m=true;if(be){let A=Math.min(1,Math.max(0,D/s)),W=we(A);Ce=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=re(E==="reverse"?1-W:W),p?.(W),A<1&&(m=false);}else L.forEach((A,W)=>{let ke=W*R*s,Oe=Math.min(1,Math.max(0,(D-ke)/s)),Ee=we(Oe);A.style.strokeDashoffset=E==="reverse"?`${H[W]*Ee}`:`${H[W]*(1-Ee)}`,c&&(A.style.opacity=E==="reverse"?`${1-Ee}`:`${Ee}`),pe&&J?A.style.stroke=Fe(pe,J,Ee):J&&(A.style.stroke=J),K!==null&&i!==null?A.style.strokeWidth=`${K+(i-K)*Ee}`:i!==null&&(A.style.strokeWidth=`${i}`),d!==null&&O!==null?A.style.fillOpacity=`${d+(O-d)*Ee}`:O!==null&&(A.style.fillOpacity=`${O}`),$&&A.tagName.toLowerCase()==="path"&&F[W]&&A.setAttribute("d",Ye(F[W],$,Ee)),W===0&&(p?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Oe<1&&(m=false);});if(g){let A=Math.min(1,Math.max(0,D/s)),W=we(A);for(let ke in g){let Oe=parseFloat(ke);W>=Oe&&!Me.has(Oe)&&(Me.add(Oe),g[ke]?.());}}return m}function me(D){if(ue)return;let m=D-a;de||(de=true,T?.());let A=Y(m);if(A&&!ne){ne=true,Y(s*(1+Math.max(0,L.length-1)*R)),b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{a=performance.now(),de=false,ne=false,Me.clear(),Ve(),se=requestAnimationFrame(me);},oe));return}A||(se=requestAnimationFrame(me));}function fe(){cancelAnimationFrame(se),clearTimeout(Ae),a=performance.now(),v=0,ue=false,de=false,ne=false,Te=0,Me.clear(),Ve(),se=requestAnimationFrame(me);}let ge=new IntersectionObserver(D=>{D.forEach(m=>{m.isIntersecting&&!(j&&ne)?fe():!m.isIntersecting&&!j&&!ne&&(cancelAnimationFrame(se),clearTimeout(Ae),a=null);});},{root:te??null,threshold:I,rootMargin:G}),w;function N(){clearTimeout(w),w=setTimeout(()=>{L.forEach((D,m)=>{H[m]=_e(D),D.style.strokeDasharray=`${H[m]}`;});},150);}return window.addEventListener("resize",N),window.addEventListener("orientationchange",N),Z>0?setTimeout(()=>ge.observe(e),Z):ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),ge.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N),clearTimeout(w);},replay(){Te=0,fe();},pause(){ue||(ue=true,v=performance.now()-a,cancelAnimationFrame(se));},resume(){ue&&(ue=false,a=performance.now()-v,se=requestAnimationFrame(me));},seek(D){let m=Math.min(1,Math.max(0,D));Ce=m,ue=true,v=m*s,a=performance.now()-v,cancelAnimationFrame(se),Y(v);},getProgress(){return Ce}}}if(B)return At();Je();function qe(){if(!He||ue)return;let s=performance.now(),a=Ne(),v=l;if(x!==false){let w=s-Ue,N=w>0?Math.abs(a-(ze<0?a:ze))/w:0;v=l*Math.max(.2,1+N*(typeof x=="number"?x:1)*.04);}ze=a,Ue=s;let Y=U?Re===-1||a>=Re?"forward":"reverse":E;Re=a;let me=ce-ie,fe=true,ge=me===0?0:(a-ie)/me;if(isNaN(Ie)||(Ie<=0&&ge>0?h?.():Ie>0&&ge<=0&&xe?.(),Ie<1&&ge>=1?q?.():Ie>=1&&ge<1&&Se?.()),Ie=ge,be){let w=we(Q(a,ie,ce,v));j&&!U&&(ve=Math.max(ve,w),w=ve),Ce=w,e.style.setProperty("--scroll-draw-progress",String(w));let N=Y==="reverse"?1-w:w;e.style.clipPath=re(N),p?.(w),!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),w>=1&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,e.style.clipPath=re(0);},oe))):w<1&&!j&&(ne=false),se=requestAnimationFrame(qe);return}if(L.forEach((w,N)=>{let D=N*R*me,m=we(Q(a,ie+D,ce+D,v));j&&!U&&(ve=Math.max(ve,m),m=ve),Ce=m,w.style.strokeDashoffset=Y==="reverse"?`${H[N]*m}`:`${H[N]*(1-m)}`,c&&(w.style.opacity=Y==="reverse"?`${1-m}`:`${m}`),pe&&J?w.style.stroke=Fe(pe,J,m):J&&(w.style.stroke=J),K!==null&&i!==null?w.style.strokeWidth=`${K+(i-K)*m}`:i!==null&&(w.style.strokeWidth=`${i}`),d!==null&&O!==null?w.style.fillOpacity=`${d+(O-d)*m}`:O!==null&&(w.style.fillOpacity=`${O}`),$&&w.tagName.toLowerCase()==="path"&&F[N]&&w.setAttribute("d",Ye(F[N],$,m)),N===0&&(p?.(m),e.style.setProperty("--scroll-draw-progress",String(m))),m<1&&(fe=false);}),g){let w=we(Q(a,ie,ce,v));for(let N in g){let D=parseFloat(N);w>=D&&!Me.has(D)&&(Me.add(D),g[N]?.());}}!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),fe&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,Me.clear(),Ve();},oe))):!fe&&!j&&(ne=false),se=requestAnimationFrame(qe);}let Ge=new IntersectionObserver(s=>{s.forEach(a=>{He=a.isIntersecting,He&&!ue?se=requestAnimationFrame(qe):cancelAnimationFrame(se);});},{root:te??null,threshold:I,rootMargin:G}),Xe;function We(){clearTimeout(Xe),Xe=setTimeout(()=>{L.forEach((s,a)=>{H[a]=_e(s),s.style.strokeDasharray=`${H[a]}`;}),Je();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),Z>0?setTimeout(()=>Ge.observe(e),Z):Ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),Ge.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Xe),Be?.remove();},replay(){ve=-1,Re=-1,ze=-1,de=false,ne=false,Te=0,ue=false,Me.clear(),clearTimeout(Ae),Ve();},pause(){ue=true,cancelAnimationFrame(se);},resume(){ue&&(ue=false,He&&(se=requestAnimationFrame(qe)));},seek(s){let a=Math.min(1,Math.max(0,s));Ce=a,ve=a,ue=true,cancelAnimationFrame(se),St(a,E);},getProgress(){return Ce}}}var ot=new Map;function Pe(e,r){ot.set(e,r);}function $e(e){ot.delete(e);}function Ot(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function it(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],f=t[2].trim();if(f)for(let l of f.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Ft(e,r,n){let t=it(e),u=it(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,f)=>{let l=u[f];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,y)=>`${c}${l.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(l.nums[y]-c)*n}${o.units[y]}`).join(", ")})`}).join(" ")}function at(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Ot(t))return Fe(t,u,n);if(t.includes("("))return Ft(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),f=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&f){let l=parseFloat(o[1]),c=parseFloat(f[1]);return `${l+(c-l)*n}${o[2]||f[2]}`}return n<1?t:u}function Nt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Dt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ht=0;function Rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ct(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:f=1,once:l=false,axis:c="y",scrollContainer:y,native:C=true,velocityScale:R=false,onProgress:E,onComplete:j,onEnter:ye,onLeave:z,onEnterBack:ee,onLeaveBack:U}=r,Z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof o=="function"?o:ae[o]??ae["ease-out"],M=le(u.start??"top bottom"),P=le(u.end??"bottom top"),g=typeof y=="string"?document.querySelector(y):y??null,x=Object.entries(t).map(([i,d])=>({prop:Nt(i),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function I(){let i=window.getComputedStyle(e);for(let d of x)d.from===""&&(d.from=i.getPropertyValue(d.prop).trim()||"0");}function G(){for(let i of x)e.style.setProperty(i.prop,String(i.to));}if(Z)return G(),j?.(),n;I();function k(){if(!C||!Rt()||typeof o!="string"||!(o in lt)||c!=="y"||g||l||f!==1||E||j||ye||z||ee||U||R!==false||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let i of x)if(!Dt.has(i.prop))return false;return true}function oe(){let i=`ssd-a-${++Ht}`,d=x.map(F=>`${F.prop}:${F.from}`).join(";"),O=x.map(F=>`${F.prop}:${F.to}`).join(";"),re=document.createElement("style");re.setAttribute("data-ssd-animate",""),re.textContent=`@keyframes ${i}{from{${d}}to{${O}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${lt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(re),e.classList.add(i);let L=()=>c==="x"?window.scrollX:window.scrollY,H=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),re.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(F){let ie=Math.min(1,Math.max(0,F));e.classList.remove(i);for(let ce of x)e.style.setProperty(ce.prop,at(ce.from,ce.to,ie));},getProgress(){let F=e.getBoundingClientRect(),ie=L(),ce=H(),{tStart:ne,tEnd:de}=he({top:F.top,height:F.height},ie,ce,M,P);return S(Q(ie,ne,de,f))}}}if(k())return oe();let $=0,_=0,B=0,X=false,V=false,p=-1,T=0,b=false,h=NaN,q=-1,Se=0,xe=()=>g?c==="x"?g.scrollLeft:g.scrollTop:c==="x"?window.scrollX:window.scrollY,be=()=>g?c==="x"?g.clientWidth:g.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function we(){let i=e.getBoundingClientRect(),d,O;if(g){let L=g.getBoundingClientRect();d=c==="x"?i.left-L.left+g.scrollLeft:i.top-L.top+g.scrollTop,O=c==="x"?i.width:i.height;}else d=c==="x"?i.left:i.top,O=c==="x"?i.width:i.height;let re=he({top:d,height:O},xe(),be(),M,P);$=re.tStart,_=re.tEnd;}function Le(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let d of x)e.style.setProperty(d.prop,at(d.from,d.to,i));E?.(i);}function De(i){if(isNaN(h)){h=i;return}h<=0&&i>0?ye?.():h>0&&i<=0&&U?.(),h<1&&i>=1?z?.():h>=1&&i<1&&ee?.(),h=i;}function te(){if(!X||V)return;let i=performance.now(),d=xe(),O=f;if(R!==false){let H=i-Se,F=H>0?Math.abs(d-(q<0?d:q))/H:0;O=f*Math.max(.2,1+F*(typeof R=="number"?R:1)*.04);}q=d,Se=i;let re=_===$?0:(d-$)/(_-$);De(re);let L=S(Q(d,$,_,O));l&&(p=Math.max(p,L),L=p),T=L,Le(L),L>=1&&!b?(b=true,j?.()):L<1&&!l&&(b=false),B=requestAnimationFrame(te);}we();{let i=S(Q(xe(),$,_,f));l&&i>0&&(p=i),T=i,Le(i);}let pe=new IntersectionObserver(i=>{i.forEach(d=>{X=d.isIntersecting,X&&!V?B=requestAnimationFrame(te):cancelAnimationFrame(B);});},{root:g??null}),J;function K(){clearTimeout(J),J=setTimeout(we,150);}return window.addEventListener("resize",K),window.addEventListener("orientationchange",K),pe.observe(e),Pe(e,{type:"animate",getProgress:()=>T,getTrigger:()=>({tStart:$,tEnd:_})}),{destroy(){cancelAnimationFrame(B),pe.disconnect(),window.removeEventListener("resize",K),window.removeEventListener("orientationchange",K),clearTimeout(J),$e(e);},replay(){p=-1,b=false,T=0,V=false,Le(0);},pause(){V=true,cancelAnimationFrame(B);},resume(){V&&(V=false,X&&(B=requestAnimationFrame(te)));},seek(i){let d=Math.min(1,Math.max(0,i));T=d,p=d,V=true,cancelAnimationFrame(B),Le(d);},getProgress(){return T}}}var je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,r){if(typeof window>"u")return je;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),je;let t=n,{from:u=0,to:o,format:f,easing:l="ease-out",trigger:c={},once:y=true,decimals:C,onComplete:R}=r,E=C!==void 0?p=>p.toFixed(C):f??(p=>String(Math.round(p))),j=typeof l=="function"?l:ae[l]??ae["ease-out"],ye=le(c.start??"top 80%"),z=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(o),R?.(),je;t.textContent=E(u);let U=0,Z=0,S=0,M=false,P=false,g=-1,x=0,I=false,G=()=>window.scrollY,k=()=>window.innerHeight;function oe(){let p=t.getBoundingClientRect(),T=he({top:p.top,height:p.height},G(),k(),ye,z);U=T.tStart,Z=T.tEnd;}function $(p){t.textContent=E(u+(o-u)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function _(){if(!M||P)return;let p=j(Q(G(),U,Z,1));y&&(g=Math.max(g,p),p=g),x=p,$(p),p>=1&&!I?(I=true,R?.()):p<1&&!y&&(I=false),S=requestAnimationFrame(_);}oe();{let p=j(Q(G(),U,Z,1));y&&p>0&&(g=p),x=p,$(p);}let B=new IntersectionObserver(p=>{p.forEach(T=>{M=T.isIntersecting,M&&!P?S=requestAnimationFrame(_):cancelAnimationFrame(S);});}),X;function V(){clearTimeout(X),X=setTimeout(oe,150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),B.observe(t),Pe(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:U,tEnd:Z})}),{destroy(){cancelAnimationFrame(S),B.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(X),$e(t);},replay(){g=-1,I=false,x=0,P=false,$(0);},pause(){P=true,cancelAnimationFrame(S);},resume(){P&&(P=false,M&&(S=requestAnimationFrame(_)));},seek(p){let T=Math.min(1,Math.max(0,p));x=T,g=T,P=true,cancelAnimationFrame(S),$(T);},getProgress(){return x}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r={}){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),mt;let t=n,{trigger:u={},easing:o="linear",once:f=false,axis:l="y",preload:c="auto",onReady:y,onComplete:C,onProgress:R}=r,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,j=typeof o=="function"?o:ae[o]??ae.linear,ye=le(u.start??"top top"),z=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let ee=r.from??0,U=r.to,Z=0,S=0,M=0,P=false,g=false,x=-1,I=0,G=false,k=false,oe=()=>l==="x"?window.scrollX:window.scrollY,$=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let h=t.getBoundingClientRect(),q=l==="x"?h.left:h.top,Se=l==="x"?h.width:h.height,xe=he({top:q,height:Se},oe(),$(),ye,z);Z=xe.tStart,S=xe.tEnd;}function B(h){if(!k)return;let q=U??t.duration??0;t.currentTime=ee+(q-ee)*h,t.style.setProperty("--scroll-draw-progress",String(h)),R?.(h);}function X(){if(!P||g||!k)return;let h=j(Q(oe(),Z,S,1));f&&(x=Math.max(x,h),h=x),I=h,B(h),h>=1&&!G?(G=true,C?.()):h<1&&!f&&(G=false),M=requestAnimationFrame(X);}function V(){if(k=true,U===void 0&&(U=t.duration),E){B(1),y?.();return}_(),y?.(),P&&!g&&(M=requestAnimationFrame(X));}t.readyState>=1?V():t.addEventListener("loadedmetadata",V,{once:true}),k||_();let p=new IntersectionObserver(h=>{h.forEach(q=>{P=q.isIntersecting,P&&!g&&k?M=requestAnimationFrame(X):cancelAnimationFrame(M);});}),T;function b(){clearTimeout(T),T=setTimeout(_,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),p.observe(t),Pe(t,{type:"video",getProgress:()=>I,getTrigger:()=>({tStart:Z,tEnd:S})}),{destroy(){cancelAnimationFrame(M),p.disconnect(),t.removeEventListener("loadedmetadata",V),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(T),$e(t);},replay(){x=-1,G=false,I=0,g=false,B(0);},pause(){g=true,cancelAnimationFrame(M);},resume(){g&&(g=false,P&&k&&(M=requestAnimationFrame(X)));},seek(h){let q=Math.min(1,Math.max(0,h));I=q,x=q,g=true,cancelAnimationFrame(M),B(q);},getProgress(){return I}}}function gt(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function zt(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function pt(e){let r=gt(e),n=new Map;for(let o of r){let f=o.offsetTop;n.has(f)||n.set(f,[]),n.get(f).push(o);}let t=[],u=Array.from(n.keys()).sort((o,f)=>o-f);for(let o of u){let f=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of f)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Vt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,f=o+(1-u);return f<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(f-o)))}function qt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ht(e,r={}){if(typeof window>"u")return dt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=n,{split:u="words",stagger:o=.04,easing:f="ease-out",from:l={opacity:0,y:24},trigger:c={},once:y=true,onComplete:C}=r,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof f=="function"?f:ae[f]??ae["ease-out"],j=le(c.start??"top 85%"),ye=le(c.end??"top 40%"),z=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=zt(t):u==="lines"?ee=pt(t):ee=gt(t);let U=ee.length;function Z(b,h){l?.opacity!==void 0&&(b.style.opacity=String(l.opacity+(1-l.opacity)*h));let q=qt(h,l);q&&(b.style.transform=q);}function S(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach((h,q)=>{let Se=E(Vt(b,q,U,o));Z(h,Se);});}if(R)return S(1),C?.(),{destroy(){t.innerHTML=z,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};S(0);let M=0,P=0,g=0,x=false,I=false,G=-1,k=0,oe=false,$=()=>window.scrollY,_=()=>window.innerHeight;function B(){let b=t.getBoundingClientRect(),h=he({top:b.top,height:b.height},$(),_(),j,ye);M=h.tStart,P=h.tEnd;}function X(){if(!x||I)return;let b=Q($(),M,P,1);y&&(G=Math.max(G,b),b=G),k=b,S(b),b>=1&&!oe?(oe=true,C?.()):b<1&&!y&&(oe=false),g=requestAnimationFrame(X);}B();let V=new IntersectionObserver(b=>{b.forEach(h=>{x=h.isIntersecting,x&&!I?g=requestAnimationFrame(X):cancelAnimationFrame(g);});}),p;function T(){clearTimeout(p),p=setTimeout(()=>{if(u==="lines"){let b=k;t.innerHTML=z,t.setAttribute("aria-label",t.textContent??""),ee=pt(t),S(b);}B();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),V.observe(t),Pe(t,{type:"text",getProgress:()=>k,getTrigger:()=>({tStart:M,tEnd:P})}),{destroy(){cancelAnimationFrame(g),V.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(p),t.innerHTML=z,t.removeAttribute("aria-label"),$e(t);},replay(){G=-1,oe=false,k=0,I=false,S(0);},pause(){I=true,cancelAnimationFrame(g);},resume(){I&&(I=false,x&&(g=requestAnimationFrame(X)));},seek(b){let h=Math.min(1,Math.max(0,b));k=h,G=h,I=true,cancelAnimationFrame(g),S(h);},getProgress(){return k}}}var yt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},bt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ct(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},wt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ut(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},vt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ft(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},Et=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ht(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};exports.ScrollAnimateRef=bt;exports.ScrollCounterRef=wt;exports.ScrollDrawRef=yt;exports.ScrollTextRef=Et;exports.ScrollVideoRef=vt;
@@ -71,6 +71,14 @@ interface ScrollDrawOptions {
71
71
  onProgress?: (alpha: number) => void;
72
72
  onStart?: () => void;
73
73
  onComplete?: () => void;
74
+ /** Fires when scroll position enters the trigger zone (scrolling forward). */
75
+ onEnter?: () => void;
76
+ /** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
77
+ onLeave?: () => void;
78
+ /** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
79
+ onEnterBack?: () => void;
80
+ /** Fires when scroll position exits the trigger zone at the start (scrolling back). */
81
+ onLeaveBack?: () => void;
74
82
  /**
75
83
  * Trigger the animation when the element enters the viewport instead of
76
84
  * tying it to scroll position. The draw runs over `duration` milliseconds,
@@ -128,8 +136,22 @@ interface ScrollAnimateOptions {
128
136
  axis?: 'x' | 'y';
129
137
  scrollContainer?: string | Element;
130
138
  native?: boolean;
139
+ /**
140
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
141
+ * Pass `true` for default sensitivity (1) or a number to control it.
142
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
143
+ */
144
+ velocityScale?: boolean | number;
131
145
  onProgress?: (alpha: number) => void;
132
146
  onComplete?: () => void;
147
+ /** Fires when scroll enters the trigger zone (scrolling forward). */
148
+ onEnter?: () => void;
149
+ /** Fires when scroll exits the trigger zone at the end (scrolling forward). */
150
+ onLeave?: () => void;
151
+ /** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
152
+ onEnterBack?: () => void;
153
+ /** Fires when scroll exits the trigger zone at the start (scrolling back). */
154
+ onLeaveBack?: () => void;
133
155
  }
134
156
 
135
157
  interface ScrollCounterOptions {
@@ -71,6 +71,14 @@ interface ScrollDrawOptions {
71
71
  onProgress?: (alpha: number) => void;
72
72
  onStart?: () => void;
73
73
  onComplete?: () => void;
74
+ /** Fires when scroll position enters the trigger zone (scrolling forward). */
75
+ onEnter?: () => void;
76
+ /** Fires when scroll position exits the trigger zone at the end (scrolling forward). */
77
+ onLeave?: () => void;
78
+ /** Fires when scroll position re-enters the trigger zone from the end (scrolling back). */
79
+ onEnterBack?: () => void;
80
+ /** Fires when scroll position exits the trigger zone at the start (scrolling back). */
81
+ onLeaveBack?: () => void;
74
82
  /**
75
83
  * Trigger the animation when the element enters the viewport instead of
76
84
  * tying it to scroll position. The draw runs over `duration` milliseconds,
@@ -128,8 +136,22 @@ interface ScrollAnimateOptions {
128
136
  axis?: 'x' | 'y';
129
137
  scrollContainer?: string | Element;
130
138
  native?: boolean;
139
+ /**
140
+ * Scale animation speed by scroll velocity — faster scrolling = faster animation.
141
+ * Pass `true` for default sensitivity (1) or a number to control it.
142
+ * Higher values = more dramatic speed-up. Default sensitivity: 1.
143
+ */
144
+ velocityScale?: boolean | number;
131
145
  onProgress?: (alpha: number) => void;
132
146
  onComplete?: () => void;
147
+ /** Fires when scroll enters the trigger zone (scrolling forward). */
148
+ onEnter?: () => void;
149
+ /** Fires when scroll exits the trigger zone at the end (scrolling forward). */
150
+ onLeave?: () => void;
151
+ /** Fires when scroll re-enters the trigger zone from the end (scrolling back). */
152
+ onEnterBack?: () => void;
153
+ /** Fires when scroll exits the trigger zone at the start (scrolling back). */
154
+ onLeaveBack?: () => void;
133
155
  }
134
156
 
135
157
  interface ScrollCounterOptions {
@@ -1,3 +1,3 @@
1
- function Et({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,m=[];for(let d=0;d<n;d++){let I=Math.pow(u,d);m.push(I),o+=I;}let l=[0],c=0;for(let d=0;d<n;d++)c+=m[d]/o,l.push(c);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let I=0;I<n;I++)if(d<=l[I+1]){let B=(d-l[I])/(l[I+1]-l[I]);if(I===0)return B*(2-B);let E=1-Math.pow(t,I);return E+(1-E)*(2*B-1)*(2*B-1)}return 1}}function St({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ae={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:Et(),elastic:St()};function le(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ye(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function je(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function Re(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function xt(e,r,n){return Math.min(n,Math.max(r,e))}function J(e,r,n,t){return n===r?0:xt((e-r)/(n-r)*t,0,1)}function fe(e,r,n,t,u){let o=Ye(e.top,e.height,r,t.element)-je(t.viewport,n),m=Ye(e.top,e.height,r,u.element)-je(u.viewport,n);return {tStart:o,tEnd:m}}function Ue(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Ce(e,r,n){let t=Ue(e),u=Ue(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var Ze={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}};function Je(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var Ke={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Tt=0;function At(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Mt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?Je("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&Je("Element has a fill \u2014 it may obscure the stroke animation.",e);}function $t(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,m=e-o,l=r-o,c=n==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${m}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;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function We(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let m=parseFloat(o),l=t[u++]??m;return String(+(m+(l-m)*n).toFixed(4))})}function Qe(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...Ze[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:d="linear",trigger:I={},stagger:B=0,direction:E="forward",once:re=false,debug:de=false,axis:q="y",scrollContainer:K,autoReverse:T=false,delay:N=0,strokeColor:A,strokeWidth:$,fillOpacity:P,waypoints:b,velocityScale:L=false,threshold:O=0,rootMargin:D="0px",repeat:M=0,repeatDelay:z=0,morphTo:C,clip:_,autoplay:Q=false,duration:j=1e3,native:oe=true,onProgress:f,onStart:k,onComplete:h}=u,p=_===true?"left":typeof _=="string"?_:false,F=typeof d=="function"?d:ae[d]??ae.linear,ge=le(I.start??"top bottom"),a=le(I.end??"bottom top"),g=typeof K=="string"?document.querySelector(K):K??null,ne=Array.isArray(A)?A[0]:null,V=Array.isArray(A)?A[1]:typeof A=="string"?A:null,U=Array.isArray($)?$[0]:null,se=Array.isArray($)?$[1]:typeof $=="number"?$:null,H=Array.isArray(P)?P[0]:null,G=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function me(s){let i=s*100;switch(p){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let ee=p?[]:Array.from(e.querySelectorAll(m)),X=[],ye=[],Ee=0,Se=0,ie=false,he=false,te=0,Ie=false,be=-1,Oe=-1,ce=false,$e=0,ve=0,xe,ze=null,Te=new Set,Fe=-1,Be=performance.now();function ke(){return g?q==="x"?g.scrollLeft:g.scrollTop:q==="x"?window.scrollX:window.scrollY}function Ge(){return g?q==="x"?g.clientWidth:g.clientHeight:q==="x"?window.innerWidth:window.innerHeight}function Xe(){let s=e.getBoundingClientRect(),i,v,Y;if(g){let ue=g.getBoundingClientRect();i=q==="x"?s.left-ue.left+g.scrollLeft:s.top-ue.top+g.scrollTop,v=q==="x"?s.width:s.height,Y=ke();}else i=q==="x"?s.left:s.top,v=q==="x"?s.width:s.height,Y=ke();let pe=fe({top:i,height:v},Y,Ge(),ge,a);Ee=pe.tStart,Se=pe.tEnd,de&&process.env.NODE_ENV!=="production"&&(ze?.remove(),ze=$t(Ee,Se,q));}function yt(s,i){if(e.style.setProperty("--scroll-draw-progress",String(s)),p){let v=i==="reverse"?1-s:s;e.style.clipPath=me(v);return}ee.forEach((v,Y)=>{v.style.strokeDashoffset=i==="reverse"?`${X[Y]*s}`:`${X[Y]*(1-s)}`,c&&(v.style.opacity=i==="reverse"?`${1-s}`:`${s}`),ne&&V?v.style.stroke=Ce(ne,V,s):V&&(v.style.stroke=V),U!==null&&se!==null?v.style.strokeWidth=`${U+(se-U)*s}`:se!==null&&(v.style.strokeWidth=`${se}`),H!==null&&G!==null?v.style.fillOpacity=`${H+(G-H)*s}`:G!==null&&(v.style.fillOpacity=`${G}`),C&&v.tagName.toLowerCase()==="path"&&ye[Y]&&v.setAttribute("d",We(ye[Y],C,s));});}function De(){if(e.style.setProperty("--scroll-draw-progress","0"),p){e.style.clipPath=me(0);return}ee.forEach((s,i)=>{s.style.strokeDasharray=`${X[i]}`,s.style.strokeDashoffset=E==="reverse"?"0":`${X[i]}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",ne&&(s.style.stroke=ne),U!==null&&(s.style.strokeWidth=`${U}`),H!==null&&(s.style.fillOpacity=`${H}`),C&&s.tagName.toLowerCase()==="path"&&ye[i]&&s.setAttribute("d",ye[i]);});}if(ee.forEach(s=>{Mt(s);let i=Re(s);X.push(i),s.tagName.toLowerCase()==="path"?ye.push(s.getAttribute("d")??""):ye.push(""),o?(s.style.strokeDasharray=`${i}`,s.style.strokeDashoffset=E==="reverse"?`${i}`:"0",c&&(s.style.opacity="1"),V&&(s.style.stroke=V),se!==null&&(s.style.strokeWidth=`${se}`),G!==null&&(s.style.fillOpacity=`${G}`),C&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",C)):(s.style.strokeDasharray=`${i}`,s.style.strokeDashoffset=E==="reverse"?"0":`${i}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",ne&&(s.style.stroke=ne),U!==null&&(s.style.strokeWidth=`${U}`),H!==null&&(s.style.fillOpacity=`${H}`));}),p){if(o)return e.style.clipPath=me(1),h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=me(0);}else if(o)return h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(oe===false||!At()||!ee.length||typeof d!="string"||!(d in Ke)||p||q!=="y"||g||l!==1||B!==0||re||T||L!==false||C||b||M||N>0||f||k||h||A!=null||$!=null||P!=null||(I.start??"top bottom").trim()!=="top bottom"||(I.end??"bottom top").trim()!=="bottom top")}function wt(){let s=`svg-scroll-draw-${++Tt}`,i=E==="reverse"?"0":"var(--ssd-len)",v=E==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${i};`,pe=`stroke-dashoffset:${v};`;c&&(Y+=`opacity:${E==="reverse"?1:0};`,pe+=`opacity:${E==="reverse"?0:1};`);let ue=document.createElement("style");ue.setAttribute("data-svg-scroll-draw",""),ue.textContent=`@keyframes ${s}{from{${Y}}to{${pe}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${Ke[d]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue);function w(y,x){y.style.setProperty("--ssd-len",String(X[x])),y.style.strokeDasharray=`${X[x]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(s);}ee.forEach(w);let R=false,Z=-1;function S(){if(Z>=0)return Z;let y=e.getBoundingClientRect(),{tStart:x,tEnd:W}=fe({top:y.top,height:y.height},ke(),Ge(),ge,a);return F(J(ke(),x,W,l))}return {destroy(){ee.forEach(y=>{y.classList.remove(s),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),ue.remove();},replay(){R=false,Z=-1,ee.forEach(w);},pause(){R=true,ee.forEach(y=>{y.style.animationPlayState="paused";});},resume(){R&&(R=false,ee.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let x=Math.min(1,Math.max(0,y));Z=x,R=true,ee.forEach((W,Pe)=>{W.classList.remove(s),W.style.strokeDashoffset=E==="reverse"?`${X[Pe]*x}`:`${X[Pe]*(1-x)}`,c&&(W.style.opacity=E==="reverse"?`${1-x}`:`${x}`);});},getProgress(){return S()}}}if(bt())return wt();function vt(){let s=Math.max(1,j),i=0,v=0;function Y(S){let y=true;if(p){let x=Math.min(1,Math.max(0,S/s)),W=F(x);$e=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=me(E==="reverse"?1-W:W),f?.(W),x<1&&(y=false);}else ee.forEach((x,W)=>{let Pe=W*B*s,Le=Math.min(1,Math.max(0,(S-Pe)/s)),we=F(Le);x.style.strokeDashoffset=E==="reverse"?`${X[W]*we}`:`${X[W]*(1-we)}`,c&&(x.style.opacity=E==="reverse"?`${1-we}`:`${we}`),ne&&V?x.style.stroke=Ce(ne,V,we):V&&(x.style.stroke=V),U!==null&&se!==null?x.style.strokeWidth=`${U+(se-U)*we}`:se!==null&&(x.style.strokeWidth=`${se}`),H!==null&&G!==null?x.style.fillOpacity=`${H+(G-H)*we}`:G!==null&&(x.style.fillOpacity=`${G}`),C&&x.tagName.toLowerCase()==="path"&&ye[W]&&x.setAttribute("d",We(ye[W],C,we)),W===0&&(f?.(we),e.style.setProperty("--scroll-draw-progress",String(we))),Le<1&&(y=false);});if(b){let x=Math.min(1,Math.max(0,S/s)),W=F(x);for(let Pe in b){let Le=parseFloat(Pe);W>=Le&&!Te.has(Le)&&(Te.add(Le),b[Pe]?.());}}return y}function pe(S){if(ce)return;let y=S-i;he||(he=true,k?.());let x=Y(y);if(x&&!ie){ie=true,Y(s*(1+Math.max(0,ee.length-1)*B)),h?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{i=performance.now(),he=false,ie=false,Te.clear(),De(),te=requestAnimationFrame(pe);},z));return}x||(te=requestAnimationFrame(pe));}function ue(){cancelAnimationFrame(te),clearTimeout(xe),i=performance.now(),v=0,ce=false,he=false,ie=false,ve=0,Te.clear(),De(),te=requestAnimationFrame(pe);}let w=new IntersectionObserver(S=>{S.forEach(y=>{y.isIntersecting&&!(re&&ie)?ue():!y.isIntersecting&&!re&&!ie&&(cancelAnimationFrame(te),clearTimeout(xe),i=null);});},{root:g??null,threshold:O,rootMargin:D}),R;function Z(){clearTimeout(R),R=setTimeout(()=>{ee.forEach((S,y)=>{X[y]=Re(S),S.style.strokeDasharray=`${X[y]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),N>0?setTimeout(()=>w.observe(e),N):w.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(xe),w.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(R);},replay(){ve=0,ue();},pause(){ce||(ce=true,v=performance.now()-i,cancelAnimationFrame(te));},resume(){ce&&(ce=false,i=performance.now()-v,te=requestAnimationFrame(pe));},seek(S){let y=Math.min(1,Math.max(0,S));$e=y,ce=true,v=y*s,i=performance.now()-v,cancelAnimationFrame(te),Y(v);},getProgress(){return $e}}}if(Q)return vt();Xe();function Ne(){if(!Ie||ce)return;let s=performance.now(),i=ke(),v=l;if(L!==false){let w=s-Be,R=w>0?Math.abs(i-(Fe<0?i:Fe))/w:0;v=l*Math.max(.2,1+R*(typeof L=="number"?L:1)*.04);}Fe=i,Be=s;let Y=T?Oe===-1||i>=Oe?"forward":"reverse":E;Oe=i;let pe=Se-Ee,ue=true;if(p){let w=F(J(i,Ee,Se,v));re&&!T&&(be=Math.max(be,w),w=be),$e=w,e.style.setProperty("--scroll-draw-progress",String(w));let R=Y==="reverse"?1-w:w;e.style.clipPath=me(R),f?.(w),!he&&J(i,Ee,Se,v)>0&&(he=true,k?.()),w>=1&&!ie?(ie=true,h?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{be=-1,he=false,ie=false,e.style.clipPath=me(0);},z))):w<1&&!re&&(ie=false),te=requestAnimationFrame(Ne);return}if(ee.forEach((w,R)=>{let Z=R*B*pe,S=F(J(i,Ee+Z,Se+Z,v));re&&!T&&(be=Math.max(be,S),S=be),$e=S,w.style.strokeDashoffset=Y==="reverse"?`${X[R]*S}`:`${X[R]*(1-S)}`,c&&(w.style.opacity=Y==="reverse"?`${1-S}`:`${S}`),ne&&V?w.style.stroke=Ce(ne,V,S):V&&(w.style.stroke=V),U!==null&&se!==null?w.style.strokeWidth=`${U+(se-U)*S}`:se!==null&&(w.style.strokeWidth=`${se}`),H!==null&&G!==null?w.style.fillOpacity=`${H+(G-H)*S}`:G!==null&&(w.style.fillOpacity=`${G}`),C&&w.tagName.toLowerCase()==="path"&&ye[R]&&w.setAttribute("d",We(ye[R],C,S)),R===0&&(f?.(S),e.style.setProperty("--scroll-draw-progress",String(S))),S<1&&(ue=false);}),b){let w=F(J(i,Ee,Se,v));for(let R in b){let Z=parseFloat(R);w>=Z&&!Te.has(Z)&&(Te.add(Z),b[R]?.());}}!he&&J(i,Ee,Se,v)>0&&(he=true,k?.()),ue&&!ie?(ie=true,h?.(),ve<(M==="infinite"?1/0:M??0)&&(ve++,xe=setTimeout(()=>{be=-1,he=false,ie=false,Te.clear(),De();},z))):!ue&&!re&&(ie=false),te=requestAnimationFrame(Ne);}let Ve=new IntersectionObserver(s=>{s.forEach(i=>{Ie=i.isIntersecting,Ie&&!ce?te=requestAnimationFrame(Ne):cancelAnimationFrame(te);});},{root:g??null,threshold:O,rootMargin:D}),qe;function He(){clearTimeout(qe),qe=setTimeout(()=>{ee.forEach((s,i)=>{X[i]=Re(s),s.style.strokeDasharray=`${X[i]}`;}),Xe();},150);}return window.addEventListener("resize",He),window.addEventListener("orientationchange",He),N>0?setTimeout(()=>Ve.observe(e),N):Ve.observe(e),{destroy(){cancelAnimationFrame(te),clearTimeout(xe),Ve.disconnect(),window.removeEventListener("resize",He),window.removeEventListener("orientationchange",He),clearTimeout(qe),ze?.remove();},replay(){be=-1,Oe=-1,Fe=-1,he=false,ie=false,ve=0,ce=false,Te.clear(),clearTimeout(xe),De();},pause(){ce=true,cancelAnimationFrame(te);},resume(){ce&&(ce=false,Ie&&(te=requestAnimationFrame(Ne)));},seek(s){let i=Math.min(1,Math.max(0,s));$e=i,be=i,ce=true,cancelAnimationFrame(te),yt(i,E);},getProgress(){return $e}}}var et=new Map;function Ae(e,r){et.set(e,r);}function Me(e){et.delete(e);}function Pt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function tt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],m=t[2].trim();if(m)for(let l of m.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Lt(e,r,n){let t=tt(e),u=tt(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,m)=>{let l=u[m];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,d)=>`${c}${o.units[d]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,d)=>`${c}${l.units[d]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,d)=>`${c+(l.nums[d]-c)*n}${o.units[d]}`).join(", ")})`}).join(" ")}function rt(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Pt(t))return Ce(t,u,n);if(t.includes("("))return Lt(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),m=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&m){let l=parseFloat(o[1]),c=parseFloat(m[1]);return `${l+(c-l)*n}${o[2]||m[2]}`}return n<1?t:u}function Ct(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},kt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),It=0;function Ot(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function st(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:m=1,once:l=false,axis:c="y",scrollContainer:d,native:I=true,onProgress:B,onComplete:E}=r,re=window.matchMedia("(prefers-reduced-motion: reduce)").matches,de=typeof o=="function"?o:ae[o]??ae["ease-out"],q=le(u.start??"top bottom"),K=le(u.end??"bottom top"),T=typeof d=="string"?document.querySelector(d):d??null,N=Object.entries(t).map(([a,g])=>({prop:Ct(a),from:Array.isArray(g)?g[0]:"",to:Array.isArray(g)?g[1]:g}));function A(){let a=window.getComputedStyle(e);for(let g of N)g.from===""&&(g.from=a.getPropertyValue(g.prop).trim()||"0");}function $(){for(let a of N)e.style.setProperty(a.prop,String(a.to));}if(re)return $(),E?.(),n;A();function P(){if(!I||!Ot()||typeof o!="string"||!(o in nt)||c!=="y"||T||l||m!==1||B||E||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let a of N)if(!kt.has(a.prop))return false;return true}function b(){let a=`ssd-a-${++It}`,g=N.map(H=>`${H.prop}:${H.from}`).join(";"),ne=N.map(H=>`${H.prop}:${H.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${a}{from{${g}}to{${ne}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${nt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(a);let U=()=>c==="x"?window.scrollX:window.scrollY,se=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),V.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(H){let G=Math.min(1,Math.max(0,H));e.classList.remove(a);for(let me of N)e.style.setProperty(me.prop,rt(me.from,me.to,G));},getProgress(){let H=e.getBoundingClientRect(),G=U(),me=se(),{tStart:ee,tEnd:X}=fe({top:H.top,height:H.height},G,me,q,K);return de(J(G,ee,X,m))}}}if(P())return b();let L=0,O=0,D=0,M=false,z=false,C=-1,_=0,Q=false,j=()=>T?c==="x"?T.scrollLeft:T.scrollTop:c==="x"?window.scrollX:window.scrollY,oe=()=>T?c==="x"?T.clientWidth:T.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function f(){let a=e.getBoundingClientRect(),g,ne;if(T){let U=T.getBoundingClientRect();g=c==="x"?a.left-U.left+T.scrollLeft:a.top-U.top+T.scrollTop,ne=c==="x"?a.width:a.height;}else g=c==="x"?a.left:a.top,ne=c==="x"?a.width:a.height;let V=fe({top:g,height:ne},j(),oe(),q,K);L=V.tStart,O=V.tEnd;}function k(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let g of N)e.style.setProperty(g.prop,rt(g.from,g.to,a));B?.(a);}function h(){if(!M||z)return;let a=de(J(j(),L,O,m));l&&(C=Math.max(C,a),a=C),_=a,k(a),a>=1&&!Q?(Q=true,E?.()):a<1&&!l&&(Q=false),D=requestAnimationFrame(h);}f();{let a=de(J(j(),L,O,m));l&&a>0&&(C=a),_=a,k(a);}let p=new IntersectionObserver(a=>{a.forEach(g=>{M=g.isIntersecting,M&&!z?D=requestAnimationFrame(h):cancelAnimationFrame(D);});},{root:T??null}),F;function ge(){clearTimeout(F),F=setTimeout(f,150);}return window.addEventListener("resize",ge),window.addEventListener("orientationchange",ge),p.observe(e),Ae(e,{type:"animate",getProgress:()=>_,getTrigger:()=>({tStart:L,tEnd:O})}),{destroy(){cancelAnimationFrame(D),p.disconnect(),window.removeEventListener("resize",ge),window.removeEventListener("orientationchange",ge),clearTimeout(F),Me(e);},replay(){C=-1,Q=false,_=0,z=false,k(0);},pause(){z=true,cancelAnimationFrame(D);},resume(){z&&(z=false,M&&(D=requestAnimationFrame(h)));},seek(a){let g=Math.min(1,Math.max(0,a));_=g,C=g,z=true,cancelAnimationFrame(D),k(g);},getProgress(){return _}}}var _e={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ot(e,r){if(typeof window>"u")return _e;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),_e;let t=n,{from:u=0,to:o,format:m,easing:l="ease-out",trigger:c={},once:d=true,decimals:I,onComplete:B}=r,E=I!==void 0?f=>f.toFixed(I):m??(f=>String(Math.round(f))),re=typeof l=="function"?l:ae[l]??ae["ease-out"],de=le(c.start??"top 80%"),q=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(o),B?.(),_e;t.textContent=E(u);let T=0,N=0,A=0,$=false,P=false,b=-1,L=0,O=false,D=()=>window.scrollY,M=()=>window.innerHeight;function z(){let f=t.getBoundingClientRect(),k=fe({top:f.top,height:f.height},D(),M(),de,q);T=k.tStart,N=k.tEnd;}function C(f){t.textContent=E(u+(o-u)*f),t.style.setProperty("--scroll-draw-progress",String(f));}function _(){if(!$||P)return;let f=re(J(D(),T,N,1));d&&(b=Math.max(b,f),f=b),L=f,C(f),f>=1&&!O?(O=true,B?.()):f<1&&!d&&(O=false),A=requestAnimationFrame(_);}z();{let f=re(J(D(),T,N,1));d&&f>0&&(b=f),L=f,C(f);}let Q=new IntersectionObserver(f=>{f.forEach(k=>{$=k.isIntersecting,$&&!P?A=requestAnimationFrame(_):cancelAnimationFrame(A);});}),j;function oe(){clearTimeout(j),j=setTimeout(z,150);}return window.addEventListener("resize",oe),window.addEventListener("orientationchange",oe),Q.observe(t),Ae(t,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:T,tEnd:N})}),{destroy(){cancelAnimationFrame(A),Q.disconnect(),window.removeEventListener("resize",oe),window.removeEventListener("orientationchange",oe),clearTimeout(j),Me(t);},replay(){b=-1,O=false,L=0,P=false,C(0);},pause(){P=true,cancelAnimationFrame(A);},resume(){P&&(P=false,$&&(A=requestAnimationFrame(_)));},seek(f){let k=Math.min(1,Math.max(0,f));L=k,b=k,P=true,cancelAnimationFrame(A),C(k);},getProgress(){return L}}}var it={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function at(e,r={}){if(typeof window>"u")return it;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),it;let t=n,{trigger:u={},easing:o="linear",once:m=false,axis:l="y",preload:c="auto",onReady:d,onComplete:I,onProgress:B}=r,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof o=="function"?o:ae[o]??ae.linear,de=le(u.start??"top top"),q=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let K=r.from??0,T=r.to,N=0,A=0,$=0,P=false,b=false,L=-1,O=0,D=false,M=false,z=()=>l==="x"?window.scrollX:window.scrollY,C=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let p=t.getBoundingClientRect(),F=l==="x"?p.left:p.top,ge=l==="x"?p.width:p.height,a=fe({top:F,height:ge},z(),C(),de,q);N=a.tStart,A=a.tEnd;}function Q(p){if(!M)return;let F=T??t.duration??0;t.currentTime=K+(F-K)*p,t.style.setProperty("--scroll-draw-progress",String(p)),B?.(p);}function j(){if(!P||b||!M)return;let p=re(J(z(),N,A,1));m&&(L=Math.max(L,p),p=L),O=p,Q(p),p>=1&&!D?(D=true,I?.()):p<1&&!m&&(D=false),$=requestAnimationFrame(j);}function oe(){if(M=true,T===void 0&&(T=t.duration),E){Q(1),d?.();return}_(),d?.(),P&&!b&&($=requestAnimationFrame(j));}t.readyState>=1?oe():t.addEventListener("loadedmetadata",oe,{once:true}),M||_();let f=new IntersectionObserver(p=>{p.forEach(F=>{P=F.isIntersecting,P&&!b&&M?$=requestAnimationFrame(j):cancelAnimationFrame($);});}),k;function h(){clearTimeout(k),k=setTimeout(_,150);}return window.addEventListener("resize",h),window.addEventListener("orientationchange",h),f.observe(t),Ae(t,{type:"video",getProgress:()=>O,getTrigger:()=>({tStart:N,tEnd:A})}),{destroy(){cancelAnimationFrame($),f.disconnect(),t.removeEventListener("loadedmetadata",oe),window.removeEventListener("resize",h),window.removeEventListener("orientationchange",h),clearTimeout(k),Me(t);},replay(){L=-1,D=false,O=0,b=false,Q(0);},pause(){b=true,cancelAnimationFrame($);},resume(){b&&(b=false,P&&M&&($=requestAnimationFrame(j)));},seek(p){let F=Math.min(1,Math.max(0,p));O=F,L=F,b=true,cancelAnimationFrame($),Q(F);},getProgress(){return O}}}function ut(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function Ft(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function lt(e){let r=ut(e),n=new Map;for(let o of r){let m=o.offsetTop;n.has(m)||n.set(m,[]),n.get(m).push(o);}let t=[],u=Array.from(n.keys()).sort((o,m)=>o-m);for(let o of u){let m=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of m)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Dt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,m=o+(1-u);return m<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(m-o)))}function Nt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function mt(e,r={}){if(typeof window>"u")return ct;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),ct;let t=n,{split:u="words",stagger:o=.04,easing:m="ease-out",from:l={opacity:0,y:24},trigger:c={},once:d=true,onComplete:I}=r,B=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof m=="function"?m:ae[m]??ae["ease-out"],re=le(c.start??"top 85%"),de=le(c.end??"top 40%"),q=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let K;u==="chars"?K=Ft(t):u==="lines"?K=lt(t):K=ut(t);let T=K.length;function N(h,p){l?.opacity!==void 0&&(h.style.opacity=String(l.opacity+(1-l.opacity)*p));let F=Nt(p,l);F&&(h.style.transform=F);}function A(h){t.style.setProperty("--scroll-draw-progress",String(h)),K.forEach((p,F)=>{let ge=E(Dt(h,F,T,o));N(p,ge);});}if(B)return A(1),I?.(),{destroy(){t.innerHTML=q,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let $=0,P=0,b=0,L=false,O=false,D=-1,M=0,z=false,C=()=>window.scrollY,_=()=>window.innerHeight;function Q(){let h=t.getBoundingClientRect(),p=fe({top:h.top,height:h.height},C(),_(),re,de);$=p.tStart,P=p.tEnd;}function j(){if(!L||O)return;let h=J(C(),$,P,1);d&&(D=Math.max(D,h),h=D),M=h,A(h),h>=1&&!z?(z=true,I?.()):h<1&&!d&&(z=false),b=requestAnimationFrame(j);}Q();let oe=new IntersectionObserver(h=>{h.forEach(p=>{L=p.isIntersecting,L&&!O?b=requestAnimationFrame(j):cancelAnimationFrame(b);});}),f;function k(){clearTimeout(f),f=setTimeout(()=>{if(u==="lines"){let h=M;t.innerHTML=q,t.setAttribute("aria-label",t.textContent??""),K=lt(t),A(h);}Q();},150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),oe.observe(t),Ae(t,{type:"text",getProgress:()=>M,getTrigger:()=>({tStart:$,tEnd:P})}),{destroy(){cancelAnimationFrame(b),oe.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(f),t.innerHTML=q,t.removeAttribute("aria-label"),Me(t);},replay(){D=-1,z=false,M=0,O=false,A(0);},pause(){O=true,cancelAnimationFrame(b);},resume(){O&&(O=false,L&&(b=requestAnimationFrame(j)));},seek(h){let p=Math.min(1,Math.max(0,h));M=p,D=p,O=true,cancelAnimationFrame(b),A(p);},getProgress(){return M}}}var pt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=Qe(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},ft=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},dt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ot(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},gt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=at(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},ht=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=mt(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};export{ft as ScrollAnimateRef,dt as ScrollCounterRef,pt as ScrollDrawRef,ht as ScrollTextRef,gt as ScrollVideoRef};
1
+ function Mt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),u=Math.sqrt(t),o=0,f=[];for(let y=0;y<n;y++){let C=Math.pow(u,y);f.push(C),o+=C;}let l=[0],c=0;for(let y=0;y<n;y++)c+=f[y]/o,l.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let C=0;C<n;C++)if(y<=l[C+1]){let R=(y-l[C])/(l[C+1]-l[C]);if(C===0)return R*(2-R);let E=1-Math.pow(t,C);return E+(1-E)*(2*R-1)*(2*R-1)}return 1}}function Pt({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),u=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-u)*(2*Math.PI)/t)+1}var ae={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:Mt(),elastic:Pt()};function le(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ke(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Qe(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function _e(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function $t(e,r,n){return Math.min(n,Math.max(r,e))}function Q(e,r,n,t){return n===r?0:$t((e-r)/(n-r)*t,0,1)}function he(e,r,n,t,u){let o=Ke(e.top,e.height,r,t.element)-Qe(t.viewport,n),f=Ke(e.top,e.height,r,u.element)-Qe(u.viewport,n);return {tStart:o,tEnd:f}}function et(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[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 Fe(e,r,n){let t=et(e),u=et(r);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*n)},${Math.round(t[1]+(u[1]-t[1])*n)},${Math.round(t[2]+(u[2]-t[2])*n)})`}var tt={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}};function rt(e,r){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,r);}var nt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function kt(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?rt("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&rt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function It(e,r,n){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 u(){let o=n==="x"?window.scrollX:window.scrollY,f=e-o,l=r-o,c=n==="x";t.innerHTML=`
2
+ <div style="position:absolute;${c?`left:${f}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${f}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;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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",u,{passive:true}),u(),t}function Ye(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let f=parseFloat(o),l=t[u++]??f;return String(+(f+(l-f)*n).toFixed(4))})}function st(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,u=n?{...tt[n],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:f="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:y="linear",trigger:C={},stagger:R=0,direction:E="forward",once:j=false,debug:ye=false,axis:z="y",scrollContainer:ee,autoReverse:U=false,delay:Z=0,strokeColor:S,strokeWidth:M,fillOpacity:P,waypoints:g,velocityScale:x=false,threshold:I=0,rootMargin:G="0px",repeat:k=0,repeatDelay:oe=0,morphTo:$,clip:_,autoplay:B=false,duration:X=1e3,native:V=true,onProgress:p,onStart:T,onComplete:b,onEnter:h,onLeave:q,onEnterBack:Se,onLeaveBack:xe}=u,be=_===true?"left":typeof _=="string"?_:false,we=typeof y=="function"?y:ae[y]??ae.linear,Le=le(C.start??"top bottom"),De=le(C.end??"bottom top"),te=typeof ee=="string"?document.querySelector(ee):ee??null,pe=Array.isArray(S)?S[0]:null,J=Array.isArray(S)?S[1]:typeof S=="string"?S:null,K=Array.isArray(M)?M[0]:null,i=Array.isArray(M)?M[1]:typeof M=="number"?M:null,d=Array.isArray(P)?P[0]:null,O=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function re(s){let a=s*100;switch(be){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let L=be?[]:Array.from(e.querySelectorAll(f)),H=[],F=[],ie=0,ce=0,ne=false,de=false,se=0,He=false,ve=-1,Re=-1,ue=false,Ce=0,Te=0,Ae,Be=null,Me=new Set,ze=-1,Ue=performance.now(),Ie=NaN;function Ne(){return te?z==="x"?te.scrollLeft:te.scrollTop:z==="x"?window.scrollX:window.scrollY}function Ze(){return te?z==="x"?te.clientWidth:te.clientHeight:z==="x"?window.innerWidth:window.innerHeight}function Je(){let s=e.getBoundingClientRect(),a,v,Y;if(te){let fe=te.getBoundingClientRect();a=z==="x"?s.left-fe.left+te.scrollLeft:s.top-fe.top+te.scrollTop,v=z==="x"?s.width:s.height,Y=Ne();}else a=z==="x"?s.left:s.top,v=z==="x"?s.width:s.height,Y=Ne();let me=he({top:a,height:v},Y,Ze(),Le,De);ie=me.tStart,ce=me.tEnd,ye&&process.env.NODE_ENV!=="production"&&(Be?.remove(),Be=It(ie,ce,z));}function St(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),be){let v=a==="reverse"?1-s:s;e.style.clipPath=re(v);return}L.forEach((v,Y)=>{v.style.strokeDashoffset=a==="reverse"?`${H[Y]*s}`:`${H[Y]*(1-s)}`,c&&(v.style.opacity=a==="reverse"?`${1-s}`:`${s}`),pe&&J?v.style.stroke=Fe(pe,J,s):J&&(v.style.stroke=J),K!==null&&i!==null?v.style.strokeWidth=`${K+(i-K)*s}`:i!==null&&(v.style.strokeWidth=`${i}`),d!==null&&O!==null?v.style.fillOpacity=`${d+(O-d)*s}`:O!==null&&(v.style.fillOpacity=`${O}`),$&&v.tagName.toLowerCase()==="path"&&F[Y]&&v.setAttribute("d",Ye(F[Y],$,s));});}function Ve(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=re(0);return}L.forEach((s,a)=>{s.style.strokeDasharray=`${H[a]}`,s.style.strokeDashoffset=E==="reverse"?"0":`${H[a]}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`),$&&s.tagName.toLowerCase()==="path"&&F[a]&&s.setAttribute("d",F[a]);});}if(L.forEach(s=>{kt(s);let a=_e(s);H.push(a),s.tagName.toLowerCase()==="path"?F.push(s.getAttribute("d")??""):F.push(""),o?(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?`${a}`:"0",c&&(s.style.opacity="1"),J&&(s.style.stroke=J),i!==null&&(s.style.strokeWidth=`${i}`),O!==null&&(s.style.fillOpacity=`${O}`),$&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",$)):(s.style.strokeDasharray=`${a}`,s.style.strokeDashoffset=E==="reverse"?"0":`${a}`,c?s.style.opacity=E==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),K!==null&&(s.style.strokeWidth=`${K}`),d!==null&&(s.style.fillOpacity=`${d}`));}),be){if(o)return e.style.clipPath=re(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=re(0);}else if(o)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function xt(){return !(V===false||!Ct()||!L.length||typeof y!="string"||!(y in nt)||be||z!=="y"||te||l!==1||R!==0||j||U||x!==false||$||g||k||Z>0||p||T||b||h||q||Se||xe||S!=null||M!=null||P!=null||(C.start??"top bottom").trim()!=="top bottom"||(C.end??"bottom top").trim()!=="bottom top")}function Tt(){let s=`svg-scroll-draw-${++Lt}`,a=E==="reverse"?"0":"var(--ssd-len)",v=E==="reverse"?"var(--ssd-len)":"0",Y=`stroke-dashoffset:${a};`,me=`stroke-dashoffset:${v};`;c&&(Y+=`opacity:${E==="reverse"?1:0};`,me+=`opacity:${E==="reverse"?0:1};`);let fe=document.createElement("style");fe.setAttribute("data-svg-scroll-draw",""),fe.textContent=`@keyframes ${s}{from{${Y}}to{${me}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${nt[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe);function ge(m,A){m.style.setProperty("--ssd-len",String(H[A])),m.style.strokeDasharray=`${H[A]}`,m.style.strokeDashoffset="",m.style.opacity="",m.style.animationPlayState="",m.classList.add(s);}L.forEach(ge);let w=false,N=-1;function D(){if(N>=0)return N;let m=e.getBoundingClientRect(),{tStart:A,tEnd:W}=he({top:m.top,height:m.height},Ne(),Ze(),Le,De);return we(Q(Ne(),A,W,l))}return {destroy(){L.forEach(m=>{m.classList.remove(s),m.style.removeProperty("--ssd-len"),m.style.animationPlayState="";}),fe.remove();},replay(){w=false,N=-1,L.forEach(ge);},pause(){w=true,L.forEach(m=>{m.style.animationPlayState="paused";});},resume(){w&&(w=false,L.forEach(m=>{m.style.animationPlayState="running";}));},seek(m){let A=Math.min(1,Math.max(0,m));N=A,w=true,L.forEach((W,ke)=>{W.classList.remove(s),W.style.strokeDashoffset=E==="reverse"?`${H[ke]*A}`:`${H[ke]*(1-A)}`,c&&(W.style.opacity=E==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return D()}}}if(xt())return Tt();function At(){let s=Math.max(1,X),a=0,v=0;function Y(D){let m=true;if(be){let A=Math.min(1,Math.max(0,D/s)),W=we(A);Ce=W,e.style.setProperty("--scroll-draw-progress",String(W)),e.style.clipPath=re(E==="reverse"?1-W:W),p?.(W),A<1&&(m=false);}else L.forEach((A,W)=>{let ke=W*R*s,Oe=Math.min(1,Math.max(0,(D-ke)/s)),Ee=we(Oe);A.style.strokeDashoffset=E==="reverse"?`${H[W]*Ee}`:`${H[W]*(1-Ee)}`,c&&(A.style.opacity=E==="reverse"?`${1-Ee}`:`${Ee}`),pe&&J?A.style.stroke=Fe(pe,J,Ee):J&&(A.style.stroke=J),K!==null&&i!==null?A.style.strokeWidth=`${K+(i-K)*Ee}`:i!==null&&(A.style.strokeWidth=`${i}`),d!==null&&O!==null?A.style.fillOpacity=`${d+(O-d)*Ee}`:O!==null&&(A.style.fillOpacity=`${O}`),$&&A.tagName.toLowerCase()==="path"&&F[W]&&A.setAttribute("d",Ye(F[W],$,Ee)),W===0&&(p?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Oe<1&&(m=false);});if(g){let A=Math.min(1,Math.max(0,D/s)),W=we(A);for(let ke in g){let Oe=parseFloat(ke);W>=Oe&&!Me.has(Oe)&&(Me.add(Oe),g[ke]?.());}}return m}function me(D){if(ue)return;let m=D-a;de||(de=true,T?.());let A=Y(m);if(A&&!ne){ne=true,Y(s*(1+Math.max(0,L.length-1)*R)),b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{a=performance.now(),de=false,ne=false,Me.clear(),Ve(),se=requestAnimationFrame(me);},oe));return}A||(se=requestAnimationFrame(me));}function fe(){cancelAnimationFrame(se),clearTimeout(Ae),a=performance.now(),v=0,ue=false,de=false,ne=false,Te=0,Me.clear(),Ve(),se=requestAnimationFrame(me);}let ge=new IntersectionObserver(D=>{D.forEach(m=>{m.isIntersecting&&!(j&&ne)?fe():!m.isIntersecting&&!j&&!ne&&(cancelAnimationFrame(se),clearTimeout(Ae),a=null);});},{root:te??null,threshold:I,rootMargin:G}),w;function N(){clearTimeout(w),w=setTimeout(()=>{L.forEach((D,m)=>{H[m]=_e(D),D.style.strokeDasharray=`${H[m]}`;});},150);}return window.addEventListener("resize",N),window.addEventListener("orientationchange",N),Z>0?setTimeout(()=>ge.observe(e),Z):ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),ge.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N),clearTimeout(w);},replay(){Te=0,fe();},pause(){ue||(ue=true,v=performance.now()-a,cancelAnimationFrame(se));},resume(){ue&&(ue=false,a=performance.now()-v,se=requestAnimationFrame(me));},seek(D){let m=Math.min(1,Math.max(0,D));Ce=m,ue=true,v=m*s,a=performance.now()-v,cancelAnimationFrame(se),Y(v);},getProgress(){return Ce}}}if(B)return At();Je();function qe(){if(!He||ue)return;let s=performance.now(),a=Ne(),v=l;if(x!==false){let w=s-Ue,N=w>0?Math.abs(a-(ze<0?a:ze))/w:0;v=l*Math.max(.2,1+N*(typeof x=="number"?x:1)*.04);}ze=a,Ue=s;let Y=U?Re===-1||a>=Re?"forward":"reverse":E;Re=a;let me=ce-ie,fe=true,ge=me===0?0:(a-ie)/me;if(isNaN(Ie)||(Ie<=0&&ge>0?h?.():Ie>0&&ge<=0&&xe?.(),Ie<1&&ge>=1?q?.():Ie>=1&&ge<1&&Se?.()),Ie=ge,be){let w=we(Q(a,ie,ce,v));j&&!U&&(ve=Math.max(ve,w),w=ve),Ce=w,e.style.setProperty("--scroll-draw-progress",String(w));let N=Y==="reverse"?1-w:w;e.style.clipPath=re(N),p?.(w),!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),w>=1&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,e.style.clipPath=re(0);},oe))):w<1&&!j&&(ne=false),se=requestAnimationFrame(qe);return}if(L.forEach((w,N)=>{let D=N*R*me,m=we(Q(a,ie+D,ce+D,v));j&&!U&&(ve=Math.max(ve,m),m=ve),Ce=m,w.style.strokeDashoffset=Y==="reverse"?`${H[N]*m}`:`${H[N]*(1-m)}`,c&&(w.style.opacity=Y==="reverse"?`${1-m}`:`${m}`),pe&&J?w.style.stroke=Fe(pe,J,m):J&&(w.style.stroke=J),K!==null&&i!==null?w.style.strokeWidth=`${K+(i-K)*m}`:i!==null&&(w.style.strokeWidth=`${i}`),d!==null&&O!==null?w.style.fillOpacity=`${d+(O-d)*m}`:O!==null&&(w.style.fillOpacity=`${O}`),$&&w.tagName.toLowerCase()==="path"&&F[N]&&w.setAttribute("d",Ye(F[N],$,m)),N===0&&(p?.(m),e.style.setProperty("--scroll-draw-progress",String(m))),m<1&&(fe=false);}),g){let w=we(Q(a,ie,ce,v));for(let N in g){let D=parseFloat(N);w>=D&&!Me.has(D)&&(Me.add(D),g[N]?.());}}!de&&Q(a,ie,ce,v)>0&&(de=true,T?.()),fe&&!ne?(ne=true,b?.(),Te<(k==="infinite"?1/0:k??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,de=false,ne=false,Me.clear(),Ve();},oe))):!fe&&!j&&(ne=false),se=requestAnimationFrame(qe);}let Ge=new IntersectionObserver(s=>{s.forEach(a=>{He=a.isIntersecting,He&&!ue?se=requestAnimationFrame(qe):cancelAnimationFrame(se);});},{root:te??null,threshold:I,rootMargin:G}),Xe;function We(){clearTimeout(Xe),Xe=setTimeout(()=>{L.forEach((s,a)=>{H[a]=_e(s),s.style.strokeDasharray=`${H[a]}`;}),Je();},150);}return window.addEventListener("resize",We),window.addEventListener("orientationchange",We),Z>0?setTimeout(()=>Ge.observe(e),Z):Ge.observe(e),{destroy(){cancelAnimationFrame(se),clearTimeout(Ae),Ge.disconnect(),window.removeEventListener("resize",We),window.removeEventListener("orientationchange",We),clearTimeout(Xe),Be?.remove();},replay(){ve=-1,Re=-1,ze=-1,de=false,ne=false,Te=0,ue=false,Me.clear(),clearTimeout(Ae),Ve();},pause(){ue=true,cancelAnimationFrame(se);},resume(){ue&&(ue=false,He&&(se=requestAnimationFrame(qe)));},seek(s){let a=Math.min(1,Math.max(0,s));Ce=a,ve=a,ue=true,cancelAnimationFrame(se),St(a,E);},getProgress(){return Ce}}}var ot=new Map;function Pe(e,r){ot.set(e,r);}function $e(e){ot.delete(e);}function Ot(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function it(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let u=[],o=[],f=t[2].trim();if(f)for(let l of f.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}r.push({fn:t[1],nums:u,units:o});}return r}function Ft(e,r,n){let t=it(e),u=it(r);return t.length===0||t.length!==u.length?n<1?e:r:t.map((o,f)=>{let l=u[f];return o.fn!==l.fn||o.nums.length!==l.nums.length?n<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,y)=>`${c}${l.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(l.nums[y]-c)*n}${o.units[y]}`).join(", ")})`}).join(" ")}function at(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),u=String(r);if(Ot(t))return Fe(t,u,n);if(t.includes("("))return Ft(t,u,n);let o=t.match(/^([-+]?[\d.]+)(.*)$/),f=u.match(/^([-+]?[\d.]+)(.*)$/);if(o&&f){let l=parseFloat(o[1]),c=parseFloat(f[1]);return `${l+(c-l)*n}${o[2]||f[2]}`}return n<1?t:u}function Nt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var lt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Dt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ht=0;function Rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ct(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:u={},easing:o="ease-out",speed:f=1,once:l=false,axis:c="y",scrollContainer:y,native:C=true,velocityScale:R=false,onProgress:E,onComplete:j,onEnter:ye,onLeave:z,onEnterBack:ee,onLeaveBack:U}=r,Z=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof o=="function"?o:ae[o]??ae["ease-out"],M=le(u.start??"top bottom"),P=le(u.end??"bottom top"),g=typeof y=="string"?document.querySelector(y):y??null,x=Object.entries(t).map(([i,d])=>({prop:Nt(i),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function I(){let i=window.getComputedStyle(e);for(let d of x)d.from===""&&(d.from=i.getPropertyValue(d.prop).trim()||"0");}function G(){for(let i of x)e.style.setProperty(i.prop,String(i.to));}if(Z)return G(),j?.(),n;I();function k(){if(!C||!Rt()||typeof o!="string"||!(o in lt)||c!=="y"||g||l||f!==1||E||j||ye||z||ee||U||R!==false||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let i of x)if(!Dt.has(i.prop))return false;return true}function oe(){let i=`ssd-a-${++Ht}`,d=x.map(F=>`${F.prop}:${F.from}`).join(";"),O=x.map(F=>`${F.prop}:${F.to}`).join(";"),re=document.createElement("style");re.setAttribute("data-ssd-animate",""),re.textContent=`@keyframes ${i}{from{${d}}to{${O}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${lt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(re),e.classList.add(i);let L=()=>c==="x"?window.scrollX:window.scrollY,H=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),re.remove();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(F){let ie=Math.min(1,Math.max(0,F));e.classList.remove(i);for(let ce of x)e.style.setProperty(ce.prop,at(ce.from,ce.to,ie));},getProgress(){let F=e.getBoundingClientRect(),ie=L(),ce=H(),{tStart:ne,tEnd:de}=he({top:F.top,height:F.height},ie,ce,M,P);return S(Q(ie,ne,de,f))}}}if(k())return oe();let $=0,_=0,B=0,X=false,V=false,p=-1,T=0,b=false,h=NaN,q=-1,Se=0,xe=()=>g?c==="x"?g.scrollLeft:g.scrollTop:c==="x"?window.scrollX:window.scrollY,be=()=>g?c==="x"?g.clientWidth:g.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function we(){let i=e.getBoundingClientRect(),d,O;if(g){let L=g.getBoundingClientRect();d=c==="x"?i.left-L.left+g.scrollLeft:i.top-L.top+g.scrollTop,O=c==="x"?i.width:i.height;}else d=c==="x"?i.left:i.top,O=c==="x"?i.width:i.height;let re=he({top:d,height:O},xe(),be(),M,P);$=re.tStart,_=re.tEnd;}function Le(i){e.style.setProperty("--scroll-draw-progress",String(i));for(let d of x)e.style.setProperty(d.prop,at(d.from,d.to,i));E?.(i);}function De(i){if(isNaN(h)){h=i;return}h<=0&&i>0?ye?.():h>0&&i<=0&&U?.(),h<1&&i>=1?z?.():h>=1&&i<1&&ee?.(),h=i;}function te(){if(!X||V)return;let i=performance.now(),d=xe(),O=f;if(R!==false){let H=i-Se,F=H>0?Math.abs(d-(q<0?d:q))/H:0;O=f*Math.max(.2,1+F*(typeof R=="number"?R:1)*.04);}q=d,Se=i;let re=_===$?0:(d-$)/(_-$);De(re);let L=S(Q(d,$,_,O));l&&(p=Math.max(p,L),L=p),T=L,Le(L),L>=1&&!b?(b=true,j?.()):L<1&&!l&&(b=false),B=requestAnimationFrame(te);}we();{let i=S(Q(xe(),$,_,f));l&&i>0&&(p=i),T=i,Le(i);}let pe=new IntersectionObserver(i=>{i.forEach(d=>{X=d.isIntersecting,X&&!V?B=requestAnimationFrame(te):cancelAnimationFrame(B);});},{root:g??null}),J;function K(){clearTimeout(J),J=setTimeout(we,150);}return window.addEventListener("resize",K),window.addEventListener("orientationchange",K),pe.observe(e),Pe(e,{type:"animate",getProgress:()=>T,getTrigger:()=>({tStart:$,tEnd:_})}),{destroy(){cancelAnimationFrame(B),pe.disconnect(),window.removeEventListener("resize",K),window.removeEventListener("orientationchange",K),clearTimeout(J),$e(e);},replay(){p=-1,b=false,T=0,V=false,Le(0);},pause(){V=true,cancelAnimationFrame(B);},resume(){V&&(V=false,X&&(B=requestAnimationFrame(te)));},seek(i){let d=Math.min(1,Math.max(0,i));T=d,p=d,V=true,cancelAnimationFrame(B),Le(d);},getProgress(){return T}}}var je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ut(e,r){if(typeof window>"u")return je;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),je;let t=n,{from:u=0,to:o,format:f,easing:l="ease-out",trigger:c={},once:y=true,decimals:C,onComplete:R}=r,E=C!==void 0?p=>p.toFixed(C):f??(p=>String(Math.round(p))),j=typeof l=="function"?l:ae[l]??ae["ease-out"],ye=le(c.start??"top 80%"),z=le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=E(o),R?.(),je;t.textContent=E(u);let U=0,Z=0,S=0,M=false,P=false,g=-1,x=0,I=false,G=()=>window.scrollY,k=()=>window.innerHeight;function oe(){let p=t.getBoundingClientRect(),T=he({top:p.top,height:p.height},G(),k(),ye,z);U=T.tStart,Z=T.tEnd;}function $(p){t.textContent=E(u+(o-u)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function _(){if(!M||P)return;let p=j(Q(G(),U,Z,1));y&&(g=Math.max(g,p),p=g),x=p,$(p),p>=1&&!I?(I=true,R?.()):p<1&&!y&&(I=false),S=requestAnimationFrame(_);}oe();{let p=j(Q(G(),U,Z,1));y&&p>0&&(g=p),x=p,$(p);}let B=new IntersectionObserver(p=>{p.forEach(T=>{M=T.isIntersecting,M&&!P?S=requestAnimationFrame(_):cancelAnimationFrame(S);});}),X;function V(){clearTimeout(X),X=setTimeout(oe,150);}return window.addEventListener("resize",V),window.addEventListener("orientationchange",V),B.observe(t),Pe(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:U,tEnd:Z})}),{destroy(){cancelAnimationFrame(S),B.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),clearTimeout(X),$e(t);},replay(){g=-1,I=false,x=0,P=false,$(0);},pause(){P=true,cancelAnimationFrame(S);},resume(){P&&(P=false,M&&(S=requestAnimationFrame(_)));},seek(p){let T=Math.min(1,Math.max(0,p));x=T,g=T,P=true,cancelAnimationFrame(S),$(T);},getProgress(){return x}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r={}){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),mt;let t=n,{trigger:u={},easing:o="linear",once:f=false,axis:l="y",preload:c="auto",onReady:y,onComplete:C,onProgress:R}=r,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches,j=typeof o=="function"?o:ae[o]??ae.linear,ye=le(u.start??"top top"),z=le(u.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let ee=r.from??0,U=r.to,Z=0,S=0,M=0,P=false,g=false,x=-1,I=0,G=false,k=false,oe=()=>l==="x"?window.scrollX:window.scrollY,$=()=>l==="x"?window.innerWidth:window.innerHeight;function _(){let h=t.getBoundingClientRect(),q=l==="x"?h.left:h.top,Se=l==="x"?h.width:h.height,xe=he({top:q,height:Se},oe(),$(),ye,z);Z=xe.tStart,S=xe.tEnd;}function B(h){if(!k)return;let q=U??t.duration??0;t.currentTime=ee+(q-ee)*h,t.style.setProperty("--scroll-draw-progress",String(h)),R?.(h);}function X(){if(!P||g||!k)return;let h=j(Q(oe(),Z,S,1));f&&(x=Math.max(x,h),h=x),I=h,B(h),h>=1&&!G?(G=true,C?.()):h<1&&!f&&(G=false),M=requestAnimationFrame(X);}function V(){if(k=true,U===void 0&&(U=t.duration),E){B(1),y?.();return}_(),y?.(),P&&!g&&(M=requestAnimationFrame(X));}t.readyState>=1?V():t.addEventListener("loadedmetadata",V,{once:true}),k||_();let p=new IntersectionObserver(h=>{h.forEach(q=>{P=q.isIntersecting,P&&!g&&k?M=requestAnimationFrame(X):cancelAnimationFrame(M);});}),T;function b(){clearTimeout(T),T=setTimeout(_,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),p.observe(t),Pe(t,{type:"video",getProgress:()=>I,getTrigger:()=>({tStart:Z,tEnd:S})}),{destroy(){cancelAnimationFrame(M),p.disconnect(),t.removeEventListener("loadedmetadata",V),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout(T),$e(t);},replay(){x=-1,G=false,I=0,g=false,B(0);},pause(){g=true,cancelAnimationFrame(M);},resume(){g&&(g=false,P&&k&&(M=requestAnimationFrame(X)));},seek(h){let q=Math.min(1,Math.max(0,h));I=q,x=q,g=true,cancelAnimationFrame(M),B(q);},getProgress(){return I}}}function gt(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function zt(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function pt(e){let r=gt(e),n=new Map;for(let o of r){let f=o.offsetTop;n.has(f)||n.set(f,[]),n.get(f).push(o);}let t=[],u=Array.from(n.keys()).sort((o,f)=>o-f);for(let o of u){let f=n.get(o),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block";for(let c of f)l.appendChild(c);t.push(l);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function Vt(e,r,n,t){if(n<=1||t===0)return e;let u=(n-1)*t,o=r*t,f=o+(1-u);return f<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(f-o)))}function qt(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ht(e,r={}){if(typeof window>"u")return dt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=n,{split:u="words",stagger:o=.04,easing:f="ease-out",from:l={opacity:0,y:24},trigger:c={},once:y=true,onComplete:C}=r,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,E=typeof f=="function"?f:ae[f]??ae["ease-out"],j=le(c.start??"top 85%"),ye=le(c.end??"top 40%"),z=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=zt(t):u==="lines"?ee=pt(t):ee=gt(t);let U=ee.length;function Z(b,h){l?.opacity!==void 0&&(b.style.opacity=String(l.opacity+(1-l.opacity)*h));let q=qt(h,l);q&&(b.style.transform=q);}function S(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach((h,q)=>{let Se=E(Vt(b,q,U,o));Z(h,Se);});}if(R)return S(1),C?.(),{destroy(){t.innerHTML=z,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};S(0);let M=0,P=0,g=0,x=false,I=false,G=-1,k=0,oe=false,$=()=>window.scrollY,_=()=>window.innerHeight;function B(){let b=t.getBoundingClientRect(),h=he({top:b.top,height:b.height},$(),_(),j,ye);M=h.tStart,P=h.tEnd;}function X(){if(!x||I)return;let b=Q($(),M,P,1);y&&(G=Math.max(G,b),b=G),k=b,S(b),b>=1&&!oe?(oe=true,C?.()):b<1&&!y&&(oe=false),g=requestAnimationFrame(X);}B();let V=new IntersectionObserver(b=>{b.forEach(h=>{x=h.isIntersecting,x&&!I?g=requestAnimationFrame(X):cancelAnimationFrame(g);});}),p;function T(){clearTimeout(p),p=setTimeout(()=>{if(u==="lines"){let b=k;t.innerHTML=z,t.setAttribute("aria-label",t.textContent??""),ee=pt(t),S(b);}B();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),V.observe(t),Pe(t,{type:"text",getProgress:()=>k,getTrigger:()=>({tStart:M,tEnd:P})}),{destroy(){cancelAnimationFrame(g),V.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(p),t.innerHTML=z,t.removeAttribute("aria-label"),$e(t);},replay(){G=-1,oe=false,k=0,I=false,S(0);},pause(){I=true,cancelAnimationFrame(g);},resume(){I&&(I=false,x&&(g=requestAnimationFrame(X)));},seek(b){let h=Math.min(1,Math.max(0,b));k=h,G=h,I=true,cancelAnimationFrame(g),S(h);},getProgress(){return k}}}var yt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=st(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},bt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ct(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},wt=class{constructor(){this.instance=null;}init(r,n){return this.destroy(),this.instance=ut(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},vt=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ft(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}},Et=class{constructor(){this.instance=null;}init(r,n={}){return this.destroy(),this.instance=ht(r,n),this}replay(){return this.instance?.replay(),this}pause(){return this.instance?.pause(),this}resume(){return this.instance?.resume(),this}seek(r){return this.instance?.seek(r),this}getProgress(){return this.instance?.getProgress()??0}destroy(){return this.instance?.destroy(),this.instance=null,this}};export{bt as ScrollAnimateRef,wt as ScrollCounterRef,yt as ScrollDrawRef,Et as ScrollTextRef,vt as ScrollVideoRef};
@@ -1,3 +1,3 @@
1
- 'use strict';function Qe({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),c=Math.sqrt(t),s=0,m=[];for(let d=0;d<r;d++){let T=Math.pow(c,d);m.push(T),s+=T;}let u=[0],l=0;for(let d=0;d<r;d++)l+=m[d]/s,u.push(l);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let T=0;T<r;T++)if(d<=u[T+1]){let Y=(d-u[T])/(u[T+1]-u[T]);if(T===0)return Y*(2-Y);let b=1-Math.pow(t,T);return b+(1-b)*(2*Y-1)*(2*Y-1)}return 1}}function et({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),c=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-c)*(2*Math.PI)/t)+1}var le={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:Qe(),elastic:et()};function me(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 Ue(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 Ze(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 Re(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 yt(e,n,r){return Math.min(r,Math.max(n,e))}function ee(e,n,r,t){return r===n?0:yt((e-n)/(r-n)*t,0,1)}function he(e,n,r,t,c){let s=Ue(e.top,e.height,n,t.element)-Ze(t.viewport,r),m=Ue(e.top,e.height,n,c.element)-Ze(c.viewport,r);return {tStart:s,tEnd:m}}function Ke(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 Ce(e,n,r){let t=Ke(e),c=Ke(n);return !t||!c?e:`rgb(${Math.round(t[0]+(c[0]-t[0])*r)},${Math.round(t[1]+(c[1]-t[1])*r)},${Math.round(t[2]+(c[2]-t[2])*r)})`}var _e={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}};function tt(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var rt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},ht=0;function wt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function bt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?tt("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&tt("Element has a fill \u2014 it may obscure the stroke animation.",e);}function St(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 c(){let s=r==="x"?window.scrollX:window.scrollY,m=e-s,u=n-s,l=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${l?`left:${m}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${m}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;${l?`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",c,{passive:true}),c(),t}function Be(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),c=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let m=parseFloat(s),u=t[c++]??m;return String(+(m+(u-m)*r).toFixed(4))})}function qe(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,c=r?{..._e[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:m="path, polyline, line, polygon, rect, circle",speed:u=1,fade:l=false,easing:d="linear",trigger:T={},stagger:Y=0,direction:b="forward",once:re=false,debug:we=false,axis:q="y",scrollContainer:ne,autoReverse:A=false,delay:N=0,strokeColor:M,strokeWidth:B,fillOpacity:O,waypoints:$,velocityScale:D=false,threshold:H=0,rootMargin:R="0px",repeat:I=0,repeatDelay:z=0,morphTo:E,clip:U,autoplay:ce=false,duration:ie=1e3,native:pe=true,onProgress:f,onStart:P,onComplete:h}=c,x=U===true?"left":typeof U=="string"?U:false,Z=typeof d=="function"?d:le[d]??le.linear,be=me(T.start??"top bottom"),a=me(T.end??"bottom top"),p=typeof ne=="string"?document.querySelector(ne):ne??null,K=Array.isArray(M)?M[0]:null,k=Array.isArray(M)?M[1]:typeof M=="string"?M:null,G=Array.isArray(B)?B[0]:null,Q=Array.isArray(B)?B[1]:typeof B=="number"?B:null,C=Array.isArray(O)?O[0]:null,V=Array.isArray(O)?O[1]:typeof O=="number"?O:null;function ae(o){let i=o*100;switch(x){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let X=x?[]:Array.from(e.querySelectorAll(m)),W=[],de=[],ve=0,Ee=0,te=false,fe=false,J=0,Oe=false,ge=-1,De=-1,oe=false,Ae=0,Se=0,xe,ze=null,Te=new Set,Ie=-1,Ye=performance.now();function ke(){return p?q==="x"?p.scrollLeft:p.scrollTop:q==="x"?window.scrollX:window.scrollY}function Xe(){return p?q==="x"?p.clientWidth:p.clientHeight:q==="x"?window.innerWidth:window.innerHeight}function Je(){let o=e.getBoundingClientRect(),i,w,_;if(p){let se=p.getBoundingClientRect();i=q==="x"?o.left-se.left+p.scrollLeft:o.top-se.top+p.scrollTop,w=q==="x"?o.width:o.height,_=ke();}else i=q==="x"?o.left:o.top,w=q==="x"?o.width:o.height,_=ke();let ue=he({top:i,height:w},_,Xe(),be,a);ve=ue.tStart,Ee=ue.tEnd,we&&process.env.NODE_ENV!=="production"&&(ze?.remove(),ze=St(ve,Ee,q));}function pt(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),x){let w=i==="reverse"?1-o:o;e.style.clipPath=ae(w);return}X.forEach((w,_)=>{w.style.strokeDashoffset=i==="reverse"?`${W[_]*o}`:`${W[_]*(1-o)}`,l&&(w.style.opacity=i==="reverse"?`${1-o}`:`${o}`),K&&k?w.style.stroke=Ce(K,k,o):k&&(w.style.stroke=k),G!==null&&Q!==null?w.style.strokeWidth=`${G+(Q-G)*o}`:Q!==null&&(w.style.strokeWidth=`${Q}`),C!==null&&V!==null?w.style.fillOpacity=`${C+(V-C)*o}`:V!==null&&(w.style.fillOpacity=`${V}`),E&&w.tagName.toLowerCase()==="path"&&de[_]&&w.setAttribute("d",Be(de[_],E,o));});}function Fe(){if(e.style.setProperty("--scroll-draw-progress","0"),x){e.style.clipPath=ae(0);return}X.forEach((o,i)=>{o.style.strokeDasharray=`${W[i]}`,o.style.strokeDashoffset=b==="reverse"?"0":`${W[i]}`,l?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",K&&(o.style.stroke=K),G!==null&&(o.style.strokeWidth=`${G}`),C!==null&&(o.style.fillOpacity=`${C}`),E&&o.tagName.toLowerCase()==="path"&&de[i]&&o.setAttribute("d",de[i]);});}if(X.forEach(o=>{bt(o);let i=Re(o);W.push(i),o.tagName.toLowerCase()==="path"?de.push(o.getAttribute("d")??""):de.push(""),s?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=b==="reverse"?`${i}`:"0",l&&(o.style.opacity="1"),k&&(o.style.stroke=k),Q!==null&&(o.style.strokeWidth=`${Q}`),V!==null&&(o.style.fillOpacity=`${V}`),E&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",E)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=b==="reverse"?"0":`${i}`,l?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",K&&(o.style.stroke=K),G!==null&&(o.style.strokeWidth=`${G}`),C!==null&&(o.style.fillOpacity=`${C}`));}),x){if(s)return e.style.clipPath=ae(1),h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=ae(0);}else if(s)return h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function ft(){return !(pe===false||!wt()||!X.length||typeof d!="string"||!(d in rt)||x||q!=="y"||p||u!==1||Y!==0||re||A||D!==false||E||$||I||N>0||f||P||h||M!=null||B!=null||O!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function dt(){let o=`svg-scroll-draw-${++ht}`,i=b==="reverse"?"0":"var(--ssd-len)",w=b==="reverse"?"var(--ssd-len)":"0",_=`stroke-dashoffset:${i};`,ue=`stroke-dashoffset:${w};`;l&&(_+=`opacity:${b==="reverse"?1:0};`,ue+=`opacity:${b==="reverse"?0:1};`);let se=document.createElement("style");se.setAttribute("data-svg-scroll-draw",""),se.textContent=`@keyframes ${o}{from{${_}}to{${ue}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${rt[d]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(se);function y(g,v){g.style.setProperty("--ssd-len",String(W[v])),g.style.strokeDasharray=`${W[v]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(o);}X.forEach(y);let L=false,j=-1;function S(){if(j>=0)return j;let g=e.getBoundingClientRect(),{tStart:v,tEnd:F}=he({top:g.top,height:g.height},ke(),Xe(),be,a);return Z(ee(ke(),v,F,u))}return {destroy(){X.forEach(g=>{g.classList.remove(o),g.style.removeProperty("--ssd-len"),g.style.animationPlayState="";}),se.remove();},replay(){L=false,j=-1,X.forEach(y);},pause(){L=true,X.forEach(g=>{g.style.animationPlayState="paused";});},resume(){L&&(L=false,X.forEach(g=>{g.style.animationPlayState="running";}));},seek(g){let v=Math.min(1,Math.max(0,g));j=v,L=true,X.forEach((F,Me)=>{F.classList.remove(o),F.style.strokeDashoffset=b==="reverse"?`${W[Me]*v}`:`${W[Me]*(1-v)}`,l&&(F.style.opacity=b==="reverse"?`${1-v}`:`${v}`);});},getProgress(){return S()}}}if(ft())return dt();function gt(){let o=Math.max(1,ie),i=0,w=0;function _(S){let g=true;if(x){let v=Math.min(1,Math.max(0,S/o)),F=Z(v);Ae=F,e.style.setProperty("--scroll-draw-progress",String(F)),e.style.clipPath=ae(b==="reverse"?1-F:F),f?.(F),v<1&&(g=false);}else X.forEach((v,F)=>{let Me=F*Y*o,$e=Math.min(1,Math.max(0,(S-Me)/o)),ye=Z($e);v.style.strokeDashoffset=b==="reverse"?`${W[F]*ye}`:`${W[F]*(1-ye)}`,l&&(v.style.opacity=b==="reverse"?`${1-ye}`:`${ye}`),K&&k?v.style.stroke=Ce(K,k,ye):k&&(v.style.stroke=k),G!==null&&Q!==null?v.style.strokeWidth=`${G+(Q-G)*ye}`:Q!==null&&(v.style.strokeWidth=`${Q}`),C!==null&&V!==null?v.style.fillOpacity=`${C+(V-C)*ye}`:V!==null&&(v.style.fillOpacity=`${V}`),E&&v.tagName.toLowerCase()==="path"&&de[F]&&v.setAttribute("d",Be(de[F],E,ye)),F===0&&(f?.(ye),e.style.setProperty("--scroll-draw-progress",String(ye))),$e<1&&(g=false);});if($){let v=Math.min(1,Math.max(0,S/o)),F=Z(v);for(let Me in $){let $e=parseFloat(Me);F>=$e&&!Te.has($e)&&(Te.add($e),$[Me]?.());}}return g}function ue(S){if(oe)return;let g=S-i;fe||(fe=true,P?.());let v=_(g);if(v&&!te){te=true,_(o*(1+Math.max(0,X.length-1)*Y)),h?.(),Se<(I==="infinite"?1/0:I??0)&&(Se++,xe=setTimeout(()=>{i=performance.now(),fe=false,te=false,Te.clear(),Fe(),J=requestAnimationFrame(ue);},z));return}v||(J=requestAnimationFrame(ue));}function se(){cancelAnimationFrame(J),clearTimeout(xe),i=performance.now(),w=0,oe=false,fe=false,te=false,Se=0,Te.clear(),Fe(),J=requestAnimationFrame(ue);}let y=new IntersectionObserver(S=>{S.forEach(g=>{g.isIntersecting&&!(re&&te)?se():!g.isIntersecting&&!re&&!te&&(cancelAnimationFrame(J),clearTimeout(xe),i=null);});},{root:p??null,threshold:H,rootMargin:R}),L;function j(){clearTimeout(L),L=setTimeout(()=>{X.forEach((S,g)=>{W[g]=Re(S),S.style.strokeDasharray=`${W[g]}`;});},150);}return window.addEventListener("resize",j),window.addEventListener("orientationchange",j),N>0?setTimeout(()=>y.observe(e),N):y.observe(e),{destroy(){cancelAnimationFrame(J),clearTimeout(xe),y.disconnect(),window.removeEventListener("resize",j),window.removeEventListener("orientationchange",j),clearTimeout(L);},replay(){Se=0,se();},pause(){oe||(oe=true,w=performance.now()-i,cancelAnimationFrame(J));},resume(){oe&&(oe=false,i=performance.now()-w,J=requestAnimationFrame(ue));},seek(S){let g=Math.min(1,Math.max(0,S));Ae=g,oe=true,w=g*o,i=performance.now()-w,cancelAnimationFrame(J),_(w);},getProgress(){return Ae}}}if(ce)return gt();Je();function Ne(){if(!Oe||oe)return;let o=performance.now(),i=ke(),w=u;if(D!==false){let y=o-Ye,L=y>0?Math.abs(i-(Ie<0?i:Ie))/y:0;w=u*Math.max(.2,1+L*(typeof D=="number"?D:1)*.04);}Ie=i,Ye=o;let _=A?De===-1||i>=De?"forward":"reverse":b;De=i;let ue=Ee-ve,se=true;if(x){let y=Z(ee(i,ve,Ee,w));re&&!A&&(ge=Math.max(ge,y),y=ge),Ae=y,e.style.setProperty("--scroll-draw-progress",String(y));let L=_==="reverse"?1-y:y;e.style.clipPath=ae(L),f?.(y),!fe&&ee(i,ve,Ee,w)>0&&(fe=true,P?.()),y>=1&&!te?(te=true,h?.(),Se<(I==="infinite"?1/0:I??0)&&(Se++,xe=setTimeout(()=>{ge=-1,fe=false,te=false,e.style.clipPath=ae(0);},z))):y<1&&!re&&(te=false),J=requestAnimationFrame(Ne);return}if(X.forEach((y,L)=>{let j=L*Y*ue,S=Z(ee(i,ve+j,Ee+j,w));re&&!A&&(ge=Math.max(ge,S),S=ge),Ae=S,y.style.strokeDashoffset=_==="reverse"?`${W[L]*S}`:`${W[L]*(1-S)}`,l&&(y.style.opacity=_==="reverse"?`${1-S}`:`${S}`),K&&k?y.style.stroke=Ce(K,k,S):k&&(y.style.stroke=k),G!==null&&Q!==null?y.style.strokeWidth=`${G+(Q-G)*S}`:Q!==null&&(y.style.strokeWidth=`${Q}`),C!==null&&V!==null?y.style.fillOpacity=`${C+(V-C)*S}`:V!==null&&(y.style.fillOpacity=`${V}`),E&&y.tagName.toLowerCase()==="path"&&de[L]&&y.setAttribute("d",Be(de[L],E,S)),L===0&&(f?.(S),e.style.setProperty("--scroll-draw-progress",String(S))),S<1&&(se=false);}),$){let y=Z(ee(i,ve,Ee,w));for(let L in $){let j=parseFloat(L);y>=j&&!Te.has(j)&&(Te.add(j),$[L]?.());}}!fe&&ee(i,ve,Ee,w)>0&&(fe=true,P?.()),se&&!te?(te=true,h?.(),Se<(I==="infinite"?1/0:I??0)&&(Se++,xe=setTimeout(()=>{ge=-1,fe=false,te=false,Te.clear(),Fe();},z))):!se&&!re&&(te=false),J=requestAnimationFrame(Ne);}let Ve=new IntersectionObserver(o=>{o.forEach(i=>{Oe=i.isIntersecting,Oe&&!oe?J=requestAnimationFrame(Ne):cancelAnimationFrame(J);});},{root:p??null,threshold:H,rootMargin:R}),We;function He(){clearTimeout(We),We=setTimeout(()=>{X.forEach((o,i)=>{W[i]=Re(o),o.style.strokeDasharray=`${W[i]}`;}),Je();},150);}return window.addEventListener("resize",He),window.addEventListener("orientationchange",He),N>0?setTimeout(()=>Ve.observe(e),N):Ve.observe(e),{destroy(){cancelAnimationFrame(J),clearTimeout(xe),Ve.disconnect(),window.removeEventListener("resize",He),window.removeEventListener("orientationchange",He),clearTimeout(We),ze?.remove();},replay(){ge=-1,De=-1,Ie=-1,fe=false,te=false,Se=0,oe=false,Te.clear(),clearTimeout(xe),Fe();},pause(){oe=true,cancelAnimationFrame(J);},resume(){oe&&(oe=false,Oe&&(J=requestAnimationFrame(Ne)));},seek(o){let i=Math.min(1,Math.max(0,o));Ae=i,ge=i,oe=true,cancelAnimationFrame(J),pt(i,b);},getProgress(){return Ae}}}var nt=new Map;function Pe(e,n){nt.set(e,n);}function Le(e){nt.delete(e);}function vt(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 c=[],s=[],m=t[2].trim();if(m)for(let u of m.split(/[\s,]+/)){let l=u.match(/^([-+]?[\d.eE]+)(.*)$/);c.push(l?parseFloat(l[1]):0),s.push(l?l[2]:"");}n.push({fn:t[1],nums:c,units:s});}return n}function Et(e,n,r){let t=ot(e),c=ot(n);return t.length===0||t.length!==c.length?r<1?e:n:t.map((s,m)=>{let u=c[m];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((l,d)=>`${l}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((l,d)=>`${l}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((l,d)=>`${l+(u.nums[d]-l)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function st(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),c=String(n);if(vt(t))return Ce(t,c,r);if(t.includes("("))return Et(t,c,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),m=c.match(/^([-+]?[\d.]+)(.*)$/);if(s&&m){let u=parseFloat(s[1]),l=parseFloat(m[1]);return `${u+(l-u)*r}${s[2]||m[2]}`}return r<1?t:c}function xt(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var it={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Tt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),At=0;function Mt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function at(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:c={},easing:s="ease-out",speed:m=1,once:u=false,axis:l="y",scrollContainer:d,native:T=true,onProgress:Y,onComplete:b}=n,re=window.matchMedia("(prefers-reduced-motion: reduce)").matches,we=typeof s=="function"?s:le[s]??le["ease-out"],q=me(c.start??"top bottom"),ne=me(c.end??"bottom top"),A=typeof d=="string"?document.querySelector(d):d??null,N=Object.entries(t).map(([a,p])=>({prop:xt(a),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function M(){let a=window.getComputedStyle(e);for(let p of N)p.from===""&&(p.from=a.getPropertyValue(p.prop).trim()||"0");}function B(){for(let a of N)e.style.setProperty(a.prop,String(a.to));}if(re)return B(),b?.(),r;M();function O(){if(!T||!Mt()||typeof s!="string"||!(s in it)||l!=="y"||A||u||m!==1||Y||b||(c.start??"top bottom").trim()!=="top bottom"||(c.end??"bottom top").trim()!=="bottom top")return false;for(let a of N)if(!Tt.has(a.prop))return false;return true}function $(){let a=`ssd-a-${++At}`,p=N.map(C=>`${C.prop}:${C.from}`).join(";"),K=N.map(C=>`${C.prop}:${C.to}`).join(";"),k=document.createElement("style");k.setAttribute("data-ssd-animate",""),k.textContent=`@keyframes ${a}{from{${p}}to{${K}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${it[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(k),e.classList.add(a);let G=()=>l==="x"?window.scrollX:window.scrollY,Q=()=>l==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),k.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(C){let V=Math.min(1,Math.max(0,C));e.classList.remove(a);for(let ae of N)e.style.setProperty(ae.prop,st(ae.from,ae.to,V));},getProgress(){let C=e.getBoundingClientRect(),V=G(),ae=Q(),{tStart:X,tEnd:W}=he({top:C.top,height:C.height},V,ae,q,ne);return we(ee(V,X,W,m))}}}if(O())return $();let D=0,H=0,R=0,I=false,z=false,E=-1,U=0,ce=false,ie=()=>A?l==="x"?A.scrollLeft:A.scrollTop:l==="x"?window.scrollX:window.scrollY,pe=()=>A?l==="x"?A.clientWidth:A.clientHeight:l==="x"?window.innerWidth:window.innerHeight;function f(){let a=e.getBoundingClientRect(),p,K;if(A){let G=A.getBoundingClientRect();p=l==="x"?a.left-G.left+A.scrollLeft:a.top-G.top+A.scrollTop,K=l==="x"?a.width:a.height;}else p=l==="x"?a.left:a.top,K=l==="x"?a.width:a.height;let k=he({top:p,height:K},ie(),pe(),q,ne);D=k.tStart,H=k.tEnd;}function P(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let p of N)e.style.setProperty(p.prop,st(p.from,p.to,a));Y?.(a);}function h(){if(!I||z)return;let a=we(ee(ie(),D,H,m));u&&(E=Math.max(E,a),a=E),U=a,P(a),a>=1&&!ce?(ce=true,b?.()):a<1&&!u&&(ce=false),R=requestAnimationFrame(h);}f();{let a=we(ee(ie(),D,H,m));u&&a>0&&(E=a),U=a,P(a);}let x=new IntersectionObserver(a=>{a.forEach(p=>{I=p.isIntersecting,I&&!z?R=requestAnimationFrame(h):cancelAnimationFrame(R);});},{root:A??null}),Z;function be(){clearTimeout(Z),Z=setTimeout(f,150);}return window.addEventListener("resize",be),window.addEventListener("orientationchange",be),x.observe(e),Pe(e,{type:"animate",getProgress:()=>U,getTrigger:()=>({tStart:D,tEnd:H})}),{destroy(){cancelAnimationFrame(R),x.disconnect(),window.removeEventListener("resize",be),window.removeEventListener("orientationchange",be),clearTimeout(Z),Le(e);},replay(){E=-1,ce=false,U=0,z=false,P(0);},pause(){z=true,cancelAnimationFrame(R);},resume(){z&&(z=false,I&&(R=requestAnimationFrame(h)));},seek(a){let p=Math.min(1,Math.max(0,a));U=p,E=p,z=true,cancelAnimationFrame(R),P(p);},getProgress(){return U}}}var Ge={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function je(e,n){if(typeof window>"u")return Ge;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),Ge;let t=r,{from:c=0,to:s,format:m,easing:u="ease-out",trigger:l={},once:d=true,decimals:T,onComplete:Y}=n,b=T!==void 0?f=>f.toFixed(T):m??(f=>String(Math.round(f))),re=typeof u=="function"?u:le[u]??le["ease-out"],we=me(l.start??"top 80%"),q=me(l.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=b(s),Y?.(),Ge;t.textContent=b(c);let A=0,N=0,M=0,B=false,O=false,$=-1,D=0,H=false,R=()=>window.scrollY,I=()=>window.innerHeight;function z(){let f=t.getBoundingClientRect(),P=he({top:f.top,height:f.height},R(),I(),we,q);A=P.tStart,N=P.tEnd;}function E(f){t.textContent=b(c+(s-c)*f),t.style.setProperty("--scroll-draw-progress",String(f));}function U(){if(!B||O)return;let f=re(ee(R(),A,N,1));d&&($=Math.max($,f),f=$),D=f,E(f),f>=1&&!H?(H=true,Y?.()):f<1&&!d&&(H=false),M=requestAnimationFrame(U);}z();{let f=re(ee(R(),A,N,1));d&&f>0&&($=f),D=f,E(f);}let ce=new IntersectionObserver(f=>{f.forEach(P=>{B=P.isIntersecting,B&&!O?M=requestAnimationFrame(U):cancelAnimationFrame(M);});}),ie;function pe(){clearTimeout(ie),ie=setTimeout(z,150);}return window.addEventListener("resize",pe),window.addEventListener("orientationchange",pe),ce.observe(t),Pe(t,{type:"counter",getProgress:()=>D,getTrigger:()=>({tStart:A,tEnd:N})}),{destroy(){cancelAnimationFrame(M),ce.disconnect(),window.removeEventListener("resize",pe),window.removeEventListener("orientationchange",pe),clearTimeout(ie),Le(t);},replay(){$=-1,H=false,D=0,O=false,E(0);},pause(){O=true,cancelAnimationFrame(M);},resume(){O&&(O=false,B&&(M=requestAnimationFrame(U)));},seek(f){let P=Math.min(1,Math.max(0,f));D=P,$=P,O=true,cancelAnimationFrame(M),E(P);},getProgress(){return D}}}function ut(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 $t(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 lt(e){let n=ut(e),r=new Map;for(let s of n){let m=s.offsetTop;r.has(m)||r.set(m,[]),r.get(m).push(s);}let t=[],c=Array.from(r.keys()).sort((s,m)=>s-m);for(let s of c){let m=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block";for(let l of m)u.appendChild(l);t.push(u);}e.textContent="";for(let s of t)e.appendChild(s),e.appendChild(document.createTextNode(" "));return t}function Ct(e,n,r,t){if(r<=1||t===0)return e;let c=(r-1)*t,s=n*t,m=s+(1-c);return m<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(m-s)))}function Pt(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 ct={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function mt(e,n={}){if(typeof window>"u")return ct;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),ct;let t=r,{split:c="words",stagger:s=.04,easing:m="ease-out",from:u={opacity:0,y:24},trigger:l={},once:d=true,onComplete:T}=n,Y=window.matchMedia("(prefers-reduced-motion: reduce)").matches,b=typeof m=="function"?m:le[m]??le["ease-out"],re=me(l.start??"top 85%"),we=me(l.end??"top 40%"),q=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ne;c==="chars"?ne=$t(t):c==="lines"?ne=lt(t):ne=ut(t);let A=ne.length;function N(h,x){u?.opacity!==void 0&&(h.style.opacity=String(u.opacity+(1-u.opacity)*x));let Z=Pt(x,u);Z&&(h.style.transform=Z);}function M(h){t.style.setProperty("--scroll-draw-progress",String(h)),ne.forEach((x,Z)=>{let be=b(Ct(h,Z,A,s));N(x,be);});}if(Y)return M(1),T?.(),{destroy(){t.innerHTML=q,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let B=0,O=0,$=0,D=false,H=false,R=-1,I=0,z=false,E=()=>window.scrollY,U=()=>window.innerHeight;function ce(){let h=t.getBoundingClientRect(),x=he({top:h.top,height:h.height},E(),U(),re,we);B=x.tStart,O=x.tEnd;}function ie(){if(!D||H)return;let h=ee(E(),B,O,1);d&&(R=Math.max(R,h),h=R),I=h,M(h),h>=1&&!z?(z=true,T?.()):h<1&&!d&&(z=false),$=requestAnimationFrame(ie);}ce();let pe=new IntersectionObserver(h=>{h.forEach(x=>{D=x.isIntersecting,D&&!H?$=requestAnimationFrame(ie):cancelAnimationFrame($);});}),f;function P(){clearTimeout(f),f=setTimeout(()=>{if(c==="lines"){let h=I;t.innerHTML=q,t.setAttribute("aria-label",t.textContent??""),ne=lt(t),M(h);}ce();},150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),pe.observe(t),Pe(t,{type:"text",getProgress:()=>I,getTrigger:()=>({tStart:B,tEnd:O})}),{destroy(){cancelAnimationFrame($),pe.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(f),t.innerHTML=q,t.removeAttribute("aria-label"),Le(t);},replay(){R=-1,z=false,I=0,H=false,M(0);},pause(){H=true,cancelAnimationFrame($);},resume(){H&&(H=false,D&&($=requestAnimationFrame(ie)));},seek(h){let x=Math.min(1,Math.max(0,h));I=x,R=x,H=true,cancelAnimationFrame($),M(x);},getProgress(){return I}}}function Lt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?qe(t,n):(console.warn("[svg-scroll-draw] Container not found:",e),r)}function kt(e=document){return Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return qe(n,r)})}function Ot(e=document){return Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return at(n,r)})}function Dt(e=document){return Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(process.env.NODE_ENV!=="production"&&console.warn('[svg-scroll-draw] initScrollCounter: element missing "to" in options JSON:',n),r.to=0),je(n,r)})}function It(e=document){return Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return mt(n,r)})}function fr(e=document){return {draw:kt(e),animate:Ot(e),counter:Dt(e),text:It(e)}}exports.initAll=fr;exports.initScrollAnimate=Ot;exports.initScrollCounter=Dt;exports.initScrollDraw=kt;exports.initScrollText=It;exports.scrollDraw=Lt;
1
+ 'use strict';function ot({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),u=Math.sqrt(t),i=0,p=[];for(let g=0;g<r;g++){let M=Math.pow(u,g);p.push(M),i+=M;}let m=[0],c=0;for(let g=0;g<r;g++)c+=p[g]/i,m.push(c);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let M=0;M<r;M++)if(g<=m[M+1]){let F=(g-m[M])/(m[M+1]-m[M]);if(M===0)return F*(2-F);let S=1-Math.pow(t,M);return S+(1-S)*(2*F-1)*(2*F-1)}return 1}}function st({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),u=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-u)*(2*Math.PI)/t)+1}var pe={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:ot(),elastic:st()};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 tt(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 rt(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 We(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 St(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:St((e-n)/(r-n)*t,0,1)}function ve(e,n,r,t,u){let i=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),p=tt(e.top,e.height,n,u.element)-rt(u.viewport,r);return {tStart:i,tEnd:p}}function nt(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 Oe(e,n,r){let t=nt(e),u=nt(n);return !t||!u?e:`rgb(${Math.round(t[0]+(u[0]-t[0])*r)},${Math.round(t[1]+(u[1]-t[1])*r)},${Math.round(t[2]+(u[2]-t[2])*r)})`}var Xe={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}};function it(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var at={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Et=0;function xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Tt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?it("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&it("Element has a fill \u2014 it may obscure the stroke animation.",e);}function At(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 u(){let i=r==="x"?window.scrollX:window.scrollY,p=e-i,m=n-i,c=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${c?`left:${p}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${p}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;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}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",u,{passive:true}),u(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),u=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let p=parseFloat(i),m=t[u++]??p;return String(+(p+(m-p)*r).toFixed(4))})}function _e(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,u=r?{...Xe[r],...t}:t,i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:p="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=false,easing:g="linear",trigger:M={},stagger:F=0,direction:S="forward",once:J=false,debug:Ee=false,axis:H="y",scrollContainer:ee,autoReverse:te=false,delay:re=0,strokeColor:x,strokeWidth:R,fillOpacity:D,waypoints:h,velocityScale:C=false,threshold:W=0,rootMargin:ne="0px",repeat:z=0,repeatDelay:ce=0,morphTo:T,clip:U,autoplay:K=false,duration:oe=1e3,native:_=true,onProgress:d,onStart:A,onComplete:b,onEnter:$,onLeave:ge,onEnterBack:Ae,onLeaveBack:Le}=u,ye=U===true?"left":typeof U=="string"?U:false,he=typeof g=="function"?g:pe[g]??pe.linear,Me=de(M.start??"top bottom"),Fe=de(M.end??"bottom top"),G=typeof ee=="string"?document.querySelector(ee):ee??null,ue=Array.isArray(x)?x[0]:null,V=Array.isArray(x)?x[1]:typeof x=="string"?x:null,B=Array.isArray(R)?R[0]:null,s=Array.isArray(R)?R[1]:typeof R=="number"?R:null,f=Array.isArray(D)?D[0]:null,L=Array.isArray(D)?D[1]:typeof D=="number"?D:null;function j(o){let a=o*100;switch(ye){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 E=ye?[]:Array.from(e.querySelectorAll(p)),I=[],P=[],Q=0,se=0,Y=false,me=false,X=0,He=false,be=-1,Re=-1,ie=false,Ce=0,Se=0,xe,Ge=null,Te=new Set,qe=-1,Ke=performance.now(),Pe=NaN;function Ne(){return G?H==="x"?G.scrollLeft:G.scrollTop:H==="x"?window.scrollX:window.scrollY}function Qe(){return G?H==="x"?G.clientWidth:G.clientHeight:H==="x"?window.innerWidth:window.innerHeight}function et(){let o=e.getBoundingClientRect(),a,w,q;if(G){let le=G.getBoundingClientRect();a=H==="x"?o.left-le.left+G.scrollLeft:o.top-le.top+G.scrollTop,w=H==="x"?o.width:o.height,q=Ne();}else a=H==="x"?o.left:o.top,w=H==="x"?o.width:o.height,q=Ne();let ae=ve({top:a,height:w},q,Qe(),Me,Fe);Q=ae.tStart,se=ae.tEnd,Ee&&process.env.NODE_ENV!=="production"&&(Ge?.remove(),Ge=At(Q,se,H));}function ht(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ye){let w=a==="reverse"?1-o:o;e.style.clipPath=j(w);return}E.forEach((w,q)=>{w.style.strokeDashoffset=a==="reverse"?`${I[q]*o}`:`${I[q]*(1-o)}`,c&&(w.style.opacity=a==="reverse"?`${1-o}`:`${o}`),ue&&V?w.style.stroke=Oe(ue,V,o):V&&(w.style.stroke=V),B!==null&&s!==null?w.style.strokeWidth=`${B+(s-B)*o}`:s!==null&&(w.style.strokeWidth=`${s}`),f!==null&&L!==null?w.style.fillOpacity=`${f+(L-f)*o}`:L!==null&&(w.style.fillOpacity=`${L}`),T&&w.tagName.toLowerCase()==="path"&&P[q]&&w.setAttribute("d",Je(P[q],T,o));});}function ze(){if(e.style.setProperty("--scroll-draw-progress","0"),ye){e.style.clipPath=j(0);return}E.forEach((o,a)=>{o.style.strokeDasharray=`${I[a]}`,o.style.strokeDashoffset=S==="reverse"?"0":`${I[a]}`,c?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),B!==null&&(o.style.strokeWidth=`${B}`),f!==null&&(o.style.fillOpacity=`${f}`),T&&o.tagName.toLowerCase()==="path"&&P[a]&&o.setAttribute("d",P[a]);});}if(E.forEach(o=>{Tt(o);let a=We(o);I.push(a),o.tagName.toLowerCase()==="path"?P.push(o.getAttribute("d")??""):P.push(""),i?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=S==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),V&&(o.style.stroke=V),s!==null&&(o.style.strokeWidth=`${s}`),L!==null&&(o.style.fillOpacity=`${L}`),T&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",T)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=S==="reverse"?"0":`${a}`,c?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),B!==null&&(o.style.strokeWidth=`${B}`),f!==null&&(o.style.fillOpacity=`${f}`));}),ye){if(i)return e.style.clipPath=j(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=j(0);}else if(i)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function bt(){return !(_===false||!xt()||!E.length||typeof g!="string"||!(g in at)||ye||H!=="y"||G||m!==1||F!==0||J||te||C!==false||T||h||z||re>0||d||A||b||$||ge||Ae||Le||x!=null||R!=null||D!=null||(M.start??"top bottom").trim()!=="top bottom"||(M.end??"bottom top").trim()!=="bottom top")}function wt(){let o=`svg-scroll-draw-${++Et}`,a=S==="reverse"?"0":"var(--ssd-len)",w=S==="reverse"?"var(--ssd-len)":"0",q=`stroke-dashoffset:${a};`,ae=`stroke-dashoffset:${w};`;c&&(q+=`opacity:${S==="reverse"?1:0};`,ae+=`opacity:${S==="reverse"?0:1};`);let le=document.createElement("style");le.setAttribute("data-svg-scroll-draw",""),le.textContent=`@keyframes ${o}{from{${q}}to{${ae}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${at[g]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(le);function fe(l,v){l.style.setProperty("--ssd-len",String(I[v])),l.style.strokeDasharray=`${I[v]}`,l.style.strokeDashoffset="",l.style.opacity="",l.style.animationPlayState="",l.classList.add(o);}E.forEach(fe);let y=false,k=-1;function O(){if(k>=0)return k;let l=e.getBoundingClientRect(),{tStart:v,tEnd:N}=ve({top:l.top,height:l.height},Ne(),Qe(),Me,Fe);return he(Z(Ne(),v,N,m))}return {destroy(){E.forEach(l=>{l.classList.remove(o),l.style.removeProperty("--ssd-len"),l.style.animationPlayState="";}),le.remove();},replay(){y=false,k=-1,E.forEach(fe);},pause(){y=true,E.forEach(l=>{l.style.animationPlayState="paused";});},resume(){y&&(y=false,E.forEach(l=>{l.style.animationPlayState="running";}));},seek(l){let v=Math.min(1,Math.max(0,l));k=v,y=true,E.forEach((N,$e)=>{N.classList.remove(o),N.style.strokeDashoffset=S==="reverse"?`${I[$e]*v}`:`${I[$e]*(1-v)}`,c&&(N.style.opacity=S==="reverse"?`${1-v}`:`${v}`);});},getProgress(){return O()}}}if(bt())return wt();function vt(){let o=Math.max(1,oe),a=0,w=0;function q(O){let l=true;if(ye){let v=Math.min(1,Math.max(0,O/o)),N=he(v);Ce=N,e.style.setProperty("--scroll-draw-progress",String(N)),e.style.clipPath=j(S==="reverse"?1-N:N),d?.(N),v<1&&(l=false);}else E.forEach((v,N)=>{let $e=N*F*o,ke=Math.min(1,Math.max(0,(O-$e)/o)),we=he(ke);v.style.strokeDashoffset=S==="reverse"?`${I[N]*we}`:`${I[N]*(1-we)}`,c&&(v.style.opacity=S==="reverse"?`${1-we}`:`${we}`),ue&&V?v.style.stroke=Oe(ue,V,we):V&&(v.style.stroke=V),B!==null&&s!==null?v.style.strokeWidth=`${B+(s-B)*we}`:s!==null&&(v.style.strokeWidth=`${s}`),f!==null&&L!==null?v.style.fillOpacity=`${f+(L-f)*we}`:L!==null&&(v.style.fillOpacity=`${L}`),T&&v.tagName.toLowerCase()==="path"&&P[N]&&v.setAttribute("d",Je(P[N],T,we)),N===0&&(d?.(we),e.style.setProperty("--scroll-draw-progress",String(we))),ke<1&&(l=false);});if(h){let v=Math.min(1,Math.max(0,O/o)),N=he(v);for(let $e in h){let ke=parseFloat($e);N>=ke&&!Te.has(ke)&&(Te.add(ke),h[$e]?.());}}return l}function ae(O){if(ie)return;let l=O-a;me||(me=true,A?.());let v=q(l);if(v&&!Y){Y=true,q(o*(1+Math.max(0,E.length-1)*F)),b?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{a=performance.now(),me=false,Y=false,Te.clear(),ze(),X=requestAnimationFrame(ae);},ce));return}v||(X=requestAnimationFrame(ae));}function le(){cancelAnimationFrame(X),clearTimeout(xe),a=performance.now(),w=0,ie=false,me=false,Y=false,Se=0,Te.clear(),ze(),X=requestAnimationFrame(ae);}let fe=new IntersectionObserver(O=>{O.forEach(l=>{l.isIntersecting&&!(J&&Y)?le():!l.isIntersecting&&!J&&!Y&&(cancelAnimationFrame(X),clearTimeout(xe),a=null);});},{root:G??null,threshold:W,rootMargin:ne}),y;function k(){clearTimeout(y),y=setTimeout(()=>{E.forEach((O,l)=>{I[l]=We(O),O.style.strokeDasharray=`${I[l]}`;});},150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),re>0?setTimeout(()=>fe.observe(e),re):fe.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),fe.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(y);},replay(){Se=0,le();},pause(){ie||(ie=true,w=performance.now()-a,cancelAnimationFrame(X));},resume(){ie&&(ie=false,a=performance.now()-w,X=requestAnimationFrame(ae));},seek(O){let l=Math.min(1,Math.max(0,O));Ce=l,ie=true,w=l*o,a=performance.now()-w,cancelAnimationFrame(X),q(w);},getProgress(){return Ce}}}if(K)return vt();et();function Ve(){if(!He||ie)return;let o=performance.now(),a=Ne(),w=m;if(C!==false){let y=o-Ke,k=y>0?Math.abs(a-(qe<0?a:qe))/y:0;w=m*Math.max(.2,1+k*(typeof C=="number"?C:1)*.04);}qe=a,Ke=o;let q=te?Re===-1||a>=Re?"forward":"reverse":S;Re=a;let ae=se-Q,le=true,fe=ae===0?0:(a-Q)/ae;if(isNaN(Pe)||(Pe<=0&&fe>0?$?.():Pe>0&&fe<=0&&Le?.(),Pe<1&&fe>=1?ge?.():Pe>=1&&fe<1&&Ae?.()),Pe=fe,ye){let y=he(Z(a,Q,se,w));J&&!te&&(be=Math.max(be,y),y=be),Ce=y,e.style.setProperty("--scroll-draw-progress",String(y));let k=q==="reverse"?1-y:y;e.style.clipPath=j(k),d?.(y),!me&&Z(a,Q,se,w)>0&&(me=true,A?.()),y>=1&&!Y?(Y=true,b?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{be=-1,me=false,Y=false,e.style.clipPath=j(0);},ce))):y<1&&!J&&(Y=false),X=requestAnimationFrame(Ve);return}if(E.forEach((y,k)=>{let O=k*F*ae,l=he(Z(a,Q+O,se+O,w));J&&!te&&(be=Math.max(be,l),l=be),Ce=l,y.style.strokeDashoffset=q==="reverse"?`${I[k]*l}`:`${I[k]*(1-l)}`,c&&(y.style.opacity=q==="reverse"?`${1-l}`:`${l}`),ue&&V?y.style.stroke=Oe(ue,V,l):V&&(y.style.stroke=V),B!==null&&s!==null?y.style.strokeWidth=`${B+(s-B)*l}`:s!==null&&(y.style.strokeWidth=`${s}`),f!==null&&L!==null?y.style.fillOpacity=`${f+(L-f)*l}`:L!==null&&(y.style.fillOpacity=`${L}`),T&&y.tagName.toLowerCase()==="path"&&P[k]&&y.setAttribute("d",Je(P[k],T,l)),k===0&&(d?.(l),e.style.setProperty("--scroll-draw-progress",String(l))),l<1&&(le=false);}),h){let y=he(Z(a,Q,se,w));for(let k in h){let O=parseFloat(k);y>=O&&!Te.has(O)&&(Te.add(O),h[k]?.());}}!me&&Z(a,Q,se,w)>0&&(me=true,A?.()),le&&!Y?(Y=true,b?.(),Se<(z==="infinite"?1/0:z??0)&&(Se++,xe=setTimeout(()=>{be=-1,me=false,Y=false,Te.clear(),ze();},ce))):!le&&!J&&(Y=false),X=requestAnimationFrame(Ve);}let je=new IntersectionObserver(o=>{o.forEach(a=>{He=a.isIntersecting,He&&!ie?X=requestAnimationFrame(Ve):cancelAnimationFrame(X);});},{root:G??null,threshold:W,rootMargin:ne}),Ye;function Be(){clearTimeout(Ye),Ye=setTimeout(()=>{E.forEach((o,a)=>{I[a]=We(o),o.style.strokeDasharray=`${I[a]}`;}),et();},150);}return window.addEventListener("resize",Be),window.addEventListener("orientationchange",Be),re>0?setTimeout(()=>je.observe(e),re):je.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(xe),je.disconnect(),window.removeEventListener("resize",Be),window.removeEventListener("orientationchange",Be),clearTimeout(Ye),Ge?.remove();},replay(){be=-1,Re=-1,qe=-1,me=false,Y=false,Se=0,ie=false,Te.clear(),clearTimeout(xe),ze();},pause(){ie=true,cancelAnimationFrame(X);},resume(){ie&&(ie=false,He&&(X=requestAnimationFrame(Ve)));},seek(o){let a=Math.min(1,Math.max(0,o));Ce=a,be=a,ie=true,cancelAnimationFrame(X),ht(a,S);},getProgress(){return Ce}}}var lt=new Map;function De(e,n){lt.set(e,n);}function Ie(e){lt.delete(e);}function Mt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ct(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let u=[],i=[],p=t[2].trim();if(p)for(let m of p.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(c?parseFloat(c[1]):0),i.push(c?c[2]:"");}n.push({fn:t[1],nums:u,units:i});}return n}function Ct(e,n,r){let t=ct(e),u=ct(n);return t.length===0||t.length!==u.length?r<1?e:n:t.map((i,p)=>{let m=u[p];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((c,g)=>`${c}${i.units[g]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,g)=>`${c}${m.units[g]}`).join(", ")})`:`${i.fn}(${i.nums.map((c,g)=>`${c+(m.nums[g]-c)*r}${i.units[g]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),u=String(n);if(Mt(t))return Oe(t,u,r);if(t.includes("("))return Ct(t,u,r);let i=t.match(/^([-+]?[\d.]+)(.*)$/),p=u.match(/^([-+]?[\d.]+)(.*)$/);if(i&&p){let m=parseFloat(i[1]),c=parseFloat(p[1]);return `${m+(c-m)*r}${i[2]||p[2]}`}return r<1?t:u}function $t(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var mt={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Lt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Pt=0;function kt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function pt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:u={},easing:i="ease-out",speed:p=1,once:m=false,axis:c="y",scrollContainer:g,native:M=true,velocityScale:F=false,onProgress:S,onComplete:J,onEnter:Ee,onLeave:H,onEnterBack:ee,onLeaveBack:te}=n,re=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof i=="function"?i:pe[i]??pe["ease-out"],R=de(u.start??"top bottom"),D=de(u.end??"bottom top"),h=typeof g=="string"?document.querySelector(g):g??null,C=Object.entries(t).map(([s,f])=>({prop:$t(s),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function W(){let s=window.getComputedStyle(e);for(let f of C)f.from===""&&(f.from=s.getPropertyValue(f.prop).trim()||"0");}function ne(){for(let s of C)e.style.setProperty(s.prop,String(s.to));}if(re)return ne(),J?.(),r;W();function z(){if(!M||!kt()||typeof i!="string"||!(i in mt)||c!=="y"||h||m||p!==1||S||J||Ee||H||ee||te||F!==false||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let s of C)if(!Lt.has(s.prop))return false;return true}function ce(){let s=`ssd-a-${++Pt}`,f=C.map(P=>`${P.prop}:${P.from}`).join(";"),L=C.map(P=>`${P.prop}:${P.to}`).join(";"),j=document.createElement("style");j.setAttribute("data-ssd-animate",""),j.textContent=`@keyframes ${s}{from{${f}}to{${L}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${mt[i]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(j),e.classList.add(s);let E=()=>c==="x"?window.scrollX:window.scrollY,I=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(s),j.remove();},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(P){let Q=Math.min(1,Math.max(0,P));e.classList.remove(s);for(let se of C)e.style.setProperty(se.prop,ut(se.from,se.to,Q));},getProgress(){let P=e.getBoundingClientRect(),Q=E(),se=I(),{tStart:Y,tEnd:me}=ve({top:P.top,height:P.height},Q,se,R,D);return x(Z(Q,Y,me,p))}}}if(z())return ce();let T=0,U=0,K=0,oe=false,_=false,d=-1,A=0,b=false,$=NaN,ge=-1,Ae=0,Le=()=>h?c==="x"?h.scrollLeft:h.scrollTop:c==="x"?window.scrollX:window.scrollY,ye=()=>h?c==="x"?h.clientWidth:h.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function he(){let s=e.getBoundingClientRect(),f,L;if(h){let E=h.getBoundingClientRect();f=c==="x"?s.left-E.left+h.scrollLeft:s.top-E.top+h.scrollTop,L=c==="x"?s.width:s.height;}else f=c==="x"?s.left:s.top,L=c==="x"?s.width:s.height;let j=ve({top:f,height:L},Le(),ye(),R,D);T=j.tStart,U=j.tEnd;}function Me(s){e.style.setProperty("--scroll-draw-progress",String(s));for(let f of C)e.style.setProperty(f.prop,ut(f.from,f.to,s));S?.(s);}function Fe(s){if(isNaN($)){$=s;return}$<=0&&s>0?Ee?.():$>0&&s<=0&&te?.(),$<1&&s>=1?H?.():$>=1&&s<1&&ee?.(),$=s;}function G(){if(!oe||_)return;let s=performance.now(),f=Le(),L=p;if(F!==false){let I=s-Ae,P=I>0?Math.abs(f-(ge<0?f:ge))/I:0;L=p*Math.max(.2,1+P*(typeof F=="number"?F:1)*.04);}ge=f,Ae=s;let j=U===T?0:(f-T)/(U-T);Fe(j);let E=x(Z(f,T,U,L));m&&(d=Math.max(d,E),E=d),A=E,Me(E),E>=1&&!b?(b=true,J?.()):E<1&&!m&&(b=false),K=requestAnimationFrame(G);}he();{let s=x(Z(Le(),T,U,p));m&&s>0&&(d=s),A=s,Me(s);}let ue=new IntersectionObserver(s=>{s.forEach(f=>{oe=f.isIntersecting,oe&&!_?K=requestAnimationFrame(G):cancelAnimationFrame(K);});},{root:h??null}),V;function B(){clearTimeout(V),V=setTimeout(he,150);}return window.addEventListener("resize",B),window.addEventListener("orientationchange",B),ue.observe(e),De(e,{type:"animate",getProgress:()=>A,getTrigger:()=>({tStart:T,tEnd:U})}),{destroy(){cancelAnimationFrame(K),ue.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),clearTimeout(V),Ie(e);},replay(){d=-1,b=false,A=0,_=false,Me(0);},pause(){_=true,cancelAnimationFrame(K);},resume(){_&&(_=false,oe&&(K=requestAnimationFrame(G)));},seek(s){let f=Math.min(1,Math.max(0,s));A=f,d=f,_=true,cancelAnimationFrame(K),Me(f);},getProgress(){return A}}}var Ue={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ze(e,n){if(typeof window>"u")return Ue;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollCounter: element not found:",e),Ue;let t=r,{from:u=0,to:i,format:p,easing:m="ease-out",trigger:c={},once:g=true,decimals:M,onComplete:F}=n,S=M!==void 0?d=>d.toFixed(M):p??(d=>String(Math.round(d))),J=typeof m=="function"?m:pe[m]??pe["ease-out"],Ee=de(c.start??"top 80%"),H=de(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(i),F?.(),Ue;t.textContent=S(u);let te=0,re=0,x=0,R=false,D=false,h=-1,C=0,W=false,ne=()=>window.scrollY,z=()=>window.innerHeight;function ce(){let d=t.getBoundingClientRect(),A=ve({top:d.top,height:d.height},ne(),z(),Ee,H);te=A.tStart,re=A.tEnd;}function T(d){t.textContent=S(u+(i-u)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function U(){if(!R||D)return;let d=J(Z(ne(),te,re,1));g&&(h=Math.max(h,d),d=h),C=d,T(d),d>=1&&!W?(W=true,F?.()):d<1&&!g&&(W=false),x=requestAnimationFrame(U);}ce();{let d=J(Z(ne(),te,re,1));g&&d>0&&(h=d),C=d,T(d);}let K=new IntersectionObserver(d=>{d.forEach(A=>{R=A.isIntersecting,R&&!D?x=requestAnimationFrame(U):cancelAnimationFrame(x);});}),oe;function _(){clearTimeout(oe),oe=setTimeout(ce,150);}return window.addEventListener("resize",_),window.addEventListener("orientationchange",_),K.observe(t),De(t,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:te,tEnd:re})}),{destroy(){cancelAnimationFrame(x),K.disconnect(),window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_),clearTimeout(oe),Ie(t);},replay(){h=-1,W=false,C=0,D=false,T(0);},pause(){D=true,cancelAnimationFrame(x);},resume(){D&&(D=false,R&&(x=requestAnimationFrame(U)));},seek(d){let A=Math.min(1,Math.max(0,d));C=A,h=A,D=true,cancelAnimationFrame(x),T(A);},getProgress(){return C}}}function gt(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 Ot(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 ft(e){let n=gt(e),r=new Map;for(let i of n){let p=i.offsetTop;r.has(p)||r.set(p,[]),r.get(p).push(i);}let t=[],u=Array.from(r.keys()).sort((i,p)=>i-p);for(let i of u){let p=r.get(i),m=document.createElement("span");m.setAttribute("aria-hidden","true"),m.style.display="inline-block";for(let c of p)m.appendChild(c);t.push(m);}e.textContent="";for(let i of t)e.appendChild(i),e.appendChild(document.createTextNode(" "));return t}function Dt(e,n,r,t){if(r<=1||t===0)return e;let u=(r-1)*t,i=n*t,p=i+(1-u);return p<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(p-i)))}function It(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 dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollText: element not found:",e),dt;let t=r,{split:u="words",stagger:i=.04,easing:p="ease-out",from:m={opacity:0,y:24},trigger:c={},once:g=true,onComplete:M}=n,F=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof p=="function"?p:pe[p]??pe["ease-out"],J=de(c.start??"top 85%"),Ee=de(c.end??"top 40%"),H=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ee;u==="chars"?ee=Ot(t):u==="lines"?ee=ft(t):ee=gt(t);let te=ee.length;function re(b,$){m?.opacity!==void 0&&(b.style.opacity=String(m.opacity+(1-m.opacity)*$));let ge=It($,m);ge&&(b.style.transform=ge);}function x(b){t.style.setProperty("--scroll-draw-progress",String(b)),ee.forEach(($,ge)=>{let Ae=S(Dt(b,ge,te,i));re($,Ae);});}if(F)return x(1),M?.(),{destroy(){t.innerHTML=H,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let R=0,D=0,h=0,C=false,W=false,ne=-1,z=0,ce=false,T=()=>window.scrollY,U=()=>window.innerHeight;function K(){let b=t.getBoundingClientRect(),$=ve({top:b.top,height:b.height},T(),U(),J,Ee);R=$.tStart,D=$.tEnd;}function oe(){if(!C||W)return;let b=Z(T(),R,D,1);g&&(ne=Math.max(ne,b),b=ne),z=b,x(b),b>=1&&!ce?(ce=true,M?.()):b<1&&!g&&(ce=false),h=requestAnimationFrame(oe);}K();let _=new IntersectionObserver(b=>{b.forEach($=>{C=$.isIntersecting,C&&!W?h=requestAnimationFrame(oe):cancelAnimationFrame(h);});}),d;function A(){clearTimeout(d),d=setTimeout(()=>{if(u==="lines"){let b=z;t.innerHTML=H,t.setAttribute("aria-label",t.textContent??""),ee=ft(t),x(b);}K();},150);}return window.addEventListener("resize",A),window.addEventListener("orientationchange",A),_.observe(t),De(t,{type:"text",getProgress:()=>z,getTrigger:()=>({tStart:R,tEnd:D})}),{destroy(){cancelAnimationFrame(h),_.disconnect(),window.removeEventListener("resize",A),window.removeEventListener("orientationchange",A),clearTimeout(d),t.innerHTML=H,t.removeAttribute("aria-label"),Ie(t);},replay(){ne=-1,ce=false,z=0,W=false,x(0);},pause(){W=true,cancelAnimationFrame(h);},resume(){W&&(W=false,C&&(h=requestAnimationFrame(oe)));},seek(b){let $=Math.min(1,Math.max(0,b));z=$,ne=$,W=true,cancelAnimationFrame(h),x($);},getProgress(){return z}}}function Nt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let t=typeof e=="string"?document.querySelector(e):e;return t?_e(t,n):(console.warn("[svg-scroll-draw] Container not found:",e),r)}function Ft(e=document){return Array.from(e.querySelectorAll("[data-scroll-draw]")).map(n=>{let r={};try{let t=n.dataset.scrollDrawOptions??n.dataset.scrollDrawoptions??"";t&&(r=JSON.parse(t));}catch{}return _e(n,r)})}function Ht(e=document){return Array.from(e.querySelectorAll("[data-scroll-animate]")).map(n=>{let r={props:{}};try{let t=n.dataset.scrollAnimateOptions??"";t&&(r=JSON.parse(t));}catch{}return pt(n,r)})}function Rt(e=document){return Array.from(e.querySelectorAll("[data-scroll-counter]")).map(n=>{let r={};try{let t=n.dataset.scrollCounterOptions??"";t&&(r=JSON.parse(t));}catch{}return !r.to&&r.to!==0&&(process.env.NODE_ENV!=="production"&&console.warn('[svg-scroll-draw] initScrollCounter: element missing "to" in options JSON:',n),r.to=0),Ze(n,r)})}function qt(e=document){return Array.from(e.querySelectorAll("[data-scroll-text]")).map(n=>{let r={};try{let t=n.dataset.scrollTextOptions??"";t&&(r=JSON.parse(t));}catch{}return yt(n,r)})}function br(e=document){return {draw:Ft(e),animate:Ht(e),counter:Rt(e),text:qt(e)}}exports.initAll=br;exports.initScrollAnimate=Ht;exports.initScrollCounter=Rt;exports.initScrollDraw=Ft;exports.initScrollText=qt;exports.scrollDraw=Nt;