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.2 to 10.0.0-rc.3

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),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 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 x(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),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);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]&&(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.playbackRate=1.000001,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,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})}));
!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 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 W(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 F(t,e){return x(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=F(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(W):W(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,allowWebkitAcceleration:S=!1}=r;const M=n(t);let A=j.waapi(),k=a;const D=(t=>m.has(t))(e);D&&(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 E=u.get(e);let V=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)}(M,e),g(e)?(k=((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):A=!1):k=((t,e)=>n=>t.style[e]=n)(t,e),A){E&&(V=V.map((t=>"number"==typeof t?E.toDefaultUnit(t):t))),j.partialKeyframes()||1!==V.length||V.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]:V,offset:w,easing:x(p)?p.map(O):void 0},n);M.activeAnimations[e]=i,i.finished||(i.finished=new Promise(((t,e)=>{i.onfinish=t,i.oncancel=e})));const r=V[V.length-1];return i.finished.then((()=>k(r))).catch(a),S||(i.playbackRate=1.000001),i}if(D&&V.every(_)){if(1===V.length&&V.unshift(X(t,e)||(null==E?void 0:E.initialValue)||0),V=V.map((t=>"string"==typeof t?parseFloat(t):t)),E){const t=k;k=e=>t(E.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new K(t,e,n)}(k,V,r)}{const t=V[V.length-1];k(E&&"number"==typeof t?E.toDefaultUnit(t):t)}}const _=t=>"number"==typeof t,B=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},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,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:F(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=W(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})}));

