svg-scroll-draw 2.9.0 → 2.10.1

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