framer-motion 12.6.0 → 12.6.2

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