framer-motion
Version:
A simple and powerful JavaScript animation library
1 lines • 63 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=t=>t,n=!1;const s=["read","resolveKeyframes","update","preRender","render","postRender"];const{schedule:i,cancel:r,state:o,steps:a}=function(t,e){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=s.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(l.schedule(e),t()),e(o)}const l={schedule:(t,i=!1,o=!1)=>{const a=o&&s?e:n;return i&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),r.delete(t)},process:t=>{o=t,s?i=!0:(s=!0,[e,n]=[n,e],n.clear(),e.forEach(a),s=!1,i&&(i=!1,l.process(t)))}};return l}(o),t),{}),{read:l,resolveKeyframes:u,update:c,preRender:h,render:d,postRender:p}=a,f=()=>{const s=performance.now();n=!1,r.delta=i?1e3/60:Math.max(Math.min(s-r.timestamp,40),1),r.timestamp=s,r.isProcessing=!0,l.process(r),u.process(r),c.process(r),h.process(r),d.process(r),p.process(r),r.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:s.reduce((e,s)=>{const o=a[s];return e[s]=(e,s=!1,a=!1)=>(n||(n=!0,i=!0,r.isProcessing||t(f)),o.schedule(e,s,a)),e},{}),cancel:t=>{for(let e=0;e<s.length;e++)a[s[e]].cancel(t)},state:r,steps:a}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e,!0);function l(t,e){-1===t.indexOf(e)&&t.push(e)}function u(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class c{constructor(){this.subscriptions=[]}add(t){return l(this.subscriptions,t),()=>u(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}}function h(t,e){return e?t*(1e3/e):0}let d;function p(){d=void 0}const f={now:()=>(void 0===d&&f.set(o.isProcessing||n?o.timestamp:performance.now()),d),set:t=>{d=t,queueMicrotask(p)}};class m{constructor(t,e={}){this.version="11.9.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=f.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=f.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 c);const n=this.events[t].add(e);return"change"===t?()=>{n(),i.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=f.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 g(t,e){return new m(t,e)}let y=e,v=e;function w(t,e,n){var s;if("string"==typeof t){let i=document;e&&(v(Boolean(e.current)),i=e.current),n?(null!==(s=n[t])&&void 0!==s||(n[t]=i.querySelectorAll(t)),t=n[t]):t=i.querySelectorAll(t)}else t instanceof Element&&(t=[t]);return Array.from(t||[])}const b=new WeakMap;function T(t){let e;return()=>(void 0===e&&(e=t()),e)}const x=T(()=>void 0!==window.ScrollTimeline);class S{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t,e){const n=this.animations.map(n=>x()&&n.attachTimeline?n.attachTimeline(t):e(n));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]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const V=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],A=new Set(V),M=t=>1e3*t,P=t=>t/1e3,k={type:"spring",stiffness:500,damping:25,restSpeed:10},C={type:"keyframes",duration:.8},F={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},E=(t,{keyframes:e})=>e.length>2?C:A.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:k:F;function O(t,e){return t[e]||t.default||t}const R=t=>null!==t;function B(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(R),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}const I=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function W(t,n,s,i){if(t===n&&s===i)return e;const r=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=I(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s);return t=>0===t||1===t?t:I(r(t),n,i)}const D=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,L=t=>e=>1-t(1-e),N=W(.33,1.53,.69,.99),K=L(N),z=D(K),j=t=>(t*=2)<1?.5*K(t):.5*(2-Math.pow(2,-10*(t-1))),$=t=>1-Math.sin(Math.acos(t)),H=L($),U=D($),Y=t=>/^0[^.\s]+$/u.test(t);const q=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),X=t=>e=>"string"==typeof e&&e.startsWith(t),G=X("--"),Z=X("var(--"),_=t=>!!Z(t)&&J.test(t.split("/*")[0].trim()),J=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Q=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tt(t,e,n=1){const[s,i]=function(t){const e=Q.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 q(t)?parseFloat(t):t}return _(i)?tt(i,e,n+1):i}const et=(t,e,n)=>n>e?e:n<t?t:n,nt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},st={...nt,transform:t=>et(0,1,t)},it={...nt,default:1},rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),ot=rt("deg"),at=rt("%"),lt=rt("px"),ut=rt("vh"),ct=rt("vw"),ht={...at,parse:t=>at.parse(t)/100,transform:t=>at.transform(100*t)},dt=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),pt=t=>t===nt||t===lt,ft=(t,e)=>parseFloat(t.split(", ")[e]),mt=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return ft(i[1],e);{const e=s.match(/^matrix\((.+)\)$/u);return e?ft(e[1],t):0}},gt=new Set(["x","y","z"]),yt=V.filter(t=>!gt.has(t));const vt={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:mt(4,13),y:mt(5,14)};vt.translateX=vt.x,vt.translateY=vt.y;const wt=t=>e=>e.test(t),bt=[nt,lt,at,ot,ct,ut,{test:t=>"auto"===t,parse:t=>t}],Tt=t=>bt.find(wt(t)),xt=new Set;let St=!1,Vt=!1;function At(){if(Vt){const t=Array.from(xt).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 yt.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)})}Vt=!1,St=!1,xt.forEach(t=>t.complete()),xt.clear()}function Mt(){xt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Vt=!0)})}class Pt{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?(xt.add(this),St||(St=!0,i.read(Mt),i.resolveKeyframes(At))):(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),xt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,xt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const kt=t=>Math.round(1e5*t)/1e5,Ct=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Ft=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Et=(t,e)=>n=>Boolean("string"==typeof n&&Ft.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Ot=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(Ct);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Rt={...nt,transform:t=>Math.round((t=>et(0,255,t))(t))},Bt={test:Et("rgb","red"),parse:Ot("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Rt.transform(t)+", "+Rt.transform(e)+", "+Rt.transform(n)+", "+kt(st.transform(s))+")"};const It={test:Et("#"),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:Bt.transform},Wt={test:Et("hsl","hue"),parse:Ot("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+at.transform(kt(e))+", "+at.transform(kt(n))+", "+kt(st.transform(s))+")"},Dt={test:t=>Bt.test(t)||It.test(t)||Wt.test(t),parse:t=>Bt.test(t)?Bt.parse(t):Wt.test(t)?Wt.parse(t):It.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Bt.transform(t):Wt.transform(t)},Lt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Nt=/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 Kt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Nt,t=>(Dt.test(t)?(s.color.push(r),i.push("color"),n.push(Dt.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 zt(t){return Kt(t).values}function jt(t){const{split:e,types:n}=Kt(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?kt(t[r]):"color"===e?Dt.transform(t[r]):t[r]}return i}}const $t=t=>"number"==typeof t?0:t;const Ht={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Ct))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Lt))||void 0===n?void 0:n.length)||0)>0},parse:zt,createTransformer:jt,getAnimatableNone:function(t){const e=zt(t);return jt(t)(e.map($t))}},Ut=new Set(["brightness","contrast","saturate","opacity"]);function Yt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Ct)||[];if(!s)return t;const i=n.replace(s,"");let r=Ut.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const qt=/\b([a-z-]*)\(.*?\)/gu,Xt={...Ht,getAnimatableNone:t=>{const e=t.match(qt);return e?e.map(Yt).join(" "):t}},Gt={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,radius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,top:lt,right:lt,bottom:lt,left:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,backgroundPositionX:lt,backgroundPositionY:lt},Zt={rotate:ot,rotateX:ot,rotateY:ot,rotateZ:ot,scale:it,scaleX:it,scaleY:it,scaleZ:it,skew:ot,skewX:ot,skewY:ot,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:st,originX:ht,originY:ht,originZ:lt},_t={...nt,transform:Math.round},Jt={...Gt,...Zt,zIndex:_t,size:lt,fillOpacity:st,strokeOpacity:st,numOctaves:_t},Qt={...Jt,color:Dt,backgroundColor:Dt,outlineColor:Dt,fill:Dt,stroke:Dt,borderColor:Dt,borderTopColor:Dt,borderRightColor:Dt,borderBottomColor:Dt,borderLeftColor:Dt,filter:Xt,WebkitFilter:Xt},te=t=>Qt[t];function ee(t,e){let n=te(t);return n!==Xt&&(n=Ht),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ne=new Set(["auto","none","0"]);class se extends Pt{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(),_(s))){const i=tt(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!dt.has(n)||2!==t.length)return;const[s,i]=t,r=Tt(s),o=Tt(i);if(r!==o)if(pt(r)&&pt(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||Y(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&&!ne.has(e)&&Kt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=ee(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=vt[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]=vt[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()}}function ie(t){return"function"==typeof t}const re=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Ht.test(t)&&"0"!==t||t.startsWith("url(")));function oe(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=re(i,e),a=re(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||ie(n))&&s)}class ae{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=f.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||(Mt(),At()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=f.now(),this.hasAttemptedResolve=!0;const{name:n,type:s,velocity:i,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!oe(t,n,s,i)){if(!r)return null==a||a(B(t,this.options,e)),null==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)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function le(t,e,n){const s=Math.max(e-5,0);return h(n-t(s),e-s)}function ue({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,r,o=1-e;o=et(.05,1,o),t=et(.01,10,P(t)),o<1?(i=e=>{const s=e*o,i=s*t;return.001-(s-n)/ce(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=ce(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=M(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}function ce(t,e){return t*Math.sqrt(1-e*e)}const he=["duration","bounce"],de=["stiffness","damping","mass"];function pe(t,e){return e.some(e=>void 0!==t[e])}function fe({keyframes:t,restDelta:e,restSpeed:n,...s}){const i=t[0],r=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!pe(t,de)&&pe(t,he)){const n=ue(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...s,velocity:-P(s.velocity||0)}),p=h||0,f=l/(2*Math.sqrt(a*u)),m=r-i,g=P(Math.sqrt(a/u)),y=Math.abs(m)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),f<1){const t=ce(g,f);v=e=>{const n=Math.exp(-f*g*e);return r-n*((p+f*g*m)/t*Math.sin(t*e)+m*Math.cos(t*e))}}else if(1===f)v=t=>r-Math.exp(-g*t)*(m+(p+g*m)*t);else{const t=g*Math.sqrt(f*f-1);v=e=>{const n=Math.exp(-f*g*e),s=Math.min(t*e,300);return r-n*((p+f*g*m)*Math.sinh(s)+t*m*Math.cosh(s))/t}}return{calculatedDuration:d&&c||null,next:t=>{const s=v(t);if(d)o.done=t>=c;else{let i=0;f<1&&(i=0===t?M(p):le(v,t,s));const a=Math.abs(i)<=n,l=Math.abs(r-s)<=e;o.done=a&&l}return o.value=o.done?r:s,o}}}function me({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:c}){const h=t[0],d={done:!1,value:h},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=h+f,g=void 0===o?m:o(m);g!==m&&(f=g-h);const y=t=>-f*Math.exp(-t/s),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let b,T;const x=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,T=fe({keyframes:[d.value,p(d.value)],velocity:le(v,t,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return T||void 0!==b||(e=!0,w(t),x(t)),void 0!==b&&t>=b?T.next(t-b):(!e&&w(t),d)}}}const ge=W(.42,0,1,1),ye=W(0,0,.58,1),ve=W(.42,0,.58,1),we=t=>Array.isArray(t)&&"number"!=typeof t[0],be={linear:e,easeIn:ge,easeInOut:ve,easeOut:ye,circIn:$,circInOut:U,circOut:H,backIn:K,backInOut:z,backOut:N,anticipate:j},Te=t=>{if(Array.isArray(t)){v(4===t.length);const[e,n,s,i]=t;return W(e,n,s,i)}return"string"==typeof t?be[t]:t},xe=(t,e)=>n=>e(t(n)),Se=(...t)=>t.reduce(xe),Ve=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},Ae=(t,e,n)=>t+(e-t)*n;function Me(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 Pe(t,e){return n=>n>0?e:t}const ke=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ce=[It,Bt,Wt];function Fe(t){const e=(n=t,Ce.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let s=e.parse(t);return e===Wt&&(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=Me(a,s,t+1/3),r=Me(a,s,t),o=Me(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 Ee=(t,e)=>{const n=Fe(t),s=Fe(e);if(!n||!s)return Pe(t,e);const i={...n};return t=>(i.red=ke(n.red,s.red,t),i.green=ke(n.green,s.green,t),i.blue=ke(n.blue,s.blue,t),i.alpha=Ae(n.alpha,s.alpha,t),Bt.transform(i))},Oe=new Set(["none","hidden"]);function Re(t,e){return n=>Ae(t,e,n)}function Be(t){return"number"==typeof t?Re:"string"==typeof t?_(t)?Pe:Dt.test(t)?Ee:De:Array.isArray(t)?Ie:"object"==typeof t?Dt.test(t)?Ee:We:Pe}function Ie(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>Be(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function We(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Be(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const De=(t,e)=>{const n=Ht.createTransformer(e),s=Kt(t),i=Kt(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?Oe.has(t)&&!i.values.length||Oe.has(e)&&!s.values.length?function(t,e){return Oe.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Se(Ie(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):Pe(t,e)};function Le(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return Ae(t,e,n);return Be(t)(t,e)}function Ne(t,n,{clamp:s=!0,ease:i,mixer:r}={}){const o=t.length;if(v(o===n.length),1===o)return()=>n[0];if(2===o&&t[0]===t[1])return()=>n[1];t[0]>t[o-1]&&(t=[...t].reverse(),n=[...n].reverse());const a=function(t,n,s){const i=[],r=s||Le,o=t.length-1;for(let s=0;s<o;s++){let o=r(t[s],t[s+1]);if(n){const t=Array.isArray(n)?n[s]||e:n;o=Se(t,o)}i.push(o)}return i}(n,i,r),l=a.length,u=e=>{let n=0;if(l>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const s=Ve(t[n],t[n+1],e);return a[n](s)};return s?e=>u(et(t[0],t[o-1],e)):u}function Ke(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Ve(0,e,s);t.push(Ae(n,1,i))}}function ze(t){const e=[0];return Ke(e,t.length-1),e}function je({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=we(s)?s.map(Te):Te(s),r={done:!1,value:e[0]},o=Ne(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:ze(e),t),e,{ease:Array.isArray(i)?i:(a=e,l=i,a.map(()=>l||ve).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}function $e(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}const He=t=>{const e=({timestamp:e})=>t(e);return{start:()=>i.update(e,!0),stop:()=>r(e),now:()=>o.isProcessing?o.timestamp:f.now()}},Ue={decay:me,inertia:me,tween:je,keyframes:je,spring:fe},Ye=t=>t/100;class qe extends ae{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)||Pt;this.resolver=new r(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=this.options,o=ie(e)?e:Ue[e]||je;let a,l;o!==je&&"number"!=typeof t[0]&&(a=Se(Ye,Le(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=$e(u));const{calculatedDuration:c}=u,h=c+s;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-s}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:n}=this;if(!n){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-h*(this.speed>=0?1:-1),y=this.speed>=0?g<0:g>u;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,w=i;if(d){const t=Math.min(this.currentTime,u)/c;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,d+1);Boolean(e%2)&&("reverse"===p?(n=1-n,f&&(n-=f/c)):"mirror"===p&&(w=r)),v=et(0,1,n)*c}const b=y?{done:!1,value:a[0]}:w.next(v);o&&(b.value=o(b.value));let{done:T}=b;y||null===l||(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return x&&void 0!==s&&(b.value=B(a,this.options,s)),m&&m(b.value),x&&this.finish(),b}get duration(){const{resolved:t}=this;return t?P(t.calculatedDuration):0}get time(){return P(this.currentTime)}set time(t){t=M(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=P(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=He,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 Xe=new Set(["opacity","clipPath","filter","transform"]),Ge=t=>Array.isArray(t)&&"number"==typeof t[0],Ze={linearEasing:void 0};function _e(t,e){const n=T(t);return()=>{var t;return null!==(t=Ze[e])&&void 0!==t?t:n()}}const Je=_e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing");function Qe(t){return Boolean("function"==typeof t&&Je()||!t||"string"==typeof t&&(t in en||Je())||Ge(t)||Array.isArray(t)&&t.every(Qe))}const tn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,en={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tn([0,.65,.55,1]),circOut:tn([.55,0,1,.45]),backIn:tn([.31,.01,.66,-.59]),backOut:tn([.33,1.53,.69,.99])};function nn(t,e){return t?"function"==typeof t&&Je()?((t,e)=>{let n="";const s=Math.max(Math.round(e/10),2);for(let e=0;e<s;e++)n+=t(Ve(0,s-1,e))+", ";return`linear(${n.substring(0,n.length-2)})`})(t,e):Ge(t)?tn(t):Array.isArray(t)?t.map(t=>nn(t,e)||en.easeOut):en[t]:void 0}function sn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=nn(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}function rn(t,e){t.timeline=e,t.onfinish=null}const on=T(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const an={anticipate:j,backInOut:z,circInOut:U};class ln extends ae{constructor(t){super(t);const{name:e,motionValue:n,element:s,keyframes:i}=this.options;this.resolver=new se(i,(t,e)=>this.onKeyframesResolved(t,e),e,n,s),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;var c;if("string"==typeof r&&Je()&&r in an&&(r=an[r]),ie((c=this.options).type)||"spring"===c.type||!Qe(c.ease)){const{onComplete:e,onUpdate:n,motionValue:a,element:l,...u}=this.options,c=function(t,e){const n=new qe({...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=c.keyframes).length&&(t[1]=t[0]),s=c.duration,i=c.times,r=c.ease,o="keyframes"}const h=sn(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return h.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(rn(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;a.set(B(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return P(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return P(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=M(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;rn(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: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,c=new qe({...u,keyframes:n,duration:s,type:i,ease:r,times:o,isGenerator:!0}),h=M(this.time);t.setWithVelocity(c.sample(h-10).value,c.sample(h).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;return on()&&n&&Xe.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}}const un=(t,e,n,s={},r,o)=>a=>{const l=O(s,t)||{},u=l.delay||s.delay||0;let{elapsed:c=0}=s;c-=M(u);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-c,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,...c}){return!!Object.keys(c).length})(l)||(h={...h,...E(t,h)}),h.duration&&(h.duration=M(h.duration)),h.repeatDelay&&(h.repeatDelay=M(h.repeatDelay)),void 0!==h.from&&(h.keyframes[0]=h.from);let d=!1;if((!1===h.type||0===h.duration&&!h.repeatDelay)&&(h.duration=0,0===h.delay&&(d=!0)),d&&!o&&void 0!==e.get()){const t=B(h.keyframes,l);if(void 0!==t)return i.update(()=>{h.onUpdate(t),h.onComplete()}),new S([])}return!o&&ln.supports(h)?new ln(h):new qe(h)},cn=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function hn(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function dn(t,e,n,s){if("function"==typeof e){const[i,r]=hn(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=hn(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function pn(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,g(n))}function fn(t,e){const n=function(t,e,n){const s=t.getProps();return dn(s,e,void 0!==n?n:s.custom,t)}(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r){pn(t,e,cn(r[e]))}}const mn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),gn="data-"+mn("framerAppearId");function yn(t){return t.props[gn]}class vn extends m{constructor(){super(...arguments),this.values=[]}add(t){const e=function(t){return A.has(t)?"transform":Xe.has(t)?mn(t):void 0}(t);e&&(l(this.values,e),this.update())}update(){this.set(this.values.length?this.values.join(", "):"auto")}}const wn=t=>Boolean(t&&t.getVelocity);function bn(t,e){var n;if(!t.applyWillChange)return;let s=t.getValue("willChange");return s||(null===(n=t.props.style)||void 0===n?void 0:n.willChange)||(s=new vn("auto"),t.addValue("willChange",s)),i=s,Boolean(wn(i)&&i.add)?s.add(e):void 0;var i}function Tn({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function xn(t,e,{delay:n=0,transitionOverride:s,type:r}={}){var o;let{transition:a=t.getDefaultTransition(),transitionEnd:l,...u}=e;s&&(a=s);const c=[],h=r&&t.animationState&&t.animationState.getState()[r];for(const e in u){const s=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),r=u[e];if(void 0===r||h&&Tn(h,e))continue;const l={delay:n,...O(a||{},e)};let d=!1;if(window.MotionHandoffAnimation){const n=yn(t);if(n){const t=window.MotionHandoffAnimation(n,e,i);null!==t&&(l.startTime=t,d=!0)}}bn(t,e),s.start(un(e,s,r,t.shouldReduceMotion&&A.has(e)?{type:!1}:l,t,d));const p=s.animation;p&&c.push(p)}return l&&Promise.all(c).then(()=>{i.update(()=>{l&&fn(t,l)})}),c}const Sn={};function Vn(t,{layout:e,layoutId:n}){return A.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Sn[t]||"opacity"===t)}function An(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(wn(i[o])||e.style&&wn(e.style[o])||Vn(o,t)||void 0!==(null===(s=null==n?void 0:n.getValue(o))||void 0===s?void 0:s.liveStyle))&&(r[o]=i[o]);return n&&i&&"string"==typeof i.willChange&&(n.applyWillChange=!1),r}const Mn="undefined"!=typeof window,Pn={current:null},kn={current:!1};const Cn=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function Fn(t){return null!==(e=t.animate)&&"object"==typeof e&&"function"==typeof e.start||Cn.some(e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e]));var e}const En={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"]},On={};for(const t in En)On[t]={isEnabled:e=>En[t].some(t=>!!e[t])};const Rn=[...bt,Dt,Ht],Bn=()=>({x:{min:0,max:0},y:{min:0,max:0}}),In=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Wn extends class{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:r,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Pt,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=f.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,i.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(r),this.isControllingVariants=Fn(e),this.isVariantNode=function(t){return Boolean(Fn(t)||t.variants)}(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in h){const e=h[t];void 0!==l[t]&&wn(e)&&e.set(l[t],!1)}}mount(t){this.current=t,b.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)),kn.current||function(){if(kn.current=!0,Mn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Pn.current=t.matches;t.addListener(e),e()}else Pn.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Pn.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){b.delete(this.current),this.projection&&this.projection.unmount(),r(this.notifyUpdate),r(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=A.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&i.preRender(this.notifyUpdate),n&&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,()=>{s(),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 On){const e=On[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<In.length;e++){const n=In[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(wn(i))t.addValue(s,i);else if(wn(r))t.addValue(s,g(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,g(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=g(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&&(q(s)||Y(s))?s=parseFloat(s):(i=s,!Rn.find(wt(i))&&Ht.test(e)&&(s=ee(t,e))),this.setBaseTarget(t,wn(s)?s.get():s)),wn(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 i=dn(this.props,n,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);i&&(s=i[t])}if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||wn(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new c),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{constructor(){super(...arguments),this.KeyframeResolver=se}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]}}const Dn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,Ln={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Nn=V.length;function Kn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(A.has(t))o=!0;else if(G(t))i[t]=n;else{const e=Dn(n,Jt[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<Nn;r++){const o=V[r],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=Dn(a,Jt[o]);if(!l){i=!1;s+=`${Ln[o]||o}(${t}) `}n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}function zn(t,e,n){return"string"==typeof t?t:lt.transform(e+n*t)}const jn={offset:"stroke-dashoffset",array:"stroke-dasharray"},$n={offset:"strokeDashoffset",array:"strokeDasharray"};function Hn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Kn(t,u,h),c)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!==i||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,n){return`${zn(e,t.x,t.width)} ${zn(n,t.y,t.height)}`}(f,void 0!==i?i:.5,void 0!==r?r:.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,i=!0){t.pathLength=1;const r=i?jn:$n;t[r.offset]=lt.transform(-s);const o=lt.transform(e),a=lt.transform(n);t[r.array]=`${o} ${a}`}(d,o,a,l,!1)}const Un=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 Yn(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class qn extends Wn{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Bn}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(A.has(e)){const t=te(e);return t&&t.default||0}return e=Un.has(e)?e:mn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return function(t,e,n){const s=An(t,e,n);for(const n in t)if(wn(t[n])||wn(e[n])){s[-1!==V.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}(t,e,n)}build(t,e,n){Hn(t,e,this.isSVGTag,n.transformTemplate)}renderInstance(t,e,n,s){!function(t,e,n,s){Yn(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Un.has(n)?n:mn(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 Xn extends Wn{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Yn}readValueFromInstance(t,e){if(A.has(e)){const t=te(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(G(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){Kn(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return An(t,e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;wn(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}}function Gn(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 qn(e):new Xn(e);n.mount(t),b.set(t,n)}function Zn(t,e,n){const s=wn(t)?t:g(t);return s.start(un("",s,e,n)),s.animation}function _n(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min($e(s),2e4);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:P(i)}}function Jn(t,e,n,s){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=s.get(e))&&void 0!==i?i:t}const Qn=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t};function ts(t,e){return we(t)?t[Qn(0,t.length,e)]:t}fu