svg-scroll-draw 2.20.1 → 2.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +11 -9
  2. package/dist/angular/index.cjs +3 -3
  3. package/dist/angular/index.d.mts +1 -1
  4. package/dist/angular/index.d.ts +1 -1
  5. package/dist/angular/index.mjs +1 -1
  6. package/dist/astro/index.cjs +3 -3
  7. package/dist/astro/index.mjs +1 -1
  8. package/dist/cdn/svg-scroll-draw.dev.global.js +83 -29
  9. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  10. package/dist/chunk-2PYLM3E7.mjs +1 -0
  11. package/dist/chunk-DY5JCXVR.mjs +1 -0
  12. package/dist/{chunk-MTEGM4RR.mjs → chunk-GVBO5GRD.mjs} +1 -1
  13. package/dist/chunk-HX4SP5WN.mjs +3 -0
  14. package/dist/chunk-LTCJVVSC.mjs +1 -0
  15. package/dist/chunk-N6PDF6O6.mjs +2 -0
  16. package/dist/{chunk-SMRTRZSD.mjs → chunk-OTDD2ROH.mjs} +1 -1
  17. package/dist/{chunk-ECHMYVSK.mjs → chunk-PKY27MO4.mjs} +1 -1
  18. package/dist/chunk-VDTAYUAR.mjs +1 -0
  19. package/dist/chunk-WXUOF4NM.mjs +1 -0
  20. package/dist/cinematic/index.cjs +2 -2
  21. package/dist/cinematic/index.mjs +1 -1
  22. package/dist/{engine-DQyBzZDl.d.ts → engine-B7UpB4fT.d.ts} +2 -1
  23. package/dist/{engine-P8u6OK4m.d.mts → engine-o1VSQ1lX.d.mts} +2 -1
  24. package/dist/group/index.cjs +3 -3
  25. package/dist/group/index.d.mts +2 -2
  26. package/dist/group/index.d.ts +2 -2
  27. package/dist/group/index.mjs +1 -1
  28. package/dist/horizontal/index.cjs +1 -1
  29. package/dist/horizontal/index.d.mts +2 -1
  30. package/dist/horizontal/index.d.ts +2 -1
  31. package/dist/horizontal/index.mjs +1 -1
  32. package/dist/{index-CMqK0GCT.d.mts → index-BY-CNE8c.d.mts} +1 -1
  33. package/dist/{index-DPqPEnO-.d.ts → index-DqXXiDIk.d.ts} +1 -1
  34. package/dist/index.cjs +4 -4
  35. package/dist/index.d.mts +2 -2
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.mjs +1 -1
  38. package/dist/nuxt/index.cjs +3 -3
  39. package/dist/nuxt/index.d.mts +1 -1
  40. package/dist/nuxt/index.d.ts +1 -1
  41. package/dist/nuxt/index.mjs +1 -1
  42. package/dist/react/index.cjs +3 -3
  43. package/dist/react/index.d.mts +1 -1
  44. package/dist/react/index.d.ts +1 -1
  45. package/dist/react/index.mjs +1 -1
  46. package/dist/reveal/index.cjs +1 -1
  47. package/dist/reveal/index.mjs +1 -1
  48. package/dist/snap/index.mjs +1 -1
  49. package/dist/solid/index.cjs +3 -3
  50. package/dist/solid/index.d.mts +1 -1
  51. package/dist/solid/index.d.ts +1 -1
  52. package/dist/solid/index.mjs +1 -1
  53. package/dist/svelte/index.cjs +3 -3
  54. package/dist/svelte/index.d.mts +1 -1
  55. package/dist/svelte/index.d.ts +1 -1
  56. package/dist/svelte/index.mjs +1 -1
  57. package/dist/text/index.cjs +1 -1
  58. package/dist/text/index.mjs +1 -1
  59. package/dist/timeline/index.mjs +1 -1
  60. package/dist/video/index.cjs +1 -1
  61. package/dist/video/index.mjs +1 -1
  62. package/dist/vue/index.cjs +3 -3
  63. package/dist/vue/index.d.mts +1 -1
  64. package/dist/vue/index.d.ts +1 -1
  65. package/dist/vue/index.mjs +1 -1
  66. package/dist/web-component/index.cjs +3 -3
  67. package/dist/web-component/index.mjs +1 -1
  68. package/package.json +1 -1
  69. package/dist/chunk-7SBTYJGH.mjs +0 -1
  70. package/dist/chunk-BFX2CSQ3.mjs +0 -1
  71. package/dist/chunk-ENACACPZ.mjs +0 -3
  72. package/dist/chunk-I45LCJUP.mjs +0 -1
  73. package/dist/chunk-KGAJQP2N.mjs +0 -2
  74. package/dist/chunk-KHQ7OGQK.mjs +0 -1
@@ -364,6 +364,45 @@ var SvgScrollDraw = (() => {
364
364
  };
365
365
  }
366
366
 
367
+ // src/core/motion-watch.ts
368
+ function watchReducedMotion(cb) {
369
+ if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
370
+ return () => {
371
+ };
372
+ }
373
+ const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
374
+ const handler = (e) => cb(!!e.matches);
375
+ if (typeof mq.addEventListener === "function") {
376
+ mq.addEventListener("change", handler);
377
+ return () => mq.removeEventListener("change", handler);
378
+ }
379
+ const legacy = mq;
380
+ legacy.addListener?.(handler);
381
+ return () => legacy.removeListener?.(handler);
382
+ }
383
+
384
+ // src/core/motion-live.ts
385
+ function finishWhenReduced(options, build) {
386
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return build(options, true);
387
+ let inst = build(options, false);
388
+ const unwatch = watchReducedMotion((reduced) => {
389
+ if (!reduced) return;
390
+ unwatch();
391
+ const finished = (inst.getProgress?.() ?? 0) >= 1;
392
+ inst.destroy();
393
+ inst = build(finished ? { ...options, onComplete: void 0 } : options, true);
394
+ });
395
+ const live = {};
396
+ for (const key of Object.keys(inst)) {
397
+ live[key] = (...args) => inst[key]?.(...args);
398
+ }
399
+ live.destroy = () => {
400
+ unwatch();
401
+ inst.destroy();
402
+ };
403
+ return live;
404
+ }
405
+
367
406
  // src/core/engine.ts
368
407
  var nativeUid = 0;
369
408
  function supportsNativeTimeline() {
@@ -454,9 +493,11 @@ var SvgScrollDraw = (() => {
454
493
  }, seek: () => {
455
494
  }, getProgress: () => 0 };
456
495
  }
