svg-scroll-draw 2.24.0 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +174 -30
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +60 -6
  4. package/dist/angular/index.d.ts +60 -6
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +2 -2
  7. package/dist/astro/index.d.mts +3 -3
  8. package/dist/astro/index.d.ts +3 -3
  9. package/dist/astro/index.mjs +1 -1
  10. package/dist/cdn/svg-scroll-draw.dev.global.js +69 -31
  11. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  12. package/dist/chunk-5SJE7725.mjs +1 -0
  13. package/dist/{chunk-NX74KN5X.mjs → chunk-5U4JXBHR.mjs} +1 -1
  14. package/dist/chunk-7LDSB4FT.mjs +1 -0
  15. package/dist/chunk-ASCOHQQD.mjs +2 -0
  16. package/dist/chunk-GBFWTY5L.mjs +1 -0
  17. package/dist/chunk-HAGTU5EX.mjs +1 -0
  18. package/dist/chunk-HJTHOZK5.mjs +1 -0
  19. package/dist/chunk-IXR6RML7.mjs +1 -0
  20. package/dist/chunk-KN2YB54Z.mjs +1 -0
  21. package/dist/chunk-NJV6S5LD.mjs +1 -0
  22. package/dist/chunk-UBH4K5YD.mjs +1 -0
  23. package/dist/chunk-UF3MO5XQ.mjs +1 -0
  24. package/dist/chunk-XLXVGQ3P.mjs +3 -0
  25. package/dist/chunk-YOOPMYT6.mjs +1 -0
  26. package/dist/chunk-Z72TVDHY.mjs +1 -0
  27. package/dist/cinematic/index.cjs +2 -2
  28. package/dist/cinematic/index.d.mts +3 -1
  29. package/dist/cinematic/index.d.ts +3 -1
  30. package/dist/cinematic/index.mjs +1 -1
  31. package/dist/{engine-6VsjEwzb.d.ts → engine-Bi2x8-X-.d.mts} +2 -2
  32. package/dist/{engine-BLWKCfxC.d.mts → engine-DAlvk6i0.d.ts} +2 -2
  33. package/dist/frames/index.cjs +1 -1
  34. package/dist/frames/index.d.mts +2 -2
  35. package/dist/frames/index.d.ts +2 -2
  36. package/dist/frames/index.mjs +1 -1
  37. package/dist/group/index.cjs +3 -3
  38. package/dist/group/index.d.mts +3 -3
  39. package/dist/group/index.d.ts +3 -3
  40. package/dist/group/index.mjs +1 -1
  41. package/dist/horizontal/index.cjs +1 -1
  42. package/dist/horizontal/index.d.mts +2 -2
  43. package/dist/horizontal/index.d.ts +2 -2
  44. package/dist/horizontal/index.mjs +1 -1
  45. package/dist/{index-BN8yKeQ3.d.ts → index-BMMZ8aW7.d.mts} +2 -2
  46. package/dist/{index-hSQqLVbg.d.ts → index-CEMsUTEG.d.ts} +3 -3
  47. package/dist/{index-DAiRJgtF.d.mts → index-ClAFxNEp.d.mts} +3 -3
  48. package/dist/{index-DVjblK_4.d.mts → index-MdQ4ti_z.d.ts} +2 -2
  49. package/dist/index.cjs +4 -4
  50. package/dist/index.d.mts +6 -6
  51. package/dist/index.d.ts +6 -6
  52. package/dist/index.mjs +1 -1
  53. package/dist/lenis/index.cjs +1 -1
  54. package/dist/lenis/index.d.mts +15 -16
  55. package/dist/lenis/index.d.ts +15 -16
  56. package/dist/lenis/index.mjs +1 -1
  57. package/dist/nuxt/index.cjs +3 -3
  58. package/dist/nuxt/index.d.mts +8 -5
  59. package/dist/nuxt/index.d.ts +8 -5
  60. package/dist/nuxt/index.mjs +1 -1
  61. package/dist/progress/index.cjs +1 -1
  62. package/dist/progress/index.d.mts +2 -2
  63. package/dist/progress/index.d.ts +2 -2
  64. package/dist/progress/index.mjs +1 -1
  65. package/dist/react/index.cjs +3 -3
  66. package/dist/react/index.d.mts +21 -5
  67. package/dist/react/index.d.ts +21 -5
  68. package/dist/react/index.mjs +1 -1
  69. package/dist/reveal/index.cjs +1 -1
  70. package/dist/reveal/index.d.mts +2 -2
  71. package/dist/reveal/index.d.ts +2 -2
  72. package/dist/reveal/index.mjs +1 -1
  73. package/dist/{scroll-draw-Fzir8hlU.d.mts → scroll-draw-CKZysh22.d.mts} +1 -1
  74. package/dist/{scroll-draw-BsU_Ohmu.d.ts → scroll-draw-DbY8RUJE.d.ts} +1 -1
  75. package/dist/snap/index.cjs +1 -1
  76. package/dist/snap/index.d.mts +2 -2
  77. package/dist/snap/index.d.ts +2 -2
  78. package/dist/snap/index.mjs +1 -1
  79. package/dist/solid/index.cjs +3 -3
  80. package/dist/solid/index.d.mts +40 -4
  81. package/dist/solid/index.d.ts +40 -4
  82. package/dist/solid/index.mjs +1 -1
  83. package/dist/svelte/index.cjs +3 -3
  84. package/dist/svelte/index.d.mts +47 -4
  85. package/dist/svelte/index.d.ts +47 -4
  86. package/dist/svelte/index.mjs +1 -1
  87. package/dist/text/index.cjs +1 -1
  88. package/dist/text/index.d.mts +2 -2
  89. package/dist/text/index.d.ts +2 -2
  90. package/dist/text/index.mjs +1 -1
  91. package/dist/timeline/index.cjs +10 -10
  92. package/dist/timeline/index.d.mts +2 -2
  93. package/dist/timeline/index.d.ts +2 -2
  94. package/dist/timeline/index.mjs +2 -2
  95. package/dist/{types-9bcJdVcg.d.mts → types-iITMwrru.d.mts} +10 -2
  96. package/dist/{types-9bcJdVcg.d.ts → types-iITMwrru.d.ts} +10 -2
  97. package/dist/video/index.cjs +1 -1
  98. package/dist/video/index.d.mts +2 -2
  99. package/dist/video/index.d.ts +2 -2
  100. package/dist/video/index.mjs +1 -1
  101. package/dist/vue/index.cjs +3 -3
  102. package/dist/vue/index.d.mts +37 -4
  103. package/dist/vue/index.d.ts +37 -4
  104. package/dist/vue/index.mjs +1 -1
  105. package/dist/web-component/index.cjs +3 -3
  106. package/dist/web-component/index.mjs +1 -1
  107. package/dist/wrapper-BOHrDnBO.d.mts +8 -0
  108. package/dist/wrapper-Cm7JTIVl.d.ts +8 -0
  109. package/package.json +1 -1
  110. package/dist/chunk-32ZCSGFZ.mjs +0 -1
  111. package/dist/chunk-5SKWSPQT.mjs +0 -1
  112. package/dist/chunk-7USW2XFB.mjs +0 -1
  113. package/dist/chunk-7XOFQCQE.mjs +0 -3
  114. package/dist/chunk-BDXWPUBJ.mjs +0 -2
  115. package/dist/chunk-BRV2B2YW.mjs +0 -1
  116. package/dist/chunk-QZKYGS74.mjs +0 -1
  117. package/dist/chunk-THPTANES.mjs +0 -1
  118. package/dist/chunk-U5TKLHGW.mjs +0 -1
  119. package/dist/chunk-V3Z6G5JE.mjs +0 -1
  120. package/dist/chunk-XSVTHCLO.mjs +0 -1
