@algorisys/tinyfly 0.65.0 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,21 @@
1
- (function(m,tt){typeof exports=="object"&&typeof module<"u"?tt(exports):typeof define=="function"&&define.amd?define(["exports"],tt):(m=typeof globalThis<"u"?globalThis:m||self,tt(m.tinyfly=m.tinyfly||{}))})(this,(function(m){"use strict";function tt(i){return typeof i=="object"&&i!==null&&i.type==="cubic-bezier"}function dt(i){return typeof i=="object"&&i!==null&&i.type!=="cubic-bezier"}const pt=1;function Ct(i){return i.property==="text"&&"textConfig"in i}function j(i){return i.kind==="inertia"&&"inertia"in i}function z(i){return i.kind==="spring"&&"spring"in i}function Kt(i){return i.property==="motionPath"&&"motionPathConfig"in i}function Un(i){return typeof i=="object"&&i!==null&&"x"in i&&"y"in i&&"angle"in i}function We(i){return"keyframes"in i}class Wn{_currentTime=0;_isRunning=!1;onTick=null;get currentTime(){return this._currentTime}get isRunning(){return this._isRunning}start(){this._isRunning=!0}stop(){this._isRunning=!1}tick(t){this._currentTime+=t,this.onTick?.(t,this._currentTime)}reset(){this._currentTime=0}seek(t){this._currentTime=t}}class jn{_currentTime=0;_isRunning=!1;_lastFrameTime=null;_rafId=null;_speed;onTick=null;constructor(t={}){this._speed=t.speed??1}get currentTime(){return this._currentTime}get isRunning(){return this._isRunning}get speed(){return this._speed}set speed(t){this._speed=t}start(){this._isRunning||(this._isRunning=!0,this._lastFrameTime=null,this._scheduleFrame())}stop(){this._isRunning=!1,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null)}reset(){this._currentTime=0,this._lastFrameTime=null}seek(t){this._currentTime=t}_scheduleFrame(){this._rafId=requestAnimationFrame(this._onFrame.bind(this))}_onFrame(t){if(this._isRunning){if(this._lastFrameTime!==null){const n=(t-this._lastFrameTime)*this._speed;this._currentTime+=n,this.onTick?.(n,this._currentTime)}this._lastFrameTime=t,this._scheduleFrame()}}}function Qt(i,t,e="start"){if(t<=1)return 0;if(typeof e=="number"){const n=Math.max(0,Math.min(t-1,e));return Math.abs(i-n)}switch(e){case"end":return t-1-i;case"center":return Math.abs(i-(t-1)/2);case"edges":return(t-1)/2-Math.abs(i-(t-1)/2);default:return i}}function Zt(i,t="start"){if(i<=1)return 0;let e=0;for(let n=0;n<i;n++)e=Math.max(e,Qt(n,i,t));return e}function Rt(i,t,e){if(e.offsets)return e.offsets[i]??0;const n=e.from??"start",s=Qt(i,t,n);if(e.amount!==void 0){const r=Zt(t,n);return r===0?0:e.amount*s/r}return e.each!==void 0?e.each*s:0}function It(i,t){return Array.from({length:i},(e,n)=>Rt(n,i,t))}function mt(i,t){return i<=1?0:Math.max(...It(i,t))}const et=1,Jt=6e4,Ft=Jt/et,D={stiffness:180,damping:12,mass:1,velocity:0,restDelta:.01,restSpeed:.1},$t={gentle:{stiffness:120,damping:18,mass:1},default:{stiffness:180,damping:12,mass:1},snappy:{stiffness:280,damping:20,mass:1},bouncy:{stiffness:220,damping:8,mass:1},wobbly:{stiffness:180,damping:5,mass:1},stiff:{stiffness:400,damping:30,mass:1}};class gt{from;to;stiffness;damping;mass;restDelta;restSpeed;distance;samples;velocity;settledStep=null;constructor(t){this.from=t.from,this.to=t.to,this.stiffness=t.stiffness??D.stiffness,this.damping=t.damping??D.damping,this.mass=t.mass??D.mass,this.restDelta=t.restDelta??D.restDelta,this.restSpeed=t.restSpeed??D.restSpeed,this.distance=Math.abs(this.to-this.from)||1,this.samples=[this.from],this.velocity=t.velocity??D.velocity,this.isAtRest(this.from)&&(this.settledStep=0)}isAtRest(t){return Math.abs(t-this.to)<this.restDelta*this.distance&&Math.abs(this.velocity)<this.restSpeed*this.distance}valueAt(t){if(t<=0)return this.from;const e=Math.floor(t/et);if(this.simulateTo(e+1),this.settledStep!==null&&e>=this.settledStep)return this.to;const n=this.samples[Math.min(e,this.samples.length-1)],s=this.samples[Math.min(e+1,this.samples.length-1)],r=t/et-e;return n+(s-n)*r}settleTime(){return this.simulateTo(Ft+1),this.settledStep!==null?this.settledStep*et:Jt}simulateTo(t){if(this.settledStep!==null)return;const e=Math.min(t,Ft+1),n=et/1e3;for(;this.samples.length<e;){const s=this.samples[this.samples.length-1],r=s-this.to,o=-this.stiffness*r,a=-this.damping*this.velocity,c=(o+a)/this.mass;this.velocity+=c*n;const l=s+this.velocity*n;if(this.samples.push(l),this.isAtRest(l)){this.settledStep=this.samples.length-1;return}}this.samples.length>Ft&&(this.settledStep=Ft)}}function zn(i,t){return new gt(i).valueAt(t)}function je(i){return new gt(i).settleTime()}function Hn(i){const t=i.stiffness??D.stiffness,e=i.damping??D.damping,n=i.mass??D.mass;return e<2*Math.sqrt(t*n)}function Gn(i){const t=i.stiffness??D.stiffness,e=i.mass??D.mass;return 2*Math.sqrt(t*e)}const te=4,Kn=.002,Qn=1e-4,ze=6e4;function Lt(i){const t=i.friction??te;return t>0?t:te}function yt(i){return i.from+i.velocity/Lt(i)}function Zn(i,t){if(t===void 0)return i;if(typeof t=="number")return t>0?Math.round(i/t)*t:i;if(t.length===0)return i;let e=t[0];for(const n of t)Math.abs(n-i)<Math.abs(e-i)&&(e=n);return e}function it(i){let t=Zn(yt(i),i.end);return i.min!==void 0&&(t=Math.max(i.min,t)),i.max!==void 0&&(t=Math.min(i.max,t)),t}function nt(i){const t=Math.abs(it(i)-i.from);if(t===0)return 0;const e=i.restDelta??Math.max(Qn,t*Kn);if(e>=t)return 0;const n=Math.log(t/e)/Lt(i);return Math.min(ze,n*1e3)}function Dt(i,t){if(t<=0)return i.from;const e=it(i);if(t>=nt(i))return e;const n=Lt(i);return i.from+(e-i.from)*(1-Math.exp(-n*t/1e3))}function Jn(i,t){const e=Lt(i),n=it(i);return t>=nt(i)?0:(n-i.from)*e*Math.exp(-e*Math.max(0,t)/1e3)}const Ot=i=>i,He=i=>i*i,Ge=i=>1-(1-i)*(1-i),Ke=i=>i<.5?2*i*i:1-Math.pow(-2*i+2,2)/2,ee=i=>i*i*i,ie=i=>1-Math.pow(1-i,3),bt=i=>i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,Qe=ee,Ze=ie,Je=bt,ts={linear:Ot,"ease-in":Qe,"ease-out":Ze,"ease-in-out":Je,"ease-in-quad":He,"ease-out-quad":Ge,"ease-in-out-quad":Ke,"ease-in-cubic":ee,"ease-out-cubic":ie,"ease-in-out-cubic":bt};function ti(i){const[t,e,n,s]=i,r=3*t,o=3*(n-t)-r,a=1-r-o,c=3*e,l=3*(s-e)-c,h=1-c-l,f=p=>((a*p+o)*p+r)*p,u=p=>((h*p+l)*p+c)*p,d=p=>(3*a*p+2*o)*p+r,g=p=>{let y=p;for(let w=0;w<8;w++){const k=f(y)-p;if(Math.abs(k)<1e-7)return y;const T=d(y);if(Math.abs(T)<1e-7)break;y-=k/T}let b=0,v=1;for(y=p;b<v;){const w=f(y);if(Math.abs(w-p)<1e-7)return y;p>w?b=y:v=y,y=(b+v)/2}return y};return p=>{if(p<=0)return 0;if(p>=1)return 1;const y=g(p);return u(y)}}function ne(i,t="out"){if(t==="out")return i;const e=n=>1-i(1-n);return t==="in"?e:n=>n<.5?e(n*2)/2:i(n*2-1)/2+.5}function ei(i=1,t=.3){const e=Math.max(1,i),n=t/(2*Math.PI)*Math.asin(1/e);return s=>s<=0?0:s>=1?1:e*Math.pow(2,-10*s)*Math.sin((s-n)*(2*Math.PI)/t)+1}const ii=i=>{if(i<=0)return 0;if(i>=1)return 1;if(i<1/2.75)return 7.5625*i*i;if(i<2/2.75){const s=i-.5454545454545454;return 7.5625*s*s+.75}if(i<2.5/2.75){const s=i-.8181818181818182;return 7.5625*s*s+.9375}const n=i-2.625/2.75;return 7.5625*n*n+.984375};function ni(i=1.70158){return t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t-1;return e*e*((i+1)*e+i)+1}}function si(i,t="end"){const e=Math.max(1,Math.floor(i));return n=>{if(n>=1)return 1;if(n<=0)return t==="start"||t==="both"?t==="start"?1/e:1/(e+1):0;const s=Math.floor(n*e);switch(t){case"start":return Math.min(1,(s+1)/e);case"both":return(s+1)/(e+1);case"none":return e===1?0:Math.min(1,s/(e-1));default:return s/e}}}function ri(i){switch(i.type){case"steps":return si(i.count,i.position);case"elastic":return ne(ei(i.amplitude,i.period),i.mode);case"bounce":return ne(ii,i.mode);case"back":return ne(ni(i.overshoot),i.mode)}}function N(i){return i===void 0?Ot:tt(i)?ti(i.points):dt(i)?ri(i):ts[i]??Ot}const oi=32,es=256,st=new Map,is=/[MmLlHhVvCcSsQqTtAaZz]/,ns=/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/,ss={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function rs(i){const t=[];let e=0,n=null;const s=()=>{for(;e<i.length&&/[\s,]/.test(i[e]);)e++};for(;e<i.length&&(s(),!(e>=i.length));){const r=i[e];if(is.test(r)){n={type:r,args:[]},t.push(n),e++;continue}if(!n)break;const o=n.type==="A"||n.type==="a",a=n.args.length%7;if(o&&(a===3||a===4)){if(r!=="0"&&r!=="1")break;n.args.push(r==="1"?1:0),e++;continue}const c=ns.exec(i.slice(e));if(!c)break;n.args.push(parseFloat(c[0])),e+=c[0].length}return t}function os(i,t,e,n,s,r,o,a,c){if(i===a&&t===c)return[];let l=Math.abs(e),h=Math.abs(n);if(l===0||h===0)return[[i,t,a,c,a,c]];const f=s*Math.PI/180,u=Math.cos(f),d=Math.sin(f),g=(i-a)/2,p=(t-c)/2,y=u*g+d*p,b=-d*g+u*p,v=y*y/(l*l)+b*b/(h*h);if(v>1){const R=Math.sqrt(v);l*=R,h*=R}const w=r===o?-1:1,k=l*l*h*h-l*l*b*b-h*h*y*y,T=l*l*b*b+h*h*y*y,S=w*Math.sqrt(Math.max(0,k/T)),M=S*l*b/h,E=-S*h*y/l,O=u*M-d*E+(i+a)/2,P=d*M+u*E+(t+c)/2,A=(R,F,L,ft)=>{const Ue=R*L+F*ft,Gt=Math.sqrt((R*R+F*F)*(L*L+ft*ft)),Et=Math.acos(Math.max(-1,Math.min(1,Ue/Gt)));return R*ft-F*L<0?-Et:Et},_=A(1,0,(y-M)/l,(b-E)/h);let x=A((y-M)/l,(b-E)/h,(-y-M)/l,(-b-E)/h);!o&&x>0&&(x-=2*Math.PI),o&&x<0&&(x+=2*Math.PI);const C=Math.max(1,Math.ceil(Math.abs(x)/(Math.PI/2))),B=x/C,U=4/3*Math.tan(B/4),W=R=>{const F=l*Math.cos(R),L=h*Math.sin(R);return[u*F-d*L+O,d*F+u*L+P]},_t=R=>{const F=-l*Math.sin(R),L=h*Math.cos(R);return[u*F-d*L,d*F+u*L]},Ht=[];for(let R=0;R<C;R++){const F=_+R*B,L=F+B,[ft,Ue]=W(F),[Gt,Et]=R===C-1?[a,c]:W(L),[$o,Lo]=_t(F),[Do,Oo]=_t(L);Ht.push([ft+U*$o,Ue+U*Lo,Gt-U*Do,Et-U*Oo,Gt,Et])}return Ht}function H(i,t,e,n,s){const r=1-s;return r*r*r*i+3*r*r*s*t+3*r*s*s*e+s*s*s*n}function ai(i,t,e,n,s){const r=1-s;return 3*r*r*(t-i)+6*r*s*(e-t)+3*s*s*(n-e)}function vt(i,t,e,n){return{subpath:0,type:"L",points:[e,n],startX:i,startY:t,endX:e,endY:n,length:Math.hypot(e-i,n-t)}}function Bt(i,t,e){const[n,s,r,o,a,c]=e,l=[0];let h=i,f=t,u=0;for(let d=1;d<=oi;d++){const g=d/oi,p=H(i,n,r,a,g),y=H(t,s,o,c,g);u+=Math.hypot(p-h,y-f),l.push(u),h=p,f=y}return{subpath:0,type:"C",points:[n,s,r,o,a,c],startX:i,startY:t,endX:a,endY:c,length:u,lengths:l}}function Q(i){const t=st.get(i);if(t)return t;const e=[];let n=0,s=0,r=0,o=0,a=null,c=null,l=-1;const h=new Set,f=p=>{l<0&&(l=0),p.subpath=l,e.push(p)};for(const{type:p,args:y}of rs(i)){const b=p.toUpperCase(),v=p!==b,w=ss[b];if(b==="Z"){(n!==r||s!==o)&&f(vt(n,s,r,o)),l>=0&&h.add(l),n=r,s=o,a=c=null;continue}for(let k=0;k+w<=y.length;k+=w){const T=y.slice(k,k+w),S=v?n:0,M=v?s:0;let E=null,O=null;switch(b){case"M":k===0?(n=T[0]+S,s=T[1]+M,r=n,o=s,(l<0||e[e.length-1]?.subpath===l)&&l++):(f(vt(n,s,T[0]+S,T[1]+M)),n=T[0]+S,s=T[1]+M);break;case"L":f(vt(n,s,T[0]+S,T[1]+M)),n=T[0]+S,s=T[1]+M;break;case"H":f(vt(n,s,T[0]+S,s)),n=T[0]+S;break;case"V":f(vt(n,s,n,T[0]+M)),s=T[0]+M;break;case"C":{const P=[T[0]+S,T[1]+M,T[2]+S,T[3]+M,T[4]+S,T[5]+M];f(Bt(n,s,P)),E=[P[2],P[3]],n=P[4],s=P[5];break}case"S":{const[P,A]=a?[2*n-a[0],2*s-a[1]]:[n,s],_=[P,A,T[0]+S,T[1]+M,T[2]+S,T[3]+M];f(Bt(n,s,_)),E=[_[2],_[3]],n=_[4],s=_[5];break}case"Q":case"T":{let P=n,A=s;b==="Q"?(P=T[0]+S,A=T[1]+M):c&&(P=2*n-c[0],A=2*s-c[1]);const _=b==="Q"?T[2]+S:T[0]+S,x=b==="Q"?T[3]+M:T[1]+M;f(Bt(n,s,[n+2/3*(P-n),s+2/3*(A-s),_+2/3*(P-_),x+2/3*(A-x),_,x])),O=[P,A],n=_,s=x;break}case"A":{const P=T[5]+S,A=T[6]+M;let _=n,x=s;for(const C of os(n,s,T[0],T[1],T[2],T[3],T[4],P,A))f(Bt(_,x,C)),_=C[4],x=C[5];n=P,s=A;break}}a=E,c=O}}const u=e.reduce((p,y)=>p+y.length,0),d=[];for(let p=0;p<e.length;){const y=e[p].subpath;let b=p,v=0;for(;b<e.length&&e[b].subpath===y;)v+=e[b++].length;const w=e[p],k=e[b-1],T=h.has(y)||Math.abs(k.endX-w.startX)<1e-9&&Math.abs(k.endY-w.startY)<1e-9;d.push({start:p,end:b,length:v,closed:T}),p=b}const g={segments:e,totalLength:u,subpaths:d};return st.size>=es&&st.delete(st.keys().next().value),st.set(i,g),g}function as(i,t){const e=i.lengths;if(t<=0)return 0;if(t>=i.length)return 1;let n=0,s=e.length-1;for(;n<s-1;){const a=n+s>>1;e[a]<t?n=a:s=a}const r=e[s]-e[n],o=r>0?(t-e[n])/r:0;return(n+o)/(e.length-1)}function cs(i,t){if(i.type==="L"){const f=i.length>0?Math.max(0,Math.min(1,t/i.length)):0;return{x:i.startX+(i.endX-i.startX)*f,y:i.startY+(i.endY-i.startY)*f,angle:Math.atan2(i.endY-i.startY,i.endX-i.startX)*180/Math.PI}}const[e,n,s,r,o,a]=i.points,c=as(i,t);let l=ai(i.startX,e,s,o,c),h=ai(i.startY,n,r,a,c);if(Math.hypot(l,h)<1e-9){const f=c<.5?Math.min(1,c+.001):Math.max(0,c-.001),u=H(i.startX,e,s,o,f),d=H(i.startY,n,r,a,f),g=H(i.startX,e,s,o,c),p=H(i.startY,n,r,a,c);l=c<.5?u-g:g-u,h=c<.5?d-p:p-d}return{x:H(i.startX,e,s,o,c),y:H(i.startY,n,r,a,c),angle:Math.atan2(h,l)*180/Math.PI}}function se(i,t,e=0,n=i.length){if(n<=e)return{x:0,y:0,angle:0};let s=0;for(let r=e;r<n;r++){const o=i[r];if(s+o.length>=t||r===n-1)return cs(o,t-s);s+=o.length}return{x:0,y:0,angle:0}}function ci(i,t){const{segments:e,totalLength:n}=Q(i);return se(e,Math.max(0,Math.min(1,t))*n)}function ls(){st.clear()}function hs(i){return Q(i).totalLength}const us=24,fs=320,ds=2.5,wt=72,ps=64,ms=.2,gs=128,Tt=new Map;let Nt=0,G;const li=i=>Math.round(i*100)/100;function hi(i,t){const{segments:e,subpaths:n,totalLength:s}=Q(i);if(e.length===0)return[];if(t){const r=n.every(o=>o.closed);return[{segments:e,start:0,end:e.length,length:s,closed:r}]}return n.filter(r=>r.length>0).map(r=>({segments:e,start:r.start,end:r.end,length:r.length,closed:r.closed}))}function re(i,t){const e=i.closed?(t%1+1)%1:Math.max(0,Math.min(1,t)),n=se(i.segments,e*i.length,i.start,i.end);return[n.x,n.y]}function ui(i){const t=[];let e=0;for(let n=i.start;n<i.end;n++)e+=i.segments[n].length,i.length>0&&t.push(e/i.length);return t}function fi(i,t){const e=[];for(let n=0;n<t;n++)e.push(re(i,i.closed?n/t:n/(t-1)));return e}function di(i){let t=0,e=0;for(const[n,s]of i)t+=n,e+=s;return t/=i.length,e/=i.length,i.map(([n,s])=>[n-t,s-e])}function ys(i,t,e){const n=i.closed&&t.closed;if(e!==void 0)return{offset:n?Math.abs(e)%wt/wt:0,reversed:e<0};const s=di(fi(i,wt)),r=di(fi(t,wt)),o=wt;let a={offset:0,reversed:!1},c=1/0;for(const l of[!1,!0]){const h=n?o:1;for(let f=0;f<h;f++){let u=0;for(let d=0;d<o&&u<c;d++){const g=n?l?(f-d+o)%o:(d+f)%o:l?o-1-d:d,p=s[d][0]-r[g][0],y=s[d][1]-r[g][1];u+=p*p+y*y}u<c&&(c=u,a={offset:n?f/o:0,reversed:l})}}return a}function bs(i,t,e){return e?((t.reversed?t.offset-i:i+t.offset)%1+1)%1:t.reversed?1-i:i}function vs(i,t,e){return e?((t.reversed?t.offset-i:i-t.offset)%1+1)%1:t.reversed?1-i:i}function ws(i,t,e){const n=i.closed&&t.closed,s=ys(i,t,e.shapeIndex),r=Math.max(us,Math.min(fs,Math.ceil(Math.max(i.length,t.length)/ds))),o=new Set,a=f=>o.add(Math.round(f*1e7)/1e7);for(let f=0;f<=r;f++)a(f/r);for(const f of ui(i))a(f);for(const f of ui(t))a(vs(f,s,n));let c=[...o].sort((f,u)=>f-u);n&&(c=c.filter(f=>f<1));const l=[],h=[];for(const f of c)l.push(...re(i,f)),h.push(...re(t,bs(f,s,n)));return Ts({from:l,to:h,closed:n})}function Ts(i){const t=i.from.length/2;if(t<=3)return i;const e=new Uint8Array(t);e[0]=1,e[t-1]=1;const n=[[0,t-1]];for(;n.length>0;){const[o,a]=n.pop();let c=-1,l=ms;for(let h=o+1;h<a;h++){const f=Math.max(pi(i.from,o,a,h),pi(i.to,o,a,h));f>l&&(l=f,c=h)}c!==-1&&(e[c]=1,n.push([o,c],[c,a]))}const s=[],r=[];for(let o=0;o<t;o++)e[o]&&(s.push(i.from[o*2],i.from[o*2+1]),r.push(i.to[o*2],i.to[o*2+1]));return{from:s,to:r,closed:i.closed}}function pi(i,t,e,n){const s=i[t*2],r=i[t*2+1],o=i[e*2]-s,a=i[e*2+1]-r,c=i[n*2]-s,l=i[n*2+1]-r,h=o*o+a*a,f=h===0?0:Math.max(0,Math.min(1,(c*o+l*a)/h));return Math.hypot(c-f*o,l-f*a)}function Ss(i,t,e){const n=e.shapeIndex;if(G&&G.from===i&&G.to===t&&G.shapeIndex===n)return G.plan;const r=Tt.get(String(n??"auto"))?.get(i)?.get(t);if(r)return G={from:i,to:t,shapeIndex:n,plan:r},r;const o=Q(i).subpaths.filter(d=>d.length>0).length===Q(t).subpaths.filter(d=>d.length>0).length,a=hi(i,!o),c=hi(t,!o),l={pairs:a.map((d,g)=>ws(d,c[g],e))};Nt>=gs&&(Tt.clear(),Nt=0);const h=String(n??"auto"),f=Tt.get(h)??new Map;Tt.set(h,f);const u=f.get(i)??new Map;return f.set(i,u),u.set(t,l),Nt++,G={from:i,to:t,shapeIndex:n,plan:l},l}function mi(i,t,e,n={}){if(!i)return t;if(!t)return i;const s=Math.max(0,Math.min(1,e));if(s===0)return i;if(s===1)return t;const r=Ss(i,t,n);if(r.pairs.length===0)return s<.5?i:t;let o="";for(const a of r.pairs){for(let c=0;c<a.from.length;c+=2){const l=li(a.from[c]+(a.to[c]-a.from[c])*s),h=li(a.from[c+1]+(a.to[c+1]-a.from[c+1])*s);o+=`${c===0?o?" M":"M":" L"}${l} ${h}`}a.closed&&(o+=" Z")}return o}function ks(){Tt.clear(),Nt=0,G=void 0}function rt(i){return/^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(i)}const q=(i,t,e)=>i+(t-i)*e,gi=512,oe=new Map,ae=new Map;function yi(i){const t=oe.get(i);if(t)return t;const e=i.replace("#",""),n=[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)];return oe.size<gi&&oe.set(i,n),n}const bi=i=>i.charCodeAt(0)===35,vi=i=>i.startsWith("rgb"),wi=i=>i.startsWith("rgba"),Ms=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/,ce=i=>Math.round(i).toString(16).padStart(2,"0");function As(i,t,e){return`#${ce(i)}${ce(t)}${ce(e)}`}function Ti(i){const t=ae.get(i);if(t)return t;const e=i.match(Ms);if(!e)throw new Error(`Invalid rgb color: ${i}`);const n=parseInt(e[1],10),s=parseInt(e[2],10),r=parseInt(e[3],10),o=e[4]!==void 0?[n,s,r,parseFloat(e[4])]:[n,s,r];return ae.size<gi&&ae.set(i,o),o}const Si=(i,t,e)=>{if(bi(i)&&bi(t)){const[n,s,r]=yi(i),[o,a,c]=yi(t),l=q(n,o,e),h=q(s,a,e),f=q(r,c,e);return As(l,h,f)}if((vi(i)||wi(i))&&(vi(t)||wi(t))){const n=Ti(i),s=Ti(t),r=Math.round(q(n[0],s[0],e)),o=Math.round(q(n[1],s[1],e)),a=Math.round(q(n[2],s[2],e));if(n.length===4||s.length===4){const c=n[3]??1,l=s[3]??1,h=q(c,l,e);return`rgba(${r}, ${o}, ${a}, ${h})`}return`rgb(${r}, ${o}, ${a})`}return e<1?i:t},ki=(i,t,e)=>{const n=Math.min(i.length,t.length),s=[];for(let r=0;r<n;r++)s.push(q(i[r],t[r],e));return s},le=(i,t,e)=>e<1?i:t,Mi=(i,t,e)=>mi(i,t,e);function St(i){return typeof i=="number"?q:Array.isArray(i)?ki:typeof i=="string"?i.startsWith("#")||i.startsWith("rgb")?Si:rt(i)?Mi:le:le}const he=1e3/60;function ue(i,t={}){if(!z(i))throw new Error(`bakeSpringTrack: track "${i.id}" is not a spring track`);const e=new gt(i.spring);return Ai(i,n=>e.valueAt(n),e.settleTime(),i.spring.from,i.spring.to,t)}function fe(i,t={}){if(!j(i))throw new Error(`bakeInertiaTrack: track "${i.id}" is not an inertia track`);const e=i.inertia;return Ai(i,n=>Dt(e,n),nt(e),e.from,it(e),t)}function Ai(i,t,e,n,s,r){const o=r.intervalMs??he,a=r.tolerance??.01,c=i.delay??0,l=[];for(let f=0;f<=e;f+=o)l.push({time:f+c,value:t(f),easing:"linear"});const h=l[l.length-1];return!h||h.time<e+c?l.push({time:e+c,value:s,easing:"linear"}):h.value=s,c>0&&l.unshift({time:0,value:n,easing:"linear"}),{id:i.id,target:i.target,property:i.property,keyframes:a>0?xi(l,a):l,...i.targets&&{targets:[...i.targets]},...i.stagger&&{stagger:{...i.stagger}}}}function de(i,t,e,n={}){const s=n.intervalMs??he,r=typeof e=="function"?e:N(e),o=St(i.value),a=t.time-i.time;if(a<=0)return[t];const c=[];for(let h=s;h<a;h+=s){const f=h/a;c.push({time:i.time+h,value:o(i.value,t.value,r(f)),easing:"linear"})}const l=r(1);return c.push({...t,...l!==1&&{value:o(i.value,t.value,l)},easing:"linear"}),c}function Ps(i,t){return z(i)?ue(i,t):j(i)?fe(i,t):i}function Pi(i,t={}){const e=i.keyframes;if(!e.some(s=>dt(s.easing)))return i;const n=e.length>0?[e[0]]:[];for(let s=1;s<e.length;s++){const r=e[s];dt(r.easing)?n.push(...de(e[s-1],r,r.easing,t)):n.push(r)}return{...i,keyframes:n}}function xs(i,t){return i.filter(We).map(e=>Pi(e,t)).concat(i.filter(z).map(e=>ue(e,t)),i.filter(j).map(e=>fe(e,t)))}function xi(i,t){if(i.length<=2)return i;const e=[i[0]];for(let n=1;n<i.length-1;n++){const s=e[e.length-1],r=i[n],o=i[n+1],a=o.time-s.time;if(a<=0)continue;const c=(r.time-s.time)/a,l=s.value+(o.value-s.value)*c;Math.abs(r.value-l)>t&&e.push(r)}return e.push(i[i.length-1]),e}function qt(i){const t=[...i.keyframes].sort((e,n)=>e.time-n.time);return{...i,keyframes:t}}function K(i){return i.targets&&i.targets.length>0?i.targets:[i.target]}function ot(i,t,e,n){const s=e??0;return!n||t<=1?s:s+Rt(i,t,n)}class Xt{track;targets;constructor(t){this.track=t,this.targets=K(t)}getValueAtTime(t){return this.valueForOffset(t-ot(0,this.targets.length,this.track.delay,this.track.stagger))}getTargetValues(t){const e=this.targets.length,n=[];for(let s=0;s<e;s++){const r=ot(s,e,this.track.delay,this.track.stagger),o=this.valueForOffset(t-r);o!==void 0&&n.push({target:this.targets[s],value:o,start:r+this.track.keyframes[0].time})}return n}getDuration(){const{keyframes:t}=this.track;if(t.length===0)return 0;const e=t[t.length-1].time,n=this.track.stagger?mt(this.targets.length,this.track.stagger):0;return e+(this.track.delay??0)+n+(this.track.endDelay??0)}getTrack(){return this.track}valueForOffset(t){const{keyframes:e}=this.track;if(e.length===0)return;if(e.length===1||t<=e[0].time)return e[0].value;if(t>=e[e.length-1].time)return e[e.length-1].value;const{from:n,to:s}=this.findSurroundingKeyframes(t);if(!n||!s)return;if(n.time===t)return n.value;const r=s.time-n.time,o=(t-n.time)/r,c=N(s.easing)(o);return St(n.value)(n.value,s.value,c)}findSurroundingKeyframes(t){const{keyframes:e}=this.track;for(let n=0;n<e.length-1;n++)if(t>=e[n].time&&t<=e[n+1].time)return{from:e[n],to:e[n+1]};return{from:null,to:null}}}class _i{track;targets;sampler;constructor(t){this.track=t,this.targets=K(t),this.sampler=new gt(t.spring)}getValueAtTime(t){return this.sampler.valueAt(t-ot(0,this.targets.length,this.track.delay,this.track.stagger))}getTargetValues(t){const e=this.targets.length,n=[];for(let s=0;s<e;s++){const r=ot(s,e,this.track.delay,this.track.stagger);n.push({target:this.targets[s],value:this.sampler.valueAt(t-r),start:r})}return n}getDuration(){const t=this.track.stagger?mt(this.targets.length,this.track.stagger):0;return this.sampler.settleTime()+(this.track.delay??0)+t}getTrack(){return this.track}}class Ei{track;targets;duration;constructor(t){this.track=t,this.targets=K(t),this.duration=nt(t.inertia)}getValueAtTime(t){return Dt(this.track.inertia,t-ot(0,this.targets.length,this.track.delay,this.track.stagger))}getTargetValues(t){const e=this.targets.length,n=[];for(let s=0;s<e;s++){const r=ot(s,e,this.track.delay,this.track.stagger);n.push({target:this.targets[s],value:Dt(this.track.inertia,t-r),start:r})}return n}getDuration(){const t=this.track.stagger?mt(this.targets.length,this.track.stagger):0;return this.duration+(this.track.delay??0)+t}getTrack(){return this.track}}function pe(i,t){const e={...ci(i.pathData,t)};if(i.matrix){const[n,s,r,o,a,c]=i.matrix,{x:l,y:h}=e;e.x=n*l+r*h+a,e.y=s*l+o*h+c;const f=e.angle*Math.PI/180,u=Math.cos(f),d=Math.sin(f);e.angle=Math.atan2(s*u+o*d,n*u+r*d)*180/Math.PI}return i.autoRotate&&i.rotateOffset&&(e.angle+=i.rotateOffset),e}function _s(i,t,e,n){const s=t+(e-t)*n;return pe(i,s)}const me={upperCase:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",lowerCase:"abcdefghijklmnopqrstuvwxyz",upperAndLowerCase:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",numbers:"0123456789"},Es=20;function Ci(i){const t=me[i??"upperCase"]??i??me.upperCase,e=Array.from(t);return e.length>0?e:Array.from(me.upperCase)}function Cs(i,t,e){let n=(i|0)^Math.imul(t+1,2654435761)^Math.imul(e+1,2246822507);return n=Math.imul(n^n>>>16,2146121005),n=Math.imul(n^n>>>15,2221713035),(n^n>>>16)>>>0}function Ri(i,t,e=0){const n=i.from??"",s=i.to,r=Math.max(0,Math.min(1,t));if(r<=0)return n;if(r>=1)return s;const o=Array.from(n),a=Array.from(s),c=i.rightToLeft??!1;if(i.mode==="type"){const v=Math.round(r*Math.max(o.length,a.length));return c?o.slice(0,Math.max(0,o.length-v)).join("")+a.slice(Math.max(0,a.length-v)).join(""):a.slice(0,v).join("")+o.slice(v).join("")}const l=Math.max(0,Math.min(.999,i.revealDelay??0)),h=Math.max(0,(r-l)/(1-l)),f=Math.floor(h*a.length),u=i.tweenLength===!1?a.length:Math.round(o.length+(a.length-o.length)*r),d=Ci(i.chars),g=i.refreshRate??Es,p=g>0?Math.floor(e*g/1e3):0,y=i.seed??1;let b="";for(let v=0;v<u;v++){const w=c?v>=u-f:v<f,k=c?a[a.length-(u-v)]:a[v];w&&k!==void 0||k===" "||k===`
2
- `?b+=k:b+=d[Cs(y,v,p)%d.length]}return b}class ge{id;name;_captions;_tracks=[];_trackPlayers=new Map;_motionPathTracks=new Map;_springTracks=new Map;_textTracks=new Map;_config;_currentTime=0;_playbackState="idle";_direction="forward";_loopIteration=0;_explicitDuration;_repeatDelayRemaining=0;_wrapAfterDelay=!1;onUpdate=null;onComplete=null;constructor(t){if(this.id=t.id,this.name=t.name,this._captions=t.captions,this._config=t.config??{},this._explicitDuration=t.config?.duration,t.tracks)for(const e of t.tracks)this.addTrack(e)}get tracks(){return[...this._tracks]}get duration(){return this._explicitDuration!==void 0?this._explicitDuration:this._calculateDuration()}setDuration(t){if(this._explicitDuration=t,t!==void 0)this._config={...this._config,duration:t};else if(this._config.duration!==void 0){const e={...this._config};delete e.duration,this._config=e}}get currentTime(){return this._currentTime}get playbackState(){return this._playbackState}get direction(){return this._direction}get loopIteration(){return this._loopIteration}get repeatDelayRemaining(){return this._repeatDelayRemaining}get speed(){return this._config.speed??1}set speed(t){this._config.speed=t}play(){const t=this.duration;this._direction==="forward"&&this._currentTime>=t&&t>0?(this._currentTime=0,this._loopIteration=0):this._direction==="reverse"&&this._currentTime<=0&&t>0&&(this._currentTime=t,this._loopIteration=0),this._playbackState="playing"}pause(){this._playbackState="paused"}stop(){this._playbackState="idle",this._repeatDelayRemaining=0,this._wrapAfterDelay=!1,this._currentTime=0,this._loopIteration=0,this._direction="forward"}seek(t){const e=this.duration>0?this.duration:1/0;this._currentTime=Math.max(0,Math.min(t,e)),this._repeatDelayRemaining=0,this._wrapAfterDelay=!1}reverse(){this._direction=this._direction==="forward"?"reverse":"forward"}tick(t){if(this._playbackState!=="playing")return;const e=this.duration;if(e<=0)return;let s=t*this.speed;if(this._repeatDelayRemaining>0){const a=Math.min(this._repeatDelayRemaining,s);if(this._repeatDelayRemaining-=a,s-=a,this._repeatDelayRemaining>0){this.onUpdate?.(this.getStateAtTime(this._currentTime));return}this._wrapAfterDelay&&(this._wrapAfterDelay=!1,this._currentTime=0)}const r=1e3;for(let a=0;a<r&&s>0&&this._playbackState==="playing";a++)if(this._direction==="forward"){const c=e-this._currentTime;if(s>=c){if(s-=c,this._currentTime=e,!this._handleEndReached())break}else this._currentTime+=s,s=0}else{const c=this._currentTime;if(s>=c){if(s-=c,this._currentTime=0,!this._handleStartReached())break}else this._currentTime-=s,s=0}const o=this.getStateAtTime(this._currentTime);this.onUpdate?.(o)}getStateAtTime(t){const e=new Map;if(this._hasSharedWrites())this._resolveShared(t,e);else for(const[n,s]of this._trackPlayers){const r=s.getTrack().property;for(const{target:o,value:a,start:c}of s.getTargetValues(t))this._write(e,n,o,r,a,t-c)}return{values:e,currentTime:this._currentTime,playbackState:this._playbackState,direction:this._direction,loopIteration:this._loopIteration}}_resolveShared(t,e){const n=new Map;for(const[s,r]of this._trackPlayers){const o=r.getTrack().property;for(const{target:a,value:c,start:l}of r.getTargetValues(t)){const h=`${a}\0${o}`,f=l<=t,u=n.get(h);(!u||(f!==u.started?f:f?l>=u.start:l<=u.start))&&n.set(h,{trackId:s,target:a,property:o,value:c,start:l,started:f})}}for(const{trackId:s,target:r,property:o,value:a,start:c}of n.values())this._write(e,s,r,o,a,t-c)}_write(t,e,n,s,r,o){if(r===void 0)return;let a=t.get(n);a||(a=new Map,t.set(n,a));const c=this._textTracks.get(e);if(c&&typeof r=="number"){a.set("text",Ri(c.textConfig,r,Math.max(0,o)));return}const l=this._motionPathTracks.get(e);if(l&&typeof r=="number"){const h=pe(l.motionPathConfig,r);a.set("motionPathX",h.x),a.set("motionPathY",h.y),l.motionPathConfig.autoRotate&&a.set("motionPathRotate",h.angle)}else a.set(s,r)}_sharedWrites=null;_hasSharedWrites(){if(this._sharedWrites===null){const t=new Set;this._sharedWrites=!1;t:for(const e of this._tracks)for(const n of K(e)){const s=`${n}\0${e.property}`;if(t.has(s)){this._sharedWrites=!0;break t}t.add(s)}}return this._sharedWrites}addTrack(t){if(this._tracks.push(t),this._sharedWrites=null,j(t)){this._trackPlayers.set(t.id,new Ei(t));return}if(z(t)){this._trackPlayers.set(t.id,new _i(t)),this._springTracks.set(t.id,t);return}if(Ct(t))this._trackPlayers.set(t.id,new Xt(t)),this._textTracks.set(t.id,t);else if(Kt(t)){const e={id:t.id,target:t.target,property:t.property,keyframes:t.keyframes,delay:t.delay,endDelay:t.endDelay,targets:t.targets,stagger:t.stagger};this._trackPlayers.set(t.id,new Xt(e)),this._motionPathTracks.set(t.id,t)}else this._trackPlayers.set(t.id,new Xt(t))}replaceTrack(t,e){const n=this._tracks.findIndex(r=>r.id===t);if(n<0)return;const s=this._tracks.slice(n+1);this.removeTrack(t);for(const r of s)this.removeTrack(r.id);this.addTrack(e);for(const r of s)this.addTrack(r)}removeTrack(t){this._tracks=this._tracks.filter(e=>e.id!==t),this._sharedWrites=null,this._trackPlayers.delete(t),this._motionPathTracks.delete(t),this._springTracks.delete(t),this._textTracks.delete(t)}getTracks(t={}){return this._tracks.filter(e=>this._matches(e,t))}removeTracks(t={}){const e=this.getTracks(t).map(n=>n.id);for(const n of e)this.removeTrack(n);return e}getTrackSpan(t){const e=this._trackPlayers.get(t);if(!e)return;const n=e.getTrack(),s=n.delay??0;if(z(n)||j(n))return{from:s,to:e.getDuration()};const r=n.keyframes;if(!(!r||r.length===0))return{from:r[0].time+s,to:e.getDuration()}}findConflicts(){const t=[];for(let e=0;e<this._tracks.length;e++){const n=this._tracks[e],s=this.getTrackSpan(n.id);if(s)for(let r=0;r<e;r++){const o=this._tracks[r];if(o.property!==n.property)continue;const a=K(o).filter(f=>K(n).includes(f));if(a.length===0)continue;const c=this.getTrackSpan(o.id);if(!c||!(c.from<=s.to&&s.from<=c.to))continue;const h=s.from>=c.from;for(const f of a)t.push({target:f,property:n.property,losingTrackId:h?o.id:n.id,winningTrackId:h?n.id:o.id})}}return t}_matches(t,e){if(e.id!==void 0&&t.id!==e.id||e.property!==void 0&&t.property!==e.property||e.target!==void 0&&!K(t).includes(e.target))return!1;if(e.timeRange){const n=this.getTrackSpan(t.id);if(!n||n.to<e.timeRange.from||n.from>e.timeRange.to)return!1}return!0}toDefinition(){return{formatVersion:pt,id:this.id,name:this.name,config:{...this._config},tracks:[...this._tracks],...this.captions&&{captions:this.captions}}}get config(){return this._config}get markers(){return[...this._config.markers??[]].sort((t,e)=>t.time-e.time)}setMarkers(t){const e=t&&t.length>0?[...t].sort((s,r)=>s.time-r.time).map(s=>({...s})):void 0,n={...this._config};e?n.markers=e:delete n.markers,this._config=n}get captions(){return this._captions}setCaptions(t){const e={};for(const[n,s]of Object.entries(t??{}))e[n]={...s};this._captions=Object.keys(e).length>0?e:void 0}_armRepeatDelay(){this._repeatDelayRemaining=this._config.repeatDelay??0}_calculateDuration(){let t=0;for(const[,e]of this._trackPlayers)t=Math.max(t,e.getDuration());return t}_handleEndReached(){const t=this._config.loop??0;return t===-1||this._loopIteration<t?(this._loopIteration++,this._armRepeatDelay(),this._config.alternate?this._direction="reverse":this._repeatDelayRemaining>0?this._wrapAfterDelay=!0:this._currentTime=0,this._repeatDelayRemaining===0):(this._playbackState="idle",this.onComplete?.(),!1)}_handleStartReached(){const t=this._config.loop??0;return this._config.alternate&&(t===-1||this._loopIteration<t)?(this._loopIteration++,this._armRepeatDelay(),this._direction="forward",this._repeatDelayRemaining===0):(this._playbackState="idle",this.onComplete?.(),!1)}}const Rs=100;function ye(i,t,e,n){const s=[],r=[],{duration:o,alternate:a}=n,c=(d,g,p,y)=>{r.push([d,g]);const b=[];i.forEach((v,w)=>{(p==="forward"?(y?v>=d:v>d)&&v<=g:(y?v<=d:v<d)&&v>=g)&&b.push(w)}),b.sort((v,w)=>(p==="forward"?i[v]-i[w]:i[w]-i[v])||v-w);for(const v of b)s.push({kind:"event",index:v,direction:p})};let l=t.time,h=t.direction,f=t.fresh===!0;const u=Math.min(Rs,Math.max(0,e.iteration-t.iteration));for(let d=0;d<u;d++){const g=h==="forward"?o:0;c(l,g,h,f),s.push({kind:"repeat"}),a?(h=h==="forward"?"reverse":"forward",l=g,f=!1):(l=h==="forward"?0:o,f=!0)}return u>0&&n.holding&&!a?{crossings:s,passes:r}:(c(l,e.time,h,f),{crossings:s,passes:r})}function Ii(i){return j(i)?{id:i.id,target:i.target,property:i.property,kind:"inertia",inertia:Fi(i.inertia),...X(i)}:z(i)?{id:i.id,target:i.target,property:i.property,kind:"spring",spring:{...i.spring},...X(i)}:Ct(i)?{id:i.id,target:i.target,property:"text",textConfig:{...i.textConfig},keyframes:i.keyframes.map(be),...X(i)}:Kt(i)?{id:i.id,target:i.target,property:"motionPath",motionPathConfig:{...i.motionPathConfig},keyframes:i.keyframes.map(be),...X(i)}:{id:i.id,target:i.target,property:i.property,keyframes:i.keyframes.map(be),...X(i)}}function Fi(i){return{...i,...Array.isArray(i.end)&&{end:[...i.end]}}}function be(i){return{time:i.time,value:i.value,...i.easing&&{easing:i.easing}}}function X(i){const t=i.endDelay;return{...i.delay!==void 0&&{delay:i.delay},...t!==void 0&&{endDelay:t},...i.targets!==void 0&&{targets:[...i.targets]},...i.stagger!==void 0&&{stagger:{...i.stagger}}}}function $i(i){if(j(i)){const t=i;return{id:t.id,target:t.target,property:t.property,kind:"inertia",inertia:Fi(t.inertia),...X(t)}}if(z(i)){const t=i;return{id:t.id,target:t.target,property:t.property,kind:"spring",spring:{...t.spring},...X(t)}}if(Ct(i)){const t=i;return{id:t.id,target:t.target,property:"text",textConfig:{...t.textConfig},keyframes:[...t.keyframes].sort((e,n)=>e.time-n.time),...X(t)}}if(i.property==="motionPath"&&"motionPathConfig"in i){const t=i,e=[...t.keyframes].sort((n,s)=>n.time-s.time);return{id:t.id,target:t.target,property:"motionPath",motionPathConfig:{...t.motionPathConfig},keyframes:e,...X(t)}}return qt({id:i.id,target:i.target,property:i.property,keyframes:i.keyframes,...X(i)})}function Li(i){const t=i._config.markers;return{formatVersion:pt,id:i.id,name:i.name,config:{duration:i.duration>0?i.duration:void 0,loop:i._config.loop,speed:i._config.speed,alternate:i._config.alternate,repeatDelay:i._config.repeatDelay,...t&&{markers:t.map(e=>({...e}))}},tracks:i.tracks.map(Ii),...i.captions&&{captions:JSON.parse(JSON.stringify(i.captions))}}}function at(i){const t=i.formatVersion??1;if(t>pt)throw new Error(`tinyfly: this animation uses format version ${t}, but this tinyfly reads up to version ${pt}. Update tinyfly to play it.`);return new ge({id:i.id,name:i.name,config:i.config,tracks:i.tracks.map($i),captions:i.captions})}function Is(i){return JSON.stringify(Li(i))}function Fs(i){const t=JSON.parse(i);return at(t)}function $s(i){let t=2166136261;for(let e=0;e<i.length;e++)t^=i.charCodeAt(e),t=Math.imul(t,16777619);return t>>>0}function Di(i){let t=i>>>0||2654435769;return{seed:i>>>0,next(){return t^=t<<13,t>>>=0,t^=t>>17,t^=t<<5,t>>>=0,t/4294967296}}}function ve(i,t,e){return t+i.next()*(e-t)}function Oi(i,t,e,n){if(n<=0)return ve(i,t,e);const s=Math.floor((e-t)/n),r=Math.round(i.next()*s);return t+r*n}function Ls(i,t){if(t.length!==0)return t[Math.floor(i.next()*t.length)]}const Bi=/^([+\-*/])=\s*(-?[\d.]+)$/,Ni=/^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;function Ds(i){return typeof i!="string"?!1:Bi.test(i.trim())||Ni.test(i.trim())}function we(i,t={}){if(typeof i!="string")return i;const e=i.trim(),n=Bi.exec(e);if(n){const[,r,o]=n,a=t.base??0,c=Number.parseFloat(o);switch(r){case"+":return a+c;case"-":return a-c;case"*":return a*c;case"/":return c===0?a:a/c}}const s=Ni.exec(e);if(s){if(!t.random)throw new Error(`resolveValue: "${e}" needs a random source — pass one via context.random`);const r=Number.parseFloat(s[1]),o=Number.parseFloat(s[2]),a=s[3]!==void 0?Number.parseFloat(s[3]):void 0;return a!==void 0?Oi(t.random,r,o,a):ve(t.random,r,o)}return i}function qi(i,t=0,e){const n=[];let s=t;for(const r of i){const o=we(r,{base:s,random:e});n.push(o),typeof o=="number"&&(s=o)}return n}class Os{random;constructor(t){this.random=Di(t)}get seed(){return this.random.seed}resolve(t,e=0){return we(t,{base:e,random:this.random})}resolveSequence(t,e=0){return qi(t,e,this.random)}}const Bs=600;function Xi(i){if(Array.isArray(i)){const[u,d,g,p]=i;return{fn:Ui(u,d,g,p),bezier:[u,d,g,p]}}const{segments:t}=Q(i);if(t.length===0)throw new Error(`customEase: no curve in "${i}"`);const e=t[0].startX,n=t[0].startY,s=t[t.length-1],r=s.endX-e,o=s.endY-n;if(r===0||o===0)throw new Error(`customEase: "${i}" must move along both axes`);const a=u=>(u-e)/r,c=u=>(u-n)/o;if(t.length===1&&s.type==="C"){const[u,d,g,p]=s.points,y=[a(u),c(d),a(g),c(p)];return{fn:Ui(...y),bezier:y}}const l=[],h=[],f=Math.max(8,Math.ceil(Bs/t.length));for(const u of t)for(let d=l.length===0?0:1;d<=f;d++){const[g,p]=Ns(u,d/f);l.push(a(g)),h.push(c(p))}return{fn:qs(l,h)}}function Yi(i={}){const e=.1+Math.max(0,Math.min(1,i.strength??.7))*.7,n=[1];for(let r=e;r>.002;r*=e)n.push(2*Math.sqrt(r));const s=n.reduce((r,o)=>r+o,0);return r=>{if(r<=0)return 0;if(r>=1)return 1;let o=r*s;for(let a=0;a<n.length;a++){if(o<=n[a]){if(a===0)return(o/n[0])**2;const c=n[a]/2,l=c*c,h=o-c;return 1-(l-h*h)}o-=n[a]}return 1}}function Vi(i={}){const t=Math.max(1,i.wiggles??10),e=i.type??"easeOut",n=s=>e==="uniform"?1:e==="easeInOut"?Math.sin(Math.PI*s):(1-s)**2;return s=>s<=0||s>=1?0:Math.sin(s*t*Math.PI*2)*n(s)}function Ns(i,t){if(i.type==="L"){const[l,h]=i.points;return[i.startX+(l-i.startX)*t,i.startY+(h-i.startY)*t]}const[e,n,s,r,o,a]=i.points,c=1-t;return[c*c*c*i.startX+3*c*c*t*e+3*c*t*t*s+t*t*t*o,c*c*c*i.startY+3*c*c*t*n+3*c*t*t*r+t*t*t*a]}function qs(i,t){return e=>{if(e<=i[0])return t[0];if(e>=i[i.length-1])return t[t.length-1];let n=0,s=i.length-1;for(;s-n>1;){const o=n+s>>1;i[o]<=e?n=o:s=o}const r=i[s]-i[n];return r===0?t[s]:t[n]+(e-i[n])/r*(t[s]-t[n])}}function Ui(i,t,e,n){const s=(o,a,c)=>3*(1-o)*(1-o)*o*a+3*(1-o)*o*o*c+o*o*o,r=(o,a,c)=>3*(1-o)*(1-o)*a+6*(1-o)*o*(c-a)+3*o*o*(1-c);return o=>{if(o<=0)return 0;if(o>=1)return 1;let a=o;for(let h=0;h<8;h++){const f=s(a,i,e)-o,u=r(a,i,e);if(Math.abs(f)<1e-6)return s(a,t,n);if(Math.abs(u)<1e-6)break;a-=f/u}let c=0,l=1;a=o;for(let h=0;h<40;h++)s(a,i,e)<o?c=a:l=a,a=(c+l)/2;return s(a,t,n)}}const Y=i=>Math.round(i*1e3)/1e3;function Wi(i,t={}){if(i.length===0)return"";const e=t.curviness??1,n=t.closed??!1,s=i.length;let r=`M${Y(i[0].x)} ${Y(i[0].y)}`;if(s===1)return r;const o=c=>n?i[(c%s+s)%s]:i[Math.max(0,Math.min(s-1,c))],a=n?s:s-1;for(let c=0;c<a;c++){const l=o(c-1),h=o(c),f=o(c+1),u=o(c+2);if(e===0){r+=` L${Y(f.x)} ${Y(f.y)}`;continue}const d=e/6,g=h.x+(f.x-l.x)*d,p=h.y+(f.y-l.y)*d,y=f.x-(u.x-h.x)*d,b=f.y-(u.y-h.y)*d;r+=` C${Y(g)} ${Y(p)} ${Y(y)} ${Y(b)} ${Y(f.x)} ${Y(f.y)}`}return n?`${r} Z`:r}const I=(i,t=0)=>{const e=parseFloat(i??"");return Number.isFinite(e)?e:t};function Xs(i){const t=(i??"").trim().split(/[\s,]+/).filter(Boolean).map(Number),e=[];for(let n=0;n+1<t.length;n+=2)e.push({x:t[n],y:t[n+1]});return e}function Yt(i){const t=i.attributes;switch(i.tag.toLowerCase()){case"path":return t.d??null;case"circle":case"ellipse":{const e=I(t.cx),n=I(t.cy),s=i.tag.toLowerCase()==="circle"?I(t.r):I(t.rx),r=i.tag.toLowerCase()==="circle"?I(t.r):I(t.ry);return`M${e+s} ${n} A${s} ${r} 0 1 1 ${e-s} ${n} A${s} ${r} 0 1 1 ${e+s} ${n} Z`}case"rect":{const e=I(t.x),n=I(t.y),s=I(t.width),r=I(t.height);let o=t.rx!=null?I(t.rx):t.ry!=null?I(t.ry):0,a=t.ry!=null?I(t.ry):o;return o=Math.min(o,s/2),a=Math.min(a,r/2),o===0||a===0?`M${e} ${n} H${e+s} V${n+r} H${e} Z`:`M${e+o} ${n} H${e+s-o} A${o} ${a} 0 0 1 ${e+s} ${n+a} V${n+r-a} A${o} ${a} 0 0 1 ${e+s-o} ${n+r} H${e+o} A${o} ${a} 0 0 1 ${e} ${n+r-a} V${n+a} A${o} ${a} 0 0 1 ${e+o} ${n} Z`}case"line":return`M${I(t.x1)} ${I(t.y1)} L${I(t.x2)} ${I(t.y2)}`;case"polyline":case"polygon":{const e=Xs(t.points);if(e.length===0)return null;const n=e.map((s,r)=>`${r===0?"M":"L"}${s.x} ${s.y}`).join(" ");return i.tag.toLowerCase()==="polygon"?`${n} Z`:n}default:return null}}const Vt={"power1.in":[.55,.085,.68,.53],"power1.out":[.25,.46,.45,.94],"power1.inout":[.455,.03,.515,.955],"power2.in":[.55,.055,.675,.19],"power2.out":[.215,.61,.355,1],"power2.inout":[.645,.045,.355,1],"power3.in":[.895,.03,.685,.22],"power3.out":[.165,.84,.44,1],"power3.inout":[.77,0,.175,1],"power4.in":[.755,.05,.855,.06],"power4.out":[.23,1,.32,1],"power4.inout":[.86,0,.07,1],"sine.in":[.47,0,.745,.715],"sine.out":[.39,.575,.565,1],"sine.inout":[.445,.05,.55,.95],"expo.in":[.95,.05,.795,.035],"expo.out":[.19,1,.22,1],"expo.inout":[1,0,0,1],"circ.in":[.6,.04,.98,.335],"circ.out":[.075,.82,.165,1],"circ.inout":[.785,.135,.15,.86],"back.in":[.6,-.28,.735,.045],"back.out":[.175,.885,.32,1.275],"back.inout":[.68,-.55,.265,1.55]},ji={none:"linear",linear:"linear","linear.none":"linear","power1.in":"ease-in-quad","power1.out":"ease-out-quad","power1.inout":"ease-in-out-quad","power2.in":"ease-in-cubic","power2.out":"ease-out-cubic","power2.inout":"ease-in-out-cubic"};function Ys(i){let t=i.trim().toLowerCase();t=t.replace(/\.ease(in|out|inout)$/,".$1");const e=/^([a-z]+\d?)(\(.*\))?$/.exec(t);return e&&e[1]!=="steps"&&t!=="none"&&t!=="linear"&&(t=`${e[1]}.out${e[2]??""}`),t}N({type:"bounce",mode:"in"}),N({type:"bounce",mode:"in-out"});function kt(i){const t=zi.get(i.trim().toLowerCase());if(t)return t;const e=Ys(i),n=/^steps\(\s*(\d+)\s*\)$/.exec(e);if(n){const o={type:"steps",count:Math.max(1,Number.parseInt(n[1],10))+1,position:"none"};return{easing:o,fn:N(o)}}const s=/^(elastic|bounce|back)\.(in|out|inout)(?:\(([^)]*)\))?$/.exec(e);if(s){const[,r,o,a]=s,c=(a??"").split(",").map(f=>Number.parseFloat(f)).filter(f=>Number.isFinite(f)),l=o==="inout"?"in-out":o;if(r==="back"&&c.length===0&&e in Vt)return{easing:{type:"cubic-bezier",points:Vt[e]}};const h=r==="elastic"?{type:"elastic",mode:l,...c[0]!==void 0&&{amplitude:c[0]},...c[1]!==void 0&&{period:c[1]}}:r==="bounce"?{type:"bounce",mode:l}:{type:"back",mode:l,...c[0]!==void 0&&{overshoot:c[0]}};return{easing:h,fn:N(h)}}return e in ji?{easing:ji[e]}:e in Vt?{easing:{type:"cubic-bezier",points:Vt[e]}}:{easing:"ease-out"}}const zi=new Map;function Te(i,t){return zi.set(i.trim().toLowerCase(),t.bezier?{easing:{type:"cubic-bezier",points:t.bezier},fn:t.fn}:{fn:t.fn,requiresBaking:"custom"}),i}function Se(i){let t=i>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}const Hi=/^\s*random\(\s*(\[.*\]|[^)]*)\s*\)\s*$/;function Gi(i){return typeof i=="string"&&Hi.test(i)}function Vs(i=1){let t=Se(i);const e=(c,l)=>((...h)=>h.length>=c?l(...h):f=>l(...h,f)),n=(c,l,h)=>Math.min(Math.max(h,Math.min(c,l)),Math.max(c,l)),s=(c,l,h,f,u)=>l===c?h:h+(u-c)/(l-c)*(f-h),r=(c,l)=>{if(typeof c=="number")return c===0?l:Math.round(l/c)*c;if(Array.isArray(c))return Ki(c,l,1/0);if("values"in c)return Ki(c.values,l,c.radius??1/0);const h=Math.round(l/c.increment)*c.increment;return Math.abs(h-l)<=(c.radius??1/0)?h:l},o=(c,l,h)=>{const f=c+t()*(l-c);return h?Math.round(f/h)*h:f};return{clamp:e(3,n),mapRange:e(5,s),normalize:e(3,(c,l,h)=>s(c,l,0,1,h)),interpolate:e(3,(c,l,h)=>{if(typeof c=="object"&&!Array.isArray(c)){const f={};for(const u of Object.keys(c))f[u]=St(c[u])(c[u],l[u],h);return f}return St(c)(c,l,h)}),wrap:((c,l,h)=>{if(Array.isArray(c)){const p=c,y=b=>p[(Math.round(b)%p.length+p.length)%p.length];return l===void 0?y:y(l)}const f=c,d=l-f,g=p=>d===0?f:((p-f)%d+d)%d+f;return h===void 0?g:g(h)}),wrapYoyo:e(3,(c,l,h)=>{const f=l-c;if(f===0)return c;const u=((h-c)%(f*2)+f*2)%(f*2);return c+(u>f?f*2-u:u)}),snap:e(2,r),random:((c,l,h,f)=>{if(Array.isArray(c)){const d=()=>c[Math.floor(t()*c.length)];return l===!0?d:d()}const u=()=>o(c,l,h);return f?u:u()}),shuffle:c=>{for(let l=c.length-1;l>0;l--){const h=Math.floor(t()*(l+1));[c[l],c[h]]=[c[h],c[l]]}return c},distribute:({base:c=0,amount:l,each:h,from:f="start",ease:u})=>(d,g,p)=>{const y=p.length,v=Rt(d,y,{...l!==void 0?{amount:l}:{each:h??1},from:f}),w=l!==void 0?l:(h??1)*Zt(y,f),k=u&&w>0?u(v/w)*w:v;return c+k},pipe:(...c)=>l=>c.reduce((h,f)=>f(h),l),splitColor:c=>Us(c),getUnit:c=>typeof c=="number"?"":/^-?[\d.]+(?:e[-+]?\d+)?([a-z%]*)$/i.exec(c.trim())?.[1]??"",seed:c=>{t=Se(c)},resolveRandomString:c=>{const l=Hi.exec(c)?.[1]??"";if(l.startsWith("[")){const g=l.slice(1,-1).split(",").map(p=>p.trim()).filter(Boolean).map(p=>Number.isFinite(Number(p))?Number(p):p.replace(/^['"]|['"]$/g,""));return g[Math.floor(t()*g.length)]}const[h,f,u]=l.split(",").map(d=>Number.parseFloat(d));return o(h,f,Number.isFinite(u)?u:void 0)}}}function Ki(i,t,e){let n=t,s=1/0;for(const r of i){const o=Math.abs(r-t);o<s&&(s=o,n=r)}return s<=e?n:t}function Us(i){const t=i.trim(),e=/^#([0-9a-f]{3,8})$/i.exec(t)?.[1];if(e){const r=(e.length<=4?[...e].map(o=>o+o).join(""):e).match(/../g).map(o=>Number.parseInt(o,16));return r.length>=4?[r[0],r[1],r[2],Math.round(r[3]/255*1e3)/1e3]:[r[0],r[1],r[2]]}const n=(/rgba?\(([^)]+)\)/i.exec(t)?.[1]??"0,0,0").split(/[\s,/]+/).filter(Boolean).map(s=>Number.parseFloat(s));return n.length>=4?[n[0],n[1],n[2],n[3]]:[n[0]??0,n[1]??0,n[2]??0]}const Ws=/^([+-])=\s*(-?[\d.]+)$/,js=/^([<>])\s*(?:([+-])?=?\s*(-?[\d.]+))?$/;function Mt(i,t){const e=t.scale??1,n=l=>Number.parseFloat(l)*e;if(i===void 0)return t.cursor;if(typeof i=="number")return i*e;const s=i.trim();if(s==="")return t.cursor;const r=Ws.exec(s);if(r){const l=n(r[2]);return t.cursor+(r[1]==="-"?-l:l)}const o=js.exec(s);if(o){const l=o[1]==="<"?t.previousStart:t.previousEnd;if(o[3]===void 0)return l;const h=n(o[3]);return l+(o[2]==="-"?-h:h)}const a=/^(.+?)([+-])=\s*(-?[\d.]+)$/.exec(s);if(a){const l=t.labels.get(a[1].trim());if(l!==void 0){const h=n(a[3]);return l+(a[2]==="-"?-h:h)}}const c=t.labels.get(s);return c!==void 0?c:/^-?[\d.]+$/.test(s)?n(s):t.cursor}function zs(i){if(typeof i!="object"||i===null)return!1;const t=i;return t.grid!==void 0||t.from==="random"||Array.isArray(t.from)||t.ease!==void 0||t.axis!==void 0}function Hs(i,t,e={}){if(i===0)return[];const n=t.grid==="auto"?Math.max(1,Math.min(i,e.columnsFromLayout?.()??i)):Array.isArray(t.grid)?Math.max(1,t.grid[1]):i,s=Array.isArray(t.grid)?Math.max(1,t.grid[0]):Math.ceil(i/n),r=g=>({x:g%n,y:Math.floor(g/n)}),o=t.from??"start",a=Array.isArray(o)?{x:o[0]*(n-1),y:o[1]*(s-1)}:typeof o=="number"?r(Math.max(0,Math.min(i-1,o))):o==="end"?r(i-1):o==="center"||o==="edges"?{x:(n-1)/2,y:(s-1)/2}:{x:0,y:0},c=g=>{const{x:p,y}=r(g),b=Math.abs(p-a.x),v=Math.abs(y-a.y);return t.axis==="x"?b:t.axis==="y"?v:Math.hypot(b,v)};let l=Array.from({length:i},(g,p)=>c(p));const h=Math.max(...l);if(o==="edges"&&(l=l.map(g=>h-g)),o==="random"){const g=e.random??Math.random;l=l.map(()=>g()*h)}const f=t.amount!==void 0?t.amount:(t.each??0)*h,u=t.ease?kt(t.ease):void 0,d=u?u.fn??N(u.easing):void 0;return l.map(g=>{const p=h===0?0:g/h;return(d?d(p):p)*f})}const ke=new Set(["duration","delay","ease","repeat","repeatDelay","yoyo","stagger","onComplete","onUpdate","onStart","onRepeat","onReverseComplete","repeatRefresh","keyframes","easeEach","scrollTo","id","immediateRender","overwrite","paused","scrollTrigger","spring"]);function Ut(i){const t={},e={};for(const[n,s]of Object.entries(i))ke.has(n)?t[n]=s:e[n]=s;return{config:t,properties:e}}function Wt(i,t){return i===void 0?t:i*1e3}function Me(i,t){if(i!==void 0)return typeof i=="number"?{each:i*1e3}:zs(i)?{offsets:Hs(t?.count??0,i,t??{}).map(n=>n*1e3)}:{...i.each!==void 0&&{each:i.each*1e3},...i.amount!==void 0&&{amount:i.amount*1e3},...i.from!==void 0&&{from:i.from}}}const Gs={opacity:1,x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,rotation:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,originX:50,originY:50,perspective:0,blur:0,glow:0,clipTop:0,clipRight:0,clipBottom:0,clipLeft:0};function Qi(i){return Gs[i]}function Ks(i){const t=typeof i=="string"||Array.isArray(i)?{path:i}:i;if(!t||typeof t.path!="string"&&!Array.isArray(t.path))throw new Error("gsap-compat: motionPath needs a path — SVG path data or an array of { x, y } points.");let e;if(Array.isArray(t.path))e=Wi(t.path,{curviness:t.curviness});else if(rt(t.path))e=t.path;else throw new Error(`gsap-compat: motionPath "${t.path}" is not path data. Selectors and elements are resolved by live.to(); timeline() and tf need the path data itself.`);const n={pathData:e};return t.autoRotate!==void 0&&t.autoRotate!==!1&&(n.autoRotate=!0,typeof t.autoRotate=="number"&&(n.rotateOffset=t.autoRotate)),t.matrix&&(n.matrix=t.matrix),{config:n,start:t.start??0,end:t.end??1}}function Qs(i){const t=typeof i=="string"||Array.isArray(i)?{path:i}:{...i};return{...t,start:t.end??1,end:t.start??0}}function Zi(i){return typeof i=="object"&&i!==null&&"shape"in i?i.shape:i}function Zs(i){if(i.morphSVG===void 0)return i;const{morphSVG:t,...e}=i,n=Zi(t);if(typeof n!="string"||!rt(n))throw new Error(`gsap-compat: morphSVG "${String(n)}" is not path data. Selectors and elements are resolved by live.to(); timeline() and tf need the path data itself.`);return{...e,d:n}}function Js(i,t){if(i===!0)return[0,t];if(i===!1)return[0,0];if(typeof i=="number")return[0,Ji(i,t)];const e=i.trim().split(/[\s,]+/).filter(Boolean),n=o=>{const a=Number.parseFloat(o);if(Number.isNaN(a))throw new Error(`gsap-compat: drawSVG "${i}" is not a length or percentage`);return Ji(o.endsWith("%")?t*a/100:a,t)};if(e.length===0)return[0,t];if(e.length===1)return[0,n(e[0])];const s=n(e[0]),r=n(e[1]);return s<=r?[s,r]:[r,s]}function tr(i,t){const[e,n]=Js(i,t);return{strokeDasharray:[n-e,t],strokeDashoffset:-e}}function er(i,t){if(i.drawSVG===void 0)return i;const{drawSVG:e,...n}=i;return{...n,...tr(e,t)}}function ir(i){if(i.drawSVG!==void 0)throw new Error("gsap-compat: drawSVG needs the stroke length from the page. Use live.to(), or animate strokeDasharray / strokeDashoffset directly (see drawSvgProperties).");return i}function Ji(i,t){return Math.max(0,Math.min(t,i))}function nr(i){let t=2166136261;for(let e=0;e<i.length;e++)t=Math.imul(t^i.charCodeAt(e),16777619);return t>>>0}function sr(i,t,e){if(i.scrambleText!==void 0){const n=i.scrambleText,s=typeof n=="string"?{text:n}:n;if(typeof s?.text!="string")throw new Error("gsap-compat: scrambleText needs the text to end on — a string, or { text }.");const r=s.revealDelay&&e>0?s.revealDelay*1e3/e:void 0;return{to:s.text,mode:"scramble",...s.chars!==void 0&&{chars:s.chars},...s.speed!==void 0&&{refreshRate:20*s.speed},...r!==void 0&&{revealDelay:Math.min(r,.999)},...s.tweenLength!==void 0&&{tweenLength:s.tweenLength},...s.rightToLeft!==void 0&&{rightToLeft:s.rightToLeft},seed:s.seed??nr(`${t}|${s.text}`)}}if(i.text!==void 0){const n=i.text,s=typeof n=="string"?{value:n}:n;if(typeof s?.value!="string")throw new Error("gsap-compat: text needs the text to end on — a string, or { value }.");return{to:s.value,mode:"type",...s.rightToLeft!==void 0&&{rightToLeft:s.rightToLeft}}}}function Ae(i){return Math.max(.1,i/25)}function rr(i,t){const e=typeof t=="number"?{velocity:t}:t;if(typeof e?.velocity!="number"||!Number.isFinite(e.velocity))throw new Error("gsap-compat: inertia needs a velocity for each property — a number, or { velocity }.");const n=e.friction??(e.resistance!==void 0?Ae(e.resistance):void 0),s={from:i,velocity:e.velocity,...n!==void 0&&{friction:n},...e.min!==void 0&&{min:e.min},...e.max!==void 0&&{max:e.max}};return typeof e.end=="function"?s.end=[e.end(yt(s))]:e.end!==void 0&&(s.end=Array.isArray(e.end)?[...e.end]:e.end),s}function or(i){const t=i===!0?{}:typeof i=="string"?{preset:i}:i;if(t.preset!==void 0&&!(t.preset in $t))throw new Error(`gsap-compat: unknown spring preset "${t.preset}" — use one of ${Object.keys($t).join(", ")}`);return{...t.preset?$t[t.preset]:{},...t.stiffness!==void 0&&{stiffness:t.stiffness},...t.damping!==void 0&&{damping:t.damping},...t.mass!==void 0&&{mass:t.mass},...t.restDelta!==void 0&&{restDelta:t.restDelta}}}function ar(i,t){if(i===!0||typeof i=="string")return;const e=i.velocity;return typeof e=="number"?e:e?.[t]}class Z{timeline;options;cursor=0;fallbackRandom=Se(1);previousStart=0;previousEnd=0;labels=new Map;trackCounter=0;lastValues=new Map;constructor(t={}){this.options=t,this.timeline=new ge({id:t.id??"gsap-compat",name:t.name,config:{...t.repeat!==void 0&&{loop:t.repeat},...t.yoyo!==void 0&&{alternate:t.yoyo},...t.repeatDelay!==void 0&&{repeatDelay:t.repeatDelay*1e3},...t.timeScale!==void 0&&{speed:t.timeScale}}})}to(t,e,n){return this.build(t,void 0,At(e),n)}from(t,e,n){const{config:s,properties:r}=Ut(At(e)),{motionPath:o,text:a,scrambleText:c,...l}=r,h=this.targetsOf(t)[0],f={...s};for(const g of Object.keys(l))f[g]=this.resolveStart(h,g);o!==void 0&&(f.motionPath=Qs(o));const u={},d=String(this.resolveStart(h,"text"));return a!==void 0&&(u.text=Pe(a),f.text=typeof a=="object"?{...a,value:d}:d),c!==void 0&&(u.text=Pe(c),f.scrambleText=typeof c=="object"?{...c,text:d}:d),this.build(t,{...l,...u},f,n)}fromTo(t,e,n,s){const{properties:r}=Ut(At(e));return this.build(t,r,At(n),s)}set(t,e,n){return this.build(t,void 0,{...At(e),duration:0},n)}get lastStart(){return this.previousStart}get lastEnd(){return this.previousEnd}addEvent(t){const e=Math.max(0,Mt(t,this.context()));return this.previousStart=e,this.previousEnd=e,this.cursor=Math.max(this.cursor,e),e}timeOf(t){return Mt(t,this.context())}addLabel(t,e){return this.labels.set(t,Mt(e,this.context())),this}labelTimes(){return[...this.labels.values()].sort((t,e)=>t-e)}labelTime(t){return this.labels.get(t)}add(t,e){const n=Mt(e,this.context());for(const r of t.timeline.tracks){if(!("keyframes"in r))continue;const o=qt({...r,id:this.nextTrackId(`nested-${r.id}`),keyframes:r.keyframes.map(a=>({...a,time:a.time+n}))});this.timeline.addTrack(o)}const s=n+t.timeline.duration;return this.previousStart=n,this.previousEnd=s,this.cursor=Math.max(this.cursor,s),this}play(){return this.timeline.play(),this}pause(){return this.timeline.pause(),this}restart(){return this.timeline.stop(),this.timeline.play(),this}reverse(){return this.timeline.reverse(),this}kill(){return this.timeline.removeTracks(),this}reset(){return this.timeline.removeTracks(),this.cursor=0,this.previousStart=0,this.previousEnd=0,this.labels.clear(),this.lastValues.clear(),this.trackCounter=0,this}seek(t){if(typeof t=="string"){const e=this.labels.get(t);return e!==void 0&&this.timeline.seek(e),this}return this.timeline.seek(t*1e3),this}progress(t){const e=this.timeline.duration;return t!==void 0&&e>0&&this.timeline.seek(t*e),e>0?this.timeline.currentTime/e:0}timeScale(t){return t!==void 0&&(this.timeline.speed=t),this.timeline.speed}duration(){return this.timeline.duration/1e3}tick(t){return this.timeline.tick(t),this}toDefinition(){return this.timeline.toDefinition()}build(t,e,n,s){const{config:r,properties:o}=Ut(n),{motionPath:a,text:c,scrambleText:l,inertia:h,...f}=o,u=this.targetsOf(t),d=Mt(s,this.context()),g=Wt(r.delay,0),p=Wt(r.duration,500),y=Me(r.stagger,{count:u.length,columnsFromLayout:this.options.layoutColumns?()=>this.options.layoutColumns(u):void 0,random:this.options.random??this.fallbackRandom}),b=this.easingFor(r.ease),v=[],w=r.spring;let k=0,T=!1;for(const[A,_]of Object.entries(f)){const x=_;let C=e?.[A]!==void 0?e[A]:this.resolveStart(u[0],A);if(typeof C!=typeof x&&(this.warn(`no usable start value for "${A}" on "${u[0]}" — it will snap to ${String(x)}. Use fromTo() to animate it.`),C=x),w!==void 0&&typeof C=="number"&&typeof x=="number"){const W={...or(w),from:C,to:x,velocity:ar(w,A)??this.options.startVelocity?.(u[0],A)??0},_t=this.nextTrackId(`${u[0]}-${A}-spring`),Ht={id:_t,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:A,kind:"spring",spring:W,delay:d+g};this.timeline.addTrack(Ht),v.push(_t),k=Math.max(k,je(W));for(const R of u)this.lastValues.set(`${R}|${A}`,x);continue}T=!0;const B=this.keyframesFor(C,x,p,b,r.ease),U=this.nextTrackId(`${u[0]}-${A}`);this.timeline.addTrack(qt({id:U,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:A,delay:d+g,keyframes:B})),v.push(U);for(const W of u)this.lastValues.set(`${W}|${A}`,x)}const S=sr({text:c,scrambleText:l},u[0],p);if(S){const A=e?.text??e?.scrambleText,_=A!==void 0?Pe(A):this.resolveStart(u[0],"text"),x=this.nextTrackId(`${u[0]}-text`),C={id:x,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:"text",textConfig:{from:typeof _=="string"?_:String(_??""),...S},delay:d+g,keyframes:this.keyframesFor(0,1,p,b,r.ease)};this.timeline.addTrack(C),v.push(x);for(const B of u)this.lastValues.set(`${B}|text`,S.to)}if(a!==void 0){const{config:A,start:_,end:x}=Ks(a),C=this.nextTrackId(`${u[0]}-motionPath`),B={id:C,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:"motionPath",motionPathConfig:A,delay:d+g,keyframes:this.keyframesFor(_,x,p,b,r.ease)};this.timeline.addTrack(B),v.push(C)}if(h!==void 0)for(const[A,_]of Object.entries(h)){const x=this.resolveStart(u[0],A);if(typeof x!="number"){this.warn(`inertia on "${A}" needs a numeric start value; skipped`);continue}const C=rr(x,_),B=this.nextTrackId(`${u[0]}-${A}-inertia`),U={id:B,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:A,kind:"inertia",inertia:C,delay:d+g};this.timeline.addTrack(U),v.push(B),k=Math.max(k,nt(C));for(const W of u)this.lastValues.set(`${W}|${A}`,it(C))}const O=((h!==void 0||w!==void 0)&&!T&&!S&&a===void 0?k:Math.max(p,k))+(y&&u.length>1?mt(u.length,y):0),P=d+g+O;return this.previousStart=d+g,this.previousEnd=P,this.cursor=Math.max(this.cursor,P),{trackIds:v,start:d+g,end:P,kill:()=>{for(const A of v)this.timeline.removeTrack(A)}}}keyframesFor(t,e,n,s,r){const o={time:0,value:t};if(n<=0)return[{time:0,value:e}];const a=typeof r=="string"?kt(r):void 0;if(a?.requiresBaking==="custom"||this.options.bakeEases&&dt(s)){const l=a?.fn??N(s);return[o,...de(o,{time:n,value:e},l,{intervalMs:this.options.bakeIntervalMs})]}return[o,{time:n,value:e,...s&&{easing:s}}]}resolveStart(t,e){const n=this.lastValues.get(`${t}|${e}`);if(n!==void 0)return n;const s=this.options.startValue?.(t,e);if(s!==void 0)return s;const r=this.options.defaults?.[e];if(r!==void 0)return r;if(e==="text")return"";if(e==="d")throw new Error(`gsap-compat: no starting shape for "${t}". Use fromTo({ d: … }, { morphSVG: … }), or live.to(), which reads the element's current shape.`);const o=Qi(e);return o!==void 0?(this.warn(`no start value for "${e}" on "${t}" — using the static default ${o}. GSAP would read the live DOM here; tinyfly cannot, so pass an explicit fromTo() or a defaults map.`),o):(this.warn(`no start value or default for "${e}" on "${t}" — using 0`),0)}easingFor(t){if(t!==void 0){if(typeof t=="string")return kt(t).easing;if(typeof t=="function")throw new Error('gsap-compat: function eases cannot be serialized. Use a named ease, or a cubic-bezier via { type: "cubic-bezier", points: [...] }.');return t}}targetsOf(t){return Array.isArray(t)?t:[t]}context(){return{cursor:this.cursor,previousStart:this.previousStart,previousEnd:this.previousEnd,labels:this.labels,scale:1e3}}nextTrackId(t){return this.trackCounter+=1,`${t}-${this.trackCounter}`}warn(t){this.options.onWarning?.(`gsap-compat: ${t}`)}}function Pe(i){if(typeof i=="string")return i;if(i&&typeof i=="object"){const t=i;return String(t.value??t.text??"")}return String(i??"")}function cr(i){return new Z(i)}function At(i){return ir(Zs(i))}const lr=new Set(["blur","brightness","glow","glowColor","shadowX","shadowY","shadowBlur","shadowColor"]),hr="#ffffff",ur="rgba(0, 0, 0, 0.5)";function fr(i){const t=[];if(i.blur!==void 0&&t.push(`blur(${Math.max(0,i.blur)}px)`),i.brightness!==void 0&&t.push(`brightness(${Math.max(0,i.brightness)})`),i.glow!==void 0&&t.push(`drop-shadow(0 0 ${Math.max(0,i.glow)}px ${i.glowColor??hr})`),i.shadowX!==void 0||i.shadowY!==void 0||i.shadowBlur!==void 0){const e=i.shadowX??0,n=i.shadowY??0,s=Math.max(0,i.shadowBlur??0);t.push(`drop-shadow(${e}px ${n}px ${s}px ${i.shadowColor??ur})`)}return t.length>0?t.join(" "):null}function dr(i,t){const e=i.childNodes.length===1?i.firstChild:null;if(e&&e.nodeType===3){const n=e;n.data!==t&&(n.data=t);return}i.textContent!==t&&(i.textContent=t)}function pr(i){if(!("ownerSVGElement"in i))return;const t=i.style;!t||t.transformBox||(t.transformBox="fill-box",t.transformOrigin||(t.transformOrigin="50% 50%"))}const tn=new Set(["width","height","top","right","bottom","left","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","borderWidth","fontSize","lineHeight","letterSpacing","outlineWidth","gap","rowGap","columnGap"]),mr=new Set(["x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY","motionPathX","motionPathY","motionPathRotate"]),gr=new Set(["originX","originY"]),yr=new Set(["clipTop","clipRight","clipBottom","clipLeft"]),br={fill:"backgroundColor",stroke:"borderColor",strokeWidth:"borderWidth",color:"color",backgroundColor:"backgroundColor",borderColor:"borderColor"},en={fill:"fill",stroke:"stroke",strokeWidth:"strokeWidth",strokeDasharray:"strokeDasharray",strokeDashoffset:"strokeDashoffset",fillOpacity:"fillOpacity",strokeOpacity:"strokeOpacity"},vr="http://www.w3.org/2000/svg";class J{targets=new Map;registerTarget(t,e){this.targets.set(t,e)}unregisterTarget(t){this.targets.delete(t)}getTarget(t){return this.targets.get(t)}clearTargets(){this.targets.clear()}applyState(t){for(const[e,n]of t.values){const s=this.targets.get(e);s&&this.applyProperties(s,n)}}applyProperties(t,e){const n=[];let s=null,r=null,o=null;const a=e.has("motionPathX"),c=e.has("motionPathY"),l=e.has("motionPathRotate");for(const[u,d]of e)if(!(u==="x"&&a)&&!(u==="y"&&c)&&!((u==="rotate"||u==="rotateZ")&&l)){if(mr.has(u)){const g=this.buildTransformPart(u,d);g&&n.push(g)}else if(gr.has(u))typeof d=="number"&&((s??={})[u]=d);else if(yr.has(u))typeof d=="number"&&((r??={})[u]=d);else if(lr.has(u))(o??={})[u]=d;else if(u!=="perspective"){if(u!=="shine")if(u==="text"&&typeof d=="string")dr(t,d);else if(u==="d"&&typeof d=="string"){const g=t;(g.tagName?.toLowerCase()==="path"?g:g.querySelector?.("path"))?.setAttribute?.("d",d)}else this.applyStyleProperty(t,u,d)}}const h=e.get("shine");typeof h=="number"&&this.applyShine(t,h);const f=e.get("perspective");if(typeof f=="number"&&n.unshift(`perspective(${f}px)`),n.length>0&&(t.style.transform=n.join(" "),pr(t)),s){const u=s.originX??50,d=s.originY??50;t.style.transformOrigin=`${u}% ${d}%`}if(r){const u=r.clipTop??0,d=r.clipRight??0,g=r.clipBottom??0,p=r.clipLeft??0;t.style.clipPath=`inset(${u}% ${d}% ${g}% ${p}%)`}if(o){const u=fr(o);u&&(t.style.filter=u)}}buildTransformPart(t,e){if(typeof e!="number")return null;switch(t){case"x":case"motionPathX":return`translateX(${e}px)`;case"y":case"motionPathY":return`translateY(${e}px)`;case"z":return`translateZ(${e}px)`;case"rotate":case"rotateZ":case"motionPathRotate":return`rotate(${e}deg)`;case"rotateX":return`rotateX(${e}deg)`;case"rotateY":return`rotateY(${e}deg)`;case"scale":return`scale(${e})`;case"scaleX":return`scaleX(${e})`;case"scaleY":return`scaleY(${e})`;case"scaleZ":return`scaleZ(${e})`;case"skewX":return`skewX(${e}deg)`;case"skewY":return`skewY(${e}deg)`;default:return null}}applyShine(t,e){t.dataset.shineBase||(t.dataset.shineBase=t.style.color||"currentColor");const n=t.dataset.shineBase,s=-20+e*140,r=t.style;r.color="transparent",r.backgroundImage=`linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%), linear-gradient(${n}, ${n})`,r.backgroundSize="250% 100%, 100% 100%",r.backgroundPosition=`${s}% 0, 0 0`,r.backgroundRepeat="no-repeat",r.webkitBackgroundClip="text",r.backgroundClip="text"}applyStyleProperty(t,e,n){let s;if(t.namespaceURI===vr&&e in en){const a=Array.isArray(n)?n.join(", "):String(n);t.style[en[e]]=a;return}else e==="fill"&&t.dataset?.elementType==="text"?s="color":s=br[e]??e;let o;typeof n=="number"?tn.has(e)||tn.has(s)?o=`${n}px`:o=String(n):Array.isArray(n)?o=n.join(", "):o=n,t.style[s]=o}}const wr={request:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i)};class nn{adapter=new J;scheduler;rootOption;names=new WeakMap;elements=new Map;nameCounter=0;objectNames=new WeakMap;objects=new Map;owned=new Set;currentCollector;tickerCallbacks=new Set;tickerTime=0;tickerFrame=0;liveTimelines=new Set;utils=Vs();active=new Map;applied=new Map;dirty=new Set;frameId=null;lastTimestamp=null;destroyed=!1;constructor(t={}){this.scheduler=t.scheduler??wr,this.rootOption=t.root}get root(){return this.rootOption??document}resolveTargets(t){const e=[];for(const n of this.targetsOf(t)){const s=this.nameFor(n);xe(n)&&this.currentCollector?.touch(n,s),e.push(s)}return e}query(t){return this.selectorRoot.querySelector(t)}get collector(){return this.currentCollector}setCollector(t){this.currentCollector=t}forget(t){this.applied.delete(t),this.dirty.delete(t)}get selectorRoot(){return this.currentCollector?.scope??this.root}elementFor(t){return this.elements.get(t)}objectFor(t){return this.objects.get(t)}appliedValue(t,e){return this.applied.get(t)?.get(e)}velocityOf(t,e){for(const s of[...this.active.keys()].reverse()){if(s.getTracks({target:t,property:e}).length===0)continue;const r=s.currentTime;if(r<4)return 0;const o=s.getStateAtTime(r).values.get(t)?.get(e),a=s.getStateAtTime(r-4).values.get(t)?.get(e);if(typeof o!="number"||typeof a!="number")return;const c=(o-a)/4;return(s.direction==="reverse"?-c:c)*1e3}}ticker={add:t=>{this.destroyed||(this.tickerCallbacks.size===0&&(this.tickerTime=0,this.tickerFrame=0),this.tickerCallbacks.add(t),this.currentCollector?.track({revert:()=>this.ticker.remove(t)}),this.startLoop())},remove:t=>{this.tickerCallbacks.delete(t),this.running||this.stopLoop()}};activate(t,e={}){this.destroyed||(t.onUpdate=n=>this.write(n),this.active.delete(t),this.active.set(t,e),this.startLoop())}deactivate(t){this.active.delete(t),this.running||this.stopLoop()}own(t){return this.destroyed?t.destroy():this.owned.add(t),t}destroy(){this.destroyed=!0;for(const t of this.owned)t.destroy();this.owned.clear();for(const t of this.active.keys())t.stop();this.active.clear(),this.stopLoop(),this.adapter.clearTargets(),this.elements.clear(),this.names=new WeakMap,this.objects.clear(),this.objectNames=new WeakMap,this.tickerCallbacks.clear(),this.liveTimelines.clear(),this.applied.clear(),this.dirty.clear()}apply(t,e){if(this.destroyed)return;const n=new Map(Object.entries(e));this.write({values:new Map([[t,n]]),currentTime:0,playbackState:"idle",direction:"forward",loopIteration:0}),this.flush()}render(t){this.destroyed||(this.write(t.getStateAtTime(t.currentTime)),this.flush())}tick(t){const e=[...this.active];for(const[n]of e)n.duration<=0?(this.write(n.getStateAtTime(0)),n.stop()):n.tick(t);this.flush();for(const[n,s]of e)s.onUpdate?.(),n.playbackState!=="playing"&&this.active.get(n)===s&&this.active.delete(n);this.flush(),this.runTicker(t),this.running||this.stopLoop()}get running(){return this.active.size>0||this.tickerCallbacks.size>0}runTicker(t){if(this.tickerCallbacks.size!==0){this.tickerTime+=t,this.tickerFrame+=1;for(const e of[...this.tickerCallbacks])e(this.tickerTime/1e3,t,this.tickerFrame)}}write(t){for(const[e,n]of t.values){let s=this.applied.get(e);s||(s=new Map,this.applied.set(e,s));for(const[r,o]of n)s.set(r,o);this.dirty.add(e)}}flush(){if(this.dirty.size===0)return;const t=new Map;for(const e of this.dirty){const n=this.applied.get(e),s=this.objects.get(e);if(s)for(const[r,o]of n)s[r]=o;else t.set(e,n)}this.dirty.clear(),t.size!==0&&this.adapter.applyState({values:t,currentTime:0,playbackState:"playing",direction:"forward",loopIteration:0})}frame=t=>{this.frameId=null;const e=this.lastTimestamp===null?0:t-this.lastTimestamp;this.lastTimestamp=t,e>0&&this.tick(e),this.running&&this.frameId===null&&(this.frameId=this.scheduler.request(this.frame))};startLoop(){this.frameId===null&&(this.lastTimestamp=null,this.frameId=this.scheduler.request(this.frame))}stopLoop(){this.frameId!==null&&this.scheduler.cancel(this.frameId),this.frameId=null,this.lastTimestamp=null}targetsOf(t){if(typeof t=="string")return Array.from(this.selectorRoot.querySelectorAll(t));if(xe(t))return[t];if(!Tr(t))return[t];const e=[];for(const n of Array.from(t))e.push(...this.targetsOf(n));return e}nameFor(t){return xe(t)?this.elementName(t):this.objectName(t)}objectName(t){const e=this.objectNames.get(t);if(e)return e;let n;do this.nameCounter+=1,n=`obj-${this.nameCounter}`;while(this.objects.has(n)||this.elements.has(n));return this.objectNames.set(t,n),this.objects.set(n,t),n}elementName(t){const e=this.names.get(t);if(e)return e;let n=t.id?`#${t.id}`:"";if(!n||this.elements.has(n))do this.nameCounter+=1,n=`el-${this.nameCounter}`;while(this.elements.has(n));return this.names.set(t,n),this.elements.set(n,t),this.adapter.registerTarget(n,t),n}}function xe(i){return typeof i=="object"&&i!==null&&i.nodeType===1}function Tr(i){if(Array.isArray(i))return!0;const t=i;return typeof t.length=="number"&&typeof t.item=="function"}function jt(i){const t=i.style;if(!t)return i.getBoundingClientRect();const e=t.transform;t.transform="none";const n=i.getBoundingClientRect();return t.transform=e,n}const sn=i=>typeof i=="object"&&i!==null&&i.nodeType===1;function Sr(i){const t={};for(const e of Array.from(i.attributes))t[e.name]=e.value;return t}function kr(i){const t=i.getScreenCTM?.();if(t)return[t.a,t.b,t.c,t.d,t.e,t.f];const e=i.getBoundingClientRect();return[1,0,0,1,e.left,e.top]}function Mr(i,t){const e=typeof i=="string"||Array.isArray(i)||sn(i)?{path:i}:i,{align:n,alignOrigin:s,path:r,...o}=e,a=S=>{const M=sn(S)?S:t.query(S);return M||t.warn(`gsap-compat: motionPath could not find "${String(S)}"`),M};let c=null,l="";if(Array.isArray(r)||typeof r=="string"&&rt(r))l=r;else{c=a(r);const S=c&&Yt({tag:c.localName,attributes:Sr(c)});c&&!S&&t.warn(`gsap-compat: motionPath element <${c.localName}> has no path geometry`),l=S??""}const h={...o,path:l};if(n===void 0||n===!1)return h;const f=n===!0?c:a(n);if(!f)return n===!0&&t.warn("gsap-compat: motionPath align: true needs the path to be an element"),h;const u=t.targets[0];if(!u)return h;const[d,g,p,y,b,v]=kr(f),w=jt(u),[k,T]=s??[.5,.5];for(const S of t.targets.slice(1)){const M=jt(S);if(Math.abs(M.left-w.left)>.5||Math.abs(M.top-w.top)>.5){t.warn("gsap-compat: motionPath align measures the first target; the others are laid out elsewhere");break}}return h.matrix=[d,g,p,y,b-w.left-k*w.width,v-w.top-T*w.height],h}const rn=i=>typeof i=="object"&&i!==null&&i.nodeType===1;function on(i){const t={};for(const e of Array.from(i.attributes))t[e.name]=e.value;return t}function an(i){if(!i)return null;const t=Yt({tag:i.localName,attributes:on(i)});return t||(i.querySelector("path")?.getAttribute("d")??null)}function Ar(i,t,e){const n=Zi(i);if(typeof n=="string"&&rt(n))return n;const s=rn(n)?n:typeof n=="string"?t(n):null,r=an(s);return r||(e(`gsap-compat: morphSVG could not find a shape for "${String(n)}"`),"")}const Pr=new Set(["cx","cy","r","rx","ry","x","y","width","height","x1","y1","x2","y2","points"]);function xr(i,t=document){return(typeof i=="string"?Array.from(t.querySelectorAll(i)):rn(i)?[i]:Array.from(i)).map(n=>{if(n.localName==="path")return n;const s=Yt({tag:n.localName,attributes:on(n)});if(!s||!n.parentNode)return n;const r=n.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");for(const o of Array.from(n.attributes))Pr.has(o.name)||r.setAttribute(o.name,o.value);return r.setAttribute("d",s),n.parentNode.replaceChild(r,n),r})}const cn=.3;class ln{options;target;running=!1;dragging=!1;passedTolerance=!1;lastX=0;lastY=0;startX=0;startY=0;velocityX=0;velocityY=0;lastTime=0;constructor(t){this.options=t,this.target=t.target}start(){if(this.running)return;this.running=!0;const t=this.options.type??["pointer","touch"];t.includes("pointer")&&(this.target.addEventListener("pointerdown",this.onPointerDown),this.target.addEventListener("pointermove",this.onPointerMove),this.target.addEventListener("pointerup",this.onPointerUp),this.target.addEventListener("pointercancel",this.onPointerUp)),t.includes("touch")&&(this.target.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.target.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.target.addEventListener("touchend",this.onTouchEnd)),t.includes("wheel")&&this.target.addEventListener("wheel",this.onWheel,{passive:!1})}stop(){this.running&&(this.running=!1,this.target.removeEventListener("pointerdown",this.onPointerDown),this.target.removeEventListener("pointermove",this.onPointerMove),this.target.removeEventListener("pointerup",this.onPointerUp),this.target.removeEventListener("pointercancel",this.onPointerUp),this.target.removeEventListener("touchstart",this.onTouchStart),this.target.removeEventListener("touchmove",this.onTouchMove),this.target.removeEventListener("touchend",this.onTouchEnd),this.target.removeEventListener("wheel",this.onWheel))}destroy(){this.stop()}get velocity(){return{x:this.velocityX,y:this.velocityY}}begin(t,e,n){this.dragging=!0,this.passedTolerance=!1,this.startX=t,this.startY=e,this.lastX=t,this.lastY=e,this.velocityX=0,this.velocityY=0,this.lastTime=hn(),this.options.onPress?.(this.stateFrom(0,0,n))}move(t,e,n){if(!this.dragging)return;const s=t-this.lastX,r=e-this.lastY;this.lastX=t,this.lastY=e;const o=t-this.startX,a=e-this.startY,c=this.options.tolerance??3;if(!this.passedTolerance){if(Math.hypot(o,a)<c)return;this.passedTolerance=!0}this.updateVelocity(s,r),this.options.preventDefault!==!1&&n.cancelable&&n.preventDefault(),this.options.onMove?.(this.stateFrom(s,r,n))}end(t){this.dragging&&(this.dragging=!1,this.options.onRelease?.(this.stateFrom(0,0,t)))}updateVelocity(t,e){const n=hn(),s=Math.max(1,n-this.lastTime);this.lastTime=n;const r=t/s*1e3,o=e/s*1e3;this.velocityX+=(r-this.velocityX)*cn,this.velocityY+=(o-this.velocityY)*cn}stateFrom(t,e,n){return{deltaX:t,deltaY:e,velocityX:this.velocityX,velocityY:this.velocityY,totalX:this.lastX-this.startX,totalY:this.lastY-this.startY,isDragging:this.dragging,event:n}}onPointerDown=t=>{const e=t,n=this.target;if(typeof e.pointerId=="number"&&typeof n.setPointerCapture=="function")try{n.setPointerCapture(e.pointerId)}catch{}this.begin(e.clientX,e.clientY,t)};onPointerMove=t=>{const e=t;this.move(e.clientX,e.clientY,t)};onPointerUp=t=>this.end(t);onTouchStart=t=>{const e=t.touches[0];e&&this.begin(e.clientX,e.clientY,t)};onTouchMove=t=>{const e=t.touches[0];e&&this.move(e.clientX,e.clientY,t)};onTouchEnd=t=>this.end(t);onWheel=t=>{const e=t;this.options.preventDefault!==!1&&e.cancelable&&e.preventDefault(),this.updateVelocity(e.deltaX,e.deltaY),this.options.onMove?.({deltaX:e.deltaX,deltaY:e.deltaY,velocityX:this.velocityX,velocityY:this.velocityY,totalX:0,totalY:0,isDragging:!1,event:t})}}function hn(){return typeof performance<"u"?performance.now():Date.now()}function un(i,t,e){let n={delta:0,line:null},s=e;for(const r of i)for(const o of t){const a=Math.abs(o-r);a<=s&&(s=a,n={delta:o-r,line:o})}return n}function fn(i,t){return t<=0?[]:i.map(e=>Math.round(e/t)*t)}class _e{options;observer;x;y;originX=0;originY=0;snappedX=null;snappedY=null;constructor(t){this.options=t,this.x=t.initialX??0,this.y=t.initialY??0,this.observer=new ln({target:t.target,onPress:e=>{const n=t.getPosition?.();n&&(this.x=n.x,this.y=n.y),this.originX=this.x,this.originY=this.y,t.onPress?.(e)},onMove:e=>this.handleMove(e),onRelease:e=>t.onRelease?.(e)})}start(){this.observer.start()}stop(){this.observer.stop()}destroy(){this.observer.destroy()}get position(){return{x:this.x,y:this.y}}get velocity(){return this.observer.velocity}setPosition(t,e){const n=this.options.axis??"both";this.x=n==="y"?this.x:this.applyConstraints(t,"x"),this.y=n==="x"?this.y:this.applyConstraints(e,"y")}get snapLines(){return{x:this.snappedX,y:this.snappedY}}snapThreshold(){if(this.options.snapThreshold!==void 0)return this.options.snapThreshold;const t=this.options.snap??0;return t>0?t/2:8}handleMove(t){this.setPosition(this.originX+t.totalX,this.originY+t.totalY),this.options.mode==="scrub"&&this.scrub(),this.options.onDrag?.(this.position,t),this.options.onSnap?.(this.snapLines)}scrub(){const t=this.options.timeline;if(!t)return;const e=t.duration;if(e<=0)return;const n=this.options.scrubDistance??500;if(n===0)return;const s=(this.options.axis??"both")==="y"?this.y:this.x,r=_r(s/n);t.pause(),t.seek(r*e)}applyConstraints(t,e){let n=t;const s=[...fn([n],this.options.snap??0),...(e==="x"?this.options.snapLinesX:this.options.snapLinesY)??[]],r=un([n],s,this.snapThreshold());n+=r.delta,e==="x"?this.snappedX=r.line:this.snappedY=r.line;const o=this.options.bounds;if(o){const a=e==="x"?o.minX:o.minY,c=e==="x"?o.maxX:o.maxY;a!==void 0&&(n=Math.max(a,n)),c!==void 0&&(n=Math.min(c,n))}return n}}function _r(i){return i<0?0:i>1?1:i}function Er(i){const t=new _e(i);return t.start(),t}const Cr={x:"x",y:"y","x,y":"both"},Ee=i=>typeof i=="object"&&i!==null&&i.nodeType===1;function dn(i,t){const e=jt(i),n=t.getBoundingClientRect();return{minX:n.left-e.left,maxX:n.right-e.right,minY:n.top-e.top,maxY:n.bottom-e.bottom}}function pn(i){return Array.isArray(i)?[...i]:i}function Rr(i,t,e,n={}){const[s]=t.resolveTargets(e),r=s?t.elementFor(s):void 0;if(!s||!r)throw new Error(`gsap-compat: live.draggable could not find ${String(e)}`);if(n.type==="rotation")return Ir(i,t,s,r,n);const o=Cr[n.type??"x,y"],a=()=>{const p=t.appliedValue(s,"x"),y=t.appliedValue(s,"y");return{x:typeof p=="number"?p:0,y:typeof y=="number"?y:0}},c=typeof n.bounds=="string"?t.query(n.bounds):Ee(n.bounds)?n.bounds:null,h={bounds:(!c&&n.bounds&&!Ee(n.bounds)?n.bounds:void 0)??(c?dn(r,c):void 0)};let f=null;const u=()=>{f?.kill(),f=null},d=p=>{const y=n.inertia===!0?{}:n.inertia,b=y.friction??(y.resistance!==void 0?Ae(y.resistance):4),v=a(),w=h.bounds??{};let k,T;const S=y.end;if(Array.isArray(S)){const E=yt({from:v.x,velocity:o==="y"?0:p.x,friction:b}),O=yt({from:v.y,velocity:o==="x"?0:p.y,friction:b});let P=S[0];for(const A of S)Math.hypot(A.x-E,A.y-O)<Math.hypot(P.x-E,P.y-O)&&(P=A);P&&(k=[P.x],T=[P.y])}else typeof S=="number"?(k=S,T=S):S&&(k=pn(S.x),T=pn(S.y));const M={};o!=="y"&&(M.x={velocity:p.x,friction:b,min:w.minX,max:w.maxX,end:k}),o!=="x"&&(M.y={velocity:p.y,friction:b,min:w.minY,max:w.maxY,end:T}),f=i.to(r,{inertia:M,onComplete:()=>n.onThrowComplete?.()})},g=new _e({target:r,axis:o,snap:n.snap,get bounds(){return h.bounds},getPosition:a,onPress:()=>{u(),c&&(h.bounds=dn(r,c)),n.onPress?.()},onDrag:p=>{t.apply(s,o==="x"?{x:p.x}:o==="y"?{y:p.y}:{x:p.x,y:p.y}),n.onDrag?.(p)},onRelease:()=>{const p=g.velocity;n.onRelease?.(p),n.inertia&&d(p)}});return g.start(),{draggable:g,get position(){return a()},get rotation(){const p=t.appliedValue(s,"rotate");return typeof p=="number"?p:0},destroy(){u(),g.destroy()}}}function Ir(i,t,e,n,s){const r=typeof s.bounds=="object"&&s.bounds!==null&&!Ee(s.bounds)?s.bounds:{},o=()=>{const w=t.appliedValue(e,"rotate");return typeof w=="number"?w:0},a=w=>Math.min(r.maxRotation??1/0,Math.max(r.minRotation??-1/0,w));let c=null,l=!1,h,f={x:0,y:0},u=0,d=0,g=[];const p=w=>Math.atan2(w.clientY-f.y,w.clientX-f.x)*180/Math.PI,y=w=>{if(l)return;c?.kill(),c=null,l=!0,h=w.pointerId,n.setPointerCapture?.(w.pointerId);const k=n.getBoundingClientRect();f={x:k.left+k.width/2,y:k.top+k.height/2},u=p(w),d=o(),g=[{time:performance.now(),rotation:d}],s.onPress?.()},b=w=>{if(!l||w.pointerId!==h)return;const k=p(w);let T=k-u;T>180&&(T-=360),T<-180&&(T+=360),u=k,d+=T;let S=a(d);s.snap&&(S=a(Math.round(S/s.snap)*s.snap)),t.apply(e,{rotate:S});const M=performance.now();for(g.push({time:M,rotation:S});g.length>2&&M-g[0].time>100;)g.shift();const E={x:0,y:0};s.onDrag?.(E)},v=w=>{if(!l||w.pointerId!==h)return;l=!1;const k=g[0],T=g[g.length-1],S=k&&T?(T.time-k.time)/1e3:0,M=S>0?(T.rotation-k.rotation)/S:0;if(s.onRelease?.({x:M,y:0}),!s.inertia)return;const E=s.inertia===!0?{}:s.inertia,O=E.friction??(E.resistance!==void 0?Ae(E.resistance):4),P=typeof E.end=="number"||Array.isArray(E.end)?E.end:void 0;c=i.to(n,{inertia:{rotate:{velocity:M,friction:O,min:r.minRotation,max:r.maxRotation,end:Array.isArray(P)?P.filter(A=>typeof A=="number"):P}},onComplete:()=>s.onThrowComplete?.()})};return n.addEventListener("pointerdown",y),n.addEventListener("pointermove",b),n.addEventListener("pointerup",v),n.addEventListener("pointercancel",v),n.style.touchAction="none",{draggable:void 0,position:{x:0,y:0},get rotation(){return o()},destroy(){c?.kill(),n.removeEventListener("pointerdown",y),n.removeEventListener("pointermove",b),n.removeEventListener("pointerup",v),n.removeEventListener("pointercancel",v)}}}const Fr={opacity:0,scale:.6};function $r(i){const t=i.getBoundingClientRect();return t.width===0&&t.height===0?null:{cx:t.left+t.width/2,cy:t.top+t.height/2,width:t.width,height:t.height}}function mn(i){const t=jt(i);return t.width===0&&t.height===0?null:{cx:t.left+t.width/2,cy:t.top+t.height/2,width:t.width,height:t.height}}function Ce(i,t){const n=i.resolveTargets(t).map(o=>i.elementFor(o)).filter(o=>!!o),s=new Map,r=new Map;for(const o of n){const a=$r(o);s.set(o,a);const c=gn(o);a&&c!==void 0&&!r.has(c)&&r.set(c,{element:o,box:a})}return{elements:n,boxes:s,ids:r}}const Re=new WeakMap;function Ie(i,t,e,n={}){const s=n.duration??.6,r=n.ease??"power2.inOut",o=n.stagger??0,a=n.scale!==!1,c=n.enter===void 0?Fr:n.enter,l=new Set(e.elements);if(n.targets!==void 0)for(const d of i.resolveTargets(n.targets)){const g=i.elementFor(d);g&&l.add(g)}const h=[...l].sort((d,g)=>d===g?0:d.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),f=t({onComplete:n.onComplete});let u=0;for(const d of h){const g=mn(d);if(!g)continue;let p=e.boxes.get(d)??null,y;const b=gn(d),v=!p&&b!==void 0?e.ids.get(b):void 0;v&&v.element!==d&&(p=v.box,y=v.element);const[w]=i.resolveTargets(d);Re.get(d)?.timeline.removeTracks({target:w});const k=u*o;if(!p){if(c===!1)continue;f.fromTo(d,{x:0,y:0,scaleX:1,scaleY:1,...c},{...yn(c),x:0,y:0,scaleX:1,scaleY:1,duration:s,ease:r,delay:k},0),Re.set(d,f),u++;continue}const T=p.cx-g.cx,S=p.cy-g.cy,M=a?p.width/g.width:1,E=a?p.height/g.height:1;if(!(Math.abs(T)>.5||Math.abs(S)>.5||Math.abs(M-1)>.001||Math.abs(E-1)>.001)){const A=(_,x)=>{const C=i.appliedValue(w,_);return typeof C=="number"&&Math.abs(C-x)>1e-6};(A("x",0)||A("y",0)||A("scaleX",1)||A("scaleY",1))&&f.set(d,{x:0,y:0,scaleX:1,scaleY:1},0);continue}const P=n.fade===!0&&y!==void 0;f.fromTo(d,{x:T,y:S,scaleX:M,scaleY:E,...P&&{opacity:0}},{x:0,y:0,scaleX:1,scaleY:1,...P&&{opacity:1},duration:s,ease:r,delay:k},0),P&&y&&mn(y)&&f.fromTo(y,{opacity:1},{opacity:0,duration:s,ease:r,delay:k},0),Re.set(d,f),u++}return f}function gn(i){return i.dataset?.flipId}function yn(i){const t={};for(const e of Object.keys(i))t[e]=e==="opacity"||e.startsWith("scale")?1:0;return t}function Lr(i,t={}){const e=new Set((t.type??"chars,words,lines").split(",").map(p=>p.trim())),n={chars:t.charsClass??"char",words:t.wordsClass??"word",lines:t.linesClass??"line"},s=t.aria!==!1,r=i.map(p=>({element:p,html:p.innerHTML,ariaLabel:p.getAttribute("aria-label")}));let o={chars:[],words:[],lines:[],masks:[]},a,c,l=!1;const h=()=>{for(const{element:p,html:y,ariaLabel:b}of r)p.innerHTML=y,b===null?p.removeAttribute("aria-label"):p.setAttribute("aria-label",b)},f=()=>{a&&(a.revert?a.revert():a.kill?.(),a=void 0)},u=()=>{const p={chars:[],words:[],lines:[],masks:[]};for(const{element:y}of r){const b=(y.textContent??"").replace(/\s+/g," ").trim(),v=Dr(y,n.words),w=e.has("chars")?v.flatMap(S=>Or(S,n.chars)):[],k=e.has("lines")?Nr(y,v,n.lines):[];if(s){!y.hasAttribute("aria-label")&&b&&y.setAttribute("aria-label",b);for(const S of v)S.setAttribute("aria-hidden","true")}if(e.has("words"))p.words.push(...v);else for(const S of v)S.removeAttribute("class");p.chars.push(...w),p.lines.push(...k);const T=t.mask==="lines"?k:t.mask==="words"?v:t.mask==="chars"?w:[];for(const S of T)p.masks.push(qr(S,`${n[t.mask]}-mask`))}o=p},d={elements:i,get chars(){return o.chars},get words(){return o.words},get lines(){return o.lines},get masks(){return o.masks},split(){l||(f(),h(),u(),a=t.onSplit?.(d))},revert(){l=!0,c?.disconnect(),f(),h()}};u(),a=t.onSplit?.(d),t.autoSplit&&g();function g(){const p=new Map;let y=!1;const b=()=>{if(y)return;y=!0;const w=()=>{y=!1,d.split()};typeof requestAnimationFrame=="function"?requestAnimationFrame(w):setTimeout(w,0)};if(typeof ResizeObserver=="function"){c=new ResizeObserver(w=>{let k=!1;for(const T of w){const S=Math.round(T.contentRect.width),M=p.get(T.target);p.set(T.target,S),M!==void 0&&M!==S&&(k=!0)}k&&b()});for(const w of i)c.observe(w)}const v=i[0]?.ownerDocument?.fonts;v&&v.status!=="loaded"&&v.ready.then(()=>b())}return d}function Dr(i,t){const e=i.ownerDocument,n=[],s=e.createTreeWalker(i,4),r=[];for(let o=s.nextNode();o;o=s.nextNode())r.push(o);for(const o of r){const a=o.data.match(/\s+|\S+/g)??[];if(a.length===0)continue;const c=e.createDocumentFragment();for(const l of a){if(/^\s/.test(l)){c.appendChild(e.createTextNode(l));continue}const h=e.createElement("span");h.className=t,h.style.display="inline-block",h.textContent=l,c.appendChild(h),n.push(h)}o.replaceWith(c)}return n}function Or(i,t){const e=i.ownerDocument,n=Br(i.textContent??"").map(s=>{const r=e.createElement("span");return r.className=t,r.style.display="inline-block",r.textContent=s,r});return i.replaceChildren(...n),n}function Br(i){const t=Intl.Segmenter;return t?Array.from(new t(void 0,{granularity:"grapheme"}).segment(i),e=>e.segment):Array.from(i)}function Nr(i,t,e){const n=i.ownerDocument,s=new Map(t.map(g=>[g,g.getBoundingClientRect()])),r=[],o=g=>{for(const p of Array.from(g.childNodes))p.nodeType===3||s.has(p)||p.tagName==="BR"?r.push(p):o(p)};o(i);const a=[];let c=null,l=0,h=0,f=!1,u=[];const d=()=>{c=n.createElement("span"),c.className=e,c.style.display="block",a.push(c),u=[]};for(const g of r){if(g.tagName==="BR"){f=!0;continue}const p=s.get(g);if(p&&(!c||f||p.top>l+h)&&(d(),l=p.top,h=p.height/2,f=!1),!c)continue;const y=[];for(let w=g.parentNode;w&&w!==i;w=w.parentNode)y.unshift(w);let b=0;for(;b<u.length&&b<y.length&&u[b].original===y[b];)b++;u.length=b;let v=b===0?c:u[b-1].clone;for(const w of y.slice(b)){const k=w.cloneNode(!1);v.appendChild(k),u.push({original:w,clone:k}),v=k}v.appendChild(g)}return i.replaceChildren(...a),a}function qr(i,t){const e=i.ownerDocument.createElement("span");return e.className=t,e.style.display=i.style.display==="block"?"block":"inline-block",e.style.overflow="clip",e.style.paddingBottom="0.12em",e.style.marginBottom="-0.12em",i.replaceWith(e),e.appendChild(i),e}const bn={top:0,left:0,start:0,center:.5,centre:.5,middle:.5,bottom:1,right:1,end:1};function Fe(i){const t=i.trim().toLowerCase();if(t in bn)return bn[t];if(t.endsWith("%")){const e=Number.parseFloat(t.slice(0,-1));return Number.isNaN(e)?void 0:e/100}}function $e(i){if(typeof i=="number")return{elementFraction:0,viewportFraction:0,offsetPx:0,absolutePx:i};let t=0;const n=i.replace(/([+-])=\s*(-?[\d.]+)/g,(o,a,c)=>(t+=(a==="-"?-1:1)*Number.parseFloat(c),"")).trim().split(/\s+/).filter(Boolean);if(n.length===1&&/^-?[\d.]+$/.test(n[0]))return{elementFraction:0,viewportFraction:0,offsetPx:0,absolutePx:Number.parseFloat(n[0])+t};const s=n[0]!==void 0?Fe(n[0]):void 0,r=n[1]!==void 0?Fe(n[1]):void 0;return{elementFraction:s??0,viewportFraction:r??0,offsetPx:t}}function ct(i,t,e){const n=$e(e),s=n.absolutePx!==void 0?i.top+n.absolutePx:i.top+i.height*n.elementFraction,r=t*n.viewportFraction;return s-r+n.offsetPx}function Xr(i,t,e,n){const s=ct(i,t,e),o=ct(i,t,n)-s;return o<=0?s<=0?1:0:Le(-s/o)}function Le(i){return i<0?0:i>1?1:i===0?0:i}function vn(i,t,e,n){if(e<=0)return t;const s=1-Math.exp(-(n/1e3)/e);return i+(t-i)*s}function De(i,t,e,n,s){const r=h=>ct({top:i+s(h),bottom:i+s(h)+t,height:t},e,n),o=r(0),a=r(1);if(Math.sign(o)===Math.sign(a)||o===0||a===0)return o===0?0:a===0?1:Math.abs(o)<Math.abs(a)?0:1;let c=0,l=1;for(let h=0;h<40;h++){const f=(c+l)/2;Math.sign(r(f))===Math.sign(o)?c=f:l=f}return(c+l)/2}class wn{timeline;trigger;behaviour;options;observer=null;hasPlayed=!1;running=!1;constructor(t){this.timeline=t.timeline,this.trigger=t.trigger,this.behaviour=t.behaviour??"once",this.options=t}start(){if(!this.running){if(this.running=!0,typeof IntersectionObserver>"u"){this.enter();return}this.observer=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?this.enter():this.leave()},{threshold:this.options.threshold??.15,rootMargin:this.options.rootMargin,root:this.options.root??null}),this.observer.observe(this.trigger)}}stop(){this.running=!1,this.observer?.disconnect(),this.observer=null}destroy(){this.stop()}reset(){this.hasPlayed=!1,this.timeline.stop()}enter(){this.options.onEnter?.(),!(this.behaviour==="once"&&this.hasPlayed)&&(this.hasPlayed=!0,this.behaviour!=="once"&&this.timeline.seek(0),this.timeline.play())}leave(){this.options.onLeave?.(),this.behaviour==="reset"&&this.timeline.stop()}}function Yr(i){const t=new wn(i);return t.start(),t}class Tn{element;spacer;saved;axis;spacing;constructor(t,e={}){this.element=t,this.axis=e.axis??"y",this.spacing=e.spacing??!0;const n=t.ownerDocument;this.spacer=n.createElement("div"),this.spacer.className="pin-spacer",this.saved={position:t.style.position,top:t.style.top,left:t.style.left},this.axis==="x"&&(this.spacer.style.flexShrink="0"),t.replaceWith(this.spacer),this.spacer.appendChild(t)}release(){this.element.style.position=this.saved.position,this.element.style.top=this.saved.top,this.element.style.left=this.saved.left}apply(t,e){const n=Math.max(0,e);this.element.style.position="sticky",this.axis==="x"?(this.spacer.style.width=`${this.element.offsetWidth+n}px`,this.spacer.style.marginRight=this.spacing?"":`-${n}px`,this.element.style.left=`${t}px`):(this.spacer.style.height=`${this.element.offsetHeight+n}px`,this.spacer.style.marginBottom=this.spacing?"":`-${n}px`,this.element.style.top=`${t}px`)}destroy(){this.element.style.position=this.saved.position,this.element.style.top=this.saved.top,this.element.style.left=this.saved.left,this.spacer.parentNode&&this.spacer.replaceWith(this.element)}}const Vr=.15;function Sn(i){return typeof i=="object"&&!Array.isArray(i)?i:{snapTo:i}}function kn(i,t,e){const n=zt(i+t*Vr);if(typeof e=="function")return zt(e(n));if(typeof e=="number")return e<=0?i:zt(Math.round(n/e)*e);if(e.length===0)return i;let s=e[0];for(const r of e)Math.abs(r-n)<Math.abs(s-n)&&(s=r);return zt(s)}function Mn(i,t,e){const n=i.duration??{min:.2,max:.8};if(typeof n=="number")return n;const s=Math.min(1,Math.abs(t)/Math.max(1,e));return n.min+(n.max-n.min)*s}class An{rafId=null;cancelEvents=["wheel","touchstart","pointerdown","keydown"];onInterrupt=()=>this.cancel();write;eventTarget;constructor(t,e){this.write=t,this.eventTarget=e}get active(){return this.rafId!==null}animate(t,e,n,s=bt,r){if(this.cancel(),typeof requestAnimationFrame>"u"||n<=0){this.write(e),r?.();return}for(const c of this.cancelEvents)this.eventTarget?.addEventListener(c,this.onInterrupt,{passive:!0});let o=null;const a=c=>{o??=c;const l=Math.min(1,(c-o)/(n*1e3));this.write(t+(e-t)*s(l)),l<1?this.rafId=requestAnimationFrame(a):(this.rafId=null,this.detach(),r?.())};this.rafId=requestAnimationFrame(a)}cancel(){this.rafId!==null&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(this.rafId),this.rafId=null,this.detach()}detach(){for(const t of this.cancelEvents)this.eventTarget?.removeEventListener(t,this.onInterrupt)}}function zt(i){return Math.max(0,Math.min(1,i))}class Pn{options;scroller;nodes=[];scrollerStart;scrollerEnd;start;end;constructor(t,e,n){this.options=n===!0?{}:n,this.scroller=e;const{startColor:s="#3ecf7a",endColor:r="#ff5a5a",id:o}=this.options,a=o?`${o} `:"",c=(l,h,f)=>{const u=t.createElement("div");return u.textContent=`${a}${l}`,u.setAttribute("aria-hidden","true"),u.className="scroll-marker",Object.assign(u.style,{position:f?"fixed":"absolute",right:`${this.options.indent??0}px`,zIndex:"2147483646",pointerEvents:"none",borderTop:`1px solid ${h}`,color:h,font:`${this.options.fontSize??"11px"} ui-monospace, monospace`,padding:"2px 6px",whiteSpace:"nowrap",background:"rgba(0, 0, 0, 0.35)"}),(e??t.body).appendChild(u),this.nodes.push(u),u};this.scrollerStart=c("scroller-start",s,!e),this.scrollerEnd=c("scroller-end",r,!e),this.start=c("start",s,!1),this.end=c("end",r,!1),e&&getComputedStyle(e).position==="static"&&(e.style.position="relative")}place(t,e){this.start.style.top=`${t.startPage}px`,this.end.style.top=`${t.endPage}px`;const n=this.scroller?e:0;this.scrollerStart.style.top=`${n+t.startViewport}px`,this.scrollerEnd.style.top=`${n+t.endViewport}px`}follow(t,e){this.scroller&&this.place(t,e)}destroy(){for(const t of this.nodes.splice(0))t.remove()}}const Ur=120,lt=[],ht=new Set;let Oe=!1;const Wr=()=>{Oe||ht.size===0||(Oe=!0,queueMicrotask(()=>{Oe=!1;for(const i of ht)i.afterRefresh()}))},xn=()=>{for(const i of ht)i.beforeRefresh();for(const i of lt)i.refresh();for(const i of ht)i.afterRefresh()};let ut={width:0,height:0};const _n=()=>{const i=window.innerWidth,t=window.innerHeight,e=i===ut.width&&t!==ut.height,n=Math.abs(t-ut.height)<ut.height*.25,s=typeof navigator<"u"&&(navigator.maxTouchPoints??0)>0;e&&n&&s||(ut={width:i,height:t},xn())};class Pt{timeline;options;running=!1;pin=null;startPx=0;endPx=0;targetProgress=0;displayProgress=0;zone="before";measured=!1;lastScroll=null;lastScrollTime=0;velocityPxPerSecond=0;idleTimer=null;lastEmitted=null;rafId=null;lastFrameTime=null;onScroll=()=>this.update();releaseVelocity=0;snapper;snapTimer=null;markers=null;markerGeometry=null;constructor(t){this.timeline=t.timeline,this.options=t,this.snapper=new An(e=>this.scrollTo(e),typeof window<"u"?window:null)}start(){if(this.running)return;this.running=!0,this.timeline?.pause();const t=this.options.pin===!0?this.options.trigger:this.options.pin||null;t&&!this.options.container&&(this.pin=new Tn(t,{axis:this.options.horizontal?"x":"y",spacing:this.options.pinSpacing!==!1})),this.options.markers&&!this.options.horizontal&&typeof document<"u"&&(this.markers=new Pn(document,this.options.scroller??null,this.options.markers)),this.scrollTarget()?.addEventListener("scroll",this.onScroll,{passive:!0}),lt.length===0&&typeof window<"u"&&(ut={width:window.innerWidth,height:window.innerHeight},window.addEventListener("resize",_n,{passive:!0})),lt.push(this),this.refresh()}stop(){this.running&&(this.running=!1,this.scrollTarget()?.removeEventListener("scroll",this.onScroll),lt.splice(lt.indexOf(this),1),lt.length===0&&typeof window<"u"&&window.removeEventListener("resize",_n),this.stopSmoothing(),this.idleTimer!==null&&clearTimeout(this.idleTimer),this.idleTimer=null,this.snapTimer!==null&&clearTimeout(this.snapTimer),this.snapTimer=null,this.snapper.cancel())}destroy(){this.stop(),this.pin?.destroy(),this.pin=null,this.markers?.destroy(),this.markers=null}get startOffset(){return this.startPx}get endOffset(){return this.endPx}static refreshAll(){xn()}static onRefresh(t){return ht.add(t),()=>ht.delete(t)}get progress(){return this.targetProgress}get velocity(){return this.velocityPxPerSecond}refresh(){if(!this.running)return;this.measured&&this.options.onRefresh?.();const t=this.scrollPosition();this.pin?.release();const e=this.triggerRect();if(e&&this.options.container)this.measureInContainer(this.options.container);else if(e){const n=this.viewportHeight();if(this.startPx=t+ct(e,n,xt(this.options.start)??"top bottom"),this.endPx=this.resolveEnd(e,n,t),this.pin){const s=this.relativeRect(this.pin.element.getBoundingClientRect());this.pin.apply(s.top-(this.startPx-t),this.endPx-this.startPx)}this.markerGeometry=this.markers?this.markersFor(n):null}this.markers&&this.markerGeometry&&this.markers.place(this.markerGeometry,t),this.lastScroll=null,this.updateFrom(t,!this.measured),this.measured=!0,Wr()}sample(){this.refresh()}update(t){this.running&&this.updateFrom(t??this.scrollPosition(),!1)}updateFrom(t,e){this.trackVelocity(t),this.markers&&this.markerGeometry&&this.markers.follow(this.markerGeometry,t);const n=this.endPx-this.startPx,s=this.zone;this.targetProgress=n>0?Le((t-this.startPx)/n):t>=this.startPx?1:0,this.zone=n>0?t<=this.startPx?"before":t>=this.endPx?"after":"active":t>=this.startPx?"after":"before",this.fireBoundaryCallbacks(s,this.zone),e||this.smoothing()<=0?(this.displayProgress=this.targetProgress,this.applyProgress()):(this.emitUpdate(),this.startSmoothing())}smoothing(){const t=this.options.scrub;return typeof t=="number"?Math.max(0,t):0}resolveEnd(t,e,n){const s=xt(this.options.end)??"bottom top",r=typeof s=="string"?s.trim().match(/^\+=\s*(-?[\d.]+)\s*(%|px)?$/):null;if(r){const o=Number.parseFloat(r[1]);return this.startPx+(r[2]==="%"?e*o/100:o)}return n+ct(t,e,s)}applyProgress(){const t=this.timeline?.duration??0;this.timeline&&t>0&&this.timeline.seek(this.displayProgress*t),this.emitUpdate()}emitUpdate(){if(!this.options.onUpdate)return;const t=[this.displayProgress,this.velocityPxPerSecond];this.lastEmitted&&this.lastEmitted[0]===t[0]&&this.lastEmitted[1]===t[1]||(this.lastEmitted=t,this.options.onUpdate(t[0],t[1]))}trackVelocity(t){const e=typeof performance<"u"?performance.now():Date.now();this.lastScroll!==null&&e>this.lastScrollTime&&t!==this.lastScroll&&(this.velocityPxPerSecond=(t-this.lastScroll)/(e-this.lastScrollTime)*1e3),(this.lastScroll===null||t!==this.lastScroll)&&(this.lastScroll=t,this.lastScrollTime=e),!(this.velocityPxPerSecond===0||typeof setTimeout>"u")&&(this.idleTimer!==null&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>{this.idleTimer=null,this.releaseVelocity=this.velocityPxPerSecond,this.velocityPxPerSecond=0,this.emitUpdate(),this.scheduleSnap()},Ur))}fireBoundaryCallbacks(t,e){if(t===e)return;const{onEnter:n,onLeave:s,onEnterBack:r,onLeaveBack:o}=this.options;t==="before"?(n?.(),e==="after"&&s?.()):t==="after"?(r?.(),e==="before"&&o?.()):e==="after"?s?.():o?.()}scheduleSnap(){const t=this.options.snap;if(t===void 0||this.snapper.active)return;const e=Sn(t),n=()=>{this.snapTimer=null;const s=this.endPx-this.startPx,r=this.scrollPosition();if(!this.running||s<=0||r<=this.startPx||r>=this.endPx)return;const o=(r-this.startPx)/s,a=this.startPx+kn(o,this.releaseVelocity/s,e.snapTo)*s;Math.abs(a-r)<1||this.snapper.animate(r,a,Mn(e,a-r,this.viewportHeight()),e.ease)};e.delay?this.snapTimer=setTimeout(n,e.delay*1e3):n()}scrollTo(t){const e=this.options.scroller,n=this.options.horizontal?{left:t}:{top:t};e?typeof e.scrollTo=="function"?e.scrollTo({...n,behavior:"instant"}):this.options.horizontal?e.scrollLeft=t:e.scrollTop=t:typeof window<"u"&&window.scrollTo({...n,behavior:"instant"})}measureInContainer(t){const e=this.options.trigger;if(typeof e?.getBoundingClientRect!="function")return;const n=e.getBoundingClientRect(),s=this.options.scroller?.getBoundingClientRect?.().left??0,r=this.options.scroller?this.options.scroller.clientWidth:typeof window<"u"?window.innerWidth:0,o=n.left-s-t.shiftAt(t.progress()),{start:a,end:c}=t.range(),l=d=>a+d*(c-a),h=De(o,n.width,r,xt(this.options.start)??"left right",t.shiftAt);this.startPx=l(h);const f=xt(this.options.end)??"right left",u=typeof f=="string"?f.trim().match(/^\+=\s*(-?[\d.]+)\s*(px)?$/):null;this.endPx=u?this.startPx+Number.parseFloat(u[1]):l(De(o,n.width,r,f,t.shiftAt)),this.markerGeometry=null}markersFor(t){const e=(r,o)=>{const a=xt(r)??o;if(typeof a=="number")return 0;if(/^\s*\+=/.test(a))return;const c=$e(a);return t*c.viewportFraction-c.offsetPx},n=e(this.options.start,"top bottom")??0,s=e(this.options.end,"bottom top")??n;return{startViewport:n,endViewport:s,startPage:this.startPx+n,endPage:this.endPx+s}}startSmoothing(){if(this.rafId!==null||typeof requestAnimationFrame>"u")return;const t=e=>{if(this.rafId=null,!this.running)return;const n=this.lastFrameTime===null?16.67:e-this.lastFrameTime;this.lastFrameTime=e,this.displayProgress=vn(this.displayProgress,this.targetProgress,this.smoothing(),n);const s=Math.abs(this.targetProgress-this.displayProgress)<1e-4;s&&(this.displayProgress=this.targetProgress),this.applyProgress(),s?this.lastFrameTime=null:this.rafId=requestAnimationFrame(t)};this.rafId=requestAnimationFrame(t)}stopSmoothing(){this.rafId!==null&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(this.rafId),this.rafId=null,this.lastFrameTime=null}scrollTarget(){return this.options.scroller??(typeof window<"u"?window:null)}scrollPosition(){const t=this.options.scroller,e=this.options.horizontal;return t?(e?t.scrollLeft:t.scrollTop)??0:typeof window<"u"?(e?window.scrollX:window.scrollY)??0:0}triggerRect(){const t=this.options.trigger;return typeof t?.getBoundingClientRect!="function"?null:this.relativeRect(t.getBoundingClientRect())}relativeRect(t){const e=this.options.horizontal,n=e?t.left??0:t.top,s=e?t.right??0:t.bottom,r=e?t.width??0:t.height,o=this.options.scroller;if(o&&typeof o.getBoundingClientRect=="function"){const a=o.getBoundingClientRect(),c=e?a.left:a.top;return{top:n-c,bottom:s-c,height:r}}return{top:n,bottom:s,height:r}}viewportHeight(){const t=this.options.scroller,e=this.options.horizontal;return t?e?t.clientWidth:t.clientHeight:typeof window<"u"?e?window.innerWidth:window.innerHeight:0}}function xt(i){return typeof i=="function"?i():i}function jr(i){const t=new Pt(i);return t.start(),t}const Be=new Set,zr=16,En=.5,Hr=2;class Ne{options;frames;running=!1;reduced=!1;current=0;target=0;written=null;velocityPxPerSecond=0;frameId=null;lastTime=null;journey=null;pausedState=!1;effects=[];onWheel=t=>this.wheel(t);onScroll=()=>this.nativeScroll();onResize=()=>this.refresh();onLoad=()=>this.refresh();stopListening=null;constructor(t={}){this.options=t,this.frames=t.frames??{request:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e)}}start(){if(this.running||typeof window>"u")return this;this.running=!0,this.reduced=this.options.reducedMotion??(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),this.current=this.target=this.position();const t=this.options.scroller??window;return t.addEventListener("wheel",this.onWheel,{passive:!1}),t.addEventListener("scroll",this.onScroll,{passive:!0}),window.addEventListener("resize",this.onResize,{passive:!0}),window.addEventListener("load",this.onLoad),Be.add(this),this.stopListening=Pt.onRefresh({beforeRefresh:()=>this.rest(),afterRefresh:()=>this.refresh()}),this.refresh(),this}static refreshAll(){for(const t of Be)t.refresh()}stop(){if(!this.running)return this;this.running=!1;const t=this.options.scroller??window;return t.removeEventListener("wheel",this.onWheel),t.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize),window.removeEventListener("load",this.onLoad),Be.delete(this),this.stopListening?.(),this.stopListening=null,this.cancelFrame(),this.journey=null,this}destroy(){this.stop();for(const t of this.effects)qe(t.element,t.saved);this.effects=[]}kill(){this.destroy()}get state(){const t=this.limit();return{scroll:this.current,target:this.target,progress:t>0?this.current/t:0,velocity:this.velocityPxPerSecond}}paused(t){return t!==void 0&&(this.pausedState=t,t&&(this.target=this.current,this.journey=null)),this.pausedState}scrollTo(t,e={}){if(!this.running)return;const n=this.clamp(this.resolve(t)+(e.offset??0)),s=Math.abs(n-this.current),r=this.reduced?0:e.duration??Math.min(1.2,Math.max(.4,s/2500));if(r<=0){this.journey=null,this.current=this.target=n,this.write(n),this.applyEffects(0);return}this.target=n,this.journey={from:this.current,to:n,ms:r*1e3,ease:e.ease??bt,elapsed:0},this.requestFrame()}refresh(){if(!this.running)return;this.rest(),this.effects=[];const t=this.options.effects===!0?"[data-speed], [data-lag]":this.options.effects||"";if(t&&!this.reduced){const e=this.options.scroller??document,n=this.position(),s=this.viewportHeight(),r=this.options.scroller?.getBoundingClientRect().top??0;for(const o of e.querySelectorAll(t)){const a=Number.parseFloat(o.dataset.speed??""),c=Number.parseFloat(o.dataset.lag??""),l=o.getBoundingClientRect(),h=l.top-r+n;this.effects.push({element:o,speed:Number.isFinite(a)?a:void 0,lag:Number.isFinite(c)&&c>0?c:void 0,centre:h+l.height/2-s/2,lagged:n,shift:0,saved:o.style.getPropertyValue("translate")})}}this.current=this.target=this.clamp(this.position()),this.applyEffects(0)}rest(){for(const t of this.effects)qe(t.element,t.saved)}wheel(t){if(this.pausedState||this.reduced||(this.options.smooth??.8)<=0||t.ctrlKey||Math.abs(t.deltaX)>Math.abs(t.deltaY)||this.nestedScrollerTakes(t))return;const e=t.deltaMode===1?zr:t.deltaMode===2?this.viewportHeight():1,n=t.deltaY*e*(this.options.wheelMultiplier??1),s=this.clamp(this.target+n);s===this.target&&s===this.current||(t.preventDefault(),this.journey=null,this.target=s,this.requestFrame())}nativeScroll(){const t=this.position();this.written!==null&&Math.abs(t-this.written)<=Hr||(this.written=null,this.journey=null,this.cancelFrame(),this.current=this.target=t,this.requestFrame())}nestedScrollerTakes(t){const e=this.options.scroller??document.documentElement;for(let n=t.target;n&&n!==e&&n!==document.body;n=n.parentElement){if(n.hasAttribute?.("data-smooth-ignore"))return!0;const s=getComputedStyle(n);if(!/(auto|scroll)/.test(s.overflowY)||n.scrollHeight<=n.clientHeight)continue;if(t.deltaY<0?n.scrollTop>0:n.scrollTop+n.clientHeight<n.scrollHeight-1)return!0}return!1}requestFrame(){this.frameId!==null||!this.running||(this.frameId=this.frames.request(t=>this.frame(t)))}cancelFrame(){this.frameId!==null&&this.frames.cancel(this.frameId),this.frameId=null,this.lastTime=null}frame(t){this.frameId=null;const e=this.lastTime===null?1e3/60:Math.min(100,t-this.lastTime);this.lastTime=t;const n=this.current;if(this.journey){const r=this.journey;r.elapsed+=e;const o=Math.min(1,r.elapsed/r.ms);this.current=r.from+(r.to-r.from)*r.ease(o),o>=1&&(this.journey=null)}else if(this.current!==this.target){const r=(this.options.smooth??.8)*1e3/3;this.current+=(this.target-this.current)*(1-Math.exp(-e/r)),Math.abs(this.target-this.current)<En&&(this.current=this.target)}this.current!==n&&this.write(this.current),this.velocityPxPerSecond=e>0?(this.current-n)*1e3/e:0;const s=this.applyEffects(e);this.current!==n&&this.options.onUpdate?.(this.state),this.journey||this.current!==this.target||s?this.requestFrame():(this.lastTime=null,this.velocityPxPerSecond=0)}applyEffects(t){let e=!1;const n=this.current;for(const s of this.effects){let r=0;if(s.speed!==void 0&&(r+=(n-s.centre)*(1-s.speed)),s.lag!==void 0){const o=s.lag*1e3/3;s.lagged=t===0?n:s.lagged+(n-s.lagged)*(1-Math.exp(-t/o)),Math.abs(n-s.lagged)<En?s.lagged=n:e=!0,r+=n-s.lagged}qe(s.element,r===0?s.saved:`0 ${Gr(r)}px`),s.shift=r}return e}write(t){const e=Math.round(t);this.written=e;const n=this.options.scroller;n?n.scrollTop=e:window.scrollTo({top:e,behavior:"instant"})}position(){const t=this.options.scroller;return t?t.scrollTop:window.scrollY}viewportHeight(){const t=this.options.scroller;return t?t.clientHeight:window.innerHeight}limit(){const t=this.options.scroller??document.documentElement;return Math.max(0,t.scrollHeight-this.viewportHeight())}clamp(t){return Math.max(0,Math.min(this.limit(),t))}resolve(t){if(typeof t=="number")return t;const e=this.options.scroller??document,n=typeof t=="string"?e.querySelector(t):t;if(!n)return this.current;const s=this.options.scroller?.getBoundingClientRect().top??0,r=this.effects.find(o=>o.element===n)?.shift??0;return n.getBoundingClientRect().top-s+this.position()-r}}function qe(i,t){t?i.style.setProperty("translate",t):i.style.removeProperty("translate")}function Gr(i){return Math.round(i*100)/100}function Kr(i,t){switch(t){case"play":if(i.progress()>=1)break;i.reversed()?i.reverse():i.play();break;case"reverse":if(i.progress()<=0)break;i.reversed()?i.play():i.reverse();break;case"pause":i.pause();break;case"resume":i.resume();break;case"restart":i.restart();break;case"reset":i.pause(),i.progress(0);break;case"complete":i.pause(),i.progress(1);break}}function Xe(i,t,e,n,s=()=>{}){const r=d=>typeof d=="string"?i.query(d)??void 0:d,o=r(t.trigger)??n;if(!o){s(`gsap-compat: scrollTrigger has no trigger element${typeof t.trigger=="string"?` for "${t.trigger}"`:""}`);return}const a=t.scrub===void 0||t.scrub===!1?!1:t.scrub,c=(t.toggleActions??"play none none none").trim().split(/\s+/);let l=0,h;const f=(d,g)=>()=>{g?.(),e&&!a&&Kr(e,c[d]??"none"),t.once&&d===0&&queueMicrotask(()=>h.destroy())},u=t.containerAnimation?Jr(i,t.containerAnimation,o,s):void 0;return h=new Pt({trigger:o,start:t.start,end:t.end,scrub:a===!1?void 0:a,pin:t.pin===!0?!0:r(t.pin),scroller:r(t.scroller),horizontal:t.horizontal,pinSpacing:t.pinSpacing,onRefresh:t.invalidateOnRefresh&&e?.invalidate?()=>e.invalidate():void 0,snap:t.snap===void 0?void 0:Qr(t.snap,e),markers:t.markers,container:u,onUpdate:(d,g)=>{if(e&&a!==!1&&e.progress(d),t.onUpdate){const p=d<l||g<0?-1:1;t.onUpdate({progress:d,velocity:g,direction:p})}l=d},onEnter:f(0,t.onEnter),onLeave:f(1,t.onLeave),onEnterBack:f(2,t.onEnterBack),onLeaveBack:f(3,t.onLeaveBack)}),e&&a===!1&&e.progress(0),h.start(),i.own(h)}function Qr(i,t){const e=s=>s==="labels"?r=>Zr(r,t?.labelProgresses?.()??[]):s;if(typeof i!="object"||Array.isArray(i))return e(i);const n=i.ease?kt(i.ease):void 0;return{snapTo:e(i.snapTo),duration:i.duration,delay:i.delay,ease:n?n.fn??N(n.easing):void 0}}function Zr(i,t){return t.reduce((e,n)=>Math.abs(n-i)<Math.abs(e-i)?n:e,t[0]??i)}function Jr(i,t,e,n){const s=()=>t.timeline.getTracks({property:"x"}).map(r=>r.target).filter(r=>{const o=i.elementFor(r);return!!o&&o!==e&&o.contains(e)});return s().length===0&&n("gsap-compat: containerAnimation does not move an ancestor of the trigger along x"),{range:()=>{const r=t.scrollTrigger;return r||n("gsap-compat: containerAnimation needs its own scrollTrigger (created before this one)"),{start:r?.startOffset??0,end:r?.endOffset??0}},progress:()=>t.progress(),shiftAt:r=>{const o=t.timeline.getStateAtTime(r*t.timeline.duration);let a=0;for(const c of s()){const l=o.values.get(c)?.get("x");typeof l=="number"&&(a+=l)}return a}}}class Cn{conditions={};scope;host;items=[];snapshots=new Map;constructor(t,e){this.host=t,this.scope=e}add(t){const e=this.host.collector;this.host.setCollector(this);try{const n=t();return typeof n=="function"&&this.items.push({revert:n}),n}finally{this.host.setCollector(e)}}track(t){this.items.push(t)}touch(t,e){this.snapshots.has(t)||this.snapshots.set(t,{name:e,style:t.getAttribute("style"),d:t.getAttribute("d")})}revert(){for(const t of this.items.splice(0).reverse())t.revert?t.revert():t.kill?t.kill():t.destroy?.();for(const[t,{name:e,style:n,d:s}]of this.snapshots)n===null?t.removeAttribute("style"):t.setAttribute("style",n),s!==null&&t.setAttribute("d",s),this.host.forget(e);this.snapshots.clear()}kill(){this.revert()}}class to{host;scope;entries=[];listeners=[];scheduled=!1;constructor(t,e){this.host=t,this.scope=e}add(t,e){const n={conditions:t,setup:e,queries:new Map},s=typeof t=="string"?{matches:t}:t;if(typeof window<"u"&&typeof window.matchMedia=="function")for(const[r,o]of Object.entries(s)){const a=window.matchMedia(o);n.queries.set(r,a);const c=()=>this.scheduleUpdate();a.addEventListener("change",c),this.listeners.push(()=>a.removeEventListener("change",c))}return this.entries.push(n),this.update(n),this}revert(){for(const t of this.listeners.splice(0))t();for(const t of this.entries.splice(0))t.context?.revert()}kill(){this.revert()}scheduleUpdate(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1;for(const t of this.entries)this.update(t)}))}update(t){const e={};for(const[o,a]of t.queries)e[o]=a.matches;const n=Object.values(e).some(Boolean),s=n?JSON.stringify(e):void 0;if(s===t.key||(t.context?.revert(),t.context=void 0,t.key=s,!n))return;const r=new Cn(this.host,this.scope);r.conditions=e,r.add(()=>t.setup(r)),t.context=r}}class eo{frames;canvas;context;options;images;ready;current=0;drawn=-1;loadedCount=0;inFlight=0;destroyed=!1;onResize=()=>this.resize();constructor(t,e){this.canvas=t,this.context=t.getContext("2d"),this.options=e,this.frames=Math.max(1,Math.floor(e.frames)),this.images=new Array(this.frames),this.ready=new Array(this.frames).fill(!1),typeof window<"u"&&window.addEventListener("resize",this.onResize,{passive:!0}),this.resize(),this.pump()}get frame(){return this.current}set frame(t){this.current=Math.max(0,Math.min(this.frames-1,t)),this.draw()}get loaded(){return this.loadedCount}destroy(){this.destroyed=!0,typeof window<"u"&&window.removeEventListener("resize",this.onResize);for(const t of this.images)t&&(t.src="")}resize(){const t=typeof window<"u"?Math.min(window.devicePixelRatio||1,2):1,e=Math.round(this.canvas.clientWidth*t),n=Math.round(this.canvas.clientHeight*t);e>0&&n>0&&(this.canvas.width!==e||this.canvas.height!==n)&&(this.canvas.width=e,this.canvas.height=n),this.drawn=-1,this.draw()}draw(){const t=Math.round(this.current),e=this.nearestReady(t);if(e===-1||e===this.drawn||!this.context)return;const n=this.images[e],{width:s,height:r}=this.canvas,o=(this.options.fit??"cover")==="cover"?Math.max(s/n.naturalWidth,r/n.naturalHeight):Math.min(s/n.naturalWidth,r/n.naturalHeight),a=n.naturalWidth*o,c=n.naturalHeight*o;this.context.clearRect(0,0,s,r),this.context.drawImage(n,(s-a)/2,(r-c)/2,a,c),this.drawn=e,this.pump()}nearestReady(t){for(let e=0;e<this.frames;e++){if(t-e>=0&&this.ready[t-e])return t-e;if(t+e<this.frames&&this.ready[t+e])return t+e}return-1}pump(){const t=this.options.concurrency??6,e=Math.round(this.current);for(let n=0;n<this.frames&&this.inFlight<t;n++)for(const s of n===0?[e]:[e+n,e-n])s<0||s>=this.frames||this.images[s]||this.inFlight>=t||this.load(s)}load(t){const e=new Image;e.decoding="async",this.images[t]=e,this.inFlight++;const n=s=>{if(!this.destroyed){if(this.inFlight--,s){this.ready[t]=!0,this.loadedCount++,this.options.onProgress?.(this.loadedCount,this.frames);const r=Math.round(this.current);(Math.abs(t-r)<Math.abs(this.drawn-r)||this.drawn===-1)&&(this.drawn=-1,this.draw())}this.pump()}};e.onload=()=>n(!0),e.onerror=()=>n(!1),e.src=this.options.url(t)}}const io={opacity:0,y:-16},no={opacity:0,y:16};async function so(i,t,e,n){const s=t.collector?.scope??t.root,r=s.ownerDocument??s,o=()=>n.shared?[...s.querySelectorAll(n.shared)]:[];if(n.native&&typeof r.startViewTransition=="function")return ro(r,n,o);const a=n.duration??.35,c=n.ease??"power2.inOut",l=y=>new Promise(b=>{y(b)||b()}),h=o(),f=h.length?Ce(t,h):void 0,u=n.from!==void 0?Rn(t,n.from,n.shared):[];if(u.length&&n.leave!==!1){const y=n.leave??io;await l(b=>i.to(u,{...y,duration:a,ease:c,onComplete:b}))}await n.update();const d=[],g=typeof n.to=="function"?n.to():n.to,p=g!==void 0?Rn(t,g,n.shared):[];if(p.length&&n.enter!==!1){const y=n.enter??no;d.push(l(b=>i.fromTo(p,y,{...yn(y),duration:a,ease:c,onComplete:b})))}if(f){const y=o().filter(b=>!h.includes(b));y.length&&d.push(l(b=>Ie(t,e,f,{targets:y,duration:a*1.4,ease:c,enter:!1,onComplete:b})))}await Promise.all(d)}function Rn(i,t,e){const n=i.resolveTargets(t).map(s=>i.elementFor(s)).filter(s=>!!s);return e?n.flatMap(s=>!s.querySelector(e)&&!s.matches(e)?[s]:[...s.children].filter(r=>!r.matches(e)&&!r.querySelector(e))):n}async function ro(i,t,e){const n=(a,c)=>{const l=a.dataset?.flipId;l&&a.style.setProperty("view-transition-name",c?`tf-${l.replace(/[^\w-]/g,"-")}`:"")},s=e();s.forEach(a=>n(a,!0));let r=[];await i.startViewTransition(async()=>{s.forEach(a=>n(a,!1)),await t.update(),r=e(),r.forEach(a=>n(a,!0))}).finished,r.forEach(a=>n(a,!1))}const In={create:(i,t)=>Te(i,Xi(t))},Fn={create:(i,t)=>Te(i,{fn:Yi(t)})},$n={create:(i,t)=>Te(i,{fn:Vi(t)})},oo=new Set(["keyframes","duration","delay","ease","easeEach","stagger","repeat","repeatDelay","yoyo","repeatRefresh","paused","id","onStart","onUpdate","onComplete","onRepeat","onReverseComplete","scrollTrigger"]),Ln=.5,ao="power1.inOut";function co(i){return i.keyframes!==void 0&&i.keyframes!==null}function lo(i){const t=i.keyframes,e={};for(const[l,h]of Object.entries(i))oo.has(l)||(e[l]=h);if(Array.isArray(t))return t.map(l=>({...e,...l,duration:l.duration??i.duration??Ln}));const n=Object.entries(t),s=i.duration??Ln,r=t.easeEach??i.easeEach??ao;if(n.length>0&&n.every(([l])=>/^\s*-?\d+(\.\d+)?\s*%\s*$/.test(l)||l==="easeEach")){const l=n.filter(([u])=>u!=="easeEach").map(([u,d])=>({at:Number.parseFloat(u)/100,step:d})).sort((u,d)=>u.at-d.at),h=[];let f=0;for(const{at:u,step:d}of l){const g=Math.max(0,u-f);h.push({...e,ease:r,...d,duration:g*s}),f=u}return h}const o=n.filter(([l,h])=>l!=="easeEach"&&Array.isArray(h)),a=Math.max(0,...o.map(([,l])=>l.length)),c=[];for(let l=0;l<a;l++){const h={...e,ease:r,duration:s/a};for(const[f,u]of o)l<u.length&&(h[f]=u[l]);c.push(h)}return c}function Dn(i,t,e,n={}){const s=t.collector?.scope??t.root,r=typeof n.scroller=="string"?s.querySelector(n.scroller):n.scroller??null,o={x:r?r.scrollLeft:window.scrollX,y:r?r.scrollTop:window.scrollY},a={x:r?r.scrollWidth-r.clientWidth:document.documentElement.scrollWidth-window.innerWidth,y:r?r.scrollHeight-r.clientHeight:document.documentElement.scrollHeight-window.innerHeight},c=(v,w)=>{if(w===void 0)return o[v];if(typeof w=="number")return w;if(w==="max")return a[v];const k=typeof w=="string"?s.querySelector(w):w;if(!k)return o[v];const T=k.getBoundingClientRect(),S=r?.getBoundingClientRect(),M=(v==="x"?n.offsetX:n.offsetY)??n.offset??0;return v==="x"?T.left-(S?.left??0)+o.x-M:T.top-(S?.top??0)+o.y-M},l=typeof e=="object"&&e!==null&&!("nodeType"in e)?{x:c("x",e.x),y:c("y",e.y)}:{x:o.x,y:c("y",e)},h={x:Math.max(0,Math.min(a.x,l.x)),y:Math.max(0,Math.min(a.y,l.y))},f={...o},u=()=>{r?(r.scrollLeft=f.x,r.scrollTop=f.y):window.scrollTo({left:f.x,top:f.y,behavior:"instant"})},d=["wheel","touchstart","keydown"],g=r??window,p=()=>{b.kill(),y()},y=()=>{for(const v of d)g.removeEventListener(v,p)},b=i.to(f,{x:h.x,y:h.y,duration:n.duration??1,ease:n.ease??"power2.inOut",onStart:n.onStart,onUpdate:()=>{u(),n.onUpdate?.()},onComplete:()=>{y(),n.onComplete?.()}});if(n.autoKill!==!1)for(const v of d)g.addEventListener(v,p,{passive:!0});return b}function ho(i,t,e){const n=i.collector?.scope??i.root,s=typeof t=="string"?[...n.querySelectorAll(t)]:"nodeType"in t?[t]:Array.from(t),{interval:r=.1,batchMax:o,onEnter:a,onLeave:c,onEnterBack:l,onLeaveBack:h,...f}=e,u={onEnter:a,onLeave:c,onEnterBack:l,onLeaveBack:h},d={onEnter:[],onLeave:[],onEnterBack:[],onLeaveBack:[]},g={},p=b=>{g[b]!==void 0&&clearTimeout(g[b]),g[b]=void 0;const v=d[b].splice(0);v.length>0&&u[b]?.(v)},y=(b,v)=>{if(u[b]){if(d[b].push(v),o!==void 0&&d[b].length>=o)return p(b);g[b]===void 0&&(g[b]=setTimeout(()=>p(b),r*1e3))}};return s.map(b=>Xe(i,{...f,trigger:b,onEnter:()=>y("onEnter",b),onLeave:()=>y("onLeave",b),onEnterBack:()=>y("onEnterBack",b),onLeaveBack:()=>y("onLeaveBack",b)})).filter(b=>b!==void 0)}class V{compat;stage;options;autoplayPending;started=!1;killed=!1;recipe=[];firstElement;scrollDriver;events=[];ranges=[];playhead={time:0,iteration:0,direction:"forward",fresh:!0};waitingToWrap=!1;finishedThisFrame=!1;backwards=!1;constructor(t,e={}){if(this.stage=t,this.options=e,this.compat=new Z({...e,startValue:(n,s)=>{const r=t.objectFor(n);if(r)return po(r[s]);const o=t.appliedValue(n,s);if(o!==void 0)return o;if(s==="d")return an(t.elementFor(n))??void 0;if(s==="text")return t.elementFor(n)?.textContent??void 0;if(s==="strokeDasharray"||s==="strokeDashoffset"){const a=Xn(t.elementFor(n));if(a!==void 0)return s==="strokeDasharray"?[a,a]:0}},startVelocity:(n,s)=>t.velocityOf(n,s),layoutColumns:n=>qn(n.map(s=>t.elementFor(s))),random:()=>t.utils.random(0,1)}),this.compat.timeline.onComplete=()=>{this.finishedThisFrame=!0},t.collector?.track(this),t.liveTimelines.add(this),this.autoplayPending=!e.paused&&!e.scrollTrigger,e.scrollTrigger){const n=e.scrollTrigger;queueMicrotask(()=>{this.killed||(this.scrollDriver=Xe(t,n,this,this.firstElement,s=>e.onWarning?.(s)))})}this.autoplayPending&&queueMicrotask(()=>{this.autoplayPending&&this.play()})}get timeline(){return this.compat.timeline}get scrollTrigger(){return this.scrollDriver}to(t,e,n){return co(e)?this.record(()=>this.keyframed(t,e,n)):this.record(()=>this.tween(t,[e],n,([s],r,o)=>this.compat.to(r,s,o)))}from(t,e,n){return this.record(()=>this.tween(t,[e],n,([s],r,o)=>this.compat.from(r,s,o)))}fromTo(t,e,n,s){return this.record(()=>this.tween(t,[e,n],s,([r,o],a,c)=>this.compat.fromTo(a,r,o,c)))}set(t,e,n){return this.record(()=>this.tween(t,[e],n,([s],r,o)=>this.compat.set(r,s,o)))}addLabel(t,e){return this.record(()=>this.compat.addLabel(t,e))}add(t,e){return this.record(()=>{t.autoplayPending=!1,t.timeline.stop(),t.stage.deactivate(t.timeline),this.compat.add(t.compat,e)})}invalidate(){const t=this.compat.progress();this.compat.progress(0),this.stage.render(this.timeline),this.compat.reset(),this.events=[],this.ranges=[];for(const e of this.recipe)e();return this.syncDuration(),this.compat.progress(t),this.stage.render(this.timeline),this}call(t,e=[],n){return this.record(()=>{const s=this.compat.addEvent(n);this.events.push({time:s,run:()=>t(...e)})})}addPause(t,e,n=[]){return this.record(()=>{const s=this.compat.addEvent(t);this.events.push({time:s,pause:!0,run:()=>e?.(...n)})})}tweenTo(t,e={}){return this.tweenFromTo(this.timeline.currentTime/1e3,t,e)}tweenFromTo(t,e,n={}){this.pause(),this.seek(t);const s=this.timeline.currentTime,r=Math.max(0,Math.min(this.timeline.duration,this.compat.timeOf(e))),o={time:s},a=n.duration??Math.abs(r-s)/1e3/(this.timeScale()||1),c=new V(this.stage,{onStart:n.onStart,onComplete:n.onComplete});return c.to(o,{time:r,duration:a,ease:n.ease??"none",onUpdate:()=>{this.moveTo(o.time),n.onUpdate?.()}}),c}play(){this.autoplayPending=!1,this.started||(this.started=!0,this.options.onStart?.());const t=this.timeline.playbackState==="playing",e=this.timeline.playbackState==="paused";if(this.timeline.play(),!t){const n=this.timeline,s=n.direction==="forward"?n.currentTime===0:n.currentTime===n.duration;this.playhead={...this.readPlayhead(),fresh:s&&!e},this.waitingToWrap=!1}return this.stage.liveTimelines.add(this),this.stage.render(this.timeline),this.stage.activate(this.timeline,{onUpdate:()=>this.afterFrame()}),this}pause(){return this.autoplayPending=!1,this.timeline.pause(),this.stage.deactivate(this.timeline),this}resume(){return this.play()}restart(){return this.timeline.stop(),this.backwards=!1,this.play()}reverse(){this.backwards=!this.backwards;const t=this.timeline.playbackState==="idle"&&this.timeline.direction==="forward";return this.timeline.reverse(),t&&this.timeline.currentTime===0&&this.timeline.seek(this.timeline.duration),this.play()}labelProgresses(){const t=this.timeline.duration;return t>0?this.compat.labelTimes().map(e=>e/t):[]}reversed(){return this.timeline.direction==="reverse"}seek(t){return this.autoplayPending=!1,this.compat.seek(t),this.stage.render(this.timeline),this.playhead=this.readPlayhead(),this.waitingToWrap=!1,this.options.onUpdate?.(),this}progress(t){return t===void 0?this.compat.progress():(this.autoplayPending=!1,this.moveTo(Math.max(0,Math.min(1,t))*this.timeline.duration),this.compat.progress())}timeScale(t){return this.compat.timeScale(t)}duration(){return this.compat.duration()}isActive(){return this.timeline.playbackState==="playing"}kill(){return this.killed=!0,this.stage.liveTimelines.delete(this),this.scrollDriver?.destroy(),this.scrollDriver=void 0,this.autoplayPending=!1,this.timeline.stop(),this.stage.deactivate(this.timeline),this.compat.kill(),this}toDefinition(){return this.compat.toDefinition()}killTweensOf(t,e){for(const n of t)for(const s of e??[void 0])this.timeline.removeTracks({target:n,...s!==void 0&&{property:s}});this.timeline.tracks.length===0&&this.events.length===0&&this.kill()}record(t){return this.recipe.push(t),t(),this.syncDuration(),this}syncDuration(){if(this.events.length===0)return;this.timeline.setDuration(void 0);const t=Math.max(...this.events.map(e=>e.time));t>this.timeline.duration&&this.timeline.setDuration(t)}readPlayhead(){const t=this.timeline;return{time:t.currentTime,iteration:t.loopIteration,direction:t.direction}}moveTo(t){const e=this.playhead;this.timeline.seek(t),this.stage.render(this.timeline);const n={time:this.timeline.currentTime,iteration:this.timeline.loopIteration,direction:t>=e.time?"forward":"reverse"},s={...e,iteration:n.iteration,direction:n.direction};this.playhead={...this.readPlayhead()},this.waitingToWrap=!1,this.runCrossings(s,n,!1),this.options.onUpdate?.()}refreshForRepeat(){const t=this.timeline.currentTime;this.compat.reset(),this.events=[],this.ranges=[];for(const e of this.recipe)e();this.syncDuration(),this.timeline.seek(Math.min(t,this.timeline.duration))}afterFrame(){const t=this.timeline,e=t.repeatDelayRemaining>0;if(this.waitingToWrap&&e){this.options.onUpdate?.();return}this.waitingToWrap=!1;const n=this.playhead,s=this.readPlayhead();this.playhead=s;const r=this.options.yoyo===!0;e&&!r&&s.iteration>n.iteration&&(this.playhead={time:0,iteration:s.iteration,direction:"forward",fresh:!0},this.waitingToWrap=!0);const o=this.runCrossings(n,s,e);if(this.options.onUpdate?.(),this.finishedThisFrame&&!o){this.finishedThisFrame=!1;const a=t.currentTime===0&&t.direction==="reverse";!this.scrollDriver&&!r&&this.stage.liveTimelines.delete(this),a&&this.backwards?this.options.onReverseComplete?.():this.options.onComplete?.()}this.finishedThisFrame=!1}runCrossings(t,e,n){if(this.events.length===0&&this.ranges.length===0&&!this.options.onRepeat&&!this.options.repeatRefresh)return!1;const s=this.events,{crossings:r,passes:o}=ye(s.map(a=>a.time),t,e,{duration:this.timeline.duration,alternate:this.options.yoyo===!0,holding:n});for(const a of r){if(this.killed)return!0;if(a.kind==="repeat"){this.options.repeatRefresh&&this.refreshForRepeat(),this.options.onRepeat?.();continue}const c=s[a.index];if(!(c.direction&&c.direction!==a.direction)){if(c.pause)return this.timeline.seek(c.time),this.stage.render(this.timeline),this.pause(),this.playhead=this.readPlayhead(),this.waitingToWrap=!1,c.run(),!0;c.run()}}for(const a of this.ranges)o.some(([l,h])=>l!==h&&Math.max(l,h)>=a.start&&Math.min(l,h)<=a.end)&&a.run();return!1}tween(t,e,n,s){const r=this.resolve(t);if(!r)return;const{onStart:o,onUpdate:a,onComplete:c}=e[e.length-1];if(o||a||c){let l=1/0,h=-1/0;const f=(u,d,g)=>{s(u,d,g),l=Math.min(l,this.compat.lastStart),h=Math.max(h,this.compat.lastEnd)};if(this.buildTween(r,e,n,f),l===1/0)return;o&&this.events.push({time:l,direction:"forward",run:o}),a&&this.ranges.push({start:l,end:h,run:a}),c&&this.events.push({time:h,direction:"forward",run:c});return}this.buildTween(r,e,n,s)}keyframed(t,e,n){const s=this.resolve(t);if(!s)return;const r=lo(e);if(r.length===0)return;const o=s.length>1?Me(e.stagger,this.staggerContext(s)):void 0,a=s.map(y=>this.targetFor(y)).filter(y=>y!==void 0),c=o?a.map(y=>[y]):[a],l=o?It(s.length,o).map(y=>y/1e3):[0],h=this.compat.timeOf(n)/1e3+Wt(e.delay,0)/1e3;let f=1/0,u=-1/0;if(c.forEach((y,b)=>{r.forEach((v,w)=>{const k=w===0?h+l[b]:">";this.tween(y,[v],k,([T],S,M)=>this.compat.to(S,T,M)),f=Math.min(f,this.compat.lastStart),u=Math.max(u,this.compat.lastEnd)})}),f===1/0)return;const{onStart:d,onUpdate:g,onComplete:p}=e;d&&this.events.push({time:f,direction:"forward",run:d}),g&&this.ranges.push({start:f,end:u,run:g}),p&&this.events.push({time:u,direction:"forward",run:p})}staggerContext(t){return{count:t.length,columnsFromLayout:()=>qn(t.map(e=>this.stage.elementFor(e))),random:()=>this.stage.utils.random(0,1)}}buildTween(t,e,n,s){const r=t.map(u=>this.targetFor(u));if(!(t.length>1&&(e.some(fo)||t.some(u=>this.stage.objectFor(u)!==void 0)))){const u=this.targetFor(t[0]);s(e.map(d=>this.prepare(Nn(d,0,u,this.stage.utils,r),t)),t,n);return}const a=e.length-1,{stagger:c,...l}=e[a],h=Me(c,this.staggerContext(t)),f=h?It(t.length,h).map(u=>u/1e3):t.map(()=>0);t.forEach((u,d)=>{const g=d===0?Wt(l.delay,0)/1e3+f[0]:0,p=d===0?0:f[d]-f[d-1],y=d===0?n:`<${p<0?"-":"+"}${Math.abs(p).toFixed(6)}`,v=e.map((w,k)=>k===a?{...l,delay:g}:w).map(w=>this.prepare(Nn(w,d,this.targetFor(u),this.stage.utils,r),[u]));s(v,[u],y)})}targetFor(t){return this.stage.elementFor(t)??this.stage.objectFor(t)}prepare(t,e){const n=o=>this.options.onWarning?.(o),s=o=>this.stage.query(o);let r=t;if(t.motionPath!==void 0){const o=Mr(t.motionPath,{query:s,targets:e.map(a=>this.stage.elementFor(a)).filter(a=>!!a),warn:n});r={...r,motionPath:o}}if(t.morphSVG!==void 0){const o=Ar(t.morphSVG,s,n),{morphSVG:a,...c}=r;r=o?{...r,morphSVG:o}:c}if(t.drawSVG!==void 0){const o=Xn(this.stage.elementFor(e[0]));if(o===void 0){n("gsap-compat: drawSVG needs an SVG shape with a stroke (path, line, circle…)");const{drawSVG:a,...c}=r;r=c}else r=er(r,o)}return r}resolve(t){const e=this.stage.resolveTargets(t);if(e.length===0){this.options.onWarning?.(`gsap-compat: no elements found for target ${mo(t)}`);return}return this.firstElement??=e.map(n=>this.stage.elementFor(n)).find(n=>n!==void 0),e}}function On(i=new nn){const t=r=>{const{config:o}=Ut(r);return new V(i,{repeat:o.repeat,yoyo:o.yoyo,repeatDelay:o.repeatDelay,paused:o.paused,onStart:o.onStart,onUpdate:o.onUpdate,onComplete:o.onComplete,onRepeat:o.onRepeat,onReverseComplete:o.onReverseComplete,repeatRefresh:o.repeatRefresh,scrollTrigger:o.scrollTrigger})},e=r=>{const{onStart:o,onUpdate:a,onComplete:c,onRepeat:l,onReverseComplete:h,repeatRefresh:f,...u}=r;return u},n=r=>(r&&i.collector?.track(r),r),s={stage:i,ticker:i.ticker,utils:i.utils,getProperty:(r,o)=>{const[a]=i.resolveTargets(r);if(a===void 0)return;const c=i.objectFor(a);return c?c[o]:i.appliedValue(a,o)??Qi(o)},scrollTrigger:r=>n(Xe(i,r)),scrollBatch:(r,o)=>ho(i,r,o).map(a=>n(a)),scrollTo:(r,o)=>Dn(s,i,r,o),refreshScroll:()=>{Pt.refreshAll(),Ne.refreshAll()},smoothScroll:(r={})=>{const o=typeof r.scroller=="string"?(i.collector?.scope??i.root).querySelector(r.scroller):r.scroller;return n(new Ne({...r,scroller:o}).start())},context:(r,o)=>{const a=new Cn(i,o);return r&&a.add(()=>r(a)),a},matchMedia:r=>new to(i,r),customEase:In.create,customBounce:Fn.create,customWiggle:$n.create,pageTransition:r=>so(s,i,o=>new V(i,o),r),imageSequence:(r,o)=>{const a=typeof r=="string"?(i.collector?.scope??i.root).querySelector(r):r;if(!(a instanceof HTMLCanvasElement))throw new Error(`gsap-compat: imageSequence needs a <canvas>, got ${String(r)}`);return n(new eo(a,o))},quickTo:(r,o,a={})=>{const c=new V(i,{paused:!0}),[l]=i.resolveTargets(r);return Object.assign(f=>{if(!l)return;const u=a.spring!==void 0?i.velocityOf(l,o)??0:0;c.compat.reset(),c.compat.to(l,{[o]:f,duration:a.duration??.4,ease:a.ease??"power3.out",...a.spring!==void 0&&{spring:uo(a.spring,o,u)}}),c.timeline.stop(),c.timeline.play(),i.activate(c.timeline)},{tween:c,kill:()=>c.kill()})},timeline:r=>new V(i,r),to:(r,o)=>{if(o.scrollTo!==void 0){const{scrollTo:a,...c}=o,l=typeof a=="object"&&a!==null&&!("nodeType"in a)?a:{},h=typeof r!="string"&&r!==window&&r.nodeType===1;return Dn(s,i,a,{...c,offsetX:l.offsetX,offsetY:l.offsetY,scroller:h?r:void 0})}return t(o).to(r,e(o))},from:(r,o)=>t(o).from(r,e(o)),fromTo:(r,o,a)=>t(a).fromTo(r,o,e(a)),set:(r,o)=>t(o).set(r,e(o)),delayedCall:(r,o,a)=>new V(i).call(o,a,r),killTweensOf:(r,o)=>{const a=i.resolveTargets(r),c=typeof o=="string"?o.split(",").map(l=>l.trim()).filter(Boolean):o;for(const l of[...i.liveTimelines])l.killTweensOf(a,c)},convertToPath:r=>xr(r,i.root),splitText:(r,o)=>{const a=i.collector?.scope??i.root,c=typeof r=="string"?Array.from(a.querySelectorAll(r)):"nodeType"in r?[r]:Array.from(r);return n(Lr(c,o))},draggable:(r,o)=>n(Rr(s,i,r,o)),getFlipState:r=>Ce(i,r),flipFrom:(r,o)=>Ie(i,a=>new V(i,a),r,o),flip:(r,o,a)=>{const c=Ce(i,r);return o(),Ie(i,l=>new V(i,l),c,{targets:r,...a})}};return s}const $=On();function uo(i,t,e){return i===!0?{velocity:{[t]:e}}:typeof i=="string"?{preset:i,velocity:{[t]:e}}:{...i,velocity:{[t]:e}}}function fo(i){return i.morphSVG!==void 0||i.drawSVG!==void 0||i.text!==void 0||i.scrambleText!==void 0||Bn(i)}function Bn(i){return Object.entries(i).some(([t,e])=>(typeof e=="function"||Gi(e))&&!ke.has(t))}function Nn(i,t,e,n,s){if(!Bn(i))return i;const r={};for(const[o,a]of Object.entries(i))ke.has(o)?r[o]=a:typeof a=="function"?r[o]=a(t,e,s):Gi(a)?r[o]=n.resolveRandomString(a):r[o]=a;return r}function qn(i){const t=i.map(n=>n?.getBoundingClientRect().top);if(t[0]===void 0)return i.length;let e=0;for(const n of t){if(n===void 0||Math.abs(n-t[0])>1)break;e++}return Math.max(1,e)}function Xn(i){const t=i;if(typeof t?.getTotalLength=="function")return t.getTotalLength()}function po(i){if(typeof i=="number"||typeof i=="string"||Array.isArray(i)&&i.every(t=>typeof t=="number"))return i}function mo(i){return typeof i=="string"?`"${i}"`:String(i)}class Ye{media;offset;driftTolerance;constructor(t,e={}){this.media=t,this.offset=e.offset??0,this.driftTolerance=Math.max(0,e.driftTolerance??.15)}targetTime(t){return Math.max(0,t/1e3+this.offset)}update(t,e){const n=this.targetTime(t);e?(this.media.paused&&this.safePlay(),Math.abs(this.media.currentTime-n)>this.driftTolerance&&(this.media.currentTime=n)):(this.media.paused||this.media.pause(),this.media.currentTime!==n&&(this.media.currentTime=n))}seek(t){this.media.currentTime=this.targetTime(t)}setRate(t){this.media.playbackRate=t}dispose(){this.media.paused||this.media.pause()}safePlay(){const t=this.media.play();t&&typeof t.catch=="function"&&t.catch(()=>{})}}function Yn(i,t,e,n,s){const r=e-s;if(r<0){t.paused||t.pause(),t.currentTime=0;return}i.update(r,n)}class Ve{container;timeline=null;adapter;animationFrameId;lastTime;options;targets={};isDestroyed=!1;mediaSync;mediaTargets=[];symbolInstances=[];markerList=[];listeners=new Set;playhead={time:0,iteration:0,direction:"forward"};stepping=!1;lastMarkerId=null;reducedQuery;onReducedChange=()=>this.applyReducedMotion();visibilityObserver;onScreen=!0;pausedByVisibility=!1;autoplayWhenSeen=!1;onDocumentVisibility=()=>this.updateVisibility();constructor(t,e={}){if(typeof t=="string"){const n=document.querySelector(t);if(!n)throw new Error(`Container not found: ${t}`);this.container=n}else this.container=t;this.options=e,this.adapter=new J}async load(t){let e;if(typeof t=="string"){const n=await fetch(t);if(!n.ok)throw new Error(`Failed to load animation: ${n.statusText}`);e=await n.json()}else e=t;this.options.speed!==void 0&&(e.config={...e.config,speed:this.options.speed}),this.options.loop!==void 0&&(e.config={...e.config,loop:this.options.loop}),this.options.alternate!==void 0&&(e.config={...e.config,alternate:this.options.alternate}),this.timeline=at(e),this.markerList=this.timeline.markers,this.lastMarkerId=null,this.options.onComplete&&(this.timeline.onComplete=this.options.onComplete),this.options.onUpdate&&(this.timeline.onUpdate=this.options.onUpdate),this.autoRegisterTargets(),this.setupSymbolInstances(),this.scanMedia(),this.showInitialFrame(),this.watchReducedMotion(),this.watchVisibility(),this.options.autoplay&&!this.reducedMotion&&(this.options.playWhenVisible&&!this.onScreen?this.autoplayWhenSeen=!0:this.play())}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){for(const t of this.listeners)t()}get reducedMotion(){return this.reducedQuery?.matches===!0}get markers(){return this.markerList}get currentMarker(){const t=this.currentTime;let e;for(const n of this.markers)if(n.time<=t+.5)e=n;else break;return e}caption(t,e){const n=t?this.markers.find(o=>o.id===t):this.currentMarker;if(!n)return;const s=e??this.language(),r=o=>o?.[s]?.[n.id]??o?.[s.split("-")[0]]?.[n.id];return r(this.options.captions)??r(this.timeline?.captions)??n.label}next(){if(!this.timeline)return;const t=this.currentTime,e=this.markers.find(n=>n.time>t+.5);if(this.reducedMotion){this.seek(e?e.time:this.duration);return}t>=this.duration-.5||(this.stepping=e!==void 0,this.startPlaying())}prev(){if(!this.timeline)return;const t=this.currentTime,e=[...this.markers].reverse().find(n=>n.time<t-.5);this.pause(),this.seek(e?e.time:0)}goToMarker(t){const e=this.markers.find(n=>n.id===t);e&&(this.pause(),this.seek(e.time))}language(){return this.container.closest("[lang]")?.getAttribute("lang")||(typeof document<"u"?document.documentElement.lang:"")||"en"}showInitialFrame(){if(!this.timeline)return;const t=this.options.initialFrame??"start";if(t==="none")return;const e=t==="end"?this.timeline.duration:t==="start"?0:t;this.timeline.seek(Math.max(0,Math.min(this.timeline.duration,e))),this.applyState()}watchReducedMotion(){this.options.respectReducedMotion===!1||typeof window>"u"||typeof window.matchMedia!="function"||(this.reducedQuery??=window.matchMedia("(prefers-reduced-motion: reduce)"),this.reducedQuery.addEventListener?.("change",this.onReducedChange),this.reducedQuery.matches&&this.applyReducedMotion())}applyReducedMotion(){!this.reducedMotion||!this.timeline||(this.autoplayWhenSeen=!1,this.pause(),this.seek(this.timeline.duration))}watchVisibility(){if(!(!this.options.playWhenVisible||typeof window>"u")){if(typeof IntersectionObserver=="function"){this.visibilityObserver?.disconnect(),this.listeners.clear(),this.visibilityObserver=new IntersectionObserver(e=>{for(const n of e)this.onScreen=n.isIntersecting;this.updateVisibility()}),this.visibilityObserver.observe(this.container);const t=this.container.getBoundingClientRect?.();t&&(t.width>0||t.height>0)&&(this.onScreen=t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth)}document.addEventListener("visibilitychange",this.onDocumentVisibility)}}updateVisibility(){const t=this.onScreen&&document.visibilityState!=="hidden";!t&&this.isPlaying?(this.pausedByVisibility=!0,this.pause()):t&&(this.pausedByVisibility||this.autoplayWhenSeen)&&!this.reducedMotion&&(this.pausedByVisibility=!1,this.autoplayWhenSeen=!1,this.startPlaying())}announceMarker(){if(!this.options.onMarker)return;const t=this.currentMarker,e=t?.id;e!==this.lastMarkerId&&(this.lastMarkerId=e,this.options.onMarker(t))}scanMedia(){this.mediaTargets=[],this.container.querySelectorAll("[data-tinyfly-media]").forEach(e=>{const n=e,s=Number(n.getAttribute("data-tinyfly-start")??"0")||0,r=n.getAttribute("data-volume");r!==null&&(n.volume=Math.max(0,Math.min(1,Number(r)||0))),this.mediaTargets.push({el:n,startTime:s,sync:new Ye(n)})})}syncAllMedia(t,e){for(const n of this.mediaTargets)Yn(n.sync,n.el,t,e,n.startTime)}loadFromString(t){const e=JSON.parse(t);this.load(e)}registerTarget(t,e){if(typeof e=="string"){const n=this.container.querySelector(e);n&&(this.targets[t]=n,this.adapter.registerTarget(t,n))}else this.targets[t]=e,this.adapter.registerTarget(t,e)}autoRegisterTargets(){this.container.querySelectorAll("[data-tinyfly]").forEach(e=>{const n=e.closest("[data-tinyfly-symbol]");if(n&&n!==e)return;const s=e.getAttribute("data-tinyfly");s&&this.registerTarget(s,e)}),this.timeline&&new Set(this.timeline.tracks.map(n=>n.target)).forEach(n=>{if(!this.targets[n]){const s=this.container.querySelector(`[data-tinyfly="${n}"]`)||this.container.querySelector(`.${n}`)||this.container.querySelector(`#${n}`);s&&this.registerTarget(n,s)}})}setupSymbolInstances(){this.symbolInstances=[];const t=this.options.symbols;if(!t||t.length===0)return;const e=new Map(t.map(n=>[n.id,n]));this.container.querySelectorAll("[data-tinyfly-symbol]").forEach(n=>{const s=n.getAttribute("data-tinyfly-symbol");if(!s)return;const r=e.get(s);if(!r||!r.timeline.tracks?.length)return;const o=new J;n.querySelectorAll("[data-tinyfly]").forEach(a=>{const c=a.getAttribute("data-tinyfly");c&&o.registerTarget(c,a)}),this.symbolInstances.push({adapter:o,timeline:at(r.timeline)})})}attachMedia(t,e){this.mediaSync=new Ye(t,e),this.timeline&&(this.mediaSync.setRate(this.timeline.speed),this.mediaSync.update(this.timeline.currentTime,this.isPlaying))}detachMedia(){this.mediaSync?.dispose(),this.mediaSync=void 0}play(){!this.timeline||this.isDestroyed||(this.autoplayWhenSeen=!1,this.stepping=this.options.stepMode===!0,this.startPlaying())}startPlaying(){if(!this.timeline||this.isDestroyed)return;const t=this.timeline.playbackState==="idle";this.timeline.play(),t&&this.timeline.currentTime===0&&this.applyState(),this.playhead={time:this.timeline.currentTime,iteration:this.timeline.loopIteration,direction:this.timeline.direction},this.mediaSync?.update(this.timeline.currentTime,!0),this.syncAllMedia(this.timeline.currentTime,!0),this.startAnimationLoop(),this.notify()}pause(){this.timeline&&(this.stepping=!1,this.timeline.pause(),this.notify(),this.mediaSync?.update(this.timeline.currentTime,!1),this.syncAllMedia(this.timeline.currentTime,!1),this.stopAnimationLoop())}stop(){this.timeline&&(this.timeline.stop(),this.stopAnimationLoop(),this.applyState(),this.mediaSync?.update(this.timeline.currentTime,!1),this.syncAllMedia(this.timeline.currentTime,!1))}seek(t){this.timeline&&(this.timeline.seek(t),this.applyState(),this.playhead={time:this.timeline.currentTime,iteration:this.timeline.loopIteration,direction:this.timeline.direction},this.mediaSync?.seek(this.timeline.currentTime),this.syncAllMedia(this.timeline.currentTime,this.isPlaying))}setSpeed(t){this.timeline&&(this.timeline.speed=t,this.mediaSync?.setRate(t))}reverse(){this.timeline&&this.timeline.reverse()}get currentTime(){return this.timeline?.currentTime??0}get duration(){return this.timeline?.duration??0}get isPlaying(){return this.timeline?.playbackState==="playing"}destroy(){this.isDestroyed=!0,this.stopAnimationLoop(),this.reducedQuery?.removeEventListener?.("change",this.onReducedChange),this.visibilityObserver?.disconnect(),typeof document<"u"&&document.removeEventListener("visibilitychange",this.onDocumentVisibility),this.mediaSync?.dispose(),this.mediaSync=void 0;for(const t of this.mediaTargets)t.el.paused||t.el.pause();this.mediaTargets=[],this.adapter.clearTargets();for(const t of this.symbolInstances)t.adapter.clearTargets();this.symbolInstances=[],this.timeline=null}startAnimationLoop(){if(this.animationFrameId!==void 0)return;this.lastTime=performance.now();const t=e=>{if(this.isDestroyed||!this.timeline)return;const n=e-(this.lastTime??e);this.lastTime=e;const s=this.playhead;this.timeline.tick(n),this.stopAtMarker(s),this.applyState();const r=this.timeline.playbackState==="playing";this.mediaSync?.update(this.timeline.currentTime,r),this.syncAllMedia(this.timeline.currentTime,r),this.timeline.playbackState==="playing"?this.animationFrameId=requestAnimationFrame(t):(this.animationFrameId=void 0,this.notify())};this.animationFrameId=requestAnimationFrame(t)}stopAtMarker(t){const e=this.timeline,n={time:e.currentTime,iteration:e.loopIteration,direction:e.direction};this.playhead=n;const s=this.markers;if(s.length===0)return;const{crossings:r}=ye(s.map(o=>o.time),t,n,{duration:e.duration,alternate:e.config.alternate===!0,holding:e.repeatDelayRemaining>0});for(const o of r){if(o.kind!=="event")continue;const a=s[o.index];if(this.stepping||a.pause){this.stepping=!1,e.pause(),e.seek(a.time),this.playhead={time:a.time,iteration:e.loopIteration,direction:e.direction};return}}}stopAnimationLoop(){this.animationFrameId!==void 0&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}applyState(){if(!this.timeline)return;const t=this.timeline.currentTime;this.adapter.applyState(this.timeline.getStateAtTime(t)),this.announceMarker(),this.notify();for(const e of this.symbolInstances){const n=e.timeline.duration;e.adapter.applyState(e.timeline.getStateAtTime(n>0?t%n:t))}}}async function go(i,t,e={}){const n=new Ve(i,{...e,autoplay:!0});return await n.load(t),n}function yo(i,t={}){return new Ve(i,t)}class Vn{container;containerA;containerB;adapterA;adapterB;timelineA=null;timelineB=null;symbolDefs=new Map;nestedByAdapter=new Map;sequence=null;options;_currentSceneIndex=0;_state="idle";_isPlaying=!1;_isDestroyed=!1;loopIteration=0;animationFrameId;lastTime;transitionTimer;constructor(t,e={}){if(typeof t=="string"){const n=document.querySelector(t);if(!n)throw new Error(`Container not found: ${t}`);this.container=n}else this.container=t;this.options=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.containerA=this.createSceneContainer(),this.containerB=this.createSceneContainer(),this.container.appendChild(this.containerA),this.container.appendChild(this.containerB),this.containerB.style.visibility="hidden",this.adapterA=new J,this.adapterB=new J}async load(t){let e;if(typeof t=="string"){const n=await fetch(t);if(!n.ok)throw new Error(`Failed to load sequence: ${n.statusText}`);e=await n.json()}else e=t;this.sequence=e,this.symbolDefs.clear();for(const n of e.symbols??[])n.timeline?.tracks?.length&&this.symbolDefs.set(n.id,n.timeline);this.container.style.width=`${e.canvas.width}px`,this.container.style.height=`${e.canvas.height}px`,e.scenes.length>0&&(this.renderScene(e.scenes[0],this.containerA,this.adapterA),this.timelineA=this.createTimeline(e.scenes[0])),this.options.autoplay&&this.play()}play(){if(!(!this.sequence||this._isDestroyed)&&this.sequence.scenes.length!==0){if(this._isPlaying=!0,this._state==="idle"){if(this._state="playing-scene",this._currentSceneIndex=0,this.timelineA)this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.play();else{this.onSceneComplete();return}this.options.onSceneChange?.(0)}else this._state==="playing-scene"&&this.timelineA&&this.timelineA.play();this.startAnimationLoop()}}pause(){this._isPlaying&&(this._isPlaying=!1,this.timelineA&&this.timelineA.pause(),this.timelineB&&this.timelineB.pause(),this.stopAnimationLoop())}stop(){if(this._isPlaying=!1,this._state="idle",this._currentSceneIndex=0,this.loopIteration=0,this.transitionTimer!==void 0&&(clearTimeout(this.transitionTimer),this.transitionTimer=void 0),this.timelineA&&this.timelineA.stop(),this.timelineB&&this.timelineB.stop(),this.stopAnimationLoop(),this.sequence&&this.sequence.scenes.length>0&&(this.clearContainer(this.containerA),this.clearContainer(this.containerB),this.adapterA.clearTargets(),this.adapterB.clearTargets(),this.containerB.style.visibility="hidden",this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB),this.renderScene(this.sequence.scenes[0],this.containerA,this.adapterA),this.timelineA=this.createTimeline(this.sequence.scenes[0]),this.timelineA)){const t=this.timelineA.getStateAtTime(0);this.adapterA.applyState(t),this.applyNested(this.adapterA,0)}}goToScene(t){if(!this.sequence||t<0||t>=this.sequence.scenes.length)return;const e=this._isPlaying;this.transitionTimer!==void 0&&(clearTimeout(this.transitionTimer),this.transitionTimer=void 0),this.stopAnimationLoop(),this.timelineA&&this.timelineA.stop(),this.timelineB&&this.timelineB.stop(),this._currentSceneIndex=t,this._state=e?"playing-scene":"idle",this.clearContainer(this.containerA),this.clearContainer(this.containerB),this.adapterA.clearTargets(),this.adapterB.clearTargets(),this.containerB.style.visibility="hidden",this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB);const n=this.sequence.scenes[t];if(this.renderScene(n,this.containerA,this.adapterA),this.timelineA=this.createTimeline(n),this.options.onSceneChange?.(t),e)this.timelineA?(this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.play(),this.startAnimationLoop()):this.onSceneComplete();else if(this.timelineA){const s=this.timelineA.getStateAtTime(0);this.adapterA.applyState(s),this.applyNested(this.adapterA,0)}}destroy(){this._isDestroyed=!0,this._isPlaying=!1,this.transitionTimer!==void 0&&(clearTimeout(this.transitionTimer),this.transitionTimer=void 0),this.stopAnimationLoop(),this.adapterA.clearTargets(),this.adapterB.clearTargets();for(const t of this.nestedByAdapter.values())for(const e of t)e.adapter.clearTargets();this.nestedByAdapter.clear(),this.timelineA&&this.timelineA.stop(),this.timelineB&&this.timelineB.stop(),this.timelineA=null,this.timelineB=null,this.containerA.parentNode&&this.containerA.remove(),this.containerB.parentNode&&this.containerB.remove(),this.sequence=null}get currentSceneIndex(){return this._currentSceneIndex}get sceneCount(){return this.sequence?.scenes.length??0}get isPlaying(){return this._isPlaying}get state(){return this._state}createSceneContainer(){const t=document.createElement("div");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t}renderScene(t,e,n){e.innerHTML="",n.clearTargets();const s=document.createElement("div");s.style.cssText="position:absolute;inset:0;transform-origin:center center",s.setAttribute("data-tinyfly","Camera"),e.appendChild(s),n.registerTarget("Camera",s);for(const r of t.elements){if(!r.html)continue;const o=document.createElement("div");o.innerHTML=r.html.trim();const a=o.firstElementChild;if(a){s.appendChild(a);const c=a.getAttribute("data-tinyfly");c&&n.registerTarget(c,a)}}this.setupNested(s,n)}setupNested(t,e){const n=[];t.querySelectorAll("[data-tinyfly-symbol]").forEach(s=>{const r=s.getAttribute("data-tinyfly-symbol");if(!r)return;const o=this.symbolDefs.get(r);if(!o)return;const a=new J;s.querySelectorAll("[data-tinyfly]").forEach(c=>{const l=c.getAttribute("data-tinyfly");l&&a.registerTarget(l,c)}),n.push({adapter:a,timeline:at(o)})}),n.length?this.nestedByAdapter.set(e,n):this.nestedByAdapter.delete(e)}applyNested(t,e){const n=this.nestedByAdapter.get(t);if(n)for(const s of n){const r=s.timeline.duration;s.adapter.applyState(s.timeline.getStateAtTime(r>0?e%r:e))}}clearContainer(t){t.innerHTML=""}createTimeline(t){return t.timeline?at(t.timeline):null}onSceneComplete(){if(this._isDestroyed||!this.sequence)return;const t=this._currentSceneIndex+1;if(t>=this.sequence.scenes.length){const e=this.options.loop??this.sequence.loop??0;e===-1||e>0&&this.loopIteration<e-1?(this.loopIteration++,this.beginTransitionTo(0)):(this._isPlaying=!1,this._state="idle",this.stopAnimationLoop(),this.options.onComplete?.())}else this.beginTransitionTo(t)}beginTransitionTo(t){if(!this.sequence||this._isDestroyed)return;const e=this.sequence.scenes[t],n=e.transition;if(n.type==="none"||n.duration<=0){this.switchToScene(t);return}this._state="transitioning",this.containerB.style.visibility="visible",this.renderScene(e,this.containerB,this.adapterB),this.timelineB=this.createTimeline(e),this.timelineB&&this.timelineB.play(),this.applyTransition(n.type,n.duration),this.transitionTimer=window.setTimeout(()=>{this.finishTransition(t)},n.duration)}applyTransition(t,e){const n=`${e}ms`,s="ease-in-out";switch(this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB),t){case"fade":this.containerB.style.opacity="0";break;case"slide-left":this.containerB.style.transform="translateX(100%)";break;case"slide-right":this.containerB.style.transform="translateX(-100%)";break;case"slide-up":this.containerB.style.transform="translateY(100%)";break;case"slide-down":this.containerB.style.transform="translateY(-100%)";break}switch(this.containerB.offsetHeight,this.containerA.style.transition=`opacity ${n} ${s}, transform ${n} ${s}`,this.containerB.style.transition=`opacity ${n} ${s}, transform ${n} ${s}`,t){case"fade":this.containerA.style.opacity="0",this.containerB.style.opacity="1";break;case"slide-left":this.containerA.style.transform="translateX(-100%)",this.containerB.style.transform="translateX(0)";break;case"slide-right":this.containerA.style.transform="translateX(100%)",this.containerB.style.transform="translateX(0)";break;case"slide-up":this.containerA.style.transform="translateY(-100%)",this.containerB.style.transform="translateY(0)";break;case"slide-down":this.containerA.style.transform="translateY(100%)",this.containerB.style.transform="translateY(0)";break}}resetTransitionStyles(t){t.style.transition="",t.style.opacity="1",t.style.transform=""}finishTransition(t){this.transitionTimer=void 0,this.timelineA&&(this.timelineA.stop(),this.timelineA=null),this.adapterA.clearTargets(),this.clearContainer(this.containerA);const e=this.containerA;this.containerA=this.containerB,this.containerB=e;const n=this.adapterA;this.adapterA=this.adapterB,this.adapterB=n,this.timelineA=this.timelineB,this.timelineB=null,this.containerB.style.visibility="hidden",this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB),this._currentSceneIndex=t,this._state="playing-scene",this.options.onSceneChange?.(t),this.timelineA?(this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.playbackState!=="playing"&&this.timelineA.play()):this.onSceneComplete()}switchToScene(t){if(!this.sequence||this._isDestroyed)return;this.timelineA&&this.timelineA.stop(),this.adapterA.clearTargets(),this.clearContainer(this.containerA);const e=this.sequence.scenes[t];this.renderScene(e,this.containerA,this.adapterA),this.timelineA=this.createTimeline(e),this._currentSceneIndex=t,this._state="playing-scene",this.options.onSceneChange?.(t),this.timelineA?(this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.play()):this.onSceneComplete()}startAnimationLoop(){if(this.animationFrameId!==void 0)return;this.lastTime=performance.now();const t=e=>{if(this._isDestroyed||!this._isPlaying)return;const n=e-(this.lastTime??e);if(this.lastTime=e,this.timelineA&&this.timelineA.playbackState==="playing"){this.timelineA.tick(n);const s=this.timelineA.getStateAtTime(this.timelineA.currentTime);this.adapterA.applyState(s),this.applyNested(this.adapterA,this.timelineA.currentTime)}if(this._state==="transitioning"&&this.timelineB&&this.timelineB.playbackState==="playing"){this.timelineB.tick(n);const s=this.timelineB.getStateAtTime(this.timelineB.currentTime);this.adapterB.applyState(s),this.applyNested(this.adapterB,this.timelineB.currentTime)}this._isPlaying?this.animationFrameId=requestAnimationFrame(t):this.animationFrameId=void 0};this.animationFrameId=requestAnimationFrame(t)}stopAnimationLoop(){this.animationFrameId!==void 0&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}}async function bo(i,t,e={}){const n=new Vn(i,{...e,autoplay:!0});return await n.load(t),n}const vo={type:"none",duration:0};function wo(i){const{timeline:t}=i,e=new J;for(const[l,h]of Object.entries(i.targets)){const f=typeof h=="string"?document.querySelector(h):h;if(!f)throw new Error(`quickPlay: no element found for target "${l}" (${String(h)})`);e.registerTarget(l,f)}t.onUpdate=l=>{e.applyState(l),i.onUpdate?.(l)},i.onComplete&&(t.onComplete=i.onComplete);let n=null,s=null,r=!1;const o=l=>{if(r)return;const h=s===null?0:l-s;s=l,h>0&&t.tick(h),n=requestAnimationFrame(o)},a=()=>{n!==null||r||(s=null,n=requestAnimationFrame(o))},c=()=>{n!==null&&cancelAnimationFrame(n),n=null,s=null};return e.applyState(t.getStateAtTime(t.currentTime)),i.autoplay!==!1&&(t.play(),a()),{timeline:t,adapter:e,play(){t.play(),a()},pause(){t.pause(),c()},restart(){t.stop(),t.play(),a()},seek(l){t.seek(l*1e3),e.applyState(t.getStateAtTime(t.currentTime))},destroy(){r=!0,c(),t.stop(),e.clearTargets()}}}const To={timeline:cr,to(i,t,e){const n=new Z(e);return n.to(i,t),n},from(i,t,e){const n=new Z(e);return n.from(i,t),n},fromTo(i,t,e,n){const s=new Z(n);return s.fromTo(i,t,e),s},set(i,t,e){const n=new Z(e);return n.set(i,t),n}},So=$.to,ko=$.from,Mo=$.fromTo,Ao=$.set,Po=$.timeline,xo=$.ticker,_o=$.splitText,Eo=$.context,Co=$.matchMedia,Ro=$.quickTo,Io=$.imageSequence,Fo=$.pageTransition;m.Clock=jn,m.CompatTimeline=Z,m.CustomBounce=Fn,m.CustomEase=In,m.CustomWiggle=$n,m.DEFAULT_BAKE_INTERVAL_MS=he,m.DEFAULT_INERTIA_FRICTION=te,m.DEFAULT_SPRING=D,m.DEFAULT_TRANSITION=vo,m.Draggable=_e,m.FORMAT_VERSION=pt,m.INERTIA_MAX_DURATION_MS=ze,m.InertiaTrackPlayer=Ei,m.LiveTimeline=V,m.MORPH_SAMPLES=ps,m.ManualClock=Wn,m.MediaSync=Ye,m.Observer=ln,m.SPRING_MAX_DURATION_MS=Jt,m.SPRING_PRESETS=$t,m.SPRING_STEP_MS=et,m.ScrollAnimator=An,m.ScrollDriver=Pt,m.ScrollMarkers=Pn,m.ScrollPin=Tn,m.SmoothScroll=Ne,m.SpringSampler=gt,m.SpringTrackPlayer=_i,m.Stage=nn,m.Timeline=ge,m.TinyflyPlayer=Ve,m.TinyflySequencer=Vn,m.TrackPlayer=Xt,m.ValueResolver=Os,m.VisibilityDriver=wn,m.backOut=ni,m.bakeEasing=de,m.bakeInertiaTrack=fe,m.bakeSpringTrack=ue,m.bounceOut=ii,m.charactersFor=Ci,m.clamp01=Le,m.clearMorphCache=ks,m.clearPathCache=ls,m.containerProgressAt=De,m.context=Eo,m.create=yo,m.createCubicBezier=ti,m.createLive=On,m.createRandom=Di,m.createTrack=qt,m.criticalDamping=Gn,m.customBounce=Yi,m.customEase=Xi,m.customWiggle=Vi,m.deserializeTimeline=at,m.deserializeTrack=$i,m.draggable=Er,m.easeIn=Qe,m.easeInCubic=ee,m.easeInOut=Je,m.easeInOutCubic=bt,m.easeInOutQuad=Ke,m.easeInQuad=He,m.easeOut=Ze,m.easeOutCubic=ie,m.easeOutQuad=Ge,m.elasticOut=ei,m.expandParametricEasings=Pi,m.from=ko,m.fromJSON=Fs,m.fromTo=Mo,m.getEasingFunction=N,m.getInterpolator=St,m.getMotionPathPoint=pe,m.getPathLength=hs,m.getPointAtProgress=ci,m.gridLinesFor=fn,m.hasKeyframes=We,m.hashSeed=$s,m.imageSequence=Io,m.inertiaDuration=nt,m.inertiaRest=it,m.inertiaValueAt=Dt,m.inertiaVelocityAt=Jn,m.interpolateArray=ki,m.interpolateColor=Si,m.interpolateMotionPath=_s,m.interpolateNumber=q,m.interpolatePathString=Mi,m.interpolateString=le,m.isCubicBezierEasing=tt,m.isInertiaTrack=j,m.isMotionPathPoint=Un,m.isMotionPathTrack=Kt,m.isParametricEasing=dt,m.isPathData=rt,m.isSpringTrack=z,m.isTextTrack=Ct,m.isUnderdamped=Hn,m.isUnresolved=Ds,m.linear=Ot,m.live=$,m.mapEase=kt,m.matchMedia=Co,m.maxStaggerDistance=Zt,m.morphPath=mi,m.naturalRest=yt,m.pageTransition=Fo,m.parametricEasing=ri,m.parseEdge=Fe,m.parsePath=Q,m.parseTrigger=$e,m.play=go,m.playSequence=bo,m.playWhenVisible=Yr,m.playheadCrossings=ye,m.pointAtDistance=se,m.pointsToPath=Wi,m.quickPlay=wo,m.quickTo=Ro,m.randomBetween=ve,m.randomChoice=Ls,m.randomSnapped=Oi,m.resolveSequence=qi,m.resolveValue=we,m.scrollProgress=Xr,m.scrubOnScroll=jr,m.serializeTimeline=Li,m.serializeTrack=Ii,m.set=Ao,m.shapeToPathData=Yt,m.simplifyKeyframes=xi,m.smoothToward=vn,m.snapAxis=un,m.snapConfig=Sn,m.snapDuration=Mn,m.snapProgress=kn,m.splitText=_o,m.springDuration=je,m.springValueAt=zn,m.staggerDistance=Qt,m.staggerOffset=Rt,m.staggerOffsets=It,m.staggerSpan=mt,m.stepsEasing=si,m.syncMediaElement=Yn,m.textAt=Ri,m.tf=To,m.ticker=xo,m.timeline=Po,m.to=So,m.toJSON=Is,m.toKeyframedTrack=Ps,m.toKeyframedTracks=xs,m.trackTargets=K,m.triggerDistance=ct,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(m,it){typeof exports=="object"&&typeof module<"u"?it(exports):typeof define=="function"&&define.amd?define(["exports"],it):(m=typeof globalThis<"u"?globalThis:m||self,it(m.tinyfly=m.tinyfly||{}))})(this,(function(m){"use strict";function it(i){return typeof i=="object"&&i!==null&&i.type==="cubic-bezier"}function mt(i){return typeof i=="object"&&i!==null&&i.type!=="cubic-bezier"}const gt=1;function Rt(i){return i.property==="text"&&"textConfig"in i}function j(i){return i.kind==="inertia"&&"inertia"in i}function z(i){return i.kind==="spring"&&"spring"in i}function Jt(i){return i.property==="motionPath"&&"motionPathConfig"in i}function Qn(i){return typeof i=="object"&&i!==null&&"x"in i&&"y"in i&&"angle"in i}function ze(i){return"keyframes"in i}class Zn{_currentTime=0;_isRunning=!1;onTick=null;get currentTime(){return this._currentTime}get isRunning(){return this._isRunning}start(){this._isRunning=!0}stop(){this._isRunning=!1}tick(t){this._currentTime+=t,this.onTick?.(t,this._currentTime)}reset(){this._currentTime=0}seek(t){this._currentTime=t}}class Jn{_currentTime=0;_isRunning=!1;_lastFrameTime=null;_rafId=null;_speed;onTick=null;constructor(t={}){this._speed=t.speed??1}get currentTime(){return this._currentTime}get isRunning(){return this._isRunning}get speed(){return this._speed}set speed(t){this._speed=t}start(){this._isRunning||(this._isRunning=!0,this._lastFrameTime=null,this._scheduleFrame())}stop(){this._isRunning=!1,this._rafId!==null&&(cancelAnimationFrame(this._rafId),this._rafId=null)}reset(){this._currentTime=0,this._lastFrameTime=null}seek(t){this._currentTime=t}_scheduleFrame(){this._rafId=requestAnimationFrame(this._onFrame.bind(this))}_onFrame(t){if(this._isRunning){if(this._lastFrameTime!==null){const n=(t-this._lastFrameTime)*this._speed;this._currentTime+=n,this.onTick?.(n,this._currentTime)}this._lastFrameTime=t,this._scheduleFrame()}}}function te(i,t,e="start"){if(t<=1)return 0;if(typeof e=="number"){const n=Math.max(0,Math.min(t-1,e));return Math.abs(i-n)}switch(e){case"end":return t-1-i;case"center":return Math.abs(i-(t-1)/2);case"edges":return(t-1)/2-Math.abs(i-(t-1)/2);default:return i}}function ee(i,t="start"){if(i<=1)return 0;let e=0;for(let n=0;n<i;n++)e=Math.max(e,te(n,i,t));return e}function It(i,t,e){if(e.offsets)return e.offsets[i]??0;const n=e.from??"start",s=te(i,t,n);if(e.amount!==void 0){const r=ee(t,n);return r===0?0:e.amount*s/r}return e.each!==void 0?e.each*s:0}function Lt(i,t){return Array.from({length:i},(e,n)=>It(n,i,t))}function yt(i,t){return i<=1?0:Math.max(...Lt(i,t))}const nt=1,ie=6e4,Ft=ie/nt,q={stiffness:180,damping:12,mass:1,velocity:0,restDelta:.01,restSpeed:.1},$t={gentle:{stiffness:120,damping:18,mass:1},default:{stiffness:180,damping:12,mass:1},snappy:{stiffness:280,damping:20,mass:1},bouncy:{stiffness:220,damping:8,mass:1},wobbly:{stiffness:180,damping:5,mass:1},stiff:{stiffness:400,damping:30,mass:1}};class bt{from;to;stiffness;damping;mass;restDelta;restSpeed;distance;samples;velocity;settledStep=null;constructor(t){this.from=t.from,this.to=t.to,this.stiffness=t.stiffness??q.stiffness,this.damping=t.damping??q.damping,this.mass=t.mass??q.mass,this.restDelta=t.restDelta??q.restDelta,this.restSpeed=t.restSpeed??q.restSpeed,this.distance=Math.abs(this.to-this.from)||1,this.samples=[this.from],this.velocity=t.velocity??q.velocity,this.isAtRest(this.from)&&(this.settledStep=0)}isAtRest(t){return Math.abs(t-this.to)<this.restDelta*this.distance&&Math.abs(this.velocity)<this.restSpeed*this.distance}valueAt(t){if(t<=0)return this.from;const e=Math.floor(t/nt);if(this.simulateTo(e+1),this.settledStep!==null&&e>=this.settledStep)return this.to;const n=this.samples[Math.min(e,this.samples.length-1)],s=this.samples[Math.min(e+1,this.samples.length-1)],r=t/nt-e;return n+(s-n)*r}settleTime(){return this.simulateTo(Ft+1),this.settledStep!==null?this.settledStep*nt:ie}simulateTo(t){if(this.settledStep!==null)return;const e=Math.min(t,Ft+1),n=nt/1e3;for(;this.samples.length<e;){const s=this.samples[this.samples.length-1],r=s-this.to,o=-this.stiffness*r,a=-this.damping*this.velocity,c=(o+a)/this.mass;this.velocity+=c*n;const l=s+this.velocity*n;if(this.samples.push(l),this.isAtRest(l)){this.settledStep=this.samples.length-1;return}}this.samples.length>Ft&&(this.settledStep=Ft)}}function ts(i,t){return new bt(i).valueAt(t)}function He(i){return new bt(i).settleTime()}function es(i){const t=i.stiffness??q.stiffness,e=i.damping??q.damping,n=i.mass??q.mass;return e<2*Math.sqrt(t*n)}function is(i){const t=i.stiffness??q.stiffness,e=i.mass??q.mass;return 2*Math.sqrt(t*e)}const ne=4,ns=.002,ss=1e-4,Ge=6e4;function Dt(i){const t=i.friction??ne;return t>0?t:ne}function vt(i){return i.from+i.velocity/Dt(i)}function rs(i,t){if(t===void 0)return i;if(typeof t=="number")return t>0?Math.round(i/t)*t:i;if(t.length===0)return i;let e=t[0];for(const n of t)Math.abs(n-i)<Math.abs(e-i)&&(e=n);return e}function st(i){let t=rs(vt(i),i.end);return i.min!==void 0&&(t=Math.max(i.min,t)),i.max!==void 0&&(t=Math.min(i.max,t)),t}function rt(i){const t=Math.abs(st(i)-i.from);if(t===0)return 0;const e=i.restDelta??Math.max(ss,t*ns);if(e>=t)return 0;const n=Math.log(t/e)/Dt(i);return Math.min(Ge,n*1e3)}function Ot(i,t){if(t<=0)return i.from;const e=st(i);if(t>=rt(i))return e;const n=Dt(i);return i.from+(e-i.from)*(1-Math.exp(-n*t/1e3))}function os(i,t){const e=Dt(i),n=st(i);return t>=rt(i)?0:(n-i.from)*e*Math.exp(-e*Math.max(0,t)/1e3)}const Nt=i=>i,Ke=i=>i*i,Qe=i=>1-(1-i)*(1-i),Ze=i=>i<.5?2*i*i:1-Math.pow(-2*i+2,2)/2,se=i=>i*i*i,re=i=>1-Math.pow(1-i,3),wt=i=>i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,Je=se,ti=re,ei=wt,as={linear:Nt,"ease-in":Je,"ease-out":ti,"ease-in-out":ei,"ease-in-quad":Ke,"ease-out-quad":Qe,"ease-in-out-quad":Ze,"ease-in-cubic":se,"ease-out-cubic":re,"ease-in-out-cubic":wt};function ii(i){const[t,e,n,s]=i,r=3*t,o=3*(n-t)-r,a=1-r-o,c=3*e,l=3*(s-e)-c,h=1-c-l,f=p=>((a*p+o)*p+r)*p,u=p=>((h*p+l)*p+c)*p,d=p=>(3*a*p+2*o)*p+r,g=p=>{let y=p;for(let w=0;w<8;w++){const S=f(y)-p;if(Math.abs(S)<1e-7)return y;const T=d(y);if(Math.abs(T)<1e-7)break;y-=S/T}let b=0,v=1;for(y=p;b<v;){const w=f(y);if(Math.abs(w-p)<1e-7)return y;p>w?b=y:v=y,y=(b+v)/2}return y};return p=>{if(p<=0)return 0;if(p>=1)return 1;const y=g(p);return u(y)}}function oe(i,t="out"){if(t==="out")return i;const e=n=>1-i(1-n);return t==="in"?e:n=>n<.5?e(n*2)/2:i(n*2-1)/2+.5}function ni(i=1,t=.3){const e=Math.max(1,i),n=t/(2*Math.PI)*Math.asin(1/e);return s=>s<=0?0:s>=1?1:e*Math.pow(2,-10*s)*Math.sin((s-n)*(2*Math.PI)/t)+1}const si=i=>{if(i<=0)return 0;if(i>=1)return 1;if(i<1/2.75)return 7.5625*i*i;if(i<2/2.75){const s=i-.5454545454545454;return 7.5625*s*s+.75}if(i<2.5/2.75){const s=i-.8181818181818182;return 7.5625*s*s+.9375}const n=i-2.625/2.75;return 7.5625*n*n+.984375};function ri(i=1.70158){return t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t-1;return e*e*((i+1)*e+i)+1}}function oi(i,t="end"){const e=Math.max(1,Math.floor(i));return n=>{if(n>=1)return 1;if(n<=0)return t==="start"||t==="both"?t==="start"?1/e:1/(e+1):0;const s=Math.floor(n*e);switch(t){case"start":return Math.min(1,(s+1)/e);case"both":return(s+1)/(e+1);case"none":return e===1?0:Math.min(1,s/(e-1));default:return s/e}}}function ai(i){switch(i.type){case"steps":return oi(i.count,i.position);case"elastic":return oe(ni(i.amplitude,i.period),i.mode);case"bounce":return oe(si,i.mode);case"back":return oe(ri(i.overshoot),i.mode)}}function X(i){return i===void 0?Nt:it(i)?ii(i.points):mt(i)?ai(i):as[i]??Nt}const ci=32,cs=256,ot=new Map,ls=/[MmLlHhVvCcSsQqTtAaZz]/,hs=/^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/,us={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};function fs(i){const t=[];let e=0,n=null;const s=()=>{for(;e<i.length&&/[\s,]/.test(i[e]);)e++};for(;e<i.length&&(s(),!(e>=i.length));){const r=i[e];if(ls.test(r)){n={type:r,args:[]},t.push(n),e++;continue}if(!n)break;const o=n.type==="A"||n.type==="a",a=n.args.length%7;if(o&&(a===3||a===4)){if(r!=="0"&&r!=="1")break;n.args.push(r==="1"?1:0),e++;continue}const c=hs.exec(i.slice(e));if(!c)break;n.args.push(parseFloat(c[0])),e+=c[0].length}return t}function ds(i,t,e,n,s,r,o,a,c){if(i===a&&t===c)return[];let l=Math.abs(e),h=Math.abs(n);if(l===0||h===0)return[[i,t,a,c,a,c]];const f=s*Math.PI/180,u=Math.cos(f),d=Math.sin(f),g=(i-a)/2,p=(t-c)/2,y=u*g+d*p,b=-d*g+u*p,v=y*y/(l*l)+b*b/(h*h);if(v>1){const L=Math.sqrt(v);l*=L,h*=L}const w=r===o?-1:1,S=l*l*h*h-l*l*b*b-h*h*y*y,T=l*l*b*b+h*h*y*y,k=w*Math.sqrt(Math.max(0,S/T)),A=k*l*b/h,C=-k*h*y/l,D=u*A-d*C+(i+a)/2,P=d*A+u*C+(t+c)/2,x=(L,O,B,pt)=>{const je=L*B+O*pt,Zt=Math.sqrt((L*L+O*O)*(B*B+pt*pt)),Ct=Math.acos(Math.max(-1,Math.min(1,je/Zt)));return L*pt-O*B<0?-Ct:Ct},_=x(1,0,(y-A)/l,(b-C)/h);let M=x((y-A)/l,(b-C)/h,(-y-A)/l,(-b-C)/h);!o&&M>0&&(M-=2*Math.PI),o&&M<0&&(M+=2*Math.PI);const E=Math.max(1,Math.ceil(Math.abs(M)/(Math.PI/2))),R=M/E,F=4/3*Math.tan(R/4),I=L=>{const O=l*Math.cos(L),B=h*Math.sin(L);return[u*O-d*B+D,d*O+u*B+P]},Q=L=>{const O=-l*Math.sin(L),B=h*Math.cos(L);return[u*O-d*B,d*O+u*B]},et=[];for(let L=0;L<E;L++){const O=_+L*R,B=O+R,[pt,je]=I(O),[Zt,Ct]=L===E-1?[a,c]:I(B),[Ho,Go]=Q(O),[Ko,Qo]=Q(B);et.push([pt+F*Ho,je+F*Go,Zt-F*Ko,Ct-F*Qo,Zt,Ct])}return et}function H(i,t,e,n,s){const r=1-s;return r*r*r*i+3*r*r*s*t+3*r*s*s*e+s*s*s*n}function li(i,t,e,n,s){const r=1-s;return 3*r*r*(t-i)+6*r*s*(e-t)+3*s*s*(n-e)}function Tt(i,t,e,n){return{subpath:0,type:"L",points:[e,n],startX:i,startY:t,endX:e,endY:n,length:Math.hypot(e-i,n-t)}}function Bt(i,t,e){const[n,s,r,o,a,c]=e,l=[0];let h=i,f=t,u=0;for(let d=1;d<=ci;d++){const g=d/ci,p=H(i,n,r,a,g),y=H(t,s,o,c,g);u+=Math.hypot(p-h,y-f),l.push(u),h=p,f=y}return{subpath:0,type:"C",points:[n,s,r,o,a,c],startX:i,startY:t,endX:a,endY:c,length:u,lengths:l}}function Z(i){const t=ot.get(i);if(t)return t;const e=[];let n=0,s=0,r=0,o=0,a=null,c=null,l=-1;const h=new Set,f=p=>{l<0&&(l=0),p.subpath=l,e.push(p)};for(const{type:p,args:y}of fs(i)){const b=p.toUpperCase(),v=p!==b,w=us[b];if(b==="Z"){(n!==r||s!==o)&&f(Tt(n,s,r,o)),l>=0&&h.add(l),n=r,s=o,a=c=null;continue}for(let S=0;S+w<=y.length;S+=w){const T=y.slice(S,S+w),k=v?n:0,A=v?s:0;let C=null,D=null;switch(b){case"M":S===0?(n=T[0]+k,s=T[1]+A,r=n,o=s,(l<0||e[e.length-1]?.subpath===l)&&l++):(f(Tt(n,s,T[0]+k,T[1]+A)),n=T[0]+k,s=T[1]+A);break;case"L":f(Tt(n,s,T[0]+k,T[1]+A)),n=T[0]+k,s=T[1]+A;break;case"H":f(Tt(n,s,T[0]+k,s)),n=T[0]+k;break;case"V":f(Tt(n,s,n,T[0]+A)),s=T[0]+A;break;case"C":{const P=[T[0]+k,T[1]+A,T[2]+k,T[3]+A,T[4]+k,T[5]+A];f(Bt(n,s,P)),C=[P[2],P[3]],n=P[4],s=P[5];break}case"S":{const[P,x]=a?[2*n-a[0],2*s-a[1]]:[n,s],_=[P,x,T[0]+k,T[1]+A,T[2]+k,T[3]+A];f(Bt(n,s,_)),C=[_[2],_[3]],n=_[4],s=_[5];break}case"Q":case"T":{let P=n,x=s;b==="Q"?(P=T[0]+k,x=T[1]+A):c&&(P=2*n-c[0],x=2*s-c[1]);const _=b==="Q"?T[2]+k:T[0]+k,M=b==="Q"?T[3]+A:T[1]+A;f(Bt(n,s,[n+2/3*(P-n),s+2/3*(x-s),_+2/3*(P-_),M+2/3*(x-M),_,M])),D=[P,x],n=_,s=M;break}case"A":{const P=T[5]+k,x=T[6]+A;let _=n,M=s;for(const E of ds(n,s,T[0],T[1],T[2],T[3],T[4],P,x))f(Bt(_,M,E)),_=E[4],M=E[5];n=P,s=x;break}}a=C,c=D}}const u=e.reduce((p,y)=>p+y.length,0),d=[];for(let p=0;p<e.length;){const y=e[p].subpath;let b=p,v=0;for(;b<e.length&&e[b].subpath===y;)v+=e[b++].length;const w=e[p],S=e[b-1],T=h.has(y)||Math.abs(S.endX-w.startX)<1e-9&&Math.abs(S.endY-w.startY)<1e-9;d.push({start:p,end:b,length:v,closed:T}),p=b}const g={segments:e,totalLength:u,subpaths:d};return ot.size>=cs&&ot.delete(ot.keys().next().value),ot.set(i,g),g}function ps(i,t){const e=i.lengths;if(t<=0)return 0;if(t>=i.length)return 1;let n=0,s=e.length-1;for(;n<s-1;){const a=n+s>>1;e[a]<t?n=a:s=a}const r=e[s]-e[n],o=r>0?(t-e[n])/r:0;return(n+o)/(e.length-1)}function ms(i,t){if(i.type==="L"){const f=i.length>0?Math.max(0,Math.min(1,t/i.length)):0;return{x:i.startX+(i.endX-i.startX)*f,y:i.startY+(i.endY-i.startY)*f,angle:Math.atan2(i.endY-i.startY,i.endX-i.startX)*180/Math.PI}}const[e,n,s,r,o,a]=i.points,c=ps(i,t);let l=li(i.startX,e,s,o,c),h=li(i.startY,n,r,a,c);if(Math.hypot(l,h)<1e-9){const f=c<.5?Math.min(1,c+.001):Math.max(0,c-.001),u=H(i.startX,e,s,o,f),d=H(i.startY,n,r,a,f),g=H(i.startX,e,s,o,c),p=H(i.startY,n,r,a,c);l=c<.5?u-g:g-u,h=c<.5?d-p:p-d}return{x:H(i.startX,e,s,o,c),y:H(i.startY,n,r,a,c),angle:Math.atan2(h,l)*180/Math.PI}}function ae(i,t,e=0,n=i.length){if(n<=e)return{x:0,y:0,angle:0};let s=0;for(let r=e;r<n;r++){const o=i[r];if(s+o.length>=t||r===n-1)return ms(o,t-s);s+=o.length}return{x:0,y:0,angle:0}}function hi(i,t){const{segments:e,totalLength:n}=Z(i);return ae(e,Math.max(0,Math.min(1,t))*n)}function gs(){ot.clear()}function ys(i){return Z(i).totalLength}const bs=24,vs=320,ws=2.5,St=72,Ts=64,Ss=.2,ks=128,kt=new Map;let qt=0,G;const ui=i=>Math.round(i*100)/100;function fi(i,t){const{segments:e,subpaths:n,totalLength:s}=Z(i);if(e.length===0)return[];if(t){const r=n.every(o=>o.closed);return[{segments:e,start:0,end:e.length,length:s,closed:r}]}return n.filter(r=>r.length>0).map(r=>({segments:e,start:r.start,end:r.end,length:r.length,closed:r.closed}))}function ce(i,t){const e=i.closed?(t%1+1)%1:Math.max(0,Math.min(1,t)),n=ae(i.segments,e*i.length,i.start,i.end);return[n.x,n.y]}function di(i){const t=[];let e=0;for(let n=i.start;n<i.end;n++)e+=i.segments[n].length,i.length>0&&t.push(e/i.length);return t}function pi(i,t){const e=[];for(let n=0;n<t;n++)e.push(ce(i,i.closed?n/t:n/(t-1)));return e}function mi(i){let t=0,e=0;for(const[n,s]of i)t+=n,e+=s;return t/=i.length,e/=i.length,i.map(([n,s])=>[n-t,s-e])}function Ms(i,t,e){const n=i.closed&&t.closed;if(e!==void 0)return{offset:n?Math.abs(e)%St/St:0,reversed:e<0};const s=mi(pi(i,St)),r=mi(pi(t,St)),o=St;let a={offset:0,reversed:!1},c=1/0;for(const l of[!1,!0]){const h=n?o:1;for(let f=0;f<h;f++){let u=0;for(let d=0;d<o&&u<c;d++){const g=n?l?(f-d+o)%o:(d+f)%o:l?o-1-d:d,p=s[d][0]-r[g][0],y=s[d][1]-r[g][1];u+=p*p+y*y}u<c&&(c=u,a={offset:n?f/o:0,reversed:l})}}return a}function As(i,t,e){return e?((t.reversed?t.offset-i:i+t.offset)%1+1)%1:t.reversed?1-i:i}function xs(i,t,e){return e?((t.reversed?t.offset-i:i-t.offset)%1+1)%1:t.reversed?1-i:i}function Ps(i,t,e){const n=i.closed&&t.closed,s=Ms(i,t,e.shapeIndex),r=Math.max(bs,Math.min(vs,Math.ceil(Math.max(i.length,t.length)/ws))),o=new Set,a=f=>o.add(Math.round(f*1e7)/1e7);for(let f=0;f<=r;f++)a(f/r);for(const f of di(i))a(f);for(const f of di(t))a(xs(f,s,n));let c=[...o].sort((f,u)=>f-u);n&&(c=c.filter(f=>f<1));const l=[],h=[];for(const f of c)l.push(...ce(i,f)),h.push(...ce(t,As(f,s,n)));return Es({from:l,to:h,closed:n})}function Es(i){const t=i.from.length/2;if(t<=3)return i;const e=new Uint8Array(t);e[0]=1,e[t-1]=1;const n=[[0,t-1]];for(;n.length>0;){const[o,a]=n.pop();let c=-1,l=Ss;for(let h=o+1;h<a;h++){const f=Math.max(gi(i.from,o,a,h),gi(i.to,o,a,h));f>l&&(l=f,c=h)}c!==-1&&(e[c]=1,n.push([o,c],[c,a]))}const s=[],r=[];for(let o=0;o<t;o++)e[o]&&(s.push(i.from[o*2],i.from[o*2+1]),r.push(i.to[o*2],i.to[o*2+1]));return{from:s,to:r,closed:i.closed}}function gi(i,t,e,n){const s=i[t*2],r=i[t*2+1],o=i[e*2]-s,a=i[e*2+1]-r,c=i[n*2]-s,l=i[n*2+1]-r,h=o*o+a*a,f=h===0?0:Math.max(0,Math.min(1,(c*o+l*a)/h));return Math.hypot(c-f*o,l-f*a)}function _s(i,t,e){const n=e.shapeIndex;if(G&&G.from===i&&G.to===t&&G.shapeIndex===n)return G.plan;const r=kt.get(String(n??"auto"))?.get(i)?.get(t);if(r)return G={from:i,to:t,shapeIndex:n,plan:r},r;const o=Z(i).subpaths.filter(d=>d.length>0).length===Z(t).subpaths.filter(d=>d.length>0).length,a=fi(i,!o),c=fi(t,!o),l={pairs:a.map((d,g)=>Ps(d,c[g],e))};qt>=ks&&(kt.clear(),qt=0);const h=String(n??"auto"),f=kt.get(h)??new Map;kt.set(h,f);const u=f.get(i)??new Map;return f.set(i,u),u.set(t,l),qt++,G={from:i,to:t,shapeIndex:n,plan:l},l}function yi(i,t,e,n={}){if(!i)return t;if(!t)return i;const s=Math.max(0,Math.min(1,e));if(s===0)return i;if(s===1)return t;const r=_s(i,t,n);if(r.pairs.length===0)return s<.5?i:t;let o="";for(const a of r.pairs){for(let c=0;c<a.from.length;c+=2){const l=ui(a.from[c]+(a.to[c]-a.from[c])*s),h=ui(a.from[c+1]+(a.to[c+1]-a.from[c+1])*s);o+=`${c===0?o?" M":"M":" L"}${l} ${h}`}a.closed&&(o+=" Z")}return o}function Cs(){kt.clear(),qt=0,G=void 0}function at(i){return/^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(i)}const Y=(i,t,e)=>i+(t-i)*e,bi=512,le=new Map,he=new Map;function vi(i){const t=le.get(i);if(t)return t;const e=i.replace("#",""),n=[parseInt(e.slice(0,2),16),parseInt(e.slice(2,4),16),parseInt(e.slice(4,6),16)];return le.size<bi&&le.set(i,n),n}const wi=i=>i.charCodeAt(0)===35,Ti=i=>i.startsWith("rgb"),Si=i=>i.startsWith("rgba"),Rs=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/,ue=i=>Math.round(i).toString(16).padStart(2,"0");function Is(i,t,e){return`#${ue(i)}${ue(t)}${ue(e)}`}function ki(i){const t=he.get(i);if(t)return t;const e=i.match(Rs);if(!e)throw new Error(`Invalid rgb color: ${i}`);const n=parseInt(e[1],10),s=parseInt(e[2],10),r=parseInt(e[3],10),o=e[4]!==void 0?[n,s,r,parseFloat(e[4])]:[n,s,r];return he.size<bi&&he.set(i,o),o}const Mi=(i,t,e)=>{if(wi(i)&&wi(t)){const[n,s,r]=vi(i),[o,a,c]=vi(t),l=Y(n,o,e),h=Y(s,a,e),f=Y(r,c,e);return Is(l,h,f)}if((Ti(i)||Si(i))&&(Ti(t)||Si(t))){const n=ki(i),s=ki(t),r=Math.round(Y(n[0],s[0],e)),o=Math.round(Y(n[1],s[1],e)),a=Math.round(Y(n[2],s[2],e));if(n.length===4||s.length===4){const c=n[3]??1,l=s[3]??1,h=Y(c,l,e);return`rgba(${r}, ${o}, ${a}, ${h})`}return`rgb(${r}, ${o}, ${a})`}return e<1?i:t},Ai=(i,t,e)=>{const n=Math.min(i.length,t.length),s=[];for(let r=0;r<n;r++)s.push(Y(i[r],t[r],e));return s},fe=(i,t,e)=>e<1?i:t,xi=(i,t,e)=>yi(i,t,e);function Mt(i){return typeof i=="number"?Y:Array.isArray(i)?Ai:typeof i=="string"?i.startsWith("#")||i.startsWith("rgb")?Mi:at(i)?xi:fe:fe}const de=1e3/60;function pe(i,t={}){if(!z(i))throw new Error(`bakeSpringTrack: track "${i.id}" is not a spring track`);const e=new bt(i.spring);return Pi(i,n=>e.valueAt(n),e.settleTime(),i.spring.from,i.spring.to,t)}function me(i,t={}){if(!j(i))throw new Error(`bakeInertiaTrack: track "${i.id}" is not an inertia track`);const e=i.inertia;return Pi(i,n=>Ot(e,n),rt(e),e.from,st(e),t)}function Pi(i,t,e,n,s,r){const o=r.intervalMs??de,a=r.tolerance??.01,c=i.delay??0,l=[];for(let f=0;f<=e;f+=o)l.push({time:f+c,value:t(f),easing:"linear"});const h=l[l.length-1];return!h||h.time<e+c?l.push({time:e+c,value:s,easing:"linear"}):h.value=s,c>0&&l.unshift({time:0,value:n,easing:"linear"}),{id:i.id,target:i.target,property:i.property,keyframes:a>0?_i(l,a):l,...i.targets&&{targets:[...i.targets]},...i.stagger&&{stagger:{...i.stagger}}}}function ge(i,t,e,n={}){const s=n.intervalMs??de,r=typeof e=="function"?e:X(e),o=Mt(i.value),a=t.time-i.time;if(a<=0)return[t];const c=[];for(let h=s;h<a;h+=s){const f=h/a;c.push({time:i.time+h,value:o(i.value,t.value,r(f)),easing:"linear"})}const l=r(1);return c.push({...t,...l!==1&&{value:o(i.value,t.value,l)},easing:"linear"}),c}function Ls(i,t){return z(i)?pe(i,t):j(i)?me(i,t):i}function Ei(i,t={}){const e=i.keyframes;if(!e.some(s=>mt(s.easing)))return i;const n=e.length>0?[e[0]]:[];for(let s=1;s<e.length;s++){const r=e[s];mt(r.easing)?n.push(...ge(e[s-1],r,r.easing,t)):n.push(r)}return{...i,keyframes:n}}function Fs(i,t){return i.filter(ze).map(e=>Ei(e,t)).concat(i.filter(z).map(e=>pe(e,t)),i.filter(j).map(e=>me(e,t)))}function _i(i,t){if(i.length<=2)return i;const e=[i[0]];for(let n=1;n<i.length-1;n++){const s=e[e.length-1],r=i[n],o=i[n+1],a=o.time-s.time;if(a<=0)continue;const c=(r.time-s.time)/a,l=s.value+(o.value-s.value)*c;Math.abs(r.value-l)>t&&e.push(r)}return e.push(i[i.length-1]),e}function Xt(i){const t=[...i.keyframes].sort((e,n)=>e.time-n.time);return{...i,keyframes:t}}function K(i){return i.targets&&i.targets.length>0?i.targets:[i.target]}function ct(i,t,e,n){const s=e??0;return!n||t<=1?s:s+It(i,t,n)}class Yt{track;targets;constructor(t){this.track=t,this.targets=K(t)}getValueAtTime(t){return this.valueForOffset(t-ct(0,this.targets.length,this.track.delay,this.track.stagger))}getTargetValues(t){const e=this.targets.length,n=[];for(let s=0;s<e;s++){const r=ct(s,e,this.track.delay,this.track.stagger),o=this.valueForOffset(t-r);o!==void 0&&n.push({target:this.targets[s],value:o,start:r+this.track.keyframes[0].time})}return n}getDuration(){const{keyframes:t}=this.track;if(t.length===0)return 0;const e=t[t.length-1].time,n=this.track.stagger?yt(this.targets.length,this.track.stagger):0;return e+(this.track.delay??0)+n+(this.track.endDelay??0)}getTrack(){return this.track}valueForOffset(t){const{keyframes:e}=this.track;if(e.length===0)return;if(e.length===1||t<=e[0].time)return e[0].value;if(t>=e[e.length-1].time)return e[e.length-1].value;const{from:n,to:s}=this.findSurroundingKeyframes(t);if(!n||!s)return;if(n.time===t)return n.value;const r=s.time-n.time,o=(t-n.time)/r,c=X(s.easing)(o);return Mt(n.value)(n.value,s.value,c)}findSurroundingKeyframes(t){const{keyframes:e}=this.track;for(let n=0;n<e.length-1;n++)if(t>=e[n].time&&t<=e[n+1].time)return{from:e[n],to:e[n+1]};return{from:null,to:null}}}class Ci{track;targets;sampler;constructor(t){this.track=t,this.targets=K(t),this.sampler=new bt(t.spring)}getValueAtTime(t){return this.sampler.valueAt(t-ct(0,this.targets.length,this.track.delay,this.track.stagger))}getTargetValues(t){const e=this.targets.length,n=[];for(let s=0;s<e;s++){const r=ct(s,e,this.track.delay,this.track.stagger);n.push({target:this.targets[s],value:this.sampler.valueAt(t-r),start:r})}return n}getDuration(){const t=this.track.stagger?yt(this.targets.length,this.track.stagger):0;return this.sampler.settleTime()+(this.track.delay??0)+t}getTrack(){return this.track}}class Ri{track;targets;duration;constructor(t){this.track=t,this.targets=K(t),this.duration=rt(t.inertia)}getValueAtTime(t){return Ot(this.track.inertia,t-ct(0,this.targets.length,this.track.delay,this.track.stagger))}getTargetValues(t){const e=this.targets.length,n=[];for(let s=0;s<e;s++){const r=ct(s,e,this.track.delay,this.track.stagger);n.push({target:this.targets[s],value:Ot(this.track.inertia,t-r),start:r})}return n}getDuration(){const t=this.track.stagger?yt(this.targets.length,this.track.stagger):0;return this.duration+(this.track.delay??0)+t}getTrack(){return this.track}}function ye(i,t){const e={...hi(i.pathData,t)};if(i.matrix){const[n,s,r,o,a,c]=i.matrix,{x:l,y:h}=e;e.x=n*l+r*h+a,e.y=s*l+o*h+c;const f=e.angle*Math.PI/180,u=Math.cos(f),d=Math.sin(f);e.angle=Math.atan2(s*u+o*d,n*u+r*d)*180/Math.PI}return i.autoRotate&&i.rotateOffset&&(e.angle+=i.rotateOffset),e}function $s(i,t,e,n){const s=t+(e-t)*n;return ye(i,s)}const be={upperCase:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",lowerCase:"abcdefghijklmnopqrstuvwxyz",upperAndLowerCase:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",numbers:"0123456789"},Ds=20;function Ii(i){const t=be[i??"upperCase"]??i??be.upperCase,e=Array.from(t);return e.length>0?e:Array.from(be.upperCase)}function Os(i,t,e){let n=(i|0)^Math.imul(t+1,2654435761)^Math.imul(e+1,2246822507);return n=Math.imul(n^n>>>16,2146121005),n=Math.imul(n^n>>>15,2221713035),(n^n>>>16)>>>0}function Li(i,t,e=0){const n=i.from??"",s=i.to,r=Math.max(0,Math.min(1,t));if(r<=0)return n;if(r>=1)return s;const o=Array.from(n),a=Array.from(s),c=i.rightToLeft??!1;if(i.mode==="type"){const v=Math.round(r*Math.max(o.length,a.length));return c?o.slice(0,Math.max(0,o.length-v)).join("")+a.slice(Math.max(0,a.length-v)).join(""):a.slice(0,v).join("")+o.slice(v).join("")}const l=Math.max(0,Math.min(.999,i.revealDelay??0)),h=Math.max(0,(r-l)/(1-l)),f=Math.floor(h*a.length),u=i.tweenLength===!1?a.length:Math.round(o.length+(a.length-o.length)*r),d=Ii(i.chars),g=i.refreshRate??Ds,p=g>0?Math.floor(e*g/1e3):0,y=i.seed??1;let b="";for(let v=0;v<u;v++){const w=c?v>=u-f:v<f,S=c?a[a.length-(u-v)]:a[v];w&&S!==void 0||S===" "||S===`
2
+ `?b+=S:b+=d[Os(y,v,p)%d.length]}return b}class ve{id;name;_captions;_tracks=[];_trackPlayers=new Map;_motionPathTracks=new Map;_springTracks=new Map;_textTracks=new Map;_config;_currentTime=0;_playbackState="idle";_direction="forward";_loopIteration=0;_explicitDuration;_repeatDelayRemaining=0;_wrapAfterDelay=!1;onUpdate=null;onComplete=null;constructor(t){if(this.id=t.id,this.name=t.name,this._captions=t.captions,this._config=t.config??{},this._explicitDuration=t.config?.duration,t.tracks)for(const e of t.tracks)this.addTrack(e)}get tracks(){return[...this._tracks]}get duration(){return this._explicitDuration!==void 0?this._explicitDuration:this._calculateDuration()}setDuration(t){if(this._explicitDuration=t,t!==void 0)this._config={...this._config,duration:t};else if(this._config.duration!==void 0){const e={...this._config};delete e.duration,this._config=e}}get currentTime(){return this._currentTime}get playbackState(){return this._playbackState}get direction(){return this._direction}get loopIteration(){return this._loopIteration}get repeatDelayRemaining(){return this._repeatDelayRemaining}get speed(){return this._config.speed??1}set speed(t){this._config.speed=t}play(){const t=this.duration;this._direction==="forward"&&this._currentTime>=t&&t>0?(this._currentTime=0,this._loopIteration=0):this._direction==="reverse"&&this._currentTime<=0&&t>0&&(this._currentTime=t,this._loopIteration=0),this._playbackState="playing"}pause(){this._playbackState="paused"}stop(){this._playbackState="idle",this._repeatDelayRemaining=0,this._wrapAfterDelay=!1,this._currentTime=0,this._loopIteration=0,this._direction="forward"}seek(t){const e=this.duration>0?this.duration:1/0;this._currentTime=Math.max(0,Math.min(t,e)),this._repeatDelayRemaining=0,this._wrapAfterDelay=!1}reverse(){this._direction=this._direction==="forward"?"reverse":"forward"}tick(t){if(this._playbackState!=="playing")return;const e=this.duration;if(e<=0)return;let s=t*this.speed;if(this._repeatDelayRemaining>0){const a=Math.min(this._repeatDelayRemaining,s);if(this._repeatDelayRemaining-=a,s-=a,this._repeatDelayRemaining>0){this.onUpdate?.(this.getStateAtTime(this._currentTime));return}this._wrapAfterDelay&&(this._wrapAfterDelay=!1,this._currentTime=0)}const r=1e3;for(let a=0;a<r&&s>0&&this._playbackState==="playing";a++)if(this._direction==="forward"){const c=e-this._currentTime;if(s>=c){if(s-=c,this._currentTime=e,!this._handleEndReached())break}else this._currentTime+=s,s=0}else{const c=this._currentTime;if(s>=c){if(s-=c,this._currentTime=0,!this._handleStartReached())break}else this._currentTime-=s,s=0}const o=this.getStateAtTime(this._currentTime);this.onUpdate?.(o)}getStateAtTime(t){const e=new Map;if(this._hasSharedWrites())this._resolveShared(t,e);else for(const[n,s]of this._trackPlayers){const r=s.getTrack().property;for(const{target:o,value:a,start:c}of s.getTargetValues(t))this._write(e,n,o,r,a,t-c)}return{values:e,currentTime:this._currentTime,playbackState:this._playbackState,direction:this._direction,loopIteration:this._loopIteration}}_resolveShared(t,e){const n=new Map;for(const[s,r]of this._trackPlayers){const o=r.getTrack().property;for(const{target:a,value:c,start:l}of r.getTargetValues(t)){const h=`${a}\0${o}`,f=l<=t,u=n.get(h);(!u||(f!==u.started?f:f?l>=u.start:l<=u.start))&&n.set(h,{trackId:s,target:a,property:o,value:c,start:l,started:f})}}for(const{trackId:s,target:r,property:o,value:a,start:c}of n.values())this._write(e,s,r,o,a,t-c)}_write(t,e,n,s,r,o){if(r===void 0)return;let a=t.get(n);a||(a=new Map,t.set(n,a));const c=this._textTracks.get(e);if(c&&typeof r=="number"){a.set("text",Li(c.textConfig,r,Math.max(0,o)));return}const l=this._motionPathTracks.get(e);if(l&&typeof r=="number"){const h=ye(l.motionPathConfig,r);a.set("motionPathX",h.x),a.set("motionPathY",h.y),l.motionPathConfig.autoRotate&&a.set("motionPathRotate",h.angle)}else a.set(s,r)}_sharedWrites=null;_hasSharedWrites(){if(this._sharedWrites===null){const t=new Set;this._sharedWrites=!1;t:for(const e of this._tracks)for(const n of K(e)){const s=`${n}\0${e.property}`;if(t.has(s)){this._sharedWrites=!0;break t}t.add(s)}}return this._sharedWrites}addTrack(t){if(this._tracks.push(t),this._sharedWrites=null,j(t)){this._trackPlayers.set(t.id,new Ri(t));return}if(z(t)){this._trackPlayers.set(t.id,new Ci(t)),this._springTracks.set(t.id,t);return}if(Rt(t))this._trackPlayers.set(t.id,new Yt(t)),this._textTracks.set(t.id,t);else if(Jt(t)){const e={id:t.id,target:t.target,property:t.property,keyframes:t.keyframes,delay:t.delay,endDelay:t.endDelay,targets:t.targets,stagger:t.stagger};this._trackPlayers.set(t.id,new Yt(e)),this._motionPathTracks.set(t.id,t)}else this._trackPlayers.set(t.id,new Yt(t))}replaceTrack(t,e){const n=this._tracks.findIndex(r=>r.id===t);if(n<0)return;const s=this._tracks.slice(n+1);this.removeTrack(t);for(const r of s)this.removeTrack(r.id);this.addTrack(e);for(const r of s)this.addTrack(r)}removeTrack(t){this._tracks=this._tracks.filter(e=>e.id!==t),this._sharedWrites=null,this._trackPlayers.delete(t),this._motionPathTracks.delete(t),this._springTracks.delete(t),this._textTracks.delete(t)}getTracks(t={}){return this._tracks.filter(e=>this._matches(e,t))}removeTracks(t={}){const e=this.getTracks(t).map(n=>n.id);for(const n of e)this.removeTrack(n);return e}getTrackSpan(t){const e=this._trackPlayers.get(t);if(!e)return;const n=e.getTrack(),s=n.delay??0;if(z(n)||j(n))return{from:s,to:e.getDuration()};const r=n.keyframes;if(!(!r||r.length===0))return{from:r[0].time+s,to:e.getDuration()}}findConflicts(){const t=[];for(let e=0;e<this._tracks.length;e++){const n=this._tracks[e],s=this.getTrackSpan(n.id);if(s)for(let r=0;r<e;r++){const o=this._tracks[r];if(o.property!==n.property)continue;const a=K(o).filter(f=>K(n).includes(f));if(a.length===0)continue;const c=this.getTrackSpan(o.id);if(!c||!(c.from<=s.to&&s.from<=c.to))continue;const h=s.from>=c.from;for(const f of a)t.push({target:f,property:n.property,losingTrackId:h?o.id:n.id,winningTrackId:h?n.id:o.id})}}return t}_matches(t,e){if(e.id!==void 0&&t.id!==e.id||e.property!==void 0&&t.property!==e.property||e.target!==void 0&&!K(t).includes(e.target))return!1;if(e.timeRange){const n=this.getTrackSpan(t.id);if(!n||n.to<e.timeRange.from||n.from>e.timeRange.to)return!1}return!0}toDefinition(){return{formatVersion:gt,id:this.id,name:this.name,config:{...this._config},tracks:[...this._tracks],...this.captions&&{captions:this.captions}}}get config(){return this._config}get markers(){return[...this._config.markers??[]].sort((t,e)=>t.time-e.time)}setMarkers(t){const e=t&&t.length>0?[...t].sort((s,r)=>s.time-r.time).map(s=>({...s})):void 0,n={...this._config};e?n.markers=e:delete n.markers,this._config=n}get captions(){return this._captions}setCaptions(t){const e={};for(const[n,s]of Object.entries(t??{}))e[n]={...s};this._captions=Object.keys(e).length>0?e:void 0}_armRepeatDelay(){this._repeatDelayRemaining=this._config.repeatDelay??0}_calculateDuration(){let t=0;for(const[,e]of this._trackPlayers)t=Math.max(t,e.getDuration());return t}_handleEndReached(){const t=this._config.loop??0;return t===-1||this._loopIteration<t?(this._loopIteration++,this._armRepeatDelay(),this._config.alternate?this._direction="reverse":this._repeatDelayRemaining>0?this._wrapAfterDelay=!0:this._currentTime=0,this._repeatDelayRemaining===0):(this._playbackState="idle",this.onComplete?.(),!1)}_handleStartReached(){const t=this._config.loop??0;return this._config.alternate&&(t===-1||this._loopIteration<t)?(this._loopIteration++,this._armRepeatDelay(),this._direction="forward",this._repeatDelayRemaining===0):(this._playbackState="idle",this.onComplete?.(),!1)}}const Ns=100;function we(i,t,e,n){const s=[],r=[],{duration:o,alternate:a}=n,c=(d,g,p,y)=>{r.push([d,g]);const b=[];i.forEach((v,w)=>{(p==="forward"?(y?v>=d:v>d)&&v<=g:(y?v<=d:v<d)&&v>=g)&&b.push(w)}),b.sort((v,w)=>(p==="forward"?i[v]-i[w]:i[w]-i[v])||v-w);for(const v of b)s.push({kind:"event",index:v,direction:p})};let l=t.time,h=t.direction,f=t.fresh===!0;const u=Math.min(Ns,Math.max(0,e.iteration-t.iteration));for(let d=0;d<u;d++){const g=h==="forward"?o:0;c(l,g,h,f),s.push({kind:"repeat"}),a?(h=h==="forward"?"reverse":"forward",l=g,f=!1):(l=h==="forward"?0:o,f=!0)}return u>0&&n.holding&&!a?{crossings:s,passes:r}:(c(l,e.time,h,f),{crossings:s,passes:r})}function Fi(i){return j(i)?{id:i.id,target:i.target,property:i.property,kind:"inertia",inertia:$i(i.inertia),...V(i)}:z(i)?{id:i.id,target:i.target,property:i.property,kind:"spring",spring:{...i.spring},...V(i)}:Rt(i)?{id:i.id,target:i.target,property:"text",textConfig:{...i.textConfig},keyframes:i.keyframes.map(Te),...V(i)}:Jt(i)?{id:i.id,target:i.target,property:"motionPath",motionPathConfig:{...i.motionPathConfig},keyframes:i.keyframes.map(Te),...V(i)}:{id:i.id,target:i.target,property:i.property,keyframes:i.keyframes.map(Te),...V(i)}}function $i(i){return{...i,...Array.isArray(i.end)&&{end:[...i.end]}}}function Te(i){return{time:i.time,value:i.value,...i.easing&&{easing:i.easing}}}function V(i){const t=i.endDelay;return{...i.delay!==void 0&&{delay:i.delay},...t!==void 0&&{endDelay:t},...i.targets!==void 0&&{targets:[...i.targets]},...i.stagger!==void 0&&{stagger:{...i.stagger}}}}function Di(i){if(j(i)){const t=i;return{id:t.id,target:t.target,property:t.property,kind:"inertia",inertia:$i(t.inertia),...V(t)}}if(z(i)){const t=i;return{id:t.id,target:t.target,property:t.property,kind:"spring",spring:{...t.spring},...V(t)}}if(Rt(i)){const t=i;return{id:t.id,target:t.target,property:"text",textConfig:{...t.textConfig},keyframes:[...t.keyframes].sort((e,n)=>e.time-n.time),...V(t)}}if(i.property==="motionPath"&&"motionPathConfig"in i){const t=i,e=[...t.keyframes].sort((n,s)=>n.time-s.time);return{id:t.id,target:t.target,property:"motionPath",motionPathConfig:{...t.motionPathConfig},keyframes:e,...V(t)}}return Xt({id:i.id,target:i.target,property:i.property,keyframes:i.keyframes,...V(i)})}function Oi(i){const t=i._config.markers;return{formatVersion:gt,id:i.id,name:i.name,config:{duration:i.duration>0?i.duration:void 0,loop:i._config.loop,speed:i._config.speed,alternate:i._config.alternate,repeatDelay:i._config.repeatDelay,...t&&{markers:t.map(e=>({...e}))}},tracks:i.tracks.map(Fi),...i.captions&&{captions:JSON.parse(JSON.stringify(i.captions))}}}function lt(i){const t=i.formatVersion??1;if(t>gt)throw new Error(`tinyfly: this animation uses format version ${t}, but this tinyfly reads up to version ${gt}. Update tinyfly to play it.`);return new ve({id:i.id,name:i.name,config:i.config,tracks:i.tracks.map(Di),captions:i.captions})}function Bs(i){return JSON.stringify(Oi(i))}function qs(i){const t=JSON.parse(i);return lt(t)}function Xs(i){let t=2166136261;for(let e=0;e<i.length;e++)t^=i.charCodeAt(e),t=Math.imul(t,16777619);return t>>>0}function Ni(i){let t=i>>>0||2654435769;return{seed:i>>>0,next(){return t^=t<<13,t>>>=0,t^=t>>17,t^=t<<5,t>>>=0,t/4294967296}}}function Se(i,t,e){return t+i.next()*(e-t)}function Bi(i,t,e,n){if(n<=0)return Se(i,t,e);const s=Math.floor((e-t)/n),r=Math.round(i.next()*s);return t+r*n}function Ys(i,t){if(t.length!==0)return t[Math.floor(i.next()*t.length)]}const qi=/^([+\-*/])=\s*(-?[\d.]+)$/,Xi=/^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;function Vs(i){return typeof i!="string"?!1:qi.test(i.trim())||Xi.test(i.trim())}function ke(i,t={}){if(typeof i!="string")return i;const e=i.trim(),n=qi.exec(e);if(n){const[,r,o]=n,a=t.base??0,c=Number.parseFloat(o);switch(r){case"+":return a+c;case"-":return a-c;case"*":return a*c;case"/":return c===0?a:a/c}}const s=Xi.exec(e);if(s){if(!t.random)throw new Error(`resolveValue: "${e}" needs a random source — pass one via context.random`);const r=Number.parseFloat(s[1]),o=Number.parseFloat(s[2]),a=s[3]!==void 0?Number.parseFloat(s[3]):void 0;return a!==void 0?Bi(t.random,r,o,a):Se(t.random,r,o)}return i}function Yi(i,t=0,e){const n=[];let s=t;for(const r of i){const o=ke(r,{base:s,random:e});n.push(o),typeof o=="number"&&(s=o)}return n}class Us{random;constructor(t){this.random=Ni(t)}get seed(){return this.random.seed}resolve(t,e=0){return ke(t,{base:e,random:this.random})}resolveSequence(t,e=0){return Yi(t,e,this.random)}}const Ws=600;function Vi(i){if(Array.isArray(i)){const[u,d,g,p]=i;return{fn:ji(u,d,g,p),bezier:[u,d,g,p]}}const{segments:t}=Z(i);if(t.length===0)throw new Error(`customEase: no curve in "${i}"`);const e=t[0].startX,n=t[0].startY,s=t[t.length-1],r=s.endX-e,o=s.endY-n;if(r===0||o===0)throw new Error(`customEase: "${i}" must move along both axes`);const a=u=>(u-e)/r,c=u=>(u-n)/o;if(t.length===1&&s.type==="C"){const[u,d,g,p]=s.points,y=[a(u),c(d),a(g),c(p)];return{fn:ji(...y),bezier:y}}const l=[],h=[],f=Math.max(8,Math.ceil(Ws/t.length));for(const u of t)for(let d=l.length===0?0:1;d<=f;d++){const[g,p]=js(u,d/f);l.push(a(g)),h.push(c(p))}return{fn:zs(l,h)}}function Ui(i={}){const e=.1+Math.max(0,Math.min(1,i.strength??.7))*.7,n=[1];for(let r=e;r>.002;r*=e)n.push(2*Math.sqrt(r));const s=n.reduce((r,o)=>r+o,0);return r=>{if(r<=0)return 0;if(r>=1)return 1;let o=r*s;for(let a=0;a<n.length;a++){if(o<=n[a]){if(a===0)return(o/n[0])**2;const c=n[a]/2,l=c*c,h=o-c;return 1-(l-h*h)}o-=n[a]}return 1}}function Wi(i={}){const t=Math.max(1,i.wiggles??10),e=i.type??"easeOut",n=s=>e==="uniform"?1:e==="easeInOut"?Math.sin(Math.PI*s):(1-s)**2;return s=>s<=0||s>=1?0:Math.sin(s*t*Math.PI*2)*n(s)}function js(i,t){if(i.type==="L"){const[l,h]=i.points;return[i.startX+(l-i.startX)*t,i.startY+(h-i.startY)*t]}const[e,n,s,r,o,a]=i.points,c=1-t;return[c*c*c*i.startX+3*c*c*t*e+3*c*t*t*s+t*t*t*o,c*c*c*i.startY+3*c*c*t*n+3*c*t*t*r+t*t*t*a]}function zs(i,t){return e=>{if(e<=i[0])return t[0];if(e>=i[i.length-1])return t[t.length-1];let n=0,s=i.length-1;for(;s-n>1;){const o=n+s>>1;i[o]<=e?n=o:s=o}const r=i[s]-i[n];return r===0?t[s]:t[n]+(e-i[n])/r*(t[s]-t[n])}}function ji(i,t,e,n){const s=(o,a,c)=>3*(1-o)*(1-o)*o*a+3*(1-o)*o*o*c+o*o*o,r=(o,a,c)=>3*(1-o)*(1-o)*a+6*(1-o)*o*(c-a)+3*o*o*(1-c);return o=>{if(o<=0)return 0;if(o>=1)return 1;let a=o;for(let h=0;h<8;h++){const f=s(a,i,e)-o,u=r(a,i,e);if(Math.abs(f)<1e-6)return s(a,t,n);if(Math.abs(u)<1e-6)break;a-=f/u}let c=0,l=1;a=o;for(let h=0;h<40;h++)s(a,i,e)<o?c=a:l=a,a=(c+l)/2;return s(a,t,n)}}const U=i=>Math.round(i*1e3)/1e3;function zi(i,t={}){if(i.length===0)return"";const e=t.curviness??1,n=t.closed??!1,s=i.length;let r=`M${U(i[0].x)} ${U(i[0].y)}`;if(s===1)return r;const o=c=>n?i[(c%s+s)%s]:i[Math.max(0,Math.min(s-1,c))],a=n?s:s-1;for(let c=0;c<a;c++){const l=o(c-1),h=o(c),f=o(c+1),u=o(c+2);if(e===0){r+=` L${U(f.x)} ${U(f.y)}`;continue}const d=e/6,g=h.x+(f.x-l.x)*d,p=h.y+(f.y-l.y)*d,y=f.x-(u.x-h.x)*d,b=f.y-(u.y-h.y)*d;r+=` C${U(g)} ${U(p)} ${U(y)} ${U(b)} ${U(f.x)} ${U(f.y)}`}return n?`${r} Z`:r}const $=(i,t=0)=>{const e=parseFloat(i??"");return Number.isFinite(e)?e:t};function Hs(i){const t=(i??"").trim().split(/[\s,]+/).filter(Boolean).map(Number),e=[];for(let n=0;n+1<t.length;n+=2)e.push({x:t[n],y:t[n+1]});return e}function Vt(i){const t=i.attributes;switch(i.tag.toLowerCase()){case"path":return t.d??null;case"circle":case"ellipse":{const e=$(t.cx),n=$(t.cy),s=i.tag.toLowerCase()==="circle"?$(t.r):$(t.rx),r=i.tag.toLowerCase()==="circle"?$(t.r):$(t.ry);return`M${e+s} ${n} A${s} ${r} 0 1 1 ${e-s} ${n} A${s} ${r} 0 1 1 ${e+s} ${n} Z`}case"rect":{const e=$(t.x),n=$(t.y),s=$(t.width),r=$(t.height);let o=t.rx!=null?$(t.rx):t.ry!=null?$(t.ry):0,a=t.ry!=null?$(t.ry):o;return o=Math.min(o,s/2),a=Math.min(a,r/2),o===0||a===0?`M${e} ${n} H${e+s} V${n+r} H${e} Z`:`M${e+o} ${n} H${e+s-o} A${o} ${a} 0 0 1 ${e+s} ${n+a} V${n+r-a} A${o} ${a} 0 0 1 ${e+s-o} ${n+r} H${e+o} A${o} ${a} 0 0 1 ${e} ${n+r-a} V${n+a} A${o} ${a} 0 0 1 ${e+o} ${n} Z`}case"line":return`M${$(t.x1)} ${$(t.y1)} L${$(t.x2)} ${$(t.y2)}`;case"polyline":case"polygon":{const e=Hs(t.points);if(e.length===0)return null;const n=e.map((s,r)=>`${r===0?"M":"L"}${s.x} ${s.y}`).join(" ");return i.tag.toLowerCase()==="polygon"?`${n} Z`:n}default:return null}}const Ut={"power1.in":[.55,.085,.68,.53],"power1.out":[.25,.46,.45,.94],"power1.inout":[.455,.03,.515,.955],"power2.in":[.55,.055,.675,.19],"power2.out":[.215,.61,.355,1],"power2.inout":[.645,.045,.355,1],"power3.in":[.895,.03,.685,.22],"power3.out":[.165,.84,.44,1],"power3.inout":[.77,0,.175,1],"power4.in":[.755,.05,.855,.06],"power4.out":[.23,1,.32,1],"power4.inout":[.86,0,.07,1],"sine.in":[.47,0,.745,.715],"sine.out":[.39,.575,.565,1],"sine.inout":[.445,.05,.55,.95],"expo.in":[.95,.05,.795,.035],"expo.out":[.19,1,.22,1],"expo.inout":[1,0,0,1],"circ.in":[.6,.04,.98,.335],"circ.out":[.075,.82,.165,1],"circ.inout":[.785,.135,.15,.86],"back.in":[.6,-.28,.735,.045],"back.out":[.175,.885,.32,1.275],"back.inout":[.68,-.55,.265,1.55]},Hi={none:"linear",linear:"linear","linear.none":"linear","power1.in":"ease-in-quad","power1.out":"ease-out-quad","power1.inout":"ease-in-out-quad","power2.in":"ease-in-cubic","power2.out":"ease-out-cubic","power2.inout":"ease-in-out-cubic"};function Gs(i){let t=i.trim().toLowerCase();t=t.replace(/\.ease(in|out|inout)$/,".$1");const e=/^([a-z]+\d?)(\(.*\))?$/.exec(t);return e&&e[1]!=="steps"&&t!=="none"&&t!=="linear"&&(t=`${e[1]}.out${e[2]??""}`),t}X({type:"bounce",mode:"in"}),X({type:"bounce",mode:"in-out"});function At(i){const t=Gi.get(i.trim().toLowerCase());if(t)return t;const e=Gs(i),n=/^steps\(\s*(\d+)\s*\)$/.exec(e);if(n){const o={type:"steps",count:Math.max(1,Number.parseInt(n[1],10))+1,position:"none"};return{easing:o,fn:X(o)}}const s=/^(elastic|bounce|back)\.(in|out|inout)(?:\(([^)]*)\))?$/.exec(e);if(s){const[,r,o,a]=s,c=(a??"").split(",").map(f=>Number.parseFloat(f)).filter(f=>Number.isFinite(f)),l=o==="inout"?"in-out":o;if(r==="back"&&c.length===0&&e in Ut)return{easing:{type:"cubic-bezier",points:Ut[e]}};const h=r==="elastic"?{type:"elastic",mode:l,...c[0]!==void 0&&{amplitude:c[0]},...c[1]!==void 0&&{period:c[1]}}:r==="bounce"?{type:"bounce",mode:l}:{type:"back",mode:l,...c[0]!==void 0&&{overshoot:c[0]}};return{easing:h,fn:X(h)}}return e in Hi?{easing:Hi[e]}:e in Ut?{easing:{type:"cubic-bezier",points:Ut[e]}}:{easing:"ease-out"}}const Gi=new Map;function Me(i,t){return Gi.set(i.trim().toLowerCase(),t.bezier?{easing:{type:"cubic-bezier",points:t.bezier},fn:t.fn}:{fn:t.fn,requiresBaking:"custom"}),i}function Ae(i){let t=i>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}const Ki=/^\s*random\(\s*(\[.*\]|[^)]*)\s*\)\s*$/;function Qi(i){return typeof i=="string"&&Ki.test(i)}function Ks(i=1){let t=Ae(i);const e=(c,l)=>((...h)=>h.length>=c?l(...h):f=>l(...h,f)),n=(c,l,h)=>Math.min(Math.max(h,Math.min(c,l)),Math.max(c,l)),s=(c,l,h,f,u)=>l===c?h:h+(u-c)/(l-c)*(f-h),r=(c,l)=>{if(typeof c=="number")return c===0?l:Math.round(l/c)*c;if(Array.isArray(c))return Zi(c,l,1/0);if("values"in c)return Zi(c.values,l,c.radius??1/0);const h=Math.round(l/c.increment)*c.increment;return Math.abs(h-l)<=(c.radius??1/0)?h:l},o=(c,l,h)=>{const f=c+t()*(l-c);return h?Math.round(f/h)*h:f};return{clamp:e(3,n),mapRange:e(5,s),normalize:e(3,(c,l,h)=>s(c,l,0,1,h)),interpolate:e(3,(c,l,h)=>{if(typeof c=="object"&&!Array.isArray(c)){const f={};for(const u of Object.keys(c))f[u]=Mt(c[u])(c[u],l[u],h);return f}return Mt(c)(c,l,h)}),wrap:((c,l,h)=>{if(Array.isArray(c)){const p=c,y=b=>p[(Math.round(b)%p.length+p.length)%p.length];return l===void 0?y:y(l)}const f=c,d=l-f,g=p=>d===0?f:((p-f)%d+d)%d+f;return h===void 0?g:g(h)}),wrapYoyo:e(3,(c,l,h)=>{const f=l-c;if(f===0)return c;const u=((h-c)%(f*2)+f*2)%(f*2);return c+(u>f?f*2-u:u)}),snap:e(2,r),random:((c,l,h,f)=>{if(Array.isArray(c)){const d=()=>c[Math.floor(t()*c.length)];return l===!0?d:d()}const u=()=>o(c,l,h);return f?u:u()}),shuffle:c=>{for(let l=c.length-1;l>0;l--){const h=Math.floor(t()*(l+1));[c[l],c[h]]=[c[h],c[l]]}return c},distribute:({base:c=0,amount:l,each:h,from:f="start",ease:u})=>(d,g,p)=>{const y=p.length,v=It(d,y,{...l!==void 0?{amount:l}:{each:h??1},from:f}),w=l!==void 0?l:(h??1)*ee(y,f),S=u&&w>0?u(v/w)*w:v;return c+S},pipe:(...c)=>l=>c.reduce((h,f)=>f(h),l),splitColor:c=>Qs(c),getUnit:c=>typeof c=="number"?"":/^-?[\d.]+(?:e[-+]?\d+)?([a-z%]*)$/i.exec(c.trim())?.[1]??"",seed:c=>{t=Ae(c)},resolveRandomString:c=>{const l=Ki.exec(c)?.[1]??"";if(l.startsWith("[")){const g=l.slice(1,-1).split(",").map(p=>p.trim()).filter(Boolean).map(p=>Number.isFinite(Number(p))?Number(p):p.replace(/^['"]|['"]$/g,""));return g[Math.floor(t()*g.length)]}const[h,f,u]=l.split(",").map(d=>Number.parseFloat(d));return o(h,f,Number.isFinite(u)?u:void 0)}}}function Zi(i,t,e){let n=t,s=1/0;for(const r of i){const o=Math.abs(r-t);o<s&&(s=o,n=r)}return s<=e?n:t}function Qs(i){const t=i.trim(),e=/^#([0-9a-f]{3,8})$/i.exec(t)?.[1];if(e){const r=(e.length<=4?[...e].map(o=>o+o).join(""):e).match(/../g).map(o=>Number.parseInt(o,16));return r.length>=4?[r[0],r[1],r[2],Math.round(r[3]/255*1e3)/1e3]:[r[0],r[1],r[2]]}const n=(/rgba?\(([^)]+)\)/i.exec(t)?.[1]??"0,0,0").split(/[\s,/]+/).filter(Boolean).map(s=>Number.parseFloat(s));return n.length>=4?[n[0],n[1],n[2],n[3]]:[n[0]??0,n[1]??0,n[2]??0]}const Zs=/^([+-])=\s*(-?[\d.]+)$/,Js=/^([<>])\s*(?:([+-])?=?\s*(-?[\d.]+))?$/;function xt(i,t){const e=t.scale??1,n=l=>Number.parseFloat(l)*e;if(i===void 0)return t.cursor;if(typeof i=="number")return i*e;const s=i.trim();if(s==="")return t.cursor;const r=Zs.exec(s);if(r){const l=n(r[2]);return t.cursor+(r[1]==="-"?-l:l)}const o=Js.exec(s);if(o){const l=o[1]==="<"?t.previousStart:t.previousEnd;if(o[3]===void 0)return l;const h=n(o[3]);return l+(o[2]==="-"?-h:h)}const a=/^(.+?)([+-])=\s*(-?[\d.]+)$/.exec(s);if(a){const l=t.labels.get(a[1].trim());if(l!==void 0){const h=n(a[3]);return l+(a[2]==="-"?-h:h)}}const c=t.labels.get(s);return c!==void 0?c:/^-?[\d.]+$/.test(s)?n(s):t.cursor}function tr(i){if(typeof i!="object"||i===null)return!1;const t=i;return t.grid!==void 0||t.from==="random"||Array.isArray(t.from)||t.ease!==void 0||t.axis!==void 0}function er(i,t,e={}){if(i===0)return[];const n=t.grid==="auto"?Math.max(1,Math.min(i,e.columnsFromLayout?.()??i)):Array.isArray(t.grid)?Math.max(1,t.grid[1]):i,s=Array.isArray(t.grid)?Math.max(1,t.grid[0]):Math.ceil(i/n),r=g=>({x:g%n,y:Math.floor(g/n)}),o=t.from??"start",a=Array.isArray(o)?{x:o[0]*(n-1),y:o[1]*(s-1)}:typeof o=="number"?r(Math.max(0,Math.min(i-1,o))):o==="end"?r(i-1):o==="center"||o==="edges"?{x:(n-1)/2,y:(s-1)/2}:{x:0,y:0},c=g=>{const{x:p,y}=r(g),b=Math.abs(p-a.x),v=Math.abs(y-a.y);return t.axis==="x"?b:t.axis==="y"?v:Math.hypot(b,v)};let l=Array.from({length:i},(g,p)=>c(p));const h=Math.max(...l);if(o==="edges"&&(l=l.map(g=>h-g)),o==="random"){const g=e.random??Math.random;l=l.map(()=>g()*h)}const f=t.amount!==void 0?t.amount:(t.each??0)*h,u=t.ease?At(t.ease):void 0,d=u?u.fn??X(u.easing):void 0;return l.map(g=>{const p=h===0?0:g/h;return(d?d(p):p)*f})}const xe=new Set(["duration","delay","ease","repeat","repeatDelay","yoyo","stagger","onComplete","onUpdate","onStart","onRepeat","onReverseComplete","repeatRefresh","keyframes","easeEach","scrollTo","id","immediateRender","overwrite","paused","scrollTrigger","spring"]);function Wt(i){const t={},e={};for(const[n,s]of Object.entries(i))xe.has(n)?t[n]=s:e[n]=s;return{config:t,properties:e}}function jt(i,t){return i===void 0?t:i*1e3}function Pe(i,t){if(i!==void 0)return typeof i=="number"?{each:i*1e3}:tr(i)?{offsets:er(t?.count??0,i,t??{}).map(n=>n*1e3)}:{...i.each!==void 0&&{each:i.each*1e3},...i.amount!==void 0&&{amount:i.amount*1e3},...i.from!==void 0&&{from:i.from}}}const ir={opacity:1,x:0,y:0,z:0,rotate:0,rotateX:0,rotateY:0,rotateZ:0,rotation:0,scale:1,scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,originX:50,originY:50,perspective:0,blur:0,glow:0,clipTop:0,clipRight:0,clipBottom:0,clipLeft:0};function Ji(i){return ir[i]}function nr(i){const t=typeof i=="string"||Array.isArray(i)?{path:i}:i;if(!t||typeof t.path!="string"&&!Array.isArray(t.path))throw new Error("gsap-compat: motionPath needs a path — SVG path data or an array of { x, y } points.");let e;if(Array.isArray(t.path))e=zi(t.path,{curviness:t.curviness});else if(at(t.path))e=t.path;else throw new Error(`gsap-compat: motionPath "${t.path}" is not path data. Selectors and elements are resolved by live.to(); timeline() and tf need the path data itself.`);const n={pathData:e};return t.autoRotate!==void 0&&t.autoRotate!==!1&&(n.autoRotate=!0,typeof t.autoRotate=="number"&&(n.rotateOffset=t.autoRotate)),t.matrix&&(n.matrix=t.matrix),{config:n,start:t.start??0,end:t.end??1}}function sr(i){const t=typeof i=="string"||Array.isArray(i)?{path:i}:{...i};return{...t,start:t.end??1,end:t.start??0}}function tn(i){return typeof i=="object"&&i!==null&&"shape"in i?i.shape:i}function rr(i){if(i.morphSVG===void 0)return i;const{morphSVG:t,...e}=i,n=tn(t);if(typeof n!="string"||!at(n))throw new Error(`gsap-compat: morphSVG "${String(n)}" is not path data. Selectors and elements are resolved by live.to(); timeline() and tf need the path data itself.`);return{...e,d:n}}function or(i,t){if(i===!0)return[0,t];if(i===!1)return[0,0];if(typeof i=="number")return[0,en(i,t)];const e=i.trim().split(/[\s,]+/).filter(Boolean),n=o=>{const a=Number.parseFloat(o);if(Number.isNaN(a))throw new Error(`gsap-compat: drawSVG "${i}" is not a length or percentage`);return en(o.endsWith("%")?t*a/100:a,t)};if(e.length===0)return[0,t];if(e.length===1)return[0,n(e[0])];const s=n(e[0]),r=n(e[1]);return s<=r?[s,r]:[r,s]}function ar(i,t){const[e,n]=or(i,t);return{strokeDasharray:[n-e,t],strokeDashoffset:-e}}function cr(i,t){if(i.drawSVG===void 0)return i;const{drawSVG:e,...n}=i;return{...n,...ar(e,t)}}function lr(i){if(i.drawSVG!==void 0)throw new Error("gsap-compat: drawSVG needs the stroke length from the page. Use live.to(), or animate strokeDasharray / strokeDashoffset directly (see drawSvgProperties).");return i}function en(i,t){return Math.max(0,Math.min(t,i))}function hr(i){let t=2166136261;for(let e=0;e<i.length;e++)t=Math.imul(t^i.charCodeAt(e),16777619);return t>>>0}function ur(i,t,e){if(i.scrambleText!==void 0){const n=i.scrambleText,s=typeof n=="string"?{text:n}:n;if(typeof s?.text!="string")throw new Error("gsap-compat: scrambleText needs the text to end on — a string, or { text }.");const r=s.revealDelay&&e>0?s.revealDelay*1e3/e:void 0;return{to:s.text,mode:"scramble",...s.chars!==void 0&&{chars:s.chars},...s.speed!==void 0&&{refreshRate:20*s.speed},...r!==void 0&&{revealDelay:Math.min(r,.999)},...s.tweenLength!==void 0&&{tweenLength:s.tweenLength},...s.rightToLeft!==void 0&&{rightToLeft:s.rightToLeft},seed:s.seed??hr(`${t}|${s.text}`)}}if(i.text!==void 0){const n=i.text,s=typeof n=="string"?{value:n}:n;if(typeof s?.value!="string")throw new Error("gsap-compat: text needs the text to end on — a string, or { value }.");return{to:s.value,mode:"type",...s.rightToLeft!==void 0&&{rightToLeft:s.rightToLeft}}}}function Ee(i){return Math.max(.1,i/25)}function fr(i,t){const e=typeof t=="number"?{velocity:t}:t;if(typeof e?.velocity!="number"||!Number.isFinite(e.velocity))throw new Error("gsap-compat: inertia needs a velocity for each property — a number, or { velocity }.");const n=e.friction??(e.resistance!==void 0?Ee(e.resistance):void 0),s={from:i,velocity:e.velocity,...n!==void 0&&{friction:n},...e.min!==void 0&&{min:e.min},...e.max!==void 0&&{max:e.max}};return typeof e.end=="function"?s.end=[e.end(vt(s))]:e.end!==void 0&&(s.end=Array.isArray(e.end)?[...e.end]:e.end),s}function dr(i){const t=i===!0?{}:typeof i=="string"?{preset:i}:i;if(t.preset!==void 0&&!(t.preset in $t))throw new Error(`gsap-compat: unknown spring preset "${t.preset}" — use one of ${Object.keys($t).join(", ")}`);return{...t.preset?$t[t.preset]:{},...t.stiffness!==void 0&&{stiffness:t.stiffness},...t.damping!==void 0&&{damping:t.damping},...t.mass!==void 0&&{mass:t.mass},...t.restDelta!==void 0&&{restDelta:t.restDelta}}}function pr(i,t){if(i===!0||typeof i=="string")return;const e=i.velocity;return typeof e=="number"?e:e?.[t]}class J{timeline;options;cursor=0;fallbackRandom=Ae(1);previousStart=0;previousEnd=0;labels=new Map;trackCounter=0;lastValues=new Map;constructor(t={}){this.options=t,this.timeline=new ve({id:t.id??"gsap-compat",name:t.name,config:{...t.repeat!==void 0&&{loop:t.repeat},...t.yoyo!==void 0&&{alternate:t.yoyo},...t.repeatDelay!==void 0&&{repeatDelay:t.repeatDelay*1e3},...t.timeScale!==void 0&&{speed:t.timeScale}}})}to(t,e,n){return this.build(t,void 0,Pt(e),n)}from(t,e,n){const{config:s,properties:r}=Wt(Pt(e)),{motionPath:o,text:a,scrambleText:c,...l}=r,h=this.targetsOf(t)[0],f={...s};for(const g of Object.keys(l))f[g]=this.resolveStart(h,g);o!==void 0&&(f.motionPath=sr(o));const u={},d=String(this.resolveStart(h,"text"));return a!==void 0&&(u.text=_e(a),f.text=typeof a=="object"?{...a,value:d}:d),c!==void 0&&(u.text=_e(c),f.scrambleText=typeof c=="object"?{...c,text:d}:d),this.build(t,{...l,...u},f,n)}fromTo(t,e,n,s){const{properties:r}=Wt(Pt(e));return this.build(t,r,Pt(n),s)}set(t,e,n){return this.build(t,void 0,{...Pt(e),duration:0},n)}get lastStart(){return this.previousStart}get lastEnd(){return this.previousEnd}addEvent(t){const e=Math.max(0,xt(t,this.context()));return this.previousStart=e,this.previousEnd=e,this.cursor=Math.max(this.cursor,e),e}timeOf(t){return xt(t,this.context())}addLabel(t,e){return this.labels.set(t,xt(e,this.context())),this}labelTimes(){return[...this.labels.values()].sort((t,e)=>t-e)}labelTime(t){return this.labels.get(t)}add(t,e){const n=xt(e,this.context());for(const r of t.timeline.tracks){if(!("keyframes"in r))continue;const o=Xt({...r,id:this.nextTrackId(`nested-${r.id}`),keyframes:r.keyframes.map(a=>({...a,time:a.time+n}))});this.timeline.addTrack(o)}const s=n+t.timeline.duration;return this.previousStart=n,this.previousEnd=s,this.cursor=Math.max(this.cursor,s),this}play(){return this.timeline.play(),this}pause(){return this.timeline.pause(),this}restart(){return this.timeline.stop(),this.timeline.play(),this}reverse(){return this.timeline.reverse(),this}kill(){return this.timeline.removeTracks(),this}reset(){return this.timeline.removeTracks(),this.cursor=0,this.previousStart=0,this.previousEnd=0,this.labels.clear(),this.lastValues.clear(),this.trackCounter=0,this}seek(t){if(typeof t=="string"){const e=this.labels.get(t);return e!==void 0&&this.timeline.seek(e),this}return this.timeline.seek(t*1e3),this}progress(t){const e=this.timeline.duration;return t!==void 0&&e>0&&this.timeline.seek(t*e),e>0?this.timeline.currentTime/e:0}timeScale(t){return t!==void 0&&(this.timeline.speed=t),this.timeline.speed}duration(){return this.timeline.duration/1e3}tick(t){return this.timeline.tick(t),this}toDefinition(){return this.timeline.toDefinition()}build(t,e,n,s){const{config:r,properties:o}=Wt(n),{motionPath:a,text:c,scrambleText:l,inertia:h,...f}=o,u=this.targetsOf(t),d=xt(s,this.context()),g=jt(r.delay,0),p=jt(r.duration,500),y=Pe(r.stagger,{count:u.length,columnsFromLayout:this.options.layoutColumns?()=>this.options.layoutColumns(u):void 0,random:this.options.random??this.fallbackRandom}),b=this.easingFor(r.ease),v=[],w=r.spring;let S=0,T=!1;for(const[x,_]of Object.entries(f)){const M=_;let E=e?.[x]!==void 0?e[x]:this.resolveStart(u[0],x);if(typeof E!=typeof M&&(this.warn(`no usable start value for "${x}" on "${u[0]}" — it will snap to ${String(M)}. Use fromTo() to animate it.`),E=M),w!==void 0&&typeof E=="number"&&typeof M=="number"){const I={...dr(w),from:E,to:M,velocity:pr(w,x)??this.options.startVelocity?.(u[0],x)??0},Q=this.nextTrackId(`${u[0]}-${x}-spring`),et={id:Q,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:x,kind:"spring",spring:I,delay:d+g};this.timeline.addTrack(et),v.push(Q),S=Math.max(S,He(I));for(const L of u)this.lastValues.set(`${L}|${x}`,M);continue}T=!0;const R=this.keyframesFor(E,M,p,b,r.ease),F=this.nextTrackId(`${u[0]}-${x}`);this.timeline.addTrack(Xt({id:F,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:x,delay:d+g,keyframes:R})),v.push(F);for(const I of u)this.lastValues.set(`${I}|${x}`,M)}const k=ur({text:c,scrambleText:l},u[0],p);if(k){const x=e?.text??e?.scrambleText,_=x!==void 0?_e(x):this.resolveStart(u[0],"text"),M=this.nextTrackId(`${u[0]}-text`),E={id:M,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:"text",textConfig:{from:typeof _=="string"?_:String(_??""),...k},delay:d+g,keyframes:this.keyframesFor(0,1,p,b,r.ease)};this.timeline.addTrack(E),v.push(M);for(const R of u)this.lastValues.set(`${R}|text`,k.to)}if(a!==void 0){const{config:x,start:_,end:M}=nr(a),E=this.nextTrackId(`${u[0]}-motionPath`),R={id:E,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:"motionPath",motionPathConfig:x,delay:d+g,keyframes:this.keyframesFor(_,M,p,b,r.ease)};this.timeline.addTrack(R),v.push(E)}if(h!==void 0)for(const[x,_]of Object.entries(h)){const M=this.resolveStart(u[0],x);if(typeof M!="number"){this.warn(`inertia on "${x}" needs a numeric start value; skipped`);continue}const E=fr(M,_),R=this.nextTrackId(`${u[0]}-${x}-inertia`),F={id:R,target:u[0],...u.length>1&&{targets:u},...y&&u.length>1&&{stagger:y},property:x,kind:"inertia",inertia:E,delay:d+g};this.timeline.addTrack(F),v.push(R),S=Math.max(S,rt(E));for(const I of u)this.lastValues.set(`${I}|${x}`,st(E))}const D=((h!==void 0||w!==void 0)&&!T&&!k&&a===void 0?S:Math.max(p,S))+(y&&u.length>1?yt(u.length,y):0),P=d+g+D;return this.previousStart=d+g,this.previousEnd=P,this.cursor=Math.max(this.cursor,P),{trackIds:v,start:d+g,end:P,kill:()=>{for(const x of v)this.timeline.removeTrack(x)}}}keyframesFor(t,e,n,s,r){const o={time:0,value:t};if(n<=0)return[{time:0,value:e}];const a=typeof r=="string"?At(r):void 0;if(a?.requiresBaking==="custom"||this.options.bakeEases&&mt(s)){const l=a?.fn??X(s);return[o,...ge(o,{time:n,value:e},l,{intervalMs:this.options.bakeIntervalMs})]}return[o,{time:n,value:e,...s&&{easing:s}}]}resolveStart(t,e){const n=this.lastValues.get(`${t}|${e}`);if(n!==void 0)return n;const s=this.options.startValue?.(t,e);if(s!==void 0)return s;const r=this.options.defaults?.[e];if(r!==void 0)return r;if(e==="text")return"";if(e==="d")throw new Error(`gsap-compat: no starting shape for "${t}". Use fromTo({ d: … }, { morphSVG: … }), or live.to(), which reads the element's current shape.`);const o=Ji(e);return o!==void 0?(this.warn(`no start value for "${e}" on "${t}" — using the static default ${o}. GSAP would read the live DOM here; tinyfly cannot, so pass an explicit fromTo() or a defaults map.`),o):(this.warn(`no start value or default for "${e}" on "${t}" — using 0`),0)}easingFor(t){if(t!==void 0){if(typeof t=="string")return At(t).easing;if(typeof t=="function")throw new Error('gsap-compat: function eases cannot be serialized. Use a named ease, or a cubic-bezier via { type: "cubic-bezier", points: [...] }.');return t}}targetsOf(t){return Array.isArray(t)?t:[t]}context(){return{cursor:this.cursor,previousStart:this.previousStart,previousEnd:this.previousEnd,labels:this.labels,scale:1e3}}nextTrackId(t){return this.trackCounter+=1,`${t}-${this.trackCounter}`}warn(t){this.options.onWarning?.(`gsap-compat: ${t}`)}}function _e(i){if(typeof i=="string")return i;if(i&&typeof i=="object"){const t=i;return String(t.value??t.text??"")}return String(i??"")}function mr(i){return new J(i)}function Pt(i){return lr(rr(i))}const gr=new Set(["blur","brightness","glow","glowColor","shadowX","shadowY","shadowBlur","shadowColor"]),yr="#ffffff",br="rgba(0, 0, 0, 0.5)";function vr(i){const t=[];if(i.blur!==void 0&&t.push(`blur(${Math.max(0,i.blur)}px)`),i.brightness!==void 0&&t.push(`brightness(${Math.max(0,i.brightness)})`),i.glow!==void 0&&t.push(`drop-shadow(0 0 ${Math.max(0,i.glow)}px ${i.glowColor??yr})`),i.shadowX!==void 0||i.shadowY!==void 0||i.shadowBlur!==void 0){const e=i.shadowX??0,n=i.shadowY??0,s=Math.max(0,i.shadowBlur??0);t.push(`drop-shadow(${e}px ${n}px ${s}px ${i.shadowColor??br})`)}return t.length>0?t.join(" "):null}function wr(i,t){const e=i.childNodes.length===1?i.firstChild:null;if(e&&e.nodeType===3){const n=e;n.data!==t&&(n.data=t);return}i.textContent!==t&&(i.textContent=t)}function Tr(i){if(!("ownerSVGElement"in i))return;const t=i.style;!t||t.transformBox||(t.transformBox="fill-box",t.transformOrigin||(t.transformOrigin="50% 50%"))}const nn=new Set(["width","height","top","right","bottom","left","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","borderRadius","borderWidth","fontSize","lineHeight","letterSpacing","outlineWidth","gap","rowGap","columnGap"]),Sr=new Set(["x","y","z","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skewX","skewY","motionPathX","motionPathY","motionPathRotate"]),kr=new Set(["originX","originY"]),Mr=new Set(["clipTop","clipRight","clipBottom","clipLeft"]),Ar={fill:"backgroundColor",stroke:"borderColor",strokeWidth:"borderWidth",color:"color",backgroundColor:"backgroundColor",borderColor:"borderColor"},sn={fill:"fill",stroke:"stroke",strokeWidth:"strokeWidth",strokeDasharray:"strokeDasharray",strokeDashoffset:"strokeDashoffset",fillOpacity:"fillOpacity",strokeOpacity:"strokeOpacity"},xr="http://www.w3.org/2000/svg";class tt{targets=new Map;registerTarget(t,e){this.targets.set(t,e)}unregisterTarget(t){this.targets.delete(t)}getTarget(t){return this.targets.get(t)}clearTargets(){this.targets.clear()}applyState(t){for(const[e,n]of t.values){const s=this.targets.get(e);s&&this.applyProperties(s,n)}}applyProperties(t,e){const n=[];let s=null,r=null,o=null;const a=e.has("motionPathX"),c=e.has("motionPathY"),l=e.has("motionPathRotate");for(const[u,d]of e)if(!(u==="x"&&a)&&!(u==="y"&&c)&&!((u==="rotate"||u==="rotateZ")&&l)){if(Sr.has(u)){const g=this.buildTransformPart(u,d);g&&n.push(g)}else if(kr.has(u))typeof d=="number"&&((s??={})[u]=d);else if(Mr.has(u))typeof d=="number"&&((r??={})[u]=d);else if(gr.has(u))(o??={})[u]=d;else if(u!=="perspective"){if(u!=="shine")if(u==="text"&&typeof d=="string")wr(t,d);else if(u==="d"&&typeof d=="string"){const g=t;(g.tagName?.toLowerCase()==="path"?g:g.querySelector?.("path"))?.setAttribute?.("d",d)}else this.applyStyleProperty(t,u,d)}}const h=e.get("shine");typeof h=="number"&&this.applyShine(t,h);const f=e.get("perspective");if(typeof f=="number"&&n.unshift(`perspective(${f}px)`),n.length>0&&(t.style.transform=n.join(" "),Tr(t)),s){const u=s.originX??50,d=s.originY??50;t.style.transformOrigin=`${u}% ${d}%`}if(r){const u=r.clipTop??0,d=r.clipRight??0,g=r.clipBottom??0,p=r.clipLeft??0;t.style.clipPath=`inset(${u}% ${d}% ${g}% ${p}%)`}if(o){const u=vr(o);u&&(t.style.filter=u)}}buildTransformPart(t,e){if(typeof e!="number")return null;switch(t){case"x":case"motionPathX":return`translateX(${e}px)`;case"y":case"motionPathY":return`translateY(${e}px)`;case"z":return`translateZ(${e}px)`;case"rotate":case"rotateZ":case"motionPathRotate":return`rotate(${e}deg)`;case"rotateX":return`rotateX(${e}deg)`;case"rotateY":return`rotateY(${e}deg)`;case"scale":return`scale(${e})`;case"scaleX":return`scaleX(${e})`;case"scaleY":return`scaleY(${e})`;case"scaleZ":return`scaleZ(${e})`;case"skewX":return`skewX(${e}deg)`;case"skewY":return`skewY(${e}deg)`;default:return null}}applyShine(t,e){t.dataset.shineBase||(t.dataset.shineBase=t.style.color||"currentColor");const n=t.dataset.shineBase,s=-20+e*140,r=t.style;r.color="transparent",r.backgroundImage=`linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%), linear-gradient(${n}, ${n})`,r.backgroundSize="250% 100%, 100% 100%",r.backgroundPosition=`${s}% 0, 0 0`,r.backgroundRepeat="no-repeat",r.webkitBackgroundClip="text",r.backgroundClip="text"}applyStyleProperty(t,e,n){let s;if(t.namespaceURI===xr&&e in sn){const a=Array.isArray(n)?n.join(", "):String(n);t.style[sn[e]]=a;return}else e==="fill"&&t.dataset?.elementType==="text"?s="color":s=Ar[e]??e;let o;typeof n=="number"?nn.has(e)||nn.has(s)?o=`${n}px`:o=String(n):Array.isArray(n)?o=n.join(", "):o=n,t.style[s]=o}}const Pr={request:i=>requestAnimationFrame(i),cancel:i=>cancelAnimationFrame(i)};class rn{adapter=new tt;scheduler;rootOption;names=new WeakMap;elements=new Map;nameCounter=0;objectNames=new WeakMap;objects=new Map;owned=new Set;currentCollector;tickerCallbacks=new Set;tickerTime=0;tickerFrame=0;liveTimelines=new Set;utils=Ks();active=new Map;applied=new Map;dirty=new Set;frameId=null;lastTimestamp=null;destroyed=!1;constructor(t={}){this.scheduler=t.scheduler??Pr,this.rootOption=t.root}get root(){return this.rootOption??document}resolveTargets(t){const e=[];for(const n of this.targetsOf(t)){const s=this.nameFor(n);Ce(n)&&this.currentCollector?.touch(n,s),e.push(s)}return e}query(t){return this.selectorRoot.querySelector(t)}get collector(){return this.currentCollector}setCollector(t){this.currentCollector=t}forget(t){this.applied.delete(t),this.dirty.delete(t)}get selectorRoot(){return this.currentCollector?.scope??this.root}elementFor(t){return this.elements.get(t)}objectFor(t){return this.objects.get(t)}appliedValue(t,e){return this.applied.get(t)?.get(e)}velocityOf(t,e){for(const s of[...this.active.keys()].reverse()){if(s.getTracks({target:t,property:e}).length===0)continue;const r=s.currentTime;if(r<4)return 0;const o=s.getStateAtTime(r).values.get(t)?.get(e),a=s.getStateAtTime(r-4).values.get(t)?.get(e);if(typeof o!="number"||typeof a!="number")return;const c=(o-a)/4;return(s.direction==="reverse"?-c:c)*1e3}}ticker={add:t=>{this.destroyed||(this.tickerCallbacks.size===0&&(this.tickerTime=0,this.tickerFrame=0),this.tickerCallbacks.add(t),this.currentCollector?.track({revert:()=>this.ticker.remove(t)}),this.startLoop())},remove:t=>{this.tickerCallbacks.delete(t),this.running||this.stopLoop()}};activate(t,e={}){this.destroyed||(t.onUpdate=n=>this.write(n),this.active.delete(t),this.active.set(t,e),this.startLoop())}deactivate(t){this.active.delete(t),this.running||this.stopLoop()}own(t){return this.destroyed?t.destroy():this.owned.add(t),t}destroy(){this.destroyed=!0;for(const t of this.owned)t.destroy();this.owned.clear();for(const t of this.active.keys())t.stop();this.active.clear(),this.stopLoop(),this.adapter.clearTargets(),this.elements.clear(),this.names=new WeakMap,this.objects.clear(),this.objectNames=new WeakMap,this.tickerCallbacks.clear(),this.liveTimelines.clear(),this.applied.clear(),this.dirty.clear()}apply(t,e){if(this.destroyed)return;const n=new Map(Object.entries(e));this.write({values:new Map([[t,n]]),currentTime:0,playbackState:"idle",direction:"forward",loopIteration:0}),this.flush()}render(t){this.destroyed||(this.write(t.getStateAtTime(t.currentTime)),this.flush())}tick(t){const e=[...this.active];for(const[n]of e)n.duration<=0?(this.write(n.getStateAtTime(0)),n.stop()):n.tick(t);this.flush();for(const[n,s]of e)s.onUpdate?.(),n.playbackState!=="playing"&&this.active.get(n)===s&&this.active.delete(n);this.flush(),this.runTicker(t),this.running||this.stopLoop()}get running(){return this.active.size>0||this.tickerCallbacks.size>0}runTicker(t){if(this.tickerCallbacks.size!==0){this.tickerTime+=t,this.tickerFrame+=1;for(const e of[...this.tickerCallbacks])e(this.tickerTime/1e3,t,this.tickerFrame)}}write(t){for(const[e,n]of t.values){let s=this.applied.get(e);s||(s=new Map,this.applied.set(e,s));for(const[r,o]of n)s.set(r,o);this.dirty.add(e)}}flush(){if(this.dirty.size===0)return;const t=new Map;for(const e of this.dirty){const n=this.applied.get(e),s=this.objects.get(e);if(s)for(const[r,o]of n)s[r]=o;else t.set(e,n)}this.dirty.clear(),t.size!==0&&this.adapter.applyState({values:t,currentTime:0,playbackState:"playing",direction:"forward",loopIteration:0})}frame=t=>{this.frameId=null;const e=this.lastTimestamp===null?0:t-this.lastTimestamp;this.lastTimestamp=t,e>0&&this.tick(e),this.running&&this.frameId===null&&(this.frameId=this.scheduler.request(this.frame))};startLoop(){this.frameId===null&&(this.lastTimestamp=null,this.frameId=this.scheduler.request(this.frame))}stopLoop(){this.frameId!==null&&this.scheduler.cancel(this.frameId),this.frameId=null,this.lastTimestamp=null}targetsOf(t){if(typeof t=="string")return Array.from(this.selectorRoot.querySelectorAll(t));if(Ce(t))return[t];if(!Er(t))return[t];const e=[];for(const n of Array.from(t))e.push(...this.targetsOf(n));return e}nameFor(t){return Ce(t)?this.elementName(t):this.objectName(t)}objectName(t){const e=this.objectNames.get(t);if(e)return e;let n;do this.nameCounter+=1,n=`obj-${this.nameCounter}`;while(this.objects.has(n)||this.elements.has(n));return this.objectNames.set(t,n),this.objects.set(n,t),n}elementName(t){const e=this.names.get(t);if(e)return e;let n=t.id?`#${t.id}`:"";if(!n||this.elements.has(n))do this.nameCounter+=1,n=`el-${this.nameCounter}`;while(this.elements.has(n));return this.names.set(t,n),this.elements.set(n,t),this.adapter.registerTarget(n,t),n}}function Ce(i){return typeof i=="object"&&i!==null&&i.nodeType===1}function Er(i){if(Array.isArray(i))return!0;const t=i;return typeof t.length=="number"&&typeof t.item=="function"}function zt(i){const t=i.style;if(!t)return i.getBoundingClientRect();const e=t.transform;t.transform="none";const n=i.getBoundingClientRect();return t.transform=e,n}const on=i=>typeof i=="object"&&i!==null&&i.nodeType===1;function _r(i){const t={};for(const e of Array.from(i.attributes))t[e.name]=e.value;return t}function Cr(i){const t=i.getScreenCTM?.();if(t)return[t.a,t.b,t.c,t.d,t.e,t.f];const e=i.getBoundingClientRect();return[1,0,0,1,e.left,e.top]}function Rr(i,t){const e=typeof i=="string"||Array.isArray(i)||on(i)?{path:i}:i,{align:n,alignOrigin:s,path:r,...o}=e,a=k=>{const A=on(k)?k:t.query(k);return A||t.warn(`gsap-compat: motionPath could not find "${String(k)}"`),A};let c=null,l="";if(Array.isArray(r)||typeof r=="string"&&at(r))l=r;else{c=a(r);const k=c&&Vt({tag:c.localName,attributes:_r(c)});c&&!k&&t.warn(`gsap-compat: motionPath element <${c.localName}> has no path geometry`),l=k??""}const h={...o,path:l};if(n===void 0||n===!1)return h;const f=n===!0?c:a(n);if(!f)return n===!0&&t.warn("gsap-compat: motionPath align: true needs the path to be an element"),h;const u=t.targets[0];if(!u)return h;const[d,g,p,y,b,v]=Cr(f),w=zt(u),[S,T]=s??[.5,.5];for(const k of t.targets.slice(1)){const A=zt(k);if(Math.abs(A.left-w.left)>.5||Math.abs(A.top-w.top)>.5){t.warn("gsap-compat: motionPath align measures the first target; the others are laid out elsewhere");break}}return h.matrix=[d,g,p,y,b-w.left-S*w.width,v-w.top-T*w.height],h}const an=i=>typeof i=="object"&&i!==null&&i.nodeType===1;function cn(i){const t={};for(const e of Array.from(i.attributes))t[e.name]=e.value;return t}function ln(i){if(!i)return null;const t=Vt({tag:i.localName,attributes:cn(i)});return t||(i.querySelector("path")?.getAttribute("d")??null)}function Ir(i,t,e){const n=tn(i);if(typeof n=="string"&&at(n))return n;const s=an(n)?n:typeof n=="string"?t(n):null,r=ln(s);return r||(e(`gsap-compat: morphSVG could not find a shape for "${String(n)}"`),"")}const Lr=new Set(["cx","cy","r","rx","ry","x","y","width","height","x1","y1","x2","y2","points"]);function Fr(i,t=document){return(typeof i=="string"?Array.from(t.querySelectorAll(i)):an(i)?[i]:Array.from(i)).map(n=>{if(n.localName==="path")return n;const s=Vt({tag:n.localName,attributes:cn(n)});if(!s||!n.parentNode)return n;const r=n.ownerDocument.createElementNS("http://www.w3.org/2000/svg","path");for(const o of Array.from(n.attributes))Lr.has(o.name)||r.setAttribute(o.name,o.value);return r.setAttribute("d",s),n.parentNode.replaceChild(r,n),r})}const hn=.3;class un{options;target;running=!1;dragging=!1;passedTolerance=!1;lastX=0;lastY=0;startX=0;startY=0;velocityX=0;velocityY=0;lastTime=0;constructor(t){this.options=t,this.target=t.target}start(){if(this.running)return;this.running=!0;const t=this.options.type??["pointer","touch"];t.includes("pointer")&&(this.target.addEventListener("pointerdown",this.onPointerDown),this.target.addEventListener("pointermove",this.onPointerMove),this.target.addEventListener("pointerup",this.onPointerUp),this.target.addEventListener("pointercancel",this.onPointerUp)),t.includes("touch")&&(this.target.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.target.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.target.addEventListener("touchend",this.onTouchEnd)),t.includes("wheel")&&this.target.addEventListener("wheel",this.onWheel,{passive:!1})}stop(){this.running&&(this.running=!1,this.target.removeEventListener("pointerdown",this.onPointerDown),this.target.removeEventListener("pointermove",this.onPointerMove),this.target.removeEventListener("pointerup",this.onPointerUp),this.target.removeEventListener("pointercancel",this.onPointerUp),this.target.removeEventListener("touchstart",this.onTouchStart),this.target.removeEventListener("touchmove",this.onTouchMove),this.target.removeEventListener("touchend",this.onTouchEnd),this.target.removeEventListener("wheel",this.onWheel))}destroy(){this.stop()}get velocity(){return{x:this.velocityX,y:this.velocityY}}begin(t,e,n){this.dragging=!0,this.passedTolerance=!1,this.startX=t,this.startY=e,this.lastX=t,this.lastY=e,this.velocityX=0,this.velocityY=0,this.lastTime=fn(),this.options.onPress?.(this.stateFrom(0,0,n))}move(t,e,n){if(!this.dragging)return;const s=t-this.lastX,r=e-this.lastY;this.lastX=t,this.lastY=e;const o=t-this.startX,a=e-this.startY,c=this.options.tolerance??3;if(!this.passedTolerance){if(Math.hypot(o,a)<c)return;this.passedTolerance=!0}this.updateVelocity(s,r),this.options.preventDefault!==!1&&n.cancelable&&n.preventDefault(),this.options.onMove?.(this.stateFrom(s,r,n))}end(t){this.dragging&&(this.dragging=!1,this.options.onRelease?.(this.stateFrom(0,0,t)))}updateVelocity(t,e){const n=fn(),s=Math.max(1,n-this.lastTime);this.lastTime=n;const r=t/s*1e3,o=e/s*1e3;this.velocityX+=(r-this.velocityX)*hn,this.velocityY+=(o-this.velocityY)*hn}stateFrom(t,e,n){return{deltaX:t,deltaY:e,velocityX:this.velocityX,velocityY:this.velocityY,totalX:this.lastX-this.startX,totalY:this.lastY-this.startY,isDragging:this.dragging,event:n}}onPointerDown=t=>{const e=t,n=this.target;if(typeof e.pointerId=="number"&&typeof n.setPointerCapture=="function")try{n.setPointerCapture(e.pointerId)}catch{}this.begin(e.clientX,e.clientY,t)};onPointerMove=t=>{const e=t;this.move(e.clientX,e.clientY,t)};onPointerUp=t=>this.end(t);onTouchStart=t=>{const e=t.touches[0];e&&this.begin(e.clientX,e.clientY,t)};onTouchMove=t=>{const e=t.touches[0];e&&this.move(e.clientX,e.clientY,t)};onTouchEnd=t=>this.end(t);onWheel=t=>{const e=t;this.options.preventDefault!==!1&&e.cancelable&&e.preventDefault(),this.updateVelocity(e.deltaX,e.deltaY),this.options.onMove?.({deltaX:e.deltaX,deltaY:e.deltaY,velocityX:this.velocityX,velocityY:this.velocityY,totalX:0,totalY:0,isDragging:!1,event:t})}}function fn(){return typeof performance<"u"?performance.now():Date.now()}function dn(i,t,e){let n={delta:0,line:null},s=e;for(const r of i)for(const o of t){const a=Math.abs(o-r);a<=s&&(s=a,n={delta:o-r,line:o})}return n}function pn(i,t){return t<=0?[]:i.map(e=>Math.round(e/t)*t)}class Re{options;observer;x;y;originX=0;originY=0;snappedX=null;snappedY=null;constructor(t){this.options=t,this.x=t.initialX??0,this.y=t.initialY??0,this.observer=new un({target:t.target,onPress:e=>{const n=t.getPosition?.();n&&(this.x=n.x,this.y=n.y),this.originX=this.x,this.originY=this.y,t.onPress?.(e)},onMove:e=>this.handleMove(e),onRelease:e=>t.onRelease?.(e)})}start(){this.observer.start()}stop(){this.observer.stop()}destroy(){this.observer.destroy()}get position(){return{x:this.x,y:this.y}}get velocity(){return this.observer.velocity}setPosition(t,e){const n=this.options.axis??"both";this.x=n==="y"?this.x:this.applyConstraints(t,"x"),this.y=n==="x"?this.y:this.applyConstraints(e,"y")}get snapLines(){return{x:this.snappedX,y:this.snappedY}}snapThreshold(){if(this.options.snapThreshold!==void 0)return this.options.snapThreshold;const t=this.options.snap??0;return t>0?t/2:8}handleMove(t){this.setPosition(this.originX+t.totalX,this.originY+t.totalY),this.options.mode==="scrub"&&this.scrub(),this.options.onDrag?.(this.position,t),this.options.onSnap?.(this.snapLines)}scrub(){const t=this.options.timeline;if(!t)return;const e=t.duration;if(e<=0)return;const n=this.options.scrubDistance??500;if(n===0)return;const s=(this.options.axis??"both")==="y"?this.y:this.x,r=$r(s/n);t.pause(),t.seek(r*e)}applyConstraints(t,e){let n=t;const s=[...pn([n],this.options.snap??0),...(e==="x"?this.options.snapLinesX:this.options.snapLinesY)??[]],r=dn([n],s,this.snapThreshold());n+=r.delta,e==="x"?this.snappedX=r.line:this.snappedY=r.line;const o=this.options.bounds;if(o){const a=e==="x"?o.minX:o.minY,c=e==="x"?o.maxX:o.maxY;a!==void 0&&(n=Math.max(a,n)),c!==void 0&&(n=Math.min(c,n))}return n}}function $r(i){return i<0?0:i>1?1:i}function Dr(i){const t=new Re(i);return t.start(),t}const Or={x:"x",y:"y","x,y":"both"},Ie=i=>typeof i=="object"&&i!==null&&i.nodeType===1;function mn(i,t){const e=zt(i),n=t.getBoundingClientRect();return{minX:n.left-e.left,maxX:n.right-e.right,minY:n.top-e.top,maxY:n.bottom-e.bottom}}function gn(i){return Array.isArray(i)?[...i]:i}function Nr(i,t,e,n={}){const[s]=t.resolveTargets(e),r=s?t.elementFor(s):void 0;if(!s||!r)throw new Error(`gsap-compat: live.draggable could not find ${String(e)}`);if(n.type==="rotation")return Br(i,t,s,r,n);const o=Or[n.type??"x,y"],a=()=>{const p=t.appliedValue(s,"x"),y=t.appliedValue(s,"y");return{x:typeof p=="number"?p:0,y:typeof y=="number"?y:0}},c=typeof n.bounds=="string"?t.query(n.bounds):Ie(n.bounds)?n.bounds:null,h={bounds:(!c&&n.bounds&&!Ie(n.bounds)?n.bounds:void 0)??(c?mn(r,c):void 0)};let f=null;const u=()=>{f?.kill(),f=null},d=p=>{const y=n.inertia===!0?{}:n.inertia,b=y.friction??(y.resistance!==void 0?Ee(y.resistance):4),v=a(),w=h.bounds??{};let S,T;const k=y.end;if(Array.isArray(k)){const C=vt({from:v.x,velocity:o==="y"?0:p.x,friction:b}),D=vt({from:v.y,velocity:o==="x"?0:p.y,friction:b});let P=k[0];for(const x of k)Math.hypot(x.x-C,x.y-D)<Math.hypot(P.x-C,P.y-D)&&(P=x);P&&(S=[P.x],T=[P.y])}else typeof k=="number"?(S=k,T=k):k&&(S=gn(k.x),T=gn(k.y));const A={};o!=="y"&&(A.x={velocity:p.x,friction:b,min:w.minX,max:w.maxX,end:S}),o!=="x"&&(A.y={velocity:p.y,friction:b,min:w.minY,max:w.maxY,end:T}),f=i.to(r,{inertia:A,onComplete:()=>n.onThrowComplete?.()})},g=new Re({target:r,axis:o,snap:n.snap,get bounds(){return h.bounds},getPosition:a,onPress:()=>{u(),c&&(h.bounds=mn(r,c)),n.onPress?.()},onDrag:p=>{t.apply(s,o==="x"?{x:p.x}:o==="y"?{y:p.y}:{x:p.x,y:p.y}),n.onDrag?.(p)},onRelease:()=>{const p=g.velocity;n.onRelease?.(p),n.inertia&&d(p)}});return g.start(),{draggable:g,get position(){return a()},get rotation(){const p=t.appliedValue(s,"rotate");return typeof p=="number"?p:0},destroy(){u(),g.destroy()}}}function Br(i,t,e,n,s){const r=typeof s.bounds=="object"&&s.bounds!==null&&!Ie(s.bounds)?s.bounds:{},o=()=>{const w=t.appliedValue(e,"rotate");return typeof w=="number"?w:0},a=w=>Math.min(r.maxRotation??1/0,Math.max(r.minRotation??-1/0,w));let c=null,l=!1,h,f={x:0,y:0},u=0,d=0,g=[];const p=w=>Math.atan2(w.clientY-f.y,w.clientX-f.x)*180/Math.PI,y=w=>{if(l)return;c?.kill(),c=null,l=!0,h=w.pointerId,n.setPointerCapture?.(w.pointerId);const S=n.getBoundingClientRect();f={x:S.left+S.width/2,y:S.top+S.height/2},u=p(w),d=o(),g=[{time:performance.now(),rotation:d}],s.onPress?.()},b=w=>{if(!l||w.pointerId!==h)return;const S=p(w);let T=S-u;T>180&&(T-=360),T<-180&&(T+=360),u=S,d+=T;let k=a(d);s.snap&&(k=a(Math.round(k/s.snap)*s.snap)),t.apply(e,{rotate:k});const A=performance.now();for(g.push({time:A,rotation:k});g.length>2&&A-g[0].time>100;)g.shift();const C={x:0,y:0};s.onDrag?.(C)},v=w=>{if(!l||w.pointerId!==h)return;l=!1;const S=g[0],T=g[g.length-1],k=S&&T?(T.time-S.time)/1e3:0,A=k>0?(T.rotation-S.rotation)/k:0;if(s.onRelease?.({x:A,y:0}),!s.inertia)return;const C=s.inertia===!0?{}:s.inertia,D=C.friction??(C.resistance!==void 0?Ee(C.resistance):4),P=typeof C.end=="number"||Array.isArray(C.end)?C.end:void 0;c=i.to(n,{inertia:{rotate:{velocity:A,friction:D,min:r.minRotation,max:r.maxRotation,end:Array.isArray(P)?P.filter(x=>typeof x=="number"):P}},onComplete:()=>s.onThrowComplete?.()})};return n.addEventListener("pointerdown",y),n.addEventListener("pointermove",b),n.addEventListener("pointerup",v),n.addEventListener("pointercancel",v),n.style.touchAction="none",{draggable:void 0,position:{x:0,y:0},get rotation(){return o()},destroy(){c?.kill(),n.removeEventListener("pointerdown",y),n.removeEventListener("pointermove",b),n.removeEventListener("pointerup",v),n.removeEventListener("pointercancel",v)}}}const qr={opacity:0,scale:.6};function Xr(i){const t=i.getBoundingClientRect();return t.width===0&&t.height===0?null:{cx:t.left+t.width/2,cy:t.top+t.height/2,width:t.width,height:t.height}}function yn(i){const t=zt(i);return t.width===0&&t.height===0?null:{cx:t.left+t.width/2,cy:t.top+t.height/2,width:t.width,height:t.height}}function Le(i,t){const n=i.resolveTargets(t).map(o=>i.elementFor(o)).filter(o=>!!o),s=new Map,r=new Map;for(const o of n){const a=Xr(o);s.set(o,a);const c=bn(o);a&&c!==void 0&&!r.has(c)&&r.set(c,{element:o,box:a})}return{elements:n,boxes:s,ids:r}}const Fe=new WeakMap;function $e(i,t,e,n={}){const s=n.duration??.6,r=n.ease??"power2.inOut",o=n.stagger??0,a=n.scale!==!1,c=n.enter===void 0?qr:n.enter,l=new Set(e.elements);if(n.targets!==void 0)for(const d of i.resolveTargets(n.targets)){const g=i.elementFor(d);g&&l.add(g)}const h=[...l].sort((d,g)=>d===g?0:d.compareDocumentPosition(g)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),f=t({onComplete:n.onComplete});let u=0;for(const d of h){const g=yn(d);if(!g)continue;let p=e.boxes.get(d)??null,y;const b=bn(d),v=!p&&b!==void 0?e.ids.get(b):void 0;v&&v.element!==d&&(p=v.box,y=v.element);const[w]=i.resolveTargets(d);Fe.get(d)?.timeline.removeTracks({target:w});const S=u*o;if(!p){if(c===!1)continue;f.fromTo(d,{x:0,y:0,scaleX:1,scaleY:1,...c},{...vn(c),x:0,y:0,scaleX:1,scaleY:1,duration:s,ease:r,delay:S},0),Fe.set(d,f),u++;continue}const T=p.cx-g.cx,k=p.cy-g.cy,A=a?p.width/g.width:1,C=a?p.height/g.height:1;if(!(Math.abs(T)>.5||Math.abs(k)>.5||Math.abs(A-1)>.001||Math.abs(C-1)>.001)){const x=(_,M)=>{const E=i.appliedValue(w,_);return typeof E=="number"&&Math.abs(E-M)>1e-6};(x("x",0)||x("y",0)||x("scaleX",1)||x("scaleY",1))&&f.set(d,{x:0,y:0,scaleX:1,scaleY:1},0);continue}const P=n.fade===!0&&y!==void 0;f.fromTo(d,{x:T,y:k,scaleX:A,scaleY:C,...P&&{opacity:0}},{x:0,y:0,scaleX:1,scaleY:1,...P&&{opacity:1},duration:s,ease:r,delay:S},0),P&&y&&yn(y)&&f.fromTo(y,{opacity:1},{opacity:0,duration:s,ease:r,delay:S},0),Fe.set(d,f),u++}return f}function bn(i){return i.dataset?.flipId}function vn(i){const t={};for(const e of Object.keys(i))t[e]=e==="opacity"||e.startsWith("scale")?1:0;return t}function Yr(i,t={}){const e=new Set((t.type??"chars,words,lines").split(",").map(p=>p.trim())),n={chars:t.charsClass??"char",words:t.wordsClass??"word",lines:t.linesClass??"line"},s=t.aria!==!1,r=i.map(p=>({element:p,html:p.innerHTML,ariaLabel:p.getAttribute("aria-label")}));let o={chars:[],words:[],lines:[],masks:[]},a,c,l=!1;const h=()=>{for(const{element:p,html:y,ariaLabel:b}of r)p.innerHTML=y,b===null?p.removeAttribute("aria-label"):p.setAttribute("aria-label",b)},f=()=>{a&&(a.revert?a.revert():a.kill?.(),a=void 0)},u=()=>{const p={chars:[],words:[],lines:[],masks:[]};for(const{element:y}of r){const b=(y.textContent??"").replace(/\s+/g," ").trim(),v=Vr(y,n.words),w=e.has("chars")?v.flatMap(k=>Ur(k,n.chars)):[],S=e.has("lines")?jr(y,v,n.lines):[];if(s){!y.hasAttribute("aria-label")&&b&&y.setAttribute("aria-label",b);for(const k of v)k.setAttribute("aria-hidden","true")}if(e.has("words"))p.words.push(...v);else for(const k of v)k.removeAttribute("class");p.chars.push(...w),p.lines.push(...S);const T=t.mask==="lines"?S:t.mask==="words"?v:t.mask==="chars"?w:[];for(const k of T)p.masks.push(zr(k,`${n[t.mask]}-mask`))}o=p},d={elements:i,get chars(){return o.chars},get words(){return o.words},get lines(){return o.lines},get masks(){return o.masks},split(){l||(f(),h(),u(),a=t.onSplit?.(d))},revert(){l=!0,c?.disconnect(),f(),h()}};u(),a=t.onSplit?.(d),t.autoSplit&&g();function g(){const p=new Map;let y=!1;const b=()=>{if(y)return;y=!0;const w=()=>{y=!1,d.split()};typeof requestAnimationFrame=="function"?requestAnimationFrame(w):setTimeout(w,0)};if(typeof ResizeObserver=="function"){c=new ResizeObserver(w=>{let S=!1;for(const T of w){const k=Math.round(T.contentRect.width),A=p.get(T.target);p.set(T.target,k),A!==void 0&&A!==k&&(S=!0)}S&&b()});for(const w of i)c.observe(w)}const v=i[0]?.ownerDocument?.fonts;v&&v.status!=="loaded"&&v.ready.then(()=>b())}return d}function Vr(i,t){const e=i.ownerDocument,n=[],s=e.createTreeWalker(i,4),r=[];for(let o=s.nextNode();o;o=s.nextNode())r.push(o);for(const o of r){const a=o.data.match(/\s+|\S+/g)??[];if(a.length===0)continue;const c=e.createDocumentFragment();for(const l of a){if(/^\s/.test(l)){c.appendChild(e.createTextNode(l));continue}const h=e.createElement("span");h.className=t,h.style.display="inline-block",h.textContent=l,c.appendChild(h),n.push(h)}o.replaceWith(c)}return n}function Ur(i,t){const e=i.ownerDocument,n=Wr(i.textContent??"").map(s=>{const r=e.createElement("span");return r.className=t,r.style.display="inline-block",r.textContent=s,r});return i.replaceChildren(...n),n}function Wr(i){const t=Intl.Segmenter;return t?Array.from(new t(void 0,{granularity:"grapheme"}).segment(i),e=>e.segment):Array.from(i)}function jr(i,t,e){const n=i.ownerDocument,s=new Map(t.map(g=>[g,g.getBoundingClientRect()])),r=[],o=g=>{for(const p of Array.from(g.childNodes))p.nodeType===3||s.has(p)||p.tagName==="BR"?r.push(p):o(p)};o(i);const a=[];let c=null,l=0,h=0,f=!1,u=[];const d=()=>{c=n.createElement("span"),c.className=e,c.style.display="block",a.push(c),u=[]};for(const g of r){if(g.tagName==="BR"){f=!0;continue}const p=s.get(g);if(p&&(!c||f||p.top>l+h)&&(d(),l=p.top,h=p.height/2,f=!1),!c)continue;const y=[];for(let w=g.parentNode;w&&w!==i;w=w.parentNode)y.unshift(w);let b=0;for(;b<u.length&&b<y.length&&u[b].original===y[b];)b++;u.length=b;let v=b===0?c:u[b-1].clone;for(const w of y.slice(b)){const S=w.cloneNode(!1);v.appendChild(S),u.push({original:w,clone:S}),v=S}v.appendChild(g)}return i.replaceChildren(...a),a}function zr(i,t){const e=i.ownerDocument.createElement("span");return e.className=t,e.style.display=i.style.display==="block"?"block":"inline-block",e.style.overflow="clip",e.style.paddingBottom="0.12em",e.style.marginBottom="-0.12em",i.replaceWith(e),e.appendChild(i),e}const wn={top:0,left:0,start:0,center:.5,centre:.5,middle:.5,bottom:1,right:1,end:1};function De(i){const t=i.trim().toLowerCase();if(t in wn)return wn[t];if(t.endsWith("%")){const e=Number.parseFloat(t.slice(0,-1));return Number.isNaN(e)?void 0:e/100}}function Oe(i){if(typeof i=="number")return{elementFraction:0,viewportFraction:0,offsetPx:0,absolutePx:i};let t=0;const n=i.replace(/([+-])=\s*(-?[\d.]+)/g,(o,a,c)=>(t+=(a==="-"?-1:1)*Number.parseFloat(c),"")).trim().split(/\s+/).filter(Boolean);if(n.length===1&&/^-?[\d.]+$/.test(n[0]))return{elementFraction:0,viewportFraction:0,offsetPx:0,absolutePx:Number.parseFloat(n[0])+t};const s=n[0]!==void 0?De(n[0]):void 0,r=n[1]!==void 0?De(n[1]):void 0;return{elementFraction:s??0,viewportFraction:r??0,offsetPx:t}}function ht(i,t,e){const n=Oe(e),s=n.absolutePx!==void 0?i.top+n.absolutePx:i.top+i.height*n.elementFraction,r=t*n.viewportFraction;return s-r+n.offsetPx}function Hr(i,t,e,n){const s=ht(i,t,e),o=ht(i,t,n)-s;return o<=0?s<=0?1:0:Ne(-s/o)}function Ne(i){return i<0?0:i>1?1:i===0?0:i}function Tn(i,t,e,n){if(e<=0)return t;const s=1-Math.exp(-(n/1e3)/e);return i+(t-i)*s}function Be(i,t,e,n,s){const r=h=>ht({top:i+s(h),bottom:i+s(h)+t,height:t},e,n),o=r(0),a=r(1);if(Math.sign(o)===Math.sign(a)||o===0||a===0)return o===0?0:a===0?1:Math.abs(o)<Math.abs(a)?0:1;let c=0,l=1;for(let h=0;h<40;h++){const f=(c+l)/2;Math.sign(r(f))===Math.sign(o)?c=f:l=f}return(c+l)/2}class Sn{timeline;trigger;behaviour;options;observer=null;hasPlayed=!1;running=!1;constructor(t){this.timeline=t.timeline,this.trigger=t.trigger,this.behaviour=t.behaviour??"once",this.options=t}start(){if(!this.running){if(this.running=!0,typeof IntersectionObserver>"u"){this.enter();return}this.observer=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?this.enter():this.leave()},{threshold:this.options.threshold??.15,rootMargin:this.options.rootMargin,root:this.options.root??null}),this.observer.observe(this.trigger)}}stop(){this.running=!1,this.observer?.disconnect(),this.observer=null}destroy(){this.stop()}reset(){this.hasPlayed=!1,this.timeline.stop()}enter(){this.options.onEnter?.(),!(this.behaviour==="once"&&this.hasPlayed)&&(this.hasPlayed=!0,this.behaviour!=="once"&&this.timeline.seek(0),this.timeline.play())}leave(){this.options.onLeave?.(),this.behaviour==="reset"&&this.timeline.stop()}}function Gr(i){const t=new Sn(i);return t.start(),t}class kn{element;spacer;saved;axis;spacing;constructor(t,e={}){this.element=t,this.axis=e.axis??"y",this.spacing=e.spacing??!0;const n=t.ownerDocument;this.spacer=n.createElement("div"),this.spacer.className="pin-spacer",this.saved={position:t.style.position,top:t.style.top,left:t.style.left},this.axis==="x"&&(this.spacer.style.flexShrink="0"),t.replaceWith(this.spacer),this.spacer.appendChild(t)}release(){this.element.style.position=this.saved.position,this.element.style.top=this.saved.top,this.element.style.left=this.saved.left}apply(t,e){const n=Math.max(0,e);this.element.style.position="sticky",this.axis==="x"?(this.spacer.style.width=`${this.element.offsetWidth+n}px`,this.spacer.style.marginRight=this.spacing?"":`-${n}px`,this.element.style.left=`${t}px`):(this.spacer.style.height=`${this.element.offsetHeight+n}px`,this.spacer.style.marginBottom=this.spacing?"":`-${n}px`,this.element.style.top=`${t}px`)}destroy(){this.element.style.position=this.saved.position,this.element.style.top=this.saved.top,this.element.style.left=this.saved.left,this.spacer.parentNode&&this.spacer.replaceWith(this.element)}}const Kr=.15;function Mn(i){return typeof i=="object"&&!Array.isArray(i)?i:{snapTo:i}}function An(i,t,e){const n=Ht(i+t*Kr);if(typeof e=="function")return Ht(e(n));if(typeof e=="number")return e<=0?i:Ht(Math.round(n/e)*e);if(e.length===0)return i;let s=e[0];for(const r of e)Math.abs(r-n)<Math.abs(s-n)&&(s=r);return Ht(s)}function xn(i,t,e){const n=i.duration??{min:.2,max:.8};if(typeof n=="number")return n;const s=Math.min(1,Math.abs(t)/Math.max(1,e));return n.min+(n.max-n.min)*s}class Pn{rafId=null;cancelEvents=["wheel","touchstart","pointerdown","keydown"];onInterrupt=()=>this.cancel();write;eventTarget;constructor(t,e){this.write=t,this.eventTarget=e}get active(){return this.rafId!==null}animate(t,e,n,s=wt,r){if(this.cancel(),typeof requestAnimationFrame>"u"||n<=0){this.write(e),r?.();return}for(const c of this.cancelEvents)this.eventTarget?.addEventListener(c,this.onInterrupt,{passive:!0});let o=null;const a=c=>{o??=c;const l=Math.min(1,(c-o)/(n*1e3));this.write(t+(e-t)*s(l)),l<1?this.rafId=requestAnimationFrame(a):(this.rafId=null,this.detach(),r?.())};this.rafId=requestAnimationFrame(a)}cancel(){this.rafId!==null&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(this.rafId),this.rafId=null,this.detach()}detach(){for(const t of this.cancelEvents)this.eventTarget?.removeEventListener(t,this.onInterrupt)}}function Ht(i){return Math.max(0,Math.min(1,i))}class En{options;scroller;nodes=[];scrollerStart;scrollerEnd;start;end;constructor(t,e,n){this.options=n===!0?{}:n,this.scroller=e;const{startColor:s="#3ecf7a",endColor:r="#ff5a5a",id:o}=this.options,a=o?`${o} `:"",c=(l,h,f)=>{const u=t.createElement("div");return u.textContent=`${a}${l}`,u.setAttribute("aria-hidden","true"),u.className="scroll-marker",Object.assign(u.style,{position:f?"fixed":"absolute",right:`${this.options.indent??0}px`,zIndex:"2147483646",pointerEvents:"none",borderTop:`1px solid ${h}`,color:h,font:`${this.options.fontSize??"11px"} ui-monospace, monospace`,padding:"2px 6px",whiteSpace:"nowrap",background:"rgba(0, 0, 0, 0.35)"}),(e??t.body).appendChild(u),this.nodes.push(u),u};this.scrollerStart=c("scroller-start",s,!e),this.scrollerEnd=c("scroller-end",r,!e),this.start=c("start",s,!1),this.end=c("end",r,!1),e&&getComputedStyle(e).position==="static"&&(e.style.position="relative")}place(t,e){this.start.style.top=`${t.startPage}px`,this.end.style.top=`${t.endPage}px`;const n=this.scroller?e:0;this.scrollerStart.style.top=`${n+t.startViewport}px`,this.scrollerEnd.style.top=`${n+t.endViewport}px`}follow(t,e){this.scroller&&this.place(t,e)}destroy(){for(const t of this.nodes.splice(0))t.remove()}}const Qr=120,ut=[],ft=new Set;let qe=!1;const Zr=()=>{qe||ft.size===0||(qe=!0,queueMicrotask(()=>{qe=!1;for(const i of ft)i.afterRefresh()}))},_n=()=>{for(const i of ft)i.beforeRefresh();for(const i of ut)i.refresh();for(const i of ft)i.afterRefresh()};let dt={width:0,height:0};const Cn=()=>{const i=window.innerWidth,t=window.innerHeight,e=i===dt.width&&t!==dt.height,n=Math.abs(t-dt.height)<dt.height*.25,s=typeof navigator<"u"&&(navigator.maxTouchPoints??0)>0;e&&n&&s||(dt={width:i,height:t},_n())};class Et{timeline;options;running=!1;pin=null;startPx=0;endPx=0;targetProgress=0;displayProgress=0;zone="before";measured=!1;lastScroll=null;lastScrollTime=0;velocityPxPerSecond=0;idleTimer=null;lastEmitted=null;rafId=null;lastFrameTime=null;onScroll=()=>this.update();releaseVelocity=0;snapper;snapTimer=null;markers=null;markerGeometry=null;constructor(t){this.timeline=t.timeline,this.options=t,this.snapper=new Pn(e=>this.scrollTo(e),typeof window<"u"?window:null)}start(){if(this.running)return;this.running=!0,this.timeline?.pause();const t=this.options.pin===!0?this.options.trigger:this.options.pin||null;t&&!this.options.container&&(this.pin=new kn(t,{axis:this.options.horizontal?"x":"y",spacing:this.options.pinSpacing!==!1})),this.options.markers&&!this.options.horizontal&&typeof document<"u"&&(this.markers=new En(document,this.options.scroller??null,this.options.markers)),this.scrollTarget()?.addEventListener("scroll",this.onScroll,{passive:!0}),ut.length===0&&typeof window<"u"&&(dt={width:window.innerWidth,height:window.innerHeight},window.addEventListener("resize",Cn,{passive:!0})),ut.push(this),this.refresh()}stop(){this.running&&(this.running=!1,this.scrollTarget()?.removeEventListener("scroll",this.onScroll),ut.splice(ut.indexOf(this),1),ut.length===0&&typeof window<"u"&&window.removeEventListener("resize",Cn),this.stopSmoothing(),this.idleTimer!==null&&clearTimeout(this.idleTimer),this.idleTimer=null,this.snapTimer!==null&&clearTimeout(this.snapTimer),this.snapTimer=null,this.snapper.cancel())}destroy(){this.stop(),this.pin?.destroy(),this.pin=null,this.markers?.destroy(),this.markers=null}get startOffset(){return this.startPx}get endOffset(){return this.endPx}static refreshAll(){_n()}static onRefresh(t){return ft.add(t),()=>ft.delete(t)}get progress(){return this.targetProgress}get velocity(){return this.velocityPxPerSecond}refresh(){if(!this.running)return;this.measured&&this.options.onRefresh?.();const t=this.scrollPosition();this.pin?.release();const e=this.triggerRect();if(e&&this.options.container)this.measureInContainer(this.options.container);else if(e){const n=this.viewportHeight();if(this.startPx=t+ht(e,n,_t(this.options.start)??"top bottom"),this.endPx=this.resolveEnd(e,n,t),this.pin){const s=this.relativeRect(this.pin.element.getBoundingClientRect());this.pin.apply(s.top-(this.startPx-t),this.endPx-this.startPx)}this.markerGeometry=this.markers?this.markersFor(n):null}this.markers&&this.markerGeometry&&this.markers.place(this.markerGeometry,t),this.lastScroll=null,this.updateFrom(t,!this.measured),this.measured=!0,Zr()}sample(){this.refresh()}update(t){this.running&&this.updateFrom(t??this.scrollPosition(),!1)}updateFrom(t,e){this.trackVelocity(t),this.markers&&this.markerGeometry&&this.markers.follow(this.markerGeometry,t);const n=this.endPx-this.startPx,s=this.zone;this.targetProgress=n>0?Ne((t-this.startPx)/n):t>=this.startPx?1:0,this.zone=n>0?t<=this.startPx?"before":t>=this.endPx?"after":"active":t>=this.startPx?"after":"before",this.fireBoundaryCallbacks(s,this.zone),e||this.smoothing()<=0?(this.displayProgress=this.targetProgress,this.applyProgress()):(this.emitUpdate(),this.startSmoothing())}smoothing(){const t=this.options.scrub;return typeof t=="number"?Math.max(0,t):0}resolveEnd(t,e,n){const s=_t(this.options.end)??"bottom top",r=typeof s=="string"?s.trim().match(/^\+=\s*(-?[\d.]+)\s*(%|px)?$/):null;if(r){const o=Number.parseFloat(r[1]);return this.startPx+(r[2]==="%"?e*o/100:o)}return n+ht(t,e,s)}applyProgress(){const t=this.timeline?.duration??0;this.timeline&&t>0&&this.timeline.seek(this.displayProgress*t),this.emitUpdate()}emitUpdate(){if(!this.options.onUpdate)return;const t=[this.displayProgress,this.velocityPxPerSecond];this.lastEmitted&&this.lastEmitted[0]===t[0]&&this.lastEmitted[1]===t[1]||(this.lastEmitted=t,this.options.onUpdate(t[0],t[1]))}trackVelocity(t){const e=typeof performance<"u"?performance.now():Date.now();this.lastScroll!==null&&e>this.lastScrollTime&&t!==this.lastScroll&&(this.velocityPxPerSecond=(t-this.lastScroll)/(e-this.lastScrollTime)*1e3),(this.lastScroll===null||t!==this.lastScroll)&&(this.lastScroll=t,this.lastScrollTime=e),!(this.velocityPxPerSecond===0||typeof setTimeout>"u")&&(this.idleTimer!==null&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>{this.idleTimer=null,this.releaseVelocity=this.velocityPxPerSecond,this.velocityPxPerSecond=0,this.emitUpdate(),this.scheduleSnap()},Qr))}fireBoundaryCallbacks(t,e){if(t===e)return;const{onEnter:n,onLeave:s,onEnterBack:r,onLeaveBack:o}=this.options;t==="before"?(n?.(),e==="after"&&s?.()):t==="after"?(r?.(),e==="before"&&o?.()):e==="after"?s?.():o?.()}scheduleSnap(){const t=this.options.snap;if(t===void 0||this.snapper.active)return;const e=Mn(t),n=()=>{this.snapTimer=null;const s=this.endPx-this.startPx,r=this.scrollPosition();if(!this.running||s<=0||r<=this.startPx||r>=this.endPx)return;const o=(r-this.startPx)/s,a=this.startPx+An(o,this.releaseVelocity/s,e.snapTo)*s;Math.abs(a-r)<1||this.snapper.animate(r,a,xn(e,a-r,this.viewportHeight()),e.ease)};e.delay?this.snapTimer=setTimeout(n,e.delay*1e3):n()}scrollTo(t){const e=this.options.scroller,n=this.options.horizontal?{left:t}:{top:t};e?typeof e.scrollTo=="function"?e.scrollTo({...n,behavior:"instant"}):this.options.horizontal?e.scrollLeft=t:e.scrollTop=t:typeof window<"u"&&window.scrollTo({...n,behavior:"instant"})}measureInContainer(t){const e=this.options.trigger;if(typeof e?.getBoundingClientRect!="function")return;const n=e.getBoundingClientRect(),s=this.options.scroller?.getBoundingClientRect?.().left??0,r=this.options.scroller?this.options.scroller.clientWidth:typeof window<"u"?window.innerWidth:0,o=n.left-s-t.shiftAt(t.progress()),{start:a,end:c}=t.range(),l=d=>a+d*(c-a),h=Be(o,n.width,r,_t(this.options.start)??"left right",t.shiftAt);this.startPx=l(h);const f=_t(this.options.end)??"right left",u=typeof f=="string"?f.trim().match(/^\+=\s*(-?[\d.]+)\s*(px)?$/):null;this.endPx=u?this.startPx+Number.parseFloat(u[1]):l(Be(o,n.width,r,f,t.shiftAt)),this.markerGeometry=null}markersFor(t){const e=(r,o)=>{const a=_t(r)??o;if(typeof a=="number")return 0;if(/^\s*\+=/.test(a))return;const c=Oe(a);return t*c.viewportFraction-c.offsetPx},n=e(this.options.start,"top bottom")??0,s=e(this.options.end,"bottom top")??n;return{startViewport:n,endViewport:s,startPage:this.startPx+n,endPage:this.endPx+s}}startSmoothing(){if(this.rafId!==null||typeof requestAnimationFrame>"u")return;const t=e=>{if(this.rafId=null,!this.running)return;const n=this.lastFrameTime===null?16.67:e-this.lastFrameTime;this.lastFrameTime=e,this.displayProgress=Tn(this.displayProgress,this.targetProgress,this.smoothing(),n);const s=Math.abs(this.targetProgress-this.displayProgress)<1e-4;s&&(this.displayProgress=this.targetProgress),this.applyProgress(),s?this.lastFrameTime=null:this.rafId=requestAnimationFrame(t)};this.rafId=requestAnimationFrame(t)}stopSmoothing(){this.rafId!==null&&typeof cancelAnimationFrame<"u"&&cancelAnimationFrame(this.rafId),this.rafId=null,this.lastFrameTime=null}scrollTarget(){return this.options.scroller??(typeof window<"u"?window:null)}scrollPosition(){const t=this.options.scroller,e=this.options.horizontal;return t?(e?t.scrollLeft:t.scrollTop)??0:typeof window<"u"?(e?window.scrollX:window.scrollY)??0:0}triggerRect(){const t=this.options.trigger;return typeof t?.getBoundingClientRect!="function"?null:this.relativeRect(t.getBoundingClientRect())}relativeRect(t){const e=this.options.horizontal,n=e?t.left??0:t.top,s=e?t.right??0:t.bottom,r=e?t.width??0:t.height,o=this.options.scroller;if(o&&typeof o.getBoundingClientRect=="function"){const a=o.getBoundingClientRect(),c=e?a.left:a.top;return{top:n-c,bottom:s-c,height:r}}return{top:n,bottom:s,height:r}}viewportHeight(){const t=this.options.scroller,e=this.options.horizontal;return t?e?t.clientWidth:t.clientHeight:typeof window<"u"?e?window.innerWidth:window.innerHeight:0}}function _t(i){return typeof i=="function"?i():i}function Jr(i){const t=new Et(i);return t.start(),t}const Xe=new Set,to=16,Rn=.5,eo=2;class Ye{options;frames;running=!1;reduced=!1;current=0;target=0;written=null;velocityPxPerSecond=0;frameId=null;lastTime=null;journey=null;pausedState=!1;effects=[];onWheel=t=>this.wheel(t);onScroll=()=>this.nativeScroll();onResize=()=>this.refresh();onLoad=()=>this.refresh();stopListening=null;constructor(t={}){this.options=t,this.frames=t.frames??{request:e=>requestAnimationFrame(e),cancel:e=>cancelAnimationFrame(e)}}start(){if(this.running||typeof window>"u")return this;this.running=!0,this.reduced=this.options.reducedMotion??(typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches),this.current=this.target=this.position();const t=this.options.scroller??window;return t.addEventListener("wheel",this.onWheel,{passive:!1}),t.addEventListener("scroll",this.onScroll,{passive:!0}),window.addEventListener("resize",this.onResize,{passive:!0}),window.addEventListener("load",this.onLoad),Xe.add(this),this.stopListening=Et.onRefresh({beforeRefresh:()=>this.rest(),afterRefresh:()=>this.refresh()}),this.refresh(),this}static refreshAll(){for(const t of Xe)t.refresh()}stop(){if(!this.running)return this;this.running=!1;const t=this.options.scroller??window;return t.removeEventListener("wheel",this.onWheel),t.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize),window.removeEventListener("load",this.onLoad),Xe.delete(this),this.stopListening?.(),this.stopListening=null,this.cancelFrame(),this.journey=null,this}destroy(){this.stop();for(const t of this.effects)Ve(t.element,t.saved);this.effects=[]}kill(){this.destroy()}get state(){const t=this.limit();return{scroll:this.current,target:this.target,progress:t>0?this.current/t:0,velocity:this.velocityPxPerSecond}}paused(t){return t!==void 0&&(this.pausedState=t,t&&(this.target=this.current,this.journey=null)),this.pausedState}scrollTo(t,e={}){if(!this.running)return;const n=this.clamp(this.resolve(t)+(e.offset??0)),s=Math.abs(n-this.current),r=this.reduced?0:e.duration??Math.min(1.2,Math.max(.4,s/2500));if(r<=0){this.journey=null,this.current=this.target=n,this.write(n),this.applyEffects(0);return}this.target=n,this.journey={from:this.current,to:n,ms:r*1e3,ease:e.ease??wt,elapsed:0},this.requestFrame()}refresh(){if(!this.running)return;this.rest(),this.effects=[];const t=this.options.effects===!0?"[data-speed], [data-lag]":this.options.effects||"";if(t&&!this.reduced){const e=this.options.scroller??document,n=this.position(),s=this.viewportHeight(),r=this.options.scroller?.getBoundingClientRect().top??0;for(const o of e.querySelectorAll(t)){const a=Number.parseFloat(o.dataset.speed??""),c=Number.parseFloat(o.dataset.lag??""),l=o.getBoundingClientRect(),h=l.top-r+n;this.effects.push({element:o,speed:Number.isFinite(a)?a:void 0,lag:Number.isFinite(c)&&c>0?c:void 0,centre:h+l.height/2-s/2,lagged:n,shift:0,saved:o.style.getPropertyValue("translate")})}}this.current=this.target=this.clamp(this.position()),this.applyEffects(0)}rest(){for(const t of this.effects)Ve(t.element,t.saved)}wheel(t){if(this.pausedState||this.reduced||(this.options.smooth??.8)<=0||t.ctrlKey||Math.abs(t.deltaX)>Math.abs(t.deltaY)||this.nestedScrollerTakes(t))return;const e=t.deltaMode===1?to:t.deltaMode===2?this.viewportHeight():1,n=t.deltaY*e*(this.options.wheelMultiplier??1),s=this.clamp(this.target+n);s===this.target&&s===this.current||(t.preventDefault(),this.journey=null,this.target=s,this.requestFrame())}nativeScroll(){const t=this.position();this.written!==null&&Math.abs(t-this.written)<=eo||(this.written=null,this.journey=null,this.cancelFrame(),this.current=this.target=t,this.requestFrame())}nestedScrollerTakes(t){const e=this.options.scroller??document.documentElement;for(let n=t.target;n&&n!==e&&n!==document.body;n=n.parentElement){if(n.hasAttribute?.("data-smooth-ignore"))return!0;const s=getComputedStyle(n);if(!/(auto|scroll)/.test(s.overflowY)||n.scrollHeight<=n.clientHeight)continue;if(t.deltaY<0?n.scrollTop>0:n.scrollTop+n.clientHeight<n.scrollHeight-1)return!0}return!1}requestFrame(){this.frameId!==null||!this.running||(this.frameId=this.frames.request(t=>this.frame(t)))}cancelFrame(){this.frameId!==null&&this.frames.cancel(this.frameId),this.frameId=null,this.lastTime=null}frame(t){this.frameId=null;const e=this.lastTime===null?1e3/60:Math.min(100,t-this.lastTime);this.lastTime=t;const n=this.current;if(this.journey){const r=this.journey;r.elapsed+=e;const o=Math.min(1,r.elapsed/r.ms);this.current=r.from+(r.to-r.from)*r.ease(o),o>=1&&(this.journey=null)}else if(this.current!==this.target){const r=(this.options.smooth??.8)*1e3/3;this.current+=(this.target-this.current)*(1-Math.exp(-e/r)),Math.abs(this.target-this.current)<Rn&&(this.current=this.target)}this.current!==n&&this.write(this.current),this.velocityPxPerSecond=e>0?(this.current-n)*1e3/e:0;const s=this.applyEffects(e);this.current!==n&&this.options.onUpdate?.(this.state),this.journey||this.current!==this.target||s?this.requestFrame():(this.lastTime=null,this.velocityPxPerSecond=0)}applyEffects(t){let e=!1;const n=this.current;for(const s of this.effects){let r=0;if(s.speed!==void 0&&(r+=(n-s.centre)*(1-s.speed)),s.lag!==void 0){const o=s.lag*1e3/3;s.lagged=t===0?n:s.lagged+(n-s.lagged)*(1-Math.exp(-t/o)),Math.abs(n-s.lagged)<Rn?s.lagged=n:e=!0,r+=n-s.lagged}Ve(s.element,r===0?s.saved:`0 ${io(r)}px`),s.shift=r}return e}write(t){const e=Math.round(t);this.written=e;const n=this.options.scroller;n?n.scrollTop=e:window.scrollTo({top:e,behavior:"instant"})}position(){const t=this.options.scroller;return t?t.scrollTop:window.scrollY}viewportHeight(){const t=this.options.scroller;return t?t.clientHeight:window.innerHeight}limit(){const t=this.options.scroller??document.documentElement;return Math.max(0,t.scrollHeight-this.viewportHeight())}clamp(t){return Math.max(0,Math.min(this.limit(),t))}resolve(t){if(typeof t=="number")return t;const e=this.options.scroller??document,n=typeof t=="string"?e.querySelector(t):t;if(!n)return this.current;const s=this.options.scroller?.getBoundingClientRect().top??0,r=this.effects.find(o=>o.element===n)?.shift??0;return n.getBoundingClientRect().top-s+this.position()-r}}function Ve(i,t){t?i.style.setProperty("translate",t):i.style.removeProperty("translate")}function io(i){return Math.round(i*100)/100}function no(i,t){switch(t){case"play":if(i.progress()>=1)break;i.reversed()?i.reverse():i.play();break;case"reverse":if(i.progress()<=0)break;i.reversed()?i.play():i.reverse();break;case"pause":i.pause();break;case"resume":i.resume();break;case"restart":i.restart();break;case"reset":i.pause(),i.progress(0);break;case"complete":i.pause(),i.progress(1);break}}function Ue(i,t,e,n,s=()=>{}){const r=d=>typeof d=="string"?i.query(d)??void 0:d,o=r(t.trigger)??n;if(!o){s(`gsap-compat: scrollTrigger has no trigger element${typeof t.trigger=="string"?` for "${t.trigger}"`:""}`);return}const a=t.scrub===void 0||t.scrub===!1?!1:t.scrub,c=(t.toggleActions??"play none none none").trim().split(/\s+/);let l=0,h;const f=(d,g)=>()=>{g?.(),e&&!a&&no(e,c[d]??"none"),t.once&&d===0&&queueMicrotask(()=>h.destroy())},u=t.containerAnimation?oo(i,t.containerAnimation,o,s):void 0;return h=new Et({trigger:o,start:t.start,end:t.end,scrub:a===!1?void 0:a,pin:t.pin===!0?!0:r(t.pin),scroller:r(t.scroller),horizontal:t.horizontal,pinSpacing:t.pinSpacing,onRefresh:t.invalidateOnRefresh&&e?.invalidate?()=>e.invalidate():void 0,snap:t.snap===void 0?void 0:so(t.snap,e),markers:t.markers,container:u,onUpdate:(d,g)=>{if(e&&a!==!1&&e.progress(d),t.onUpdate){const p=d<l||g<0?-1:1;t.onUpdate({progress:d,velocity:g,direction:p})}l=d},onEnter:f(0,t.onEnter),onLeave:f(1,t.onLeave),onEnterBack:f(2,t.onEnterBack),onLeaveBack:f(3,t.onLeaveBack)}),e&&a===!1&&e.progress(0),h.start(),i.own(h)}function so(i,t){const e=s=>s==="labels"?r=>ro(r,t?.labelProgresses?.()??[]):s;if(typeof i!="object"||Array.isArray(i))return e(i);const n=i.ease?At(i.ease):void 0;return{snapTo:e(i.snapTo),duration:i.duration,delay:i.delay,ease:n?n.fn??X(n.easing):void 0}}function ro(i,t){return t.reduce((e,n)=>Math.abs(n-i)<Math.abs(e-i)?n:e,t[0]??i)}function oo(i,t,e,n){const s=()=>t.timeline.getTracks({property:"x"}).map(r=>r.target).filter(r=>{const o=i.elementFor(r);return!!o&&o!==e&&o.contains(e)});return s().length===0&&n("gsap-compat: containerAnimation does not move an ancestor of the trigger along x"),{range:()=>{const r=t.scrollTrigger;return r||n("gsap-compat: containerAnimation needs its own scrollTrigger (created before this one)"),{start:r?.startOffset??0,end:r?.endOffset??0}},progress:()=>t.progress(),shiftAt:r=>{const o=t.timeline.getStateAtTime(r*t.timeline.duration);let a=0;for(const c of s()){const l=o.values.get(c)?.get("x");typeof l=="number"&&(a+=l)}return a}}}class In{conditions={};scope;host;items=[];snapshots=new Map;constructor(t,e){this.host=t,this.scope=e}add(t){const e=this.host.collector;this.host.setCollector(this);try{const n=t();return typeof n=="function"&&this.items.push({revert:n}),n}finally{this.host.setCollector(e)}}track(t){this.items.push(t)}touch(t,e){this.snapshots.has(t)||this.snapshots.set(t,{name:e,style:t.getAttribute("style"),d:t.getAttribute("d")})}revert(){for(const t of this.items.splice(0).reverse())t.revert?t.revert():t.kill?t.kill():t.destroy?.();for(const[t,{name:e,style:n,d:s}]of this.snapshots)n===null?t.removeAttribute("style"):t.setAttribute("style",n),s!==null&&t.setAttribute("d",s),this.host.forget(e);this.snapshots.clear()}kill(){this.revert()}}class ao{host;scope;entries=[];listeners=[];scheduled=!1;constructor(t,e){this.host=t,this.scope=e}add(t,e){const n={conditions:t,setup:e,queries:new Map},s=typeof t=="string"?{matches:t}:t;if(typeof window<"u"&&typeof window.matchMedia=="function")for(const[r,o]of Object.entries(s)){const a=window.matchMedia(o);n.queries.set(r,a);const c=()=>this.scheduleUpdate();a.addEventListener("change",c),this.listeners.push(()=>a.removeEventListener("change",c))}return this.entries.push(n),this.update(n),this}revert(){for(const t of this.listeners.splice(0))t();for(const t of this.entries.splice(0))t.context?.revert()}kill(){this.revert()}scheduleUpdate(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1;for(const t of this.entries)this.update(t)}))}update(t){const e={};for(const[o,a]of t.queries)e[o]=a.matches;const n=Object.values(e).some(Boolean),s=n?JSON.stringify(e):void 0;if(s===t.key||(t.context?.revert(),t.context=void 0,t.key=s,!n))return;const r=new In(this.host,this.scope);r.conditions=e,r.add(()=>t.setup(r)),t.context=r}}class co{frames;canvas;context;options;images;ready;current=0;drawn=-1;loadedCount=0;inFlight=0;destroyed=!1;onResize=()=>this.resize();constructor(t,e){this.canvas=t,this.context=t.getContext("2d"),this.options=e,this.frames=Math.max(1,Math.floor(e.frames)),this.images=new Array(this.frames),this.ready=new Array(this.frames).fill(!1),typeof window<"u"&&window.addEventListener("resize",this.onResize,{passive:!0}),this.resize(),this.pump()}get frame(){return this.current}set frame(t){this.current=Math.max(0,Math.min(this.frames-1,t)),this.draw()}get loaded(){return this.loadedCount}destroy(){this.destroyed=!0,typeof window<"u"&&window.removeEventListener("resize",this.onResize);for(const t of this.images)t&&(t.src="")}resize(){const t=typeof window<"u"?Math.min(window.devicePixelRatio||1,2):1,e=Math.round(this.canvas.clientWidth*t),n=Math.round(this.canvas.clientHeight*t);e>0&&n>0&&(this.canvas.width!==e||this.canvas.height!==n)&&(this.canvas.width=e,this.canvas.height=n),this.drawn=-1,this.draw()}draw(){const t=Math.round(this.current),e=this.nearestReady(t);if(e===-1||e===this.drawn||!this.context)return;const n=this.images[e],{width:s,height:r}=this.canvas,o=(this.options.fit??"cover")==="cover"?Math.max(s/n.naturalWidth,r/n.naturalHeight):Math.min(s/n.naturalWidth,r/n.naturalHeight),a=n.naturalWidth*o,c=n.naturalHeight*o;this.context.clearRect(0,0,s,r),this.context.drawImage(n,(s-a)/2,(r-c)/2,a,c),this.drawn=e,this.pump()}nearestReady(t){for(let e=0;e<this.frames;e++){if(t-e>=0&&this.ready[t-e])return t-e;if(t+e<this.frames&&this.ready[t+e])return t+e}return-1}pump(){const t=this.options.concurrency??6,e=Math.round(this.current);for(let n=0;n<this.frames&&this.inFlight<t;n++)for(const s of n===0?[e]:[e+n,e-n])s<0||s>=this.frames||this.images[s]||this.inFlight>=t||this.load(s)}load(t){const e=new Image;e.decoding="async",this.images[t]=e,this.inFlight++;const n=s=>{if(!this.destroyed){if(this.inFlight--,s){this.ready[t]=!0,this.loadedCount++,this.options.onProgress?.(this.loadedCount,this.frames);const r=Math.round(this.current);(Math.abs(t-r)<Math.abs(this.drawn-r)||this.drawn===-1)&&(this.drawn=-1,this.draw())}this.pump()}};e.onload=()=>n(!0),e.onerror=()=>n(!1),e.src=this.options.url(t)}}const lo={opacity:0,y:-16},ho={opacity:0,y:16};async function uo(i,t,e,n){const s=t.collector?.scope??t.root,r=s.ownerDocument??s,o=()=>n.shared?[...s.querySelectorAll(n.shared)]:[];if(n.native&&typeof r.startViewTransition=="function")return fo(r,n,o);const a=n.duration??.35,c=n.ease??"power2.inOut",l=y=>new Promise(b=>{y(b)||b()}),h=o(),f=h.length?Le(t,h):void 0,u=n.from!==void 0?Ln(t,n.from,n.shared):[];if(u.length&&n.leave!==!1){const y=n.leave??lo;await l(b=>i.to(u,{...y,duration:a,ease:c,onComplete:b}))}await n.update();const d=[],g=typeof n.to=="function"?n.to():n.to,p=g!==void 0?Ln(t,g,n.shared):[];if(p.length&&n.enter!==!1){const y=n.enter??ho;d.push(l(b=>i.fromTo(p,y,{...vn(y),duration:a,ease:c,onComplete:b})))}if(f){const y=o().filter(b=>!h.includes(b));y.length&&d.push(l(b=>$e(t,e,f,{targets:y,duration:a*1.4,ease:c,enter:!1,onComplete:b})))}await Promise.all(d)}function Ln(i,t,e){const n=i.resolveTargets(t).map(s=>i.elementFor(s)).filter(s=>!!s);return e?n.flatMap(s=>!s.querySelector(e)&&!s.matches(e)?[s]:[...s.children].filter(r=>!r.matches(e)&&!r.querySelector(e))):n}async function fo(i,t,e){const n=(a,c)=>{const l=a.dataset?.flipId;l&&a.style.setProperty("view-transition-name",c?`tf-${l.replace(/[^\w-]/g,"-")}`:"")},s=e();s.forEach(a=>n(a,!0));let r=[];await i.startViewTransition(async()=>{s.forEach(a=>n(a,!1)),await t.update(),r=e(),r.forEach(a=>n(a,!0))}).finished,r.forEach(a=>n(a,!1))}const Fn={create:(i,t)=>Me(i,Vi(t))},$n={create:(i,t)=>Me(i,{fn:Ui(t)})},Dn={create:(i,t)=>Me(i,{fn:Wi(t)})},po=new Set(["keyframes","duration","delay","ease","easeEach","stagger","repeat","repeatDelay","yoyo","repeatRefresh","paused","id","onStart","onUpdate","onComplete","onRepeat","onReverseComplete","scrollTrigger"]),On=.5,mo="power1.inOut";function go(i){return i.keyframes!==void 0&&i.keyframes!==null}function yo(i){const t=i.keyframes,e={};for(const[l,h]of Object.entries(i))po.has(l)||(e[l]=h);if(Array.isArray(t))return t.map(l=>({...e,...l,duration:l.duration??i.duration??On}));const n=Object.entries(t),s=i.duration??On,r=t.easeEach??i.easeEach??mo;if(n.length>0&&n.every(([l])=>/^\s*-?\d+(\.\d+)?\s*%\s*$/.test(l)||l==="easeEach")){const l=n.filter(([u])=>u!=="easeEach").map(([u,d])=>({at:Number.parseFloat(u)/100,step:d})).sort((u,d)=>u.at-d.at),h=[];let f=0;for(const{at:u,step:d}of l){const g=Math.max(0,u-f);h.push({...e,ease:r,...d,duration:g*s}),f=u}return h}const o=n.filter(([l,h])=>l!=="easeEach"&&Array.isArray(h)),a=Math.max(0,...o.map(([,l])=>l.length)),c=[];for(let l=0;l<a;l++){const h={...e,ease:r,duration:s/a};for(const[f,u]of o)l<u.length&&(h[f]=u[l]);c.push(h)}return c}function Nn(i,t,e,n={}){const s=t.collector?.scope??t.root,r=typeof n.scroller=="string"?s.querySelector(n.scroller):n.scroller??null,o={x:r?r.scrollLeft:window.scrollX,y:r?r.scrollTop:window.scrollY},a={x:r?r.scrollWidth-r.clientWidth:document.documentElement.scrollWidth-window.innerWidth,y:r?r.scrollHeight-r.clientHeight:document.documentElement.scrollHeight-window.innerHeight},c=(v,w)=>{if(w===void 0)return o[v];if(typeof w=="number")return w;if(w==="max")return a[v];const S=typeof w=="string"?s.querySelector(w):w;if(!S)return o[v];const T=S.getBoundingClientRect(),k=r?.getBoundingClientRect(),A=(v==="x"?n.offsetX:n.offsetY)??n.offset??0;return v==="x"?T.left-(k?.left??0)+o.x-A:T.top-(k?.top??0)+o.y-A},l=typeof e=="object"&&e!==null&&!("nodeType"in e)?{x:c("x",e.x),y:c("y",e.y)}:{x:o.x,y:c("y",e)},h={x:Math.max(0,Math.min(a.x,l.x)),y:Math.max(0,Math.min(a.y,l.y))},f={...o},u=()=>{r?(r.scrollLeft=f.x,r.scrollTop=f.y):window.scrollTo({left:f.x,top:f.y,behavior:"instant"})},d=["wheel","touchstart","keydown"],g=r??window,p=()=>{b.kill(),y()},y=()=>{for(const v of d)g.removeEventListener(v,p)},b=i.to(f,{x:h.x,y:h.y,duration:n.duration??1,ease:n.ease??"power2.inOut",onStart:n.onStart,onUpdate:()=>{u(),n.onUpdate?.()},onComplete:()=>{y(),n.onComplete?.()}});if(n.autoKill!==!1)for(const v of d)g.addEventListener(v,p,{passive:!0});return b}function bo(i,t,e){const n=i.collector?.scope??i.root,s=typeof t=="string"?[...n.querySelectorAll(t)]:"nodeType"in t?[t]:Array.from(t),{interval:r=.1,batchMax:o,onEnter:a,onLeave:c,onEnterBack:l,onLeaveBack:h,...f}=e,u={onEnter:a,onLeave:c,onEnterBack:l,onLeaveBack:h},d={onEnter:[],onLeave:[],onEnterBack:[],onLeaveBack:[]},g={},p=b=>{g[b]!==void 0&&clearTimeout(g[b]),g[b]=void 0;const v=d[b].splice(0);v.length>0&&u[b]?.(v)},y=(b,v)=>{if(u[b]){if(d[b].push(v),o!==void 0&&d[b].length>=o)return p(b);g[b]===void 0&&(g[b]=setTimeout(()=>p(b),r*1e3))}};return s.map(b=>Ue(i,{...f,trigger:b,onEnter:()=>y("onEnter",b),onLeave:()=>y("onLeave",b),onEnterBack:()=>y("onEnterBack",b),onLeaveBack:()=>y("onLeaveBack",b)})).filter(b=>b!==void 0)}class W{compat;stage;options;autoplayPending;started=!1;killed=!1;recipe=[];firstElement;scrollDriver;events=[];ranges=[];playhead={time:0,iteration:0,direction:"forward",fresh:!0};waitingToWrap=!1;finishedThisFrame=!1;backwards=!1;constructor(t,e={}){if(this.stage=t,this.options=e,this.compat=new J({...e,startValue:(n,s)=>{const r=t.objectFor(n);if(r)return To(r[s]);const o=t.appliedValue(n,s);if(o!==void 0)return o;if(s==="d")return ln(t.elementFor(n))??void 0;if(s==="text")return t.elementFor(n)?.textContent??void 0;if(s==="strokeDasharray"||s==="strokeDashoffset"){const a=Vn(t.elementFor(n));if(a!==void 0)return s==="strokeDasharray"?[a,a]:0}},startVelocity:(n,s)=>t.velocityOf(n,s),layoutColumns:n=>Yn(n.map(s=>t.elementFor(s))),random:()=>t.utils.random(0,1)}),this.compat.timeline.onComplete=()=>{this.finishedThisFrame=!0},t.collector?.track(this),t.liveTimelines.add(this),this.autoplayPending=!e.paused&&!e.scrollTrigger,e.scrollTrigger){const n=e.scrollTrigger;queueMicrotask(()=>{this.killed||(this.scrollDriver=Ue(t,n,this,this.firstElement,s=>e.onWarning?.(s)))})}this.autoplayPending&&queueMicrotask(()=>{this.autoplayPending&&this.play()})}get timeline(){return this.compat.timeline}get scrollTrigger(){return this.scrollDriver}to(t,e,n){return go(e)?this.record(()=>this.keyframed(t,e,n)):this.record(()=>this.tween(t,[e],n,([s],r,o)=>this.compat.to(r,s,o)))}from(t,e,n){return this.record(()=>this.tween(t,[e],n,([s],r,o)=>this.compat.from(r,s,o)))}fromTo(t,e,n,s){return this.record(()=>this.tween(t,[e,n],s,([r,o],a,c)=>this.compat.fromTo(a,r,o,c)))}set(t,e,n){return this.record(()=>this.tween(t,[e],n,([s],r,o)=>this.compat.set(r,s,o)))}addLabel(t,e){return this.record(()=>this.compat.addLabel(t,e))}add(t,e){return this.record(()=>{t.autoplayPending=!1,t.timeline.stop(),t.stage.deactivate(t.timeline),this.compat.add(t.compat,e)})}invalidate(){const t=this.compat.progress();this.compat.progress(0),this.stage.render(this.timeline),this.compat.reset(),this.events=[],this.ranges=[];for(const e of this.recipe)e();return this.syncDuration(),this.compat.progress(t),this.stage.render(this.timeline),this}call(t,e=[],n){return this.record(()=>{const s=this.compat.addEvent(n);this.events.push({time:s,run:()=>t(...e)})})}addPause(t,e,n=[]){return this.record(()=>{const s=this.compat.addEvent(t);this.events.push({time:s,pause:!0,run:()=>e?.(...n)})})}tweenTo(t,e={}){return this.tweenFromTo(this.timeline.currentTime/1e3,t,e)}tweenFromTo(t,e,n={}){this.pause(),this.seek(t);const s=this.timeline.currentTime,r=Math.max(0,Math.min(this.timeline.duration,this.compat.timeOf(e))),o={time:s},a=n.duration??Math.abs(r-s)/1e3/(this.timeScale()||1),c=new W(this.stage,{onStart:n.onStart,onComplete:n.onComplete});return c.to(o,{time:r,duration:a,ease:n.ease??"none",onUpdate:()=>{this.moveTo(o.time),n.onUpdate?.()}}),c}play(){this.autoplayPending=!1,this.started||(this.started=!0,this.options.onStart?.());const t=this.timeline.playbackState==="playing",e=this.timeline.playbackState==="paused";if(this.timeline.play(),!t){const n=this.timeline,s=n.direction==="forward"?n.currentTime===0:n.currentTime===n.duration;this.playhead={...this.readPlayhead(),fresh:s&&!e},this.waitingToWrap=!1}return this.stage.liveTimelines.add(this),this.stage.render(this.timeline),this.stage.activate(this.timeline,{onUpdate:()=>this.afterFrame()}),this}pause(){return this.autoplayPending=!1,this.timeline.pause(),this.stage.deactivate(this.timeline),this}resume(){return this.play()}restart(){return this.timeline.stop(),this.backwards=!1,this.play()}reverse(){this.backwards=!this.backwards;const t=this.timeline.playbackState==="idle"&&this.timeline.direction==="forward";return this.timeline.reverse(),t&&this.timeline.currentTime===0&&this.timeline.seek(this.timeline.duration),this.play()}labelProgresses(){const t=this.timeline.duration;return t>0?this.compat.labelTimes().map(e=>e/t):[]}reversed(){return this.timeline.direction==="reverse"}seek(t){return this.autoplayPending=!1,this.compat.seek(t),this.stage.render(this.timeline),this.playhead=this.readPlayhead(),this.waitingToWrap=!1,this.options.onUpdate?.(),this}progress(t){return t===void 0?this.compat.progress():(this.autoplayPending=!1,this.moveTo(Math.max(0,Math.min(1,t))*this.timeline.duration),this.compat.progress())}timeScale(t){return this.compat.timeScale(t)}duration(){return this.compat.duration()}isActive(){return this.timeline.playbackState==="playing"}kill(){return this.killed=!0,this.stage.liveTimelines.delete(this),this.scrollDriver?.destroy(),this.scrollDriver=void 0,this.autoplayPending=!1,this.timeline.stop(),this.stage.deactivate(this.timeline),this.compat.kill(),this}toDefinition(){return this.compat.toDefinition()}killTweensOf(t,e){for(const n of t)for(const s of e??[void 0])this.timeline.removeTracks({target:n,...s!==void 0&&{property:s}});this.timeline.tracks.length===0&&this.events.length===0&&this.kill()}record(t){return this.recipe.push(t),t(),this.syncDuration(),this}syncDuration(){if(this.events.length===0)return;this.timeline.setDuration(void 0);const t=Math.max(...this.events.map(e=>e.time));t>this.timeline.duration&&this.timeline.setDuration(t)}readPlayhead(){const t=this.timeline;return{time:t.currentTime,iteration:t.loopIteration,direction:t.direction}}moveTo(t){const e=this.playhead;this.timeline.seek(t),this.stage.render(this.timeline);const n={time:this.timeline.currentTime,iteration:this.timeline.loopIteration,direction:t>=e.time?"forward":"reverse"},s={...e,iteration:n.iteration,direction:n.direction};this.playhead={...this.readPlayhead()},this.waitingToWrap=!1,this.runCrossings(s,n,!1),this.options.onUpdate?.()}refreshForRepeat(){const t=this.timeline.currentTime;this.compat.reset(),this.events=[],this.ranges=[];for(const e of this.recipe)e();this.syncDuration(),this.timeline.seek(Math.min(t,this.timeline.duration))}afterFrame(){const t=this.timeline,e=t.repeatDelayRemaining>0;if(this.waitingToWrap&&e){this.options.onUpdate?.();return}this.waitingToWrap=!1;const n=this.playhead,s=this.readPlayhead();this.playhead=s;const r=this.options.yoyo===!0;e&&!r&&s.iteration>n.iteration&&(this.playhead={time:0,iteration:s.iteration,direction:"forward",fresh:!0},this.waitingToWrap=!0);const o=this.runCrossings(n,s,e);if(this.options.onUpdate?.(),this.finishedThisFrame&&!o){this.finishedThisFrame=!1;const a=t.currentTime===0&&t.direction==="reverse";!this.scrollDriver&&!r&&this.stage.liveTimelines.delete(this),a&&this.backwards?this.options.onReverseComplete?.():this.options.onComplete?.()}this.finishedThisFrame=!1}runCrossings(t,e,n){if(this.events.length===0&&this.ranges.length===0&&!this.options.onRepeat&&!this.options.repeatRefresh)return!1;const s=this.events,{crossings:r,passes:o}=we(s.map(a=>a.time),t,e,{duration:this.timeline.duration,alternate:this.options.yoyo===!0,holding:n});for(const a of r){if(this.killed)return!0;if(a.kind==="repeat"){this.options.repeatRefresh&&this.refreshForRepeat(),this.options.onRepeat?.();continue}const c=s[a.index];if(!(c.direction&&c.direction!==a.direction)){if(c.pause)return this.timeline.seek(c.time),this.stage.render(this.timeline),this.pause(),this.playhead=this.readPlayhead(),this.waitingToWrap=!1,c.run(),!0;c.run()}}for(const a of this.ranges)o.some(([l,h])=>l!==h&&Math.max(l,h)>=a.start&&Math.min(l,h)<=a.end)&&a.run();return!1}tween(t,e,n,s){const r=this.resolve(t);if(!r)return;const{onStart:o,onUpdate:a,onComplete:c}=e[e.length-1];if(o||a||c){let l=1/0,h=-1/0;const f=(u,d,g)=>{s(u,d,g),l=Math.min(l,this.compat.lastStart),h=Math.max(h,this.compat.lastEnd)};if(this.buildTween(r,e,n,f),l===1/0)return;o&&this.events.push({time:l,direction:"forward",run:o}),a&&this.ranges.push({start:l,end:h,run:a}),c&&this.events.push({time:h,direction:"forward",run:c});return}this.buildTween(r,e,n,s)}keyframed(t,e,n){const s=this.resolve(t);if(!s)return;const r=yo(e);if(r.length===0)return;const o=s.length>1?Pe(e.stagger,this.staggerContext(s)):void 0,a=s.map(y=>this.targetFor(y)).filter(y=>y!==void 0),c=o?a.map(y=>[y]):[a],l=o?Lt(s.length,o).map(y=>y/1e3):[0],h=this.compat.timeOf(n)/1e3+jt(e.delay,0)/1e3;let f=1/0,u=-1/0;if(c.forEach((y,b)=>{r.forEach((v,w)=>{const S=w===0?h+l[b]:">";this.tween(y,[v],S,([T],k,A)=>this.compat.to(k,T,A)),f=Math.min(f,this.compat.lastStart),u=Math.max(u,this.compat.lastEnd)})}),f===1/0)return;const{onStart:d,onUpdate:g,onComplete:p}=e;d&&this.events.push({time:f,direction:"forward",run:d}),g&&this.ranges.push({start:f,end:u,run:g}),p&&this.events.push({time:u,direction:"forward",run:p})}staggerContext(t){return{count:t.length,columnsFromLayout:()=>Yn(t.map(e=>this.stage.elementFor(e))),random:()=>this.stage.utils.random(0,1)}}buildTween(t,e,n,s){const r=t.map(u=>this.targetFor(u));if(!(t.length>1&&(e.some(wo)||t.some(u=>this.stage.objectFor(u)!==void 0)))){const u=this.targetFor(t[0]);s(e.map(d=>this.prepare(Xn(d,0,u,this.stage.utils,r),t)),t,n);return}const a=e.length-1,{stagger:c,...l}=e[a],h=Pe(c,this.staggerContext(t)),f=h?Lt(t.length,h).map(u=>u/1e3):t.map(()=>0);t.forEach((u,d)=>{const g=d===0?jt(l.delay,0)/1e3+f[0]:0,p=d===0?0:f[d]-f[d-1],y=d===0?n:`<${p<0?"-":"+"}${Math.abs(p).toFixed(6)}`,v=e.map((w,S)=>S===a?{...l,delay:g}:w).map(w=>this.prepare(Xn(w,d,this.targetFor(u),this.stage.utils,r),[u]));s(v,[u],y)})}targetFor(t){return this.stage.elementFor(t)??this.stage.objectFor(t)}prepare(t,e){const n=o=>this.options.onWarning?.(o),s=o=>this.stage.query(o);let r=t;if(t.motionPath!==void 0){const o=Rr(t.motionPath,{query:s,targets:e.map(a=>this.stage.elementFor(a)).filter(a=>!!a),warn:n});r={...r,motionPath:o}}if(t.morphSVG!==void 0){const o=Ir(t.morphSVG,s,n),{morphSVG:a,...c}=r;r=o?{...r,morphSVG:o}:c}if(t.drawSVG!==void 0){const o=Vn(this.stage.elementFor(e[0]));if(o===void 0){n("gsap-compat: drawSVG needs an SVG shape with a stroke (path, line, circle…)");const{drawSVG:a,...c}=r;r=c}else r=cr(r,o)}return r}resolve(t){const e=this.stage.resolveTargets(t);if(e.length===0){this.options.onWarning?.(`gsap-compat: no elements found for target ${So(t)}`);return}return this.firstElement??=e.map(n=>this.stage.elementFor(n)).find(n=>n!==void 0),e}}function Bn(i=new rn){const t=r=>{const{config:o}=Wt(r);return new W(i,{repeat:o.repeat,yoyo:o.yoyo,repeatDelay:o.repeatDelay,paused:o.paused,onStart:o.onStart,onUpdate:o.onUpdate,onComplete:o.onComplete,onRepeat:o.onRepeat,onReverseComplete:o.onReverseComplete,repeatRefresh:o.repeatRefresh,scrollTrigger:o.scrollTrigger})},e=r=>{const{onStart:o,onUpdate:a,onComplete:c,onRepeat:l,onReverseComplete:h,repeatRefresh:f,...u}=r;return u},n=r=>(r&&i.collector?.track(r),r),s={stage:i,ticker:i.ticker,utils:i.utils,getProperty:(r,o)=>{const[a]=i.resolveTargets(r);if(a===void 0)return;const c=i.objectFor(a);return c?c[o]:i.appliedValue(a,o)??Ji(o)},scrollTrigger:r=>n(Ue(i,r)),scrollBatch:(r,o)=>bo(i,r,o).map(a=>n(a)),scrollTo:(r,o)=>Nn(s,i,r,o),refreshScroll:()=>{Et.refreshAll(),Ye.refreshAll()},smoothScroll:(r={})=>{const o=typeof r.scroller=="string"?(i.collector?.scope??i.root).querySelector(r.scroller):r.scroller;return n(new Ye({...r,scroller:o}).start())},context:(r,o)=>{const a=new In(i,o);return r&&a.add(()=>r(a)),a},matchMedia:r=>new ao(i,r),customEase:Fn.create,customBounce:$n.create,customWiggle:Dn.create,pageTransition:r=>uo(s,i,o=>new W(i,o),r),imageSequence:(r,o)=>{const a=typeof r=="string"?(i.collector?.scope??i.root).querySelector(r):r;if(!(a instanceof HTMLCanvasElement))throw new Error(`gsap-compat: imageSequence needs a <canvas>, got ${String(r)}`);return n(new co(a,o))},quickTo:(r,o,a={})=>{const c=new W(i,{paused:!0}),[l]=i.resolveTargets(r);return Object.assign(f=>{if(!l)return;const u=a.spring!==void 0?i.velocityOf(l,o)??0:0;c.compat.reset(),c.compat.to(l,{[o]:f,duration:a.duration??.4,ease:a.ease??"power3.out",...a.spring!==void 0&&{spring:vo(a.spring,o,u)}}),c.timeline.stop(),c.timeline.play(),i.activate(c.timeline)},{tween:c,kill:()=>c.kill()})},timeline:r=>new W(i,r),to:(r,o)=>{if(o.scrollTo!==void 0){const{scrollTo:a,...c}=o,l=typeof a=="object"&&a!==null&&!("nodeType"in a)?a:{},h=typeof r!="string"&&r!==window&&r.nodeType===1;return Nn(s,i,a,{...c,offsetX:l.offsetX,offsetY:l.offsetY,scroller:h?r:void 0})}return t(o).to(r,e(o))},from:(r,o)=>t(o).from(r,e(o)),fromTo:(r,o,a)=>t(a).fromTo(r,o,e(a)),set:(r,o)=>t(o).set(r,e(o)),delayedCall:(r,o,a)=>new W(i).call(o,a,r),killTweensOf:(r,o)=>{const a=i.resolveTargets(r),c=typeof o=="string"?o.split(",").map(l=>l.trim()).filter(Boolean):o;for(const l of[...i.liveTimelines])l.killTweensOf(a,c)},convertToPath:r=>Fr(r,i.root),splitText:(r,o)=>{const a=i.collector?.scope??i.root,c=typeof r=="string"?Array.from(a.querySelectorAll(r)):"nodeType"in r?[r]:Array.from(r);return n(Yr(c,o))},draggable:(r,o)=>n(Nr(s,i,r,o)),getFlipState:r=>Le(i,r),flipFrom:(r,o)=>$e(i,a=>new W(i,a),r,o),flip:(r,o,a)=>{const c=Le(i,r);return o(),$e(i,l=>new W(i,l),c,{targets:r,...a})}};return s}const N=Bn();function vo(i,t,e){return i===!0?{velocity:{[t]:e}}:typeof i=="string"?{preset:i,velocity:{[t]:e}}:{...i,velocity:{[t]:e}}}function wo(i){return i.morphSVG!==void 0||i.drawSVG!==void 0||i.text!==void 0||i.scrambleText!==void 0||qn(i)}function qn(i){return Object.entries(i).some(([t,e])=>(typeof e=="function"||Qi(e))&&!xe.has(t))}function Xn(i,t,e,n,s){if(!qn(i))return i;const r={};for(const[o,a]of Object.entries(i))xe.has(o)?r[o]=a:typeof a=="function"?r[o]=a(t,e,s):Qi(a)?r[o]=n.resolveRandomString(a):r[o]=a;return r}function Yn(i){const t=i.map(n=>n?.getBoundingClientRect().top);if(t[0]===void 0)return i.length;let e=0;for(const n of t){if(n===void 0||Math.abs(n-t[0])>1)break;e++}return Math.max(1,e)}function Vn(i){const t=i;if(typeof t?.getTotalLength=="function")return t.getTotalLength()}function To(i){if(typeof i=="number"||typeof i=="string"||Array.isArray(i)&&i.every(t=>typeof t=="number"))return i}function So(i){return typeof i=="string"?`"${i}"`:String(i)}class We{media;offset;driftTolerance;constructor(t,e={}){this.media=t,this.offset=e.offset??0,this.driftTolerance=Math.max(0,e.driftTolerance??.15)}targetTime(t){return Math.max(0,t/1e3+this.offset)}update(t,e){const n=this.targetTime(t);e?(this.media.paused&&this.safePlay(),Math.abs(this.media.currentTime-n)>this.driftTolerance&&(this.media.currentTime=n)):(this.media.paused||this.media.pause(),this.media.currentTime!==n&&(this.media.currentTime=n))}seek(t){this.media.currentTime=this.targetTime(t)}setRate(t){this.media.playbackRate=t}dispose(){this.media.paused||this.media.pause()}safePlay(){const t=this.media.play();t&&typeof t.catch=="function"&&t.catch(()=>{})}}function Un(i,t,e,n,s){const r=e-s;if(r<0){t.paused||t.pause(),t.currentTime=0;return}i.update(r,n)}class Gt{container;timeline=null;adapter;animationFrameId;lastTime;options;targets={};isDestroyed=!1;mediaSync;mediaTargets=[];symbolInstances=[];markerList=[];listeners=new Set;playhead={time:0,iteration:0,direction:"forward"};stepping=!1;lastMarkerId=null;reducedQuery;onReducedChange=()=>this.applyReducedMotion();visibilityObserver;onScreen=!0;pausedByVisibility=!1;autoplayWhenSeen=!1;onDocumentVisibility=()=>this.updateVisibility();constructor(t,e={}){if(typeof t=="string"){const n=document.querySelector(t);if(!n)throw new Error(`Container not found: ${t}`);this.container=n}else this.container=t;this.options=e,this.adapter=new tt}async load(t){let e;if(typeof t=="string"){const n=await fetch(t);if(!n.ok)throw new Error(`Failed to load animation: ${n.statusText}`);e=await n.json()}else e=t;this.options.speed!==void 0&&(e.config={...e.config,speed:this.options.speed}),this.options.loop!==void 0&&(e.config={...e.config,loop:this.options.loop}),this.options.alternate!==void 0&&(e.config={...e.config,alternate:this.options.alternate}),this.timeline=lt(e),this.markerList=this.timeline.markers,this.lastMarkerId=null,this.options.onComplete&&(this.timeline.onComplete=this.options.onComplete),this.options.onUpdate&&(this.timeline.onUpdate=this.options.onUpdate),this.autoRegisterTargets(),this.setupSymbolInstances(),this.scanMedia(),this.showInitialFrame(),this.watchReducedMotion(),this.watchVisibility(),this.options.autoplay&&!this.reducedMotion&&(this.options.playWhenVisible&&!this.onScreen?this.autoplayWhenSeen=!0:this.play())}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){for(const t of this.listeners)t()}get reducedMotion(){return this.reducedQuery?.matches===!0}get markers(){return this.markerList}get currentMarker(){const t=this.currentTime;let e;for(const n of this.markers)if(n.time<=t+.5)e=n;else break;return e}caption(t,e){const n=t?this.markers.find(o=>o.id===t):this.currentMarker;if(!n)return;const s=e??this.language(),r=o=>o?.[s]?.[n.id]??o?.[s.split("-")[0]]?.[n.id];return r(this.options.captions)??r(this.timeline?.captions)??n.label}next(){if(!this.timeline)return;const t=this.currentTime,e=this.markers.find(n=>n.time>t+.5);if(this.reducedMotion){this.seek(e?e.time:this.duration);return}t>=this.duration-.5||(this.stepping=e!==void 0,this.startPlaying())}prev(){if(!this.timeline)return;const t=this.currentTime,e=[...this.markers].reverse().find(n=>n.time<t-.5);this.pause(),this.seek(e?e.time:0)}goToMarker(t){const e=this.markers.find(n=>n.id===t);e&&(this.pause(),this.seek(e.time))}language(){return this.container.closest("[lang]")?.getAttribute("lang")||(typeof document<"u"?document.documentElement.lang:"")||"en"}showInitialFrame(){if(!this.timeline)return;const t=this.options.initialFrame??"start";if(t==="none")return;const e=t==="end"?this.timeline.duration:t==="start"?0:t;this.timeline.seek(Math.max(0,Math.min(this.timeline.duration,e))),this.applyState()}watchReducedMotion(){this.options.respectReducedMotion===!1||typeof window>"u"||typeof window.matchMedia!="function"||(this.reducedQuery??=window.matchMedia("(prefers-reduced-motion: reduce)"),this.reducedQuery.addEventListener?.("change",this.onReducedChange),this.reducedQuery.matches&&this.applyReducedMotion())}applyReducedMotion(){!this.reducedMotion||!this.timeline||(this.autoplayWhenSeen=!1,this.pause(),this.seek(this.timeline.duration))}watchVisibility(){if(!(!this.options.playWhenVisible||typeof window>"u")){if(typeof IntersectionObserver=="function"){this.visibilityObserver?.disconnect(),this.listeners.clear(),this.visibilityObserver=new IntersectionObserver(e=>{for(const n of e)this.onScreen=n.isIntersecting;this.updateVisibility()}),this.visibilityObserver.observe(this.container);const t=this.container.getBoundingClientRect?.();t&&(t.width>0||t.height>0)&&(this.onScreen=t.bottom>0&&t.top<window.innerHeight&&t.right>0&&t.left<window.innerWidth)}document.addEventListener("visibilitychange",this.onDocumentVisibility)}}updateVisibility(){const t=this.onScreen&&document.visibilityState!=="hidden";!t&&this.isPlaying?(this.pausedByVisibility=!0,this.pause()):t&&(this.pausedByVisibility||this.autoplayWhenSeen)&&!this.reducedMotion&&(this.pausedByVisibility=!1,this.autoplayWhenSeen=!1,this.startPlaying())}announceMarker(){if(!this.options.onMarker)return;const t=this.currentMarker,e=t?.id;e!==this.lastMarkerId&&(this.lastMarkerId=e,this.options.onMarker(t))}scanMedia(){this.mediaTargets=[],this.container.querySelectorAll("[data-tinyfly-media]").forEach(e=>{const n=e,s=Number(n.getAttribute("data-tinyfly-start")??"0")||0,r=n.getAttribute("data-volume");r!==null&&(n.volume=Math.max(0,Math.min(1,Number(r)||0))),this.mediaTargets.push({el:n,startTime:s,sync:new We(n)})})}syncAllMedia(t,e){for(const n of this.mediaTargets)Un(n.sync,n.el,t,e,n.startTime)}loadFromString(t){const e=JSON.parse(t);this.load(e)}registerTarget(t,e){if(typeof e=="string"){const n=this.container.querySelector(e);n&&(this.targets[t]=n,this.adapter.registerTarget(t,n))}else this.targets[t]=e,this.adapter.registerTarget(t,e)}autoRegisterTargets(){this.container.querySelectorAll("[data-tinyfly]").forEach(e=>{const n=e.closest("[data-tinyfly-symbol]");if(n&&n!==e)return;const s=e.getAttribute("data-tinyfly");s&&this.registerTarget(s,e)}),this.timeline&&new Set(this.timeline.tracks.map(n=>n.target)).forEach(n=>{if(!this.targets[n]){const s=this.container.querySelector(`[data-tinyfly="${n}"]`)||this.container.querySelector(`.${n}`)||this.container.querySelector(`#${n}`);s&&this.registerTarget(n,s)}})}setupSymbolInstances(){this.symbolInstances=[];const t=this.options.symbols;if(!t||t.length===0)return;const e=new Map(t.map(n=>[n.id,n]));this.container.querySelectorAll("[data-tinyfly-symbol]").forEach(n=>{const s=n.getAttribute("data-tinyfly-symbol");if(!s)return;const r=e.get(s);if(!r||!r.timeline.tracks?.length)return;const o=new tt;n.querySelectorAll("[data-tinyfly]").forEach(a=>{const c=a.getAttribute("data-tinyfly");c&&o.registerTarget(c,a)}),this.symbolInstances.push({adapter:o,timeline:lt(r.timeline)})})}attachMedia(t,e){this.mediaSync=new We(t,e),this.timeline&&(this.mediaSync.setRate(this.timeline.speed),this.mediaSync.update(this.timeline.currentTime,this.isPlaying))}detachMedia(){this.mediaSync?.dispose(),this.mediaSync=void 0}play(){!this.timeline||this.isDestroyed||(this.autoplayWhenSeen=!1,this.stepping=this.options.stepMode===!0,this.startPlaying())}startPlaying(){if(!this.timeline||this.isDestroyed)return;const t=this.timeline.playbackState==="idle";this.timeline.play(),t&&this.timeline.currentTime===0&&this.applyState(),this.playhead={time:this.timeline.currentTime,iteration:this.timeline.loopIteration,direction:this.timeline.direction},this.mediaSync?.update(this.timeline.currentTime,!0),this.syncAllMedia(this.timeline.currentTime,!0),this.startAnimationLoop(),this.notify()}pause(){this.timeline&&(this.stepping=!1,this.timeline.pause(),this.notify(),this.mediaSync?.update(this.timeline.currentTime,!1),this.syncAllMedia(this.timeline.currentTime,!1),this.stopAnimationLoop())}stop(){this.timeline&&(this.timeline.stop(),this.stopAnimationLoop(),this.applyState(),this.mediaSync?.update(this.timeline.currentTime,!1),this.syncAllMedia(this.timeline.currentTime,!1))}seek(t){this.timeline&&(this.timeline.seek(t),this.applyState(),this.playhead={time:this.timeline.currentTime,iteration:this.timeline.loopIteration,direction:this.timeline.direction},this.mediaSync?.seek(this.timeline.currentTime),this.syncAllMedia(this.timeline.currentTime,this.isPlaying))}setSpeed(t){this.timeline&&(this.timeline.speed=t,this.mediaSync?.setRate(t))}reverse(){this.timeline&&this.timeline.reverse()}get currentTime(){return this.timeline?.currentTime??0}get duration(){return this.timeline?.duration??0}get isPlaying(){return this.timeline?.playbackState==="playing"}destroy(){this.isDestroyed=!0,this.stopAnimationLoop(),this.reducedQuery?.removeEventListener?.("change",this.onReducedChange),this.visibilityObserver?.disconnect(),typeof document<"u"&&document.removeEventListener("visibilitychange",this.onDocumentVisibility),this.mediaSync?.dispose(),this.mediaSync=void 0;for(const t of this.mediaTargets)t.el.paused||t.el.pause();this.mediaTargets=[],this.adapter.clearTargets();for(const t of this.symbolInstances)t.adapter.clearTargets();this.symbolInstances=[],this.timeline=null}startAnimationLoop(){if(this.animationFrameId!==void 0)return;this.lastTime=performance.now();const t=e=>{if(this.isDestroyed||!this.timeline)return;const n=e-(this.lastTime??e);this.lastTime=e;const s=this.playhead;this.timeline.tick(n),this.stopAtMarker(s),this.applyState();const r=this.timeline.playbackState==="playing";this.mediaSync?.update(this.timeline.currentTime,r),this.syncAllMedia(this.timeline.currentTime,r),this.timeline.playbackState==="playing"?this.animationFrameId=requestAnimationFrame(t):(this.animationFrameId=void 0,this.notify())};this.animationFrameId=requestAnimationFrame(t)}stopAtMarker(t){const e=this.timeline,n={time:e.currentTime,iteration:e.loopIteration,direction:e.direction};this.playhead=n;const s=this.markers;if(s.length===0)return;const{crossings:r}=we(s.map(o=>o.time),t,n,{duration:e.duration,alternate:e.config.alternate===!0,holding:e.repeatDelayRemaining>0});for(const o of r){if(o.kind!=="event")continue;const a=s[o.index];if(this.stepping||a.pause){this.stepping=!1,e.pause(),e.seek(a.time),this.playhead={time:a.time,iteration:e.loopIteration,direction:e.direction};return}}}stopAnimationLoop(){this.animationFrameId!==void 0&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}applyState(){if(!this.timeline)return;const t=this.timeline.currentTime;this.adapter.applyState(this.timeline.getStateAtTime(t)),this.announceMarker(),this.notify();for(const e of this.symbolInstances){const n=e.timeline.duration;e.adapter.applyState(e.timeline.getStateAtTime(n>0?t%n:t))}}}async function ko(i,t,e={}){const n=new Gt(i,{...e,autoplay:!0});return await n.load(t),n}function Mo(i,t={}){return new Gt(i,t)}const Wn={play:"Play",pause:"Pause",prev:"Previous step",next:"Next step",restart:"Restart",scrub:"Position",speed:"Speed",reveal:"Reveal",step:"Step",of:"of",stepFormat:"{index} / {total}"},jn="tinyfly-controls-style",Ao=`
3
+ .tf-ctl { --tf-ctl-fg: #1d1d1f; --tf-ctl-bg: #f4f2ee; --tf-ctl-accent: #c2410c; --tf-ctl-radius: 8px;
4
+ font: 14px/1.4 var(--tf-ctl-font, system-ui, sans-serif); color: var(--tf-ctl-fg); margin-top: 8px; }
5
+ .tf-ctl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border-radius: var(--tf-ctl-radius); background: var(--tf-ctl-bg); }
6
+ .tf-ctl-btn { min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: calc(var(--tf-ctl-radius) - 2px); background: transparent; color: inherit; font: inherit; cursor: pointer; }
7
+ .tf-ctl-btn:hover { background: color-mix(in srgb, var(--tf-ctl-fg) 8%, transparent); }
8
+ .tf-ctl-btn:focus-visible, .tf-ctl-scrub:focus-visible, .tf-ctl-speed:focus-visible { outline: 2px solid var(--tf-ctl-accent); outline-offset: 2px; }
9
+ .tf-ctl-btn[disabled] { opacity: 0.4; cursor: default; }
10
+ .tf-ctl-primary { background: var(--tf-ctl-accent); color: #fff; }
11
+ .tf-ctl-primary:hover { background: var(--tf-ctl-accent); filter: brightness(1.08); }
12
+ .tf-ctl-scrub { flex: 1 1 120px; min-width: 80px; accent-color: var(--tf-ctl-accent); }
13
+ .tf-ctl-speed { height: 32px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; }
14
+ .tf-ctl-step { font-variant-numeric: tabular-nums; opacity: 0.75; padding: 0 4px; }
15
+ .tf-ctl-caption { margin: 6px 2px 0; min-height: 1.4em; }
16
+ .tf-ctl-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 2px 0; font-weight: 600; }
17
+ .tf-ctl-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
18
+ /* The hidden attribute only hides through the browser's default stylesheet; any rule
19
+ above that sets display would override it, so enforce it for everything here. */
20
+ .tf-ctl [hidden] { display: none !important; }
21
+ `;function xo(i){if(i.getElementById(jn))return;const t=i.createElement("style");t.id=jn,t.textContent=Ao,i.head.appendChild(t)}function zn(i,t,e={}){const n=t.ownerDocument;xo(n);const s={...Wn,...e.labels},r=e.speeds??[.5,1,2],o=()=>i.markers.length>0,a=()=>i.markers.some(M=>M.label!==void 0||i.caption(M.id)!==void 0),c=n.createElement("div");c.className="tf-ctl";const l=n.createElement("div");l.className="tf-ctl-bar",l.setAttribute("role","group");const h=(M,E,R,F="")=>{const I=n.createElement("button");return I.type="button",I.className=`tf-ctl-btn ${F}`.trim(),I.setAttribute("aria-label",M),I.title=M,I.textContent=E,I.addEventListener("click",R),I},f=h(s.restart,"⟲",()=>{i.pause(),i.seek(0)}),u=h(s.prev,"◀",()=>i.prev()),d=h(s.play,"▶",()=>i.isPlaying?i.pause():p(),"tf-ctl-primary"),g=h(s.next,"▶|",()=>i.next()),p=()=>{i.currentTime>=i.duration-.5&&i.seek(0),i.play()},y=n.createElement("input");y.type="range",y.className="tf-ctl-scrub",y.min="0",y.max="1000",y.step="1",y.setAttribute("aria-label",s.scrub),y.addEventListener("input",()=>{i.pause(),i.seek(Number(y.value)/1e3*i.duration)});const b=n.createElement("span");b.className="tf-ctl-step";const v=n.createElement("select");v.className="tf-ctl-speed",v.setAttribute("aria-label",s.speed);for(const M of r){const E=n.createElement("option");E.value=String(M),E.textContent=`${M}×`,M===1&&(E.selected=!0),v.appendChild(E)}v.addEventListener("change",()=>i.setSpeed(Number(v.value))),l.append(f,u,d,g,y,b),r.length>0&&l.append(v),c.append(l);const w=n.createElement("p");w.className="tf-ctl-caption",w.setAttribute("aria-live","polite"),e.captions!==!1&&c.append(w);const S=n.createElement("div");S.className="tf-ctl-question",S.hidden=!0;const T=n.createElement("span"),k=h(s.reveal,s.reveal,()=>i.play(),"tf-ctl-primary");S.append(T,k),c.append(S);const A=e.mount;A?A.appendChild(c):t.insertAdjacentElement("afterend",c);const C=()=>{const M=i.isPlaying;d.textContent=M?"❚❚":"▶",d.setAttribute("aria-label",M?s.pause:s.play),d.title=M?s.pause:s.play;const E=i.duration;n.activeElement!==y&&(y.value=String(E>0?Math.round(i.currentTime/E*1e3):0));const R=i.markers;if(u.hidden=g.hidden=b.hidden=R.length===0,R.length>0){const F=i.currentMarker,I=F?R.indexOf(F)+1:0;b.textContent=s.stepFormat.replace("{index}",String(I)).replace("{total}",String(R.length)),b.setAttribute("aria-label",`${s.step} ${I} ${s.of} ${R.length}`),u.disabled=i.currentTime<=.5,g.disabled=i.currentTime>=E-.5;const Q=i.caption()??"";w.textContent!==Q&&(w.textContent=Q),w.hidden=!a();const et=!M&&F?.question!==void 0&&Math.abs(i.currentTime-F.time)<1;S.hidden=!et,et&&T.textContent!==F.question&&(T.textContent=F.question)}else S.hidden=!0,w.hidden=!0},D=i.subscribe(C);C();const P=e.keyboardScope??t;!P.hasAttribute("tabindex")&&P.tabIndex<0&&(P.tabIndex=0);const x=new WeakSet,_=M=>{if(x.has(M)||(x.add(M),M.defaultPrevented||M.altKey||M.ctrlKey||M.metaKey))return;const E=M.target;if(!(E.tagName==="INPUT"||E.tagName==="SELECT")&&!(M.key===" "&&E.tagName==="BUTTON"))switch(M.key){case" ":M.preventDefault(),i.isPlaying?i.pause():p();break;case"ArrowRight":if(!o())return;M.preventDefault(),i.next();break;case"ArrowLeft":if(!o())return;M.preventDefault(),i.prev();break;case"Home":M.preventDefault(),i.pause(),i.seek(0);break}};return P.addEventListener("keydown",_),c.addEventListener("keydown",_),{element:c,destroy(){D(),P.removeEventListener("keydown",_),c.removeEventListener("keydown",_),c.remove()}}}const Kt=new WeakMap;let Po=0;function Qt(i,t,e){if(i)try{return JSON.parse(i)}catch(n){console.warn(`tinyfly: invalid ${t} JSON on`,e,n);return}}async function Hn(i,t={}){const e=Kt.get(i);if(e)return e;const n=i.querySelector("script[data-tinyfly-timeline]"),s=i.getAttribute("data-src");let r=n?Qt(n.textContent,"timeline",i):void 0;const o=Eo(i.getAttribute("data-markers"));if(!r&&s&&o){const f=await fetch(s);f.ok&&(r=await f.json())}if(r&&o&&!r.config.markers?.length&&(r.config={...r.config,markers:o.map((f,u)=>({id:`step-${u+1}`,time:f}))}),!r&&!s){console.warn('tinyfly: embed has no timeline (a <script type="application/json" data-tinyfly-timeline> or data-src)',i);return}const a=Qt(i.querySelector("script[data-tinyfly-captions]")?.textContent,"captions",i),c={playWhenVisible:!0,...t.player,...a&&{captions:a},...Qt(i.getAttribute("data-options"),"data-options",i)};Co(i);const l=new Gt(i,c),h={element:i,player:l};if(Kt.set(i,h),i.setAttribute("data-tinyfly-mounted",""),await l.load(r??s),i.getAttribute("data-controls")!=="false"){const f=Qt(i.getAttribute("data-labels"),"data-labels",i),u=i.querySelector("figcaption");h.controls=zn(l,i,{...t.controls,labels:{...t.controls?.labels,...f},mount:void 0}),u?i.insertBefore(h.controls.element,u):i.appendChild(h.controls.element)}return h}function Eo(i){if(!i)return;const t=i.split(/[\s,]+/).filter(Boolean).map(Number).filter(e=>Number.isFinite(e)&&e>=0).sort((e,n)=>e-n);return t.length>0?t:void 0}async function Gn(i=document,t={}){const e=Array.from(i.querySelectorAll("[data-tinyfly-embed]"));return(await Promise.all(e.map(s=>Hn(s,t)))).filter(s=>s!==void 0)}function _o(i){const t=Kt.get(i);t&&(t.controls?.destroy(),t.player.destroy(),Kt.delete(i),i.removeAttribute("data-tinyfly-mounted"))}function Co(i){const t=i.querySelector("svg");if(!t||t.hasAttribute("role")||t.hasAttribute("aria-hidden"))return;const e=i.getAttribute("data-alt"),n=i.querySelector("figcaption");t.setAttribute("role","img"),e?t.setAttribute("aria-label",e):n&&(n.id||=`tinyfly-caption-${++Po}`,t.setAttribute("aria-labelledby",n.id))}function Ro(){if(!(typeof document<"u"?document.currentScript:null)?.hasAttribute("data-tinyfly-auto"))return;const t=()=>{Gn()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}class Kn{container;containerA;containerB;adapterA;adapterB;timelineA=null;timelineB=null;symbolDefs=new Map;nestedByAdapter=new Map;sequence=null;options;_currentSceneIndex=0;_state="idle";_isPlaying=!1;_isDestroyed=!1;loopIteration=0;animationFrameId;lastTime;transitionTimer;constructor(t,e={}){if(typeof t=="string"){const n=document.querySelector(t);if(!n)throw new Error(`Container not found: ${t}`);this.container=n}else this.container=t;this.options=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.containerA=this.createSceneContainer(),this.containerB=this.createSceneContainer(),this.container.appendChild(this.containerA),this.container.appendChild(this.containerB),this.containerB.style.visibility="hidden",this.adapterA=new tt,this.adapterB=new tt}async load(t){let e;if(typeof t=="string"){const n=await fetch(t);if(!n.ok)throw new Error(`Failed to load sequence: ${n.statusText}`);e=await n.json()}else e=t;this.sequence=e,this.symbolDefs.clear();for(const n of e.symbols??[])n.timeline?.tracks?.length&&this.symbolDefs.set(n.id,n.timeline);this.container.style.width=`${e.canvas.width}px`,this.container.style.height=`${e.canvas.height}px`,e.scenes.length>0&&(this.renderScene(e.scenes[0],this.containerA,this.adapterA),this.timelineA=this.createTimeline(e.scenes[0])),this.options.autoplay&&this.play()}play(){if(!(!this.sequence||this._isDestroyed)&&this.sequence.scenes.length!==0){if(this._isPlaying=!0,this._state==="idle"){if(this._state="playing-scene",this._currentSceneIndex=0,this.timelineA)this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.play();else{this.onSceneComplete();return}this.options.onSceneChange?.(0)}else this._state==="playing-scene"&&this.timelineA&&this.timelineA.play();this.startAnimationLoop()}}pause(){this._isPlaying&&(this._isPlaying=!1,this.timelineA&&this.timelineA.pause(),this.timelineB&&this.timelineB.pause(),this.stopAnimationLoop())}stop(){if(this._isPlaying=!1,this._state="idle",this._currentSceneIndex=0,this.loopIteration=0,this.transitionTimer!==void 0&&(clearTimeout(this.transitionTimer),this.transitionTimer=void 0),this.timelineA&&this.timelineA.stop(),this.timelineB&&this.timelineB.stop(),this.stopAnimationLoop(),this.sequence&&this.sequence.scenes.length>0&&(this.clearContainer(this.containerA),this.clearContainer(this.containerB),this.adapterA.clearTargets(),this.adapterB.clearTargets(),this.containerB.style.visibility="hidden",this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB),this.renderScene(this.sequence.scenes[0],this.containerA,this.adapterA),this.timelineA=this.createTimeline(this.sequence.scenes[0]),this.timelineA)){const t=this.timelineA.getStateAtTime(0);this.adapterA.applyState(t),this.applyNested(this.adapterA,0)}}goToScene(t){if(!this.sequence||t<0||t>=this.sequence.scenes.length)return;const e=this._isPlaying;this.transitionTimer!==void 0&&(clearTimeout(this.transitionTimer),this.transitionTimer=void 0),this.stopAnimationLoop(),this.timelineA&&this.timelineA.stop(),this.timelineB&&this.timelineB.stop(),this._currentSceneIndex=t,this._state=e?"playing-scene":"idle",this.clearContainer(this.containerA),this.clearContainer(this.containerB),this.adapterA.clearTargets(),this.adapterB.clearTargets(),this.containerB.style.visibility="hidden",this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB);const n=this.sequence.scenes[t];if(this.renderScene(n,this.containerA,this.adapterA),this.timelineA=this.createTimeline(n),this.options.onSceneChange?.(t),e)this.timelineA?(this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.play(),this.startAnimationLoop()):this.onSceneComplete();else if(this.timelineA){const s=this.timelineA.getStateAtTime(0);this.adapterA.applyState(s),this.applyNested(this.adapterA,0)}}destroy(){this._isDestroyed=!0,this._isPlaying=!1,this.transitionTimer!==void 0&&(clearTimeout(this.transitionTimer),this.transitionTimer=void 0),this.stopAnimationLoop(),this.adapterA.clearTargets(),this.adapterB.clearTargets();for(const t of this.nestedByAdapter.values())for(const e of t)e.adapter.clearTargets();this.nestedByAdapter.clear(),this.timelineA&&this.timelineA.stop(),this.timelineB&&this.timelineB.stop(),this.timelineA=null,this.timelineB=null,this.containerA.parentNode&&this.containerA.remove(),this.containerB.parentNode&&this.containerB.remove(),this.sequence=null}get currentSceneIndex(){return this._currentSceneIndex}get sceneCount(){return this.sequence?.scenes.length??0}get isPlaying(){return this._isPlaying}get state(){return this._state}createSceneContainer(){const t=document.createElement("div");return t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",t}renderScene(t,e,n){e.innerHTML="",n.clearTargets();const s=document.createElement("div");s.style.cssText="position:absolute;inset:0;transform-origin:center center",s.setAttribute("data-tinyfly","Camera"),e.appendChild(s),n.registerTarget("Camera",s);for(const r of t.elements){if(!r.html)continue;const o=document.createElement("div");o.innerHTML=r.html.trim();const a=o.firstElementChild;if(a){s.appendChild(a);const c=a.getAttribute("data-tinyfly");c&&n.registerTarget(c,a)}}this.setupNested(s,n)}setupNested(t,e){const n=[];t.querySelectorAll("[data-tinyfly-symbol]").forEach(s=>{const r=s.getAttribute("data-tinyfly-symbol");if(!r)return;const o=this.symbolDefs.get(r);if(!o)return;const a=new tt;s.querySelectorAll("[data-tinyfly]").forEach(c=>{const l=c.getAttribute("data-tinyfly");l&&a.registerTarget(l,c)}),n.push({adapter:a,timeline:lt(o)})}),n.length?this.nestedByAdapter.set(e,n):this.nestedByAdapter.delete(e)}applyNested(t,e){const n=this.nestedByAdapter.get(t);if(n)for(const s of n){const r=s.timeline.duration;s.adapter.applyState(s.timeline.getStateAtTime(r>0?e%r:e))}}clearContainer(t){t.innerHTML=""}createTimeline(t){return t.timeline?lt(t.timeline):null}onSceneComplete(){if(this._isDestroyed||!this.sequence)return;const t=this._currentSceneIndex+1;if(t>=this.sequence.scenes.length){const e=this.options.loop??this.sequence.loop??0;e===-1||e>0&&this.loopIteration<e-1?(this.loopIteration++,this.beginTransitionTo(0)):(this._isPlaying=!1,this._state="idle",this.stopAnimationLoop(),this.options.onComplete?.())}else this.beginTransitionTo(t)}beginTransitionTo(t){if(!this.sequence||this._isDestroyed)return;const e=this.sequence.scenes[t],n=e.transition;if(n.type==="none"||n.duration<=0){this.switchToScene(t);return}this._state="transitioning",this.containerB.style.visibility="visible",this.renderScene(e,this.containerB,this.adapterB),this.timelineB=this.createTimeline(e),this.timelineB&&this.timelineB.play(),this.applyTransition(n.type,n.duration),this.transitionTimer=window.setTimeout(()=>{this.finishTransition(t)},n.duration)}applyTransition(t,e){const n=`${e}ms`,s="ease-in-out";switch(this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB),t){case"fade":this.containerB.style.opacity="0";break;case"slide-left":this.containerB.style.transform="translateX(100%)";break;case"slide-right":this.containerB.style.transform="translateX(-100%)";break;case"slide-up":this.containerB.style.transform="translateY(100%)";break;case"slide-down":this.containerB.style.transform="translateY(-100%)";break}switch(this.containerB.offsetHeight,this.containerA.style.transition=`opacity ${n} ${s}, transform ${n} ${s}`,this.containerB.style.transition=`opacity ${n} ${s}, transform ${n} ${s}`,t){case"fade":this.containerA.style.opacity="0",this.containerB.style.opacity="1";break;case"slide-left":this.containerA.style.transform="translateX(-100%)",this.containerB.style.transform="translateX(0)";break;case"slide-right":this.containerA.style.transform="translateX(100%)",this.containerB.style.transform="translateX(0)";break;case"slide-up":this.containerA.style.transform="translateY(-100%)",this.containerB.style.transform="translateY(0)";break;case"slide-down":this.containerA.style.transform="translateY(100%)",this.containerB.style.transform="translateY(0)";break}}resetTransitionStyles(t){t.style.transition="",t.style.opacity="1",t.style.transform=""}finishTransition(t){this.transitionTimer=void 0,this.timelineA&&(this.timelineA.stop(),this.timelineA=null),this.adapterA.clearTargets(),this.clearContainer(this.containerA);const e=this.containerA;this.containerA=this.containerB,this.containerB=e;const n=this.adapterA;this.adapterA=this.adapterB,this.adapterB=n,this.timelineA=this.timelineB,this.timelineB=null,this.containerB.style.visibility="hidden",this.resetTransitionStyles(this.containerA),this.resetTransitionStyles(this.containerB),this._currentSceneIndex=t,this._state="playing-scene",this.options.onSceneChange?.(t),this.timelineA?(this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.playbackState!=="playing"&&this.timelineA.play()):this.onSceneComplete()}switchToScene(t){if(!this.sequence||this._isDestroyed)return;this.timelineA&&this.timelineA.stop(),this.adapterA.clearTargets(),this.clearContainer(this.containerA);const e=this.sequence.scenes[t];this.renderScene(e,this.containerA,this.adapterA),this.timelineA=this.createTimeline(e),this._currentSceneIndex=t,this._state="playing-scene",this.options.onSceneChange?.(t),this.timelineA?(this.timelineA.onComplete=()=>this.onSceneComplete(),this.timelineA.play()):this.onSceneComplete()}startAnimationLoop(){if(this.animationFrameId!==void 0)return;this.lastTime=performance.now();const t=e=>{if(this._isDestroyed||!this._isPlaying)return;const n=e-(this.lastTime??e);if(this.lastTime=e,this.timelineA&&this.timelineA.playbackState==="playing"){this.timelineA.tick(n);const s=this.timelineA.getStateAtTime(this.timelineA.currentTime);this.adapterA.applyState(s),this.applyNested(this.adapterA,this.timelineA.currentTime)}if(this._state==="transitioning"&&this.timelineB&&this.timelineB.playbackState==="playing"){this.timelineB.tick(n);const s=this.timelineB.getStateAtTime(this.timelineB.currentTime);this.adapterB.applyState(s),this.applyNested(this.adapterB,this.timelineB.currentTime)}this._isPlaying?this.animationFrameId=requestAnimationFrame(t):this.animationFrameId=void 0};this.animationFrameId=requestAnimationFrame(t)}stopAnimationLoop(){this.animationFrameId!==void 0&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}}async function Io(i,t,e={}){const n=new Kn(i,{...e,autoplay:!0});return await n.load(t),n}const Lo={type:"none",duration:0};function Fo(i){const{timeline:t}=i,e=new tt;for(const[l,h]of Object.entries(i.targets)){const f=typeof h=="string"?document.querySelector(h):h;if(!f)throw new Error(`quickPlay: no element found for target "${l}" (${String(h)})`);e.registerTarget(l,f)}t.onUpdate=l=>{e.applyState(l),i.onUpdate?.(l)},i.onComplete&&(t.onComplete=i.onComplete);let n=null,s=null,r=!1;const o=l=>{if(r)return;const h=s===null?0:l-s;s=l,h>0&&t.tick(h),n=requestAnimationFrame(o)},a=()=>{n!==null||r||(s=null,n=requestAnimationFrame(o))},c=()=>{n!==null&&cancelAnimationFrame(n),n=null,s=null};return e.applyState(t.getStateAtTime(t.currentTime)),i.autoplay!==!1&&(t.play(),a()),{timeline:t,adapter:e,play(){t.play(),a()},pause(){t.pause(),c()},restart(){t.stop(),t.play(),a()},seek(l){t.seek(l*1e3),e.applyState(t.getStateAtTime(t.currentTime))},destroy(){r=!0,c(),t.stop(),e.clearTargets()}}}const $o={timeline:mr,to(i,t,e){const n=new J(e);return n.to(i,t),n},from(i,t,e){const n=new J(e);return n.from(i,t),n},fromTo(i,t,e,n){const s=new J(n);return s.fromTo(i,t,e),s},set(i,t,e){const n=new J(e);return n.set(i,t),n}},Do=N.to,Oo=N.from,No=N.fromTo,Bo=N.set,qo=N.timeline,Xo=N.ticker,Yo=N.splitText,Vo=N.context,Uo=N.matchMedia,Wo=N.quickTo,jo=N.imageSequence,zo=N.pageTransition;Ro(),m.Clock=Jn,m.CompatTimeline=J,m.CustomBounce=$n,m.CustomEase=Fn,m.CustomWiggle=Dn,m.DEFAULT_BAKE_INTERVAL_MS=de,m.DEFAULT_INERTIA_FRICTION=ne,m.DEFAULT_LABELS=Wn,m.DEFAULT_SPRING=q,m.DEFAULT_TRANSITION=Lo,m.Draggable=Re,m.FORMAT_VERSION=gt,m.INERTIA_MAX_DURATION_MS=Ge,m.InertiaTrackPlayer=Ri,m.LiveTimeline=W,m.MORPH_SAMPLES=Ts,m.ManualClock=Zn,m.MediaSync=We,m.Observer=un,m.SPRING_MAX_DURATION_MS=ie,m.SPRING_PRESETS=$t,m.SPRING_STEP_MS=nt,m.ScrollAnimator=Pn,m.ScrollDriver=Et,m.ScrollMarkers=En,m.ScrollPin=kn,m.SmoothScroll=Ye,m.SpringSampler=bt,m.SpringTrackPlayer=Ci,m.Stage=rn,m.Timeline=ve,m.TinyflyPlayer=Gt,m.TinyflySequencer=Kn,m.TrackPlayer=Yt,m.ValueResolver=Us,m.VisibilityDriver=Sn,m.backOut=ri,m.bakeEasing=ge,m.bakeInertiaTrack=me,m.bakeSpringTrack=pe,m.bounceOut=si,m.charactersFor=Ii,m.clamp01=Ne,m.clearMorphCache=Cs,m.clearPathCache=gs,m.containerProgressAt=Be,m.context=Vo,m.create=Mo,m.createControls=zn,m.createCubicBezier=ii,m.createLive=Bn,m.createRandom=Ni,m.createTrack=Xt,m.criticalDamping=is,m.customBounce=Ui,m.customEase=Vi,m.customWiggle=Wi,m.deserializeTimeline=lt,m.deserializeTrack=Di,m.draggable=Dr,m.easeIn=Je,m.easeInCubic=se,m.easeInOut=ei,m.easeInOutCubic=wt,m.easeInOutQuad=Ze,m.easeInQuad=Ke,m.easeOut=ti,m.easeOutCubic=re,m.easeOutQuad=Qe,m.elasticOut=ni,m.expandParametricEasings=Ei,m.from=Oo,m.fromJSON=qs,m.fromTo=No,m.getEasingFunction=X,m.getInterpolator=Mt,m.getMotionPathPoint=ye,m.getPathLength=ys,m.getPointAtProgress=hi,m.gridLinesFor=pn,m.hasKeyframes=ze,m.hashSeed=Xs,m.imageSequence=jo,m.inertiaDuration=rt,m.inertiaRest=st,m.inertiaValueAt=Ot,m.inertiaVelocityAt=os,m.interpolateArray=Ai,m.interpolateColor=Mi,m.interpolateMotionPath=$s,m.interpolateNumber=Y,m.interpolatePathString=xi,m.interpolateString=fe,m.isCubicBezierEasing=it,m.isInertiaTrack=j,m.isMotionPathPoint=Qn,m.isMotionPathTrack=Jt,m.isParametricEasing=mt,m.isPathData=at,m.isSpringTrack=z,m.isTextTrack=Rt,m.isUnderdamped=es,m.isUnresolved=Vs,m.linear=Nt,m.live=N,m.mapEase=At,m.matchMedia=Uo,m.maxStaggerDistance=ee,m.morphPath=yi,m.mount=Hn,m.mountAll=Gn,m.naturalRest=vt,m.pageTransition=zo,m.parametricEasing=ai,m.parseEdge=De,m.parsePath=Z,m.parseTrigger=Oe,m.play=ko,m.playSequence=Io,m.playWhenVisible=Gr,m.playheadCrossings=we,m.pointAtDistance=ae,m.pointsToPath=zi,m.quickPlay=Fo,m.quickTo=Wo,m.randomBetween=Se,m.randomChoice=Ys,m.randomSnapped=Bi,m.resolveSequence=Yi,m.resolveValue=ke,m.scrollProgress=Hr,m.scrubOnScroll=Jr,m.serializeTimeline=Oi,m.serializeTrack=Fi,m.set=Bo,m.shapeToPathData=Vt,m.simplifyKeyframes=_i,m.smoothToward=Tn,m.snapAxis=dn,m.snapConfig=Mn,m.snapDuration=xn,m.snapProgress=An,m.splitText=Yo,m.springDuration=He,m.springValueAt=ts,m.staggerDistance=te,m.staggerOffset=It,m.staggerOffsets=Lt,m.staggerSpan=yt,m.stepsEasing=oi,m.syncMediaElement=Un,m.textAt=Li,m.tf=$o,m.ticker=Xo,m.timeline=qo,m.to=Do,m.toJSON=Bs,m.toKeyframedTrack=Ls,m.toKeyframedTracks=Fs,m.trackTargets=K,m.triggerDistance=ht,m.unmount=_o,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));