motion-dom
Version:
2 lines • 171 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const n={delta:0,timestamp:0,isProcessing:!1};let i;function s(){i=void 0}const o={now:()=>(void 0===i&&o.set(n.isProcessing||e.MotionGlobalConfig.useManualTiming?n.timestamp:performance.now()),i),set:t=>{i=t,queueMicrotask(s)}},r=t=>Math.round(1e5*t)/1e5,a=t=>e=>"string"==typeof e&&e.startsWith(t),l=a("--"),c=a("var(--"),u=t=>!!c(t)&&h.test(t.split("/*")[0].trim()),h=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function d(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const p={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},m={...p,transform:t=>e.clamp(0,1,t)},f={...p,default:1},g=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const y=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,v=(t,e)=>n=>Boolean("string"==typeof n&&y.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),x=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(g);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},w={...p,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},T={test:v("rgb","red"),parse:x("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+w.transform(t)+", "+w.transform(e)+", "+w.transform(n)+", "+r(m.transform(i))+")"},S=(t,e,n)=>{const i=t.substring(1+e*n,1+(e+1)*n);return n>1?i:i+i};const b={test:v("#"),parse:function(t){const e=t.length>5?2:1,n=S(t,3,e);return{red:parseInt(S(t,0,e),16),green:parseInt(S(t,1,e),16),blue:parseInt(S(t,2,e),16),alpha:n?parseInt(n,16)/255:1}},transform:T.transform},P=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),M=P("deg"),A=P("%"),E=P("px"),V=P("vh"),D=P("vw"),k=(()=>({...A,parse:t=>A.parse(t)/100,transform:t=>A.transform(100*t)}))(),C={test:v("hsl","hue"),parse:x("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+A.transform(r(e))+", "+A.transform(r(n))+", "+r(m.transform(i))+")"},R={test:t=>T.test(t)||b.test(t)||C.test(t),parse:t=>T.test(t)?T.parse(t):C.test(t)?C.parse(t):b.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?T.transform(t):C.transform(t),getAnimatableNone:t=>{const e=R.parse(t);return e.alpha=0,R.transform(e)}},j=new RegExp(g.source),L=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const B="number",O="color",F=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)(?![a-z]*\()/giu;function I(t){const e=t.toString();return j.test(e)||L.test(e)}function U(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(F,t=>(R.test(t)?(i.color.push(o),s.push(O),n.push(R.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(B),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function N({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===B?r(i[o]):t===O?R.transform(i[o]):i[o]}return s}}const W=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(n=t)?0:R.test(n)?R.getAnimatableNone(n):n;var n};const $={test:function(t){return isNaN(t)&&"string"==typeof t&&(j.test(t)||L.test(t))},parse:function(t){return U(t).values},createTransformer:function(t){return N(U(t))},getAnimatableNone:function(t){const e=U(t);return N(e)(e.values.map((t,n)=>W(t,e.split[n])))}};function z(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 K({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=z(a,i,t+1/3),o=z(a,i,t),r=z(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 G(t,e){return n=>n>0?e:t}const Y=(t,e,n)=>t+(e-t)*n,X=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},q=[b,T,C];function H(t){const e=(n=t,q.find(t=>t.test(n)));var n;if(!e)return!1;let i=e.parse(t);return e===C&&(i=K(i)),i}const _=(t,e)=>{const n=H(t),i=H(e);if(!n||!i)return G(t,e);const s={...n};return t=>(s.red=X(n.red,i.red,t),s.green=X(n.green,i.green,t),s.blue=X(n.blue,i.blue,t),s.alpha=Y(n.alpha,i.alpha,t),T.transform(s))},Z=new Set(["none","hidden"]);function J(t,e){return Z.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Q(t,e){return n=>Y(t,e,n)}function tt(t){return"number"==typeof t?Q:"string"==typeof t?u(t)?G:R.test(t)?_:it:Array.isArray(t)?et:"object"==typeof t?R.test(t)?_:nt:G}function et(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>tt(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function nt(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=tt(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const it=(t,n)=>{const i=U(t),s=U(n);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Z.has(t)&&!s.values.length||Z.has(n)&&!i.values.length?J(t,n):e.pipe(et(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),N(s)):G(t,n)},st=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function ot(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Y(t,e,n);if("string"==typeof t&&"string"==typeof e){const n=function(t,e){const n=st.exec(t);if(!n)return;const i=st.exec(e);if(!i||n[2]!==i[2])return;const s=n[2],o=parseFloat(n[1]),a=parseFloat(i[1]);return t=>r(Y(o,a,t))+s}(t,e);if(n)return n}return tt(t)(t,e)}const rt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function at(t,n,i={delta:0,timestamp:0,isProcessing:!1}){let s=!1,o=!0;const r=()=>s=!0,a=rt.reduce((t,e)=>(t[e]=function(t){let e,n=new Set,i=new Set,s=!1,o=!1;const r=new Set;let a={delta:0,timestamp:0,isProcessing:!1};function l(n){r.has(n)&&(i.add(n),t()),(e=n)(a)}const c={schedule:(t,o=!1,a=!1)=>{const l=a&&s,c=l?n:i;return o&&r.add(t),l&&t!==e&&c.delete(t),c.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(a=t,s)return void(o=!0);s=!0;const r=n;n=i,i=r,n.forEach(l),n.clear(),e=void 0,s=!1,o&&(o=!1,c.process(t))}};return c}(r),t),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:m,postRender:f}=a,g=()=>{const r=e.MotionGlobalConfig.useManualTiming,a=r?i.timestamp:performance.now();s=!1,r||(i.delta=o?1e3/60:Math.max(Math.min(a-i.timestamp,40),1)),i.timestamp=a,i.isProcessing=!0,l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),p.process(i),m.process(i),f.process(i),i.isProcessing=!1,s&&n&&(o=!1,t(g))};return{schedule:rt.reduce((e,n)=>{const r=a[n];return e[n]=(e,n=!1,a=!1)=>(s||(s=!0,o=!0,i.isProcessing||t(g)),r.schedule(e,n,a)),e},{}),cancel:t=>{for(let e=0;e<rt.length;e++)a[rt[e]].cancel(t)},state:i,steps:a}}const{schedule:lt,cancel:ct,steps:ut}=at("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0,n),ht=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>lt.update(e,t),stop:()=>ct(e),now:()=>n.isProcessing?n.timestamp:o.now()}},dt=(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)})`},pt=2e4;function mt(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 ft(t,n=100,i){const{keyframes:s,velocity:o}=t,r=s&&s[s.length-1]-s[0],a=i({...t,velocity:o&&r?o*n/r:o,keyframes:[0,n]}),l=Math.min(mt(a),pt);return{type:"keyframes",ease:t=>a.next(l*t).value/n,duration:e.millisecondsToSeconds(l)}}const gt=t=>t<0?1/Math.max(1+t,.05):Math.max(1-t,.05);function yt(t,e){if(!(t>1))return 1;const n=Math.sqrt(t*t-1),i=t-n,s=t+n,o=2*n*Math.exp(-e)*(1+e);return wt(t=>s*Math.exp(-i*t)-i*Math.exp(-s*t)-o,t=>Math.exp(-s*t)-Math.exp(-i*t),e)/e}function vt(t,e){return t*Math.sqrt(1-e*e)}const xt=12;function wt(t,e,n){let i=n;for(let n=1;n<xt;n++)i-=t(i)/e(i);return i}const Tt=.001;const St=(t,e)=>(e?t>=0:t>0)&&t<1/0;function bt(t,e){if(St(t,e))return t}function Pt(t){const n=bt(t.stiffness),i=bt(t.damping,!0),s=bt(t.mass),o={...t,stiffness:n??100,damping:i??10,mass:s??1,isResolvedFromDuration:!1,isTimeDefined:void 0===(n??i??s)&&(void 0!==t.duration||void 0!==t.bounce)};if(o.isTimeDefined){if(t.visualDuration){const e=gt(t.bounce||0),n=2*Math.PI/(1.2*t.visualDuration)*yt(e,2*Math.PI/1.2);o.stiffness=n*n,o.damping=2*e*Math.sqrt(o.stiffness)}else Object.assign(o,function({duration:t=800,bounce:n=.3}){let i,s;const o=gt(n);t=e.clamp(.01,10,e.millisecondsToSeconds(t)),o<1?(i=e=>{const n=e*o,i=n*t,s=vt(e,o),r=Math.exp(-i);return Tt-n/s*r},s=e=>{const n=e*o*t,s=o*o*e*e*t,r=Math.exp(-n),a=vt(e*e,o);return(-i(e)+Tt>0?-1:1)*-s*r/a}):(i=e=>Math.exp(-e*t)*(e*t+1)-.001,s=e=>Math.exp(-e*t)*(t*t*-e));const r=wt(i,s,5/t),a=r*yt(o,r*t),l=a*a;return{stiffness:l,damping:2*o*Math.sqrt(l),duration:e.secondsToMilliseconds(t)}}(o)),o.isResolvedFromDuration=!0;St(o.stiffness)&&St(o.damping,!0)||(o.stiffness=100,o.damping=10)}return o}function Mt(t=.3,n=.3){const i="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:n}:t,s=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],r={done:!1,value:s},{stiffness:a,damping:l,mass:c,duration:u,isResolvedFromDuration:h,isTimeDefined:d}=Pt({...i}),p=t=>h?0:-e.millisecondsToSeconds(t),m=l/(2*Math.sqrt(a*c)),f=e.millisecondsToSeconds(Math.sqrt(a/c)),g=m*f,y={target:o,delta:o-s,velocity:p(i.velocity)||0,restSpeed:0,restDelta:0},v=()=>{const t=Math.abs(y.delta)<5;y.restSpeed=i.restSpeed||(t?.01:2),y.restDelta=i.restDelta||(t?.005:.5)};let x,w,T;if(v(),m<1){const t=vt(f,m),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};T=()=>{e.A=(y.velocity+g*y.delta)/t,e.sinC=g*e.A+y.delta*t,e.cosC=g*y.delta-e.A*t};const n=n=>{n!==e.t&&(e.t=n,e.env=Math.exp(-g*n),e.sin=Math.sin(t*n),e.cos=Math.cos(t*n))};x=t=>(n(t),y.target-e.env*(e.A*e.sin+y.delta*e.cos)),w=t=>(n(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===m){x=t=>y.target-Math.exp(-f*t)*(y.delta+(y.velocity+f*y.delta)*t);const t={C:0};T=()=>{t.C=y.velocity+f*y.delta},w=e=>Math.exp(-f*e)*(f*t.C*e-y.velocity)}else{const t=f*Math.sqrt(m*m-1),e=g-t,n=g+t,i=t<1||d?1/0:300/t,s=(t,e)=>Math.exp(e>i?(g-t)*i-g*e:-t*e),o={S:0,F:0};T=()=>{const e=(y.velocity+g*y.delta)/t;o.S=(y.delta+e)/2,o.F=(y.delta-e)/2},x=t=>y.target-o.S*s(e,t)-o.F*s(n,t),w=t=>e*o.S*s(e,t)+n*o.F*s(n,t)}T();const S=h&&u||null,b={calculatedDuration:S,retarget:(t,e)=>{y.target=t[t.length-1],y.delta=y.target-t[0],y.velocity=p(e),i.restSpeed&&i.restDelta||v(),b.calculatedDuration=S,r.done=!1,T()},velocity:t=>e.secondsToMilliseconds(w(t)),next:t=>{const n=x(t);if(h)r.done=t>=u;else{const i=e.secondsToMilliseconds(w(t));r.done=Math.abs(i)<=y.restSpeed&&Math.abs(y.target-n)<=y.restDelta}return r.value=r.done?y.target:n,r},toString:()=>{const t=Math.min(mt(b),pt),e=dt(e=>b.next(t*e).value,t,30);return t+"ms "+e}};return b}const At=Object.assign(Mt,{applyToOptions:t=>{const n=ft(t,100,Mt);return t.ease=n.ease,t.duration=e.secondsToMilliseconds(n.duration),t.type="keyframes",t}});function Et({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 m=n*e;const f=h+m,g=r?r(f):f;g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>{const e=y(t);d.done=Math.abs(e)<=c,d.value=d.done?g:t?g+e:h};let x,w;const T=t=>{var e;((e=d.value)<a||e>l)&&(x=t,w=At({keyframes:[d.value,p(d.value)],velocity:-y(t)/i*1e3,damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==x||(e=!0,v(t),T(t)),void 0!==x&&t>=x?w.next(t-x):(!e&&v(t),d)}}}function Vt(t,n,{clamp:i=!0,ease:s,mixer:o}={}){const r=t.length;if(1===r)return()=>n[0];if(2===r&&n[0]===n[1])return()=>n[1];const a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,i){const s=[],o=e.MotionGlobalConfig.mix||ot,r=t.length-1;for(let a=0;a<r;a++){let r=i?.(t[a],t[a+1])||o(t[a],t[a+1]);if(n){const t=Array.isArray(n)?n[a]||e.noop:n;r=e.pipe(t,r)}s.push(r)}return s}(n,s,o),c=l.length,u=i=>{if(a&&i<t[0])return n[0];let s=0;if(c>1)for(;s<t.length-2&&!(i<t[s+1]);s++);const o=e.progress(t[s],t[s+1],i);return l[s](o)};return i?n=>u(e.clamp(t[0],t[r-1],n)):u}function Dt(t,n){const i=t[t.length-1];for(let s=1;s<=n;s++){const o=e.progress(0,n,s);t.push(Y(i,1,o))}}function kt(t){const e=[0];return Dt(e,t.length-1),e}function Ct(t,e){return t.map(t=>t*e)}function Rt(t,n){return t.map(()=>n||e.easeInOut).splice(0,t.length-1)}function jt({duration:t=300,keyframes:n,times:i,ease:s="easeInOut",mixer:o}){const r="number"==typeof n[0]?void 0:o,a=e.isEasingArray(s)?s.map(e.easingDefinitionToFunction):e.easingDefinitionToFunction(s)||e.easeInOut,l={done:!1,value:n[0]};let c=-1;if(!r)for(let t=1;t<n.length;t++)if(n[t]!==n[t-1]){if(c>=0){c=-2;break}c=t-1}if(c>=0){const s=i&&i.length===n.length?i:kt(n),o=s[c]*t,r=s[c+1]*t,u=n[c],h=n[c+1],d=Array.isArray(a)?a[c]:a,p=(e.MotionGlobalConfig.mix||ot)(u,h),m=n.length-2;return{calculatedDuration:t,next:e=>(l.value=c&&e<o?p(0):c<m&&(e>=r||!t)?"number"==typeof h?h:p(1):p(d(e>=r||!t?1:e<=o?0:(e-o)/(r-o))),l.done=e>=t,l)}}const u=Vt(Ct(i&&i.length===n.length?i:kt(n),t),n,{ease:Array.isArray(a)?a:Rt(n,a),mixer:r});return{calculatedDuration:t,next:e=>(l.value=u(e),l.done=e>=t,l)}}function Lt(t,n,i=0){return n<=0?i:t.velocity?t.velocity(n):function(t,n,i){const s=Math.max(n-5,0);return e.velocityPerSecond(i-t(s),n-s)}(e=>t.next(e).value,n,t.next(n).value)}function Bt(t,{repeat:e,repeatType:n="loop"},i,s=1){let o,r,a=0;for(let e=0;e<t.length;e++){const n=t[e];null!==n&&(a++||(o=n),r=n)}const l=s<0||e&&"loop"!==n&&e%2==1?0:a-1;return l&&void 0!==i?i:l?r:o}const Ot={decay:Et,inertia:Et,tween:jt,keyframes:jt,spring:At};function Ft(t){"string"==typeof t.type&&(t.type=Ot[t.type])}const It=(t,n)=>n-t>40&&!e.MotionGlobalConfig.useManualTiming?n:t;function Ut(t,e){return{kind:t,animation:e,timestamp:o.now(),frameTimestamp:n.timestamp,frameIsProcessing:n.isProcessing}}function Nt(t,e,n){const i=globalThis.__MOTION_INSPECT__;if(i)try{i({...Ut("animation-start",t),options:n?{...e,...n}:e})}catch{}}class Wt{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 $t=t=>t/100,zt=t=>Math.round(1e4*t)/1e4;class Kt extends Wt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:t}=this.options,e=o.now();t&&t.updatedAt!==e&&this.tick(t.updatedAt=e),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause(),Nt(this,this.options)}initAnimation(){const{options:t}=this;Ft(t);const{type:n=jt,repeat:i=0,repeatDelay:s=0,repeatType:o,velocity:r=0}=t;let{keyframes:a}=t;const l=n||jt;this.mixKeyframes=void 0,l!==jt&&"number"!=typeof a[0]&&(this.mixKeyframes=e.pipe($t,t.mixer?.(a[0],a[1])||ot(a[0],a[1])),a=[0,100]);const c=l(a===t.keyframes?t:{...t,keyframes:a});"mirror"===o&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-r})),null===c.calculatedDuration&&(c.calculatedDuration=mt(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=c}updateTime(t){this.currentTime=this.holdTime??Math.round(t-this.startTime)*this.playbackSpeed}tick(t,e=!1){const{generator:n,totalDuration:i,calculatedDuration:s}=this;if(null===this.startTime)return n.next(0);const{delay:o=0,keyframes:r,type:a,onUpdate:l,finalKeyframe:c}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=It(this.startTime,t)),this.pendingStartTime=void 0,this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const u=this.currentTime-o*(this.playbackSpeed>=0?1:-1),h=this.playbackSpeed>=0?u<0:u>i;this.currentTime=Math.max(u,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);const d=this.generate(this.currentTime,h);let{done:p}=d;h||(p=this.playbackSpeed>=0?s<1/0?this.currentTime>=i:p:this.currentTime<=0);const m=null===this.holdTime&&("finished"===this.state||"running"===this.state&&p);return m&&a!==Et&&(d.value=Bt(r,this.options,c,this.speed)),l&&l(d.value),m&&this.finish(),d}at(t){return this.holdTime??zt((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:n,totalDuration:i}=this,s=this.at(t)-(n.delay||0);return s>=i&&n.type!==Et?Bt(n.keyframes,n,e?void 0:n.finalKeyframe):this.generate(Math.max(s,0),s<0).value}generate(t,n){const{generator:i,totalDuration:s,mixKeyframes:o,mirroredGenerator:r,resolvedDuration:a}=this,{keyframes:l,repeat:c,repeatType:u,repeatDelay:h}=this.options;let d,p=t,m=i;if(c){const n=Math.min(t,s)/a;let i=Math.floor(n),o=n%1;!o&&n>=1&&(o=1),1===o&&i--,i=Math.min(i,c+1);Boolean(i%2)&&("reverse"===u?(o=1-o,h&&(o-=h/a)):"mirror"===u&&(m=r)),p=e.clamp(0,1,o)*a}return n?(this.delayState.value=l[0],d=this.delayState):d=m.next(p),o&&!n&&(d.value=o(d.value)),d}get duration(){return e.millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){return this.duration+e.millisecondsToSeconds(this.options.delay??0)}get time(){return e.millisecondsToSeconds(this.currentTime)}set time(t){"finished"===this.state&&this.updateFinished(),t=e.secondsToMilliseconds(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 Lt(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(o.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=e.millisecondsToSeconds(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ht,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=n)),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(o.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.driver?.stop(),this.driver=void 0,this.startTime=this.holdTime=null}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const Gt=new Set(["brightness","contrast","saturate","opacity"]);function Yt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(g)||[];if(!i)return t;const s=n.replace(i,"");let o=Gt.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Xt=/\b([a-z-]*)\(.*?\)/gu,qt={...$,getAnimatableNone:t=>{const e=t.match(Xt);return e?e.map(Yt).join(" "):t}},Ht={...$,getAnimatableNone:t=>{const e=$.parse(t);return $.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},_t={...p,transform:Math.round},Zt={rotate:M,pathRotation:M,rotateX:M,rotateY:M,rotateZ:M,scale:f,scaleX:f,scaleY:f,scaleZ:f,skew:M,skewX:M,skewY:M,distance:E,translateX:E,translateY:E,translateZ:E,x:E,y:E,z:E,perspective:E,transformPerspective:E,opacity:m,originX:k,originY:k,originZ:E},Jt={borderWidth:E,borderTopWidth:E,borderRightWidth:E,borderBottomWidth:E,borderLeftWidth:E,borderRadius:E,borderTopLeftRadius:E,borderTopRightRadius:E,borderBottomRightRadius:E,borderBottomLeftRadius:E,width:E,maxWidth:E,height:E,maxHeight:E,top:E,right:E,bottom:E,left:E,inset:E,insetBlock:E,insetBlockStart:E,insetBlockEnd:E,insetInline:E,insetInlineStart:E,insetInlineEnd:E,padding:E,paddingTop:E,paddingRight:E,paddingBottom:E,paddingLeft:E,paddingBlock:E,paddingBlockStart:E,paddingBlockEnd:E,paddingInline:E,paddingInlineStart:E,paddingInlineEnd:E,margin:E,marginTop:E,marginRight:E,marginBottom:E,marginLeft:E,marginBlock:E,marginBlockStart:E,marginBlockEnd:E,marginInline:E,marginInlineStart:E,marginInlineEnd:E,fontSize:E,backgroundPositionX:E,backgroundPositionY:E,...Zt,zIndex:_t,fillOpacity:m,strokeOpacity:m,numOctaves:_t},Qt={...Jt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:qt,WebkitFilter:qt,mask:Ht,WebkitMask:Ht},te=t=>Qt[t],ee=new Set([qt,Ht]);let ne,ie,se;function oe(t,e){if(t===ne&&e===ie)return se;let n=te(t);return ee.has(n)||(n=$),se=n.getAnimatableNone?n.getAnimatableNone(e):void 0,ne=t,ie=e,se}function re(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ae=t=>180*t/Math.PI,le=t=>{const e=ae(Math.atan2(t[1],t[0]));return ue(e)},ce={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scaleZ:()=>1,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:le,rotateZ:le,skewX:t=>ae(Math.atan(t[1])),skewY:t=>ae(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ue=t=>((t%=360)<0&&(t+=360),t),he=t=>Math.hypot(t[0],t[1]),de=t=>Math.hypot(t[4],t[5]),pe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:he,scaleY:de,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(he(t)+de(t))/2,rotateX:t=>ue(ae(Math.atan2(t[6],t[5]))),rotateY:t=>ue(ae(Math.atan2(-t[2],t[0]))),rotateZ:le,rotate:le,skewX:t=>ae(Math.atan(t[4])),skewY:t=>ae(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function me(t){return t.includes("scale")?1:0}function fe(t,e){if(!t||"none"===t)return me(e);const n=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!n)return me(e);const i=(n[1]?pe:ce)[e],s=n[2].split(",").map(t=>parseFloat(t));return"function"==typeof i?i(s):s[i]}const ge=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return fe(n,e)},ye=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ve=(()=>new Set([...ye,"pathRotation"]))(),xe=t=>t===p||t===E,we=new Set(["x","y","z"]),Te=ye.filter(t=>!we.has(t));const Se=new Set(["bottom","right"]);function be(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 Pe=({transform:t})=>fe(t,"x"),Me=({transform:t})=>fe(t,"y"),Ae={width:({width:t,paddingLeft:e="0",paddingRight:n="0",boxSizing:i},s)=>be(t,s,"x",e,n,i),height:({height:t,paddingTop:e="0",paddingBottom:n="0",boxSizing:i},s)=>be(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:Pe,y:Me,translateX:Pe,translateY:Me},Ee=new Set;let Ve=!1,De=!1,ke=!1;function Ce(){if(De){const t=[],e=new Set,n=new Set;Ee.forEach(i=>{i.needsMeasurement&&(t.push(i),e.add(i.element),Se.has(i.name)&&n.add(i.element))});const i=new Map;n.forEach(t=>{const e=function(t){const e=[];return Te.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)})}De=!1,Ve=!1,Ee.forEach(t=>t.complete(ke)),Ee.clear()}function Re(){Ee.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(De=!0)})}function je(){ke=!0,Re(),Ce(),ke=!1}class Le{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?(Ee.add(this),Ve||(Ve=!0,lt.read(Re),lt.resolveKeyframes(Ce))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(null===t[0]){const o=s?.get(),r=t[t.length-1];if(void 0!==o)t[0]=o;else if(i&&n){const s=function(t,n,i){if("string"==typeof t){if(e.isNumericalString(t)||e.isZeroValueString(t))return parseFloat(t);if(!$.test(t)&&$.test(i))return oe(n,i)}return t??void 0}(i.readValue(n,r),n,r);void 0!==s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===o&&s.set(t[0])}re(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Ee.delete(this)}cancel(){"scheduled"===this.state&&(Ee.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Be=t=>t.startsWith("--");function Oe(t,e,n){Be(e)?t.style.setProperty(e,n):t.style[e]=n}const Fe={};function Ie(t,n){const i=e.memo(t);return()=>Fe[n]??i()}const Ue=Ie(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),Ne=Ie(()=>void 0!==window.ViewTimeline,"viewTimeline"),We=Ie(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),$e=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,ze={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$e([0,.65,.55,1]),circOut:$e([.55,0,1,.45]),backIn:$e([.31,.01,.66,-.59]),backOut:$e([.33,1.53,.69,.99])};function Ke(t,n){return t?"function"==typeof t?We()?dt(t,n):"ease-out":e.isBezierDefinition(t)?$e(t):Array.isArray(t)?t.map(t=>Ke(t,n)||ze.easeOut):ze[t]:void 0}function Ge(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=Ke(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 Ye(t){return"function"==typeof t&&"applyToOptions"in t}function Xe({type:t,...e}){return Ye(t)&&We()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class qe extends Wt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t;const l=Xe(t);this.animation=Ge(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!s){const t=Bt(i,this.options,r,this.speed);this.updateMotionValue?.(t),Oe(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},Nt(this,t,l)}play(){this.isStopped||(this.manualStartTime=null,this.animation.onfinish=this.onFinish,this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.isStopped||(this.animation.onfinish=this.onFinish),this.animation.finish?.()}cancel(){this.animation.onfinish=null;try{this.animation.cancel()}catch(t){}}stop(){this.isStopped||(this.isStopped=!0,"idle"!==this.state&&null===this.finishedTime&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel()))}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return e.millisecondsToSeconds(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+e.millisecondsToSeconds(t)}get time(){return e.millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(t){const n=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=e.secondsToMilliseconds(t),n&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:n,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=this.onFinish=null,t&&Ue()?(this.animation.timeline=t,n?.(this.animation),e.noop):i(this)}}const He={anticipate:e.anticipate,backInOut:e.backInOut,circInOut:e.circInOut};function _e(t){"string"==typeof t.ease&&t.ease in He&&(t.ease=He[t.ease])}class Ze extends qe{constructor(t){_e(t),Ft(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(o.now()-this.startTime)*this.speed:1e3*this.time}sample(t){if(!this.sampler){const{motionValue:t,onUpdate:e,onComplete:n,onPlay:i,onStop:s,element:o,...r}=this.options;this.sampler=new Kt({...r,autoplay:!1}),this.sampler.stop()}return this.sampler.sample(Math.max(0,t)).value}liveValue(){const{state:t}=this;if("running"===t||"paused"===t)return this.sample(this.elapsed())}updateMotionValue(t){const{motionValue:n,element:i,name:s}=this.options;if(!n)return;if(void 0!==t)return void n.set(t);const{speed:o}=this,r=this.elapsed(),a="running"===this.state&&o?e.clamp(0,10,r):0,l=this.sample(r);i&&s&&Oe(i,s,l),n.setWithVelocity(this.sample(r-a*Math.sign(o)),l,a/Math.abs(o||1))}}const Je=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!$.test(t)&&"0"!==t||t.startsWith("url(")));function Qe(t){t.duration=0,t.type="keyframes"}const tn=new Set(["opacity","clipPath","filter","transform"]),en=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const nn=({mixer:t,keyframes:e})=>t&&"number"!=typeof e[0]&&e.some((n,i)=>i&&t(e[i-1],n)),sn=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),on=()=>!e.MotionGlobalConfig.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function rn(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r,keyframes:a}=t;if(!n||!tn.has(n)&&!sn.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 on()&&(tn.has(n)||sn.has(n)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&en.test(t[e]))return!0;return!1}(a))&&("transform"!==n||!u)&&!c&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r&&!nn(t)}const an=(t,e)=>e&&"number"==typeof t?e.transform(t):t,ln={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},cn=ye.length,un={},hn=(t,e,n=an(e,Zt[t]))=>(un[t]||(un[t]=(ln[t]||t)+"("))+n+")",dn=(t,e)=>("number"==typeof e?e:parseFloat(e))===(t.startsWith("scale")?1:0);function pn(t,e,n){let i="";for(let s=0;s<cn;s++){const o=ye[s],r=t[o];if(void 0===r)continue;const a=n&&(e[o]=an(r,Jt[o]));dn(o,r)||(i+=hn(o,r,a||void 0)+" ")}const s=t.pathRotation;return s&&(i+=hn("rotate",s)),i=i.trim(),n?n(e,i):i||"none"}const mn=new WeakMap,fn=.001,gn=100,yn=new Set(["linear","easeIn","easeOut","easeInOut"]),vn=new WeakMap,xn=(t,e)=>Math.min(200,Math.max(2,Math.ceil((e-t)/10))),wn=(t,e)=>Math.abs(t-e)<=.001,Tn=(t,e)=>t-e,Sn=(t,e,n)=>kt(Array(n+1)).map(n=>Y(t,e,n)),bn=t=>t.motionValue.owner,Pn=t=>mn.get(t),Mn=({state:t})=>"idle"===t||"finished"===t,An=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class En{constructor(t,e,n,i){this.element=t,this.update=e,this.makeDriver=n,this.animation=i}get js(){return this.driver||(this.driver=this.makeDriver(this.update))}now(){return this.driver||this.makeDriver!==ht?this.js.now():n.isProcessing?n.timestamp:o.now()}start(t=!0){const e=Pn(this.element);!e||e.isJS?this.js.start(t):e.schedule(!1,!t)}stopJS(){this.driver?.stop()}stop(){this.stopJS();const t=Pn(this.element);t&&!t.isFinishing&&t.release(this.animation)}}let Vn,Dn;class kn extends Kt{constructor(t){const e=bn(t).current,{driver:n=ht}=t;let i;const s=function(t){const e=bn(t),{onUpdate:n,transformTemplate:i}=e.getProps();return!(t.isHandoff||n||t.hasOnUpdate||i||"inertia"===t.type||"none"!==(An(e,"transform")||"none")||An(e,"pathRotation")||e.projection?.isProjecting()||nn(t))}(t);t.driver=t=>new En(e,t,n,i),super(t),i=this;const o=this.driver;o&&(o.animation=this),this.canAccelerate=s;const{stop:r}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),r()}}offsets(){const{keyframes:t,times:e}=this.options;return e||(this.offsetsOf!==t&&(this.offsetsOf=t,this.cachedOffsets=kt(t)),this.cachedOffsets)}get group(){return Pn(bn(this.options).current)}get js(){return this.driver?.js}stopJS(){this.driver?.stopJS()}get name(){return this.options.name}timing(){const{startTime:t,speed:e,totalDuration:n}=this,{delay:i=0,repeatType:s}=this.options;return null!==this.holdTime?[1/0,0]:n===1/0?[t+i/e,this.resolvedDuration*("loop"===s?1:2)/e||1]:[t+(i+n)/e,0]}isAccelerated(){const{group:t,state:e}=this;return t?.tracks.has(this)&&!t.isJS&&this.canAccelerate&&("running"===e||"paused"===e)}liveValue(){return this.isAccelerated()?this.sampleAt(o.now()):void 0}tween(){const{keyframes:t,type:n,repeat:i,delay:s=0}=this.options;let o=-1;if(i||n!==jt||null!==this.holdTime)return;for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(o>=0)return;o=e-1}let{ease:r}=this.options;e.isEasingArray(r)&&(r=r[o]);const a=this.offsets(),l=t=>this.startTime+(s+a[t]*this.totalDuration)/this.speed;if(o>=0){const t=e.isBezierDefinition(r)?$e(r):(t=>yn.has(t))(r)?ze[r]:e.easingDefinitionToFunction(r);return[l(o),l(o+1),"string"==typeof t||wn(t(0),0)&&wn(t(1),1)?t:void 0]}}boundaries(t,e){const{startTime:n,speed:i,resolvedDuration:s,options:o}=this,{delay:r=0,repeat:a=0,repeatDelay:l=0,repeatType:c,type:u}=o,h=(u||jt)===jt?this.offsets():[0,1],d=n+r/i,p=[];if(null!==this.holdTime||!(s>0))return p;for(let n=Math.max(0,Math.floor((t-d)*i/s));n<=a;n++){const o=d+n*s/i;if(o>e)break;for(const r of h){const a=o+(n%2&&c&&"loop"!==c?1-r:r)*(s-l)/i;a>t&&a<e&&p.push(a)}}return p}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=o.now(),e=this.sampleAt(t,!0);this.options.motionValue.setWithVelocity(null===this.holdTime?this.sampleAt(t-10,!0):e,e,10)}play(){this.isStopped||((this.group||function(t){const i=t.current,s=new Set,r=new Map;let a,l,c={},u=[],h=new Map,d=[],p=!1,m=!1,f=!1,g=!1,y=-1/0,v=1/0;const x=t=>{for(const e of s)if(e.name===t)return!0},w=(e,n)=>{const i={};for(const s of void 0===e?ye:u){const o=r.get(s),a=void 0===e?An(t,s):o?o.sampleAt(n>e&&!o.timing()[1]?n:e):c[s];void 0!==a&&(i[s]=a)}return i},T=(t,e)=>{let n="";for(const i in t){const s=t[i];e&&dn(i,s)||(n+=hn(i,s)+" ")}return(e?n.trim():n)||"none"},S=(t,e)=>T(w(t,e)),b=(t=w())=>{i.style.transform=T(t,!0)},P=t=>{t.onfinish=t.oncancel=null,t.cancel()},M=(t=!0)=>{clearTimeout(a),v=1/0,l=void 0,t&&b(),d.forEach(({animation:t})=>P(t)),d=[]},A=(t,e)=>new Animation(new KeyframeEffect(i,t,e)),E=(t,e,n=1/0)=>{const i={animation:t,offset:e,end:n};t.startTime=o.now()+e,n<1/0&&(t.onfinish=()=>{i.isDone=!0,d.some(t=>t.end===1/0)&&(P(t),d=d.filter(t=>t!==i)),I.schedule(!1)}),t.oncancel=()=>d.includes(i)&&I.demote(),d.push(i)},V=(t,e,n)=>{const i=(e,n)=>Math.abs(t(n)-t(e)),s=i(e,n);for(;n-e>.01;){const t=(e+n)/2;i(e,t)>i(t,n)?n=t:e=t}return i(e,n)>s/2?[e,n]:[]},D=(t,n,i,s)=>{const o=xn(n,i);if(4*s.length>o)return;let r;for(const e of t){const t=e.numberAt(n),s=(e.numberAt((n+i)/2)-t)/(e.numberAt(i)-t);if(s==s)if(void 0===r)r=s;else if(!wn(s,r))return}const a=Sn(n,i,o).concat(s).sort(Tn),l=t=>e.progress(n,i,t);let c,u;for(const e of t){const t=e.numberAt(n),i=a.map(n=>e.numberAt(n)-t),s=i[i.length-1],o=i.some(t=>Math.abs(t)*fn>Math.abs(s))?0:s,r=i.map(t=>o?t/o:t);if(o&&!c)c=r,u=n=>(e.numberAt(n)-t)/o;else if(r.some((t,e)=>!wn(t,o&&c[e])))return}if(!c||c.every((t,e)=>wn(t,l(a[e]))))return"linear";const h=[],d=(t,e=u(t))=>h.push(zt(e)+" "+zt(100*l(t))+"%");return c.forEach((t,e)=>{e&&Math.abs(t-c[e-1])>.2&&V(u,a[e-1],a[e]).forEach(t=>d(t)),d(a[e],t)}),"linear("+h+")"},k=(t,e,n,i)=>{const s=[e],o=[];let r=n,a=e;for(const i of t){const t=i.tween();if("linear"!==t?.[2]){const[s,l]=i.timing(),[c,u]=t||[e,l?n:s];r=Math.min(r,c),a=Math.max(a,u),o.push(i)}}r=Math.max(e,r),a=Math.min(n,a);const l=(t,e)=>o.every(n=>!(Math.abs(n.numberAt((t+e)/2)-(n.numberAt(t)+n.numberAt(e))/2)>(n.name.startsWith("scale")?.001:.1))),c=(e,n,i)=>{if(n-e<1||l(e,n))s.push(n);else if(i<4)c(e,(e+n)/2,i+1),c((e+n)/2,n,i+1);else{for(const i of t)s.push(...V(t=>i.numberAt(t),e,n));s.push(n)}},u=a>r?Sn(r,a,Math.ceil((a-r)/100)):[];u.push(n);for(const t of i)u.push(t,Math.min(t+.01,n));let h=e;for(const t of u.sort(Tn))t>h&&c(h,t,0),h=t;return s.sort(Tn)},C=t=>{let e;for(const n of t){const t=n.tween();if(!t||e&&(Math.abs(t[0]-e[0])>1||Math.abs(t[1]-e[1])>1))return;e=[t[0],t[1],e&&t[2]!==e[2]?void 0:t[2]]}return e},R=(t,n,i,s,o={fill:"both"},r)=>{const a=s?[]:t.flatMap(t=>t.boundaries(n,i)),l=s||D(t,n,i,a),c=l?[n,i]:k(t,n,i,a),u=c.map(t=>S(t,r));let h={transform:u};return l||(h.offset=c.map(t=>e.progress(n,i,t))),u.every(t=>t===u[0])&&(b(w(n,r)),h=null),A(h,{...o,duration:i-n,easing:l||"linear"})},j=t=>{const e=o.now()+t;e<v&&(clearTimeout(a),v=e,a=setTimeout(()=>{v=1/0,I.schedule(!1)},t))},L=e=>{let n=e,i=0,o=0;const a=[],p=[],m=new Set;r.clear(),h=new Map;for(const t of s){r.set(t.name,t);const[s,l]=t.timing(),c=s===1/0;if(h.set(t,[t.at(e),t.speed,c]),!c){if(t.speed<0)return;if(l){if(i){const t=(s-o)/l;if(Math.abs(l-i)>1||Math.abs(t-Math.round(t))*i>1)return}else i=l,o=s;p.push(t)}else m.add(s);a.push(t),n=Math.max(n,s)}}c={},u=ye.filter(e=>{if(r.has(e))return!0;const n=c[e]=An(t,e);return void 0!==n&&!dn(e,n)}),M(!1);const f=!i&&C(a);try{if(n>e){let t;if(f&&f[1]>e){const[i,s,o]=f;if(i-e>gn)return a.forEach(t=>t.sync()),j(l=i-e-gn),!0;t="string"==typeof o?o:o?((t,e)=>{let n=vn.get(t);return n?.[0]!==e&&(n=[e,"linear("+kt(Array(e+1)).map(e=>zt(t(e))+" "+zt(100*e)+"%")+")"],vn.set(t,n)),n[1]})(o,xn(i,s)):D(a,i,s,[]),t&&E(R(a,i,s,t,{fill:"both",endDelay:n-s}),i-e,n-i)}t||E(R(a,e,n),0,n-e),m.forEach(t=>t<n-1&&E(A(null,{duration:t-e}),0,t-e))}if(i){const t=o+Math.floor((n-o)/i)*i;E(R(p,t,t+i,void 0,{iterations:1/0,iterationStart:(n-t)/i,fill:"forwards"},n),n-e)}}catch{return}return d.length||M(),!0},B=(t,e)=>{let n,i=0;for(const e of s){const s=h.get(e);if(!s)return!1;const[o,r,a]=s,l=e.at(t),c=e.timing()[0]===1/0;if(a){if(c&&(l===o||!d.length))continue;return!1}const u=(l-o)/r,p=c?0:e.speed/r;if(void 0===n)n=u,i=p;else if(Math.abs(u-n)>1||p!==i)return!1}if(void 0===n)return!0;if(!d.length){if(void 0===l||e&&i)return!1;if(i){const t=(l-n)/i;if(t<1)return!1;j(t)}return!0}for(const{offset:t,end:i,isDone:s}of d){const o=n-t;if(i<1/0&&(s?o<i-1:o<0&&(e||t<=0)||o>=i))return!1}for(const{animation:e,offset:s,isDone:o}of d){if(o)continue;const r=n-s;i&&e.updatePlaybackRate&&"running"===e.playState&&Math.abs(Number(e.currentTime)-r)<20?e.playbackRate!==i&&e.updatePlaybackRate(i):i?(e.playbackRate!==i&&(e.playbackRate=i),e.startTime=t-r/i):(e.startTime=null,e.currentTime=r)}return!0},O=()=>!s.size&&(f=!0,Pn(i)===I&&mn.delete(i),I.isJS||M(),!0),F=()=>{const e=o.now();if(I.isJS||(I.isFinishing=!0,s.forEach(n=>{const[i,s]=n.timing();"running"===n.state&&n.speed>0&&!s&&i<=e+1&&(n.complete(),c[n.name]=An(t,n.name),h.has(n)||(p=!0))}),I.isFinishing=!1),m=!1,f)return;if(s.forEach(t=>Mn(t)&&s.delete(t)),O())return;for(const t of s)if(!t.canAccelerate)return I.demote(!0);I.isJS&&(I.isJS=!1,p=!0,s.forEach(t=>t.stopJS()));const n=p,i=g;if(p=g=!1,n||!B(e,i)){if(i){if(e-y<100)return I.demote();y=e}if(!L(e))return I.demote()}else if(void 0!==l&&!i)return;s.forEach(t=>t.timing()[0]===1/0&&t.sync())},I={tracks:s,isJS:!1,isFinishing:!1,schedule(t,e){f||(p||(p=t),g||(g=!!e),m||(m=!0,n.isProcessing?lt.render(F,!1,!0):Cn(F)))},release(t){Mn(t)&&s.delete(t),O()||I.schedule(!0)},check(){if(!I.isJS)for(const e in c)if(An(t,e)!==c[e]&&!x(e))return I.schedule(!0,!0)},demote(t){if(!I.isJS&&!f)return s.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),I.isJS=!0,h=new Map,M(),s.forEach(t=>"running"===t.state&&t.js?.start()),!0}};return mn.set(i,I),I}(bn(this.options))).tracks.add(this),super.play())}pause(){super.pause(),this.isAccelerated()&&this.group.schedule(!1)}complete(){super.complete();const{group:t}=this;t&&!t.isJS&&this.tick(o.now())}get time(){return this.isAccelerated()?e.millisecondsToSeconds(e.clamp(0,this.totalDuration,this.at(o.now())-(this.options.delay||0))):super.time}set time(t){(Vn??(Vn=Object.getOwnPropertyDescriptor(Kt.prototype,"time").set)).call(this,t)}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}const Cn=t=>{Dn||queueMicrotask(()=>{const t=Dn;Dn=void 0,t.forEach(t=>t())}),(Dn||(Dn=[])).push(t)};class Rn extends Wt{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=o.now();const{keyframes:e,name:n,motionValue:i,element:s}=t,r=t;r.autoplay??(r.autoplay=!0),r.delay??(r.delay=0),r.type??(r.type="keyframes"),r.repeat??(r.repeat=0),r.repeatDelay??(r.repeatDelay=0),r.repeatType??(r.repeatType="loop");const a=s?.KeyframeResolver||Le;this.keyframeResolver=new a(e,(t,e,n)=>this.onKeyframesResolved(t,e,r,!n),n,i,s),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:r,type:a,velocity:l,delay:c,isHandoff:u,onUpdate:h}=i;this.resolvedAt=o.now();const d=function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Je(s,e),a=Je(o,e);return!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Ye(n))&&i)}(t,r,a,l);d||(!e.MotionGlobalConfig.instantAnimations&&c||h?.(Bt(t,i,n)),t[0]=t[t.length-1],Qe(i),i.repeat=0);const{onComplete:p}=i;i.finalKeyframe=n,i.keyframes=t,i.onComplete=()=>{p?.(),this.notifyFinished()};const m=d&&!u&&rn(i),f=!m&&(({name:t,motionValue:e})=>t&&ye.includes(t)&&e?.owner?.current instanceof HTMLElement&&on()&&We())(i);let g;if(s&&(m||f||this.resolvedAt!==this.createdAt)&&(i.startTime??(i.startTime=It(this.createdAt,this.resolvedAt))),m){i.element=i.motionValue?.owner?.current;try{g=new Ze(i)}catch{g=new Kt(i)}}else g=f?new kn(i):new Kt(i);this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),je()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}}class jn{constructor(t){this.stop=()=>{for(const t of this.animations)t.stop()},this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}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){for(const e of this.animations)e.time=t}get speed(){return this.getAll("speed")}set speed(t){for(const e of this.animations)e.speed=t}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return Ln(this.animations,"duration")}get iterationDuration(){return Ln(this.animations,"iterationDuration")}play(){for(const t of this.animations)t.play()}pause(){for(const t of this.animations)t.pause()}cancel(){for(const t of this.animations)t.cancel()}complete(){for(const t of this.animations)t.complete()}}function Ln(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 Bn extends qe{constructor(t){super(),this.animation=t,t.onfinish=this.onFinish=()=>{t.onfinish=null,this.finishedTime=this.time,this.notifyFinished()},Nt(this,{})}}const On=new WeakMap;function Fn(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 In={current:void 0};class Un{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=o.now();if(this.updatedAt!==e&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.dirty(),this.dependents))for(const t of this.dependents)t.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=o.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,n){var i;return"change"===t?this.onChangeSubscribe(n):((i=this.events)[t]||(i[t]=new e.SubscriptionManager)).add(n)}onChangeSubscribe(t){const{events:n}=this;return n.change||this.changeSubscriber?(n.change||(n.change=new e.SubscriptionManager,n.change.add(this.changeSubscriber),this.changeSubscriber=void 0),n.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:n.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){lt.read(()=>{this.changeSubscriber||this.events.change?.getSize()||this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){e&&(this.updatedAt=o.now(),this.stop()),this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){(this.dependents||(this.dependents=new Set)).add(t)}removeDependent(t){this.dependents?.delete(t)}get(){In.current?.push(this);const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=o.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e.velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return new Promise(e=>this.run(t,e))}run(t,e){this.stop(),this.hasAnimated=!0;let n,i=!1;n=t(()=>{i=!0,this.events.animationComplete?.notify(),this.animation===n&&(this.animation=void 0),e?.()}),i||(this.animation=n),this.events.animationStart?.notify()}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel?.notify()),this.animation=void 0}isAnimating(){return!!this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect?.()}}function Nn(t,e){return new Un(t,e)}function Wn(t,e){if(t?.inherit&&e){const{inherit:n,...i}=t;return{...e,...i}}return t}function $n(t,e){const n=t?.[e]??t?.default??t;return n!==t?Wn(n,t):n}const zn={type:"spring",stiffness:500,damping:25,restSpeed:10},Kn={type:"keyframes",duration:.8},Gn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yn=(t,{keyframes:e})=>e.length>2?Kn:ve.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:zn:Gn,Xn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out","mixer"]);function qn(t){for(const e in t)if(!Xn.has(e))return!0;return!1}const Hn=(t,n,i,s={},o,r)=>a=>{const l=$n(s,t)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u-=e.secondsToMilliseconds(c);const h={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:n.getVelocity(),...l,delay:-u,onUpdate:t=>{n.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:n,element:r?void 0:o,hasOnUpdate:!!l.onUpdate};qn(l)||Object.assign(h,Yn(t,h)),h.duration&&(h.duration=e.secondsToMilliseconds(h.duration)),h.repeatDelay&&(h.repeatDelay=e.secondsToMilliseconds(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(Qe(h),0===h.delay&&(d=!0)),(e.MotionGlobalConfig.instantAnimations||e.MotionGlobalConfig.skipAnimations||o?.shouldSkipAnimations||l.skipAnimations)&&(d=!0,Qe(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,d&&!r&&void 0!==n.get()){const t=Bt(h.keyframes,l);if(void 0!==t)return void lt.update(()=>{h.onUpdate(t),h.onComplete()})}return l.isSync?new Kt(h):new Rn(h)};function _n(t,e,n,i){const s=1-t;return s*s*e+2*s*t*n+t*t*i}function Zn(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 Jn(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 Qn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ti(t){const e=Qn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}function ei(t,n,i=1){const[s,o]=ti(t);if(!s)return;const r=window.getComputedStyle(n).getPropertyValue(s);if(r){const t=r.trim();return e.isNumericalString(t)?parseFloat(t):t}return u(o)?ei(o,n,i+1):o}function ni(t,e,n,i){const s=e=>"function"==typeof e?e(void 0!==n?n:t.custom,...function(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}(i)):e;return"string"==typeof(e=s(e))&&(e=t.variants&&t.variants[e]),s(e)}function ii(t,e,n){return ni(t.getProps(),e,n,t)}const si=(t,e)=>"exit"===e?t.presenceContext?.custom:void 0,oi=new Set(["width","height","top","left","right","bottom",...ye]),ri=t=>Array.isArray(t);function ai(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Nn(n))}function li(t){return ri(t)?t[t.length-1]||0:t}function ci(t,e){const n=ii(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){ai(t,e,li(o[e]))}}const ui=t=>Boolean(t&&t.getVelocity);function hi(t){return Boolean(ui(t)&&t.add)}function di(t,n){const i=t.getValue("willChange");if(hi(i))return i.add(n);if(!i&&e.MotionGlobalConfig.WillChange){const i=new e.MotionGlobalConfig.WillChange("auto");t.addValue("willChange",i),i.add(n)}}const pi="data-framer-appear-id";function mi(t){return t.props[pi]}const fi="undefined"!=typeof window;function gi({protectedKeys:t,needsAnimating:e},n){const i=n in t&&!e[n];return e[n]=!1,i}function yi(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o,transitionEnd:r,...a}=e;const l=t.getDefaultTransition();o=o?Wn(o,l):l;const c=o?.reduceMotion,u=o?.skipAnimations;i&&(o=i);const h=[],d=s&&t.animationState?.getState()[s],p=o?.path;p&&(p.animateValues?p.animateValues(e=>t.getValue(e,t.latestValues[e]??0),a,o,n,h):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&&gi(d,e))continue;const r={delay:n,...$n(d?.out[e]||o||{},e)};u&&(r.skipAnimations=!0);const l=i.get();if(void 0!==l&&!i.isAnimating()&&!Array.isArray(s)&&s===l&&!r.velocity){lt.update(()=>i.set(s));continue}let p=!1;if(fi&&window.MotionHandoffAnimation){const n=mi(t);if(n){const t=window.MotionHandoffAnimation(n,e,lt);null!==t&&(r.startTime=t,p=!0)}}di(t,e);const m=c??t.shouldReduceMotion;i.run(Hn(e,i,s,m&&oi.has(e)?{type:!1}:r,t,p));const f=i.animation;f&&h.push(f)}if(r){const e=()=>lt.update(()=>{r&&ci(t,r)});h.length?Promise.all(h).then(e):e()}return h}function vi(t,e,n={}){const i=ii(t,e,si(t,n.type)),s=n.transitionOverride||(i?.transition??(t.getDefaultTransition()||{})),o=()=>Promise.all(i?yi(t,i,n):[]),r=(i=0)=>{const{variantChildren:o}=t,{delayChildren:r=0,staggerChildren:a,staggerDirection:l}=s,c=[];return o?.forEach(t=>{t.notify("AnimationStart",e),c.push(vi(t,e,{...n,delay:i+("function"==typeof r?0:r)+Fn(o,t,r,a,l)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(c)},{when:a}=s;return a?"beforeChildren"===a?o().then(()=>r()):r().then(o):Promise.all([o(),r(n.delay)])}function xi(t,e,n={}){t.notify("AnimationStart",e);return(Array.isArray(e)?Promise.all(e.map(e=>vi(t,e,n))):"string"==typeof e?vi(t,e,n):Promise.all(yi(t,ii(t,e,n.custom),n))).then(()=>{t.notify("AnimationComplete",e)})}const wi=t=>e=>e.test(t),Ti=[p,E,A,M,D,V,{test:t=>"auto"===t,parse:t=>t}],Si=t=>Ti.find(wi(t));function bi(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||e.isZeroValueString(t))}const Pi=new Set(["auto","none","0"]);class Mi extends Le{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:n}=this,i=t[0]??n?.get();if(!e?.current||void 0===i)return!1;for(let e=0;e<t.length;e++)if(d(e?t[e]:i))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e?.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),u(i))){const s=ei(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!oi.has(n)||2!==t.length)return;const[i,s]=t;if("number"==typeof i&&"number"==typeof s)return;const o=Si(i),r=Si(s);if(d(i)!==d(s)&&Ae[n])this.needsMeasurement=!0;else if(o!==r)if(xe(o)&&xe(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else Ae[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||bi(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&&!Pi.has(e)&&I(e)&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]!==i&&(t[s]=oe(n,i))}(t,n,e)}measure(){const{element:t,name:e}=this;return Ae[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t?.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&this.motionValue?.jump(i,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const n=e.length-1,i=e[n];e[n]=this.measure(),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),this.resolveNoneKeyframes()}}const Ai=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],Ei=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius",...Ai,"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"]);const Vi=e.memo(()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0}),Di=[];function ki(t){e.removeItem(Di,t)}function Ci(t,e,n={},i){const s=[],{velocity:o,path:r}=n,a=n.reduceMotion??i?.shouldReduceMotion;r?.animateValues&&i&&(e={...e},r.animateValues(t,e,n,0,s));for(const r in e){if("transition"===r||"transitionEnd"===r)continue;const l=e[r];if(void 0===l)continue;const c=t(r),u=c.get();void 0===u||c.isAnimating()||Array.isArray(l)||l!==u||o?(c.run(Hn(r,c,l,a&&oi.has(r)?{type:!1}:n,i)),c.animation&&s.push(c.animation)):lt.update(()=>c.set(l))}const{transitionEnd:l}=e;if(l){const e=()=>lt.update(()=>{for(const e in l)t(e).set(l[e])});s.length?Promise.all(s).then(e):e()}return s}function Ri(t,e,n,i,s){let o,r=!1;const a=Ci(i=>{let a=o?.[i]??t.get(e,i);if(!a){let l;if(!s){const s=n[i];l=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(s)??t.read(e,i,s)}a=Nn(l,{owner:s}),r?t(e,{[i]:a}):(o||(o={}))[i]=a}return a},n,i,s);return r=!0,o&&t(e,o),a}function ji(t){return e.isObject(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function Li(t){return e.isObject(t)&&"ownerSVGElement"in t}const Bi={};function Oi(t){return Bi.current?.add(t),t}function Fi(t){const e=Bi.current;if(!e)return;let n,i=!1;const s=e.add(()=>{i=!0,n?.()});t.then(t=>{t&&(n=()=>t.stop(),i?n():t.finished.then(s))},s)}const Ii=t=>Bi.current?Bi.current.bind(t):t;function Ui(t,e,n){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const i=e?e.current:Bi.current?.root||document,s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(t=>null!=t)}function Ni(t){const{test:e,read:n,get:i,flush:s,state:o}=t;return Object.assign((e,n)=>{const i=Ui(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 Wi{constructor(t=lt.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.get(t)?.onRemove===r&&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 $i(t,{step:e,...n}={}){const i=new WeakMap;return Object.assign((n,s)=>{const o=i.get(n)??new Wi(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 zi=new Set(["originX","originY","originZ"]),Ki=(t,e)=>an(t.get(e)?.get(),Jt[e]),Gi=(t,e,n,i)=>{let s,o;if(ve.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)=>ye.indexOf(t)-ye.indexOf(e)))}e.get("transform")||(ji(t)||e.get("transformBox")||Gi(t,e,"transformBox",new Un("fill-box")),e.set("transform",new Un("none"),()=>{mn.get(t)?.check(),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].getCurrent();void 0!==o&&(dn(s,o)||(e+=(e&&" ")+hn(s,o)))}const s=t.get("pathRotation")?.get();return s&&(e+=(e&&" ")+hn("rotate",s)),e||"none"}(e)})),o=e.get("transform")}else zi.has(n)?(e.get("transformOrigin")||e.set("transformOrigin",new Un(""),()=>{const n=Ki(e,"originX")??"50%",i=Ki(e,"originY")??"50%",s=Ki(e,"originZ")??0;t.style.transformOrigin=`${n} ${i} ${s}`}),o=e.get("transformOrigin")):s=Be(n)?()=>{t.style.setProperty(n,i.getCurrent())}:()=>{t.style[n]=an(i.getCurrent(),Jt[n])};return e.set(n,i,s,o)},Yi=(t,e)=>{if(ve.has(e))return ge(t,e);const n=getComputedStyle(t),i=Be(e)?n.getPropertyValue(e):n[e];return"string"==typeof i&&i.trim()||0},Xi=$i(Gi,{test:t=>ji(t)||Li(t),read:Yi}),qi=Ni(Xi);function Hi(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}function _i(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(ve.has(t))r=!0;else if(l(t))s[t]=n;else{const e=an(n,Jt[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=pn(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 Zi={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ji={offset:"strokeDashoffset",array:"strokeDasharray"};function Qi(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?Zi:Ji;t[o.offset]=""+-i,t[o.array]=`${e} ${n}`}const ts=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function es(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(_i(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 ts)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&&Qi(h,s,o,r,!1)}const ns=(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=Hi(s));const r=Jt[n]||Jt[s],a=o?()=>{t[s]=an(i.get(),Jt[n])}:()=>{const e=an(i.get(),r);null==e?t.removeAttribute(s):t.setAttribute(s,String(e))};return e.set(n,i,a)},is=Ni($i(ns));const ss=(t,e,n,i)=>{if(n.startsWith("path")&&!ve.has(n))return function(t,e,n,i){return lt.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 Un("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 ns(t,e,n,i,ls(n));if("d"===n)return e.set(n,i,()=>{const e=i.get()?.replace(/path\(|["')]/g,"");void 0===e?t.removeAttribute(n):t.setAttribute(n,e)});return(ve.has(n)||zi.has(n)||Be(n)||n in t.style?Gi:ns)(t,e,n,i)},os=(t,e)=>ve.has(e)?Jt[e]?.default||0:Be(e)||ts.includes(e)?Yi(t,e)||t.getAttribute(Hi(e))||0:(e=ls(e),t.getAttribute(Hi(e))??t.getAttribute(e)??void 0),rs=$i(ss,{test:Li,read:os}),as=Ni(rs);function ls(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}function cs({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function us({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function hs(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 ds(t){return void 0===t||1===t}function ps({scale:t,scaleX:e,scaleY:n}){return!ds(t)||!ds(e)||!ds(n)}const ms=["rotate","rotateX","rotateY","rotateZ","skewX","skewY"];function fs(t){return ps(t)||ys(t)||gs(t)}function gs(t){return t.z||t.rotate||t.rotateX||t.rotateY||t.rotateZ||t.skewX||t.skewY}function ys(t){return vs(t.x)||vs(t.y)}function vs(t){return t&&"0%"!==t}function xs(t,e,n){return n+e*(t-n)}function ws(t,e,n,i,s){return void 0!==s&&(t=xs(t,s,i)),xs(t,n,i)+e}function Ts(t,e=0,n=1,i,s){t.min=ws(t.min,e,n,i,s),t.max=ws(t.max,e,n,i,s)}function Ss(t,{x:e,y:n}){Ts(t.x,e.translate,e.scale,e.originPoint),Ts(t.y,n.translate,n.scale,n.originPoint)}const bs=.999999999999,Ps=1.0000000000001;function Ms(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++)o=n[a],r=o.projectionDelta,"contents"!==o.options.visualElement?.props.style?.display&&(!0===i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(As(t.x,-o.scroll.offset.x),As(t.y,-o.scroll.offset.y)),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ss(t,r)),i&&(i.path?.[a]||i)!==o&&fs(o.latestValues)&&Ds(t,o.latestValues,o.layout?.layoutBox));e.x<Ps&&e.x>bs&&(e.x=1),e.y<Ps&&e.y>bs&&(e.y=1)}function As(t,e){t.min+=e,t.max+=e}function Es(t,e,n,i,s=.5){Ts(t,e,n,Y(t.min,t.max,s),i)}function Vs(t,e){return"string"==typeof t?parseFloat(t)/100*(e.max-e.min):t}function Ds(t,e,n){const i=n??t;Es(t.x,Vs(e.x,i.x),e.scaleX,e.scale,e.originX),Es(t.y,Vs(e.y,i.y),e.scaleY,e.scale,e.originY)}function ks(t,e){return cs(hs(t.getBoundingClientRect(),e))}function Cs(t,e,n){const i=ks(t,n),{scroll:s}=e;return s&&(As(i.x,s.offset.x),As(i.y,s.offset.y)),i}const Rs=()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),js={},Ls=t=>Li(t)?rs:Xi;class Bs{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=Mi}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 ks(this.current)}getProps(){return js}}const Os=t=>Ls(t).state(t)?.release();function Fs(t,e){const n=Ls(t).state(t);if(!n)return;const i=mn.get(t);i&&(i.demote(),mn.delete(t));const{transformKeys:s}=n;n.release().forEach((t,n)=>{"transformBox"===n||"transform"===n&&s?.length||(t.owner=e,e.addValue(n,t))})}const Is=$i((t,e,n,i)=>e.set(n,i,()=>{t[n]=i.get()}),{test:t=>e.isObject(t),read:(t,e)=>{const n=t[e];return"string"==typeof n||"number"==typeof n?n:void 0}}),{schedule:Us,cancel:Ns}=at(queueMicrotask,!1);function Ws(t,e,n){const i=ui(t)?t:Nn(t);return i.run(Hn("",i,e,n)),i.animation}const $s={};function zs(t,{layout:e,layoutId:n}){return ve.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!$s[t]||"opacity"===t)}const Ks={value:null,addProjectionMetrics:null,countProjection:void 0};function Gs(t,e){const n=o.now();t=Ii(t);const i=({timestamp:s})=>{const o=s-n;o>=e&&(ct(i),t(o-e))};return lt.setup(i,!0),Oi(()=>ct(i))}function Ys(t){return Li(t)&&"svg"===t.tagName}function Xs(t){return ui(t)?t.get():t}const qs=t=>"number"==typeof t?t:parseFloat(t),Hs=Ai.length,_s=t=>"number"==typeof t||E.test(t);function Zs(t,e,n,i,s,o){s?(t.opacity=Y(0,n.opacity??1,Qs(i)),t.opacityExit=Y(e.opacity??1,0,to(i))):o&&(t.opacity=Y(e.opacity??1,n.opacity??1,i));for(let s=0;s<Hs;s++){const o=Ai[s];let r=Js(e,o),a=Js(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||_s(r)===_s(a)?(t[o]=Math.max(Y(qs(r),qs(a),i),0),(A.test(a)||A.test(r))&&(t[o]+="%")):t[o]=a}for(let s=0;s<ms.length;s++){const o=ms[s];(e[o]||n[o])&&(t[o]=Y(e[o]||0,n[o]||0,i))}}function Js(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const Qs=eo(0,.5,e.circOut),to=eo(.5,.95,e.noop);function eo(t,n,i){return s=>s<t?0:s>n?1:i(e.progress(t,n,s))}function no(t,e){t.min=e.min,t.max=e.max}function io(t,e){no(t.x,e.x),no(t.y,e.y)}function so(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function oo(t){return t.max-t.min}function ro(t,e,n){return Math.abs(t-e)<=n}function ao(t,e,n,i=.5){t.origin=i,t.originPoint=Y(e.min,e.max,t.origin),t.scale=oo(n)/oo(e),t.translate=Y(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 lo(t,e,n,i){ao(t.x,e.x,n.x,i?.originX),ao(t.y,e.y,n.y,i?.originY)}function co(t,e,n,i=0){const s=i?Y(n.min,n.max,i):n.min;t.min=s+e.min,t.max=t.min+oo(e)}function uo(t,e,n,i){co(t.x,e.x,n.x,i?.x),co(t.y,e.y,n.y,i?.y)}function ho(t,e,n,i=0){const s=i?Y(n.min,n.max,i):n.min;t.min=e.min-s,t.max=t.min+oo(e)}function po(t,e,n,i){ho(t.x,e.x,n.x,i?.x),ho(t.y,e.y,n.y,i?.y)}function mo(t,e,n,i,s){return t=xs(t-=e,1/n,i),void 0!==s&&(t=xs(t,1/s,i)),t}function fo(t,e=0,n=1,i=.5,s,o=t,r=t){if(A.test(e)){e=parseFloat(e);e=Y(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Y(o.min,o.max,i);t===o&&(a-=e),t.min=mo(t.min,e,n,a,s),t.max=mo(t.max,e,n,a,s)}function go(t,e,[n,i,s],o,r){fo(t,e[n],e[i],e[s],e.scale,o,r)}const yo=["x","scaleX","originX"],vo=["y","scaleY","originY"];function xo(t,e,n,i){go(t.x,e,yo,n?.x,i?.x),go(t.y,e,vo,n?.y,i?.y)}const wo=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),To=wo("applewebkit/")&&!wo("chrome/")?Math.round:e.noop;function So(t){t.min=To(t.min),t.max=To(t.max)}function bo(t){So(t.x),So(t.y)}const Po=()=>({translate:0,scale:1,origin:0,originPoint:0}),Mo=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),Ao=()=>({min:0,max:0}),Eo=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Vo(t){return 0===t.translate&&1===t.scale}function Do(t){return Vo(t.x)&&Vo(t.y)}function ko(t,e){return t.min===e.min&&t.max===e.max}function Co(t,e){return ko(t.x,e.x)&&ko(t.y,e.y)}function Ro(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function jo(t,e){return Ro(t.x,e.x)&&Ro(t.y,e.y)}function Lo(t){return oo(t.x)/oo(t.y)}function Bo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Oo{constructor(){this.members=[]}add(t){e.addUniqueItem(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;s&&!1!==s.isConnected||i.snapshot||(e.removeItem(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(e.removeItem(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){for(let e=this.members.indexOf(t)-1;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent&&!1!==t.instance?.isConnected)return this.promote(t),!0}return!1}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=n.options,{layoutDependency:s}=t.options;void 0!==i&&i===s||(t.resumeFrom=n,e&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),!1===t.options.crossfade&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}function Fo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Io={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!E.test(t))return t;t=parseFloat(t)}return`${Fo(t,e.target.x)}% ${Fo(t,e.target.y)}%`}},Uo={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=$.parse(t);if(s.length>5)return i;const o=$.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=Y(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}},No={borderRadius:Object.assign({},Io,{applyTo:Ai.slice()}),borderTopLeftRadius:Io,borderTopRightRadius:Io,borderBottomLeftRadius:Io,borderBottomRightRadius:Io,boxShadow:Uo};function Wo(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;(s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `);let a="";if(n){const{transformPerspective:t}=n;t&&(i=`perspective(${t}px) ${i}`);for(let t=0;t<ms.length;t++){const e=ms[t],i=n[e];i&&(a+=`${e}(${i}deg) `),!t&&n.pathRotation&&(a+=`rotate(${n.pathRotation}deg) `)}}if(a){1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),i+=a;const n=t.x.scale*e.x,s=t.y.scale*e.y;1===n&&1===s||(i+=`scale(${n}, ${s})`)}else 1!==t.x.scale||1!==t.y.scale?i+=`scale(${t.x.scale}, ${t.y.scale})`:i||1===e.x&&1===e.y||(i="scale(1, 1)");return i||"none"}function $o(t){return[t("x"),t("y")]}const zo=(t,e)=>t.depth-e.depth;class Ko{constructor(){this.children=[],this.isDirty=!1}add(t){e.addUniqueItem(this.children,t),this.isDirty=!0}remove(t){e.removeItem(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(zo),this.isDirty=!1,this.children.forEach(t)}}const Go={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Yo=["z","skew","skewZ"];let Xo=0;function qo(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}const Ho=t=>t.instance&&mn.get(t.instance)?.demote()&&t.resetSkewAndRotation();function _o(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=mi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",lt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&_o(i)}function Zo(t){if(t)return!1!==t.options.allowProjection?t.projection:Zo(t.parent)}function Jo({attachResizeListener:t,defaultParent:i,measureScroll:s,checkIsScrollRoot:r,resetTransform:a}){return Object.assign($s,{...No,...$s}),class{static create(t,e,n){const{layoutId:i,layout:s,drag:o,dragConstraints:r,layoutScroll:a,layoutRoot:l,layoutAnchor:c,layoutCrossfade:u}=e,h=t.projection=new this(t.latestValues,e["data-framer-portal-id"]?void 0:Zo(t.parent));var d;h.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:Boolean(o)||r&&(d=r,d&&"object"==typeof d&&Object.prototype.hasOwnProperty.call(d,"current")),visualElement:t,animationType:"string"==typeof s?s:"both",initialPromotionConfig:n,crossfade:u,layoutScroll:a,layoutRoot:l,layoutAnchor:c});const p=h.getStack()?.lead;p&&!h.root.isUpdateBlocked()&&(p.willUpdate(),p.scheduleCheckAfterUnmount())}constructor(t={},e=i?.()){this.id=Xo++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(er),this.nodes.forEach(hr),this.nodes.forEach(dr),this.nodes.forEach(nr),Ks.countProjection?.()},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=e?e.root||e:this,this.path=e?[...e.path,e]:[],this.parent=e,this.depth=e?e.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ko)}addEventListener(t,n){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new e.SubscriptionManager),this.eventHandlers.get(t).add(n)}notifyListeners(t,...e){this.eventHandlers.get(t)?.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;this.isSVG=Li(e)&&!Ys(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?.children.add(this),this.root.hasTreeAnimated&&(i||n)&&(this.isLayoutDirty=!0),t){let n,i=0;const s=()=>this.root.updateBlockedByResize=!1;lt.read(()=>{i=window.innerWidth}),t(e,()=>{const t=window.innerWidth;t!==i&&(i=t,this.root.updateBlockedByResize=!0,n?.(),n=Gs(s,250),Go.hasAnimatedSinceResize&&(Go.hasAnimatedSinceResize=!1,this.nodes.forEach(ur)))})}n&&this.root.registerSharedNode(n,this),this.addLayoutListener()}addLayoutListener(){const{layoutId:t,layout:e,visualElement:n,animate:i}=this.options;this.instance&&!this.hasLayoutListener&&!1!==i&&n&&(t||e)&&(this.hasLayoutListener=!0,this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:i,layout:s})=>{if(this.isAnimationBlocked)return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||n.getDefaultTransition()||vr,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=n.getProps(),l=!this.targetLayout||!jo(this.targetLayout,s),c=!e&&i;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...$n(o,"layout"),onPlay:r,onComplete:a};(n.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c,e.path)}else e||ur(this),this.isLead()&&this.options.onExitComplete?.();this.targetLayout=s}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),this.getStack()?.remove(this),this.parent?.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),this.hasLayoutListener=!1,ct(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes?.forEach(pr),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void this.options.onExitComplete?.();if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_o(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;Ho(this),this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,Ho(e),"string"!=typeof e.latestValues.x&&"string"!=typeof e.latestValues.y||(e.isLayoutDirty=!0),e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1),e.isAnimationBlocked&&(e.dragSnapshot||(e.dragSnapshot=e.measure()),this.dragAncestor=e)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked()){const t=this.updateBlockedByResize;return this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),t&&this.nodes.forEach(or),void this.nodes.forEach(sr)}if(this.animationId<=this.animationCommitId)return void this.nodes.forEach(rr);this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(ar),this.nodes.forEach(lr),this.nodes.forEach(cr),this.nodes.forEach(Qo),this.nodes.forEach(tr)):this.nodes.forEach(rr),this.clearAllSnapshots();const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ut.update.process(n),ut.preRender.process(n),ut.render.process(n),n.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Us.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ir),this.sharedNodes.forEach((t,e)=>t.members.length?t.removeLeadSnapshot():this.sharedNodes.delete(e))}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||oo(this.snapshot.measuredBox.x)||oo(this.snapshot.measuredBox.y)||(this.snapshot=void 0),this.snapshot)){const{visualElement:t}=this.options,e="running"===this.currentAnimation?.state,n=e&&this.animationEdges;e&&this.relativeTarget&&(this.snapshot.relativeVelocity=this.relativeVelocity?.slice()||[]);const i=n&&this.motionValue?.getVelocity()||0,s=[0,1,2,3,4,5].map(e=>(e<4?n&&(this.edgeValues?this.edgeVelocity(e):-n[e]*i/1e3):t?.getValue(e<5?"x":"y")?.getVelocity())||0);s.some(Boolean)&&(this.snapshot.velocity=s)}}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected||(this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}}),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e?.notify("LayoutMeasure",this.layout.layoutBox,t?.layoutBox)}updateScroll(t="measure"){const{scroll:e,instance:n}=this,{animationId:i}=this.root;if(this.options.layoutScroll&&n&&(!e||e.animationId!==i||e.phase!==t)){const o=r(n);this.scroll={animationId:i,phase:t,isRoot:o,offset:s(n),wasRoot:e?e.isRoot:o}}}resetTransform(){if(!a)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout;t&&Ho(this);const e=this.projectionDelta&&!Do(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,s=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||fs(this.latestValues)||s)&&(a(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);return t&&(n=this.removeTransform(n)),bo(n),{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(Tr))){const{scroll:t}=this.root;t&&(As(e.x,t.offset.x),As(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(io(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&&io(e,t),As(e.x,s.offset.x),As(e.y,s.offset.y))}return e}applyTransform(t,e=!1,n,i,s=0){const o=n||{x:{min:0,max:0},y:{min:0,max:0}};io(o,t);for(let t=s;t<this.path.length;t++){const n=this.path[t];!e&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(As(o.x,-n.scroll.offset.x),As(o.y,-n.scroll.offset.y)),fs(n.latestValues)&&Ds(o,n.latestValues,n.layout?.layoutBox)}return!i&&fs(this.latestValues)&&Ds(o,this.latestValues,this.layout?.layoutBox),o}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};io(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!fs(n.latestValues))continue;let i;n.instance&&(ps(n.latestValues)&&n.updateSnapshot(),i=Eo(),io(i,n.measurePageBox())),xo(e,n.latestValues,n.snapshot?.layoutBox,i)}return fs(this.latestValues)&&xo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade},this.addLayoutListener()}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==n.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 i=Boolean(this.resumingFrom)||this!==e;if(!(t||i&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:o}=this.options;if(!this.layout||!s&&!o)return;this.resolvedRelativeTargetAt=n.timestamp;const r=this.getClosestProjectingParent();this.targetDelta||this.relativeTarget||(!1!==this.options.layoutAnchor&&r&&r.layout?this.createRelativeTarget(r,this.layout.layoutBox,r.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(),uo(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,!0):io(this.target,this.layout.layoutBox),Ss(this.target,this.targetDelta)):io(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,!1!==this.options.layoutAnchor&&r&&(!r.resumingFrom==!this.resumingFrom||r.options.layoutRoot&&!r.resumingFrom)&&!r.options.layoutScroll&&r.target&&1!==this.animationProgress?this.createRelativeTarget(r,this.target,r.target):this.relativeParent=this.relativeTarget=void 0),Ks.countProjection?.(1))}getClosestProjectingParent(){if(this.parent&&!ps(this.parent.latestValues)&&!ys(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(t,e,n){this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},po(this.relativeTargetOrigin,e,n,this.options.layoutAnchor||void 0),io(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let i=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(i=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(i=!1),this.resolvedRelativeTargetAt===n.timestamp&&(i=!1),i)return;const{layout:s,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent?.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!o)return;io(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,a=this.treeScale.y;Ms(this.layoutCorrected,this.treeScale,this.path,e&&(!(t.relativeTarget&&!t.relativeParent.resumingFrom)||t.relativeParent)),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(so(this.prevProjectionDelta.x,this.projectionDelta.x),so(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),lo(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===r&&this.treeScale.y===a&&Bo(this.projectionDelta.x,this.prevProjectionDelta.x)&&Bo(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Ks.countProjection?.(2)):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){this.options.visualElement?.scheduleRender(),t&&this.getStack()?.scheduleRender(),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1,n){const i=this.snapshot,s=i?i.latestValues:{},r={...this.latestValues},a={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 l={x:{min:0,max:0},y:{min:0,max:0}},c=i?.source!==this.layout?.source,u=this.getStack(),h=!u||u.members.length<=1,d=Boolean(c&&!h&&!0===this.options.crossfade&&!this.path.some(yr));let p;this.animationProgress=0;const m=n?.interpolateProjection(t),f=this.layout?.layoutBox;let g=f&&[f.x.min,f.x.max,f.y.min,f.y.max].map((e,n)=>{const{translate:i,scale:s,originPoint:o}=t[n<2?"x":"y"];return(e-o)*(s-1)+i});g?.every(isFinite)||(g=void 0),this.animationEdges=g,this.edgeValues=this.startVelocity=this.impulse=this.relativeVelocity=this.relativeStart=void 0;const y=i?.velocity,v=i?.relativeVelocity||y;if(v?.slice(0,4).some(Boolean)&&this.getClosestProjectingParent()&&(this.relativeStart=v),y&&g){const e=y.slice(0,4).map((t,e)=>t+(c?y[4+(e>>1)]:0));e.some(Boolean)&&(this.startVelocity=m?((t,e,{x:n,y:i})=>{const s=t*t+e*e;return s<1?0:-1e3*(n*t+i*e)/s})(t.x.translate,t.y.translate,{x:(e[0]+e[1])/2,y:(e[2]+e[3])/2}):e)}this.mixTargetDelta=e=>{const n=e/1e3,i=m?.(n),u=this.edgeValues;for(let e=0;e<2;e++){const i=e?"y":"x";u?mr(a[i],t[i],this.layout.layoutBox[i],u[2*e],u[2*e+1]):fr(a[i],t[i],n)}if(i&&(a.x.translate=i.x,a.y.translate=i.y),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){po(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0);const t=this.relativeTargetOrigin,e=l;if(function(t,e,n,i){gr(t.x,e.x,n.x,i),gr(t.y,e.y,n.y,i)}(this.relativeTarget,t,e,n),this.isSpringLayout){const t=this.relativeTarget,e=this.impulse||0,n=this.relativeStart,i=o.now(),s=(i-this.relativeTime)/1e3;this.relativeTime=i;const r=this.relativeVelocity||(this.relativeVelocity=[0,0,0,0]);for(let i=0;i<4;i++){const o=i<2?"x":"y",a=1&i?"max":"min";n&&(t[o][a]+=n[i]*e),p&&s>0&&(r[i]=(t[o][a]-p[o][a])/s)}}p&&Co(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||(p={x:{min:0,max:0},y:{min:0,max:0}}),io(p,this.relativeTarget)}c&&(this.animationValues=r,Zs(r,s,this.latestValues,n,d,h)),void 0!==i?.rotate&&(this.animationValues||(this.animationValues=r),this.animationValues.pathRotation=i.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart");const n=this.isSpringLayout="spring"===t.type;this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.resumingFrom&&(this.resumingFrom.edgeValues=void 0),this.pendingAnimation&&(ct(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{Go.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Nn(0)),this.motionValue.jump(0,!1);const i=this.startVelocity;this.startVelocity=void 0;let s=t,o=0;if(n){if("auto"===t.mass){const n=this.layout?.layoutBox;s=((t,n=300)=>{const i=e.clamp(.25,2,n/300),{stiffness:s,damping:o}=Pt({...t,duration:t.duration&&e.secondsToMilliseconds(t.duration)});return{...t,stiffness:s,damping:o*Math.sqrt(i),mass:i}})(t,n&&Math.sqrt(oo(n.x)*oo(n.y)))}const n=this.relativeStart;if((i||n)&&!t.repeat)if("number"==typeof i)o=i;else{const t=i&&this.animationEdges;s={...s,type:e=>{const s=[e.velocity,...i||[]].map((n,i)=>At({...e,keyframes:i?[t[i-1],0]:e.keyframes,velocity:n})),o=s.length;n&&s.push(At({...e,keyframes:[0,0],velocity:1e3,restDelta:.5,restSpeed:5}));let r=0;const a=[],l={calculatedDuration:null,next:e=>{r=e;const n=s[0].next(e);let i=n.done;for(let t=1;t<s.length;t++){const{value:n,done:r}=s[t].next(e);t<o?a[t-1]=n:this.impulse=n/1e3,i=i&&r}return t&&(this.edgeValues=a),n.done=i,n}};return l.calculatedDuration=mt(l),l.next(0),this.edgeVelocity=t=>s[t+1].velocity(r),l}}}}const r=Ws(this.motionValue,[0,1e3],{...s,velocity:o,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}});this.currentAnimation=r,function(t,e){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...Ut("layout-animation-start",t),node:e})}catch{}}(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=this.edgeValues=this.edgeVelocity=this.impulse=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.edgeValues=this.impulse=void 0,this.mixTargetDelta?.(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead(),{targetWithTransforms:e,layout:n,latestValues:i}=t;let{target:s}=t;if(e&&s&&n){if(this!==t&&this.layout&&n&&wr(this.options.animationType,this.layout.layoutBox,n.layoutBox)){const{layoutBox:t}=this.layout,e=s;s=this.target||{x:{min:0,max:0},y:{min:0,max:0}},xr(s.x,e.x,t.x),xr(s.y,e.y,t.y)}io(e,s),Ds(e,i),lo(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Oo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?.transition,preserveFollowOpacity:n?.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){this.getStack()?.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){return this.getStack()?.relegate(this)||!1}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;const{latestValues:e}=t;if(!gs(e))return;const n={};for(let e=0;e<Yo.length;e++)qo(Yo[e],t,n,this.animationValues);for(let e=0;e<ms.length;e++)qo(ms[e],t,n,this.animationValues);t.render();for(const e in n)t.setStaticValue(e,n[e]),this.animationValues&&(this.animationValues[e]=n[e]);t.scheduleRender()}applyProjectionStyles(t,e){if(!this.instance||this.isSVG)return;const n=this.getLead();if(!this.isVisible&&n!==this)return void(t.visibility="hidden");const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,t.visibility="",t.opacity="",t.pointerEvents=Xs(e?.pointerEvents)||"",void(t.transform=i?i(this.latestValues,""):"none");if(!this.projectionDelta||!this.layout||!n.target)return(this.options.layoutId||this.needsShow)&&(this.needsShow=!1,t.visibility="",t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Xs(e?.pointerEvents)||""),void(this.hasProjected&&!fs(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1));t.visibility="";const s=n.animationValues||n.latestValues;this.applyTransformsToTarget();let o=Wo(this.projectionDeltaWithTransform,this.treeScale,s);i&&(o=i(s,o)),t.transform=o;const{x:r,y:a}=this.projectionDelta;t.transformOrigin=`${100*r.origin}% ${100*a.origin}% 0`,n.animationValues?t.opacity=n===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:t.opacity=n===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in $s){if(void 0===s[e])continue;const{correct:i,applyTo:r,isCSSVariable:a}=$s[e],l="none"===o?s[e]:i(s[e],n);if(r){const e=r.length;for(let n=0;n<e;n++)t[r[n]]=l}else a?this.options.visualElement.renderState.vars[e]=l:t[e]=l}this.options.layoutId&&(t.pointerEvents=n===this?Xs(e?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=this.dragSnapshot=this.dragAncestor=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(sr),this.root.sharedNodes.clear()}}}function Qo(t){t.updateLayout(),function(t){const{snapshot:e,dragAncestor:n}=t,i=n?.isAnimationBlocked&&n.layout;if(!e||!i||t.resumeFrom||t.isAnimationBlocked)return;const s=n.dragSnapshot;$o(t=>As(e.layoutBox[t],i.layoutBox[t].min-s.layoutBox[t].min))}(t)}function tr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source,r=(i,o)=>{if("size"===s)$o(t=>{const e=oo(i[t]);i[t].min=o[t].min,i[t].max=i[t].min+e});else if("x"===s||"y"===s){const t="x"===s?"y":"x";no(i[t],o[t])}else wr(s,e.layoutBox,n)&&$o(e=>{const n=oo(o[e]);i[e].max=i[e].min+n,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[e].max=t.relativeTarget[e].min+n)})},a=o?e.measuredBox:e.layoutBox;r(a,n);const l={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};lo(l,n,e.layoutBox);const c={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};lo(c,o?t.applyTransform(i,!0):n,a);const u=!Do(l);let h=!1;const d=t.getClosestProjectingParent();if((!o||d?.options.layoutRoot&&t.resumeFrom?.path.includes(d))&&d&&!d.resumeFrom){const{snapshot:i,layout:s}=d;if(i&&s){const a=t.options.layoutAnchor||void 0,l={x:{min:0,max:0},y:{min:0,max:0}};po(l,o?t.resumeFrom.applyTransform(e.layoutBox,!0,void 0,!0,d.depth+1):e.layoutBox,i.layoutBox,a);const c={x:{min:0,max:0},y:{min:0,max:0}};po(c,n,s.layoutBox,a),o&&r(l,c),jo(l,c)||(h=!0),d.options.layoutRoot&&(t.relativeTarget=c,t.relativeTargetOrigin=l,t.relativeParent=d)}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:h})}else t.isLead()&&t.options.onExitComplete?.();t.options.transition=void 0}function er(t){Ks.countProjection?.(0),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 nr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ir(t){t.clearSnapshot()}function sr(t){t.clearMeasurements()}function or(t){t.isLayoutDirty=!0,t.updateLayout()}function rr(t){t.isLayoutDirty=!1}function ar(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.dragSnapshot||t.layout,t.isLayoutDirty=!0)}function lr(t){t.relativeTarget&&t.relativeParent?.isLayoutDirty&&(t.currentAnimation?t.isLayoutDirty=!0:(t.targetDelta=void 0,t.removeRelativeTarget()))}function cr(t){const{visualElement:e}=t.options;e?.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ur(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function hr(t){t.resolveTargetDelta()}function dr(t){t.calcProjection()}function pr(t){t.resetSkewAndRotation()}function mr(t,e,n,i,s){const o=n.max-n.min,r=o?Math.max(0,(o+s-i)/o):1,a=t.originPoint=e.originPoint;t.origin=e.origin,t.scale=r,t.translate=n.min+i-(a+(n.min-a)*r)}function fr(t,e,n){t.translate=Y(e.translate,0,n),t.scale=Y(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function gr(t,e,n,i){t.min=Y(e.min,n.min,i),t.max=Y(e.max,n.max,i)}function yr(t){return void 0!==t.animationValues?.opacityExit}const vr={duration:.45,ease:[.4,0,.1,1]};function xr(t,e,n){t.max=oo(n)+(t.min=e.min)}function wr(t,e,n){return"position"===t||"preserve-aspect"===t&&!ro(Lo(e),Lo(n),.2)}function Tr(t){return t!==t.root&&t.scroll?.wasRoot}function Sr(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}const br=Jo({attachResizeListener:(t,e)=>Sr(t,"resize",e),measureScroll:Rs,checkIsScrollRoot:()=>!0}),Pr={current:void 0},Mr=Jo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Pr.current){const t=new br({});t.mount(window),t.setOptions({layoutScroll:!0}),Pr.current=t}return Pr.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),Ar=new WeakMap;function Er(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Vr(t){return"string"==typeof t||Array.isArray(t)}const Dr=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","whilePinch","exit"],kr=["initial"].concat(Dr);function Cr(t){if(Er(t.animate))return!0;for(let e=0;e<kr.length;e++)if(Vr(t[kr[e]]))return!0;return!1}function Rr(t){return Boolean(Cr(t)||t.variants)}function jr(t,e,n){for(const i in e){const s=e[i],o=n[i];if(ui(s))t.addValue(i,s);else if(ui(o))t.addValue(i,Nn(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,Nn(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}const Lr={current:null},Br={current:!1},Or="undefined"!=typeof window;function Fr(){if(Br.current=!0,Or)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Lr.current=t.matches;t.addEventListener("change",e),e()}else Lr.current=!1}const Ir=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ur={};class Nr{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:r,visualState:a},l={}){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=Le,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=o.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,lt.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=e.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Cr(e),this.isVariantNode=Rr(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==c[t]&&ui(e)&&e.set(c[t])}}mount(t){const e=this.presenceContext;if(this.hasBeenMounted&&!1!==e?.isPresent&&!e?.keepValuesOnRemount)for(const t in this.initialValues)this.values.get(t)?.jump(this.initialValues[t]),this.latestValues[t]=this.initialValues[t];if(this.current=t,Ar.set(t,this),this.projection?.instance||this.projection?.mount(t),this.isVariantNode&&!this.isControllingVariants){let t=this;do{t=!1!==t.props.inherit&&t.parent}while(t&&!t.isVariantNode);if(t){const{variantChildren:e}=t;e.add(this),this.removeFromVariantTree=()=>e.delete(this)}}this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),"never"===this.reducedMotionConfig?this.shouldReduceMotion=!1:"always"===this.reducedMotionConfig?this.shouldReduceMotion=!0:(Br.current||Fr(),this.shouldReduceMotion=Lr.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection?.unmount(),ct(this.notifyUpdate),ct(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree?.(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),(this.enteringChildren||(this.enteringChildren=new Set)).add(t)}removeChild(t){this.children.delete(t),this.enteringChildren?.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.get(t)?.(),n.accelerate&&tn.has(t)&&this.current instanceof HTMLElement){const{factory:i,keyframes:s,times:o,ease:r,duration:a}=n.accelerate,l=new qe({element:this.current,name:t,keyframes:s,times:o,ease:r,duration:e.secondsToMilliseconds(a)}),c=i(l);return void this.valueSubscriptions.set(t,()=>{c(),l.cancel()})}const i=ve.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&<.preRender(this.notifyUpdate),i&&(this.projection&&(this.projection.isTransformDirty=!0),mn.get(this.current)?.check()),this.scheduleRender()});let o;"undefined"!=typeof window&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o?.()})}sortNodePosition(t){return this.current&&t.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Ur){const e=Ur[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){const{transformTemplate:n,onUpdate:i}=this.props;(t.transformTemplate||n)&&this.scheduleRender(),(t.transformTemplate&&!n||t.onUpdate&&!i)&&mn.get(this.current)?.demote(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ir.length;e++){const n=Ir[e];this.propEventSubscriptions[n]?.(),delete this.propEventSubscriptions[n];const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=jr(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue?.()}getProps(){return this.props}getVariant(t){return this.props.variants?.[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}addValue(t,e){const n=this.values.get(t);if(e!==n){n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e);const i=e.get();void 0!==i&&(this.latestValues[t]=i)}}removeValue(t){this.values.delete(t),this.valueSubscriptions.get(t)?.(),this.valueSubscriptions.delete(t),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){let n=this.props.values?.[t];return n||(n=this.values.get(t),void 0===n&&void 0!==e&&(n=Nn(e??this.getDefaultValue?.(t),{owner:this}),this.addValue(t,n)),n)}readValue(t,n){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(e.isNumericalString(i)||e.isZeroValueString(i))?i=parseFloat(i):"number"!=typeof i&&!$.test(i)&&$.test(n)&&(i=oe(t,n)),this.setBaseTarget(t,ui(i)?i.get():i)),ui(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}on(t,n){return(this.events[t]||(this.events[t]=new e.SubscriptionManager)).add(n)}notify(t,...e){this.events[t]?.notify(...e)}scheduleRenderMicrotask(){Us.render(this.render)}}class Wr extends Nr{constructor(){super(...arguments),this.KeyframeResolver=Mi}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;ui(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function $r(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 zr(t,e,n){const i=t.style,s=e?.style,o={};if(!i)return o;for(const e in i)(ui(i[e])||s&&ui(s[e])||zs(e,t)||void 0!==n?.getValue(e)?.liveStyle)&&(o[e]=i[e]);return o}class Kr extends Wr{constructor(){super(...arguments),this.type="html",this.renderInstance=$r}mount(t){super.mount(t)}readValueFromInstance(t,e){if(ve.has(e))return this.projection?.isProjecting?me(e):ge(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(l(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ks(t,e)}build(t,e,n){_i(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return zr(t,e,n)}}function Gr(t){let e=Ar.get(t);return e||(e=new Kr({props:{},presenceContext:null,visualState:{latestValues:{},renderState:{transform:{},transformOrigin:{},style:{},vars:{}}}},{allowProjection:!0}),Fs(t,e)),t.style.transform&&!fs(e.latestValues)&&(t.style.transform=""),e}const Yr={},Xr={updateScroll:()=>{Xr.scroll||(Xr.scroll={offset:Rs()})}},qr=t=>{const n=Gr(t),i=new e.SubscriptionManager,s={instance:t,root:Xr,path:[Xr],setOptions:e.noop,isProjecting:e.noop,applyProjectionStyles:e.noop,removeElementScroll:t=>t,updateLayout:()=>{const e=Cs(t,Xr,n.getTransformPagePoint());bo(e),s.layout={layoutBox:e},i.notify()},addEventListener:(t,n)=>"measure"===t?i.add(n):e.noop,unmount:()=>{s.instance=void 0,n.projection===s&&(n.projection=void 0)}};return n.projection=s,n.current||n.mount(t),[s,s.unmount]},Hr=t=>{const n=Ar.get(t)?.projection;return n?.instance?[n,e.noop]:(Yr.create||qr)(t)},_r="[data-layout],[data-layout-id]",Zr=new WeakMap;let Jr;function Qr(t){const e=[];return t instanceof HTMLElement&&t.matches(_r)&&e.push(t),t.querySelectorAll(_r).forEach(t=>{t instanceof HTMLElement&&e.push(t)}),e}function ta(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 ea(t,e){let n=Zr.get(t);if(n)n.setOptions(ta(t,e));else{const i=Gr(t);n=new Mr(i.latestValues,function(t){let e=t.parentElement;for(;e;){const t=Zr.get(e);if(t?.instance)return t;e=e.parentElement}}(t)),i.projection=n,n.setOptions({...ta(t,e),visualElement:i}),n.mount(t),Zr.set(t,n)}return n.isPresent=!0,n.options.onExitComplete&&n.setOptions({onExitComplete:void 0}),n}function na(t){const e=ea(t);return[e,()=>Zr.get(t)===e&&ia(t,e)]}function ia(t,e){e.setOptions({onExitComplete:void 0});e.getStack()&&!e.isLead()||e.currentAnimation?.stop(),e.unmount(),Zr.delete(t)}function sa(){const t=Jr;if(!t)return;Jr=void 0,function(){if(n.isProcessing)return;const t=o.now();n.delta=e.clamp(0,1e3/60,t-n.timestamp),n.timestamp=t,n.isProcessing=!0,ut.update.process(n),ut.preRender.process(n),ut.render.process(n),n.isProcessing=!1}();const i=new Map;for(const e of t)for(const t of e.collectTargets()){const n=i.get(t);n?n.push(e):i.set(t,[e])}const s=new Map;for(const t of(r=i.keys(),[...r].sort((t,e)=>t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))){const e=i.get(t),n=ea(t,e[e.length-1].transitionFor(t));for(const i of e)i.adopt(t,n);s.set(t,n)}var r;s.forEach(t=>{t.isLayoutDirty=!1,t.willUpdate()});const a=[];for(const e of t){const t=e.runUpdate();t&&a.push(t)}const l=()=>{const e=new Set;for(const n of t)n.reconcileAdditions(e);for(const n of t)n.reconcileRemovals(e);let n;s.forEach(t=>n||(n=t.root));for(const e of t)n||(n=e.getRoot());n?.didUpdate(),Us.render(()=>{for(const e of t)e.finalize()})};a.length?Promise.all(a).then(l):l()}Yr.create=na;const oa=sa;class ra{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}),Jr||(Jr=[],queueMicrotask(sa)),Jr.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 Qr(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 Qr(this.scope)){if(this.tracked.has(e))continue;const n=ea(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?.parentNode===i.parent?i.next:null),e.isPresent=!1,e.setOptions({onExitComplete:()=>{n.remove(),ia(n,e)}}),e.relegate())return;n.remove()}ia(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 jn([...t]))}}function aa(t,e,n){if("function"==typeof t)return{scope:Bi.current?.root||document,updateDom:t,defaultOptions:e};return{scope:t instanceof Document?t:Ui(t)[0]??document,updateDom:e,defaultOptions:n}}const la=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function ca(t){return{point:{x:t.pageX,y:t.pageY}}}const ua=t=>e=>la(e)&&t(e,ca(e));function ha(t,e,n,i){return Sr(t,e,ua(n),i)}const da=new WeakMap;let pa;const ma=(t,e,n)=>(i,s)=>s&&s[0]?s[0][t+"Size"]:Li(i)&&"getBBox"in i?i.getBBox()[e]:i[n],fa=ma("inline","width","offsetWidth"),ga=ma("block","height","offsetHeight");function ya({target:t,borderBoxSize:e}){da.get(t)?.forEach(n=>{n(t,{get width(){return fa(t,e)},get height(){return ga(t,e)}})})}function va(t){t.forEach(ya)}function xa(t,e){pa||"undefined"!=typeof ResizeObserver&&(pa=new ResizeObserver(va));const n=Ui(t);return n.forEach(t=>{let n=da.get(t);n||(n=new Set,da.set(t,n)),n.add(e),pa?.observe(t)}),()=>{n.forEach(t=>{const n=da.get(t);n?.delete(e),n?.size||pa?.unobserve(t)})}}const wa=new Set;let Ta;function Sa(t){return wa.add(t),Ta||(Ta=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};wa.forEach(e=>e(t))},window.addEventListener("resize",Ta)),()=>{wa.delete(t),wa.size||"function"!=typeof Ta||(window.removeEventListener("resize",Ta),Ta=void 0)}}function ba(t,e){return Oi("function"==typeof t?Sa(t):xa(t,e))}const Pa=(t,e)=>Math.abs(t-e);function Ma(t,e){const n=Pa(t.x,e.x),i=Pa(t.y,e.y);return Math.sqrt(n**2+i**2)}const Aa=new Set(["auto","scroll"]);class Ea{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:r=!1,distanceThreshold:a=3,element:l,immediate:c}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.onElementScroll=t=>{this.handleScroll(t.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Da(this.lastRawMoveEventInfo,this.transformPagePoint));const t=Ca(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=Ma(t.offset,{x:0,y:0})>=this.distanceThreshold;if(!e&&!n)return;const{point:i}=t;this.history.push({...i,timestamp:o.now()});const{onStart:s,onMove:r}=this.handlers;e||(s?.(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r?.(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.handleScroll(window),this.lastMoveEvent=t,this.lastRawMoveEventInfo=e,this.lastMoveEventInfo=Da(e,this.transformPagePoint),this.hasPendingMove=!0,lt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(!this.dragSnapToOrigin&&this.startEvent||s?.(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Ca("pointercancel"===t.type?this.lastMoveEventInfo:Da(e,this.transformPagePoint),this.history);this.startEvent&&n?.(t,o),i?.(t,o)},!la(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=c?0:a,this.contextWindow=s||window;const u=ca(t),h=Da(u,this.transformPagePoint),{point:d}=h;this.history=[{...d,timestamp:o.now()}];const{onSessionStart:p}=n;p&&p(t,Ca(h,this.history));const m={passive:!0,capture:!0};this.removeListeners=e.pipe(ha(this.contextWindow,"pointermove",this.handlePointerMove,m),ha(this.contextWindow,"pointerup",this.handlePointerUp,m),ha(this.contextWindow,"pointercancel",this.handlePointerUp,m)),l&&this.startScrollTracking(l),c&&(this.handlePointerMove(t,u),this.updatePoint())}startScrollTracking(t){let n=t.parentElement;for(;n;){const t=getComputedStyle(n);(Aa.has(t.overflowX)||Aa.has(t.overflowY))&&this.scrollPositions.set(n,Va(n)),n=n.parentElement}this.scrollPositions.set(window,Va(window)),this.removeScrollListeners=e.pipe(Sr(window,"scroll",this.onElementScroll,{capture:!0}),Sr(window,"scroll",this.onWindowScroll,{}))}handleScroll(t){const e=this.scrollPositions.get(t);if(!e)return;const n=t===window,i=Va(t),s=i.x-e.x,o=i.y-e.y;0===s&&0===o||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s,this.lastMoveEventInfo.point.y+=o):this.history.length>0&&(this.history[0].x-=s,this.history[0].y-=o),this.scrollPositions.set(t,i),lt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners?.(),this.removeScrollListeners?.(),this.scrollPositions.clear(),ct(this.updatePoint)}}const Va=t=>t===window?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop};function Da(t,e){return e?{point:e(t.point)}:t}function ka(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ca({point:t},e){return{point:t,delta:ka(t,ja(e)),offset:ka(t,Ra(e)),velocity:La(e,.1)}}function Ra(t){return t[0]}function ja(t){return t[t.length-1]}function La(t,n){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null;const o=ja(t);for(;i>=0&&(s=t[i],!(o.timestamp-s.timestamp>e.secondsToMilliseconds(n)));)i--;if(!s)return{x:0,y:0};s===t[0]&&t.length>2&&o.timestamp-s.timestamp>2*e.secondsToMilliseconds(n)&&(s=t[1]);const r=e.millisecondsToSeconds(o.timestamp-s.timestamp);if(0===r)return{x:0,y:0};const a={x:(o.x-s.x)/r,y:(o.y-s.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const Ba=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Oa(t){return Ba.has(t.tagName)||!0===t.isContentEditable}const Fa=new Set(["INPUT","SELECT","TEXTAREA"]);function Ia(t){return Fa.has(t.tagName)||!0===t.isContentEditable}const Ua={x:!1,y:!1};function Na(){return Ua.x||Ua.y}function Wa(t){return"x"===t||"y"===t?Ua[t]?null:(Ua[t]=!0,()=>{Ua[t]=!1}):Ua.x||Ua.y?null:(Ua.x=Ua.y=!0,()=>{Ua.x=Ua.y=!1})}function $a(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?Y(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Y(n,t,i.max):Math.min(t,n)),t}function za(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 Ka(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 Ga=.35;function Ya(t,e,n){return{min:Xa(t,e),max:Xa(t,n)}}function Xa(t,e){return"number"==typeof t?t:t[e]||0}function qa(t){let e="";for(const n of t.path){n.scroll=void 0,n.updateScroll();const{scroll:i}=n;n!==t.root&&i&&(e+=i.offset.x+","+i.offset.y+",")}return e}const Ha=new WeakMap;class _a{constructor(t,e=()=>t.getProps()){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t,this.readProps=e}start(t,e={}){if(!1===this.visualElement.presenceContext?.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new Ea(t,{onSessionStart:t=>{e.snapToCursor&&this.snapToCursor(t),this.stopAnimation()},onStart:(t,e)=>{const{drag:n,dragConstraints:i,dragPropagation:s,onDragStart:o}=this.getProps();if(n&&!s&&(this.openDragLock?.(),this.openDragLock=Wa(n),!this.openDragLock))return;this.latestPointerEvent=t,this.latestPanInfo=e,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints();const{projection:r}=this.visualElement;r&&(r.isAnimationBlocked=!0,r.target=void 0),$o(t=>{let e=this.getAxisMotionValue(t).get()||0;if(u(e)&&(e=ei(e,this.visualElement.current)||0),E.test(e))e=parseFloat(e);else if(A.test(e)){const n=r?.layout?.layoutBox[t];n&&(e=oo(n)*(parseFloat(e)/100))}this.originPoint[t]=e}),this.point="function"==typeof i&&i(this),o&<.update(()=>o(t,e),!1,!0),di(this.visualElement,"transform"),this.visualElement.animationState?.setActive("whileDrag",!0)},onMove:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e;const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection){if(this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),null===this.currentDirection)return;s&&s(this.currentDirection)}this.updateAxis("x",r),this.updateAxis("y",r),this.point&&this.point.move(),this.visualElement.render(),o&<.update(()=>o(t,e),!1,!0)},onSessionEnd:(t,e)=>{this.latestPointerEvent=t,this.latestPanInfo=e,this.stop(t,e),this.latestPointerEvent=null,this.latestPanInfo=null},resumeAnimation:()=>{const{dragSnapToOrigin:t}=this.getProps();(t||this.constraints||this.point)&&this.startAnimation({x:0,y:0})}},{...e,transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:this.visualElement.current?.ownerDocument.defaultView,element:this.visualElement.current})}stop(t,e,n){const i=t||this.latestPointerEvent,s=e||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r,n);const{onDragEnd:a}=this.getProps();a&<.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession(),!this.getProps().dragPropagation&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e?.setActive("whileDrag",!1)}endPanSession(){this.panSession?.end(),this.panSession=void 0}updateAxis(t,e){const{drag:n}=this.readProps();if(!e||!tl(t,n,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+e[t];const o=this.constraints&&this.constraints[t];o&&(s=$a(s,o,this.elastic[t])),this.point?this.point[t]=s:i.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{projection:n}=this.visualElement,i=n&&(n.layout||n.measure(!1)),s=this.constraints;Za(t)?this.constraints&&this.scroll===qa(n)||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!i||"object"!=typeof t)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:za(t.x,n,s),y:za(t.y,e,i)}}(i.layoutBox,t),this.elastic=function(t=Ga){return!1===t?t=0:!0===t&&(t=Ga),{x:Ya(t,"left","right"),y:Ya(t,"top","bottom")}}(e),s!==this.constraints&&!Za(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&$o(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!Za(t))return!1;const n=Ja(t),{projection:i}=this.visualElement;if(!i||!i.layout)return!1;this.scroll=qa(i);const s=Cs(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Ka(t.x,e.x),y:Ka(t.y,e.y)}}(i.layout.layoutBox,i.removeElementScroll(s));if(e){const t=e(us(o));this.hasMutatedConstraints=!!t,t&&(o=cs(t))}return o}startAnimation(t,e){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l={bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o},c=s=>!i||this.point&&r||!tl(s,e||n,this.currentDirection)?0:t[s];if(this.point&&!r)return this.point.release({x:c("x"),y:c("y")},l).then(a);const u=this.constraints||{},h=$o(t=>{if(!tl(t,e||n,this.currentDirection))return;let i=u[t]||{};!0!==r&&r!==t||(i={min:0,max:0});const s={type:"inertia",velocity:c(t),...l,...i};return this.startAxisValueAnimation(t,s)});return Promise.all(h).then(a)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return di(this.visualElement,t),n.start(Hn(t,n,0,e,this.visualElement,!1))}stopAnimation(){$o(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.readProps()[e];return n||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor({clientX:t,clientY:e}){const{drag:n}=this.getProps(),i={x:t,y:e},s=this.visualElement.getTransformPagePoint()?.(i)||i,o=this.visualElement.measureViewportBox();$o(t=>{if(!tl(t,n,this.currentDirection))return;const e=this.getAxisMotionValue(t),{min:i,max:r}=o[t];e.set((e.get()||0)+s[t]-Y(i,r,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Za(n)||!i||!this.constraints)return;this.stopAnimation();const s=this.constraints,o={x:0,y:0};$o(t=>{const n=this.getAxisMotionValue(t).get();o[t]=function(t,n){let i=.5;const s=oo(t),o=oo(n);return o>s?i=e.progress(n.min,n.max-s,t.min):s>o&&(i=e.progress(t.min,t.max-o,n.min)),e.clamp(0,1,i)}({min:n,max:n},s[t])});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",i.root?.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),$o(e=>{const n=this.getAxisMotionValue(e);if(!tl(e,t,null)||!n.get())return;const{min:i,max:s}=this.constraints[e];n.set(Y(i,s,o[e]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Ha.set(this.visualElement,this);const t=this.visualElement.current,e=ha(t,"pointerdown",e=>{const{drag:n,dragListener:i=!0}=this.getProps(),s=e.target,o=s!==t&&Ia(s);n&&i&&!o&&this.start(e)});let n;const i=()=>{const{dragConstraints:e}=this.getProps(),i=Za(e)&&Ja(e);i&&(this.constraints=this.resolveRefConstraints(),n||(n=function(t,e,n){const i=ba(t,Qa(n)),s=ba(e,Qa(n));return()=>{i(),s()}}(t,i,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s.layout||(s.root?.updateScroll(),s.updateLayout()),lt.read(i);const r=Sr(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&($o(e=>{if(!tl(e,this.getProps().drag,this.currentDirection))return;const n=this.getAxisMotionValue(e);this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate)}),this.visualElement.render())});return()=>{r(),e(),o(),a(),n?.()}}getProps(){const t=this.readProps(),{dragElastic:e=Ga,dragMomentum:n=!0}=t;return{...t,dragElastic:e,dragMomentum:n}}}function Za(t){return!!t&&"object"==typeof t&&("current"in t||"nodeType"in t)}const Ja=t=>"current"in t?t.current:t;function Qa(t){let e=!0;return()=>{e?e=!1:t()}}function tl(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const el=["user-select","-webkit-user-select","-webkit-touch-callout","touch-action"];function nl(t,e){const n=Ui(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},Oi(()=>i.abort())]}const il=(t,e)=>{const n=t.get();"string"==typeof n&&t.set(parseFloat(n)*(n.endsWith("%")?e/100:1))},sl=t=>"object"==typeof t?t:{},ol=(t=Ga)=>{const e=t=>!0===t?Ga:+(t||0);return"object"==typeof t?{min:e(t.min),max:e(t.max)}:{min:e(t),max:e(t)}},rl=({pan:t,origin:e})=>!1!==t||!!e,al=(t,{min:n=-1/0,max:i=1/0})=>e.clamp(n,i,t),ll=(t,e,n)=>{const i=al(t,sl(e)),s=n[t<i?"min":"max"];return s?i+(t-i)/s:t};function cl(t,n,i,s){const r=new Map,a={x:0,y:0,l:0,a:0},l={...a},c={...a};let u,h,d,p,m=0,f=0,g=0,y=0,v=0,x=0,w=!1,T=0,S={},b=1,P=0,M=()=>{},A={};const E=()=>A=i()||A,V=()=>({point:{x:a.x,y:a.y},offset:{x:a.x-l.x,y:a.y-l.y},scale:Math.exp(a.l-l.l),rotate:a.a-l.a}),D=()=>{const e=t.getBoundingClientRect(),{left:i,top:s}=e,{scale:o,rotate:r,elastic:a}=E(),[l,c,u,h]=d=n(),p=ol(a);!1!==o&&l.stop(),!1!==r&&c.stop(),b=ll(l.get(),o,p),P=ll(c.get(),r,p),g=t.offsetWidth??e.width,y=t.offsetHeight??e.height,rl(A)&&(u.stop(),h.stop(),il(u,g),il(h,y)),v=u.get(),x=h.get(),m=i+e.width/2-v,f=s+e.height/2-x},k=(t,e,n,i,s)=>{const{origin:o}=A;if("object"!=typeof o)return t;const r=n*Math.PI/180,a=(o.x-.5)*g*e,l=(o.y-.5)*y*e;return{x:m+i+Math.cos(r)*a-Math.sin(r)*l,y:f+s+Math.sin(r)*a+Math.cos(r)*l}},C=()=>Ha.get(Ar.get(t)),R=()=>{const{scale:t,rotate:e,snapToOrigin:n,transition:i}=A,[s,r,l,c]=d,u=s.get(),h=r.get(),p=l.get(),g=c.get(),{snap:y}=sl(e);let v=al(u,sl(t)),x=al(y?Math.round((h+.2*r.getVelocity())/y)*y:h,sl(e));n&&(v=1,x=360*Math.round(h/360));const w=rl(A)&&!C()?.isDragging,T=k(a,u,h,p,g),S=m+p-T.x,b=f+g-T.y;if(!u||v===u&&x===h&&(!n||!w||!p&&!g))return;const P=At({keyframes:[0,1],stiffness:200,damping:40,...i}),E=o.now(),V=()=>{const{value:i,done:a}=P.next(o.now()-E);a&&M();const[d,m,f,y]=(t=>{const e=Y(u,v,t),n=Y(h,x,t),i=(n-h)*Math.PI/180,s=Math.cos(i)*e/u,o=Math.sin(i)*e/u;return[e,n,p+s*S-o*b-S,g+o*S+s*b-b]})(i);!1!==t&&s.set(d),!1!==e&&r.set(m),w&&!C()?.isDragging&&(l.set(n?Y(p,0,i):f),c.set(n?Y(g,0,i):y))};M=()=>ct(V),lt.update(V,!0)},j=()=>{if(!d||!w)return;w=!1;const{rotate:t,scale:n,pan:i,elastic:s}=E(),[o,r,l,u]=d,p=ol(s),g=o.get(),y=C(),T=y?.isDragging;T||(v=l.get(),x=u.get());const M=k(c,g,r.get(),v,x);let D=0,R=1;const j=(t,e)=>{const n=sl(e),i=al(t,n);return p[t<i?"min":"max"]?[$a(t,n,p),t]:[i,i]};if(!1!==n&&g){const[t,i]=j(e.clamp(1e-9,1e9,b*Math.exp(a.l-c.l)),n);b=i,R=t/g,o.set(t)}if(!1!==t){const[e,n]=j(P+a.a-c.a,t);P=n,D=e-r.get(),D&&r.set(e)}if(rl(A)){l.stop(),u.stop();const t=D*Math.PI/180,e=Math.cos(t)*R,n=Math.sin(t)*R,s=M.x-m-v,o=M.y-f-x,r=!1!==i?a.x-c.x:0,h=!1!==i?a.y-c.y:0;if(v+=s+r-(e*s-n*o),x+=o+h-(n*s+e*o),T){const t=y.panSession.history;t.splice(0,t.length-1),t[0].timestamp=-1/0,y.originPoint.x=v,y.originPoint.y=x}l.set(v),u.set(x)}Object.assign(c,a),S.onPinch?.(h,V())},L=()=>{if(!i())return O(h);j(),"wheel"===u&&o.now()-T>150&&O(h)},B=(e,n)=>{if(!i())return;M(),u=n,h=e,w=!1,d=void 0,S={},Object.assign(l,a),Object.assign(c,a),lt.read(D),lt.preRender(L,!0);const o=s(t,e,V());S="function"==typeof o?{onComplete:o}:o||{}},O=t=>{u&&(ct(D),ct(L),i()&&(j(),d&&R()),u=void 0,S.onComplete?.(t,V()))},F=t=>{h=t,w=!0},I=()=>{const[t,e]=r.values(),n=180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI-a.a;a.x=(t.x+e.x)/2,a.y=(t.y+e.y)/2,a.l=Math.log(Math.hypot(e.x-t.x,e.y-t.y)||1),a.a+=n-360*Math.round(n/360)},U=t=>r.set(t.pointerId,{x:t.clientX,y:t.clientY}),N=t=>{r.has(t.pointerId)&&(U(t),"pointer"===u&&(I(),F(t)))},W=t=>{r.delete(t.pointerId)&&("pointer"===u&&O(t),r.size||(K(),z()))},$=e=>{u||r.size>1||r.has(e.pointerId)||"mouse"===e.pointerType||(r.size||K(!0),U(e),2===r.size&&(I(),B(e,"pointer"),!u||p||Ha.get(Ar.get(t))||(p=Wa(!0))))},z=()=>{const t=p;p=void 0,t&<.postRender(t)},K=t=>{const e=t?"addEventListener":"removeEventListener";window[e]("pointerdown",$),window[e]("pointermove",N),window[e]("pointerup",W),window[e]("pointercancel",W)},G=t=>{if(!(r.size||u&&"gesture"!==u)){const{scale:e,rotation:n,clientX:i,clientY:s}=t;a.x=i,a.y=s,a.l=Math.log(e),a.a=n,u?(F(t),"gestureend"===t.type&&O(t)):"gesturestart"===t.type&&B(t,"gesture")}u&&t.preventDefault()},X={pointerdown:$,wheel:t=>{!t.ctrlKey||u&&"wheel"!==u||(a.x=t.clientX,a.y=t.clientY,(u||(a.l=0,B(t,"wheel"),u))&&(t.preventDefault(),a.l-=e.clamp(-50,50,t.deltaY*(t.deltaMode?16:1))/100,T=o.now(),F(t)))},gesturestart:G,gesturechange:G,gestureend:G};for(const e in X)t.addEventListener(e,X[e],{passive:!1});return()=>{for(const e in X)t.removeEventListener(e,X[e]);K(),O(h),M(),r.clear(),z()}}const ul=["scale","rotate","x","y"];const hl=(t,e)=>!!e&&(t===e||hl(t,e.parentElement)),dl=new WeakSet;function pl(t){return e=>{"Enter"===e.key&&t(e)}}function ml(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const fl=new WeakSet,gl=(t,e,n)=>Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)>n,yl=t=>t.preventDefault();const vl={reducedMotion:"(prefers-reduced-motion: reduce)",motion:"(prefers-reduced-motion: no-preference)",dark:"(prefers-color-scheme: dark)",light:"(prefers-color-scheme: light)",hover:"(hover: hover) and (pointer: fine)",touch:"(pointer: coarse)",portrait:"(orientation: portrait)",landscape:"(orientation: landscape)"};function xl(t){return t.includes("(")?t:t.replace(/([<>!]=?)\s+/g,"$1").trim().split(/\s+/).map(t=>{const e="!"===t[0];e&&(t=t.slice(1));const n=/^([<>]=?)([\d.]+)([a-z]*)$/.exec(t),i=n?`(width ${n[1]} ${n[2]}${n[3]||"px"})`:vl[t]||t;return e?`(not (${i}))`:i}).join(" and ")}const wl=["nodes","calculatedTargetDeltas","calculatedProjections"];function Tl(...t){const e=!Array.isArray(t[0]),n=e?0:-1,i=t[0+n],s=Vt(t[1+n],t[2+n],t[3+n]);return e?s(i):s}const Sl=new Set,bl=({timestamp:t})=>{Sl.forEach(e=>e.tick(t))};class Pl extends Wt{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,this.factory=t.type,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():(Sl.size||lt.update(bl,!0),Sl.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;this.started||(this.startTime=It(this.startTime,t));const 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 Lt(this.generator,this.currentTime,this.options.velocity)}now(){return this.driver?this.driver.now():o.now()}teardown(){this.state="idle",this.driver?this.driver.stop():(Sl.delete(this),Sl.size||ct(bl))}}function Ml(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=qs(e);if("running"===o?.state)return void o.setTarget(r,n.velocity);const u=qs(t.get()),h=o?o.getGeneratorVelocity():t.getVelocity();if(c(),u===r)return;const d={keyframes:[u,r],velocity:h,restDelta:.001,restSpeed:.01,...n,onUpdate:a},p=o=new Pl({...d,onPlay:l});t.animation=p,p.then(()=>{o===p&&(o=null,t.animation=void 0,t.events.animationComplete?.notify())})},c),ui(e)){let i=!0===n.skipInitialAnimation;const s=e=>{i?(i=!1,t.jump(Al(e,r),!1)):t.set(Al(e,r))},o=e.on("change",s),a=e.get();qs(a)-qs(t.get())&&s(a);const l=t.on("destroy",o);return()=>{o(),l(),c()}}return c}function Al(t,e){return e?t+e:t}function El(t,e,n={}){const i={type:"spring",...n};return Ft(i),i.type=i.type||jt,Ml(t,e,i)}function Vl(t){const e=[];In.current=e;const n=t();In.current=void 0;const i=Nn(n);return function(t,e,n){const i=()=>e.set(n()),s=()=>lt.preRender(i,!1,!0),o=t.map(t=>t.on("change",s));e.on("destroy",()=>{o.forEach(t=>t()),ct(i)})}(e,i,t),i}function Dl(t,e,n){return Ml(t,e,{...n,type:At})}const kl=[...Ti,R,$];let Cl=0;const Rl=()=>"motion-view-"+Cl++;function jl(t,e,n){e&&(t.style?.setProperty("view-transition-class",e),n.push(t))}function Ll(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 Bl(t,e,n,i,s,o=[],r,a=[],l){const c=Ui(t);if(i)return c.map((t,c)=>{const u=e.get(t);if(u)return u;const h=i[c]??Rl();return t.style?.setProperty("view-transition-name",h),n.push(t),e.set(t,h),jl(t,s,o),Ll(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=Rl(),t.style?.setProperty("view-transition-name",d),n.push(t)),e.set(t,d),jl(t,s,o),Ll(t,d,r,a,l),d})}function Ol(t){return"layout"===t?"group":"enter"===t||"new"===t?"new":"old"}let Fl={},Il=null;const Ul=(t,e)=>{Fl[t]=e},Nl=()=>{Il||(Il=document.createElement("style"),Il.id="motion-view");let t="";for(const e in Fl){const n=Fl[e];t+=`${e} {\n`;for(const[e,i]of Object.entries(n))t+=` ${e}: ${i};\n`;t+="}\n"}Il.textContent=t,document.head.appendChild(Il),Fl={}},Wl=()=>{Il&&Il.parentElement&&Il.parentElement.removeChild(Il)};function $l(t){const e=t.match(/::view-transition-(old|new|group-children|group|image-pair)\((.*?)\)/);return e?{layer:e[2],type:e[1]}:null}function zl(){return document.getAnimations().filter(t=>{const{effect:e}=t;return!!e&&e.target===document.documentElement&&e.pseudoElement?.startsWith("::view-transition")})}const Kl=["layout","enter","exit","new","old"],Gl=t=>t.split(" ").every(t=>0===parseFloat(t)),Yl={group:["layout"],new:["new","enter"],old:["old","exit"]},Xl={new:{opacity:0,scale:.85},old:{opacity:1,scale:1}};function ql(t){const{update:n,targets:i,resolveDefs:s,cropOverride:o,pairs:r,classNames:a,flatGroups:l,options:c}=t;if(!document.startViewTransition)return(async()=>(await n(),new jn([])))();const u=new Map,h=[],d=[],p=[],m=new Set,f=new Map,g=new Set,y=new Map,v=new Map,x=new Map,w=new Map,T=t=>{i.forEach((e,n)=>{const i=a.get(n),c="root"!==n&&s.has(n)?l.has(n)?"none":"contain":void 0;let g;if("root"!==n&&s.has(n))if(r.has(n))if("old"===t)w.set(n,Ui(n)),g=Bl(n,u,h,void 0,i,d,c,p,m),x.set(n,g);else{for(const t of w.get(n)??[])t.style?.removeProperty("view-transition-name"),u.delete(t);g=Bl(r.get(n),u,h,x.get(n),i,d,c,p,m)}else g=Bl(n,u,h,void 0,i,d,c,p,m);else g=[n];const T=o.get(n);g.forEach((n,i)=>{const s=f.get(n);f.set(n,s&&s!==e?{...s,...e}:e),void 0!==T&&y.set(n,T);const o=v.get(n)??{};o[t]=[i,g.length],v.set(n,o)})})},S=(t,e)=>{const n=v.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=Hl($n(c,n),$n(function(t,e){for(const n of Yl[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},P=t=>{const[n,i]=S(t,"group"),s=b(f.get(t),"group","layout",-1===n?0:n,i);s.duration&&(s.duration=e.secondsToMilliseconds(s.duration));const{delay:o=0,duration:r,ease:a}=Xe(s);return{delay:e.secondsToMilliseconds(o),duration:r,ease:a}},M=new Map,A=t=>u.forEach((e,n)=>{const i=n,s=i.getBoundingClientRect?.();if(s&&s.height){const n=getComputedStyle(i),o={};for(const t of Ai)o[t]=n[t];const r=M.get(e)??{};r[t]={width:s.width,height:s.height,radii:o},M.set(e,r)}}),E=t=>{const e=M.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},V=()=>{(function(t,e){return e.has(t)&&Object.keys(e.get(t)).length>0})("root",i)||Ul(":root",{"view-transition-name":"none"}),Ul("::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*)",{"animation-timing-function":"linear !important"}),g.forEach(t=>{Ul(`::view-transition-group(${t})`,{overflow:"clip"}),Ul(`::view-transition-old(${t}), ::view-transition-new(${t})`,{width:"100%",height:"100%","object-fit":"cover"})}),m.forEach(t=>{Ul(`::view-transition-group-children(${t})`,{overflow:"clip"})}),Nl()},D=()=>{!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")}(h,d,p),Wl()},k=async()=>{await n(),T("new"),A("new"),(()=>{g.clear();for(const t of v.keys())"root"!==t&&(y.get(t)??E(t))&&g.add(t)})(),V()};let C;try{T("old"),A("old"),V(),C=document.startViewTransition(k)}catch(t){return D(),Promise.reject(t)}return C.finished.finally(D),new Promise((t,n)=>{C.ready.then(()=>{const n=zl(),i=[],s=new Set,o=new Set;f.forEach((t,n)=>{const r=v.get(n),a=!!r?.new&&!r?.old,l=!!r?.old&&!r?.new;for(const r of Kl){if(!t[r])continue;if("enter"===r&&!a)continue;if("exit"===r&&!l)continue;const u=Ol(r),[h,d]=S(n,u);if(-1===h)continue;const{keyframes:p,options:m}=t[r];for(let[f,g]of Object.entries(p)){if(null==g)continue;if("x"===f||"y"===f){e.warnOnce(!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"===r&&a&&null!=t.enter?.keyframes[f])continue;if("old"===r&&l&&null!=t.exit?.keyframes[f])continue;const p=Hl($n(c,f),$n(m,f));if(!Array.isArray(g)){const e="enter"===r?t.exit?.keyframes[f]:void 0,n="opacity"===f||("new"===u?a:l),i=null!=e?Array.isArray(e)?e[e.length-1]:e:n?Xl[u]?.[f]:void 0;void 0!==i&&(g=[i,g])}"function"==typeof p.delay&&(p.delay=p.delay(h,d)),p.duration&&(p.duration=e.secondsToMilliseconds(p.duration)),p.delay&&(p.delay=e.secondsToMilliseconds(p.delay)),i.push(new qe({...p,element:document.documentElement,name:f,pseudoElement:`::view-transition-${u}(${n})`,keyframes:g})),s.add(`${n}:${u}`),"opacity"===f&&o.add(`${n}:${u}`)}}});for(const t of n){if("finished"===t.playState)continue;const{effect:n}=t;if(!(n&&n instanceof KeyframeEffect))continue;const{pseudoElement:r}=n;if(!r)continue;const a=$l(r);if(!a)continue;const l=f.get(a.layer);if(s.has(`${a.layer}:${a.type}`)){o.has(`${a.layer}:new`)&&o.has(`${a.layer}:old`)&&n.getKeyframes().some(t=>t.mixBlendMode)?i.push(new Bn(t)):t.cancel();continue}const c="old"===a.type?"new":"new"===a.type?"old":void 0;if(c&&s.has(`${a.layer}:${c}`)&&!o.has(`${a.layer}:${c}`)){t.cancel();continue}const u=v.get(a.layer),h=!("old"!==a.type&&"new"!==a.type||!u?.old||!u?.new);let d;if(a.type.startsWith("group")){const{delay:t,duration:e,ease:n}=P(a.layer);d={delay:t,duration:e,easing:Ke(n,e)}}else{const t=h?"group":a.type,[n,i]=S(a.layer,t);let s=b(l,t,"group"===t?"layout":"",-1===n?0:n,i);const o=s.visualDuration;s.duration&&(s.duration=e.secondsToMilliseconds(s.duration)),s=Xe(s),d={delay:e.secondsToMilliseconds(s.delay??0),duration:h&&void 0!==o?e.secondsToMilliseconds(o):s.duration,easing:h?"linear":Ke(s.ease,s.duration)}}n.updateTiming(d),i.push(new Bn(t))}M.forEach((t,e)=>{if(!g.has(e))return;const{delay:n,duration:s,ease:o}=P(e);for(const r of Ai){const a=t.old?.radii[r]||t.new?.radii[r]||"0px",l=t.new?.radii[r]||t.old?.radii[r]||"0px";Gl(a)&&Gl(l)||i.push(new qe({element:document.documentElement,name:r,pseudoElement:`::view-transition-group(${e})`,keyframes:[a,l],delay:n,duration:s,ease:o}))}}),t(new jn(i))}).catch(()=>C.updateCallbackDone.then(()=>t(new jn([])),n))})}function Hl(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 _l=[],Zl=null;function Jl(){Zl=null;const[t]=_l;var n;t&&(n=t,e.removeItem(_l,n),Zl=n,ql(n).then(t=>(n.notifyReady(t),t.finished)).catch(t=>n.notifyReject(t)).finally(Jl))}function Ql(){for(let t=_l.length-1;t>=0;t--){const e=_l[t],{interrupt:n}=e.options;if("immediate"===n){const n=_l.slice(0,t+1).map(t=>t.update),i=_l.slice(t+1);e.update=()=>{n.forEach(t=>t())},_l=[e,...i];break}}Zl&&"immediate"!==_l[0]?.options.interrupt||Jl()}class tc{constructor(t,n={}){var i;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=e.noop,this.notifyReject=e.noop,this.readyPromise=new Promise((t,e)=>{this.notifyReady=t,this.notifyReject=e}),this.update=t,this.options={interrupt:"wait",...n},this.readyPromise.catch(e.noop),i=this,_l.push(i),Us.render(Ql)}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 ec=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"]),nc=t=>"string"==typeof t&&"svg"===t.toLowerCase();function ic(t,e,n,i){$r(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(ec.has(n)?n:Hi(n),e.attrs[n])}function sc(t,e,n){const i=zr(t,e,n);for(const n in t)if("children"!==n&&(ui(t[n])||ui(e[n]))){i[-1!==ye.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}function oc(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 rc=[...Dr].reverse(),ac=t=>!0===t?.out?t:t?.out;function lc(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!oc(e,t)}function cc(){const t={};for(const e of Dr)t[e]={isActive:"animate"===e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{},out:{}};return t}const uc=kr.length;const hc=t=>!t.isLayoutDirty&&t.willUpdate(!1);const dc=lt,pc=rt.reduce((t,e)=>(t[e]=t=>ct(t),t),{});t.AsyncMotionValueAnimation=Rn,t.DOMKeyframesResolver=Mi,t.DOMVisualElement=Wr,t.DocumentProjectionNode=br,t.Feature=class{constructor(t){this.isMounted=!1,this.node=t}update(){}},t.FlatTree=Ko,t.GroupAnimation=jn,t.GroupAnimationWithThen=class extends jn{then(t,e){return this.finished.finally(t).then(()=>{})}},t.HTMLProjectionNode=Mr,t.HTMLVisualElement=Kr,t.JSAnimation=Kt,t.KeyframeResolver=Le,t.LayoutAnimationBuilder=ra,t.MotionValue=Un,t.MotionValueState=Wi,t.NativeAnimation=qe,t.NativeAnimationExtended=Ze,t.NativeAnimationWrapper=Bn,t.NodeStack=Oo,t.ObjectVisualElement=class extends Nr{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.PanSession=Ea,t.SVGVisualElement=class extends Wr{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Eo}getBaseTargetFromProps(t,e){return ve.has(e)?super.getBaseTargetFromProps(t,e)??me(e):t[e]}getDefaultValue(t){return ve.has(t)?this.latestValues[t]??me(t):void 0}readValueFromInstance(t,e){if(ve.has(e)){const t=te(e);return t&&t.default||0}if(ts.includes(e)){const n=getComputedStyle(t)[e];if("string"==typeof n&&n)return n.trim()}return e=ec.has(e)?e:Hi(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return sc(t,e,n)}build(t,e,n){es(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){ic(t,e,0,i)}mount(t){this.isSVGTag=nc(t.tagName),super.mount(t)}},t.ViewTransitionBuilder=tc,t.VisualElement=Nr,t.VisualElementDragControls=_a,t.acceleratedValues=tn,t.acquireProjectionNode=function(t){const e=Zr.get(t)||Ar.get(t)?.projection;return e?.instance?[e,()=>{}]:na(t)},t.activeScope=Bi,t.addAttrValue=ns,t.addBuilderToScope=Fi,t.addDomEvent=Sr,t.addEffect=function(t){ki(t),Di.unshift(t)},t.addPinchListeners=cl,t.addPointerEvent=ha,t.addPointerInfo=ua,t.addSVGValue=ss,t.addScaleCorrector=function(t){for(const e in t)$s[e]=t[e],l(e)&&($s[e].isCSSVariable=!0)},t.addStyleValue=Gi,t.addToScope=Oi,t.addValueToWillChange=di,t.alpha=m,t.analyseComplexValue=U,t.animateEffectSubject=Ri,t.animateElement=function(t,e,n,i){if(Bi.current?.track(t),i)return Ci(t=>i.getValue(t,null),e,n,i);const s=Ls(t);return Ri(s,t,e,n,new Bs(s,t))},t.animateLayout=function(t,e,n){const{scope:i,updateDom:s,defaultOptions:o}=aa(t,e,n),r=new ra(i,s,{...Bi.current?.transition,...o});return Fi(r),r},t.animateMotionValue=Hn,t.animateSingleValue=Ws,t.animateTarget=yi,t.animateValue=function(t){return new Kt(t)},t.animateValues=Ci,t.animateVariant=vi,t.animateView=function(t,e={}){const n=new tc(t,e);return Fi(n),n},t.animateVisualElement=xi,t.animationMapKey=(t,e="")=>`${t}:${e}`,t.applyAxisDelta=Ts,t.applyBoxDelta=Ss,t.applyGeneratorOptions=Xe,t.applyPointDelta=ws,t.applyPxDefaults=function(t,e){for(let n=0;n<t.length;n++)"number"==typeof t[n]&&Ei.has(e)&&(t[n]=t[n]+"px")},t.applyTreeDeltas=Ms,t.arc=function(t={}){const n=function({strength:t=.5,peak:n=.5,direction:i,rotate:s=!1}={}){const o=!0===s?1:"number"==typeof s?s:0;let r;return(s,a)=>{const l=a.x-s.x,c=a.y-s.y;let u;u="cw"===i?-t:"ccw"===i?t:(Math.abs(l)>=Math.abs(c)?l:c)<0?-t:t;let h=Jn(s.x,s.y,a.x,a.y,u,n);if(void 0===i){const t=Math.abs(l)<Math.abs(c),e=s.x+l*n,i=s.y+c*n,o=t?Math.sign(h.x-e):Math.sign(h.y-i);void 0!==r&&0!==o&&o!==r?(u=-u,h=Jn(s.x,s.y,a.x,a.y,u,n)):0!==o&&(r=o)}const d=o?Zn(0,s.x,h.x,a.x,s.y,h.y,a.y):0,p=o?Zn(1,s.x,h.x,a.x,s.y,h.y,a.y):0,m=o?e.wrap(-180,180,p-d):0;return t=>{const n={x:_n(t,s.x,h.x,a.x),y:_n(t,s.y,h.y,a.y)};if(o){const i=Zn(t,s.x,h.x,a.x,s.y,h.y,a.y),r=d+m*t;n.rotate=e.wrap(-180,180,i-r)*o}return n}}}(t),i={interpolateProjection(t){const e=t.x.translate,i=t.y.translate;if(!(Math.sqrt(e*e+i*i)<20))return n({x:e,y:i},{x:0,y:0})},animateValues(t,e,i,s,o){if(!("x"in e)&&!("y"in e))return;const r=t("x"),a=t("y"),l=e.x,c=e.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,m=n({x:u,y:h},{x:d,y:p}),f=void 0!==m(0).rotate?t("pathRotation"):void 0,g={delay:s,...$n(i||{},"x")};delete g.path;const y=Nn(0);y.start(Hn("",y,[0,1e3],{...g,isSync:!0,velocity:0,onUpdate:t=>{const e=m(t/1e3);r?.set(e.x),a?.set(e.y),f&&void 0!==e.rotate&&f.set(e.rotate)},onComplete:()=>{r?.set(d),a?.set(p),f?.set(0)},onStop:()=>f?.set(0),onCancel:()=>f?.set(0)})),y.animation&&o.push(y.animation),delete e.x,delete e.y}};return i},t.aspectRatio=Lo,t.attachFollow=El,t.attachSpring=Dl,t.attrEffect=is,t.axisDeltaEquals=Bo,t.axisEquals=ko,t.axisEqualsRounded=Ro,t.bindToScope=Ii,t.boxEquals=Co,t.boxEqualsRounded=jo,t.buildHTMLStyles=_i,t.buildProjectionTransform=Wo,t.buildSVGAttrs=es,t.buildSVGPath=Qi,t.buildTransform=pn,t.buildTransformer=N,t.calcAxisDelta=ao,t.calcBoxDelta=lo,t.calcChildStagger=Fn,t.calcGeneratorDuration=mt,t.calcLength=oo,t.calcRelativeAxis=co,t.calcRelativeAxisPosition=ho,t.calcRelativeBox=uo,t.calcRelativePosition=po,t.camelCaseAttributes=ec,t.camelToDash=Hi,t.cancelFrame=ct,t.cancelMicrotask=Ns,t.cancelSync=pc,t.checkVariantsDidChange=lc,t.cleanDirtyNodes=nr,t.collectMotionValues=In,t.color=R,t.compareByDepth=zo,t.complex=$,t.containsCSSVariable=d,t.convertBoundingBoxToBox=cs,t.convertBoxToBoundingBox=us,t.convertOffsetToTimes=Ct,t.copyAxisDeltaInto=so,t.copyAxisInto=no,t.copyBoxInto=io,t.correctBorderRadius=Io,t.correctBoxShadow=Uo,t.createAnimationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:n})=>xi(t,e,n))),n=cc(),i=!0,s=!1;function o(o){const{props:r,parent:a,manuallyAnimateOnMount:l}=t,{initial:c}=r,u=i||s,h=[],d=(e=c)=>"boolean"!=typeof e&&ii(t,Array.isArray(e)?e[0]:e,t.presenceContext?.custom)||void 0,p=new Map;let m={},f=1/0,g=t;do{g=!1!==g.props.inherit&&g.parent}while(g&&!g.isControllingVariants);const y=u&&ac(d(c??(g&&g.props.initial))?.transition);if(rc.forEach((e,i)=>{const s=n[e],c=r[e],d=g&&g.props[e],v=void 0!==c?c:Vr(d)||!1===d?d:void 0,x=Vr(v),w=e===o?s.isActive:null,T=x&&void 0===c&&!(u&&l);if(s.protectedKeys={...m},!s.isActive&&null===w||!v&&!s.prevProp||Er(v)||"boolean"==typeof v)return;if(!1===w&&(f=i),"exit"===e&&s.isActive&&!0!==w)return void(m={...m,...s.prevResolvedValues});const S=lc(s.prevProp,v);let b=S||x&&(w&&!T||i>f),P=!1;const M=Array.isArray(v)?v:[v];let A,E={};if(!1!==w)for(const n of M){const{transition:i,transitionEnd:s,...o}=ii(t,n,si(t,e))||{};E={...E,...o,...s},A=ac(i)||A}const{prevResolvedValues:V}=s;for(const e in{...V,...E}){if(e in m)continue;const n=E[e],i=V[e],o=Array.isArray(n)&&Array.isArray(i)?!oc(n,i)||S:n!==i;let r;if(o&&null==n)p.has(e)||p.set(e,s.prevOut);else if(o||void 0!==n&&p.has(e)){b=!0,r=p.get(e)||y,p.delete(e)&&(P=!0),s.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)}else s.protectedKeys[e]=!0;s.out[e]=r}if(s.prevProp=v,s.prevResolvedValues=E,s.prevOut=A,s.isActive&&(m={...m,...E}),b&&(!T||!S||P))for(const n of M){const i={type:e};if("string"==typeof n&&u&&l&&a?.enteringChildren){const e=ii(a,n)?.transition?.delayChildren;i.delay=Fn(a.enteringChildren,t,e)}h.push({animation:n,options:i})}}),p.size){const e={},n=d();let i=n?.transition;p.forEach((s,o)=>{s&&(i={...i||t.getDefaultTransition(),[o]:s});const a=t.getValue(o);a&&(a.liveStyle=!0);const l=n&&!Array.isArray(c)?n[o]:void 0,u=t.getBaseTargetFromProps(r,o);e[o]=(void 0!==l?l:void 0===u||ui(u)?void 0===t.initialValues[o]?t.baseTarget[o]:void 0:u)??null}),i&&(e.transition=i),h.push({animation:e})}const v=u&&t.blockInitialAnimation||i&&!l&&(!1===r.initial||r.initial===r.animate);return i=s=!1,!v&&h.length?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:n=>{e=n(t)},getState:()=>n,reset:()=>{n=cc(),s=!0}}},t.createAxis=Ao,t.createAxisDelta=Po,t.createBox=Eo,t.createDelta=Mo,t.createEffect=$i,t.createGeneratorEasing=ft,t.createProjectionNode=Jo,t.createRenderBatcher=at,t.cubicBezierAsString=$e,t.defaultEasing=Rt,t.defaultOffset=kt,t.defaultTransformValue=me,t.defaultValueTypes=Qt,t.degrees=M,t.delay=Gs,t.delayInSeconds=function(t,n){return Gs(t,e.secondsToMilliseconds(n))},t.dimensionValueTypes=Ti,t.distance=Pa,t.distance2D=Ma,t.drag=function(t,e={}){const n=(({axis:t,constraints:e,elastic:n,momentum:i,transition:s,snapToOrigin:o,directionLock:r,propagation:a,onStart:l,onMove:c,onEnd:u,onDirectionLock:h,onTransitionEnd:d,onMeasureConstraints:p,x:m,y:f})=>({drag:t||!0,_dragX:m||f&&Nn(0),_dragY:f||m&&Nn(0),dragConstraints:e,dragElastic:n,dragMomentum:i,dragTransition:s,dragSnapToOrigin:o,dragDirectionLock:r,dragPropagation:a,onDragStart:l,onDrag:c,onDragEnd:u,onDirectionLock:h,onDragTransitionEnd:d,onMeasureDragConstraints:p}))(e),i=Bi.current;if(i)for(const t in n){const e=n[t];"function"==typeof e&&(n[t]=i.bind(e))}const s=Ui(t).map(t=>{i?.track(t);const[s,o]=Hr(t);s.setOptions({alwaysMeasureLayout:!0});const r=new _a(Ar.get(t),()=>n),a=r.addListeners(),l=function(t,e){const{style:n}=t,i=t.getAttribute("draggable"),s=el.map(t=>n.getPropertyValue(t)),o=e?"pan-"+("x"===e?"y":"x"):"none";return el.forEach((t,e)=>n.setProperty(t,e<3?"none":o)),t.setAttribute("draggable","false"),()=>{el.forEach((t,e)=>n.setProperty(t,s[e])),null===i?t.removeAttribute("draggable"):t.setAttribute("draggable",i)}}(t,e.axis);return()=>{l(),a?.(),r.cancel(),r.stopAnimation(),o()}});return Oi(()=>s.forEach(t=>t()))},t.eachAxis=$o,t.elementDragControls=Ha,t.expectsResolvedDragConstraints=function({dragConstraints:t,onMeasureDragConstraints:e}){return Za(t)&&!!e},t.extractEventInfo=ca,t.fillOffset=Dt,t.fillWildcards=re,t.findDimensionValueType=Si,t.findEffect=function(t){return Di.find(e=>e.test(t))},t.findValueType=t=>kl.find(wi(t)),t.flushKeyframeResolvers=je,t.flushLayoutSnapshots=oa,t.followValue=function(t,e){const n=Nn(ui(t)?t.get():t);return El(n,t,e),n},t.frame=lt,t.frameData=n,t.frameSteps=ut,t.generateLinearEasing=dt,t.getAnimatableNone=oe,t.getAnimationMap=function(t){let e=On.get(t);return e||(e=new Map,On.set(t,e)),e},t.getComputedStyle=function(t,e){const n=window.getComputedStyle(t);return Be(e)?n.getPropertyValue(e):n[e]},t.getDefaultTransition=Yn,t.getDefaultValueType=te,t.getFeatureDefinitions=function(){return Ur},t.getFinalKeyframe=Bt,t.getMixer=tt,t.getOptimisedAppearId=mi,t.getOriginIndex=function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}},t.getSpringOptions=Pt,t.getValueAsType=an,t.getValueTransition=$n,t.getVariableValue=ei,t.getVariantContext=function t(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(n.initial=e.props.initial),n}const n={};for(let t=0;t<uc;t++){const i=kr[t],s=e.props[i];(Vr(s)||!1===s)&&(n[i]=s)}return n},t.getViewAnimationLayerInfo=$l,t.getViewAnimations=zl,t.globalProjectionState=Go,t.handOffElementState=Fs,t.has2DTranslate=ys,t.hasComplexValues=I,t.hasReducedMotionListener=Br,t.hasScale=ps,t.hasTransform=fs,t.hex=b,t.hover=function(t,e,n={}){e=Ii(e);const[i,s,o]=nl(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||Na())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},t.hsla=C,t.hslaToRgba=K,t.inertia=Et,t.initPrefersReducedMotion=Fr,t.interpolate=Vt,t.invisibleValues=Z,t.isAnimationControls=Er,t.isCSSVariableName=l,t.isCSSVariableToken=u,t.isControllingVariants=Cr,t.isDeltaZero=Do,t.isDragActive=Na,t.isDragging=Ua,t.isElementKeyboardAccessible=Oa,t.isElementTextInput=Ia,t.isForcedMotionValue=zs,t.isGenerator=Ye,t.isHTMLElement=ji,t.isKeyframesTarget=ri,t.isMotionValue=ui,t.isNear=ro,t.isNodeOrChild=hl,t.isPrimaryPointer=la,t.isSVGElement=Li,t.isSVGSVGElement=Ys,t.isSVGTag=nc,t.isTransitionDefined=qn,t.isVariantLabel=Vr,t.isVariantNode=Rr,t.isWaapiSupportedEasing=function t(n){return Boolean("function"==typeof n&&We()||!n||"string"==typeof n&&(n in ze||We())||e.isBezierDefinition(n)||Array.isArray(n)&&n.every(t))},t.isWillChangeMotionValue=hi,t.keyframes=jt,t.makeAnimationInstant=Qe,t.mapEasingToNativeEasing=Ke,t.mapValue=function(t,e,n,i){const s=Tl(e,n,i);return Vl(()=>s(t.get()))},t.maxGeneratorDuration=pt,t.measurePageBox=Cs,t.measureViewportBox=ks,t.microtask=Us,t.mix=ot,t.mixArray=et,t.mixColor=_,t.mixComplex=it,t.mixImmediate=G,t.mixLinearColor=X,t.mixNumber=Y,t.mixObject=nt,t.mixValues=Zs,t.mixVisibility=J,t.motionValue=Nn,t.nodeGroup=function(){const t=new Set,e=new WeakMap,n=()=>t.forEach(hc);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}},t.number=p,t.numberValueTypes=Jt,t.optimizedAppearDataAttribute=pi,t.optimizedAppearDataId="framerAppearId",t.originProps=zi,t.parseAnimateLayoutArgs=aa,t.parseCSSVariable=ti,t.parseValueFromTransform=fe,t.percent=A,t.pinch=function(t,e,n={}){let i=()=>{};"function"==typeof e?i=e:e&&(n=e);const s=Bi.current;if(s){const t=s.bind(i);i=(e,n)=>{const i=t(e,n);if("object"!=typeof i)return i;const o={};for(const t in i){const e=t,n=i[e];o[e]=n&&s.bind(n)}return o}}const o=Ui(t).map(t=>{s?.track(t);const{style:e}=t,o=e.touchAction;e.touchAction="none";const r=cl(t,()=>(t=>{const e=Ar.get(t),n=Li(t)?rs:Xi;return ul.map(i=>{if(e)return e.getValue(i,"scale"===i?1:0);let s=n.get(t,i);return s||(s=Nn(Yi(t,i)),n(t,{[i]:s})),s})})(t),()=>n,i);return()=>{r(),e.touchAction=o}});return Oi(()=>o.forEach(t=>t()))},t.pixelsToPercent=Fo,t.positionalKeys=oi,t.prefersReducedMotion=Lr,t.press=function(t,n,i={}){n=Ii(n);const[s,r,a]=nl(t,i),l=new WeakMap,c=t=>{const s=t.currentTarget;if(!la(t)||Na())return;if(fl.has(t))return;i.stopPropagation&&fl.add(t);const{count:a=1,countTimeout:c=.3,hold:u=0,repeat:h}=i,d=o.now(),p=e.secondsToMilliseconds(u),m=e.secondsToMilliseconds(c);let f=l.get(s);f?.expire(gl(f.event,t,100))?f=void 0:f&&(ct(f.expire),l.delete(s));const g=f?f.count+1:1,y=g>=a,v=y&&(u||h);let x,w=!u,T=0;if(dl.add(s),f)x=f.handlers;else{const e=n(s,t);x="function"==typeof e?{onComplete:e}:e||{}}y&&w&&x.onActive?.();const S=e.secondsToMilliseconds(h);let b=p||S,P=d+b,M=!0;const A=()=>{if(r.signal.aborted)return ct(A);let t=Math.min(1-(P-o.now())/b,1);M&&t<1&&(t=0),M=!1,x.onHold?.(t),t<1||(w?x.onRepeat?.(++T):(w=!0,x.onActive?.()),h?(M=!0,P+=b=S):ct(A))},E={...r,capture:!0},V=(e,n)=>{if(la(e))if(window.removeEventListener("pointerup",D,E),window.removeEventListener("pointercancel",k,E),window.removeEventListener("pointermove",C,E),s.removeEventListener("contextmenu",yl),ct(A),dl.delete(s),Na()&&(n=!1),n&&!y){const n=o.now(),i=t=>{const a=r.signal.aborted;if(a||!0===t||o.now()-n>m)return ct(i),l.delete(s),a||x.onComplete?.(e,{success:!1}),!0};l.set(s,{count:g,event:t,handlers:x,expire:i}),lt.update(i,!0)}else x.onComplete?.(e,{success:n&&w})},D=t=>{V(t,s===window||s===document||i.useGlobalTarget||hl(s,t.target))},k=t=>{V(t,!1)},C=e=>{la(e)&&((h||!w)&&gl(t,e,8)||a>1&&Na())&&k(e)};window.addEventListener("pointerup",D,E),window.addEventListener("pointercancel",k,E),(v||a>1)&&window.addEventListener("pointermove",C,E),v&&(lt.update(A,!0),s.addEventListener("contextmenu",yl,{...r,passive:!1}))};return s.forEach(t=>{(i.useGlobalTarget?window:t).addEventListener("pointerdown",c,r),ji(t)&&(t.addEventListener("focus",()=>((t,e)=>{let n=!1;const i=pl(()=>{n||dl.has(t)||(n=!0,ml(t,"down"))}),s=pl(()=>{n&&(n=!1,ml(t,"up"))});t.addEventListener("keydown",i,e),t.addEventListener("keyup",s,e),t.addEventListener("blur",()=>{t.removeEventListener("keydown",i),t.removeEventListener("keyup",s),n&&ml(t,"cancel")},{...e,once:!0})})(t,r),r),Oa(t)||t.hasAttribute("tabindex")||(t.tabIndex=0))}),a},t.processFrame=(t=o.now())=>{if(n.isProcessing)return;const i=t-n.timestamp;n.delta=e.MotionGlobalConfig.useManualTiming?i:Math.max(Math.min(i,40),1),o.set(n.timestamp=t),n.isProcessing=!0;for(const t in ut)ut[t].process(n);n.isProcessing=!1},t.progressPercentage=k,t.propEffect=Is,t.propagateDirtyNodes=er,t.px=E,t.readSVGValue=os,t.readStyleValue=Yi,t.readTransformValue=ge,t.recordStats=function(){if(Ks.value)throw Ks.value=null,Ks.addProjectionMetrics=null,Ks.countProjection=void 0,new Error("Stats are already being measured");const t=Ks;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)};const e={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0};t.countProjection=n=>{void 0!==n?e[wl[n]]++:(t.addProjectionMetrics(e),e.nodes=e.calculatedTargetDeltas=e.calculatedProjections=0)}},t.releaseElement=Os,t.removeAxisDelta=fo,t.removeAxisTransforms=go,t.removeBoxTransforms=xo,t.removeEffect=ki,t.removePointDelta=mo,t.renderHTML=$r,t.renderSVG=ic,t.resize=ba,t.resolveElements=Ui,t.resolveMotionValue=Xs,t.resolveTransition=Wn,t.resolveVariant=ii,t.resolveVariantFromProps=ni,t.rgbUnit=w,t.rgba=T,t.rootProjectionNode=Pr,t.round=zt,t.sampleDelta=10,t.scale=f,t.scaleCorrectors=$s,t.scalePoint=xs,t.scopeMotion=function(...t){const n="function"==typeof t[0]?void 0:t.shift(),[i,s={}]=t,{transition:o,matchMedia:r}=s,a=[],l=new Map;let c=[],u=!1;const h={root:Ui(n)[0],transition:o,add:t=>(c.push(t),()=>e.removeItem(c,t)),bind:t=>(...e)=>{const n=y.run(()=>t(...e));return"function"==typeof n?h.bind(n):n},track(t){l.has(t)||l.set(t,t.getAttribute("style"))}},d=t=>{const e=c;c=[];for(let t=e.length-1;t>=0;t--)e[t]();t&&l.forEach((t,e)=>{Os(e),null===t?e.removeAttribute("style"):e.setAttribute("style",t)}),l.clear()},p=()=>{y.state="active";let t=!a.length;y.media={};for(const[e,n]of a)t=(y.media[e]=n.matches)||t;if(t&&i){const t=y.run(()=>i(y));"function"==typeof t&&h.add(t)}},m=()=>{u||(u=!0,queueMicrotask(()=>{u=!1,a.length&&y.refresh()}))},f=t=>{y.state=t?"cancelled":"stopped";for(const[,t]of a)t.removeEventListener("change",m);a.length=0,d(t)},g=(t,e)=>{const n=Bi.current;Bi.current=t;try{return e()}finally{Bi.current=n}},y={state:"active",media:{},run:t=>g(h,t),ignore:t=>g(void 0,t),bind:h.bind,stop:()=>f(),cancel:()=>f(!0),refresh(){d(!0),p()}};if(r&&"undefined"!=typeof window){const t="string"==typeof r?{matches:r}:r;for(const e in t){const n=window.matchMedia(xl(t[e]));n.addEventListener("change",m),a.push([e,n])}}return Oi(y.cancel),p(),y},t.scrapeHTMLMotionValuesFromProps=zr,t.scrapeSVGMotionValuesFromProps=sc,t.setDragLock=Wa,t.setFeatureDefinitions=function(t){Ur=t},t.setStyle=Oe,t.setTarget=ci,t.spring=At,t.springValue=function(t,e){const n=Nn(ui(t)?t.get():t);return Dl(n,t,e),n},t.stagger=function(t=.1,{startDelay:n=0,from:i=0,ease:s,grid:o}={}){const r={};return(a,l)=>{let c=r[l];if(!c){const[t,e]=o||[1/0,1],n=Math.min(t,l)-1,s=Math.max(e,Math.ceil(l/t))-1,a="number"==typeof i,u="first"===i?0:"last"===i?1:.5,h=a?i%t:n*u,d=a?Math.floor(i/t):s*u;c=r[l]=[];for(let e=0;e<l;e++){const o=e%t,r=Math.floor(e/t),a=Math.min(o,n-o),l=Math.min(r,s-r);if("random"===i){const t=Math.random()*(e+1)|0;c[e]=c[t],c[t]=e}else c[e]="edges"===i?Math.min(n?a:l,s?l:a):Math.hypot(o-h,r-d)}c.push(o?Math.max(...c):l)}let u=t*c[a];const h=t*c[l];if(s&&h){u=e.easingDefinitionToFunction(s)(u/h)*h}return n+u}},t.startWaapiAnimation=Ge,t.statsBuffer=Ks,t.styleEffect=qi,t.styleSubjectEffect=Xi,t.supportedWaapiEasing=ze,t.supportsBrowserAnimation=rn,t.supportsFlags=Fe,t.supportsLinearEasing=We,t.supportsPartialKeyframes=Vi,t.supportsScrollTimeline=Ue,t.supportsViewTimeline=Ne,t.supportsWaapi=on,t.svgEffect=as,t.svgSubjectEffect=rs,t.sync=dc,t.testValueType=wi,t.time=o,t.toMediaQuery=xl,t.transform=Tl,t.transformAxis=Es,t.transformBox=Ds,t.transformBoxPoints=hs,t.transformPropOrder=ye,t.transformProps=ve,t.transformValue=Vl,t.transformValueTypes=Zt,t.translateAxis=As,t.updateMotionValuesFromProps=jr,t.variantPriorityOrder=Dr,t.variantProps=kr,t.vh=V,t.visualElementStore=Ar,t.vw=D});