!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";function e(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let n=()=>{};const s={skipAnimations:!1,useManualTiming:!1};function r(t){let e;return()=>(void 0===e&&(e=t()),e)}const i=t=>t,o=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class a{constructor(){this.subscriptions=[]}add(t){var n,s;return n=this.subscriptions,s=t,-1===n.indexOf(s)&&n.push(s),()=>e(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 r=0;r1e3*t,u=t=>t/1e3;function c(t,e){return e?t*(1e3/e):0}const h=r((()=>void 0!==window.ScrollTimeline));class d{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;nh()&&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;ee[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class p extends d{then(t,e){return this.finished.finally(t).then((()=>{}))}}const f=t=>t.startsWith("--"),m=(t,e,n)=>{f(e)?t.style.setProperty(e,n):t.style[e]=n},g=(t,e)=>f(e)?t.style.getPropertyValue(e):t.style[e],y=t=>null!==t;const v=r((()=>{try{document.createElement("div").animate({opacity:[1]})}catch(t){return!1}return!0})),w=new Set(["borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","radius","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","width","maxWidth","height","maxHeight","top","right","bottom","left","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","backgroundPositionX","backgroundPositionY"]);const b={value:null,addProjectionMetrics:null},T=t=>Array.isArray(t)&&"number"==typeof t[0],x={};function S(t,e){const n=r(t);return()=>x[e]??n()}const M=S((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}),"linearEasing"),A=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let e=0;e`cubic-bezier(${t}, ${e}, ${n}, ${s})`,k={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 P(t,e){return t?"function"==typeof t&&M()?A(t,e):T(t)?V(t):Array.isArray(t)?t.map((t=>P(t,e)||k.easeOut)):k[t]:void 0}function E(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=P(a,r);Array.isArray(h)&&(c.easing=h);return t.animate(c,{delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:"reverse"===o?"alternate":"normal",pseudoElement:u})}function C(t){return"function"==typeof t&&"applyToOptions"in t}const F=new WeakMap;class O{constructor(t){if("animation"in t)return void(this.animation=t.animation);const{element:e,name:n,keyframes:s,pseudoElement:r,allowFlatten:i=!1}=t;let{transition:o}=t;this.isPseudoElement=Boolean(r),this.allowFlatten=i;const a=function(t){const e=F.get(t)||new Map;return F.set(t,e),e}(e),l=((t,e)=>`${t}:${e}`)(n,r||""),u=a.get(l);u&&u.stop();const c=function(t,e,n,s){Array.isArray(n)||(n=[n]);for(let r=0;ra.delete(l),this.animation.onfinish=()=>{r||(m(e,n,function(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(y),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}(c,o)),this.cancel())},a.set(l,this)}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.finish()}cancel(){try{this.animation.cancel()}catch(t){}this.removeAnimation()}stop(){const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.commitStyles(),this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming().duration||0;return u(Number(t))}get time(){return u(Number(this.animation.currentTime)||0)}set time(t){this.animation.currentTime=l(t)}get speed(){return this.animation.playbackRate}set speed(t){this.animation.playbackRate=t}get state(){return this.animation.playState}get startTime(){return Number(this.animation.startTime)}get finished(){return this.animation.finished}flatten(){this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"})}attachTimeline(t){return this.animation.timeline=t,this.animation.onfinish=null,i}then(t,e){return this.finished.then(t).catch(e)}}function R(t,e){return t?.[e]??t?.default??t}const B=2e4;function L(t){let e=0;let n=t.next(e);for(;!n.done&&e=B?1/0:e}function I(t,e=100,n){const s=n({...t,keyframes:[0,e]}),r=Math.min(L(s),B);return{type:"keyframes",ease:t=>s.next(r*t).value/e,duration:u(r)}}function W(t){return Boolean("function"==typeof t&&M()||!t||"string"==typeof t&&(t in k||M())||T(t)||Array.isArray(t)&&t.every(W))}function D(t,e){t.timeline=e,t.onfinish=null}const N=["read","resolveKeyframes","update","preRender","render","postRender"];function K(t,e){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=N.reduce(((t,n)=>(t[n]=function(t,e){let n=new Set,s=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)&&(c.schedule(e),t()),l++,e(a)}const c={schedule:(t,e=!1,i=!1)=>{const a=i&&r?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,r?i=!0:(r=!0,[n,s]=[s,n],n.forEach(u),e&&b.value&&b.value.frameloop[e].push(l),l=0,n.clear(),r=!1,i&&(i=!1,c.process(t)))}};return c}(i,e?n:void 0),t)),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,p=()=>{const i=performance.now();n=!1,r.delta=s?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),c.process(r),h.process(r),d.process(r),r.isProcessing=!1,n&&e&&(s=!1,t(p))};return{schedule:N.reduce(((e,i)=>{const a=o[i];return e[i]=(e,i=!1,o=!1)=>(n||(n=!0,s=!0,r.isProcessing||t(p)),a.schedule(e,i,o)),e}),{}),cancel:t=>{for(let e=0;e(void 0===U&&H.set(z.isProcessing||s.useManualTiming?z.timestamp:performance.now()),U),set:t=>{U=t,queueMicrotask(X)}},q=!1;function G(){return q}function Z(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const r=n?.[t]??s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function _(t,e){const n=Z(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function J(t){return!("touch"===t.pointerType||G())}const Q=(t,e)=>!!e&&(t===e||Q(t,e.parentElement)),tt=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const et=new WeakSet;function nt(t){return e=>{"Enter"===e.key&&t(e)}}function st(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function rt(t){return(t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary)(t)&&!G()}class it{constructor(t,e={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=H.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=H.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 a);const n=this.events[t].add(e);return"change"===t?()=>{n(),$.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=H.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return c(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 ot(t,e){return new it(t,e)}const at=$,lt=N.reduce(((t,e)=>(t[e]=t=>j(t),t)),{}),ut=(t,e,n)=>n>e?e:n{const s=e*o,r=s*t,i=s-n,a=kt(e,o),l=Math.exp(-r);return Mt-i/a*l},i=e=>{const s=e*o*t,i=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),u=kt(Math.pow(e,2),o);return(-r(e)+Mt>0?-1:1)*((i-a)*l)/u}):(r=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;nvoid 0!==t[e]))}function Ft(t=yt,e=gt){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:c,damping:h,mass:d,duration:p,velocity:f,isResolvedFromDuration:m}=function(t){let e={velocity:ft,stiffness:ht,damping:dt,mass:pt,isResolvedFromDuration:!1,...t};if(!Ct(t,Et)&&Ct(t,Pt))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),r=s*s,i=2*ut(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:pt,stiffness:r,damping:i}}else{const n=At(t);e={...e,...n,mass:pt},e.isResolvedFromDuration=!0}return e}({...n,velocity:-u(n.velocity||0)}),g=f||0,y=h/(2*Math.sqrt(c*d)),v=o-i,w=u(Math.sqrt(c/d)),b=Math.abs(v)<5;let T;if(s||(s=b?vt.granular:vt.default),r||(r=b?wt.granular:wt.default),y<1){const t=kt(w,y);T=e=>{const n=Math.exp(-y*w*e);return o-n*((g+y*w*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===y)T=t=>o-Math.exp(-w*t)*(v+(g+w*v)*t);else{const t=w*Math.sqrt(y*y-1);T=e=>{const n=Math.exp(-y*w*e),s=Math.min(t*e,300);return o-n*((g+y*w*v)*Math.sinh(s)+t*v*Math.cosh(s))/t}}const x={calculatedDuration:m&&p||null,next:t=>{const e=T(t);if(m)a.done=t>=p;else{let n=0;y<1&&(n=0===t?l(g):ct(T,t,e));const i=Math.abs(n)<=s,u=Math.abs(o-e)<=r;a.done=i&&u}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(L(x),B),e=A((e=>x.next(t*e).value),t,30);return t+"ms "+e},toTransition:()=>{}};return x}Ft.applyToOptions=t=>{const e=I(t,100,Ft);return t.ease=M()?e.ease:"easeOut",t.duration=l(e.duration),t.type="keyframes",t};const Ot=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},Rt=t=>Array.isArray(t)&&"number"!=typeof t[0];function Bt(t,e){return Rt(t)?t[Ot(0,t.length,e)]:t}const Lt=(t,e,n)=>t+(e-t)*n;function It(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=o(0,e,s);t.push(Lt(n,1,r))}}function Wt(t){const e=[0];return It(e,t.length-1),e}const Dt=t=>Boolean(t&&t.getVelocity);function Nt(t){return"object"==typeof t&&!Array.isArray(t)}function Kt(t,e,n,s){return"string"==typeof t&&Nt(e)?Z(t,n,s):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function $t(t,e,n){return t*(e+1)}function jt(t,e,n,s){return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:s.get(e)??t}function zt(t,n,s,r,i,o){!function(t,n,s){for(let r=0;rn&&i.at"number"==typeof t,_t=t=>t.every(Zt),Jt=new WeakMap,Qt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],te=new Set(Qt),ee=new Set(["width","height","top","left","right","bottom",...Qt]),ne=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function se(t){const e=[{},{}];return t?.values.forEach(((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()})),e}function re(t,e,n,s){if("function"==typeof e){const[r,i]=se(s);e=e(void 0!==n?n:t.custom,r,i)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[r,i]=se(s);e=e(void 0!==n?n:t.custom,r,i)}return e}function ie(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ot(n))}function oe(t,e){const n=function(t,e,n){const s=t.getProps();return re(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const e in i){ie(t,e,ne(i[e]))}}function ae(t,e){const n=t.getValue("willChange");if(r=n,Boolean(Dt(r)&&r.add))return n.add(e);if(!n&&s.WillChange){const n=new s.WillChange("auto");t.addValue("willChange",n),n.add(e)}var r}const le=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ue="data-"+le("framerAppearId");function ce(t){return t.props[ue]}const he=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function de(t,e,n,s){if(t===e&&n===s)return i;const r=e=>function(t,e,n,s,r){let i,o,a=0;do{o=e+(n-e)/2,i=he(o,s,r)-t,i>0?n=o:e=o}while(Math.abs(i)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:he(r(t),e,s)}const pe=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,fe=t=>e=>1-t(1-e),me=de(.33,1.53,.69,.99),ge=fe(me),ye=pe(ge),ve=t=>(t*=2)<1?.5*ge(t):.5*(2-Math.pow(2,-10*(t-1))),we=t=>1-Math.sin(Math.acos(t)),be=fe(we),Te=pe(we),xe=t=>/^0[^.\s]+$/u.test(t);const Se={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Me={...Se,transform:t=>ut(0,1,t)},Ae={...Se,default:1},Ve=t=>Math.round(1e5*t)/1e5,ke=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Pe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ee=(t,e)=>n=>Boolean("string"==typeof n&&Pe.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ce=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[r,i,o,a]=s.match(ke);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Fe={...Se,transform:t=>Math.round((t=>ut(0,255,t))(t))},Oe={test:Ee("rgb","red"),parse:Ce("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Fe.transform(t)+", "+Fe.transform(e)+", "+Fe.transform(n)+", "+Ve(Me.transform(s))+")"};const Re={test:Ee("#"),parse:function(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}},transform:Oe.transform},Be=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Le=Be("deg"),Ie=Be("%"),We=Be("px"),De=Be("vh"),Ne=Be("vw"),Ke={...Ie,parse:t=>Ie.parse(t)/100,transform:t=>Ie.transform(100*t)},$e={test:Ee("hsl","hue"),parse:Ce("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Ie.transform(Ve(e))+", "+Ie.transform(Ve(n))+", "+Ve(Me.transform(s))+")"},je={test:t=>Oe.test(t)||Re.test(t)||$e.test(t),parse:t=>Oe.test(t)?Oe.parse(t):$e.test(t)?$e.parse(t):Re.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Oe.transform(t):$e.transform(t)},ze=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Ye="number",Ue="color",Xe=/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 He(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const o=e.replace(Xe,(t=>(je.test(t)?(s.color.push(i),r.push(Ue),n.push(je.parse(t))):t.startsWith("var(")?(s.var.push(i),r.push("var"),n.push(t)):(s.number.push(i),r.push(Ye),n.push(parseFloat(t))),++i,"${}"))).split("${}");return{values:n,split:o,indexes:s,types:r}}function qe(t){return He(t).values}function Ge(t){const{split:e,types:n}=He(t),s=e.length;return t=>{let r="";for(let i=0;i"number"==typeof t?0:t;const _e={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(ke)?.length||0)+(t.match(ze)?.length||0)>0},parse:qe,createTransformer:Ge,getAnimatableNone:function(t){const e=qe(t);return Ge(t)(e.map(Ze))}},Je=new Set(["brightness","contrast","saturate","opacity"]);function Qe(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(ke)||[];if(!s)return t;const r=n.replace(s,"");let i=Je.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const tn=/\b([a-z-]*)\(.*?\)/gu,en={..._e,getAnimatableNone:t=>{const e=t.match(tn);return e?e.map(Qe).join(" "):t}},nn={borderWidth:We,borderTopWidth:We,borderRightWidth:We,borderBottomWidth:We,borderLeftWidth:We,borderRadius:We,radius:We,borderTopLeftRadius:We,borderTopRightRadius:We,borderBottomRightRadius:We,borderBottomLeftRadius:We,width:We,maxWidth:We,height:We,maxHeight:We,top:We,right:We,bottom:We,left:We,padding:We,paddingTop:We,paddingRight:We,paddingBottom:We,paddingLeft:We,margin:We,marginTop:We,marginRight:We,marginBottom:We,marginLeft:We,backgroundPositionX:We,backgroundPositionY:We},sn={rotate:Le,rotateX:Le,rotateY:Le,rotateZ:Le,scale:Ae,scaleX:Ae,scaleY:Ae,scaleZ:Ae,skew:Le,skewX:Le,skewY:Le,distance:We,translateX:We,translateY:We,translateZ:We,x:We,y:We,z:We,perspective:We,transformPerspective:We,opacity:Me,originX:Ke,originY:Ke,originZ:We},rn={...Se,transform:Math.round},on={...nn,...sn,zIndex:rn,size:We,fillOpacity:Me,strokeOpacity:Me,numOctaves:rn},an={...on,color:je,backgroundColor:je,outlineColor:je,fill:je,stroke:je,borderColor:je,borderTopColor:je,borderRightColor:je,borderBottomColor:je,borderLeftColor:je,filter:en,WebkitFilter:en},ln=t=>an[t];function un(t,e){let n=ln(t);return n!==en&&(n=_e),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const cn=new Set(["auto","none","0"]);const hn=t=>180*t/Math.PI,dn=t=>{const e=hn(Math.atan2(t[1],t[0]));return fn(e)},pn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:dn,rotateZ:dn,skewX:t=>hn(Math.atan(t[1])),skewY:t=>hn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},fn=t=>((t%=360)<0&&(t+=360),t),mn=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),gn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),yn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:mn,scaleY:gn,scale:t=>(mn(t)+gn(t))/2,rotateX:t=>fn(hn(Math.atan2(t[6],t[5]))),rotateY:t=>fn(hn(Math.atan2(-t[2],t[0]))),rotateZ:dn,rotate:dn,skewX:t=>hn(Math.atan(t[4])),skewY:t=>hn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function vn(t){return t.includes("scale")?1:0}function wn(t,e){if(!t||"none"===t)return vn(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=yn,r=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=pn,r=e}if(!r)return vn(e);const i=s[e],o=r[1].split(",").map(bn);return"function"==typeof i?i(o):o[i]}function bn(t){return parseFloat(t.trim())}const Tn=t=>t===Se||t===We,xn=new Set(["x","y","z"]),Sn=Qt.filter((t=>!xn.has(t)));const Mn={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})=>wn(e,"x"),y:(t,{transform:e})=>wn(e,"y")};Mn.translateX=Mn.x,Mn.translateY=Mn.y;const An=new Set;let Vn=!1,kn=!1;function Pn(){if(kn){const t=Array.from(An).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 Sn.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)}))}kn=!1,Vn=!1,An.forEach((t=>t.complete())),An.clear()}function En(){An.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(kn=!0)}))}class Cn{constructor(t,e,n,s,r,i=!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=r,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(An.add(this),Vn||(Vn=!0,$.read(En),$.resolveKeyframes(Pn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;for(let r=0;r/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),On=t=>e=>"string"==typeof e&&e.startsWith(t),Rn=On("--"),Bn=On("var(--"),Ln=t=>!!Bn(t)&&In.test(t.split("/*")[0].trim()),In=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dn(t,e,n=1){const[s,r]=function(t){const e=Wn.exec(t);if(!e)return[,];const[,n,s,r]=e;return[`--${n??s}`,r]}(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const t=i.trim();return Fn(t)?parseFloat(t):t}return Ln(r)?Dn(r,e,n+1):r}const Nn=t=>e=>e.test(t),Kn=[Se,We,Ie,Le,Ne,De,{test:t=>"auto"===t,parse:t=>t}],$n=t=>Kn.find(Nn(t));class jn extends Cn{constructor(t,e,n,s,r){super(t,e,n,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const zn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!_e.test(t)&&"0"!==t||t.startsWith("url(")));function Yn(t,e,n,s){const r=t[0];if(null===r)return!1;if("display"===e||"visibility"===e)return!0;const i=t[t.length-1],o=zn(r,e),a=zn(i,e);return!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;nnull!==t;function Xn(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(Un),i=e&&"loop"!==n&&e%2==1?0:r.length-1;return i&&void 0!==s?s:r[i]}class Hn{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=H.now(),this.options={autoplay:t,delay:e,type:n,repeat:s,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||(En(),Pn()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=H.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:r,delay:i,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!Yn(t,n,s,r)){if(!i)return a&&a(Xn(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 qn(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 Gn(t,e){return n=>n>0?e:t}const Zn=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},_n=[Re,Oe,$e];function Jn(t){const e=(n=t,_n.find((t=>t.test(n))));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===$e&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let r=0,i=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;r=qn(a,s,t+1/3),i=qn(a,s,t),o=qn(a,s,t-1/3)}else r=i=o=n;return{red:Math.round(255*r),green:Math.round(255*i),blue:Math.round(255*o),alpha:s}}(s)),s}const Qn=(t,e)=>{const n=Jn(t),s=Jn(e);if(!n||!s)return Gn(t,e);const r={...n};return t=>(r.red=Zn(n.red,s.red,t),r.green=Zn(n.green,s.green,t),r.blue=Zn(n.blue,s.blue,t),r.alpha=Lt(n.alpha,s.alpha,t),Oe.transform(r))},ts=(t,e)=>n=>e(t(n)),es=(...t)=>t.reduce(ts),ns=new Set(["none","hidden"]);function ss(t,e){return n=>Lt(t,e,n)}function rs(t){return"number"==typeof t?ss:"string"==typeof t?Ln(t)?Gn:je.test(t)?Qn:as:Array.isArray(t)?is:"object"==typeof t?je.test(t)?Qn:os:Gn}function is(t,e){const n=[...t],s=n.length,r=t.map(((t,n)=>rs(t)(t,e[n])));return t=>{for(let e=0;e{for(const e in s)n[e]=s[e](t);return n}}const as=(t,e)=>{const n=_e.createTransformer(e),s=He(t),r=He(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?ns.has(t)&&!r.values.length||ns.has(e)&&!s.values.length?function(t,e){return ns.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):es(is(function(t,e){const n=[],s={color:0,var:0,number:0};for(let r=0;rvoid 0===a?l:void 0===l||Math.abs(a-t)-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&el)&&(b=t,T=Ft({keyframes:[d.value,p(d.value)],velocity:ct(v,t,d.value),damping:r,stiffness:i,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const cs=de(.42,0,1,1),hs=de(0,0,.58,1),ds=de(.42,0,.58,1),ps={linear:i,easeIn:cs,easeInOut:ds,easeOut:hs,circIn:we,circInOut:Te,circOut:be,backIn:ge,backInOut:ye,backOut:me,anticipate:ve},fs=t=>{if(T(t)){t.length;const[e,n,s,r]=t;return de(e,n,s,r)}return"string"==typeof t?ps[t]:t};function ms(t,e,{clamp:n=!0,ease:s,mixer:r}={}){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,n){const s=[],r=n||ls,o=t.length-1;for(let n=0;n{if(l&&n1)for(;sh(ut(t[0],t[a-1],e)):h}function gs({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=Rt(s)?s.map(fs):fs(s),i={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:Wt(e),t),a=ms(o,e,{ease:Array.isArray(r)?r:(l=e,u=r,l.map((()=>u||ds)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(i.value=a(e),i.done=e>=t,i)}}const ys=t=>{const e=({timestamp:e})=>t(e);return{start:()=>$.update(e,!0),stop:()=>j(e),now:()=>z.isProcessing?z.timestamp:H.now()}},vs={decay:us,inertia:us,tween:gs,keyframes:gs,spring:Ft},ws=t=>t/100;class bs extends Hn{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:r}=this.options,i=s?.KeyframeResolver||Cn;this.resolver=new i(r,((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:r,velocity:i=0}=this.options,o=C(e)?e:vs[e]||gs;let a,l;o!==gs&&"number"!=typeof t[0]&&(a=es(ws,ls(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=L(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(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:r,mirroredGenerator:i,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return r.next(0);const{delay:h,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 g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,w=r;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=i)),v=ut(0,1,n)*c}const b=y?{done:!1,value:a[0]}:w.next(v);o&&(b.value=o(b.value));let{done:T}=b;y||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=Xn(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?u(t.calculatedDuration):0}get time(){return u(this.currentTime)}set time(t){t=l(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=u(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=ys,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 Ts=new Set(["opacity","clipPath","filter","transform"]),xs=r((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));const Ss={anticipate:ve,backInOut:ye,circInOut:Te};class Ms extends Hn{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:r}=this.options;this.resolver=new jn(r,((t,e)=>this.onKeyframesResolved(t,e)),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:n=300,times:s,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&&M()&&r in Ss&&(r=Ss[r]),C((u=this.options).type)||"spring"===u.type||!W(u.ease)){const{onComplete:e,onUpdate:o,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new bs({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<2e4;)s=n.sample(i),r.push(s.value),i+=10;return{times:void 0,keyframes:r,duration:i-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),n=c.duration,s=c.times,r=c.ease,i="keyframes"}const c=E(o.owner.current,a,t,{...this.options,duration:n,times:s,ease:r});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(D(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;o.set(Xn(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:s,type:i,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return u(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return u(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=l(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 i;const{animation:n}=e;D(n,t)}else this.pendingTimeline=t;return i}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:r,ease:i,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:u,...c}=this.options,h=new bs({...c,keyframes:n,duration:s,type:r,ease:i,times:o,isGenerator:!0}),d=l(this.time);t.setWithVelocity(h.sample(d-10).value,h.sample(d).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: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 xs()&&n&&Ts.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==r&&0!==i&&"inertia"!==o}}const As={type:"spring",stiffness:500,damping:25,restSpeed:10},Vs={type:"keyframes",duration:.8},ks={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ps=(t,{keyframes:e})=>e.length>2?Vs:te.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:As:ks;const Es=(t,e,n,s={},r,i)=>o=>{const a=R(s,t)||{},u=a.delay||s.delay||0;let{elapsed:c=0}=s;c-=l(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:r};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(h={...h,...Ps(t,h)}),h.duration&&(h.duration=l(h.duration)),h.repeatDelay&&(h.repeatDelay=l(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),h.allowFlatten=!a.type&&!a.ease,d&&!i&&void 0!==e.get()){const t=Xn(h.keyframes,a);if(void 0!==t)return $.update((()=>{h.onUpdate(t),h.onComplete()})),new p([])}return!i&&Ms.supports(h)?new Ms(h):new bs(h)};function Cs({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Fs(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(i=s);const l=[],u=r&&t.animationState&&t.animationState.getState()[r];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),r=a[e];if(void 0===r||u&&Cs(u,e))continue;const o={delay:n,...R(i||{},e)};let c=!1;if(window.MotionHandoffAnimation){const n=ce(t);if(n){const t=window.MotionHandoffAnimation(n,e,$);null!==t&&(o.startTime=t,c=!0)}}ae(t,e),s.start(Es(e,s,r,t.shouldReduceMotion&&ee.has(e)?{type:!1}:o,t,c));const h=s.animation;h&&l.push(h)}return o&&Promise.all(l).then((()=>{$.update((()=>{o&&oe(t,o)}))})),l}const Os=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Rs={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"]},Bs={};for(const t in Rs)Bs[t]={isEnabled:e=>Rs[t].some((t=>!!e[t]))};const Ls="undefined"!=typeof window,Is={current:null},Ws={current:!1};const Ds=[...Kn,je,_e];const Ns=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Ks(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Ns.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])));var e}const $s=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class js{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,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=Cn,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=H.now();this.renderScheduledAtthis.bindToMotionValue(e,t))),Ws.current||function(){if(Ws.current=!0,Ls)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Is.current=t.matches;t.addListener(e),e()}else Is.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Is.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),j(this.notifyUpdate),j(this.render),this.valueSubscriptions.forEach((t=>t())),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=te.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&$.preRender(this.notifyUpdate),n&&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,(()=>{s(),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 Bs){const e=Bs[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<$s.length;e++){const n=$s[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 r=e[s],i=n[s];if(Dt(r))t.addValue(s,r);else if(Dt(i))t.addValue(s,ot(r,{owner:t}));else if(i!==r)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(r):e.hasAnimated||e.set(r)}else{const e=t.getStaticValue(s);t.addValue(s,ot(void 0!==e?e:r,{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=ot(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&&(Fn(n)||xe(n))?n=parseFloat(n):(s=n,!Ds.find(Nn(s))&&_e.test(e)&&(n=un(t,e))),this.setBaseTarget(t,Dt(n)?n.get():n)),Dt(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=re(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Dt(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new a),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class zs extends js{constructor(){super(...arguments),this.KeyframeResolver=jn}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;Dt(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}}const Ys=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Us={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Xs=Qt.length;function Hs(t,e,n){const{style:s,vars:r,transformOrigin:i}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(te.has(t))o=!0;else if(Rn(t))r[t]=n;else{const e=Ys(n,on[t]);t.startsWith("origin")?(a=!0,i[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",r=!0;for(let i=0;i{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(te.has(e)){const t=ln(e);return t&&t.default||0}return e=Js.has(e)?e:le(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=nr(t,e,n);for(const n in t)(Dt(t[n])||Dt(e[n]))&&(s[-1!==Qt.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]);return s}(t,e,n)}onBindTransform(){this.current&&!this.renderState.dimensions&&$.postRender(this.updateDimensions)}build(t,e,n){_s(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Qs(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Js.has(n)?n:le(n),e.attrs[n])}(t,e,0,s)}mount(t){var e;this.isSVGTag="string"==typeof(e=t.tagName)&&"svg"===e.toLowerCase(),super.mount(t)}}class rr extends zs{constructor(){super(...arguments),this.type="html",this.renderInstance=Qs}readValueFromInstance(t,e){if(te.has(e))return((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return wn(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),r=(Rn(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof r?r.trim():r}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){Hs(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return nr(t,e,n)}}class ir extends js{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(function(t,e){return t in e}(e,t)){const n=t[e];if("string"==typeof n||"number"==typeof n)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function or(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=function(t){return t instanceof SVGElement&&"svg"!==t.tagName}(t)?new sr(e):new rr(e);n.mount(t),Jt.set(t,n)}function ar(t){const e=new ir({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});e.mount(t),Jt.set(t,e)}function lr(t,e,n,s){const r=[];if(function(t,e){return Dt(t)||"number"==typeof t||"string"==typeof t&&!Nt(e)}(t,e))r.push(function(t,e,n){const s=Dt(t)?t:ot(t);return s.start(Es("",s,e,n)),s.animation}(t,Nt(e)&&e.default||e,n&&n.default||n));else{const i=Kt(t,e,s),o=i.length;for(let t=0;t{const u=qt(t),{delay:c=0,times:h=Wt(u),type:d="keyframes",repeat:m,repeatType:g,repeatDelay:v=0,...w}=n;let{ease:b=e.ease||"easeOut",duration:T}=n;const x="function"==typeof c?c(o,a):c,S=u.length,M=C(d)?d:r?.[d];if(S<=2&&M){let t=100;if(2===S&&_t(u)){const e=u[1]-u[0];t=Math.abs(e)}const e={...w};void 0!==T&&(e.duration=l(T));const n=I(e,t,M);b=n.ease,T=n.duration}T??(T=i);const A=p+x;1===h.length&&0===h[0]&&(h[1]=1);const V=h.length-u.length;if(V>0&&It(h,V),1===u.length&&u.unshift(null),m){T=$t(T,m);const t=[...u],e=[...h];b=Array.isArray(b)?[...b]:[b];const n=[...b];for(let s=0;s{for(const r in t){const i=t[r];i.sort(Ut);const l=[],u=[],c=[];for(let t=0;t{s.push(...lr(n,t,e))})),s}function cr(t){return function(e,n,s){let r=[];var i;i=e,r=Array.isArray(i)&&i.some(Array.isArray)?ur(e,n,t):lr(e,n,s,t);const o=new p(r);return t&&t.animations.push(o),o}}const hr=cr();const dr=t=>function(e,n,s){return new p(function(t,e,n,s){const r=Z(t,s),i=r.length,o=[];for(let t=0;t{const{currentTime:s}=e,r=(null===s?0:s.value)/100;n!==r&&t(r),n=r};return $.update(s,!0),()=>j(s)}const mr=new WeakMap;let gr;function yr({target:t,contentRect:e,borderBoxSize:n}){mr.get(t)?.forEach((s=>{s({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function vr(t){t.forEach(yr)}function wr(t,e){gr||"undefined"!=typeof ResizeObserver&&(gr=new ResizeObserver(vr));const n=Z(t);return n.forEach((t=>{let n=mr.get(t);n||(n=new Set,mr.set(t,n)),n.add(e),gr?.observe(t)})),()=>{n.forEach((t=>{const n=mr.get(t);n?.delete(e),n?.size||gr?.unobserve(t)}))}}const br=new Set;let Tr;function xr(t){return br.add(t),Tr||(Tr=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};br.forEach((t=>t(e)))},window.addEventListener("resize",Tr)),()=>{br.delete(t),!br.size&&Tr&&(Tr=void 0)}}const Sr={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Mr(t,e,n,s){const r=n[e],{length:i,position:a}=Sr[e],l=r.current,u=n.time;r.current=t[`scroll${a}`],r.scrollLength=t[`scroll${i}`]-t[`client${i}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=o(0,r.scrollLength,r.current);const h=s-u;r.velocity=h>50?0:c(r.current-l,h)}const Ar={start:0,center:.5,end:1};function Vr(t,e,n=0){let s=0;if(t in Ar&&(t=Ar[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?s=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?s=e/100*document.documentElement.clientWidth:t.endsWith("vh")?s=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(s=e*t),n+s}const kr=[0,0];function Pr(t,e,n,s){let r=Array.isArray(t)?t:kr,i=0,o=0;return"number"==typeof t?r=[t,t]:"string"==typeof t&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Ar[t]?t:"0"]),i=Vr(r[0],n,s),o=Vr(r[1],e),i-o}const Er={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Cr={x:0,y:0};function Fr(t,e,n){const{offset:s=Er.All}=n,{target:r=t,axis:i="y"}=n,o="y"===i?"height":"width",a=r!==t?function(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if("svg"===s.tagName){const t=s.getBoundingClientRect();s=s.parentElement;const e=s.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(s instanceof SVGGraphicsElement))break;{const{x:t,y:e}=s.getBBox();n.x+=t,n.y+=e;let r=null,i=s.parentNode;for(;!r;)"svg"===i.tagName&&(r=i),i=s.parentNode;s=r}}return n}(r,t):Cr,l=r===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(r),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let c=!e[i].interpolate;const h=s.length;for(let t=0;tfunction(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,s.target,n),update:e=>{!function(t,e,n){Mr(t,"x",e,n),Mr(t,"y",e,n),e.time=n}(t,n,e),(s.offset||s.target)&&Fr(t,n,s)},notify:()=>e(n)}}const Rr=new WeakMap,Br=new WeakMap,Lr=new WeakMap,Ir=t=>t===document.documentElement?window:t;function Wr(t,{container:e=document.documentElement,...n}={}){let s=Lr.get(e);s||(s=new Set,Lr.set(e,s));const r=Or(e,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},n);if(s.add(r),!Rr.has(e)){const t=()=>{for(const t of s)t.measure()},n=()=>{for(const t of s)t.update(z.timestamp)},r=()=>{for(const t of s)t.notify()},a=()=>{$.read(t,!1,!0),$.read(n,!1,!0),$.update(r,!1,!0)};Rr.set(e,a);const l=Ir(e);window.addEventListener("resize",a,{passive:!0}),e!==document.documentElement&&Br.set(e,(o=a,"function"==typeof(i=e)?xr(i):wr(i,o))),l.addEventListener("scroll",a,{passive:!0})}var i,o;const a=Rr.get(e);return $.read(a,!1,!0),()=>{j(a);const t=Lr.get(e);if(!t)return;if(t.delete(r),t.size)return;const n=Rr.get(e);Rr.delete(e),n&&(Ir(e).removeEventListener("scroll",n),Br.get(e)?.(),window.removeEventListener("resize",n))}}const Dr=new Map;function Nr({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),Dr.has(e)||Dr.set(e,{});const s=Dr.get(e);return s[n]||(s[n]=h()?new ScrollTimeline({source:e,axis:n}):function({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},r=Wr((t=>{s.value=100*t[n].progress}),{container:e,axis:n});return{currentTime:s,cancel:r}}({source:e,axis:n})),s[n]}function Kr(t){return t&&(t.target||t.offset)}const $r={some:0,all:1};const jr=(t,e)=>Math.abs(t-e);t.MotionValue=it,t.animate=hr,t.animateMini=pr,t.anticipate=ve,t.backIn=ge,t.backInOut=ye,t.backOut=me,t.cancelFrame=j,t.cancelSync=lt,t.circIn=we,t.circInOut=Te,t.circOut=be,t.clamp=ut,t.createScopedAnimate=cr,t.cubicBezier=de,t.delay=function(t,e){return function(t,e){const n=H.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(j(s),t(i-e))};return $.read(s,!0),()=>j(s)}(t,l(e))},t.distance=jr,t.distance2D=function(t,e){const n=jr(t.x,e.x),s=jr(t.y,e.y);return Math.sqrt(n**2+s**2)},t.easeIn=cs,t.easeInOut=ds,t.easeOut=hs,t.frame=$,t.frameData=z,t.hover=function(t,e,n={}){const[s,r,i]=_(t,n),o=t=>{if(!J(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const i=t=>{J(t)&&(s(t),n.removeEventListener("pointerleave",i))};n.addEventListener("pointerleave",i,r)};return s.forEach((t=>{t.addEventListener("pointerenter",o,r)})),i},t.inView=function(t,e,{root:n,margin:s,amount:r="some"}={}){const i=Z(t),o=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=o.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t.target,t);"function"==typeof n?o.set(t.target,n):a.unobserve(t.target)}else"function"==typeof n&&(n(t),o.delete(t.target))}))}),{root:n,rootMargin:s,threshold:"number"==typeof r?r:$r[r]});return i.forEach((t=>a.observe(t))),()=>a.disconnect()},t.inertia=us,t.interpolate=ms,t.invariant=n,t.isDragActive=G,t.keyframes=gs,t.mirrorEasing=pe,t.mix=ls,t.motionValue=ot,t.noop=i,t.pipe=es,t.press=function(t,e,n={}){const[s,r,i]=_(t,n),o=t=>{const s=t.currentTarget;if(!rt(t)||et.has(s))return;et.add(s);const i=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),rt(t)&&et.has(s)&&(et.delete(s),"function"==typeof i&&i(t,{success:e}))},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||Q(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,r),window.addEventListener("pointercancel",l,r)};return s.forEach((t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,r),t instanceof HTMLElement&&(t.addEventListener("focus",(t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=nt((()=>{if(et.has(n))return;st(n,"down");const t=nt((()=>{st(n,"up")}));n.addEventListener("keyup",t,e),n.addEventListener("blur",(()=>st(n,"cancel")),e)}));n.addEventListener("keydown",s,e),n.addEventListener("blur",(()=>n.removeEventListener("keydown",s)),e)})(t,r))),e=t,tt.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))})),i},t.progress=o,t.reverseEasing=fe,t.scroll=function(t,{axis:e="y",...n}={}){const s={axis:e,...n};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)||Kr(e)?Wr((n=>{t(n[e.axis].progress,n)}),e):fr(t,Nr(e))}(t,s):function(t,e){if(t.flatten(),Kr(e))return t.pause(),Wr((n=>{t.time=t.duration*n[e.axis].progress}),e);{const n=Nr(e);return t.attachTimeline?t.attachTimeline(n,(t=>(t.pause(),fr((e=>{t.time=t.duration*e}),n)))):i}}(t,s)},t.scrollInfo=Wr,t.spring=Ft,t.stagger=function(t=.1,{startDelay:e=0,from:n=0,ease:s}={}){return(r,i)=>{const o="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,i),a=Math.abs(o-r);let l=t*a;if(s){const e=i*t;l=fs(s)(l/e)*e}return e+l}},t.steps=function(t,e="end"){return n=>{const s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(s):Math.ceil(s);return ut(0,1,r/t)}},t.sync=at,t.time=H,t.transform=function(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],o=t[3+n],a=ms(r,i,{mixer:(l=i[0],(t=>t&&"object"==typeof t&&t.mix)(l)?l.mix:void 0),...o});var l;return e?a(s):a},t.wrap=Ot}));