svg-scroll-draw 2.25.0 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +116 -15
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +60 -6
  4. package/dist/angular/index.d.ts +60 -6
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +2 -2
  7. package/dist/astro/index.d.mts +3 -3
  8. package/dist/astro/index.d.ts +3 -3
  9. package/dist/astro/index.mjs +1 -1
  10. package/dist/cdn/svg-scroll-draw.dev.global.js +69 -31
  11. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  12. package/dist/chunk-5SJE7725.mjs +1 -0
  13. package/dist/{chunk-NX74KN5X.mjs → chunk-5U4JXBHR.mjs} +1 -1
  14. package/dist/chunk-7LDSB4FT.mjs +1 -0
  15. package/dist/chunk-ASCOHQQD.mjs +2 -0
  16. package/dist/chunk-GBFWTY5L.mjs +1 -0
  17. package/dist/chunk-HAGTU5EX.mjs +1 -0
  18. package/dist/chunk-HJTHOZK5.mjs +1 -0
  19. package/dist/chunk-IXR6RML7.mjs +1 -0
  20. package/dist/chunk-KN2YB54Z.mjs +1 -0
  21. package/dist/chunk-NJV6S5LD.mjs +1 -0
  22. package/dist/chunk-UBH4K5YD.mjs +1 -0
  23. package/dist/chunk-UF3MO5XQ.mjs +1 -0
  24. package/dist/chunk-XLXVGQ3P.mjs +3 -0
  25. package/dist/chunk-YOOPMYT6.mjs +1 -0
  26. package/dist/chunk-Z72TVDHY.mjs +1 -0
  27. package/dist/cinematic/index.cjs +2 -2
  28. package/dist/cinematic/index.d.mts +3 -1
  29. package/dist/cinematic/index.d.ts +3 -1
  30. package/dist/cinematic/index.mjs +1 -1
  31. package/dist/{engine-6VsjEwzb.d.ts → engine-Bi2x8-X-.d.mts} +2 -2
  32. package/dist/{engine-BLWKCfxC.d.mts → engine-DAlvk6i0.d.ts} +2 -2
  33. package/dist/frames/index.cjs +1 -1
  34. package/dist/frames/index.d.mts +2 -2
  35. package/dist/frames/index.d.ts +2 -2
  36. package/dist/frames/index.mjs +1 -1
  37. package/dist/group/index.cjs +3 -3
  38. package/dist/group/index.d.mts +3 -3
  39. package/dist/group/index.d.ts +3 -3
  40. package/dist/group/index.mjs +1 -1
  41. package/dist/horizontal/index.cjs +1 -1
  42. package/dist/horizontal/index.d.mts +2 -2
  43. package/dist/horizontal/index.d.ts +2 -2
  44. package/dist/horizontal/index.mjs +1 -1
  45. package/dist/{index-BN8yKeQ3.d.ts → index-BMMZ8aW7.d.mts} +2 -2
  46. package/dist/{index-hSQqLVbg.d.ts → index-CEMsUTEG.d.ts} +3 -3
  47. package/dist/{index-DAiRJgtF.d.mts → index-ClAFxNEp.d.mts} +3 -3
  48. package/dist/{index-DVjblK_4.d.mts → index-MdQ4ti_z.d.ts} +2 -2
  49. package/dist/index.cjs +4 -4
  50. package/dist/index.d.mts +6 -6
  51. package/dist/index.d.ts +6 -6
  52. package/dist/index.mjs +1 -1
  53. package/dist/lenis/index.cjs +1 -1
  54. package/dist/lenis/index.d.mts +15 -16
  55. package/dist/lenis/index.d.ts +15 -16
  56. package/dist/lenis/index.mjs +1 -1
  57. package/dist/nuxt/index.cjs +3 -3
  58. package/dist/nuxt/index.d.mts +4 -3
  59. package/dist/nuxt/index.d.ts +4 -3
  60. package/dist/nuxt/index.mjs +1 -1
  61. package/dist/progress/index.cjs +1 -1
  62. package/dist/progress/index.d.mts +2 -2
  63. package/dist/progress/index.d.ts +2 -2
  64. package/dist/progress/index.mjs +1 -1
  65. package/dist/react/index.cjs +2 -2
  66. package/dist/react/index.d.mts +4 -4
  67. package/dist/react/index.d.ts +4 -4
  68. package/dist/react/index.mjs +1 -1
  69. package/dist/reveal/index.cjs +1 -1
  70. package/dist/reveal/index.d.mts +2 -2
  71. package/dist/reveal/index.d.ts +2 -2
  72. package/dist/reveal/index.mjs +1 -1
  73. package/dist/{scroll-draw-Fzir8hlU.d.mts → scroll-draw-CKZysh22.d.mts} +1 -1
  74. package/dist/{scroll-draw-BsU_Ohmu.d.ts → scroll-draw-DbY8RUJE.d.ts} +1 -1
  75. package/dist/snap/index.cjs +1 -1
  76. package/dist/snap/index.d.mts +2 -2
  77. package/dist/snap/index.d.ts +2 -2
  78. package/dist/snap/index.mjs +1 -1
  79. package/dist/solid/index.cjs +3 -3
  80. package/dist/solid/index.d.mts +40 -4
  81. package/dist/solid/index.d.ts +40 -4
  82. package/dist/solid/index.mjs +1 -1
  83. package/dist/svelte/index.cjs +3 -3
  84. package/dist/svelte/index.d.mts +47 -4
  85. package/dist/svelte/index.d.ts +47 -4
  86. package/dist/svelte/index.mjs +1 -1
  87. package/dist/text/index.cjs +1 -1
  88. package/dist/text/index.d.mts +2 -2
  89. package/dist/text/index.d.ts +2 -2
  90. package/dist/text/index.mjs +1 -1
  91. package/dist/timeline/index.cjs +10 -10
  92. package/dist/timeline/index.d.mts +2 -2
  93. package/dist/timeline/index.d.ts +2 -2
  94. package/dist/timeline/index.mjs +2 -2
  95. package/dist/{types-9bcJdVcg.d.mts → types-iITMwrru.d.mts} +10 -2
  96. package/dist/{types-9bcJdVcg.d.ts → types-iITMwrru.d.ts} +10 -2
  97. package/dist/video/index.cjs +1 -1
  98. package/dist/video/index.d.mts +2 -2
  99. package/dist/video/index.d.ts +2 -2
  100. package/dist/video/index.mjs +1 -1
  101. package/dist/vue/index.cjs +3 -3
  102. package/dist/vue/index.d.mts +4 -7
  103. package/dist/vue/index.d.ts +4 -7
  104. package/dist/vue/index.mjs +1 -1
  105. package/dist/web-component/index.cjs +3 -3
  106. package/dist/web-component/index.mjs +1 -1
  107. package/dist/wrapper-BOHrDnBO.d.mts +8 -0
  108. package/dist/wrapper-Cm7JTIVl.d.ts +8 -0
  109. package/package.json +1 -1
  110. package/dist/chunk-22P4KBPG.mjs +0 -1
  111. package/dist/chunk-32ZCSGFZ.mjs +0 -1
  112. package/dist/chunk-7USW2XFB.mjs +0 -1
  113. package/dist/chunk-7XOFQCQE.mjs +0 -3
  114. package/dist/chunk-BDXWPUBJ.mjs +0 -2
  115. package/dist/chunk-BRV2B2YW.mjs +0 -1
  116. package/dist/chunk-D2BHE4F2.mjs +0 -1
  117. package/dist/chunk-QZKYGS74.mjs +0 -1
  118. package/dist/chunk-THPTANES.mjs +0 -1
  119. package/dist/chunk-U5TKLHGW.mjs +0 -1
  120. package/dist/chunk-V3Z6G5JE.mjs +0 -1
  121. package/dist/chunk-WKOT2MND.mjs +0 -1
  122. package/dist/chunk-XSVTHCLO.mjs +0 -1
@@ -1,7 +1,9 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.mjs';
2
- import { S as ScrollAnimateOptions } from '../engine-BLWKCfxC.mjs';
3
- import { S as ScrollCounterOptions } from '../index-DVjblK_4.mjs';
1
+ import { F as FramesInput } from '../wrapper-BOHrDnBO.mjs';
2
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-iITMwrru.mjs';
3
+ import { S as ScrollAnimateOptions } from '../engine-Bi2x8-X-.mjs';
4
+ import { S as ScrollCounterOptions } from '../index-BMMZ8aW7.mjs';
4
5
  import { ScrollVideoOptions } from '../video/index.mjs';
6
+ export { ScrollFramesOptions } from '../frames/index.mjs';
5
7
  import { ScrollTextOptions } from '../text/index.mjs';
6
8
 
