svg-scroll-draw 2.9.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +17 -10
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +42 -0
  4. package/dist/angular/index.d.ts +42 -0
  5. package/dist/angular/index.mjs +3 -3
  6. package/dist/astro/index.cjs +3 -3
  7. package/dist/astro/index.d.mts +20 -5
  8. package/dist/astro/index.d.ts +20 -5
  9. package/dist/astro/index.mjs +3 -3
  10. package/dist/cdn/svg-scroll-draw.dev.global.js +1903 -0
  11. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  12. package/dist/cinematic/index.cjs +2 -2
  13. package/dist/cinematic/index.mjs +2 -2
  14. package/dist/cli/init.js +104 -101
  15. package/dist/devtools/index.cjs +1 -1
  16. package/dist/devtools/index.mjs +1 -1
  17. package/dist/group/index.cjs +3 -3
  18. package/dist/group/index.d.mts +42 -0
  19. package/dist/group/index.d.ts +42 -0
  20. package/dist/group/index.mjs +3 -3
  21. package/dist/horizontal/index.cjs +1 -1
  22. package/dist/horizontal/index.d.mts +48 -1
  23. package/dist/horizontal/index.d.ts +48 -1
  24. package/dist/horizontal/index.mjs +1 -1
  25. package/dist/index.cjs +4 -4
  26. package/dist/index.d.mts +42 -0
  27. package/dist/index.d.ts +42 -0
  28. package/dist/index.mjs +4 -4
  29. package/dist/nuxt/index.cjs +3 -3
  30. package/dist/nuxt/index.d.mts +27 -0
  31. package/dist/nuxt/index.d.ts +27 -0
  32. package/dist/nuxt/index.mjs +3 -3
  33. package/dist/pin/index.cjs +1 -1
  34. package/dist/pin/index.mjs +1 -1
  35. package/dist/progress/index.cjs +1 -1
  36. package/dist/progress/index.d.mts +15 -0
  37. package/dist/progress/index.d.ts +15 -0
  38. package/dist/progress/index.mjs +1 -1
  39. package/dist/react/index.cjs +3 -3
  40. package/dist/react/index.d.mts +27 -0
  41. package/dist/react/index.d.ts +27 -0
  42. package/dist/react/index.mjs +3 -3
  43. package/dist/reveal/index.cjs +1 -1
  44. package/dist/reveal/index.mjs +1 -1
  45. package/dist/snap/index.cjs +1 -1
  46. package/dist/snap/index.d.mts +8 -0
  47. package/dist/snap/index.d.ts +8 -0
  48. package/dist/snap/index.mjs +1 -1
  49. package/dist/solid/index.cjs +3 -3
  50. package/dist/solid/index.d.mts +42 -0
  51. package/dist/solid/index.d.ts +42 -0
  52. package/dist/solid/index.mjs +3 -3
  53. package/dist/svelte/index.cjs +3 -3
  54. package/dist/svelte/index.d.mts +42 -0
  55. package/dist/svelte/index.d.ts +42 -0
  56. package/dist/svelte/index.mjs +3 -3
  57. package/dist/text/index.cjs +1 -1
  58. package/dist/text/index.d.mts +15 -0
  59. package/dist/text/index.d.ts +15 -0
  60. package/dist/text/index.mjs +1 -1
  61. package/dist/timeline/index.cjs +9 -9
  62. package/dist/timeline/index.d.mts +31 -0
  63. package/dist/timeline/index.d.ts +31 -0
  64. package/dist/timeline/index.mjs +9 -9
  65. package/dist/video/index.cjs +1 -1
  66. package/dist/video/index.d.mts +15 -0
  67. package/dist/video/index.d.ts +15 -0
  68. package/dist/video/index.mjs +1 -1
  69. package/dist/vue/index.cjs +3 -3
  70. package/dist/vue/index.d.mts +27 -0
  71. package/dist/vue/index.d.ts +27 -0
  72. package/dist/vue/index.mjs +3 -3
  73. package/dist/web-component/index.cjs +3 -3
  74. package/dist/web-component/index.mjs +3 -3
  75. package/package.json +40 -6
@@ -15,6 +15,21 @@ interface ScrollDrawInstance {
15
15
  seek: (progress: number) => void;
16
16
  /** Returns current draw progress (0–1). */
17
17
  getProgress: () => number;
18
+ /**
19
+ * Re-measure after a layout change: path lengths, and the scroll trigger window.
20
+ *
21
+ * The engine already re-measures on `resize`, on `orientationchange`, and via a
22
+ * `ResizeObserver` on the document element — but none of those fire for a layout
23
+ * change that leaves the document height alone, such as a tab switching, a
24
+ * sibling collapsing, or a font swapping inside a fixed-height box. Call this
25
+ * after one of those.
26
+ *
27
+ * Optional on this shared type because several instances here are fan-outs over
28
+ * other instances or SSR no-op stubs. `scrollDraw`, `scrollPin`,
29
+ * `scrollHorizontal`, `scrollDrawTimeline` and the group APIs all provide it;
30
+ * use `instance.refresh?.()` if you hold an instance of unknown origin.
31
+ */
32
+ refresh?: () => void;
18
33
  }
19
34
 
