framer-motion 12.8.0 → 12.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/client.js +1 -1
- package/dist/cjs/{create-Bv1Fn_mR.js → create-BMX8oz9O.js} +66 -142
- package/dist/cjs/dom.js +29 -57
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/m.js +17 -136
- package/dist/dom-mini.js +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/animation/interfaces/visual-element-target.mjs +11 -0
- package/dist/es/motion/utils/use-visual-state.mjs +1 -10
- package/dist/es/render/VisualElement.mjs +1 -3
- package/dist/es/render/svg/SVGVisualElement.mjs +1 -12
- package/dist/es/render/svg/config-motion.mjs +0 -44
- package/dist/es/render/svg/utils/build-attrs.mjs +16 -11
- package/dist/es/render/utils/motion-values.mjs +1 -1
- package/dist/framer-motion.dev.js +128 -173
- package/dist/framer-motion.js +1 -1
- package/dist/mini.js +1 -1
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation-m.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-waapi-animate.js +1 -1
- package/dist/types/client.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/{types.d-DUA-weyD.d.ts → types.d-DDSxwf0n.d.ts} +2 -12
- package/package.json +4 -4
- package/dist/es/render/svg/utils/measure.mjs +0 -19
- package/dist/es/render/svg/utils/transform-origin.mjs +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as t,w as e,M as n,x as s,y as i,z as r,A as o,B as a,p as u,C as h,D as l,E as c,F as d,G as p,H as m,I as f,r as v,d as y,o as g,t as b,a as w,J as T,m as S,K as V,b as A,i as M,l as x,f as C,L as E,N as k,g as P,s as F,u as I,O,P as D,n as N,h as R,q as K,j as B,k as L}from"./size-rollup-dom-animation-assets.js";import{Fragment as U}from"react";const j=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),q=t=>/^0[^.\s]+$/u.test(t);function W(t){let e;return()=>(void 0===e&&(e=t()),e)}const $=(t,e)=>n=>e(t(n)),z=(...t)=>t.reduce($),Y=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class H{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const X=t=>1e3*t,_=t=>t/1e3;function G(t,e){return e?t*(1e3/e):0}const Z=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function J(e,n,s,i){if(e===n&&s===i)return t;const r=t=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=Z(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(t,0,1,e,s);return t=>0===t||1===t?t:Z(r(t),n,i)}const Q=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,tt=t=>e=>1-t(1-e),et=J(.33,1.53,.69,.99),nt=tt(et),st=Q(nt),it=t=>(t*=2)<1?.5*nt(t):.5*(2-Math.pow(2,-10*(t-1))),rt=t=>1-Math.sin(Math.acos(t)),ot=tt(rt),at=Q(rt),ut=J(.42,0,1,1),ht=J(0,0,.58,1),lt=J(.42,0,.58,1),ct=t=>Array.isArray(t)&&"number"==typeof t[0],dt={linear:t,easeIn:ut,easeInOut:lt,easeOut:ht,circIn:rt,circInOut:at,circOut:ot,backIn:nt,backInOut:st,backOut:et,anticipate:it},pt=t=>{if(ct(t)){t.length;const[e,n,s,i]=t;return J(e,n,s,i)}return"string"==typeof t?dt[t]:t};let mt;function ft(){mt=void 0}const vt={now:()=>(void 0===mt&&vt.set(e.isProcessing||n.useManualTiming?e.timestamp:performance.now()),mt),set:t=>{mt=t,queueMicrotask(ft)}},yt=t=>Math.round(1e5*t)/1e5,gt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const bt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,wt=(t,e)=>n=>Boolean("string"==typeof n&&bt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Tt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(gt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},St={...s,transform:t=>Math.round((t=>r(0,255,t))(t))},Vt={test:wt("rgb","red"),parse:Tt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+St.transform(t)+", "+St.transform(e)+", "+St.transform(n)+", "+yt(i.transform(s))+")"};const At={test:wt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:Vt.transform},Mt={test:wt("hsl","hue"),parse:Tt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+o.transform(yt(e))+", "+o.transform(yt(n))+", "+yt(i.transform(s))+")"},xt={test:t=>Vt.test(t)||At.test(t)||Mt.test(t),parse:t=>Vt.test(t)?Vt.parse(t):Mt.test(t)?Mt.parse(t):At.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Vt.transform(t):Mt.transform(t)},Ct=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Et="number",kt="color",Pt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ft(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Pt,(t=>(xt.test(t)?(s.color.push(r),i.push(kt),n.push(xt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Et),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function It(t){return Ft(t).values}function Ot(t){const{split:e,types:n}=Ft(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===Et?yt(t[r]):e===kt?xt.transform(t[r]):t[r]}return i}}const Dt=t=>"number"==typeof t?0:t;const Nt={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(gt)?.length||0)+(t.match(Ct)?.length||0)>0},parse:It,createTransformer:Ot,getAnimatableNone:function(t){const e=It(t);return Ot(t)(e.map(Dt))}};function Rt(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 Kt(t,e){return n=>n>0?e:t}const Bt=(t,e,n)=>t+(e-t)*n,Lt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ut=[At,Vt,Mt];function jt(t){const e=(n=t,Ut.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Mt&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Rt(a,s,t+1/3),r=Rt(a,s,t),o=Rt(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const qt=(t,e)=>{const n=jt(t),s=jt(e);if(!n||!s)return Kt(t,e);const i={...n};return t=>(i.red=Lt(n.red,s.red,t),i.green=Lt(n.green,s.green,t),i.blue=Lt(n.blue,s.blue,t),i.alpha=Bt(n.alpha,s.alpha,t),Vt.transform(i))},Wt=new Set(["none","hidden"]);function $t(t,e){return n=>Bt(t,e,n)}function zt(t){return"number"==typeof t?$t:"string"==typeof t?a(t)?Kt:xt.test(t)?qt:Xt:Array.isArray(t)?Yt:"object"==typeof t?xt.test(t)?qt:Ht:Kt}function Yt(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>zt(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function Ht(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=zt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const Xt=(t,e)=>{const n=Nt.createTransformer(e),s=Ft(t),i=Ft(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Wt.has(t)&&!i.values.length||Wt.has(e)&&!s.values.length?function(t,e){return Wt.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):z(Yt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Kt(t,e)};function _t(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Bt(t,e,n);return zt(t)(t,e)}const Gt=t=>{const n=({timestamp:e})=>t(e);return{start:()=>u.update(n,!0),stop:()=>h(n),now:()=>e.isProcessing?e.timestamp:vt.now()}},Zt=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},Jt=2e4;function Qt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Jt;)e+=50,n=t.next(e);return e>=Jt?1/0:e}function te(t,e,n){const s=Math.max(e-5,0);return G(n-t(s),e-s)}const ee=100,ne=10,se=1,ie=0,re=800,oe=.3,ae=.3,ue={granular:.01,default:2},he={granular:.005,default:.5},le=.01,ce=10,de=.05,pe=1,me=.001;function fe({duration:t=re,bounce:e=oe,velocity:n=ie,mass:s=se}){let i,o,a=1-e;a=r(de,pe,a),t=r(le,ce,_(t)),a<1?(i=e=>{const s=e*a,i=s*t,r=s-n,o=ye(e,a),u=Math.exp(-i);return me-r/o*u},o=e=>{const s=e*a*t,r=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-s),h=ye(Math.pow(e,2),a);return(-i(e)+me>0?-1:1)*((r-o)*u)/h}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<ve;n++)s-=t(s)/e(s);return s}(i,o,5/t);if(t=X(t),isNaN(u))return{stiffness:ee,damping:ne,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const ve=12;function ye(t,e){return t*Math.sqrt(1-e*e)}const ge=["duration","bounce"],be=["stiffness","damping","mass"];function we(t,e){return e.some((e=>void 0!==t[e]))}function Te(t=ae,e=oe){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:h,damping:l,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:ie,stiffness:ee,damping:ne,mass:se,isResolvedFromDuration:!1,...t};if(!we(t,be)&&we(t,ge))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,o=2*r(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:se,stiffness:i,damping:o}}else{const n=fe(t);e={...e,...n,mass:se},e.isResolvedFromDuration=!0}return e}({...n,velocity:-_(n.velocity||0)}),f=p||0,v=l/(2*Math.sqrt(h*c)),y=a-o,g=_(Math.sqrt(h/c)),b=Math.abs(y)<5;let w;if(s||(s=b?ue.granular:ue.default),i||(i=b?he.granular:he.default),v<1){const t=ye(g,v);w=e=>{const n=Math.exp(-v*g*e);return a-n*((f+v*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===v)w=t=>a-Math.exp(-g*t)*(y+(f+g*y)*t);else{const t=g*Math.sqrt(v*v-1);w=e=>{const n=Math.exp(-v*g*e),s=Math.min(t*e,300);return a-n*((f+v*g*y)*Math.sinh(s)+t*y*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=w(t);if(m)u.done=t>=d;else{let n=0===t?f:0;v<1&&(n=0===t?X(f):te(w,t,e));const r=Math.abs(n)<=s,o=Math.abs(a-e)<=i;u.done=r&&o}return u.value=u.done?a:e,u},toString:()=>{const t=Math.min(Qt(T),Jt),e=Zt((e=>T.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return T}function Se({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:h=.5,restSpeed:l}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=c+m,v=void 0===o?f:o(f);v!==f&&(m=v-c);const y=t=>-m*Math.exp(-t/s),g=t=>v+y(t),b=t=>{const e=y(t),n=g(t);d.done=Math.abs(e)<=h,d.value=d.done?v:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(w=t,T=Te({keyframes:[d.value,p(d.value)],velocity:te(g,t,d.value),damping:i,stiffness:r,restDelta:h,restSpeed:l}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}function Ve(e,s,{clamp:i=!0,ease:o,mixer:a}={}){const u=e.length;if(s.length,1===u)return()=>s[0];if(2===u&&s[0]===s[1])return()=>s[1];const h=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),s=[...s].reverse());const l=function(e,s,i){const r=[],o=i||n.mix||_t,a=e.length-1;for(let n=0;n<a;n++){let i=o(e[n],e[n+1]);if(s){const e=Array.isArray(s)?s[n]||t:s;i=z(e,i)}r.push(i)}return r}(s,o,a),c=l.length,d=t=>{if(h&&t<e[0])return s[0];let n=0;if(c>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const i=Y(e[n],e[n+1],t);return l[n](i)};return i?t=>d(r(e[0],e[u-1],t)):d}function Ae(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Y(0,e,s);t.push(Bt(n,1,i))}}(e,t.length-1),e}function Me({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(pt):pt(s),r={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:Ae(e),t),a=Ve(o,e,{ease:Array.isArray(i)?i:(u=e,h=i,u.map((()=>h||lt)).splice(0,u.length-1))});var u,h;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}Te.applyToOptions=t=>{const e=function(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Qt(s),Jt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:_(i)}}(t,100,Te);return t.ease=e.ease,t.duration=X(e.duration),t.type="keyframes",t};const xe=t=>null!==t;function Ce(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(xe),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Ee={decay:Se,inertia:Se,tween:Me,keyframes:Me,spring:Te};function ke(t){"string"==typeof t.type&&(t.type=Ee[t.type])}class Pe{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Fe=t=>t/100;class Ie extends Pe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;if(t&&t.updatedAt!==vt.now()&&this.tick(vt.now()),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;ke(t);const{type:e=Me,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Me;a!==Me&&"number"!=typeof o[0]&&(this.mixKeyframes=z(Fe,_t(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Qt(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(null===this.startTime)return n.next(0);const{delay:h=0,keyframes:l,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-h*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let b=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(w=o)),b=r(0,1,n)*a}const T=g?{done:!1,value:l[0]}:w.next(b);i&&(T.value=i(T.value));let{done:S}=T;g||null===u||(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const V=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return V&&m!==Se&&(T.value=Ce(l,this.options,v,this.speed)),f&&f(T.value),V&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return _(this.calculatedDuration)}get time(){return _(this.currentTime)}set time(t){t=X(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)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(vt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=_(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Gt,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:"finished"===this.state?(this.updateFinished(),this.startTime=s):this.startTime||(this.startTime=n??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(vt.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";const{onComplete:t}=this.options;t&&t()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),t.observe(this)}}const Oe=t=>180*t/Math.PI,De=t=>{const e=Oe(Math.atan2(t[1],t[0]));return Re(e)},Ne={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:De,rotateZ:De,skewX:t=>Oe(Math.atan(t[1])),skewY:t=>Oe(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Re=t=>((t%=360)<0&&(t+=360),t),Ke=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Be=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Le={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ke,scaleY:Be,scale:t=>(Ke(t)+Be(t))/2,rotateX:t=>Re(Oe(Math.atan2(t[6],t[5]))),rotateY:t=>Re(Oe(Math.atan2(-t[2],t[0]))),rotateZ:De,rotate:De,skewX:t=>Oe(Math.atan(t[4])),skewY:t=>Oe(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Ue(t){return t.includes("scale")?1:0}function je(t,e){if(!t||"none"===t)return Ue(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Le,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ne,i=e}if(!i)return Ue(e);const r=s[e],o=i[1].split(",").map(qe);return"function"==typeof r?r(o):o[r]}function qe(t){return parseFloat(t.trim())}const We=t=>t===s||t===l,$e=new Set(["x","y","z"]),ze=c.filter((t=>!$e.has(t)));const Ye={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>je(e,"x"),y:(t,{transform:e})=>je(e,"y")};Ye.translateX=Ye.x,Ye.translateY=Ye.y;const He=new Set;let Xe=!1,_e=!1,Ge=!1;function Ze(){if(_e){const t=Array.from(He).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return ze.forEach((n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))})),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,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}_e=!1,Xe=!1,He.forEach((t=>t.complete(Ge))),He.clear()}function Je(){He.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(_e=!0)}))}class Qe{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(He.add(this),Xe||(Xe=!0,u.read(Je),u.resolveKeyframes(Ze))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.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.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),He.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,He.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const tn=W((()=>void 0!==window.ScrollTimeline)),en={};function nn(t,e){const n=W(t);return()=>en[e]??n()}const sn=nn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),rn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,on={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:rn([0,.65,.55,1]),circOut:rn([.55,0,1,.45]),backIn:rn([.31,.01,.66,-.59]),backOut:rn([.33,1.53,.69,.99])};function an(t,e){return t?"function"==typeof t?sn()?Zt(t,e):"ease-out":ct(t)?rn(t):Array.isArray(t)?t.map((t=>an(t,e)||on.easeOut)):on[t]:void 0}function un(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},h=void 0){const l={[e]:n};u&&(l.offset=u);const c=an(a,i);Array.isArray(c)&&(l.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};h&&(d.pseudoElement=h);return t.animate(l,d)}function hn(t){return"function"==typeof t&&"applyToOptions"in t}class ln extends Pe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const a=function({type:t,...e}){return hn(t)&&sn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=un(e,n,s,a,i),!1===a.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=Ce(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return _(Number(t))}get time(){return _(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=X(t)}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 Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&tn()?(this.animation.timeline=e,t):n(this)}}const cn={anticipate:it,backInOut:st,circInOut:at};function dn(t){"string"==typeof t.ease&&t.ease in cn&&(t.ease=cn[t.ease])}class pn extends ln{constructor(t){dn(t),ke(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new Ie({...r,autoplay:!1}),a=X(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const mn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Nt.test(t)&&"0"!==t||t.startsWith("url(")));const fn=new Set(["opacity","clipPath","filter","transform"]),vn=W((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class yn extends Pe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:h,...l}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel()},this.createdAt=vt.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:u,element:h,...l},d=h?.KeyframeResolver||Qe;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,c,!n)),a,u,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,s,i,r){this.keyframeResolver=void 0;const{name:o,type:a,velocity:u,delay:h,isHandoff:l,onUpdate:c,onComplete:d}=i;this.resolvedAt=vt.now(),function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=mn(i,e),a=mn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||hn(n))&&s)}(e,o,a,u)||(!n.instantAnimations&&h||c?.(Ce(e,i,s)),e[0]=e[e.length-1],i.duration=0,i.repeat=0);const p={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:s,...i,keyframes:e},m=!l&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=e.owner.getProps();return vn()&&n&&fn.has(n)&&("transform"!==n||!u)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}(p)?new pn({...p,element:p.motionValue.owner.current}):new Ie(p);m.finished.then((()=>{d?.(),this.notifyFinished()})).catch(t),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(Ge=!0,Je(),Ze(),Ge=!1),this._animation}get duration(){return this.animation.duration}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()}}const gn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bn(t,e,n=1){const[s,i]=function(t){const e=gn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return j(t)?parseFloat(t):t}return a(i)?bn(i,e,n+1):i}function wn(t,e){return t?.[e]??t?.default??t}const Tn=new Set(["width","height","top","left","right","bottom",...c]),Sn=t=>e=>e.test(t),Vn=[s,l,o,d,p,m,{test:t=>"auto"===t,parse:t=>t}],An=t=>Vn.find(Sn(t));const Mn=new Set(["brightness","contrast","saturate","opacity"]);function xn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(gt)||[];if(!s)return t;const i=n.replace(s,"");let r=Mn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Cn=/\b([a-z-]*)\(.*?\)/gu,En={...Nt,getAnimatableNone:t=>{const e=t.match(Cn);return e?e.map(xn).join(" "):t}},kn={...f,color:xt,backgroundColor:xt,outlineColor:xt,fill:xt,stroke:xt,borderColor:xt,borderTopColor:xt,borderRightColor:xt,borderBottomColor:xt,borderLeftColor:xt,filter:En,WebkitFilter:En},Pn=t=>kn[t];function Fn(t,e){let n=Pn(t);return n!==En&&(n=Nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const In=new Set(["auto","none","0"]);class On extends Qe{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),a(s))){const i=bn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Tn.has(n)||2!==t.length)return;const[s,i]=t,r=An(s),o=An(i);if(r!==o)if(We(r)&&We(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||q(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!In.has(e)&&Ft(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=Fn(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ye[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ye[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Dn=!1;function Nn(){return Dn}function Rn(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function Kn(t){return!("touch"===t.pointerType||Nn())}const Bn=(t,e)=>!!e&&(t===e||Bn(t,e.parentElement)),Ln=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Un=new WeakSet;function jn(t){return e=>{"Enter"===e.key&&t(e)}}function qn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Wn(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!Nn()}function $n(t,e,n={}){const[s,i,r]=Rn(t,n),o=t=>{const s=t.currentTarget;if(!Wn(t)||Un.has(s))return;Un.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),Wn(t)&&Un.has(s)&&(Un.delete(s),"function"==typeof r&&r(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||Bn(s,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",u,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=jn((()=>{if(Un.has(n))return;qn(n,"down");const t=jn((()=>{qn(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>qn(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,Ln.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r}class zn{constructor(t,e={}){this.version="12.8.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=vt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=vt.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){this.events[t]||(this.events[t]=new H);const n=this.events[t].add(e);return"change"===t?()=>{n(),u.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){"none"===t&&console.trace(),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=vt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return G(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yn(t,e){return new zn(t,e)}const Hn=[...Vn,xt,Nt];function Xn(t,e,n){const s=t.getProps();return v(s,e,void 0!==n?n:s.custom,t)}const _n=t=>Array.isArray(t);function Gn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Yn(n))}function Zn(t,e){const s=t.getValue("willChange");if(i=s,Boolean(y(i)&&i.add))return s.add(e);if(!s&&n.WillChange){const s=new n.WillChange("auto");t.addValue("willChange",s),s.add(e)}var i}function Jn(t){return t.props[g]}const Qn=t=>null!==t;const ts={type:"spring",stiffness:500,damping:25,restSpeed:10},es={type:"keyframes",duration:.8},ns={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ss=(t,{keyframes:e})=>e.length>2?es:b.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ts:ns;const is=(t,e,s,i={},r,o)=>a=>{const h=wn(i,t)||{},l=h.delay||i.delay||0;let{elapsed:c=0}=i;c-=X(l);const d={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...h,delay:-c,onUpdate:t=>{e.set(t),h.onUpdate&&h.onUpdate(t)},onComplete:()=>{a(),h.onComplete&&h.onComplete()},name:t,motionValue:e,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:h,...l}){return!!Object.keys(l).length})(h)||Object.assign(d,ss(t,d)),d.duration&&(d.duration=X(d.duration)),d.repeatDelay&&(d.repeatDelay=X(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let p=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(p=!0)),(n.instantAnimations||n.skipAnimations)&&(p=!0,d.duration=0,d.delay=0),d.allowFlatten=!h.type&&!h.ease,p&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Qn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(d.keyframes,h);if(void 0!==t)return void u.update((()=>{d.onUpdate(t),d.onComplete()}))}return new yn(d)};function rs({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function os(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const h=[],l=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||l&&rs(l,e))continue;const o={delay:n,...wn(r||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=Jn(t);if(n){const t=window.MotionHandoffAnimation(n,e,u);null!==t&&(o.startTime=t,c=!0)}}Zn(t,e),s.start(is(e,s,i,t.shouldReduceMotion&&Tn.has(e)?{type:!1}:o,t,c));const d=s.animation;d&&h.push(d)}return o&&Promise.all(h).then((()=>{u.update((()=>{o&&function(t,e){const n=Xn(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r)Gn(t,e,(o=r[e],_n(o)?o[o.length-1]||0:o));var o}(t,o)}))})),h}function as(t,e,n={}){const s=Xn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(os(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,u=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(us).forEach(((t,s)=>{t.notify("AnimationStart",e),o.push(as(t,e,{...r,delay:n+u(s)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(o)}(t,e,r+s,o,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then((()=>e()))}return Promise.all([r(),o(n.delay)])}function us(t,e){return t.sortNodePosition(e)}function hs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const ls=T.length;function cs(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&cs(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<ls;n++){const s=T[n],i=t.props[s];(w(i)||!1===i)&&(e[s]=i)}return e}const ds=[...V].reverse(),ps=V.length;function ms(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map((e=>as(t,e,n)));s=Promise.all(i)}else if("string"==typeof e)s=as(t,e,n);else{const i="function"==typeof e?Xn(t,e,n.custom):e;s=Promise.all(os(t,i,n))}return s.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}function fs(t){let e=ms(t),n=gs(),s=!0;const i=e=>(n,s)=>{const i=Xn(t,s,"exit"===e?t.presenceContext?.custom:void 0);if(i){const{transition:t,transitionEnd:e,...s}=i;n={...n,...s,...e}}return n};function r(r){const{props:o}=t,a=cs(t.parent)||{},u=[],h=new Set;let l={},c=1/0;for(let e=0;e<ps;e++){const d=ds[e],p=n[d],m=void 0!==o[d]?o[d]:a[d],f=w(m),v=d===r?p.isActive:null;!1===v&&(c=e);let y=m===a[d]&&m!==o[d]&&f;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...l},!p.isActive&&null===v||!m&&!p.prevProp||S(m)||"boolean"==typeof m)continue;const g=vs(p.prevProp,m);let b=g||d===r&&p.isActive&&!y&&f||e>c&&f,T=!1;const V=Array.isArray(m)?m:[m];let A=V.reduce(i(d),{});!1===v&&(A={});const{prevResolvedValues:M={}}=p,x={...M,...A},C=e=>{b=!0,h.has(e)&&(T=!0,h.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in x){const e=A[t],n=M[t];if(l.hasOwnProperty(t))continue;let s=!1;s=_n(e)&&_n(n)?!hs(e,n):e!==n,s?null!=e?C(t):h.add(t):void 0!==e&&h.has(t)?C(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=A,p.isActive&&(l={...l,...A}),s&&t.blockInitialAnimation&&(b=!1);b&&(!(y&&g)||T)&&u.push(...V.map((t=>({animation:t,options:{type:d}}))))}if(h.size){const e={};if("boolean"!=typeof o.initial){const n=Xn(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}h.forEach((n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=s??null})),u.push({animation:e})}let d=Boolean(u.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){if(n[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach((t=>t.animationState?.setActive(e,s))),n[e].isActive=s;const i=r(e);for(const t in n)n[t].protectedKeys={};return i},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=gs(),s=!0}}}function vs(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!hs(e,t)}function ys(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gs(){return{animate:ys(!0),whileInView:ys(),whileHover:ys(),whileTap:ys(),whileDrag:ys(),whileFocus:ys(),exit:ys()}}class bs{constructor(t){this.isMounted=!1,this.node=t}update(){}}let ws=0;const Ts={animation:{Feature:class extends bs{constructor(t){super(t),t.animationState||(t.animationState=fs(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();S(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends bs{constructor(){super(...arguments),this.id=ws++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then((()=>{e(this.id)}))}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function Ss(t){return{point:{x:t.pageX,y:t.pageY}}}function Vs(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const i=s["onHover"+n];i&&u.postRender((()=>i(e,Ss(e))))}function As(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function Ms(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const i=s["onTap"+("End"===n?"":n)];i&&u.postRender((()=>i(e,Ss(e))))}const xs=new WeakMap,Cs=new WeakMap,Es=t=>{const e=xs.get(t.target);e&&e(t)},ks=t=>{t.forEach(Es)};function Ps(t,e,n){const s=function({root:t,...e}){const n=t||document;Cs.has(n)||Cs.set(n,{});const s=Cs.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(ks,{root:t,...e})),s[i]}(e);return xs.set(t,n),s.observe(t),()=>{xs.delete(t),s.unobserve(t)}}const Fs={some:0,all:1};const Is={inView:{Feature:class extends bs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Fs[s]};return Ps(this.node.current,r,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends bs{mount(){const{current:t}=this.node;t&&(this.unmount=$n(t,((t,e)=>(Ms(this.node,e,"Start"),(t,{success:e})=>Ms(this.node,t,e?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends bs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=z(As(this.node.current,"focus",(()=>this.onFocus())),As(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends bs{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=Rn(t,n),o=t=>{if(!Kn(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{Kn(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r}(t,((t,e)=>(Vs(this.node,e,"Start"),t=>Vs(this.node,t,"End")))))}unmount(){}}}};const Os=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ds={current:null},Ns={current:!1};const Rs=new WeakMap;const Ks=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Bs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=vt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,u.render(this.render,!1,!0))};const{latestValues:a,renderState:h,onUpdate:l}=r;this.onUpdate=l,this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=h,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=M(e),this.isVariantNode=x(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in d){const e=d[t];void 0!==a[t]&&y(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Rs.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Ns.current||function(){if(Ns.current=!0,A)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ds.current=t.matches;t.addListener(e),e()}else Ds.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ds.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),h(this.notifyUpdate),h(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=b.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&u.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),r&&r(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in C){const e=C[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ks.length;e++){const n=Ks[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(y(i))t.addValue(s,i);else if(y(r))t.addValue(s,Yn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Yn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Yn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(j(n)||q(n))?n=parseFloat(n):(s=n,!Hn.find(Sn(s))&&Nt.test(e)&&(n=Fn(t,e))),this.setBaseTarget(t,y(n)?n.get():n)),y(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=v(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||y(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new H),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Ls extends Bs{constructor(){super(...arguments),this.KeyframeResolver=On}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[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;y(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}class Us extends Ls{constructor(){super(...arguments),this.type="html",this.renderInstance=E}readValueFromInstance(t,e){if(b.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return je(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(k(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){P(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return F(t,e,n)}}class js extends Ls{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Os,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&I(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(b.has(e)){const t=Pn(e);return t&&t.default||0}return e=O.has(e)?e:D(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return N(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&u.postRender(this.updateDimensions)}build(t,e,n){R(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){K(t,e,n,s)}mount(t){this.isSVGTag=B(t.tagName),super.mount(t)}}const qs={renderer:(t,e)=>L(t)?new js(e):new Us(e,{allowProjection:t!==U}),...Ts,...Is};export{qs as domAnimation};
|
|
1
|
+
import{c as t,M as e,p as n,q as s,t as i,u as r,v as o,w as a,x as u,y as l,z as h,A as c,B as d,r as p,d as m,o as f,C as v,a as y,D as g,m as b,E as w,b as T,i as S,l as A,f as V,F as M,g as x,s as C,G as k,n as E,h as P,j as F,k as O}from"./size-rollup-dom-animation-assets.js";import{Fragment as I}from"react";const D=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),N=t=>/^0[^.\s]+$/u.test(t);function R(t){let e;return()=>(void 0===e&&(e=t()),e)}const B=t=>t,K=(t,e)=>n=>e(t(n)),L=(...t)=>t.reduce(K),j=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class U{constructor(){this.subscriptions=[]}add(t){var e,n;return e=this.subscriptions,n=t,-1===e.indexOf(n)&&e.push(n),()=>function(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const q=t=>1e3*t,W=t=>t/1e3;function Y(t,e){return e?t*(1e3/e):0}const $=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function z(t,e,n,s){if(t===e&&n===s)return B;const i=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=$(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:$(i(t),e,s)}const H=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,X=t=>e=>1-t(1-e),_=z(.33,1.53,.69,.99),G=X(_),Z=H(G),J=t=>(t*=2)<1?.5*G(t):.5*(2-Math.pow(2,-10*(t-1))),Q=t=>1-Math.sin(Math.acos(t)),tt=X(Q),et=H(Q),nt=z(.42,0,1,1),st=z(0,0,.58,1),it=z(.42,0,.58,1),rt=t=>Array.isArray(t)&&"number"==typeof t[0],ot={linear:B,easeIn:nt,easeInOut:it,easeOut:st,circIn:Q,circInOut:et,circOut:tt,backIn:G,backInOut:Z,backOut:_,anticipate:J},at=t=>{if(rt(t)){t.length;const[e,n,s,i]=t;return z(e,n,s,i)}return"string"==typeof t?ot[t]:t},{schedule:ut,cancel:lt,state:ht,steps:ct}=t("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:B,!0);let dt;function pt(){dt=void 0}const mt={now:()=>(void 0===dt&&mt.set(ht.isProcessing||e.useManualTiming?ht.timestamp:performance.now()),dt),set:t=>{dt=t,queueMicrotask(pt)}},ft=t=>Math.round(1e5*t)/1e5,vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const yt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,gt=(t,e)=>n=>Boolean("string"==typeof n&&yt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),bt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(vt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},wt={...n,transform:t=>Math.round((t=>i(0,255,t))(t))},Tt={test:gt("rgb","red"),parse:bt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+wt.transform(t)+", "+wt.transform(e)+", "+wt.transform(n)+", "+ft(s.transform(i))+")"};const St={test:gt("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:Tt.transform},At={test:gt("hsl","hue"),parse:bt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+r.transform(ft(e))+", "+r.transform(ft(n))+", "+ft(s.transform(i))+")"},Vt={test:t=>Tt.test(t)||St.test(t)||At.test(t),parse:t=>Tt.test(t)?Tt.parse(t):At.test(t)?At.parse(t):St.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Tt.transform(t):At.transform(t)},Mt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const xt="number",Ct="color",kt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Et(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(kt,(t=>(Vt.test(t)?(s.color.push(r),i.push(Ct),n.push(Vt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(xt),n.push(parseFloat(t))),++r,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:i}}function Pt(t){return Et(t).values}function Ft(t){const{split:e,types:n}=Et(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===xt?ft(t[r]):e===Ct?Vt.transform(t[r]):t[r]}return i}}const Ot=t=>"number"==typeof t?0:t;const It={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(vt)?.length||0)+(t.match(Mt)?.length||0)>0},parse:Pt,createTransformer:Ft,getAnimatableNone:function(t){const e=Pt(t);return Ft(t)(e.map(Ot))}};function Dt(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 Nt(t,e){return n=>n>0?e:t}const Rt=(t,e,n)=>t+(e-t)*n,Bt=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Kt=[St,Tt,At];function Lt(t){const e=(n=t,Kt.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===At&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Dt(a,s,t+1/3),r=Dt(a,s,t),o=Dt(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const jt=(t,e)=>{const n=Lt(t),s=Lt(e);if(!n||!s)return Nt(t,e);const i={...n};return t=>(i.red=Bt(n.red,s.red,t),i.green=Bt(n.green,s.green,t),i.blue=Bt(n.blue,s.blue,t),i.alpha=Rt(n.alpha,s.alpha,t),Tt.transform(i))},Ut=new Set(["none","hidden"]);function qt(t,e){return n=>Rt(t,e,n)}function Wt(t){return"number"==typeof t?qt:"string"==typeof t?o(t)?Nt:Vt.test(t)?jt:zt:Array.isArray(t)?Yt:"object"==typeof t?Vt.test(t)?jt:$t:Nt}function Yt(t,e){const n=[...t],s=n.length,i=t.map(((t,n)=>Wt(t)(t,e[n])));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function $t(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Wt(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const zt=(t,e)=>{const n=It.createTransformer(e),s=Et(t),i=Et(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Ut.has(t)&&!i.values.length||Ut.has(e)&&!s.values.length?function(t,e){return Ut.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):L(Yt(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):Nt(t,e)};function Ht(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Rt(t,e,n);return Wt(t)(t,e)}const Xt=t=>{const e=({timestamp:e})=>t(e);return{start:()=>ut.update(e,!0),stop:()=>lt(e),now:()=>ht.isProcessing?ht.timestamp:mt.now()}},_t=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=t(e/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},Gt=2e4;function Zt(t){let e=0;let n=t.next(e);for(;!n.done&&e<Gt;)e+=50,n=t.next(e);return e>=Gt?1/0:e}function Jt(t,e,n){const s=Math.max(e-5,0);return Y(n-t(s),e-s)}const Qt=100,te=10,ee=1,ne=0,se=800,ie=.3,re=.3,oe={granular:.01,default:2},ae={granular:.005,default:.5},ue=.01,le=10,he=.05,ce=1,de=.001;function pe({duration:t=se,bounce:e=ie,velocity:n=ne,mass:s=ee}){let r,o,a=1-e;a=i(he,ce,a),t=i(ue,le,W(t)),a<1?(r=e=>{const s=e*a,i=s*t,r=s-n,o=fe(e,a),u=Math.exp(-i);return de-r/o*u},o=e=>{const s=e*a*t,i=s*n+n,o=Math.pow(a,2)*Math.pow(e,2)*t,u=Math.exp(-s),l=fe(Math.pow(e,2),a);return(-r(e)+de>0?-1:1)*((i-o)*u)/l}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const u=function(t,e,n){let s=n;for(let n=1;n<me;n++)s-=t(s)/e(s);return s}(r,o,5/t);if(t=q(t),isNaN(u))return{stiffness:Qt,damping:te,duration:t};{const e=Math.pow(u,2)*s;return{stiffness:e,damping:2*a*Math.sqrt(s*e),duration:t}}}const me=12;function fe(t,e){return t*Math.sqrt(1-e*e)}const ve=["duration","bounce"],ye=["stiffness","damping","mass"];function ge(t,e){return e.some((e=>void 0!==t[e]))}function be(t=re,e=ie){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],u={done:!1,value:o},{stiffness:l,damping:h,mass:c,duration:d,velocity:p,isResolvedFromDuration:m}=function(t){let e={velocity:ne,stiffness:Qt,damping:te,mass:ee,isResolvedFromDuration:!1,...t};if(!ge(t,ye)&&ge(t,ve))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,o=2*i(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:ee,stiffness:r,damping:o}}else{const n=pe(t);e={...e,...n,mass:ee},e.isResolvedFromDuration=!0}return e}({...n,velocity:-W(n.velocity||0)}),f=p||0,v=h/(2*Math.sqrt(l*c)),y=a-o,g=W(Math.sqrt(l/c)),b=Math.abs(y)<5;let w;if(s||(s=b?oe.granular:oe.default),r||(r=b?ae.granular:ae.default),v<1){const t=fe(g,v);w=e=>{const n=Math.exp(-v*g*e);return a-n*((f+v*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}}else if(1===v)w=t=>a-Math.exp(-g*t)*(y+(f+g*y)*t);else{const t=g*Math.sqrt(v*v-1);w=e=>{const n=Math.exp(-v*g*e),s=Math.min(t*e,300);return a-n*((f+v*g*y)*Math.sinh(s)+t*y*Math.cosh(s))/t}}const T={calculatedDuration:m&&d||null,next:t=>{const e=w(t);if(m)u.done=t>=d;else{let n=0===t?f:0;v<1&&(n=0===t?q(f):Jt(w,t,e));const i=Math.abs(n)<=s,o=Math.abs(a-e)<=r;u.done=i&&o}return u.value=u.done?a:e,u},toString:()=>{const t=Math.min(Zt(T),Gt),e=_t((e=>T.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return T}function we({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:u,restDelta:l=.5,restSpeed:h}){const c=t[0],d={done:!1,value:c},p=t=>void 0===a?u:void 0===u||Math.abs(a-t)<Math.abs(u-t)?a:u;let m=n*e;const f=c+m,v=void 0===o?f:o(f);v!==f&&(m=v-c);const y=t=>-m*Math.exp(-t/s),g=t=>v+y(t),b=t=>{const e=y(t),n=g(t);d.done=Math.abs(e)<=l,d.value=d.done?v:n};let w,T;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==u&&e>u)&&(w=t,T=be({keyframes:[d.value,p(d.value)],velocity:Jt(g,t,d.value),damping:i,stiffness:r,restDelta:l,restSpeed:h}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==w||(e=!0,b(t),S(t)),void 0!==w&&t>=w?T.next(t-w):(!e&&b(t),d)}}}function Te(t,n,{clamp:s=!0,ease:r,mixer:o}={}){const a=t.length;if(n.length,1===a)return()=>n[0];if(2===a&&n[0]===n[1])return()=>n[1];const u=t[0]===t[1];t[0]>t[a-1]&&(t=[...t].reverse(),n=[...n].reverse());const l=function(t,n,s){const i=[],r=s||e.mix||Ht,o=t.length-1;for(let e=0;e<o;e++){let s=r(t[e],t[e+1]);if(n){const t=Array.isArray(n)?n[e]||B:n;s=L(t,s)}i.push(s)}return i}(n,r,o),h=l.length,c=e=>{if(u&&e<t[0])return n[0];let s=0;if(h>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=j(t[s],t[s+1],e);return l[s](i)};return s?e=>c(i(t[0],t[a-1],e)):c}function Se(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=j(0,e,s);t.push(Rt(n,1,i))}}(e,t.length-1),e}function Ae({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(at):at(s),r={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:Se(e),t),a=Te(o,e,{ease:Array.isArray(i)?i:(u=e,l=i,u.map((()=>l||it)).splice(0,u.length-1))});var u,l;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}be.applyToOptions=t=>{const e=function(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Zt(s),Gt);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:W(i)}}(t,100,be);return t.ease=e.ease,t.duration=q(e.duration),t.type="keyframes",t};const Ve=t=>null!==t;function Me(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ve),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const xe={decay:we,inertia:we,tween:Ae,keyframes:Ae,spring:be};function Ce(t){"string"==typeof t.type&&(t.type=xe[t.type])}class ke{constructor(){this.count=0,this.updateFinished()}get finished(){return this._finished}updateFinished(){this.count++,this._finished=new Promise((t=>{this.resolve=t}))}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Ee=t=>t/100;class Pe extends ke{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;if(t&&t.updatedAt!==mt.now()&&this.tick(mt.now()),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Ce(t);const{type:e=Ae,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||Ae;a!==Ae&&"number"!=typeof o[0]&&(this.mixKeyframes=L(Ee,Ht(o[0],o[1])),o=[0,100]);const u=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===u.calculatedDuration&&(u.calculatedDuration=Zt(u));const{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:h,repeat:c,repeatType:d,repeatDelay:p,type:m,onUpdate:f,finalKeyframe:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const y=this.currentTime-l*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?y<0:y>s;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let b=this.currentTime,w=n;if(c){const t=Math.min(this.currentTime,s)/a;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,c+1);Boolean(e%2)&&("reverse"===d?(n=1-n,p&&(n-=p/a)):"mirror"===d&&(w=o)),b=i(0,1,n)*a}const T=g?{done:!1,value:h[0]}:w.next(b);r&&(T.value=r(T.value));let{done:S}=T;g||null===u||(S=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const A=null===this.holdTime&&("finished"===this.state||"running"===this.state&&S);return A&&m!==we&&(T.value=Me(h,this.options,v,this.speed)),f&&f(T.value),A&&this.finish(),T}then(t,e){return this.finished.then(t,e)}get duration(){return W(this.calculatedDuration)}get time(){return W(this.currentTime)}set time(t){t=q(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)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(mt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=W(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=Xt,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:"finished"===this.state?(this.updateFinished(),this.startTime=s):this.startTime||(this.startTime=n??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(mt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown()}teardown(){this.notifyFinished(),this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),t.observe(this)}}const Fe=t=>180*t/Math.PI,Oe=t=>{const e=Fe(Math.atan2(t[1],t[0]));return De(e)},Ie={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Oe,rotateZ:Oe,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},De=t=>((t%=360)<0&&(t+=360),t),Ne=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Re=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Be={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ne,scaleY:Re,scale:t=>(Ne(t)+Re(t))/2,rotateX:t=>De(Fe(Math.atan2(t[6],t[5]))),rotateY:t=>De(Fe(Math.atan2(-t[2],t[0]))),rotateZ:Oe,rotate:Oe,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 Ke(t){return t.includes("scale")?1:0}function Le(t,e){if(!t||"none"===t)return Ke(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Be,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Ie,i=e}if(!i)return Ke(e);const r=s[e],o=i[1].split(",").map(je);return"function"==typeof r?r(o):o[r]}function je(t){return parseFloat(t.trim())}const Ue=t=>t===n||t===a,qe=new Set(["x","y","z"]),We=u.filter((t=>!qe.has(t)));const Ye={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Le(e,"x"),y:(t,{transform:e})=>Le(e,"y")};Ye.translateX=Ye.x,Ye.translateY=Ye.y;const $e=new Set;let ze=!1,He=!1,Xe=!1;function _e(){if(He){const t=Array.from($e).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),n=new Map;e.forEach((t=>{const e=function(t){const e=[];return We.forEach((n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))})),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,n])=>{t.getValue(e)?.set(n)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}He=!1,ze=!1,$e.forEach((t=>t.complete(Xe))),$e.clear()}function Ge(){$e.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(He=!0)}))}class Ze{constructor(t,e,n,s,i,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?($e.add(this),ze||(ze=!0,ut.read(Ge),ut.resolveKeyframes(_e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.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.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$e.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,$e.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Je=R((()=>void 0!==window.ScrollTimeline)),Qe={};function tn(t,e){const n=R(t);return()=>Qe[e]??n()}const en=tn((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),nn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,sn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:nn([0,.65,.55,1]),circOut:nn([.55,0,1,.45]),backIn:nn([.31,.01,.66,-.59]),backOut:nn([.33,1.53,.69,.99])};function rn(t,e){return t?"function"==typeof t?en()?_t(t,e):"ease-out":rt(t)?nn(t):Array.isArray(t)?t.map((t=>rn(t,e)||sn.easeOut)):sn[t]:void 0}function on(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:u}={},l=void 0){const h={[e]:n};u&&(h.offset=u);const c=rn(a,i);Array.isArray(c)&&(h.easing=c);const d={delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};l&&(d.pseudoElement=l);return t.animate(h,d)}function an(t){return"function"==typeof t&&"applyToOptions"in t}class un extends ke{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,t.type;const u=function({type:t,...e}){return an(t)&&en()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=on(e,n,s,u,i),!1===u.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=Me(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()},this.animation.oncancel=()=>this.notifyFinished()}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return W(Number(t))}get time(){return W(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=q(t)}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 Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Je()?(this.animation.timeline=t,B):e(this)}}const ln={anticipate:J,backInOut:Z,circInOut:et};function hn(t){"string"==typeof t.ease&&t.ease in ln&&(t.ease=ln[t.ease])}class cn extends un{constructor(t){hn(t),Ce(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new Pe({...r,autoplay:!1}),a=q(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const dn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!It.test(t)&&"0"!==t||t.startsWith("url(")));const pn=new Set(["opacity","clipPath","filter","transform"]),mn=R((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class fn extends ke{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:u,element:l,...h}){super(),this.stop=()=>{this._animation?(this._animation.stop(),this.stopTimeline?.()):this.keyframeResolver?.cancel()},this.createdAt=mt.now();const c={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:u,element:l,...h},d=l?.KeyframeResolver||Ze;this.keyframeResolver=new d(o,((t,e,n)=>this.onKeyframesResolved(t,e,c,!n)),a,u,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,s,i){this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:u,isHandoff:l,onUpdate:h}=s;this.resolvedAt=mt.now(),function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=dn(i,e),a=dn(r,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||an(n))&&s)}(t,r,o,a)||(!e.instantAnimations&&u||h?.(Me(t,s,n)),t[0]=t[t.length-1],s.duration=0,s.repeat=0);const c={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},d=!l&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!(e&&e.owner&&e.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:u}=e.owner.getProps();return mn()&&n&&pn.has(n)&&("transform"!==n||!u)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}(c)?new cn({...c,element:c.motionValue.owner.current}):new Pe(c);d.finished.then((()=>this.notifyFinished())).catch(B),this.pendingTimeline&&(this.stopTimeline=d.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=d}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then((()=>{}))}get animation(){return this._animation||(Xe=!0,Ge(),_e(),Xe=!1),this._animation}get duration(){return this.animation.duration}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()}}const vn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function yn(t,e,n=1){const[s,i]=function(t){const e=vn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return D(t)?parseFloat(t):t}return o(i)?yn(i,e,n+1):i}function gn(t,e){return t?.[e]??t?.default??t}const bn=new Set(["width","height","top","left","right","bottom",...u]),wn=t=>e=>e.test(t),Tn=[n,a,r,l,h,c,{test:t=>"auto"===t,parse:t=>t}],Sn=t=>Tn.find(wn(t));const An=new Set(["brightness","contrast","saturate","opacity"]);function Vn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(vt)||[];if(!s)return t;const i=n.replace(s,"");let r=An.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Mn=/\b([a-z-]*)\(.*?\)/gu,xn={...It,getAnimatableNone:t=>{const e=t.match(Mn);return e?e.map(Vn).join(" "):t}},Cn={...d,color:Vt,backgroundColor:Vt,outlineColor:Vt,fill:Vt,stroke:Vt,borderColor:Vt,borderTopColor:Vt,borderRightColor:Vt,borderBottomColor:Vt,borderLeftColor:Vt,filter:xn,WebkitFilter:xn},kn=t=>Cn[t];function En(t,e){let n=kn(t);return n!==xn&&(n=It),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Pn=new Set(["auto","none","0"]);class Fn extends Ze{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),o(s))){const i=yn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!bn.has(n)||2!==t.length)return;const[s,i]=t,r=Sn(s),a=Sn(i);if(r!==a)if(Ue(r)&&Ue(a))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||("number"==typeof(s=t[e])?0===s:null===s||"none"===s||"0"===s||N(s)))&&n.push(e);var s;n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!Pn.has(e)&&Et(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=En(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ye[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=Ye[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const On=!1;function In(){return On}function Dn(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function Nn(t){return!("touch"===t.pointerType||In())}const Rn=(t,e)=>!!e&&(t===e||Rn(t,e.parentElement)),Bn=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const Kn=new WeakSet;function Ln(t){return e=>{"Enter"===e.key&&t(e)}}function jn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Un(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!In()}function qn(t,e,n={}){const[s,i,r]=Dn(t,n),o=t=>{const s=t.currentTarget;if(!Un(t)||Kn.has(s))return;Kn.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",u),Un(t)&&Kn.has(s)&&(Kn.delete(s),"function"==typeof r&&r(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||Rn(s,t.target))},u=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",u,i)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ln((()=>{if(Kn.has(n))return;jn(n,"down");const t=Ln((()=>{jn(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>jn(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,i))),e=t,Bn.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),r}class Wn{constructor(t,e={}){this.version="12.9.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=mt.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change?.notify(this.current),e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=mt.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){this.events[t]||(this.events[t]=new U);const n=this.events[t].add(e);return"change"===t?()=>{n(),ut.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=mt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Y(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yn(t,e){return new Wn(t,e)}const $n=[...Tn,Vt,It];function zn(t,e,n){const s=t.getProps();return p(s,e,void 0!==n?n:s.custom,t)}const Hn=t=>Array.isArray(t);function Xn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Yn(n))}function _n(t,n){const s=t.getValue("willChange");if(i=s,Boolean(m(i)&&i.add))return s.add(n);if(!s&&e.WillChange){const s=new e.WillChange("auto");t.addValue("willChange",s),s.add(n)}var i}function Gn(t){return t.props[f]}const Zn=t=>null!==t;const Jn={type:"spring",stiffness:500,damping:25,restSpeed:10},Qn={type:"keyframes",duration:.8},ts={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},es=(t,{keyframes:e})=>e.length>2?Qn:v.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Jn:ts;const ns=(t,n,s,i={},r,o)=>a=>{const u=gn(i,t)||{},l=u.delay||i.delay||0;let{elapsed:h=0}=i;h-=q(l);const c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:n.getVelocity(),...u,delay:-h,onUpdate:t=>{n.set(t),u.onUpdate&&u.onUpdate(t)},onComplete:()=>{a(),u.onComplete&&u.onComplete()},name:t,motionValue:n,element:o?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:u,elapsed:l,...h}){return!!Object.keys(h).length})(u)||Object.assign(c,es(t,c)),c.duration&&(c.duration=q(c.duration)),c.repeatDelay&&(c.repeatDelay=q(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let d=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(d=!0)),(e.instantAnimations||e.skipAnimations)&&(d=!0,c.duration=0,c.delay=0),c.allowFlatten=!u.type&&!u.ease,d&&!o&&void 0!==n.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Zn),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(c.keyframes,u);if(void 0!==t)return void ut.update((()=>{c.onUpdate(t),c.onComplete()}))}return new fn(c)};function ss({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function is(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const u=[],l=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||l&&ss(l,e))continue;const o={delay:n,...gn(r||{},e)},h=s.get();if(void 0!==h&&!s.isAnimating&&!Array.isArray(i)&&i===h&&!o.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){const n=Gn(t);if(n){const t=window.MotionHandoffAnimation(n,e,ut);null!==t&&(o.startTime=t,c=!0)}}_n(t,e),s.start(ns(e,s,i,t.shouldReduceMotion&&bn.has(e)?{type:!1}:o,t,c));const d=s.animation;d&&u.push(d)}return o&&Promise.all(u).then((()=>{ut.update((()=>{o&&function(t,e){const n=zn(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r)Xn(t,e,(o=r[e],Hn(o)?o[o.length-1]||0:o));var o}(t,o)}))})),u}function rs(t,e,n={}){const s=zn(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(is(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,u=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(os).forEach(((t,s)=>{t.notify("AnimationStart",e),o.push(rs(t,e,{...r,delay:n+u(s)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(o)}(t,e,r+s,o,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then((()=>e()))}return Promise.all([r(),o(n.delay)])}function os(t,e){return t.sortNodePosition(e)}function as(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const us=g.length;function ls(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&ls(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<us;n++){const s=g[n],i=t.props[s];(y(i)||!1===i)&&(e[s]=i)}return e}const hs=[...w].reverse(),cs=w.length;function ds(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map((e=>rs(t,e,n)));s=Promise.all(i)}else if("string"==typeof e)s=rs(t,e,n);else{const i="function"==typeof e?zn(t,e,n.custom):e;s=Promise.all(is(t,i,n))}return s.then((()=>{t.notify("AnimationComplete",e)}))}(t,e,n))))}function ps(t){let e=ds(t),n=vs(),s=!0;const i=e=>(n,s)=>{const i=zn(t,s,"exit"===e?t.presenceContext?.custom:void 0);if(i){const{transition:t,transitionEnd:e,...s}=i;n={...n,...s,...e}}return n};function r(r){const{props:o}=t,a=ls(t.parent)||{},u=[],l=new Set;let h={},c=1/0;for(let e=0;e<cs;e++){const d=hs[e],p=n[d],m=void 0!==o[d]?o[d]:a[d],f=y(m),v=d===r?p.isActive:null;!1===v&&(c=e);let g=m===a[d]&&m!==o[d]&&f;if(g&&s&&t.manuallyAnimateOnMount&&(g=!1),p.protectedKeys={...h},!p.isActive&&null===v||!m&&!p.prevProp||b(m)||"boolean"==typeof m)continue;const w=ms(p.prevProp,m);let T=w||d===r&&p.isActive&&!g&&f||e>c&&f,S=!1;const A=Array.isArray(m)?m:[m];let V=A.reduce(i(d),{});!1===v&&(V={});const{prevResolvedValues:M={}}=p,x={...M,...V},C=e=>{T=!0,l.has(e)&&(S=!0,l.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in x){const e=V[t],n=M[t];if(h.hasOwnProperty(t))continue;let s=!1;s=Hn(e)&&Hn(n)?!as(e,n):e!==n,s?null!=e?C(t):l.add(t):void 0!==e&&l.has(t)?C(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=V,p.isActive&&(h={...h,...V}),s&&t.blockInitialAnimation&&(T=!1);T&&(!(g&&w)||S)&&u.push(...A.map((t=>({animation:t,options:{type:d}}))))}if(l.size){const e={};if("boolean"!=typeof o.initial){const n=zn(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}l.forEach((n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=s??null})),u.push({animation:e})}let d=Boolean(u.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){if(n[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach((t=>t.animationState?.setActive(e,s))),n[e].isActive=s;const i=r(e);for(const t in n)n[t].protectedKeys={};return i},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=vs(),s=!0}}}function ms(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!as(e,t)}function fs(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vs(){return{animate:fs(!0),whileInView:fs(),whileHover:fs(),whileTap:fs(),whileDrag:fs(),whileFocus:fs(),exit:fs()}}class ys{constructor(t){this.isMounted=!1,this.node=t}update(){}}let gs=0;const bs={animation:{Feature:class extends ys{constructor(t){super(t),t.animationState||(t.animationState=ps(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();b(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends ys{constructor(){super(...arguments),this.id=gs++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then((()=>{e(this.id)}))}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function ws(t){return{point:{x:t.pageX,y:t.pageY}}}function Ts(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const i=s["onHover"+n];i&&ut.postRender((()=>i(e,ws(e))))}function Ss(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function As(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const i=s["onTap"+("End"===n?"":n)];i&&ut.postRender((()=>i(e,ws(e))))}const Vs=new WeakMap,Ms=new WeakMap,xs=t=>{const e=Vs.get(t.target);e&&e(t)},Cs=t=>{t.forEach(xs)};function ks(t,e,n){const s=function({root:t,...e}){const n=t||document;Ms.has(n)||Ms.set(n,{});const s=Ms.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Cs,{root:t,...e})),s[i]}(e);return Vs.set(t,n),s.observe(t),()=>{Vs.delete(t),s.unobserve(t)}}const Es={some:0,all:1};const Ps={inView:{Feature:class extends ys{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Es[s]};return ks(this.node.current,r,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends ys{mount(){const{current:t}=this.node;t&&(this.unmount=qn(t,((t,e)=>(As(this.node,e,"Start"),(t,{success:e})=>As(this.node,t,e?"End":"Cancel"))),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends ys{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=L(Ss(this.node.current,"focus",(()=>this.onFocus())),Ss(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends ys{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=Dn(t,n),o=t=>{if(!Nn(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{Nn(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach((t=>{t.addEventListener("pointerenter",o,i)})),r}(t,((t,e)=>(Ts(this.node,e,"Start"),t=>Ts(this.node,t,"End")))))}unmount(){}}}};const Fs=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Os={current:null},Is={current:!1};const Ds=new WeakMap;const Ns=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Rs{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ze,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=mt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,ut.render(this.render,!1,!0))};const{latestValues:a,renderState:u}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=S(e),this.isVariantNode=A(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==a[t]&&m(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ds.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Is.current||function(){if(Is.current=!0,T)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Os.current=t.matches;t.addListener(e),e()}else Os.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Os.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),lt(this.notifyUpdate),lt(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(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}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=v.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&ut.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,(()=>{s(),i(),r&&r(),e.owner&&e.stop()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in V){const e=V[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ns.length;e++){const n=Ns[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(m(i))t.addValue(s,i);else if(m(r))t.addValue(s,Yn(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,Yn(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Yn(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(D(n)||N(n))?n=parseFloat(n):(s=n,!$n.find(wn(s))&&It.test(e)&&(n=En(t,e))),this.setBaseTarget(t,m(n)?n.get():n)),m(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=p(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||m(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new U),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Bs extends Rs{constructor(){super(...arguments),this.KeyframeResolver=Fn}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[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;m(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}function Ks(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class Ls extends Bs{constructor(){super(...arguments),this.type="html",this.renderInstance=Ks}readValueFromInstance(t,e){if(v.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Le(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(M(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return function(t,e){return function({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}(t,e)}build(t,e,n){x(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return C(t,e,n)}}const js=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"]);class Us extends Bs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Fs}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(v.has(e)){const t=kn(e);return t&&t.default||0}return e=js.has(e)?e:k(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return E(t,e,n)}build(t,e,n){P(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Ks(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(js.has(n)?n:k(n),e.attrs[n])}(t,e,0,s)}mount(t){this.isSVGTag=F(t.tagName),super.mount(t)}}const qs={renderer:(t,e)=>O(t)?new Us(e):new Ls(e,{allowProjection:t!==I}),...bs,...Ps};export{qs as domAnimation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createContext as t}from"react";const e=(t,e,
|
|
1
|
+
import{createContext as t}from"react";const e=(t,e,r)=>r>e?e:r<t?t:r,r={},s=t({});function a(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function o(t){return"string"==typeof t||Array.isArray(t)}const n=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],i=["initial",...n];function c(t){return a(t.animate)||i.some((e=>o(t[e])))}function l(t){return Boolean(c(t)||t.variants)}const f="undefined"!=typeof window,p={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},d={};for(const t in p)d[t]={isEnabled:e=>p[t].some((t=>!!e[t]))};function u(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}const m=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],g={value:null,addProjectionMetrics:null};function h(t,e){let s=!1,a=!0;const o={delta:0,timestamp:0,isProcessing:!1},n=()=>s=!0,i=m.reduce(((t,r)=>(t[r]=function(t,e){let r=new Set,s=new Set,a=!1,o=!1;const n=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1},c=0;function l(e){n.has(e)&&(f.schedule(e),t()),c++,e(i)}const f={schedule:(t,e=!1,o=!1)=>{const i=o&&a?r:s;return e&&n.add(t),i.has(t)||i.add(t),t},cancel:t=>{s.delete(t),n.delete(t)},process:t=>{i=t,a?o=!0:(a=!0,[r,s]=[s,r],r.forEach(l),e&&g.value&&g.value.frameloop[e].push(c),c=0,r.clear(),a=!1,o&&(o=!1,f.process(t)))}};return f}(n,e?r:void 0),t)),{}),{setup:c,read:l,resolveKeyframes:f,preUpdate:p,update:d,preRender:u,render:h,postRender:y}=i,v=()=>{const n=r.useManualTiming?o.timestamp:performance.now();s=!1,r.useManualTiming||(o.delta=a?1e3/60:Math.max(Math.min(n-o.timestamp,40),1)),o.timestamp=n,o.isProcessing=!0,c.process(o),l.process(o),f.process(o),p.process(o),d.process(o),u.process(o),h.process(o),y.process(o),o.isProcessing=!1,s&&e&&(a=!1,t(v))};return{schedule:m.reduce(((e,r)=>{const n=i[r];return e[r]=(e,r=!1,i=!1)=>(s||(s=!0,a=!0,o.isProcessing||t(v)),n.schedule(e,r,i)),e}),{}),cancel:t=>{for(let e=0;e<m.length;e++)i[m[e]].cancel(t)},state:o,steps:i}}const y=t=>e=>"string"==typeof e&&e.startsWith(t),v=y("--"),w=y("var(--"),b=t=>!!w(t)&&x.test(t.split("/*")[0].trim()),x=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,k={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},P={...k,transform:t=>e(0,1,t)},S={...k,default:1},O=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),R=O("deg"),B=O("%"),T=O("px"),X=O("vh"),Y=O("vw"),W=(()=>({...B,parse:t=>B.parse(t)/100,transform:t=>B.transform(100*t)}))(),$=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],L=(()=>new Set($))(),V={...k,transform:Math.round},Z={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,backgroundPositionX:T,backgroundPositionY:T,...{rotate:R,rotateX:R,rotateY:R,rotateZ:R,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:R,skewX:R,skewY:R,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:P,originX:W,originY:W,originZ:T},zIndex:V,fillOpacity:P,strokeOpacity:P,numOctaves:V},{schedule:I,cancel:M}=h(queueMicrotask,!1),A=(t,e)=>e&&"number"==typeof t?e.transform(t):t,C=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),E="data-"+C("framerAppearId"),F=t(null),H=t({}),z={};function j(t){for(const e in t)z[e]=t[e],v(e)&&(z[e].isCSSVariable=!0)}function D(t,{layout:e,layoutId:r}){return L.has(t)||t.startsWith("origin")||(e||void 0!==r)&&(!!z[t]||"opacity"===t)}const K=t=>Boolean(t&&t.getVelocity),U={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},q=$.length;function G(t,e,r){const{style:s,vars:a,transformOrigin:o}=t;let n=!1,i=!1;for(const t in e){const r=e[t];if(L.has(t))n=!0;else if(v(t))a[t]=r;else{const e=A(r,Z[t]);t.startsWith("origin")?(i=!0,o[t]=e):s[t]=e}}if(e.transform||(n||r?s.transform=function(t,e,r){let s="",a=!0;for(let o=0;o<q;o++){const n=$[o],i=t[n];if(void 0===i)continue;let c=!0;if(c="number"==typeof i?i===(n.startsWith("scale")?1:0):0===parseFloat(i),!c||r){const t=A(i,Z[n]);c||(a=!1,s+=`${U[n]||n}(${t}) `),r&&(e[n]=t)}}return s=s.trim(),r?s=r(e,a?"":s):a&&(s="none"),s}(e,t.transform,r):s.transform&&(s.transform="none")),i){const{originX:t="50%",originY:e="50%",originZ:r=0}=o;s.transformOrigin=`${t} ${e} ${r}`}}const J=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function N(t){return"string"==typeof t&&!t.includes("-")&&!!(J.indexOf(t)>-1||/[A-Z]/u.test(t))}const Q={offset:"stroke-dashoffset",array:"stroke-dasharray"},_={offset:"strokeDashoffset",array:"strokeDasharray"};function tt(t,{attrX:e,attrY:r,attrScale:s,pathLength:a,pathSpacing:o=1,pathOffset:n=0,...i},c,l){if(G(t,i,l),c)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:f,style:p}=t;f.transform&&(p.transform=f.transform,delete f.transform),(p.transform||f.transformOrigin)&&(p.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),p.transform&&(p.transformBox="fill-box",delete f.transformBox),void 0!==e&&(f.x=e),void 0!==r&&(f.y=r),void 0!==s&&(f.scale=s),void 0!==a&&function(t,e,r=1,s=0,a=!0){t.pathLength=1;const o=a?Q:_;t[o.offset]=T.transform(-s);const n=T.transform(e),i=T.transform(r);t[o.array]=`${n} ${i}`}(f,a,o,n,!1)}const et=t=>"string"==typeof t&&"svg"===t.toLowerCase();function rt(t){const e=[{},{}];return t?.values.forEach(((t,r)=>{e[0][r]=t.get(),e[1][r]=t.getVelocity()})),e}function st(t,e,r,s){if("function"==typeof e){const[a,o]=rt(s);e=e(void 0!==r?r:t.custom,a,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[a,o]=rt(s);e=e(void 0!==r?r:t.custom,a,o)}return e}function at(t){return K(t)?t.get():t}function ot(t,e,r){const{style:s}=t,a={};for(const o in s)(K(s[o])||e.style&&K(e.style[o])||D(o,t)||void 0!==r?.getValue(o)?.liveStyle)&&(a[o]=s[o]);return a}function nt(t,e,r){const s=ot(t,e,r);for(const r in t)if(K(t[r])||K(e[r])){s[-1!==$.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]}return s}export{$ as A,R as B,Y as C,X as D,Z as E,L as F,z as G,v as H,j as I,i as J,n as K,s as L,r as M,C as N,F as P,H as S,o as a,u as b,f as c,K as d,D as e,d as f,G as g,tt as h,c as i,et as j,N as k,l,I as m,a as n,E as o,st as p,nt as q,at as r,ot as s,h as t,k as u,P as v,e as w,B as x,b as y,T as z};
|