framer-motion
Version:
A simple and powerful JavaScript animation library
3 lines • 86.8 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 r,createElement as o,useRef as a,useInsertionEffect as u,useCallback as l,useLayoutEffect as c,useEffect as h,forwardRef as d,useState as p,startTransition as m}from"react";const f=(t,e,n)=>n>e?e:n<t?t:n,g={},y=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),v=t=>/^0[^.\s]+$/u.test(t);const b=t=>t,w=(...t)=>t.reduce((t,e)=>n=>e(t(n))),S=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class T{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>this.remove(t)}remove(t){!function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(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 A=t=>1e3*t,M=t=>t/1e3,x=(t,e)=>e?t*(1e3/e):0,k=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function V(t,e,n,i){return t===e&&n===i?b:s=>{let r=0,o=1,a=s;for(let e=0;;e++){a>=r&&a<=o||(a=(r+o)/2);const i=k(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?o=a:r=a,a-=1e-7*i/(k(a+1e-7,t,n)-s-i)}return k(a,e,i)}}const C=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,E=t=>e=>1-t(1-e),P=V(.33,1.53,.69,.99),F=E(P),D=C(F),O=t=>t>=1?1:(t*=2)<1?.5*F(t):.5*(2-Math.pow(2,-10*(t-1))),R=t=>1-Math.sin(Math.acos(t)),I=E(R),L=C(R),B=V(.42,0,1,1),j=V(0,0,.58,1),N=V(.42,0,.58,1),W=t=>Array.isArray(t)&&"number"!=typeof t[0],K=t=>Array.isArray(t)&&"number"==typeof t[0],U={linear:b,easeIn:B,easeInOut:N,easeOut:j,circIn:R,circInOut:L,circOut:I,backIn:F,backInOut:D,backOut:P,anticipate:O},Y=t=>{if(K(t)){const[e,n,i,s]=t;return V(e,n,i,s)}return"string"==typeof t?U[t]:t},X={delta:0,timestamp:0,isProcessing:!1};let $;function _(){$=void 0}const H={now:()=>(void 0===$&&H.set(X.isProcessing||g.useManualTiming?X.timestamp:performance.now()),$),set:t=>{$=t,queueMicrotask(_)}},z=t=>Math.round(1e5*t)/1e5,q=t=>e=>"string"==typeof e&&e.startsWith(t),J=q("--"),Z=q("var(--"),G=t=>!!Z(t)&&Q.test(t.split("/*")[0].trim()),Q=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function tt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const et={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},nt={...et,transform:t=>f(0,1,t)},it={...et,default:1},st=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const rt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ot=(t,e)=>n=>Boolean("string"==typeof n&&rt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),at=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,r,o,a]=i.match(st);return{[t]:parseFloat(s),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},ut={...et,transform:t=>Math.round((t=>f(0,255,t))(t))},lt={test:ot("rgb","red"),parse:at("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+ut.transform(t)+", "+ut.transform(e)+", "+ut.transform(n)+", "+z(nt.transform(i))+")"},ct=(t,e,n)=>{const i=t.substring(1+e*n,1+(e+1)*n);return n>1?i:i+i};const ht={test:ot("#"),parse:function(t){const e=t.length>5?2:1,n=ct(t,3,e);return{red:parseInt(ct(t,0,e),16),green:parseInt(ct(t,1,e),16),blue:parseInt(ct(t,2,e),16),alpha:n?parseInt(n,16)/255:1}},transform:lt.transform},dt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),pt=dt("deg"),mt=dt("%"),ft=dt("px"),gt=dt("vh"),yt=dt("vw"),vt=(()=>({...mt,parse:t=>mt.parse(t)/100,transform:t=>mt.transform(100*t)}))(),bt={test:ot("hsl","hue"),parse:at("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+mt.transform(z(e))+", "+mt.transform(z(n))+", "+z(nt.transform(i))+")"},wt={test:t=>lt.test(t)||ht.test(t)||bt.test(t),parse:t=>lt.test(t)?lt.parse(t):bt.test(t)?bt.parse(t):ht.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?lt.transform(t):bt.transform(t),getAnimatableNone:t=>{const e=wt.parse(t);return e.alpha=0,wt.transform(e)}},St=new RegExp(st.source),Tt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const At="number",Mt="color",xt=/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+)(?![a-z]*\()/giu;function kt(t){const e=t.toString();return St.test(e)||Tt.test(e)}function Vt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let r=0;const o=e.replace(xt,t=>(wt.test(t)?(i.color.push(r),s.push(Mt),n.push(wt.parse(t))):t.startsWith("var(")?(i.var.push(r),s.push("var"),n.push(t)):(i.number.push(r),s.push(At),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:i,types:s}}function Ct({split:t,types:e}){const n=t.length;return i=>{let s="";for(let r=0;r<n;r++)if(s+=t[r],void 0!==i[r]){const t=e[r];s+=t===At?z(i[r]):t===Mt?wt.transform(i[r]):i[r]}return s}}const Et=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:wt.test(n)?wt.getAnimatableNone(n):n;var n};const Pt={test:function(t){return isNaN(t)&&"string"==typeof t&&(St.test(t)||Tt.test(t))},parse:function(t){return Vt(t).values},createTransformer:function(t){return Ct(Vt(t))},getAnimatableNone:function(t){const e=Vt(t);return Ct(e)(e.values.map((t,n)=>Et(t,e.split[n])))}};function Ft(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Dt(t,e){return n=>n>0?e:t}const Ot=(t,e,n)=>t+(e-t)*n,Rt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},It=[ht,lt,bt];function Lt(t){const e=(n=t,It.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===bt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,r=0,o=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=Ft(a,i,t+1/3),r=Ft(a,i,t),o=Ft(a,i,t-1/3)}else s=r=o=n;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(i)),i}const Bt=(t,e)=>{const n=Lt(t),i=Lt(e);if(!n||!i)return Dt(t,e);const s={...n};return t=>(s.red=Rt(n.red,i.red,t),s.green=Rt(n.green,i.green,t),s.blue=Rt(n.blue,i.blue,t),s.alpha=Ot(n.alpha,i.alpha,t),lt.transform(s))},jt=new Set(["none","hidden"]);function Nt(t,e){return n=>Ot(t,e,n)}function Wt(t){return"number"==typeof t?Nt:"string"==typeof t?G(t)?Dt:wt.test(t)?Bt:Yt:Array.isArray(t)?Kt:"object"==typeof t?wt.test(t)?Bt:Ut:Dt}function Kt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Wt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Ut(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Wt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const Yt=(t,e)=>{const n=Vt(t),i=Vt(e);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?jt.has(t)&&!i.values.length||jt.has(e)&&!n.values.length?function(t,e){return jt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):w(Kt(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][i[r]],a=t.values[o]??0;n[s]=a,i[r]++}return n}(n,i),i.values),Ct(i)):Dt(t,e)},Xt=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function $t(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ot(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=Xt.exec(t);if(!n)return;const i=Xt.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],r=parseFloat(n[1]),o=parseFloat(i[1]);return t=>z(Ot(r,o,t))+s}(t,e);if(n)return n}return Wt(t)(t,e)}const _t=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ht(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,s=!0;const r=()=>i=!0,o=_t.reduce((t,e)=>(t[e]=function(t){let e,n=new Set,i=new Set,s=!1,r=!1;const o=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function u(n){o.has(n)&&(i.add(n),t()),(e=n)(a)}const l={schedule:(t,r=!1,a=!1)=>{const u=a&&s,l=u?n:i;return r&&o.add(t),u&&t!==e&&l.delete(t),l.add(t),t},cancel:t=>{i.delete(t),o.delete(t)},process:t=>{if(a=t,s)return void(r=!0);s=!0;const o=n;n=i,i=o,n.forEach(u),n.clear(),e=void 0,s=!1,r&&(r=!1,l.process(t))}};return l}(r),t),{}),{setup:a,read:u,resolveKeyframes:l,preUpdate:c,update:h,preRender:d,render:p,postRender:m}=o,f=()=>{const r=g.useManualTiming,o=r?n.timestamp:performance.now();i=!1,r||(n.delta=s?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,a.process(n),u.process(n),l.process(n),c.process(n),h.process(n),d.process(n),p.process(n),m.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(f))};return{schedule:_t.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(i||(i=!0,s=!0,n.isProcessing||t(f)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<_t.length;e++)o[_t[e]].cancel(t)},state:n,steps:o}}const{schedule:zt,cancel:qt}=Ht("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:b,!0,X),Jt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>zt.update(e,t),stop:()=>qt(e),now:()=>X.isProcessing?X.timestamp:H.now()}},Zt=(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)})`},Gt=2e4;function Qt(t,e=50,n=2e4,i){let s=0,r=t.next(s);for(;!r.done&&s<n;)s+=e,r=t.next(s);return s>=n?1/0:s}const te=t=>t<0?1/Math.max(1+t,.05):Math.max(1-t,.05);function ee(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),i=t-n,s=t+n,r=2*n*Math.exp(-e)*(1+e);return se(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-r,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function ne(t,e){return t*Math.sqrt(1-e*e)}const ie=12;function se(t,e,n){let i=n;for(let n=1;n<ie;n++)i-=t(i)/e(i);return i}const re=.001;const oe=(t,e)=>(e?t>=0:t>0)&&t<1/0;function ae(t,e){if(oe(t,e))return t}function ue(t){const e=ae(t.stiffness),n=ae(t.damping,!0),i=ae(t.mass),s={...t,stiffness:e??100,damping:n??10,mass:i??1,isResolvedFromDuration:!1,isTimeDefined:void 0===(e??n??i)&&(void 0!==t.duration||void 0!==t.bounce)};if(s.isTimeDefined){if(t.visualDuration){const e=te(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*ee(e,2*Math.PI/1.2);s.stiffness=n*n,s.damping=2*e*Math.sqrt(s.stiffness)}else Object.assign(s,function({duration:t=800,bounce:e=.3}){let n,i;const s=te(e);t=f(.01,10,M(t)),s<1?(n=e=>{const n=e*s,i=n*t,r=ne(e,s),o=Math.exp(-i);return re-n/r*o},i=e=>{const i=e*s*t,r=s*s*e*e*t,o=Math.exp(-i),a=ne(e*e,s);return(-n(e)+re>0?-1:1)*-r*o/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*-e));const r=se(n,i,5/t),o=r*ee(s,r*t),a=o*o;return{stiffness:a,damping:2*s*Math.sqrt(a),duration:A(t)}}(s)),s.isResolvedFromDuration=!0;oe(s.stiffness)&&oe(s.damping,!0)||(s.stiffness=100,s.damping=10)}return s}function le(t=.3,e=.3){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],r={done:!1,value:i},{stiffness:o,damping:a,mass:u,duration:l,isResolvedFromDuration:c,isTimeDefined:h}=ue({...n}),d=t=>c?0:-M(t),p=a/(2*Math.sqrt(o*u)),m=M(Math.sqrt(o/u)),f=p*m,g={target:s,delta:s-i,velocity:d(n.velocity)||0,restSpeed:0,restDelta:0},y=()=>{const t=Math.abs(g.delta)<5;g.restSpeed=n.restSpeed||(t?.01:2),g.restDelta=n.restDelta||(t?.005:.5)};let v,b,w;if(y(),p<1){const t=ne(m,p),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(g.velocity+f*g.delta)/t,e.sinC=f*e.A+g.delta*t,e.cosC=f*g.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-f*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};v=t=>(n(t),g.target-e.env*(e.A*e.sin+g.delta*e.cos)),b=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===p){v=t=>g.target-Math.exp(-m*t)*(g.delta+(g.velocity+m*g.delta)*t);const t={C:0};w=()=>{t.C=g.velocity+m*g.delta},b=e=>Math.exp(-m*e)*(m*t.C*e-g.velocity)}else{const t=m*Math.sqrt(p*p-1),e=f-t,n=f+t,i=t<1||h?1/0:300/t,s=(t,e)=>Math.exp(e>i?(f-t)*i-f*e:-t*e),r={S:0,F:0};w=()=>{const e=(g.velocity+f*g.delta)/t;r.S=(g.delta+e)/2,r.F=(g.delta-e)/2},v=t=>g.target-r.S*s(e,t)-r.F*s(n,t),b=t=>e*r.S*s(e,t)+n*r.F*s(n,t)}w();const S=c&&l||null,T={calculatedDuration:S,retarget:(t,e)=>{g.target=t[t.length-1],g.delta=g.target-t[0],g.velocity=d(e),n.restSpeed&&n.restDelta||y(),T.calculatedDuration=S,r.done=!1,w()},velocity:t=>A(b(t)),next:t=>{const e=v(t);if(c)r.done=t>=l;else{const n=A(b(t));r.done=Math.abs(n)<=g.restSpeed&&Math.abs(g.target-e)<=g.restDelta}return r.value=r.done?g.target:e,r},toString:()=>{const t=Math.min(Qt(T),Gt),e=Zt(e=>T.next(t*e).value,t,30);return t+"ms "+e}};return T}const ce=Object.assign(le,{applyToOptions:t=>{const e=function(t,e=100,n){const{keyframes:i,velocity:s}=t,r=i&&i[i.length-1]-i[0],o=n({...t,velocity:s&&r?s*e/r:s,keyframes:[0,e]}),a=Math.min(Qt(o),Gt);return{type:"keyframes",ease:t=>o.next(a*t).value/e,duration:M(a)}}(t,100,le);return t.ease=e.ease,t.duration=A(e.duration),t.type="keyframes",t}});function he({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=h+m,g=o?o(f):f;g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>{const e=y(t);d.done=Math.abs(e)<=l,d.value=d.done?g:t?g+e:h};let b,w;const S=t=>{var e;((e=d.value)<a||e>u)&&(b=t,w=ce({keyframes:[d.value,p(d.value)],velocity:-y(t)/i*1e3,damping:s,stiffness:r,restDelta:l,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,v(t),S(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&v(t),d)}}}function de(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const r=t.length;if(1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=g.mix||$t,r=t.length-1;for(let o=0;o<r;o++){let r=n?.(t[o],t[o+1])||s(t[o],t[o+1]);if(e){const t=Array.isArray(e)?e[o]||b:e;r=w(t,r)}i.push(r)}return i}(e,i,s),u=a.length,l=n=>{if(o&&n<t[0])return e[0];let i=0;if(u>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=S(t[i],t[i+1],n);return a[i](s)};return n?e=>l(f(t[0],t[r-1],e)):l}function pe(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=S(0,e,i);t.push(Ot(n,1,s))}}(e,t.length-1),e}function me({duration:t=300,keyframes:e,times:n,ease:i="easeInOut",mixer:s}){const r="number"==typeof e[0]?void 0:s,o=W(i)?i.map(Y):Y(i)||N,a={done:!1,value:e[0]};let u=-1;if(!r)for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(u>=0){u=-2;break}u=t-1}if(u>=0){const i=n&&n.length===e.length?n:pe(e),s=i[u]*t,r=i[u+1]*t,l=e[u],c=e[u+1],h=Array.isArray(o)?o[u]:o,d=(g.mix||$t)(l,c),p=e.length-2;return{calculatedDuration:t,next:e=>(a.value=u&&e<s?d(0):u<p&&(e>=r||!t)?"number"==typeof c?c:d(1):d(h(e>=r||!t?1:e<=s?0:(e-s)/(r-s))),a.done=e>=t,a)}}const l=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:pe(e),t),c=de(l,e,{ease:Array.isArray(o)?o:(h=e,d=o,h.map(()=>d||N).splice(0,h.length-1)),mixer:r});var h,d;return{calculatedDuration:t,next:e=>(a.value=c(e),a.done=e>=t,a)}}function fe(t,e,n=0){return e<=0?n:t.velocity?t.velocity(e):function(t,e,n){const i=Math.max(e-5,0);return x(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}function ge(t,{repeat:e,repeatType:n="loop"},i,s=1){let r,o,a=0;for(let e=0;e<t.length;e++){const n=t[e];null!==n&&(a++||(r=n),o=n)}const u=s<0||e&&"loop"!==n&&e%2==1?0:a-1;return u&&void 0!==i?i:u?o:r}const ye={decay:he,inertia:he,tween:me,keyframes:me,spring:ce};function ve(t){"string"==typeof t.type&&(t.type=ye[t.type])}const be=(t,e)=>e-t>40&&!g.useManualTiming?e:t;function we(t,e){return{kind:t,animation:e,timestamp:H.now(),frameTimestamp:X.timestamp,frameIsProcessing:X.isProcessing}}function Se(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...we("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Te{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(t=>{this._resolve=t})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(t,e){return this.finished.then(t,e)}}const Ae=t=>t/100,Me=t=>Math.round(1e4*t)/1e4;class xe extends Te{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,e=H.now();t&&t.updatedAt!==e&&this.tick(t.updatedAt=e),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Se(this,this.options)}initAnimation(){const{options:t}=this;ve(t);const{type:e=me,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:r=0}=t;let{keyframes:o}=t;const a=e||me;this.mixKeyframes=void 0,a!==me&&"number"!=typeof o[0]&&(this.mixKeyframes=w(Ae,t.mixer?.(o[0],o[1])||$t(o[0],o[1])),o=[0,100]);const u=a(o===t.keyframes?t:{...t,keyframes:o});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Qt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){this.currentTime=this.holdTime??Math.round(t-this.startTime)*this.playbackSpeed}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:r=0,keyframes:o,type:a,onUpdate:u,finalKeyframe:l}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=be(this.startTime,t)),this.pendingStartTime=void 0,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 c=this.currentTime-r*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?c<0:c>i;this.currentTime=Math.max(c,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);const d=this.generate(this.currentTime,h);let{done:p}=d;h||(p=this.playbackSpeed>=0?s<1/0?this.currentTime>=i:p:this.currentTime<=0);const m=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return m&&a!==he&&(d.value=ge(o,this.options,l,this.speed)),u&&u(d.value),m&&this.finish(),d}at(t){return this.holdTime??Me((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:n,totalDuration:i}=this,s=this.at(t)-(n.delay||0);return s>=i&&n.type!==he?ge(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,e){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o}=this,{keyframes:a,repeat:u,repeatType:l,repeatDelay:c}=this.options;let h,d=t,p=n;if(u){const e=Math.min(t,i)/o;let n=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&n--,n=Math.min(n,u+1);Boolean(n%2)&&("reverse"===l?(s=1-s,c&&(s-=c/o)):"mirror"===l&&(p=r)),d=f(0,1,s)*o}return e?(this.delayState.value=a[0],h=this.delayState):h=p.next(d),s&&!e&&(h.value=s(h.value)),h}get duration(){return M(this.calculatedDuration)}get iterationDuration(){return this.duration+M(this.options.delay??0)}get time(){return M(this.currentTime)}set time(t){"finished"===this.state&&this.updateFinished(),t=A(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(){return fe(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(H.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=M(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Jt,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.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=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(H.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.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}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 ke=new Set(["brightness","contrast","saturate","opacity"]);function Ve(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(st)||[];if(!i)return t;const s=n.replace(i,"");let r=ke.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+s+")"}const Ce=/\b([a-z-]*)\(.*?\)/gu,Ee={...Pt,getAnimatableNone:t=>{const e=t.match(Ce);return e?e.map(Ve).join(" "):t}},Pe={...Pt,getAnimatableNone:t=>{const e=Pt.parse(t);return Pt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Fe={...et,transform:Math.round},De={rotate:pt,pathRotation:pt,rotateX:pt,rotateY:pt,rotateZ:pt,scale:it,scaleX:it,scaleY:it,scaleZ:it,skew:pt,skewX:pt,skewY:pt,distance:ft,translateX:ft,translateY:ft,translateZ:ft,x:ft,y:ft,z:ft,perspective:ft,transformPerspective:ft,opacity:nt,originX:vt,originY:vt,originZ:ft},Oe={borderWidth:ft,borderTopWidth:ft,borderRightWidth:ft,borderBottomWidth:ft,borderLeftWidth:ft,borderRadius:ft,borderTopLeftRadius:ft,borderTopRightRadius:ft,borderBottomRightRadius:ft,borderBottomLeftRadius:ft,width:ft,maxWidth:ft,height:ft,maxHeight:ft,top:ft,right:ft,bottom:ft,left:ft,inset:ft,insetBlock:ft,insetBlockStart:ft,insetBlockEnd:ft,insetInline:ft,insetInlineStart:ft,insetInlineEnd:ft,padding:ft,paddingTop:ft,paddingRight:ft,paddingBottom:ft,paddingLeft:ft,paddingBlock:ft,paddingBlockStart:ft,paddingBlockEnd:ft,paddingInline:ft,paddingInlineStart:ft,paddingInlineEnd:ft,margin:ft,marginTop:ft,marginRight:ft,marginBottom:ft,marginLeft:ft,marginBlock:ft,marginBlockStart:ft,marginBlockEnd:ft,marginInline:ft,marginInlineStart:ft,marginInlineEnd:ft,fontSize:ft,backgroundPositionX:ft,backgroundPositionY:ft,...De,zIndex:Fe,fillOpacity:nt,strokeOpacity:nt,numOctaves:Fe},Re={...Oe,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:Ee,WebkitFilter:Ee,mask:Pe,WebkitMask:Pe},Ie=t=>Re[t],Le=new Set([Ee,Pe]);let Be,je,Ne;function We(t,e){if(t===Be&&e===je)return Ne;let n=Ie(t);return Le.has(n)||(n=Pt),Ne=n.getAnimatableNone?n.getAnimatableNone(e):void 0,Be=t,je=e,Ne}const Ke=t=>180*t/Math.PI,Ue=t=>{const e=Ke(Math.atan2(t[1],t[0]));return Xe(e)},Ye={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Ue,rotateZ:Ue,skewX:t=>Ke(Math.atan(t[1])),skewY:t=>Ke(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Xe=t=>((t%=360)<0&&(t+=360),t),$e=t=>Math.hypot(t[0],t[1]),_e=t=>Math.hypot(t[4],t[5]),He={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:$e,scaleY:_e,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>($e(t)+_e(t))/2,rotateX:t=>Xe(Ke(Math.atan2(t[6],t[5]))),rotateY:t=>Xe(Ke(Math.atan2(-t[2],t[0]))),rotateZ:Ue,rotate:Ue,skewX:t=>Ke(Math.atan(t[4])),skewY:t=>Ke(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 qe(t,e){if(!t||"none"===t)return ze(e);const n=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return ze(e);const i=(n[1]?He:Ye)[e],s=n[2].split(",").map(t=>parseFloat(t));return"function"==typeof i?i(s):s[i]}const Je=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ze=(()=>new Set([...Je,"pathRotation"]))(),Ge=t=>t===et||t===ft,Qe=new Set(["x","y","z"]),tn=Je.filter(t=>!Qe.has(t));const en=new Set(["bottom","right"]);function nn(t,e,n,i,s,r){const o=parseFloat(t);if(!isNaN(o))return o;const{min:a,max:u}=e()[n],l=u-a;return"border-box"===r?l:l-parseFloat(i)-parseFloat(s)}const sn=({transform:t})=>qe(t,"x"),rn=({transform:t})=>qe(t,"y"),on={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>nn(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>nn(t,s,"y",e,n,i),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:n}=e();return parseFloat(t)+(n.max-n.min)},right:({left:t},e)=>{const{x:n}=e();return parseFloat(t)+(n.max-n.min)},x:sn,y:rn,translateX:sn,translateY:rn},an=new Set;let un=!1,ln=!1,cn=!1;function hn(){if(ln){const t=[],e=new Set,n=new Set;an.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),en.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return tn.forEach(n=>{const i=t.getValue(n);if(void 0!==i){const t=i.get(),s=n.startsWith("scale")?1:0;if(t===s)return;e.push([n,t]),i.set(s)}}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=i.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,un=!1,an.forEach(t=>t.complete(cn)),an.clear()}function dn(){an.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ln=!0)})}class pn{constructor(t,e,n,i,s,r=!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=r}scheduleResolve(){this.state="scheduled",this.isAsync?(an.add(this),un||(un=!0,zt.read(dn),zt.resolveKeyframes(hn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=function(t,e,n){if("string"==typeof t){if(y(t)||v(t))return parseFloat(t);if(!Pt.test(t)&&Pt.test(n))return We(e,n)}return t??void 0}(n.readValue(e,r),e,r);void 0!==i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),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),an.delete(this)}cancel(){"scheduled"===this.state&&(an.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function mn(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const fn={};function gn(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>fn[e]??n()}const yn=gn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),vn=gn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),bn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,wn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bn([0,.65,.55,1]),circOut:bn([.55,0,1,.45]),backIn:bn([.31,.01,.66,-.59]),backOut:bn([.33,1.53,.69,.99])};function Sn(t,e){return t?"function"==typeof t?vn()?Zt(t,e):"ease-out":K(t)?bn(t):Array.isArray(t)?t.map(t=>Sn(t,e)||wn.easeOut):wn[t]:void 0}function Tn(t,e,n,{delay:i=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const c={[e]:n};u&&(c.offset=u);const h=Sn(a,s);Array.isArray(h)&&(c.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};return l&&(d.pseudoElement=l),t.animate(c,d)}function An(t){return"function"==typeof t&&"applyToOptions"in t}class Mn extends Te{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:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=r,this.options=t;const u=function({type:t,...e}){return An(t)&&vn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Tn(e,n,i,u,s),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!s){const t=ge(i,this.options,o,this.speed);this.updateMotionValue?.(t),mn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Se(this,t,u)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch(t){}}stop(){this.isStopped||(this.isStopped=!0,"idle"!==this.state&&null===this.finishedTime&&(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 M(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+M(t)}get time(){return M(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=A(t),e&&(this.animation.pause(),this.updateFinished())}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,onAttach:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=this.onFinish=null,t&&yn()?(this.animation.timeline=t,e?.(this.animation),b):n(this)}}const xn={anticipate:O,backInOut:D,circInOut:L};function kn(t){"string"==typeof t.ease&&t.ease in xn&&(t.ease=xn[t.ease])}class Vn extends Mn{constructor(t){kn(t),ve(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(H.now()-this.startTime)*this.speed:1e3*this.time}sample(t){if(!this.sampler){const{motionValue:t,onUpdate:e,onComplete:n,onPlay:i,onStop:s,element:r,...o}=this.options;this.sampler=new xe({...o,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if("running"===t||"paused"===t)return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:e,element:n,name:i}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const{speed:s}=this,r=this.elapsed(),o="running"===this.state&&s?f(0,10,r):0,a=this.sample(r);n&&i&&mn(n,i,a),e.setWithVelocity(this.sample(r-o*Math.sign(s)),a,o/Math.abs(s||1))}}const Cn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Pt.test(t)&&"0"!==t||t.startsWith("url(")));function En(t){t.duration=0,t.type="keyframes"}const Pn=new Set(["opacity","clipPath","filter","transform"]),Fn=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const Dn=({mixer:t,keyframes:e})=>t&&"number"!=typeof e[0]&&e.some((n,i)=>i&&t(e[i-1],n)),On=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Rn=()=>!g.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function In(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:r,type:o,keyframes:a}=t;if(!n||!Pn.has(n)&&!On.has(n))return!1;const u=e?.owner?.current;if(!(u instanceof HTMLElement||u instanceof SVGElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Rn()&&(Pn.has(n)||On.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&Fn.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!c)&&!l&&!i&&"mirror"!==s&&0!==r&&"inertia"!==o&&!Dn(t)}const Ln=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Bn={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jn=Je.length,Nn={},Wn=(t,e,n=Ln(e,De[t]))=>(Nn[t]||(Nn[t]=(Bn[t]||t)+"("))+n+")",Kn=(t,e)=>("number"==typeof e?e:parseFloat(e))===(t.startsWith("scale")?1:0);const Un=new WeakMap,Yn=.001,Xn=100,$n=new Set(["linear","easeIn","easeOut","easeInOut"]),_n=new WeakMap,Hn=(t,e)=>Math.min(200,Math.max(2,Math.ceil((e-t)/10))),zn=(t,e)=>Math.abs(t-e)<=.001,qn=(t,e)=>t-e,Jn=(t,e,n)=>pe(Array(n+1)).map(n=>Ot(t,e,n)),Zn=t=>t.motionValue.owner,Gn=t=>Un.get(t),Qn=({state:t})=>"idle"===t||"finished"===t,ti=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class ei{constructor(t,e,n,i){this.element=t,this.update=e,this.makeDriver=n,this.animation=i}get js(){return this.driver||(this.driver=this.makeDriver(this.update))}now(){return this.driver||this.makeDriver!==Jt?this.js.now():X.isProcessing?X.timestamp:H.now()}start(t=!0){const e=Gn(this.element);!e||e.isJS?this.js.start(t):e.schedule(!1,!t)}stopJS(){this.driver?.stop()}stop(){this.stopJS();const t=Gn(this.element);t&&!t.isFinishing&&t.release(this.animation)}}let ni,ii;class si extends xe{constructor(t){const e=Zn(t).current,{driver:n=Jt}=t;let i;const s=function(t){const e=Zn(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(ti(e,"transform")||"none")||ti(e,"pathRotation")||e.projection?.isProjecting()||Dn(t))}(t);t.driver=t=>new ei(e,t,n,i),super(t),i=this;const r=this.driver;r&&(r.animation=this),this.canAccelerate=s;const{stop:o}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),o()}}offsets(){const{keyframes:t,times:e}=this.options;return e||(this.offsetsOf!==t&&(this.offsetsOf=t,this.cachedOffsets=pe(t)),this.cachedOffsets)}get group(){return Gn(Zn(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){const{startTime:t,speed:e,totalDuration:n}=this,{delay:i=0,repeatType:s}=this.options;return null!==this.holdTime?[1/0,0]:n===1/0?[t+i/e,this.resolvedDuration*("loop"===s?1:2)/e||1]:[t+(i+n)/e,0]}isAccelerated(){const{group:t,state:e}=this;return t?.tracks.has(this)&&!t.isJS&&this.canAccelerate&&("running"===e||"paused"===e)}liveValue(){return this.isAccelerated()?this.sampleAt(H.now()):void 0}tween(){const{keyframes:t,type:e,repeat:n,delay:i=0}=this.options;let s=-1;if(n||e!==me||null!==this.holdTime)return;for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(s>=0)return;s=e-1}let{ease:r}=this.options;W(r)&&(r=r[s]);const o=this.offsets(),a=t=>this.startTime+(i+o[t]*this.totalDuration)/this.speed;if(s>=0){const t=K(r)?bn(r):(t=>$n.has(t))(r)?wn[r]:Y(r);return[a(s),a(s+1),"string"==typeof t||zn(t(0),0)&&zn(t(1),1)?t:void 0]}}boundaries(t,e){const{startTime:n,speed:i,resolvedDuration:s,options:r}=this,{delay:o=0,repeat:a=0,repeatDelay:u=0,repeatType:l,type:c}=r,h=(c||me)===me?this.offsets():[0,1],d=n+o/i,p=[];if(null!==this.holdTime||!(s>0))return p;for(let n=Math.max(0,Math.floor((t-d)*i/s));n<=a;n++){const r=d+n*s/i;if(r>e)break;for(const o of h){const a=r+(n%2&&l&&"loop"!==l?1-o:o)*(s-u)/i;a>t&&a<e&&p.push(a)}}return p}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=H.now(),e=this.sampleAt(t,!0);this.options.motionValue.setWithVelocity(null===this.holdTime?this.sampleAt(t-10,!0):e,e,10)}play(){this.isStopped||((this.group||function(t){const e=t.current,n=new Set,i=new Map;let s,r,o={},a=[],u=new Map,l=[],c=!1,h=!1,d=!1,p=!1,m=-1/0,f=1/0;const g=t=>{for(const e of n)if(e.name===t)return!0},y=(e,n)=>{const s={};for(const r of void 0===e?Je:a){const a=i.get(r),u=void 0===e?ti(t,r):a?a.sampleAt(n>e&&!a.timing()[1]?n:e):o[r];void 0!==u&&(s[r]=u)}return s},v=(t,e)=>{let n="";for(const i in t){const s=t[i];e&&Kn(i,s)||(n+=Wn(i,s)+" ")}return(e?n.trim():n)||"none"},b=(t,e)=>v(y(t,e)),w=(t=y())=>{e.style.transform=v(t,!0)},T=t=>{t.onfinish=t.oncancel=null,t.cancel()},A=(t=!0)=>{clearTimeout(s),f=1/0,r=void 0,t&&w(),l.forEach(({animation:t})=>T(t)),l=[]},M=(t,n)=>new Animation(new KeyframeEffect(e,t,n)),x=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=H.now()+e,n<1/0&&(t.onfinish=()=>{i.isDone=!0,l.some(t=>t.end===1/0)&&(T(t),l=l.filter(t=>t!==i)),L.schedule(!1)}),t.oncancel=()=>l.includes(i)&&L.demote(),l.push(i)},k=(t,e,n)=>{const i=(e,n)=>Math.abs(t(n)-t(e)),s=i(e,n);for(;n-e>.01;){const t=(e+n)/2;i(e,t)>i(t,n)?n=t:e=t}return i(e,n)>s/2?[e,n]:[]},V=(t,e,n,i)=>{const s=Hn(e,n);if(4*i.length>s)return;let r;for(const i of t){const t=i.numberAt(e),s=(i.numberAt((e+n)/2)-t)/(i.numberAt(n)-t);if(s==s)if(void 0===r)r=s;else if(!zn(s,r))return}const o=Jn(e,n,s).concat(i).sort(qn),a=t=>S(e,n,t);let u,l;for(const n of t){const t=n.numberAt(e),i=o.map(e=>n.numberAt(e)-t),s=i[i.length-1],r=i.some(t=>Math.abs(t)*Yn>Math.abs(s))?0:s,a=i.map(t=>r?t/r:t);if(r&&!u)u=a,l=e=>(n.numberAt(e)-t)/r;else if(a.some((t,e)=>!zn(t,r&&u[e])))return}if(!u||u.every((t,e)=>zn(t,a(o[e]))))return"linear";const c=[],h=(t,e=l(t))=>c.push(Me(e)+" "+Me(100*a(t))+"%");return u.forEach((t,e)=>{e&&Math.abs(t-u[e-1])>.2&&k(l,o[e-1],o[e]).forEach(t=>h(t)),h(o[e],t)}),"linear("+c+")"},C=(t,e,n,i)=>{const s=[e],r=[];let o=n,a=e;for(const i of t){const t=i.tween();if("linear"!==t?.[2]){const[s,u]=i.timing(),[l,c]=t||[e,u?n:s];o=Math.min(o,l),a=Math.max(a,c),r.push(i)}}o=Math.max(e,o),a=Math.min(n,a);const u=(t,e)=>r.every(n=>!(Math.abs(n.numberAt((t+e)/2)-(n.numberAt(t)+n.numberAt(e))/2)>(n.name.startsWith("scale")?.001:.1))),l=(e,n,i)=>{if(n-e<1||u(e,n))s.push(n);else if(i<4)l(e,(e+n)/2,i+1),l((e+n)/2,n,i+1);else{for(const i of t)s.push(...k(t=>i.numberAt(t),e,n));s.push(n)}},c=a>o?Jn(o,a,Math.ceil((a-o)/100)):[];c.push(n);for(const t of i)c.push(t,Math.min(t+.01,n));let h=e;for(const t of c.sort(qn))t>h&&l(h,t,0),h=t;return s.sort(qn)},E=t=>{let e;for(const n of t){const t=n.tween();if(!t||e&&(Math.abs(t[0]-e[0])>1||Math.abs(t[1]-e[1])>1))return;e=[t[0],t[1],e&&t[2]!==e[2]?void 0:t[2]]}return e},P=(t,e,n,i,s={fill:"both"},r)=>{const o=i?[]:t.flatMap(t=>t.boundaries(e,n)),a=i||V(t,e,n,o),u=a?[e,n]:C(t,e,n,o),l=u.map(t=>b(t,r));let c={transform:l};return a||(c.offset=u.map(t=>S(e,n,t))),l.every(t=>t===l[0])&&(w(y(e,r)),c=null),M(c,{...s,duration:n-e,easing:a||"linear"})},F=t=>{const e=H.now()+t;e<f&&(clearTimeout(s),f=e,s=setTimeout(()=>{f=1/0,L.schedule(!1)},t))},D=e=>{let s=e,c=0,h=0;const d=[],p=[],m=new Set;i.clear(),u=new Map;for(const t of n){i.set(t.name,t);const[n,r]=t.timing(),o=n===1/0;if(u.set(t,[t.at(e),t.speed,o]),!o){if(t.speed<0)return;if(r){if(c){const t=(n-h)/r;if(Math.abs(r-c)>1||Math.abs(t-Math.round(t))*c>1)return}else c=r,h=n;p.push(t)}else m.add(n);d.push(t),s=Math.max(s,n)}}o={},a=Je.filter(e=>{if(i.has(e))return!0;const n=o[e]=ti(t,e);return void 0!==n&&!Kn(e,n)}),A(!1);const f=!c&&E(d);try{if(s>e){let t;if(f&&f[1]>e){const[n,i,o]=f;if(n-e>Xn)return d.forEach(t=>t.sync()),F(r=n-e-Xn),!0;t="string"==typeof o?o:o?((t,e)=>{let n=_n.get(t);return n?.[0]!==e&&(n=[e,"linear("+pe(Array(e+1)).map(e=>Me(t(e))+" "+Me(100*e)+"%")+")"],_n.set(t,n)),n[1]})(o,Hn(n,i)):V(d,n,i,[]),t&&x(P(d,n,i,t,{fill:"both",endDelay:s-i}),n-e,s-n)}t||x(P(d,e,s),0,s-e),m.forEach(t=>t<s-1&&x(M(null,{duration:t-e}),0,t-e))}if(c){const t=h+Math.floor((s-h)/c)*c;x(P(p,t,t+c,void 0,{iterations:1/0,iterationStart:(s-t)/c,fill:"forwards"},s),s-e)}}catch{return}return l.length||A(),!0},O=(t,e)=>{let i,s=0;for(const e of n){const n=u.get(e);if(!n)return!1;const[r,o,a]=n,c=e.at(t),h=e.timing()[0]===1/0;if(a){if(h&&(c===r||!l.length))continue;return!1}const d=(c-r)/o,p=h?0:e.speed/o;if(void 0===i)i=d,s=p;else if(Math.abs(d-i)>1||p!==s)return!1}if(void 0===i)return!0;if(!l.length){if(void 0===r||e&&s)return!1;if(s){const t=(r-i)/s;if(t<1)return!1;F(t)}return!0}for(const{offset:t,end:n,isDone:s}of l){const r=i-t;if(n<1/0&&(s?r<n-1:r<0&&(e||t<=0)||r>=n))return!1}for(const{animation:e,offset:n,isDone:r}of l){if(r)continue;const o=i-n;s&&e.updatePlaybackRate&&"running"===e.playState&&Math.abs(Number(e.currentTime)-o)<20?e.playbackRate!==s&&e.updatePlaybackRate(s):s?(e.playbackRate!==s&&(e.playbackRate=s),e.startTime=t-o/s):(e.startTime=null,e.currentTime=o)}return!0},R=()=>!n.size&&(d=!0,Gn(e)===L&&Un.delete(e),L.isJS||A(),!0),I=()=>{const e=H.now();if(L.isJS||(L.isFinishing=!0,n.forEach(n=>{const[i,s]=n.timing();"running"===n.state&&n.speed>0&&!s&&i<=e+1&&(n.complete(),o[n.name]=ti(t,n.name),u.has(n)||(c=!0))}),L.isFinishing=!1),h=!1,d)return;if(n.forEach(t=>Qn(t)&&n.delete(t)),R())return;for(const t of n)if(!t.canAccelerate)return L.demote(!0);L.isJS&&(L.isJS=!1,c=!0,n.forEach(t=>t.stopJS()));const i=c,s=p;if(c=p=!1,i||!O(e,s)){if(s){if(e-m<100)return L.demote();m=e}if(!D(e))return L.demote()}else if(void 0!==r&&!s)return;n.forEach(t=>t.timing()[0]===1/0&&t.sync())},L={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){d||(c||(c=t),p||(p=!!e),h||(h=!0,X.isProcessing?zt.render(I,!1,!0):ri(I)))},release(t){Qn(t)&&n.delete(t),R()||L.schedule(!0)},check(){if(!L.isJS)for(const e in o)if(ti(t,e)!==o[e]&&!g(e))return L.schedule(!0,!0)},demote(t){if(!L.isJS&&!d)return n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),L.isJS=!0,u=new Map,A(),n.forEach(t=>"running"===t.state&&t.js?.start()),!0}};return Un.set(e,L),L}(Zn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&this.group.schedule(!1)}complete(){super.complete();const{group:t}=this;t&&!t.isJS&&this.tick(H.now())}get time(){return this.isAccelerated()?M(f(0,this.totalDuration,this.at(H.now())-(this.options.delay||0))):super.time}set time(t){(ni??(ni=Object.getOwnPropertyDescriptor(xe.prototype,"time").set)).call(this,t)}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}const ri=t=>{ii||queueMicrotask(()=>{const t=ii;ii=void 0,t.forEach(t=>t())}),(ii||(ii=[])).push(t)};class oi extends Te{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=H.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,r=t;r.autoplay??(r.autoplay=!0),r.delay??(r.delay=0),r.type??(r.type="keyframes"),r.repeat??(r.repeat=0),r.repeatDelay??(r.repeatDelay=0),r.repeatType??(r.repeatType="loop");const o=s?.KeyframeResolver||pn;this.keyframeResolver=new o(e,(t,e,n)=>this.onKeyframesResolved(t,e,r,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:r,velocity:o,delay:a,isHandoff:u,onUpdate:l}=n;this.resolvedAt=H.now();const c=function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=Cn(s,e),a=Cn(r,e);return!(!o||!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||An(n))&&i)}(t,s,r,o);c||(!g.instantAnimations&&a||l?.(ge(t,n,e)),t[0]=t[t.length-1],En(n),n.repeat=0);const{onComplete:h}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{h?.(),this.notifyFinished()};const d=c&&!u&&In(n),p=!d&&(({name:t,motionValue:e})=>t&&Je.includes(t)&&e?.owner?.current instanceof HTMLElement&&Rn()&&vn())(n);let m;if(i&&(d||p||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=be(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{m=new Vn(n)}catch{m=new xe(n)}}else m=p?new si(n):new xe(n);this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),cn=!0,dn(),hn(),cn=!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?.cancel(),this.keyframeResolver?.cancel()}}function ai(t,e,n,i=0,s=1){const r=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),o=t.size,a=(o-1)*i;return"function"==typeof n?n(r,o):1===s?r*i:a-r*i}class ui{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=H.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.dirty(),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=H.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){var n;return"change"===t?this.onChangeSubscribe(e):((n=this.events)[t]||(n[t]=new T)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new T,e.change.add(this.changeSubscriber),this.changeSubscriber=void 0),e.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:e.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){zt.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;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){e&&(this.updatedAt=H.now(),this.stop()),this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){(this.dependents||(this.dependents=new Set)).add(t)}removeDependent(t){this.dependents?.delete(t)}get(){const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=H.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return x(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return new Promise(e=>this.run(t,e))}run(t,e){this.stop(),this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&(this.animation=void 0),e?.()}),i||(this.animation=n),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}}function li(t,e){return new ui(t,e)}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={type:"spring",stiffness:500,damping:25,restSpeed:10},pi={type:"keyframes",duration:.8},mi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fi=(t,{keyframes:e})=>e.length>2?pi:Ze.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:di:mi,gi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out","mixer"]);const yi=(t,e,n,i={},s,r)=>o=>{const a=hi(i,t)||{},u=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=A(u);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:s,hasOnUpdate:!!a.onUpdate};(function(t){for(const e in t)if(!gi.has(e))return!0;return!1})(a)||Object.assign(c,fi(t,c)),c.duration&&(c.duration=A(c.duration)),c.repeatDelay&&(c.repeatDelay=A(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(En(c),0===c.delay&&(h=!0)),(g.instantAnimations||g.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,En(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=ge(c.keyframes,a);if(void 0!==t)return void zt.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new xe(c):new oi(c)},vi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bi(t,e,n=1){const[i,s]=function(t){const e=vi.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return y(t)?parseFloat(t):t}return G(s)?bi(s,e,n+1):s}function wi(t,e,n,i){const s=e=>"function"==typeof e?e(void 0!==n?n:t.custom,...function(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}(i)):e;return"string"==typeof(e=s(e))&&(e=t.variants&&t.variants[e]),s(e)}function Si(t,e,n){return wi(t.getProps(),e,n,t)}const Ti=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,Ai=new Set(["width","height","top","left","right","bottom",...Je]);function Mi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,li(n))}function xi(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}const ki=t=>Boolean(t&&t.getVelocity);function Vi(t,e){const n=t.getValue("willChange");if(i=n,Boolean(ki(i)&&i.add))return n.add(e);if(!n&&g.WillChange){const n=new g.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}const Ci="data-framer-appear-id";function Ei(t){return t.props[Ci]}const Pi="undefined"!=typeof window;function Fi({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function Di(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:r,transitionEnd:o,...a}=e;const u=t.getDefaultTransition();r=r?ci(r,u):u;const l=r?.reduceMotion,c=r?.skipAnimations;i&&(r=i);const h=[],d=s&&t.animationState?.getState()[s],p=r?.path;p&&(p.animateValues?p.animateValues(e=>t.getValue(e,t.latestValues[e]??0),a,r,n,h):p.animateVisualElement?.(t,a,r,n,h));for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&Fi(d,e))continue;const o={delay:n,...hi(d?.out[e]||r||{},e)};c&&(o.skipAnimations=!0);const u=i.get();if(void 0!==u&&!i.isAnimating()&&!Array.isArray(s)&&s===u&&!o.velocity){zt.update(()=>i.set(s));continue}let p=!1;if(Pi&&window.MotionHandoffAnimation){const n=Ei(t);if(n){const t=window.MotionHandoffAnimation(n,e,zt);null!==t&&(o.startTime=t,p=!0)}}Vi(t,e);const m=l??t.shouldReduceMotion;i.run(yi(e,i,s,m&&Ai.has(e)?{type:!1}:o,t,p));const f=i.animation;f&&h.push(f)}if(o){const e=()=>zt.update(()=>{o&&function(t,e){const n=Si(t,e);let{transitionEnd:i={},transition:s={},...r}=n||{};r={...r,...i};for(const e in r)Mi(t,e,xi(r[e]))}(t,o)});h.length?Promise.all(h).then(e):e()}return h}function Oi(t,e,n={}){const i=Si(t,e,Ti(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),r=()=>Promise.all(i?Di(t,i,n):[]),o=(i=0)=>{const{variantChildren:r}=t,{delayChildren:o=0,staggerChildren:a,staggerDirection:u}=s,l=[];return r?.forEach(t=>{t.notify("AnimationStart",e),l.push(Oi(t,e,{...n,delay:i+("function"==typeof o?0:o)+ai(r,t,o,a,u)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(l)},{when:a}=s;return a?"beforeChildren"===a?r().then(()=>o()):o().then(r):Promise.all([r(),o(n.delay)])}const Ri=[et,ft,mt,pt,yt,gt,{test:t=>"auto"===t,parse:t=>t}],Ii=t=>Ri.find((t=>e=>e.test(t))(t));function Li(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||v(t))}const Bi=new Set(["auto","none","0"]);class ji extends pn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)return!1;for(let e=0;e<t.length;e++)if(tt(e?t[e]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e?.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),G(i))){const s=bi(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Ai.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const r=Ii(i),o=Ii(s);if(tt(i)!==tt(s)&&on[n])this.needsMeasurement=!0;else if(r!==o)if(Ge(r)&&Ge(o))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&&!Bi.has(e)&&kt(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=We(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return on[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t?.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.resolveNoneKeyframes()}}const Ni={};const Wi=t=>Ni.current?Ni.current.bind(t):t;function Ki(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function Ui(t,e,n){const{style:i,vars:s,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(Ze.has(t))o=!0;else if(J(t))s[t]=n;else{const e=Ln(n,Oe[t]);t.startsWith("origin")?(a=!0,r[t]=e):i[t]=e}}if(e.transform||(o||n?i.transform=function(t,e,n){let i="";for(let s=0;s<jn;s++){const r=Je[s],o=t[r];if(void 0===o)continue;const a=n&&(e[r]=Ln(o,Oe[r]));Kn(r,o)||(i+=Wn(r,o,a||void 0)+" ")}const s=t.pathRotation;return s&&(i+=Wn("rotate",s)),i=i.trim(),n?n(e,i):i||"none"}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;i.transformOrigin=`${t} ${e} ${n}`}}const Yi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Xi={offset:"strokeDashoffset",array:"strokeDasharray"};const $i=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _i(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...a},u,l,c){if(Ui(t,a,l),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of $i)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const r=s?Yi:Xi;t[r.offset]=""+-i,t[r.array]=`${e} ${n}`}(h,s,r,o,!1)}const{schedule:Hi}=Ht(queueMicrotask,!1),zi={};function qi(t){return ki(t)?t.get():t}const Ji=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Zi(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Gi=new WeakMap;function Qi(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function ts(t){return"string"==typeof t||Array.isArray(t)}const es=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","whilePinch","exit"],ns=["initial"].concat(es);function is(t){if(Qi(t.animate))return!0;for(let e=0;e<ns.length;e++)if(ts(t[ns[e]]))return!0;return!1}function ss(t){return Boolean(is(t)||t.variants)}const rs={current:null},os={current:!1},as="undefined"!=typeof window;const us=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ls={};function cs(t){ls=t}class hs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:o},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=pn,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=H.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,zt.render(this.render,!1,!0))};const{latestValues:u,renderState:l}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=e.initial?{...u}:{},this.renderState=l,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(r),this.isControllingVariants=is(e),this.isVariantNode=ss(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==u[t]&&ki(e)&&e.set(u[t])}}mount(t){const e=this.presenceContext;if(this.hasBeenMounted&&!1!==e?.isPresent&&!e?.keepValuesOnRemount)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];if(this.current=t,Gi.set(t,this),this.projection?.instance||this.projection?.mount(t),this.isVariantNode&&!this.isControllingVariants){let t=this;do{t=!1!==t.props.inherit&&t.parent}while(t&&!t.isVariantNode);if(t){const{variantChildren:e}=t;e.add(this),this.removeFromVariantTree=()=>e.delete(this)}}this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(os.current||function(){if(os.current=!0,as)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>rs.current=t.matches;t.addEventListener("change",e),e()}else rs.current=!1}(),this.shouldReduceMotion=rs.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),qt(this.notifyUpdate),qt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),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)).add(t)}removeChild(t){this.children.delete(t),this.enteringChildren?.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.get(t)?.(),e.accelerate&&Pn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:r,duration:o}=e.accelerate,a=new Mn({element:this.current,name:t,keyframes:i,times:s,ease:r,duration:A(o)}),u=n(a);return void this.valueSubscriptions.set(t,()=>{u(),a.cancel()})}const n=Ze.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&zt.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),Un.get(this.current)?.check()),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s?.()})}sortNodePosition(t){return this.current&&t.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in ls){const e=ls[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){const{transformTemplate:n,onUpdate:i}=this.props;(t.transformTemplate||n)&&this.scheduleRender(),(t.transformTemplate&&!n||t.onUpdate&&!i)&&Un.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<us.length;e++){const n=us[e];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],r=n[i];if(ki(s))t.addValue(i,s);else if(ki(r))t.addValue(i,li(s,{owner:t}));else if(r!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,li(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(t){return this.props.variants?.[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,e){const n=this.values.get(t);if(e!==n){n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e);const i=e.get();void 0!==i&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t),this.valueSubscriptions.get(t)?.(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){let n=this.props.values?.[t];return n||(n=this.values.get(t),void 0===n&&void 0!==e&&(n=li(e??this.getDefaultValue?.(t),{owner:this}),this.addValue(t,n)),n)}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=n&&("string"==typeof n&&(y(n)||v(n))?n=parseFloat(n):"number"!=typeof n&&!Pt.test(n)&&Pt.test(e)&&(n=We(t,e)),this.setBaseTarget(t,ki(n)?n.get():n)),ki(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,e){return(this.events[t]||(this.events[t]=new T)).add(e)}notify(t,...e){this.events[t]?.notify(...e)}scheduleRenderMicrotask(){Hi.render(this.render)}}class ds extends hs{constructor(){super(...arguments),this.KeyframeResolver=ji}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){const n=t.style;return n?n[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ki(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function ps(t,{style:e,vars:n},i,s){const r=t.style;let o;for(o in e)r[o]=e[o];for(o in s?.applyProjectionStyles(r,i),n)r.setProperty(o,n[o])}function ms(t,{layout:e,layoutId:n}){return Ze.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!zi[t]||"opacity"===t)}function fs(t,e,n){const i=t.style,s=e?.style,r={};if(!i)return r;for(const e in i)(ki(i[e])||s&&ki(s[e])||ms(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(r[e]=i[e]);return r}class gs extends ds{constructor(){super(...arguments),this.type="html",this.renderInstance=ps}mount(t){super.mount(t)}readValueFromInstance(t,e){if(Ze.has(e))return this.projection?.isProjecting?ze(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return qe(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(J(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){Ui(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return fs(t,e,n)}}const ys=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;const vs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const bs=!1;function ws(){return bs}function Ss(t,e){const n=function(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const i=e?e.current:Ni.current?.root||document,s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}(t),i=new AbortController;var s;return[n,{passive:!0,...e,signal:i.signal},(s=()=>i.abort(),Ni.current?.add(s),s)]}function Ts(t,e,n={}){e=Wi(e);const[i,s,r]=Ss(t,n);return i.forEach(t=>{let n,i=!1,r=!1;const o=e=>{n&&(n(e),n=void 0),t.removeEventListener("pointerleave",u)},a=t=>{i=!1,window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),r&&(r=!1,o(t))},u=t=>{"touch"!==t.pointerType&&(i?r=!0:o(t))};t.addEventListener("pointerenter",i=>{if("touch"===i.pointerType||ws())return;r=!1;const o=e(t,i);"function"==typeof o&&(n=o,t.addEventListener("pointerleave",u,s))},s),t.addEventListener("pointerdown",()=>{i=!0,window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",a,s)},s)}),r}const As=(t,e)=>!!e&&(t===e||As(t,e.parentElement)),Ms=new WeakSet;function xs(t){return e=>{"Enter"===e.key&&t(e)}}function ks(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Vs=new WeakSet,Cs=(t,e,n)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)>n,Es=t=>t.preventDefault();function Ps(t,e,n={}){e=Wi(e);const[i,s,r]=Ss(t,n),o=new WeakMap,a=t=>{const i=t.currentTarget;if(!ys(t))return;if(Vs.has(t))return;n.stopPropagation&&Vs.add(t);const{count:r=1,countTimeout:a=.3,hold:u=0,repeat:l}=n,c=H.now(),h=A(u),d=A(a);let p=o.get(i);p?.expire(Cs(p.event,t,100))?p=void 0:p&&(qt(p.expire),o.delete(i));const m=p?p.count+1:1,f=m>=r,g=f&&(u||l);let y,v=!u,b=0;if(Ms.add(i),p)y=p.handlers;else{const n=e(i,t);y="function"==typeof n?{onComplete:n}:n||{}}f&&v&&y.onActive?.();const w=A(l);let S=h||w,T=c+S,M=!0;const x=()=>{if(s.signal.aborted)return qt(x);let t=Math.min(1-(T-H.now())/S,1);M&&t<1&&(t=0),M=!1,y.onHold?.(t),t<1||(v?y.onRepeat?.(++b):(v=!0,y.onActive?.()),l?(M=!0,T+=S=w):qt(x))},k={...s,capture:!0},V=(e,n)=>{if(ys(e))if(window.removeEventListener("pointerup",C,k),window.removeEventListener("pointercancel",E,k),window.removeEventListener("pointermove",P,k),i.removeEventListener("contextmenu",Es),qt(x),Ms.delete(i),n&&!f){const n=H.now(),r=t=>{const a=s.signal.aborted;if(a||!0===t||H.now()-n>d)return qt(r),o.delete(i),a||y.onComplete?.(e,{success:!1}),!0};o.set(i,{count:m,event:t,handlers:y,expire:r}),zt.update(r,!0)}else y.onComplete?.(e,{success:n&&v})},C=t=>{V(t,i===window||i===document||n.useGlobalTarget||As(i,t.target))},E=t=>{V(t,!1)},P=e=>{ys(e)&&((l||!v)&&Cs(t,e,8)||r>1&&ws())&&E(e)};window.addEventListener("pointerup",C,k),window.addEventListener("pointercancel",E,k),(g||r>1)&&window.addEventListener("pointermove",P,k),g&&(zt.update(x,!0),i.addEventListener("contextmenu",Es,{...s,passive:!1}))};return i.forEach(t=>{var e,i;(n.useGlobalTarget?window:t).addEventListener("pointerdown",a,s),"object"==typeof(i=e=t)&&null!==i&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",()=>((t,e)=>{let n=!1;const i=xs(()=>{n||Ms.has(t)||(n=!0,ks(t,"down"))}),s=xs(()=>{n&&(n=!1,ks(t,"up"))});t.addEventListener("keydown",i,e),t.addEventListener("keyup",s,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",i),t.removeEventListener("keyup",s),n&&ks(t,"cancel")},{...e,once:!0})})(t,s),s),function(t){return vs.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}class Fs{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Ds=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Os=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Rs(t,e,n){const i=fs(t,e,n);for(const n in t)if("children"!==n&&(ki(t[n])||ki(e[n]))){i[-1!==Je.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class Is extends ds{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ji}getBaseTargetFromProps(t,e){return Ze.has(e)?super.getBaseTargetFromProps(t,e)??ze(e):t[e]}getDefaultValue(t){return Ze.has(t)?this.latestValues[t]??ze(t):void 0}readValueFromInstance(t,e){if(Ze.has(e)){const t=Ie(e);return t&&t.default||0}if($i.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=Ds.has(e)?e:Ki(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Rs(t,e,n)}build(t,e,n){_i(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){ps(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ds.has(n)?n:Ki(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Os(t.tagName),super.mount(t)}}function Ls(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const Bs=[...es].reverse(),js=t=>!0===t?.out?t:t?.out;function Ns(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){return t.notify("AnimationStart",e),(Array.isArray(e)?Promise.all(e.map(e=>Oi(t,e,n))):"string"==typeof e?Oi(t,e,n):Promise.all(Di(t,Si(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}(t,e,n))),n=Ws(),i=!0,s=!1;function r(r){const{props:o,parent:a,manuallyAnimateOnMount:u}=t,{initial:l}=o,c=i||s,h=[],d=(e=l)=>"boolean"!=typeof e&&Si(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom)||void 0,p=new Map;let m={},f=1/0,g=t;do{g=!1!==g.props.inherit&&g.parent}while(g&&!g.isControllingVariants);const y=c&&js(d(l??(g&&g.props.initial))?.transition);if(Bs.forEach((e,i)=>{const s=n[e],l=o[e],d=g&&g.props[e],v=void 0!==l?l:ts(d)||!1===d?d:void 0,b=ts(v),w=e===r?s.isActive:null,S=b&&void 0===l&&!(c&&u);if(s.protectedKeys={...m},!s.isActive&&null===w||!v&&!s.prevProp||Qi(v)||"boolean"==typeof v)return;if(!1===w&&(f=i),"exit"===e&&s.isActive&&!0!==w)return void(m={...m,...s.prevResolvedValues});const T=function(t,e){if("string"==typeof e)return e!==t;if(Array.isArray(e))return!Ls(e,t);return!1}(s.prevProp,v);let A=T||b&&(w&&!S||i>f),M=!1;const x=Array.isArray(v)?v:[v];let k,V={};if(!1!==w)for(const n of x){const{transition:i,transitionEnd:s,...r}=Si(t,n,Ti(t,e))||{};V={...V,...r,...s},k=js(i)||k}const{prevResolvedValues:C}=s;for(const e in{...C,...V}){if(e in m)continue;const n=V[e],i=C[e],r=Array.isArray(n)&&Array.isArray(i)?!Ls(n,i)||T:n!==i;let o;if(r&&null==n)p.has(e)||p.set(e,s.prevOut);else if(r||void 0!==n&&p.has(e)){A=!0,o=p.get(e)||y,p.delete(e)&&(M=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0;s.out[e]=o}if(s.prevProp=v,s.prevResolvedValues=V,s.prevOut=k,s.isActive&&(m={...m,...V}),A&&(!S||!T||M))for(const n of x){const i={type:e};if("string"==typeof n&&c&&u&&a?.enteringChildren){const e=Si(a,n)?.transition?.delayChildren;i.delay=ai(a.enteringChildren,t,e)}h.push({animation:n,options:i})}}),p.size){const e={},n=d();let i=n?.transition;p.forEach((s,r)=>{s&&(i={...i||t.getDefaultTransition(),[r]:s});const a=t.getValue(r);a&&(a.liveStyle=!0);const u=n&&!Array.isArray(l)?n[r]:void 0,c=t.getBaseTargetFromProps(o,r);e[r]=(void 0!==u?u:void 0===c||ki(c)?void 0===t.initialValues[r]?t.baseTarget[r]:void 0:c)??null}),i&&(e.transition=i),h.push({animation:e})}const v=c&&t.blockInitialAnimation||i&&!u&&(!1===o.initial||o.initial===o.animate);return i=s=!1,!v&&h.length?e(h):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=Ws(),s=!0}}}function Ws(){const t={};for(const e of es)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return t}const Ks=n({}),Us=n({strict:!1}),Ys=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Xs=n({});function $s(t){const{initial:e,animate:n}=function(t,e){if(is(t)){const{initial:e,animate:n}=t;return{initial:!1===e||ts(e)?e:void 0,animate:ts(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(Xs));return s(()=>({initial:e,animate:n}),[_s(e),_s(n)])}function _s(t){return Array.isArray(t)?t.join(" "):t}const Hs=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zs(t,e,n){for(const i in e)ki(e[i])||ms(i,n)||(t[i]=e[i])}function qs(t,e){const n={};return zs(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ui(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Js(t,e){const n={},i=qs(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const Zs=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Gs(t,e,n,i){const r=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return _i(n,e,Os(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};return zs(e,t.style,t),{...r,style:{...e,...r.style}}}return r}const Qs=new Set(["animate","exit","variants","initial","style","values","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","tap","propagate","ignoreStrict","viewport","pinch"]);function tr(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Qs.has(t)}function er(t,e){return t.startsWith("on")?!tr(t):e?.(t)??!tr(t)}const nr=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ir(t){return"string"==typeof t&&!t.includes("-")&&!!(nr.indexOf(t)>-1||/[A-Z]/u.test(t))}function sr(t,e,n,{latestValues:i},a,u=!1,l,c){const h=(l??ir(t)?Gs:Js)(e,i,a,t),d=function(t,e,n,i){const s={};for(const r in t)"values"===r&&"object"==typeof t.values||ki(t[r])||("fx"!==r?(er(r,i)||!0===n&&tr(r)||!e&&!tr(r)||t.draggable&&r.startsWith("onDrag"))&&(s[r]=t[r]):t.fx&&(s.fx=""));return s}(e,"string"==typeof t,u,c),p=t!==r?{...d,...h,ref:n}:{},{children:m}=e,f=s(()=>ki(m)?m.get():m,[m]);return o(t,{...p,children:f})}const rr=n(null);function or(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}function ar(t,e,n,i){const s={},r=i(t,{});for(const t in r)s[t]=qi(r[t]);let{initial:o,animate:a}=t;const u=is(t),l=ss(t);e&&l&&!u&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===o;const h=c?a:o;if(h&&"boolean"!=typeof h&&!Qi(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=wi(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[c?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const ur=t=>(e,n)=>{const s=i(Xs),r=i(rr),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:ar(n,i,s,t),renderState:e()}}(t,e,s,r);return n?o():or(o)},lr=ur({scrapeMotionValuesFromProps:fs,createRenderState:Hs}),cr=ur({scrapeMotionValuesFromProps:Rs,createRenderState:Zs}),hr={animation:["variants",...es],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let dr=!1;function pr(){return function(){if(dr)return;const t={};for(const e in hr)t[e]={isEnabled:t=>hr[e].some(e=>!!t[e])};cs(t),dr=!0}(),ls}function mr(t){const e=pr();for(const n in t)e[n]={...e[n],...t[n]};cs(e)}const fr=Symbol.for("motionComponentSymbol");function gr(t,e,n){const i=a(n);u(()=>{i.current=n});const s=a(null);return l(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const r=i.current;if("function"==typeof r)if(n){const t=r(n);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):r(n);else r&&(r.current=n)},[e])}const yr=n({}),vr="undefined"!=typeof window?c:h;function br(n,{forwardMotionProps:s=!1,type:r}={},o,l){const c=r?"svg"===r:ir(n),p=c?cr:lr;function m(r,o){let d;const m=function({layoutId:t}){const e=i(Ks).id;return e&&void 0!==t?e+"-"+t:t}(r);or(()=>!1)&&(r={...r,initial:!1});const f={...i(Ys),...r,layoutId:m},{isStatic:g,isValidProp:y}=f,v=$s(r),b=p(r,g);if(!g&&"undefined"!=typeof window){i(Us).strict;const t=function(t){const e=pr(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:s.MeasureLayout,isEnabled:n?.isEnabled(t)||i?.isEnabled(t),ProjectionNode:s.ProjectionNode}}(f);v.visualElement=function(t,e,n,s,r,o){const{visualElement:l}=i(Xs),c=i(Us),d=i(rr),p=i(Ys),m=p.reducedMotion,f=p.skipAnimations,g=a(null),y=a(!1);s=s||c.renderer,!g.current&&s&&(g.current=s(t,{visualState:e,parent:l,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:f,isSVG:o}),y.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const v=g.current,b=i(yr);!v||v.projection||!r||"html"!==v.type&&"svg"!==v.type||r.create(v,n,b),u(()=>{v&&v.props!==n&&v.update(n,d)});const w=n[Ci],S=a(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return vr(()=>{y.current&&v&&(v.animationState?.animateChanges(),v.enteringChildren=void 0)},[]),vr(()=>{y.current=!0,v&&(window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),h(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),v.enteringChildren=void 0)}),v}(n,b,f,l,t.ProjectionNode,c),(t.isEnabled||v.visualElement?.projection?.options.layoutId)&&(d=t.MeasureLayout)}return t(Xs.Provider,{value:v,children:[d&&v.visualElement?e(d,{visualElement:v.visualElement,...f}):null,sr(n,r,gr(b,v.visualElement,o),b,g,s,c,y)]})}m.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const f=d(m);return f[fr]=n,f}function wr(t,e){return br(t,e)}const Sr=wr("div");function Tr({children:t,features:n,strict:i=!1}){const[,s]=p(!Ar(n)),r=a(void 0);if(!Ar(n)){const{renderer:t,...e}=n;r.current=t,mr(e)}return h(()=>{Ar(n)&&n().then(({renderer:t,...e})=>{mr(e),r.current=t,m(()=>s(!0))})},[]),e(Us.Provider,{value:{renderer:r.current,strict:i},children:t})}function Ar(t){return"function"==typeof t}let Mr=0;const xr={animation:{Feature:class extends Fs{constructor(t){super(t),t.animationState||(t.animationState=Ns(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Qi(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){this.node.getProps().animate!==this.node.prevProps?.animate&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends Fs{constructor(){super(...arguments),this.id=Mr++}update(){const{presenceContext:t,animationState:e}=this.node;if(!t||!e)return;const{isPresent:n,onExitComplete:i}=t;if(n===!this.exit)return;if(n){if(!0===this.exit){const{initial:t}=this.node.getProps();if(t&&!Array.isArray(t)){const{transition:e,transitionEnd:n,...i}=Si(this.node,t)||{};for(const t in i)this.node.getValue(t)?.jump(i[t])}this.node.blockInitialAnimation=!1,e.reset(),e.animateChanges()}else e.setActive("exit",!1);return void(this.exit=void 0)}const s=this.exit=e.setActive("exit",!0);i&&s.then(()=>{this.exit===s&&(this.exit=!0,i(this.id))})}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id,this.node)),this.update()}unmount(){}}}};function kr(t,e,n,i,s){const{props:r}=t,o="while"+n;!s&&t.animationState&&r[o]&&t.animationState.setActive(o,"Start"===i);const a=r["on"+n+i];a&&zt.postRender(()=>a(e,function(t){return{point:{x:t.pageX,y:t.pageY}}}(e)))}function Vr(t,e,n,i){t.current instanceof HTMLButtonElement&&t.current.disabled||kr(t,e,"Tap",n,i)}const Cr=new WeakMap,Er=new WeakMap,Pr=t=>{const e=Cr.get(t.target);e&&e(t)},Fr=t=>{t.forEach(Pr)};function Dr(t,e,n){const i=function({root:t,...e}){const n=t||document;Er.has(n)||Er.set(n,{});const i=Er.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Fr,{root:t,...e})),i[s]}(e);return Cr.set(t,n),i.observe(t),()=>{Cr.delete(t),i.unobserve(t)}}const Or={some:0,all:1};const Rr={inView:{Feature:class extends Fs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Or[i]};this.stopObserver=Dr(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),r=e?n:i;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}},tap:{Feature:class extends Fs{constructor(){super(...arguments),this.options={}}mount(){const{current:t}=this.node;t&&(this.update(),this.unmount=Ps(t,(t,e)=>(Vr(this.node,e,"Start"),{onComplete:(t,{success:e})=>Vr(this.node,t,e?"":"Cancel"),onRepeat:()=>Vr(this.node,e,"",!0)}),this.options))}update(){const{options:t,node:e}=this,{globalTapTarget:n,propagate:i,tap:s}=e.props;for(const e in t)delete t[e];Object.assign(t,s,{useGlobalTarget:n,stopPropagation:!1===i?.tap})}unmount(){}}},focus:{Feature:class extends Fs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=w(Zi(this.node.current,"focus",()=>this.onFocus()),Zi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Fs{mount(){const{current:t}=this.node;t&&(this.unmount=Ts(t,(t,e)=>(kr(this.node,e,"Hover","Start"),t=>kr(this.node,t,"Hover","End"))))}unmount(){}}}},Ir=Object.assign({renderer:(t,e)=>e.isSVG??ir(t)?new Is(e):new gs(e,{allowProjection:t!==r})},xr,Rr);export{Tr as LazyMotion,Sr as MotionDiv,Ir as domAnimation};
//# sourceMappingURL=size-rollup-m-dom-animation.js.map