framer-motion
Version:
A simple and powerful JavaScript animation library
1 lines • 142 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={},t.React)}(this,(function(t,e){"use strict";function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=n(e);function s(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>t(...e),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}function o(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}const r=t=>Array.isArray(t);function a(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}function l(t){return"string"==typeof t||Array.isArray(t)}function u(t){const e=[{},{}];return null==t||t.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function c(t,e,n,i){if("function"==typeof e){const[s,o]=u(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=u(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function h(t,e,n){const i=t.getProps();return c(i,e,void 0!==n?n:i.custom,t)}const d=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],p=["initial",...d],m=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],f=new Set(m),g=t=>1e3*t,y=t=>t/1e3,v={type:"spring",stiffness:500,damping:25,restSpeed:10},x={type:"keyframes",duration:.8},w={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},P=(t,{keyframes:e})=>e.length>2?x:f.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:v:w;function S(t,e){return t?t[e]||t.default||t:void 0}const T={skipAnimations:!1,useManualTiming:!1},b={current:!1},A=t=>null!==t;function E(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(A),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}const C=t=>t;const M=["read","resolveKeyframes","update","preRender","render","postRender"];function V(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=M.reduce((t,e)=>(t[e]=function(t){let e=new Set,n=new Set,i=!1,s=!1;const o=new WeakSet;let r={delta:0,timestamp:0,isProcessing:!1};function a(e){o.has(e)&&(l.schedule(e),t()),e(r)}const l={schedule:(t,s=!1,r=!1)=>{const a=r&&i?e:n;return s&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{n.delete(t),o.delete(t)},process:t=>{r=t,i?s=!0:(i=!0,[e,n]=[n,e],n.clear(),e.forEach(a),i=!1,s&&(s=!1,l.process(t)))}};return l}(o),t),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=r,p=()=>{const o=T.useManualTiming?s.timestamp:performance.now();n=!1,s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),h.process(s),d.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(p))};return{schedule:M.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(p)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<M.length;e++)r[M[e]].cancel(t)},state:s,steps:r}}const{schedule:R,cancel:k,state:D,steps:L}=V("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:C,!0),B=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function F(t,e,n,i){if(t===e&&n===i)return C;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=B(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:B(s(t),e,i)}const j=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,O=t=>e=>1-t(1-e),I=F(.33,1.53,.69,.99),U=O(I),W=j(U),N=t=>(t*=2)<1?.5*U(t):.5*(2-Math.pow(2,-10*(t-1))),z=t=>1-Math.sin(Math.acos(t)),$=O(z),H=j(z),Y=t=>/^0[^.\s]+$/u.test(t);let X=C,G=C;const K=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),_=t=>e=>"string"==typeof e&&e.startsWith(t),q=_("--"),Z=_("var(--"),J=t=>!!Z(t)&&Q.test(t.split("/*")[0].trim()),Q=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,tt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function et(t,e,n=1){const[i,s]=function(t){const e=tt.exec(t);if(!e)return[,];const[,n,i,s]=e;return["--"+(null!=n?n:i),s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return K(t)?parseFloat(t):t}return J(s)?et(s,e,n+1):s}const nt=(t,e,n)=>n>e?e:n<t?t:n,it={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},st={...it,transform:t=>nt(0,1,t)},ot={...it,default:1},rt=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),at=rt("deg"),lt=rt("%"),ut=rt("px"),ct=rt("vh"),ht=rt("vw"),dt={...lt,parse:t=>lt.parse(t)/100,transform:t=>lt.transform(100*t)},pt=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),mt=t=>t===it||t===ut,ft=(t,e)=>parseFloat(t.split(", ")[e]),gt=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/u);if(s)return ft(s[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?ft(e[1],t):0}},yt=new Set(["x","y","z"]),vt=m.filter(t=>!yt.has(t));const xt={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:gt(4,13),y:gt(5,14)};xt.translateX=xt.x,xt.translateY=xt.y;const wt=t=>e=>e.test(t),Pt=[it,ut,lt,at,ht,ct,{test:t=>"auto"===t,parse:t=>t}],St=t=>Pt.find(wt(t)),Tt=new Set;let bt=!1,At=!1;function Et(){if(At){const t=Array.from(Tt).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 vt.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.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 i;null===(i=t.getValue(e))||void 0===i||i.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}At=!1,bt=!1,Tt.forEach(t=>t.complete()),Tt.clear()}function Ct(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(At=!0)})}class Mt{constructor(t,e,n,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Tt.add(this),bt||(bt=!0,R.read(Ct),R.resolveKeyframes(Et))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;for(let s=0;s<t.length;s++)if(null===t[s])if(0===s){const s=null==i?void 0:i.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Tt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Tt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Vt=t=>Math.round(1e5*t)/1e5,Rt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const kt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dt=(t,e)=>n=>Boolean("string"==typeof n&&kt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Lt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Rt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Bt={...it,transform:t=>Math.round((t=>nt(0,255,t))(t))},Ft={test:Dt("rgb","red"),parse:Lt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Bt.transform(t)+", "+Bt.transform(e)+", "+Bt.transform(n)+", "+Vt(st.transform(i))+")"};const jt={test:Dt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Ft.transform},Ot={test:Dt("hsl","hue"),parse:Lt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+lt.transform(Vt(e))+", "+lt.transform(Vt(n))+", "+Vt(st.transform(i))+")"},It={test:t=>Ft.test(t)||jt.test(t)||Ot.test(t),parse:t=>Ft.test(t)?Ft.parse(t):Ot.test(t)?Ot.parse(t):jt.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ft.transform(t):Ot.transform(t)},Ut=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Wt=/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 Nt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Wt,t=>(It.test(t)?(i.color.push(o),s.push("color"),n.push(It.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push("number"),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function zt(t){return Nt(t).values}function $t(t){const{split:e,types:n}=Nt(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+="number"===e?Vt(t[o]):"color"===e?It.transform(t[o]):t[o]}return s}}const Ht=t=>"number"==typeof t?0:t;const Yt={test:function(t){var e,n;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Rt))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(Ut))||void 0===n?void 0:n.length)||0)>0},parse:zt,createTransformer:$t,getAnimatableNone:function(t){const e=zt(t);return $t(t)(e.map(Ht))}},Xt=new Set(["brightness","contrast","saturate","opacity"]);function Gt(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Rt)||[];if(!i)return t;const s=n.replace(i,"");let o=Xt.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Kt=/\b([a-z-]*)\(.*?\)/gu,_t={...Yt,getAnimatableNone:t=>{const e=t.match(Kt);return e?e.map(Gt).join(" "):t}},qt={borderWidth:ut,borderTopWidth:ut,borderRightWidth:ut,borderBottomWidth:ut,borderLeftWidth:ut,borderRadius:ut,radius:ut,borderTopLeftRadius:ut,borderTopRightRadius:ut,borderBottomRightRadius:ut,borderBottomLeftRadius:ut,width:ut,maxWidth:ut,height:ut,maxHeight:ut,top:ut,right:ut,bottom:ut,left:ut,padding:ut,paddingTop:ut,paddingRight:ut,paddingBottom:ut,paddingLeft:ut,margin:ut,marginTop:ut,marginRight:ut,marginBottom:ut,marginLeft:ut,backgroundPositionX:ut,backgroundPositionY:ut},Zt={rotate:at,rotateX:at,rotateY:at,rotateZ:at,scale:ot,scaleX:ot,scaleY:ot,scaleZ:ot,skew:at,skewX:at,skewY:at,distance:ut,translateX:ut,translateY:ut,translateZ:ut,x:ut,y:ut,z:ut,perspective:ut,transformPerspective:ut,opacity:st,originX:dt,originY:dt,originZ:ut},Jt={...it,transform:Math.round},Qt={...qt,...Zt,zIndex:Jt,size:ut,fillOpacity:st,strokeOpacity:st,numOctaves:Jt},te={...Qt,color:It,backgroundColor:It,outlineColor:It,fill:It,stroke:It,borderColor:It,borderTopColor:It,borderRightColor:It,borderBottomColor:It,borderLeftColor:It,filter:_t,WebkitFilter:_t},ee=t=>te[t];function ne(t,e){let n=ee(t);return n!==_t&&(n=Yt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ie=new Set(["auto","none","0"]);class se extends Mt{constructor(t,e,n,i,s){super(t,e,n,i,s,!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 i=t[n];if("string"==typeof i&&(i=i.trim(),J(i))){const s=et(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!pt.has(n)||2!==t.length)return;const[i,s]=t,o=St(i),r=St(s);if(o!==r)if(mt(o)&&mt(r))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(i=t[e])?0===i:null===i||"none"===i||"0"===i||Y(i))&&n.push(e);var i;n.length&&function(t,e,n){let i=0,s=void 0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!ie.has(e)&&Nt(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=ne(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xt[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const s=e.getValue(n);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,r=i[o];i[o]=xt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),(null===(t=this.removedTransforms)||void 0===t?void 0:t.length)&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}}function oe(t){return"function"==typeof t}let re;function ae(){re=void 0}const le={now:()=>(void 0===re&&le.set(D.isProcessing||T.useManualTiming?D.timestamp:performance.now()),re),set:t=>{re=t,queueMicrotask(ae)}},ue=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Yt.test(t)&&"0"!==t||t.startsWith("url(")));function ce(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=ue(s,e),a=ue(o,e);return!(!r||!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||oe(n))&&i)}class he{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...r}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=le.now(),this.options={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,...r},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Ct(),Et()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=le.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:r,onUpdate:a,isGenerator:l}=this.options;if(!l&&!ce(t,n,i,s)){if(b.current||!o)return null==a||a(E(t,this.options,e)),null==r||r(),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 de(t,e){return e?t*(1e3/e):0}function pe(t,e,n){const i=Math.max(e-5,0);return de(n-t(i),e-i)}function me({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let s,o,r=1-e;r=nt(.05,1,r),t=nt(.01,10,y(t)),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/fe(e,r)*Math.exp(-s)},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),u=fe(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=g(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function fe(t,e){return t*Math.sqrt(1-e*e)}const ge=["duration","bounce"],ye=["stiffness","damping","mass"];function ve(t,e){return e.some(e=>void 0!==t[e])}function xe({keyframes:t,restDelta:e,restSpeed:n,...i}){const s=t[0],o=t[t.length-1],r={done:!1,value:s},{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(!ve(t,ye)&&ve(t,ge)){const n=me(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}({...i,velocity:-y(i.velocity||0)}),p=h||0,m=l/(2*Math.sqrt(a*u)),f=o-s,v=y(Math.sqrt(a/u)),x=Math.abs(f)<5;let w;if(n||(n=x?.01:2),e||(e=x?.005:.5),m<1){const t=fe(v,m);w=e=>{const n=Math.exp(-m*v*e);return o-n*((p+m*v*f)/t*Math.sin(t*e)+f*Math.cos(t*e))}}else if(1===m)w=t=>o-Math.exp(-v*t)*(f+(p+v*f)*t);else{const t=v*Math.sqrt(m*m-1);w=e=>{const n=Math.exp(-m*v*e),i=Math.min(t*e,300);return o-n*((p+m*v*f)*Math.sinh(i)+t*f*Math.cosh(i))/t}}return{calculatedDuration:d&&c||null,next:t=>{const i=w(t);if(d)r.done=t>=c;else{let s=0;m<1&&(s=0===t?g(p):pe(w,t,i));const a=Math.abs(s)<=n,l=Math.abs(o-i)<=e;r.done=a&&l}return r.value=r.done?o:i,r}}}function we({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,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 m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=u,d.value=d.done?g:n};let w,P;const S=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(w=t,P=xe({keyframes:[d.value,p(d.value)],velocity:pe(v,t,d.value),damping:s,stiffness:o,restDelta:u,restSpeed:c}))};return S(0),{calculatedDuration:null,next:t=>{let e=!1;return P||void 0!==w||(e=!0,x(t),S(t)),void 0!==w&&t>=w?P.next(t-w):(!e&&x(t),d)}}}const Pe=F(.42,0,1,1),Se=F(0,0,.58,1),Te=F(.42,0,.58,1),be=t=>Array.isArray(t)&&"number"!=typeof t[0],Ae=t=>Array.isArray(t)&&"number"==typeof t[0],Ee={linear:C,easeIn:Pe,easeInOut:Te,easeOut:Se,circIn:z,circInOut:H,circOut:$,backIn:U,backInOut:W,backOut:I,anticipate:N},Ce=t=>{if(Ae(t)){G(4===t.length);const[e,n,i,s]=t;return F(e,n,i,s)}return"string"==typeof t?Ee[t]:t},Me=(t,e)=>n=>e(t(n)),Ve=(...t)=>t.reduce(Me),Re=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},ke=(t,e,n)=>t+(e-t)*n;function De(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 Le(t,e){return n=>n>0?e:t}const Be=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},Fe=[jt,Ft,Ot];function je(t){const e=(n=t,Fe.find(t=>t.test(n)));var n;if(!Boolean(e))return!1;let i=e.parse(t);return e===Ot&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=De(a,i,t+1/3),o=De(a,i,t),r=De(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const Oe=(t,e)=>{const n=je(t),i=je(e);if(!n||!i)return Le(t,e);const s={...n};return t=>(s.red=Be(n.red,i.red,t),s.green=Be(n.green,i.green,t),s.blue=Be(n.blue,i.blue,t),s.alpha=ke(n.alpha,i.alpha,t),Ft.transform(s))},Ie=new Set(["none","hidden"]);function Ue(t,e){return n=>ke(t,e,n)}function We(t){return"number"==typeof t?Ue:"string"==typeof t?J(t)?Le:It.test(t)?Oe:$e:Array.isArray(t)?Ne:"object"==typeof t?It.test(t)?Oe:ze:Le}function Ne(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>We(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function ze(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=We(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const $e=(t,e)=>{const n=Yt.createTransformer(e),i=Nt(t),s=Nt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?Ie.has(t)&&!s.values.length||Ie.has(e)&&!i.values.length?function(t,e){return Ie.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):Ve(Ne(function(t,e){var n;const i=[],s={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][s[r]],l=null!==(n=t.values[a])&&void 0!==n?n:0;i[o]=l,s[r]++}return i}(i,s),s.values),n):Le(t,e)};function He(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ke(t,e,n);return We(t)(t,e)}function Ye(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(G(o===e.length),1===o)return()=>e[0];if(2===o&&t[0]===t[1])return()=>e[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=function(t,e,n){const i=[],s=n||He,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||C:e;o=Ve(t,o)}i.push(o)}return i}(e,i,s),a=r.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=Re(t[n],t[n+1],e);return r[n](i)};return n?e=>l(nt(t[0],t[o-1],e)):l}function Xe(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=Re(0,e,i);t.push(ke(n,1,s))}}function Ge(t){const e=[0];return Xe(e,t.length-1),e}function Ke({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=be(i)?i.map(Ce):Ce(i),o={done:!1,value:e[0]},r=Ye(function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ge(e),t),e,{ease:Array.isArray(s)?s:(a=e,l=s,a.map(()=>l||Te).splice(0,a.length-1))});var a,l;return{calculatedDuration:t,next:e=>(o.value=r(e),o.done=e>=t,o)}}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 qe=t=>{const e=({timestamp:e})=>t(e);return{start:()=>R.update(e,!0),stop:()=>k(e),now:()=>D.isProcessing?D.timestamp:le.now()}},Ze={decay:we,inertia:we,tween:Ke,keyframes:Ke,spring:xe},Je=t=>t/100;class Qe extends he{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:i,keyframes:s}=this.options,o=(null==i?void 0:i.KeyframeResolver)||Mt;this.resolver=new o(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:e="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,r=oe(e)?e:Ze[e]||Ke;let a,l;r!==Ke&&"number"!=typeof t[0]&&(a=Ve(Je,He(t[0],t[1])),t=[0,100]);const u=r({...this.options,keyframes:t});"mirror"===s&&(l=r({...this.options,keyframes:[...t].reverse(),velocity:-o})),null===u.calculatedDuration&&(u.calculatedDuration=_e(u));const{calculatedDuration:c}=u,h=c+i;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:h,totalDuration:h*(n+1)-i}}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:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:r,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return s.next(0);const{delay:h,repeat:d,repeatType:p,repeatDelay:m,onUpdate:f}=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,x=s;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,m&&(n-=m/c)):"mirror"===p&&(x=o)),v=nt(0,1,n)*c}const w=y?{done:!1,value:a[0]}:x.next(v);r&&(w.value=r(w.value));let{done:P}=w;y||null===l||(P=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&P);return S&&void 0!==i&&(w.value=E(a,this.options,i)),f&&f(w.value),S&&this.finish(),w}get duration(){const{resolved:t}=this;return t?y(t.calculatedDuration):0}get time(){return y(this.currentTime)}set time(t){t=g(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=y(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=qe,onPlay:e,startTime:n}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):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)}}function tn(t){return new Qe(t)}const en=new Set(["opacity","clipPath","filter","transform"]);function nn(t){let e;return()=>(void 0===e&&(e=t()),e)}const sn={linearEasing:void 0};function on(t,e){const n=nn(t);return()=>{var t;return null!==(t=sn[e])&&void 0!==t?t:n()}}const rn=on(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing");function an(t){return Boolean("function"==typeof t&&rn()||!t||"string"==typeof t&&(t in un||rn())||Ae(t)||Array.isArray(t)&&t.every(an))}const ln=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,un={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ln([0,.65,.55,1]),circOut:ln([.55,0,1,.45]),backIn:ln([.31,.01,.66,-.59]),backOut:ln([.33,1.53,.69,.99])};function cn(t,e){return t?"function"==typeof t&&rn()?((t,e)=>{let n="";const i=Math.max(Math.round(e/10),2);for(let e=0;e<i;e++)n+=t(Re(0,i-1,e))+", ";return`linear(${n.substring(0,n.length-2)})`})(t,e):Ae(t)?ln(t):Array.isArray(t)?t.map(t=>cn(t,e)||un.easeOut):un[t]:void 0}function hn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=cn(a,s);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:i,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}function dn(t,e){t.timeline=e,t.onfinish=null}const pn=nn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const mn={anticipate:N,backInOut:W,circInOut:H};class fn extends he{constructor(t){super(t);const{name:e,motionValue:n,element:i,keyframes:s}=this.options;this.resolver=new se(s,(t,e)=>this.onKeyframesResolved(t,e),e,n,i),this.resolver.scheduleResolve()}initPlayback(t,e){var n;let{duration:i=300,times:s,ease:o,type:r,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 o&&rn()&&o in mn&&(o=mn[o]),oe((c=this.options).type)||"spring"===c.type||!an(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 i={done:!1,value:t[0]};const s=[];let o=0;for(;!i.done&&o<2e4;)i=n.sample(o),s.push(i.value),o+=10;return{times:void 0,keyframes:s,duration:o-10,ease:"linear"}}(t,u);1===(t=c.keyframes).length&&(t[1]=t[0]),i=c.duration,s=c.times,o=c.ease,r="keyframes"}const h=hn(a.owner.current,l,t,{...this.options,duration:i,times:s,ease:o});return h.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(dn(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:n}=this.options;a.set(E(t,this.options,e)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:s,type:r,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return y(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return y(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.currentTime=g(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:e}=this;if(!e)return C;const{animation:n}=e;dn(n,t)}else this.pendingTimeline=t;return C}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:i,type:s,ease:o,times:r}=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:i,type:s,ease:o,times:r,isGenerator:!0}),h=g(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:i,repeatType:s,damping:o,type:r}=t;return pn()&&n&&en.has(n)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}}const gn=nn(()=>void 0!==window.ScrollTimeline);class yn{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=>gn()&&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 vn=(t,e,n,i={},s,o)=>r=>{const a=S(i,t)||{},l=a.delay||i.delay||0;let{elapsed:u=0}=i;u-=g(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(a)||(c={...c,...P(t,c)}),c.duration&&(c.duration=g(c.duration)),c.repeatDelay&&(c.repeatDelay=g(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let h=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(h=!0)),(b.current||T.skipAnimations)&&(h=!0,c.duration=0,c.delay=0),h&&!o&&void 0!==e.get()){const t=E(c.keyframes,a);if(void 0!==t)return R.update(()=>{c.onUpdate(t),c.onComplete()}),new yn([])}return!o&&fn.supports(c)?new fn(c):new Qe(c)};function xn(t,e){-1===t.indexOf(e)&&t.push(e)}function wn(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Pn{constructor(){this.subscriptions=[]}add(t){return xn(this.subscriptions,t),()=>wn(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Sn={current:void 0};class Tn{constructor(t,e={}){this.version="11.11.8",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=le.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=le.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 Pn);const n=this.events[t].add(e);return"change"===t?()=>{n(),R.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 Sn.current&&Sn.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=le.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return de(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 bn(t,e){return new Tn(t,e)}function An(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,bn(n))}function En(t,e){const n=h(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o){An(t,e,(a=o[e],r(a)?a[a.length-1]||0:a))}var a}const Cn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Mn="data-"+Cn("framerAppearId");function Vn(t){return t.props[Mn]}const Rn=t=>Boolean(t&&t.getVelocity);function kn(t){return f.has(t)?"transform":en.has(t)?Cn(t):void 0}function Dn(t,e){var n;if(!t.applyWillChange)return;const i=t.getValue("willChange");if(s=i,Boolean(Rn(s)&&s.add))return i.add(e);var s;!(null===(n=t.props.style)||void 0===n?void 0:n.willChange)&&kn(e)&&t.setStaticValue("willChange","transform")}function Ln({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function Bn(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;i&&(r=i);const u=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in l){const i=t.getValue(e,null!==(o=t.latestValues[e])&&void 0!==o?o:null),s=l[e];if(void 0===s||c&&Ln(c,e))continue;const a={delay:n,...S(r||{},e)};let h=!1;if(window.MotionHandoffAnimation){const n=Vn(t);if(n){const t=window.MotionHandoffAnimation(n,e,R);null!==t&&(a.startTime=t,h=!0)}}Dn(t,e),i.start(vn(e,i,s,t.shouldReduceMotion&&f.has(e)?{type:!1}:a,t,h));const d=i.animation;d&&u.push(d)}return a&&Promise.all(u).then(()=>{R.update(()=>{a&&En(t,a)})}),u}function Fn(t,e,n={}){var i;const s=h(t,e,"exit"===n.type?null===(i=t.presenceContext)||void 0===i?void 0:i.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>Promise.all(Bn(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(jn).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(Fn(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(()=>e())}return Promise.all([r(),a(n.delay)])}function jn(t,e){return t.sortNodePosition(e)}function On(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Fn(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Fn(t,e,n);else{const s="function"==typeof e?h(t,e,n.custom):e;i=Promise.all(Bn(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}const In=p.length;const Un=[...d].reverse(),Wn=d.length;function Nn(t){let e=function(t){return e=>Promise.all(e.map(({animation:e,options:n})=>On(t,e,n)))}(t),n=Hn(),i=!0;const s=e=>(n,i)=>{var s;const o=h(t,i,"exit"===e?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0);if(o){const{transition:t,transitionEnd:e,...i}=o;n={...n,...i,...e}}return n};function u(u){const{props:c}=t,h=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<In;t++){const i=p[t],s=e.props[i];(l(s)||!1===s)&&(n[i]=s)}return n}(t.parent)||{},d=[],m=new Set;let f={},g=1/0;for(let e=0;e<Wn;e++){const p=Un[e],y=n[p],v=void 0!==c[p]?c[p]:h[p],x=l(v),w=p===u?y.isActive:null;!1===w&&(g=e);let P=v===h[p]&&v!==c[p]&&x;if(P&&i&&t.manuallyAnimateOnMount&&(P=!1),y.protectedKeys={...f},!y.isActive&&null===w||!v&&!y.prevProp||o(v)||"boolean"==typeof v)continue;const S=zn(y.prevProp,v);let T=S||p===u&&y.isActive&&!P&&x||e>g&&x,b=!1;const A=Array.isArray(v)?v:[v];let E=A.reduce(s(p),{});!1===w&&(E={});const{prevResolvedValues:C={}}=y,M={...C,...E},V=e=>{T=!0,m.has(e)&&(b=!0,m.delete(e)),y.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in M){const e=E[t],n=C[t];if(f.hasOwnProperty(t))continue;let i=!1;i=r(e)&&r(n)?!a(e,n):e!==n,i?null!=e?V(t):m.add(t):void 0!==e&&m.has(t)?V(t):y.protectedKeys[t]=!0}y.prevProp=v,y.prevResolvedValues=E,y.isActive&&(f={...f,...E}),i&&t.blockInitialAnimation&&(T=!1);const R=!(P&&S)||b;T&&R&&d.push(...A.map(t=>({animation:t,options:{type:p}})))}if(m.size){const e={};m.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=null!=i?i:null}),d.push({animation:e})}let y=Boolean(d.length);return!i||!1!==c.initial&&c.initial!==c.animate||t.manuallyAnimateOnMount||(y=!1),i=!1,y?e(d):Promise.resolve()}return{animateChanges:u,setActive:function(e,i){var s;if(n[e].isActive===i)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const o=u(e);for(const t in n)n[t].protectedKeys={};return o},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=Hn(),i=!0}}}function zn(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!a(e,t)}function $n(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hn(){return{animate:$n(!0),whileInView:$n(),whileHover:$n(),whileTap:$n(),whileDrag:$n(),whileFocus:$n(),exit:$n()}}class Yn{constructor(t){this.isMounted=!1,this.node=t}update(){}}let Xn=0;const Gn={animation:{Feature:class extends Yn{constructor(t){super(t),t.animationState||(t.animationState=Nn(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();o(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 Yn{constructor(){super(...arguments),this.id=Xn++}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 i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},Kn=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function _n(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const qn=t=>e=>Kn(e)&&t(e,_n(e));function Zn(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Jn(t,e,n,i){return Zn(t,e,qn(n),i)}const Qn=(t,e)=>Math.abs(t-e);function ti(t,e){const n=Qn(t.x,e.x),i=Qn(t.y,e.y);return Math.sqrt(n**2+i**2)}class ei{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=si(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=ti(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=D;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=ni(e,this.transformPagePoint),R.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=si("pointercancel"===t.type?this.lastMoveEventInfo:ni(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!Kn(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=ni(_n(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=D;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,si(o,this.history)),this.removeListeners=Ve(Jn(this.contextWindow,"pointermove",this.handlePointerMove),Jn(this.contextWindow,"pointerup",this.handlePointerUp),Jn(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),k(this.updatePoint)}}function ni(t,e){return e?{point:e(t.point)}:t}function ii(t,e){return{x:t.x-e.x,y:t.y-e.y}}function si({point:t},e){return{point:t,delta:ii(t,ri(e)),offset:ii(t,oi(e)),velocity:ai(e,.1)}}function oi(t){return t[0]}function ri(t){return t[t.length-1]}function ai(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=ri(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>g(e)));)n--;if(!i)return{x:0,y:0};const o=y(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function li(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const ui=li("dragHorizontal"),ci=li("dragVertical");function hi(t){let e=!1;if("y"===t)e=ci();else if("x"===t)e=ui();else{const t=ui(),n=ci();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function di(){const t=hi(!0);return!t||(t(),!1)}function pi(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function mi(t){return t.max-t.min}function fi(t,e,n,i=.5){t.origin=i,t.originPoint=ke(e.min,e.max,t.origin),t.scale=mi(n)/mi(e),t.translate=ke(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function gi(t,e,n,i){fi(t.x,e.x,n.x,i?i.originX:void 0),fi(t.y,e.y,n.y,i?i.originY:void 0)}function yi(t,e,n){t.min=n.min+e.min,t.max=t.min+mi(e)}function vi(t,e,n){t.min=e.min-n.min,t.max=t.min+mi(e)}function xi(t,e,n){vi(t.x,e.x,n.x),vi(t.y,e.y,n.y)}function wi(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Pi(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const Si=.35;function Ti(t,e,n){return{min:bi(t,e),max:bi(t,n)}}function bi(t,e){return"number"==typeof t?t:t[e]||0}const Ai=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Ei(t){return[t("x"),t("y")]}function Ci({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function Mi(t){return void 0===t||1===t}function Vi({scale:t,scaleX:e,scaleY:n}){return!Mi(t)||!Mi(e)||!Mi(n)}function Ri(t){return Vi(t)||ki(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function ki(t){return Di(t.x)||Di(t.y)}function Di(t){return t&&"0%"!==t}function Li(t,e,n){return n+e*(t-n)}function Bi(t,e,n,i,s){return void 0!==s&&(t=Li(t,s,i)),Li(t,n,i)+e}function Fi(t,e=0,n=1,i,s){t.min=Bi(t.min,e,n,i,s),t.max=Bi(t.max,e,n,i,s)}function ji(t,{x:e,y:n}){Fi(t.x,e.translate,e.scale,e.originPoint),Fi(t.y,n.translate,n.scale,n.originPoint)}function Oi(t,e){t.min=t.min+e,t.max=t.max+e}function Ii(t,e,n,i,s=.5){Fi(t,e,n,ke(t.min,t.max,s),i)}function Ui(t,e){Ii(t.x,e.x,e.scaleX,e.scale,e.originX),Ii(t.y,e.y,e.scaleY,e.scale,e.originY)}function Wi(t,e){return Ci(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const Ni=({current:t})=>t?t.ownerDocument.defaultView:null,zi=new WeakMap;class $i{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new ei(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(_n(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=hi(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ei(t=>{let e=this.getAxisMotionValue(t).get()||0;if(lt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=mi(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&R.postRender(()=>s(t,e)),Dn(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Ei(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:Ni(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&R.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLo