framer-motion
Version:
A simple and powerful JavaScript animation library
3 lines • 140 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 c,useEffect as u,forwardRef as d,useState as p,startTransition as m,useId as f,Component as y}from"react";function g(t,e){-1===t.indexOf(e)&&t.push(e)}function v(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const x=(t,e,n)=>n>e?e:n<t?t:n,w={},S=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),T=t=>"object"==typeof t&&null!==t,b=t=>/^0[^.\s]+$/u.test(t);const P=t=>t,A=(...t)=>t.reduce((t,e)=>n=>e(t(n))),E=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class M{constructor(){this.subscriptions=[]}add(t){return g(this.subscriptions,t),()=>this.remove(t)}remove(t){v(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 V=t=>1e3*t,k=t=>t/1e3,D=(t,e)=>e?t*(1e3/e):0,C=(t,e,n)=>t*(3*(1-t)*((1-t)*e+t*n)+t*t);function R(t,e,n,i){return t===e&&n===i?P:s=>{let o=0,r=1,a=s;for(let e=0;;e++){a>=o&&a<=r||(a=(o+r)/2);const i=C(a,t,n)-s;if(i*i<1e-28||40===e)break;i>0?r=a:o=a,a-=1e-7*i/(C(a+1e-7,t,n)-s-i)}return C(a,e,i)}}const L=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,B=t=>e=>1-t(1-e),F=R(.33,1.53,.69,.99),j=B(F),O=L(j),I=t=>t>=1?1:(t*=2)<1?.5*j(t):.5*(2-Math.pow(2,-10*(t-1))),U=t=>1-Math.sin(Math.acos(t)),N=B(U),W=L(U),z=R(.42,0,1,1),$=R(0,0,.58,1),K=R(.42,0,.58,1),Y=t=>Array.isArray(t)&&"number"!=typeof t[0],X=t=>Array.isArray(t)&&"number"==typeof t[0],H={linear:P,easeIn:z,easeInOut:K,easeOut:$,circIn:U,circInOut:W,circOut:N,backIn:j,backInOut:O,backOut:F,anticipate:I},_=t=>{if(X(t)){const[e,n,i,s]=t;return R(e,n,i,s)}return"string"==typeof t?H[t]:t},G={delta:0,timestamp:0,isProcessing:!1};let q;function Z(){q=void 0}const J={now:()=>(void 0===q&&J.set(G.isProcessing||w.useManualTiming?G.timestamp:performance.now()),q),set:t=>{q=t,queueMicrotask(Z)}},Q=t=>Math.round(1e5*t)/1e5,tt=t=>e=>"string"==typeof e&&e.startsWith(t),et=tt("--"),nt=tt("var(--"),it=t=>!!nt(t)&&st.test(t.split("/*")[0].trim()),st=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ot(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const rt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},at={...rt,transform:t=>x(0,1,t)},lt={...rt,default:1},ht=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const ct=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ut=(t,e)=>n=>Boolean("string"==typeof n&&ct.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),dt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(ht);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},pt={...rt,transform:t=>Math.round((t=>x(0,255,t))(t))},mt={test:ut("rgb","red"),parse:dt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+pt.transform(t)+", "+pt.transform(e)+", "+pt.transform(n)+", "+Q(at.transform(i))+")"},ft=(t,e,n)=>{const i=t.substring(1+e*n,1+(e+1)*n);return n>1?i:i+i};const yt={test:ut("#"),parse:function(t){const e=t.length>5?2:1,n=ft(t,3,e);return{red:parseInt(ft(t,0,e),16),green:parseInt(ft(t,1,e),16),blue:parseInt(ft(t,2,e),16),alpha:n?parseInt(n,16)/255:1}},transform:mt.transform},gt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),vt=gt("deg"),xt=gt("%"),wt=gt("px"),St=gt("vh"),Tt=gt("vw"),bt=(()=>({...xt,parse:t=>xt.parse(t)/100,transform:t=>xt.transform(100*t)}))(),Pt={test:ut("hsl","hue"),parse:dt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+xt.transform(Q(e))+", "+xt.transform(Q(n))+", "+Q(at.transform(i))+")"},At={test:t=>mt.test(t)||yt.test(t)||Pt.test(t),parse:t=>mt.test(t)?mt.parse(t):Pt.test(t)?Pt.parse(t):yt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?mt.transform(t):Pt.transform(t),getAnimatableNone:t=>{const e=At.parse(t);return e.alpha=0,At.transform(e)}},Et=new RegExp(ht.source),Mt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const Vt="number",kt="color",Dt=/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 Ct(t){const e=t.toString();return Et.test(e)||Mt.test(e)}function Rt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Dt,t=>(At.test(t)?(i.color.push(o),s.push(kt),n.push(At.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Vt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Lt({split:t,types:e}){const n=t.length;return i=>{let s="";for(let o=0;o<n;o++)if(s+=t[o],void 0!==i[o]){const t=e[o];s+=t===Vt?Q(i[o]):t===kt?At.transform(i[o]):i[o]}return s}}const Bt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:At.test(n)?At.getAnimatableNone(n):n;var n};const Ft={test:function(t){return isNaN(t)&&"string"==typeof t&&(Et.test(t)||Mt.test(t))},parse:function(t){return Rt(t).values},createTransformer:function(t){return Lt(Rt(t))},getAnimatableNone:function(t){const e=Rt(t);return Lt(e)(e.values.map((t,n)=>Bt(t,e.split[n])))}};function jt(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 Ot(t,e){return n=>n>0?e:t}const It=(t,e,n)=>t+(e-t)*n,Ut=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Nt=[yt,mt,Pt];function Wt(t){const e=(n=t,Nt.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===Pt&&(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=jt(a,i,t+1/3),o=jt(a,i,t),r=jt(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 zt=(t,e)=>{const n=Wt(t),i=Wt(e);if(!n||!i)return Ot(t,e);const s={...n};return t=>(s.red=Ut(n.red,i.red,t),s.green=Ut(n.green,i.green,t),s.blue=Ut(n.blue,i.blue,t),s.alpha=It(n.alpha,i.alpha,t),mt.transform(s))},$t=new Set(["none","hidden"]);function Kt(t,e){return n=>It(t,e,n)}function Yt(t){return"number"==typeof t?Kt:"string"==typeof t?it(t)?Ot:At.test(t)?zt:_t:Array.isArray(t)?Xt:"object"==typeof t?At.test(t)?zt:Ht:Ot}function Xt(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>Yt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function Ht(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Yt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const _t=(t,e)=>{const n=Rt(t),i=Rt(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?$t.has(t)&&!i.values.length||$t.has(e)&&!n.values.length?function(t,e){return $t.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):A(Xt(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}(n,i),i.values),Lt(i)):Ot(t,e)},Gt=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function qt(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return It(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=Gt.exec(t);if(!n)return;const i=Gt.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),r=parseFloat(i[1]);return t=>Q(It(o,r,t))+s}(t,e);if(n)return n}return Yt(t)(t,e)}const Zt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Jt(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,s=!0;const o=()=>i=!0,r=Zt.reduce((t,e)=>(t[e]=function(t){let e,n=new Set,i=new Set,s=!1,o=!1;const r=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function l(n){r.has(n)&&(i.add(n),t()),(e=n)(a)}const h={schedule:(t,o=!1,a=!1)=>{const l=a&&s,h=l?n:i;return o&&r.add(t),l&&t!==e&&h.delete(t),h.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(o=!0);s=!0;const r=n;n=i,i=r,n.forEach(l),n.clear(),e=void 0,s=!1,o&&(o=!1,h.process(t))}};return h}(o),t),{}),{setup:a,read:l,resolveKeyframes:h,preUpdate:c,update:u,preRender:d,render:p,postRender:m}=r,f=()=>{const o=w.useManualTiming,r=o?n.timestamp:performance.now();i=!1,o||(n.delta=s?1e3/60:Math.max(Math.min(r-n.timestamp,40),1)),n.timestamp=r,n.isProcessing=!0,a.process(n),l.process(n),h.process(n),c.process(n),u.process(n),d.process(n),p.process(n),m.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(f))};return{schedule:Zt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(i||(i=!0,s=!0,n.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<Zt.length;e++)r[Zt[e]].cancel(t)},state:n,steps:r}}const{schedule:Qt,cancel:te,steps:ee}=Jt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:P,!0,G),ne=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Qt.update(e,t),stop:()=>te(e),now:()=>G.isProcessing?G.timestamp:J.now()}},ie=(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)})`},se=2e4;function oe(t,e=50,n=2e4,i){let s=0,o=t.next(s);for(;!o.done&&s<n;)s+=e,o=t.next(s);return s>=n?1/0:s}const re=t=>t<0?1/Math.max(1+t,.05):Math.max(1-t,.05);function ae(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),i=t-n,s=t+n,o=2*n*Math.exp(-e)*(1+e);return ce(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function le(t,e){return t*Math.sqrt(1-e*e)}const he=12;function ce(t,e,n){let i=n;for(let n=1;n<he;n++)i-=t(i)/e(i);return i}const ue=.001;const de=(t,e)=>(e?t>=0:t>0)&&t<1/0;function pe(t,e){if(de(t,e))return t}function me(t){const e=pe(t.stiffness),n=pe(t.damping,!0),i=pe(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=re(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*ae(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=re(e);t=x(.01,10,k(t)),s<1?(n=e=>{const n=e*s,i=n*t,o=le(e,s),r=Math.exp(-i);return ue-n/o*r},i=e=>{const i=e*s*t,o=s*s*e*e*t,r=Math.exp(-i),a=le(e*e,s);return(-n(e)+ue>0?-1:1)*-o*r/a}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*-e));const o=ce(n,i,5/t),r=o*ae(s,o*t),a=r*r;return{stiffness:a,damping:2*s*Math.sqrt(a),duration:V(t)}}(s)),s.isResolvedFromDuration=!0;de(s.stiffness)&&de(s.damping,!0)||(s.stiffness=100,s.damping=10)}return s}function fe(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],o={done:!1,value:i},{stiffness:r,damping:a,mass:l,duration:h,isResolvedFromDuration:c,isTimeDefined:u}=me({...n}),d=t=>c?0:-k(t),p=a/(2*Math.sqrt(r*l)),m=k(Math.sqrt(r/l)),f=p*m,y={target:s,delta:s-i,velocity:d(n.velocity)||0,restSpeed:0,restDelta:0},g=()=>{const t=Math.abs(y.delta)<5;y.restSpeed=n.restSpeed||(t?.01:2),y.restDelta=n.restDelta||(t?.005:.5)};let v,x,w;if(g(),p<1){const t=le(m,p),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(y.velocity+f*y.delta)/t,e.sinC=f*e.A+y.delta*t,e.cosC=f*y.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),y.target-e.env*(e.A*e.sin+y.delta*e.cos)),x=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===p){v=t=>y.target-Math.exp(-m*t)*(y.delta+(y.velocity+m*y.delta)*t);const t={C:0};w=()=>{t.C=y.velocity+m*y.delta},x=e=>Math.exp(-m*e)*(m*t.C*e-y.velocity)}else{const t=m*Math.sqrt(p*p-1),e=f-t,n=f+t,i=t<1||u?1/0:300/t,s=(t,e)=>Math.exp(e>i?(f-t)*i-f*e:-t*e),o={S:0,F:0};w=()=>{const e=(y.velocity+f*y.delta)/t;o.S=(y.delta+e)/2,o.F=(y.delta-e)/2},v=t=>y.target-o.S*s(e,t)-o.F*s(n,t),x=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}w();const S=c&&h||null,T={calculatedDuration:S,retarget:(t,e)=>{y.target=t[t.length-1],y.delta=y.target-t[0],y.velocity=d(e),n.restSpeed&&n.restDelta||g(),T.calculatedDuration=S,o.done=!1,w()},velocity:t=>V(x(t)),next:t=>{const e=v(t);if(c)o.done=t>=h;else{const n=V(x(t));o.done=Math.abs(n)<=y.restSpeed&&Math.abs(y.target-e)<=y.restDelta}return o.value=o.done?y.target:e,o},toString:()=>{const t=Math.min(oe(T),se),e=ie(e=>T.next(t*e).value,t,30);return t+"ms "+e}};return T}const ye=Object.assign(fe,{applyToOptions:t=>{const e=function(t,e=100,n){const{keyframes:i,velocity:s}=t,o=i&&i[i.length-1]-i[0],r=n({...t,velocity:s&&o?s*e/o:s,keyframes:[0,e]}),a=Math.min(oe(r),se);return{type:"keyframes",ease:t=>r.next(a*t).value/e,duration:k(a)}}(t,100,fe);return t.ease=e.ease,t.duration=V(e.duration),t.type="keyframes",t}});function ge({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:c}){const u=t[0],d={done:!1,value:u},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=u+m,y=r?r(f):f;y!==f&&(m=y-u);const g=t=>-m*Math.exp(-t/i),v=t=>{const e=g(t);d.done=Math.abs(e)<=h,d.value=d.done?y:t?y+e:u};let x,w;const S=t=>{var e;((e=d.value)<a||e>l)&&(x=t,w=ye({keyframes:[d.value,p(d.value)],velocity:-g(t)/i*1e3,damping:s,stiffness:o,restDelta:h,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,v(t),S(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&v(t),d)}}}function ve(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(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=w.mix||qt,o=t.length-1;for(let r=0;r<o;r++){let o=n?.(t[r],t[r+1])||s(t[r],t[r+1]);if(e){const t=Array.isArray(e)?e[r]||P:e;o=A(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=E(t[i],t[i+1],n);return a[i](s)};return n?e=>h(x(t[0],t[o-1],e)):h}function xe(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=E(0,e,i);t.push(It(n,1,s))}}(e,t.length-1),e}function we({duration:t=300,keyframes:e,times:n,ease:i="easeInOut",mixer:s}){const o="number"==typeof e[0]?void 0:s,r=Y(i)?i.map(_):_(i)||K,a={done:!1,value:e[0]};let l=-1;if(!o)for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(l>=0){l=-2;break}l=t-1}if(l>=0){const i=n&&n.length===e.length?n:xe(e),s=i[l]*t,o=i[l+1]*t,h=e[l],c=e[l+1],u=Array.isArray(r)?r[l]:r,d=(w.mix||qt)(h,c),p=e.length-2;return{calculatedDuration:t,next:e=>(a.value=l&&e<s?d(0):l<p&&(e>=o||!t)?"number"==typeof c?c:d(1):d(u(e>=o||!t?1:e<=s?0:(e-s)/(o-s))),a.done=e>=t,a)}}const h=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:xe(e),t),c=ve(h,e,{ease:Array.isArray(r)?r:(u=e,d=r,u.map(()=>d||K).splice(0,u.length-1)),mixer:o});var u,d;return{calculatedDuration:t,next:e=>(a.value=c(e),a.done=e>=t,a)}}function Se(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 D(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}function Te(t,{repeat:e,repeatType:n="loop"},i,s=1){let o,r,a=0;for(let e=0;e<t.length;e++){const n=t[e];null!==n&&(a++||(o=n),r=n)}const l=s<0||e&&"loop"!==n&&e%2==1?0:a-1;return l&&void 0!==i?i:l?r:o}const be={decay:ge,inertia:ge,tween:we,keyframes:we,spring:ye};function Pe(t){"string"==typeof t.type&&(t.type=be[t.type])}const Ae=(t,e)=>e-t>40&&!w.useManualTiming?e:t;function Ee(t,e){return{kind:t,animation:e,timestamp:J.now(),frameTimestamp:G.timestamp,frameIsProcessing:G.isProcessing}}function Me(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Ee("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Ve{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 ke=t=>t/100,De=t=>Math.round(1e4*t)/1e4;class Ce extends Ve{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=J.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(),Me(this,this.options)}initAnimation(){const{options:t}=this;Pe(t);const{type:e=we,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||we;this.mixKeyframes=void 0,a!==we&&"number"!=typeof r[0]&&(this.mixKeyframes=A(ke,t.mixer?.(r[0],r[1])||qt(r[0],r[1])),r=[0,100]);const l=a(r===t.keyframes?t:{...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=oe(l));const{calculatedDuration:h}=l;this.calculatedDuration=h,this.resolvedDuration=h+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}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:o=0,keyframes:r,type:a,onUpdate:l,finalKeyframe:h}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=Ae(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-o*(this.playbackSpeed>=0?1:-1),u=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,u);let{done:p}=d;u||(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!==ge&&(d.value=Te(r,this.options,h,this.speed)),l&&l(d.value),m&&this.finish(),d}at(t){return this.holdTime??De((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!==ge?Te(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:o,resolvedDuration:r}=this,{keyframes:a,repeat:l,repeatType:h,repeatDelay:c}=this.options;let u,d=t,p=n;if(l){const e=Math.min(t,i)/r;let n=Math.floor(e),s=e%1;!s&&e>=1&&(s=1),1===s&&n--,n=Math.min(n,l+1);Boolean(n%2)&&("reverse"===h?(s=1-s,c&&(s-=c/r)):"mirror"===h&&(p=o)),d=x(0,1,s)*r}return e?(this.delayState.value=a[0],u=this.delayState):u=p.next(d),s&&!e&&(u.value=s(u.value)),u}get duration(){return k(this.calculatedDuration)}get iterationDuration(){return this.duration+k(this.options.delay??0)}get time(){return k(this.currentTime)}set time(t){"finished"===this.state&&this.updateFinished(),t=V(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 Se(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(J.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=k(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ne,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(J.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 Re=new Set(["brightness","contrast","saturate","opacity"]);function Le(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(ht)||[];if(!i)return t;const s=n.replace(i,"");let o=Re.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Be=/\b([a-z-]*)\(.*?\)/gu,Fe={...Ft,getAnimatableNone:t=>{const e=t.match(Be);return e?e.map(Le).join(" "):t}},je={...Ft,getAnimatableNone:t=>{const e=Ft.parse(t);return Ft.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},Oe={...rt,transform:Math.round},Ie={rotate:vt,pathRotation:vt,rotateX:vt,rotateY:vt,rotateZ:vt,scale:lt,scaleX:lt,scaleY:lt,scaleZ:lt,skew:vt,skewX:vt,skewY:vt,distance:wt,translateX:wt,translateY:wt,translateZ:wt,x:wt,y:wt,z:wt,perspective:wt,transformPerspective:wt,opacity:at,originX:bt,originY:bt,originZ:wt},Ue={borderWidth:wt,borderTopWidth:wt,borderRightWidth:wt,borderBottomWidth:wt,borderLeftWidth:wt,borderRadius:wt,borderTopLeftRadius:wt,borderTopRightRadius:wt,borderBottomRightRadius:wt,borderBottomLeftRadius:wt,width:wt,maxWidth:wt,height:wt,maxHeight:wt,top:wt,right:wt,bottom:wt,left:wt,inset:wt,insetBlock:wt,insetBlockStart:wt,insetBlockEnd:wt,insetInline:wt,insetInlineStart:wt,insetInlineEnd:wt,padding:wt,paddingTop:wt,paddingRight:wt,paddingBottom:wt,paddingLeft:wt,paddingBlock:wt,paddingBlockStart:wt,paddingBlockEnd:wt,paddingInline:wt,paddingInlineStart:wt,paddingInlineEnd:wt,margin:wt,marginTop:wt,marginRight:wt,marginBottom:wt,marginLeft:wt,marginBlock:wt,marginBlockStart:wt,marginBlockEnd:wt,marginInline:wt,marginInlineStart:wt,marginInlineEnd:wt,fontSize:wt,backgroundPositionX:wt,backgroundPositionY:wt,...Ie,zIndex:Oe,fillOpacity:at,strokeOpacity:at,numOctaves:Oe},Ne={...Ue,color:At,backgroundColor:At,outlineColor:At,fill:At,stroke:At,borderColor:At,borderTopColor:At,borderRightColor:At,borderBottomColor:At,borderLeftColor:At,filter:Fe,WebkitFilter:Fe,mask:je,WebkitMask:je},We=t=>Ne[t],ze=new Set([Fe,je]);let $e,Ke,Ye;function Xe(t,e){if(t===$e&&e===Ke)return Ye;let n=We(t);return ze.has(n)||(n=Ft),Ye=n.getAnimatableNone?n.getAnimatableNone(e):void 0,$e=t,Ke=e,Ye}const He=t=>180*t/Math.PI,_e=t=>{const e=He(Math.atan2(t[1],t[0]));return qe(e)},Ge={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:_e,rotateZ:_e,skewX:t=>He(Math.atan(t[1])),skewY:t=>He(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},qe=t=>((t%=360)<0&&(t+=360),t),Ze=t=>Math.hypot(t[0],t[1]),Je=t=>Math.hypot(t[4],t[5]),Qe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ze,scaleY:Je,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(Ze(t)+Je(t))/2,rotateX:t=>qe(He(Math.atan2(t[6],t[5]))),rotateY:t=>qe(He(Math.atan2(-t[2],t[0]))),rotateZ:_e,rotate:_e,skewX:t=>He(Math.atan(t[4])),skewY:t=>He(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function tn(t){return t.includes("scale")?1:0}function en(t,e){if(!t||"none"===t)return tn(e);const n=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return tn(e);const i=(n[1]?Qe:Ge)[e],s=n[2].split(",").map(t=>parseFloat(t));return"function"==typeof i?i(s):s[i]}const nn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sn=(()=>new Set([...nn,"pathRotation"]))(),on=t=>t===rt||t===wt,rn=new Set(["x","y","z"]),an=nn.filter(t=>!rn.has(t));const ln=new Set(["bottom","right"]);function hn(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],h=l-a;return"border-box"===o?h:h-parseFloat(i)-parseFloat(s)}const cn=({transform:t})=>en(t,"x"),un=({transform:t})=>en(t,"y"),dn={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>hn(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>hn(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:cn,y:un,translateX:cn,translateY:un},pn=new Set;let mn=!1,fn=!1,yn=!1;function gn(){if(fn){const t=[],e=new Set,n=new Set;pn.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),ln.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return an.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)})}fn=!1,mn=!1,pn.forEach(t=>t.complete(yn)),pn.clear()}function vn(){pn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(fn=!0)})}class xn{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?(pn.add(this),mn||(mn=!0,Qt.read(vn),Qt.resolveKeyframes(gn))):(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=function(t,e,n){if("string"==typeof t){if(S(t)||b(t))return parseFloat(t);if(!Ft.test(t)&&Ft.test(n))return Xe(e,n)}return t??void 0}(n.readValue(e,o),e,o);void 0!==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),pn.delete(this)}cancel(){"scheduled"===this.state&&(pn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}function wn(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}const Sn={};function Tn(t,e){const n=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>Sn[e]??n()}const bn=Tn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Pn=Tn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),An=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,En={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:An([0,.65,.55,1]),circOut:An([.55,0,1,.45]),backIn:An([.31,.01,.66,-.59]),backOut:An([.33,1.53,.69,.99])};function Mn(t,e){return t?"function"==typeof t?Pn()?ie(t,e):"ease-out":X(t)?An(t):Array.isArray(t)?t.map(t=>Mn(t,e)||En.easeOut):En[t]:void 0}function Vn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},h=void 0){const c={[e]:n};l&&(c.offset=l);const u=Mn(a,s);Array.isArray(u)&&(c.easing=u);const d={delay:i,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return h&&(d.pseudoElement=h),t.animate(c,d)}function kn(t){return"function"==typeof t&&"applyToOptions"in t}class Dn extends Ve{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;const l=function({type:t,...e}){return kn(t)&&Pn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Vn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!s){const t=Te(i,this.options,r,this.speed);this.updateMotionValue?.(t),wn(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Me(this,t,l)}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 k(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+k(t)}get time(){return k(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=V(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&&bn()?(this.animation.timeline=t,e?.(this.animation),P):n(this)}}const Cn={anticipate:I,backInOut:O,circInOut:W};function Rn(t){"string"==typeof t.ease&&t.ease in Cn&&(t.ease=Cn[t.ease])}class Ln extends Dn{constructor(t){Rn(t),Pe(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(J.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:o,...r}=this.options;this.sampler=new Ce({...r,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,o=this.elapsed(),r="running"===this.state&&s?x(0,10,o):0,a=this.sample(o);n&&i&&wn(n,i,a),e.setWithVelocity(this.sample(o-r*Math.sign(s)),a,r/Math.abs(s||1))}}const Bn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ft.test(t)&&"0"!==t||t.startsWith("url(")));function Fn(t){t.duration=0,t.type="keyframes"}const jn=new Set(["opacity","clipPath","filter","transform"]),On=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const In=({mixer:t,keyframes:e})=>t&&"number"!=typeof e[0]&&e.some((n,i)=>i&&t(e[i-1],n)),Un=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Nn=()=>!w.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function Wn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!jn.has(n)&&!Un.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:h,transformTemplate:c}=e.owner.getProps();return Nn()&&(jn.has(n)||Un.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&On.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!c)&&!h&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r&&!In(t)}const zn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,$n={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Kn=nn.length,Yn={},Xn=(t,e,n=zn(e,Ie[t]))=>(Yn[t]||(Yn[t]=($n[t]||t)+"("))+n+")",Hn=(t,e)=>("number"==typeof e?e:parseFloat(e))===(t.startsWith("scale")?1:0);const _n=new WeakMap,Gn=.001,qn=100,Zn=new Set(["linear","easeIn","easeOut","easeInOut"]),Jn=new WeakMap,Qn=(t,e)=>Math.min(200,Math.max(2,Math.ceil((e-t)/10))),ti=(t,e)=>Math.abs(t-e)<=.001,ei=(t,e)=>t-e,ni=(t,e,n)=>xe(Array(n+1)).map(n=>It(t,e,n)),ii=t=>t.motionValue.owner,si=t=>_n.get(t),oi=({state:t})=>"idle"===t||"finished"===t,ri=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class ai{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!==ne?this.js.now():G.isProcessing?G.timestamp:J.now()}start(t=!0){const e=si(this.element);!e||e.isJS?this.js.start(t):e.schedule(!1,!t)}stopJS(){this.driver?.stop()}stop(){this.stopJS();const t=si(this.element);t&&!t.isFinishing&&t.release(this.animation)}}let li,hi;class ci extends Ce{constructor(t){const e=ii(t).current,{driver:n=ne}=t;let i;const s=function(t){const e=ii(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(ri(e,"transform")||"none")||ri(e,"pathRotation")||e.projection?.isProjecting()||In(t))}(t);t.driver=t=>new ai(e,t,n,i),super(t),i=this;const o=this.driver;o&&(o.animation=this),this.canAccelerate=s;const{stop:r}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),r()}}offsets(){const{keyframes:t,times:e}=this.options;return e||(this.offsetsOf!==t&&(this.offsetsOf=t,this.cachedOffsets=xe(t)),this.cachedOffsets)}get group(){return si(ii(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(J.now()):void 0}tween(){const{keyframes:t,type:e,repeat:n,delay:i=0}=this.options;let s=-1;if(n||e!==we||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:o}=this.options;Y(o)&&(o=o[s]);const r=this.offsets(),a=t=>this.startTime+(i+r[t]*this.totalDuration)/this.speed;if(s>=0){const t=X(o)?An(o):(t=>Zn.has(t))(o)?En[o]:_(o);return[a(s),a(s+1),"string"==typeof t||ti(t(0),0)&&ti(t(1),1)?t:void 0]}}boundaries(t,e){const{startTime:n,speed:i,resolvedDuration:s,options:o}=this,{delay:r=0,repeat:a=0,repeatDelay:l=0,repeatType:h,type:c}=o,u=(c||we)===we?this.offsets():[0,1],d=n+r/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 o=d+n*s/i;if(o>e)break;for(const r of u){const a=o+(n%2&&h&&"loop"!==h?1-r:r)*(s-l)/i;a>t&&a<e&&p.push(a)}}return p}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=J.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,o,r={},a=[],l=new Map,h=[],c=!1,u=!1,d=!1,p=!1,m=-1/0,f=1/0;const y=t=>{for(const e of n)if(e.name===t)return!0},g=(e,n)=>{const s={};for(const o of void 0===e?nn:a){const a=i.get(o),l=void 0===e?ri(t,o):a?a.sampleAt(n>e&&!a.timing()[1]?n:e):r[o];void 0!==l&&(s[o]=l)}return s},v=(t,e)=>{let n="";for(const i in t){const s=t[i];e&&Hn(i,s)||(n+=Xn(i,s)+" ")}return(e?n.trim():n)||"none"},x=(t,e)=>v(g(t,e)),w=(t=g())=>{e.style.transform=v(t,!0)},S=t=>{t.onfinish=t.oncancel=null,t.cancel()},T=(t=!0)=>{clearTimeout(s),f=1/0,o=void 0,t&&w(),h.forEach(({animation:t})=>S(t)),h=[]},b=(t,n)=>new Animation(new KeyframeEffect(e,t,n)),P=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=J.now()+e,n<1/0&&(t.onfinish=()=>{i.isDone=!0,h.some(t=>t.end===1/0)&&(S(t),h=h.filter(t=>t!==i)),j.schedule(!1)}),t.oncancel=()=>h.includes(i)&&j.demote(),h.push(i)},A=(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]:[]},M=(t,e,n,i)=>{const s=Qn(e,n);if(4*i.length>s)return;let o;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===o)o=s;else if(!ti(s,o))return}const r=ni(e,n,s).concat(i).sort(ei),a=t=>E(e,n,t);let l,h;for(const n of t){const t=n.numberAt(e),i=r.map(e=>n.numberAt(e)-t),s=i[i.length-1],o=i.some(t=>Math.abs(t)*Gn>Math.abs(s))?0:s,a=i.map(t=>o?t/o:t);if(o&&!l)l=a,h=e=>(n.numberAt(e)-t)/o;else if(a.some((t,e)=>!ti(t,o&&l[e])))return}if(!l||l.every((t,e)=>ti(t,a(r[e]))))return"linear";const c=[],u=(t,e=h(t))=>c.push(De(e)+" "+De(100*a(t))+"%");return l.forEach((t,e)=>{e&&Math.abs(t-l[e-1])>.2&&A(h,r[e-1],r[e]).forEach(t=>u(t)),u(r[e],t)}),"linear("+c+")"},V=(t,e,n,i)=>{const s=[e],o=[];let r=n,a=e;for(const i of t){const t=i.tween();if("linear"!==t?.[2]){const[s,l]=i.timing(),[h,c]=t||[e,l?n:s];r=Math.min(r,h),a=Math.max(a,c),o.push(i)}}r=Math.max(e,r),a=Math.min(n,a);const l=(t,e)=>o.every(n=>!(Math.abs(n.numberAt((t+e)/2)-(n.numberAt(t)+n.numberAt(e))/2)>(n.name.startsWith("scale")?.001:.1))),h=(e,n,i)=>{if(n-e<1||l(e,n))s.push(n);else if(i<4)h(e,(e+n)/2,i+1),h((e+n)/2,n,i+1);else{for(const i of t)s.push(...A(t=>i.numberAt(t),e,n));s.push(n)}},c=a>r?ni(r,a,Math.ceil((a-r)/100)):[];c.push(n);for(const t of i)c.push(t,Math.min(t+.01,n));let u=e;for(const t of c.sort(ei))t>u&&h(u,t,0),u=t;return s.sort(ei)},k=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},D=(t,e,n,i,s={fill:"both"},o)=>{const r=i?[]:t.flatMap(t=>t.boundaries(e,n)),a=i||M(t,e,n,r),l=a?[e,n]:V(t,e,n,r),h=l.map(t=>x(t,o));let c={transform:h};return a||(c.offset=l.map(t=>E(e,n,t))),h.every(t=>t===h[0])&&(w(g(e,o)),c=null),b(c,{...s,duration:n-e,easing:a||"linear"})},C=t=>{const e=J.now()+t;e<f&&(clearTimeout(s),f=e,s=setTimeout(()=>{f=1/0,j.schedule(!1)},t))},R=e=>{let s=e,c=0,u=0;const d=[],p=[],m=new Set;i.clear(),l=new Map;for(const t of n){i.set(t.name,t);const[n,o]=t.timing(),r=n===1/0;if(l.set(t,[t.at(e),t.speed,r]),!r){if(t.speed<0)return;if(o){if(c){const t=(n-u)/o;if(Math.abs(o-c)>1||Math.abs(t-Math.round(t))*c>1)return}else c=o,u=n;p.push(t)}else m.add(n);d.push(t),s=Math.max(s,n)}}r={},a=nn.filter(e=>{if(i.has(e))return!0;const n=r[e]=ri(t,e);return void 0!==n&&!Hn(e,n)}),T(!1);const f=!c&&k(d);try{if(s>e){let t;if(f&&f[1]>e){const[n,i,r]=f;if(n-e>qn)return d.forEach(t=>t.sync()),C(o=n-e-qn),!0;t="string"==typeof r?r:r?((t,e)=>{let n=Jn.get(t);return n?.[0]!==e&&(n=[e,"linear("+xe(Array(e+1)).map(e=>De(t(e))+" "+De(100*e)+"%")+")"],Jn.set(t,n)),n[1]})(r,Qn(n,i)):M(d,n,i,[]),t&&P(D(d,n,i,t,{fill:"both",endDelay:s-i}),n-e,s-n)}t||P(D(d,e,s),0,s-e),m.forEach(t=>t<s-1&&P(b(null,{duration:t-e}),0,t-e))}if(c){const t=u+Math.floor((s-u)/c)*c;P(D(p,t,t+c,void 0,{iterations:1/0,iterationStart:(s-t)/c,fill:"forwards"},s),s-e)}}catch{return}return h.length||T(),!0},L=(t,e)=>{let i,s=0;for(const e of n){const n=l.get(e);if(!n)return!1;const[o,r,a]=n,c=e.at(t),u=e.timing()[0]===1/0;if(a){if(u&&(c===o||!h.length))continue;return!1}const d=(c-o)/r,p=u?0:e.speed/r;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(!h.length){if(void 0===o||e&&s)return!1;if(s){const t=(o-i)/s;if(t<1)return!1;C(t)}return!0}for(const{offset:t,end:n,isDone:s}of h){const o=i-t;if(n<1/0&&(s?o<n-1:o<0&&(e||t<=0)||o>=n))return!1}for(const{animation:e,offset:n,isDone:o}of h){if(o)continue;const r=i-n;s&&e.updatePlaybackRate&&"running"===e.playState&&Math.abs(Number(e.currentTime)-r)<20?e.playbackRate!==s&&e.updatePlaybackRate(s):s?(e.playbackRate!==s&&(e.playbackRate=s),e.startTime=t-r/s):(e.startTime=null,e.currentTime=r)}return!0},B=()=>!n.size&&(d=!0,si(e)===j&&_n.delete(e),j.isJS||T(),!0),F=()=>{const e=J.now();if(j.isJS||(j.isFinishing=!0,n.forEach(n=>{const[i,s]=n.timing();"running"===n.state&&n.speed>0&&!s&&i<=e+1&&(n.complete(),r[n.name]=ri(t,n.name),l.has(n)||(c=!0))}),j.isFinishing=!1),u=!1,d)return;if(n.forEach(t=>oi(t)&&n.delete(t)),B())return;for(const t of n)if(!t.canAccelerate)return j.demote(!0);j.isJS&&(j.isJS=!1,c=!0,n.forEach(t=>t.stopJS()));const i=c,s=p;if(c=p=!1,i||!L(e,s)){if(s){if(e-m<100)return j.demote();m=e}if(!R(e))return j.demote()}else if(void 0!==o&&!s)return;n.forEach(t=>t.timing()[0]===1/0&&t.sync())},j={tracks:n,isJS:!1,isFinishing:!1,schedule(t,e){d||(c||(c=t),p||(p=!!e),u||(u=!0,G.isProcessing?Qt.render(F,!1,!0):ui(F)))},release(t){oi(t)&&n.delete(t),B()||j.schedule(!0)},check(){if(!j.isJS)for(const e in r)if(ri(t,e)!==r[e]&&!y(e))return j.schedule(!0,!0)},demote(t){if(!j.isJS&&!d)return n.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),j.isJS=!0,l=new Map,T(),n.forEach(t=>"running"===t.state&&t.js?.start()),!0}};return _n.set(e,j),j}(ii(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(J.now())}get time(){return this.isAccelerated()?k(x(0,this.totalDuration,this.at(J.now())-(this.options.delay||0))):super.time}set time(t){(li??(li=Object.getOwnPropertyDescriptor(Ce.prototype,"time").set)).call(this,t)}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}const ui=t=>{hi||queueMicrotask(()=>{const t=hi;hi=void 0,t.forEach(t=>t())}),(hi||(hi=[])).push(t)};class di extends Ve{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=J.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,o=t;o.autoplay??(o.autoplay=!0),o.delay??(o.delay=0),o.type??(o.type="keyframes"),o.repeat??(o.repeat=0),o.repeatDelay??(o.repeatDelay=0),o.repeatType??(o.repeatType="loop");const r=s?.KeyframeResolver||xn;this.keyframeResolver=new r(e,(t,e,n)=>this.onKeyframesResolved(t,e,o,!n),n,i,s),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=J.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 o=t[t.length-1],r=Bn(s,e),a=Bn(o,e);return!(!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||kn(n))&&i)}(t,s,o,r);c||(!w.instantAnimations&&a||h?.(Te(t,n,e)),t[0]=t[t.length-1],Fn(n),n.repeat=0);const{onComplete:u}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{u?.(),this.notifyFinished()};const d=c&&!l&&Wn(n),p=!d&&(({name:t,motionValue:e})=>t&&nn.includes(t)&&e?.owner?.current instanceof HTMLElement&&Nn()&&Pn())(n);let m;if(i&&(d||p||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=Ae(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{m=new Ln(n)}catch{m=new Ce(n)}}else m=p?new ci(n):new Ce(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(),yn=!0,vn(),gn(),yn=!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 pi(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}class mi{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=J.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=J.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 M)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new M,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(){Qt.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=J.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=J.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return D(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 fi(t,e){return new mi(t,e)}function yi(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function gi(t,e){const n=t?.[e]??t?.default??t;return n!==t?yi(n,t):n}const vi={type:"spring",stiffness:500,damping:25,restSpeed:10},xi={type:"keyframes",duration:.8},wi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Si=(t,{keyframes:e})=>e.length>2?xi:sn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:vi:wi,Ti=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out","mixer"]);const bi=(t,e,n,i={},s,o)=>r=>{const a=gi(i,t)||{},l=a.delay||i.delay||0;let{elapsed:h=0}=i;h-=V(l);const c={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,hasOnUpdate:!!a.onUpdate};(function(t){for(const e in t)if(!Ti.has(e))return!0;return!1})(a)||Object.assign(c,Si(t,c)),c.duration&&(c.duration=V(c.duration)),c.repeatDelay&&(c.repeatDelay=V(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let u=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(Fn(c),0===c.delay&&(u=!0)),(w.instantAnimations||w.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(u=!0,Fn(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,u&&!o&&void 0!==e.get()){const t=Te(c.keyframes,a);if(void 0!==t)return void Qt.update(()=>{c.onUpdate(t),c.onComplete()})}return a.isSync?new Ce(c):new di(c)},Pi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ai(t,e,n=1){const[i,s]=function(t){const e=Pi.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 it(s)?Ai(s,e,n+1):s}function Ei(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 Mi(t,e,n){return Ei(t.getProps(),e,n,t)}const Vi=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,ki=new Set(["width","height","top","left","right","bottom",...nn]);function Di(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,fi(n))}function Ci(t){return(t=>Array.isArray(t))(t)?t[t.length-1]||0:t}const Ri=t=>Boolean(t&&t.getVelocity);function Li(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Ri(i)&&i.add))return n.add(e);if(!n&&w.WillChange){const n=new w.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}const Bi="data-framer-appear-id";function Fi(t){return t.props[Bi]}const ji="undefined"!=typeof window;function Oi({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!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?yi(o,l):l;const h=o?.reduceMotion,c=o?.skipAnimations;i&&(o=i);const u=[],d=s&&t.animationState?.getState()[s],p=o?.path;p&&(p.animateValues?p.animateValues(e=>t.getValue(e,t.latestValues[e]??0),a,o,n,u):p.animateVisualElement?.(t,a,o,n,u));for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&Oi(d,e))continue;const r={delay:n,...gi(d?.out[e]||o||{},e)};c&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){Qt.update(()=>i.set(s));continue}let p=!1;if(ji&&window.MotionHandoffAnimation){const n=Fi(t);if(n){const t=window.MotionHandoffAnimation(n,e,Qt);null!==t&&(r.startTime=t,p=!0)}}Li(t,e);const m=h??t.shouldReduceMotion;i.run(bi(e,i,s,m&&ki.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&u.push(f)}if(r){const e=()=>Qt.update(()=>{r&&function(t,e){const n=Mi(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)Di(t,e,Ci(o[e]))}(t,r)});u.length?Promise.all(u).then(e):e()}return u}function Ui(t,e,n={}){const i=Mi(t,e,Vi(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?Ii(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,h=[];return o?.forEach(t=>{t.notify("AnimationStart",e),h.push(Ui(t,e,{...n,delay:i+("function"==typeof r?0:r)+pi(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(h)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}const Ni=[rt,wt,xt,vt,Tt,St,{test:t=>"auto"===t,parse:t=>t}],Wi=t=>Ni.find((t=>e=>e.test(t))(t));function zi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||b(t))}const $i=new Set(["auto","none","0"]);class Ki extends xn{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(ot(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(),it(i))){const s=Ai(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!ki.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=Wi(i),r=Wi(s);if(ot(i)!==ot(s)&&dn[n])this.needsMeasurement=!0;else if(o!==r)if(on(o)&&on(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else dn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||zi(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&&!$i.has(e)&&Ct(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=Xe(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return dn[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 Yi=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Xi(t){return T(t)&&"ownerSVGElement"in t}const Hi={};function _i(t){return Hi.current?.add(t),t}const Gi=t=>Hi.current?Hi.current.bind(t):t;function qi(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const i=e?e.current:Hi.current?.root||document,s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Zi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function Ji(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(sn.has(t))r=!0;else if(et(t))s[t]=n;else{const e=zn(n,Ue[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="";for(let s=0;s<Kn;s++){const o=nn[s],r=t[o];if(void 0===r)continue;const a=n&&(e[o]=zn(r,Ue[o]));Hn(o,r)||(i+=Xn(o,r,a||void 0)+" ")}const s=t.pathRotation;return s&&(i+=Xn("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}=o;i.transformOrigin=`${t} ${e} ${n}`}}const Qi={offset:"stroke-dashoffset",array:"stroke-dasharray"},ts={offset:"strokeDashoffset",array:"strokeDasharray"};const es=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ns(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,h,c){if(Ji(t,a,h),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:u,style:d}=t;for(const t of es)void 0!==u[t]&&(d[t]=u[t],delete u[t]);(d.transform||u.transformOrigin)&&(d.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),d.transform&&(d.transformBox=c?.transformBox??"fill-box",delete u.transformBox),void 0!==e&&(u.x=e),void 0!==n&&(u.y=n),void 0!==i&&(u.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Qi:ts;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}(u,s,o,r,!1)}function is({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ss(t){return void 0===t||1===t}function os({scale:t,scaleX:e,scaleY:n}){return!ss(t)||!ss(e)||!ss(n)}const rs=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"];function as(t){return os(t)||hs(t)||ls(t)}function ls(t){return t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function hs(t){return cs(t.x)||cs(t.y)}function cs(t){return t&&"0%"!==t}function us(t,e,n){return n+e*(t-n)}function ds(t,e,n,i,s){return void 0!==s&&(t=us(t,s,i)),us(t,n,i)+e}function ps(t,e=0,n=1,i,s){t.min=ds(t.min,e,n,i,s),t.max=ds(t.max,e,n,i,s)}function ms(t,{x:e,y:n}){ps(t.x,e.translate,e.scale,e.originPoint),ps(t.y,n.translate,n.scale,n.originPoint)}const fs=.999999999999,ys=1.0000000000001;function gs(t,e){t.min+=e,t.max+=e}function vs(t,e,n,i,s=.5){ps(t,e,n,It(t.min,t.max,s),i)}function xs(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function ws(t,e,n){const i=n??t;vs(t.x,xs(e.x,i.x),e.scaleX,e.scale,e.originX),vs(t.y,xs(e.y,i.y),e.scaleY,e.scale,e.originY)}function Ss(t,e){return is(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))}const{schedule:Ts}=Jt(queueMicrotask,!1);const bs={};function Ps(t){return Ri(t)?t.get():t}const As=t=>"number"==typeof t?t:parseFloat(t),Es=Yi.length,Ms=t=>"number"==typeof t||wt.test(t);function Vs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ks=Cs(0,.5,N),Ds=Cs(.5,.95,P);function Cs(t,e,n){return i=>i<t?0:i>e?1:n(E(t,e,i))}function Rs(t,e){t.min=e.min,t.max=e.max}function Ls(t,e){Rs(t.x,e.x),Rs(t.y,e.y)}function Bs(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Fs(t){return t.max-t.min}function js(t,e,n,i=.5){t.origin=i,t.originPoint=It(e.min,e.max,t.origin),t.scale=Fs(n)/Fs(e),t.translate=It(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function Os(t,e,n,i){js(t.x,e.x,n.x,i?.originX),js(t.y,e.y,n.y,i?.originY)}function Is(t,e,n,i=0){const s=i?It(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Fs(e)}function Us(t,e,n,i=0){const s=i?It(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Fs(e)}function Ns(t,e,n,i){Us(t.x,e.x,n.x,i?.x),Us(t.y,e.y,n.y,i?.y)}function Ws(t,e,n,i,s){return t=us(t-=e,1/n,i),void 0!==s&&(t=us(t,1/s,i)),t}function zs(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){xt.test(e)&&(e=parseFloat(e),e=It(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=It(o.min,o.max,i);t===o&&(a-=e),t.min=Ws(t.min,e,n,a,s),t.max=Ws(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const $s=["x","scaleX","originX"],Ks=["y","scaleY","originY"];function Ys(t,e,n,i){zs(t.x,e,$s,n?.x,i?.x),zs(t.y,e,Ks,n?.y,i?.y)}const Xs=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Hs=Xs("applewebkit/")&&!Xs("chrome/")?Math.round:P;function _s(t){t.min=Hs(t.min),t.max=Hs(t.max)}const Gs=()=>({x:{min:0,max:0},y:{min:0,max:0}});function qs(t){return 0===t.translate&&1===t.scale}function Zs(t){return qs(t.x)&&qs(t.y)}function Js(t,e){return t.min===e.min&&t.max===e.max}function Qs(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function to(t,e){return Qs(t.x,e.x)&&Qs(t.y,e.y)}function eo(t){return Fs(t.x)/Fs(t.y)}function no(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class io{constructor(){this.members=[]}add(t){g(this.members,t);for(let e=this.members.length-1;e>=0;e--){const n=this.members[e];if(n===t||n===this.lead||n===this.prevLead)continue;const i=n.instance;i&&!1!==i.isConnected||n.snapshot||(v(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(v(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}function so(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const oo={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!wt.test(t))return t;t=parseFloat(t)}return`${so(t,e.target.x)}% ${so(t,e.target.y)}%`}},ro={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Ft.parse(t);if(s.length>5)return i;const o=Ft.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const h=It(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=h),"number"==typeof s[3+r]&&(s[3+r]/=h),o(s)}},ao={borderRadius:Object.assign({},oo,{applyTo:Yi.slice()}),borderTopLeftRadius:oo,borderTopRightRadius:oo,borderBottomLeftRadius:oo,borderBottomRightRadius:oo,boxShadow:ro};function lo(t){return[t("x"),t("y")]}const ho=(t,e)=>t.depth-e.depth;class co{constructor(){this.children=[],this.isDirty=!1}add(t){g(this.children,t),this.isDirty=!0}remove(t){v(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ho),this.isDirty=!1,this.children.forEach(t)}}const uo={hasAnimatedSinceResize:!0,hasEverUpdated:!1},po=["z","skew","skewZ"];let mo=0;function fo(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const yo=t=>t.instance&&_n.get(t.instance)?.demote()&&t.resetSkewAndRotation();function go(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Fi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Qt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&go(i)}function vo(t){if(t)return!1!==t.options.allowProjection?t.projection:vo(t.parent)}function xo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return Object.assign(bs,{...ao,...bs}),class{static create(t,e,n){const{layoutId:i,layout:s,drag:o,dragConstraints:r,layoutScroll:a,layoutRoot:l,layoutAnchor:h,layoutCrossfade:c}=e,u=t.projection=new this(t.latestValues,e["data-framer-portal-id"]?void 0:vo(t.parent));var d;u.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:Boolean(o)||r&&(d=r,d&&"object"==typeof d&&Object.prototype.hasOwnProperty.call(d,"current")),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:n,crossfade:c,layoutScroll:a,layoutRoot:l,layoutAnchor:h});const p=u.getStack()?.lead;p&&!u.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}constructor(t={},n=e?.()){this.id=mo++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(To),this.nodes.forEach(Ro),this.nodes.forEach(Lo),this.nodes.forEach(bo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new co)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new M),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){this.eventHandlers.get(t)?.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var n;this.isSVG=Xi(e)&&!(Xi(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent?.children.add(this),this.root.hasTreeAnimated&&(s||i)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;Qt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n?.(),n=function(t,e){const n=J.now();t=Gi(t);const i=({timestamp:s})=>{const o=s-n;o>=e&&(te(i),t(o-e))};return Qt.setup(i,!0),_i(()=>te(i))}(s,250),uo.hasAnimatedSinceResize&&(uo.hasAnimatedSinceResize=!1,this.nodes.forEach(Co)))})}i&&this.root.registerSharedNode(i,this),this.addLayoutListener()}addLayoutListener(){const{layoutId:t,layout:e,visualElement:n,animate:i}=this.options;this.instance&&!this.hasLayoutListener&&!1!==i&&n&&(t||e)&&(this.hasLayoutListener=!0,this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isAnimationBlocked)return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||n.getDefaultTransition()||Uo,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!to(this.targetLayout,s),h=!e&&i;if(this.options.layoutRoot||this.resumeFrom||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...gi(o,"layout"),onPlay:r,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,h,e.path)}else e||Co(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,te(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(Bo),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void this.options.onExitComplete?.();if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&go(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;yo(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,yo(e),"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1),e.isAnimationBlocked&&(e.dragSnapshot||(e.dragSnapshot=e.measure()),this.dragAncestor=e)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(Eo),void this.nodes.forEach(Ao)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Mo);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Vo),this.nodes.forEach(ko),this.nodes.forEach(Do),this.nodes.forEach(wo),this.nodes.forEach(So)):this.nodes.forEach(Mo),this.clearAllSnapshots();const t=J.now();G.delta=x(0,1e3/60,t-G.timestamp),G.timestamp=t,G.isProcessing=!0,ee.update.process(G),ee.preRender.process(G),ee.render.process(G),G.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ts.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Po),this.sharedNodes.forEach((t,e)=>t.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Qt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Qt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Fs(this.snapshot.measuredBox.x)||Fs(this.snapshot.measuredBox.y)||(this.snapshot=void 0),this.snapshot)){const{visualElement:t}=this.options,e="running"===this.currentAnimation?.state,n=e&&this.animationEdges;e&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);const i=n&&this.motionValue?.getVelocity()||0,s=[0,1,2,3,4,5].map(e=>(e<4?n&&(this.edgeValues?this.edgeVelocity(e):-n[e]*i/1e3):t?.getValue(e<5?"x":"y")?.getVelocity())||0);s.some(Boolean)&&(this.snapshot.velocity=s)}}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e?.notify("LayoutMeasure",this.layout.layoutBox,t?.layoutBox)}updateScroll(t="measure"){const{scroll:e,instance:s}=this,{animationId:o}=this.root;if(this.options.layoutScroll&&s&&(!e||e.animationId!==o||e.phase!==t)){const r=i(s);this.scroll={animationId:o,phase:t,isRoot:r,offset:n(s),wasRoot:e?e.isRoot:r}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;t&&yo(this);const e=this.projectionDelta&&!Zs(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||as(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),_s((i=n).x),_s(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(zo))){const{scroll:t}=this.root;t&&(gs(e.x,t.offset.x),gs(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Ls(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&Ls(e,t),gs(e.x,s.offset.x),gs(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n,i,s=0){const o=n||{x:{min:0,max:0},y:{min:0,max:0}};Ls(o,t);for(let t=s;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(gs(o.x,-n.scroll.offset.x),gs(o.y,-n.scroll.offset.y)),as(n.latestValues)&&ws(o,n.latestValues,n.layout?.layoutBox)}return!i&&as(this.latestValues)&&ws(o,this.latestValues,this.layout?.layoutBox),o}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Ls(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!as(n.latestValues))continue;let i;n.instance&&(os(n.latestValues)&&n.updateSnapshot(),i=Gs(),Ls(i,n.measurePageBox())),Ys(e,n.latestValues,n.snapshot?.layoutBox,i)}return as(this.latestValues)&&Ys(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==G.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(!this.layout||!i&&!s)return;this.resolvedRelativeTargetAt=G.timestamp;const o=this.getClosestProjectingParent();var r,a,l,h;(this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&o&&o.layout?this.createRelativeTarget(o,this.layout.layoutBox,o.layout.layoutBox):this.removeRelativeTarget()),this.relativeTarget||this.targetDelta)&&(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,a=this.relativeTarget,l=this.relativeParent.target,h=this.options.layoutAnchor||void 0,Is(r.x,a.x,l.x,h?.x),Is(r.y,a.y,l.y,h?.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target,!0):Ls(this.target,this.layout.layoutBox),ms(this.target,this.targetDelta)):Ls(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&(!o.resumingFrom==!this.resumingFrom||o.options.layoutRoot&&!o.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(this.parent&&!os(this.parent.latestValues)&&!hs(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ns(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),Ls(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===G.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;Ls(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++)o=n[a],r=o.projectionDelta,"contents"!==o.options.visualElement?.props.style?.display&&(!0===i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(gs(t.x,-o.scroll.offset.x),gs(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,ms(t,r)),i&&(i.path?.[a]||i)!==o&&as(o.latestValues)&&ws(t,o.latestValues,o.layout?.layoutBox));e.x<ys&&e.x>fs&&(e.x=1),e.y<ys&&e.y>fs&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e&&(!(t.relativeTarget&&!t.relativeParent.resumingFrom)||t.relativeParent)),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Bs(this.prevProjectionDelta.x,this.projectionDelta.x),Bs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Os(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&no(this.projectionDelta.x,this.prevProjectionDelta.x)&&no(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){this.options.visualElement?.scheduleRender(),t&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},o={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const a={x:{min:0,max:0},y:{min:0,max:0}},l=i?.source!==this.layout?.source,h=this.getStack(),c=!h||h.members.length<=1,u=Boolean(l&&!c&&!0===this.options.crossfade&&!this.path.some(Io));let d;this.animationProgress=0;const p=n?.interpolateProjection(t),m=this.layout?.layoutBox;let f=m&&[m.x.min,m.x.max,m.y.min,m.y.max].map((e,n)=>{const{translate:i,scale:s,originPoint:o}=t[n<2?"x":"y"];return(e-o)*(s-1)+i});f?.every(isFinite)||(f=void 0),this.animationEdges=f,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;const y=i?.velocity,g=i?.relativeVelocity||y;if(g?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=g),y&&f){const e=y.slice(0,4).map((t,e)=>t+(l?y[4+(e>>1)]:0));e.some(Boolean)&&(this.startVelocity=p?((t,e,{x:n,y:i})=>{const s=t*t+e*e;return s<1?0:-1e3*(n*t+i*e)/s})(t.x.translate,t.y.translate,{x:(e[0]+e[1])/2,y:(e[2]+e[3])/2}):e)}this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n),h=this.edgeValues;for(let e=0;e<2;e++){const i=e?"y":"x";h?Fo(r[i],t[i],this.layout.layoutBox[i],h[2*e],h[2*e+1]):jo(r[i],t[i],n)}if(i&&(r.x.translate=i.x,r.y.translate=i.y),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){Ns(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);const t=this.relativeTargetOrigin,e=a;if(function(t,e,n,i){Oo(t.x,e.x,n.x,i),Oo(t.y,e.y,n.y,i)}(this.relativeTarget,t,e,n),this.isSpringLayout){const t=this.relativeTarget,e=this.impulse||0,n=this.relativeStart,i=J.now(),s=(i-this.relativeTime)/1e3;this.relativeTime=i;const o=this.relativeVelocity||(this.relativeVelocity=[0,0,0,0]);for(let i=0;i<4;i++){const r=i<2?"x":"y",a=1&i?"max":"min";n&&(t[r][a]+=n[i]*e),d&&s>0&&(o[i]=(t[r][a]-d[r][a])/s)}}d&&(m=this.relativeTarget,f=d,Js(m.x,f.x)&&Js(m.y,f.y))&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Ls(d,this.relativeTarget)}var m,f;l&&(this.animationValues=o,function(t,e,n,i,s,o){s?(t.opacity=It(0,n.opacity??1,ks(i)),t.opacityExit=It(e.opacity??1,0,Ds(i))):o&&(t.opacity=It(e.opacity??1,n.opacity??1,i));for(let s=0;s<Es;s++){const o=Yi[s];let r=Vs(e,o),a=Vs(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||Ms(r)===Ms(a)?(t[o]=Math.max(It(As(r),As(a),i),0),(xt.test(a)||xt.test(r))&&(t[o]+="%")):t[o]=a)}for(let s=0;s<rs.length;s++){const o=rs[s];(e[o]||n[o])&&(t[o]=It(e[o]||0,n[o]||0,i))}}(o,s,this.latestValues,n,u,c)),void 0!==i?.rotate&&(this.animationValues||(this.animationValues=o),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart");const e=this.isSpringLayout="spring"===t.type;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&(te(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qt.update(()=>{uo.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=fi(0)),this.motionValue.jump(0,!1);const n=this.startVelocity;this.startVelocity=void 0;let i=t,s=0;if(e){if("auto"===t.mass){const e=this.layout?.layoutBox;i=((t,e=300)=>{const n=x(.25,2,e/300),{stiffness:i,damping:s}=me({...t,duration:t.duration&&V(t.duration)});return{...t,stiffness:i,damping:s*Math.sqrt(n),mass:n}})(t,e&&Math.sqrt(Fs(e.x)*Fs(e.y)))}const e=this.relativeStart;if((n||e)&&!t.repeat)if("number"==typeof n)s=n;else{const t=n&&this.animationEdges;i={...i,type:i=>{const s=[i.velocity,...n||[]].map((e,n)=>ye({...i,keyframes:n?[t[n-1],0]:i.keyframes,velocity:e})),o=s.length;e&&s.push(ye({...i,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let r=0;const a=[],l={calculatedDuration:null,next:e=>{r=e;const n=s[0].next(e);let i=n.done;for(let t=1;t<s.length;t++){const{value:n,done:r}=s[t].next(e);t<o?a[t-1]=n:this.impulse=n/1e3,i=i&&r}return t&&(this.edgeValues=a),n.done=i,n}};return l.calculatedDuration=oe(l),l.next(0),this.edgeVelocity=t=>s[t+1].velocity(r),l}}}}const o=function(t,e,n){const i=Ri(t)?t:fi(t);return i.run(bi("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...i,velocity:s,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}});this.currentAnimation=o,function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Ee("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&Wo(this.options.animationType,this.layout.layoutBox,n.layoutBox)){const{layoutBox:t}=this.layout,e=s;s=this.target||{x:{min:0,max:0},y:{min:0,max:0}},No(s.x,e.x,t.x),No(s.y,e.y,t.y)}Ls(e,s),ws(e,i),Os(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new io);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;const{latestValues:e}=t;if(!ls(e))return;const n={};for(let e=0;e<po.length;e++)fo(po[e],t,n,this.animationValues);for(let e=0;e<rs.length;e++)fo(rs[e],t,n,this.animationValues);t.render();for(const e in n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;const n=this.getLead();if(!this.isVisible&&n!==this)return void(t.visibility="hidden");const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Ps(e?.pointerEvents)||"",void(t.transform=i?i(this.latestValues,""):"none");if(!this.projectionDelta||!this.layout||!n.target)return(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,t.visibility="",t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Ps(e?.pointerEvents)||""),void(this.hasProjected&&!as(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;(s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `);let a="";if(n){const{transformPerspective:t}=n;t&&(i=`perspective(${t}px) ${i}`);for(let t=0;t<rs.length;t++){const e=rs[t],i=n[e];i&&(a+=`${e}(${i}deg) `),!t&&n.pathRotation&&(a+=`rotate(${n.pathRotation}deg) `)}}if(a){1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),i+=a;const n=t.x.scale*e.x,s=t.y.scale*e.y;1===n&&1===s||(i+=`scale(${n}, ${s})`)}else 1!==t.x.scale||1!==t.y.scale?i+=`scale(${t.x.scale}, ${t.y.scale})`:i||1===e.x&&1===e.y||(i="scale(1, 1)");return i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s);i&&(o=i(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in bs){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=bs[e],l="none"===o?s[e]:i(s[e],n);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=n===this?Ps(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(Ao),this.root.sharedNodes.clear()}}}function wo(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.isAnimationBlocked&&n.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;lo(t=>gs(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function So(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source,r=(i,o)=>{if("size"===s)lo(t=>{const e=Fs(i[t]);i[t].min=o[t].min,i[t].max=i[t].min+e});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Rs(i[t],o[t])}else Wo(s,e.layoutBox,n)&&lo(e=>{const n=Fs(o[e]);i[e].max=i[e].min+n,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[e].max=t.relativeTarget[e].min+n)})},a=o?e.measuredBox:e.layoutBox;r(a,n);const l={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Os(l,n,e.layoutBox);const h={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Os(h,o?t.applyTransform(i,!0):n,a);const c=!Zs(l);let u=!1;const d=t.getClosestProjectingParent();if((!o||d?.options.layoutRoot&&t.resumeFrom?.path.includes(d))&&d&&!d.resumeFrom){const{snapshot:i,layout:s}=d;if(i&&s){const a=t.options.layoutAnchor||void 0,l={x:{min:0,max:0},y:{min:0,max:0}};Ns(l,o?t.resumeFrom.applyTransform(e.layoutBox,!0,void 0,!0,d.depth+1):e.layoutBox,i.layoutBox,a);const h={x:{min:0,max:0},y:{min:0,max:0}};Ns(h,n,s.layoutBox,a),o&&r(l,h),to(l,h)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=h,t.relativeTargetOrigin=l,t.relativeParent=d)}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:h,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else t.isLead()&&t.options.onExitComplete?.();t.options.transition=void 0}function To(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function bo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Po(t){t.clearSnapshot()}function Ao(t){t.clearMeasurements()}function Eo(t){t.isLayoutDirty=!0,t.updateLayout()}function Mo(t){t.isLayoutDirty=!1}function Vo(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function ko(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function Do(t){const{visualElement:e}=t.options;e?.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Co(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Ro(t){t.resolveTargetDelta()}function Lo(t){t.calcProjection()}function Bo(t){t.resetSkewAndRotation()}function Fo(t,e,n,i,s){const o=n.max-n.min,r=o?Math.max(0,(o+s-i)/o):1,a=t.originPoint=e.originPoint;t.origin=e.origin,t.scale=r,t.translate=n.min+i-(a+(n.min-a)*r)}function jo(t,e,n){t.translate=It(e.translate,0,n),t.scale=It(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Oo(t,e,n,i){t.min=It(e.min,n.min,i),t.max=It(e.max,n.max,i)}function Io(t){return void 0!==t.animationValues?.opacityExit}const Uo={duration:.45,ease:[.4,0,.1,1]};function No(t,e,n){t.max=Fs(n)+(t.min=e.min)}function Wo(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=eo(e),s=eo(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function zo(t){return t!==t.root&&t.scroll?.wasRoot}function $o(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const Ko=xo({attachResizeListener:(t,e)=>$o(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Yo={current:void 0},Xo=xo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Yo.current){const t=new Ko({});t.mount(window),t.setOptions({layoutScroll:!0}),Yo.current=t}return Yo.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),Ho=new WeakMap;function _o(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Go(t){return"string"==typeof t||Array.isArray(t)}const qo=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","whilePinch","exit"],Zo=["initial"].concat(qo);function Jo(t){if(_o(t.animate))return!0;for(let e=0;e<Zo.length;e++)if(Go(t[Zo[e]]))return!0;return!1}function Qo(t){return Boolean(Jo(t)||t.variants)}const tr={current:null},er={current:!1},nr="undefined"!=typeof window;const ir=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let sr={};function or(t){sr=t}class rr{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=xn,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=J.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,Qt.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=Jo(e),this.isVariantNode=Qo(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==l[t]&&Ri(e)&&e.set(l[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,Ho.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:(er.current||function(){if(er.current=!0,nr)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>tr.current=t.matches;t.addEventListener("change",e),e()}else tr.current=!1}(),this.shouldReduceMotion=tr.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),te(this.notifyUpdate),te(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&&jn.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new Dn({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:V(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=sn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&Qt.preRender(this.notifyUpdate),n&&(this.projection&&(this.projection.isTransformDirty=!0),_n.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 sr){const e=sr[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)&&_n.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ir.length;e++){const n=ir[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],o=n[i];if(Ri(s))t.addValue(i,s);else if(Ri(o))t.addValue(i,fi(s,{owner:t}));else if(o!==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,fi(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=fi(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&&(S(n)||b(n))?n=parseFloat(n):"number"!=typeof n&&!Ft.test(n)&&Ft.test(e)&&(n=Xe(t,e)),this.setBaseTarget(t,Ri(n)?n.get():n)),Ri(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,e){return(this.events[t]||(this.events[t]=new M)).add(e)}notify(t,...e){this.events[t]?.notify(...e)}scheduleRenderMicrotask(){Ts.render(this.render)}}class ar extends rr{constructor(){super(...arguments),this.KeyframeResolver=Ki}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;Ri(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function lr(t,{style:e,vars:n},i,s){const o=t.style;let r;for(r in e)o[r]=e[r];for(r in s?.applyProjectionStyles(o,i),n)o.setProperty(r,n[r])}function hr(t,{layout:e,layoutId:n}){return sn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!bs[t]||"opacity"===t)}function cr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(Ri(i[e])||s&&Ri(s[e])||hr(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class ur extends ar{constructor(){super(...arguments),this.type="html",this.renderInstance=lr}mount(t){super.mount(t)}readValueFromInstance(t,e){if(sn.has(e))return this.projection?.isProjecting?tn(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return en(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(et(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Ss(t,e)}build(t,e,n){Ji(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return cr(t,e,n)}}const dr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function pr(t){return{point:{x:t.pageX,y:t.pageY}}}function mr(t,e,n,i){return $o(t,e,(t=>e=>dr(e)&&t(e,pr(e)))(n),i)}const fr=new WeakMap;let yr;const gr=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Xi(i)&&"getBBox"in i?i.getBBox()[e]:i[n],vr=gr("inline","width","offsetWidth"),xr=gr("block","height","offsetHeight");function wr({target:t,borderBoxSize:e}){fr.get(t)?.forEach(n=>{n(t,{get width(){return vr(t,e)},get height(){return xr(t,e)}})})}function Sr(t){t.forEach(wr)}function Tr(t,e){yr||"undefined"!=typeof ResizeObserver&&(yr=new ResizeObserver(Sr));const n=qi(t);return n.forEach(t=>{let n=fr.get(t);n||(n=new Set,fr.set(t,n)),n.add(e),yr?.observe(t)}),()=>{n.forEach(t=>{const n=fr.get(t);n?.delete(e),n?.size||yr?.unobserve(t)})}}const br=new Set;let Pr;function Ar(t){return br.add(t),Pr||(Pr=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};br.forEach(e=>e(t))},window.addEventListener("resize",Pr)),()=>{br.delete(t),br.size||"function"!=typeof Pr||(window.removeEventListener("resize",Pr),Pr=void 0)}}function Er(t,e){return _i("function"==typeof t?Ar(t):Tr(t,e))}const Mr=(t,e)=>Math.abs(t-e);const Vr=new Set(["auto","scroll"]);class kr{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r,immediate:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Cr(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Lr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Mr(t.x,e.x),i=Mr(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t;this.history.push({...i,timestamp:J.now()});const{onStart:s,onMove:o}=this.handlers;e||(s?.(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o?.(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.handleScroll(window),this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Cr(e,this.transformPagePoint),this.hasPendingMove=!0,Qt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s?.(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Lr("pointercancel"===t.type?this.lastMoveEventInfo:Cr(e,this.transformPagePoint),this.history);this.startEvent&&n?.(t,o),i?.(t,o)},!dr(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=a?0:o,this.contextWindow=i||window;const l=pr(t),h=Cr(l,this.transformPagePoint),{point:c}=h;this.history=[{...c,timestamp:J.now()}];const{onSessionStart:u}=e;u&&u(t,Lr(h,this.history));const d={passive:!0,capture:!0};this.removeListeners=A(mr(this.contextWindow,"pointermove",this.handlePointerMove,d),mr(this.contextWindow,"pointerup",this.handlePointerUp,d),mr(this.contextWindow,"pointercancel",this.handlePointerUp,d)),r&&this.startScrollTracking(r),a&&(this.handlePointerMove(t,l),this.updatePoint())}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(Vr.has(t.overflowX)||Vr.has(t.overflowY))&&this.scrollPositions.set(e,Dr(e)),e=e.parentElement}this.scrollPositions.set(window,Dr(window)),this.removeScrollListeners=A($o(window,"scroll",this.onElementScroll,{capture:!0}),$o(window,"scroll",this.onWindowScroll,{}))}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=Dr(t),s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),Qt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),te(this.updatePoint)}}const Dr=t=>t===window?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop};function Cr(t,e){return e?{point:e(t.point)}:t}function Rr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Lr({point:t},e){return{point:t,delta:Rr(t,Fr(e)),offset:Rr(t,Br(e)),velocity:jr(e,.1)}}function Br(t){return t[0]}function Fr(t){return t[t.length-1]}function jr(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Fr(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>V(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*V(e)&&(i=t[1]);const o=k(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}const Or=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Ir=new Set(["INPUT","SELECT","TEXTAREA"]);const Ur={x:!1,y:!1};function Nr(){return Ur.x||Ur.y}function Wr(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function zr(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const $r=.35;function Kr(t,e,n){return{min:Yr(t,e),max:Yr(t,n)}}function Yr(t,e){return"number"==typeof t?t:t[e]||0}function Xr(t){let e="";for(const n of t.path){n.scroll=void 0,n.updateScroll();const{scroll:i}=n;n!==t.root&&i&&(e+=i.offset.x+","+i.offset.y+",")}return e}const Hr=new WeakMap;class _r{constructor(t,e=()=>t.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t,this.readProps=e}start(t,e={}){if(!1===this.visualElement.presenceContext?.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new kr(t,{onSessionStart:t=>{e.snapToCursor&&this.snapToCursor(t),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragConstraints:i,dragPropagation:s,onDragStart:o}=this.getProps();if(n&&!s&&(this.openDragLock?.(),this.openDragLock="x"===(r=n)||"y"===r?Ur[r]?null:(Ur[r]=!0,()=>{Ur[r]=!1}):Ur.x||Ur.y?null:(Ur.x=Ur.y=!0,()=>{Ur.x=Ur.y=!1}),!this.openDragLock))return;var r;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();const{projection:a}=this.visualElement;a&&(a.isAnimationBlocked=!0,a.target=void 0),lo(t=>{let e=this.getAxisMotionValue(t).get()||0;if(it(e)&&(e=Ai(e,this.visualElement.current)||0),wt.test(e))e=parseFloat(e);else if(xt.test(e)){const n=a?.layout?.layoutBox[t];n&&(e=Fs(n)*(parseFloat(e)/100))}this.originPoint[t]=e}),this.point="function"==typeof i&&i(this),o&&Qt.update(()=>o(t,e),!1,!0),Li(this.visualElement,"transform"),this.visualElement.animationState?.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection){if(this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),null===this.currentDirection)return;s&&s(this.currentDirection)}this.updateAxis("x",r),this.updateAxis("y",r),this.point&&this.point.move(),this.visualElement.render(),o&&Qt.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints||this.point)&&this.startAnimation({x:0,y:0})}},{...e,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(t,e,n){const i=t||this.latestPointerEvent,s=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r,n);const{onDragEnd:a}=this.getProps();a&&Qt.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e?.setActive("whileDrag",!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(t,e){const{drag:n}=this.readProps();if(!e||!Jr(t,n,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+e[t];const o=this.constraints&&this.constraints[t];o&&(s=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?It(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?It(n,t,i.max):Math.min(t,n)),t}(s,o,this.elastic[t])),this.point?this.point[t]=s:i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{projection:n}=this.visualElement,i=n&&(n.layout||n.measure(!1)),s=this.constraints;Gr(t)?this.constraints&&this.scroll===Xr(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i||"object"!=typeof t)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Wr(t.x,n,s),y:Wr(t.y,e,i)}}(i.layoutBox,t),this.elastic=function(t=$r){return!1===t?t=0:!0===t&&(t=$r),{x:Kr(t,"left","right"),y:Kr(t,"top","bottom")}}(e),s!==this.constraints&&!Gr(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&lo(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!Gr(t))return!1;const n=qr(t),{projection:i}=this.visualElement;if(!i||!i.layout)return!1;this.scroll=Xr(i);const s=function(t,e,n){const i=Ss(t,n),{scroll:s}=e;return s&&(gs(i.x,s.offset.x),gs(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:zr(t.x,e.x),y:zr(t.y,e.y)}}(i.layout.layoutBox,i.removeElementScroll(s));if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=is(t))}return o}startAnimation(t,e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l={bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o},h=s=>!i||this.point&&r||!Jr(s,e||n,this.currentDirection)?0:t[s];if(this.point&&!r)return this.point.release({x:h("x"),y:h("y")},l).then(a);const c=this.constraints||{},u=lo(t=>{if(!Jr(t,e||n,this.currentDirection))return;let i=c[t]||{};!0!==r&&r!==t||(i={min:0,max:0});const s={type:"inertia",velocity:h(t),...l,...i};return this.startAxisValueAnimation(t,s)});return Promise.all(u).then(a)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Li(this.visualElement,t),n.start(bi(t,n,0,e,this.visualElement,!1))}stopAnimation(){lo(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.readProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:e}){const{drag:n}=this.getProps(),i={x:t,y:e},s=this.visualElement.getTransformPagePoint()?.(i)||i,o=this.visualElement.measureViewportBox();lo(t=>{if(!Jr(t,n,this.currentDirection))return;const e=this.getAxisMotionValue(t),{min:i,max:r}=o[t];e.set((e.get()||0)+s[t]-It(i,r,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Gr(e)||!n||!this.constraints)return;this.stopAnimation();const i=this.constraints,s={x:0,y:0};lo(t=>{const e=this.getAxisMotionValue(t).get();s[t]=function(t,e){let n=.5;const i=Fs(t),s=Fs(e);return s>i?n=E(e.min,e.max-i,t.min):i>s&&(n=E(t.min,t.max-s,e.min)),x(0,1,n)}({min:e,max:e},i[t])});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root?.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),lo(e=>{const n=this.getAxisMotionValue(e);if(!Jr(e,t,null)||!n.get())return;const{min:i,max:o}=this.constraints[e];n.set(It(i,o,s[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Hr.set(this.visualElement,this);const t=this.visualElement.current,e=mr(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&function(t){return Ir.has(t.tagName)||!0===t.isContentEditable}(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps(),i=Gr(e)&&qr(e);i&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=Er(t,Zr(n)),s=Er(e,Zr(n));return()=>{i(),s()}}(t,i,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s.layout||(s.root?.updateScroll(),s.updateLayout()),Qt.read(i);const r=$o(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(lo(e=>{if(!Jr(e,this.getProps().drag,this.currentDirection))return;const n=this.getAxisMotionValue(e);this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate)}),this.visualElement.render())});return()=>{r(),e(),o(),a(),n?.()}}getProps(){const t=this.readProps(),{dragElastic:e=$r,dragMomentum:n=!0}=t;return{...t,dragElastic:e,dragMomentum:n}}}function Gr(t){return!!t&&"object"==typeof t&&("current"in t||"nodeType"in t)}const qr=t=>"current"in t?t.current:t;function Zr(t){let e=!0;return()=>{e?e=!1:t()}}function Jr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Qr(t,e){const n=qi(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},_i(()=>i.abort())]}function ta(t,e,n={}){e=Gi(e);const[i,s,o]=Qr(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||Nr())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 ea=(t,e)=>!!e&&(t===e||ea(t,e.parentElement)),na=new WeakSet;function ia(t){return e=>{"Enter"===e.key&&t(e)}}function sa(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const oa=new WeakSet,ra=(t,e,n)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)>n,aa=t=>t.preventDefault();function la(t,e,n={}){e=Gi(e);const[i,s,o]=Qr(t,n),r=new WeakMap,a=t=>{const i=t.currentTarget;if(!dr(t)||Nr())return;if(oa.has(t))return;n.stopPropagation&&oa.add(t);const{count:o=1,countTimeout:a=.3,hold:l=0,repeat:h}=n,c=J.now(),u=V(l),d=V(a);let p=r.get(i);p?.expire(ra(p.event,t,100))?p=void 0:p&&(te(p.expire),r.delete(i));const m=p?p.count+1:1,f=m>=o,y=f&&(l||h);let g,v=!l,x=0;if(na.add(i),p)g=p.handlers;else{const n=e(i,t);g="function"==typeof n?{onComplete:n}:n||{}}f&&v&&g.onActive?.();const w=V(h);let S=u||w,T=c+S,b=!0;const P=()=>{if(s.signal.aborted)return te(P);let t=Math.min(1-(T-J.now())/S,1);b&&t<1&&(t=0),b=!1,g.onHold?.(t),t<1||(v?g.onRepeat?.(++x):(v=!0,g.onActive?.()),h?(b=!0,T+=S=w):te(P))},A={...s,capture:!0},E=(e,n)=>{if(dr(e))if(window.removeEventListener("pointerup",M,A),window.removeEventListener("pointercancel",k,A),window.removeEventListener("pointermove",D,A),i.removeEventListener("contextmenu",aa),te(P),na.delete(i),Nr()&&(n=!1),n&&!f){const n=J.now(),o=t=>{const a=s.signal.aborted;if(a||!0===t||J.now()-n>d)return te(o),r.delete(i),a||g.onComplete?.(e,{success:!1}),!0};r.set(i,{count:m,event:t,handlers:g,expire:o}),Qt.update(o,!0)}else g.onComplete?.(e,{success:n&&v})},M=t=>{E(t,i===window||i===document||n.useGlobalTarget||ea(i,t.target))},k=t=>{E(t,!1)},D=e=>{dr(e)&&((h||!v)&&ra(t,e,8)||o>1&&Nr())&&k(e)};window.addEventListener("pointerup",M,A),window.addEventListener("pointercancel",k,A),(y||o>1)&&window.addEventListener("pointermove",D,A),y&&(Qt.update(P,!0),i.addEventListener("contextmenu",aa,{...s,passive:!1}))};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",a,s),T(e=t)&&"offsetHeight"in e&&!("ownerSVGElement"in e)&&(t.addEventListener("focus",()=>((t,e)=>{let n=!1;const i=ia(()=>{n||na.has(t)||(n=!0,sa(t,"down"))}),s=ia(()=>{n&&(n=!1,sa(t,"up"))});t.addEventListener("keydown",i,e),t.addEventListener("keyup",s,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",i),t.removeEventListener("keyup",s),n&&sa(t,"cancel")},{...e,once:!0})})(t,s),s),function(t){return Or.has(t.tagName)||!0===t.isContentEditable}(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}class ha{constructor(t){this.isMounted=!1,this.node=t}update(){}}const ca=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"]),ua=t=>"string"==typeof t&&"svg"===t.toLowerCase();function da(t,e,n){const i=cr(t,e,n);for(const n in t)if("children"!==n&&(Ri(t[n])||Ri(e[n]))){i[-1!==nn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class pa extends ar{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Gs}getBaseTargetFromProps(t,e){return sn.has(e)?super.getBaseTargetFromProps(t,e)??tn(e):t[e]}getDefaultValue(t){return sn.has(t)?this.latestValues[t]??tn(t):void 0}readValueFromInstance(t,e){if(sn.has(e)){const t=We(e);return t&&t.default||0}if(es.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=ca.has(e)?e:Zi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return da(t,e,n)}build(t,e,n){ns(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){lr(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(ca.has(n)?n:Zi(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=ua(t.tagName),super.mount(t)}}function ma(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 fa=[...qo].reverse(),ya=t=>!0===t?.out?t:t?.out;function ga(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=>Ui(t,e,n))):"string"==typeof e?Ui(t,e,n):Promise.all(Ii(t,Mi(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}(t,e,n))),n=va(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,{initial:h}=r,c=i||s,u=[],d=(e=h)=>"boolean"!=typeof e&&Mi(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom)||void 0,p=new Map;let m={},f=1/0,y=t;do{y=!1!==y.props.inherit&&y.parent}while(y&&!y.isControllingVariants);const g=c&&ya(d(h??(y&&y.props.initial))?.transition);if(fa.forEach((e,i)=>{const s=n[e],h=r[e],d=y&&y.props[e],v=void 0!==h?h:Go(d)||!1===d?d:void 0,x=Go(v),w=e===o?s.isActive:null,S=x&&void 0===h&&!(c&&l);if(s.protectedKeys={...m},!s.isActive&&null===w||!v&&!s.prevProp||_o(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!ma(e,t);return!1}(s.prevProp,v);let b=T||x&&(w&&!S||i>f),P=!1;const A=Array.isArray(v)?v:[v];let E,M={};if(!1!==w)for(const n of A){const{transition:i,transitionEnd:s,...o}=Mi(t,n,Vi(t,e))||{};M={...M,...o,...s},E=ya(i)||E}const{prevResolvedValues:V}=s;for(const e in{...V,...M}){if(e in m)continue;const n=M[e],i=V[e],o=Array.isArray(n)&&Array.isArray(i)?!ma(n,i)||T:n!==i;let r;if(o&&null==n)p.has(e)||p.set(e,s.prevOut);else if(o||void 0!==n&&p.has(e)){b=!0,r=p.get(e)||g,p.delete(e)&&(P=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0;s.out[e]=r}if(s.prevProp=v,s.prevResolvedValues=M,s.prevOut=E,s.isActive&&(m={...m,...M}),b&&(!S||!T||P))for(const n of A){const i={type:e};if("string"==typeof n&&c&&l&&a?.enteringChildren){const e=Mi(a,n)?.transition?.delayChildren;i.delay=pi(a.enteringChildren,t,e)}u.push({animation:n,options:i})}}),p.size){const e={},n=d();let i=n?.transition;p.forEach((s,o)=>{s&&(i={...i||t.getDefaultTransition(),[o]:s});const a=t.getValue(o);a&&(a.liveStyle=!0);const l=n&&!Array.isArray(h)?n[o]:void 0,c=t.getBaseTargetFromProps(r,o);e[o]=(void 0!==l?l:void 0===c||Ri(c)?void 0===t.initialValues[o]?t.baseTarget[o]:void 0:c)??null}),i&&(e.transition=i),u.push({animation:e})}const v=c&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!v&&u.length?e(u):Promise.resolve()}return{animateChanges:o,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=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=va(),s=!0}}}function va(){const t={};for(const e of qo)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return t}const xa=n({}),wa=n({strict:!1}),Sa=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ta=n({});function ba(t){const{initial:e,animate:n}=function(t,e){if(Jo(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Go(e)?e:void 0,animate:Go(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,i(Ta));return s(()=>({initial:e,animate:n}),[Pa(e),Pa(n)])}function Pa(t){return Array.isArray(t)?t.join(" "):t}const Aa=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ea(t,e,n){for(const i in e)Ri(e[i])||hr(i,n)||(t[i]=e[i])}function Ma(t,e){const n={};return Ea(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},e){return s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Ji(n,e,t),Object.assign({},n.vars,n.style)},[e])}(t,e)),n}function Va(t,e){const n={},i=Ma(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 ka=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Da(t,e,n,i){const o=s(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return ns(n,e,ua(i),t.transformTemplate,t.style),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};return Ea(e,t.style,t),{...o,style:{...e,...o.style}}}return o}const Ca=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 Ra(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ca.has(t)}function La(t,e){return t.startsWith("on")?!Ra(t):e?.(t)??!Ra(t)}const Ba=["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 Fa(t){return"string"==typeof t&&!t.includes("-")&&!!(Ba.indexOf(t)>-1||/[A-Z]/u.test(t))}function ja(t,e,n,{latestValues:i},a,l=!1,h,c){const u=(h??Fa(t)?Da:Va)(e,i,a,t),d=function(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||Ri(t[o])||("fx"!==o?(La(o,i)||!0===n&&Ra(o)||!e&&!Ra(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]):t.fx&&(s.fx=""));return s}(e,"string"==typeof t,l,c),p=t!==o?{...d,...u,ref:n}:{},{children:m}=e,f=s(()=>Ri(m)?m.get():m,[m]);return r(t,{...p,children:f})}const Oa=n(null);function Ia(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}function Ua(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=Ps(o[t]);let{initial:r,animate:a}=t;const l=Jo(t),h=Qo(t);e&&h&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===r;const u=c?a:r;if(u&&"boolean"!=typeof u&&!_o(u)){const e=Array.isArray(u)?u:[u];for(let n=0;n<e.length;n++){const i=Ei(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 Na=t=>(e,n)=>{const s=i(Ta),o=i(Oa),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Ua(n,i,s,t),renderState:e()}}(t,e,s,o);return n?r():Ia(r)},Wa=Na({scrapeMotionValuesFromProps:cr,createRenderState:Aa}),za=Na({scrapeMotionValuesFromProps:da,createRenderState:ka}),$a={animation:["variants",...qo],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 Ka=!1;function Ya(){return function(){if(Ka)return;const t={};for(const e in $a)t[e]={isEnabled:t=>$a[e].some(e=>!!t[e])};or(t),Ka=!0}(),sr}function Xa(t){const e=Ya();for(const n in t)e[n]={...e[n],...t[n]};or(e)}const Ha=Symbol.for("motionComponentSymbol");function _a(t,e,n){const i=a(n);l(()=>{i.current=n});const s=a(null);return h(n=>{n&&t.onMount?.(n),e&&(n?e.mount(n):e.unmount());const o=i.current;if("function"==typeof o)if(n){const t=o(n);"function"==typeof t&&(s.current=t)}else s.current?(s.current(),s.current=null):o(n);else o&&(o.current=n)},[e])}const Ga=n({}),qa="undefined"!=typeof window?c:u;function Za(n,{forwardMotionProps:s=!1,type:o}={},r,h){const c=o?"svg"===o:Fa(n),p=c?za:Wa;function m(o,r){let d;const m=function({layoutId:t}){const e=i(xa).id;return e&&void 0!==t?e+"-"+t:t}(o);Ia(()=>!!Yo.current?.sharedNodes.get(m)?.lead&&o.initial)&&(o={...o,initial:!1});const f={...i(Sa),...o,layoutId:m},{isStatic:y,isValidProp:g}=f,v=ba(o),x=p(o,y);if(!y&&"undefined"!=typeof window){i(wa).strict;const t=function(t){const e=Ya(),{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,o,r){const{visualElement:h}=i(Ta),c=i(wa),d=i(Oa),p=i(Sa),m=p.reducedMotion,f=p.skipAnimations,y=a(null),g=a(!1);s=s||c.renderer,!y.current&&s&&(y.current=s(t,{visualState:e,parent:h,props:n,presenceContext:d,blockInitialAnimation:!!d&&!1===d.initial,reducedMotionConfig:m,skipAnimations:f,isSVG:r}),g.current&&y.current&&(y.current.manuallyAnimateOnMount=!0));const v=y.current,x=i(Ga);!v||v.projection||!o||"html"!==v.type&&"svg"!==v.type||o.create(v,n,x),l(()=>{v&&v.props!==n&&v.update(n,d)});const w=n[Bi],S=a(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return qa(()=>{g.current&&v&&(v.animationState?.animateChanges(),v.enteringChildren=void 0)},[]),qa(()=>{g.current=!0,v&&(window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),S.current&&v.animationState&&v.animationState.animateChanges())}),u(()=>{v&&(!S.current&&v.animationState&&v.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),v.enteringChildren=void 0)}),v}(n,x,f,h,t.ProjectionNode,c),(t.isEnabled||v.visualElement?.projection?.options.layoutId)&&(d=t.MeasureLayout)}return t(Ta.Provider,{value:v,children:[d&&v.visualElement?e(d,{visualElement:v.visualElement,...f}):null,ja(n,o,_a(x,v.visualElement,r),x,y,s,c,g)]})}m.displayName=`motion.${"string"==typeof n?n:`create(${n.displayName??n.name??""})`}`;const f=d(m);return f[Ha]=n,f}function Ja(t,e){return Za(t,e)}const Qa=Ja("div");function tl({children:t,features:n,strict:i=!1}){const[,s]=p(!el(n)),o=a(void 0);if(!el(n)){const{renderer:t,...e}=n;o.current=t,Xa(e)}return u(()=>{el(n)&&n().then(({renderer:t,...e})=>{Xa(e),o.current=t,m(()=>s(!0))})},[]),e(wa.Provider,{value:{renderer:o.current,strict:i},children:t})}function el(t){return"function"==typeof t}const nl=t=>(e,n)=>{t&&Qt.update(()=>t(e,n),!1,!0)};let il=!1;const sl=({layout:t,layoutDependency:e,layoutAnchor:n})=>({layout:t,layoutDependency:e,layoutAnchor:n,animationType:"string"==typeof t?t:"both"}),ol=(t,e)=>{const{snapshot:n}=t,i=t.getStack();i?.remove(t);const s=i?.lead;if(i?.prevLead===t&&s.resumeFrom===t&&(s.resumeFrom=s.currentAnimation=t.resumingFrom=void 0),t.options.layoutId=e,e)return t.root.registerSharedNode(e,t),()=>{const{resumeFrom:e}=t;!1!==e?.isPresent&&t.getStack().members.includes(e)&&(e.hide(),t.resumeFrom=void 0,t.snapshot=n)};t.needsShow=!0};class rl extends y{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group?.add(s),i&&n?.register?.(s),il&&s.root.didUpdate(),s.options.layoutId!==i&&ol(s,i)?.(),s.addEventListener("animationComplete",()=>this.safeToRemove()),s.setOptions({...s.options,...sl(this.props),onExitComplete:()=>this.safeToRemove()})),uo.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,layoutId:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r?(r.isPresent=o,this.takeOver=t.layoutId!==n?(r.willUpdate(),ol(r,n)):void 0,r.setOptions({...r.options,...sl(this.props)}),il=!0,s||t.layoutDependency!==e||void 0===e||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||Qt.postRender(()=>{r.getStack()?.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(this.takeOver?.(),t.root.didUpdate(),Ts.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;il=!0,i&&(i.scheduleCheckAfterUnmount(),e.group?.remove(i),n?.deregister?.(i))}safeToRemove(){this.props.safeToRemove?.()}render(){return null}}function al(t){const[n,s]=function(t=!0){const e=i(Oa);if(null===e)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=e,r=f();u(()=>{if(t)return o(r)},[t]);const a=h(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,a]:[!0]}(),o=i(xa);return e(rl,{...t,layoutGroup:o,switchLayoutGroup:i(Ga),isPresent:n,safeToRemove:s})}const ll={pan:{Feature:class extends ha{constructor(){super(...arguments),this.removePointerDownListener=P}onPointerDown(t){this.session=new kr(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:this.node.current?.ownerDocument.defaultView})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:nl(t),onStart:nl(e),onMove:nl(n),onEnd:(t,e)=>{delete this.session,i&&Qt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=mr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session?.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session?.end()}}},drag:{Feature:class extends ha{constructor(t){super(t),this.removeGroupControls=P,this.removeListeners=P,this.controls=new _r(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||P}update(){const{dragControls:t,drag:e}=this.node.getProps(),{dragControls:n,drag:i}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls))),i&&!e&&this.controls.stop(void 0,void 0,i)}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:Xo,MeasureLayout:al}},hl={layout:{ProjectionNode:Xo,MeasureLayout:al}};let cl=0;const ul={animation:{Feature:class extends ha{constructor(t){super(t),t.animationState||(t.animationState=ga(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_o(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 ha{constructor(){super(...arguments),this.id=cl++}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}=Mi(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 dl(t,e,n,i,s){const{props:o}=t,r="while"+n;!s&&t.animationState&&o[r]&&t.animationState.setActive(r,"Start"===i);const a=o["on"+n+i];a&&Qt.postRender(()=>a(e,pr(e)))}function pl(t,e,n,i){t.current instanceof HTMLButtonElement&&t.current.disabled||dl(t,e,"Tap",n,i)}const ml=new WeakMap,fl=new WeakMap,yl=t=>{const e=ml.get(t.target);e&&e(t)},gl=t=>{t.forEach(yl)};function vl(t,e,n){const i=function({root:t,...e}){const n=t||document;fl.has(n)||fl.set(n,{});const i=fl.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(gl,{root:t,...e})),i[s]}(e);return ml.set(t,n),i.observe(t),()=>{ml.delete(t),i.unobserve(t)}}const xl={some:0,all:1};const wl={inView:{Feature:class extends ha{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,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:xl[i]};this.stopObserver=vl(this.node.current,o,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(),o=e?n:i;o&&o(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 ha{constructor(){super(...arguments),this.options={}}mount(){const{current:t}=this.node;t&&(this.update(),this.unmount=la(t,(t,e)=>(pl(this.node,e,"Start"),{onComplete:(t,{success:e})=>pl(this.node,t,e?"":"Cancel"),onRepeat:()=>pl(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 ha{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=A($o(this.node.current,"focus",()=>this.onFocus()),$o(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ha{mount(){const{current:t}=this.node;t&&(this.unmount=ta(t,(t,e)=>(dl(this.node,e,"Hover","Start"),t=>dl(this.node,t,"Hover","End"))))}unmount(){}}}},Sl=Object.assign({renderer:(t,e)=>e.isSVG??Fa(t)?new pa(e):new ur(e,{allowProjection:t!==o})},ul,wl),Tl=Object.assign({},Sl,ll,hl);export{tl as LazyMotion,Qa as MotionDiv,Tl as domMax};
//# sourceMappingURL=size-rollup-m-dom-max.js.map