framer-motion
Version:
A simple and powerful JavaScript animation library
1 lines • 120 kB
JavaScript
import{jsxs as t,jsx as e}from"react/jsx-runtime";import{createContext as n,useContext as i,useMemo as s,Fragment as o,createElement as r,useRef as a,useInsertionEffect as l,useCallback as h,useLayoutEffect as u,useEffect as c,forwardRef as d,useId as p,Component as m}from"react";function f(t,e){-1===t.indexOf(e)&&t.push(e)}function g(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const y=(t,e,n)=>n>e?e:n<t?t:n;function v(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}let x=()=>{},w=()=>{};"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(x=(t,e,n)=>{t||"undefined"==typeof console||console.warn(v(e,n))},w=(t,e,n)=>{if(!t)throw new Error(v(e,n))});const T={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function P(t){return"object"==typeof t&&null!==t}const b=t=>/^0[^.\s]+$/u.test(t);function E(t){let e;return()=>(void 0===e&&(e=t()),e)}const A=t=>t,M=(t,e)=>n=>e(t(n)),V=(...t)=>t.reduce(M),C=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class k{constructor(){this.subscriptions=[]}add(t){return f(this.subscriptions,t),()=>g(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const D=t=>1e3*t,R=t=>t/1e3;function L(t,e){return e?t*(1e3/e):0}const B=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function j(t,e,n,i){if(t===e&&n===i)return A;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=B(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:B(s(t),e,i)}const F=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,I=t=>e=>1-t(1-e),O=j(.33,1.53,.69,.99),U=I(O),W=F(U),N=t=>(t*=2)<1?.5*U(t):.5*(2-Math.pow(2,-10*(t-1))),$=t=>1-Math.sin(Math.acos(t)),Y=I($),z=F($),X=j(.42,0,1,1),H=j(0,0,.58,1),K=j(.42,0,.58,1),G=t=>Array.isArray(t)&&"number"==typeof t[0],q={linear:A,easeIn:X,easeInOut:K,easeOut:H,circIn:$,circInOut:z,circOut:Y,backIn:U,backInOut:W,backOut:O,anticipate:N},Z=t=>{if(G(t)){w(4===t.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[e,n,i,s]=t;return j(e,n,i,s)}return"string"==typeof t?(w(void 0!==q[t],`Invalid easing type '${t}'`,"invalid-easing-type"),q[t]):t},_=n({}),J=n({strict:!1}),Q=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),tt=n({}),et=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],nt={value:null,addProjectionMetrics:null};function it(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=et.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function h(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(h),e&&nt.value&&nt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:u,update:c,preRender:d,render:p,postRender:m}=r,f=()=>{const o=T.useManualTiming?s.timestamp:performance.now();n=!1,T.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),h.process(s),u.process(s),c.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:et.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<et.length;e++)r[et[e]].cancel(t)},state:s,steps:r}}const{schedule:st,cancel:ot,state:rt,steps:at}=it("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:A,!0);let lt;function ht(){lt=void 0}const ut={now:()=>(void 0===lt&&ut.set(rt.isProcessing||T.useManualTiming?rt.timestamp:performance.now()),lt),set:t=>{lt=t,queueMicrotask(ht)}},ct=t=>e=>"string"==typeof e&&e.startsWith(t),dt=ct("--"),pt=ct("var(--"),mt=t=>!!pt(t)&&ft.test(t.split("/*")[0].trim()),ft=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function gt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const yt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},vt={...yt,transform:t=>y(0,1,t)},xt={...yt,default:1},wt=t=>Math.round(1e5*t)/1e5,Tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const St=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pt=(t,e)=>n=>Boolean("string"==typeof n&&St.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),bt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Tt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Et={...yt,transform:t=>Math.round((t=>y(0,255,t))(t))},At={test:Pt("rgb","red"),parse:bt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Et.transform(t)+", "+Et.transform(e)+", "+Et.transform(n)+", "+wt(vt.transform(i))+")"};const Mt={test:Pt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:At.transform},Vt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Ct=Vt("deg"),kt=Vt("%"),Dt=Vt("px"),Rt=Vt("vh"),Lt=Vt("vw"),Bt=(()=>({...kt,parse:t=>kt.parse(t)/100,transform:t=>kt.transform(100*t)}))(),jt={test:Pt("hsl","hue"),parse:bt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+kt.transform(wt(e))+", "+kt.transform(wt(n))+", "+wt(vt.transform(i))+")"},Ft={test:t=>At.test(t)||Mt.test(t)||jt.test(t),parse:t=>At.test(t)?At.parse(t):jt.test(t)?jt.parse(t):Mt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?At.transform(t):jt.transform(t),getAnimatableNone:t=>{const e=Ft.parse(t);return e.alpha=0,Ft.transform(e)}},It=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ot="number",Ut="color",Wt=/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 Nt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Wt,t=>(Ft.test(t)?(i.color.push(o),s.push(Ut),n.push(Ft.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Ot),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function $t(t){return Nt(t).values}function Yt(t){const{split:e,types:n}=Nt(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===Ot?wt(t[o]):e===Ut?Ft.transform(t[o]):t[o]}return s}}const zt=t=>"number"==typeof t?0:Ft.test(t)?Ft.getAnimatableNone(t):t;const Xt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Tt)?.length||0)+(t.match(It)?.length||0)>0},parse:$t,createTransformer:Yt,getAnimatableNone:function(t){const e=$t(t);return Yt(t)(e.map(zt))}};function Ht(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 Kt(t,e){return n=>n>0?e:t}const Gt=(t,e,n)=>t+(e-t)*n,qt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Zt=[Mt,At,jt];function _t(t){const e=(n=t,Zt.find(t=>t.test(n)));var n;if(x(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!Boolean(e))return!1;let i=e.parse(t);return e===jt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ht(a,i,t+1/3),o=Ht(a,i,t),r=Ht(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Jt=(t,e)=>{const n=_t(t),i=_t(e);if(!n||!i)return Kt(t,e);const s={...n};return t=>(s.red=qt(n.red,i.red,t),s.green=qt(n.green,i.green,t),s.blue=qt(n.blue,i.blue,t),s.alpha=Gt(n.alpha,i.alpha,t),At.transform(s))},Qt=new Set(["none","hidden"]);function te(t,e){return n=>Gt(t,e,n)}function ee(t){return"number"==typeof t?te:"string"==typeof t?mt(t)?Kt:Ft.test(t)?Jt:se:Array.isArray(t)?ne:"object"==typeof t?Ft.test(t)?Jt:ie:Kt}function ne(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>ee(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ie(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=ee(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const se=(t,e)=>{const n=Xt.createTransformer(e),i=Nt(t),s=Nt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Qt.has(t)&&!s.values.length||Qt.has(e)&&!i.values.length?function(t,e){return Qt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):V(ne(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),n):(x(!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"),Kt(t,e))};function oe(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Gt(t,e,n);return ee(t)(t,e)}const re=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>st.update(e,t),stop:()=>ot(e),now:()=>rt.isProcessing?rt.timestamp:ut.now()}},ae=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},le=2e4;function he(t){let e=0;let n=t.next(e);for(;!n.done&&e<le;)e+=50,n=t.next(e);return e>=le?1/0:e}function ue(t,e,n){const i=Math.max(e-5,0);return L(n-t(i),e-i)}const ce=100,de=10,pe=1,me=0,fe=800,ge=.3,ye=.3,ve={granular:.01,default:2},xe={granular:.005,default:.5},we=.01,Te=10,Se=.05,Pe=1,be=.001;function Ee({duration:t=fe,bounce:e=ge,velocity:n=me,mass:i=pe}){let s,o;x(t<=D(Te),"Spring duration must be 10 seconds or less","spring-duration-limit");let r=1-e;r=y(Se,Pe,r),t=y(we,Te,R(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=Me(e,r),l=Math.exp(-s);return be-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),h=Me(Math.pow(e,2),r);return(-s(e)+be>0?-1:1)*((o-a)*l)/h}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<Ae;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=D(t),isNaN(a))return{stiffness:ce,damping:de,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Ae=12;function Me(t,e){return t*Math.sqrt(1-e*e)}const Ve=["duration","bounce"],Ce=["stiffness","damping","mass"];function ke(t,e){return e.some(e=>void 0!==t[e])}function De(t=ye,e=ge){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:h,mass:u,duration:c,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:me,stiffness:ce,damping:de,mass:pe,isResolvedFromDuration:!1,...t};if(!ke(t,Ce)&&ke(t,Ve))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*y(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:pe,stiffness:s,damping:o}}else{const n=Ee(t);e={...e,...n,mass:pe},e.isResolvedFromDuration=!0}return e}({...n,velocity:-R(n.velocity||0)}),m=d||0,f=h/(2*Math.sqrt(l*u)),g=r-o,v=R(Math.sqrt(l/u)),x=Math.abs(g)<5;let w;if(i||(i=x?ve.granular:ve.default),s||(s=x?xe.granular:xe.default),f<1){const t=Me(v,f);w=e=>{const n=Math.exp(-f*v*e);return r-n*((m+f*v*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)w=t=>r-Math.exp(-v*t)*(g+(m+v*g)*t);else{const t=v*Math.sqrt(f*f-1);w=e=>{const n=Math.exp(-f*v*e),i=Math.min(t*e,300);return r-n*((m+f*v*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const T={calculatedDuration:p&&c||null,next:t=>{const e=w(t);if(p)a.done=t>=c;else{let n=0===t?m:0;f<1&&(n=0===t?D(m):ue(w,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(he(T),le),e=ae(e=>T.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return T}function Re({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:h=.5,restSpeed:u}){const c=t[0],d={done:!1,value:c},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=c+m,g=void 0===r?f:r(f);g!==f&&(m=g-c);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)<=h,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=De({keyframes:[d.value,p(d.value)],velocity:ue(v,t,d.value),damping:s,stiffness:o,restDelta:h,restSpeed:u}))};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 Le(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(w(o===e.length,"Both input and output ranges must be the same length","range-length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||T.mix||oe,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||A:e;o=V(t,o)}i.push(o)}return i}(e,i,s),l=a.length,h=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=C(t[i],t[i+1],n);return a[i](s)};return n?e=>h(y(t[0],t[o-1],e)):h}function Be(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=C(0,e,i);t.push(Gt(n,1,s))}}(e,t.length-1),e}function je({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(Z):Z(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Be(e),t),a=Le(r,e,{ease:Array.isArray(s)?s:(l=e,h=s,l.map(()=>h||K).splice(0,l.length-1))});var l,h;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}De.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(he(i),le);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:R(s)}}(t,100,De);return t.ease=e.ease,t.duration=D(e.duration),t.type="keyframes",t};const Fe=t=>null!==t;function Ie(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Fe),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Oe={decay:Re,inertia:Re,tween:je,keyframes:je,spring:De};function Ue(t){"string"==typeof t.type&&(t.type=Oe[t.type])}class We{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 Ne=t=>t/100;class $e extends We{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==ut.now()&&this.tick(ut.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Ue(t);const{type:e=je,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||je;a!==je&&"number"!=typeof r[0]&&(this.mixKeyframes=V(Ne,oe(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=he(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:u,repeatType:c,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),v=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let x=this.currentTime,w=n;if(u){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,u+1);Boolean(e%2)&&("reverse"===c?(n=1-n,d&&(n-=d/r)):"mirror"===c&&(w=o)),x=y(0,1,n)*r}const T=v?{done:!1,value:h[0]}:w.next(x);s&&(T.value=s(T.value));let{done:S}=T;v||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const P=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return P&&p!==Re&&(T.value=Ie(h,this.options,f,this.speed)),m&&m(T.value),P&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return R(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+R(t)}get time(){return R(this.currentTime)}set time(t){t=D(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?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ut.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=R(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=re,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(ut.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}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)}}const Ye=t=>180*t/Math.PI,ze=t=>{const e=Ye(Math.atan2(t[1],t[0]));return He(e)},Xe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:ze,rotateZ:ze,skewX:t=>Ye(Math.atan(t[1])),skewY:t=>Ye(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},He=t=>((t%=360)<0&&(t+=360),t),Ke=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Ge=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),qe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ke,scaleY:Ge,scale:t=>(Ke(t)+Ge(t))/2,rotateX:t=>He(Ye(Math.atan2(t[6],t[5]))),rotateY:t=>He(Ye(Math.atan2(-t[2],t[0]))),rotateZ:ze,rotate:ze,skewX:t=>Ye(Math.atan(t[4])),skewY:t=>Ye(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ze(t){return t.includes("scale")?1:0}function _e(t,e){if(!t||"none"===t)return Ze(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=qe,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=Xe,s=e}if(!s)return Ze(e);const o=i[e],r=s[1].split(",").map(Je);return"function"==typeof o?o(r):r[o]}function Je(t){return parseFloat(t.trim())}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],tn=(()=>new Set(Qe))(),en=t=>t===yt||t===Dt,nn=new Set(["x","y","z"]),sn=Qe.filter(t=>!nn.has(t));const on={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})=>_e(e,"x"),y:(t,{transform:e})=>_e(e,"y")};on.translateX=on.x,on.translateY=on.y;const rn=new Set;let an=!1,ln=!1,hn=!1;function un(){if(ln){const t=Array.from(rn).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 sn.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)})}ln=!1,an=!1,rn.forEach(t=>t.complete(hn)),rn.clear()}function cn(){rn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ln=!0)})}class dn{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(rn.add(this),an||(an=!0,st.read(cn),st.resolveKeyframes(un))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),rn.delete(this)}cancel(){"scheduled"===this.state&&(rn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const pn={};function mn(t,e){const n=E(t);return()=>pn[e]??n()}const fn=mn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),gn=mn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),yn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,vn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yn([0,.65,.55,1]),circOut:yn([.55,0,1,.45]),backIn:yn([.31,.01,.66,-.59]),backOut:yn([.33,1.53,.69,.99])};function xn(t,e){return t?"function"==typeof t?gn()?ae(t,e):"ease-out":G(t)?yn(t):Array.isArray(t)?t.map(t=>xn(t,e)||vn.easeOut):vn[t]:void 0}function wn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const u={[e]:n};l&&(u.offset=l);const c=xn(a,s);Array.isArray(c)&&(u.easing=c);const d={delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(u,d)}function Tn(t){return"function"==typeof t&&"applyToOptions"in t}class Sn extends We{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,w("string"!=typeof t.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const l=function({type:t,...e}){return Tn(t)&&gn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=wn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=Ie(i,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),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 R(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+R(t)}get time(){return R(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=D(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&fn()?(this.animation.timeline=t,A):e(this)}}const Pn={anticipate:N,backInOut:W,circInOut:z};function bn(t){"string"==typeof t.ease&&t.ease in Pn&&(t.ease=Pn[t.ease])}class En extends Sn{constructor(t){bn(t),Ue(t),super(t),void 0!==t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new $e({...o,autoplay:!1}),a=Math.max(10,ut.now()-this.startTime),l=y(0,10,a-10);e.setWithVelocity(r.sample(Math.max(0,a-l)).value,r.sample(a).value,l),r.stop()}}const An=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Xt.test(t)&&"0"!==t||t.startsWith("url(")));function Mn(t){t.duration=0,t.type="keyframes"}const Vn=new Set(["opacity","clipPath","filter","transform"]),Cn=E(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class kn extends We{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:h,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ut.now();const c={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:h,...u},d=h?.KeyframeResolver||dn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,c,!n),a,l,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:h}=n;this.resolvedAt=ut.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=An(s,e),a=An(o,e);return x(r===a,`You are trying to animate ${e} from "${s}" to "${o}". "${r?o:s}" is not an animatable value.`,"value-not-animatable"),!(!r||!a)&&(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}(t)||("spring"===n||Tn(n))&&i)}(t,s,o,r)||(!T.instantAnimations&&a||h?.(Ie(t,n,e)),t[0]=t[t.length-1],Mn(n),n.repeat=0);const u={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},c=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t,a=e?.owner?.current;if(!(a instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:h}=e.owner.getProps();return Cn()&&n&&Vn.has(n)&&("transform"!==n||!h)&&!l&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}(u),d=u.motionValue?.owner?.current,p=c?new En({...u,element:d}):new $e(u);p.finished.then(()=>{this.notifyFinished()}).catch(A),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}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(),hn=!0,cn(),un(),hn=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Dn(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const Rn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ln(t,e,n=1){w(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,s]=function(t){const e=Rn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return S(t)?parseFloat(t):t}return mt(s)?Ln(s,e,n+1):s}const Bn={type:"spring",stiffness:500,damping:25,restSpeed:10},jn={type:"keyframes",duration:.8},Fn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},In=(t,{keyframes:e})=>e.length>2?jn:tn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Bn:Fn,On=t=>null!==t;function Un(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Wn(t,e){const n=t?.[e]??t?.default??t;return n!==t?Un(n,t):n}const Nn=(t,e,n,i={},s,o)=>r=>{const a=Wn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=D(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-h,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,In(t,u)),u.duration&&(u.duration=D(u.duration)),u.repeatDelay&&(u.repeatDelay=D(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let c=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(Mn(u),0===u.delay&&(c=!0)),(T.instantAnimations||T.skipAnimations||s?.shouldSkipAnimations)&&(c=!0,Mn(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,c&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(On),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}(u.keyframes,a);if(void 0!==t)return void st.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new $e(u):new kn(u)};function $n(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Yn(t,e,n,i){if("function"==typeof e){const[s,o]=$n(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=$n(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function zn(t,e,n){const i=t.getProps();return Yn(i,e,void 0!==n?n:i.custom,t)}const Xn=new Set(["width","height","top","left","right","bottom",...Qe]);class Hn{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=ut.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=ut.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 k);const n=this.events[t].add(e);return"change"===t?()=>{n(),st.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 this.current}getPrevious(){return this.prev}getVelocity(){const t=ut.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return L(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 Kn(t,e){return new Hn(t,e)}const Gn=t=>Array.isArray(t);function qn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Kn(n))}function Zn(t){return Gn(t)?t[t.length-1]||0:t}const _n=t=>Boolean(t&&t.getVelocity);function Jn(t,e){const n=t.getValue("willChange");if(i=n,Boolean(_n(i)&&i.add))return n.add(e);if(!n&&T.WillChange){const n=new T.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Qn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ti="data-"+Qn("framerAppearId");function ei(t){return t.props[ti]}function ni({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function ii(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Un(o,l):l;const h=o?.reduceMotion;i&&(o=i);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&ni(c,e))continue;const r={delay:n,...Wn(o||{},e)},l=i.get();if(void 0!==l&&!i.isAnimating&&!Array.isArray(s)&&s===l&&!r.velocity)continue;let d=!1;if(window.MotionHandoffAnimation){const n=ei(t);if(n){const t=window.MotionHandoffAnimation(n,e,st);null!==t&&(r.startTime=t,d=!0)}}Jn(t,e);const p=h??t.shouldReduceMotion;i.start(Nn(e,i,s,p&&Xn.has(e)?{type:!1}:r,t,d));const m=i.animation;m&&u.push(m)}if(r){const e=()=>st.update(()=>{r&&function(t,e){const n=zn(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)qn(t,e,Zn(o[e]))}(t,r)});u.length?Promise.all(u).then(e):e()}return u}function si(t,e,n={}){const i=zn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(ii(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(si(l,e,{...r,delay:n+("function"==typeof i?0:i)+Dn(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}const oi=t=>e=>e.test(t),ri=[yt,Dt,kt,Ct,Lt,Rt,{test:t=>"auto"===t,parse:t=>t}],ai=t=>ri.find(oi(t));function li(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const hi=new Set(["brightness","contrast","saturate","opacity"]);function ui(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Tt)||[];if(!i)return t;const s=n.replace(i,"");let o=hi.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const ci=/\b([a-z-]*)\(.*?\)/gu,di={...Xt,getAnimatableNone:t=>{const e=t.match(ci);return e?e.map(ui).join(" "):t}},pi={...Xt,getAnimatableNone:t=>{const e=Xt.parse(t);return Xt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},mi={...yt,transform:Math.round},fi={borderWidth:Dt,borderTopWidth:Dt,borderRightWidth:Dt,borderBottomWidth:Dt,borderLeftWidth:Dt,borderRadius:Dt,borderTopLeftRadius:Dt,borderTopRightRadius:Dt,borderBottomRightRadius:Dt,borderBottomLeftRadius:Dt,width:Dt,maxWidth:Dt,height:Dt,maxHeight:Dt,top:Dt,right:Dt,bottom:Dt,left:Dt,inset:Dt,insetBlock:Dt,insetBlockStart:Dt,insetBlockEnd:Dt,insetInline:Dt,insetInlineStart:Dt,insetInlineEnd:Dt,padding:Dt,paddingTop:Dt,paddingRight:Dt,paddingBottom:Dt,paddingLeft:Dt,paddingBlock:Dt,paddingBlockStart:Dt,paddingBlockEnd:Dt,paddingInline:Dt,paddingInlineStart:Dt,paddingInlineEnd:Dt,margin:Dt,marginTop:Dt,marginRight:Dt,marginBottom:Dt,marginLeft:Dt,marginBlock:Dt,marginBlockStart:Dt,marginBlockEnd:Dt,marginInline:Dt,marginInlineStart:Dt,marginInlineEnd:Dt,fontSize:Dt,backgroundPositionX:Dt,backgroundPositionY:Dt,...{rotate:Ct,rotateX:Ct,rotateY:Ct,rotateZ:Ct,scale:xt,scaleX:xt,scaleY:xt,scaleZ:xt,skew:Ct,skewX:Ct,skewY:Ct,distance:Dt,translateX:Dt,translateY:Dt,translateZ:Dt,x:Dt,y:Dt,z:Dt,perspective:Dt,transformPerspective:Dt,opacity:vt,originX:Bt,originY:Bt,originZ:Dt},zIndex:mi,fillOpacity:vt,strokeOpacity:vt,numOctaves:mi},gi={...fi,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:di,WebkitFilter:di,mask:pi,WebkitMask:pi},yi=t=>gi[t],vi=new Set([di,pi]);function xi(t,e){let n=yi(t);return vi.has(n)||(n=Xt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const wi=new Set(["auto","none","0"]);class Ti extends dn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),mt(i))){const s=Ln(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Xn.has(n)||2!==t.length)return;const[i,s]=t,o=ai(i),r=ai(s);if(gt(i)!==gt(s)&&on[n])this.needsMeasurement=!0;else if(o!==r)if(en(o)&&en(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else on[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||li(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!wi.has(e)&&Nt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=xi(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=on[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 s=n.length-1,o=n[s];n[s]=on[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Si=new Set(["opacity","clipPath","filter","transform"]);function Pi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const e=document.querySelectorAll(t);return e?Array.from(e):[]}return Array.from(t).filter(t=>null!=t)}const bi=(t,e)=>e&&"number"==typeof t?e.transform(t):t;const{schedule:Ei,cancel:Ai}=it(queueMicrotask,!1),Mi={x:!1,y:!1};function Vi(){return Mi.x||Mi.y}function Ci(t,e){const n=Pi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function ki(t,e,n={}){const[i,s,o]=Ci(t,n);return i.forEach(t=>{let n,i=!1,o=!1;const r=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",l)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),o&&(o=!1,r(t))},l=t=>{"touch"!==t.pointerType&&(i?o=!0:r(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||Vi())return;o=!1;const r=e(t,i);"function"==typeof r&&(n=r,t.addEventListener("pointerleave",l,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),o}const Di=(t,e)=>!!e&&(t===e||Di(t,e.parentElement)),Ri=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Li=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Bi=new Set(["INPUT","SELECT","TEXTAREA"]);const ji=new WeakSet;function Fi(t){return e=>{"Enter"===e.key&&t(e)}}function Ii(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Oi(t){return Ri(t)&&!Vi()}const Ui=new WeakSet;function Wi(t,e,n={}){const[i,s,o]=Ci(t,n),r=t=>{const i=t.currentTarget;if(!Oi(t))return;if(Ui.has(t))return;ji.add(i),n.stopPropagation&&Ui.add(t);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ji.has(i)&&ji.delete(i),Oi(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||Di(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),P(e=t)&&"offsetHeight"in e&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Fi(()=>{if(ji.has(n))return;Ii(n,"down");const t=Fi(()=>{Ii(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>Ii(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),function(t){return Li.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Ni(t){return P(t)&&"ownerSVGElement"in t}const $i=new WeakMap;let Yi;const zi=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ni(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Xi=zi("inline","width","offsetWidth"),Hi=zi("block","height","offsetHeight");function Ki({target:t,borderBoxSize:e}){$i.get(t)?.forEach(n=>{n(t,{get width(){return Xi(t,e)},get height(){return Hi(t,e)}})})}function Gi(t){t.forEach(Ki)}function qi(t,e){Yi||"undefined"!=typeof ResizeObserver&&(Yi=new ResizeObserver(Gi));const n=Pi(t);return n.forEach(t=>{let n=$i.get(t);n||(n=new Set,$i.set(t,n)),n.add(e),Yi?.observe(t)}),()=>{n.forEach(t=>{const n=$i.get(t);n?.delete(e),n?.size||Yi?.unobserve(t)})}}const Zi=new Set;let _i;function Ji(t){return Zi.add(t),_i||(_i=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Zi.forEach(e=>e(t))},window.addEventListener("resize",_i)),()=>{Zi.delete(t),Zi.size||"function"!=typeof _i||(window.removeEventListener("resize",_i),_i=void 0)}}function Qi(t,e){return"function"==typeof t?Ji(t):qi(t,e)}const ts=[...ri,Ft,Xt],es=()=>({x:{min:0,max:0},y:{min:0,max:0}}),ns=new WeakMap;function is(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ss(t){return"string"==typeof t||Array.isArray(t)}const os=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],rs=["initial",...os];function as(t){return is(t.animate)||rs.some(e=>ss(t[e]))}function ls(t){return Boolean(as(t)||t.variants)}const hs={current:null},us={current:!1},cs="undefined"!=typeof window;const ds=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ps={};function ms(t){ps=t}class fs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=dn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const t=ut.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,st.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=a,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=as(e),this.isVariantNode=ls(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in c){const e=c[t];void 0!==l[t]&&_n(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,ns.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(us.current||function(){if(us.current=!0,cs)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>hs.current=t.matches;t.addEventListener("change",e),e()}else hs.current=!1}(),this.shouldReduceMotion=hs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),ot(this.notifyUpdate),ot(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&Si.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Sn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:D(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=tn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this