import{j as t}from"./chunk-BcMzut3W.js";import{a as e}from"./chunk-CLN-lmR0.js";const n=e.createContext({});function i(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const s="undefined"!=typeof window,o=s?e.useLayoutEffect:e.useEffect,r=e.createContext(null);function a(t,e){-1===t.indexOf(e)&&t.push(e)}function l(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const u=(t,e,n)=>n>e?e:n/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function d(t){return"object"==typeof t&&null!==t}const p=t=>/^0[^.\s]+$/u.test(t);function m(t){let e;return()=>(void 0===e&&(e=t()),e)}const f=t=>t,g=(t,e)=>n=>e(t(n)),y=(...t)=>t.reduce(g),v=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class x{constructor(){this.subscriptions=[]}add(t){return a(this.subscriptions,t),()=>l(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s1e3*t,w=t=>t/1e3;function P(t,e){return e?t*(1e3/e):0}const S=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function b(t,e,n,i){if(t===e&&n===i)return f;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=S(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:S(s(t),e,i)}const A=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,E=t=>e=>1-t(1-e),C=b(.33,1.53,.69,.99),M=E(C),V=A(M),D=t=>(t*=2)<1?.5*M(t):.5*(2-Math.pow(2,-10*(t-1))),k=t=>1-Math.sin(Math.acos(t)),R=E(k),L=A(k),j=b(.42,0,1,1),B=b(0,0,.58,1),F=b(.42,0,.58,1),O=t=>Array.isArray(t)&&"number"==typeof t[0],I={linear:f,easeIn:j,easeInOut:F,easeOut:B,circIn:k,circInOut:L,circOut:R,backIn:M,backInOut:V,backOut:C,anticipate:D},U=t=>{if(O(t)){t.length;const[e,n,i,s]=t;return b(e,n,i,s)}return"string"==typeof t?I[t]:t},N=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function W(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=N.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{r=t,i?s=!0:(i=!0,[e,n]=[n,e],e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t)))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:p,render:m,postRender:f}=r,g=()=>{const o=h.useManualTiming?s.timestamp:performance.now();n=!1,h.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(g))};return{schedule:N.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(g)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e(void 0===K&&G.set(Y.isProcessing||h.useManualTiming?Y.timestamp:performance.now()),K),set:t=>{K=t,queueMicrotask(H)}},q=t=>e=>"string"==typeof e&&e.startsWith(t),Z=q("--"),_=q("var(--"),J=t=>!!_(t)&&Q.test(t.split("/*")[0].trim()),Q=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},et={...tt,transform:t=>u(0,1,t)},nt={...tt,default:1},it=t=>Math.round(1e5*t)/1e5,st=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ot=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rt=(t,e)=>n=>Boolean("string"==typeof n&&ot.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(st);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},lt={...tt,transform:t=>Math.round((t=>u(0,255,t))(t))},ut={test:rt("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+lt.transform(t)+", "+lt.transform(e)+", "+lt.transform(n)+", "+it(et.transform(i))+")"};const ht={test:rt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:ut.transform},ct=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),dt=ct("deg"),pt=ct("%"),mt=ct("px"),ft=ct("vh"),gt=ct("vw"),yt=(()=>({...pt,parse:t=>pt.parse(t)/100,transform:t=>pt.transform(100*t)}))(),vt={test:rt("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+pt.transform(it(e))+", "+pt.transform(it(n))+", "+it(et.transform(i))+")"},xt={test:t=>ut.test(t)||ht.test(t)||vt.test(t),parse:t=>ut.test(t)?ut.parse(t):vt.test(t)?vt.parse(t):ht.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?ut.transform(t):vt.transform(t),getAnimatableNone:t=>{const e=xt.parse(t);return e.alpha=0,xt.transform(e)}},Tt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const wt="number",Pt="color",St=/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 bt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(St,t=>(xt.test(t)?(i.color.push(o),s.push(Pt),n.push(xt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(wt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function At(t){return bt(t).values}function Et(t){const{split:e,types:n}=bt(t),i=e.length;return t=>{let s="";for(let o=0;o"number"==typeof t?0:xt.test(t)?xt.getAnimatableNone(t):t;const Mt={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null==(e=t.match(st))?void 0:e.length)||0)+((null==(n=t.match(Tt))?void 0:n.length)||0)>0},parse:At,createTransformer:Et,getAnimatableNone:function(t){const e=At(t);return Et(t)(e.map(Ct))}};function Vt(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Dt(t,e){return n=>n>0?e:t}const kt=(t,e,n)=>t+(e-t)*n,Rt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Lt=[ht,ut,vt];function jt(t){const e=(n=t,Lt.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===vt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Vt(a,i,t+1/3),o=Vt(a,i,t),r=Vt(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Bt=(t,e)=>{const n=jt(t),i=jt(e);if(!n||!i)return Dt(t,e);const s={...n};return t=>(s.red=Rt(n.red,i.red,t),s.green=Rt(n.green,i.green,t),s.blue=Rt(n.blue,i.blue,t),s.alpha=kt(n.alpha,i.alpha,t),ut.transform(s))},Ft=new Set(["none","hidden"]);function Ot(t,e){return n=>kt(t,e,n)}function It(t){return"number"==typeof t?Ot:"string"==typeof t?J(t)?Dt:xt.test(t)?Bt:Wt:Array.isArray(t)?Ut:"object"==typeof t?xt.test(t)?Bt:Nt:Dt}function Ut(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>It(t)(t,e[n]));return t=>{for(let e=0;e{for(const e in i)n[e]=i[e](t);return n}}const Wt=(t,e)=>{const n=Mt.createTransformer(e),i=bt(t),s=bt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ft.has(t)&&!s.values.length||Ft.has(e)&&!i.values.length?function(t,e){return Ft.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):y(Ut(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>$.update(e,t),stop:()=>X(e),now:()=>Y.isProcessing?Y.timestamp:G.now()}},Yt=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let o=0;o=zt?1/0:e}function Ht(t,e,n){const i=Math.max(e-5,0);return P(n-t(i),e-i)}const Gt=100,qt=10,Zt=1,_t=0,Jt=800,Qt=.3,te=.3,ee={granular:.01,default:2},ne={granular:.005,default:.5},ie=.01,se=10,oe=.05,re=1,ae=.001;function le({duration:t=Jt,bounce:e=Qt,velocity:n=_t,mass:i=Zt}){let s,o,r=1-e;r=u(oe,re,r),t=u(ie,se,w(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=he(e,r),l=Math.exp(-s);return ae-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=he(Math.pow(e,2),r);return(-s(e)+ae>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let s=1;svoid 0!==t[e])}function me(t=te,e=Qt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:_t,stiffness:Gt,damping:qt,mass:Zt,isResolvedFromDuration:!1,...t};if(!pe(t,de)&&pe(t,ce))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*u(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Zt,stiffness:s,damping:o}}else{const n=le(t);e={...e,...n,mass:Zt},e.isResolvedFromDuration=!0}return e}({...n,velocity:-w(n.velocity||0)}),f=p||0,g=h/(2*Math.sqrt(l*c)),y=r-o,v=w(Math.sqrt(l/c)),x=Math.abs(y)<5;let P;if(i||(i=x?ee.granular:ee.default),s||(s=x?ne.granular:ne.default),g<1){const t=he(v,g);P=e=>{const n=Math.exp(-g*v*e);return r-n*((f+g*v*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===g)P=t=>r-Math.exp(-v*t)*(y+(f+v*y)*t);else{const t=v*Math.sqrt(g*g-1);P=e=>{const n=Math.exp(-g*v*e),i=Math.min(t*e,300);return r-n*((f+g*v*y)*Math.sinh(i)+t*y*Math.cosh(i))/t}}const S={calculatedDuration:m&&d||null,next:t=>{const e=P(t);if(m)a.done=t>=d;else{let n=0===t?f:0;g<1&&(n=0===t?T(f):Ht(P,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(Kt(S),zt),e=Yt(e=>S.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return S}function fe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let T,w;const P=t=>{var e;(e=d.value,void 0!==a&&el)&&(T=t,w=me({keyframes:[d.value,p(d.value)],velocity:Ht(v,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:h}))};return P(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==T||(e=!0,x(t),P(t)),void 0!==T&&t>=T?w.next(t-T):(!e&&x(t),d)}}}function ge(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(e.length,1===o)return()=>e[0];if(2===o&&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=function(t,e,n){const i=[],s=n||h.mix||$t,o=t.length-1;for(let r=0;r{if(r&&n1)for(;ic(u(t[0],t[o-1],e)):c}function ye(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=v(0,e,i);t.push(kt(n,1,s))}}(e,t.length-1),e}function ve({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(U):U(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ye(e),t),a=ge(r,e,{ease:Array.isArray(s)?s:(l=e,u=s,l.map(()=>u||F).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}me.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(Kt(i),zt);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:w(s)}}(t,100,me);return t.ease=e.ease,t.duration=T(e.duration),t.type="keyframes",t};const xe=t=>null!==t;function Te(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(xe),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const we={decay:fe,inertia:fe,tween:ve,keyframes:ve,spring:me};function Pe(t){"string"==typeof t.type&&(t.type=we[t.type])}class Se{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const be=t=>t/100;class Ae extends Se{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var t,e;const{motionValue:n}=this.options;n&&n.updatedAt!==G.now()&&this.tick(G.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),null==(e=(t=this.options).onStop)||e.call(t))},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Pe(t);const{type:e=ve,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||ve;a!==ve&&"number"!=typeof r[0]&&(this.mixKeyframes=y(be,$t(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=Kt(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x=this.currentTime,T=n;if(c){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/r)):"mirror"===d&&(T=o)),x=u(0,1,n)*r}const w=v?{done:!1,value:h[0]}:T.next(x);s&&(w.value=s(w.value));let{done:P}=w;v||null===a||(P=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&P);return S&&m!==fe&&(w.value=Te(h,this.options,g,this.speed)),f&&f(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return w(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+w(t)}get time(){return w(this.currentTime)}set time(t){var e;t=T(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),null==(e=this.driver)||e.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(G.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=w(this.currentTime))}play(){var t,e;if(this.isStopped)return;const{driver:n=Xt,startTime:i}=this.options;this.driver||(this.driver=n(t=>this.tick(t))),null==(e=(t=this.options).onPlay)||e.call(t);const s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime||(this.startTime=i??s),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(G.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,e;this.notifyFinished(),this.teardown(),this.state="finished",null==(e=(t=this.options).onComplete)||e.call(t)}cancel(){var t,e;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),null==(e=(t=this.options).onCancel)||e.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var e;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),null==(e=this.driver)||e.stop(),t.observe(this)}}const Ee=t=>180*t/Math.PI,Ce=t=>{const e=Ee(Math.atan2(t[1],t[0]));return Ve(e)},Me={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ce,rotateZ:Ce,skewX:t=>Ee(Math.atan(t[1])),skewY:t=>Ee(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ve=t=>((t%=360)<0&&(t+=360),t),De=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ke=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Re={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:De,scaleY:ke,scale:t=>(De(t)+ke(t))/2,rotateX:t=>Ve(Ee(Math.atan2(t[6],t[5]))),rotateY:t=>Ve(Ee(Math.atan2(-t[2],t[0]))),rotateZ:Ce,rotate:Ce,skewX:t=>Ee(Math.atan(t[4])),skewY:t=>Ee(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Le(t){return t.includes("scale")?1:0}function je(t,e){if(!t||"none"===t)return Le(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=Re,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Me,s=e}if(!s)return Le(e);const o=i[e],r=s[1].split(",").map(Be);return"function"==typeof o?o(r):r[o]}function Be(t){return parseFloat(t.trim())}const Fe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Oe=(()=>new Set(Fe))(),Ie=t=>t===tt||t===mt,Ue=new Set(["x","y","z"]),Ne=Fe.filter(t=>!Ue.has(t));const We={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})=>je(e,"x"),y:(t,{transform:e})=>je(e,"y")};We.translateX=We.x,We.translateY=We.y;const $e=new Set;let Xe=!1,Ye=!1,ze=!1;function Ke(){if(Ye){const t=Array.from($e).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return Ne.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{var i;null==(i=t.getValue(e))||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ye=!1,Xe=!1,$e.forEach(t=>t.complete(ze)),$e.clear()}function He(){$e.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ye=!0)})}class Ge{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?($e.add(this),Xe||(Xe=!0,$.read(He),$.resolveKeyframes(Ke))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;evoid 0!==window.ScrollTimeline),Ze={};function _e(t,e){const n=m(t);return()=>Ze[e]??n()}const Je=_e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Qe=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,tn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qe([0,.65,.55,1]),circOut:Qe([.55,0,1,.45]),backIn:Qe([.31,.01,.66,-.59]),backOut:Qe([.33,1.53,.69,.99])};function en(t,e){return t?"function"==typeof t?Je()?Yt(t,e):"ease-out":O(t)?Qe(t):Array.isArray(t)?t.map(t=>en(t,e)||tn.easeOut):tn[t]:void 0}function nn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const h={[e]:n};l&&(h.offset=l);const c=en(a,s);Array.isArray(c)&&(h.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};u&&(d.pseudoElement=u);return t.animate(h,d)}function sn(t){return"function"==typeof t&&"applyToOptions"in t}class on extends Se{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,t.type;const l=function({type:t,...e}){return sn(t)&&Je()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=nn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Te(i,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}null==a||a(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,e;null==(e=(t=this.animation).finish)||e.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,e;this.isPseudoElement||null==(e=(t=this.animation).commitStyles)||e.call(t)}get duration(){var t,e;const n=(null==(e=null==(t=this.animation.effect)?void 0:t.getComputedTiming)?void 0:e.call(t).duration)||0;return w(Number(n))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+w(t)}get time(){return w(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=T(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){var n;return this.allowFlatten&&(null==(n=this.animation.effect)||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&qe()?(this.animation.timeline=t,f):e(this)}}const rn={anticipate:D,backInOut:V,circInOut:L};function an(t){"string"==typeof t.ease&&t.ease in rn&&(t.ease=rn[t.ease])}class ln extends on{constructor(t){an(t),Pe(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Ae({...o,autoplay:!1}),a=T(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const un=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Mt.test(t)&&"0"!==t||t.startsWith("url(")));function hn(t){t.duration=0,t.type="keyframes"}const cn=new Set(["opacity","clipPath","filter","transform"]),dn=m(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class pn extends Se{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:u,...h}){var c;super(),this.stop=()=>{var t,e;this._animation&&(this._animation.stop(),null==(t=this.stopTimeline)||t.call(this)),null==(e=this.keyframeResolver)||e.cancel()},this.createdAt=G.now();const d={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:u,...h},p=(null==u?void 0:u.KeyframeResolver)||Ge;this.keyframeResolver=new p(r,(t,e,n)=>this.onKeyframesResolved(t,e,d,!n),a,l,u),null==(c=this.keyframeResolver)||c.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:u}=n;this.resolvedAt=G.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=un(s,e),a=un(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},d=!l&&function(t){var e;const{motionValue:n,name:i,repeatDelay:s,repeatType:o,damping:r,type:a}=t;if(!((null==(e=null==n?void 0:n.owner)?void 0:e.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return dn()&&i&&cn.has(i)&&("transform"!==i||!u)&&!l&&!s&&"mirror"!==o&&0!==r&&"inertia"!==a}(c)?new ln({...c,element:c.motionValue.owner.current}):new Ae(c);d.finished.then(()=>this.notifyFinished()).catch(f),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||(null==(t=this.keyframeResolver)||t.resume(),ze=!0,He(),Ke(),ze=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),null==(t=this.keyframeResolver)||t.cancel()}}const mn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fn(t,e,n=1){const[i,s]=function(t){const e=mn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return c(t)?parseFloat(t):t}return J(s)?fn(s,e,n+1):s}function gn(t,e){return(null==t?void 0:t[e])??(null==t?void 0:t.default)??t}const yn=new Set(["width","height","top","left","right","bottom",...Fe]),vn=t=>e=>e.test(t),xn=[tt,mt,pt,dt,gt,ft,{test:t=>"auto"===t,parse:t=>t}],Tn=t=>xn.find(vn(t));function wn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||p(t))}const Pn=new Set(["brightness","contrast","saturate","opacity"]);function Sn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(st)||[];if(!i)return t;const s=n.replace(i,"");let o=Pn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const bn=/\b([a-z-]*)\(.*?\)/gu,An={...Mt,getAnimatableNone:t=>{const e=t.match(bn);return e?e.map(Sn).join(" "):t}},En={...tt,transform:Math.round},Cn={borderWidth:mt,borderTopWidth:mt,borderRightWidth:mt,borderBottomWidth:mt,borderLeftWidth:mt,borderRadius:mt,radius:mt,borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomRightRadius:mt,borderBottomLeftRadius:mt,width:mt,maxWidth:mt,height:mt,maxHeight:mt,top:mt,right:mt,bottom:mt,left:mt,padding:mt,paddingTop:mt,paddingRight:mt,paddingBottom:mt,paddingLeft:mt,margin:mt,marginTop:mt,marginRight:mt,marginBottom:mt,marginLeft:mt,backgroundPositionX:mt,backgroundPositionY:mt,...{rotate:dt,rotateX:dt,rotateY:dt,rotateZ:dt,scale:nt,scaleX:nt,scaleY:nt,scaleZ:nt,skew:dt,skewX:dt,skewY:dt,distance:mt,translateX:mt,translateY:mt,translateZ:mt,x:mt,y:mt,z:mt,perspective:mt,transformPerspective:mt,opacity:et,originX:yt,originY:yt,originZ:mt},zIndex:En,fillOpacity:et,strokeOpacity:et,numOctaves:En},Mn={...Cn,color:xt,backgroundColor:xt,outlineColor:xt,fill:xt,stroke:xt,borderColor:xt,borderTopColor:xt,borderRightColor:xt,borderBottomColor:xt,borderLeftColor:xt,filter:An,WebkitFilter:An},Vn=t=>Mn[t];function Dn(t,e){let n=Vn(t);return n!==An&&(n=Mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const kn=new Set(["auto","none","0"]);class Rn extends Ge{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let a=0;a{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}const Ln=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function jn(t){return d(t)&&"offsetHeight"in t}const Bn={current:void 0};class Fn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{var e;const n=G.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(null==(e=this.events.change)||e.notify(this.current),this.dependents))for(const i of this.dependents)i.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=G.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new x);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;null==(t=this.events.change)||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Bn.current&&Bn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=G.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return P(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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(){var t,e;null==(t=this.dependents)||t.clear(),null==(e=this.events.destroy)||e.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function On(t,e){return new Fn(t,e)}const{schedule:In}=W(queueMicrotask,!1),Un={x:!1,y:!1};function Nn(){return Un.x||Un.y}function Wn(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document;const i=(null==n?void 0:n[t])??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function $n(t){return!("touch"===t.pointerType||Nn())}const Xn=(t,e)=>!!e&&(t===e||Xn(t,e.parentElement)),Yn=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,zn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Kn=new WeakSet;function Hn(t){return e=>{"Enter"===e.key&&t(e)}}function Gn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function qn(t){return Yn(t)&&!Nn()}function Zn(t,e,n={}){const[i,s,o]=Wn(t,n),r=t=>{const i=t.currentTarget;if(!qn(t))return;Kn.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),Kn.has(i)&&Kn.delete(i),qn(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||Xn(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),jn(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Hn(()=>{if(Kn.has(n))return;Gn(n,"down");const t=Hn(()=>{Gn(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Gn(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),e=t,zn.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function _n(t){return d(t)&&"ownerSVGElement"in t}const Jn=t=>Boolean(t&&t.getVelocity);function Qn(t,e){return e?t+e:t}function ti(t){return"number"==typeof t?t:parseFloat(t)}const ei=[...xn,xt,Mt],ni=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function ii(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function si(...t){return e.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=ii(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e{const{width:t,height:e,top:n,left:h,right:c}=l.current;if(i||!a.current||!t||!e)return;const d="left"===s?`left: ${h}`:`right: ${c}`;a.current.dataset.motionPopId=r;const p=document.createElement("style");u&&(p.nonce=u);const m=o??document.head;return m.appendChild(p),p.sheet&&p.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${d}px !important;\n top: ${n}px !important;\n }\n `),()=>{m.contains(p)&&m.removeChild(p)}},[i]),t.jsx(oi,{isPresent:i,childRef:a,sizeRef:l,children:e.cloneElement(n,{ref:h})})}const ai=({children:n,initial:s,isPresent:o,onExitComplete:a,custom:l,presenceAffectsLayout:u,mode:h,anchorX:c,root:d})=>{const p=i(li),m=e.useId();let f=!0,g=e.useMemo(()=>(f=!1,{id:m,initial:s,isPresent:o,custom:l,onExitComplete:t=>{p.set(t,!0);for(const e of p.values())if(!e)return;a&&a()},register:t=>(p.set(t,!1),()=>p.delete(t))}),[o,p,a]);return u&&f&&(g={...g}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[o]),e.useEffect(()=>{!o&&!p.size&&a&&a()},[o]),"popLayout"===h&&(n=t.jsx(ri,{isPresent:o,anchorX:c,root:d,children:n})),t.jsx(r.Provider,{value:g,children:n})};function li(){return new Map}function ui(t=!0){const n=e.useContext(r);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,a=e.useId();e.useEffect(()=>{if(t)return o(a)},[t]);const l=e.useCallback(()=>t&&s&&s(a),[a,s,t]);return!i&&s?[!1,l]:[!0]}const hi=t=>t.key||"";function ci(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const di=({children:s,custom:r,initial:a=!0,onExitComplete:l,presenceAffectsLayout:u=!0,mode:h="sync",propagate:c=!1,anchorX:d="left",root:p})=>{const[m,f]=ui(c),g=e.useMemo(()=>ci(s),[s]),y=c&&!m?[]:g.map(hi),v=e.useRef(!0),x=e.useRef(g),T=i(()=>new Map),[w,P]=e.useState(g),[S,b]=e.useState(g);o(()=>{v.current=!1,x.current=g;for(let t=0;t{const n=hi(e),i=!(c&&!m)&&(g===S||y.includes(n));return t.jsx(ai,{isPresent:i,initial:!(v.current&&!a)&&void 0,custom:r,presenceAffectsLayout:u,mode:h,root:p,onExitComplete:i?void 0:()=>{if(!T.has(n))return;T.set(n,!0);let t=!0;T.forEach(e=>{e||(t=!1)}),t&&(null==E||E(),b(x.current),c&&(null==f||f()),l&&l())},anchorX:d,children:e},n)})})},pi=e.createContext({strict:!1}),mi={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"]},fi={};for(const ga in mi)fi[ga]={isEnabled:t=>mi[ga].some(e=>!!t[e])};const gi=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","ignoreStrict","viewport"]);function yi(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||gi.has(t)}let vi=t=>!yi(t);try{"function"==typeof(xi=require("@emotion/is-prop-valid").default)&&(vi=t=>t.startsWith("on")?!yi(t):xi(t))}catch{}var xi;const Ti=e.createContext({});function wi(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Pi(t){return"string"==typeof t||Array.isArray(t)}const Si=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bi=["initial",...Si];function Ai(t){return wi(t.animate)||bi.some(e=>Pi(t[e]))}function Ei(t){return Boolean(Ai(t)||t.variants)}function Ci(t){const{initial:n,animate:i}=function(t,e){if(Ai(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Pi(e)?e:void 0,animate:Pi(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(Ti));return e.useMemo(()=>({initial:n,animate:i}),[Mi(n),Mi(i)])}function Mi(t){return Array.isArray(t)?t.join(" "):t}const Vi={};function Di(t,{layout:e,layoutId:n}){return Oe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Vi[t]||"opacity"===t)}const ki={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ri=Fe.length;function Li(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const t=e[l];if(Oe.has(l))r=!0;else if(Z(l))s[l]=t;else{const e=Ln(t,Cn[l]);l.startsWith("origin")?(a=!0,o[l]=e):i[l]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o({style:{},transform:{},transformOrigin:{},vars:{}});function Bi(t,e,n){for(const i in e)Jn(e[i])||Di(i,n)||(t[i]=e[i])}function Fi(t,n){const i={};return Bi(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Li(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function Oi(t,e){const n={},i=Fi(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Ii={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ui={offset:"strokeDashoffset",array:"strokeDasharray"};function Ni(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,u,h){if(Li(t,a,u),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:c,style:d}=t;c.transform&&(d.transform=c.transform,delete c.transform),(d.transform||c.transformOrigin)&&(d.transformOrigin=c.transformOrigin??"50% 50%",delete c.transformOrigin),d.transform&&(d.transformBox=(null==h?void 0:h.transformBox)??"fill-box",delete c.transformBox),void 0!==e&&(c.x=e),void 0!==n&&(c.y=n),void 0!==i&&(c.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Ii:Ui;t[o.offset]=mt.transform(-i);const r=mt.transform(e),a=mt.transform(n);t[o.array]=`${r} ${a}`}(c,s,o,r,!1)}const Wi=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),$i=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Xi(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ni(e,n,$i(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Bi(e,t.style,t),o.style={...e,...o.style}}return o}const Yi=["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 zi(t){return"string"==typeof t&&!t.includes("-")&&!!(Yi.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ki(t,n,i,{latestValues:s},o,r=!1){const a=(zi(t)?Xi:Oi)(n,s,o,t),l=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(vi(s)||!0===n&&yi(s)||!e&&!yi(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(n,"string"==typeof t,r),u=t!==e.Fragment?{...l,...a,ref:i}:{},{children:h}=n,c=e.useMemo(()=>Jn(h)?h.get():h,[h]);return e.createElement(t,{...u,children:c})}function Hi(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Gi(t,e,n,i){if("function"==typeof e){const[s,o]=Hi(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Hi(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function qi(t){return Jn(t)?t.get():t}function Zi(t,e,n,i){const s={},o=i(t,{});for(const d in o)s[d]=qi(o[d]);let{initial:r,animate:a}=t;const l=Ai(t),u=Ei(t);e&&u&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let h=!!n&&!1===n.initial;h=h||!1===r;const c=h?a:r;if(c&&"boolean"!=typeof c&&!wi(c)){const e=Array.isArray(c)?c:[c];for(let n=0;n(n,s)=>{const o=e.useContext(Ti),a=e.useContext(r),l=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Zi(n,i,s,t),renderState:e()}}(t,n,o,a);return s?l():i(l)};function Ji(t,e,n){var i;const{style:s}=t,o={};for(const r in s)(Jn(s[r])||e.style&&Jn(e.style[r])||Di(r,t)||void 0!==(null==(i=null==n?void 0:n.getValue(r))?void 0:i.liveStyle))&&(o[r]=s[r]);return o}const Qi=_i({scrapeMotionValuesFromProps:Ji,createRenderState:ji});function ts(t,e,n){const i=Ji(t,e,n);for(const s in t)if(Jn(t[s])||Jn(e[s])){i[-1!==Fe.indexOf(s)?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s]=t[s]}return i}const es=_i({scrapeMotionValuesFromProps:ts,createRenderState:Wi}),ns=Symbol.for("motionComponentSymbol");function is(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function ss(t,n,i){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):is(i)&&(i.current=e))},[n])}const os=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),rs="data-"+os("framerAppearId"),as=e.createContext({});function ls(t,n,i,s,a){var l,u;const{visualElement:h}=e.useContext(Ti),c=e.useContext(pi),d=e.useContext(r),p=e.useContext(ni).reducedMotion,m=e.useRef(null);s=s||c.renderer,!m.current&&s&&(m.current=s(t,{visualState:n,parent:h,props:i,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:p}));const f=m.current,g=e.useContext(as);!f||f.projection||!a||"html"!==f.type&&"svg"!==f.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:us(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&is(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:u})}(m.current,i,a,g);const y=e.useRef(!1);e.useInsertionEffect(()=>{f&&y.current&&f.update(i,d)});const v=i[rs],x=e.useRef(Boolean(v)&&!(null==(l=window.MotionHandoffIsComplete)?void 0:l.call(window,v))&&(null==(u=window.MotionHasOptimisedAnimation)?void 0:u.call(window,v)));return o(()=>{f&&(y.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),f.scheduleRenderMicrotask(),x.current&&f.animationState&&f.animationState.animateChanges())}),e.useEffect(()=>{f&&(!x.current&&f.animationState&&f.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var t;null==(t=window.MotionHandoffMarkAsComplete)||t.call(window,v)}),x.current=!1),f.enteringChildren=void 0)}),f}function us(t){if(t)return!1!==t.options.allowProjection?t.projection:us(t.parent)}function hs(n,{forwardMotionProps:i=!1}={},o,r){o&&function(t){for(const e in t)fi[e]={...fi[e],...t[e]}}(o);const a=zi(n)?es:Qi;function l(o,l){let u;const h={...e.useContext(ni),...o,layoutId:cs(o)},{isStatic:c}=h,d=Ci(o),p=a(o,c);if(!c&&s){e.useContext(pi).strict;const t=function(t){const{drag:e,layout:n}=fi;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==n?void 0:n.isEnabled(t))?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(h);u=t.MeasureLayout,d.visualElement=ls(n,p,h,r,t.ProjectionNode)}return t.jsxs(Ti.Provider,{value:d,children:[u&&d.visualElement?t.jsx(u,{visualElement:d.visualElement,...h}):null,Ki(n,o,ss(p,d.visualElement,l),p,c,i)]})}l.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const u=e.forwardRef(l);return u[ns]=n,u}function cs({layoutId:t}){const i=e.useContext(n).id;return i&&void 0!==t?i+"-"+t:t}function ds(t,e){if("undefined"==typeof Proxy)return hs;const n=new Map,i=(n,i)=>hs(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(s,o)=>"create"===o?i:(n.has(o)||n.set(o,hs(o,void 0,t,e)),n.get(o))})}function ps({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ms(t){return void 0===t||1===t}function fs({scale:t,scaleX:e,scaleY:n}){return!ms(t)||!ms(e)||!ms(n)}function gs(t){return fs(t)||ys(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ys(t){return vs(t.x)||vs(t.y)}function vs(t){return t&&"0%"!==t}function xs(t,e,n){return n+e*(t-n)}function Ts(t,e,n,i,s){return void 0!==s&&(t=xs(t,s,i)),xs(t,n,i)+e}function ws(t,e=0,n=1,i,s){t.min=Ts(t.min,e,n,i,s),t.max=Ts(t.max,e,n,i,s)}function Ps(t,{x:e,y:n}){ws(t.x,e.translate,e.scale,e.originPoint),ws(t.y,n.translate,n.scale,n.originPoint)}const Ss=.999999999999,bs=1.0000000000001;function As(t,e){t.min=t.min+e,t.max=t.max+e}function Es(t,e,n,i,s=.5){ws(t,e,n,kt(t.min,t.max,s),i)}function Cs(t,e){Es(t.x,e.x,e.scaleX,e.scale,e.originX),Es(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ms(t,e){return ps(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Vs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ds={current:null},ks={current:!1};const Rs=new WeakMap;const Ls=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class js{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ge,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=G.now();this.renderScheduledAtthis.bindToMotionValue(e,t)),ks.current||function(){if(ks.current=!0,s)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ds.current=t.matches;t.addEventListener("change",e),e()}else Ds.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ds.current),null==(e=this.parent)||e.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),X(this.notifyUpdate),X(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),null==(t=this.parent)||t.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Oe.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in fi){const e=fi[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let n=0;ne.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=On(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(c(n)||p(n))?n=parseFloat(n):(i=n,!ei.find(vn(i))&&Mt.test(e)&&(n=Dn(t,e))),this.setBaseTarget(t,Jn(n)?n.get():n)),Jn(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props;let i;if("string"==typeof n||"object"==typeof n){const s=Gi(this.props,n,null==(e=this.presenceContext)?void 0:e.custom);s&&(i=s[t])}if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Jn(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new x),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){In.render(this.render)}}class Bs extends js{constructor(){super(...arguments),this.KeyframeResolver=Rn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Fs(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in null==s||s.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}class Os extends Bs{constructor(){super(...arguments),this.type="html",this.renderInstance=Fs}readValueFromInstance(t,e){var n,i;if(Oe.has(e))return(null==(n=this.projection)?void 0:n.isProjecting)?Le(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return je(n,e)})(t,e);{const n=(i=t,window.getComputedStyle(i)),s=(Z(e)?n.getPropertyValue(e):n[e])||0;return"string"==typeof s?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ms(t,e)}build(t,e,n){Li(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ji(t,e,n)}}const Is=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"]);class Us extends Bs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Vs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Oe.has(e)){const t=Vn(e);return t&&t.default||0}return e=Is.has(e)?e:os(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return ts(t,e,n)}build(t,e,n){Ni(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Fs(t,e,void 0,i);for(const s in e.attrs)t.setAttribute(Is.has(s)?s:os(s),e.attrs[s])}(t,e,0,i)}mount(t){this.isSVGTag=$i(t.tagName),super.mount(t)}}const Ns=(t,n)=>zi(t)?new Us(n):new Os(n,{allowProjection:t!==e.Fragment});function Ws(t,e,n){const i=t.getProps();return Gi(i,e,void 0!==n?n:i.custom,t)}const $s=t=>Array.isArray(t);function Xs(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,On(n))}function Ys(t){return $s(t)?t[t.length-1]||0:t}function zs(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Jn(i)&&i.add))return n.add(e);if(!n&&h.WillChange){const n=new h.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ks(t){return t.props[rs]}const Hs=t=>null!==t;const Gs={type:"spring",stiffness:500,damping:25,restSpeed:10},qs={type:"keyframes",duration:.8},Zs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_s=(t,{keyframes:e})=>e.length>2?qs:Oe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Gs:Zs;const Js=(t,e,n,i={},s,o)=>r=>{const a=gn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=T(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...h}){return!!Object.keys(h).length})(a)||Object.assign(c,_s(t,c)),c.duration&&(c.duration=T(c.duration)),c.repeatDelay&&(c.repeatDelay=T(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(hn(c),0===c.delay&&(d=!0)),(h.instantAnimations||h.skipAnimations)&&(d=!0,hn(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"}){const i=t.filter(Hs);return i[e&&"loop"!==n&&e%2==1?0:i.length-1]}(c.keyframes,a);if(void 0!==t)return void $.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new Ae(c):new pn(c)};function Qs({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function to(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;i&&(o=i);const l=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const h in a){const e=t.getValue(h,t.latestValues[h]??null),i=a[h];if(void 0===i||u&&Qs(u,h))continue;const s={delay:n,...gn(o||{},h)},r=e.get();if(void 0!==r&&!e.isAnimating&&!Array.isArray(i)&&i===r&&!s.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){const e=Ks(t);if(e){const t=window.MotionHandoffAnimation(e,h,$);null!==t&&(s.startTime=t,c=!0)}}zs(t,h),e.start(Js(h,e,i,t.shouldReduceMotion&&yn.has(h)?{type:!1}:s,t,c));const d=e.animation;d&&l.push(d)}return r&&Promise.all(l).then(()=>{$.update(()=>{r&&function(t,e){const n=Ws(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const r in o)Xs(t,r,Ys(o[r]))}(t,r)})}),l}function eo(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}function no(t,e,n={}){var i;const s=Ws(t,e,"exit"===n.type?null==(i=t.presenceContext)?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(to(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(no(l,e,{...r,delay:n+("function"==typeof i?0:i)+eo(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,s,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function io(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;iPromise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>no(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=no(t,e,n);else{const s="function"==typeof e?Ws(t,e,n.custom):e;i=Promise.all(to(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function uo(t){let e=lo(t),n=po(),i=!0;const s=e=>(n,i)=>{var s;const o=Ws(t,i,"exit"===e?null==(s=t.presenceContext)?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=oo(t.parent)||{},l=[],u=new Set;let h={},c=1/0;for(let e=0;ec&&f,T=!1;const w=Array.isArray(m)?m:[m];let P=w.reduce(s(d),{});!1===g&&(P={});const{prevResolvedValues:S={}}=p,b={...S,...P},A=e=>{x=!0,u.has(e)&&(T=!0,u.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in b){const e=P[t],n=S[t];if(h.hasOwnProperty(t))continue;let i=!1;i=$s(e)&&$s(n)?!io(e,n):e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=P,p.isActive&&(h={...h,...P}),i&&t.blockInitialAnimation&&(x=!1);const E=y&&v;x&&(!E||T)&&l.push(...w.map(e=>{const n={type:d};if("string"==typeof e&&i&&!E&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Ws(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=eo(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof r.initial){const n=Ws(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null==(s=t.variantChildren)||s.forEach(t=>{var n;return null==(n=t.animationState)?void 0:n.setActive(e,i)}),n[e].isActive=i;const r=o(e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=po(),i=!0}}}function ho(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!io(e,t)}function co(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function po(){return{animate:co(!0),whileInView:co(),whileHover:co(),whileTap:co(),whileDrag:co(),whileFocus:co(),exit:co()}}class mo{constructor(t){this.isMounted=!1,this.node=t}update(){}}let fo=0;const go={animation:{Feature:class extends mo{constructor(t){super(t),t.animationState||(t.animationState=uo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();wi(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null==(t=this.unmountControls)||t.call(this)}}},exit:{Feature:class extends mo{constructor(){super(...arguments),this.id=fo++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function yo(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function vo(t){return{point:{x:t.pageX,y:t.pageY}}}function xo(t,e,n,i){return yo(t,e,(t=>e=>Yn(e)&&t(e,vo(e)))(n),i)}function To(t){return t.max-t.min}function wo(t,e,n,i=.5){t.origin=i,t.originPoint=kt(e.min,e.max,t.origin),t.scale=To(n)/To(e),t.translate=kt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Po(t,e,n,i){wo(t.x,e.x,n.x,i?i.originX:void 0),wo(t.y,e.y,n.y,i?i.originY:void 0)}function So(t,e,n){t.min=n.min+e.min,t.max=t.min+To(e)}function bo(t,e,n){t.min=e.min-n.min,t.max=t.min+To(e)}function Ao(t,e,n){bo(t.x,e.x,n.x),bo(t.y,e.y,n.y)}function Eo(t){return[t("x"),t("y")]}const Co=({current:t})=>t?t.ownerDocument.defaultView:null,Mo=(t,e)=>Math.abs(t-e);class Vo{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Ro(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Mo(t.x,e.x),i=Mo(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=Y;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Do(e,this.transformPagePoint),$.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Ro("pointercancel"===t.type?this.lastMoveEventInfo:Do(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Yn(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const r=Do(vo(t),this.transformPagePoint),{point:a}=r,{timestamp:l}=Y;this.history=[{...a,timestamp:l}];const{onSessionStart:u}=e;u&&u(t,Ro(r,this.history)),this.removeListeners=y(xo(this.contextWindow,"pointermove",this.handlePointerMove),xo(this.contextWindow,"pointerup",this.handlePointerUp),xo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),X(this.updatePoint)}}function Do(t,e){return e?{point:e(t.point)}:t}function ko(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ro({point:t},e){return{point:t,delta:ko(t,jo(e)),offset:ko(t,Lo(e)),velocity:Bo(e,.1)}}function Lo(t){return t[0]}function jo(t){return t[t.length-1]}function Bo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=jo(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>T(e)));)n--;if(!i)return{x:0,y:0};const o=w(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Fo(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Oo(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(vo(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?Un[o]?null:(Un[o]=!0,()=>{Un[o]=!1}):Un.x||Un.y?null:(Un.x=Un.y=!0,()=>{Un.x=Un.y=!1}),!this.openDragLock))return;var o;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Eo(t=>{let e=this.getAxisMotionValue(t).get()||0;if(pt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=To(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&$.postRender(()=>s(t,e)),zs(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>Eo(t=>{var e;return"paused"===this.getAnimationState(t)&&(null==(e=this.getAxisMotionValue(t).animation)?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:Co(this.visualElement)})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&$.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Xo(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&tn&&(t=i?kt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null==(t=this.visualElement.projection)?void 0:t.layout,s=this.constraints;e&&is(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!e||!i)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Fo(t.x,n,s),y:Fo(t.y,e,i)}}(i.layoutBox,e),this.elastic=function(t=Io){return!1===t?t=0:!0===t&&(t=Io),{x:Uo(t,"left","right"),y:Uo(t,"top","bottom")}}(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Eo(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!is(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Ms(t,n),{scroll:s}=e;return s&&(As(i.x,s.offset.x),As(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Oo(t.x,e.x),y:Oo(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=ps(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Eo(r=>{if(!Xo(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const u=i?200:1e6,h=i?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return zs(this.visualElement,t),n.start(Js(t,n,0,e,this.visualElement,!1))}stopAnimation(){Eo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Eo(t=>{var e;return null==(e=this.getAxisMotionValue(t).animation)?void 0:e.pause()})}getAnimationState(t){var e;return null==(e=this.getAxisMotionValue(t).animation)?void 0:e.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Eo(e=>{const{drag:n}=this.getProps();if(!Xo(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-kt(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!is(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Eo(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=To(t),s=To(e);return s>i?n=v(e.min,e.max-i,t.min):i>s&&(n=v(t.min,t.max-s,e.min)),u(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Eo(e=>{if(!Xo(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(kt(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;Wo.set(this.visualElement,this);const t=xo(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();is(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),$.read(e);const s=yo(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Eo(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Io,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Xo(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Yo=t=>(e,n)=>{t&&$.postRender(()=>t(e,n))};const zo={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ko(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ho={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!mt.test(t))return t;t=parseFloat(t)}return`${Ko(t,e.target.x)}% ${Ko(t,e.target.y)}%`}},Go={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Mt.parse(t);if(s.length>5)return i;const o=Mt.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const u=kt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=u),"number"==typeof s[3+r]&&(s[3+r]/=u),o(s)}};let qo=!1;class Zo extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)Vi[e]=t[e],Z(e)&&(Vi[e].isCSSVariable=!0)}(Jo),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),qo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),zo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,qo=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||$.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),In.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;qo=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function _o(i){const[s,o]=ui(),r=e.useContext(n);return t.jsx(Zo,{...i,layoutGroup:r,switchLayoutGroup:e.useContext(as),isPresent:s,safeToRemove:o})}const Jo={borderRadius:{...Ho,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ho,borderTopRightRadius:Ho,borderBottomLeftRadius:Ho,borderBottomRightRadius:Ho,boxShadow:Go};const Qo=(t,e)=>t.depth-e.depth;class tr{constructor(){this.children=[],this.isDirty=!1}add(t){a(this.children,t),this.isDirty=!0}remove(t){l(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Qo),this.isDirty=!1,this.children.forEach(t)}}const er=["TopLeft","TopRight","BottomLeft","BottomRight"],nr=er.length,ir=t=>"string"==typeof t?parseFloat(t):t,sr=t=>"number"==typeof t||mt.test(t);function or(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const rr=lr(0,.5,R),ar=lr(.5,.95,f);function lr(t,e,n){return i=>ie?1:n(v(t,e,i))}function ur(t,e){t.min=e.min,t.max=e.max}function hr(t,e){ur(t.x,e.x),ur(t.y,e.y)}function cr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function dr(t,e,n,i,s){return t=xs(t-=e,1/n,i),void 0!==s&&(t=xs(t,1/s,i)),t}function pr(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){pt.test(e)&&(e=parseFloat(e),e=kt(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=kt(o.min,o.max,i);t===o&&(a-=e),t.min=dr(t.min,e,n,a,s),t.max=dr(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const mr=["x","scaleX","originX"],fr=["y","scaleY","originY"];function gr(t,e,n,i){pr(t.x,e,mr,n?n.x:void 0,i?i.x:void 0),pr(t.y,e,fr,n?n.y:void 0,i?i.y:void 0)}function yr(t){return 0===t.translate&&1===t.scale}function vr(t){return yr(t.x)&&yr(t.y)}function xr(t,e){return t.min===e.min&&t.max===e.max}function Tr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function wr(t,e){return Tr(t.x,e.x)&&Tr(t.y,e.y)}function Pr(t){return To(t.x)/To(t.y)}function Sr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class br{constructor(){this.members=[]}add(t){a(this.members,t),t.scheduleRender()}remove(t){if(l(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let i=e;i>=0;i--){const t=this.members[i];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Ar=["","X","Y","Z"];let Er=0;function Cr(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Mr(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ks(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",$,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Mr(i)}function Vr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=Er++,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.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(Rr),this.nodes.forEach(Ur),this.nodes.forEach(Nr),this.nodes.forEach(Lr)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;$.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=G.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(X(i),t(o-e))};return $.setup(i,!0),()=>X(i)}(s,250),zo.hasAnimatedSinceResize&&(zo.hasAnimatedSinceResize=!1,this.nodes.forEach(Ir)))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||Kr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!wr(this.targetLayout,i),u=!e&&n;if(this.options.layoutRoot||this.resumeFrom||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...gn(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,u)}else e||Ir(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),X(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(Wr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Mr(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let s=0;s{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||To(this.snapshot.measuredBox.x)||To(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let n=0;nSs&&(e.x=1),e.ySs&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox,e.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=e;l?(this.projectionDelta&&this.prevProjectionDelta?(cr(this.prevProjectionDelta.x,this.projectionDelta.x),cr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Po(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Sr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Sr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null==(e=this.options.visualElement)||e.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,h=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(zr));let c;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,g;Xr(o.x,t.x,n),Xr(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ao(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,g=n,Yr(p.x,m.x,f.x,g),Yr(p.y,m.y,f.y,g),c&&(l=this.relativeTarget,d=c,xr(l.x,d.x)&&xr(l.y,d.y))&&(this.isProjectionDirty=!1),c||(c={x:{min:0,max:0},y:{min:0,max:0}}),hr(c,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=kt(0,n.opacity??1,rr(i)),t.opacityExit=kt(e.opacity??1,0,ar(i))):o&&(t.opacity=kt(e.opacity??1,n.opacity??1,i));for(let r=0;r{zo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=On(0)),this.currentAnimation=function(t,e,n){const i=Jn(t)?t:On(t);return i.start(Js("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&Zr(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=To(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=To(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}hr(e,n),Cs(e,s),Po(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new br);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null==(t=this.getStack())?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null==(t=this.getStack())?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Cr("z",t,i,this.animationValues);for(let s=0;s{var e;return null==(e=t.currentAnimation)?void 0:e.stop()}),this.root.nodes.forEach(Br),this.root.sharedNodes.clear()}}}function Dr(t){t.updateLayout()}function kr(t){var e;const n=(null==(e=t.resumeFrom)?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:i}=t.layout,{animationType:s}=t.options,o=n.source!==t.layout.source;"size"===s?Eo(t=>{const i=o?n.measuredBox[t]:n.layoutBox[t],s=To(i);i.min=e[t].min,i.max=i.min+s}):Zr(s,n.layoutBox,e)&&Eo(i=>{const s=o?n.measuredBox[i]:n.layoutBox[i],r=To(e[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Po(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Po(a,t.applyTransform(i,!0),n.measuredBox):Po(a,e,n.layoutBox);const l=!vr(r);let u=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ao(r,n.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ao(a,e,o.layoutBox),wr(r,a)||(u=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Rr(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Lr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function jr(t){t.clearSnapshot()}function Br(t){t.clearMeasurements()}function Fr(t){t.isLayoutDirty=!1}function Or(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ir(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ur(t){t.resolveTargetDelta()}function Nr(t){t.calcProjection()}function Wr(t){t.resetSkewAndRotation()}function $r(t){t.removeLeadSnapshot()}function Xr(t,e,n){t.translate=kt(e.translate,0,n),t.scale=kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Yr(t,e,n,i){t.min=kt(e.min,n.min,i),t.max=kt(e.max,n.max,i)}function zr(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Kr={duration:.45,ease:[.4,0,.1,1]},Hr=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gr=Hr("applewebkit/")&&!Hr("chrome/")?Math.round:f;function qr(t){t.min=Gr(t.min),t.max=Gr(t.max)}function Zr(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Pr(e),s=Pr(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function _r(t){var e;return t!==t.root&&(null==(e=t.scroll)?void 0:e.wasRoot)}const Jr=Vr({attachResizeListener:(t,e)=>yo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Qr={current:void 0},ta=Vr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Qr.current){const t=new Jr({});t.mount(window),t.setOptions({layoutScroll:!0}),Qr.current=t}return Qr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ea={pan:{Feature:class extends mo{constructor(){super(...arguments),this.removePointerDownListener=f}onPointerDown(t){this.session=new Vo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Co(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Yo(t),onStart:Yo(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&$.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=xo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends mo{constructor(t){super(t),this.removeGroupControls=f,this.removeListeners=f,this.controls=new $o(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||f}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:ta,MeasureLayout:_o}};function na(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&$.postRender(()=>s(e,vo(e)))}function ia(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&$.postRender(()=>s(e,vo(e)))}const sa=new WeakMap,oa=new WeakMap,ra=t=>{const e=sa.get(t.target);e&&e(t)},aa=t=>{t.forEach(ra)};function la(t,e,n){const i=function({root:t,...e}){const n=t||document;oa.has(n)||oa.set(n,{});const i=oa.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(aa,{root:t,...e})),i[s]}(e);return sa.set(t,n),i.observe(t),()=>{sa.delete(t),i.unobserve(t)}}const ua={some:0,all:1};const ha=ds({...go,...{inView:{Feature:class extends mo{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:ua[i]};return la(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends mo{mount(){const{current:t}=this.node;t&&(this.unmount=Zn(t,(t,e)=>(ia(this.node,e,"Start"),(t,{success:e})=>ia(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends mo{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&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=y(yo(this.node.current,"focus",()=>this.onFocus()),yo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends mo{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=Wn(t,n),r=t=>{if(!$n(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{$n(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(na(this.node,e,"Start"),t=>na(this.node,t,"End"))))}unmount(){}}}},...ea,...{layout:{ProjectionNode:ta,MeasureLayout:_o}}},Ns);function ca(t){const n=i(()=>On(t)),{isStatic:s}=e.useContext(ni);if(s){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function da(t,e){const n=ca(e()),i=()=>n.set(e());return i(),o(()=>{const e=()=>$.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),X(i)}}),n}function pa(t,e,n,i){if("function"==typeof t)return function(t){Bn.current=[],t();const e=da(Bn.current,t);return Bn.current=void 0,e}(t);const s=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=ge(t[1+n],t[2+n],t[3+n]);return e?s(i):s}(e,n,i);return Array.isArray(t)?ma(t,s):ma([t],([t])=>s(t))}function ma(t,e){const n=i(()=>[]);return da(t,()=>{n.length=0;const i=t.length;for(let e=0;eJn(t)?t.get():t;if(i)return pa(s);const o=ca(s());return e.useInsertionEffect(()=>function(t,e,n){const i=t.get();let s,o=null,r=i;const a="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,l=()=>{o&&(o.stop(),o=null)},u=()=>{l(),o=new Ae({keyframes:[ti(t.get()),ti(r)],velocity:t.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:s})};if(t.attach((e,n)=>(r=e,s=t=>n(Qn(t,a)),$.postRender(u),t.get()),l),Jn(e)){const n=e.on("change",e=>t.set(Qn(e,a))),i=t.on("destroy",n);return()=>{n(),i()}}return l}(o,t,n),[o,JSON.stringify(n)]),o}export{di as A,ha as m,fa as u};