framer-motion
Version:
A simple and powerful JavaScript animation library
3 lines • 72 kB
JavaScript
function t(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}const e=(t,e,s)=>s>e?e:s<t?t:s,s={},n=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),i=t=>"object"==typeof t&&null!==t,r=t=>/^0[^.\s]+$/u.test(t);const a=t=>t,o=(...t)=>t.reduce((t,e)=>s=>e(t(s))),h=(t,e,s)=>{const n=e-t;return n?(s-t)/n:1};class u{constructor(){this.subscriptions=[]}add(t){var e,s;return e=this.subscriptions,s=t,-1===e.indexOf(s)&&e.push(s),()=>this.remove(t)}remove(e){t(this.subscriptions,e)}notify(t,e,s){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](t,e,s);else for(let i=0;i<n;i++){const n=this.subscriptions[i];n&&n(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const l=t=>1e3*t,c=t=>t/1e3,p=(t,e)=>e?t*(1e3/e):0,d=(t,e,s)=>t*(3*(1-t)*((1-t)*e+t*s)+t*t);function m(t,e,s,n){return t===e&&s===n?a:i=>{let r=0,a=1,o=i;for(let e=0;;e++){o>=r&&o<=a||(o=(r+a)/2);const n=d(o,t,s)-i;if(n*n<1e-28||40===e)break;n>0?a=o:r=o,o-=1e-7*n/(d(o+1e-7,t,s)-i-n)}return d(o,e,n)}}const f=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,g=t=>e=>1-t(1-e),y=m(.33,1.53,.69,.99),v=g(y),b=f(v),T=t=>t>=1?1:(t*=2)<1?.5*v(t):.5*(2-Math.pow(2,-10*(t-1))),k=t=>1-Math.sin(Math.acos(t)),w=g(k),M=f(k),A=m(.42,0,1,1),S=m(0,0,.58,1),x=m(.42,0,.58,1),D=t=>Array.isArray(t)&&"number"!=typeof t[0];function F(t,e){return D(t)?t[((t,e,s)=>{const n=e-t;return((s-t)%n+n)%n+t})(0,t.length,e)]:t}const R=t=>Array.isArray(t)&&"number"==typeof t[0],E={linear:a,easeIn:A,easeInOut:x,easeOut:S,circIn:k,circInOut:M,circOut:w,backIn:v,backInOut:b,backOut:y,anticipate:T},P=t=>{if(R(t)){const[e,s,n,i]=t;return m(e,s,n,i)}return"string"==typeof t?E[t]:t},C={delta:0,timestamp:0,isProcessing:!1};let O;function V(){O=void 0}const I={now:()=>(void 0===O&&I.set(C.isProcessing||s.useManualTiming?C.timestamp:performance.now()),O),set:t=>{O=t,queueMicrotask(V)}},K=t=>Math.round(1e5*t)/1e5,W=(t=>e=>"string"==typeof e&&e.startsWith(t))("var(--"),N=t=>!!W(t)&&j.test(t.split("/*")[0].trim()),j=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function B(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const Y={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},U={...Y,transform:t=>e(0,1,t)},_={...Y,default:1},$=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const q=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,X=(t,e)=>s=>Boolean("string"==typeof s&&q.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),z=(t,e,s)=>n=>{if("string"!=typeof n)return n;const[i,r,a,o]=n.match($);return{[t]:parseFloat(i),[e]:parseFloat(r),[s]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},L={...Y,transform:t=>Math.round((t=>e(0,255,t))(t))},Z={test:X("rgb","red"),parse:z("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+L.transform(t)+", "+L.transform(e)+", "+L.transform(s)+", "+K(U.transform(n))+")"},J=(t,e,s)=>{const n=t.substring(1+e*s,1+(e+1)*s);return s>1?n:n+n};const G={test:X("#"),parse:function(t){const e=t.length>5?2:1,s=J(t,3,e);return{red:parseInt(J(t,0,e),16),green:parseInt(J(t,1,e),16),blue:parseInt(J(t,2,e),16),alpha:s?parseInt(s,16)/255:1}},transform:Z.transform},H=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Q=H("deg"),tt=H("%"),et=H("px"),st=H("vh"),nt=H("vw"),it=(()=>({...tt,parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)}))(),rt={test:X("hsl","hue"),parse:z("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+tt.transform(K(e))+", "+tt.transform(K(s))+", "+K(U.transform(n))+")"},at={test:t=>Z.test(t)||G.test(t)||rt.test(t),parse:t=>Z.test(t)?Z.parse(t):rt.test(t)?rt.parse(t):G.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Z.transform(t):rt.transform(t),getAnimatableNone:t=>{const e=at.parse(t);return e.alpha=0,at.transform(e)}},ot=new RegExp($.source),ht=new RegExp(/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu.source,"i");const ut="number",lt="color",ct=/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 pt(t){const e=t.toString();return ot.test(e)||ht.test(e)}function dt(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(ct,t=>(at.test(t)?(n.color.push(r),i.push(lt),s.push(at.parse(t))):t.startsWith("var(")?(n.var.push(r),i.push("var"),s.push(t)):(n.number.push(r),i.push(ut),s.push(parseFloat(t))),++r,"${}")).split("${}");return{values:s,split:a,indexes:n,types:i}}function mt({split:t,types:e}){const s=t.length;return n=>{let i="";for(let r=0;r<s;r++)if(i+=t[r],void 0!==n[r]){const t=e[r];i+=t===ut?K(n[r]):t===lt?at.transform(n[r]):n[r]}return i}}const ft=(t,e)=>{return"number"==typeof t?e?.trim().endsWith("/")?t:0:"number"==typeof(s=t)?0:at.test(s)?at.getAnimatableNone(s):s;var s};const gt={test:function(t){return isNaN(t)&&"string"==typeof t&&(ot.test(t)||ht.test(t))},parse:function(t){return dt(t).values},createTransformer:function(t){return mt(dt(t))},getAnimatableNone:function(t){const e=dt(t);return mt(e)(e.values.map((t,s)=>ft(t,e.split[s])))}};function yt(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function vt(t,e){return s=>s>0?e:t}const bt=(t,e,s)=>t+(e-t)*s,Tt=(t,e,s)=>{const n=t*t,i=s*(e*e-n)+n;return i<0?0:Math.sqrt(i)},kt=[G,Z,rt];function wt(t){const e=(s=t,kt.find(t=>t.test(s)));var s;if(!e)return!1;let n=e.parse(t);return e===rt&&(n=function({hue:t,saturation:e,lightness:s,alpha:n}){t/=360,s/=100;let i=0,r=0,a=0;if(e/=100){const n=s<.5?s*(1+e):s+e-s*e,o=2*s-n;i=yt(o,n,t+1/3),r=yt(o,n,t),a=yt(o,n,t-1/3)}else i=r=a=s;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*a),alpha:n}}(n)),n}const Mt=(t,e)=>{const s=wt(t),n=wt(e);if(!s||!n)return vt(t,e);const i={...s};return t=>(i.red=Tt(s.red,n.red,t),i.green=Tt(s.green,n.green,t),i.blue=Tt(s.blue,n.blue,t),i.alpha=bt(s.alpha,n.alpha,t),Z.transform(i))},At=new Set(["none","hidden"]);function St(t,e){return s=>bt(t,e,s)}function xt(t){return"number"==typeof t?St:"string"==typeof t?N(t)?vt:at.test(t)?Mt:Rt:Array.isArray(t)?Dt:"object"==typeof t?at.test(t)?Mt:Ft:vt}function Dt(t,e){const s=[...t],n=s.length,i=t.map((t,s)=>xt(t)(t,e[s]));return t=>{for(let e=0;e<n;e++)s[e]=i[e](t);return s}}function Ft(t,e){const s={...t,...e},n={};for(const i in s)void 0!==t[i]&&void 0!==e[i]&&(n[i]=xt(t[i])(t[i],e[i]));return t=>{for(const e in n)s[e]=n[e](t);return s}}const Rt=(t,e)=>{const s=dt(t),n=dt(e);return s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length?At.has(t)&&!n.values.length||At.has(e)&&!s.values.length?function(t,e){return At.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}(t,e):o(Dt(function(t,e){const s=[],n={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],a=t.indexes[r][n[r]],o=t.values[a]??0;s[i]=o,n[r]++}return s}(s,n),n.values),mt(n)):vt(t,e)},Et=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function Pt(t,e,s){if("number"==typeof t&&"number"==typeof e&&"number"==typeof s)return bt(t,e,s);if("string"==typeof t&&"string"==typeof e){const s=function(t,e){const s=Et.exec(t);if(!s)return;const n=Et.exec(e);if(!n||s[2]!==n[2])return;const i=s[2],r=parseFloat(s[1]),a=parseFloat(n[1]);return t=>K(bt(r,a,t))+i}(t,e);if(s)return s}return xt(t)(t,e)}const Ct=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Ot(t,e,n={delta:0,timestamp:0,isProcessing:!1}){let i=!1,r=!0;const a=()=>i=!0,o=Ct.reduce((t,e)=>(t[e]=function(t){let e,s=new Set,n=new Set,i=!1,r=!1;const a=new Set;let o={delta:0,timestamp:0,isProcessing:!1};function h(s){a.has(s)&&(n.add(s),t()),(e=s)(o)}const u={schedule:(t,r=!1,o=!1)=>{const h=o&&i,u=h?s:n;return r&&a.add(t),h&&t!==e&&u.delete(t),u.add(t),t},cancel:t=>{n.delete(t),a.delete(t)},process:t=>{if(o=t,i)return void(r=!0);i=!0;const a=s;s=n,n=a,s.forEach(h),s.clear(),e=void 0,i=!1,r&&(r=!1,u.process(t))}};return u}(a),t),{}),{setup:h,read:u,resolveKeyframes:l,preUpdate:c,update:p,preRender:d,render:m,postRender:f}=o,g=()=>{const a=s.useManualTiming,o=a?n.timestamp:performance.now();i=!1,a||(n.delta=r?1e3/60:Math.max(Math.min(o-n.timestamp,40),1)),n.timestamp=o,n.isProcessing=!0,h.process(n),u.process(n),l.process(n),c.process(n),p.process(n),d.process(n),m.process(n),f.process(n),n.isProcessing=!1,i&&e&&(r=!1,t(g))};return{schedule:Ct.reduce((e,s)=>{const a=o[s];return e[s]=(e,s=!1,o=!1)=>(i||(i=!0,r=!0,n.isProcessing||t(g)),a.schedule(e,s,o)),e},{}),cancel:t=>{for(let e=0;e<Ct.length;e++)o[Ct[e]].cancel(t)},state:n,steps:o}}const{schedule:Vt,cancel:It}=Ot("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:a,!0,C),Kt=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>Vt.update(e,t),stop:()=>It(e),now:()=>C.isProcessing?C.timestamp:I.now()}},Wt=(t,e,s=10)=>{let n="";const i=Math.max(Math.round(e/s),2);for(let e=0;e<i;e++)n+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Nt=2e4;function jt(t,e=50,s=2e4,n){let i=0,r=t.next(i);for(;!r.done&&i<s;)i+=e,r=t.next(i);return i>=s?1/0:i}function Bt(t,e=100,s){const{keyframes:n,velocity:i}=t,r=n&&n[n.length-1]-n[0],a=s({...t,velocity:i&&r?i*e/r:i,keyframes:[0,e]}),o=Math.min(jt(a),Nt);return{type:"keyframes",ease:t=>a.next(o*t).value/e,duration:c(o)}}const Yt=t=>t<0?1/Math.max(1+t,.05):Math.max(1-t,.05);function Ut(t,e){if(!(t>1))return 1;const s=Math.sqrt(t*t-1),n=t-s,i=t+s,r=2*s*Math.exp(-e)*(1+e);return qt(t=>i*Math.exp(-n*t)-n*Math.exp(-i*t)-r,t=>Math.exp(-i*t)-Math.exp(-n*t),e)/e}function _t(t,e){return t*Math.sqrt(1-e*e)}const $t=12;function qt(t,e,s){let n=s;for(let s=1;s<$t;s++)n-=t(n)/e(n);return n}const Xt=.001;const zt=(t,e)=>(e?t>=0:t>0)&&t<1/0;function Lt(t,e){if(zt(t,e))return t}function Zt(t){const s=Lt(t.stiffness),n=Lt(t.damping,!0),i=Lt(t.mass),r={...t,stiffness:s??100,damping:n??10,mass:i??1,isResolvedFromDuration:!1,isTimeDefined:void 0===(s??n??i)&&(void 0!==t.duration||void 0!==t.bounce)};if(r.isTimeDefined){if(t.visualDuration){const e=Yt(t.bounce||0),s=2*Math.PI/(1.2*t.visualDuration)*Ut(e,2*Math.PI/1.2);r.stiffness=s*s,r.damping=2*e*Math.sqrt(r.stiffness)}else Object.assign(r,function({duration:t=800,bounce:s=.3}){let n,i;const r=Yt(s);t=e(.01,10,c(t)),r<1?(n=e=>{const s=e*r,n=s*t,i=_t(e,r),a=Math.exp(-n);return Xt-s/i*a},i=e=>{const s=e*r*t,i=r*r*e*e*t,a=Math.exp(-s),o=_t(e*e,r);return(-n(e)+Xt>0?-1:1)*-i*a/o}):(n=e=>Math.exp(-e*t)*(e*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*-e));const a=qt(n,i,5/t),o=a*Ut(r,a*t),h=o*o;return{stiffness:h,damping:2*r*Math.sqrt(h),duration:l(t)}}(r)),r.isResolvedFromDuration=!0;zt(r.stiffness)&&zt(r.damping,!0)||(r.stiffness=100,r.damping=10)}return r}function Jt(t=.3,e=.3){const s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,n=s.keyframes[0],i=s.keyframes[s.keyframes.length-1],r={done:!1,value:n},{stiffness:a,damping:o,mass:h,duration:u,isResolvedFromDuration:p,isTimeDefined:d}=Zt({...s}),m=t=>p?0:-c(t),f=o/(2*Math.sqrt(a*h)),g=c(Math.sqrt(a/h)),y=f*g,v={target:i,delta:i-n,velocity:m(s.velocity)||0,restSpeed:0,restDelta:0},b=()=>{const t=Math.abs(v.delta)<5;v.restSpeed=s.restSpeed||(t?.01:2),v.restDelta=s.restDelta||(t?.005:.5)};let T,k,w;if(b(),f<1){const t=_t(g,f),e={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};w=()=>{e.A=(v.velocity+y*v.delta)/t,e.sinC=y*e.A+v.delta*t,e.cosC=y*v.delta-e.A*t};const s=s=>{s!==e.t&&(e.t=s,e.env=Math.exp(-y*s),e.sin=Math.sin(t*s),e.cos=Math.cos(t*s))};T=t=>(s(t),v.target-e.env*(e.A*e.sin+v.delta*e.cos)),k=t=>(s(t),e.env*(e.sinC*e.sin+e.cosC*e.cos))}else if(1===f){T=t=>v.target-Math.exp(-g*t)*(v.delta+(v.velocity+g*v.delta)*t);const t={C:0};w=()=>{t.C=v.velocity+g*v.delta},k=e=>Math.exp(-g*e)*(g*t.C*e-v.velocity)}else{const t=g*Math.sqrt(f*f-1),e=y-t,s=y+t,n=t<1||d?1/0:300/t,i=(t,e)=>Math.exp(e>n?(y-t)*n-y*e:-t*e),r={S:0,F:0};w=()=>{const e=(v.velocity+y*v.delta)/t;r.S=(v.delta+e)/2,r.F=(v.delta-e)/2},T=t=>v.target-r.S*i(e,t)-r.F*i(s,t),k=t=>e*r.S*i(e,t)+s*r.F*i(s,t)}w();const M=p&&u||null,A={calculatedDuration:M,retarget:(t,e)=>{v.target=t[t.length-1],v.delta=v.target-t[0],v.velocity=m(e),s.restSpeed&&s.restDelta||b(),A.calculatedDuration=M,r.done=!1,w()},velocity:t=>l(k(t)),next:t=>{const e=T(t);if(p)r.done=t>=u;else{const s=l(k(t));r.done=Math.abs(s)<=v.restSpeed&&Math.abs(v.target-e)<=v.restDelta}return r.value=r.done?v.target:e,r},toString:()=>{const t=Math.min(jt(A),Nt),e=Wt(e=>A.next(t*e).value,t,30);return t+"ms "+e}};return A}const Gt=Object.assign(Jt,{applyToOptions:t=>{const e=Bt(t,100,Jt);return t.ease=e.ease,t.duration=l(e.duration),t.type="keyframes",t}});function Ht({keyframes:t,velocity:e=0,power:s=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:h,restDelta:u=.5,restSpeed:l}){const c=t[0],p={done:!1,value:c},d=t=>void 0===o?h:void 0===h||Math.abs(o-t)<Math.abs(h-t)?o:h;let m=s*e;const f=c+m,g=a?a(f):f;g!==f&&(m=g-c);const y=t=>-m*Math.exp(-t/n),v=t=>{const e=y(t);p.done=Math.abs(e)<=u,p.value=p.done?g:t?g+e:c};let b,T;const k=t=>{var e;((e=p.value)<o||e>h)&&(b=t,T=Gt({keyframes:[p.value,d(p.value)],velocity:-y(t)/n*1e3,damping:i,stiffness:r,restDelta:u,restSpeed:l}))};return k(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,v(t),k(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&v(t),p)}}}function Qt(t,n,{clamp:i=!0,ease:r,mixer:u}={}){const l=t.length;if(1===l)return()=>n[0];if(2===l&&n[0]===n[1])return()=>n[1];const c=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),n=[...n].reverse());const p=function(t,e,n){const i=[],r=s.mix||Pt,h=t.length-1;for(let s=0;s<h;s++){let h=n?.(t[s],t[s+1])||r(t[s],t[s+1]);if(e){const t=Array.isArray(e)?e[s]||a:e;h=o(t,h)}i.push(h)}return i}(n,r,u),d=p.length,m=e=>{if(c&&e<t[0])return n[0];let s=0;if(d>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=h(t[s],t[s+1],e);return p[s](i)};return i?s=>m(e(t[0],t[l-1],s)):m}function te(t,e){const s=t[t.length-1];for(let n=1;n<=e;n++){const i=h(0,e,n);t.push(bt(s,1,i))}}function ee(t){const e=[0];return te(e,t.length-1),e}function se({duration:t=300,keyframes:e,times:n,ease:i="easeInOut",mixer:r}){const a="number"==typeof e[0]?void 0:r,o=D(i)?i.map(P):P(i)||x,h={done:!1,value:e[0]};let u=-1;if(!a)for(let t=1;t<e.length;t++)if(e[t]!==e[t-1]){if(u>=0){u=-2;break}u=t-1}if(u>=0){const i=n&&n.length===e.length?n:ee(e),r=i[u]*t,a=i[u+1]*t,l=e[u],c=e[u+1],p=Array.isArray(o)?o[u]:o,d=(s.mix||Pt)(l,c),m=e.length-2;return{calculatedDuration:t,next:e=>(h.value=u&&e<r?d(0):u<m&&(e>=a||!t)?"number"==typeof c?c:d(1):d(p(e>=a||!t?1:e<=r?0:(e-r)/(a-r))),h.done=e>=t,h)}}const l=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ee(e),t),c=Qt(l,e,{ease:Array.isArray(o)?o:(p=e,d=o,p.map(()=>d||x).splice(0,p.length-1)),mixer:a});var p,d;return{calculatedDuration:t,next:e=>(h.value=c(e),h.done=e>=t,h)}}function ne(t,e,s=0){return e<=0?s:t.velocity?t.velocity(e):function(t,e,s){const n=Math.max(e-5,0);return p(s-t(n),e-n)}(e=>t.next(e).value,e,t.next(e).value)}function ie(t,{repeat:e,repeatType:s="loop"},n,i=1){let r,a,o=0;for(let e=0;e<t.length;e++){const s=t[e];null!==s&&(o++||(r=s),a=s)}const h=i<0||e&&"loop"!==s&&e%2==1?0:o-1;return h&&void 0!==n?n:h?a:r}const re={decay:Ht,inertia:Ht,tween:se,keyframes:se,spring:Gt};function ae(t){"string"==typeof t.type&&(t.type=re[t.type])}const oe=(t,e)=>e-t>40&&!s.useManualTiming?e:t;function he(t,e){return{kind:t,animation:e,timestamp:I.now(),frameTimestamp:C.timestamp,frameIsProcessing:C.isProcessing}}function ue(t,e,s){const n=globalThis.__MOTION_INSPECT__;if(n)try{n({...he("animation-start",t),options:s?{...e,...s}:e})}catch{}}class le{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 ce=t=>t/100,pe=t=>Math.round(1e4*t)/1e4;class de extends le{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=I.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(),ue(this,this.options)}initAnimation(){const{options:t}=this;ae(t);const{type:e=se,repeat:s=0,repeatDelay:n=0,repeatType:i,velocity:r=0}=t;let{keyframes:a}=t;const h=e||se;this.mixKeyframes=void 0,h!==se&&"number"!=typeof a[0]&&(this.mixKeyframes=o(ce,t.mixer?.(a[0],a[1])||Pt(a[0],a[1])),a=[0,100]);const u=h(a===t.keyframes?t:{...t,keyframes:a});"mirror"===i&&(this.mirroredGenerator=h({...t,keyframes:[...a].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=jt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+n,this.totalDuration=this.resolvedDuration*(s+1)-n,this.generator=u}updateTime(t){this.currentTime=this.holdTime??Math.round(t-this.startTime)*this.playbackSpeed}tick(t,e=!1){const{generator:s,totalDuration:n,calculatedDuration:i}=this;if(null===this.startTime)return s.next(0);const{delay:r=0,keyframes:a,type:o,onUpdate:h,finalKeyframe:u}=this.options;this.startTime===this.pendingStartTime&&(this.startTime=oe(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-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const l=this.currentTime-r*(this.playbackSpeed>=0?1:-1),c=this.playbackSpeed>=0?l<0:l>n;this.currentTime=Math.max(l,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);const p=this.generate(this.currentTime,c);let{done:d}=p;c||(d=this.playbackSpeed>=0?i<1/0?this.currentTime>=n:d:this.currentTime<=0);const m=null===this.holdTime&&("finished"===this.state||"running"===this.state&&d);return m&&o!==Ht&&(p.value=ie(a,this.options,u,this.speed)),h&&h(p.value),m&&this.finish(),p}at(t){return this.holdTime??pe((t-this.startTime)*this.playbackSpeed)}sampleAt(t,e){const{options:s,totalDuration:n}=this,i=this.at(t)-(s.delay||0);return i>=n&&s.type!==Ht?ie(s.keyframes,s,e?void 0:s.finalKeyframe):this.generate(Math.max(i,0),i<0).value}generate(t,s){const{generator:n,totalDuration:i,mixKeyframes:r,mirroredGenerator:a,resolvedDuration:o}=this,{keyframes:h,repeat:u,repeatType:l,repeatDelay:c}=this.options;let p,d=t,m=n;if(u){const s=Math.min(t,i)/o;let n=Math.floor(s),r=s%1;!r&&s>=1&&(r=1),1===r&&n--,n=Math.min(n,u+1);Boolean(n%2)&&("reverse"===l?(r=1-r,c&&(r-=c/o)):"mirror"===l&&(m=a)),d=e(0,1,r)*o}return s?(this.delayState.value=h[0],p=this.delayState):p=m.next(d),r&&!s&&(p.value=r(p.value)),p}get duration(){return c(this.calculatedDuration)}get iterationDuration(){return this.duration+c(this.options.delay??0)}get time(){return c(this.currentTime)}set time(t){"finished"===this.state&&this.updateFinished(),t=l(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){return ne(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;e&&this.driver&&this.updateTime(I.now()),this.playbackSpeed=t,e&&this.driver&&(this.time=c(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Kt,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const s=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=s):null!==this.holdTime?this.startTime=s-this.holdTime/(this.playbackSpeed||1):this.startTime||(this.startTime=e??(this.pendingStartTime=s)),"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(I.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 me=new Set(["brightness","contrast","saturate","opacity"]);function fe(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[n]=s.match($)||[];if(!n)return t;const i=s.replace(n,"");let r=me.has(e)?1:0;return n!==s&&(r*=100),e+"("+r+i+")"}const ge=/\b([a-z-]*)\(.*?\)/gu,ye={...gt,getAnimatableNone:t=>{const e=t.match(ge);return e?e.map(fe).join(" "):t}},ve={...gt,getAnimatableNone:t=>{const e=gt.parse(t);return gt.createTransformer(t)(e.map(t=>"number"==typeof t?0:"object"==typeof t?{...t,alpha:1}:t))}},be={...Y,transform:Math.round},Te={rotate:Q,pathRotation:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:_,scaleX:_,scaleY:_,scaleZ:_,skew:Q,skewX:Q,skewY:Q,distance:et,translateX:et,translateY:et,translateZ:et,x:et,y:et,z:et,perspective:et,transformPerspective:et,opacity:U,originX:it,originY:it,originZ:et},ke={borderWidth:et,borderTopWidth:et,borderRightWidth:et,borderBottomWidth:et,borderLeftWidth:et,borderRadius:et,borderTopLeftRadius:et,borderTopRightRadius:et,borderBottomRightRadius:et,borderBottomLeftRadius:et,width:et,maxWidth:et,height:et,maxHeight:et,top:et,right:et,bottom:et,left:et,inset:et,insetBlock:et,insetBlockStart:et,insetBlockEnd:et,insetInline:et,insetInlineStart:et,insetInlineEnd:et,padding:et,paddingTop:et,paddingRight:et,paddingBottom:et,paddingLeft:et,paddingBlock:et,paddingBlockStart:et,paddingBlockEnd:et,paddingInline:et,paddingInlineStart:et,paddingInlineEnd:et,margin:et,marginTop:et,marginRight:et,marginBottom:et,marginLeft:et,marginBlock:et,marginBlockStart:et,marginBlockEnd:et,marginInline:et,marginInlineStart:et,marginInlineEnd:et,fontSize:et,backgroundPositionX:et,backgroundPositionY:et,...Te,zIndex:be,fillOpacity:U,strokeOpacity:U,numOctaves:be},we={...ke,color:at,backgroundColor:at,outlineColor:at,fill:at,stroke:at,borderColor:at,borderTopColor:at,borderRightColor:at,borderBottomColor:at,borderLeftColor:at,filter:ye,WebkitFilter:ye,mask:ve,WebkitMask:ve},Me=new Set([ye,ve]);let Ae,Se,xe;function De(t,e){if(t===Ae&&e===Se)return xe;let s=(t=>we[t])(t);return Me.has(s)||(s=gt),xe=s.getAnimatableNone?s.getAnimatableNone(e):void 0,Ae=t,Se=e,xe}const Fe=t=>180*t/Math.PI,Re=t=>{const e=Fe(Math.atan2(t[1],t[0]));return Pe(e)},Ee={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:Re,rotateZ:Re,skewX:t=>Fe(Math.atan(t[1])),skewY:t=>Fe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Pe=t=>((t%=360)<0&&(t+=360),t),Ce=t=>Math.hypot(t[0],t[1]),Oe=t=>Math.hypot(t[4],t[5]),Ve={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ce,scaleY:Oe,scaleZ:t=>Math.hypot(t[8],t[9],t[10]),scale:t=>(Ce(t)+Oe(t))/2,rotateX:t=>Pe(Fe(Math.atan2(t[6],t[5]))),rotateY:t=>Pe(Fe(Math.atan2(-t[2],t[0]))),rotateZ:Re,rotate:Re,skewX:t=>Fe(Math.atan(t[4])),skewY:t=>Fe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ie(t){return t.includes("scale")?1:0}function Ke(t,e){if(!t||"none"===t)return Ie(e);const s=t.match(/^matrix(3d)?\(([-\d.e\s,]+)\)$/u);if(!s)return Ie(e);const n=(s[1]?Ve:Ee)[e],i=s[2].split(",").map(t=>parseFloat(t));return"function"==typeof n?n(i):i[n]}const We=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ne=(()=>new Set([...We,"pathRotation"]))(),je=t=>t===Y||t===et,Be=new Set(["x","y","z"]),Ye=We.filter(t=>!Be.has(t));const Ue=new Set(["bottom","right"]);function _e(t,e,s,n,i,r){const a=parseFloat(t);if(!isNaN(a))return a;const{min:o,max:h}=e()[s],u=h-o;return"border-box"===r?u:u-parseFloat(n)-parseFloat(i)}const $e=({transform:t})=>Ke(t,"x"),qe=({transform:t})=>Ke(t,"y"),Xe={width:({width:t,paddingLeft:e="0",paddingRight:s="0",boxSizing:n},i)=>_e(t,i,"x",e,s,n),height:({height:t,paddingTop:e="0",paddingBottom:s="0",boxSizing:n},i)=>_e(t,i,"y",e,s,n),top:({top:t})=>parseFloat(t),left:({left:t})=>parseFloat(t),bottom:({top:t},e)=>{const{y:s}=e();return parseFloat(t)+(s.max-s.min)},right:({left:t},e)=>{const{x:s}=e();return parseFloat(t)+(s.max-s.min)},x:$e,y:qe,translateX:$e,translateY:qe},ze=new Set;let Le=!1,Ze=!1,Je=!1;function Ge(){if(Ze){const t=[],e=new Set,s=new Set;ze.forEach(n=>{n.needsMeasurement&&(t.push(n),e.add(n.element),Ue.has(n.name)&&s.add(n.element))});const n=new Map;s.forEach(t=>{const e=function(t){const e=[];return Ye.forEach(s=>{const n=t.getValue(s);if(void 0!==n){const t=n.get(),i=s.startsWith("scale")?1:0;if(t===i)return;e.push([s,t]),n.set(i)}}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,s])=>{t.getValue(e)?.set(s)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}Ze=!1,Le=!1,ze.forEach(t=>t.complete(Je)),ze.clear()}function He(){ze.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Ze=!0)})}class Qe{constructor(t,e,s,n,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=n,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(ze.add(this),Le||(Le=!0,Vt.read(He),Vt.resolveKeyframes(Ge))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:i}=this;if(null===t[0]){const a=i?.get(),o=t[t.length-1];if(void 0!==a)t[0]=a;else if(s&&e){const i=function(t,e,s){if("string"==typeof t){if(n(t)||r(t))return parseFloat(t);if(!gt.test(t)&>.test(s))return De(e,s)}return t??void 0}(s.readValue(e,o),e,o);void 0!==i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===a&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ze.delete(this)}cancel(){"scheduled"===this.state&&(ze.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const ts=t=>t.startsWith("--");function es(t,e,s){ts(e)?t.style.setProperty(e,s):t.style[e]=s}const ss={};function ns(t,e){const s=function(t){let e;return()=>(void 0===e&&(e=t()),e)}(t);return()=>ss[e]??s()}const is=ns(()=>void 0!==window.ScrollTimeline,"scrollTimeline"),rs=ns(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),as=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,os={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:as([0,.65,.55,1]),circOut:as([.55,0,1,.45]),backIn:as([.31,.01,.66,-.59]),backOut:as([.33,1.53,.69,.99])};function hs(t,e){return t?"function"==typeof t?rs()?Wt(t,e):"ease-out":R(t)?as(t):Array.isArray(t)?t.map(t=>hs(t,e)||os.easeOut):os[t]:void 0}function us(t,e,s,{delay:n=0,duration:i=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:h}={},u=void 0){const l={[e]:s};h&&(l.offset=h);const c=hs(o,i);Array.isArray(c)&&(l.easing=c);const p={delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};return u&&(p.pseudoElement=u),t.animate(l,p)}function ls(t){return"function"==typeof t&&"applyToOptions"in t}class cs extends le{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:e,name:s,keyframes:n,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t;const h=function({type:t,...e}){return ls(t)&&rs()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=us(e,s,n,h,i),!1===h.autoplay&&this.animation.pause(),this.animation.onfinish=this.onFinish=()=>{if(this.animation.onfinish=null,this.finishedTime=this.time,!i){const t=ie(n,this.options,a,this.speed);this.updateMotionValue?.(t),es(e,s,t),this.animation.cancel()}o?.(),this.notifyFinished()},ue(this,t,h)}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 c(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+c(t)}get time(){return c(Number(this.animation.currentTime)||0)}set time(t){const e=null!==this.finishedTime;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=l(t),e&&(this.animation.pause(),this.updateFinished())}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,onAttach:e,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=this.onFinish=null,t&&is()?(this.animation.timeline=t,e?.(this.animation),a):s(this)}}const ps={anticipate:T,backInOut:b,circInOut:M};function ds(t){"string"==typeof t.ease&&t.ease in ps&&(t.ease=ps[t.ease])}class ms extends cs{constructor(t){ds(t),ae(t),super(t),void 0!==t.startTime&&!1!==t.autoplay&&(this.startTime=t.startTime),this.options=t}elapsed(){return"running"===this.state?(I.now()-this.startTime)*this.speed:1e3*this.time}sample(t){if(!this.sampler){const{motionValue:t,onUpdate:e,onComplete:s,onPlay:n,onStop:i,element:r,...a}=this.options;this.sampler=new de({...a,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:s,element:n,name:i}=this.options;if(!s)return;if(void 0!==t)return void s.set(t);const{speed:r}=this,a=this.elapsed(),o="running"===this.state&&r?e(0,10,a):0,h=this.sample(a);n&&i&&es(n,i,h),s.setWithVelocity(this.sample(a-o*Math.sign(r)),h,o/Math.abs(r||1))}}const fs=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!gt.test(t)&&"0"!==t||t.startsWith("url(")));function gs(t){t.duration=0,t.type="keyframes"}const ys=new Set(["opacity","clipPath","filter","transform"]),vs=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;const bs=({mixer:t,keyframes:e})=>t&&"number"!=typeof e[0]&&e.some((s,n)=>n&&t(e[n-1],s)),Ts=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),ks=()=>!s.useManualTiming&&Object.hasOwnProperty.call(Element.prototype,"animate");function ws(t){const{motionValue:e,name:s,repeatDelay:n,repeatType:i,damping:r,type:a,keyframes:o}=t;if(!s||!ys.has(s)&&!Ts.has(s))return!1;const h=e?.owner?.current;if(!(h instanceof HTMLElement||h instanceof SVGElement))return!1;const{onUpdate:u,transformTemplate:l}=e.owner.getProps();return ks()&&(ys.has(s)||Ts.has(s)&&function(t){for(let e=0;e<t.length;e++)if("string"==typeof t[e]&&vs.test(t[e]))return!0;return!1}(o))&&("transform"!==s||!l)&&!u&&!n&&"mirror"!==i&&0!==r&&"inertia"!==a&&!bs(t)}const Ms=(t,e)=>e&&"number"==typeof t?e.transform(t):t,As={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};We.length;const Ss={},xs=(t,e,s=Ms(e,Te[t]))=>(Ss[t]||(Ss[t]=(As[t]||t)+"("))+s+")",Ds=(t,e)=>("number"==typeof e?e:parseFloat(e))===(t.startsWith("scale")?1:0),Fs=new WeakMap,Rs=.001,Es=100,Ps=new Set(["linear","easeIn","easeOut","easeInOut"]),Cs=new WeakMap,Os=(t,e)=>Math.min(200,Math.max(2,Math.ceil((e-t)/10))),Vs=(t,e)=>Math.abs(t-e)<=.001,Is=(t,e)=>t-e,Ks=(t,e,s)=>ee(Array(s+1)).map(s=>bt(t,e,s)),Ws=t=>t.motionValue.owner,Ns=t=>Fs.get(t),js=({state:t})=>"idle"===t||"finished"===t,Bs=(t,e)=>t.latestValues?t.latestValues[e]:t.getValue(e)?.get();class Ys{constructor(t,e,s,n){this.element=t,this.update=e,this.makeDriver=s,this.animation=n}get js(){return this.driver||(this.driver=this.makeDriver(this.update))}now(){return this.driver||this.makeDriver!==Kt?this.js.now():C.isProcessing?C.timestamp:I.now()}start(t=!0){const e=Ns(this.element);!e||e.isJS?this.js.start(t):e.schedule(!1,!t)}stopJS(){this.driver?.stop()}stop(){this.stopJS();const t=Ns(this.element);t&&!t.isFinishing&&t.release(this.animation)}}let Us,_s;class $s extends de{constructor(t){const e=Ws(t).current,{driver:s=Kt}=t;let n;const i=function(t){const e=Ws(t),{onUpdate:s,transformTemplate:n}=e.getProps();return!(t.isHandoff||s||t.hasOnUpdate||n||"inertia"===t.type||"none"!==(Bs(e,"transform")||"none")||Bs(e,"pathRotation")||e.projection?.isProjecting()||bs(t))}(t);t.driver=t=>new Ys(e,t,s,n),super(t),n=this;const r=this.driver;r&&(r.animation=this),this.canAccelerate=i;const{stop:a}=this;this.stop=()=>{this.isAccelerated()&&this.sync(),a()}}offsets(){const{keyframes:t,times:e}=this.options;return e||(this.offsetsOf!==t&&(this.offsetsOf=t,this.cachedOffsets=ee(t)),this.cachedOffsets)}get group(){return Ns(Ws(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:s}=this,{delay:n=0,repeatType:i}=this.options;return null!==this.holdTime?[1/0,0]:s===1/0?[t+n/e,this.resolvedDuration*("loop"===i?1:2)/e||1]:[t+(n+s)/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(I.now()):void 0}tween(){const{keyframes:t,type:e,repeat:s,delay:n=0}=this.options;let i=-1;if(s||e!==se||null!==this.holdTime)return;for(let e=1;e<t.length;e++)if(t[e]!==t[e-1]){if(i>=0)return;i=e-1}let{ease:r}=this.options;D(r)&&(r=r[i]);const a=this.offsets(),o=t=>this.startTime+(n+a[t]*this.totalDuration)/this.speed;if(i>=0){const t=R(r)?as(r):(t=>Ps.has(t))(r)?os[r]:P(r);return[o(i),o(i+1),"string"==typeof t||Vs(t(0),0)&&Vs(t(1),1)?t:void 0]}}boundaries(t,e){const{startTime:s,speed:n,resolvedDuration:i,options:r}=this,{delay:a=0,repeat:o=0,repeatDelay:h=0,repeatType:u,type:l}=r,c=(l||se)===se?this.offsets():[0,1],p=s+a/n,d=[];if(null!==this.holdTime||!(i>0))return d;for(let s=Math.max(0,Math.floor((t-p)*n/i));s<=o;s++){const r=p+s*i/n;if(r>e)break;for(const a of c){const o=r+(s%2&&u&&"loop"!==u?1-a:a)*(i-h)/n;o>t&&o<e&&d.push(o)}}return d}numberAt(t){return parseFloat(this.sampleAt(t,!0))}sync(){const t=I.now(),e=this.sampleAt(t,!0);this.options.motionValue.setWithVelocity(null===this.holdTime?this.sampleAt(t-10,!0):e,e,10)}play(){this.isStopped||((this.group||function(t){const e=t.current,s=new Set,n=new Map;let i,r,a={},o=[],u=new Map,l=[],c=!1,p=!1,d=!1,m=!1,f=-1/0,g=1/0;const y=t=>{for(const e of s)if(e.name===t)return!0},v=(e,s)=>{const i={};for(const r of void 0===e?We:o){const o=n.get(r),h=void 0===e?Bs(t,r):o?o.sampleAt(s>e&&!o.timing()[1]?s:e):a[r];void 0!==h&&(i[r]=h)}return i},b=(t,e)=>{let s="";for(const n in t){const i=t[n];e&&Ds(n,i)||(s+=xs(n,i)+" ")}return(e?s.trim():s)||"none"},T=(t,e)=>b(v(t,e)),k=(t=v())=>{e.style.transform=b(t,!0)},w=t=>{t.onfinish=t.oncancel=null,t.cancel()},M=(t=!0)=>{clearTimeout(i),g=1/0,r=void 0,t&&k(),l.forEach(({animation:t})=>w(t)),l=[]},A=(t,s)=>new Animation(new KeyframeEffect(e,t,s)),S=(t,e,s=1/0)=>{const n={animation:t,offset:e,end:s};t.startTime=I.now()+e,s<1/0&&(t.onfinish=()=>{n.isDone=!0,l.some(t=>t.end===1/0)&&(w(t),l=l.filter(t=>t!==n)),N.schedule(!1)}),t.oncancel=()=>l.includes(n)&&N.demote(),l.push(n)},x=(t,e,s)=>{const n=(e,s)=>Math.abs(t(s)-t(e)),i=n(e,s);for(;s-e>.01;){const t=(e+s)/2;n(e,t)>n(t,s)?s=t:e=t}return n(e,s)>i/2?[e,s]:[]},D=(t,e,s,n)=>{const i=Os(e,s);if(4*n.length>i)return;let r;for(const n of t){const t=n.numberAt(e),i=(n.numberAt((e+s)/2)-t)/(n.numberAt(s)-t);if(i==i)if(void 0===r)r=i;else if(!Vs(i,r))return}const a=Ks(e,s,i).concat(n).sort(Is),o=t=>h(e,s,t);let u,l;for(const s of t){const t=s.numberAt(e),n=a.map(e=>s.numberAt(e)-t),i=n[n.length-1],r=n.some(t=>Math.abs(t)*Rs>Math.abs(i))?0:i,o=n.map(t=>r?t/r:t);if(r&&!u)u=o,l=e=>(s.numberAt(e)-t)/r;else if(o.some((t,e)=>!Vs(t,r&&u[e])))return}if(!u||u.every((t,e)=>Vs(t,o(a[e]))))return"linear";const c=[],p=(t,e=l(t))=>c.push(pe(e)+" "+pe(100*o(t))+"%");return u.forEach((t,e)=>{e&&Math.abs(t-u[e-1])>.2&&x(l,a[e-1],a[e]).forEach(t=>p(t)),p(a[e],t)}),"linear("+c+")"},F=(t,e,s,n)=>{const i=[e],r=[];let a=s,o=e;for(const n of t){const t=n.tween();if("linear"!==t?.[2]){const[i,h]=n.timing(),[u,l]=t||[e,h?s:i];a=Math.min(a,u),o=Math.max(o,l),r.push(n)}}a=Math.max(e,a),o=Math.min(s,o);const h=(t,e)=>r.every(s=>!(Math.abs(s.numberAt((t+e)/2)-(s.numberAt(t)+s.numberAt(e))/2)>(s.name.startsWith("scale")?.001:.1))),u=(e,s,n)=>{if(s-e<1||h(e,s))i.push(s);else if(n<4)u(e,(e+s)/2,n+1),u((e+s)/2,s,n+1);else{for(const n of t)i.push(...x(t=>n.numberAt(t),e,s));i.push(s)}},l=o>a?Ks(a,o,Math.ceil((o-a)/100)):[];l.push(s);for(const t of n)l.push(t,Math.min(t+.01,s));let c=e;for(const t of l.sort(Is))t>c&&u(c,t,0),c=t;return i.sort(Is)},R=t=>{let e;for(const s of t){const t=s.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},E=(t,e,s,n,i={fill:"both"},r)=>{const a=n?[]:t.flatMap(t=>t.boundaries(e,s)),o=n||D(t,e,s,a),u=o?[e,s]:F(t,e,s,a),l=u.map(t=>T(t,r));let c={transform:l};return o||(c.offset=u.map(t=>h(e,s,t))),l.every(t=>t===l[0])&&(k(v(e,r)),c=null),A(c,{...i,duration:s-e,easing:o||"linear"})},P=t=>{const e=I.now()+t;e<g&&(clearTimeout(i),g=e,i=setTimeout(()=>{g=1/0,N.schedule(!1)},t))},O=e=>{let i=e,h=0,c=0;const p=[],d=[],m=new Set;n.clear(),u=new Map;for(const t of s){n.set(t.name,t);const[s,r]=t.timing(),a=s===1/0;if(u.set(t,[t.at(e),t.speed,a]),!a){if(t.speed<0)return;if(r){if(h){const t=(s-c)/r;if(Math.abs(r-h)>1||Math.abs(t-Math.round(t))*h>1)return}else h=r,c=s;d.push(t)}else m.add(s);p.push(t),i=Math.max(i,s)}}a={},o=We.filter(e=>{if(n.has(e))return!0;const s=a[e]=Bs(t,e);return void 0!==s&&!Ds(e,s)}),M(!1);const f=!h&&R(p);try{if(i>e){let t;if(f&&f[1]>e){const[s,n,a]=f;if(s-e>Es)return p.forEach(t=>t.sync()),P(r=s-e-Es),!0;t="string"==typeof a?a:a?((t,e)=>{let s=Cs.get(t);return s?.[0]!==e&&(s=[e,"linear("+ee(Array(e+1)).map(e=>pe(t(e))+" "+pe(100*e)+"%")+")"],Cs.set(t,s)),s[1]})(a,Os(s,n)):D(p,s,n,[]),t&&S(E(p,s,n,t,{fill:"both",endDelay:i-n}),s-e,i-s)}t||S(E(p,e,i),0,i-e),m.forEach(t=>t<i-1&&S(A(null,{duration:t-e}),0,t-e))}if(h){const t=c+Math.floor((i-c)/h)*h;S(E(d,t,t+h,void 0,{iterations:1/0,iterationStart:(i-t)/h,fill:"forwards"},i),i-e)}}catch{return}return l.length||M(),!0},V=(t,e)=>{let n,i=0;for(const e of s){const s=u.get(e);if(!s)return!1;const[r,a,o]=s,h=e.at(t),c=e.timing()[0]===1/0;if(o){if(c&&(h===r||!l.length))continue;return!1}const p=(h-r)/a,d=c?0:e.speed/a;if(void 0===n)n=p,i=d;else if(Math.abs(p-n)>1||d!==i)return!1}if(void 0===n)return!0;if(!l.length){if(void 0===r||e&&i)return!1;if(i){const t=(r-n)/i;if(t<1)return!1;P(t)}return!0}for(const{offset:t,end:s,isDone:i}of l){const r=n-t;if(s<1/0&&(i?r<s-1:r<0&&(e||t<=0)||r>=s))return!1}for(const{animation:e,offset:s,isDone:r}of l){if(r)continue;const a=n-s;i&&e.updatePlaybackRate&&"running"===e.playState&&Math.abs(Number(e.currentTime)-a)<20?e.playbackRate!==i&&e.updatePlaybackRate(i):i?(e.playbackRate!==i&&(e.playbackRate=i),e.startTime=t-a/i):(e.startTime=null,e.currentTime=a)}return!0},K=()=>!s.size&&(d=!0,Ns(e)===N&&Fs.delete(e),N.isJS||M(),!0),W=()=>{const e=I.now();if(N.isJS||(N.isFinishing=!0,s.forEach(s=>{const[n,i]=s.timing();"running"===s.state&&s.speed>0&&!i&&n<=e+1&&(s.complete(),a[s.name]=Bs(t,s.name),u.has(s)||(c=!0))}),N.isFinishing=!1),p=!1,d)return;if(s.forEach(t=>js(t)&&s.delete(t)),K())return;for(const t of s)if(!t.canAccelerate)return N.demote(!0);N.isJS&&(N.isJS=!1,c=!0,s.forEach(t=>t.stopJS()));const n=c,i=m;if(c=m=!1,n||!V(e,i)){if(i){if(e-f<100)return N.demote();f=e}if(!O(e))return N.demote()}else if(void 0!==r&&!i)return;s.forEach(t=>t.timing()[0]===1/0&&t.sync())},N={tracks:s,isJS:!1,isFinishing:!1,schedule(t,e){d||(c||(c=t),m||(m=!!e),p||(p=!0,C.isProcessing?Vt.render(W,!1,!0):qs(W)))},release(t){js(t)&&s.delete(t),K()||N.schedule(!0)},check(){if(!N.isJS)for(const e in a)if(Bs(t,e)!==a[e]&&!y(e))return N.schedule(!0,!0)},demote(t){if(!N.isJS&&!d)return s.forEach(e=>{e.isAccelerated()&&e.sync(),t||(e.canAccelerate=!1)}),N.isJS=!0,u=new Map,M(),s.forEach(t=>"running"===t.state&&t.js?.start()),!0}};return Fs.set(e,N),N}(Ws(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(I.now())}get time(){return this.isAccelerated()?c(e(0,this.totalDuration,this.at(I.now())-(this.options.delay||0))):super.time}set time(t){(Us??(Us=Object.getOwnPropertyDescriptor(de.prototype,"time").set)).call(this,t)}attachTimeline(t){return this.canAccelerate=!1,this.group?.demote(!0),super.attachTimeline(t)}}const qs=t=>{_s||queueMicrotask(()=>{const t=_s;_s=void 0,t.forEach(t=>t())}),(_s||(_s=[])).push(t)};class Xs extends le{constructor(t){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=I.now();const{keyframes:e,name:s,motionValue:n,element:i}=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=i?.KeyframeResolver||Qe;this.keyframeResolver=new a(e,(t,e,s)=>this.onKeyframesResolved(t,e,r,!s),s,n,i),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:r,type:a,velocity:o,delay:h,isHandoff:u,onUpdate:l}=n;this.resolvedAt=I.now();const c=function(t,e,s,n){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],a=fs(i,e),o=fs(r,e);return!(!a||!o)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}(t)||("spring"===s||ls(s))&&n)}(t,r,a,o);c||(!s.instantAnimations&&h||l?.(ie(t,n,e)),t[0]=t[t.length-1],gs(n),n.repeat=0);const{onComplete:p}=n;n.finalKeyframe=e,n.keyframes=t,n.onComplete=()=>{p?.(),this.notifyFinished()};const d=c&&!u&&ws(n),m=!d&&(({name:t,motionValue:e})=>t&&We.includes(t)&&e?.owner?.current instanceof HTMLElement&&ks()&&rs())(n);let f;if(i&&(d||m||this.resolvedAt!==this.createdAt)&&(n.startTime??(n.startTime=oe(this.createdAt,this.resolvedAt))),d){n.element=n.motionValue?.owner?.current;try{f=new ms(n)}catch{f=new de(n)}}else f=m?new $s(n):new de(n);this.pendingTimeline&&(this.stopTimeline=f.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=f}get finished(){return this._animation?this._animation.finished:super.finished}then(t,e){return this.finished.finally(t).then(()=>{})}liveValue(){return this._animation?.liveValue?.()}get animation(){return this._animation||(this.keyframeResolver?.resume(),Je=!0,He(),Ge(),Je=!1),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation?.cancel(),this.keyframeResolver?.cancel()}}class zs{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 Ls(this.animations,"duration")}get iterationDuration(){return Ls(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 Ls(t,e){let s=0;for(let n=0;n<t.length;n++){const i=t[n][e];null!==i&&i>s&&(s=i)}return s}class Zs extends zs{then(t,e){return this.finished.finally(t).then(()=>{})}}class Js{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=t=>{const e=I.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=I.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){var s;return"change"===t?this.onChangeSubscribe(e):((s=this.events)[t]||(s[t]=new u)).add(e)}onChangeSubscribe(t){const{events:e}=this;return e.change||this.changeSubscriber?(e.change||(e.change=new u,e.change.add(this.changeSubscriber),this.changeSubscriber=void 0),e.change.add(t)):this.changeSubscriber=t,()=>{this.changeSubscriber===t?this.changeSubscriber=void 0:e.change?.remove(t),this.stopIfUnobserved()}}stopIfUnobserved(){Vt.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,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){e&&(this.updatedAt=I.now(),this.stop()),this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stopPassiveEffect?.()}dirty(){const{current:t,changeSubscriber:e}=this;e?e(t):this.events.change?.notify(t)}addDependent(t){(this.dependents||(this.dependents=new Set)).add(t)}removeDependent(t){this.dependents?.delete(t)}get(){const t=this.animation?.liveValue?.();return void 0===t?this.current:t}getCurrent(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=I.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return p(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return new Promise(e=>this.run(t,e))}run(t,e){this.stop(),this.hasAnimated=!0;let s,n=!1;s=t(()=>{n=!0,this.events.animationComplete?.notify(),this.animation===s&&(this.animation=void 0),e?.()}),n||(this.animation=s),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 Gs(t,e){return new Js(t,e)}const Hs={type:"spring",stiffness:500,damping:25,restSpeed:10},Qs={type:"keyframes",duration:.8},tn={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},en=(t,{keyframes:e})=>e.length>2?Qs:Ne.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Hs:tn,sn=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed","out","mixer"]);const nn=(t,e,n,i={},r,a)=>a=>{const o=function(t,e){const s=t?.[e]??t?.default??t;return s!==t?function(t,e){if(t?.inherit&&e){const{inherit:s,...n}=t;return{...e,...n}}return t}(s,t):s}(i,t)||{},h=o.delay||i.delay||0;let{elapsed:u=0}=i;u-=l(h);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:r,hasOnUpdate:!!o.onUpdate};(function(t){for(const e in t)if(!sn.has(e))return!0;return!1})(o)||Object.assign(c,en(t,c)),c.duration&&(c.duration=l(c.duration)),c.repeatDelay&&(c.repeatDelay=l(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let p=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(gs(c),0===c.delay&&(p=!0)),(s.instantAnimations||s.skipAnimations||r?.shouldSkipAnimations||o.skipAnimations)&&(p=!0,gs(c),c.delay=0),c.allowFlatten=!o.type&&!o.ease,p&&void 0!==e.get()){const t=ie(c.keyframes,o);if(void 0!==t)return void Vt.update(()=>{c.onUpdate(t),c.onComplete()})}return o.isSync?new de(c):new Xs(c)},rn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function an(t,e,s=1){const[i,r]=function(t){const e=rn.exec(t);if(!e)return[,];const[,s,n,i]=e;return[`--${s??n}`,i]}(t);if(!i)return;const a=window.getComputedStyle(e).getPropertyValue(i);if(a){const t=a.trim();return n(t)?parseFloat(t):t}return N(r)?an(r,e,s+1):r}const on=new Set(["width","height","top","left","right","bottom",...We]),hn=t=>Boolean(t&&t.getVelocity),un=[Y,et,tt,Q,nt,st,{test:t=>"auto"===t,parse:t=>t}],ln=t=>un.find((t=>e=>e.test(t))(t));function cn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||r(t))}const pn=new Set(["auto","none","0"]);class dn extends Qe{constructor(t,e,s,n,i){super(t,e,s,n,i,!0)}scheduleResolve(){if(this.canReadNow()&&(this.readKeyframes(),!this.needsMeasurement))return this.complete();super.scheduleResolve()}canReadNow(){const{unresolvedKeyframes:t,element:e,motionValue:s}=this,n=t[0]??s?.get();if(!e?.current||void 0===n)return!1;for(let e=0;e<t.length;e++)if(B(e?t[e]:n))return!1;return!0}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:s}=this;if(!e?.current)return;super.readKeyframes();for(let s=0;s<t.length;s++){let n=t[s];if("string"==typeof n&&(n=n.trim(),N(n))){const i=an(n,e.current);void 0!==i&&(t[s]=i),s===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!on.has(s)||2!==t.length)return;const[n,i]=t;if("number"==typeof n&&"number"==typeof i)return;const r=ln(n),a=ln(i);if(B(n)!==B(i)&&Xe[s])this.needsMeasurement=!0;else if(r!==a)if(je(r)&&je(a))for(let e=0;e<t.length;e++){const s=t[e];"string"==typeof s&&(t[e]=parseFloat(s))}else Xe[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,s=[];for(let e=0;e<t.length;e++)(null===t[e]||cn(t[e]))&&s.push(e);s.length&&function(t,e,s){let n,i=0;for(;i<t.length&&!n;){const e=t[i];"string"==typeof e&&!pn.has(e)&&pt(e)&&(n=t[i]),i++}if(n&&s)for(const i of e)t[i]!==n&&(t[i]=De(s,n))}(t,s,e)}measure(){const{element:t,name:e}=this;return Xe[e](window.getComputedStyle(t.current),()=>t.measureViewportBox())}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:s}=this;if(!t?.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),e[0]=this.measuredOrigin;const n=e[e.length-1];void 0!==n&&this.motionValue?.jump(n,!1)}measureEndState(){const{element:t,unresolvedKeyframes:e}=this;if(!t?.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const s=e.length-1,n=e[s];e[s]=this.measure(),null!==n&&void 0===this.finalKeyframe&&(this.finalKeyframe=n),this.resolveNoneKeyframes()}}const mn=[];function fn(e){t(mn,e)}function gn(t){return mn.find(e=>e.test(t))}function yn(t,e,s={},n){const i=[],{velocity:r,path:a}=s,o=s.reduceMotion??n?.shouldReduceMotion;a?.animateValues&&n&&(e={...e},a.animateValues(t,e,s,0,i));for(const a in e){if("transition"===a||"transitionEnd"===a)continue;const h=e[a];if(void 0===h)continue;const u=t(a),l=u.get();void 0===l||u.isAnimating()||Array.isArray(h)||h!==l||r?(u.run(nn(a,u,h,o&&on.has(a)?{type:!1}:s,n)),u.animation&&i.push(u.animation)):Vt.update(()=>u.set(h))}const{transitionEnd:h}=e;if(h){const e=()=>Vt.update(()=>{for(const e in h)t(e).set(h[e])});i.length?Promise.all(i).then(e):e()}return i}function vn(t,e,s,n,i){let r,a=!1;const o=yn(n=>{let o=r?.[n]??t.get(e,n);if(!o){let h;if(!i){const i=s[n];h=function(t){const e=Array.isArray(t)?t[0]:void 0;return null===e?void 0:e}(i)??t.read(e,n,i)}o=Gs(h,{owner:i}),a?t(e,{[n]:o}):(r||(r={}))[n]=o}return o},s,n,i);return a=!0,r&&t(e,r),o}function bn(t){return i(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}function Tn(t){return i(t)&&"ownerSVGElement"in t}const kn={};class wn{constructor(t=Vt.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 s=0;s<e;s++)t[s]()}}set(t,e,s,n){if(this.values.get(t)?.onRemove(),n)for(const t of this.values.values())t.value===n&&(s=t.render);const i=()=>s&&this.schedule(s);void 0!==e.get()&&i();const r=e.on("change",i),a=()=>{r(),s&&!n&&this.cancel(s),this.values.get(t)?.onRemove===a&&this.values.delete(t)};return this.values.set(t,{value:e,render:n?void 0:s,onRemove:a}),a}get(t){return this.values.get(t)?.value}release(){const t=new Map;return this.values.forEach((e,s)=>{t.set(s,e.value),e.onRemove()}),this.transformKeys=this.transformValues=void 0,t}schedule(t){const{pending:e,numPending:s}=this;for(let n=0;n<s;n++)if(e[n]===t)return;s||this.step(this.flush),e[this.numPending++]=t}cancel(t){const{pending:e}=this;for(let s=0;s<this.numPending;s++)if(e[s]===t)return void(e[s]=e[--this.numPending])}}function Mn(t,{step:e,...s}={}){const n=new WeakMap;return Object.assign((s,i)=>{const r=n.get(s)??new wn(e);n.set(s,r);const a=[];for(const e in i){const n=i[e],o=t(s,r,e,n);a.push(o)}return()=>{for(const t of a)t()}},s,{get:(t,e)=>n.get(t)?.get(e),flush:t=>n.get(t)?.flush(),state:t=>n.get(t)})}const An=new Set(["originX","originY","originZ"]),Sn=(t,e)=>Ms(t.get(e)?.get(),ke[e]),xn=(t,e,s,n)=>{let i,r;if(Ne.has(s)){if("pathRotation"!==s){const t=e.transformKeys??(e.transformKeys=[]);(e.transformValues??(e.transformValues={}))[s]=n,t.includes(s)||(t.push(s),t.sort((t,e)=>We.indexOf(t)-We.indexOf(e)))}e.get("transform")||(bn(t)||e.get("transformBox")||xn(t,e,"transformBox",new Js("fill-box")),e.set("transform",new Js("none"),()=>{Fs.get(t)?.check(),t.style.transform=function(t){let e="";const{transformKeys:s=[],transformValues:n={}}=t;for(let t=0;t<s.length;t++){const i=s[t],r=n[i].getCurrent();void 0!==r&&(Ds(i,r)||(e+=(e&&" ")+xs(i,r)))}const i=t.get("pathRotation")?.get();return i&&(e+=(e&&" ")+xs("rotate",i)),e||"none"}(e)})),r=e.get("transform")}else An.has(s)?(e.get("transformOrigin")||e.set("transformOrigin",new Js(""),()=>{const s=Sn(e,"originX")??"50%",n=Sn(e,"originY")??"50%",i=Sn(e,"originZ")??0;t.style.transformOrigin=`${s} ${n} ${i}`}),r=e.get("transformOrigin")):i=ts(s)?()=>{t.style.setProperty(s,n.getCurrent())}:()=>{t.style[s]=Ms(n.getCurrent(),ke[s])};return e.set(s,n,i,r)},Dn=(t,e)=>{if(Ne.has(e))return((t,e)=>{const{transform:s="none"}=getComputedStyle(t);return Ke(s,e)})(t,e);const s=getComputedStyle(t),n=ts(e)?s.getPropertyValue(e):s[e];return"string"==typeof n&&n.trim()||0},Fn=Mn(xn,{test:t=>bn(t)||Tn(t),read:Dn});function Rn(t){return t.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const En=["transform","opacity","clipPath","filter","offsetDistance","offsetPath","offsetRotate","offsetAnchor"];const Pn=(t,e,s,n,i=s)=>{const r=function(t,e){if(!(e in t))return!1;const s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),e)||Object.getOwnPropertyDescriptor(t,e);return s&&"function"==typeof s.set}(t,i);r||!i.startsWith("data")&&!i.startsWith("aria")||(i=Rn(i));const a=ke[s]||ke[i],o=r?()=>{t[i]=Ms(n.get(),ke[s])}:()=>{const e=Ms(n.get(),a);null==e?t.removeAttribute(i):t.setAttribute(i,String(e))};return e.set(s,n,o)};const Cn=Mn((t,e,s,n)=>{if(s.startsWith("path")&&!Ne.has(s))return function(t,e,s,n){return Vt.render(()=>t.setAttribute("pathLength","1")),"pathOffset"===s?e.set(s,n,()=>{const e=n.get();t.setAttribute("stroke-dashoffset",""+-e)}):(e.get("stroke-dasharray")||e.set("stroke-dasharray",new Js("1 1"),()=>{const s=e.get("pathLength")?.get()??1,n=e.get("pathSpacing")?.get();t.setAttribute("stroke-dasharray",`${s} ${n??1-Number(s)}`)}),e.set(s,n,void 0,e.get("stroke-dasharray")))}(t,e,s,n);if(s.startsWith("attr"))return Pn(t,e,s,n,On(s));if("d"===s)return e.set(s,n,()=>{const e=n.get()?.replace(/path\(|["')]/g,"");void 0===e?t.removeAttribute(s):t.setAttribute(s,e)});return(Ne.has(s)||An.has(s)||ts(s)||s in t.style?xn:Pn)(t,e,s,n)},{test:Tn,read:(t,e)=>Ne.has(e)?ke[e]?.default||0:ts(e)||En.includes(e)?Dn(t,e)||t.getAttribute(Rn(e))||0:(e=On(e),t.getAttribute(Rn(e))??t.getAttribute(e)??void 0)});function On(t){return t.replace(/^attr([A-Z])/,(t,e)=>e.toLowerCase())}const Vn={};class In{constructor(t,e){this.effect=t,this.current=e,this.KeyframeResolver=dn}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 function({top:t,left:e,right:s,bottom:n}){return{x:{min:e,max:s},y:{min:t,max:n}}}(this.current.getBoundingClientRect())}getProps(){return Vn}}function Kn(t,e,s,n){if(kn.current?.track(t),n)return yn(t=>n.getValue(t,null),e,s,n);const i=(t=>Tn(t)?Cn:Fn)(t);return vn(i,t,e,s,new In(i,t))}const Wn=Mn((t,e,s,n)=>e.set(s,n,()=>{t[s]=n.get()}),{test:t=>i(t),read:(t,e)=>{const s=t[e];return"string"==typeof s||"number"==typeof s?s:void 0}});function Nn(t,e,s){const n=hn(t)?t:Gs(t);return n.run(nn("",n,e,s)),n.animation}const jn=new WeakMap;function Bn(t){return"object"==typeof t&&!Array.isArray(t)}function Yn(t,e,s,n){return null==t?[]:"string"==typeof t&&Bn(e)?function(t,e,s){if(null==t)return[];if(t instanceof EventTarget)return[t];if("string"==typeof t){const n=e?e.current:kn.current?.root||document,i=s?.[t]??n.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t).filter(t=>null!=t)}(t,s,n):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(t=>null!=t):[t]}function Un(t,e,s){return t*(e+1)+s*e}function _n(t,e){if(e.has(t))return e.get(t);const[,s,n]=t.match(/^(.+?)([+-][\d.]+)$/)||[];return e.has(s)?Math.max(0,e.get(s)+parseFloat(n)):void 0}function $n(e,s,n,i,r,a){!function(e,s,n){for(let i=0;i<e.length;i++){const r=e[i];r.at>s&&r.at<n&&(t(e,r),i--)}}(e,r,a);for(let t=0;t<s.length;t++)e.push({value:s[t],at:bt(r,a,i[t]),easing:F(n,t)})}function qn(t,e,s=0){const n=e+1+e*s;for(let e=0;e<t.length;e++)t[e]=t[e]/n}function Xn(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function zn(t,{defaultTransition:e={},...s}={},n,i,r){const a=e.duration||.3,o=new Map,u=new Map,c={},p=new Map;let d=0,m=0,f=0;const y=(t,s)=>{let r=s;const o=t=>{return"number"==typeof t?s+t:(e=m,i=d,r=p,"number"==typeof(n=t)?n:n.startsWith("-")||n.startsWith("+")?Math.max(0,e+parseFloat(n)):"<"===n?i:n.startsWith("<")?Math.max(0,i+parseFloat(n.slice(1))):_n(n,r)??e);var e,n,i,r};for(let s=0;s<t.length;s++){const h=t[s];if("string"==typeof h){p.set(h,m);continue}if(!Array.isArray(h)){const t=void 0===h.at?m:o(h.at);"sequence"in h?(d=m=t,m=y(h.sequence,t),d=t,r=Math.max(r,m)):p.set(h.name,t);continue}let[v,b,T={}]=h;void 0!==T.at&&(m=o(T.at));let k=0;const w=(t,s,n,r=0,o=0)=>{const h=Jn(t),{delay:u=0,times:c=ee(h),type:p=e.type||"keyframes",repeat:d,repeatType:y,repeatDelay:v=0,...b}=s;let{ease:T=e.ease||"easeOut",duration:w}=s;n.mixer||(n.mixer=s.mixer);const M="function"==typeof u?u(r,o):u,A=h.length,S=ls(p)?p:i?.[p||"keyframes"];if(A<=2&&S){let t=100;if(2===A&&Qn(h)){const e=h[1]-h[0];t=Math.abs(e)}const s={...e,...b};void 0!==w&&(s.duration=l(w));const n=Bt(s,t,S);T=n.ease,w=n.duration}w??(w=a);const x=m+M;1===c.length&&0===c[0]&&(c[1]=1);const D=c.length-h.length;if(D>0&&te(c,D),1===h.length&&h.unshift(null),d&&d<20){const t=w>0?v/w:0;w=Un(w,d,v);const e=[...h],s=[...c];T=Array.isArray(T)?[...T]:[T];const n=[...T],i="reverse"===y||"mirror"===y;let r=e,a=n;i&&(r=[...e].reverse(),"reverse"===y&&(a=[...n].reverse().map(t=>"function"==typeof t?g(t):t)));for(let o=0;o<d;o++){const u=i&&o%2==0,l=u?r:e,p=u?a:n,d=(o+1)*(1+t);t>0&&(h.push(h[h.length-1]),c.push(d),T.push("linear")),h.push(...l);for(let t=0;t<l.length;t++)c.push(s[t]+d),T.push(0===t?"linear":F(p,t-1))}qn(c,d,t)}const R=x+w;$n(n,h,T,c,x,R),k=Math.max(M+w,k),f=Math.max(R,f)};if(hn(v)){w(b,T,Zn("default",Ln(v,u)))}else{const t=Yn(v,b,n,c),e=t.length;for(let s=0;s<e;s++){const n=Ln(t[s],u);for(const t in b)w(b[t],Gn(T,t),Zn(t,n),s,e)}}d=m,m+=k,r=Math.max(r,m)}return r};y(t,0),r&&(r.duration=f,r.labels=p);const{type:v,...b}=e;return u.forEach((t,n)=>{for(const i in t){const r=t[i];r.sort(Xn);const a=[],u=[],l=[];for(let t=0;t<r.length;t++){const{at:e,value:s,easing:n}=r[t];a.push(s),u.push(h(0,f,e)),l.push(n||"easeOut")}0!==u[0]&&(u.unshift(0),a.unshift(a[0]),l.unshift("easeInOut")),1!==u[u.length-1]&&(u.push(1),a.push(null)),o.has(n)||o.set(n,{keyframes:{},transition:{}});const c=o.get(n);c.keyframes[i]=a,c.transition[i]={...b,duration:f,ease:l,times:u,mixer:r.mixer||e.mixer,...s}}}),o}function Ln(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function Zn(t,e){return e[t]||(e[t]=[]),e[t]}function Jn(t){return Array.isArray(t)?t:[t]}function Gn(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Hn=t=>"number"==typeof t,Qn=t=>t.every(Hn);function ti(t,e,s,n){const i=[];if(function(t,e){return hn(t)||"number"==typeof t||"string"==typeof t&&!Bn(e)}(t,e))i.push(Nn(t,Bn(e)&&e.default||e,s&&s.default||s));else{if(null==t)return i;const r=Yn(t,e,n),a=r.length;for(let t=0;t<a;t++){const n=r[t],o={...s};"delay"in o&&"function"==typeof o.delay&&(o.delay=o.delay(t,a)),n instanceof Element?i.push(...Kn(n,e,o,jn.get(n))):i.push(...vn(gn(n)??Wn,n,e,o))}}return i}let ei=0;function si({repeat:t=0,repeatDelay:e=0,repeatType:s="loop",delay:n=0},i,r,a){const o=i+e,h=void 0===a;if(h){const e=Math.max(0,r-n);a=o&&e>0?Math.min(t,Math.ceil(e/o-1e-9)-1):0,r=Math.min(e-a*o,i)}return"loop"!==s&&a%2&&(r=i-r),[a,h?r:n+a*o+r]}const ni=(t,e)=>void 0===e?t:{name:t,at:e};function ii(t){t.pause(),t.time=0,t.stop()}class ri{constructor(t=[],e={},s){this.options=e,this.entries=[],this.repeatIndex=0,this.prevTime=0,this.markers=[],this.labels=new Map,this.totalDuration=0,this.isDirty=!1,this.isDone=!1,this.isRebuilding=!1,this.playbackSpeed=1,this.motionScope=kn.current,this.isKilled=!1,this.isWrapped=!1,this.stop=()=>{this.flush(),this.group?.stop()},this.isPaused=!1===e.autoplay,this.newFinished(),t.forEach(t=>this.add(t)),s?(this.isDirty=!1,this.isWrapped=!0,this.group=new Zs(s),this.watch()):(this.invalidate(),this.flush())}add(t,e){return t instanceof ri&&t.adopt(this),this.push({item:t,at:e})}call(t,e){return this.push({item:t,at:e,marker:{name:"_m"+ei++,time:0,callback:t}})}addPause(t,e){return this.push({item:e||{},at:t,marker:{name:"_m"+ei++,time:0,callback:e,pause:!0}})}move(t,e){return this.entries.forEach(s=>{s.item===t&&(s.at=e)}),this.invalidate()}remove(t){return t instanceof ri&&(t.parent=void 0),this.entries=this.entries.filter(e=>e.item!==t),this.invalidate()}clear(){return this.entries=[],this.invalidate()}getLabelTime(t){return this.flush(),this.labels.get(t)}seek(t){return this.time=this.resolve(t),this}playTo(t){const e=this.resolve(t),s=this.iterationDuration,n=this.time,[i]=si(this.options,s,n),r=si(this.options,s,e,i)[1],a=Math.abs(this.speed);return this.speed=r<n?-a:a,this.stopAt=e,this.clock||this.invalidate(),this.play(),this}reverse(){return this.speed=-this.speed,this.play(),this}get progress(){return this.duration?this.time/this.duration:0}set progress(t){this.time=t*this.duration}get time(){return this.active()?.time??0}set time(t){this.flush(),this.prevTime=t,this.group&&(this.group.time=t),this.repeatIndex=this.currentRepeat()}get speed(){return this.playbackSpeed}set speed(t){this.playbackSpeed=t,this.group&&(this.group.speed=t)}get duration(){return this.flush(),this.isWrapped?this.group.duration:this.totalDuration}get iterationDuration(){return this.flush(),this.isWrapped?this.group.iterationDuration:this.totalDuration}get state(){return this.active()?.state??"idle"}get startTime(){return this.active()?.startTime??null}play(){this.flush(),this.isPaused=!1,this.group?.play(),this.isDone&&(this.newFinished(),this.watch())}pause(){this.flush(),this.isPaused=!0,this.group?.pause()}cancel(){this.flush(),this.group?.cancel()}complete(){this.flush(),this.group?.complete()}attachTimeline(t){return this.flush(),this.scrollTimeline=t,this.detachScroll=this.group?.attachTimeline(t),()=>{this.scrollTimeline=void 0,this.detachScroll?.()}}then(t,e){return this.finished.then(t,e)}active(){return this.flush(),this.group?.animations.length?this.group:void 0}push(t){return this.entries.push(t),this.invalidate()}invalidate(){return this.parent?this.parent.invalidate():this.isDirty||(this.isDirty=!0,queueMicrotask(()=>this.flush())),this}flush(){this.isDirty&&!this.parent&&!this.isKilled&&this.build()}adopt(t){this.group&&(ii(this.group),this.group=void 0),this.isDirty=!1,this.parent=t}build(){const t=this.isWrapped?this.group.iterationDuration:this.totalDuration;this.isDirty=!1,this.isWrapped=!1;const e=this.group;let s=0;e&&(this.isRebuilding=!0,this.scrollTimeline?(this.detachScroll?.(),e.cancel()):(s=e.animations.length?e.time:0,ii(e)),this.isRebuilding=!1);const{defaultTransition:n,onComplete:i,onUpdate:r,onRepeat:a,onReverseComplete:o,autoplay:h,scope:u,...l}=this.options,c={};void 0!==u?.reduceMotion&&(c.reduceMotion=u.reduceMotion),void 0!==u?.skipAnimations&&(c.skipAnimations=u.skipAnimations),Object.assign(c,l);const p=new Map,d={},m=kn.current;let f;kn.current=this.motionScope;try{f=function(t,e,s,n){const i=[],r=zn(t.map(t=>{if(Array.isArray(t)&&"function"==typeof t[0]){const e=t[0],s=Gs(0);return s.on("change",e),1===t.length?[s,[0,1]]:2===t.length?[s,[0,1],t[1]]:[s,t[1],t[2]]}return t}),e,s,{spring:Gt},n),a=e?.reduceMotion??e?.defaultTransition?.reduceMotion;return r.forEach(({keyframes:t,transition:e},s)=>{i.push(...ti(s,t,{...e,reduceMotion:a}))}),i}(this.toSequence(p),{defaultTransition:n,...c},u,d)}finally{kn.current=m}const g=d.labels;let y=c.duration??d.duration;const v=d.duration?y/d.duration:1;if(g.forEach((t,e)=>g.set(e,t*v)),this.markers=[],p.forEach((t,e)=>{t.time=g.get(e),g.delete(e),y=Math.max(y,t.time),this.markers.push(t)}),this.markers.sort((t,e)=>t.time-e.time),this.labels=g,this.totalDuration=y,this.clock=this.clockAnimation=void 0,this.markers.length||void 0!==this.stopAt||r||a){const t=this.clock=Gs(0);t.on("change",e=>t===this.clock&&this.onClock(e)),f.unshift(this.clockAnimation=Nn(t,[0,y],{...c,duration:y,ease:"linear"}))}const b=this.group=new Zs(f),{delay:T=0,repeat:k=0,repeatDelay:w=0}=this.options,[M,A]=si(this.options,t,s);s>T&&(s=si(this.options,y,Math.min(A,y),M)[1]),this.isDone&&s<T+(k+1)*(y+w)-w&&this.newFinished(),this.scrollTimeline?this.detachScroll=b.attachTimeline(this.scrollTimeline):(b.speed=this.playbackSpeed,this.isPaused&&b.pause(),s&&(b.time=s)),this.repeatIndex=this.currentRepeat(),this.prevTime=s||-1,this.watch()}toSequence(t){return this.entries.map(({item:e,at:s,marker:n})=>n?(t.set(n.name,n),ni(n.name,s)):e instanceof ri?{sequence:e.toSequence(t),at:s}:"string"==typeof e?ni(e,s):void 0===s?e:Array.isArray(e)?function(t,e){const s=[...t],n="function"==typeof s[0]?Math.max(1,s.length-1):2;return s[n]={...s[n],at:e},s}(e,s):{...e,at:s})}resolve(t){return this.flush(),"number"==typeof t?t:_n(t,this.labels)??this.time}currentRepeat(){return si(this.options,this.totalDuration,this.clockAnimation?.time??0)[0]}onClock(t){let e=this.prevTime;if(this.prevTime=t,this.isRebuilding)return;const{onUpdate:s,onRepeat:n,repeatType:i="loop"}=this.options;s?.(t);const r=this.currentRepeat(),a=r>this.repeatIndex?1:-1;for(;r!==this.repeatIndex;){const t=this.speed>0==("loop"===i||!(this.repeatIndex%2)),s=t?this.totalDuration:0;if(this.cross(e,s))return;this.repeatIndex+=a,n?.(),e="loop"===i?t?-1:1/0:s}this.cross(e,t)}cross(t,e){if(t===e)return;const s=e>t,n=n=>s?n>t&&n<=e:n<t&&n>=e,i=s?this.markers:[...this.markers].reverse();for(const t of i)if(n(t.time)&&(t.callback?.(s?1:-1),t.pause))return this.pauseAt(t.time);return void 0!==this.stopAt&&n(this.stopAt)?(this.pauseAt(this.stopAt),this.stopAt=void 0,!0):void 0}pauseAt(t){return this.pause(),this.time=si(this.options,this.totalDuration,t,this.repeatIndex)[1],!0}watch(){const t=this.group;t.finished.then(()=>{if(t!==this.group||this.isDone)return;this.isDone=!0;const{onComplete:e,onReverseComplete:s}=this.options,n=this.speed<0&&s||e,i=this.resolveFinished;n?.(),i()})}newFinished(){this.isDone=!1,this.finished=new Promise(t=>{this.resolveFinished=t});const{scope:e}=this.options,s=this.motionScope?.add(()=>{this.isKilled=!0,this.stop()});e?.animations.push(this),this.finished.then(()=>{s?.(),e&&t(e.animations,this)})}}function ai(t={}){const{scope:e,reduceMotion:s,skipAnimations:n}=t;return function(t,i,r){const a=kn.current?.transition,o={};let h;if(void 0!==s&&(o.reduceMotion=s),void 0!==n&&(o.skipAnimations=n),u=t,Array.isArray(u)&&u.some(t=>Array.isArray(t)||t?.sequence)){const n={...o,...i,scope:e};a&&(n.defaultTransition={...a,...n.defaultTransition}),n.reduceMotion=i?.reduceMotion??n.defaultTransition?.reduceMotion??s,h=new ri(t,n)}else{const{onComplete:s,...n}=r||{},u={...o,...a,...n},{onUpdate:l}=n,c="number"==typeof t||"string"==typeof t&&("string"==typeof i||Array.isArray(i))?[l||(()=>{}),Array.isArray(i)?i:[t,i],{...u,onUpdate:void 0}]:[t,i,u];h=new ri([c],{...o,onComplete:s,scope:e},ti(t,i,u,e))}var u;return h}}const oi=Object.assign(ai(),{addEffect:function(t){fn(t),mn.unshift(t)},removeEffect:fn});export{oi as animate,ai as createScopedAnimate};
//# sourceMappingURL=size-rollup-animate.js.map