496
+ return finishWhenReduced(rawOptions, (options, reduced) => buildEngine(container, options, reduced));
497
+ }
498
+ function buildEngine(container, rawOptions, prefersReduced) {
457
499
  const { preset, ...userOptions } = rawOptions;
458
500
  const options = preset ? { ...PRESETS[preset], ...userOptions } : userOptions;
459
- const prefersReduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
460
501
  const {
461
502
  selector = "path, polyline, line, polygon, rect, circle",
462
503
  speed = 1,
@@ -1319,21 +1360,25 @@ var SvgScrollDraw = (() => {
1319
1360
  function supportsNativeTimeline2() {
1320
1361
  return typeof CSS !== "undefined" && typeof CSS.supports === "function" && CSS.supports("animation-timeline: view()");
1321
1362
  }
1363
+ var NOOP = {
1364
+ destroy: () => {
1365
+ },
1366
+ replay: () => {
1367
+ },
1368
+ pause: () => {
1369
+ },
1370
+ resume: () => {
1371
+ },
1372
+ seek: () => {
1373
+ },
1374
+ getProgress: () => 0
1375
+ };
1322
1376
  function createAnimateEngine(el, options) {
1323
- const NOOP3 = {
1324
- destroy: () => {
1325
- },
1326
- replay: () => {
1327
- },
1328
- pause: () => {
1329
- },
1330
- resume: () => {
1331
- },
1332
- seek: () => {
1333
- },
1334
- getProgress: () => 0
1335
- };
1336
- if (typeof window === "undefined") return NOOP3;
1377
+ if (typeof window === "undefined") return NOOP;
1378
+ if (options.respectReducedMotion === false) return buildAnimateEngine(el, options, false);
1379
+ return finishWhenReduced(options, (opts, reduced) => buildAnimateEngine(el, opts, reduced));
1380
+ }
1381
+ function buildAnimateEngine(el, options, prefersReduced) {
1337
1382
  const {
1338
1383
  props,
1339
1384
  trigger = {},
@@ -1344,7 +1389,6 @@ var SvgScrollDraw = (() => {
1344
1389
  scrollContainer,
1345
1390
  native = true,
1346
1391
  velocityScale = false,
1347
- respectReducedMotion = true,
1348
1392
  triggerElement,
1349
1393
  onProgress,
1350
1394
  onComplete,
@@ -1353,7 +1397,6 @@ var SvgScrollDraw = (() => {
1353
1397
  onEnterBack,
1354
1398
  onLeaveBack
1355
1399
  } = options;
1356
- const prefersReduced = respectReducedMotion && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1357
1400
  const easeFn = typeof easing === "function" ? easing : EASINGS[easing] ?? EASINGS["ease-out"];
1358
1401
  const startConfig = parseTrigger(trigger.start ?? "top bottom");
1359
1402
  const endConfig = parseTrigger(trigger.end ?? "bottom top");
@@ -1390,7 +1433,7 @@ var SvgScrollDraw = (() => {
1390
1433
  if (prefersReduced) {
1391
1434
  applyFinal();
1392
1435
  onComplete?.();
1393
- return { ...NOOP3, destroy: restoreInline, getProgress: () => 1 };
1436
+ return { ...NOOP, destroy: restoreInline, getProgress: () => 1 };
1394
1437
  }
1395
1438
  resolveFromValues();
1396
1439
  const cssTiming = typeof easing === "string" ? cssTimingFor(easing) : null;
@@ -1638,7 +1681,7 @@ var SvgScrollDraw = (() => {
1638
1681
  }
1639
1682
 
1640
1683
  // src/animate/index.ts
1641
- var NOOP = {
1684
+ var NOOP2 = {
1642
1685
  destroy: () => {
1643
1686
  },
1644
1687
  replay: () => {
@@ -1652,20 +1695,20 @@ var SvgScrollDraw = (() => {
1652
1695
  getProgress: () => 0
1653
1696
  };
1654
1697
  function scrollAnimate(target, options) {
1655
- if (typeof window === "undefined") return NOOP;
1698
+ if (typeof window === "undefined") return NOOP2;
1656
1699
  const el = typeof target === "string" ? document.querySelector(target) : target;
1657
1700
  if (!el) {
1658
1701
  warn("scrollAnimate: element not found:", target);
1659
- return NOOP;
1702
+ return NOOP2;
1660
1703
  }
1661
1704
  return createAnimateEngine(el, options);
1662
1705
  }
1663
1706
  function scrollParallax(target, options = {}) {
1664
- if (typeof window === "undefined") return NOOP;
1707
+ if (typeof window === "undefined") return NOOP2;
1665
1708
  const el = typeof target === "string" ? document.querySelector(target) : target;
1666
1709
  if (!el) {
1667
1710
  warn("scrollParallax: element not found:", target);
1668
- return NOOP;
1711
+ return NOOP2;
1669
1712
  }
1670
1713
  const { speed = 0.3, axis = "y", easing = "linear", trigger, onProgress } = options;
1671
1714
  const travel = -speed * 100;
@@ -1688,7 +1731,7 @@ var SvgScrollDraw = (() => {
1688
1731
  }
1689
1732
 
1690
1733
  // src/counter/index.ts
1691
- var NOOP2 = {
1734
+ var NOOP3 = {
1692
1735
  destroy: () => {
1693
1736
  },
1694
1737
  replay: () => {
@@ -1702,13 +1745,15 @@ var SvgScrollDraw = (() => {
1702
1745
  getProgress: () => 0
1703
1746
  };
1704
1747
  function scrollCounter(target, options) {
1705
- if (typeof window === "undefined") return NOOP2;
1748
+ if (typeof window === "undefined") return NOOP3;
1706
1749
  const raw = typeof target === "string" ? document.querySelector(target) : target;
1707
1750
  if (!raw) {
1708
1751
  warn("scrollCounter: element not found:", target);
1709
- return NOOP2;
1752
+ return NOOP3;
1710
1753
  }
1711
- const el = raw;
1754
+ return finishWhenReduced(options, (opts, reduced) => buildCounter(raw, opts, reduced));
1755
+ }
1756
+ function buildCounter(el, options, prefersReduced) {
1712
1757
  const {
1713
1758
  from = 0,
1714
1759
  to,
@@ -1723,11 +1768,10 @@ var SvgScrollDraw = (() => {
1723
1768
  const easeFn = typeof easing === "function" ? easing : EASINGS[easing] ?? EASINGS["ease-out"];
1724
1769
  const startConfig = parseTrigger(trigger.start ?? "top 80%");
1725
1770
  const endConfig = parseTrigger(trigger.end ?? "top 20%");
1726
- const prefersReduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
1727
1771
  if (prefersReduced) {
1728
1772
  el.textContent = fmt(to);
1729
1773
  onComplete?.();
1730
- return NOOP2;
1774
+ return { ...NOOP3, getProgress: () => 1 };
1731
1775
  }
1732
1776
  let tStart = 0;
1733
1777
  let tEnd = 0;
@@ -1994,8 +2038,18 @@ var SvgScrollDraw = (() => {
1994
2038
  return { tStart, tEnd: tStart + Math.max(0, mount.offsetHeight - window.innerHeight) };
1995
2039
  }
1996
2040
  });
2041
+ const unwatchMotion = watchReducedMotion((reduced) => {
2042
+ if (!reduced) return;
2043
+ unwatchMotion();
2044
+ stop();
2045
+ observer2.disconnect();
2046
+ _unregister(mount);
2047
+ progress = 1;
2048
+ apply(1);
2049
+ });
1997
2050
  return {
1998
2051
  destroy() {
2052
+ unwatchMotion();
1999
2053
  stop();
2000
2054
  observer2.disconnect();
2001
2055
  _unregister(mount);
@@ -1,3 +1,3 @@
1
- "use strict";var SvgScrollDraw=(()=>{var ht=Object.defineProperty;var ar=Object.getOwnPropertyDescriptor;var lr=Object.getOwnPropertyNames;var cr=Object.prototype.hasOwnProperty;var ur=(e,t)=>{for(var r in t)ht(e,r,{get:t[r],enumerable:!0})},mr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of lr(t))!cr.call(e,s)&&s!==r&&ht(e,s,{get:()=>t[s],enumerable:!(n=ar(t,s))||n.enumerable});return e};var fr=e=>mr(ht({},"__esModule",{value:!0}),e);var Dr={};ur(Dr,{Cinematic:()=>ut,PRESETS:()=>nt,createBounce:()=>bt,createElastic:()=>wt,createSpring:()=>Ot,scrollAnimate:()=>Zt,scrollCounter:()=>Kt,scrollDraw:()=>Yt,scrollParallax:()=>Jt});function Ot({tension:e=2.5,friction:t=2.2}={}){return r=>1-Math.cos(r*Math.PI*e)*Math.pow(1-r,t)}function bt({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),s=Math.sqrt(n),i=0,u=[];for(let f=0;f<r;f++){let v=Math.pow(s,f);u.push(v),i+=v}let m=[0],c=0;for(let f=0;f<r;f++)c+=u[f]/i,m.push(c);return f=>{if(f<=0)return 0;if(f>=1)return 1;for(let v=0;v<r;v++)if(f<=m[v+1]){let M=(f-m[v])/(m[v+1]-m[v]);if(v===0)return M*(2-M);let E=1-Math.pow(n,v);return E+(1-E)*(2*M-1)*(2*M-1)}return 1}}function wt({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),s=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var ne={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:bt(),elastic:wt()};function Rt(e,t,r){return Math.min(r,Math.max(t,e))}function Le(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 Ft(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 Nt(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 pe(e,t,r,n){return r===t?0:Rt((e-t)/(r-t)*n,0,1)}function Fe(e,t,r,n,s){let i=Ft(e.top,e.height,t,n.element)-Nt(n.viewport,r),u=Ft(e.top,e.height,t,s.element)-Nt(s.viewport,r);return{tStart:i,tEnd:u}}function rt(e,t,r){let n=e.getBoundingClientRect(),s=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:s,scroll:0}:{top:r==="x"?n.left:n.top,height:s,scroll:r==="x"?window.scrollX:window.scrollY}}function Be(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 Ht(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 Ge(e,t,r){let n=Ht(e),s=Ht(t);return!n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*r)},${Math.round(n[1]+(s[1]-n[1])*r)},${Math.round(n[2]+(s[2]-n[2])*r)})`}var nt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:!1},reveal:{easing:"ease-out",fade:!0,speed:1.2,once:!0},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:!0,speed:.75},spring:{easing:"spring",speed:1.1}};function Q(e,...t){}var pr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",dr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",_t=33;function gr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function yr(e){let t=[];for(let r=0;r<_t;r++){let n=r/(_t-1);t.push(String(Math.round(e(n)*1e5)/1e5))}return`linear(${t.join(",")})`}function ot(e){switch(e){case"linear":return"linear";case"ease-in":return pr;case"ease-out":return dr;case"ease-in-out":return gr()?yr(ne["ease-in-out"]):null;default:return null}}var Vt=Symbol.for("svg-scroll-draw.registry");function zt(){let e=globalThis;return e[Vt]||(e[Vt]=new Map)}function Ce(e,t){zt().set(e,t)}function De(e){zt().delete(e)}var Xe,st=new Set,it=new WeakMap,Qe=new Map,Wt=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function hr(e){let t=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let n=r;n;n=n.previousElementSibling)t.add(n);return t}function je(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return()=>{};let r=()=>t();Xe??(Xe=new ResizeObserver(s=>{let i=!1;for(let{target:u}of s)it.get(u)!==Wt(u)&&(i=!0),it.set(u,"");i&&st.forEach(u=>u())})),st.add(r);let n=hr(e);return[document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{it.has(s)||it.set(s,Wt(s)),Qe.set(s,(Qe.get(s)??0)+1),Xe.observe(s)}),()=>{st.delete(r)&&(n.forEach(s=>{let i=(Qe.get(s)??1)-1;if(i)return void Qe.set(s,i);Qe.delete(s),Xe?.unobserve(s)}),st.size||(Xe?.disconnect(),Xe=void 0))}}var br=0;function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function qt(e,t){let r="";try{r=getComputedStyle(e).getPropertyValue(t).trim()}catch{}return r||(e.getAttribute(t)??"").trim()}var Bt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function vr(e){if(!!1)return;let t=qt(e,"stroke");if(!t||t==="none"){Q("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Bt.has(r)&&!Bt.has(qt(e,"fill"))&&Q("Element has a fill \u2014 it may obscure the stroke animation.",e)}function Er(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 s(){let i=r==="x"?window.scrollX:window.scrollY,u=e-i,m=t-i,c=r==="x";n.innerHTML=`
2
- <div style="position:absolute;${c?`left:${u}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${u}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",s,{passive:!0}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove()}}}var Gt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,jt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Sr(e,t,r){if(!!1)return;let n=(e.match(jt)??[]).join("").toUpperCase(),s=(t.match(jt)??[]).join("").toUpperCase(),i=(e.match(Gt)??[]).length,u=(t.match(Gt)??[]).length;if(n!==s){Q(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}i!==u&&Q(`morphTo: coordinate count differs (${i} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r)}function vt(e,t,r){let n=(t.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let u=parseFloat(i),m=n[s++]??u;return String(+(u+(m-u)*r).toFixed(4))})}function at(e,t={}){if(typeof window>"u")return{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...n}=t,s=r?{...nt[r],...n}:n,i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:u="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=!1,easing:f="linear",trigger:v={},stagger:M=0,direction:E="forward",once:oe=!1,debug:Te=!1,axis:S="y",scrollContainer:P,autoReverse:d=!1,delay:x=0,strokeColor:T,strokeWidth:I,fillOpacity:Z,waypoints:q,velocityScale:se=!1,threshold:le=0,rootMargin:G="0px",repeat:O=0,repeatDelay:Ne=0,morphTo:j,clip:ye,autoplay:Ae=!1,duration:He=1e3,native:_e=!0,onProgress:de,onStart:J,onComplete:p,onEnter:R,onLeave:Ve,onEnterBack:Ee,onLeaveBack:Me}=s,ie=ye===!0?"left":typeof ye=="string"?ye:!1,he=typeof f=="function"?f:ne[f]??ne.linear,Se=Le(v.start??"top bottom"),ze=Le(v.end??"bottom top"),ce=typeof P=="string"?document.querySelector(P):P??null,ge=Array.isArray(T)?T[0]:null,K=Array.isArray(T)?T[1]:typeof T=="string"?T:null,_=Array.isArray(I)?I[0]:null,Y=Array.isArray(I)?I[1]:typeof I=="number"?I:null,U=Array.isArray(Z)?Z[0]:null,V=Array.isArray(Z)?Z[1]:typeof Z=="number"?Z:null;function Pe(o){let a=o*100;switch(ie){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 L=ie?[]:Array.from(e.querySelectorAll(u)),$=[],ee=[],B=0,ue=0,l=M,h=0,C=!1,F=!1,A=0,te=!1,ae=-1,$e=[],X=-1,N=!1,me=0,ke=0,Ie,mt=null;function At(){mt?.destroy(),mt=null}let Oe=new Set,Mt=NaN,Re=!0,Ze=-1,Pt=performance.now(),We=NaN;function Ye(){return ce?S==="x"?ce.scrollLeft:ce.scrollTop:S==="x"?window.scrollX:window.scrollY}function $t(){return ce?S==="x"?ce.clientWidth:ce.clientHeight:S==="x"?window.innerWidth:window.innerHeight}function kt(){let o=rt(e,ce,S);return Fe(o,o.scroll,$t(),Se,ze)}function tr(){let o=ue-B,a=L.length-1,y=ce??document.documentElement,z=S==="x"?"Width":"Height";if(l=M,M>0&&a>0&&o>0){let be=y[`scroll${z}`]-y[`client${z}`]-1-B-o/m;be>=0&&(l=Math.min(M,be/(a*o)))}h=ue+a*l*o}function Lt(){({tStart:B,tEnd:ue}=kt()),tr(),Te&&!1&&(At(),mt=Er(B,ue,S))}function ft(o,a=kt){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let y=o.destroy;return o.destroy=()=>{y.call(o),De(e)},o}function rr(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ie){let y=a==="reverse"?1-o:o;e.style.clipPath=Pe(y);return}L.forEach((y,z)=>{y.style.strokeDashoffset=a==="reverse"?`${$[z]*o}`:`${$[z]*(1-o)}`,c&&(y.style.opacity=a==="reverse"?`${1-o}`:`${o}`),ge&&K?y.style.stroke=Ge(ge,K,o):K&&(y.style.stroke=K),_!==null&&Y!==null?y.style.strokeWidth=`${_+(Y-_)*o}`:Y!==null&&(y.style.strokeWidth=`${Y}`),U!==null&&V!==null?y.style.fillOpacity=`${U+(V-U)*o}`:V!==null&&(y.style.fillOpacity=`${V}`),j&&y.tagName.toLowerCase()==="path"&&ee[z]&&y.setAttribute("d",vt(ee[z],j,o))})}function Je(){if(e.style.setProperty("--scroll-draw-progress","0"),ie){e.style.clipPath=Pe(0);return}L.forEach((o,a)=>{o.style.strokeDasharray=`${$[a]}`,o.style.strokeDashoffset=E==="reverse"?"0":`${$[a]}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),_!==null&&(o.style.strokeWidth=`${_}`),U!==null&&(o.style.fillOpacity=`${U}`),j&&o.tagName.toLowerCase()==="path"&&ee[a]&&o.setAttribute("d",ee[a])})}if(L.forEach(o=>{vr(o);let a=Be(o);$.push(a);let y=o.tagName.toLowerCase()==="path";y?ee.push(o.getAttribute("d")??""):ee.push(""),j&&(y?Sr(ee[ee.length-1],j,o):Q(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),i?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=E==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),K&&(o.style.stroke=K),Y!==null&&(o.style.strokeWidth=`${Y}`),V!==null&&(o.style.fillOpacity=`${V}`),j&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",j)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=E==="reverse"?"0":`${a}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),_!==null&&(o.style.strokeWidth=`${_}`),U!==null&&(o.style.fillOpacity=`${U}`))}),ie){if(i)return e.style.clipPath=Pe(1),p?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Pe(0)}else if(i)return p?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ct=typeof f=="string"?ot(f):null;function nr(){return!(_e===!1||!wr()||!L.length||!Ct||ie||S!=="y"||ce||m!==1||M!==0||oe||d||se!==!1||j||q||O||x>0||de||J||p||R||Ve||Ee||Me||T!=null||I!=null||Z!=null||(v.start??"top bottom").trim()!=="top bottom"||(v.end??"bottom top").trim()!=="bottom top")}function or(){let o=++br,a=`svg-scroll-draw-${o}`,y=`svg-scroll-draw-host-${o}`,z=`--svg-scroll-draw-${o}`,be=E==="reverse"?"0":"var(--ssd-len)",xe=E==="reverse"?"var(--ssd-len)":"0",ve=`stroke-dashoffset:${be};`,w=`stroke-dashoffset:${xe};`;c&&(ve+=`opacity:${E==="reverse"?1:0};`,w+=`opacity:${E==="reverse"?0:1};`);let k=document.createElement("style");k.setAttribute("data-svg-scroll-draw",""),k.textContent=`@keyframes ${a}{from{${ve}}to{${w}}}.${y}{view-timeline-name:${z};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${z};animation-range:cover 0% cover 100%;}`,document.head.appendChild(k),e.classList.add(y);function re(g,W){g.style.setProperty("--ssd-len",String($[W])),g.style.strokeDasharray=`${$[W]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(a)}L.forEach(re);let b=!1,D=-1;function H(){if(D>=0)return D;let g=e.getBoundingClientRect(),{tStart:W,tEnd:we}=Fe({top:g.top,height:g.height},Ye(),$t(),Se,ze);return he(pe(Ye(),W,we,m))}return{destroy(){e.classList.remove(y),L.forEach(g=>{g.classList.remove(a),g.style.removeProperty("--ssd-len"),g.style.animationPlayState=""}),k.remove()},replay(){b=!1,D=-1,L.forEach(re)},pause(){b=!0,L.forEach(g=>{g.style.animationPlayState="paused"})},resume(){b&&(b=!1,L.forEach(g=>{g.style.animationPlayState="running"}))},seek(g){let W=Math.min(1,Math.max(0,g));D=W,b=!0,L.forEach((we,fe)=>{we.classList.remove(a),we.style.strokeDashoffset=E==="reverse"?`${$[fe]*W}`:`${$[fe]*(1-W)}`,c&&(we.style.opacity=E==="reverse"?`${1-W}`:`${W}`)})},getProgress(){return H()},refresh(){L.forEach((g,W)=>{$[W]=Be(g),g.style.setProperty("--ssd-len",String($[W])),g.style.strokeDasharray=`${$[W]}`})}}}if(nr())return ft(or());function sr(){let o=Math.max(1,He),a=0,y=0,z=!1;function be(b){let D=!0;if(ie){let H=Math.min(1,Math.max(0,b/o)),g=he(H);me=g,e.style.setProperty("--scroll-draw-progress",String(g)),e.style.clipPath=Pe(E==="reverse"?1-g:g),de?.(g),H<1&&(D=!1)}else L.forEach((H,g)=>{let W=g*M*o,we=Math.min(1,Math.max(0,(b-W)/o)),fe=he(we);H.style.strokeDashoffset=E==="reverse"?`${$[g]*fe}`:`${$[g]*(1-fe)}`,c&&(H.style.opacity=E==="reverse"?`${1-fe}`:`${fe}`),ge&&K?H.style.stroke=Ge(ge,K,fe):K&&(H.style.stroke=K),_!==null&&Y!==null?H.style.strokeWidth=`${_+(Y-_)*fe}`:Y!==null&&(H.style.strokeWidth=`${Y}`),U!==null&&V!==null?H.style.fillOpacity=`${U+(V-U)*fe}`:V!==null&&(H.style.fillOpacity=`${V}`),j&&H.tagName.toLowerCase()==="path"&&ee[g]&&H.setAttribute("d",vt(ee[g],j,fe)),g===0&&(me=fe,de?.(fe),e.style.setProperty("--scroll-draw-progress",String(fe))),we<1&&(D=!1)});if(q){let H=Math.min(1,Math.max(0,b/o)),g=he(H);for(let W in q){let we=parseFloat(W);g>=we&&!Oe.has(we)&&(Oe.add(we),q[W]?.())}}return D}function xe(b){if(N)return;let D=b-a;F||(F=!0,J?.());let H=be(D);if(H&&!C){C=!0,be(o*(1+Math.max(0,L.length-1)*M)),p?.(),ke<(O==="infinite"?1/0:O??0)&&(ke++,Ie=setTimeout(()=>{a=performance.now(),F=!1,C=!1,Oe.clear(),Je(),A=requestAnimationFrame(xe)},Ne));return}H||(A=requestAnimationFrame(xe))}function ve(){cancelAnimationFrame(A),clearTimeout(Ie),a=performance.now(),y=0,N=!1,F=!1,C=!1,ke=0,z=!0,me=0,Oe.clear(),Je(),A=requestAnimationFrame(xe)}let w=new IntersectionObserver(b=>{b.forEach(D=>{D.isIntersecting&&!(oe&&C)?ve():!D.isIntersecting&&!oe&&!C&&(cancelAnimationFrame(A),clearTimeout(Ie),z=!1)})},{root:ce??null,threshold:le,rootMargin:G}),k;function re(){clearTimeout(k),k=setTimeout(()=>{L.forEach((b,D)=>{$[D]=Be(b),b.style.strokeDasharray=`${$[D]}`})},150)}return window.addEventListener("resize",re),window.addEventListener("orientationchange",re),x>0?setTimeout(()=>w.observe(e),x):w.observe(e),{destroy(){cancelAnimationFrame(A),clearTimeout(Ie),w.disconnect(),window.removeEventListener("resize",re),window.removeEventListener("orientationchange",re),clearTimeout(k)},replay(){ke=0,ve()},pause(){N||!z||(N=!0,y=performance.now()-a,cancelAnimationFrame(A))},resume(){N&&(N=!1,z=!0,a=performance.now()-y,A=requestAnimationFrame(xe))},seek(b){let D=Math.min(1,Math.max(0,b));me=D,N=!0,y=D*o,a=performance.now()-y,cancelAnimationFrame(A),be(y)},getProgress(){return me},refresh(){clearTimeout(k),L.forEach((b,D)=>{$[D]=Be(b),b.style.strokeDasharray=`${$[D]}`})}}}if(Ae)return ft(sr());Lt();function Dt(){if(N||!qe)return;let o=performance.now(),a=Ye();if(!Re&&se===!1&&a===Mt){dt(a);return}Re=!1,Mt=a;let y=m;if(se!==!1){let w=o-Pt,k=w>0?Math.abs(a-(Ze<0?a:Ze))/w:0;y=m*Math.max(.2,1+k*(typeof se=="number"?se:1)*.04)}Ze=a,Pt=o;let z=d?X===-1||a>=X?"forward":"reverse":E;X=a;let be=ue-B,xe=!0,ve=be===0?0:(a-B)/be;if(isNaN(We)||(We<=0&&ve>0?R?.():We>0&&ve<=0&&Me?.(),We<1&&ve>=1?Ve?.():We>=1&&ve<1&&Ee?.()),We=ve,ie){let w=he(pe(a,B,ue,y));oe&&!d&&(ae=Math.max(ae,w),w=ae),me=w,e.style.setProperty("--scroll-draw-progress",String(w));let k=z==="reverse"?1-w:w;e.style.clipPath=Pe(k),de?.(w),!F&&pe(a,B,ue,y)>0&&(F=!0,J?.()),w>=1&&!C?(C=!0,p?.(),ke<(O==="infinite"?1/0:O??0)&&(ke++,Ie=setTimeout(()=>{ae=-1,F=!1,C=!1,e.style.clipPath=Pe(0)},Ne))):w<1&&!oe&&(C=!1),dt(a);return}if(L.forEach((w,k)=>{let re=k*l*be,b=he(pe(a,B+re,ue+re,y));oe&&!d&&(b=$e[k]=Math.max($e[k]??ae,b)),w.style.strokeDashoffset=z==="reverse"?`${$[k]*b}`:`${$[k]*(1-b)}`,c&&(w.style.opacity=z==="reverse"?`${1-b}`:`${b}`),ge&&K?w.style.stroke=Ge(ge,K,b):K&&(w.style.stroke=K),_!==null&&Y!==null?w.style.strokeWidth=`${_+(Y-_)*b}`:Y!==null&&(w.style.strokeWidth=`${Y}`),U!==null&&V!==null?w.style.fillOpacity=`${U+(V-U)*b}`:V!==null&&(w.style.fillOpacity=`${V}`),j&&w.tagName.toLowerCase()==="path"&&ee[k]&&w.setAttribute("d",vt(ee[k],j,b)),k===0&&(me=b,de?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(xe=!1)}),q){let w=he(pe(a,B,ue,y));for(let k in q){let re=parseFloat(k);w>=re&&!Oe.has(re)&&(Oe.add(re),q[k]?.())}}!F&&pe(a,B,ue,y)>0&&(F=!0,J?.()),xe&&!C?(C=!0,p?.(),ke<(O==="infinite"?1/0:O??0)&&(ke++,Ie=setTimeout(()=>{ae=-1,$e=[],F=!1,C=!1,Oe.clear(),Je(),Re=!0},Ne))):!xe&&!oe&&(C=!1),dt(a)}function pt(o){return o>=ue&&o<h}function dt(o){te||pt(o)?A=requestAnimationFrame(Dt):qe=!1}function gt(){return te||pt(Ye())}let qe=!1;function Ke(){qe||(qe=!0,A=requestAnimationFrame(function(){Dt()}))}function et(){qe=!1,cancelAnimationFrame(A)}let yt=new IntersectionObserver(o=>{o.forEach(a=>{te=a.isIntersecting,te&&!N?(Re=!0,Ke()):qe&&!N&&pt(Ye())||et()})},{root:ce??null,threshold:le,rootMargin:G});function It(){L.forEach((o,a)=>{$[a]=Be(o),o.style.strokeDasharray=`${$[a]}`}),Lt(),Re=!0}let tt;function Ue(){clearTimeout(tt),tt=setTimeout(It,150)}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let ir=je([e],Ue);return x>0?setTimeout(()=>yt.observe(e),x):yt.observe(e),ft({destroy(){cancelAnimationFrame(A),clearTimeout(Ie),et(),yt.disconnect(),ir(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(tt),At()},replay(){ae=-1,$e=[],X=-1,Ze=-1,F=!1,C=!1,ke=0,N=!1,me=0,Oe.clear(),clearTimeout(Ie),Je(),Re=!0,gt()&&Ke()},pause(){N=!0,et()},resume(){N&&(N=!1,Re=!0,gt()&&Ke())},seek(o){let a=Math.min(1,Math.max(0,o));me=a,ae=a,$e=[],N=!0,et(),rr(a,E),Re=!0},getProgress(){return me},refresh(){clearTimeout(tt),It(),gt()&&!N&&Ke()}},()=>({tStart:B,tEnd:ue}))}function Yt(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):(Q("Container not found:",e),r)}function xr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ut(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let s=[],i=[],u=n[2].trim();if(u)for(let m of u.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(c?parseFloat(c[1]):0),i.push(c?c[2]:"")}t.push({fn:n[1],nums:s,units:i})}return t}function Tr(e,t,r){let n=Ut(e),s=Ut(t);return n.length===0||n.length!==s.length?r<1?e:t:n.map((i,u)=>{let m=s[u];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((c,f)=>`${c}${i.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,f)=>`${c}${m.units[f]}`).join(", ")})`:`${i.fn}(${i.nums.map((c,f)=>`${c+(m.nums[f]-c)*r}${i.units[f]}`).join(", ")})`}).join(" ")}function Xt(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),s=String(t);if(xr(n))return Ge(n,s,r);if(n.includes("("))return Tr(n,s,r);let i=n.match(/^([-+]?[\d.]+)(.*)$/),u=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&u){let m=parseFloat(i[1]),c=parseFloat(u[1]);return`${m+(c-m)*r}${i[2]||u[2]}`}return r<1?n:s}function Ar(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Mr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Pr=0,Qt="--scroll-draw-progress";function $r(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function St(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:s={},easing:i="ease-out",speed:u=1,once:m=!1,axis:c="y",scrollContainer:f,native:v=!0,velocityScale:M=!1,respectReducedMotion:E=!0,triggerElement:oe,onProgress:Te,onComplete:S,onEnter:P,onLeave:d,onEnterBack:x,onLeaveBack:T}=t,I=E&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Z=typeof i=="function"?i:ne[i]??ne["ease-out"],q=Le(s.start??"top bottom"),se=Le(s.end??"bottom top"),le=oe??e,G=typeof f=="string"?document.querySelector(f):f??null,O=Object.entries(n).map(([l,h])=>({prop:Ar(l),from:Array.isArray(h)?h[0]:"",to:Array.isArray(h)?h[1]:h}));function Ne(){let l=window.getComputedStyle(e);for(let h of O)h.from===""&&(h.from=l.getPropertyValue(h.prop).trim()||"0")}function j(){for(let l of O)e.style.setProperty(l.prop,String(l.to))}let ye=new Map;for(let l of[...O.map(h=>h.prop),Qt])ye.set(l,e.style.getPropertyValue(l));function Ae(){for(let[l,h]of ye)h?e.style.setProperty(l,h):e.style.removeProperty(l)}if(I)return j(),S?.(),{...r,destroy:Ae,getProgress:()=>1};Ne();let He=typeof i=="string"?ot(i):null;function _e(){if(!v||!$r()||!He||c!=="y"||G||le!==e||m||u!==1||Te||S||P||d||x||T||M!==!1||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return!1;for(let l of O)if(!Mr.has(l.prop))return!1;return!0}function de(){let l=`ssd-a-${++Pr}`,h=O.map(X=>`${X.prop}:${X.from}`).join(";"),C=O.map(X=>`${X.prop}:${X.to}`).join(";"),F=document.createElement("style");F.setAttribute("data-ssd-animate",""),F.textContent=`@keyframes ${l}{from{${h}}to{${C}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${He};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(l);let A=()=>c==="x"?window.scrollX:window.scrollY,te=()=>c==="x"?window.innerWidth:window.innerHeight,ae=()=>{let X=e.getBoundingClientRect();return Fe({top:X.top,height:X.height},A(),te(),q,se)};Ce(e,{type:"animate",getProgress:()=>$e.getProgress(),getTrigger:ae});let $e={refresh(){},destroy(){e.classList.remove(l),F.remove(),e.style.animationPlayState="",Ae(),De(e)},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l)},pause(){e.style.animationPlayState="paused"},resume(){e.style.animationPlayState=""},seek(X){let N=Math.min(1,Math.max(0,X));e.classList.remove(l);for(let me of O)e.style.setProperty(me.prop,Xt(me.from,me.to,N))},getProgress(){let{tStart:X,tEnd:N}=ae();return Z(pe(A(),X,N,u))}};return $e}if(_e())return de();let J=0,p=0,R=0,Ve=!1,Ee=!1,Me=-1,ie=0,he=!1,Se=NaN,ze=-1,ce=0,ge=()=>G?c==="x"?G.scrollLeft:G.scrollTop:c==="x"?window.scrollX:window.scrollY,K=()=>G?c==="x"?G.clientWidth:G.clientHeight:c==="x"?window.innerWidth:window.innerHeight,_=le===e?O:[],Y=!1;function U(){let l=e.style,h=_.map(te=>l.getPropertyValue(te.prop)),C=l.transition;_.length&&(l.transition="none"),_.forEach(te=>l.setProperty(te.prop,ye.get(te.prop)??""));let F=rt(le,G,c);_.forEach((te,ae)=>l.setProperty(te.prop,h[ae])),_.length&&(e.offsetWidth,l.transition=C);let A=Fe(F,F.scroll,K(),q,se);Y&&Math.abs(A.tStart-J)<1&&Math.abs(A.tEnd-p)<1||(Y=!0,J=A.tStart,p=A.tEnd)}function V(l){e.style.setProperty(Qt,String(l));for(let h of O)e.style.setProperty(h.prop,Xt(h.from,h.to,l));Te?.(l)}function Pe(l){if(isNaN(Se)){Se=l;return}Se<=0&&l>0?P?.():Se>0&&l<=0&&T?.(),Se<1&&l>=1?d?.():Se>=1&&l<1&&x?.(),Se=l}function L(){if(!Ve||Ee)return;let l=performance.now(),h=ge(),C=u;if(M!==!1){let te=l-ce,ae=te>0?Math.abs(h-(ze<0?h:ze))/te:0;C=u*Math.max(.2,1+ae*(typeof M=="number"?M:1)*.04)}ze=h,ce=l;let F=p===J?0:(h-J)/(p-J);Pe(F);let A=Z(pe(h,J,p,C));m&&(Me=Math.max(Me,A),A=Me),ie=A,V(A),A>=1&&!he?(he=!0,S?.()):A<1&&!m&&(he=!1),R=requestAnimationFrame(L)}U(),p===J&&Q("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 l=Z(pe(ge(),J,p,u));m&&l>0&&(Me=l),ie=l,V(l)}let $=new IntersectionObserver(l=>{l.forEach(h=>{Ve=h.isIntersecting,Ve&&!Ee?R=requestAnimationFrame(L):cancelAnimationFrame(R)})},{root:G??null}),ee;function B(){clearTimeout(ee),ee=setTimeout(U,150)}window.addEventListener("resize",B),window.addEventListener("orientationchange",B);let ue=je([le],B);return $.observe(e),Ce(e,{type:"animate",getProgress:()=>ie,getTrigger:()=>({tStart:J,tEnd:p})}),{destroy(){cancelAnimationFrame(R),$.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),ue(),clearTimeout(ee),Ae(),De(e)},replay(){Me=-1,he=!1,ie=0,Ee=!1,V(0)},pause(){Ee=!0,cancelAnimationFrame(R)},resume(){Ee&&(Ee=!1,Ve&&(R=requestAnimationFrame(L)))},seek(l){let h=Math.min(1,Math.max(0,l));ie=h,Me=h,Ee=!0,cancelAnimationFrame(R),V(h)},getProgress(){return ie},refresh(){U()}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Zt(e,t){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;return r?St(r,t):(Q("scrollAnimate: element not found:",e),lt)}function Jt(e,t={}){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return Q("scrollParallax: element not found:",e),lt;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:u,onProgress:m}=t,c=-n*100,f=r.style,v=!!r.ownerSVGElement,M=f.getPropertyValue("transform-box");v&&f.setProperty("transform-box","fill-box");let E=St(r,{props:s==="x"?{transform:["translateX(0%)",`translateX(${c}%)`]}:{transform:["translateY(0%)",`translateY(${c}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:i,native:!1,onProgress:m});return v?{...E,destroy(){E.destroy(),f.setProperty("transform-box",M)}}:E}var xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Kt(e,t){if(typeof window>"u")return xt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return Q("scrollCounter: element not found:",e),xt;let n=r,{from:s=0,to:i,format:u,easing:m="ease-out",trigger:c={},once:f=!0,decimals:v,onComplete:M}=t,E=v!==void 0?p=>p.toFixed(v):u??(p=>String(Math.round(p))),oe=typeof m=="function"?m:ne[m]??ne["ease-out"],Te=Le(c.start??"top 80%"),S=Le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.textContent=E(i),M?.(),xt;let d=0,x=0,T=!1,I=0,Z=!1,q=!1,se=-1,le=0,G=!1,O=()=>window.scrollY,Ne=()=>window.innerHeight;function j(){let p=n.getBoundingClientRect(),R=Fe({top:p.top,height:p.height},O(),Ne(),Te,S);T&&Math.abs(R.tStart-d)<1&&Math.abs(R.tEnd-x)<1||(T=!0,d=R.tStart,x=R.tEnd)}function ye(p){n.textContent=E(s+(i-s)*p),n.style.setProperty("--scroll-draw-progress",String(p))}function Ae(){if(!Z||q)return;let p=oe(pe(O(),d,x,1));f&&(se=Math.max(se,p),p=se),le=p,ye(p),p>=1&&!G?(G=!0,M?.()):p<1&&!f&&(G=!1),I=requestAnimationFrame(Ae)}j();{let p=oe(pe(O(),d,x,1));f&&p>0&&(se=p),le=p,ye(p)}let He=new IntersectionObserver(p=>{p.forEach(R=>{Z=R.isIntersecting,Z&&!q?I=requestAnimationFrame(Ae):cancelAnimationFrame(I)})}),_e;function de(){clearTimeout(_e),_e=setTimeout(j,150)}window.addEventListener("resize",de),window.addEventListener("orientationchange",de);let J=je([n],de);return He.observe(n),Ce(n,{type:"counter",getProgress:()=>le,getTrigger:()=>({tStart:d,tEnd:x})}),{destroy(){cancelAnimationFrame(I),He.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),J(),clearTimeout(_e),De(n)},replay(){se=-1,G=!1,le=0,q=!1,ye(0)},pause(){q=!0,cancelAnimationFrame(I)},resume(){q&&(q=!1,Z&&(I=requestAnimationFrame(Ae)))},seek(p){let R=Math.min(1,Math.max(0,p));le=R,se=R,q=!0,cancelAnimationFrame(I),ye(R)},getProgress(){return le}}}var er="http://www.w3.org/2000/svg",kr="cinematic-photo",Tt=e=>e<0?0:e>1?1:e;function ct(e){let t=parseFloat(e);return Number.isFinite(t)?Tt(t/100):0}function Lr(e){return ne[e]??ne.linear}var Cr={destroy:()=>{},getProgress:()=>0},ut=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||Q("Cinematic: wrapper not found:",t.wrapper)}loadStory(t){let r=this.mount;if(typeof window>"u"||!r)return Cr;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 s=[];for(let S of t.scenes){if(S.background){let d=document.createElement("img");d.id=kr,d.src=S.background,d.alt="",d.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(d)}let P=S.animations.filter(d=>d.type==="draw");if(P.length){let d=document.createElementNS(er,"svg");d.setAttribute("viewBox",`0 0 ${t.canvas.width} ${t.canvas.height}`),d.setAttribute("preserveAspectRatio","xMidYMid meet"),d.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(d);for(let x of P){let T=document.createElementNS(er,"path");T.id=x.target.replace(/^#/,""),T.setAttribute("d",x.d),T.setAttribute("fill","none"),T.setAttribute("stroke",x.stroke),T.setAttribute("stroke-width",String(x.strokeWidth)),T.setAttribute("stroke-linecap","round"),T.setAttribute("stroke-linejoin","round");let I=x.length||T.getTotalLength?.()||0;T.style.strokeDasharray=String(I),T.style.strokeDashoffset=String(I),d.appendChild(T),s.push({kind:"draw",el:T,start:ct(x.start),end:ct(x.end),ease:Lr(x.easing),length:I})}}for(let d of S.animations){if(d.type!=="fade")continue;let x=n.querySelector(d.target)??document.querySelector(d.target);x&&(x.style.opacity=String(d.from),s.push({kind:"fade",el:x,start:ct(d.start),end:ct(d.end),ease:ne["ease-in-out"]??ne.linear,from:d.from,to:d.to}))}}let i=0,u=()=>{let S=r.offsetHeight-window.innerHeight;return S<=0?r.getBoundingClientRect().top<=0?1:0:Tt(-r.getBoundingClientRect().top/S)},m=S=>{for(let P of s){let d=P.end-P.start,x=d<=0?S>=P.end?1:0:Tt((S-P.start)/d),T=P.ease(x);P.kind==="draw"?P.el.style.strokeDashoffset=String(P.length*(1-T)):P.el.style.opacity=String(P.from+(P.to-P.from)*T)}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let c=0,f=!1,v=!1,M=()=>{i=u(),m(i),f&&(c=requestAnimationFrame(M))},E=()=>{f||(f=!0,c=requestAnimationFrame(M))},oe=()=>{f=!1,cancelAnimationFrame(c)},Te=new IntersectionObserver(S=>{for(let P of S)v=P.isIntersecting,v?E():oe()},{threshold:0});return Te.observe(n),i=u(),m(i),Ce(r,{type:"draw",getProgress:()=>i,getTrigger:()=>{let S=r.getBoundingClientRect().top+window.scrollY;return{tStart:S,tEnd:S+Math.max(0,r.offsetHeight-window.innerHeight)}}}),{destroy(){oe(),Te.disconnect(),De(r)},getProgress:()=>i}}};if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class t extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key=""}connectedCallback(){this.build()}attributeChangedCallback(){this.instance&&this.build()}build(){let s=JSON.stringify(e.map(M=>this.getAttribute(M)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},u=this.getAttribute("speed"),m=this.getAttribute("easing"),c=this.getAttribute("stagger"),f=this.getAttribute("direction"),v=this.getAttribute("selector");u&&(i.speed=parseFloat(u)),m&&(i.easing=m),c&&(i.stagger=parseFloat(c)),f&&(i.direction=f),v&&(i.selector=v),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=at(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}t.observedAttributes=e,customElements.define("scroll-draw",t)}return fr(Dr);})();
1
+ "use strict";var SvgScrollDraw=(()=>{var wt=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var pr=Object.prototype.hasOwnProperty;var dr=(e,r)=>{for(var t in r)wt(e,t,{get:r[t],enumerable:!0})},gr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of fr(r))!pr.call(e,s)&&s!==t&&wt(e,s,{get:()=>r[s],enumerable:!(n=mr(r,s))||n.enumerable});return e};var yr=e=>gr(wt({},"__esModule",{value:!0}),e);var Hr={};dr(Hr,{Cinematic:()=>ft,PRESETS:()=>ot,createBounce:()=>vt,createElastic:()=>Et,createSpring:()=>Ft,scrollAnimate:()=>tr,scrollCounter:()=>nr,scrollDraw:()=>Ut,scrollParallax:()=>rr});function Ft({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function vt({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,c=[];for(let p=0;p<t;p++){let S=Math.pow(s,p);c.push(S),i+=S}let f=[0],u=0;for(let p=0;p<t;p++)u+=c[p]/i,f.push(u);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let S=0;S<t;S++)if(p<=f[S+1]){let P=(p-f[S])/(f[S+1]-f[S]);if(S===0)return P*(2-P);let x=1-Math.pow(n,S);return x+(1-x)*(2*P-1)*(2*P-1)}return 1}}function Et({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var te={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:Et()};function Nt(e,r,t){return Math.min(t,Math.max(r,e))}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 Ht(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 _t(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 se(e,r,t,n){return t===r?0:Nt((e-r)/(t-r)*n,0,1)}function Fe(e,r,t,n,s){let i=Ht(e.top,e.height,r,n.element)-_t(n.viewport,t),c=Ht(e.top,e.height,r,s.element)-_t(s.viewport,t);return{tStart:i,tEnd:c}}function nt(e,r,t){let n=e.getBoundingClientRect(),s=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:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function We(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 Vt(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 qe(e,r,t){let n=Vt(e),s=Vt(r);return!n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var ot={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:!1},reveal:{easing:"ease-out",fade:!0,speed:1.2,once:!0},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:!0,speed:.75},spring:{easing:"spring",speed:1.1}};function Y(e,...r){}var hr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",br="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",zt=33;function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function vr(e){let r=[];for(let t=0;t<zt;t++){let n=t/(zt-1);r.push(String(Math.round(e(n)*1e5)/1e5))}return`linear(${r.join(",")})`}function st(e){switch(e){case"linear":return"linear";case"ease-in":return hr;case"ease-out":return br;case"ease-in-out":return wr()?vr(te["ease-in-out"]):null;default:return null}}var Wt=Symbol.for("svg-scroll-draw.registry");function qt(){let e=globalThis;return e[Wt]||(e[Wt]=new Map)}function ke(e,r){qt().set(e,r)}function Se(e){qt().delete(e)}var Xe,it=new Set,at=new WeakMap,Ze=new Map,Bt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function Er(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function Be(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return()=>{};let t=()=>r();Xe??(Xe=new ResizeObserver(s=>{let i=!1;for(let{target:c}of s)at.get(c)!==Bt(c)&&(i=!0),at.set(c,"");i&&it.forEach(c=>c())})),it.add(t);let n=Er(e);return[document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{at.has(s)||at.set(s,Bt(s)),Ze.set(s,(Ze.get(s)??0)+1),Xe.observe(s)}),()=>{it.delete(t)&&(n.forEach(s=>{let i=(Ze.get(s)??1)-1;if(i)return void Ze.set(s,i);Ze.delete(s),Xe?.unobserve(s)}),it.size||(Xe?.disconnect(),Xe=void 0))}}function lt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function Ge(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,!0);let t=r(e,!1),n=lt(i=>{if(!i)return;n();let c=(t.getProgress?.()??0)>=1;t.destroy(),t=r(c?{...e,onComplete:void 0}:e,!0)}),s={};for(let i of Object.keys(t))s[i]=(...c)=>t[i]?.(...c);return s.destroy=()=>{n(),t.destroy()},s}var Sr=0;function xr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Gt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim()}catch{}return t||(e.getAttribute(r)??"").trim()}var jt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Tr(e){if(!!1)return;let r=Gt(e,"stroke");if(!r||r==="none"){Y("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!jt.has(t)&&!jt.has(Gt(e,"fill"))&&Y("Element has a fill \u2014 it may obscure the stroke animation.",e)}function Ar(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 s(){let i=t==="x"?window.scrollX:window.scrollY,c=e-i,f=r-i,u=t==="x";n.innerHTML=`
2
+ <div style="position:absolute;${u?`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;${u?`left:${f}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${f}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",s,{passive:!0}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove()}}}var Qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Yt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Mr(e,r,t){if(!!1)return;let n=(e.match(Yt)??[]).join("").toUpperCase(),s=(r.match(Yt)??[]).join("").toUpperCase(),i=(e.match(Qt)??[]).length,c=(r.match(Qt)??[]).length;if(n!==s){Y(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==c&&Y(`morphTo: coordinate count differs (${i} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t)}function St(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let c=parseFloat(i),f=n[s++]??c;return String(+(c+(f-c)*t).toFixed(4))})}function ct(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(r,(t,n)=>Lr(e,t,n))}function Lr(e,r,t){let{preset:n,...s}=r,i=n?{...ot[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:f=1,fade:u=!1,easing:p="linear",trigger:S={},stagger:P=0,direction:x="forward",once:U=!1,debug:pe=!1,axis:F="y",scrollContainer:T,autoReverse:M=!1,delay:d=0,strokeColor:E,strokeWidth:w,fillOpacity:I,waypoints:z,velocityScale:N=!1,threshold:X=0,rootMargin:_e="0px",repeat:le=0,repeatDelay:ce=0,morphTo:H,clip:xe,autoplay:Ne=!1,duration:Te=1e3,native:ie=!0,onProgress:g,onStart:k,onComplete:de,onEnter:be,onLeave:Ae,onEnterBack:Me,onLeaveBack:He}=i,Z=xe===!0?"left":typeof xe=="string"?xe:!1,ge=typeof p=="function"?p:te[p]??te.linear,je=$e(S.start??"top bottom"),Qe=$e(S.end??"bottom top"),ae=typeof T=="string"?document.querySelector(T):T??null,J=Array.isArray(E)?E[0]:null,j=Array.isArray(E)?E[1]:typeof E=="string"?E:null,Q=Array.isArray(w)?w[0]:null,W=Array.isArray(w)?w[1]:typeof w=="number"?w:null,re=Array.isArray(I)?I[0]:null,G=Array.isArray(I)?I[1]:typeof I=="number"?I:null;function we(o){let l=o*100;switch(Z){case"right":return`inset(0 0 0 ${100-l}%)`;case"top":return`inset(0 0 ${100-l}% 0)`;case"bottom":return`inset(${100-l}% 0 0 0)`;case"center":return`circle(${o*150}% at 50% 50%)`;default:return`inset(0 ${100-l}% 0 0)`}}let D=Z?[]:Array.from(e.querySelectorAll(c)),L=[],ne=[],a=0,m=0,ye=P,ue=0,A=!1,C=!1,_=0,Ce=!1,R=-1,Le=[],De=-1,K=!1,ve=0,Pe=0,Oe,pt=null;function Lt(){pt?.destroy(),pt=null}let Ie=new Set,Pt=NaN,Re=!0,Je=-1,$t=performance.now(),Ve=NaN;function Ye(){return ae?F==="x"?ae.scrollLeft:ae.scrollTop:F==="x"?window.scrollX:window.scrollY}function kt(){return ae?F==="x"?ae.clientWidth:ae.clientHeight:F==="x"?window.innerWidth:window.innerHeight}function Ct(){let o=nt(e,ae,F);return Fe(o,o.scroll,kt(),je,Qe)}function sr(){let o=m-a,l=D.length-1,h=ae??document.documentElement,q=F==="x"?"Width":"Height";if(ye=P,P>0&&l>0&&o>0){let me=h[`scroll${q}`]-h[`client${q}`]-1-a-o/f;me>=0&&(ye=Math.min(P,me/(l*o)))}ue=m+l*ye*o}function Dt(){({tStart:a,tEnd:m}=Ct()),sr(),pe&&!1&&(Lt(),pt=Ar(a,m,F))}function dt(o,l=Ct){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let h=o.destroy;return o.destroy=()=>{h.call(o),Se(e)},o}function ir(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let h=l==="reverse"?1-o:o;e.style.clipPath=we(h);return}D.forEach((h,q)=>{h.style.strokeDashoffset=l==="reverse"?`${L[q]*o}`:`${L[q]*(1-o)}`,u&&(h.style.opacity=l==="reverse"?`${1-o}`:`${o}`),J&&j?h.style.stroke=qe(J,j,o):j&&(h.style.stroke=j),Q!==null&&W!==null?h.style.strokeWidth=`${Q+(W-Q)*o}`:W!==null&&(h.style.strokeWidth=`${W}`),re!==null&&G!==null?h.style.fillOpacity=`${re+(G-re)*o}`:G!==null&&(h.style.fillOpacity=`${G}`),H&&h.tagName.toLowerCase()==="path"&&ne[q]&&h.setAttribute("d",St(ne[q],H,o))})}function Ke(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=we(0);return}D.forEach((o,l)=>{o.style.strokeDasharray=`${L[l]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${L[l]}`,u?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",J&&(o.style.stroke=J),Q!==null&&(o.style.strokeWidth=`${Q}`),re!==null&&(o.style.fillOpacity=`${re}`),H&&o.tagName.toLowerCase()==="path"&&ne[l]&&o.setAttribute("d",ne[l])})}if(D.forEach(o=>{Tr(o);let l=We(o);L.push(l);let h=o.tagName.toLowerCase()==="path";h?ne.push(o.getAttribute("d")??""):ne.push(""),H&&(h?Mr(ne[ne.length-1],H,o):Y(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=x==="reverse"?`${l}`:"0",u&&(o.style.opacity="1"),j&&(o.style.stroke=j),W!==null&&(o.style.strokeWidth=`${W}`),G!==null&&(o.style.fillOpacity=`${G}`),H&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",H)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=x==="reverse"?"0":`${l}`,u?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",J&&(o.style.stroke=J),Q!==null&&(o.style.strokeWidth=`${Q}`),re!==null&&(o.style.fillOpacity=`${re}`))}),Z){if(t)return e.style.clipPath=we(1),de?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=we(0)}else if(t)return de?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ot=typeof p=="string"?st(p):null;function ar(){return!(ie===!1||!xr()||!D.length||!Ot||Z||F!=="y"||ae||f!==1||P!==0||U||M||N!==!1||H||z||le||d>0||g||k||de||be||Ae||Me||He||E!=null||w!=null||I!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function lr(){let o=++Sr,l=`svg-scroll-draw-${o}`,h=`svg-scroll-draw-host-${o}`,q=`--svg-scroll-draw-${o}`,me=x==="reverse"?"0":"var(--ssd-len)",Ee=x==="reverse"?"var(--ssd-len)":"0",he=`stroke-dashoffset:${me};`,v=`stroke-dashoffset:${Ee};`;u&&(he+=`opacity:${x==="reverse"?1:0};`,v+=`opacity:${x==="reverse"?0:1};`);let $=document.createElement("style");$.setAttribute("data-svg-scroll-draw",""),$.textContent=`@keyframes ${l}{from{${he}}to{${v}}}.${h}{view-timeline-name:${q};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ot};animation-fill-mode:both;animation-timeline:${q};animation-range:cover 0% cover 100%;}`,document.head.appendChild($),e.classList.add(h);function ee(y,B){y.style.setProperty("--ssd-len",String(L[B])),y.style.strokeDasharray=`${L[B]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l)}D.forEach(ee);let b=!1,O=-1;function V(){if(O>=0)return O;let y=e.getBoundingClientRect(),{tStart:B,tEnd:fe}=Fe({top:y.top,height:y.height},Ye(),kt(),je,Qe);return ge(se(Ye(),B,fe,f))}return{destroy(){e.classList.remove(h),D.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState=""}),$.remove()},replay(){b=!1,O=-1,D.forEach(ee)},pause(){b=!0,D.forEach(y=>{y.style.animationPlayState="paused"})},resume(){b&&(b=!1,D.forEach(y=>{y.style.animationPlayState="running"}))},seek(y){let B=Math.min(1,Math.max(0,y));O=B,b=!0,D.forEach((fe,oe)=>{fe.classList.remove(l),fe.style.strokeDashoffset=x==="reverse"?`${L[oe]*B}`:`${L[oe]*(1-B)}`,u&&(fe.style.opacity=x==="reverse"?`${1-B}`:`${B}`)})},getProgress(){return V()},refresh(){D.forEach((y,B)=>{L[B]=We(y),y.style.setProperty("--ssd-len",String(L[B])),y.style.strokeDasharray=`${L[B]}`})}}}if(ar())return dt(lr());function cr(){let o=Math.max(1,Te),l=0,h=0,q=!1;function me(b){let O=!0;if(Z){let V=Math.min(1,Math.max(0,b/o)),y=ge(V);ve=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=we(x==="reverse"?1-y:y),g?.(y),V<1&&(O=!1)}else D.forEach((V,y)=>{let B=y*P*o,fe=Math.min(1,Math.max(0,(b-B)/o)),oe=ge(fe);V.style.strokeDashoffset=x==="reverse"?`${L[y]*oe}`:`${L[y]*(1-oe)}`,u&&(V.style.opacity=x==="reverse"?`${1-oe}`:`${oe}`),J&&j?V.style.stroke=qe(J,j,oe):j&&(V.style.stroke=j),Q!==null&&W!==null?V.style.strokeWidth=`${Q+(W-Q)*oe}`:W!==null&&(V.style.strokeWidth=`${W}`),re!==null&&G!==null?V.style.fillOpacity=`${re+(G-re)*oe}`:G!==null&&(V.style.fillOpacity=`${G}`),H&&V.tagName.toLowerCase()==="path"&&ne[y]&&V.setAttribute("d",St(ne[y],H,oe)),y===0&&(ve=oe,g?.(oe),e.style.setProperty("--scroll-draw-progress",String(oe))),fe<1&&(O=!1)});if(z){let V=Math.min(1,Math.max(0,b/o)),y=ge(V);for(let B in z){let fe=parseFloat(B);y>=fe&&!Ie.has(fe)&&(Ie.add(fe),z[B]?.())}}return O}function Ee(b){if(K)return;let O=b-l;C||(C=!0,k?.());let V=me(O);if(V&&!A){A=!0,me(o*(1+Math.max(0,D.length-1)*P)),de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Oe=setTimeout(()=>{l=performance.now(),C=!1,A=!1,Ie.clear(),Ke(),_=requestAnimationFrame(Ee)},ce));return}V||(_=requestAnimationFrame(Ee))}function he(){cancelAnimationFrame(_),clearTimeout(Oe),l=performance.now(),h=0,K=!1,C=!1,A=!1,Pe=0,q=!0,ve=0,Ie.clear(),Ke(),_=requestAnimationFrame(Ee)}let v=new IntersectionObserver(b=>{b.forEach(O=>{O.isIntersecting&&!(U&&A)?he():!O.isIntersecting&&!U&&!A&&(cancelAnimationFrame(_),clearTimeout(Oe),q=!1)})},{root:ae??null,threshold:X,rootMargin:_e}),$;function ee(){clearTimeout($),$=setTimeout(()=>{D.forEach((b,O)=>{L[O]=We(b),b.style.strokeDasharray=`${L[O]}`})},150)}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),d>0?setTimeout(()=>v.observe(e),d):v.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Oe),v.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout($)},replay(){Pe=0,he()},pause(){K||!q||(K=!0,h=performance.now()-l,cancelAnimationFrame(_))},resume(){K&&(K=!1,q=!0,l=performance.now()-h,_=requestAnimationFrame(Ee))},seek(b){let O=Math.min(1,Math.max(0,b));ve=O,K=!0,h=O*o,l=performance.now()-h,cancelAnimationFrame(_),me(h)},getProgress(){return ve},refresh(){clearTimeout($),D.forEach((b,O)=>{L[O]=We(b),b.style.strokeDasharray=`${L[O]}`})}}}if(Ne)return dt(cr());Dt();function It(){if(K||!ze)return;let o=performance.now(),l=Ye();if(!Re&&N===!1&&l===Pt){yt(l);return}Re=!1,Pt=l;let h=f;if(N!==!1){let v=o-$t,$=v>0?Math.abs(l-(Je<0?l:Je))/v:0;h=f*Math.max(.2,1+$*(typeof N=="number"?N:1)*.04)}Je=l,$t=o;let q=M?De===-1||l>=De?"forward":"reverse":x;De=l;let me=m-a,Ee=!0,he=me===0?0:(l-a)/me;if(isNaN(Ve)||(Ve<=0&&he>0?be?.():Ve>0&&he<=0&&He?.(),Ve<1&&he>=1?Ae?.():Ve>=1&&he<1&&Me?.()),Ve=he,Z){let v=ge(se(l,a,m,h));U&&!M&&(R=Math.max(R,v),v=R),ve=v,e.style.setProperty("--scroll-draw-progress",String(v));let $=q==="reverse"?1-v:v;e.style.clipPath=we($),g?.(v),!C&&se(l,a,m,h)>0&&(C=!0,k?.()),v>=1&&!A?(A=!0,de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Oe=setTimeout(()=>{R=-1,C=!1,A=!1,e.style.clipPath=we(0)},ce))):v<1&&!U&&(A=!1),yt(l);return}if(D.forEach((v,$)=>{let ee=$*ye*me,b=ge(se(l,a+ee,m+ee,h));U&&!M&&(b=Le[$]=Math.max(Le[$]??R,b)),v.style.strokeDashoffset=q==="reverse"?`${L[$]*b}`:`${L[$]*(1-b)}`,u&&(v.style.opacity=q==="reverse"?`${1-b}`:`${b}`),J&&j?v.style.stroke=qe(J,j,b):j&&(v.style.stroke=j),Q!==null&&W!==null?v.style.strokeWidth=`${Q+(W-Q)*b}`:W!==null&&(v.style.strokeWidth=`${W}`),re!==null&&G!==null?v.style.fillOpacity=`${re+(G-re)*b}`:G!==null&&(v.style.fillOpacity=`${G}`),H&&v.tagName.toLowerCase()==="path"&&ne[$]&&v.setAttribute("d",St(ne[$],H,b)),$===0&&(ve=b,g?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Ee=!1)}),z){let v=ge(se(l,a,m,h));for(let $ in z){let ee=parseFloat($);v>=ee&&!Ie.has(ee)&&(Ie.add(ee),z[$]?.())}}!C&&se(l,a,m,h)>0&&(C=!0,k?.()),Ee&&!A?(A=!0,de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Oe=setTimeout(()=>{R=-1,Le=[],C=!1,A=!1,Ie.clear(),Ke(),Re=!0},ce))):!Ee&&!U&&(A=!1),yt(l)}function gt(o){return o>=m&&o<ue}function yt(o){Ce||gt(o)?_=requestAnimationFrame(It):ze=!1}function ht(){return Ce||gt(Ye())}let ze=!1;function et(){ze||(ze=!0,_=requestAnimationFrame(function(){It()}))}function tt(){ze=!1,cancelAnimationFrame(_)}let bt=new IntersectionObserver(o=>{o.forEach(l=>{Ce=l.isIntersecting,Ce&&!K?(Re=!0,et()):ze&&!K&&gt(Ye())||tt()})},{root:ae??null,threshold:X,rootMargin:_e});function Rt(){D.forEach((o,l)=>{L[l]=We(o),o.style.strokeDasharray=`${L[l]}`}),Dt(),Re=!0}let rt;function Ue(){clearTimeout(rt),rt=setTimeout(Rt,150)}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let ur=Be([e],Ue);return d>0?setTimeout(()=>bt.observe(e),d):bt.observe(e),dt({destroy(){cancelAnimationFrame(_),clearTimeout(Oe),tt(),bt.disconnect(),ur(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(rt),Lt()},replay(){R=-1,Le=[],De=-1,Je=-1,C=!1,A=!1,Pe=0,K=!1,ve=0,Ie.clear(),clearTimeout(Oe),Ke(),Re=!0,ht()&&et()},pause(){K=!0,tt()},resume(){K&&(K=!1,Re=!0,ht()&&et())},seek(o){let l=Math.min(1,Math.max(0,o));ve=l,R=l,Le=[],K=!0,tt(),ir(l,x),Re=!0},getProgress(){return ve},refresh(){clearTimeout(rt),Rt(),ht()&&!K&&et()}},()=>({tStart:a,tEnd:m}))}function Ut(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?ct(n,r):(Y("Container not found:",e),t)}function Pr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Xt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],c=n[2].trim();if(c)for(let f of c.split(/[\s,]+/)){let u=f.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"")}r.push({fn:n[1],nums:s,units:i})}return r}function $r(e,r,t){let n=Xt(e),s=Xt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,c)=>{let f=s[c];return i.fn!==f.fn||i.nums.length!==f.nums.length?t<1?`${i.fn}(${i.nums.map((u,p)=>`${u}${i.units[p]}`).join(", ")})`:`${f.fn}(${f.nums.map((u,p)=>`${u}${f.units[p]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,p)=>`${u+(f.nums[p]-u)*t}${i.units[p]}`).join(", ")})`}).join(" ")}function Zt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(Pr(n))return qe(n,s,t);if(n.includes("("))return $r(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&c){let f=parseFloat(i[1]),u=parseFloat(c[1]);return`${f+(u-f)*t}${i[2]||c[2]}`}return t<1?n:s}function kr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Cr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Dr=0,Jt="--scroll-draw-progress";function Or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var er={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Tt(e,r){return typeof window>"u"?er:r.respectReducedMotion===!1?Kt(e,r,!1):Ge(r,(t,n)=>Kt(e,t,n))}function Kt(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:c=1,once:f=!1,axis:u="y",scrollContainer:p,native:S=!0,velocityScale:P=!1,triggerElement:x,onProgress:U,onComplete:pe,onEnter:F,onLeave:T,onEnterBack:M,onLeaveBack:d}=r,E=typeof i=="function"?i:te[i]??te["ease-out"],w=$e(s.start??"top bottom"),I=$e(s.end??"bottom top"),z=x??e,N=typeof p=="string"?document.querySelector(p):p??null,X=Object.entries(n).map(([a,m])=>({prop:kr(a),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function _e(){let a=window.getComputedStyle(e);for(let m of X)m.from===""&&(m.from=a.getPropertyValue(m.prop).trim()||"0")}function le(){for(let a of X)e.style.setProperty(a.prop,String(a.to))}let ce=new Map;for(let a of[...X.map(m=>m.prop),Jt])ce.set(a,e.style.getPropertyValue(a));function H(){for(let[a,m]of ce)m?e.style.setProperty(a,m):e.style.removeProperty(a)}if(t)return le(),pe?.(),{...er,destroy:H,getProgress:()=>1};_e();let xe=typeof i=="string"?st(i):null;function Ne(){if(!S||!Or()||!xe||u!=="y"||N||z!==e||f||c!==1||U||pe||F||T||M||d||P!==!1||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return!1;for(let a of X)if(!Cr.has(a.prop))return!1;return!0}function Te(){let a=`ssd-a-${++Dr}`,m=X.map(R=>`${R.prop}:${R.from}`).join(";"),ye=X.map(R=>`${R.prop}:${R.to}`).join(";"),ue=document.createElement("style");ue.setAttribute("data-ssd-animate",""),ue.textContent=`@keyframes ${a}{from{${m}}to{${ye}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${xe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue),e.classList.add(a);let A=()=>u==="x"?window.scrollX:window.scrollY,C=()=>u==="x"?window.innerWidth:window.innerHeight,_=()=>{let R=e.getBoundingClientRect();return Fe({top:R.top,height:R.height},A(),C(),w,I)};ke(e,{type:"animate",getProgress:()=>Ce.getProgress(),getTrigger:_});let Ce={refresh(){},destroy(){e.classList.remove(a),ue.remove(),e.style.animationPlayState="",H(),Se(e)},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a)},pause(){e.style.animationPlayState="paused"},resume(){e.style.animationPlayState=""},seek(R){let Le=Math.min(1,Math.max(0,R));e.classList.remove(a);for(let De of X)e.style.setProperty(De.prop,Zt(De.from,De.to,Le))},getProgress(){let{tStart:R,tEnd:Le}=_();return E(se(A(),R,Le,c))}};return Ce}if(Ne())return Te();let ie=0,g=0,k=0,de=!1,be=!1,Ae=-1,Me=0,He=!1,Z=NaN,ge=-1,je=0,Qe=()=>N?u==="x"?N.scrollLeft:N.scrollTop:u==="x"?window.scrollX:window.scrollY,ae=()=>N?u==="x"?N.clientWidth:N.clientHeight:u==="x"?window.innerWidth:window.innerHeight,J=z===e?X:[],j=!1;function Q(){let a=e.style,m=J.map(C=>a.getPropertyValue(C.prop)),ye=a.transition;J.length&&(a.transition="none"),J.forEach(C=>a.setProperty(C.prop,ce.get(C.prop)??""));let ue=nt(z,N,u);J.forEach((C,_)=>a.setProperty(C.prop,m[_])),J.length&&(e.offsetWidth,a.transition=ye);let A=Fe(ue,ue.scroll,ae(),w,I);j&&Math.abs(A.tStart-ie)<1&&Math.abs(A.tEnd-g)<1||(j=!0,ie=A.tStart,g=A.tEnd)}function W(a){e.style.setProperty(Jt,String(a));for(let m of X)e.style.setProperty(m.prop,Zt(m.from,m.to,a));U?.(a)}function re(a){if(isNaN(Z)){Z=a;return}Z<=0&&a>0?F?.():Z>0&&a<=0&&d?.(),Z<1&&a>=1?T?.():Z>=1&&a<1&&M?.(),Z=a}function G(){if(!de||be)return;let a=performance.now(),m=Qe(),ye=c;if(P!==!1){let C=a-je,_=C>0?Math.abs(m-(ge<0?m:ge))/C:0;ye=c*Math.max(.2,1+_*(typeof P=="number"?P:1)*.04)}ge=m,je=a;let ue=g===ie?0:(m-ie)/(g-ie);re(ue);let A=E(se(m,ie,g,ye));f&&(Ae=Math.max(Ae,A),A=Ae),Me=A,W(A),A>=1&&!He?(He=!0,pe?.()):A<1&&!f&&(He=!1),k=requestAnimationFrame(G)}Q(),g===ie&&Y("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 a=E(se(Qe(),ie,g,c));f&&a>0&&(Ae=a),Me=a,W(a)}let we=new IntersectionObserver(a=>{a.forEach(m=>{de=m.isIntersecting,de&&!be?k=requestAnimationFrame(G):cancelAnimationFrame(k)})},{root:N??null}),D;function L(){clearTimeout(D),D=setTimeout(Q,150)}window.addEventListener("resize",L),window.addEventListener("orientationchange",L);let ne=Be([z],L);return we.observe(e),ke(e,{type:"animate",getProgress:()=>Me,getTrigger:()=>({tStart:ie,tEnd:g})}),{destroy(){cancelAnimationFrame(k),we.disconnect(),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),ne(),clearTimeout(D),H(),Se(e)},replay(){Ae=-1,He=!1,Me=0,be=!1,W(0)},pause(){be=!0,cancelAnimationFrame(k)},resume(){be&&(be=!1,de&&(k=requestAnimationFrame(G)))},seek(a){let m=Math.min(1,Math.max(0,a));Me=m,Ae=m,be=!0,cancelAnimationFrame(k),W(m)},getProgress(){return Me},refresh(){Q()}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tr(e,r){if(typeof window>"u")return ut;let t=typeof e=="string"?document.querySelector(e):e;return t?Tt(t,r):(Y("scrollAnimate: element not found:",e),ut)}function rr(e,r={}){if(typeof window>"u")return ut;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return Y("scrollParallax: element not found:",e),ut;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:c,onProgress:f}=r,u=-n*100,p=t.style,S=!!t.ownerSVGElement,P=p.getPropertyValue("transform-box");S&&p.setProperty("transform-box","fill-box");let x=Tt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:i,native:!1,onProgress:f});return S?{...x,destroy(){x.destroy(),p.setProperty("transform-box",P)}}:x}var At={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nr(e,r){if(typeof window>"u")return At;let t=typeof e=="string"?document.querySelector(e):e;return t?Ge(r,(n,s)=>Ir(t,n,s)):(Y("scrollCounter: element not found:",e),At)}function Ir(e,r,t){let{from:n=0,to:s,format:i,easing:c="ease-out",trigger:f={},once:u=!0,decimals:p,onComplete:S}=r,P=p!==void 0?g=>g.toFixed(p):i??(g=>String(Math.round(g))),x=typeof c=="function"?c:te[c]??te["ease-out"],U=$e(f.start??"top 80%"),pe=$e(f.end??"top 20%");if(t)return e.textContent=P(s),S?.(),{...At,getProgress:()=>1};let F=0,T=0,M=!1,d=0,E=!1,w=!1,I=-1,z=0,N=!1,X=()=>window.scrollY,_e=()=>window.innerHeight;function le(){let g=e.getBoundingClientRect(),k=Fe({top:g.top,height:g.height},X(),_e(),U,pe);M&&Math.abs(k.tStart-F)<1&&Math.abs(k.tEnd-T)<1||(M=!0,F=k.tStart,T=k.tEnd)}function ce(g){e.textContent=P(n+(s-n)*g),e.style.setProperty("--scroll-draw-progress",String(g))}function H(){if(!E||w)return;let g=x(se(X(),F,T,1));u&&(I=Math.max(I,g),g=I),z=g,ce(g),g>=1&&!N?(N=!0,S?.()):g<1&&!u&&(N=!1),d=requestAnimationFrame(H)}le();{let g=x(se(X(),F,T,1));u&&g>0&&(I=g),z=g,ce(g)}let xe=new IntersectionObserver(g=>{g.forEach(k=>{E=k.isIntersecting,E&&!w?d=requestAnimationFrame(H):cancelAnimationFrame(d)})}),Ne;function Te(){clearTimeout(Ne),Ne=setTimeout(le,150)}window.addEventListener("resize",Te),window.addEventListener("orientationchange",Te);let ie=Be([e],Te);return xe.observe(e),ke(e,{type:"counter",getProgress:()=>z,getTrigger:()=>({tStart:F,tEnd:T})}),{destroy(){cancelAnimationFrame(d),xe.disconnect(),window.removeEventListener("resize",Te),window.removeEventListener("orientationchange",Te),ie(),clearTimeout(Ne),Se(e)},replay(){I=-1,N=!1,z=0,w=!1,ce(0)},pause(){w=!0,cancelAnimationFrame(d)},resume(){w&&(w=!1,E&&(d=requestAnimationFrame(H)))},seek(g){let k=Math.min(1,Math.max(0,g));z=k,I=k,w=!0,cancelAnimationFrame(d),ce(k)},getProgress(){return z}}}var or="http://www.w3.org/2000/svg",Rr="cinematic-photo",Mt=e=>e<0?0:e>1?1:e;function mt(e){let r=parseFloat(e);return Number.isFinite(r)?Mt(r/100):0}function Fr(e){return te[e]??te.linear}var Nr={destroy:()=>{},getProgress:()=>0},ft=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||Y("Cinematic: wrapper not found:",r.wrapper)}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return Nr;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 s=[];for(let T of r.scenes){if(T.background){let d=document.createElement("img");d.id=Rr,d.src=T.background,d.alt="",d.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(d)}let M=T.animations.filter(d=>d.type==="draw");if(M.length){let d=document.createElementNS(or,"svg");d.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),d.setAttribute("preserveAspectRatio","xMidYMid meet"),d.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(d);for(let E of M){let w=document.createElementNS(or,"path");w.id=E.target.replace(/^#/,""),w.setAttribute("d",E.d),w.setAttribute("fill","none"),w.setAttribute("stroke",E.stroke),w.setAttribute("stroke-width",String(E.strokeWidth)),w.setAttribute("stroke-linecap","round"),w.setAttribute("stroke-linejoin","round");let I=E.length||w.getTotalLength?.()||0;w.style.strokeDasharray=String(I),w.style.strokeDashoffset=String(I),d.appendChild(w),s.push({kind:"draw",el:w,start:mt(E.start),end:mt(E.end),ease:Fr(E.easing),length:I})}}for(let d of T.animations){if(d.type!=="fade")continue;let E=n.querySelector(d.target)??document.querySelector(d.target);E&&(E.style.opacity=String(d.from),s.push({kind:"fade",el:E,start:mt(d.start),end:mt(d.end),ease:te["ease-in-out"]??te.linear,from:d.from,to:d.to}))}}let i=0,c=()=>{let T=t.offsetHeight-window.innerHeight;return T<=0?t.getBoundingClientRect().top<=0?1:0:Mt(-t.getBoundingClientRect().top/T)},f=T=>{for(let M of s){let d=M.end-M.start,E=d<=0?T>=M.end?1:0:Mt((T-M.start)/d),w=M.ease(E);M.kind==="draw"?M.el.style.strokeDashoffset=String(M.length*(1-w)):M.el.style.opacity=String(M.from+(M.to-M.from)*w)}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return f(1),{destroy:()=>{},getProgress:()=>1};let u=0,p=!1,S=!1,P=()=>{i=c(),f(i),p&&(u=requestAnimationFrame(P))},x=()=>{p||(p=!0,u=requestAnimationFrame(P))},U=()=>{p=!1,cancelAnimationFrame(u)},pe=new IntersectionObserver(T=>{for(let M of T)S=M.isIntersecting,S?x():U()},{threshold:0});pe.observe(n),i=c(),f(i),ke(t,{type:"draw",getProgress:()=>i,getTrigger:()=>{let T=t.getBoundingClientRect().top+window.scrollY;return{tStart:T,tEnd:T+Math.max(0,t.offsetHeight-window.innerHeight)}}});let F=lt(T=>{T&&(F(),U(),pe.disconnect(),Se(t),i=1,f(1))});return{destroy(){F(),U(),pe.disconnect(),Se(t)},getProgress:()=>i}}};if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class r extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key=""}connectedCallback(){this.build()}attributeChangedCallback(){this.instance&&this.build()}build(){let s=JSON.stringify(e.map(P=>this.getAttribute(P)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},c=this.getAttribute("speed"),f=this.getAttribute("easing"),u=this.getAttribute("stagger"),p=this.getAttribute("direction"),S=this.getAttribute("selector");c&&(i.speed=parseFloat(c)),f&&(i.easing=f),u&&(i.stagger=parseFloat(u)),p&&(i.direction=p),S&&(i.selector=S),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=ct(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}r.observedAttributes=e,customElements.define("scroll-draw",r)}return yr(Hr);})();
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-5PJEKEEP.mjs';function i(n,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(n,true);let e=t(n,false),d=a(o=>{if(!o)return;d();let s=(e.getProgress?.()??0)>=1;e.destroy(),e=t(s?{...n,onComplete:void 0}:n,true);}),r={};for(let o of Object.keys(e))r[o]=(...s)=>e[o]?.(...s);return r.destroy=()=>{d(),e.destroy();},r}export{i as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function B(e,r){let t=document.createElement("span");t.textContent=r,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function _(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),/^\s+$/.test(t)?(n.textContent=t,n.style.whiteSpace="pre"):(n.textContent=t,n.style.display="inline-block"),e.appendChild(n),/^\s+$/.test(t)?null:n}).filter(t=>t!==null)}function Q(e){let r=e.textContent??"";return e.textContent="",r.split("").map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=t,t===" "?n.style.whiteSpace="pre":n.style.display="inline-block",e.appendChild(n),t===" "?null:n}).filter(t=>t!==null)}function W(e){let r=_(e),t=new Map;for(let s of r){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let n=[],c=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of c){let i=t.get(s),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block",i.forEach((g,b)=>{let h=g.nextElementSibling;l.appendChild(g),b<i.length-1&&h&&h.style.whiteSpace==="pre"&&l.appendChild(h);}),n.push(l);}return e.textContent="",n.forEach((s,i)=>{e.appendChild(s),i<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function Z(e,r,t,n){if(t<=1||n===0)return e;let c=(t-1)*n,s=r*n,i=s+(1-c);return i<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(i-s)))}function ee(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")||""}var Y={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(e,r={}){if(typeof window>"u")return Y;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),Y;let n=t;return a(r,(c,s)=>te(n,c,s))}function te(e,r,t){let{split:n="words",stagger:c$1=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:l={},once:g=true,onComplete:b}=r,h=typeof s=="function"?s:d[s]??d["ease-out"],j=a$1(l.start??"top 85%"),G=a$1(l.end??"top 40%"),S=e.innerHTML,I=e.textContent??"",m;n==="chars"?m=Q(e):n==="lines"?m=W(e):m=_(e),B(e,I);let U=m.length;function V(o,a){i?.opacity!==void 0&&(o.style.opacity=String(i.opacity+(1-i.opacity)*a));let E=ee(a,i);E&&(o.style.transform=E);}function d$2(o){e.style.setProperty("--scroll-draw-progress",String(o)),m.forEach((a,E)=>{let K=h(Z(o,E,U,c$1));V(a,K);});}if(t)return d$2(1),b?.(),{destroy(){e.innerHTML=S;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};d$2(0);let C=0,M=0,p=0,x=false,u=false,y=-1,f=0,w=false,F=()=>window.scrollY,X=()=>window.innerHeight;function P(){let o=e.getBoundingClientRect(),a=c({top:o.top,height:o.height},F(),X(),j,G);C=a.tStart,M=a.tEnd;}function L(){if(!x||u)return;let o=b$2(F(),C,M,1);g&&(y=Math.max(y,o),o=y),f=o,d$2(o),o>=1&&!w?(w=true,b?.()):o<1&&!g&&(w=false),p=requestAnimationFrame(L);}P();let O=new IntersectionObserver(o=>{o.forEach(a=>{x=a.isIntersecting,x&&!u?p=requestAnimationFrame(L):cancelAnimationFrame(p);});}),v;function T(){clearTimeout(v),v=setTimeout(()=>{if(n==="lines"){let o=f;e.innerHTML=S,m=W(e),B(e,I),d$2(o);}P();},150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let J=d$1([e],T);return O.observe(e),a$2(e,{type:"text",getProgress:()=>f,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(p),O.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),J(),clearTimeout(v),e.innerHTML=S,b$1(e);},replay(){y=-1,w=false,f=0,u=false,d$2(0);},pause(){u=true,cancelAnimationFrame(p);},resume(){u&&(u=false,x&&(p=requestAnimationFrame(L)));},seek(o){let a=Math.min(1,Math.max(0,o));f=a,y=a,u=true,cancelAnimationFrame(p),d$2(a);},getProgress(){return f}}}export{le as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-BFX2CSQ3.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function b(e,o){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?a(r,o):(b$1("scrollAnimate: element not found:",e),n)}function P(e,o={}){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return b$1("scrollParallax: element not found:",e),n;let{speed:c=.3,axis:p="y",easing:f="linear",trigger:u,onProgress:g}=o,i=-c*100,s=r.style,m=!!r.ownerSVGElement,y=s.getPropertyValue("transform-box");m&&s.setProperty("transform-box","fill-box");let l=a(r,{props:p==="x"?{transform:["translateX(0%)",`translateX(${i}%)`]}:{transform:["translateY(0%)",`translateY(${i}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:f,native:false,onProgress:g});return m?{...l,destroy(){l.destroy(),s.setProperty("transform-box",y);}}:l}export{b as a,P as b};
1
+ import {a}from'./chunk-LTCJVVSC.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function b(e,o){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?a(r,o):(b$1("scrollAnimate: element not found:",e),n)}function P(e,o={}){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return b$1("scrollParallax: element not found:",e),n;let{speed:c=.3,axis:p="y",easing:f="linear",trigger:u,onProgress:g}=o,i=-c*100,s=r.style,m=!!r.ownerSVGElement,y=s.getPropertyValue("transform-box");m&&s.setProperty("transform-box","fill-box");let l=a(r,{props:p==="x"?{transform:["translateX(0%)",`translateX(${i}%)`]}:{transform:["translateY(0%)",`translateY(${i}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:f,native:false,onProgress:g});return m?{...l,destroy(){l.destroy(),s.setProperty("transform-box",y);}}:l}export{b as a,P as b};
@@ -0,0 +1,3 @@
1
+ import {b as b$1,a as a$6}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-YWKPTYSG.mjs';import {a as a$2}from'./chunk-YZV4Z3EQ.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$3}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$5,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b,a as a$4}from'./chunk-LFSU6LR3.mjs';var ht={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 Dt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function gt(r,y){let u="";try{u=getComputedStyle(r).getPropertyValue(y).trim();}catch{}return u||(r.getAttribute(y)??"").trim()}var vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Ot(r){if(!a$4)return;let y=gt(r,"stroke");if(!y||y==="none"){b("Element has no stroke \u2014 path will not be visible.",r);return}let u=(r.getAttribute("fill")??"").trim();u&&!vt.has(u)&&!vt.has(gt(r,"fill"))&&b("Element has a fill \u2014 it may obscure the stroke animation.",r);}function Nt(r,y,u){let h=document.createElement("div");h.setAttribute("data-svg-scroll-draw-debug",""),h.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 N(){let B=u==="x"?window.scrollX:window.scrollY,F=r-B,z=y-B,H=u==="x";h.innerHTML=`
2
+ <div style="position:absolute;${H?`left:${F}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${F}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;${H?`left:${z}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${z}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(h),window.addEventListener("scroll",N,{passive:true}),N(),{el:h,destroy(){window.removeEventListener("scroll",N),h.remove();}}}var wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,bt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Ft(r,y,u){if(!a$4)return;let h=(r.match(bt)??[]).join("").toUpperCase(),N=(y.match(bt)??[]).join("").toUpperCase(),B=(r.match(wt)??[]).length,F=(y.match(wt)??[]).length;if(h!==N){b(`morphTo: command sequence differs (${h||"\u2205"} \u2192 ${N||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,u);return}B!==F&&b(`morphTo: coordinate count differs (${B} \u2192 ${F}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,u);}function _e(r,y,u){let h=(y.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),N=0;return r.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,B=>{let F=parseFloat(B),z=h[N++]??F;return String(+(F+(z-F)*u).toFixed(4))})}function Yt(r,y={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:a(y,(u,h)=>Ht(r,u,h))}function Ht(r,y,u){let{preset:h,...N}=y,B=h?{...ht[h],...N}:N,{selector:F="path, polyline, line, polygon, rect, circle",speed:z=1,fade:H=false,easing:pe="linear",trigger:be={},stagger:J=0,direction:g="forward",once:K=false,debug:Et=false,axis:U="y",scrollContainer:Oe,autoReverse:Ee=false,delay:de=0,strokeColor:ee,strokeWidth:te,fillOpacity:re,waypoints:se,velocityScale:ye=false,threshold:Ue=0,rootMargin:je="0px",repeat:oe=0,repeatDelay:Ne=0,morphTo:P,clip:Fe,autoplay:$t=false,duration:Tt=1e3,native:kt=true,onProgress:he,onStart:$e,onComplete:le,onEnter:Xe,onLeave:Ye,onEnterBack:Qe,onLeaveBack:Ze}=B,j=Fe===true?"left":typeof Fe=="string"?Fe:false,ne=typeof pe=="function"?pe:d[pe]??d.linear,Je=a$1(be.start??"top bottom"),Ke=a$1(be.end??"bottom top"),I=typeof Oe=="string"?document.querySelector(Oe):Oe??null,V=Array.isArray(ee)?ee[0]:null,E=Array.isArray(ee)?ee[1]:typeof ee=="string"?ee:null,S=Array.isArray(te)?te[0]:null,$=Array.isArray(te)?te[1]:typeof te=="number"?te:null,x=Array.isArray(re)?re[0]:null,T=Array.isArray(re)?re[1]:typeof re=="number"?re:null;function ie(e){let t=e*100;switch(j){case "right":return `inset(0 0 0 ${100-t}%)`;case "top":return `inset(0 0 ${100-t}% 0)`;case "bottom":return `inset(${100-t}% 0 0 0)`;case "center":return `circle(${e*150}% at 50% 50%)`;default:return `inset(0 ${100-t}% 0 0)`}}let d$2=j?[]:Array.from(r.querySelectorAll(F)),l=[],L=[],M=0,D=0,Te=J,et=0,b$4=false,R=false,A=0,ke=false,X=-1,ge=[],Se=-1,v=false,q=0,_=0,Y,He=null;function tt(){He?.destroy(),He=null;}let Q=new Set,rt=NaN,Z=true,xe=-1,st=performance.now(),fe=NaN;function ve(){return I?U==="x"?I.scrollLeft:I.scrollTop:U==="x"?window.scrollX:window.scrollY}function ot(){return I?U==="x"?I.clientWidth:I.clientHeight:U==="x"?window.innerWidth:window.innerHeight}function nt(){let e=a$3(r,I,U);return c(e,e.scroll,ot(),Je,Ke)}function St(){let e=D-M,t=d$2.length-1,o=I??document.documentElement,m=U==="x"?"Width":"Height";if(Te=J,J>0&&t>0&&e>0){let C=o[`scroll${m}`]-o[`client${m}`]-1-M-e/z;C>=0&&(Te=Math.min(J,C/(t*e)));}et=D+t*Te*e;}function it(){(({tStart:M,tEnd:D}=nt())),St(),Et&&a$4&&(tt(),He=Nt(M,D,U));}function Ie(e,t=nt){a$5(r,{type:"draw",getProgress:()=>e.getProgress(),getTrigger:t});let o=e.destroy;return e.destroy=()=>{o.call(e),b$2(r);},e}function xt(e,t){if(r.style.setProperty("--scroll-draw-progress",String(e)),j){let o=t==="reverse"?1-e:e;r.style.clipPath=ie(o);return}d$2.forEach((o,m)=>{o.style.strokeDashoffset=t==="reverse"?`${l[m]*e}`:`${l[m]*(1-e)}`,H&&(o.style.opacity=t==="reverse"?`${1-e}`:`${e}`),V&&E?o.style.stroke=a$6(V,E,e):E&&(o.style.stroke=E),S!==null&&$!==null?o.style.strokeWidth=`${S+($-S)*e}`:$!==null&&(o.style.strokeWidth=`${$}`),x!==null&&T!==null?o.style.fillOpacity=`${x+(T-x)*e}`:T!==null&&(o.style.fillOpacity=`${T}`),P&&o.tagName.toLowerCase()==="path"&&L[m]&&o.setAttribute("d",_e(L[m],P,e));});}function Ae(){if(r.style.setProperty("--scroll-draw-progress","0"),j){r.style.clipPath=ie(0);return}d$2.forEach((e,t)=>{e.style.strokeDasharray=`${l[t]}`,e.style.strokeDashoffset=g==="reverse"?"0":`${l[t]}`,H?e.style.opacity=g==="reverse"?"1":"0":e.style.opacity="",V&&(e.style.stroke=V),S!==null&&(e.style.strokeWidth=`${S}`),x!==null&&(e.style.fillOpacity=`${x}`),P&&e.tagName.toLowerCase()==="path"&&L[t]&&e.setAttribute("d",L[t]);});}if(d$2.forEach(e=>{Ot(e);let t=a$2(e);l.push(t);let o=e.tagName.toLowerCase()==="path";o?L.push(e.getAttribute("d")??""):L.push(""),P&&(o?Ft(L[L.length-1],P,e):b(`morphTo only applies to <path> elements \u2014 ignored on <${e.tagName}>.`,e)),u?(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=g==="reverse"?`${t}`:"0",H&&(e.style.opacity="1"),E&&(e.style.stroke=E),$!==null&&(e.style.strokeWidth=`${$}`),T!==null&&(e.style.fillOpacity=`${T}`),P&&e.tagName.toLowerCase()==="path"&&e.setAttribute("d",P)):(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=g==="reverse"?"0":`${t}`,H?e.style.opacity=g==="reverse"?"1":"0":e.style.opacity="",V&&(e.style.stroke=V),S!==null&&(e.style.strokeWidth=`${S}`),x!==null&&(e.style.fillOpacity=`${x}`));}),j){if(u)return r.style.clipPath=ie(1),le?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};r.style.clipPath=ie(0);}else if(u)return le?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let at=typeof pe=="string"?b$1(pe):null;function At(){return !(kt===false||!Ct()||!d$2.length||!at||j||U!=="y"||I||z!==1||J!==0||K||Ee||ye!==false||P||se||oe||de>0||he||$e||le||Xe||Ye||Qe||Ze||ee!=null||te!=null||re!=null||(be.start??"top bottom").trim()!=="top bottom"||(be.end??"bottom top").trim()!=="bottom top")}function Pt(){let e=++Dt,t=`svg-scroll-draw-${e}`,o=`svg-scroll-draw-host-${e}`,m=`--svg-scroll-draw-${e}`,C=g==="reverse"?"0":"var(--ssd-len)",G=g==="reverse"?"var(--ssd-len)":"0",W=`stroke-dashoffset:${C};`,i=`stroke-dashoffset:${G};`;H&&(W+=`opacity:${g==="reverse"?1:0};`,i+=`opacity:${g==="reverse"?0:1};`);let a=document.createElement("style");a.setAttribute("data-svg-scroll-draw",""),a.textContent=`@keyframes ${t}{from{${W}}to{${i}}}.${o}{view-timeline-name:${m};view-timeline-axis:block;}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${at};animation-fill-mode:both;animation-timeline:${m};animation-range:cover 0% cover 100%;}`,document.head.appendChild(a),r.classList.add(o);function w(s,p){s.style.setProperty("--ssd-len",String(l[p])),s.style.strokeDasharray=`${l[p]}`,s.style.strokeDashoffset="",s.style.opacity="",s.style.animationPlayState="",s.classList.add(t);}d$2.forEach(w);let n=false,f=-1;function c$1(){if(f>=0)return f;let s=r.getBoundingClientRect(),{tStart:p,tEnd:O}=c({top:s.top,height:s.height},ve(),ot(),Je,Ke);return ne(b$3(ve(),p,O,z))}return {destroy(){r.classList.remove(o),d$2.forEach(s=>{s.classList.remove(t),s.style.removeProperty("--ssd-len"),s.style.animationPlayState="";}),a.remove();},replay(){n=false,f=-1,d$2.forEach(w);},pause(){n=true,d$2.forEach(s=>{s.style.animationPlayState="paused";});},resume(){n&&(n=false,d$2.forEach(s=>{s.style.animationPlayState="running";}));},seek(s){let p=Math.min(1,Math.max(0,s));f=p,n=true,d$2.forEach((O,k)=>{O.classList.remove(t),O.style.strokeDashoffset=g==="reverse"?`${l[k]*p}`:`${l[k]*(1-p)}`,H&&(O.style.opacity=g==="reverse"?`${1-p}`:`${p}`);});},getProgress(){return c$1()},refresh(){d$2.forEach((s,p)=>{l[p]=a$2(s),s.style.setProperty("--ssd-len",String(l[p])),s.style.strokeDasharray=`${l[p]}`;});}}}if(At())return Ie(Pt());function Lt(){let e=Math.max(1,Tt),t=0,o=0,m=false;function C(n){let f=true;if(j){let c=Math.min(1,Math.max(0,n/e)),s=ne(c);q=s,r.style.setProperty("--scroll-draw-progress",String(s)),r.style.clipPath=ie(g==="reverse"?1-s:s),he?.(s),c<1&&(f=false);}else d$2.forEach((c,s)=>{let p=s*J*e,O=Math.min(1,Math.max(0,(n-p)/e)),k=ne(O);c.style.strokeDashoffset=g==="reverse"?`${l[s]*k}`:`${l[s]*(1-k)}`,H&&(c.style.opacity=g==="reverse"?`${1-k}`:`${k}`),V&&E?c.style.stroke=a$6(V,E,k):E&&(c.style.stroke=E),S!==null&&$!==null?c.style.strokeWidth=`${S+($-S)*k}`:$!==null&&(c.style.strokeWidth=`${$}`),x!==null&&T!==null?c.style.fillOpacity=`${x+(T-x)*k}`:T!==null&&(c.style.fillOpacity=`${T}`),P&&c.tagName.toLowerCase()==="path"&&L[s]&&c.setAttribute("d",_e(L[s],P,k)),s===0&&(q=k,he?.(k),r.style.setProperty("--scroll-draw-progress",String(k))),O<1&&(f=false);});if(se){let c=Math.min(1,Math.max(0,n/e)),s=ne(c);for(let p in se){let O=parseFloat(p);s>=O&&!Q.has(O)&&(Q.add(O),se[p]?.());}}return f}function G(n){if(v)return;let f=n-t;R||(R=true,$e?.());let c=C(f);if(c&&!b$4){b$4=true,C(e*(1+Math.max(0,d$2.length-1)*J)),le?.(),_<(oe==="infinite"?1/0:oe??0)&&(_++,Y=setTimeout(()=>{t=performance.now(),R=false,b$4=false,Q.clear(),Ae(),A=requestAnimationFrame(G);},Ne));return}c||(A=requestAnimationFrame(G));}function W(){cancelAnimationFrame(A),clearTimeout(Y),t=performance.now(),o=0,v=false,R=false,b$4=false,_=0,m=true,q=0,Q.clear(),Ae(),A=requestAnimationFrame(G);}let i=new IntersectionObserver(n=>{n.forEach(f=>{f.isIntersecting&&!(K&&b$4)?W():!f.isIntersecting&&!K&&!b$4&&(cancelAnimationFrame(A),clearTimeout(Y),m=false);});},{root:I??null,threshold:Ue,rootMargin:je}),a;function w(){clearTimeout(a),a=setTimeout(()=>{d$2.forEach((n,f)=>{l[f]=a$2(n),n.style.strokeDasharray=`${l[f]}`;});},150);}return window.addEventListener("resize",w),window.addEventListener("orientationchange",w),de>0?setTimeout(()=>i.observe(r),de):i.observe(r),{destroy(){cancelAnimationFrame(A),clearTimeout(Y),i.disconnect(),window.removeEventListener("resize",w),window.removeEventListener("orientationchange",w),clearTimeout(a);},replay(){_=0,W();},pause(){v||!m||(v=true,o=performance.now()-t,cancelAnimationFrame(A));},resume(){v&&(v=false,m=true,t=performance.now()-o,A=requestAnimationFrame(G));},seek(n){let f=Math.min(1,Math.max(0,n));q=f,v=true,o=f*e,t=performance.now()-o,cancelAnimationFrame(A),C(o);},getProgress(){return q},refresh(){clearTimeout(a),d$2.forEach((n,f)=>{l[f]=a$2(n),n.style.strokeDasharray=`${l[f]}`;});}}}if($t)return Ie(Lt());it();function lt(){if(v||!ce)return;let e=performance.now(),t=ve();if(!Z&&ye===false&&t===rt){We(t);return}Z=false,rt=t;let o=z;if(ye!==false){let i=e-st,a=i>0?Math.abs(t-(xe<0?t:xe))/i:0;o=z*Math.max(.2,1+a*(typeof ye=="number"?ye:1)*.04);}xe=t,st=e;let m=Ee?Se===-1||t>=Se?"forward":"reverse":g;Se=t;let C=D-M,G=true,W=C===0?0:(t-M)/C;if(isNaN(fe)||(fe<=0&&W>0?Xe?.():fe>0&&W<=0&&Ze?.(),fe<1&&W>=1?Ye?.():fe>=1&&W<1&&Qe?.()),fe=W,j){let i=ne(b$3(t,M,D,o));K&&!Ee&&(X=Math.max(X,i),i=X),q=i,r.style.setProperty("--scroll-draw-progress",String(i));let a=m==="reverse"?1-i:i;r.style.clipPath=ie(a),he?.(i),!R&&b$3(t,M,D,o)>0&&(R=true,$e?.()),i>=1&&!b$4?(b$4=true,le?.(),_<(oe==="infinite"?1/0:oe??0)&&(_++,Y=setTimeout(()=>{X=-1,R=false,b$4=false,r.style.clipPath=ie(0);},Ne))):i<1&&!K&&(b$4=false),We(t);return}if(d$2.forEach((i,a)=>{let w=a*Te*C,n=ne(b$3(t,M+w,D+w,o));K&&!Ee&&(n=ge[a]=Math.max(ge[a]??X,n)),i.style.strokeDashoffset=m==="reverse"?`${l[a]*n}`:`${l[a]*(1-n)}`,H&&(i.style.opacity=m==="reverse"?`${1-n}`:`${n}`),V&&E?i.style.stroke=a$6(V,E,n):E&&(i.style.stroke=E),S!==null&&$!==null?i.style.strokeWidth=`${S+($-S)*n}`:$!==null&&(i.style.strokeWidth=`${$}`),x!==null&&T!==null?i.style.fillOpacity=`${x+(T-x)*n}`:T!==null&&(i.style.fillOpacity=`${T}`),P&&i.tagName.toLowerCase()==="path"&&L[a]&&i.setAttribute("d",_e(L[a],P,n)),a===0&&(q=n,he?.(n),r.style.setProperty("--scroll-draw-progress",String(n))),n<1&&(G=false);}),se){let i=ne(b$3(t,M,D,o));for(let a in se){let w=parseFloat(a);i>=w&&!Q.has(w)&&(Q.add(w),se[a]?.());}}!R&&b$3(t,M,D,o)>0&&(R=true,$e?.()),G&&!b$4?(b$4=true,le?.(),_<(oe==="infinite"?1/0:oe??0)&&(_++,Y=setTimeout(()=>{X=-1,ge=[],R=false,b$4=false,Q.clear(),Ae(),Z=true;},Ne))):!G&&!K&&(b$4=false),We(t);}function Re(e){return e>=D&&e<et}function We(e){ke||Re(e)?A=requestAnimationFrame(lt):ce=false;}function ze(){return ke||Re(ve())}let ce=false;function Pe(){ce||(ce=true,A=requestAnimationFrame(function(){lt();}));}function Le(){ce=false,cancelAnimationFrame(A);}let Ve=new IntersectionObserver(e=>{e.forEach(t=>{ke=t.isIntersecting,ke&&!v?(Z=true,Pe()):ce&&!v&&Re(ve())||Le();});},{root:I??null,threshold:Ue,rootMargin:je});function ft(){d$2.forEach((e,t)=>{l[t]=a$2(e),e.style.strokeDasharray=`${l[t]}`;}),it(),Z=true;}let Me;function we(){clearTimeout(Me),Me=setTimeout(ft,150);}window.addEventListener("resize",we),window.addEventListener("orientationchange",we);let Mt=d$1([r],we);return de>0?setTimeout(()=>Ve.observe(r),de):Ve.observe(r),Ie({destroy(){cancelAnimationFrame(A),clearTimeout(Y),Le(),Ve.disconnect(),Mt(),window.removeEventListener("resize",we),window.removeEventListener("orientationchange",we),clearTimeout(Me),tt();},replay(){X=-1,ge=[],Se=-1,xe=-1,R=false,b$4=false,_=0,v=false,q=0,Q.clear(),clearTimeout(Y),Ae(),Z=true,ze()&&Pe();},pause(){v=true,Le();},resume(){v&&(v=false,Z=true,ze()&&Pe());},seek(e){let t=Math.min(1,Math.max(0,e));q=t,X=t,ge=[],v=true,Le(),xt(t,g),Z=true;},getProgress(){return q},refresh(){clearTimeout(Me),ft(),ze()&&!v&&Pe();}},()=>({tStart:M,tEnd:D}))}export{ht as a,Yt as b};
@@ -0,0 +1 @@
1
+ import {b,a as a$4}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-YWKPTYSG.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$2,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$3}from'./chunk-BCV4RAIX.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function He(t){return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")}function de(t){let i=[],l=/([\w]+)\(([^)]*)\)/g,s;for(;(s=l.exec(t))!==null;){let m=[],o=[],c=s[2].trim();if(c)for(let a of c.split(/[\s,]+/)){let r=a.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(r?parseFloat(r[1]):0),o.push(r?r[2]:"");}i.push({fn:s[1],nums:m,units:o});}return i}function xe(t,i,l){let s=de(t),m=de(i);return s.length===0||s.length!==m.length?l<1?t:i:s.map((o,c)=>{let a=m[c];return o.fn!==a.fn||o.nums.length!==a.nums.length?l<1?`${o.fn}(${o.nums.map((r,g)=>`${r}${o.units[g]}`).join(", ")})`:`${a.fn}(${a.nums.map((r,g)=>`${r}${a.units[g]}`).join(", ")})`:`${o.fn}(${o.nums.map((r,g)=>`${r+(a.nums[g]-r)*l}${o.units[g]}`).join(", ")})`}).join(" ")}function ye(t,i,l){if(typeof t=="number"&&typeof i=="number")return String(t+(i-t)*l);let s=String(t),m=String(i);if(He(s))return a$4(s,m,l);if(s.includes("("))return xe(s,m,l);let o=s.match(/^([-+]?[\d.]+)(.*)$/),c=m.match(/^([-+]?[\d.]+)(.*)$/);if(o&&c){let a=parseFloat(o[1]),r=parseFloat(c[1]);return `${a+(r-a)*l}${o[2]||c[2]}`}return l<1?s:m}function Ce(t){return t.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}var Fe=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ie=0,he="--scroll-draw-progress";function Ne(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var be={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function _e(t,i){return typeof window>"u"?be:i.respectReducedMotion===false?Ee(t,i,false):a(i,(l,s)=>Ee(t,l,s))}function Ee(t,i,l){let{props:s,trigger:m={},easing:o="ease-out",speed:c$1=1,once:a=false,axis:r="y",scrollContainer:g,native:ve=true,velocityScale:H=false,triggerElement:we,onProgress:J,onComplete:R,onEnter:K,onLeave:Q,onEnterBack:ee,onLeaveBack:te}=i,k=typeof o=="function"?o:d[o]??d["ease-out"],ne=a$1(m.start??"top bottom"),re=a$1(m.end??"bottom top"),x=we??t,d$2=typeof g=="string"?document.querySelector(g):g??null,y=Object.entries(s).map(([e,n])=>({prop:Ce(e),from:Array.isArray(n)?n[0]:"",to:Array.isArray(n)?n[1]:n}));function Se(){let e=window.getComputedStyle(t);for(let n of y)n.from===""&&(n.from=e.getPropertyValue(n.prop).trim()||"0");}function Te(){for(let e of y)t.style.setProperty(e.prop,String(e.to));}let V=new Map;for(let e of [...y.map(n=>n.prop),he])V.set(e,t.style.getPropertyValue(e));function O(){for(let[e,n]of V)n?t.style.setProperty(e,n):t.style.removeProperty(e);}if(l)return Te(),R?.(),{...be,destroy:O,getProgress:()=>1};Se();let oe=typeof o=="string"?b(o):null;function Le(){if(!ve||!Ne()||!oe||r!=="y"||d$2||x!==t||a||c$1!==1||J||R||K||Q||ee||te||H!==false||(m.start??"top bottom").trim()!=="top bottom"||(m.end??"bottom top").trim()!=="bottom top")return false;for(let e of y)if(!Fe.has(e.prop))return false;return true}function Pe(){let e=`ssd-a-${++Ie}`,n=y.map(f=>`${f.prop}:${f.from}`).join(";"),P=y.map(f=>`${f.prop}:${f.to}`).join(";"),E=document.createElement("style");E.setAttribute("data-ssd-animate",""),E.textContent=`@keyframes ${e}{from{${n}}to{${P}}}.${e}{animation-name:${e};animation-duration:auto;animation-timing-function:${oe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),t.classList.add(e);let u=()=>r==="x"?window.scrollX:window.scrollY,p=()=>r==="x"?window.innerWidth:window.innerHeight,A=()=>{let f=t.getBoundingClientRect();return c({top:f.top,height:f.height},u(),p(),ne,re)};a$2(t,{type:"animate",getProgress:()=>D.getProgress(),getTrigger:A});let D={refresh(){},destroy(){t.classList.remove(e),E.remove(),t.style.animationPlayState="",O(),b$3(t);},replay(){t.classList.remove(e),t.offsetWidth,t.classList.add(e);},pause(){t.style.animationPlayState="paused";},resume(){t.style.animationPlayState="";},seek(f){let _=Math.min(1,Math.max(0,f));t.classList.remove(e);for(let q of y)t.style.setProperty(q.prop,ye(q.from,q.to,_));},getProgress(){let{tStart:f,tEnd:_}=A();return k(b$2(u(),f,_,c$1))}};return D}if(Le())return Pe();let h=0,b$4=0,v=0,C=false,w=false,T=-1,L=0,F=false,S=NaN,W=-1,se=0,ie=()=>d$2?r==="x"?d$2.scrollLeft:d$2.scrollTop:r==="x"?window.scrollX:window.scrollY,Ae=()=>d$2?r==="x"?d$2.clientWidth:d$2.clientHeight:r==="x"?window.innerWidth:window.innerHeight,M=x===t?y:[],ae=false;function z(){let e=t.style,n=M.map(p=>e.getPropertyValue(p.prop)),P=e.transition;M.length&&(e.transition="none"),M.forEach(p=>e.setProperty(p.prop,V.get(p.prop)??""));let E=a$3(x,d$2,r);M.forEach((p,A)=>e.setProperty(p.prop,n[A])),M.length&&(t.offsetWidth,e.transition=P);let u=c(E,E.scroll,Ae(),ne,re);ae&&Math.abs(u.tStart-h)<1&&Math.abs(u.tEnd-b$4)<1||(ae=true,h=u.tStart,b$4=u.tEnd);}function I(e){t.style.setProperty(he,String(e));for(let n of y)t.style.setProperty(n.prop,ye(n.from,n.to,e));J?.(e);}function Me(e){if(isNaN(S)){S=e;return}S<=0&&e>0?K?.():S>0&&e<=0&&te?.(),S<1&&e>=1?Q?.():S>=1&&e<1&&ee?.(),S=e;}function B(){if(!C||w)return;let e=performance.now(),n=ie(),P=c$1;if(H!==false){let p=e-se,A=p>0?Math.abs(n-(W<0?n:W))/p:0;P=c$1*Math.max(.2,1+A*(typeof H=="number"?H:1)*.04);}W=n,se=e;let E=b$4===h?0:(n-h)/(b$4-h);Me(E);let u=k(b$2(n,h,b$4,P));a&&(T=Math.max(T,u),u=T),L=u,I(u),u>=1&&!F?(F=true,R?.()):u<1&&!a&&(F=false),v=requestAnimationFrame(B);}z(),b$4===h&&b$1("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`.",t);{let e=k(b$2(ie(),h,b$4,c$1));a&&e>0&&(T=e),L=e,I(e);}let le=new IntersectionObserver(e=>{e.forEach(n=>{C=n.isIntersecting,C&&!w?v=requestAnimationFrame(B):cancelAnimationFrame(v);});},{root:d$2??null}),j;function $(){clearTimeout(j),j=setTimeout(z,150);}window.addEventListener("resize",$),window.addEventListener("orientationchange",$);let $e=d$1([x],$);return le.observe(t),a$2(t,{type:"animate",getProgress:()=>L,getTrigger:()=>({tStart:h,tEnd:b$4})}),{destroy(){cancelAnimationFrame(v),le.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),$e(),clearTimeout(j),O(),b$3(t);},replay(){T=-1,F=false,L=0,w=false,I(0);},pause(){w=true,cancelAnimationFrame(v);},resume(){w&&(w=false,C&&(v=requestAnimationFrame(B)));},seek(e){let n=Math.min(1,Math.max(0,e));L=n,T=n,w=true,cancelAnimationFrame(v),I(n);},getProgress(){return L},refresh(){z();}}}export{_e as a};
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var M="http://www.w3.org/2000/svg",P="cinematic-photo",S=a=>a<0?0:a>1?1:a;function p(a){let s=parseFloat(a);return Number.isFinite(s)?S(s/100):0}function L(a){return d[a]??d.linear}var R={destroy:()=>{},getProgress:()=>0},T=class{constructor(s){if(typeof document>"u"){this.mount=null;return}this.mount=typeof s.wrapper=="string"?document.querySelector(s.wrapper):s.wrapper,this.mount||b("Cinematic: wrapper not found:",s.wrapper);}loadStory(s){let i=this.mount;if(typeof window>"u"||!i)return R;i.style.position="relative",i.style.height=s.totalHeight,i.style.display="block";let c=document.createElement("div");c.setAttribute("data-cinematic-stage",""),c.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",i.appendChild(c);let f=[];for(let e of s.scenes){if(e.background){let t=document.createElement("img");t.id=P,t.src=e.background,t.alt="",t.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",c.appendChild(t);}let n=e.animations.filter(t=>t.type==="draw");if(n.length){let t=document.createElementNS(M,"svg");t.setAttribute("viewBox",`0 0 ${s.canvas.width} ${s.canvas.height}`),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",c.appendChild(t);for(let o of n){let r=document.createElementNS(M,"path");r.id=o.target.replace(/^#/,""),r.setAttribute("d",o.d),r.setAttribute("fill","none"),r.setAttribute("stroke",o.stroke),r.setAttribute("stroke-width",String(o.strokeWidth)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");let b=o.length||r.getTotalLength?.()||0;r.style.strokeDasharray=String(b),r.style.strokeDashoffset=String(b),t.appendChild(r),f.push({kind:"draw",el:r,start:p(o.start),end:p(o.end),ease:L(o.easing),length:b});}}for(let t of e.animations){if(t.type!=="fade")continue;let o=c.querySelector(t.target)??document.querySelector(t.target);o&&(o.style.opacity=String(t.from),f.push({kind:"fade",el:o,start:p(t.start),end:p(t.end),ease:d["ease-in-out"]??d.linear,from:t.from,to:t.to}));}}let d$1=0,v=()=>{let e=i.offsetHeight-window.innerHeight;return e<=0?i.getBoundingClientRect().top<=0?1:0:S(-i.getBoundingClientRect().top/e)},l=e=>{for(let n of f){let t=n.end-n.start,o=t<=0?e>=n.end?1:0:S((e-n.start)/t),r=n.ease(o);n.kind==="draw"?n.el.style.strokeDashoffset=String(n.length*(1-r)):n.el.style.opacity=String(n.from+(n.to-n.from)*r);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return l(1),{destroy:()=>{},getProgress:()=>1};let g=0,u=false,A=false,k=()=>{d$1=v(),l(d$1),u&&(g=requestAnimationFrame(k));},I=()=>{u||(u=true,g=requestAnimationFrame(k));},h=()=>{u=false,cancelAnimationFrame(g);},y=new IntersectionObserver(e=>{for(let n of e)A=n.isIntersecting,A?I():h();},{threshold:0});y.observe(c),d$1=v(),l(d$1),a(i,{type:"draw",getProgress:()=>d$1,getTrigger:()=>{let e=i.getBoundingClientRect().top+window.scrollY;return {tStart:e,tEnd:e+Math.max(0,i.offsetHeight-window.innerHeight)}}});let E=a$1(e=>{e&&(E(),h(),y.disconnect(),b$1(i),d$1=1,l(1));});return {destroy(){E(),h(),y.disconnect(),b$1(i);},getProgress:()=>d$1}}};
2
+ export{T as a};
@@ -1 +1 @@
1
- import {b}from'./chunk-ENACACPZ.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function l(r,s){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let o=typeof r=="string"?document.querySelector(r):r;return o?b(o,s):(b$1("Container not found:",r),n)}export{l as a};
1
+ import {b}from'./chunk-HX4SP5WN.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function l(r,s){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let o=typeof r=="string"?document.querySelector(r):r;return o?b(o,s):(b$1("Container not found:",r),n)}export{l as a};
@@ -1 +1 @@
1
- import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-7SBTYJGH.mjs';import {a as a$4}from'./chunk-I45LCJUP.mjs';import {a as a$2}from'./chunk-KHQ7OGQK.mjs';import {a as a$1}from'./chunk-BFX2CSQ3.mjs';import {b as b$2}from'./chunk-ENACACPZ.mjs';import {defineComponent,ref,h as h$1,onMounted,watch,onUnmounted,unref}from'vue';var u=e=>typeof e=="function"?e():unref(e);function r(e,t,o){let l=null,i=t(),s=()=>{l?.destroy(),l=e.value?o(e.value,b$1(i,()=>i)):null;};onMounted(s),watch(()=>a(i=t()),s),onUnmounted(()=>{l?.destroy(),l=null;});}function B(e={}){let t=ref(null);return r(t,()=>u(e),b$2),t}var g={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},b=[null,Boolean,[Boolean,String],[Boolean,Number]],T=e=>({type:e,default:void 0}),H=defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(g).map(([e,t])=>[e,t?T(b[t]):null])),setup(e,{slots:t}){let o=ref(null);return r(o,()=>{let l={};for(let i in g){let s=e[i];s!=null&&(l[i]=s);}return l},b$2),()=>h$1("div",{ref:o},t.default?.())}});function V(e){let t=ref(null);return r(t,()=>u(e),a$1),t}var j=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options,a$1),()=>h$1("div",{ref:o},t.default?.())}});function G(e){let t=ref(null);return r(t,()=>u(e),a$2),t}var h=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:T(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return r(t,()=>{let o={to:e.to};return e.from!=null&&(o.from=e.from),e.format!=null&&(o.format=e.format),e.easing!=null&&(o.easing=e.easing),e.trigger!=null&&(o.trigger=e.trigger),e.once!=null&&(o.once=e.once),e.decimals!=null&&(o.decimals=e.decimals),e.onComplete!=null&&(o.onComplete=e.onComplete),o},a$2),()=>h$1("span",{ref:t})}});function N(e={}){let t=ref(null);return r(t,()=>u(e),a$3),t}var F=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 t=ref(null);return r(t,()=>e.options??{},a$3),()=>h$1("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function q(e={}){let t=ref(null);return r(t,()=>u(e),a$4),t}var I=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options??{},a$4),()=>h$1(e.tag,{ref:o},t.default?.())}});export{B as a,H as b,V as c,j as d,G as e,h as f,N as g,F as h,q as i,I as j};
1
+ import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-VDTAYUAR.mjs';import {a as a$4}from'./chunk-DY5JCXVR.mjs';import {a as a$2}from'./chunk-WXUOF4NM.mjs';import {a as a$1}from'./chunk-LTCJVVSC.mjs';import {b as b$2}from'./chunk-HX4SP5WN.mjs';import {defineComponent,ref,h as h$1,onMounted,watch,onUnmounted,unref}from'vue';var u=e=>typeof e=="function"?e():unref(e);function r(e,t,o){let l=null,i=t(),s=()=>{l?.destroy(),l=e.value?o(e.value,b$1(i,()=>i)):null;};onMounted(s),watch(()=>a(i=t()),s),onUnmounted(()=>{l?.destroy(),l=null;});}function B(e={}){let t=ref(null);return r(t,()=>u(e),b$2),t}var g={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},b=[null,Boolean,[Boolean,String],[Boolean,Number]],T=e=>({type:e,default:void 0}),H=defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(g).map(([e,t])=>[e,t?T(b[t]):null])),setup(e,{slots:t}){let o=ref(null);return r(o,()=>{let l={};for(let i in g){let s=e[i];s!=null&&(l[i]=s);}return l},b$2),()=>h$1("div",{ref:o},t.default?.())}});function V(e){let t=ref(null);return r(t,()=>u(e),a$1),t}var j=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options,a$1),()=>h$1("div",{ref:o},t.default?.())}});function G(e){let t=ref(null);return r(t,()=>u(e),a$2),t}var h=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:T(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return r(t,()=>{let o={to:e.to};return e.from!=null&&(o.from=e.from),e.format!=null&&(o.format=e.format),e.easing!=null&&(o.easing=e.easing),e.trigger!=null&&(o.trigger=e.trigger),e.once!=null&&(o.once=e.once),e.decimals!=null&&(o.decimals=e.decimals),e.onComplete!=null&&(o.onComplete=e.onComplete),o},a$2),()=>h$1("span",{ref:t})}});function N(e={}){let t=ref(null);return r(t,()=>u(e),a$3),t}var F=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 t=ref(null);return r(t,()=>e.options??{},a$3),()=>h$1("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function q(e={}){let t=ref(null);return r(t,()=>u(e),a$4),t}var I=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options??{},a$4),()=>h$1(e.tag,{ref:o},t.default?.())}});export{B as a,H as b,V as c,j as d,G as e,h as f,N as g,F as h,q as i,I as j};
@@ -0,0 +1 @@
1
+ import {a,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var X={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function se(u,E={}){if(typeof window>"u")return X;let b$3=typeof u=="string"?document.querySelector(u):u;if(!b$3||b$3.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",u),X;let t=b$3,{trigger:P={},easing:T="linear",once:z=false,axis:f="y",preload:Y="auto",triggerElement:j,onReady:C,onComplete:J,onProgress:K}=E,I=j??t,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=typeof T=="function"?T:d[T]??d.linear,U=a(P.start??"top top"),Z=a(P.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=Y);let V=E.from??0,A=E.to,p=0,w=0,r=0,a$3=false,n=false,s=-1,l=0,v=false,i=false,R=()=>f==="x"?window.scrollX:window.scrollY,$=()=>f==="x"?window.innerWidth:window.innerHeight;function S(){let e=I.getBoundingClientRect(),o=f==="x"?e.left:e.top,m=f==="x"?e.width:e.height,k=c({top:o,height:m},R(),$(),U,Z);p=k.tStart,w=k.tEnd,i&&w===p&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let h=NaN;function c$1(e){if(!i)return;let o=A??t.duration??0,m=V+(o-V)*e;m!==h&&(h=m,t.currentTime=m),t.style.setProperty("--scroll-draw-progress",String(e)),K?.(e);}function y(){if(!a$3||n||!i||g)return;let e=Q(b$2(R(),p,w,1));z&&(s=Math.max(s,e),e=s),l=e,c$1(e),e>=1&&!v?(v=true,J?.()):e<1&&!z&&(v=false),r=requestAnimationFrame(y);}function x(){if(i=true,A===void 0&&(A=t.duration),g){c$1(1),C?.();return}S(),C?.(),a$3&&!n&&(r=requestAnimationFrame(y));}t.readyState>=1?x():t.addEventListener("loadedmetadata",x,{once:true}),i||S();let q=g?()=>{}:a$1(e=>{e&&(q(),g=true,cancelAnimationFrame(r),c$1(1));}),O=new IntersectionObserver(e=>{e.forEach(o=>{a$3=o.isIntersecting,a$3&&!n&&i?r=requestAnimationFrame(y):cancelAnimationFrame(r);});}),L;function d$2(){clearTimeout(L),L=setTimeout(S,150);}window.addEventListener("resize",d$2),window.addEventListener("orientationchange",d$2);let ee=d$1([I],d$2);return O.observe(t),a$2(t,{type:"video",getProgress:()=>l,getTrigger:()=>({tStart:p,tEnd:w})}),{destroy(){cancelAnimationFrame(r),O.disconnect(),t.removeEventListener("loadedmetadata",x),window.removeEventListener("resize",d$2),window.removeEventListener("orientationchange",d$2),ee(),q(),clearTimeout(L),b$1(t);},replay(){s=-1,v=false,l=0,n=false,h=NaN,c$1(0);},pause(){n=true,cancelAnimationFrame(r);},resume(){n&&(n=false,a$3&&i&&(r=requestAnimationFrame(y)));},seek(e){let o=Math.min(1,Math.max(0,e));l=o,s=o,n=true,cancelAnimationFrame(r),h=NaN,c$1(o);},getProgress(){return l}}}export{se as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var A={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Z(t,w){if(typeof window>"u")return A;let l=typeof t=="string"?document.querySelector(t):t;return l?a(w,(m,f)=>Y(l,m,f)):(b("scrollCounter: element not found:",t),A)}function Y(t,w,l){let{from:m=0,to:f,format:_,easing:h="ease-out",trigger:F={},once:b=true,decimals:I,onComplete:M}=w,P=I!==void 0?e=>e.toFixed(I):_??(e=>String(Math.round(e))),x=typeof h=="function"?h:d[h]??d["ease-out"],B=a$1(F.start??"top 80%"),G=a$1(F.end??"top 20%");if(l)return t.textContent=P(f),M?.(),{...A,getProgress:()=>1};let a=0,c$1=0,L=false,n=0,g=false,o=false,i=-1,s=0,p=false,y=()=>window.scrollY,V=()=>window.innerHeight;function z(){let e=t.getBoundingClientRect(),r=c({top:e.top,height:e.height},y(),V(),B,G);L&&Math.abs(r.tStart-a)<1&&Math.abs(r.tEnd-c$1)<1||(L=true,a=r.tStart,c$1=r.tEnd);}function d$2(e){t.textContent=P(m+(f-m)*e),t.style.setProperty("--scroll-draw-progress",String(e));}function v(){if(!g||o)return;let e=x(b$1(y(),a,c$1,1));b&&(i=Math.max(i,e),e=i),s=e,d$2(e),e>=1&&!p?(p=true,M?.()):e<1&&!b&&(p=false),n=requestAnimationFrame(v);}z();{let e=x(b$1(y(),a,c$1,1));b&&e>0&&(i=e),s=e,d$2(e);}let O=new IntersectionObserver(e=>{e.forEach(r=>{g=r.isIntersecting,g&&!o?n=requestAnimationFrame(v):cancelAnimationFrame(n);});}),S;function u(){clearTimeout(S),S=setTimeout(z,150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let W=d$1([t],u);return O.observe(t),a$2(t,{type:"counter",getProgress:()=>s,getTrigger:()=>({tStart:a,tEnd:c$1})}),{destroy(){cancelAnimationFrame(n),O.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),W(),clearTimeout(S),b$2(t);},replay(){i=-1,p=false,s=0,o=false,d$2(0);},pause(){o=true,cancelAnimationFrame(n);},resume(){o&&(o=false,g&&(n=requestAnimationFrame(v)));},seek(e){let r=Math.min(1,Math.max(0,e));s=r,i=r,o=true,cancelAnimationFrame(n),d$2(r);},getProgress(){return s}}}export{Z as a};
@@ -1,2 +1,2 @@
1
- 'use strict';function C({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),c=Math.max(.01,Math.min(.99,n)),p=Math.sqrt(c),u=0,h=[];for(let o=0;o<r;o++){let m=Math.pow(p,o);h.push(m),u+=m;}let l=[0],g=0;for(let o=0;o<r;o++)g+=h[o]/u,l.push(g);return o=>{if(o<=0)return 0;if(o>=1)return 1;for(let m=0;m<r;m++)if(o<=l[m+1]){let f=(o-l[m])/(l[m+1]-l[m]);if(m===0)return f*(2-f);let b=1-Math.pow(c,m);return b+(1-b)*(2*f-1)*(2*f-1)}return 1}}function D({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),c=Math.max(.1,n),p=r<=1?c/4:c/(2*Math.PI)*Math.asin(1/r);return u=>u<=0?0:u>=1?1:r*Math.pow(2,-10*u)*Math.sin((u-p)*(2*Math.PI)/c)+1}var y={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:C(),elastic:D()};var L=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function _(e,...n){L&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var x=Symbol.for("svg-scroll-draw.registry");function A(){let e=globalThis;return e[x]||(e[x]=new Map)}function k(e,n){A().set(e,n);}function R(e){A().delete(e);}var I="http://www.w3.org/2000/svg",P="cinematic-photo",E=e=>e<0?0:e>1?1:e;function w(e){let n=parseFloat(e);return Number.isFinite(n)?E(n/100):0}function H(e){return y[e]??y.linear}var V={destroy:()=>{},getProgress:()=>0},T=class{constructor(n){if(typeof document>"u"){this.mount=null;return}this.mount=typeof n.wrapper=="string"?document.querySelector(n.wrapper):n.wrapper,this.mount||_("Cinematic: wrapper not found:",n.wrapper);}loadStory(n){let r=this.mount;if(typeof window>"u"||!r)return V;r.style.position="relative",r.style.height=n.totalHeight,r.style.display="block";let c=document.createElement("div");c.setAttribute("data-cinematic-stage",""),c.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",r.appendChild(c);let p=[];for(let i of n.scenes){if(i.background){let t=document.createElement("img");t.id=P,t.src=i.background,t.alt="",t.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",c.appendChild(t);}let s=i.animations.filter(t=>t.type==="draw");if(s.length){let t=document.createElementNS(I,"svg");t.setAttribute("viewBox",`0 0 ${n.canvas.width} ${n.canvas.height}`),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",c.appendChild(t);for(let d of s){let a=document.createElementNS(I,"path");a.id=d.target.replace(/^#/,""),a.setAttribute("d",d.d),a.setAttribute("fill","none"),a.setAttribute("stroke",d.stroke),a.setAttribute("stroke-width",String(d.strokeWidth)),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round");let S=d.length||a.getTotalLength?.()||0;a.style.strokeDasharray=String(S),a.style.strokeDashoffset=String(S),t.appendChild(a),p.push({kind:"draw",el:a,start:w(d.start),end:w(d.end),ease:H(d.easing),length:S});}}for(let t of i.animations){if(t.type!=="fade")continue;let d=c.querySelector(t.target)??document.querySelector(t.target);d&&(d.style.opacity=String(t.from),p.push({kind:"fade",el:d,start:w(t.start),end:w(t.end),ease:y["ease-in-out"]??y.linear,from:t.from,to:t.to}));}}let u=0,h=()=>{let i=r.offsetHeight-window.innerHeight;return i<=0?r.getBoundingClientRect().top<=0?1:0:E(-r.getBoundingClientRect().top/i)},l=i=>{for(let s of p){let t=s.end-s.start,d=t<=0?i>=s.end?1:0:E((i-s.start)/t),a=s.ease(d);s.kind==="draw"?s.el.style.strokeDashoffset=String(s.length*(1-a)):s.el.style.opacity=String(s.from+(s.to-s.from)*a);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return l(1),{destroy:()=>{},getProgress:()=>1};let g=0,o=false,m=false,f=()=>{u=h(),l(u),o&&(g=requestAnimationFrame(f));},b=()=>{o||(o=true,g=requestAnimationFrame(f));},M=()=>{o=false,cancelAnimationFrame(g);},v=new IntersectionObserver(i=>{for(let s of i)m=s.isIntersecting,m?b():M();},{threshold:0});return v.observe(c),u=h(),l(u),k(r,{type:"draw",getProgress:()=>u,getTrigger:()=>{let i=r.getBoundingClientRect().top+window.scrollY;return {tStart:i,tEnd:i+Math.max(0,r.offsetHeight-window.innerHeight)}}}),{destroy(){M(),v.disconnect(),R(r);},getProgress:()=>u}}};
2
- exports.Cinematic=T;
1
+ 'use strict';function D({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,n)),p=Math.sqrt(o),c=0,h=[];for(let i=0;i<t;i++){let d=Math.pow(p,i);h.push(d),c+=d;}let l=[0],g=0;for(let i=0;i<t;i++)g+=h[i]/c,l.push(g);return i=>{if(i<=0)return 0;if(i>=1)return 1;for(let d=0;d<t;d++)if(i<=l[d+1]){let f=(i-l[d])/(l[d+1]-l[d]);if(d===0)return f*(2-f);let b=1-Math.pow(o,d);return b+(1-b)*(2*f-1)*(2*f-1)}return 1}}function P({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),o=Math.max(.1,n),p=t<=1?o/4:o/(2*Math.PI)*Math.asin(1/t);return c=>c<=0?0:c>=1?1:t*Math.pow(2,-10*c)*Math.sin((c-p)*(2*Math.PI)/o)+1}var y={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:D(),elastic:P()};var H=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function _(e,...n){H&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var A=Symbol.for("svg-scroll-draw.registry");function R(){let e=globalThis;return e[A]||(e[A]=new Map)}function k(e,n){R().set(e,n);}function S(e){R().delete(e);}function I(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=p=>e(!!p.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let o=n;return o.addListener?.(t),()=>o.removeListener?.(t)}var T="http://www.w3.org/2000/svg",V="cinematic-photo",x=e=>e<0?0:e>1?1:e;function w(e){let n=parseFloat(e);return Number.isFinite(n)?x(n/100):0}function O(e){return y[e]??y.linear}var Q={destroy:()=>{},getProgress:()=>0},C=class{constructor(n){if(typeof document>"u"){this.mount=null;return}this.mount=typeof n.wrapper=="string"?document.querySelector(n.wrapper):n.wrapper,this.mount||_("Cinematic: wrapper not found:",n.wrapper);}loadStory(n){let t=this.mount;if(typeof window>"u"||!t)return Q;t.style.position="relative",t.style.height=n.totalHeight,t.style.display="block";let o=document.createElement("div");o.setAttribute("data-cinematic-stage",""),o.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(o);let p=[];for(let s of n.scenes){if(s.background){let r=document.createElement("img");r.id=V,r.src=s.background,r.alt="",r.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",o.appendChild(r);}let a=s.animations.filter(r=>r.type==="draw");if(a.length){let r=document.createElementNS(T,"svg");r.setAttribute("viewBox",`0 0 ${n.canvas.width} ${n.canvas.height}`),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",o.appendChild(r);for(let m of a){let u=document.createElementNS(T,"path");u.id=m.target.replace(/^#/,""),u.setAttribute("d",m.d),u.setAttribute("fill","none"),u.setAttribute("stroke",m.stroke),u.setAttribute("stroke-width",String(m.strokeWidth)),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round");let E=m.length||u.getTotalLength?.()||0;u.style.strokeDasharray=String(E),u.style.strokeDashoffset=String(E),r.appendChild(u),p.push({kind:"draw",el:u,start:w(m.start),end:w(m.end),ease:O(m.easing),length:E});}}for(let r of s.animations){if(r.type!=="fade")continue;let m=o.querySelector(r.target)??document.querySelector(r.target);m&&(m.style.opacity=String(r.from),p.push({kind:"fade",el:m,start:w(r.start),end:w(r.end),ease:y["ease-in-out"]??y.linear,from:r.from,to:r.to}));}}let c=0,h=()=>{let s=t.offsetHeight-window.innerHeight;return s<=0?t.getBoundingClientRect().top<=0?1:0:x(-t.getBoundingClientRect().top/s)},l=s=>{for(let a of p){let r=a.end-a.start,m=r<=0?s>=a.end?1:0:x((s-a.start)/r),u=a.ease(m);a.kind==="draw"?a.el.style.strokeDashoffset=String(a.length*(1-u)):a.el.style.opacity=String(a.from+(a.to-a.from)*u);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return l(1),{destroy:()=>{},getProgress:()=>1};let g=0,i=false,d=false,f=()=>{c=h(),l(c),i&&(g=requestAnimationFrame(f));},b=()=>{i||(i=true,g=requestAnimationFrame(f));},v=()=>{i=false,cancelAnimationFrame(g);},M=new IntersectionObserver(s=>{for(let a of s)d=a.isIntersecting,d?b():v();},{threshold:0});M.observe(o),c=h(),l(c),k(t,{type:"draw",getProgress:()=>c,getTrigger:()=>{let s=t.getBoundingClientRect().top+window.scrollY;return {tStart:s,tEnd:s+Math.max(0,t.offsetHeight-window.innerHeight)}}});let L=I(s=>{s&&(L(),v(),M.disconnect(),S(t),c=1,l(1));});return {destroy(){L(),v(),M.disconnect(),S(t);},getProgress:()=>c}}};
2
+ exports.Cinematic=C;
@@ -1 +1 @@
1
- export{a as Cinematic}from'../chunk-KGAJQP2N.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as Cinematic}from'../chunk-N6PDF6O6.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';