svg-scroll-draw 2.23.4 → 2.23.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.d.mts +3 -3
- package/dist/angular/index.d.ts +3 -3
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +2 -2
- package/dist/astro/index.d.mts +3 -3
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +190 -265
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/{chunk-DSFD227B.mjs → chunk-22B37AWY.mjs} +1 -1
- package/dist/{chunk-YNNA33A5.mjs → chunk-BSW7W2Y5.mjs} +1 -1
- package/dist/{chunk-XTPAW6XR.mjs → chunk-CZLUBJAI.mjs} +1 -1
- package/dist/chunk-K6VATIJH.mjs +3 -0
- package/dist/chunk-NV6YTPHI.mjs +1 -0
- package/dist/chunk-NYQJPPMP.mjs +1 -0
- package/dist/{chunk-ZNCZYV3Q.mjs → chunk-OSGWGHQJ.mjs} +1 -1
- package/dist/chunk-PAGN26EH.mjs +1 -0
- package/dist/chunk-THPTANES.mjs +1 -0
- package/dist/{chunk-OJFWQ6CU.mjs → chunk-V3Z6G5JE.mjs} +1 -1
- package/dist/chunk-VJ5ZU55P.mjs +1 -0
- package/dist/chunk-XNM3VKEK.mjs +1 -0
- package/dist/cinematic/index.cjs +2 -2
- package/dist/cinematic/index.mjs +1 -1
- package/dist/{engine-B7UpB4fT.d.ts → engine-6VsjEwzb.d.ts} +1 -1
- package/dist/{engine-o1VSQ1lX.d.mts → engine-BLWKCfxC.d.mts} +1 -1
- package/dist/group/index.cjs +3 -3
- package/dist/group/index.d.mts +3 -3
- package/dist/group/index.d.ts +3 -3
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +1 -1
- package/dist/horizontal/index.d.ts +1 -1
- package/dist/horizontal/index.mjs +1 -1
- package/dist/{index-D3o4vT3e.d.ts → index-BN8yKeQ3.d.ts} +1 -1
- package/dist/{index-BY-CNE8c.d.mts → index-DAiRJgtF.d.mts} +2 -2
- package/dist/{index-CdaBYn3A.d.mts → index-DVjblK_4.d.mts} +1 -1
- package/dist/{index-DqXXiDIk.d.ts → index-hSQqLVbg.d.ts} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.mts +3 -3
- package/dist/nuxt/index.d.ts +3 -3
- package/dist/nuxt/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.d.mts +1 -1
- package/dist/progress/index.d.ts +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.mts +3 -3
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +1 -1
- package/dist/reveal/index.d.ts +1 -1
- package/dist/reveal/index.mjs +1 -1
- package/dist/{scroll-draw-DsBMkwrX.d.ts → scroll-draw-BsU_Ohmu.d.ts} +1 -1
- package/dist/{scroll-draw-Dej-GIRP.d.mts → scroll-draw-Fzir8hlU.d.mts} +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.d.mts +1 -1
- package/dist/snap/index.d.ts +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.d.mts +3 -3
- package/dist/solid/index.d.ts +3 -3
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.d.mts +3 -3
- package/dist/svelte/index.d.ts +3 -3
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.d.mts +1 -1
- package/dist/text/index.d.ts +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +9 -9
- package/dist/timeline/index.d.mts +1 -1
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.mjs +8 -8
- package/dist/{types-MswK0erX.d.mts → types-9bcJdVcg.d.mts} +6 -2
- package/dist/{types-MswK0erX.d.ts → types-9bcJdVcg.d.ts} +6 -2
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.mts +1 -1
- package/dist/video/index.d.ts +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.d.mts +3 -3
- package/dist/vue/index.d.ts +3 -3
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-6TWFLRUB.mjs +0 -3
- package/dist/chunk-A4JCC3QQ.mjs +0 -1
- package/dist/chunk-DM6EDKWH.mjs +0 -1
- package/dist/chunk-I73SOXBN.mjs +0 -1
- package/dist/chunk-NLPSVYFP.mjs +0 -1
- package/dist/chunk-OPXWNJBG.mjs +0 -1
- package/dist/chunk-QFSTKVA3.mjs +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var SvgScrollDraw=(()=>{var
|
|
2
|
-
<div style="position:absolute;${
|
|
3
|
-
<div style="position:absolute;${m?`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 Xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Cr(e,t,r){if(!!1)return;let n=(e.match(Zt)??[]).join("").toUpperCase(),s=(t.match(Zt)??[]).join("").toUpperCase(),i=(e.match(Xt)??[]).length,c=(t.match(Xt)??[]).length;if(n!==s){G(`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!==c&&G(`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.`,r)}function $r(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 c=parseFloat(i),f=n[s++]??c;return String(+(c+(f-c)*r).toFixed(4))})}function mt(e,t={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(t,(r,n)=>Ir(e,r,n))}function Ir(e,t,r){let{preset:n,...s}=t,i=n?{...st[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:f=1,fade:m=!1,easing:p="linear",trigger:v={},stagger:T=0,direction:b="forward",once:K=!1,debug:fe=!1,axis:I="y",scrollContainer:E,autoReverse:A=!1,delay:d=0,strokeColor:w,strokeWidth:h,fillOpacity:F,waypoints:O,velocityScale:C=!1,threshold:V=0,rootMargin:Ce="0px",repeat:ge=0,repeatDelay:he=0,morphTo:B,clip:oe,autoplay:Se=!1,duration:Ne=1e3,native:Fe=!0,onProgress:le,onStart:z,onComplete:H,onEnter:S,onLeave:L,onEnterBack:be,onLeaveBack:Ve}=i,q=oe===!0?"left":typeof oe=="string"?oe:!1,j=typeof p=="function"?p:J[p]??J.linear,He=Pe(v.start||"top bottom"),we=Pe(v.end||"bottom top"),ee=typeof E=="string"?document.querySelector(E):E??null,xe=Array.isArray(w)?w[0]:null,pe=Array.isArray(w)?w[1]:typeof w=="string"?w:null,ve=Array.isArray(h)?h[0]:null,Te=Array.isArray(h)?h[1]:typeof h=="number"?h:null,de=Array.isArray(F)?F[0]:null,$e=Array.isArray(F)?F[1]:typeof F=="number"?F:null;function Ae(o){let a=o*100;switch(q){case"right":return`inset(0 0 0 ${100-a}%)`;case"top":return`inset(0 0 ${100-a}% 0)`;case"bottom":return`inset(${100-a}% 0 0 0)`;case"center":return`circle(${o*150}% at 50% 50%)`;default:return`inset(0 ${100-a}% 0 0)`}}let P=q?[]:Array.from(e.querySelectorAll(c)),se=[],ce=[],Q=0,_=0,_e=T,Ze=0,R=!1,l=!1,u=0,ye=!1,te=-1,W=[],N=-1,y=!1,U=0,ie=0,Ie,gt=null;function Pt(){gt?.destroy(),gt=null}let De=new Set,kt=NaN,Oe=!0,Je=-1,Ct=performance.now(),ze=NaN;function Be(){return ee?I==="x"?ee.scrollLeft:ee.scrollTop:I==="x"?window.scrollX:window.scrollY}function $t(){return ee?I==="x"?ee.clientWidth:ee.clientHeight:I==="x"?window.innerWidth:window.innerHeight}function It(){let o=rt(e,ee,I);return Re(o,o.scroll,$t(),He,we)}function lr(){let o=_-Q,a=P.length-1,g=ee??document.documentElement,M=I==="x"?"Width":"Height";if(_e=T,T>0&&a>0&&o>0){let re=g[`scroll${M}`]-g[`client${M}`]-1-Q-o/f;re>=0&&(_e=Math.min(T,re/(a*o)))}Ze=_+a*_e*o}function Dt(){({tStart:Q,tEnd:_}=It()),lr(),fe&&!1&&(Pt(),gt=kr(Q,_,I))}function yt(o,a=It){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let g=o.destroy;return o.destroy=()=>{g.call(o),Ee(e)},o}function Ot(o,a){return K&&!A?Math.max(te,j(W[o]=Math.max(W[o]??0,a))):j(a)}function cr(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),q){let g=a==="reverse"?1-o:o;e.style.clipPath=Ae(g);return}P.forEach((g,M)=>ht(g,M,o,a))}function ht(o,a,g,M){o.style.strokeDashoffset=M==="reverse"?`${se[a]*g}`:`${se[a]*(1-g)}`,m&&(o.style.opacity=M==="reverse"?`${1-g}`:`${g}`),xe&&pe?o.style.stroke=ot(xe,pe,g):pe&&(o.style.stroke=pe),ve!==null&&Te!==null?o.style.strokeWidth=`${ve+(Te-ve)*g}`:Te!==null&&(o.style.strokeWidth=`${Te}`),de!==null&&$e!==null?o.style.fillOpacity=`${de+($e-de)*g}`:$e!==null&&(o.style.fillOpacity=`${$e}`),B&&o.tagName.toLowerCase()==="path"&&ce[a]&&o.setAttribute("d",$r(ce[a],B,g))}function je(){if(e.style.setProperty("--scroll-draw-progress","0"),q){e.style.clipPath=Ae(b==="reverse"?1:0);return}P.forEach((o,a)=>{o.style.strokeDasharray=`${se[a]}`,o.style.strokeDashoffset=b==="reverse"?"0":`${se[a]}`,m?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",xe&&(o.style.stroke=xe),ve!==null&&(o.style.strokeWidth=`${ve}`),de!==null&&(o.style.fillOpacity=`${de}`),B&&o.tagName.toLowerCase()==="path"&&ce[a]&&o.setAttribute("d",ce[a])})}function Qe(o,a){let g=o.getAttribute("d"),M=nt(o);if(B&&ce[a]){o.setAttribute("d",B);let re=nt(o);o.setAttribute("d",ce[a]),M=Math.max(nt(o),re),o.setAttribute("d",g)}se[a]=M,o.style.strokeDasharray=`${M}`}if(P.forEach((o,a)=>{Pr(o);let g=o.tagName.toLowerCase()==="path";g?ce.push(o.getAttribute("d")??""):ce.push(""),Qe(o,a);let M=se[a];B&&(g?Cr(ce[ce.length-1],B,o):G(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),r?(o.style.strokeDashoffset=b==="reverse"?`${M}`:"0",m&&(o.style.opacity="1"),pe&&(o.style.stroke=pe),Te!==null&&(o.style.strokeWidth=`${Te}`),$e!==null&&(o.style.fillOpacity=`${$e}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDashoffset=b==="reverse"?"0":`${M}`,m?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",xe&&(o.style.stroke=xe),ve!==null&&(o.style.strokeWidth=`${ve}`),de!==null&&(o.style.fillOpacity=`${de}`))}),r)return q&&(e.style.clipPath=Ae(1)),H?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};q&&(e.style.clipPath=Ae(b==="reverse"?1:0));let Rt=typeof p=="string"?it(p):null;function ur(){return!(Fe===!1||Se||fe&&!1||!Lr()||!P.length||!Rt||q||I!=="y"||ee||f!==1||T!==0||K||A||C!==!1||B||O||ge||d>0||le||z||H||S||L||be||Ve||w!=null||h!=null||F!=null||(v.start||"top bottom").trim()!=="top bottom"||(v.end||"bottom top").trim()!=="bottom top")}function mr(){let o=++Mr,a=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,M=`--svg-scroll-draw-${o}`,re=b==="reverse"?"0":"var(--ssd-len)",Me=b==="reverse"?"var(--ssd-len)":"0",ue=`stroke-dashoffset:${re};`,$=`stroke-dashoffset:${Me};`;m&&(ue+=`opacity:${b==="reverse"?1:0};`,$+=`opacity:${b==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${a}{from{${ue}}to{${$}}}.${g}{view-timeline-name:${M};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Rt};animation-fill-mode:both;animation-timeline:${M};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(g);function Y(x,k){x.style.setProperty("--ssd-len",String(se[k])),x.style.strokeDasharray=`${se[k]}`,x.style.strokeDashoffset="",x.style.opacity="",x.style.animationPlayState="",x.classList.add(a)}P.forEach(Y);let X=!1,ae=-1;function me(){if(ae>=0)return ae;let x=e.getBoundingClientRect(),{tStart:k,tEnd:Z}=Re({top:x.top,height:x.height},Be(),$t(),He,we);return j(ne(Be(),k,Z,f))}return{destroy(){e.classList.remove(g),P.forEach(x=>{x.classList.remove(a),x.style.removeProperty("--ssd-len"),x.style.animationPlayState=""}),D.remove()},replay(){X=!1,ae=-1,P.forEach(Y)},pause(){X=!0,P.forEach(x=>{x.style.animationPlayState="paused"})},resume(){X&&(X=!1,P.forEach(x=>{x.style.animationPlayState="running"}))},seek(x){let k=Math.min(1,Math.max(0,x));ae=k,X=!0,P.forEach((Z,Le)=>{Z.classList.remove(a),Z.style.strokeDashoffset=b==="reverse"?`${se[Le]*k}`:`${se[Le]*(1-k)}`,m&&(Z.style.opacity=b==="reverse"?`${1-k}`:`${k}`)})},getProgress(){return me()},refresh(){P.forEach((x,k)=>{Qe(x,k),x.style.setProperty("--ssd-len",String(se[k]))})}}}if(ur())return yt(mr());function fr(){let o=Math.max(1,Ne),a=q?o:o*(1+Math.max(0,P.length-1)*T),g=0,M=0,re=!1;function Me(ae){let me=!0,x=Math.min(1,Math.max(0,ae/a));if(q){let k=Math.min(1,Math.max(0,ae/o)),Z=j(k);U=Z,e.style.setProperty("--scroll-draw-progress",String(Z)),e.style.clipPath=Ae(b==="reverse"?1-Z:Z),le?.(Z),k<1&&(me=!1)}else{P.forEach((Z,Le)=>{let dr=Le*T*o,Ht=Math.min(1,Math.max(0,(ae-dr)/o));ht(Z,Le,j(Ht),b),Ht<1&&(me=!1)});let k=j(x);U=k,le?.(k),e.style.setProperty("--scroll-draw-progress",String(k))}if(O){let k=j(x);for(let Z in O){let Le=parseFloat(Z);k>=Le&&!De.has(Le)&&(De.add(Le),O[Z]?.())}}return me}function ue(ae){if(y)return;let me=ae-g;l||(l=!0,z?.());let x=Me(me);if(x&&!R){R=!0,Me(a),H?.(),ie<(ge==="infinite"?1/0:ge??0)&&(ie++,Ie=setTimeout(()=>{g=performance.now(),l=!1,R=!1,De.clear(),je(),u=requestAnimationFrame(ue)},he));return}x||(u=requestAnimationFrame(ue))}function $(){cancelAnimationFrame(u),clearTimeout(Ie),g=performance.now(),M=0,y=!1,l=!1,R=!1,ie=0,re=!0,U=0,De.clear(),je(),u=requestAnimationFrame(ue)}let D=new IntersectionObserver(ae=>{ae.forEach(me=>{me.isIntersecting&&!(K&&R)?$():!me.isIntersecting&&!K&&!R&&(cancelAnimationFrame(u),clearTimeout(Ie),re=!1)})},{root:ee??null,threshold:V,rootMargin:Ce}),Y;function X(){clearTimeout(Y),Y=setTimeout(()=>P.forEach(Qe),150)}return window.addEventListener("resize",X),window.addEventListener("orientationchange",X),d>0?setTimeout(()=>D.observe(e),d):D.observe(e),{destroy(){cancelAnimationFrame(u),clearTimeout(Ie),D.disconnect(),window.removeEventListener("resize",X),window.removeEventListener("orientationchange",X),clearTimeout(Y)},replay(){ie=0,$()},pause(){y||!re||(y=!0,M=performance.now()-g,cancelAnimationFrame(u))},resume(){y&&(y=!1,re=!0,g=performance.now()-M,u=requestAnimationFrame(ue))},seek(ae){let me=Math.min(1,Math.max(0,ae));U=me,y=!0,M=me*a,g=performance.now()-M,cancelAnimationFrame(u),Me(M)},getProgress(){return U},refresh(){clearTimeout(Y),P.forEach(Qe)}}}if(Se)return yt(fr());Dt();function Nt(){if(y||!qe)return;let o=performance.now(),a=Be();if(!Oe&&C===!1&&a===kt){wt(a);return}Oe=!1,kt=a;let g=f;if(C!==!1){let $=o-Ct,D=$>0?Math.abs(a-(Je<0?a:Je))/$:0;g=f*Math.max(.2,1+D*(typeof C=="number"?C:1)*.04)}Je=a,Ct=o;let M=A?N===-1||a>=N?"forward":"reverse":b;N=a;let re=_-Q,Me=!0,ue=re===0?0:(a-Q)/re;if(isNaN(ze)||(ze<=0&&ue>0?S?.():ze>0&&ue<=0&&Ve?.(),ze<1&&ue>=1?L?.():ze>=1&&ue<1&&be?.()),ze=ue,q){let $=Ot(0,ne(a,Q,_,g));U=$,e.style.setProperty("--scroll-draw-progress",String($));let D=M==="reverse"?1-$:$;e.style.clipPath=Ae(D),le?.($),!l&&ne(a,Q,_,g)>0&&(l=!0,z?.()),$>=1&&!R?(R=!0,H?.(),ie<(ge==="infinite"?1/0:ge??0)&&(ie++,Ie=setTimeout(()=>{te=-1,W=[],l=!1,R=!1,je()},he))):$<1&&!K&&(R=!1),wt(a);return}if(P.forEach(($,D)=>{let Y=D*_e*re,X=Ot(D,ne(a,Q+Y,_+Y,g));ht($,D,X,M),D===0&&(U=X,le?.(X),e.style.setProperty("--scroll-draw-progress",String(X))),X<1&&(Me=!1)}),O){let $=j(ne(a,Q,_,g));for(let D in O){let Y=parseFloat(D);$>=Y&&!De.has(Y)&&(De.add(Y),O[D]?.())}}!l&&ne(a,Q,_,g)>0&&(l=!0,z?.()),Me&&!R?(R=!0,H?.(),ie<(ge==="infinite"?1/0:ge??0)&&(ie++,Ie=setTimeout(()=>{te=-1,W=[],l=!1,R=!1,De.clear(),je(),Oe=!0},he))):!Me&&!K&&(R=!1),wt(a)}function bt(o){return o>=_&&o<Ze}function wt(o){ye||bt(o)?u=requestAnimationFrame(Nt):qe=!1}function vt(){return ye||bt(Be())}let qe=!1;function Ke(){qe||(qe=!0,u=requestAnimationFrame(function(){Nt()}))}function et(){qe=!1,cancelAnimationFrame(u)}let Et=new IntersectionObserver(o=>{o.forEach(a=>{ye=a.isIntersecting,ye&&!y?(Oe=!0,Ke()):qe&&!y&&bt(Be())||et()})},{root:ee??null,threshold:V,rootMargin:Ce});function Ft(){P.forEach(Qe),Dt(),Oe=!0}let tt;function Ue(){clearTimeout(tt),tt=setTimeout(Ft,150)}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let pr=We([e],Ue);return d>0?setTimeout(()=>Et.observe(e),d):Et.observe(e),yt({destroy(){cancelAnimationFrame(u),clearTimeout(Ie),et(),Et.disconnect(),pr(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(tt),Pt()},replay(){te=-1,W=[],N=-1,Je=-1,l=!1,R=!1,ie=0,y=!1,U=0,De.clear(),clearTimeout(Ie),je(),Oe=!0,vt()&&Ke()},pause(){y=!0,et()},resume(){y&&(y=!1,Oe=!0,vt()&&Ke())},seek(o){let a=Math.min(1,Math.max(0,o));U=a,te=a,W=[],y=!0,et(),cr(a,b),Oe=!0},getProgress(){return U},refresh(){clearTimeout(tt),Ft(),vt()&&!y&&Ke()}},()=>({tStart:Q,tEnd:_}))}function Jt(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?mt(n,t):(G("Container not found:",e),r)}function Dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Kt(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let s=[],i=[],c=n[2].trim();if(c)for(let f of c.split(/[\s,]+/)){let m=f.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),i.push(m?m[2]:"")}t.push({fn:n[1],nums:s,units:i})}return t}function Or(e,t,r){let n=Kt(e),s=Kt(t);return n.length===0||n.length!==s.length?r<1?e:t:n.map((i,c)=>{let f=s[c];return i.fn!==f.fn||i.nums.length!==f.nums.length?r<1?`${i.fn}(${i.nums.map((m,p)=>`${m}${i.units[p]}`).join(", ")})`:`${f.fn}(${f.nums.map((m,p)=>`${m}${f.units[p]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,p)=>`${m+(f.nums[p]-m)*r}${i.units[p]}`).join(", ")})`}).join(" ")}function er(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),s=String(t);if(Dr(n))return ot(n,s,r);if(n.includes("("))return Or(n,s,r);let i=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&c){let f=parseFloat(i[1]),m=parseFloat(c[1]);return`${f+(m-f)*r}${i[2]||c[2]}`}return r<1?n:s}function Rr(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Nr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fr=0,tr="--scroll-draw-progress";function Hr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var nr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function At(e,t){return typeof window>"u"?nr:t.respectReducedMotion===!1?rr(e,t,!1):Ge(t,(r,n)=>rr(e,r,n))}function rr(e,t,r){let{props:n,trigger:s={},easing:i="ease-out",speed:c=1,once:f=!1,axis:m="y",scrollContainer:p,native:v=!0,velocityScale:T=!1,triggerElement:b,onProgress:K,onComplete:fe,onEnter:I,onLeave:E,onEnterBack:A,onLeaveBack:d}=t,w=typeof i=="function"?i:J[i]??J["ease-out"],h=Pe(s.start||"top bottom"),F=Pe(s.end||"bottom top"),O=b??e,C=typeof p=="string"?document.querySelector(p):p??null,V=Object.entries(n).map(([l,u])=>({prop:Rr(l),from:Array.isArray(u)?u[0]:"",to:Array.isArray(u)?u[1]:u}));function Ce(){let l=window.getComputedStyle(e);for(let u of V)u.from===""&&(u.from=l.getPropertyValue(u.prop).trim()||"0")}function ge(){for(let l of V)e.style.setProperty(l.prop,String(l.to))}let he=new Map;for(let l of[...V.map(u=>u.prop),tr])he.set(l,e.style.getPropertyValue(l));function B(){for(let[l,u]of he)u?e.style.setProperty(l,u):e.style.removeProperty(l)}if(r)return ge(),fe?.(),{...nr,destroy:B,getProgress:()=>1};Ce();let oe=()=>C?m==="x"?C.scrollLeft:C.scrollTop:m==="x"?window.scrollX:window.scrollY,Se=()=>C?m==="x"?C.clientWidth:C.clientHeight:m==="x"?window.innerWidth:window.innerHeight,Ne=typeof i=="string"?it(i):null;function Fe(){if(!v||!Hr()||!Ne||m!=="y"||C||O!==e||f||c!==1||K||fe||I||E||A||d||T!==!1||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return!1;for(let l of V)if(!Nr.has(l.prop))return!1;return!0}function le(){let l=`ssd-a-${++Fr}`,u=V.map(y=>`${y.prop}:${y.from}`).join(";"),ye=V.map(y=>`${y.prop}:${y.to}`).join(";"),te=document.createElement("style");te.setAttribute("data-ssd-animate",""),te.textContent=`@keyframes ${l}{from{${u}}to{${ye}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ne};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(te),e.classList.add(l);let W=()=>{let y=e.getBoundingClientRect();return Re({top:y.top,height:y.height},oe(),Se(),h,F)};ke(e,{type:"animate",getProgress:()=>N.getProgress(),getTrigger:W});let N={refresh(){},destroy(){e.classList.remove(l),te.remove(),e.style.animationPlayState="",B(),Ee(e)},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l)},pause(){e.style.animationPlayState="paused"},resume(){e.style.animationPlayState=""},seek(y){let U=Math.min(1,Math.max(0,y));e.classList.remove(l);for(let ie of V)e.style.setProperty(ie.prop,er(ie.from,ie.to,U))},getProgress(){let{tStart:y,tEnd:U}=W();return w(ne(oe(),y,U,c))}};return N}if(Fe())return le();let z=0,H=0,S=0,L=NaN,be=!1,Ve=-1,q=0,j=0,He=!1,we=NaN,ee=-1,xe=0,pe=O===e?V:[],ve=!1;function Te(){let l=e.style,u=pe.map(N=>l.getPropertyValue(N.prop)),ye=l.transition;pe.length&&(l.transition="none"),pe.forEach(N=>l.setProperty(N.prop,he.get(N.prop)??""));let te=rt(O,C,m);pe.forEach((N,y)=>l.setProperty(N.prop,u[y])),pe.length&&(e.offsetWidth,l.transition=ye);let W=Re(te,te.scroll,Se(),h,F);ve&&Math.abs(W.tStart-z)<1&&Math.abs(W.tEnd-H)<1||(ve=!0,z=W.tStart,H=W.tEnd)}function de(l){e.style.setProperty(tr,String(l));for(let u of V)e.style.setProperty(u.prop,er(u.from,u.to,l));K?.(l)}function $e(l){if(isNaN(we)){we=l;return}we<=0&&l>0?I?.():we>0&&l<=0&&d?.(),we<1&&l>=1?E?.():we>=1&&l<1&&A?.(),we=l}let Ae=l=>ne(l,z,H,Math.min(c,1));function P(){!S&&!be&&Ae(oe())!==L&&(S=requestAnimationFrame(se))}function se(){if(be)return;let l=performance.now(),u=oe(),ye=c;if(T!==!1){let y=l-xe,U=y>0?Math.abs(u-(ee<0?u:ee))/y:0;ye=c*Math.max(.2,1+U*(typeof T=="number"?T:1)*.04)}ee=u,xe=l;let te=H===z?0:(u-z)/(H-z);$e(te);let W=ne(u,z,H,ye),N=f?Math.max(Ve,w(q=Math.max(q,W))):w(W);j=N,de(N),N>=1&&!He?(He=!0,fe?.()):N<1&&!f&&(He=!1),!be&&(L=Ae(u),S=L>0&&L<1?requestAnimationFrame(se):0)}Te(),H===z&&G("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),q=ne(oe(),z,H,c),j=w(q),de(j);function ce(){Te(),P()}let Q;function _(){clearTimeout(Q),Q=setTimeout(ce,150)}let _e=C??window;_e.addEventListener("scroll",P,{passive:!0}),window.addEventListener("resize",_),window.addEventListener("orientationchange",_);let Ze=We([O],_);P(),ke(e,{type:"animate",getProgress:()=>j,getTrigger:()=>({tStart:z,tEnd:H})});function R(){be=!0,cancelAnimationFrame(S),S=0,L=NaN}return{destroy(){R(),_e.removeEventListener("scroll",P),window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_),Ze(),clearTimeout(Q),B(),Ee(e)},replay(){Ve=-1,q=0,He=!1,j=0,be=!1,de(0),L=0,P()},pause:R,resume(){be&&(be=!1,P())},seek(l){let u=Math.min(1,Math.max(0,l));j=u,Ve=u,q=0,R(),de(u)},getProgress(){return j},refresh:ce}}var ft={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function or(e,t){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;return r?At(r,t):(G("scrollAnimate: element not found:",e),ft)}function sr(e,t={}){if(typeof window>"u")return ft;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return G("scrollParallax: element not found:",e),ft;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:c,onProgress:f}=t,m=-n*100,p=r.style,v=!!r.ownerSVGElement,T=p.getPropertyValue("transform-box");v&&p.setProperty("transform-box","fill-box");let b=At(r,{props:s==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:i,native:!1,onProgress:f});return v?{...b,destroy(){b.destroy(),p.setProperty("transform-box",T)}}:b}var Mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ir(e,t){if(typeof window>"u")return Mt;let r=typeof e=="string"?document.querySelector(e):e;return r?Ge(t,(n,s)=>_r(r,n,s)):(G("scrollCounter: element not found:",e),Mt)}function _r(e,t,r){let{from:n=0,to:s,format:i,easing:c="ease-out",trigger:f={},once:m=!0,decimals:p,onComplete:v}=t,T=p!==void 0?S=>S.toFixed(p):i??(S=>String(Math.round(S))),b=typeof c=="function"?c:J[c]??J["ease-out"],K=Pe(f.start||"top 80%"),fe=Pe(f.end||"top 20%");if(r)return e.textContent=T(s),v?.(),{...Mt,getProgress:()=>1};let I=0,E=0,A=!1,d=0,w=!1,h=!1,F=-1,O=0,C=0,V=!1,Ce=()=>window.scrollY,ge=()=>window.innerHeight;function he(){let S=e.getBoundingClientRect(),L=Re({top:S.top,height:S.height},Ce(),ge(),K,fe);A&&Math.abs(L.tStart-I)<1&&Math.abs(L.tEnd-E)<1||(A=!0,I=L.tStart,E=L.tEnd)}let B=e.style.getPropertyValue("--scroll-draw-progress");function oe(S){e.textContent=T(n+(s-n)*S),e.style.setProperty("--scroll-draw-progress",String(S))}function Se(){if(!w||h)return;let S=ne(Ce(),I,E,1),L=m?Math.max(F,b(O=Math.max(O,S))):b(S);C=L,oe(L),L>=1&&!V?(V=!0,v?.()):L<1&&!m&&(V=!1),d=requestAnimationFrame(Se)}he();{O=ne(Ce(),I,E,1);let S=b(O);C=S,oe(S)}let Ne=new IntersectionObserver(S=>{S.forEach(L=>{w=L.isIntersecting,w&&!h?d=requestAnimationFrame(Se):cancelAnimationFrame(d)})}),Fe;function le(){clearTimeout(Fe),Fe=setTimeout(he,150)}window.addEventListener("resize",le),window.addEventListener("orientationchange",le);let z=We([e],le);Ne.observe(e),ke(e,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:I,tEnd:E})});function H(){h&&(h=!1,w&&(d=requestAnimationFrame(Se)))}return{destroy(){cancelAnimationFrame(d),Ne.disconnect(),window.removeEventListener("resize",le),window.removeEventListener("orientationchange",le),z(),clearTimeout(Fe),e.style.setProperty("--scroll-draw-progress",B),Ee(e)},replay(){F=-1,O=0,V=!1,C=0,oe(0),H()},pause(){h=!0,cancelAnimationFrame(d)},resume:H,seek(S){let L=Math.min(1,Math.max(0,S));C=L,F=L,O=0,h=!0,cancelAnimationFrame(d),oe(L)},getProgress(){return C}}}var ar="http://www.w3.org/2000/svg",Vr="cinematic-photo",Lt=e=>e<0?0:e>1?1:e;function pt(e){let t=parseFloat(e);return Number.isFinite(t)?Lt(t/100):0}function zr(e){return J[e]??J.linear}var qr={destroy:()=>{},getProgress:()=>0},dt=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||G("Cinematic: wrapper not found:",t.wrapper)}loadStory(t){let r=this.mount;if(typeof window>"u"||!r)return qr;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 E of t.scenes){if(E.background){let d=document.createElement("img");d.id=Vr,d.src=E.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 A=E.animations.filter(d=>d.type==="draw");if(A.length){let d=document.createElementNS(ar,"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 w of A){let h=document.createElementNS(ar,"path");h.id=w.target.replace(/^#/,""),h.setAttribute("d",w.d),h.setAttribute("fill","none"),h.setAttribute("stroke",w.stroke),h.setAttribute("stroke-width",String(w.strokeWidth)),h.setAttribute("stroke-linecap","round"),h.setAttribute("stroke-linejoin","round");let F=w.length||h.getTotalLength?.()||0;h.style.strokeDasharray=String(F),h.style.strokeDashoffset=String(F),d.appendChild(h),s.push({kind:"draw",el:h,start:pt(w.start),end:pt(w.end),ease:zr(w.easing),length:F})}}for(let d of E.animations){if(d.type!=="fade")continue;let w=n.querySelector(d.target)??document.querySelector(d.target);w&&(w.style.opacity=String(d.from),s.push({kind:"fade",el:w,start:pt(d.start),end:pt(d.end),ease:J["ease-in-out"]??J.linear,from:d.from,to:d.to}))}}let i=0,c=()=>{let E=r.offsetHeight-window.innerHeight;return E<=0?r.getBoundingClientRect().top<=0?1:0:Lt(-r.getBoundingClientRect().top/E)},f=E=>{for(let A of s){let d=A.end-A.start,w=d<=0?E>=A.end?1:0:Lt((E-A.start)/d),h=A.ease(w);A.kind==="draw"?A.el.style.strokeDashoffset=String(A.length*(1-h)):A.el.style.opacity=String(A.from+(A.to-A.from)*h)}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return f(1),{destroy:()=>{},getProgress:()=>1};let m=0,p=!1,v=!1,T=()=>{i=c(),f(i),p&&(m=requestAnimationFrame(T))},b=()=>{p||(p=!0,m=requestAnimationFrame(T))},K=()=>{p=!1,cancelAnimationFrame(m)},fe=new IntersectionObserver(E=>{for(let A of E)v=A.isIntersecting,v?b():K()},{threshold:0});fe.observe(n),i=c(),f(i),ke(r,{type:"draw",getProgress:()=>i,getTrigger:()=>{let E=r.getBoundingClientRect().top+window.scrollY;return{tStart:E,tEnd:E+Math.max(0,r.offsetHeight-window.innerHeight)}}});let I=ct(E=>{E&&(I(),K(),fe.disconnect(),Ee(r),i=1,f(1))});return{destroy(){I(),K(),fe.disconnect(),Ee(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(T=>this.getAttribute(T)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},c=this.getAttribute("speed"),f=this.getAttribute("easing"),m=this.getAttribute("stagger"),p=this.getAttribute("direction"),v=this.getAttribute("selector");c&&(i.speed=parseFloat(c)),f&&(i.easing=f),m&&(i.stagger=parseFloat(m)),p&&(i.direction=p),v&&(i.selector=v),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=mt(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}t.observedAttributes=e,customElements.define("scroll-draw",t)}return vr(Wr);})();
|
|
1
|
+
"use strict";var SvgScrollDraw=(()=>{var ht=Object.defineProperty;var dr=Object.getOwnPropertyDescriptor;var gr=Object.getOwnPropertyNames;var yr=Object.prototype.hasOwnProperty;var hr=(e,t)=>{for(var r in t)ht(e,r,{get:t[r],enumerable:!0})},br=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of gr(t))!yr.call(e,s)&&s!==r&&ht(e,s,{get:()=>t[s],enumerable:!(n=dr(t,s))||n.enumerable});return e};var wr=e=>br(ht({},"__esModule",{value:!0}),e);var Wr={};hr(Wr,{Cinematic:()=>ct,PRESETS:()=>et,createBounce:()=>wt,createElastic:()=>vt,createSpring:()=>bt,scrollAnimate:()=>nr,scrollCounter:()=>sr,scrollDraw:()=>Zt,scrollParallax:()=>or});function bt({tension:e=2.5,friction:t=2.2}={}){return r=>1-Math.cos(r*Math.PI*e)*Math.pow(1-r,t)}function wt({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,c=[];for(let f=0;f<r;f++){let h=Math.pow(s,f);c.push(h),i+=h}let m=[0],u=0;for(let f=0;f<r;f++)u+=c[f]/i,m.push(u);return f=>{if(f<=0)return 0;if(f>=1)return 1;for(let h=0;h<r;h++)if(f<=m[h+1]){let S=(f-m[h])/(m[h+1]-m[h]);if(h===0)return S*(2-S);let b=1-Math.pow(n,h);return b+(1-b)*(2*S-1)*(2*S-1)}return 1}}function vt({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 U={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:bt(),bounce:wt(),elastic:vt()};function Ht(e,t,r){return Math.min(r,Math.max(t,e))}function Te(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}}var Vt=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function Ft(e,t,r,n){return e+r+t*Vt(n,0)}function _t(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Vt(e,1))}function X(e,t,r,n){return r===t?0:Ht((e-t)/(r-t)*n,0,1)}function ke(e,t,r,n,s){let i=Ft(e.top,e.height,t,n.element)-_t(n.viewport,r),c=Ft(e.top,e.height,t,s.element)-_t(s.viewport,r);return{tStart:i,tEnd:c}}function Ze(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.clientLeft+t.scrollLeft:n.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:s,scroll:0}:{top:r==="x"?n.left:n.top,height:s,scroll:r==="x"?window.scrollX:window.scrollY}}function Je(e){let t=parseFloat(e.getAttribute("pathLength")??"");if(t>0)return t;let r=e.tagName.toLowerCase();if(r==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(n+s)}if(r==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function Gt(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 Ke(e,t,r){let n=Gt(e),s=Gt(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 et={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 W(e,...t){}var vr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Sr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Wt=33;function Er(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function xr(e){let t=[];for(let r=0;r<Wt;r++){let n=r/(Wt-1);t.push(String(Math.round(e(n)*1e5)/1e5))}return`linear(${t.join(",")})`}function tt(e){switch(e){case"linear":return"linear";case"ease-in":return vr;case"ease-out":return Sr;case"ease-in-out":return Er()?xr(U["ease-in-out"]):null;default:return null}}var zt=Symbol.for("svg-scroll-draw.registry");function Bt(){let e=globalThis;return e[zt]||(e[zt]=new Map)}function Me(e,t){Bt().set(e,t)}function pe(e){Bt().delete(e)}function rt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),r=s=>e(!!s.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",r),()=>t.removeEventListener("change",r);let n=t;return n.addListener?.(r),()=>n.removeListener?.(r)}function Fe(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,!0);let r=t(e,!1),n=rt(i=>{if(!i)return;n();let c=(r.getProgress?.()??0)>=1;r.destroy(),r=t(c?{...e,onComplete:void 0}:e,!0)}),s={};for(let i of Object.keys(r))s[i]=(...c)=>r[i]?.(...c);return s.destroy=()=>{n(),r.destroy()},s}var qe,nt=new Set,ot=new WeakMap,je=new Map,qt=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Tr(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 jt(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return()=>{};let r=()=>t();qe??(qe=new ResizeObserver(s=>{let i=!1;for(let{target:c}of s)ot.get(c)!==qt(c)&&(i=!0),ot.set(c,"");i&&nt.forEach(c=>c())})),nt.add(r);let n=Tr(e);return[document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{ot.has(s)||ot.set(s,qt(s)),je.set(s,(je.get(s)??0)+1),qe.observe(s)}),()=>{nt.delete(r)&&(n.forEach(s=>{let i=(je.get(s)??1)-1;if(i)return void je.set(s,i);je.delete(s),qe?.unobserve(s)}),nt.size||(qe?.disconnect(),qe=void 0))}}function _e(e,t,r,n,s){let i,c=NaN,m,u,f=()=>{i=0,n(),!m&&!i&&(c=r())>0&&c<1&&(i=requestAnimationFrame(f))},h=()=>{!i&&!m&&r()!==c&&(i=requestAnimationFrame(f))},S=y=>{m=y,cancelAnimationFrame(i),i=c=NaN,h()},b=()=>{clearTimeout(u),s(),h()},O=()=>{clearTimeout(u),u=setTimeout(b,150)},ee=jt(t,O),A=y=>{e[y]("scroll",h,{passive:!0}),window[y]("resize",O),window[y]("orientationchange",O)};return A("addEventListener"),h(),{hold:S,remeasure:b,off(){S(!0),A("removeEventListener"),ee(),clearTimeout(u)}}}var Mr=0;function Ar(){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 Yt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Pr(e){if(!!1)return;let t=Qt(e,"stroke");if(!t||t==="none"){W("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Yt.has(r)&&!Yt.has(Qt(e,"fill"))&&W("Element has a fill \u2014 it may obscure the stroke animation.",e)}function Lr(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,c=e-i,m=t-i,u=r==="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:${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 Ut=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Xt=/[MmLlHhVvCcSsQqTtAaZz]/g;function kr(e,t,r){if(!!1)return;let n=(e.match(Xt)??[]).join("").toUpperCase(),s=(t.match(Xt)??[]).join("").toUpperCase(),i=(e.match(Ut)??[]).length,c=(t.match(Ut)??[]).length;if(n!==s){W(`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!==c&&W(`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.`,r)}function Cr(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 c=parseFloat(i),m=n[s++]??c;return String(+(c+(m-c)*r).toFixed(4))})}function it(e,t={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Fe(t,(r,n)=>$r(e,r,n))}function $r(e,t,r){let{preset:n,...s}=t,i=n?{...et[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:m=1,fade:u=!1,easing:f="linear",trigger:h={},stagger:S=0,direction:b="forward",once:O=!1,debug:ee=!1,axis:A="y",scrollContainer:y,autoReverse:x=!1,delay:g=0,strokeColor:w,strokeWidth:v,fillOpacity:I,waypoints:z,velocityScale:N=!1,threshold:te=0,rootMargin:Ve="0px",repeat:le=0,repeatDelay:de=0,morphTo:B,clip:re,autoplay:Ae=!1,duration:L=1e3,native:H=!0,onProgress:Ce,onStart:Z,onComplete:ne,onEnter:ge,onLeave:Ie,onEnterBack:ye,onLeaveBack:me}=i,J=re===!0?"left":typeof re=="string"?re:!1,q=typeof f=="function"?f:U[f]??U.linear,Re=Te(h.start||"top bottom"),Ge=Te(h.end||"bottom top"),F=typeof y=="string"?document.querySelector(y):y??null,he=Array.isArray(w)?w[0]:null,be=Array.isArray(w)?w[1]:typeof w=="string"?w:null,ce=Array.isArray(v)?v[0]:null,Pe=Array.isArray(v)?v[1]:typeof v=="number"?v:null,we=Array.isArray(I)?I[0]:null,ue=Array.isArray(I)?I[1]:typeof I=="number"?I:null;function ve(o){let l=o*100;switch(J){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 a=J?[]:Array.from(e.querySelectorAll(c)),p=[],_=[],M=0,k=0,R=S,C=0,Le=0,V=!1,Se=!1,Ee=0,ut=-1,Qe=[],Ye=-1,ie=!1,fe=0,$e=0,De,mt=!1,ft=null;function Tt(){ft?.destroy(),ft=null}let Oe=new Set,Mt=NaN,Ne=!0,Ue=-1,At=performance.now(),He=NaN;function Xe(){return F?A==="x"?F.scrollLeft:F.scrollTop:A==="x"?window.scrollX:window.scrollY}function Pt(){return F?A==="x"?F.clientWidth:F.clientHeight:A==="x"?window.innerWidth:window.innerHeight}function Lt(){let o=Ze(e,F,A);return ke(o,o.scroll,Pt(),Re,Ge)}function ar(){let o=k-M,l=a.length-1,d=F??document.documentElement,T=A==="x"?"Width":"Height";if(R=S,S>0&&l>0&&o>0){let j=d[`scroll${T}`]-d[`client${T}`]-1-M-o/m;j>=0&&(R=Math.min(S,j/(l*o)))}let G=Math.max(0,l)*R*o,oe=o/Math.min(m,1);C=M+Math.min(0,G,oe,G+oe),Le=M+Math.max(0,G,oe,G+oe)}function kt(){({tStart:M,tEnd:k}=Lt()),ar(),ee&&!1&&(Tt(),ft=Lr(M,k,A))}function pt(o,l=Lt){Me(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let d=o.destroy;return o.destroy=()=>{d.call(o),pe(e)},o}function Ct(o,l){return O&&!x?Math.max(ut,q(Qe[o]=Math.max(Qe[o]??0,l))):q(l)}function lr(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),J){let d=l==="reverse"?1-o:o;e.style.clipPath=ve(d);return}a.forEach((d,T)=>dt(d,T,o,l))}function dt(o,l,d,T){o.style.strokeDashoffset=T==="reverse"?`${p[l]*d}`:`${p[l]*(1-d)}`,u&&(o.style.opacity=T==="reverse"?`${1-d}`:`${d}`),he&&be?o.style.stroke=Ke(he,be,d):be&&(o.style.stroke=be),ce!==null&&Pe!==null?o.style.strokeWidth=`${ce+(Pe-ce)*d}`:Pe!==null&&(o.style.strokeWidth=`${Pe}`),we!==null&&ue!==null?o.style.fillOpacity=`${we+(ue-we)*d}`:ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&_[l]&&o.setAttribute("d",Cr(_[l],B,d))}function gt(){if(e.style.setProperty("--scroll-draw-progress","0"),J){e.style.clipPath=ve(b==="reverse"?1:0);return}a.forEach((o,l)=>{o.style.strokeDasharray=`${p[l]}`,o.style.strokeDashoffset=b==="reverse"?"0":`${p[l]}`,u?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`),B&&o.tagName.toLowerCase()==="path"&&_[l]&&o.setAttribute("d",_[l])})}function We(o,l){let d=o.getAttribute("d"),T=Je(o);if(B&&_[l]){o.setAttribute("d",B);let G=Je(o);o.setAttribute("d",_[l]),T=Math.max(Je(o),G),o.setAttribute("d",d)}p[l]=T,o.style.strokeDasharray=`${T}`}if(a.forEach((o,l)=>{Pr(o);let d=o.tagName.toLowerCase()==="path";d?_.push(o.getAttribute("d")??""):_.push(""),We(o,l);let T=p[l];B&&(d?kr(_[_.length-1],B,o):W(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),r?(o.style.strokeDashoffset=b==="reverse"?`${T}`:"0",u&&(o.style.opacity="1"),be&&(o.style.stroke=be),Pe!==null&&(o.style.strokeWidth=`${Pe}`),ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDashoffset=b==="reverse"?"0":`${T}`,u?o.style.opacity=b==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`))}),r)return J&&(e.style.clipPath=ve(1)),ne?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};J&&(e.style.clipPath=ve(b==="reverse"?1:0));let $t=typeof f=="string"?tt(f):null;function cr(){return!(H===!1||Ae||ee&&!1||!Ar()||!a.length||!$t||J||A!=="y"||F||m!==1||S!==0||O||x||N!==!1||B||z||le||g>0||Ce||Z||ne||ge||Ie||ye||me||w!=null||v!=null||I!=null||(h.start||"top bottom").trim()!=="top bottom"||(h.end||"bottom top").trim()!=="bottom top")}function ur(){let o=++Mr,l=`svg-scroll-draw-${o}`,d=`svg-scroll-draw-host-${o}`,T=`--svg-scroll-draw-${o}`,G=b==="reverse"?"0":"var(--ssd-len)",oe=b==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${G};`,$=`stroke-dashoffset:${oe};`;u&&(j+=`opacity:${b==="reverse"?1:0};`,$+=`opacity:${b==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${l}{from{${j}}to{${$}}}.${d}{view-timeline-name:${T};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${$t};animation-fill-mode:both;animation-timeline:${T};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(d);function K(E,P){E.style.setProperty("--ssd-len",String(p[P])),E.style.strokeDasharray=`${p[P]}`,E.style.strokeDashoffset="",E.style.opacity="",E.style.animationPlayState="",E.classList.add(l)}a.forEach(K);let Q=!1,se=-1;function ae(){if(se>=0)return se;let E=e.getBoundingClientRect(),{tStart:P,tEnd:Y}=ke({top:E.top,height:E.height},Xe(),Pt(),Re,Ge);return q(X(Xe(),P,Y,m))}return{destroy(){e.classList.remove(d),a.forEach(E=>{E.classList.remove(l),E.style.removeProperty("--ssd-len"),E.style.animationPlayState=""}),D.remove()},replay(){Q=!1,se=-1,a.forEach(K)},pause(){Q=!0,a.forEach(E=>{E.style.animationPlayState="paused"})},resume(){Q&&(Q=!1,a.forEach(E=>{E.style.animationPlayState="running"}))},seek(E){let P=Math.min(1,Math.max(0,E));se=P,Q=!0,a.forEach((Y,xe)=>{Y.classList.remove(l),Y.style.strokeDashoffset=b==="reverse"?`${p[xe]*P}`:`${p[xe]*(1-P)}`,u&&(Y.style.opacity=b==="reverse"?`${1-P}`:`${P}`)})},getProgress(){return ae()},refresh(){a.forEach((E,P)=>{We(E,P),E.style.setProperty("--ssd-len",String(p[P]))})}}}if(cr())return pt(ur());function mr(){let o=Math.max(1,L),l=J?o:o*(1+Math.max(0,a.length-1)*S),d=0,T=0,G=!1;function oe(se){let ae=!0,E=Math.min(1,Math.max(0,se/l));if(J){let P=Math.min(1,Math.max(0,se/o)),Y=q(P);fe=Y,e.style.setProperty("--scroll-draw-progress",String(Y)),e.style.clipPath=ve(b==="reverse"?1-Y:Y),Ce?.(Y),P<1&&(ae=!1)}else{a.forEach((Y,xe)=>{let pr=xe*S*o,Nt=Math.min(1,Math.max(0,(se-pr)/o));dt(Y,xe,q(Nt),b),Nt<1&&(ae=!1)});let P=q(E);fe=P,Ce?.(P),e.style.setProperty("--scroll-draw-progress",String(P))}if(z){let P=q(E);for(let Y in z){let xe=parseFloat(Y);P>=xe&&!Oe.has(xe)&&(Oe.add(xe),z[Y]?.())}}return ae}function j(se){if(ie)return;let ae=se-d;Se||(Se=!0,Z?.());let E=oe(ae);if(E&&!V){V=!0,oe(l),ne?.(),$e<(le==="infinite"?1/0:le??0)&&($e++,De=setTimeout(()=>{d=performance.now(),Se=!1,V=!1,Oe.clear(),gt(),Ee=requestAnimationFrame(j)},de));return}E||(Ee=requestAnimationFrame(j))}function $(){cancelAnimationFrame(Ee),clearTimeout(De),d=performance.now(),T=0,ie=!1,Se=!1,V=!1,$e=0,G=!0,fe=0,Oe.clear(),gt(),Ee=requestAnimationFrame(j)}let D=new IntersectionObserver(se=>{se.forEach(ae=>{ae.isIntersecting&&!(O&&V)?$():!ae.isIntersecting&&!O&&!V&&(cancelAnimationFrame(Ee),clearTimeout(De),G=!1)})},{root:F??null,threshold:te,rootMargin:Ve}),K;function Q(){clearTimeout(K),K=setTimeout(()=>a.forEach(We),150)}return window.addEventListener("resize",Q),window.addEventListener("orientationchange",Q),g>0?setTimeout(()=>D.observe(e),g):D.observe(e),{destroy(){cancelAnimationFrame(Ee),clearTimeout(De),D.disconnect(),window.removeEventListener("resize",Q),window.removeEventListener("orientationchange",Q),clearTimeout(K)},replay(){$e=0,$()},pause(){ie||!G||(ie=!0,T=performance.now()-d,cancelAnimationFrame(Ee))},resume(){ie&&(ie=!1,G=!0,d=performance.now()-T,Ee=requestAnimationFrame(j))},seek(se){let ae=Math.min(1,Math.max(0,se));fe=ae,ie=!0,T=ae*l,d=performance.now()-T,cancelAnimationFrame(Ee),oe(T)},getProgress(){return fe},refresh(){clearTimeout(K),a.forEach(We)}}}if(Ae)return pt(mr());kt();let Dt=()=>X(Xe(),C,Le,1);function Ot(){V=!0,ne?.(),$e<(le==="infinite"?1/0:le)&&($e++,De=setTimeout(()=>{mt=!0},de))}function It(){ut=-1,Qe=[],Se=!1,V=!1,mt=!1,Oe.clear(),gt(),Ne=!0}function fr(){let o=performance.now(),l=Xe();if(mt&&Dt()%1&&It(),!Ne&&N===!1&&l===Mt)return;Ne=!1,Mt=l;let d=m;if(N!==!1){let $=o-At,D=$>0?Math.abs(l-(Ue<0?l:Ue))/$:0;d=m*Math.max(.2,1+D*(typeof N=="number"?N:1)*.04)}Ue=l,At=o;let T=x?Ye===-1||l>=Ye?"forward":"reverse":b;Ye=l;let G=k-M,oe=!0,j=G===0?0:(l-M)/G;if(isNaN(He)||(He<=0&&j>0&&ge?.(),He<1&&j>=1&&Ie?.(),He>=1&&j<1&&ye?.(),He>0&&j<=0&&me?.()),He=j,J){let $=Ct(0,X(l,M,k,d));fe=$,e.style.setProperty("--scroll-draw-progress",String($));let D=T==="reverse"?1-$:$;e.style.clipPath=ve(D),Ce?.($),!Se&&X(l,M,k,d)>0&&(Se=!0,Z?.()),$>=1&&!V?Ot():$<1&&!O&&(V=!1);return}if(a.forEach(($,D)=>{let K=D*R*G,Q=Ct(D,X(l,M+K,k+K,d));dt($,D,Q,T),D===0&&(fe=Q,Ce?.(Q),e.style.setProperty("--scroll-draw-progress",String(Q))),Q<1&&(oe=!1)}),z){let $=q(X(l,M,k,d));for(let D in z){let K=parseFloat(D);$>=K&&!Oe.has(K)&&(Oe.add(K),z[D]?.())}}!Se&&X(l,M,k,d)>0&&(Se=!0,Z?.()),oe&&!V?Ot():!oe&&!O&&(V=!1)}let ze=_e(F??window,[e],Dt,fr,()=>{let o=p.join();a.forEach(We),kt(),Ne=!0,p.join()!==o&&Be()}),yt=g>0;function Be(){ze.hold(ie||yt)}let Rt;return yt&&(Rt=setTimeout(()=>{yt=!1,Be()},g)),Be(),pt({destroy(){clearTimeout(De),clearTimeout(Rt),ze.off(),Tt()},replay(){It(),Ye=-1,Ue=-1,$e=0,ie=!1,fe=0,clearTimeout(De),Be()},pause(){ie=!0,ze.hold(!0)},resume(){ie&&(ie=!1,Ne=!0,Be())},seek(o){let l=Math.min(1,Math.max(0,o));fe=l,ut=l,Qe=[],ie=!0,ze.hold(!0),lr(l,b),Ne=!0},getProgress(){return fe},refresh:ze.remeasure},()=>({tStart:M,tEnd:k}))}function Zt(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?it(n,t):(W("Container not found:",e),r)}function Dr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Jt(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let s=[],i=[],c=n[2].trim();if(c)for(let m of c.split(/[\s,]+/)){let u=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"")}t.push({fn:n[1],nums:s,units:i})}return t}function Or(e,t,r){let n=Jt(e),s=Jt(t);return n.length===0||n.length!==s.length?r<1?e:t:n.map((i,c)=>{let m=s[c];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((u,f)=>`${u}${i.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,f)=>`${u}${m.units[f]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,f)=>`${u+(m.nums[f]-u)*r}${i.units[f]}`).join(", ")})`}).join(" ")}function Kt(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),s=String(t);if(Dr(n))return Ke(n,s,r);if(n.includes("("))return Or(n,s,r);let i=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&c){let m=parseFloat(i[1]),u=parseFloat(c[1]);return`${m+(u-m)*r}${i[2]||c[2]}`}return r<1?n:s}function Ir(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Rr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Nr=0,er="--scroll-draw-progress";function Hr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var rr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function St(e,t){return typeof window>"u"?rr:t.respectReducedMotion===!1?tr(e,t,!1):Fe(t,(r,n)=>tr(e,r,n))}function tr(e,t,r){let{props:n,trigger:s={},easing:i="ease-out",speed:c=1,once:m=!1,axis:u="y",scrollContainer:f,native:h=!0,velocityScale:S=!1,triggerElement:b,onProgress:O,onComplete:ee,onEnter:A,onLeave:y,onEnterBack:x,onLeaveBack:g}=t,w=typeof i=="function"?i:U[i]??U["ease-out"],v=Te(s.start||"top bottom"),I=Te(s.end||"bottom top"),z=b??e,N=typeof f=="string"?document.querySelector(f):f??null,te=Object.entries(n).map(([a,p])=>({prop:Ir(a),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function Ve(){let a=window.getComputedStyle(e);for(let p of te)p.from===""&&(p.from=a.getPropertyValue(p.prop).trim()||"0")}function le(){for(let a of te)e.style.setProperty(a.prop,String(a.to))}let de=new Map;for(let a of[...te.map(p=>p.prop),er])de.set(a,e.style.getPropertyValue(a));function B(){for(let[a,p]of de)p?e.style.setProperty(a,p):e.style.removeProperty(a)}if(r)return le(),ee?.(),{...rr,destroy:B,getProgress:()=>1};Ve();let re=()=>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,L=typeof i=="string"?tt(i):null;function H(){if(!h||!Hr()||!L||u!=="y"||N||z!==e||m||c!==1||O||ee||A||y||x||g||S!==!1||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return!1;for(let a of te)if(!Rr.has(a.prop))return!1;return!0}function Ce(){let a=`ssd-a-${++Nr}`,p=te.map(C=>`${C.prop}:${C.from}`).join(";"),_=te.map(C=>`${C.prop}:${C.to}`).join(";"),M=document.createElement("style");M.setAttribute("data-ssd-animate",""),M.textContent=`@keyframes ${a}{from{${p}}to{${_}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${L};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(a);let k=()=>{let C=e.getBoundingClientRect();return ke({top:C.top,height:C.height},re(),Ae(),v,I)};Me(e,{type:"animate",getProgress:()=>R.getProgress(),getTrigger:k});let R={refresh(){},destroy(){e.classList.remove(a),M.remove(),e.style.animationPlayState="",B(),pe(e)},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a)},pause(){e.style.animationPlayState="paused"},resume(){e.style.animationPlayState=""},seek(C){let Le=Math.min(1,Math.max(0,C));e.classList.remove(a);for(let V of te)e.style.setProperty(V.prop,Kt(V.from,V.to,Le))},getProgress(){let{tStart:C,tEnd:Le}=k();return w(X(re(),C,Le,c))}};return R}if(H())return Ce();let Z=0,ne=0,ge=!1,Ie=-1,ye=0,me=0,J=!1,q=NaN,Re=-1,Ge=0,F=z===e?te:[],he=!1;function be(){let a=e.style,p=F.map(R=>a.getPropertyValue(R.prop)),_=a.transition;F.length&&(a.transition="none"),F.forEach(R=>a.setProperty(R.prop,de.get(R.prop)??""));let M=Ze(z,N,u);F.forEach((R,C)=>a.setProperty(R.prop,p[C])),F.length&&(e.offsetWidth,a.transition=_);let k=ke(M,M.scroll,Ae(),v,I);he&&Math.abs(k.tStart-Z)<1&&Math.abs(k.tEnd-ne)<1||(he=!0,Z=k.tStart,ne=k.tEnd)}function ce(a){e.style.setProperty(er,String(a));for(let p of te)e.style.setProperty(p.prop,Kt(p.from,p.to,a));O?.(a)}function Pe(a){if(isNaN(q)){q=a;return}q<=0&&a>0&&A?.(),q<1&&a>=1&&y?.(),q>=1&&a<1&&x?.(),q>0&&a<=0&&g?.(),q=a}function we(){if(ge)return;let a=performance.now(),p=re(),_=c;if(S!==!1){let C=a-Ge,Le=C>0?Math.abs(p-(Re<0?p:Re))/C:0;_=c*Math.max(.2,1+Le*(typeof S=="number"?S:1)*.04)}Re=p,Ge=a;let M=ne===Z?0:(p-Z)/(ne-Z);Pe(M);let k=X(p,Z,ne,_),R=m?Math.max(Ie,w(ye=Math.max(ye,k))):w(k);me=R,ce(R),R>=1&&!J?(J=!0,ee?.()):R<1&&!m&&(J=!1)}let ue=_e(N??window,[z],()=>X(re(),Z,ne,Math.min(c,1)),we,be);be(),ne===Z&&W("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ye=X(re(),Z,ne,c),me=w(ye),ce(me),Me(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:Z,tEnd:ne})});function ve(){ge=!0,ue.hold(!0)}return{destroy(){ge=!0,ue.off(),B(),pe(e)},replay(){Ie=-1,ye=0,J=!1,me=0,ge=!1,ce(0),ue.hold(!1)},pause:ve,resume(){ge&&(ge=!1,ue.hold(!1))},seek(a){let p=Math.min(1,Math.max(0,a));me=p,Ie=p,ye=0,ve(),ce(p)},getProgress(){return me},refresh:ue.remeasure}}var at={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nr(e,t){if(typeof window>"u")return at;let r=typeof e=="string"?document.querySelector(e):e;return r?St(r,t):(W("scrollAnimate: element not found:",e),at)}function or(e,t={}){if(typeof window>"u")return at;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return W("scrollParallax: element not found:",e),at;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:c,onProgress:m}=t,u=-n*100,f=r.style,h=!!r.ownerSVGElement,S=f.getPropertyValue("transform-box");h&&f.setProperty("transform-box","fill-box");let b=St(r,{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:m});return h?{...b,destroy(){b.destroy(),f.setProperty("transform-box",S)}}:b}var Et={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function sr(e,t){if(typeof window>"u")return Et;let r=typeof e=="string"?document.querySelector(e):e;return r?Fe(t,(n,s)=>Fr(r,n,s)):(W("scrollCounter: element not found:",e),Et)}function Fr(e,t,r){let{from:n=0,to:s,format:i,easing:c="ease-out",trigger:m={},once:u=!0,decimals:f,onComplete:h}=t,S=f!==void 0?L=>L.toFixed(f):i??(L=>String(Math.round(L))),b=typeof c=="function"?c:U[c]??U["ease-out"],O=Te(m.start||"top 80%"),ee=Te(m.end||"top 20%");if(r)return e.textContent=S(s),h?.(),{...Et,getProgress:()=>1};let A=0,y=0,x=!1,g=-1,w=0,v=0,I=!1,z=()=>window.scrollY,N=()=>window.innerHeight;function te(){let L=e.getBoundingClientRect(),H=ke({top:L.top,height:L.height},z(),N(),O,ee);x&&Math.abs(H.tStart-A)<1&&Math.abs(H.tEnd-y)<1||(x=!0,A=H.tStart,y=H.tEnd)}let Ve=e.style.getPropertyValue("--scroll-draw-progress");function le(L){e.textContent=S(n+(s-n)*L),e.style.setProperty("--scroll-draw-progress",String(L))}let de=()=>X(z(),A,y,1);function B(){let L=de(),H=u?Math.max(g,b(w=Math.max(w,L))):b(L);v=H,le(H),H>=1&&!I?(I=!0,h?.()):H<1&&!u&&(I=!1)}te();{w=X(z(),A,y,1);let L=b(w);v=L,le(L)}let re=_e(window,[e],de,B,te);Me(e,{type:"counter",getProgress:()=>v,getTrigger:()=>({tStart:A,tEnd:y})});let Ae=()=>re.hold(!1);return{destroy(){re.off(),e.style.setProperty("--scroll-draw-progress",Ve),pe(e)},replay(){g=-1,w=0,I=!1,v=0,le(0),Ae()},pause:()=>re.hold(!0),resume:Ae,seek(L){let H=Math.min(1,Math.max(0,L));v=H,g=H,w=0,re.hold(!0),le(H)},getProgress(){return v}}}var ir="http://www.w3.org/2000/svg",_r="cinematic-photo",xt=e=>e<0?0:e>1?1:e;function lt(e){let t=parseFloat(e);return Number.isFinite(t)?xt(t/100):0}function Vr(e){return U[e]??U.linear}var Gr={destroy:()=>{},getProgress:()=>0},ct=class{constructor(t){if(typeof document>"u"){this.mount=null;return}this.mount=typeof t.wrapper=="string"?document.querySelector(t.wrapper):t.wrapper,this.mount||W("Cinematic: wrapper not found:",t.wrapper)}loadStory(t){let r=this.mount;if(typeof window>"u"||!r)return Gr;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 y of t.scenes){if(y.background){let g=document.createElement("img");g.id=_r,g.src=y.background,g.alt="",g.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(g)}let x=y.animations.filter(g=>g.type==="draw");if(x.length){let g=document.createElementNS(ir,"svg");g.setAttribute("viewBox",`0 0 ${t.canvas.width} ${t.canvas.height}`),g.setAttribute("preserveAspectRatio","xMidYMid meet"),g.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(g);for(let w of x){let v=document.createElementNS(ir,"path");v.id=w.target.replace(/^#/,""),v.setAttribute("d",w.d),v.setAttribute("fill","none"),v.setAttribute("stroke",w.stroke),v.setAttribute("stroke-width",String(w.strokeWidth)),v.setAttribute("stroke-linecap","round"),v.setAttribute("stroke-linejoin","round");let I=w.length||v.getTotalLength?.()||0;v.style.strokeDasharray=String(I),v.style.strokeDashoffset=String(I),g.appendChild(v),s.push({kind:"draw",el:v,start:lt(w.start),end:lt(w.end),ease:Vr(w.easing),length:I})}}for(let g of y.animations){if(g.type!=="fade")continue;let w=n.querySelector(g.target)??document.querySelector(g.target);w&&(w.style.opacity=String(g.from),s.push({kind:"fade",el:w,start:lt(g.start),end:lt(g.end),ease:U["ease-in-out"]??U.linear,from:g.from,to:g.to}))}}let i=0,c=()=>{let y=r.offsetHeight-window.innerHeight;return y<=0?r.getBoundingClientRect().top<=0?1:0:xt(-r.getBoundingClientRect().top/y)},m=y=>{for(let x of s){let g=x.end-x.start,w=g<=0?y>=x.end?1:0:xt((y-x.start)/g),v=x.ease(w);x.kind==="draw"?x.el.style.strokeDashoffset=String(x.length*(1-v)):x.el.style.opacity=String(x.from+(x.to-x.from)*v)}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let u=0,f=!1,h=!1,S=()=>{i=c(),m(i),f&&(u=requestAnimationFrame(S))},b=()=>{f||(f=!0,u=requestAnimationFrame(S))},O=()=>{f=!1,cancelAnimationFrame(u)},ee=new IntersectionObserver(y=>{for(let x of y)h=x.isIntersecting,h?b():O()},{threshold:0});ee.observe(n),i=c(),m(i),Me(r,{type:"draw",getProgress:()=>i,getTrigger:()=>{let y=r.getBoundingClientRect().top+window.scrollY;return{tStart:y,tEnd:y+Math.max(0,r.offsetHeight-window.innerHeight)}}});let A=rt(y=>{y&&(A(),O(),ee.disconnect(),pe(r),i=1,m(1))});return{destroy(){A(),O(),ee.disconnect(),pe(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(S=>this.getAttribute(S)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},c=this.getAttribute("speed"),m=this.getAttribute("easing"),u=this.getAttribute("stagger"),f=this.getAttribute("direction"),h=this.getAttribute("selector");c&&(i.speed=parseFloat(c)),m&&(i.easing=m),u&&(i.stagger=parseFloat(u)),f&&(i.direction=f),h&&(i.selector=h),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=it(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}t.observedAttributes=e,customElements.define("scroll-draw",t)}return wr(Wr);})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-K6VATIJH.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,2 +1,2 @@
|
|
|
1
|
-
import {d}from'./chunk-
|
|
1
|
+
import {d}from'./chunk-THPTANES.mjs';import {a as a$1}from'./chunk-5PJEKEEP.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
2
|
export{T as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-VJ5ZU55P.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-V3Z6G5JE.mjs';import {a as a$2}from'./chunk-UPWWULKI.mjs';import {a as a$5}from'./chunk-XC5NR2MU.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,e,c,b as b$3}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$4,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b,a as a$3}from'./chunk-LFSU6LR3.mjs';var gt={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 Ct=0;function Ot(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function ht(r,p){let f="";try{f=getComputedStyle(r).getPropertyValue(p).trim();}catch{}return f||(r.getAttribute(p)??"").trim()}var vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Nt(r){if(!a$3)return;let p=ht(r,"stroke");if(!p||p==="none"){b("Element has no stroke \u2014 path will not be visible.",r);return}let f=(r.getAttribute("fill")??"").trim();f&&!vt.has(f)&&!vt.has(ht(r,"fill"))&&b("Element has a fill \u2014 it may obscure the stroke animation.",r);}function Ft(r,p,f){let d=document.createElement("div");d.setAttribute("data-svg-scroll-draw-debug",""),d.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 k(){let F=f==="x"?window.scrollX:window.scrollY,x=r-F,M=p-F,H=f==="x";d.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${H?`left:${x}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${x}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:${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(d),window.addEventListener("scroll",k,{passive:true}),k(),{el:d,destroy(){window.removeEventListener("scroll",k),d.remove();}}}var wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,bt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Ht(r,p,f){if(!a$3)return;let d=(r.match(bt)??[]).join("").toUpperCase(),k=(p.match(bt)??[]).join("").toUpperCase(),F=(r.match(wt)??[]).length,x=(p.match(wt)??[]).length;if(d!==k){b(`morphTo: command sequence differs (${d||"\u2205"} \u2192 ${k||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,f);return}F!==x&&b(`morphTo: coordinate count differs (${F} \u2192 ${x}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,f);}function It(r,p,f){let d=(p.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),k=0;return r.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,F=>{let x=parseFloat(F),M=d[k++]??x;return String(+(x+(M-x)*f).toFixed(4))})}function Zt(r,p={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:a(p,(f,d)=>Rt(r,f,d))}function Rt(r,p,f){let{preset:d$1,...k}=p,F=d$1?{...gt[d$1],...k}:k,{selector:x="path, polyline, line, polygon, rect, circle",speed:M=1,fade:H=false,easing:le="linear",trigger:he={},stagger:q=0,direction:u="forward",once:K=false,debug:Ve=false,axis:W="y",scrollContainer:ke,autoReverse:xe=false,delay:fe=0,strokeColor:B,strokeWidth:_,fillOpacity:j,waypoints:U,velocityScale:ce=false,threshold:Et=0,rootMargin:St="0px",repeat:ue=0,repeatDelay:We=0,morphTo:L,clip:Me,autoplay:ze=false,duration:Tt=1e3,native:$t=true,onProgress:me,onStart:ve,onComplete:we,onEnter:Ge,onLeave:qe,onEnterBack:Be,onLeaveBack:_e}=F,D=Me===true?"left":typeof Me=="string"?Me:false,z=typeof le=="function"?le:d[le]??d.linear,je=a$1(he.start||"top bottom"),Ue=a$1(he.end||"bottom top"),P=typeof ke=="string"?document.querySelector(ke):ke??null,ee=Array.isArray(B)?B[0]:null,te=Array.isArray(B)?B[1]:typeof B=="string"?B:null,X=Array.isArray(_)?_[0]:null,re=Array.isArray(_)?_[1]:typeof _=="number"?_:null,Y=Array.isArray(j)?j[0]:null,se=Array.isArray(j)?j[1]:typeof j=="number"?j:null;function ne(e){let t=e*100;switch(D){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 c$1=D?[]:Array.from(r.querySelectorAll(x)),S=[],C=[],w=0,O=0,be=q,Xe=0,Ye=0,A=false,I=false,R=0,Pe=-1,Ee=[],Se=-1,T=false,N=0,Q=0,Z,Le=false,De=null;function Qe(){De?.destroy(),De=null;}let J=new Set,Ze=NaN,oe=true,Te=-1,Je=performance.now(),ie=NaN;function $e(){return P?W==="x"?P.scrollLeft:P.scrollTop:W==="x"?window.scrollX:window.scrollY}function Ke(){return P?W==="x"?P.clientWidth:P.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function et(){let e=a$2(r,P,W);return c(e,e.scroll,Ke(),je,Ue)}function At(){let e=O-w,t=c$1.length-1,s=P??document.documentElement,o=W==="x"?"Width":"Height";if(be=q,q>0&&t>0&&e>0){let y=s[`scroll${o}`]-s[`client${o}`]-1-w-e/M;y>=0&&(be=Math.min(q,y/(t*e)));}let m=Math.max(0,t)*be*e,b=e/Math.min(M,1);Xe=w+Math.min(0,m,b,m+b),Ye=w+Math.max(0,m,b,m+b);}function tt(){(({tStart:w,tEnd:O}=et())),At(),Ve&&a$3&&(Qe(),De=Ft(w,O,W));}function Ce(e,t=et){a$4(r,{type:"draw",getProgress:()=>e.getProgress(),getTrigger:t});let s=e.destroy;return e.destroy=()=>{s.call(e),b$2(r);},e}function rt(e,t){return K&&!xe?Math.max(Pe,z(Ee[e]=Math.max(Ee[e]??0,t))):z(t)}function kt(e,t){if(r.style.setProperty("--scroll-draw-progress",String(e)),D){let s=t==="reverse"?1-e:e;r.style.clipPath=ne(s);return}c$1.forEach((s,o)=>Oe(s,o,e,t));}function Oe(e,t,s,o){e.style.strokeDashoffset=o==="reverse"?`${S[t]*s}`:`${S[t]*(1-s)}`,H&&(e.style.opacity=o==="reverse"?`${1-s}`:`${s}`),ee&&te?e.style.stroke=a$6(ee,te,s):te&&(e.style.stroke=te),X!==null&&re!==null?e.style.strokeWidth=`${X+(re-X)*s}`:re!==null&&(e.style.strokeWidth=`${re}`),Y!==null&&se!==null?e.style.fillOpacity=`${Y+(se-Y)*s}`:se!==null&&(e.style.fillOpacity=`${se}`),L&&e.tagName.toLowerCase()==="path"&&C[t]&&e.setAttribute("d",It(C[t],L,s));}function Ne(){if(r.style.setProperty("--scroll-draw-progress","0"),D){r.style.clipPath=ne(u==="reverse"?1:0);return}c$1.forEach((e,t)=>{e.style.strokeDasharray=`${S[t]}`,e.style.strokeDashoffset=u==="reverse"?"0":`${S[t]}`,H?e.style.opacity=u==="reverse"?"1":"0":e.style.opacity="",ee&&(e.style.stroke=ee),X!==null&&(e.style.strokeWidth=`${X}`),Y!==null&&(e.style.fillOpacity=`${Y}`),L&&e.tagName.toLowerCase()==="path"&&C[t]&&e.setAttribute("d",C[t]);});}function pe(e,t){let s=e.getAttribute("d"),o=a$5(e);if(L&&C[t]){e.setAttribute("d",L);let m=a$5(e);e.setAttribute("d",C[t]),o=Math.max(a$5(e),m),e.setAttribute("d",s);}S[t]=o,e.style.strokeDasharray=`${o}`;}if(c$1.forEach((e,t)=>{Nt(e);let s=e.tagName.toLowerCase()==="path";s?C.push(e.getAttribute("d")??""):C.push(""),pe(e,t);let o=S[t];L&&(s?Ht(C[C.length-1],L,e):b(`morphTo only applies to <path> elements \u2014 ignored on <${e.tagName}>.`,e)),f?(e.style.strokeDashoffset=u==="reverse"?`${o}`:"0",H&&(e.style.opacity="1"),te&&(e.style.stroke=te),re!==null&&(e.style.strokeWidth=`${re}`),se!==null&&(e.style.fillOpacity=`${se}`),L&&e.tagName.toLowerCase()==="path"&&e.setAttribute("d",L)):(e.style.strokeDashoffset=u==="reverse"?"0":`${o}`,H?e.style.opacity=u==="reverse"?"1":"0":e.style.opacity="",ee&&(e.style.stroke=ee),X!==null&&(e.style.strokeWidth=`${X}`),Y!==null&&(e.style.fillOpacity=`${Y}`));}),f)return D&&(r.style.clipPath=ne(1)),we?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};D&&(r.style.clipPath=ne(u==="reverse"?1:0));let st=typeof le=="string"?b$1(le):null;function xt(){return !($t===false||ze||Ve&&a$3||!Ot()||!c$1.length||!st||D||W!=="y"||P||M!==1||q!==0||K||xe||ce!==false||L||U||ue||fe>0||me||ve||we||Ge||qe||Be||_e||B!=null||_!=null||j!=null||(he.start||"top bottom").trim()!=="top bottom"||(he.end||"bottom top").trim()!=="bottom top")}function Mt(){let e=++Ct,t=`svg-scroll-draw-${e}`,s=`svg-scroll-draw-host-${e}`,o=`--svg-scroll-draw-${e}`,m=u==="reverse"?"0":"var(--ssd-len)",b=u==="reverse"?"var(--ssd-len)":"0",y=`stroke-dashoffset:${m};`,a=`stroke-dashoffset:${b};`;H&&(y+=`opacity:${u==="reverse"?1:0};`,a+=`opacity:${u==="reverse"?0:1};`);let l=document.createElement("style");l.setAttribute("data-svg-scroll-draw",""),l.textContent=`@keyframes ${t}{from{${y}}to{${a}}}.${s}{view-timeline-name:${o};view-timeline-axis:block;}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${st};animation-fill-mode:both;animation-timeline:${o};animation-range:cover 0% cover 100%;}`,document.head.appendChild(l),r.classList.add(s);function v(n,i){n.style.setProperty("--ssd-len",String(S[i])),n.style.strokeDasharray=`${S[i]}`,n.style.strokeDashoffset="",n.style.opacity="",n.style.animationPlayState="",n.classList.add(t);}c$1.forEach(v);let g=false,E=-1;function $(){if(E>=0)return E;let n=r.getBoundingClientRect(),{tStart:i,tEnd:h}=c({top:n.top,height:n.height},$e(),Ke(),je,Ue);return z(b$3($e(),i,h,M))}return {destroy(){r.classList.remove(s),c$1.forEach(n=>{n.classList.remove(t),n.style.removeProperty("--ssd-len"),n.style.animationPlayState="";}),l.remove();},replay(){g=false,E=-1,c$1.forEach(v);},pause(){g=true,c$1.forEach(n=>{n.style.animationPlayState="paused";});},resume(){g&&(g=false,c$1.forEach(n=>{n.style.animationPlayState="running";}));},seek(n){let i=Math.min(1,Math.max(0,n));E=i,g=true,c$1.forEach((h,V)=>{h.classList.remove(t),h.style.strokeDashoffset=u==="reverse"?`${S[V]*i}`:`${S[V]*(1-i)}`,H&&(h.style.opacity=u==="reverse"?`${1-i}`:`${i}`);});},getProgress(){return $()},refresh(){c$1.forEach((n,i)=>{pe(n,i),n.style.setProperty("--ssd-len",String(S[i]));});}}}if(xt())return Ce(Mt());function Pt(){let e=Math.max(1,Tt),t=D?e:e*(1+Math.max(0,c$1.length-1)*q),s=0,o=0,m=false;function b(E){let $=true,n=Math.min(1,Math.max(0,E/t));if(D){let i=Math.min(1,Math.max(0,E/e)),h=z(i);N=h,r.style.setProperty("--scroll-draw-progress",String(h)),r.style.clipPath=ne(u==="reverse"?1-h:h),me?.(h),i<1&&($=false);}else {c$1.forEach((h,V)=>{let Dt=V*q*e,lt=Math.min(1,Math.max(0,(E-Dt)/e));Oe(h,V,z(lt),u),lt<1&&($=false);});let i=z(n);N=i,me?.(i),r.style.setProperty("--scroll-draw-progress",String(i));}if(U){let i=z(n);for(let h in U){let V=parseFloat(h);i>=V&&!J.has(V)&&(J.add(V),U[h]?.());}}return $}function y(E){if(T)return;let $=E-s;I||(I=true,ve?.());let n=b($);if(n&&!A){A=true,b(t),we?.(),Q<(ue==="infinite"?1/0:ue??0)&&(Q++,Z=setTimeout(()=>{s=performance.now(),I=false,A=false,J.clear(),Ne(),R=requestAnimationFrame(y);},We));return}n||(R=requestAnimationFrame(y));}function a(){cancelAnimationFrame(R),clearTimeout(Z),s=performance.now(),o=0,T=false,I=false,A=false,Q=0,m=true,N=0,J.clear(),Ne(),R=requestAnimationFrame(y);}let l=new IntersectionObserver(E=>{E.forEach($=>{$.isIntersecting&&!(K&&A)?a():!$.isIntersecting&&!K&&!A&&(cancelAnimationFrame(R),clearTimeout(Z),m=false);});},{root:P??null,threshold:Et,rootMargin:St}),v;function g(){clearTimeout(v),v=setTimeout(()=>c$1.forEach(pe),150);}return window.addEventListener("resize",g),window.addEventListener("orientationchange",g),fe>0?setTimeout(()=>l.observe(r),fe):l.observe(r),{destroy(){cancelAnimationFrame(R),clearTimeout(Z),l.disconnect(),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),clearTimeout(v);},replay(){Q=0,a();},pause(){T||!m||(T=true,o=performance.now()-s,cancelAnimationFrame(R));},resume(){T&&(T=false,m=true,s=performance.now()-o,R=requestAnimationFrame(y));},seek(E){let $=Math.min(1,Math.max(0,E));N=$,T=true,o=$*t,s=performance.now()-o,cancelAnimationFrame(R),b(o);},getProgress(){return N},refresh(){clearTimeout(v),c$1.forEach(pe);}}}if(ze)return Ce(Pt());tt();let nt=()=>b$3($e(),Xe,Ye,1);function ot(){A=true,we?.(),Q<(ue==="infinite"?1/0:ue)&&(Q++,Z=setTimeout(()=>{Le=true;},We));}function it(){Pe=-1,Ee=[],I=false,A=false,Le=false,J.clear(),Ne(),oe=true;}function Lt(){let e=performance.now(),t=$e();if(Le&&nt()%1&&it(),!oe&&ce===false&&t===Ze)return;oe=false,Ze=t;let s=M;if(ce!==false){let a=e-Je,l=a>0?Math.abs(t-(Te<0?t:Te))/a:0;s=M*Math.max(.2,1+l*(typeof ce=="number"?ce:1)*.04);}Te=t,Je=e;let o=xe?Se===-1||t>=Se?"forward":"reverse":u;Se=t;let m=O-w,b=true,y=m===0?0:(t-w)/m;if(isNaN(ie)||(ie<=0&&y>0&&Ge?.(),ie<1&&y>=1&&qe?.(),ie>=1&&y<1&&Be?.(),ie>0&&y<=0&&_e?.()),ie=y,D){let a=rt(0,b$3(t,w,O,s));N=a,r.style.setProperty("--scroll-draw-progress",String(a));let l=o==="reverse"?1-a:a;r.style.clipPath=ne(l),me?.(a),!I&&b$3(t,w,O,s)>0&&(I=true,ve?.()),a>=1&&!A?ot():a<1&&!K&&(A=false);return}if(c$1.forEach((a,l)=>{let v=l*be*m,g=rt(l,b$3(t,w+v,O+v,s));Oe(a,l,g,o),l===0&&(N=g,me?.(g),r.style.setProperty("--scroll-draw-progress",String(g))),g<1&&(b=false);}),U){let a=z(b$3(t,w,O,s));for(let l in U){let v=parseFloat(l);a>=v&&!J.has(v)&&(J.add(v),U[l]?.());}}!I&&b$3(t,w,O,s)>0&&(I=true,ve?.()),b&&!A?ot():!b&&!K&&(A=false);}let de=e(P??window,[r],nt,Lt,()=>{let e=S.join();c$1.forEach(pe),tt(),oe=true,S.join()!==e&&ye();}),Fe=fe>0;function ye(){de.hold(T||Fe);}let at;return Fe&&(at=setTimeout(()=>{Fe=false,ye();},fe)),ye(),Ce({destroy(){clearTimeout(Z),clearTimeout(at),de.off(),Qe();},replay(){it(),Se=-1,Te=-1,Q=0,T=false,N=0,clearTimeout(Z),ye();},pause(){T=true,de.hold(true);},resume(){T&&(T=false,oe=true,ye());},seek(e){let t=Math.min(1,Math.max(0,e));N=t,Pe=t,Ee=[],T=true,de.hold(true),kt(t,u),oe=true;},getProgress(){return N},refresh:de.remeasure},()=>({tStart:w,tEnd:O}))}export{gt as a,Zt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-4DOJSIEQ.mjs';function N(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",o="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:o}}var T=(e,t)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:t;function x(e,t,n,o){return e+n+t*T(o,0)}function y(e,t){return t*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:T(e,1))}function O(e,t,n,o){return n===t?0:a((e-t)/(n-t)*o,0,1)}function S(e,t,n,o,r){let i=x(e.top,e.height,t,o.element)-y(o.viewport,n),u=x(e.top,e.height,t,r.element)-y(r.viewport,n);return {tStart:i,tEnd:u}}var s,c=new Set,f=new WeakMap,d=new Map,A=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function z(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let o=n;o;o=o.previousElementSibling)t.add(o);return t}function F(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();s??(s=new ResizeObserver(r=>{let i=false;for(let{target:u}of r)f.get(u)!==A(u)&&(i=true),f.set(u,"");i&&c.forEach(u=>u());})),c.add(n);let o=z(e);return [document.body,document.documentElement].forEach(r=>r&&o.add(r)),o.forEach(r=>{f.has(r)||f.set(r,A(r)),d.set(r,(d.get(r)??0)+1),s.observe(r);}),()=>{c.delete(n)&&(o.forEach(r=>{let i=(d.get(r)??1)-1;if(i)return void d.set(r,i);d.delete(r),s?.unobserve(r);}),c.size||(s?.disconnect(),s=void 0));}}function B(e,t,n,o,r){let i,u=NaN,b,l,v=()=>{i=0,o(),!b&&!i&&(u=n())>0&&u<1&&(i=requestAnimationFrame(v));},a=()=>{!i&&!b&&n()!==u&&(i=requestAnimationFrame(v));},g=m=>{b=m,cancelAnimationFrame(i),i=u=NaN,a();},w=()=>{clearTimeout(l),r(),a();},p=()=>{clearTimeout(l),l=setTimeout(w,150);},L=F(t,p),E=m=>{e[m]("scroll",a,{passive:true}),window[m]("resize",p),window[m]("orientationchange",p);};return E("addEventListener"),a(),{hold:g,remeasure:w,off(){g(true),E("removeEventListener"),L(),clearTimeout(l);}}}export{N as a,O as b,S as c,F as d,B as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,e,c,b as b$2}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$1}from'./chunk-5PJEKEEP.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(c$1,h={}){if(typeof window>"u")return X;let y=typeof c$1=="string"?document.querySelector(c$1):c$1;if(!y||y.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",c$1),X;let t=y,{trigger:C={},easing:v="linear",once:V=false,axis:u="y",preload:Y="auto",triggerElement:j,onReady:L,onComplete:J,onProgress:K}=h,R=j??t,a$3=window.matchMedia("(prefers-reduced-motion: reduce)").matches,z=typeof v=="function"?v:d[v]??d.linear,Q=a(C.start||"top top"),U=a(C.end||"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=Y);let A=h.from??0,b$3=h.to,m=0,f=0,r=false,E=-1,g=0,n=0,p=false,i=false,I=()=>u==="x"?window.scrollX:window.scrollY,Z=()=>u==="x"?window.innerWidth:window.innerHeight;function S(){let e=R.getBoundingClientRect(),o=u==="x"?e.left:e.top,d=u==="x"?e.width:e.height,H=c({top:o,height:d},I(),Z(),Q,U);m=H.tStart,f=H.tEnd,i&&f===m&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let w=NaN;function s(e){if(!i)return;let o=b$3??t.duration??0,d=A+(o-A)*e;d!==w&&(w=d,t.currentTime=d),t.style.setProperty("--scroll-draw-progress",String(e)),K?.(e);}let O=()=>b$2(I(),m,f,1);function $(){if(!i||a$3)return;let e=O(),o=V?Math.max(E,z(g=Math.max(g,e))):z(e);n=o,s(o),o>=1&&!p?(p=true,J?.()):o<1&&!V&&(p=false);}let l=e(window,[R],O,$,S),x=()=>l.hold(r||!i||a$3);x();function N(){if(i=true,b$3===void 0&&(b$3=t.duration),a$3){s(1),L?.();return}S(),L?.(),r?s(n):x();}t.readyState>=1?N():t.addEventListener("loadedmetadata",N,{once:true}),i||S();let k=a$3?()=>{}:a$1(e=>{e&&(k(),a$3=true,l.hold(true),s(1));});a$2(t,{type:"video",getProgress:()=>n,getTrigger:()=>({tStart:m,tEnd:f})});function D(){r&&(r=false,x());}return {destroy(){l.off(),t.removeEventListener("loadedmetadata",N),k(),b$1(t);},replay(){E=-1,g=0,p=false,n=0,w=NaN,s(0),D();},pause(){r=true,l.hold(true);},resume:D,seek(e){let o=Math.min(1,Math.max(0,e));n=o,E=o,g=0,r=true,l.hold(true),w=NaN,s(o);},getProgress(){return n}}}export{se as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-
|
|
1
|
+
import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-NYQJPPMP.mjs';import {a as a$4}from'./chunk-XNM3VKEK.mjs';import {a as a$2}from'./chunk-PAGN26EH.mjs';import {a as a$1}from'./chunk-VJ5ZU55P.mjs';import {b as b$2}from'./chunk-K6VATIJH.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}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,e,c}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$2,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var C={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function U(t,p){if(typeof window>"u")return C;let a$1=typeof t=="string"?document.querySelector(t):t;return a$1?a(p,(l,c)=>B(a$1,l,c)):(b("scrollCounter: element not found:",t),C)}function B(t,p,a){let{from:l=0,to:c$1,format:F,easing:f="ease-out",trigger:P={},once:E=true,decimals:M,onComplete:v}=p,x=M!==void 0?e=>e.toFixed(M):F??(e=>String(Math.round(e))),d$1=typeof f=="function"?f:d[f]??d["ease-out"],G=a$1(P.start||"top 80%"),L=a$1(P.end||"top 20%");if(a)return t.textContent=x(c$1),v?.(),{...C,getProgress:()=>1};let s=0,i=0,T=false,h=-1,o=0,n=0,u=false,w=()=>window.scrollY,V=()=>window.innerHeight;function A(){let e=t.getBoundingClientRect(),r=c({top:e.top,height:e.height},w(),V(),G,L);T&&Math.abs(r.tStart-s)<1&&Math.abs(r.tEnd-i)<1||(T=true,s=r.tStart,i=r.tEnd);}let _=t.style.getPropertyValue("--scroll-draw-progress");function m(e){t.textContent=x(l+(c$1-l)*e),t.style.setProperty("--scroll-draw-progress",String(e));}let I=()=>b$1(w(),s,i,1);function q(){let e=I(),r=E?Math.max(h,d$1(o=Math.max(o,e))):d$1(e);n=r,m(r),r>=1&&!u?(u=true,v?.()):r<1&&!E&&(u=false);}A();{o=b$1(w(),s,i,1);let e=d$1(o);n=e,m(e);}let g=e(window,[t],I,q,A);a$2(t,{type:"counter",getProgress:()=>n,getTrigger:()=>({tStart:s,tEnd:i})});let O=()=>g.hold(false);return {destroy(){g.off(),t.style.setProperty("--scroll-draw-progress",_),b$2(t);},replay(){h=-1,o=0,u=false,n=0,m(0),O();},pause:()=>g.hold(true),resume:O,seek(e){let r=Math.min(1,Math.max(0,e));n=r,h=r,o=0,g.hold(true),m(r);},getProgress(){return n}}}export{U as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function M({tension:n=2.5,friction:a=2.2}={}){return t=>1-Math.cos(t*Math.PI*n)*Math.pow(1-t,a)}function p({bounces:n=3,decay:a=.5}={}){let t=Math.max(1,Math.round(n)),o=Math.max(.01,Math.min(.99,a)),c=Math.sqrt(o),u=0,m=[];for(let r=0;r<t;r++){let e=Math.pow(c,r);m.push(e),u+=e;}let s=[0],b=0;for(let r=0;r<t;r++)b+=m[r]/u,s.push(b);return r=>{if(r<=0)return 0;if(r>=1)return 1;for(let e=0;e<t;e++)if(r<=s[e+1]){let i=(r-s[e])/(s[e+1]-s[e]);if(e===0)return i*(2-i);let h=1-Math.pow(o,e);return h+(1-h)*(2*i-1)*(2*i-1)}return 1}}function f({amplitude:n=1,period:a=.4}={}){let t=Math.max(1,n),o=Math.max(.1,a),c=t<=1?o/4:o/(2*Math.PI)*Math.asin(1/t);return u=>u<=0?0:u>=1?1:t*Math.pow(2,-10*u)*Math.sin((u-c)*(2*Math.PI)/o)+1}var l={linear:n=>n,"ease-in":n=>n*n,"ease-out":n=>n*(2-n),"ease-in-out":n=>n<.5?2*n*n:-1+(4-2*n)*n,spring:M(),bounce:p(),elastic:f()};export{M as a,p as b,f as c,l as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d}from'./chunk-
|
|
1
|
+
import {d}from'./chunk-THPTANES.mjs';function u(t){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(t);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let e=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(e)return [parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(t);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function l(t,r,e){let n=u(t),s=u(r);return !n||!s?t:`rgb(${Math.round(n[0]+(s[0]-n[0])*e)},${Math.round(n[1]+(s[1]-n[1])*e)},${Math.round(n[2]+(s[2]-n[2])*e)})`}var o="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",c="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",a=33;function p(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function f(t){let r=[];for(let e=0;e<a;e++){let n=e/(a-1);r.push(String(Math.round(t(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function g(t){switch(t){case "linear":return "linear";case "ease-in":return o;case "ease-out":return c;case "ease-in-out":return p()?f(d["ease-in-out"]):null;default:return null}}export{l as a,g as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,a as a$4}from'./chunk-V3Z6G5JE.mjs';import {a as a$3}from'./chunk-UPWWULKI.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,e,b as b$1,c}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$2,b as b$3}from'./chunk-BCV4RAIX.mjs';import {b as b$2}from'./chunk-LFSU6LR3.mjs';function wt(t){return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")}function ut(t){let i=[],l=/([\w]+)\(([^)]*)\)/g,s;for(;(s=l.exec(t))!==null;){let m=[],r=[],c=s[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let o=u.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(o?parseFloat(o[1]):0),r.push(o?o[2]:"");}i.push({fn:s[1],nums:m,units:r});}return i}function Mt(t,i,l){let s=ut(t),m=ut(i);return s.length===0||s.length!==m.length?l<1?t:i:s.map((r,c)=>{let u=m[c];return r.fn!==u.fn||r.nums.length!==u.nums.length?l<1?`${r.fn}(${r.nums.map((o,p)=>`${o}${r.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((o,p)=>`${o}${u.units[p]}`).join(", ")})`:`${r.fn}(${r.nums.map((o,p)=>`${o+(u.nums[p]-o)*l}${r.units[p]}`).join(", ")})`}).join(" ")}function ft(t,i,l){if(typeof t=="number"&&typeof i=="number")return String(t+(i-t)*l);let s=String(t),m=String(i);if(wt(s))return a$4(s,m,l);if(s.includes("("))return Mt(s,m,l);let r=s.match(/^([-+]?[\d.]+)(.*)$/),c=m.match(/^([-+]?[\d.]+)(.*)$/);if(r&&c){let u=parseFloat(r[1]),o=parseFloat(c[1]);return `${u+(o-u)*l}${r[2]||c[2]}`}return l<1?s:m}function Lt(t){return t.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}var $t=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),At=0,pt="--scroll-draw-progress";function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var dt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Wt(t,i){return typeof window>"u"?dt:i.respectReducedMotion===false?gt(t,i,false):a(i,(l,s)=>gt(t,l,s))}function gt(t,i,l){let{props:s,trigger:m={},easing:r="ease-out",speed:c$1=1,once:u=false,axis:o="y",scrollContainer:p,native:yt=true,velocityScale:H=false,triggerElement:ht,onProgress:q,onComplete:F,onEnter:U,onLeave:X,onEnterBack:Y,onLeaveBack:Z}=i,x=typeof r=="function"?r:d[r]??d["ease-out"],J=a$1(m.start||"top bottom"),K=a$1(m.end||"bottom top"),N=ht??t,y=typeof p=="string"?document.querySelector(p):p??null,h=Object.entries(s).map(([e,n])=>({prop:Lt(e),from:Array.isArray(n)?n[0]:"",to:Array.isArray(n)?n[1]:n}));function Et(){let e=window.getComputedStyle(t);for(let n of h)n.from===""&&(n.from=e.getPropertyValue(n.prop).trim()||"0");}function bt(){for(let e of h)t.style.setProperty(e.prop,String(e.to));}let V=new Map;for(let e of [...h.map(n=>n.prop),pt])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 bt(),F?.(),{...dt,destroy:O,getProgress:()=>1};Et();let M=()=>y?o==="x"?y.scrollLeft:y.scrollTop:o==="x"?window.scrollX:window.scrollY,Q=()=>y?o==="x"?y.clientWidth:y.clientHeight:o==="x"?window.innerWidth:window.innerHeight,tt=typeof r=="string"?b(r):null;function St(){if(!yt||!Ct()||!tt||o!=="y"||y||N!==t||u||c$1!==1||q||F||U||X||Y||Z||H!==false||(m.start||"top bottom").trim()!=="top bottom"||(m.end||"bottom top").trim()!=="bottom top")return false;for(let e of h)if(!$t.has(e.prop))return false;return true}function vt(){let e=`ssd-a-${++At}`,n=h.map(a=>`${a.prop}:${a.from}`).join(";"),w=h.map(a=>`${a.prop}:${a.to}`).join(";"),b=document.createElement("style");b.setAttribute("data-ssd-animate",""),b.textContent=`@keyframes ${e}{from{${n}}to{${w}}}.${e}{animation-name:${e};animation-duration:auto;animation-timing-function:${tt};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(b),t.classList.add(e);let d=()=>{let a=t.getBoundingClientRect();return c({top:a.top,height:a.height},M(),Q(),J,K)};a$2(t,{type:"animate",getProgress:()=>f.getProgress(),getTrigger:d});let f={refresh(){},destroy(){t.classList.remove(e),b.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(a){let A=Math.min(1,Math.max(0,a));t.classList.remove(e);for(let I of h)t.style.setProperty(I.prop,ft(I.from,I.to,A));},getProgress(){let{tStart:a,tEnd:A}=d();return x(b$1(M(),a,A,c$1))}};return f}if(St())return vt();let g=0,E=0,T=false,W=-1,P=0,S=0,R=false,v=NaN,B=-1,et=0,L=N===t?h:[],nt=false;function rt(){let e=t.style,n=L.map(f=>e.getPropertyValue(f.prop)),w=e.transition;L.length&&(e.transition="none"),L.forEach(f=>e.setProperty(f.prop,V.get(f.prop)??""));let b=a$3(N,y,o);L.forEach((f,a)=>e.setProperty(f.prop,n[a])),L.length&&(t.offsetWidth,e.transition=w);let d=c(b,b.scroll,Q(),J,K);nt&&Math.abs(d.tStart-g)<1&&Math.abs(d.tEnd-E)<1||(nt=true,g=d.tStart,E=d.tEnd);}function k(e){t.style.setProperty(pt,String(e));for(let n of h)t.style.setProperty(n.prop,ft(n.from,n.to,e));q?.(e);}function Tt(e){if(isNaN(v)){v=e;return}v<=0&&e>0&&U?.(),v<1&&e>=1&&X?.(),v>=1&&e<1&&Y?.(),v>0&&e<=0&&Z?.(),v=e;}function Pt(){if(T)return;let e=performance.now(),n=M(),w=c$1;if(H!==false){let a=e-et,A=a>0?Math.abs(n-(B<0?n:B))/a:0;w=c$1*Math.max(.2,1+A*(typeof H=="number"?H:1)*.04);}B=n,et=e;let b=E===g?0:(n-g)/(E-g);Tt(b);let d=b$1(n,g,E,w),f=u?Math.max(W,x(P=Math.max(P,d))):x(d);S=f,k(f),f>=1&&!R?(R=true,F?.()):f<1&&!u&&(R=false);}let $=e(y??window,[N],()=>b$1(M(),g,E,Math.min(c$1,1)),Pt,rt);rt(),E===g&&b$2("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",t),P=b$1(M(),g,E,c$1),S=x(P),k(S),a$2(t,{type:"animate",getProgress:()=>S,getTrigger:()=>({tStart:g,tEnd:E})});function ot(){T=true,$.hold(true);}return {destroy(){T=true,$.off(),O(),b$3(t);},replay(){W=-1,P=0,R=false,S=0,T=false,k(0),$.hold(false);},pause:ot,resume(){T&&(T=false,$.hold(false));},seek(e){let n=Math.min(1,Math.max(0,e));S=n,W=n,P=0,ot(),k(n);},getProgress(){return S},refresh:$.remeasure}}export{Wt as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,e,c,b as b$2}from'./chunk-NV6YTPHI.mjs';import {d}from'./chunk-THPTANES.mjs';import {a as a$3}from'./chunk-4DOJSIEQ.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function G(e,o){let t=document.createElement("span");t.textContent=o,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 S(e=""){let o=document.createElement("span");return o.setAttribute("aria-hidden","true"),o.textContent=e,o}function W(e){let o=e.textContent??"";return e.textContent="",o.split(/(\s+)/).filter(Boolean).map(t=>{let n=e.appendChild(S(t)),i=/^\s+$/.test(t);return i?n.style.whiteSpace="pre":n.style.display="inline-block",i?null:n}).filter(t=>t!==null)}function X(e){let o=e.textContent??"";e.textContent="";let t=[],n=null;for(let i of o){let r=S(i),s=i===" ";s?r.style.whiteSpace="pre":(r.style.display="inline-block",t.push(r)),s||i>"\u0DFF"?n=null:n||(n=e.appendChild(S()),n.style.cssText="display:inline-block;white-space:nowrap"),(n??e).appendChild(r);}return t}function R(e){let o=W(e),t=new Map;for(let r of o){let s=r.offsetTop;t.has(s)||t.set(s,[]),t.get(s).push(r);}let n=[],i=Array.from(t.keys()).sort((r,s)=>r-s);for(let r of i){let s=t.get(r),p=S();p.style.display="inline-block",s.forEach((d,m)=>{let f=d.nextElementSibling;p.appendChild(d),m<s.length-1&&f&&f.style.whiteSpace==="pre"&&p.appendChild(f);}),n.push(p);}return e.textContent="",n.forEach((r,s)=>{e.appendChild(r),s<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function J(e,o,t,n){if(t<=1||n===0)return e;n=Math.min(n,1/t);let i=(t-1)*n,r=o*n,s=r+(1-i);return s<=r?e>=r?1:0:a$3((e-r)/(s-r),0,1)}function K(e,o){let t=[];if(o?.y!==void 0&&t.push(`translateY(${o.y*(1-e)}px)`),o?.x!==void 0&&t.push(`translateX(${o.x*(1-e)}px)`),o?.rotate!==void 0&&t.push(`rotate(${o.rotate*(1-e)}deg)`),o?.scale!==void 0){let n=o.scale+(1-o.scale)*e;t.push(`scale(${n})`);}return t.join(" ")}var v={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function se(e,o={}){if(typeof window>"u")return v;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),v;let n=t;return a(o,(i,r)=>Q(n,i,r))}function Q(e$1,o,t){let{split:n="words",stagger:i=.04,easing:r="ease-out",from:s={opacity:0,y:24},trigger:p={},once:d$1=true,onComplete:m}=o,f=typeof r=="function"?r:d[r]??d["ease-out"],_=a$1(p.start||"top 85%"),j=a$1(p.end||"top 40%"),b=e$1.innerHTML,I=e$1.textContent??"",a;n==="chars"?a=X(e$1):n==="lines"?a=R(e$1):a=W(e$1),G(e$1,I);let q=a.length;function z(l,T){s?.opacity!==void 0&&(l.style.opacity=String(s.opacity+(1-s.opacity)*T));let x=K(T,s);x&&(l.style.transform=x);}function c$1(l){e$1.style.setProperty("--scroll-draw-progress",String(l)),a.forEach((T,x)=>{let U=f(J(l,x,q,i));z(T,U);});}if(t)return c$1(1),m?.(),{...v,destroy:()=>{e$1.innerHTML=b;},getProgress:()=>1};c$1(0);let w=0,E=0,g=-1,u=0,h=false;function P(){({tStart:w,tEnd:E}=c(e$1.getBoundingClientRect(),window.scrollY,window.innerHeight,_,j));}let C=()=>b$2(window.scrollY,w,E,1);function F(){let l=d$1?g=Math.max(g,C()):C();u=l,c$1(l),l>=1&&!h?(h=true,m?.()):l<1&&!d$1&&(h=false);}P();let y=e(window,[e$1],C,F,()=>{n==="lines"&&(e$1.innerHTML=b,a=R(e$1),G(e$1,I),c$1(u)),P();});a$2(e$1,{type:"text",getProgress:()=>u,getTrigger:()=>({tStart:w,tEnd:E})});let k=()=>y.hold(false);return {destroy(){y.off(),e$1.innerHTML=b,b$1(e$1);},replay(){g=-1,h=false,u=0,c$1(0),k();},pause:()=>y.hold(true),resume:k,seek(l){y.hold(true),c$1(u=g=a$3(l,0,1));},getProgress(){return u}}}export{se as a};
|
package/dist/cinematic/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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,
|
|
2
|
-
exports.Cinematic=
|
|
1
|
+
'use strict';function D({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function H({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,y=[];for(let i=0;i<t;i++){let d=Math.pow(p,i);y.push(d),c+=d;}let l=[0],g=0;for(let i=0;i<t;i++)g+=y[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 h={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:D(),bounce:H(),elastic:P()};var V=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){V&&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 T(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 C="http://www.w3.org/2000/svg",O="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 Q(e){return h[e]??h.linear}var q={destroy:()=>{},getProgress:()=>0},I=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=O,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(C,"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(C,"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:Q(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:h["ease-in-out"]??h.linear,from:r.from,to:r.to}));}}let c=0,y=()=>{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=y(),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=y(),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=T(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=I;
|
package/dist/cinematic/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Cinematic}from'../chunk-
|
|
1
|
+
export{a as Cinematic}from'../chunk-BSW7W2Y5.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
|
package/dist/group/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';function sr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),
|
|
2
|
-
<div style="position:absolute;${
|
|
3
|
-
<div style="position:absolute;${m?`left:${i}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${i}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Bt=/[MmLlHhVvCcSsQqTtAaZz]/g;function yr(e,n,r){if(!_e)return;let t=(e.match(Bt)??[]).join("").toUpperCase(),o=(n.match(Bt)??[]).join("").toUpperCase(),c=(e.match(qt)??[]).length,u=(n.match(qt)??[]).length;if(t!==o){le(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}c!==u&&le(`morphTo: coordinate count differs (${c} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function hr(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,c=>{let u=parseFloat(c),i=t[o++]??u;return String(+(u+(i-u)*r).toFixed(4))})}function wt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:ut(n,(r,t)=>br(e,r,t))}function br(e,n,r){let{preset:t,...o}=n,c=t?{...Nt[t],...o}:o,{selector:u="path, polyline, line, polygon, rect, circle",speed:i=1,fade:m=false,easing:g="linear",trigger:E={},stagger:T=0,direction:b="forward",once:ce=false,debug:ke=false,axis:te="y",scrollContainer:De,autoReverse:Ie=false,delay:be=0,strokeColor:X,strokeWidth:ne,fillOpacity:oe,waypoints:Y,velocityScale:N=false,threshold:Z=0,rootMargin:Ye="0px",repeat:ue=0,repeatDelay:Me=0,morphTo:W,clip:fe,autoplay:Ve=false,duration:Ze=1e3,native:ft=true,onProgress:Pe,onStart:F,onComplete:_,onEnter:we,onLeave:me,onEnterBack:se,onLeaveBack:Ce}=c,L=fe===true?"left":typeof fe=="string"?fe:false,k=typeof g=="function"?g:Te[g]??Te.linear,Ae=Ne(E.start||"top bottom"),ie=Ne(E.end||"bottom top"),H=typeof De=="string"?document.querySelector(De):De??null,pe=Array.isArray(X)?X[0]:null,K=Array.isArray(X)?X[1]:typeof X=="string"?X:null,ae=Array.isArray(ne)?ne[0]:null,de=Array.isArray(ne)?ne[1]:typeof ne=="number"?ne:null,J=Array.isArray(oe)?oe[0]:null,ve=Array.isArray(oe)?oe[1]:typeof oe=="number"?oe:null;function ge(s){let a=s*100;switch(L){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(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-a}% 0 0)`}}let w=L?[]:Array.from(e.querySelectorAll(u)),G=[],Q=[],D=0,A=0,Le=T,Ke=0,M=false,l=false,f=0,re=false,V=-1,$=[],P=-1,d=false,I=0,q=0,Ee,mt=null;function Et(){mt?.destroy(),mt=null;}let Se=new Set,St=NaN,xe=true,Je=-1,xt=performance.now(),Oe=NaN;function ze(){return H?te==="x"?H.scrollLeft:H.scrollTop:te==="x"?window.scrollX:window.scrollY}function Tt(){return H?te==="x"?H.clientWidth:H.clientHeight:te==="x"?window.innerWidth:window.innerHeight}function Mt(){let s=nt(e,H,te);return Fe(s,s.scroll,Tt(),Ae,ie)}function Kt(){let s=A-D,a=w.length-1,p=H??document.documentElement,h=te==="x"?"Width":"Height";if(Le=T,T>0&&a>0&&s>0){let z=p[`scroll${h}`]-p[`client${h}`]-1-D-s/i;z>=0&&(Le=Math.min(T,z/(a*s)));}Ke=A+a*Le*s;}function Pt(){(({tStart:D,tEnd:A}=Mt())),Kt(),ke&&_e&&(Et(),mt=gr(D,A,te));}function pt(s,a=Mt){Be(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:a});let p=s.destroy;return s.destroy=()=>{p.call(s),Qe(e);},s}function At(s,a){return ce&&!Ie?Math.max(V,k($[s]=Math.max($[s]??0,a))):k(a)}function Jt(s,a){if(e.style.setProperty("--scroll-draw-progress",String(s)),L){let p=a==="reverse"?1-s:s;e.style.clipPath=ge(p);return}w.forEach((p,h)=>dt(p,h,s,a));}function dt(s,a,p,h){s.style.strokeDashoffset=h==="reverse"?`${G[a]*p}`:`${G[a]*(1-p)}`,m&&(s.style.opacity=h==="reverse"?`${1-p}`:`${p}`),pe&&K?s.style.stroke=st(pe,K,p):K&&(s.style.stroke=K),ae!==null&&de!==null?s.style.strokeWidth=`${ae+(de-ae)*p}`:de!==null&&(s.style.strokeWidth=`${de}`),J!==null&&ve!==null?s.style.fillOpacity=`${J+(ve-J)*p}`:ve!==null&&(s.style.fillOpacity=`${ve}`),W&&s.tagName.toLowerCase()==="path"&&Q[a]&&s.setAttribute("d",hr(Q[a],W,p));}function We(){if(e.style.setProperty("--scroll-draw-progress","0"),L){e.style.clipPath=ge(b==="reverse"?1:0);return}w.forEach((s,a)=>{s.style.strokeDasharray=`${G[a]}`,s.style.strokeDashoffset=b==="reverse"?"0":`${G[a]}`,m?s.style.opacity=b==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),ae!==null&&(s.style.strokeWidth=`${ae}`),J!==null&&(s.style.fillOpacity=`${J}`),W&&s.tagName.toLowerCase()==="path"&&Q[a]&&s.setAttribute("d",Q[a]);});}function Ge(s,a){let p=s.getAttribute("d"),h=ot(s);if(W&&Q[a]){s.setAttribute("d",W);let z=ot(s);s.setAttribute("d",Q[a]),h=Math.max(ot(s),z),s.setAttribute("d",p);}G[a]=h,s.style.strokeDasharray=`${h}`;}if(w.forEach((s,a)=>{dr(s);let p=s.tagName.toLowerCase()==="path";p?Q.push(s.getAttribute("d")??""):Q.push(""),Ge(s,a);let h=G[a];W&&(p?yr(Q[Q.length-1],W,s):le(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),r?(s.style.strokeDashoffset=b==="reverse"?`${h}`:"0",m&&(s.style.opacity="1"),K&&(s.style.stroke=K),de!==null&&(s.style.strokeWidth=`${de}`),ve!==null&&(s.style.fillOpacity=`${ve}`),W&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",W)):(s.style.strokeDashoffset=b==="reverse"?"0":`${h}`,m?s.style.opacity=b==="reverse"?"1":"0":s.style.opacity="",pe&&(s.style.stroke=pe),ae!==null&&(s.style.strokeWidth=`${ae}`),J!==null&&(s.style.fillOpacity=`${J}`));}),r)return L&&(e.style.clipPath=ge(1)),_?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};L&&(e.style.clipPath=ge(b==="reverse"?1:0));let Lt=typeof g=="string"?it(g):null;function er(){return !(ft===false||Ve||ke&&_e||!pr()||!w.length||!Lt||L||te!=="y"||H||i!==1||T!==0||ce||Ie||N!==false||W||Y||ue||be>0||Pe||F||_||we||me||se||Ce||X!=null||ne!=null||oe!=null||(E.start||"top bottom").trim()!=="top bottom"||(E.end||"bottom top").trim()!=="bottom top")}function tr(){let s=++mr,a=`svg-scroll-draw-${s}`,p=`svg-scroll-draw-host-${s}`,h=`--svg-scroll-draw-${s}`,z=b==="reverse"?"0":"var(--ssd-len)",ye=b==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${z};`,S=`stroke-dashoffset:${ye};`;m&&(j+=`opacity:${b==="reverse"?1:0};`,S+=`opacity:${b==="reverse"?0:1};`);let x=document.createElement("style");x.setAttribute("data-svg-scroll-draw",""),x.textContent=`@keyframes ${a}{from{${j}}to{${S}}}.${p}{view-timeline-name:${h};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${h};animation-range:cover 0% cover 100%;}`,document.head.appendChild(x),e.classList.add(p);function C(y,v){y.style.setProperty("--ssd-len",String(G[v])),y.style.strokeDasharray=`${G[v]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(a);}w.forEach(C);let O=false,B=-1;function U(){if(B>=0)return B;let y=e.getBoundingClientRect(),{tStart:v,tEnd:R}=Fe({top:y.top,height:y.height},ze(),Tt(),Ae,ie);return k(ee(ze(),v,R,i))}return {destroy(){e.classList.remove(p),w.forEach(y=>{y.classList.remove(a),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),x.remove();},replay(){O=false,B=-1,w.forEach(C);},pause(){O=true,w.forEach(y=>{y.style.animationPlayState="paused";});},resume(){O&&(O=false,w.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let v=Math.min(1,Math.max(0,y));B=v,O=true,w.forEach((R,he)=>{R.classList.remove(a),R.style.strokeDashoffset=b==="reverse"?`${G[he]*v}`:`${G[he]*(1-v)}`,m&&(R.style.opacity=b==="reverse"?`${1-v}`:`${v}`);});},getProgress(){return U()},refresh(){w.forEach((y,v)=>{Ge(y,v),y.style.setProperty("--ssd-len",String(G[v]));});}}}if(er())return pt(tr());function rr(){let s=Math.max(1,Ze),a=L?s:s*(1+Math.max(0,w.length-1)*T),p=0,h=0,z=false;function ye(B){let U=true,y=Math.min(1,Math.max(0,B/a));if(L){let v=Math.min(1,Math.max(0,B/s)),R=k(v);I=R,e.style.setProperty("--scroll-draw-progress",String(R)),e.style.clipPath=ge(b==="reverse"?1-R:R),Pe?.(R),v<1&&(U=false);}else {w.forEach((R,he)=>{let or=he*T*s,Dt=Math.min(1,Math.max(0,(B-or)/s));dt(R,he,k(Dt),b),Dt<1&&(U=false);});let v=k(y);I=v,Pe?.(v),e.style.setProperty("--scroll-draw-progress",String(v));}if(Y){let v=k(y);for(let R in Y){let he=parseFloat(R);v>=he&&!Se.has(he)&&(Se.add(he),Y[R]?.());}}return U}function j(B){if(d)return;let U=B-p;l||(l=true,F?.());let y=ye(U);if(y&&!M){M=true,ye(a),_?.(),q<(ue==="infinite"?1/0:ue??0)&&(q++,Ee=setTimeout(()=>{p=performance.now(),l=false,M=false,Se.clear(),We(),f=requestAnimationFrame(j);},Me));return}y||(f=requestAnimationFrame(j));}function S(){cancelAnimationFrame(f),clearTimeout(Ee),p=performance.now(),h=0,d=false,l=false,M=false,q=0,z=true,I=0,Se.clear(),We(),f=requestAnimationFrame(j);}let x=new IntersectionObserver(B=>{B.forEach(U=>{U.isIntersecting&&!(ce&&M)?S():!U.isIntersecting&&!ce&&!M&&(cancelAnimationFrame(f),clearTimeout(Ee),z=false);});},{root:H??null,threshold:Z,rootMargin:Ye}),C;function O(){clearTimeout(C),C=setTimeout(()=>w.forEach(Ge),150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),be>0?setTimeout(()=>x.observe(e),be):x.observe(e),{destroy(){cancelAnimationFrame(f),clearTimeout(Ee),x.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(C);},replay(){q=0,S();},pause(){d||!z||(d=true,h=performance.now()-p,cancelAnimationFrame(f));},resume(){d&&(d=false,z=true,p=performance.now()-h,f=requestAnimationFrame(j));},seek(B){let U=Math.min(1,Math.max(0,B));I=U,d=true,h=U*a,p=performance.now()-h,cancelAnimationFrame(f),ye(h);},getProgress(){return I},refresh(){clearTimeout(C),w.forEach(Ge);}}}if(Ve)return pt(rr());Pt();function $t(){if(d||!Re)return;let s=performance.now(),a=ze();if(!xe&&N===false&&a===St){yt(a);return}xe=false,St=a;let p=i;if(N!==false){let S=s-xt,x=S>0?Math.abs(a-(Je<0?a:Je))/S:0;p=i*Math.max(.2,1+x*(typeof N=="number"?N:1)*.04);}Je=a,xt=s;let h=Ie?P===-1||a>=P?"forward":"reverse":b;P=a;let z=A-D,ye=true,j=z===0?0:(a-D)/z;if(isNaN(Oe)||(Oe<=0&&j>0?we?.():Oe>0&&j<=0&&Ce?.(),Oe<1&&j>=1?me?.():Oe>=1&&j<1&&se?.()),Oe=j,L){let S=At(0,ee(a,D,A,p));I=S,e.style.setProperty("--scroll-draw-progress",String(S));let x=h==="reverse"?1-S:S;e.style.clipPath=ge(x),Pe?.(S),!l&&ee(a,D,A,p)>0&&(l=true,F?.()),S>=1&&!M?(M=true,_?.(),q<(ue==="infinite"?1/0:ue??0)&&(q++,Ee=setTimeout(()=>{V=-1,$=[],l=false,M=false,We();},Me))):S<1&&!ce&&(M=false),yt(a);return}if(w.forEach((S,x)=>{let C=x*Le*z,O=At(x,ee(a,D+C,A+C,p));dt(S,x,O,h),x===0&&(I=O,Pe?.(O),e.style.setProperty("--scroll-draw-progress",String(O))),O<1&&(ye=false);}),Y){let S=k(ee(a,D,A,p));for(let x in Y){let C=parseFloat(x);S>=C&&!Se.has(C)&&(Se.add(C),Y[x]?.());}}!l&&ee(a,D,A,p)>0&&(l=true,F?.()),ye&&!M?(M=true,_?.(),q<(ue==="infinite"?1/0:ue??0)&&(q++,Ee=setTimeout(()=>{V=-1,$=[],l=false,M=false,Se.clear(),We(),xe=true;},Me))):!ye&&!ce&&(M=false),yt(a);}function gt(s){return s>=A&&s<Ke}function yt(s){re||gt(s)?f=requestAnimationFrame($t):Re=false;}function ht(){return re||gt(ze())}let Re=false;function et(){Re||(Re=true,f=requestAnimationFrame(function(){$t();}));}function tt(){Re=false,cancelAnimationFrame(f);}let bt=new IntersectionObserver(s=>{s.forEach(a=>{re=a.isIntersecting,re&&!d?(xe=true,et()):Re&&!d&>(ze())||tt();});},{root:H??null,threshold:Z,rootMargin:Ye});function kt(){w.forEach(Ge),Pt(),xe=true;}let rt;function qe(){clearTimeout(rt),rt=setTimeout(kt,150);}window.addEventListener("resize",qe),window.addEventListener("orientationchange",qe);let nr=ct([e],qe);return be>0?setTimeout(()=>bt.observe(e),be):bt.observe(e),pt({destroy(){cancelAnimationFrame(f),clearTimeout(Ee),tt(),bt.disconnect(),nr(),window.removeEventListener("resize",qe),window.removeEventListener("orientationchange",qe),clearTimeout(rt),Et();},replay(){V=-1,$=[],P=-1,Je=-1,l=false,M=false,q=0,d=false,I=0,Se.clear(),clearTimeout(Ee),We(),xe=true,ht()&&et();},pause(){d=true,tt();},resume(){d&&(d=false,xe=true,ht()&&et());},seek(s){let a=Math.min(1,Math.max(0,s));I=a,V=a,$=[],d=true,tt(),Jt(a,b),xe=true;},getProgress(){return I},refresh(){clearTimeout(rt),kt(),ht()&&!d&&et();}},()=>({tStart:D,tEnd:A}))}function wr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Qt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],c=[],u=t[2].trim();if(u)for(let i of u.split(/[\s,]+/)){let m=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),c.push(m?m[2]:"");}n.push({fn:t[1],nums:o,units:c});}return n}function vr(e,n,r){let t=Qt(e),o=Qt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((c,u)=>{let i=o[u];return c.fn!==i.fn||c.nums.length!==i.nums.length?r<1?`${c.fn}(${c.nums.map((m,g)=>`${m}${c.units[g]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,g)=>`${m}${i.units[g]}`).join(", ")})`:`${c.fn}(${c.nums.map((m,g)=>`${m+(i.nums[g]-m)*r}${c.units[g]}`).join(", ")})`}).join(" ")}function vt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(wr(t))return st(t,o,r);if(t.includes("("))return vr(t,o,r);let c=t.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(c&&u){let i=parseFloat(c[1]),m=parseFloat(u[1]);return `${i+(m-i)*r}${c[2]||u[2]}`}return r<1?t:o}function Er(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Sr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),xr=0,jt="--scroll-draw-progress";function Tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function He(e,n){return typeof window>"u"?Xt:n.respectReducedMotion===false?Ut(e,n,false):ut(n,(r,t)=>Ut(e,r,t))}function Ut(e,n,r){let{props:t,trigger:o={},easing:c="ease-out",speed:u=1,once:i=false,axis:m="y",scrollContainer:g,native:E=true,velocityScale:T=false,triggerElement:b,onProgress:ce,onComplete:ke,onEnter:te,onLeave:De,onEnterBack:Ie,onLeaveBack:be}=n,X=typeof c=="function"?c:Te[c]??Te["ease-out"],ne=Ne(o.start||"top bottom"),oe=Ne(o.end||"bottom top"),Y=b??e,N=typeof g=="string"?document.querySelector(g):g??null,Z=Object.entries(t).map(([l,f])=>({prop:Er(l),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function Ye(){let l=window.getComputedStyle(e);for(let f of Z)f.from===""&&(f.from=l.getPropertyValue(f.prop).trim()||"0");}function ue(){for(let l of Z)e.style.setProperty(l.prop,String(l.to));}let Me=new Map;for(let l of [...Z.map(f=>f.prop),jt])Me.set(l,e.style.getPropertyValue(l));function W(){for(let[l,f]of Me)f?e.style.setProperty(l,f):e.style.removeProperty(l);}if(r)return ue(),ke?.(),{...Xt,destroy:W,getProgress:()=>1};Ye();let fe=()=>N?m==="x"?N.scrollLeft:N.scrollTop:m==="x"?window.scrollX:window.scrollY,Ve=()=>N?m==="x"?N.clientWidth:N.clientHeight:m==="x"?window.innerWidth:window.innerHeight,Ze=typeof c=="string"?it(c):null;function ft(){if(!E||!Tr()||!Ze||m!=="y"||N||Y!==e||i||u!==1||ce||ke||te||De||Ie||be||T!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of Z)if(!Sr.has(l.prop))return false;return true}function Pe(){let l=`ssd-a-${++xr}`,f=Z.map(d=>`${d.prop}:${d.from}`).join(";"),re=Z.map(d=>`${d.prop}:${d.to}`).join(";"),V=document.createElement("style");V.setAttribute("data-ssd-animate",""),V.textContent=`@keyframes ${l}{from{${f}}to{${re}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ze};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(V),e.classList.add(l);let $=()=>{let d=e.getBoundingClientRect();return Fe({top:d.top,height:d.height},fe(),Ve(),ne,oe)};Be(e,{type:"animate",getProgress:()=>P.getProgress(),getTrigger:$});let P={refresh(){},destroy(){e.classList.remove(l),V.remove(),e.style.animationPlayState="",W(),Qe(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(d){let I=Math.min(1,Math.max(0,d));e.classList.remove(l);for(let q of Z)e.style.setProperty(q.prop,vt(q.from,q.to,I));},getProgress(){let{tStart:d,tEnd:I}=$();return X(ee(fe(),d,I,u))}};return P}if(ft())return Pe();let F=0,_=0,we=0,me=NaN,se=false,Ce=-1,L=0,k=0,Ae=false,ie=NaN,H=-1,pe=0,K=Y===e?Z:[],ae=false;function de(){let l=e.style,f=K.map(P=>l.getPropertyValue(P.prop)),re=l.transition;K.length&&(l.transition="none"),K.forEach(P=>l.setProperty(P.prop,Me.get(P.prop)??""));let V=nt(Y,N,m);K.forEach((P,d)=>l.setProperty(P.prop,f[d])),K.length&&(e.offsetWidth,l.transition=re);let $=Fe(V,V.scroll,Ve(),ne,oe);ae&&Math.abs($.tStart-F)<1&&Math.abs($.tEnd-_)<1||(ae=true,F=$.tStart,_=$.tEnd);}function J(l){e.style.setProperty(jt,String(l));for(let f of Z)e.style.setProperty(f.prop,vt(f.from,f.to,l));ce?.(l);}function ve(l){if(isNaN(ie)){ie=l;return}ie<=0&&l>0?te?.():ie>0&&l<=0&&be?.(),ie<1&&l>=1?De?.():ie>=1&&l<1&&Ie?.(),ie=l;}let ge=l=>ee(l,F,_,Math.min(u,1));function w(){!we&&!se&&ge(fe())!==me&&(we=requestAnimationFrame(G));}function G(){if(se)return;let l=performance.now(),f=fe(),re=u;if(T!==false){let d=l-pe,I=d>0?Math.abs(f-(H<0?f:H))/d:0;re=u*Math.max(.2,1+I*(typeof T=="number"?T:1)*.04);}H=f,pe=l;let V=_===F?0:(f-F)/(_-F);ve(V);let $=ee(f,F,_,re),P=i?Math.max(Ce,X(L=Math.max(L,$))):X($);k=P,J(P),P>=1&&!Ae?(Ae=true,ke?.()):P<1&&!i&&(Ae=false),!se&&(me=ge(f),we=me>0&&me<1?requestAnimationFrame(G):0);}de(),_===F&&le("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),L=ee(fe(),F,_,u),k=X(L),J(k);function Q(){de(),w();}let D;function A(){clearTimeout(D),D=setTimeout(Q,150);}let Le=N??window;Le.addEventListener("scroll",w,{passive:true}),window.addEventListener("resize",A),window.addEventListener("orientationchange",A);let Ke=ct([Y],A);w(),Be(e,{type:"animate",getProgress:()=>k,getTrigger:()=>({tStart:F,tEnd:_})});function M(){se=true,cancelAnimationFrame(we),we=0,me=NaN;}return {destroy(){M(),Le.removeEventListener("scroll",w),window.removeEventListener("resize",A),window.removeEventListener("orientationchange",A),Ke(),clearTimeout(D),W(),Qe(e);},replay(){Ce=-1,L=0,Ae=false,k=0,se=false,J(0),me=0,w();},pause:M,resume(){se&&(se=false,w());},seek(l){let f=Math.min(1,Math.max(0,l));k=f,Ce=f,L=0,M(),J(f);},getProgress(){return k},refresh:Q}}var Yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Zt(e,n={}){if(typeof window>"u")return Yt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return le("scrollParallax: element not found:",e),Yt;let{speed:t=.3,axis:o="y",easing:c="linear",trigger:u,onProgress:i}=n,m=-t*100,g=r.style,E=!!r.ownerSVGElement,T=g.getPropertyValue("transform-box");E&&g.setProperty("transform-box","fill-box");let b=He(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:c,native:false,onProgress:i});return E?{...b,destroy(){b.destroy(),g.setProperty("transform-box",T);}}:b}function Xe(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var $e={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yn(e,n={}){if(typeof window>"u")return $e;let r=Xe(e).map(t=>wt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function hn(e,n={}){if(typeof window>"u")return $e;let r=Xe(e);if(r.length===0)return $e;let t=0,o=[];function c(i){return wt(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,m)=>{o[m]=c(m);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function bn(e,n){if(typeof window>"u")return $e;let r=Xe(e).map(t=>He(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function wn(e,n){if(typeof window>"u")return $e;let r=Xe(e);if(r.length===0)return $e;let t=0,o=[];function c(i){return He(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,m)=>{o[m]=c(m);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function vn(e,n={}){if(typeof window>"u")return $e;let r=Xe(e).map(t=>Zt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}exports.scrollAnimateGroup=bn;exports.scrollAnimateSequence=wn;exports.scrollDrawGroup=yn;exports.scrollDrawSequence=hn;exports.scrollParallaxGroup=vn;
|
|
1
|
+
'use strict';function or({tension:e=2.5,friction:n=2.2}={}){return r=>1-Math.cos(r*Math.PI*e)*Math.pow(1-r,n)}function sr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),a=0,u=[];for(let d=0;d<r;d++){let b=Math.pow(o,d);u.push(b),a+=b;}let i=[0],f=0;for(let d=0;d<r;d++)f+=u[d]/a,i.push(f);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let b=0;b<r;b++)if(d<=i[b+1]){let E=(d-i[b])/(i[b+1]-i[b]);if(b===0)return E*(2-E);let g=1-Math.pow(t,b);return g+(1-g)*(2*E-1)*(2*E-1)}return 1}}function ir({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return a=>a<=0?0:a>=1?1:r*Math.pow(2,-10*a)*Math.sin((a-o)*(2*Math.PI)/t)+1}var ve={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:or(),bounce:sr(),elastic:ir()};function $t(e,n,r){return Math.min(r,Math.max(n,e))}function Ce(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}var Ct=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function kt(e,n,r,t){return e+r+n*Ct(t,0)}function Dt(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:Ct(e,1))}function Q(e,n,r,t){return r===n?0:$t((e-n)/(r-n)*t,0,1)}function Oe(e,n,r,t,o){let a=kt(e.top,e.height,n,t.element)-Dt(t.viewport,r),u=kt(e.top,e.height,n,o.element)-Dt(o.viewport,r);return {tStart:a,tEnd:u}}function Ze(e,n,r){let t=e.getBoundingClientRect(),o=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:t.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function Ke(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(t+o)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function Ot(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function Je(e,n,r){let t=Ot(e),o=Ot(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var It={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ie=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function oe(e,...n){Ie&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var ar="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",lr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Rt=33;function cr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function ur(e){let n=[];for(let r=0;r<Rt;r++){let t=r/(Rt-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function et(e){switch(e){case "linear":return "linear";case "ease-in":return ar;case "ease-out":return lr;case "ease-in-out":return cr()?ur(ve["ease-in-out"]):null;default:return null}}var Nt=Symbol.for("svg-scroll-draw.registry");function Ft(){let e=globalThis;return e[Nt]||(e[Nt]=new Map)}function Ge(e,n){Ft().set(e,n);}function We(e){Ft().delete(e);}function Ht(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",r),()=>n.removeEventListener("change",r);let t=n;return t.addListener?.(r),()=>t.removeListener?.(r)}function tt(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let r=n(e,false),t=Ht(a=>{if(!a)return;t();let u=(r.getProgress?.()??0)>=1;r.destroy(),r=n(u?{...e,onComplete:void 0}:e,true);}),o={};for(let a of Object.keys(r))o[a]=(...u)=>r[a]?.(...u);return o.destroy=()=>{t(),r.destroy();},o}var ze,rt=new Set,nt=new WeakMap,qe=new Map,_t=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function fr(e){let n=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let t=r;t;t=t.previousElementSibling)n.add(t);return n}function Vt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();ze??(ze=new ResizeObserver(o=>{let a=false;for(let{target:u}of o)nt.get(u)!==_t(u)&&(a=true),nt.set(u,"");a&&rt.forEach(u=>u());})),rt.add(r);let t=fr(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{nt.has(o)||nt.set(o,_t(o)),qe.set(o,(qe.get(o)??0)+1),ze.observe(o);}),()=>{rt.delete(r)&&(t.forEach(o=>{let a=(qe.get(o)??1)-1;if(a)return void qe.set(o,a);qe.delete(o),ze?.unobserve(o);}),rt.size||(ze?.disconnect(),ze=void 0));}}function ot(e,n,r,t,o){let a,u=NaN,i,f,d=()=>{a=0,t(),!i&&!a&&(u=r())>0&&u<1&&(a=requestAnimationFrame(d));},b=()=>{!a&&!i&&r()!==u&&(a=requestAnimationFrame(d));},E=U=>{i=U,cancelAnimationFrame(a),a=u=NaN,b();},g=()=>{clearTimeout(f),o(),b();},q=()=>{clearTimeout(f),f=setTimeout(g,150);},ge=Vt(n,q),_=U=>{e[U]("scroll",b,{passive:true}),window[U]("resize",q),window[U]("orientationchange",q);};return _("addEventListener"),b(),{hold:E,remeasure:g,off(){E(true),_("removeEventListener"),ge(),clearTimeout(f);}}}var mr=0;function pr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Gt(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Wt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function dr(e){if(!Ie)return;let n=Gt(e,"stroke");if(!n||n==="none"){oe("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Wt.has(r)&&!Wt.has(Gt(e,"fill"))&&oe("Element has a fill \u2014 it may obscure the stroke animation.",e);}function gr(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function o(){let a=r==="x"?window.scrollX:window.scrollY,u=e-a,i=n-a,f=r==="x";t.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${f?`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;${f?`left:${i}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${i}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var zt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,qt=/[MmLlHhVvCcSsQqTtAaZz]/g;function yr(e,n,r){if(!Ie)return;let t=(e.match(qt)??[]).join("").toUpperCase(),o=(n.match(qt)??[]).join("").toUpperCase(),a=(e.match(zt)??[]).length,u=(n.match(zt)??[]).length;if(t!==o){oe(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}a!==u&&oe(`morphTo: coordinate count differs (${a} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function hr(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,a=>{let u=parseFloat(a),i=t[o++]??u;return String(+(u+(i-u)*r).toFixed(4))})}function dt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:tt(n,(r,t)=>br(e,r,t))}function br(e,n,r){let{preset:t,...o}=n,a=t?{...It[t],...o}:o,{selector:u="path, polyline, line, polygon, rect, circle",speed:i=1,fade:f=false,easing:d="linear",trigger:b={},stagger:E=0,direction:g="forward",once:q=false,debug:ge=false,axis:_="y",scrollContainer:U,autoReverse:Pe=false,delay:ye=0,strokeColor:Y,strokeWidth:ee,fillOpacity:te,waypoints:X,velocityScale:R=false,threshold:J=0,rootMargin:st="0px",repeat:we=0,repeatDelay:Ae=0,morphTo:V,clip:se,autoplay:Ne=false,duration:je=1e3,native:it=true,onProgress:Ee,onStart:N,onComplete:G,onEnter:ie,onLeave:Le,onEnterBack:ae,onLeaveBack:re}=a,F=se===true?"left":typeof se=="string"?se:false,D=typeof d=="function"?d:ve[d]??ve.linear,$e=Ce(b.start||"top bottom"),Fe=Ce(b.end||"bottom top"),A=typeof U=="string"?document.querySelector(U):U??null,le=Array.isArray(Y)?Y[0]:null,ce=Array.isArray(Y)?Y[1]:typeof Y=="string"?Y:null,Z=Array.isArray(ee)?ee[0]:null,he=Array.isArray(ee)?ee[1]:typeof ee=="number"?ee:null,ue=Array.isArray(te)?te[0]:null,K=Array.isArray(te)?te[1]:typeof te=="number"?te:null;function fe(s){let c=s*100;switch(F){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${s*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let l=F?[]:Array.from(e.querySelectorAll(u)),m=[],L=[],v=0,S=0,P=E,x=0,be=0,$=false,me=false,pe=0,at=-1,Qe=[],Ue=-1,B=false,ne=0,Se=0,xe,lt=false,ct=null;function yt(){ct?.destroy(),ct=null;}let Me=new Set,ht=NaN,ke=true,Ye=-1,bt=performance.now(),De=NaN;function Xe(){return A?_==="x"?A.scrollLeft:A.scrollTop:_==="x"?window.scrollX:window.scrollY}function vt(){return A?_==="x"?A.clientWidth:A.clientHeight:_==="x"?window.innerWidth:window.innerHeight}function wt(){let s=Ze(e,A,_);return Oe(s,s.scroll,vt(),$e,Fe)}function Zt(){let s=S-v,c=l.length-1,p=A??document.documentElement,h=_==="x"?"Width":"Height";if(P=E,E>0&&c>0&&s>0){let C=p[`scroll${h}`]-p[`client${h}`]-1-v-s/i;C>=0&&(P=Math.min(E,C/(c*s)));}let k=Math.max(0,c)*P*s,W=s/Math.min(i,1);x=v+Math.min(0,k,W,k+W),be=v+Math.max(0,k,W,k+W);}function Et(){(({tStart:v,tEnd:S}=wt())),Zt(),ge&&Ie&&(yt(),ct=gr(v,S,_));}function ut(s,c=wt){Ge(e,{type:"draw",getProgress:()=>s.getProgress(),getTrigger:c});let p=s.destroy;return s.destroy=()=>{p.call(s),We(e);},s}function St(s,c){return q&&!Pe?Math.max(at,D(Qe[s]=Math.max(Qe[s]??0,c))):D(c)}function Kt(s,c){if(e.style.setProperty("--scroll-draw-progress",String(s)),F){let p=c==="reverse"?1-s:s;e.style.clipPath=fe(p);return}l.forEach((p,h)=>ft(p,h,s,c));}function ft(s,c,p,h){s.style.strokeDashoffset=h==="reverse"?`${m[c]*p}`:`${m[c]*(1-p)}`,f&&(s.style.opacity=h==="reverse"?`${1-p}`:`${p}`),le&&ce?s.style.stroke=Je(le,ce,p):ce&&(s.style.stroke=ce),Z!==null&&he!==null?s.style.strokeWidth=`${Z+(he-Z)*p}`:he!==null&&(s.style.strokeWidth=`${he}`),ue!==null&&K!==null?s.style.fillOpacity=`${ue+(K-ue)*p}`:K!==null&&(s.style.fillOpacity=`${K}`),V&&s.tagName.toLowerCase()==="path"&&L[c]&&s.setAttribute("d",hr(L[c],V,p));}function mt(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=fe(g==="reverse"?1:0);return}l.forEach((s,c)=>{s.style.strokeDasharray=`${m[c]}`,s.style.strokeDashoffset=g==="reverse"?"0":`${m[c]}`,f?s.style.opacity=g==="reverse"?"1":"0":s.style.opacity="",le&&(s.style.stroke=le),Z!==null&&(s.style.strokeWidth=`${Z}`),ue!==null&&(s.style.fillOpacity=`${ue}`),V&&s.tagName.toLowerCase()==="path"&&L[c]&&s.setAttribute("d",L[c]);});}function He(s,c){let p=s.getAttribute("d"),h=Ke(s);if(V&&L[c]){s.setAttribute("d",V);let k=Ke(s);s.setAttribute("d",L[c]),h=Math.max(Ke(s),k),s.setAttribute("d",p);}m[c]=h,s.style.strokeDasharray=`${h}`;}if(l.forEach((s,c)=>{dr(s);let p=s.tagName.toLowerCase()==="path";p?L.push(s.getAttribute("d")??""):L.push(""),He(s,c);let h=m[c];V&&(p?yr(L[L.length-1],V,s):oe(`morphTo only applies to <path> elements \u2014 ignored on <${s.tagName}>.`,s)),r?(s.style.strokeDashoffset=g==="reverse"?`${h}`:"0",f&&(s.style.opacity="1"),ce&&(s.style.stroke=ce),he!==null&&(s.style.strokeWidth=`${he}`),K!==null&&(s.style.fillOpacity=`${K}`),V&&s.tagName.toLowerCase()==="path"&&s.setAttribute("d",V)):(s.style.strokeDashoffset=g==="reverse"?"0":`${h}`,f?s.style.opacity=g==="reverse"?"1":"0":s.style.opacity="",le&&(s.style.stroke=le),Z!==null&&(s.style.strokeWidth=`${Z}`),ue!==null&&(s.style.fillOpacity=`${ue}`));}),r)return F&&(e.style.clipPath=fe(1)),G?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};F&&(e.style.clipPath=fe(g==="reverse"?1:0));let xt=typeof d=="string"?et(d):null;function Jt(){return !(it===false||Ne||ge&&Ie||!pr()||!l.length||!xt||F||_!=="y"||A||i!==1||E!==0||q||Pe||R!==false||V||X||we||ye>0||Ee||N||G||ie||Le||ae||re||Y!=null||ee!=null||te!=null||(b.start||"top bottom").trim()!=="top bottom"||(b.end||"bottom top").trim()!=="bottom top")}function er(){let s=++mr,c=`svg-scroll-draw-${s}`,p=`svg-scroll-draw-host-${s}`,h=`--svg-scroll-draw-${s}`,k=g==="reverse"?"0":"var(--ssd-len)",W=g==="reverse"?"var(--ssd-len)":"0",C=`stroke-dashoffset:${k};`,M=`stroke-dashoffset:${W};`;f&&(C+=`opacity:${g==="reverse"?1:0};`,M+=`opacity:${g==="reverse"?0:1};`);let T=document.createElement("style");T.setAttribute("data-svg-scroll-draw",""),T.textContent=`@keyframes ${c}{from{${C}}to{${M}}}.${p}{view-timeline-name:${h};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${xt};animation-fill-mode:both;animation-timeline:${h};animation-range:cover 0% cover 100%;}`,document.head.appendChild(T),e.classList.add(p);function H(y,w){y.style.setProperty("--ssd-len",String(m[w])),y.style.strokeDasharray=`${m[w]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(c);}l.forEach(H);let O=false,z=-1;function j(){if(z>=0)return z;let y=e.getBoundingClientRect(),{tStart:w,tEnd:I}=Oe({top:y.top,height:y.height},Xe(),vt(),$e,Fe);return D(Q(Xe(),w,I,i))}return {destroy(){e.classList.remove(p),l.forEach(y=>{y.classList.remove(c),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),T.remove();},replay(){O=false,z=-1,l.forEach(H);},pause(){O=true,l.forEach(y=>{y.style.animationPlayState="paused";});},resume(){O&&(O=false,l.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let w=Math.min(1,Math.max(0,y));z=w,O=true,l.forEach((I,de)=>{I.classList.remove(c),I.style.strokeDashoffset=g==="reverse"?`${m[de]*w}`:`${m[de]*(1-w)}`,f&&(I.style.opacity=g==="reverse"?`${1-w}`:`${w}`);});},getProgress(){return j()},refresh(){l.forEach((y,w)=>{He(y,w),y.style.setProperty("--ssd-len",String(m[w]));});}}}if(Jt())return ut(er());function tr(){let s=Math.max(1,je),c=F?s:s*(1+Math.max(0,l.length-1)*E),p=0,h=0,k=false;function W(z){let j=true,y=Math.min(1,Math.max(0,z/c));if(F){let w=Math.min(1,Math.max(0,z/s)),I=D(w);ne=I,e.style.setProperty("--scroll-draw-progress",String(I)),e.style.clipPath=fe(g==="reverse"?1-I:I),Ee?.(I),w<1&&(j=false);}else {l.forEach((I,de)=>{let nr=de*E*s,Lt=Math.min(1,Math.max(0,(z-nr)/s));ft(I,de,D(Lt),g),Lt<1&&(j=false);});let w=D(y);ne=w,Ee?.(w),e.style.setProperty("--scroll-draw-progress",String(w));}if(X){let w=D(y);for(let I in X){let de=parseFloat(I);w>=de&&!Me.has(de)&&(Me.add(de),X[I]?.());}}return j}function C(z){if(B)return;let j=z-p;me||(me=true,N?.());let y=W(j);if(y&&!$){$=true,W(c),G?.(),Se<(we==="infinite"?1/0:we??0)&&(Se++,xe=setTimeout(()=>{p=performance.now(),me=false,$=false,Me.clear(),mt(),pe=requestAnimationFrame(C);},Ae));return}y||(pe=requestAnimationFrame(C));}function M(){cancelAnimationFrame(pe),clearTimeout(xe),p=performance.now(),h=0,B=false,me=false,$=false,Se=0,k=true,ne=0,Me.clear(),mt(),pe=requestAnimationFrame(C);}let T=new IntersectionObserver(z=>{z.forEach(j=>{j.isIntersecting&&!(q&&$)?M():!j.isIntersecting&&!q&&!$&&(cancelAnimationFrame(pe),clearTimeout(xe),k=false);});},{root:A??null,threshold:J,rootMargin:st}),H;function O(){clearTimeout(H),H=setTimeout(()=>l.forEach(He),150);}return window.addEventListener("resize",O),window.addEventListener("orientationchange",O),ye>0?setTimeout(()=>T.observe(e),ye):T.observe(e),{destroy(){cancelAnimationFrame(pe),clearTimeout(xe),T.disconnect(),window.removeEventListener("resize",O),window.removeEventListener("orientationchange",O),clearTimeout(H);},replay(){Se=0,M();},pause(){B||!k||(B=true,h=performance.now()-p,cancelAnimationFrame(pe));},resume(){B&&(B=false,k=true,p=performance.now()-h,pe=requestAnimationFrame(C));},seek(z){let j=Math.min(1,Math.max(0,z));ne=j,B=true,h=j*c,p=performance.now()-h,cancelAnimationFrame(pe),W(h);},getProgress(){return ne},refresh(){clearTimeout(H),l.forEach(He);}}}if(Ne)return ut(tr());Et();let Mt=()=>Q(Xe(),x,be,1);function Tt(){$=true,G?.(),Se<(we==="infinite"?1/0:we)&&(Se++,xe=setTimeout(()=>{lt=true;},Ae));}function Pt(){at=-1,Qe=[],me=false,$=false,lt=false,Me.clear(),mt(),ke=true;}function rr(){let s=performance.now(),c=Xe();if(lt&&Mt()%1&&Pt(),!ke&&R===false&&c===ht)return;ke=false,ht=c;let p=i;if(R!==false){let M=s-bt,T=M>0?Math.abs(c-(Ye<0?c:Ye))/M:0;p=i*Math.max(.2,1+T*(typeof R=="number"?R:1)*.04);}Ye=c,bt=s;let h=Pe?Ue===-1||c>=Ue?"forward":"reverse":g;Ue=c;let k=S-v,W=true,C=k===0?0:(c-v)/k;if(isNaN(De)||(De<=0&&C>0&&ie?.(),De<1&&C>=1&&Le?.(),De>=1&&C<1&&ae?.(),De>0&&C<=0&&re?.()),De=C,F){let M=St(0,Q(c,v,S,p));ne=M,e.style.setProperty("--scroll-draw-progress",String(M));let T=h==="reverse"?1-M:M;e.style.clipPath=fe(T),Ee?.(M),!me&&Q(c,v,S,p)>0&&(me=true,N?.()),M>=1&&!$?Tt():M<1&&!q&&($=false);return}if(l.forEach((M,T)=>{let H=T*P*k,O=St(T,Q(c,v+H,S+H,p));ft(M,T,O,h),T===0&&(ne=O,Ee?.(O),e.style.setProperty("--scroll-draw-progress",String(O))),O<1&&(W=false);}),X){let M=D(Q(c,v,S,p));for(let T in X){let H=parseFloat(T);M>=H&&!Me.has(H)&&(Me.add(H),X[T]?.());}}!me&&Q(c,v,S,p)>0&&(me=true,N?.()),W&&!$?Tt():!W&&!q&&($=false);}let _e=ot(A??window,[e],Mt,rr,()=>{let s=m.join();l.forEach(He),Et(),ke=true,m.join()!==s&&Ve();}),pt=ye>0;function Ve(){_e.hold(B||pt);}let At;return pt&&(At=setTimeout(()=>{pt=false,Ve();},ye)),Ve(),ut({destroy(){clearTimeout(xe),clearTimeout(At),_e.off(),yt();},replay(){Pt(),Ue=-1,Ye=-1,Se=0,B=false,ne=0,clearTimeout(xe),Ve();},pause(){B=true,_e.hold(true);},resume(){B&&(B=false,ke=true,Ve());},seek(s){let c=Math.min(1,Math.max(0,s));ne=c,at=c,Qe=[],B=true,_e.hold(true),Kt(c,g),ke=true;},getProgress(){return ne},refresh:_e.remeasure},()=>({tStart:v,tEnd:S}))}function vr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Bt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],a=[],u=t[2].trim();if(u)for(let i of u.split(/[\s,]+/)){let f=i.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(f?parseFloat(f[1]):0),a.push(f?f[2]:"");}n.push({fn:t[1],nums:o,units:a});}return n}function wr(e,n,r){let t=Bt(e),o=Bt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((a,u)=>{let i=o[u];return a.fn!==i.fn||a.nums.length!==i.nums.length?r<1?`${a.fn}(${a.nums.map((f,d)=>`${f}${a.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((f,d)=>`${f}${i.units[d]}`).join(", ")})`:`${a.fn}(${a.nums.map((f,d)=>`${f+(i.nums[d]-f)*r}${a.units[d]}`).join(", ")})`}).join(" ")}function gt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(vr(t))return Je(t,o,r);if(t.includes("("))return wr(t,o,r);let a=t.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(a&&u){let i=parseFloat(a[1]),f=parseFloat(u[1]);return `${i+(f-i)*r}${a[2]||u[2]}`}return r<1?t:o}function Er(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Sr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),xr=0,jt="--scroll-draw-progress";function Mr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Re(e,n){return typeof window>"u"?Ut:n.respectReducedMotion===false?Qt(e,n,false):tt(n,(r,t)=>Qt(e,r,t))}function Qt(e,n,r){let{props:t,trigger:o={},easing:a="ease-out",speed:u=1,once:i=false,axis:f="y",scrollContainer:d,native:b=true,velocityScale:E=false,triggerElement:g,onProgress:q,onComplete:ge,onEnter:_,onLeave:U,onEnterBack:Pe,onLeaveBack:ye}=n,Y=typeof a=="function"?a:ve[a]??ve["ease-out"],ee=Ce(o.start||"top bottom"),te=Ce(o.end||"bottom top"),X=g??e,R=typeof d=="string"?document.querySelector(d):d??null,J=Object.entries(t).map(([l,m])=>({prop:Er(l),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function st(){let l=window.getComputedStyle(e);for(let m of J)m.from===""&&(m.from=l.getPropertyValue(m.prop).trim()||"0");}function we(){for(let l of J)e.style.setProperty(l.prop,String(l.to));}let Ae=new Map;for(let l of [...J.map(m=>m.prop),jt])Ae.set(l,e.style.getPropertyValue(l));function V(){for(let[l,m]of Ae)m?e.style.setProperty(l,m):e.style.removeProperty(l);}if(r)return we(),ge?.(),{...Ut,destroy:V,getProgress:()=>1};st();let se=()=>R?f==="x"?R.scrollLeft:R.scrollTop:f==="x"?window.scrollX:window.scrollY,Ne=()=>R?f==="x"?R.clientWidth:R.clientHeight:f==="x"?window.innerWidth:window.innerHeight,je=typeof a=="string"?et(a):null;function it(){if(!b||!Mr()||!je||f!=="y"||R||X!==e||i||u!==1||q||ge||_||U||Pe||ye||E!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of J)if(!Sr.has(l.prop))return false;return true}function Ee(){let l=`ssd-a-${++xr}`,m=J.map(x=>`${x.prop}:${x.from}`).join(";"),L=J.map(x=>`${x.prop}:${x.to}`).join(";"),v=document.createElement("style");v.setAttribute("data-ssd-animate",""),v.textContent=`@keyframes ${l}{from{${m}}to{${L}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${je};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),e.classList.add(l);let S=()=>{let x=e.getBoundingClientRect();return Oe({top:x.top,height:x.height},se(),Ne(),ee,te)};Ge(e,{type:"animate",getProgress:()=>P.getProgress(),getTrigger:S});let P={refresh(){},destroy(){e.classList.remove(l),v.remove(),e.style.animationPlayState="",V(),We(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(x){let be=Math.min(1,Math.max(0,x));e.classList.remove(l);for(let $ of J)e.style.setProperty($.prop,gt($.from,$.to,be));},getProgress(){let{tStart:x,tEnd:be}=S();return Y(Q(se(),x,be,u))}};return P}if(it())return Ee();let N=0,G=0,ie=false,Le=-1,ae=0,re=0,F=false,D=NaN,$e=-1,Fe=0,A=X===e?J:[],le=false;function ce(){let l=e.style,m=A.map(P=>l.getPropertyValue(P.prop)),L=l.transition;A.length&&(l.transition="none"),A.forEach(P=>l.setProperty(P.prop,Ae.get(P.prop)??""));let v=Ze(X,R,f);A.forEach((P,x)=>l.setProperty(P.prop,m[x])),A.length&&(e.offsetWidth,l.transition=L);let S=Oe(v,v.scroll,Ne(),ee,te);le&&Math.abs(S.tStart-N)<1&&Math.abs(S.tEnd-G)<1||(le=true,N=S.tStart,G=S.tEnd);}function Z(l){e.style.setProperty(jt,String(l));for(let m of J)e.style.setProperty(m.prop,gt(m.from,m.to,l));q?.(l);}function he(l){if(isNaN(D)){D=l;return}D<=0&&l>0&&_?.(),D<1&&l>=1&&U?.(),D>=1&&l<1&&Pe?.(),D>0&&l<=0&&ye?.(),D=l;}function ue(){if(ie)return;let l=performance.now(),m=se(),L=u;if(E!==false){let x=l-Fe,be=x>0?Math.abs(m-($e<0?m:$e))/x:0;L=u*Math.max(.2,1+be*(typeof E=="number"?E:1)*.04);}$e=m,Fe=l;let v=G===N?0:(m-N)/(G-N);he(v);let S=Q(m,N,G,L),P=i?Math.max(Le,Y(ae=Math.max(ae,S))):Y(S);re=P,Z(P),P>=1&&!F?(F=true,ge?.()):P<1&&!i&&(F=false);}let K=ot(R??window,[X],()=>Q(se(),N,G,Math.min(u,1)),ue,ce);ce(),G===N&&oe("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ae=Q(se(),N,G,u),re=Y(ae),Z(re),Ge(e,{type:"animate",getProgress:()=>re,getTrigger:()=>({tStart:N,tEnd:G})});function fe(){ie=true,K.hold(true);}return {destroy(){ie=true,K.off(),V(),We(e);},replay(){Le=-1,ae=0,F=false,re=0,ie=false,Z(0),K.hold(false);},pause:fe,resume(){ie&&(ie=false,K.hold(false));},seek(l){let m=Math.min(1,Math.max(0,l));re=m,Le=m,ae=0,fe(),Z(m);},getProgress(){return re},refresh:K.remeasure}}var Yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Xt(e,n={}){if(typeof window>"u")return Yt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return oe("scrollParallax: element not found:",e),Yt;let{speed:t=.3,axis:o="y",easing:a="linear",trigger:u,onProgress:i}=n,f=-t*100,d=r.style,b=!!r.ownerSVGElement,E=d.getPropertyValue("transform-box");b&&d.setProperty("transform-box","fill-box");let g=Re(r,{props:o==="x"?{transform:["translateX(0%)",`translateX(${f}%)`]}:{transform:["translateY(0%)",`translateY(${f}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:a,native:false,onProgress:i});return b?{...g,destroy(){g.destroy(),d.setProperty("transform-box",E);}}:g}function Be(e){return e.map(n=>typeof n=="string"?document.querySelector(n):n).filter(n=>n!==null)}var Te={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bn(e,n={}){if(typeof window>"u")return Te;let r=Be(e).map(t=>dt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function vn(e,n={}){if(typeof window>"u")return Te;let r=Be(e);if(r.length===0)return Te;let t=0,o=[];function a(i){return dt(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,f)=>{o[f]=a(f);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function wn(e,n){if(typeof window>"u")return Te;let r=Be(e).map(t=>Re(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}function En(e,n){if(typeof window>"u")return Te;let r=Be(e);if(r.length===0)return Te;let t=0,o=[];function a(i){return Re(r[i],{...n,once:true,onComplete(){n.onComplete?.(),t=Math.min(i+1,r.length-1),t>i&&o[t]?.resume();}})}function u(){r.forEach((i,f)=>{o[f]=a(f);});for(let i=1;i<o.length;i++)o[i].pause();}return u(),{destroy(){o.forEach(i=>i.destroy()),o.length=0;},replay(){o.forEach(i=>i.destroy()),o.length=0,t=0,u();},pause(){o[t]?.pause();},resume(){o[t]?.resume();},seek(i){o[t]?.seek(i);},getProgress(){return o[t]?.getProgress()??0},refresh(){o.forEach(i=>i.refresh?.());}}}function Sn(e,n={}){if(typeof window>"u")return Te;let r=Be(e).map(t=>Xt(t,n));return {destroy(){r.forEach(t=>t.destroy());},replay(){r.forEach(t=>t.replay());},pause(){r.forEach(t=>t.pause());},resume(){r.forEach(t=>t.resume());},seek(t){r.forEach(o=>o.seek(t));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(t=>t.refresh?.());}}}exports.scrollAnimateGroup=wn;exports.scrollAnimateSequence=En;exports.scrollDrawGroup=bn;exports.scrollDrawSequence=vn;exports.scrollParallaxGroup=Sn;
|