import{r as T}from"./router-BC4OM2fV.js";var fe={exports:{}},Vt={};var En;function Ir(){if(En)return Vt;En=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,o){var r=null;if(o!==void 0&&(r=""+o),i.key!==void 0&&(r=""+i.key),"key"in i){o={};for(var a in i)a!=="key"&&(o[a]=i[a])}else o=i;return i=o.ref,{$$typeof:t,type:s,key:r,ref:i!==void 0?i:null,props:o}}return Vt.Fragment=e,Vt.jsx=n,Vt.jsxs=n,Vt}var Rn;function Br(){return Rn||(Rn=1,fe.exports=Ir()),fe.exports}var et=Br();const Je=T.createContext({});function Qe(t){const e=T.useRef(null);return e.current===null&&(e.current=t()),e.current}const jr=typeof window<"u",Ys=jr?T.useLayoutEffect:T.useEffect,le=T.createContext(null);function tn(t,e){t.indexOf(e)===-1&&t.push(e)}function te(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const J=(t,e,n)=>n>e?e:n{};const nt={},qs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Zs(t){return typeof t=="object"&&t!==null}const Js=t=>/^0[^.\s]+$/u.test(t);function Qs(t){let e;return()=>(e===void 0&&(e=t()),e)}const H=t=>t,Or=(t,e)=>n=>e(t(n)),jt=(...t)=>t.reduce(Or),kt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class nn{constructor(){this.subscriptions=[]}add(e){return tn(this.subscriptions,e),()=>te(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 o=0;ot*1e3,K=t=>t/1e3;function ti(t,e){return e?t*(1e3/e):0}const ei=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Nr=1e-7,Ur=12;function Wr(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=ei(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Nr&&++aWr(o,0,1,t,n);return o=>o===0||o===1?o:ei(i(o),e,s)}const ni=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,si=t=>e=>1-t(1-e),ii=Ot(.33,1.53,.69,.99),sn=si(ii),ri=ni(sn),oi=t=>(t*=2)<1?.5*sn(t):.5*(2-Math.pow(2,-10*(t-1))),rn=t=>1-Math.sin(Math.acos(t)),ai=si(rn),li=ni(rn),$r=Ot(.42,0,1,1),Kr=Ot(0,0,.58,1),ui=Ot(.42,0,.58,1),Hr=t=>Array.isArray(t)&&typeof t[0]!="number",ci=t=>Array.isArray(t)&&typeof t[0]=="number",zr={linear:H,easeIn:$r,easeInOut:ui,easeOut:Kr,circIn:rn,circInOut:li,circOut:ai,backIn:sn,backInOut:ri,backOut:ii,anticipate:oi},Gr=t=>typeof t=="string",Ln=t=>{if(ci(t)){en(t.length===4);const[e,n,s,i]=t;return Ot(e,n,s,i)}else if(Gr(t))return zr[t];return t},Wt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function _r(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function u(l){r.has(l)&&(c.schedule(l),t()),l(a)}const c={schedule:(l,h=!1,f=!1)=>{const p=f&&i?n:s;return h&&r.add(l),p.has(l)||p.add(l),l},cancel:l=>{s.delete(l),r.delete(l)},process:l=>{if(a=l,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(u),n.clear(),i=!1,o&&(o=!1,c.process(l))}};return c}const Xr=40;function hi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Wt.reduce((v,w)=>(v[w]=_r(o),v),{}),{setup:a,read:u,resolveKeyframes:c,preUpdate:l,update:h,preRender:f,render:d,postRender:p}=r,m=()=>{const v=nt.useManualTiming?i.timestamp:performance.now();n=!1,nt.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,Xr),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),u.process(i),c.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))},y=()=>{n=!0,s=!0,i.isProcessing||t(m)};return{schedule:Wt.reduce((v,w)=>{const b=r[w];return v[w]=(D,F=!1,A=!1)=>(n||y(),b.schedule(D,F,A)),v},{}),cancel:v=>{for(let w=0;w(Gt===void 0&&N.set(j.isProcessing||nt.useManualTiming?j.timestamp:performance.now()),Gt),set:t=>{Gt=t,queueMicrotask(Yr)}},fi=t=>e=>typeof e=="string"&&e.startsWith(t),di=fi("--"),qr=fi("var(--"),on=t=>qr(t)?Zr.test(t.split("/*")[0].trim()):!1,Zr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function kn(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const St={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ft={...St,transform:t=>J(0,1,t)},$t={...St,default:1},Dt=t=>Math.round(t*1e5)/1e5,an=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Jr(t){return t==null}const Qr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ln=(t,e)=>n=>!!(typeof n=="string"&&Qr.test(n)&&n.startsWith(t)||e&&!Jr(n)&&Object.prototype.hasOwnProperty.call(n,e)),pi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(an);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},to=t=>J(0,255,t),pe={...St,transform:t=>Math.round(to(t))},ct={test:ln("rgb","red"),parse:pi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+pe.transform(t)+", "+pe.transform(e)+", "+pe.transform(n)+", "+Dt(Ft.transform(s))+")"};function eo(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 De={test:ln("#"),parse:eo,transform:ct.transform},Nt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),st=Nt("deg"),Z=Nt("%"),P=Nt("px"),no=Nt("vh"),so=Nt("vw"),Fn={...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(t*100)},mt={test:ln("hsl","hue"),parse:pi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Z.transform(Dt(e))+", "+Z.transform(Dt(n))+", "+Dt(Ft.transform(s))+")"},L={test:t=>ct.test(t)||De.test(t)||mt.test(t),parse:t=>ct.test(t)?ct.parse(t):mt.test(t)?mt.parse(t):De.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ct.transform(t):mt.transform(t),getAnimatableNone:t=>{const e=L.parse(t);return e.alpha=0,L.transform(e)}},io=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ro(t){return isNaN(t)&&typeof t=="string"&&(t.match(an)?.length||0)+(t.match(io)?.length||0)>0}const mi="number",gi="color",oo="var",ao="var(",In="${}",lo=/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 wt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(lo,u=>(L.test(u)?(s.color.push(o),i.push(gi),n.push(L.parse(u))):u.startsWith(ao)?(s.var.push(o),i.push(oo),n.push(u)):(s.number.push(o),i.push(mi),n.push(parseFloat(u))),++o,In)).split(In);return{values:n,split:a,indexes:s,types:i}}function uo(t){return wt(t).values}function yi({split:t,types:e}){const n=t.length;return s=>{let i="";for(let o=0;otypeof t=="number"?0:L.test(t)?L.getAnimatableNone(t):t,fo=(t,e)=>typeof t=="number"?e?.trim().endsWith("/")?t:0:ho(t);function po(t){const e=wt(t);return yi(e)(e.values.map((s,i)=>fo(s,e.split[i])))}const _={test:ro,parse:uo,createTransformer:co,getAnimatableNone:po};function me(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 mo({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,u=2*n-a;i=me(u,a,t+1/3),o=me(u,a,t),r=me(u,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function ee(t,e){return n=>n>0?e:t}const E=(t,e,n)=>t+(e-t)*n,ge=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},go=[De,ct,mt],yo=t=>go.find(e=>e.test(t));function Bn(t){const e=yo(t);if(!e)return!1;let n=e.parse(t);return e===mt&&(n=mo(n)),n}const jn=(t,e)=>{const n=Bn(t),s=Bn(e);if(!n||!s)return ee(t,e);const i={...n};return o=>(i.red=ge(n.red,s.red,o),i.green=ge(n.green,s.green,o),i.blue=ge(n.blue,s.blue,o),i.alpha=E(n.alpha,s.alpha,o),ct.transform(i))},Ee=new Set(["none","hidden"]);function vo(t,e){return Ee.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function xo(t,e){return n=>E(t,e,n)}function un(t){return typeof t=="number"?xo:typeof t=="string"?on(t)?ee:L.test(t)?jn:Po:Array.isArray(t)?vi:typeof t=="object"?L.test(t)?jn:To:ee}function vi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>un(o)(o,e[r]));return o=>{for(let r=0;r{for(const o in s)n[o]=s[o](i);return n}}function wo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i{const n=_.createTransformer(e),s=wt(t),i=wt(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?Ee.has(t)&&!i.values.length||Ee.has(e)&&!s.values.length?vo(t,e):jt(vi(wo(s,i),i.values),n):ee(t,e)};function xi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?E(t,e,n):un(t)(t,e)}const So=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>C.update(e,n),stop:()=>rt(e),now:()=>j.isProcessing?j.timestamp:N.now()}},Ti=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o=ne?1/0:e}function bo(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(cn(s),ne);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:K(i)}}const R={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 Re(t,e){return t*Math.sqrt(1-e*e)}const Ao=12;function Vo(t,e,n){let s=n;for(let i=1;i{const l=c*r,h=l*t,f=l-n,d=Re(c,r),p=Math.exp(-h);return ye-f/d*p},o=c=>{const h=c*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(c,2)*t,p=Math.exp(-h),m=Re(Math.pow(c,2),r);return(-i(c)+ye>0?-1:1)*((f-d)*p)/m}):(i=c=>{const l=Math.exp(-c*t),h=(c-n)*t+1;return-ye+l*h},o=c=>{const l=Math.exp(-c*t),h=(n-c)*(t*t);return l*h});const a=5/t,u=Vo(i,o,a);if(t=W(t),isNaN(u))return{stiffness:R.stiffness,damping:R.damping,duration:t};{const c=Math.pow(u,2)*s;return{stiffness:c,damping:r*2*Math.sqrt(s*c),duration:t}}}const Mo=["duration","bounce"],Do=["stiffness","damping","mass"];function On(t,e){return e.some(n=>t[n]!==void 0)}function Eo(t){let e={velocity:R.velocity,stiffness:R.stiffness,damping:R.damping,mass:R.mass,isResolvedFromDuration:!1,...t};if(!On(t,Do)&&On(t,Mo))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*J(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:R.mass,stiffness:i,damping:o}}else{const n=Co({...t,velocity:0});e={...e,...n,mass:R.mass},e.isResolvedFromDuration=!0}return e}function se(t=R.visualDuration,e=R.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:u,damping:c,mass:l,duration:h,velocity:f,isResolvedFromDuration:d}=Eo({...n,velocity:-K(n.velocity||0)}),p=f||0,m=c/(2*Math.sqrt(u*l)),y=r-o,g=K(Math.sqrt(u/l)),x=Math.abs(y)<5;s||(s=x?R.restSpeed.granular:R.restSpeed.default),i||(i=x?R.restDelta.granular:R.restDelta.default);let v,w,b,D,F,A;if(m<1)b=Re(g,m),D=(p+m*g*y)/b,v=S=>{const M=Math.exp(-m*g*S);return r-M*(D*Math.sin(b*S)+y*Math.cos(b*S))},F=m*g*D+y*b,A=m*g*y-D*b,w=S=>Math.exp(-m*g*S)*(F*Math.sin(b*S)+A*Math.cos(b*S));else if(m===1){v=M=>r-Math.exp(-g*M)*(y+(p+g*y)*M);const S=p+g*y;w=M=>Math.exp(-g*M)*(g*S*M-p)}else{const S=g*Math.sqrt(m*m-1);v=X=>{const tt=Math.exp(-m*g*X),Y=Math.min(S*X,300);return r-tt*((p+m*g*y)*Math.sinh(Y)+S*y*Math.cosh(Y))/S};const M=(p+m*g*y)/S,I=m*g*M-y*S,Q=m*g*y-M*S;w=X=>{const tt=Math.exp(-m*g*X),Y=Math.min(S*X,300);return tt*(I*Math.sinh(Y)+Q*Math.cosh(Y))}}const V={calculatedDuration:d&&h||null,velocity:S=>W(w(S)),next:S=>{if(!d&&m<1){const I=Math.exp(-m*g*S),Q=Math.sin(b*S),X=Math.cos(b*S),tt=r-I*(D*Q+y*X),Y=W(I*(F*Q+A*X));return a.done=Math.abs(Y)<=s&&Math.abs(r-tt)<=i,a.value=a.done?r:tt,a}const M=v(S);if(d)a.done=S>=h;else{const I=W(w(S));a.done=Math.abs(I)<=s&&Math.abs(r-M)<=i}return a.value=a.done?r:M,a},toString:()=>{const S=Math.min(cn(V),ne),M=Ti(I=>V.next(S*I).value,S,30);return S+"ms "+M},toTransition:()=>{}};return V}se.applyToOptions=t=>{const e=bo(t,100,se);return t.ease=e.ease,t.duration=W(e.duration),t.type="keyframes",t};const Ro=5;function wi(t,e,n){const s=Math.max(e-Ro,0);return ti(n-t(s),e-s)}function Le({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:u,restDelta:c=.5,restSpeed:l}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&Au,p=A=>a===void 0?u:u===void 0||Math.abs(a-A)-m*Math.exp(-A/s),v=A=>g+x(A),w=A=>{const V=x(A),S=v(A);f.done=Math.abs(V)<=c,f.value=f.done?g:S};let b,D;const F=A=>{d(f.value)&&(b=A,D=se({keyframes:[f.value,p(f.value)],velocity:wi(v,A,f.value),damping:i,stiffness:o,restDelta:c,restSpeed:l}))};return F(0),{calculatedDuration:null,next:A=>{let V=!1;return!D&&b===void 0&&(V=!0,w(A),F(A)),b!==void 0&&A>=b?D.next(A-b):(!V&&w(A),f)}}}function Lo(t,e,n){const s=[],i=n||nt.mix||xi,o=t.length-1;for(let r=0;re[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Lo(e,s,i),u=a.length,c=l=>{if(r&&l1)for(;hc(J(t[0],t[o-1],l)):c}function Fo(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=kt(0,e,s);t.push(E(n,1,i))}}function Io(t){const e=[0];return Fo(e,t.length-1),e}function Bo(t,e){return t.map(n=>n*e)}function jo(t,e){return t.map(()=>e||ui).splice(0,t.length-1)}function Et({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Hr(s)?s.map(Ln):Ln(s),o={done:!1,value:e[0]},r=Bo(n&&n.length===e.length?n:Io(e),t),a=ko(r,e,{ease:Array.isArray(i)?i:jo(e,i)});return{calculatedDuration:t,next:u=>(o.value=a(u),o.done=u>=t,o)}}const Oo=t=>t!==null;function hn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(Oo),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const No={decay:Le,inertia:Le,tween:Et,keyframes:Et,spring:se};function Pi(t){typeof t.type=="string"&&(t.type=No[t.type])}class fn{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 Uo=t=>t/100;class dn extends fn{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!==N.now()&&this.tick(N.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;Pi(e);const{type:n=Et,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const u=n||Et;u!==Et&&typeof a[0]!="number"&&(this.mixKeyframes=jt(Uo,xi(a[0],a[1])),a=[0,100]);const c=u({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...a].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=cn(c));const{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=c}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:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return s.next(0);const{delay:c=0,keyframes:l,repeat:h,repeatType:f,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:y}=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 g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,w=s;if(h){const A=Math.min(this.currentTime,i)/a;let V=Math.floor(A),S=A%1;!S&&A>=1&&(S=1),S===1&&V--,V=Math.min(V,h+1),V%2&&(f==="reverse"?(S=1-S,d&&(S-=d/a)):f==="mirror"&&(w=r)),v=J(0,1,S)*a}const b=x?{done:!1,value:l[0]}:w.next(v);o&&!x&&(b.value=o(b.value));let{done:D}=b;!x&&u!==null&&(D=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const F=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return F&&p!==Le&&(b.value=hn(l,this.options,y,this.speed)),m&&m(b.value),F&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return K(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(this.currentTime)}set time(e){e=W(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 wi(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(N.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=K(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=So,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(N.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 Wo(t){for(let e=1;et*180/Math.PI,ke=t=>{const e=ht(Math.atan2(t[1],t[0]));return Fe(e)},$o={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ke,rotateZ:ke,skewX:t=>ht(Math.atan(t[1])),skewY:t=>ht(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Fe=t=>(t=t%360,t<0&&(t+=360),t),Nn=ke,Un=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Wn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Ko={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Un,scaleY:Wn,scale:t=>(Un(t)+Wn(t))/2,rotateX:t=>Fe(ht(Math.atan2(t[6],t[5]))),rotateY:t=>Fe(ht(Math.atan2(-t[2],t[0]))),rotateZ:Nn,rotate:Nn,skewX:t=>ht(Math.atan(t[4])),skewY:t=>ht(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function Be(t,e){if(!t||t==="none")return Ie(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Ko,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=$o,i=a}if(!i)return Ie(e);const o=s[e],r=i[1].split(",").map(zo);return typeof o=="function"?o(r):r[o]}const Ho=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Be(n,e)};function zo(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],At=new Set(bt),$n=t=>t===St||t===P,Go=new Set(["x","y","z"]),_o=bt.filter(t=>!Go.has(t));function Xo(t){const e=[];return _o.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const it={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})=>Be(e,"x"),y:(t,{transform:e})=>Be(e,"y")};it.translateX=it.x;it.translateY=it.y;const ft=new Set;let je=!1,Oe=!1,Ne=!1;function Si(){if(Oe){const t=Array.from(ft).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Xo(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(([o,r])=>{s.getValue(o)?.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Oe=!1,je=!1,ft.forEach(t=>t.complete(Ne)),ft.clear()}function bi(){ft.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Oe=!0)})}function Yo(){Ne=!0,bi(),Si(),Ne=!1}class pn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ft.add(this),je||(je=!0,C.read(bi),C.resolveKeyframes(Si))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i?.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Wo(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ft.delete(this)}cancel(){this.state==="scheduled"&&(ft.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qo=t=>t.startsWith("--");function Ai(t,e,n){qo(e)?t.style.setProperty(e,n):t.style[e]=n}const Zo={};function Vi(t,e){const n=Qs(t);return()=>Zo[e]??n()}const Jo=Vi(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Ci=Vi(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Kn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mt([0,.65,.55,1]),circOut:Mt([.55,0,1,.45]),backIn:Mt([.31,.01,.66,-.59]),backOut:Mt([.33,1.53,.69,.99])};function Mi(t,e){if(t)return typeof t=="function"?Ci()?Ti(t,e):"ease-out":ci(t)?Mt(t):Array.isArray(t)?t.map(n=>Mi(n,e)||Kn.easeOut):Kn[t]}function Qo(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:u}={},c=void 0){const l={[e]:n};u&&(l.offset=u);const h=Mi(a,i);Array.isArray(h)&&(l.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return c&&(f.pseudoElement=c),t.animate(l,f)}function Di(t){return typeof t=="function"&&"applyToOptions"in t}function ta({type:t,...e}){return Di(t)&&Ci()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Ei extends fn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:u}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,en(typeof e.type!="string");const c=ta(e);this.animation=Qo(n,s,i,c,o),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const l=hn(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),Ai(n,s,l),this.animation.cancel()}u?.(),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 K(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=W(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&&Jo()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),s&&(this.animation.rangeEnd=s),H):i(this)}}const Ri={anticipate:oi,backInOut:ri,circInOut:li};function ea(t){return t in Ri}function na(t){typeof t.ease=="string"&&ea(t.ease)&&(t.ease=Ri[t.ease])}const ve=10;class sa extends Ei{constructor(e){na(e),Pi(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:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new dn({...r,autoplay:!1}),u=Math.max(ve,N.now()-this.startTime),c=J(0,ve,u-ve),l=a.sample(u).value,{name:h}=this.options;o&&h&&Ai(o,h,l),n.setWithVelocity(a.sample(Math.max(0,u-c)).value,l,c),a.stop()}}const Hn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(_.test(t)||t==="0")&&!t.startsWith("url("));function ia(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function la(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return aa()&&n&&oa.has(n)&&(n!=="transform"||!c)&&!u&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const ua=40;class ca extends fn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:u,motionValue:c,element:l,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=N.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:u,motionValue:c,element:l,...h},d=l?.KeyframeResolver||pn;this.keyframeResolver=new d(a,(p,m,y)=>this.onKeyframesResolved(p,m,f,!y),u,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:u,isHandoff:c,onUpdate:l}=s;this.resolvedAt=N.now(),ra(e,o,r,a)||((nt.instantAnimations||!u)&&l?.(hn(e,s,n)),e[0]=e[e.length-1],Ue(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ua?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!c&&la(f),p=f.motionValue?.owner?.current,m=d?new sa({...f,element:p}):new dn(f);m.finished.then(()=>{this.notifyFinished()}).catch(H),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(),Yo()),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 Li(t,e,n,s=0,i=1){const o=Array.from(t).sort((c,l)=>c.sortNodePosition(l)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}const ha=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fa(t){const e=ha.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function ki(t,e,n=1){const[s,i]=fa(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return qs(r)?parseFloat(r):r}return on(i)?ki(i,e,n+1):i}const da={type:"spring",stiffness:500,damping:25,restSpeed:10},pa=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ma={type:"keyframes",duration:.8},ga={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ya=(t,{keyframes:e})=>e.length>2?ma:At.has(t)?t.startsWith("scale")?pa(e[1]):da:ga,va=t=>t!==null;function xa(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(va),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}function Fi(t,e){if(t?.inherit&&e){const{inherit:n,...s}=t;return{...e,...s}}return t}function mn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Fi(n,t):n}function Ta({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:u,elapsed:c,...l}){return!!Object.keys(l).length}const gn=(t,e,n,s={},i,o)=>r=>{const a=mn(s,t)||{},u=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-W(u);const l={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};Ta(a)||Object.assign(l,ya(t,l)),l.duration&&(l.duration=W(l.duration)),l.repeatDelay&&(l.repeatDelay=W(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let h=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(Ue(l),l.delay===0&&(h=!0)),(nt.instantAnimations||nt.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,Ue(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=xa(l.keyframes,a);if(f!==void 0){C.update(()=>{l.onUpdate(f),l.onComplete()});return}}return a.isSync?new dn(l):new ca(l)};function zn(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function yn(t,e,n,s){if(typeof e=="function"){const[i,o]=zn(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=zn(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function Tt(t,e,n){const s=t.getProps();return yn(s,e,n!==void 0?n:s.custom,t)}const Ii=new Set(["width","height","top","left","right","bottom",...bt]),Gn=30,wa=t=>!isNaN(parseFloat(t));class Pa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const i=N.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 o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=N.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=wa(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 nn);const s=this.events[e].add(n);return e==="change"?()=>{s(),C.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=N.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Gn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Gn);return ti(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 Pt(t,e){return new Pa(t,e)}const We=t=>Array.isArray(t);function Sa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Pt(n))}function ba(t){return We(t)?t[t.length-1]||0:t}function Aa(t,e){const n=Tt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=ba(o[r]);Sa(t,r,a)}}const O=t=>!!(t&&t.getVelocity);function Va(t){return!!(O(t)&&t.add)}function $e(t,e){const n=t.getValue("willChange");if(Va(n))return n.add(e);if(!n&&nt.WillChange){const s=new nt.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function vn(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Ca="framerAppearId",Bi="data-"+vn(Ca);function ji(t){return t.props[Bi]}function Ma({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Oi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o,transitionEnd:r,...a}=e;const u=t.getDefaultTransition();o=o?Fi(o,u):u;const c=o?.reduceMotion;s&&(o=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&&Ma(h,f))continue;const m={delay:n,...mn(o||{},f)},y=d.get();if(y!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===y&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const w=ji(t);if(w){const b=window.MotionHandoffAnimation(w,f,C);b!==null&&(m.startTime=b,g=!0)}}$e(t,f);const x=c??t.shouldReduceMotion;d.start(gn(f,d,p,x&&Ii.has(f)?{type:!1}:m,t,g));const v=d.animation;v&&l.push(v)}if(r){const f=()=>C.update(()=>{r&&Aa(t,r)});l.length?Promise.all(l).then(f):f()}return l}function Ke(t,e,n={}){const s=Tt(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Oi(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:l,staggerDirection:h}=i;return Da(t,e,u,c,l,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[o,r]:[r,o];return u().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function Da(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),a.push(Ke(u,e,{...r,delay:n+(typeof s=="function"?0:s)+Li(t.variantChildren,u,s,i,o)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(a)}function Ea(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>Ke(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=Ke(t,e,n);else{const i=typeof e=="function"?Tt(t,e,n.custom):e;s=Promise.all(Oi(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const Ra={test:t=>t==="auto",parse:t=>t},Ni=t=>e=>e.test(t),Ui=[St,P,Z,st,so,no,Ra],_n=t=>Ui.find(Ni(t));function La(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Js(t):!0}const ka=new Set(["brightness","contrast","saturate","opacity"]);function Fa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(an)||[];if(!s)return t;const i=n.replace(s,"");let o=ka.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Ia=/\b([a-z-]*)\(.*?\)/gu,He={..._,getAnimatableNone:t=>{const e=t.match(Ia);return e?e.map(Fa).join(" "):t}},ze={..._,getAnimatableNone:t=>{const e=_.parse(t);return _.createTransformer(t)(e.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Xn={...St,transform:Math.round},Ba={rotate:st,rotateX:st,rotateY:st,rotateZ:st,scale:$t,scaleX:$t,scaleY:$t,scaleZ:$t,skew:st,skewX:st,skewY:st,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:Ft,originX:Fn,originY:Fn,originZ:P},xn={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,inset:P,insetBlock:P,insetBlockStart:P,insetBlockEnd:P,insetInline:P,insetInlineStart:P,insetInlineEnd:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,paddingBlock:P,paddingBlockStart:P,paddingBlockEnd:P,paddingInline:P,paddingInlineStart:P,paddingInlineEnd:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,marginBlock:P,marginBlockStart:P,marginBlockEnd:P,marginInline:P,marginInlineStart:P,marginInlineEnd:P,fontSize:P,backgroundPositionX:P,backgroundPositionY:P,...Ba,zIndex:Xn,fillOpacity:Ft,strokeOpacity:Ft,numOctaves:Xn},ja={...xn,color:L,backgroundColor:L,outlineColor:L,fill:L,stroke:L,borderColor:L,borderTopColor:L,borderRightColor:L,borderBottomColor:L,borderLeftColor:L,filter:He,WebkitFilter:He,mask:ze,WebkitMask:ze},Wi=t=>ja[t],Oa=new Set([He,ze]);function $i(t,e){let n=Wi(t);return Oa.has(n)||(n=_),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Na=new Set(["auto","none","0"]);function Ua(t,e,n){let s=0,i;for(;s{e.getValue(a).set(u)}),this.resolveNoneKeyframes()}}const $a=new Set(["opacity","clipPath","filter","transform"]);function Ki(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 Hi=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function _t(t){return Zs(t)&&"offsetHeight"in t}const{schedule:Tn}=hi(queueMicrotask,!1),G={x:!1,y:!1};function zi(){return G.x||G.y}function Ka(t){return t==="x"||t==="y"?G[t]?null:(G[t]=!0,()=>{G[t]=!1}):G.x||G.y?null:(G.x=G.y=!0,()=>{G.x=G.y=!1})}function Gi(t,e){const n=Ki(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Ha(t){return!(t.pointerType==="touch"||zi())}function za(t,e,n={}){const[s,i,o]=Gi(t,n);return s.forEach(r=>{let a=!1,u=!1,c;const l=()=>{r.removeEventListener("pointerleave",p)},h=y=>{c&&(c(y),c=void 0),l()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),u&&(u=!1,h(y))},d=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=y=>{if(y.pointerType!=="touch"){if(a){u=!0;return}h(y)}},m=y=>{if(!Ha(y))return;u=!1;const g=e(r,y);typeof g=="function"&&(c=g,r.addEventListener("pointerleave",p,i))};r.addEventListener("pointerenter",m,i),r.addEventListener("pointerdown",d,i)}),o}const _i=(t,e)=>e?t===e?!0:_i(t,e.parentElement):!1,wn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ga=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _a(t){return Ga.has(t.tagName)||t.isContentEditable===!0}const Xa=new Set(["INPUT","SELECT","TEXTAREA"]);function Ya(t){return Xa.has(t.tagName)||t.isContentEditable===!0}const Xt=new WeakSet;function Yn(t){return e=>{e.key==="Enter"&&t(e)}}function xe(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const qa=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Yn(()=>{if(Xt.has(n))return;xe(n,"down");const i=Yn(()=>{xe(n,"up")}),o=()=>xe(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function qn(t){return wn(t)&&!zi()}const Zn=new WeakSet;function Za(t,e,n={}){const[s,i,o]=Gi(t,n),r=a=>{const u=a.currentTarget;if(!qn(a)||Zn.has(a))return;Xt.add(u),n.stopPropagation&&Zn.add(a);const c=e(u,a),l=(d,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Xt.has(u)&&Xt.delete(u),qn(d)&&typeof c=="function"&&c(d,{success:p})},h=d=>{l(d,u===window||u===document||n.useGlobalTarget||_i(u,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",r,i),_t(a)&&(a.addEventListener("focus",c=>qa(c,i)),!_a(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Pn(t){return Zs(t)&&"ownerSVGElement"in t}const Yt=new WeakMap;let qt;const Xi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Pn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ja=Xi("inline","width","offsetWidth"),Qa=Xi("block","height","offsetHeight");function tl({target:t,borderBoxSize:e}){Yt.get(t)?.forEach(n=>{n(t,{get width(){return Ja(t,e)},get height(){return Qa(t,e)}})})}function el(t){t.forEach(tl)}function nl(){typeof ResizeObserver>"u"||(qt=new ResizeObserver(el))}function sl(t,e){qt||nl();const n=Ki(t);return n.forEach(s=>{let i=Yt.get(s);i||(i=new Set,Yt.set(s,i)),i.add(e),qt?.observe(s)}),()=>{n.forEach(s=>{const i=Yt.get(s);i?.delete(e),i?.size||qt?.unobserve(s)})}}const Zt=new Set;let gt;function il(){gt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Zt.forEach(e=>e(t))},window.addEventListener("resize",gt)}function rl(t){return Zt.add(t),gt||il(),()=>{Zt.delete(t),!Zt.size&&typeof gt=="function"&&(window.removeEventListener("resize",gt),gt=void 0)}}function Jn(t,e){return typeof t=="function"?rl(t):sl(t,e)}function ol(t){return Pn(t)&&t.tagName==="svg"}const al=[...Ui,L,_],ll=t=>al.find(Ni(t)),Qn=()=>({translate:0,scale:1,origin:0,originPoint:0}),yt=()=>({x:Qn(),y:Qn()}),ts=()=>({min:0,max:0}),k=()=>({x:ts(),y:ts()}),ul=new WeakMap;function ue(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function It(t){return typeof t=="string"||Array.isArray(t)}const Sn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bn=["initial",...Sn];function ce(t){return ue(t.animate)||bn.some(e=>It(t[e]))}function Yi(t){return!!(ce(t)||t.variants)}function cl(t,e,n){for(const s in e){const i=e[s],o=n[s];if(O(i))t.addValue(s,i);else if(O(o))t.addValue(s,Pt(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,Pt(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ge={current:null},qi={current:!1},hl=typeof window<"u";function fl(){if(qi.current=!0,!!hl)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ge.current=t.matches;t.addEventListener("change",e),e()}else Ge.current=!1}const es=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ie={};function Zi(t){ie=t}function dl(){return ie}class pl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:o,blockInitialAnimation:r,visualState:a},u={}){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=pn,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=N.now();this.renderScheduledAtthis.bindToMotionValue(s,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(qi.current||fl(),this.shouldReduceMotion=Ge.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(),rt(this.notifyUpdate),rt(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&&$a.has(e)&&this.current instanceof HTMLElement){const{factory:r,keyframes:a,times:u,ease:c,duration:l}=n.accelerate,h=new Ei({element:this.current,name:e,keyframes:a,times:u,ease:c,duration:W(l)}),f=r(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const s=At.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&C.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),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 ie){const n=ie[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 o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):k()}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;sn.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=Pt(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"&&(qs(s)||Js(s))?s=parseFloat(s):!ll(s)&&_.test(n)&&(s=$i(e,n)),this.setBaseTarget(e,O(s)?s.get():s)),O(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 o=yn(this.props,n,this.presenceContext?.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!O(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 nn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Tn.render(this.render)}}class Ji extends pl{constructor(){super(...arguments),this.KeyframeResolver=Wa}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;O(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ot{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Qi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ml({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function gl(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 Te(t){return t===void 0||t===1}function _e({scale:t,scaleX:e,scaleY:n}){return!Te(t)||!Te(e)||!Te(n)}function ut(t){return _e(t)||tr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function tr(t){return ns(t.x)||ns(t.y)}function ns(t){return t&&t!=="0%"}function re(t,e,n){const s=t-n,i=e*s;return n+i}function ss(t,e,n,s,i){return i!==void 0&&(t=re(t,i,s)),re(t,n,s)+e}function Xe(t,e=0,n=1,s,i){t.min=ss(t.min,e,n,s,i),t.max=ss(t.max,e,n,s,i)}function er(t,{x:e,y:n}){Xe(t.x,e.translate,e.scale,e.originPoint),Xe(t.y,n.translate,n.scale,n.originPoint)}const is=.999999999999,rs=1.0000000000001;function yl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;ais&&(e.x=1),e.yis&&(e.y=1)}function vt(t,e){t.min=t.min+e,t.max=t.max+e}function os(t,e,n,s,i=.5){const o=E(t.min,t.max,i);Xe(t,e,n,o,s)}function as(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function xt(t,e,n){const s=n??t;os(t.x,as(e.x,s.x),e.scaleX,e.scale,e.originX),os(t.y,as(e.y,s.y),e.scaleY,e.scale,e.originY)}function nr(t,e){return Qi(gl(t.getBoundingClientRect(),e))}function vl(t,e,n){const s=nr(t,n),{scroll:i}=e;return i&&(vt(s.x,i.offset.x),vt(s.y,i.offset.y)),s}const xl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Tl=bt.length;function wl(t,e,n){let s="",i=!0;for(let o=0;o{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=ls(t,e.target.x),s=ls(t,e.target.y);return`${n}% ${s}%`}},Pl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=_.parse(t);if(i.length>5)return s;const o=_.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,u=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=u;const c=E(a,u,.5);return typeof i[2+r]=="number"&&(i[2+r]/=c),typeof i[3+r]=="number"&&(i[3+r]/=c),o(i)}},Ye={borderRadius:{...Ct,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ct,borderTopRightRadius:Ct,borderBottomLeftRadius:Ct,borderBottomRightRadius:Ct,boxShadow:Pl};function ir(t,{layout:e,layoutId:n}){return At.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ye[t]||t==="opacity")}function Vn(t,e,n){const s=t.style,i=e?.style,o={};if(!s)return o;for(const r in s)(O(s[r])||i&&O(i[r])||ir(r,t)||n?.getValue(r)?.liveStyle!==void 0)&&(o[r]=s[r]);return o}function Sl(t){return window.getComputedStyle(t)}class bl extends Ji{constructor(){super(...arguments),this.type="html",this.renderInstance=sr}readValueFromInstance(e,n){if(At.has(n))return this.projection?.isProjecting?Ie(n):Ho(e,n);{const s=Sl(e),i=(di(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return nr(e,n)}build(e,n,s){An(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Vn(e,n,s)}}const Al={offset:"stroke-dashoffset",array:"stroke-dasharray"},Vl={offset:"strokeDashoffset",array:"strokeDasharray"};function Cl(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?Al:Vl;t[o.offset]=`${-s}`,t[o.array]=`${e} ${n}`}const Ml=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function rr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},u,c,l){if(An(t,a,c),u){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 Ml)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&&Cl(h,i,o,r,!1)}const or=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"]),ar=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Dl(t,e,n,s){sr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(or.has(i)?i:vn(i),e.attrs[i])}function lr(t,e,n){const s=Vn(t,e,n);for(const i in t)if(O(t[i])||O(e[i])){const o=bt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}class El extends Ji{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=k}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(At.has(n)){const s=Wi(n);return s&&s.default||0}return n=or.has(n)?n:vn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return lr(e,n,s)}build(e,n,s){rr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Dl(e,n,s,i)}mount(e){this.isSVGTag=ar(e.tagName),super.mount(e)}}const Rl=bn.length;function ur(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ur(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:s})=>Ea(t,n,s)))}function Il(t){let e=Fl(t),n=us(),s=!0,i=!1;const o=c=>(l,h)=>{const f=Tt(t,h,c==="exit"?t.presenceContext?.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;l={...l,...m,...p}}return l};function r(c){e=c(t)}function a(c){const{props:l}=t,h=ur(t.parent)||{},f=[],d=new Set;let p={},m=1/0;for(let g=0;gm&&b,S=!1;const M=Array.isArray(w)?w:[w];let I=M.reduce(o(x),{});D===!1&&(I={});const{prevResolvedValues:Q={}}=v,X={...Q,...I},tt=B=>{V=!0,d.has(B)&&(S=!0,d.delete(B)),v.needsAnimating[B]=!0;const $=t.getValue(B);$&&($.liveStyle=!1)};for(const B in X){const $=I[B],at=Q[B];if(p.hasOwnProperty(B))continue;let dt=!1;We($)&&We(at)?dt=!cr($,at):dt=$!==at,dt?$!=null?tt(B):d.add(B):$!==void 0&&d.has(B)?tt(B):v.protectedKeys[B]=!0}v.prevProp=w,v.prevResolvedValues=I,v.isActive&&(p={...p,...I}),(s||i)&&t.blockInitialAnimation&&(V=!1);const Y=F&&A;V&&(!Y||S)&&f.push(...M.map(B=>{const $={type:x};if(typeof B=="string"&&(s||i)&&!Y&&t.manuallyAnimateOnMount&&t.parent){const{parent:at}=t,dt=Tt(at,B);if(at.enteringChildren&&dt){const{delayChildren:Fr}=dt.transition||{};$.delay=Li(at.enteringChildren,t,Fr)}}return{animation:B,options:$}}))}if(d.size){const g={};if(typeof l.initial!="boolean"){const x=Tt(t,Array.isArray(l.initial)?l.initial[0]:l.initial);x&&x.transition&&(g.transition=x.transition)}d.forEach(x=>{const v=t.getBaseTarget(x),w=t.getValue(x);w&&(w.liveStyle=!0),g[x]=v??null}),f.push({animation:g})}let y=!!f.length;return s&&(l.initial===!1||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(y=!1),s=!1,i=!1,y?e(f):Promise.resolve()}function u(c,l){if(n[c].isActive===l)return Promise.resolve();t.variantChildren?.forEach(f=>f.animationState?.setActive(c,l)),n[c].isActive=l;const h=a(c);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:a,setActive:u,setAnimateFunction:r,getState:()=>n,reset:()=>{n=us(),i=!0}}}function Bl(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!cr(e,t):!1}function lt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function us(){return{animate:lt(!0),whileInView:lt(),whileHover:lt(),whileTap:lt(),whileDrag:lt(),whileFocus:lt(),exit:lt()}}function cs(t,e){t.min=e.min,t.max=e.max}function z(t,e){cs(t.x,e.x),cs(t.y,e.y)}function hs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const hr=1e-4,jl=1-hr,Ol=1+hr,fr=.01,Nl=0-fr,Ul=0+fr;function U(t){return t.max-t.min}function Wl(t,e,n){return Math.abs(t-e)<=n}function fs(t,e,n,s=.5){t.origin=s,t.originPoint=E(e.min,e.max,t.origin),t.scale=U(n)/U(e),t.translate=E(n.min,n.max,t.origin)-t.originPoint,(t.scale>=jl&&t.scale<=Ol||isNaN(t.scale))&&(t.scale=1),(t.translate>=Nl&&t.translate<=Ul||isNaN(t.translate))&&(t.translate=0)}function Rt(t,e,n,s){fs(t.x,e.x,n.x,s?s.originX:void 0),fs(t.y,e.y,n.y,s?s.originY:void 0)}function ds(t,e,n){t.min=n.min+e.min,t.max=t.min+U(e)}function $l(t,e,n){ds(t.x,e.x,n.x),ds(t.y,e.y,n.y)}function ps(t,e,n){t.min=e.min-n.min,t.max=t.min+U(e)}function oe(t,e,n){ps(t.x,e.x,n.x),ps(t.y,e.y,n.y)}function ms(t,e,n,s,i){return t-=e,t=re(t,1/n,s),i!==void 0&&(t=re(t,1/i,s)),t}function Kl(t,e=0,n=1,s=.5,i,o=t,r=t){if(Z.test(e)&&(e=parseFloat(e),e=E(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=E(o.min,o.max,s);t===o&&(a-=e),t.min=ms(t.min,e,n,a,i),t.max=ms(t.max,e,n,a,i)}function gs(t,e,[n,s,i],o,r){Kl(t,e[n],e[s],e[i],e.scale,o,r)}const Hl=["x","scaleX","originX"],zl=["y","scaleY","originY"];function ys(t,e,n,s){gs(t.x,e,Hl,n?n.x:void 0,s?s.x:void 0),gs(t.y,e,zl,n?n.y:void 0,s?s.y:void 0)}function vs(t){return t.translate===0&&t.scale===1}function dr(t){return vs(t.x)&&vs(t.y)}function xs(t,e){return t.min===e.min&&t.max===e.max}function Gl(t,e){return xs(t.x,e.x)&&xs(t.y,e.y)}function Ts(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function pr(t,e){return Ts(t.x,e.x)&&Ts(t.y,e.y)}function ws(t){return U(t.x)/U(t.y)}function Ps(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function q(t){return[t("x"),t("y")]}function _l(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:c,rotate:l,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;c&&(s=`perspective(${c}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,u=t.y.scale*e.y;return(a!==1||u!==1)&&(s+=`scale(${a}, ${u})`),s||"none"}const mr=["TopLeft","TopRight","BottomLeft","BottomRight"],Xl=mr.length,Ss=t=>typeof t=="string"?parseFloat(t):t,bs=t=>typeof t=="number"||P.test(t);function Yl(t,e,n,s,i,o){i?(t.opacity=E(0,n.opacity??1,ql(s)),t.opacityExit=E(e.opacity??1,0,Zl(s))):o&&(t.opacity=E(e.opacity??1,n.opacity??1,s));for(let r=0;rse?1:n(kt(t,e,s))}function Jl(t,e,n){const s=O(t)?t:Pt(t);return s.start(gn("",s,e,n)),s.animation}function Bt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Ql=(t,e)=>t.depth-e.depth;class tu{constructor(){this.children=[],this.isDirty=!1}add(e){tn(this.children,e),this.isDirty=!0}remove(e){te(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ql),this.isDirty=!1,this.children.forEach(e)}}function eu(t,e){const n=N.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(rt(s),t(o-e))};return C.setup(s,!0),()=>rt(s)}function Jt(t){return O(t)?t.get():t}class nu{constructor(){this.members=[]}add(e){tn(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&&(te(this.members,s),s.unmount())}e.scheduleRender()}remove(e){if(te(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:o}=e.options;(i===void 0||i!==o)&&(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 Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1},we=["","X","Y","Z"],su=1e3;let iu=0;function Pe(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function yr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ji(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",C,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&yr(s)}function vr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e?.()){this.id=iu++,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(au),this.nodes.forEach(hu),this.nodes.forEach(fu),this.nodes.forEach(lu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,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 u=0;uthis.root.updateBlockedByResize=!1;C.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,l&&l(),l=eu(f,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(Ms)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||u)&&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||c.getDefaultTransition()||yu,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=c.getProps(),g=!this.targetLayout||!pr(this.targetLayout,d),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...mn(p,"layout"),onPlay:m,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(l,x)}else h||Ms(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),rt(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(du),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!U(this.snapshot.measuredBox.x)&&!U(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 u=0;u{const b=w/1e3;Ds(h.x,r.x,b),Ds(h.y,r.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(oe(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mu(this.relativeTarget,this.relativeTargetOrigin,f,b),v&&Gl(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=k()),z(v,this.relativeTarget)),m&&(this.animationValues=l,Yl(l,c,this.latestValues,b,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(rt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=C.update(()=>{Qt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Pt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Jl(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(su),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:u,layout:c,latestValues:l}=r;if(!(!a||!u||!c)){if(this!==r&&this.layout&&c&&xr(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||k();const h=U(this.layout.layoutBox.x);u.x.min=r.target.x.min,u.x.max=u.x.min+h;const f=U(this.layout.layoutBox.y);u.y.min=r.target.y.min,u.y.max=u.y.min+f}z(a,u),xt(a,l),Rt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new nu),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:u}=r;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;const c={};u.z&&Pe("z",r,c,this.animationValues);for(let l=0;lr.currentAnimation?.stop()),this.root.nodes.forEach(Vs),this.root.sharedNodes.clear()}}}function ru(t){t.updateLayout()}function ou(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,o=e.source!==t.layout.source;i==="size"?q(l=>{const h=o?e.measuredBox[l]:e.layoutBox[l],f=U(h);h.min=n[l].min,h.max=h.min+f}):xr(i,e.layoutBox,n)&&q(l=>{const h=o?e.measuredBox[l]:e.layoutBox[l],f=U(n[l]);h.max=h.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[l].max=t.relativeTarget[l].min+f)});const r=yt();Rt(r,n,e.layoutBox);const a=yt();o?Rt(a,t.applyTransform(s,!0),e.measuredBox):Rt(a,n,e.layoutBox);const u=!dr(r);let c=!1;if(!t.resumeFrom){const l=t.getClosestProjectingParent();if(l&&!l.resumeFrom){const{snapshot:h,layout:f}=l;if(h&&f){const d=k();oe(d,e.layoutBox,h.layoutBox);const p=k();oe(p,n,f.layoutBox),pr(d,p)||(c=!0),l.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=d,t.relativeParent=l)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function au(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 lu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function uu(t){t.clearSnapshot()}function Vs(t){t.clearMeasurements()}function Cs(t){t.isLayoutDirty=!1}function cu(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ms(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function hu(t){t.resolveTargetDelta()}function fu(t){t.calcProjection()}function du(t){t.resetSkewAndRotation()}function pu(t){t.removeLeadSnapshot()}function Ds(t,e,n){t.translate=E(e.translate,0,n),t.scale=E(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Es(t,e,n,s){t.min=E(e.min,n.min,s),t.max=E(e.max,n.max,s)}function mu(t,e,n,s){Es(t.x,e.x,n.x,s),Es(t.y,e.y,n.y,s)}function gu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const yu={duration:.45,ease:[.4,0,.1,1]},Rs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ls=Rs("applewebkit/")&&!Rs("chrome/")?Math.round:H;function ks(t){t.min=Ls(t.min),t.max=Ls(t.max)}function vu(t){ks(t.x),ks(t.y)}function xr(t,e,n){return t==="position"||t==="preserve-aspect"&&!Wl(ws(e),ws(n),.2)}function xu(t){return t!==t.root&&t.scroll?.wasRoot}const Tu=vr({attachResizeListener:(t,e)=>Bt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Se={current:void 0},Tr=vr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Se.current){const t=new Tu({});t.mount(window),t.setOptions({layoutScroll:!0}),Se.current=t}return Se.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Cn=T.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Fs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function wu(...t){return e=>{let n=!1;const s=t.map(i=>{const o=Fs(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{const{width:f,height:d,top:p,left:m,right:y,bottom:g}=u.current;if(e||o===!1||!a.current||!f||!d)return;const x=n==="left"?`left: ${m}`:`right: ${y}`,v=s==="bottom"?`bottom: ${g}`:`top: ${p}`;a.current.dataset.motionPopId=r;const w=document.createElement("style");c&&(w.nonce=c);const b=i??document.head;return b.appendChild(w),w.sheet&&w.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${f}px !important; height: ${d}px !important; ${x}px !important; ${v}px !important; } `),()=>{b.contains(w)&&b.removeChild(w)}},[e]),et.jsx(Su,{isPresent:e,childRef:a,sizeRef:u,pop:o,children:o===!1?t:T.cloneElement(t,{ref:h})})}const Au=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a,anchorY:u,root:c})=>{const l=Qe(Vu),h=T.useId();let f=!0,d=T.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 o&&f&&(d={...d}),T.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),T.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),t=et.jsx(bu,{pop:r==="popLayout",isPresent:n,anchorX:a,anchorY:u,root:c,children:t}),et.jsx(le.Provider,{value:d,children:t})};function Vu(){return new Map}function wr(t=!0){const e=T.useContext(le);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=T.useId();T.useEffect(()=>{if(t)return i(o)},[t]);const r=T.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Kt=t=>t.key||"";function Is(t){const e=[];return T.Children.forEach(t,n=>{T.isValidElement(n)&&e.push(n)}),e}const jc=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",anchorY:u="top",root:c})=>{const[l,h]=wr(r),f=T.useMemo(()=>Is(t),[t]),d=r&&!l?[]:f.map(Kt),p=T.useRef(!0),m=T.useRef(f),y=Qe(()=>new Map),g=T.useRef(new Set),[x,v]=T.useState(f),[w,b]=T.useState(f);Ys(()=>{p.current=!1,m.current=f;for(let A=0;A{const V=Kt(A),S=r&&!l?!1:f===w||d.includes(V),M=()=>{if(g.current.has(V))return;if(g.current.add(V),y.has(V))y.set(V,!0);else return;let I=!0;y.forEach(Q=>{Q||(I=!1)}),I&&(F?.(),b(m.current),r&&h?.(),s&&s())};return et.jsx(Au,{isPresent:S,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,root:c,onExitComplete:S?void 0:M,anchorX:a,anchorY:u,children:A},V)})})},Pr=T.createContext({strict:!1}),Bs={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 js=!1;function Cu(){if(js)return;const t={};for(const e in Bs)t[e]={isEnabled:n=>Bs[e].some(s=>!!n[s])};Zi(t),js=!0}function Sr(){return Cu(),dl()}function Mu(t){const e=Sr();for(const n in t)e[n]={...e[n],...t[n]};Zi(e)}const Du=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 ae(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Du.has(t)}let br=t=>!ae(t);function Eu(t){typeof t=="function"&&(br=e=>e.startsWith("on")?!ae(e):t(e))}try{Eu(require("@emotion/is-prop-valid").default)}catch{}function Ru(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(br(i)||n===!0&&ae(i)||!e&&!ae(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const he=T.createContext({});function Lu(t,e){if(ce(t)){const{initial:n,animate:s}=t;return{initial:n===!1||It(n)?n:void 0,animate:It(s)?s:void 0}}return t.inherit!==!1?e:{}}function ku(t){const{initial:e,animate:n}=Lu(t,T.useContext(he));return T.useMemo(()=>({initial:e,animate:n}),[Os(e),Os(n)])}function Os(t){return Array.isArray(t)?t.join(" "):t}const Mn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ar(t,e,n){for(const s in e)!O(e[s])&&!ir(s,n)&&(t[s]=e[s])}function Fu({transformTemplate:t},e){return T.useMemo(()=>{const n=Mn();return An(n,e,t),Object.assign({},n.vars,n.style)},[e])}function Iu(t,e){const n=t.style||{},s={};return Ar(s,n,t),Object.assign(s,Fu(t,e)),s}function Bu(t,e){const n={},s=Iu(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 Vr=()=>({...Mn(),attrs:{}});function ju(t,e,n,s){const i=T.useMemo(()=>{const o=Vr();return rr(o,e,ar(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ar(o,t.style,t),i.style={...o,...i.style}}return i}const Ou=["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 Dn(t){return typeof t!="string"||t.includes("-")?!1:!!(Ou.indexOf(t)>-1||/[A-Z]/u.test(t))}function Nu(t,e,n,{latestValues:s},i,o=!1,r){const u=(r??Dn(t)?ju:Bu)(e,s,i,t),c=Ru(e,typeof t=="string",o),l=t!==T.Fragment?{...c,...u,ref:n}:{},{children:h}=e,f=T.useMemo(()=>O(h)?h.get():h,[h]);return T.createElement(t,{...l,children:f})}function Uu({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Wu(n,s,i,t),renderState:e()}}function Wu(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Jt(o[f]);let{initial:r,animate:a}=t;const u=ce(t),c=Yi(t);e&&c&&!u&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let l=n?n.initial===!1:!1;l=l||r===!1;const h=l?a:r;if(h&&typeof h!="boolean"&&!ue(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d(e,n)=>{const s=T.useContext(he),i=T.useContext(le),o=()=>Uu(t,e,s,i);return n?o():Qe(o)},$u=Cr({scrapeMotionValuesFromProps:Vn,createRenderState:Mn}),Ku=Cr({scrapeMotionValuesFromProps:lr,createRenderState:Vr}),Hu=Symbol.for("motionComponentSymbol");function zu(t,e,n){const s=T.useRef(n);T.useInsertionEffect(()=>{s.current=n});const i=T.useRef(null);return T.useCallback(o=>{o&&t.onMount?.(o);const r=s.current;if(typeof r=="function")if(o){const a=r(o);typeof a=="function"&&(i.current=a)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o);e&&(o?e.mount(o):e.unmount())},[e])}const Mr=T.createContext({});function pt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Gu(t,e,n,s,i,o){const{visualElement:r}=T.useContext(he),a=T.useContext(Pr),u=T.useContext(le),c=T.useContext(Cn),l=c.reducedMotion,h=c.skipAnimations,f=T.useRef(null),d=T.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(t,{visualState:e,parent:r,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:l,skipAnimations:h,isSVG:o}),d.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,m=T.useContext(Mr);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&_u(f.current,n,i,m);const y=T.useRef(!1);T.useInsertionEffect(()=>{p&&y.current&&p.update(n,u)});const g=n[Bi],x=T.useRef(!!g&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return Ys(()=>{d.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),x.current&&p.animationState&&p.animationState.animateChanges())}),T.useEffect(()=>{p&&(!x.current&&p.animationState&&p.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),x.current=!1),p.enteringChildren=void 0)}),p}function _u(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:u,layoutRoot:c,layoutCrossfade:l}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Dr(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&pt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:l,layoutScroll:u,layoutRoot:c})}function Dr(t){if(t)return t.options.allowProjection!==!1?t.projection:Dr(t.parent)}function be(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&Mu(s);const o=n?n==="svg":Dn(t),r=o?Ku:$u;function a(c,l){let h;const f={...T.useContext(Cn),...c,layoutId:Xu(c)},{isStatic:d}=f,p=ku(c),m=r(c,d);if(!d&&typeof window<"u"){Yu();const y=qu(f);h=y.MeasureLayout,p.visualElement=Gu(t,m,f,i,y.ProjectionNode,o)}return et.jsxs(he.Provider,{value:p,children:[h&&p.visualElement?et.jsx(h,{visualElement:p.visualElement,...f}):null,Nu(t,c,zu(m,p.visualElement,l),m,d,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const u=T.forwardRef(a);return u[Hu]=t,u}function Xu({layoutId:t}){const e=T.useContext(Je).id;return e&&t!==void 0?e+"-"+t:t}function Yu(t,e){T.useContext(Pr).strict}function qu(t){const e=Sr(),{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 Zu(t,e){if(typeof Proxy>"u")return be;const n=new Map,s=(o,r)=>be(o,r,t,e),i=(o,r)=>s(o,r);return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,be(r,void 0,t,e)),n.get(r))})}const Ju=(t,e)=>e.isSVG??Dn(t)?new El(e):new bl(e,{allowProjection:t!==T.Fragment});class Qu extends ot{constructor(e){super(e),e.animationState||(e.animationState=Il(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();ue(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 tc=0;class ec extends ot{constructor(){super(...arguments),this.id=tc++}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 nc={animation:{Feature:Qu},exit:{Feature:ec}};function Ut(t){return{point:{x:t.pageX,y:t.pageY}}}const sc=t=>e=>wn(e)&&t(e,Ut(e));function Lt(t,e,n,s){return Bt(t,e,sc(n),s)}const Er=({current:t})=>t?t.ownerDocument.defaultView:null,Ns=(t,e)=>Math.abs(t-e);function ic(t,e){const n=Ns(t.x,e.x),s=Ns(t.y,e.y);return Math.sqrt(n**2+s**2)}const Us=new Set(["auto","scroll"]);class Rr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=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=Ht(this.lastRawMoveEventInfo,this.transformPagePoint));const d=Ae(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=ic(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:y}=d,{timestamp:g}=j;this.history.push({...y,timestamp:g});const{onStart:x,onMove:v}=this.handlers;p||(x&&x(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastRawMoveEventInfo=p,this.lastMoveEventInfo=Ht(p,this.transformPagePoint),C.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ae(d.type==="pointercancel"?this.lastMoveEventInfo:Ht(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,x),y&&y(d,x)},!wn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const u=Ut(e),c=Ht(u,this.transformPagePoint),{point:l}=c,{timestamp:h}=j;this.history=[{...l,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,Ae(c,this.history)),this.removeListeners=jt(Lt(this.contextWindow,"pointermove",this.handlePointerMove),Lt(this.contextWindow,"pointerup",this.handlePointerUp),Lt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(Us.has(s.overflowX)||Us.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},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,i),C.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),rt(this.updatePoint)}}function Ht(t,e){return e?{point:e(t.point)}:t}function Ws(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ae({point:t},e){return{point:t,delta:Ws(t,Lr(e)),offset:Ws(t,rc(e)),velocity:oc(e,.1)}}function rc(t){return t[0]}function Lr(t){return t[t.length-1]}function oc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Lr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>W(e)));)n--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&i.timestamp-s.timestamp>W(e)*2&&(s=t[1]);const o=K(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function ac(t,{min:e,max:n},s){return e!==void 0&&tn&&(t=s?E(n,t,s.max):Math.min(t,n)),t}function $s(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 lc(t,{top:e,left:n,bottom:s,right:i}){return{x:$s(t.x,n,i),y:$s(t.y,e,s)}}function Ks(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=kt(e.min,e.max-s,t.min):s>i&&(n=kt(t.min,t.max-i,e.min)),J(0,1,n)}function hc(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 qe=.35;function fc(t=qe){return t===!1?t=0:t===!0&&(t=qe),{x:Hs(t,"left","right"),y:Hs(t,"top","bottom")}}function Hs(t,e,n){return{min:zs(t,e),max:zs(t,n)}}function zs(t,e){return typeof t=="number"?t:t[e]||0}const dc=new WeakMap;class pc{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=k(),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 o=h=>{n&&this.snapToCursor(Ut(h).point),this.stopAnimation()},r=(h,f)=>{const{drag:d,dragPropagation:p,onDragStart:m}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ka(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),q(g=>{let x=this.getAxisMotionValue(g).get()||0;if(Z.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const w=v.layout.layoutBox[g];w&&(x=U(w)*(parseFloat(x)/100))}}this.originPoint[g]=x}),m&&C.update(()=>m(h,f),!1,!0),$e(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:g}=f;if(p&&this.currentDirection===null){this.currentDirection=gc(g),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),y&&C.update(()=>y(h,f),!1,!0)},u=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Rr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:s,contextWindow:Er(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&C.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||!zt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=ac(r,this.constraints[e],this.elastic[e])),o.set(r)}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&&pt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=lc(s.layoutBox,e):this.constraints=!1,this.elastic=fc(n),i!==this.constraints&&!pt(e)&&s&&this.constraints&&!this.hasMutatedConstraints&&q(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=hc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!pt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=vl(s,i.root,this.visualElement.getTransformPagePoint());let r=uc(i.layout.layoutBox,o);if(n){const a=n(ml(r));this.hasMutatedConstraints=!!a,a&&(r=Qi(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=q(l=>{if(!zt(l,n,this.currentDirection))return;let h=u&&u[l]||{};r&&(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,...o,...h};return this.startAxisValueAnimation(l,p)});return Promise.all(c).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return $e(this.visualElement,e),s.start(gn(e,s,0,n,this.visualElement,!1))}stopAnimation(){q(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){q(n=>{const{drag:s}=this.getProps();if(!zt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],u=o.get()||0;o.set(e[n]-E(r,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!pt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};q(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const u=a.get();i[r]=cc({min:u,max:u},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),q(r=>{if(!zt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:u,max:c}=this.constraints[r];a.set(E(u,c,i[r]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;dc.set(this.visualElement,this);const e=this.visualElement.current,n=Lt(e,"pointerdown",c=>{const{drag:l,dragListener:h=!0}=this.getProps(),f=c.target,d=f!==e&&Ya(f);l&&h&&!d&&this.start(c)});let s;const i=()=>{const{dragConstraints:c}=this.getProps();pt(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),s||(s=mc(e,c.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,r=o.addEventListener("measure",i);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),C.read(i);const a=Bt(window,"resize",()=>this.scalePositionWithinConstraints()),u=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(q(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=c[h].translate,f.set(f.get()+c[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),r(),u&&u(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=qe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Gs(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function mc(t,e,n){const s=Jn(t,Gs(n)),i=Jn(e,Gs(n));return()=>{s(),i()}}function zt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function gc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class yc extends ot{constructor(e){super(e),this.removeGroupControls=H,this.removeListeners=H,this.controls=new pc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||H}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 Ve=t=>(e,n)=>{t&&C.update(()=>t(e,n),!1,!0)};class vc extends ot{constructor(){super(...arguments),this.removePointerDownListener=H}onPointerDown(e){this.session=new Rr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Er(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ve(e),onStart:Ve(n),onMove:Ve(s),onEnd:(o,r)=>{delete this.session,i&&C.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Lt(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 Ce=!1;class xc extends T.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),Ce&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,e.layoutDependency!==n&&r.setOptions({...r.options,layoutDependency:n}),Ce=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||C.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Tn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;Ce=!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 kr(t){const[e,n]=wr(),s=T.useContext(Je);return et.jsx(xc,{...t,layoutGroup:s,switchLayoutGroup:T.useContext(Mr),isPresent:e,safeToRemove:n})}const Tc={pan:{Feature:vc},drag:{Feature:yc,ProjectionNode:Tr,MeasureLayout:kr}};function _s(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&C.postRender(()=>o(e,Ut(e)))}class wc extends ot{mount(){const{current:e}=this.node;e&&(this.unmount=za(e,(n,s)=>(_s(this.node,s,"Start"),i=>_s(this.node,i,"End"))))}unmount(){}}class Pc extends ot{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=jt(Bt(this.node.current,"focus",()=>this.onFocus()),Bt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Xs(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),o=s[i];o&&C.postRender(()=>o(e,Ut(e)))}class Sc extends ot{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=Za(e,(i,o)=>(Xs(this.node,o,"Start"),(r,{success:a})=>Xs(this.node,r,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:s?.tap===!1})}unmount(){}}const Ze=new WeakMap,Me=new WeakMap,bc=t=>{const e=Ze.get(t.target);e&&e(t)},Ac=t=>{t.forEach(bc)};function Vc({root:t,...e}){const n=t||document;Me.has(n)||Me.set(n,{});const s=Me.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ac,{root:t,...e})),s[i]}function Cc(t,e,n){const s=Vc(e);return Ze.set(t,n),s.observe(t),()=>{Ze.delete(t),s.unobserve(t)}}const Mc={some:0,all:1};class Dc extends ot{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:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Mc[i]},a=u=>{const{isIntersecting:c}=u;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:l,onViewportLeave:h}=this.node.getProps(),f=c?l:h;f&&f(u)};return Cc(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Ec(e,n))&&this.startObserver()}unmount(){}}function Ec({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Rc={inView:{Feature:Dc},tap:{Feature:Sc},focus:{Feature:Pc},hover:{Feature:wc}},Lc={layout:{ProjectionNode:Tr,MeasureLayout:kr}},kc={...nc,...Rc,...Tc,...Lc},Oc=Zu(kc,Ju);export{jc as A,et as j,Oc as m};