7
9
  /**
@@ -117,6 +119,47 @@ declare function createScrollVideo(options?: ScrollVideoOptions): {
117
119
  };
118
120
  getInstance: () => ScrollDrawInstance | null;
119
121
  };
122
+ /**
123
+ * Svelte action — scrub an image sequence on a <canvas> with the scroll
124
+ * (scrollFrames). The canvas is yours, so give it role="img" and an
125
+ * aria-label saying what the frames show; in development the action warns
126
+ * when it has no name (unless it is aria-hidden="true" or role="presentation").
127
+ *
128
+ * An inline parameter is fine: `update()` starts a new film only when the URLs
129
+ * (a `frames` function is read by the URLs it gives for `count`) or another
130
+ * option changed, and callbacks are read live. `triggerElement` takes an
131
+ * element or a selector, found when the film starts.
132
+ *
133
+ * @example
134
+ * <section id="track" style="height: 400vh">
135
+ * <div style="position: sticky; top: 0; height: 100vh">
136
+ * <canvas role="img" aria-label="The headphones turning"
137
+ * use:scrollFramesAction={{ frames: (i) => `/film/${i + 1}.jpg`, count: 120,
138
+ * triggerElement: '#track', trigger: { start: 'top top', end: 'bottom bottom' } }} />
139
+ * </div>
140
+ * </section>
141
+ */
142
+ declare function scrollFramesAction(node: HTMLCanvasElement, options: FramesInput): {
143
+ update(next: FramesInput): void;
144
+ destroy(): void;
145
+ };
146
+ /**
147
+ * Returns an action and a getter for the live film instance. Its options are
148
+ * read once, like the other create* helpers.
149
+ *
150
+ * @example
151
+ * <script>
152
+ * import { createScrollFrames } from 'svg-scroll-draw/svelte';
153
+ * const { action, getInstance } = createScrollFrames({ frames: urls });
154
+ * </script>
155
+ * <canvas use:action role="img" aria-label="The headphones turning" />
156
+ */
157
+ declare function createScrollFrames(options: FramesInput): {
158
+ action: (node: HTMLCanvasElement) => {
159
+ destroy(): void;
160
+ };
161
+ getInstance: () => ScrollDrawInstance | null;
162
+ };
120
163
  /**
121
164
  * Svelte action — split text and stagger-animate each piece on scroll.
122
165
  *
@@ -146,4 +189,4 @@ declare function createScrollText(options?: ScrollTextOptions): {
146
189
  getInstance: () => ScrollDrawInstance | null;
147
190
  };
148
191
 
149
- export { ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollText, createScrollVideo, scrollAnimate, scrollCounterAction, scrollDraw, scrollTextAction, scrollVideoAction };
192
+ export { ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollFrames, createScrollText, createScrollVideo, scrollAnimate, scrollCounterAction, scrollDraw, scrollFramesAction, scrollTextAction, scrollVideoAction };
@@ -1,7 +1,9 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.js';
2
- import { S as ScrollAnimateOptions } from '../engine-6VsjEwzb.js';
3
- import { S as ScrollCounterOptions } from '../index-BN8yKeQ3.js';
1
+ import { F as FramesInput } from '../wrapper-Cm7JTIVl.js';
2
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-iITMwrru.js';
3
+ import { S as ScrollAnimateOptions } from '../engine-DAlvk6i0.js';
4
+ import { S as ScrollCounterOptions } from '../index-MdQ4ti_z.js';
4
5
  import { ScrollVideoOptions } from '../video/index.js';
6
+ export { ScrollFramesOptions } from '../frames/index.js';
5
7
  import { ScrollTextOptions } from '../text/index.js';
6
8
 
7
9
  /**
@@ -117,6 +119,47 @@ declare function createScrollVideo(options?: ScrollVideoOptions): {
117
119
  };
118
120
  getInstance: () => ScrollDrawInstance | null;
119
121
  };
122
+ /**
123
+ * Svelte action — scrub an image sequence on a <canvas> with the scroll
124
+ * (scrollFrames). The canvas is yours, so give it role="img" and an
125
+ * aria-label saying what the frames show; in development the action warns
126
+ * when it has no name (unless it is aria-hidden="true" or role="presentation").
127
+ *
128
+ * An inline parameter is fine: `update()` starts a new film only when the URLs
129
+ * (a `frames` function is read by the URLs it gives for `count`) or another
130
+ * option changed, and callbacks are read live. `triggerElement` takes an
131
+ * element or a selector, found when the film starts.
132
+ *
133
+ * @example
134
+ * <section id="track" style="height: 400vh">
135
+ * <div style="position: sticky; top: 0; height: 100vh">
136
+ * <canvas role="img" aria-label="The headphones turning"
137
+ * use:scrollFramesAction={{ frames: (i) => `/film/${i + 1}.jpg`, count: 120,
138
+ * triggerElement: '#track', trigger: { start: 'top top', end: 'bottom bottom' } }} />
139
+ * </div>
140
+ * </section>
141
+ */
142
+ declare function scrollFramesAction(node: HTMLCanvasElement, options: FramesInput): {
143
+ update(next: FramesInput): void;
144
+ destroy(): void;
145
+ };
146
+ /**
147
+ * Returns an action and a getter for the live film instance. Its options are
148
+ * read once, like the other create* helpers.
149
+ *
150
+ * @example
151
+ * <script>
152
+ * import { createScrollFrames } from 'svg-scroll-draw/svelte';
153
+ * const { action, getInstance } = createScrollFrames({ frames: urls });
154
+ * </script>
155
+ * <canvas use:action role="img" aria-label="The headphones turning" />
156
+ */
157
+ declare function createScrollFrames(options: FramesInput): {
158
+ action: (node: HTMLCanvasElement) => {
159
+ destroy(): void;
160
+ };
161
+ getInstance: () => ScrollDrawInstance | null;
162
+ };
120
163
  /**
121
164
  * Svelte action — split text and stagger-animate each piece on scroll.
122
165
  *
@@ -146,4 +189,4 @@ declare function createScrollText(options?: ScrollTextOptions): {
146
189
  getInstance: () => ScrollDrawInstance | null;
147
190
  };
148
191
 
149
- export { ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollText, createScrollVideo, scrollAnimate, scrollCounterAction, scrollDraw, scrollTextAction, scrollVideoAction };
192
+ export { ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollFrames, createScrollText, createScrollVideo, scrollAnimate, scrollCounterAction, scrollDraw, scrollFramesAction, scrollTextAction, scrollVideoAction };
@@ -1 +1 @@
1
- import {a as a$4,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-BRV2B2YW.mjs';import {a as a$2}from'../chunk-32ZCSGFZ.mjs';import {a as a$1}from'../chunk-U5TKLHGW.mjs';import {a}from'../chunk-7USW2XFB.mjs';import {b}from'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';function r(n,t,o){let e=t,f=a$4(t),l=o(n,b$1(t,()=>e));return {update(c){e=c;let d=a$4(c);d!==f&&(f=d,l.destroy(),l=o(n,b$1(c,()=>e)));},destroy(){l.destroy();}}}function D(n,t={}){return r(n,t,b)}function I(n={}){let t=null;function o(e){return t=b(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function A(n,t){return r(n,t,a)}function H(n){let t=null;function o(e){return t=a(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function L(n,t){return r(n,t,a$1)}function M(n){let t=null;function o(e){return t=a$1(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function V(n,t={}){return r(n,t,a$3)}function g(n={}){let t=null;function o(e){return t=a$3(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function C(n,t={}){return r(n,t,a$2)}function v(n={}){let t=null;function o(e){return t=a$2(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}export{H as createScrollAnimate,M as createScrollCounter,I as createScrollDraw,v as createScrollText,g as createScrollVideo,A as scrollAnimate,L as scrollCounterAction,D as scrollDraw,C as scrollTextAction,V as scrollVideoAction};
1
+ import {a as a$3}from'../chunk-NJV6S5LD.mjs';import {a,d,b as b$2,c}from'../chunk-KN2YB54Z.mjs';import {a as a$5}from'../chunk-HJTHOZK5.mjs';import'../chunk-GBFWTY5L.mjs';import {a as a$4}from'../chunk-UF3MO5XQ.mjs';import {a as a$2}from'../chunk-Z72TVDHY.mjs';import {a as a$1}from'../chunk-HAGTU5EX.mjs';import {b as b$1}from'../chunk-XLXVGQ3P.mjs';import'../chunk-7LDSB4FT.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-YOOPMYT6.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';function o(e,t,r,n=a){let c=t,O=n(t),i=r(e,b$2(t,()=>c),t);return {update(l){c=l;let d=n(l);d!==O&&(O=d,i.destroy(),i=r(e,b$2(l,()=>c),l));},destroy(){i.destroy();}}}function F(e,t={}){return o(e,t,b$1)}function g(e={}){let t=null;function r(n){return t=b$1(n,e),{destroy(){t?.destroy(),t=null;}}}return {action:r,getInstance:()=>t}}function C(e,t){return o(e,t,a$1)}function V(e){let t=null;function r(n){return t=a$1(n,e),{destroy(){t?.destroy(),t=null;}}}return {action:r,getInstance:()=>t}}function v(e,t){return o(e,t,a$2)}function K(e){let t=null;function r(n){return t=a$2(n,e),{destroy(){t?.destroy(),t=null;}}}return {action:r,getInstance:()=>t}}function b(e,t={}){return o(e,t,a$5)}function h(e={}){let t=null;function r(n){return t=a$5(n,e),{destroy(){t?.destroy(),t=null;}}}return {action:r,getInstance:()=>t}}function j(e,t){return d(e,"scrollFramesAction"),o(e,t,a$3,c)}function k(e){let t=null;function r(n){return d(n,"createScrollFrames"),t=a$3(n,e,e),{destroy(){t?.destroy(),t=null;}}}return {action:r,getInstance:()=>t}}function q(e,t={}){return o(e,t,a$4)}function z(e={}){let t=null;function r(n){return t=a$4(n,e),{destroy(){t?.destroy(),t=null;}}}return {action:r,getInstance:()=>t}}export{V as createScrollAnimate,K as createScrollCounter,g as createScrollDraw,k as createScrollFrames,z as createScrollText,h as createScrollVideo,C as scrollAnimate,v as scrollCounterAction,F as scrollDraw,j as scrollFramesAction,q as scrollTextAction,b as scrollVideoAction};
@@ -1 +1 @@
1
- 'use strict';function se({tension:e=2.5,friction:t=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,t)}function ue({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),i=Math.sqrt(r),o=0,s=[];for(let a=0;a<n;a++){let u=Math.pow(i,a);s.push(u),o+=u;}let c=[0],d=0;for(let a=0;a<n;a++)d+=s[a]/o,c.push(d);return a=>{if(a<=0)return 0;if(a>=1)return 1;for(let u=0;u<n;u++)if(a<=c[u+1]){let p=(a-c[u])/(c[u+1]-c[u]);if(u===0)return p*(2-p);let f=1-Math.pow(r,u);return f+(1-f)*(2*p-1)*(2*p-1)}return 1}}function ae({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),i=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/r)+1}var I={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:se(),bounce:ue(),elastic:ae()};function w(e,t,n){return Math.min(n,Math.max(t,e))}function D(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}var V=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function G(e,t,n,r){return e+n+t*V(r,0)}function Q(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:V(e,1))}function $(e,t,n,r){return n===t?0:w((e-t)/(n-t)*r,0,1)}function F(e,t,n,r,i){let o=G(e.top,e.height,t,r.element)-Q(r.viewport,n),s=G(e.top,e.height,t,i.element)-Q(i.viewport,n);return {tStart:o,tEnd:s}}var q=Symbol.for("svg-scroll-draw.registry");function z(){let e=globalThis;return e[q]||(e[q]=new Map)}function B(e,t){z().set(e,t);}function Y(e){z().delete(e);}var ce=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function j(e,...t){ce&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function K(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=i=>e(!!i.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function U(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=K(o=>{if(!o)return;r();let s=(n.getProgress?.()??0)>=1;n.destroy(),n=t(s?{...e,onComplete:void 0}:e,true);}),i={};for(let o of Object.keys(n))i[o]=(...s)=>n[o]?.(...s);return i.destroy=()=>{r(),n.destroy();},i}var E,_=new Set,R=new WeakMap,v=new Map,X=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function de(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function J(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();E??(E=new ResizeObserver(i=>{let o=false;for(let{target:s}of i)R.get(s)!==X(s)&&(o=true),R.set(s,"");o&&_.forEach(s=>s());})),_.add(n);let r=de(e);return [document.body,document.documentElement].forEach(i=>i&&r.add(i)),r.forEach(i=>{R.has(i)||R.set(i,X(i)),v.set(i,(v.get(i)??0)+1),E.observe(i);}),()=>{_.delete(n)&&(r.forEach(i=>{let o=(v.get(i)??1)-1;if(o)return void v.set(i,o);v.delete(i),E?.unobserve(i);}),_.size||(E?.disconnect(),E=void 0));}}function Z(e,t,n,r,i){let o,s=NaN,c,d,a=()=>{o=0,r(),!c&&!o&&(s=n())>0&&s<1&&(o=requestAnimationFrame(a));},u=()=>{!o&&!c&&n()!==s&&(o=requestAnimationFrame(a));},p=b=>{c=b,cancelAnimationFrame(o),o=s=NaN,u();},f=()=>{clearTimeout(d),i(),u();},g=()=>{clearTimeout(d),d=setTimeout(f,150);},x=J(t,g),m=b=>{e[b]("scroll",u,{passive:true}),window[b]("resize",g),window[b]("orientationchange",g);};return m("addEventListener"),u(),{hold:p,remeasure:f,off(){p(true),m("removeEventListener"),x(),clearTimeout(d);}}}function ee(e,t){let n=document.createElement("span");n.textContent=t,n.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(n);}function k(e=""){let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=e,t}function te(e){let t=e.textContent??"";return e.textContent="",t.split(/(\s+)/).filter(Boolean).map(n=>{let r=e.appendChild(k(n)),i=/^\s+$/.test(n);return i?r.style.whiteSpace="pre":r.style.display="inline-block",i?null:r}).filter(n=>n!==null)}function le(e){let t=e.textContent??"";e.textContent="";let n=[],r=null;for(let i of t){let o=k(i),s=i===" ";s?o.style.whiteSpace="pre":(o.style.display="inline-block",n.push(o)),s||i>"\u0DFF"?r=null:r||(r=e.appendChild(k()),r.style.cssText="display:inline-block;white-space:nowrap"),(r??e).appendChild(o);}return n}function ne(e){let t=te(e),n=new Map;for(let o of t){let s=o.offsetTop;n.has(s)||n.set(s,[]),n.get(s).push(o);}let r=[],i=Array.from(n.keys()).sort((o,s)=>o-s);for(let o of i){let s=n.get(o),c=k();c.style.display="inline-block",s.forEach((d,a)=>{let u=d.nextElementSibling;c.appendChild(d),a<s.length-1&&u&&u.style.whiteSpace==="pre"&&c.appendChild(u);}),r.push(c);}return e.textContent="",r.forEach((o,s)=>{e.appendChild(o),s<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function pe(e,t,n,r){if(n<=1||r===0)return e;r=Math.min(r,1/n);let i=(n-1)*r,o=t*r,s=o+(1-i);return s<=o?e>=o?1:0:w((e-o)/(s-o),0,1)}function me(e,t){let n=[];if(t?.y!==void 0&&n.push(`translateY(${t.y*(1-e)}px)`),t?.x!==void 0&&n.push(`translateX(${t.x*(1-e)}px)`),t?.rotate!==void 0&&n.push(`rotate(${t.rotate*(1-e)}deg)`),t?.scale!==void 0){let r=t.scale+(1-t.scale)*e;n.push(`scale(${r})`);}return n.join(" ")}var P={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ie(e,t={}){if(typeof window>"u")return P;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return j("scrollText: element not found:",e),P;let r=n;return U(t,(i,o)=>fe(r,i,o))}function fe(e,t,n){let{split:r="words",stagger:i=.04,easing:o="ease-out",from:s={opacity:0,y:24},trigger:c={},once:d=true,onComplete:a}=t,u=typeof o=="function"?o:I[o]??I["ease-out"],p=D(c.start||"top 85%"),f=D(c.end||"top 40%"),g=e.innerHTML,x=e.textContent??"",m;r==="chars"?m=le(e):r==="lines"?m=ne(e):m=te(e),ee(e,x);let b=m.length;function re(l,S){s?.opacity!==void 0&&(l.style.opacity=String(s.opacity+(1-s.opacity)*S));let C=me(S,s);C&&(l.style.transform=C);}function h(l){e.style.setProperty("--scroll-draw-progress",String(l)),m.forEach((S,C)=>{let ie=u(pe(l,C,b,i));re(S,ie);});}if(n)return h(1),a?.(),{...P,destroy:()=>{e.innerHTML=g;},getProgress:()=>1};h(0);let H=0,O=0,M=-1,y=0,T=false;function N(){({tStart:H,tEnd:O}=F(e.getBoundingClientRect(),window.scrollY,window.innerHeight,p,f));}let A=()=>$(window.scrollY,H,O,1);function oe(){let l=d?M=Math.max(M,A()):A();y=l,h(l),l>=1&&!T?(T=true,a?.()):l<1&&!d&&(T=false);}N();let L=Z(window,[e],A,oe,()=>{r==="lines"&&(e.innerHTML=g,m=ne(e),ee(e,x),h(y)),N();});B(e,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:H,tEnd:O})});let W=()=>L.hold(false);return {destroy(){L.off(),e.innerHTML=g,Y(e);},replay(){M=-1,T=false,y=0,h(0),W();},pause:()=>L.hold(true),resume:W,seek(l){L.hold(true),h(y=M=w(l,0,1));},getProgress(){return y}}}exports.scrollText=Ie;
1
+ 'use strict';var ae=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function _(e,...t){ae&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function ce({tension:e=2.5,friction:t=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,t)}function de({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,t)),s=Math.sqrt(o),r=0,i=[];for(let a=0;a<n;a++){let c=Math.pow(s,a);i.push(c),r+=c;}let u=[0],d=0;for(let a=0;a<n;a++)d+=i[a]/r,u.push(d);return a=>{if(a<=0)return 0;if(a>=1)return 1;for(let c=0;c<n;c++)if(a<=u[c+1]){let m=(a-u[c])/(u[c+1]-u[c]);if(c===0)return m*(2-m);let f=1-Math.pow(o,c);return f+(1-f)*(2*m-1)*(2*m-1)}return 1}}function le({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),o=Math.max(.1,t),s=n<=1?o/4:o/(2*Math.PI)*Math.asin(1/n);return r=>r<=0?0:r>=1?1:n*Math.pow(2,-10*r)*Math.sin((r-s)*(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:ce(),bounce:de(),elastic:le()};function me(e,t,n,o){let s=(r,i,u)=>((1+3*r-3*i)*u+3*i-6*r)*u*u+3*r*u;return r=>{if(r<=0||r>=1)return +(r>0);let i=r;for(let u=0;u<8;u++)i-=(s(e,n,i)-r)/((3*(1+3*e-3*n)*i+6*n-12*e)*i+3*e);if(!(i>=0&&i<=1&&Math.abs(s(e,n,i)-r)<1e-9))for(let u=0,d=0,a=1;u<30;u++)i=(d+a)/2,s(e,n,i)<r?d=i:a=i;return s(t,o,i)}}function pe(e){let t=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),n=t?t[1].split(",").map(parseFloat):[];if(n.length===4&&n.every(Number.isFinite)&&n[0]*(1-n[0])>=0&&n[2]*(1-n[2])>=0)return [me(n[0],n[1],n[2],n[3]),`cubic-bezier(${n})`]}var W=new Set;function F(e,t="linear"){if(typeof e=="function")return e;if(e==null)return R[t];if({}.hasOwnProperty.call(R,e))return R[e];let n=pe(String(e));return n?n[0]:(!W.has(e)&&W.add(e)&&_(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),R[t])}function w(e,t,n){return Math.min(n,Math.max(t,e))}function I(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",o="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:o}}var V=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function Q(e,t,n,o){return e+n+t*V(o,0)}function G(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:V(e,1))}function q(e,t,n,o){return n===t?0:w((e-t)/(n-t)*o,0,1)}function B(e,t,n,o,s){let r=Q(e.top,e.height,t,o.element)-G(o.viewport,n),i=Q(e.top,e.height,t,s.element)-G(s.viewport,n);return {tStart:r,tEnd:i}}var Y=Symbol.for("svg-scroll-draw.registry");function j(){let e=globalThis;return e[Y]||(e[Y]=new Map)}function U(e,t){j().set(e,t);}function J(e){j().delete(e);}function K(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=s=>e(!!s.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let o=t;return o.addListener?.(n),()=>o.removeListener?.(n)}function X(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),o=K(r=>{if(!r)return;o();let i=(n.getProgress?.()??0)>=1;n.destroy(),n=t(i?{...e,onComplete:void 0}:e,true);}),s={};for(let r of Object.keys(n))s[r]=(...i)=>n[r]?.(...i);return s.destroy=()=>{o(),n.destroy();},s}var E,k=new Set,O=new WeakMap,v=new Map,Z=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function fe(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let o=n;o;o=o.previousElementSibling)t.add(o);return t}function ee(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();E??(E=new ResizeObserver(s=>{let r=false;for(let{target:i}of s)O.get(i)!==Z(i)&&(r=true),O.set(i,"");r&&k.forEach(i=>i());})),k.add(n);let o=fe(e);return [document.body,document.documentElement].forEach(s=>s&&o.add(s)),o.forEach(s=>{O.has(s)||O.set(s,Z(s)),v.set(s,(v.get(s)??0)+1),E.observe(s);}),()=>{k.delete(n)&&(o.forEach(s=>{let r=(v.get(s)??1)-1;if(r)return void v.set(s,r);v.delete(s),E?.unobserve(s);}),k.size||(E?.disconnect(),E=void 0));}}function ne(e,t,n,o,s){let r,i=NaN,u,d,a=()=>{r=0,o(),!u&&!r&&(i=n())>0&&i<1&&(r=requestAnimationFrame(a));},c=()=>{!r&&!u&&n()!==i&&(r=requestAnimationFrame(a));},m=g=>{u=g,cancelAnimationFrame(r),r=i=NaN,c();},f=()=>{clearTimeout(d),s(),c();},b=()=>{clearTimeout(d),d=setTimeout(f,150);},M=ee(t,b),p=g=>{e[g]("scroll",c,{passive:true}),window[g]("resize",b),window[g]("orientationchange",b);};return p("addEventListener"),c(),{hold:m,remeasure:f,off(){m(true),p("removeEventListener"),M(),clearTimeout(d);}}}function te(e,t){let n=document.createElement("span");n.textContent=t,n.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(n);}function H(e=""){let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=e,t}function oe(e){let t=e.textContent??"";return e.textContent="",t.split(/(\s+)/).filter(Boolean).map(n=>{let o=e.appendChild(H(n)),s=/^\s+$/.test(n);return s?o.style.whiteSpace="pre":o.style.display="inline-block",s?null:o}).filter(n=>n!==null)}function be(e){let t=e.textContent??"";e.textContent="";let n=[],o=null;for(let s of t){let r=H(s),i=s===" ";i?r.style.whiteSpace="pre":(r.style.display="inline-block",n.push(r)),i||s>"\u0DFF"?o=null:o||(o=e.appendChild(H()),o.style.cssText="display:inline-block;white-space:nowrap"),(o??e).appendChild(r);}return n}function re(e){let t=oe(e),n=new Map;for(let r of t){let i=r.offsetTop;n.has(i)||n.set(i,[]),n.get(i).push(r);}let o=[],s=Array.from(n.keys()).sort((r,i)=>r-i);for(let r of s){let i=n.get(r),u=H();u.style.display="inline-block",i.forEach((d,a)=>{let c=d.nextElementSibling;u.appendChild(d),a<i.length-1&&c&&c.style.whiteSpace==="pre"&&u.appendChild(c);}),o.push(u);}return e.textContent="",o.forEach((r,i)=>{e.appendChild(r),i<o.length-1&&e.appendChild(document.createTextNode(" "));}),o}function ge(e,t,n,o){if(n<=1||o===0)return e;o=Math.min(o,1/n);let s=(n-1)*o,r=t*o,i=r+(1-s);return i<=r?e>=r?1:0:w((e-r)/(i-r),0,1)}function he(e,t){let n=[];if(t?.y!==void 0&&n.push(`translateY(${t.y*(1-e)}px)`),t?.x!==void 0&&n.push(`translateX(${t.x*(1-e)}px)`),t?.rotate!==void 0&&n.push(`rotate(${t.rotate*(1-e)}deg)`),t?.scale!==void 0){let o=t.scale+(1-t.scale)*e;n.push(`scale(${o})`);}return n.join(" ")}var N={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function $e(e,t={}){if(typeof window>"u")return N;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return _("scrollText: element not found:",e),N;let o=n;return X(t,(s,r)=>ye(o,s,r))}function ye(e,t,n){let{split:o="words",stagger:s=.04,easing:r="ease-out",from:i={opacity:0,y:24},trigger:u={},once:d=true,onComplete:a}=t,c=F(r,"ease-out"),m=I(u.start||"top 85%"),f=I(u.end||"top 40%"),b=e.innerHTML,M=e.textContent??"",p;o==="chars"?p=be(e):o==="lines"?p=re(e):p=oe(e),te(e,M);let g=p.length;function ie(l,L){i?.opacity!==void 0&&(l.style.opacity=String(i.opacity+(1-i.opacity)*L));let C=he(L,i);C&&(l.style.transform=C);}function h(l){e.style.setProperty("--scroll-draw-progress",String(l)),p.forEach((L,C)=>{let ue=c(ge(l,C,g,s));ie(L,ue);});}if(n)return h(1),a?.(),{...N,destroy:()=>{e.innerHTML=b;},getProgress:()=>1};h(0);let P=0,A=0,x=-1,y=0,T=false;function z(){({tStart:P,tEnd:A}=B(e.getBoundingClientRect(),window.scrollY,window.innerHeight,m,f));}let D=()=>q(window.scrollY,P,A,1);function se(){let l=d?x=Math.max(x,D()):D();y=l,h(l),l>=1&&!T?(T=true,a?.()):l<1&&!d&&(T=false);}z();let S=ne(window,[e],D,se,()=>{o==="lines"&&(e.innerHTML=b,p=re(e),te(e,M),h(y)),z();});U(e,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:P,tEnd:A})});let $=()=>S.hold(false);return {destroy(){S.off(),e.innerHTML=b,J(e);},replay(){x=-1,T=false,y=0,h(0),$();},pause:()=>S.hold(true),resume:$,seek(l){S.hold(true),h(y=x=w(l,0,1));},getProgress(){return y}}}exports.scrollText=$e;
@@ -1,9 +1,9 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from '../types-9bcJdVcg.mjs';
1
+ import { E as Easing, T as TriggerConfig, S as ScrollDrawInstance } from '../types-iITMwrru.mjs';
2
2
 
3
3
  interface ScrollTextOptions {
4
4
  split?: 'chars' | 'words' | 'lines';
5
5
  stagger?: number;
6
- easing?: EasingName | ((t: number) => number);
6
+ easing?: Easing;
7
7
  from?: {
8
8
  opacity?: number;
9
9
  y?: number;
@@ -1,9 +1,9 @@
1
- import { E as EasingName, T as TriggerConfig, S as ScrollDrawInstance } from '../types-9bcJdVcg.js';
1
+ import { E as Easing, T as TriggerConfig, S as ScrollDrawInstance } from '../types-iITMwrru.js';
2
2
 
3
3
  interface ScrollTextOptions {
4
4
  split?: 'chars' | 'words' | 'lines';
5
5
  stagger?: number;
6
- easing?: EasingName | ((t: number) => number);
6
+ easing?: Easing;
7
7
  from?: {
8
8
  opacity?: number;
9
9
  y?: number;
@@ -1 +1 @@
1
- export{a as scrollText}from'../chunk-32ZCSGFZ.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as scrollText}from'../chunk-UF3MO5XQ.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
@@ -1,23 +1,23 @@
1
- 'use strict';function Ge({tension:e=2.5,friction:t=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,t)}function Fe({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),i=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(i),s=0,u=[];for(let l=0;l<n;l++){let d=Math.pow(o,l);u.push(d),s+=d;}let b=[0],g=0;for(let l=0;l<n;l++)g+=u[l]/s,b.push(g);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let d=0;d<n;d++)if(l<=b[d+1]){let h=(l-b[d])/(b[d+1]-b[d]);if(d===0)return h*(2-h);let v=1-Math.pow(i,d);return v+(1-v)*(2*h-1)*(2*h-1)}return 1}}function Oe({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),i=Math.max(.1,t),o=n<=1?i/4:i/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/i)+1}var ee={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:Ge(),bounce:Fe(),elastic:Oe()};function ce(e,t,n){return Math.min(n,Math.max(t,e))}function te(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",i="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:i}}var fe=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function me(e,t,n,i){return e+n+t*fe(i,0)}function pe(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:fe(e,1))}function z(e,t,n,i){return n===t?0:ce((e-t)/(n-t)*i,0,1)}function be(e,t,n,i,o){let s=me(e.top,e.height,t,i.element)-pe(i.viewport,n),u=me(e.top,e.height,t,o.element)-pe(o.viewport,n);return {tStart:s,tEnd:u}}function ne(e){let t=parseFloat(e.getAttribute("pathLength")??"");if(t>0)return t;let n=e.tagName.toLowerCase();if(n==="rect"){let i=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(i+o)}if(n==="circle"){let i=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*i}return e.getTotalLength()}function ge(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function he(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let i=t;return i.addListener?.(n),()=>i.removeListener?.(n)}var Pe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ye(e,...t){Pe&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var ve=Symbol.for("svg-scroll-draw.registry");function we(){let e=globalThis;return e[ve]||(e[ve]=new Map)}function xe(e,t){we().set(e,t);}function Ee(e){we().delete(e);}var I,W=new Set,Q=new WeakMap,$=new Map,Me=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ce(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let i=n;i;i=i.previousElementSibling)t.add(i);return t}function Le(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();I??(I=new ResizeObserver(o=>{let s=false;for(let{target:u}of o)Q.get(u)!==Me(u)&&(s=true),Q.set(u,"");s&&W.forEach(u=>u());})),W.add(n);let i=Ce(e);return [document.body,document.documentElement].forEach(o=>o&&i.add(o)),i.forEach(o=>{Q.has(o)||Q.set(o,Me(o)),$.set(o,($.get(o)??0)+1),I.observe(o);}),()=>{W.delete(n)&&(i.forEach(o=>{let s=($.get(o)??1)-1;if(s)return void $.set(o,s);$.delete(o),I?.unobserve(o);}),W.size||(I?.disconnect(),I=void 0));}}function Te(e,t,n,i,o){let s,u=NaN,b,g,l=()=>{s=0,i(),!b&&!s&&(u=n())>0&&u<1&&(s=requestAnimationFrame(l));},d=()=>{!s&&!b&&n()!==u&&(s=requestAnimationFrame(l));},h=M=>{b=M,cancelAnimationFrame(s),s=u=NaN,d();},v=()=>{clearTimeout(g),o(),d();},E=()=>{clearTimeout(g),g=setTimeout(v,150);},q=Le(t,E),k=M=>{e[M]("scroll",d,{passive:true}),window[M]("resize",E),window[M]("orientationchange",E);};return k("addEventListener"),d(),{hold:h,remeasure:v,off(){h(true),k("removeEventListener"),q(),clearTimeout(g);}}}var Se=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function it(e,t){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let i=typeof e=="string"?document.querySelector(e):e;if(!i)return ye("timeline: Container not found:",e),n;let o=i,{trigger:s={},speed:u=1,once:b=false,axis:g="y",tracks:l,onComplete:d,repeat:h,repeatDelay:v=0,loop:E=false,loopDuration:q=1500,debug:k=false,label:M,respectReducedMotion:re=true}=t,Re=te(s.start||"top bottom"),De=te(s.end||"bottom top"),G=h==="infinite"?1/0:h??0,f,H=false,B=E===true?1/0:typeof E=="number"?E:0,y=false,j=0,S=B,Y=re&&ge(),_e=he(r=>{Y=re&&r,Y&&(y=false,clearTimeout(f),f=void 0);}),K=()=>B>0&&!Y,U=new Map,X=l.map(r=>{let c=typeof r.easing=="function"?r.easing:ee[r.easing??"linear"]??ee.linear,p=Array.from(o.querySelectorAll(r.selector)),m=p.map(a=>ne(a));return p.forEach((a,w)=>{U.has(a)||U.set(a,a.getAttribute("style")??""),a.style.strokeDasharray=`${m[w]}`,a.style.strokeDashoffset=`${m[w]}`,r.fade&&(a.style.opacity="0");}),{...r,elements:p,lengths:m,easeFn:c}});function Ae(){for(let[r,c]of U)c?r.setAttribute("style",c):r.removeAttribute("style");}let F=0,O=0,oe=0,ie=0,R=false,_=false,A=-1,L=0,x=null;k&&(x=document.createElement("div"),Object.assign(x.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(x));function Ie(r){if(!x)return;let c=M??(typeof e=="string"?e:"timeline"),p=l.map(({selector:m,from:a,to:w},Z)=>{let D=Se[Z%Se.length],N=w>a?Math.min(1,Math.max(0,(r-a)/(w-a))):0,V=Math.round(N*100);return `<div style="margin:4px 0">
1
+ 'use strict';var Ge=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function V(e,...n){Ge&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function Pe({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function Ne({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,n)),r=Math.sqrt(o),i=0,a=[];for(let l=0;l<t;l++){let d=Math.pow(r,l);a.push(d),i+=d;}let u=[0],b=0;for(let l=0;l<t;l++)b+=a[l]/i,u.push(b);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let d=0;d<t;d++)if(l<=u[d+1]){let h=(l-u[d])/(u[d+1]-u[d]);if(d===0)return h*(2-h);let v=1-Math.pow(o,d);return v+(1-v)*(2*h-1)*(2*h-1)}return 1}}function Ce({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),o=Math.max(.1,n),r=t<=1?o/4:o/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-r)*(2*Math.PI)/o)+1}var W={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:Pe(),bounce:Ne(),elastic:Ce()};function Ve(e,n,t,o){let r=(i,a,u)=>((1+3*i-3*a)*u+3*a-6*i)*u*u+3*i*u;return i=>{if(i<=0||i>=1)return +(i>0);let a=i;for(let u=0;u<8;u++)a-=(r(e,t,a)-i)/((3*(1+3*e-3*t)*a+6*t-12*e)*a+3*e);if(!(a>=0&&a<=1&&Math.abs(r(e,t,a)-i)<1e-9))for(let u=0,b=0,l=1;u<30;u++)a=(b+l)/2,r(e,t,a)<i?b=a:l=a;return r(n,o,a)}}function We(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [Ve(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var fe=new Set;function pe(e,n="linear"){if(typeof e=="function")return e;if(e==null)return W[n];if({}.hasOwnProperty.call(W,e))return W[e];let t=We(String(e));return t?t[0]:(!fe.has(e)&&fe.add(e)&&V(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),W[n])}function be(e,n,t){return Math.min(t,Math.max(n,e))}function ne(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",o="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:o}}var ye=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function ge(e,n,t,o){return e+t+n*ye(o,0)}function he(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:ye(e,1))}function Q(e,n,t,o){return t===n?0:be((e-n)/(t-n)*o,0,1)}function ve(e,n,t,o,r){let i=ge(e.top,e.height,n,o.element)-he(o.viewport,t),a=ge(e.top,e.height,n,r.element)-he(r.viewport,t);return {tStart:i,tEnd:a}}function re(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let t=e.tagName.toLowerCase();if(t==="rect"){let o=parseFloat(e.getAttribute("width")??"0"),r=parseFloat(e.getAttribute("height")??"0");return 2*(o+r)}if(t==="circle"){let o=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*o}return e.getTotalLength()}function oe(e){return `${e} ${e*2}`}function we(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Ee(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=r=>e(!!r.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let o=n;return o.addListener?.(t),()=>o.removeListener?.(t)}var xe=Symbol.for("svg-scroll-draw.registry");function Me(){let e=globalThis;return e[xe]||(e[xe]=new Map)}function Le(e,n){Me().set(e,n);}function Se(e){Me().delete(e);}var k,q=new Set,B=new WeakMap,A=new Map,Te=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function Qe(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let o=t;o;o=o.previousElementSibling)n.add(o);return n}function Re(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();k??(k=new ResizeObserver(r=>{let i=false;for(let{target:a}of r)B.get(a)!==Te(a)&&(i=true),B.set(a,"");i&&q.forEach(a=>a());})),q.add(t);let o=Qe(e);return [document.body,document.documentElement].forEach(r=>r&&o.add(r)),o.forEach(r=>{B.has(r)||B.set(r,Te(r)),A.set(r,(A.get(r)??0)+1),k.observe(r);}),()=>{q.delete(t)&&(o.forEach(r=>{let i=(A.get(r)??1)-1;if(i)return void A.set(r,i);A.delete(r),k?.unobserve(r);}),q.size||(k?.disconnect(),k=void 0));}}function De(e,n,t,o,r){let i,a=NaN,u,b,l=()=>{i=0,o(),!u&&!i&&(a=t())>0&&a<1&&(i=requestAnimationFrame(l));},d=()=>{!i&&!u&&t()!==a&&(i=requestAnimationFrame(l));},h=M=>{u=M,cancelAnimationFrame(i),i=a=NaN,d();},v=()=>{clearTimeout(b),r(),d();},x=()=>{clearTimeout(b),b=setTimeout(v,150);},H=Re(n,x),I=M=>{e[M]("scroll",d,{passive:true}),window[M]("resize",x),window[M]("orientationchange",x);};return I("addEventListener"),d(),{hold:h,remeasure:v,off(){h(true),I("removeEventListener"),H(),clearTimeout(b);}}}var _e=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function ft(e,n){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let o=typeof e=="string"?document.querySelector(e):e;if(!o)return V("timeline: Container not found:",e),t;let r=o,{trigger:i={},speed:a=1,once:u=false,axis:b="y",tracks:l,onComplete:d,repeat:h,repeatDelay:v=0,loop:x=false,loopDuration:H=1500,debug:I=false,label:M,respectReducedMotion:ie=true}=n,$e=ne(i.start||"top bottom"),ke=ne(i.end||"bottom top"),F=h==="infinite"?1/0:h??0,g,j=false,Y=x===true?1/0:typeof x=="number"?x:0,y=false,U=0,T=Y,J=ie&&we(),Ae=Ee(s=>{J=ie&&s,J&&(y=false,clearTimeout(g),g=void 0);}),K=()=>Y>0&&!J,X=new Map,Z=l.map(s=>{let m=pe(s.easing),p=Array.from(r.querySelectorAll(s.selector)),f=p.map(c=>re(c));return p.forEach((c,w)=>{X.has(c)||X.set(c,c.getAttribute("style")??""),c.style.strokeDasharray=oe(f[w]),c.style.strokeDashoffset=`${f[w]}`,s.fade&&(c.style.opacity="0");}),{...s,elements:p,lengths:f,easeFn:m}});function Ie(){for(let[s,m]of X)m?s.setAttribute("style",m):s.removeAttribute("style");}let z=0,O=0,se=0,ae=0,R=false,_=false,$=-1,L=0,E=null;I&&(E=document.createElement("div"),Object.assign(E.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(E));function Fe(s){if(!E)return;let m=M??(typeof e=="string"?e:"timeline"),p=l.map(({selector:f,from:c,to:w},te)=>{let D=_e[te%_e.length],N=w>c?Math.min(1,Math.max(0,(s-c)/(w-c))):0,C=Math.round(N*100);return `<div style="margin:4px 0">
2
2
  <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
3
- <span style="color:${D};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${m}</span>
4
- <span style="color:#666;margin-left:8px">${V}%</span>
3
+ <span style="color:${D};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${f}</span>
4
+ <span style="color:#666;margin-left:8px">${C}%</span>
5
5
  </div>
6
6
  <div style="height:3px;background:#2a2a2a;border-radius:2px;position:relative;overflow:hidden">
7
- <div style="position:absolute;left:${a*100}%;width:${(w-a)*100}%;height:100%;background:${D}33;border-radius:2px"></div>
8
- <div style="position:absolute;left:${a*100}%;width:${(w-a)*N*100}%;height:100%;background:${D};border-radius:2px;transition:width 0.05s linear"></div>
7
+ <div style="position:absolute;left:${c*100}%;width:${(w-c)*100}%;height:100%;background:${D}33;border-radius:2px"></div>
8
+ <div style="position:absolute;left:${c*100}%;width:${(w-c)*N*100}%;height:100%;background:${D};border-radius:2px;transition:width 0.05s linear"></div>
9
9
  </div>
10
- </div>`}).join("");x.innerHTML=`
10
+ </div>`}).join("");E.innerHTML=`
11
11
  <div style="color:#555;margin-bottom:8px;font-size:10px;text-transform:uppercase;letter-spacing:0.12em;border-bottom:1px solid rgba(255,255,255,0.06);padding-bottom:6px">
12
- scrollDrawTimeline \xB7 ${c}
12
+ scrollDrawTimeline \xB7 ${m}
13
13
  </div>
14
14
  ${p}
15
15
  <div style="margin-top:6px;padding-top:6px;border-top:1px solid rgba(255,255,255,0.06)">
16
16
  <div style="display:flex;justify-content:space-between;margin-bottom:2px">
17
17
  <span style="color:#555">scroll</span>
18
- <span style="color:#666">${Math.round(r*100)}%</span>
18
+ <span style="color:#666">${Math.round(s*100)}%</span>
19
19
  </div>
20
20
  <div style="height:2px;background:#2a2a2a;border-radius:1px;overflow:hidden">
21
- <div style="height:100%;background:#fff;border-radius:1px;width:${r*100}%;transition:width 0.05s linear"></div>
21
+ <div style="height:100%;background:#fff;border-radius:1px;width:${s*100}%;transition:width 0.05s linear"></div>
22
22
  </div>
23
- </div>`;}function P(){return g==="x"?window.scrollX:window.scrollY}function se(){return g==="x"?window.innerWidth:window.innerHeight}function ae(){let r=o.getBoundingClientRect(),c=P(),p=g==="x"?r.left:r.top,m=g==="x"?r.width:r.height,a=be({top:p,height:m},c,se(),Re,De);F=a.tStart,O=a.tEnd,oe=p+c-se(),ie=p+c+m;}function ue(r){o.style.setProperty("--scroll-draw-progress",String(r)),X.forEach(({elements:c,lengths:p,from:m,to:a,easeFn:w,fade:Z})=>{let D=a-m,N=D>0?Math.min(1,Math.max(0,(r-m)/D)):0,V=w(N);c.forEach((de,ke)=>{de.style.strokeDashoffset=`${p[ke]*(1-V)}`,Z&&(de.style.opacity=String(V));});}),Ie(r);}function C(){H=false,A=-1,L=0,_=false,X.forEach(({elements:r,lengths:c,fade:p})=>{r.forEach((m,a)=>{m.style.strokeDashoffset=`${c[a]}`,p&&(m.style.opacity="0");});}),o.style.setProperty("--scroll-draw-progress","0");}function le(){return y?z(P(),oe,ie,1):z(P(),F,O,Math.min(u,1))}function $e(){H&&le()%1&&C();let r;y?r=Math.min(1,(performance.now()-j)/q):(r=z(P(),F,O,u),(b||K())&&(A=Math.max(A,r),r=A)),L=r,ue(r),r>=1&&!_?(_=true,d?.(),K()&&!y&&!f?f=setTimeout(()=>{f=void 0,S!==1/0&&S--,C(),y=true,j=performance.now(),T();},v):G>0&&b&&!y&&!f&&(f=setTimeout(()=>{f=void 0,G!==1/0&&G--,H=true;},v))):!y&&r<1&&!b&&(_=false),y&&r>=1&&!f&&(_=false,S>0&&K()?f=setTimeout(()=>{f=void 0,S!==1/0&&S--,C(),j=performance.now(),T();},v):y=false);}ae();let J=Te(window,[o],le,$e,()=>{X.forEach(({elements:r,lengths:c})=>{r.forEach((p,m)=>{c[m]=ne(p),p.style.strokeDasharray=`${c[m]}`;});}),ae();}),T=()=>J.hold(R);return T(),xe(o,{type:"draw",getProgress:()=>L,getTrigger:()=>({tStart:F,tEnd:O})}),{destroy(){J.off(),clearTimeout(f),Ee(o),_e(),x&&(x.remove(),x=null),Ae(),o.style.removeProperty("--scroll-draw-progress");},refresh:J.remeasure,replay(){G=h==="infinite"?1/0:h??0,S=B,y=false,clearTimeout(f),f=void 0,C(),R=false,T();},pause(){R=true,T();},resume(){R&&(R=false,T());},seek(r){L=Math.min(1,Math.max(0,r)),A=L,R=true,T(),ue(L);},getProgress(){return L}}}exports.scrollDrawTimeline=it;
23
+ </div>`;}function G(){return b==="x"?window.scrollX:window.scrollY}function ue(){return b==="x"?window.innerWidth:window.innerHeight}function ce(){let s=r.getBoundingClientRect(),m=G(),p=b==="x"?s.left:s.top,f=b==="x"?s.width:s.height,c=ve({top:p,height:f},m,ue(),$e,ke);z=c.tStart,O=c.tEnd,se=p+m-ue(),ae=p+m+f;}function le(s){r.style.setProperty("--scroll-draw-progress",String(s)),Z.forEach(({elements:m,lengths:p,from:f,to:c,easeFn:w,fade:te})=>{let D=c-f,N=D>0?Math.min(1,Math.max(0,(s-f)/D)):0,C=w(N);m.forEach((me,Oe)=>{me.style.strokeDashoffset=`${p[Oe]*(1-C)}`,te&&(me.style.opacity=String(C));});}),Fe(s);}function P(){j=false,$=-1,L=0,_=false,Z.forEach(({elements:s,lengths:m,fade:p})=>{s.forEach((f,c)=>{f.style.strokeDashoffset=`${m[c]}`,p&&(f.style.opacity="0");});}),r.style.setProperty("--scroll-draw-progress","0");}function de(){return y?Q(G(),se,ae,1):Q(G(),z,O,Math.min(a,1))}function ze(){j&&de()%1&&P();let s;y?s=Math.min(1,(performance.now()-U)/H):(s=Q(G(),z,O,a),(u||K())&&($=Math.max($,s),s=$)),L=s,le(s),s>=1&&!_?(_=true,d?.(),K()&&!y&&!g?g=setTimeout(()=>{g=void 0,T!==1/0&&T--,P(),y=true,U=performance.now(),S();},v):F>0&&u&&!y&&!g&&(g=setTimeout(()=>{g=void 0,F!==1/0&&F--,j=true;},v))):!y&&s<1&&!u&&(_=false),y&&s>=1&&!g&&(_=false,T>0&&K()?g=setTimeout(()=>{g=void 0,T!==1/0&&T--,P(),U=performance.now(),S();},v):y=false);}ce();let ee=De(window,[r],de,ze,()=>{Z.forEach(({elements:s,lengths:m})=>{s.forEach((p,f)=>{m[f]=re(p),p.style.strokeDasharray=oe(m[f]);});}),ce();}),S=()=>ee.hold(R);return S(),Le(r,{type:"draw",getProgress:()=>L,getTrigger:()=>({tStart:z,tEnd:O})}),{destroy(){ee.off(),clearTimeout(g),Se(r),Ae(),E&&(E.remove(),E=null),Ie(),r.style.removeProperty("--scroll-draw-progress");},refresh:ee.remeasure,replay(){F=h==="infinite"?1/0:h??0,T=Y,y=false,clearTimeout(g),g=void 0,P(),R=false,S();},pause(){R=true,S();},resume(){R&&(R=false,S());},seek(s){L=Math.min(1,Math.max(0,s)),$=L,R=true,S(),le(L);},getProgress(){return L}}}exports.scrollDrawTimeline=ft;
@@ -1,4 +1,4 @@
1
- import { E as EasingName, S as ScrollDrawInstance } from '../types-9bcJdVcg.mjs';
1
+ import { E as Easing, S as ScrollDrawInstance } from '../types-iITMwrru.mjs';
2
2
 
3
3
  interface TimelineTrack {
4
4
  /** CSS selector for paths within the container to animate on this track. */
