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