svg-scroll-draw 2.15.1 → 2.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular/index.cjs +2 -2
- package/dist/angular/index.mjs +2 -2
- package/dist/aos/react/index.d.mts +44 -0
- package/dist/aos/react/index.d.ts +44 -0
- package/dist/horizontal/index.d.mts +108 -0
- package/dist/horizontal/index.d.ts +108 -0
- package/dist/lenis/index.d.mts +51 -0
- package/dist/lenis/index.d.ts +51 -0
- package/dist/nuxt/index.cjs +2 -2
- package/dist/nuxt/index.mjs +2 -2
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.mjs +2 -2
- package/dist/solid/index.cjs +2 -2
- package/dist/solid/index.mjs +2 -2
- package/dist/svelte/index.cjs +2 -2
- package/dist/svelte/index.mjs +2 -2
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vivus/react/index.d.mts +116 -0
- package/dist/vivus/react/index.d.ts +116 -0
- package/dist/vue/index.cjs +2 -2
- package/dist/vue/index.mjs +2 -2
- package/package.json +1 -1
package/dist/video/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function H({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),c=Math.sqrt(r),s=0,p=[];for(let i=0;i<n;i++){let a=Math.pow(c,i);p.push(a),s+=a;}let u=[0],
|
|
1
|
+
function H({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),c=Math.sqrt(r),s=0,p=[];for(let i=0;i<n;i++){let a=Math.pow(c,i);p.push(a),s+=a;}let u=[0],v=0;for(let i=0;i<n;i++)v+=p[i]/s,u.push(v);return i=>{if(i<=0)return 0;if(i>=1)return 1;for(let a=0;a<n;a++)if(i<=u[a+1]){let f=(i-u[a])/(u[a+1]-u[a]);if(a===0)return f*(2-f);let b=1-Math.pow(r,a);return b+(1-b)*(2*f-1)*(2*f-1)}return 1}}function ee({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),c=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-c)*(2*Math.PI)/r)+1}var C={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:H(),elastic:ee()};function N(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}}function z(e,t,n,r){switch(r){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function G(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 te(e,t,n){return Math.min(n,Math.max(t,e))}function q(e,t,n,r){return n===t?0:te((e-t)/(n-t)*r,0,1)}function B(e,t,n,r,c){let s=z(e.top,e.height,t,r.element)-G(r.viewport,n),p=z(e.top,e.height,t,c.element)-G(c.viewport,n);return {tStart:s,tEnd:p}}var W=Symbol.for("svg-scroll-draw.registry");function k(){let e=globalThis;return e[W]||(e[W]=new Map)}function X(e,t){k().set(e,t);}function K(e){k().delete(e);}var re=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function Y(e,...t){re&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var j={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ce(e,t={}){if(typeof window>"u")return j;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return Y("scrollVideo: <video> element not found:",e),j;let r=n,{trigger:c={},easing:s="linear",once:p=false,axis:u="y",preload:v="auto",onReady:i,onComplete:a,onProgress:f}=t,b=window.matchMedia("(prefers-reduced-motion: reduce)").matches,J=typeof s=="function"?s:C[s]??C.linear,Q=N(c.start??"top top"),U=N(c.end??"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=v);let F=t.from??0,I=t.to,R=0,A=0,l=0,h=false,d=false,w=-1,y=0,M=false,g=false,D=()=>u==="x"?window.scrollX:window.scrollY,Z=()=>u==="x"?window.innerWidth:window.innerHeight;function L(){let o=r.getBoundingClientRect(),m=u==="x"?o.left:o.top,x=u==="x"?o.width:o.height,$=B({top:m,height:x},D(),Z(),Q,U);R=$.tStart,A=$.tEnd;}let E=NaN;function _(o){if(!g)return;let m=I??r.duration??0,x=F+(m-F)*o;x!==E&&(E=x,r.currentTime=x),r.style.setProperty("--scroll-draw-progress",String(o)),f?.(o);}function S(){if(!h||d||!g||b)return;let o=J(q(D(),R,A,1));p&&(w=Math.max(w,o),o=w),y=o,_(o),o>=1&&!M?(M=true,a?.()):o<1&&!p&&(M=false),l=requestAnimationFrame(S);}function V(){if(g=true,I===void 0&&(I=r.duration),b){_(1),i?.();return}L(),i?.(),h&&!d&&(l=requestAnimationFrame(S));}r.readyState>=1?V():r.addEventListener("loadedmetadata",V,{once:true}),g||L();let O=new IntersectionObserver(o=>{o.forEach(m=>{h=m.isIntersecting,h&&!d&&g?l=requestAnimationFrame(S):cancelAnimationFrame(l);});}),P;function T(){clearTimeout(P),P=setTimeout(L,150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),O.observe(r),X(r,{type:"video",getProgress:()=>y,getTrigger:()=>({tStart:R,tEnd:A})}),{destroy(){cancelAnimationFrame(l),O.disconnect(),r.removeEventListener("loadedmetadata",V),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(P),K(r);},replay(){w=-1,M=false,y=0,d=false,E=NaN,_(0);},pause(){d=true,cancelAnimationFrame(l);},resume(){d&&(d=false,h&&g&&(l=requestAnimationFrame(S)));},seek(o){let m=Math.min(1,Math.max(0,o));y=m,w=m,d=true,cancelAnimationFrame(l),E=NaN,_(m);},getProgress(){return y}}}export{ce as scrollVideo};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
type VivusType = 'delayed' | 'sync' | 'async' | 'nsync' | 'oneByOne' | 'scenario' | 'scenario-sync';
|
|
4
|
+
type VivusStart = 'inViewport' | 'manual' | 'autostart';
|
|
5
|
+
type VivusTiming = (x: number) => number;
|
|
6
|
+
type VivusCallback = (instance: Vivus) => void;
|
|
7
|
+
interface VivusOptions {
|
|
8
|
+
type?: VivusType;
|
|
9
|
+
/** Load the SVG from this URL into `element` instead of using markup. */
|
|
10
|
+
file?: string;
|
|
11
|
+
start?: VivusStart;
|
|
12
|
+
/** Animation length in frames. Default 120. */
|
|
13
|
+
duration?: number;
|
|
14
|
+
/** For `delayed`: frames between the first and last path starting. Default duration / 3. */
|
|
15
|
+
delay?: number;
|
|
16
|
+
/** Extra gap in the dash pattern, so the line start never shows early. Default 1. */
|
|
17
|
+
dashGap?: number;
|
|
18
|
+
/** Clone-and-replace each path after every update (an old IE/Edge repaint hack). */
|
|
19
|
+
forceRender?: boolean;
|
|
20
|
+
reverseStack?: boolean;
|
|
21
|
+
selfDestroy?: boolean;
|
|
22
|
+
onReady?: VivusCallback;
|
|
23
|
+
ignoreInvisible?: boolean;
|
|
24
|
+
pathTimingFunction?: VivusTiming;
|
|
25
|
+
animTimingFunction?: VivusTiming;
|
|
26
|
+
}
|
|
27
|
+
interface PathRecord {
|
|
28
|
+
el: SVGPathElement;
|
|
29
|
+
length: number;
|
|
30
|
+
startAt: number;
|
|
31
|
+
duration: number;
|
|
32
|
+
isResizeSensitive: boolean;
|
|
33
|
+
progress?: number;
|
|
34
|
+
}
|
|
35
|
+
declare class Vivus {
|
|
36
|
+
static LINEAR: VivusTiming;
|
|
37
|
+
static EASE: VivusTiming;
|
|
38
|
+
static EASE_OUT: VivusTiming;
|
|
39
|
+
static EASE_IN: VivusTiming;
|
|
40
|
+
static EASE_OUT_BOUNCE: VivusTiming;
|
|
41
|
+
el: Element;
|
|
42
|
+
parentEl: Element;
|
|
43
|
+
isReady: boolean;
|
|
44
|
+
type: VivusType;
|
|
45
|
+
start: VivusStart;
|
|
46
|
+
duration: number;
|
|
47
|
+
delay: number | null;
|
|
48
|
+
dashGap: number;
|
|
49
|
+
forceRender: boolean;
|
|
50
|
+
reverseStack: boolean;
|
|
51
|
+
selfDestroy: boolean;
|
|
52
|
+
ignoreInvisible: boolean;
|
|
53
|
+
onReady?: VivusCallback;
|
|
54
|
+
animTimingFunction: VivusTiming;
|
|
55
|
+
pathTimingFunction: VivusTiming;
|
|
56
|
+
callback: VivusCallback;
|
|
57
|
+
map: PathRecord[];
|
|
58
|
+
frameLength: number;
|
|
59
|
+
currentFrame: number;
|
|
60
|
+
delayUnit: number;
|
|
61
|
+
speed: number;
|
|
62
|
+
handle: number | null;
|
|
63
|
+
private instanceCallback;
|
|
64
|
+
private mustRecalcScale;
|
|
65
|
+
private viewportListener;
|
|
66
|
+
constructor(element: string | Element, options?: VivusOptions, callback?: VivusCallback);
|
|
67
|
+
private setElement;
|
|
68
|
+
private setOptions;
|
|
69
|
+
private setCallback;
|
|
70
|
+
/** Measure every path, set its dashes, and work out when each one draws. */
|
|
71
|
+
mapping(): void;
|
|
72
|
+
/** Re-measure `vector-effect: non-scaling-stroke` paths on the next frame (after a resize). */
|
|
73
|
+
recalc(): void;
|
|
74
|
+
performLineRecalc(): void;
|
|
75
|
+
/** One frame: advance by `speed`, render, and finish at either end. */
|
|
76
|
+
draw(): void;
|
|
77
|
+
private finished;
|
|
78
|
+
/** Render the current frame to every path's dash offset. */
|
|
79
|
+
trace(): void;
|
|
80
|
+
renderPath(index: number): void;
|
|
81
|
+
init(): void;
|
|
82
|
+
private starter;
|
|
83
|
+
/** `'start'`, `'progress'` or `'end'`. */
|
|
84
|
+
getStatus(): 'start' | 'progress' | 'end';
|
|
85
|
+
reset(): this;
|
|
86
|
+
finish(): this;
|
|
87
|
+
/** Jump to a point (0–1) and render it. */
|
|
88
|
+
setFrameProgress(progress: number): this;
|
|
89
|
+
/**
|
|
90
|
+
* Animate at `speed` frames per frame (negative plays backwards). The callback
|
|
91
|
+
* may be given alone, as the first argument.
|
|
92
|
+
*/
|
|
93
|
+
play(speed?: number | VivusCallback, callback?: VivusCallback): this;
|
|
94
|
+
stop(): this;
|
|
95
|
+
/** Stop and remove every dash style vivus set. */
|
|
96
|
+
destroy(): void;
|
|
97
|
+
isInvisible(el: Element): boolean;
|
|
98
|
+
/** Whether `el` is in view; with `h` = 1 its whole height must fit above the fold. */
|
|
99
|
+
isInViewport(el: Element, h?: number): boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* svg-scroll-draw/vivus/react — the vivus drop-in for React.
|
|
104
|
+
*
|
|
105
|
+
* `new Vivus()` needs the mounted <svg>, and the instance needs destroying when
|
|
106
|
+
* the component goes, which vivus users wire up by hand in every component. This
|
|
107
|
+
* hook does both and hands the instance back for `play()`, `reset()` and the
|
|
108
|
+
* rest. StrictMode's double mount is safe: the first instance is destroyed
|
|
109
|
+
* before the second is made.
|
|
110
|
+
*
|
|
111
|
+
* Options and the callback are read once, on mount.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
declare function useVivus<T extends Element = SVGSVGElement>(options?: VivusOptions, callback?: VivusCallback): [RefObject<T>, Vivus | null];
|
|
115
|
+
|
|
116
|
+
export { useVivus };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
type VivusType = 'delayed' | 'sync' | 'async' | 'nsync' | 'oneByOne' | 'scenario' | 'scenario-sync';
|
|
4
|
+
type VivusStart = 'inViewport' | 'manual' | 'autostart';
|
|
5
|
+
type VivusTiming = (x: number) => number;
|
|
6
|
+
type VivusCallback = (instance: Vivus) => void;
|
|
7
|
+
interface VivusOptions {
|
|
8
|
+
type?: VivusType;
|
|
9
|
+
/** Load the SVG from this URL into `element` instead of using markup. */
|
|
10
|
+
file?: string;
|
|
11
|
+
start?: VivusStart;
|
|
12
|
+
/** Animation length in frames. Default 120. */
|
|
13
|
+
duration?: number;
|
|
14
|
+
/** For `delayed`: frames between the first and last path starting. Default duration / 3. */
|
|
15
|
+
delay?: number;
|
|
16
|
+
/** Extra gap in the dash pattern, so the line start never shows early. Default 1. */
|
|
17
|
+
dashGap?: number;
|
|
18
|
+
/** Clone-and-replace each path after every update (an old IE/Edge repaint hack). */
|
|
19
|
+
forceRender?: boolean;
|
|
20
|
+
reverseStack?: boolean;
|
|
21
|
+
selfDestroy?: boolean;
|
|
22
|
+
onReady?: VivusCallback;
|
|
23
|
+
ignoreInvisible?: boolean;
|
|
24
|
+
pathTimingFunction?: VivusTiming;
|
|
25
|
+
animTimingFunction?: VivusTiming;
|
|
26
|
+
}
|
|
27
|
+
interface PathRecord {
|
|
28
|
+
el: SVGPathElement;
|
|
29
|
+
length: number;
|
|
30
|
+
startAt: number;
|
|
31
|
+
duration: number;
|
|
32
|
+
isResizeSensitive: boolean;
|
|
33
|
+
progress?: number;
|
|
34
|
+
}
|
|
35
|
+
declare class Vivus {
|
|
36
|
+
static LINEAR: VivusTiming;
|
|
37
|
+
static EASE: VivusTiming;
|
|
38
|
+
static EASE_OUT: VivusTiming;
|
|
39
|
+
static EASE_IN: VivusTiming;
|
|
40
|
+
static EASE_OUT_BOUNCE: VivusTiming;
|
|
41
|
+
el: Element;
|
|
42
|
+
parentEl: Element;
|
|
43
|
+
isReady: boolean;
|
|
44
|
+
type: VivusType;
|
|
45
|
+
start: VivusStart;
|
|
46
|
+
duration: number;
|
|
47
|
+
delay: number | null;
|
|
48
|
+
dashGap: number;
|
|
49
|
+
forceRender: boolean;
|
|
50
|
+
reverseStack: boolean;
|
|
51
|
+
selfDestroy: boolean;
|
|
52
|
+
ignoreInvisible: boolean;
|
|
53
|
+
onReady?: VivusCallback;
|
|
54
|
+
animTimingFunction: VivusTiming;
|
|
55
|
+
pathTimingFunction: VivusTiming;
|
|
56
|
+
callback: VivusCallback;
|
|
57
|
+
map: PathRecord[];
|
|
58
|
+
frameLength: number;
|
|
59
|
+
currentFrame: number;
|
|
60
|
+
delayUnit: number;
|
|
61
|
+
speed: number;
|
|
62
|
+
handle: number | null;
|
|
63
|
+
private instanceCallback;
|
|
64
|
+
private mustRecalcScale;
|
|
65
|
+
private viewportListener;
|
|
66
|
+
constructor(element: string | Element, options?: VivusOptions, callback?: VivusCallback);
|
|
67
|
+
private setElement;
|
|
68
|
+
private setOptions;
|
|
69
|
+
private setCallback;
|
|
70
|
+
/** Measure every path, set its dashes, and work out when each one draws. */
|
|
71
|
+
mapping(): void;
|
|
72
|
+
/** Re-measure `vector-effect: non-scaling-stroke` paths on the next frame (after a resize). */
|
|
73
|
+
recalc(): void;
|
|
74
|
+
performLineRecalc(): void;
|
|
75
|
+
/** One frame: advance by `speed`, render, and finish at either end. */
|
|
76
|
+
draw(): void;
|
|
77
|
+
private finished;
|
|
78
|
+
/** Render the current frame to every path's dash offset. */
|
|
79
|
+
trace(): void;
|
|
80
|
+
renderPath(index: number): void;
|
|
81
|
+
init(): void;
|
|
82
|
+
private starter;
|
|
83
|
+
/** `'start'`, `'progress'` or `'end'`. */
|
|
84
|
+
getStatus(): 'start' | 'progress' | 'end';
|
|
85
|
+
reset(): this;
|
|
86
|
+
finish(): this;
|
|
87
|
+
/** Jump to a point (0–1) and render it. */
|
|
88
|
+
setFrameProgress(progress: number): this;
|
|
89
|
+
/**
|
|
90
|
+
* Animate at `speed` frames per frame (negative plays backwards). The callback
|
|
91
|
+
* may be given alone, as the first argument.
|
|
92
|
+
*/
|
|
93
|
+
play(speed?: number | VivusCallback, callback?: VivusCallback): this;
|
|
94
|
+
stop(): this;
|
|
95
|
+
/** Stop and remove every dash style vivus set. */
|
|
96
|
+
destroy(): void;
|
|
97
|
+
isInvisible(el: Element): boolean;
|
|
98
|
+
/** Whether `el` is in view; with `h` = 1 its whole height must fit above the fold. */
|
|
99
|
+
isInViewport(el: Element, h?: number): boolean;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* svg-scroll-draw/vivus/react — the vivus drop-in for React.
|
|
104
|
+
*
|
|
105
|
+
* `new Vivus()` needs the mounted <svg>, and the instance needs destroying when
|
|
106
|
+
* the component goes, which vivus users wire up by hand in every component. This
|
|
107
|
+
* hook does both and hands the instance back for `play()`, `reset()` and the
|
|
108
|
+
* rest. StrictMode's double mount is safe: the first instance is destroyed
|
|
109
|
+
* before the second is made.
|
|
110
|
+
*
|
|
111
|
+
* Options and the callback are read once, on mount.
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
declare function useVivus<T extends Element = SVGSVGElement>(options?: VivusOptions, callback?: VivusCallback): [RefObject<T>, Vivus | null];
|
|
115
|
+
|
|
116
|
+
export { useVivus };
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var vue=require('vue');function jt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<n;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<n;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<n;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let
|
|
1
|
+
'use strict';var vue=require('vue');function jt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),s=0,c=[];for(let p=0;p<n;p++){let T=Math.pow(l,p);c.push(T),s+=T;}let u=[0],m=0;for(let p=0;p<n;p++)m+=c[p]/s,u.push(m);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let T=0;T<n;T++)if(p<=u[T+1]){let V=(p-u[T])/(u[T+1]-u[T]);if(T===0)return V*(2-V);let A=1-Math.pow(t,T);return A+(1-A)*(2*V-1)*(2*V-1)}return 1}}function Ut({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var ne={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:jt(),elastic:Ut()};function de(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function xt(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function At(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function Be(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Yt(e,r,n){return Math.min(n,Math.max(r,e))}function K(e,r,n,t){return n===r?0:Yt((e-r)/(n-r)*t,0,1)}function nt(e,r,n){let t=e.getBoundingClientRect(),l=n==="x"?t.width:t.height;return r?{top:n==="x"?t.left-r.getBoundingClientRect().left+r.scrollLeft:t.top-r.getBoundingClientRect().top+r.scrollTop,height:l,scroll:0}:{top:n==="x"?t.left:t.top,height:l,scroll:n==="x"?window.scrollX:window.scrollY}}function xe(e,r,n,t,l){let s=xt(e.top,e.height,r,t.element)-At(t.viewport,n),c=xt(e.top,e.height,r,l.element)-At(l.viewport,n);return {tStart:s,tEnd:c}}function Mt(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,r,n){let t=Mt(e),l=Mt(r);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*n)},${Math.round(t[1]+(l[1]-t[1])*n)},${Math.round(t[2]+(l[2]-t[2])*n)})`}var Lt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ue=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function we(e,...r){Ue&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var Xt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Qt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ct=33;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Kt(e){let r=[];for(let n=0;n<Ct;n++){let t=n/(Ct-1);r.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${r.join(",")})`}function rt(e){switch(e){case "linear":return "linear";case "ease-in":return Xt;case "ease-out":return Qt;case "ease-in-out":return Zt()?Kt(ne["ease-in-out"]):null;default:return null}}var $t=Symbol.for("svg-scroll-draw.registry");function Pt(){let e=globalThis;return e[$t]||(e[$t]=new Map)}function Le(e,r){Pt().set(e,r);}function Ce(e){Pt().delete(e);}var Jt=0;function en(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ot(e,r){let n="";try{n=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return n||(e.getAttribute(r)??"").trim()}var kt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function tn(e){if(!Ue)return;let r=Ot(e,"stroke");if(!r||r==="none"){we("Element has no stroke \u2014 path will not be visible.",e);return}let n=(e.getAttribute("fill")??"").trim();n&&!kt.has(n)&&!kt.has(Ot(e,"fill"))&&we("Element has a fill \u2014 it may obscure the stroke animation.",e);}function nn(e,r,n){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=n==="x"?window.scrollX:window.scrollY,c=e-s,u=r-s,m=n==="x";t.innerHTML=`
|
|
2
2
|
<div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Ft=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,It=/[MmLlHhVvCcSsQqTtAaZz]/g;function rn(e,r,n){if(!Ue)return;let t=(e.match(It)??[]).join("").toUpperCase(),l=(r.match(It)??[]).join("").toUpperCase(),s=(e.match(Ft)??[]).length,c=(r.match(Ft)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function ct(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*n).toFixed(4))})}function ut(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,l=n?{...Lt[n],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:C="forward",once:re=false,debug:$e=false,axis:W="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:A,strokeWidth:$,fillOpacity:M,waypoints:w,velocityScale:k=false,threshold:F=0,rootMargin:P="0px",repeat:S=0,repeatDelay:oe=0,morphTo:I,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:L,onLeave:E,onEnterBack:D,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:ne[p]??ne.linear,Pe=de(T.start??"top bottom"),_e=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(A)?A[0]:null,le=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ce=Array.isArray($)?$[0]:null,j=Array.isArray($)?$[1]:typeof $=="number"?$:null,pe=Array.isArray(M)?M[0]:null,Z=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Oe(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),O=[],i=[],f=0,ge=0,N=false,_=false,q=0,Ae=false,ye=-1,te=-1,U=false,he=0,De=0,He,ot=null;function yt(){ot?.destroy(),ot=null;}let Ve=new Set,ht=NaN,ze=true,Qe=-1,bt=performance.now(),qe=NaN;function st(){return ve?W==="x"?ve.scrollLeft:ve.scrollTop:W==="x"?window.scrollX:window.scrollY}function wt(){return ve?W==="x"?ve.clientWidth:ve.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function vt(){let o=nt(e,ve,W);return xe(o,o.scroll,wt(),Pe,_e)}function St(){(({tStart:f,tEnd:ge}=vt())),$e&&Ue&&(yt(),ot=nn(f,ge,W));}function it(o,a=vt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),Ce(e);},o}function qt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Oe(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${O[ue]*o}`:`${O[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=We(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),I&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],I,o));});}function Ze(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Oe(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${O[a]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${O[a]}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),I&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{tn(o);let a=Be(o);O.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),I&&(b?rn(i[i.length-1],I,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),I&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",I)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?"0":`${a}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Oe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Et=typeof p=="string"?rt(p):null;function Bt(){return !(ae===false||!en()||!z.length||!Et||Q||W!=="y"||ve||u!==1||V!==0||re||X||k!==false||I||w||S||G>0||d||x||g||L||E||D||fe||A!=null||$!=null||M!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Wt(){let o=++Jt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Ne=C==="reverse"?"0":"var(--ssd-len)",ke=C==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${Ne};`,v=`stroke-dashoffset:${ke};`;m&&(Me+=`opacity:${C==="reverse"?1:0};`,v+=`opacity:${C==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Et};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(b);function me(y,Y){y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:Y,tEnd:Te}=xe({top:y.top,height:y.height},st(),wt(),Pe,_e);return Ee(K(st(),Y,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),R.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let Y=Math.min(1,Math.max(0,y));H=Y,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=C==="reverse"?`${O[be]*Y}`:`${O[be]*(1-Y)}`,m&&(Te.style.opacity=C==="reverse"?`${1-Y}`:`${Y}`);});},getProgress(){return B()},refresh(){z.forEach((y,Y)=>{O[Y]=Be(y),y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`;});}}}if(Bt())return it(Wt());function Gt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function Ne(h){let H=true;if(Q){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Oe(C==="reverse"?1-y:y),d?.(y),B<1&&(H=false);}else z.forEach((B,y)=>{let Y=y*V*o,Te=Math.min(1,Math.max(0,(h-Y)/o)),be=Ee(Te);B.style.strokeDashoffset=C==="reverse"?`${O[y]*be}`:`${O[y]*(1-be)}`,m&&(B.style.opacity=C==="reverse"?`${1-be}`:`${be}`),Se&&le?B.style.stroke=We(Se,le,be):le&&(B.style.stroke=le),ce!==null&&j!==null?B.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(B.style.strokeWidth=`${j}`),pe!==null&&Z!==null?B.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(B.style.fillOpacity=`${Z}`),I&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ct(i[y],I,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);for(let Y in w){let Te=parseFloat(Y);y>=Te&&!Ve.has(Te)&&(Ve.add(Te),w[Y]?.());}}return H}function ke(h){if(U)return;let H=h-a;_||(_=true,x?.());let B=Ne(H);if(B&&!N){N=true,Ne(o*(1+Math.max(0,z.length-1)*V)),g?.(),De<(S==="infinite"?1/0:S??0)&&(De++,He=setTimeout(()=>{a=performance.now(),_=false,N=false,Ve.clear(),Ze(),q=requestAnimationFrame(ke);},oe));return}B||(q=requestAnimationFrame(ke));}function Me(){cancelAnimationFrame(q),clearTimeout(He),a=performance.now(),b=0,U=false,_=false,N=false,De=0,ue=true,he=0,Ve.clear(),Ze(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(re&&N)?Me():!H.isIntersecting&&!re&&!N&&(cancelAnimationFrame(q),clearTimeout(He),ue=false);});},{root:ve??null,threshold:F,rootMargin:P}),R;function me(){clearTimeout(R),R=setTimeout(()=>{z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(He),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(R);},replay(){De=0,Me();},pause(){U||!ue||(U=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){U&&(U=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));he=H,U=true,b=H*o,a=performance.now()-b,cancelAnimationFrame(q),Ne(b);},getProgress(){return he},refresh(){clearTimeout(R),z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});}}}if(ie)return it(Gt());St();function Ke(){if(!Ae||U)return;let o=performance.now(),a=st();if(!ze&&k===false&&a===ht){q=requestAnimationFrame(Ke);return}ze=false,ht=a;let b=u;if(k!==false){let v=o-bt,R=v>0?Math.abs(a-(Qe<0?a:Qe))/v:0;b=u*Math.max(.2,1+R*(typeof k=="number"?k:1)*.04);}Qe=a,bt=o;let ue=X?te===-1||a>=te?"forward":"reverse":C;te=a;let Ne=ge-f,ke=true,Me=Ne===0?0:(a-f)/Ne;if(isNaN(qe)||(qe<=0&&Me>0?L?.():qe>0&&Me<=0&&fe?.(),qe<1&&Me>=1?E?.():qe>=1&&Me<1&&D?.()),qe=Me,Q){let v=Ee(K(a,f,ge,b));re&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let R=ue==="reverse"?1-v:v;e.style.clipPath=Oe(R),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!N?(N=true,g?.(),De<(S==="infinite"?1/0:S??0)&&(De++,He=setTimeout(()=>{ye=-1,_=false,N=false,e.style.clipPath=Oe(0);},oe))):v<1&&!re&&(N=false),q=requestAnimationFrame(Ke);return}if(z.forEach((v,R)=>{let me=R*V*Ne,h=Ee(K(a,f+me,ge+me,b));re&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${O[R]*h}`:`${O[R]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=We(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),I&&v.tagName.toLowerCase()==="path"&&i[R]&&v.setAttribute("d",ct(i[R],I,h)),R===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=Ee(K(a,f,ge,b));for(let R in w){let me=parseFloat(R);v>=me&&!Ve.has(me)&&(Ve.add(me),w[R]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),ke&&!N?(N=true,g?.(),De<(S==="infinite"?1/0:S??0)&&(De++,He=setTimeout(()=>{ye=-1,_=false,N=false,Ve.clear(),Ze(),ze=true;},oe))):!ke&&!re&&(N=false),q=requestAnimationFrame(Ke);}let at=false;function Je(){at||(at=true,q=requestAnimationFrame(function(){Ke();}));}function et(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!U?(ze=true,Je()):et();});},{root:ve??null,threshold:F,rootMargin:P});function Tt(){z.forEach((o,a)=>{O[a]=Be(o),o.style.strokeDasharray=`${O[a]}`;}),St(),ze=true;}let tt;function Ge(){clearTimeout(tt),tt=setTimeout(Tt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(He),et(),lt.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(tt),yt();},replay(){ye=-1,te=-1,Qe=-1,_=false,N=false,De=0,U=false,he=0,Ve.clear(),clearTimeout(He),Ze(),ze=true,Ae&&Je();},pause(){U=true,et();},resume(){U&&(U=false,ze=true,Ae&&Je());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,U=true,et(),qt(a,C),ze=true;},getProgress(){return he},refresh(){clearTimeout(tt),Tt(),Ae&&!U&&Je();}},()=>({tStart:f,tEnd:ge}))}function on(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Rt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}r.push({fn:t[1],nums:l,units:s});}return r}function sn(e,r,n){let t=Rt(e),l=Rt(r);return t.length===0||t.length!==l.length?n<1?e:r:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?n<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*n}${s.units[p]}`).join(", ")})`}).join(" ")}function Dt(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),l=String(r);if(on(t))return We(t,l,n);if(t.includes("("))return sn(t,l,n);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*n}${s[2]||c[2]}`}return n<1?t:l}function an(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var ln=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),cn=0,Nt="--scroll-draw-progress";function un(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function mt(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:C=true,triggerElement:re,onProgress:$e,onComplete:W,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:A}=r,$=C&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:ne[s]??ne["ease-out"],w=de(l.start??"top bottom"),k=de(l.end??"bottom top"),F=re??e,P=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:an(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function I(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Nt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if($)return I(),W?.(),{...n,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?rt(s):null;function ae(){if(!T||!un()||!ee||m!=="y"||P||F!==e||u||c!==1||$e||W||J||X||G||A||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!ln.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++cn}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,k)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",ie(),Ce(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let U=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,Dt(he.from,he.to,U));},getProgress(){let{tStart:te,tEnd:U}=Ae();return M(K(_(),te,U,c))}};return ye}if(ae())return d();let x=0,g=0,L=0,E=false,D=false,fe=-1,Q=0,Ee=false,Pe=NaN,_e=-1,ve=0,Se=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=nt(F,P,m),f=xe(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Nt,String(i));for(let f of S)e.style.setProperty(f.prop,Dt(f.from,f.to,i));$e?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!E||D)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}_e=f,ve=i;let N=g===x?0:(f-x)/(g-x);pe(N);let _=M(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,W?.()):_<1&&!u&&(Ee=false),L=requestAnimationFrame(Z);}ce(),g===x&&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 i=M(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Oe=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!D?L=requestAnimationFrame(Z):cancelAnimationFrame(L);});},{root:P??null}),z;function O(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Oe.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(L),Oe.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(z),ie(),Ce(e);},replay(){fe=-1,Ee=false,Q=0,D=false,j(0);},pause(){D=true,cancelAnimationFrame(L);},resume(){D&&(D=false,E&&(L=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,D=true,cancelAnimationFrame(L),j(f);},getProgress(){return Q}}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,r){if(typeof window>"u")return ft;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return we("scrollCounter: element not found:",e),ft;let t=n,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=r,C=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),re=typeof u=="function"?u:ne[u]??ne["ease-out"],$e=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=C(s),V?.(),ft;let X=0,G=0,A=0,$=false,M=false,w=-1,k=0,F=false,P=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),S(),$e,W);X=x.tStart,G=x.tEnd;}function I(d){t.textContent=C(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!$||M)return;let d=re(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,I(d),d>=1&&!F?(F=true,V?.()):d<1&&!p&&(F=false),A=requestAnimationFrame(se);}oe();{let d=re(K(P(),X,G,1));p&&d>0&&(w=d),k=d,I(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{$=x.isIntersecting,$&&!M?A=requestAnimationFrame(se):cancelAnimationFrame(A);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(A),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),Ce(t);},replay(){w=-1,F=false,k=0,M=false,I(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,$&&(A=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,M=true,cancelAnimationFrame(A),I(x);},getProgress(){return k}}}var Ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,r={}){if(typeof window>"u")return Ht;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Ht;let t=n,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=r,C=window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof s=="function"?s:ne[s]??ne.linear,$e=de(l.start??"top top"),W=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=r.from??0,X=r.to,G=0,A=0,$=0,M=false,w=false,k=-1,F=0,P=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,I=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),D=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:D,height:fe},oe(),I(),$e,W);G=Q.tStart,A=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let D=X??t.duration??0,fe=J+(D-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!M||w||!S)return;let E=re(K(oe(),G,A,1));c&&(k=Math.max(k,E),E=k),F=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),$=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),C){ee(1),p?.();return}se(),p?.(),M&&!w&&($=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(D=>{M=D.isIntersecting,M&&!w&&S?$=requestAnimationFrame(ae):cancelAnimationFrame($);});}),g;function L(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",L),window.addEventListener("orientationchange",L),x.observe(t),Le(t,{type:"video",getProgress:()=>F,getTrigger:()=>({tStart:G,tEnd:A})}),{destroy(){cancelAnimationFrame($),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),clearTimeout(g),Ce(t);},replay(){k=-1,P=false,F=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,M&&S&&($=requestAnimationFrame(ae)));},seek(E){let D=Math.min(1,Math.max(0,E));F=D,k=D,w=true,cancelAnimationFrame($),ie=NaN,ee(D);},getProgress(){return F}}}function _t(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function mn(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function Vt(e){let r=_t(e),n=new Map;for(let s of r){let c=s.offsetTop;n.has(c)||n.set(c,[]),n.get(c).push(s);}let t=[],l=Array.from(n.keys()).sort((s,c)=>s-c);for(let s of l){let c=n.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function fn(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,s=r*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function pn(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,r={}){if(typeof window>"u")return zt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return we("scrollText: element not found:",e),zt;let t=n,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=r,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof c=="function"?c:ne[c]??ne["ease-out"],re=de(m.start??"top 85%"),$e=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=mn(t):l==="lines"?J=Vt(t):J=_t(t);let X=J.length;function G(g,L){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*L));let E=pn(L,u);E&&(g.style.transform=E);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((L,E)=>{let D=C(fn(g,E,X,s));G(L,D);});}if(V)return A(1),T?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let $=0,M=0,w=0,k=false,F=false,P=-1,S=0,oe=false,I=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),L=xe({top:g.top,height:g.height},I(),se(),re,$e);$=L.tStart,M=L.tEnd;}function ee(){if(!k||F)return;let g=K(I(),$,M,1);p&&(P=Math.max(P,g),g=P),S=g,A(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(L=>{k=L.isIntersecting,k&&!F?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),J=Vt(t),A(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:$,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=W,t.removeAttribute("aria-label"),Ce(t);},replay(){P=-1,oe=false,S=0,F=false,A(0);},pause(){F=true,cancelAnimationFrame(w);},resume(){F&&(F=false,k&&(w=requestAnimationFrame(ee)));},seek(g){let L=Math.min(1,Math.max(0,g));S=L,P=L,F=true,cancelAnimationFrame(w),A(L);},getProgress(){return S}}}function Xn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=ut(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var Qn=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=ut(n.value,t);vue.onUnmounted(()=>l.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function Zn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=mt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var Kn=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=mt(n.value,e.options);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function Jn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=pt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var er=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n={to:e.to};e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete);let t=pt(r.value,n);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("span",{ref:r})}});function tr(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=dt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var nr=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=dt(r.value,e.options??{});vue.onUnmounted(()=>n.destroy());}),()=>vue.h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function rr(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=gt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var or=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=gt(n.value,e.options??{});vue.onUnmounted(()=>t.destroy());}),()=>vue.h(e.tag,{ref:n},r.default?.())}});exports.ScrollAnimate=Kn;exports.ScrollCounter=er;exports.ScrollDraw=Qn;exports.ScrollText=or;exports.ScrollVideo=nr;exports.useScrollAnimate=Zn;exports.useScrollCounter=Jn;exports.useScrollDraw=Xn;exports.useScrollText=rr;exports.useScrollVideo=tr;
|
|
3
|
+
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var Ft=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,It=/[MmLlHhVvCcSsQqTtAaZz]/g;function rn(e,r,n){if(!Ue)return;let t=(e.match(It)??[]).join("").toUpperCase(),l=(r.match(It)??[]).join("").toUpperCase(),s=(e.match(Ft)??[]).length,c=(r.match(Ft)??[]).length;if(t!==l){we(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}s!==c&&we(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function ct(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*n).toFixed(4))})}function ut(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,l=n?{...Lt[n],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:p="linear",trigger:T={},stagger:V=0,direction:A="forward",once:re=false,debug:$e=false,axis:W="y",scrollContainer:J,autoReverse:X=false,delay:G=0,strokeColor:M,strokeWidth:$,fillOpacity:L,waypoints:w,velocityScale:k=false,threshold:F=0,rootMargin:P="0px",repeat:S=0,repeatDelay:oe=0,morphTo:I,clip:se,autoplay:ie=false,duration:ee=1e3,native:ae=true,onProgress:d,onStart:x,onComplete:g,onEnter:C,onLeave:E,onEnterBack:D,onLeaveBack:fe}=l,Q=se===true?"left":typeof se=="string"?se:false,Ee=typeof p=="function"?p:ne[p]??ne.linear,Pe=de(T.start??"top bottom"),_e=de(T.end??"bottom top"),ve=typeof J=="string"?document.querySelector(J):J??null,Se=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray($)?$[0]:null,j=Array.isArray($)?$[1]:typeof $=="number"?$:null,pe=Array.isArray(L)?L[0]:null,Z=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Oe(o){let a=o*100;switch(Q){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let z=Q?[]:Array.from(e.querySelectorAll(c)),O=[],i=[],f=0,ge=0,N=false,_=false,q=0,Ae=false,ye=-1,te=-1,U=false,he=0,De=0,He,ot=null;function yt(){ot?.destroy(),ot=null;}let Ve=new Set,ht=NaN,ze=true,Qe=-1,bt=performance.now(),qe=NaN;function st(){return ve?W==="x"?ve.scrollLeft:ve.scrollTop:W==="x"?window.scrollX:window.scrollY}function wt(){return ve?W==="x"?ve.clientWidth:ve.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function vt(){let o=nt(e,ve,W);return xe(o,o.scroll,wt(),Pe,_e)}function St(){(({tStart:f,tEnd:ge}=vt())),$e&&Ue&&(yt(),ot=nn(f,ge,W));}function it(o,a=vt){Le(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let b=o.destroy;return o.destroy=()=>{b.call(o),Ce(e);},o}function qt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),Q){let b=a==="reverse"?1-o:o;e.style.clipPath=Oe(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=a==="reverse"?`${O[ue]*o}`:`${O[ue]*(1-o)}`,m&&(b.style.opacity=a==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=We(Se,le,o):le&&(b.style.stroke=le),ce!==null&&j!==null?b.style.strokeWidth=`${ce+(j-ce)*o}`:j!==null&&(b.style.strokeWidth=`${j}`),pe!==null&&Z!==null?b.style.fillOpacity=`${pe+(Z-pe)*o}`:Z!==null&&(b.style.fillOpacity=`${Z}`),I&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ct(i[ue],I,o));});}function Ze(){if(e.style.setProperty("--scroll-draw-progress","0"),Q){e.style.clipPath=Oe(0);return}z.forEach((o,a)=>{o.style.strokeDasharray=`${O[a]}`,o.style.strokeDashoffset=A==="reverse"?"0":`${O[a]}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),I&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(z.forEach(o=>{tn(o);let a=Be(o);O.push(a);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),I&&(b?rn(i[i.length-1],I,o):we(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=A==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),j!==null&&(o.style.strokeWidth=`${j}`),Z!==null&&(o.style.fillOpacity=`${Z}`),I&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",I)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=A==="reverse"?"0":`${a}`,m?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),Q){if(s)return e.style.clipPath=Oe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Et=typeof p=="string"?rt(p):null;function Bt(){return !(ae===false||!en()||!z.length||!Et||Q||W!=="y"||ve||u!==1||V!==0||re||X||k!==false||I||w||S||G>0||d||x||g||C||E||D||fe||M!=null||$!=null||L!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function Wt(){let o=++Jt,a=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,Ne=A==="reverse"?"0":"var(--ssd-len)",ke=A==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${Ne};`,v=`stroke-dashoffset:${ke};`;m&&(Me+=`opacity:${A==="reverse"?1:0};`,v+=`opacity:${A==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${a}{from{${Me}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Et};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(b);function me(y,Y){y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}z.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:Y,tEnd:Te}=xe({top:y.top,height:y.height},st(),wt(),Pe,_e);return Ee(K(st(),Y,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),R.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let Y=Math.min(1,Math.max(0,y));H=Y,h=true,z.forEach((Te,be)=>{Te.classList.remove(a),Te.style.strokeDashoffset=A==="reverse"?`${O[be]*Y}`:`${O[be]*(1-Y)}`,m&&(Te.style.opacity=A==="reverse"?`${1-Y}`:`${Y}`);});},getProgress(){return B()},refresh(){z.forEach((y,Y)=>{O[Y]=Be(y),y.style.setProperty("--ssd-len",String(O[Y])),y.style.strokeDasharray=`${O[Y]}`;});}}}if(Bt())return it(Wt());function Gt(){let o=Math.max(1,ee),a=0,b=0,ue=false;function Ne(h){let H=true;if(Q){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);he=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Oe(A==="reverse"?1-y:y),d?.(y),B<1&&(H=false);}else z.forEach((B,y)=>{let Y=y*V*o,Te=Math.min(1,Math.max(0,(h-Y)/o)),be=Ee(Te);B.style.strokeDashoffset=A==="reverse"?`${O[y]*be}`:`${O[y]*(1-be)}`,m&&(B.style.opacity=A==="reverse"?`${1-be}`:`${be}`),Se&&le?B.style.stroke=We(Se,le,be):le&&(B.style.stroke=le),ce!==null&&j!==null?B.style.strokeWidth=`${ce+(j-ce)*be}`:j!==null&&(B.style.strokeWidth=`${j}`),pe!==null&&Z!==null?B.style.fillOpacity=`${pe+(Z-pe)*be}`:Z!==null&&(B.style.fillOpacity=`${Z}`),I&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ct(i[y],I,be)),y===0&&(he=be,d?.(be),e.style.setProperty("--scroll-draw-progress",String(be))),Te<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=Ee(B);for(let Y in w){let Te=parseFloat(Y);y>=Te&&!Ve.has(Te)&&(Ve.add(Te),w[Y]?.());}}return H}function ke(h){if(U)return;let H=h-a;_||(_=true,x?.());let B=Ne(H);if(B&&!N){N=true,Ne(o*(1+Math.max(0,z.length-1)*V)),g?.(),De<(S==="infinite"?1/0:S??0)&&(De++,He=setTimeout(()=>{a=performance.now(),_=false,N=false,Ve.clear(),Ze(),q=requestAnimationFrame(ke);},oe));return}B||(q=requestAnimationFrame(ke));}function Me(){cancelAnimationFrame(q),clearTimeout(He),a=performance.now(),b=0,U=false,_=false,N=false,De=0,ue=true,he=0,Ve.clear(),Ze(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(re&&N)?Me():!H.isIntersecting&&!re&&!N&&(cancelAnimationFrame(q),clearTimeout(He),ue=false);});},{root:ve??null,threshold:F,rootMargin:P}),R;function me(){clearTimeout(R),R=setTimeout(()=>{z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),G>0?setTimeout(()=>v.observe(e),G):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(He),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(R);},replay(){De=0,Me();},pause(){U||!ue||(U=true,b=performance.now()-a,cancelAnimationFrame(q));},resume(){U&&(U=false,ue=true,a=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));he=H,U=true,b=H*o,a=performance.now()-b,cancelAnimationFrame(q),Ne(b);},getProgress(){return he},refresh(){clearTimeout(R),z.forEach((h,H)=>{O[H]=Be(h),h.style.strokeDasharray=`${O[H]}`;});}}}if(ie)return it(Gt());St();function Ke(){if(!Ae||U)return;let o=performance.now(),a=st();if(!ze&&k===false&&a===ht){q=requestAnimationFrame(Ke);return}ze=false,ht=a;let b=u;if(k!==false){let v=o-bt,R=v>0?Math.abs(a-(Qe<0?a:Qe))/v:0;b=u*Math.max(.2,1+R*(typeof k=="number"?k:1)*.04);}Qe=a,bt=o;let ue=X?te===-1||a>=te?"forward":"reverse":A;te=a;let Ne=ge-f,ke=true,Me=Ne===0?0:(a-f)/Ne;if(isNaN(qe)||(qe<=0&&Me>0?C?.():qe>0&&Me<=0&&fe?.(),qe<1&&Me>=1?E?.():qe>=1&&Me<1&&D?.()),qe=Me,Q){let v=Ee(K(a,f,ge,b));re&&!X&&(ye=Math.max(ye,v),v=ye),he=v,e.style.setProperty("--scroll-draw-progress",String(v));let R=ue==="reverse"?1-v:v;e.style.clipPath=Oe(R),d?.(v),!_&&K(a,f,ge,b)>0&&(_=true,x?.()),v>=1&&!N?(N=true,g?.(),De<(S==="infinite"?1/0:S??0)&&(De++,He=setTimeout(()=>{ye=-1,_=false,N=false,e.style.clipPath=Oe(0);},oe))):v<1&&!re&&(N=false),q=requestAnimationFrame(Ke);return}if(z.forEach((v,R)=>{let me=R*V*Ne,h=Ee(K(a,f+me,ge+me,b));re&&!X&&(ye=Math.max(ye,h),h=ye),he=h,v.style.strokeDashoffset=ue==="reverse"?`${O[R]*h}`:`${O[R]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=We(Se,le,h):le&&(v.style.stroke=le),ce!==null&&j!==null?v.style.strokeWidth=`${ce+(j-ce)*h}`:j!==null&&(v.style.strokeWidth=`${j}`),pe!==null&&Z!==null?v.style.fillOpacity=`${pe+(Z-pe)*h}`:Z!==null&&(v.style.fillOpacity=`${Z}`),I&&v.tagName.toLowerCase()==="path"&&i[R]&&v.setAttribute("d",ct(i[R],I,h)),R===0&&(d?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=Ee(K(a,f,ge,b));for(let R in w){let me=parseFloat(R);v>=me&&!Ve.has(me)&&(Ve.add(me),w[R]?.());}}!_&&K(a,f,ge,b)>0&&(_=true,x?.()),ke&&!N?(N=true,g?.(),De<(S==="infinite"?1/0:S??0)&&(De++,He=setTimeout(()=>{ye=-1,_=false,N=false,Ve.clear(),Ze(),ze=true;},oe))):!ke&&!re&&(N=false),q=requestAnimationFrame(Ke);}let at=false;function Je(){at||(at=true,q=requestAnimationFrame(function(){Ke();}));}function et(){at=false,cancelAnimationFrame(q);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!U?(ze=true,Je()):et();});},{root:ve??null,threshold:F,rootMargin:P});function Tt(){z.forEach((o,a)=>{O[a]=Be(o),o.style.strokeDasharray=`${O[a]}`;}),St(),ze=true;}let tt;function Ge(){clearTimeout(tt),tt=setTimeout(Tt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),G>0?setTimeout(()=>lt.observe(e),G):lt.observe(e),it({destroy(){cancelAnimationFrame(q),clearTimeout(He),et(),lt.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(tt),yt();},replay(){ye=-1,te=-1,Qe=-1,_=false,N=false,De=0,U=false,he=0,Ve.clear(),clearTimeout(He),Ze(),ze=true,Ae&&Je();},pause(){U=true,et();},resume(){U&&(U=false,ze=true,Ae&&Je());},seek(o){let a=Math.min(1,Math.max(0,o));he=a,ye=a,U=true,et(),qt(a,A),ze=true;},getProgress(){return he},refresh(){clearTimeout(tt),Tt(),Ae&&!U&&Je();}},()=>({tStart:f,tEnd:ge}))}function on(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Rt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}r.push({fn:t[1],nums:l,units:s});}return r}function sn(e,r,n){let t=Rt(e),l=Rt(r);return t.length===0||t.length!==l.length?n<1?e:r:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?n<1?`${s.fn}(${s.nums.map((m,p)=>`${m}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,p)=>`${m}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,p)=>`${m+(u.nums[p]-m)*n}${s.units[p]}`).join(", ")})`}).join(" ")}function Dt(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),l=String(r);if(on(t))return We(t,l,n);if(t.includes("("))return sn(t,l,n);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*n}${s[2]||c[2]}`}return n<1?t:l}function an(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var ln=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),cn=0,Nt="--scroll-draw-progress";function un(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function mt(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:p,native:T=true,velocityScale:V=false,respectReducedMotion:A=true,triggerElement:re,onProgress:$e,onComplete:W,onEnter:J,onLeave:X,onEnterBack:G,onLeaveBack:M}=r,$=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof s=="function"?s:ne[s]??ne["ease-out"],w=de(l.start??"top bottom"),k=de(l.end??"bottom top"),F=re??e,P=typeof p=="string"?document.querySelector(p):p??null,S=Object.entries(t).map(([i,f])=>({prop:an(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function oe(){let i=window.getComputedStyle(e);for(let f of S)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function I(){for(let i of S)e.style.setProperty(i.prop,String(i.to));}let se=new Map;for(let i of [...S.map(f=>f.prop),Nt])se.set(i,e.style.getPropertyValue(i));function ie(){for(let[i,f]of se)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if($)return I(),W?.(),{...n,destroy:ie,getProgress:()=>1};oe();let ee=typeof s=="string"?rt(s):null;function ae(){if(!T||!un()||!ee||m!=="y"||P||F!==e||u||c!==1||$e||W||J||X||G||M||V!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of S)if(!ln.has(i.prop))return false;return true}function d(){let i=`ssd-a-${++cn}`,f=S.map(te=>`${te.prop}:${te.from}`).join(";"),ge=S.map(te=>`${te.prop}:${te.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ge}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ee};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let te=e.getBoundingClientRect();return xe({top:te.top,height:te.height},_(),q(),w,k)};Le(e,{type:"animate",getProgress:()=>ye.getProgress(),getTrigger:Ae});let ye={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",ie(),Ce(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(te){let U=Math.min(1,Math.max(0,te));e.classList.remove(i);for(let he of S)e.style.setProperty(he.prop,Dt(he.from,he.to,U));},getProgress(){let{tStart:te,tEnd:U}=Ae();return L(K(_(),te,U,c))}};return ye}if(ae())return d();let x=0,g=0,C=0,E=false,D=false,fe=-1,Q=0,Ee=false,Pe=NaN,_e=-1,ve=0,Se=()=>P?m==="x"?P.scrollLeft:P.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>P?m==="x"?P.clientWidth:P.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=nt(F,P,m),f=xe(i,i.scroll,le(),w,k);x=f.tStart,g=f.tEnd;}function j(i){e.style.setProperty(Nt,String(i));for(let f of S)e.style.setProperty(f.prop,Dt(f.from,f.to,i));$e?.(i);}function pe(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?J?.():Pe>0&&i<=0&&M?.(),Pe<1&&i>=1?X?.():Pe>=1&&i<1&&G?.(),Pe=i;}function Z(){if(!E||D)return;let i=performance.now(),f=Se(),ge=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ge=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}_e=f,ve=i;let N=g===x?0:(f-x)/(g-x);pe(N);let _=L(K(f,x,g,ge));u&&(fe=Math.max(fe,_),_=fe),Q=_,j(_),_>=1&&!Ee?(Ee=true,W?.()):_<1&&!u&&(Ee=false),C=requestAnimationFrame(Z);}ce(),g===x&&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 i=L(K(Se(),x,g,c));u&&i>0&&(fe=i),Q=i,j(i);}let Oe=new IntersectionObserver(i=>{i.forEach(f=>{E=f.isIntersecting,E&&!D?C=requestAnimationFrame(Z):cancelAnimationFrame(C);});},{root:P??null}),z;function O(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),Oe.observe(e),Le(e,{type:"animate",getProgress:()=>Q,getTrigger:()=>({tStart:x,tEnd:g})}),{destroy(){cancelAnimationFrame(C),Oe.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(z),ie(),Ce(e);},replay(){fe=-1,Ee=false,Q=0,D=false,j(0);},pause(){D=true,cancelAnimationFrame(C);},resume(){D&&(D=false,E&&(C=requestAnimationFrame(Z)));},seek(i){let f=Math.min(1,Math.max(0,i));Q=f,fe=f,D=true,cancelAnimationFrame(C),j(f);},getProgress(){return Q}}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,r){if(typeof window>"u")return ft;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return we("scrollCounter: element not found:",e),ft;let t=n,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:p=true,decimals:T,onComplete:V}=r,A=T!==void 0?d=>d.toFixed(T):c??(d=>String(Math.round(d))),re=typeof u=="function"?u:ne[u]??ne["ease-out"],$e=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=A(s),V?.(),ft;let X=0,G=0,M=0,$=false,L=false,w=-1,k=0,F=false,P=()=>window.scrollY,S=()=>window.innerHeight;function oe(){let d=t.getBoundingClientRect(),x=xe({top:d.top,height:d.height},P(),S(),$e,W);X=x.tStart,G=x.tEnd;}function I(d){t.textContent=A(l+(s-l)*d),t.style.setProperty("--scroll-draw-progress",String(d));}function se(){if(!$||L)return;let d=re(K(P(),X,G,1));p&&(w=Math.max(w,d),d=w),k=d,I(d),d>=1&&!F?(F=true,V?.()):d<1&&!p&&(F=false),M=requestAnimationFrame(se);}oe();{let d=re(K(P(),X,G,1));p&&d>0&&(w=d),k=d,I(d);}let ie=new IntersectionObserver(d=>{d.forEach(x=>{$=x.isIntersecting,$&&!L?M=requestAnimationFrame(se):cancelAnimationFrame(M);});}),ee;function ae(){clearTimeout(ee),ee=setTimeout(oe,150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),ie.observe(t),Le(t,{type:"counter",getProgress:()=>k,getTrigger:()=>({tStart:X,tEnd:G})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ee),Ce(t);},replay(){w=-1,F=false,k=0,L=false,I(0);},pause(){L=true,cancelAnimationFrame(M);},resume(){L&&(L=false,$&&(M=requestAnimationFrame(se)));},seek(d){let x=Math.min(1,Math.max(0,d));k=x,w=x,L=true,cancelAnimationFrame(M),I(x);},getProgress(){return k}}}var Ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,r={}){if(typeof window>"u")return Ht;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return we("scrollVideo: <video> element not found:",e),Ht;let t=n,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:p,onComplete:T,onProgress:V}=r,A=window.matchMedia("(prefers-reduced-motion: reduce)").matches,re=typeof s=="function"?s:ne[s]??ne.linear,$e=de(l.start??"top top"),W=de(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let J=r.from??0,X=r.to,G=0,M=0,$=0,L=false,w=false,k=-1,F=0,P=false,S=false,oe=()=>u==="x"?window.scrollX:window.scrollY,I=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let E=t.getBoundingClientRect(),D=u==="x"?E.left:E.top,fe=u==="x"?E.width:E.height,Q=xe({top:D,height:fe},oe(),I(),$e,W);G=Q.tStart,M=Q.tEnd;}let ie=NaN;function ee(E){if(!S)return;let D=X??t.duration??0,fe=J+(D-J)*E;fe!==ie&&(ie=fe,t.currentTime=fe),t.style.setProperty("--scroll-draw-progress",String(E)),V?.(E);}function ae(){if(!L||w||!S||A)return;let E=re(K(oe(),G,M,1));c&&(k=Math.max(k,E),E=k),F=E,ee(E),E>=1&&!P?(P=true,T?.()):E<1&&!c&&(P=false),$=requestAnimationFrame(ae);}function d(){if(S=true,X===void 0&&(X=t.duration),A){ee(1),p?.();return}se(),p?.(),L&&!w&&($=requestAnimationFrame(ae));}t.readyState>=1?d():t.addEventListener("loadedmetadata",d,{once:true}),S||se();let x=new IntersectionObserver(E=>{E.forEach(D=>{L=D.isIntersecting,L&&!w&&S?$=requestAnimationFrame(ae):cancelAnimationFrame($);});}),g;function C(){clearTimeout(g),g=setTimeout(se,150);}return window.addEventListener("resize",C),window.addEventListener("orientationchange",C),x.observe(t),Le(t,{type:"video",getProgress:()=>F,getTrigger:()=>({tStart:G,tEnd:M})}),{destroy(){cancelAnimationFrame($),x.disconnect(),t.removeEventListener("loadedmetadata",d),window.removeEventListener("resize",C),window.removeEventListener("orientationchange",C),clearTimeout(g),Ce(t);},replay(){k=-1,P=false,F=0,w=false,ie=NaN,ee(0);},pause(){w=true,cancelAnimationFrame($);},resume(){w&&(w=false,L&&S&&($=requestAnimationFrame(ae)));},seek(E){let D=Math.min(1,Math.max(0,E));F=D,k=D,w=true,cancelAnimationFrame($),ie=NaN,ee(D);},getProgress(){return F}}}function _t(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function mn(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function Vt(e){let r=_t(e),n=new Map;for(let s of r){let c=s.offsetTop;n.has(c)||n.set(c,[]),n.get(c).push(s);}let t=[],l=Array.from(n.keys()).sort((s,c)=>s-c);for(let s of l){let c=n.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,p)=>{let T=m.nextElementSibling;u.appendChild(m),p<c.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function fn(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,s=r*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function pn(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,r={}){if(typeof window>"u")return zt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return we("scrollText: element not found:",e),zt;let t=n,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:p=true,onComplete:T}=r,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof c=="function"?c:ne[c]??ne["ease-out"],re=de(m.start??"top 85%"),$e=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let J;l==="chars"?J=mn(t):l==="lines"?J=Vt(t):J=_t(t);let X=J.length;function G(g,C){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*C));let E=pn(C,u);E&&(g.style.transform=E);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),J.forEach((C,E)=>{let D=A(fn(g,E,X,s));G(C,D);});}if(V)return M(1),T?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let $=0,L=0,w=0,k=false,F=false,P=-1,S=0,oe=false,I=()=>window.scrollY,se=()=>window.innerHeight;function ie(){let g=t.getBoundingClientRect(),C=xe({top:g.top,height:g.height},I(),se(),re,$e);$=C.tStart,L=C.tEnd;}function ee(){if(!k||F)return;let g=K(I(),$,L,1);p&&(P=Math.max(P,g),g=P),S=g,M(g),g>=1&&!oe?(oe=true,T?.()):g<1&&!p&&(oe=false),w=requestAnimationFrame(ee);}ie();let ae=new IntersectionObserver(g=>{g.forEach(C=>{k=C.isIntersecting,k&&!F?w=requestAnimationFrame(ee):cancelAnimationFrame(w);});}),d;function x(){clearTimeout(d),d=setTimeout(()=>{if(l==="lines"){let g=S;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),J=Vt(t),M(g);}ie();},150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),ae.observe(t),Le(t,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:$,tEnd:L})}),{destroy(){cancelAnimationFrame(w),ae.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(d),t.innerHTML=W,t.removeAttribute("aria-label"),Ce(t);},replay(){P=-1,oe=false,S=0,F=false,M(0);},pause(){F=true,cancelAnimationFrame(w);},resume(){F&&(F=false,k&&(w=requestAnimationFrame(ee)));},seek(g){let C=Math.min(1,Math.max(0,g));S=C,P=C,F=true,cancelAnimationFrame(w),M(C);},getProgress(){return S}}}function Xn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=ut(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var Qn=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=ut(n.value,t);vue.onUnmounted(()=>l.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function Zn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=mt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var Kn=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=mt(n.value,e.options);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function Jn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=pt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var er=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n={to:e.to};e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete);let t=pt(r.value,n);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("span",{ref:r})}});function tr(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=dt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var nr=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=dt(r.value,e.options??{});vue.onUnmounted(()=>n.destroy());}),()=>vue.h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function rr(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=gt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var or=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=gt(n.value,e.options??{});vue.onUnmounted(()=>t.destroy());}),()=>vue.h(e.tag,{ref:n},r.default?.())}});exports.ScrollAnimate=Kn;exports.ScrollCounter=er;exports.ScrollDraw=Qn;exports.ScrollText=or;exports.ScrollVideo=nr;exports.useScrollAnimate=Zn;exports.useScrollCounter=Jn;exports.useScrollDraw=Xn;exports.useScrollText=rr;exports.useScrollVideo=tr;
|