@plyaz/ui 0.9.1 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react/jsx-runtime"),T=require("react"),Nr=require("../utils-IjLH3w2e.cjs"),Qs=T.createContext({});function se(t){const e=T.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ye=typeof window<"u",Xe=Ye?T.useLayoutEffect:T.useEffect,qe=T.createContext(null);function Ze(t,e){t.indexOf(e)===-1&&t.push(e)}function Je(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Z=(t,e,n)=>n>e?e:n<t?t:n;function Pe(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let bt=()=>{},_=()=>{};process.env.NODE_ENV!=="production"&&(bt=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(Pe(e,n))},_=(t,e,n)=>{if(!t)throw new Error(Pe(e,n))});const J={},ti=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ei(t){return typeof t=="object"&&t!==null}const ni=t=>/^0[^.\s]+$/u.test(t);function Qe(t){let e;return()=>(e===void 0&&(e=t()),e)}const j=t=>t,Wr=(t,e)=>n=>e(t(n)),It=(...t)=>t.reduce(Wr),Tt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class tn{constructor(){this.subscriptions=[]}add(e){return Ze(this.subscriptions,e),()=>Je(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const G=t=>t*1e3,K=t=>t/1e3;function en(t,e){return e?t*(1e3/e):0}const kn=new Set;function ie(t,e,n){t||kn.has(e)||(console.warn(Pe(e,n)),kn.add(e))}const si=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Ur=1e-7,Kr=12;function $r(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=si(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Ur&&++a<Kr);return r}function jt(t,e,n,s){if(t===e&&n===s)return j;const i=o=>$r(o,0,1,t,n);return o=>o===0||o===1?o:si(i(o),e,s)}const ii=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ri=t=>e=>1-t(1-e),oi=jt(.33,1.53,.69,.99),nn=ri(oi),ai=ii(nn),li=t=>(t*=2)<1?.5*nn(t):.5*(2-Math.pow(2,-10*(t-1))),sn=t=>1-Math.sin(Math.acos(t)),ci=ri(sn),ui=ii(sn),zr=jt(.42,0,1,1),Hr=jt(0,0,.58,1),hi=jt(.42,0,.58,1),Gr=t=>Array.isArray(t)&&typeof t[0]!="number",fi=t=>Array.isArray(t)&&typeof t[0]=="number",Bn={linear:j,easeIn:zr,easeInOut:hi,easeOut:Hr,circIn:sn,circInOut:ui,circOut:ci,backIn:nn,backInOut:ai,backOut:oi,anticipate:li},_r=t=>typeof t=="string",Fn=t=>{if(fi(t)){_(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,i]=t;return jt(e,n,s,i)}else if(_r(t))return _(Bn[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),Bn[t];return t},Ut=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Yr(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){r.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,h=!1,f=!1)=>{const m=f&&i?n:s;return h&&r.add(c),m.has(c)||m.add(c),c},cancel:c=>{s.delete(c),r.delete(c)},process:c=>{if(a=c,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,u.process(c))}};return u}const Xr=40;function di(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ut.reduce((y,P)=>(y[P]=Yr(o),y),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:m}=r,g=()=>{const y=J.useManualTiming?i.timestamp:performance.now();n=!1,J.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,Xr),1)),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(g))},v=()=>{n=!0,s=!0,i.isProcessing||t(g)};return{schedule:Ut.reduce((y,P)=>{const b=r[P];return y[P]=(V,E=!1,S=!1)=>(n||v(),b.schedule(V,E,S)),y},{}),cancel:y=>{for(let P=0;P<Ut.length;P++)r[Ut[P]].cancel(y)},state:i,steps:r}}const{schedule:A,cancel:Y,state:L,steps:le}=di(typeof requestAnimationFrame<"u"?requestAnimationFrame:j,!0);let Ht;function qr(){Ht=void 0}const I={now:()=>(Ht===void 0&&I.set(L.isProcessing||J.useManualTiming?L.timestamp:performance.now()),Ht),set:t=>{Ht=t,queueMicrotask(qr)}},mi=t=>e=>typeof e=="string"&&e.startsWith(t),pi=mi("--"),Zr=mi("var(--"),rn=t=>Zr(t)?Jr.test(t.split("/*")[0].trim()):!1,Jr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,St={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},kt={...St,transform:t=>Z(0,1,t)},Kt={...St,default:1},Dt=t=>Math.round(t*1e5)/1e5,on=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Qr(t){return t==null}const to=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,an=(t,e)=>n=>!!(typeof n=="string"&&to.test(n)&&n.startsWith(t)||e&&!Qr(n)&&Object.prototype.hasOwnProperty.call(n,e)),gi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(on);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},eo=t=>Z(0,255,t),ce={...St,transform:t=>Math.round(eo(t))},ot={test:an("rgb","red"),parse:gi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ce.transform(t)+", "+ce.transform(e)+", "+ce.transform(n)+", "+Dt(kt.transform(s))+")"};function no(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ae={test:an("#"),parse:no,transform:ot.transform},Nt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Q=Nt("deg"),q=Nt("%"),w=Nt("px"),so=Nt("vh"),io=Nt("vw"),On={...q,parse:t=>q.parse(t)/100,transform:t=>q.transform(t*100)},ft={test:an("hsl","hue"),parse:gi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+q.transform(Dt(e))+", "+q.transform(Dt(n))+", "+Dt(kt.transform(s))+")"},D={test:t=>ot.test(t)||Ae.test(t)||ft.test(t),parse:t=>ot.test(t)?ot.parse(t):ft.test(t)?ft.parse(t):Ae.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ot.transform(t):ft.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},ro=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function oo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(on))==null?void 0:e.length)||0)+(((n=t.match(ro))==null?void 0:n.length)||0)>0}const yi="number",vi="color",ao="var",lo="var(",In="${}",co=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Bt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(co,l=>(D.test(l)?(s.color.push(o),i.push(vi),n.push(D.parse(l))):l.startsWith(lo)?(s.var.push(o),i.push(ao),n.push(l)):(s.number.push(o),i.push(yi),n.push(parseFloat(l))),++o,In)).split(In);return{values:n,split:a,indexes:s,types:i}}function xi(t){return Bt(t).values}function Ti(t){const{split:e,types:n}=Bt(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===yi?o+=Dt(i[r]):a===vi?o+=D.transform(i[r]):o+=i[r]}return o}}const uo=t=>typeof t=="number"?0:D.test(t)?D.getAnimatableNone(t):t;function ho(t){const e=xi(t);return Ti(t)(e.map(uo))}const et={test:oo,parse:xi,createTransformer:Ti,getAnimatableNone:ho};function ue(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function fo({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ue(l,a,t+1/3),o=ue(l,a,t),r=ue(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Zt(t,e){return n=>n>0?e:t}const M=(t,e,n)=>t+(e-t)*n,he=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},mo=[Ae,ot,ft],po=t=>mo.find(e=>e.test(t));function jn(t){const e=po(t);if(bt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===ft&&(n=fo(n)),n}const Nn=(t,e)=>{const n=jn(t),s=jn(e);if(!n||!s)return Zt(t,e);const i={...n};return o=>(i.red=he(n.red,s.red,o),i.green=he(n.green,s.green,o),i.blue=he(n.blue,s.blue,o),i.alpha=M(n.alpha,s.alpha,o),ot.transform(i))},Ve=new Set(["none","hidden"]);function go(t,e){return Ve.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function yo(t,e){return n=>M(t,e,n)}function ln(t){return typeof t=="number"?yo:typeof t=="string"?rn(t)?Zt:D.test(t)?Nn:To:Array.isArray(t)?wi:typeof t=="object"?D.test(t)?Nn:vo:Zt}function wi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>ln(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function vo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=ln(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function xo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const To=(t,e)=>{const n=et.createTransformer(e),s=Bt(t),i=Bt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ve.has(t)&&!i.values.length||Ve.has(e)&&!s.values.length?go(t,e):It(wi(xo(s,i),i.values),n):(bt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Zt(t,e))};function bi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?M(t,e,n):ln(t)(t,e)}const wo=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>A.update(e,n),stop:()=>Y(e),now:()=>L.isProcessing?L.timestamp:I.now()}},Si=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Jt=2e4;function cn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Jt;)e+=n,s=t.next(e);return e>=Jt?1/0:e}function bo(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(cn(s),Jt);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:K(i)}}const So=5;function Pi(t,e,n){const s=Math.max(e-So,0);return en(n-t(s),e-s)}const C={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},fe=.001;function Po({duration:t=C.duration,bounce:e=C.bounce,velocity:n=C.velocity,mass:s=C.mass}){let i,o;bt(t<=G(C.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=Z(C.minDamping,C.maxDamping,r),t=Z(C.minDuration,C.maxDuration,K(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=Ce(u,r),m=Math.exp(-h);return fe-f/d*m},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),g=Ce(Math.pow(u,2),r);return(-i(u)+fe>0?-1:1)*((f-d)*m)/g}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-fe+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Vo(i,o,a);if(t=G(t),isNaN(l))return{stiffness:C.stiffness,damping:C.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Ao=12;function Vo(t,e,n){let s=n;for(let i=1;i<Ao;i++)s=s-t(s)/e(s);return s}function Ce(t,e){return t*Math.sqrt(1-e*e)}const Co=["duration","bounce"],Mo=["stiffness","damping","mass"];function Wn(t,e){return e.some(n=>t[n]!==void 0)}function Do(t){let e={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:!1,...t};if(!Wn(t,Mo)&&Wn(t,Co))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*Z(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:C.mass,stiffness:i,damping:o}}else{const n=Po(t);e={...e,...n,mass:C.mass},e.isResolvedFromDuration=!0}return e}function Qt(t=C.visualDuration,e=C.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=Do({...n,velocity:-K(n.velocity||0)}),m=f||0,g=u/(2*Math.sqrt(l*c)),v=r-o,p=K(Math.sqrt(l/c)),x=Math.abs(v)<5;s||(s=x?C.restSpeed.granular:C.restSpeed.default),i||(i=x?C.restDelta.granular:C.restDelta.default);let y;if(g<1){const b=Ce(p,g);y=V=>{const E=Math.exp(-g*p*V);return r-E*((m+g*p*v)/b*Math.sin(b*V)+v*Math.cos(b*V))}}else if(g===1)y=b=>r-Math.exp(-p*b)*(v+(m+p*v)*b);else{const b=p*Math.sqrt(g*g-1);y=V=>{const E=Math.exp(-g*p*V),S=Math.min(b*V,300);return r-E*((m+g*p*v)*Math.sinh(S)+b*v*Math.cosh(S))/b}}const P={calculatedDuration:d&&h||null,next:b=>{const V=y(b);if(d)a.done=b>=h;else{let E=b===0?m:0;g<1&&(E=b===0?G(m):Pi(y,b,V));const S=Math.abs(E)<=s,O=Math.abs(r-V)<=i;a.done=S&&O}return a.value=a.done?r:V,a},toString:()=>{const b=Math.min(cn(P),Jt),V=Si(E=>P.next(b*E).value,b,30);return b+"ms "+V},toTransition:()=>{}};return P}Qt.applyToOptions=t=>{const e=bo(t,100,Qt);return t.ease=e.ease,t.duration=G(e.duration),t.type="keyframes",t};function Me({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=S=>a!==void 0&&S<a||l!==void 0&&S>l,m=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l;let g=n*e;const v=h+g,p=r===void 0?v:r(v);p!==v&&(g=p-h);const x=S=>-g*Math.exp(-S/s),y=S=>p+x(S),P=S=>{const O=x(S),N=y(S);f.done=Math.abs(O)<=u,f.value=f.done?p:N};let b,V;const E=S=>{d(f.value)&&(b=S,V=Qt({keyframes:[f.value,m(f.value)],velocity:Pi(y,S,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:S=>{let O=!1;return!V&&b===void 0&&(O=!0,P(S),E(S)),b!==void 0&&S>=b?V.next(S-b):(!O&&P(S),f)}}}function Eo(t,e,n){const s=[],i=n||J.mix||bi,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||j:e;a=It(l,a)}s.push(a)}return s}function un(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(_(o===e.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Eo(e,s,i),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=Tt(t[h],t[h+1],c);return a[h](f)};return n?c=>u(Z(t[0],t[o-1],c)):u}function Ro(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Tt(0,e,s);t.push(M(n,1,i))}}function Ai(t){const e=[0];return Ro(e,t.length-1),e}function Lo(t,e){return t.map(n=>n*e)}function ko(t,e){return t.map(()=>e||hi).splice(0,t.length-1)}function dt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Gr(s)?s.map(Fn):Fn(s),o={done:!1,value:e[0]},r=Lo(n&&n.length===e.length?n:Ai(e),t),a=un(r,e,{ease:Array.isArray(i)?i:ko(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Bo=t=>t!==null;function hn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(Bo),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const Fo={decay:Me,inertia:Me,tween:dt,keyframes:dt,spring:Qt};function Vi(t){typeof t.type=="string"&&(t.type=Fo[t.type])}class fn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Oo=t=>t/100;class dn extends fn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==I.now()&&this.tick(I.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Vi(e);const{type:n=dt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||dt;process.env.NODE_ENV!=="production"&&l!==dt&&_(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==dt&&typeof a[0]!="number"&&(this.mixKeyframes=It(Oo,bi(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=cn(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:g,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const p=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,P=s;if(h){const S=Math.min(this.currentTime,i)/a;let O=Math.floor(S),N=S%1;!N&&S>=1&&(N=1),N===1&&O--,O=Math.min(O,h+1),!!(O%2)&&(f==="reverse"?(N=1-N,d&&(N-=d/a)):f==="mirror"&&(P=r)),y=Z(0,1,N)*a}const b=x?{done:!1,value:c[0]}:P.next(y);o&&(b.value=o(b.value));let{done:V}=b;!x&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return E&&m!==Me&&(b.value=hn(c,this.options,v,this.speed)),g&&g(b.value),E&&this.finish(),b}then(e,n){return this.finished.then(e,n)}get duration(){return K(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(this.currentTime)}set time(e){var n;e=G(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(I.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=K(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:e=wo,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),(o=(i=this.options).onPlay)==null||o.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(I.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Io(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const at=t=>t*180/Math.PI,De=t=>{const e=at(Math.atan2(t[1],t[0]));return Ee(e)},jo={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:De,rotateZ:De,skewX:t=>at(Math.atan(t[1])),skewY:t=>at(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Ee=t=>(t=t%360,t<0&&(t+=360),t),Un=De,Kn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$n=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),No={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Kn,scaleY:$n,scale:t=>(Kn(t)+$n(t))/2,rotateX:t=>Ee(at(Math.atan2(t[6],t[5]))),rotateY:t=>Ee(at(Math.atan2(-t[2],t[0]))),rotateZ:Un,rotate:Un,skewX:t=>at(Math.atan(t[4])),skewY:t=>at(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Re(t){return t.includes("scale")?1:0}function Le(t,e){if(!t||t==="none")return Re(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=No,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=jo,i=a}if(!i)return Re(e);const o=s[e],r=i[1].split(",").map(Uo);return typeof o=="function"?o(r):r[o]}const Wo=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Le(n,e)};function Uo(t){return parseFloat(t.trim())}const Pt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],At=new Set(Pt),zn=t=>t===St||t===w,Ko=new Set(["x","y","z"]),$o=Pt.filter(t=>!Ko.has(t));function zo(t){const e=[];return $o.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const lt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Le(e,"x"),y:(t,{transform:e})=>Le(e,"y")};lt.translateX=lt.x;lt.translateY=lt.y;const ct=new Set;let ke=!1,Be=!1,Fe=!1;function Ci(){if(Be){const t=Array.from(ct).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=zo(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))==null||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Be=!1,ke=!1,ct.forEach(t=>t.complete(Fe)),ct.clear()}function Mi(){ct.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Be=!0)})}function Ho(){Fe=!0,Mi(),Ci(),Fe=!1}class mn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ct.add(this),ke||(ke=!0,A.read(Mi),A.resolveKeyframes(Ci))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i==null?void 0:i.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Io(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ct.delete(this)}cancel(){this.state==="scheduled"&&(ct.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Go=t=>t.startsWith("--");function _o(t,e,n){Go(e)?t.style.setProperty(e,n):t.style[e]=n}const Di=Qe(()=>window.ScrollTimeline!==void 0),Yo={};function Xo(t,e){const n=Qe(t);return()=>Yo[e]??n()}const Ei=Xo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Hn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mt([0,.65,.55,1]),circOut:Mt([.55,0,1,.45]),backIn:Mt([.31,.01,.66,-.59]),backOut:Mt([.33,1.53,.69,.99])};function Ri(t,e){if(t)return typeof t=="function"?Ei()?Si(t,e):"ease-out":fi(t)?Mt(t):Array.isArray(t)?t.map(n=>Ri(n,e)||Hn.easeOut):Hn[t]}function qo(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Ri(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function Li(t){return typeof t=="function"&&"applyToOptions"in t}function Zo({type:t,...e}){return Li(t)&&Ei()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Jo extends fn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,_(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Zo(e);this.animation=qo(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=hn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):_o(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return K(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=G(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Di()?(this.animation.timeline=e,j):n(this)}}const ki={anticipate:li,backInOut:ai,circInOut:ui};function Qo(t){return t in ki}function ta(t){typeof t.ease=="string"&&Qo(t.ease)&&(t.ease=ki[t.ease])}const Gn=10;class ea extends Jo{constructor(e){ta(e),Vi(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new dn({...r,autoplay:!1}),l=G(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-Gn).value,a.sample(l).value,Gn),a.stop()}}const _n=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(et.test(t)||t==="0")&&!t.startsWith("url("));function na(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function sa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=_n(i,e),a=_n(o,e);return bt(r===a,`You are trying to animate ${e} from "${i}" to "${o}". "${r?o:i}" is not an animatable value.`,"value-not-animatable"),!r||!a?!1:na(t)||(n==="spring"||Li(n))&&s}function Oe(t){t.duration=0,t.type="keyframes"}const ia=new Set(["opacity","clipPath","filter","transform"]),ra=Qe(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oa(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return ra()&&n&&ia.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const aa=40;class la extends fn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){var m;super(),this.stop=()=>{var g,v;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(v=this.keyframeResolver)==null||v.cancel()},this.createdAt=I.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:u,element:c,...h},d=(c==null?void 0:c.KeyframeResolver)||mn;this.keyframeResolver=new d(a,(g,v,p)=>this.onKeyframesResolved(g,v,f,!p),l,u,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=I.now(),sa(e,o,r,a)||((J.instantAnimations||!l)&&(c==null||c(hn(e,s,n))),e[0]=e[e.length-1],Oe(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>aa?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&oa(f)?new ea({...f,element:f.motionValue.owner.current}):new dn(f);d.finished.then(()=>this.notifyFinished()).catch(j),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Ho()),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(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const ca=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ua(t){const e=ca.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const ha=4;function Bi(t,e,n=1){_(n<=ha,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,i]=ua(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return ti(r)?parseFloat(r):r}return rn(i)?Bi(i,e,n+1):i}function pn(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const Fi=new Set(["width","height","top","left","right","bottom",...Pt]),fa={test:t=>t==="auto",parse:t=>t},Oi=t=>e=>e.test(t),Ii=[St,w,q,Q,io,so,fa],Yn=t=>Ii.find(Oi(t));function da(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ni(t):!0}const ma=new Set(["brightness","contrast","saturate","opacity"]);function pa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(on)||[];if(!s)return t;const i=n.replace(s,"");let o=ma.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const ga=/\b([a-z-]*)\(.*?\)/gu,Ie={...et,getAnimatableNone:t=>{const e=t.match(ga);return e?e.map(pa).join(" "):t}},Xn={...St,transform:Math.round},ya={rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:Kt,scaleX:Kt,scaleY:Kt,scaleZ:Kt,skew:Q,skewX:Q,skewY:Q,distance:w,translateX:w,translateY:w,translateZ:w,x:w,y:w,z:w,perspective:w,transformPerspective:w,opacity:kt,originX:On,originY:On,originZ:w},gn={borderWidth:w,borderTopWidth:w,borderRightWidth:w,borderBottomWidth:w,borderLeftWidth:w,borderRadius:w,radius:w,borderTopLeftRadius:w,borderTopRightRadius:w,borderBottomRightRadius:w,borderBottomLeftRadius:w,width:w,maxWidth:w,height:w,maxHeight:w,top:w,right:w,bottom:w,left:w,padding:w,paddingTop:w,paddingRight:w,paddingBottom:w,paddingLeft:w,margin:w,marginTop:w,marginRight:w,marginBottom:w,marginLeft:w,backgroundPositionX:w,backgroundPositionY:w,...ya,zIndex:Xn,fillOpacity:kt,strokeOpacity:kt,numOctaves:Xn},va={...gn,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:Ie,WebkitFilter:Ie},ji=t=>va[t];function Ni(t,e){let n=ji(t);return n!==Ie&&(n=et),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const xa=new Set(["auto","none","0"]);function Ta(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!xa.has(o)&&Bt(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Ni(n,i)}class wa extends mn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),rn(u))){const c=Bi(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Fi.has(s)||e.length!==2)return;const[i,o]=e,r=Yn(i),a=Yn(o);if(r!==a)if(zn(r)&&zn(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else lt[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||da(e[i]))&&s.push(i);s.length&&Ta(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=lt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=lt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function Wi(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const Ui=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function Ki(t){return ei(t)&&"offsetHeight"in t}const qn=30,ba=t=>!isNaN(parseFloat(t)),Et={current:void 0};class Sa{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var o;const i=I.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=I.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ba(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&ie(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new tn);const s=this.events[e].add(n);return e==="change"?()=>{s(),A.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Et.current&&Et.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=I.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>qn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,qn);return en(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function H(t,e){return new Sa(t,e)}const{schedule:yn}=di(queueMicrotask,!1),z={x:!1,y:!1};function $i(){return z.x||z.y}function Pa(t){return t==="x"||t==="y"?z[t]?null:(z[t]=!0,()=>{z[t]=!1}):z.x||z.y?null:(z.x=z.y=!0,()=>{z.x=z.y=!1})}function zi(t,e){const n=Wi(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Zn(t){return!(t.pointerType==="touch"||$i())}function Aa(t,e,n={}){const[s,i,o]=zi(t,n),r=a=>{if(!Zn(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=h=>{Zn(h)&&(u(h),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const Hi=(t,e)=>e?t===e?!0:Hi(t,e.parentElement):!1,vn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Va=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ca(t){return Va.has(t.tagName)||t.tabIndex!==-1}const Gt=new WeakSet;function Jn(t){return e=>{e.key==="Enter"&&t(e)}}function de(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ma=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Jn(()=>{if(Gt.has(n))return;de(n,"down");const i=Jn(()=>{de(n,"up")}),o=()=>de(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Qn(t){return vn(t)&&!$i()}function Da(t,e,n={}){const[s,i,o]=zi(t,n),r=a=>{const l=a.currentTarget;if(!Qn(a))return;Gt.add(l);const u=e(l,a),c=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Gt.has(l)&&Gt.delete(l),Qn(d)&&typeof u=="function"&&u(d,{success:m})},h=d=>{c(d,l===window||l===document||n.useGlobalTarget||Hi(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),Ki(a)&&(a.addEventListener("focus",u=>Ma(u,i)),!Ca(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function xn(t){return ei(t)&&"ownerSVGElement"in t}const _t=new WeakMap;let tt;const Gi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:xn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],Ea=Gi("inline","width","offsetWidth"),Ra=Gi("block","height","offsetHeight");function La({target:t,borderBoxSize:e}){var n;(n=_t.get(t))==null||n.forEach(s=>{s(t,{get width(){return Ea(t,e)},get height(){return Ra(t,e)}})})}function ka(t){t.forEach(La)}function Ba(){typeof ResizeObserver>"u"||(tt=new ResizeObserver(ka))}function Fa(t,e){tt||Ba();const n=Wi(t);return n.forEach(s=>{let i=_t.get(s);i||(i=new Set,_t.set(s,i)),i.add(e),tt==null||tt.observe(s)}),()=>{n.forEach(s=>{const i=_t.get(s);i==null||i.delete(e),i!=null&&i.size||tt==null||tt.unobserve(s)})}}const Yt=new Set;let mt;function Oa(){mt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yt.forEach(e=>e(t))},window.addEventListener("resize",mt)}function Ia(t){return Yt.add(t),mt||Oa(),()=>{Yt.delete(t),!Yt.size&&typeof mt=="function"&&(window.removeEventListener("resize",mt),mt=void 0)}}function ja(t,e){return typeof t=="function"?Ia(t):Fa(t,e)}function _i(t,e){let n;const s=()=>{const{currentTime:i}=e,r=(i===null?0:i.value)/100;n!==r&&t(r),n=r};return A.preUpdate(s,!0),()=>Y(s)}function Na(t){return xn(t)&&t.tagName==="svg"}function Wa(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],o=t[2+n],r=t[3+n],a=un(i,o,r);return e?a(s):a}const B=t=>!!(t&&t.getVelocity),Ua=[...Ii,D,et],Ka=t=>Ua.find(Oi(t)),Tn=T.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function $a(t=!0){const e=T.useContext(qe);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=T.useId();T.useEffect(()=>{if(t)return i(o)},[t]);const r=T.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Yi=T.createContext({strict:!1}),ts={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"]},wt={};for(const t in ts)wt[t]={isEnabled:e=>ts[t].some(n=>!!e[n])};function za(t){for(const e in t)wt[e]={...wt[e],...t[e]}}const Ha=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function te(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ha.has(t)}let Xi=t=>!te(t);function Ga(t){typeof t=="function"&&(Xi=e=>e.startsWith("on")?!te(e):t(e))}try{Ga(require("@emotion/is-prop-valid").default)}catch{}function _a(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Xi(i)||n===!0&&te(i)||!e&&!te(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const re=T.createContext({});function oe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ft(t){return typeof t=="string"||Array.isArray(t)}const wn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bn=["initial",...wn];function ae(t){return oe(t.animate)||bn.some(e=>Ft(t[e]))}function qi(t){return!!(ae(t)||t.variants)}function Ya(t,e){if(ae(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ft(n)?n:void 0,animate:Ft(s)?s:void 0}}return t.inherit!==!1?e:{}}function Xa(t){const{initial:e,animate:n}=Ya(t,T.useContext(re));return T.useMemo(()=>({initial:e,animate:n}),[es(e),es(n)])}function es(t){return Array.isArray(t)?t.join(" "):t}function ns(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Vt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(w.test(t))t=parseFloat(t);else return t;const n=ns(t,e.target.x),s=ns(t,e.target.y);return`${n}% ${s}%`}},qa={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=et.parse(t);if(i.length>5)return s;const o=et.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=M(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},je={borderRadius:{...Vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomLeftRadius:Vt,borderBottomRightRadius:Vt,boxShadow:qa};function Zi(t,{layout:e,layoutId:n}){return At.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!je[t]||t==="opacity")}const Za={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ja=Pt.length;function Qa(t,e,n){let s="",i=!0;for(let o=0;o<Ja;o++){const r=Pt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Ui(a,gn[r]);if(!l){i=!1;const c=Za[r]||r;s+=`${c}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Sn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(At.has(l)){r=!0;continue}else if(pi(l)){i[l]=u;continue}else{const c=Ui(u,gn[l]);l.startsWith("origin")?(a=!0,o[l]=c):s[l]=c}}if(e.transform||(r||n?s.transform=Qa(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;s.transformOrigin=`${l} ${u} ${c}`}}const Pn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ji(t,e,n){for(const s in e)!B(e[s])&&!Zi(s,n)&&(t[s]=e[s])}function tl({transformTemplate:t},e){return T.useMemo(()=>{const n=Pn();return Sn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function el(t,e){const n=t.style||{},s={};return Ji(s,n,t),Object.assign(s,tl(t,e)),s}function nl(t,e){const n={},s=el(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const sl={offset:"stroke-dashoffset",array:"stroke-dasharray"},il={offset:"strokeDashoffset",array:"strokeDasharray"};function rl(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?sl:il;t[o.offset]=w.transform(-s);const r=w.transform(e),a=w.transform(n);t[o.array]=`${r} ${a}`}function Qi(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(Sn(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&rl(h,i,o,r,!1)}const tr=()=>({...Pn(),attrs:{}}),er=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ol(t,e,n,s){const i=T.useMemo(()=>{const o=tr();return Qi(o,e,er(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ji(o,t.style,t),i.style={...o,...i.style}}return i}const al=["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 An(t){return typeof t!="string"||t.includes("-")?!1:!!(al.indexOf(t)>-1||/[A-Z]/u.test(t))}function ll(t,e,n,{latestValues:s},i,o=!1){const a=(An(t)?ol:nl)(e,s,i,t),l=_a(e,typeof t=="string",o),u=t!==T.Fragment?{...l,...a,ref:n}:{},{children:c}=e,h=T.useMemo(()=>B(c)?c.get():c,[c]);return T.createElement(t,{...u,children:h})}function ss(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Vn(t,e,n,s){if(typeof e=="function"){const[i,o]=ss(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=ss(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function Xt(t){return B(t)?t.get():t}function cl({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:ul(n,s,i,t),renderState:e()}}function ul(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Xt(o[f]);let{initial:r,animate:a}=t;const l=ae(t),u=qi(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;if(h&&typeof h!="boolean"&&!oe(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const m=Vn(t,f[d]);if(m){const{transitionEnd:g,transition:v,...p}=m;for(const x in p){let y=p[x];if(Array.isArray(y)){const P=c?y.length-1:0;y=y[P]}y!==null&&(i[x]=y)}for(const x in g)i[x]=g[x]}}}return i}const nr=t=>(e,n)=>{const s=T.useContext(re),i=T.useContext(qe),o=()=>cl(t,e,s,i);return n?o():se(o)};function Cn(t,e,n){var o;const{style:s}=t,i={};for(const r in s)(B(s[r])||e.style&&B(e.style[r])||Zi(r,t)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(i[r]=s[r]);return i}const hl=nr({scrapeMotionValuesFromProps:Cn,createRenderState:Pn});function sr(t,e,n){const s=Cn(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const o=Pt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}const fl=nr({scrapeMotionValuesFromProps:sr,createRenderState:tr}),dl=Symbol.for("motionComponentSymbol");function pt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ml(t,e,n){return T.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):pt(n)&&(n.current=s))},[e])}const Mn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),pl="framerAppearId",ir="data-"+Mn(pl),rr=T.createContext({});function gl(t,e,n,s,i){var g,v;const{visualElement:o}=T.useContext(re),r=T.useContext(Yi),a=T.useContext(qe),l=T.useContext(Tn).reducedMotion,u=T.useRef(null);s=s||r.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,h=T.useContext(rr);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&yl(u.current,n,i,h);const f=T.useRef(!1);T.useInsertionEffect(()=>{c&&f.current&&c.update(n,a)});const d=n[ir],m=T.useRef(!!d&&!((g=window.MotionHandoffIsComplete)!=null&&g.call(window,d))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,d)));return Xe(()=>{c&&(f.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),c.scheduleRenderMicrotask(),m.current&&c.animationState&&c.animationState.animateChanges())}),T.useEffect(()=>{c&&(!m.current&&c.animationState&&c.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var p;(p=window.MotionHandoffMarkAsComplete)==null||p.call(window,d)}),m.current=!1),c.enteringChildren=void 0)}),c}function yl(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:or(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&pt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function or(t){if(t)return t.options.allowProjection!==!1?t.projection:or(t.parent)}function me(t,{forwardMotionProps:e=!1}={},n,s){n&&za(n);const i=An(t)?fl:hl;function o(a,l){let u;const c={...T.useContext(Tn),...a,layoutId:vl(a)},{isStatic:h}=c,f=Xa(a),d=i(a,h);if(!h&&Ye){xl(c,n);const m=Tl(c);u=m.MeasureLayout,f.visualElement=gl(t,d,c,s,m.ProjectionNode)}return X.jsxs(re.Provider,{value:f,children:[u&&f.visualElement?X.jsx(u,{visualElement:f.visualElement,...c}):null,ll(t,a,ml(d,f.visualElement,l),d,h,e)]})}o.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const r=T.forwardRef(o);return r[dl]=t,r}function vl({layoutId:t}){const e=T.useContext(Qs).id;return e&&t!==void 0?e+"-"+t:t}function xl(t,e){const n=T.useContext(Yi).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?bt(!1,s,"lazy-strict-mode"):_(!1,s,"lazy-strict-mode")}}function Tl(t){const{drag:e,layout:n}=wt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function wl(t,e){if(typeof Proxy>"u")return me;const n=new Map,s=(o,r)=>me(o,r,t,e),i=(o,r)=>(process.env.NODE_ENV!=="production"&&ie(!1,"motion() is deprecated. Use motion.create() instead."),s(o,r));return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,me(r,void 0,t,e)),n.get(r))})}function ar({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function bl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Sl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function pe(t){return t===void 0||t===1}function Ne({scale:t,scaleX:e,scaleY:n}){return!pe(t)||!pe(e)||!pe(n)}function rt(t){return Ne(t)||lr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function lr(t){return is(t.x)||is(t.y)}function is(t){return t&&t!=="0%"}function ee(t,e,n){const s=t-n,i=e*s;return n+i}function rs(t,e,n,s,i){return i!==void 0&&(t=ee(t,i,s)),ee(t,n,s)+e}function We(t,e=0,n=1,s,i){t.min=rs(t.min,e,n,s,i),t.max=rs(t.max,e,n,s,i)}function cr(t,{x:e,y:n}){We(t.x,e.translate,e.scale,e.originPoint),We(t.y,n.translate,n.scale,n.originPoint)}const os=.999999999999,as=1.0000000000001;function Pl(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&yt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,cr(t,r)),s&&rt(o.latestValues)&&yt(t,o.latestValues))}e.x<as&&e.x>os&&(e.x=1),e.y<as&&e.y>os&&(e.y=1)}function gt(t,e){t.min=t.min+e,t.max=t.max+e}function ls(t,e,n,s,i=.5){const o=M(t.min,t.max,i);We(t,e,n,o,s)}function yt(t,e){ls(t.x,e.x,e.scaleX,e.scale,e.originX),ls(t.y,e.y,e.scaleY,e.scale,e.originY)}function ur(t,e){return ar(Sl(t.getBoundingClientRect(),e))}function Al(t,e,n){const s=ur(t,n),{scroll:i}=e;return i&&(gt(s.x,i.offset.x),gt(s.y,i.offset.y)),s}const cs=()=>({translate:0,scale:1,origin:0,originPoint:0}),vt=()=>({x:cs(),y:cs()}),us=()=>({min:0,max:0}),R=()=>({x:us(),y:us()}),Ue={current:null},hr={current:!1};function Vl(){if(hr.current=!0,!!Ye)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ue.current=t.matches;t.addEventListener("change",e),e()}else Ue.current=!1}const Cl=new WeakMap;function Ml(t,e,n){for(const s in e){const i=e[s],o=n[s];if(B(i))t.addValue(s,i);else if(B(o))t.addValue(s,H(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,H(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const hs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Dl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=mn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=I.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,A.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=ae(n),this.isVariantNode=qi(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&B(d)&&d.set(l[f])}}mount(e){var n;this.current=e,Cl.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((s,i)=>this.bindToMotionValue(i,s)),hr.current||Vl(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ue.current,process.env.NODE_ENV!=="production"&&ie(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=At.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&A.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in wt){const n=wt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):R()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<hs.length;s++){const i=hs[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Ml(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=H(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(ti(s)||ni(s))?s=parseFloat(s):!Ka(s)&&et.test(n)&&(s=Ni(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Vn(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!B(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new tn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){yn.render(this.render)}}class fr extends Dl{constructor(){super(...arguments),this.KeyframeResolver=wa}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dr(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i==null||i.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function El(t){return window.getComputedStyle(t)}class Rl extends fr{constructor(){super(...arguments),this.type="html",this.renderInstance=dr}readValueFromInstance(e,n){var s;if(At.has(n))return(s=this.projection)!=null&&s.isProjecting?Re(n):Wo(e,n);{const i=El(e),o=(pi(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ur(e,n)}build(e,n,s){Sn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Cn(e,n,s)}}const mr=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 Ll(t,e,n,s){dr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(mr.has(i)?i:Mn(i),e.attrs[i])}class kl extends fr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=R}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(At.has(n)){const s=ji(n);return s&&s.default||0}return n=mr.has(n)?n:Mn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return sr(e,n,s)}build(e,n,s){Qi(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Ll(e,n,s,i)}mount(e){this.isSVGTag=er(e.tagName),super.mount(e)}}const Bl=(t,e)=>An(t)?new kl(e):new Rl(e,{allowProjection:t!==T.Fragment});function xt(t,e,n){const s=t.getProps();return Vn(s,e,n!==void 0?n:s.custom,t)}const Ke=t=>Array.isArray(t);function Fl(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,H(n))}function Ol(t){return Ke(t)?t[t.length-1]||0:t}function Il(t,e){const n=xt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Ol(o[r]);Fl(t,r,a)}}function jl(t){return!!(B(t)&&t.add)}function $e(t,e){const n=t.getValue("willChange");if(jl(n))return n.add(e);if(!n&&J.WillChange){const s=new J.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function pr(t){return t.props[ir]}const Nl=t=>t!==null;function Wl(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Nl),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}const Ul={type:"spring",stiffness:500,damping:25,restSpeed:10},Kl=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$l={type:"keyframes",duration:.8},zl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Hl=(t,{keyframes:e})=>e.length>2?$l:At.has(t)?t.startsWith("scale")?Kl(e[1]):Ul:zl;function Gl({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const Dn=(t,e,n,s={},i,o)=>r=>{const a=pn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-G(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};Gl(a)||Object.assign(c,Hl(t,c)),c.duration&&(c.duration=G(c.duration)),c.repeatDelay&&(c.repeatDelay=G(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Oe(c),c.delay===0&&(h=!0)),(J.instantAnimations||J.skipAnimations)&&(h=!0,Oe(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=Wl(c.keyframes,a);if(f!==void 0){A.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new dn(c):new la(c)};function _l({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function gr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;s&&(o=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const h=t.getValue(c,t.latestValues[c]??null),f=a[c];if(f===void 0||u&&_l(u,c))continue;const d={delay:n,...pn(o||{},c)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===m&&!d.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const p=pr(t);if(p){const x=window.MotionHandoffAnimation(p,c,A);x!==null&&(d.startTime=x,g=!0)}}$e(t,c),h.start(Dn(c,h,f,t.shouldReduceMotion&&Fi.has(c)?{type:!1}:d,t,g));const v=h.animation;v&&l.push(v)}return r&&Promise.all(l).then(()=>{A.update(()=>{r&&Il(t,r)})}),l}function yr(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}function ze(t,e,n={}){var l;const s=xt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(gr(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=i;return Yl(t,e,u,c,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[o,r]:[r,o];return u().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function Yl(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ze(l,e,{...r,delay:n+(typeof s=="function"?0:s)+yr(t.variantChildren,l,s,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Xl(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>ze(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=ze(t,e,n);else{const i=typeof e=="function"?xt(t,e,n.custom):e;s=Promise.all(gr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function vr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const ql=bn.length;function xr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?xr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<ql;n++){const s=bn[n],i=t.props[s];(Ft(i)||i===!1)&&(e[s]=i)}return e}const Zl=[...wn].reverse(),Jl=wn.length;function Ql(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Xl(t,n,s)))}function tc(t){let e=Ql(t),n=fs(),s=!0;const i=l=>(u,c)=>{var f;const h=xt(t,c,l==="exit"?(f=t.presenceContext)==null?void 0:f.custom:void 0);if(h){const{transition:d,transitionEnd:m,...g}=h;u={...u,...g,...m}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=xr(t.parent)||{},h=[],f=new Set;let d={},m=1/0;for(let v=0;v<Jl;v++){const p=Zl[v],x=n[p],y=u[p]!==void 0?u[p]:c[p],P=Ft(y),b=p===l?x.isActive:null;b===!1&&(m=v);let V=y===c[p]&&y!==u[p]&&P;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),x.protectedKeys={...d},!x.isActive&&b===null||!y&&!x.prevProp||oe(y)||typeof y=="boolean")continue;const E=ec(x.prevProp,y);let S=E||p===l&&x.isActive&&!V&&P||v>m&&P,O=!1;const N=Array.isArray(y)?y:[y];let ut=N.reduce(i(p),{});b===!1&&(ut={});const{prevResolvedValues:En={}}=x,Ir={...En,...ut},Rn=k=>{S=!0,f.has(k)&&(O=!0,f.delete(k)),x.needsAnimating[k]=!0;const W=t.getValue(k);W&&(W.liveStyle=!1)};for(const k in Ir){const W=ut[k],st=En[k];if(d.hasOwnProperty(k))continue;let ht=!1;Ke(W)&&Ke(st)?ht=!vr(W,st):ht=W!==st,ht?W!=null?Rn(k):f.add(k):W!==void 0&&f.has(k)?Rn(k):x.protectedKeys[k]=!0}x.prevProp=y,x.prevResolvedValues=ut,x.isActive&&(d={...d,...ut}),s&&t.blockInitialAnimation&&(S=!1);const Ln=V&&E;S&&(!Ln||O)&&h.push(...N.map(k=>{const W={type:p};if(typeof k=="string"&&s&&!Ln&&t.manuallyAnimateOnMount&&t.parent){const{parent:st}=t,ht=xt(st,k);if(st.enteringChildren&&ht){const{delayChildren:jr}=ht.transition||{};W.delay=yr(st.enteringChildren,t,jr)}}return{animation:k,options:W}}))}if(f.size){const v={};if(typeof u.initial!="boolean"){const p=xt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);p&&p.transition&&(v.transition=p.transition)}f.forEach(p=>{const x=t.getBaseTarget(p),y=t.getValue(p);y&&(y.liveStyle=!0),v[p]=x??null}),h.push({animation:v})}let g=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(g=!1),s=!1,g?e(h):Promise.resolve()}function a(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(f=>{var d;return(d=f.animationState)==null?void 0:d.setActive(l,u)}),n[l].isActive=u;const c=r(l);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=fs()}}}function ec(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!vr(e,t):!1}function it(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function fs(){return{animate:it(!0),whileInView:it(),whileHover:it(),whileTap:it(),whileDrag:it(),whileFocus:it(),exit:it()}}class nt{constructor(e){this.isMounted=!1,this.node=e}update(){}}class nc extends nt{constructor(e){super(e),e.animationState||(e.animationState=tc(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();oe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let sc=0;class ic extends nt{constructor(){super(...arguments),this.id=sc++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const rc={animation:{Feature:nc},exit:{Feature:ic}};function Ot(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Wt(t){return{point:{x:t.pageX,y:t.pageY}}}const oc=t=>e=>vn(e)&&t(e,Wt(e));function Rt(t,e,n,s){return Ot(t,e,oc(n),s)}const Tr=1e-4,ac=1-Tr,lc=1+Tr,wr=.01,cc=0-wr,uc=0+wr;function F(t){return t.max-t.min}function hc(t,e,n){return Math.abs(t-e)<=n}function ds(t,e,n,s=.5){t.origin=s,t.originPoint=M(e.min,e.max,t.origin),t.scale=F(n)/F(e),t.translate=M(n.min,n.max,t.origin)-t.originPoint,(t.scale>=ac&&t.scale<=lc||isNaN(t.scale))&&(t.scale=1),(t.translate>=cc&&t.translate<=uc||isNaN(t.translate))&&(t.translate=0)}function Lt(t,e,n,s){ds(t.x,e.x,n.x,s?s.originX:void 0),ds(t.y,e.y,n.y,s?s.originY:void 0)}function ms(t,e,n){t.min=n.min+e.min,t.max=t.min+F(e)}function fc(t,e,n){ms(t.x,e.x,n.x),ms(t.y,e.y,n.y)}function ps(t,e,n){t.min=e.min-n.min,t.max=t.min+F(e)}function ne(t,e,n){ps(t.x,e.x,n.x),ps(t.y,e.y,n.y)}function U(t){return[t("x"),t("y")]}const br=({current:t})=>t?t.ownerDocument.defaultView:null,gs=(t,e)=>Math.abs(t-e);function dc(t,e){const n=gs(t.x,e.x),s=gs(t.y,e.y);return Math.sqrt(n**2+s**2)}class Sr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=ye(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,m=dc(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!d&&!m)return;const{point:g}=f,{timestamp:v}=L;this.history.push({...g,timestamp:v});const{onStart:p,onMove:x}=this.handlers;d||(p&&p(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,d)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ge(d,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(f,d)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=ye(f.type==="pointercancel"?this.lastMoveEventInfo:ge(d,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,p),g&&g(f,p)},!vn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const a=Wt(e),l=ge(a,this.transformPagePoint),{point:u}=l,{timestamp:c}=L;this.history=[{...u,timestamp:c}];const{onSessionStart:h}=n;h&&h(e,ye(l,this.history)),this.removeListeners=It(Rt(this.contextWindow,"pointermove",this.handlePointerMove),Rt(this.contextWindow,"pointerup",this.handlePointerUp),Rt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Y(this.updatePoint)}}function ge(t,e){return e?{point:e(t.point)}:t}function ys(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ye({point:t},e){return{point:t,delta:ys(t,Pr(e)),offset:ys(t,mc(e)),velocity:pc(e,.1)}}function mc(t){return t[0]}function Pr(t){return t[t.length-1]}function pc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Pr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>G(e)));)n--;if(!s)return{x:0,y:0};const o=K(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function gc(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?M(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?M(n,t,s.max):Math.min(t,n)),t}function vs(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yc(t,{top:e,left:n,bottom:s,right:i}){return{x:vs(t.x,n,i),y:vs(t.y,e,s)}}function xs(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function vc(t,e){return{x:xs(t.x,e.x),y:xs(t.y,e.y)}}function xc(t,e){let n=.5;const s=F(t),i=F(e);return i>s?n=Tt(e.min,e.max-s,t.min):s>i&&(n=Tt(t.min,t.max-i,e.min)),Z(0,1,n)}function Tc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const He=.35;function wc(t=He){return t===!1?t=0:t===!0&&(t=He),{x:Ts(t,"left","right"),y:Ts(t,"top","bottom")}}function Ts(t,e,n){return{min:ws(t,e),max:ws(t,n)}}function ws(t,e){return typeof t=="number"?t:t[e]||0}const bc=new WeakMap;class Sc{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=R(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=h=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Wt(h).point)},r=(h,f)=>{const{drag:d,dragPropagation:m,onDragStart:g}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Pa(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),U(p=>{let x=this.getAxisMotionValue(p).get()||0;if(q.test(x)){const{projection:y}=this.visualElement;if(y&&y.layout){const P=y.layout.layoutBox[p];P&&(x=F(P)*(parseFloat(x)/100))}}this.originPoint[p]=x}),g&&A.postRender(()=>g(h,f)),$e(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:g,onDrag:v}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:p}=f;if(m&&this.currentDirection===null){this.currentDirection=Pc(p),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,p),this.updateAxis("y",f.point,p),this.visualElement.render(),v&&v(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>U(h=>{var f;return this.getAnimationState(h)==="paused"&&((f=this.getAxisMotionValue(h).animation)==null?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Sr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:br(this.visualElement)})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&A.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!$t(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=gc(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;e&&pt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=yc(s.layoutBox,e):this.constraints=!1,this.elastic=wc(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&U(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Tc(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!pt(e))return!1;const s=e.current;_(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Al(s,i.root,this.visualElement.getTransformPagePoint());let r=vc(i.layout.layoutBox,o);if(n){const a=n(bl(r));this.hasMutatedConstraints=!!a,a&&(r=ar(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=U(c=>{if(!$t(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return $e(this.visualElement,e),s.start(Dn(e,s,0,n,this.visualElement,!1))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){U(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){U(n=>{const{drag:s}=this.getProps();if(!$t(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-M(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!pt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=xc({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),U(r=>{if(!$t(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(M(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;bc.set(this.visualElement,this);const e=this.visualElement.current,n=Rt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();pt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),A.read(s);const r=Ot(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(U(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=He,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function $t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Pc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Ac extends nt{constructor(e){super(e),this.removeGroupControls=j,this.removeListeners=j,this.controls=new Sc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||j}unmount(){this.removeGroupControls(),this.removeListeners()}}const bs=t=>(e,n)=>{t&&A.postRender(()=>t(e,n))};class Vc extends nt{constructor(){super(...arguments),this.removePointerDownListener=j}onPointerDown(e){this.session=new Sr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:br(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:bs(e),onStart:bs(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&A.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let ve=!1;class Cc extends T.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),ve&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,ve=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||A.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),yn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;ve=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ar(t){const[e,n]=$a(),s=T.useContext(Qs);return X.jsx(Cc,{...t,layoutGroup:s,switchLayoutGroup:T.useContext(rr),isPresent:e,safeToRemove:n})}function Mc(t,e,n){const s=B(t)?t:H(t);return s.start(Dn("",s,e,n)),s.animation}const Dc=(t,e)=>t.depth-e.depth;class Ec{constructor(){this.children=[],this.isDirty=!1}add(e){Ze(this.children,e),this.isDirty=!0}remove(e){Je(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Dc),this.isDirty=!1,this.children.forEach(e)}}function Rc(t,e){const n=I.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Y(s),t(o-e))};return A.setup(s,!0),()=>Y(s)}const Vr=["TopLeft","TopRight","BottomLeft","BottomRight"],Lc=Vr.length,Ss=t=>typeof t=="string"?parseFloat(t):t,Ps=t=>typeof t=="number"||w.test(t);function kc(t,e,n,s,i,o){i?(t.opacity=M(0,n.opacity??1,Bc(s)),t.opacityExit=M(e.opacity??1,0,Fc(s))):o&&(t.opacity=M(e.opacity??1,n.opacity??1,s));for(let r=0;r<Lc;r++){const a=`border${Vr[r]}Radius`;let l=As(e,a),u=As(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ps(l)===Ps(u)?(t[a]=Math.max(M(Ss(l),Ss(u),s),0),(q.test(u)||q.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function As(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Bc=Cr(0,.5,ci),Fc=Cr(.5,.95,j);function Cr(t,e,n){return s=>s<t?0:s>e?1:n(Tt(t,e,s))}function Vs(t,e){t.min=e.min,t.max=e.max}function $(t,e){Vs(t.x,e.x),Vs(t.y,e.y)}function Cs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ms(t,e,n,s,i){return t-=e,t=ee(t,1/n,s),i!==void 0&&(t=ee(t,1/i,s)),t}function Oc(t,e=0,n=1,s=.5,i,o=t,r=t){if(q.test(e)&&(e=parseFloat(e),e=M(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=M(o.min,o.max,s);t===o&&(a-=e),t.min=Ms(t.min,e,n,a,i),t.max=Ms(t.max,e,n,a,i)}function Ds(t,e,[n,s,i],o,r){Oc(t,e[n],e[s],e[i],e.scale,o,r)}const Ic=["x","scaleX","originX"],jc=["y","scaleY","originY"];function Es(t,e,n,s){Ds(t.x,e,Ic,n?n.x:void 0,s?s.x:void 0),Ds(t.y,e,jc,n?n.y:void 0,s?s.y:void 0)}function Rs(t){return t.translate===0&&t.scale===1}function Mr(t){return Rs(t.x)&&Rs(t.y)}function Ls(t,e){return t.min===e.min&&t.max===e.max}function Nc(t,e){return Ls(t.x,e.x)&&Ls(t.y,e.y)}function ks(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Dr(t,e){return ks(t.x,e.x)&&ks(t.y,e.y)}function Bs(t){return F(t.x)/F(t.y)}function Fs(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Wc{constructor(){this.members=[]}add(e){Ze(this.members,e),e.scheduleRender()}remove(e){if(Je(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Uc(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const xe=["","X","Y","Z"],Kc=1e3;let $c=0;function Te(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Er(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=pr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",A,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Er(s)}function Rr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=$c++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Gc),this.nodes.forEach(qc),this.nodes.forEach(Zc),this.nodes.forEach(_c)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ec)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new tn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=xn(r)&&!Na(r),this.instance=r;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;A.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=Rc(f,250),qt.hasAnimatedSinceResize&&(qt.hasAnimatedSinceResize=!1,this.nodes.forEach(js)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||nu,{onLayoutAnimationStart:g,onLayoutAnimationComplete:v}=u.getProps(),p=!this.targetLayout||!Dr(this.targetLayout,d),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...pn(m,"layout"),onPlay:g,onComplete:v};(u.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(c,x)}else h||js(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Y(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(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Er(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Os);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Is);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Xc),this.nodes.forEach(zc),this.nodes.forEach(Hc)):this.nodes.forEach(Is),this.clearAllSnapshots();const a=I.now();L.delta=Z(0,1e3/60,a-L.timestamp),L.timestamp=a,L.isProcessing=!0,le.update.process(L),le.preRender.process(L),le.render.process(L),L.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,yn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Yc),this.sharedNodes.forEach(Qc)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!F(this.snapshot.measuredBox.x)&&!F(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=R(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Mr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||rt(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),su(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:r}=this.options;if(!r)return R();const a=r.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(iu))){const{scroll:c}=this.root;c&&(gt(a.x,c.offset.x),gt(a.y,c.offset.y))}return a}removeElementScroll(r){var l;const a=R();if($(a,r),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&$(a,r),gt(a.x,h.offset.x),gt(a.y,h.offset.y))}return a}applyTransform(r,a=!1){const l=R();$(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&yt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),rt(c.latestValues)&&yt(l,c.latestValues)}return rt(this.latestValues)&&yt(l,this.latestValues),l}removeTransform(r){const a=R();$(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!rt(u.latestValues))continue;Ne(u.latestValues)&&u.updateSnapshot();const c=R(),h=u.measurePageBox();$(c,h),Es(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return rt(this.latestValues)&&Es(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==L.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=L.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=R(),this.targetWithTransforms=R()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),cr(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Ne(this.parent.latestValues)||lr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,l){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),ne(this.relativeTargetOrigin,a,l),$(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===L.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Pl(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=R());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cs(this.prevProjectionDelta.x,this.projectionDelta.x),Cs(this.prevProjectionDelta.y,this.projectionDelta.y)),Lt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Fs(this.projectionDelta.x,this.prevProjectionDelta.x)||!Fs(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=vt(),this.projectionDelta=vt(),this.projectionDeltaWithTransform=vt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=vt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=R(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,g=d!==m,v=this.getStack(),p=!v||v.members.length<=1,x=!!(g&&!p&&this.options.crossfade===!0&&!this.path.some(eu));this.animationProgress=0;let y;this.mixTargetDelta=P=>{const b=P/1e3;Ns(h.x,r.x,b),Ns(h.y,r.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ne(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),tu(this.relativeTarget,this.relativeTargetOrigin,f,b),y&&Nc(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=R()),$(y,this.relativeTarget)),g&&(this.animationValues=c,kc(c,u,this.latestValues,b,x,p)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=A.update(()=>{qt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=H(0)),this.currentAnimation=Mc(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),r.onUpdate&&r.onUpdate(c)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Kc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&Lr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||R();const h=F(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=F(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}$(a,l),yt(a,c),Lt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Wc),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var a;const{layoutId:r}=this.options;return r?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:r}=this.options;return r?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Te("z",r,u,this.animationValues);for(let c=0;c<xe.length;c++)Te(`rotate${xe[c]}`,r,u,this.animationValues),Te(`skew${xe[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=Xt(a==null?void 0:a.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=Xt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!rt(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=Uc(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),r.transform=h;const{x:f,y:d}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?r.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in je){if(c[m]===void 0)continue;const{correct:g,applyTo:v,isCSSVariable:p}=je[m],x=h==="none"?c[m]:g(c[m],u);if(v){const y=v.length;for(let P=0;P<y;P++)r[v[P]]=x}else p?this.options.visualElement.renderState.vars[m]=x:r[m]=x}this.options.layoutId&&(r.pointerEvents=u===this?Xt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Os),this.root.sharedNodes.clear()}}}function zc(t){t.updateLayout()}function Hc(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=e.source!==t.layout.source;o==="size"?U(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=F(f);f.min=s[h].min,f.max=f.min+d}):Lr(o,e.layoutBox,s)&&U(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=F(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=vt();Lt(a,s,e.layoutBox);const l=vt();r?Lt(l,t.applyTransform(i,!0),e.measuredBox):Lt(l,s,e.layoutBox);const u=!Mr(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=R();ne(m,e.layoutBox,f.layoutBox);const g=R();ne(g,s,d.layoutBox),Dr(m,g)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Gc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function _c(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Yc(t){t.clearSnapshot()}function Os(t){t.clearMeasurements()}function Is(t){t.isLayoutDirty=!1}function Xc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function js(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qc(t){t.resolveTargetDelta()}function Zc(t){t.calcProjection()}function Jc(t){t.resetSkewAndRotation()}function Qc(t){t.removeLeadSnapshot()}function Ns(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ws(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function tu(t,e,n,s){Ws(t.x,e.x,n.x,s),Ws(t.y,e.y,n.y,s)}function eu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const nu={duration:.45,ease:[.4,0,.1,1]},Us=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Ks=Us("applewebkit/")&&!Us("chrome/")?Math.round:j;function $s(t){t.min=Ks(t.min),t.max=Ks(t.max)}function su(t){$s(t.x),$s(t.y)}function Lr(t,e,n){return t==="position"||t==="preserve-aspect"&&!hc(Bs(e),Bs(n),.2)}function iu(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const ru=Rr({attachResizeListener:(t,e)=>Ot(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),we={current:void 0},kr=Rr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!we.current){const t=new ru({});t.mount(window),t.setOptions({layoutScroll:!0}),we.current=t}return we.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),ou={pan:{Feature:Vc},drag:{Feature:Ac,ProjectionNode:kr,MeasureLayout:Ar}};function zs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&A.postRender(()=>o(e,Wt(e)))}class au extends nt{mount(){const{current:e}=this.node;e&&(this.unmount=Aa(e,(n,s)=>(zs(this.node,s,"Start"),i=>zs(this.node,i,"End"))))}unmount(){}}class lu extends nt{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=It(Ot(this.node.current,"focus",()=>this.onFocus()),Ot(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Hs(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&A.postRender(()=>o(e,Wt(e)))}class cu extends nt{mount(){const{current:e}=this.node;e&&(this.unmount=Da(e,(n,s)=>(Hs(this.node,s,"Start"),(i,{success:o})=>Hs(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ge=new WeakMap,be=new WeakMap,uu=t=>{const e=Ge.get(t.target);e&&e(t)},hu=t=>{t.forEach(uu)};function fu({root:t,...e}){const n=t||document;be.has(n)||be.set(n,{});const s=be.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(hu,{root:t,...e})),s[i]}function du(t,e,n){const s=fu(e);return Ge.set(t,n),s.observe(t),()=>{Ge.delete(t),s.unobserve(t)}}const mu={some:0,all:1};class pu extends nt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:mu[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return du(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(gu(e,n))&&this.startObserver()}unmount(){}}function gu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const yu={inView:{Feature:pu},tap:{Feature:cu},focus:{Feature:lu},hover:{Feature:au}},vu={layout:{ProjectionNode:kr,MeasureLayout:Ar}},xu={...rc,...yu,...ou,...vu},Tu=wl(xu,Bl),wu=50,Gs=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),bu=()=>({time:0,x:Gs(),y:Gs()}),Su={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function _s(t,e,n,s){const i=n[e],{length:o,position:r}=Su[e],a=i.current,l=n.time;i.current=t[`scroll${r}`],i.scrollLength=t[`scroll${o}`]-t[`client${o}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=Tt(0,i.scrollLength,i.current);const u=s-l;i.velocity=u>wu?0:en(i.current-a,u)}function Pu(t,e,n){_s(t,"x",e,n),_s(t,"y",e,n),e.time=n}function Au(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(Ki(s))n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if(s.tagName==="svg"){const i=s.getBoundingClientRect();s=s.parentElement;const o=s.getBoundingClientRect();n.x+=i.left-o.left,n.y+=i.top-o.top}else if(s instanceof SVGGraphicsElement){const{x:i,y:o}=s.getBBox();n.x+=i,n.y+=o;let r=null,a=s.parentNode;for(;!r;)a.tagName==="svg"&&(r=a),a=s.parentNode;s=r}else break;return n}const _e={start:0,center:.5,end:1};function Ys(t,e,n=0){let s=0;if(t in _e&&(t=_e[t]),typeof t=="string"){const i=parseFloat(t);t.endsWith("px")?s=i:t.endsWith("%")?t=i/100:t.endsWith("vw")?s=i/100*document.documentElement.clientWidth:t.endsWith("vh")?s=i/100*document.documentElement.clientHeight:t=i}return typeof t=="number"&&(s=e*t),n+s}const Vu=[0,0];function Cu(t,e,n,s){let i=Array.isArray(t)?t:Vu,o=0,r=0;return typeof t=="number"?i=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?i=t.split(" "):i=[t,_e[t]?t:"0"]),o=Ys(i[0],n,s),r=Ys(i[1],e),o-r}const Mu={All:[[0,0],[1,1]]},Du={x:0,y:0};function Eu(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function Ru(t,e,n){const{offset:s=Mu.All}=n,{target:i=t,axis:o="y"}=n,r=o==="y"?"height":"width",a=i!==t?Au(i,t):Du,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:Eu(i),u={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let c=!e[o].interpolate;const h=s.length;for(let f=0;f<h;f++){const d=Cu(s[f],u[r],l[r],a[o]);!c&&d!==e[o].interpolatorOffsets[f]&&(c=!0),e[o].offset[f]=d}c&&(e[o].interpolate=un(e[o].offset,Ai(s),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=Z(0,1,e[o].interpolate(e[o].current))}function Lu(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight,process.env.NODE_ENV!=="production"&&t&&e&&e!==t&&ie(getComputedStyle(t).position!=="static","Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.")}function ku(t,e,n,s={}){return{measure:i=>{Lu(t,s.target,n),Pu(t,n,i),(s.offset||s.target)&&Ru(t,n,s)},notify:()=>e(n)}}const Ct=new WeakMap,Xs=new WeakMap,Se=new WeakMap,qs=t=>t===document.scrollingElement?window:t;function Br(t,{container:e=document.scrollingElement,...n}={}){if(!e)return j;let s=Se.get(e);s||(s=new Set,Se.set(e,s));const i=bu(),o=ku(e,t,i,n);if(s.add(o),!Ct.has(e)){const a=()=>{for(const h of s)h.measure(L.timestamp);A.preUpdate(l)},l=()=>{for(const h of s)h.notify()},u=()=>A.read(a);Ct.set(e,u);const c=qs(e);window.addEventListener("resize",u,{passive:!0}),e!==document.documentElement&&Xs.set(e,ja(e,u)),c.addEventListener("scroll",u,{passive:!0}),u()}const r=Ct.get(e);return A.read(r,!1,!0),()=>{var u;Y(r);const a=Se.get(e);if(!a||(a.delete(o),a.size))return;const l=Ct.get(e);Ct.delete(e),l&&(qs(e).removeEventListener("scroll",l),(u=Xs.get(e))==null||u(),window.removeEventListener("resize",l))}}const Zs=new Map;function Bu(t){const e={value:0},n=Br(s=>{e.value=s[t.axis].progress*100},t);return{currentTime:e,cancel:n}}function Fr({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const i=Zs.get(e)??new Map;Zs.set(e,i);const o=n.target??"self",r=i.get(o)??{},a=s+(n.offset??[]).join(",");return r[a]||(r[a]=!n.target&&Di()?new ScrollTimeline({source:e,axis:s}):Bu({container:e,...n})),r[a]}function Fu(t,e){const n=Fr(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:s=>(s.pause(),_i(i=>{s.time=s.iterationDuration*i},n))})}function Ou(t){return t.length===2}function Iu(t,e){return Ou(t)?Br(n=>{t(n[e.axis].progress,n)},e):_i(t,Fr(e))}function ju(t,{axis:e="y",container:n=document.scrollingElement,...s}={}){if(!n)return j;const i={axis:e,container:n,...s};return typeof t=="function"?Iu(t,i):Fu(t,i)}const Nu=()=>({scrollX:H(0),scrollY:H(0),scrollXProgress:H(0),scrollYProgress:H(0)}),zt=t=>t?!t.current:!1;function Wu({container:t,target:e,...n}={}){const s=se(Nu),i=T.useRef(null),o=T.useRef(!1),r=T.useCallback(()=>(i.current=ju((a,{x:l,y:u})=>{s.scrollX.set(l.current),s.scrollXProgress.set(l.progress),s.scrollY.set(u.current),s.scrollYProgress.set(u.progress)},{...n,container:(t==null?void 0:t.current)||void 0,target:(e==null?void 0:e.current)||void 0}),()=>{var a;(a=i.current)==null||a.call(i)}),[t,e,JSON.stringify(n.offset)]);return Xe(()=>{if(o.current=!1,zt(t)||zt(e)){o.current=!0;return}else return r()},[r]),T.useEffect(()=>{if(o.current)return _(!zt(t),"Container ref is defined but not hydrated","use-scroll-ref"),_(!zt(e),"Target ref is defined but not hydrated","use-scroll-ref"),r()},[r]),s}function Uu(t){const e=se(()=>H(t)),{isStatic:n}=T.useContext(Tn);if(n){const[,s]=T.useState(t);T.useEffect(()=>e.on("change",s),[])}return e}function Or(t,e){const n=Uu(e()),s=()=>n.set(e());return s(),Xe(()=>{const i=()=>A.preRender(s,!1,!0),o=t.map(r=>r.on("change",i));return()=>{o.forEach(r=>r()),Y(s)}}),n}function Ku(t){Et.current=[],t();const e=Or(Et.current,t);return Et.current=void 0,e}function $u(t,e,n,s){if(typeof t=="function")return Ku(t);const i=typeof e=="function"?e:Wa(e,n,s);return Array.isArray(t)?Js(t,i):Js([t],([o])=>i(o))}function Js(t,e){const n=se(()=>[]);return Or(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}const zu=({children:t,className:e})=>{const n=T.useRef(null),{scrollYProgress:s}=Wu({target:n});if(typeof t!="string")throw new Error("TextReveal: children must be a string");const i=t.split(" ");return X.jsx("div",{ref:n,className:Nr.cn("z-0 relative h-[200vh]",e),children:X.jsx("div",{className:"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]",children:X.jsx("span",{ref:n,className:"flex flex-wrap p-5 text-2xl font-bold text-black/20 dark:text-white/20 md:p-8 md:text-3xl lg:p-10 lg:text-4xl xl:text-5xl",children:i.map((o,r)=>{const a=r/i.length,l=a+1/i.length;return X.jsx(Hu,{progress:s,range:[a,l],children:o},r)})})})})},Hu=({children:t,progress:e,range:n})=>{const s=$u(e,n,[0,1]);return X.jsxs("span",{className:"relative mx-1 lg:mx-1.5",children:[X.jsx("span",{className:"absolute opacity-30",children:t}),X.jsx(Tu.span,{style:{opacity:s},className:"text-black dark:text-white",children:t})]})};exports.TextReveal=zu;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react/jsx-runtime"),w=require("react"),$r=require("../utils-IjLH3w2e.cjs"),ni=w.createContext({});function se(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}const Xe=typeof window<"u",qe=Xe?w.useLayoutEffect:w.useEffect,Ze=w.createContext(null);function Je(t,e){t.indexOf(e)===-1&&t.push(e)}function Qe(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const G=(t,e,n)=>n>e?e:n<t?t:n;function Ae(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let wt=()=>{},_=()=>{};var ei;typeof process<"u"&&((ei=process.env)==null?void 0:ei.NODE_ENV)!=="production"&&(wt=(t,e,n)=>{!t&&typeof console<"u"&&console.warn(Ae(e,n))},_=(t,e,n)=>{if(!t)throw new Error(Ae(e,n))});const J={},si=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function ii(t){return typeof t=="object"&&t!==null}const ri=t=>/^0[^.\s]+$/u.test(t);function tn(t){let e;return()=>(e===void 0&&(e=t()),e)}const j=t=>t,Hr=(t,e)=>n=>e(t(n)),Ot=(...t)=>t.reduce(Hr),xt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class en{constructor(){this.subscriptions=[]}add(e){return Je(this.subscriptions,e),()=>Qe(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const q=t=>t*1e3,K=t=>t/1e3;function nn(t,e){return e?t*(1e3/e):0}const Bn=new Set;function ie(t,e,n){t||Bn.has(e)||(console.warn(Ae(e,n)),Bn.add(e))}const oi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,zr=1e-7,Gr=12;function _r(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=oi(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>zr&&++a<Gr);return r}function jt(t,e,n,s){if(t===e&&n===s)return j;const i=o=>_r(o,0,1,t,n);return o=>o===0||o===1?o:oi(i(o),e,s)}const ai=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,li=t=>e=>1-t(1-e),ci=jt(.33,1.53,.69,.99),sn=li(ci),ui=ai(sn),hi=t=>(t*=2)<1?.5*sn(t):.5*(2-Math.pow(2,-10*(t-1))),rn=t=>1-Math.sin(Math.acos(t)),fi=li(rn),di=ai(rn),Yr=jt(.42,0,1,1),Xr=jt(0,0,.58,1),mi=jt(.42,0,.58,1),qr=t=>Array.isArray(t)&&typeof t[0]!="number",pi=t=>Array.isArray(t)&&typeof t[0]=="number",In={linear:j,easeIn:Yr,easeInOut:mi,easeOut:Xr,circIn:rn,circInOut:di,circOut:fi,backIn:sn,backInOut:ui,backOut:ci,anticipate:hi},Zr=t=>typeof t=="string",Fn=t=>{if(pi(t)){_(t.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,s,i]=t;return jt(e,n,s,i)}else if(Zr(t))return _(In[t]!==void 0,`Invalid easing type '${t}'`,"invalid-easing-type"),In[t];return t},Ut=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Jr(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){r.has(c)&&(u.schedule(c),t()),c(a)}const u={schedule:(c,h=!1,f=!1)=>{const m=f&&i?n:s;return h&&r.add(c),m.has(c)||m.add(c),c},cancel:c=>{s.delete(c),r.delete(c)},process:c=>{if(a=c,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,o&&(o=!1,u.process(c))}};return u}const Qr=40;function gi(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=Ut.reduce((v,P)=>(v[P]=Jr(o),v),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:f,render:d,postRender:m}=r,p=()=>{const v=J.useManualTiming?i.timestamp:performance.now();n=!1,J.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,Qr),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),d.process(i),m.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},x=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:Ut.reduce((v,P)=>{const S=r[P];return v[P]=(V,E=!1,b=!1)=>(n||x(),S.schedule(V,E,b)),v},{}),cancel:v=>{for(let P=0;P<Ut.length;P++)r[Ut[P]].cancel(v)},state:i,steps:r}}const{schedule:A,cancel:Y,state:L,steps:le}=gi(typeof requestAnimationFrame<"u"?requestAnimationFrame:j,!0);let zt;function to(){zt=void 0}const I={now:()=>(zt===void 0&&I.set(L.isProcessing||J.useManualTiming?L.timestamp:performance.now()),zt),set:t=>{zt=t,queueMicrotask(to)}},yi=t=>e=>typeof e=="string"&&e.startsWith(t),vi=yi("--"),eo=yi("var(--"),on=t=>eo(t)?no.test(t.split("/*")[0].trim()):!1,no=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function On(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const St={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},kt={...St,transform:t=>G(0,1,t)},Kt={...St,default:1},Dt=t=>Math.round(t*1e5)/1e5,an=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function so(t){return t==null}const io=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ln=(t,e)=>n=>!!(typeof n=="string"&&io.test(n)&&n.startsWith(t)||e&&!so(n)&&Object.prototype.hasOwnProperty.call(n,e)),xi=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(an);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},ro=t=>G(0,255,t),ce={...St,transform:t=>Math.round(ro(t))},at={test:ln("rgb","red"),parse:xi("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ce.transform(t)+", "+ce.transform(e)+", "+ce.transform(n)+", "+Dt(kt.transform(s))+")"};function oo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ve={test:ln("#"),parse:oo,transform:at.transform},Nt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Q=Nt("deg"),Z=Nt("%"),y=Nt("px"),ao=Nt("vh"),lo=Nt("vw"),jn={...Z,parse:t=>Z.parse(t)/100,transform:t=>Z.transform(t*100)},ft={test:ln("hsl","hue"),parse:xi("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Z.transform(Dt(e))+", "+Z.transform(Dt(n))+", "+Dt(kt.transform(s))+")"},D={test:t=>at.test(t)||Ve.test(t)||ft.test(t),parse:t=>at.test(t)?at.parse(t):ft.test(t)?ft.parse(t):Ve.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?at.transform(t):ft.transform(t),getAnimatableNone:t=>{const e=D.parse(t);return e.alpha=0,D.transform(e)}},co=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function uo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(an))==null?void 0:e.length)||0)+(((n=t.match(co))==null?void 0:n.length)||0)>0}const Ti="number",wi="color",ho="var",fo="var(",Nn="${}",mo=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Bt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(mo,l=>(D.test(l)?(s.color.push(o),i.push(wi),n.push(D.parse(l))):l.startsWith(fo)?(s.var.push(o),i.push(ho),n.push(l)):(s.number.push(o),i.push(Ti),n.push(parseFloat(l))),++o,Nn)).split(Nn);return{values:n,split:a,indexes:s,types:i}}function Si(t){return Bt(t).values}function bi(t){const{split:e,types:n}=Bt(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Ti?o+=Dt(i[r]):a===wi?o+=D.transform(i[r]):o+=i[r]}return o}}const po=t=>typeof t=="number"?0:D.test(t)?D.getAnimatableNone(t):t;function go(t){const e=Si(t);return bi(t)(e.map(po))}const nt={test:uo,parse:Si,createTransformer:bi,getAnimatableNone:go};function ue(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function yo({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=ue(l,a,t+1/3),o=ue(l,a,t),r=ue(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Zt(t,e){return n=>n>0?e:t}const M=(t,e,n)=>t+(e-t)*n,he=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},vo=[Ve,at,ft],xo=t=>vo.find(e=>e.test(t));function Wn(t){const e=xo(t);if(wt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!e)return!1;let n=e.parse(t);return e===ft&&(n=yo(n)),n}const Un=(t,e)=>{const n=Wn(t),s=Wn(e);if(!n||!s)return Zt(t,e);const i={...n};return o=>(i.red=he(n.red,s.red,o),i.green=he(n.green,s.green,o),i.blue=he(n.blue,s.blue,o),i.alpha=M(n.alpha,s.alpha,o),at.transform(i))},Ce=new Set(["none","hidden"]);function To(t,e){return Ce.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function wo(t,e){return n=>M(t,e,n)}function cn(t){return typeof t=="number"?wo:typeof t=="string"?on(t)?Zt:D.test(t)?Un:Po:Array.isArray(t)?Pi:typeof t=="object"?D.test(t)?Un:So:Zt}function Pi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>cn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function So(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=cn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function bo(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const Po=(t,e)=>{const n=nt.createTransformer(e),s=Bt(t),i=Bt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ce.has(t)&&!i.values.length||Ce.has(e)&&!s.values.length?To(t,e):Ot(Pi(bo(s,i),i.values),n):(wt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Zt(t,e))};function Ai(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?M(t,e,n):cn(t)(t,e)}const Ao=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>A.update(e,n),stop:()=>Y(e),now:()=>L.isProcessing?L.timestamp:I.now()}},Vi=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=Math.round(t(o/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Jt=2e4;function un(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Jt;)e+=n,s=t.next(e);return e>=Jt?1/0:e}function Vo(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(un(s),Jt);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:K(i)}}const Co=5;function Ci(t,e,n){const s=Math.max(e-Co,0);return nn(n-t(s),e-s)}const C={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},fe=.001;function Mo({duration:t=C.duration,bounce:e=C.bounce,velocity:n=C.velocity,mass:s=C.mass}){let i,o;wt(t<=q(C.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=G(C.minDamping,C.maxDamping,r),t=G(C.minDuration,C.maxDuration,K(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=Me(u,r),m=Math.exp(-h);return fe-f/d*m},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),p=Me(Math.pow(u,2),r);return(-i(u)+fe>0?-1:1)*((f-d)*m)/p}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-fe+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Eo(i,o,a);if(t=q(t),isNaN(l))return{stiffness:C.stiffness,damping:C.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Do=12;function Eo(t,e,n){let s=n;for(let i=1;i<Do;i++)s=s-t(s)/e(s);return s}function Me(t,e){return t*Math.sqrt(1-e*e)}const Ro=["duration","bounce"],Lo=["stiffness","damping","mass"];function Kn(t,e){return e.some(n=>t[n]!==void 0)}function ko(t){let e={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:!1,...t};if(!Kn(t,Lo)&&Kn(t,Ro))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*G(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:C.mass,stiffness:i,damping:o}}else{const n=Mo(t);e={...e,...n,mass:C.mass},e.isResolvedFromDuration=!0}return e}function Qt(t=C.visualDuration,e=C.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:h,velocity:f,isResolvedFromDuration:d}=ko({...n,velocity:-K(n.velocity||0)}),m=f||0,p=u/(2*Math.sqrt(l*c)),x=r-o,g=K(Math.sqrt(l/c)),T=Math.abs(x)<5;s||(s=T?C.restSpeed.granular:C.restSpeed.default),i||(i=T?C.restDelta.granular:C.restDelta.default);let v;if(p<1){const S=Me(g,p);v=V=>{const E=Math.exp(-p*g*V);return r-E*((m+p*g*x)/S*Math.sin(S*V)+x*Math.cos(S*V))}}else if(p===1)v=S=>r-Math.exp(-g*S)*(x+(m+g*x)*S);else{const S=g*Math.sqrt(p*p-1);v=V=>{const E=Math.exp(-p*g*V),b=Math.min(S*V,300);return r-E*((m+p*g*x)*Math.sinh(b)+S*x*Math.cosh(b))/S}}const P={calculatedDuration:d&&h||null,next:S=>{const V=v(S);if(d)a.done=S>=h;else{let E=S===0?m:0;p<1&&(E=S===0?q(m):Ci(v,S,V));const b=Math.abs(E)<=s,O=Math.abs(r-V)<=i;a.done=b&&O}return a.value=a.done?r:V,a},toString:()=>{const S=Math.min(un(P),Jt),V=Vi(E=>P.next(S*E).value,S,30);return S+"ms "+V},toTransition:()=>{}};return P}Qt.applyToOptions=t=>{const e=Vo(t,100,Qt);return t.ease=e.ease,t.duration=q(e.duration),t.type="keyframes",t};function De({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=b=>a!==void 0&&b<a||l!==void 0&&b>l,m=b=>a===void 0?l:l===void 0||Math.abs(a-b)<Math.abs(l-b)?a:l;let p=n*e;const x=h+p,g=r===void 0?x:r(x);g!==x&&(p=g-h);const T=b=>-p*Math.exp(-b/s),v=b=>g+T(b),P=b=>{const O=T(b),N=v(b);f.done=Math.abs(O)<=u,f.value=f.done?g:N};let S,V;const E=b=>{d(f.value)&&(S=b,V=Qt({keyframes:[f.value,m(f.value)],velocity:Ci(v,b,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:b=>{let O=!1;return!V&&S===void 0&&(O=!0,P(b),E(b)),S!==void 0&&b>=S?V.next(b-S):(!O&&P(b),f)}}}function Bo(t,e,n){const s=[],i=n||J.mix||Ai,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||j:e;a=Ot(l,a)}s.push(a)}return s}function hn(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(_(o===e.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Bo(e,s,i),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const f=xt(t[h],t[h+1],c);return a[h](f)};return n?c=>u(G(t[0],t[o-1],c)):u}function Io(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=xt(0,e,s);t.push(M(n,1,i))}}function Mi(t){const e=[0];return Io(e,t.length-1),e}function Fo(t,e){return t.map(n=>n*e)}function Oo(t,e){return t.map(()=>e||mi).splice(0,t.length-1)}function dt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=qr(s)?s.map(Fn):Fn(s),o={done:!1,value:e[0]},r=Fo(n&&n.length===e.length?n:Mi(e),t),a=hn(r,e,{ease:Array.isArray(i)?i:Oo(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const jo=t=>t!==null;function fn(t,{repeat:e,repeatType:n="loop"},s,i=1){const o=t.filter(jo),a=i<0||e&&n!=="loop"&&e%2===1?0:o.length-1;return!a||s===void 0?o[a]:s}const No={decay:De,inertia:De,tween:dt,keyframes:dt,spring:Qt};function Di(t){typeof t.type=="string"&&(t.type=No[t.type])}class dn{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Wo=t=>t/100;class mn extends dn{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==I.now()&&this.tick(I.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;Di(e);const{type:n=dt,repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=e;let{keyframes:a}=e;const l=n||dt;process.env.NODE_ENV!=="production"&&l!==dt&&_(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==dt&&typeof a[0]!="number"&&(this.mixKeyframes=Ot(Wo,Ai(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});o==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=un(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:s,totalDuration:i,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:h,repeatType:f,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-i/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const g=this.currentTime-u*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,P=s;if(h){const b=Math.min(this.currentTime,i)/a;let O=Math.floor(b),N=b%1;!N&&b>=1&&(N=1),N===1&&O--,O=Math.min(O,h+1),!!(O%2)&&(f==="reverse"?(N=1-N,d&&(N-=d/a)):f==="mirror"&&(P=r)),v=G(0,1,N)*a}const S=T?{done:!1,value:c[0]}:P.next(v);o&&(S.value=o(S.value));let{done:V}=S;!T&&l!==null&&(V=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return E&&m!==De&&(S.value=fn(c,this.options,x,this.speed)),p&&p(S.value),E&&this.finish(),S}then(e,n){return this.finished.then(e,n)}get duration(){return K(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(this.currentTime)}set time(e){var n;e=q(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),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(I.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=K(this.currentTime))}play(){var i,o;if(this.isStopped)return;const{driver:e=Ao,startTime:n}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),(o=(i=this.options).onPlay)==null||o.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(I.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function Uo(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const lt=t=>t*180/Math.PI,Ee=t=>{const e=lt(Math.atan2(t[1],t[0]));return Re(e)},Ko={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ee,rotateZ:Ee,skewX:t=>lt(Math.atan(t[1])),skewY:t=>lt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Re=t=>(t=t%360,t<0&&(t+=360),t),$n=Ee,Hn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),zn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),$o={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Hn,scaleY:zn,scale:t=>(Hn(t)+zn(t))/2,rotateX:t=>Re(lt(Math.atan2(t[6],t[5]))),rotateY:t=>Re(lt(Math.atan2(-t[2],t[0]))),rotateZ:$n,rotate:$n,skewX:t=>lt(Math.atan(t[4])),skewY:t=>lt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Le(t){return t.includes("scale")?1:0}function ke(t,e){if(!t||t==="none")return Le(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=$o,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ko,i=a}if(!i)return Le(e);const o=s[e],r=i[1].split(",").map(zo);return typeof o=="function"?o(r):r[o]}const Ho=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ke(n,e)};function zo(t){return parseFloat(t.trim())}const bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Pt=new Set(bt),Gn=t=>t===St||t===y,Go=new Set(["x","y","z"]),_o=bt.filter(t=>!Go.has(t));function Yo(t){const e=[];return _o.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const et={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ke(e,"x"),y:(t,{transform:e})=>ke(e,"y")};et.translateX=et.x;et.translateY=et.y;const ct=new Set;let Be=!1,Ie=!1,Fe=!1;function Ei(){if(Ie){const t=Array.from(ct).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Yo(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))==null||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Ie=!1,Be=!1,ct.forEach(t=>t.complete(Fe)),ct.clear()}function Ri(){ct.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ie=!0)})}function Xo(){Fe=!0,Ri(),Ei(),Fe=!1}class pn{constructor(e,n,s,i,o,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ct.add(this),Be||(Be=!0,A.read(Ri),A.resolveKeyframes(Ei))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;if(e[0]===null){const o=i==null?void 0:i.get(),r=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const a=s.readValue(n,r);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=r),i&&o===void 0&&i.set(e[0])}Uo(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ct.delete(this)}cancel(){this.state==="scheduled"&&(ct.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const qo=t=>t.startsWith("--");function Zo(t,e,n){qo(e)?t.style.setProperty(e,n):t.style[e]=n}const Li=tn(()=>window.ScrollTimeline!==void 0),Jo={};function Qo(t,e){const n=tn(t);return()=>Jo[e]??n()}const ki=Qo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ct=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,_n={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ct([0,.65,.55,1]),circOut:Ct([.55,0,1,.45]),backIn:Ct([.31,.01,.66,-.59]),backOut:Ct([.33,1.53,.69,.99])};function Bi(t,e){if(t)return typeof t=="function"?ki()?Vi(t,e):"ease-out":pi(t)?Ct(t):Array.isArray(t)?t.map(n=>Bi(n,e)||_n.easeOut):_n[t]}function ta(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Bi(a,i);Array.isArray(h)&&(c.easing=h);const f={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(c,f)}function Ii(t){return typeof t=="function"&&"applyToOptions"in t}function ea({type:t,...e}){return Ii(t)&&ki()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class na extends dn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:s,keyframes:i,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!o,this.allowFlatten=r,this.options=e,_(typeof e.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=ea(e);this.animation=ta(n,s,i,u,o),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const c=fn(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):Zo(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,s;const e=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return K(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+K(e)}get time(){return K(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=q(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&Li()?(this.animation.timeline=e,j):n(this)}}const Fi={anticipate:hi,backInOut:ui,circInOut:di};function sa(t){return t in Fi}function ia(t){typeof t.ease=="string"&&sa(t.ease)&&(t.ease=Fi[t.ease])}const de=10;class ra extends na{constructor(e){ia(e),Di(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:s,onComplete:i,element:o,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new mn({...r,autoplay:!1}),l=Math.max(de,I.now()-this.startTime),u=G(0,de,l-de);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const Yn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(nt.test(t)||t==="0")&&!t.startsWith("url("));function oa(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function aa(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=Yn(i,e),a=Yn(o,e);return wt(r===a,`You are trying to animate ${e} from "${i}" to "${o}". "${r?o:i}" is not an animatable value.`,"value-not-animatable"),!r||!a?!1:oa(t)||(n==="spring"||Ii(n))&&s}function Oe(t){t.duration=0,t.type="keyframes"}const la=new Set(["opacity","clipPath","filter","transform"]),ca=tn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ua(t){var c;const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:o,type:r}=t;if(!(((c=e==null?void 0:e.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return ca()&&n&&la.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&o!==0&&r!=="inertia"}const ha=40;class fa extends dn{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",keyframes:a,name:l,motionValue:u,element:c,...h}){var m;super(),this.stop=()=>{var p,x;this._animation&&(this._animation.stop(),(p=this.stopTimeline)==null||p.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=I.now();const f={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,name:l,motionValue:u,element:c,...h},d=(c==null?void 0:c.KeyframeResolver)||pn;this.keyframeResolver=new d(a,(p,x,g)=>this.onKeyframesResolved(p,x,f,!g),l,u,c),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,s,i){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=I.now(),aa(e,o,r,a)||((J.instantAnimations||!l)&&(c==null||c(fn(e,s,n))),e[0]=e[e.length-1],Oe(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>ha?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:e},d=!u&&ua(f)?new ra({...f,element:f.motionValue.owner.current}):new mn(f);d.finished.then(()=>this.notifyFinished()).catch(j),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Xo()),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(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const da=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ma(t){const e=da.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const pa=4;function Oi(t,e,n=1){_(n<=pa,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,i]=ma(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return si(r)?parseFloat(r):r}return on(i)?Oi(i,e,n+1):i}function gn(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const ji=new Set(["width","height","top","left","right","bottom",...bt]),ga={test:t=>t==="auto",parse:t=>t},Ni=t=>e=>e.test(t),Wi=[St,y,Z,Q,lo,ao,ga],Xn=t=>Wi.find(Ni(t));function ya(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ri(t):!0}const va=new Set(["brightness","contrast","saturate","opacity"]);function xa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(an)||[];if(!s)return t;const i=n.replace(s,"");let o=va.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Ta=/\b([a-z-]*)\(.*?\)/gu,je={...nt,getAnimatableNone:t=>{const e=t.match(Ta);return e?e.map(xa).join(" "):t}},qn={...St,transform:Math.round},wa={rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:Kt,scaleX:Kt,scaleY:Kt,scaleZ:Kt,skew:Q,skewX:Q,skewY:Q,distance:y,translateX:y,translateY:y,translateZ:y,x:y,y,z:y,perspective:y,transformPerspective:y,opacity:kt,originX:jn,originY:jn,originZ:y},yn={borderWidth:y,borderTopWidth:y,borderRightWidth:y,borderBottomWidth:y,borderLeftWidth:y,borderRadius:y,radius:y,borderTopLeftRadius:y,borderTopRightRadius:y,borderBottomRightRadius:y,borderBottomLeftRadius:y,width:y,maxWidth:y,height:y,maxHeight:y,top:y,right:y,bottom:y,left:y,inset:y,insetBlock:y,insetBlockStart:y,insetBlockEnd:y,insetInline:y,insetInlineStart:y,insetInlineEnd:y,padding:y,paddingTop:y,paddingRight:y,paddingBottom:y,paddingLeft:y,paddingBlock:y,paddingBlockStart:y,paddingBlockEnd:y,paddingInline:y,paddingInlineStart:y,paddingInlineEnd:y,margin:y,marginTop:y,marginRight:y,marginBottom:y,marginLeft:y,marginBlock:y,marginBlockStart:y,marginBlockEnd:y,marginInline:y,marginInlineStart:y,marginInlineEnd:y,backgroundPositionX:y,backgroundPositionY:y,...wa,zIndex:qn,fillOpacity:kt,strokeOpacity:kt,numOctaves:qn},Sa={...yn,color:D,backgroundColor:D,outlineColor:D,fill:D,stroke:D,borderColor:D,borderTopColor:D,borderRightColor:D,borderBottomColor:D,borderLeftColor:D,filter:je,WebkitFilter:je},Ui=t=>Sa[t];function Ki(t,e){let n=Ui(t);return n!==je&&(n=nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ba=new Set(["auto","none","0"]);function Pa(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!ba.has(o)&&Bt(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Ki(n,i)}class Aa extends pn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let h=e[c];if(typeof h=="string"&&(h=h.trim(),on(h))){const f=Oi(h,n.current);f!==void 0&&(e[c]=f),c===e.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!ji.has(s)||e.length!==2)return;const[i,o]=e,r=Xn(i),a=Xn(o),l=On(i),u=On(o);if(l!==u&&et[s]){this.needsMeasurement=!0;return}if(r!==a)if(Gn(r)&&Gn(a))for(let c=0;c<e.length;c++){const h=e[c];typeof h=="string"&&(e[c]=parseFloat(h))}else et[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)(e[i]===null||ya(e[i]))&&s.push(i);s.length&&Pa(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=et[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=et[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function $i(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){const i=document.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}const Hi=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function zi(t){return ii(t)&&"offsetHeight"in t}const Zn=30,Va=t=>!isNaN(parseFloat(t)),Et={current:void 0};class Ca{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var o;const i=I.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((o=this.events.change)==null||o.notify(this.current),this.dependents))for(const r of this.dependents)r.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=I.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Va(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&ie(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new en);const s=this.events[e].add(n);return e==="change"?()=>{s(),A.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Et.current&&Et.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=I.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Zn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Zn);return nn(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function z(t,e){return new Ca(t,e)}const{schedule:vn}=gi(queueMicrotask,!1),H={x:!1,y:!1};function Gi(){return H.x||H.y}function Ma(t){return t==="x"||t==="y"?H[t]?null:(H[t]=!0,()=>{H[t]=!1}):H.x||H.y?null:(H.x=H.y=!0,()=>{H.x=H.y=!1})}function _i(t,e){const n=$i(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Jn(t){return!(t.pointerType==="touch"||Gi())}function Da(t,e,n={}){const[s,i,o]=_i(t,n),r=a=>{if(!Jn(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=h=>{Jn(h)&&(u(h),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const Yi=(t,e)=>e?t===e?!0:Yi(t,e.parentElement):!1,xn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Ea=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Xi(t){return Ea.has(t.tagName)||t.isContentEditable===!0}const Gt=new WeakSet;function Qn(t){return e=>{e.key==="Enter"&&t(e)}}function me(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ra=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Qn(()=>{if(Gt.has(n))return;me(n,"down");const i=Qn(()=>{me(n,"up")}),o=()=>me(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ts(t){return xn(t)&&!Gi()}function La(t,e,n={}){const[s,i,o]=_i(t,n),r=a=>{const l=a.currentTarget;if(!ts(a))return;Gt.add(l);const u=e(l,a),c=(d,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),Gt.has(l)&&Gt.delete(l),ts(d)&&typeof u=="function"&&u(d,{success:m})},h=d=>{c(d,l===window||l===document||n.useGlobalTarget||Yi(l,d.target))},f=d=>{c(d,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),zi(a)&&(a.addEventListener("focus",u=>Ra(u,i)),!Xi(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function Tn(t){return ii(t)&&"ownerSVGElement"in t}const _t=new WeakMap;let tt;const qi=(t,e,n)=>(s,i)=>i&&i[0]?i[0][t+"Size"]:Tn(s)&&"getBBox"in s?s.getBBox()[e]:s[n],ka=qi("inline","width","offsetWidth"),Ba=qi("block","height","offsetHeight");function Ia({target:t,borderBoxSize:e}){var n;(n=_t.get(t))==null||n.forEach(s=>{s(t,{get width(){return ka(t,e)},get height(){return Ba(t,e)}})})}function Fa(t){t.forEach(Ia)}function Oa(){typeof ResizeObserver>"u"||(tt=new ResizeObserver(Fa))}function ja(t,e){tt||Oa();const n=$i(t);return n.forEach(s=>{let i=_t.get(s);i||(i=new Set,_t.set(s,i)),i.add(e),tt==null||tt.observe(s)}),()=>{n.forEach(s=>{const i=_t.get(s);i==null||i.delete(e),i!=null&&i.size||tt==null||tt.unobserve(s)})}}const Yt=new Set;let mt;function Na(){mt=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Yt.forEach(e=>e(t))},window.addEventListener("resize",mt)}function Wa(t){return Yt.add(t),mt||Na(),()=>{Yt.delete(t),!Yt.size&&typeof mt=="function"&&(window.removeEventListener("resize",mt),mt=void 0)}}function Ua(t,e){return typeof t=="function"?Wa(t):ja(t,e)}function Zi(t,e){let n;const s=()=>{const{currentTime:i}=e,r=(i===null?0:i.value)/100;n!==r&&t(r),n=r};return A.preUpdate(s,!0),()=>Y(s)}function Ka(t){return Tn(t)&&t.tagName==="svg"}function $a(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],i=t[1+n],o=t[2+n],r=t[3+n],a=hn(i,o,r);return e?a(s):a}const B=t=>!!(t&&t.getVelocity),Ha=[...Wi,D,nt],za=t=>Ha.find(Ni(t)),wn=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ga(t=!0){const e=w.useContext(Ze);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=w.useId();w.useEffect(()=>{if(t)return i(o)},[t]);const r=w.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Ji=w.createContext({strict:!1}),es={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"]},Tt={};for(const t in es)Tt[t]={isEnabled:e=>es[t].some(n=>!!e[n])};function _a(t){for(const e in t)Tt[e]={...Tt[e],...t[e]}}const Ya=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function te(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ya.has(t)}let Qi=t=>!te(t);function Xa(t){typeof t=="function"&&(Qi=e=>e.startsWith("on")?!te(e):t(e))}try{Xa(require("@emotion/is-prop-valid").default)}catch{}function qa(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Qi(i)||n===!0&&te(i)||!e&&!te(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}const re=w.createContext({});function oe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function It(t){return typeof t=="string"||Array.isArray(t)}const Sn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],bn=["initial",...Sn];function ae(t){return oe(t.animate)||bn.some(e=>It(t[e]))}function tr(t){return!!(ae(t)||t.variants)}function Za(t,e){if(ae(t)){const{initial:n,animate:s}=t;return{initial:n===!1||It(n)?n:void 0,animate:It(s)?s:void 0}}return t.inherit!==!1?e:{}}function Ja(t){const{initial:e,animate:n}=Za(t,w.useContext(re));return w.useMemo(()=>({initial:e,animate:n}),[ns(e),ns(n)])}function ns(t){return Array.isArray(t)?t.join(" "):t}function ss(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const At={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(y.test(t))t=parseFloat(t);else return t;const n=ss(t,e.target.x),s=ss(t,e.target.y);return`${n}% ${s}%`}},Qa={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=nt.parse(t);if(i.length>5)return s;const o=nt.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=M(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}},Ne={borderRadius:{...At,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:At,borderTopRightRadius:At,borderBottomLeftRadius:At,borderBottomRightRadius:At,boxShadow:Qa};function er(t,{layout:e,layoutId:n}){return Pt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Ne[t]||t==="opacity")}const tl={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},el=bt.length;function nl(t,e,n){let s="",i=!0;for(let o=0;o<el;o++){const r=bt[o],a=t[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Hi(a,yn[r]);if(!l){i=!1;const c=tl[r]||r;s+=`${c}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Pn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(Pt.has(l)){r=!0;continue}else if(vi(l)){i[l]=u;continue}else{const c=Hi(u,yn[l]);l.startsWith("origin")?(a=!0,o[l]=c):s[l]=c}}if(e.transform||(r||n?s.transform=nl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;s.transformOrigin=`${l} ${u} ${c}`}}const An=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nr(t,e,n){for(const s in e)!B(e[s])&&!er(s,n)&&(t[s]=e[s])}function sl({transformTemplate:t},e){return w.useMemo(()=>{const n=An();return Pn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function il(t,e){const n=t.style||{},s={};return nr(s,n,t),Object.assign(s,sl(t,e)),s}function rl(t,e){const n={},s=il(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const ol={offset:"stroke-dashoffset",array:"stroke-dasharray"},al={offset:"strokeDashoffset",array:"strokeDasharray"};function ll(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?ol:al;t[o.offset]=y.transform(-s);const r=y.transform(e),a=y.transform(n);t[o.array]=`${r} ${a}`}const cl=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function sr(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:o=1,pathOffset:r=0,...a},l,u,c){if(Pn(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete h.transformBox);for(const d of cl)h[d]!==void 0&&(f[d]=h[d],delete h[d]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),i!==void 0&&ll(h,i,o,r,!1)}const ir=()=>({...An(),attrs:{}}),rr=t=>typeof t=="string"&&t.toLowerCase()==="svg";function ul(t,e,n,s){const i=w.useMemo(()=>{const o=ir();return sr(o,e,rr(s),t.transformTemplate,t.style),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};nr(o,t.style,t),i.style={...o,...i.style}}return i}const hl=["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 Vn(t){return typeof t!="string"||t.includes("-")?!1:!!(hl.indexOf(t)>-1||/[A-Z]/u.test(t))}function fl(t,e,n,{latestValues:s},i,o=!1,r){const l=(r??Vn(t)?ul:rl)(e,s,i,t),u=qa(e,typeof t=="string",o),c=t!==w.Fragment?{...u,...l,ref:n}:{},{children:h}=e,f=w.useMemo(()=>B(h)?h.get():h,[h]);return w.createElement(t,{...c,children:f})}function is(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Cn(t,e,n,s){if(typeof e=="function"){const[i,o]=is(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=is(s);e=e(n!==void 0?n:t.custom,i,o)}return e}function Xt(t){return B(t)?t.get():t}function dl({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:ml(n,s,i,t),renderState:e()}}function ml(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Xt(o[f]);let{initial:r,animate:a}=t;const l=ae(t),u=tr(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;if(h&&typeof h!="boolean"&&!oe(h)){const f=Array.isArray(h)?h:[h];for(let d=0;d<f.length;d++){const m=Cn(t,f[d]);if(m){const{transitionEnd:p,transition:x,...g}=m;for(const T in g){let v=g[T];if(Array.isArray(v)){const P=c?v.length-1:0;v=v[P]}v!==null&&(i[T]=v)}for(const T in p)i[T]=p[T]}}}return i}const or=t=>(e,n)=>{const s=w.useContext(re),i=w.useContext(Ze),o=()=>dl(t,e,s,i);return n?o():se(o)};function Mn(t,e,n){var o;const{style:s}=t,i={};for(const r in s)(B(s[r])||e.style&&B(e.style[r])||er(r,t)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(i[r]=s[r]);return i}const pl=or({scrapeMotionValuesFromProps:Mn,createRenderState:An});function ar(t,e,n){const s=Mn(t,e,n);for(const i in t)if(B(t[i])||B(e[i])){const o=bt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}const gl=or({scrapeMotionValuesFromProps:ar,createRenderState:ir}),yl=Symbol.for("motionComponentSymbol");function vl(t,e,n){const s=w.useRef(n);w.useInsertionEffect(()=>{s.current=n});const i=w.useRef(null);return w.useCallback(o=>{var a;o&&((a=t.onMount)==null||a.call(t,o)),e&&(o?e.mount(o):e.unmount());const r=s.current;if(typeof r=="function")if(o){const l=r(o);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):r(o);else r&&(r.current=o)},[e])}const Dn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xl="framerAppearId",lr="data-"+Dn(xl),cr=w.createContext({});function Mt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Tl(t,e,n,s,i,o){var x,g;const{visualElement:r}=w.useContext(re),a=w.useContext(Ji),l=w.useContext(Ze),u=w.useContext(wn).reducedMotion,c=w.useRef(null);s=s||a.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:r,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u,isSVG:o}));const h=c.current,f=w.useContext(cr);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&wl(c.current,n,i,f);const d=w.useRef(!1);w.useInsertionEffect(()=>{h&&d.current&&h.update(n,l)});const m=n[lr],p=w.useRef(!!m&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,m))&&((g=window.MotionHasOptimisedAnimation)==null?void 0:g.call(window,m)));return qe(()=>{h&&(d.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),p.current&&h.animationState&&h.animationState.animateChanges())}),w.useEffect(()=>{h&&(!p.current&&h.animationState&&h.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,m)}),p.current=!1),h.enteringChildren=void 0)}),h}function wl(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ur(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&Mt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function ur(t){if(t)return t.options.allowProjection!==!1?t.projection:ur(t.parent)}function pe(t,{forwardMotionProps:e=!1,type:n}={},s,i){s&&_a(s);const o=n?n==="svg":Vn(t),r=o?gl:pl;function a(u,c){let h;const f={...w.useContext(wn),...u,layoutId:Sl(u)},{isStatic:d}=f,m=Ja(u),p=r(u,d);if(!d&&Xe){bl(f,s);const x=Pl(f);h=x.MeasureLayout,m.visualElement=Tl(t,p,f,i,x.ProjectionNode,o)}return X.jsxs(re.Provider,{value:m,children:[h&&m.visualElement?X.jsx(h,{visualElement:m.visualElement,...f}):null,fl(t,u,vl(p,m.visualElement,c),p,d,e,o)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=w.forwardRef(a);return l[yl]=t,l}function Sl({layoutId:t}){const e=w.useContext(ni).id;return e&&t!==void 0?e+"-"+t:t}function bl(t,e){const n=w.useContext(Ji).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?wt(!1,s,"lazy-strict-mode"):_(!1,s,"lazy-strict-mode")}}function Pl(t){const{drag:e,layout:n}=Tt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function Al(t,e){if(typeof Proxy>"u")return pe;const n=new Map,s=(o,r)=>pe(o,r,t,e),i=(o,r)=>(process.env.NODE_ENV!=="production"&&ie(!1,"motion() is deprecated. Use motion.create() instead."),s(o,r));return new Proxy(i,{get:(o,r)=>r==="create"?s:(n.has(r)||n.set(r,pe(r,void 0,t,e)),n.get(r))})}function hr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Vl({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Cl(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ge(t){return t===void 0||t===1}function We({scale:t,scaleX:e,scaleY:n}){return!ge(t)||!ge(e)||!ge(n)}function ot(t){return We(t)||fr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function fr(t){return rs(t.x)||rs(t.y)}function rs(t){return t&&t!=="0%"}function ee(t,e,n){const s=t-n,i=e*s;return n+i}function os(t,e,n,s,i){return i!==void 0&&(t=ee(t,i,s)),ee(t,n,s)+e}function Ue(t,e=0,n=1,s,i){t.min=os(t.min,e,n,s,i),t.max=os(t.max,e,n,s,i)}function dr(t,{x:e,y:n}){Ue(t.x,e.translate,e.scale,e.originPoint),Ue(t.y,n.translate,n.scale,n.originPoint)}const as=.999999999999,ls=1.0000000000001;function Ml(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&gt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,dr(t,r)),s&&ot(o.latestValues)&&gt(t,o.latestValues))}e.x<ls&&e.x>as&&(e.x=1),e.y<ls&&e.y>as&&(e.y=1)}function pt(t,e){t.min=t.min+e,t.max=t.max+e}function cs(t,e,n,s,i=.5){const o=M(t.min,t.max,i);Ue(t,e,n,o,s)}function gt(t,e){cs(t.x,e.x,e.scaleX,e.scale,e.originX),cs(t.y,e.y,e.scaleY,e.scale,e.originY)}function mr(t,e){return hr(Cl(t.getBoundingClientRect(),e))}function Dl(t,e,n){const s=mr(t,n),{scroll:i}=e;return i&&(pt(s.x,i.offset.x),pt(s.y,i.offset.y)),s}const us=()=>({translate:0,scale:1,origin:0,originPoint:0}),yt=()=>({x:us(),y:us()}),hs=()=>({min:0,max:0}),R=()=>({x:hs(),y:hs()}),Ke={current:null},pr={current:!1};function El(){if(pr.current=!0,!!Xe)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ke.current=t.matches;t.addEventListener("change",e),e()}else Ke.current=!1}const Rl=new WeakMap;function Ll(t,e,n){for(const s in e){const i=e[s],o=n[s];if(B(i))t.addValue(s,i);else if(B(o))t.addValue(s,z(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,z(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const fs=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class kl{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=pn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=I.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,A.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=ae(n),this.isVariantNode=tr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&B(d)&&d.set(l[f])}}mount(e){var n;this.current=e,Rl.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((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(pr.current||El(),this.shouldReduceMotion=Ke.current),process.env.NODE_ENV!=="production"&&ie(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),Y(this.notifyUpdate),Y(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=Pt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&A.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Tt){const n=Tt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):R()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<fs.length;s++){const i=fs[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Ll(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=z(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(si(s)||ri(s))?s=parseFloat(s):!za(s)&&nt.test(n)&&(s=Ki(e,n)),this.setBaseTarget(e,B(s)?s.get():s)),B(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Cn(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!B(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new en),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){vn.render(this.render)}}class gr extends kl{constructor(){super(...arguments),this.KeyframeResolver=Aa}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;B(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function yr(t,{style:e,vars:n},s,i){const o=t.style;let r;for(r in e)o[r]=e[r];i==null||i.applyProjectionStyles(o,s);for(r in n)o.setProperty(r,n[r])}function Bl(t){return window.getComputedStyle(t)}class Il extends gr{constructor(){super(...arguments),this.type="html",this.renderInstance=yr}readValueFromInstance(e,n){var s;if(Pt.has(n))return(s=this.projection)!=null&&s.isProjecting?Le(n):Ho(e,n);{const i=Bl(e),o=(vi(n)?i.getPropertyValue(n):i[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return mr(e,n)}build(e,n,s){Pn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Mn(e,n,s)}}const vr=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 Fl(t,e,n,s){yr(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(vr.has(i)?i:Dn(i),e.attrs[i])}class Ol extends gr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=R}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Pt.has(n)){const s=Ui(n);return s&&s.default||0}return n=vr.has(n)?n:Dn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return ar(e,n,s)}build(e,n,s){sr(e,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(e,n,s,i){Fl(e,n,s,i)}mount(e){this.isSVGTag=rr(e.tagName),super.mount(e)}}const jl=(t,e)=>e.isSVG??Vn(t)?new Ol(e):new Il(e,{allowProjection:t!==w.Fragment});function vt(t,e,n){const s=t.getProps();return Cn(s,e,n!==void 0?n:s.custom,t)}const $e=t=>Array.isArray(t);function Nl(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,z(n))}function Wl(t){return $e(t)?t[t.length-1]||0:t}function Ul(t,e){const n=vt(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Wl(o[r]);Nl(t,r,a)}}function Kl(t){return!!(B(t)&&t.add)}function He(t,e){const n=t.getValue("willChange");if(Kl(n))return n.add(e);if(!n&&J.WillChange){const s=new J.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function xr(t){return t.props[lr]}const $l=t=>t!==null;function Hl(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter($l),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return i[o]}const zl={type:"spring",stiffness:500,damping:25,restSpeed:10},Gl=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),_l={type:"keyframes",duration:.8},Yl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xl=(t,{keyframes:e})=>e.length>2?_l:Pt.has(t)?t.startsWith("scale")?Gl(e[1]):zl:Yl;function ql({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const En=(t,e,n,s={},i,o)=>r=>{const a=gn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-q(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};ql(a)||Object.assign(c,Xl(t,c)),c.duration&&(c.duration=q(c.duration)),c.repeatDelay&&(c.repeatDelay=q(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(Oe(c),c.delay===0&&(h=!0)),(J.instantAnimations||J.skipAnimations)&&(h=!0,Oe(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!o&&e.get()!==void 0){const f=Hl(c.keyframes,a);if(f!==void 0){A.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new mn(c):new fa(c)};function Zl({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Tr(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;s&&(o=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const h=t.getValue(c,t.latestValues[c]??null),f=a[c];if(f===void 0||u&&Zl(u,c))continue;const d={delay:n,...gn(o||{},c)},m=h.get();if(m!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===m&&!d.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const g=xr(t);if(g){const T=window.MotionHandoffAnimation(g,c,A);T!==null&&(d.startTime=T,p=!0)}}He(t,c),h.start(En(c,h,f,t.shouldReduceMotion&&ji.has(c)?{type:!1}:d,t,p));const x=h.animation;x&&l.push(x)}return r&&Promise.all(l).then(()=>{A.update(()=>{r&&Ul(t,r)})}),l}function wr(t,e,n,s=0,i=1){const o=Array.from(t).sort((u,c)=>u.sortNodePosition(c)).indexOf(e),r=t.size,a=(r-1)*s;return typeof n=="function"?n(o,r):i===1?o*s:a-o*s}function ze(t,e,n={}){var l;const s=vt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(Tr(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=i;return Jl(t,e,u,c,h,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[o,r]:[r,o];return u().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function Jl(t,e,n=0,s=0,i=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ze(l,e,{...r,delay:n+(typeof s=="function"?0:s)+wr(t.variantChildren,l,s,i,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function Ql(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>ze(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=ze(t,e,n);else{const i=typeof e=="function"?vt(t,e,n.custom):e;s=Promise.all(Tr(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function Sr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const tc=bn.length;function br(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?br(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<tc;n++){const s=bn[n],i=t.props[s];(It(i)||i===!1)&&(e[s]=i)}return e}const ec=[...Sn].reverse(),nc=Sn.length;function sc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Ql(t,n,s)))}function ic(t){let e=sc(t),n=ds(),s=!0;const i=l=>(u,c)=>{var f;const h=vt(t,c,l==="exit"?(f=t.presenceContext)==null?void 0:f.custom:void 0);if(h){const{transition:d,transitionEnd:m,...p}=h;u={...u,...p,...m}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=br(t.parent)||{},h=[],f=new Set;let d={},m=1/0;for(let x=0;x<nc;x++){const g=ec[x],T=n[g],v=u[g]!==void 0?u[g]:c[g],P=It(v),S=g===l?T.isActive:null;S===!1&&(m=x);let V=v===c[g]&&v!==u[g]&&P;if(V&&s&&t.manuallyAnimateOnMount&&(V=!1),T.protectedKeys={...d},!T.isActive&&S===null||!v&&!T.prevProp||oe(v)||typeof v=="boolean")continue;const E=rc(T.prevProp,v);let b=E||g===l&&T.isActive&&!V&&P||x>m&&P,O=!1;const N=Array.isArray(v)?v:[v];let ut=N.reduce(i(g),{});S===!1&&(ut={});const{prevResolvedValues:Rn={}}=T,Ur={...Rn,...ut},Ln=k=>{b=!0,f.has(k)&&(O=!0,f.delete(k)),T.needsAnimating[k]=!0;const W=t.getValue(k);W&&(W.liveStyle=!1)};for(const k in Ur){const W=ut[k],it=Rn[k];if(d.hasOwnProperty(k))continue;let ht=!1;$e(W)&&$e(it)?ht=!Sr(W,it):ht=W!==it,ht?W!=null?Ln(k):f.add(k):W!==void 0&&f.has(k)?Ln(k):T.protectedKeys[k]=!0}T.prevProp=v,T.prevResolvedValues=ut,T.isActive&&(d={...d,...ut}),s&&t.blockInitialAnimation&&(b=!1);const kn=V&&E;b&&(!kn||O)&&h.push(...N.map(k=>{const W={type:g};if(typeof k=="string"&&s&&!kn&&t.manuallyAnimateOnMount&&t.parent){const{parent:it}=t,ht=vt(it,k);if(it.enteringChildren&&ht){const{delayChildren:Kr}=ht.transition||{};W.delay=wr(it.enteringChildren,t,Kr)}}return{animation:k,options:W}}))}if(f.size){const x={};if(typeof u.initial!="boolean"){const g=vt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(x.transition=g.transition)}f.forEach(g=>{const T=t.getBaseTarget(g),v=t.getValue(g);v&&(v.liveStyle=!0),x[g]=T??null}),h.push({animation:x})}let p=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}function a(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(f=>{var d;return(d=f.animationState)==null?void 0:d.setActive(l,u)}),n[l].isActive=u;const c=r(l);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=ds()}}}function rc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Sr(e,t):!1}function rt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ds(){return{animate:rt(!0),whileInView:rt(),whileHover:rt(),whileTap:rt(),whileDrag:rt(),whileFocus:rt(),exit:rt()}}class st{constructor(e){this.isMounted=!1,this.node=e}update(){}}class oc extends st{constructor(e){super(e),e.animationState||(e.animationState=ic(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();oe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let ac=0;class lc extends st{constructor(){super(...arguments),this.id=ac++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const cc={animation:{Feature:oc},exit:{Feature:lc}};function Ft(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Wt(t){return{point:{x:t.pageX,y:t.pageY}}}const uc=t=>e=>xn(e)&&t(e,Wt(e));function Rt(t,e,n,s){return Ft(t,e,uc(n),s)}const Pr=1e-4,hc=1-Pr,fc=1+Pr,Ar=.01,dc=0-Ar,mc=0+Ar;function F(t){return t.max-t.min}function pc(t,e,n){return Math.abs(t-e)<=n}function ms(t,e,n,s=.5){t.origin=s,t.originPoint=M(e.min,e.max,t.origin),t.scale=F(n)/F(e),t.translate=M(n.min,n.max,t.origin)-t.originPoint,(t.scale>=hc&&t.scale<=fc||isNaN(t.scale))&&(t.scale=1),(t.translate>=dc&&t.translate<=mc||isNaN(t.translate))&&(t.translate=0)}function Lt(t,e,n,s){ms(t.x,e.x,n.x,s?s.originX:void 0),ms(t.y,e.y,n.y,s?s.originY:void 0)}function ps(t,e,n){t.min=n.min+e.min,t.max=t.min+F(e)}function gc(t,e,n){ps(t.x,e.x,n.x),ps(t.y,e.y,n.y)}function gs(t,e,n){t.min=e.min-n.min,t.max=t.min+F(e)}function ne(t,e,n){gs(t.x,e.x,n.x),gs(t.y,e.y,n.y)}function U(t){return[t("x"),t("y")]}const Vr=({current:t})=>t?t.ownerDocument.defaultView:null,ys=(t,e)=>Math.abs(t-e);function yc(t,e){const n=ys(t.x,e.x),s=ys(t.y,e.y);return Math.sqrt(n**2+s**2)}const vs=new Set(["auto","scroll"]);class Cr{constructor(e,n,{transformPagePoint:s,contextWindow:i=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=d=>{this.handleScroll(d.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=ve(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,p=yc(d.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!p)return;const{point:x}=d,{timestamp:g}=L;this.history.push({...x,timestamp:g});const{onStart:T,onMove:v}=this.handlers;m||(T&&T(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,d)},this.handlePointerMove=(d,m)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=ye(m,this.transformPagePoint),A.update(this.updatePoint,!0)},this.handlePointerUp=(d,m)=>{this.end();const{onEnd:p,onSessionEnd:x,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=ve(d.type==="pointercancel"?this.lastMoveEventInfo:ye(m,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,T),x&&x(d,T)},!xn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.distanceThreshold=r,this.contextWindow=i||window;const l=Wt(e),u=ye(l,this.transformPagePoint),{point:c}=u,{timestamp:h}=L;this.history=[{...c,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,ve(u,this.history)),this.removeListeners=Ot(Rt(this.contextWindow,"pointermove",this.handlePointerMove),Rt(this.contextWindow,"pointerup",this.handlePointerUp),Rt(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const s=getComputedStyle(n);(vs.has(s.overflowX)||vs.has(s.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const s=e===window,i=s?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},o={x:i.x-n.x,y:i.y-n.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(e,i),A.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Y(this.updatePoint)}}function ye(t,e){return e?{point:e(t.point)}:t}function xs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ve({point:t},e){return{point:t,delta:xs(t,Mr(e)),offset:xs(t,vc(e)),velocity:xc(e,.1)}}function vc(t){return t[0]}function Mr(t){return t[t.length-1]}function xc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Mr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>q(e)));)n--;if(!s)return{x:0,y:0};const o=K(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Tc(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?M(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?M(n,t,s.max):Math.min(t,n)),t}function Ts(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function wc(t,{top:e,left:n,bottom:s,right:i}){return{x:Ts(t.x,n,i),y:Ts(t.y,e,s)}}function ws(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Sc(t,e){return{x:ws(t.x,e.x),y:ws(t.y,e.y)}}function bc(t,e){let n=.5;const s=F(t),i=F(e);return i>s?n=xt(e.min,e.max-s,t.min):s>i&&(n=xt(t.min,t.max-i,e.min)),G(0,1,n)}function Pc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Ge=.35;function Ac(t=Ge){return t===!1?t=0:t===!0&&(t=Ge),{x:Ss(t,"left","right"),y:Ss(t,"top","bottom")}}function Ss(t,e,n){return{min:bs(t,e),max:bs(t,n)}}function bs(t,e){return typeof t=="number"?t:t[e]||0}const Vc=new WeakMap;class Cc{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=R(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:s}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const o=h=>{n?(this.stopAnimation(),this.snapToCursor(Wt(h).point)):this.pauseAnimation()},r=(h,f)=>{this.stopAnimation();const{drag:d,dragPropagation:m,onDragStart:p}=this.getProps();if(d&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ma(d),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),U(g=>{let T=this.getAxisMotionValue(g).get()||0;if(Z.test(T)){const{projection:v}=this.visualElement;if(v&&v.layout){const P=v.layout.layoutBox[g];P&&(T=F(P)*(parseFloat(T)/100))}}this.originPoint[g]=T}),p&&A.postRender(()=>p(h,f)),He(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:d,dragDirectionLock:m,onDirectionLock:p,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:g}=f;if(m&&this.currentDirection===null){this.currentDirection=Mc(g),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",f.point,g),this.updateAxis("y",f.point,g),this.visualElement.render(),x&&x(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>U(h=>{var f;return this.getAnimationState(h)==="paused"&&((f=this.getAxisMotionValue(h).animation)==null?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Cr(e,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,distanceThreshold:s,contextWindow:Vr(this.visualElement),element:this.visualElement.current})}stop(e,n){const s=e||this.latestPointerEvent,i=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!i||!s)return;const{velocity:r}=i;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&A.postRender(()=>a(s,i))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!$t(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=Tc(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;e&&Mt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=wc(s.layoutBox,e):this.constraints=!1,this.elastic=Ac(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&U(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Pc(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Mt(e))return!1;const s=e.current;_(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Dl(s,i.root,this.visualElement.getTransformPagePoint());let r=Sc(i.layout.layoutBox,o);if(n){const a=n(Vl(r));this.hasMutatedConstraints=!!a,a&&(r=hr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=U(c=>{if(!$t(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return He(this.visualElement,e),s.start(En(e,s,0,n,this.visualElement,!1))}stopAnimation(){U(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){U(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){U(n=>{const{drag:s}=this.getProps();if(!$t(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n],l=o.get()||0;o.set(e[n]-M(r,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Mt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};U(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=bc({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),U(r=>{if(!$t(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(M(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;Vc.set(this.visualElement,this);const e=this.visualElement.current,n=Rt(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&!Xi(l.target)&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Mt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),A.read(s);const r=Ft(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(U(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())}));return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Ge,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function $t(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Mc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Dc extends st{constructor(e){super(e),this.removeGroupControls=j,this.removeListeners=j,this.controls=new Cc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||j}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ps=t=>(e,n)=>{t&&A.postRender(()=>t(e,n))};class Ec extends st{constructor(){super(...arguments),this.removePointerDownListener=j}onPointerDown(e){this.session=new Cr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vr(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Ps(e),onStart:Ps(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&A.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=Rt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let xe=!1;class Rc extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),xe&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),qt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,{projection:r}=s;return r&&(r.isPresent=o,xe=!0,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||A.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),vn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;xe=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Dr(t){const[e,n]=Ga(),s=w.useContext(ni);return X.jsx(Rc,{...t,layoutGroup:s,switchLayoutGroup:w.useContext(cr),isPresent:e,safeToRemove:n})}function Lc(t,e,n){const s=B(t)?t:z(t);return s.start(En("",s,e,n)),s.animation}const kc=(t,e)=>t.depth-e.depth;class Bc{constructor(){this.children=[],this.isDirty=!1}add(e){Je(this.children,e),this.isDirty=!0}remove(e){Qe(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(kc),this.isDirty=!1,this.children.forEach(e)}}function Ic(t,e){const n=I.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Y(s),t(o-e))};return A.setup(s,!0),()=>Y(s)}const Er=["TopLeft","TopRight","BottomLeft","BottomRight"],Fc=Er.length,As=t=>typeof t=="string"?parseFloat(t):t,Vs=t=>typeof t=="number"||y.test(t);function Oc(t,e,n,s,i,o){i?(t.opacity=M(0,n.opacity??1,jc(s)),t.opacityExit=M(e.opacity??1,0,Nc(s))):o&&(t.opacity=M(e.opacity??1,n.opacity??1,s));for(let r=0;r<Fc;r++){const a=`border${Er[r]}Radius`;let l=Cs(e,a),u=Cs(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Vs(l)===Vs(u)?(t[a]=Math.max(M(As(l),As(u),s),0),(Z.test(u)||Z.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function Cs(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const jc=Rr(0,.5,fi),Nc=Rr(.5,.95,j);function Rr(t,e,n){return s=>s<t?0:s>e?1:n(xt(t,e,s))}function Ms(t,e){t.min=e.min,t.max=e.max}function $(t,e){Ms(t.x,e.x),Ms(t.y,e.y)}function Ds(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Es(t,e,n,s,i){return t-=e,t=ee(t,1/n,s),i!==void 0&&(t=ee(t,1/i,s)),t}function Wc(t,e=0,n=1,s=.5,i,o=t,r=t){if(Z.test(e)&&(e=parseFloat(e),e=M(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=M(o.min,o.max,s);t===o&&(a-=e),t.min=Es(t.min,e,n,a,i),t.max=Es(t.max,e,n,a,i)}function Rs(t,e,[n,s,i],o,r){Wc(t,e[n],e[s],e[i],e.scale,o,r)}const Uc=["x","scaleX","originX"],Kc=["y","scaleY","originY"];function Ls(t,e,n,s){Rs(t.x,e,Uc,n?n.x:void 0,s?s.x:void 0),Rs(t.y,e,Kc,n?n.y:void 0,s?s.y:void 0)}function ks(t){return t.translate===0&&t.scale===1}function Lr(t){return ks(t.x)&&ks(t.y)}function Bs(t,e){return t.min===e.min&&t.max===e.max}function $c(t,e){return Bs(t.x,e.x)&&Bs(t.y,e.y)}function Is(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function kr(t,e){return Is(t.x,e.x)&&Is(t.y,e.y)}function Fs(t){return F(t.x)/F(t.y)}function Os(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Hc{constructor(){this.members=[]}add(e){Je(this.members,e),e.scheduleRender()}remove(e){if(Qe(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function zc(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Te=["","X","Y","Z"],Gc=1e3;let _c=0;function we(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Br(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=xr(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",A,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Br(s)}function Ir({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=_c++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(qc),this.nodes.forEach(tu),this.nodes.forEach(eu),this.nodes.forEach(Zc)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Bc)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new en),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=Tn(r)&&!Ka(r),this.instance=r;const{layoutId:a,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),t){let c,h=0;const f=()=>this.root.updateBlockedByResize=!1;A.read(()=>{h=window.innerWidth}),t(r,()=>{const d=window.innerWidth;d!==h&&(h=d,this.root.updateBlockedByResize=!0,c&&c(),c=Ic(f,250),qt.hasAnimatedSinceResize&&(qt.hasAnimatedSinceResize=!1,this.nodes.forEach(Ws)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||ou,{onLayoutAnimationStart:p,onLayoutAnimationComplete:x}=u.getProps(),g=!this.targetLayout||!kr(this.targetLayout,d),T=!h&&f;if(this.options.layoutRoot||this.resumeFrom||T||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...gn(m,"layout"),onPlay:p,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(c,T)}else h||Ws(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Y(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(nu),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Br(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(js);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ns);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qc),this.nodes.forEach(Yc),this.nodes.forEach(Xc)):this.nodes.forEach(Ns),this.clearAllSnapshots();const a=I.now();L.delta=G(0,1e3/60,a-L.timestamp),L.timestamp=a,L.isProcessing=!0,le.update.process(L),le.preRender.process(L),le.render.process(L),L.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,vn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Jc),this.sharedNodes.forEach(su)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,A.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){A.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!F(this.snapshot.measuredBox.x)&&!F(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=R(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Lr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&this.instance&&(a||ot(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),au(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:r}=this.options;if(!r)return R();const a=r.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(lu))){const{scroll:c}=this.root;c&&(pt(a.x,c.offset.x),pt(a.y,c.offset.y))}return a}removeElementScroll(r){var l;const a=R();if($(a,r),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&$(a,r),pt(a.x,h.offset.x),pt(a.y,h.offset.y))}return a}applyTransform(r,a=!1){const l=R();$(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&gt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),ot(c.latestValues)&&gt(l,c.latestValues)}return ot(this.latestValues)&&gt(l,this.latestValues),l}removeTransform(r){const a=R();$(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!ot(u.latestValues))continue;We(u.latestValues)&&u.updateSnapshot();const c=R(),h=u.measurePageBox();$(c,h),Ls(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return ot(this.latestValues)&&Ls(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==L.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!this.layout||!(c||h))return;this.resolvedRelativeTargetAt=L.timestamp;const f=this.getClosestProjectingParent();f&&this.linkedParentVersion!==f.layoutVersion&&!f.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(f&&f.layout?this.createRelativeTarget(f,this.layout.layoutBox,f.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=R(),this.targetWithTransforms=R()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$(this.target,this.layout.layoutBox),dr(this.target,this.targetDelta)):$(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?this.createRelativeTarget(f,this.target,f.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||We(this.parent.latestValues)||fr(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(r,a,l){this.relativeParent=r,this.linkedParentVersion=r.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=R(),this.relativeTargetOrigin=R(),ne(this.relativeTargetOrigin,a,l),$(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var m;const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===L.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;$(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,f=this.treeScale.y;Ml(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=R());const{target:d}=r;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ds(this.prevProjectionDelta.x,this.projectionDelta.x),Ds(this.prevProjectionDelta.y,this.projectionDelta.y)),Lt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==f||!Os(this.projectionDelta.x,this.prevProjectionDelta.x)||!Os(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=yt(),this.projectionDelta=yt(),this.projectionDeltaWithTransform=yt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=yt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=R(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=d!==m,x=this.getStack(),g=!x||x.members.length<=1,T=!!(p&&!g&&this.options.crossfade===!0&&!this.path.some(ru));this.animationProgress=0;let v;this.mixTargetDelta=P=>{const S=P/1e3;Us(h.x,r.x,S),Us(h.y,r.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ne(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iu(this.relativeTarget,this.relativeTargetOrigin,f,S),v&&$c(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=R()),$(v,this.relativeTarget)),p&&(this.animationValues=c,Oc(c,u,this.latestValues,S,T,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Y(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=A.update(()=>{qt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=z(0)),this.currentAnimation=Lc(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:c=>{this.mixTargetDelta(c),r.onUpdate&&r.onUpdate(c)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gc),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&Fr(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||R();const h=F(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=F(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}$(a,l),gt(a,c),Lt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Hc),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var a;const{layoutId:r}=this.options;return r?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:r}=this.options;return r?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&we("z",r,u,this.animationValues);for(let c=0;c<Te.length;c++)we(`rotate${Te[c]}`,r,u,this.animationValues),we(`skew${Te[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=Xt(a==null?void 0:a.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=Xt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ot(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const c=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=zc(this.projectionDeltaWithTransform,this.treeScale,c);l&&(h=l(c,h)),r.transform=h;const{x:f,y:d}=this.projectionDelta;r.transformOrigin=`${f.origin*100}% ${d.origin*100}% 0`,u.animationValues?r.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:r.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const m in Ne){if(c[m]===void 0)continue;const{correct:p,applyTo:x,isCSSVariable:g}=Ne[m],T=h==="none"?c[m]:p(c[m],u);if(x){const v=x.length;for(let P=0;P<v;P++)r[x[P]]=T}else g?this.options.visualElement.renderState.vars[m]=T:r[m]=T}this.options.layoutId&&(r.pointerEvents=u===this?Xt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(js),this.root.sharedNodes.clear()}}}function Yc(t){t.updateLayout()}function Xc(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=e.source!==t.layout.source;o==="size"?U(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=F(f);f.min=s[h].min,f.max=f.min+d}):Fr(o,e.layoutBox,s)&&U(h=>{const f=r?e.measuredBox[h]:e.layoutBox[h],d=F(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=yt();Lt(a,s,e.layoutBox);const l=yt();r?Lt(l,t.applyTransform(i,!0),e.measuredBox):Lt(l,s,e.layoutBox);const u=!Lr(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=R();ne(m,e.layoutBox,f.layoutBox);const p=R();ne(p,s,d.layoutBox),kr(m,p)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function qc(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Zc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Jc(t){t.clearSnapshot()}function js(t){t.clearMeasurements()}function Ns(t){t.isLayoutDirty=!1}function Qc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Ws(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function tu(t){t.resolveTargetDelta()}function eu(t){t.calcProjection()}function nu(t){t.resetSkewAndRotation()}function su(t){t.removeLeadSnapshot()}function Us(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ks(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function iu(t,e,n,s){Ks(t.x,e.x,n.x,s),Ks(t.y,e.y,n.y,s)}function ru(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ou={duration:.45,ease:[.4,0,.1,1]},$s=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Hs=$s("applewebkit/")&&!$s("chrome/")?Math.round:j;function zs(t){t.min=Hs(t.min),t.max=Hs(t.max)}function au(t){zs(t.x),zs(t.y)}function Fr(t,e,n){return t==="position"||t==="preserve-aspect"&&!pc(Fs(e),Fs(n),.2)}function lu(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const cu=Ir({attachResizeListener:(t,e)=>Ft(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Se={current:void 0},Or=Ir({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Se.current){const t=new cu({});t.mount(window),t.setOptions({layoutScroll:!0}),Se.current=t}return Se.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),uu={pan:{Feature:Ec},drag:{Feature:Dc,ProjectionNode:Or,MeasureLayout:Dr}};function Gs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&A.postRender(()=>o(e,Wt(e)))}class hu extends st{mount(){const{current:e}=this.node;e&&(this.unmount=Da(e,(n,s)=>(Gs(this.node,s,"Start"),i=>Gs(this.node,i,"End"))))}unmount(){}}class fu extends st{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=Ot(Ft(this.node.current,"focus",()=>this.onFocus()),Ft(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _s(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&A.postRender(()=>o(e,Wt(e)))}class du extends st{mount(){const{current:e}=this.node;e&&(this.unmount=La(e,(n,s)=>(_s(this.node,s,"Start"),(i,{success:o})=>_s(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const _e=new WeakMap,be=new WeakMap,mu=t=>{const e=_e.get(t.target);e&&e(t)},pu=t=>{t.forEach(mu)};function gu({root:t,...e}){const n=t||document;be.has(n)||be.set(n,{});const s=be.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(pu,{root:t,...e})),s[i]}function yu(t,e,n){const s=gu(e);return _e.set(t,n),s.observe(t),()=>{_e.delete(t),s.unobserve(t)}}const vu={some:0,all:1};class xu extends st{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:vu[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return yu(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Tu(e,n))&&this.startObserver()}unmount(){}}function Tu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const wu={inView:{Feature:xu},tap:{Feature:du},focus:{Feature:fu},hover:{Feature:hu}},Su={layout:{ProjectionNode:Or,MeasureLayout:Dr}},bu={...cc,...wu,...uu,...Su},Pu=Al(bu,jl),Au=50,Ys=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),Vu=()=>({time:0,x:Ys(),y:Ys()}),Cu={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Xs(t,e,n,s){const i=n[e],{length:o,position:r}=Cu[e],a=i.current,l=n.time;i.current=t[`scroll${r}`],i.scrollLength=t[`scroll${o}`]-t[`client${o}`],i.offset.length=0,i.offset[0]=0,i.offset[1]=i.scrollLength,i.progress=xt(0,i.scrollLength,i.current);const u=s-l;i.velocity=u>Au?0:nn(i.current-a,u)}function Mu(t,e,n){Xs(t,"x",e,n),Xs(t,"y",e,n),e.time=n}function Du(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(zi(s))n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if(s.tagName==="svg"){const i=s.getBoundingClientRect();s=s.parentElement;const o=s.getBoundingClientRect();n.x+=i.left-o.left,n.y+=i.top-o.top}else if(s instanceof SVGGraphicsElement){const{x:i,y:o}=s.getBBox();n.x+=i,n.y+=o;let r=null,a=s.parentNode;for(;!r;)a.tagName==="svg"&&(r=a),a=s.parentNode;s=r}else break;return n}const Ye={start:0,center:.5,end:1};function qs(t,e,n=0){let s=0;if(t in Ye&&(t=Ye[t]),typeof t=="string"){const i=parseFloat(t);t.endsWith("px")?s=i:t.endsWith("%")?t=i/100:t.endsWith("vw")?s=i/100*document.documentElement.clientWidth:t.endsWith("vh")?s=i/100*document.documentElement.clientHeight:t=i}return typeof t=="number"&&(s=e*t),n+s}const Eu=[0,0];function Ru(t,e,n,s){let i=Array.isArray(t)?t:Eu,o=0,r=0;return typeof t=="number"?i=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?i=t.split(" "):i=[t,Ye[t]?t:"0"]),o=qs(i[0],n,s),r=qs(i[1],e),o-r}const Lu={All:[[0,0],[1,1]]},ku={x:0,y:0};function Bu(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function Iu(t,e,n){const{offset:s=Lu.All}=n,{target:i=t,axis:o="y"}=n,r=o==="y"?"height":"width",a=i!==t?Du(i,t):ku,l=i===t?{width:t.scrollWidth,height:t.scrollHeight}:Bu(i),u={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let c=!e[o].interpolate;const h=s.length;for(let f=0;f<h;f++){const d=Ru(s[f],u[r],l[r],a[o]);!c&&d!==e[o].interpolatorOffsets[f]&&(c=!0),e[o].offset[f]=d}c&&(e[o].interpolate=hn(e[o].offset,Mi(s),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=G(0,1,e[o].interpolate(e[o].current))}function Fu(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight,process.env.NODE_ENV!=="production"&&t&&e&&e!==t&&ie(getComputedStyle(t).position!=="static","Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.")}function Ou(t,e,n,s={}){return{measure:i=>{Fu(t,s.target,n),Mu(t,n,i),(s.offset||s.target)&&Iu(t,n,s)},notify:()=>e(n)}}const Vt=new WeakMap,Zs=new WeakMap,Pe=new WeakMap,Js=t=>t===document.scrollingElement?window:t;function jr(t,{container:e=document.scrollingElement,...n}={}){if(!e)return j;let s=Pe.get(e);s||(s=new Set,Pe.set(e,s));const i=Vu(),o=Ou(e,t,i,n);if(s.add(o),!Vt.has(e)){const a=()=>{for(const h of s)h.measure(L.timestamp);A.preUpdate(l)},l=()=>{for(const h of s)h.notify()},u=()=>A.read(a);Vt.set(e,u);const c=Js(e);window.addEventListener("resize",u,{passive:!0}),e!==document.documentElement&&Zs.set(e,Ua(e,u)),c.addEventListener("scroll",u,{passive:!0}),u()}const r=Vt.get(e);return A.read(r,!1,!0),()=>{var u;Y(r);const a=Pe.get(e);if(!a||(a.delete(o),a.size))return;const l=Vt.get(e);Vt.delete(e),l&&(Js(e).removeEventListener("scroll",l),(u=Zs.get(e))==null||u(),window.removeEventListener("resize",l))}}const Qs=new Map;function ju(t){const e={value:0},n=jr(s=>{e.value=s[t.axis].progress*100},t);return{currentTime:e,cancel:n}}function Nr({source:t,container:e,...n}){const{axis:s}=n;t&&(e=t);const i=Qs.get(e)??new Map;Qs.set(e,i);const o=n.target??"self",r=i.get(o)??{},a=s+(n.offset??[]).join(",");return r[a]||(r[a]=!n.target&&Li()?new ScrollTimeline({source:e,axis:s}):ju({container:e,...n})),r[a]}function Nu(t,e){const n=Nr(e);return t.attachTimeline({timeline:e.target?void 0:n,observe:s=>(s.pause(),Zi(i=>{s.time=s.iterationDuration*i},n))})}function Wu(t){return t.length===2}function Uu(t,e){return Wu(t)?jr(n=>{t(n[e.axis].progress,n)},e):Zi(t,Nr(e))}function Ku(t,{axis:e="y",container:n=document.scrollingElement,...s}={}){if(!n)return j;const i={axis:e,container:n,...s};return typeof t=="function"?Uu(t,i):Nu(t,i)}const $u=()=>({scrollX:z(0),scrollY:z(0),scrollXProgress:z(0),scrollYProgress:z(0)}),Ht=t=>t?!t.current:!1;function Hu({container:t,target:e,...n}={}){const s=se($u),i=w.useRef(null),o=w.useRef(!1),r=w.useCallback(()=>(i.current=Ku((a,{x:l,y:u})=>{s.scrollX.set(l.current),s.scrollXProgress.set(l.progress),s.scrollY.set(u.current),s.scrollYProgress.set(u.progress)},{...n,container:(t==null?void 0:t.current)||void 0,target:(e==null?void 0:e.current)||void 0}),()=>{var a;(a=i.current)==null||a.call(i)}),[t,e,JSON.stringify(n.offset)]);return qe(()=>{if(o.current=!1,Ht(t)||Ht(e)){o.current=!0;return}else return r()},[r]),w.useEffect(()=>{if(o.current)return _(!Ht(t),"Container ref is defined but not hydrated","use-scroll-ref"),_(!Ht(e),"Target ref is defined but not hydrated","use-scroll-ref"),r()},[r]),s}function zu(t){const e=se(()=>z(t)),{isStatic:n}=w.useContext(wn);if(n){const[,s]=w.useState(t);w.useEffect(()=>e.on("change",s),[])}return e}function Wr(t,e){const n=zu(e()),s=()=>n.set(e());return s(),qe(()=>{const i=()=>A.preRender(s,!1,!0),o=t.map(r=>r.on("change",i));return()=>{o.forEach(r=>r()),Y(s)}}),n}function Gu(t){Et.current=[],t();const e=Wr(Et.current,t);return Et.current=void 0,e}function _u(t,e,n,s){if(typeof t=="function")return Gu(t);const i=typeof e=="function"?e:$a(e,n,s);return Array.isArray(t)?ti(t,i):ti([t],([o])=>i(o))}function ti(t,e){const n=se(()=>[]);return Wr(t,()=>{n.length=0;const s=t.length;for(let i=0;i<s;i++)n[i]=t[i].get();return e(n)})}const Yu=({children:t,className:e})=>{const n=w.useRef(null),{scrollYProgress:s}=Hu({target:n});if(typeof t!="string")throw new Error("TextReveal: children must be a string");const i=t.split(" ");return X.jsx("div",{ref:n,className:$r.cn("z-0 relative h-[200vh]",e),children:X.jsx("div",{className:"sticky top-0 mx-auto flex h-[50%] max-w-4xl items-center bg-transparent px-[1rem] py-[5rem]",children:X.jsx("span",{ref:n,className:"flex flex-wrap p-5 text-2xl font-bold text-black/20 dark:text-white/20 md:p-8 md:text-3xl lg:p-10 lg:text-4xl xl:text-5xl",children:i.map((o,r)=>{const a=r/i.length,l=a+1/i.length;return X.jsx(Xu,{progress:s,range:[a,l],children:o},r)})})})})},Xu=({children:t,progress:e,range:n})=>{const s=_u(e,n,[0,1]);return X.jsxs("span",{className:"relative mx-1 lg:mx-1.5",children:[X.jsx("span",{className:"absolute opacity-30",children:t}),X.jsx(Pu.span,{style:{opacity:s},className:"text-black dark:text-white",children:t})]})};exports.TextReveal=Yu;