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