Socket
Socket
Sign inDemoInstall

motion

Package Overview
Dependencies
Maintainers
1
Versions
207
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion - npm Package Compare versions

Comparing version 10.0.0-rc.0 to 10.0.0-rc.1

2

dist/motion.min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=new WeakMap;function n(t){return e.has(t)||e.set(t,{activeTransforms:[],activeAnimations:{}}),e.get(t)}function i(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const a=()=>{},r=t=>t,s=["","X","Y","Z"],o={x:"translateX",y:"translateY",z:"translateZ"},c={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},l={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:c,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:r},skew:c},u=new Map,f=t=>`--motion-${t}`,h=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{s.forEach((e=>{h.push(t+e),u.set(f(t+e),l[t])}))}));const p=(t,e)=>h.indexOf(t)-h.indexOf(e),y=new Set(h),m=t=>t.sort(p).reduce(d,"").trim(),d=(t,e)=>`${t} ${e}(var(${f(e)}))`,g=t=>t.startsWith("--"),v=new Set;const b=t=>1e3*t;function T(t){try{t.commitStyles(),t.cancel()}catch(t){}}const x=t=>Array.isArray(t)&&"number"!=typeof t[0],O=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?w(t):t,w=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,S=t=>document.createElement("div").animate(t,{duration:.001}),M={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{S({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(S({opacity:[0,1]}).finished)},A={},j=Object.keys(M).reduce(((t,e)=>(t[e]=()=>(void 0===A[e]&&(A[e]=M[e]()),A[e]),t)),{}),P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},k=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function D(t,e,n,i){if(t===e&&n===i)return r;const a=e=>function(t,e,n,i,a){let r,s,o=0;do{s=e+(n-e)/2,r=k(s,i,a)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:k(a(t),e,i)}var E=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},V=function(t,e,n){return-n*t+n*e+t},$=function(t,e){return void 0===e&&(e="end"),function(n){var i,a,r,s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i=0,a=1,r=o/t,Math.min(Math.max(r,i),a)}};const R={ease:D(.25,.1,.25,1),"ease-in":D(.42,0,1,1),"ease-in-out":D(.42,0,.58,1),"ease-out":D(0,0,.58,1)},U=/\((.*?)\)/;function F(t){if("function"==typeof t)return t;if(Array.isArray(t))return D(...t);if(R[t])return R[t];if(t.startsWith("steps")){const e=U.exec(t);if(e){const t=e[1].split(",");return $(parseFloat(t[0]),t[1].trim())}}return r}function W(t,e){return Array.isArray(t)?t[(n=0,i=t.length,a=e,r=i-n,((a-n)%r+r)%r+n)]:t;var n,i,a,r}function q(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=E(0,e,i);t.push(V(n,1,a))}}function C(t){const e=[0];return q(e,t-1),e}function z(t,e=C(t.length),n=r){const i=t.length,a=i-e.length;return a>0&&q(e,a),a=>{let r=0;for(;r<i-2&&!(a<e[r+1]);r++);let s=(o=E(e[r],e[r+1],a),Math.min(1,Math.max(o,0)));var o;return s=W(n,r)(s),V(t[r],t[r+1],s)}}class K{constructor(t,e,{easing:n=P.easing,duration:i=P.duration,delay:a=P.delay,endDelay:r=P.endDelay,offset:s,repeat:o=P.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=i*(o+1),u=z(e,s,x(n)?n.map(F):F(n));this.tick=e=>{if("finished"===this.playState){const e=u(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-a,0);const s=n/i;let o=Math.floor(s),f=s%1;!f&&s>=1&&(f=1),1===f&&o--;const h=o%2;("reverse"===c||"alternate"===c&&h||"alternate-reverse"===c&&!h)&&(f=1-f);const p=n>=l?1:Math.min(f,1),y=u(p);t(y);n>=l+r?(this.playState="finished",this.resolve(y)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=b(t):this.startTime=performance.now()-b(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=(t,e)=>{let n=g(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=u.get(e);t&&(n=t.initialValue)}return n};const Y=t=>Array.isArray(t)?t:[t];function Z(t,e,i,r={}){let{duration:s=P.duration,delay:c=P.delay,endDelay:l=P.endDelay,repeat:h=P.repeat,easing:p=P.easing,direction:d,offset:w}=r;const S=n(t);let M=j.waapi(),A=a;const k=(t=>y.has(t))(e);k&&(o[e]&&(e=o[e]),((t,e)=>{const{activeTransforms:i}=n(t);var a,r;r=e,-1===(a=i).indexOf(r)&&a.push(r),t.style.transform=m(i)})(t,e),e=f(e));const D=u.get(e);let E=function(t,e,n){for(let i=0;i<t.length;i++)null===t[i]&&(t[i]=i?t[i-1]:X(e,n));return t}(Y(i),t,e);if(function(t,e){t.activeAnimations[e]&&(T(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(S,e),g(e)?(A=((t,e)=>n=>t.style.setProperty(e,n))(t,e),j.cssRegisterProperty()?function(t){if(!v.has(t)){v.add(t);try{const{syntax:e,initialValue:n}=u.has(t)?u.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(e):M=!1):A=((t,e)=>n=>t.style[e]=n)(t,e),M){D&&(E=E.map((t=>"number"==typeof t?D.toDefaultUnit(t):t))),j.partialKeyframes()||1!==E.length||E.unshift(X(t,e));const n={delay:b(c),duration:b(s),endDelay:b(l),easing:x(p)?void 0:O(p),direction:d,iterations:h+1},i=t.animate({[e]:E,offset:w,easing:x(p)?p.map(O):void 0},n);S.activeAnimations[e]=i,i.finished||(i.finished=new Promise(((t,e)=>{i.onfinish=t,i.oncancel=e})));const r=E[E.length-1];return i.finished.then((()=>A(r))).catch(a),i}if(k&&E.every(_)){if(1===E.length&&E.unshift(X(t,e)||(null==D?void 0:D.initialValue)||0),E=E.map((t=>"string"==typeof t?parseFloat(t):t)),D){const t=A;A=e=>t(D.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new K(t,e,n)}(A,E,r)}{const t=E[E.length-1];A(D&&"number"==typeof t?D.toDefaultUnit(t):t)}}const _=t=>"number"==typeof t,B=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;function I(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)}function G(t){const e={animations:t,finished:Promise.all(t.map((t=>t.finished)))};return new Proxy(e,H)}const H={get:(t,e)=>{var n,i;switch(e){case"finished":return t.finished;case"currentTime":const a=(null===(n=t.animations[0])||void 0===n?void 0:n[e])||0;return a?a/1e3:0;case"playbackRate":return null===(i=t.animations[0])||void 0===i?void 0:i[e];case"stop":return()=>t.animations.forEach(T);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n*=1e3;case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}};function J(t,e,n){return"function"==typeof t?t(e,n):t}function L(t,e,n){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?t+parseFloat(e):null!==(i=n.get(e))&&void 0!==i?i:t}function N(t,e,n,a,r,s){!function(t,e,n){for(let a=0;a<t.length;a++){const r=t[a];r.at>e&&r.at<n&&(i(t,r),a--)}}(t,r,s);for(let i=0;i<e.length;i++)t.push({value:e[i],at:V(r,s,a[i]),easing:W(n,i)})}function Q(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function tt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function et(t,e){return e[t]||(e[t]=[]),e[t]}t.animate=function(t,e,n={}){const i=[],a=(t=I(t)).length;for(let r=0;r<a;r++){const s=t[r];for(const t in e){const o=B(n,t);o.delay=J(o.delay,r,a);const c=Z(s,t,e[t],o);c&&i.push(c)}}return G(i)},t.animateStyle=Z,t.stagger=function(t=.1,{start:e=0,from:n=0,easing:i}={}){return(a,r)=>{const s="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),o=Math.abs(s-a);let c=t*o;if(i){const t=r*a;c=F(i)(c/t)*t}return e+c}},t.timeline=function(t,e={}){const n=[],i=function(t,e={}){var{defaultOptions:n={}}=e,i=function(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 a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(n[i[a]]=t[i[a]])}return n}(e,["defaultOptions"]);const a=[],r=new Map,s={},o=new Map;let c=0,l=0;for(let e=0;e<t.length;e++){const[i,a,u={}]=t[e];void 0!==u.at&&(c=L(c,u.at,o));let f=0;const h=I(i,s),p=h.length;for(let t=0;t<p;t++){const e=tt(h[t],r);for(const i in a){const r=et(i,e),s=Y(a[i]),o=B(u,i),{duration:h=n.duration||P.duration,easing:y=n.easing||P.easing,offset:m=C(s.length)}=o,d=J(u.delay,t,p)||0,g=c+d,v=g+h;1===m.length&&0===m[0]&&(m[1]=1);const b=length-s.length;b>0&&q(m,b),1===s.length&&s.unshift(null),N(r,s,y,m,g,v),f=Math.max(d+h,f),l=Math.max(v,l)}}c+=f}return r.forEach(((t,e)=>{for(const r in t){const s=t[r];s.sort(Q);const o=[],c=[],u=[];for(let t=0;t<s.length;t++){const{at:e,value:n,easing:i}=s[t];o.push(n),c.push(E(0,l,e)),u.push(i||P.easing)}1!==c[c.length-1]&&(c.push(1),o.push(null)),a.push([e,r,o,Object.assign(Object.assign(Object.assign({},n),{duration:l,easing:u,offset:c}),i)])}})),a}(t,e);for(let t=0;t<i.length;t++){const e=Z(...i[t]);e&&n.push(e)}return G(n)},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Motion={})}(this,(function(t){"use strict";const e=new WeakMap;function n(t){return e.has(t)||e.set(t,{activeTransforms:[],activeAnimations:{}}),e.get(t)}function i(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const a=()=>{},r=t=>t,s=["","X","Y","Z"],o={x:"translateX",y:"translateY",z:"translateZ"},c={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},l={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:c,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:r},skew:c},u=new Map,f=t=>`--motion-${t}`,h=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{s.forEach((e=>{h.push(t+e),u.set(f(t+e),l[t])}))}));const p=(t,e)=>h.indexOf(t)-h.indexOf(e),m=new Set(h),y=t=>t.sort(p).reduce(d,"").trim(),d=(t,e)=>`${t} ${e}(var(${f(e)}))`,g=t=>t.startsWith("--"),v=new Set;const b=t=>1e3*t;function x(t){try{t.commitStyles(),t.cancel()}catch(t){}}const T=t=>Array.isArray(t)&&"number"!=typeof t[0],O=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?w(t):t,w=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,S=t=>document.createElement("div").animate(t,{duration:.001}),M={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{S({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(S({opacity:[0,1]}).finished)},A={},j=Object.keys(M).reduce(((t,e)=>(t[e]=()=>(void 0===A[e]&&(A[e]=M[e]()),A[e]),t)),{}),P={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},k=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function D(t,e,n,i){if(t===e&&n===i)return r;const a=e=>function(t,e,n,i,a){let r,s,o=0;do{s=e+(n-e)/2,r=k(s,i,a)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:k(a(t),e,i)}var E=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},V=function(t,e,n){return-n*t+n*e+t},$=function(t,e){return void 0===e&&(e="end"),function(n){var i,a,r,s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i=0,a=1,r=o/t,Math.min(Math.max(r,i),a)}};const R={ease:D(.25,.1,.25,1),"ease-in":D(.42,0,1,1),"ease-in-out":D(.42,0,.58,1),"ease-out":D(0,0,.58,1)},U=/\((.*?)\)/;function F(t){if("function"==typeof t)return t;if(Array.isArray(t))return D(...t);if(R[t])return R[t];if(t.startsWith("steps")){const e=U.exec(t);if(e){const t=e[1].split(",");return $(parseFloat(t[0]),t[1].trim())}}return r}function W(t,e){return T(t)?t[(n=0,i=t.length,a=e,r=i-n,((a-n)%r+r)%r+n)]:t;var n,i,a,r}function q(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=E(0,e,i);t.push(V(n,1,a))}}function C(t){const e=[0];return q(e,t-1),e}function z(t,e=C(t.length),n=r){const i=t.length,a=i-e.length;return a>0&&q(e,a),a=>{let r=0;for(;r<i-2&&!(a<e[r+1]);r++);let s=(o=E(e[r],e[r+1],a),Math.min(1,Math.max(o,0)));var o;return s=W(n,r)(s),V(t[r],t[r+1],s)}}class K{constructor(t,e,{easing:n=P.easing,duration:i=P.duration,delay:a=P.delay,endDelay:r=P.endDelay,offset:s,repeat:o=P.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=i*(o+1),u=z(e,s,T(n)?n.map(F):F(n));this.tick=e=>{if("finished"===this.playState){const e=u(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-a,0);const s=n/i;let o=Math.floor(s),f=s%1;!f&&s>=1&&(f=1),1===f&&o--;const h=o%2;("reverse"===c||"alternate"===c&&h||"alternate-reverse"===c&&!h)&&(f=1-f);const p=n>=l?1:Math.min(f,1),m=u(p);t(m);n>=l+r?(this.playState="finished",this.resolve(m)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=b(t):this.startTime=performance.now()-b(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=(t,e)=>{let n=g(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=u.get(e);t&&(n=t.initialValue)}return n};const Y=t=>Array.isArray(t)?t:[t];function Z(t,e,i,r={}){let{duration:s=P.duration,delay:c=P.delay,endDelay:l=P.endDelay,repeat:h=P.repeat,easing:p=P.easing,direction:d,offset:w}=r;const S=n(t);let M=j.waapi(),A=a;const k=(t=>m.has(t))(e);c=Math.max(1e-5,c),k&&(o[e]&&(e=o[e]),((t,e)=>{const{activeTransforms:i}=n(t);var a,r;r=e,-1===(a=i).indexOf(r)&&a.push(r),t.style.transform=y(i)})(t,e),e=f(e));const D=u.get(e);let E=function(t,e,n){for(let i=0;i<t.length;i++)null===t[i]&&(t[i]=i?t[i-1]:X(e,n));return t}(Y(i),t,e);if(function(t,e){t.activeAnimations[e]&&(x(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(S,e),g(e)?(A=((t,e)=>n=>t.style.setProperty(e,n))(t,e),j.cssRegisterProperty()?function(t){if(!v.has(t)){v.add(t);try{const{syntax:e,initialValue:n}=u.has(t)?u.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(e):M=!1):A=((t,e)=>n=>t.style[e]=n)(t,e),M){D&&(E=E.map((t=>"number"==typeof t?D.toDefaultUnit(t):t))),j.partialKeyframes()||1!==E.length||E.unshift(X(t,e));const n={delay:b(c),duration:b(s),endDelay:b(l),easing:T(p)?void 0:O(p),direction:d,iterations:h+1},i=t.animate({[e]:E,offset:w,easing:T(p)?p.map(O):void 0},n);S.activeAnimations[e]=i,i.finished||(i.finished=new Promise(((t,e)=>{i.onfinish=t,i.oncancel=e})));const r=E[E.length-1];return i.finished.then((()=>A(r))).catch(a),i}if(k&&E.every(_)){if(1===E.length&&E.unshift(X(t,e)||(null==D?void 0:D.initialValue)||0),E=E.map((t=>"string"==typeof t?parseFloat(t):t)),D){const t=A;A=e=>t(D.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new K(t,e,n)}(A,E,r)}{const t=E[E.length-1];A(D&&"number"==typeof t?D.toDefaultUnit(t):t)}}const _=t=>"number"==typeof t,B=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;function I(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)}function G(t){const e={animations:t,finished:Promise.all(t.map((t=>t.finished)))};return new Proxy(e,H)}const H={get:(t,e)=>{var n,i;switch(e){case"finished":return t.finished;case"currentTime":const a=(null===(n=t.animations[0])||void 0===n?void 0:n[e])||0;return a?a/1e3:0;case"playbackRate":return null===(i=t.animations[0])||void 0===i?void 0:i[e];case"stop":return()=>t.animations.forEach(x);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n*=1e3;case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}};function J(t,e,n){return"function"==typeof t?t(e,n):t}function L(t,e,n,i){var a;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(a=i.get(e))&&void 0!==a?a:t}function N(t,e,n,a,r,s){!function(t,e,n){for(let a=0;a<t.length;a++){const r=t[a];r.at>e&&r.at<n&&(i(t,r),a--)}}(t,r,s);for(let i=0;i<e.length;i++)t.push({value:e[i],at:V(r,s,a[i]),easing:W(n,i)})}function Q(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function tt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function et(t,e){return e[t]||(e[t]=[]),e[t]}t.animate=function(t,e,n={}){const i=[],a=(t=I(t)).length;for(let r=0;r<a;r++){const s=t[r];for(const t in e){const o=B(n,t);o.delay=J(o.delay,r,a);const c=Z(s,t,e[t],o);c&&i.push(c)}}return G(i)},t.animateStyle=Z,t.stagger=function(t=.1,{start:e=0,from:n=0,easing:i}={}){return(a,r)=>{const s="number"==typeof n?n:function(t,e){if("first"===t)return 0;{const n=e-1;return"last"===t?n:n/2}}(n,r),o=Math.abs(s-a);let c=t*o;if(i){const t=r*a;c=F(i)(c/t)*t}return e+c}},t.timeline=function(t,e={}){const n=[],i=function(t,e={}){var{defaultOptions:n={}}=e,i=function(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 a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(n[i[a]]=t[i[a]])}return n}(e,["defaultOptions"]);const a=[],r=new Map,s={},o=new Map;let c=0,l=0,u=0;for(let e=0;e<t.length;e++){const[i,a,f={}]=t[e];void 0!==f.at&&(l=L(l,f.at,c,o));let h=0;const p=I(i,s),m=p.length;for(let t=0;t<m;t++){const e=tt(p[t],r);for(const i in a){const r=et(i,e),s=Y(a[i]),o=B(f,i),{duration:c=n.duration||P.duration,easing:p=n.easing||P.easing,offset:y=C(s.length)}=o,d=J(f.delay,t,m)||0,g=l+d,v=g+c;1===y.length&&0===y[0]&&(y[1]=1);const b=length-s.length;b>0&&q(y,b),1===s.length&&s.unshift(null),N(r,s,p,y,g,v),h=Math.max(d+c,h),u=Math.max(v,u)}}c=l,l+=h}return r.forEach(((t,e)=>{for(const r in t){const s=t[r];s.sort(Q);const o=[],c=[],l=[];for(let t=0;t<s.length;t++){const{at:e,value:n,easing:i}=s[t];o.push(n),c.push(E(0,u,e)),l.push(i||P.easing)}1!==c[c.length-1]&&(c.push(1),o.push(null)),a.push([e,r,o,Object.assign(Object.assign(Object.assign({},n),{duration:u,easing:l,offset:c}),i)])}})),a}(t,e);for(let t=0;t<i.length;t++){const e=Z(...i[t]);e&&n.push(e)}return G(n)},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -307,3 +307,5 @@ (function (global, factory) {

function getEasingForSegment(easing, i) {
return Array.isArray(easing) ? easing[wrap(0, easing.length, i)] : easing;
return isEasingList(easing)
? easing[wrap(0, easing.length, i)]
: easing;
}

@@ -499,2 +501,8 @@

/**
* This fixes a bug in WKWebView (used in iOS apps) where compositor values
* like opacity and transform won't start animating for a long time after the
* animation starts, even while other values like color do.
*/
delay = Math.max(0.00001, delay);
/**
* If this is an individual transform, we need to map its

@@ -719,3 +727,3 @@ * key to a CSS variable and update the element's transform style

function calcNextTime(current, next, labels) {
function calcNextTime(current, next, prev, labels) {
var _a;

@@ -726,4 +734,7 @@ if (typeof next === "number") {

else if (next.startsWith("-") || next.startsWith("+")) {
return current + parseFloat(next);
return Math.max(0, current + parseFloat(next));
}
else if (next === "<") {
return prev;
}
else {

@@ -784,2 +795,3 @@ return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current;

const timeLabels = new Map();
let prevTime = 0;
let currentTime = 0;

@@ -799,3 +811,3 @@ let totalDuration = 0;

if (options.at !== undefined) {
currentTime = calcNextTime(currentTime, options.at, timeLabels);
currentTime = calcNextTime(currentTime, options.at, prevTime, timeLabels);
}

@@ -846,2 +858,3 @@ /**

}
prevTime = currentTime;
currentTime += maxDuration;

@@ -848,0 +861,0 @@ }

@@ -1,1 +0,1 @@

const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{activeTransforms:[],activeAnimations:{}}),t.get(e)}const n=()=>{},i=t=>t,a=["","X","Y","Z"],r={x:"translateX",y:"translateY",z:"translateZ"},s={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:s,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:i},skew:s},c=new Map,l=t=>`--motion-${t}`,u=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{a.forEach((e=>{u.push(t+e),c.set(l(t+e),o[t])}))}));const h=(t,e)=>u.indexOf(t)-u.indexOf(e),f=new Set(u),m=t=>t.sort(h).reduce(y,"").trim(),y=(t,e)=>`${t} ${e}(var(${l(e)}))`,p=t=>t.startsWith("--"),d=new Set;const g=t=>1e3*t;function v(t){try{t.commitStyles(),t.cancel()}catch(t){}}const T=t=>Array.isArray(t)&&"number"!=typeof t[0],S=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?w(t):t,w=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,A=t=>document.createElement("div").animate(t,{duration:.001}),x={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{A({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(A({opacity:[0,1]}).finished)},b={},M=Object.keys(x).reduce(((t,e)=>(t[e]=()=>(void 0===b[e]&&(b[e]=x[e]()),b[e]),t)),{}),k={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},D=(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 i;const r=e=>function(t,e,n,i,a){let r,s,o=0;do{s=e+(n-e)/2,r=D(s,i,a)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:D(r(t),e,a)}var O=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},V=function(t,e,n){return-n*t+n*e+t},$=function(t,e){return void 0===e&&(e="end"),function(n){var i,a,r,s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i=0,a=1,r=o/t,Math.min(Math.max(r,i),a)}};const j={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)},E=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return P(...t);if(j[t])return j[t];if(t.startsWith("steps")){const e=E.exec(t);if(e){const t=e[1].split(",");return $(parseFloat(t[0]),t[1].trim())}}return i}function U(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=O(0,e,i);t.push(V(n,1,a))}}function q(t,e=function(t){const e=[0];return U(e,t-1),e}(t.length),n=i){const a=t.length,r=a-e.length;return r>0&&U(e,r),i=>{let r=0;for(;r<a-2&&!(i<e[r+1]);r++);let s=(o=O(e[r],e[r+1],i),Math.min(1,Math.max(o,0)));var o;return s=function(t,e){return Array.isArray(t)?t[(n=0,i=t.length,a=e,r=i-n,((a-n)%r+r)%r+n)]:t;var n,i,a,r}(n,r)(s),V(t[r],t[r+1],s)}}class C{constructor(t,e,{easing:n=k.easing,duration:i=k.duration,delay:a=k.delay,endDelay:r=k.endDelay,offset:s,repeat:o=k.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=i*(o+1),u=q(e,s,T(n)?n.map(R):R(n));this.tick=e=>{if("finished"===this.playState){const e=u(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-a,0);const s=n/i;let o=Math.floor(s),h=s%1;!h&&s>=1&&(h=1),1===h&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(h=1-h);const m=n>=l?1:Math.min(h,1),y=u(m);t(y);n>=l+r?(this.playState="finished",this.resolve(y)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=g(t):this.startTime=performance.now()-g(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const F=(t,e)=>{let n=p(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=c.get(e);t&&(n=t.initialValue)}return n};function z(t,i,a,s={}){let{duration:o=k.duration,delay:u=k.delay,endDelay:h=k.endDelay,repeat:y=k.repeat,easing:w=k.easing,direction:A,offset:x}=s;const b=e(t);let D=M.waapi(),P=n;const O=(t=>f.has(t))(i);O&&(r[i]&&(i=r[i]),((t,n)=>{const{activeTransforms:i}=e(t);var a,r;r=n,-1===(a=i).indexOf(r)&&a.push(r),t.style.transform=m(i)})(t,i),i=l(i));const V=c.get(i);let $=function(t,e,n){for(let i=0;i<t.length;i++)null===t[i]&&(t[i]=i?t[i-1]:F(e,n));return t}((t=>Array.isArray(t)?t:[t])(a),t,i);if(function(t,e){t.activeAnimations[e]&&(v(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(b,i),p(i)?(P=((t,e)=>n=>t.style.setProperty(e,n))(t,i),M.cssRegisterProperty()?function(t){if(!d.has(t)){d.add(t);try{const{syntax:e,initialValue:n}=c.has(t)?c.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(i):D=!1):P=((t,e)=>n=>t.style[e]=n)(t,i),D){V&&($=$.map((t=>"number"==typeof t?V.toDefaultUnit(t):t))),M.partialKeyframes()||1!==$.length||$.unshift(F(t,i));const e={delay:g(u),duration:g(o),endDelay:g(h),easing:T(w)?void 0:S(w),direction:A,iterations:y+1},a=t.animate({[i]:$,offset:x,easing:T(w)?w.map(S):void 0},e);b.activeAnimations[i]=a,a.finished||(a.finished=new Promise(((t,e)=>{a.onfinish=t,a.oncancel=e})));const r=$[$.length-1];return a.finished.then((()=>P(r))).catch(n),a}if(O&&$.every(W)){if(1===$.length&&$.unshift(F(t,i)||(null==V?void 0:V.initialValue)||0),$=$.map((t=>"string"==typeof t?parseFloat(t):t)),V){const t=P;P=e=>t(V.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new C(t,e,n)}(P,$,s)}{const t=$[$.length-1];P(V&&"number"==typeof t?V.toDefaultUnit(t):t)}}const W=t=>"number"==typeof t,K=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;const X={get:(t,e)=>{var n,i;switch(e){case"finished":return t.finished;case"currentTime":const a=(null===(n=t.animations[0])||void 0===n?void 0:n[e])||0;return a?a/1e3:0;case"playbackRate":return null===(i=t.animations[0])||void 0===i?void 0:i[e];case"stop":return()=>t.animations.forEach(v);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n*=1e3;case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}};function Y(t,e,n){return"function"==typeof t?t(e,n):t}function Z(t,e,n={}){const i=[],a=(t=function(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)}(t)).length;for(let r=0;r<a;r++){const s=t[r];for(const t in e){const o=K(n,t);o.delay=Y(o.delay,r,a);const c=z(s,t,e[t],o);c&&i.push(c)}}return function(t){const e={animations:t,finished:Promise.all(t.map((t=>t.finished)))};return new Proxy(e,X)}(i)}export{Z as animate};
const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{activeTransforms:[],activeAnimations:{}}),t.get(e)}const n=()=>{},i=t=>t,a=["","X","Y","Z"],r={x:"translateX",y:"translateY",z:"translateZ"},s={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:s,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:i},skew:s},c=new Map,l=t=>`--motion-${t}`,u=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{a.forEach((e=>{u.push(t+e),c.set(l(t+e),o[t])}))}));const h=(t,e)=>u.indexOf(t)-u.indexOf(e),f=new Set(u),m=t=>t.sort(h).reduce(y,"").trim(),y=(t,e)=>`${t} ${e}(var(${l(e)}))`,p=t=>t.startsWith("--"),d=new Set;const g=t=>1e3*t;function v(t){try{t.commitStyles(),t.cancel()}catch(t){}}const T=t=>Array.isArray(t)&&"number"!=typeof t[0],S=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?w(t):t,w=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,x=t=>document.createElement("div").animate(t,{duration:.001}),b={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{x({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(x({opacity:[0,1]}).finished)},A={},M=Object.keys(b).reduce(((t,e)=>(t[e]=()=>(void 0===A[e]&&(A[e]=b[e]()),A[e]),t)),{}),k={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},D=(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 i;const r=e=>function(t,e,n,i,a){let r,s,o=0;do{s=e+(n-e)/2,r=D(s,i,a)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,n);return t=>0===t||1===t?t:D(r(t),e,a)}var O=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},V=function(t,e,n){return-n*t+n*e+t},$=function(t,e){return void 0===e&&(e="end"),function(n){var i,a,r,s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i=0,a=1,r=o/t,Math.min(Math.max(r,i),a)}};const j={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)},E=/\((.*?)\)/;function R(t){if("function"==typeof t)return t;if(Array.isArray(t))return P(...t);if(j[t])return j[t];if(t.startsWith("steps")){const e=E.exec(t);if(e){const t=e[1].split(",");return $(parseFloat(t[0]),t[1].trim())}}return i}function U(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=O(0,e,i);t.push(V(n,1,a))}}function q(t,e=function(t){const e=[0];return U(e,t-1),e}(t.length),n=i){const a=t.length,r=a-e.length;return r>0&&U(e,r),i=>{let r=0;for(;r<a-2&&!(i<e[r+1]);r++);let s=(o=O(e[r],e[r+1],i),Math.min(1,Math.max(o,0)));var o;return s=function(t,e){return T(t)?t[(n=0,i=t.length,a=e,r=i-n,((a-n)%r+r)%r+n)]:t;var n,i,a,r}(n,r)(s),V(t[r],t[r+1],s)}}class C{constructor(t,e,{easing:n=k.easing,duration:i=k.duration,delay:a=k.delay,endDelay:r=k.endDelay,offset:s,repeat:o=k.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=i*(o+1),u=q(e,s,T(n)?n.map(R):R(n));this.tick=e=>{if("finished"===this.playState){const e=u(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-a,0);const s=n/i;let o=Math.floor(s),h=s%1;!h&&s>=1&&(h=1),1===h&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(h=1-h);const m=n>=l?1:Math.min(h,1),y=u(m);t(y);n>=l+r?(this.playState="finished",this.resolve(y)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=g(t):this.startTime=performance.now()-g(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const F=(t,e)=>{let n=p(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=c.get(e);t&&(n=t.initialValue)}return n};function z(t,i,a,s={}){let{duration:o=k.duration,delay:u=k.delay,endDelay:h=k.endDelay,repeat:y=k.repeat,easing:w=k.easing,direction:x,offset:b}=s;const A=e(t);let D=M.waapi(),P=n;const O=(t=>f.has(t))(i);u=Math.max(1e-5,u),O&&(r[i]&&(i=r[i]),((t,n)=>{const{activeTransforms:i}=e(t);var a,r;r=n,-1===(a=i).indexOf(r)&&a.push(r),t.style.transform=m(i)})(t,i),i=l(i));const V=c.get(i);let $=function(t,e,n){for(let i=0;i<t.length;i++)null===t[i]&&(t[i]=i?t[i-1]:F(e,n));return t}((t=>Array.isArray(t)?t:[t])(a),t,i);if(function(t,e){t.activeAnimations[e]&&(v(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(A,i),p(i)?(P=((t,e)=>n=>t.style.setProperty(e,n))(t,i),M.cssRegisterProperty()?function(t){if(!d.has(t)){d.add(t);try{const{syntax:e,initialValue:n}=c.has(t)?c.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(i):D=!1):P=((t,e)=>n=>t.style[e]=n)(t,i),D){V&&($=$.map((t=>"number"==typeof t?V.toDefaultUnit(t):t))),M.partialKeyframes()||1!==$.length||$.unshift(F(t,i));const e={delay:g(u),duration:g(o),endDelay:g(h),easing:T(w)?void 0:S(w),direction:x,iterations:y+1},a=t.animate({[i]:$,offset:b,easing:T(w)?w.map(S):void 0},e);A.activeAnimations[i]=a,a.finished||(a.finished=new Promise(((t,e)=>{a.onfinish=t,a.oncancel=e})));const r=$[$.length-1];return a.finished.then((()=>P(r))).catch(n),a}if(O&&$.every(W)){if(1===$.length&&$.unshift(F(t,i)||(null==V?void 0:V.initialValue)||0),$=$.map((t=>"string"==typeof t?parseFloat(t):t)),V){const t=P;P=e=>t(V.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new C(t,e,n)}(P,$,s)}{const t=$[$.length-1];P(V&&"number"==typeof t?V.toDefaultUnit(t):t)}}const W=t=>"number"==typeof t,K=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;const X={get:(t,e)=>{var n,i;switch(e){case"finished":return t.finished;case"currentTime":const a=(null===(n=t.animations[0])||void 0===n?void 0:n[e])||0;return a?a/1e3:0;case"playbackRate":return null===(i=t.animations[0])||void 0===i?void 0:i[e];case"stop":return()=>t.animations.forEach(v);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n*=1e3;case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}};function Y(t,e,n){return"function"==typeof t?t(e,n):t}function Z(t,e,n={}){const i=[],a=(t=function(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)}(t)).length;for(let r=0;r<a;r++){const s=t[r];for(const t in e){const o=K(n,t);o.delay=Y(o.delay,r,a);const c=z(s,t,e[t],o);c&&i.push(c)}}return function(t){const e={animations:t,finished:Promise.all(t.map((t=>t.finished)))};return new Proxy(e,X)}(i)}export{Z as animate};

@@ -1,1 +0,1 @@

const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{activeTransforms:[],activeAnimations:{}}),t.get(e)}const i=()=>{},n=t=>t,a=["","X","Y","Z"],r={x:"translateX",y:"translateY",z:"translateZ"},s={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:s,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:n},skew:s},c=new Map,l=t=>`--motion-${t}`,h=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{a.forEach((e=>{h.push(t+e),c.set(l(t+e),o[t])}))}));const u=(t,e)=>h.indexOf(t)-h.indexOf(e),f=new Set(h),y=t=>t.sort(u).reduce(p,"").trim(),p=(t,e)=>`${t} ${e}(var(${l(e)}))`,m=t=>t.startsWith("--"),d=new Set;const g=t=>1e3*t;const v=t=>Array.isArray(t)&&"number"!=typeof t[0],T=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?S(t):t,S=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,x=t=>document.createElement("div").animate(t,{duration:.001}),w={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{x({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(x({opacity:[0,1]}).finished)},A={},b=Object.keys(w).reduce(((t,e)=>(t[e]=()=>(void 0===A[e]&&(A[e]=w[e]()),A[e]),t)),{}),M={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},D=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function k(t,e,i,a){if(t===e&&i===a)return n;const r=e=>function(t,e,i,n,a){let r,s,o=0;do{s=e+(i-e)/2,r=D(s,n,a)-t,r>0?i=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,i);return t=>0===t||1===t?t:D(r(t),e,a)}var P=function(t,e,i){var n=e-t;return 0===n?1:(i-t)/n},O=function(t,e,i){return-i*t+i*e+t},V=function(t,e){return void 0===e&&(e="end"),function(i){var n,a,r,s=(i="end"===e?Math.min(i,.999):Math.max(i,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return n=0,a=1,r=o/t,Math.min(Math.max(r,n),a)}};const $={ease:k(.25,.1,.25,1),"ease-in":k(.42,0,1,1),"ease-in-out":k(.42,0,.58,1),"ease-out":k(0,0,.58,1)},U=/\((.*?)\)/;function j(t){if("function"==typeof t)return t;if(Array.isArray(t))return k(...t);if($[t])return $[t];if(t.startsWith("steps")){const e=U.exec(t);if(e){const t=e[1].split(",");return V(parseFloat(t[0]),t[1].trim())}}return n}function C(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const a=P(0,e,n);t.push(O(i,1,a))}}function E(t,e=function(t){const e=[0];return C(e,t-1),e}(t.length),i=n){const a=t.length,r=a-e.length;return r>0&&C(e,r),n=>{let r=0;for(;r<a-2&&!(n<e[r+1]);r++);let s=(o=P(e[r],e[r+1],n),Math.min(1,Math.max(o,0)));var o;return s=function(t,e){return Array.isArray(t)?t[(i=0,n=t.length,a=e,r=n-i,((a-i)%r+r)%r+i)]:t;var i,n,a,r}(i,r)(s),O(t[r],t[r+1],s)}}class F{constructor(t,e,{easing:i=M.easing,duration:n=M.duration,delay:a=M.delay,endDelay:r=M.endDelay,offset:s,repeat:o=M.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=n*(o+1),h=E(e,s,v(i)?i.map(j):j(i));this.tick=e=>{if("finished"===this.playState){const e=h(1);return t(e),void this.resolve(e)}let i=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=i,i/=1e3,i=Math.max(i-a,0);const s=i/n;let o=Math.floor(s),u=s%1;!u&&s>=1&&(u=1),1===u&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(u=1-u);const y=i>=l?1:Math.min(u,1),p=h(y);t(p);i>=l+r?(this.playState="finished",this.resolve(p)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=g(t):this.startTime=performance.now()-g(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const R=(t,e)=>{let i=m(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!i&&0!==i){const t=c.get(e);t&&(i=t.initialValue)}return i};function z(t,n,a,s={}){let{duration:o=M.duration,delay:h=M.delay,endDelay:u=M.endDelay,repeat:p=M.repeat,easing:S=M.easing,direction:x,offset:w}=s;const A=e(t);let D=b.waapi(),k=i;const P=(t=>f.has(t))(n);P&&(r[n]&&(n=r[n]),((t,i)=>{const{activeTransforms:n}=e(t);var a,r;r=i,-1===(a=n).indexOf(r)&&a.push(r),t.style.transform=y(n)})(t,n),n=l(n));const O=c.get(n);let V=function(t,e,i){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:R(e,i));return t}((t=>Array.isArray(t)?t:[t])(a),t,n);if(function(t,e){t.activeAnimations[e]&&(!function(t){try{t.commitStyles(),t.cancel()}catch(t){}}(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(A,n),m(n)?(k=((t,e)=>i=>t.style.setProperty(e,i))(t,n),b.cssRegisterProperty()?function(t){if(!d.has(t)){d.add(t);try{const{syntax:e,initialValue:i}=c.has(t)?c.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:i})}catch(t){}}}(n):D=!1):k=((t,e)=>i=>t.style[e]=i)(t,n),D){O&&(V=V.map((t=>"number"==typeof t?O.toDefaultUnit(t):t))),b.partialKeyframes()||1!==V.length||V.unshift(R(t,n));const e={delay:g(h),duration:g(o),endDelay:g(u),easing:v(S)?void 0:T(S),direction:x,iterations:p+1},a=t.animate({[n]:V,offset:w,easing:v(S)?S.map(T):void 0},e);A.activeAnimations[n]=a,a.finished||(a.finished=new Promise(((t,e)=>{a.onfinish=t,a.oncancel=e})));const r=V[V.length-1];return a.finished.then((()=>k(r))).catch(i),a}if(P&&V.every(W)){if(1===V.length&&V.unshift(R(t,n)||(null==O?void 0:O.initialValue)||0),V=V.map((t=>"string"==typeof t?parseFloat(t):t)),O){const t=k;k=e=>t(O.toDefaultUnit(e))}return function(t,e=[0,1],i={}){return new F(t,e,i)}(k,V,s)}{const t=V[V.length-1];k(O&&"number"==typeof t?O.toDefaultUnit(t):t)}}const W=t=>"number"==typeof t;export{z as animateStyle};
const t=new WeakMap;function e(e){return t.has(e)||t.set(e,{activeTransforms:[],activeAnimations:{}}),t.get(e)}const i=()=>{},n=t=>t,a=["","X","Y","Z"],r={x:"translateX",y:"translateY",z:"translateZ"},s={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},o={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:s,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:n},skew:s},c=new Map,l=t=>`--motion-${t}`,h=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{a.forEach((e=>{h.push(t+e),c.set(l(t+e),o[t])}))}));const u=(t,e)=>h.indexOf(t)-h.indexOf(e),f=new Set(h),m=t=>t.sort(u).reduce(p,"").trim(),p=(t,e)=>`${t} ${e}(var(${l(e)}))`,y=t=>t.startsWith("--"),d=new Set;const g=t=>1e3*t;const v=t=>Array.isArray(t)&&"number"!=typeof t[0],T=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?x(t):t,x=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,S=t=>document.createElement("div").animate(t,{duration:.001}),w={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{S({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(S({opacity:[0,1]}).finished)},A={},M=Object.keys(w).reduce(((t,e)=>(t[e]=()=>(void 0===A[e]&&(A[e]=w[e]()),A[e]),t)),{}),b={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},D=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function k(t,e,i,a){if(t===e&&i===a)return n;const r=e=>function(t,e,i,n,a){let r,s,o=0;do{s=e+(i-e)/2,r=D(s,n,a)-t,r>0?i=s:e=s}while(Math.abs(r)>1e-7&&++o<12);return s}(e,0,1,t,i);return t=>0===t||1===t?t:D(r(t),e,a)}var P=function(t,e,i){var n=e-t;return 0===n?1:(i-t)/n},O=function(t,e,i){return-i*t+i*e+t},V=function(t,e){return void 0===e&&(e="end"),function(i){var n,a,r,s=(i="end"===e?Math.min(i,.999):Math.max(i,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return n=0,a=1,r=o/t,Math.min(Math.max(r,n),a)}};const $={ease:k(.25,.1,.25,1),"ease-in":k(.42,0,1,1),"ease-in-out":k(.42,0,.58,1),"ease-out":k(0,0,.58,1)},U=/\((.*?)\)/;function j(t){if("function"==typeof t)return t;if(Array.isArray(t))return k(...t);if($[t])return $[t];if(t.startsWith("steps")){const e=U.exec(t);if(e){const t=e[1].split(",");return V(parseFloat(t[0]),t[1].trim())}}return n}function C(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const a=P(0,e,n);t.push(O(i,1,a))}}function E(t,e=function(t){const e=[0];return C(e,t-1),e}(t.length),i=n){const a=t.length,r=a-e.length;return r>0&&C(e,r),n=>{let r=0;for(;r<a-2&&!(n<e[r+1]);r++);let s=(o=P(e[r],e[r+1],n),Math.min(1,Math.max(o,0)));var o;return s=function(t,e){return v(t)?t[(i=0,n=t.length,a=e,r=n-i,((a-i)%r+r)%r+i)]:t;var i,n,a,r}(i,r)(s),O(t[r],t[r+1],s)}}class F{constructor(t,e,{easing:i=b.easing,duration:n=b.duration,delay:a=b.delay,endDelay:r=b.endDelay,offset:s,repeat:o=b.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=n*(o+1),h=E(e,s,v(i)?i.map(j):j(i));this.tick=e=>{if("finished"===this.playState){const e=h(1);return t(e),void this.resolve(e)}let i=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=i,i/=1e3,i=Math.max(i-a,0);const s=i/n;let o=Math.floor(s),u=s%1;!u&&s>=1&&(u=1),1===u&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(u=1-u);const m=i>=l?1:Math.min(u,1),p=h(m);t(p);i>=l+r?(this.playState="finished",this.resolve(p)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=g(t):this.startTime=performance.now()-g(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const R=(t,e)=>{let i=y(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!i&&0!==i){const t=c.get(e);t&&(i=t.initialValue)}return i};function z(t,n,a,s={}){let{duration:o=b.duration,delay:h=b.delay,endDelay:u=b.endDelay,repeat:p=b.repeat,easing:x=b.easing,direction:S,offset:w}=s;const A=e(t);let D=M.waapi(),k=i;const P=(t=>f.has(t))(n);h=Math.max(1e-5,h),P&&(r[n]&&(n=r[n]),((t,i)=>{const{activeTransforms:n}=e(t);var a,r;r=i,-1===(a=n).indexOf(r)&&a.push(r),t.style.transform=m(n)})(t,n),n=l(n));const O=c.get(n);let V=function(t,e,i){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:R(e,i));return t}((t=>Array.isArray(t)?t:[t])(a),t,n);if(function(t,e){t.activeAnimations[e]&&(!function(t){try{t.commitStyles(),t.cancel()}catch(t){}}(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(A,n),y(n)?(k=((t,e)=>i=>t.style.setProperty(e,i))(t,n),M.cssRegisterProperty()?function(t){if(!d.has(t)){d.add(t);try{const{syntax:e,initialValue:i}=c.has(t)?c.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:i})}catch(t){}}}(n):D=!1):k=((t,e)=>i=>t.style[e]=i)(t,n),D){O&&(V=V.map((t=>"number"==typeof t?O.toDefaultUnit(t):t))),M.partialKeyframes()||1!==V.length||V.unshift(R(t,n));const e={delay:g(h),duration:g(o),endDelay:g(u),easing:v(x)?void 0:T(x),direction:S,iterations:p+1},a=t.animate({[n]:V,offset:w,easing:v(x)?x.map(T):void 0},e);A.activeAnimations[n]=a,a.finished||(a.finished=new Promise(((t,e)=>{a.onfinish=t,a.oncancel=e})));const r=V[V.length-1];return a.finished.then((()=>k(r))).catch(i),a}if(P&&V.every(W)){if(1===V.length&&V.unshift(R(t,n)||(null==O?void 0:O.initialValue)||0),V=V.map((t=>"string"==typeof t?parseFloat(t):t)),O){const t=k;k=e=>t(O.toDefaultUnit(e))}return function(t,e=[0,1],i={}){return new F(t,e,i)}(k,V,s)}{const t=V[V.length-1];k(O&&"number"==typeof t?O.toDefaultUnit(t):t)}}const W=t=>"number"==typeof t;export{z as animateStyle};

@@ -1,1 +0,1 @@

import*as t from"react";import{useRef as e,useEffect as n,useState as r,createContext as i,useContext as s,forwardRef as o,createElement as a,useMemo as c}from"react";const l=new WeakMap;function u(t){return l.has(t)||l.set(t,{activeTransforms:[],activeAnimations:{}}),l.get(t)}const f=()=>{},p=t=>t,h=["","X","Y","Z"],y={x:"translateX",y:"translateY",z:"translateZ"},m={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},d={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:m,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:p},skew:m},v=new Map,g=t=>`--motion-${t}`,w=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{h.forEach((e=>{w.push(t+e),v.set(g(t+e),d[t])}))}));const b=(t,e)=>w.indexOf(t)-w.indexOf(e),O=new Set(w),x=t=>O.has(t),S=t=>t.sort(b).reduce(A,"").trim(),A=(t,e)=>`${t} ${e}(var(${g(e)}))`,P=t=>t.startsWith("--"),T=new Set;const j=t=>1e3*t;const V=t=>Array.isArray(t)&&"number"!=typeof t[0],M=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?D(t):t,D=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,E=t=>document.createElement("div").animate(t,{duration:.001}),k={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{E({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(E({opacity:[0,1]}).finished)},$={},C=Object.keys(k).reduce(((t,e)=>(t[e]=()=>(void 0===$[e]&&($[e]=k[e]()),$[e]),t)),{}),L={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},U=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function I(t,e,n,r){if(t===e&&n===r)return p;const i=e=>function(t,e,n,r,i){let s,o,a=0;do{o=e+(n-e)/2,s=U(o,r,i)-t,s>0?n=o:e=o}while(Math.abs(s)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:U(i(t),e,r)}var F=function(t,e,n){var r=e-t;return 0===r?1:(n-t)/r},R=function(t,e,n){return-n*t+n*e+t},z=function(t,e){return void 0===e&&(e="end"),function(n){var r,i,s,o=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,a="end"===e?Math.floor(o):Math.ceil(o);return r=0,i=1,s=a/t,Math.min(Math.max(s,r),i)}};const W={ease:I(.25,.1,.25,1),"ease-in":I(.42,0,1,1),"ease-in-out":I(.42,0,.58,1),"ease-out":I(0,0,.58,1)},q=/\((.*?)\)/;function B(t){if("function"==typeof t)return t;if(Array.isArray(t))return I(...t);if(W[t])return W[t];if(t.startsWith("steps")){const e=q.exec(t);if(e){const t=e[1].split(",");return z(parseFloat(t[0]),t[1].trim())}}return p}function K(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=F(0,e,r);t.push(R(n,1,i))}}function X(t,e=function(t){const e=[0];return K(e,t-1),e}(t.length),n=p){const r=t.length,i=r-e.length;return i>0&&K(e,i),i=>{let s=0;for(;s<r-2&&!(i<e[s+1]);s++);let o=(a=F(e[s],e[s+1],i),Math.min(1,Math.max(a,0)));var a;return o=function(t,e){return Array.isArray(t)?t[(n=0,r=t.length,i=e,s=r-n,((i-n)%s+s)%s+n)]:t;var n,r,i,s}(n,s)(o),R(t[s],t[s+1],o)}}class Y{constructor(t,e,{easing:n=L.easing,duration:r=L.duration,delay:i=L.delay,endDelay:s=L.endDelay,offset:o,repeat:a=L.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=r*(a+1),u=X(e,o,V(n)?n.map(B):B(n));this.tick=e=>{if("finished"===this.playState){const e=u(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0);const o=n/r;let a=Math.floor(o),f=o%1;!f&&o>=1&&(f=1),1===f&&a--;const p=a%2;("reverse"===c||"alternate"===c&&p||"alternate-reverse"===c&&!p)&&(f=1-f);const h=n>=l?1:Math.min(f,1),y=u(h);t(y);n>=l+s?(this.playState="finished",this.resolve(y)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=j(t):this.startTime=performance.now()-j(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const Z=(t,e)=>{let n=P(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=v.get(e);t&&(n=t.initialValue)}return n};function G(t,e,n,r={}){let{duration:i=L.duration,delay:s=L.delay,endDelay:o=L.endDelay,repeat:a=L.repeat,easing:c=L.easing,direction:l,offset:p}=r;const h=u(t);let m=C.waapi(),d=f;const w=x(e);w&&(y[e]&&(e=y[e]),((t,e)=>{const{activeTransforms:n}=u(t);var r,i;i=e,-1===(r=n).indexOf(i)&&r.push(i),t.style.transform=S(n)})(t,e),e=g(e));const b=v.get(e);let O=function(t,e,n){for(let r=0;r<t.length;r++)null===t[r]&&(t[r]=r?t[r-1]:Z(e,n));return t}((t=>Array.isArray(t)?t:[t])(n),t,e);if(function(t,e){t.activeAnimations[e]&&(!function(t){try{t.commitStyles(),t.cancel()}catch(t){}}(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(h,e),P(e)?(d=((t,e)=>n=>t.style.setProperty(e,n))(t,e),C.cssRegisterProperty()?function(t){if(!T.has(t)){T.add(t);try{const{syntax:e,initialValue:n}=v.has(t)?v.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(e):m=!1):d=((t,e)=>n=>t.style[e]=n)(t,e),m){b&&(O=O.map((t=>"number"==typeof t?b.toDefaultUnit(t):t))),C.partialKeyframes()||1!==O.length||O.unshift(Z(t,e));const n={delay:j(s),duration:j(i),endDelay:j(o),easing:V(c)?void 0:M(c),direction:l,iterations:a+1},r=t.animate({[e]:O,offset:p,easing:V(c)?c.map(M):void 0},n);h.activeAnimations[e]=r,r.finished||(r.finished=new Promise(((t,e)=>{r.onfinish=t,r.oncancel=e})));const u=O[O.length-1];return r.finished.then((()=>d(u))).catch(f),r}if(w&&O.every(H)){if(1===O.length&&O.unshift(Z(t,e)||(null==b?void 0:b.initialValue)||0),O=O.map((t=>"string"==typeof t?parseFloat(t):t)),b){const t=d;d=e=>t(b.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new Y(t,e,n)}(d,O,r)}{const t=O[O.length-1];d(b&&"number"==typeof t?b.toDefaultUnit(t):t)}}const H=t=>"number"==typeof t;const J=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;function N(t,r,i,s,o,a){const c=e(r);n((()=>{const e={};if(new Set([...Object.keys(i),...Object.keys(c.current)]).forEach((t=>{let n=i[t];var r,s;(r=n,s=c.current[t],typeof r==typeof s&&(Array.isArray(r)&&Array.isArray(s)?function(t,e){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(r,s):r===s))||(e[t]=n)})),Object.keys(e).length&&t.current){null==o||o(e);const n=[];for(const r in e){const i=G(t.current,r,e[r],J(s,r));i&&n.push(i)}Promise.all(n.map((t=>t.finished))).then((()=>null==a?void 0:a(e))).catch(f)}c.current=i}))}function Q(t,e,n={}){return t?"string"==typeof t?n[t]:t:e?n[e]:void 0}function _(t,e,n){if(n)for(const r in n)"options"!==r&&(t[r]=n[r],n.options&&(e[r]=J(n.options,r)))}function tt(t,e,n,i,s){const[o,a]=r(!1);return(o||i)&&_(t,e,Q(n,i,s)),[o||Boolean(i),a]}var et=i(null);var nt=0,rt=function(){return nt++},it=function(){return t=rt,null===(n=e(null)).current&&(n.current=t()),n.current;var t,n};function st(t,e,{exit:r,poses:i},{exit:o}){const[a,c]=function(){var t=s(et);if(null===t)return[!0,null];var e=t.isPresent,r=t.onExitComplete,i=t.register,o=it();return n((function(){return i(o)}),[]),!e&&r?[!1,function(){return null==r?void 0:r(o)}]:[!0]}();if(n((()=>{r||null==c||c()}),[a]),r&&!a)return _(t,e,Q(r,o,i)),c}const ot=i({});function at(r){return o((function(i,o){const l=e(null),{options:u,style:f,initial:p,hover:h,press:m,exit:d,inViewport:w,viewport:b,poses:O,onStart:A,onComplete:P,onViewportEnter:T,onViewportLeave:j,inherit:V=!0}=i,M=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["options","style","initial","hover","press","exit","inViewport","viewport","poses","onStart","onComplete","onViewportEnter","onViewportLeave","inherit"]),D={initial:!0,style:!0};let E=s(ot);V||(E={});const k=Q(f,E.style,O),$=Q(p,E.initial,O),C=Object.assign(Object.assign({},k),$),L=Object.assign(Object.assign({},$),k),U=Object.assign(Object.assign({},u),null==k?void 0:k.options),I=e(null);I.current||(I.current=function(t){const e={},n=[];for(let r in t){const i=t[r];x(r)&&(y[r]&&(r=y[r]),n.push(r),r=g(r));let s=Array.isArray(i)?i[0]:i;const o=v.get(r);o&&(s="number"==typeof i?o.toDefaultUnit(i):i),e[r]=s}return n.length&&(e.transform=S(n)),e}(C));const F=function(t,e,{hover:n,onPointerEnter:r,onPointerLeave:i,poses:s}={},{hover:o},a){const[c,l]=tt(t,e,n,o,s);return a.hover=c,n?{onPointerEnter:t=>{null==r||r(t),l(!0)},onPointerLeave:t=>{null==i||i(t),l(!1)}}:{}}(L,U,i,E,D),R=function(t,e,{press:n,onPointerDown:r,poses:i}={},{press:s},o){const[a,c]=tt(t,e,n,s,i);if(o.press=a,!n)return{};const l=()=>{c(!1),window.removeEventListener("pointerup",l)};return{onPointerDown:t=>{null==r||r(t),c(!0),window.addEventListener("pointerup",l)}}}(L,U,i,E,D);!function(t,e,r,{inViewport:i,poses:s,viewport:o={},onViewportEnter:a,onViewportLeave:c},{inViewport:l},u){const{root:f,margin:p,once:h,threshold:y}=o,[m,d]=tt(e,r,i,l,s);u.inViewport=m;let v=!!i||!!a||!!c;h&&m&&(v=!1),n((()=>{if(!v||"undefined"==typeof IntersectionObserver)return;const e=new IntersectionObserver((([t])=>{d(t.isIntersecting);const e=t.isIntersecting?a:c;e&&e(t)}),{root:null==f?void 0:f.current,rootMargin:p,threshold:y});return e.observe(t.current),()=>e.disconnect()}),[i,a,c,f,p,y])}(l,L,U,i,E,D);const z=st(L,U,i,E);N(l,C,L,U,A,(t=>{P&&P(t),z&&z()}));const W=a(r,Object.assign({},M,F,R,{style:I.current,ref:l})),q=ct.reduce(((t,e)=>(t[e]=void 0,i[e]?"string"==typeof i[e]&&D[e]&&(t[e]=i[e]):E[e]&&(t[e]=E[e]),t)),{}),B=c((()=>q),Object.values(q));return t.createElement(ot.Provider,{value:B},W)}))}const ct=["initial","style","hover","press","inViewport","exit"],lt=new Map,ut=new Proxy({},{get:(t,e)=>(lt.has(e)||lt.set(e,at(e)),lt.get(e))});export{ut as animated};
import*as t from"react";import{useRef as e,useEffect as n,useState as r,createContext as i,useContext as s,forwardRef as o,createElement as a,useMemo as c}from"react";const l=new WeakMap;function u(t){return l.has(t)||l.set(t,{activeTransforms:[],activeAnimations:{}}),l.get(t)}const f=()=>{},p=t=>t,h=["","X","Y","Z"],y={x:"translateX",y:"translateY",z:"translateZ"},m={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},d={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:m,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:p},skew:m},v=new Map,g=t=>`--motion-${t}`,w=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{h.forEach((e=>{w.push(t+e),v.set(g(t+e),d[t])}))}));const b=(t,e)=>w.indexOf(t)-w.indexOf(e),O=new Set(w),x=t=>O.has(t),S=t=>t.sort(b).reduce(P,"").trim(),P=(t,e)=>`${t} ${e}(var(${g(e)}))`,T=t=>t.startsWith("--"),j=new Set;const A=t=>1e3*t;const V=t=>Array.isArray(t)&&"number"!=typeof t[0],M=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?D(t):t,D=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,E=t=>document.createElement("div").animate(t,{duration:.001}),k={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{E({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(E({opacity:[0,1]}).finished)},$={},C=Object.keys(k).reduce(((t,e)=>(t[e]=()=>(void 0===$[e]&&($[e]=k[e]()),$[e]),t)),{}),L={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},U=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function I(t,e,n,r){if(t===e&&n===r)return p;const i=e=>function(t,e,n,r,i){let s,o,a=0;do{o=e+(n-e)/2,s=U(o,r,i)-t,s>0?n=o:e=o}while(Math.abs(s)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:U(i(t),e,r)}var F=function(t,e,n){var r=e-t;return 0===r?1:(n-t)/r},R=function(t,e,n){return-n*t+n*e+t},z=function(t,e){return void 0===e&&(e="end"),function(n){var r,i,s,o=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,a="end"===e?Math.floor(o):Math.ceil(o);return r=0,i=1,s=a/t,Math.min(Math.max(s,r),i)}};const W={ease:I(.25,.1,.25,1),"ease-in":I(.42,0,1,1),"ease-in-out":I(.42,0,.58,1),"ease-out":I(0,0,.58,1)},q=/\((.*?)\)/;function B(t){if("function"==typeof t)return t;if(Array.isArray(t))return I(...t);if(W[t])return W[t];if(t.startsWith("steps")){const e=q.exec(t);if(e){const t=e[1].split(",");return z(parseFloat(t[0]),t[1].trim())}}return p}function K(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=F(0,e,r);t.push(R(n,1,i))}}function X(t,e=function(t){const e=[0];return K(e,t-1),e}(t.length),n=p){const r=t.length,i=r-e.length;return i>0&&K(e,i),i=>{let s=0;for(;s<r-2&&!(i<e[s+1]);s++);let o=(a=F(e[s],e[s+1],i),Math.min(1,Math.max(a,0)));var a;return o=function(t,e){return V(t)?t[(n=0,r=t.length,i=e,s=r-n,((i-n)%s+s)%s+n)]:t;var n,r,i,s}(n,s)(o),R(t[s],t[s+1],o)}}class Y{constructor(t,e,{easing:n=L.easing,duration:r=L.duration,delay:i=L.delay,endDelay:s=L.endDelay,offset:o,repeat:a=L.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const l=r*(a+1),u=X(e,o,V(n)?n.map(B):B(n));this.tick=e=>{if("finished"===this.playState){const e=u(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0);const o=n/r;let a=Math.floor(o),f=o%1;!f&&o>=1&&(f=1),1===f&&a--;const p=a%2;("reverse"===c||"alternate"===c&&p||"alternate-reverse"===c&&!p)&&(f=1-f);const h=n>=l?1:Math.min(f,1),y=u(h);t(y);n>=l+s?(this.playState="finished",this.resolve(y)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=A(t):this.startTime=performance.now()-A(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const Z=(t,e)=>{let n=T(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=v.get(e);t&&(n=t.initialValue)}return n};function G(t,e,n,r={}){let{duration:i=L.duration,delay:s=L.delay,endDelay:o=L.endDelay,repeat:a=L.repeat,easing:c=L.easing,direction:l,offset:p}=r;const h=u(t);let m=C.waapi(),d=f;const w=x(e);s=Math.max(1e-5,s),w&&(y[e]&&(e=y[e]),((t,e)=>{const{activeTransforms:n}=u(t);var r,i;i=e,-1===(r=n).indexOf(i)&&r.push(i),t.style.transform=S(n)})(t,e),e=g(e));const b=v.get(e);let O=function(t,e,n){for(let r=0;r<t.length;r++)null===t[r]&&(t[r]=r?t[r-1]:Z(e,n));return t}((t=>Array.isArray(t)?t:[t])(n),t,e);if(function(t,e){t.activeAnimations[e]&&(!function(t){try{t.commitStyles(),t.cancel()}catch(t){}}(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(h,e),T(e)?(d=((t,e)=>n=>t.style.setProperty(e,n))(t,e),C.cssRegisterProperty()?function(t){if(!j.has(t)){j.add(t);try{const{syntax:e,initialValue:n}=v.has(t)?v.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(e):m=!1):d=((t,e)=>n=>t.style[e]=n)(t,e),m){b&&(O=O.map((t=>"number"==typeof t?b.toDefaultUnit(t):t))),C.partialKeyframes()||1!==O.length||O.unshift(Z(t,e));const n={delay:A(s),duration:A(i),endDelay:A(o),easing:V(c)?void 0:M(c),direction:l,iterations:a+1},r=t.animate({[e]:O,offset:p,easing:V(c)?c.map(M):void 0},n);h.activeAnimations[e]=r,r.finished||(r.finished=new Promise(((t,e)=>{r.onfinish=t,r.oncancel=e})));const u=O[O.length-1];return r.finished.then((()=>d(u))).catch(f),r}if(w&&O.every(H)){if(1===O.length&&O.unshift(Z(t,e)||(null==b?void 0:b.initialValue)||0),O=O.map((t=>"string"==typeof t?parseFloat(t):t)),b){const t=d;d=e=>t(b.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new Y(t,e,n)}(d,O,r)}{const t=O[O.length-1];d(b&&"number"==typeof t?b.toDefaultUnit(t):t)}}const H=t=>"number"==typeof t;const J=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;function N(t,r,i,s,o,a){const c=e(r);n((()=>{const e={};if(new Set([...Object.keys(i),...Object.keys(c.current)]).forEach((t=>{let n=i[t];var r,s;(r=n,s=c.current[t],typeof r==typeof s&&(Array.isArray(r)&&Array.isArray(s)?function(t,e){const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}(r,s):r===s))||(e[t]=n)})),Object.keys(e).length&&t.current){null==o||o(e);const n=[];for(const r in e){const i=G(t.current,r,e[r],J(s,r));i&&n.push(i)}Promise.all(n.map((t=>t.finished))).then((()=>null==a?void 0:a(e))).catch(f)}c.current=i}))}function Q(t,e,n={}){return t?"string"==typeof t?n[t]:t:e?n[e]:void 0}function _(t,e,n){if(n)for(const r in n)"options"!==r&&(t[r]=n[r],n.options&&(e[r]=J(n.options,r)))}function tt(t,e,n,i,s){const[o,a]=r(!1);return(o||i)&&_(t,e,Q(n,i,s)),[o||Boolean(i),a]}var et=i(null);var nt=0,rt=function(){return nt++},it=function(){return t=rt,null===(n=e(null)).current&&(n.current=t()),n.current;var t,n};function st(t,e,{exit:r,poses:i},{exit:o}){const[a,c]=function(){var t=s(et);if(null===t)return[!0,null];var e=t.isPresent,r=t.onExitComplete,i=t.register,o=it();return n((function(){return i(o)}),[]),!e&&r?[!1,function(){return null==r?void 0:r(o)}]:[!0]}();if(n((()=>{r||null==c||c()}),[a]),r&&!a)return _(t,e,Q(r,o,i)),c}const ot=i({});function at(r){return o((function(i,o){const l=e(null),{options:u,style:f,initial:p,hover:h,press:m,exit:d,inViewport:w,viewport:b,poses:O,onStart:P,onComplete:T,onViewportEnter:j,onViewportLeave:A,inherit:V=!0}=i,M=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}(i,["options","style","initial","hover","press","exit","inViewport","viewport","poses","onStart","onComplete","onViewportEnter","onViewportLeave","inherit"]),D={initial:!0,style:!0};let E=s(ot);V||(E={});const k=Q(f,E.style,O),$=Q(p,E.initial,O),C=Object.assign(Object.assign({},k),$),L=Object.assign(Object.assign({},$),k),U=Object.assign(Object.assign({},u),null==k?void 0:k.options),I=e(null);I.current||(I.current=function(t){const e={},n=[];for(let r in t){const i=t[r];x(r)&&(y[r]&&(r=y[r]),n.push(r),r=g(r));let s=Array.isArray(i)?i[0]:i;const o=v.get(r);o&&(s="number"==typeof i?o.toDefaultUnit(i):i),e[r]=s}return n.length&&(e.transform=S(n)),e}(C));const F=function(t,e,{hover:n,onPointerEnter:r,onPointerLeave:i,poses:s}={},{hover:o},a){const[c,l]=tt(t,e,n,o,s);return a.hover=c,n?{onPointerEnter:t=>{null==r||r(t),l(!0)},onPointerLeave:t=>{null==i||i(t),l(!1)}}:{}}(L,U,i,E,D),R=function(t,e,{press:n,onPointerDown:r,poses:i}={},{press:s},o){const[a,c]=tt(t,e,n,s,i);if(o.press=a,!n)return{};const l=()=>{c(!1),window.removeEventListener("pointerup",l)};return{onPointerDown:t=>{null==r||r(t),c(!0),window.addEventListener("pointerup",l)}}}(L,U,i,E,D);!function(t,e,r,{inViewport:i,poses:s,viewport:o={},onViewportEnter:a,onViewportLeave:c},{inViewport:l},u){const{root:f,margin:p,once:h,threshold:y}=o,[m,d]=tt(e,r,i,l,s);u.inViewport=m;let v=!!i||!!a||!!c;h&&m&&(v=!1),n((()=>{if(!v||"undefined"==typeof IntersectionObserver)return;const e=new IntersectionObserver((([t])=>{d(t.isIntersecting);const e=t.isIntersecting?a:c;e&&e(t)}),{root:null==f?void 0:f.current,rootMargin:p,threshold:y});return e.observe(t.current),()=>e.disconnect()}),[i,a,c,f,p,y])}(l,L,U,i,E,D);const z=st(L,U,i,E);N(l,C,L,U,P,(t=>{T&&T(t),z&&z()}));const W=a(r,Object.assign({},M,F,R,{style:I.current,ref:l})),q=ct.reduce(((t,e)=>(t[e]=void 0,i[e]?"string"==typeof i[e]&&D[e]&&(t[e]=i[e]):E[e]&&(t[e]=E[e]),t)),{}),B=c((()=>q),Object.values(q));return t.createElement(ot.Provider,{value:B},W)}))}const ct=["initial","style","hover","press","inViewport","exit"],lt=new Map,ut=new Proxy({},{get:(t,e)=>(lt.has(e)||lt.set(e,at(e)),lt.get(e))});export{ut as animated};

@@ -1,1 +0,1 @@

var t=function(t,e,n){var i=e-t;return 0===i?1:(n-t)/i},e=function(t,e,n){return-n*t+n*e+t},n=function(t,e){return void 0===e&&(e="end"),function(n){var i,a,r,s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return i=0,a=1,r=o/t,Math.min(Math.max(r,i),a)}};const i=()=>{},a=t=>t,r=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function s(t,e,n,i){if(t===e&&n===i)return a;const s=e=>function(t,e,n,i,a){let s,o,c=0;do{o=e+(n-e)/2,s=r(o,i,a)-t,s>0?n=o:e=o}while(Math.abs(s)>1e-7&&++c<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:r(s(t),e,i)}const o={ease:s(.25,.1,.25,1),"ease-in":s(.42,0,1,1),"ease-in-out":s(.42,0,.58,1),"ease-out":s(0,0,.58,1)},c=/\((.*?)\)/;function l(t){if("function"==typeof t)return t;if(Array.isArray(t))return s(...t);if(o[t])return o[t];if(t.startsWith("steps")){const e=c.exec(t);if(e){const t=e[1].split(",");return n(parseFloat(t[0]),t[1].trim())}}return a}function u(t,e,n){return"function"==typeof t?t(e,n):t}function h(n,i){const a=n[n.length-1];for(let r=1;r<=i;r++){const s=t(0,i,r);n.push(e(a,1,s))}}function f(t){const e=[0];return h(e,t-1),e}const p=new WeakMap;function m(t){return p.has(t)||p.set(t,{activeTransforms:[],activeAnimations:{}}),p.get(t)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const d=["","X","Y","Z"],g={x:"translateX",y:"translateY",z:"translateZ"},v={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},b={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:v,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:a},skew:v},T=new Map,w=t=>`--motion-${t}`,O=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{d.forEach((e=>{O.push(t+e),T.set(w(t+e),b[t])}))}));const x=(t,e)=>O.indexOf(t)-O.indexOf(e),S=new Set(O),A=t=>t.sort(x).reduce(M,"").trim(),M=(t,e)=>`${t} ${e}(var(${w(e)}))`,P=t=>t.startsWith("--"),j=new Set;const k=t=>1e3*t;function D(t){try{t.commitStyles(),t.cancel()}catch(t){}}const E=t=>Array.isArray(t)&&"number"!=typeof t[0],V=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?$(t):t,$=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,R=t=>document.createElement("div").animate(t,{duration:.001}),U={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{R({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(R({opacity:[0,1]}).finished)},F={},W=Object.keys(U).reduce(((t,e)=>(t[e]=()=>(void 0===F[e]&&(F[e]=U[e]()),F[e]),t)),{}),q={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"};function C(t,e){return Array.isArray(t)?t[(n=0,i=t.length,a=e,r=i-n,((a-n)%r+r)%r+n)]:t;var n,i,a,r}function z(n,i=f(n.length),r=a){const s=n.length,o=s-i.length;return o>0&&h(i,o),a=>{let o=0;for(;o<s-2&&!(a<i[o+1]);o++);let c=(l=t(i[o],i[o+1],a),Math.min(1,Math.max(l,0)));var l;return c=C(r,o)(c),e(n[o],n[o+1],c)}}class K{constructor(t,e,{easing:n=q.easing,duration:i=q.duration,delay:a=q.delay,endDelay:r=q.endDelay,offset:s,repeat:o=q.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const u=i*(o+1),h=z(e,s,E(n)?n.map(l):l(n));this.tick=e=>{if("finished"===this.playState){const e=h(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-a,0);const s=n/i;let o=Math.floor(s),l=s%1;!l&&s>=1&&(l=1),1===l&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(l=1-l);const p=n>=u?1:Math.min(l,1),m=h(p);t(m);n>=u+r?(this.playState="finished",this.resolve(m)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=k(t):this.startTime=performance.now()-k(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=(t,e)=>{let n=P(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=T.get(e);t&&(n=t.initialValue)}return n};const Y=t=>Array.isArray(t)?t:[t];function Z(t,e,n,a={}){let{duration:r=q.duration,delay:s=q.delay,endDelay:o=q.endDelay,repeat:c=q.repeat,easing:l=q.easing,direction:u,offset:h}=a;const f=m(t);let p=W.waapi(),y=i;const d=(t=>S.has(t))(e);d&&(g[e]&&(e=g[e]),((t,e)=>{const{activeTransforms:n}=m(t);var i,a;a=e,-1===(i=n).indexOf(a)&&i.push(a),t.style.transform=A(n)})(t,e),e=w(e));const v=T.get(e);let b=function(t,e,n){for(let i=0;i<t.length;i++)null===t[i]&&(t[i]=i?t[i-1]:X(e,n));return t}(Y(n),t,e);if(function(t,e){t.activeAnimations[e]&&(D(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(f,e),P(e)?(y=((t,e)=>n=>t.style.setProperty(e,n))(t,e),W.cssRegisterProperty()?function(t){if(!j.has(t)){j.add(t);try{const{syntax:e,initialValue:n}=T.has(t)?T.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(e):p=!1):y=((t,e)=>n=>t.style[e]=n)(t,e),p){v&&(b=b.map((t=>"number"==typeof t?v.toDefaultUnit(t):t))),W.partialKeyframes()||1!==b.length||b.unshift(X(t,e));const n={delay:k(s),duration:k(r),endDelay:k(o),easing:E(l)?void 0:V(l),direction:u,iterations:c+1},a=t.animate({[e]:b,offset:h,easing:E(l)?l.map(V):void 0},n);f.activeAnimations[e]=a,a.finished||(a.finished=new Promise(((t,e)=>{a.onfinish=t,a.oncancel=e})));const p=b[b.length-1];return a.finished.then((()=>y(p))).catch(i),a}if(d&&b.every(B)){if(1===b.length&&b.unshift(X(t,e)||(null==v?void 0:v.initialValue)||0),b=b.map((t=>"string"==typeof t?parseFloat(t):t)),v){const t=y;y=e=>t(v.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new K(t,e,n)}(y,b,a)}{const t=b[b.length-1];y(v&&"number"==typeof t?v.toDefaultUnit(t):t)}}const B=t=>"number"==typeof t;const I={get:(t,e)=>{var n,i;switch(e){case"finished":return t.finished;case"currentTime":const a=(null===(n=t.animations[0])||void 0===n?void 0:n[e])||0;return a?a/1e3:0;case"playbackRate":return null===(i=t.animations[0])||void 0===i?void 0:i[e];case"stop":return()=>t.animations.forEach(D);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n*=1e3;case"currentTime":case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=n;return!0}return!1}},G=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;function H(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)}function J(t,e,n){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?t+parseFloat(e):null!==(i=n.get(e))&&void 0!==i?i:t}function L(t,n,i,a,r,s){!function(t,e,n){for(let i=0;i<t.length;i++){const a=t[i];a.at>e&&a.at<n&&(y(t,a),i--)}}(t,r,s);for(let o=0;o<n.length;o++)t.push({value:n[o],at:e(r,s,a[o]),easing:C(i,o)})}function N(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function Q(t,e={}){const n=[],i=_(t,e);for(let t=0;t<i.length;t++){const e=Z(...i[t]);e&&n.push(e)}return function(t){const e={animations:t,finished:Promise.all(t.map((t=>t.finished)))};return new Proxy(e,I)}(n)}function _(e,n={}){var{defaultOptions:i={}}=n,a=function(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 a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(n[i[a]]=t[i[a]])}return n}(n,["defaultOptions"]);const r=[],s=new Map,o={},c=new Map;let l=0,p=0;for(let t=0;t<e.length;t++){const[n,a,r={}]=e[t];void 0!==r.at&&(l=J(l,r.at,c));let m=0;const y=H(n,o),d=y.length;for(let t=0;t<d;t++){const e=tt(y[t],s);for(const n in a){const s=et(n,e),o=Y(a[n]),c=G(r,n),{duration:y=i.duration||q.duration,easing:g=i.easing||q.easing,offset:v=f(o.length)}=c,b=u(r.delay,t,d)||0,T=l+b,w=T+y;1===v.length&&0===v[0]&&(v[1]=1);const O=length-o.length;O>0&&h(v,O),1===o.length&&o.unshift(null),L(s,o,g,v,T,w),m=Math.max(b+y,m),p=Math.max(w,p)}}l+=m}return s.forEach(((e,n)=>{for(const s in e){const o=e[s];o.sort(N);const c=[],l=[],u=[];for(let e=0;e<o.length;e++){const{at:n,value:i,easing:a}=o[e];c.push(i),l.push(t(0,p,n)),u.push(a||q.easing)}1!==l[l.length-1]&&(l.push(1),c.push(null)),r.push([n,s,c,Object.assign(Object.assign(Object.assign({},i),{duration:p,easing:u,offset:l}),a)])}})),r}function tt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function et(t,e){return e[t]||(e[t]=[]),e[t]}export{_ as createAnimationsFromTimeline,Q as timeline};
var t=function(t,e,n){var a=e-t;return 0===a?1:(n-t)/a},e=function(t,e,n){return-n*t+n*e+t},n=function(t,e){return void 0===e&&(e="end"),function(n){var a,i,r,s=(n="end"===e?Math.min(n,.999):Math.max(n,.001))*t,o="end"===e?Math.floor(s):Math.ceil(s);return a=0,i=1,r=o/t,Math.min(Math.max(r,a),i)}};const a=()=>{},i=t=>t,r=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function s(t,e,n,a){if(t===e&&n===a)return i;const s=e=>function(t,e,n,a,i){let s,o,c=0;do{o=e+(n-e)/2,s=r(o,a,i)-t,s>0?n=o:e=o}while(Math.abs(s)>1e-7&&++c<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:r(s(t),e,a)}const o={ease:s(.25,.1,.25,1),"ease-in":s(.42,0,1,1),"ease-in-out":s(.42,0,.58,1),"ease-out":s(0,0,.58,1)},c=/\((.*?)\)/;function l(t){if("function"==typeof t)return t;if(Array.isArray(t))return s(...t);if(o[t])return o[t];if(t.startsWith("steps")){const e=c.exec(t);if(e){const t=e[1].split(",");return n(parseFloat(t[0]),t[1].trim())}}return i}function u(t,e,n){return"function"==typeof t?t(e,n):t}function h(n,a){const i=n[n.length-1];for(let r=1;r<=a;r++){const s=t(0,a,r);n.push(e(i,1,s))}}function f(t){const e=[0];return h(e,t-1),e}const p=new WeakMap;function m(t){return p.has(t)||p.set(t,{activeTransforms:[],activeAnimations:{}}),p.get(t)}function y(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const d=["","X","Y","Z"],g={x:"translateX",y:"translateY",z:"translateZ"},v={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},b={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:v,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:i},skew:v},x=new Map,T=t=>`--motion-${t}`,w=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{d.forEach((e=>{w.push(t+e),x.set(T(t+e),b[t])}))}));const O=(t,e)=>w.indexOf(t)-w.indexOf(e),S=new Set(w),M=t=>t.sort(O).reduce(A,"").trim(),A=(t,e)=>`${t} ${e}(var(${T(e)}))`,P=t=>t.startsWith("--"),j=new Set;const k=t=>1e3*t;function D(t){try{t.commitStyles(),t.cancel()}catch(t){}}const E=t=>Array.isArray(t)&&"number"!=typeof t[0],V=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?$(t):t,$=([t,e,n,a])=>`cubic-bezier(${t}, ${e}, ${n}, ${a})`,R=t=>document.createElement("div").animate(t,{duration:.001}),U={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{R({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(R({opacity:[0,1]}).finished)},F={},W=Object.keys(U).reduce(((t,e)=>(t[e]=()=>(void 0===F[e]&&(F[e]=U[e]()),F[e]),t)),{}),q={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"};function C(t,e){return E(t)?t[(n=0,a=t.length,i=e,r=a-n,((i-n)%r+r)%r+n)]:t;var n,a,i,r}function z(n,a=f(n.length),r=i){const s=n.length,o=s-a.length;return o>0&&h(a,o),i=>{let o=0;for(;o<s-2&&!(i<a[o+1]);o++);let c=(l=t(a[o],a[o+1],i),Math.min(1,Math.max(l,0)));var l;return c=C(r,o)(c),e(n[o],n[o+1],c)}}class K{constructor(t,e,{easing:n=q.easing,duration:a=q.duration,delay:i=q.delay,endDelay:r=q.endDelay,offset:s,repeat:o=q.repeat,direction:c="normal"}){this.startTime=0,this.rate=1,this.t=0,this.cancelT=0,this.playState="idle",this.finished=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const u=a*(o+1),h=z(e,s,E(n)?n.map(l):l(n));this.tick=e=>{if("finished"===this.playState){const e=h(1);return t(e),void this.resolve(e)}let n=this.pauseTime?this.pauseTime:(e-this.startTime)*this.rate;this.t=n,n/=1e3,n=Math.max(n-i,0);const s=n/a;let o=Math.floor(s),l=s%1;!l&&s>=1&&(l=1),1===l&&o--;const f=o%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(l=1-l);const p=n>=u?1:Math.min(l,1),m=h(p);t(m);n>=u+r?(this.playState="finished",this.resolve(m)):"idle"!==this.playState&&requestAnimationFrame(this.tick)},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime?this.startTime=t-(this.pauseTime-this.startTime):this.startTime||(this.startTime=t),this.pauseTime=void 0,requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=performance.now()}finish(){this.playState="finished",this.tick(0)}cancel(){this.playState="idle",this.tick(this.cancelT),this.reject(!1)}reverse(){this.rate*=-1}commitStyles(){this.cancelT=this.t}get currentTime(){return this.currentTime}set currentTime(t){this.pauseTime||0===this.rate?this.pauseTime=k(t):this.startTime=performance.now()-k(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=(t,e)=>{let n=P(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=x.get(e);t&&(n=t.initialValue)}return n};const Y=t=>Array.isArray(t)?t:[t];function Z(t,e,n,i={}){let{duration:r=q.duration,delay:s=q.delay,endDelay:o=q.endDelay,repeat:c=q.repeat,easing:l=q.easing,direction:u,offset:h}=i;const f=m(t);let p=W.waapi(),y=a;const d=(t=>S.has(t))(e);s=Math.max(1e-5,s),d&&(g[e]&&(e=g[e]),((t,e)=>{const{activeTransforms:n}=m(t);var a,i;i=e,-1===(a=n).indexOf(i)&&a.push(i),t.style.transform=M(n)})(t,e),e=T(e));const v=x.get(e);let b=function(t,e,n){for(let a=0;a<t.length;a++)null===t[a]&&(t[a]=a?t[a-1]:X(e,n));return t}(Y(n),t,e);if(function(t,e){t.activeAnimations[e]&&(D(t.activeAnimations[e]),t.activeAnimations[e]=void 0)}(f,e),P(e)?(y=((t,e)=>n=>t.style.setProperty(e,n))(t,e),W.cssRegisterProperty()?function(t){if(!j.has(t)){j.add(t);try{const{syntax:e,initialValue:n}=x.has(t)?x.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(e):p=!1):y=((t,e)=>n=>t.style[e]=n)(t,e),p){v&&(b=b.map((t=>"number"==typeof t?v.toDefaultUnit(t):t))),W.partialKeyframes()||1!==b.length||b.unshift(X(t,e));const n={delay:k(s),duration:k(r),endDelay:k(o),easing:E(l)?void 0:V(l),direction:u,iterations:c+1},i=t.animate({[e]:b,offset:h,easing:E(l)?l.map(V):void 0},n);f.activeAnimations[e]=i,i.finished||(i.finished=new Promise(((t,e)=>{i.onfinish=t,i.oncancel=e})));const p=b[b.length-1];return i.finished.then((()=>y(p))).catch(a),i}if(d&&b.every(B)){if(1===b.length&&b.unshift(X(t,e)||(null==v?void 0:v.initialValue)||0),b=b.map((t=>"string"==typeof t?parseFloat(t):t)),v){const t=y;y=e=>t(v.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new K(t,e,n)}(y,b,i)}{const t=b[b.length-1];y(v&&"number"==typeof t?v.toDefaultUnit(t):t)}}const B=t=>"number"==typeof t;const I={get:(t,e)=>{var n,a;switch(e){case"finished":return t.finished;case"currentTime":const i=(null===(n=t.animations[0])||void 0===n?void 0:n[e])||0;return i?i/1e3:0;case"playbackRate":return null===(a=t.animations[0])||void 0===a?void 0:a[e];case"stop":return()=>t.animations.forEach(D);default:return()=>t.animations.forEach((t=>t[e]()))}},set:(t,e,n)=>{switch(e){case"currentTime":n*=1e3;case"currentTime":case"playbackRate":for(let a=0;a<t.animations.length;a++)t.animations[a][e]=n;return!0}return!1}},G=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):t;function H(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)}function J(t,e,n,a){var i;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?n:null!==(i=a.get(e))&&void 0!==i?i:t}function L(t,n,a,i,r,s){!function(t,e,n){for(let a=0;a<t.length;a++){const i=t[a];i.at>e&&i.at<n&&(y(t,i),a--)}}(t,r,s);for(let o=0;o<n.length;o++)t.push({value:n[o],at:e(r,s,i[o]),easing:C(a,o)})}function N(t,e){return t.at===e.at?null===t.value?1:-1:t.at-e.at}function Q(t,e={}){const n=[],a=_(t,e);for(let t=0;t<a.length;t++){const e=Z(...a[t]);e&&n.push(e)}return function(t){const e={animations:t,finished:Promise.all(t.map((t=>t.finished)))};return new Proxy(e,I)}(n)}function _(e,n={}){var{defaultOptions:a={}}=n,i=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 i=0;for(a=Object.getOwnPropertySymbols(t);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(t,a[i])&&(n[a[i]]=t[a[i]])}return n}(n,["defaultOptions"]);const r=[],s=new Map,o={},c=new Map;let l=0,p=0,m=0;for(let t=0;t<e.length;t++){const[n,i,r={}]=e[t];void 0!==r.at&&(p=J(p,r.at,l,c));let y=0;const d=H(n,o),g=d.length;for(let t=0;t<g;t++){const e=tt(d[t],s);for(const n in i){const s=et(n,e),o=Y(i[n]),c=G(r,n),{duration:l=a.duration||q.duration,easing:d=a.easing||q.easing,offset:v=f(o.length)}=c,b=u(r.delay,t,g)||0,x=p+b,T=x+l;1===v.length&&0===v[0]&&(v[1]=1);const w=length-o.length;w>0&&h(v,w),1===o.length&&o.unshift(null),L(s,o,d,v,x,T),y=Math.max(b+l,y),m=Math.max(T,m)}}l=p,p+=y}return s.forEach(((e,n)=>{for(const s in e){const o=e[s];o.sort(N);const c=[],l=[],u=[];for(let e=0;e<o.length;e++){const{at:n,value:a,easing:i}=o[e];c.push(a),l.push(t(0,m,n)),u.push(i||q.easing)}1!==l[l.length-1]&&(l.push(1),c.push(null)),r.push([n,s,c,Object.assign(Object.assign(Object.assign({},a),{duration:m,easing:u,offset:l}),i)])}})),r}function tt(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function et(t,e){return e[t]||(e[t]=[]),e[t]}export{_ as createAnimationsFromTimeline,Q as timeline};

@@ -27,2 +27,8 @@ 'use strict';

/**
* This fixes a bug in WKWebView (used in iOS apps) where compositor values
* like opacity and transform won't start animating for a long time after the
* animation starts, even while other values like color do.
*/
delay = Math.max(0.00001, delay);
/**
* If this is an individual transform, we need to map its

@@ -29,0 +35,0 @@ * key to a CSS variable and update the element's transform style

@@ -23,2 +23,8 @@ import { getAnimationData } from './data.es.js';

/**
* This fixes a bug in WKWebView (used in iOS apps) where compositor values
* like opacity and transform won't start animating for a long time after the
* animation starts, even while other values like color do.
*/
delay = Math.max(0.00001, delay);
/**
* If this is an individual transform, we need to map its

@@ -25,0 +31,0 @@ * key to a CSS variable and update the element's transform style

@@ -34,2 +34,3 @@ 'use strict';

const timeLabels = new Map();
let prevTime = 0;
let currentTime = 0;

@@ -49,3 +50,3 @@ let totalDuration = 0;

if (options$1.at !== undefined) {
currentTime = calcTime.calcNextTime(currentTime, options$1.at, timeLabels);
currentTime = calcTime.calcNextTime(currentTime, options$1.at, prevTime, timeLabels);
}

@@ -96,2 +97,3 @@ /**

}
prevTime = currentTime;
currentTime += maxDuration;

@@ -98,0 +100,0 @@ }

@@ -30,2 +30,3 @@ import { __rest } from 'tslib';

const timeLabels = new Map();
let prevTime = 0;
let currentTime = 0;

@@ -45,3 +46,3 @@ let totalDuration = 0;

if (options.at !== undefined) {
currentTime = calcNextTime(currentTime, options.at, timeLabels);
currentTime = calcNextTime(currentTime, options.at, prevTime, timeLabels);
}

@@ -92,2 +93,3 @@ /**

}
prevTime = currentTime;
currentTime += maxDuration;

@@ -94,0 +96,0 @@ }

@@ -5,3 +5,3 @@ 'use strict';

function calcNextTime(current, next, labels) {
function calcNextTime(current, next, prev, labels) {
var _a;

@@ -12,4 +12,7 @@ if (typeof next === "number") {

else if (next.startsWith("-") || next.startsWith("+")) {
return current + parseFloat(next);
return Math.max(0, current + parseFloat(next));
}
else if (next === "<") {
return prev;
}
else {

@@ -16,0 +19,0 @@ return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current;

@@ -1,2 +0,2 @@

function calcNextTime(current, next, labels) {
function calcNextTime(current, next, prev, labels) {
var _a;

@@ -7,4 +7,7 @@ if (typeof next === "number") {

else if (next.startsWith("-") || next.startsWith("+")) {
return current + parseFloat(next);
return Math.max(0, current + parseFloat(next));
}
else if (next === "<") {
return prev;
}
else {

@@ -11,0 +14,0 @@ return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current;

@@ -6,7 +6,10 @@ 'use strict';

var popmotion = require('popmotion');
var easing = require('../../dom/utils/easing.cjs.js');
function getEasingForSegment(easing, i) {
return Array.isArray(easing) ? easing[popmotion.wrap(0, easing.length, i)] : easing;
function getEasingForSegment(easing$1, i) {
return easing.isEasingList(easing$1)
? easing$1[popmotion.wrap(0, easing$1.length, i)]
: easing$1;
}
exports.getEasingForSegment = getEasingForSegment;
import { wrap } from 'popmotion';
import { isEasingList } from '../../dom/utils/easing.es.js';
function getEasingForSegment(easing, i) {
return Array.isArray(easing) ? easing[wrap(0, easing.length, i)] : easing;
return isEasingList(easing)
? easing[wrap(0, easing.length, i)]
: easing;
}
export { getEasingForSegment };
{
"name": "motion",
"version": "10.0.0-rc.0",
"version": "10.0.0-rc.1",
"description": "The Motion library for the web",

@@ -5,0 +5,0 @@ "author": "Matt Perry",

import { AcceptedElements, AnimationListOptions, Easing, MotionKeyframesDefinition } from "../types";
export declare type TimelineSegment = [AcceptedElements, MotionKeyframesDefinition] | [AcceptedElements, MotionKeyframesDefinition, AnimationListOptions];
export declare type TimelineDefinition = TimelineSegment[];
export declare type NextTime = number | `+${number}` | `-${number}` | `${string}`;
export declare type NextTime = number | "<" | `+${number}` | `-${number}` | `${string}`;
export interface ElementSequence {

@@ -6,0 +6,0 @@ [key: string]: ValueSequence;

import { NextTime } from "../types";
export declare function calcNextTime(current: number, next: NextTime, labels: Map<string, number>): number;
export declare function calcNextTime(current: number, next: NextTime, prev: number, labels: Map<string, number>): number;

@@ -1,1 +0,1 @@

export declare function getEasingForSegment<T>(easing: T | T[], i: number): T;
export declare function getEasingForSegment<T>(easing: T | T[], i: number): any;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc