framer-motion
Version:
A simple and powerful JavaScript animation library
1 lines • 182 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),o=React,s=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(t,e,n){var i,o={},r=null,c=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(c=e.ref),e)a.call(e,i)&&!u.hasOwnProperty(i)&&(o[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===o[i]&&(o[i]=e[i]);return{$$typeof:s,type:t,key:r,ref:c,props:o,_owner:l.current}}const h=r,d=c,p=c,m=e.createContext({});function f(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function T([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[o]=t.splice(e,1);t.splice(i,0,o)}return t}const S=(t,e,n)=>n>e?e:n<t?t:n;function b(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}t.warning=()=>{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(b(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(b(e,n))});const P={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function A(t){return"object"==typeof t&&null!==t}const M=t=>/^0[^.\s]+$/u.test(t);function C(t){let e;return()=>(void 0===e&&(e=t()),e)}const V=t=>t,k=(t,e)=>n=>e(t(n)),R=(...t)=>t.reduce(k),D=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class L{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let o=0;o<i;o++){const i=this.subscriptions[o];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const B=t=>1e3*t,j=t=>t/1e3;function I(t,e){return e?t*(1e3/e):0}const O=new Set;const F=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},W=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function U(t,e,n,i){if(t===e&&n===i)return V;const o=e=>function(t,e,n,i,o){let s,r,a=0;do{r=e+(n-e)/2,s=W(r,i,o)-t,s>0?n=r:e=r}while(Math.abs(s)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:W(o(t),e,i)}const N=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,$=t=>e=>1-t(1-e),z=U(.33,1.53,.69,.99),Y=$(z),H=N(Y),X=t=>t>=1?1:(t*=2)<1?.5*Y(t):.5*(2-Math.pow(2,-10*(t-1))),G=t=>1-Math.sin(Math.acos(t)),K=$(G),_=N(G),q=U(.42,0,1,1),Z=U(0,0,.58,1),J=U(.42,0,.58,1);const Q=t=>Array.isArray(t)&&"number"!=typeof t[0];function tt(t,e){return Q(t)?t[F(0,t.length,e)]:t}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linear:V,easeIn:q,easeInOut:J,easeOut:Z,circIn:G,circInOut:_,circOut:K,backIn:Y,backInOut:H,backOut:z,anticipate:X},it=e=>{if(et(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,o,s]=e;return U(n,i,o,s)}return"string"==typeof e?(t.invariant(void 0!==nt[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nt[e]):e},ot=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],st={value:null,addProjectionMetrics:null};function rt(t,e){let n=!1,i=!0;const o={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,r=ot.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,o=!1,s=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(e){r.has(e)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,s=!1)=>{const a=s&&o?n:i;return e&&r.add(t),a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(a=t,o)return void(s=!0);o=!0;const r=n;n=i,i=r,n.forEach(u),e&&st.value&&st.value.frameloop[e].push(l),l=0,n.clear(),o=!1,s&&(s=!1,c.process(t))}};return c}(s,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const s=P.useManualTiming,r=s?o.timestamp:performance.now();n=!1,s||(o.delta=i?1e3/60:Math.max(Math.min(r-o.timestamp,40),1)),o.timestamp=r,o.isProcessing=!0,a.process(o),l.process(o),u.process(o),c.process(o),h.process(o),d.process(o),p.process(o),m.process(o),o.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:ot.reduce((e,s)=>{const a=r[s];return e[s]=(e,s=!1,r=!1)=>(n||(n=!0,i=!0,o.isProcessing||t(f)),a.schedule(e,s,r)),e},{}),cancel:t=>{for(let e=0;e<ot.length;e++)r[ot[e]].cancel(t)},state:o,steps:r}}const{schedule:at,cancel:lt,state:ut,steps:ct}=rt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:V,!0);let ht;function dt(){ht=void 0}const pt={now:()=>(void 0===ht&&pt.set(ut.isProcessing||P.useManualTiming?ut.timestamp:performance.now()),ht),set:t=>{ht=t,queueMicrotask(dt)}},mt={layout:0,mainThread:0,waapi:0},ft=t=>e=>"string"==typeof e&&e.startsWith(t),gt=ft("--"),yt=ft("var(--"),vt=t=>!!yt(t)&&xt.test(t.split("/*")[0].trim()),xt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function wt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Tt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},St={...Tt,transform:t=>S(0,1,t)},bt={...Tt,default:1},Pt=t=>Math.round(1e5*t)/1e5,Et=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const At=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Mt=(t,e)=>n=>Boolean("string"==typeof n&&At.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ct=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[o,s,r,a]=i.match(Et);return{[t]:parseFloat(o),[e]:parseFloat(s),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Vt={...Tt,transform:t=>Math.round((t=>S(0,255,t))(t))},kt={test:Mt("rgb","red"),parse:Ct("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Vt.transform(t)+", "+Vt.transform(e)+", "+Vt.transform(n)+", "+Pt(St.transform(i))+")"};const Rt={test:Mt("#"),parse:function(t){let e="",n="",i="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,i+=i,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:o?parseInt(o,16)/255:1}},transform:kt.transform},Dt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Lt=Dt("deg"),Bt=Dt("%"),jt=Dt("px"),It=Dt("vh"),Ot=Dt("vw"),Ft=(()=>({...Bt,parse:t=>Bt.parse(t)/100,transform:t=>Bt.transform(100*t)}))(),Wt={test:Mt("hsl","hue"),parse:Ct("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Bt.transform(Pt(e))+", "+Bt.transform(Pt(n))+", "+Pt(St.transform(i))+")"},Ut={test:t=>kt.test(t)||Rt.test(t)||Wt.test(t),parse:t=>kt.test(t)?kt.parse(t):Wt.test(t)?Wt.parse(t):Rt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?kt.transform(t):Wt.transform(t),getAnimatableNone:t=>{const e=Ut.parse(t);return e.alpha=0,Ut.transform(e)}},Nt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const $t="number",zt="color",Yt=/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 Ht(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},o=[];let s=0;const r=e.replace(Yt,t=>(Ut.test(t)?(i.color.push(s),o.push(zt),n.push(Ut.parse(t))):t.startsWith("var(")?(i.var.push(s),o.push("var"),n.push(t)):(i.number.push(s),o.push($t),n.push(parseFloat(t))),++s,"${}")).split("${}");return{values:n,split:r,indexes:i,types:o}}function Xt({split:t,types:e}){const n=t.length;return i=>{let o="";for(let s=0;s<n;s++)if(o+=t[s],void 0!==i[s]){const t=e[s];o+=t===$t?Pt(i[s]):t===zt?Ut.transform(i[s]):i[s]}return o}}const Gt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Ut.test(n)?Ut.getAnimatableNone(n):n;var n};const Kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Et)?.length||0)+(t.match(Nt)?.length||0)>0},parse:function(t){return Ht(t).values},createTransformer:function(t){return Xt(Ht(t))},getAnimatableNone:function(t){const e=Ht(t);return Xt(e)(e.values.map((t,n)=>Gt(t,e.split[n])))}};function _t(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function qt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let o=0,s=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;o=_t(a,i,t+1/3),s=_t(a,i,t),r=_t(a,i,t-1/3)}else o=s=r=n;return{red:Math.round(255*o),green:Math.round(255*s),blue:Math.round(255*r),alpha:i}}function Zt(t,e){return n=>n>0?e:t}const Jt=(t,e,n)=>t+(e-t)*n,Qt=(t,e,n)=>{const i=t*t,o=n*(e*e-i)+i;return o<0?0:Math.sqrt(o)},te=[Rt,kt,Wt];function ee(e){const n=(i=e,te.find(t=>t.test(i)));var i;if(t.warning(Boolean(n),`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(n))return!1;let o=n.parse(e);return n===Wt&&(o=qt(o)),o}const ne=(t,e)=>{const n=ee(t),i=ee(e);if(!n||!i)return Zt(t,e);const o={...n};return t=>(o.red=Qt(n.red,i.red,t),o.green=Qt(n.green,i.green,t),o.blue=Qt(n.blue,i.blue,t),o.alpha=Jt(n.alpha,i.alpha,t),kt.transform(o))},ie=new Set(["none","hidden"]);function oe(t,e){return ie.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function se(t,e){return n=>Jt(t,e,n)}function re(t){return"number"==typeof t?se:"string"==typeof t?vt(t)?Zt:Ut.test(t)?ne:ue:Array.isArray(t)?ae:"object"==typeof t?Ut.test(t)?ne:le:Zt}function ae(t,e){const n=[...t],i=n.length,o=t.map((t,n)=>re(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=o[e](t);return n}}function le(t,e){const n={...t,...e},i={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(i[o]=re(t[o])(t[o],e[o]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ue=(e,n)=>{const i=Kt.createTransformer(n),o=Ht(e),s=Ht(n);return o.indexes.var.length===s.indexes.var.length&&o.indexes.color.length===s.indexes.color.length&&o.indexes.number.length>=s.indexes.number.length?ie.has(e)&&!s.values.length||ie.has(n)&&!o.values.length?oe(e,n):R(ae(function(t,e){const n=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const s=e.types[o],r=t.indexes[s][i[s]],a=t.values[r]??0;n[o]=a,i[s]++}return n}(o,s),s.values),i):(t.warning(!0,`Complex values '${e}' and '${n}' 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(e,n))};function ce(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Jt(t,e,n);return re(t)(t,e)}const he=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>at.update(e,t),stop:()=>lt(e),now:()=>ut.isProcessing?ut.timestamp:pt.now()}},de=(t,e,n=10)=>{let i="";const o=Math.max(Math.round(e/n),2);for(let e=0;e<o;e++)i+=Math.round(1e4*t(e/(o-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},pe=2e4;function me(t){let e=0;let n=t.next(e);for(;!n.done&&e<pe;)e+=50,n=t.next(e);return e>=pe?1/0:e}function fe(t,e=100,n){const i=n({...t,keyframes:[0,e]}),o=Math.min(me(i),pe);return{type:"keyframes",ease:t=>i.next(o*t).value/e,duration:j(o)}}const ge=100,ye=10,ve=1,xe=0,we=800,Te=.3,Se=.3,be={granular:.01,default:2},Pe={granular:.005,default:.5},Ee=.01,Ae=10,Me=.05,Ce=1;function Ve(t,e){return t*Math.sqrt(1-e*e)}const ke=.001;const Re=["duration","bounce"],De=["stiffness","damping","mass"];function Le(t,e){return e.some(e=>void 0!==t[e])}function Be(e){let n={velocity:xe,stiffness:ge,damping:ye,mass:ve,isResolvedFromDuration:!1,...e};if(!Le(e,De)&&Le(e,Re))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,i=2*Math.PI/(1.2*t),o=i*i,s=2*S(.05,1,1-(e.bounce||0))*Math.sqrt(o);n={...n,mass:ve,stiffness:o,damping:s}}else{const i=function({duration:e=we,bounce:n=Te,velocity:i=xe,mass:o=ve}){let s,r;t.warning(e<=B(Ae),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=S(Me,Ce,a),e=S(Ee,Ae,j(e)),a<1?(s=t=>{const n=t*a,o=n*e,s=n-i,r=Ve(t,a),l=Math.exp(-o);return ke-s/r*l},r=t=>{const n=t*a*e,o=n*i+i,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),u=Ve(Math.pow(t,2),a);return(-s(t)+ke>0?-1:1)*((o-r)*l)/u}):(s=t=>Math.exp(-t*e)*((t-i)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(i-t)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,r,5/e);if(e=B(e),isNaN(l))return{stiffness:ge,damping:ye,duration:e};{const t=Math.pow(l,2)*o;return{stiffness:t,damping:2*a*Math.sqrt(o*t),duration:e}}}({...e,velocity:0});n={...n,...i,mass:ve},n.isResolvedFromDuration=!0}return n}function je(t=Se,e=Te){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:o}=n;const s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:p}=Be({...n,velocity:-j(n.velocity||0)}),m=d||0,f=u/(2*Math.sqrt(l*c)),g=r-s,y=j(Math.sqrt(l/c)),v=Math.abs(g)<5;let x,w,T,S,b,P;if(i||(i=v?be.granular:be.default),o||(o=v?Pe.granular:Pe.default),f<1)T=Ve(y,f),S=(m+f*y*g)/T,x=t=>{const e=Math.exp(-f*y*t);return r-e*(S*Math.sin(T*t)+g*Math.cos(T*t))},b=f*y*S+g*T,P=f*y*g-S*T,w=t=>Math.exp(-f*y*t)*(b*Math.sin(T*t)+P*Math.cos(T*t));else if(1===f){x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);const t=m+y*g;w=e=>Math.exp(-y*e)*(y*t*e-m)}else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t};const e=(m+f*y*g)/t,n=f*y*e-g*t,i=f*y*g-e*t;w=e=>{const o=Math.exp(-f*y*e),s=Math.min(t*e,300);return o*(n*Math.sinh(s)+i*Math.cosh(s))}}const E={calculatedDuration:p&&h||null,velocity:t=>B(w(t)),next:t=>{if(!p&&f<1){const e=Math.exp(-f*y*t),n=Math.sin(T*t),s=Math.cos(T*t),l=r-e*(S*n+g*s),u=B(e*(b*n+P*s));return a.done=Math.abs(u)<=i&&Math.abs(r-l)<=o,a.value=a.done?r:l,a}const e=x(t);if(p)a.done=t>=h;else{const n=B(w(t));a.done=Math.abs(n)<=i&&Math.abs(r-e)<=o}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(me(E),pe),e=de(e=>E.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return E}je.applyToOptions=t=>{const e=fe(t,100,je);return t.ease=e.ease,t.duration=B(e.duration),t.type="keyframes",t};function Ie(t,e,n){const i=Math.max(e-5,0);return I(n-t(i),e-i)}function Oe({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:o=10,bounceStiffness:s=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,T=je({keyframes:[d.value,p(d.value)],velocity:Ie(v,t,d.value),damping:o,stiffness:s,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&x(t),d)}}}function Fe(e,n,{clamp:i=!0,ease:o,mixer:s}={}){const r=e.length;if(t.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(t,e,n){const i=[],o=n||P.mix||ce,s=t.length-1;for(let n=0;n<s;n++){let s=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||V:e;s=R(t,s)}i.push(s)}return i}(n,o,s),u=l.length,c=t=>{if(a&&t<e[0])return n[0];let i=0;if(u>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const o=D(e[i],e[i+1],t);return l[i](o)};return i?t=>c(S(e[0],e[r-1],t)):c}function We(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const o=D(0,e,i);t.push(Jt(n,1,o))}}function Ue(t){const e=[0];return We(e,t.length-1),e}function Ne(t,e){return t.map(t=>t*e)}function $e(t,e){return t.map(()=>e||J).splice(0,t.length-1)}function ze({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const o=Q(i)?i.map(it):it(i),s={done:!1,value:e[0]},r=Fe(Ne(n&&n.length===e.length?n:Ue(e),t),e,{ease:Array.isArray(o)?o:$e(e,o)});return{calculatedDuration:t,next:e=>(s.value=r(e),s.done=e>=t,s)}}const Ye=t=>null!==t;function He(t,{repeat:e,repeatType:n="loop"},i,o=1){const s=t.filter(Ye),r=o<0||e&&"loop"!==n&&e%2==1?0:s.length-1;return r&&void 0!==i?i:s[r]}const Xe={decay:Oe,inertia:Oe,tween:ze,keyframes:ze,spring:je};function Ge(t){"string"==typeof t.type&&(t.type=Xe[t.type])}class Ke{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const _e=t=>t/100;class qe extends Ke{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==pt.now()&&this.tick(pt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},mt.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Ge(t);const{type:e=ze,repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=t;let{keyframes:r}=t;const a=e||ze;a!==ze&&"number"!=typeof r[0]&&(this.mixKeyframes=R(_e,ce(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===o&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-s})),null===l.calculatedDuration&&(l.calculatedDuration=me(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:u,repeat:c,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(w=s)),x=S(0,1,n)*r}y?(this.delayState.value=u[0],v=this.delayState):v=w.next(x),o&&!y&&(v.value=o(v.value));let{done:T}=v;y||null===a||(T=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const b=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return b&&p!==Oe&&(v.value=He(u,this.options,f,this.speed)),m&&m(v.value),b&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return j(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(this.currentTime)}set time(t){t=B(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);return Ie(t=>this.generator.next(t).value,t,this.generator.next(t).value)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(pt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=j(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=he,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(pt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,mt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function Ze(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Je=t=>180*t/Math.PI,Qe=t=>{const e=Je(Math.atan2(t[1],t[0]));return en(e)},tn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Qe,rotateZ:Qe,skewX:t=>Je(Math.atan(t[1])),skewY:t=>Je(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},en=t=>((t%=360)<0&&(t+=360),t),nn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),on=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),sn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:nn,scaleY:on,scale:t=>(nn(t)+on(t))/2,rotateX:t=>en(Je(Math.atan2(t[6],t[5]))),rotateY:t=>en(Je(Math.atan2(-t[2],t[0]))),rotateZ:Qe,rotate:Qe,skewX:t=>Je(Math.atan(t[4])),skewY:t=>Je(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function rn(t){return t.includes("scale")?1:0}function an(t,e){if(!t||"none"===t)return rn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,o;if(n)i=sn,o=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=tn,o=e}if(!o)return rn(e);const s=i[e],r=o[1].split(",").map(un);return"function"==typeof s?s(r):r[s]}const ln=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return an(n,e)};function un(t){return parseFloat(t.trim())}const cn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hn=(()=>new Set(cn))(),dn=t=>t===Tt||t===jt,pn=new Set(["x","y","z"]),mn=cn.filter(t=>!pn.has(t));const fn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:i})=>{const o=t.max-t.min;return"border-box"===i?o:o-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})=>an(e,"x"),y:(t,{transform:e})=>an(e,"y")};fn.translateX=fn.x,fn.translateY=fn.y;const gn=new Set;let yn=!1,vn=!1,xn=!1;function wn(){if(vn){const t=Array.from(gn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return mn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}vn=!1,yn=!1,gn.forEach(t=>t.complete(xn)),gn.clear()}function Tn(){gn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(vn=!0)})}function Sn(){xn=!0,Tn(),wn(),xn=!1}class bn{constructor(t,e,n,i,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(gn.add(this),yn||(yn=!0,at.read(Tn),at.resolveKeyframes(wn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const o=i?.get(),s=t[t.length-1];if(void 0!==o)t[0]=o;else if(n&&e){const i=n.readValue(e,s);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=s),i&&void 0===o&&i.set(t[0])}Ze(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),gn.delete(this)}cancel(){"scheduled"===this.state&&(gn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Pn=t=>t.startsWith("--");function En(t,e,n){Pn(e)?t.style.setProperty(e,n):t.style[e]=n}const An={};function Mn(t,e){const n=C(t);return()=>An[e]??n()}const Cn=Mn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Vn=Mn(()=>void 0!==window.ViewTimeline,"viewTimeline"),kn=Mn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Rn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Rn([0,.65,.55,1]),circOut:Rn([.55,0,1,.45]),backIn:Rn([.31,.01,.66,-.59]),backOut:Rn([.33,1.53,.69,.99])};function Ln(t,e){return t?"function"==typeof t?kn()?de(t,e):"ease-out":et(t)?Rn(t):Array.isArray(t)?t.map(t=>Ln(t,e)||Dn.easeOut):Dn[t]:void 0}function Bn(t,e,n,{delay:i=0,duration:o=300,repeat:s=0,repeatType:r="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=Ln(a,o);Array.isArray(h)&&(c.easing=h),st.value&&mt.waapi++;const d={delay:i,duration:o,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:"reverse"===r?"alternate":"normal"};u&&(d.pseudoElement=u);const p=t.animate(c,d);return st.value&&p.finished.finally(()=>{mt.waapi--}),p}function jn(t){return"function"==typeof t&&"applyToOptions"in t}function In({type:t,...e}){return jn(t)&&kn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class On extends Ke{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:o,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const u=In(e);this.animation=Bn(n,i,o,u,s),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=He(o,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),En(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return j(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+j(t)}get time(){return j(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=B(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Cn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),V):i(this)}}const Fn={anticipate:X,backInOut:H,circInOut:_};function Wn(t){"string"==typeof t.ease&&t.ease in Fn&&(t.ease=Fn[t.ease])}class Un extends On{constructor(t){Wn(t),Ge(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:o,...s}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new qe({...s,autoplay:!1}),a=Math.max(10,pt.now()-this.startTime),l=S(0,10,a-10),u=r.sample(a).value,{name:c}=this.options;o&&c&&En(o,c,u),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,u,l),r.stop()}}const Nn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Kt.test(t)&&"0"!==t||t.startsWith("url(")));function $n(t){t.duration=0,t.type="keyframes"}const zn=new Set(["opacity","clipPath","filter","transform"]),Yn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Hn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Xn=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Gn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:o,damping:s,type:r,keyframes:a}=t,l=e?.owner?.current;if(!(l instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:c}=e.owner.getProps();return Xn()&&n&&(zn.has(n)||Hn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Yn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!c)&&!u&&!i&&"mirror"!==o&&0!==s&&"inertia"!==r}class Kn extends Ke{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:s="loop",keyframes:r,name:a,motionValue:l,element:u,...c}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=pt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:o,repeatType:s,name:a,motionValue:l,element:u,...c},d=u?.KeyframeResolver||bn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,o){this.keyframeResolver=void 0;const{name:s,type:r,velocity:a,delay:l,isHandoff:u,onUpdate:c}=i;this.resolvedAt=pt.now();let h=!0;(function(e,n,i,o){const s=e[0];if(null===s)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=Nn(s,n),l=Nn(r,n);return t.warning(a===l,`You are trying to animate ${n} from "${s}" to "${r}". "${a?r:s}" is not an animatable value.`,"value-not-animatable"),!(!a||!l)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(e)||("spring"===i||jn(i))&&o)})(e,s,r,a)||(h=!1,!P.instantAnimations&&l||c?.(He(e,i,n)),e[0]=e[e.length-1],$n(i),i.repeat=0);const d={startTime:o?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},p=h&&!u&&Gn(d),m=d.motionValue?.owner?.current;let f;if(p)try{f=new Un({...d,element:m})}catch{f=new qe(d)}else f=new qe(d);f.finished.then(()=>{this.notifyFinished()}).catch(V),this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Sn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class _n{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return qn(this.animations,"duration")}get iterationDuration(){return qn(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function qn(t,e){let n=0;for(let i=0;i<t.length;i++){const o=t[i][e];null!==o&&o>n&&(n=o)}return n}class Zn extends _n{then(t,e){return this.finished.finally(t).then(()=>{})}}class Jn extends On{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()}}}const Qn=new WeakMap,ti=(t,e="")=>`${t}:${e}`;function ei(t){let e=Qn.get(t);return e||(e=new Map,Qn.set(t,e)),e}function ni(t,e,n,i=0,o=1){const s=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(s,r):1===o?s*i:a-s*i}const ii=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function oi(t){const e=ii.exec(t);if(!e)return[,];const[,n,i,o]=e;return[`--${n??i}`,o]}function si(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[o,s]=oi(e);if(!o)return;const r=window.getComputedStyle(n).getPropertyValue(o);if(r){const t=r.trim();return E(t)?parseFloat(t):t}return vt(s)?si(s,n,i+1):s}const ri={type:"spring",stiffness:500,damping:25,restSpeed:10},ai={type:"keyframes",duration:.8},li={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ui=(t,{keyframes:e})=>e.length>2?ai:hn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ri:li;function ci(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function hi(t,e){const n=t?.[e]??t?.default??t;return n!==t?ci(n,t):n}const di=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function pi(t){for(const e in t)if(!di.has(e))return!0;return!1}const mi=(t,e,n,i={},o,s)=>r=>{const a=hi(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=B(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:s?void 0:o};pi(a)||Object.assign(c,ui(t,c)),c.duration&&(c.duration=B(c.duration)),c.repeatDelay&&(c.repeatDelay=B(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&($n(c),0===c.delay&&(h=!0)),(P.instantAnimations||P.skipAnimations||o?.shouldSkipAnimations)&&(h=!0,$n(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!s&&void 0!==e.get()){const t=He(c.keyframes,a);if(void 0!==t)return void at.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new qe(c):new Kn(c)};function fi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function gi(t,e,n,i){if("function"==typeof e){const[o,s]=fi(i);e=e(void 0!==n?n:t.custom,o,s)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[o,s]=fi(i);e=e(void 0!==n?n:t.custom,o,s)}return e}function yi(t,e,n){const i=t.getProps();return gi(i,e,void 0!==n?n:i.custom,t)}const vi=new Set(["width","height","top","left","right","bottom",...cn]),xi={current:void 0};class wi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=pt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=pt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new L);const n=this.events[t].add(e);return"change"===t?()=>{n(),at.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return xi.current&&xi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=pt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return I(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ti(t,e){return new wi(t,e)}const Si=t=>Array.isArray(t);function bi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Ti(n))}function Pi(t){return Si(t)?t[t.length-1]||0:t}function Ei(t,e){const n=yi(t,e);let{transitionEnd:i={},transition:o={},...s}=n||{};s={...s,...i};for(const e in s){bi(t,e,Pi(s[e]))}}const Ai=t=>Boolean(t&&t.getVelocity);function Mi(t){return Boolean(Ai(t)&&t.add)}function Ci(t,e){const n=t.getValue("willChange");if(Mi(n))return n.add(e);if(!n&&P.WillChange){const n=new P.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function Vi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ki="framerAppearId",Ri="data-"+Vi(ki);function Di(t){return t.props[Ri]}function Li({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Bi(t,e,{delay:n=0,transitionOverride:i,type:o}={}){let{transition:s,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();s=s?ci(s,l):l;const u=s?.reduceMotion;i&&(s=i);const c=[],h=o&&t.animationState&&t.animationState.getState()[o];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),o=a[e];if(void 0===o||h&&Li(h,e))continue;const r={delay:n,...hi(s||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(o)&&o===l&&!r.velocity){at.update(()=>i.set(o));continue}let d=!1;if(window.MotionHandoffAnimation){const n=Di(t);if(n){const t=window.MotionHandoffAnimation(n,e,at);null!==t&&(r.startTime=t,d=!0)}}Ci(t,e);const p=u??t.shouldReduceMotion;i.start(mi(e,i,o,p&&vi.has(e)?{type:!1}:r,t,d));const m=i.animation;m&&c.push(m)}if(r){const e=()=>at.update(()=>{r&&Ei(t,r)});c.length?Promise.all(c).then(e):e()}return c}function ji(t,e,n={}){const i=yi(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Bi(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,o=0,s=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ji(l,e,{...r,delay:n+("function"==typeof i?0:i)+ni(t.variantChildren,l,i,o,s)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,s,r,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[s,r]:[r,s];return t().then(()=>e())}return Promise.all([s(),r(n.delay)])}function Ii(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map(e=>ji(t,e,n));i=Promise.all(o)}else if("string"==typeof e)i=ji(t,e,n);else{const o="function"==typeof e?yi(t,e,n.custom):e;i=Promise.all(Bi(t,o,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const Oi=t=>e=>e.test(t),Fi=[Tt,jt,Bt,Lt,Ot,It,{test:t=>"auto"===t,parse:t=>t}],Wi=t=>Fi.find(Oi(t));function Ui(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const Ni=new Set(["brightness","contrast","saturate","opacity"]);function $i(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Et)||[];if(!i)return t;const o=n.replace(i,"");let s=Ni.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+o+")"}const zi=/\b([a-z-]*)\(.*?\)/gu,Yi={...Kt,getAnimatableNone:t=>{const e=t.match(zi);return e?e.map($i).join(" "):t}},Hi={...Kt,getAnimatableNone:t=>{const e=Kt.parse(t);return Kt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Xi={...Tt,transform:Math.round},Gi={rotate:Lt,rotateX:Lt,rotateY:Lt,rotateZ:Lt,scale:bt,scaleX:bt,scaleY:bt,scaleZ:bt,skew:Lt,skewX:Lt,skewY:Lt,distance:jt,translateX:jt,translateY:jt,translateZ:jt,x:jt,y:jt,z:jt,perspective:jt,transformPerspective:jt,opacity:St,originX:Ft,originY:Ft,originZ:jt},Ki={borderWidth:jt,borderTopWidth:jt,borderRightWidth:jt,borderBottomWidth:jt,borderLeftWidth:jt,borderRadius:jt,borderTopLeftRadius:jt,borderTopRightRadius:jt,borderBottomRightRadius:jt,borderBottomLeftRadius:jt,width:jt,maxWidth:jt,height:jt,maxHeight:jt,top:jt,right:jt,bottom:jt,left:jt,inset:jt,insetBlock:jt,insetBlockStart:jt,insetBlockEnd:jt,insetInline:jt,insetInlineStart:jt,insetInlineEnd:jt,padding:jt,paddingTop:jt,paddingRight:jt,paddingBottom:jt,paddingLeft:jt,paddingBlock:jt,paddingBlockStart:jt,paddingBlockEnd:jt,paddingInline:jt,paddingInlineStart:jt,paddingInlineEnd:jt,margin:jt,marginTop:jt,marginRight:jt,marginBottom:jt,marginLeft:jt,marginBlock:jt,marginBlockStart:jt,marginBlockEnd:jt,marginInline:jt,marginInlineStart:jt,marginInlineEnd:jt,fontSize:jt,backgroundPositionX:jt,backgroundPositionY:jt,...Gi,zIndex:Xi,fillOpacity:St,strokeOpacity:St,numOctaves:Xi},_i={...Ki,color:Ut,backgroundColor:Ut,outlineColor:Ut,fill:Ut,stroke:Ut,borderColor:Ut,borderTopColor:Ut,borderRightColor:Ut,borderBottomColor:Ut,borderLeftColor:Ut,filter:Yi,WebkitFilter:Yi,mask:Hi,WebkitMask:Hi},qi=t=>_i[t],Zi=new Set([Yi,Hi]);function Ji(t,e){let n=qi(t);return Zi.has(n)||(n=Kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Qi=new Set(["auto","none","0"]);class to extends bn{constructor(t,e,n,i,o){super(t,e,n,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),vt(i))){const o=si(i,e.current);void 0!==o&&(t[n]=o),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!vi.has(n)||2!==t.length)return;const[i,o]=t,s=Wi(i),r=Wi(o);if(wt(i)!==wt(o)&&fn[n])this.needsMeasurement=!0;else if(s!==r)if(dn(s)&&dn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else fn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Ui(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,o=0;for(;o<t.length&&!i;){const e=t[o];"string"==typeof e&&!Qi.has(e)&&Ht(e).values.length&&(i=t[o]),o++}if(i&&n)for(const o of e)t[o]=Ji(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=fn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const o=n.length-1,s=n[o];n[o]=fn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const eo=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function no(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&eo.has(e)&&(t[n]=t[n]+"px")}const io=C(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0});function oo(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const o=n?.[t]??i.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t).filter(t=>null!=t)}function so(t){return(e,n)=>{const i=oo(e),o=[];for(const e of i){const i=t(e,n);o.push(i)}return()=>{for(const t of o)t()}}}const ro=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class ao{constructor(){this.latest={},this.values=new Map}set(t,e,n,i,o=!0){const s=this.values.get(t);s&&s.onRemove();const r=()=>{const i=e.get();this.latest[t]=o?ro(i,Ki[t]):i,n&&at.render(n)};r();const a=e.on("change",r);i&&e.addDependent(i);const l=()=>{a(),n&<(n),this.values.delete(t),i&&e.removeDependent(i)};return this.values.set(t,{value:e,onRemove:l}),l}get(t){return this.values.get(t)?.value}}function lo(t){const e=new WeakMap;return(n,i)=>{const o=e.get(n)??new ao;e.set(n,o);const s=[];for(const e in i){const r=i[e],a=t(n,o,e,r);s.push(a)}return()=>{for(const t of s)t()}}}const uo=(t,e,n,i)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,n),s=o?n:n.startsWith("data")||n.startsWith("aria")?Vi(n):n,r=o?()=>{t[s]=e.latest[n]}:()=>{const i=e.latest[n];null==i?t.removeAttribute(s):t.setAttribute(s,String(i))};return e.set(n,i,r)},co=so(lo(uo)),ho=lo((t,e,n,i)=>e.set(n,i,()=>{t[n]=e.latest[n]},void 0,!1));function po(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const mo={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};const fo=new Set(["originX","originY","originZ"]),go=(t,e,n,i)=>{let o,s;return hn.has(n)?(e.get("transform")||(po(t)||e.get("transformBox")||go(t,e,"transformBox",new wi("fill-box")),e.set("transform",new wi("none"),()=>{t.style.transform=function(t){let e="",n=!0;for(let i=0;i<cn.length;i++){const o=cn[i],s=t.latest[o];i