@@ -8,7 +8,7 @@ interface TimelineTrack {
8
8
  /** Progress value (0–1) within the overall scroll range where this track ends. */
9
9
  to: number;
10
10
  /** Easing for this track. Defaults to 'linear'. */
11
- easing?: EasingName | ((t: number) => number);
11
+ easing?: Easing;
12
12
  /** Fade opacity in sync with this track's draw progress. */
13
13
  fade?: boolean;
14
14
  }
@@ -1,4 +1,4 @@
1
- import { E as EasingName, S as ScrollDrawInstance } from '../types-9bcJdVcg.js';
1
+ import { E as Easing, S as ScrollDrawInstance } from '../types-iITMwrru.js';
2
2
 
3
3
  interface TimelineTrack {
4
4
  /** CSS selector for paths within the container to animate on this track. */
@@ -8,7 +8,7 @@ interface TimelineTrack {
8
8
  /** Progress value (0–1) within the overall scroll range where this track ends. */
9
9
  to: number;
10
10
  /** Easing for this track. Defaults to 'linear'. */
11
- easing?: EasingName | ((t: number) => number);
11
+ easing?: Easing;
12
12
  /** Fade opacity in sync with this track's draw progress. */
13
13
  fade?: boolean;
14
14
  }
@@ -1,4 +1,4 @@
1
- import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-XC5NR2MU.mjs';import {a,e,c,b as b$2}from'../chunk-NV6YTPHI.mjs';import {d}from'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$4,b as b$1}from'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var pe=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Re(c$1,de){let _={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return _;let q=typeof c$1=="string"?document.querySelector(c$1):c$1;if(!q)return b("timeline: Container not found:",c$1),_;let l=q,{trigger:B={},speed:V=1,once:k=false,axis:h="y",tracks:U,onComplete:fe,repeat:x,repeatDelay:I=0,loop:R=false,loopDuration:ce=1500,debug:ue=false,label:me,respectReducedMotion:X=true}=de,ge=a(B.start||"top bottom"),ye=a(B.end||"bottom top"),w=x==="infinite"?1/0:x??0,i,L=false,C=R===true?1/0:typeof R=="number"?R:0,s=false,P=0,u=C,A=X&&a$1(),be=a$2(e=>{A=X&&e,A&&(s=false,clearTimeout(i),i=void 0);}),H=()=>C>0&&!A,z=new Map,G=U.map(e=>{let o=typeof e.easing=="function"?e.easing:d[e.easing??"linear"]??d.linear,r=Array.from(l.querySelectorAll(e.selector)),n=r.map(t=>a$3(t));return r.forEach((t,a)=>{z.has(t)||z.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=`${n[a]}`,t.style.strokeDashoffset=`${n[a]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:r,lengths:n,easeFn:o}});function he(){for(let[e,o]of z)o?e.setAttribute("style",o):e.removeAttribute("style");}let v=0,T=0,Y=0,J=0,m=false,y=false,b$3=-1,d$1=0,p=null;ue&&(p=document.createElement("div"),Object.assign(p.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(p));function xe(e){if(!p)return;let o=me??(typeof c$1=="string"?c$1:"timeline"),r=U.map(({selector:n,from:t,to:a},j)=>{let g=pe[j%pe.length],D=a>t?Math.min(1,Math.max(0,(e-t)/(a-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
1
+ import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-XC5NR2MU.mjs';import {a as a$4}from'../chunk-YOOPMYT6.mjs';import {a,e,c,b as b$2}from'../chunk-NV6YTPHI.mjs';import {f}from'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$5,b as b$1}from'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var de=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Ce(f$1,ce){let q={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return q;let B=typeof f$1=="string"?document.querySelector(f$1):f$1;if(!B)return b("timeline: Container not found:",f$1),q;let l=B,{trigger:V={},speed:N=1,once:$=false,axis:h="y",tracks:U,onComplete:fe,repeat:x,repeatDelay:I=0,loop:R=false,loopDuration:ue=1500,debug:me=false,label:ge,respectReducedMotion:X=true}=ce,ye=a(V.start||"top bottom"),be=a(V.end||"bottom top"),w=x==="infinite"?1/0:x??0,i,L=false,C=R===true?1/0:typeof R=="number"?R:0,s=false,P=0,u=C,H=X&&a$1(),he=a$2(e=>{H=X&&e,H&&(s=false,clearTimeout(i),i=void 0);}),z=()=>C>0&&!H,A=new Map,O=U.map(e=>{let o=f(e.easing),r=Array.from(l.querySelectorAll(e.selector)),n=r.map(t=>a$3(t));return r.forEach((t,a)=>{A.has(t)||A.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=a$4(n[a]),t.style.strokeDashoffset=`${n[a]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:r,lengths:n,easeFn:o}});function xe(){for(let[e,o]of A)o?e.setAttribute("style",o):e.removeAttribute("style");}let v=0,T=0,Y=0,J=0,m=false,y=false,b$3=-1,d=0,p=null;me&&(p=document.createElement("div"),Object.assign(p.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(p));function we(e){if(!p)return;let o=ge??(typeof f$1=="string"?f$1:"timeline"),r=U.map(({selector:n,from:t,to:a},G)=>{let g=de[G%de.length],D=a>t?Math.min(1,Math.max(0,(e-t)/(a-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
2
2
  <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
