llmtap 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/assets/CommandBar-CTVjcTSb.js +1 -0
- package/dist/dashboard/assets/Costs-CIcHpRev.js +1 -0
- package/dist/dashboard/assets/Dashboard-Bxw4TSkN.js +1 -0
- package/dist/dashboard/assets/DataTable-NGj_eAG3.js +1 -0
- package/dist/dashboard/assets/EmptyState-B8rSQL1S.js +1 -0
- package/dist/dashboard/assets/GettingStartedPanel-Cn46fQ1w.js +18 -0
- package/dist/dashboard/assets/Models-BJBIK0Bi.js +1 -0
- package/dist/dashboard/assets/ProviderBadge-Qtp_Hf66.js +1 -0
- package/dist/dashboard/assets/Sessions-BqAJxlud.js +3 -0
- package/dist/dashboard/assets/Settings-R7gn546k.js +6 -0
- package/dist/dashboard/assets/TraceDetail-BNzpHmos.js +17 -0
- package/dist/dashboard/assets/Traces-Bcs-oGQr.js +1 -0
- package/dist/dashboard/assets/{accordion-DZ-R65JQ.js → accordion-BbWMmUmi.js} +1 -1
- package/dist/dashboard/assets/content-BV3DhCiY.js +2 -0
- package/dist/dashboard/assets/format-BdzpxHjW.js +1 -0
- package/dist/dashboard/assets/icons-BOLUIAKd.js +1 -0
- package/dist/dashboard/assets/index-BCjwgtkq.js +791 -0
- package/dist/dashboard/assets/index-DBxoe0Ri.css +1 -0
- package/dist/dashboard/assets/motion-CSeNjKbZ.js +17 -0
- package/dist/dashboard/assets/{number-ticker-DAf-8EjI.js → number-ticker-4lK1KASk.js} +1 -1
- package/dist/dashboard/assets/provider-colors-CTiHNYHs.js +1 -0
- package/dist/dashboard/assets/select-Dsu3r0h-.js +1 -0
- package/dist/dashboard/assets/statistics-with-status-grid-QCEOlWCN.js +1 -0
- package/dist/dashboard/index.html +4 -4
- package/package.json +3 -3
- package/dist/dashboard/assets/Costs-a6RxtEyD.js +0 -1
- package/dist/dashboard/assets/Dashboard-Dc3SbA3o.js +0 -1
- package/dist/dashboard/assets/DataTable-WlvwCpLc.js +0 -1
- package/dist/dashboard/assets/GettingStartedPanel-D2-E8-3Q.js +0 -18
- package/dist/dashboard/assets/Models-BwTqYNmO.js +0 -1
- package/dist/dashboard/assets/Sessions-PuU5TiOR.js +0 -3
- package/dist/dashboard/assets/Settings-Dsgny2rQ.js +0 -6
- package/dist/dashboard/assets/StatusDot-D69CfzT5.js +0 -1
- package/dist/dashboard/assets/TraceDetail-_YLBxcmc.js +0 -17
- package/dist/dashboard/assets/Traces-B5znc91x.js +0 -1
- package/dist/dashboard/assets/constants-OlSc-7iA.js +0 -1
- package/dist/dashboard/assets/content-BRoZVvRJ.js +0 -2
- package/dist/dashboard/assets/format-wxLsIVjs.js +0 -1
- package/dist/dashboard/assets/icons-mXW2t-HS.js +0 -1
- package/dist/dashboard/assets/index-BjX-ME4E.js +0 -14
- package/dist/dashboard/assets/index-C98gdeiH.css +0 -1
- package/dist/dashboard/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/dist/dashboard/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/dist/dashboard/assets/motion-DSHPdBNu.js +0 -17
- package/dist/dashboard/assets/provider-colors-BhO_XSTV.js +0 -1
- package/dist/dashboard/assets/select-DxzgyWz-.js +0 -1
- package/dist/dashboard/assets/statistics-with-status-grid-DE7T_RSi.js +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{r as x,j as q}from"./query-DVWnIZNd.js";const Ti=x.createContext({});function Ie(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Oh=typeof window<"u",wi=Oh?x.useLayoutEffect:x.useEffect,Bn=x.createContext(null);function Pi(t,e){t.indexOf(e)===-1&&t.push(e)}function wn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Pt=(t,e,n)=>n>e?e:n<t?t:n;let Si=()=>{};const bt={},cl=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ul(t){return typeof t=="object"&&t!==null}const hl=t=>/^0[^.\s]+$/u.test(t);function fl(t){let e;return()=>(e===void 0&&(e=t()),e)}const ct=t=>t,jh=(t,e)=>n=>e(t(n)),Fe=(...t)=>t.reduce(jh),Ve=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};let bi=class{constructor(){this.subscriptions=[]}add(e){return Pi(this.subscriptions,e),()=>wn(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 o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const ot=t=>t*1e3,at=t=>t/1e3;function dl(t,e){return e?t*(1e3/e):0}const pl=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Nh=1e-7,Uh=12;function Wh(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=pl(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Nh&&++a<Uh);return o}function Be(t,e,n,s){if(t===e&&n===s)return ct;const i=r=>Wh(r,0,1,t,n);return r=>r===0||r===1?r:pl(i(r),e,s)}const ml=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,gl=t=>e=>1-t(1-e),yl=Be(.33,1.53,.69,.99),Ai=gl(yl),vl=ml(Ai),xl=t=>(t*=2)<1?.5*Ai(t):.5*(2-Math.pow(2,-10*(t-1))),Vi=t=>1-Math.sin(Math.acos(t)),Tl=gl(Vi),wl=ml(Vi),Kh=Be(.42,0,1,1),Hh=Be(0,0,.58,1),Pl=Be(.42,0,.58,1),Gh=t=>Array.isArray(t)&&typeof t[0]!="number",Sl=t=>Array.isArray(t)&&typeof t[0]=="number",zh={linear:ct,easeIn:Kh,easeInOut:Pl,easeOut:Hh,circIn:Vi,circInOut:wl,circOut:Tl,backIn:Ai,backInOut:vl,backOut:yl,anticipate:xl},_h=t=>typeof t=="string",Ao=t=>{if(Sl(t)){Si(t.length===4);const[e,n,s,i]=t;return Be(e,n,s,i)}else if(_h(t))return zh[t];return t},_e=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Xh(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){o.has(l)&&(u.schedule(l),t()),l(a)}const u={schedule:(l,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&o.add(l),p.has(l)||p.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(c),n.clear(),i=!1,r&&(r=!1,u.process(l))}};return u}const Yh=40;function bl(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=_e.reduce((v,w)=>(v[w]=Xh(r),v),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:h,preRender:f,render:d,postRender:p}=o,m=()=>{const v=bt.useManualTiming?i.timestamp:performance.now();n=!1,bt.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,Yh),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},g=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:_e.reduce((v,w)=>{const S=o[w];return v[w]=(M,D=!1,b=!1)=>(n||g(),S.schedule(M,D,b)),v},{}),cancel:v=>{for(let w=0;w<_e.length;w++)o[_e[w]].cancel(v)},state:i,steps:o}}const{schedule:k,cancel:At,state:Z,steps:Xn}=bl(typeof requestAnimationFrame<"u"?requestAnimationFrame:ct,!0);let sn;function qh(){sn=void 0}const tt={now:()=>(sn===void 0&&tt.set(Z.isProcessing||bt.useManualTiming?Z.timestamp:performance.now()),sn),set:t=>{sn=t,queueMicrotask(qh)}},Al=t=>e=>typeof e=="string"&&e.startsWith(t),Vl=Al("--"),Zh=Al("var(--"),Ci=t=>Zh(t)?Jh.test(t.split("/*")[0].trim()):!1,Jh=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Vo(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const re={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ce={...re,transform:t=>Pt(0,1,t)},Xe={...re,default:1},ge=t=>Math.round(t*1e5)/1e5,$i=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qh(t){return t==null}const tf=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Mi=(t,e)=>n=>!!(typeof n=="string"&&tf.test(n)&&n.startsWith(t)||e&&!Qh(n)&&Object.prototype.hasOwnProperty.call(n,e)),Cl=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match($i);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ef=t=>Pt(0,255,t),Yn={...re,transform:t=>Math.round(ef(t))},Ot={test:Mi("rgb","red"),parse:Cl("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Yn.transform(t)+", "+Yn.transform(e)+", "+Yn.transform(n)+", "+ge(Ce.transform(s))+")"};function nf(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Cs={test:Mi("#"),parse:nf,transform:Ot.transform},Oe=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ct=Oe("deg"),Tt=Oe("%"),V=Oe("px"),sf=Oe("vh"),of=Oe("vw"),Co={...Tt,parse:t=>Tt.parse(t)/100,transform:t=>Tt.transform(t*100)},Yt={test:Mi("hsl","hue"),parse:Cl("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Tt.transform(ge(e))+", "+Tt.transform(ge(n))+", "+ge(Ce.transform(s))+")"},W={test:t=>Ot.test(t)||Cs.test(t)||Yt.test(t),parse:t=>Ot.test(t)?Ot.parse(t):Yt.test(t)?Yt.parse(t):Cs.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ot.transform(t):Yt.transform(t),getAnimatableNone:t=>{const e=W.parse(t);return e.alpha=0,W.transform(e)}},rf=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function af(t){return isNaN(t)&&typeof t=="string"&&(t.match($i)?.length||0)+(t.match(rf)?.length||0)>0}const $l="number",Ml="color",lf="var",cf="var(",$o="${}",uf=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ie(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(uf,c=>(W.test(c)?(s.color.push(r),i.push(Ml),n.push(W.parse(c))):c.startsWith(cf)?(s.var.push(r),i.push(lf),n.push(c)):(s.number.push(r),i.push($l),n.push(parseFloat(c))),++r,$o)).split($o);return{values:n,split:a,indexes:s,types:i}}function hf(t){return ie(t).values}function Dl({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===$l?i+=ge(s[r]):o===Ml?i+=W.transform(s[r]):i+=s[r]}return i}}function ff(t){return Dl(ie(t))}const df=t=>typeof t=="number"?0:W.test(t)?W.getAnimatableNone(t):t,pf=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:df(t);function mf(t){const e=ie(t);return Dl(e)(e.values.map((s,i)=>pf(s,e.split[i])))}const mt={test:af,parse:hf,createTransformer:ff,getAnimatableNone:mf};function qn(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 gf({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=qn(c,a,t+1/3),r=qn(c,a,t),o=qn(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Pn(t,e){return n=>n>0?e:t}const B=(t,e,n)=>t+(e-t)*n,Zn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},yf=[Cs,Ot,Yt],vf=t=>yf.find(e=>e.test(t));function Mo(t){const e=vf(t);if(!e)return!1;let n=e.parse(t);return e===Yt&&(n=gf(n)),n}const Do=(t,e)=>{const n=Mo(t),s=Mo(e);if(!n||!s)return Pn(t,e);const i={...n};return r=>(i.red=Zn(n.red,s.red,r),i.green=Zn(n.green,s.green,r),i.blue=Zn(n.blue,s.blue,r),i.alpha=B(n.alpha,s.alpha,r),Ot.transform(i))},$s=new Set(["none","hidden"]);function xf(t,e){return $s.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Tf(t,e){return n=>B(t,e,n)}function Di(t){return typeof t=="number"?Tf:typeof t=="string"?Ci(t)?Pn:W.test(t)?Do:Sf:Array.isArray(t)?El:typeof t=="object"?W.test(t)?Do:wf:Pn}function El(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Di(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function wf(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Di(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Pf(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],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const Sf=(t,e)=>{const n=mt.createTransformer(e),s=ie(t),i=ie(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?$s.has(t)&&!i.values.length||$s.has(e)&&!s.values.length?xf(t,e):Fe(El(Pf(s,i),i.values),n):Pn(t,e)};function Rl(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?B(t,e,n):Di(t)(t,e)}const bf=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>k.update(e,n),stop:()=>At(e),now:()=>Z.isProcessing?Z.timestamp:tt.now()}},Ll=(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)})`},Sn=2e4;function Ei(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Sn;)e+=n,s=t.next(e);return e>=Sn?1/0:e}function Af(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Ei(s),Sn);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:at(i)}}const O={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};function Ms(t,e){return t*Math.sqrt(1-e*e)}const Vf=12;function Cf(t,e,n){let s=n;for(let i=1;i<Vf;i++)s=s-t(s)/e(s);return s}const Jn=.001;function $f({duration:t=O.duration,bounce:e=O.bounce,velocity:n=O.velocity,mass:s=O.mass}){let i,r,o=1-e;o=Pt(O.minDamping,O.maxDamping,o),t=Pt(O.minDuration,O.maxDuration,at(t)),o<1?(i=u=>{const l=u*o,h=l*t,f=l-n,d=Ms(u,o),p=Math.exp(-h);return Jn-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=Ms(Math.pow(u,2),o);return(-i(u)+Jn>0?-1:1)*((f-d)*p)/m}):(i=u=>{const l=Math.exp(-u*t),h=(u-n)*t+1;return-Jn+l*h},r=u=>{const l=Math.exp(-u*t),h=(n-u)*(t*t);return l*h});const a=5/t,c=Cf(i,r,a);if(t=ot(t),isNaN(c))return{stiffness:O.stiffness,damping:O.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Mf=["duration","bounce"],Df=["stiffness","damping","mass"];function Eo(t,e){return e.some(n=>t[n]!==void 0)}function Ef(t){let e={velocity:O.velocity,stiffness:O.stiffness,damping:O.damping,mass:O.mass,isResolvedFromDuration:!1,...t};if(!Eo(t,Df)&&Eo(t,Mf))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*Pt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:O.mass,stiffness:i,damping:r}}else{const n=$f({...t,velocity:0});e={...e,...n,mass:O.mass},e.isResolvedFromDuration=!0}return e}function bn(t=O.visualDuration,e=O.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],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:c,damping:u,mass:l,duration:h,velocity:f,isResolvedFromDuration:d}=Ef({...n,velocity:-at(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(c*l)),g=o-r,y=at(Math.sqrt(c/l)),T=Math.abs(g)<5;s||(s=T?O.restSpeed.granular:O.restSpeed.default),i||(i=T?O.restDelta.granular:O.restDelta.default);let v,w,S,M,D,b;if(m<1)S=Ms(y,m),M=(p+m*y*g)/S,v=P=>{const $=Math.exp(-m*y*P);return o-$*(M*Math.sin(S*P)+g*Math.cos(S*P))},D=m*y*M+g*S,b=m*y*g-M*S,w=P=>Math.exp(-m*y*P)*(D*Math.sin(S*P)+b*Math.cos(S*P));else if(m===1){v=$=>o-Math.exp(-y*$)*(g+(p+y*g)*$);const P=p+y*g;w=$=>Math.exp(-y*$)*(y*P*$-p)}else{const P=y*Math.sqrt(m*m-1);v=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return o-G*((p+m*y*g)*Math.sinh(U)+P*g*Math.cosh(U))/P};const $=(p+m*y*g)/P,E=m*y*$-g*P,H=m*y*g-$*P;w=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return G*(E*Math.sinh(U)+H*Math.cosh(U))}}const A={calculatedDuration:d&&h||null,velocity:P=>ot(w(P)),next:P=>{if(!d&&m<1){const E=Math.exp(-m*y*P),H=Math.sin(S*P),N=Math.cos(S*P),G=o-E*(M*H+g*N),U=ot(E*(D*H+b*N));return a.done=Math.abs(U)<=s&&Math.abs(o-G)<=i,a.value=a.done?o:G,a}const $=v(P);if(d)a.done=P>=h;else{const E=ot(w(P));a.done=Math.abs(E)<=s&&Math.abs(o-$)<=i}return a.value=a.done?o:$,a},toString:()=>{const P=Math.min(Ei(A),Sn),$=Ll(E=>A.next(P*E).value,P,30);return P+"ms "+$},toTransition:()=>{}};return A}bn.applyToOptions=t=>{const e=Af(t,100,bn);return t.ease=e.ease,t.duration=ot(e.duration),t.type="keyframes",t};const Rf=5;function kl(t,e,n){const s=Math.max(e-Rf,0);return dl(n-t(s),e-s)}function Ds({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&b<a||c!==void 0&&b>c,p=b=>a===void 0?c:c===void 0||Math.abs(a-b)<Math.abs(c-b)?a:c;let m=n*e;const g=h+m,y=o===void 0?g:o(g);y!==g&&(m=y-h);const T=b=>-m*Math.exp(-b/s),v=b=>y+T(b),w=b=>{const A=T(b),P=v(b);f.done=Math.abs(A)<=u,f.value=f.done?y:P};let S,M;const D=b=>{d(f.value)&&(S=b,M=bn({keyframes:[f.value,p(f.value)],velocity:kl(v,b,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return D(0),{calculatedDuration:null,next:b=>{let A=!1;return!M&&S===void 0&&(A=!0,w(b),D(b)),S!==void 0&&b>=S?M.next(b-S):(!A&&w(b),f)}}}function Lf(t,e,n){const s=[],i=n||bt.mix||Rl,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||ct:e;a=Fe(c,a)}s.push(a)}return s}function Il(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Si(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Lf(e,s,i),c=a.length,u=l=>{if(o&&l<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(l<t[h+1]);h++);const f=Ve(t[h],t[h+1],l);return a[h](f)};return n?l=>u(Pt(t[0],t[r-1],l)):u}function kf(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ve(0,e,s);t.push(B(n,1,i))}}function If(t){const e=[0];return kf(e,t.length-1),e}function Ff(t,e){return t.map(n=>n*e)}function Bf(t,e){return t.map(()=>e||Pl).splice(0,t.length-1)}function ye({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Gh(s)?s.map(Ao):Ao(s),r={done:!1,value:e[0]},o=Ff(n&&n.length===e.length?n:If(e),t),a=Il(o,e,{ease:Array.isArray(i)?i:Bf(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const Of=t=>t!==null;function Ri(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Of),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const jf={decay:Ds,inertia:Ds,tween:ye,keyframes:ye,spring:bn};function Fl(t){typeof t.type=="string"&&(t.type=jf[t.type])}let Li=class{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 Nf=t=>t/100;let On=class extends Li{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!==tt.now()&&this.tick(tt.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;Fl(e);const{type:n=ye,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||ye;c!==ye&&typeof a[0]!="number"&&(this.mixKeyframes=Fe(Nf,Rl(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Ei(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}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:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:g}=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 y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=s;if(h){const b=Math.min(this.currentTime,i)/a;let A=Math.floor(b),P=b%1;!P&&b>=1&&(P=1),P===1&&A--,A=Math.min(A,h+1),A%2&&(f==="reverse"?(P=1-P,d&&(P-=d/a)):f==="mirror"&&(w=o)),v=Pt(0,1,P)*a}const S=T?{done:!1,value:l[0]}:w.next(v);r&&!T&&(S.value=r(S.value));let{done:M}=S;!T&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return D&&p!==Ds&&(S.value=Ri(l,this.options,g,this.speed)),m&&m(S.value),D&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return at(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+at(e)}get time(){return at(this.currentTime)}set time(e){e=ot(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?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return kl(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(tt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=at(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=bf,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(tt.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 Uf(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const jt=t=>t*180/Math.PI,Es=t=>{const e=jt(Math.atan2(t[1],t[0]));return Rs(e)},Wf={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Es,rotateZ:Es,skewX:t=>jt(Math.atan(t[1])),skewY:t=>jt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Rs=t=>(t=t%360,t<0&&(t+=360),t),Ro=Es,Lo=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ko=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Kf={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Lo,scaleY:ko,scale:t=>(Lo(t)+ko(t))/2,rotateX:t=>Rs(jt(Math.atan2(t[6],t[5]))),rotateY:t=>Rs(jt(Math.atan2(-t[2],t[0]))),rotateZ:Ro,rotate:Ro,skewX:t=>jt(Math.atan(t[4])),skewY:t=>jt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ls(t){return t.includes("scale")?1:0}function ks(t,e){if(!t||t==="none")return Ls(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Kf,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Wf,i=a}if(!i)return Ls(e);const r=s[e],o=i[1].split(",").map(Gf);return typeof r=="function"?r(o):o[r]}const Hf=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ks(n,e)};function Gf(t){return parseFloat(t.trim())}const ae=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],le=new Set(ae),Io=t=>t===re||t===V,zf=new Set(["x","y","z"]),_f=ae.filter(t=>!zf.has(t));function Xf(t){const e=[];return _f.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Mt={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})=>ks(e,"x"),y:(t,{transform:e})=>ks(e,"y")};Mt.translateX=Mt.x;Mt.translateY=Mt.y;const Wt=new Set;let Is=!1,Fs=!1,Bs=!1;function Bl(){if(Fs){const t=Array.from(Wt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Xf(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,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Fs=!1,Is=!1,Wt.forEach(t=>t.complete(Bs)),Wt.clear()}function Ol(){Wt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Fs=!0)})}function Yf(){Bs=!0,Ol(),Bl(),Bs=!1}let ki=class{constructor(e,n,s,i,r,o=!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=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Wt.add(this),Is||(Is=!0,k.read(Ol),k.resolveKeyframes(Bl))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Uf(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Wt.delete(this)}cancel(){this.state==="scheduled"&&(Wt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};const qf=t=>t.startsWith("--");function jl(t,e,n){qf(e)?t.style.setProperty(e,n):t.style[e]=n}const Zf={};function Nl(t,e){const n=fl(t);return()=>Zf[e]??n()}const Jf=Nl(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ul=Nl(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pe=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Fo={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pe([0,.65,.55,1]),circOut:pe([.55,0,1,.45]),backIn:pe([.31,.01,.66,-.59]),backOut:pe([.33,1.53,.69,.99])};function Wl(t,e){if(t)return typeof t=="function"?Ul()?Ll(t,e):"ease-out":Sl(t)?pe(t):Array.isArray(t)?t.map(n=>Wl(n,e)||Fo.easeOut):Fo[t]}function Qf(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[e]:n};c&&(l.offset=c);const h=Wl(a,i);Array.isArray(h)&&(l.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(l,f)}function Kl(t){return typeof t=="function"&&"applyToOptions"in t}function td({type:t,...e}){return Kl(t)&&Ul()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}let Hl=class extends Li{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:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Si(typeof e.type!="string");const u=td(e);this.animation=Qf(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=Ri(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),jl(n,s,l),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(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return at(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+at(e)}get time(){return at(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ot(e),n&&this.animation.pause()}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,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Jf()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),ct):i(this)}};const Gl={anticipate:xl,backInOut:vl,circInOut:wl};function ed(t){return t in Gl}function nd(t){typeof t.ease=="string"&&ed(t.ease)&&(t.ease=Gl[t.ease])}const Qn=10;let sd=class extends Hl{constructor(e){nd(e),Fl(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new On({...o,autoplay:!1}),c=Math.max(Qn,tt.now()-this.startTime),u=Pt(0,Qn,c-Qn),l=a.sample(c).value,{name:h}=this.options;r&&h&&jl(r,h,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}};const Bo=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(mt.test(t)||t==="0")&&!t.startsWith("url("));function id(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 od(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],o=Bo(i,e),a=Bo(r,e);return!o||!a?!1:id(t)||(n==="spring"||Kl(n))&&s}function Os(t){t.duration=0,t.type="keyframes"}const rd=new Set(["opacity","clipPath","filter","transform"]),ad=fl(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ld(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return ad()&&n&&rd.has(n)&&(n!=="transform"||!u)&&!c&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const cd=40;let ud=class extends Li{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=tt.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:l,...h},d=l?.KeyframeResolver||ki;this.keyframeResolver=new d(a,(p,m,g)=>this.onKeyframesResolved(p,m,f,!g),c,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=tt.now(),od(e,r,o,a)||((bt.instantAnimations||!c)&&l?.(Ri(e,s,n)),e[0]=e[e.length-1],Os(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>cd?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&ld(f),p=f.motionValue?.owner?.current,m=d?new sd({...f,element:p}):new On(f);m.finished.then(()=>{this.notifyFinished()}).catch(ct),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}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(),Yf()),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()}};function zl(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,l)=>u.sortNodePosition(l)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const hd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fd(t){const e=hd.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function _l(t,e,n=1){const[s,i]=fd(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return cl(o)?parseFloat(o):o}return Ci(i)?_l(i,e,n+1):i}const dd={type:"spring",stiffness:500,damping:25,restSpeed:10},pd=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),md={type:"keyframes",duration:.8},gd={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},yd=(t,{keyframes:e})=>e.length>2?md:le.has(t)?t.startsWith("scale")?pd(e[1]):dd:gd,vd=t=>t!==null;function xd(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(vd),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[r]}function Xl(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function Ii(t,e){const n=t?.[e]??t?.default??t;return n!==t?Xl(n,t):n}function Td({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:c,elapsed:u,...l}){return!!Object.keys(l).length}const Fi=(t,e,n,s={},i,r)=>o=>{const a=Ii(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-ot(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Td(a)||Object.assign(l,yd(t,l)),l.duration&&(l.duration=ot(l.duration)),l.repeatDelay&&(l.repeatDelay=ot(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let h=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(Os(l),l.delay===0&&(h=!0)),(bt.instantAnimations||bt.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,Os(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=xd(l.keyframes,a);if(f!==void 0){k.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new On(l):new ud(l)};function Oo(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Bi(t,e,n,s){if(typeof e=="function"){const[i,r]=Oo(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Oo(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function se(t,e,n){const s=t.getProps();return Bi(s,e,n!==void 0?n:s.custom,t)}const Yl=new Set(["width","height","top","left","right","bottom",...ae]),jo=30,wd=t=>!isNaN(parseFloat(t)),ve={current:void 0};let Pd=class{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=tt.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=tt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wd(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 bi);const s=this.events[e].add(n);return e==="change"?()=>{s(),k.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 ve.current&&ve.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=tt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>jo)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,jo);return dl(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 Gt(t,e){return new Pd(t,e)}const js=t=>Array.isArray(t);function Sd(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Gt(n))}function bd(t){return js(t)?t[t.length-1]||0:t}function Ad(t,e){const n=se(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=bd(r[o]);Sd(t,o,a)}}const Y=t=>!!(t&&t.getVelocity);function Vd(t){return!!(Y(t)&&t.add)}function Ns(t,e){const n=t.getValue("willChange");if(Vd(n))return n.add(e);if(!n&&bt.WillChange){const s=new bt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function Oi(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Cd="framerAppearId",ql="data-"+Oi(Cd);function Zl(t){return t.props[ql]}function $d({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Jl(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Xl(r,c):c;const u=r?.reduceMotion;s&&(r=s);const l=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),p=a[f];if(p===void 0||h&&$d(h,f))continue;const m={delay:n,...Ii(r||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===g&&!m.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const w=Zl(t);if(w){const S=window.MotionHandoffAnimation(w,f,k);S!==null&&(m.startTime=S,y=!0)}}Ns(t,f);const T=u??t.shouldReduceMotion;d.start(Fi(f,d,p,T&&Yl.has(f)?{type:!1}:m,t,y));const v=d.animation;v&&l.push(v)}if(o){const f=()=>k.update(()=>{o&&Ad(t,o)});l.length?Promise.all(l).then(f):f()}return l}function Us(t,e,n={}){const s=se(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(Jl(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:h}=i;return Md(t,e,c,u,l,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Md(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(Us(c,e,{...o,delay:n+(typeof s=="function"?0:s)+zl(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Dd(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Us(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Us(t,e,n);else{const i=typeof e=="function"?se(t,e,n.custom):e;s=Promise.all(Jl(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ed={test:t=>t==="auto",parse:t=>t},Ql=t=>e=>e.test(t),tc=[re,V,Tt,Ct,of,sf,Ed],No=t=>tc.find(Ql(t));function Rd(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||hl(t):!0}const Ld=new Set(["brightness","contrast","saturate","opacity"]);function kd(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match($i)||[];if(!s)return t;const i=n.replace(s,"");let r=Ld.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Id=/\b([a-z-]*)\(.*?\)/gu,Ws={...mt,getAnimatableNone:t=>{const e=t.match(Id);return e?e.map(kd).join(" "):t}},Ks={...mt,getAnimatableNone:t=>{const e=mt.parse(t);return mt.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Uo={...re,transform:Math.round},Fd={rotate:Ct,rotateX:Ct,rotateY:Ct,rotateZ:Ct,scale:Xe,scaleX:Xe,scaleY:Xe,scaleZ:Xe,skew:Ct,skewX:Ct,skewY:Ct,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:Ce,originX:Co,originY:Co,originZ:V},ji={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,inset:V,insetBlock:V,insetBlockStart:V,insetBlockEnd:V,insetInline:V,insetInlineStart:V,insetInlineEnd:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,paddingBlock:V,paddingBlockStart:V,paddingBlockEnd:V,paddingInline:V,paddingInlineStart:V,paddingInlineEnd:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,marginBlock:V,marginBlockStart:V,marginBlockEnd:V,marginInline:V,marginInlineStart:V,marginInlineEnd:V,fontSize:V,backgroundPositionX:V,backgroundPositionY:V,...Fd,zIndex:Uo,fillOpacity:Ce,strokeOpacity:Ce,numOctaves:Uo},Bd={...ji,color:W,backgroundColor:W,outlineColor:W,fill:W,stroke:W,borderColor:W,borderTopColor:W,borderRightColor:W,borderBottomColor:W,borderLeftColor:W,filter:Ws,WebkitFilter:Ws,mask:Ks,WebkitMask:Ks},ec=t=>Bd[t],Od=new Set([Ws,Ks]);function nc(t,e){let n=ec(t);return Od.has(n)||(n=mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const jd=new Set(["auto","none","0"]);function Nd(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!jd.has(r)&&ie(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=nc(n,i)}let Ud=class extends ki{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 l=0;l<e.length;l++){let h=e[l];if(typeof h=="string"&&(h=h.trim(),Ci(h))){const f=_l(h,n.current);f!==void 0&&(e[l]=f),l===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Yl.has(s)||e.length!==2)return;const[i,r]=e,o=No(i),a=No(r),c=Vo(i),u=Vo(r);if(c!==u&&Mt[s]){this.needsMeasurement=!0;return}if(o!==a)if(Io(o)&&Io(a))for(let l=0;l<e.length;l++){const h=e[l];typeof h=="string"&&(e[l]=parseFloat(h))}else Mt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Rd(e[i]))&&s.push(i);s.length&&Nd(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=Mt[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,o=s[r];s[r]=Mt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}};const Wd=new Set(["opacity","clipPath","filter","transform"]);function Ni(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(s=>s!=null)}const sc=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function on(t){return ul(t)&&"offsetHeight"in t}const{schedule:Ui}=bl(queueMicrotask,!1),dt={x:!1,y:!1};function ic(){return dt.x||dt.y}function Kd(t){return t==="x"||t==="y"?dt[t]?null:(dt[t]=!0,()=>{dt[t]=!1}):dt.x||dt.y?null:(dt.x=dt.y=!0,()=>{dt.x=dt.y=!1})}function oc(t,e){const n=Ni(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Hd(t){return!(t.pointerType==="touch"||ic())}function Gd(t,e,n={}){const[s,i,r]=oc(t,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",p)},h=g=>{u&&(u(g),u=void 0),l()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(g))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=g=>{if(g.pointerType!=="touch"){if(a){c=!0;return}h(g)}},m=g=>{if(!Hd(g))return;c=!1;const y=e(o,g);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",d,i)}),r}const rc=(t,e)=>e?t===e?!0:rc(t,e.parentElement):!1,Wi=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,zd=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _d(t){return zd.has(t.tagName)||t.isContentEditable===!0}const Xd=new Set(["INPUT","SELECT","TEXTAREA"]);function Yd(t){return Xd.has(t.tagName)||t.isContentEditable===!0}const rn=new WeakSet;function Wo(t){return e=>{e.key==="Enter"&&t(e)}}function ts(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const qd=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Wo(()=>{if(rn.has(n))return;ts(n,"down");const i=Wo(()=>{ts(n,"up")}),r=()=>ts(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 Ko(t){return Wi(t)&&!ic()}const Ho=new WeakSet;function Zd(t,e,n={}){const[s,i,r]=oc(t,n),o=a=>{const c=a.currentTarget;if(!Ko(a)||Ho.has(a))return;rn.add(c),n.stopPropagation&&Ho.add(a);const u=e(c,a),l=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),rn.has(c)&&rn.delete(c),Ko(d)&&typeof u=="function"&&u(d,{success:p})},h=d=>{l(d,c===window||c===document||n.useGlobalTarget||rc(c,d.target))},f=d=>{l(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),on(a)&&(a.addEventListener("focus",u=>qd(u,i)),!_d(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function Ki(t){return ul(t)&&"ownerSVGElement"in t}const an=new WeakMap;let ln;const ac=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Ki(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Jd=ac("inline","width","offsetWidth"),Qd=ac("block","height","offsetHeight");function tp({target:t,borderBoxSize:e}){an.get(t)?.forEach(n=>{n(t,{get width(){return Jd(t,e)},get height(){return Qd(t,e)}})})}function ep(t){t.forEach(tp)}function np(){typeof ResizeObserver>"u"||(ln=new ResizeObserver(ep))}function sp(t,e){ln||np();const n=Ni(t);return n.forEach(s=>{let i=an.get(s);i||(i=new Set,an.set(s,i)),i.add(e),ln?.observe(s)}),()=>{n.forEach(s=>{const i=an.get(s);i?.delete(e),i?.size||ln?.unobserve(s)})}}const cn=new Set;let qt;function ip(){qt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};cn.forEach(e=>e(t))},window.addEventListener("resize",qt)}function op(t){return cn.add(t),qt||ip(),()=>{cn.delete(t),!cn.size&&typeof qt=="function"&&(window.removeEventListener("resize",qt),qt=void 0)}}function Go(t,e){return typeof t=="function"?op(t):sp(t,e)}function rp(t){return Ki(t)&&t.tagName==="svg"}function ap(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=Il(i,r,o);return e?a(s):a}function lp(t,e,n={}){const s=t.get();let i=null,r=s,o;const a=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,c=()=>{i&&(i.stop(),i=null)},u=()=>{const h=_o(t.get()),f=_o(r);if(h===f){c();return}const d=i?i.getGeneratorVelocity():t.getVelocity();c(),i=new On({keyframes:[h,f],velocity:d,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},l=()=>{u(),t.events.animationStart?.notify(),i?.then(()=>{t.events.animationComplete?.notify()})};if(t.attach((h,f)=>{r=h,o=d=>f(zo(d,a)),k.postRender(l)},c),Y(e)){const h=e.on("change",d=>t.set(zo(d,a))),f=t.on("destroy",h);return()=>{h(),f()}}return c}function zo(t,e){return e?t+e:t}function _o(t){return typeof t=="number"?t:parseFloat(t)}const cp=[...tc,W,mt],up=t=>cp.find(Ql(t)),Xo=()=>({translate:0,scale:1,origin:0,originPoint:0}),Zt=()=>({x:Xo(),y:Xo()}),Yo=()=>({min:0,max:0}),z=()=>({x:Yo(),y:Yo()}),hp=new WeakMap;function jn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function $e(t){return typeof t=="string"||Array.isArray(t)}const Hi=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Gi=["initial",...Hi];function Nn(t){return jn(t.animate)||Gi.some(e=>$e(t[e]))}function lc(t){return!!(Nn(t)||t.variants)}function fp(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Y(i))t.addValue(s,i);else if(Y(r))t.addValue(s,Gt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Gt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Hs={current:null},cc={current:!1},dp=typeof window<"u";function pp(){if(cc.current=!0,!!dp)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Hs.current=t.matches;t.addEventListener("change",e),e()}else Hs.current=!1}const qo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let An={};function uc(t){An=t}function mp(){return An}let gp=class{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ki,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 d=tt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,k.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Nn(n),this.isVariantNode=lc(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];u[d]!==void 0&&Y(p)&&p.set(u[d])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,hp.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:(cc.current||pp(),this.shouldReduceMotion=Hs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),At(this.notifyUpdate),At(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){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Wd.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,h=new Hl({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:ot(l)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=le.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&k.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&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 An){const n=An[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):z()}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<qo.length;s++){const i=qo[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=fp(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=Gt(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"&&(cl(s)||hl(s))?s=parseFloat(s):!up(s)&&mt.test(n)&&(s=nc(e,n)),this.setBaseTarget(e,Y(s)?s.get():s)),Y(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=Bi(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&&!Y(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 bi),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Ui.render(this.render)}},hc=class extends gp{constructor(){super(...arguments),this.KeyframeResolver=Ud}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[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;Y(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}},Rt=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function fc({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function yp({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function vp(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 es(t){return t===void 0||t===1}function Gs({scale:t,scaleX:e,scaleY:n}){return!es(t)||!es(e)||!es(n)}function Ft(t){return Gs(t)||dc(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function dc(t){return Zo(t.x)||Zo(t.y)}function Zo(t){return t&&t!=="0%"}function Vn(t,e,n){const s=t-n,i=e*s;return n+i}function Jo(t,e,n,s,i){return i!==void 0&&(t=Vn(t,i,s)),Vn(t,n,s)+e}function zs(t,e=0,n=1,s,i){t.min=Jo(t.min,e,n,s,i),t.max=Jo(t.max,e,n,s,i)}function pc(t,{x:e,y:n}){zs(t.x,e.translate,e.scale,e.originPoint),zs(t.y,n.translate,n.scale,n.originPoint)}const Qo=.999999999999,tr=1.0000000000001;function xp(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Qt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,pc(t,o)),s&&Ft(r.latestValues)&&Qt(t,r.latestValues,r.layout?.layoutBox))}e.x<tr&&e.x>Qo&&(e.x=1),e.y<tr&&e.y>Qo&&(e.y=1)}function Jt(t,e){t.min=t.min+e,t.max=t.max+e}function er(t,e,n,s,i=.5){const r=B(t.min,t.max,i);zs(t,e,n,r,s)}function nr(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function Qt(t,e,n){const s=n??t;er(t.x,nr(e.x,s.x),e.scaleX,e.scale,e.originX),er(t.y,nr(e.y,s.y),e.scaleY,e.scale,e.originY)}function mc(t,e){return fc(vp(t.getBoundingClientRect(),e))}function Tp(t,e,n){const s=mc(t,n),{scroll:i}=e;return i&&(Jt(s.x,i.offset.x),Jt(s.y,i.offset.y)),s}const wp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Pp=ae.length;function Sp(t,e,n){let s="",i=!0;for(let r=0;r<Pp;r++){const o=ae[r],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=sc(a,ji[o]);if(!c){i=!1;const l=wp[o]||o;s+=`${l}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function zi(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const c in e){const u=e[c];if(le.has(c)){o=!0;continue}else if(Vl(c)){i[c]=u;continue}else{const l=sc(u,ji[c]);c.startsWith("origin")?(a=!0,r[c]=l):s[c]=l}}if(e.transform||(o||n?s.transform=Sp(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=r;s.transformOrigin=`${c} ${u} ${l}`}}function gc(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function sr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const fe={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(V.test(t))t=parseFloat(t);else return t;const n=sr(t,e.target.x),s=sr(t,e.target.y);return`${n}% ${s}%`}},bp={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=mt.parse(t);if(i.length>5)return s;const r=mt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const u=B(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},_s={borderRadius:{...fe,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fe,borderTopRightRadius:fe,borderBottomLeftRadius:fe,borderBottomRightRadius:fe,boxShadow:bp};function yc(t,{layout:e,layoutId:n}){return le.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!_s[t]||t==="opacity")}function _i(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(Y(s[o])||i&&Y(i[o])||yc(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function Ap(t){return window.getComputedStyle(t)}let Vp=class extends hc{constructor(){super(...arguments),this.type="html",this.renderInstance=gc}readValueFromInstance(e,n){if(le.has(n))return this.projection?.isProjecting?Ls(n):Hf(e,n);{const s=Ap(e),i=(Vl(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return mc(e,n)}build(e,n,s){zi(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return _i(e,n,s)}};const Cp={offset:"stroke-dashoffset",array:"stroke-dasharray"},$p={offset:"strokeDashoffset",array:"strokeDasharray"};function Mp(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?Cp:$p;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const Dp=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function vc(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,u,l){if(zi(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=l?.transformBox??"fill-box",delete h.transformBox);for(const d of Dp)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&Mp(h,i,r,o,!1)}const xc=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"]),Tc=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Ep(t,e,n,s){gc(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(xc.has(i)?i:Oi(i),e.attrs[i])}function wc(t,e,n){const s=_i(t,e,n);for(const i in t)if(Y(t[i])||Y(e[i])){const r=ae.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}let Rp=class extends hc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=z}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(le.has(n)){const s=ec(n);return s&&s.default||0}return n=xc.has(n)?n:Oi(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return wc(e,n,s)}build(e,n,s){vc(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Ep(e,n,s,i)}mount(e){this.isSVGTag=Tc(e.tagName),super.mount(e)}};const Lp=Gi.length;function Pc(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?Pc(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Lp;n++){const s=Gi[n],i=t.props[s];($e(i)||i===!1)&&(e[s]=i)}return e}function Sc(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 kp=[...Hi].reverse(),Ip=Hi.length;function Fp(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Dd(t,n,s)))}function Bp(t){let e=Fp(t),n=ir(),s=!0,i=!1;const r=u=>(l,h)=>{const f=se(t,h,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function o(u){e=u(t)}function a(u){const{props:l}=t,h=Pc(t.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let y=0;y<Ip;y++){const T=kp[y],v=n[T],w=l[T]!==void 0?l[T]:h[T],S=$e(w),M=T===u?v.isActive:null;M===!1&&(m=y);let D=w===h[T]&&w!==l[T]&&S;if(D&&(s||i)&&t.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...p},!v.isActive&&M===null||!w&&!v.prevProp||jn(w)||typeof w=="boolean")continue;if(T==="exit"&&v.isActive&&M!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const b=Op(v.prevProp,w);let A=b||T===u&&v.isActive&&!D&&S||y>m&&S,P=!1;const $=Array.isArray(w)?w:[w];let E=$.reduce(r(T),{});M===!1&&(E={});const{prevResolvedValues:H={}}=v,N={...H,...E},G=R=>{A=!0,d.has(R)&&(P=!0,d.delete(R)),v.needsAnimating[R]=!0;const I=t.getValue(R);I&&(I.liveStyle=!1)};for(const R in N){const I=E[R],Q=H[R];if(p.hasOwnProperty(R))continue;let it=!1;js(I)&&js(Q)?it=!Sc(I,Q):it=I!==Q,it?I!=null?G(R):d.add(R):I!==void 0&&d.has(R)?G(R):v.protectedKeys[R]=!0}v.prevProp=w,v.prevResolvedValues=E,v.isActive&&(p={...p,...E}),(s||i)&&t.blockInitialAnimation&&(A=!1);const U=D&&b;A&&(!U||P)&&f.push(...$.map(R=>{const I={type:T};if(typeof R=="string"&&(s||i)&&!U&&t.manuallyAnimateOnMount&&t.parent){const{parent:Q}=t,it=se(Q,R);if(Q.enteringChildren&&it){const{delayChildren:_n}=it.transition||{};I.delay=zl(Q.enteringChildren,t,_n)}}return{animation:R,options:I}}))}if(d.size){const y={};if(typeof l.initial!="boolean"){const T=se(t,Array.isArray(l.initial)?l.initial[0]:l.initial);T&&T.transition&&(y.transition=T.transition)}d.forEach(T=>{const v=t.getBaseTarget(T),w=t.getValue(T);w&&(w.liveStyle=!0),y[T]=v??null}),f.push({animation:y})}let g=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(f):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(u,l)),n[u].isActive=l;const h=a(u);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ir(),i=!0}}}function Op(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Sc(e,t):!1}function kt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ir(){return{animate:kt(!0),whileInView:kt(),whileHover:kt(),whileTap:kt(),whileDrag:kt(),whileFocus:kt(),exit:kt()}}function or(t,e){t.min=e.min,t.max=e.max}function ht(t,e){or(t.x,e.x),or(t.y,e.y)}function rr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const bc=1e-4,jp=1-bc,Np=1+bc,Ac=.01,Up=0-Ac,Wp=0+Ac;function et(t){return t.max-t.min}function Kp(t,e,n){return Math.abs(t-e)<=n}function ar(t,e,n,s=.5){t.origin=s,t.originPoint=B(e.min,e.max,t.origin),t.scale=et(n)/et(e),t.translate=B(n.min,n.max,t.origin)-t.originPoint,(t.scale>=jp&&t.scale<=Np||isNaN(t.scale))&&(t.scale=1),(t.translate>=Up&&t.translate<=Wp||isNaN(t.translate))&&(t.translate=0)}function xe(t,e,n,s){ar(t.x,e.x,n.x,s?s.originX:void 0),ar(t.y,e.y,n.y,s?s.originY:void 0)}function lr(t,e,n){t.min=n.min+e.min,t.max=t.min+et(e)}function Hp(t,e,n){lr(t.x,e.x,n.x),lr(t.y,e.y,n.y)}function cr(t,e,n){t.min=e.min-n.min,t.max=t.min+et(e)}function Cn(t,e,n){cr(t.x,e.x,n.x),cr(t.y,e.y,n.y)}function ur(t,e,n,s,i){return t-=e,t=Vn(t,1/n,s),i!==void 0&&(t=Vn(t,1/i,s)),t}function Gp(t,e=0,n=1,s=.5,i,r=t,o=t){if(Tt.test(e)&&(e=parseFloat(e),e=B(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=B(r.min,r.max,s);t===r&&(a-=e),t.min=ur(t.min,e,n,a,i),t.max=ur(t.max,e,n,a,i)}function hr(t,e,[n,s,i],r,o){Gp(t,e[n],e[s],e[i],e.scale,r,o)}const zp=["x","scaleX","originX"],_p=["y","scaleY","originY"];function fr(t,e,n,s){hr(t.x,e,zp,n?n.x:void 0,s?s.x:void 0),hr(t.y,e,_p,n?n.y:void 0,s?s.y:void 0)}function dr(t){return t.translate===0&&t.scale===1}function Vc(t){return dr(t.x)&&dr(t.y)}function pr(t,e){return t.min===e.min&&t.max===e.max}function Xp(t,e){return pr(t.x,e.x)&&pr(t.y,e.y)}function mr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Cc(t,e){return mr(t.x,e.x)&&mr(t.y,e.y)}function gr(t){return et(t.x)/et(t.y)}function yr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function yt(t){return[t("x"),t("y")]}function Yp(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:l,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const $c=["TopLeft","TopRight","BottomLeft","BottomRight"],qp=$c.length,vr=t=>typeof t=="string"?parseFloat(t):t,xr=t=>typeof t=="number"||V.test(t);function Zp(t,e,n,s,i,r){i?(t.opacity=B(0,n.opacity??1,Jp(s)),t.opacityExit=B(e.opacity??1,0,Qp(s))):r&&(t.opacity=B(e.opacity??1,n.opacity??1,s));for(let o=0;o<qp;o++){const a=`border${$c[o]}Radius`;let c=Tr(e,a),u=Tr(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||xr(c)===xr(u)?(t[a]=Math.max(B(vr(c),vr(u),s),0),(Tt.test(u)||Tt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=B(e.rotate||0,n.rotate||0,s))}function Tr(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Jp=Mc(0,.5,Tl),Qp=Mc(.5,.95,ct);function Mc(t,e,n){return s=>s<t?0:s>e?1:n(Ve(t,e,s))}function tm(t,e,n){const s=Y(t)?t:Gt(t);return s.start(Fi("",s,e,n)),s.animation}function Me(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const em=(t,e)=>t.depth-e.depth;let nm=class{constructor(){this.children=[],this.isDirty=!1}add(e){Pi(this.children,e),this.isDirty=!0}remove(e){wn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(em),this.isDirty=!1,this.children.forEach(e)}};function sm(t,e){const n=tt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(At(s),t(r-e))};return k.setup(s,!0),()=>At(s)}function un(t){return Y(t)?t.get():t}let im=class{constructor(){this.members=[]}add(e){Pi(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(wn(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(wn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const hn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ns=["","X","Y","Z"],om=1e3;let rm=0;function ss(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Dc(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Zl(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",k,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Dc(s)}function Ec({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=rm++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(cm),this.nodes.forEach(dm),this.nodes.forEach(pm),this.nodes.forEach(um)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new nm)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new bi),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Ki(o)&&!rp(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let l,h=0;const f=()=>this.root.updateBlockedByResize=!1;k.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,l&&l(),l=sm(f,250),hn.hasAnimatedSinceResize&&(hn.hasAnimatedSinceResize=!1,this.nodes.forEach(Sr)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||xm,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!Cc(this.targetLayout,d),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Ii(p,"layout"),onPlay:m,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(l,T)}else h||Sr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),At(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(mm),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Dc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const h=this.path[l];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(wr);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Pr);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fm),this.nodes.forEach(am),this.nodes.forEach(lm)):this.nodes.forEach(Pr),this.clearAllSnapshots();const a=tt.now();Z.delta=Pt(0,1e3/60,a-Z.timestamp),Z.timestamp=a,Z.isProcessing=!0,Xn.update.process(Z),Xn.preRender.process(Z),Xn.render.process(Z),Z.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ui.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(hm),this.sharedNodes.forEach(gm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,k.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){k.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!et(this.snapshot.measuredBox.x)&&!et(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=z(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Vc(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Ft(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),Tm(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return z();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(wm))){const{scroll:u}=this.root;u&&(Jt(a.x,u.offset.x),Jt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=z();if(ht(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:h}=u;u!==this.root&&l&&h.layoutScroll&&(l.wasRoot&&ht(a,o),Jt(a.x,l.offset.x),Jt(a.y,l.offset.y))}return a}applyTransform(o,a=!1){const c=z();ht(c,o);for(let u=0;u<this.path.length;u++){const l=this.path[u];!a&&l.options.layoutScroll&&l.scroll&&l!==l.root&&Qt(c,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),Ft(l.latestValues)&&Qt(c,l.latestValues,l.layout?.layoutBox)}return Ft(this.latestValues)&&Qt(c,this.latestValues,this.layout?.layoutBox),c}removeTransform(o){const a=z();ht(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!Ft(u.latestValues))continue;let l;u.instance&&(Gs(u.latestValues)&&u.updateSnapshot(),l=z(),ht(l,u.measurePageBox())),fr(a,u.latestValues,u.snapshot?.layoutBox,l)}return Ft(this.latestValues)&&fr(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Z.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:h}=this.options;if(!this.layout||!(l||h))return;this.resolvedRelativeTargetAt=Z.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=z(),this.targetWithTransforms=z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hp(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ht(this.target,this.layout.layoutBox),pc(this.target,this.targetDelta)):ht(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Gs(this.parent.latestValues)||dc(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=z(),this.relativeTargetOrigin=z(),Cn(this.relativeTargetOrigin,a,c),ht(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Z.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;ht(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;xp(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=z());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(rr(this.prevProjectionDelta.x,this.projectionDelta.x),rr(this.prevProjectionDelta.y,this.projectionDelta.y)),xe(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!yr(this.projectionDelta.x,this.prevProjectionDelta.x)||!yr(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Zt(),this.projectionDelta=Zt(),this.projectionDeltaWithTransform=Zt()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},h=Zt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=z(),d=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,g=this.getStack(),y=!g||g.members.length<=1,T=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(vm));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const S=w/1e3;br(h.x,o.x,S),br(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cn(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ym(this.relativeTarget,this.relativeTargetOrigin,f,S),v&&Xp(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=z()),ht(v,this.relativeTarget)),m&&(this.animationValues=l,Zp(l,u,this.latestValues,S,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(At(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=k.update(()=>{hn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Gt(0)),this.motionValue.jump(0,!1),this.currentAnimation=tm(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(om),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:l}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&Rc(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||z();const h=et(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=et(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}ht(a,c),Qt(a,l),xe(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new im),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&ss("z",o,u,this.animationValues);for(let l=0;l<ns.length;l++)ss(`rotate${ns[l]}`,o,u,this.animationValues),ss(`skew${ns[l]}`,o,u,this.animationValues);o.render();for(const l in u)o.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=un(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=un(a?.pointerEvents)||""),this.hasProjected&&!Ft(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Yp(this.projectionDeltaWithTransform,this.treeScale,l);c&&(h=c(l,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in _s){if(l[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=_s[p],T=h==="none"?l[p]:m(l[p],u);if(g){const v=g.length;for(let w=0;w<v;w++)o[g[w]]=T}else y?this.options.visualElement.renderState.vars[p]=T:o[p]=T}this.options.layoutId&&(o.pointerEvents=u===this?un(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(wr),this.root.sharedNodes.clear()}}}function am(t){t.updateLayout()}function lm(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;i==="size"?yt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=et(h);h.min=n[l].min,h.max=h.min+f}):Rc(i,e.layoutBox,n)&&yt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=et(n[l]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const o=Zt();xe(o,n,e.layoutBox);const a=Zt();r?xe(a,t.applyTransform(s,!0),e.measuredBox):xe(a,n,e.layoutBox);const c=!Vc(o);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:h,layout:f}=l;if(h&&f){const d=z();Cn(d,e.layoutBox,h.layoutBox);const p=z();Cn(p,n,f.layoutBox),Cc(d,p)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=d,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function cm(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function um(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function hm(t){t.clearSnapshot()}function wr(t){t.clearMeasurements()}function Pr(t){t.isLayoutDirty=!1}function fm(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Sr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function dm(t){t.resolveTargetDelta()}function pm(t){t.calcProjection()}function mm(t){t.resetSkewAndRotation()}function gm(t){t.removeLeadSnapshot()}function br(t,e,n){t.translate=B(e.translate,0,n),t.scale=B(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ar(t,e,n,s){t.min=B(e.min,n.min,s),t.max=B(e.max,n.max,s)}function ym(t,e,n,s){Ar(t.x,e.x,n.x,s),Ar(t.y,e.y,n.y,s)}function vm(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const xm={duration:.45,ease:[.4,0,.1,1]},Vr=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Cr=Vr("applewebkit/")&&!Vr("chrome/")?Math.round:ct;function $r(t){t.min=Cr(t.min),t.max=Cr(t.max)}function Tm(t){$r(t.x),$r(t.y)}function Rc(t,e,n){return t==="position"||t==="preserve-aspect"&&!Kp(gr(e),gr(n),.2)}function wm(t){return t!==t.root&&t.scroll?.wasRoot}const Pm=Ec({attachResizeListener:(t,e)=>Me(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),is={current:void 0},Lc=Ec({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!is.current){const t=new Pm({});t.mount(window),t.setOptions({layoutScroll:!0}),is.current=t}return is.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),je=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Mr(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Sm(...t){return e=>{let n=!1;const s=t.map(i=>{const r=Mr(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Mr(t[i],null)}}}}function bm(...t){return x.useCallback(Sm(...t),t)}let Am=class extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(on(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=on(s)&&s.offsetWidth||0,r=on(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}};function Vm({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=x.useId(),a=x.useRef(null),c=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=x.useContext(je),l=t.props?.ref??t?.ref,h=bm(a,l);return x.useInsertionEffect(()=>{const{width:f,height:d,top:p,left:m,right:g,bottom:y}=c.current;if(e||r===!1||!a.current||!f||!d)return;const T=n==="left"?`left: ${m}`:`right: ${g}`,v=s==="bottom"?`bottom: ${y}`:`top: ${p}`;a.current.dataset.motionPopId=o;const w=document.createElement("style");u&&(w.nonce=u);const S=i??document.head;return S.appendChild(w),w.sheet&&w.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${o}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${f}px !important;
|
|
5
|
+
height: ${d}px !important;
|
|
6
|
+
${T}px !important;
|
|
7
|
+
${v}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{S.contains(w)&&S.removeChild(w)}},[e]),q.jsx(Am,{isPresent:e,childRef:a,sizeRef:c,pop:r,children:r===!1?t:x.cloneElement(t,{ref:h})})}const Cm=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:c,root:u})=>{const l=Ie($m),h=x.useId();let f=!0,d=x.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;s&&s()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,s]);return r&&f&&(d={...d}),x.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),x.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=q.jsx(Vm,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),q.jsx(Bn.Provider,{value:d,children:t})};function $m(){return new Map}function kc(t=!0){const e=x.useContext(Bn);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=x.useId();x.useEffect(()=>{if(t)return i(r)},[t]);const o=x.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const Ye=t=>t.key||"";function Dr(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const lT=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[l,h]=kc(o),f=x.useMemo(()=>Dr(t),[t]),d=o&&!l?[]:f.map(Ye),p=x.useRef(!0),m=x.useRef(f),g=Ie(()=>new Map),y=x.useRef(new Set),[T,v]=x.useState(f),[w,S]=x.useState(f);wi(()=>{p.current=!1,m.current=f;for(let b=0;b<w.length;b++){const A=Ye(w[b]);d.includes(A)?(g.delete(A),y.current.delete(A)):g.get(A)!==!0&&g.set(A,!1)}},[w,d.length,d.join("-")]);const M=[];if(f!==T){let b=[...f];for(let A=0;A<w.length;A++){const P=w[A],$=Ye(P);d.includes($)||(b.splice(A,0,P),M.push(P))}return r==="wait"&&M.length&&(b=M),S(Dr(b)),v(f),null}const{forceRender:D}=x.useContext(Ti);return q.jsx(q.Fragment,{children:w.map(b=>{const A=Ye(b),P=o&&!l?!1:f===w||d.includes(A),$=()=>{if(y.current.has(A))return;if(y.current.add(A),g.has(A))g.set(A,!0);else return;let E=!0;g.forEach(H=>{H||(E=!1)}),E&&(D?.(),S(m.current),o&&h?.(),s&&s())};return q.jsx(Cm,{isPresent:P,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:P?void 0:$,anchorX:a,anchorY:c,children:b},A)})})},Ic=x.createContext({strict:!1}),Er={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Rr=!1;function Mm(){if(Rr)return;const t={};for(const e in Er)t[e]={isEnabled:n=>Er[e].some(s=>!!n[s])};uc(t),Rr=!0}function Fc(){return Mm(),mp()}function Dm(t){const e=Fc();for(const n in t)e[n]={...e[n],...t[n]};uc(e)}const Em=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function $n(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Em.has(t)}let Bc=t=>!$n(t);function Rm(t){typeof t=="function"&&(Bc=e=>e.startsWith("on")?!$n(e):t(e))}try{Rm(require("@emotion/is-prop-valid").default)}catch{}function Lm(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Bc(i)||n===!0&&$n(i)||!e&&!$n(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const Un=x.createContext({});function km(t,e){if(Nn(t)){const{initial:n,animate:s}=t;return{initial:n===!1||$e(n)?n:void 0,animate:$e(s)?s:void 0}}return t.inherit!==!1?e:{}}function Im(t){const{initial:e,animate:n}=km(t,x.useContext(Un));return x.useMemo(()=>({initial:e,animate:n}),[Lr(e),Lr(n)])}function Lr(t){return Array.isArray(t)?t.join(" "):t}const Xi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Oc(t,e,n){for(const s in e)!Y(e[s])&&!yc(s,n)&&(t[s]=e[s])}function Fm({transformTemplate:t},e){return x.useMemo(()=>{const n=Xi();return zi(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Bm(t,e){const n=t.style||{},s={};return Oc(s,n,t),Object.assign(s,Fm(t,e)),s}function Om(t,e){const n={},s=Bm(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const jc=()=>({...Xi(),attrs:{}});function jm(t,e,n,s){const i=x.useMemo(()=>{const r=jc();return vc(r,e,Tc(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Oc(r,t.style,t),i.style={...r,...i.style}}return i}const Nm=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yi(t){return typeof t!="string"||t.includes("-")?!1:!!(Nm.indexOf(t)>-1||/[A-Z]/u.test(t))}function Um(t,e,n,{latestValues:s},i,r=!1,o){const c=(o??Yi(t)?jm:Om)(e,s,i,t),u=Lm(e,typeof t=="string",r),l=t!==x.Fragment?{...u,...c,ref:n}:{},{children:h}=e,f=x.useMemo(()=>Y(h)?h.get():h,[h]);return x.createElement(t,{...l,children:f})}function Wm({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Km(n,s,i,t),renderState:e()}}function Km(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=un(r[f]);let{initial:o,animate:a}=t;const c=Nn(t),u=lc(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const h=l?a:o;if(h&&typeof h!="boolean"&&!jn(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=Bi(t,f[d]);if(p){const{transitionEnd:m,transition:g,...y}=p;for(const T in y){let v=y[T];if(Array.isArray(v)){const w=l?v.length-1:0;v=v[w]}v!==null&&(i[T]=v)}for(const T in m)i[T]=m[T]}}}return i}const Nc=t=>(e,n)=>{const s=x.useContext(Un),i=x.useContext(Bn),r=()=>Wm(t,e,s,i);return n?r():Ie(r)},Hm=Nc({scrapeMotionValuesFromProps:_i,createRenderState:Xi}),Gm=Nc({scrapeMotionValuesFromProps:wc,createRenderState:jc}),zm=Symbol.for("motionComponentSymbol");function _m(t,e,n){const s=x.useRef(n);x.useInsertionEffect(()=>{s.current=n});const i=x.useRef(null);return x.useCallback(r=>{r&&t.onMount?.(r);const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Uc=x.createContext({});function _t(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Xm(t,e,n,s,i,r){const{visualElement:o}=x.useContext(Un),a=x.useContext(Ic),c=x.useContext(Bn),u=x.useContext(je),l=u.reducedMotion,h=u.skipAnimations,f=x.useRef(null),d=x.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,m=x.useContext(Uc);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Ym(f.current,n,i,m);const g=x.useRef(!1);x.useInsertionEffect(()=>{p&&g.current&&p.update(n,c)});const y=n[ql],T=x.useRef(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return wi(()=>{d.current=!0,p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),T.current&&p.animationState&&p.animationState.animateChanges())}),x.useEffect(()=>{p&&(!T.current&&p.animationState&&p.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),T.current=!1),p.enteringChildren=void 0)}),p}function Ym(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Wc(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&_t(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:l,layoutScroll:c,layoutRoot:u})}function Wc(t){if(t)return t.options.allowProjection!==!1?t.projection:Wc(t.parent)}function os(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Dm(s);const r=n?n==="svg":Yi(t),o=r?Gm:Hm;function a(u,l){let h;const f={...x.useContext(je),...u,layoutId:qm(u)},{isStatic:d}=f,p=Im(u),m=o(u,d);if(!d&&typeof window<"u"){Zm();const g=Jm(f);h=g.MeasureLayout,p.visualElement=Xm(t,m,f,i,g.ProjectionNode,r)}return q.jsxs(Un.Provider,{value:p,children:[h&&p.visualElement?q.jsx(h,{visualElement:p.visualElement,...f}):null,Um(t,u,_m(m,p.visualElement,l),m,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=x.forwardRef(a);return c[zm]=t,c}function qm({layoutId:t}){const e=x.useContext(Ti).id;return e&&t!==void 0?e+"-"+t:t}function Zm(t,e){x.useContext(Ic).strict}function Jm(t){const e=Fc(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Qm(t,e){if(typeof Proxy>"u")return os;const n=new Map,s=(r,o)=>os(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,os(o,void 0,t,e)),n.get(o))})}const tg=(t,e)=>e.isSVG??Yi(t)?new Rp(e):new Vp(e,{allowProjection:t!==x.Fragment});let eg=class extends Rt{constructor(e){super(e),e.animationState||(e.animationState=Bp(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();jn(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?.()}},ng=0,sg=class extends Rt{constructor(){super(...arguments),this.id=ng++}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 ig={animation:{Feature:eg},exit:{Feature:sg}};function Ne(t){return{point:{x:t.pageX,y:t.pageY}}}const og=t=>e=>Wi(e)&&t(e,Ne(e));function Te(t,e,n,s){return Me(t,e,og(n),s)}const Kc=({current:t})=>t?t.ownerDocument.defaultView:null,kr=(t,e)=>Math.abs(t-e);function rg(t,e){const n=kr(t.x,e.x),s=kr(t.y,e.y);return Math.sqrt(n**2+s**2)}const Ir=new Set(["auto","scroll"]);let Hc=class{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=qe(this.lastRawMoveEventInfo,this.transformPagePoint));const d=rs(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=rg(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=d,{timestamp:y}=Z;this.history.push({...g,timestamp:y});const{onStart:T,onMove:v}=this.handlers;p||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=qe(p,this.transformPagePoint),k.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=rs(d.type==="pointercancel"?this.lastMoveEventInfo:qe(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,T),g&&g(d,T)},!Wi(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const c=Ne(e),u=qe(c,this.transformPagePoint),{point:l}=u,{timestamp:h}=Z;this.history=[{...l,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,rs(u,this.history)),this.removeListeners=Fe(Te(this.contextWindow,"pointermove",this.handlePointerMove),Te(this.contextWindow,"pointerup",this.handlePointerUp),Te(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Ir.has(s.overflowX)||Ir.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),k.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),At(this.updatePoint)}};function qe(t,e){return e?{point:e(t.point)}:t}function Fr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function rs({point:t},e){return{point:t,delta:Fr(t,Gc(e)),offset:Fr(t,ag(e)),velocity:lg(e,.1)}}function ag(t){return t[0]}function Gc(t){return t[t.length-1]}function lg(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Gc(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>ot(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>ot(e)*2&&(s=t[1]);const r=at(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function cg(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?B(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?B(n,t,s.max):Math.min(t,n)),t}function Br(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ug(t,{top:e,left:n,bottom:s,right:i}){return{x:Br(t.x,n,i),y:Br(t.y,e,s)}}function Or(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function hg(t,e){return{x:Or(t.x,e.x),y:Or(t.y,e.y)}}function fg(t,e){let n=.5;const s=et(t),i=et(e);return i>s?n=Ve(e.min,e.max-s,t.min):s>i&&(n=Ve(t.min,t.max-i,e.min)),Pt(0,1,n)}function dg(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Xs=.35;function pg(t=Xs){return t===!1?t=0:t===!0&&(t=Xs),{x:jr(t,"left","right"),y:jr(t,"top","bottom")}}function jr(t,e,n){return{min:Nr(t,e),max:Nr(t,n)}}function Nr(t,e){return typeof t=="number"?t:t[e]||0}const mg=new WeakMap;let gg=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=z(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(Ne(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Kd(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),yt(y=>{let T=this.getAxisMotionValue(y).get()||0;if(Tt.test(T)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[y];w&&(T=et(w)*(parseFloat(T)/100))}}this.originPoint[y]=T}),m&&k.update(()=>m(h,f),!1,!0),Ns(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=vg(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&k.update(()=>g(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Hc(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Kc(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&k.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Ze(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=cg(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&_t(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=ug(s.layoutBox,e):this.constraints=!1,this.elastic=pg(n),i!==this.constraints&&!_t(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&yt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=dg(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!_t(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=Tp(s,i.root,this.visualElement.getTransformPagePoint());let o=hg(i.layout.layoutBox,r);if(n){const a=n(yp(o));this.hasMutatedConstraints=!!a,a&&(o=fc(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=yt(l=>{if(!Ze(l,n,this.currentDirection))return;let h=c&&c[l]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[l]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(l,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Ns(this.visualElement,e),s.start(Fi(e,s,0,n,this.visualElement,!1))}stopAnimation(){yt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){yt(n=>{const{drag:s}=this.getProps();if(!Ze(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],c=r.get()||0;r.set(e[n]-B(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!_t(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};yt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=fg({min:c,max:c},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),yt(o=>{if(!Ze(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(B(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;mg.set(this.visualElement,this);const e=this.visualElement.current,n=Te(e,"pointerdown",u=>{const{drag:l,dragListener:h=!0}=this.getProps(),f=u.target,d=f!==e&&Yd(f);l&&h&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();_t(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=yg(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),k.read(i);const a=Me(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(yt(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),c&&c(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=Xs,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}};function Ur(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function yg(t,e,n){const s=Go(t,Ur(n)),i=Go(e,Ur(n));return()=>{s(),i()}}function Ze(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function vg(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}let xg=class extends Rt{constructor(e){super(e),this.removeGroupControls=ct,this.removeListeners=ct,this.controls=new gg(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ct}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const as=t=>(e,n)=>{t&&k.update(()=>t(e,n),!1,!0)};let Tg=class extends Rt{constructor(){super(...arguments),this.removePointerDownListener=ct}onPointerDown(e){this.session=new Hc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Kc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:as(e),onStart:as(n),onMove:as(s),onEnd:(r,o)=>{delete this.session,i&&k.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Te(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},ls=!1,wg=class extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),ls&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),hn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),ls=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||k.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ui.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;ls=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}};function zc(t){const[e,n]=kc(),s=x.useContext(Ti);return q.jsx(wg,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(Uc),isPresent:e,safeToRemove:n})}const Pg={pan:{Feature:Tg},drag:{Feature:xg,ProjectionNode:Lc,MeasureLayout:zc}};function Wr(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&&k.postRender(()=>r(e,Ne(e)))}let Sg=class extends Rt{mount(){const{current:e}=this.node;e&&(this.unmount=Gd(e,(n,s)=>(Wr(this.node,s,"Start"),i=>Wr(this.node,i,"End"))))}unmount(){}},bg=class extends Rt{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=Fe(Me(this.node.current,"focus",()=>this.onFocus()),Me(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function Kr(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&&k.postRender(()=>r(e,Ne(e)))}let Ag=class extends Rt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Zd(e,(i,r)=>(Kr(this.node,r,"Start"),(o,{success:a})=>Kr(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}};const Ys=new WeakMap,cs=new WeakMap,Vg=t=>{const e=Ys.get(t.target);e&&e(t)},Cg=t=>{t.forEach(Vg)};function $g({root:t,...e}){const n=t||document;cs.has(n)||cs.set(n,{});const s=cs.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Cg,{root:t,...e})),s[i]}function Mg(t,e,n){const s=$g(e);return Ys.set(t,n),s.observe(t),()=>{Ys.delete(t),s.unobserve(t)}}const Dg={some:0,all:1};let Eg=class extends Rt{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,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Dg[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:l,onViewportLeave:h}=this.node.getProps(),f=u?l:h;f&&f(c)};return Mg(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Rg(e,n))&&this.startObserver()}unmount(){}};function Rg({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Lg={inView:{Feature:Eg},tap:{Feature:Ag},focus:{Feature:bg},hover:{Feature:Sg}},kg={layout:{ProjectionNode:Lc,MeasureLayout:zc}},Ig={...ig,...Lg,...Pg,...kg},TT=Qm(Ig,tg);function _c(t){const e=Ie(()=>Gt(t)),{isStatic:n}=x.useContext(je);if(n){const[,s]=x.useState(t);x.useEffect(()=>e.on("change",s),[])}return e}function Xc(t,e){const n=_c(e()),s=()=>n.set(e());return s(),wi(()=>{const i=()=>k.preRender(s,!1,!0),r=t.map(o=>o.on("change",i));return()=>{r.forEach(o=>o()),At(s)}}),n}function Fg(t){ve.current=[],t();const e=Xc(ve.current,t);return ve.current=void 0,e}function Bg(t,e,n,s){if(typeof t=="function")return Fg(t);const r=typeof e=="function"?e:ap(e,n,s),o=Array.isArray(t)?Hr(t,r):Hr([t],([c])=>r(c)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&s?.clamp!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function Hr(t,e){const n=Ie(()=>[]);return Xc(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}function Og(t,e={}){const{isStatic:n}=x.useContext(je),s=()=>Y(t)?t.get():t;if(n)return Bg(s);const i=_c(s());return x.useInsertionEffect(()=>lp(i,t,e),[i,JSON.stringify(e)]),i}function wT(t,e={}){return Og(t,{type:"spring",...e})}const jg={some:0,all:1};function Ng(t,e,{root:n,margin:s,amount:i="some"}={}){const r=Ni(t),o=new WeakMap,a=u=>{u.forEach(l=>{const h=o.get(l.target);if(l.isIntersecting!==!!h)if(l.isIntersecting){const f=e(l.target,l);typeof f=="function"?o.set(l.target,f):c.unobserve(l.target)}else typeof h=="function"&&(h(l),o.delete(l.target))})},c=new IntersectionObserver(a,{root:n,rootMargin:s,threshold:typeof i=="number"?i:jg[i]});return r.forEach(u=>c.observe(u)),()=>c.disconnect()}function PT(t,{root:e,margin:n,amount:s,once:i=!1,initial:r=!1}={}){const[o,a]=x.useState(r);return x.useEffect(()=>{if(!t.current||i&&o)return;const c=()=>(a(!0),i?void 0:()=>a(!1)),u={root:e&&e.current||void 0,margin:n,amount:s};return Ng(t.current,c,u)},[e,t,n,i,s]),o}const qi=x.createContext({});function Ue(t){const e=x.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ug=typeof window<"u",Zi=Ug?x.useLayoutEffect:x.useEffect,Wn=x.createContext(null);function Ji(t,e){t.indexOf(e)===-1&&t.push(e)}function Mn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const St=(t,e,n)=>n>e?e:n<t?t:n;let Qi=()=>{};const Et={},Yc=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function qc(t){return typeof t=="object"&&t!==null}const Zc=t=>/^0[^.\s]+$/u.test(t);function Jc(t){let e;return()=>(e===void 0&&(e=t()),e)}const ut=t=>t,Wg=(t,e)=>n=>e(t(n)),We=(...t)=>t.reduce(Wg),De=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class to{constructor(){this.subscriptions=[]}add(e){return Ji(this.subscriptions,e),()=>Mn(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 o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rt=t=>t*1e3,lt=t=>t/1e3;function Qc(t,e){return e?t*(1e3/e):0}const tu=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Kg=1e-7,Hg=12;function Gg(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=tu(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Kg&&++a<Hg);return o}function Ke(t,e,n,s){if(t===e&&n===s)return ut;const i=r=>Gg(r,0,1,t,n);return r=>r===0||r===1?r:tu(i(r),e,s)}const eu=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,nu=t=>e=>1-t(1-e),su=Ke(.33,1.53,.69,.99),eo=nu(su),iu=eu(eo),ou=t=>t>=1?1:(t*=2)<1?.5*eo(t):.5*(2-Math.pow(2,-10*(t-1))),no=t=>1-Math.sin(Math.acos(t)),ru=nu(no),au=eu(no),zg=Ke(.42,0,1,1),_g=Ke(0,0,.58,1),lu=Ke(.42,0,.58,1),Xg=t=>Array.isArray(t)&&typeof t[0]!="number",cu=t=>Array.isArray(t)&&typeof t[0]=="number",Yg={linear:ut,easeIn:zg,easeInOut:lu,easeOut:_g,circIn:no,circInOut:au,circOut:ru,backIn:eo,backInOut:iu,backOut:su,anticipate:ou},qg=t=>typeof t=="string",Gr=t=>{if(cu(t)){Qi(t.length===4);const[e,n,s,i]=t;return Ke(e,n,s,i)}else if(qg(t))return Yg[t];return t},Je=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Zg(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(l){o.has(l)&&(u.schedule(l),t()),l(a)}const u={schedule:(l,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&o.add(l),p.add(l),l},cancel:l=>{s.delete(l),o.delete(l)},process:l=>{if(a=l,i){r=!0;return}i=!0;const h=n;n=s,s=h,n.forEach(c),n.clear(),i=!1,r&&(r=!1,u.process(l))}};return u}const Jg=40;function uu(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Je.reduce((v,w)=>(v[w]=Zg(r),v),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:h,preRender:f,render:d,postRender:p}=o,m=()=>{const v=Et.useManualTiming,w=v?i.timestamp:performance.now();n=!1,v||(i.delta=s?1e3/60:Math.max(Math.min(w-i.timestamp,Jg),1)),i.timestamp=w,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),h.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(m))},g=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Je.reduce((v,w)=>{const S=o[w];return v[w]=(M,D=!1,b=!1)=>(n||g(),S.schedule(M,D,b)),v},{}),cancel:v=>{for(let w=0;w<Je.length;w++)o[Je[w]].cancel(v)},state:i,steps:o}}const{schedule:L,cancel:Vt,state:J,steps:us}=uu(typeof requestAnimationFrame<"u"?requestAnimationFrame:ut,!0);let fn;function Qg(){fn=void 0}const nt={now:()=>(fn===void 0&&nt.set(J.isProcessing||Et.useManualTiming?J.timestamp:performance.now()),fn),set:t=>{fn=t,queueMicrotask(Qg)}},hu=t=>e=>typeof e=="string"&&e.startsWith(t),fu=hu("--"),ty=hu("var(--"),so=t=>ty(t)?ey.test(t.split("/*")[0].trim()):!1,ey=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function zr(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const ce={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ee={...ce,transform:t=>St(0,1,t)},Qe={...ce,default:1},we=t=>Math.round(t*1e5)/1e5,io=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function ny(t){return t==null}const sy=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,oo=(t,e)=>n=>!!(typeof n=="string"&&sy.test(n)&&n.startsWith(t)||e&&!ny(n)&&Object.prototype.hasOwnProperty.call(n,e)),du=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(io);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},iy=t=>St(0,255,t),hs={...ce,transform:t=>Math.round(iy(t))},Nt={test:oo("rgb","red"),parse:du("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+hs.transform(t)+", "+hs.transform(e)+", "+hs.transform(n)+", "+we(Ee.transform(s))+")"};function oy(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const qs={test:oo("#"),parse:oy,transform:Nt.transform},He=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),$t=He("deg"),wt=He("%"),C=He("px"),ry=He("vh"),ay=He("vw"),_r={...wt,parse:t=>wt.parse(t)/100,transform:t=>wt.transform(t*100)},te={test:oo("hsl","hue"),parse:du("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+wt.transform(we(e))+", "+wt.transform(we(n))+", "+we(Ee.transform(s))+")"},K={test:t=>Nt.test(t)||qs.test(t)||te.test(t),parse:t=>Nt.test(t)?Nt.parse(t):te.test(t)?te.parse(t):qs.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Nt.transform(t):te.transform(t),getAnimatableNone:t=>{const e=K.parse(t);return e.alpha=0,K.transform(e)}},ly=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function cy(t){return isNaN(t)&&typeof t=="string"&&(t.match(io)?.length||0)+(t.match(ly)?.length||0)>0}const pu="number",mu="color",uy="var",hy="var(",Xr="${}",fy=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function oe(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(fy,c=>(K.test(c)?(s.color.push(r),i.push(mu),n.push(K.parse(c))):c.startsWith(hy)?(s.var.push(r),i.push(uy),n.push(c)):(s.number.push(r),i.push(pu),n.push(parseFloat(c))),++r,Xr)).split(Xr);return{values:n,split:a,indexes:s,types:i}}function dy(t){return oe(t).values}function gu({split:t,types:e}){const n=t.length;return s=>{let i="";for(let r=0;r<n;r++)if(i+=t[r],s[r]!==void 0){const o=e[r];o===pu?i+=we(s[r]):o===mu?i+=K.transform(s[r]):i+=s[r]}return i}}function py(t){return gu(oe(t))}const my=t=>typeof t=="number"?0:K.test(t)?K.getAnimatableNone(t):t,gy=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:my(t);function yy(t){const e=oe(t);return gu(e)(e.values.map((s,i)=>gy(s,e.split[i])))}const gt={test:cy,parse:dy,createTransformer:py,getAnimatableNone:yy};function fs(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 vy({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=fs(c,a,t+1/3),r=fs(c,a,t),o=fs(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Dn(t,e){return n=>n>0?e:t}const F=(t,e,n)=>t+(e-t)*n,ds=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},xy=[qs,Nt,te],Ty=t=>xy.find(e=>e.test(t));function Yr(t){const e=Ty(t);if(!e)return!1;let n=e.parse(t);return e===te&&(n=vy(n)),n}const qr=(t,e)=>{const n=Yr(t),s=Yr(e);if(!n||!s)return Dn(t,e);const i={...n};return r=>(i.red=ds(n.red,s.red,r),i.green=ds(n.green,s.green,r),i.blue=ds(n.blue,s.blue,r),i.alpha=F(n.alpha,s.alpha,r),Nt.transform(i))},Zs=new Set(["none","hidden"]);function wy(t,e){return Zs.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Py(t,e){return n=>F(t,e,n)}function ro(t){return typeof t=="number"?Py:typeof t=="string"?so(t)?Dn:K.test(t)?qr:Ay:Array.isArray(t)?yu:typeof t=="object"?K.test(t)?qr:Sy:Dn}function yu(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>ro(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Sy(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=ro(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function by(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],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const Ay=(t,e)=>{const n=gt.createTransformer(e),s=oe(t),i=oe(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?Zs.has(t)&&!i.values.length||Zs.has(e)&&!s.values.length?wy(t,e):We(yu(by(s,i),i.values),n):Dn(t,e)};function vu(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?F(t,e,n):ro(t)(t,e)}const Vy=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>L.update(e,n),stop:()=>Vt(e),now:()=>J.isProcessing?J.timestamp:nt.now()}},xu=(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)})`},En=2e4;function ao(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<En;)e+=n,s=t.next(e);return e>=En?1/0:e}function Cy(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ao(s),En);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:lt(i)}}const j={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};function Js(t,e){return t*Math.sqrt(1-e*e)}const $y=12;function My(t,e,n){let s=n;for(let i=1;i<$y;i++)s=s-t(s)/e(s);return s}const ps=.001;function Dy({duration:t=j.duration,bounce:e=j.bounce,velocity:n=j.velocity,mass:s=j.mass}){let i,r,o=1-e;o=St(j.minDamping,j.maxDamping,o),t=St(j.minDuration,j.maxDuration,lt(t)),o<1?(i=u=>{const l=u*o,h=l*t,f=l-n,d=Js(u,o),p=Math.exp(-h);return ps-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=Js(Math.pow(u,2),o);return(-i(u)+ps>0?-1:1)*((f-d)*p)/m}):(i=u=>{const l=Math.exp(-u*t),h=(u-n)*t+1;return-ps+l*h},r=u=>{const l=Math.exp(-u*t),h=(n-u)*(t*t);return l*h});const a=5/t,c=My(i,r,a);if(t=rt(t),isNaN(c))return{stiffness:j.stiffness,damping:j.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Ey=["duration","bounce"],Ry=["stiffness","damping","mass"];function Zr(t,e){return e.some(n=>t[n]!==void 0)}function Ly(t){let e={velocity:j.velocity,stiffness:j.stiffness,damping:j.damping,mass:j.mass,isResolvedFromDuration:!1,...t};if(!Zr(t,Ry)&&Zr(t,Ey))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*St(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:j.mass,stiffness:i,damping:r}}else{const n=Dy({...t,velocity:0});e={...e,...n,mass:j.mass},e.isResolvedFromDuration=!0}return e}function Rn(t=j.visualDuration,e=j.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],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:c,damping:u,mass:l,duration:h,velocity:f,isResolvedFromDuration:d}=Ly({...n,velocity:-lt(n.velocity||0)}),p=f||0,m=u/(2*Math.sqrt(c*l)),g=o-r,y=lt(Math.sqrt(c/l)),T=Math.abs(g)<5;s||(s=T?j.restSpeed.granular:j.restSpeed.default),i||(i=T?j.restDelta.granular:j.restDelta.default);let v,w,S,M,D,b;if(m<1)S=Js(y,m),M=(p+m*y*g)/S,v=P=>{const $=Math.exp(-m*y*P);return o-$*(M*Math.sin(S*P)+g*Math.cos(S*P))},D=m*y*M+g*S,b=m*y*g-M*S,w=P=>Math.exp(-m*y*P)*(D*Math.sin(S*P)+b*Math.cos(S*P));else if(m===1){v=$=>o-Math.exp(-y*$)*(g+(p+y*g)*$);const P=p+y*g;w=$=>Math.exp(-y*$)*(y*P*$-p)}else{const P=y*Math.sqrt(m*m-1);v=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return o-G*((p+m*y*g)*Math.sinh(U)+P*g*Math.cosh(U))/P};const $=(p+m*y*g)/P,E=m*y*$-g*P,H=m*y*g-$*P;w=N=>{const G=Math.exp(-m*y*N),U=Math.min(P*N,300);return G*(E*Math.sinh(U)+H*Math.cosh(U))}}const A={calculatedDuration:d&&h||null,velocity:P=>rt(w(P)),next:P=>{if(!d&&m<1){const E=Math.exp(-m*y*P),H=Math.sin(S*P),N=Math.cos(S*P),G=o-E*(M*H+g*N),U=rt(E*(D*H+b*N));return a.done=Math.abs(U)<=s&&Math.abs(o-G)<=i,a.value=a.done?o:G,a}const $=v(P);if(d)a.done=P>=h;else{const E=rt(w(P));a.done=Math.abs(E)<=s&&Math.abs(o-$)<=i}return a.value=a.done?o:$,a},toString:()=>{const P=Math.min(ao(A),En),$=xu(E=>A.next(P*E).value,P,30);return P+"ms "+$},toTransition:()=>{}};return A}Rn.applyToOptions=t=>{const e=Cy(t,100,Rn);return t.ease=e.ease,t.duration=rt(e.duration),t.type="keyframes",t};const ky=5;function Tu(t,e,n){const s=Math.max(e-ky,0);return Qc(n-t(s),e-s)}function Qs({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&b<a||c!==void 0&&b>c,p=b=>a===void 0?c:c===void 0||Math.abs(a-b)<Math.abs(c-b)?a:c;let m=n*e;const g=h+m,y=o===void 0?g:o(g);y!==g&&(m=y-h);const T=b=>-m*Math.exp(-b/s),v=b=>y+T(b),w=b=>{const A=T(b),P=v(b);f.done=Math.abs(A)<=u,f.value=f.done?y:P};let S,M;const D=b=>{d(f.value)&&(S=b,M=Rn({keyframes:[f.value,p(f.value)],velocity:Tu(v,b,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return D(0),{calculatedDuration:null,next:b=>{let A=!1;return!M&&S===void 0&&(A=!0,w(b),D(b)),S!==void 0&&b>=S?M.next(b-S):(!A&&w(b),f)}}}function Iy(t,e,n){const s=[],i=n||Et.mix||vu,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||ut:e;a=We(c,a)}s.push(a)}return s}function wu(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(Qi(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Iy(e,s,i),c=a.length,u=l=>{if(o&&l<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(l<t[h+1]);h++);const f=De(t[h],t[h+1],l);return a[h](f)};return n?l=>u(St(t[0],t[r-1],l)):u}function Fy(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=De(0,e,s);t.push(F(n,1,i))}}function By(t){const e=[0];return Fy(e,t.length-1),e}function Oy(t,e){return t.map(n=>n*e)}function jy(t,e){return t.map(()=>e||lu).splice(0,t.length-1)}function Pe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Xg(s)?s.map(Gr):Gr(s),r={done:!1,value:e[0]},o=Oy(n&&n.length===e.length?n:By(e),t),a=wu(o,e,{ease:Array.isArray(i)?i:jy(e,i)});return{calculatedDuration:t,next:c=>(r.value=a(c),r.done=c>=t,r)}}const Ny=t=>t!==null;function Kn(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ny),a=i<0||e&&n!=="loop"&&e%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Uy={decay:Qs,inertia:Qs,tween:Pe,keyframes:Pe,spring:Rn};function Pu(t){typeof t.type=="string"&&(t.type=Uy[t.type])}class lo{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 Wy=t=>t/100;class Re extends lo{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==nt.now()&&this.tick(nt.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;Pu(e);const{type:n=Pe,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=e;let{keyframes:a}=e;const c=n||Pe;c!==Pe&&typeof a[0]!="number"&&(this.mixKeyframes=We(Wy,vu(a[0],a[1])),a=[0,100]);const u=c({...e,keyframes:a});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ao(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}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:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:l,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:g}=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 y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=s;if(h){const b=Math.min(this.currentTime,i)/a;let A=Math.floor(b),P=b%1;!P&&b>=1&&(P=1),P===1&&A--,A=Math.min(A,h+1),A%2&&(f==="reverse"?(P=1-P,d&&(P-=d/a)):f==="mirror"&&(w=o)),v=St(0,1,P)*a}let S;T?(this.delayState.value=l[0],S=this.delayState):S=w.next(v),r&&!T&&(S.value=r(S.value));let{done:M}=S;!T&&c!==null&&(M=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return D&&p!==Qs&&(S.value=Kn(l,this.options,g,this.speed)),m&&m(S.value),D&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return lt(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+lt(e)}get time(){return lt(this.currentTime)}set time(e){e=rt(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?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return Tu(s=>this.generator.next(s).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(nt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=lt(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Vy,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(nt.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 Ky(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Ut=t=>t*180/Math.PI,ti=t=>{const e=Ut(Math.atan2(t[1],t[0]));return ei(e)},Hy={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ti,rotateZ:ti,skewX:t=>Ut(Math.atan(t[1])),skewY:t=>Ut(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ei=t=>(t=t%360,t<0&&(t+=360),t),Jr=ti,Qr=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ta=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Gy={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qr,scaleY:ta,scale:t=>(Qr(t)+ta(t))/2,rotateX:t=>ei(Ut(Math.atan2(t[6],t[5]))),rotateY:t=>ei(Ut(Math.atan2(-t[2],t[0]))),rotateZ:Jr,rotate:Jr,skewX:t=>Ut(Math.atan(t[4])),skewY:t=>Ut(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ni(t){return t.includes("scale")?1:0}function si(t,e){if(!t||t==="none")return ni(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Gy,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Hy,i=a}if(!i)return ni(e);const r=s[e],o=i[1].split(",").map(_y);return typeof r=="function"?r(o):o[r]}const zy=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return si(n,e)};function _y(t){return parseFloat(t.trim())}const ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],he=new Set(ue),ea=t=>t===ce||t===C,Xy=new Set(["x","y","z"]),Yy=ue.filter(t=>!Xy.has(t));function qy(t){const e=[];return Yy.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Dt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:s})=>{const i=t.max-t.min;return s==="border-box"?i:i-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})=>si(e,"x"),y:(t,{transform:e})=>si(e,"y")};Dt.translateX=Dt.x;Dt.translateY=Dt.y;const Kt=new Set;let ii=!1,oi=!1,ri=!1;function Su(){if(oi){const t=Array.from(Kt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=qy(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,o])=>{s.getValue(r)?.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}oi=!1,ii=!1,Kt.forEach(t=>t.complete(ri)),Kt.clear()}function bu(){Kt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(oi=!0)})}function Zy(){ri=!0,bu(),Su(),ri=!1}class co{constructor(e,n,s,i,r,o=!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=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Kt.add(this),ii||(ii=!0,L.read(bu),L.resolveKeyframes(Su))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const r=i?.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),i&&r===void 0&&i.set(e[0])}Ky(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Kt.delete(this)}cancel(){this.state==="scheduled"&&(Kt.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Jy=t=>t.startsWith("--");function Au(t,e,n){Jy(e)?t.style.setProperty(e,n):t.style[e]=n}const Qy={};function Vu(t,e){const n=Jc(t);return()=>Qy[e]??n()}const tv=Vu(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Cu=Vu(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),me=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,na={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:me([0,.65,.55,1]),circOut:me([.55,0,1,.45]),backIn:me([.31,.01,.66,-.59]),backOut:me([.33,1.53,.69,.99])};function $u(t,e){if(t)return typeof t=="function"?Cu()?xu(t,e):"ease-out":cu(t)?me(t):Array.isArray(t)?t.map(n=>$u(n,e)||na.easeOut):na[t]}function ev(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){const l={[e]:n};c&&(l.offset=c);const h=$u(a,i);Array.isArray(h)&&(l.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(l,f)}function Mu(t){return typeof t=="function"&&"applyToOptions"in t}function nv({type:t,...e}){return Mu(t)&&Cu()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Du extends lo{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:o=!1,finalKeyframe:a,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,Qi(typeof e.type!="string");const u=nv(e);this.animation=ev(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const l=Kn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Au(n,s,l),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(){const e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return lt(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+lt(e)}get time(){return lt(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=rt(e),n&&this.animation.pause()}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,rangeStart:n,rangeEnd:s,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&tv()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),ut):i(this)}}const Eu={anticipate:ou,backInOut:iu,circInOut:au};function sv(t){return t in Eu}function iv(t){typeof t.ease=="string"&&sv(t.ease)&&(t.ease=Eu[t.ease])}const ms=10;class ov extends Du{constructor(e){iv(e),Pu(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new Re({...o,autoplay:!1}),c=Math.max(ms,nt.now()-this.startTime),u=St(0,ms,c-ms),l=a.sample(c).value,{name:h}=this.options;r&&h&&Au(r,h,l),n.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}}const sa=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gt.test(t)||t==="0")&&!t.startsWith("url("));function rv(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 av(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],o=sa(i,e),a=sa(r,e);return!o||!a?!1:rv(t)||(n==="spring"||Mu(n))&&s}function ai(t){t.duration=0,t.type="keyframes"}const Ru=new Set(["opacity","clipPath","filter","transform"]),lv=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function cv(t){for(let e=0;e<t.length;e++)if(typeof t[e]=="string"&&lv.test(t[e]))return!0;return!1}const uv=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),hv=Jc(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function fv(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o,keyframes:a}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return hv()&&n&&(Ru.has(n)||uv.has(n)&&cv(a))&&(n!=="transform"||!l)&&!u&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const dv=40;class pv extends lo{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=nt.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:l,...h},d=l?.KeyframeResolver||co;this.keyframeResolver=new d(a,(p,m,g)=>this.onKeyframesResolved(p,m,f,!g),c,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=s;this.resolvedAt=nt.now();let h=!0;av(e,r,o,a)||(h=!1,(Et.instantAnimations||!c)&&l?.(Kn(e,s,n)),e[0]=e[e.length-1],ai(s),s.repeat=0);const d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>dv?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},p=h&&!u&&fv(d),m=d.motionValue?.owner?.current;let g;if(p)try{g=new ov({...d,element:m})}catch{g=new Re(d)}else g=new Re(d);g.finished.then(()=>{this.notifyFinished()}).catch(ut),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}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(),Zy()),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()}}function Lu(t,e,n,s=0,i=1){const r=Array.from(t).sort((u,l)=>u.sortNodePosition(l)).indexOf(e),o=t.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const mv=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function gv(t){const e=mv.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ku(t,e,n=1){const[s,i]=gv(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Yc(o)?parseFloat(o):o}return so(i)?ku(i,e,n+1):i}const yv={type:"spring",stiffness:500,damping:25,restSpeed:10},vv=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),xv={type:"keyframes",duration:.8},Tv={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wv=(t,{keyframes:e})=>e.length>2?xv:he.has(t)?t.startsWith("scale")?vv(e[1]):yv:Tv;function Iu(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function uo(t,e){const n=t?.[e]??t?.default??t;return n!==t?Iu(n,t):n}const Pv=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Sv(t){for(const e in t)if(!Pv.has(e))return!0;return!1}const ho=(t,e,n,s={},i,r)=>o=>{const a=uo(s,t)||{},c=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-rt(c);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};Sv(a)||Object.assign(l,wv(t,l)),l.duration&&(l.duration=rt(l.duration)),l.repeatDelay&&(l.repeatDelay=rt(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let h=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(ai(l),l.delay===0&&(h=!0)),(Et.instantAnimations||Et.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,ai(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const f=Kn(l.keyframes,a);if(f!==void 0){L.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new Re(l):new pv(l)};function ia(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function fo(t,e,n,s){if(typeof e=="function"){const[i,r]=ia(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=ia(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Ht(t,e,n){const s=t.getProps();return fo(s,e,n!==void 0?n:s.custom,t)}const Fu=new Set(["width","height","top","left","right","bottom",...ue]),oa=30,bv=t=>!isNaN(parseFloat(t)),Se={current:void 0};class Av{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=nt.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=nt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bv(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 to);const s=this.events[e].add(n);return e==="change"?()=>{s(),L.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 Se.current&&Se.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=nt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>oa)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,oa);return Qc(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 zt(t,e){return new Av(t,e)}const li=t=>Array.isArray(t);function Vv(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,zt(n))}function Cv(t){return li(t)?t[t.length-1]||0:t}function $v(t,e){const n=Ht(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Cv(r[o]);Vv(t,o,a)}}const X=t=>!!(t&&t.getVelocity);function Mv(t){return!!(X(t)&&t.add)}function ci(t,e){const n=t.getValue("willChange");if(Mv(n))return n.add(e);if(!n&&Et.WillChange){const s=new Et.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function po(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Dv="framerAppearId",Bu="data-"+po(Dv);function Ou(t){return t.props[Bu]}function Ev({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ju(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=e;const c=t.getDefaultTransition();r=r?Iu(r,c):c;const u=r?.reduceMotion;s&&(r=s);const l=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in a){const d=t.getValue(f,t.latestValues[f]??null),p=a[f];if(p===void 0||h&&Ev(h,f))continue;const m={delay:n,...uo(r||{},f)},g=d.get();if(g!==void 0&&!d.isAnimating()&&!Array.isArray(p)&&p===g&&!m.velocity){L.update(()=>d.set(p));continue}let y=!1;if(window.MotionHandoffAnimation){const w=Ou(t);if(w){const S=window.MotionHandoffAnimation(w,f,L);S!==null&&(m.startTime=S,y=!0)}}ci(t,f);const T=u??t.shouldReduceMotion;d.start(ho(f,d,p,T&&Fu.has(f)?{type:!1}:m,t,y));const v=d.animation;v&&l.push(v)}if(o){const f=()=>L.update(()=>{o&&$v(t,o)});l.length?Promise.all(l).then(f):f()}return l}function ui(t,e,n={}){const s=Ht(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(ju(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:l,staggerDirection:h}=i;return Rv(t,e,c,u,l,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[r,o]:[o,r];return c().then(()=>u())}else return Promise.all([r(),o(n.delay)])}function Rv(t,e,n=0,s=0,i=0,r=1,o){const a=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),a.push(ui(c,e,{...o,delay:n+(typeof s=="function"?0:s)+Lu(t.variantChildren,c,s,i,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(a)}function Lv(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>ui(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=ui(t,e,n);else{const i=typeof e=="function"?Ht(t,e,n.custom):e;s=Promise.all(ju(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const kv={test:t=>t==="auto",parse:t=>t},Nu=t=>e=>e.test(t),Uu=[ce,C,wt,$t,ay,ry,kv],ra=t=>Uu.find(Nu(t));function Iv(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Zc(t):!0}const Fv=new Set(["brightness","contrast","saturate","opacity"]);function Bv(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(io)||[];if(!s)return t;const i=n.replace(s,"");let r=Fv.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Ov=/\b([a-z-]*)\(.*?\)/gu,hi={...gt,getAnimatableNone:t=>{const e=t.match(Ov);return e?e.map(Bv).join(" "):t}},fi={...gt,getAnimatableNone:t=>{const e=gt.parse(t);return gt.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},aa={...ce,transform:Math.round},jv={rotate:$t,rotateX:$t,rotateY:$t,rotateZ:$t,scale:Qe,scaleX:Qe,scaleY:Qe,scaleZ:Qe,skew:$t,skewX:$t,skewY:$t,distance:C,translateX:C,translateY:C,translateZ:C,x:C,y:C,z:C,perspective:C,transformPerspective:C,opacity:Ee,originX:_r,originY:_r,originZ:C},mo={borderWidth:C,borderTopWidth:C,borderRightWidth:C,borderBottomWidth:C,borderLeftWidth:C,borderRadius:C,borderTopLeftRadius:C,borderTopRightRadius:C,borderBottomRightRadius:C,borderBottomLeftRadius:C,width:C,maxWidth:C,height:C,maxHeight:C,top:C,right:C,bottom:C,left:C,inset:C,insetBlock:C,insetBlockStart:C,insetBlockEnd:C,insetInline:C,insetInlineStart:C,insetInlineEnd:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockStart:C,paddingBlockEnd:C,paddingInline:C,paddingInlineStart:C,paddingInlineEnd:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockStart:C,marginBlockEnd:C,marginInline:C,marginInlineStart:C,marginInlineEnd:C,fontSize:C,backgroundPositionX:C,backgroundPositionY:C,...jv,zIndex:aa,fillOpacity:Ee,strokeOpacity:Ee,numOctaves:aa},Nv={...mo,color:K,backgroundColor:K,outlineColor:K,fill:K,stroke:K,borderColor:K,borderTopColor:K,borderRightColor:K,borderBottomColor:K,borderLeftColor:K,filter:hi,WebkitFilter:hi,mask:fi,WebkitMask:fi},Wu=t=>Nv[t],Uv=new Set([hi,fi]);function Ku(t,e){let n=Wu(t);return Uv.has(n)||(n=gt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Wv=new Set(["auto","none","0"]);function Kv(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Wv.has(r)&&oe(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=Ku(n,i)}class Hv extends co{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 l=0;l<e.length;l++){let h=e[l];if(typeof h=="string"&&(h=h.trim(),so(h))){const f=ku(h,n.current);f!==void 0&&(e[l]=f),l===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Fu.has(s)||e.length!==2)return;const[i,r]=e,o=ra(i),a=ra(r),c=zr(i),u=zr(r);if(c!==u&&Dt[s]){this.needsMeasurement=!0;return}if(o!==a)if(ea(o)&&ea(a))for(let l=0;l<e.length;l++){const h=e[l];typeof h=="string"&&(e[l]=parseFloat(h))}else Dt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||Iv(e[i]))&&s.push(i);s.length&&Kv(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=Dt[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,o=s[r];s[r]=Dt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{e.getValue(a).set(c)}),this.resolveNoneKeyframes()}}function Hu(t,e,n){if(t==null)return[];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).filter(s=>s!=null)}const Gu=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function dn(t){return qc(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:go}=uu(queueMicrotask,!1),pt={x:!1,y:!1};function zu(){return pt.x||pt.y}function Gv(t){return t==="x"||t==="y"?pt[t]?null:(pt[t]=!0,()=>{pt[t]=!1}):pt.x||pt.y?null:(pt.x=pt.y=!0,()=>{pt.x=pt.y=!1})}function _u(t,e){const n=Hu(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function zv(t){return!(t.pointerType==="touch"||zu())}function _v(t,e,n={}){const[s,i,r]=_u(t,n);return s.forEach(o=>{let a=!1,c=!1,u;const l=()=>{o.removeEventListener("pointerleave",p)},h=g=>{u&&(u(g),u=void 0),l()},f=g=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),c&&(c=!1,h(g))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=g=>{if(g.pointerType!=="touch"){if(a){c=!0;return}h(g)}},m=g=>{if(!zv(g))return;c=!1;const y=e(o,g);typeof y=="function"&&(u=y,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",m,i),o.addEventListener("pointerdown",d,i)}),r}const Xu=(t,e)=>e?t===e?!0:Xu(t,e.parentElement):!1,yo=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Xv=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Yv(t){return Xv.has(t.tagName)||t.isContentEditable===!0}const qv=new Set(["INPUT","SELECT","TEXTAREA"]);function Zv(t){return qv.has(t.tagName)||t.isContentEditable===!0}const pn=new WeakSet;function la(t){return e=>{e.key==="Enter"&&t(e)}}function gs(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Jv=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=la(()=>{if(pn.has(n))return;gs(n,"down");const i=la(()=>{gs(n,"up")}),r=()=>gs(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 ca(t){return yo(t)&&!zu()}const ua=new WeakSet;function Qv(t,e,n={}){const[s,i,r]=_u(t,n),o=a=>{const c=a.currentTarget;if(!ca(a)||ua.has(a))return;pn.add(c),n.stopPropagation&&ua.add(a);const u=e(c,a),l=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),pn.has(c)&&pn.delete(c),ca(d)&&typeof u=="function"&&u(d,{success:p})},h=d=>{l(d,c===window||c===document||n.useGlobalTarget||Xu(c,d.target))},f=d=>{l(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),dn(a)&&(a.addEventListener("focus",u=>Jv(u,i)),!Yv(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}function vo(t){return qc(t)&&"ownerSVGElement"in t}const mn=new WeakMap;let gn;const Yu=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:vo(s)&&"getBBox"in s?s.getBBox()[e]:s[n],t0=Yu("inline","width","offsetWidth"),e0=Yu("block","height","offsetHeight");function n0({target:t,borderBoxSize:e}){mn.get(t)?.forEach(n=>{n(t,{get width(){return t0(t,e)},get height(){return e0(t,e)}})})}function s0(t){t.forEach(n0)}function i0(){typeof ResizeObserver>"u"||(gn=new ResizeObserver(s0))}function o0(t,e){gn||i0();const n=Hu(t);return n.forEach(s=>{let i=mn.get(s);i||(i=new Set,mn.set(s,i)),i.add(e),gn?.observe(s)}),()=>{n.forEach(s=>{const i=mn.get(s);i?.delete(e),i?.size||gn?.unobserve(s)})}}const yn=new Set;let ee;function r0(){ee=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};yn.forEach(e=>e(t))},window.addEventListener("resize",ee)}function a0(t){return yn.add(t),ee||r0(),()=>{yn.delete(t),!yn.size&&typeof ee=="function"&&(window.removeEventListener("resize",ee),ee=void 0)}}function ha(t,e){return typeof t=="function"?a0(t):o0(t,e)}function l0(t){return vo(t)&&t.tagName==="svg"}function c0(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],r=t[2+n],o=t[3+n],a=wu(i,r,o);return e?a(s):a}function u0(t,e,n={}){const s=t.get();let i=null,r=s,o;const a=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,c=()=>{i&&(i.stop(),i=null),t.animation=void 0},u=()=>{const h=fa(t.get()),f=fa(r);if(h===f){c();return}const d=i?i.getGeneratorVelocity():t.getVelocity();c(),i=new Re({keyframes:[h,f],velocity:d,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},l=()=>{u(),t.animation=i??void 0,t.events.animationStart?.notify(),i?.then(()=>{t.animation=void 0,t.events.animationComplete?.notify()})};if(t.attach((h,f)=>{r=h,o=d=>f(ys(d,a)),L.postRender(l)},c),X(e)){let h=n.skipInitialAnimation===!0;const f=e.on("change",p=>{h?(h=!1,t.jump(ys(p,a),!1)):t.set(ys(p,a))}),d=t.on("destroy",f);return()=>{f(),d()}}return c}function ys(t,e){return e?t+e:t}function fa(t){return typeof t=="number"?t:parseFloat(t)}const h0=[...Uu,K,gt],f0=t=>h0.find(Nu(t)),da=()=>({translate:0,scale:1,origin:0,originPoint:0}),ne=()=>({x:da(),y:da()}),pa=()=>({min:0,max:0}),_=()=>({x:pa(),y:pa()}),d0=new WeakMap;function Hn(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Le(t){return typeof t=="string"||Array.isArray(t)}const xo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],To=["initial",...xo];function Gn(t){return Hn(t.animate)||To.some(e=>Le(t[e]))}function qu(t){return!!(Gn(t)||t.variants)}function p0(t,e,n){for(const s in e){const i=e[s],r=n[s];if(X(i))t.addValue(s,i);else if(X(r))t.addValue(s,zt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,zt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const di={current:null},Zu={current:!1},m0=typeof window<"u";function g0(){if(Zu.current=!0,!!m0)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>di.current=t.matches;t.addEventListener("change",e),e()}else di.current=!1}const ma=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ln={};function Ju(t){Ln=t}function y0(){return Ln}class v0{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=co,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,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 d=nt.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,L.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=l,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Gn(n),this.isVariantNode=qu(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const d in f){const p=f[d];u[d]!==void 0&&X(p)&&p.set(u[d])}}mount(e){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=e,d0.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:(Zu.current||g0(),this.shouldReduceMotion=di.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Vt(this.notifyUpdate),Vt(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){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&Ru.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:c,ease:u,duration:l}=n.accelerate,h=new Du({element:this.current,name:e,keyframes:a,times:c,ease:u,duration:rt(l)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=he.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&L.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&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 Ln){const n=Ln[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):_()}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<ma.length;s++){const i=ma[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=p0(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=zt(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"&&(Yc(s)||Zc(s))?s=parseFloat(s):!f0(s)&>.test(n)&&(s=Ku(e,n)),this.setBaseTarget(e,X(s)?s.get():s)),X(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=fo(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&&!X(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 to),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){go.render(this.render)}}class Qu extends v0{constructor(){super(...arguments),this.KeyframeResolver=Hv}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const s=e.style;return s?s[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;X(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Lt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function th({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function x0({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function T0(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 vs(t){return t===void 0||t===1}function pi({scale:t,scaleX:e,scaleY:n}){return!vs(t)||!vs(e)||!vs(n)}function Bt(t){return pi(t)||eh(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function eh(t){return ga(t.x)||ga(t.y)}function ga(t){return t&&t!=="0%"}function kn(t,e,n){const s=t-n,i=e*s;return n+i}function ya(t,e,n,s,i){return i!==void 0&&(t=kn(t,i,s)),kn(t,n,s)+e}function mi(t,e=0,n=1,s,i){t.min=ya(t.min,e,n,s,i),t.max=ya(t.max,e,n,s,i)}function nh(t,{x:e,y:n}){mi(t.x,e.translate,e.scale,e.originPoint),mi(t.y,n.translate,n.scale,n.originPoint)}const va=.999999999999,xa=1.0000000000001;function w0(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&(xt(t.x,-r.scroll.offset.x),xt(t.y,-r.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,nh(t,o)),s&&Bt(r.latestValues)&&vn(t,r.latestValues,r.layout?.layoutBox))}e.x<xa&&e.x>va&&(e.x=1),e.y<xa&&e.y>va&&(e.y=1)}function xt(t,e){t.min+=e,t.max+=e}function Ta(t,e,n,s,i=.5){const r=F(t.min,t.max,i);mi(t,e,n,r,s)}function wa(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function vn(t,e,n){const s=n??t;Ta(t.x,wa(e.x,s.x),e.scaleX,e.scale,e.originX),Ta(t.y,wa(e.y,s.y),e.scaleY,e.scale,e.originY)}function sh(t,e){return th(T0(t.getBoundingClientRect(),e))}function P0(t,e,n){const s=sh(t,n),{scroll:i}=e;return i&&(xt(s.x,i.offset.x),xt(s.y,i.offset.y)),s}const S0={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},b0=ue.length;function A0(t,e,n){let s="",i=!0;for(let r=0;r<b0;r++){const o=ue[r],a=t[o];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);c=o.startsWith("scale")?u===1:u===0}if(!c||n){const u=Gu(a,mo[o]);if(!c){i=!1;const l=S0[o]||o;s+=`${l}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function wo(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const c in e){const u=e[c];if(he.has(c)){o=!0;continue}else if(fu(c)){i[c]=u;continue}else{const l=Gu(u,mo[c]);c.startsWith("origin")?(a=!0,r[c]=l):s[c]=l}}if(e.transform||(o||n?s.transform=A0(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:c="50%",originY:u="50%",originZ:l=0}=r;s.transformOrigin=`${c} ${u} ${l}`}}function ih(t,{style:e,vars:n},s,i){const r=t.style;let o;for(o in e)r[o]=e[o];i?.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function Pa(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const de={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(C.test(t))t=parseFloat(t);else return t;const n=Pa(t,e.target.x),s=Pa(t,e.target.y);return`${n}% ${s}%`}},V0={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=gt.parse(t);if(i.length>5)return s;const r=gt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=c;const u=F(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},gi={borderRadius:{...de,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomLeftRadius:de,borderBottomRightRadius:de,boxShadow:V0};function oh(t,{layout:e,layoutId:n}){return he.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!gi[t]||t==="opacity")}function Po(t,e,n){const s=t.style,i=e?.style,r={};if(!s)return r;for(const o in s)(X(s[o])||i&&X(i[o])||oh(o,t)||n?.getValue(o)?.liveStyle!==void 0)&&(r[o]=s[o]);return r}function C0(t){return window.getComputedStyle(t)}class $0 extends Qu{constructor(){super(...arguments),this.type="html",this.renderInstance=ih}readValueFromInstance(e,n){if(he.has(n))return this.projection?.isProjecting?ni(n):zy(e,n);{const s=C0(e),i=(fu(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return sh(e,n)}build(e,n,s){wo(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Po(e,n,s)}}const M0={offset:"stroke-dashoffset",array:"stroke-dasharray"},D0={offset:"strokeDashoffset",array:"strokeDasharray"};function E0(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?M0:D0;t[r.offset]=`${-s}`,t[r.array]=`${e} ${n}`}const R0=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function rh(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},c,u,l){if(wo(t,a,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=l?.transformBox??"fill-box",delete h.transformBox);for(const d of R0)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&E0(h,i,r,o,!1)}const ah=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"]),lh=t=>typeof t=="string"&&t.toLowerCase()==="svg";function L0(t,e,n,s){ih(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(ah.has(i)?i:po(i),e.attrs[i])}function ch(t,e,n){const s=Po(t,e,n);for(const i in t)if(X(t[i])||X(e[i])){const r=ue.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}class k0 extends Qu{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(he.has(n)){const s=Wu(n);return s&&s.default||0}return n=ah.has(n)?n:po(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return ch(e,n,s)}build(e,n,s){rh(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){L0(e,n,s,i)}mount(e){this.isSVGTag=lh(e.tagName),super.mount(e)}}const I0=To.length;function uh(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?uh(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<I0;n++){const s=To[n],i=t.props[s];(Le(i)||i===!1)&&(e[s]=i)}return e}function hh(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 F0=[...xo].reverse(),B0=xo.length;function O0(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Lv(t,n,s)))}function j0(t){let e=O0(t),n=Sa(),s=!0,i=!1;const r=u=>(l,h)=>{const f=Ht(t,h,u==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function o(u){e=u(t)}function a(u){const{props:l}=t,h=uh(t.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let y=0;y<B0;y++){const T=F0[y],v=n[T],w=l[T]!==void 0?l[T]:h[T],S=Le(w),M=T===u?v.isActive:null;M===!1&&(m=y);let D=w===h[T]&&w!==l[T]&&S;if(D&&(s||i)&&t.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...p},!v.isActive&&M===null||!w&&!v.prevProp||Hn(w)||typeof w=="boolean")continue;if(T==="exit"&&v.isActive&&M!==!0){v.prevResolvedValues&&(p={...p,...v.prevResolvedValues});continue}const b=N0(v.prevProp,w);let A=b||T===u&&v.isActive&&!D&&S||y>m&&S,P=!1;const $=Array.isArray(w)?w:[w];let E=$.reduce(r(T),{});M===!1&&(E={});const{prevResolvedValues:H={}}=v,N={...H,...E},G=R=>{A=!0,d.has(R)&&(P=!0,d.delete(R)),v.needsAnimating[R]=!0;const I=t.getValue(R);I&&(I.liveStyle=!1)};for(const R in N){const I=E[R],Q=H[R];if(p.hasOwnProperty(R))continue;let it=!1;li(I)&&li(Q)?it=!hh(I,Q):it=I!==Q,it?I!=null?G(R):d.add(R):I!==void 0&&d.has(R)?G(R):v.protectedKeys[R]=!0}v.prevProp=w,v.prevResolvedValues=E,v.isActive&&(p={...p,...E}),(s||i)&&t.blockInitialAnimation&&(A=!1);const U=D&&b;A&&(!U||P)&&f.push(...$.map(R=>{const I={type:T};if(typeof R=="string"&&(s||i)&&!U&&t.manuallyAnimateOnMount&&t.parent){const{parent:Q}=t,it=Ht(Q,R);if(Q.enteringChildren&&it){const{delayChildren:_n}=it.transition||{};I.delay=Lu(Q.enteringChildren,t,_n)}}return{animation:R,options:I}}))}if(d.size){const y={};if(typeof l.initial!="boolean"){const T=Ht(t,Array.isArray(l.initial)?l.initial[0]:l.initial);T&&T.transition&&(y.transition=T.transition)}d.forEach(T=>{const v=t.getBaseTarget(T),w=t.getValue(T);w&&(w.liveStyle=!0),y[T]=v??null}),f.push({animation:y})}let g=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,i=!1,g?e(f):Promise.resolve()}function c(u,l){if(n[u].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(u,l)),n[u].isActive=l;const h=a(u);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Sa(),i=!0}}}function N0(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!hh(e,t):!1}function It(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Sa(){return{animate:It(!0),whileInView:It(),whileHover:It(),whileTap:It(),whileDrag:It(),whileFocus:It(),exit:It()}}function yi(t,e){t.min=e.min,t.max=e.max}function ft(t,e){yi(t.x,e.x),yi(t.y,e.y)}function ba(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const fh=1e-4,U0=1-fh,W0=1+fh,dh=.01,K0=0-dh,H0=0+dh;function st(t){return t.max-t.min}function G0(t,e,n){return Math.abs(t-e)<=n}function Aa(t,e,n,s=.5){t.origin=s,t.originPoint=F(e.min,e.max,t.origin),t.scale=st(n)/st(e),t.translate=F(n.min,n.max,t.origin)-t.originPoint,(t.scale>=U0&&t.scale<=W0||isNaN(t.scale))&&(t.scale=1),(t.translate>=K0&&t.translate<=H0||isNaN(t.translate))&&(t.translate=0)}function be(t,e,n,s){Aa(t.x,e.x,n.x,s?s.originX:void 0),Aa(t.y,e.y,n.y,s?s.originY:void 0)}function Va(t,e,n,s=0){const i=s?F(n.min,n.max,s):n.min;t.min=i+e.min,t.max=t.min+st(e)}function z0(t,e,n,s){Va(t.x,e.x,n.x,s?.x),Va(t.y,e.y,n.y,s?.y)}function Ca(t,e,n,s=0){const i=s?F(n.min,n.max,s):n.min;t.min=e.min-i,t.max=t.min+st(e)}function In(t,e,n,s){Ca(t.x,e.x,n.x,s?.x),Ca(t.y,e.y,n.y,s?.y)}function $a(t,e,n,s,i){return t-=e,t=kn(t,1/n,s),i!==void 0&&(t=kn(t,1/i,s)),t}function _0(t,e=0,n=1,s=.5,i,r=t,o=t){if(wt.test(e)&&(e=parseFloat(e),e=F(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=F(r.min,r.max,s);t===r&&(a-=e),t.min=$a(t.min,e,n,a,i),t.max=$a(t.max,e,n,a,i)}function Ma(t,e,[n,s,i],r,o){_0(t,e[n],e[s],e[i],e.scale,r,o)}const X0=["x","scaleX","originX"],Y0=["y","scaleY","originY"];function Da(t,e,n,s){Ma(t.x,e,X0,n?n.x:void 0,s?s.x:void 0),Ma(t.y,e,Y0,n?n.y:void 0,s?s.y:void 0)}function Ea(t){return t.translate===0&&t.scale===1}function ph(t){return Ea(t.x)&&Ea(t.y)}function Ra(t,e){return t.min===e.min&&t.max===e.max}function q0(t,e){return Ra(t.x,e.x)&&Ra(t.y,e.y)}function La(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function mh(t,e){return La(t.x,e.x)&&La(t.y,e.y)}function ka(t){return st(t.x)/st(t.y)}function Ia(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function vt(t){return[t("x"),t("y")]}function Z0(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:l,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),l&&(s+=`rotate(${l}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,c=t.y.scale*e.y;return(a!==1||c!==1)&&(s+=`scale(${a}, ${c})`),s||"none"}const gh=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],J0=gh.length,Fa=t=>typeof t=="string"?parseFloat(t):t,Ba=t=>typeof t=="number"||C.test(t);function Q0(t,e,n,s,i,r){i?(t.opacity=F(0,n.opacity??1,t1(s)),t.opacityExit=F(e.opacity??1,0,e1(s))):r&&(t.opacity=F(e.opacity??1,n.opacity??1,s));for(let o=0;o<J0;o++){const a=gh[o];let c=Oa(e,a),u=Oa(n,a);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Ba(c)===Ba(u)?(t[a]=Math.max(F(Fa(c),Fa(u),s),0),(wt.test(u)||wt.test(c))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=F(e.rotate||0,n.rotate||0,s))}function Oa(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const t1=yh(0,.5,ru),e1=yh(.5,.95,ut);function yh(t,e,n){return s=>s<t?0:s>e?1:n(De(t,e,s))}function n1(t,e,n){const s=X(t)?t:zt(t);return s.start(ho("",s,e,n)),s.animation}function ke(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const s1=(t,e)=>t.depth-e.depth;class i1{constructor(){this.children=[],this.isDirty=!1}add(e){Ji(this.children,e),this.isDirty=!0}remove(e){Mn(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(s1),this.isDirty=!1,this.children.forEach(e)}}function o1(t,e){const n=nt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(Vt(s),t(r-e))};return L.setup(s,!0),()=>Vt(s)}function xn(t){return X(t)?t.get():t}class r1{constructor(){this.members=[]}add(e){Ji(this.members,e);for(let n=this.members.length-1;n>=0;n--){const s=this.members[n];if(s===e||s===this.lead||s===this.prevLead)continue;const i=s.instance;(!i||i.isConnected===!1)&&!s.snapshot&&(Mn(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(Mn(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){for(let n=this.members.indexOf(e)-1;n>=0;n--){const s=this.members[n];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=s.options,{layoutDependency:r}=e.options;(i===void 0||i!==r)&&(e.resumeFrom=s,n&&(s.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Tn={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xs=["","X","Y","Z"],a1=1e3;let l1=0;function Ts(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function vh(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ou(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",L,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&vh(s)}function xh({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e?.()){this.id=l1++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(h1),this.nodes.forEach(y1),this.nodes.forEach(v1),this.nodes.forEach(f1)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new i1)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new to),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=vo(o)&&!l0(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),t){let l,h=0;const f=()=>this.root.updateBlockedByResize=!1;L.read(()=>{h=window.innerWidth}),t(o,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,l&&l(),l=o1(f,250),Tn.hasAnimatedSinceResize&&(Tn.hasAnimatedSinceResize=!1,this.nodes.forEach(Ua)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||S1,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!mh(this.targetLayout,d),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...uo(p,"layout"),onPlay:m,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(l,T)}else h||Ua(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(x1),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vh(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){const h=this.path[l];h.shouldResetTransform=!0,(typeof h.latestValues.x=="string"||typeof h.latestValues.y=="string")&&(h.isLayoutDirty=!0),h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(p1),this.nodes.forEach(ja);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Na);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(m1),this.nodes.forEach(g1),this.nodes.forEach(c1),this.nodes.forEach(u1)):this.nodes.forEach(Na),this.clearAllSnapshots();const a=nt.now();J.delta=St(0,1e3/60,a-J.timestamp),J.timestamp=a,J.isProcessing=!0,us.update.process(J),us.preRender.process(J),us.render.process(J),J.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,go.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(d1),this.sharedNodes.forEach(T1)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!st(this.snapshot.measuredBox.x)&&!st(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=_()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!ph(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Bt(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),b1(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:o}=this.options;if(!o)return _();const a=o.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(A1))){const{scroll:u}=this.root;u&&(xt(a.x,u.offset.x),xt(a.y,u.offset.y))}return a}removeElementScroll(o){const a=_();if(ft(a,o),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:l,options:h}=u;u!==this.root&&l&&h.layoutScroll&&(l.wasRoot&&ft(a,o),xt(a.x,l.offset.x),xt(a.y,l.offset.y))}return a}applyTransform(o,a=!1,c){const u=c||_();ft(u,o);for(let l=0;l<this.path.length;l++){const h=this.path[l];!a&&h.options.layoutScroll&&h.scroll&&h!==h.root&&(xt(u.x,-h.scroll.offset.x),xt(u.y,-h.scroll.offset.y)),Bt(h.latestValues)&&vn(u,h.latestValues,h.layout?.layoutBox)}return Bt(this.latestValues)&&vn(u,this.latestValues,this.layout?.layoutBox),u}removeTransform(o){const a=_();ft(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!Bt(u.latestValues))continue;let l;u.instance&&(pi(u.latestValues)&&u.updateSnapshot(),l=_(),ft(l,u.measurePageBox())),Da(a,u.latestValues,u.snapshot?.layoutBox,l)}return Bt(this.latestValues)&&Da(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==J.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:l,layoutId:h}=this.options;if(!this.layout||!(l||h))return;this.resolvedRelativeTargetAt=J.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_(),this.targetWithTransforms=_()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),z0(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ft(this.target,this.layout.layoutBox),nh(this.target,this.targetDelta)):ft(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||pi(this.parent.latestValues)||eh(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_(),this.relativeTargetOrigin=_(),In(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ft(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const o=this.getLead(),a=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===J.timestamp&&(c=!1),c)return;const{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;ft(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;w0(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=_());const{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ba(this.prevProjectionDelta.x,this.projectionDelta.x),ba(this.prevProjectionDelta.y,this.projectionDelta.y)),be(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Ia(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ia(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){if(this.options.visualElement?.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ne(),this.projectionDelta=ne(),this.projectionDeltaWithTransform=ne()}setAnimationOrigin(o,a=!1){const c=this.snapshot,u=c?c.latestValues:{},l={...this.latestValues},h=ne();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=_(),d=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,g=this.getStack(),y=!g||g.members.length<=1,T=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(P1));this.animationProgress=0;let v;this.mixTargetDelta=w=>{const S=w/1e3;Wa(h.x,o.x,S),Wa(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(In(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),w1(this.relativeTarget,this.relativeTargetOrigin,f,S),v&&q0(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=_()),ft(v,this.relativeTarget)),m&&(this.animationValues=l,Q0(l,u,this.latestValues,S,T,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Vt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=L.update(()=>{Tn.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=zt(0)),this.motionValue.jump(0,!1),this.currentAnimation=n1(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(a1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:u,latestValues:l}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&Th(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||_();const h=st(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const f=st(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+f}ft(a,c),vn(a,l),be(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new r1),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){const{layoutId:o}=this.options;return o?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:o}=this.options;return o?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const u={};c.z&&Ts("z",o,u,this.animationValues);for(let l=0;l<xs.length;l++)Ts(`rotate${xs[l]}`,o,u,this.animationValues),Ts(`skew${xs[l]}`,o,u,this.animationValues);o.render();for(const l in u)o.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=xn(a?.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=xn(a?.pointerEvents)||""),this.hasProjected&&!Bt(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Z0(this.projectionDeltaWithTransform,this.treeScale,l);c&&(h=c(l,h)),o.transform=h;const{x:f,y:d}=this.projectionDelta;o.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?l.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(const p in gi){if(l[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=gi[p],T=h==="none"?l[p]:m(l[p],u);if(g){const v=g.length;for(let w=0;w<v;w++)o[g[w]]=T}else y?this.options.visualElement.renderState.vars[p]=T:o[p]=T}this.options.layoutId&&(o.pointerEvents=u===this?xn(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>o.currentAnimation?.stop()),this.root.nodes.forEach(ja),this.root.sharedNodes.clear()}}}function c1(t){t.updateLayout()}function u1(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;if(i==="size")vt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=st(h);h.min=n[l].min,h.max=h.min+f});else if(i==="x"||i==="y"){const l=i==="x"?"y":"x";yi(r?e.measuredBox[l]:e.layoutBox[l],n[l])}else Th(i,e.layoutBox,n)&&vt(l=>{const h=r?e.measuredBox[l]:e.layoutBox[l],f=st(n[l]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const o=ne();be(o,n,e.layoutBox);const a=ne();r?be(a,t.applyTransform(s,!0),e.measuredBox):be(a,n,e.layoutBox);const c=!ph(o);let u=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:h,layout:f}=l;if(h&&f){const d=t.options.layoutAnchor||void 0,p=_();In(p,e.layoutBox,h.layoutBox,d);const m=_();In(m,n,f.layoutBox,d),mh(p,m)||(u=!0),l.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function h1(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function f1(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function d1(t){t.clearSnapshot()}function ja(t){t.clearMeasurements()}function p1(t){t.isLayoutDirty=!0,t.updateLayout()}function Na(t){t.isLayoutDirty=!1}function m1(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function g1(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ua(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function y1(t){t.resolveTargetDelta()}function v1(t){t.calcProjection()}function x1(t){t.resetSkewAndRotation()}function T1(t){t.removeLeadSnapshot()}function Wa(t,e,n){t.translate=F(e.translate,0,n),t.scale=F(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ka(t,e,n,s){t.min=F(e.min,n.min,s),t.max=F(e.max,n.max,s)}function w1(t,e,n,s){Ka(t.x,e.x,n.x,s),Ka(t.y,e.y,n.y,s)}function P1(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const S1={duration:.45,ease:[.4,0,.1,1]},Ha=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ga=Ha("applewebkit/")&&!Ha("chrome/")?Math.round:ut;function za(t){t.min=Ga(t.min),t.max=Ga(t.max)}function b1(t){za(t.x),za(t.y)}function Th(t,e,n){return t==="position"||t==="preserve-aspect"&&!G0(ka(e),ka(n),.2)}function A1(t){return t!==t.root&&t.scroll?.wasRoot}const V1=xh({attachResizeListener:(t,e)=>ke(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ws={current:void 0},wh=xh({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ws.current){const t=new V1({});t.mount(window),t.setOptions({layoutScroll:!0}),ws.current=t}return ws.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Ge=x.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function _a(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function C1(...t){return e=>{let n=!1;const s=t.map(i=>{const r=_a(i,e);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():_a(t[i],null)}}}}function $1(...t){return x.useCallback(C1(...t),t)}class M1 extends x.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(dn(n)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const s=n.offsetParent,i=dn(s)&&s.offsetWidth||0,r=dn(s)&&s.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=r-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function D1({children:t,isPresent:e,anchorX:n,anchorY:s,root:i,pop:r}){const o=x.useId(),a=x.useRef(null),c=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=x.useContext(Ge),l=t.props?.ref??t?.ref,h=$1(a,l);return x.useInsertionEffect(()=>{const{width:f,height:d,top:p,left:m,right:g,bottom:y}=c.current;if(e||r===!1||!a.current||!f||!d)return;const T=n==="left"?`left: ${m}`:`right: ${g}`,v=s==="bottom"?`bottom: ${y}`:`top: ${p}`;a.current.dataset.motionPopId=o;const w=document.createElement("style");u&&(w.nonce=u);const S=i??document.head;return S.appendChild(w),w.sheet&&w.sheet.insertRule(`
|
|
10
|
+
[data-motion-pop-id="${o}"] {
|
|
11
|
+
position: absolute !important;
|
|
12
|
+
width: ${f}px !important;
|
|
13
|
+
height: ${d}px !important;
|
|
14
|
+
${T}px !important;
|
|
15
|
+
${v}px !important;
|
|
16
|
+
}
|
|
17
|
+
`),()=>{a.current?.removeAttribute("data-motion-pop-id"),S.contains(w)&&S.removeChild(w)}},[e]),q.jsx(M1,{isPresent:e,childRef:a,sizeRef:c,pop:r,children:r===!1?t:x.cloneElement(t,{ref:h})})}const E1=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a,anchorY:c,root:u})=>{const l=Ue(R1),h=x.useId();let f=!0,d=x.useMemo(()=>(f=!1,{id:h,initial:e,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;s&&s()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,s]);return r&&f&&(d={...d}),x.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),x.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=q.jsx(D1,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:c,root:u,children:t}),q.jsx(Wn.Provider,{value:d,children:t})};function R1(){return new Map}function Ph(t=!0){const e=x.useContext(Wn);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=x.useId();x.useEffect(()=>{if(t)return i(r)},[t]);const o=x.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const tn=t=>t.key||"";function Xa(t){const e=[];return x.Children.forEach(t,n=>{x.isValidElement(n)&&e.push(n)}),e}const bT=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[l,h]=Ph(o),f=x.useMemo(()=>Xa(t),[t]),d=o&&!l?[]:f.map(tn),p=x.useRef(!0),m=x.useRef(f),g=Ue(()=>new Map),y=x.useRef(new Set),[T,v]=x.useState(f),[w,S]=x.useState(f);Zi(()=>{p.current=!1,m.current=f;for(let b=0;b<w.length;b++){const A=tn(w[b]);d.includes(A)?(g.delete(A),y.current.delete(A)):g.get(A)!==!0&&g.set(A,!1)}},[w,d.length,d.join("-")]);const M=[];if(f!==T){let b=[...f];for(let A=0;A<w.length;A++){const P=w[A],$=tn(P);d.includes($)||(b.splice(A,0,P),M.push(P))}return r==="wait"&&M.length&&(b=M),S(Xa(b)),v(f),null}const{forceRender:D}=x.useContext(qi);return q.jsx(q.Fragment,{children:w.map(b=>{const A=tn(b),P=o&&!l?!1:f===w||d.includes(A),$=()=>{if(y.current.has(A))return;if(g.has(A))y.current.add(A),g.set(A,!0);else return;let E=!0;g.forEach(H=>{H||(E=!1)}),E&&(D?.(),S(m.current),o&&h?.(),s&&s())};return q.jsx(E1,{isPresent:P,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,root:u,onExitComplete:P?void 0:$,anchorX:a,anchorY:c,children:b},A)})})},Sh=x.createContext({strict:!1}),Ya={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let qa=!1;function L1(){if(qa)return;const t={};for(const e in Ya)t[e]={isEnabled:n=>Ya[e].some(s=>!!n[s])};Ju(t),qa=!0}function bh(){return L1(),y0()}function k1(t){const e=bh();for(const n in t)e[n]={...e[n],...t[n]};Ju(e)}const I1=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Fn(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||I1.has(t)}let Ah=t=>!Fn(t);function F1(t){typeof t=="function"&&(Ah=e=>e.startsWith("on")?!Fn(e):t(e))}try{F1(require("@emotion/is-prop-valid").default)}catch{}function B1(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||X(t[i])||(Ah(i)||n===!0&&Fn(i)||!e&&!Fn(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const zn=x.createContext({});function O1(t,e){if(Gn(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Le(n)?n:void 0,animate:Le(s)?s:void 0}}return t.inherit!==!1?e:{}}function j1(t){const{initial:e,animate:n}=O1(t,x.useContext(zn));return x.useMemo(()=>({initial:e,animate:n}),[Za(e),Za(n)])}function Za(t){return Array.isArray(t)?t.join(" "):t}const So=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Vh(t,e,n){for(const s in e)!X(e[s])&&!oh(s,n)&&(t[s]=e[s])}function N1({transformTemplate:t},e){return x.useMemo(()=>{const n=So();return wo(n,e,t),Object.assign({},n.vars,n.style)},[e])}function U1(t,e){const n=t.style||{},s={};return Vh(s,n,t),Object.assign(s,N1(t,e)),s}function W1(t,e){const n={},s=U1(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const Ch=()=>({...So(),attrs:{}});function K1(t,e,n,s){const i=x.useMemo(()=>{const r=Ch();return rh(r,e,lh(s),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Vh(r,t.style,t),i.style={...r,...i.style}}return i}const H1=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function bo(t){return typeof t!="string"||t.includes("-")?!1:!!(H1.indexOf(t)>-1||/[A-Z]/u.test(t))}function G1(t,e,n,{latestValues:s},i,r=!1,o){const c=(o??bo(t)?K1:W1)(e,s,i,t),u=B1(e,typeof t=="string",r),l=t!==x.Fragment?{...u,...c,ref:n}:{},{children:h}=e,f=x.useMemo(()=>X(h)?h.get():h,[h]);return x.createElement(t,{...l,children:f})}function z1({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:_1(n,s,i,t),renderState:e()}}function _1(t,e,n,s){const i={},r=s(t,{});for(const f in r)i[f]=xn(r[f]);let{initial:o,animate:a}=t;const c=Gn(t),u=qu(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||o===!1;const h=l?a:o;if(h&&typeof h!="boolean"&&!Hn(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const p=fo(t,f[d]);if(p){const{transitionEnd:m,transition:g,...y}=p;for(const T in y){let v=y[T];if(Array.isArray(v)){const w=l?v.length-1:0;v=v[w]}v!==null&&(i[T]=v)}for(const T in m)i[T]=m[T]}}}return i}const $h=t=>(e,n)=>{const s=x.useContext(zn),i=x.useContext(Wn),r=()=>z1(t,e,s,i);return n?r():Ue(r)},X1=$h({scrapeMotionValuesFromProps:Po,createRenderState:So}),Y1=$h({scrapeMotionValuesFromProps:ch,createRenderState:Ch}),q1=Symbol.for("motionComponentSymbol");function Z1(t,e,n){const s=x.useRef(n);x.useInsertionEffect(()=>{s.current=n});const i=x.useRef(null);return x.useCallback(r=>{r&&t.onMount?.(r);const o=s.current;if(typeof o=="function")if(r){const a=o(r);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r);e&&(r?e.mount(r):e.unmount())},[e])}const Mh=x.createContext({});function Xt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function J1(t,e,n,s,i,r){const{visualElement:o}=x.useContext(zn),a=x.useContext(Sh),c=x.useContext(Wn),u=x.useContext(Ge),l=u.reducedMotion,h=u.skipAnimations,f=x.useRef(null),d=x.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:h,isSVG:r}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,m=x.useContext(Mh);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Q1(f.current,n,i,m);const g=x.useRef(!1);x.useInsertionEffect(()=>{p&&g.current&&p.update(n,c)});const y=n[Bu],T=x.useRef(!!y&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(y)&&window.MotionHasOptimisedAnimation?.(y));return Zi(()=>{d.current=!0,p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),T.current&&p.animationState&&p.animationState.animateChanges())}),x.useEffect(()=>{p&&(!T.current&&p.animationState&&p.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(y)}),T.current=!1),p.enteringChildren=void 0)}),p}function Q1(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:l,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Dh(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Xt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:h,layoutScroll:c,layoutRoot:u,layoutAnchor:l})}function Dh(t){if(t)return t.options.allowProjection!==!1?t.projection:Dh(t.parent)}function Ps(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&k1(s);const r=n?n==="svg":bo(t),o=r?Y1:X1;function a(u,l){let h;const f={...x.useContext(Ge),...u,layoutId:tx(u)},{isStatic:d}=f,p=j1(u),m=o(u,d);if(!d&&typeof window<"u"){ex();const g=nx(f);h=g.MeasureLayout,p.visualElement=J1(t,m,f,i,g.ProjectionNode,r)}return q.jsxs(zn.Provider,{value:p,children:[h&&p.visualElement?q.jsx(h,{visualElement:p.visualElement,...f}):null,G1(t,u,Z1(m,p.visualElement,l),m,d,e,r)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=x.forwardRef(a);return c[q1]=t,c}function tx({layoutId:t}){const e=x.useContext(qi).id;return e&&t!==void 0?e+"-"+t:t}function ex(t,e){x.useContext(Sh).strict}function nx(t){const e=bh(),{drag:n,layout:s}=e;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n?.isEnabled(t)||s?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function sx(t,e){if(typeof Proxy>"u")return Ps;const n=new Map,s=(r,o)=>Ps(r,o,t,e),i=(r,o)=>s(r,o);return new Proxy(i,{get:(r,o)=>o==="create"?s:(n.has(o)||n.set(o,Ps(o,void 0,t,e)),n.get(o))})}const ix=(t,e)=>e.isSVG??bo(t)?new k0(e):new $0(e,{allowProjection:t!==x.Fragment});class ox extends Lt{constructor(e){super(e),e.animationState||(e.animationState=j0(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Hn(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 rx=0;class ax extends Lt{constructor(){super(...arguments),this.id=rx++,this.isExitComplete=!1}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;if(e&&s===!1){if(this.isExitComplete){const{initial:r,custom:o}=this.node.getProps();if(typeof r=="string"){const a=Ht(this.node,r,o);if(a){const{transition:c,transitionEnd:u,...l}=a;for(const h in l)this.node.getValue(h)?.jump(l[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const lx={animation:{Feature:ox},exit:{Feature:ax}};function ze(t){return{point:{x:t.pageX,y:t.pageY}}}const cx=t=>e=>yo(e)&&t(e,ze(e));function Ae(t,e,n,s){return ke(t,e,cx(n),s)}const Eh=({current:t})=>t?t.ownerDocument.defaultView:null,Ja=(t,e)=>Math.abs(t-e);function ux(t,e){const n=Ja(t.x,e.x),s=Ja(t.y,e.y);return Math.sqrt(n**2+s**2)}const Qa=new Set(["auto","scroll"]);class Rh{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=en(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Ss(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=ux(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=d,{timestamp:y}=J;this.history.push({...g,timestamp:y});const{onStart:T,onMove:v}=this.handlers;p||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=en(p,this.transformPagePoint),L.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=Ss(d.type==="pointercancel"?this.lastMoveEventInfo:en(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,T),g&&g(d,T)},!yo(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=o,this.contextWindow=i||window;const c=ze(e),u=en(c,this.transformPagePoint),{point:l}=u,{timestamp:h}=J;this.history=[{...l,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ss(u,this.history)),this.removeListeners=We(Ae(this.contextWindow,"pointermove",this.handlePointerMove),Ae(this.contextWindow,"pointerup",this.handlePointerUp),Ae(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Qa.has(s.overflowX)||Qa.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:i.x-n.x,y:i.y-n.y};r.x===0&&r.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,i),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vt(this.updatePoint)}}function en(t,e){return e?{point:e(t.point)}:t}function tl(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ss({point:t},e){return{point:t,delta:tl(t,Lh(e)),offset:tl(t,hx(e)),velocity:fx(e,.1)}}function hx(t){return t[0]}function Lh(t){return t[t.length-1]}function fx(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Lh(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>rt(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>rt(e)*2&&(s=t[1]);const r=lt(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function dx(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?F(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?F(n,t,s.max):Math.min(t,n)),t}function el(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function px(t,{top:e,left:n,bottom:s,right:i}){return{x:el(t.x,n,i),y:el(t.y,e,s)}}function nl(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function mx(t,e){return{x:nl(t.x,e.x),y:nl(t.y,e.y)}}function gx(t,e){let n=.5;const s=st(t),i=st(e);return i>s?n=De(e.min,e.max-s,t.min):s>i&&(n=De(t.min,t.max-i,e.min)),St(0,1,n)}function yx(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const vi=.35;function vx(t=vi){return t===!1?t=0:t===!0&&(t=vi),{x:sl(t,"left","right"),y:sl(t,"top","bottom")}}function sl(t,e,n){return{min:il(t,e),max:il(t,n)}}function il(t,e){return typeof t=="number"?t:t[e]||0}const xx=new WeakMap;class Tx{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=h=>{n&&this.snapToCursor(ze(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Gv(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),vt(y=>{let T=this.getAxisMotionValue(y).get()||0;if(wt.test(T)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[y];w&&(T=st(w)*(parseFloat(T)/100))}}this.originPoint[y]=T}),m&&L.update(()=>m(h,f),!1,!0),ci(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:y}=f;if(p&&this.currentDirection===null){this.currentDirection=Px(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,y),this.updateAxis("y",f.point,y),this.visualElement.render(),g&&L.update(()=>g(h,f),!1,!0)},c=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Rh(e,{onSessionStart:r,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Eh(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!s)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&L.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!nn(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=dx(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;e&&Xt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=px(s.layoutBox,e):this.constraints=!1,this.elastic=vx(n),i!==this.constraints&&!Xt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&vt(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=yx(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Xt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=P0(s,i.root,this.visualElement.getTransformPagePoint());let o=mx(i.layout.layoutBox,r);if(n){const a=n(x0(o));this.hasMutatedConstraints=!!a,a&&(o=th(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=vt(l=>{if(!nn(l,n,this.currentDirection))return;let h=c&&c[l]||{};(o===!0||o===l)&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[l]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(l,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return ci(this.visualElement,e),s.start(ho(e,s,0,n,this.visualElement,!1))}stopAnimation(){vt(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){vt(n=>{const{drag:s}=this.getProps();if(!nn(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n],c=r.get()||0;r.set(e[n]-F(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Xt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};vt(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const c=a.get();i[o]=gx({min:c,max:c},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),vt(o=>{if(!nn(o,e,null))return;const a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(F(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;xx.set(this.visualElement,this);const e=this.visualElement.current,n=Ae(e,"pointerdown",u=>{const{drag:l,dragListener:h=!0}=this.getProps(),f=u.target,d=f!==e&&Zv(f);l&&h&&!d&&this.start(u)});let s;const i=()=>{const{dragConstraints:u}=this.getProps();Xt(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),s||(s=wx(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),L.read(i);const a=ke(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(vt(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),c&&c(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=vi,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function ol(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function wx(t,e,n){const s=ha(t,ol(n)),i=ha(e,ol(n));return()=>{s(),i()}}function nn(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Px(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Sx extends Lt{constructor(e){super(e),this.removeGroupControls=ut,this.removeListeners=ut,this.controls=new Tx(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ut}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const bs=t=>(e,n)=>{t&&L.update(()=>t(e,n),!1,!0)};class bx extends Lt{constructor(){super(...arguments),this.removePointerDownListener=ut}onPointerDown(e){this.session=new Rh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Eh(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:bs(e),onStart:bs(n),onMove:bs(s),onEnd:(r,o)=>{delete this.session,i&&L.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=Ae(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let As=!1;class Ax extends x.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),As&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Tn.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,{projection:o}=s;return o&&(o.isPresent=r,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),As=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||L.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:s}=e;s&&(s.options.layoutAnchor=n,s.root.didUpdate(),go.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;As=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function kh(t){const[e,n]=Ph(),s=x.useContext(qi);return q.jsx(Ax,{...t,layoutGroup:s,switchLayoutGroup:x.useContext(Mh),isPresent:e,safeToRemove:n})}const Vx={pan:{Feature:bx},drag:{Feature:Sx,ProjectionNode:wh,MeasureLayout:kh}};function rl(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&&L.postRender(()=>r(e,ze(e)))}class Cx extends Lt{mount(){const{current:e}=this.node;e&&(this.unmount=_v(e,(n,s)=>(rl(this.node,s,"Start"),i=>rl(this.node,i,"End"))))}unmount(){}}class $x extends Lt{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=We(ke(this.node.current,"focus",()=>this.onFocus()),ke(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function al(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&&L.postRender(()=>r(e,ze(e)))}class Mx extends Lt{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Qv(e,(i,r)=>(al(this.node,r,"Start"),(o,{success:a})=>al(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const xi=new WeakMap,Vs=new WeakMap,Dx=t=>{const e=xi.get(t.target);e&&e(t)},Ex=t=>{t.forEach(Dx)};function Rx({root:t,...e}){const n=t||document;Vs.has(n)||Vs.set(n,{});const s=Vs.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ex,{root:t,...e})),s[i]}function Lx(t,e,n){const s=Rx(e);return xi.set(t,n),s.observe(t),()=>{xi.delete(t),s.unobserve(t)}}const kx={some:0,all:1};class Ix extends Lt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:kx[i]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:l,onViewportLeave:h}=this.node.getProps(),f=u?l:h;f&&f(c)};this.stopObserver=Lx(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Fx(e,n))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function Fx({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Bx={inView:{Feature:Ix},tap:{Feature:Mx},focus:{Feature:$x},hover:{Feature:Cx}},Ox={layout:{ProjectionNode:wh,MeasureLayout:kh}},jx={...lx,...Bx,...Vx,...Ox},AT=sx(jx,ix);function Ih(t){const e=Ue(()=>zt(t)),{isStatic:n}=x.useContext(Ge);if(n){const[,s]=x.useState(t);x.useEffect(()=>e.on("change",s),[])}return e}function Fh(t,e){const n=Ih(e()),s=()=>n.set(e());return s(),Zi(()=>{const i=()=>L.preRender(s,!1,!0),r=t.map(o=>o.on("change",i));return()=>{r.forEach(o=>o()),Vt(s)}}),n}function Nx(t){Se.current=[],t();const e=Fh(Se.current,t);return Se.current=void 0,e}function Ux(t,e,n,s){if(typeof t=="function")return Nx(t);const r=c0(e,n,s),o=Array.isArray(t)?ll(t,r):ll([t],([c])=>r(c)),a=Array.isArray(t)?void 0:t.accelerate;return a&&!a.isTransformed&&typeof e!="function"&&Array.isArray(n)&&s?.clamp!==!1&&(o.accelerate={...a,times:e,keyframes:n,isTransformed:!0}),o}function ll(t,e){const n=Ue(()=>[]);return Fh(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}function Wx(t,e={}){const{isStatic:n}=x.useContext(Ge),s=()=>X(t)?t.get():t;if(n)return Ux(s);const i=Ih(s());return x.useInsertionEffect(()=>u0(i,t,e),[i,JSON.stringify(e)]),i}function VT(t,e={}){return Wx(t,{type:"spring",...e})}export{bT as A,VT as a,lT as b,TT as c,PT as d,wT as e,Bg as f,AT as m,Ih as u};
|