@viji-dev/sdk 1.0.5 → 1.0.7

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 +1 @@
1
- import{aA as O,aB as ae,aC as gt,aD as Vn,aE as yt,aF as Re,aG as P,aH as $,aI as me,aJ as H,aK as vt,aL as Tt,aM as bt,aN as Sn,aO as An,aP as wn,aQ as xn,aR as Mn,aS as Cn,aT as qe,aU as Pn,aV as Fn,aW as K,aX as Dn,aY as En,aZ as oe,a_ as ze,a$ as Vt,b0 as In,b1 as Rn,b2 as On,b3 as St,b4 as Kn,b5 as kn,b6 as Nn,b7 as Bn,r as Ln,b8 as Gn,b9 as At,ba as wt,bb as xt,bc as Mt}from"./index-DjBaYzeu.js";function Un(t,e){t.indexOf(e)===-1&&t.push(e)}function _n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let Oe=()=>{};const Ct=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Pt=t=>/^0[^.\s]+$/u.test(t);function Ke(t){let e;return()=>(e===void 0&&(e=t()),e)}const q=t=>t,jn=(t,e)=>n=>e(t(n)),ue=(...t)=>t.reduce(jn),Ft=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Dt{constructor(){this.subscriptions=[]}add(e){return Un(this.subscriptions,e),()=>_n(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const a=this.subscriptions[r];a&&a(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const N=t=>t*1e3,I=t=>t/1e3;function Et(t,e){return e?t*(1e3/e):0}const It=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Wn=1e-7,Hn=12;function $n(t,e,n,s,i){let r,a,o=0;do a=e+(n-e)/2,r=It(a,s,i)-t,r>0?n=a:e=a;while(Math.abs(r)>Wn&&++o<Hn);return a}function Z(t,e,n,s){if(t===e&&n===s)return q;const i=r=>$n(r,0,1,t,n);return r=>r===0||r===1?r:It(i(r),e,s)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ot=t=>e=>1-t(1-e),Kt=Z(.33,1.53,.69,.99),ke=Ot(Kt),kt=Rt(ke),Nt=t=>(t*=2)<1?.5*ke(t):.5*(2-Math.pow(2,-10*(t-1))),Ne=t=>1-Math.sin(Math.acos(t)),qn=Ot(Ne),Bt=Rt(Ne),zn=Z(.42,0,1,1),Yn=Z(0,0,.58,1),Lt=Z(.42,0,.58,1),Xn=t=>Array.isArray(t)&&typeof t[0]!="number",Gt=t=>Array.isArray(t)&&typeof t[0]=="number",Zn={linear:q,easeIn:zn,easeInOut:Lt,easeOut:Yn,circIn:Ne,circInOut:Bt,circOut:qn,backIn:ke,backInOut:kt,backOut:Kt,anticipate:Nt},Jn=t=>typeof t=="string",Ye=t=>{if(Gt(t)){Oe(t.length===4);const[e,n,s,i]=t;return Z(e,n,s,i)}else if(Jn(t))return Zn[t];return t},J=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qn(t,e){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function c(u){a.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,h=!1,f=!1)=>{const T=f&&i?n:s;return h&&a.add(u),T.has(u)||T.add(u),u},cancel:u=>{s.delete(u),a.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,r&&(r=!1,l.process(u))}};return l}const es=40;function Ut(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=J.reduce((g,A)=>(g[A]=Qn(r),g),{}),{setup:o,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:f,render:d,postRender:T}=a,b=()=>{const g=O.useManualTiming?i.timestamp:performance.now();n=!1,O.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,es),1)),i.timestamp=g,i.isProcessing=!0,o.process(i),c.process(i),l.process(i),u.process(i),h.process(i),f.process(i),d.process(i),T.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(b))},v=()=>{n=!0,s=!0,i.isProcessing||t(b)};return{schedule:J.reduce((g,A)=>{const m=a[A];return g[A]=(S,x=!1,y=!1)=>(n||v(),m.schedule(S,x,y)),g},{}),cancel:g=>{for(let A=0;A<J.length;A++)a[J[A]].cancel(g)},state:i,steps:a}}const{schedule:R,cancel:ge,state:te}=Ut(typeof requestAnimationFrame<"u"?requestAnimationFrame:q,!0);let Q;function ts(){Q=void 0}const F={now:()=>(Q===void 0&&F.set(te.isProcessing||O.useManualTiming?te.timestamp:performance.now()),Q),set:t=>{Q=t,queueMicrotask(ts)}};function le(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ns({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,a=0;if(!e)i=r=a=n;else{const o=n<.5?n*(1+e):n+e-n*e,c=2*n-o;i=le(c,o,t+1/3),r=le(c,o,t),a=le(c,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:s}}function ne(t,e){return n=>n>0?e:t}const ce=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ss=[Vn,gt,yt],is=t=>ss.find(e=>e.test(t));function Xe(t){const e=is(t);if(!e)return!1;let n=e.parse(t);return e===yt&&(n=ns(n)),n}const Ze=(t,e)=>{const n=Xe(t),s=Xe(e);if(!n||!s)return ne(t,e);const i={...n};return r=>(i.red=ce(n.red,s.red,r),i.green=ce(n.green,s.green,r),i.blue=ce(n.blue,s.blue,r),i.alpha=ae(n.alpha,s.alpha,r),gt.transform(i))},ye=new Set(["none","hidden"]);function rs(t,e){return ye.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function as(t,e){return n=>ae(t,e,n)}function Be(t){return typeof t=="number"?as:typeof t=="string"?Re(t)?ne:P.test(t)?Ze:ls:Array.isArray(t)?_t:typeof t=="object"?P.test(t)?Ze:os:ne}function _t(t,e){const n=[...t],s=n.length,i=t.map((r,a)=>Be(r)(r,e[a]));return r=>{for(let a=0;a<s;a++)n[a]=i[a](r);return n}}function os(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Be(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function us(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}const ls=(t,e)=>{const n=$.createTransformer(e),s=me(t),i=me(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ye.has(t)&&!i.values.length||ye.has(e)&&!s.values.length?rs(t,e):ue(_t(us(s,i),i.values),n):ne(t,e)};function jt(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ae(t,e,n):Be(t)(t,e)}const cs=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>R.update(e,n),stop:()=>ge(e),now:()=>te.isProcessing?te.timestamp:F.now()}},Wt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},se=2e4;function Le(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<se;)e+=n,s=t.next(e);return e>=se?1/0:e}function hs(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Le(s),se);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:I(i)}}const fs=5;function Ht(t,e,n){const s=Math.max(e-fs,0);return Et(n-t(s),e-s)}const w={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},he=.001;function ds({duration:t=w.duration,bounce:e=w.bounce,velocity:n=w.velocity,mass:s=w.mass}){let i,r,a=1-e;a=H(w.minDamping,w.maxDamping,a),t=H(w.minDuration,w.maxDuration,I(t)),a<1?(i=l=>{const u=l*a,h=u*t,f=u-n,d=ve(l,a),T=Math.exp(-h);return he-f/d*T},r=l=>{const h=l*a*t,f=h*n+n,d=Math.pow(a,2)*Math.pow(l,2)*t,T=Math.exp(-h),b=ve(Math.pow(l,2),a);return(-i(l)+he>0?-1:1)*((f-d)*T)/b}):(i=l=>{const u=Math.exp(-l*t),h=(l-n)*t+1;return-he+u*h},r=l=>{const u=Math.exp(-l*t),h=(n-l)*(t*t);return u*h});const o=5/t,c=ms(i,r,o);if(t=N(t),isNaN(c))return{stiffness:w.stiffness,damping:w.damping,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:a*2*Math.sqrt(s*l),duration:t}}}const ps=12;function ms(t,e,n){let s=n;for(let i=1;i<ps;i++)s=s-t(s)/e(s);return s}function ve(t,e){return t*Math.sqrt(1-e*e)}const gs=["duration","bounce"],ys=["stiffness","damping","mass"];function Je(t,e){return e.some(n=>t[n]!==void 0)}function vs(t){let e={velocity:w.velocity,stiffness:w.stiffness,damping:w.damping,mass:w.mass,isResolvedFromDuration:!1,...t};if(!Je(t,ys)&&Je(t,gs))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*H(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:w.mass,stiffness:i,damping:r}}else{const n=ds(t);e={...e,...n,mass:w.mass},e.isResolvedFromDuration=!0}return e}function ie(t=w.visualDuration,e=w.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:c,damping:l,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=vs({...n,velocity:-I(n.velocity||0)}),T=f||0,b=l/(2*Math.sqrt(c*u)),v=a-r,p=I(Math.sqrt(c/u)),V=Math.abs(v)<5;s||(s=V?w.restSpeed.granular:w.restSpeed.default),i||(i=V?w.restDelta.granular:w.restDelta.default);let g;if(b<1){const m=ve(p,b);g=S=>{const x=Math.exp(-b*p*S);return a-x*((T+b*p*v)/m*Math.sin(m*S)+v*Math.cos(m*S))}}else if(b===1)g=m=>a-Math.exp(-p*m)*(v+(T+p*v)*m);else{const m=p*Math.sqrt(b*b-1);g=S=>{const x=Math.exp(-b*p*S),y=Math.min(m*S,300);return a-x*((T+b*p*v)*Math.sinh(y)+m*v*Math.cosh(y))/m}}const A={calculatedDuration:d&&h||null,next:m=>{const S=g(m);if(d)o.done=m>=h;else{let x=m===0?T:0;b<1&&(x=m===0?N(T):Ht(g,m,S));const y=Math.abs(x)<=s,C=Math.abs(a-S)<=i;o.done=y&&C}return o.value=o.done?a:S,o},toString:()=>{const m=Math.min(Le(A),se),S=Wt(x=>A.next(m*x).value,m,30);return m+"ms "+S},toTransition:()=>{}};return A}ie.applyToOptions=t=>{const e=hs(t,100,ie);return t.ease=e.ease,t.duration=N(e.duration),t.type="keyframes",t};function Te({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:c,restDelta:l=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=y=>o!==void 0&&y<o||c!==void 0&&y>c,T=y=>o===void 0?c:c===void 0||Math.abs(o-y)<Math.abs(c-y)?o:c;let b=n*e;const v=h+b,p=a===void 0?v:a(v);p!==v&&(b=p-h);const V=y=>-b*Math.exp(-y/s),g=y=>p+V(y),A=y=>{const C=V(y),D=g(y);f.done=Math.abs(C)<=l,f.value=f.done?p:D};let m,S;const x=y=>{d(f.value)&&(m=y,S=ie({keyframes:[f.value,T(f.value)],velocity:Ht(g,y,f.value),damping:i,stiffness:r,restDelta:l,restSpeed:u}))};return x(0),{calculatedDuration:null,next:y=>{let C=!1;return!S&&m===void 0&&(C=!0,A(y),x(y)),m!==void 0&&y>=m?S.next(y-m):(!C&&A(y),f)}}}function Ts(t,e,n){const s=[],i=n||O.mix||jt,r=t.length-1;for(let a=0;a<r;a++){let o=i(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||q:e;o=ue(c,o)}s.push(o)}return s}function bs(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Oe(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Ts(e,s,i),c=o.length,l=u=>{if(a&&u<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Ft(t[h],t[h+1],u);return o[h](f)};return n?u=>l(H(t[0],t[r-1],u)):l}function Vs(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ft(0,e,s);t.push(ae(n,1,i))}}function Ss(t){const e=[0];return Vs(e,t.length-1),e}function As(t,e){return t.map(n=>n*e)}function ws(t,e){return t.map(()=>e||Lt).splice(0,t.length-1)}function X({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Xn(s)?s.map(Ye):Ye(s),r={done:!1,value:e[0]},a=As(n&&n.length===e.length?n:Ss(e),t),o=bs(a,e,{ease:Array.isArray(i)?i:ws(e,i)});return{calculatedDuration:t,next:c=>(r.value=o(c),r.done=c>=t,r)}}const xs=t=>t!==null;function Ge(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(xs),o=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!o||s===void 0?r[o]:s}const Ms={decay:Te,inertia:Te,tween:X,keyframes:X,spring:ie};function $t(t){typeof t.type=="string"&&(t.type=Ms[t.type])}class Ue{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Cs=t=>t/100;class _e extends Ue{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==F.now()&&this.tick(F.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;$t(e);const{type:n=X,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=e;let{keyframes:o}=e;const c=n||X;c!==X&&typeof o[0]!="number"&&(this.mixKeyframes=ue(Cs,jt(o[0],o[1])),o=[0,100]);const l=c({...e,keyframes:o});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...o].reverse(),velocity:-a})),l.calculatedDuration===null&&(l.calculatedDuration=Le(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:T,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const p=this.currentTime-l*(this.playbackSpeed>=0?1:-1),V=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,A=s;if(h){const y=Math.min(this.currentTime,i)/o;let C=Math.floor(y),D=y%1;!D&&y>=1&&(D=1),D===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(f==="reverse"?(D=1-D,d&&(D-=d/o)):f==="mirror"&&(A=a)),g=H(0,1,D)*o}const m=V?{done:!1,value:u[0]}:A.next(g);r&&(m.value=r(m.value));let{done:S}=m;!V&&c!==null&&(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return x&&T!==Te&&(m.value=Ge(u,this.options,v,this.speed)),b&&b(m.value),x&&this.finish(),m}then(e,n){return this.finished.then(e,n)}get duration(){return I(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(this.currentTime)}set time(e){e=N(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(F.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=I(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=cs,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(F.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Ps(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const G=t=>t*180/Math.PI,be=t=>{const e=G(Math.atan2(t[1],t[0]));return Ve(e)},Fs={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:be,rotateZ:be,skewX:t=>G(Math.atan(t[1])),skewY:t=>G(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ve=t=>(t=t%360,t<0&&(t+=360),t),Qe=be,et=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),tt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ds={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:et,scaleY:tt,scale:t=>(et(t)+tt(t))/2,rotateX:t=>Ve(G(Math.atan2(t[6],t[5]))),rotateY:t=>Ve(G(Math.atan2(-t[2],t[0]))),rotateZ:Qe,rotate:Qe,skewX:t=>G(Math.atan(t[4])),skewY:t=>G(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Se(t){return t.includes("scale")?1:0}function Ae(t,e){if(!t||t==="none")return Se(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ds,i=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Fs,i=o}if(!i)return Se(e);const r=s[e],a=i[1].split(",").map(Is);return typeof r=="function"?r(a):a[r]}const Es=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ae(n,e)};function Is(t){return parseFloat(t.trim())}const nt=t=>t===vt||t===Tt,Rs=new Set(["x","y","z"]),Os=bt.filter(t=>!Rs.has(t));function Ks(t){const e=[];return Os.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const k={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ae(e,"x"),y:(t,{transform:e})=>Ae(e,"y")};k.translateX=k.x;k.translateY=k.y;const U=new Set;let we=!1,xe=!1,Me=!1;function qt(){if(xe){const t=Array.from(U).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Ks(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,a])=>{s.getValue(r)?.set(a)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}xe=!1,we=!1,U.forEach(t=>t.complete(Me)),U.clear()}function zt(){U.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xe=!0)})}function ks(){Me=!0,zt(),qt(),Me=!1}class je{constructor(e,n,s,i,r,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(U.add(this),we||(we=!0,R.read(zt),R.resolveKeyframes(qt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const o=s.readValue(n,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}Ps(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),U.delete(this)}cancel(){this.state==="scheduled"&&(U.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ns=t=>t.startsWith("--");function Bs(t,e,n){Ns(e)?t.style.setProperty(e,n):t.style[e]=n}const Ls=Ke(()=>window.ScrollTimeline!==void 0),Gs={};function Us(t,e){const n=Ke(t);return()=>Gs[e]??n()}const Yt=Us(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Y=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,st={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Y([0,.65,.55,1]),circOut:Y([.55,0,1,.45]),backIn:Y([.31,.01,.66,-.59]),backOut:Y([.33,1.53,.69,.99])};function Xt(t,e){if(t)return typeof t=="function"?Yt()?Wt(t,e):"ease-out":Gt(t)?Y(t):Array.isArray(t)?t.map(n=>Xt(n,e)||st.easeOut):st[t]}function _s(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const h=Xt(o,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),t.animate(u,f)}function Zt(t){return typeof t=="function"&&"applyToOptions"in t}function js({type:t,...e}){return Zt(t)&&Yt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ws extends Ue{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=a,this.options=e,Oe(typeof e.type!="string");const l=js(e);this.animation=_s(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=Ge(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(u):Bs(n,s,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return I(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=N(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Ls()?(this.animation.timeline=e,q):n(this)}}const Jt={anticipate:Nt,backInOut:kt,circInOut:Bt};function Hs(t){return t in Jt}function $s(t){typeof t.ease=="string"&&Hs(t.ease)&&(t.ease=Jt[t.ease])}const fe=10;class qs extends Ws{constructor(e){$s(e),$t(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new _e({...a,autoplay:!1}),c=Math.max(fe,F.now()-this.startTime),l=H(0,fe,c-fe);n.setWithVelocity(o.sample(Math.max(0,c-l)).value,o.sample(c).value,l),o.stop()}}const it=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&($.test(t)||t==="0")&&!t.startsWith("url("));function zs(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Ys(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],a=it(i,e),o=it(r,e);return!a||!o?!1:zs(t)||(n==="spring"||Zt(n))&&s}function Ce(t){t.duration=0,t.type="keyframes"}const Xs=new Set(["opacity","clipPath","filter","transform"]),Zs=Ke(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Js(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=e.owner.getProps();return Zs()&&n&&Xs.has(n)&&(n!=="transform"||!l)&&!c&&!s&&i!=="mirror"&&r!==0&&a!=="inertia"}const Qs=40;class ei extends Ue{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",keyframes:o,name:c,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=F.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:a,name:c,motionValue:l,element:u,...h},d=u?.KeyframeResolver||je;this.keyframeResolver=new d(o,(T,b,v)=>this.onKeyframesResolved(T,b,f,!v),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:a,velocity:o,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=F.now(),Ys(e,r,a,o)||((O.instantAnimations||!c)&&u?.(Ge(e,s,n)),e[0]=e[e.length-1],Ce(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Qs?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!l&&Js(f)?new qs({...f,element:f.motionValue.owner.current}):new _e(f);d.finished.then(()=>this.notifyFinished()).catch(q),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ks()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const ti=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ni(t){const e=ti.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Qt(t,e,n=1){const[s,i]=ni(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const a=r.trim();return Ct(a)?parseFloat(a):a}return Re(i)?Qt(i,e,n+1):i}function en(t,e){return t?.[e]??t?.default??t}const tn=new Set(["width","height","top","left","right","bottom",...bt]),si={test:t=>t==="auto",parse:t=>t},nn=t=>e=>e.test(t),sn=[vt,Tt,Sn,An,wn,xn,si],rt=t=>sn.find(nn(t));function ii(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Pt(t):!0}const ri=new Set(["brightness","contrast","saturate","opacity"]);function ai(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Mn)||[];if(!s)return t;const i=n.replace(s,"");let r=ri.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const oi=/\b([a-z-]*)\(.*?\)/gu,Pe={...$,getAnimatableNone:t=>{const e=t.match(oi);return e?e.map(ai).join(" "):t}},ui={...Cn,color:P,backgroundColor:P,outlineColor:P,fill:P,stroke:P,borderColor:P,borderTopColor:P,borderRightColor:P,borderBottomColor:P,borderLeftColor:P,filter:Pe,WebkitFilter:Pe},rn=t=>ui[t];function an(t,e){let n=rn(t);return n!==Pe&&(n=$),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const li=new Set(["auto","none","0"]);function ci(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!li.has(r)&&me(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=an(n,i)}class hi extends je{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),Re(h))){const f=Qt(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!tn.has(s)||e.length!==2)return;const[i,r]=e,a=rt(i),o=rt(r),c=qe(i),l=qe(r);if(c!==l&&k[s]){this.needsMeasurement=!0;return}if(a!==o)if(nt(a)&&nt(o))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else k[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ii(e[i]))&&s.push(i);s.length&&ci(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=k[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,a=s[r];s[r]=k[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([o,c])=>{e.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function fi(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const at=30,di=t=>!isNaN(parseFloat(t));class pi{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=F.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=F.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=di(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Dt);const s=this.events[e].add(n);return e==="change"?()=>{s(),R.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=F.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>at)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,at);return Et(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function re(t,e){return new pi(t,e)}const{schedule:mi}=Ut(queueMicrotask,!1),gi={y:!1};function yi(){return gi.y}function on(t,e){const n=fi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function ot(t){return!(t.pointerType==="touch"||yi())}function vi(t,e,n={}){const[s,i,r]=on(t,n),a=o=>{if(!ot(o))return;const{target:c}=o,l=e(c,o);if(typeof l!="function"||!c)return;const u=h=>{ot(h)&&(l(h),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,i)};return s.forEach(o=>{o.addEventListener("pointerenter",a,i)}),r}const un=(t,e)=>e?t===e?!0:un(t,e.parentElement):!1,Ti=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,bi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Vi(t){return bi.has(t.tagName)||t.isContentEditable===!0}const ee=new WeakSet;function ut(t){return e=>{e.key==="Enter"&&t(e)}}function de(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Si=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ut(()=>{if(ee.has(n))return;de(n,"down");const i=ut(()=>{de(n,"up")}),r=()=>de(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function lt(t){return Ti(t)&&!0}function Ai(t,e,n={}){const[s,i,r]=on(t,n),a=o=>{const c=o.currentTarget;if(!lt(o))return;ee.add(c);const l=e(c,o),u=(d,T)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),ee.has(c)&&ee.delete(c),lt(d)&&typeof l=="function"&&l(d,{success:T})},h=d=>{u(d,c===window||c===document||n.useGlobalTarget||un(c,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),Pn(o)&&(o.addEventListener("focus",l=>Si(l,i)),!Vi(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),r}const wi=[...sn,P,$],xi=t=>wi.find(nn(t));function Mi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Ci(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Pi(t,e){return Mi(Ci(t.getBoundingClientRect(),e))}const ct=()=>({min:0,max:0}),ln=()=>({x:ct(),y:ct()}),Fe={current:null},cn={current:!1};function Fi(){if(cn.current=!0,!!Fn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fe.current=t.matches;t.addEventListener("change",e),e()}else Fe.current=!1}const Di=new WeakMap;function Ei(t,e,n){for(const s in e){const i=e[s],r=n[s];if(K(i))t.addValue(s,i);else if(K(r))t.addValue(s,re(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(s);t.addValue(s,re(a!==void 0?a:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ht=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ii{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=je,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=F.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,R.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!r,this.isControllingVariants=Dn(n),this.isVariantNode=En(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];c[f]!==void 0&&K(d)&&d.set(c[f])}}mount(e){this.current=e,Di.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(cn.current||Fi(),this.shouldReduceMotion=Fe.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ge(this.notifyUpdate),ge(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=oe.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&R.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ze){const n=ze[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ln()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ht.length;s++){const i=ht[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,a=e[r];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=Ei(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=re(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Ct(s)||Pt(s))?s=parseFloat(s):!xi(s)&&$.test(n)&&(s=an(e,n)),this.setBaseTarget(e,K(s)?s.get():s)),K(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Vt(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!K(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Dt),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){mi.render(this.render)}}class hn extends Ii{constructor(){super(...arguments),this.KeyframeResolver=hi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;K(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function fn(t,{style:e,vars:n},s,i){const r=t.style;let a;for(a in e)r[a]=e[a];i?.applyProjectionStyles(r,s);for(a in n)r.setProperty(a,n[a])}function Ri(t){return window.getComputedStyle(t)}class Oi extends hn{constructor(){super(...arguments),this.type="html",this.renderInstance=fn}readValueFromInstance(e,n){if(oe.has(n))return this.projection?.isProjecting?Se(n):Es(e,n);{const s=Ri(e),i=(In(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Pi(e,n)}build(e,n,s){Rn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return On(e,n,s)}}const dn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ki(t,e,n,s){fn(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(dn.has(i)?i:St(i),e.attrs[i])}class ki extends hn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ln}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(oe.has(n)){const s=rn(n);return s&&s.default||0}return n=dn.has(n)?n:St(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Kn(e,n,s)}build(e,n,s){kn(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Ki(e,n,s,i)}mount(e){this.isSVGTag=Nn(e.tagName),super.mount(e)}}const Ni=(t,e)=>e.isSVG??Bn(t)?new ki(e):new Oi(e,{allowProjection:t!==Ln.Fragment});function W(t,e,n){const s=t.getProps();return Vt(s,e,n!==void 0?n:s.custom,t)}const De=t=>Array.isArray(t);function Bi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,re(n))}function Li(t){return De(t)?t[t.length-1]||0:t}function Gi(t,e){const n=W(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const a in r){const o=Li(r[a]);Bi(t,a,o)}}function Ui(t){return!!(K(t)&&t.add)}function _i(t,e){const n=t.getValue("willChange");if(Ui(n))return n.add(e);if(!n&&O.WillChange){const s=new O.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ji(t){return t.props[Gn]}const Wi=t=>t!==null;function Hi(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Wi),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}const $i={type:"spring",stiffness:500,damping:25,restSpeed:10},qi=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),zi={type:"keyframes",duration:.8},Yi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xi=(t,{keyframes:e})=>e.length>2?zi:oe.has(t)?t.startsWith("scale")?qi(e[1]):$i:Yi;function Zi({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Ji=(t,e,n,s={},i,r)=>a=>{const o=en(s,t)||{},c=o.delay||s.delay||0;let{elapsed:l=0}=s;l=l-N(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-l,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:r?void 0:i};Zi(o)||Object.assign(u,Xi(t,u)),u.duration&&(u.duration=N(u.duration)),u.repeatDelay&&(u.repeatDelay=N(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ce(u),u.delay===0&&(h=!0)),(O.instantAnimations||O.skipAnimations)&&(h=!0,Ce(u),u.delay=0),u.allowFlatten=!o.type&&!o.ease,h&&!r&&e.get()!==void 0){const f=Hi(u.keyframes,o);if(f!==void 0){R.update(()=>{u.onUpdate(f),u.onComplete()});return}}return o.isSync?new _e(u):new ei(u)};function Qi({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function pn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:a,...o}=e;s&&(r=s);const c=[],l=i&&t.animationState&&t.animationState.getState()[i];for(const u in o){const h=t.getValue(u,t.latestValues[u]??null),f=o[u];if(f===void 0||l&&Qi(l,u))continue;const d={delay:n,...en(r||{},u)},T=h.get();if(T!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===T&&!d.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const p=ji(t);if(p){const V=window.MotionHandoffAnimation(p,u,R);V!==null&&(d.startTime=V,b=!0)}}_i(t,u),h.start(Ji(u,h,f,t.shouldReduceMotion&&tn.has(u)?{type:!1}:d,t,b));const v=h.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{R.update(()=>{a&&Gi(t,a)})}),c}function mn(t,e,n,s=0,i=1){const r=Array.from(t).sort((l,u)=>l.sortNodePosition(u)).indexOf(e),a=t.size,o=(a-1)*s;return typeof n=="function"?n(r,a):i===1?r*s:o-r*s}function Ee(t,e,n={}){const s=W(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(pn(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=i;return er(t,e,c,l,u,h,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[c,l]=o==="beforeChildren"?[r,a]:[a,r];return c().then(()=>l())}else return Promise.all([r(),a(n.delay)])}function er(t,e,n=0,s=0,i=0,r=1,a){const o=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),o.push(Ee(c,e,{...a,delay:n+(typeof s=="function"?0:s)+mn(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(o)}function tr(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ee(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ee(t,e,n);else{const i=typeof e=="function"?W(t,e,n.custom):e;s=Promise.all(pn(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function gn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const nr=wt.length;function yn(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?yn(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<nr;n++){const s=wt[n],i=t.props[s];(At(i)||i===!1)&&(e[s]=i)}return e}const sr=[...Mt].reverse(),ir=Mt.length;function rr(t){return e=>Promise.all(e.map(({animation:n,options:s})=>tr(t,n,s)))}function ar(t){let e=rr(t),n=ft(),s=!0;const i=c=>(l,u)=>{const h=W(t,u,c==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...T}=h;l={...l,...T,...d}}return l};function r(c){e=c(t)}function a(c){const{props:l}=t,u=yn(t.parent)||{},h=[],f=new Set;let d={},T=1/0;for(let v=0;v<ir;v++){const p=sr[v],V=n[p],g=l[p]!==void 0?l[p]:u[p],A=At(g),m=p===c?V.isActive:null;m===!1&&(T=v);let S=g===u[p]&&g!==l[p]&&A;if(S&&s&&t.manuallyAnimateOnMount&&(S=!1),V.protectedKeys={...d},!V.isActive&&m===null||!g&&!V.prevProp||xt(g)||typeof g=="boolean")continue;const x=or(V.prevProp,g);let y=x||p===c&&V.isActive&&!S&&A||v>T&&A,C=!1;const D=Array.isArray(g)?g:[g];let _=D.reduce(i(p),{});m===!1&&(_={});const{prevResolvedValues:We={}}=V,Tn={...We,..._},He=M=>{y=!0,f.has(M)&&(C=!0,f.delete(M)),V.needsAnimating[M]=!0;const E=t.getValue(M);E&&(E.liveStyle=!1)};for(const M in Tn){const E=_[M],B=We[M];if(d.hasOwnProperty(M))continue;let j=!1;De(E)&&De(B)?j=!gn(E,B):j=E!==B,j?E!=null?He(M):f.add(M):E!==void 0&&f.has(M)?He(M):V.protectedKeys[M]=!0}V.prevProp=g,V.prevResolvedValues=_,V.isActive&&(d={...d,..._}),s&&t.blockInitialAnimation&&(y=!1);const $e=S&&x;y&&(!$e||C)&&h.push(...D.map(M=>{const E={type:p};if(typeof M=="string"&&s&&!$e&&t.manuallyAnimateOnMount&&t.parent){const{parent:B}=t,j=W(B,M);if(B.enteringChildren&&j){const{delayChildren:bn}=j.transition||{};E.delay=mn(B.enteringChildren,t,bn)}}return{animation:M,options:E}}))}if(f.size){const v={};if(typeof l.initial!="boolean"){const p=W(t,Array.isArray(l.initial)?l.initial[0]:l.initial);p&&p.transition&&(v.transition=p.transition)}f.forEach(p=>{const V=t.getBaseTarget(p),g=t.getValue(p);g&&(g.liveStyle=!0),v[p]=V??null}),h.push({animation:v})}let b=!!h.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,b?e(h):Promise.resolve()}function o(c,l){if(n[c].isActive===l)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(c,l)),n[c].isActive=l;const u=a(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:a,setActive:o,setAnimateFunction:r,getState:()=>n,reset:()=>{n=ft()}}}function or(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!gn(e,t):!1}function L(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ft(){return{animate:L(!0),whileInView:L(),whileHover:L(),whileTap:L(),whileDrag:L(),whileFocus:L(),exit:L()}}class z{constructor(e){this.isMounted=!1,this.node=e}update(){}}class ur extends z{constructor(e){super(e),e.animationState||(e.animationState=ar(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();xt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let lr=0;class cr extends z{constructor(){super(...arguments),this.id=lr++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const hr={animation:{Feature:ur},exit:{Feature:cr}};function dt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function vn(t){return{point:{x:t.pageX,y:t.pageY}}}function pt(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&R.postRender(()=>r(e,vn(e)))}class fr extends z{mount(){const{current:e}=this.node;e&&(this.unmount=vi(e,(n,s)=>(pt(this.node,s,"Start"),i=>pt(this.node,i,"End"))))}unmount(){}}class dr extends z{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ue(dt(this.node.current,"focus",()=>this.onFocus()),dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function mt(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&R.postRender(()=>r(e,vn(e)))}class pr extends z{mount(){const{current:e}=this.node;e&&(this.unmount=Ai(e,(n,s)=>(mt(this.node,s,"Start"),(i,{success:r})=>mt(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ie=new WeakMap,pe=new WeakMap,mr=t=>{const e=Ie.get(t.target);e&&e(t)},gr=t=>{t.forEach(mr)};function yr({root:t,...e}){const n=t||document;pe.has(n)||pe.set(n,{});const s=pe.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(gr,{root:t,...e})),s[i]}function vr(t,e,n){const s=yr(e);return Ie.set(t,n),s.observe(t),()=>{Ie.delete(t),s.unobserve(t)}}const Tr={some:0,all:1};class br extends z{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,a={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Tr[i]},o=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=l?u:h;f&&f(c)};return vr(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Vr(e,n))&&this.startObserver()}unmount(){}}function Vr({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Sr={inView:{Feature:br},tap:{Feature:pr},focus:{Feature:dr},hover:{Feature:fr}},Ar={renderer:Ni,...hr,...Sr};var Mr=Ar;export{Mr as default};
1
+ import{aA as O,aB as ae,aC as gt,aD as Vn,aE as yt,aF as Re,aG as P,aH as $,aI as me,aJ as H,aK as vt,aL as Tt,aM as bt,aN as Sn,aO as An,aP as wn,aQ as xn,aR as Mn,aS as Cn,aT as qe,aU as Pn,aV as Fn,aW as K,aX as Dn,aY as En,aZ as oe,a_ as ze,a$ as Vt,b0 as In,b1 as Rn,b2 as On,b3 as St,b4 as Kn,b5 as kn,b6 as Nn,b7 as Bn,r as Ln,b8 as Gn,b9 as At,ba as wt,bb as xt,bc as Mt}from"./index-CCbJB3bX.js";function Un(t,e){t.indexOf(e)===-1&&t.push(e)}function _n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let Oe=()=>{};const Ct=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Pt=t=>/^0[^.\s]+$/u.test(t);function Ke(t){let e;return()=>(e===void 0&&(e=t()),e)}const q=t=>t,jn=(t,e)=>n=>e(t(n)),ue=(...t)=>t.reduce(jn),Ft=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Dt{constructor(){this.subscriptions=[]}add(e){return Un(this.subscriptions,e),()=>_n(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const a=this.subscriptions[r];a&&a(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const N=t=>t*1e3,I=t=>t/1e3;function Et(t,e){return e?t*(1e3/e):0}const It=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Wn=1e-7,Hn=12;function $n(t,e,n,s,i){let r,a,o=0;do a=e+(n-e)/2,r=It(a,s,i)-t,r>0?n=a:e=a;while(Math.abs(r)>Wn&&++o<Hn);return a}function Z(t,e,n,s){if(t===e&&n===s)return q;const i=r=>$n(r,0,1,t,n);return r=>r===0||r===1?r:It(i(r),e,s)}const Rt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Ot=t=>e=>1-t(1-e),Kt=Z(.33,1.53,.69,.99),ke=Ot(Kt),kt=Rt(ke),Nt=t=>(t*=2)<1?.5*ke(t):.5*(2-Math.pow(2,-10*(t-1))),Ne=t=>1-Math.sin(Math.acos(t)),qn=Ot(Ne),Bt=Rt(Ne),zn=Z(.42,0,1,1),Yn=Z(0,0,.58,1),Lt=Z(.42,0,.58,1),Xn=t=>Array.isArray(t)&&typeof t[0]!="number",Gt=t=>Array.isArray(t)&&typeof t[0]=="number",Zn={linear:q,easeIn:zn,easeInOut:Lt,easeOut:Yn,circIn:Ne,circInOut:Bt,circOut:qn,backIn:ke,backInOut:kt,backOut:Kt,anticipate:Nt},Jn=t=>typeof t=="string",Ye=t=>{if(Gt(t)){Oe(t.length===4);const[e,n,s,i]=t;return Z(e,n,s,i)}else if(Jn(t))return Zn[t];return t},J=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Qn(t,e){let n=new Set,s=new Set,i=!1,r=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function c(u){a.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,h=!1,f=!1)=>{const T=f&&i?n:s;return h&&a.add(u),T.has(u)||T.add(u),u},cancel:u=>{s.delete(u),a.delete(u)},process:u=>{if(o=u,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,r&&(r=!1,l.process(u))}};return l}const es=40;function Ut(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,a=J.reduce((g,A)=>(g[A]=Qn(r),g),{}),{setup:o,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:f,render:d,postRender:T}=a,b=()=>{const g=O.useManualTiming?i.timestamp:performance.now();n=!1,O.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,es),1)),i.timestamp=g,i.isProcessing=!0,o.process(i),c.process(i),l.process(i),u.process(i),h.process(i),f.process(i),d.process(i),T.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(b))},v=()=>{n=!0,s=!0,i.isProcessing||t(b)};return{schedule:J.reduce((g,A)=>{const m=a[A];return g[A]=(S,x=!1,y=!1)=>(n||v(),m.schedule(S,x,y)),g},{}),cancel:g=>{for(let A=0;A<J.length;A++)a[J[A]].cancel(g)},state:i,steps:a}}const{schedule:R,cancel:ge,state:te}=Ut(typeof requestAnimationFrame<"u"?requestAnimationFrame:q,!0);let Q;function ts(){Q=void 0}const F={now:()=>(Q===void 0&&F.set(te.isProcessing||O.useManualTiming?te.timestamp:performance.now()),Q),set:t=>{Q=t,queueMicrotask(ts)}};function le(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ns({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,a=0;if(!e)i=r=a=n;else{const o=n<.5?n*(1+e):n+e-n*e,c=2*n-o;i=le(c,o,t+1/3),r=le(c,o,t),a=le(c,o,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(a*255),alpha:s}}function ne(t,e){return n=>n>0?e:t}const ce=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ss=[Vn,gt,yt],is=t=>ss.find(e=>e.test(t));function Xe(t){const e=is(t);if(!e)return!1;let n=e.parse(t);return e===yt&&(n=ns(n)),n}const Ze=(t,e)=>{const n=Xe(t),s=Xe(e);if(!n||!s)return ne(t,e);const i={...n};return r=>(i.red=ce(n.red,s.red,r),i.green=ce(n.green,s.green,r),i.blue=ce(n.blue,s.blue,r),i.alpha=ae(n.alpha,s.alpha,r),gt.transform(i))},ye=new Set(["none","hidden"]);function rs(t,e){return ye.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function as(t,e){return n=>ae(t,e,n)}function Be(t){return typeof t=="number"?as:typeof t=="string"?Re(t)?ne:P.test(t)?Ze:ls:Array.isArray(t)?_t:typeof t=="object"?P.test(t)?Ze:os:ne}function _t(t,e){const n=[...t],s=n.length,i=t.map((r,a)=>Be(r)(r,e[a]));return r=>{for(let a=0;a<s;a++)n[a]=i[a](r);return n}}function os(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Be(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function us(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][s[r]],o=t.values[a]??0;n[i]=o,s[r]++}return n}const ls=(t,e)=>{const n=$.createTransformer(e),s=me(t),i=me(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ye.has(t)&&!i.values.length||ye.has(e)&&!s.values.length?rs(t,e):ue(_t(us(s,i),i.values),n):ne(t,e)};function jt(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?ae(t,e,n):Be(t)(t,e)}const cs=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>R.update(e,n),stop:()=>ge(e),now:()=>te.isProcessing?te.timestamp:F.now()}},Wt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=Math.round(t(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},se=2e4;function Le(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<se;)e+=n,s=t.next(e);return e>=se?1/0:e}function hs(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Le(s),se);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:I(i)}}const fs=5;function Ht(t,e,n){const s=Math.max(e-fs,0);return Et(n-t(s),e-s)}const w={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},he=.001;function ds({duration:t=w.duration,bounce:e=w.bounce,velocity:n=w.velocity,mass:s=w.mass}){let i,r,a=1-e;a=H(w.minDamping,w.maxDamping,a),t=H(w.minDuration,w.maxDuration,I(t)),a<1?(i=l=>{const u=l*a,h=u*t,f=u-n,d=ve(l,a),T=Math.exp(-h);return he-f/d*T},r=l=>{const h=l*a*t,f=h*n+n,d=Math.pow(a,2)*Math.pow(l,2)*t,T=Math.exp(-h),b=ve(Math.pow(l,2),a);return(-i(l)+he>0?-1:1)*((f-d)*T)/b}):(i=l=>{const u=Math.exp(-l*t),h=(l-n)*t+1;return-he+u*h},r=l=>{const u=Math.exp(-l*t),h=(n-l)*(t*t);return u*h});const o=5/t,c=ms(i,r,o);if(t=N(t),isNaN(c))return{stiffness:w.stiffness,damping:w.damping,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:a*2*Math.sqrt(s*l),duration:t}}}const ps=12;function ms(t,e,n){let s=n;for(let i=1;i<ps;i++)s=s-t(s)/e(s);return s}function ve(t,e){return t*Math.sqrt(1-e*e)}const gs=["duration","bounce"],ys=["stiffness","damping","mass"];function Je(t,e){return e.some(n=>t[n]!==void 0)}function vs(t){let e={velocity:w.velocity,stiffness:w.stiffness,damping:w.damping,mass:w.mass,isResolvedFromDuration:!1,...t};if(!Je(t,ys)&&Je(t,gs))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*H(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:w.mass,stiffness:i,damping:r}}else{const n=ds(t);e={...e,...n,mass:w.mass},e.isResolvedFromDuration=!0}return e}function ie(t=w.visualDuration,e=w.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:r},{stiffness:c,damping:l,mass:u,duration:h,velocity:f,isResolvedFromDuration:d}=vs({...n,velocity:-I(n.velocity||0)}),T=f||0,b=l/(2*Math.sqrt(c*u)),v=a-r,p=I(Math.sqrt(c/u)),V=Math.abs(v)<5;s||(s=V?w.restSpeed.granular:w.restSpeed.default),i||(i=V?w.restDelta.granular:w.restDelta.default);let g;if(b<1){const m=ve(p,b);g=S=>{const x=Math.exp(-b*p*S);return a-x*((T+b*p*v)/m*Math.sin(m*S)+v*Math.cos(m*S))}}else if(b===1)g=m=>a-Math.exp(-p*m)*(v+(T+p*v)*m);else{const m=p*Math.sqrt(b*b-1);g=S=>{const x=Math.exp(-b*p*S),y=Math.min(m*S,300);return a-x*((T+b*p*v)*Math.sinh(y)+m*v*Math.cosh(y))/m}}const A={calculatedDuration:d&&h||null,next:m=>{const S=g(m);if(d)o.done=m>=h;else{let x=m===0?T:0;b<1&&(x=m===0?N(T):Ht(g,m,S));const y=Math.abs(x)<=s,C=Math.abs(a-S)<=i;o.done=y&&C}return o.value=o.done?a:S,o},toString:()=>{const m=Math.min(Le(A),se),S=Wt(x=>A.next(m*x).value,m,30);return m+"ms "+S},toTransition:()=>{}};return A}ie.applyToOptions=t=>{const e=hs(t,100,ie);return t.ease=e.ease,t.duration=N(e.duration),t.type="keyframes",t};function Te({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:c,restDelta:l=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=y=>o!==void 0&&y<o||c!==void 0&&y>c,T=y=>o===void 0?c:c===void 0||Math.abs(o-y)<Math.abs(c-y)?o:c;let b=n*e;const v=h+b,p=a===void 0?v:a(v);p!==v&&(b=p-h);const V=y=>-b*Math.exp(-y/s),g=y=>p+V(y),A=y=>{const C=V(y),D=g(y);f.done=Math.abs(C)<=l,f.value=f.done?p:D};let m,S;const x=y=>{d(f.value)&&(m=y,S=ie({keyframes:[f.value,T(f.value)],velocity:Ht(g,y,f.value),damping:i,stiffness:r,restDelta:l,restSpeed:u}))};return x(0),{calculatedDuration:null,next:y=>{let C=!1;return!S&&m===void 0&&(C=!0,A(y),x(y)),m!==void 0&&y>=m?S.next(y-m):(!C&&A(y),f)}}}function Ts(t,e,n){const s=[],i=n||O.mix||jt,r=t.length-1;for(let a=0;a<r;a++){let o=i(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||q:e;o=ue(c,o)}s.push(o)}return s}function bs(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Oe(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Ts(e,s,i),c=o.length,l=u=>{if(a&&u<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const f=Ft(t[h],t[h+1],u);return o[h](f)};return n?u=>l(H(t[0],t[r-1],u)):l}function Vs(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ft(0,e,s);t.push(ae(n,1,i))}}function Ss(t){const e=[0];return Vs(e,t.length-1),e}function As(t,e){return t.map(n=>n*e)}function ws(t,e){return t.map(()=>e||Lt).splice(0,t.length-1)}function X({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Xn(s)?s.map(Ye):Ye(s),r={done:!1,value:e[0]},a=As(n&&n.length===e.length?n:Ss(e),t),o=bs(a,e,{ease:Array.isArray(i)?i:ws(e,i)});return{calculatedDuration:t,next:c=>(r.value=o(c),r.done=c>=t,r)}}const xs=t=>t!==null;function Ge(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(xs),o=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!o||s===void 0?r[o]:s}const Ms={decay:Te,inertia:Te,tween:X,keyframes:X,spring:ie};function $t(t){typeof t.type=="string"&&(t.type=Ms[t.type])}class Ue{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Cs=t=>t/100;class _e extends Ue{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==F.now()&&this.tick(F.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;$t(e);const{type:n=X,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:a=0}=e;let{keyframes:o}=e;const c=n||X;c!==X&&typeof o[0]!="number"&&(this.mixKeyframes=ue(Cs,jt(o[0],o[1])),o=[0,100]);const l=c({...e,keyframes:o});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...o].reverse(),velocity:-a})),l.calculatedDuration===null&&(l.calculatedDuration=Le(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=l}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:f,repeatDelay:d,type:T,onUpdate:b,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const p=this.currentTime-l*(this.playbackSpeed>=0?1:-1),V=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,A=s;if(h){const y=Math.min(this.currentTime,i)/o;let C=Math.floor(y),D=y%1;!D&&y>=1&&(D=1),D===1&&C--,C=Math.min(C,h+1),!!(C%2)&&(f==="reverse"?(D=1-D,d&&(D-=d/o)):f==="mirror"&&(A=a)),g=H(0,1,D)*o}const m=V?{done:!1,value:u[0]}:A.next(g);r&&(m.value=r(m.value));let{done:S}=m;!V&&c!==null&&(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const x=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return x&&T!==Te&&(m.value=Ge(u,this.options,v,this.speed)),b&&b(m.value),x&&this.finish(),m}then(e,n){return this.finished.then(e,n)}get duration(){return I(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(this.currentTime)}set time(e){e=N(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(F.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=I(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=cs,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(F.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Ps(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const G=t=>t*180/Math.PI,be=t=>{const e=G(Math.atan2(t[1],t[0]));return Ve(e)},Fs={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:be,rotateZ:be,skewX:t=>G(Math.atan(t[1])),skewY:t=>G(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ve=t=>(t=t%360,t<0&&(t+=360),t),Qe=be,et=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),tt=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ds={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:et,scaleY:tt,scale:t=>(et(t)+tt(t))/2,rotateX:t=>Ve(G(Math.atan2(t[6],t[5]))),rotateY:t=>Ve(G(Math.atan2(-t[2],t[0]))),rotateZ:Qe,rotate:Qe,skewX:t=>G(Math.atan(t[4])),skewY:t=>G(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Se(t){return t.includes("scale")?1:0}function Ae(t,e){if(!t||t==="none")return Se(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ds,i=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Fs,i=o}if(!i)return Se(e);const r=s[e],a=i[1].split(",").map(Is);return typeof r=="function"?r(a):a[r]}const Es=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Ae(n,e)};function Is(t){return parseFloat(t.trim())}const nt=t=>t===vt||t===Tt,Rs=new Set(["x","y","z"]),Os=bt.filter(t=>!Rs.has(t));function Ks(t){const e=[];return Os.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const k={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Ae(e,"x"),y:(t,{transform:e})=>Ae(e,"y")};k.translateX=k.x;k.translateY=k.y;const U=new Set;let we=!1,xe=!1,Me=!1;function qt(){if(xe){const t=Array.from(U).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Ks(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,a])=>{s.getValue(r)?.set(a)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}xe=!1,we=!1,U.forEach(t=>t.complete(Me)),U.clear()}function zt(){U.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xe=!0)})}function ks(){Me=!0,zt(),qt(),Me=!1}class je{constructor(e,n,s,i,r,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(U.add(this),we||(we=!0,R.read(zt),R.resolveKeyframes(qt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const o=s.readValue(n,a);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}Ps(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),U.delete(this)}cancel(){this.state==="scheduled"&&(U.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Ns=t=>t.startsWith("--");function Bs(t,e,n){Ns(e)?t.style.setProperty(e,n):t.style[e]=n}const Ls=Ke(()=>window.ScrollTimeline!==void 0),Gs={};function Us(t,e){const n=Ke(t);return()=>Gs[e]??n()}const Yt=Us(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Y=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,st={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Y([0,.65,.55,1]),circOut:Y([.55,0,1,.45]),backIn:Y([.31,.01,.66,-.59]),backOut:Y([.33,1.53,.69,.99])};function Xt(t,e){if(t)return typeof t=="function"?Yt()?Wt(t,e):"ease-out":Gt(t)?Y(t):Array.isArray(t)?t.map(n=>Xt(n,e)||st.easeOut):st[t]}function _s(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:c}={},l=void 0){const u={[e]:n};c&&(u.offset=c);const h=Xt(o,i);Array.isArray(h)&&(u.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:a==="reverse"?"alternate":"normal"};return l&&(f.pseudoElement=l),t.animate(u,f)}function Zt(t){return typeof t=="function"&&"applyToOptions"in t}function js({type:t,...e}){return Zt(t)&&Yt()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ws extends Ue{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:a=!1,finalKeyframe:o,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=a,this.options=e,Oe(typeof e.type!="string");const l=js(e);this.animation=_s(n,s,i,l,r),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const u=Ge(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(u):Bs(n,s,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return I(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=N(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Ls()?(this.animation.timeline=e,q):n(this)}}const Jt={anticipate:Nt,backInOut:kt,circInOut:Bt};function Hs(t){return t in Jt}function $s(t){typeof t.ease=="string"&&Hs(t.ease)&&(t.ease=Jt[t.ease])}const fe=10;class qs extends Ws{constructor(e){$s(e),$t(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...a}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new _e({...a,autoplay:!1}),c=Math.max(fe,F.now()-this.startTime),l=H(0,fe,c-fe);n.setWithVelocity(o.sample(Math.max(0,c-l)).value,o.sample(c).value,l),o.stop()}}const it=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&($.test(t)||t==="0")&&!t.startsWith("url("));function zs(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Ys(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],a=it(i,e),o=it(r,e);return!a||!o?!1:zs(t)||(n==="spring"||Zt(n))&&s}function Ce(t){t.duration=0,t.type="keyframes"}const Xs=new Set(["opacity","clipPath","filter","transform"]),Zs=Ke(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Js(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=e.owner.getProps();return Zs()&&n&&Xs.has(n)&&(n!=="transform"||!l)&&!c&&!s&&i!=="mirror"&&r!==0&&a!=="inertia"}const Qs=40;class ei extends Ue{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:a="loop",keyframes:o,name:c,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=F.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:a,name:c,motionValue:l,element:u,...h},d=u?.KeyframeResolver||je;this.keyframeResolver=new d(o,(T,b,v)=>this.onKeyframesResolved(T,b,f,!v),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:a,velocity:o,delay:c,isHandoff:l,onUpdate:u}=s;this.resolvedAt=F.now(),Ys(e,r,a,o)||((O.instantAnimations||!c)&&u?.(Ge(e,s,n)),e[0]=e[e.length-1],Ce(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Qs?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!l&&Js(f)?new qs({...f,element:f.motionValue.owner.current}):new _e(f);d.finished.then(()=>this.notifyFinished()).catch(q),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ks()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const ti=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ni(t){const e=ti.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Qt(t,e,n=1){const[s,i]=ni(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const a=r.trim();return Ct(a)?parseFloat(a):a}return Re(i)?Qt(i,e,n+1):i}function en(t,e){return t?.[e]??t?.default??t}const tn=new Set(["width","height","top","left","right","bottom",...bt]),si={test:t=>t==="auto",parse:t=>t},nn=t=>e=>e.test(t),sn=[vt,Tt,Sn,An,wn,xn,si],rt=t=>sn.find(nn(t));function ii(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Pt(t):!0}const ri=new Set(["brightness","contrast","saturate","opacity"]);function ai(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Mn)||[];if(!s)return t;const i=n.replace(s,"");let r=ri.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const oi=/\b([a-z-]*)\(.*?\)/gu,Pe={...$,getAnimatableNone:t=>{const e=t.match(oi);return e?e.map(ai).join(" "):t}},ui={...Cn,color:P,backgroundColor:P,outlineColor:P,fill:P,stroke:P,borderColor:P,borderTopColor:P,borderRightColor:P,borderBottomColor:P,borderLeftColor:P,filter:Pe,WebkitFilter:Pe},rn=t=>ui[t];function an(t,e){let n=rn(t);return n!==Pe&&(n=$),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const li=new Set(["auto","none","0"]);function ci(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!li.has(r)&&me(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=an(n,i)}class hi extends je{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let h=e[u];if(typeof h=="string"&&(h=h.trim(),Re(h))){const f=Qt(h,n.current);f!==void 0&&(e[u]=f),u===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!tn.has(s)||e.length!==2)return;const[i,r]=e,a=rt(i),o=rt(r),c=qe(i),l=qe(r);if(c!==l&&k[s]){this.needsMeasurement=!0;return}if(a!==o)if(nt(a)&&nt(o))for(let u=0;u<e.length;u++){const h=e[u];typeof h=="string"&&(e[u]=parseFloat(h))}else k[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ii(e[i]))&&s.push(i);s.length&&ci(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=k[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,a=s[r];s[r]=k[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([o,c])=>{e.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function fi(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const at=30,di=t=>!isNaN(parseFloat(t));class pi{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=F.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=F.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=di(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Dt);const s=this.events[e].add(n);return e==="change"?()=>{s(),R.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=F.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>at)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,at);return Et(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function re(t,e){return new pi(t,e)}const{schedule:mi}=Ut(queueMicrotask,!1),gi={y:!1};function yi(){return gi.y}function on(t,e){const n=fi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function ot(t){return!(t.pointerType==="touch"||yi())}function vi(t,e,n={}){const[s,i,r]=on(t,n),a=o=>{if(!ot(o))return;const{target:c}=o,l=e(c,o);if(typeof l!="function"||!c)return;const u=h=>{ot(h)&&(l(h),c.removeEventListener("pointerleave",u))};c.addEventListener("pointerleave",u,i)};return s.forEach(o=>{o.addEventListener("pointerenter",a,i)}),r}const un=(t,e)=>e?t===e?!0:un(t,e.parentElement):!1,Ti=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,bi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Vi(t){return bi.has(t.tagName)||t.isContentEditable===!0}const ee=new WeakSet;function ut(t){return e=>{e.key==="Enter"&&t(e)}}function de(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Si=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ut(()=>{if(ee.has(n))return;de(n,"down");const i=ut(()=>{de(n,"up")}),r=()=>de(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function lt(t){return Ti(t)&&!0}function Ai(t,e,n={}){const[s,i,r]=on(t,n),a=o=>{const c=o.currentTarget;if(!lt(o))return;ee.add(c);const l=e(c,o),u=(d,T)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),ee.has(c)&&ee.delete(c),lt(d)&&typeof l=="function"&&l(d,{success:T})},h=d=>{u(d,c===window||c===document||n.useGlobalTarget||un(c,d.target))},f=d=>{u(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),Pn(o)&&(o.addEventListener("focus",l=>Si(l,i)),!Vi(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),r}const wi=[...sn,P,$],xi=t=>wi.find(nn(t));function Mi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Ci(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function Pi(t,e){return Mi(Ci(t.getBoundingClientRect(),e))}const ct=()=>({min:0,max:0}),ln=()=>({x:ct(),y:ct()}),Fe={current:null},cn={current:!1};function Fi(){if(cn.current=!0,!!Fn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Fe.current=t.matches;t.addEventListener("change",e),e()}else Fe.current=!1}const Di=new WeakMap;function Ei(t,e,n){for(const s in e){const i=e[s],r=n[s];if(K(i))t.addValue(s,i);else if(K(r))t.addValue(s,re(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=t.getStaticValue(s);t.addValue(s,re(a!==void 0?a:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const ht=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ii{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=je,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=F.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,R.render(this.render,!1,!0))};const{latestValues:c,renderState:l}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!r,this.isControllingVariants=Dn(n),this.isVariantNode=En(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];c[f]!==void 0&&K(d)&&d.set(c[f])}}mount(e){this.current=e,Di.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(cn.current||Fi(),this.shouldReduceMotion=Fe.current),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ge(this.notifyUpdate),ge(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=oe.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&R.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in ze){const n=ze[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ln()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ht.length;s++){const i=ht[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,a=e[r];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=Ei(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=re(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Ct(s)||Pt(s))?s=parseFloat(s):!xi(s)&&$.test(n)&&(s=an(e,n)),this.setBaseTarget(e,K(s)?s.get():s)),K(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Vt(this.props,n,this.presenceContext?.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!K(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Dt),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){mi.render(this.render)}}class hn extends Ii{constructor(){super(...arguments),this.KeyframeResolver=hi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;K(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function fn(t,{style:e,vars:n},s,i){const r=t.style;let a;for(a in e)r[a]=e[a];i?.applyProjectionStyles(r,s);for(a in n)r.setProperty(a,n[a])}function Ri(t){return window.getComputedStyle(t)}class Oi extends hn{constructor(){super(...arguments),this.type="html",this.renderInstance=fn}readValueFromInstance(e,n){if(oe.has(n))return this.projection?.isProjecting?Se(n):Es(e,n);{const s=Ri(e),i=(In(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Pi(e,n)}build(e,n,s){Rn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return On(e,n,s)}}const dn=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ki(t,e,n,s){fn(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(dn.has(i)?i:St(i),e.attrs[i])}class ki extends hn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ln}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(oe.has(n)){const s=rn(n);return s&&s.default||0}return n=dn.has(n)?n:St(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Kn(e,n,s)}build(e,n,s){kn(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Ki(e,n,s,i)}mount(e){this.isSVGTag=Nn(e.tagName),super.mount(e)}}const Ni=(t,e)=>e.isSVG??Bn(t)?new ki(e):new Oi(e,{allowProjection:t!==Ln.Fragment});function W(t,e,n){const s=t.getProps();return Vt(s,e,n!==void 0?n:s.custom,t)}const De=t=>Array.isArray(t);function Bi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,re(n))}function Li(t){return De(t)?t[t.length-1]||0:t}function Gi(t,e){const n=W(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const a in r){const o=Li(r[a]);Bi(t,a,o)}}function Ui(t){return!!(K(t)&&t.add)}function _i(t,e){const n=t.getValue("willChange");if(Ui(n))return n.add(e);if(!n&&O.WillChange){const s=new O.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function ji(t){return t.props[Gn]}const Wi=t=>t!==null;function Hi(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Wi),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}const $i={type:"spring",stiffness:500,damping:25,restSpeed:10},qi=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),zi={type:"keyframes",duration:.8},Yi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xi=(t,{keyframes:e})=>e.length>2?zi:oe.has(t)?t.startsWith("scale")?qi(e[1]):$i:Yi;function Zi({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:a,repeatDelay:o,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const Ji=(t,e,n,s={},i,r)=>a=>{const o=en(s,t)||{},c=o.delay||s.delay||0;let{elapsed:l=0}=s;l=l-N(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-l,onUpdate:f=>{e.set(f),o.onUpdate&&o.onUpdate(f)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:r?void 0:i};Zi(o)||Object.assign(u,Xi(t,u)),u.duration&&(u.duration=N(u.duration)),u.repeatDelay&&(u.repeatDelay=N(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ce(u),u.delay===0&&(h=!0)),(O.instantAnimations||O.skipAnimations)&&(h=!0,Ce(u),u.delay=0),u.allowFlatten=!o.type&&!o.ease,h&&!r&&e.get()!==void 0){const f=Hi(u.keyframes,o);if(f!==void 0){R.update(()=>{u.onUpdate(f),u.onComplete()});return}}return o.isSync?new _e(u):new ei(u)};function Qi({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function pn(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:a,...o}=e;s&&(r=s);const c=[],l=i&&t.animationState&&t.animationState.getState()[i];for(const u in o){const h=t.getValue(u,t.latestValues[u]??null),f=o[u];if(f===void 0||l&&Qi(l,u))continue;const d={delay:n,...en(r||{},u)},T=h.get();if(T!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===T&&!d.velocity)continue;let b=!1;if(window.MotionHandoffAnimation){const p=ji(t);if(p){const V=window.MotionHandoffAnimation(p,u,R);V!==null&&(d.startTime=V,b=!0)}}_i(t,u),h.start(Ji(u,h,f,t.shouldReduceMotion&&tn.has(u)?{type:!1}:d,t,b));const v=h.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{R.update(()=>{a&&Gi(t,a)})}),c}function mn(t,e,n,s=0,i=1){const r=Array.from(t).sort((l,u)=>l.sortNodePosition(u)).indexOf(e),a=t.size,o=(a-1)*s;return typeof n=="function"?n(r,a):i===1?r*s:o-r*s}function Ee(t,e,n={}){const s=W(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(pn(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=i;return er(t,e,c,l,u,h,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[c,l]=o==="beforeChildren"?[r,a]:[a,r];return c().then(()=>l())}else return Promise.all([r(),a(n.delay)])}function er(t,e,n=0,s=0,i=0,r=1,a){const o=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),o.push(Ee(c,e,{...a,delay:n+(typeof s=="function"?0:s)+mn(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(o)}function tr(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ee(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ee(t,e,n);else{const i=typeof e=="function"?W(t,e,n.custom):e;s=Promise.all(pn(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function gn(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const nr=wt.length;function yn(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?yn(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<nr;n++){const s=wt[n],i=t.props[s];(At(i)||i===!1)&&(e[s]=i)}return e}const sr=[...Mt].reverse(),ir=Mt.length;function rr(t){return e=>Promise.all(e.map(({animation:n,options:s})=>tr(t,n,s)))}function ar(t){let e=rr(t),n=ft(),s=!0;const i=c=>(l,u)=>{const h=W(t,u,c==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:f,transitionEnd:d,...T}=h;l={...l,...T,...d}}return l};function r(c){e=c(t)}function a(c){const{props:l}=t,u=yn(t.parent)||{},h=[],f=new Set;let d={},T=1/0;for(let v=0;v<ir;v++){const p=sr[v],V=n[p],g=l[p]!==void 0?l[p]:u[p],A=At(g),m=p===c?V.isActive:null;m===!1&&(T=v);let S=g===u[p]&&g!==l[p]&&A;if(S&&s&&t.manuallyAnimateOnMount&&(S=!1),V.protectedKeys={...d},!V.isActive&&m===null||!g&&!V.prevProp||xt(g)||typeof g=="boolean")continue;const x=or(V.prevProp,g);let y=x||p===c&&V.isActive&&!S&&A||v>T&&A,C=!1;const D=Array.isArray(g)?g:[g];let _=D.reduce(i(p),{});m===!1&&(_={});const{prevResolvedValues:We={}}=V,Tn={...We,..._},He=M=>{y=!0,f.has(M)&&(C=!0,f.delete(M)),V.needsAnimating[M]=!0;const E=t.getValue(M);E&&(E.liveStyle=!1)};for(const M in Tn){const E=_[M],B=We[M];if(d.hasOwnProperty(M))continue;let j=!1;De(E)&&De(B)?j=!gn(E,B):j=E!==B,j?E!=null?He(M):f.add(M):E!==void 0&&f.has(M)?He(M):V.protectedKeys[M]=!0}V.prevProp=g,V.prevResolvedValues=_,V.isActive&&(d={...d,..._}),s&&t.blockInitialAnimation&&(y=!1);const $e=S&&x;y&&(!$e||C)&&h.push(...D.map(M=>{const E={type:p};if(typeof M=="string"&&s&&!$e&&t.manuallyAnimateOnMount&&t.parent){const{parent:B}=t,j=W(B,M);if(B.enteringChildren&&j){const{delayChildren:bn}=j.transition||{};E.delay=mn(B.enteringChildren,t,bn)}}return{animation:M,options:E}}))}if(f.size){const v={};if(typeof l.initial!="boolean"){const p=W(t,Array.isArray(l.initial)?l.initial[0]:l.initial);p&&p.transition&&(v.transition=p.transition)}f.forEach(p=>{const V=t.getBaseTarget(p),g=t.getValue(p);g&&(g.liveStyle=!0),v[p]=V??null}),h.push({animation:v})}let b=!!h.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,b?e(h):Promise.resolve()}function o(c,l){if(n[c].isActive===l)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(c,l)),n[c].isActive=l;const u=a(c);for(const h in n)n[h].protectedKeys={};return u}return{animateChanges:a,setActive:o,setAnimateFunction:r,getState:()=>n,reset:()=>{n=ft()}}}function or(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!gn(e,t):!1}function L(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ft(){return{animate:L(!0),whileInView:L(),whileHover:L(),whileTap:L(),whileDrag:L(),whileFocus:L(),exit:L()}}class z{constructor(e){this.isMounted=!1,this.node=e}update(){}}class ur extends z{constructor(e){super(e),e.animationState||(e.animationState=ar(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();xt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let lr=0;class cr extends z{constructor(){super(...arguments),this.id=lr++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const hr={animation:{Feature:ur},exit:{Feature:cr}};function dt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function vn(t){return{point:{x:t.pageX,y:t.pageY}}}function pt(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&R.postRender(()=>r(e,vn(e)))}class fr extends z{mount(){const{current:e}=this.node;e&&(this.unmount=vi(e,(n,s)=>(pt(this.node,s,"Start"),i=>pt(this.node,i,"End"))))}unmount(){}}class dr extends z{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ue(dt(this.node.current,"focus",()=>this.onFocus()),dt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function mt(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&R.postRender(()=>r(e,vn(e)))}class pr extends z{mount(){const{current:e}=this.node;e&&(this.unmount=Ai(e,(n,s)=>(mt(this.node,s,"Start"),(i,{success:r})=>mt(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ie=new WeakMap,pe=new WeakMap,mr=t=>{const e=Ie.get(t.target);e&&e(t)},gr=t=>{t.forEach(mr)};function yr({root:t,...e}){const n=t||document;pe.has(n)||pe.set(n,{});const s=pe.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(gr,{root:t,...e})),s[i]}function vr(t,e,n){const s=yr(e);return Ie.set(t,n),s.observe(t),()=>{Ie.delete(t),s.unobserve(t)}}const Tr={some:0,all:1};class br extends z{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,a={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Tr[i]},o=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,r&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=l?u:h;f&&f(c)};return vr(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Vr(e,n))&&this.startObserver()}unmount(){}}function Vr({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Sr={inView:{Feature:br},tap:{Feature:pr},focus:{Feature:dr},hover:{Feature:fr}},Ar={renderer:Ni,...hr,...Sr};var Mr=Ar;export{Mr as default};