3
3
  <span style="color:${g};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${n}</span>
4
4
  <span style="color:#666;margin-left:8px">${S}%</span>
@@ -20,4 +20,4 @@ import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-XC5N
20
20
  <div style="height:2px;background:#2a2a2a;border-radius:1px;overflow:hidden">
21
21
  <div style="height:100%;background:#fff;border-radius:1px;width:${e*100}%;transition:width 0.05s linear"></div>
22
22
  </div>
23
- </div>`;}function E(){return h==="x"?window.scrollX:window.scrollY}function K(){return h==="x"?window.innerWidth:window.innerHeight}function Q(){let e=l.getBoundingClientRect(),o=E(),r=h==="x"?e.left:e.top,n=h==="x"?e.width:e.height,t=c({top:r,height:n},o,K(),ge,ye);v=t.tStart,T=t.tEnd,Y=r+o-K(),J=r+o+n;}function Z(e){l.style.setProperty("--scroll-draw-progress",String(e)),G.forEach(({elements:o,lengths:r,from:n,to:t,easeFn:a,fade:j})=>{let g=t-n,D=g>0?Math.min(1,Math.max(0,(e-n)/g)):0,S=a(D);o.forEach((te,ve)=>{te.style.strokeDashoffset=`${r[ve]*(1-S)}`,j&&(te.style.opacity=String(S));});}),xe(e);}function M(){L=false,b$3=-1,d$1=0,y=false,G.forEach(({elements:e,lengths:o,fade:r})=>{e.forEach((n,t)=>{n.style.strokeDashoffset=`${o[t]}`,r&&(n.style.opacity="0");});}),l.style.setProperty("--scroll-draw-progress","0");}function ee(){return s?b$2(E(),Y,J,1):b$2(E(),v,T,Math.min(V,1))}function we(){L&&ee()%1&&M();let e;s?e=Math.min(1,(performance.now()-P)/ce):(e=b$2(E(),v,T,V),(k||H())&&(b$3=Math.max(b$3,e),e=b$3)),d$1=e,Z(e),e>=1&&!y?(y=true,fe?.(),H()&&!s&&!i?i=setTimeout(()=>{i=void 0,u!==1/0&&u--,M(),s=true,P=performance.now(),f();},I):w>0&&k&&!s&&!i&&(i=setTimeout(()=>{i=void 0,w!==1/0&&w--,L=true;},I))):!s&&e<1&&!k&&(y=false),s&&e>=1&&!i&&(y=false,u>0&&H()?i=setTimeout(()=>{i=void 0,u!==1/0&&u--,M(),P=performance.now(),f();},I):s=false);}Q();let O=e(window,[l],ee,we,()=>{G.forEach(({elements:e,lengths:o})=>{e.forEach((r,n)=>{o[n]=a$3(r),r.style.strokeDasharray=`${o[n]}`;});}),Q();}),f=()=>O.hold(m);return f(),a$4(l,{type:"draw",getProgress:()=>d$1,getTrigger:()=>({tStart:v,tEnd:T})}),{destroy(){O.off(),clearTimeout(i),b$1(l),be(),p&&(p.remove(),p=null),he(),l.style.removeProperty("--scroll-draw-progress");},refresh:O.remeasure,replay(){w=x==="infinite"?1/0:x??0,u=C,s=false,clearTimeout(i),i=void 0,M(),m=false,f();},pause(){m=true,f();},resume(){m&&(m=false,f());},seek(e){d$1=Math.min(1,Math.max(0,e)),b$3=d$1,m=true,f(),Z(d$1);},getProgress(){return d$1}}}export{Re as scrollDrawTimeline};
23
+ </div>`;}function E(){return h==="x"?window.scrollX:window.scrollY}function K(){return h==="x"?window.innerWidth:window.innerHeight}function Q(){let e=l.getBoundingClientRect(),o=E(),r=h==="x"?e.left:e.top,n=h==="x"?e.width:e.height,t=c({top:r,height:n},o,K(),ye,be);v=t.tStart,T=t.tEnd,Y=r+o-K(),J=r+o+n;}function Z(e){l.style.setProperty("--scroll-draw-progress",String(e)),O.forEach(({elements:o,lengths:r,from:n,to:t,easeFn:a,fade:G})=>{let g=t-n,D=g>0?Math.min(1,Math.max(0,(e-n)/g)):0,S=a(D);o.forEach((te,Te)=>{te.style.strokeDashoffset=`${r[Te]*(1-S)}`,G&&(te.style.opacity=String(S));});}),we(e);}function M(){L=false,b$3=-1,d=0,y=false,O.forEach(({elements:e,lengths:o,fade:r})=>{e.forEach((n,t)=>{n.style.strokeDashoffset=`${o[t]}`,r&&(n.style.opacity="0");});}),l.style.setProperty("--scroll-draw-progress","0");}function ee(){return s?b$2(E(),Y,J,1):b$2(E(),v,T,Math.min(N,1))}function ve(){L&&ee()%1&&M();let e;s?e=Math.min(1,(performance.now()-P)/ue):(e=b$2(E(),v,T,N),($||z())&&(b$3=Math.max(b$3,e),e=b$3)),d=e,Z(e),e>=1&&!y?(y=true,fe?.(),z()&&!s&&!i?i=setTimeout(()=>{i=void 0,u!==1/0&&u--,M(),s=true,P=performance.now(),c$1();},I):w>0&&$&&!s&&!i&&(i=setTimeout(()=>{i=void 0,w!==1/0&&w--,L=true;},I))):!s&&e<1&&!$&&(y=false),s&&e>=1&&!i&&(y=false,u>0&&z()?i=setTimeout(()=>{i=void 0,u!==1/0&&u--,M(),P=performance.now(),c$1();},I):s=false);}Q();let F=e(window,[l],ee,ve,()=>{O.forEach(({elements:e,lengths:o})=>{e.forEach((r,n)=>{o[n]=a$3(r),r.style.strokeDasharray=a$4(o[n]);});}),Q();}),c$1=()=>F.hold(m);return c$1(),a$5(l,{type:"draw",getProgress:()=>d,getTrigger:()=>({tStart:v,tEnd:T})}),{destroy(){F.off(),clearTimeout(i),b$1(l),he(),p&&(p.remove(),p=null),xe(),l.style.removeProperty("--scroll-draw-progress");},refresh:F.remeasure,replay(){w=x==="infinite"?1/0:x??0,u=C,s=false,clearTimeout(i),i=void 0,M(),m=false,c$1();},pause(){m=true,c$1();},resume(){m&&(m=false,c$1());},seek(e){d=Math.min(1,Math.max(0,e)),b$3=d,m=true,c$1(),Z(d);},getProgress(){return d}}}export{Ce as scrollDrawTimeline};
@@ -1,4 +1,12 @@
1
1
  type EasingName = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'spring' | 'bounce' | 'elastic';