@@ -1 +1 @@
1
- 'use strict';function ze({tension:e=2.5,friction:t=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,t)}function Xe({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),s=0,a=[];for(let l=0;l<n;l++){let f=Math.pow(o,l);a.push(f),s+=f;}let m=[0],c=0;for(let l=0;l<n;l++)c+=a[l]/s,m.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let f=0;f<n;f++)if(l<=m[f+1]){let d=(l-m[f])/(m[f+1]-m[f]);if(f===0)return d*(2-d);let E=1-Math.pow(r,f);return E+(1-E)*(2*d-1)*(2*d-1)}return 1}}function Ye({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/r)+1}var H={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:ze(),bounce:Xe(),elastic:Ye()};function pe(e,t,n){return Math.min(n,Math.max(t,e))}function ne(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}var be=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function de(e,t,n,r){return e+n+t*be(r,0)}function ge(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:be(e,1))}function V(e,t,n,r){return n===t?0:pe((e-t)/(n-t)*r,0,1)}function re(e,t,n,r,o){let s=de(e.top,e.height,t,r.element)-ge(r.viewport,n),a=de(e.top,e.height,t,o.element)-ge(o.viewport,n);return {tStart:s,tEnd:a}}function he(e,t,n){let r=e.getBoundingClientRect(),o=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left-t.clientLeft+t.scrollLeft:r.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function ye(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[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 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 ve(e,t,n){let r=ye(e),o=ye(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var Ge="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Qe="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ee=33;function je(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function qe(e){let t=[];for(let n=0;n<Ee;n++){let r=n/(Ee-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function we(e){switch(e){case "linear":return "linear";case "ease-in":return Ge;case "ease-out":return Qe;case "ease-in-out":return je()?qe(H["ease-in-out"]):null;default:return null}}var Se=Symbol.for("svg-scroll-draw.registry");function Me(){let e=globalThis;return e[Se]||(e[Se]=new Map)}function oe(e,t){Me().set(e,t);}function se(e){Me().delete(e);}var Ue=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function q(e,...t){Ue&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function xe(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function Le(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=xe(s=>{if(!s)return;r();let a=(n.getProgress?.()??0)>=1;n.destroy(),n=t(a?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(n))o[s]=(...a)=>n[s]?.(...a);return o.destroy=()=>{r(),n.destroy();},o}var W,U=new Set,K=new WeakMap,B=new Map,Re=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ke(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function Te(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();W??(W=new ResizeObserver(o=>{let s=false;for(let{target:a}of o)K.get(a)!==Re(a)&&(s=true),K.set(a,"");s&&U.forEach(a=>a());})),U.add(n);let r=Ke(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{K.has(o)||K.set(o,Re(o)),B.set(o,(B.get(o)??0)+1),W.observe(o);}),()=>{U.delete(n)&&(r.forEach(o=>{let s=(B.get(o)??1)-1;if(s)return void B.set(o,s);B.delete(o),W?.unobserve(o);}),U.size||(W?.disconnect(),W=void 0));}}function Pe(e,t,n,r,o){let s,a=NaN,m,c,l=()=>{s=0,r(),!m&&!s&&(a=n())>0&&a<1&&(s=requestAnimationFrame(l));},f=()=>{!s&&!m&&n()!==a&&(s=requestAnimationFrame(l));},d=b=>{m=b,cancelAnimationFrame(s),s=a=NaN,f();},E=()=>{clearTimeout(c),o(),f();},h=()=>{clearTimeout(c),c=setTimeout(E,150);},w=Te(t,h),R=b=>{e[b]("scroll",f,{passive:true}),window[b]("resize",h),window[b]("orientationchange",h);};return R("addEventListener"),f(),{hold:d,remeasure:E,off(){d(true),R("removeEventListener"),w(),clearTimeout(c);}}}function Ze(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function $e(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],s=[],a=r[2].trim();if(a)for(let m of a.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:r[1],nums:o,units:s});}return t}function Je(e,t,n){let r=$e(e),o=$e(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((s,a)=>{let m=o[a];return s.fn!==m.fn||s.nums.length!==m.nums.length?n<1?`${s.fn}(${s.nums.map((c,l)=>`${c}${s.units[l]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,l)=>`${c}${m.units[l]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,l)=>`${c+(m.nums[l]-c)*n}${s.units[l]}`).join(", ")})`}).join(" ")}function Ae(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Ze(r))return ve(r,o,n);if(r.includes("("))return Je(r,o,n);let s=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let m=parseFloat(s[1]),c=parseFloat(a[1]);return `${m+(c-m)*n}${s[2]||a[2]}`}return n<1?r:o}function et(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var tt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),nt=0,Ce="--scroll-draw-progress";function rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ie={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ne(e,t){return typeof window>"u"?Ie:t.respectReducedMotion===false?_e(e,t,false):Le(t,(n,r)=>_e(e,n,r))}function _e(e,t,n){let{props:r,trigger:o={},easing:s="ease-out",speed:a=1,once:m=false,axis:c="y",scrollContainer:l,native:f=true,velocityScale:d=false,triggerElement:E,onProgress:h,onComplete:w,onEnter:R,onLeave:b,onEnterBack:z,onLeaveBack:X}=t,T=typeof s=="function"?s:H[s]??H["ease-out"],A=ne(o.start||"top bottom"),C=ne(o.end||"bottom top"),Y=E??e,S=typeof l=="string"?document.querySelector(l):l??null,M=Object.entries(r).map(([i,u])=>({prop:et(i),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function Fe(){let i=window.getComputedStyle(e);for(let u of M)u.from===""&&(u.from=i.getPropertyValue(u.prop).trim()||"0");}function De(){for(let i of M)e.style.setProperty(i.prop,String(i.to));}let Z=new Map;for(let i of [...M.map(u=>u.prop),Ce])Z.set(i,e.style.getPropertyValue(i));function J(){for(let[i,u]of Z)u?e.style.setProperty(i,u):e.style.removeProperty(i);}if(n)return De(),w?.(),{...Ie,destroy:J,getProgress:()=>1};Fe();let O=()=>S?c==="x"?S.scrollLeft:S.scrollTop:c==="x"?window.scrollX:window.scrollY,ae=()=>S?c==="x"?S.clientWidth:S.clientHeight:c==="x"?window.innerWidth:window.innerHeight,ue=typeof s=="string"?we(s):null;function He(){if(!f||!rt()||!ue||c!=="y"||S||Y!==e||m||a!==1||h||w||R||b||z||X||d!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let i of M)if(!tt.has(i.prop))return false;return true}function Ve(){let i=`ssd-a-${++nt}`,u=M.map(p=>`${p.prop}:${p.from}`).join(";"),N=M.map(p=>`${p.prop}:${p.to}`).join(";"),L=document.createElement("style");L.setAttribute("data-ssd-animate",""),L.textContent=`@keyframes ${i}{from{${u}}to{${N}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ue};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(L),e.classList.add(i);let v=()=>{let p=e.getBoundingClientRect();return re({top:p.top,height:p.height},O(),ae(),A,C)};oe(e,{type:"animate",getProgress:()=>g.getProgress(),getTrigger:v});let g={refresh(){},destroy(){e.classList.remove(i),L.remove(),e.style.animationPlayState="",J(),se(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(p){let D=Math.min(1,Math.max(0,p));e.classList.remove(i);for(let j of M)e.style.setProperty(j.prop,Ae(j.from,j.to,D));},getProgress(){let{tStart:p,tEnd:D}=v();return T(V(O(),p,D,a))}};return g}if(He())return Ve();let y=0,x=0,_=false,ee=-1,I=0,P=0,G=false,$=NaN,te=-1,ce=0,k=Y===e?M:[],le=false;function me(){let i=e.style,u=k.map(g=>i.getPropertyValue(g.prop)),N=i.transition;k.length&&(i.transition="none"),k.forEach(g=>i.setProperty(g.prop,Z.get(g.prop)??""));let L=he(Y,S,c);k.forEach((g,p)=>i.setProperty(g.prop,u[p])),k.length&&(e.offsetWidth,i.transition=N);let v=re(L,L.scroll,ae(),A,C);le&&Math.abs(v.tStart-y)<1&&Math.abs(v.tEnd-x)<1||(le=true,y=v.tStart,x=v.tEnd);}function Q(i){e.style.setProperty(Ce,String(i));for(let u of M)e.style.setProperty(u.prop,Ae(u.from,u.to,i));h?.(i);}function We(i){if(isNaN($)){$=i;return}$<=0&&i>0&&R?.(),$<1&&i>=1&&b?.(),$>=1&&i<1&&z?.(),$>0&&i<=0&&X?.(),$=i;}function Be(){if(_)return;let i=performance.now(),u=O(),N=a;if(d!==false){let p=i-ce,D=p>0?Math.abs(u-(te<0?u:te))/p:0;N=a*Math.max(.2,1+D*(typeof d=="number"?d:1)*.04);}te=u,ce=i;let L=x===y?0:(u-y)/(x-y);We(L);let v=V(u,y,x,N),g=m?Math.max(ee,T(I=Math.max(I,v))):T(v);P=g,Q(g),g>=1&&!G?(G=true,w?.()):g<1&&!m&&(G=false);}let F=Pe(S??window,[Y],()=>V(O(),y,x,Math.min(a,1)),Be,me);me(),x===y&&q("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),I=V(O(),y,x,a),P=T(I),Q(P),oe(e,{type:"animate",getProgress:()=>P,getTrigger:()=>({tStart:y,tEnd:x})});function fe(){_=true,F.hold(true);}return {destroy(){_=true,F.off(),J(),se(e);},replay(){ee=-1,I=0,G=false,P=0,_=false,Q(0),F.hold(false);},pause:fe,resume(){_&&(_=false,F.hold(false));},seek(i){let u=Math.min(1,Math.max(0,i));P=u,ee=u,I=0,fe(),Q(u);},getProgress(){return P},refresh:F.remeasure}}var ot={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 st(e){let t={};e.opacity!==void 0&&(t.opacity=[e.opacity,1]);let n=[],r=[];return e.x!==void 0&&(n.push(`translateX(${e.x}px)`),r.push("translateX(0px)")),e.y!==void 0&&(n.push(`translateY(${e.y}px)`),r.push("translateY(0px)")),e.scale!==void 0&&(n.push(`scale(${e.scale})`),r.push("scale(1)")),e.rotate!==void 0&&(n.push(`rotate(${e.rotate}deg)`),r.push("rotate(0deg)")),e.rotateX!==void 0&&(n.push(`rotateX(${e.rotateX}deg)`),r.push("rotateX(0deg)")),e.rotateY!==void 0&&(n.push(`rotateY(${e.rotateY}deg)`),r.push("rotateY(0deg)")),n.length>0&&(t.transform=[n.join(" "),r.join(" ")]),t}function it(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function ie(e){let t=e.trim().split(/\s+/),[n,r]=t.length>1?t:/%$/.test(t[0])?["top",t[0]]:[t[0],"bottom"];return [n,/%$/.test(r)?parseFloat(r):r==="top"?0:r==="center"?50:100]}function Oe(e,t){let[n,r]=ie(e);return `${n} ${+Math.max(0,r-t).toFixed(3)}%`}function at(e){let t=NaN,n=0,r=0;return e.map(o=>{let s=o.getBoundingClientRect();return Math.abs(s.top-t)<=Math.max(8,Math.min(s.height,n||s.height)/2)?r++:(t=s.top,n=s.height,r=0),r})}var ke={destroy:()=>{}};function kt(e,t={}){if(typeof window>"u")return ke;let n=it(e);if(!n.length)return q("scrollReveal: no elements found:",e),ke;let{preset:r="fadeUp",from:o,stagger:s=.15,easing:a="ease-out",once:m=true,trigger:c,onEnter:l,onLeave:f}=t,d={...ot[r],...o},E=st(d),h=c?.start||"top 88%",w=c?.end||"top 53%",R=Math.abs(ie(h)[1]-ie(w)[1]),b=Math.min(Math.max(s,0),1)*R,z=b>0?at(n):n.map(()=>0),X=n.map((T,A)=>{let C=Math.min(z[A]*b,R);return Ne(T,{props:E,easing:a,once:m,native:false,trigger:C>0?{start:Oe(h,C),end:Oe(w,C)}:{start:h,end:w},onEnter:A===0?l:void 0,onLeave:A===n.length-1?f:void 0})});return {destroy(){X.forEach(T=>T.destroy());}}}exports.scrollReveal=kt;
1
+ 'use strict';var Qe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function O(e,...n){Qe&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function je({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function Ge({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),s=Math.sqrt(r),o=0,i=[];for(let m=0;m<t;m++){let f=Math.pow(s,m);i.push(f),o+=f;}let u=[0],c=0;for(let m=0;m<t;m++)c+=i[m]/o,u.push(c);return m=>{if(m<=0)return 0;if(m>=1)return 1;for(let f=0;f<t;f++)if(m<=u[f+1]){let d=(m-u[f])/(u[f+1]-u[f]);if(f===0)return d*(2-d);let E=1-Math.pow(r,f);return E+(1-E)*(2*d-1)*(2*d-1)}return 1}}function Ue({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),s=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return o=>o<=0?0:o>=1?1:t*Math.pow(2,-10*o)*Math.sin((o-s)*(2*Math.PI)/r)+1}var F={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:je(),bounce:Ge(),elastic:Ue()};function qe(e,n,t,r){let s=(o,i,u)=>((1+3*o-3*i)*u+3*i-6*o)*u*u+3*o*u;return o=>{if(o<=0||o>=1)return +(o>0);let i=o;for(let u=0;u<8;u++)i-=(s(e,t,i)-o)/((3*(1+3*e-3*t)*i+6*t-12*e)*i+3*e);if(!(i>=0&&i<=1&&Math.abs(s(e,t,i)-o)<1e-9))for(let u=0,c=0,m=1;u<30;u++)i=(c+m)/2,s(e,t,i)<o?c=i:m=i;return s(n,r,i)}}function ne(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [qe(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var de=new Set;function ge(e,n="linear"){if(typeof e=="function")return e;if(e==null)return F[n];if({}.hasOwnProperty.call(F,e))return F[e];let t=ne(String(e));return t?t[0]:(!de.has(e)&&de.add(e)&&O(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),F[n])}function be(e,n,t){return Math.min(t,Math.max(n,e))}function re(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}var ve=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function he(e,n,t,r){return e+t+n*ve(r,0)}function ye(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:ve(e,1))}function z(e,n,t,r){return t===n?0:be((e-n)/(t-n)*r,0,1)}function oe(e,n,t,r,s){let o=he(e.top,e.height,n,r.element)-ye(r.viewport,t),i=he(e.top,e.height,n,s.element)-ye(s.viewport,t);return {tStart:o,tEnd:i}}function Ee(e,n,t){let r=e.getBoundingClientRect(),s=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:s,scroll:0}:{top:t==="x"?r.left:r.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function we(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 Se(e,n,t){let r=we(e),s=we(n);return !r||!s?e:`rgb(${Math.round(r[0]+(s[0]-r[0])*t)},${Math.round(r[1]+(s[1]-r[1])*t)},${Math.round(r[2]+(s[2]-r[2])*t)})`}var Je="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Ke="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Me=33;function Ze(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function et(e){let n=[];for(let t=0;t<Me;t++){let r=t/(Me-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function Le(e){switch(e){case "linear":return "linear";case "ease-in":return Je;case "ease-out":return Ke;case "ease-in-out":return Ze()?et(F["ease-in-out"]):null;default:return ne(e)?.[1]??null}}var xe=Symbol.for("svg-scroll-draw.registry");function Re(){let e=globalThis;return e[xe]||(e[xe]=new Map)}function se(e,n){Re().set(e,n);}function ie(e){Re().delete(e);}function Te(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}function $e(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let t=n(e,false),r=Te(o=>{if(!o)return;r();let i=(t.getProgress?.()??0)>=1;t.destroy(),t=n(i?{...e,onComplete:void 0}:e,true);}),s={};for(let o of Object.keys(t))s[o]=(...i)=>t[o]?.(...i);return s.destroy=()=>{r(),t.destroy();},s}var W,q=new Set,J=new WeakMap,B=new Map,Pe=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function tt(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function Ae(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();W??(W=new ResizeObserver(s=>{let o=false;for(let{target:i}of s)J.get(i)!==Pe(i)&&(o=true),J.set(i,"");o&&q.forEach(i=>i());})),q.add(t);let r=tt(e);return [document.body,document.documentElement].forEach(s=>s&&r.add(s)),r.forEach(s=>{J.has(s)||J.set(s,Pe(s)),B.set(s,(B.get(s)??0)+1),W.observe(s);}),()=>{q.delete(t)&&(r.forEach(s=>{let o=(B.get(s)??1)-1;if(o)return void B.set(s,o);B.delete(s),W?.unobserve(s);}),q.size||(W?.disconnect(),W=void 0));}}function Ce(e,n,t,r,s){let o,i=NaN,u,c,m=()=>{o=0,r(),!u&&!o&&(i=t())>0&&i<1&&(o=requestAnimationFrame(m));},f=()=>{!o&&!u&&t()!==i&&(o=requestAnimationFrame(m));},d=b=>{u=b,cancelAnimationFrame(o),o=i=NaN,f();},E=()=>{clearTimeout(c),s(),f();},h=()=>{clearTimeout(c),c=setTimeout(E,150);},w=Ae(n,h),R=b=>{e[b]("scroll",f,{passive:true}),window[b]("resize",h),window[b]("orientationchange",h);};return R("addEventListener"),f(),{hold:d,remeasure:E,off(){d(true),R("removeEventListener"),w(),clearTimeout(c);}}}function nt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function _e(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let s=[],o=[],i=r[2].trim();if(i)for(let u of i.split(/[\s,]+/)){let c=u.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(c?parseFloat(c[1]):0),o.push(c?c[2]:"");}n.push({fn:r[1],nums:s,units:o});}return n}function rt(e,n,t){let r=_e(e),s=_e(n);return r.length===0||r.length!==s.length?t<1?e:n:r.map((o,i)=>{let u=s[i];return o.fn!==u.fn||o.nums.length!==u.nums.length?t<1?`${o.fn}(${o.nums.map((c,m)=>`${c}${o.units[m]}`).join(", ")})`:`${u.fn}(${u.nums.map((c,m)=>`${c}${u.units[m]}`).join(", ")})`:`${o.fn}(${o.nums.map((c,m)=>`${c+(u.nums[m]-c)*t}${o.units[m]}`).join(", ")})`}).join(" ")}function Ie(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),s=String(n);if(nt(r))return Se(r,s,t);if(r.includes("("))return rt(r,s,t);let o=r.match(/^([-+]?[\d.]+)(.*)$/),i=s.match(/^([-+]?[\d.]+)(.*)$/);if(o&&i){let u=parseFloat(o[1]),c=parseFloat(i[1]);return `${u+(c-u)*t}${o[2]||i[2]}`}return t<1?r:s}function ot(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var st=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),it=0,Ne="--scroll-draw-progress";function at(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Fe={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ke(e,n){return typeof window>"u"?Fe:n.respectReducedMotion===false?Oe(e,n,false):$e(n,(t,r)=>Oe(e,t,r))}function Oe(e,n,t){let{props:r,trigger:s={},easing:o="ease-out",speed:i=1,once:u=false,axis:c="y",scrollContainer:m,native:f=true,velocityScale:d=false,triggerElement:E,onProgress:h,onComplete:w,onEnter:R,onLeave:b,onEnterBack:X,onLeaveBack:Y}=n,T=ge(o,"ease-out"),A=re(s.start||"top bottom"),C=re(s.end||"bottom top"),Q=E??e,S=typeof m=="string"?document.querySelector(m):m??null,M=Object.entries(r).map(([a,l])=>({prop:ot(a),from:Array.isArray(l)?l[0]:"",to:Array.isArray(l)?l[1]:l}));function Ve(){let a=window.getComputedStyle(e);for(let l of M)l.from===""&&(l.from=a.getPropertyValue(l.prop).trim()||"0");}function ze(){for(let a of M)e.style.setProperty(a.prop,String(a.to));}let K=new Map;for(let a of [...M.map(l=>l.prop),Ne])K.set(a,e.style.getPropertyValue(a));function Z(){for(let[a,l]of K)l?e.style.setProperty(a,l):e.style.removeProperty(a);}if(t)return ze(),w?.(),{...Fe,destroy:Z,getProgress:()=>1};Ve();let k=()=>S?c==="x"?S.scrollLeft:S.scrollTop:c==="x"?window.scrollX:window.scrollY,ue=()=>S?c==="x"?S.clientWidth:S.clientHeight:c==="x"?window.innerWidth:window.innerHeight,ce=typeof o=="string"?Le(o):null;function We(){if(!f||!at()||!ce||c!=="y"||S||Q!==e||u||i!==1||h||w||R||b||X||Y||d!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let a of M)if(!st.has(a.prop))return false;return true}function Be(){let a=`ssd-a-${++it}`,l=M.map(p=>`${p.prop}:${p.from}`).join(";"),N=M.map(p=>`${p.prop}:${p.to}`).join(";"),x=document.createElement("style");x.setAttribute("data-ssd-animate",""),x.textContent=`@keyframes ${a}{from{${l}}to{${N}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ce};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(x),e.classList.add(a);let v=()=>{let p=e.getBoundingClientRect();return oe({top:p.top,height:p.height},k(),ue(),A,C)};se(e,{type:"animate",getProgress:()=>g.getProgress(),getTrigger:v});let g={refresh(){},destroy(){e.classList.remove(a),x.remove(),e.style.animationPlayState="",Z(),ie(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(p){let V=Math.min(1,Math.max(0,p));e.classList.remove(a);for(let U of M)e.style.setProperty(U.prop,Ie(U.from,U.to,V));},getProgress(){let{tStart:p,tEnd:V}=v();return T(z(k(),p,V,i))}};return g}if(We())return Be();let y=0,L=0,_=false,ee=-1,I=0,$=0,j=false,P=NaN,te=-1,le=0,D=Q===e?M:[],me=false;function fe(){let a=e.style,l=D.map(g=>a.getPropertyValue(g.prop)),N=a.transition;D.length&&(a.transition="none"),D.forEach(g=>a.setProperty(g.prop,K.get(g.prop)??""));let x=Ee(Q,S,c);D.forEach((g,p)=>a.setProperty(g.prop,l[p])),D.length&&(e.offsetWidth,a.transition=N);let v=oe(x,x.scroll,ue(),A,C);me&&Math.abs(v.tStart-y)<1&&Math.abs(v.tEnd-L)<1||(me=true,y=v.tStart,L=v.tEnd);}function G(a){e.style.setProperty(Ne,String(a));for(let l of M)e.style.setProperty(l.prop,Ie(l.from,l.to,a));h?.(a);}function Xe(a){if(isNaN(P)){P=a;return}P<=0&&a>0&&R?.(),P<1&&a>=1&&b?.(),P>=1&&a<1&&X?.(),P>0&&a<=0&&Y?.(),P=a;}function Ye(){if(_)return;let a=performance.now(),l=k(),N=i;if(d!==false){let p=a-le,V=p>0?Math.abs(l-(te<0?l:te))/p:0;N=i*Math.max(.2,1+V*(typeof d=="number"?d:1)*.04);}te=l,le=a;let x=L===y?0:(l-y)/(L-y);Xe(x);let v=z(l,y,L,N),g=u?Math.max(ee,T(I=Math.max(I,v))):T(v);$=g,G(g),g>=1&&!j?(j=true,w?.()):g<1&&!u&&(j=false);}let H=Ce(S??window,[Q],()=>z(k(),y,L,Math.min(i,1)),Ye,fe);fe(),L===y&&O("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),I=z(k(),y,L,i),$=T(I),G($),se(e,{type:"animate",getProgress:()=>$,getTrigger:()=>({tStart:y,tEnd:L})});function pe(){_=true,H.hold(true);}return {destroy(){_=true,H.off(),Z(),ie(e);},replay(){ee=-1,I=0,j=false,$=0,_=false,G(0),H.hold(false);},pause:pe,resume(){_&&(_=false,H.hold(false));},seek(a){let l=Math.min(1,Math.max(0,a));$=l,ee=l,I=0,pe(),G(l);},getProgress(){return $},refresh:H.remeasure}}var ut={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 ct(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 lt(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function ae(e){let n=e.trim().split(/\s+/),[t,r]=n.length>1?n:/%$/.test(n[0])?["top",n[0]]:[n[0],"bottom"];return [t,/%$/.test(r)?parseFloat(r):r==="top"?0:r==="center"?50:100]}function De(e,n){let[t,r]=ae(e);return `${t} ${+Math.max(0,r-n).toFixed(3)}%`}function mt(e){let n=NaN,t=0,r=0;return e.map(s=>{let o=s.getBoundingClientRect();return Math.abs(o.top-n)<=Math.max(8,Math.min(o.height,t||o.height)/2)?r++:(n=o.top,t=o.height,r=0),r})}var He={destroy:()=>{}};function zt(e,n={}){if(typeof window>"u")return He;let t=lt(e);if(!t.length)return O("scrollReveal: no elements found:",e),He;let{preset:r="fadeUp",from:s,stagger:o=.15,easing:i="ease-out",once:u=true,trigger:c,onEnter:m,onLeave:f}=n,d={...ut[r],...s},E=ct(d),h=c?.start||"top 88%",w=c?.end||"top 53%",R=Math.abs(ae(h)[1]-ae(w)[1]),b=Math.min(Math.max(o,0),1)*R,X=b>0?mt(t):t.map(()=>0),Y=t.map((T,A)=>{let C=Math.min(X[A]*b,R);return ke(T,{props:E,easing:i,once:u,native:false,trigger:C>0?{start:De(h,C),end:De(w,C)}:{start:h,end:w},onEnter:A===0?m:void 0,onLeave:A===t.length-1?f:void 0})});return {destroy(){Y.forEach(T=>T.destroy());}}}exports.scrollReveal=zt;
@@ -1,4 +1,4 @@
1
- import { E as EasingName, T as TriggerConfig } from '../types-9bcJdVcg.mjs';
1
+ import { E as Easing, T as TriggerConfig } from '../types-iITMwrru.mjs';
2
2
 
3
3
  interface ScrollRevealFrom {
4
4
  /** Start opacity (0–1). Animates to 1. */
@@ -53,7 +53,7 @@ interface ScrollRevealOptions {
53
53
  */
54
54
  stagger?: number;
55
55
  /** Animation easing. Default: `'ease-out'`. */
56
- easing?: EasingName | ((t: number) => number);
56
+ easing?: Easing;
57
57
  /** Freeze at max progress — don't reverse on scroll back. Default: true. */
58
58
  once?: boolean;
59
59
  /** Override the default trigger window. */
@@ -1,4 +1,4 @@
1
- import { E as EasingName, T as TriggerConfig } from '../types-9bcJdVcg.js';
1
+ import { E as Easing, T as TriggerConfig } from '../types-iITMwrru.js';
2
2
 
3
3
  interface ScrollRevealFrom {
4
4
  /** Start opacity (0–1). Animates to 1. */
@@ -53,7 +53,7 @@ interface ScrollRevealOptions {
53
53
  */
54
54
  stagger?: number;
55
55
  /** Animation easing. Default: `'ease-out'`. */
56
- easing?: EasingName | ((t: number) => number);
56
+ easing?: Easing;
57
57
  /** Freeze at max progress — don't reverse on scroll back. Default: true. */
58
58
  once?: boolean;
59
59
  /** Override the default trigger window. */
@@ -1 +1 @@
1
- import {a}from'../chunk-7USW2XFB.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var M={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 N(e){let r={};e.opacity!==void 0&&(r.opacity=[e.opacity,1]);let t=[],n=[];return e.x!==void 0&&(t.push(`translateX(${e.x}px)`),n.push("translateX(0px)")),e.y!==void 0&&(t.push(`translateY(${e.y}px)`),n.push("translateY(0px)")),e.scale!==void 0&&(t.push(`scale(${e.scale})`),n.push("scale(1)")),e.rotate!==void 0&&(t.push(`rotate(${e.rotate}deg)`),n.push("rotate(0deg)")),e.rotateX!==void 0&&(t.push(`rotateX(${e.rotateX}deg)`),n.push("rotateX(0deg)")),e.rotateY!==void 0&&(t.push(`rotateY(${e.rotateY}deg)`),n.push("rotateY(0deg)")),t.length>0&&(r.transform=[t.join(" "),n.join(" ")]),r}function P(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function u(e){let r=e.trim().split(/\s+/),[t,n]=r.length>1?r:/%$/.test(r[0])?["top",r[0]]:[r[0],"bottom"];return [t,/%$/.test(n)?parseFloat(n):n==="top"?0:n==="center"?50:100]}function y(e,r){let[t,n]=u(e);return `${t} ${+Math.max(0,n-r).toFixed(3)}%`}function Y(e){let r=NaN,t=0,n=0;return e.map(a=>{let o=a.getBoundingClientRect();return Math.abs(o.top-r)<=Math.max(8,Math.min(o.height,t||o.height)/2)?n++:(r=o.top,t=o.height,n=0),n})}var v={destroy:()=>{}};function A(e,r={}){if(typeof window>"u")return v;let t=P(e);if(!t.length)return b("scrollReveal: no elements found:",e),v;let{preset:n="fadeUp",from:a$1,stagger:o=.15,easing:b$1="ease-out",once:R=true,trigger:d,onEnter:x,onLeave:E}=r,S={...M[n],...a$1},X=N(S),s=d?.start||"top 88%",i=d?.end||"top 53%",f=Math.abs(u(s)[1]-u(i)[1]),g=Math.min(Math.max(o,0),1)*f,$=g>0?Y(t):t.map(()=>0),L=t.map((l,c)=>{let p=Math.min($[c]*g,f);return a(l,{props:X,easing:b$1,once:R,native:false,trigger:p>0?{start:y(s,p),end:y(i,p)}:{start:s,end:i},onEnter:c===0?x:void 0,onLeave:c===t.length-1?E:void 0})});return {destroy(){L.forEach(l=>l.destroy());}}}export{A as scrollReveal};
1
+ import {a}from'../chunk-HAGTU5EX.mjs';import'../chunk-7LDSB4FT.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var M={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 P(e){let r={};e.opacity!==void 0&&(r.opacity=[e.opacity,1]);let t=[],n=[];return e.x!==void 0&&(t.push(`translateX(${e.x}px)`),n.push("translateX(0px)")),e.y!==void 0&&(t.push(`translateY(${e.y}px)`),n.push("translateY(0px)")),e.scale!==void 0&&(t.push(`scale(${e.scale})`),n.push("scale(1)")),e.rotate!==void 0&&(t.push(`rotate(${e.rotate}deg)`),n.push("rotate(0deg)")),e.rotateX!==void 0&&(t.push(`rotateX(${e.rotateX}deg)`),n.push("rotateX(0deg)")),e.rotateY!==void 0&&(t.push(`rotateY(${e.rotateY}deg)`),n.push("rotateY(0deg)")),t.length>0&&(r.transform=[t.join(" "),n.join(" ")]),r}function Y(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function d(e){let r=e.trim().split(/\s+/),[t,n]=r.length>1?r:/%$/.test(r[0])?["top",r[0]]:[r[0],"bottom"];return [t,/%$/.test(n)?parseFloat(n):n==="top"?0:n==="center"?50:100]}function y(e,r){let[t,n]=d(e);return `${t} ${+Math.max(0,n-r).toFixed(3)}%`}function w(e){let r=NaN,t=0,n=0;return e.map(a=>{let o=a.getBoundingClientRect();return Math.abs(o.top-r)<=Math.max(8,Math.min(o.height,t||o.height)/2)?n++:(r=o.top,t=o.height,n=0),n})}var v={destroy:()=>{}};function A(e,r={}){if(typeof window>"u")return v;let t=Y(e);if(!t.length)return b("scrollReveal: no elements found:",e),v;let{preset:n="fadeUp",from:a$1,stagger:o=.15,easing:R="ease-out",once:b$1=true,trigger:u,onEnter:x,onLeave:E}=r,S={...M[n],...a$1},X=P(S),s=u?.start||"top 88%",i=u?.end||"top 53%",f=Math.abs(d(s)[1]-d(i)[1]),g=Math.min(Math.max(o,0),1)*f,$=g>0?w(t):t.map(()=>0),L=t.map((l,c)=>{let p=Math.min($[c]*g,f);return a(l,{props:X,easing:R,once:b$1,native:false,trigger:p>0?{start:y(s,p),end:y(i,p)}:{start:s,end:i},onEnter:c===0?x:void 0,onLeave:c===t.length-1?E:void 0})});return {destroy(){L.forEach(l=>l.destroy());}}}export{A as scrollReveal};
@@ -1,4 +1,4 @@
1
- import { a as ScrollDrawOptions, S as ScrollDrawInstance } from './types-9bcJdVcg.mjs';
1
+ import { a as ScrollDrawOptions, S as ScrollDrawInstance } from './types-iITMwrru.mjs';
2
2
 
3
3
  declare function scrollDraw(target: string | Element, options?: ScrollDrawOptions): ScrollDrawInstance;
4
4
 
@@ -1,4 +1,4 @@
1
- import { a as ScrollDrawOptions, S as ScrollDrawInstance } from './types-9bcJdVcg.js';
1
+ import { a as ScrollDrawOptions, S as ScrollDrawInstance } from './types-iITMwrru.js';
2
2
 
3
3
  declare function scrollDraw(target: string | Element, options?: ScrollDrawOptions): ScrollDrawInstance;
4
4
 
@@ -1 +1 @@
1
- 'use strict';function K({tension:e=2.5,friction:r=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,r)}function X({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),a=Math.max(.01,Math.min(.99,r)),p=Math.sqrt(a),u=0,h=[];for(let o=0;o<n;o++){let s=Math.pow(p,o);h.push(s),u+=s;}let m=[0],M=0;for(let o=0;o<n;o++)M+=h[o]/u,m.push(M);return o=>{if(o<=0)return 0;if(o>=1)return 1;for(let s=0;s<n;s++)if(o<=m[s+1]){let b=(o-m[s])/(m[s+1]-m[s]);if(s===0)return b*(2-b);let E=1-Math.pow(a,s);return E+(1-E)*(2*b-1)*(2*b-1)}return 1}}function j({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),a=Math.max(.1,r),p=n<=1?a/4:a/(2*Math.PI)*Math.asin(1/n);return u=>u<=0?0:u>=1?1:n*Math.pow(2,-10*u)*Math.sin((u-p)*(2*Math.PI)/a)+1}var A={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:K(),bounce:X(),elastic:j()};function x(e,r,n){return Math.min(n,Math.max(r,e))}var J=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function q(e,...r){J&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function H(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function P(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),n=p=>e(!!p.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",n),()=>r.removeEventListener("change",n);let a=r;return a.addListener?.(n),()=>a.removeListener?.(n)}var W=Symbol.for("svg-scroll-draw.registry");function F(){let e=globalThis;return e[W]||(e[W]=new Map)}function G(e,r){F().set(e,r);}function z(e){F().delete(e);}var $={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function U(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function de(e,r={}){if(typeof window>"u")return $;let n=U(e);if(!n.length)return q("scrollSnap: no sections found"),$;let{direction:a="vertical",duration:p=600,easing:u="ease-in-out",threshold:h=.3,scrollContainer:m,onSnap:M,respectReducedMotion:o=true}=r,s=o&&H(),b=o?P(t=>{s=t;}):()=>{},E=typeof u=="function"?u:A[u]??A["ease-in-out"],y=a==="horizontal",_=y?"Width":"Height",C=y?"left":"top",f=typeof m=="string"?document.querySelector(m):m??null,R=false,v=0;function w(){return f?y?f.scrollLeft:f.scrollTop:y?window.scrollX:window.scrollY}function N(t){let i=f??window,c=y?{left:t}:{top:t};try{i.scrollTo({...c,behavior:"instant"});}catch{i.scrollTo(c);}}function S(){let t=f??document.scrollingElement??document.documentElement,i=t[`scroll${_}`]-t[`client${_}`],c=f?f.getBoundingClientRect()[C]+f[y?"clientLeft":"clientTop"]:0,d=w();return n.map(g=>x(g.getBoundingClientRect()[C]-c+d,0,i))}function B(){let t=w(),i=S();return i.reduce((c,d,g)=>Math.abs(d-t)<Math.abs(i[c]-t)?g:c,0)}let l=B();function T(t){R=false,l=t,M?.(t);}function L(t){let i=x(t,0,n.length-1);cancelAnimationFrame(v),R=true;let c=S(),d=w(),g=c[i];if(Math.abs(d-g)<1)return T(i);if(s)return N(g),T(i);let k=performance.now();function Q(Y){let V=x((Y-k)/p,0,1);N(d+(g-d)*E(V)),V<1?v=requestAnimationFrame(Q):T(i);}v=requestAnimationFrame(Q);}let I;function O(){R||(clearTimeout(I),I=setTimeout(()=>{let t=w(),i=S();if(Math.abs(t-i[l])<1)return;let c=n[l][`offset${_}`],d=t-i[l];d>c*h&&l<n.length-1?L(l+1):d<-(c*h)&&l>0?L(l-1):L(l);},100));}let D=f??window;return D.addEventListener("scroll",O,{passive:true}),G(n[0],{type:"snap",getProgress:()=>l/(n.length-1||1),getTrigger:()=>{let t=S();return {tStart:t[0],tEnd:t[t.length-1]}}}),{destroy(){cancelAnimationFrame(v),clearTimeout(I),D.removeEventListener("scroll",O),b(),z(n[0]);},snapTo:L,getCurrentIndex(){return l}}}exports.scrollSnap=de;
1
+ 'use strict';var U=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function _(e,...t){U&&console.warn(`[svg-scroll-draw] ${e}`,...t);}function X({tension:e=2.5,friction:t=2.2}={}){return n=>1-Math.cos(n*Math.PI*e)*Math.pow(1-n,t)}function j({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),l=Math.max(.01,Math.min(.99,t)),d=Math.sqrt(l),o=0,i=[];for(let c=0;c<n;c++){let u=Math.pow(d,c);i.push(u),o+=u;}let s=[0],g=0;for(let c=0;c<n;c++)g+=i[c]/o,s.push(g);return c=>{if(c<=0)return 0;if(c>=1)return 1;for(let u=0;u<n;u++)if(c<=s[u+1]){let h=(c-s[u])/(s[u+1]-s[u]);if(u===0)return h*(2-h);let M=1-Math.pow(l,u);return M+(1-M)*(2*h-1)*(2*h-1)}return 1}}function Z({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),l=Math.max(.1,t),d=n<=1?l/4:l/(2*Math.PI)*Math.asin(1/n);return o=>o<=0?0:o>=1?1:n*Math.pow(2,-10*o)*Math.sin((o-d)*(2*Math.PI)/l)+1}var R={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:X(),bounce:j(),elastic:Z()};function ee(e,t,n,l){let d=(o,i,s)=>((1+3*o-3*i)*s+3*i-6*o)*s*s+3*o*s;return o=>{if(o<=0||o>=1)return +(o>0);let i=o;for(let s=0;s<8;s++)i-=(d(e,n,i)-o)/((3*(1+3*e-3*n)*i+6*n-12*e)*i+3*e);if(!(i>=0&&i<=1&&Math.abs(d(e,n,i)-o)<1e-9))for(let s=0,g=0,c=1;s<30;s++)i=(g+c)/2,d(e,n,i)<o?g=i:c=i;return d(t,l,i)}}function ne(e){let t=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),n=t?t[1].split(",").map(parseFloat):[];if(n.length===4&&n.every(Number.isFinite)&&n[0]*(1-n[0])>=0&&n[2]*(1-n[2])>=0)return [ee(n[0],n[1],n[2],n[3]),`cubic-bezier(${n})`]}var q=new Set;function F(e,t="linear"){if(typeof e=="function")return e;if(e==null)return R[t];if({}.hasOwnProperty.call(R,e))return R[e];let n=ne(String(e));return n?n[0]:(!q.has(e)&&q.add(e)&&_(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),R[t])}function T(e,t,n){return Math.min(n,Math.max(t,e))}function P(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function $(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=d=>e(!!d.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let l=t;return l.addListener?.(n),()=>l.removeListener?.(n)}var H=Symbol.for("svg-scroll-draw.registry");function W(){let e=globalThis;return e[H]||(e[H]=new Map)}function B(e,t){W().set(e,t);}function G(e){W().delete(e);}var k={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function te(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function ge(e,t={}){if(typeof window>"u")return k;let n=te(e);if(!n.length)return _("scrollSnap: no sections found"),k;let{direction:l="vertical",duration:d=600,easing:o="ease-in-out",threshold:i=.3,scrollContainer:s,onSnap:g,respectReducedMotion:c=true}=t,u=c&&P(),h=c?$(r=>{u=r;}):()=>{},M=F(o,"ease-in-out"),E=l==="horizontal",x=E?"Width":"Height",N=E?"left":"top",b=typeof s=="string"?document.querySelector(s):s??null,I=false,w=0;function v(){return b?E?b.scrollLeft:b.scrollTop:E?window.scrollX:window.scrollY}function C(r){let a=b??window,m=E?{left:r}:{top:r};try{a.scrollTo({...m,behavior:"instant"});}catch{a.scrollTo(m);}}function S(){let r=b??document.scrollingElement??document.documentElement,a=r[`scroll${x}`]-r[`client${x}`],m=b?b.getBoundingClientRect()[N]+b[E?"clientLeft":"clientTop"]:0,p=v();return n.map(y=>T(y.getBoundingClientRect()[N]-m+p,0,a))}function Y(){let r=v(),a=S();return a.reduce((m,p,y)=>Math.abs(p-r)<Math.abs(a[m]-r)?y:m,0)}let f=Y();function A(r){I=false,f=r,g?.(r);}function L(r){let a=T(r,0,n.length-1);cancelAnimationFrame(w),I=true;let m=S(),p=v(),y=m[a];if(Math.abs(p-y)<1)return A(a);if(u)return C(y),A(a);let J=performance.now();function Q(K){let V=T((K-J)/d,0,1);C(p+(y-p)*M(V)),V<1?w=requestAnimationFrame(Q):A(a);}w=requestAnimationFrame(Q);}let O;function z(){I||(clearTimeout(O),O=setTimeout(()=>{let r=v(),a=S();if(Math.abs(r-a[f])<1)return;let m=n[f][`offset${x}`],p=r-a[f];p>m*i&&f<n.length-1?L(f+1):p<-(m*i)&&f>0?L(f-1):L(f);},100));}let D=b??window;return D.addEventListener("scroll",z,{passive:true}),B(n[0],{type:"snap",getProgress:()=>f/(n.length-1||1),getTrigger:()=>{let r=S();return {tStart:r[0],tEnd:r[r.length-1]}}}),{destroy(){cancelAnimationFrame(w),clearTimeout(O),D.removeEventListener("scroll",z),h(),G(n[0]);},snapTo:L,getCurrentIndex(){return f}}}exports.scrollSnap=ge;
@@ -1,4 +1,4 @@
1
- import { E as EasingName } from '../types-9bcJdVcg.mjs';
1
+ import { E as Easing } from '../types-iITMwrru.mjs';
2
2
 
3
3
  interface ScrollSnapOptions {
4
4
  /** Scroll axis. Default: 'vertical'. */
@@ -6,7 +6,7 @@ interface ScrollSnapOptions {
6
6
  /** Snap animation duration in ms. Default: 600. */
7
7
  duration?: number;
8
8
  /** Easing for the snap scroll animation. Default: 'ease-in-out'. */
9
- easing?: EasingName | ((t: number) => number);
9
+ easing?: Easing;
10
10
  /**
11
11
  * Fraction of a section's size the user must scroll past before it snaps
12
12
  * forward instead of snapping back. Range 0–1. Default: 0.3.
@@ -1,4 +1,4 @@
1
- import { E as EasingName } from '../types-9bcJdVcg.js';
1
+ import { E as Easing } from '../types-iITMwrru.js';
2
2
 
3
3
  interface ScrollSnapOptions {
4
4
  /** Scroll axis. Default: 'vertical'. */
@@ -6,7 +6,7 @@ interface ScrollSnapOptions {
6
6
  /** Snap animation duration in ms. Default: 600. */
7
7
  duration?: number;
8
8
  /** Easing for the snap scroll animation. Default: 'ease-in-out'. */
9
- easing?: EasingName | ((t: number) => number);
9
+ easing?: Easing;
10
10
  /**
11
11
  * Fraction of a section's size the user must scroll past before it snaps
12
12
  * forward instead of snapping back. Range 0–1. Default: 0.3.
@@ -1 +1 @@
1
- import {a}from'../chunk-AJ22VSHC.mjs';import {d}from'../chunk-THPTANES.mjs';import {a as a$3}from'../chunk-4DOJSIEQ.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var z={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function k(c){return typeof c=="string"?Array.from(document.querySelectorAll(c)):c instanceof NodeList?Array.from(c):c}function Z(c,$={}){if(typeof window>"u")return z;let i=k(c);if(!i.length)return b("scrollSnap: no sections found"),z;let{direction:B="vertical",duration:P=600,easing:g="ease-in-out",threshold:v=.3,scrollContainer:S,onSnap:_,respectReducedMotion:w=true}=$,M=w&&a(),G=w?a$1(e=>{M=e;}):()=>{},W=typeof g=="function"?g:d[g]??d["ease-in-out"],a$4=B==="horizontal",b$2=a$4?"Width":"Height",x=a$4?"left":"top",s=typeof S=="string"?document.querySelector(S):S??null,h=false,u=0;function m(){return s?a$4?s.scrollLeft:s.scrollTop:a$4?window.scrollX:window.scrollY}function L(e){let t=s??window,n=a$4?{left:e}:{top:e};try{t.scrollTo({...n,behavior:"instant"});}catch{t.scrollTo(n);}}function d$1(){let e=s??document.scrollingElement??document.documentElement,t=e[`scroll${b$2}`]-e[`client${b$2}`],n=s?s.getBoundingClientRect()[x]+s[a$4?"clientLeft":"clientTop"]:0,r=m();return i.map(l=>a$3(l.getBoundingClientRect()[x]-n+r,0,t))}function X(){let e=m(),t=d$1();return t.reduce((n,r,l)=>Math.abs(r-e)<Math.abs(t[n]-e)?l:n,0)}let o=X();function T(e){h=false,o=e,_?.(e);}function f(e){let t=a$3(e,0,i.length-1);cancelAnimationFrame(u),h=true;let n=d$1(),r=m(),l=n[t];if(Math.abs(r-l)<1)return T(t);if(M)return L(l),T(t);let Y=performance.now();function R(j){let C=a$3((j-Y)/P,0,1);L(r+(l-r)*W(C)),C<1?u=requestAnimationFrame(R):T(t);}u=requestAnimationFrame(R);}let E;function I(){h||(clearTimeout(E),E=setTimeout(()=>{let e=m(),t=d$1();if(Math.abs(e-t[o])<1)return;let n=i[o][`offset${b$2}`],r=e-t[o];r>n*v&&o<i.length-1?f(o+1):r<-(n*v)&&o>0?f(o-1):f(o);},100));}let A=s??window;return A.addEventListener("scroll",I,{passive:true}),a$2(i[0],{type:"snap",getProgress:()=>o/(i.length-1||1),getTrigger:()=>{let e=d$1();return {tStart:e[0],tEnd:e[e.length-1]}}}),{destroy(){cancelAnimationFrame(u),clearTimeout(E),A.removeEventListener("scroll",I),G(),b$1(i[0]);},snapTo:f,getCurrentIndex(){return o}}}export{Z as scrollSnap};
1
+ import {a}from'../chunk-AJ22VSHC.mjs';import {f}from'../chunk-IXR6RML7.mjs';import {a as a$3}from'../chunk-4DOJSIEQ.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var z={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function D(c){return typeof c=="string"?Array.from(document.querySelectorAll(c)):c instanceof NodeList?Array.from(c):c}function Z(c,N={}){if(typeof window>"u")return z;let i=D(c);if(!i.length)return b("scrollSnap: no sections found"),z;let{direction:$="vertical",duration:B=600,easing:P="ease-in-out",threshold:E=.3,scrollContainer:g,onSnap:_,respectReducedMotion:v=true}=N,y=v&&a(),W=v?a$1(e=>{y=e;}):()=>{},X=f(P,"ease-in-out"),a$4=$==="horizontal",S=a$4?"Width":"Height",w=a$4?"left":"top",s=typeof g=="string"?document.querySelector(g):g??null,h=false,u=0;function m(){return s?a$4?s.scrollLeft:s.scrollTop:a$4?window.scrollX:window.scrollY}function M(e){let t=s??window,n=a$4?{left:e}:{top:e};try{t.scrollTo({...n,behavior:"instant"});}catch{t.scrollTo(n);}}function d(){let e=s??document.scrollingElement??document.documentElement,t=e[`scroll${S}`]-e[`client${S}`],n=s?s.getBoundingClientRect()[w]+s[a$4?"clientLeft":"clientTop"]:0,r=m();return i.map(l=>a$3(l.getBoundingClientRect()[w]-n+r,0,t))}function Y(){let e=m(),t=d();return t.reduce((n,r,l)=>Math.abs(r-e)<Math.abs(t[n]-e)?l:n,0)}let o=Y();function T(e){h=false,o=e,_?.(e);}function f$1(e){let t=a$3(e,0,i.length-1);cancelAnimationFrame(u),h=true;let n=d(),r=m(),l=n[t];if(Math.abs(r-l)<1)return T(t);if(y)return M(l),T(t);let j=performance.now();function I(k){let A=a$3((k-j)/B,0,1);M(r+(l-r)*X(A)),A<1?u=requestAnimationFrame(I):T(t);}u=requestAnimationFrame(I);}let b$2;function x(){h||(clearTimeout(b$2),b$2=setTimeout(()=>{let e=m(),t=d();if(Math.abs(e-t[o])<1)return;let n=i[o][`offset${S}`],r=e-t[o];r>n*E&&o<i.length-1?f$1(o+1):r<-(n*E)&&o>0?f$1(o-1):f$1(o);},100));}let L=s??window;return L.addEventListener("scroll",x,{passive:true}),a$2(i[0],{type:"snap",getProgress:()=>o/(i.length-1||1),getTrigger:()=>{let e=d();return {tStart:e[0],tEnd:e[e.length-1]}}}),{destroy(){cancelAnimationFrame(u),clearTimeout(b$2),L.removeEventListener("scroll",x),W(),b$1(i[0]);},snapTo:f$1,getCurrentIndex(){return o}}}export{Z as scrollSnap};
@@ -1,3 +1,3 @@
1
- 'use strict';var solidJs=require('solid-js');function dr({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function gr({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(r),s=0,a=[];for(let p=0;p<t;p++){let g=Math.pow(o,p);a.push(g),s+=g;}let u=[0],f=0;for(let p=0;p<t;p++)f+=a[p]/s,u.push(f);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let g=0;g<t;g++)if(p<=u[g+1]){let x=(p-u[g])/(u[g+1]-u[g]);if(g===0)return x*(2-x);let y=1-Math.pow(r,g);return y+(1-y)*(2*x-1)*(2*x-1)}return 1}}function yr({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),o=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-o)*(2*Math.PI)/r)+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:dr(),bounce:gr(),elastic:yr()};function Qe(e,n,t){return Math.min(t,Math.max(n,e))}function ie(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}var Rt=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function It(e,n,t,r){return e+t+n*Rt(r,0)}function Nt(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Rt(e,1))}function B(e,n,t,r){return t===n?0:Qe((e-n)/(t-n)*r,0,1)}function we(e,n,t,r,o){let s=It(e.top,e.height,n,r.element)-Nt(r.viewport,t),a=It(e.top,e.height,n,o.element)-Nt(o.viewport,t);return {tStart:s,tEnd:a}}function et(e,n,t){let r=e.getBoundingClientRect(),o=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:o,scroll:0}:{top:t==="x"?r.left:r.top,height:o,scroll:t==="x"?window.scrollX:window.scrollY}}function tt(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let t=e.tagName.toLowerCase();if(t==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(r+o)}if(t==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Vt(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 rt(e,n,t){let r=Vt(e),o=Vt(n);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*t)},${Math.round(r[1]+(o[1]-r[1])*t)},${Math.round(r[2]+(o[2]-r[2])*t)})`}var Ft={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 Ge=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ae(e,...n){Ge&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var hr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",br="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",_t=33;function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function vr(e){let n=[];for(let t=0;t<_t;t++){let r=t/(_t-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function nt(e){switch(e){case "linear":return "linear";case "ease-in":return hr;case "ease-out":return br;case "ease-in-out":return wr()?vr(ee["ease-in-out"]):null;default:return null}}var Wt=Symbol.for("svg-scroll-draw.registry");function zt(){let e=globalThis;return e[Wt]||(e[Wt]=new Map)}function ve(e,n){zt().set(e,n);}function Ee(e){zt().delete(e);}function ot(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}function Re(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let t=n(e,false),r=ot(s=>{if(!s)return;r();let a=(t.getProgress?.()??0)>=1;t.destroy(),t=n(a?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(t))o[s]=(...a)=>t[s]?.(...a);return o.destroy=()=>{r(),t.destroy();},o}var Ye,st=new Set,it=new WeakMap,Ue=new Map,Gt=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function Er(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function Bt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();Ye??(Ye=new ResizeObserver(o=>{let s=false;for(let{target:a}of o)it.get(a)!==Gt(a)&&(s=true),it.set(a,"");s&&st.forEach(a=>a());})),st.add(t);let r=Er(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{it.has(o)||it.set(o,Gt(o)),Ue.set(o,(Ue.get(o)??0)+1),Ye.observe(o);}),()=>{st.delete(t)&&(r.forEach(o=>{let s=(Ue.get(o)??1)-1;if(s)return void Ue.set(o,s);Ue.delete(o),Ye?.unobserve(o);}),st.size||(Ye?.disconnect(),Ye=void 0));}}function Me(e,n,t,r,o){let s,a=NaN,u,f,p=()=>{s=0,r(),!u&&!s&&(a=t())>0&&a<1&&(s=requestAnimationFrame(p));},g=()=>{!s&&!u&&t()!==a&&(s=requestAnimationFrame(p));},x=D=>{u=D,cancelAnimationFrame(s),s=a=NaN,g();},y=()=>{clearTimeout(f),o(),g();},H=()=>{clearTimeout(f),f=setTimeout(y,150);},j=Bt(n,H),w=D=>{e[D]("scroll",g,{passive:true}),window[D]("resize",H),window[D]("orientationchange",H);};return w("addEventListener"),g(),{hold:x,remeasure:y,off(){x(true),w("removeEventListener"),j(),clearTimeout(f);}}}var Sr=0;function Tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function jt(e,n){let t="";try{t=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return t||(e.getAttribute(n)??"").trim()}var qt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function xr(e){if(!Ge)return;let n=jt(e,"stroke");if(!n||n==="none"){ae("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!qt.has(t)&&!qt.has(jt(e,"fill"))&&ae("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Mr(e,n,t){let r=document.createElement("div");r.setAttribute("data-svg-scroll-draw-debug",""),r.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 o(){let s=t==="x"?window.scrollX:window.scrollY,a=e-s,u=n-s,f=t==="x";r.innerHTML=`
2
- <div style="position:absolute;${f?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${f?`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(r),window.addEventListener("scroll",o,{passive:true}),o(),{el:r,destroy(){window.removeEventListener("scroll",o),r.remove();}}}var Qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Yt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Lr(e,n,t){if(!Ge)return;let r=(e.match(Yt)??[]).join("").toUpperCase(),o=(n.match(Yt)??[]).join("").toUpperCase(),s=(e.match(Qt)??[]).length,a=(n.match(Qt)??[]).length;if(r!==o){ae(`morphTo: command sequence differs (${r||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}s!==a&&ae(`morphTo: coordinate count differs (${s} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Ar(e,n,t){let r=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let a=parseFloat(s),u=r[o++]??a;return String(+(a+(u-a)*t).toFixed(4))})}function gt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Re(n,(t,r)=>Cr(e,t,r))}function Cr(e,n,t){let{preset:r,...o}=n,s=r?{...Ft[r],...o}:o,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:f=false,easing:p="linear",trigger:g={},stagger:x=0,direction:y="forward",once:H=false,debug:j=false,axis:w="y",scrollContainer:D,autoReverse:ue=false,delay:I=0,strokeColor:M,strokeWidth:A,fillOpacity:$,waypoints:v,velocityScale:C=false,threshold:N=0,rootMargin:te="0px",repeat:q=0,repeatDelay:V=0,morphTo:R,clip:E,autoplay:Y=false,duration:h=1e3,native:P=true,onProgress:Se,onStart:U,onComplete:_,onEnter:fe,onLeave:Te,onEnterBack:ge,onLeaveBack:me}=s,b=E===true?"left":typeof E=="string"?E:false,S=typeof p=="function"?p:ee[p]??ee.linear,ye=ie(g.start||"top bottom"),De=ie(g.end||"bottom top"),X=typeof D=="string"?document.querySelector(D):D??null,Ae=Array.isArray(M)?M[0]:null,Ce=Array.isArray(M)?M[1]:typeof M=="string"?M:null,he=Array.isArray(A)?A[0]:null,Ie=Array.isArray(A)?A[1]:typeof A=="number"?A:null,Pe=Array.isArray($)?$[0]:null,be=Array.isArray($)?$[1]:typeof $=="number"?$:null;function $e(i){let c=i*100;switch(b){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${i*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let l=b?[]:Array.from(e.querySelectorAll(a)),m=[],K=[],O=0,F=0,Q=x,W=0,Ne=0,Z=false,Oe=false,ke=0,lt=-1,Xe=[],Ke=-1,pe=false,xe=0,Ve=0,Fe,ct=false,ut=null;function St(){ut?.destroy(),ut=null;}let _e=new Set,Tt=NaN,We=true,Ze=-1,xt=performance.now(),ze=NaN;function Je(){return X?w==="x"?X.scrollLeft:X.scrollTop:w==="x"?window.scrollX:window.scrollY}function Mt(){return X?w==="x"?X.clientWidth:X.clientHeight:w==="x"?window.innerWidth:window.innerHeight}function Lt(){let i=et(e,X,w);return we(i,i.scroll,Mt(),ye,De)}function ar(){let i=F-O,c=l.length-1,d=X??document.documentElement,L=w==="x"?"Width":"Height";if(Q=x,x>0&&c>0&&i>0){let re=d[`scroll${L}`]-d[`client${L}`]-1-O-i/u;re>=0&&(Q=Math.min(x,re/(c*i)));}let J=Math.max(0,c)*Q*i,le=i/Math.min(u,1);W=O+Math.min(0,J,le,J+le),Ne=O+Math.max(0,J,le,J+le);}function At(){(({tStart:O,tEnd:F}=Lt())),ar(),j&&Ge&&(St(),ut=Mr(O,F,w));}function ft(i,c=Lt){ve(e,{type:"draw",getProgress:()=>i.getProgress(),getTrigger:c});let d=i.destroy;return i.destroy=()=>{d.call(i),Ee(e);},i}function Ct(i,c){return H&&!ue?Math.max(lt,S(Xe[i]=Math.max(Xe[i]??0,c))):S(c)}function lr(i,c){if(e.style.setProperty("--scroll-draw-progress",String(i)),b){let d=c==="reverse"?1-i:i;e.style.clipPath=$e(d);return}l.forEach((d,L)=>mt(d,L,i,c));}function mt(i,c,d,L){i.style.strokeDashoffset=L==="reverse"?`${m[c]*d}`:`${m[c]*(1-d)}`,f&&(i.style.opacity=L==="reverse"?`${1-d}`:`${d}`),Ae&&Ce?i.style.stroke=rt(Ae,Ce,d):Ce&&(i.style.stroke=Ce),he!==null&&Ie!==null?i.style.strokeWidth=`${he+(Ie-he)*d}`:Ie!==null&&(i.style.strokeWidth=`${Ie}`),Pe!==null&&be!==null?i.style.fillOpacity=`${Pe+(be-Pe)*d}`:be!==null&&(i.style.fillOpacity=`${be}`),R&&i.tagName.toLowerCase()==="path"&&K[c]&&i.setAttribute("d",Ar(K[c],R,d));}function pt(){if(e.style.setProperty("--scroll-draw-progress","0"),b){e.style.clipPath=$e(y==="reverse"?1:0);return}l.forEach((i,c)=>{i.style.strokeDasharray=`${m[c]}`,i.style.strokeDashoffset=y==="reverse"?"0":`${m[c]}`,f?i.style.opacity=y==="reverse"?"1":"0":i.style.opacity="",Ae&&(i.style.stroke=Ae),he!==null&&(i.style.strokeWidth=`${he}`),Pe!==null&&(i.style.fillOpacity=`${Pe}`),R&&i.tagName.toLowerCase()==="path"&&K[c]&&i.setAttribute("d",K[c]);});}function Be(i,c){let d=i.getAttribute("d"),L=tt(i);if(R&&K[c]){i.setAttribute("d",R);let J=tt(i);i.setAttribute("d",K[c]),L=Math.max(tt(i),J),i.setAttribute("d",d);}m[c]=L,i.style.strokeDasharray=`${L}`;}if(l.forEach((i,c)=>{xr(i);let d=i.tagName.toLowerCase()==="path";d?K.push(i.getAttribute("d")??""):K.push(""),Be(i,c);let L=m[c];R&&(d?Lr(K[K.length-1],R,i):ae(`morphTo only applies to <path> elements \u2014 ignored on <${i.tagName}>.`,i)),t?(i.style.strokeDashoffset=y==="reverse"?`${L}`:"0",f&&(i.style.opacity="1"),Ce&&(i.style.stroke=Ce),Ie!==null&&(i.style.strokeWidth=`${Ie}`),be!==null&&(i.style.fillOpacity=`${be}`),R&&i.tagName.toLowerCase()==="path"&&i.setAttribute("d",R)):(i.style.strokeDashoffset=y==="reverse"?"0":`${L}`,f?i.style.opacity=y==="reverse"?"1":"0":i.style.opacity="",Ae&&(i.style.stroke=Ae),he!==null&&(i.style.strokeWidth=`${he}`),Pe!==null&&(i.style.fillOpacity=`${Pe}`));}),t)return b&&(e.style.clipPath=$e(1)),_?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};b&&(e.style.clipPath=$e(y==="reverse"?1:0));let Pt=typeof p=="string"?nt(p):null;function cr(){return !(P===false||Y||j&&Ge||!Tr()||!l.length||!Pt||b||w!=="y"||X||u!==1||x!==0||H||ue||C!==false||R||v||q||I>0||Se||U||_||fe||Te||ge||me||M!=null||A!=null||$!=null||(g.start||"top bottom").trim()!=="top bottom"||(g.end||"bottom top").trim()!=="bottom top")}function ur(){let i=++Sr,c=`svg-scroll-draw-${i}`,d=`svg-scroll-draw-host-${i}`,L=`--svg-scroll-draw-${i}`,J=y==="reverse"?"0":"var(--ssd-len)",le=y==="reverse"?"var(--ssd-len)":"0",re=`stroke-dashoffset:${J};`,z=`stroke-dashoffset:${le};`;f&&(re+=`opacity:${y==="reverse"?1:0};`,z+=`opacity:${y==="reverse"?0:1};`);let G=document.createElement("style");G.setAttribute("data-svg-scroll-draw",""),G.textContent=`@keyframes ${c}{from{${re}}to{${z}}}.${d}{view-timeline-name:${L};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Pt};animation-fill-mode:both;animation-timeline:${L};animation-range:cover 0% cover 100%;}`,document.head.appendChild(G),e.classList.add(d);function se(T,k){T.style.setProperty("--ssd-len",String(m[k])),T.style.strokeDasharray=`${m[k]}`,T.style.strokeDashoffset="",T.style.opacity="",T.style.animationPlayState="",T.classList.add(c);}l.forEach(se);let ne=false,ce=-1;function de(){if(ce>=0)return ce;let T=e.getBoundingClientRect(),{tStart:k,tEnd:oe}=we({top:T.top,height:T.height},Je(),Mt(),ye,De);return S(B(Je(),k,oe,u))}return {destroy(){e.classList.remove(d),l.forEach(T=>{T.classList.remove(c),T.style.removeProperty("--ssd-len"),T.style.animationPlayState="";}),G.remove();},replay(){ne=false,ce=-1,l.forEach(se);},pause(){ne=true,l.forEach(T=>{T.style.animationPlayState="paused";});},resume(){ne&&(ne=false,l.forEach(T=>{T.style.animationPlayState="running";}));},seek(T){let k=Math.min(1,Math.max(0,T));ce=k,ne=true,l.forEach((oe,He)=>{oe.classList.remove(c),oe.style.strokeDashoffset=y==="reverse"?`${m[He]*k}`:`${m[He]*(1-k)}`,f&&(oe.style.opacity=y==="reverse"?`${1-k}`:`${k}`);});},getProgress(){return de()},refresh(){l.forEach((T,k)=>{Be(T,k),T.style.setProperty("--ssd-len",String(m[k]));});}}}if(cr())return ft(ur());function fr(){let i=Math.max(1,h),c=b?i:i*(1+Math.max(0,l.length-1)*x),d=0,L=0,J=false;function le(ce){let de=true,T=Math.min(1,Math.max(0,ce/c));if(b){let k=Math.min(1,Math.max(0,ce/i)),oe=S(k);xe=oe,e.style.setProperty("--scroll-draw-progress",String(oe)),e.style.clipPath=$e(y==="reverse"?1-oe:oe),Se?.(oe),k<1&&(de=false);}else {l.forEach((oe,He)=>{let pr=He*x*i,Dt=Math.min(1,Math.max(0,(ce-pr)/i));mt(oe,He,S(Dt),y),Dt<1&&(de=false);});let k=S(T);xe=k,Se?.(k),e.style.setProperty("--scroll-draw-progress",String(k));}if(v){let k=S(T);for(let oe in v){let He=parseFloat(oe);k>=He&&!_e.has(He)&&(_e.add(He),v[oe]?.());}}return de}function re(ce){if(pe)return;let de=ce-d;Oe||(Oe=true,U?.());let T=le(de);if(T&&!Z){Z=true,le(c),_?.(),Ve<(q==="infinite"?1/0:q??0)&&(Ve++,Fe=setTimeout(()=>{d=performance.now(),Oe=false,Z=false,_e.clear(),pt(),ke=requestAnimationFrame(re);},V));return}T||(ke=requestAnimationFrame(re));}function z(){cancelAnimationFrame(ke),clearTimeout(Fe),d=performance.now(),L=0,pe=false,Oe=false,Z=false,Ve=0,J=true,xe=0,_e.clear(),pt(),ke=requestAnimationFrame(re);}let G=new IntersectionObserver(ce=>{ce.forEach(de=>{de.isIntersecting&&!(H&&Z)?z():!de.isIntersecting&&!H&&!Z&&(cancelAnimationFrame(ke),clearTimeout(Fe),J=false);});},{root:X??null,threshold:N,rootMargin:te}),se;function ne(){clearTimeout(se),se=setTimeout(()=>l.forEach(Be),150);}return window.addEventListener("resize",ne),window.addEventListener("orientationchange",ne),I>0?setTimeout(()=>G.observe(e),I):G.observe(e),{destroy(){cancelAnimationFrame(ke),clearTimeout(Fe),G.disconnect(),window.removeEventListener("resize",ne),window.removeEventListener("orientationchange",ne),clearTimeout(se);},replay(){Ve=0,z();},pause(){pe||!J||(pe=true,L=performance.now()-d,cancelAnimationFrame(ke));},resume(){pe&&(pe=false,J=true,d=performance.now()-L,ke=requestAnimationFrame(re));},seek(ce){let de=Math.min(1,Math.max(0,ce));xe=de,pe=true,L=de*c,d=performance.now()-L,cancelAnimationFrame(ke),le(L);},getProgress(){return xe},refresh(){clearTimeout(se),l.forEach(Be);}}}if(Y)return ft(fr());At();let $t=()=>B(Je(),W,Ne,1);function Ot(){Z=true,_?.(),Ve<(q==="infinite"?1/0:q)&&(Ve++,Fe=setTimeout(()=>{ct=true;},V));}function kt(){lt=-1,Xe=[],Oe=false,Z=false,ct=false,_e.clear(),pt(),We=true;}function mr(){let i=performance.now(),c=Je();if(ct&&$t()%1&&kt(),!We&&C===false&&c===Tt)return;We=false,Tt=c;let d=u;if(C!==false){let z=i-xt,G=z>0?Math.abs(c-(Ze<0?c:Ze))/z:0;d=u*Math.max(.2,1+G*(typeof C=="number"?C:1)*.04);}Ze=c,xt=i;let L=ue?Ke===-1||c>=Ke?"forward":"reverse":y;Ke=c;let J=F-O,le=true,re=J===0?0:(c-O)/J;if(isNaN(ze)||(ze<=0&&re>0&&fe?.(),ze<1&&re>=1&&Te?.(),ze>=1&&re<1&&ge?.(),ze>0&&re<=0&&me?.()),ze=re,b){let z=Ct(0,B(c,O,F,d));xe=z,e.style.setProperty("--scroll-draw-progress",String(z));let G=L==="reverse"?1-z:z;e.style.clipPath=$e(G),Se?.(z),!Oe&&B(c,O,F,d)>0&&(Oe=true,U?.()),z>=1&&!Z?Ot():z<1&&!H&&(Z=false);return}if(l.forEach((z,G)=>{let se=G*Q*J,ne=Ct(G,B(c,O+se,F+se,d));mt(z,G,ne,L),G===0&&(xe=ne,Se?.(ne),e.style.setProperty("--scroll-draw-progress",String(ne))),ne<1&&(le=false);}),v){let z=S(B(c,O,F,d));for(let G in v){let se=parseFloat(G);z>=se&&!_e.has(se)&&(_e.add(se),v[G]?.());}}!Oe&&B(c,O,F,d)>0&&(Oe=true,U?.()),le&&!Z?Ot():!le&&!H&&(Z=false);}let je=Me(X??window,[e],$t,mr,()=>{let i=m.join();l.forEach(Be),At(),We=true,m.join()!==i&&qe();}),dt=I>0;function qe(){je.hold(pe||dt);}let Ht;return dt&&(Ht=setTimeout(()=>{dt=false,qe();},I)),qe(),ft({destroy(){clearTimeout(Fe),clearTimeout(Ht),je.off(),St();},replay(){kt(),Ke=-1,Ze=-1,Ve=0,pe=false,xe=0,clearTimeout(Fe),qe();},pause(){pe=true,je.hold(true);},resume(){pe&&(pe=false,We=true,qe());},seek(i){let c=Math.min(1,Math.max(0,i));xe=c,lt=c,Xe=[],pe=true,je.hold(true),lr(c,y),We=true;},getProgress(){return xe},refresh:je.remeasure},()=>({tStart:O,tEnd:F}))}var Ut=new WeakMap,Pr=0;function Xt(e){return JSON.stringify(e,(n,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let r=Ut.get(t);return r===void 0&&Ut.set(t,r=++Pr),`el#${r}`}return t})}function Kt(e,n){let t={...e};for(let r of Object.keys(t))typeof t[r]=="function"&&(t[r]=(...o)=>n()[r]?.(...o));return t}function $r(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Zt(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let o=[],s=[],a=r[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let f=u.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(f?parseFloat(f[1]):0),s.push(f?f[2]:"");}n.push({fn:r[1],nums:o,units:s});}return n}function Or(e,n,t){let r=Zt(e),o=Zt(n);return r.length===0||r.length!==o.length?t<1?e:n:r.map((s,a)=>{let u=o[a];return s.fn!==u.fn||s.nums.length!==u.nums.length?t<1?`${s.fn}(${s.nums.map((f,p)=>`${f}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((f,p)=>`${f}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((f,p)=>`${f+(u.nums[p]-f)*t}${s.units[p]}`).join(", ")})`}).join(" ")}function Jt(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),o=String(n);if($r(r))return rt(r,o,t);if(r.includes("("))return Or(r,o,t);let s=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let u=parseFloat(s[1]),f=parseFloat(a[1]);return `${u+(f-u)*t}${s[2]||a[2]}`}return t<1?r:o}function kr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Hr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Dr=0,er="--scroll-draw-progress";function Ir(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var rr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n){return typeof window>"u"?rr:n.respectReducedMotion===false?tr(e,n,false):Re(n,(t,r)=>tr(e,t,r))}function tr(e,n,t){let{props:r,trigger:o={},easing:s="ease-out",speed:a=1,once:u=false,axis:f="y",scrollContainer:p,native:g=true,velocityScale:x=false,triggerElement:y,onProgress:H,onComplete:j,onEnter:w,onLeave:D,onEnterBack:ue,onLeaveBack:I}=n,M=typeof s=="function"?s:ee[s]??ee["ease-out"],A=ie(o.start||"top bottom"),$=ie(o.end||"bottom top"),v=y??e,C=typeof p=="string"?document.querySelector(p):p??null,N=Object.entries(r).map(([l,m])=>({prop:kr(l),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function te(){let l=window.getComputedStyle(e);for(let m of N)m.from===""&&(m.from=l.getPropertyValue(m.prop).trim()||"0");}function q(){for(let l of N)e.style.setProperty(l.prop,String(l.to));}let V=new Map;for(let l of [...N.map(m=>m.prop),er])V.set(l,e.style.getPropertyValue(l));function R(){for(let[l,m]of V)m?e.style.setProperty(l,m):e.style.removeProperty(l);}if(t)return q(),j?.(),{...rr,destroy:R,getProgress:()=>1};te();let E=()=>C?f==="x"?C.scrollLeft:C.scrollTop:f==="x"?window.scrollX:window.scrollY,Y=()=>C?f==="x"?C.clientWidth:C.clientHeight:f==="x"?window.innerWidth:window.innerHeight,h=typeof s=="string"?nt(s):null;function P(){if(!g||!Ir()||!h||f!=="y"||C||v!==e||u||a!==1||H||j||w||D||ue||I||x!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of N)if(!Hr.has(l.prop))return false;return true}function Se(){let l=`ssd-a-${++Dr}`,m=N.map(W=>`${W.prop}:${W.from}`).join(";"),K=N.map(W=>`${W.prop}:${W.to}`).join(";"),O=document.createElement("style");O.setAttribute("data-ssd-animate",""),O.textContent=`@keyframes ${l}{from{${m}}to{${K}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${h};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(O),e.classList.add(l);let F=()=>{let W=e.getBoundingClientRect();return we({top:W.top,height:W.height},E(),Y(),A,$)};ve(e,{type:"animate",getProgress:()=>Q.getProgress(),getTrigger:F});let Q={refresh(){},destroy(){e.classList.remove(l),O.remove(),e.style.animationPlayState="",R(),Ee(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(W){let Ne=Math.min(1,Math.max(0,W));e.classList.remove(l);for(let Z of N)e.style.setProperty(Z.prop,Jt(Z.from,Z.to,Ne));},getProgress(){let{tStart:W,tEnd:Ne}=F();return M(B(E(),W,Ne,a))}};return Q}if(P())return Se();let U=0,_=0,fe=false,Te=-1,ge=0,me=0,b=false,S=NaN,ye=-1,De=0,X=v===e?N:[],Ae=false;function Ce(){let l=e.style,m=X.map(Q=>l.getPropertyValue(Q.prop)),K=l.transition;X.length&&(l.transition="none"),X.forEach(Q=>l.setProperty(Q.prop,V.get(Q.prop)??""));let O=et(v,C,f);X.forEach((Q,W)=>l.setProperty(Q.prop,m[W])),X.length&&(e.offsetWidth,l.transition=K);let F=we(O,O.scroll,Y(),A,$);Ae&&Math.abs(F.tStart-U)<1&&Math.abs(F.tEnd-_)<1||(Ae=true,U=F.tStart,_=F.tEnd);}function he(l){e.style.setProperty(er,String(l));for(let m of N)e.style.setProperty(m.prop,Jt(m.from,m.to,l));H?.(l);}function Ie(l){if(isNaN(S)){S=l;return}S<=0&&l>0&&w?.(),S<1&&l>=1&&D?.(),S>=1&&l<1&&ue?.(),S>0&&l<=0&&I?.(),S=l;}function Pe(){if(fe)return;let l=performance.now(),m=E(),K=a;if(x!==false){let W=l-De,Ne=W>0?Math.abs(m-(ye<0?m:ye))/W:0;K=a*Math.max(.2,1+Ne*(typeof x=="number"?x:1)*.04);}ye=m,De=l;let O=_===U?0:(m-U)/(_-U);Ie(O);let F=B(m,U,_,K),Q=u?Math.max(Te,M(ge=Math.max(ge,F))):M(F);me=Q,he(Q),Q>=1&&!b?(b=true,j?.()):Q<1&&!u&&(b=false);}let be=Me(C??window,[v],()=>B(E(),U,_,Math.min(a,1)),Pe,Ce);Ce(),_===U&&ae("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ge=B(E(),U,_,a),me=M(ge),he(me),ve(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:U,tEnd:_})});function $e(){fe=true,be.hold(true);}return {destroy(){fe=true,be.off(),R(),Ee(e);},replay(){Te=-1,ge=0,b=false,me=0,fe=false,he(0),be.hold(false);},pause:$e,resume(){fe&&(fe=false,be.hold(false));},seek(l){let m=Math.min(1,Math.max(0,l));me=m,Te=m,ge=0,$e(),he(m);},getProgress(){return me},refresh:be.remeasure}}var ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bt(e,n){if(typeof window>"u")return ht;let t=typeof e=="string"?document.querySelector(e):e;return t?Re(n,(r,o)=>Nr(t,r,o)):(ae("scrollCounter: element not found:",e),ht)}function Nr(e,n,t){let{from:r=0,to:o,format:s,easing:a="ease-out",trigger:u={},once:f=true,decimals:p,onComplete:g}=n,x=p!==void 0?h=>h.toFixed(p):s??(h=>String(Math.round(h))),y=typeof a=="function"?a:ee[a]??ee["ease-out"],H=ie(u.start||"top 80%"),j=ie(u.end||"top 20%");if(t)return e.textContent=x(o),g?.(),{...ht,getProgress:()=>1};let w=0,D=0,ue=false,I=-1,M=0,A=0,$=false,v=()=>window.scrollY,C=()=>window.innerHeight;function N(){let h=e.getBoundingClientRect(),P=we({top:h.top,height:h.height},v(),C(),H,j);ue&&Math.abs(P.tStart-w)<1&&Math.abs(P.tEnd-D)<1||(ue=true,w=P.tStart,D=P.tEnd);}let te=e.style.getPropertyValue("--scroll-draw-progress");function q(h){e.textContent=x(r+(o-r)*h),e.style.setProperty("--scroll-draw-progress",String(h));}let V=()=>B(v(),w,D,1);function R(){let h=V(),P=f?Math.max(I,y(M=Math.max(M,h))):y(h);A=P,q(P),P>=1&&!$?($=true,g?.()):P<1&&!f&&($=false);}N();{M=B(v(),w,D,1);let h=y(M);A=h,q(h);}let E=Me(window,[e],V,R,N);ve(e,{type:"counter",getProgress:()=>A,getTrigger:()=>({tStart:w,tEnd:D})});let Y=()=>E.hold(false);return {destroy(){E.off(),e.style.setProperty("--scroll-draw-progress",te),Ee(e);},replay(){I=-1,M=0,$=false,A=0,q(0),Y();},pause:()=>E.hold(true),resume:Y,seek(h){let P=Math.min(1,Math.max(0,h));A=P,I=P,M=0,E.hold(true),q(P);},getProgress(){return A}}}var nr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,n={}){if(typeof window>"u")return nr;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return ae("scrollVideo: <video> element not found:",e),nr;let r=t,{trigger:o={},easing:s="linear",once:a=false,axis:u="y",preload:f="auto",triggerElement:p,onReady:g,onComplete:x,onProgress:y}=n,H=p??r,j=window.matchMedia("(prefers-reduced-motion: reduce)").matches,w=typeof s=="function"?s:ee[s]??ee.linear,D=ie(o.start||"top top"),ue=ie(o.end||"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=f);let I=n.from??0,M=n.to,A=0,$=0,v=false,C=-1,N=0,te=0,q=false,V=false,R=()=>u==="x"?window.scrollX:window.scrollY,E=()=>u==="x"?window.innerWidth:window.innerHeight;function Y(){let b=H.getBoundingClientRect(),S=u==="x"?b.left:b.top,ye=u==="x"?b.width:b.height,De=we({top:S,height:ye},R(),E(),D,ue);A=De.tStart,$=De.tEnd,V&&$===A&&ae("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r);}let h=NaN;function P(b){if(!V)return;let S=M??r.duration??0,ye=I+(S-I)*b;ye!==h&&(h=ye,r.currentTime=ye),r.style.setProperty("--scroll-draw-progress",String(b)),y?.(b);}let Se=()=>B(R(),A,$,1);function U(){if(!V||j)return;let b=Se(),S=a?Math.max(C,w(N=Math.max(N,b))):w(b);te=S,P(S),S>=1&&!q?(q=true,x?.()):S<1&&!a&&(q=false);}let _=Me(window,[H],Se,U,Y),fe=()=>_.hold(v||!V||j);fe();function Te(){if(V=true,M===void 0&&(M=r.duration),j){P(1),g?.();return}Y(),g?.(),v?P(te):fe();}r.readyState>=1?Te():r.addEventListener("loadedmetadata",Te,{once:true}),V||Y();let ge=j?()=>{}:ot(b=>{b&&(ge(),j=true,_.hold(true),P(1));});ve(r,{type:"video",getProgress:()=>te,getTrigger:()=>({tStart:A,tEnd:$})});function me(){v&&(v=false,fe());}return {destroy(){_.off(),r.removeEventListener("loadedmetadata",Te),ge(),Ee(r);},replay(){C=-1,N=0,q=false,te=0,h=NaN,P(0),me();},pause(){v=true,_.hold(true);},resume:me,seek(b){let S=Math.min(1,Math.max(0,b));te=S,C=S,N=0,v=true,_.hold(true),h=NaN,P(S);},getProgress(){return te}}}function or(e,n){let t=document.createElement("span");t.textContent=n,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function at(e=""){let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=e,n}function ir(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(t=>{let r=e.appendChild(at(t)),o=/^\s+$/.test(t);return o?r.style.whiteSpace="pre":r.style.display="inline-block",o?null:r}).filter(t=>t!==null)}function Rr(e){let n=e.textContent??"";e.textContent="";let t=[],r=null;for(let o of n){let s=at(o),a=o===" ";a?s.style.whiteSpace="pre":(s.style.display="inline-block",t.push(s)),a||o>"\u0DFF"?r=null:r||(r=e.appendChild(at()),r.style.cssText="display:inline-block;white-space:nowrap"),(r??e).appendChild(s);}return t}function sr(e){let n=ir(e),t=new Map;for(let s of n){let a=s.offsetTop;t.has(a)||t.set(a,[]),t.get(a).push(s);}let r=[],o=Array.from(t.keys()).sort((s,a)=>s-a);for(let s of o){let a=t.get(s),u=at();u.style.display="inline-block",a.forEach((f,p)=>{let g=f.nextElementSibling;u.appendChild(f),p<a.length-1&&g&&g.style.whiteSpace==="pre"&&u.appendChild(g);}),r.push(u);}return e.textContent="",r.forEach((s,a)=>{e.appendChild(s),a<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function Vr(e,n,t,r){if(t<=1||r===0)return e;r=Math.min(r,1/t);let o=(t-1)*r,s=n*r,a=s+(1-o);return a<=s?e>=s?1:0:Qe((e-s)/(a-s),0,1)}function Fr(e,n){let t=[];if(n?.y!==void 0&&t.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&t.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&t.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let r=n.scale+(1-n.scale)*e;t.push(`scale(${r})`);}return t.join(" ")}var vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Et(e,n={}){if(typeof window>"u")return vt;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return ae("scrollText: element not found:",e),vt;let r=t;return Re(n,(o,s)=>_r(r,o,s))}function _r(e,n,t){let{split:r="words",stagger:o=.04,easing:s="ease-out",from:a={opacity:0,y:24},trigger:u={},once:f=true,onComplete:p}=n,g=typeof s=="function"?s:ee[s]??ee["ease-out"],x=ie(u.start||"top 85%"),y=ie(u.end||"top 40%"),H=e.innerHTML,j=e.textContent??"",w;r==="chars"?w=Rr(e):r==="lines"?w=sr(e):w=ir(e),or(e,j);let D=w.length;function ue(E,Y){a?.opacity!==void 0&&(E.style.opacity=String(a.opacity+(1-a.opacity)*Y));let h=Fr(Y,a);h&&(E.style.transform=h);}function I(E){e.style.setProperty("--scroll-draw-progress",String(E)),w.forEach((Y,h)=>{let P=g(Vr(E,h,D,o));ue(Y,P);});}if(t)return I(1),p?.(),{...vt,destroy:()=>{e.innerHTML=H;},getProgress:()=>1};I(0);let M=0,A=0,$=-1,v=0,C=false;function N(){({tStart:M,tEnd:A}=we(e.getBoundingClientRect(),window.scrollY,window.innerHeight,x,y));}let te=()=>B(window.scrollY,M,A,1);function q(){let E=f?$=Math.max($,te()):te();v=E,I(E),E>=1&&!C?(C=true,p?.()):E<1&&!f&&(C=false);}N();let V=Me(window,[e],te,q,()=>{r==="lines"&&(e.innerHTML=H,w=sr(e),or(e,j),I(v)),N();});ve(e,{type:"text",getProgress:()=>v,getTrigger:()=>({tStart:M,tEnd:A})});let R=()=>V.hold(false);return {destroy(){V.off(),e.innerHTML=H,Ee(e);},replay(){$=-1,C=false,v=0,I(0),R();},pause:()=>V.hold(true),resume:R,seek(E){V.hold(true),I(v=$=Qe(E,0,1));},getProgress(){return v}}}function Le(e,n){let t,r,o,s;return solidJs.createEffect(()=>{s=typeof e=="function"?e():e;let a=Xt(s);!t||a===o||(o=a,solidJs.untrack(()=>{r?.destroy(),r=n(t,Kt(s,()=>s));}));}),solidJs.onCleanup(()=>{r?.destroy(),r=o=void 0;}),{ref:a=>{t=a;},getInstance:()=>r}}function ao(e={}){return Le(e,gt).ref}function lo(e={}){return Le(e,gt)}function co(e){return Le(e,yt).ref}function uo(e){return Le(e,yt)}function fo(e){return Le(e,bt).ref}function mo(e){return Le(e,bt)}function po(e={}){return Le(e,wt).ref}function go(e={}){return Le(e,wt)}function yo(e={}){return Le(e,Et).ref}function ho(e={}){return Le(e,Et)}exports.createScrollAnimate=uo;exports.createScrollCounter=mo;exports.createScrollDraw=lo;exports.createScrollText=ho;exports.createScrollVideo=go;exports.useScrollAnimate=co;exports.useScrollCounter=fo;exports.useScrollDraw=ao;exports.useScrollText=yo;exports.useScrollVideo=po;
1
+ 'use strict';var solidJs=require('solid-js');var Ke=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function $(e,...n){Ke&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function Tr({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function xr({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(r),s=0,i=[];for(let g=0;g<t;g++){let w=Math.pow(o,g);i.push(w),s+=w;}let l=[0],m=0;for(let g=0;g<t;g++)m+=i[g]/s,l.push(m);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let w=0;w<t;w++)if(g<=l[w+1]){let P=(g-l[w])/(l[w+1]-l[w]);if(w===0)return P*(2-P);let S=1-Math.pow(r,w);return S+(1-S)*(2*P-1)*(2*P-1)}return 1}}function Lr({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),o=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-o)*(2*Math.PI)/r)+1}var Xe={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:Tr(),bounce:xr(),elastic:Lr()};function Ar(e,n,t,r){let o=(s,i,l)=>((1+3*s-3*i)*l+3*i-6*s)*l*l+3*s*l;return s=>{if(s<=0||s>=1)return +(s>0);let i=s;for(let l=0;l<8;l++)i-=(o(e,t,i)-s)/((3*(1+3*e-3*t)*i+6*t-12*e)*i+3*e);if(!(i>=0&&i<=1&&Math.abs(o(e,t,i)-s)<1e-9))for(let l=0,m=0,g=1;l<30;l++)i=(m+g)/2,o(e,t,i)<s?m=i:g=i;return o(n,r,i)}}function Et(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [Ar(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var _t=new Set;function Re(e,n="linear"){if(typeof e=="function")return e;if(e==null)return Xe[n];if({}.hasOwnProperty.call(Xe,e))return Xe[e];let t=Et(String(e));return t?t[0]:(!_t.has(e)&&_t.add(e)&&$(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),Xe[n])}function rt(e,n,t){return Math.min(t,Math.max(n,e))}function ae(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}var Gt=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function zt(e,n,t,r){return e+t+n*Gt(r,0)}function Wt(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Gt(e,1))}function Y(e,n,t,r){return t===n?0:rt((e-n)/(t-n)*r,0,1)}function Le(e,n,t,r,o){let s=zt(e.top,e.height,n,r.element)-Wt(r.viewport,t),i=zt(e.top,e.height,n,o.element)-Wt(o.viewport,t);return {tStart:s,tEnd:i}}function lt(e,n,t){let r=e.getBoundingClientRect(),o=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:o,scroll:0}:{top:t==="x"?r.left:r.top,height:o,scroll:t==="x"?window.scrollX:window.scrollY}}function ct(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let t=e.tagName.toLowerCase();if(t==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(r+o)}if(t==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function ut(e){return `${e} ${e*2}`}function Bt(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 ft(e,n,t){let r=Bt(e),o=Bt(n);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*t)},${Math.round(r[1]+(o[1]-r[1])*t)},${Math.round(r[2]+(o[2]-r[2])*t)})`}var qt={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 Cr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Pr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",jt=33;function Or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function $r(e){let n=[];for(let t=0;t<jt;t++){let r=t/(jt-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function mt(e){switch(e){case "linear":return "linear";case "ease-in":return Cr;case "ease-out":return Pr;case "ease-in-out":return Or()?$r(Xe["ease-in-out"]):null;default:return Et(e)?.[1]??null}}var Ut=Symbol.for("svg-scroll-draw.registry");function Yt(){let e=globalThis;return e[Ut]||(e[Ut]=new Map)}function Oe(e,n){Yt().set(e,n);}function $e(e){Yt().delete(e);}function Je(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}function qe(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let t=n(e,false),r=Je(s=>{if(!s)return;r();let i=(t.getProgress?.()??0)>=1;t.destroy(),t=n(i?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(t))o[s]=(...i)=>t[s]?.(...i);return o.destroy=()=>{r(),t.destroy();},o}var nt,pt=new Set,dt=new WeakMap,ot=new Map,Qt=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function kr(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function Kt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();nt??(nt=new ResizeObserver(o=>{let s=false;for(let{target:i}of o)dt.get(i)!==Qt(i)&&(s=true),dt.set(i,"");s&&pt.forEach(i=>i());})),pt.add(t);let r=kr(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{dt.has(o)||dt.set(o,Qt(o)),ot.set(o,(ot.get(o)??0)+1),nt.observe(o);}),()=>{pt.delete(t)&&(r.forEach(o=>{let s=(ot.get(o)??1)-1;if(s)return void ot.set(o,s);ot.delete(o),nt?.unobserve(o);}),pt.size||(nt?.disconnect(),nt=void 0));}}function De(e,n,t,r,o){let s,i=NaN,l,m,g=()=>{s=0,r(),!l&&!s&&(i=t())>0&&i<1&&(s=requestAnimationFrame(g));},w=()=>{!s&&!l&&t()!==i&&(s=requestAnimationFrame(g));},P=z=>{l=z,cancelAnimationFrame(s),s=i=NaN,w();},S=()=>{clearTimeout(m),o(),w();},G=()=>{clearTimeout(m),m=setTimeout(S,150);},Q=Kt(n,G),v=z=>{e[z]("scroll",w,{passive:true}),window[z]("resize",G),window[z]("orientationchange",G);};return v("addEventListener"),w(),{hold:P,remeasure:S,off(){P(true),v("removeEventListener"),Q(),clearTimeout(m);}}}var Fr=0;function Hr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Xt(e,n){let t="";try{t=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return t||(e.getAttribute(n)??"").trim()}var Jt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Ir(e){if(!Ke)return;let n=Xt(e,"stroke");if(!n||n==="none"){$("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Jt.has(t)&&!Jt.has(Xt(e,"fill"))&&$("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Rr(e,n,t){let r=document.createElement("div");r.setAttribute("data-svg-scroll-draw-debug",""),r.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 o(){let s=t==="x"?window.scrollX:window.scrollY,i=e-s,l=n-s,m=t==="x";r.innerHTML=`
2
+ <div style="position:absolute;${m?`left:${i}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${i}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:${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(r),window.addEventListener("scroll",o,{passive:true}),o(),{el:r,destroy(){window.removeEventListener("scroll",o),r.remove();}}}var Zt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,er=/[MmLlHhVvCcSsQqTtAaZz]/g;function Dr(e,n,t){if(!Ke)return;let r=(e.match(er)??[]).join("").toUpperCase(),o=(n.match(er)??[]).join("").toUpperCase(),s=(e.match(Zt)??[]).length,i=(n.match(Zt)??[]).length;if(r!==o){$(`morphTo: command sequence differs (${r||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}s!==i&&$(`morphTo: coordinate count differs (${s} \u2192 ${i}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Nr(e,n,t){let r=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let i=parseFloat(s),l=r[o++]??i;return String(+(i+(l-i)*t).toFixed(4))})}function St(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:qe(n,(t,r)=>Vr(e,t,r))}function Vr(e,n,t){let{preset:r,...o}=n,s=r?{...qt[r],...o}:o,{selector:i="path, polyline, line, polygon, rect, circle",speed:l=1,fade:m=false,easing:g="linear",trigger:w={},stagger:P=0,direction:S="forward",once:G=false,debug:Q=false,axis:v="y",scrollContainer:z,autoReverse:Z=false,delay:O=0,strokeColor:C,strokeWidth:L,fillOpacity:k,waypoints:h,velocityScale:F=false,threshold:W=0,rootMargin:se="0px",repeat:K=0,repeatDelay:V=0,morphTo:R,clip:M,autoplay:X=false,duration:E=1e3,native:A=true,onProgress:he,onStart:D,onComplete:q,onEnter:ue,onLeave:Ee,onEnterBack:fe,onLeaveBack:ie}=s,T=M===true?"left":typeof M=="string"?M:false,x=Re(g),re=ae(w.start||"top bottom"),ke=ae(w.end||"bottom top"),J=typeof z=="string"?document.querySelector(z):z??null,Fe=Array.isArray(C)?C[0]:null,Se=Array.isArray(C)?C[1]:typeof C=="string"?C:null,ye=Array.isArray(L)?L[0]:null,_e=Array.isArray(L)?L[1]:typeof L=="number"?L:null,He=Array.isArray(k)?k[0]:null,Me=Array.isArray(k)?k[1]:typeof k=="number"?k:null;function Ae(a){let f=a*100;switch(T){case "right":return `inset(0 0 0 ${100-f}%)`;case "top":return `inset(0 0 ${100-f}% 0)`;case "bottom":return `inset(${100-f}% 0 0 0)`;case "center":return `circle(${a*150}% at 50% 50%)`;default:return `inset(0 ${100-f}% 0 0)`}}let c=T?[]:Array.from(e.querySelectorAll(i)),d=[],ne=[],H=0,_=0,B=P,j=0,Ne=0,oe=false,Ie=false,be=0,Ye=-1,je=[],Ue=-1,me=false,u=0,p=0,b,le=false,we=null;function ze(){we?.destroy(),we=null;}let Ce=new Set,We=NaN,Ge=true,it=-1,Pt=performance.now(),Qe=NaN;function at(){return J?v==="x"?J.scrollLeft:J.scrollTop:v==="x"?window.scrollX:window.scrollY}function Ot(){return J?v==="x"?J.clientWidth:J.clientHeight:v==="x"?window.innerWidth:window.innerHeight}function $t(){let a=lt(e,J,v);return Le(a,a.scroll,Ot(),re,ke)}function yr(){let a=_-H,f=c.length-1,y=J??document.documentElement,N=v==="x"?"Width":"Height";if(B=P,P>0&&f>0&&a>0){let pe=y[`scroll${N}`]-y[`client${N}`]-1-H-a/l;pe>=0&&(B=Math.min(P,pe/(f*a)));}let ce=Math.max(0,f)*B*a,Te=a/Math.min(l,1);j=H+Math.min(0,ce,Te,ce+Te),Ne=H+Math.max(0,ce,Te,ce+Te);}function kt(){(({tStart:H,tEnd:_}=$t())),yr(),Q&&Ke&&(ze(),we=Rr(H,_,v));}function yt(a,f=$t){Oe(e,{type:"draw",getProgress:()=>a.getProgress(),getTrigger:f});let y=a.destroy;return a.destroy=()=>{y.call(a),$e(e);},a}function Ft(a,f){return G&&!Z?Math.max(Ye,x(je[a]=Math.max(je[a]??0,f))):x(f)}function br(a,f){if(e.style.setProperty("--scroll-draw-progress",String(a)),T){let y=f==="reverse"?1-a:a;e.style.clipPath=Ae(y);return}c.forEach((y,N)=>bt(y,N,a,f));}function bt(a,f,y,N){a.style.strokeDashoffset=N==="reverse"?`${d[f]*y}`:`${d[f]*(1-y)}`,m&&(a.style.opacity=N==="reverse"?`${1-y}`:`${y}`),Fe&&Se?a.style.stroke=ft(Fe,Se,y):Se&&(a.style.stroke=Se),ye!==null&&_e!==null?a.style.strokeWidth=`${ye+(_e-ye)*y}`:_e!==null&&(a.style.strokeWidth=`${_e}`),He!==null&&Me!==null?a.style.fillOpacity=`${He+(Me-He)*y}`:Me!==null&&(a.style.fillOpacity=`${Me}`),R&&a.tagName.toLowerCase()==="path"&&ne[f]&&a.setAttribute("d",Nr(ne[f],R,y));}function wt(){if(e.style.setProperty("--scroll-draw-progress","0"),T){e.style.clipPath=Ae(S==="reverse"?1:0);return}c.forEach((a,f)=>{a.style.strokeDasharray=ut(d[f]),a.style.strokeDashoffset=S==="reverse"?"0":`${d[f]}`,m?a.style.opacity=S==="reverse"?"1":"0":a.style.opacity="",Fe&&(a.style.stroke=Fe),ye!==null&&(a.style.strokeWidth=`${ye}`),He!==null&&(a.style.fillOpacity=`${He}`),R&&a.tagName.toLowerCase()==="path"&&ne[f]&&a.setAttribute("d",ne[f]);});}function Ze(a,f){let y=a.getAttribute("d"),N=ct(a);if(R&&ne[f]){a.setAttribute("d",R);let ce=ct(a);a.setAttribute("d",ne[f]),N=Math.max(ct(a),ce),a.setAttribute("d",y);}d[f]=N,a.style.strokeDasharray=ut(N);}if(c.forEach((a,f)=>{Ir(a);let y=a.tagName.toLowerCase()==="path";y?ne.push(a.getAttribute("d")??""):ne.push(""),Ze(a,f);let N=d[f];R&&(y?Dr(ne[ne.length-1],R,a):$(`morphTo only applies to <path> elements \u2014 ignored on <${a.tagName}>.`,a)),t?(a.style.strokeDashoffset=S==="reverse"?`${N}`:"0",m&&(a.style.opacity="1"),Se&&(a.style.stroke=Se),_e!==null&&(a.style.strokeWidth=`${_e}`),Me!==null&&(a.style.fillOpacity=`${Me}`),R&&a.tagName.toLowerCase()==="path"&&a.setAttribute("d",R)):(a.style.strokeDashoffset=S==="reverse"?"0":`${N}`,m?a.style.opacity=S==="reverse"?"1":"0":a.style.opacity="",Fe&&(a.style.stroke=Fe),ye!==null&&(a.style.strokeWidth=`${ye}`),He!==null&&(a.style.fillOpacity=`${He}`));}),t)return T&&(e.style.clipPath=Ae(1)),q?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};T&&(e.style.clipPath=Ae(S==="reverse"?1:0));let Ht=typeof g=="string"?mt(g):null;function wr(){return !(A===false||X||Q&&Ke||!Hr()||!c.length||!Ht||T||v!=="y"||J||l!==1||P!==0||G||Z||F!==false||R||h||K||O>0||he||D||q||ue||Ee||fe||ie||C!=null||L!=null||k!=null||(w.start||"top bottom").trim()!=="top bottom"||(w.end||"bottom top").trim()!=="bottom top")}function vr(){let a=++Fr,f=`svg-scroll-draw-${a}`,y=`svg-scroll-draw-host-${a}`,N=`--svg-scroll-draw-${a}`,ce=S==="reverse"?"0":"var(--ssd-len)",Te=S==="reverse"?"var(--ssd-len)":"0",pe=`stroke-dashoffset:${ce};`,ee=`stroke-dashoffset:${Te};`;m&&(pe+=`opacity:${S==="reverse"?1:0};`,ee+=`opacity:${S==="reverse"?0:1};`);let te=document.createElement("style");te.setAttribute("data-svg-scroll-draw",""),te.textContent=`@keyframes ${f}{from{${pe}}to{${ee}}}.${y}{view-timeline-name:${N};view-timeline-axis:block;}.${f}{animation-name:${f};animation-duration:auto;animation-timing-function:${Ht};animation-fill-mode:both;animation-timeline:${N};animation-range:cover 0% cover 100%;}`,document.head.appendChild(te),e.classList.add(y);function ve(I,U){I.style.setProperty("--ssd-len",String(d[U])),I.style.strokeDasharray=ut(d[U]),I.style.strokeDashoffset="",I.style.opacity="",I.style.animationPlayState="",I.classList.add(f);}c.forEach(ve);let de=false,xe=-1;function Pe(){if(xe>=0)return xe;let I=e.getBoundingClientRect(),{tStart:U,tEnd:ge}=Le({top:I.top,height:I.height},at(),Ot(),re,ke);return x(Y(at(),U,ge,l))}return {destroy(){e.classList.remove(y),c.forEach(I=>{I.classList.remove(f),I.style.removeProperty("--ssd-len"),I.style.animationPlayState="";}),te.remove();},replay(){de=false,xe=-1,c.forEach(ve);},pause(){de=true,c.forEach(I=>{I.style.animationPlayState="paused";});},resume(){de&&(de=false,c.forEach(I=>{I.style.animationPlayState="running";}));},seek(I){let U=Math.min(1,Math.max(0,I));xe=U,de=true,c.forEach((ge,Be)=>{ge.classList.remove(f),ge.style.strokeDashoffset=S==="reverse"?`${d[Be]*U}`:`${d[Be]*(1-U)}`,m&&(ge.style.opacity=S==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return Pe()},refresh(){c.forEach((I,U)=>{Ze(I,U),I.style.setProperty("--ssd-len",String(d[U]));});}}}if(wr())return yt(vr());function Er(){let a=Math.max(1,E),f=T?a:a*(1+Math.max(0,c.length-1)*P),y=0,N=0,ce=false;function Te(xe){let Pe=true,I=Math.min(1,Math.max(0,xe/f));if(T){let U=Math.min(1,Math.max(0,xe/a)),ge=x(U);u=ge,e.style.setProperty("--scroll-draw-progress",String(ge)),e.style.clipPath=Ae(S==="reverse"?1-ge:ge),he?.(ge),U<1&&(Pe=false);}else {c.forEach((ge,Be)=>{let Mr=Be*P*a,Vt=Math.min(1,Math.max(0,(xe-Mr)/a));bt(ge,Be,x(Vt),S),Vt<1&&(Pe=false);});let U=x(I);u=U,he?.(U),e.style.setProperty("--scroll-draw-progress",String(U));}if(h){let U=x(I);for(let ge in h){let Be=parseFloat(ge);U>=Be&&!Ce.has(Be)&&(Ce.add(Be),h[ge]?.());}}return Pe}function pe(xe){if(me)return;let Pe=xe-y;Ie||(Ie=true,D?.());let I=Te(Pe);if(I&&!oe){oe=true,Te(f),q?.(),p<(K==="infinite"?1/0:K??0)&&(p++,b=setTimeout(()=>{y=performance.now(),Ie=false,oe=false,Ce.clear(),wt(),be=requestAnimationFrame(pe);},V));return}I||(be=requestAnimationFrame(pe));}function ee(){cancelAnimationFrame(be),clearTimeout(b),y=performance.now(),N=0,me=false,Ie=false,oe=false,p=0,ce=true,u=0,Ce.clear(),wt(),be=requestAnimationFrame(pe);}let te=new IntersectionObserver(xe=>{xe.forEach(Pe=>{Pe.isIntersecting&&!(G&&oe)?ee():!Pe.isIntersecting&&!G&&!oe&&(cancelAnimationFrame(be),clearTimeout(b),ce=false);});},{root:J??null,threshold:W,rootMargin:se}),ve;function de(){clearTimeout(ve),ve=setTimeout(()=>c.forEach(Ze),150);}return window.addEventListener("resize",de),window.addEventListener("orientationchange",de),O>0?setTimeout(()=>te.observe(e),O):te.observe(e),{destroy(){cancelAnimationFrame(be),clearTimeout(b),te.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),clearTimeout(ve);},replay(){p=0,ee();},pause(){me||!ce||(me=true,N=performance.now()-y,cancelAnimationFrame(be));},resume(){me&&(me=false,ce=true,y=performance.now()-N,be=requestAnimationFrame(pe));},seek(xe){let Pe=Math.min(1,Math.max(0,xe));u=Pe,me=true,N=Pe*f,y=performance.now()-N,cancelAnimationFrame(be),Te(N);},getProgress(){return u},refresh(){clearTimeout(ve),c.forEach(Ze);}}}if(X)return yt(Er());kt();let It=()=>Y(at(),j,Ne,1);function Rt(){oe=true,q?.(),p<(K==="infinite"?1/0:K)&&(p++,b=setTimeout(()=>{le=true;},V));}function Dt(){Ye=-1,je=[],Ie=false,oe=false,le=false,Ce.clear(),wt(),Ge=true;}function Sr(){let a=performance.now(),f=at();if(le&&It()%1&&Dt(),!Ge&&F===false&&f===We)return;Ge=false,We=f;let y=l;if(F!==false){let ee=a-Pt,te=ee>0?Math.abs(f-(it<0?f:it))/ee:0;y=l*Math.max(.2,1+te*(typeof F=="number"?F:1)*.04);}it=f,Pt=a;let N=Z?Ue===-1||f>=Ue?"forward":"reverse":S;Ue=f;let ce=_-H,Te=true,pe=ce===0?0:(f-H)/ce;if(isNaN(Qe)||(Qe<=0&&pe>0&&ue?.(),Qe<1&&pe>=1&&Ee?.(),Qe>=1&&pe<1&&fe?.(),Qe>0&&pe<=0&&ie?.()),Qe=pe,T){let ee=Ft(0,Y(f,H,_,y));u=ee,e.style.setProperty("--scroll-draw-progress",String(ee));let te=N==="reverse"?1-ee:ee;e.style.clipPath=Ae(te),he?.(ee),!Ie&&Y(f,H,_,y)>0&&(Ie=true,D?.()),ee>=1&&!oe?Rt():ee<1&&!G&&(oe=false);return}if(c.forEach((ee,te)=>{let ve=te*B*ce,de=Ft(te,Y(f,H+ve,_+ve,y));bt(ee,te,de,N),te===0&&(u=de,he?.(de),e.style.setProperty("--scroll-draw-progress",String(de))),de<1&&(Te=false);}),h){let ee=x(Y(f,H,_,y));for(let te in h){let ve=parseFloat(te);ee>=ve&&!Ce.has(ve)&&(Ce.add(ve),h[te]?.());}}!Ie&&Y(f,H,_,y)>0&&(Ie=true,D?.()),Te&&!oe?Rt():!Te&&!G&&(oe=false);}let et=De(J??window,[e],It,Sr,()=>{let a=d.join();c.forEach(Ze),kt(),Ge=true,d.join()!==a&&tt();}),vt=O>0;function tt(){et.hold(me||vt);}let Nt;return vt&&(Nt=setTimeout(()=>{vt=false,tt();},O)),tt(),yt({destroy(){clearTimeout(b),clearTimeout(Nt),et.off(),ze();},replay(){Dt(),Ue=-1,it=-1,p=0,me=false,u=0,clearTimeout(b),tt();},pause(){me=true,et.hold(true);},resume(){me&&(me=false,Ge=true,tt());},seek(a){let f=Math.min(1,Math.max(0,a));u=f,Ye=f,je=[],me=true,et.hold(true),br(f,S),Ge=true;},getProgress(){return u},refresh:et.remeasure},()=>({tStart:H,tEnd:_}))}var tr=new WeakMap,_r=0;function st(e){return JSON.stringify(e,(n,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let r=tr.get(t);return r===void 0&&tr.set(t,r=++_r),`el#${r}`}return t})}function rr(e,n){let t={...e};for(let r of Object.keys(t))typeof t[r]=="function"&&(t[r]=(...o)=>n()[r]?.(...o));return t}function zr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function nr(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let o=[],s=[],i=r[2].trim();if(i)for(let l of i.split(/[\s,]+/)){let m=l.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:r[1],nums:o,units:s});}return n}function Wr(e,n,t){let r=nr(e),o=nr(n);return r.length===0||r.length!==o.length?t<1?e:n:r.map((s,i)=>{let l=o[i];return s.fn!==l.fn||s.nums.length!==l.nums.length?t<1?`${s.fn}(${s.nums.map((m,g)=>`${m}${s.units[g]}`).join(", ")})`:`${l.fn}(${l.nums.map((m,g)=>`${m}${l.units[g]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,g)=>`${m+(l.nums[g]-m)*t}${s.units[g]}`).join(", ")})`}).join(" ")}function or(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),o=String(n);if(zr(r))return ft(r,o,t);if(r.includes("("))return Wr(r,o,t);let s=r.match(/^([-+]?[\d.]+)(.*)$/),i=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&i){let l=parseFloat(s[1]),m=parseFloat(i[1]);return `${l+(m-l)*t}${s[2]||i[2]}`}return t<1?r:o}function Gr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Br=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),qr=0,sr="--scroll-draw-progress";function jr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ar={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mt(e,n){return typeof window>"u"?ar:n.respectReducedMotion===false?ir(e,n,false):qe(n,(t,r)=>ir(e,t,r))}function ir(e,n,t){let{props:r,trigger:o={},easing:s="ease-out",speed:i=1,once:l=false,axis:m="y",scrollContainer:g,native:w=true,velocityScale:P=false,triggerElement:S,onProgress:G,onComplete:Q,onEnter:v,onLeave:z,onEnterBack:Z,onLeaveBack:O}=n,C=Re(s,"ease-out"),L=ae(o.start||"top bottom"),k=ae(o.end||"bottom top"),h=S??e,F=typeof g=="string"?document.querySelector(g):g??null,W=Object.entries(r).map(([c,d])=>({prop:Gr(c),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function se(){let c=window.getComputedStyle(e);for(let d of W)d.from===""&&(d.from=c.getPropertyValue(d.prop).trim()||"0");}function K(){for(let c of W)e.style.setProperty(c.prop,String(c.to));}let V=new Map;for(let c of [...W.map(d=>d.prop),sr])V.set(c,e.style.getPropertyValue(c));function R(){for(let[c,d]of V)d?e.style.setProperty(c,d):e.style.removeProperty(c);}if(t)return K(),Q?.(),{...ar,destroy:R,getProgress:()=>1};se();let M=()=>F?m==="x"?F.scrollLeft:F.scrollTop:m==="x"?window.scrollX:window.scrollY,X=()=>F?m==="x"?F.clientWidth:F.clientHeight:m==="x"?window.innerWidth:window.innerHeight,E=typeof s=="string"?mt(s):null;function A(){if(!w||!jr()||!E||m!=="y"||F||h!==e||l||i!==1||G||Q||v||z||Z||O||P!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let c of W)if(!Br.has(c.prop))return false;return true}function he(){let c=`ssd-a-${++qr}`,d=W.map(j=>`${j.prop}:${j.from}`).join(";"),ne=W.map(j=>`${j.prop}:${j.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${c}{from{${d}}to{${ne}}}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${E};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(c);let _=()=>{let j=e.getBoundingClientRect();return Le({top:j.top,height:j.height},M(),X(),L,k)};Oe(e,{type:"animate",getProgress:()=>B.getProgress(),getTrigger:_});let B={refresh(){},destroy(){e.classList.remove(c),H.remove(),e.style.animationPlayState="",R(),$e(e);},replay(){e.classList.remove(c),e.offsetWidth,e.classList.add(c);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(j){let Ne=Math.min(1,Math.max(0,j));e.classList.remove(c);for(let oe of W)e.style.setProperty(oe.prop,or(oe.from,oe.to,Ne));},getProgress(){let{tStart:j,tEnd:Ne}=_();return C(Y(M(),j,Ne,i))}};return B}if(A())return he();let D=0,q=0,ue=false,Ee=-1,fe=0,ie=0,T=false,x=NaN,re=-1,ke=0,J=h===e?W:[],Fe=false;function Se(){let c=e.style,d=J.map(B=>c.getPropertyValue(B.prop)),ne=c.transition;J.length&&(c.transition="none"),J.forEach(B=>c.setProperty(B.prop,V.get(B.prop)??""));let H=lt(h,F,m);J.forEach((B,j)=>c.setProperty(B.prop,d[j])),J.length&&(e.offsetWidth,c.transition=ne);let _=Le(H,H.scroll,X(),L,k);Fe&&Math.abs(_.tStart-D)<1&&Math.abs(_.tEnd-q)<1||(Fe=true,D=_.tStart,q=_.tEnd);}function ye(c){e.style.setProperty(sr,String(c));for(let d of W)e.style.setProperty(d.prop,or(d.from,d.to,c));G?.(c);}function _e(c){if(isNaN(x)){x=c;return}x<=0&&c>0&&v?.(),x<1&&c>=1&&z?.(),x>=1&&c<1&&Z?.(),x>0&&c<=0&&O?.(),x=c;}function He(){if(ue)return;let c=performance.now(),d=M(),ne=i;if(P!==false){let j=c-ke,Ne=j>0?Math.abs(d-(re<0?d:re))/j:0;ne=i*Math.max(.2,1+Ne*(typeof P=="number"?P:1)*.04);}re=d,ke=c;let H=q===D?0:(d-D)/(q-D);_e(H);let _=Y(d,D,q,ne),B=l?Math.max(Ee,C(fe=Math.max(fe,_))):C(_);ie=B,ye(B),B>=1&&!T?(T=true,Q?.()):B<1&&!l&&(T=false);}let Me=De(F??window,[h],()=>Y(M(),D,q,Math.min(i,1)),He,Se);Se(),q===D&&$("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),fe=Y(M(),D,q,i),ie=C(fe),ye(ie),Oe(e,{type:"animate",getProgress:()=>ie,getTrigger:()=>({tStart:D,tEnd:q})});function Ae(){ue=true,Me.hold(true);}return {destroy(){ue=true,Me.off(),R(),$e(e);},replay(){Ee=-1,fe=0,T=false,ie=0,ue=false,ye(0),Me.hold(false);},pause:Ae,resume(){ue&&(ue=false,Me.hold(false));},seek(c){let d=Math.min(1,Math.max(0,c));ie=d,Ee=d,fe=0,Ae(),ye(d);},getProgress(){return ie},refresh:Me.remeasure}}var Tt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function xt(e,n){if(typeof window>"u")return Tt;let t=typeof e=="string"?document.querySelector(e):e;return t?qe(n,(r,o)=>Ur(t,r,o)):($("scrollCounter: element not found:",e),Tt)}function Ur(e,n,t){let{from:r=0,to:o,format:s,easing:i="ease-out",trigger:l={},once:m=true,decimals:g,onComplete:w}=n,P=g!==void 0?E=>E.toFixed(g):s??(E=>String(Math.round(E))),S=Re(i,"ease-out"),G=ae(l.start||"top 80%"),Q=ae(l.end||"top 20%");if(t)return e.textContent=P(o),w?.(),{...Tt,getProgress:()=>1};let v=0,z=0,Z=false,O=-1,C=0,L=0,k=false,h=()=>window.scrollY,F=()=>window.innerHeight;function W(){let E=e.getBoundingClientRect(),A=Le({top:E.top,height:E.height},h(),F(),G,Q);Z&&Math.abs(A.tStart-v)<1&&Math.abs(A.tEnd-z)<1||(Z=true,v=A.tStart,z=A.tEnd);}let se=e.style.getPropertyValue("--scroll-draw-progress");function K(E){e.textContent=P(r+(o-r)*E),e.style.setProperty("--scroll-draw-progress",String(E));}let V=()=>Y(h(),v,z,1);function R(){let E=V(),A=m?Math.max(O,S(C=Math.max(C,E))):S(E);L=A,K(A),A>=1&&!k?(k=true,w?.()):A<1&&!m&&(k=false);}W();{C=Y(h(),v,z,1);let E=S(C);L=E,K(E);}let M=De(window,[e],V,R,W);Oe(e,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:v,tEnd:z})});let X=()=>M.hold(false);return {destroy(){M.off(),e.style.setProperty("--scroll-draw-progress",se),$e(e);},replay(){O=-1,C=0,k=false,L=0,K(0),X();},pause:()=>M.hold(true),resume:X,seek(E){let A=Math.min(1,Math.max(0,E));L=A,O=A,C=0,M.hold(true),K(A);},getProgress(){return L}}}var lr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Lt(e,n={}){if(typeof window>"u")return lr;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return $("scrollVideo: <video> element not found:",e),lr;let r=t,{trigger:o={},easing:s="linear",once:i=false,axis:l="y",preload:m="auto",triggerElement:g,onReady:w,onComplete:P,onProgress:S}=n,G=g??r,Q=window.matchMedia("(prefers-reduced-motion: reduce)").matches,v=Re(s),z=ae(o.start||"top top"),Z=ae(o.end||"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=m);let O=n.from??0,C=n.to,L=0,k=0,h=false,F=-1,W=0,se=0,K=false,V=false,R=()=>l==="x"?window.scrollX:window.scrollY,M=()=>l==="x"?window.innerWidth:window.innerHeight;function X(){let T=G.getBoundingClientRect(),x=l==="x"?T.left:T.top,re=l==="x"?T.width:T.height,ke=Le({top:x,height:re},R(),M(),z,Z);L=ke.tStart,k=ke.tEnd,V&&k===L&&$("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r);}let E=NaN;function A(T){if(!V)return;let x=C??r.duration??0,re=O+(x-O)*T;re!==E&&(E=re,r.currentTime=re),r.style.setProperty("--scroll-draw-progress",String(T)),S?.(T);}let he=()=>Y(R(),L,k,1);function D(){if(!V||Q)return;let T=he(),x=i?Math.max(F,v(W=Math.max(W,T))):v(T);se=x,A(x),x>=1&&!K?(K=true,P?.()):x<1&&!i&&(K=false);}let q=De(window,[G],he,D,X),ue=()=>q.hold(h||!V||Q);ue();function Ee(){if(V=true,C===void 0&&(C=r.duration),Q){A(1),w?.();return}X(),w?.(),h?A(se):ue();}r.readyState>=1?Ee():r.addEventListener("loadedmetadata",Ee,{once:true}),V||X();let fe=Q?()=>{}:Je(T=>{T&&(fe(),Q=true,q.hold(true),A(1));});Oe(r,{type:"video",getProgress:()=>se,getTrigger:()=>({tStart:L,tEnd:k})});function ie(){h&&(h=false,ue());}return {destroy(){q.off(),r.removeEventListener("loadedmetadata",Ee),fe(),$e(r);},replay(){F=-1,W=0,K=false,se=0,E=NaN,A(0),ie();},pause(){h=true,q.hold(true);},resume:ie,seek(T){let x=Math.min(1,Math.max(0,T));se=x,F=x,W=0,h=true,q.hold(true),E=NaN,A(x);},getProgress(){return se}}}var Yr=1e4;function cr(e){let{frames:n,count:t}=e;if(typeof n!="function")return st(e);let r=Number.isFinite(t)?Math.min(Math.max(Math.floor(t),0),Yr):0,o;try{o=Array.from({length:r},(s,i)=>n(i));}catch{o=["throws"];}return st({...e,frames:o})}function ur(e,n="<ScrollFrames>"){if(!e||e.getAttribute("aria-hidden")==="true")return;let t=e.getAttribute("role");t==="presentation"||t==="none"||e.getAttribute("aria-label")||e.getAttribute("aria-labelledby")||$(`${n}: the canvas has no aria-label. Say what the frames show, or set aria-hidden="true" if they are decoration.`,e);}var gt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Qr(e){let n=e>1?[0,e-1]:[0],t=[[0,e-1]];for(let r=0;r<t.length;r++){let[o,s]=t[r];if(s-o<2)continue;let i=o+s>>1;n.push(i),t.push([o,i],[i,s]);}return n}function fr(e,n){if(typeof window>"u")return gt;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="canvas")return $("scrollFrames: <canvas> element not found:",e),gt;let r=t,{frames:o,trigger:s={},easing:i="linear",once:l=false,axis:m="y",fit:g="cover",triggerElement:w,onReady:P,onLoad:S,onComplete:G,onProgress:Q}=n||{},v=Array.isArray(o)?o:null,z=n?.count,Z=Math.floor(v?Math.min(z??v.length,v.length):z??NaN);if(!(v||typeof o=="function")||!Number.isFinite(Z)||Z<1)return $("scrollFrames: no frames. Pass `frames` as an array of URLs, or a function with a finite `count` of 1 or more.",r),gt;let O=n.concurrency??6;(!Number.isFinite(O)||O<1)&&($("scrollFrames: `concurrency` must be a finite number of 1 or more; using 6.",n.concurrency),O=6),O=Math.floor(O);let C=r.getContext("2d");if(!C)return $("scrollFrames: the canvas has no 2D context.",r),gt;let L=Z-1,k=w??r,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches,F=Re(i),W=u=>{let p=F(u);return p===p?p:0},se=ae(s.start||"top top"),K=ae(s.end||"bottom top"),V=0,R=0,M=false,X=-1,E=0,A=0,he=false,D=false,q=false,ue=false,Ee=0,fe=-1,ie=new Array(Z),T=new Uint8Array(Z),x=new Set,re=h?[L]:Qr(Z),ke=0,J=0,Fe=false,Se=(u,...p)=>{if(u)try{u(...p);}catch(b){typeof reportError=="function"?reportError(b):setTimeout(()=>{throw b});}},ye=false,_e=u=>{let p;try{p=v?v[u]:o(u);}catch(b){p=b;}return typeof p=="string"&&p?p:(ye||(ye=true,$(`scrollFrames: no URL for frame ${u}; it is skipped for its nearest neighbour.`,p)),null)},He=()=>m==="x"?window.scrollX:window.scrollY,Me=()=>m==="x"?window.innerWidth:window.innerHeight;function Ae(){!Fe&&J===re.length&&(Fe=true,Se(S));}function c(){for(;!D&&x.size<O&&ke<re.length;){let u=re[ke++];T[u]||d(u);}}function d(u){T[u]=1;let p=_e(u);if(p===null){J++,queueMicrotask(()=>{D||Ae();});return}let b=new Image,le=false,we=ze=>{le||D||(le=true,b.onload=b.onerror=null,x.delete(b),ze?ie[u]=b:$("scrollFrames: a frame failed to load; its nearest neighbour shows instead:",p),J++,c(),_(),Ae());};x.add(b),b.decoding="async",b.onerror=()=>we(false),b.src=p,typeof b.decode=="function"?b.decode().then(()=>we(true),()=>{b.complete?we(b.naturalWidth>0):b.onload=()=>we(true);}):b.onload=()=>we(true);}function ne(u){for(let p=0;p<=L;p++){if(ie[u-p])return u-p;if(ie[u+p])return u+p}return -1}function H(){let u=r.clientWidth,p=r.clientHeight;if(!u||!p)return;let b=Math.min(window.devicePixelRatio||1,2),le=Math.round(u*b),we=Math.round(p*b);if(Math.abs(r.width-le)<=1&&Math.abs(r.height-we)<=1)return;r.width=le,r.height=we,fe=-1;let ze=r.clientWidth,Ce=r.clientHeight;if(ze!==u||Ce!==p){let We=r.style;ze!==u&&Ce!==p?(We.width=`${u}px`,We.height=`${p}px`):We.aspectRatio=`${u} / ${p}`;}}function _(){let u=ne(Ee);if(u<0||u===fe)return;let p=ie[u],b=r.width,le=r.height,we=p.naturalWidth||b,ze=p.naturalHeight||le,Ce=(g==="contain"?Math.min:Math.max)(b/we,le/ze),We=we*Ce,Ge=ze*Ce;C.clearRect(0,0,b,le),C.drawImage(p,(b-We)/2,(le-Ge)/2,We,Ge),fe=u,q||(q=true,Se(P));}function B(u){Ee=Math.min(L,Math.max(0,Math.round(u*L))),r.style.setProperty("--scroll-draw-progress",String(u)),_(),Se(Q,u,Ee);}function j(){let u=k.getBoundingClientRect(),p=m==="x"?u.left:u.top,b=m==="x"?u.width:u.height,le=Le({top:p,height:b},He(),Me(),se,K);V=le.tStart,R=le.tEnd,R===V&&b>0&&!h&&!ue&&(ue=true,$("scrollFrames: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r));}let Ne=()=>Y(He(),V,R,1);function oe(){if(h)return;let u=Ne(),p=l?Math.max(X,W(E=Math.max(E,u))):W(u);A=p,B(p),p>=1&&!he?(he=true,Se(G)):p<1&&!l&&(he=false);}function Ie(){A=1,B(1);}H(),h||j();let be=De(window,[k],Ne,oe,()=>{H(),h||j(),_();}),Ye=()=>be.hold(M||h);Ye(),h&&Ie(),c();let je=typeof ResizeObserver=="function"?new ResizeObserver(()=>{H(),_();}):null;je?.observe(r);let Ue=h?()=>{}:Je(u=>{u&&(Ue(),h=true,be.hold(true),re=re.slice(0,ke),T[L]||re.push(L),Ae(),Ie(),c());});Oe(r,{type:"frames",getProgress:()=>A,getTrigger:()=>({tStart:V,tEnd:R})});function me(){D||!M||(M=false,Ye());}return {destroy(){if(!D){D=true,be.off(),je?.disconnect(),Ue();for(let u of x)u.onload=u.onerror=null,u.src="";x.clear(),$e(r);}},replay(){D||(X=-1,E=0,he=false,A=0,B(0),me());},pause(){D||(M=true,be.hold(true));},resume:me,seek(u){if(D)return;let p=Math.min(1,Math.max(0,u===u?u:0));A=p,X=p,E=0,M=true,be.hold(true),B(p);},getProgress(){return A}}}function mr(e,{triggerElement:n,...t},r){let o=n;return typeof n=="string"&&typeof document<"u"&&(o=document.querySelector(n),o||$(`scrollFrames: triggerElement "${n}" matches nothing; measuring the canvas.`)),fr(e,{...t,frames:r.frames,triggerElement:o??void 0})}function pr(e,n){let t=document.createElement("span");t.textContent=n,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function ht(e=""){let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=e,n}function gr(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(t=>{let r=e.appendChild(ht(t)),o=/^\s+$/.test(t);return o?r.style.whiteSpace="pre":r.style.display="inline-block",o?null:r}).filter(t=>t!==null)}function Kr(e){let n=e.textContent??"";e.textContent="";let t=[],r=null;for(let o of n){let s=ht(o),i=o===" ";i?s.style.whiteSpace="pre":(s.style.display="inline-block",t.push(s)),i||o>"\u0DFF"?r=null:r||(r=e.appendChild(ht()),r.style.cssText="display:inline-block;white-space:nowrap"),(r??e).appendChild(s);}return t}function dr(e){let n=gr(e),t=new Map;for(let s of n){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let r=[],o=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of o){let i=t.get(s),l=ht();l.style.display="inline-block",i.forEach((m,g)=>{let w=m.nextElementSibling;l.appendChild(m),g<i.length-1&&w&&w.style.whiteSpace==="pre"&&l.appendChild(w);}),r.push(l);}return e.textContent="",r.forEach((s,i)=>{e.appendChild(s),i<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function Xr(e,n,t,r){if(t<=1||r===0)return e;r=Math.min(r,1/t);let o=(t-1)*r,s=n*r,i=s+(1-o);return i<=s?e>=s?1:0:rt((e-s)/(i-s),0,1)}function Jr(e,n){let t=[];if(n?.y!==void 0&&t.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&t.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&t.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let r=n.scale+(1-n.scale)*e;t.push(`scale(${r})`);}return t.join(" ")}var At={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ct(e,n={}){if(typeof window>"u")return At;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return $("scrollText: element not found:",e),At;let r=t;return qe(n,(o,s)=>Zr(r,o,s))}function Zr(e,n,t){let{split:r="words",stagger:o=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:l={},once:m=true,onComplete:g}=n,w=Re(s,"ease-out"),P=ae(l.start||"top 85%"),S=ae(l.end||"top 40%"),G=e.innerHTML,Q=e.textContent??"",v;r==="chars"?v=Kr(e):r==="lines"?v=dr(e):v=gr(e),pr(e,Q);let z=v.length;function Z(M,X){i?.opacity!==void 0&&(M.style.opacity=String(i.opacity+(1-i.opacity)*X));let E=Jr(X,i);E&&(M.style.transform=E);}function O(M){e.style.setProperty("--scroll-draw-progress",String(M)),v.forEach((X,E)=>{let A=w(Xr(M,E,z,o));Z(X,A);});}if(t)return O(1),g?.(),{...At,destroy:()=>{e.innerHTML=G;},getProgress:()=>1};O(0);let C=0,L=0,k=-1,h=0,F=false;function W(){({tStart:C,tEnd:L}=Le(e.getBoundingClientRect(),window.scrollY,window.innerHeight,P,S));}let se=()=>Y(window.scrollY,C,L,1);function K(){let M=m?k=Math.max(k,se()):se();h=M,O(M),M>=1&&!F?(F=true,g?.()):M<1&&!m&&(F=false);}W();let V=De(window,[e],se,K,()=>{r==="lines"&&(e.innerHTML=G,v=dr(e),pr(e,Q),O(h)),W();});Oe(e,{type:"text",getProgress:()=>h,getTrigger:()=>({tStart:C,tEnd:L})});let R=()=>V.hold(false);return {destroy(){V.off(),e.innerHTML=G,$e(e);},replay(){k=-1,F=false,h=0,O(0),R();},pause:()=>V.hold(true),resume:R,seek(M){V.hold(true),O(h=k=rt(M,0,1));},getProgress(){return h}}}function Ve(e,n,t=st){let r,o,s,i;return solidJs.createEffect(()=>{i=typeof e=="function"?e():e;let l=t(i);!r||l===s||(s=l,solidJs.untrack(()=>{o?.destroy(),o=n(r,rr(i,()=>i),i);}));}),solidJs.onCleanup(()=>{o?.destroy(),o=s=void 0;}),{ref:l=>{r=l;},getInstance:()=>o}}function Vo(e={}){return Ve(e,St).ref}function _o(e={}){return Ve(e,St)}function zo(e){return Ve(e,Mt).ref}function Wo(e){return Ve(e,Mt)}function Go(e){return Ve(e,xt).ref}function Bo(e){return Ve(e,xt)}function qo(e={}){return Ve(e,Lt).ref}function jo(e={}){return Ve(e,Lt)}function hr(e,n){let t=false;return Ve(e,(r,o,s)=>(t||ur(r,n),t=true,mr(r,o,s)),cr)}function Uo(e){return hr(e,"useScrollFrames").ref}function Yo(e){return hr(e,"createScrollFrames")}function Qo(e={}){return Ve(e,Ct).ref}function Ko(e={}){return Ve(e,Ct)}exports.createScrollAnimate=Wo;exports.createScrollCounter=Bo;exports.createScrollDraw=_o;exports.createScrollFrames=Yo;exports.createScrollText=Ko;exports.createScrollVideo=jo;exports.useScrollAnimate=zo;exports.useScrollCounter=Go;exports.useScrollDraw=Vo;exports.useScrollFrames=Uo;exports.useScrollText=Qo;exports.useScrollVideo=qo;
@@ -1,7 +1,9 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.mjs';
2
- import { S as ScrollAnimateOptions } from '../engine-BLWKCfxC.mjs';
3
- import { S as ScrollCounterOptions } from '../index-DVjblK_4.mjs';
1
+ import { F as FramesInput } from '../wrapper-BOHrDnBO.mjs';
2
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-iITMwrru.mjs';
3
+ import { S as ScrollAnimateOptions } from '../engine-Bi2x8-X-.mjs';
4
+ import { S as ScrollCounterOptions } from '../index-BMMZ8aW7.mjs';
4
5
  import { ScrollVideoOptions } from '../video/index.mjs';
6
+ export { ScrollFramesOptions } from '../frames/index.mjs';
5
7
  import { ScrollTextOptions } from '../text/index.mjs';
6
8
 
7
9
  /** Options as a plain object, or an accessor that keeps them live. */
@@ -111,6 +113,40 @@ declare function createScrollVideo(options?: MaybeAccessor<ScrollVideoOptions>):
111
113
  ref: (node: HTMLVideoElement) => void;
112
114
  getInstance: () => ScrollDrawInstance | undefined;
113
115
  };
116
+ /**
117
+ * SolidJS hook — scrub an image sequence on a <canvas> with the scroll
118
+ * (scrollFrames). The canvas is yours, so give it role="img" and an
119
+ * aria-label saying what the frames show; in development the hook warns when
120
+ * it has no name (unless it is aria-hidden="true" or role="presentation").
121
+ *
122
+ * Pass an accessor to keep the options live: a new film starts only when the
123
+ * URLs or another option changed, and callbacks are read live.
124
+ * `triggerElement` takes an element or a selector, found when the film starts.
125
+ *
126
+ * @example
127
+ * import { useScrollFrames } from 'svg-scroll-draw/solid';
128
+ *
129
+ * function Film() {
130
+ * const ref = useScrollFrames({
131
+ * frames: (i) => `/film/${i + 1}.jpg`, count: 120,
132
+ * triggerElement: '#track', trigger: { start: 'top top', end: 'bottom bottom' },
133
+ * });
134
+ * return <canvas ref={ref} role="img" aria-label="The headphones turning" />;
135
+ * }
136
+ */
137
+ declare function useScrollFrames(options: MaybeAccessor<FramesInput>): (node: HTMLCanvasElement) => void;
138
+ /**
139
+ * Returns both the ref setter and a getter for the live film instance.
140
+ *
141
+ * @example
142
+ * const { ref, getInstance } = createScrollFrames(() => ({ frames: urls(), fit: 'contain' }));
143
+ * <canvas ref={ref} role="img" aria-label="The headphones turning" />
144
+ * <button onClick={() => getInstance()?.replay()}>Replay</button>
145
+ */
146
+ declare function createScrollFrames(options: MaybeAccessor<FramesInput>): {
147
+ ref: (node: HTMLCanvasElement) => void;
148
+ getInstance: () => ScrollDrawInstance | undefined;
149
+ };
114
150
  /**
115
151
  * SolidJS hook — split text and stagger-animate each piece on scroll.
116
152
  *
@@ -136,4 +172,4 @@ declare function createScrollText(options?: MaybeAccessor<ScrollTextOptions>): {
136
172
  getInstance: () => ScrollDrawInstance | undefined;
137
173
  };
138
174
 
139
- export { type MaybeAccessor, ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollText, createScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollText, useScrollVideo };
175
+ export { type MaybeAccessor, ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollFrames, createScrollText, createScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollFrames, useScrollText, useScrollVideo };
@@ -1,7 +1,9 @@
1
- import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-9bcJdVcg.js';
2
- import { S as ScrollAnimateOptions } from '../engine-6VsjEwzb.js';
3
- import { S as ScrollCounterOptions } from '../index-BN8yKeQ3.js';
1
+ import { F as FramesInput } from '../wrapper-Cm7JTIVl.js';
2
+ import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-iITMwrru.js';
3
+ import { S as ScrollAnimateOptions } from '../engine-DAlvk6i0.js';
4
+ import { S as ScrollCounterOptions } from '../index-MdQ4ti_z.js';
4
5
  import { ScrollVideoOptions } from '../video/index.js';
6
+ export { ScrollFramesOptions } from '../frames/index.js';
5
7
  import { ScrollTextOptions } from '../text/index.js';
6
8
 
7
9
  /** Options as a plain object, or an accessor that keeps them live. */
@@ -111,6 +113,40 @@ declare function createScrollVideo(options?: MaybeAccessor<ScrollVideoOptions>):
111
113
  ref: (node: HTMLVideoElement) => void;
112
114
  getInstance: () => ScrollDrawInstance | undefined;
113
115
  };
116
+ /**
117
+ * SolidJS hook — scrub an image sequence on a <canvas> with the scroll
118
+ * (scrollFrames). The canvas is yours, so give it role="img" and an
119
+ * aria-label saying what the frames show; in development the hook warns when
120
+ * it has no name (unless it is aria-hidden="true" or role="presentation").
121
+ *
122
+ * Pass an accessor to keep the options live: a new film starts only when the
123
+ * URLs or another option changed, and callbacks are read live.
124
+ * `triggerElement` takes an element or a selector, found when the film starts.
125
+ *
126
+ * @example
127
+ * import { useScrollFrames } from 'svg-scroll-draw/solid';
128
+ *
129
+ * function Film() {
130
+ * const ref = useScrollFrames({
131
+ * frames: (i) => `/film/${i + 1}.jpg`, count: 120,
132
+ * triggerElement: '#track', trigger: { start: 'top top', end: 'bottom bottom' },
133
+ * });
134
+ * return <canvas ref={ref} role="img" aria-label="The headphones turning" />;
135
+ * }
136
+ */
137
+ declare function useScrollFrames(options: MaybeAccessor<FramesInput>): (node: HTMLCanvasElement) => void;
138
+ /**
139
+ * Returns both the ref setter and a getter for the live film instance.
140
+ *
141
+ * @example
142
+ * const { ref, getInstance } = createScrollFrames(() => ({ frames: urls(), fit: 'contain' }));
143
+ * <canvas ref={ref} role="img" aria-label="The headphones turning" />
144
+ * <button onClick={() => getInstance()?.replay()}>Replay</button>
145
+ */
146
+ declare function createScrollFrames(options: MaybeAccessor<FramesInput>): {
147
+ ref: (node: HTMLCanvasElement) => void;
148
+ getInstance: () => ScrollDrawInstance | undefined;
149
+ };
114
150
  /**
115
151
  * SolidJS hook — split text and stagger-animate each piece on scroll.
116
152
  *
@@ -136,4 +172,4 @@ declare function createScrollText(options?: MaybeAccessor<ScrollTextOptions>): {
136
172
  getInstance: () => ScrollDrawInstance | undefined;
137
173
  };
138
174
 
139
- export { type MaybeAccessor, ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollText, createScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollText, useScrollVideo };
175
+ export { type MaybeAccessor, ScrollAnimateOptions, ScrollCounterOptions, ScrollDrawOptions, ScrollTextOptions, ScrollVideoOptions, createScrollAnimate, createScrollCounter, createScrollDraw, createScrollFrames, createScrollText, createScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollFrames, useScrollText, useScrollVideo };
@@ -1 +1 @@
1
- import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-BRV2B2YW.mjs';import {a as a$4}from'../chunk-32ZCSGFZ.mjs';import {a as a$2}from'../chunk-U5TKLHGW.mjs';import {a as a$1}from'../chunk-7USW2XFB.mjs';import {b as b$1}from'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';import {createEffect,onCleanup,untrack}from'solid-js';function o(e,f){let l,t,c,r;return createEffect(()=>{r=typeof e=="function"?e():e;let n=a(r);!l||n===c||(c=n,untrack(()=>{t?.destroy(),t=f(l,b(r,()=>r));}));}),onCleanup(()=>{t?.destroy(),t=c=void 0;}),{ref:n=>{l=n;},getInstance:()=>t}}function D(e={}){return o(e,b$1).ref}function V(e={}){return o(e,b$1)}function C(e){return o(e,a$1).ref}function H(e){return o(e,a$1)}function L(e){return o(e,a$2).ref}function g(e){return o(e,a$2)}function I(e={}){return o(e,a$3).ref}function k(e={}){return o(e,a$3)}function v(e={}){return o(e,a$4).ref}function j(e={}){return o(e,a$4)}export{H as createScrollAnimate,g as createScrollCounter,V as createScrollDraw,j as createScrollText,k as createScrollVideo,C as useScrollAnimate,L as useScrollCounter,D as useScrollDraw,v as useScrollText,I as useScrollVideo};
1
+ import {a as a$1}from'../chunk-NJV6S5LD.mjs';import {a,c,d,b}from'../chunk-KN2YB54Z.mjs';import {a as a$4}from'../chunk-HJTHOZK5.mjs';import'../chunk-GBFWTY5L.mjs';import {a as a$5}from'../chunk-UF3MO5XQ.mjs';import {a as a$3}from'../chunk-Z72TVDHY.mjs';import {a as a$2}from'../chunk-HAGTU5EX.mjs';import {b as b$1}from'../chunk-XLXVGQ3P.mjs';import'../chunk-7LDSB4FT.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-YOOPMYT6.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';import {createEffect,onCleanup,untrack}from'solid-js';function r(e,i,c=a){let o,t,n,l;return createEffect(()=>{l=typeof e=="function"?e():e;let s=c(l);!o||s===n||(n=s,untrack(()=>{t?.destroy(),t=i(o,b(l,()=>l),l);}));}),onCleanup(()=>{t?.destroy(),t=n=void 0;}),{ref:s=>{o=s;},getInstance:()=>t}}function g(e={}){return r(e,b$1).ref}function k(e={}){return r(e,b$1)}function v(e){return r(e,a$2).ref}function K(e){return r(e,a$2)}function h(e){return r(e,a$3).ref}function j(e){return r(e,a$3)}function q(e={}){return r(e,a$4).ref}function z(e={}){return r(e,a$4)}function M(e,i){let c$1=false;return r(e,(o,t,n)=>(c$1||d(o,i),c$1=true,a$1(o,t,n)),c)}function B(e){return M(e,"useScrollFrames").ref}function G(e){return M(e,"createScrollFrames")}function J(e={}){return r(e,a$5).ref}function N(e={}){return r(e,a$5)}export{K as createScrollAnimate,j as createScrollCounter,k as createScrollDraw,G as createScrollFrames,N as createScrollText,z as createScrollVideo,v as useScrollAnimate,h as useScrollCounter,g as useScrollDraw,B as useScrollFrames,J as useScrollText,q as useScrollVideo};