motion 10.11.1 → 10.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/dist/animate.cjs.js +6 -5
- package/dist/animate.es.js +7 -6
- package/dist/main.cjs.js +7 -25
- package/dist/main.es.js +2 -2
- package/dist/motion.min.js +1 -1
- package/dist/motion.umd.js +948 -108
- package/dist/size-index.js +1 -1
- package/dist/vue.cjs.js +0 -0
- package/dist/vue.es.js +0 -0
- package/lib/animate.js +7 -6
- package/lib/animate.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/react.js +0 -0
- package/lib/react.js.map +0 -0
- package/lib/vue.js +0 -0
- package/lib/vue.js.map +0 -0
- package/package.json +8 -8
- package/types/animate.d.ts +2 -2
- package/types/animate.d.ts.map +1 -1
- package/types/index.d.ts +2 -3
- package/types/index.d.ts.map +1 -1
- package/types/react.d.ts +0 -0
- package/types/react.d.ts.map +0 -0
- package/types/vue.d.ts +0 -0
- package/types/vue.d.ts.map +0 -0
- package/dist/react.cjs.js +0 -14
- package/dist/react.es.js +0 -1
- package/react/package.json +0 -6
package/dist/size-index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class t{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const e=new WeakMap;function n(t){return e.has(t)||e.set(t,{transforms:[],values:new Map}),e.get(t)}function a(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const r={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},i=t=>"number"==typeof t,s=t=>"string"==typeof t,o=t=>"object"==typeof t&&Boolean(t.createAnimation),c=t=>Array.isArray(t)&&!i(t[0]),l=(t,e,n)=>-n*t+n*e+t,u=()=>{},h=t=>t,f=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function d(t,e){const n=t[t.length-1];for(let a=1;a<=e;a++){const r=f(0,e,a);t.push(l(n,1,r))}}function m(t){const e=[0];return d(e,t-1),e}const p=t=>1e3*t,g=t=>t/1e3;const y=["","X","Y","Z"],v={x:"translateX",y:"translateY",z:"translateZ"},b={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},w={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:b,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:h},skew:b},M=new Map,O=t=>`--motion-${t}`,T=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{y.forEach((e=>{T.push(t+e),M.set(O(t+e),w[t])}))}));const S=(t,e)=>T.indexOf(t)-T.indexOf(e),x=new Set(T),A=t=>x.has(t),k=t=>t.sort(S).reduce(D,"").trim(),D=(t,e)=>`${t} ${e}(var(${O(e)}))`,j=t=>t.startsWith("--"),R=new Set;const E=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function P(t,e,n,a){if(t===e&&n===a)return h;const r=e=>function(t,e,n,a,r){let i,s,o=0;do{s=e+(n-e)/2,i=E(s,a,r)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++o<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:E(r(t),e,a)}const $=(t,e="end")=>n=>{const a=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(a):Math.ceil(a);return i=0,s=1,o=r/t,Math.min(Math.max(o,i),s);var i,s,o},q={ease:P(.25,.1,.25,1),"ease-in":P(.42,0,1,1),"ease-in-out":P(.42,0,.58,1),"ease-out":P(0,0,.58,1)},I=/\((.*?)\)/;function V(t){if("function"==typeof t)return t;if(Array.isArray(t))return P(...t);if(q[t])return q[t];if(t.startsWith("steps")){const e=I.exec(t);if(e){const t=e[1].split(",");return $(parseFloat(t[0]),t[1].trim())}}return h}function F(t,e){return c(t)?t[((t,e,n)=>{const a=e-t;return((n-t)%a+a)%a+t})(0,t.length,e)]:t}function W(t,e=m(t.length),n=h){const a=t.length,r=a-e.length;return r>0&&d(e,r),r=>{let i=0;for(;i<a-2&&!(r<e[i+1]);i++);let s=(o=f(e[i],e[i+1],r),Math.min(1,Math.max(o,0)));var o;return s=F(n,i)(s),l(t[i],t[i+1],s)}}class U{constructor(t,e=[0,1],{easing:n=r.easing,duration:a=r.duration,delay:i=r.delay,endDelay:s=r.endDelay,repeat:l=r.repeat,offset:u,direction:f="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),o(n)){const t=n.createAnimation(e,(()=>"0"),!0);n=t.easing,void 0!==t.keyframes&&(e=t.keyframes),void 0!==t.duration&&(a=t.duration)}const d=c(n)?h:V(n),m=a*(l+1),p=W(e,u,c(n)?n.map(V):h);this.tick=e=>{var n;this.pauseTime&&(e=this.pauseTime);let r=(e-this.startTime)*this.rate;this.t=r,r/=1e3,r=Math.max(r-i,0),"finished"===this.playState&&(r=m);const o=r/a;let c=Math.floor(o),l=o%1;!l&&o>=1&&(l=1),1===l&&c--;const u=c%2;("reverse"===f||"alternate"===f&&u||"alternate-reverse"===f&&!u)&&(l=1-l);const h=r>=m?1:Math.min(l,1),g=p(d(h));t(g);"finished"===this.playState||r>=m+s?(this.playState="finished",null===(n=this.resolve)||void 0===n||n.call(this,g)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){var t;const e=performance.now();this.playState="running",this.pauseTime?this.startTime=e-(this.pauseTime-(null!==(t=this.startTime)&&void 0!==t?t:0)):this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}get currentTime(){return this.t}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const _=t=>(t=>Array.isArray(t)&&i(t[0]))(t)?B(t):t,B=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,C=t=>document.createElement("div").animate(t,{duration:.001}),z={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{C({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(C({opacity:[0,1]}).finished)},N={},K={};for(const t in z)K[t]=()=>(void 0===N[t]&&(N[t]=z[t]()),N[t]);const X=t=>Array.isArray(t)?t:[t];function Y(t){return v[t]&&(t=v[t]),A(t)?O(t):t}const Z={get:(t,e)=>{e=Y(e);let n=j(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=M.get(e);t&&(n=t.initialValue)}return n},set:(t,e,n)=>{e=Y(e),j(e)?t.style.setProperty(e,n):t.style[e]=n}};function L(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function G(e,a,s,l={}){const h=window.__MOTION_DEV_TOOLS_RECORD,f=!1!==l.record&&h;let d,{duration:m=r.duration,delay:g=r.delay,endDelay:y=r.endDelay,repeat:b=r.repeat,easing:w=r.easing,direction:O,offset:T,allowWebkitAcceleration:S=!1}=l;const x=n(e);let D=K.waapi();const E=A(a);E&&((t,e)=>{v[e]&&(e=v[e]);const{transforms:a}=n(t);var r,i;i=e,-1===(r=a).indexOf(i)&&r.push(i),t.style.transform=k(a)})(e,a);const P=Y(a),$=function(e,n){return e.has(n)||e.set(n,new t),e.get(n)}(x.values,P),q=M.get(P);return L($.animation,!(o(w)&&$.generator)&&!1!==l.record),()=>{const t=()=>{var t,n;return null!==(n=null!==(t=Z.get(e,P))&&void 0!==t?t:null==q?void 0:q.initialValue)&&void 0!==n?n:0};let n=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(X(s),t);if(o(w)){const e=w.createAnimation(n,t,E,P,$);w=e.easing,void 0!==e.keyframes&&(n=e.keyframes),void 0!==e.duration&&(m=e.duration)}if(j(P)&&(K.cssRegisterProperty()?function(t){if(!R.has(t)){R.add(t);try{const{syntax:e,initialValue:n}=M.has(t)?M.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(P):D=!1),D){q&&(n=n.map((t=>i(t)?q.toDefaultUnit(t):t))),1!==n.length||K.partialKeyframes()&&!f||n.unshift(t());const a={delay:p(g),duration:p(m),endDelay:p(y),easing:c(w)?void 0:_(w),direction:O,iterations:b+1,fill:"both"};d=e.animate({[P]:n,offset:T,easing:c(w)?w.map(_):void 0},a),d.finished||(d.finished=new Promise(((t,e)=>{d.onfinish=t,d.oncancel=e})));const r=n[n.length-1];d.finished.then((()=>{Z.set(e,P,r),d.cancel()})).catch(u),S||(d.playbackRate=1.000001)}else if(E){n=n.map((t=>"string"==typeof t?parseFloat(t):t)),1===n.length&&n.unshift(parseFloat(t()));d=new U((t=>{q&&(t=q.toDefaultUnit(t)),Z.set(e,P,t)}),n,Object.assign(Object.assign({},l),{duration:m,easing:w}))}else{const t=n[n.length-1];Z.set(e,P,q&&i(t)?q.toDefaultUnit(t):t)}return f&&h(e,a,n,{duration:m,delay:g,easing:w,repeat:b,offset:T},"motion-one"),$.setAnimation(d),d}}const H=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function J(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Q=t=>t(),tt=(t,e=r.duration)=>new Proxy({animations:t.map(Q).filter(Boolean),duration:e},et),et={get:(t,e)=>{const n=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":let a=(null==n?void 0:n[e])||0;return a?a/1e3:0;case"playbackRate":case"playState":return null==n?void 0:n[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(nt)).catch(u)),t.finished;case"stop":return()=>t.animations.forEach((t=>L(t)));default:return void 0===(null==n?void 0:n[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=p(n);case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},nt=t=>t.finished;function at(t=.1,{start:e=0,from:n=0,easing:a}={}){return(r,s)=>{const o=i(n)?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,s),c=Math.abs(o-r);let l=t*c;if(a){const e=s*t;l=V(a)(l/e)*e}return e+l}}function rt(t,e,n){return"function"==typeof t?t(e,n):t}function it(t,e,n={}){const a=(t=J(t)).length,r=[];for(let i=0;i<a;i++){const s=t[i];for(const t in e){const o=H(n,t);o.delay=rt(o.delay,i,a);const c=G(s,t,e[t],o);r.push(c)}}return tt(r,n.duration)}var st=function(){};function ot(t,e,n,a){var r;return i(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(r=a.get(e))&&void 0!==r?r:t}function ct(t,e,n,r,i,s){!function(t,e,n){for(let r=0;r<t.length;r++){const i=t[r];i.at>e&&i.at<n&&(a(t,i),r--)}}(t,i,s);for(let a=0;a<e.length;a++)t.push({value:e[a],at:l(i,s,r[a]),easing:F(n,a)})}function lt(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function ut(t,e={}){var n;const a=function(t,e={}){var{defaultOptions:n={}}=e,a=function(t,e){var n={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(n[a]=t[a]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(t);r<a.length;r++)e.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(t,a[r])&&(n[a[r]]=t[a[r]])}return n}(e,["defaultOptions"]);const i=[],c=new Map,l={},u=new Map;let h=0,p=0,g=0;for(let e=0;e<t.length;e++){const a=t[e];if(s(a)){u.set(a,p);continue}if(!Array.isArray(a)){u.set(a.name,ot(p,a.at,h,u));continue}const[i,f,y={}]=a;void 0!==y.at&&(p=ot(p,y.at,h,u));let v=0;const b=J(i,l),w=b.length;for(let t=0;t<w;t++){const e=ht(b[t],c);for(const a in f){const i=ft(a,e);let s=X(f[a]);const c=H(y,a);let{duration:l=n.duration||r.duration,easing:u=n.easing||r.easing}=c;if(o(u)){const t=A(a);st(2===s.length||!t,"spring must be provided 2 keyframes within timeline");const e=u.createAnimation(s,(()=>"0"),t);u=e.easing,void 0!==e.keyframes&&(s=e.keyframes),void 0!==e.duration&&(l=e.duration)}const h=rt(y.delay,t,w)||0,b=p+h,M=b+l;let{offset:O=m(s.length)}=c;1===O.length&&0===O[0]&&(O[1]=1);const T=length-s.length;T>0&&d(O,T),1===s.length&&s.unshift(null),ct(i,s,u,O,b,M),v=Math.max(h+l,v),g=Math.max(M,g)}}h=p,p+=v}return c.forEach(((t,e)=>{for(const s in t){const o=t[s];o.sort(lt);const c=[],l=[],u=[];for(let t=0;t<o.length;t++){const{at:e,value:n,easing:a}=o[t];c.push(n),l.push(f(0,g,e)),u.push(a||r.easing)}0!==l[0]&&(l.unshift(0),c.unshift(c[0]),u.unshift("linear")),1!==l[l.length-1]&&(l.push(1),c.push(null)),i.push([e,s,c,Object.assign(Object.assign(Object.assign({},n),{duration:g,easing:u,offset:l}),a)])}})),i}(t,e),i=a.map((t=>G(...t))).filter(Boolean);return tt(i,null===(n=a[0])||void 0===n?void 0:n[3].duration)}function ht(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function ft(t,e){return e[t]||(e[t]=[]),e[t]}"production"!==process.env.NODE_ENV&&(st=function(t,e){if(!t)throw new Error(e)});function dt(t,e,n){const a=Math.max(e-5,0);return r=n-t(a),(i=e-a)?r*(1e3/i):0;var r,i}const mt=100,pt=10,gt=1;const yt=({stiffness:t=mt,damping:e=pt,mass:n=gt,from:a=0,to:r=1,velocity:i=0,restSpeed:s=2,restDistance:o=.5}={})=>{i=i?g(i):0;const c={done:!1,hasReachedTarget:!1,current:a,target:r},l=r-a,u=Math.sqrt(t/n)/1e3,h=((t=mt,e=pt,n=gt)=>e/(2*Math.sqrt(t*n)))(t,e,n);let f;if(h<1){const t=u*Math.sqrt(1-h*h);f=e=>r-Math.exp(-h*u*e)*((h*u*l-i)/t*Math.sin(t*e)+l*Math.cos(t*e))}else f=t=>r-Math.exp(-u*t)*(l+(u*l-i)*t);return t=>{c.current=f(t);const e=0===t?i:dt(f,t,c.current),n=Math.abs(e)<=s,l=Math.abs(r-c.current)<=o;var u,h,d;return c.done=n&&l,c.hasReachedTarget=(u=a,h=r,d=c.current,u<h&&d>=h||u>h&&d<=h),c}};function vt(t){const e=new WeakMap;return(n={})=>{const a=new Map,r=(e=0,r=100,i=0,s=!1)=>{const o=`${e}-${r}-${i}-${s}`;return a.has(o)||a.set(o,t(Object.assign({from:e,to:r,velocity:i,restSpeed:s?.05:2,restDistance:s?.01:.5},n))),a.get(o)},i=t=>(e.has(t)||e.set(t,function(t){let e,n=10,a=t(0);const r=[a.current];for(;!a.done&&n<1e4;)a=t(n),r.push(a.done?a.target:a.current),void 0===e&&a.hasReachedTarget&&(e=n),n+=10;const i=n-10;return 1===r.length&&r.push(a.current),{keyframes:r,duration:i/1e3,overshootDuration:(null!=e?e:i)/1e3}}(t)),e.get(t));return{createAnimation:(t,e,n,a,s)=>{var o,c;let l;const u=t.length;if(n&&u<=2&&t.every(bt)){const n=t[u-1],h=1===u?null:t[0];let f=0,d=0;const m=null==s?void 0:s.generator;if(m){const{animation:e,generatorStartTime:n}=s,a=(null==e?void 0:e.startTime)||n||0,r=(null==e?void 0:e.currentTime)||performance.now()-a,i=m(r).current;d=null!==(o=h)&&void 0!==o?o:i,(1===u||2===u&&null===t[0])&&(f=dt((t=>m(t).current),r,i))}else d=null!==(c=h)&&void 0!==c?c:parseFloat(e());const p=r(d,n,f,null==a?void 0:a.includes("scale")),g=i(p);l=Object.assign(Object.assign({},g),{easing:"linear"}),s&&(s.generator=p,s.generatorStartTime=performance.now())}else{l={easing:"ease",duration:i(r(0,100)).overshootDuration}}return l}}}}const bt=t=>"string"!=typeof t,wt=vt(yt),Mt=vt((({from:t=0,velocity:e=0,power:n=.8,decay:a=.325,bounceDamping:r,bounceStiffness:i,changeTarget:s,min:o,max:c,restDistance:l=.5,restSpeed:u})=>{a=p(a);const h={hasReachedTarget:!1,done:!1,current:t,target:t},f=t=>void 0===o?c:void 0===c||Math.abs(o-t)<Math.abs(c-t)?o:c;let d=n*e;const m=t+d,g=void 0===s?m:s(m);h.target=g,g!==m&&(d=g-t);const y=t=>-d*Math.exp(-t/a),v=t=>g+y(t),b=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=l,h.current=h.done?g:n};let w,M;const O=t=>{var e;(e=h.current,void 0!==o&&e<o||void 0!==c&&e>c)&&(w=t,M=yt({from:h.current,to:f(h.current),velocity:dt(v,t,h.current),damping:r,stiffness:i,restDistance:l,restSpeed:u}))};return O(0),t=>{let e=!1;return M||void 0!==w||(e=!0,b(t),O(t)),void 0!==w&&t>w?(h.hasReachedTarget=!0,M(t-w)):(h.hasReachedTarget=!1,!e&&b(t),h)}}));let Ot;function Tt(){if(void 0===Ot)try{new IntersectionObserver(u,{root:document}),Ot=!0}catch(t){Ot=!1}return Ot?document:void 0}const St={any:0,all:1};function xt(t,e,{root:n,margin:a,amount:r="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const i=J(t),s=new WeakMap,o=new IntersectionObserver((t=>{t.forEach((t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);"function"==typeof n?s.set(t.target,n):o.unobserve(t.target)}else n&&(n(t),s.delete(t.target))}))}),{root:n||Tt(),rootMargin:a,threshold:"number"==typeof r?r:St[r]});return i.forEach((t=>o.observe(t))),()=>o.disconnect()}function At(t,e){return tt([()=>{const n=new U(t,[0,1],e);return n.finished.catch((()=>{})),n}],null==e?void 0:e.duration)}function kt(t,e,n){return("function"==typeof t?At:it)(t,e,n)}export{t as MotionValue,kt as animate,Mt as glide,xt as inView,wt as spring,at as stagger,Z as style,ut as timeline};
|
|
1
|
+
class t{setAnimation(t){this.animation=t,null==t||t.finished.then((()=>this.clearAnimation())).catch((()=>{}))}clearAnimation(){this.animation=this.generator=void 0}}const e=new WeakMap;function n(t){return e.has(t)||e.set(t,{transforms:[],values:new Map}),e.get(t)}function i(t,e){-1===t.indexOf(e)&&t.push(e)}function r(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const o=(t,e,n)=>Math.min(Math.max(n,t),e),s={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},a=t=>"number"==typeof t,c=t=>Array.isArray(t)&&!a(t[0]);function l(t,e){return c(t)?t[((t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t})(0,t.length,e)]:t}const u=(t,e,n)=>-n*t+n*e+t,f=()=>{},h=t=>t,d=(t,e,n)=>e-t==0?1:(n-t)/(e-t);function p(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const r=d(0,e,i);t.push(u(n,1,r))}}function g(t){const e=[0];return p(e,t-1),e}function m(t,e=g(t.length),n=h){const i=t.length,r=i-e.length;return r>0&&p(e,r),r=>{let s=0;for(;s<i-2&&!(r<e[s+1]);s++);let a=o(0,1,d(e[s],e[s+1],r));return a=l(n,s)(a),u(t[s],t[s+1],a)}}const v=t=>"object"==typeof t&&Boolean(t.createAnimation),y=t=>"function"==typeof t,w=t=>"string"==typeof t,b=t=>1e3*t,E=t=>t/1e3;function O(t,e){return e?t*(1e3/e):0}const x=["","X","Y","Z"],A={x:"translateX",y:"translateY",z:"translateZ"},T={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},M={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:T,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:h},skew:T},S=new Map,D=t=>`--motion-${t}`,k=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{x.forEach((e=>{k.push(t+e),S.set(D(t+e),M[t])}))}));const L=(t,e)=>k.indexOf(t)-k.indexOf(e),W=new Set(k),j=t=>W.has(t),R=t=>t.sort(L).reduce(B,"").trim(),B=(t,e)=>`${t} ${e}(var(${D(e)}))`,z=t=>t.startsWith("--"),P=new Set;const V=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function $(t,e,n,i){if(t===e&&n===i)return h;const r=e=>function(t,e,n,i,r){let o,s,a=0;do{s=e+(n-e)/2,o=V(s,i,r)-t,o>0?n=s:e=s}while(Math.abs(o)>1e-7&&++a<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:V(r(t),e,i)}const q={ease:$(.25,.1,.25,1),"ease-in":$(.42,0,1,1),"ease-in-out":$(.42,0,.58,1),"ease-out":$(0,0,.58,1)},F=/\((.*?)\)/;function C(t){if(y(t))return t;if(Array.isArray(t))return $(...t);if(q[t])return q[t];if(t.startsWith("steps")){const e=F.exec(t);if(e){const t=e[1].split(",");return((t,e="end")=>n=>{const i=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,r="end"===e?Math.floor(i):Math.ceil(i);return o(0,1,r/t)})(parseFloat(t[0]),t[1].trim())}}return h}class H{constructor(t,e=[0,1],{easing:n,duration:i=s.duration,delay:r=s.delay,endDelay:o=s.endDelay,repeat:a=s.repeat,offset:l,direction:u="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=h,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e})),n=n||s.easing,v(n)){const t=n.createAnimation(e,(()=>"0"),!0);n=t.easing,void 0!==t.keyframes&&(e=t.keyframes),void 0!==t.duration&&(i=t.duration)}this.repeat=a,this.easing=c(n)?h:C(n),this.updateDuration(i);const f=m(e,l,c(n)?n.map(C):h);this.tick=e=>{var n;let i=0;i=void 0!==this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate,this.t=i,i/=1e3,i=Math.max(i-r,0),"finished"===this.playState&&void 0===this.pauseTime&&(i=this.totalDuration);const s=i/this.duration;let a=Math.floor(s),c=s%1;!c&&s>=1&&(c=1),1===c&&a--;const l=a%2;("reverse"===u||"alternate"===u&&l||"alternate-reverse"===u&&!l)&&(c=1-c);const h=i>=this.totalDuration?1:Math.min(c,1),d=f(this.easing(h));t(d);void 0===this.pauseTime&&("finished"===this.playState||i>=this.totalDuration+o)?(this.playState="finished",null===(n=this.resolve)||void 0===n||n.call(this,d)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(t=this.reject)||void 0===t||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){void 0!==this.pauseTime||0===this.rate?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const I=(t,e)=>document.createElement("div").animate(t,e),U={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{I({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(I({opacity:[0,1]},{duration:.001}).finished),linearEasing:()=>{try{I({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0}},N={},_={};for(const t in U)_[t]=()=>(void 0===N[t]&&(N[t]=U[t]()),N[t]);const G=(t,e)=>y(t)?_.linearEasing()?`linear(${((t,e)=>{let n="";const i=Math.round(e/.015);for(let e=0;e<i;e++)n+=t(d(0,i-1,e))+", ";return n.substring(0,n.length-2)})(t,e)})`:s.easing:(t=>Array.isArray(t)&&a(t[0]))(t)?Z(t):t,Z=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`;const K=t=>Array.isArray(t)?t:[t];function X(t){return A[t]&&(t=A[t]),j(t)?D(t):t}const Y={get:(t,e)=>{e=X(e);let n=z(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=S.get(e);t&&(n=t.initialValue)}return n},set:(t,e,n)=>{e=X(e),z(e)?t.style.setProperty(e,n):t.style[e]=n}};function J(t,e=!0){if(t&&"finished"!==t.playState)try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch(t){}}function Q(e,r,o,l={}){const u=window.__MOTION_DEV_TOOLS_RECORD,h=!1!==l.record&&u;let d,{duration:p=s.duration,delay:g=s.delay,endDelay:m=s.endDelay,repeat:w=s.repeat,easing:E=s.easing,direction:O,offset:x,allowWebkitAcceleration:T=!1}=l;const M=n(e),D=j(r);let k=_.waapi();D&&((t,e)=>{A[e]&&(e=A[e]);const{transforms:r}=n(t);i(r,e),t.style.transform=R(r)})(e,r);const L=X(r),W=function(e,n){return e.has(n)||e.set(n,new t),e.get(n)}(M.values,L),B=S.get(L);return J(W.animation,!(v(E)&&W.generator)&&!1!==l.record),()=>{const t=()=>{var t,n;return null!==(n=null!==(t=Y.get(e,L))&&void 0!==t?t:null==B?void 0:B.initialValue)&&void 0!==n?n:0};let n=function(t,e){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:e());return t}(K(o),t);if(v(E)){const e=E.createAnimation(n,t,D,L,W);E=e.easing,void 0!==e.keyframes&&(n=e.keyframes),void 0!==e.duration&&(p=e.duration)}if(z(L)&&(_.cssRegisterProperty()?function(t){if(!P.has(t)){P.add(t);try{const{syntax:e,initialValue:n}=S.has(t)?S.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(L):k=!1),y(E)&&!_.linearEasing()&&D&&(k=!1),k){B&&(n=n.map((t=>a(t)?B.toDefaultUnit(t):t))),1!==n.length||_.partialKeyframes()&&!h||n.unshift(t());const i={delay:b(g),duration:b(p),endDelay:b(m),easing:c(E)?void 0:G(E,p),direction:O,iterations:w+1,fill:"both"};d=e.animate({[L]:n,offset:x,easing:c(E)?E.map((t=>G(t,p))):void 0},i),d.finished||(d.finished=new Promise(((t,e)=>{d.onfinish=t,d.oncancel=e})));const r=n[n.length-1];d.finished.then((()=>{Y.set(e,L,r),d.cancel()})).catch(f),T||(d.playbackRate=1.000001)}else if(D){n=n.map((t=>"string"==typeof t?parseFloat(t):t)),1===n.length&&n.unshift(parseFloat(t()));d=new H((t=>{B&&(t=B.toDefaultUnit(t)),Y.set(e,L,t)}),n,Object.assign(Object.assign({},l),{duration:p,easing:E}))}else{const t=n[n.length-1];Y.set(e,L,B&&a(t)?B.toDefaultUnit(t):t)}return h&&u(e,r,n,{duration:p,delay:g,easing:E,repeat:w,offset:x},"motion-one"),W.setAnimation(d),d}}const tt=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function et(t,e){var n;return"string"==typeof t?e?(null!==(n=e[t])&&void 0!==n||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const nt=t=>t(),it=(t,e,n=s.duration)=>new Proxy({animations:t.map(nt).filter(Boolean),duration:n,options:e},rt),rt={get:(t,e)=>{const n=t.animations[0];switch(e){case"duration":return t.duration;case"currentTime":return E((null==n?void 0:n[e])||0);case"playbackRate":case"playState":return null==n?void 0:n[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(ot)).catch(f)),t.finished;case"stop":return()=>{t.animations.forEach((t=>J(t)))};case"forEachNative":return e=>{t.animations.forEach((n=>e(n,t)))};default:return void 0===(null==n?void 0:n[e])?void 0:()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n=b(n);case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}},ot=t=>t.finished;function st(t=.1,{start:e=0,from:n=0,easing:i}={}){return(r,o)=>{const s=a(n)?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,o),c=Math.abs(s-r);let l=t*c;if(i){const e=o*t;l=C(i)(l/e)*e}return e+l}}function at(t,e,n){return y(t)?t(e,n):t}function ct(t,e,n={}){const i=(t=et(t)).length,r=[];for(let o=0;o<i;o++){const s=t[o];for(const t in e){const a=tt(n,t);a.delay=at(a.delay,o,i);const c=Q(s,t,e[t],a);r.push(c)}}return it(r,n,n.duration)}function lt(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}var ut=function(){};function ft(t,e,n,i){var r;return a(e)?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(r=i.get(e))&&void 0!==r?r:t}function ht(t,e,n,i,o,s){!function(t,e,n){for(let i=0;i<t.length;i++){const o=t[i];o.at>e&&o.at<n&&(r(t,o),i--)}}(t,o,s);for(let r=0;r<e.length;r++)t.push({value:e[r],at:u(o,s,i[r]),easing:l(n,r)})}function dt(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function pt(t,e={}){var n;const i=function(t,e={}){var{defaultOptions:n={}}=e,i=lt(e,["defaultOptions"]);const r=[],o=new Map,a={},c=new Map;let l=0,u=0,f=0;for(let e=0;e<t.length;e++){const i=t[e];if(w(i)){c.set(i,u);continue}if(!Array.isArray(i)){c.set(i.name,ft(u,i.at,l,c));continue}const[r,h,d={}]=i;void 0!==d.at&&(u=ft(u,d.at,l,c));let m=0;const y=et(r,a),b=y.length;for(let t=0;t<b;t++){const e=gt(y[t],o);for(const i in h){const r=mt(i,e);let o=K(h[i]);const a=tt(d,i);let{duration:c=n.duration||s.duration,easing:l=n.easing||s.easing}=a;if(v(l)){const t=j(i);ut(2===o.length||!t,"spring must be provided 2 keyframes within timeline");const e=l.createAnimation(o,(()=>"0"),t);l=e.easing,void 0!==e.keyframes&&(o=e.keyframes),void 0!==e.duration&&(c=e.duration)}const y=at(d.delay,t,b)||0,w=u+y,E=w+c;let{offset:O=g(o.length)}=a;1===O.length&&0===O[0]&&(O[1]=1);const x=length-o.length;x>0&&p(O,x),1===o.length&&o.unshift(null),ht(r,o,l,O,w,E),m=Math.max(y+c,m),f=Math.max(E,f)}}l=u,u+=m}return o.forEach(((t,e)=>{for(const o in t){const a=t[o];a.sort(dt);const c=[],l=[],u=[];for(let t=0;t<a.length;t++){const{at:e,value:n,easing:i}=a[t];c.push(n),l.push(d(0,f,e)),u.push(i||s.easing)}0!==l[0]&&(l.unshift(0),c.unshift(c[0]),u.unshift("linear")),1!==l[l.length-1]&&(l.push(1),c.push(null)),r.push([e,o,c,Object.assign(Object.assign(Object.assign({},n),{duration:f,easing:u,offset:l}),i)])}})),r}(t,e),r=i.map((t=>Q(...t))).filter(Boolean);return it(r,e,null===(n=i[0])||void 0===n?void 0:n[3].duration)}function gt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function mt(t,e){return e[t]||(e[t]=[]),e[t]}"production"!==process.env.NODE_ENV&&(ut=function(t,e){if(!t)throw new Error(e)});function vt(t,e,n){const i=Math.max(e-5,0);return O(n-t(i),e-i)}const yt=100,wt=10,bt=1;const Et=({stiffness:t=yt,damping:e=wt,mass:n=bt,from:i=0,to:r=1,velocity:o=0,restSpeed:s=2,restDistance:a=.5}={})=>{o=o?E(o):0;const c={done:!1,hasReachedTarget:!1,current:i,target:r},l=r-i,u=Math.sqrt(t/n)/1e3,f=((t=yt,e=wt,n=bt)=>e/(2*Math.sqrt(t*n)))(t,e,n);let h;if(f<1){const t=u*Math.sqrt(1-f*f);h=e=>r-Math.exp(-f*u*e)*((f*u*l-o)/t*Math.sin(t*e)+l*Math.cos(t*e))}else h=t=>r-Math.exp(-u*t)*(l+(u*l-o)*t);return t=>{c.current=h(t);const e=0===t?o:vt(h,t,c.current),n=Math.abs(e)<=s,l=Math.abs(r-c.current)<=a;var u,f,d;return c.done=n&&l,c.hasReachedTarget=(u=i,f=r,d=c.current,u<f&&d>=f||u>f&&d<=f),c}};function Ot(t){const e=new WeakMap;return(n={})=>{const i=new Map,r=(e=0,r=100,o=0,s=!1)=>{const a=`${e}-${r}-${o}-${s}`;return i.has(a)||i.set(a,t(Object.assign({from:e,to:r,velocity:o,restSpeed:s?.05:2,restDistance:s?.01:.5},n))),i.get(a)},o=t=>(e.has(t)||e.set(t,function(t){let e,n=10,i=t(0);const r=[i.current];for(;!i.done&&n<1e4;)i=t(n),r.push(i.done?i.target:i.current),void 0===e&&i.hasReachedTarget&&(e=n),n+=10;const o=n-10;return 1===r.length&&r.push(i.current),{keyframes:r,duration:o/1e3,overshootDuration:(null!=e?e:o)/1e3}}(t)),e.get(t));return{createAnimation:(t,e,n,i,s)=>{var a,c;let l;const u=t.length;if(n&&u<=2&&t.every(xt)){const n=t[u-1],f=1===u?null:t[0];let h=0,d=0;const p=null==s?void 0:s.generator;if(p){const{animation:e,generatorStartTime:n}=s,i=(null==e?void 0:e.startTime)||n||0,r=(null==e?void 0:e.currentTime)||performance.now()-i,o=p(r).current;d=null!==(a=f)&&void 0!==a?a:o,(1===u||2===u&&null===t[0])&&(h=vt((t=>p(t).current),r,o))}else d=null!==(c=f)&&void 0!==c?c:parseFloat(e());const g=r(d,n,h,null==i?void 0:i.includes("scale")),m=o(g);l=Object.assign(Object.assign({},m),{easing:"linear"}),s&&(s.generator=g,s.generatorStartTime=performance.now())}else{l={easing:"ease",duration:o(r(0,100)).overshootDuration}}return l}}}}const xt=t=>"string"!=typeof t,At=Ot(Et),Tt=Ot((({from:t=0,velocity:e=0,power:n=.8,decay:i=.325,bounceDamping:r,bounceStiffness:o,changeTarget:s,min:a,max:c,restDistance:l=.5,restSpeed:u})=>{i=b(i);const f={hasReachedTarget:!1,done:!1,current:t,target:t},h=t=>void 0===a?c:void 0===c||Math.abs(a-t)<Math.abs(c-t)?a:c;let d=n*e;const p=t+d,g=void 0===s?p:s(p);f.target=g,g!==p&&(d=g-t);const m=t=>-d*Math.exp(-t/i),v=t=>g+m(t),y=t=>{const e=m(t),n=v(t);f.done=Math.abs(e)<=l,f.current=f.done?g:n};let w,E;const O=t=>{var e;(e=f.current,void 0!==a&&e<a||void 0!==c&&e>c)&&(w=t,E=Et({from:f.current,to:h(f.current),velocity:vt(v,t,f.current),damping:r,stiffness:o,restDistance:l,restSpeed:u}))};return O(0),t=>{let e=!1;return E||void 0!==w||(e=!0,y(t),O(t)),void 0!==w&&t>w?(f.hasReachedTarget=!0,E(t-w)):(f.hasReachedTarget=!1,!e&&y(t),f)}})),Mt={any:0,all:1};function St(t,e,{root:n,margin:i,amount:r="any"}={}){if("undefined"==typeof IntersectionObserver)return()=>{};const o=et(t),s=new WeakMap,a=new IntersectionObserver((t=>{t.forEach((t=>{const n=s.get(t.target);if(t.isIntersecting!==Boolean(n))if(t.isIntersecting){const n=e(t);y(n)?s.set(t.target,n):a.unobserve(t.target)}else n&&(n(t),s.delete(t.target))}))}),{root:n,rootMargin:i,threshold:"number"==typeof r?r:Mt[r]});return o.forEach((t=>a.observe(t))),()=>a.disconnect()}const Dt=new WeakMap;let kt;function Lt({target:t,contentRect:e,borderBoxSize:n}){var i;null===(i=Dt.get(t))||void 0===i||i.forEach((i=>{i({target:t,contentSize:e,get size(){return function(t,e){if(e){const{inlineSize:t,blockSize:n}=e[0];return{width:t,height:n}}return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}(t,n)}})}))}function Wt(t){t.forEach(Lt)}function jt(t,e){kt||"undefined"!=typeof ResizeObserver&&(kt=new ResizeObserver(Wt));const n=et(t);return n.forEach((t=>{let n=Dt.get(t);n||(n=new Set,Dt.set(t,n)),n.add(e),null==kt||kt.observe(t)})),()=>{n.forEach((t=>{const n=Dt.get(t);null==n||n.delete(e),(null==n?void 0:n.size)||null==kt||kt.unobserve(t)}))}}const Rt=new Set;let Bt;function zt(t){return Rt.add(t),Bt||(Bt=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Rt.forEach((t=>t(e)))},window.addEventListener("resize",Bt)),()=>{Rt.delete(t),!Rt.size&&Bt&&(Bt=void 0)}}function Pt(t,e){return y(t)?zt(t):jt(t,e)}const Vt={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function $t(t,e,n,i){const r=n[e],{length:o,position:s}=Vt[e],a=r.current,c=n.time;r.current=t["scroll"+s],r.scrollLength=t["scroll"+o]-t["client"+o],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=d(0,r.scrollLength,r.current);const l=i-c;r.velocity=l>50?0:O(r.current-a,l)}const qt={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},Ft={start:0,center:.5,end:1};function Ct(t,e,n=0){let i=0;if(void 0!==Ft[t]&&(t=Ft[t]),w(t)){const e=parseFloat(t);t.endsWith("px")?i=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?i=e/100*document.documentElement.clientWidth:t.endsWith("vh")?i=e/100*document.documentElement.clientHeight:t=e}return a(t)&&(i=e*t),n+i}const Ht=[0,0];function It(t,e,n,i){let r=Array.isArray(t)?t:Ht,o=0,s=0;return a(t)?r=[t,t]:w(t)&&(r=(t=t.trim()).includes(" ")?t.split(" "):[t,Ft[t]?t:"0"]),o=Ct(r[0],n,i),s=Ct(r[1],e),o-s}const Ut={x:0,y:0};function Nt(t,e,n){let{offset:i=qt.All}=n;const{target:r=t,axis:o="y"}=n,s="y"===o?"height":"width",a=r!==t?function(t,e){let n={x:0,y:0},i=t;for(;i&&i!==e;)if(i instanceof HTMLElement)n.x+=i.offsetLeft,n.y+=i.offsetTop,i=i.offsetParent;else if(i instanceof SVGGraphicsElement&&"getBBox"in i){const{top:t,left:e}=i.getBBox();for(n.x+=e,n.y+=t;i&&"svg"!==i.tagName;)i=i.parentNode}return n}(r,t):Ut,c=r===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:r.clientWidth,height:r.clientHeight},l={width:t.clientWidth,height:t.clientHeight};e[o].offset.length=0;let u=!e[o].interpolate;const f=i.length;for(let t=0;t<f;t++){const n=It(i[t],l[s],c[s],a[o]);u||n===e[o].interpolatorOffsets[t]||(u=!0),e[o].offset[t]=n}u&&(e[o].interpolate=m(g(f),e[o].offset),e[o].interpolatorOffsets=[...e[o].offset]),e[o].progress=e[o].interpolate(e[o].current)}function _t(t,e,n,i={}){const r=i.axis||"y";return{measure:()=>function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let i=e;for(;i&&i!=t;)n.x.targetOffset+=i.offsetLeft,n.y.targetOffset+=i.offsetTop,i=i.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,i.target,n),update:e=>{!function(t,e,n){$t(t,"x",e,n),$t(t,"y",e,n),e.time=n}(t,n,e),(i.offset||i.target)&&Nt(t,n,i)},notify:y(e)?()=>e(n):Gt(e,n[r])}}function Gt(t,e){return t.pause(),t.forEachNative(((t,{easing:e})=>{var n,i;if(t.updateDuration)e||(t.easing=h),t.updateDuration(1);else{const r={duration:1e3};e||(r.easing="linear"),null===(i=null===(n=t.effect)||void 0===n?void 0:n.updateTiming)||void 0===i||i.call(n,r)}})),()=>{t.currentTime=e.progress}}const Zt=new WeakMap,Kt=new WeakMap,Xt=new WeakMap,Yt=t=>t===document.documentElement?window:t;function Jt(t,e={}){var{container:n=document.documentElement}=e,i=lt(e,["container"]);let r=Xt.get(n);r||(r=new Set,Xt.set(n,r));const o=_t(n,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},i);if(r.add(o),!Zt.has(n)){const t=()=>{const t=performance.now();for(const t of r)t.measure();for(const e of r)e.update(t);for(const t of r)t.notify()};Zt.set(n,t);const e=Yt(n);window.addEventListener("resize",t,{passive:!0}),n!==document.documentElement&&Kt.set(n,Pt(n,t)),e.addEventListener("scroll",t,{passive:!0})}const s=Zt.get(n),a=requestAnimationFrame(s);return()=>{var e;"function"!=typeof t&&t.stop(),cancelAnimationFrame(a);const i=Xt.get(n);if(!i)return;if(i.delete(o),i.size)return;const r=Zt.get(n);Zt.delete(n),r&&(Yt(n).removeEventListener("scroll",r),null===(e=Kt.get(n))||void 0===e||e(),window.removeEventListener("resize",r))}}function Qt(t,e){return function(t){return"object"==typeof t}(t)?t:t&&e?e[t]:void 0}let te;function ee(){if(!te)return;const t=te.sort(ie).map(re);t.forEach(oe),t.forEach(oe),te=void 0}function ne(t){te?i(te,t):(te=[t],requestAnimationFrame(ee))}const ie=(t,e)=>t.getDepth()-e.getDepth(),re=t=>t.animateUpdates(),oe=t=>t.next(),se=(t,e)=>new CustomEvent(t,{detail:{target:e}});function ae(t,e,n){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:n}}))}function ce(t,e,n){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:n}}))}const le=(t,e,n)=>i=>{i.pointerType&&"mouse"!==i.pointerType||(n(),ae(t,e,i))},ue={inView:{isActive:t=>Boolean(t.inView),subscribe:(t,{enable:e,disable:n},{inViewOptions:i={}})=>{const{once:r}=i,o=lt(i,["once"]);return St(t,(i=>{if(e(),ce(t,"viewenter",i),!r)return e=>{n(),ce(t,"viewleave",e)}}),o)}},hover:{isActive:t=>Boolean(t.hover),subscribe:(t,{enable:e,disable:n})=>{const i=le(t,"hoverstart",e),r=le(t,"hoverend",n);return t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",r)}}},press:{isActive:t=>Boolean(t.press),subscribe:(t,{enable:e,disable:n})=>{const i=e=>{n(),ae(t,"pressend",e),window.removeEventListener("pointerup",i)},r=n=>{e(),ae(t,"pressstart",n),window.addEventListener("pointerup",i)};return t.addEventListener("pointerdown",r),()=>{t.removeEventListener("pointerdown",r),window.removeEventListener("pointerup",i)}}}},fe=["initial","animate",...Object.keys(ue),"exit"],he=new WeakMap;function de(t={},e){let n,i=e?e.getDepth()+1:0;const o={initial:!0,animate:!0},s={},a={};for(const n of fe)a[n]="string"==typeof t[n]?t[n]:null==e?void 0:e.getContext()[n];const c=!1===t.initial?"animate":"initial";let l=lt(Qt(t[c]||a[c],t.variants)||{},["transition"]);const u=Object.assign({},l);const h=(t,e)=>()=>{o[t]=e,ne(p)},d=()=>{for(const e in ue){const i=ue[e].isActive(t),r=s[e];i&&!r?s[e]=ue[e].subscribe(n,{enable:h(e,!0),disable:h(e,!1)},t):!i&&r&&(r(),delete s[e])}},p={update:e=>{n&&(t=e,d(),ne(p))},setActive:(t,e)=>{n&&(o[t]=e,ne(p))},animateUpdates:function*(){var e,i;const r=l;l={};const s={};for(const n of fe){if(!o[n])continue;const r=Qt(t[n]);if(r)for(const n in r)"transition"!==n&&(l[n]=r[n],s[n]=tt(null!==(i=null!==(e=r.transition)&&void 0!==e?e:t.transition)&&void 0!==i?i:{},n))}const a=new Set([...Object.keys(l),...Object.keys(r)]),c=[];a.forEach((t=>{var e,i,o;void 0===l[t]&&(l[t]=u[t]),i=r[t],o=l[t],typeof i==typeof o&&(Array.isArray(i)&&Array.isArray(o)?function(t,e){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}(i,o):i===o)||(null!==(e=u[t])&&void 0!==e||(u[t]=Y.get(n,t)),c.push(Q(n,t,l[t],s[t])))})),yield;const h=c.map((t=>t())).filter(Boolean);if(!h.length)return;const d=l;n.dispatchEvent(se("motionstart",d)),Promise.all(h.map((t=>t.finished))).then((()=>{n.dispatchEvent(se("motioncomplete",d))})).catch(f)},getDepth:()=>i,getTarget:()=>l,getOptions:()=>t,getContext:()=>a,mount:t=>(ut(Boolean(t),"Animation state must be mounted with valid Element"),n=t,he.set(n,p),d(),()=>{he.delete(n),function(t){te&&r(te,t)}(p);for(const t in s)s[t]()}),isMounted:()=>Boolean(n)};return p}function pe(t){const e={},n=[];for(let i in t){const r=t[i];j(i)&&(A[i]&&(i=A[i]),n.push(i),i=D(i));let o=Array.isArray(r)?r[0]:r;const s=S.get(i);s&&(o=a(r)?s.toDefaultUnit(r):r),e[i]=o}return n.length&&(e.transform=R(n)),e}const ge=t=>`-${t.toLowerCase()}`;function me(t={}){const e=pe(t);let n="";for(const t in e)n+=t.startsWith("--")?t:t.replace(/[A-Z]/g,ge),n+=`: ${e[t]}; `;return n}function ve(t,e={}){return it([()=>{const n=new H(t,[0,1],e);return n.finished.catch((()=>{})),n}],e,e.duration)}function ye(t,e,n){return(y(t)?ve:ct)(t,e,n)}export{t as MotionValue,qt as ScrollOffset,ye as animate,Q as animateStyle,de as createMotionState,me as createStyleString,pe as createStyles,n as getAnimationData,X as getStyleName,Tt as glide,St as inView,he as mountedStates,Pt as resize,Jt as scroll,At as spring,st as stagger,Y as style,pt as timeline,it as withControls};
|
package/dist/vue.cjs.js
CHANGED
|
File without changes
|
package/dist/vue.es.js
CHANGED
|
File without changes
|
package/lib/animate.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { animate as animateDom,
|
|
1
|
+
import { animate as animateDom, withControls, } from "@motionone/dom";
|
|
2
|
+
import { isFunction } from "@motionone/utils";
|
|
2
3
|
import { Animation } from "@motionone/animation";
|
|
3
|
-
export function animateProgress(target, options) {
|
|
4
|
-
return
|
|
4
|
+
export function animateProgress(target, options = {}) {
|
|
5
|
+
return withControls([
|
|
5
6
|
() => {
|
|
6
7
|
const animation = new Animation(target, [0, 1], options);
|
|
7
8
|
animation.finished.catch(() => { });
|
|
8
9
|
return animation;
|
|
9
10
|
},
|
|
10
|
-
], options
|
|
11
|
+
], options, options.duration);
|
|
11
12
|
}
|
|
12
13
|
export function animate(target, keyframesOrOptions, options) {
|
|
13
|
-
const
|
|
14
|
-
return
|
|
14
|
+
const factory = isFunction(target) ? animateProgress : animateDom;
|
|
15
|
+
return factory(target, keyframesOrOptions, options);
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=animate.js.map
|
package/lib/animate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animate.js","sourceRoot":"","sources":["../src/animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,IAAI,UAAU,EAGrB,
|
|
1
|
+
{"version":3,"file":"animate.js","sourceRoot":"","sources":["../src/animate.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,IAAI,UAAU,EAGrB,YAAY,GACb,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAOhD,MAAM,UAAU,eAAe,CAC7B,MAAwB,EACxB,UAA4B,EAAE;IAE9B,OAAO,YAAY,CACjB;QACE,GAAG,EAAE;YACH,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;YACxD,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;YAClC,OAAO,SAAS,CAAA;QAClB,CAAC;KACF,EACD,OAAO,EACP,OAAO,CAAC,QAAQ,CACjB,CAAA;AACH,CAAC;AAWD,MAAM,UAAU,OAAO,CACrB,MAA4C,EAC5C,kBAAiE,EACjE,OAAuC;IAEvC,MAAM,OAAO,GAAQ,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,UAAU,CAAA;IAEtE,OAAO,OAAO,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAA;AACrD,CAAC"}
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
package/lib/react.js
CHANGED
|
File without changes
|
package/lib/react.js.map
CHANGED
|
File without changes
|
package/lib/vue.js
CHANGED
|
File without changes
|
package/lib/vue.js.map
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "motion",
|
|
3
3
|
"description": "A tiny, performant animation library for the web",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.13.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Matt Perry",
|
|
7
7
|
"main": "dist/main.cjs.js",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"dev": "concurrently -c blue,red -n tsc,rollup --kill-others \"tsc --watch -p . --preserveWatchOutput\" \"rollup --c --watch --no-watch.clearScreen\""
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@motionone/animation": "^10.
|
|
27
|
-
"@motionone/dom": "^10.
|
|
28
|
-
"@motionone/
|
|
29
|
-
"@motionone/
|
|
30
|
-
"@motionone/
|
|
31
|
-
"@motionone/vue": "^10.
|
|
26
|
+
"@motionone/animation": "^10.13.0",
|
|
27
|
+
"@motionone/dom": "^10.13.0",
|
|
28
|
+
"@motionone/svelte": "^10.13.0",
|
|
29
|
+
"@motionone/types": "^10.13.0",
|
|
30
|
+
"@motionone/utils": "^10.13.0",
|
|
31
|
+
"@motionone/vue": "^10.13.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "40bc3d673c83ba5bf2fd0118c55db2389617d901"
|
|
34
34
|
}
|
package/types/animate.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElementOrSelector, AnimationOptionsWithOverrides, MotionKeyframesDefinition } from "@motionone/dom";
|
|
2
2
|
import { AnimationControls, AnimationOptions, ProgressFunction } from "@motionone/types";
|
|
3
3
|
export declare function animateProgress(target: ProgressFunction, options?: AnimationOptions): AnimationControls;
|
|
4
|
-
export declare function animate(elements:
|
|
4
|
+
export declare function animate(elements: ElementOrSelector, keyframes: MotionKeyframesDefinition, options?: AnimationOptionsWithOverrides): AnimationControls;
|
|
5
5
|
export declare function animate(target: ProgressFunction, options?: AnimationOptions): AnimationControls;
|
|
6
6
|
//# sourceMappingURL=animate.d.ts.map
|
package/types/animate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../src/animate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../src/animate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAEjB,6BAA6B,EAC7B,yBAAyB,EAE1B,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAEzB,wBAAgB,eAAe,CAC7B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,gBAAqB,qBAa/B;AAED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,yBAAyB,EACpC,OAAO,CAAC,EAAE,6BAA6B,GACtC,iBAAiB,CAAA;AACpB,wBAAgB,OAAO,CACrB,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,gBAAgB,GACzB,iBAAiB,CAAA"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { animate } from "./animate";
|
|
1
|
+
export * from "@motionone/dom";
|
|
3
2
|
export * from "@motionone/types";
|
|
4
|
-
export
|
|
3
|
+
export { animate } from "./animate";
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
|
package/types/react.d.ts
CHANGED
|
File without changes
|
package/types/react.d.ts.map
CHANGED
|
File without changes
|
package/types/vue.d.ts
CHANGED
|
File without changes
|
package/types/vue.d.ts.map
CHANGED
|
File without changes
|
package/dist/react.cjs.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var react = require('@motionone/react');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.keys(react).forEach(function (k) {
|
|
10
|
-
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () { return react[k]; }
|
|
13
|
-
});
|
|
14
|
-
});
|
package/dist/react.es.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@motionone/react';
|