svg-scroll-draw 2.10.0 → 2.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +17 -10
  2. package/dist/angular/index.cjs +2 -2
  3. package/dist/angular/index.mjs +2 -2
  4. package/dist/astro/index.cjs +2 -2
  5. package/dist/astro/index.mjs +2 -2
  6. package/dist/cdn/svg-scroll-draw.dev.global.js +54 -29
  7. package/dist/cdn/svg-scroll-draw.global.js +2 -2
  8. package/dist/cinematic/index.cjs +2 -2
  9. package/dist/cinematic/index.mjs +2 -2
  10. package/dist/devtools/index.cjs +1 -1
  11. package/dist/devtools/index.mjs +1 -1
  12. package/dist/group/index.cjs +2 -2
  13. package/dist/group/index.mjs +2 -2
  14. package/dist/horizontal/index.cjs +1 -1
  15. package/dist/horizontal/index.mjs +1 -1
  16. package/dist/index.cjs +3 -3
  17. package/dist/index.mjs +3 -3
  18. package/dist/nuxt/index.cjs +2 -2
  19. package/dist/nuxt/index.mjs +2 -2
  20. package/dist/pin/index.cjs +1 -1
  21. package/dist/pin/index.mjs +1 -1
  22. package/dist/progress/index.cjs +1 -1
  23. package/dist/progress/index.mjs +1 -1
  24. package/dist/react/index.cjs +2 -2
  25. package/dist/react/index.mjs +2 -2
  26. package/dist/reveal/index.cjs +1 -1
  27. package/dist/reveal/index.mjs +1 -1
  28. package/dist/snap/index.cjs +1 -1
  29. package/dist/snap/index.mjs +1 -1
  30. package/dist/solid/index.cjs +2 -2
  31. package/dist/solid/index.mjs +2 -2
  32. package/dist/svelte/index.cjs +2 -2
  33. package/dist/svelte/index.mjs +2 -2
  34. package/dist/text/index.cjs +1 -1
  35. package/dist/text/index.mjs +1 -1
  36. package/dist/timeline/index.cjs +8 -8
  37. package/dist/timeline/index.mjs +8 -8
  38. package/dist/video/index.cjs +1 -1
  39. package/dist/video/index.mjs +1 -1
  40. package/dist/vue/index.cjs +2 -2
  41. package/dist/vue/index.mjs +2 -2
  42. package/dist/web-component/index.cjs +3 -3
  43. package/dist/web-component/index.mjs +3 -3
  44. package/package.json +19 -2
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- function Ft({tension:e=2.5,friction:t=2.2}={}){return r=>1-Math.cos(r*Math.PI*e)*Math.pow(1-r,t)}function vt({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),l=Math.sqrt(n),a=0,d=[];for(let f=0;f<r;f++){let E=Math.pow(l,f);d.push(E),a+=E;}let m=[0],c=0;for(let f=0;f<r;f++)c+=d[f]/a,m.push(c);return f=>{if(f<=0)return 0;if(f>=1)return 1;for(let E=0;E<r;E++)if(f<=m[E+1]){let I=(f-m[E])/(m[E+1]-m[E]);if(E===0)return I*(2-I);let T=1-Math.pow(n,E);return T+(1-T)*(2*I-1)*(2*I-1)}return 1}}function St({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),l=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return a=>a<=0?0:a>=1?1:r*Math.pow(2,-10*a)*Math.sin((a-l)*(2*Math.PI)/n)+1}var J={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:vt(),elastic:St()};function $e(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function ht(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function bt(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function He(e){let t=e.tagName.toLowerCase();if(t==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(r+n)}if(t==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Nt(e,t,r){return Math.min(r,Math.max(t,e))}function ie(e,t,r,n){return r===t?0:Nt((e-t)/(r-t)*n,0,1)}function Xe(e,t,r){let n=e.getBoundingClientRect(),l=r==="x"?n.width:n.height;return t?{top:r==="x"?n.left-t.getBoundingClientRect().left+t.scrollLeft:n.top-t.getBoundingClientRect().top+t.scrollTop,height:l,scroll:0}:{top:r==="x"?n.left:n.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function Oe(e,t,r,n,l){let a=ht(e.top,e.height,t,n.element)-bt(n.viewport,r),d=ht(e.top,e.height,t,l.element)-bt(l.viewport,r);return {tStart:a,tEnd:d}}function wt(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 r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function _e(e,t,r){let n=wt(e),l=wt(t);return !n||!l?e:`rgb(${Math.round(n[0]+(l[0]-n[0])*r)},${Math.round(n[1]+(l[1]-n[1])*r)},${Math.round(n[2]+(l[2]-n[2])*r)})`}var st={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 Ye=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function K(e,...t){Ye&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var Ht="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",_t="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Et=33;function zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Vt(e){let t=[];for(let r=0;r<Et;r++){let n=r/(Et-1);t.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${t.join(",")})`}function Qe(e){switch(e){case "linear":return "linear";case "ease-in":return Ht;case "ease-out":return _t;case "ease-in-out":return zt()?Vt(J["ease-in-out"]):null;default:return null}}var qt=0;function Wt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Bt(e){let t=e.getAttribute("stroke"),r=e.getAttribute("fill");!t||t==="none"?K("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&K("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Gt(e,t,r){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let a=r==="x"?window.scrollX:window.scrollY,d=e-a,m=t-a,c=r==="x";n.innerHTML=`
1
+ function _t({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Et({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(n),a=0,d=[];for(let f=0;f<t;f++){let x=Math.pow(l,f);d.push(x),a+=x;}let m=[0],c=0;for(let f=0;f<t;f++)c+=d[f]/a,m.push(c);return f=>{if(f<=0)return 0;if(f>=1)return 1;for(let x=0;x<t;x++)if(f<=m[x+1]){let D=(f-m[x])/(m[x+1]-m[x]);if(x===0)return D*(2-D);let A=1-Math.pow(n,x);return A+(1-A)*(2*D-1)*(2*D-1)}return 1}}function xt({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),l=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return a=>a<=0?0:a>=1?1:t*Math.pow(2,-10*a)*Math.sin((a-l)*(2*Math.PI)/n)+1}var Z={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Et(),elastic:xt()};function $e(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}function wt(e,r,t,n){switch(n){case "top":return e+t;case "center":return e+t+r/2;case "bottom":return e+t+r;default:return e+t}}function vt(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function ze(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function zt(e,r,t){return Math.min(t,Math.max(r,e))}function le(e,r,t,n){return t===r?0:zt((e-r)/(t-r)*n,0,1)}function Qe(e,r,t){let n=e.getBoundingClientRect(),l=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left+r.scrollLeft:n.top-r.getBoundingClientRect().top+r.scrollTop,height:l,scroll:0}:{top:t==="x"?n.left:n.top,height:l,scroll:t==="x"?window.scrollX:window.scrollY}}function Fe(e,r,t,n,l){let a=wt(e.top,e.height,r,n.element)-vt(n.viewport,t),d=wt(e.top,e.height,r,l.element)-vt(l.viewport,t);return {tStart:a,tEnd:d}}function St(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let 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 n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function Ve(e,r,t){let n=St(e),l=St(r);return !n||!l?e:`rgb(${Math.round(n[0]+(l[0]-n[0])*t)},${Math.round(n[1]+(l[1]-n[1])*t)},${Math.round(n[2]+(l[2]-n[2])*t)})`}var it={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 Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function K(e,...r){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var Vt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",qt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Tt=33;function Wt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Bt(e){let r=[];for(let t=0;t<Tt;t++){let n=t/(Tt-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function Ke(e){switch(e){case "linear":return "linear";case "ease-in":return Vt;case "ease-out":return qt;case "ease-in-out":return Wt()?Bt(Z["ease-in-out"]):null;default:return null}}var At=Symbol.for("svg-scroll-draw.registry");function $t(){let e=globalThis;return e[At]||(e[At]=new Map)}function Me(e,r){$t().set(e,r);}function Pe(e){$t().delete(e);}var Gt=0;function jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Yt(e){let r=e.getAttribute("stroke"),t=e.getAttribute("fill");!r||r==="none"?K("Element has no stroke \u2014 path will not be visible.",e):t&&t!=="none"&&t!=="transparent"&&K("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Ut(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let a=t==="x"?window.scrollX:window.scrollY,d=e-a,m=r-a,c=t==="x";n.innerHTML=`
2
2
  <div style="position:absolute;${c?`left:${d}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${d}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}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(n),window.addEventListener("scroll",l,{passive:true}),l(),{el:n,destroy(){window.removeEventListener("scroll",l),n.remove();}}}var xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Tt=/[MmLlHhVvCcSsQqTtAaZz]/g;function jt(e,t,r){if(!Ye)return;let n=(e.match(Tt)??[]).join("").toUpperCase(),l=(t.match(Tt)??[]).join("").toUpperCase(),a=(e.match(xt)??[]).length,d=(t.match(xt)??[]).length;if(n!==l){K(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}a!==d&&K(`morphTo: coordinate count differs (${a} \u2192 ${d}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function it(e,t,r){let n=(t.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let d=parseFloat(a),m=n[l++]??d;return String(+(d+(m-d)*r).toFixed(4))})}function At(e,t={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...n}=t,l=r?{...st[r],...n}:n,a=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:d="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=false,easing:f="linear",trigger:E={},stagger:I=0,direction:T="forward",once:ee=false,debug:Ee=false,axis:A="y",scrollContainer:$,autoReverse:g=false,delay:S=0,strokeColor:h,strokeWidth:V,fillOpacity:F,waypoints:B,velocityScale:te=false,threshold:de=0,rootMargin:j="0px",repeat:q=0,repeatDelay:Me=0,morphTo:N,clip:ge,autoplay:Pe=false,duration:ke=1e3,native:Le=true,onProgress:b,onStart:P,onComplete:oe,onEnter:ye,onLeave:Re,onEnterBack:he,onLeaveBack:xe}=l,re=ge===true?"left":typeof ge=="string"?ge:false,ue=typeof f=="function"?f:J[f]??J.linear,be=$e(E.start??"top bottom"),Fe=$e(E.end??"bottom top"),ae=typeof $=="string"?document.querySelector($):$??null,le=Array.isArray(h)?h[0]:null,U=Array.isArray(h)?h[1]:typeof h=="string"?h:null,X=Array.isArray(V)?V[0]:null,H=Array.isArray(V)?V[1]:typeof V=="number"?V:null,ne=Array.isArray(F)?F[0]:null,W=Array.isArray(F)?F[1]:typeof F=="number"?F:null;function we(o){let i=o*100;switch(re){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let C=re?[]:Array.from(e.querySelectorAll(d)),x=[],s=[],u=0,ce=0,k=false,D=false,O=0,_=false,Y=-1,ve=-1,G=false,me=0,Te=0,Ce,tt=null;function ut(){tt?.destroy(),tt=null;}let Ie=new Set,mt=NaN,De=true,qe=-1,ft=performance.now(),Ne=NaN;function rt(){return ae?A==="x"?ae.scrollLeft:ae.scrollTop:A==="x"?window.scrollX:window.scrollY}function pt(){return ae?A==="x"?ae.clientWidth:ae.clientHeight:A==="x"?window.innerWidth:window.innerHeight}function dt(){let o=Xe(e,ae,A),i=Oe(o,o.scroll,pt(),be,Fe);u=i.tStart,ce=i.tEnd,Ee&&Ye&&(ut(),tt=Gt(u,ce,A));}function It(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),re){let w=i==="reverse"?1-o:o;e.style.clipPath=we(w);return}C.forEach((w,Q)=>{w.style.strokeDashoffset=i==="reverse"?`${x[Q]*o}`:`${x[Q]*(1-o)}`,c&&(w.style.opacity=i==="reverse"?`${1-o}`:`${o}`),le&&U?w.style.stroke=_e(le,U,o):U&&(w.style.stroke=U),X!==null&&H!==null?w.style.strokeWidth=`${X+(H-X)*o}`:H!==null&&(w.style.strokeWidth=`${H}`),ne!==null&&W!==null?w.style.fillOpacity=`${ne+(W-ne)*o}`:W!==null&&(w.style.fillOpacity=`${W}`),N&&w.tagName.toLowerCase()==="path"&&s[Q]&&w.setAttribute("d",it(s[Q],N,o));});}function We(){if(e.style.setProperty("--scroll-draw-progress","0"),re){e.style.clipPath=we(0);return}C.forEach((o,i)=>{o.style.strokeDasharray=`${x[i]}`,o.style.strokeDashoffset=T==="reverse"?"0":`${x[i]}`,c?o.style.opacity=T==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),X!==null&&(o.style.strokeWidth=`${X}`),ne!==null&&(o.style.fillOpacity=`${ne}`),N&&o.tagName.toLowerCase()==="path"&&s[i]&&o.setAttribute("d",s[i]);});}if(C.forEach(o=>{Bt(o);let i=He(o);x.push(i);let w=o.tagName.toLowerCase()==="path";w?s.push(o.getAttribute("d")??""):s.push(""),N&&(w?jt(s[s.length-1],N,o):K(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),a?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=T==="reverse"?`${i}`:"0",c&&(o.style.opacity="1"),U&&(o.style.stroke=U),H!==null&&(o.style.strokeWidth=`${H}`),W!==null&&(o.style.fillOpacity=`${W}`),N&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",N)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=T==="reverse"?"0":`${i}`,c?o.style.opacity=T==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),X!==null&&(o.style.strokeWidth=`${X}`),ne!==null&&(o.style.fillOpacity=`${ne}`));}),re){if(a)return e.style.clipPath=we(1),oe?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=we(0);}else if(a)return oe?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let gt=typeof f=="string"?Qe(f):null;function Dt(){return !(Le===false||!Wt()||!C.length||!gt||re||A!=="y"||ae||m!==1||I!==0||ee||g||te!==false||N||B||q||S>0||b||P||oe||ye||Re||he||xe||h!=null||V!=null||F!=null||(E.start??"top bottom").trim()!=="top bottom"||(E.end??"bottom top").trim()!=="bottom top")}function Ot(){let o=++qt,i=`svg-scroll-draw-${o}`,w=`svg-scroll-draw-host-${o}`,Q=`--svg-scroll-draw-${o}`,Ae=T==="reverse"?"0":"var(--ssd-len)",Se=T==="reverse"?"var(--ssd-len)":"0",pe=`stroke-dashoffset:${Ae};`,v=`stroke-dashoffset:${Se};`;c&&(pe+=`opacity:${T==="reverse"?1:0};`,v+=`opacity:${T==="reverse"?0:1};`);let M=document.createElement("style");M.setAttribute("data-svg-scroll-draw",""),M.textContent=`@keyframes ${i}{from{${pe}}to{${v}}}.${w}{view-timeline-name:${Q};view-timeline-axis:block;}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${gt};animation-fill-mode:both;animation-timeline:${Q};animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(w);function Z(p,z){p.style.setProperty("--ssd-len",String(x[z])),p.style.strokeDasharray=`${x[z]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(i);}C.forEach(Z);let y=false,L=-1;function R(){if(L>=0)return L;let p=e.getBoundingClientRect(),{tStart:z,tEnd:fe}=Oe({top:p.top,height:p.height},rt(),pt(),be,Fe);return ue(ie(rt(),z,fe,m))}return {destroy(){e.classList.remove(w),C.forEach(p=>{p.classList.remove(i),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),M.remove();},replay(){y=false,L=-1,C.forEach(Z);},pause(){y=true,C.forEach(p=>{p.style.animationPlayState="paused";});},resume(){y&&(y=false,C.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let z=Math.min(1,Math.max(0,p));L=z,y=true,C.forEach((fe,se)=>{fe.classList.remove(i),fe.style.strokeDashoffset=T==="reverse"?`${x[se]*z}`:`${x[se]*(1-z)}`,c&&(fe.style.opacity=T==="reverse"?`${1-z}`:`${z}`);});},getProgress(){return R()},refresh(){C.forEach((p,z)=>{x[z]=He(p),p.style.setProperty("--ssd-len",String(x[z])),p.style.strokeDasharray=`${x[z]}`;});}}}if(Dt())return Ot();function Rt(){let o=Math.max(1,ke),i=0,w=0,Q=false;function Ae(y){let L=true;if(re){let R=Math.min(1,Math.max(0,y/o)),p=ue(R);me=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=we(T==="reverse"?1-p:p),b?.(p),R<1&&(L=false);}else C.forEach((R,p)=>{let z=p*I*o,fe=Math.min(1,Math.max(0,(y-z)/o)),se=ue(fe);R.style.strokeDashoffset=T==="reverse"?`${x[p]*se}`:`${x[p]*(1-se)}`,c&&(R.style.opacity=T==="reverse"?`${1-se}`:`${se}`),le&&U?R.style.stroke=_e(le,U,se):U&&(R.style.stroke=U),X!==null&&H!==null?R.style.strokeWidth=`${X+(H-X)*se}`:H!==null&&(R.style.strokeWidth=`${H}`),ne!==null&&W!==null?R.style.fillOpacity=`${ne+(W-ne)*se}`:W!==null&&(R.style.fillOpacity=`${W}`),N&&R.tagName.toLowerCase()==="path"&&s[p]&&R.setAttribute("d",it(s[p],N,se)),p===0&&(me=se,b?.(se),e.style.setProperty("--scroll-draw-progress",String(se))),fe<1&&(L=false);});if(B){let R=Math.min(1,Math.max(0,y/o)),p=ue(R);for(let z in B){let fe=parseFloat(z);p>=fe&&!Ie.has(fe)&&(Ie.add(fe),B[z]?.());}}return L}function Se(y){if(G)return;let L=y-i;D||(D=true,P?.());let R=Ae(L);if(R&&!k){k=true,Ae(o*(1+Math.max(0,C.length-1)*I)),oe?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,Ce=setTimeout(()=>{i=performance.now(),D=false,k=false,Ie.clear(),We(),O=requestAnimationFrame(Se);},Me));return}R||(O=requestAnimationFrame(Se));}function pe(){cancelAnimationFrame(O),clearTimeout(Ce),i=performance.now(),w=0,G=false,D=false,k=false,Te=0,Q=true,me=0,Ie.clear(),We(),O=requestAnimationFrame(Se);}let v=new IntersectionObserver(y=>{y.forEach(L=>{L.isIntersecting&&!(ee&&k)?pe():!L.isIntersecting&&!ee&&!k&&(cancelAnimationFrame(O),clearTimeout(Ce),Q=false);});},{root:ae??null,threshold:de,rootMargin:j}),M;function Z(){clearTimeout(M),M=setTimeout(()=>{C.forEach((y,L)=>{x[L]=He(y),y.style.strokeDasharray=`${x[L]}`;});},150);}return window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z),S>0?setTimeout(()=>v.observe(e),S):v.observe(e),{destroy(){cancelAnimationFrame(O),clearTimeout(Ce),v.disconnect(),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),clearTimeout(M);},replay(){Te=0,pe();},pause(){G||!Q||(G=true,w=performance.now()-i,cancelAnimationFrame(O));},resume(){G&&(G=false,Q=true,i=performance.now()-w,O=requestAnimationFrame(Se));},seek(y){let L=Math.min(1,Math.max(0,y));me=L,G=true,w=L*o,i=performance.now()-w,cancelAnimationFrame(O),Ae(w);},getProgress(){return me},refresh(){clearTimeout(M),C.forEach((y,L)=>{x[L]=He(y),y.style.strokeDasharray=`${x[L]}`;});}}}if(Pe)return Rt();dt();function Be(){if(!_||G)return;let o=performance.now(),i=rt();if(!De&&te===false&&i===mt){O=requestAnimationFrame(Be);return}De=false,mt=i;let w=m;if(te!==false){let v=o-ft,M=v>0?Math.abs(i-(qe<0?i:qe))/v:0;w=m*Math.max(.2,1+M*(typeof te=="number"?te:1)*.04);}qe=i,ft=o;let Q=g?ve===-1||i>=ve?"forward":"reverse":T;ve=i;let Ae=ce-u,Se=true,pe=Ae===0?0:(i-u)/Ae;if(isNaN(Ne)||(Ne<=0&&pe>0?ye?.():Ne>0&&pe<=0&&xe?.(),Ne<1&&pe>=1?Re?.():Ne>=1&&pe<1&&he?.()),Ne=pe,re){let v=ue(ie(i,u,ce,w));ee&&!g&&(Y=Math.max(Y,v),v=Y),me=v,e.style.setProperty("--scroll-draw-progress",String(v));let M=Q==="reverse"?1-v:v;e.style.clipPath=we(M),b?.(v),!D&&ie(i,u,ce,w)>0&&(D=true,P?.()),v>=1&&!k?(k=true,oe?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,Ce=setTimeout(()=>{Y=-1,D=false,k=false,e.style.clipPath=we(0);},Me))):v<1&&!ee&&(k=false),O=requestAnimationFrame(Be);return}if(C.forEach((v,M)=>{let Z=M*I*Ae,y=ue(ie(i,u+Z,ce+Z,w));ee&&!g&&(Y=Math.max(Y,y),y=Y),me=y,v.style.strokeDashoffset=Q==="reverse"?`${x[M]*y}`:`${x[M]*(1-y)}`,c&&(v.style.opacity=Q==="reverse"?`${1-y}`:`${y}`),le&&U?v.style.stroke=_e(le,U,y):U&&(v.style.stroke=U),X!==null&&H!==null?v.style.strokeWidth=`${X+(H-X)*y}`:H!==null&&(v.style.strokeWidth=`${H}`),ne!==null&&W!==null?v.style.fillOpacity=`${ne+(W-ne)*y}`:W!==null&&(v.style.fillOpacity=`${W}`),N&&v.tagName.toLowerCase()==="path"&&s[M]&&v.setAttribute("d",it(s[M],N,y)),M===0&&(b?.(y),e.style.setProperty("--scroll-draw-progress",String(y))),y<1&&(Se=false);}),B){let v=ue(ie(i,u,ce,w));for(let M in B){let Z=parseFloat(M);v>=Z&&!Ie.has(Z)&&(Ie.add(Z),B[M]?.());}}!D&&ie(i,u,ce,w)>0&&(D=true,P?.()),Se&&!k?(k=true,oe?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,Ce=setTimeout(()=>{Y=-1,D=false,k=false,Ie.clear(),We(),De=true;},Me))):!Se&&!ee&&(k=false),O=requestAnimationFrame(Be);}let nt=false;function Ge(){nt||(nt=true,O=requestAnimationFrame(function(){Be();}));}function je(){nt=false,cancelAnimationFrame(O);}let ot=new IntersectionObserver(o=>{o.forEach(i=>{_=i.isIntersecting,_&&!G?(De=true,Ge()):je();});},{root:ae??null,threshold:de,rootMargin:j});function yt(){C.forEach((o,i)=>{x[i]=He(o),o.style.strokeDasharray=`${x[i]}`;}),dt(),De=true;}let Ue;function ze(){clearTimeout(Ue),Ue=setTimeout(yt,150);}window.addEventListener("resize",ze),window.addEventListener("orientationchange",ze);let Ve;return typeof ResizeObserver<"u"&&(Ve=new ResizeObserver(()=>ze()),Ve.observe(document.body),Ve.observe(document.documentElement),Ve.observe(e)),S>0?setTimeout(()=>ot.observe(e),S):ot.observe(e),{destroy(){cancelAnimationFrame(O),clearTimeout(Ce),je(),ot.disconnect(),Ve?.disconnect(),window.removeEventListener("resize",ze),window.removeEventListener("orientationchange",ze),clearTimeout(Ue),ut();},replay(){Y=-1,ve=-1,qe=-1,D=false,k=false,Te=0,G=false,me=0,Ie.clear(),clearTimeout(Ce),We(),De=true,_&&Ge();},pause(){G=true,je();},resume(){G&&(G=false,De=true,_&&Ge());},seek(o){let i=Math.min(1,Math.max(0,o));me=i,Y=i,G=true,je(),It(i,T),De=true;},getProgress(){return me},refresh(){clearTimeout(Ue),yt(),_&&!G&&Ge();}}}var $t=new Map;function Ze(e,t){$t.set(e,t);}function Je(e){$t.delete(e);}function Ut(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Mt(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let l=[],a=[],d=n[2].trim();if(d)for(let m of d.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(c?parseFloat(c[1]):0),a.push(c?c[2]:"");}t.push({fn:n[1],nums:l,units:a});}return t}function Xt(e,t,r){let n=Mt(e),l=Mt(t);return n.length===0||n.length!==l.length?r<1?e:t:n.map((a,d)=>{let m=l[d];return a.fn!==m.fn||a.nums.length!==m.nums.length?r<1?`${a.fn}(${a.nums.map((c,f)=>`${c}${a.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,f)=>`${c}${m.units[f]}`).join(", ")})`:`${a.fn}(${a.nums.map((c,f)=>`${c+(m.nums[f]-c)*r}${a.units[f]}`).join(", ")})`}).join(" ")}function Pt(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),l=String(t);if(Ut(n))return _e(n,l,r);if(n.includes("("))return Xt(n,l,r);let a=n.match(/^([-+]?[\d.]+)(.*)$/),d=l.match(/^([-+]?[\d.]+)(.*)$/);if(a&&d){let m=parseFloat(a[1]),c=parseFloat(d[1]);return `${m+(c-m)*r}${a[2]||d[2]}`}return r<1?n:l}function Yt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Qt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Zt=0,kt="--scroll-draw-progress";function Jt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Lt(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:l={},easing:a="ease-out",speed:d=1,once:m=false,axis:c="y",scrollContainer:f,native:E=true,velocityScale:I=false,respectReducedMotion:T=true,triggerElement:ee,onProgress:Ee,onComplete:A,onEnter:$,onLeave:g,onEnterBack:S,onLeaveBack:h}=t,V=T&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,F=typeof a=="function"?a:J[a]??J["ease-out"],B=$e(l.start??"top bottom"),te=$e(l.end??"bottom top"),de=ee??e,j=typeof f=="string"?document.querySelector(f):f??null,q=Object.entries(n).map(([s,u])=>({prop:Yt(s),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function Me(){let s=window.getComputedStyle(e);for(let u of q)u.from===""&&(u.from=s.getPropertyValue(u.prop).trim()||"0");}function N(){for(let s of q)e.style.setProperty(s.prop,String(s.to));}let ge=new Map;for(let s of [...q.map(u=>u.prop),kt])ge.set(s,e.style.getPropertyValue(s));function Pe(){for(let[s,u]of ge)u?e.style.setProperty(s,u):e.style.removeProperty(s);}if(V)return N(),A?.(),{...r,destroy:Pe,getProgress:()=>1};Me();let ke=typeof a=="string"?Qe(a):null;function Le(){if(!E||!Jt()||!ke||c!=="y"||j||de!==e||m||d!==1||Ee||A||$||g||S||h||I!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let s of q)if(!Qt.has(s.prop))return false;return true}function b(){let s=`ssd-a-${++Zt}`,u=q.map(_=>`${_.prop}:${_.from}`).join(";"),ce=q.map(_=>`${_.prop}:${_.to}`).join(";"),k=document.createElement("style");k.setAttribute("data-ssd-animate",""),k.textContent=`@keyframes ${s}{from{${u}}to{${ce}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${ke};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(k),e.classList.add(s);let D=()=>c==="x"?window.scrollX:window.scrollY,O=()=>c==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(s),k.remove(),e.style.animationPlayState="",Pe();},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(_){let Y=Math.min(1,Math.max(0,_));e.classList.remove(s);for(let ve of q)e.style.setProperty(ve.prop,Pt(ve.from,ve.to,Y));},getProgress(){let _=e.getBoundingClientRect(),Y=D(),ve=O(),{tStart:G,tEnd:me}=Oe({top:_.top,height:_.height},Y,ve,B,te);return F(ie(Y,G,me,d))}}}if(Le())return b();let P=0,oe=0,ye=0,Re=false,he=false,xe=-1,re=0,ue=false,be=NaN,Fe=-1,ae=0,le=()=>j?c==="x"?j.scrollLeft:j.scrollTop:c==="x"?window.scrollX:window.scrollY,U=()=>j?c==="x"?j.clientWidth:j.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function X(){let s=Xe(de,j,c),u=Oe(s,s.scroll,U(),B,te);P=u.tStart,oe=u.tEnd;}function H(s){e.style.setProperty(kt,String(s));for(let u of q)e.style.setProperty(u.prop,Pt(u.from,u.to,s));Ee?.(s);}function ne(s){if(isNaN(be)){be=s;return}be<=0&&s>0?$?.():be>0&&s<=0&&h?.(),be<1&&s>=1?g?.():be>=1&&s<1&&S?.(),be=s;}function W(){if(!Re||he)return;let s=performance.now(),u=le(),ce=d;if(I!==false){let O=s-ae,_=O>0?Math.abs(u-(Fe<0?u:Fe))/O:0;ce=d*Math.max(.2,1+_*(typeof I=="number"?I:1)*.04);}Fe=u,ae=s;let k=oe===P?0:(u-P)/(oe-P);ne(k);let D=F(ie(u,P,oe,ce));m&&(xe=Math.max(xe,D),D=xe),re=D,H(D),D>=1&&!ue?(ue=true,A?.()):D<1&&!m&&(ue=false),ye=requestAnimationFrame(W);}X(),oe===P&&K("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let s=F(ie(le(),P,oe,d));m&&s>0&&(xe=s),re=s,H(s);}let we=new IntersectionObserver(s=>{s.forEach(u=>{Re=u.isIntersecting,Re&&!he?ye=requestAnimationFrame(W):cancelAnimationFrame(ye);});},{root:j??null}),C;function x(){clearTimeout(C),C=setTimeout(X,150);}return window.addEventListener("resize",x),window.addEventListener("orientationchange",x),we.observe(e),Ze(e,{type:"animate",getProgress:()=>re,getTrigger:()=>({tStart:P,tEnd:oe})}),{destroy(){cancelAnimationFrame(ye),we.disconnect(),window.removeEventListener("resize",x),window.removeEventListener("orientationchange",x),clearTimeout(C),Pe(),Je(e);},replay(){xe=-1,ue=false,re=0,he=false,H(0);},pause(){he=true,cancelAnimationFrame(ye);},resume(){he&&(he=false,Re&&(ye=requestAnimationFrame(W)));},seek(s){let u=Math.min(1,Math.max(0,s));re=u,xe=u,he=true,cancelAnimationFrame(ye),H(u);},getProgress(){return re}}}var Ke={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Kt(e,t){if(typeof window>"u")return Ke;let r=typeof e=="string"?document.querySelector(e):e;return r?Lt(r,t):(K("scrollAnimate: element not found:",e),Ke)}function er(e,t={}){if(typeof window>"u")return Ke;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return K("scrollParallax: element not found:",e),Ke;let{speed:n=.3,axis:l="y",easing:a="linear",trigger:d,onProgress:m}=t,c=r.getBoundingClientRect(),f=l==="x"?c.width:c.height,E=n*f;return Lt(r,{props:l==="x"?{transform:["translateX(0px)",`translateX(${-E}px)`]}:{transform:["translateY(0px)",`translateY(${-E}px)`]},trigger:d??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:m})}var at={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tr(e,t){if(typeof window>"u")return at;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return K("scrollCounter: element not found:",e),at;let n=r,{from:l=0,to:a,format:d,easing:m="ease-out",trigger:c={},once:f=true,decimals:E,onComplete:I}=t,T=E!==void 0?b=>b.toFixed(E):d??(b=>String(Math.round(b))),ee=typeof m=="function"?m:J[m]??J["ease-out"],Ee=$e(c.start??"top 80%"),A=$e(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.textContent=T(a),I?.(),at;let g=0,S=0,h=0,V=false,F=false,B=-1,te=0,de=false,j=()=>window.scrollY,q=()=>window.innerHeight;function Me(){let b=n.getBoundingClientRect(),P=Oe({top:b.top,height:b.height},j(),q(),Ee,A);g=P.tStart,S=P.tEnd;}function N(b){n.textContent=T(l+(a-l)*b),n.style.setProperty("--scroll-draw-progress",String(b));}function ge(){if(!V||F)return;let b=ee(ie(j(),g,S,1));f&&(B=Math.max(B,b),b=B),te=b,N(b),b>=1&&!de?(de=true,I?.()):b<1&&!f&&(de=false),h=requestAnimationFrame(ge);}Me();{let b=ee(ie(j(),g,S,1));f&&b>0&&(B=b),te=b,N(b);}let Pe=new IntersectionObserver(b=>{b.forEach(P=>{V=P.isIntersecting,V&&!F?h=requestAnimationFrame(ge):cancelAnimationFrame(h);});}),ke;function Le(){clearTimeout(ke),ke=setTimeout(Me,150);}return window.addEventListener("resize",Le),window.addEventListener("orientationchange",Le),Pe.observe(n),Ze(n,{type:"counter",getProgress:()=>te,getTrigger:()=>({tStart:g,tEnd:S})}),{destroy(){cancelAnimationFrame(h),Pe.disconnect(),window.removeEventListener("resize",Le),window.removeEventListener("orientationchange",Le),clearTimeout(ke),Je(n);},replay(){B=-1,de=false,te=0,F=false,N(0);},pause(){F=true,cancelAnimationFrame(h);},resume(){F&&(F=false,V&&(h=requestAnimationFrame(ge)));},seek(b){let P=Math.min(1,Math.max(0,b));te=P,B=P,F=true,cancelAnimationFrame(h),N(P);},getProgress(){return te}}}var Ct="http://www.w3.org/2000/svg",rr="cinematic-photo",lt=e=>e<0?0:e>1?1:e;function et(e){let t=parseFloat(e);return Number.isFinite(t)?lt(t/100):0}function nr(e){return J[e]??J.linear}var or={destroy:()=>{},getProgress:()=>0},ct=class{constructor(t){if(typeof document>"u"){this.mount=null;return}this.mount=typeof t.wrapper=="string"?document.querySelector(t.wrapper):t.wrapper,this.mount||K("Cinematic: wrapper not found:",t.wrapper);}loadStory(t){let r=this.mount;if(typeof window>"u"||!r)return or;r.style.position="relative",r.style.height=t.totalHeight,r.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",r.appendChild(n);let l=[];for(let A of t.scenes){if(A.background){let g=document.createElement("img");g.id=rr,g.src=A.background,g.alt="",g.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(g);}let $=A.animations.filter(g=>g.type==="draw");if($.length){let g=document.createElementNS(Ct,"svg");g.setAttribute("viewBox",`0 0 ${t.canvas.width} ${t.canvas.height}`),g.setAttribute("preserveAspectRatio","xMidYMid meet"),g.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(g);for(let S of $){let h=document.createElementNS(Ct,"path");h.id=S.target.replace(/^#/,""),h.setAttribute("d",S.d),h.setAttribute("fill","none"),h.setAttribute("stroke",S.stroke),h.setAttribute("stroke-width",String(S.strokeWidth)),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round");let V=S.length||h.getTotalLength?.()||0;h.style.strokeDasharray=String(V),h.style.strokeDashoffset=String(V),g.appendChild(h),l.push({kind:"draw",el:h,start:et(S.start),end:et(S.end),ease:nr(S.easing),length:V});}}for(let g of A.animations){if(g.type!=="fade")continue;let S=n.querySelector(g.target)??document.querySelector(g.target);S&&(S.style.opacity=String(g.from),l.push({kind:"fade",el:S,start:et(g.start),end:et(g.end),ease:J["ease-in-out"]??J.linear,from:g.from,to:g.to}));}}let a=0,d=()=>{let A=r.offsetHeight-window.innerHeight;return A<=0?r.getBoundingClientRect().top<=0?1:0:lt(-r.getBoundingClientRect().top/A)},m=A=>{for(let $ of l){let g=$.end-$.start,S=g<=0?A>=$.end?1:0:lt((A-$.start)/g),h=$.ease(S);$.kind==="draw"?$.el.style.strokeDashoffset=String($.length*(1-h)):$.el.style.opacity=String($.from+($.to-$.from)*h);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let c=0,f=false,E=false,I=()=>{a=d(),m(a),f&&(c=requestAnimationFrame(I));},T=()=>{f||(f=true,c=requestAnimationFrame(I));},ee=()=>{f=false,cancelAnimationFrame(c);},Ee=new IntersectionObserver(A=>{for(let $ of A)E=$.isIntersecting,E?T():ee();},{threshold:0});return Ee.observe(n),a=d(),m(a),{destroy(){ee(),Ee.disconnect();},getProgress:()=>a}}};function Lr(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let n=typeof e=="string"?document.querySelector(e):e;return n?At(n,t):(K("Container not found:",e),r)}
4
- export{ct as Cinematic,st as PRESETS,vt as createBounce,St as createElastic,Ft as createSpring,Kt as scrollAnimate,tr as scrollCounter,Lr as scrollDraw,er as scrollParallax};
3
+ <div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}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(n),window.addEventListener("scroll",l,{passive:true}),l(),{el:n,destroy(){window.removeEventListener("scroll",l),n.remove();}}}var Mt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Pt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Xt(e,r,t){if(!Ze)return;let n=(e.match(Pt)??[]).join("").toUpperCase(),l=(r.match(Pt)??[]).join("").toUpperCase(),a=(e.match(Mt)??[]).length,d=(r.match(Mt)??[]).length;if(n!==l){K(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}a!==d&&K(`morphTo: coordinate count differs (${a} \u2192 ${d}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function at(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let d=parseFloat(a),m=n[l++]??d;return String(+(d+(m-d)*t).toFixed(4))})}function kt(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:t,...n}=r,l=t?{...it[t],...n}:n,a=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:d="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=false,easing:f="linear",trigger:x={},stagger:D=0,direction:A="forward",once:J=false,debug:Ee=false,axis:S="y",scrollContainer:$,autoReverse:g=false,delay:E=0,strokeColor:b,strokeWidth:V,fillOpacity:F,waypoints:B,velocityScale:ee=false,threshold:ge=0,rootMargin:j="0px",repeat:q=0,repeatDelay:ke=0,morphTo:N,clip:ye,autoplay:Le=false,duration:Ce=1e3,native:Ie=true,onProgress:w,onStart:P,onComplete:ne,onEnter:he,onLeave:Ne,onEnterBack:be,onLeaveBack:xe}=l,te=ye===true?"left":typeof ye=="string"?ye:false,me=typeof f=="function"?f:Z[f]??Z.linear,we=$e(x.start??"top bottom"),He=$e(x.end??"bottom top"),ce=typeof $=="string"?document.querySelector($):$??null,ue=Array.isArray(b)?b[0]:null,Y=Array.isArray(b)?b[1]:typeof b=="string"?b:null,U=Array.isArray(V)?V[0]:null,H=Array.isArray(V)?V[1]:typeof V=="number"?V:null,re=Array.isArray(F)?F[0]:null,W=Array.isArray(F)?F[1]:typeof F=="number"?F:null;function ve(o){let i=o*100;switch(te){case "right":return `inset(0 0 0 ${100-i}%)`;case "top":return `inset(0 0 ${100-i}% 0)`;case "bottom":return `inset(${100-i}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-i}% 0 0)`}}let C=te?[]:Array.from(e.querySelectorAll(d)),T=[],s=[],u=0,oe=0,k=false,I=false,R=0,pe=false,se=-1,G=-1,_=false,ie=0,Te=0,De,tt=null;function mt(){tt?.destroy(),tt=null;}let Re=new Set,ft=NaN,Oe=true,Be=-1,pt=performance.now(),_e=NaN;function rt(){return ce?S==="x"?ce.scrollLeft:ce.scrollTop:S==="x"?window.scrollX:window.scrollY}function dt(){return ce?S==="x"?ce.clientWidth:ce.clientHeight:S==="x"?window.innerWidth:window.innerHeight}function gt(){let o=Qe(e,ce,S);return Fe(o,o.scroll,dt(),we,He)}function yt(){(({tStart:u,tEnd:oe}=gt())),Ee&&Ze&&(mt(),tt=Ut(u,oe,S));}function nt(o,i=gt){Me(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:i});let h=o.destroy;return o.destroy=()=>{h.call(o),Pe(e);},o}function Ot(o,i){if(e.style.setProperty("--scroll-draw-progress",String(o)),te){let h=i==="reverse"?1-o:o;e.style.clipPath=ve(h);return}C.forEach((h,X)=>{h.style.strokeDashoffset=i==="reverse"?`${T[X]*o}`:`${T[X]*(1-o)}`,c&&(h.style.opacity=i==="reverse"?`${1-o}`:`${o}`),ue&&Y?h.style.stroke=Ve(ue,Y,o):Y&&(h.style.stroke=Y),U!==null&&H!==null?h.style.strokeWidth=`${U+(H-U)*o}`:H!==null&&(h.style.strokeWidth=`${H}`),re!==null&&W!==null?h.style.fillOpacity=`${re+(W-re)*o}`:W!==null&&(h.style.fillOpacity=`${W}`),N&&h.tagName.toLowerCase()==="path"&&s[X]&&h.setAttribute("d",at(s[X],N,o));});}function Ge(){if(e.style.setProperty("--scroll-draw-progress","0"),te){e.style.clipPath=ve(0);return}C.forEach((o,i)=>{o.style.strokeDasharray=`${T[i]}`,o.style.strokeDashoffset=A==="reverse"?"0":`${T[i]}`,c?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),U!==null&&(o.style.strokeWidth=`${U}`),re!==null&&(o.style.fillOpacity=`${re}`),N&&o.tagName.toLowerCase()==="path"&&s[i]&&o.setAttribute("d",s[i]);});}if(C.forEach(o=>{Yt(o);let i=ze(o);T.push(i);let h=o.tagName.toLowerCase()==="path";h?s.push(o.getAttribute("d")??""):s.push(""),N&&(h?Xt(s[s.length-1],N,o):K(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),a?(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=A==="reverse"?`${i}`:"0",c&&(o.style.opacity="1"),Y&&(o.style.stroke=Y),H!==null&&(o.style.strokeWidth=`${H}`),W!==null&&(o.style.fillOpacity=`${W}`),N&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",N)):(o.style.strokeDasharray=`${i}`,o.style.strokeDashoffset=A==="reverse"?"0":`${i}`,c?o.style.opacity=A==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),U!==null&&(o.style.strokeWidth=`${U}`),re!==null&&(o.style.fillOpacity=`${re}`));}),te){if(a)return e.style.clipPath=ve(1),ne?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=ve(0);}else if(a)return ne?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let ht=typeof f=="string"?Ke(f):null;function Ft(){return !(Ie===false||!jt()||!C.length||!ht||te||S!=="y"||ce||m!==1||D!==0||J||g||ee!==false||N||B||q||E>0||w||P||ne||he||Ne||be||xe||b!=null||V!=null||F!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function Nt(){let o=++Gt,i=`svg-scroll-draw-${o}`,h=`svg-scroll-draw-host-${o}`,X=`--svg-scroll-draw-${o}`,Ae=A==="reverse"?"0":"var(--ssd-len)",Se=A==="reverse"?"var(--ssd-len)":"0",de=`stroke-dashoffset:${Ae};`,v=`stroke-dashoffset:${Se};`;c&&(de+=`opacity:${A==="reverse"?1:0};`,v+=`opacity:${A==="reverse"?0:1};`);let M=document.createElement("style");M.setAttribute("data-svg-scroll-draw",""),M.textContent=`@keyframes ${i}{from{${de}}to{${v}}}.${h}{view-timeline-name:${X};view-timeline-axis:block;}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${ht};animation-fill-mode:both;animation-timeline:${X};animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(h);function Q(p,z){p.style.setProperty("--ssd-len",String(T[z])),p.style.strokeDasharray=`${T[z]}`,p.style.strokeDashoffset="",p.style.opacity="",p.style.animationPlayState="",p.classList.add(i);}C.forEach(Q);let y=false,L=-1;function O(){if(L>=0)return L;let p=e.getBoundingClientRect(),{tStart:z,tEnd:fe}=Fe({top:p.top,height:p.height},rt(),dt(),we,He);return me(le(rt(),z,fe,m))}return {destroy(){e.classList.remove(h),C.forEach(p=>{p.classList.remove(i),p.style.removeProperty("--ssd-len"),p.style.animationPlayState="";}),M.remove();},replay(){y=false,L=-1,C.forEach(Q);},pause(){y=true,C.forEach(p=>{p.style.animationPlayState="paused";});},resume(){y&&(y=false,C.forEach(p=>{p.style.animationPlayState="running";}));},seek(p){let z=Math.min(1,Math.max(0,p));L=z,y=true,C.forEach((fe,ae)=>{fe.classList.remove(i),fe.style.strokeDashoffset=A==="reverse"?`${T[ae]*z}`:`${T[ae]*(1-z)}`,c&&(fe.style.opacity=A==="reverse"?`${1-z}`:`${z}`);});},getProgress(){return O()},refresh(){C.forEach((p,z)=>{T[z]=ze(p),p.style.setProperty("--ssd-len",String(T[z])),p.style.strokeDasharray=`${T[z]}`;});}}}if(Ft())return nt(Nt());function Ht(){let o=Math.max(1,Ce),i=0,h=0,X=false;function Ae(y){let L=true;if(te){let O=Math.min(1,Math.max(0,y/o)),p=me(O);ie=p,e.style.setProperty("--scroll-draw-progress",String(p)),e.style.clipPath=ve(A==="reverse"?1-p:p),w?.(p),O<1&&(L=false);}else C.forEach((O,p)=>{let z=p*D*o,fe=Math.min(1,Math.max(0,(y-z)/o)),ae=me(fe);O.style.strokeDashoffset=A==="reverse"?`${T[p]*ae}`:`${T[p]*(1-ae)}`,c&&(O.style.opacity=A==="reverse"?`${1-ae}`:`${ae}`),ue&&Y?O.style.stroke=Ve(ue,Y,ae):Y&&(O.style.stroke=Y),U!==null&&H!==null?O.style.strokeWidth=`${U+(H-U)*ae}`:H!==null&&(O.style.strokeWidth=`${H}`),re!==null&&W!==null?O.style.fillOpacity=`${re+(W-re)*ae}`:W!==null&&(O.style.fillOpacity=`${W}`),N&&O.tagName.toLowerCase()==="path"&&s[p]&&O.setAttribute("d",at(s[p],N,ae)),p===0&&(ie=ae,w?.(ae),e.style.setProperty("--scroll-draw-progress",String(ae))),fe<1&&(L=false);});if(B){let O=Math.min(1,Math.max(0,y/o)),p=me(O);for(let z in B){let fe=parseFloat(z);p>=fe&&!Re.has(fe)&&(Re.add(fe),B[z]?.());}}return L}function Se(y){if(_)return;let L=y-i;I||(I=true,P?.());let O=Ae(L);if(O&&!k){k=true,Ae(o*(1+Math.max(0,C.length-1)*D)),ne?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,De=setTimeout(()=>{i=performance.now(),I=false,k=false,Re.clear(),Ge(),R=requestAnimationFrame(Se);},ke));return}O||(R=requestAnimationFrame(Se));}function de(){cancelAnimationFrame(R),clearTimeout(De),i=performance.now(),h=0,_=false,I=false,k=false,Te=0,X=true,ie=0,Re.clear(),Ge(),R=requestAnimationFrame(Se);}let v=new IntersectionObserver(y=>{y.forEach(L=>{L.isIntersecting&&!(J&&k)?de():!L.isIntersecting&&!J&&!k&&(cancelAnimationFrame(R),clearTimeout(De),X=false);});},{root:ce??null,threshold:ge,rootMargin:j}),M;function Q(){clearTimeout(M),M=setTimeout(()=>{C.forEach((y,L)=>{T[L]=ze(y),y.style.strokeDasharray=`${T[L]}`;});},150);}return window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q),E>0?setTimeout(()=>v.observe(e),E):v.observe(e),{destroy(){cancelAnimationFrame(R),clearTimeout(De),v.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),clearTimeout(M);},replay(){Te=0,de();},pause(){_||!X||(_=true,h=performance.now()-i,cancelAnimationFrame(R));},resume(){_&&(_=false,X=true,i=performance.now()-h,R=requestAnimationFrame(Se));},seek(y){let L=Math.min(1,Math.max(0,y));ie=L,_=true,h=L*o,i=performance.now()-h,cancelAnimationFrame(R),Ae(h);},getProgress(){return ie},refresh(){clearTimeout(M),C.forEach((y,L)=>{T[L]=ze(y),y.style.strokeDasharray=`${T[L]}`;});}}}if(Le)return nt(Ht());yt();function je(){if(!pe||_)return;let o=performance.now(),i=rt();if(!Oe&&ee===false&&i===ft){R=requestAnimationFrame(je);return}Oe=false,ft=i;let h=m;if(ee!==false){let v=o-pt,M=v>0?Math.abs(i-(Be<0?i:Be))/v:0;h=m*Math.max(.2,1+M*(typeof ee=="number"?ee:1)*.04);}Be=i,pt=o;let X=g?G===-1||i>=G?"forward":"reverse":A;G=i;let Ae=oe-u,Se=true,de=Ae===0?0:(i-u)/Ae;if(isNaN(_e)||(_e<=0&&de>0?he?.():_e>0&&de<=0&&xe?.(),_e<1&&de>=1?Ne?.():_e>=1&&de<1&&be?.()),_e=de,te){let v=me(le(i,u,oe,h));J&&!g&&(se=Math.max(se,v),v=se),ie=v,e.style.setProperty("--scroll-draw-progress",String(v));let M=X==="reverse"?1-v:v;e.style.clipPath=ve(M),w?.(v),!I&&le(i,u,oe,h)>0&&(I=true,P?.()),v>=1&&!k?(k=true,ne?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,De=setTimeout(()=>{se=-1,I=false,k=false,e.style.clipPath=ve(0);},ke))):v<1&&!J&&(k=false),R=requestAnimationFrame(je);return}if(C.forEach((v,M)=>{let Q=M*D*Ae,y=me(le(i,u+Q,oe+Q,h));J&&!g&&(se=Math.max(se,y),y=se),ie=y,v.style.strokeDashoffset=X==="reverse"?`${T[M]*y}`:`${T[M]*(1-y)}`,c&&(v.style.opacity=X==="reverse"?`${1-y}`:`${y}`),ue&&Y?v.style.stroke=Ve(ue,Y,y):Y&&(v.style.stroke=Y),U!==null&&H!==null?v.style.strokeWidth=`${U+(H-U)*y}`:H!==null&&(v.style.strokeWidth=`${H}`),re!==null&&W!==null?v.style.fillOpacity=`${re+(W-re)*y}`:W!==null&&(v.style.fillOpacity=`${W}`),N&&v.tagName.toLowerCase()==="path"&&s[M]&&v.setAttribute("d",at(s[M],N,y)),M===0&&(w?.(y),e.style.setProperty("--scroll-draw-progress",String(y))),y<1&&(Se=false);}),B){let v=me(le(i,u,oe,h));for(let M in B){let Q=parseFloat(M);v>=Q&&!Re.has(Q)&&(Re.add(Q),B[M]?.());}}!I&&le(i,u,oe,h)>0&&(I=true,P?.()),Se&&!k?(k=true,ne?.(),Te<(q==="infinite"?1/0:q??0)&&(Te++,De=setTimeout(()=>{se=-1,I=false,k=false,Re.clear(),Ge(),Oe=true;},ke))):!Se&&!J&&(k=false),R=requestAnimationFrame(je);}let ot=false;function Ye(){ot||(ot=true,R=requestAnimationFrame(function(){je();}));}function Ue(){ot=false,cancelAnimationFrame(R);}let st=new IntersectionObserver(o=>{o.forEach(i=>{pe=i.isIntersecting,pe&&!_?(Oe=true,Ye()):Ue();});},{root:ce??null,threshold:ge,rootMargin:j});function bt(){C.forEach((o,i)=>{T[i]=ze(o),o.style.strokeDasharray=`${T[i]}`;}),yt(),Oe=true;}let Xe;function qe(){clearTimeout(Xe),Xe=setTimeout(bt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let We;return typeof ResizeObserver<"u"&&(We=new ResizeObserver(()=>qe()),We.observe(document.body),We.observe(document.documentElement),We.observe(e)),E>0?setTimeout(()=>st.observe(e),E):st.observe(e),nt({destroy(){cancelAnimationFrame(R),clearTimeout(De),Ue(),st.disconnect(),We?.disconnect(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(Xe),mt();},replay(){se=-1,G=-1,Be=-1,I=false,k=false,Te=0,_=false,ie=0,Re.clear(),clearTimeout(De),Ge(),Oe=true,pe&&Ye();},pause(){_=true,Ue();},resume(){_&&(_=false,Oe=true,pe&&Ye());},seek(o){let i=Math.min(1,Math.max(0,o));ie=i,se=i,_=true,Ue(),Ot(i,A),Oe=true;},getProgress(){return ie},refresh(){clearTimeout(Xe),bt(),pe&&!_&&Ye();}},()=>({tStart:u,tEnd:oe}))}function Qt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Lt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let l=[],a=[],d=n[2].trim();if(d)for(let m of d.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(c?parseFloat(c[1]):0),a.push(c?c[2]:"");}r.push({fn:n[1],nums:l,units:a});}return r}function Zt(e,r,t){let n=Lt(e),l=Lt(r);return n.length===0||n.length!==l.length?t<1?e:r:n.map((a,d)=>{let m=l[d];return a.fn!==m.fn||a.nums.length!==m.nums.length?t<1?`${a.fn}(${a.nums.map((c,f)=>`${c}${a.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,f)=>`${c}${m.units[f]}`).join(", ")})`:`${a.fn}(${a.nums.map((c,f)=>`${c+(m.nums[f]-c)*t}${a.units[f]}`).join(", ")})`}).join(" ")}function Ct(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),l=String(r);if(Qt(n))return Ve(n,l,t);if(n.includes("("))return Zt(n,l,t);let a=n.match(/^([-+]?[\d.]+)(.*)$/),d=l.match(/^([-+]?[\d.]+)(.*)$/);if(a&&d){let m=parseFloat(a[1]),c=parseFloat(d[1]);return `${m+(c-m)*t}${a[2]||d[2]}`}return t<1?n:l}function Kt(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Jt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),er=0,It="--scroll-draw-progress";function tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Dt(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let{props:n,trigger:l={},easing:a="ease-out",speed:d=1,once:m=false,axis:c="y",scrollContainer:f,native:x=true,velocityScale:D=false,respectReducedMotion:A=true,triggerElement:J,onProgress:Ee,onComplete:S,onEnter:$,onLeave:g,onEnterBack:E,onLeaveBack:b}=r,V=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,F=typeof a=="function"?a:Z[a]??Z["ease-out"],B=$e(l.start??"top bottom"),ee=$e(l.end??"bottom top"),ge=J??e,j=typeof f=="string"?document.querySelector(f):f??null,q=Object.entries(n).map(([s,u])=>({prop:Kt(s),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function ke(){let s=window.getComputedStyle(e);for(let u of q)u.from===""&&(u.from=s.getPropertyValue(u.prop).trim()||"0");}function N(){for(let s of q)e.style.setProperty(s.prop,String(s.to));}let ye=new Map;for(let s of [...q.map(u=>u.prop),It])ye.set(s,e.style.getPropertyValue(s));function Le(){for(let[s,u]of ye)u?e.style.setProperty(s,u):e.style.removeProperty(s);}if(V)return N(),S?.(),{...t,destroy:Le,getProgress:()=>1};ke();let Ce=typeof a=="string"?Ke(a):null;function Ie(){if(!x||!tr()||!Ce||c!=="y"||j||ge!==e||m||d!==1||Ee||S||$||g||E||b||D!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let s of q)if(!Jt.has(s.prop))return false;return true}function w(){let s=`ssd-a-${++er}`,u=q.map(G=>`${G.prop}:${G.from}`).join(";"),oe=q.map(G=>`${G.prop}:${G.to}`).join(";"),k=document.createElement("style");k.setAttribute("data-ssd-animate",""),k.textContent=`@keyframes ${s}{from{${u}}to{${oe}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${Ce};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(k),e.classList.add(s);let I=()=>c==="x"?window.scrollX:window.scrollY,R=()=>c==="x"?window.innerWidth:window.innerHeight,pe=()=>{let G=e.getBoundingClientRect();return Fe({top:G.top,height:G.height},I(),R(),B,ee)};Me(e,{type:"animate",getProgress:()=>se.getProgress(),getTrigger:pe});let se={destroy(){e.classList.remove(s),k.remove(),e.style.animationPlayState="",Le(),Pe(e);},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(G){let _=Math.min(1,Math.max(0,G));e.classList.remove(s);for(let ie of q)e.style.setProperty(ie.prop,Ct(ie.from,ie.to,_));},getProgress(){let{tStart:G,tEnd:_}=pe();return F(le(I(),G,_,d))}};return se}if(Ie())return w();let P=0,ne=0,he=0,Ne=false,be=false,xe=-1,te=0,me=false,we=NaN,He=-1,ce=0,ue=()=>j?c==="x"?j.scrollLeft:j.scrollTop:c==="x"?window.scrollX:window.scrollY,Y=()=>j?c==="x"?j.clientWidth:j.clientHeight:c==="x"?window.innerWidth:window.innerHeight;function U(){let s=Qe(ge,j,c),u=Fe(s,s.scroll,Y(),B,ee);P=u.tStart,ne=u.tEnd;}function H(s){e.style.setProperty(It,String(s));for(let u of q)e.style.setProperty(u.prop,Ct(u.from,u.to,s));Ee?.(s);}function re(s){if(isNaN(we)){we=s;return}we<=0&&s>0?$?.():we>0&&s<=0&&b?.(),we<1&&s>=1?g?.():we>=1&&s<1&&E?.(),we=s;}function W(){if(!Ne||be)return;let s=performance.now(),u=ue(),oe=d;if(D!==false){let R=s-ce,pe=R>0?Math.abs(u-(He<0?u:He))/R:0;oe=d*Math.max(.2,1+pe*(typeof D=="number"?D:1)*.04);}He=u,ce=s;let k=ne===P?0:(u-P)/(ne-P);re(k);let I=F(le(u,P,ne,oe));m&&(xe=Math.max(xe,I),I=xe),te=I,H(I),I>=1&&!me?(me=true,S?.()):I<1&&!m&&(me=false),he=requestAnimationFrame(W);}U(),ne===P&&K("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let s=F(le(ue(),P,ne,d));m&&s>0&&(xe=s),te=s,H(s);}let ve=new IntersectionObserver(s=>{s.forEach(u=>{Ne=u.isIntersecting,Ne&&!be?he=requestAnimationFrame(W):cancelAnimationFrame(he);});},{root:j??null}),C;function T(){clearTimeout(C),C=setTimeout(U,150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),ve.observe(e),Me(e,{type:"animate",getProgress:()=>te,getTrigger:()=>({tStart:P,tEnd:ne})}),{destroy(){cancelAnimationFrame(he),ve.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(C),Le(),Pe(e);},replay(){xe=-1,me=false,te=0,be=false,H(0);},pause(){be=true,cancelAnimationFrame(he);},resume(){be&&(be=false,Ne&&(he=requestAnimationFrame(W)));},seek(s){let u=Math.min(1,Math.max(0,s));te=u,xe=u,be=true,cancelAnimationFrame(he),H(u);},getProgress(){return te}}}var Je={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rr(e,r){if(typeof window>"u")return Je;let t=typeof e=="string"?document.querySelector(e):e;return t?Dt(t,r):(K("scrollAnimate: element not found:",e),Je)}function nr(e,r={}){if(typeof window>"u")return Je;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return K("scrollParallax: element not found:",e),Je;let{speed:n=.3,axis:l="y",easing:a="linear",trigger:d,onProgress:m}=r,c=t.getBoundingClientRect(),f=l==="x"?c.width:c.height,x=n*f;return Dt(t,{props:l==="x"?{transform:["translateX(0px)",`translateX(${-x}px)`]}:{transform:["translateY(0px)",`translateY(${-x}px)`]},trigger:d??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:m})}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function or(e,r){if(typeof window>"u")return lt;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return K("scrollCounter: element not found:",e),lt;let n=t,{from:l=0,to:a,format:d,easing:m="ease-out",trigger:c={},once:f=true,decimals:x,onComplete:D}=r,A=x!==void 0?w=>w.toFixed(x):d??(w=>String(Math.round(w))),J=typeof m=="function"?m:Z[m]??Z["ease-out"],Ee=$e(c.start??"top 80%"),S=$e(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.textContent=A(a),D?.(),lt;let g=0,E=0,b=0,V=false,F=false,B=-1,ee=0,ge=false,j=()=>window.scrollY,q=()=>window.innerHeight;function ke(){let w=n.getBoundingClientRect(),P=Fe({top:w.top,height:w.height},j(),q(),Ee,S);g=P.tStart,E=P.tEnd;}function N(w){n.textContent=A(l+(a-l)*w),n.style.setProperty("--scroll-draw-progress",String(w));}function ye(){if(!V||F)return;let w=J(le(j(),g,E,1));f&&(B=Math.max(B,w),w=B),ee=w,N(w),w>=1&&!ge?(ge=true,D?.()):w<1&&!f&&(ge=false),b=requestAnimationFrame(ye);}ke();{let w=J(le(j(),g,E,1));f&&w>0&&(B=w),ee=w,N(w);}let Le=new IntersectionObserver(w=>{w.forEach(P=>{V=P.isIntersecting,V&&!F?b=requestAnimationFrame(ye):cancelAnimationFrame(b);});}),Ce;function Ie(){clearTimeout(Ce),Ce=setTimeout(ke,150);}return window.addEventListener("resize",Ie),window.addEventListener("orientationchange",Ie),Le.observe(n),Me(n,{type:"counter",getProgress:()=>ee,getTrigger:()=>({tStart:g,tEnd:E})}),{destroy(){cancelAnimationFrame(b),Le.disconnect(),window.removeEventListener("resize",Ie),window.removeEventListener("orientationchange",Ie),clearTimeout(Ce),Pe(n);},replay(){B=-1,ge=false,ee=0,F=false,N(0);},pause(){F=true,cancelAnimationFrame(b);},resume(){F&&(F=false,V&&(b=requestAnimationFrame(ye)));},seek(w){let P=Math.min(1,Math.max(0,w));ee=P,B=P,F=true,cancelAnimationFrame(b),N(P);},getProgress(){return ee}}}var Rt="http://www.w3.org/2000/svg",sr="cinematic-photo",ct=e=>e<0?0:e>1?1:e;function et(e){let r=parseFloat(e);return Number.isFinite(r)?ct(r/100):0}function ir(e){return Z[e]??Z.linear}var ar={destroy:()=>{},getProgress:()=>0},ut=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||K("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return ar;t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let l=[];for(let S of r.scenes){if(S.background){let g=document.createElement("img");g.id=sr,g.src=S.background,g.alt="",g.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(g);}let $=S.animations.filter(g=>g.type==="draw");if($.length){let g=document.createElementNS(Rt,"svg");g.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),g.setAttribute("preserveAspectRatio","xMidYMid meet"),g.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(g);for(let E of $){let b=document.createElementNS(Rt,"path");b.id=E.target.replace(/^#/,""),b.setAttribute("d",E.d),b.setAttribute("fill","none"),b.setAttribute("stroke",E.stroke),b.setAttribute("stroke-width",String(E.strokeWidth)),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round");let V=E.length||b.getTotalLength?.()||0;b.style.strokeDasharray=String(V),b.style.strokeDashoffset=String(V),g.appendChild(b),l.push({kind:"draw",el:b,start:et(E.start),end:et(E.end),ease:ir(E.easing),length:V});}}for(let g of S.animations){if(g.type!=="fade")continue;let E=n.querySelector(g.target)??document.querySelector(g.target);E&&(E.style.opacity=String(g.from),l.push({kind:"fade",el:E,start:et(g.start),end:et(g.end),ease:Z["ease-in-out"]??Z.linear,from:g.from,to:g.to}));}}let a=0,d=()=>{let S=t.offsetHeight-window.innerHeight;return S<=0?t.getBoundingClientRect().top<=0?1:0:ct(-t.getBoundingClientRect().top/S)},m=S=>{for(let $ of l){let g=$.end-$.start,E=g<=0?S>=$.end?1:0:ct((S-$.start)/g),b=$.ease(E);$.kind==="draw"?$.el.style.strokeDashoffset=String($.length*(1-b)):$.el.style.opacity=String($.from+($.to-$.from)*b);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let c=0,f=false,x=false,D=()=>{a=d(),m(a),f&&(c=requestAnimationFrame(D));},A=()=>{f||(f=true,c=requestAnimationFrame(D));},J=()=>{f=false,cancelAnimationFrame(c);},Ee=new IntersectionObserver(S=>{for(let $ of S)x=$.isIntersecting,x?A():J();},{threshold:0});return Ee.observe(n),a=d(),m(a),Me(t,{type:"draw",getProgress:()=>a,getTrigger:()=>{let S=t.getBoundingClientRect().top+window.scrollY;return {tStart:S,tEnd:S+Math.max(0,t.offsetHeight-window.innerHeight)}}}),{destroy(){J(),Ee.disconnect(),Pe(t);},getProgress:()=>a}}};function Or(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?kt(n,r):(K("Container not found:",e),t)}
4
+ export{ut as Cinematic,it as PRESETS,Et as createBounce,xt as createElastic,_t as createSpring,rr as scrollAnimate,or as scrollCounter,Or as scrollDraw,nr as scrollParallax};
@@ -1,3 +1,3 @@
1
- 'use strict';var vue=require('vue');function jt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<n;d++){let x=Math.pow(l,d);c.push(x),s+=x;}let u=[0],m=0;for(let d=0;d<n;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let x=0;x<n;x++)if(d<=u[x+1]){let N=(d-u[x])/(u[x+1]-u[x]);if(x===0)return N*(2-N);let C=1-Math.pow(t,x);return C+(1-C)*(2*N-1)*(2*N-1)}return 1}}function Ut({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var ee={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:jt(),elastic:Ut()};function pe(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ct(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Lt(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function Be(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Xt(e,r,n){return Math.min(n,Math.max(r,e))}function Q(e,r,n,t){return n===r?0:Xt((e-r)/(n-r)*t,0,1)}function tt(e,r,n){let t=e.getBoundingClientRect(),l=n==="x"?t.width:t.height;return r?{top:n==="x"?t.left-r.getBoundingClientRect().left+r.scrollLeft:t.top-r.getBoundingClientRect().top+r.scrollTop,height:l,scroll:0}:{top:n==="x"?t.left:t.top,height:l,scroll:n==="x"?window.scrollX:window.scrollY}}function xe(e,r,n,t,l){let s=Ct(e.top,e.height,r,t.element)-Lt(t.viewport,n),c=Ct(e.top,e.height,r,l.element)-Lt(l.viewport,n);return {tStart:s,tEnd:c}}function $t(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,r,n){let t=$t(e),l=$t(r);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*n)},${Math.round(t[1]+(l[1]-t[1])*n)},${Math.round(t[2]+(l[2]-t[2])*n)})`}var Pt={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 nt=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ye(e,...r){nt&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var Yt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Qt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ot=33;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Jt(e){let r=[];for(let n=0;n<Ot;n++){let t=n/(Ot-1);r.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${r.join(",")})`}function rt(e){switch(e){case "linear":return "linear";case "ease-in":return Yt;case "ease-out":return Qt;case "ease-in-out":return Zt()?Jt(ee["ease-in-out"]):null;default:return null}}var Kt=0;function en(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function tn(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?ye("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&ye("Element has a fill \u2014 it may obscure the stroke animation.",e);}function nn(e,r,n){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=n==="x"?window.scrollX:window.scrollY,c=e-s,u=r-s,m=n==="x";t.innerHTML=`
1
+ 'use strict';var vue=require('vue');function Xt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let x=Math.pow(l,d);c.push(x),s+=x;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let x=0;x<r;x++)if(d<=u[x+1]){let N=(d-u[x])/(u[x+1]-u[x]);if(x===0)return N*(2-N);let C=1-Math.pow(t,x);return C+(1-C)*(2*N-1)*(2*N-1)}return 1}}function Qt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var ee={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Xt(),elastic:Qt()};function fe(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function $t(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function Pt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function Be(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Zt(e,n,r){return Math.min(r,Math.max(n,e))}function Q(e,n,r,t){return r===n?0:Zt((e-n)/(r-n)*t,0,1)}function tt(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=$t(e.top,e.height,n,t.element)-Pt(t.viewport,r),c=$t(e.top,e.height,n,l.element)-Pt(l.viewport,r);return {tStart:s,tEnd:c}}function Ot(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,n,r){let t=Ot(e),l=Ot(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var kt={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 rt=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function be(e,...n){rt&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Kt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Jt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Dt=33;function er(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function tr(e){let n=[];for(let r=0;r<Dt;r++){let t=r/(Dt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function nt(e){switch(e){case "linear":return "linear";case "ease-in":return Kt;case "ease-out":return Jt;case "ease-in-out":return er()?tr(ee["ease-in-out"]):null;default:return null}}var Rt=Symbol.for("svg-scroll-draw.registry");function Ft(){let e=globalThis;return e[Rt]||(e[Rt]=new Map)}function Ce(e,n){Ft().set(e,n);}function Le(e){Ft().delete(e);}var rr=0;function nr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function or(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?be("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&be("Element has a fill \u2014 it may obscure the stroke animation.",e);}function sr(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var kt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Dt=/[MmLlHhVvCcSsQqTtAaZz]/g;function rn(e,r,n){if(!nt)return;let t=(e.match(Dt)??[]).join("").toUpperCase(),l=(r.match(Dt)??[]).join("").toUpperCase(),s=(e.match(kt)??[]).length,c=(r.match(kt)??[]).length;if(t!==l){ye(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}s!==c&&ye(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function lt(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*n).toFixed(4))})}function ct(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,l=n?{...Pt[n],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:x={},stagger:N=0,direction:C="forward",once:te=false,debug:Me=false,axis:B="y",scrollContainer:Z,autoReverse:X=false,delay:W=0,strokeColor:A,strokeWidth:L,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:$="0px",repeat:E=0,repeatDelay:ne=0,morphTo:D,clip:re,autoplay:oe=false,duration:J=1e3,native:ue=true,onProgress:y,onStart:T,onComplete:g,onEnter:p,onLeave:R,onEnterBack:de,onLeaveBack:ve}=l,me=re===true?"left":typeof re=="string"?re:false,Se=typeof d=="function"?d:ee[d]??ee.linear,Ce=pe(x.start??"top bottom"),_e=pe(x.end??"bottom top"),he=typeof Z=="string"?document.querySelector(Z):Z??null,be=Array.isArray(A)?A[0]:null,se=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ie=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null,fe=Array.isArray(M)?M[0]:null,Y=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Le(o){let a=o*100;switch(me){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let V=me?[]:Array.from(e.querySelectorAll(c)),P=[],i=[],f=0,we=0,I=false,z=false,_=0,j=false,ae=-1,$e=-1,K=false,Ee=0,Fe=0,Ie,ot=null;function vt(){ot?.destroy(),ot=null;}let He=new Set,St=NaN,Ne=true,Ye=-1,Et=performance.now(),qe=NaN;function st(){return he?B==="x"?he.scrollLeft:he.scrollTop:B==="x"?window.scrollX:window.scrollY}function Tt(){return he?B==="x"?he.clientWidth:he.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function xt(){let o=tt(e,he,B),a=xe(o,o.scroll,Tt(),Ce,_e);f=a.tStart,we=a.tEnd,Me&&nt&&(vt(),ot=nn(f,we,B));}function qt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),me){let v=a==="reverse"?1-o:o;e.style.clipPath=Le(v);return}V.forEach((v,le)=>{v.style.strokeDashoffset=a==="reverse"?`${P[le]*o}`:`${P[le]*(1-o)}`,m&&(v.style.opacity=a==="reverse"?`${1-o}`:`${o}`),be&&se?v.style.stroke=We(be,se,o):se&&(v.style.stroke=se),ie!==null&&G!==null?v.style.strokeWidth=`${ie+(G-ie)*o}`:G!==null&&(v.style.strokeWidth=`${G}`),fe!==null&&Y!==null?v.style.fillOpacity=`${fe+(Y-fe)*o}`:Y!==null&&(v.style.fillOpacity=`${Y}`),D&&v.tagName.toLowerCase()==="path"&&i[le]&&v.setAttribute("d",lt(i[le],D,o));});}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),me){e.style.clipPath=Le(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${P[a]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${P[a]}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{tn(o);let a=Be(o);P.push(a);let v=o.tagName.toLowerCase()==="path";v?i.push(o.getAttribute("d")??""):i.push(""),D&&(v?rn(i[i.length-1],D,o):ye(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),se&&(o.style.stroke=se),G!==null&&(o.style.strokeWidth=`${G}`),Y!==null&&(o.style.fillOpacity=`${Y}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?"0":`${a}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`));}),me){if(s)return e.style.clipPath=Le(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Le(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let At=typeof d=="string"?rt(d):null;function Bt(){return !(ue===false||!en()||!V.length||!At||me||B!=="y"||he||u!==1||N!==0||te||X||O!==false||D||w||E||W>0||y||T||g||p||R||de||ve||A!=null||L!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function Wt(){let o=++Kt,a=`svg-scroll-draw-${o}`,v=`svg-scroll-draw-host-${o}`,le=`--svg-scroll-draw-${o}`,Re=C==="reverse"?"0":"var(--ssd-len)",Pe=C==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Re};`,S=`stroke-dashoffset:${Pe};`;m&&(Ae+=`opacity:${C==="reverse"?1:0};`,S+=`opacity:${C==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Ae}}to{${S}}}.${v}{view-timeline-name:${le};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${At};animation-fill-mode:both;animation-timeline:${le};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(v);function ce(h,U){h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(a);}V.forEach(ce);let b=false,H=-1;function q(){if(H>=0)return H;let h=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:h.top,height:h.height},st(),Tt(),Ce,_e);return Se(Q(st(),U,Te,u))}return {destroy(){e.classList.remove(v),V.forEach(h=>{h.classList.remove(a),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),F.remove();},replay(){b=false,H=-1,V.forEach(ce);},pause(){b=true,V.forEach(h=>{h.style.animationPlayState="paused";});},resume(){b&&(b=false,V.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let U=Math.min(1,Math.max(0,h));H=U,b=true,V.forEach((Te,ge)=>{Te.classList.remove(a),Te.style.strokeDashoffset=C==="reverse"?`${P[ge]*U}`:`${P[ge]*(1-U)}`,m&&(Te.style.opacity=C==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return q()},refresh(){V.forEach((h,U)=>{P[U]=Be(h),h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`;});}}}if(Bt())return Wt();function Gt(){let o=Math.max(1,J),a=0,v=0,le=false;function Re(b){let H=true;if(me){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);Ee=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=Le(C==="reverse"?1-h:h),y?.(h),q<1&&(H=false);}else V.forEach((q,h)=>{let U=h*N*o,Te=Math.min(1,Math.max(0,(b-U)/o)),ge=Se(Te);q.style.strokeDashoffset=C==="reverse"?`${P[h]*ge}`:`${P[h]*(1-ge)}`,m&&(q.style.opacity=C==="reverse"?`${1-ge}`:`${ge}`),be&&se?q.style.stroke=We(be,se,ge):se&&(q.style.stroke=se),ie!==null&&G!==null?q.style.strokeWidth=`${ie+(G-ie)*ge}`:G!==null&&(q.style.strokeWidth=`${G}`),fe!==null&&Y!==null?q.style.fillOpacity=`${fe+(Y-fe)*ge}`:Y!==null&&(q.style.fillOpacity=`${Y}`),D&&q.tagName.toLowerCase()==="path"&&i[h]&&q.setAttribute("d",lt(i[h],D,ge)),h===0&&(Ee=ge,y?.(ge),e.style.setProperty("--scroll-draw-progress",String(ge))),Te<1&&(H=false);});if(w){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);for(let U in w){let Te=parseFloat(U);h>=Te&&!He.has(Te)&&(He.add(Te),w[U]?.());}}return H}function Pe(b){if(K)return;let H=b-a;z||(z=true,T?.());let q=Re(H);if(q&&!I){I=true,Re(o*(1+Math.max(0,V.length-1)*N)),g?.(),Fe<(E==="infinite"?1/0:E??0)&&(Fe++,Ie=setTimeout(()=>{a=performance.now(),z=false,I=false,He.clear(),Qe(),_=requestAnimationFrame(Pe);},ne));return}q||(_=requestAnimationFrame(Pe));}function Ae(){cancelAnimationFrame(_),clearTimeout(Ie),a=performance.now(),v=0,K=false,z=false,I=false,Fe=0,le=true,Ee=0,He.clear(),Qe(),_=requestAnimationFrame(Pe);}let S=new IntersectionObserver(b=>{b.forEach(H=>{H.isIntersecting&&!(te&&I)?Ae():!H.isIntersecting&&!te&&!I&&(cancelAnimationFrame(_),clearTimeout(Ie),le=false);});},{root:he??null,threshold:k,rootMargin:$}),F;function ce(){clearTimeout(F),F=setTimeout(()=>{V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});},150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),W>0?setTimeout(()=>S.observe(e),W):S.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Ie),S.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(F);},replay(){Fe=0,Ae();},pause(){K||!le||(K=true,v=performance.now()-a,cancelAnimationFrame(_));},resume(){K&&(K=false,le=true,a=performance.now()-v,_=requestAnimationFrame(Pe));},seek(b){let H=Math.min(1,Math.max(0,b));Ee=H,K=true,v=H*o,a=performance.now()-v,cancelAnimationFrame(_),Re(v);},getProgress(){return Ee},refresh(){clearTimeout(F),V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});}}}if(oe)return Gt();xt();function Ze(){if(!j||K)return;let o=performance.now(),a=st();if(!Ne&&O===false&&a===St){_=requestAnimationFrame(Ze);return}Ne=false,St=a;let v=u;if(O!==false){let S=o-Et,F=S>0?Math.abs(a-(Ye<0?a:Ye))/S:0;v=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Ye=a,Et=o;let le=X?$e===-1||a>=$e?"forward":"reverse":C;$e=a;let Re=we-f,Pe=true,Ae=Re===0?0:(a-f)/Re;if(isNaN(qe)||(qe<=0&&Ae>0?p?.():qe>0&&Ae<=0&&ve?.(),qe<1&&Ae>=1?R?.():qe>=1&&Ae<1&&de?.()),qe=Ae,me){let S=Se(Q(a,f,we,v));te&&!X&&(ae=Math.max(ae,S),S=ae),Ee=S,e.style.setProperty("--scroll-draw-progress",String(S));let F=le==="reverse"?1-S:S;e.style.clipPath=Le(F),y?.(S),!z&&Q(a,f,we,v)>0&&(z=true,T?.()),S>=1&&!I?(I=true,g?.(),Fe<(E==="infinite"?1/0:E??0)&&(Fe++,Ie=setTimeout(()=>{ae=-1,z=false,I=false,e.style.clipPath=Le(0);},ne))):S<1&&!te&&(I=false),_=requestAnimationFrame(Ze);return}if(V.forEach((S,F)=>{let ce=F*N*Re,b=Se(Q(a,f+ce,we+ce,v));te&&!X&&(ae=Math.max(ae,b),b=ae),Ee=b,S.style.strokeDashoffset=le==="reverse"?`${P[F]*b}`:`${P[F]*(1-b)}`,m&&(S.style.opacity=le==="reverse"?`${1-b}`:`${b}`),be&&se?S.style.stroke=We(be,se,b):se&&(S.style.stroke=se),ie!==null&&G!==null?S.style.strokeWidth=`${ie+(G-ie)*b}`:G!==null&&(S.style.strokeWidth=`${G}`),fe!==null&&Y!==null?S.style.fillOpacity=`${fe+(Y-fe)*b}`:Y!==null&&(S.style.fillOpacity=`${Y}`),D&&S.tagName.toLowerCase()==="path"&&i[F]&&S.setAttribute("d",lt(i[F],D,b)),F===0&&(y?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Pe=false);}),w){let S=Se(Q(a,f,we,v));for(let F in w){let ce=parseFloat(F);S>=ce&&!He.has(ce)&&(He.add(ce),w[F]?.());}}!z&&Q(a,f,we,v)>0&&(z=true,T?.()),Pe&&!I?(I=true,g?.(),Fe<(E==="infinite"?1/0:E??0)&&(Fe++,Ie=setTimeout(()=>{ae=-1,z=false,I=false,He.clear(),Qe(),Ne=true;},ne))):!Pe&&!te&&(I=false),_=requestAnimationFrame(Ze);}let it=false;function Je(){it||(it=true,_=requestAnimationFrame(function(){Ze();}));}function Ke(){it=false,cancelAnimationFrame(_);}let at=new IntersectionObserver(o=>{o.forEach(a=>{j=a.isIntersecting,j&&!K?(Ne=true,Je()):Ke();});},{root:he??null,threshold:k,rootMargin:$});function Mt(){V.forEach((o,a)=>{P[a]=Be(o),o.style.strokeDasharray=`${P[a]}`;}),xt(),Ne=true;}let et;function Ge(){clearTimeout(et),et=setTimeout(Mt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),W>0?setTimeout(()=>at.observe(e),W):at.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Ie),Ke(),at.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(et),vt();},replay(){ae=-1,$e=-1,Ye=-1,z=false,I=false,Fe=0,K=false,Ee=0,He.clear(),clearTimeout(Ie),Qe(),Ne=true,j&&Je();},pause(){K=true,Ke();},resume(){K&&(K=false,Ne=true,j&&Je());},seek(o){let a=Math.min(1,Math.max(0,o));Ee=a,ae=a,K=true,Ke(),qt(a,C),Ne=true;},getProgress(){return Ee},refresh(){clearTimeout(et),Mt(),j&&!K&&Je();}}}var Ft=new Map;function Ve(e,r){Ft.set(e,r);}function ze(e){Ft.delete(e);}function on(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Rt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}r.push({fn:t[1],nums:l,units:s});}return r}function sn(e,r,n){let t=Rt(e),l=Rt(r);return t.length===0||t.length!==l.length?n<1?e:r:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?n<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*n}${s.units[d]}`).join(", ")})`}).join(" ")}function It(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),l=String(r);if(on(t))return We(t,l,n);if(t.includes("("))return sn(t,l,n);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*n}${s[2]||c[2]}`}return n<1?t:l}function an(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var ln=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),cn=0,Ht="--scroll-draw-progress";function un(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ut(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:x=true,velocityScale:N=false,respectReducedMotion:C=true,triggerElement:te,onProgress:Me,onComplete:B,onEnter:Z,onLeave:X,onEnterBack:W,onLeaveBack:A}=r,L=C&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:ee[s]??ee["ease-out"],w=pe(l.start??"top bottom"),O=pe(l.end??"bottom top"),k=te??e,$=typeof d=="string"?document.querySelector(d):d??null,E=Object.entries(t).map(([i,f])=>({prop:an(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function ne(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let re=new Map;for(let i of [...E.map(f=>f.prop),Ht])re.set(i,e.style.getPropertyValue(i));function oe(){for(let[i,f]of re)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(L)return D(),B?.(),{...n,destroy:oe,getProgress:()=>1};ne();let J=typeof s=="string"?rt(s):null;function ue(){if(!x||!un()||!J||m!=="y"||$||k!==e||u||c!==1||Me||B||Z||X||W||A||N!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!ln.has(i.prop))return false;return true}function y(){let i=`ssd-a-${++cn}`,f=E.map(j=>`${j.prop}:${j.from}`).join(";"),we=E.map(j=>`${j.prop}:${j.to}`).join(";"),I=document.createElement("style");I.setAttribute("data-ssd-animate",""),I.textContent=`@keyframes ${i}{from{${f}}to{${we}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${J};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(i);let z=()=>m==="x"?window.scrollX:window.scrollY,_=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),I.remove(),e.style.animationPlayState="",oe();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(j){let ae=Math.min(1,Math.max(0,j));e.classList.remove(i);for(let $e of E)e.style.setProperty($e.prop,It($e.from,$e.to,ae));},getProgress(){let j=e.getBoundingClientRect(),ae=z(),$e=_(),{tStart:K,tEnd:Ee}=xe({top:j.top,height:j.height},ae,$e,w,O);return M(Q(ae,K,Ee,c))}}}if(ue())return y();let T=0,g=0,p=0,R=false,de=false,ve=-1,me=0,Se=false,Ce=NaN,_e=-1,he=0,be=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,se=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ie(){let i=tt(k,$,m),f=xe(i,i.scroll,se(),w,O);T=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(Ht,String(i));for(let f of E)e.style.setProperty(f.prop,It(f.from,f.to,i));Me?.(i);}function fe(i){if(isNaN(Ce)){Ce=i;return}Ce<=0&&i>0?Z?.():Ce>0&&i<=0&&A?.(),Ce<1&&i>=1?X?.():Ce>=1&&i<1&&W?.(),Ce=i;}function Y(){if(!R||de)return;let i=performance.now(),f=be(),we=c;if(N!==false){let _=i-he,j=_>0?Math.abs(f-(_e<0?f:_e))/_:0;we=c*Math.max(.2,1+j*(typeof N=="number"?N:1)*.04);}_e=f,he=i;let I=g===T?0:(f-T)/(g-T);fe(I);let z=M(Q(f,T,g,we));u&&(ve=Math.max(ve,z),z=ve),me=z,G(z),z>=1&&!Se?(Se=true,B?.()):z<1&&!u&&(Se=false),p=requestAnimationFrame(Y);}ie(),g===T&&ye("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(Q(be(),T,g,c));u&&i>0&&(ve=i),me=i,G(i);}let Le=new IntersectionObserver(i=>{i.forEach(f=>{R=f.isIntersecting,R&&!de?p=requestAnimationFrame(Y):cancelAnimationFrame(p);});},{root:$??null}),V;function P(){clearTimeout(V),V=setTimeout(ie,150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),Le.observe(e),Ve(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:T,tEnd:g})}),{destroy(){cancelAnimationFrame(p),Le.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(V),oe(),ze(e);},replay(){ve=-1,Se=false,me=0,de=false,G(0);},pause(){de=true,cancelAnimationFrame(p);},resume(){de&&(de=false,R&&(p=requestAnimationFrame(Y)));},seek(i){let f=Math.min(1,Math.max(0,i));me=f,ve=f,de=true,cancelAnimationFrame(p),G(f);},getProgress(){return me}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return ye("scrollCounter: element not found:",e),mt;let t=n,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:x,onComplete:N}=r,C=x!==void 0?y=>y.toFixed(x):c??(y=>String(Math.round(y))),te=typeof u=="function"?u:ee[u]??ee["ease-out"],Me=pe(m.start??"top 80%"),B=pe(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=C(s),N?.(),mt;let X=0,W=0,A=0,L=false,M=false,w=-1,O=0,k=false,$=()=>window.scrollY,E=()=>window.innerHeight;function ne(){let y=t.getBoundingClientRect(),T=xe({top:y.top,height:y.height},$(),E(),Me,B);X=T.tStart,W=T.tEnd;}function D(y){t.textContent=C(l+(s-l)*y),t.style.setProperty("--scroll-draw-progress",String(y));}function re(){if(!L||M)return;let y=te(Q($(),X,W,1));d&&(w=Math.max(w,y),y=w),O=y,D(y),y>=1&&!k?(k=true,N?.()):y<1&&!d&&(k=false),A=requestAnimationFrame(re);}ne();{let y=te(Q($(),X,W,1));d&&y>0&&(w=y),O=y,D(y);}let oe=new IntersectionObserver(y=>{y.forEach(T=>{L=T.isIntersecting,L&&!M?A=requestAnimationFrame(re):cancelAnimationFrame(A);});}),J;function ue(){clearTimeout(J),J=setTimeout(ne,150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),oe.observe(t),Ve(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:W})}),{destroy(){cancelAnimationFrame(A),oe.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(J),ze(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,L&&(A=requestAnimationFrame(re)));},seek(y){let T=Math.min(1,Math.max(0,y));O=T,w=T,M=true,cancelAnimationFrame(A),D(T);},getProgress(){return O}}}var Nt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,r={}){if(typeof window>"u")return Nt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return ye("scrollVideo: <video> element not found:",e),Nt;let t=n,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:d,onComplete:x,onProgress:N}=r,C=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof s=="function"?s:ee[s]??ee.linear,Me=pe(l.start??"top top"),B=pe(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Z=r.from??0,X=r.to,W=0,A=0,L=0,M=false,w=false,O=-1,k=0,$=false,E=false,ne=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function re(){let p=t.getBoundingClientRect(),R=u==="x"?p.left:p.top,de=u==="x"?p.width:p.height,ve=xe({top:R,height:de},ne(),D(),Me,B);W=ve.tStart,A=ve.tEnd;}function oe(p){if(!E)return;let R=X??t.duration??0;t.currentTime=Z+(R-Z)*p,t.style.setProperty("--scroll-draw-progress",String(p)),N?.(p);}function J(){if(!M||w||!E)return;let p=te(Q(ne(),W,A,1));c&&(O=Math.max(O,p),p=O),k=p,oe(p),p>=1&&!$?($=true,x?.()):p<1&&!c&&($=false),L=requestAnimationFrame(J);}function ue(){if(E=true,X===void 0&&(X=t.duration),C){oe(1),d?.();return}re(),d?.(),M&&!w&&(L=requestAnimationFrame(J));}t.readyState>=1?ue():t.addEventListener("loadedmetadata",ue,{once:true}),E||re();let y=new IntersectionObserver(p=>{p.forEach(R=>{M=R.isIntersecting,M&&!w&&E?L=requestAnimationFrame(J):cancelAnimationFrame(L);});}),T;function g(){clearTimeout(T),T=setTimeout(re,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),y.observe(t),Ve(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:W,tEnd:A})}),{destroy(){cancelAnimationFrame(L),y.disconnect(),t.removeEventListener("loadedmetadata",ue),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(T),ze(t);},replay(){O=-1,$=false,k=0,w=false,oe(0);},pause(){w=true,cancelAnimationFrame(L);},resume(){w&&(w=false,M&&E&&(L=requestAnimationFrame(J)));},seek(p){let R=Math.min(1,Math.max(0,p));k=R,O=R,w=true,cancelAnimationFrame(L),oe(R);},getProgress(){return k}}}function _t(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function mn(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function Vt(e){let r=_t(e),n=new Map;for(let s of r){let c=s.offsetTop;n.has(c)||n.set(c,[]),n.get(c).push(s);}let t=[],l=Array.from(n.keys()).sort((s,c)=>s-c);for(let s of l){let c=n.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let x=m.nextElementSibling;u.appendChild(m),d<c.length-1&&x&&x.style.whiteSpace==="pre"&&u.appendChild(x);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function fn(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,s=r*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function pn(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,r={}){if(typeof window>"u")return zt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return ye("scrollText: element not found:",e),zt;let t=n,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:x}=r,N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof c=="function"?c:ee[c]??ee["ease-out"],te=pe(m.start??"top 85%"),Me=pe(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let Z;l==="chars"?Z=mn(t):l==="lines"?Z=Vt(t):Z=_t(t);let X=Z.length;function W(g,p){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*p));let R=pn(p,u);R&&(g.style.transform=R);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),Z.forEach((p,R)=>{let de=C(fn(g,R,X,s));W(p,de);});}if(N)return A(1),x?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let L=0,M=0,w=0,O=false,k=false,$=-1,E=0,ne=false,D=()=>window.scrollY,re=()=>window.innerHeight;function oe(){let g=t.getBoundingClientRect(),p=xe({top:g.top,height:g.height},D(),re(),te,Me);L=p.tStart,M=p.tEnd;}function J(){if(!O||k)return;let g=Q(D(),L,M,1);d&&($=Math.max($,g),g=$),E=g,A(g),g>=1&&!ne?(ne=true,x?.()):g<1&&!d&&(ne=false),w=requestAnimationFrame(J);}oe();let ue=new IntersectionObserver(g=>{g.forEach(p=>{O=p.isIntersecting,O&&!k?w=requestAnimationFrame(J):cancelAnimationFrame(w);});}),y;function T(){clearTimeout(y),y=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),Z=Vt(t),A(g);}oe();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),ue.observe(t),Ve(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:L,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ue.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(y),t.innerHTML=B,t.removeAttribute("aria-label"),ze(t);},replay(){$=-1,ne=false,E=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(J)));},seek(g){let p=Math.min(1,Math.max(0,g));E=p,$=p,k=true,cancelAnimationFrame(w),A(p);},getProgress(){return E}}}function dn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=ct(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var gt=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=ct(n.value,t);vue.onUnmounted(()=>l.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function gn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=ut(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var yt=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=ut(n.value,e.options);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("div",{ref:n},r.default?.())}});function yn(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=ft(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var ht=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n={to:e.to};e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete);let t=ft(r.value,n);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("span",{ref:r})}});function hn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=pt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var bt=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=pt(r.value,e.options??{});vue.onUnmounted(()=>n.destroy());}),()=>vue.h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function bn(e={}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let n=dt(r.value,e);vue.onUnmounted(()=>n.destroy());}),r}var wt=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let t=dt(n.value,e.options??{});vue.onUnmounted(()=>t.destroy());}),()=>vue.h(e.tag,{ref:n},r.default?.())}});function tr(){return {install(e){e.component("ScrollDraw",gt),e.component("ScrollAnimate",yt),e.component("ScrollCounter",ht),e.component("ScrollVideo",bt),e.component("ScrollText",wt);}}}exports.ScrollAnimate=yt;exports.ScrollCounter=ht;exports.ScrollDraw=gt;exports.ScrollText=wt;exports.ScrollVideo=bt;exports.createScrollDrawPlugin=tr;exports.useScrollAnimate=gn;exports.useScrollCounter=yn;exports.useScrollDraw=dn;exports.useScrollText=bn;exports.useScrollVideo=hn;
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var It=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Ht=/[MmLlHhVvCcSsQqTtAaZz]/g;function ir(e,n,r){if(!rt)return;let t=(e.match(Ht)??[]).join("").toUpperCase(),l=(n.match(Ht)??[]).join("").toUpperCase(),s=(e.match(It)??[]).length,c=(n.match(It)??[]).length;if(t!==l){be(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&be(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function ut(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...kt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:x={},stagger:N=0,direction:C="forward",once:te=false,debug:$e=false,axis:B="y",scrollContainer:Z,autoReverse:Y=false,delay:W=0,strokeColor:A,strokeWidth:L,fillOpacity:M,waypoints:v,velocityScale:O=false,threshold:k=0,rootMargin:$="0px",repeat:E=0,repeatDelay:re=0,morphTo:D,clip:ne,autoplay:oe=false,duration:K=1e3,native:ce=true,onProgress:y,onStart:T,onComplete:g,onEnter:p,onLeave:F,onEnterBack:pe,onLeaveBack:Se}=l,ue=ne===true?"left":typeof ne=="string"?ne:false,Ee=typeof d=="function"?d:ee[d]??ee.linear,Pe=fe(x.start??"top bottom"),_e=fe(x.end??"bottom top"),we=typeof Z=="string"?document.querySelector(Z):Z??null,ve=Array.isArray(A)?A[0]:null,se=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ie=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null,me=Array.isArray(M)?M[0]:null,X=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Oe(o){let a=o*100;switch(ue){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let V=ue?[]:Array.from(e.querySelectorAll(c)),P=[],i=[],f=0,de=0,I=false,z=false,_=0,Ae=false,ge=-1,J=-1,j=false,ye=0,Ie=0,Ne,ot=null;function St(){ot?.destroy(),ot=null;}let Ve=new Set,Et=NaN,ze=true,Xe=-1,Tt=performance.now(),qe=NaN;function st(){return we?B==="x"?we.scrollLeft:we.scrollTop:B==="x"?window.scrollX:window.scrollY}function xt(){return we?B==="x"?we.clientWidth:we.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function At(){let o=tt(e,we,B);return xe(o,o.scroll,xt(),Pe,_e)}function Mt(){(({tStart:f,tEnd:de}=At())),$e&&rt&&(St(),ot=sr(f,de,B));}function it(o,a=At){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let w=o.destroy;return o.destroy=()=>{w.call(o),Le(e);},o}function Gt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ue){let w=a==="reverse"?1-o:o;e.style.clipPath=Oe(w);return}V.forEach((w,ae)=>{w.style.strokeDashoffset=a==="reverse"?`${P[ae]*o}`:`${P[ae]*(1-o)}`,m&&(w.style.opacity=a==="reverse"?`${1-o}`:`${o}`),ve&&se?w.style.stroke=We(ve,se,o):se&&(w.style.stroke=se),ie!==null&&G!==null?w.style.strokeWidth=`${ie+(G-ie)*o}`:G!==null&&(w.style.strokeWidth=`${G}`),me!==null&&X!==null?w.style.fillOpacity=`${me+(X-me)*o}`:X!==null&&(w.style.fillOpacity=`${X}`),D&&w.tagName.toLowerCase()==="path"&&i[ae]&&w.setAttribute("d",ct(i[ae],D,o));});}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),ue){e.style.clipPath=Oe(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${P[a]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${P[a]}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ie!==null&&(o.style.strokeWidth=`${ie}`),me!==null&&(o.style.fillOpacity=`${me}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{or(o);let a=Be(o);P.push(a);let w=o.tagName.toLowerCase()==="path";w?i.push(o.getAttribute("d")??""):i.push(""),D&&(w?ir(i[i.length-1],D,o):be(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),se&&(o.style.stroke=se),G!==null&&(o.style.strokeWidth=`${G}`),X!==null&&(o.style.fillOpacity=`${X}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?"0":`${a}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ie!==null&&(o.style.strokeWidth=`${ie}`),me!==null&&(o.style.fillOpacity=`${me}`));}),ue){if(s)return e.style.clipPath=Oe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ct=typeof d=="string"?nt(d):null;function jt(){return !(ce===false||!nr()||!V.length||!Ct||ue||B!=="y"||we||u!==1||N!==0||te||Y||O!==false||D||v||E||W>0||y||T||g||p||F||pe||Se||A!=null||L!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function Ut(){let o=++rr,a=`svg-scroll-draw-${o}`,w=`svg-scroll-draw-host-${o}`,ae=`--svg-scroll-draw-${o}`,He=C==="reverse"?"0":"var(--ssd-len)",ke=C==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${He};`,S=`stroke-dashoffset:${ke};`;m&&(Me+=`opacity:${C==="reverse"?1:0};`,S+=`opacity:${C==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${a}{from{${Me}}to{${S}}}.${w}{view-timeline-name:${ae};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${ae};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(w);function le(h,U){h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(a);}V.forEach(le);let b=false,H=-1;function q(){if(H>=0)return H;let h=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:h.top,height:h.height},st(),xt(),Pe,_e);return Ee(Q(st(),U,Te,u))}return {destroy(){e.classList.remove(w),V.forEach(h=>{h.classList.remove(a),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),R.remove();},replay(){b=false,H=-1,V.forEach(le);},pause(){b=true,V.forEach(h=>{h.style.animationPlayState="paused";});},resume(){b&&(b=false,V.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let U=Math.min(1,Math.max(0,h));H=U,b=true,V.forEach((Te,he)=>{Te.classList.remove(a),Te.style.strokeDashoffset=C==="reverse"?`${P[he]*U}`:`${P[he]*(1-U)}`,m&&(Te.style.opacity=C==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return q()},refresh(){V.forEach((h,U)=>{P[U]=Be(h),h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`;});}}}if(jt())return it(Ut());function Yt(){let o=Math.max(1,K),a=0,w=0,ae=false;function He(b){let H=true;if(ue){let q=Math.min(1,Math.max(0,b/o)),h=Ee(q);ye=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=Oe(C==="reverse"?1-h:h),y?.(h),q<1&&(H=false);}else V.forEach((q,h)=>{let U=h*N*o,Te=Math.min(1,Math.max(0,(b-U)/o)),he=Ee(Te);q.style.strokeDashoffset=C==="reverse"?`${P[h]*he}`:`${P[h]*(1-he)}`,m&&(q.style.opacity=C==="reverse"?`${1-he}`:`${he}`),ve&&se?q.style.stroke=We(ve,se,he):se&&(q.style.stroke=se),ie!==null&&G!==null?q.style.strokeWidth=`${ie+(G-ie)*he}`:G!==null&&(q.style.strokeWidth=`${G}`),me!==null&&X!==null?q.style.fillOpacity=`${me+(X-me)*he}`:X!==null&&(q.style.fillOpacity=`${X}`),D&&q.tagName.toLowerCase()==="path"&&i[h]&&q.setAttribute("d",ct(i[h],D,he)),h===0&&(ye=he,y?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Te<1&&(H=false);});if(v){let q=Math.min(1,Math.max(0,b/o)),h=Ee(q);for(let U in v){let Te=parseFloat(U);h>=Te&&!Ve.has(Te)&&(Ve.add(Te),v[U]?.());}}return H}function ke(b){if(j)return;let H=b-a;z||(z=true,T?.());let q=He(H);if(q&&!I){I=true,He(o*(1+Math.max(0,V.length-1)*N)),g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{a=performance.now(),z=false,I=false,Ve.clear(),Qe(),_=requestAnimationFrame(ke);},re));return}q||(_=requestAnimationFrame(ke));}function Me(){cancelAnimationFrame(_),clearTimeout(Ne),a=performance.now(),w=0,j=false,z=false,I=false,Ie=0,ae=true,ye=0,Ve.clear(),Qe(),_=requestAnimationFrame(ke);}let S=new IntersectionObserver(b=>{b.forEach(H=>{H.isIntersecting&&!(te&&I)?Me():!H.isIntersecting&&!te&&!I&&(cancelAnimationFrame(_),clearTimeout(Ne),ae=false);});},{root:we??null,threshold:k,rootMargin:$}),R;function le(){clearTimeout(R),R=setTimeout(()=>{V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});},150);}return window.addEventListener("resize",le),window.addEventListener("orientationchange",le),W>0?setTimeout(()=>S.observe(e),W):S.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Ne),S.disconnect(),window.removeEventListener("resize",le),window.removeEventListener("orientationchange",le),clearTimeout(R);},replay(){Ie=0,Me();},pause(){j||!ae||(j=true,w=performance.now()-a,cancelAnimationFrame(_));},resume(){j&&(j=false,ae=true,a=performance.now()-w,_=requestAnimationFrame(ke));},seek(b){let H=Math.min(1,Math.max(0,b));ye=H,j=true,w=H*o,a=performance.now()-w,cancelAnimationFrame(_),He(w);},getProgress(){return ye},refresh(){clearTimeout(R),V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});}}}if(oe)return it(Yt());Mt();function Ze(){if(!Ae||j)return;let o=performance.now(),a=st();if(!ze&&O===false&&a===Et){_=requestAnimationFrame(Ze);return}ze=false,Et=a;let w=u;if(O!==false){let S=o-Tt,R=S>0?Math.abs(a-(Xe<0?a:Xe))/S:0;w=u*Math.max(.2,1+R*(typeof O=="number"?O:1)*.04);}Xe=a,Tt=o;let ae=Y?J===-1||a>=J?"forward":"reverse":C;J=a;let He=de-f,ke=true,Me=He===0?0:(a-f)/He;if(isNaN(qe)||(qe<=0&&Me>0?p?.():qe>0&&Me<=0&&Se?.(),qe<1&&Me>=1?F?.():qe>=1&&Me<1&&pe?.()),qe=Me,ue){let S=Ee(Q(a,f,de,w));te&&!Y&&(ge=Math.max(ge,S),S=ge),ye=S,e.style.setProperty("--scroll-draw-progress",String(S));let R=ae==="reverse"?1-S:S;e.style.clipPath=Oe(R),y?.(S),!z&&Q(a,f,de,w)>0&&(z=true,T?.()),S>=1&&!I?(I=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{ge=-1,z=false,I=false,e.style.clipPath=Oe(0);},re))):S<1&&!te&&(I=false),_=requestAnimationFrame(Ze);return}if(V.forEach((S,R)=>{let le=R*N*He,b=Ee(Q(a,f+le,de+le,w));te&&!Y&&(ge=Math.max(ge,b),b=ge),ye=b,S.style.strokeDashoffset=ae==="reverse"?`${P[R]*b}`:`${P[R]*(1-b)}`,m&&(S.style.opacity=ae==="reverse"?`${1-b}`:`${b}`),ve&&se?S.style.stroke=We(ve,se,b):se&&(S.style.stroke=se),ie!==null&&G!==null?S.style.strokeWidth=`${ie+(G-ie)*b}`:G!==null&&(S.style.strokeWidth=`${G}`),me!==null&&X!==null?S.style.fillOpacity=`${me+(X-me)*b}`:X!==null&&(S.style.fillOpacity=`${X}`),D&&S.tagName.toLowerCase()==="path"&&i[R]&&S.setAttribute("d",ct(i[R],D,b)),R===0&&(y?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(ke=false);}),v){let S=Ee(Q(a,f,de,w));for(let R in v){let le=parseFloat(R);S>=le&&!Ve.has(le)&&(Ve.add(le),v[R]?.());}}!z&&Q(a,f,de,w)>0&&(z=true,T?.()),ke&&!I?(I=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{ge=-1,z=false,I=false,Ve.clear(),Qe(),ze=true;},re))):!ke&&!te&&(I=false),_=requestAnimationFrame(Ze);}let at=false;function Ke(){at||(at=true,_=requestAnimationFrame(function(){Ze();}));}function Je(){at=false,cancelAnimationFrame(_);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!j?(ze=true,Ke()):Je();});},{root:we??null,threshold:k,rootMargin:$});function Lt(){V.forEach((o,a)=>{P[a]=Be(o),o.style.strokeDasharray=`${P[a]}`;}),Mt(),ze=true;}let et;function Ge(){clearTimeout(et),et=setTimeout(Lt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),W>0?setTimeout(()=>lt.observe(e),W):lt.observe(e),it({destroy(){cancelAnimationFrame(_),clearTimeout(Ne),Je(),lt.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(et),St();},replay(){ge=-1,J=-1,Xe=-1,z=false,I=false,Ie=0,j=false,ye=0,Ve.clear(),clearTimeout(Ne),Qe(),ze=true,Ae&&Ke();},pause(){j=true,Je();},resume(){j&&(j=false,ze=true,Ae&&Ke());},seek(o){let a=Math.min(1,Math.max(0,o));ye=a,ge=a,j=true,Je(),Gt(a,C),ze=true;},getProgress(){return ye},refresh(){clearTimeout(et),Lt(),Ae&&!j&&Ke();}},()=>({tStart:f,tEnd:de}))}function ar(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Nt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function lr(e,n,r){let t=Nt(e),l=Nt(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function Vt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(ar(t))return We(t,l,r);if(t.includes("("))return lr(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function cr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var ur=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),mr=0,zt="--scroll-draw-progress";function fr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function mt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:x=true,velocityScale:N=false,respectReducedMotion:C=true,triggerElement:te,onProgress:$e,onComplete:B,onEnter:Z,onLeave:Y,onEnterBack:W,onLeaveBack:A}=n,L=C&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:ee[s]??ee["ease-out"],v=fe(l.start??"top bottom"),O=fe(l.end??"bottom top"),k=te??e,$=typeof d=="string"?document.querySelector(d):d??null,E=Object.entries(t).map(([i,f])=>({prop:cr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function re(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let ne=new Map;for(let i of [...E.map(f=>f.prop),zt])ne.set(i,e.style.getPropertyValue(i));function oe(){for(let[i,f]of ne)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(L)return D(),B?.(),{...r,destroy:oe,getProgress:()=>1};re();let K=typeof s=="string"?nt(s):null;function ce(){if(!x||!fr()||!K||m!=="y"||$||k!==e||u||c!==1||$e||B||Z||Y||W||A||N!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!ur.has(i.prop))return false;return true}function y(){let i=`ssd-a-${++mr}`,f=E.map(J=>`${J.prop}:${J.from}`).join(";"),de=E.map(J=>`${J.prop}:${J.to}`).join(";"),I=document.createElement("style");I.setAttribute("data-ssd-animate",""),I.textContent=`@keyframes ${i}{from{${f}}to{${de}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${K};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(i);let z=()=>m==="x"?window.scrollX:window.scrollY,_=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let J=e.getBoundingClientRect();return xe({top:J.top,height:J.height},z(),_(),v,O)};Ce(e,{type:"animate",getProgress:()=>ge.getProgress(),getTrigger:Ae});let ge={destroy(){e.classList.remove(i),I.remove(),e.style.animationPlayState="",oe(),Le(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(J){let j=Math.min(1,Math.max(0,J));e.classList.remove(i);for(let ye of E)e.style.setProperty(ye.prop,Vt(ye.from,ye.to,j));},getProgress(){let{tStart:J,tEnd:j}=Ae();return M(Q(z(),J,j,c))}};return ge}if(ce())return y();let T=0,g=0,p=0,F=false,pe=false,Se=-1,ue=0,Ee=false,Pe=NaN,_e=-1,we=0,ve=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,se=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ie(){let i=tt(k,$,m),f=xe(i,i.scroll,se(),v,O);T=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(zt,String(i));for(let f of E)e.style.setProperty(f.prop,Vt(f.from,f.to,i));$e?.(i);}function me(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?Z?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?Y?.():Pe>=1&&i<1&&W?.(),Pe=i;}function X(){if(!F||pe)return;let i=performance.now(),f=ve(),de=c;if(N!==false){let _=i-we,Ae=_>0?Math.abs(f-(_e<0?f:_e))/_:0;de=c*Math.max(.2,1+Ae*(typeof N=="number"?N:1)*.04);}_e=f,we=i;let I=g===T?0:(f-T)/(g-T);me(I);let z=M(Q(f,T,g,de));u&&(Se=Math.max(Se,z),z=Se),ue=z,G(z),z>=1&&!Ee?(Ee=true,B?.()):z<1&&!u&&(Ee=false),p=requestAnimationFrame(X);}ie(),g===T&&be("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(Q(ve(),T,g,c));u&&i>0&&(Se=i),ue=i,G(i);}let Oe=new IntersectionObserver(i=>{i.forEach(f=>{F=f.isIntersecting,F&&!pe?p=requestAnimationFrame(X):cancelAnimationFrame(p);});},{root:$??null}),V;function P(){clearTimeout(V),V=setTimeout(ie,150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),Oe.observe(e),Ce(e,{type:"animate",getProgress:()=>ue,getTrigger:()=>({tStart:T,tEnd:g})}),{destroy(){cancelAnimationFrame(p),Oe.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(V),oe(),Le(e);},replay(){Se=-1,Ee=false,ue=0,pe=false,G(0);},pause(){pe=true,cancelAnimationFrame(p);},resume(){pe&&(pe=false,F&&(p=requestAnimationFrame(X)));},seek(i){let f=Math.min(1,Math.max(0,i));ue=f,Se=f,pe=true,cancelAnimationFrame(p),G(f);},getProgress(){return ue}}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,n){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollCounter: element not found:",e),ft;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:x,onComplete:N}=n,C=x!==void 0?y=>y.toFixed(x):c??(y=>String(Math.round(y))),te=typeof u=="function"?u:ee[u]??ee["ease-out"],$e=fe(m.start??"top 80%"),B=fe(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=C(s),N?.(),ft;let Y=0,W=0,A=0,L=false,M=false,v=-1,O=0,k=false,$=()=>window.scrollY,E=()=>window.innerHeight;function re(){let y=t.getBoundingClientRect(),T=xe({top:y.top,height:y.height},$(),E(),$e,B);Y=T.tStart,W=T.tEnd;}function D(y){t.textContent=C(l+(s-l)*y),t.style.setProperty("--scroll-draw-progress",String(y));}function ne(){if(!L||M)return;let y=te(Q($(),Y,W,1));d&&(v=Math.max(v,y),y=v),O=y,D(y),y>=1&&!k?(k=true,N?.()):y<1&&!d&&(k=false),A=requestAnimationFrame(ne);}re();{let y=te(Q($(),Y,W,1));d&&y>0&&(v=y),O=y,D(y);}let oe=new IntersectionObserver(y=>{y.forEach(T=>{L=T.isIntersecting,L&&!M?A=requestAnimationFrame(ne):cancelAnimationFrame(A);});}),K;function ce(){clearTimeout(K),K=setTimeout(re,150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),oe.observe(t),Ce(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:Y,tEnd:W})}),{destroy(){cancelAnimationFrame(A),oe.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(K),Le(t);},replay(){v=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,L&&(A=requestAnimationFrame(ne)));},seek(y){let T=Math.min(1,Math.max(0,y));O=T,v=T,M=true,cancelAnimationFrame(A),D(T);},getProgress(){return O}}}var _t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n={}){if(typeof window>"u")return _t;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return be("scrollVideo: <video> element not found:",e),_t;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:d,onComplete:x,onProgress:N}=n,C=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof s=="function"?s:ee[s]??ee.linear,$e=fe(l.start??"top top"),B=fe(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Z=n.from??0,Y=n.to,W=0,A=0,L=0,M=false,v=false,O=-1,k=0,$=false,E=false,re=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function ne(){let p=t.getBoundingClientRect(),F=u==="x"?p.left:p.top,pe=u==="x"?p.width:p.height,Se=xe({top:F,height:pe},re(),D(),$e,B);W=Se.tStart,A=Se.tEnd;}function oe(p){if(!E)return;let F=Y??t.duration??0;t.currentTime=Z+(F-Z)*p,t.style.setProperty("--scroll-draw-progress",String(p)),N?.(p);}function K(){if(!M||v||!E)return;let p=te(Q(re(),W,A,1));c&&(O=Math.max(O,p),p=O),k=p,oe(p),p>=1&&!$?($=true,x?.()):p<1&&!c&&($=false),L=requestAnimationFrame(K);}function ce(){if(E=true,Y===void 0&&(Y=t.duration),C){oe(1),d?.();return}ne(),d?.(),M&&!v&&(L=requestAnimationFrame(K));}t.readyState>=1?ce():t.addEventListener("loadedmetadata",ce,{once:true}),E||ne();let y=new IntersectionObserver(p=>{p.forEach(F=>{M=F.isIntersecting,M&&!v&&E?L=requestAnimationFrame(K):cancelAnimationFrame(L);});}),T;function g(){clearTimeout(T),T=setTimeout(ne,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),y.observe(t),Ce(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:W,tEnd:A})}),{destroy(){cancelAnimationFrame(L),y.disconnect(),t.removeEventListener("loadedmetadata",ce),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(T),Le(t);},replay(){O=-1,$=false,k=0,v=false,oe(0);},pause(){v=true,cancelAnimationFrame(L);},resume(){v&&(v=false,M&&E&&(L=requestAnimationFrame(K)));},seek(p){let F=Math.min(1,Math.max(0,p));k=F,O=F,v=true,cancelAnimationFrame(L),oe(F);},getProgress(){return k}}}function Wt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function pr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function qt(e){let n=Wt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let x=m.nextElementSibling;u.appendChild(m),d<c.length-1&&x&&x.style.whiteSpace==="pre"&&u.appendChild(x);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function dr(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function gr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return Bt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollText: element not found:",e),Bt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:x}=n,N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof c=="function"?c:ee[c]??ee["ease-out"],te=fe(m.start??"top 85%"),$e=fe(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let Z;l==="chars"?Z=pr(t):l==="lines"?Z=qt(t):Z=Wt(t);let Y=Z.length;function W(g,p){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*p));let F=gr(p,u);F&&(g.style.transform=F);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),Z.forEach((p,F)=>{let pe=C(dr(g,F,Y,s));W(p,pe);});}if(N)return A(1),x?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let L=0,M=0,v=0,O=false,k=false,$=-1,E=0,re=false,D=()=>window.scrollY,ne=()=>window.innerHeight;function oe(){let g=t.getBoundingClientRect(),p=xe({top:g.top,height:g.height},D(),ne(),te,$e);L=p.tStart,M=p.tEnd;}function K(){if(!O||k)return;let g=Q(D(),L,M,1);d&&($=Math.max($,g),g=$),E=g,A(g),g>=1&&!re?(re=true,x?.()):g<1&&!d&&(re=false),v=requestAnimationFrame(K);}oe();let ce=new IntersectionObserver(g=>{g.forEach(p=>{O=p.isIntersecting,O&&!k?v=requestAnimationFrame(K):cancelAnimationFrame(v);});}),y;function T(){clearTimeout(y),y=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),Z=qt(t),A(g);}oe();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),ce.observe(t),Ce(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:L,tEnd:M})}),{destroy(){cancelAnimationFrame(v),ce.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(y),t.innerHTML=B,t.removeAttribute("aria-label"),Le(t);},replay(){$=-1,re=false,E=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(v);},resume(){k&&(k=false,O&&(v=requestAnimationFrame(K)));},seek(g){let p=Math.min(1,Math.max(0,g));E=p,$=p,k=true,cancelAnimationFrame(v),A(p);},getProgress(){return E}}}function yr(e={}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=ut(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var yt=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=ut(r.value,t);vue.onUnmounted(()=>l.destroy());}),()=>vue.h("div",{ref:r},n.default?.())}});function hr(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=mt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var ht=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let t=mt(r.value,e.options);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("div",{ref:r},n.default?.())}});function br(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=pt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var bt=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r={to:e.to};e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete);let t=pt(n.value,r);vue.onUnmounted(()=>t.destroy());}),()=>vue.h("span",{ref:n})}});function wr(e={}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=dt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var wt=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=dt(n.value,e.options??{});vue.onUnmounted(()=>r.destroy());}),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function vr(e={}){let n=vue.ref(null);return vue.onMounted(()=>{if(!n.value)return;let r=gt(n.value,e);vue.onUnmounted(()=>r.destroy());}),n}var vt=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return vue.onMounted(()=>{if(!r.value)return;let t=gt(r.value,e.options??{});vue.onUnmounted(()=>t.destroy());}),()=>vue.h(e.tag,{ref:r},n.default?.())}});function on(){return {install(e){e.component("ScrollDraw",yt),e.component("ScrollAnimate",ht),e.component("ScrollCounter",bt),e.component("ScrollVideo",wt),e.component("ScrollText",vt);}}}exports.ScrollAnimate=ht;exports.ScrollCounter=bt;exports.ScrollDraw=yt;exports.ScrollText=vt;exports.ScrollVideo=wt;exports.createScrollDrawPlugin=on;exports.useScrollAnimate=hr;exports.useScrollCounter=br;exports.useScrollDraw=yr;exports.useScrollText=vr;exports.useScrollVideo=wr;
@@ -1,3 +1,3 @@
1
- import {defineComponent,ref,onMounted,onUnmounted,h}from'vue';function jt({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,r)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<n;d++){let x=Math.pow(l,d);c.push(x),s+=x;}let u=[0],m=0;for(let d=0;d<n;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let x=0;x<n;x++)if(d<=u[x+1]){let N=(d-u[x])/(u[x+1]-u[x]);if(x===0)return N*(2-N);let C=1-Math.pow(t,x);return C+(1-C)*(2*N-1)*(2*N-1)}return 1}}function Ut({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),t=Math.max(.1,r),l=n<=1?t/4:t/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var ee={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:jt(),elastic:Ut()};function pe(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[n="top",t="bottom"]=r.split(/\s+/).filter(Boolean);return {element:n,viewport:t}}function Ct(e,r,n,t){switch(t){case "top":return e+n;case "center":return e+n+r/2;case "bottom":return e+n+r;default:return e+n}}function Lt(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return r/2;case "bottom":return r;default:return r}}function Be(e){let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(n+t)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Xt(e,r,n){return Math.min(n,Math.max(r,e))}function Q(e,r,n,t){return n===r?0:Xt((e-r)/(n-r)*t,0,1)}function tt(e,r,n){let t=e.getBoundingClientRect(),l=n==="x"?t.width:t.height;return r?{top:n==="x"?t.left-r.getBoundingClientRect().left+r.scrollLeft:t.top-r.getBoundingClientRect().top+r.scrollTop,height:l,scroll:0}:{top:n==="x"?t.left:t.top,height:l,scroll:n==="x"?window.scrollX:window.scrollY}}function xe(e,r,n,t,l){let s=Ct(e.top,e.height,r,t.element)-Lt(t.viewport,n),c=Ct(e.top,e.height,r,l.element)-Lt(l.viewport,n);return {tStart:s,tEnd:c}}function $t(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,r,n){let t=$t(e),l=$t(r);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*n)},${Math.round(t[1]+(l[1]-t[1])*n)},${Math.round(t[2]+(l[2]-t[2])*n)})`}var Pt={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 nt=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function ye(e,...r){nt&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var Yt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Qt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ot=33;function Zt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Jt(e){let r=[];for(let n=0;n<Ot;n++){let t=n/(Ot-1);r.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${r.join(",")})`}function rt(e){switch(e){case "linear":return "linear";case "ease-in":return Yt;case "ease-out":return Qt;case "ease-in-out":return Zt()?Jt(ee["ease-in-out"]):null;default:return null}}var Kt=0;function en(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function tn(e){let r=e.getAttribute("stroke"),n=e.getAttribute("fill");!r||r==="none"?ye("Element has no stroke \u2014 path will not be visible.",e):n&&n!=="none"&&n!=="transparent"&&ye("Element has a fill \u2014 it may obscure the stroke animation.",e);}function nn(e,r,n){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=n==="x"?window.scrollX:window.scrollY,c=e-s,u=r-s,m=n==="x";t.innerHTML=`
1
+ import {defineComponent,ref,onMounted,onUnmounted,h}from'vue';function Xt({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),l=Math.sqrt(t),s=0,c=[];for(let d=0;d<r;d++){let x=Math.pow(l,d);c.push(x),s+=x;}let u=[0],m=0;for(let d=0;d<r;d++)m+=c[d]/s,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let x=0;x<r;x++)if(d<=u[x+1]){let N=(d-u[x])/(u[x+1]-u[x]);if(x===0)return N*(2-N);let C=1-Math.pow(t,x);return C+(1-C)*(2*N-1)*(2*N-1)}return 1}}function Qt({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),l=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-l)*(2*Math.PI)/t)+1}var ee={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:Xt(),elastic:Qt()};function fe(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function $t(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function Pt(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function Be(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function Zt(e,n,r){return Math.min(r,Math.max(n,e))}function Q(e,n,r,t){return r===n?0:Zt((e-n)/(r-n)*t,0,1)}function tt(e,n,r){let t=e.getBoundingClientRect(),l=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:l,scroll:0}:{top:r==="x"?t.left:t.top,height:l,scroll:r==="x"?window.scrollX:window.scrollY}}function xe(e,n,r,t,l){let s=$t(e.top,e.height,n,t.element)-Pt(t.viewport,r),c=$t(e.top,e.height,n,l.element)-Pt(l.viewport,r);return {tStart:s,tEnd:c}}function Ot(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function We(e,n,r){let t=Ot(e),l=Ot(n);return !t||!l?e:`rgb(${Math.round(t[0]+(l[0]-t[0])*r)},${Math.round(t[1]+(l[1]-t[1])*r)},${Math.round(t[2]+(l[2]-t[2])*r)})`}var kt={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 rt=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function be(e,...n){rt&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var Kt="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Jt="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Dt=33;function er(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function tr(e){let n=[];for(let r=0;r<Dt;r++){let t=r/(Dt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function nt(e){switch(e){case "linear":return "linear";case "ease-in":return Kt;case "ease-out":return Jt;case "ease-in-out":return er()?tr(ee["ease-in-out"]):null;default:return null}}var Rt=Symbol.for("svg-scroll-draw.registry");function Ft(){let e=globalThis;return e[Rt]||(e[Rt]=new Map)}function Ce(e,n){Ft().set(e,n);}function Le(e){Ft().delete(e);}var rr=0;function nr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function or(e){let n=e.getAttribute("stroke"),r=e.getAttribute("fill");!n||n==="none"?be("Element has no stroke \u2014 path will not be visible.",e):r&&r!=="none"&&r!=="transparent"&&be("Element has a fill \u2014 it may obscure the stroke animation.",e);}function sr(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function l(){let s=r==="x"?window.scrollX:window.scrollY,c=e-s,u=n-s,m=r==="x";t.innerHTML=`
2
2
  <div style="position:absolute;${m?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
3
- <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var kt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Dt=/[MmLlHhVvCcSsQqTtAaZz]/g;function rn(e,r,n){if(!nt)return;let t=(e.match(Dt)??[]).join("").toUpperCase(),l=(r.match(Dt)??[]).join("").toUpperCase(),s=(e.match(kt)??[]).length,c=(r.match(kt)??[]).length;if(t!==l){ye(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}s!==c&&ye(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function lt(e,r,n){let t=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*n).toFixed(4))})}function ct(e,r={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:n,...t}=r,l=n?{...Pt[n],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:x={},stagger:N=0,direction:C="forward",once:te=false,debug:Me=false,axis:B="y",scrollContainer:Z,autoReverse:X=false,delay:W=0,strokeColor:A,strokeWidth:L,fillOpacity:M,waypoints:w,velocityScale:O=false,threshold:k=0,rootMargin:$="0px",repeat:E=0,repeatDelay:ne=0,morphTo:D,clip:re,autoplay:oe=false,duration:J=1e3,native:ue=true,onProgress:y,onStart:T,onComplete:g,onEnter:p,onLeave:R,onEnterBack:de,onLeaveBack:ve}=l,me=re===true?"left":typeof re=="string"?re:false,Se=typeof d=="function"?d:ee[d]??ee.linear,Ce=pe(x.start??"top bottom"),_e=pe(x.end??"bottom top"),he=typeof Z=="string"?document.querySelector(Z):Z??null,be=Array.isArray(A)?A[0]:null,se=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ie=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null,fe=Array.isArray(M)?M[0]:null,Y=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Le(o){let a=o*100;switch(me){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let V=me?[]:Array.from(e.querySelectorAll(c)),P=[],i=[],f=0,we=0,I=false,z=false,_=0,j=false,ae=-1,$e=-1,K=false,Ee=0,Fe=0,Ie,ot=null;function vt(){ot?.destroy(),ot=null;}let He=new Set,St=NaN,Ne=true,Ye=-1,Et=performance.now(),qe=NaN;function st(){return he?B==="x"?he.scrollLeft:he.scrollTop:B==="x"?window.scrollX:window.scrollY}function Tt(){return he?B==="x"?he.clientWidth:he.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function xt(){let o=tt(e,he,B),a=xe(o,o.scroll,Tt(),Ce,_e);f=a.tStart,we=a.tEnd,Me&&nt&&(vt(),ot=nn(f,we,B));}function qt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),me){let v=a==="reverse"?1-o:o;e.style.clipPath=Le(v);return}V.forEach((v,le)=>{v.style.strokeDashoffset=a==="reverse"?`${P[le]*o}`:`${P[le]*(1-o)}`,m&&(v.style.opacity=a==="reverse"?`${1-o}`:`${o}`),be&&se?v.style.stroke=We(be,se,o):se&&(v.style.stroke=se),ie!==null&&G!==null?v.style.strokeWidth=`${ie+(G-ie)*o}`:G!==null&&(v.style.strokeWidth=`${G}`),fe!==null&&Y!==null?v.style.fillOpacity=`${fe+(Y-fe)*o}`:Y!==null&&(v.style.fillOpacity=`${Y}`),D&&v.tagName.toLowerCase()==="path"&&i[le]&&v.setAttribute("d",lt(i[le],D,o));});}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),me){e.style.clipPath=Le(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${P[a]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${P[a]}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{tn(o);let a=Be(o);P.push(a);let v=o.tagName.toLowerCase()==="path";v?i.push(o.getAttribute("d")??""):i.push(""),D&&(v?rn(i[i.length-1],D,o):ye(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),se&&(o.style.stroke=se),G!==null&&(o.style.strokeWidth=`${G}`),Y!==null&&(o.style.fillOpacity=`${Y}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?"0":`${a}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",be&&(o.style.stroke=be),ie!==null&&(o.style.strokeWidth=`${ie}`),fe!==null&&(o.style.fillOpacity=`${fe}`));}),me){if(s)return e.style.clipPath=Le(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Le(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let At=typeof d=="string"?rt(d):null;function Bt(){return !(ue===false||!en()||!V.length||!At||me||B!=="y"||he||u!==1||N!==0||te||X||O!==false||D||w||E||W>0||y||T||g||p||R||de||ve||A!=null||L!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function Wt(){let o=++Kt,a=`svg-scroll-draw-${o}`,v=`svg-scroll-draw-host-${o}`,le=`--svg-scroll-draw-${o}`,Re=C==="reverse"?"0":"var(--ssd-len)",Pe=C==="reverse"?"var(--ssd-len)":"0",Ae=`stroke-dashoffset:${Re};`,S=`stroke-dashoffset:${Pe};`;m&&(Ae+=`opacity:${C==="reverse"?1:0};`,S+=`opacity:${C==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${a}{from{${Ae}}to{${S}}}.${v}{view-timeline-name:${le};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${At};animation-fill-mode:both;animation-timeline:${le};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(v);function ce(h,U){h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(a);}V.forEach(ce);let b=false,H=-1;function q(){if(H>=0)return H;let h=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:h.top,height:h.height},st(),Tt(),Ce,_e);return Se(Q(st(),U,Te,u))}return {destroy(){e.classList.remove(v),V.forEach(h=>{h.classList.remove(a),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),F.remove();},replay(){b=false,H=-1,V.forEach(ce);},pause(){b=true,V.forEach(h=>{h.style.animationPlayState="paused";});},resume(){b&&(b=false,V.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let U=Math.min(1,Math.max(0,h));H=U,b=true,V.forEach((Te,ge)=>{Te.classList.remove(a),Te.style.strokeDashoffset=C==="reverse"?`${P[ge]*U}`:`${P[ge]*(1-U)}`,m&&(Te.style.opacity=C==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return q()},refresh(){V.forEach((h,U)=>{P[U]=Be(h),h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`;});}}}if(Bt())return Wt();function Gt(){let o=Math.max(1,J),a=0,v=0,le=false;function Re(b){let H=true;if(me){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);Ee=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=Le(C==="reverse"?1-h:h),y?.(h),q<1&&(H=false);}else V.forEach((q,h)=>{let U=h*N*o,Te=Math.min(1,Math.max(0,(b-U)/o)),ge=Se(Te);q.style.strokeDashoffset=C==="reverse"?`${P[h]*ge}`:`${P[h]*(1-ge)}`,m&&(q.style.opacity=C==="reverse"?`${1-ge}`:`${ge}`),be&&se?q.style.stroke=We(be,se,ge):se&&(q.style.stroke=se),ie!==null&&G!==null?q.style.strokeWidth=`${ie+(G-ie)*ge}`:G!==null&&(q.style.strokeWidth=`${G}`),fe!==null&&Y!==null?q.style.fillOpacity=`${fe+(Y-fe)*ge}`:Y!==null&&(q.style.fillOpacity=`${Y}`),D&&q.tagName.toLowerCase()==="path"&&i[h]&&q.setAttribute("d",lt(i[h],D,ge)),h===0&&(Ee=ge,y?.(ge),e.style.setProperty("--scroll-draw-progress",String(ge))),Te<1&&(H=false);});if(w){let q=Math.min(1,Math.max(0,b/o)),h=Se(q);for(let U in w){let Te=parseFloat(U);h>=Te&&!He.has(Te)&&(He.add(Te),w[U]?.());}}return H}function Pe(b){if(K)return;let H=b-a;z||(z=true,T?.());let q=Re(H);if(q&&!I){I=true,Re(o*(1+Math.max(0,V.length-1)*N)),g?.(),Fe<(E==="infinite"?1/0:E??0)&&(Fe++,Ie=setTimeout(()=>{a=performance.now(),z=false,I=false,He.clear(),Qe(),_=requestAnimationFrame(Pe);},ne));return}q||(_=requestAnimationFrame(Pe));}function Ae(){cancelAnimationFrame(_),clearTimeout(Ie),a=performance.now(),v=0,K=false,z=false,I=false,Fe=0,le=true,Ee=0,He.clear(),Qe(),_=requestAnimationFrame(Pe);}let S=new IntersectionObserver(b=>{b.forEach(H=>{H.isIntersecting&&!(te&&I)?Ae():!H.isIntersecting&&!te&&!I&&(cancelAnimationFrame(_),clearTimeout(Ie),le=false);});},{root:he??null,threshold:k,rootMargin:$}),F;function ce(){clearTimeout(F),F=setTimeout(()=>{V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});},150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),W>0?setTimeout(()=>S.observe(e),W):S.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Ie),S.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(F);},replay(){Fe=0,Ae();},pause(){K||!le||(K=true,v=performance.now()-a,cancelAnimationFrame(_));},resume(){K&&(K=false,le=true,a=performance.now()-v,_=requestAnimationFrame(Pe));},seek(b){let H=Math.min(1,Math.max(0,b));Ee=H,K=true,v=H*o,a=performance.now()-v,cancelAnimationFrame(_),Re(v);},getProgress(){return Ee},refresh(){clearTimeout(F),V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});}}}if(oe)return Gt();xt();function Ze(){if(!j||K)return;let o=performance.now(),a=st();if(!Ne&&O===false&&a===St){_=requestAnimationFrame(Ze);return}Ne=false,St=a;let v=u;if(O!==false){let S=o-Et,F=S>0?Math.abs(a-(Ye<0?a:Ye))/S:0;v=u*Math.max(.2,1+F*(typeof O=="number"?O:1)*.04);}Ye=a,Et=o;let le=X?$e===-1||a>=$e?"forward":"reverse":C;$e=a;let Re=we-f,Pe=true,Ae=Re===0?0:(a-f)/Re;if(isNaN(qe)||(qe<=0&&Ae>0?p?.():qe>0&&Ae<=0&&ve?.(),qe<1&&Ae>=1?R?.():qe>=1&&Ae<1&&de?.()),qe=Ae,me){let S=Se(Q(a,f,we,v));te&&!X&&(ae=Math.max(ae,S),S=ae),Ee=S,e.style.setProperty("--scroll-draw-progress",String(S));let F=le==="reverse"?1-S:S;e.style.clipPath=Le(F),y?.(S),!z&&Q(a,f,we,v)>0&&(z=true,T?.()),S>=1&&!I?(I=true,g?.(),Fe<(E==="infinite"?1/0:E??0)&&(Fe++,Ie=setTimeout(()=>{ae=-1,z=false,I=false,e.style.clipPath=Le(0);},ne))):S<1&&!te&&(I=false),_=requestAnimationFrame(Ze);return}if(V.forEach((S,F)=>{let ce=F*N*Re,b=Se(Q(a,f+ce,we+ce,v));te&&!X&&(ae=Math.max(ae,b),b=ae),Ee=b,S.style.strokeDashoffset=le==="reverse"?`${P[F]*b}`:`${P[F]*(1-b)}`,m&&(S.style.opacity=le==="reverse"?`${1-b}`:`${b}`),be&&se?S.style.stroke=We(be,se,b):se&&(S.style.stroke=se),ie!==null&&G!==null?S.style.strokeWidth=`${ie+(G-ie)*b}`:G!==null&&(S.style.strokeWidth=`${G}`),fe!==null&&Y!==null?S.style.fillOpacity=`${fe+(Y-fe)*b}`:Y!==null&&(S.style.fillOpacity=`${Y}`),D&&S.tagName.toLowerCase()==="path"&&i[F]&&S.setAttribute("d",lt(i[F],D,b)),F===0&&(y?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Pe=false);}),w){let S=Se(Q(a,f,we,v));for(let F in w){let ce=parseFloat(F);S>=ce&&!He.has(ce)&&(He.add(ce),w[F]?.());}}!z&&Q(a,f,we,v)>0&&(z=true,T?.()),Pe&&!I?(I=true,g?.(),Fe<(E==="infinite"?1/0:E??0)&&(Fe++,Ie=setTimeout(()=>{ae=-1,z=false,I=false,He.clear(),Qe(),Ne=true;},ne))):!Pe&&!te&&(I=false),_=requestAnimationFrame(Ze);}let it=false;function Je(){it||(it=true,_=requestAnimationFrame(function(){Ze();}));}function Ke(){it=false,cancelAnimationFrame(_);}let at=new IntersectionObserver(o=>{o.forEach(a=>{j=a.isIntersecting,j&&!K?(Ne=true,Je()):Ke();});},{root:he??null,threshold:k,rootMargin:$});function Mt(){V.forEach((o,a)=>{P[a]=Be(o),o.style.strokeDasharray=`${P[a]}`;}),xt(),Ne=true;}let et;function Ge(){clearTimeout(et),et=setTimeout(Mt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),W>0?setTimeout(()=>at.observe(e),W):at.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Ie),Ke(),at.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(et),vt();},replay(){ae=-1,$e=-1,Ye=-1,z=false,I=false,Fe=0,K=false,Ee=0,He.clear(),clearTimeout(Ie),Qe(),Ne=true,j&&Je();},pause(){K=true,Ke();},resume(){K&&(K=false,Ne=true,j&&Je());},seek(o){let a=Math.min(1,Math.max(0,o));Ee=a,ae=a,K=true,Ke(),qt(a,C),Ne=true;},getProgress(){return Ee},refresh(){clearTimeout(et),Mt(),j&&!K&&Je();}}}var Ft=new Map;function Ve(e,r){Ft.set(e,r);}function ze(e){Ft.delete(e);}function on(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Rt(e){let r=[],n=/([\w]+)\(([^)]*)\)/g,t;for(;(t=n.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}r.push({fn:t[1],nums:l,units:s});}return r}function sn(e,r,n){let t=Rt(e),l=Rt(r);return t.length===0||t.length!==l.length?n<1?e:r:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?n<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*n}${s.units[d]}`).join(", ")})`}).join(" ")}function It(e,r,n){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*n);let t=String(e),l=String(r);if(on(t))return We(t,l,n);if(t.includes("("))return sn(t,l,n);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*n}${s[2]||c[2]}`}return n<1?t:l}function an(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var ln=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),cn=0,Ht="--scroll-draw-progress";function un(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ut(e,r){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:x=true,velocityScale:N=false,respectReducedMotion:C=true,triggerElement:te,onProgress:Me,onComplete:B,onEnter:Z,onLeave:X,onEnterBack:W,onLeaveBack:A}=r,L=C&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:ee[s]??ee["ease-out"],w=pe(l.start??"top bottom"),O=pe(l.end??"bottom top"),k=te??e,$=typeof d=="string"?document.querySelector(d):d??null,E=Object.entries(t).map(([i,f])=>({prop:an(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function ne(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let re=new Map;for(let i of [...E.map(f=>f.prop),Ht])re.set(i,e.style.getPropertyValue(i));function oe(){for(let[i,f]of re)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(L)return D(),B?.(),{...n,destroy:oe,getProgress:()=>1};ne();let J=typeof s=="string"?rt(s):null;function ue(){if(!x||!un()||!J||m!=="y"||$||k!==e||u||c!==1||Me||B||Z||X||W||A||N!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!ln.has(i.prop))return false;return true}function y(){let i=`ssd-a-${++cn}`,f=E.map(j=>`${j.prop}:${j.from}`).join(";"),we=E.map(j=>`${j.prop}:${j.to}`).join(";"),I=document.createElement("style");I.setAttribute("data-ssd-animate",""),I.textContent=`@keyframes ${i}{from{${f}}to{${we}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${J};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(i);let z=()=>m==="x"?window.scrollX:window.scrollY,_=()=>m==="x"?window.innerWidth:window.innerHeight;return {destroy(){e.classList.remove(i),I.remove(),e.style.animationPlayState="",oe();},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(j){let ae=Math.min(1,Math.max(0,j));e.classList.remove(i);for(let $e of E)e.style.setProperty($e.prop,It($e.from,$e.to,ae));},getProgress(){let j=e.getBoundingClientRect(),ae=z(),$e=_(),{tStart:K,tEnd:Ee}=xe({top:j.top,height:j.height},ae,$e,w,O);return M(Q(ae,K,Ee,c))}}}if(ue())return y();let T=0,g=0,p=0,R=false,de=false,ve=-1,me=0,Se=false,Ce=NaN,_e=-1,he=0,be=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,se=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ie(){let i=tt(k,$,m),f=xe(i,i.scroll,se(),w,O);T=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(Ht,String(i));for(let f of E)e.style.setProperty(f.prop,It(f.from,f.to,i));Me?.(i);}function fe(i){if(isNaN(Ce)){Ce=i;return}Ce<=0&&i>0?Z?.():Ce>0&&i<=0&&A?.(),Ce<1&&i>=1?X?.():Ce>=1&&i<1&&W?.(),Ce=i;}function Y(){if(!R||de)return;let i=performance.now(),f=be(),we=c;if(N!==false){let _=i-he,j=_>0?Math.abs(f-(_e<0?f:_e))/_:0;we=c*Math.max(.2,1+j*(typeof N=="number"?N:1)*.04);}_e=f,he=i;let I=g===T?0:(f-T)/(g-T);fe(I);let z=M(Q(f,T,g,we));u&&(ve=Math.max(ve,z),z=ve),me=z,G(z),z>=1&&!Se?(Se=true,B?.()):z<1&&!u&&(Se=false),p=requestAnimationFrame(Y);}ie(),g===T&&ye("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(Q(be(),T,g,c));u&&i>0&&(ve=i),me=i,G(i);}let Le=new IntersectionObserver(i=>{i.forEach(f=>{R=f.isIntersecting,R&&!de?p=requestAnimationFrame(Y):cancelAnimationFrame(p);});},{root:$??null}),V;function P(){clearTimeout(V),V=setTimeout(ie,150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),Le.observe(e),Ve(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:T,tEnd:g})}),{destroy(){cancelAnimationFrame(p),Le.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(V),oe(),ze(e);},replay(){ve=-1,Se=false,me=0,de=false,G(0);},pause(){de=true,cancelAnimationFrame(p);},resume(){de&&(de=false,R&&(p=requestAnimationFrame(Y)));},seek(i){let f=Math.min(1,Math.max(0,i));me=f,ve=f,de=true,cancelAnimationFrame(p),G(f);},getProgress(){return me}}}var mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ft(e,r){if(typeof window>"u")return mt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return ye("scrollCounter: element not found:",e),mt;let t=n,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:x,onComplete:N}=r,C=x!==void 0?y=>y.toFixed(x):c??(y=>String(Math.round(y))),te=typeof u=="function"?u:ee[u]??ee["ease-out"],Me=pe(m.start??"top 80%"),B=pe(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=C(s),N?.(),mt;let X=0,W=0,A=0,L=false,M=false,w=-1,O=0,k=false,$=()=>window.scrollY,E=()=>window.innerHeight;function ne(){let y=t.getBoundingClientRect(),T=xe({top:y.top,height:y.height},$(),E(),Me,B);X=T.tStart,W=T.tEnd;}function D(y){t.textContent=C(l+(s-l)*y),t.style.setProperty("--scroll-draw-progress",String(y));}function re(){if(!L||M)return;let y=te(Q($(),X,W,1));d&&(w=Math.max(w,y),y=w),O=y,D(y),y>=1&&!k?(k=true,N?.()):y<1&&!d&&(k=false),A=requestAnimationFrame(re);}ne();{let y=te(Q($(),X,W,1));d&&y>0&&(w=y),O=y,D(y);}let oe=new IntersectionObserver(y=>{y.forEach(T=>{L=T.isIntersecting,L&&!M?A=requestAnimationFrame(re):cancelAnimationFrame(A);});}),J;function ue(){clearTimeout(J),J=setTimeout(ne,150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),oe.observe(t),Ve(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:X,tEnd:W})}),{destroy(){cancelAnimationFrame(A),oe.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(J),ze(t);},replay(){w=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,L&&(A=requestAnimationFrame(re)));},seek(y){let T=Math.min(1,Math.max(0,y));O=T,w=T,M=true,cancelAnimationFrame(A),D(T);},getProgress(){return O}}}var Nt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,r={}){if(typeof window>"u")return Nt;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return ye("scrollVideo: <video> element not found:",e),Nt;let t=n,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:d,onComplete:x,onProgress:N}=r,C=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof s=="function"?s:ee[s]??ee.linear,Me=pe(l.start??"top top"),B=pe(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Z=r.from??0,X=r.to,W=0,A=0,L=0,M=false,w=false,O=-1,k=0,$=false,E=false,ne=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function re(){let p=t.getBoundingClientRect(),R=u==="x"?p.left:p.top,de=u==="x"?p.width:p.height,ve=xe({top:R,height:de},ne(),D(),Me,B);W=ve.tStart,A=ve.tEnd;}function oe(p){if(!E)return;let R=X??t.duration??0;t.currentTime=Z+(R-Z)*p,t.style.setProperty("--scroll-draw-progress",String(p)),N?.(p);}function J(){if(!M||w||!E)return;let p=te(Q(ne(),W,A,1));c&&(O=Math.max(O,p),p=O),k=p,oe(p),p>=1&&!$?($=true,x?.()):p<1&&!c&&($=false),L=requestAnimationFrame(J);}function ue(){if(E=true,X===void 0&&(X=t.duration),C){oe(1),d?.();return}re(),d?.(),M&&!w&&(L=requestAnimationFrame(J));}t.readyState>=1?ue():t.addEventListener("loadedmetadata",ue,{once:true}),E||re();let y=new IntersectionObserver(p=>{p.forEach(R=>{M=R.isIntersecting,M&&!w&&E?L=requestAnimationFrame(J):cancelAnimationFrame(L);});}),T;function g(){clearTimeout(T),T=setTimeout(re,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),y.observe(t),Ve(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:W,tEnd:A})}),{destroy(){cancelAnimationFrame(L),y.disconnect(),t.removeEventListener("loadedmetadata",ue),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(T),ze(t);},replay(){O=-1,$=false,k=0,w=false,oe(0);},pause(){w=true,cancelAnimationFrame(L);},resume(){w&&(w=false,M&&E&&(L=requestAnimationFrame(J)));},seek(p){let R=Math.min(1,Math.max(0,p));k=R,O=R,w=true,cancelAnimationFrame(L),oe(R);},getProgress(){return k}}}function _t(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(n)?(t.textContent=n,t.style.whiteSpace="pre"):(t.textContent=n,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(n)?null:t}).filter(n=>n!==null)}function mn(e){let r=e.textContent??"";return e.textContent="",r.split("").map(n=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=n,n===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),n===" "?null:t}).filter(n=>n!==null)}function Vt(e){let r=_t(e),n=new Map;for(let s of r){let c=s.offsetTop;n.has(c)||n.set(c,[]),n.get(c).push(s);}let t=[],l=Array.from(n.keys()).sort((s,c)=>s-c);for(let s of l){let c=n.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let x=m.nextElementSibling;u.appendChild(m),d<c.length-1&&x&&x.style.whiteSpace==="pre"&&u.appendChild(x);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function fn(e,r,n,t){if(n<=1||t===0)return e;let l=(n-1)*t,s=r*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function pn(e,r){let n=[];if(r?.y!==void 0&&n.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&n.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&n.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let t=r.scale+(1-r.scale)*e;n.push(`scale(${t})`);}return n.join(" ")||""}var zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,r={}){if(typeof window>"u")return zt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return ye("scrollText: element not found:",e),zt;let t=n,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:x}=r,N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof c=="function"?c:ee[c]??ee["ease-out"],te=pe(m.start??"top 85%"),Me=pe(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let Z;l==="chars"?Z=mn(t):l==="lines"?Z=Vt(t):Z=_t(t);let X=Z.length;function W(g,p){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*p));let R=pn(p,u);R&&(g.style.transform=R);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),Z.forEach((p,R)=>{let de=C(fn(g,R,X,s));W(p,de);});}if(N)return A(1),x?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let L=0,M=0,w=0,O=false,k=false,$=-1,E=0,ne=false,D=()=>window.scrollY,re=()=>window.innerHeight;function oe(){let g=t.getBoundingClientRect(),p=xe({top:g.top,height:g.height},D(),re(),te,Me);L=p.tStart,M=p.tEnd;}function J(){if(!O||k)return;let g=Q(D(),L,M,1);d&&($=Math.max($,g),g=$),E=g,A(g),g>=1&&!ne?(ne=true,x?.()):g<1&&!d&&(ne=false),w=requestAnimationFrame(J);}oe();let ue=new IntersectionObserver(g=>{g.forEach(p=>{O=p.isIntersecting,O&&!k?w=requestAnimationFrame(J):cancelAnimationFrame(w);});}),y;function T(){clearTimeout(y),y=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),Z=Vt(t),A(g);}oe();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),ue.observe(t),Ve(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:L,tEnd:M})}),{destroy(){cancelAnimationFrame(w),ue.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(y),t.innerHTML=B,t.removeAttribute("aria-label"),ze(t);},replay(){$=-1,ne=false,E=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(w);},resume(){k&&(k=false,O&&(w=requestAnimationFrame(J)));},seek(g){let p=Math.min(1,Math.max(0,g));E=p,$=p,k=true,cancelAnimationFrame(w),A(p);},getProgress(){return E}}}function dn(e={}){let r=ref(null);return onMounted(()=>{if(!r.value)return;let n=ct(r.value,e);onUnmounted(()=>n.destroy());}),r}var gt=defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:r}){let n=ref(null);return onMounted(()=>{if(!n.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=ct(n.value,t);onUnmounted(()=>l.destroy());}),()=>h("div",{ref:n},r.default?.())}});function gn(e){let r=ref(null);return onMounted(()=>{if(!r.value)return;let n=ut(r.value,e);onUnmounted(()=>n.destroy());}),r}var yt=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let n=ref(null);return onMounted(()=>{if(!n.value)return;let t=ut(n.value,e.options);onUnmounted(()=>t.destroy());}),()=>h("div",{ref:n},r.default?.())}});function yn(e){let r=ref(null);return onMounted(()=>{if(!r.value)return;let n=ft(r.value,e);onUnmounted(()=>n.destroy());}),r}var ht=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=ref(null);return onMounted(()=>{if(!r.value)return;let n={to:e.to};e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete);let t=ft(r.value,n);onUnmounted(()=>t.destroy());}),()=>h("span",{ref:r})}});function hn(e={}){let r=ref(null);return onMounted(()=>{if(!r.value)return;let n=pt(r.value,e);onUnmounted(()=>n.destroy());}),r}var bt=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=ref(null);return onMounted(()=>{if(!r.value)return;let n=pt(r.value,e.options??{});onUnmounted(()=>n.destroy());}),()=>h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function bn(e={}){let r=ref(null);return onMounted(()=>{if(!r.value)return;let n=dt(r.value,e);onUnmounted(()=>n.destroy());}),r}var wt=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let n=ref(null);return onMounted(()=>{if(!n.value)return;let t=dt(n.value,e.options??{});onUnmounted(()=>t.destroy());}),()=>h(e.tag,{ref:n},r.default?.())}});function tr(){return {install(e){e.component("ScrollDraw",gt),e.component("ScrollAnimate",yt),e.component("ScrollCounter",ht),e.component("ScrollVideo",bt),e.component("ScrollText",wt);}}}export{yt as ScrollAnimate,ht as ScrollCounter,gt as ScrollDraw,wt as ScrollText,bt as ScrollVideo,tr as createScrollDrawPlugin,gn as useScrollAnimate,yn as useScrollCounter,dn as useScrollDraw,bn as useScrollText,hn as useScrollVideo};
3
+ <div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",l,{passive:true}),l(),{el:t,destroy(){window.removeEventListener("scroll",l),t.remove();}}}var It=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Ht=/[MmLlHhVvCcSsQqTtAaZz]/g;function ir(e,n,r){if(!rt)return;let t=(e.match(Ht)??[]).join("").toUpperCase(),l=(n.match(Ht)??[]).join("").toUpperCase(),s=(e.match(It)??[]).length,c=(n.match(It)??[]).length;if(t!==l){be(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${l||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&be(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ct(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),l=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[l++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function ut(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,l=r?{...kt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:x={},stagger:N=0,direction:C="forward",once:te=false,debug:$e=false,axis:B="y",scrollContainer:Z,autoReverse:Y=false,delay:W=0,strokeColor:A,strokeWidth:L,fillOpacity:M,waypoints:v,velocityScale:O=false,threshold:k=0,rootMargin:$="0px",repeat:E=0,repeatDelay:re=0,morphTo:D,clip:ne,autoplay:oe=false,duration:K=1e3,native:ce=true,onProgress:y,onStart:T,onComplete:g,onEnter:p,onLeave:F,onEnterBack:pe,onLeaveBack:Se}=l,ue=ne===true?"left":typeof ne=="string"?ne:false,Ee=typeof d=="function"?d:ee[d]??ee.linear,Pe=fe(x.start??"top bottom"),_e=fe(x.end??"bottom top"),we=typeof Z=="string"?document.querySelector(Z):Z??null,ve=Array.isArray(A)?A[0]:null,se=Array.isArray(A)?A[1]:typeof A=="string"?A:null,ie=Array.isArray(L)?L[0]:null,G=Array.isArray(L)?L[1]:typeof L=="number"?L:null,me=Array.isArray(M)?M[0]:null,X=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Oe(o){let a=o*100;switch(ue){case "right":return `inset(0 0 0 ${100-a}%)`;case "top":return `inset(0 0 ${100-a}% 0)`;case "bottom":return `inset(${100-a}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let V=ue?[]:Array.from(e.querySelectorAll(c)),P=[],i=[],f=0,de=0,I=false,z=false,_=0,Ae=false,ge=-1,J=-1,j=false,ye=0,Ie=0,Ne,ot=null;function St(){ot?.destroy(),ot=null;}let Ve=new Set,Et=NaN,ze=true,Xe=-1,Tt=performance.now(),qe=NaN;function st(){return we?B==="x"?we.scrollLeft:we.scrollTop:B==="x"?window.scrollX:window.scrollY}function xt(){return we?B==="x"?we.clientWidth:we.clientHeight:B==="x"?window.innerWidth:window.innerHeight}function At(){let o=tt(e,we,B);return xe(o,o.scroll,xt(),Pe,_e)}function Mt(){(({tStart:f,tEnd:de}=At())),$e&&rt&&(St(),ot=sr(f,de,B));}function it(o,a=At){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let w=o.destroy;return o.destroy=()=>{w.call(o),Le(e);},o}function Gt(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ue){let w=a==="reverse"?1-o:o;e.style.clipPath=Oe(w);return}V.forEach((w,ae)=>{w.style.strokeDashoffset=a==="reverse"?`${P[ae]*o}`:`${P[ae]*(1-o)}`,m&&(w.style.opacity=a==="reverse"?`${1-o}`:`${o}`),ve&&se?w.style.stroke=We(ve,se,o):se&&(w.style.stroke=se),ie!==null&&G!==null?w.style.strokeWidth=`${ie+(G-ie)*o}`:G!==null&&(w.style.strokeWidth=`${G}`),me!==null&&X!==null?w.style.fillOpacity=`${me+(X-me)*o}`:X!==null&&(w.style.fillOpacity=`${X}`),D&&w.tagName.toLowerCase()==="path"&&i[ae]&&w.setAttribute("d",ct(i[ae],D,o));});}function Qe(){if(e.style.setProperty("--scroll-draw-progress","0"),ue){e.style.clipPath=Oe(0);return}V.forEach((o,a)=>{o.style.strokeDasharray=`${P[a]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${P[a]}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ie!==null&&(o.style.strokeWidth=`${ie}`),me!==null&&(o.style.fillOpacity=`${me}`),D&&o.tagName.toLowerCase()==="path"&&i[a]&&o.setAttribute("d",i[a]);});}if(V.forEach(o=>{or(o);let a=Be(o);P.push(a);let w=o.tagName.toLowerCase()==="path";w?i.push(o.getAttribute("d")??""):i.push(""),D&&(w?ir(i[i.length-1],D,o):be(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?`${a}`:"0",m&&(o.style.opacity="1"),se&&(o.style.stroke=se),G!==null&&(o.style.strokeWidth=`${G}`),X!==null&&(o.style.fillOpacity=`${X}`),D&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",D)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=C==="reverse"?"0":`${a}`,m?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",ve&&(o.style.stroke=ve),ie!==null&&(o.style.strokeWidth=`${ie}`),me!==null&&(o.style.fillOpacity=`${me}`));}),ue){if(s)return e.style.clipPath=Oe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ct=typeof d=="string"?nt(d):null;function jt(){return !(ce===false||!nr()||!V.length||!Ct||ue||B!=="y"||we||u!==1||N!==0||te||Y||O!==false||D||v||E||W>0||y||T||g||p||F||pe||Se||A!=null||L!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function Ut(){let o=++rr,a=`svg-scroll-draw-${o}`,w=`svg-scroll-draw-host-${o}`,ae=`--svg-scroll-draw-${o}`,He=C==="reverse"?"0":"var(--ssd-len)",ke=C==="reverse"?"var(--ssd-len)":"0",Me=`stroke-dashoffset:${He};`,S=`stroke-dashoffset:${ke};`;m&&(Me+=`opacity:${C==="reverse"?1:0};`,S+=`opacity:${C==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${a}{from{${Me}}to{${S}}}.${w}{view-timeline-name:${ae};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${ae};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(w);function le(h,U){h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`,h.style.strokeDashoffset="",h.style.opacity="",h.style.animationPlayState="",h.classList.add(a);}V.forEach(le);let b=false,H=-1;function q(){if(H>=0)return H;let h=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:h.top,height:h.height},st(),xt(),Pe,_e);return Ee(Q(st(),U,Te,u))}return {destroy(){e.classList.remove(w),V.forEach(h=>{h.classList.remove(a),h.style.removeProperty("--ssd-len"),h.style.animationPlayState="";}),R.remove();},replay(){b=false,H=-1,V.forEach(le);},pause(){b=true,V.forEach(h=>{h.style.animationPlayState="paused";});},resume(){b&&(b=false,V.forEach(h=>{h.style.animationPlayState="running";}));},seek(h){let U=Math.min(1,Math.max(0,h));H=U,b=true,V.forEach((Te,he)=>{Te.classList.remove(a),Te.style.strokeDashoffset=C==="reverse"?`${P[he]*U}`:`${P[he]*(1-U)}`,m&&(Te.style.opacity=C==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return q()},refresh(){V.forEach((h,U)=>{P[U]=Be(h),h.style.setProperty("--ssd-len",String(P[U])),h.style.strokeDasharray=`${P[U]}`;});}}}if(jt())return it(Ut());function Yt(){let o=Math.max(1,K),a=0,w=0,ae=false;function He(b){let H=true;if(ue){let q=Math.min(1,Math.max(0,b/o)),h=Ee(q);ye=h,e.style.setProperty("--scroll-draw-progress",String(h)),e.style.clipPath=Oe(C==="reverse"?1-h:h),y?.(h),q<1&&(H=false);}else V.forEach((q,h)=>{let U=h*N*o,Te=Math.min(1,Math.max(0,(b-U)/o)),he=Ee(Te);q.style.strokeDashoffset=C==="reverse"?`${P[h]*he}`:`${P[h]*(1-he)}`,m&&(q.style.opacity=C==="reverse"?`${1-he}`:`${he}`),ve&&se?q.style.stroke=We(ve,se,he):se&&(q.style.stroke=se),ie!==null&&G!==null?q.style.strokeWidth=`${ie+(G-ie)*he}`:G!==null&&(q.style.strokeWidth=`${G}`),me!==null&&X!==null?q.style.fillOpacity=`${me+(X-me)*he}`:X!==null&&(q.style.fillOpacity=`${X}`),D&&q.tagName.toLowerCase()==="path"&&i[h]&&q.setAttribute("d",ct(i[h],D,he)),h===0&&(ye=he,y?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Te<1&&(H=false);});if(v){let q=Math.min(1,Math.max(0,b/o)),h=Ee(q);for(let U in v){let Te=parseFloat(U);h>=Te&&!Ve.has(Te)&&(Ve.add(Te),v[U]?.());}}return H}function ke(b){if(j)return;let H=b-a;z||(z=true,T?.());let q=He(H);if(q&&!I){I=true,He(o*(1+Math.max(0,V.length-1)*N)),g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{a=performance.now(),z=false,I=false,Ve.clear(),Qe(),_=requestAnimationFrame(ke);},re));return}q||(_=requestAnimationFrame(ke));}function Me(){cancelAnimationFrame(_),clearTimeout(Ne),a=performance.now(),w=0,j=false,z=false,I=false,Ie=0,ae=true,ye=0,Ve.clear(),Qe(),_=requestAnimationFrame(ke);}let S=new IntersectionObserver(b=>{b.forEach(H=>{H.isIntersecting&&!(te&&I)?Me():!H.isIntersecting&&!te&&!I&&(cancelAnimationFrame(_),clearTimeout(Ne),ae=false);});},{root:we??null,threshold:k,rootMargin:$}),R;function le(){clearTimeout(R),R=setTimeout(()=>{V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});},150);}return window.addEventListener("resize",le),window.addEventListener("orientationchange",le),W>0?setTimeout(()=>S.observe(e),W):S.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Ne),S.disconnect(),window.removeEventListener("resize",le),window.removeEventListener("orientationchange",le),clearTimeout(R);},replay(){Ie=0,Me();},pause(){j||!ae||(j=true,w=performance.now()-a,cancelAnimationFrame(_));},resume(){j&&(j=false,ae=true,a=performance.now()-w,_=requestAnimationFrame(ke));},seek(b){let H=Math.min(1,Math.max(0,b));ye=H,j=true,w=H*o,a=performance.now()-w,cancelAnimationFrame(_),He(w);},getProgress(){return ye},refresh(){clearTimeout(R),V.forEach((b,H)=>{P[H]=Be(b),b.style.strokeDasharray=`${P[H]}`;});}}}if(oe)return it(Yt());Mt();function Ze(){if(!Ae||j)return;let o=performance.now(),a=st();if(!ze&&O===false&&a===Et){_=requestAnimationFrame(Ze);return}ze=false,Et=a;let w=u;if(O!==false){let S=o-Tt,R=S>0?Math.abs(a-(Xe<0?a:Xe))/S:0;w=u*Math.max(.2,1+R*(typeof O=="number"?O:1)*.04);}Xe=a,Tt=o;let ae=Y?J===-1||a>=J?"forward":"reverse":C;J=a;let He=de-f,ke=true,Me=He===0?0:(a-f)/He;if(isNaN(qe)||(qe<=0&&Me>0?p?.():qe>0&&Me<=0&&Se?.(),qe<1&&Me>=1?F?.():qe>=1&&Me<1&&pe?.()),qe=Me,ue){let S=Ee(Q(a,f,de,w));te&&!Y&&(ge=Math.max(ge,S),S=ge),ye=S,e.style.setProperty("--scroll-draw-progress",String(S));let R=ae==="reverse"?1-S:S;e.style.clipPath=Oe(R),y?.(S),!z&&Q(a,f,de,w)>0&&(z=true,T?.()),S>=1&&!I?(I=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{ge=-1,z=false,I=false,e.style.clipPath=Oe(0);},re))):S<1&&!te&&(I=false),_=requestAnimationFrame(Ze);return}if(V.forEach((S,R)=>{let le=R*N*He,b=Ee(Q(a,f+le,de+le,w));te&&!Y&&(ge=Math.max(ge,b),b=ge),ye=b,S.style.strokeDashoffset=ae==="reverse"?`${P[R]*b}`:`${P[R]*(1-b)}`,m&&(S.style.opacity=ae==="reverse"?`${1-b}`:`${b}`),ve&&se?S.style.stroke=We(ve,se,b):se&&(S.style.stroke=se),ie!==null&&G!==null?S.style.strokeWidth=`${ie+(G-ie)*b}`:G!==null&&(S.style.strokeWidth=`${G}`),me!==null&&X!==null?S.style.fillOpacity=`${me+(X-me)*b}`:X!==null&&(S.style.fillOpacity=`${X}`),D&&S.tagName.toLowerCase()==="path"&&i[R]&&S.setAttribute("d",ct(i[R],D,b)),R===0&&(y?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(ke=false);}),v){let S=Ee(Q(a,f,de,w));for(let R in v){let le=parseFloat(R);S>=le&&!Ve.has(le)&&(Ve.add(le),v[R]?.());}}!z&&Q(a,f,de,w)>0&&(z=true,T?.()),ke&&!I?(I=true,g?.(),Ie<(E==="infinite"?1/0:E??0)&&(Ie++,Ne=setTimeout(()=>{ge=-1,z=false,I=false,Ve.clear(),Qe(),ze=true;},re))):!ke&&!te&&(I=false),_=requestAnimationFrame(Ze);}let at=false;function Ke(){at||(at=true,_=requestAnimationFrame(function(){Ze();}));}function Je(){at=false,cancelAnimationFrame(_);}let lt=new IntersectionObserver(o=>{o.forEach(a=>{Ae=a.isIntersecting,Ae&&!j?(ze=true,Ke()):Je();});},{root:we??null,threshold:k,rootMargin:$});function Lt(){V.forEach((o,a)=>{P[a]=Be(o),o.style.strokeDasharray=`${P[a]}`;}),Mt(),ze=true;}let et;function Ge(){clearTimeout(et),et=setTimeout(Lt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),W>0?setTimeout(()=>lt.observe(e),W):lt.observe(e),it({destroy(){cancelAnimationFrame(_),clearTimeout(Ne),Je(),lt.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(et),St();},replay(){ge=-1,J=-1,Xe=-1,z=false,I=false,Ie=0,j=false,ye=0,Ve.clear(),clearTimeout(Ne),Qe(),ze=true,Ae&&Ke();},pause(){j=true,Je();},resume(){j&&(j=false,ze=true,Ae&&Ke());},seek(o){let a=Math.min(1,Math.max(0,o));ye=a,ge=a,j=true,Je(),Gt(a,C),ze=true;},getProgress(){return ye},refresh(){clearTimeout(et),Lt(),Ae&&!j&&Ke();}},()=>({tStart:f,tEnd:de}))}function ar(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Nt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let l=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);l.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:l,units:s});}return n}function lr(e,n,r){let t=Nt(e),l=Nt(n);return t.length===0||t.length!==l.length?r<1?e:n:t.map((s,c)=>{let u=l[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function Vt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),l=String(n);if(ar(t))return We(t,l,r);if(t.includes("("))return lr(t,l,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=l.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:l}function cr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var ur=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),mr=0,zt="--scroll-draw-progress";function fr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function mt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:l={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:x=true,velocityScale:N=false,respectReducedMotion:C=true,triggerElement:te,onProgress:$e,onComplete:B,onEnter:Z,onLeave:Y,onEnterBack:W,onLeaveBack:A}=n,L=C&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,M=typeof s=="function"?s:ee[s]??ee["ease-out"],v=fe(l.start??"top bottom"),O=fe(l.end??"bottom top"),k=te??e,$=typeof d=="string"?document.querySelector(d):d??null,E=Object.entries(t).map(([i,f])=>({prop:cr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function re(){let i=window.getComputedStyle(e);for(let f of E)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function D(){for(let i of E)e.style.setProperty(i.prop,String(i.to));}let ne=new Map;for(let i of [...E.map(f=>f.prop),zt])ne.set(i,e.style.getPropertyValue(i));function oe(){for(let[i,f]of ne)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(L)return D(),B?.(),{...r,destroy:oe,getProgress:()=>1};re();let K=typeof s=="string"?nt(s):null;function ce(){if(!x||!fr()||!K||m!=="y"||$||k!==e||u||c!==1||$e||B||Z||Y||W||A||N!==false||(l.start??"top bottom").trim()!=="top bottom"||(l.end??"bottom top").trim()!=="bottom top")return false;for(let i of E)if(!ur.has(i.prop))return false;return true}function y(){let i=`ssd-a-${++mr}`,f=E.map(J=>`${J.prop}:${J.from}`).join(";"),de=E.map(J=>`${J.prop}:${J.to}`).join(";"),I=document.createElement("style");I.setAttribute("data-ssd-animate",""),I.textContent=`@keyframes ${i}{from{${f}}to{${de}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${K};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(i);let z=()=>m==="x"?window.scrollX:window.scrollY,_=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let J=e.getBoundingClientRect();return xe({top:J.top,height:J.height},z(),_(),v,O)};Ce(e,{type:"animate",getProgress:()=>ge.getProgress(),getTrigger:Ae});let ge={destroy(){e.classList.remove(i),I.remove(),e.style.animationPlayState="",oe(),Le(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(J){let j=Math.min(1,Math.max(0,J));e.classList.remove(i);for(let ye of E)e.style.setProperty(ye.prop,Vt(ye.from,ye.to,j));},getProgress(){let{tStart:J,tEnd:j}=Ae();return M(Q(z(),J,j,c))}};return ge}if(ce())return y();let T=0,g=0,p=0,F=false,pe=false,Se=-1,ue=0,Ee=false,Pe=NaN,_e=-1,we=0,ve=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,se=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ie(){let i=tt(k,$,m),f=xe(i,i.scroll,se(),v,O);T=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(zt,String(i));for(let f of E)e.style.setProperty(f.prop,Vt(f.from,f.to,i));$e?.(i);}function me(i){if(isNaN(Pe)){Pe=i;return}Pe<=0&&i>0?Z?.():Pe>0&&i<=0&&A?.(),Pe<1&&i>=1?Y?.():Pe>=1&&i<1&&W?.(),Pe=i;}function X(){if(!F||pe)return;let i=performance.now(),f=ve(),de=c;if(N!==false){let _=i-we,Ae=_>0?Math.abs(f-(_e<0?f:_e))/_:0;de=c*Math.max(.2,1+Ae*(typeof N=="number"?N:1)*.04);}_e=f,we=i;let I=g===T?0:(f-T)/(g-T);me(I);let z=M(Q(f,T,g,de));u&&(Se=Math.max(Se,z),z=Se),ue=z,G(z),z>=1&&!Ee?(Ee=true,B?.()):z<1&&!u&&(Ee=false),p=requestAnimationFrame(X);}ie(),g===T&&be("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let i=M(Q(ve(),T,g,c));u&&i>0&&(Se=i),ue=i,G(i);}let Oe=new IntersectionObserver(i=>{i.forEach(f=>{F=f.isIntersecting,F&&!pe?p=requestAnimationFrame(X):cancelAnimationFrame(p);});},{root:$??null}),V;function P(){clearTimeout(V),V=setTimeout(ie,150);}return window.addEventListener("resize",P),window.addEventListener("orientationchange",P),Oe.observe(e),Ce(e,{type:"animate",getProgress:()=>ue,getTrigger:()=>({tStart:T,tEnd:g})}),{destroy(){cancelAnimationFrame(p),Oe.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),clearTimeout(V),oe(),Le(e);},replay(){Se=-1,Ee=false,ue=0,pe=false,G(0);},pause(){pe=true,cancelAnimationFrame(p);},resume(){pe&&(pe=false,F&&(p=requestAnimationFrame(X)));},seek(i){let f=Math.min(1,Math.max(0,i));ue=f,Se=f,pe=true,cancelAnimationFrame(p),G(f);},getProgress(){return ue}}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function pt(e,n){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollCounter: element not found:",e),ft;let t=r,{from:l=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:x,onComplete:N}=n,C=x!==void 0?y=>y.toFixed(x):c??(y=>String(Math.round(y))),te=typeof u=="function"?u:ee[u]??ee["ease-out"],$e=fe(m.start??"top 80%"),B=fe(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=C(s),N?.(),ft;let Y=0,W=0,A=0,L=false,M=false,v=-1,O=0,k=false,$=()=>window.scrollY,E=()=>window.innerHeight;function re(){let y=t.getBoundingClientRect(),T=xe({top:y.top,height:y.height},$(),E(),$e,B);Y=T.tStart,W=T.tEnd;}function D(y){t.textContent=C(l+(s-l)*y),t.style.setProperty("--scroll-draw-progress",String(y));}function ne(){if(!L||M)return;let y=te(Q($(),Y,W,1));d&&(v=Math.max(v,y),y=v),O=y,D(y),y>=1&&!k?(k=true,N?.()):y<1&&!d&&(k=false),A=requestAnimationFrame(ne);}re();{let y=te(Q($(),Y,W,1));d&&y>0&&(v=y),O=y,D(y);}let oe=new IntersectionObserver(y=>{y.forEach(T=>{L=T.isIntersecting,L&&!M?A=requestAnimationFrame(ne):cancelAnimationFrame(A);});}),K;function ce(){clearTimeout(K),K=setTimeout(re,150);}return window.addEventListener("resize",ce),window.addEventListener("orientationchange",ce),oe.observe(t),Ce(t,{type:"counter",getProgress:()=>O,getTrigger:()=>({tStart:Y,tEnd:W})}),{destroy(){cancelAnimationFrame(A),oe.disconnect(),window.removeEventListener("resize",ce),window.removeEventListener("orientationchange",ce),clearTimeout(K),Le(t);},replay(){v=-1,k=false,O=0,M=false,D(0);},pause(){M=true,cancelAnimationFrame(A);},resume(){M&&(M=false,L&&(A=requestAnimationFrame(ne)));},seek(y){let T=Math.min(1,Math.max(0,y));O=T,v=T,M=true,cancelAnimationFrame(A),D(T);},getProgress(){return O}}}var _t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n={}){if(typeof window>"u")return _t;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return be("scrollVideo: <video> element not found:",e),_t;let t=r,{trigger:l={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",onReady:d,onComplete:x,onProgress:N}=n,C=window.matchMedia("(prefers-reduced-motion: reduce)").matches,te=typeof s=="function"?s:ee[s]??ee.linear,$e=fe(l.start??"top top"),B=fe(l.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Z=n.from??0,Y=n.to,W=0,A=0,L=0,M=false,v=false,O=-1,k=0,$=false,E=false,re=()=>u==="x"?window.scrollX:window.scrollY,D=()=>u==="x"?window.innerWidth:window.innerHeight;function ne(){let p=t.getBoundingClientRect(),F=u==="x"?p.left:p.top,pe=u==="x"?p.width:p.height,Se=xe({top:F,height:pe},re(),D(),$e,B);W=Se.tStart,A=Se.tEnd;}function oe(p){if(!E)return;let F=Y??t.duration??0;t.currentTime=Z+(F-Z)*p,t.style.setProperty("--scroll-draw-progress",String(p)),N?.(p);}function K(){if(!M||v||!E)return;let p=te(Q(re(),W,A,1));c&&(O=Math.max(O,p),p=O),k=p,oe(p),p>=1&&!$?($=true,x?.()):p<1&&!c&&($=false),L=requestAnimationFrame(K);}function ce(){if(E=true,Y===void 0&&(Y=t.duration),C){oe(1),d?.();return}ne(),d?.(),M&&!v&&(L=requestAnimationFrame(K));}t.readyState>=1?ce():t.addEventListener("loadedmetadata",ce,{once:true}),E||ne();let y=new IntersectionObserver(p=>{p.forEach(F=>{M=F.isIntersecting,M&&!v&&E?L=requestAnimationFrame(K):cancelAnimationFrame(L);});}),T;function g(){clearTimeout(T),T=setTimeout(ne,150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),y.observe(t),Ce(t,{type:"video",getProgress:()=>k,getTrigger:()=>({tStart:W,tEnd:A})}),{destroy(){cancelAnimationFrame(L),y.disconnect(),t.removeEventListener("loadedmetadata",ce),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(T),Le(t);},replay(){O=-1,$=false,k=0,v=false,oe(0);},pause(){v=true,cancelAnimationFrame(L);},resume(){v&&(v=false,M&&E&&(L=requestAnimationFrame(K)));},seek(p){let F=Math.min(1,Math.max(0,p));k=F,O=F,v=true,cancelAnimationFrame(L),oe(F);},getProgress(){return k}}}function Wt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function pr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function qt(e){let n=Wt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],l=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of l){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let x=m.nextElementSibling;u.appendChild(m),d<c.length-1&&x&&x.style.whiteSpace==="pre"&&u.appendChild(x);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function dr(e,n,r,t){if(r<=1||t===0)return e;let l=(r-1)*t,s=n*t,c=s+(1-l);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function gr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return Bt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollText: element not found:",e),Bt;let t=r,{split:l="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:x}=n,N=window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof c=="function"?c:ee[c]??ee["ease-out"],te=fe(m.start??"top 85%"),$e=fe(m.end??"top 40%"),B=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let Z;l==="chars"?Z=pr(t):l==="lines"?Z=qt(t):Z=Wt(t);let Y=Z.length;function W(g,p){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*p));let F=gr(p,u);F&&(g.style.transform=F);}function A(g){t.style.setProperty("--scroll-draw-progress",String(g)),Z.forEach((p,F)=>{let pe=C(dr(g,F,Y,s));W(p,pe);});}if(N)return A(1),x?.(),{destroy(){t.innerHTML=B,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};A(0);let L=0,M=0,v=0,O=false,k=false,$=-1,E=0,re=false,D=()=>window.scrollY,ne=()=>window.innerHeight;function oe(){let g=t.getBoundingClientRect(),p=xe({top:g.top,height:g.height},D(),ne(),te,$e);L=p.tStart,M=p.tEnd;}function K(){if(!O||k)return;let g=Q(D(),L,M,1);d&&($=Math.max($,g),g=$),E=g,A(g),g>=1&&!re?(re=true,x?.()):g<1&&!d&&(re=false),v=requestAnimationFrame(K);}oe();let ce=new IntersectionObserver(g=>{g.forEach(p=>{O=p.isIntersecting,O&&!k?v=requestAnimationFrame(K):cancelAnimationFrame(v);});}),y;function T(){clearTimeout(y),y=setTimeout(()=>{if(l==="lines"){let g=E;t.innerHTML=B,t.setAttribute("aria-label",t.textContent??""),Z=qt(t),A(g);}oe();},150);}return window.addEventListener("resize",T),window.addEventListener("orientationchange",T),ce.observe(t),Ce(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:L,tEnd:M})}),{destroy(){cancelAnimationFrame(v),ce.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),clearTimeout(y),t.innerHTML=B,t.removeAttribute("aria-label"),Le(t);},replay(){$=-1,re=false,E=0,k=false,A(0);},pause(){k=true,cancelAnimationFrame(v);},resume(){k&&(k=false,O&&(v=requestAnimationFrame(K)));},seek(g){let p=Math.min(1,Math.max(0,g));E=p,$=p,k=true,cancelAnimationFrame(v),A(p);},getProgress(){return E}}}function yr(e={}){let n=ref(null);return onMounted(()=>{if(!n.value)return;let r=ut(n.value,e);onUnmounted(()=>r.destroy());}),n}var yt=defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=ref(null);return onMounted(()=>{if(!r.value)return;let t={};e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete);let l=ut(r.value,t);onUnmounted(()=>l.destroy());}),()=>h("div",{ref:r},n.default?.())}});function hr(e){let n=ref(null);return onMounted(()=>{if(!n.value)return;let r=mt(n.value,e);onUnmounted(()=>r.destroy());}),n}var ht=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=ref(null);return onMounted(()=>{if(!r.value)return;let t=mt(r.value,e.options);onUnmounted(()=>t.destroy());}),()=>h("div",{ref:r},n.default?.())}});function br(e){let n=ref(null);return onMounted(()=>{if(!n.value)return;let r=pt(n.value,e);onUnmounted(()=>r.destroy());}),n}var bt=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=ref(null);return onMounted(()=>{if(!n.value)return;let r={to:e.to};e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete);let t=pt(n.value,r);onUnmounted(()=>t.destroy());}),()=>h("span",{ref:n})}});function wr(e={}){let n=ref(null);return onMounted(()=>{if(!n.value)return;let r=dt(n.value,e);onUnmounted(()=>r.destroy());}),n}var wt=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let n=ref(null);return onMounted(()=>{if(!n.value)return;let r=dt(n.value,e.options??{});onUnmounted(()=>r.destroy());}),()=>h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function vr(e={}){let n=ref(null);return onMounted(()=>{if(!n.value)return;let r=gt(n.value,e);onUnmounted(()=>r.destroy());}),n}var vt=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=ref(null);return onMounted(()=>{if(!r.value)return;let t=gt(r.value,e.options??{});onUnmounted(()=>t.destroy());}),()=>h(e.tag,{ref:r},n.default?.())}});function on(){return {install(e){e.component("ScrollDraw",yt),e.component("ScrollAnimate",ht),e.component("ScrollCounter",bt),e.component("ScrollVideo",wt),e.component("ScrollText",vt);}}}export{ht as ScrollAnimate,bt as ScrollCounter,yt as ScrollDraw,vt as ScrollText,wt as ScrollVideo,on as createScrollDrawPlugin,hr as useScrollAnimate,br as useScrollCounter,yr as useScrollDraw,vr as useScrollText,wr as useScrollVideo};