2
+ /**
3
+ * A CSS timing function (2.26.0+): `cubic-bezier(x1, y1, x2, y2)` with x1 and
4
+ * x2 in [0, 1], or the keyword `ease`. The library's own `ease-in`, `ease-out`
5
+ * and `ease-in-out` are its quadratics, not the CSS keywords of the same name.
6
+ */
7
+ type CssEasing = 'ease' | `cubic-bezier(${string})`;
8
+ /** What every `easing` option takes: a name, a CSS cubic-bezier(), or a curve over [0, 1]. */
9
+ type Easing = EasingName | CssEasing | ((t: number) => number);
2
10
  type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
3
11
  interface TriggerConfig {
4
12
  start?: string;
@@ -18,7 +26,7 @@ interface ScrollDrawOptions {
18
26
  selector?: string;
19
27
  speed?: number;
20
28
  fade?: boolean;
21
- easing?: EasingName | ((t: number) => number);
29
+ easing?: Easing;
22
30
  trigger?: TriggerConfig;
23
31
  /**
24
32
  * Each path starts this fraction of the scroll range after the previous one,
@@ -159,4 +167,4 @@ interface ScrollDrawInstance {
159
167
  refresh?: () => void;
160
168
  }
161
169
 
162
- export type { EasingName as E, PresetName as P, ScrollDrawInstance as S, TriggerConfig as T, ScrollDrawOptions as a };
170
+ export type { CssEasing as C, Easing as E, PresetName as P, ScrollDrawInstance as S, TriggerConfig as T, ScrollDrawOptions as a };
@@ -1,4 +1,12 @@
1
1
  type EasingName = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'spring' | 'bounce' | 'elastic';
2
+ /**
3
+ * A CSS timing function (2.26.0+): `cubic-bezier(x1, y1, x2, y2)` with x1 and
4
+ * x2 in [0, 1], or the keyword `ease`. The library's own `ease-in`, `ease-out`
5
+ * and `ease-in-out` are its quadratics, not the CSS keywords of the same name.
6
+ */
7
+ type CssEasing = 'ease' | `cubic-bezier(${string})`;
8
+ /** What every `easing` option takes: a name, a CSS cubic-bezier(), or a curve over [0, 1]. */
9
+ type Easing = EasingName | CssEasing | ((t: number) => number);
2
10
  type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
3
11
  interface TriggerConfig {
4
12
  start?: string;
@@ -18,7 +26,7 @@ interface ScrollDrawOptions {
18
26
  selector?: string;
19
27
  speed?: number;
20
28
  fade?: boolean;
21
- easing?: EasingName | ((t: number) => number);
29
+ easing?: Easing;
22
30
  trigger?: TriggerConfig;
23
31
  /**
24
32
  * Each path starts this fraction of the scroll range after the previous one,
@@ -159,4 +167,4 @@ interface ScrollDrawInstance {
159
167
  refresh?: () => void;
160
168
  }
161
169
 
162
- export type { EasingName as E, PresetName as P, ScrollDrawInstance as S, TriggerConfig as T, ScrollDrawOptions as a };
170
+ export type { CssEasing as C, Easing as E, PresetName as P, ScrollDrawInstance as S, TriggerConfig as T, ScrollDrawOptions as a };
@@ -1 +1 @@
1
- 'use strict';function le({tension:e=2.5,friction:t=2.2}={}){return r=>1-Math.cos(r*Math.PI*e)*Math.pow(1-r,t)}function fe({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(n),i=0,a=[];for(let u=0;u<r;u++){let s=Math.pow(o,u);a.push(s),i+=s;}let c=[0],l=0;for(let u=0;u<r;u++)l+=a[u]/i,c.push(l);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let s=0;s<r;s++)if(u<=c[s+1]){let f=(u-c[s])/(c[s+1]-c[s]);if(s===0)return f*(2-f);let p=1-Math.pow(n,s);return p+(1-p)*(2*f-1)*(2*f-1)}return 1}}function pe({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),o=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-o)*(2*Math.PI)/n)+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:le(),bounce:fe(),elastic:pe()};function K(e,t,r){return Math.min(r,Math.max(t,e))}function k(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}}var J=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function X(e,t,r,n){return e+r+t*J(n,0)}function j(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:J(e,1))}function U(e,t,r,n){return r===t?0:K((e-t)/(r-t)*n,0,1)}function Z(e,t,r,n,o){let i=X(e.top,e.height,t,n.element)-j(n.viewport,r),a=X(e.top,e.height,t,o.element)-j(o.viewport,r);return {tStart:i,tEnd:a}}var ee=Symbol.for("svg-scroll-draw.registry");function te(){let e=globalThis;return e[ee]||(e[ee]=new Map)}function ne(e,t){te().set(e,t);}function re(e){te().delete(e);}var ge=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function W(e,...t){ge&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function oe(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),r=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",r),()=>t.removeEventListener("change",r);let n=t;return n.addListener?.(r),()=>n.removeListener?.(r)}var S,P=new Set,D=new WeakMap,_=new Map,ie=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function be(e){let t=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let n=r;n;n=n.previousElementSibling)t.add(n);return t}function se(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>t();S??(S=new ResizeObserver(o=>{let i=false;for(let{target:a}of o)D.get(a)!==ie(a)&&(i=true),D.set(a,"");i&&P.forEach(a=>a());})),P.add(r);let n=be(e);return [document.body,document.documentElement].forEach(o=>o&&n.add(o)),n.forEach(o=>{D.has(o)||D.set(o,ie(o)),_.set(o,(_.get(o)??0)+1),S.observe(o);}),()=>{P.delete(r)&&(n.forEach(o=>{let i=(_.get(o)??1)-1;if(i)return void _.set(o,i);_.delete(o),S?.unobserve(o);}),P.size||(S?.disconnect(),S=void 0));}}function ae(e,t,r,n,o){let i,a=NaN,c,l,u=()=>{i=0,n(),!c&&!i&&(a=r())>0&&a<1&&(i=requestAnimationFrame(u));},s=()=>{!i&&!c&&r()!==a&&(i=requestAnimationFrame(u));},f=b=>{c=b,cancelAnimationFrame(i),i=a=NaN,s();},p=()=>{clearTimeout(l),o(),s();},v=()=>{clearTimeout(l),l=setTimeout(p,150);},g=se(t,v),M=b=>{e[b]("scroll",s,{passive:true}),window[b]("resize",v),window[b]("orientationchange",v);};return M("addEventListener"),s(),{hold:f,remeasure:p,off(){f(true),M("removeEventListener"),g(),clearTimeout(l);}}}var ue={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function De(e,t={}){if(typeof window>"u")return ue;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return W("scrollVideo: <video> element not found:",e),ue;let n=r,{trigger:o={},easing:i="linear",once:a=false,axis:c="y",preload:l="auto",triggerElement:u,onReady:s,onComplete:f,onProgress:p}=t,v=u??n,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof i=="function"?i:Q[i]??Q.linear,b=k(o.start||"top top"),de=k(o.end||"bottom top");n.pause(),n.hasAttribute("preload")||(n.preload=l);let F=t.from??0,I=t.to,R=0,T=0,h=false,O=-1,N=0,w=0,A=false,y=false,q=()=>c==="x"?window.scrollX:window.scrollY,ce=()=>c==="x"?window.innerWidth:window.innerHeight;function z(){let d=v.getBoundingClientRect(),m=c==="x"?d.left:d.top,L=c==="x"?d.width:d.height,H=Z({top:m,height:L},q(),ce(),b,de);R=H.tStart,T=H.tEnd,y&&T===R&&W("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",n);}let V=NaN;function E(d){if(!y)return;let m=I??n.duration??0,L=F+(m-F)*d;L!==V&&(V=L,n.currentTime=L),n.style.setProperty("--scroll-draw-progress",String(d)),p?.(d);}let B=()=>U(q(),R,T,1);function me(){if(!y||g)return;let d=B(),m=a?Math.max(O,M(N=Math.max(N,d))):M(d);w=m,E(m),m>=1&&!A?(A=true,f?.()):m<1&&!a&&(A=false);}let x=ae(window,[v],B,me,z),C=()=>x.hold(h||!y||g);C();function G(){if(y=true,I===void 0&&(I=n.duration),g){E(1),s?.();return}z(),s?.(),h?E(w):C();}n.readyState>=1?G():n.addEventListener("loadedmetadata",G,{once:true}),y||z();let Y=g?()=>{}:oe(d=>{d&&(Y(),g=true,x.hold(true),E(1));});ne(n,{type:"video",getProgress:()=>w,getTrigger:()=>({tStart:R,tEnd:T})});function $(){h&&(h=false,C());}return {destroy(){x.off(),n.removeEventListener("loadedmetadata",G),Y(),re(n);},replay(){O=-1,N=0,A=false,w=0,V=NaN,E(0),$();},pause(){h=true,x.hold(true);},resume:$,seek(d){let m=Math.min(1,Math.max(0,d));w=m,O=m,N=0,h=true,x.hold(true),V=NaN,E(m);},getProgress(){return w}}}exports.scrollVideo=De;
1
+ 'use strict';var pe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function x(e,...n){pe&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function ge({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function be({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(r),o=0,s=[];for(let a=0;a<t;a++){let d=Math.pow(i,a);s.push(d),o+=d;}let u=[0],m=0;for(let a=0;a<t;a++)m+=s[a]/o,u.push(m);return a=>{if(a<=0)return 0;if(a>=1)return 1;for(let d=0;d<t;d++)if(a<=u[d+1]){let f=(a-u[d])/(u[d+1]-u[d]);if(d===0)return f*(2-f);let p=1-Math.pow(r,d);return p+(1-p)*(2*f-1)*(2*f-1)}return 1}}function ve({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),i=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return o=>o<=0?0:o>=1?1:t*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/r)+1}var A={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:ge(),bounce:be(),elastic:ve()};function he(e,n,t,r){let i=(o,s,u)=>((1+3*o-3*s)*u+3*s-6*o)*u*u+3*o*u;return o=>{if(o<=0||o>=1)return +(o>0);let s=o;for(let u=0;u<8;u++)s-=(i(e,t,s)-o)/((3*(1+3*e-3*t)*s+6*t-12*e)*s+3*e);if(!(s>=0&&s<=1&&Math.abs(i(e,t,s)-o)<1e-9))for(let u=0,m=0,a=1;u<30;u++)s=(m+a)/2,i(e,t,s)<o?m=s:a=s;return i(n,r,s)}}function we(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [he(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var J=new Set;function K(e,n="linear"){if(typeof e=="function")return e;if(e==null)return A[n];if({}.hasOwnProperty.call(A,e))return A[e];let t=we(String(e));return t?t[0]:(!J.has(e)&&J.add(e)&&x(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),A[n])}function U(e,n,t){return Math.min(t,Math.max(n,e))}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}}var Z=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function X(e,n,t,r){return e+t+n*Z(r,0)}function j(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Z(e,1))}function ee(e,n,t,r){return t===n?0:U((e-n)/(t-n)*r,0,1)}function te(e,n,t,r,i){let o=X(e.top,e.height,n,r.element)-j(r.viewport,t),s=X(e.top,e.height,n,i.element)-j(i.viewport,t);return {tStart:o,tEnd:s}}var ne=Symbol.for("svg-scroll-draw.registry");function re(){let e=globalThis;return e[ne]||(e[ne]=new Map)}function oe(e,n){re().set(e,n);}function ie(e){re().delete(e);}function se(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=i=>e(!!i.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}var _,O=new Set,D=new WeakMap,R=new Map,ue=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function Ee(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function ae(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();_??(_=new ResizeObserver(i=>{let o=false;for(let{target:s}of i)D.get(s)!==ue(s)&&(o=true),D.set(s,"");o&&O.forEach(s=>s());})),O.add(t);let r=Ee(e);return [document.body,document.documentElement].forEach(i=>i&&r.add(i)),r.forEach(i=>{D.has(i)||D.set(i,ue(i)),R.set(i,(R.get(i)??0)+1),_.observe(i);}),()=>{O.delete(t)&&(r.forEach(i=>{let o=(R.get(i)??1)-1;if(o)return void R.set(i,o);R.delete(i),_?.unobserve(i);}),O.size||(_?.disconnect(),_=void 0));}}function de(e,n,t,r,i){let o,s=NaN,u,m,a=()=>{o=0,r(),!u&&!o&&(s=t())>0&&s<1&&(o=requestAnimationFrame(a));},d=()=>{!o&&!u&&t()!==s&&(o=requestAnimationFrame(a));},f=b=>{u=b,cancelAnimationFrame(o),o=s=NaN,d();},p=()=>{clearTimeout(m),i(),d();},v=()=>{clearTimeout(m),m=setTimeout(p,150);},g=ae(n,v),M=b=>{e[b]("scroll",d,{passive:true}),window[b]("resize",v),window[b]("orientationchange",v);};return M("addEventListener"),d(),{hold:f,remeasure:p,off(){f(true),M("removeEventListener"),g(),clearTimeout(m);}}}var ce={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ke(e,n={}){if(typeof window>"u")return ce;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return x("scrollVideo: <video> element not found:",e),ce;let r=t,{trigger:i={},easing:o="linear",once:s=false,axis:u="y",preload:m="auto",triggerElement:a,onReady:d,onComplete:f,onProgress:p}=n,v=a??r,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=K(o),b=G(i.start||"top top"),me=G(i.end||"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=m);let W=n.from??0,I=n.to,T=0,N=0,h=false,C=-1,z=0,w=0,P=false,E=false,q=()=>u==="x"?window.scrollX:window.scrollY,le=()=>u==="x"?window.innerWidth:window.innerHeight;function k(){let c=v.getBoundingClientRect(),l=u==="x"?c.left:c.top,S=u==="x"?c.width:c.height,H=te({top:l,height:S},q(),le(),b,me);T=H.tStart,N=H.tEnd,E&&N===T&&x("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r);}let V=NaN;function y(c){if(!E)return;let l=I??r.duration??0,S=W+(l-W)*c;S!==V&&(V=S,r.currentTime=S),r.style.setProperty("--scroll-draw-progress",String(c)),p?.(c);}let $=()=>ee(q(),T,N,1);function fe(){if(!E||g)return;let c=$(),l=s?Math.max(C,M(z=Math.max(z,c))):M(c);w=l,y(l),l>=1&&!P?(P=true,f?.()):l<1&&!s&&(P=false);}let L=de(window,[v],$,fe,k),F=()=>L.hold(h||!E||g);F();function Q(){if(E=true,I===void 0&&(I=r.duration),g){y(1),d?.();return}k(),d?.(),h?y(w):F();}r.readyState>=1?Q():r.addEventListener("loadedmetadata",Q,{once:true}),E||k();let B=g?()=>{}:se(c=>{c&&(B(),g=true,L.hold(true),y(1));});oe(r,{type:"video",getProgress:()=>w,getTrigger:()=>({tStart:T,tEnd:N})});function Y(){h&&(h=false,F());}return {destroy(){L.off(),r.removeEventListener("loadedmetadata",Q),B(),ie(r);},replay(){C=-1,z=0,P=false,w=0,V=NaN,y(0),Y();},pause(){h=true,L.hold(true);},resume:Y,seek(c){let l=Math.min(1,Math.max(0,c));w=l,C=l,z=0,h=true,L.hold(true),V=NaN,y(l);},getProgress(){return w}}}exports.scrollVideo=ke;
@@ -1,10 +1,10 @@
1
- import { T as TriggerConfig, E as EasingName, S as ScrollDrawInstance } from '../types-9bcJdVcg.mjs';
1
+ import { T as TriggerConfig, E as Easing, S as ScrollDrawInstance } from '../types-iITMwrru.mjs';
2
2
 
3
3
  interface ScrollVideoOptions {
4
4
  trigger?: TriggerConfig;
5
5
  from?: number;
6
6
  to?: number;
7
- easing?: EasingName | ((t: number) => number);
7
+ easing?: Easing;
8
8
  once?: boolean;
9
9
  axis?: 'x' | 'y';
10
10
  preload?: 'auto' | 'metadata';
@@ -1,10 +1,10 @@
1
- import { T as TriggerConfig, E as EasingName, S as ScrollDrawInstance } from '../types-9bcJdVcg.js';
1
+ import { T as TriggerConfig, E as Easing, S as ScrollDrawInstance } from '../types-iITMwrru.js';
2
2
 
3
3
  interface ScrollVideoOptions {
4
4
  trigger?: TriggerConfig;
5
5
  from?: number;
6
6
  to?: number;
7
- easing?: EasingName | ((t: number) => number);
7
+ easing?: Easing;
8
8
  once?: boolean;
9
9
  axis?: 'x' | 'y';
10
10
  preload?: 'auto' | 'metadata';
@@ -1 +1 @@
1
- export{a as scrollVideo}from'../chunk-BRV2B2YW.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as scrollVideo}from'../chunk-HJTHOZK5.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';