20
35
  interface ScrollProgressOptions {
@@ -1 +1 @@
1
- function X({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,t)),m=Math.sqrt(o),a=0,p=[];for(let s=0;s<r;s++){let u=Math.pow(m,s);p.push(u),a+=u;}let l=[0],h=0;for(let s=0;s<r;s++)h+=p[s]/a,l.push(h);return s=>{if(s<=0)return 0;if(s>=1)return 1;for(let u=0;u<r;u++)if(s<=l[u+1]){let b=(s-l[u])/(l[u+1]-l[u]);if(u===0)return b*(2-b);let f=1-Math.pow(o,u);return f+(1-f)*(2*b-1)*(2*b-1)}return 1}}function j({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),o=Math.max(.1,t),m=r<=1?o/4:o/(2*Math.PI)*Math.asin(1/r);return a=>a<=0?0:a>=1?1:r*Math.pow(2,-10*a)*Math.sin((a-m)*(2*Math.PI)/o)+1}var R={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:X(),elastic:j()};function F(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",o="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:o}}function q(e,t,r,o){switch(o){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function _(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function J(e,t,r){return Math.min(r,Math.max(t,e))}function L(e,t,r,o){return r===t?0:J((e-t)/(r-t)*o,0,1)}function z(e,t,r,o,m){let a=q(e.top,e.height,t,o.element)-_(o.viewport,r),p=q(e.top,e.height,t,m.element)-_(m.viewport,r);return {tStart:a,tEnd:p}}var O=new Map;function V(e,t){O.set(e,t);}function D(e){O.delete(e);}var G={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function H(e,t={}){if(typeof window>"u")return G;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollProgress: element not found:",e),G;let o=r,{variable:m="--scroll-progress",easedVariable:a="--scroll-progress-eased",trigger:p={},easing:l="linear",speed:h=1,axis:s="y",scrollContainer:u,onProgress:b}=t,f=typeof l=="function"?l:R[l]??R.linear,B=F(p.start??"top bottom"),W=F(p.end??"bottom top"),c=typeof u=="string"?document.querySelector(u):u??null,x=0,E=0,g=0,M=false,d=false,w=0,I=()=>c?s==="x"?c.scrollLeft:c.scrollTop:s==="x"?window.scrollX:window.scrollY,k=()=>c?s==="x"?c.clientWidth:c.clientHeight:s==="x"?window.innerWidth:window.innerHeight;function P(){let n=o.getBoundingClientRect(),i,y;if(c){let $=c.getBoundingClientRect();i=s==="x"?n.left-$.left+c.scrollLeft:n.top-$.top+c.scrollTop,y=s==="x"?n.width:n.height;}else i=s==="x"?n.left:n.top,y=s==="x"?n.width:n.height;let N=z({top:i,height:y},I(),k(),B,W);x=N.tStart,E=N.tEnd;}function T(n,i){o.style.setProperty(m,String(n)),a!=null&&o.style.setProperty(a,String(i)),b?.(n,i);}function S(){if(!M||d)return;let n=L(I(),x,E,h),i=f(n);w=n,T(n,i),g=requestAnimationFrame(S);}P();{let n=L(I(),x,E,h),i=f(n);w=n,T(n,i);}let C=new IntersectionObserver(n=>{n.forEach(i=>{M=i.isIntersecting,M&&!d?g=requestAnimationFrame(S):cancelAnimationFrame(g);});},{root:c??null}),A;function v(){clearTimeout(A),A=setTimeout(P,150);}return window.addEventListener("resize",v),window.addEventListener("orientationchange",v),C.observe(r),V(r,{type:"animate",getProgress:()=>w,getTrigger:()=>({tStart:x,tEnd:E})}),{destroy(){cancelAnimationFrame(g),C.disconnect(),window.removeEventListener("resize",v),window.removeEventListener("orientationchange",v),clearTimeout(A),o.style.removeProperty(m),a!=null&&o.style.removeProperty(a),D(r);},replay(){P();},pause(){d=true,cancelAnimationFrame(g);},resume(){d&&(d=false,M&&(g=requestAnimationFrame(S)));},seek(n){let i=Math.min(1,Math.max(0,n)),y=f(i);w=i,d=true,cancelAnimationFrame(g),T(i,y);},getProgress(){return w}}}export{H as scrollProgress};
1
+ function K({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),c=Math.sqrt(n),i=0,p=[];for(let o=0;o<r;o++){let u=Math.pow(c,o);p.push(u),i+=u;}let m=[0],h=0;for(let o=0;o<r;o++)h+=p[o]/i,m.push(h);return o=>{if(o<=0)return 0;if(o>=1)return 1;for(let u=0;u<r;u++)if(o<=m[u+1]){let d=(o-m[u])/(m[u+1]-m[u]);if(u===0)return d*(2-d);let f=1-Math.pow(n,u);return f+(1-f)*(2*d-1)*(2*d-1)}return 1}}function Y({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),c=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-c)*(2*Math.PI)/n)+1}var P={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:K(),elastic:Y()};function T(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function F(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function C(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function j(e,t,r){return Math.min(r,Math.max(t,e))}function R(e,t,r,n){return r===t?0:j((e-t)/(r-t)*n,0,1)}function V(e,t,r){let n=e.getBoundingClientRect(),c=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:c,scroll:0}:{top:r==="x"?n.left:n.top,height:c,scroll:r==="x"?window.scrollX:window.scrollY}}function D(e,t,r,n,c){let i=F(e.top,e.height,t,n.element)-C(n.viewport,r),p=F(e.top,e.height,t,c.element)-C(c.viewport,r);return {tStart:i,tEnd:p}}var O=Symbol.for("svg-scroll-draw.registry");function $(){let e=globalThis;return e[O]||(e[O]=new Map)}function G(e,t){$().set(e,t);}function N(e){$().delete(e);}var J=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function q(e,...t){J&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var W={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function re(e,t={}){if(typeof window>"u")return W;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return q("scrollProgress: element not found:",e),W;let n=r,{variable:c="--scroll-progress",easedVariable:i="--scroll-progress-eased",trigger:p={},easing:m="linear",speed:h=1,axis:o="y",scrollContainer:u,onProgress:d}=t,f=typeof m=="function"?m:P[m]??P.linear,z=T(p.start??"top bottom"),B=T(p.end??"bottom top"),l=typeof u=="string"?document.querySelector(u):u??null,y=0,x=0,g=0,E=false,b=false,w=0,A=()=>l?o==="x"?l.scrollLeft:l.scrollTop:o==="x"?window.scrollX:window.scrollY,k=()=>l?o==="x"?l.clientWidth:l.clientHeight:o==="x"?window.innerWidth:window.innerHeight;function v(){let s=V(n,l,o),a=D(s,s.scroll,k(),z,B);y=a.tStart,x=a.tEnd;}function S(s,a){n.style.setProperty(c,String(s)),i!=null&&n.style.setProperty(i,String(a)),d?.(s,a);}function _(){if(!E||b)return;let s=R(A(),y,x,h),a=f(s);w=s,S(s,a),g=requestAnimationFrame(_);}v();{let s=R(A(),y,x,h),a=f(s);w=s,S(s,a);}let L=new IntersectionObserver(s=>{s.forEach(a=>{E=a.isIntersecting,E&&!b?g=requestAnimationFrame(_):cancelAnimationFrame(g);});},{root:l??null}),I;function M(){clearTimeout(I),I=setTimeout(v,150);}return window.addEventListener("resize",M),window.addEventListener("orientationchange",M),L.observe(r),G(r,{type:"animate",getProgress:()=>w,getTrigger:()=>({tStart:y,tEnd:x})}),{destroy(){cancelAnimationFrame(g),L.disconnect(),window.removeEventListener("resize",M),window.removeEventListener("orientationchange",M),clearTimeout(I),n.style.removeProperty(c),i!=null&&n.style.removeProperty(i),N(r);},replay(){v();},pause(){b=true,cancelAnimationFrame(g);},resume(){b&&(b=false,E&&(g=requestAnimationFrame(_)));},seek(s){let a=Math.min(1,Math.max(0,s)),X=f(a);w=a,b=true,cancelAnimationFrame(g),S(a,X);},getProgress(){return w}}}export{re as scrollProgress};
@@ -1,3 +1,3 @@
1
- 'use strict';var _t=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var _t__default=/*#__PURE__*/_interopDefault(_t);function At({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(t),o=0,l=[];for(let y=0;y<r;y++){let L=Math.pow(i,y);l.push(L),o+=L;}let u=[0],c=0;for(let y=0;y<r;y++)c+=l[y]/o,u.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let L=0;L<r;L++)if(y<=u[L+1]){let C=(y-u[L])/(u[L+1]-u[L]);if(L===0)return C*(2-C);let S=1-Math.pow(t,L);return S+(1-S)*(2*C-1)*(2*C-1)}return 1}}function Mt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),i=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return o=>o<=0?0:o>=1?1:r*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/t)+1}var re={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:At(),elastic:Mt()};function ne(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 Ge(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 Pt(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:Pt((e-n)/(r-n)*t,0,1)}function pe(e,n,r,t,i){let o=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),l=tt(e.top,e.height,n,i.element)-rt(i.viewport,r);return {tStart:o,tEnd:l}}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),i=nt(n);return !t||!i?e:`rgb(${Math.round(t[0]+(i[0]-t[0])*r)},${Math.round(t[1]+(i[1]-t[1])*r)},${Math.round(t[2]+(i[2]-t[2])*r)})`}var ot={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 st(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var it={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 $t(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?st("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&st("Element has a fill \u2014 it may obscure the stroke animation.",e);}function kt(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 i(){let o=r==="x"?window.scrollX:window.scrollY,l=e-o,u=n-o,c=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}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:${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",i,{passive:true}),i(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let l=parseFloat(o),u=t[i++]??l;return String(+(l+(u-l)*r).toFixed(4))})}function at(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...ot[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:l="path, polyline, line, polygon, rect, circle",speed:u=1,fade:c=false,easing:y="linear",trigger:L={},stagger:C=0,direction:S="forward",once:U=false,debug:de=false,axis:F="y",scrollContainer:_,autoReverse:H=false,delay:G=0,strokeColor:x,strokeWidth:M,fillOpacity:P,waypoints:p,velocityScale:v=false,threshold:N=0,rootMargin:I="0px",repeat:E=0,repeatDelay:J=0,morphTo:T,clip:R,autoplay:D=false,duration:K=1e3,native:X=true,onProgress:d,onStart:$,onComplete:b,onEnter:h,onLeave:Y,onEnterBack:Se,onLeaveBack:xe}=i,be=R===true?"left":typeof R=="string"?R:false,we=typeof y=="function"?y:re[y]??re.linear,Ce=ne(L.start??"top bottom"),He=ne(L.end??"bottom top"),oe=typeof _=="string"?document.querySelector(_):_??null,ge=Array.isArray(x)?x[0]:null,ee=Array.isArray(x)?x[1]:typeof x=="string"?x:null,te=Array.isArray(M)?M[0]:null,a=Array.isArray(M)?M[1]:typeof M=="number"?M:null,g=Array.isArray(P)?P[0]:null,z=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function se(s){let m=s*100;switch(be){case "right":return `inset(0 0 0 ${100-m}%)`;case "top":return `inset(0 0 ${100-m}% 0)`;case "bottom":return `inset(${100-m}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-m}% 0 0)`}}let O=be?[]:Array.from(e.querySelectorAll(l)),B=[],V=[],le=0,ce=0,ie=false,ye=false,ae=0,ze=false,ve=-1,Ve=-1,ue=false,$e=0,Te=0,Ae,Ye=null,Me=new Set,qe=-1,Ke=performance.now(),Ne=NaN;function Re(){return oe?F==="x"?oe.scrollLeft:oe.scrollTop:F==="x"?window.scrollX:window.scrollY}function Qe(){return oe?F==="x"?oe.clientWidth:oe.clientHeight:F==="x"?window.innerWidth:window.innerHeight}function et(){let s=e.getBoundingClientRect(),m,A,Q;if(oe){let fe=oe.getBoundingClientRect();m=F==="x"?s.left-fe.left+oe.scrollLeft:s.top-fe.top+oe.scrollTop,A=F==="x"?s.width:s.height,Q=Re();}else m=F==="x"?s.left:s.top,A=F==="x"?s.width:s.height,Q=Re();let me=pe({top:m,height:A},Q,Qe(),Ce,He);le=me.tStart,ce=me.tEnd,de&&process.env.NODE_ENV!=="production"&&(Ye?.remove(),Ye=kt(le,ce,F));}function Et(s,m){if(e.style.setProperty("--scroll-draw-progress",String(s)),be){let A=m==="reverse"?1-s:s;e.style.clipPath=se(A);return}O.forEach((A,Q)=>{A.style.strokeDashoffset=m==="reverse"?`${B[Q]*s}`:`${B[Q]*(1-s)}`,c&&(A.style.opacity=m==="reverse"?`${1-s}`:`${s}`),ge&&ee?A.style.stroke=Oe(ge,ee,s):ee&&(A.style.stroke=ee),te!==null&&a!==null?A.style.strokeWidth=`${te+(a-te)*s}`:a!==null&&(A.style.strokeWidth=`${a}`),g!==null&&z!==null?A.style.fillOpacity=`${g+(z-g)*s}`:z!==null&&(A.style.fillOpacity=`${z}`),T&&A.tagName.toLowerCase()==="path"&&V[Q]&&A.setAttribute("d",Je(V[Q],T,s));});}function We(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=se(0);return}O.forEach((s,m)=>{s.style.strokeDasharray=`${B[m]}`,s.style.strokeDashoffset=S==="reverse"?"0":`${B[m]}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",ge&&(s.style.stroke=ge),te!==null&&(s.style.strokeWidth=`${te}`),g!==null&&(s.style.fillOpacity=`${g}`),T&&s.tagName.toLowerCase()==="path"&&V[m]&&s.setAttribute("d",V[m]);});}if(O.forEach(s=>{$t(s);let m=Ge(s);B.push(m),s.tagName.toLowerCase()==="path"?V.push(s.getAttribute("d")??""):V.push(""),o?(s.style.strokeDasharray=`${m}`,s.style.strokeDashoffset=S==="reverse"?`${m}`:"0",c&&(s.style.opacity="1"),ee&&(s.style.stroke=ee),a!==null&&(s.style.strokeWidth=`${a}`),z!==null&&(s.style.fillOpacity=`${z}`),T&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",T)):(s.style.strokeDasharray=`${m}`,s.style.strokeDashoffset=S==="reverse"?"0":`${m}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",ge&&(s.style.stroke=ge),te!==null&&(s.style.strokeWidth=`${te}`),g!==null&&(s.style.fillOpacity=`${g}`));}),be){if(o)return e.style.clipPath=se(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=se(0);}else if(o)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function St(){return !(X===false||!Ct()||!O.length||typeof y!="string"||!(y in it)||be||F!=="y"||oe||u!==1||C!==0||U||H||v!==false||T||p||E||G>0||d||$||b||h||Y||Se||xe||x!=null||M!=null||P!=null||(L.start??"top bottom").trim()!=="top bottom"||(L.end??"bottom top").trim()!=="bottom top")}function xt(){let s=`svg-scroll-draw-${++Lt}`,m=S==="reverse"?"0":"var(--ssd-len)",A=S==="reverse"?"var(--ssd-len)":"0",Q=`stroke-dashoffset:${m};`,me=`stroke-dashoffset:${A};`;c&&(Q+=`opacity:${S==="reverse"?1:0};`,me+=`opacity:${S==="reverse"?0:1};`);let fe=document.createElement("style");fe.setAttribute("data-svg-scroll-draw",""),fe.textContent=`@keyframes ${s}{from{${Q}}to{${me}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${it[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe);function he(f,k){f.style.setProperty("--ssd-len",String(B[k])),f.style.strokeDasharray=`${B[k]}`,f.style.strokeDashoffset="",f.style.opacity="",f.style.animationPlayState="",f.classList.add(s);}O.forEach(he);let w=false,q=-1;function W(){if(q>=0)return q;let f=e.getBoundingClientRect(),{tStart:k,tEnd:j}=pe({top:f.top,height:f.height},Re(),Qe(),Ce,He);return we(Z(Re(),k,j,u))}return {destroy(){O.forEach(f=>{f.classList.remove(s),f.style.removeProperty("--ssd-len"),f.style.animationPlayState="";}),fe.remove();},replay(){w=false,q=-1,O.forEach(he);},pause(){w=true,O.forEach(f=>{f.style.animationPlayState="paused";});},resume(){w&&(w=false,O.forEach(f=>{f.style.animationPlayState="running";}));},seek(f){let k=Math.min(1,Math.max(0,f));q=k,w=true,O.forEach((j,ke)=>{j.classList.remove(s),j.style.strokeDashoffset=S==="reverse"?`${B[ke]*k}`:`${B[ke]*(1-k)}`,c&&(j.style.opacity=S==="reverse"?`${1-k}`:`${k}`);});},getProgress(){return W()}}}if(St())return xt();function Tt(){let s=Math.max(1,K),m=0,A=0;function Q(W){let f=true;if(be){let k=Math.min(1,Math.max(0,W/s)),j=we(k);$e=j,e.style.setProperty("--scroll-draw-progress",String(j)),e.style.clipPath=se(S==="reverse"?1-j:j),d?.(j),k<1&&(f=false);}else O.forEach((k,j)=>{let ke=j*C*s,Ie=Math.min(1,Math.max(0,(W-ke)/s)),Ee=we(Ie);k.style.strokeDashoffset=S==="reverse"?`${B[j]*Ee}`:`${B[j]*(1-Ee)}`,c&&(k.style.opacity=S==="reverse"?`${1-Ee}`:`${Ee}`),ge&&ee?k.style.stroke=Oe(ge,ee,Ee):ee&&(k.style.stroke=ee),te!==null&&a!==null?k.style.strokeWidth=`${te+(a-te)*Ee}`:a!==null&&(k.style.strokeWidth=`${a}`),g!==null&&z!==null?k.style.fillOpacity=`${g+(z-g)*Ee}`:z!==null&&(k.style.fillOpacity=`${z}`),T&&k.tagName.toLowerCase()==="path"&&V[j]&&k.setAttribute("d",Je(V[j],T,Ee)),j===0&&(d?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Ie<1&&(f=false);});if(p){let k=Math.min(1,Math.max(0,W/s)),j=we(k);for(let ke in p){let Ie=parseFloat(ke);j>=Ie&&!Me.has(Ie)&&(Me.add(Ie),p[ke]?.());}}return f}function me(W){if(ue)return;let f=W-m;ye||(ye=true,$?.());let k=Q(f);if(k&&!ie){ie=true,Q(s*(1+Math.max(0,O.length-1)*C)),b?.(),Te<(E==="infinite"?1/0:E??0)&&(Te++,Ae=setTimeout(()=>{m=performance.now(),ye=false,ie=false,Me.clear(),We(),ae=requestAnimationFrame(me);},J));return}k||(ae=requestAnimationFrame(me));}function fe(){cancelAnimationFrame(ae),clearTimeout(Ae),m=performance.now(),A=0,ue=false,ye=false,ie=false,Te=0,Me.clear(),We(),ae=requestAnimationFrame(me);}let he=new IntersectionObserver(W=>{W.forEach(f=>{f.isIntersecting&&!(U&&ie)?fe():!f.isIntersecting&&!U&&!ie&&(cancelAnimationFrame(ae),clearTimeout(Ae),m=null);});},{root:oe??null,threshold:N,rootMargin:I}),w;function q(){clearTimeout(w),w=setTimeout(()=>{O.forEach((W,f)=>{B[f]=Ge(W),W.style.strokeDasharray=`${B[f]}`;});},150);}return window.addEventListener("resize",q),window.addEventListener("orientationchange",q),G>0?setTimeout(()=>he.observe(e),G):he.observe(e),{destroy(){cancelAnimationFrame(ae),clearTimeout(Ae),he.disconnect(),window.removeEventListener("resize",q),window.removeEventListener("orientationchange",q),clearTimeout(w);},replay(){Te=0,fe();},pause(){ue||(ue=true,A=performance.now()-m,cancelAnimationFrame(ae));},resume(){ue&&(ue=false,m=performance.now()-A,ae=requestAnimationFrame(me));},seek(W){let f=Math.min(1,Math.max(0,W));$e=f,ue=true,A=f*s,m=performance.now()-A,cancelAnimationFrame(ae),Q(A);},getProgress(){return $e}}}if(D)return Tt();et();function Be(){if(!ze||ue)return;let s=performance.now(),m=Re(),A=u;if(v!==false){let w=s-Ke,q=w>0?Math.abs(m-(qe<0?m:qe))/w:0;A=u*Math.max(.2,1+q*(typeof v=="number"?v:1)*.04);}qe=m,Ke=s;let Q=H?Ve===-1||m>=Ve?"forward":"reverse":S;Ve=m;let me=ce-le,fe=true,he=me===0?0:(m-le)/me;if(isNaN(Ne)||(Ne<=0&&he>0?h?.():Ne>0&&he<=0&&xe?.(),Ne<1&&he>=1?Y?.():Ne>=1&&he<1&&Se?.()),Ne=he,be){let w=we(Z(m,le,ce,A));U&&!H&&(ve=Math.max(ve,w),w=ve),$e=w,e.style.setProperty("--scroll-draw-progress",String(w));let q=Q==="reverse"?1-w:w;e.style.clipPath=se(q),d?.(w),!ye&&Z(m,le,ce,A)>0&&(ye=true,$?.()),w>=1&&!ie?(ie=true,b?.(),Te<(E==="infinite"?1/0:E??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,ye=false,ie=false,e.style.clipPath=se(0);},J))):w<1&&!U&&(ie=false),ae=requestAnimationFrame(Be);return}if(O.forEach((w,q)=>{let W=q*C*me,f=we(Z(m,le+W,ce+W,A));U&&!H&&(ve=Math.max(ve,f),f=ve),$e=f,w.style.strokeDashoffset=Q==="reverse"?`${B[q]*f}`:`${B[q]*(1-f)}`,c&&(w.style.opacity=Q==="reverse"?`${1-f}`:`${f}`),ge&&ee?w.style.stroke=Oe(ge,ee,f):ee&&(w.style.stroke=ee),te!==null&&a!==null?w.style.strokeWidth=`${te+(a-te)*f}`:a!==null&&(w.style.strokeWidth=`${a}`),g!==null&&z!==null?w.style.fillOpacity=`${g+(z-g)*f}`:z!==null&&(w.style.fillOpacity=`${z}`),T&&w.tagName.toLowerCase()==="path"&&V[q]&&w.setAttribute("d",Je(V[q],T,f)),q===0&&(d?.(f),e.style.setProperty("--scroll-draw-progress",String(f))),f<1&&(fe=false);}),p){let w=we(Z(m,le,ce,A));for(let q in p){let W=parseFloat(q);w>=W&&!Me.has(W)&&(Me.add(W),p[q]?.());}}!ye&&Z(m,le,ce,A)>0&&(ye=true,$?.()),fe&&!ie?(ie=true,b?.(),Te<(E==="infinite"?1/0:E??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,ye=false,ie=false,Me.clear(),We();},J))):!fe&&!U&&(ie=false),ae=requestAnimationFrame(Be);}let je=new IntersectionObserver(s=>{s.forEach(m=>{ze=m.isIntersecting,ze&&!ue?ae=requestAnimationFrame(Be):cancelAnimationFrame(ae);});},{root:oe??null,threshold:N,rootMargin:I}),Ue;function _e(){clearTimeout(Ue),Ue=setTimeout(()=>{O.forEach((s,m)=>{B[m]=Ge(s),s.style.strokeDasharray=`${B[m]}`;}),et();},150);}return window.addEventListener("resize",_e),window.addEventListener("orientationchange",_e),G>0?setTimeout(()=>je.observe(e),G):je.observe(e),{destroy(){cancelAnimationFrame(ae),clearTimeout(Ae),je.disconnect(),window.removeEventListener("resize",_e),window.removeEventListener("orientationchange",_e),clearTimeout(Ue),Ye?.remove();},replay(){ve=-1,Ve=-1,qe=-1,ye=false,ie=false,Te=0,ue=false,Me.clear(),clearTimeout(Ae),We();},pause(){ue=true,cancelAnimationFrame(ae);},resume(){ue&&(ue=false,ze&&(ae=requestAnimationFrame(Be)));},seek(s){let m=Math.min(1,Math.max(0,s));$e=m,ve=m,ue=true,cancelAnimationFrame(ae),Et(m,S);},getProgress(){return $e}}}var lt=new Map;function Pe(e,n){lt.set(e,n);}function Le(e){lt.delete(e);}function Nt(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 i=[],o=[],l=t[2].trim();if(l)for(let u of l.split(/[\s,]+/)){let c=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}n.push({fn:t[1],nums:i,units:o});}return n}function It(e,n,r){let t=ct(e),i=ct(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((o,l)=>{let u=i[l];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${u.fn}(${u.nums.map((c,y)=>`${c}${u.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(u.nums[y]-c)*r}${o.units[y]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(Nt(t))return Oe(t,i,r);if(t.includes("("))return It(t,i,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),l=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&l){let u=parseFloat(o[1]),c=parseFloat(l[1]);return `${u+(c-u)*r}${o[2]||l[2]}`}return r<1?t:i}function Ot(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"},Rt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ft=0;function Dt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ft(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:o="ease-out",speed:l=1,once:u=false,axis:c="y",scrollContainer:y,native:L=true,velocityScale:C=false,onProgress:S,onComplete:U,onEnter:de,onLeave:F,onEnterBack:_,onLeaveBack:H}=n,G=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof o=="function"?o:re[o]??re["ease-out"],M=ne(i.start??"top bottom"),P=ne(i.end??"bottom top"),p=typeof y=="string"?document.querySelector(y):y??null,v=Object.entries(t).map(([a,g])=>({prop:Ot(a),from:Array.isArray(g)?g[0]:"",to:Array.isArray(g)?g[1]:g}));function N(){let a=window.getComputedStyle(e);for(let g of v)g.from===""&&(g.from=a.getPropertyValue(g.prop).trim()||"0");}function I(){for(let a of v)e.style.setProperty(a.prop,String(a.to));}if(G)return I(),U?.(),r;N();function E(){if(!L||!Dt()||typeof o!="string"||!(o in mt)||c!=="y"||p||u||l!==1||S||U||de||F||_||H||C!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let a of v)if(!Rt.has(a.prop))return false;return true}function J(){let a=`ssd-a-${++Ft}`,g=v.map(V=>`${V.prop}:${V.from}`).join(";"),z=v.map(V=>`${V.prop}:${V.to}`).join(";"),se=document.createElement("style");se.setAttribute("data-ssd-animate",""),se.textContent=`@keyframes ${a}{from{${g}}to{${z}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${mt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(se),e.classList.add(a);let O=()=>c==="x"?window.scrollX:window.scrollY,B=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),se.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(V){let le=Math.min(1,Math.max(0,V));e.classList.remove(a);for(let ce of v)e.style.setProperty(ce.prop,ut(ce.from,ce.to,le));},getProgress(){let V=e.getBoundingClientRect(),le=O(),ce=B(),{tStart:ie,tEnd:ye}=pe({top:V.top,height:V.height},le,ce,M,P);return x(Z(le,ie,ye,l))}}}if(E())return J();let T=0,R=0,D=0,K=false,X=false,d=-1,$=0,b=false,h=NaN,Y=-1,Se=0,xe=()=>p?c==="x"?p.scrollLeft:p.scrollTop:c==="x"?window.scrollX:window.scrollY,be=()=>p?c==="x"?p.clientWidth:p.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function we(){let a=e.getBoundingClientRect(),g,z;if(p){let O=p.getBoundingClientRect();g=c==="x"?a.left-O.left+p.scrollLeft:a.top-O.top+p.scrollTop,z=c==="x"?a.width:a.height;}else g=c==="x"?a.left:a.top,z=c==="x"?a.width:a.height;let se=pe({top:g,height:z},xe(),be(),M,P);T=se.tStart,R=se.tEnd;}function Ce(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let g of v)e.style.setProperty(g.prop,ut(g.from,g.to,a));S?.(a);}function He(a){if(isNaN(h)){h=a;return}h<=0&&a>0?de?.():h>0&&a<=0&&H?.(),h<1&&a>=1?F?.():h>=1&&a<1&&_?.(),h=a;}function oe(){if(!K||X)return;let a=performance.now(),g=xe(),z=l;if(C!==false){let B=a-Se,V=B>0?Math.abs(g-(Y<0?g:Y))/B:0;z=l*Math.max(.2,1+V*(typeof C=="number"?C:1)*.04);}Y=g,Se=a;let se=R===T?0:(g-T)/(R-T);He(se);let O=x(Z(g,T,R,z));u&&(d=Math.max(d,O),O=d),$=O,Ce(O),O>=1&&!b?(b=true,U?.()):O<1&&!u&&(b=false),D=requestAnimationFrame(oe);}we();{let a=x(Z(xe(),T,R,l));u&&a>0&&(d=a),$=a,Ce(a);}let ge=new IntersectionObserver(a=>{a.forEach(g=>{K=g.isIntersecting,K&&!X?D=requestAnimationFrame(oe):cancelAnimationFrame(D);});},{root:p??null}),ee;function te(){clearTimeout(ee),ee=setTimeout(we,150);}return window.addEventListener("resize",te),window.addEventListener("orientationchange",te),ge.observe(e),Pe(e,{type:"animate",getProgress:()=>$,getTrigger:()=>({tStart:T,tEnd:R})}),{destroy(){cancelAnimationFrame(D),ge.disconnect(),window.removeEventListener("resize",te),window.removeEventListener("orientationchange",te),clearTimeout(ee),Le(e);},replay(){d=-1,b=false,$=0,X=false,Ce(0);},pause(){X=true,cancelAnimationFrame(D);},resume(){X&&(X=false,K&&(D=requestAnimationFrame(oe)));},seek(a){let g=Math.min(1,Math.max(0,a));$=g,d=g,X=true,cancelAnimationFrame(D),Ce(g);},getProgress(){return $}}}var Ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,n){if(typeof window>"u")return Ze;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),Ze;let t=r,{from:i=0,to:o,format:l,easing:u="ease-out",trigger:c={},once:y=true,decimals:L,onComplete:C}=n,S=L!==void 0?d=>d.toFixed(L):l??(d=>String(Math.round(d))),U=typeof u=="function"?u:re[u]??re["ease-out"],de=ne(c.start??"top 80%"),F=ne(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(o),C?.(),Ze;t.textContent=S(i);let H=0,G=0,x=0,M=false,P=false,p=-1,v=0,N=false,I=()=>window.scrollY,E=()=>window.innerHeight;function J(){let d=t.getBoundingClientRect(),$=pe({top:d.top,height:d.height},I(),E(),de,F);H=$.tStart,G=$.tEnd;}function T(d){t.textContent=S(i+(o-i)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function R(){if(!M||P)return;let d=U(Z(I(),H,G,1));y&&(p=Math.max(p,d),d=p),v=d,T(d),d>=1&&!N?(N=true,C?.()):d<1&&!y&&(N=false),x=requestAnimationFrame(R);}J();{let d=U(Z(I(),H,G,1));y&&d>0&&(p=d),v=d,T(d);}let D=new IntersectionObserver(d=>{d.forEach($=>{M=$.isIntersecting,M&&!P?x=requestAnimationFrame(R):cancelAnimationFrame(x);});}),K;function X(){clearTimeout(K),K=setTimeout(J,150);}return window.addEventListener("resize",X),window.addEventListener("orientationchange",X),D.observe(t),Pe(t,{type:"counter",getProgress:()=>v,getTrigger:()=>({tStart:H,tEnd:G})}),{destroy(){cancelAnimationFrame(x),D.disconnect(),window.removeEventListener("resize",X),window.removeEventListener("orientationchange",X),clearTimeout(K),Le(t);},replay(){p=-1,N=false,v=0,P=false,T(0);},pause(){P=true,cancelAnimationFrame(x);},resume(){P&&(P=false,M&&(x=requestAnimationFrame(R)));},seek(d){let $=Math.min(1,Math.max(0,d));v=$,p=$,P=true,cancelAnimationFrame(x),T($);},getProgress(){return v}}}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),dt;let t=r,{trigger:i={},easing:o="linear",once:l=false,axis:u="y",preload:c="auto",onReady:y,onComplete:L,onProgress:C}=n,S=window.matchMedia("(prefers-reduced-motion: reduce)").matches,U=typeof o=="function"?o:re[o]??re.linear,de=ne(i.start??"top top"),F=ne(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let _=n.from??0,H=n.to,G=0,x=0,M=0,P=false,p=false,v=-1,N=0,I=false,E=false,J=()=>u==="x"?window.scrollX:window.scrollY,T=()=>u==="x"?window.innerWidth:window.innerHeight;function R(){let h=t.getBoundingClientRect(),Y=u==="x"?h.left:h.top,Se=u==="x"?h.width:h.height,xe=pe({top:Y,height:Se},J(),T(),de,F);G=xe.tStart,x=xe.tEnd;}function D(h){if(!E)return;let Y=H??t.duration??0;t.currentTime=_+(Y-_)*h,t.style.setProperty("--scroll-draw-progress",String(h)),C?.(h);}function K(){if(!P||p||!E)return;let h=U(Z(J(),G,x,1));l&&(v=Math.max(v,h),h=v),N=h,D(h),h>=1&&!I?(I=true,L?.()):h<1&&!l&&(I=false),M=requestAnimationFrame(K);}function X(){if(E=true,H===void 0&&(H=t.duration),S){D(1),y?.();return}R(),y?.(),P&&!p&&(M=requestAnimationFrame(K));}t.readyState>=1?X():t.addEventListener("loadedmetadata",X,{once:true}),E||R();let d=new IntersectionObserver(h=>{h.forEach(Y=>{P=Y.isIntersecting,P&&!p&&E?M=requestAnimationFrame(K):cancelAnimationFrame(M);});}),$;function b(){clearTimeout($),$=setTimeout(R,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),d.observe(t),Pe(t,{type:"video",getProgress:()=>N,getTrigger:()=>({tStart:G,tEnd:x})}),{destroy(){cancelAnimationFrame(M),d.disconnect(),t.removeEventListener("loadedmetadata",X),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout($),Le(t);},replay(){v=-1,I=false,N=0,p=false,D(0);},pause(){p=true,cancelAnimationFrame(M);},resume(){p&&(p=false,P&&E&&(M=requestAnimationFrame(K)));},seek(h){let Y=Math.min(1,Math.max(0,h));N=Y,v=Y,p=true,cancelAnimationFrame(M),D(Y);},getProgress(){return N}}}function bt(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 Ht(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 yt(e){let n=bt(e),r=new Map;for(let o of n){let l=o.offsetTop;r.has(l)||r.set(l,[]),r.get(l).push(o);}let t=[],i=Array.from(r.keys()).sort((o,l)=>o-l);for(let o of i){let l=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block";for(let c of l)u.appendChild(c);t.push(u);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function zt(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,o=n*t,l=o+(1-i);return l<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(l-o)))}function Vt(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 ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,n={}){if(typeof window>"u")return ht;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),ht;let t=r,{split:i="words",stagger:o=.04,easing:l="ease-out",from:u={opacity:0,y:24},trigger:c={},once:y=true,onComplete:L}=n,C=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof l=="function"?l:re[l]??re["ease-out"],U=ne(c.start??"top 85%"),de=ne(c.end??"top 40%"),F=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let _;i==="chars"?_=Ht(t):i==="lines"?_=yt(t):_=bt(t);let H=_.length;function G(b,h){u?.opacity!==void 0&&(b.style.opacity=String(u.opacity+(1-u.opacity)*h));let Y=Vt(h,u);Y&&(b.style.transform=Y);}function x(b){t.style.setProperty("--scroll-draw-progress",String(b)),_.forEach((h,Y)=>{let Se=S(zt(b,Y,H,o));G(h,Se);});}if(C)return x(1),L?.(),{destroy(){t.innerHTML=F,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let M=0,P=0,p=0,v=false,N=false,I=-1,E=0,J=false,T=()=>window.scrollY,R=()=>window.innerHeight;function D(){let b=t.getBoundingClientRect(),h=pe({top:b.top,height:b.height},T(),R(),U,de);M=h.tStart,P=h.tEnd;}function K(){if(!v||N)return;let b=Z(T(),M,P,1);y&&(I=Math.max(I,b),b=I),E=b,x(b),b>=1&&!J?(J=true,L?.()):b<1&&!y&&(J=false),p=requestAnimationFrame(K);}D();let X=new IntersectionObserver(b=>{b.forEach(h=>{v=h.isIntersecting,v&&!N?p=requestAnimationFrame(K):cancelAnimationFrame(p);});}),d;function $(){clearTimeout(d),d=setTimeout(()=>{if(i==="lines"){let b=E;t.innerHTML=F,t.setAttribute("aria-label",t.textContent??""),_=yt(t),x(b);}D();},150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),X.observe(t),Pe(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:M,tEnd:P})}),{destroy(){cancelAnimationFrame(p),X.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(d),t.innerHTML=F,t.removeAttribute("aria-label"),Le(t);},replay(){I=-1,J=false,E=0,N=false,x(0);},pause(){N=true,cancelAnimationFrame(p);},resume(){N&&(N=false,v&&(p=requestAnimationFrame(K)));},seek(b){let h=Math.min(1,Math.max(0,b));E=h,I=h,N=true,cancelAnimationFrame(p),x(h);},getProgress(){return E}}}function Bt(e,n={}){let[r,t]=_t.useState(0),i=_t.useRef(n);i.current=n;let o=_t.useRef(-1);return _t.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let l=typeof e=="string"?document.querySelector(e):e.current;if(!l)return;let u=l,{axis:c="y",scrollContainer:y,trigger:L={}}=i.current,C=typeof y=="string"?document.querySelector(y):y??null,S=ne(L.start??"top bottom"),U=ne(L.end??"bottom top"),de=0,F=0,_=false,H=0;function G(){return C?c==="x"?C.scrollLeft:C.scrollTop:c==="x"?window.scrollX:window.scrollY}function x(){return C?c==="x"?C.clientWidth:C.clientHeight:c==="x"?window.innerWidth:window.innerHeight}function M(){let I=u.getBoundingClientRect(),E=G(),J=c==="x"?I.left:I.top,T=c==="x"?I.width:I.height,R=pe({top:J,height:T},E,x(),S,U);de=R.tStart,F=R.tEnd;}function P(){if(!_)return;let{speed:I=1,easing:E="linear",once:J=false}=i.current,T=typeof E=="function"?E:re[E]??re.linear,R=Z(G(),de,F,I),D=T(R);J&&(o.current=Math.max(o.current,D),D=o.current),t(D),H=requestAnimationFrame(P);}let p=new IntersectionObserver(I=>{I.forEach(E=>{_=E.isIntersecting,_?H=requestAnimationFrame(P):cancelAnimationFrame(H);});},{root:C??null,threshold:0});M(),p.observe(u);let v;function N(){clearTimeout(v),v=setTimeout(M,150);}return window.addEventListener("resize",N),window.addEventListener("orientationchange",N),()=>{cancelAnimationFrame(H),clearTimeout(v),p.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N);}},[]),r}function br({children:e,className:n,style:r,...t}){let i=_t.useRef(null);return _t.useEffect(()=>{if(!i.current)return;let o=at(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function wr({children:e,className:n,style:r,...t}){let i=_t.useRef(null);return _t.useEffect(()=>{if(!i.current)return;let o=ft(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function vr({className:e,style:n,...r}){let t=_t.useRef(null);return _t.useEffect(()=>{if(!t.current)return;let i=pt(t.current,r);return ()=>i.destroy()},[]),jsxRuntime.jsx("span",{ref:t,className:e,style:n})}function Er({src:e,className:n,style:r,muted:t=true,playsInline:i=true,...o}){let l=_t.useRef(null);return _t.useEffect(()=>{if(!l.current)return;let u=gt(l.current,o);return ()=>u.destroy()},[]),jsxRuntime.jsx("video",{ref:l,src:e,className:n,style:r,muted:t,playsInline:i,preload:"auto"})}function Sr({children:e,as:n="p",className:r,style:t,...i}){let o=_t.useRef(null);return _t.useEffect(()=>{if(!o.current)return;let l=wt(o.current,i);return ()=>l.destroy()},[]),_t__default.default.createElement(n,{ref:o,className:r,style:t},e)}exports.ScrollAnimate=wr;exports.ScrollCounter=vr;exports.ScrollDraw=br;exports.ScrollText=Sr;exports.ScrollVideo=Er;exports.useScrollDrawProgress=Bt;
1
+ 'use strict';var pr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var pr__default=/*#__PURE__*/_interopDefault(pr);function Wt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(t),o=0,a=[];for(let p=0;p<r;p++){let T=Math.pow(i,p);a.push(T),o+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=a[p]/o,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let R=(p-u[T])/(u[T+1]-u[T]);if(T===0)return R*(2-R);let L=1-Math.pow(t,T);return L+(1-L)*(2*R-1)*(2*R-1)}return 1}}function Bt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),i=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return o=>o<=0?0:o>=1?1:r*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/t)+1}var Q={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:Wt(),elastic:Bt()};function ne(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 ht(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 bt(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 Ve(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 Gt(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:Gt((e-n)/(r-n)*t,0,1)}function Je(e,n,r){let t=e.getBoundingClientRect(),i=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:i,scroll:0}:{top:r==="x"?t.left:t.top,height:i,scroll:r==="x"?window.scrollX:window.scrollY}}function be(e,n,r,t,i){let o=ht(e.top,e.height,n,t.element)-bt(t.viewport,r),a=ht(e.top,e.height,n,i.element)-bt(i.viewport,r);return {tStart:o,tEnd:a}}function wt(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 _e(e,n,r){let t=wt(e),i=wt(n);return !t||!i?e:`rgb(${Math.round(t[0]+(i[0]-t[0])*r)},${Math.round(t[1]+(i[1]-t[1])*r)},${Math.round(t[2]+(i[2]-t[2])*r)})`}var vt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ke=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Ke&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Ut="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",jt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function Xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Yt(e){let n=[];for(let r=0;r<St;r++){let t=r/(St-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return Ut;case "ease-out":return jt;case "ease-in-out":return Xt()?Yt(Q["ease-in-out"]):null;default:return null}}var Et=Symbol.for("svg-scroll-draw.registry");function Tt(){let e=globalThis;return e[Et]||(e[Et]=new Map)}function Le(e,n){Tt().set(e,n);}function Ce(e){Tt().delete(e);}var Qt=0;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Jt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?we("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Kt(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 i(){let o=r==="x"?window.scrollX:window.scrollY,a=e-o,u=n-o,m=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${m?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",i,{passive:true}),i(),{el:t,destroy(){window.removeEventListener("scroll",i),t.remove();}}}var xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,At=/[MmLlHhVvCcSsQqTtAaZz]/g;function er(e,n,r){if(!Ke)return;let t=(e.match(At)??[]).join("").toUpperCase(),i=(n.match(At)??[]).join("").toUpperCase(),o=(e.match(xt)??[]).length,a=(n.match(xt)??[]).length;if(t!==i){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}o!==a&&we(`morphTo: coordinate count differs (${o} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function at(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let a=parseFloat(o),u=t[i++]??a;return String(+(a+(u-a)*r).toFixed(4))})}function Mt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...vt[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:R=0,direction:L="forward",once:te=false,debug:ve=false,axis:N="y",scrollContainer:q,autoReverse:D=false,delay:H=0,strokeColor:M,strokeWidth:C,fillOpacity:A,waypoints:w,velocityScale:$=false,threshold:k=0,rootMargin:v="0px",repeat:y=0,repeatDelay:U=0,morphTo:I,clip:W,autoplay:j=false,duration:oe=1e3,native:ue=true,onProgress:h,onStart:P,onComplete:g,onEnter:d,onLeave:z,onEnterBack:pe,onLeaveBack:Te}=i,me=W===true?"left":typeof W=="string"?W:false,xe=typeof p=="function"?p:Q[p]??Q.linear,$e=ne(T.start??"top bottom"),He=ne(T.end??"bottom top"),Se=typeof q=="string"?document.querySelector(q):q??null,Ee=Array.isArray(M)?M[0]:null,ie=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ae=Array.isArray(C)?C[0]:null,J=Array.isArray(C)?C[1]:typeof C=="number"?C:null,fe=Array.isArray(A)?A[0]:null,re=Array.isArray(A)?A[1]:typeof A=="number"?A:null;function Re(s){let c=s*100;switch(me){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let B=me?[]:Array.from(e.querySelectorAll(a)),O=[],l=[],f=0,de=0,V=false,G=false,X=0,Me=false,ge=-1,se=-1,K=false,ye=0,Ie=0,De,rt=null;function ct(){rt?.destroy(),rt=null;}let Fe=new Set,ut=NaN,Ne=true,Ue=-1,mt=performance.now(),ze=NaN;function nt(){return Se?N==="x"?Se.scrollLeft:Se.scrollTop:N==="x"?window.scrollX:window.scrollY}function ft(){return Se?N==="x"?Se.clientWidth:Se.clientHeight:N==="x"?window.innerWidth:window.innerHeight}function pt(){let s=Je(e,Se,N);return be(s,s.scroll,ft(),$e,He)}function dt(){(({tStart:f,tEnd:de}=pt())),ve&&Ke&&(ct(),rt=Kt(f,de,N));}function ot(s,c=pt){Le(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:c});let E=s.destroy;return s.destroy=()=>{E.call(s),Ce(e);},s}function zt(s,c){if(e.style.setProperty("--scroll-draw-progress",String(s)),me){let E=c==="reverse"?1-s:s;e.style.clipPath=Re(E);return}B.forEach((E,le)=>{E.style.strokeDashoffset=c==="reverse"?`${O[le]*s}`:`${O[le]*(1-s)}`,m&&(E.style.opacity=c==="reverse"?`${1-s}`:`${s}`),Ee&&ie?E.style.stroke=_e(Ee,ie,s):ie&&(E.style.stroke=ie),ae!==null&&J!==null?E.style.strokeWidth=`${ae+(J-ae)*s}`:J!==null&&(E.style.strokeWidth=`${J}`),fe!==null&&re!==null?E.style.fillOpacity=`${fe+(re-fe)*s}`:re!==null&&(E.style.fillOpacity=`${re}`),I&&E.tagName.toLowerCase()==="path"&&l[le]&&E.setAttribute("d",at(l[le],I,s));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),me){e.style.clipPath=Re(0);return}B.forEach((s,c)=>{s.style.strokeDasharray=`${O[c]}`,s.style.strokeDashoffset=L==="reverse"?"0":`${O[c]}`,m?s.style.opacity=L==="reverse"?"1":"0":s.style.opacity="",Ee&&(s.style.stroke=Ee),ae!==null&&(s.style.strokeWidth=`${ae}`),fe!==null&&(s.style.fillOpacity=`${fe}`),I&&s.tagName.toLowerCase()==="path"&&l[c]&&s.setAttribute("d",l[c]);});}if(B.forEach(s=>{Jt(s);let c=Ve(s);O.push(c);let E=s.tagName.toLowerCase()==="path";E?l.push(s.getAttribute("d")??""):l.push(""),I&&(E?er(l[l.length-1],I,s):we(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),o?(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=L==="reverse"?`${c}`:"0",m&&(s.style.opacity="1"),ie&&(s.style.stroke=ie),J!==null&&(s.style.strokeWidth=`${J}`),re!==null&&(s.style.fillOpacity=`${re}`),I&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",I)):(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=L==="reverse"?"0":`${c}`,m?s.style.opacity=L==="reverse"?"1":"0":s.style.opacity="",Ee&&(s.style.stroke=Ee),ae!==null&&(s.style.strokeWidth=`${ae}`),fe!==null&&(s.style.fillOpacity=`${fe}`));}),me){if(o)return e.style.clipPath=Re(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Re(0);}else if(o)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof p=="string"?et(p):null;function Vt(){return !(ue===false||!Zt()||!B.length||!gt||me||N!=="y"||Se||u!==1||R!==0||te||D||$!==false||I||w||y||H>0||h||P||g||d||z||pe||Te||M!=null||C!=null||A!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function _t(){let s=++Qt,c=`svg-scroll-draw-${s}`,E=`svg-scroll-draw-host-${s}`,le=`--svg-scroll-draw-${s}`,Oe=L==="reverse"?"0":"var(--ssd-len)",ke=L==="reverse"?"var(--ssd-len)":"0",Pe=`stroke-dashoffset:${Oe};`,x=`stroke-dashoffset:${ke};`;m&&(Pe+=`opacity:${L==="reverse"?1:0};`,x+=`opacity:${L==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${c}{from{${Pe}}to{${x}}}.${E}{view-timeline-name:${le};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${le};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(E);function ce(b,ee){b.style.setProperty("--ssd-len",String(O[ee])),b.style.strokeDasharray=`${O[ee]}`,b.style.strokeDashoffset="",b.style.opacity="",b.style.animationPlayState="",b.classList.add(c);}B.forEach(ce);let S=false,_=-1;function Y(){if(_>=0)return _;let b=e.getBoundingClientRect(),{tStart:ee,tEnd:Ae}=be({top:b.top,height:b.height},nt(),ft(),$e,He);return xe(Z(nt(),ee,Ae,u))}return {destroy(){e.classList.remove(E),B.forEach(b=>{b.classList.remove(c),b.style.removeProperty("--ssd-len"),b.style.animationPlayState="";}),F.remove();},replay(){S=false,_=-1,B.forEach(ce);},pause(){S=true,B.forEach(b=>{b.style.animationPlayState="paused";});},resume(){S&&(S=false,B.forEach(b=>{b.style.animationPlayState="running";}));},seek(b){let ee=Math.min(1,Math.max(0,b));_=ee,S=true,B.forEach((Ae,he)=>{Ae.classList.remove(c),Ae.style.strokeDashoffset=L==="reverse"?`${O[he]*ee}`:`${O[he]*(1-ee)}`,m&&(Ae.style.opacity=L==="reverse"?`${1-ee}`:`${ee}`);});},getProgress(){return Y()},refresh(){B.forEach((b,ee)=>{O[ee]=Ve(b),b.style.setProperty("--ssd-len",String(O[ee])),b.style.strokeDasharray=`${O[ee]}`;});}}}if(Vt())return ot(_t());function qt(){let s=Math.max(1,oe),c=0,E=0,le=false;function Oe(S){let _=true;if(me){let Y=Math.min(1,Math.max(0,S/s)),b=xe(Y);ye=b,e.style.setProperty("--scroll-draw-progress",String(b)),e.style.clipPath=Re(L==="reverse"?1-b:b),h?.(b),Y<1&&(_=false);}else B.forEach((Y,b)=>{let ee=b*R*s,Ae=Math.min(1,Math.max(0,(S-ee)/s)),he=xe(Ae);Y.style.strokeDashoffset=L==="reverse"?`${O[b]*he}`:`${O[b]*(1-he)}`,m&&(Y.style.opacity=L==="reverse"?`${1-he}`:`${he}`),Ee&&ie?Y.style.stroke=_e(Ee,ie,he):ie&&(Y.style.stroke=ie),ae!==null&&J!==null?Y.style.strokeWidth=`${ae+(J-ae)*he}`:J!==null&&(Y.style.strokeWidth=`${J}`),fe!==null&&re!==null?Y.style.fillOpacity=`${fe+(re-fe)*he}`:re!==null&&(Y.style.fillOpacity=`${re}`),I&&Y.tagName.toLowerCase()==="path"&&l[b]&&Y.setAttribute("d",at(l[b],I,he)),b===0&&(ye=he,h?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Ae<1&&(_=false);});if(w){let Y=Math.min(1,Math.max(0,S/s)),b=xe(Y);for(let ee in w){let Ae=parseFloat(ee);b>=Ae&&!Fe.has(Ae)&&(Fe.add(Ae),w[ee]?.());}}return _}function ke(S){if(K)return;let _=S-c;G||(G=true,P?.());let Y=Oe(_);if(Y&&!V){V=true,Oe(s*(1+Math.max(0,B.length-1)*R)),g?.(),Ie<(y==="infinite"?1/0:y??0)&&(Ie++,De=setTimeout(()=>{c=performance.now(),G=false,V=false,Fe.clear(),je(),X=requestAnimationFrame(ke);},U));return}Y||(X=requestAnimationFrame(ke));}function Pe(){cancelAnimationFrame(X),clearTimeout(De),c=performance.now(),E=0,K=false,G=false,V=false,Ie=0,le=true,ye=0,Fe.clear(),je(),X=requestAnimationFrame(ke);}let x=new IntersectionObserver(S=>{S.forEach(_=>{_.isIntersecting&&!(te&&V)?Pe():!_.isIntersecting&&!te&&!V&&(cancelAnimationFrame(X),clearTimeout(De),le=false);});},{root:Se??null,threshold:k,rootMargin:v}),F;function ce(){clearTimeout(F),F=setTimeout(()=>{B.forEach((S,_)=>{O[_]=Ve(S),S.style.strokeDasharray=`${O[_]}`;});},150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),H>0?setTimeout(()=>x.observe(e),H):x.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(De),x.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(F);},replay(){Ie=0,Pe();},pause(){K||!le||(K=true,E=performance.now()-c,cancelAnimationFrame(X));},resume(){K&&(K=false,le=true,c=performance.now()-E,X=requestAnimationFrame(ke));},seek(S){let _=Math.min(1,Math.max(0,S));ye=_,K=true,E=_*s,c=performance.now()-E,cancelAnimationFrame(X),Oe(E);},getProgress(){return ye},refresh(){clearTimeout(F),B.forEach((S,_)=>{O[_]=Ve(S),S.style.strokeDasharray=`${O[_]}`;});}}}if(j)return ot(qt());dt();function Xe(){if(!Me||K)return;let s=performance.now(),c=nt();if(!Ne&&$===false&&c===ut){X=requestAnimationFrame(Xe);return}Ne=false,ut=c;let E=u;if($!==false){let x=s-mt,F=x>0?Math.abs(c-(Ue<0?c:Ue))/x:0;E=u*Math.max(.2,1+F*(typeof $=="number"?$:1)*.04);}Ue=c,mt=s;let le=D?se===-1||c>=se?"forward":"reverse":L;se=c;let Oe=de-f,ke=true,Pe=Oe===0?0:(c-f)/Oe;if(isNaN(ze)||(ze<=0&&Pe>0?d?.():ze>0&&Pe<=0&&Te?.(),ze<1&&Pe>=1?z?.():ze>=1&&Pe<1&&pe?.()),ze=Pe,me){let x=xe(Z(c,f,de,E));te&&!D&&(ge=Math.max(ge,x),x=ge),ye=x,e.style.setProperty("--scroll-draw-progress",String(x));let F=le==="reverse"?1-x:x;e.style.clipPath=Re(F),h?.(x),!G&&Z(c,f,de,E)>0&&(G=true,P?.()),x>=1&&!V?(V=true,g?.(),Ie<(y==="infinite"?1/0:y??0)&&(Ie++,De=setTimeout(()=>{ge=-1,G=false,V=false,e.style.clipPath=Re(0);},U))):x<1&&!te&&(V=false),X=requestAnimationFrame(Xe);return}if(B.forEach((x,F)=>{let ce=F*R*Oe,S=xe(Z(c,f+ce,de+ce,E));te&&!D&&(ge=Math.max(ge,S),S=ge),ye=S,x.style.strokeDashoffset=le==="reverse"?`${O[F]*S}`:`${O[F]*(1-S)}`,m&&(x.style.opacity=le==="reverse"?`${1-S}`:`${S}`),Ee&&ie?x.style.stroke=_e(Ee,ie,S):ie&&(x.style.stroke=ie),ae!==null&&J!==null?x.style.strokeWidth=`${ae+(J-ae)*S}`:J!==null&&(x.style.strokeWidth=`${J}`),fe!==null&&re!==null?x.style.fillOpacity=`${fe+(re-fe)*S}`:re!==null&&(x.style.fillOpacity=`${re}`),I&&x.tagName.toLowerCase()==="path"&&l[F]&&x.setAttribute("d",at(l[F],I,S)),F===0&&(h?.(S),e.style.setProperty("--scroll-draw-progress",String(S))),S<1&&(ke=false);}),w){let x=xe(Z(c,f,de,E));for(let F in w){let ce=parseFloat(F);x>=ce&&!Fe.has(ce)&&(Fe.add(ce),w[F]?.());}}!G&&Z(c,f,de,E)>0&&(G=true,P?.()),ke&&!V?(V=true,g?.(),Ie<(y==="infinite"?1/0:y??0)&&(Ie++,De=setTimeout(()=>{ge=-1,G=false,V=false,Fe.clear(),je(),Ne=true;},U))):!ke&&!te&&(V=false),X=requestAnimationFrame(Xe);}let st=false;function Ye(){st||(st=true,X=requestAnimationFrame(function(){Xe();}));}function Qe(){st=false,cancelAnimationFrame(X);}let it=new IntersectionObserver(s=>{s.forEach(c=>{Me=c.isIntersecting,Me&&!K?(Ne=true,Ye()):Qe();});},{root:Se??null,threshold:k,rootMargin:v});function yt(){B.forEach((s,c)=>{O[c]=Ve(s),s.style.strokeDasharray=`${O[c]}`;}),dt(),Ne=true;}let Ze;function qe(){clearTimeout(Ze),Ze=setTimeout(yt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),H>0?setTimeout(()=>it.observe(e),H):it.observe(e),ot({destroy(){cancelAnimationFrame(X),clearTimeout(De),Qe(),it.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Ze),ct();},replay(){ge=-1,se=-1,Ue=-1,G=false,V=false,Ie=0,K=false,ye=0,Fe.clear(),clearTimeout(De),je(),Ne=true,Me&&Ye();},pause(){K=true,Qe();},resume(){K&&(K=false,Ne=true,Me&&Ye());},seek(s){let c=Math.min(1,Math.max(0,s));ye=c,ge=c,K=true,Qe(),zt(c,L),Ne=true;},getProgress(){return ye},refresh(){clearTimeout(Ze),yt(),Me&&!K&&Ye();}},()=>({tStart:f,tEnd:de}))}function tr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Pt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let i=[],o=[],a=t[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(m?parseFloat(m[1]):0),o.push(m?m[2]:"");}n.push({fn:t[1],nums:i,units:o});}return n}function rr(e,n,r){let t=Pt(e),i=Pt(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((o,a)=>{let u=i[a];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((m,p)=>`${m}${o.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${o.fn}(${o.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${o.units[p]}`).join(", ")})`}).join(" ")}function Lt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(tr(t))return _e(t,i,r);if(t.includes("("))return rr(t,i,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),a=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&a){let u=parseFloat(o[1]),m=parseFloat(a[1]);return `${u+(m-u)*r}${o[2]||a[2]}`}return r<1?t:i}function nr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var or=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),sr=0,Ct="--scroll-draw-progress";function ir(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function $t(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:o="ease-out",speed:a=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:R=false,respectReducedMotion:L=true,triggerElement:te,onProgress:ve,onComplete:N,onEnter:q,onLeave:D,onEnterBack:H,onLeaveBack:M}=n,C=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof o=="function"?o:Q[o]??Q["ease-out"],w=ne(i.start??"top bottom"),$=ne(i.end??"bottom top"),k=te??e,v=typeof p=="string"?document.querySelector(p):p??null,y=Object.entries(t).map(([l,f])=>({prop:nr(l),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function U(){let l=window.getComputedStyle(e);for(let f of y)f.from===""&&(f.from=l.getPropertyValue(f.prop).trim()||"0");}function I(){for(let l of y)e.style.setProperty(l.prop,String(l.to));}let W=new Map;for(let l of [...y.map(f=>f.prop),Ct])W.set(l,e.style.getPropertyValue(l));function j(){for(let[l,f]of W)f?e.style.setProperty(l,f):e.style.removeProperty(l);}if(C)return I(),N?.(),{...r,destroy:j,getProgress:()=>1};U();let oe=typeof o=="string"?et(o):null;function ue(){if(!T||!ir()||!oe||m!=="y"||v||k!==e||u||a!==1||ve||N||q||D||H||M||R!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let l of y)if(!or.has(l.prop))return false;return true}function h(){let l=`ssd-a-${++sr}`,f=y.map(se=>`${se.prop}:${se.from}`).join(";"),de=y.map(se=>`${se.prop}:${se.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${l}{from{${f}}to{${de}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${oe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(l);let G=()=>m==="x"?window.scrollX:window.scrollY,X=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let se=e.getBoundingClientRect();return be({top:se.top,height:se.height},G(),X(),w,$)};Le(e,{type:"animate",getProgress:()=>ge.getProgress(),getTrigger:Me});let ge={destroy(){e.classList.remove(l),V.remove(),e.style.animationPlayState="",j(),Ce(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(se){let K=Math.min(1,Math.max(0,se));e.classList.remove(l);for(let ye of y)e.style.setProperty(ye.prop,Lt(ye.from,ye.to,K));},getProgress(){let{tStart:se,tEnd:K}=Me();return A(Z(G(),se,K,a))}};return ge}if(ue())return h();let P=0,g=0,d=0,z=false,pe=false,Te=-1,me=0,xe=false,$e=NaN,He=-1,Se=0,Ee=()=>v?m==="x"?v.scrollLeft:v.scrollTop:m==="x"?window.scrollX:window.scrollY,ie=()=>v?m==="x"?v.clientWidth:v.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ae(){let l=Je(k,v,m),f=be(l,l.scroll,ie(),w,$);P=f.tStart,g=f.tEnd;}function J(l){e.style.setProperty(Ct,String(l));for(let f of y)e.style.setProperty(f.prop,Lt(f.from,f.to,l));ve?.(l);}function fe(l){if(isNaN($e)){$e=l;return}$e<=0&&l>0?q?.():$e>0&&l<=0&&M?.(),$e<1&&l>=1?D?.():$e>=1&&l<1&&H?.(),$e=l;}function re(){if(!z||pe)return;let l=performance.now(),f=Ee(),de=a;if(R!==false){let X=l-Se,Me=X>0?Math.abs(f-(He<0?f:He))/X:0;de=a*Math.max(.2,1+Me*(typeof R=="number"?R:1)*.04);}He=f,Se=l;let V=g===P?0:(f-P)/(g-P);fe(V);let G=A(Z(f,P,g,de));u&&(Te=Math.max(Te,G),G=Te),me=G,J(G),G>=1&&!xe?(xe=true,N?.()):G<1&&!u&&(xe=false),d=requestAnimationFrame(re);}ae(),g===P&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let l=A(Z(Ee(),P,g,a));u&&l>0&&(Te=l),me=l,J(l);}let Re=new IntersectionObserver(l=>{l.forEach(f=>{z=f.isIntersecting,z&&!pe?d=requestAnimationFrame(re):cancelAnimationFrame(d);});},{root:v??null}),B;function O(){clearTimeout(B),B=setTimeout(ae,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Re.observe(e),Le(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:P,tEnd:g})}),{destroy(){cancelAnimationFrame(d),Re.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(B),j(),Ce(e);},replay(){Te=-1,xe=false,me=0,pe=false,J(0);},pause(){pe=true,cancelAnimationFrame(d);},resume(){pe&&(pe=false,z&&(d=requestAnimationFrame(re)));},seek(l){let f=Math.min(1,Math.max(0,l));me=f,Te=f,pe=true,cancelAnimationFrame(d),J(f);},getProgress(){return me}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Rt(e,n){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),lt;let t=r,{from:i=0,to:o,format:a,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:R}=n,L=T!==void 0?h=>h.toFixed(T):a??(h=>String(Math.round(h))),te=typeof u=="function"?u:Q[u]??Q["ease-out"],ve=ne(m.start??"top 80%"),N=ne(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(o),R?.(),lt;let D=0,H=0,M=0,C=false,A=false,w=-1,$=0,k=false,v=()=>window.scrollY,y=()=>window.innerHeight;function U(){let h=t.getBoundingClientRect(),P=be({top:h.top,height:h.height},v(),y(),ve,N);D=P.tStart,H=P.tEnd;}function I(h){t.textContent=L(i+(o-i)*h),t.style.setProperty("--scroll-draw-progress",String(h));}function W(){if(!C||A)return;let h=te(Z(v(),D,H,1));p&&(w=Math.max(w,h),h=w),$=h,I(h),h>=1&&!k?(k=true,R?.()):h<1&&!p&&(k=false),M=requestAnimationFrame(W);}U();{let h=te(Z(v(),D,H,1));p&&h>0&&(w=h),$=h,I(h);}let j=new IntersectionObserver(h=>{h.forEach(P=>{C=P.isIntersecting,C&&!A?M=requestAnimationFrame(W):cancelAnimationFrame(M);});}),oe;function ue(){clearTimeout(oe),oe=setTimeout(U,150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),j.observe(t),Le(t,{type:"counter",getProgress:()=>$,getTrigger:()=>({tStart:D,tEnd:H})}),{destroy(){cancelAnimationFrame(M),j.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(oe),Ce(t);},replay(){w=-1,k=false,$=0,A=false,I(0);},pause(){A=true,cancelAnimationFrame(M);},resume(){A&&(A=false,C&&(M=requestAnimationFrame(W)));},seek(h){let P=Math.min(1,Math.max(0,h));$=P,w=P,A=true,cancelAnimationFrame(M),I(P);},getProgress(){return $}}}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function It(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),kt;let t=r,{trigger:i={},easing:o="linear",once:a=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:R}=n,L=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof o=="function"?o:Q[o]??Q.linear,ve=ne(i.start??"top top"),N=ne(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let q=n.from??0,D=n.to,H=0,M=0,C=0,A=false,w=false,$=-1,k=0,v=false,y=false,U=()=>u==="x"?window.scrollX:window.scrollY,I=()=>u==="x"?window.innerWidth:window.innerHeight;function W(){let d=t.getBoundingClientRect(),z=u==="x"?d.left:d.top,pe=u==="x"?d.width:d.height,Te=be({top:z,height:pe},U(),I(),ve,N);H=Te.tStart,M=Te.tEnd;}function j(d){if(!y)return;let z=D??t.duration??0;t.currentTime=q+(z-q)*d,t.style.setProperty("--scroll-draw-progress",String(d)),R?.(d);}function oe(){if(!A||w||!y)return;let d=te(Z(U(),H,M,1));a&&($=Math.max($,d),d=$),k=d,j(d),d>=1&&!v?(v=true,T?.()):d<1&&!a&&(v=false),C=requestAnimationFrame(oe);}function ue(){if(y=true,D===void 0&&(D=t.duration),L){j(1),p?.();return}W(),p?.(),A&&!w&&(C=requestAnimationFrame(oe));}t.readyState>=1?ue():t.addEventListener("loadedmetadata",ue,{once:true}),y||W();let h=new IntersectionObserver(d=>{d.forEach(z=>{A=z.isIntersecting,A&&!w&&y?C=requestAnimationFrame(oe):cancelAnimationFrame(C);});}),P;function g(){clearTimeout(P),P=setTimeout(W,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),h.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:H,tEnd:M})}),{destroy(){cancelAnimationFrame(C),h.disconnect(),t.removeEventListener("loadedmetadata",ue),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(P),Ce(t);},replay(){$=-1,v=false,k=0,w=false,j(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,A&&y&&(C=requestAnimationFrame(oe)));},seek(d){let z=Math.min(1,Math.max(0,d));k=z,$=z,w=true,cancelAnimationFrame(C),j(z);},getProgress(){return k}}}function Ft(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 ar(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 Ot(e){let n=Ft(e),r=new Map;for(let o of n){let a=o.offsetTop;r.has(a)||r.set(a,[]),r.get(a).push(o);}let t=[],i=Array.from(r.keys()).sort((o,a)=>o-a);for(let o of i){let a=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",a.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<a.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((o,a)=>{e.appendChild(o),a<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function lr(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,o=n*t,a=o+(1-i);return a<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(a-o)))}function cr(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 Nt(e,n={}){if(typeof window>"u")return Dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Dt;let t=r,{split:i="words",stagger:o=.04,easing:a="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof a=="function"?a:Q[a]??Q["ease-out"],te=ne(m.start??"top 85%"),ve=ne(m.end??"top 40%"),N=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let q;i==="chars"?q=ar(t):i==="lines"?q=Ot(t):q=Ft(t);let D=q.length;function H(g,d){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*d));let z=cr(d,u);z&&(g.style.transform=z);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),q.forEach((d,z)=>{let pe=L(lr(g,z,D,o));H(d,pe);});}if(R)return M(1),T?.(),{destroy(){t.innerHTML=N,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let C=0,A=0,w=0,$=false,k=false,v=-1,y=0,U=false,I=()=>window.scrollY,W=()=>window.innerHeight;function j(){let g=t.getBoundingClientRect(),d=be({top:g.top,height:g.height},I(),W(),te,ve);C=d.tStart,A=d.tEnd;}function oe(){if(!$||k)return;let g=Z(I(),C,A,1);p&&(v=Math.max(v,g),g=v),y=g,M(g),g>=1&&!U?(U=true,T?.()):g<1&&!p&&(U=false),w=requestAnimationFrame(oe);}j();let ue=new IntersectionObserver(g=>{g.forEach(d=>{$=d.isIntersecting,$&&!k?w=requestAnimationFrame(oe):cancelAnimationFrame(w);});}),h;function P(){clearTimeout(h),h=setTimeout(()=>{if(i==="lines"){let g=y;t.innerHTML=N,t.setAttribute("aria-label",t.textContent??""),q=Ot(t),M(g);}j();},150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),ue.observe(t),Le(t,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:C,tEnd:A})}),{destroy(){cancelAnimationFrame(w),ue.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(h),t.innerHTML=N,t.removeAttribute("aria-label"),Ce(t);},replay(){v=-1,U=false,y=0,k=false,M(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,$&&(w=requestAnimationFrame(oe)));},seek(g){let d=Math.min(1,Math.max(0,g));y=d,v=d,k=true,cancelAnimationFrame(w),M(d);},getProgress(){return y}}}function fr(e,n={}){let[r,t]=pr.useState(0),i=pr.useRef(n);i.current=n;let o=pr.useRef(-1);return pr.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let a=typeof e=="string"?document.querySelector(e):e.current;if(!a)return;let u=a,{axis:m="y",scrollContainer:p,trigger:T={}}=i.current,R=typeof p=="string"?document.querySelector(p):p??null,L=ne(T.start??"top bottom"),te=ne(T.end??"bottom top"),ve=0,N=0,q=false,D=0;function H(){return R?m==="x"?R.scrollLeft:R.scrollTop:m==="x"?window.scrollX:window.scrollY}function M(){return R?m==="x"?R.clientWidth:R.clientHeight:m==="x"?window.innerWidth:window.innerHeight}function C(){let v=u.getBoundingClientRect(),y=H(),U=m==="x"?v.left:v.top,I=m==="x"?v.width:v.height,W=be({top:U,height:I},y,M(),L,te);ve=W.tStart,N=W.tEnd;}function A(){if(!q)return;let{speed:v=1,easing:y="linear",once:U=false}=i.current,I=typeof y=="function"?y:Q[y]??Q.linear,W=Z(H(),ve,N,v),j=I(W);U&&(o.current=Math.max(o.current,j),j=o.current),t(j),D=requestAnimationFrame(A);}let w=new IntersectionObserver(v=>{v.forEach(y=>{q=y.isIntersecting,q?D=requestAnimationFrame(A):cancelAnimationFrame(D);});},{root:R??null,threshold:0});C(),w.observe(u);let $;function k(){clearTimeout($),$=setTimeout(C,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),()=>{cancelAnimationFrame(D),clearTimeout($),w.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k);}},[]),r}function Jr({children:e,className:n,style:r,...t}){let i=pr.useRef(null);return pr.useEffect(()=>{if(!i.current)return;let o=Mt(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function Kr({children:e,className:n,style:r,...t}){let i=pr.useRef(null);return pr.useEffect(()=>{if(!i.current)return;let o=$t(i.current,t);return ()=>o.destroy()},[]),jsxRuntime.jsx("div",{ref:i,className:n,style:r,children:e})}function en({className:e,style:n,...r}){let t=pr.useRef(null);return pr.useEffect(()=>{if(!t.current)return;let i=Rt(t.current,r);return ()=>i.destroy()},[]),jsxRuntime.jsx("span",{ref:t,className:e,style:n})}function tn({src:e,className:n,style:r,muted:t=true,playsInline:i=true,...o}){let a=pr.useRef(null);return pr.useEffect(()=>{if(!a.current)return;let u=It(a.current,o);return ()=>u.destroy()},[]),jsxRuntime.jsx("video",{ref:a,src:e,className:n,style:r,muted:t,playsInline:i,preload:"auto"})}function rn({children:e,as:n="p",className:r,style:t,...i}){let o=pr.useRef(null);return pr.useEffect(()=>{if(!o.current)return;let a=Nt(o.current,i);return ()=>a.destroy()},[]),pr__default.default.createElement(n,{ref:o,className:r,style:t},e)}exports.ScrollAnimate=Kr;exports.ScrollCounter=en;exports.ScrollDraw=Jr;exports.ScrollText=rn;exports.ScrollVideo=tn;exports.useScrollDrawProgress=fr;
@@ -132,6 +132,33 @@ interface ScrollAnimateOptions {
132
132
  * Higher values = more dramatic speed-up. Default sensitivity: 1.
133
133
  */
134
134
  velocityScale?: boolean | number;
135
+ /**
136
+ * Honour `prefers-reduced-motion: reduce` by applying the final state and not
137
+ * animating. Default: `true`.
138
+ *
139
+ * Set to `false` only when the movement is *scroll-linked scrubbing* rather
140
+ * than autonomous motion — it advances solely as the user scrolls, 1:1 with
141
+ * their input, so it is direct manipulation rather than something that plays at
142
+ * them. `scrollHorizontal` sets this, because jumping to the final state there
143
+ * would leave every panel but the last unreachable inside the sticky
144
+ * `overflow: hidden` container.
145
+ */
146
+ respectReducedMotion?: boolean;
147
+ /**
148
+ * Element whose geometry defines the trigger window, when that is not the
149
+ * element being animated. Defaults to the animated element.
150
+ *
151
+ * Needed whenever the animated element cannot supply the scroll length itself —
152
+ * the case that matters is a `position: sticky` stage, where the pinned element
153
+ * is exactly one viewport tall and all of the scroll room belongs to its
154
+ * container. Resolving `top top` → `bottom bottom` against the pinned element
155
+ * there yields tStart === tEnd, a zero-length window, and no movement at all.
156
+ *
157
+ * Setting this disables the native CSS fast path: `animation-timeline: view()`
158
+ * always measures the element the animation is attached to, so it cannot express
159
+ * a separate subject.
160
+ */
161
+ triggerElement?: Element;
135
162
  onProgress?: (alpha: number) => void;
136
163
  onComplete?: () => void;
137
164
  /** Fires when scroll enters the trigger zone (scrolling forward). */
@@ -132,6 +132,33 @@ interface ScrollAnimateOptions {
132
132
  * Higher values = more dramatic speed-up. Default sensitivity: 1.
133
133
  */
134
134
  velocityScale?: boolean | number;
135
+ /**
136
+ * Honour `prefers-reduced-motion: reduce` by applying the final state and not
137
+ * animating. Default: `true`.
138
+ *
139
+ * Set to `false` only when the movement is *scroll-linked scrubbing* rather
140
+ * than autonomous motion — it advances solely as the user scrolls, 1:1 with
141
+ * their input, so it is direct manipulation rather than something that plays at
142
+ * them. `scrollHorizontal` sets this, because jumping to the final state there
143
+ * would leave every panel but the last unreachable inside the sticky
144
+ * `overflow: hidden` container.
145
+ */
146
+ respectReducedMotion?: boolean;
147
+ /**
148
+ * Element whose geometry defines the trigger window, when that is not the
149
+ * element being animated. Defaults to the animated element.
150
+ *
151
+ * Needed whenever the animated element cannot supply the scroll length itself —
152
+ * the case that matters is a `position: sticky` stage, where the pinned element
153
+ * is exactly one viewport tall and all of the scroll room belongs to its
154
+ * container. Resolving `top top` → `bottom bottom` against the pinned element
155
+ * there yields tStart === tEnd, a zero-length window, and no movement at all.
156
+ *
157
+ * Setting this disables the native CSS fast path: `animation-timeline: view()`
158
+ * always measures the element the animation is attached to, so it cannot express
159
+ * a separate subject.
160
+ */
161
+ triggerElement?: Element;
135
162
  onProgress?: (alpha: number) => void;
136
163
  onComplete?: () => void;
137
164
  /** Fires when scroll enters the trigger zone (scrolling forward). */
@@ -1,3 +1,3 @@
1
- import _t,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function At({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(t),o=0,l=[];for(let y=0;y<r;y++){let L=Math.pow(i,y);l.push(L),o+=L;}let u=[0],c=0;for(let y=0;y<r;y++)c+=l[y]/o,u.push(c);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let L=0;L<r;L++)if(y<=u[L+1]){let C=(y-u[L])/(u[L+1]-u[L]);if(L===0)return C*(2-C);let S=1-Math.pow(t,L);return S+(1-S)*(2*C-1)*(2*C-1)}return 1}}function Mt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),i=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return o=>o<=0?0:o>=1?1:r*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/t)+1}var re={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:At(),elastic:Mt()};function ne(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 Ge(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 Pt(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:Pt((e-n)/(r-n)*t,0,1)}function pe(e,n,r,t,i){let o=tt(e.top,e.height,n,t.element)-rt(t.viewport,r),l=tt(e.top,e.height,n,i.element)-rt(i.viewport,r);return {tStart:o,tEnd:l}}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),i=nt(n);return !t||!i?e:`rgb(${Math.round(t[0]+(i[0]-t[0])*r)},${Math.round(t[1]+(i[1]-t[1])*r)},${Math.round(t[2]+(i[2]-t[2])*r)})`}var ot={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 st(e,n){process.env.NODE_ENV!=="production"&&console.warn(`[svg-scroll-draw] ${e}`,n);}var it={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 $t(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?st("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&st("Element has a fill \u2014 it may obscure the stroke animation.",e);}function kt(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 i(){let o=r==="x"?window.scrollX:window.scrollY,l=e-o,u=n-o,c=r==="x";t.innerHTML=`
2
- <div style="position:absolute;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}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:${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",i,{passive:true}),i(),t}function Je(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let l=parseFloat(o),u=t[i++]??l;return String(+(l+(u-l)*r).toFixed(4))})}function at(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...ot[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:l="path, polyline, line, polygon, rect, circle",speed:u=1,fade:c=false,easing:y="linear",trigger:L={},stagger:C=0,direction:S="forward",once:U=false,debug:de=false,axis:F="y",scrollContainer:_,autoReverse:H=false,delay:G=0,strokeColor:x,strokeWidth:M,fillOpacity:P,waypoints:p,velocityScale:v=false,threshold:N=0,rootMargin:I="0px",repeat:E=0,repeatDelay:J=0,morphTo:T,clip:R,autoplay:D=false,duration:K=1e3,native:X=true,onProgress:d,onStart:$,onComplete:b,onEnter:h,onLeave:Y,onEnterBack:Se,onLeaveBack:xe}=i,be=R===true?"left":typeof R=="string"?R:false,we=typeof y=="function"?y:re[y]??re.linear,Ce=ne(L.start??"top bottom"),He=ne(L.end??"bottom top"),oe=typeof _=="string"?document.querySelector(_):_??null,ge=Array.isArray(x)?x[0]:null,ee=Array.isArray(x)?x[1]:typeof x=="string"?x:null,te=Array.isArray(M)?M[0]:null,a=Array.isArray(M)?M[1]:typeof M=="number"?M:null,g=Array.isArray(P)?P[0]:null,z=Array.isArray(P)?P[1]:typeof P=="number"?P:null;function se(s){let m=s*100;switch(be){case "right":return `inset(0 0 0 ${100-m}%)`;case "top":return `inset(0 0 ${100-m}% 0)`;case "bottom":return `inset(${100-m}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-m}% 0 0)`}}let O=be?[]:Array.from(e.querySelectorAll(l)),B=[],V=[],le=0,ce=0,ie=false,ye=false,ae=0,ze=false,ve=-1,Ve=-1,ue=false,$e=0,Te=0,Ae,Ye=null,Me=new Set,qe=-1,Ke=performance.now(),Ne=NaN;function Re(){return oe?F==="x"?oe.scrollLeft:oe.scrollTop:F==="x"?window.scrollX:window.scrollY}function Qe(){return oe?F==="x"?oe.clientWidth:oe.clientHeight:F==="x"?window.innerWidth:window.innerHeight}function et(){let s=e.getBoundingClientRect(),m,A,Q;if(oe){let fe=oe.getBoundingClientRect();m=F==="x"?s.left-fe.left+oe.scrollLeft:s.top-fe.top+oe.scrollTop,A=F==="x"?s.width:s.height,Q=Re();}else m=F==="x"?s.left:s.top,A=F==="x"?s.width:s.height,Q=Re();let me=pe({top:m,height:A},Q,Qe(),Ce,He);le=me.tStart,ce=me.tEnd,de&&process.env.NODE_ENV!=="production"&&(Ye?.remove(),Ye=kt(le,ce,F));}function Et(s,m){if(e.style.setProperty("--scroll-draw-progress",String(s)),be){let A=m==="reverse"?1-s:s;e.style.clipPath=se(A);return}O.forEach((A,Q)=>{A.style.strokeDashoffset=m==="reverse"?`${B[Q]*s}`:`${B[Q]*(1-s)}`,c&&(A.style.opacity=m==="reverse"?`${1-s}`:`${s}`),ge&&ee?A.style.stroke=Oe(ge,ee,s):ee&&(A.style.stroke=ee),te!==null&&a!==null?A.style.strokeWidth=`${te+(a-te)*s}`:a!==null&&(A.style.strokeWidth=`${a}`),g!==null&&z!==null?A.style.fillOpacity=`${g+(z-g)*s}`:z!==null&&(A.style.fillOpacity=`${z}`),T&&A.tagName.toLowerCase()==="path"&&V[Q]&&A.setAttribute("d",Je(V[Q],T,s));});}function We(){if(e.style.setProperty("--scroll-draw-progress","0"),be){e.style.clipPath=se(0);return}O.forEach((s,m)=>{s.style.strokeDasharray=`${B[m]}`,s.style.strokeDashoffset=S==="reverse"?"0":`${B[m]}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",ge&&(s.style.stroke=ge),te!==null&&(s.style.strokeWidth=`${te}`),g!==null&&(s.style.fillOpacity=`${g}`),T&&s.tagName.toLowerCase()==="path"&&V[m]&&s.setAttribute("d",V[m]);});}if(O.forEach(s=>{$t(s);let m=Ge(s);B.push(m),s.tagName.toLowerCase()==="path"?V.push(s.getAttribute("d")??""):V.push(""),o?(s.style.strokeDasharray=`${m}`,s.style.strokeDashoffset=S==="reverse"?`${m}`:"0",c&&(s.style.opacity="1"),ee&&(s.style.stroke=ee),a!==null&&(s.style.strokeWidth=`${a}`),z!==null&&(s.style.fillOpacity=`${z}`),T&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",T)):(s.style.strokeDasharray=`${m}`,s.style.strokeDashoffset=S==="reverse"?"0":`${m}`,c?s.style.opacity=S==="reverse"?"1":"0":s.style.opacity="",ge&&(s.style.stroke=ge),te!==null&&(s.style.strokeWidth=`${te}`),g!==null&&(s.style.fillOpacity=`${g}`));}),be){if(o)return e.style.clipPath=se(1),b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=se(0);}else if(o)return b?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};function St(){return !(X===false||!Ct()||!O.length||typeof y!="string"||!(y in it)||be||F!=="y"||oe||u!==1||C!==0||U||H||v!==false||T||p||E||G>0||d||$||b||h||Y||Se||xe||x!=null||M!=null||P!=null||(L.start??"top bottom").trim()!=="top bottom"||(L.end??"bottom top").trim()!=="bottom top")}function xt(){let s=`svg-scroll-draw-${++Lt}`,m=S==="reverse"?"0":"var(--ssd-len)",A=S==="reverse"?"var(--ssd-len)":"0",Q=`stroke-dashoffset:${m};`,me=`stroke-dashoffset:${A};`;c&&(Q+=`opacity:${S==="reverse"?1:0};`,me+=`opacity:${S==="reverse"?0:1};`);let fe=document.createElement("style");fe.setAttribute("data-svg-scroll-draw",""),fe.textContent=`@keyframes ${s}{from{${Q}}to{${me}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${it[y]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe);function he(f,k){f.style.setProperty("--ssd-len",String(B[k])),f.style.strokeDasharray=`${B[k]}`,f.style.strokeDashoffset="",f.style.opacity="",f.style.animationPlayState="",f.classList.add(s);}O.forEach(he);let w=false,q=-1;function W(){if(q>=0)return q;let f=e.getBoundingClientRect(),{tStart:k,tEnd:j}=pe({top:f.top,height:f.height},Re(),Qe(),Ce,He);return we(Z(Re(),k,j,u))}return {destroy(){O.forEach(f=>{f.classList.remove(s),f.style.removeProperty("--ssd-len"),f.style.animationPlayState="";}),fe.remove();},replay(){w=false,q=-1,O.forEach(he);},pause(){w=true,O.forEach(f=>{f.style.animationPlayState="paused";});},resume(){w&&(w=false,O.forEach(f=>{f.style.animationPlayState="running";}));},seek(f){let k=Math.min(1,Math.max(0,f));q=k,w=true,O.forEach((j,ke)=>{j.classList.remove(s),j.style.strokeDashoffset=S==="reverse"?`${B[ke]*k}`:`${B[ke]*(1-k)}`,c&&(j.style.opacity=S==="reverse"?`${1-k}`:`${k}`);});},getProgress(){return W()}}}if(St())return xt();function Tt(){let s=Math.max(1,K),m=0,A=0;function Q(W){let f=true;if(be){let k=Math.min(1,Math.max(0,W/s)),j=we(k);$e=j,e.style.setProperty("--scroll-draw-progress",String(j)),e.style.clipPath=se(S==="reverse"?1-j:j),d?.(j),k<1&&(f=false);}else O.forEach((k,j)=>{let ke=j*C*s,Ie=Math.min(1,Math.max(0,(W-ke)/s)),Ee=we(Ie);k.style.strokeDashoffset=S==="reverse"?`${B[j]*Ee}`:`${B[j]*(1-Ee)}`,c&&(k.style.opacity=S==="reverse"?`${1-Ee}`:`${Ee}`),ge&&ee?k.style.stroke=Oe(ge,ee,Ee):ee&&(k.style.stroke=ee),te!==null&&a!==null?k.style.strokeWidth=`${te+(a-te)*Ee}`:a!==null&&(k.style.strokeWidth=`${a}`),g!==null&&z!==null?k.style.fillOpacity=`${g+(z-g)*Ee}`:z!==null&&(k.style.fillOpacity=`${z}`),T&&k.tagName.toLowerCase()==="path"&&V[j]&&k.setAttribute("d",Je(V[j],T,Ee)),j===0&&(d?.(Ee),e.style.setProperty("--scroll-draw-progress",String(Ee))),Ie<1&&(f=false);});if(p){let k=Math.min(1,Math.max(0,W/s)),j=we(k);for(let ke in p){let Ie=parseFloat(ke);j>=Ie&&!Me.has(Ie)&&(Me.add(Ie),p[ke]?.());}}return f}function me(W){if(ue)return;let f=W-m;ye||(ye=true,$?.());let k=Q(f);if(k&&!ie){ie=true,Q(s*(1+Math.max(0,O.length-1)*C)),b?.(),Te<(E==="infinite"?1/0:E??0)&&(Te++,Ae=setTimeout(()=>{m=performance.now(),ye=false,ie=false,Me.clear(),We(),ae=requestAnimationFrame(me);},J));return}k||(ae=requestAnimationFrame(me));}function fe(){cancelAnimationFrame(ae),clearTimeout(Ae),m=performance.now(),A=0,ue=false,ye=false,ie=false,Te=0,Me.clear(),We(),ae=requestAnimationFrame(me);}let he=new IntersectionObserver(W=>{W.forEach(f=>{f.isIntersecting&&!(U&&ie)?fe():!f.isIntersecting&&!U&&!ie&&(cancelAnimationFrame(ae),clearTimeout(Ae),m=null);});},{root:oe??null,threshold:N,rootMargin:I}),w;function q(){clearTimeout(w),w=setTimeout(()=>{O.forEach((W,f)=>{B[f]=Ge(W),W.style.strokeDasharray=`${B[f]}`;});},150);}return window.addEventListener("resize",q),window.addEventListener("orientationchange",q),G>0?setTimeout(()=>he.observe(e),G):he.observe(e),{destroy(){cancelAnimationFrame(ae),clearTimeout(Ae),he.disconnect(),window.removeEventListener("resize",q),window.removeEventListener("orientationchange",q),clearTimeout(w);},replay(){Te=0,fe();},pause(){ue||(ue=true,A=performance.now()-m,cancelAnimationFrame(ae));},resume(){ue&&(ue=false,m=performance.now()-A,ae=requestAnimationFrame(me));},seek(W){let f=Math.min(1,Math.max(0,W));$e=f,ue=true,A=f*s,m=performance.now()-A,cancelAnimationFrame(ae),Q(A);},getProgress(){return $e}}}if(D)return Tt();et();function Be(){if(!ze||ue)return;let s=performance.now(),m=Re(),A=u;if(v!==false){let w=s-Ke,q=w>0?Math.abs(m-(qe<0?m:qe))/w:0;A=u*Math.max(.2,1+q*(typeof v=="number"?v:1)*.04);}qe=m,Ke=s;let Q=H?Ve===-1||m>=Ve?"forward":"reverse":S;Ve=m;let me=ce-le,fe=true,he=me===0?0:(m-le)/me;if(isNaN(Ne)||(Ne<=0&&he>0?h?.():Ne>0&&he<=0&&xe?.(),Ne<1&&he>=1?Y?.():Ne>=1&&he<1&&Se?.()),Ne=he,be){let w=we(Z(m,le,ce,A));U&&!H&&(ve=Math.max(ve,w),w=ve),$e=w,e.style.setProperty("--scroll-draw-progress",String(w));let q=Q==="reverse"?1-w:w;e.style.clipPath=se(q),d?.(w),!ye&&Z(m,le,ce,A)>0&&(ye=true,$?.()),w>=1&&!ie?(ie=true,b?.(),Te<(E==="infinite"?1/0:E??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,ye=false,ie=false,e.style.clipPath=se(0);},J))):w<1&&!U&&(ie=false),ae=requestAnimationFrame(Be);return}if(O.forEach((w,q)=>{let W=q*C*me,f=we(Z(m,le+W,ce+W,A));U&&!H&&(ve=Math.max(ve,f),f=ve),$e=f,w.style.strokeDashoffset=Q==="reverse"?`${B[q]*f}`:`${B[q]*(1-f)}`,c&&(w.style.opacity=Q==="reverse"?`${1-f}`:`${f}`),ge&&ee?w.style.stroke=Oe(ge,ee,f):ee&&(w.style.stroke=ee),te!==null&&a!==null?w.style.strokeWidth=`${te+(a-te)*f}`:a!==null&&(w.style.strokeWidth=`${a}`),g!==null&&z!==null?w.style.fillOpacity=`${g+(z-g)*f}`:z!==null&&(w.style.fillOpacity=`${z}`),T&&w.tagName.toLowerCase()==="path"&&V[q]&&w.setAttribute("d",Je(V[q],T,f)),q===0&&(d?.(f),e.style.setProperty("--scroll-draw-progress",String(f))),f<1&&(fe=false);}),p){let w=we(Z(m,le,ce,A));for(let q in p){let W=parseFloat(q);w>=W&&!Me.has(W)&&(Me.add(W),p[q]?.());}}!ye&&Z(m,le,ce,A)>0&&(ye=true,$?.()),fe&&!ie?(ie=true,b?.(),Te<(E==="infinite"?1/0:E??0)&&(Te++,Ae=setTimeout(()=>{ve=-1,ye=false,ie=false,Me.clear(),We();},J))):!fe&&!U&&(ie=false),ae=requestAnimationFrame(Be);}let je=new IntersectionObserver(s=>{s.forEach(m=>{ze=m.isIntersecting,ze&&!ue?ae=requestAnimationFrame(Be):cancelAnimationFrame(ae);});},{root:oe??null,threshold:N,rootMargin:I}),Ue;function _e(){clearTimeout(Ue),Ue=setTimeout(()=>{O.forEach((s,m)=>{B[m]=Ge(s),s.style.strokeDasharray=`${B[m]}`;}),et();},150);}return window.addEventListener("resize",_e),window.addEventListener("orientationchange",_e),G>0?setTimeout(()=>je.observe(e),G):je.observe(e),{destroy(){cancelAnimationFrame(ae),clearTimeout(Ae),je.disconnect(),window.removeEventListener("resize",_e),window.removeEventListener("orientationchange",_e),clearTimeout(Ue),Ye?.remove();},replay(){ve=-1,Ve=-1,qe=-1,ye=false,ie=false,Te=0,ue=false,Me.clear(),clearTimeout(Ae),We();},pause(){ue=true,cancelAnimationFrame(ae);},resume(){ue&&(ue=false,ze&&(ae=requestAnimationFrame(Be)));},seek(s){let m=Math.min(1,Math.max(0,s));$e=m,ve=m,ue=true,cancelAnimationFrame(ae),Et(m,S);},getProgress(){return $e}}}var lt=new Map;function Pe(e,n){lt.set(e,n);}function Le(e){lt.delete(e);}function Nt(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 i=[],o=[],l=t[2].trim();if(l)for(let u of l.split(/[\s,]+/)){let c=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}n.push({fn:t[1],nums:i,units:o});}return n}function It(e,n,r){let t=ct(e),i=ct(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((o,l)=>{let u=i[l];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((c,y)=>`${c}${o.units[y]}`).join(", ")})`:`${u.fn}(${u.nums.map((c,y)=>`${c}${u.units[y]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,y)=>`${c+(u.nums[y]-c)*r}${o.units[y]}`).join(", ")})`}).join(" ")}function ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(Nt(t))return Oe(t,i,r);if(t.includes("("))return It(t,i,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),l=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&l){let u=parseFloat(o[1]),c=parseFloat(l[1]);return `${u+(c-u)*r}${o[2]||l[2]}`}return r<1?t:i}function Ot(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"},Rt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ft=0;function Dt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ft(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:o="ease-out",speed:l=1,once:u=false,axis:c="y",scrollContainer:y,native:L=true,velocityScale:C=false,onProgress:S,onComplete:U,onEnter:de,onLeave:F,onEnterBack:_,onLeaveBack:H}=n,G=window.matchMedia("(prefers-reduced-motion: reduce)").matches,x=typeof o=="function"?o:re[o]??re["ease-out"],M=ne(i.start??"top bottom"),P=ne(i.end??"bottom top"),p=typeof y=="string"?document.querySelector(y):y??null,v=Object.entries(t).map(([a,g])=>({prop:Ot(a),from:Array.isArray(g)?g[0]:"",to:Array.isArray(g)?g[1]:g}));function N(){let a=window.getComputedStyle(e);for(let g of v)g.from===""&&(g.from=a.getPropertyValue(g.prop).trim()||"0");}function I(){for(let a of v)e.style.setProperty(a.prop,String(a.to));}if(G)return I(),U?.(),r;N();function E(){if(!L||!Dt()||typeof o!="string"||!(o in mt)||c!=="y"||p||u||l!==1||S||U||de||F||_||H||C!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let a of v)if(!Rt.has(a.prop))return false;return true}function J(){let a=`ssd-a-${++Ft}`,g=v.map(V=>`${V.prop}:${V.from}`).join(";"),z=v.map(V=>`${V.prop}:${V.to}`).join(";"),se=document.createElement("style");se.setAttribute("data-ssd-animate",""),se.textContent=`@keyframes ${a}{from{${g}}to{${z}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${mt[o]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(se),e.classList.add(a);let O=()=>c==="x"?window.scrollX:window.scrollY,B=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(a),se.remove();},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(V){let le=Math.min(1,Math.max(0,V));e.classList.remove(a);for(let ce of v)e.style.setProperty(ce.prop,ut(ce.from,ce.to,le));},getProgress(){let V=e.getBoundingClientRect(),le=O(),ce=B(),{tStart:ie,tEnd:ye}=pe({top:V.top,height:V.height},le,ce,M,P);return x(Z(le,ie,ye,l))}}}if(E())return J();let T=0,R=0,D=0,K=false,X=false,d=-1,$=0,b=false,h=NaN,Y=-1,Se=0,xe=()=>p?c==="x"?p.scrollLeft:p.scrollTop:c==="x"?window.scrollX:window.scrollY,be=()=>p?c==="x"?p.clientWidth:p.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function we(){let a=e.getBoundingClientRect(),g,z;if(p){let O=p.getBoundingClientRect();g=c==="x"?a.left-O.left+p.scrollLeft:a.top-O.top+p.scrollTop,z=c==="x"?a.width:a.height;}else g=c==="x"?a.left:a.top,z=c==="x"?a.width:a.height;let se=pe({top:g,height:z},xe(),be(),M,P);T=se.tStart,R=se.tEnd;}function Ce(a){e.style.setProperty("--scroll-draw-progress",String(a));for(let g of v)e.style.setProperty(g.prop,ut(g.from,g.to,a));S?.(a);}function He(a){if(isNaN(h)){h=a;return}h<=0&&a>0?de?.():h>0&&a<=0&&H?.(),h<1&&a>=1?F?.():h>=1&&a<1&&_?.(),h=a;}function oe(){if(!K||X)return;let a=performance.now(),g=xe(),z=l;if(C!==false){let B=a-Se,V=B>0?Math.abs(g-(Y<0?g:Y))/B:0;z=l*Math.max(.2,1+V*(typeof C=="number"?C:1)*.04);}Y=g,Se=a;let se=R===T?0:(g-T)/(R-T);He(se);let O=x(Z(g,T,R,z));u&&(d=Math.max(d,O),O=d),$=O,Ce(O),O>=1&&!b?(b=true,U?.()):O<1&&!u&&(b=false),D=requestAnimationFrame(oe);}we();{let a=x(Z(xe(),T,R,l));u&&a>0&&(d=a),$=a,Ce(a);}let ge=new IntersectionObserver(a=>{a.forEach(g=>{K=g.isIntersecting,K&&!X?D=requestAnimationFrame(oe):cancelAnimationFrame(D);});},{root:p??null}),ee;function te(){clearTimeout(ee),ee=setTimeout(we,150);}return window.addEventListener("resize",te),window.addEventListener("orientationchange",te),ge.observe(e),Pe(e,{type:"animate",getProgress:()=>$,getTrigger:()=>({tStart:T,tEnd:R})}),{destroy(){cancelAnimationFrame(D),ge.disconnect(),window.removeEventListener("resize",te),window.removeEventListener("orientationchange",te),clearTimeout(ee),Le(e);},replay(){d=-1,b=false,$=0,X=false,Ce(0);},pause(){X=true,cancelAnimationFrame(D);},resume(){X&&(X=false,K&&(D=requestAnimationFrame(oe)));},seek(a){let g=Math.min(1,Math.max(0,a));$=g,d=g,X=true,cancelAnimationFrame(D),Ce(g);},getProgress(){return $}}}var Ze={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,n){if(typeof window>"u")return Ze;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),Ze;let t=r,{from:i=0,to:o,format:l,easing:u="ease-out",trigger:c={},once:y=true,decimals:L,onComplete:C}=n,S=L!==void 0?d=>d.toFixed(L):l??(d=>String(Math.round(d))),U=typeof u=="function"?u:re[u]??re["ease-out"],de=ne(c.start??"top 80%"),F=ne(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=S(o),C?.(),Ze;t.textContent=S(i);let H=0,G=0,x=0,M=false,P=false,p=-1,v=0,N=false,I=()=>window.scrollY,E=()=>window.innerHeight;function J(){let d=t.getBoundingClientRect(),$=pe({top:d.top,height:d.height},I(),E(),de,F);H=$.tStart,G=$.tEnd;}function T(d){t.textContent=S(i+(o-i)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function R(){if(!M||P)return;let d=U(Z(I(),H,G,1));y&&(p=Math.max(p,d),d=p),v=d,T(d),d>=1&&!N?(N=true,C?.()):d<1&&!y&&(N=false),x=requestAnimationFrame(R);}J();{let d=U(Z(I(),H,G,1));y&&d>0&&(p=d),v=d,T(d);}let D=new IntersectionObserver(d=>{d.forEach($=>{M=$.isIntersecting,M&&!P?x=requestAnimationFrame(R):cancelAnimationFrame(x);});}),K;function X(){clearTimeout(K),K=setTimeout(J,150);}return window.addEventListener("resize",X),window.addEventListener("orientationchange",X),D.observe(t),Pe(t,{type:"counter",getProgress:()=>v,getTrigger:()=>({tStart:H,tEnd:G})}),{destroy(){cancelAnimationFrame(x),D.disconnect(),window.removeEventListener("resize",X),window.removeEventListener("orientationchange",X),clearTimeout(K),Le(t);},replay(){p=-1,N=false,v=0,P=false,T(0);},pause(){P=true,cancelAnimationFrame(x);},resume(){P&&(P=false,M&&(x=requestAnimationFrame(R)));},seek(d){let $=Math.min(1,Math.max(0,d));v=$,p=$,P=true,cancelAnimationFrame(x),T($);},getProgress(){return v}}}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollVideo: <video> element not found:",e),dt;let t=r,{trigger:i={},easing:o="linear",once:l=false,axis:u="y",preload:c="auto",onReady:y,onComplete:L,onProgress:C}=n,S=window.matchMedia("(prefers-reduced-motion: reduce)").matches,U=typeof o=="function"?o:re[o]??re.linear,de=ne(i.start??"top top"),F=ne(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=c);let _=n.from??0,H=n.to,G=0,x=0,M=0,P=false,p=false,v=-1,N=0,I=false,E=false,J=()=>u==="x"?window.scrollX:window.scrollY,T=()=>u==="x"?window.innerWidth:window.innerHeight;function R(){let h=t.getBoundingClientRect(),Y=u==="x"?h.left:h.top,Se=u==="x"?h.width:h.height,xe=pe({top:Y,height:Se},J(),T(),de,F);G=xe.tStart,x=xe.tEnd;}function D(h){if(!E)return;let Y=H??t.duration??0;t.currentTime=_+(Y-_)*h,t.style.setProperty("--scroll-draw-progress",String(h)),C?.(h);}function K(){if(!P||p||!E)return;let h=U(Z(J(),G,x,1));l&&(v=Math.max(v,h),h=v),N=h,D(h),h>=1&&!I?(I=true,L?.()):h<1&&!l&&(I=false),M=requestAnimationFrame(K);}function X(){if(E=true,H===void 0&&(H=t.duration),S){D(1),y?.();return}R(),y?.(),P&&!p&&(M=requestAnimationFrame(K));}t.readyState>=1?X():t.addEventListener("loadedmetadata",X,{once:true}),E||R();let d=new IntersectionObserver(h=>{h.forEach(Y=>{P=Y.isIntersecting,P&&!p&&E?M=requestAnimationFrame(K):cancelAnimationFrame(M);});}),$;function b(){clearTimeout($),$=setTimeout(R,150);}return window.addEventListener("resize",b),window.addEventListener("orientationchange",b),d.observe(t),Pe(t,{type:"video",getProgress:()=>N,getTrigger:()=>({tStart:G,tEnd:x})}),{destroy(){cancelAnimationFrame(M),d.disconnect(),t.removeEventListener("loadedmetadata",X),window.removeEventListener("resize",b),window.removeEventListener("orientationchange",b),clearTimeout($),Le(t);},replay(){v=-1,I=false,N=0,p=false,D(0);},pause(){p=true,cancelAnimationFrame(M);},resume(){p&&(p=false,P&&E&&(M=requestAnimationFrame(K)));},seek(h){let Y=Math.min(1,Math.max(0,h));N=Y,v=Y,p=true,cancelAnimationFrame(M),D(Y);},getProgress(){return N}}}function bt(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 Ht(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 yt(e){let n=bt(e),r=new Map;for(let o of n){let l=o.offsetTop;r.has(l)||r.set(l,[]),r.get(l).push(o);}let t=[],i=Array.from(r.keys()).sort((o,l)=>o-l);for(let o of i){let l=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block";for(let c of l)u.appendChild(c);t.push(u);}e.textContent="";for(let o of t)e.appendChild(o),e.appendChild(document.createTextNode(" "));return t}function zt(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,o=n*t,l=o+(1-i);return l<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(l-o)))}function Vt(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 ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,n={}){if(typeof window>"u")return ht;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),ht;let t=r,{split:i="words",stagger:o=.04,easing:l="ease-out",from:u={opacity:0,y:24},trigger:c={},once:y=true,onComplete:L}=n,C=window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof l=="function"?l:re[l]??re["ease-out"],U=ne(c.start??"top 85%"),de=ne(c.end??"top 40%"),F=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let _;i==="chars"?_=Ht(t):i==="lines"?_=yt(t):_=bt(t);let H=_.length;function G(b,h){u?.opacity!==void 0&&(b.style.opacity=String(u.opacity+(1-u.opacity)*h));let Y=Vt(h,u);Y&&(b.style.transform=Y);}function x(b){t.style.setProperty("--scroll-draw-progress",String(b)),_.forEach((h,Y)=>{let Se=S(zt(b,Y,H,o));G(h,Se);});}if(C)return x(1),L?.(),{destroy(){t.innerHTML=F,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x(0);let M=0,P=0,p=0,v=false,N=false,I=-1,E=0,J=false,T=()=>window.scrollY,R=()=>window.innerHeight;function D(){let b=t.getBoundingClientRect(),h=pe({top:b.top,height:b.height},T(),R(),U,de);M=h.tStart,P=h.tEnd;}function K(){if(!v||N)return;let b=Z(T(),M,P,1);y&&(I=Math.max(I,b),b=I),E=b,x(b),b>=1&&!J?(J=true,L?.()):b<1&&!y&&(J=false),p=requestAnimationFrame(K);}D();let X=new IntersectionObserver(b=>{b.forEach(h=>{v=h.isIntersecting,v&&!N?p=requestAnimationFrame(K):cancelAnimationFrame(p);});}),d;function $(){clearTimeout(d),d=setTimeout(()=>{if(i==="lines"){let b=E;t.innerHTML=F,t.setAttribute("aria-label",t.textContent??""),_=yt(t),x(b);}D();},150);}return window.addEventListener("resize",$),window.addEventListener("orientationchange",$),X.observe(t),Pe(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:M,tEnd:P})}),{destroy(){cancelAnimationFrame(p),X.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),clearTimeout(d),t.innerHTML=F,t.removeAttribute("aria-label"),Le(t);},replay(){I=-1,J=false,E=0,N=false,x(0);},pause(){N=true,cancelAnimationFrame(p);},resume(){N&&(N=false,v&&(p=requestAnimationFrame(K)));},seek(b){let h=Math.min(1,Math.max(0,b));E=h,I=h,N=true,cancelAnimationFrame(p),x(h);},getProgress(){return E}}}function Bt(e,n={}){let[r,t]=useState(0),i=useRef(n);i.current=n;let o=useRef(-1);return useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let l=typeof e=="string"?document.querySelector(e):e.current;if(!l)return;let u=l,{axis:c="y",scrollContainer:y,trigger:L={}}=i.current,C=typeof y=="string"?document.querySelector(y):y??null,S=ne(L.start??"top bottom"),U=ne(L.end??"bottom top"),de=0,F=0,_=false,H=0;function G(){return C?c==="x"?C.scrollLeft:C.scrollTop:c==="x"?window.scrollX:window.scrollY}function x(){return C?c==="x"?C.clientWidth:C.clientHeight:c==="x"?window.innerWidth:window.innerHeight}function M(){let I=u.getBoundingClientRect(),E=G(),J=c==="x"?I.left:I.top,T=c==="x"?I.width:I.height,R=pe({top:J,height:T},E,x(),S,U);de=R.tStart,F=R.tEnd;}function P(){if(!_)return;let{speed:I=1,easing:E="linear",once:J=false}=i.current,T=typeof E=="function"?E:re[E]??re.linear,R=Z(G(),de,F,I),D=T(R);J&&(o.current=Math.max(o.current,D),D=o.current),t(D),H=requestAnimationFrame(P);}let p=new IntersectionObserver(I=>{I.forEach(E=>{_=E.isIntersecting,_?H=requestAnimationFrame(P):cancelAnimationFrame(H);});},{root:C??null,threshold:0});M(),p.observe(u);let v;function N(){clearTimeout(v),v=setTimeout(M,150);}return window.addEventListener("resize",N),window.addEventListener("orientationchange",N),()=>{cancelAnimationFrame(H),clearTimeout(v),p.disconnect(),window.removeEventListener("resize",N),window.removeEventListener("orientationchange",N);}},[]),r}function br({children:e,className:n,style:r,...t}){let i=useRef(null);return useEffect(()=>{if(!i.current)return;let o=at(i.current,t);return ()=>o.destroy()},[]),jsx("div",{ref:i,className:n,style:r,children:e})}function wr({children:e,className:n,style:r,...t}){let i=useRef(null);return useEffect(()=>{if(!i.current)return;let o=ft(i.current,t);return ()=>o.destroy()},[]),jsx("div",{ref:i,className:n,style:r,children:e})}function vr({className:e,style:n,...r}){let t=useRef(null);return useEffect(()=>{if(!t.current)return;let i=pt(t.current,r);return ()=>i.destroy()},[]),jsx("span",{ref:t,className:e,style:n})}function Er({src:e,className:n,style:r,muted:t=true,playsInline:i=true,...o}){let l=useRef(null);return useEffect(()=>{if(!l.current)return;let u=gt(l.current,o);return ()=>u.destroy()},[]),jsx("video",{ref:l,src:e,className:n,style:r,muted:t,playsInline:i,preload:"auto"})}function Sr({children:e,as:n="p",className:r,style:t,...i}){let o=useRef(null);return useEffect(()=>{if(!o.current)return;let l=wt(o.current,i);return ()=>l.destroy()},[]),_t.createElement(n,{ref:o,className:r,style:t},e)}export{wr as ScrollAnimate,vr as ScrollCounter,br as ScrollDraw,Sr as ScrollText,Er as ScrollVideo,Bt as useScrollDrawProgress};
1
+ import pr,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function Wt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(t),o=0,a=[];for(let p=0;p<r;p++){let T=Math.pow(i,p);a.push(T),o+=T;}let u=[0],m=0;for(let p=0;p<r;p++)m+=a[p]/o,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<r;T++)if(p<=u[T+1]){let R=(p-u[T])/(u[T+1]-u[T]);if(T===0)return R*(2-R);let L=1-Math.pow(t,T);return L+(1-L)*(2*R-1)*(2*R-1)}return 1}}function Bt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),i=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return o=>o<=0?0:o>=1?1:r*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/t)+1}var Q={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:Wt(),elastic:Bt()};function ne(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 ht(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 bt(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 Ve(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 Gt(e,n,r){return Math.min(r,Math.max(n,e))}function Z(e,n,r,t){return r===n?0:Gt((e-n)/(r-n)*t,0,1)}function Je(e,n,r){let t=e.getBoundingClientRect(),i=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:i,scroll:0}:{top:r==="x"?t.left:t.top,height:i,scroll:r==="x"?window.scrollX:window.scrollY}}function be(e,n,r,t,i){let o=ht(e.top,e.height,n,t.element)-bt(t.viewport,r),a=ht(e.top,e.height,n,i.element)-bt(i.viewport,r);return {tStart:o,tEnd:a}}function wt(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 _e(e,n,r){let t=wt(e),i=wt(n);return !t||!i?e:`rgb(${Math.round(t[0]+(i[0]-t[0])*r)},${Math.round(t[1]+(i[1]-t[1])*r)},${Math.round(t[2]+(i[2]-t[2])*r)})`}var vt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ke=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...n){Ke&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Ut="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",jt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",St=33;function Xt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Yt(e){let n=[];for(let r=0;r<St;r++){let t=r/(St-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return Ut;case "ease-out":return jt;case "ease-in-out":return Xt()?Yt(Q["ease-in-out"]):null;default:return null}}var Et=Symbol.for("svg-scroll-draw.registry");function Tt(){let e=globalThis;return e[Et]||(e[Et]=new Map)}function Le(e,n){Tt().set(e,n);}function Ce(e){Tt().delete(e);}var Qt=0;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Jt(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?we("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Kt(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 i(){let o=r==="x"?window.scrollX:window.scrollY,a=e-o,u=n-o,m=r==="x";t.innerHTML=`
2
+ <div style="position:absolute;${m?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",i,{passive:true}),i(),{el:t,destroy(){window.removeEventListener("scroll",i),t.remove();}}}var xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,At=/[MmLlHhVvCcSsQqTtAaZz]/g;function er(e,n,r){if(!Ke)return;let t=(e.match(At)??[]).join("").toUpperCase(),i=(n.match(At)??[]).join("").toUpperCase(),o=(e.match(xt)??[]).length,a=(n.match(xt)??[]).length;if(t!==i){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}o!==a&&we(`morphTo: coordinate count differs (${o} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function at(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,o=>{let a=parseFloat(o),u=t[i++]??a;return String(+(a+(u-a)*r).toFixed(4))})}function Mt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...vt[r],...t}:t,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:R=0,direction:L="forward",once:te=false,debug:ve=false,axis:N="y",scrollContainer:q,autoReverse:D=false,delay:H=0,strokeColor:M,strokeWidth:C,fillOpacity:A,waypoints:w,velocityScale:$=false,threshold:k=0,rootMargin:v="0px",repeat:y=0,repeatDelay:U=0,morphTo:I,clip:W,autoplay:j=false,duration:oe=1e3,native:ue=true,onProgress:h,onStart:P,onComplete:g,onEnter:d,onLeave:z,onEnterBack:pe,onLeaveBack:Te}=i,me=W===true?"left":typeof W=="string"?W:false,xe=typeof p=="function"?p:Q[p]??Q.linear,$e=ne(T.start??"top bottom"),He=ne(T.end??"bottom top"),Se=typeof q=="string"?document.querySelector(q):q??null,Ee=Array.isArray(M)?M[0]:null,ie=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ae=Array.isArray(C)?C[0]:null,J=Array.isArray(C)?C[1]:typeof C=="number"?C:null,fe=Array.isArray(A)?A[0]:null,re=Array.isArray(A)?A[1]:typeof A=="number"?A:null;function Re(s){let c=s*100;switch(me){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let B=me?[]:Array.from(e.querySelectorAll(a)),O=[],l=[],f=0,de=0,V=false,G=false,X=0,Me=false,ge=-1,se=-1,K=false,ye=0,Ie=0,De,rt=null;function ct(){rt?.destroy(),rt=null;}let Fe=new Set,ut=NaN,Ne=true,Ue=-1,mt=performance.now(),ze=NaN;function nt(){return Se?N==="x"?Se.scrollLeft:Se.scrollTop:N==="x"?window.scrollX:window.scrollY}function ft(){return Se?N==="x"?Se.clientWidth:Se.clientHeight:N==="x"?window.innerWidth:window.innerHeight}function pt(){let s=Je(e,Se,N);return be(s,s.scroll,ft(),$e,He)}function dt(){(({tStart:f,tEnd:de}=pt())),ve&&Ke&&(ct(),rt=Kt(f,de,N));}function ot(s,c=pt){Le(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:c});let E=s.destroy;return s.destroy=()=>{E.call(s),Ce(e);},s}function zt(s,c){if(e.style.setProperty("--scroll-draw-progress",String(s)),me){let E=c==="reverse"?1-s:s;e.style.clipPath=Re(E);return}B.forEach((E,le)=>{E.style.strokeDashoffset=c==="reverse"?`${O[le]*s}`:`${O[le]*(1-s)}`,m&&(E.style.opacity=c==="reverse"?`${1-s}`:`${s}`),Ee&&ie?E.style.stroke=_e(Ee,ie,s):ie&&(E.style.stroke=ie),ae!==null&&J!==null?E.style.strokeWidth=`${ae+(J-ae)*s}`:J!==null&&(E.style.strokeWidth=`${J}`),fe!==null&&re!==null?E.style.fillOpacity=`${fe+(re-fe)*s}`:re!==null&&(E.style.fillOpacity=`${re}`),I&&E.tagName.toLowerCase()==="path"&&l[le]&&E.setAttribute("d",at(l[le],I,s));});}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),me){e.style.clipPath=Re(0);return}B.forEach((s,c)=>{s.style.strokeDasharray=`${O[c]}`,s.style.strokeDashoffset=L==="reverse"?"0":`${O[c]}`,m?s.style.opacity=L==="reverse"?"1":"0":s.style.opacity="",Ee&&(s.style.stroke=Ee),ae!==null&&(s.style.strokeWidth=`${ae}`),fe!==null&&(s.style.fillOpacity=`${fe}`),I&&s.tagName.toLowerCase()==="path"&&l[c]&&s.setAttribute("d",l[c]);});}if(B.forEach(s=>{Jt(s);let c=Ve(s);O.push(c);let E=s.tagName.toLowerCase()==="path";E?l.push(s.getAttribute("d")??""):l.push(""),I&&(E?er(l[l.length-1],I,s):we(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),o?(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=L==="reverse"?`${c}`:"0",m&&(s.style.opacity="1"),ie&&(s.style.stroke=ie),J!==null&&(s.style.strokeWidth=`${J}`),re!==null&&(s.style.fillOpacity=`${re}`),I&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",I)):(s.style.strokeDasharray=`${c}`,s.style.strokeDashoffset=L==="reverse"?"0":`${c}`,m?s.style.opacity=L==="reverse"?"1":"0":s.style.opacity="",Ee&&(s.style.stroke=Ee),ae!==null&&(s.style.strokeWidth=`${ae}`),fe!==null&&(s.style.fillOpacity=`${fe}`));}),me){if(o)return e.style.clipPath=Re(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Re(0);}else if(o)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof p=="string"?et(p):null;function Vt(){return !(ue===false||!Zt()||!B.length||!gt||me||N!=="y"||Se||u!==1||R!==0||te||D||$!==false||I||w||y||H>0||h||P||g||d||z||pe||Te||M!=null||C!=null||A!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function _t(){let s=++Qt,c=`svg-scroll-draw-${s}`,E=`svg-scroll-draw-host-${s}`,le=`--svg-scroll-draw-${s}`,Oe=L==="reverse"?"0":"var(--ssd-len)",ke=L==="reverse"?"var(--ssd-len)":"0",Pe=`stroke-dashoffset:${Oe};`,x=`stroke-dashoffset:${ke};`;m&&(Pe+=`opacity:${L==="reverse"?1:0};`,x+=`opacity:${L==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${c}{from{${Pe}}to{${x}}}.${E}{view-timeline-name:${le};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${le};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(E);function ce(b,ee){b.style.setProperty("--ssd-len",String(O[ee])),b.style.strokeDasharray=`${O[ee]}`,b.style.strokeDashoffset="",b.style.opacity="",b.style.animationPlayState="",b.classList.add(c);}B.forEach(ce);let S=false,_=-1;function Y(){if(_>=0)return _;let b=e.getBoundingClientRect(),{tStart:ee,tEnd:Ae}=be({top:b.top,height:b.height},nt(),ft(),$e,He);return xe(Z(nt(),ee,Ae,u))}return {destroy(){e.classList.remove(E),B.forEach(b=>{b.classList.remove(c),b.style.removeProperty("--ssd-len"),b.style.animationPlayState="";}),F.remove();},replay(){S=false,_=-1,B.forEach(ce);},pause(){S=true,B.forEach(b=>{b.style.animationPlayState="paused";});},resume(){S&&(S=false,B.forEach(b=>{b.style.animationPlayState="running";}));},seek(b){let ee=Math.min(1,Math.max(0,b));_=ee,S=true,B.forEach((Ae,he)=>{Ae.classList.remove(c),Ae.style.strokeDashoffset=L==="reverse"?`${O[he]*ee}`:`${O[he]*(1-ee)}`,m&&(Ae.style.opacity=L==="reverse"?`${1-ee}`:`${ee}`);});},getProgress(){return Y()},refresh(){B.forEach((b,ee)=>{O[ee]=Ve(b),b.style.setProperty("--ssd-len",String(O[ee])),b.style.strokeDasharray=`${O[ee]}`;});}}}if(Vt())return ot(_t());function qt(){let s=Math.max(1,oe),c=0,E=0,le=false;function Oe(S){let _=true;if(me){let Y=Math.min(1,Math.max(0,S/s)),b=xe(Y);ye=b,e.style.setProperty("--scroll-draw-progress",String(b)),e.style.clipPath=Re(L==="reverse"?1-b:b),h?.(b),Y<1&&(_=false);}else B.forEach((Y,b)=>{let ee=b*R*s,Ae=Math.min(1,Math.max(0,(S-ee)/s)),he=xe(Ae);Y.style.strokeDashoffset=L==="reverse"?`${O[b]*he}`:`${O[b]*(1-he)}`,m&&(Y.style.opacity=L==="reverse"?`${1-he}`:`${he}`),Ee&&ie?Y.style.stroke=_e(Ee,ie,he):ie&&(Y.style.stroke=ie),ae!==null&&J!==null?Y.style.strokeWidth=`${ae+(J-ae)*he}`:J!==null&&(Y.style.strokeWidth=`${J}`),fe!==null&&re!==null?Y.style.fillOpacity=`${fe+(re-fe)*he}`:re!==null&&(Y.style.fillOpacity=`${re}`),I&&Y.tagName.toLowerCase()==="path"&&l[b]&&Y.setAttribute("d",at(l[b],I,he)),b===0&&(ye=he,h?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Ae<1&&(_=false);});if(w){let Y=Math.min(1,Math.max(0,S/s)),b=xe(Y);for(let ee in w){let Ae=parseFloat(ee);b>=Ae&&!Fe.has(Ae)&&(Fe.add(Ae),w[ee]?.());}}return _}function ke(S){if(K)return;let _=S-c;G||(G=true,P?.());let Y=Oe(_);if(Y&&!V){V=true,Oe(s*(1+Math.max(0,B.length-1)*R)),g?.(),Ie<(y==="infinite"?1/0:y??0)&&(Ie++,De=setTimeout(()=>{c=performance.now(),G=false,V=false,Fe.clear(),je(),X=requestAnimationFrame(ke);},U));return}Y||(X=requestAnimationFrame(ke));}function Pe(){cancelAnimationFrame(X),clearTimeout(De),c=performance.now(),E=0,K=false,G=false,V=false,Ie=0,le=true,ye=0,Fe.clear(),je(),X=requestAnimationFrame(ke);}let x=new IntersectionObserver(S=>{S.forEach(_=>{_.isIntersecting&&!(te&&V)?Pe():!_.isIntersecting&&!te&&!V&&(cancelAnimationFrame(X),clearTimeout(De),le=false);});},{root:Se??null,threshold:k,rootMargin:v}),F;function ce(){clearTimeout(F),F=setTimeout(()=>{B.forEach((S,_)=>{O[_]=Ve(S),S.style.strokeDasharray=`${O[_]}`;});},150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),H>0?setTimeout(()=>x.observe(e),H):x.observe(e),{destroy(){cancelAnimationFrame(X),clearTimeout(De),x.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(F);},replay(){Ie=0,Pe();},pause(){K||!le||(K=true,E=performance.now()-c,cancelAnimationFrame(X));},resume(){K&&(K=false,le=true,c=performance.now()-E,X=requestAnimationFrame(ke));},seek(S){let _=Math.min(1,Math.max(0,S));ye=_,K=true,E=_*s,c=performance.now()-E,cancelAnimationFrame(X),Oe(E);},getProgress(){return ye},refresh(){clearTimeout(F),B.forEach((S,_)=>{O[_]=Ve(S),S.style.strokeDasharray=`${O[_]}`;});}}}if(j)return ot(qt());dt();function Xe(){if(!Me||K)return;let s=performance.now(),c=nt();if(!Ne&&$===false&&c===ut){X=requestAnimationFrame(Xe);return}Ne=false,ut=c;let E=u;if($!==false){let x=s-mt,F=x>0?Math.abs(c-(Ue<0?c:Ue))/x:0;E=u*Math.max(.2,1+F*(typeof $=="number"?$:1)*.04);}Ue=c,mt=s;let le=D?se===-1||c>=se?"forward":"reverse":L;se=c;let Oe=de-f,ke=true,Pe=Oe===0?0:(c-f)/Oe;if(isNaN(ze)||(ze<=0&&Pe>0?d?.():ze>0&&Pe<=0&&Te?.(),ze<1&&Pe>=1?z?.():ze>=1&&Pe<1&&pe?.()),ze=Pe,me){let x=xe(Z(c,f,de,E));te&&!D&&(ge=Math.max(ge,x),x=ge),ye=x,e.style.setProperty("--scroll-draw-progress",String(x));let F=le==="reverse"?1-x:x;e.style.clipPath=Re(F),h?.(x),!G&&Z(c,f,de,E)>0&&(G=true,P?.()),x>=1&&!V?(V=true,g?.(),Ie<(y==="infinite"?1/0:y??0)&&(Ie++,De=setTimeout(()=>{ge=-1,G=false,V=false,e.style.clipPath=Re(0);},U))):x<1&&!te&&(V=false),X=requestAnimationFrame(Xe);return}if(B.forEach((x,F)=>{let ce=F*R*Oe,S=xe(Z(c,f+ce,de+ce,E));te&&!D&&(ge=Math.max(ge,S),S=ge),ye=S,x.style.strokeDashoffset=le==="reverse"?`${O[F]*S}`:`${O[F]*(1-S)}`,m&&(x.style.opacity=le==="reverse"?`${1-S}`:`${S}`),Ee&&ie?x.style.stroke=_e(Ee,ie,S):ie&&(x.style.stroke=ie),ae!==null&&J!==null?x.style.strokeWidth=`${ae+(J-ae)*S}`:J!==null&&(x.style.strokeWidth=`${J}`),fe!==null&&re!==null?x.style.fillOpacity=`${fe+(re-fe)*S}`:re!==null&&(x.style.fillOpacity=`${re}`),I&&x.tagName.toLowerCase()==="path"&&l[F]&&x.setAttribute("d",at(l[F],I,S)),F===0&&(h?.(S),e.style.setProperty("--scroll-draw-progress",String(S))),S<1&&(ke=false);}),w){let x=xe(Z(c,f,de,E));for(let F in w){let ce=parseFloat(F);x>=ce&&!Fe.has(ce)&&(Fe.add(ce),w[F]?.());}}!G&&Z(c,f,de,E)>0&&(G=true,P?.()),ke&&!V?(V=true,g?.(),Ie<(y==="infinite"?1/0:y??0)&&(Ie++,De=setTimeout(()=>{ge=-1,G=false,V=false,Fe.clear(),je(),Ne=true;},U))):!ke&&!te&&(V=false),X=requestAnimationFrame(Xe);}let st=false;function Ye(){st||(st=true,X=requestAnimationFrame(function(){Xe();}));}function Qe(){st=false,cancelAnimationFrame(X);}let it=new IntersectionObserver(s=>{s.forEach(c=>{Me=c.isIntersecting,Me&&!K?(Ne=true,Ye()):Qe();});},{root:Se??null,threshold:k,rootMargin:v});function yt(){B.forEach((s,c)=>{O[c]=Ve(s),s.style.strokeDasharray=`${O[c]}`;}),dt(),Ne=true;}let Ze;function qe(){clearTimeout(Ze),Ze=setTimeout(yt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),H>0?setTimeout(()=>it.observe(e),H):it.observe(e),ot({destroy(){cancelAnimationFrame(X),clearTimeout(De),Qe(),it.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Ze),ct();},replay(){ge=-1,se=-1,Ue=-1,G=false,V=false,Ie=0,K=false,ye=0,Fe.clear(),clearTimeout(De),je(),Ne=true,Me&&Ye();},pause(){K=true,Qe();},resume(){K&&(K=false,Ne=true,Me&&Ye());},seek(s){let c=Math.min(1,Math.max(0,s));ye=c,ge=c,K=true,Qe(),zt(c,L),Ne=true;},getProgress(){return ye},refresh(){clearTimeout(Ze),yt(),Me&&!K&&Ye();}},()=>({tStart:f,tEnd:de}))}function tr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Pt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let i=[],o=[],a=t[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(m?parseFloat(m[1]):0),o.push(m?m[2]:"");}n.push({fn:t[1],nums:i,units:o});}return n}function rr(e,n,r){let t=Pt(e),i=Pt(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((o,a)=>{let u=i[a];return o.fn!==u.fn||o.nums.length!==u.nums.length?r<1?`${o.fn}(${o.nums.map((m,p)=>`${m}${o.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${o.fn}(${o.nums.map((m,p)=>`${m+(u.nums[p]-m)*r}${o.units[p]}`).join(", ")})`}).join(" ")}function Lt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(tr(t))return _e(t,i,r);if(t.includes("("))return rr(t,i,r);let o=t.match(/^([-+]?[\d.]+)(.*)$/),a=i.match(/^([-+]?[\d.]+)(.*)$/);if(o&&a){let u=parseFloat(o[1]),m=parseFloat(a[1]);return `${u+(m-u)*r}${o[2]||a[2]}`}return r<1?t:i}function nr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var or=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),sr=0,Ct="--scroll-draw-progress";function ir(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function $t(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:o="ease-out",speed:a=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:R=false,respectReducedMotion:L=true,triggerElement:te,onProgress:ve,onComplete:N,onEnter:q,onLeave:D,onEnterBack:H,onLeaveBack:M}=n,C=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof o=="function"?o:Q[o]??Q["ease-out"],w=ne(i.start??"top bottom"),$=ne(i.end??"bottom top"),k=te??e,v=typeof p=="string"?document.querySelector(p):p??null,y=Object.entries(t).map(([l,f])=>({prop:nr(l),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function U(){let l=window.getComputedStyle(e);for(let f of y)f.from===""&&(f.from=l.getPropertyValue(f.prop).trim()||"0");}function I(){for(let l of y)e.style.setProperty(l.prop,String(l.to));}let W=new Map;for(let l of [...y.map(f=>f.prop),Ct])W.set(l,e.style.getPropertyValue(l));function j(){for(let[l,f]of W)f?e.style.setProperty(l,f):e.style.removeProperty(l);}if(C)return I(),N?.(),{...r,destroy:j,getProgress:()=>1};U();let oe=typeof o=="string"?et(o):null;function ue(){if(!T||!ir()||!oe||m!=="y"||v||k!==e||u||a!==1||ve||N||q||D||H||M||R!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let l of y)if(!or.has(l.prop))return false;return true}function h(){let l=`ssd-a-${++sr}`,f=y.map(se=>`${se.prop}:${se.from}`).join(";"),de=y.map(se=>`${se.prop}:${se.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${l}{from{${f}}to{${de}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${oe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(l);let G=()=>m==="x"?window.scrollX:window.scrollY,X=()=>m==="x"?window.innerWidth:window.innerHeight,Me=()=>{let se=e.getBoundingClientRect();return be({top:se.top,height:se.height},G(),X(),w,$)};Le(e,{type:"animate",getProgress:()=>ge.getProgress(),getTrigger:Me});let ge={destroy(){e.classList.remove(l),V.remove(),e.style.animationPlayState="",j(),Ce(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(se){let K=Math.min(1,Math.max(0,se));e.classList.remove(l);for(let ye of y)e.style.setProperty(ye.prop,Lt(ye.from,ye.to,K));},getProgress(){let{tStart:se,tEnd:K}=Me();return A(Z(G(),se,K,a))}};return ge}if(ue())return h();let P=0,g=0,d=0,z=false,pe=false,Te=-1,me=0,xe=false,$e=NaN,He=-1,Se=0,Ee=()=>v?m==="x"?v.scrollLeft:v.scrollTop:m==="x"?window.scrollX:window.scrollY,ie=()=>v?m==="x"?v.clientWidth:v.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ae(){let l=Je(k,v,m),f=be(l,l.scroll,ie(),w,$);P=f.tStart,g=f.tEnd;}function J(l){e.style.setProperty(Ct,String(l));for(let f of y)e.style.setProperty(f.prop,Lt(f.from,f.to,l));ve?.(l);}function fe(l){if(isNaN($e)){$e=l;return}$e<=0&&l>0?q?.():$e>0&&l<=0&&M?.(),$e<1&&l>=1?D?.():$e>=1&&l<1&&H?.(),$e=l;}function re(){if(!z||pe)return;let l=performance.now(),f=Ee(),de=a;if(R!==false){let X=l-Se,Me=X>0?Math.abs(f-(He<0?f:He))/X:0;de=a*Math.max(.2,1+Me*(typeof R=="number"?R:1)*.04);}He=f,Se=l;let V=g===P?0:(f-P)/(g-P);fe(V);let G=A(Z(f,P,g,de));u&&(Te=Math.max(Te,G),G=Te),me=G,J(G),G>=1&&!xe?(xe=true,N?.()):G<1&&!u&&(xe=false),d=requestAnimationFrame(re);}ae(),g===P&&we("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let l=A(Z(Ee(),P,g,a));u&&l>0&&(Te=l),me=l,J(l);}let Re=new IntersectionObserver(l=>{l.forEach(f=>{z=f.isIntersecting,z&&!pe?d=requestAnimationFrame(re):cancelAnimationFrame(d);});},{root:v??null}),B;function O(){clearTimeout(B),B=setTimeout(ae,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Re.observe(e),Le(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:P,tEnd:g})}),{destroy(){cancelAnimationFrame(d),Re.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(B),j(),Ce(e);},replay(){Te=-1,xe=false,me=0,pe=false,J(0);},pause(){pe=true,cancelAnimationFrame(d);},resume(){pe&&(pe=false,z&&(d=requestAnimationFrame(re)));},seek(l){let f=Math.min(1,Math.max(0,l));me=f,Te=f,pe=true,cancelAnimationFrame(d),J(f);},getProgress(){return me}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Rt(e,n){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollCounter: element not found:",e),lt;let t=r,{from:i=0,to:o,format:a,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:R}=n,L=T!==void 0?h=>h.toFixed(T):a??(h=>String(Math.round(h))),te=typeof u=="function"?u:Q[u]??Q["ease-out"],ve=ne(m.start??"top 80%"),N=ne(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(o),R?.(),lt;let D=0,H=0,M=0,C=false,A=false,w=-1,$=0,k=false,v=()=>window.scrollY,y=()=>window.innerHeight;function U(){let h=t.getBoundingClientRect(),P=be({top:h.top,height:h.height},v(),y(),ve,N);D=P.tStart,H=P.tEnd;}function I(h){t.textContent=L(i+(o-i)*h),t.style.setProperty("--scroll-draw-progress",String(h));}function W(){if(!C||A)return;let h=te(Z(v(),D,H,1));p&&(w=Math.max(w,h),h=w),$=h,I(h),h>=1&&!k?(k=true,R?.()):h<1&&!p&&(k=false),M=requestAnimationFrame(W);}U();{let h=te(Z(v(),D,H,1));p&&h>0&&(w=h),$=h,I(h);}let j=new IntersectionObserver(h=>{h.forEach(P=>{C=P.isIntersecting,C&&!A?M=requestAnimationFrame(W):cancelAnimationFrame(M);});}),oe;function ue(){clearTimeout(oe),oe=setTimeout(U,150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),j.observe(t),Le(t,{type:"counter",getProgress:()=>$,getTrigger:()=>({tStart:D,tEnd:H})}),{destroy(){cancelAnimationFrame(M),j.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(oe),Ce(t);},replay(){w=-1,k=false,$=0,A=false,I(0);},pause(){A=true,cancelAnimationFrame(M);},resume(){A&&(A=false,C&&(M=requestAnimationFrame(W)));},seek(h){let P=Math.min(1,Math.max(0,h));$=P,w=P,A=true,cancelAnimationFrame(M),I(P);},getProgress(){return $}}}var kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function It(e,n={}){if(typeof window>"u")return kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),kt;let t=r,{trigger:i={},easing:o="linear",once:a=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:R}=n,L=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof o=="function"?o:Q[o]??Q.linear,ve=ne(i.start??"top top"),N=ne(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let q=n.from??0,D=n.to,H=0,M=0,C=0,A=false,w=false,$=-1,k=0,v=false,y=false,U=()=>u==="x"?window.scrollX:window.scrollY,I=()=>u==="x"?window.innerWidth:window.innerHeight;function W(){let d=t.getBoundingClientRect(),z=u==="x"?d.left:d.top,pe=u==="x"?d.width:d.height,Te=be({top:z,height:pe},U(),I(),ve,N);H=Te.tStart,M=Te.tEnd;}function j(d){if(!y)return;let z=D??t.duration??0;t.currentTime=q+(z-q)*d,t.style.setProperty("--scroll-draw-progress",String(d)),R?.(d);}function oe(){if(!A||w||!y)return;let d=te(Z(U(),H,M,1));a&&($=Math.max($,d),d=$),k=d,j(d),d>=1&&!v?(v=true,T?.()):d<1&&!a&&(v=false),C=requestAnimationFrame(oe);}function ue(){if(y=true,D===void 0&&(D=t.duration),L){j(1),p?.();return}W(),p?.(),A&&!w&&(C=requestAnimationFrame(oe));}t.readyState>=1?ue():t.addEventListener("loadedmetadata",ue,{once:true}),y||W();let h=new IntersectionObserver(d=>{d.forEach(z=>{A=z.isIntersecting,A&&!w&&y?C=requestAnimationFrame(oe):cancelAnimationFrame(C);});}),P;function g(){clearTimeout(P),P=setTimeout(W,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),h.observe(t),Le(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:H,tEnd:M})}),{destroy(){cancelAnimationFrame(C),h.disconnect(),t.removeEventListener("loadedmetadata",ue),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(P),Ce(t);},replay(){$=-1,v=false,k=0,w=false,j(0);},pause(){w=true,cancelAnimationFrame(C);},resume(){w&&(w=false,A&&y&&(C=requestAnimationFrame(oe)));},seek(d){let z=Math.min(1,Math.max(0,d));k=z,$=z,w=true,cancelAnimationFrame(C),j(z);},getProgress(){return k}}}function Ft(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 ar(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 Ot(e){let n=Ft(e),r=new Map;for(let o of n){let a=o.offsetTop;r.has(a)||r.set(a,[]),r.get(a).push(o);}let t=[],i=Array.from(r.keys()).sort((o,a)=>o-a);for(let o of i){let a=r.get(o),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",a.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<a.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((o,a)=>{e.appendChild(o),a<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function lr(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,o=n*t,a=o+(1-i);return a<=o?e>=o?1:0:Math.min(1,Math.max(0,(e-o)/(a-o)))}function cr(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 Nt(e,n={}){if(typeof window>"u")return Dt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return we("scrollText: element not found:",e),Dt;let t=r,{split:i="words",stagger:o=.04,easing:a="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=n,R=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof a=="function"?a:Q[a]??Q["ease-out"],te=ne(m.start??"top 85%"),ve=ne(m.end??"top 40%"),N=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let q;i==="chars"?q=ar(t):i==="lines"?q=Ot(t):q=Ft(t);let D=q.length;function H(g,d){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*d));let z=cr(d,u);z&&(g.style.transform=z);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),q.forEach((d,z)=>{let pe=L(lr(g,z,D,o));H(d,pe);});}if(R)return M(1),T?.(),{destroy(){t.innerHTML=N,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let C=0,A=0,w=0,$=false,k=false,v=-1,y=0,U=false,I=()=>window.scrollY,W=()=>window.innerHeight;function j(){let g=t.getBoundingClientRect(),d=be({top:g.top,height:g.height},I(),W(),te,ve);C=d.tStart,A=d.tEnd;}function oe(){if(!$||k)return;let g=Z(I(),C,A,1);p&&(v=Math.max(v,g),g=v),y=g,M(g),g>=1&&!U?(U=true,T?.()):g<1&&!p&&(U=false),w=requestAnimationFrame(oe);}j();let ue=new IntersectionObserver(g=>{g.forEach(d=>{$=d.isIntersecting,$&&!k?w=requestAnimationFrame(oe):cancelAnimationFrame(w);});}),h;function P(){clearTimeout(h),h=setTimeout(()=>{if(i==="lines"){let g=y;t.innerHTML=N,t.setAttribute("aria-label",t.textContent??""),q=Ot(t),M(g);}j();},150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),ue.observe(t),Le(t,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:C,tEnd:A})}),{destroy(){cancelAnimationFrame(w),ue.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(h),t.innerHTML=N,t.removeAttribute("aria-label"),Ce(t);},replay(){v=-1,U=false,y=0,k=false,M(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,$&&(w=requestAnimationFrame(oe)));},seek(g){let d=Math.min(1,Math.max(0,g));y=d,v=d,k=true,cancelAnimationFrame(w),M(d);},getProgress(){return y}}}function fr(e,n={}){let[r,t]=useState(0),i=useRef(n);i.current=n;let o=useRef(-1);return useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let a=typeof e=="string"?document.querySelector(e):e.current;if(!a)return;let u=a,{axis:m="y",scrollContainer:p,trigger:T={}}=i.current,R=typeof p=="string"?document.querySelector(p):p??null,L=ne(T.start??"top bottom"),te=ne(T.end??"bottom top"),ve=0,N=0,q=false,D=0;function H(){return R?m==="x"?R.scrollLeft:R.scrollTop:m==="x"?window.scrollX:window.scrollY}function M(){return R?m==="x"?R.clientWidth:R.clientHeight:m==="x"?window.innerWidth:window.innerHeight}function C(){let v=u.getBoundingClientRect(),y=H(),U=m==="x"?v.left:v.top,I=m==="x"?v.width:v.height,W=be({top:U,height:I},y,M(),L,te);ve=W.tStart,N=W.tEnd;}function A(){if(!q)return;let{speed:v=1,easing:y="linear",once:U=false}=i.current,I=typeof y=="function"?y:Q[y]??Q.linear,W=Z(H(),ve,N,v),j=I(W);U&&(o.current=Math.max(o.current,j),j=o.current),t(j),D=requestAnimationFrame(A);}let w=new IntersectionObserver(v=>{v.forEach(y=>{q=y.isIntersecting,q?D=requestAnimationFrame(A):cancelAnimationFrame(D);});},{root:R??null,threshold:0});C(),w.observe(u);let $;function k(){clearTimeout($),$=setTimeout(C,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),()=>{cancelAnimationFrame(D),clearTimeout($),w.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k);}},[]),r}function Jr({children:e,className:n,style:r,...t}){let i=useRef(null);return useEffect(()=>{if(!i.current)return;let o=Mt(i.current,t);return ()=>o.destroy()},[]),jsx("div",{ref:i,className:n,style:r,children:e})}function Kr({children:e,className:n,style:r,...t}){let i=useRef(null);return useEffect(()=>{if(!i.current)return;let o=$t(i.current,t);return ()=>o.destroy()},[]),jsx("div",{ref:i,className:n,style:r,children:e})}function en({className:e,style:n,...r}){let t=useRef(null);return useEffect(()=>{if(!t.current)return;let i=Rt(t.current,r);return ()=>i.destroy()},[]),jsx("span",{ref:t,className:e,style:n})}function tn({src:e,className:n,style:r,muted:t=true,playsInline:i=true,...o}){let a=useRef(null);return useEffect(()=>{if(!a.current)return;let u=It(a.current,o);return ()=>u.destroy()},[]),jsx("video",{ref:a,src:e,className:n,style:r,muted:t,playsInline:i,preload:"auto"})}function rn({children:e,as:n="p",className:r,style:t,...i}){let o=useRef(null);return useEffect(()=>{if(!o.current)return;let a=Nt(o.current,i);return ()=>a.destroy()},[]),pr.createElement(n,{ref:o,className:r,style:t},e)}export{Kr as ScrollAnimate,en as ScrollCounter,Jr as ScrollDraw,rn as ScrollText,tn as ScrollVideo,fr as useScrollDrawProgress};
@@ -1 +1 @@
1
- 'use strict';function Ee({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),u=Math.sqrt(r),s=0,m=[];for(let c=0;c<t;c++){let p=Math.pow(u,c);m.push(p),s+=p;}let l=[0],a=0;for(let c=0;c<t;c++)a+=m[c]/s,l.push(a);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let p=0;p<t;p++)if(c<=l[p+1]){let d=(c-l[p])/(l[p+1]-l[p]);if(p===0)return d*(2-d);let v=1-Math.pow(r,p);return v+(1-v)*(2*d-1)*(2*d-1)}return 1}}function xe({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),u=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return s=>s<=0?0:s>=1?1:t*Math.pow(2,-10*s)*Math.sin((s-u)*(2*Math.PI)/r)+1}var j={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:Ee(),elastic:xe()};function G(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}function te(e,n,t,r){switch(r){case "top":return e+t;case "center":return e+t+n/2;case "bottom":return e+t+n;default:return e+t}}function ne(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 Se(e,n,t){return Math.min(t,Math.max(n,e))}function B(e,n,t,r){return t===n?0:Se((e-n)/(t-n)*r,0,1)}function U(e,n,t,r,u){let s=te(e.top,e.height,n,r.element)-ne(r.viewport,t),m=te(e.top,e.height,n,u.element)-ne(u.viewport,t);return {tStart:s,tEnd:m}}function re(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 t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function oe(e,n,t){let r=re(e),u=re(n);return !r||!u?e:`rgb(${Math.round(r[0]+(u[0]-r[0])*t)},${Math.round(r[1]+(u[1]-r[1])*t)},${Math.round(r[2]+(u[2]-r[2])*t)})`}var se=new Map;function ie(e,n){se.set(e,n);}function ae(e){se.delete(e);}function Me(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ue(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let u=[],s=[],m=r[2].trim();if(m)for(let l of m.split(/[\s,]+/)){let a=l.match(/^([-+]?[\d.eE]+)(.*)$/);u.push(a?parseFloat(a[1]):0),s.push(a?a[2]:"");}n.push({fn:r[1],nums:u,units:s});}return n}function Pe(e,n,t){let r=ue(e),u=ue(n);return r.length===0||r.length!==u.length?t<1?e:n:r.map((s,m)=>{let l=u[m];return s.fn!==l.fn||s.nums.length!==l.nums.length?t<1?`${s.fn}(${s.nums.map((a,c)=>`${a}${s.units[c]}`).join(", ")})`:`${l.fn}(${l.nums.map((a,c)=>`${a}${l.units[c]}`).join(", ")})`:`${s.fn}(${s.nums.map((a,c)=>`${a+(l.nums[c]-a)*t}${s.units[c]}`).join(", ")})`}).join(" ")}function ce(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),u=String(n);if(Me(r))return oe(r,u,t);if(r.includes("("))return Pe(r,u,t);let s=r.match(/^([-+]?[\d.]+)(.*)$/),m=u.match(/^([-+]?[\d.]+)(.*)$/);if(s&&m){let l=parseFloat(s[1]),a=parseFloat(m[1]);return `${l+(a-l)*t}${s[2]||m[2]}`}return t<1?r:u}function $e(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var le={linear:"linear","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"},Ae=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Te=0;function Le(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function me(e,n){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let{props:r,trigger:u={},easing:s="ease-out",speed:m=1,once:l=false,axis:a="y",scrollContainer:c,native:p=true,velocityScale:d=false,onProgress:v,onComplete:R,onEnter:F,onLeave:P,onEnterBack:$,onLeaveBack:I}=n,k=window.matchMedia("(prefers-reduced-motion: reduce)").matches,H=typeof s=="function"?s:j[s]??j["ease-out"],Z=G(u.start??"top bottom"),J=G(u.end??"bottom top"),f=typeof c=="string"?document.querySelector(c):c??null,w=Object.entries(r).map(([o,i])=>({prop:$e(o),from:Array.isArray(i)?i[0]:"",to:Array.isArray(i)?i[1]:i}));function fe(){let o=window.getComputedStyle(e);for(let i of w)i.from===""&&(i.from=o.getPropertyValue(i.prop).trim()||"0");}function ge(){for(let o of w)e.style.setProperty(o.prop,String(o.to));}if(k)return ge(),R?.(),t;fe();function de(){if(!p||!Le()||typeof s!="string"||!(s in le)||a!=="y"||f||l||m!==1||v||R||F||P||$||I||d!==false||(u.start??"top bottom").trim()!=="top bottom"||(u.end??"bottom top").trim()!=="bottom top")return false;for(let o of w)if(!Ae.has(o.prop))return false;return true}function be(){let o=`ssd-a-${++Te}`,i=w.map(g=>`${g.prop}:${g.from}`).join(";"),y=w.map(g=>`${g.prop}:${g.to}`).join(";"),h=document.createElement("style");h.setAttribute("data-ssd-animate",""),h.textContent=`@keyframes ${o}{from{${i}}to{${y}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${le[s]};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(h),e.classList.add(o);let b=()=>a==="x"?window.scrollX:window.scrollY,D=()=>a==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(o),h.remove();},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(g){let N=Math.min(1,Math.max(0,g));e.classList.remove(o);for(let C of w)e.style.setProperty(C.prop,ce(C.from,C.to,N));},getProgress(){let g=e.getBoundingClientRect(),N=b(),C=D(),{tStart:ve,tEnd:we}=U({top:g.top,height:g.height},N,C,Z,J);return H(B(N,ve,we,m))}}}if(de())return be();let E=0,A=0,x=0,O=false,S=false,T=-1,L=0,V=false,M=NaN,Y=-1,K=0,q=()=>f?a==="x"?f.scrollLeft:f.scrollTop:a==="x"?window.scrollX:window.scrollY,he=()=>f?a==="x"?f.clientWidth:f.clientHeight:a==="x"?window.innerWidth:window.innerHeight;function Q(){let o=e.getBoundingClientRect(),i,y;if(f){let b=f.getBoundingClientRect();i=a==="x"?o.left-b.left+f.scrollLeft:o.top-b.top+f.scrollTop,y=a==="x"?o.width:o.height;}else i=a==="x"?o.left:o.top,y=a==="x"?o.width:o.height;let h=U({top:i,height:y},q(),he(),Z,J);E=h.tStart,A=h.tEnd;}function X(o){e.style.setProperty("--scroll-draw-progress",String(o));for(let i of w)e.style.setProperty(i.prop,ce(i.from,i.to,o));v?.(o);}function ye(o){if(isNaN(M)){M=o;return}M<=0&&o>0?F?.():M>0&&o<=0&&I?.(),M<1&&o>=1?P?.():M>=1&&o<1&&$?.(),M=o;}function z(){if(!O||S)return;let o=performance.now(),i=q(),y=m;if(d!==false){let D=o-K,g=D>0?Math.abs(i-(Y<0?i:Y))/D:0;y=m*Math.max(.2,1+g*(typeof d=="number"?d:1)*.04);}Y=i,K=o;let h=A===E?0:(i-E)/(A-E);ye(h);let b=H(B(i,E,A,y));l&&(T=Math.max(T,b),b=T),L=b,X(b),b>=1&&!V?(V=true,R?.()):b<1&&!l&&(V=false),x=requestAnimationFrame(z);}Q();{let o=H(B(q(),E,A,m));l&&o>0&&(T=o),L=o,X(o);}let ee=new IntersectionObserver(o=>{o.forEach(i=>{O=i.isIntersecting,O&&!S?x=requestAnimationFrame(z):cancelAnimationFrame(x);});},{root:f??null}),W;function _(){clearTimeout(W),W=setTimeout(Q,150);}return window.addEventListener("resize",_),window.addEventListener("orientationchange",_),ee.observe(e),ie(e,{type:"animate",getProgress:()=>L,getTrigger:()=>({tStart:E,tEnd:A})}),{destroy(){cancelAnimationFrame(x),ee.disconnect(),window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_),clearTimeout(W),ae(e);},replay(){T=-1,V=false,L=0,S=false,X(0);},pause(){S=true,cancelAnimationFrame(x);},resume(){S&&(S=false,O&&(x=requestAnimationFrame(z)));},seek(o){let i=Math.min(1,Math.max(0,o));L=i,T=i,S=true,cancelAnimationFrame(x),X(i);},getProgress(){return L}}}var Re={fadeUp:{opacity:0,y:32},fadeDown:{opacity:0,y:-32},fadeLeft:{opacity:0,x:32},fadeRight:{opacity:0,x:-32},scale:{opacity:0,scale:.88},flip:{opacity:0,rotateX:20},flipX:{opacity:0,rotateY:20}};function Ie(e){let n={};e.opacity!==void 0&&(n.opacity=[e.opacity,1]);let t=[],r=[];return e.x!==void 0&&(t.push(`translateX(${e.x}px)`),r.push("translateX(0px)")),e.y!==void 0&&(t.push(`translateY(${e.y}px)`),r.push("translateY(0px)")),e.scale!==void 0&&(t.push(`scale(${e.scale})`),r.push("scale(1)")),e.rotate!==void 0&&(t.push(`rotate(${e.rotate}deg)`),r.push("rotate(0deg)")),e.rotateX!==void 0&&(t.push(`rotateX(${e.rotateX}deg)`),r.push("rotateX(0deg)")),e.rotateY!==void 0&&(t.push(`rotateY(${e.rotateY}deg)`),r.push("rotateY(0deg)")),t.length>0&&(n.transform=[t.join(" "),r.join(" ")]),n}function Ne(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}var pe={destroy:()=>{}};function De(e,n={}){if(typeof window>"u")return pe;let t=Ne(e);if(!t.length)return process.env.NODE_ENV!=="production"&&console.warn("[svg-scroll-draw] scrollReveal: no elements found:",e),pe;let{preset:r="fadeUp",from:u,stagger:s=.08,easing:m="ease-out",once:l=true,trigger:a,onEnter:c,onLeave:p}=n,d={...Re[r],...u},v=Ie(d),R=Math.min(s*4,4),F=t.map((P,$)=>{let I=Math.max(50,88-$*R),k=Math.max(20,I-35);return me(P,{props:v,easing:m,once:l,native:false,trigger:a??{start:`top ${I}%`,end:`top ${k}%`},onEnter:$===0?c:void 0,onLeave:$===t.length-1?p:void 0})});return {destroy(){F.forEach(P=>P.destroy());}}}exports.scrollReveal=De;
1
+ 'use strict';function _e({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),a=Math.sqrt(r),i=0,m=[];for(let c=0;c<t;c++){let p=Math.pow(a,c);m.push(p),i+=p;}let l=[0],u=0;for(let c=0;c<t;c++)u+=m[c]/i,l.push(u);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let p=0;p<t;p++)if(c<=l[p+1]){let g=(c-l[p])/(l[p+1]-l[p]);if(p===0)return g*(2-g);let M=1-Math.pow(r,p);return M+(1-M)*(2*g-1)*(2*g-1)}return 1}}function Ce({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),a=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-a)*(2*Math.PI)/r)+1}var $={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:_e(),elastic:Ce()};function K(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}function me(e,n,t,r){switch(r){case "top":return e+t;case "center":return e+t+n/2;case "bottom":return e+t+n;default:return e+t}}function pe(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 Ne(e,n,t){return Math.min(t,Math.max(n,e))}function X(e,n,t,r){return t===n?0:Ne((e-n)/(t-n)*r,0,1)}function ge(e,n,t){let r=e.getBoundingClientRect(),a=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left+n.scrollLeft:r.top-n.getBoundingClientRect().top+n.scrollTop,height:a,scroll:0}:{top:t==="x"?r.left:r.top,height:a,scroll:t==="x"?window.scrollX:window.scrollY}}function Z(e,n,t,r,a){let i=me(e.top,e.height,n,r.element)-pe(r.viewport,t),m=me(e.top,e.height,n,a.element)-pe(a.viewport,t);return {tStart:i,tEnd:m}}function fe(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 t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function de(e,n,t){let r=fe(e),a=fe(n);return !r||!a?e:`rgb(${Math.round(r[0]+(a[0]-r[0])*t)},${Math.round(r[1]+(a[1]-r[1])*t)},${Math.round(r[2]+(a[2]-r[2])*t)})`}var Fe="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Oe="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",be=33;function De(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ve(e){let n=[];for(let t=0;t<be;t++){let r=t/(be-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function ye(e){switch(e){case "linear":return "linear";case "ease-in":return Fe;case "ease-out":return Oe;case "ease-in-out":return De()?Ve($["ease-in-out"]):null;default:return null}}var he=Symbol.for("svg-scroll-draw.registry");function we(){let e=globalThis;return e[he]||(e[he]=new Map)}function J(e,n){we().set(e,n);}function ee(e){we().delete(e);}var He=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function k(e,...n){He&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function Xe(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ee(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let a=[],i=[],m=r[2].trim();if(m)for(let l of m.split(/[\s,]+/)){let u=l.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"");}n.push({fn:r[1],nums:a,units:i});}return n}function ke(e,n,t){let r=Ee(e),a=Ee(n);return r.length===0||r.length!==a.length?t<1?e:n:r.map((i,m)=>{let l=a[m];return i.fn!==l.fn||i.nums.length!==l.nums.length?t<1?`${i.fn}(${i.nums.map((u,c)=>`${u}${i.units[c]}`).join(", ")})`:`${l.fn}(${l.nums.map((u,c)=>`${u}${l.units[c]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,c)=>`${u+(l.nums[c]-u)*t}${i.units[c]}`).join(", ")})`}).join(" ")}function Se(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),a=String(n);if(Xe(r))return de(r,a,t);if(r.includes("("))return ke(r,a,t);let i=r.match(/^([-+]?[\d.]+)(.*)$/),m=a.match(/^([-+]?[\d.]+)(.*)$/);if(i&&m){let l=parseFloat(i[1]),u=parseFloat(m[1]);return `${l+(u-l)*t}${i[2]||m[2]}`}return t<1?r:a}function Be(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var ze=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),We=0,ve="--scroll-draw-progress";function Ye(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function xe(e,n){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let{props:r,trigger:a={},easing:i="ease-out",speed:m=1,once:l=false,axis:u="y",scrollContainer:c,native:p=true,velocityScale:g=false,respectReducedMotion:M=true,triggerElement:B,onProgress:I,onComplete:w,onEnter:P,onLeave:A,onEnterBack:_,onLeaveBack:te}=n,Pe=M&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,z=typeof i=="function"?i:$[i]??$["ease-out"],ne=K(a.start??"top bottom"),re=K(a.end??"bottom top"),oe=B??e,d=typeof c=="string"?document.querySelector(c):c??null,y=Object.entries(r).map(([o,s])=>({prop:Be(o),from:Array.isArray(s)?s[0]:"",to:Array.isArray(s)?s[1]:s}));function Te(){let o=window.getComputedStyle(e);for(let s of y)s.from===""&&(s.from=o.getPropertyValue(s.prop).trim()||"0");}function Re(){for(let o of y)e.style.setProperty(o.prop,String(o.to));}let se=new Map;for(let o of [...y.map(s=>s.prop),ve])se.set(o,e.style.getPropertyValue(o));function W(){for(let[o,s]of se)s?e.style.setProperty(o,s):e.style.removeProperty(o);}if(Pe)return Re(),w?.(),{...t,destroy:W,getProgress:()=>1};Te();let ie=typeof i=="string"?ye(i):null;function Le(){if(!p||!Ye()||!ie||u!=="y"||d||oe!==e||l||m!==1||I||w||P||A||_||te||g!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let o of y)if(!ze.has(o.prop))return false;return true}function Ae(){let o=`ssd-a-${++We}`,s=y.map(f=>`${f.prop}:${f.from}`).join(";"),D=y.map(f=>`${f.prop}:${f.to}`).join(";"),L=document.createElement("style");L.setAttribute("data-ssd-animate",""),L.textContent=`@keyframes ${o}{from{${s}}to{${D}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${ie};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(L),e.classList.add(o);let b=()=>u==="x"?window.scrollX:window.scrollY,V=()=>u==="x"?window.innerWidth:window.innerHeight,H=()=>{let f=e.getBoundingClientRect();return Z({top:f.top,height:f.height},b(),V(),ne,re)};J(e,{type:"animate",getProgress:()=>q.getProgress(),getTrigger:H});let q={destroy(){e.classList.remove(o),L.remove(),e.style.animationPlayState="",W(),ee(e);},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(f){let U=Math.min(1,Math.max(0,f));e.classList.remove(o);for(let Q of y)e.style.setProperty(Q.prop,Se(Q.from,Q.to,U));},getProgress(){let{tStart:f,tEnd:U}=H();return z(X(b(),f,U,m))}};return q}if(Le())return Ae();let h=0,E=0,S=0,C=false,v=false,T=-1,R=0,N=false,x=NaN,Y=-1,ae=0,ue=()=>d?u==="x"?d.scrollLeft:d.scrollTop:u==="x"?window.scrollX:window.scrollY,$e=()=>d?u==="x"?d.clientWidth:d.clientHeight:u==="x"?window.innerWidth:window.innerHeight;function ce(){let o=ge(oe,d,u),s=Z(o,o.scroll,$e(),ne,re);h=s.tStart,E=s.tEnd;}function F(o){e.style.setProperty(ve,String(o));for(let s of y)e.style.setProperty(s.prop,Se(s.from,s.to,o));I?.(o);}function Ie(o){if(isNaN(x)){x=o;return}x<=0&&o>0?P?.():x>0&&o<=0&&te?.(),x<1&&o>=1?A?.():x>=1&&o<1&&_?.(),x=o;}function G(){if(!C||v)return;let o=performance.now(),s=ue(),D=m;if(g!==false){let V=o-ae,H=V>0?Math.abs(s-(Y<0?s:Y))/V:0;D=m*Math.max(.2,1+H*(typeof g=="number"?g:1)*.04);}Y=s,ae=o;let L=E===h?0:(s-h)/(E-h);Ie(L);let b=z(X(s,h,E,D));l&&(T=Math.max(T,b),b=T),R=b,F(b),b>=1&&!N?(N=true,w?.()):b<1&&!l&&(N=false),S=requestAnimationFrame(G);}ce(),E===h&&k("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let o=z(X(ue(),h,E,m));l&&o>0&&(T=o),R=o,F(o);}let le=new IntersectionObserver(o=>{o.forEach(s=>{C=s.isIntersecting,C&&!v?S=requestAnimationFrame(G):cancelAnimationFrame(S);});},{root:d??null}),j;function O(){clearTimeout(j),j=setTimeout(ce,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),le.observe(e),J(e,{type:"animate",getProgress:()=>R,getTrigger:()=>({tStart:h,tEnd:E})}),{destroy(){cancelAnimationFrame(S),le.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(j),W(),ee(e);},replay(){T=-1,N=false,R=0,v=false,F(0);},pause(){v=true,cancelAnimationFrame(S);},resume(){v&&(v=false,C&&(S=requestAnimationFrame(G)));},seek(o){let s=Math.min(1,Math.max(0,o));R=s,T=s,v=true,cancelAnimationFrame(S),F(s);},getProgress(){return R}}}var Ge={fadeUp:{opacity:0,y:32},fadeDown:{opacity:0,y:-32},fadeLeft:{opacity:0,x:32},fadeRight:{opacity:0,x:-32},scale:{opacity:0,scale:.88},flip:{opacity:0,rotateX:20},flipX:{opacity:0,rotateY:20}};function je(e){let n={};e.opacity!==void 0&&(n.opacity=[e.opacity,1]);let t=[],r=[];return e.x!==void 0&&(t.push(`translateX(${e.x}px)`),r.push("translateX(0px)")),e.y!==void 0&&(t.push(`translateY(${e.y}px)`),r.push("translateY(0px)")),e.scale!==void 0&&(t.push(`scale(${e.scale})`),r.push("scale(1)")),e.rotate!==void 0&&(t.push(`rotate(${e.rotate}deg)`),r.push("rotate(0deg)")),e.rotateX!==void 0&&(t.push(`rotateX(${e.rotateX}deg)`),r.push("rotateX(0deg)")),e.rotateY!==void 0&&(t.push(`rotateY(${e.rotateY}deg)`),r.push("rotateY(0deg)")),t.length>0&&(n.transform=[t.join(" "),r.join(" ")]),n}function qe(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}var Me={destroy:()=>{}};function at(e,n={}){if(typeof window>"u")return Me;let t=qe(e);if(!t.length)return k("scrollReveal: no elements found:",e),Me;let{preset:r="fadeUp",from:a,stagger:i=.08,easing:m="ease-out",once:l=true,trigger:u,onEnter:c,onLeave:p}=n,g={...Ge[r],...a},M=je(g),B=Math.min(i*4,4),I=t.map((w,P)=>{let A=Math.max(50,88-P*B),_=Math.max(20,A-35);return xe(w,{props:M,easing:m,once:l,native:false,trigger:u??{start:`top ${A}%`,end:`top ${_}%`},onEnter:P===0?c:void 0,onLeave:P===t.length-1?p:void 0})});return {destroy(){I.forEach(w=>w.destroy());}}}exports.scrollReveal=at;