UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

2 lines 199 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var i=n(e),s=React,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(t,e,n){var i,s={},r=null,u=null;for(i in void 0!==n&&(r=""+n),void 0!==e.key&&(r=""+e.key),void 0!==e.ref&&(u=e.ref),e)a.call(e,i)&&!c.hasOwnProperty(i)&&(s[i]=e[i]);if(t&&t.defaultProps)for(i in e=t.defaultProps)void 0===s[i]&&(s[i]=e[i]);return{$$typeof:o,type:t,key:r,ref:u,props:s,_owner:l.current}}const h=r,d=u,p=u,f=e.createContext({});function m(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const g="undefined"!=typeof window,y=g?e.useLayoutEffect:e.useEffect,v=e.createContext(null);function x(t,e){-1===t.indexOf(e)&&t.push(e)}function w(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function S([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const i=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(i,0,s)}return t}const b=(t,e,n)=>n>e?e:n<t?t:n;function T(t,e){return e?`${t}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${e}`:t}t.warning=()=>{},t.invariant=()=>{},"undefined"!=typeof process&&"production"!==process.env?.NODE_ENV&&(t.warning=(t,e,n)=>{t||"undefined"==typeof console||console.warn(T(e,n))},t.invariant=(t,e,n)=>{if(!t)throw new Error(T(e,n))});const P={},E=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),A=t=>"object"==typeof t&&null!==t,M=t=>/^0[^.\s]+$/u.test(t);function C(t){let e;return()=>(void 0===e&&(e=t()),e)}const V=t=>t,k=(...t)=>t.reduce((t,e)=>n=>e(t(n))),D=(t,e,n)=>{const i=e-t;return i?(n-t)/i:1};class R{constructor(){this.subscriptions=[]}add(t){return x(this.subscriptions,t),()=>this.remove(t)}remove(t){w(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let 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 L=t=>1e3*t,B=t=>t/1e3,O=(t,e)=>e?t*(1e3/e):0,j=new Set;function I(t,e,n){t||j.has(e)||(console.warn(T(e,n)),j.add(e))}const F=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t},W=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function N(t,e,n,i){if(t===e&&n===i)return V;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=W(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:W(s(t),e,i)}const $=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,U=t=>e=>1-t(1-e),z=N(.33,1.53,.69,.99),Y=U(z),H=$(Y),X=t=>t>=1?1:(t*=2)<1?.5*Y(t):.5*(2-Math.pow(2,-10*(t-1))),G=t=>1-Math.sin(Math.acos(t)),K=U(G),_=$(G),q=N(.42,0,1,1),Z=N(0,0,.58,1),J=N(.42,0,.58,1);const Q=t=>Array.isArray(t)&&"number"!=typeof t[0];function tt(t,e){return Q(t)?t[F(0,t.length,e)]:t}const et=t=>Array.isArray(t)&&"number"==typeof t[0],nt={linear:V,easeIn:q,easeInOut:J,easeOut:Z,circIn:G,circInOut:_,circOut:K,backIn:Y,backInOut:H,backOut:z,anticipate:X},it=e=>{if(et(e)){t.invariant(4===e.length,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[n,i,s,o]=e;return N(n,i,s,o)}return"string"==typeof e?(t.invariant(void 0!==nt[e],`Invalid easing type '${e}'`,"invalid-easing-type"),nt[e]):e},st=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ot(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=st.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new Set;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(n.add(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{if(r=t,i)return void(s=!0);i=!0;const o=e;e=n,n=o,e.forEach(a),e.clear(),i=!1,s&&(s=!1,l.process(t))}};return l}(o),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:f}=r,m=()=>{const o=P.useManualTiming,r=o?s.timestamp:performance.now();n=!1,o||(s.delta=i?1e3/60:Math.max(Math.min(r-s.timestamp,40),1)),s.timestamp=r,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),f.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(m))};return{schedule:st.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(m)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<st.length;e++)r[st[e]].cancel(t)},state:s,steps:r}}const{schedule:rt,cancel:at,state:lt,steps:ct}=ot("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:V,!0);let ut;function ht(){ut=void 0}const dt={now:()=>(void 0===ut&&dt.set(lt.isProcessing||P.useManualTiming?lt.timestamp:performance.now()),ut),set:t=>{ut=t,queueMicrotask(ht)}},pt=t=>Math.round(1e5*t)/1e5,ft=t=>e=>"string"==typeof e&&e.startsWith(t),mt=ft("--"),gt=ft("var(--"),yt=t=>!!gt(t)&&vt.test(t.split("/*")[0].trim()),vt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function xt(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const wt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},St={...wt,transform:t=>b(0,1,t)},bt={...wt,default:1},Tt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Et=(t,e)=>n=>Boolean("string"==typeof n&&Pt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),At=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Tt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Mt={...wt,transform:t=>Math.round((t=>b(0,255,t))(t))},Ct={test:Et("rgb","red"),parse:At("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Mt.transform(t)+", "+Mt.transform(e)+", "+Mt.transform(n)+", "+pt(St.transform(i))+")"};const Vt={test:Et("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Ct.transform},kt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Dt=kt("deg"),Rt=kt("%"),Lt=kt("px"),Bt=kt("vh"),Ot=kt("vw"),jt=(()=>({...Rt,parse:t=>Rt.parse(t)/100,transform:t=>Rt.transform(100*t)}))(),It={test:Et("hsl","hue"),parse:At("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Rt.transform(pt(e))+", "+Rt.transform(pt(n))+", "+pt(St.transform(i))+")"},Ft={test:t=>Ct.test(t)||Vt.test(t)||It.test(t),parse:t=>Ct.test(t)?Ct.parse(t):It.test(t)?It.parse(t):Vt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ct.transform(t):It.transform(t),getAnimatableNone:t=>{const e=Ft.parse(t);return e.alpha=0,Ft.transform(e)}},Wt=new RegExp(Tt.source),Nt=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const $t="number",Ut="color",zt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Yt(t){const e=t.toString();return Wt.test(e)||Nt.test(e)}function Ht(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(zt,t=>(Ft.test(t)?(i.color.push(o),s.push(Ut),n.push(Ft.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push($t),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Xt({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===$t?pt(i[o]):t===Ut?Ft.transform(i[o]):i[o]}return s}}const Gt=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:Ft.test(n)?Ft.getAnimatableNone(n):n;var n};const Kt={test:function(t){return isNaN(t)&&"string"==typeof t&&(Wt.test(t)||Nt.test(t))},parse:function(t){return Ht(t).values},createTransformer:function(t){return Xt(Ht(t))},getAnimatableNone:function(t){const e=Ht(t);return Xt(e)(e.values.map((t,n)=>Gt(t,e.split[n])))}};function _t(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function qt({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let 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=_t(a,i,t+1/3),o=_t(a,i,t),r=_t(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}}function Zt(t,e){return n=>n>0?e:t}const Jt=(t,e,n)=>t+(e-t)*n,Qt=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},te=[Vt,Ct,It];function ee(e){const n=(i=e,te.find(t=>t.test(i)));var i;if(!n)return t.warning(!1,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!1;let s=n.parse(e);return n===It&&(s=qt(s)),s}const ne=(t,e)=>{const n=ee(t),i=ee(e);if(!n||!i)return Zt(t,e);const s={...n};return t=>(s.red=Qt(n.red,i.red,t),s.green=Qt(n.green,i.green,t),s.blue=Qt(n.blue,i.blue,t),s.alpha=Jt(n.alpha,i.alpha,t),Ct.transform(s))},ie=new Set(["none","hidden"]);function se(t,e){return ie.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function oe(t,e){return n=>Jt(t,e,n)}function re(t){return"number"==typeof t?oe:"string"==typeof t?yt(t)?Zt:Ft.test(t)?ne:ce:Array.isArray(t)?ae:"object"==typeof t?Ft.test(t)?ne:le:Zt}function ae(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>re(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function le(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=re(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const ce=(e,n)=>{const i=Kt.createTransformer(n),s=Ht(e),o=Ht(n);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?ie.has(e)&&!o.values.length||ie.has(n)&&!s.values.length?se(e,n):k(ae(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}(s,o),o.values),i):(t.warning(!0,`Complex values '${e}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Zt(e,n))},ue=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function he(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Jt(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=ue.exec(t);if(!n)return;const i=ue.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),r=parseFloat(i[1]);return t=>pt(Jt(o,r,t))+s}(t,e);if(n)return n}return re(t)(t,e)}const de=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>rt.update(e,t),stop:()=>at(e),now:()=>lt.isProcessing?lt.timestamp:dt.now()}},pe=(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)})`},fe=2e4;function me(t,e=50,n=2e4,i){let s=0,o=t.next(s);for(i?.push(o.value);!o.done&&s<n;)s+=e,o=t.next(s),i?.push(o.value);return s>=n?1/0:s}function ge(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(me(i),fe);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:B(s)}}const ye=100,ve=10,xe=1,we=0,Se=800,be=.3,Te=.3,Pe={granular:.01,default:2},Ee={granular:.005,default:.5},Ae=.01,Me=10,Ce=.05,Ve=1;function ke(t,e){return t*Math.sqrt(1-e*e)}const De=.001;const Re=["duration","bounce"],Le=["stiffness","damping","mass"];function Be(t,e){return e.some(e=>void 0!==t[e])}function Oe(e){let n={velocity:we,stiffness:ye,damping:ve,mass:xe,isResolvedFromDuration:!1,...e};if(!Be(e,Le)&&Be(e,Re))if(n.velocity=0,e.visualDuration){const t=e.visualDuration,i=2*Math.PI/(1.2*t),s=i*i,o=2*b(.05,1,1-(e.bounce||0))*Math.sqrt(s);n={...n,mass:xe,stiffness:s,damping:o}}else{const i=function({duration:e=Se,bounce:n=be,velocity:i=we,mass:s=xe}){let o,r;t.warning(e<=L(Me),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-n;a=b(Ce,Ve,a),e=b(Ae,Me,B(e)),a<1?(o=t=>{const n=t*a,s=n*e,o=n-i,r=ke(t,a),l=Math.exp(-s);return De-o/r*l},r=t=>{const n=t*a*e,s=n*i+i,r=a*a*t*t*e,l=Math.exp(-n),c=ke(t*t,a);return(-o(t)+De>0?-1:1)*((s-r)*l)/c}):(o=t=>Math.exp(-t*e)*((t-i)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(i-t)));const l=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(o,r,5/e);if(e=L(e),isNaN(l))return{stiffness:ye,damping:ve,duration:e};{const t=l*l*s;return{stiffness:t,damping:2*a*Math.sqrt(s*t),duration:e}}}({...e,velocity:0});n={...n,...i,mass:xe},n.isResolvedFromDuration=!0}return n}function je(t=Te,e=be){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:c,velocity:u,isResolvedFromDuration:h}=Oe({...n,velocity:-B(n.velocity||0)}),d=a/(2*Math.sqrt(r*l)),p=B(Math.sqrt(r/l)),f=d*p,m={target:s,delta:s-i,velocity:u||0,restSpeed:0,restDelta:0},g=()=>{const t=Math.abs(m.delta)<5;m.restSpeed=n.restSpeed||(t?Pe.granular:Pe.default),m.restDelta=n.restDelta||(t?Ee.granular:Ee.default)};let y,v,x;if(g(),d<1){const t=ke(p,d),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};x=()=>{e.A=(m.velocity+f*m.delta)/t,e.sinC=f*e.A+m.delta*t,e.cosC=f*m.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))};y=t=>(n(t),m.target-e.env*(e.A*e.sin+m.delta*e.cos)),v=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===d){y=t=>m.target-Math.exp(-p*t)*(m.delta+(m.velocity+p*m.delta)*t);const t={C:0};x=()=>{t.C=m.velocity+p*m.delta},v=e=>Math.exp(-p*e)*(p*t.C*e-m.velocity)}else{const t=p*Math.sqrt(d*d-1);y=e=>{const n=Math.exp(-f*e),i=Math.min(t*e,300);return m.target-n*((m.velocity+f*m.delta)*Math.sinh(i)+t*m.delta*Math.cosh(i))/t};const e={P:0,sinh:0,cosh:0};x=()=>{e.P=(m.velocity+f*m.delta)/t,e.sinh=f*e.P-m.delta*t,e.cosh=f*m.delta-e.P*t},v=n=>{const i=Math.exp(-f*n),s=Math.min(t*n,300);return i*(e.sinh*Math.sinh(s)+e.cosh*Math.cosh(s))}}x();const w=!Be(n,Le)&&Be(n,Re),S=h&&c||null,b={calculatedDuration:S,retarget:(t,e)=>{m.target=t[t.length-1],m.delta=m.target-t[0],m.velocity=w?0:-B(e),n.restSpeed&&n.restDelta||g(),b.calculatedDuration=S,o.done=!1,x()},velocity:t=>L(v(t)),next:t=>{const e=y(t);if(h)o.done=t>=c;else{const n=L(v(t));o.done=Math.abs(n)<=m.restSpeed&&Math.abs(m.target-e)<=m.restDelta}return o.value=o.done?m.target:e,o},toString:()=>{const t=Math.min(me(b),fe),e=pe(e=>b.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return b}function Ie({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=h+f,g=void 0===r?m:r(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/i),v=t=>{const e=y(t);d.done=Math.abs(e)<=c,d.value=d.done?g:g+e};let x,w;const S=t=>{var e;((e=d.value)<a||e>l)&&(x=t,w=je({keyframes:[d.value,p(d.value)],velocity:-y(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};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 Fe(e,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=e.length;if(t.invariant(r===n.length,"Both input and output ranges must be the same length","range-length"),1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const l=function(t,e,n){const i=[],s=n||P.mix||he,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||V:e;o=k(t,o)}i.push(o)}return i}(n,s,o),c=l.length,u=t=>{if(a&&t<e[0])return n[0];let i=0;if(c>1)for(;i<e.length-2&&!(t<e[i+1]);i++);const s=D(e[i],e[i+1],t);return l[i](s)};return i?t=>u(b(e[0],e[r-1],t)):u}function We(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=D(0,e,i);t.push(Jt(n,1,s))}}function Ne(t){const e=[0];return We(e,t.length-1),e}function $e(t,e){return t.map(t=>t*e)}function Ue(t,e){return t.map(()=>e||J).splice(0,t.length-1)}function ze({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=Q(i)?i.map(it):it(i),o={done:!1,value:e[0]};if(2===e.length&&!Array.isArray(s)&&(!n||2!==n.length||0===n[0]&&1===n[1])){const[n,i]=e,r=n===i?void 0:(P.mix||he)(n,i);return{calculatedDuration:t,next:e=>(o.value=r?r(s(t>0?b(0,1,e/t):1)):i,o.done=e>=t,o)}}const r=Fe($e(n&&n.length===e.length?n:Ne(e),t),e,{ease:Array.isArray(s)?s:Ue(e,s)});return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}je.applyToOptions=t=>{const e=ge(t,100,je);return t.ease=e.ease,t.duration=L(e.duration),t.type="keyframes",t};function Ye(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 O(n-t(i),e-i)}(e=>t.next(e).value,e,t.next(e).value)}const He=t=>null!==t;function Xe(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(He),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ge={decay:Ie,inertia:Ie,tween:ze,keyframes:ze,spring:je};function Ke(t){"string"==typeof t.type&&(t.type=Ge[t.type])}function _e(t,e){return{kind:t,animation:e,timestamp:dt.now(),frameTimestamp:lt.timestamp,frameIsProcessing:lt.isProcessing}}function qe(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({..._e("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Ze{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 Je=t=>t/100;class Qe extends Ze{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==dt.now()&&this.tick(dt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),qe(this,this.options)}initAnimation(){const{options:t}=this;Ke(t);const{type:e=ze,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||ze;a!==ze&&"number"!=typeof r[0]&&(this.mixKeyframes=k(Je,he(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=me(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:f,finalKeyframe:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v,x=this.currentTime,w=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(w=o)),x=b(0,1,n)*r}y?(this.delayState.value=c[0],v=this.delayState):v=w.next(x),s&&!y&&(v.value=s(v.value));let{done:S}=v;y||null===a||(S=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return T&&p!==Ie&&(v.value=Xe(c,this.options,m,this.speed)),f&&f(v.value),T&&this.finish(),v}then(t,e){return this.finished.then(t,e)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){t=L(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 Ye(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(dt.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=B(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=de,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(dt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const tn=new Set(["brightness","contrast","saturate","opacity"]);function en(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Tt)||[];if(!i)return t;const s=n.replace(i,"");let o=tn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const nn=/\b([a-z-]*)\(.*?\)/gu,sn={...Kt,getAnimatableNone:t=>{const e=t.match(nn);return e?e.map(en).join(" "):t}},on={...Kt,getAnimatableNone:t=>{const e=Kt.parse(t);return Kt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},rn={...wt,transform:Math.round},an={rotate:Dt,pathRotation:Dt,rotateX:Dt,rotateY:Dt,rotateZ:Dt,scale:bt,scaleX:bt,scaleY:bt,scaleZ:bt,skew:Dt,skewX:Dt,skewY:Dt,distance:Lt,translateX:Lt,translateY:Lt,translateZ:Lt,x:Lt,y:Lt,z:Lt,perspective:Lt,transformPerspective:Lt,opacity:St,originX:jt,originY:jt,originZ:Lt},ln={borderWidth:Lt,borderTopWidth:Lt,borderRightWidth:Lt,borderBottomWidth:Lt,borderLeftWidth:Lt,borderRadius:Lt,borderTopLeftRadius:Lt,borderTopRightRadius:Lt,borderBottomRightRadius:Lt,borderBottomLeftRadius:Lt,width:Lt,maxWidth:Lt,height:Lt,maxHeight:Lt,top:Lt,right:Lt,bottom:Lt,left:Lt,inset:Lt,insetBlock:Lt,insetBlockStart:Lt,insetBlockEnd:Lt,insetInline:Lt,insetInlineStart:Lt,insetInlineEnd:Lt,padding:Lt,paddingTop:Lt,paddingRight:Lt,paddingBottom:Lt,paddingLeft:Lt,paddingBlock:Lt,paddingBlockStart:Lt,paddingBlockEnd:Lt,paddingInline:Lt,paddingInlineStart:Lt,paddingInlineEnd:Lt,margin:Lt,marginTop:Lt,marginRight:Lt,marginBottom:Lt,marginLeft:Lt,marginBlock:Lt,marginBlockStart:Lt,marginBlockEnd:Lt,marginInline:Lt,marginInlineStart:Lt,marginInlineEnd:Lt,fontSize:Lt,backgroundPositionX:Lt,backgroundPositionY:Lt,...an,zIndex:rn,fillOpacity:St,strokeOpacity:St,numOctaves:rn},cn={...ln,color:Ft,backgroundColor:Ft,outlineColor:Ft,fill:Ft,stroke:Ft,borderColor:Ft,borderTopColor:Ft,borderRightColor:Ft,borderBottomColor:Ft,borderLeftColor:Ft,filter:sn,WebkitFilter:sn,mask:on,WebkitMask:on},un=t=>cn[t],hn=new Set([sn,on]);function dn(t,e){let n=un(t);return hn.has(n)||(n=Kt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function pn(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const fn=t=>180*t/Math.PI,mn=t=>{const e=fn(Math.atan2(t[1],t[0]));return yn(e)},gn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:mn,rotateZ:mn,skewX:t=>fn(Math.atan(t[1])),skewY:t=>fn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},yn=t=>((t%=360)<0&&(t+=360),t),vn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),xn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),wn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vn,scaleY:xn,scale:t=>(vn(t)+xn(t))/2,rotateX:t=>yn(fn(Math.atan2(t[6],t[5]))),rotateY:t=>yn(fn(Math.atan2(-t[2],t[0]))),rotateZ:mn,rotate:mn,skewX:t=>fn(Math.atan(t[4])),skewY:t=>fn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Sn(t){return t.includes("scale")?1:0}function bn(t,e){if(!t||"none"===t)return Sn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=wn,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=gn,s=e}if(!s)return Sn(e);const o=i[e],r=s[1].split(",").map(Pn);return"function"==typeof o?o(r):r[o]}const Tn=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return bn(n,e)};function Pn(t){return parseFloat(t.trim())}const En=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],An=(()=>new Set([...En,"pathRotation"]))(),Mn=t=>t===wt||t===Lt,Cn=new Set(["x","y","z"]),Vn=En.filter(t=>!Cn.has(t));const kn=new Set(["bottom","right"]);function Dn(t,e,n,i,s,o){const r=parseFloat(t);if(!isNaN(r))return r;const{min:a,max:l}=e()[n],c=l-a;return"border-box"===o?c:c-parseFloat(i)-parseFloat(s)}const Rn={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>Dn(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>Dn(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:({transform:t})=>bn(t,"x"),y:({transform:t})=>bn(t,"y")};Rn.translateX=Rn.x,Rn.translateY=Rn.y;const Ln=new Set;let Bn=!1,On=!1,jn=!1;function In(){if(On){const t=[],e=new Set,n=new Set;Ln.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),kn.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return Vn.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)})}On=!1,Bn=!1,Ln.forEach(t=>t.complete(jn)),Ln.clear()}function Fn(){Ln.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(On=!0)})}function Wn(){jn=!0,Fn(),In(),jn=!1}class Nn{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?(Ln.add(this),Bn||(Bn=!0,rt.read(Fn),rt.resolveKeyframes(In))):(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(E(t)||M(t))return parseFloat(t);if(!Kt.test(t)&&Kt.test(n))return dn(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])}pn(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ln.delete(this)}cancel(){"scheduled"===this.state&&(Ln.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const $n=t=>t.startsWith("--");function Un(t,e,n){$n(e)?t.style.setProperty(e,n):t.style[e]=n}const zn={};function Yn(t,e){const n=C(t);return()=>zn[e]??n()}const Hn=Yn(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Xn=Yn(()=>void 0!==window.ViewTimeline,"viewTimeline"),Gn=Yn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Kn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,_n={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Kn([0,.65,.55,1]),circOut:Kn([.55,0,1,.45]),backIn:Kn([.31,.01,.66,-.59]),backOut:Kn([.33,1.53,.69,.99])};function qn(t,e){return t?"function"==typeof t?Gn()?pe(t,e):"ease-out":et(t)?Kn(t):Array.isArray(t)?t.map(t=>qn(t,e)||_n.easeOut):_n[t]:void 0}function Zn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=qn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};return c&&(d.pseudoElement=c),t.animate(u,d)}function Jn(t){return"function"==typeof t&&"applyToOptions"in t}function Qn({type:t,...e}){return Jn(t)&&Gn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class ti extends Ze{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:i,keyframes:s,pseudoElement:o,allowFlatten:r=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=Boolean(o),this.allowFlatten=r,this.options=e,t.invariant("string"!=typeof e.type,'Mini animate() doesn\'t support "type" as a string.',"mini-spring");const c=Qn(e);this.animation=Zn(n,i,s,c,o),!1===c.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const t=Xe(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(t),Un(n,i,t),this.animation.cancel()}l?.(),this.notifyFinished()},qe(this,e,c)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=L(t),e&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:e,rangeEnd:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Hn()?(this.animation.timeline=t,e&&(this.animation.rangeStart=e),n&&(this.animation.rangeEnd=n),V):i(this)}}const ei={anticipate:X,backInOut:H,circInOut:_};function ni(t){"string"==typeof t.ease&&t.ease in ei&&(t.ease=ei[t.ease])}class ii extends ti{constructor(t){ni(t),Ke(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Qe({...o,autoplay:!1}),a=Math.max(10,dt.now()-this.startTime),l=b(0,10,a-10),c=r.sample(a).value,{name:u}=this.options;s&&u&&Un(s,u,c),e.setWithVelocity(r.sample(Math.max(0,a-l)).value,c,l),r.stop()}}const si=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Kt.test(t)&&"0"!==t||t.startsWith("url(")));function oi(t){t.duration=0,t.type="keyframes"}const ri=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),ai=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const li=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ci=C(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ui(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!ri.has(n)&&!li.has(n))return!1;const l=e?.owner?.current;if(!(l instanceof HTMLElement||l instanceof SVGElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return ci()&&(ri.has(n)||li.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&ai.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}class hi extends Ze{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=dt.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||Nn;this.keyframeResolver=new r(e,(t,e,n)=>this.onKeyframesResolved(t,e,o,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,s){this.keyframeResolver=void 0;const{name:o,type:r,velocity:a,delay:l,isHandoff:c,onUpdate:u}=i;this.resolvedAt=dt.now();let h=!0;(function(e,n,i,s){const o=e[0];if(null===o)return!1;if("display"===n||"visibility"===n)return!0;const r=e[e.length-1],a=si(o,n),l=si(r,n);return a&&l?function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(e)||("spring"===i||Jn(i))&&s:(a!==l&&t.warning(!1,`You are trying to animate ${n} from "${o}" to "${r}". "${a?r:o}" is not an animatable value.`,"value-not-animatable"),!1)})(e,o,r,a)||(h=!1,!P.instantAnimations&&l||u?.(Xe(e,i,n)),e[0]=e[e.length-1],oi(i),i.repeat=0);const d=s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,{onComplete:p}=i;i.startTime??(i.startTime=d),i.finalKeyframe=n,i.keyframes=e,i.onComplete=()=>{p?.(),this.notifyFinished()};let f;if(h&&!c&&ui(i)){i.element=i.motionValue?.owner?.current;try{f=new ii(i)}catch{f=new Qe(i)}}else f=new Qe(i);this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Wn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class di{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map(e=>e.attachTimeline(t));return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return pi(this.animations,"duration")}get iterationDuration(){return pi(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(e=>e[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function pi(t,e){let n=0;for(let i=0;i<t.length;i++){const s=t[i][e];null!==s&&s>n&&(n=s)}return n}class fi extends di{then(t,e){return this.finished.finally(t).then(()=>{})}}class mi extends ti{constructor(t){super(),this.animation=t,t.onfinish=()=>{this.finishedTime=this.time,this.notifyFinished()},qe(this,{})}}const gi=new WeakMap,yi=(t,e="")=>`${t}:${e}`;function vi(t){let e=gi.get(t);return e||(e=new Map,gi.set(t,e)),e}function xi(t,e,n,i=0,s=1){const o=Array.from(t).sort((t,e)=>t.sortNodePosition(e)).indexOf(e),r=t.size,a=(r-1)*i;return"function"==typeof n?n(o,r):1===s?o*i:a-o*i}const wi={current:void 0};class Si{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=dt.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.notifyChange(),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=dt.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 R)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new R,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(){rt.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){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return wi.current&&wi.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=dt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return O(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&this.clearAnimation(),e()}),i||(this.animation=n),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function bi(t,e){return new Si(t,e)}function Ti(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function Pi(t,e){const n=t?.[e]??t?.default??t;return n!==t?Ti(n,t):n}const Ei={type:"spring",stiffness:500,damping:25,restSpeed:10},Ai={type:"keyframes",duration:.8},Mi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ci=(t,{keyframes:e})=>e.length>2?Ai:An.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ei:Mi,Vi=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ki(t){for(const e in t)if(!Vi.has(e))return!0;return!1}const Di=(t,e,n,i={},s,o)=>r=>{const a=Pi(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=L(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,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};ki(a)||Object.assign(u,Ci(t,u)),u.duration&&(u.duration=L(u.duration)),u.repeatDelay&&(u.repeatDelay=L(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(oi(u),0===u.delay&&(h=!0)),(P.instantAnimations||P.skipAnimations||s?.shouldSkipAnimations||a.skipAnimations)&&(h=!0,oi(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=Xe(u.keyframes,a);if(void 0!==t)return void rt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Qe(u):new hi(u)};function Ri(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function Li(t,e,n,i,s,o,r){const a=2*(1-t)*(n-e)+2*t*(i-n),l=2*(1-t)*(o-s)+2*t*(r-o);return Math.atan2(l,a)*(180/Math.PI)}function Bi(t,e,n,i,s,o){const r=n-t,a=i-e,l=Math.sqrt(r*r+a*a);if(l>0){const n=s*l;return{x:t+r*o+-a/l*n,y:e+a*o+r/l*n}}return{x:t,y:e}}const Oi=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ji(t){const e=Oi.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function Ii(e,n,i=1){t.invariant(i<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,o]=ji(e);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return E(t)?parseFloat(t):t}return yt(o)?Ii(o,n,i+1):o}function Fi(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Wi(t,e,n,i){if("function"==typeof e){const[s,o]=Fi(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Fi(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function Ni(t,e,n){const i=t.getProps();return Wi(i,e,void 0!==n?n:i.custom,t)}const $i=new Set(["width","height","top","left","right","bottom",...En]),Ui=t=>Array.isArray(t);function zi(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,bi(n))}function Yi(t){return Ui(t)?t[t.length-1]||0:t}function Hi(t,e){const n=Ni(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){zi(t,e,Yi(o[e]))}}const Xi=t=>Boolean(t&&t.getVelocity);function Gi(t){return Boolean(Xi(t)&&t.add)}function Ki(t,e){const n=t.getValue("willChange");if(Gi(n))return n.add(e);if(!n&&P.WillChange){const n=new P.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function _i(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const qi="framerAppearId",Zi="data-"+_i(qi);function Ji(t){return t.props[Zi]}const Qi="undefined"!=typeof window;function ts({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function es(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Ti(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState&&t.animationState.getState()[s],p=o?.path;p&&p.animateVisualElement(t,a,o,n,h);for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||d&&ts(d,e))continue;const r={delay:n,...Pi(o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){rt.update(()=>i.set(s));continue}let p=!1;if(Qi&&window.MotionHandoffAnimation){const n=Ji(t);if(n){const t=window.MotionHandoffAnimation(n,e,rt);null!==t&&(r.startTime=t,p=!0)}}Ki(t,e);const f=c??t.shouldReduceMotion;i.start(Di(e,i,s,f&&$i.has(e)?{type:!1}:r,t,p));const m=i.animation;m&&h.push(m)}if(r){const e=()=>rt.update(()=>{r&&Hi(t,r)});h.length?Promise.all(h).then(e):e()}return h}function ns(t,e,n={}){const i=Ni(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(es(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=0,o=1,r){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(ns(l,e,{...r,delay:n+("function"==typeof i?0:i)+xi(t.variantChildren,l,i,s,o)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}(t,e,i,o,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function is(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>ns(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=ns(t,e,n);else{const s="function"==typeof e?Ni(t,e,n.custom):e;i=Promise.all(es(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const ss=t=>e=>e.test(t),os=[wt,Lt,Rt,Dt,Ot,Bt,{test:t=>"auto"===t,parse:t=>t}],rs=t=>os.find(ss(t));function as(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||M(t))}const ls=new Set(["auto","none","0"]);class cs extends Nn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),yt(i))){const s=Ii(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!$i.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=rs(i),r=rs(s);if(xt(i)!==xt(s)&&Rn[n])this.needsMeasurement=!0;else if(o!==r)if(Mn(o)&&Mn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Rn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||as(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&&!ls.has(e)&&Yt(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=dn(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return Rn[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!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||!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.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const us=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],hs=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...us,"width","maxWidth","height","maxHeight","top","right","bottom","left","inset","insetBlock","insetBlockStart","insetBlockEnd","insetInline","insetInlineStart","insetInlineEnd","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingBlock","paddingBlockStart","paddingBlockEnd","paddingInline","paddingInlineStart","paddingInlineEnd","margin","marginTop","marginRight","marginBottom","marginLeft","marginBlock","marginBlockStart","marginBlockEnd","marginInline","marginInlineStart","marginInlineEnd","fontSize","backgroundPositionX","backgroundPositionY"]);function ds(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&hs.has(e)&&(t[n]=t[n]+"px")}const ps=C(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),fs=[];function ms(e){t.invariant("function"==typeof e.test&&"function"==typeof e.read,"Effects passed to animate.addEffect() need test() and read().","effect-missing-test"),gs(e),fs.unshift(e)}function gs(t){w(fs,t)}function ys(t){return fs.find(e=>e.test(t))}function vs(t,e,n={},i){const s=[],{velocity:o}=n,r=n.reduceMotion??i?.shouldReduceMotion;for(const a in e){if("transition"===a||"transitionEnd"===a)continue;const l=e[a];if(void 0===l)continue;const c=t(a),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.start(Di(a,c,l,r&&$i.has(a)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):rt.update(()=>c.set(l))}const{transitionEnd:a}=e;if(a){const e=()=>rt.update(()=>{for(const e in a)t(e).set(a[e])});s.length?Promise.all(s).then(e):e()}return s}function xs(e,n,i,s,o){return vs(s=>{let r=e.get(n,s);if(!r){let a;if(!o){const o=i[s];a=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(o)??e.read(n,s,o),t.invariant(void 0!==a,`"${s}" can't be read from the animated subject. Provide [from, to] keyframes.`,"effect-unreadable-value")}r=bi(a,{owner:o}),e(n,{[s]:r})}return r},i,s,o)}function ws(t){return A(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function Ss(t){return A(t)&&"ownerSVGElement"in t}const bs=(t,e)=>e&&"number"==typeof t?e.transform(t):t;function Ts(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ps(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=Ts(e),s=[];for(const e of i){const i=t(e,n);s.push(i)}return()=>{for(const t of s)t()}},{test:e,read:n,get:i,flush:s,state:o})}class Es{constructor(t=rt.render){this.step=t,this.values=new Map,this.pending=[],this.numPending=0,this.flush=()=>{const{pending:t,numPending:e}=this;this.numPending=0;for(let n=0;n<e;n++)t[n]()}}set(t,e,n,i){if(this.values.get(t)?.onRemove(),i)for(const t of this.values.values())t.value===i&&(n=t.render);const s=()=>n&&this.schedule(n);void 0!==e.get()&&s();const o=e.on("change",s),r=()=>{o(),n&&!i&&this.cancel(n),this.values.delete(t)};return this.values.set(t,{value:e,render:i?void 0:n,onRemove:r}),r}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,n)=>{t.set(n,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:n}=this;for(let i=0;i<n;i++)if(e[i]===t)return;n||this.step(this.flush),e[this.numPending++]=t}cancel(t){const{pending:e}=this;for(let n=0;n<this.numPending;n++)if(e[n]===t)return void(e[n]=e[--this.numPending])}}function As(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new Es(e);i.set(n,o);const r=[];for(const e in s){const i=s[e],a=t(n,o,e,i);r.push(a)}return()=>{for(const t of r)t()}},n,{get:(t,e)=>i.get(t)?.get(e),flush:t=>i.get(t)?.flush(),state:t=>i.get(t)})}const Ms={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cs={};const Vs=new Set(["originX","originY","originZ"]),ks=(t,e)=>bs(t.get(e)?.get(),ln[e]),Ds=(t,e,n,i)=>{let s,o;if(An.has(n)){if("pathRotation"!==n){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[n]=i,t.includes(n)||(t.push(n),t.sort((t,e)=>En.indexOf(t)-En.indexOf(e)))}e.get("transform")||(ws(t)||e.get("transformBox")||Ds(t,e,"transformBox",new Si("fill-box")),e.set("transform",new Si("none"),()=>{t.style.transform=function(t){let e="";const{transformKeys:n=[],transformValues:i={}}=t;for(let t=0;t<n.length;t++){const s=n[t],o=i[s].get();void 0!==o&&(("number"==typeof o?o:parseFloat(o))!==(s.startsWith("scale")?1:0)&&(e+=(e&&" ")+(Cs[s]||(Cs[s]=(Ms[s]||s)+"("))+bs(o,an[s])+")"))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+"rotate("+bs(s,an.pathRotation)+")"),e||"none"}(e)})),o=e.get("transform")}else Vs.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new Si(""),()=>{const n=ks(e,"originX")??"50%",i=ks(e,"originY")??"50%",s=ks(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=$n(n)?()=>{t.style.setProperty(n,i.get())}:()=>{t.style[n]=bs(i.get(),ln[n])};return e.set(n,i,s,o)},Rs=(t,e)=>{if(An.has(e))return Tn(t,e);const n=getComputedStyle(t),i=$n(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Ls=As(Ds,{test:t=>ws(t)||Ss(t),read:Rs}),Bs=Ps(Ls),Os={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},js=En.length;function Is(t,e,n){let i="",s=!0;for(let o=0;o<js;o++){const r=En[o],a=t[r];if(void 0===a)continue;let l=!0;if("number"==typeof a)l=a===(r.startsWith("scale")?1:0);else{const t=parseFloat(a);l=r.startsWith("scale")?1===t:0===t}if(!l||n){const t=bs(a,ln[r]);if(!l){s=!1;i+=`${Os[r]||r}(${t}) `}n&&(e[r]=t)}}const o=t.pathRotation;return o&&(s=!1,i+=`rotate(${bs(o,ln.pathRotation)}) `),i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}function Fs(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(An.has(t))r=!0;else if(mt(t))s[t]=n;else{const e=bs(n,ln[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=Is(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 Ws={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ns={offset:"strokeDashoffset",array:"strokeDasharray"};function $s(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Ws:Ns;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const Us=["transform","opacity","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function zs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(Fs(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;for(const t of Us)void 0!==h[t]&&(d[t]=h[t],delete h[t]);(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&$s(h,s,o,r,!1)}const Ys=(t,e,n,i,s=n)=>{const o=function(t,e){if(!(e in t))return!1;const n=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return n&&"function"==typeof n.set}(t,s);o||!s.startsWith("data")&&!s.startsWith("aria")||(s=_i(s));const r=ln[n]||ln[s],a=o?()=>{t[s]=bs(i.get(),ln[n])}:()=>{const e=bs(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},Hs=Ps(As(Ys));const Xs=(t,e,n,i)=>{if(n.startsWith("path"))return function(t,e,n,i){return rt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===n?e.set(n,i,()=>{const e=i.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Si("1 1"),()=>{const n=e.get("pathLength")?.get()??1,i=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${n} ${i??1-Number(n)}`)}),e.set(n,i,void 0,e.get("stroke-dasharray")))}(t,e,n,i);if(n.startsWith("attr"))return Ys(t,e,n,i,qs(n));return(n in t.style?Ds:Ys)(t,e,n,i)},Gs=(t,e)=>An.has(e)?ln[e]?.default||0:Us.includes(e)?Rs(t,e):(e=qs(e),t.getAttribute(_i(e))??t.getAttribute(e)??void 0),Ks=As(Xs,{test:Ss,read:Gs}),_s=Ps(Ks);function qs(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function Zs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Js({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Qs(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}}function to(t){return void 0===t||1===t}function eo({scale:t,scaleX:e,scaleY:n}){return!to(t)||!to(e)||!to(n)}function no(t){return eo(t)||io(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function io(t){return so(t.x)||so(t.y)}function so(t){return t&&"0%"!==t}function oo(t,e,n){return n+e*(t-n)}function ro(t,e,n,i,s){return void 0!==s&&(t=oo(t,s,i)),oo(t,n,i)+e}function ao(t,e=0,n=1,i,s){t.min=ro(t.min,e,n,i,s),t.max=ro(t.max,e,n,i,s)}function lo(t,{x:e,y:n}){ao(t.x,e.translate,e.scale,e.originPoint),ao(t.y,n.translate,n.scale,n.originPoint)}const co=.999999999999,uo=1.0000000000001;function ho(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;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(po(t.x,-o.scroll.offset.x),po(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,lo(t,r)),i&&no(o.latestValues)&&go(t,o.latestValues,o.layout?.layoutBox))}e.x<uo&&e.x>co&&(e.x=1),e.y<uo&&e.y>co&&(e.y=1)}function po(t,e){t.min+=e,t.max+=e}function fo(t,e,n,i,s=.5){ao(t,e,n,Jt(t.min,t.max,s),i)}function mo(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function go(t,e,n){const i=n??t;fo(t.x,mo(e.x,i.x),e.scaleX,e.scale,e.originX),fo(t.y,mo(e.y,i.y),e.scaleY,e.scale,e.originY)}function yo(t,e){return Zs(Qs(t.getBoundingClientRect(),e))}function vo(t,e,n){const i=yo(t,n),{scroll:s}=e;return s&&(po(i.x,s.offset.x),po(i.y,s.offset.y)),i}const xo={},wo=t=>Ss(t)?Ks:Ls;class So{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=cs}getValue(t){return this.effect.get(this.current,t)}readValue(t,e){return this.effect.read(this.current,t,e)}render(){this.effect.flush(this.current)}measureViewportBox(){return yo(this.current)}getProps(){return xo}}function bo(t,e,n,i){if(i)return vs(t=>i.getValue(t,null),e,n,i);const s=wo(t);return xs(s,t,e,n,new So(s,t))}function To(t,e){const n=wo(t).state(t);if(!n)return;const{transformKeys:i}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&i?.length||e.addValue(n,t)})}const Po=As((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>A(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:Eo,cancel:Ao}=ot(queueMicrotask,!1),Mo={x:!1,y:!1};function Co(){return Mo.x||Mo.y}function Vo(t){return"x"===t||"y"===t?Mo[t]?null:(Mo[t]=!0,()=>{Mo[t]=!1}):Mo.x||Mo.y?null:(Mo.x=Mo.y=!0,()=>{Mo.x=Mo.y=!1})}function ko(t,e){const n=Ts(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function Do(t,e,n={}){const[i,s,o]=ko(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||Co())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 Ro=(t,e)=>!!e&&(t===e||Ro(t,e.parentElement)),Lo=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,Bo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Oo(t){return Bo.has(t.tagName)||!0===t.isContentEditable}const jo=new Set(["INPUT","SELECT","TEXTAREA"]);function Io(t){return jo.has(t.tagName)||!0===t.isContentEditable}const Fo=new WeakSet;function Wo(t){return e=>{"Enter"===e.key&&t(e)}}function No(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function $o(t){return Lo(t)&&!Co()}const Uo=new WeakSet;function zo(t,e,n={}){const[i,s,o]=ko(t,n),r=t=>{const i=t.currentTarget;if(!$o(t))return;if(Uo.has(t))return;Fo.add(i),n.stopPropagation&&Uo.add(t);const o=e(i,t),r={...s,capture:!0},a=(t,e)=>{window.removeEventListener("pointerup",l,r),window.removeEventListener("pointercancel",c,r),Fo.has(i)&&Fo.delete(i),$o(t)&&"function"==typeof o&&o(t,{success:e})},l=t=>{a(t,i===window||i===document||n.useGlobalTarget||Ro(i,t.target))},c=t=>{a(t,!1)};window.addEventListener("pointerup",l,r),window.addEventListener("pointercancel",c,r)};return i.forEach(t=>{(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),ws(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=Wo(()=>{if(Fo.has(n))return;No(n,"down");const t=Wo(()=>{No(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>No(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),Oo(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Yo(t,e){const n=window.getComputedStyle(t);return $n(e)?n.getPropertyValue(e):n[e]}const Ho=new WeakMap;let Xo;const Go=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Ss(i)&&"getBBox"in i?i.getBBox()[e]:i[n],Ko=Go("inline","width","offsetWidth"),_o=Go("block","height","offsetHeight");function qo({target:t,borderBoxSize:e}){Ho.get(t)?.forEach(n=>{n(t,{get width(){return Ko(t,e)},get height(){return _o(t,e)}})})}function Zo(t){t.forEach(qo)}function Jo(t,e){Xo||"undefined"!=typeof ResizeObserver&&(Xo=new ResizeObserver(Zo));const n=Ts(t);return n.forEach(t=>{let n=Ho.get(t);n||(n=new Set,Ho.set(t,n)),n.add(e),Xo?.observe(t)}),()=>{n.forEach(t=>{const n=Ho.get(t);n?.delete(e),n?.size||Xo?.unobserve(t)})}}const Qo=new Set;let tr;function er(t){return Qo.add(t),tr||(tr=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Qo.forEach(e=>e(t))},window.addEventListener("resize",tr)),()=>{Qo.delete(t),Qo.size||"function"!=typeof tr||(window.removeEventListener("resize",tr),tr=void 0)}}function nr(t,e){return"function"==typeof t?er(t):Jo(t,e)}function ir(t,e){let n;const i=()=>{const{currentTime:i}=e,s=(null===i?0:i.value)/100;n!==s&&t(s),n=s};return rt.preUpdate(i,!0),()=>at(i)}const sr={value:null,addProjectionMetrics:null};function or(t){return Ss(t)&&"svg"===t.tagName}function rr(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}function ar(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Fe(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const lr=new Set,cr=({timestamp:t})=>{lr.forEach(e=>e.tick(t))};class ur extends Ze{constructor(t){super(),this.state="idle",this.startTime=0,this.currentTime=0,this.started=!1,this.hasNextTarget=!1,this.nextTarget=0,this.stop=()=>{"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,Ke(t),this.factory=t.type||ze,this.generator=this.factory(t);const{driver:e}=t;e&&(this.driver=e(t=>this.tick(t))),this.startTime=this.now(),this.state="running",this.driver?this.driver.start():(lr.size||rt.update(cr,!0),lr.add(this))}setTarget(t,e){this.nextTarget=t,this.nextVelocity=e,this.hasNextTarget=!0}retarget(t,e){const{options:n,generator:i}=this;n.keyframes=t,n.velocity=e,this.startTime=this.now(),this.currentTime=0,i.retarget?i.retarget(t,e):this.generator=this.factory(n)}tick(t){const{options:e,hasNextTarget:n}=this,{delay:i=0,onUpdate:s,onPlay:o}=e,r=Math.round(t-this.startTime)-i,a=this.currentTime=Math.max(0,r),l=this.generator.next(a),c=r<0?e.keyframes[0]:l.value;if(n){this.hasNextTarget=!1;const{keyframes:t}=e;t[0]=c,t[1]=this.nextTarget,this.retarget(t,this.nextVelocity??this.getGeneratorVelocity())}!n&&this.started||(this.started=!0,o?.()),"running"===this.state&&(s?.(c),l.done&&r>=0&&!n&&!this.hasNextTarget&&"running"===this.state&&(this.notifyFinished(),this.teardown(),this.state="finished",e.onComplete?.()))}getGeneratorVelocity(){return Ye(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():dt.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(lr.delete(this),lr.size||at(cr))}}function hr(t,e){const n=bi(Xi(t)?t.get():t);return dr(n,t,e),n}function dr(t,e,n={}){const i=t.get();let s,o=null;const r="string"==typeof i?i.replace(/[\d.-]/g,""):void 0,a=t=>s(r?t+r:t),l=()=>t.events.animationStart?.notify(),c=()=>{o&&(o.stop(),o=null),t.animation=void 0};if(t.attach((e,i)=>{s=i;const r=fr(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=fr(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new ur({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),Xi(e)){let i=!0===n.skipInitialAnimation;const s=e.on("change",e=>{i?(i=!1,t.jump(pr(e,r),!1)):t.set(pr(e,r))}),o=t.on("destroy",s);return()=>{s(),o()}}return c}function pr(t,e){return e?t+e:t}function fr(t){return"number"==typeof t?t:parseFloat(t)}function mr(t){const e=[];wi.current=e;const n=t();wi.current=void 0;const i=bi(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>rt.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),at(i)})}(e,i,t),i}const gr=[...os,Ft,Kt];let yr=0;const vr=()=>"motion-view-"+yr++;function xr(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function wr(t,e,n,i,s){if(n&&(t.style?.setProperty("view-transition-group",n),i.push(t),"none"!==n&&s)){const n=getComputedStyle(t);"visible"===n.overflowX&&"visible"===n.overflowY||s.add(e)}}function Sr(t,e,n,i,s,o=[],r,a=[],l){const c=Ts(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??vr();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),xr(t,s,o),wr(t,h,r,a,l),h});const u=c.map(t=>e.has(t)?void 0:getComputedStyle(t).getPropertyValue("view-transition-name"));return c.map((t,i)=>{const c=e.get(t);if(c)return c;const h=u[i];let d;return h&&"none"!==h&&"auto"!==h&&"match-element"!==h&&!(t=>t.startsWith("motion-view-"))(h)?d=h:(d=vr(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),xr(t,s,o),wr(t,d,r,a,l),d})}function br(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Tr={},Pr=null;const Er=(t,e)=>{Tr[t]=e},Ar=()=>{Pr||(Pr=document.createElement("style"),Pr.id="motion-view");let t="";for(const e in Tr){const n=Tr[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=`  ${e}: ${i};\n`;t+="}\n"}Pr.textContent=t,document.head.appendChild(Pr),Tr={}},Mr=()=>{Pr&&Pr.parentElement&&Pr.parentElement.removeChild(Pr)};function Cr(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function Vr(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const kr=["layout","enter","exit","new","old"],Dr=t=>t.split(" ").every(t=>0===parseFloat(t)),Rr={group:["layout"],new:["new","enter"],old:["old","exit"]},Lr={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function Br(t){const{update:e,targets:n,resolveDefs:i,cropOverride:s,pairs:o,classNames:r,flatGroups:a,options:l}=t;if(!document.startViewTransition)return(async()=>(await e(),new di([])))();const c=new Map,u=[],h=[],d=[],p=new Set,f=new Map,m=new Set,g=new Map,y=new Map,v=new Map,x=new Map,w=t=>{n.forEach((e,n)=>{const l=r.get(n),m="root"!==n&&i.has(n)?a.has(n)?"none":"contain":void 0;let w;if("root"!==n&&i.has(n))if(o.has(n))if("old"===t)x.set(n,Ts(n)),w=Sr(n,c,u,void 0,l,h,m,d,p),v.set(n,w);else{for(const t of x.get(n)??[])t.style?.removeProperty("view-transition-name"),c.delete(t);w=Sr(o.get(n),c,u,v.get(n),l,h,m,d,p)}else w=Sr(n,c,u,void 0,l,h,m,d,p);else w=[n];const S=s.get(n);w.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==S&&g.set(n,S);const o=y.get(n)??{};o[t]=[i,w.length],y.set(n,o)})})},S=(t,e)=>{const n=y.get(t);return("old"===e?n?.old:"new"===e?n?.new:n?.new??n?.old)??[-1,1]},b=(t,e,n,i,s)=>{const o=Or(Pi(l,n),Pi(function(t,e){for(const n of Rr[e]??[]){const e=t?.[n]?.options;if(e)return e}}(t,e)??{},n));return"function"==typeof o.delay&&(o.delay=o.delay(i,s)),o},T=t=>{const[e,n]=S(t,"group"),i=b(f.get(t),"group","layout",-1===e?0:e,n);i.duration&&(i.duration=L(i.duration));const{delay:s=0,duration:o,ease:r}=Qn(i);return{delay:L(s),duration:o,ease:r}},P=new Map,E=t=>c.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of us)o[t]=n[t];const r=P.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},P.set(e,r)}}),A=t=>{const e=P.get(t);return!!(e?.old&&e?.new&&e.old.height&&e.new.height)&&Math.abs(e.old.width/e.old.height-e.new.width/e.new.height)>.2},M=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",n)||Er(":root",{"view-transition-name":"none"}),Er("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),m.forEach(t=>{Er(`::view-transition-group(${t})`,{overflow:"clip"}),Er(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),p.forEach(t=>{Er(`::view-transition-group-children(${t})`,{overflow:"clip"})}),Ar()},C=()=>{!function(t,e=[],n=[]){for(const e of t)e.style?.removeProperty("view-transition-name");for(const t of e)t.style?.removeProperty("view-transition-class");for(const t of n)t.style?.removeProperty("view-transition-group")}(u,h,d),Mr()},V=async()=>{await e(),w("new"),E("new"),(()=>{m.clear();for(const t of y.keys())"root"!==t&&(g.get(t)??A(t))&&m.add(t)})(),M()};let k;try{w("old"),E("old"),M(),k=document.startViewTransition(V)}catch(t){return C(),Promise.reject(t)}return k.finished.finally(C),new Promise((t,e)=>{k.ready.then(()=>{const e=Vr(),n=[],i=new Set,s=new Set;f.forEach((t,e)=>{const o=y.get(e),r=!!o?.new&&!o?.old,a=!!o?.old&&!o?.new;for(const o of kr){if(!t[o])continue;if("enter"===o&&!r)continue;if("exit"===o&&!a)continue;const c=br(o),[u,h]=S(e,c);if(-1===u)continue;const{keyframes:d,options:p}=t[o];for(let[f,m]of Object.entries(d)){if(null==m)continue;if("x"===f||"y"===f){I(!1,`animateView() animates view-transition layers with CSS properties; the "${f}" shorthand has no effect - use transform, e.g. { transform: "translateX(40px)" }.`);continue}if("new"===o&&r&&null!=t.enter?.keyframes[f])continue;if("old"===o&&a&&null!=t.exit?.keyframes[f])continue;const d=Or(Pi(l,f),Pi(p,f));if(!Array.isArray(m)){const e="enter"===o?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===c?r:a),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?Lr[c]?.[f]:void 0;void 0!==i&&(m=[i,m])}"function"==typeof d.delay&&(d.delay=d.delay(u,h)),d.duration&&(d.duration=L(d.duration)),d.delay&&(d.delay=L(d.delay)),n.push(new ti({...d,element:document.documentElement,name:f,pseudoElement:`::view-transition-${c}(${e})`,keyframes:m})),i.add(`${e}:${c}`),"opacity"===f&&s.add(`${e}:${c}`)}}});for(const t of e){if("finished"===t.playState)continue;const{effect:e}=t;if(!(e&&e instanceof KeyframeEffect))continue;const{pseudoElement:o}=e;if(!o)continue;const r=Cr(o);if(!r)continue;const a=f.get(r.layer);if(i.has(`${r.layer}:${r.type}`)){s.has(`${r.layer}:new`)&&s.has(`${r.layer}:old`)&&e.getKeyframes().some(t=>t.mixBlendMode)?n.push(new mi(t)):t.cancel();continue}const l="old"===r.type?"new":"new"===r.type?"old":void 0;if(l&&i.has(`${r.layer}:${l}`)&&!s.has(`${r.layer}:${l}`)){t.cancel();continue}const c=y.get(r.layer),u=!("old"!==r.type&&"new"!==r.type||!c?.old||!c?.new);let h;if(r.type.startsWith("group")){const{delay:t,duration:e,ease:n}=T(r.layer);h={delay:t,duration:e,easing:qn(n,e)}}else{const t=u?"group":r.type,[e,n]=S(r.layer,t);let i=b(a,t,"group"===t?"layout":"",-1===e?0:e,n);const s=i.visualDuration;i.duration&&(i.duration=L(i.duration)),i=Qn(i),h={delay:L(i.delay??0),duration:u&&void 0!==s?L(s):i.duration,easing:u?"linear":qn(i.ease,i.duration)}}e.updateTiming(h),n.push(new mi(t))}P.forEach((t,e)=>{if(!m.has(e))return;const{delay:i,duration:s,ease:o}=T(e);for(const r of us){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";Dr(a)&&Dr(l)||n.push(new ti({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:i,duration:s,ease:o}))}}),t(new di(n))}).catch(()=>k.updateCallbackDone.then(()=>t(new di([])),e))})}function Or(t,e){const n={...t,...e};return void 0!==e.duration&&(void 0===e.visualDuration&&delete n.visualDuration,void 0===e.type&&delete n.type),n}let jr=[],Ir=null;function Fr(){Ir=null;const[t]=jr;var e;t&&(w(jr,e=t),Ir=e,Br(e).then(t=>(e.notifyReady(t),t.finished)).catch(t=>e.notifyReject(t)).finally(Fr))}function Wr(){for(let t=jr.length-1;t>=0;t--){const e=jr[t],{interrupt:n}=e.options;if("immediate"===n){const n=jr.slice(0,t+1).map(t=>t.update),i=jr.slice(t+1);e.update=()=>{n.forEach(t=>t())},jr=[e,...i];break}}Ir&&"immediate"!==jr[0]?.options.interrupt||Fr()}class Nr{constructor(t,e={}){var n;this.currentSubject="root",this.targets=new Map,this.resolveDefs=new Set,this.cropOverride=new Map,this.pairs=new Map,this.classNames=new Map,this.flatGroups=new Set,this.notifyReady=V,this.notifyReject=V,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...e},this.readyPromise.catch(V),n=this,jr.push(n),Eo.render(Wr)}add(t,e){return this.currentSubject=t,this.resolveDefs.add(t),void 0!==e&&this.pairs.set(t,e),this.targets.has(t)||this.targets.set(t,{}),this}crop(t=!0){return this.cropOverride.set(this.currentSubject,t),this}group(t=!0){return t?this.flatGroups.delete(this.currentSubject):this.flatGroups.add(this.currentSubject),this}class(t){return this.classNames.set(this.currentSubject,t),this}layout(t={}){return this.updateTarget("layout",{},t),this}enter(t,e){return this.updateTarget("enter",t,e),this}exit(t,e){return this.updateTarget("exit",t,e),this}new(t,e){return this.updateTarget("new",t,e),this}old(t,e){return this.updateTarget("old",t,e),this}updateTarget(t,e,n={}){const{currentSubject:i,targets:s}=this;s.has(i)||s.set(i,{});s.get(i)[t]={keyframes:e,options:n}}then(t,e){return this.readyPromise.then(t,e)}}const $r=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ur=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),zr=()=>({min:0,max:0}),Yr=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Hr=new WeakMap;function Xr(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Gr(t){return"string"==typeof t||Array.isArray(t)}const Kr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_r=["initial",...Kr];function qr(t){if(Xr(t.animate))return!0;for(let e=0;e<_r.length;e++)if(Gr(t[_r[e]]))return!0;return!1}function Zr(t){return Boolean(qr(t)||t.variants)}function Jr(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Xi(s))t.addValue(i,s);else if(Xi(o))t.addValue(i,bi(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,bi(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Qr={current:null},ta={current:!1},ea="undefined"!=typeof window;function na(){if(ta.current=!0,ea)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Qr.current=t.matches;t.addEventListener("change",e),e()}else Qr.current=!1}const ia=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let sa={};function oa(t){sa=t}function ra(){return sa}class aa{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=Nn,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=dt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,rt.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,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=qr(e),this.isVariantNode=Zr(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:u,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&Xi(e)&&e.set(l[t])}}mount(t){if(this.hasBeenMounted)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];this.current=t,Hr.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(ta.current||na(),this.shouldReduceMotion=Qr.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),at(this.notifyUpdate),at(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,e){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),e.accelerate&&ri.has(t)&&this.current instanceof HTMLElement){const{factory:n,keyframes:i,times:s,ease:o,duration:r}=e.accelerate,a=new ti({element:this.current,name:t,keyframes:i,times:s,ease:o,duration:L(r)}),l=n(a);return void this.valueSubscriptions.set(t,()=>{l(),a.cancel()})}const n=An.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&rt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in sa){const e=sa[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){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ia.length;e++){const n=ia[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=Jr(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=bi(null===e?void 0:e,{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&&(E(n)||M(n))?n=parseFloat(n):"number"!=typeof n&&!Kt.test(n)&&Kt.test(e)&&(n=dn(t,e)),this.setBaseTarget(t,Xi(n)?n.get():n)),Xi(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=Wi(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Xi(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new R),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}scheduleRenderMicrotask(){Eo.render(this.render)}}class la extends aa{constructor(){super(...arguments),this.KeyframeResolver=cs}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;Xi(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class ca{constructor(t){this.isMounted=!1,this.node=t}update(){}}function ua(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 ha(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const da={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Lt.test(t))return t;t=parseFloat(t)}return`${ha(t,e.target.x)}% ${ha(t,e.target.y)}%`}},pa={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=Kt.parse(t);if(s.length>5)return i;const o=Kt.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 c=Jt(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},fa={borderRadius:{...da,applyTo:[...us]},borderTopLeftRadius:da,borderTopRightRadius:da,borderBottomLeftRadius:da,borderBottomRightRadius:da,boxShadow:pa};function ma(t,{layout:e,layoutId:n}){return An.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!fa[t]||"opacity"===t)}function ga(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(Xi(i[e])||s&&Xi(s[e])||ma(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class ya extends la{constructor(){super(...arguments),this.type="html",this.renderInstance=ua}mount(e){t.invariant(Boolean(e.style),"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(e)}readValueFromInstance(t,e){if(An.has(e))return this.projection?.isProjecting?Sn(e):Tn(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(mt(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return yo(t,e)}build(t,e,n){Fs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return ga(t,e,n)}}const va=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"]),xa=t=>"string"==typeof t&&"svg"===t.toLowerCase();function wa(t,e,n,i){ua(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(va.has(n)?n:_i(n),e.attrs[n])}function Sa(t,e,n){const i=ga(t,e,n);for(const n in t)if(Xi(t[n])||Xi(e[n])){i[-1!==En.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}class ba extends la{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Yr}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(An.has(e)){const t=un(e);return t&&t.default||0}if(Us.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=va.has(e)?e:_i(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Sa(t,e,n)}build(t,e,n){zs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){wa(t,e,0,i)}mount(t){this.isSVGTag=xa(t.tagName),super.mount(t)}}const Ta=_r.length;function Pa(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&Pa(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<Ta;n++){const i=_r[n],s=t.props[i];(Gr(s)||!1===s)&&(e[i]=s)}return e}function Ea(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 Aa=[...Kr].reverse(),Ma=Kr.length;function Ca(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>is(t,e,n)))}(t),n=Da(),i=!0,s=!1;const o=e=>(n,i)=>{const s=Ni(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function r(r){const{props:a}=t,l=Pa(t.parent)||{},c=[],u=new Set;let h={},d=1/0;for(let e=0;e<Ma;e++){const p=Aa[e],f=n[p],m=void 0!==a[p]?a[p]:l[p],g=Gr(m),y=p===r?f.isActive:null;!1===y&&(d=e);let v=m===l[p]&&m!==a[p]&&g;if(v&&(i||s)&&t.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...h},!f.isActive&&null===y||!m&&!f.prevProp||Xr(m)||"boolean"==typeof m)continue;if("exit"===p&&f.isActive&&!0!==y){f.prevResolvedValues&&(h={...h,...f.prevResolvedValues});continue}const x=Va(f.prevProp,m);let w=x||p===r&&f.isActive&&!v&&g||e>d&&g,S=!1;const b=Array.isArray(m)?m:[m];let T=b.reduce(o(p),{});!1===y&&(T={});const{prevResolvedValues:P={}}=f,E={...P,...T},A=e=>{w=!0,u.has(e)&&(S=!0,u.delete(e)),f.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in E){const e=T[t],n=P[t];if(h.hasOwnProperty(t))continue;let i=!1;i=Ui(e)&&Ui(n)?!Ea(e,n)||x:e!==n,i?null!=e?A(t):u.add(t):void 0!==e&&u.has(t)?A(t):f.protectedKeys[t]=!0}f.prevProp=m,f.prevResolvedValues=T,f.isActive&&(h={...h,...T}),(i||s)&&t.blockInitialAnimation&&(w=!1);const M=v&&x;w&&(!M||S)&&c.push(...b.map(e=>{const n={type:p};if("string"==typeof e&&(i||s)&&!M&&t.manuallyAnimateOnMount&&t.parent){const{parent:i}=t,s=Ni(i,e);if(i.enteringChildren&&s){const{delayChildren:e}=s.transition||{};n.delay=xi(i.enteringChildren,t,e)}}return{animation:e,options:n}}))}if(u.size){const e={};if("boolean"!=typeof a.initial){const n=Ni(t,Array.isArray(a.initial)?a.initial[0]:a.initial);n&&n.transition&&(e.transition=n.transition)}u.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),c.push({animation:e})}let p=Boolean(c.length);return!i||!1!==a.initial&&a.initial!==a.animate||t.manuallyAnimateOnMount||(p=!1),i=!1,s=!1,p?e(c):Promise.resolve()}return{animateChanges:r,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=r(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Da(),s=!0}}}function Va(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ea(e,t)}function ka(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Da(){return{animate:ka(!0),whileInView:ka(),whileHover:ka(),whileTap:ka(),whileDrag:ka(),whileFocus:ka(),exit:ka()}}function Ra(t,e){t.min=e.min,t.max=e.max}function La(t,e){Ra(t.x,e.x),Ra(t.y,e.y)}function Ba(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Oa(t){return t.max-t.min}function ja(t,e,n){return Math.abs(t-e)<=n}function Ia(t,e,n,i=.5){t.origin=i,t.originPoint=Jt(e.min,e.max,t.origin),t.scale=Oa(n)/Oa(e),t.translate=Jt(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 Fa(t,e,n,i){Ia(t.x,e.x,n.x,i?i.originX:void 0),Ia(t.y,e.y,n.y,i?i.originY:void 0)}function Wa(t,e,n,i=0){const s=i?Jt(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+Oa(e)}function Na(t,e,n,i){Wa(t.x,e.x,n.x,i?.x),Wa(t.y,e.y,n.y,i?.y)}function $a(t,e,n,i=0){const s=i?Jt(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+Oa(e)}function Ua(t,e,n,i){$a(t.x,e.x,n.x,i?.x),$a(t.y,e.y,n.y,i?.y)}function za(t,e,n,i,s){return t=oo(t-=e,1/n,i),void 0!==s&&(t=oo(t,1/s,i)),t}function Ya(t,e=0,n=1,i=.5,s,o=t,r=t){if(Rt.test(e)){e=parseFloat(e);e=Jt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Jt(o.min,o.max,i);t===o&&(a-=e),t.min=za(t.min,e,n,a,s),t.max=za(t.max,e,n,a,s)}function Ha(t,e,[n,i,s],o,r){Ya(t,e[n],e[i],e[s],e.scale,o,r)}const Xa=["x","scaleX","originX"],Ga=["y","scaleY","originY"];function Ka(t,e,n,i){Ha(t.x,e,Xa,n?n.x:void 0,i?i.x:void 0),Ha(t.y,e,Ga,n?n.y:void 0,i?i.y:void 0)}function _a(t){return 0===t.translate&&1===t.scale}function qa(t){return _a(t.x)&&_a(t.y)}function Za(t,e){return t.min===e.min&&t.max===e.max}function Ja(t,e){return Za(t.x,e.x)&&Za(t.y,e.y)}function Qa(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function tl(t,e){return Qa(t.x,e.x)&&Qa(t.y,e.y)}function el(t){return Oa(t.x)/Oa(t.y)}function nl(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function il(t){return[t("x"),t("y")]}function sl(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,pathRotation:s,rotateX:o,rotateY:r,skewX:a,skewY:l}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotate(${s}deg) `),o&&(i+=`rotateX(${o}deg) `),r&&(i+=`rotateY(${r}deg) `),a&&(i+=`skewX(${a}deg) `),l&&(i+=`skewY(${l}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}const ol=us.length,rl=t=>"string"==typeof t?parseFloat(t):t,al=t=>"number"==typeof t||Lt.test(t);function ll(t,e,n,i,s,o){s?(t.opacity=Jt(0,n.opacity??1,ul(i)),t.opacityExit=Jt(e.opacity??1,0,hl(i))):o&&(t.opacity=Jt(e.opacity??1,n.opacity??1,i));for(let s=0;s<ol;s++){const o=us[s];let r=cl(e,o),a=cl(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||al(r)===al(a)?(t[o]=Math.max(Jt(rl(r),rl(a),i),0),(Rt.test(a)||Rt.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=Jt(e.rotate||0,n.rotate||0,i))}function cl(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const ul=dl(0,.5,K),hl=dl(.5,.95,V);function dl(t,e,n){return i=>i<t?0:i>e?1:n(D(t,e,i))}function pl(t,e,n){const i=Xi(t)?t:bi(t);return i.start(Di("",i,e,n)),i.animation}function fl(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const ml=(t,e)=>t.depth-e.depth;class gl{constructor(){this.children=[],this.isDirty=!1}add(t){x(this.children,t),this.isDirty=!0}remove(t){w(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ml),this.isDirty=!1,this.children.forEach(t)}}function yl(t,e){const n=dt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(at(i),t(o-e))};return rt.setup(i,!0),()=>at(i)}function vl(t){return Xi(t)?t.get():t}class xl{constructor(){this.members=[]}add(t){x(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||(w(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(w(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)}}const wl={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sl={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},bl=["","X","Y","Z"];let Tl=0;function Pl(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function El(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ji(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",rt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&El(i)}function Al({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Tl++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,sr.value&&(Sl.nodes=Sl.calculatedTargetDeltas=Sl.calculatedProjections=0),this.nodes.forEach(Vl),this.nodes.forEach(Fl),this.nodes.forEach(Wl),this.nodes.forEach(kl),sr.addProjectionMetrics&&sr.addProjectionMetrics(Sl)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=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 gl)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new R),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=Ss(e)&&!or(e),this.instance=e;const{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;rt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n&&n(),n=yl(s,250),wl.hasAnimatedSinceResize&&(wl.hasAnimatedSinceResize=!1,this.nodes.forEach(Il)))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Hl,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!tl(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Pi(o,"layout"),onPlay:r,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||Il(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),at(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Nl),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&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&El(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}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(Ll),void this.nodes.forEach(Rl)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(Bl);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Ol),this.nodes.forEach(jl),this.nodes.forEach(Ml),this.nodes.forEach(Cl)):this.nodes.forEach(Bl),this.clearAllSnapshots();const t=dt.now();lt.delta=b(0,1e3/60,t-lt.timestamp),lt.timestamp=t,lt.isProcessing=!0,ct.update.process(lt),ct.preRender.process(lt),ct.render.process(lt),lt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Eo.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Dl),this.sharedNodes.forEach($l)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||Oa(this.snapshot.measuredBox.x)||Oa(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}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.layoutVersion++,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&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!qa(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||no(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)),Kl((i=n).x),Kl(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(ql))){const{scroll:t}=this.root;t&&(po(e.x,t.offset.x),po(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(La(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&&La(e,t),po(e.x,s.offset.x),po(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n){const i=n||{x:{min:0,max:0},y:{min:0,max:0}};La(i,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(po(i.x,-n.scroll.offset.x),po(i.y,-n.scroll.offset.y)),no(n.latestValues)&&go(i,n.latestValues,n.layout?.layoutBox)}return no(this.latestValues)&&go(i,this.latestValues,this.layout?.layoutBox),i}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};La(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!no(n.latestValues))continue;let i;n.instance&&(eo(n.latestValues)&&n.updateSnapshot(),i=Yr(),La(i,n.measurePageBox())),Ka(e,n.latestValues,n.snapshot?.layoutBox,i)}return no(this.latestValues)&&Ka(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}}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!==lt.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=lt.timestamp;const o=this.getClosestProjectingParent();o&&this.linkedParentVersion!==o.layoutVersion&&!o.options.layoutRoot&&this.removeRelativeTarget(),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(),Na(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(Boolean(this.resumingFrom)?this.applyTransform(this.layout.layoutBox,!1,this.target):La(this.target,this.layout.layoutBox),lo(this.target,this.targetDelta)):La(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&o&&Boolean(o.resumingFrom)===Boolean(this.resumingFrom)&&!o.options.layoutScroll&&o.target&&1!==this.animationProgress?this.createRelativeTarget(o,this.target,o.target):this.relativeParent=this.relativeTarget=void 0),sr.value&&Sl.calculatedTargetDeltas++)}getClosestProjectingParent(){if(this.parent&&!eo(this.parent.latestValues)&&!io(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.linkedParentVersion=t.layoutVersion,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}},Ua(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),La(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===lt.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;La(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;ho(this.layoutCorrected,this.treeScale,this.path,e),!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?(Ba(this.prevProjectionDelta.x,this.projectionDelta.x),Ba(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Fa(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&nl(this.projectionDelta.x,this.prevProjectionDelta.x)&&nl(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a)),sr.value&&Sl.calculatedProjections++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.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?i.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),u=!c||c.members.length<=1,h=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Yl));let d;this.animationProgress=0;const p=n?.interpolateProjection(t);this.mixTargetDelta=e=>{const n=e/1e3,i=p?.(n);i?(r.x.translate=i.x,r.x.scale=Jt(t.x.scale,1,n),r.x.origin=t.x.origin,r.x.originPoint=t.x.originPoint,r.y.translate=i.y,r.y.scale=Jt(t.y.scale,1,n),r.y.origin=t.y.origin,r.y.originPoint=t.y.originPoint):(Ul(r.x,t.x,n),Ul(r.y,t.y,n)),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ua(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),function(t,e,n,i){zl(t.x,e.x,n.x,i),zl(t.y,e.y,n.y,i)}(this.relativeTarget,this.relativeTargetOrigin,a,n),d&&Ja(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),La(d,this.relativeTarget)),l&&(this.animationValues=o,ll(o,s,this.latestValues,n,h,u)),i&&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"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(at(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rt.update(()=>{wl.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=bi(0)),this.motionValue.jump(0,!1),this.currentAnimation=pl(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({..._e("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=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&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&&_l(this.options.animationType,this.layout.layoutBox,n.layoutBox)){s=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Oa(this.layout.layoutBox.x);s.x.min=t.target.x.min,s.x.max=s.x.min+e;const n=Oa(this.layout.layoutBox.y);s.y.min=t.target.y.min,s.y.max=s.y.min+n}La(e,s),go(e,i),Fa(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new xl);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&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}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&Pl("z",t,i,this.animationValues);for(let e=0;e<bl.length;e++)Pl(`rotate${bl[e]}`,t,i,this.animationValues),Pl(`skew${bl[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;if(!this.isVisible)return void(t.visibility="hidden");const n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=vl(e?.pointerEvents)||"",void(t.transform=n?n(this.latestValues,""):"none");const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target)return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=vl(e?.pointerEvents)||""),void(this.hasProjected&&!no(this.latestValues)&&(t.transform=n?n({},""):"none",this.hasProjected=!1));t.visibility="";const s=i.animationValues||i.latestValues;this.applyTransformsToTarget();let o=sl(this.projectionDeltaWithTransform,this.treeScale,s);n&&(o=n(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,i.animationValues?t.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in fa){if(void 0===s[e])continue;const{correct:n,applyTo:r,isCSSVariable:a}=fa[e],l="none"===o?s[e]:n(s[e],i);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=i===this?vl(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(Rl),this.root.sharedNodes.clear()}}}function Ml(t){t.updateLayout()}function Cl(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;if("size"===s)il(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=Oa(i);i.min=n[t].min,i.max=i.min+s});else if("x"===s||"y"===s){const t="x"===s?"y":"x";Ra(o?e.measuredBox[t]:e.layoutBox[t],n[t])}else _l(s,e.layoutBox,n)&&il(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=Oa(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Fa(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Fa(a,t.applyTransform(i,!0),e.measuredBox):Fa(a,n,e.layoutBox);const l=!qa(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r=t.options.layoutAnchor||void 0,a={x:{min:0,max:0},y:{min:0,max:0}};Ua(a,e.layoutBox,s.layoutBox,r);const l={x:{min:0,max:0},y:{min:0,max:0}};Ua(l,n,o.layoutBox,r),tl(a,l)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=l,t.relativeTargetOrigin=a,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Vl(t){sr.value&&Sl.nodes++,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 kl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Dl(t){t.clearSnapshot()}function Rl(t){t.clearMeasurements()}function Ll(t){t.isLayoutDirty=!0,t.updateLayout()}function Bl(t){t.isLayoutDirty=!1}function Ol(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function jl(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Il(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Fl(t){t.resolveTargetDelta()}function Wl(t){t.calcProjection()}function Nl(t){t.resetSkewAndRotation()}function $l(t){t.removeLeadSnapshot()}function Ul(t,e,n){t.translate=Jt(e.translate,0,n),t.scale=Jt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function zl(t,e,n,i){t.min=Jt(e.min,n.min,i),t.max=Jt(e.max,n.max,i)}function Yl(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Hl={duration:.45,ease:[.4,0,.1,1]},Xl=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gl=Xl("applewebkit/")&&!Xl("chrome/")?Math.round:V;function Kl(t){t.min=Gl(t.min),t.max=Gl(t.max)}function _l(t,e,n){return"position"===t||"preserve-aspect"===t&&!ja(el(e),el(n),.2)}function ql(t){return t!==t.root&&t.scroll?.wasRoot}const Zl=Al({attachResizeListener:(t,e)=>fl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Jl=t=>!t.isLayoutDirty&&t.willUpdate(!1);function Ql(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Jl);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const s=e.get(i);s&&(s(),e.delete(i)),n()},dirty:n}}const tc={current:void 0},ec=Al({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!tc.current){const t=new Zl({});t.mount(window),t.setOptions({layoutScroll:!0}),tc.current=t}return tc.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),nc="[data-layout],[data-layout-id]",ic=new WeakMap;let sc;function oc(t){const e=[];return t instanceof HTMLElement&&t.matches(nc)&&e.push(t),t.querySelectorAll(nc).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function rc(t,e){const n=t.getAttribute("data-layout");return{layoutId:t.getAttribute("data-layout-id")??void 0,layout:null!==n||void 0,animationType:n&&"true"!==n?n:"both",transition:e}}function ac(t,e){let n=ic.get(t);if(n)n.setOptions(rc(t,e));else{let i=Hr.get(t);i||(i=new ya({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),To(t,i)),t.style.transform&&!no(i.latestValues)&&(t.style.transform=""),n=new ec(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=ic.get(e);if(t&&t.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...rc(t,e),visualElement:i}),n.mount(t),ic.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function lc(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),ic.delete(t)}function cc(){const t=sc;sc=void 0,function(){if(lt.isProcessing)return;const t=dt.now();lt.delta=b(0,1e3/60,t-lt.timestamp),lt.timestamp=t,lt.isProcessing=!0,ct.update.process(lt),ct.preRender.process(lt),ct.render.process(lt),lt.isProcessing=!1}();const e=new Map;for(const n of t)for(const t of n.collectTargets()){const i=e.get(t);i?i.push(n):e.set(t,[n])}const n=new Map;for(const t of(i=e.keys(),[...i].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const i=e.get(t),s=ac(t,i[i.length-1].transitionFor(t));for(const e of i)e.adopt(t,s);n.set(t,s)}var i;n.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const s=[];for(const e of t){const t=e.runUpdate();t&&s.push(t)}const o=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let i;n.forEach(t=>i||(i=t.root));for(const e of t)i||(i=e.getRoot());i?.didUpdate(),Eo.render(()=>{for(const e of t)e.finalize()})};s.length?Promise.all(s).then(o):o()}const uc=rt,hc=st.reduce((t,e)=>(t[e]=t=>at(t),t),{}),dc=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function pc(t,e){if("function"==typeof t)return t(e);null!=t&&(t.current=e)}function fc(...t){return i.useCallback(function(...t){return e=>{let n=!1;const i=t.map(t=>{const i=pc(t,e);return n||"function"!=typeof i||(n=!0),i});if(n)return()=>{for(let e=0;e<i.length;e++){const n=i[e];"function"==typeof n?n():pc(t[e],null)}}}}(...t),t)}class mc extends i.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(ws(e)&&t.isPresent&&!this.props.isPresent&&!1!==this.props.pop){const t=e.offsetParent,n=ws(t)&&t.offsetWidth||0,i=ws(t)&&t.offsetHeight||0,s=getComputedStyle(e),o=this.props.sizeRef.current;o.height=parseFloat(s.height),o.width=parseFloat(s.width),o.top=e.offsetTop,o.left=e.offsetLeft,o.right=n-o.width-o.left,o.bottom=i-o.height-o.top,o.direction=s.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function gc({children:t,isPresent:n,anchorX:s,anchorY:o,root:r,pop:a}){const l=e.useId(),c=e.useRef(null),u=e.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:h}=e.useContext(dc),p=!1!==a?t.props?.ref??t?.ref:void 0,f=fc(c,p);return e.useInsertionEffect(()=>{const{width:t,height:e,top:i,left:d,right:p,bottom:f,direction:m}=u.current;if(n||!1===a||!c.current||!t||!e)return;const g="rtl"===m,y="left"===s?g?`right: ${p}`:`left: ${d}`:g?`left: ${d}`:`right: ${p}`,v="bottom"===o?`bottom: ${f}`:`top: ${i}`;c.current.dataset.motionPopId=l;const x=document.createElement("style");h&&(x.nonce=h);const w=r??document.head;return w.appendChild(x),x.sheet&&x.sheet.insertRule(`\n          [data-motion-pop-id="${l}"] {\n            position: absolute !important;\n            width: ${t}px !important;\n            height: ${e}px !important;\n            ${y}px !important;\n            ${v}px !important;\n          }\n        `),()=>{c.current?.removeAttribute("data-motion-pop-id"),w.contains(x)&&w.removeChild(x)}},[n]),d(mc,{isPresent:n,childRef:c,sizeRef:u,pop:a,children:!1===a?t:i.cloneElement(t,{ref:f})})}const yc=({children:t,initial:n,isPresent:s,onExitComplete:o,custom:r,presenceAffectsLayout:a,mode:l,anchorX:c,anchorY:u,root:h})=>{const p=m(vc),f=e.useId(),g=e.useRef(s),x=e.useRef(o);y(()=>{g.current=s,x.current=o});let w=!0,S=e.useMemo(()=>(w=!1,{id:f,initial:n,isPresent:s,custom:r,onExitComplete:t=>{p.set(t,!0);for(const t of p.values())if(!t)return;o&&o()},register:t=>(p.set(t,!1),()=>{p.delete(t),!g.current&&!p.size&&x.current?.()})}),[s,p,o]);return a&&w&&(S={...S}),e.useMemo(()=>{p.forEach((t,e)=>p.set(e,!1))},[s]),i.useEffect(()=>{!s&&!p.size&&o&&o()},[s]),t=d(gc,{pop:"popLayout"===l,isPresent:s,anchorX:c,anchorY:u,root:h,children:t}),d(v.Provider,{value:S,children:t})};function vc(){return new Map}function xc(t=!0){const n=e.useContext(v);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect(()=>{if(t)return o(r)},[t]);const a=e.useCallback(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,a]:[!0]}const wc=t=>t.key||"";function Sc(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const bc=e.createContext(null);function Tc(){const t=function(){const t=e.useRef(!1);return y(()=>(t.current=!0,()=>{t.current=!1}),[]),t}(),[n,i]=e.useState(0),s=e.useCallback(()=>{t.current&&i(n+1)},[n]);return[e.useCallback(()=>rt.postRender(s),[s]),n]}const Pc=t=>!0===t,Ec=({children:t,id:n,inherit:i=!0})=>{const s=e.useContext(f),o=e.useContext(bc),[r,a]=Tc(),l=e.useRef(null),c=s.id||o;null===l.current&&((t=>Pc(!0===t)||"id"===t)(i)&&c&&(n=n?c+"-"+n:c),l.current={id:n,group:Pc(i)&&s.group||Ql()});const u=e.useMemo(()=>({...l.current,forceRender:r}),[a]);return d(f.Provider,{value:u,children:t})},Ac=e.createContext({strict:!1}),Mc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Cc=!1;function Vc(){return function(){if(Cc)return;const t={};for(const e in Mc)t[e]={isEnabled:t=>Mc[e].some(e=>!!t[e])};oa(t),Cc=!0}(),ra()}function kc(t){const e=Vc();for(const n in t)e[n]={...e[n],...t[n]};oa(e)}function Dc(t){return"function"==typeof t}const Rc=e.createContext(null),Lc=["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 Bc(t){return"string"==typeof t&&!t.includes("-")&&!!(Lc.indexOf(t)>-1||/[A-Z]/u.test(t))}const Oc=(t,n)=>n.isSVG??Bc(t)?new ba(n):new ya(n,{allowProjection:t!==e.Fragment}),jc=e.createContext({});function Ic(t){const{initial:n,animate:i}=function(t,e){if(qr(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Gr(e)?e:void 0,animate:Gr(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(jc));return e.useMemo(()=>({initial:n,animate:i}),[Fc(n),Fc(i)])}function Fc(t){return Array.isArray(t)?t.join(" "):t}const Wc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Nc(t,e,n){for(const i in e)Xi(e[i])||ma(i,n)||(t[i]=e[i])}function $c(t,n){const i={};return Nc(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Fs(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function Uc(t,e){const n={},i=$c(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 zc=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}});function Yc(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return zs(e,n,xa(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};Nc(e,t.style,t),o.style={...e,...o.style}}return o}const Hc=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Xc(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Hc.has(t)}function Gc(t,e){return t.startsWith("on")?!Xc(t):e?.(t)??!Xc(t)}function Kc(t,e,n,i){const s={};for(const o in t)"values"===o&&"object"==typeof t.values||Xi(t[o])||(Gc(o,i)||!0===n&&Xc(o)||!e&&!Xc(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}function _c(t,n,i,{latestValues:s},o,r=!1,a,l){const c=(a??Bc(t)?Yc:Uc)(n,s,o,t),u=Kc(n,"string"==typeof t,r,l),h=t!==e.Fragment?{...u,...c,ref:i}:{},{children:d}=n,p=e.useMemo(()=>Xi(d)?d.get():d,[d]);return e.createElement(t,{...h,children:p})}function qc(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=vl(o[t]);let{initial:r,animate:a}=t;const l=qr(t),c=Zr(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Xr(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=Wi(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}const Zc=t=>(n,i)=>{const s=e.useContext(jc),o=e.useContext(v),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:qc(n,i,s,t),renderState:e()}}(t,n,s,o);return i?r():m(r)},Jc=Zc({scrapeMotionValuesFromProps:ga,createRenderState:Wc}),Qc=Zc({scrapeMotionValuesFromProps:Sa,createRenderState:zc}),tu=Symbol.for("motionComponentSymbol");function eu(t,n,i){const s=e.useRef(i);e.useInsertionEffect(()=>{s.current=i});const o=e.useRef(null);return e.useCallback(e=>{e&&t.onMount?.(e),n&&(e?n.mount(e):n.unmount());const i=s.current;if("function"==typeof i)if(e){const t=i(e);"function"==typeof t&&(o.current=t)}else o.current?(o.current(),o.current=null):i(e);else i&&(i.current=e)},[n])}const nu=e.createContext({});function iu(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function su(t,n,i,s,o,r){const{visualElement:a}=e.useContext(jc),l=e.useContext(Ac),c=e.useContext(v),u=e.useContext(dc),h=u.reducedMotion,d=u.skipAnimations,p=e.useRef(null),f=e.useRef(!1);s=s||l.renderer,!p.current&&s&&(p.current=s(t,{visualState:n,parent:a,props:i,presenceContext:c,blockInitialAnimation:!!c&&!1===c.initial,reducedMotionConfig:h,skipAnimations:d,isSVG:r}),f.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const m=p.current,g=e.useContext(nu);!m||m.projection||!o||"html"!==m.type&&"svg"!==m.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:ou(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&iu(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:l,layoutRoot:c,layoutAnchor:u})}(p.current,i,o,g);const x=e.useRef(!1);e.useInsertionEffect(()=>{m&&x.current&&m.update(i,c)});const w=i[Zi],S=e.useRef(Boolean(w)&&"undefined"!=typeof window&&!window.MotionHandoffIsComplete?.(w)&&window.MotionHasOptimisedAnimation?.(w));return y(()=>{f.current=!0,m&&(x.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),S.current&&m.animationState&&m.animationState.animateChanges())}),e.useEffect(()=>{m&&(!S.current&&m.animationState&&m.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(w)}),S.current=!1),m.enteringChildren=void 0)}),m}function ou(t){if(t)return!1!==t.options.allowProjection?t.projection:ou(t.parent)}function ru(t,{forwardMotionProps:n=!1,type:i}={},s,o){s&&kc(s);const r=i?"svg"===i:Bc(t),a=r?Qc:Jc;function l(i,s){let l;const c={...e.useContext(dc),...i,layoutId:au(i)},{isStatic:u,isValidProp:h}=c,f=Ic(i),m=a(i,u);if(!u&&"undefined"!=typeof window){e.useContext(Ac).strict;const n=function(t){const e=Vc(),{drag:n,layout:i}=e;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(t)||i?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(c);l=n.MeasureLayout,f.visualElement=su(t,m,c,o,n.ProjectionNode,r)}return p(jc.Provider,{value:f,children:[l&&f.visualElement?d(l,{visualElement:f.visualElement,...c}):null,_c(t,i,eu(m,f.visualElement,s),m,u,n,r,h)]})}l.displayName=`motion.${"string"==typeof t?t:`create(${t.displayName??t.name??""})`}`;const c=e.forwardRef(l);return c[tu]=t,c}function au({layoutId:t}){const n=e.useContext(f).id;return n&&void 0!==t?n+"-"+t:t}function lu(t,e){if("undefined"==typeof Proxy)return ru;const n=new Map,i=(n,i)=>ru(n,i,t,e);return new Proxy((t,e)=>i(t,e),{get:(s,o)=>"create"===o?i:(n.has(o)||n.set(o,ru(o,void 0,t,e)),n.get(o))})}let cu=0;const uu={animation:{Feature:class extends ca{constructor(t){super(t),t.animationState||(t.animationState=Ca(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xr(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ca{constructor(){super(...arguments),this.id=cu++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&!1===n){if(this.isExitComplete){const{initial:t,custom:e}=this.node.getProps();if("string"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)){const n=Ni(this.node,t,e);if(n){const{transition:t,transitionEnd:e,...i}=n;for(const t in i)this.node.getValue(t)?.jump(i[t])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);return void(this.isExitComplete=!1)}const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{this.isExitComplete=!0,e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function hu(t){return{point:{x:t.pageX,y:t.pageY}}}const du=t=>e=>Lo(e)&&t(e,hu(e));function pu(t,e,n,i){return fl(t,e,du(n),i)}const fu=({current:t})=>t?t.ownerDocument.defaultView:null,mu=(t,e)=>Math.abs(t-e);function gu(t,e){const n=mu(t.x,e.x),i=mu(t.y,e.y);return Math.sqrt(n**2+i**2)}const yu=new Set(["auto","scroll"]);class vu{constructor(t,e,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=xu(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Su(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=gu(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=lt;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=xu(e,this.transformPagePoint),rt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Su("pointercancel"===t.type?this.lastMoveEventInfo:xu(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Lo(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;const a=xu(hu(t),this.transformPagePoint),{point:l}=a,{timestamp:c}=lt;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=e;u&&u(t,Su(a,this.history));const h={passive:!0,capture:!0};this.removeListeners=k(pu(this.contextWindow,"pointermove",this.handlePointerMove,h),pu(this.contextWindow,"pointerup",this.handlePointerUp,h),pu(this.contextWindow,"pointercancel",this.handlePointerUp,h)),r&&this.startScrollTracking(r)}startScrollTracking(t){let e=t.parentElement;for(;e;){const t=getComputedStyle(e);(yu.has(t.overflowX)||yu.has(t.overflowY))&&this.scrollPositions.set(e,{x:e.scrollLeft,y:e.scrollTop}),e=e.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},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),rt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),at(this.updatePoint)}}function xu(t,e){return e?{point:e(t.point)}:t}function wu(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Su({point:t},e){return{point:t,delta:wu(t,Tu(e)),offset:wu(t,bu(e)),velocity:Pu(e,.1)}}function bu(t){return t[0]}function Tu(t){return t[t.length-1]}function Pu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Tu(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>L(e)));)n--;if(!i)return{x:0,y:0};i===t[0]&&t.length>2&&s.timestamp-i.timestamp>2*L(e)&&(i=t[1]);const o=B(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}function Eu(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 Au(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 Mu=.35;function Cu(t,e,n){return{min:Vu(t,e),max:Vu(t,n)}}function Vu(t,e){return"number"==typeof t?t:t[e]||0}const ku=new WeakMap;class Du{constructor(t){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}start(t,{snapToCursor:e=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new vu(t,{onSessionStart:t=>{e&&this.snapToCursor(hu(t).point),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vo(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),il(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Rt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=Oa(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&rt.update(()=>s(t,e),!1,!0),Ki(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.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)return 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),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&rt.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.startAnimation({x:0,y:0})}},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,distanceThreshold:n,contextWindow:fu(this.visualElement),element:this.visualElement.current})}stop(t,e){const n=t||this.latestPointerEvent,i=e||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;const{velocity:o}=i;this.startAnimation(o);const{onDragEnd:r}=this.getProps();r&&rt.postRender(()=>r(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Lu(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Jt(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Jt(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&iu(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Eu(t.x,n,s),y:Eu(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Mu){return!1===t?t=0:!0===t&&(t=Mu),{x:Cu(t,"left","right"),y:Cu(t,"top","bottom")}}(e),i!==this.constraints&&!iu(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&il(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}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!iu(e))return!1;const i=e.current;t.invariant(null!==i,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const o=vo(i,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Au(t.x,e.x),y:Au(t.y,e.y)}}(s.layout.layoutBox,o);if(n){const t=n(Js(r));this.hasMutatedConstraints=!!t,t&&(r=Zs(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=il(r=>{if(!Lu(r,e,this.currentDirection))return;let l=a&&a[r]||{};!0!==o&&o!==r||(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Ki(this.visualElement,t),n.start(Di(t,n,0,e,this.visualElement,!1))}stopAnimation(){il(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){il(e=>{const{drag:n}=this.getProps();if(!Lu(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e],r=s.get()||0;s.set(t[e]-Jt(n,o,.5)+r)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!iu(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};il(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=Oa(t),s=Oa(e);return s>i?n=D(e.min,e.max-i,t.min):i>s&&(n=D(t.min,t.max-s,e.min)),b(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),il(e=>{if(!Lu(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(Jt(s,o,i[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ku.set(this.visualElement,this);const t=this.visualElement.current,e=pu(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&Io(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps();iu(e)&&e.current&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=nr(t,Ru(n)),s=nr(e,Ru(n));return()=>{i(),s()}}(t,e.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),rt.read(i);const r=fl(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(il(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{r(),e(),o(),a&&a(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Mu,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Ru(t){let e=!0;return()=>{e?e=!1:t()}}function Lu(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Bu=t=>(e,n)=>{t&&rt.update(()=>t(e,n),!1,!0)};let Ou=!1;class ju extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),Ou&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),wl.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,t.layoutDependency!==e&&o.setOptions({...o.options,layoutDependency:e}),Ou=!0,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||rt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{visualElement:t,layoutAnchor:e}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=e,n.root.didUpdate(),Eo.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;Ou=!0,i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Iu(t){const[n,i]=xc(),s=e.useContext(f);return d(ju,{...t,layoutGroup:s,switchLayoutGroup:e.useContext(nu),isPresent:n,safeToRemove:i})}const Fu={pan:{Feature:class extends ca{constructor(){super(...arguments),this.removePointerDownListener=V}onPointerDown(t){this.session=new vu(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fu(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Bu(t),onStart:Bu(e),onMove:Bu(n),onEnd:(t,e)=>{delete this.session,i&&rt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=pu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends ca{constructor(t){super(t),this.removeGroupControls=V,this.removeListeners=V,this.controls=new Du(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||V}update(){const{dragControls:t}=this.node.getProps(),{dragControls:e}=this.node.prevProps||{};t!==e&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},ProjectionNode:ec,MeasureLayout:Iu}};function Wu(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&rt.postRender(()=>s(e,hu(e)))}function Nu(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&rt.postRender(()=>s(e,hu(e)))}const $u=new WeakMap,Uu=new WeakMap,zu=t=>{const e=$u.get(t.target);e&&e(t)},Yu=t=>{t.forEach(zu)};function Hu(t,e,n){const i=function({root:t,...e}){const n=t||document;Uu.has(n)||Uu.set(n,{});const i=Uu.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(Yu,{root:t,...e})),i[s]}(e);return $u.set(t,n),i.observe(t),()=>{$u.delete(t),i.unobserve(t)}}const Xu={some:0,all:1};const Gu={inView:{Feature:class extends ca{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:Xu[i]};this.stopObserver=Hu(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 ca{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:e,propagate:n}=this.node.props;this.unmount=zo(t,(t,e)=>(Nu(this.node,e,"Start"),(t,{success:e})=>Nu(this.node,t,e?"End":"Cancel")),{useGlobalTarget:e,stopPropagation:!1===n?.tap})}unmount(){}}},focus:{Feature:class extends ca{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=k(fl(this.node.current,"focus",()=>this.onFocus()),fl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends ca{mount(){const{current:t}=this.node;t&&(this.unmount=Do(t,(t,e)=>(Wu(this.node,e,"Start"),t=>Wu(this.node,t,"End"))))}unmount(){}}}},Ku={layout:{ProjectionNode:ec,MeasureLayout:Iu}},_u=lu({...uu,...Gu,...Fu,...Ku},Oc);function qu(t,e,n,i,s,o="ltr"){const r=t.findIndex(t=>t.value===e);if(-1===r)return t;if("xy"===s){const{layout:e}=t[r],i={x:Jt(e.x.min,e.x.max,.5)+n.x,y:Jt(e.y.min,e.y.max,.5)+n.y},s=function(t){const e=[];return t.forEach(t=>{const{min:n,max:i}=t.layout.y,s=e[e.length-1];!s||n>=s.max||i<=s.min?e.push({items:[t],min:n,max:i}):(s.items.push(t),s.min=Math.min(s.min,n),s.max=Math.max(s.max,i))}),e}(t),a=s.find(e=>e.items.includes(t[r])),l=s.reduce((t,e)=>Zu(i.y,e)<Zu(i.y,t)?e:t);if(l!==a)return function(t,e,n,i,s){const o=t.filter((t,n)=>n!==e),r=i.items.find(t=>{const e=Jt(t.layout.x.min,t.layout.x.max,.5);return"ltr"===s?n<e:n>e}),a=r?o.indexOf(r):o.indexOf(i.items[i.items.length-1])+1,l=[...o];return l.splice(a,0,t[e]),l.every((e,n)=>e===t[n])?t:l}(t,r,i.x,l,o);const c=Ju(i,e);let u=-1,h=c;return t.forEach((t,e)=>{if(e===r)return;const n=Ju(i,t.layout);n<h&&(u=e,h=n)}),-1===u?t:S(t,r,r+Math.sign(u-r))}if(!i[s])return t;const a=i[s]>0?1:-1,l=t[r+a];if(!l)return t;const c=t[r].layout[s],u=l.layout[s],h=Jt(u.min,u.max,.5);return 1===a&&c.max+n[s]>h||-1===a&&c.min+n[s]<h?S(t,r,r+a):t}function Zu(t,e){return t<e.min?e.min-t:t>e.max?t-e.max:0}function Ju(t,e){const n=Math.max(e.x.min-t.x,0,t.x-e.x.max),i=Math.max(e.y.min-t.y,0,t.y-e.y.max);return n*n+i*i}const Qu=(t,e)=>t.max<=e.min||e.max<=t.min;function th({children:n,as:i="ul",axis:s,onReorder:o,values:r,...a},l){const c=m(()=>_u[i]),u=e.useRef(new Map),[h,p]=e.useState("y"),f=e.useRef(!1),g=e.useRef(null),y=s||h;t.invariant(Boolean(r),"Reorder.Group must be provided a values prop","reorder-values");const v=new Set(r);u.current.forEach((t,e)=>{v.has(e)||u.current.delete(e)});const x={axis:y,groupRef:g,registerItem:(t,e)=>{if(u.current.set(t,e),!s){const t=function(t){let e=!1,n=!1;for(let i=0;i<t.length;i++)for(let s=i+1;s<t.length;s++)if(e||(e=Qu(t[i].x,t[s].x)),n||(n=Qu(t[i].y,t[s].y)),e&&n)return"xy";return e?"x":"y"}(r.flatMap(t=>{const e=u.current.get(t);return e?[e]:[]}));t!==h&&p(t)}},updateOrder:(t,e,n)=>{if(f.current)return;const i=r.flatMap(t=>{const e=u.current.get(t);return e?[{value:t,layout:e}]:[]}),s="rtl"===g.current?.ownerDocument.defaultView?.getComputedStyle(g.current).direction?"rtl":"ltr",a=qu(i,t,e,n,y,s);if(i!==a){f.current=!0;const t=[...r],e=i.map(({value:t})=>r.indexOf(t));a.forEach(({value:n},i)=>{t[e[i]]=n}),o(t)}}};e.useEffect(()=>{f.current=!1});const w={overflowAnchor:"none",...a.style};return d(c,{...a,style:w,ref:t=>{g.current=t,"function"==typeof l?l(t):l&&(l.current=t)},ignoreStrict:!0,children:d(Rc.Provider,{value:x,children:n})})}const eh=e.forwardRef(th);function nh(t){const n=m(()=>bi(t)),{isStatic:i}=e.useContext(dc);if(i){const[,i]=e.useState(t);e.useEffect(()=>n.on("change",i),[])}return n}function ih(t,e){const n=nh(e()),i=()=>n.set(e());return i(),y(()=>{const e=()=>rt.preRender(i,!1,!0),n=t.map(t=>t.on("change",e));return()=>{n.forEach(t=>t()),at(i)}}),n}function sh(t,e,n,i){if("function"==typeof t)return function(t){wi.current=[],t();const e=ih(wi.current,t);return wi.current=void 0,e}(t);if(void 0!==n&&!Array.isArray(n)&&"function"!=typeof e)return function(t,e,n,i){const s=m(()=>Object.keys(n)),o=m(()=>({}));for(const r of s)o[r]=sh(t,e,n[r],i);return o}(t,e,n,i);const s="function"==typeof e?e:ar(e,n,i),o=Array.isArray(t)?oh(t,s):oh([t],([t])=>s(t)),r=Array.isArray(t)?void 0:t.accelerate;return r&&!r.isTransformed&&"function"!=typeof e&&Array.isArray(n)&&!1!==i?.clamp&&(o.accelerate={...r,times:e,keyframes:n,isTransformed:!0,...i?.ease?{ease:i.ease}:{}}),o}function oh(t,e){const n=m(()=>[]);return ih(t,()=>{n.length=0;const i=t.length;for(let e=0;e<i;e++)n[e]=t[e].get();return e(n)})}const rh=new Set(["auto","scroll"]),ah=new WeakMap,lh=new WeakMap;let ch=null;function uh(t,e){const n=getComputedStyle(t),i="x"===e?n.overflowX:n.overflowY,s=t===document.body||t===document.documentElement;return rh.has(i)||s}function hh(t,e){let n=t?.parentElement;for(;n;){if(uh(n,e))return n;n=n.parentElement}return null}function dh(t,e,n,i){if(!t)return;ch=t;const s=hh(t,n);if(!s)return;const o=e-("x"===n?window.scrollX:window.scrollY),{amount:r,edge:a}=function(t,e,n){const i=e.getBoundingClientRect(),s=t-("x"===n?Math.max(0,i.left):Math.max(0,i.top)),o=("x"===n?Math.min(window.innerWidth,i.right):Math.min(window.innerHeight,i.bottom))-t;if(s<50){const t=1-s/50;return{amount:-25*t*t,edge:"start"}}if(o<50){const t=1-o/50;return{amount:25*t*t,edge:"end"}}return{amount:0,edge:null}}(o,s,n);if(null===a)return lh.delete(s),void ah.delete(s);const l=lh.get(s),c=s===document.body||s===document.documentElement;if(l!==a){if(!("start"===a&&i<0||"end"===a&&i>0))return;lh.set(s,a);const t="x"===n?s.scrollWidth-(c?window.innerWidth:s.clientWidth):s.scrollHeight-(c?window.innerHeight:s.clientHeight);ah.set(s,t)}if(r>0){const t=ah.get(s);if(("x"===n?c?window.scrollX:s.scrollLeft:c?window.scrollY:s.scrollTop)>=t)return}"x"===n?c?window.scrollBy({left:r}):s.scrollLeft+=r:c?window.scrollBy({top:r}):s.scrollTop+=r}function ph(t,e=0){return Xi(t)?t:nh(e)}function fh({children:n,style:i={},value:s,as:o="li",onDrag:r,onDragEnd:a,layout:l=!0,...c},u){const h=m(()=>_u[o]),p=e.useContext(Rc),f={x:ph(i.x),y:ph(i.y)},g=sh([f.x,f.y],([t,e])=>t||e?1:"unset");t.invariant(Boolean(p),"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:v,updateOrder:x,groupRef:w}=p;return d(h,{drag:"xy"===y||y,...c,dragSnapToOrigin:!0,style:{...i,x:f.x,y:f.y,zIndex:g},layout:l,onDrag:(t,e)=>{const{velocity:n,point:i}=e,o={x:f.x.get(),y:f.y.get()};x(s,o,n);const a="xy"===y?Math.abs(n.x)>Math.abs(n.y)?"x":"y":y;dh(w.current,i[a],a,n[a]),r&&r(t,e)},onDragEnd:(t,e)=>{!function(){if(ch){const t=hh(ch,"y");t&&(lh.delete(t),ah.delete(t));const e=hh(ch,"x");e&&e!==t&&(lh.delete(e),ah.delete(e)),ch=null}}(),a&&a(t,e)},onLayoutMeasure:t=>{v(s,t)},ref:u,ignoreStrict:!0,children:n})}const mh=e.forwardRef(fh);var gh=Object.freeze({__proto__:null,Group:eh,Item:mh});function yh(t){return"object"==typeof t&&!Array.isArray(t)}function vh(t,e,n,i){return null==t?[]:"string"==typeof t&&yh(e)?Ts(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function xh(t,e,n){return t*(e+1)+n*e}function wh(t,e,n,i){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function Sh(t,e,n,i,s,o){!function(t,e,n){for(let i=0;i<t.length;i++){const s=t[i];s.at>e&&s.at<n&&(w(t,s),i--)}}(t,s,o);for(let r=0;r<e.length;r++)t.push({value:e[r],at:Jt(s,o,i[r]),easing:tt(n,r)})}function bh(t,e,n=0){const i=e+1+e*n;for(let e=0;e<t.length;e++)t[e]=t[e]/i}function Th(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Ph(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Eh(t,e){return e[t]||(e[t]=[]),e[t]}function Ah(t){return Array.isArray(t)?t:[t]}function Mh(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Ch=t=>"number"==typeof t,Vh=t=>t.every(Ch);function kh(e,n,i,s){const o=[];if(function(t,e){return Xi(t)||"number"==typeof t||"string"==typeof t&&!yh(e)}(e,n))o.push(pl(e,yh(n)&&n.default||n,i&&i.default||i));else{if(null==e)return o;const r=vh(e,n,s),a=r.length;t.invariant(Boolean(a),"No valid elements provided.","no-valid-elements");for(let t=0;t<a;t++){const e=r[t],s={...i};"delay"in s&&"function"==typeof s.delay&&(s.delay=s.delay(t,a)),e instanceof Element?o.push(...bo(e,n,s,Hr.get(e))):o.push(...xs(ys(e)??Po,e,n,s))}}return o}function Dh(e,n,i){const s=[],o=function(e,{defaultTransition:n={},...i}={},s,o){const r=n.duration||.3,a=new Map,l=new Map,c={},u=new Map;let h=0,d=0,p=0;for(let i=0;i<e.length;i++){const a=e[i];if("string"==typeof a){u.set(a,d);continue}if(!Array.isArray(a)){u.set(a.name,wh(d,a.at,h,u));continue}let[f,m,g={}]=a;void 0!==g.at&&(d=wh(d,g.at,h,u));let y=0;const v=(e,i,s,a=0,l=0)=>{const c=Ah(e),{delay:u=0,times:h=Ne(c),type:f=n.type||"keyframes",repeat:m,repeatType:g,repeatDelay:v=0,...x}=i;let{ease:w=n.ease||"easeOut",duration:S}=i;const b="function"==typeof u?u(a,l):u,T=c.length,P=Jn(f)?f:o?.[f||"keyframes"];if(T<=2&&P){let t=100;if(2===T&&Vh(c)){const e=c[1]-c[0];t=Math.abs(e)}const e={...n,...x};void 0!==S&&(e.duration=L(S));const i=ge(e,t,P);w=i.ease,S=i.duration}S??(S=r);const E=d+b;1===h.length&&0===h[0]&&(h[1]=1);const A=h.length-c.length;if(A>0&&We(h,A),1===c.length&&c.unshift(null),m&&t.warning(m<20,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below 20 or apply repeat at the sequence level instead.`),m&&m<20){const t=S>0?v/S:0;S=xh(S,m,v);const e=[...c],n=[...h];w=Array.isArray(w)?[...w]:[w];const i=[...w],s="reverse"===g||"mirror"===g;let o=e,r=i;s&&(o=[...e].reverse(),"reverse"===g&&(r=[...i].reverse().map(t=>"function"==typeof t?U(t):t)));for(let a=0;a<m;a++){const l=s&&a%2==0,u=l?o:e,d=l?r:i,p=(a+1)*(1+t);t>0&&(c.push(c[c.length-1]),h.push(p),w.push("linear")),c.push(...u);for(let t=0;t<u.length;t++)h.push(n[t]+p),w.push(0===t?"linear":tt(d,t-1))}bh(h,m,t)}const M=E+S;Sh(s,c,w,h,E,M),y=Math.max(b+S,y),p=Math.max(M,p)};if(Xi(f))v(m,g,Eh("default",Ph(f,l)));else{const t=vh(f,m,s,c),e=t.length;for(let n=0;n<e;n++){const i=Ph(t[n],l);for(const t in m)v(m[t],Mh(g,t),Eh(t,i),n,e)}}h=d,d+=y}return l.forEach((t,e)=>{for(const s in t){const o=t[s];o.sort(Th);const r=[],l=[],c=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:i}=o[t];r.push(n),l.push(D(0,p,e)),c.push(i||"easeOut")}0!==l[0]&&(l.unshift(0),r.unshift(r[0]),c.unshift("easeInOut")),1!==l[l.length-1]&&(l.push(1),r.push(null)),a.has(e)||a.set(e,{keyframes:{},transition:{}});const u=a.get(e);u.keyframes[s]=r;const{type:h,...d}=n;u.transition[s]={...d,duration:p,ease:c,times:l,...i}}}),a}(e.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],n=bi(0);return n.on("change",e),1===t.length?[n,[0,1]]:2===t.length?[n,[0,1],t[1]]:[n,t[1],t[2]]}return t}),n,i,{spring:je});return o.forEach(({keyframes:t,transition:e},n)=>{s.push(...kh(n,t,e))}),s}function Rh(t={}){const{scope:e,reduceMotion:n,skipAnimations:i}=t;return function(t,s,o){let r,a=[];const l={};if(void 0!==n&&(l.reduceMotion=n),void 0!==i&&(l.skipAnimations=i),c=t,Array.isArray(c)&&c.some(Array.isArray)){const{onComplete:n,...i}=s||{};"function"==typeof n&&(r=n),a=Dh(t,{...l,...i},e)}else{const{onComplete:n,...i}=o||{};"function"==typeof n&&(r=n),a=kh(t,s,{...l,...i},e)}var c;const u=new fi(a);return r&&u.finished.then(r),e&&(e.animations.push(u),u.finished.then(()=>{w(e.animations,u)})),u}}const Lh=Object.assign(Rh(),{addEffect:ms,removeEffect:gs});const Bh=e=>function(n,i,s){return new fi(function(e,n,i,s){if(null==e)return[];const o=Ts(e,s),r=o.length;t.invariant(Boolean(r),"No valid elements provided.","no-valid-elements");const a=[];for(let t=0;t<r;t++){const e=o[t],s={...i};"function"==typeof s.delay&&(s.delay=s.delay(t,r));for(const t in n){let i=n[t];Array.isArray(i)||(i=[i]);const o={...Pi(s,t)};o.duration&&(o.duration=L(o.duration)),o.delay&&(o.delay=L(o.delay));const r=vi(e),l=yi(t,o.pseudoElement||""),c=r.get(l);c&&c.stop(),a.push({map:r,key:l,unresolvedKeyframes:i,options:{...o,element:e,name:t,allowFlatten:!s.type&&!s.ease}})}}for(let t=0;t<a.length;t++){const{unresolvedKeyframes:e,options:n}=a[t],{element:i,name:s,pseudoElement:o}=n;o||null!==e[0]||(e[0]=Yo(i,s)),pn(e),ds(e,s),!o&&e.length<2&&e.unshift(Yo(i,s)),n.keyframes=e}const l=[];for(let t=0;t<a.length;t++){const{map:e,key:n,options:i}=a[t],s=new ti(i);e.set(n,s),s.finished.finally(()=>e.delete(n)),l.push(s)}return l}(n,i,s,e))},Oh=Bh();function jh(t){return"undefined"!=typeof window&&(t?Xn():Hn())}const Ih={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Fh(t,e,n,i){const s=n[e],{length:o,position:r}=Ih[e],a=s.current,l=n.time;s.current=Math.abs(t[`scroll${r}`]),s.scrollLength=t[`scroll${o}`]-t[`client${o}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=D(0,s.scrollLength,s.current);const c=i-l;s.velocity=c>50?0:O(s.current-a,c)}const Wh={start:0,center:.5,end:1};function Nh(t,e,n=0){let i=0;if(t in Wh&&(t=Wh[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(i=e*t),n+i}const $h=[0,0];function Uh(t,e,n,i){let s=Array.isArray(t)?t:$h,o=0,r=0;return"number"==typeof t?s=[t,t]:"string"==typeof t&&(s=(t=t.trim()).includes(" ")?t.split(" "):[t,Wh[t]?t:"0"]),o=Nh(s[0],n,i),r=Nh(s[1],e),o-r}const zh={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Yh={x:0,y:0};function Hh(t,e,n){const{offset:i=zh.All}=n,{target:s=t,axis:o="y"}=n,r="y"===o?"height":"width",a=s!==t?function(t,e){const n={x:0,y:0};let i=t;for(;i&&i!==e;)if(ws(i))n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if("svg"===i.tagName){const t=i.getBoundingClientRect();i=i.parentElement;const e=i.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(i instanceof SVGGraphicsElement))break;{const{x:t,y:e}=i.getBBox();n.x+=t,n.y+=e;let s=null,o=i.parentNode;for(;!s;)"svg"===o.tagName&&(s=o),o=i.parentNode;i=s}}return n}(s,t):Yh,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(s),c={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let u=!e[o].interpolate;const h=i.length;for(let t=0;t<h;t++){const n=Uh(i[t],c[r],l[r],a[o]);u||n===e[o].interpolatorOffsets[t]||(u=!0),e[o].offset[t]=n}u&&(e[o].interpolate=Fe(e[o].offset,Ne(i),{clamp:!1}),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=b(0,1,e[o].interpolate(e[o].current))}function Xh(t,e,n,i={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!==t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),function(t,e,n){Fh(t,"x",e,n),Fh(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&Hh(t,n,i)},notify:()=>e(n)}}const Gh=new WeakMap,Kh=new WeakMap,_h=new WeakMap,qh=new WeakMap,Zh=new WeakMap,Jh=t=>t===document.scrollingElement?window:t;function Qh(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...i}={}){if(!e)return V;let s=_h.get(e);s||(s=new Set,_h.set(e,s));const o=Xh(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(s.add(o),!Gh.has(e)){const t=()=>{for(const t of s)t.measure(lt.timestamp);rt.preUpdate(n)},n=()=>{for(const t of s)t.notify()},i=()=>rt.read(t);Gh.set(e,i);const o=Jh(e);window.addEventListener("resize",i),e!==document.documentElement&&Kh.set(e,nr(e,i)),o.addEventListener("scroll",i),i()}if(n&&!Zh.has(e)){const t=Gh.get(e),n={width:e.scrollWidth,height:e.scrollHeight};qh.set(e,n);const i=()=>{const i=e.scrollWidth,s=e.scrollHeight;n.width===i&&n.height===s||(t(),n.width=i,n.height=s)},s=rt.read(i,!0);Zh.set(e,s)}const r=Gh.get(e);return rt.read(r,!1,!0),()=>{at(r);const t=_h.get(e);if(!t)return;if(t.delete(o),t.size)return;const n=Gh.get(e);Gh.delete(e),n&&(Jh(e).removeEventListener("scroll",n),Kh.get(e)?.(),window.removeEventListener("resize",n));const i=Zh.get(e);i&&(at(i),Zh.delete(e)),qh.delete(e)}}const td=[[zh.Enter,"entry"],[zh.Exit,"exit"],[zh.Any,"cover"],[zh.All,"contain"]],ed={start:0,end:1};function nd(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=ed[e[0]],i=ed[e[1]];return void 0!==n&&void 0!==i?[n,i]:void 0}function id(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=nd(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let t=0;t<2;t++){const i=n[t],s=e[t];if(i[0]!==s[0]||i[1]!==s[1])return!1}return!0}function sd(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of td)if(id(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const od=new Map;function rd(t){const e={value:0},n=Qh(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function ad({source:t,container:e,...n}){const{axis:i}=n;t&&(e=t);let s=od.get(e);s||(s=new Map,od.set(e,s));const o=n.target??"self";let r=s.get(o);r||(r={},s.set(o,r));const a=i+(n.offset??[]).join(",");if(!r[a])if(n.target&&jh(n.target)){const t=sd(n.offset);r[a]=t?new ViewTimeline({subject:n.target,axis:i}):rd({container:e,...n})}else jh()?r[a]=new ScrollTimeline({source:e,axis:i}):r[a]=rd({container:e,...n});return r[a]}function ld(t,{axis:e="y",container:n=document.scrollingElement,...i}={}){if(!n)return V;const s={axis:e,container:n,...i};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||function(t){return t&&(t.target||t.offset)}(e)?Qh(n=>{t(n[e.axis].progress,n)},e):ir(t,ad(e))}(t,s):function(t,e){const n=ad(e),i=e.target?sd(e.offset):void 0,s=e.target?jh(e.target)&&!!i:jh();return t.attachTimeline({timeline:s?n:void 0,...i&&s&&{rangeStart:i.rangeStart,rangeEnd:i.rangeEnd},observe:t=>(t.pause(),ir(e=>{t.time=t.iterationDuration*e},n))})}(t,s)}const cd={some:0,all:1};function ud(t,e,{root:n,margin:i,amount:s="some"}={}){const o=Ts(t),r=new WeakMap,a=new IntersectionObserver(t=>{t.forEach(t=>{const n=r.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?r.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),r.delete(t.target))})},{root:n,rootMargin:i,threshold:"number"==typeof s?s:cd[s]});return o.forEach(t=>a.observe(t)),()=>a.disconnect()}const hd=lu();function dd(t){return e.useEffect(()=>()=>t(),[])}const pd={renderer:Oc,...uu,...Gu},fd={...pd,...Fu,...Ku},md={renderer:Oc,...uu};function gd(t,n,i){e.useInsertionEffect(()=>t.on(n,i),[t,n,i])}const yd=()=>({scrollX:bi(0),scrollY:bi(0),scrollXProgress:bi(0),scrollYProgress:bi(0)}),vd=t=>!!t&&!t.current;function xd(t,e,n,i){return{factory:s=>{let o;const r=()=>{vd(n)||vd(i)?Eo.read(r):o=ld(s,{...e,axis:t,container:n?.current||void 0,target:i?.current||void 0})};return Eo.read(r),()=>{Ao(r),o?.()}},times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function wd({container:n,target:i,...s}={}){const o=m(yd);(function(t,e){return"undefined"!=typeof window&&(t?Xn()&&!!sd(e):Hn())})(i,s.offset)&&(o.scrollXProgress.accelerate=xd("x",s,n,i),o.scrollYProgress.accelerate=xd("y",s,n,i));const r=e.useRef(null),a=e.useRef(!1),l=e.useCallback(()=>(r.current=ld((t,{x:e,y:n})=>{o.scrollX.set(e.current),o.scrollXProgress.set(e.progress),o.scrollY.set(n.current),o.scrollYProgress.set(n.progress)},{...s,container:n?.current||void 0,target:i?.current||void 0}),()=>{r.current?.()}),[n,i,JSON.stringify(s.offset)]);return y(()=>(a.current=!1,vd(n)||vd(i)?void(a.current=!0):l()),[l]),e.useEffect(()=>{if(!a.current)return;let e;const s=()=>{const s=vd(n),o=vd(i);t.invariant(!s,"Container ref is defined but not hydrated","use-scroll-ref"),t.invariant(!o,"Target ref is defined but not hydrated","use-scroll-ref"),s||o||(e=l())};return Eo.read(s),()=>{Ao(s),e?.()}},[l]),o}function Sd(t,n={}){const{isStatic:i}=e.useContext(dc),s=()=>Xi(t)?t.get():t;if(i)return sh(s);const o=nh(s());return e.useInsertionEffect(()=>dr(o,t,n),[o,JSON.stringify(n)]),o}function bd(t){const n=e.useRef(0),{isStatic:i}=e.useContext(dc);e.useEffect(()=>{if(i)return;const e=({timestamp:e,delta:i})=>{n.current||(n.current=e),t(e-n.current,i)};return rt.update(e,!0),()=>at(e)},[t])}class Td extends Si{constructor(){super(...arguments),this.isEnabled=!1}add(t){(An.has(t)||ri.has(t))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Pd(){!ta.current&&na();const[t]=e.useState(Qr.current);return t}function Ed(){const t=Pd(),{reducedMotion:n}=e.useContext(dc);return"never"!==n&&("always"===n||t)}function Ad(t,e){[...e].reverse().forEach(n=>{const i=t.getVariant(n);i&&Hi(t,i),t.variantChildren&&t.variantChildren.forEach(t=>{Ad(t,e)})})}function Md(){let e=!1;const n=new Set,i={subscribe:t=>(n.add(t),()=>{n.delete(t)}),start(i,s){t.invariant(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");const o=[];return n.forEach(t=>{o.push(is(t,i,{transitionOverride:s}))}),Promise.all(o)},set:i=>(t.invariant(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),n.forEach(t=>{!function(t,e){Array.isArray(e)?Ad(t,e):"string"==typeof e?Ad(t,[e]):Hi(t,e)}(t,i)})),stop(){n.forEach(t=>{!function(t){t.values.forEach(t=>t.stop())}(t)})},mount:()=>(e=!0,()=>{e=!1,i.stop()})};return i}function Cd(){const t=m(Md);return y(t.mount,[]),t}const Vd=Cd;class kd{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,e){this.componentControls.forEach(n=>{n.start(t.nativeEvent||t,e)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const Dd=()=>new kd;function Rd(t){return null!==t&&"object"==typeof t&&tu in t}function Ld(){return Bd}function Bd(t){tc.current&&(tc.current.isUpdating=!1,tc.current.blockUpdate(),t&&t())}const Od=new Map,jd=new Map,Id=(t,e)=>`${t}: ${An.has(e)?"transform":e}`;function Fd(t,e,n){const i=Id(t,e),s=Od.get(i);if(!s)return null;const{animation:o,startTime:r}=s;function a(){window.MotionCancelOptimisedAnimation?.(t,e,n)}return o.onfinish=a,null===r||window.MotionHandoffIsComplete?.(t)?(a(),null):r}let Wd,Nd;const $d=new Set;function Ud(){$d.forEach(t=>{t.animation.play(),t.animation.startTime=t.startTime}),$d.clear()}const zd=()=>({});class Yd extends aa{constructor(){super(...arguments),this.measureInstanceViewportBox=Yr}build(){}resetTransform(){}restoreTransform(){}removeValueFromRenderState(){}renderInstance(){}scrapeMotionValuesFromProps(){return{}}getBaseTargetFromProps(){}readValueFromInstance(t,e,n){return n.initialState[e]||0}sortInstanceNodePosition(){return 0}}const Hd=Zc({scrapeMotionValuesFromProps:zd,createRenderState:zd});let Xd=0;const Gd=t=>t>.001?1/t:1e5;let Kd=!1;t.AnimatePresence=({children:t,custom:n,initial:i=!0,onExitComplete:s,presenceAffectsLayout:o=!0,mode:r="sync",propagate:a=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[p,g]=xc(a),v=e.useMemo(()=>Sc(t),[t]),x=a&&!p?[]:v.map(wc),w=e.useRef(!0),S=e.useRef(v),b=m(()=>new Map),T=e.useRef(new Set),[P,E]=e.useState(v),[A,M]=e.useState(v);y(()=>{!a||p||A.length||g?.()},[p,a,A.length,g]),y(()=>{w.current=!1,S.current=v;for(let t=0;t<A.length;t++){const e=wc(A[t]);x.includes(e)?(b.delete(e),T.current.delete(e)):!0!==b.get(e)&&b.set(e,!1)}},[A,x.length,x.join("-")]);const C=[];if(v!==P){let t=[...v],e=0;for(const n of A){const i=x.indexOf(wc(n));-1===i?(t.splice(e++,0,n),C.push(n)):e=i+C.length+1}return"wait"===r&&C.length&&(t=C),M(Sc(t)),E(v),null}const{forceRender:V}=e.useContext(f);return d(h,{children:A.map(t=>{const e=wc(t),h=!(a&&!p)&&(v===A||x.includes(e));return d(yc,{isPresent:h,initial:!(w.current&&!i)&&void 0,custom:n,presenceAffectsLayout:o,mode:r,root:u,onExitComplete:h?void 0:()=>{if(T.current.has(e))return;if(!b.has(e))return;T.current.add(e),b.set(e,!0);let t=!0;b.forEach(e=>{e||(t=!1)}),t&&(V?.(),M(S.current),a&&g?.(),s&&s())},anchorX:l,anchorY:c,children:t},e)})})},t.AnimateSharedLayout=({children:e})=>(i.useEffect(()=>{t.invariant(!1,"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations")},[]),d(Ec,{id:m(()=>"asl-"+Xd++),children:e})),t.AsyncMotionValueAnimation=hi,t.DOMKeyframesResolver=cs,t.DOMVisualElement=la,t.DeprecatedLayoutGroupContext=bc,t.DocumentProjectionNode=Zl,t.DragControls=kd,t.Feature=ca,t.FlatTree=gl,t.GroupAnimation=di,t.GroupAnimationWithThen=fi,t.HTMLProjectionNode=ec,t.HTMLVisualElement=ya,t.JSAnimation=Qe,t.KeyframeResolver=Nn,t.LayoutAnimationBuilder=class{constructor(t,e,n){this.scope=t,this.updateDom=e,this.defaultOptions=n,this.sharedTransitions=new Map,this.notifyReady=()=>{},this.rejectReady=()=>{},this.tracked=new Map,this.restorePoints=new Map,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.rejectReady=e}),sc||(sc=[],queueMicrotask(cc)),sc.push(this)}shared(t,e){return this.sharedTransitions.set(t,e),this}then(t,e){return this.readyPromise.then(t,e)}transitionFor(t){const e=t.getAttribute("data-layout-id");return e&&this.sharedTransitions.get(e)||this.defaultOptions}adopt(t,e){this.tracked.set(t,e),this.restorePoints.set(t,{parent:t.parentElement,next:t.nextSibling})}collectTargets(){return oc(this.scope)}runUpdate(){try{const t=this.updateDom();if(t&&"function"==typeof t.then)return t.then(void 0,t=>{this.updateError=t})}catch(t){this.updateError=t}}reconcileAdditions(t){for(const e of oc(this.scope)){if(this.tracked.has(e))continue;const n=ac(e,this.transitionFor(e));this.adopt(e,n),n.options.layoutId&&t.add(n.options.layoutId)}}reconcileRemovals(t){this.tracked.forEach((e,n)=>{if(n.isConnected)return;const i=this.restorePoints.get(n);this.restorePoints.delete(n);const{layoutId:s}=e.options,o=e.getStack(),r=o&&o.members.some(t=>t!==e&&t.instance?.isConnected);if(s&&e.isLead()&&r&&!t.has(s)&&i&&i.parent.isConnected){if(i.parent.insertBefore(n,i.next&&i.next.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),lc(n,e)}}),e.relegate())return;n.remove()}lc(n,e),this.tracked.delete(n)})}getRoot(){let t;return this.tracked.forEach(e=>t||(t=e.root)),t}finalize(){if(this.updateError)return void this.rejectReady(this.updateError);const t=new Set;this.tracked.forEach(e=>{e.instance&&e.currentAnimation&&t.add(e.currentAnimation)}),this.notifyReady(new di([...t]))}},t.LayoutGroup=Ec,t.LayoutGroupContext=f,t.LazyMotion=function({children:t,features:n,strict:i=!1}){const[,s]=e.useState(!Dc(n)),o=e.useRef(void 0);if(!Dc(n)){const{renderer:t,...e}=n;o.current=t,kc(e)}return e.useEffect(()=>{Dc(n)&&n().then(({renderer:t,...e})=>{kc(e),o.current=t,s(!0)})},[]),d(Ac.Provider,{value:{renderer:o.current,strict:i},children:t})},t.MotionConfig=function({children:t,...n}){const i=e.useContext(dc);(n={...i,...n}).transition=Ti(n.transition,i.transition),n.isStatic=m(()=>n.isStatic);const s=e.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations,n.isValidProp]);return d(dc.Provider,{value:s,children:t})},t.MotionConfigContext=dc,t.MotionContext=jc,t.MotionGlobalConfig=P,t.MotionValue=Si,t.MotionValueState=Es,t.NativeAnimation=ti,t.NativeAnimationExtended=ii,t.NativeAnimationWrapper=mi,t.NodeStack=xl,t.ObjectVisualElement=class extends aa{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}},t.PopChild=gc,t.PresenceChild=yc,t.PresenceContext=v,t.Reorder=gh,t.SVGVisualElement=ba,t.SubscriptionManager=R,t.SwitchLayoutGroupContext=nu,t.ViewTransitionBuilder=Nr,t.VisualElement=aa,t.WillChangeMotionValue=Td,t.acceleratedValues=ri,t.addAttrValue=Ys,t.addDomEvent=fl,t.addEffect=ms,t.addPointerEvent=pu,t.addPointerInfo=du,t.addSVGValue=Xs,t.addScaleCorrector=function(t){for(const e in t)fa[e]=t[e],mt(e)&&(fa[e].isCSSVariable=!0)},t.addStyleValue=Ds,t.addUniqueItem=x,t.addValueToWillChange=Ki,t.alpha=St,t.analyseComplexValue=Ht,t.animate=Lh,t.animateEffectSubject=xs,t.animateElement=bo,t.animateMini=Oh,t.animateMotionValue=Di,t.animateSingleValue=pl,t.animateTarget=es,t.animateValue=function(t){return new Qe(t)},t.animateValues=vs,t.animateVariant=ns,t.animateView=function(t,e={}){return new Nr(t,e)},t.animateVisualElement=is,t.animationControls=Md,t.animationMapKey=yi,t.animations=uu,t.anticipate=X,t.applyAxisDelta=ao,t.applyBoxDelta=lo,t.applyGeneratorOptions=Qn,t.applyPointDelta=ro,t.applyPxDefaults=ds,t.applyTreeDeltas=ho,t.arc=function(t={}){const e=function({strength:t=.5,peak:e=.5,direction:n,rotate:i=!1}={}){const s=!0===i?1:"number"==typeof i?i:0;let o;return(i,r)=>{const a=r.x-i.x,l=r.y-i.y;let c;c="cw"===n?-t:"ccw"===n?t:(Math.abs(a)>=Math.abs(l)?a:l)<0?-t:t;let u=Bi(i.x,i.y,r.x,r.y,c,e);if(void 0===n){const t=Math.abs(a)<Math.abs(l),n=i.x+a*e,s=i.y+l*e,h=t?Math.sign(u.x-n):Math.sign(u.y-s);void 0!==o&&0!==h&&h!==o?(c=-c,u=Bi(i.x,i.y,r.x,r.y,c,e)):0!==h&&(o=h)}const h=s?Li(0,i.x,u.x,r.x,i.y,u.y,r.y):0,d=s?Li(1,i.x,u.x,r.x,i.y,u.y,r.y):0,p=s?F(-180,180,d-h):0;return t=>{const e={x:Ri(t,i.x,u.x,r.x),y:Ri(t,i.y,u.y,r.y)};if(s){const n=Li(t,i.x,u.x,r.x,i.y,u.y,r.y),o=h+p*t;e.rotate=F(-180,180,n-o)*s}return e}}}(t),n={interpolateProjection(t){const n=t.x.translate,i=t.y.translate;if(!(Math.sqrt(n*n+i*i)<20))return e({x:n,y:i},{x:0,y:0})},animateVisualElement(t,n,i,s,o){if(!("x"in n)&&!("y"in n))return;const r=t.getValue("x",t.latestValues.x??0),a=t.getValue("y",t.latestValues.y??0),l=n.x,c=n.y,u=(Array.isArray(l)&&null!=l[0]?l[0]:r?.get())??0,h=(Array.isArray(c)&&null!=c[0]?c[0]:a?.get())??0,d=Array.isArray(l)?l[l.length-1]:l??u,p=Array.isArray(c)?c[c.length-1]:c??h,f=e({x:u,y:h},{x:d,y:p}),m=void 0!==f(0).rotate?t.getValue("pathRotation",0):void 0,g={delay:s,...Pi(i||{},"x")};delete g.path;const y=bi(0);y.start(Di("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=f(t/1e3);r?.set(e.x),a?.set(e.y),m&&void 0!==e.rotate&&m.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),m?.set(0)},onStop:()=>m?.set(0),onCancel:()=>m?.set(0)})),y.animation&&o.push(y.animation),delete n.x,delete n.y}};return n},t.aspectRatio=el,t.attachFollow=dr,t.attachSpring=function(t,e,n){return dr(t,e,{type:"spring",...n})},t.attrEffect=Hs,t.axisDeltaEquals=nl,t.axisEquals=Za,t.axisEqualsRounded=Qa,t.backIn=Y,t.backInOut=H,t.backOut=z,t.boxEquals=Ja,t.boxEqualsRounded=tl,t.buildHTMLStyles=Fs,t.buildProjectionTransform=sl,t.buildSVGAttrs=zs,t.buildSVGPath=$s,t.buildTransform=Is,t.calcAxisDelta=Ia,t.calcBoxDelta=Fa,t.calcChildStagger=xi,t.calcGeneratorDuration=me,t.calcLength=Oa,t.calcRelativeAxis=Wa,t.calcRelativeAxisPosition=$a,t.calcRelativeBox=Na,t.calcRelativePosition=Ua,t.camelCaseAttributes=va,t.camelToDash=_i,t.cancelFrame=at,t.cancelMicrotask=Ao,t.cancelSync=hc,t.checkVariantsDidChange=Va,t.circIn=G,t.circInOut=_,t.circOut=K,t.clamp=b,t.cleanDirtyNodes=kl,t.collectMotionValues=wi,t.color=Ft,t.compareByDepth=ml,t.complex=Kt,t.containsCSSVariable=xt,t.convertBoundingBoxToBox=Zs,t.convertBoxToBoundingBox=Js,t.convertOffsetToTimes=$e,t.copyAxisDeltaInto=Ba,t.copyAxisInto=Ra,t.copyBoxInto=La,t.correctBorderRadius=da,t.correctBoxShadow=pa,t.correctParentTransform=function(t){return e=>{const n=t.current;if(!n)return e;const i=function(t){const{transform:e}=getComputedStyle(t);if(!e||"none"===e)return null;const n=e.match(/^matrix3d\((.*)\)$/u)||e.match(/^matrix\((.*)\)$/u);if(!n)return null;const i=n[1].split(",").map(Number),s=e.startsWith("matrix3d"),o=i[0],r=i[1],a=s?i[4]:i[2],l=s?i[5]:i[3],c=o*l-r*a;return Math.abs(c)<1e-10?null:{a:l/c,b:-r/c,c:-a/c,d:o/c}}(n);if(!i)return e;const s=n.getBoundingClientRect(),o=s.left+window.scrollX+s.width/2,r=s.top+window.scrollY+s.height/2,a=e.x-o,l=e.y-r;return{x:o+i.a*a+i.c*l,y:r+i.b*a+i.d*l}}},t.createAnimationState=Ca,t.createAxis=zr,t.createAxisDelta=$r,t.createBox=Yr,t.createDelta=Ur,t.createEffect=As,t.createGeneratorEasing=ge,t.createProjectionNode=Al,t.createRenderBatcher=ot,t.createScopedAnimate=Rh,t.cubicBezier=N,t.cubicBezierAsString=Kn,t.defaultEasing=Ue,t.defaultOffset=Ne,t.defaultTransformValue=Sn,t.defaultValueTypes=cn,t.degrees=Dt,t.delay=yl,t.delayInSeconds=function(t,e){return yl(t,L(e))},t.dimensionValueTypes=os,t.disableInstantTransitions=function(){P.instantAnimations=!1},t.distance=mu,t.distance2D=gu,t.domAnimation=pd,t.domMax=fd,t.domMin=md,t.eachAxis=il,t.easeIn=q,t.easeInOut=J,t.easeOut=Z,t.easingDefinitionToFunction=it,t.fillOffset=We,t.fillWildcards=pn,t.filterProps=Kc,t.findDimensionValueType=rs,t.findEffect=ys,t.findValueType=t=>gr.find(ss(t)),t.flushKeyframeResolvers=Wn,t.followValue=hr,t.frame=rt,t.frameData=lt,t.frameSteps=ct,t.generateLinearEasing=pe,t.getAnimatableNone=dn,t.getAnimationMap=vi,t.getComputedStyle=Yo,t.getDefaultTransition=Ci,t.getDefaultValueType=un,t.getEasingForSegment=tt,t.getFeatureDefinitions=ra,t.getFinalKeyframe=Xe,t.getMixer=re,t.getOptimisedAppearId=Ji,t.getOriginIndex=rr,t.getValueAsType=bs,t.getValueTransition=Pi,t.getVariableValue=Ii,t.getVariantContext=Pa,t.getViewAnimationLayerInfo=Cr,t.getViewAnimations=Vr,t.globalProjectionState=wl,t.handOffElementState=To,t.has2DTranslate=io,t.hasComplexValues=Yt,t.hasReducedMotionListener=ta,t.hasScale=eo,t.hasTransform=no,t.hasWarned=function(t){return j.has(t)},t.hex=Vt,t.hover=Do,t.hsla=It,t.hslaToRgba=qt,t.inView=ud,t.inertia=Ie,t.initPrefersReducedMotion=na,t.interpolate=Fe,t.invisibleValues=ie,t.isAnimationControls=Xr,t.isBezierDefinition=et,t.isBrowser=g,t.isCSSVariableName=mt,t.isCSSVariableToken=yt,t.isControllingVariants=qr,t.isDeltaZero=qa,t.isDragActive=Co,t.isDragging=Mo,t.isEasingArray=Q,t.isElementKeyboardAccessible=Oo,t.isElementTextInput=Io,t.isForcedMotionValue=ma,t.isGenerator=Jn,t.isHTMLElement=ws,t.isKeyframesTarget=Ui,t.isMotionComponent=Rd,t.isMotionValue=Xi,t.isNear=ja,t.isNodeOrChild=Ro,t.isNumericalString=E,t.isObject=A,t.isPrimaryPointer=Lo,t.isSVGElement=Ss,t.isSVGSVGElement=or,t.isSVGTag=xa,t.isTransitionDefined=ki,t.isValidMotionProp=Xc,t.isVariantLabel=Gr,t.isVariantNode=Zr,t.isWaapiSupportedEasing=function t(e){return Boolean("function"==typeof e&&Gn()||!e||"string"==typeof e&&(e in _n||Gn())||et(e)||Array.isArray(e)&&e.every(t))},t.isWillChangeMotionValue=Gi,t.isZeroValueString=M,t.keyframes=ze,t.m=hd,t.makeAnimationInstant=oi,t.makeUseVisualState=Zc,t.mapEasingToNativeEasing=qn,t.mapValue=function(t,e,n,i){const s=ar(e,n,i);return mr(()=>s(t.get()))},t.maxGeneratorDuration=fe,t.measurePageBox=vo,t.measureViewportBox=yo,t.memo=C,t.microtask=Eo,t.millisecondsToSeconds=B,t.mirrorEasing=$,t.mix=he,t.mixArray=ae,t.mixColor=ne,t.mixComplex=ce,t.mixImmediate=Zt,t.mixLinearColor=Qt,t.mixNumber=Jt,t.mixObject=le,t.mixValues=ll,t.mixVisibility=se,t.motion=_u,t.motionValue=bi,t.moveItem=S,t.nodeGroup=Ql,t.noop=V,t.number=wt,t.numberValueTypes=ln,t.observeTimeline=ir,t.optimizedAppearDataAttribute=Zi,t.optimizedAppearDataId=qi,t.parseAnimateLayoutArgs=function(t,e,n){return"function"==typeof t?{scope:document,updateDom:t,defaultOptions:e}:{scope:t instanceof Document?t:Ts(t)[0]??document,updateDom:e,defaultOptions:n}},t.parseCSSVariable=ji,t.parseValueFromTransform=bn,t.percent=Rt,t.pipe=k,t.pixelsToPercent=ha,t.positionalKeys=$i,t.prefersReducedMotion=Qr,t.press=zo,t.progress=D,t.progressPercentage=jt,t.propEffect=Po,t.propagateDirtyNodes=Vl,t.px=Lt,t.readSVGValue=Gs,t.readStyleValue=Rs,t.readTransformValue=Tn,t.recordStats=function(){if(sr.value)throw sr.value=null,sr.addProjectionMetrics=null,new Error("Stats are already being measured");const t=sr;t.value={layoutProjection:{nodes:[],calculatedTargetDeltas:[],calculatedProjections:[]}},t.addProjectionMetrics=e=>{const{layoutProjection:n}=t.value;n.nodes.push(e.nodes),n.calculatedTargetDeltas.push(e.calculatedTargetDeltas),n.calculatedProjections.push(e.calculatedProjections)}},t.removeAxisDelta=Ya,t.removeAxisTransforms=Ha,t.removeBoxTransforms=Ka,t.removeEffect=gs,t.removeItem=w,t.removePointDelta=za,t.renderHTML=ua,t.renderSVG=wa,t.resize=nr,t.resolveElements=Ts,t.resolveMotionValue=vl,t.resolveTransition=Ti,t.resolveVariant=Ni,t.resolveVariantFromProps=Wi,t.reverseEasing=U,t.rgbUnit=Mt,t.rgba=Ct,t.rootProjectionNode=tc,t.scale=bt,t.scaleCorrectors=fa,t.scalePoint=oo,t.scrapeHTMLMotionValuesFromProps=ga,t.scrapeSVGMotionValuesFromProps=Sa,t.scroll=ld,t.scrollInfo=Qh,t.secondsToMilliseconds=L,t.setDragLock=Vo,t.setFeatureDefinitions=oa,t.setStyle=Un,t.setTarget=Hi,t.spring=je,t.springValue=function(t,e){return hr(t,{type:"spring",...e})},t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:i}={}){return(s,o)=>{const r="number"==typeof n?n:rr(n,o),a=Math.abs(r-s);let l=t*a;if(i){const e=o*t;l=it(i)(l/e)*e}return e+l}},t.startOptimizedAppearAnimation=function(t,e,n,i,s){if(window.MotionIsMounted)return;const o=t.dataset[qi];if(!o)return;window.MotionHandoffAnimation=Fd;const r=Id(o,e);Nd||(Nd=Zn(t,e,[n[0],n[0]],{duration:1e4,ease:"linear"}),Od.set(r,{animation:Nd,startTime:null}),window.MotionHandoffAnimation=Fd,window.MotionHasOptimisedAnimation=(t,e)=>{if(!t)return!1;if(!e)return jd.has(t);const n=Id(t,e);return Boolean(Od.get(n))},window.MotionHandoffMarkAsComplete=t=>{jd.has(t)&&jd.set(t,!0)},window.MotionHandoffIsComplete=t=>!0===jd.get(t),window.MotionCancelOptimisedAnimation=(t,e,n,i)=>{const s=Id(t,e),o=Od.get(s);o&&(n&&void 0===i?n.postRender(()=>{n.postRender(()=>{o.animation.cancel()})}):o.animation.cancel(),n&&i?($d.add(o),n.render(Ud)):(Od.delete(s),Od.size||(window.MotionCancelOptimisedAnimation=void 0)))},window.MotionCheckAppearSync=(t,e,n)=>{const i=Ji(t);if(!i)return;const s=window.MotionHasOptimisedAnimation?.(i,e),o=t.props.values?.[e];if(!s||!o)return;const r=n.on("change",t=>{o.get()!==t&&(window.MotionCancelOptimisedAnimation?.(i,e),r())});return r});const a=()=>{Nd.cancel();const o=Zn(t,e,n,i);void 0===Wd&&(Wd=performance.now()),o.startTime=Wd,Od.set(r,{animation:o,startTime:Wd}),s&&s(o)};jd.set(o,!1),Nd.ready?Nd.ready.then(a).catch(V):a()},t.startWaapiAnimation=Zn,t.statsBuffer=sr,t.steps=function(t,e="end"){return n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,s="end"===e?Math.floor(i):Math.ceil(i);return b(0,1,s/t)}},t.styleEffect=Bs,t.styleSubjectEffect=Ls,t.supportedWaapiEasing=_n,t.supportsBrowserAnimation=ui,t.supportsFlags=zn,t.supportsLinearEasing=Gn,t.supportsPartialKeyframes=ps,t.supportsScrollTimeline=Hn,t.supportsViewTimeline=Xn,t.svgEffect=_s,t.svgSubjectEffect=Ks,t.sync=uc,t.testValueType=ss,t.time=dt,t.transform=ar,t.transformAxis=fo,t.transformBox=go,t.transformBoxPoints=Qs,t.transformPropOrder=En,t.transformProps=An,t.transformValue=mr,t.transformValueTypes=an,t.transformViewBoxPoint=function(t){return e=>{const n=t.current;if(!n)return e;const i=n.viewBox?.baseVal;if(!i||0===i.width&&0===i.height)return e;const s=n.getBoundingClientRect();if(0===s.width||0===s.height)return e;const o=i.width/s.width,r=i.height/s.height,a=s.left+window.scrollX,l=s.top+window.scrollY;return{x:(e.x-a)*o+a,y:(e.y-l)*r+l}}},t.translateAxis=po,t.unwrapMotionComponent=function(t){if(Rd(t))return t[tu]},t.updateMotionValuesFromProps=Jr,t.useAnimate=function(){const t=m(()=>({current:null,animations:[]})),n=Ed()??void 0,{skipAnimations:i}=e.useContext(dc),s=e.useMemo(()=>Rh({scope:t,reduceMotion:n,skipAnimations:i}),[t,n,i]);return dd(()=>{t.animations.forEach(t=>t.stop()),t.animations.length=0}),[t,s]},t.useAnimateMini=function(){const t=m(()=>({current:null,animations:[]})),e=m(()=>Bh(t));return dd(()=>{t.animations.forEach(t=>t.stop())}),[t,e]},t.useAnimation=Vd,t.useAnimationControls=Cd,t.useAnimationFrame=bd,t.useComposedRefs=fc,t.useCycle=function(...t){const n=e.useRef(0),[i,s]=e.useState(t[n.current]),o=e.useCallback(e=>{n.current="number"!=typeof e?F(0,t.length,n.current+1):e,s(t[n.current])},[t.length,...t]);return[i,o]},t.useDeprecatedAnimatedState=function(t){const[n,i]=e.useState(t),s=Hd({},!1),o=m(()=>new Yd({props:{onUpdate:t=>{i({...t})}},visualState:s,presenceContext:null},{initialState:t}));return e.useLayoutEffect(()=>(o.mount({}),()=>o.unmount()),[o]),[n,m(()=>t=>is(o,t))]},t.useDeprecatedInvertedScale=function(n){let i=nh(1),s=nh(1);const{visualElement:o}=e.useContext(jc);return t.invariant(!(!n&&!o),"If no scale values are provided, useInvertedScale must be used within a child of another motion component."),t.warning(Kd,"useInvertedScale is deprecated and will be removed in 3.0. Use the layout prop instead."),Kd=!0,n?(i=n.scaleX||i,s=n.scaleY||s):o&&(i=o.getValue("scaleX",1),s=o.getValue("scaleY",1)),{scaleX:sh(i,Gd),scaleY:sh(s,Gd)}},t.useDomEvent=function(t,n,i,s){e.useEffect(()=>{const e=t.current;if(i&&e)return fl(e,n,i,s)},[t,n,i,s])},t.useDragControls=function(){return m(Dd)},t.useElementScroll=function(t){return wd({container:t})},t.useFollowValue=Sd,t.useForceUpdate=Tc,t.useInView=function(t,{root:n,margin:i,amount:s,once:o=!1,initial:r=!1}={}){const[a,l]=e.useState(r);return e.useEffect(()=>{if(!t.current||o&&a)return;const e={root:n&&n.current||void 0,margin:i,amount:s};return ud(t.current,()=>(l(!0),o?void 0:()=>l(!1)),e)},[n,t,i,o,s]),a},t.useInstantLayoutTransition=Ld,t.useInstantTransition=function(){const[t,n]=Tc(),i=Ld(),s=e.useRef(-1);return e.useEffect(()=>{rt.postRender(()=>rt.postRender(()=>{n===s.current&&(P.instantAnimations=!1)}))},[n]),e=>{i(()=>{P.instantAnimations=!0,t(),e(),s.current=n+1})}},t.useIsPresent=function(){return null===(t=e.useContext(v))||t.isPresent;var t},t.useIsomorphicLayoutEffect=y,t.useMotionTemplate=function(t,...e){const n=t.length;return ih(e.filter(Xi),function(){let i="";for(let s=0;s<n;s++){i+=t[s];const n=e[s];n&&(i+=Xi(n)?n.get():n)}return i})},t.useMotionValue=nh,t.useMotionValueEvent=gd,t.usePageInView=function(){const[t,n]=e.useState(!0);return e.useEffect(()=>{const t=()=>n(!document.hidden);return document.hidden&&t(),document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),t},t.usePresence=xc,t.usePresenceData=function(){const t=e.useContext(v);return t?t.custom:void 0},t.useReducedMotion=Pd,t.useReducedMotionConfig=Ed,t.useResetProjection=function(){return e.useCallback(()=>{const t=tc.current;t&&t.resetTree()},[])},t.useScroll=wd,t.useSpring=function(t,e={}){return Sd(t,{type:"spring",...e})},t.useTime=function(){const t=nh(0);return bd(e=>t.set(e)),t},t.useTransform=sh,t.useUnmountEffect=dd,t.useVelocity=function(t){const e=nh(t.getVelocity()),n=()=>{const i=t.getVelocity();e.set(i),i&&rt.update(n)};return gd(t,"change",()=>{rt.update(n,!1,!0)}),e},t.useViewportScroll=function(){return wd()},t.useWillChange=function(){return m(()=>new Td("auto"))},t.variantPriorityOrder=Kr,t.variantProps=_r,t.velocityPerSecond=O,t.vh=Bt,t.visualElementStore=Hr,t.vw=Ot,t.warnOnce=I,t.wrap=F});