@@ -493,4 +493,3 @@ (function (global, factory) {

function animateStyle(element, name, keyframesDefinition, options = {}) {
// TODO: Merge in defaults
let { duration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, direction, offset, } = options;
let { duration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, direction, offset, allowWebkitAcceleration = false, } = options;
const data = getAnimationData(element);

@@ -583,7 +582,12 @@ let canAnimateNatively = supports.waapi();

/**
* 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.
* This forces Webkit to run animations on the main thread by exploiting
* this condition:
* https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp?rev=281238#L1099
*
* This fixes Webkit's timing bugs, like accelerated animations falling
* out of sync with main thread animations and massive delays in starting
* accelerated animations in WKWebView.
*/
animation.playbackRate = 1.000001;
if (!allowWebkitAcceleration)
animation.playbackRate = 1.000001;
return animation;

@@ -622,3 +626,3 @@ }

const getOptions = (options, key) => options[key] ? Object.assign(Object.assign({}, options), options[key]) : options;
const getOptions = (options, key) => options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options);

@@ -625,0 +629,0 @@ function resolveElements(elements, selectorCache) {

@@ -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})`,b=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{b({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(b({opacity:[0,1]}).finished)},A={},k=Object.keys(x).reduce(((t,e)=>(t[e]=()=>(void 0===A[e]&&(A[e]=x[e]()),A[e]),t)),{}),M={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=M.easing,duration:i=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=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=M.duration,delay:u=M.delay,endDelay:h=M.endDelay,repeat:y=M.repeat,easing:w=M.easing,direction:b,offset:x}=s;const A=e(t);let D=k.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)}(A,i),p(i)?(P=((t,e)=>n=>t.style.setProperty(e,n))(t,i),k.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))),k.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:b,iterations:y+1},a=t.animate({[i]:$,offset:x,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.playbackRate=1.000001,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],b=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}),x={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={},k=Object.keys(x).reduce(((t,e)=>(t[e]=()=>(void 0===A[e]&&(A[e]=x[e]()),A[e]),t)),{}),M={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},j=function(t,e,n){return-n*t+n*e+t},V=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 $={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($[t])return $[t];if(t.startsWith("steps")){const e=E.exec(t);if(e){const t=e[1].split(",");return V(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(j(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),j(t[r],t[r+1],s)}}class C{constructor(t,e,{easing:n=M.easing,duration:i=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=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 W(t,i,a,s={}){let{duration:o=M.duration,delay:u=M.delay,endDelay:h=M.endDelay,repeat:y=M.repeat,easing:w=M.easing,direction:S,offset:x,allowWebkitAcceleration:A=!1}=s;const D=e(t);let P=k.waapi(),O=n;const j=(t=>f.has(t))(i);j&&(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)}(D,i),p(i)?(O=((t,e)=>n=>t.style.setProperty(e,n))(t,i),k.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):P=!1):O=((t,e)=>n=>t.style[e]=n)(t,i),P){V&&($=$.map((t=>"number"==typeof t?V.toDefaultUnit(t):t))),k.partialKeyframes()||1!==$.length||$.unshift(F(t,i));const e={delay:g(u),duration:g(o),endDelay:g(h),easing:T(w)?void 0:b(w),direction:S,iterations:y+1},a=t.animate({[i]:$,offset:x,easing:T(w)?w.map(b):void 0},e);D.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((()=>O(r))).catch(n),A||(a.playbackRate=1.000001),a}if(j&&$.every(z)){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=O;O=e=>t(V.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new C(t,e,n)}(O,$,s)}{const t=$[$.length-1];O(V&&"number"==typeof t?V.toDefaultUnit(t):t)}}const z=t=>"number"==typeof t,K=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},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=W(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),p=t=>t.sort(u).reduce(y,"").trim(),y=(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)},b={},A=Object.keys(w).reduce(((t,e)=>(t[e]=()=>(void 0===b[e]&&(b[e]=w[e]()),b[e]),t)),{}),M={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},k=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function D(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=k(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:k(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: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 j(t){if("function"==typeof t)return t;if(Array.isArray(t))return D(...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 R(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 C(t,e=function(t){const e=[0];return R(e,t-1),e}(t.length),i=n){const a=t.length,r=a-e.length;return r>0&&R(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 E{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=C(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 p=i>=l?1:Math.min(u,1),y=h(p);t(y);i>=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 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:y=M.repeat,easing:S=M.easing,direction:x,offset:w}=s;const b=e(t);let k=A.waapi(),D=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=p(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]:F(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)}(b,n),m(n)?(D=((t,e)=>i=>t.style.setProperty(e,i))(t,n),A.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):k=!1):D=((t,e)=>i=>t.style[e]=i)(t,n),k){O&&(V=V.map((t=>"number"==typeof t?O.toDefaultUnit(t):t))),A.partialKeyframes()||1!==V.length||V.unshift(F(t,n));const e={delay:g(h),duration:g(o),endDelay:g(u),easing:v(S)?void 0:T(S),direction:x,iterations:y+1},a=t.animate({[n]:V,offset:w,easing:v(S)?S.map(T):void 0},e);b.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((()=>D(r))).catch(i),a.playbackRate=1.000001,a}if(P&&V.every(W)){if(1===V.length&&V.unshift(F(t,n)||(null==O?void 0:O.initialValue)||0),V=V.map((t=>"string"==typeof t?parseFloat(t):t)),O){const t=D;D=e=>t(O.toDefaultUnit(e))}return function(t,e=[0,1],i={}){return new E(t,e,i)}(D,V,s)}{const t=V[V.length-1];D(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),p=t=>t.sort(u).reduce(y,"").trim(),y=(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})`,w=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{w({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(w({opacity:[0,1]}).finished)},b={},A=Object.keys(x).reduce(((t,e)=>(t[e]=()=>(void 0===b[e]&&(b[e]=x[e]()),b[e]),t)),{}),M={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},k=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function D(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=k(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:k(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: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 j(t){if("function"==typeof t)return t;if(Array.isArray(t))return D(...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 R(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 C(t,e=function(t){const e=[0];return R(e,t-1),e}(t.length),i=n){const a=t.length,r=a-e.length;return r>0&&R(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 E{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=C(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 p=i>=l?1:Math.min(u,1),y=h(p);t(y);i>=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 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 W(t,n,a,s={}){let{duration:o=M.duration,delay:h=M.delay,endDelay:u=M.endDelay,repeat:y=M.repeat,easing:S=M.easing,direction:w,offset:x,allowWebkitAcceleration:b=!1}=s;const k=e(t);let D=A.waapi(),P=i;const O=(t=>f.has(t))(n);O&&(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=p(n)})(t,n),n=l(n));const V=c.get(n);let $=function(t,e,i){for(let n=0;n<t.length;n++)null===t[n]&&(t[n]=n?t[n-1]:F(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)}(k,n),m(n)?(P=((t,e)=>i=>t.style.setProperty(e,i))(t,n),A.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):P=((t,e)=>i=>t.style[e]=i)(t,n),D){V&&($=$.map((t=>"number"==typeof t?V.toDefaultUnit(t):t))),A.partialKeyframes()||1!==$.length||$.unshift(F(t,n));const e={delay:g(h),duration:g(o),endDelay:g(u),easing:v(S)?void 0:T(S),direction:w,iterations:y+1},a=t.animate({[n]:$,offset:x,easing:v(S)?S.map(T):void 0},e);k.activeAnimations[n]=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(i),b||(a.playbackRate=1.000001),a}if(O&&$.every(z)){if(1===$.length&&$.unshift(F(t,n)||(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],i={}){return new E(t,e,i)}(P,$,s)}{const t=$[$.length-1];P(V&&"number"==typeof t?V.toDefaultUnit(t):t)}}const z=t=>"number"==typeof t;export{W 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 p=()=>{},f=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:f},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)?k(t):t,k=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,D=t=>document.createElement("div").animate(t,{duration:.001}),E={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{D({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(D({opacity:[0,1]}).finished)},$={},C=Object.keys(E).reduce(((t,e)=>(t[e]=()=>(void 0===$[e]&&($[e]=E[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 f;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 R=function(t,e,n){var r=e-t;return 0===r?1:(n-t)/r},F=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 f}function K(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=R(0,e,r);t.push(F(n,1,i))}}function X(t,e=function(t){const e=[0];return K(e,t-1),e}(t.length),n=f){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=R(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),F(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),p=o%1;!p&&o>=1&&(p=1),1===p&&a--;const f=a%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(p=1-p);const h=n>=l?1:Math.min(p,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:f}=r;const h=u(t);let m=C.waapi(),d=p;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),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:f,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(p),r.playbackRate=1.000001,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(p)}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:p,initial:f,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"]),k={initial:!0,style:!0};let D=s(ot);V||(D={});const E=Q(p,D.style,O),$=Q(f,D.initial,O),C=Object.assign(Object.assign({},E),$),L=Object.assign(Object.assign({},$),E),U=Object.assign(Object.assign({},u),null==E?void 0:E.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 R=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,D,k),F=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,D,k);!function(t,e,r,{inViewport:i,poses:s,viewport:o={},onViewportEnter:a,onViewportLeave:c},{inViewport:l},u){const{root:p,margin:f,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==p?void 0:p.current,rootMargin:f,threshold:y});return e.observe(t.current),()=>e.disconnect()}),[i,a,c,p,f,y])}(l,L,U,i,D,k);const z=st(L,U,i,D);N(l,C,L,U,P,(t=>{T&&T(t),z&&z()}));const W=a(r,Object.assign({},M,R,F,{style:I.current,ref:l})),q=ct.reduce(((t,e)=>(t[e]=void 0,i[e]?"string"==typeof i[e]&&k[e]&&(t[e]=i[e]):D[e]&&(t[e]=D[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 p=()=>{},f=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:f},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(j,"").trim(),j=(t,e)=>`${t} ${e}(var(${g(e)}))`,P=t=>t.startsWith("--"),T=new Set;const A=t=>1e3*t;const V=t=>Array.isArray(t)&&"number"!=typeof t[0],k=t=>(t=>Array.isArray(t)&&"number"==typeof t[0])(t)?M(t):t,M=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,D=t=>document.createElement("div").animate(t,{duration:.001}),E={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{D({opacity:[1]})}catch(t){return!1}return!0},finished:()=>Boolean(D({opacity:[0,1]}).finished)},$={},C=Object.keys(E).reduce(((t,e)=>(t[e]=()=>(void 0===$[e]&&($[e]=E[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 f;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 R=function(t,e,n){var r=e-t;return 0===r?1:(n-t)/r},F=function(t,e,n){return-n*t+n*e+t},W=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 z={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(z[t])return z[t];if(t.startsWith("steps")){const e=q.exec(t);if(e){const t=e[1].split(",");return W(parseFloat(t[0]),t[1].trim())}}return f}function K(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const i=R(0,e,r);t.push(F(n,1,i))}}function X(t,e=function(t){const e=[0];return K(e,t-1),e}(t.length),n=f){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=R(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),F(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),p=o%1;!p&&o>=1&&(p=1),1===p&&a--;const f=a%2;("reverse"===c||"alternate"===c&&f||"alternate-reverse"===c&&!f)&&(p=1-p);const h=n>=l?1:Math.min(p,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=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:f,allowWebkitAcceleration:h=!1}=r;const m=u(t);let d=C.waapi(),w=p;const b=x(e);b&&(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 O=v.get(e);let j=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)}(m,e),P(e)?(w=((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):d=!1):w=((t,e)=>n=>t.style[e]=n)(t,e),d){O&&(j=j.map((t=>"number"==typeof t?O.toDefaultUnit(t):t))),C.partialKeyframes()||1!==j.length||j.unshift(Z(t,e));const n={delay:A(s),duration:A(i),endDelay:A(o),easing:V(c)?void 0:k(c),direction:l,iterations:a+1},r=t.animate({[e]:j,offset:f,easing:V(c)?c.map(k):void 0},n);m.activeAnimations[e]=r,r.finished||(r.finished=new Promise(((t,e)=>{r.onfinish=t,r.oncancel=e})));const u=j[j.length-1];return r.finished.then((()=>w(u))).catch(p),h||(r.playbackRate=1.000001),r}if(b&&j.every(H)){if(1===j.length&&j.unshift(Z(t,e)||(null==O?void 0:O.initialValue)||0),j=j.map((t=>"string"==typeof t?parseFloat(t):t)),O){const t=w;w=e=>t(O.toDefaultUnit(e))}return function(t,e=[0,1],n={}){return new Y(t,e,n)}(w,j,r)}{const t=j[j.length-1];w(O&&"number"==typeof t?O.toDefaultUnit(t):t)}}const H=t=>"number"==typeof t;const J=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},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(p)}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:p,initial:f,hover:h,press:m,exit:d,inViewport:w,viewport:b,poses:O,onStart:j,onComplete:P,onViewportEnter:T,onViewportLeave:A,inherit:V=!0}=i,k=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"]),M={initial:!0,style:!0};let D=s(ot);V||(D={});const E=Q(p,D.style,O),$=Q(f,D.initial,O),C=Object.assign(Object.assign({},E),$),L=Object.assign(Object.assign({},$),E),U=Object.assign(Object.assign({},u),null==E?void 0:E.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 R=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,D,M),F=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,D,M);!function(t,e,r,{inViewport:i,poses:s,viewport:o={},onViewportEnter:a,onViewportLeave:c},{inViewport:l},u){const{root:p,margin:f,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==p?void 0:p.current,rootMargin:f,threshold:y});return e.observe(t.current),()=>e.disconnect()}),[i,a,c,p,f,y])}(l,L,U,i,D,M);const W=st(L,U,i,D);N(l,C,L,U,j,(t=>{P&&P(t),W&&W()}));const z=a(r,Object.assign({},k,R,F,{style:I.current,ref:l})),q=ct.reduce(((t,e)=>(t[e]=void 0,i[e]?"string"==typeof i[e]&&M[e]&&(t[e]=i[e]):D[e]&&(t[e]=D[e]),t)),{}),B=c((()=>q),Object.values(q));return t.createElement(ot.Provider,{value:B},z)}))}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 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},T=new Map,w=t=>`--motion-${t}`,x=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{d.forEach((e=>{x.push(t+e),T.set(w(t+e),b[t])}))}));const O=(t,e)=>x.indexOf(t)-x.indexOf(e),S=new Set(x),M=t=>t.sort(O).reduce(A,"").trim(),A=(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,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=T.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);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=w(e));const v=T.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}=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},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.playbackRate=1.000001,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,T=p+b,w=T+l;1===v.length&&0===v[0]&&(v[1]=1);const x=length-o.length;x>0&&h(v,x),1===o.length&&o.unshift(null),L(s,o,d,v,T,w),y=Math.max(b+l,y),m=Math.max(w,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};
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},w=new Map,O=t=>`--motion-${t}`,T=["x","y","z"];["translate","scale","rotate","skew"].forEach((t=>{d.forEach((e=>{T.push(t+e),w.set(O(t+e),b[t])}))}));const x=(t,e)=>T.indexOf(t)-T.indexOf(e),S=new Set(T),A=t=>t.sort(x).reduce(M,"").trim(),M=(t,e)=>`${t} ${e}(var(${O(e)}))`,j=t=>t.startsWith("--"),k=new Set;const P=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)},W={},F=Object.keys(U).reduce(((t,e)=>(t[e]=()=>(void 0===W[e]&&(W[e]=U[e]()),W[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=P(t):this.startTime=performance.now()-P(t)/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}const X=(t,e)=>{let n=j(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!n&&0!==n){const t=w.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,allowWebkitAcceleration:f=!1}=i;const p=m(t);let y=F.waapi(),d=a;const v=(t=>S.has(t))(e);v&&(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=A(n)})(t,e),e=O(e));const b=w.get(e);let T=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)}(p,e),j(e)?(d=((t,e)=>n=>t.style.setProperty(e,n))(t,e),F.cssRegisterProperty()?function(t){if(!k.has(t)){k.add(t);try{const{syntax:e,initialValue:n}=w.has(t)?w.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:n})}catch(t){}}}(e):y=!1):d=((t,e)=>n=>t.style[e]=n)(t,e),y){b&&(T=T.map((t=>"number"==typeof t?b.toDefaultUnit(t):t))),F.partialKeyframes()||1!==T.length||T.unshift(X(t,e));const n={delay:P(s),duration:P(r),endDelay:P(o),easing:E(l)?void 0:V(l),direction:u,iterations:c+1},i=t.animate({[e]:T,offset:h,easing:E(l)?l.map(V):void 0},n);p.activeAnimations[e]=i,i.finished||(i.finished=new Promise(((t,e)=>{i.onfinish=t,i.oncancel=e})));const m=T[T.length-1];return i.finished.then((()=>d(m))).catch(a),f||(i.playbackRate=1.000001),i}if(v&&T.every(B)){if(1===T.length&&T.unshift(X(t,e)||(null==b?void 0:b.initialValue)||0),T=T.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 K(t,e,n)}(d,T,i)}{const t=T[T.length-1];d(b&&"number"==typeof t?b.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]):Object.assign({},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,w=p+b,O=w+l;1===v.length&&0===v[0]&&(v[1]=1);const T=length-o.length;T>0&&h(v,T),1===o.length&&o.unshift(null),L(s,o,d,v,w,O),y=Math.max(b+l,y),m=Math.max(O,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};

@@ -20,4 +20,3 @@ 'use strict';

function animateStyle(element, name, keyframesDefinition, options = {}) {
// TODO: Merge in defaults
let { duration = defaults.defaults.duration, delay = defaults.defaults.delay, endDelay = defaults.defaults.endDelay, repeat = defaults.defaults.repeat, easing: easing$1 = defaults.defaults.easing, direction, offset, } = options;
let { duration = defaults.defaults.duration, delay = defaults.defaults.delay, endDelay = defaults.defaults.endDelay, repeat = defaults.defaults.repeat, easing: easing$1 = defaults.defaults.easing, direction, offset, allowWebkitAcceleration = false, } = options;
const data$1 = data.getAnimationData(element);

@@ -110,7 +109,12 @@ let canAnimateNatively = featureDetection.supports.waapi();

/**
* 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.
* This forces Webkit to run animations on the main thread by exploiting
* this condition:
* https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp?rev=281238#L1099
*
* This fixes Webkit's timing bugs, like accelerated animations falling
* out of sync with main thread animations and massive delays in starting
* accelerated animations in WKWebView.
*/
animation.playbackRate = 1.000001;
if (!allowWebkitAcceleration)
animation.playbackRate = 1.000001;
return animation;

@@ -117,0 +121,0 @@ }

@@ -16,4 +16,3 @@ import { getAnimationData } from './data.es.js';

function animateStyle(element, name, keyframesDefinition, options = {}) {
// TODO: Merge in defaults
let { duration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, direction, offset, } = options;
let { duration = defaults.duration, delay = defaults.delay, endDelay = defaults.endDelay, repeat = defaults.repeat, easing = defaults.easing, direction, offset, allowWebkitAcceleration = false, } = options;
const data = getAnimationData(element);

@@ -106,7 +105,12 @@ let canAnimateNatively = supports.waapi();

/**
* 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.
* This forces Webkit to run animations on the main thread by exploiting
* this condition:
* https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp?rev=281238#L1099
*
* This fixes Webkit's timing bugs, like accelerated animations falling
* out of sync with main thread animations and massive delays in starting
* accelerated animations in WKWebView.
*/
animation.playbackRate = 1.000001;
if (!allowWebkitAcceleration)
animation.playbackRate = 1.000001;
return animation;

@@ -113,0 +117,0 @@ }

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

const getOptions = (options, key) => options[key] ? Object.assign(Object.assign({}, options), options[key]) : options;
const getOptions = (options, key) => options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options);
exports.getOptions = getOptions;

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

const getOptions = (options, key) => options[key] ? Object.assign(Object.assign({}, options), options[key]) : options;
const getOptions = (options, key) => options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options);
export { getOptions };
{
"name": "motion",
"version": "10.0.0-rc.2",
"version": "10.0.0-rc.3",
"description": "The Motion library for the web",

@@ -130,7 +130,7 @@ "author": "Matt Perry",

"path": "./dist/size-animate-style.js",
"maxSize": "2.7 kB"
"maxSize": "2.8 kB"
},
{
"path": "./dist/size-timeline-dom.js",
"maxSize": "3.8 kB"
"maxSize": "3.85 kB"
},

@@ -137,0 +137,0 @@ {

@@ -63,3 +63,5 @@ import { OptionResolver } from "../../utils/stagger";

};
export declare type AnimationOptions = SpringOptions & KeyframeOptions & PlaybackOptions;
export declare type AnimationOptions = SpringOptions & KeyframeOptions & PlaybackOptions & {
allowWebkitAcceleration?: boolean;
};
export interface AnimationWithCommitStyles extends Animation {

@@ -66,0 +68,0 @@ commitStyles: () => void;

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