animejs
Version:
JavaScript animation engine
7 lines • 119 kB
JavaScript
/**
* Anime.js - ESM minified bundle
* @version v4.5.0
* @license MIT
* @copyright 2026 - Julian Garnier
*/
const t="undefined"!=typeof window,e=t?window:null,s=t?document:null,i={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},r={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},n={NONE:0,AUTO:1,FORCE:2},o={replace:0,none:1,blend:2},a=Symbol(),l=Symbol(),h=Symbol(),d=Symbol(),c=Symbol(),u=1e-11,p=1e12,m=1e3,f=240,g="",y="var(",_=[],v=(()=>{const t=new Map;return t.set("x","translateX"),t.set("y","translateY"),t.set("z","translateZ"),t})(),b=["perspective","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY"],T=b.reduce((t,e)=>({...t,[e]:e+"("}),{}),S=()=>{},x=t=>t,w=/\)\s*[-.\d]/,C=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,$=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,E=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,N=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,k=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,R=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,A=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,D=/([a-z])([A-Z])/g,O=/(\*=|\+=|-=)/,I=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,L={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:f,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:m,delay:0,loopDelay:0,ease:"out(2)",composition:o.replace,modifier:x,onBegin:S,onBeforeUpdate:S,onUpdate:S,onLoop:S,onPause:S,onComplete:S,onRender:S},B={current:null,root:s},M={defaults:L,precision:4,timeScale:1,tickThreshold:200,editor:null},F={version:"4.5.0",engine:null};t&&(e.AnimeJS||(e.AnimeJS=[]),e.AnimeJS.push(F));const P=t=>t.replace(D,"$1-$2").toLowerCase(),V=(t,e)=>0===t.indexOf(e),z=Date.now,X=Array.isArray,U=t=>t&&t.constructor===Object,H=t=>"number"==typeof t&&!isNaN(t),Y=t=>"string"==typeof t,W=t=>"function"==typeof t,q=t=>void 0===t,j=t=>q(t)||null===t,G=e=>t&&e instanceof SVGElement,Z=t=>C.test(t),Q=t=>V(t,"rgb"),J=t=>V(t,"hsl"),K=t=>Z(t)||(Q(t)||J(t))&&(")"===t[t.length-1]||!w.test(t)),tt=t=>!M.defaults.hasOwnProperty(t),et=["opacity","rotate","overflow","color"],st=(t,e)=>{if(et.includes(e))return!1;if(t.getAttribute(e)||e in t){if("scale"===e){const e=t.parentNode;return e&&"filter"===e.tagName}return!0}},it=t=>Y(t)?parseFloat(t):t,rt=Math.pow,nt=Math.sqrt,ot=Math.sin,at=Math.cos,lt=Math.abs,ht=Math.exp,dt=Math.ceil,ct=Math.floor,ut=Math.asin,pt=Math.max,mt=Math.atan2,ft=Math.PI,gt=Math.round,yt=(t,e,s)=>t<e?e:t>s?s:t,_t=(t,e)=>{if(e<0)return t;if(!e)return gt(t);const s=10**e;return gt(t*s)/s},vt=(t,e)=>X(e)?e.reduce((e,s)=>lt(s-t)<lt(e-t)?s:e):e?gt(t/e)*e:t,bt=(t,e,s)=>1===s?e:0===s?t:t+(e-t)*s,Tt=t=>t===1/0?p:t===-1/0?-p:t,St=t=>t<=u?u:Tt(_t(t,11)),xt=t=>X(t)?[...t]:t,wt=(t,e)=>{const s={...t};for(let i in e){const r=t[i];s[i]=q(r)?e[i]:r}return s},Ct=(t,e,s,i="_prev",r="_next")=>{let n=t._head,o=r;for(s&&(n=t._tail,o=i);n;){const t=n[o];e(n),n=t}},$t=(t,e,s="_prev",i="_next")=>{const r=e[s],n=e[i];r?r[i]=n:t._head=n,n?n[s]=r:t._tail=r,e[s]=null,e[i]=null},Et=(t,e,s,i="_prev",r="_next")=>{let n=t._tail;for(;n&&s&&s(n,e);)n=n[i];const o=n?n[r]:t._head;n?n[r]=e:t._head=e,o?o[i]=e:t._tail=e,e[i]=n,e[r]=o},Nt=(t,e,s)=>{const i=t.style.transform;if(i){const r=t[d];let n=0;const o=i.length;let a;for(;n<o;){for(;n<o&&32===i.charCodeAt(n);)n++;if(n>=o)break;const t=n;for(;n<o&&40!==i.charCodeAt(n);)n++;if(n>=o)break;const e=i.substring(t,n);let s=1;const l=n+1;let h=-1,d=-1;for(n++;n<o&&s>0;){const t=i.charCodeAt(n);40===t?s++:41===t?s--:44===t&&1===s&&(-1===h?h=n:-1===d&&(d=n)),n++}const c=n-1;"translate"===e||"translate3d"===e?(-1===h?r.translateX=i.substring(l,c).trim():(r.translateX=i.substring(l,h).trim(),-1===d?r.translateY=i.substring(h+1,c).trim():(r.translateY=i.substring(h+1,d).trim(),r.translateZ=i.substring(d+1,c).trim())),a=i.substring(l,c)):"scale"===e||"scale3d"===e?-1===h?r.scale=i.substring(l,c).trim():(r.scaleX=i.substring(l,h).trim(),-1===d?r.scaleY=i.substring(h+1,c).trim():(r.scaleY=i.substring(h+1,d).trim(),r.scaleZ=i.substring(d+1,c).trim())):r[e]=i.substring(l,c)}if("translate3d"===e&&a)return s&&(s[e]=a),a;const l=r[e];if(!q(l))return s&&(s[e]=l),l}return"translate3d"===e?"0px, 0px, 0px":"rotate3d"===e?"0, 0, 0, 0deg":V(e,"scale")?"1":V(e,"rotate")||V(e,"skew")?"0deg":"0px"},kt=t=>{let e=g;for(let s=0,i=b.length;s<i;s++){const i=b[s],r=t[i];if(void 0!==r){if("translateX"===i){const i=t.translateY;if(void 0!==i){const n=t.translateZ;void 0!==n?(e+=`translate3d(${r},${i},${n}) `,s+=2):(e+=`translate(${r},${i}) `,s+=1);continue}}if("scaleX"===i&&void 0===t.scale){const i=t.scaleY;if(void 0!==i){const n=t.scaleZ;void 0!==n?(e+=`scale3d(${r},${i},${n}) `,s+=2):(e+=`scale(${r},${i}) `,s+=1);continue}}e+=`${T[i]}${r}) `}"rotateZ"===i&&void 0!==t.rotate3d&&(e+=`rotate3d(${t.rotate3d}) `)}return void 0!==t.matrix&&(e+=`matrix(${t.matrix}) `),void 0!==t.matrix3d&&(e+=`matrix3d(${t.matrix3d}) `),e},Rt=[];function At(t,e){if(!t)return null;const s=Rt.length;t:for(let i=0;i<s;i++){const s=Rt[i];if(s.detect&&!s.detect(t))continue;const r=s.targetAdapters;for(let s=0,i=r.length;s<i;s++){const i=r[s];if(i.detect(t)){const s=i.props[e];if(s&&(!s.gate||s.gate(t)))return s;break t}}}for(let i=0;i<s;i++){const s=Rt[i];if(s.detect&&!s.detect(t))continue;const r=s.propertyResolvers;for(let s=0,i=r.length;s<i;s++){const i=r[s](t,e);if(i)return i}}return null}const Dt=t=>{const e=$.exec(t)||E.exec(t),s=q(e[4])?1:+e[4];return[+e[1],+e[2],+e[3],s]},Ot=t=>{const e=t.length,s=4===e||5===e;return[+("0x"+t[1]+t[s?1:2]),+("0x"+t[s?2:3]+t[s?2:4]),+("0x"+t[s?3:5]+t[s?3:6]),5===e||9===e?+(+("0x"+t[s?4:7]+t[s?4:8])/255).toFixed(3):1]},It=(t,e,s)=>(s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t),Lt=t=>{const e=N.exec(t)||k.exec(t),s=+e[1]/360,i=+e[2]/100,r=+e[3]/100,n=q(e[4])?1:+e[4];let o,a,l;if(0===i)o=a=l=r;else{const t=r<.5?r*(1+i):r+i-r*i,e=2*r-t;o=_t(255*It(e,t,s+1/3),0),a=_t(255*It(e,t,s),0),l=_t(255*It(e,t,s-1/3),0)}return[o,a,l,n]},Bt=t=>Q(t)?Dt(t):Z(t)?Ot(t):J(t)?Lt(t):[0,0,0,1],Mt=(t,e)=>q(t)?e:t,Ft=(t,e)=>{const s=t.match(I),i=e[l]?e:document.documentElement;let r=getComputedStyle(i)?.getPropertyValue(s[1]);return r&&r.trim()!==g||!s[2]||(r=s[2].trim()),r||0},Pt=(t,e,s,i,r,n)=>{if(W(t)){if(!r){const r=t(e,s,i,n);return isNaN(+r)?r||0:+r}const o=()=>{const r=t(e,s,i,n);return isNaN(+r)?r||0:+r};return r.func=o,o()}if(Y(t)&&V(t,y)){if(!r)return Ft(t,e);const s=()=>Ft(t,e);return r.func=s,s()}return t},Vt=(t,e)=>t[l]?t[h]&&st(t,e)?i.ATTRIBUTE:b.includes(e)||v.get(e)?i.TRANSFORM:V(e,"--")?i.CSS_VAR:e in t.style?i.CSS:e in t?i.OBJECT:i.ATTRIBUTE:i.OBJECT,zt=(t,e,s)=>{const i=t.style[e];i&&s&&(s[e]=i);const r=i||getComputedStyle(t[c]||t).getPropertyValue(e);return"auto"===r?"0":r},Xt=(t,e,s,r)=>{const n=q(s)?Vt(t,e):s,o=At(t,e);if(o){const s=o.get(t);return s&&r&&(r[e]=s),null==s?0:s}if(n===i.OBJECT){const s=t[e];return s&&r&&(r[e]=s),s||0}if(n===i.ATTRIBUTE){const s=t.getAttribute(e);return s&&r&&(r[e]=s),s}return n===i.TRANSFORM?Nt(t,e,r):n===i.CSS_VAR?zt(t,e,r).trimStart():zt(t,e,r)},Ut=(t,e,s)=>"-"===s?t-e:"+"===s?t+e:t*e,Ht=()=>({t:r.NUMBER,n:0,u:null,o:null,d:null,s:null}),Yt=(t,e)=>{if(e.t=r.NUMBER,e.n=0,e.u=null,e.o=null,e.d=null,e.s=null,!t)return e;const s=+t;if(!isNaN(s))return e.n=s,e;let i=t;"="===i[1]&&(e.o=i[0],i=i.slice(2));const n=!i.includes(" ")&&A.exec(i);if(n)return e.t=r.UNIT,e.n=+n[1],e.u=n[2],e;if(e.o)return e.n=+i,e;if(K(i))return e.t=r.COLOR,e.d=Bt(i),e;{const t=i.match(R);return e.t=r.COMPLEX,e.d=t?t.map(Number):[],e.s=i.split(R)||[],e}},Wt=(t,e)=>(e.t=t._valueType,e.n=t._toNumber,e.u=t._unit,e.o=null,e.d=xt(t._toNumbers),e.s=xt(t._strings),e),qt=Ht(),jt=(t,e,s)=>{const i=t._modifier,r=t._fromNumbers,n=t._toNumbers,o=t._strings;let a=o[0];for(let l=0,h=n.length;l<h;l++){const h=i(_t(bt(r[l],n[l],e),s)),d=o[l+1];a+=`${d?h+d:h}`,t._numbers[l]=h}return a},Gt=(t,e,s,a,l)=>{const h=t.parent,c=t.duration,p=t.completed,m=t.iterationDuration,f=t.iterationCount,g=t._currentIteration,y=t._loopDelay,_=t._reversed,v=t._alternate,b=t._hasChildren,T=t._delay,S=t._currentTime,x=T+m,w=e-T,C=yt(S,-T,c),$=yt(w,-T,c),E=w-S,N=$>0,k=$>=c,R=c<=u,A=l===n.FORCE;let D=0,O=w,I=0;if(f>1){const e=m+(k?0:y),s=~~($/e);t._currentIteration=yt(s,0,f),k&&t._currentIteration--,D=t._currentIteration%2,O=$-s*e||0}const L=_^(v&&D),B=t._ease;let F=k?L?0:c:L?m-O:O;B&&(F=m*B(F/m)||0);const P=(h?h.backwards:w<S)?!L:!!L;if(t._currentTime=w,t._iterationTime=F,t.backwards=P,N&&!t.began?(t.began=!0,s||h&&(P||!h.began)||t.onBegin(t)):w<=0&&(t.began=!1),s||b||!N||t._currentIteration===g||t.onLoop(t),A||l===n.AUTO&&(e>=(h&&T>0?0:T)&&e<=x||e<=T&&C>T||e>=x&&C!==c)||F>=x&&C!==c||F<=T&&C>0&&!k||e<=C&&C===c&&p||k&&!p&&R){if(N&&(t.computeDeltaTime(C),s||t.onBeforeUpdate(t)),!b){const e=A||(P?-1*E:E)>=M.tickThreshold,n=_t(t._offset+(h?h._offset:0)+T+F,12);let l,c,u,p,m=t._head,f=0;for(;m;){const t=m._composition,s=m._currentTime,h=m._changeDuration,g=m._absoluteStartTime+m._changeDuration,y=m._nextRep,_=m._prevRep,v=t!==o.none,b=_?_._absoluteStartTime+_._changeDuration:0,T=_&&_.parent!==m.parent,S=!y||y._isOverridden?g:y.parent===m.parent?g+y._delay:y._absoluteStartTime<y._absoluteUpdateStartTime?y._absoluteStartTime:y._absoluteUpdateStartTime;if((e||(s!==h||n<=S||_&&!T&&(!y||y.parent!==m.parent))&&(0!==s||n>=m._absoluteStartTime||T&&!m._hasFromValue&&!_._isOverridden&&n>=b||y&&!y._isOverridden&&y.parent===m.parent&&0!==y._currentTime&&F<y._startTime))&&(!_||T||F>=m._startTime)&&(!v||!m._isOverridden&&(!m._isOverlapped||n<=g)&&(!y||y._isOverridden||n<=S)&&(!_||_._isOverridden||(T?n>=m._absoluteStartTime||!m._hasFromValue&&n>=b:n>=b+m._delay)))){const e=m._currentTime=yt(F-m._startTime,0,h),s=m._ease(e/m._updateDuration),n=m._modifier,g=m._valueType,y=m._tweenType,_=y===i.OBJECT,b=g===r.NUMBER,T=b&&_||0===s||1===s?-1:M.precision;let S,x;if(b)S=x=n(_t(bt(m._fromNumber,m._toNumber,s),T));else if(g===r.UNIT)x=n(_t(bt(m._fromNumber,m._toNumber,s),T)),S=`${x}${m._unit}`;else if(g===r.COLOR){const t=m._numbers,e=m._fromNumbers,i=m._toNumbers,r=1-s,o=e[0],l=e[1],h=e[2],d=i[0],c=i[1],u=i[2];t[0]=n(Math.sqrt(o*o*r+d*d*s)),t[1]=n(Math.sqrt(l*l*r+c*c*s)),t[2]=n(Math.sqrt(h*h*r+u*u*s)),t[3]=n(bt(e[3],i[3],s)),m._setter&&!a||(S=`rgba(${_t(t[0],0)},${_t(t[1],0)},${_t(t[2],0)},${t[3]})`)}else g===r.COMPLEX&&(S=jt(m,s,T));if(v&&(m._number=x),a||t===o.blend)m._value=S;else{const t=m.property;l=m.target,m._setter?m._setter(l,x,m):_?l[t]=S:y===i.ATTRIBUTE?l.setAttribute(t,S):(c=l.style,y===i.TRANSFORM?(l!==u&&(u=l,p=l[d]),p[t]=S,f=1):y===i.CSS?c[t]=S:y===i.CSS_VAR&&c.setProperty(t,S)),N&&(I=1)}}else s&&_&&!T&&F<m._startTime&&(m._currentTime=0);f&&m._renderTransforms&&(c.transform=kt(p),f=0),m=m._next}!s&&I&&t.onRender(t)}!s&&N&&t.onUpdate(t)}return h&&R?!s&&(h.began&&!P&&w>0&&!p||P&&w<=u&&p)&&(t.onComplete(t),t.completed=!P):N&&k?f===1/0?t._startTime+=t.duration:t._currentIteration>=f-1&&(t.paused=!0,p||b||(t.completed=!0,s||h&&(P||!h.began)||(t.onComplete(t),t._resolve(t)))):t.completed=!1,I},Zt=(t,e,s,i,r)=>{const o=t._currentIteration;if(Gt(t,e,s,i,r),t._hasChildren){const a=t,l=a.backwards,h=i?e:a._iterationTime,d=z();let c=0,p=!0;if(!i&&a._currentIteration!==o){const t=a.iterationDuration;Ct(a,e=>{if(l){const i=e.duration,r=e._offset+e._delay;s||!(i<=u)||r&&r+i!==t||e.onComplete(e)}else!e.completed&&!e.backwards&&e._currentTime<e.iterationDuration&&Gt(e,t,s,1,n.FORCE),e.began=!1,e.completed=!1}),s||a.onLoop(a)}Ct(a,t=>{const e=_t((h-t._offset)*t._speed,12);if(l&&e>t._delay+t.duration)return;const n=t._fps<a._fps?t.requestTick(d):r;c+=Gt(t,e,s,i,n),!t.completed&&p&&(p=!1)},l),!s&&c&&a.onRender(a),(p||l)&&a._currentTime>=a.duration&&(a.paused=!0,a.completed||(a.completed=!0,s||(a.onComplete(a),a._resolve(a))))}},Qt={},Jt=(t,e,s)=>{if(s===i.TRANSFORM)return v.get(t)||t;if(s===i.CSS||s===i.ATTRIBUTE&&G(e)&&t in e.style){const e=Qt[t];if(e)return e;{const e=t?P(t):t;return Qt[t]=e,e}}return t},Kt=(t,e=!1)=>{if(t._hasChildren)Ct(t,t=>Kt(t,e),!0);else{const s=t;s.pause(),Ct(s,t=>{const r=t.property,n=t.target,o=t._tweenType,a=t._inlineValue,h=j(a)||a===g;if(t._setter){if(!e&&!h){if(Yt(a,qt),qt.d){const e=qt.d,s=t._numbers;for(let t=0,i=e.length;t<i;t++)s[t]=e[t]}else t._number=qt.n;t._setter(t.target,t._number,t)}}else if(o===i.OBJECT)e||h||(n[r]=a);else if(n[l])if(o===i.ATTRIBUTE)e||(h?n.removeAttribute(r):n.setAttribute(r,a));else{const e=n.style;if(o===i.TRANSFORM){const s=n[d];h?delete s[r]:s[r]=a,t._renderTransforms&&(Object.keys(s).length?e.transform=kt(s):e.removeProperty("transform"))}else h?e.removeProperty(P(r)):e[r]=a}n[l]&&s._tail===t&&s.targets.forEach(t=>{t.getAttribute&&t.getAttribute("style")===g&&t.removeAttribute("style")})})}return t},te=t=>Kt(t,!0);class ee{constructor(t=0){this.deltaTime=0,this._currentTime=t,this._lastTickTime=t,this._startTime=t,this._lastTime=t,this._frameDuration=m/f,this._fps=f,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(t){const e=+t,s=e<u?u:e,i=m/s;s>L.frameRate&&(L.frameRate=s),this._fps=s,this._frameDuration=i}get speed(){return this._speed}set speed(t){const e=+t;this._speed=e<u?u:e}requestTick(t){const e=this._frameDuration,s=t-this._lastTickTime,i=.25*e;return s+(i<4?i:4)<e?n.NONE:(this._lastTickTime=s>=e?t-s%e:t,n.AUTO)}computeDeltaTime(t){const e=t-this._lastTime;return this.deltaTime=e,this._lastTime=t,e}}const se={animation:null,update:S},ie=t=>{let e=se.animation;return e||(e={duration:u,computeDeltaTime:S,_offset:0,_delay:0,_head:null,_tail:null},se.animation=e,se.update=()=>{t.forEach(t=>{for(let e in t){const s=t[e],i=s._head;if(i){const t=i._valueType,e=t===r.COMPLEX||t===r.COLOR?xt(i._fromNumbers):null;let n=i._fromNumber,o=s._tail;for(;o&&o!==i;){if(e)for(let t=0,s=o._numbers.length;t<s;t++)e[t]+=o._numbers[t];else n+=o._number;o=o._prevAdd}i._toNumber=n,i._toNumbers=e}}}),Gt(e,1,1,0,n.FORCE)}),e},re=(()=>t?requestAnimationFrame:setImmediate)(),ne=(()=>t?cancelAnimationFrame:clearImmediate)();class oe extends ee{constructor(t){super(t),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=L,this.paused=!0,this.reqId=0}update(){const t=this._currentTime=z();if(this.requestTick(t)){this.computeDeltaTime(t);const e=this._speed,s=this._fps;let i=this._head;for(;i;){const r=i._next;i.paused?($t(this,i),this._hasChildren=!!this._tail,i._running=!1,i.completed&&!i._cancelled&&i.cancel()):Zt(i,(t-i._startTime)*i._speed*e,0,0,i._fps<s?i.requestTick(t):n.AUTO),i=r}se.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(z()),this.reqId=re(le)),this}pause(){if(this.reqId)return this.paused=!0,he()}resume(){if(this.paused)return this.paused=!1,Ct(this,t=>t.resetTime()),this.wake()}get speed(){return this._speed*(1===M.timeScale?1:m)}set speed(t){const e=t*M.timeScale;this._speed!==e&&(this._speed=e,Ct(this,t=>t.speed=t._speed))}get timeUnit(){return 1===M.timeScale?"ms":"s"}set timeUnit(t){const e="s"===t,s=e?.001:1;if(M.timeScale!==s){M.timeScale=s,M.tickThreshold=200*s;const t=e?.001:m;this.defaults.duration*=t,this._speed*=t}}get precision(){return M.precision}set precision(t){M.precision=t}}const ae=(()=>{const e=new oe(z());return t&&(F.engine=e,s.addEventListener("visibilitychange",()=>{e.pauseOnDocumentHidden&&(s.hidden?e.pause():e.resume())})),e})(),le=()=>{ae._head?(ae.reqId=re(le),ae.update()):ae.reqId=0},he=()=>(ne(ae.reqId),ae.reqId=0,ae),de={_rep:new WeakMap,_add:new Map},ce=(t,e,s="_rep")=>{const i=de[s];let r=i.get(t);return r||(r={},i.set(t,r)),r[e]?r[e]:r[e]={_head:null,_tail:null}},ue=(t,e)=>t._isOverridden||t._absoluteStartTime>e._absoluteStartTime,pe=t=>{t._isOverlapped=1,t._isOverridden=1,t._changeDuration=u,t._currentTime=u},me=(t,e)=>{const s=t._composition;if(s===o.replace){const s=t._absoluteStartTime;Et(e,t,ue,"_prevRep","_nextRep");const i=t._prevRep;if(i){const e=i.parent,r=i._absoluteEndTime;if(t.parent.id!==e.id&&e.iterationCount>1&&r+(e.duration-e.iterationDuration)>s){pe(i);let t=i._prevRep;for(;t&&t.parent.id===e.id;)pe(t),t=t._prevRep}const n=t._absoluteUpdateStartTime;if(r>n){const t=i._startTime,e=r-(t+i._updateDuration),s=_t(n-e-t,12);i._changeDuration=s,i._currentTime=s,i._isOverlapped=1,s<u&&pe(i)}const o=t.parent.parent;if(!o||o!==e.parent){let t=!0;if(Ct(e,e=>{e._isOverlapped||(t=!1)}),t){const t=e.parent;if(t){let s=!0;Ct(t,t=>{t!==e&&Ct(t,t=>{t._isOverlapped||(s=!1)})}),s&&t.cancel()}else e.cancel()}}}}else if(s===o.blend){const e=ce(t.target,t.property,"_add"),s=ie(de._add);let i=e._head;i||(i={...t},i._composition=o.replace,i._updateDuration=u,i._startTime=0,i._numbers=xt(t._fromNumbers),i._number=0,i._next=null,i._prev=null,Et(e,i),Et(s,i));const r=t._toNumber;if(t._fromNumber=i._fromNumber-r,t._toNumber=0,t._numbers=xt(t._fromNumbers),t._number=0,i._fromNumber=r,t._toNumbers.length){const e=xt(t._toNumbers);e.forEach((e,s)=>{t._fromNumbers[s]=i._fromNumbers[s]-e,t._toNumbers[s]=0}),i._fromNumbers=e}Et(e,t,null,"_prevAdd","_nextAdd")}return t},fe=t=>{const e=t._composition;if(e!==o.none){const s=t.target,i=t.property,r=de._rep.get(s)[i];if($t(r,t,"_prevRep","_nextRep"),e===o.blend){const e=de._add,r=e.get(s);if(!r)return;const n=r[i],o=se.animation;$t(n,t,"_prevAdd","_nextAdd");const a=n._head;if(a&&a===n._tail){$t(n,a,"_prevAdd","_nextAdd"),$t(o,a);let t=!0;for(let e in r)if(r[e]._head){t=!1;break}t&&e.delete(s)}}}return t},ge=(t,e,s)=>{let r=!1;return Ct(e,n=>{const o=n.target;if(t.includes(o)){const t=n.property,a=n._tweenType,l=Jt(s,o,a);(!l||l&&l===t)&&(n.parent._tail===n&&n._tweenType===i.TRANSFORM&&n._prev&&n._prev._tweenType===i.TRANSFORM&&(n._prev._renderTransforms=1),$t(e,n),fe(n),r=!0)}},!0),r},ye=(t,e,s)=>{const i=e||ae;let r;if(i._hasChildren){let e=0;Ct(i,n=>{if(!n._hasChildren)if(r=ge(t,n,s),r&&!n._head)n.cancel(),$t(i,n);else{const t=n._offset+n._delay+n.duration;t>e&&(e=t)}n._head?ye(t,n,s):n._hasChildren=!1},!0),q(i.iterationDuration)||(i.iterationDuration=e)}else r=ge(t,i,s);r&&!i._head&&(i._hasChildren=!1,i.cancel&&i.cancel())},_e=t=>(t.paused=!0,t.began=!1,t.completed=!1,t),ve=t=>t._cancelled?(t._hasChildren?Ct(t,ve):Ct(t,t=>{t._composition!==o.none&&me(t,ce(t.target,t.property))}),t._cancelled=0,t):t;let be=0;const Te=(t,e)=>t._priority>e._priority;class Se extends ee{constructor(t={},e=null,s=0){super(0),++be;const{id:i,delay:r,duration:n,reversed:o,alternate:a,loop:l,loopDelay:h,autoplay:d,frameRate:c,playbackRate:p,priority:m,onComplete:f,onLoop:g,onPause:y,onBegin:_,onBeforeUpdate:v,onUpdate:b}=t;B.current&&B.current.register(this);const T=e?0:ae._lastTickTime,x=e?e.defaults:M.defaults,w=W(r)||q(r)?x.delay:+r,C=W(n)||q(n)?1/0:+n,$=Mt(l,x.loop),E=Mt(h,x.loopDelay);let N=!0===$||$===1/0||$<0?1/0:$+1,k=0;e?k=s:(ae.reqId||ae.requestTick(z()),k=(ae._lastTickTime-ae._startTime)*M.timeScale),this.id=q(i)?be:i,this.parent=e,this.duration=Tt((C+E)*N-E)||u,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=b||x.onUpdate,this.onLoop=g||x.onLoop,this.onPause=y||x.onPause,this.onComplete=f||x.onComplete,this.iterationDuration=C,this.iterationCount=N,this._autoplay=!e&&Mt(d,x.autoplay),this._offset=k,this._delay=w,this._loopDelay=E,this._iterationTime=0,this._currentIteration=0,this._resolve=S,this._running=!1,this._reversed=+Mt(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=Mt(a,x.alternate),this._prev=null,this._next=null,this._lastTickTime=T,this._startTime=T,this._lastTime=T,this._fps=Mt(c,x.frameRate),this._speed=Mt(p,x.playbackRate),this._priority=+Mt(m,1)}get cancelled(){return!!this._cancelled}set cancelled(t){t?this.cancel():this.reset(!0).play()}get currentTime(){return yt(_t(this._currentTime,M.precision),-this._delay,this.duration)}set currentTime(t){const e=this.paused;this.pause().seek(+t),e||this.resume()}get iterationCurrentTime(){return yt(_t(this._iterationTime,M.precision),0,this.iterationDuration)}set iterationCurrentTime(t){this.currentTime=this.iterationDuration*this._currentIteration+t}get progress(){return yt(_t(this._currentTime/this.duration,10),0,1)}set progress(t){this.currentTime=this.duration*t}get iterationProgress(){return yt(_t(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(t){const e=this.iterationDuration;this.currentTime=e*this._currentIteration+e*t}get currentIteration(){return this._currentIteration}set currentIteration(t){this.currentTime=this.iterationDuration*yt(+t,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(t){t?this.reverse():this.play()}get speed(){return super.speed}set speed(t){super.speed=t,this.resetTime()}reset(t=!1){return ve(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Zt(this,0,1,~~t,n.FORCE),_e(this),this._hasChildren&&Ct(this,_e),this}init(t=!1){this.fps=this._fps,this.speed=this._speed,!t&&this._hasChildren&&Zt(this,this.duration,1,~~t,n.FORCE),this.reset(t);const e=this._autoplay;return!0===e?this.resume():e&&!q(e.linked)&&e.link(this),this}resetTime(){const t=1/(this._speed*ae._speed);return this._startTime=z()-(this._currentTime+this._delay)*t,this}pause(){return this.paused||(this.paused=!0,this.onPause(this)),this}resume(){return this.paused?(this.paused=!1,this.duration<=u&&!this._hasChildren?Zt(this,u,0,0,n.FORCE):(this._running||(Et(ae,this,Te),ae._hasChildren=!0,this._running=!0),this.resetTime(),this._startTime-=12,ae.wake()),this):this}restart(){return this.reset().resume()}seek(t,e=0,s=0){ve(this),this.completed=!1;const i=this.paused;return this.paused=!0,Zt(this,t+this._delay,~~e,~~s,n.AUTO),i?this:this.resume()}alternate(){const t=this._reversed,e=this.iterationCount,s=this.iterationDuration,i=e===1/0?ct(p/s):e;return this._reversed=+(!this._alternate||i%2?!t:t),e===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(s*i-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?Ct(this,t=>t.cancel(),!0):Ct(this,fe),this._cancelled=1,this.pause()}stretch(t){const e=this.duration,s=St(t);if(e===s)return this;const i=t/e,r=t<=u;return this.duration=r?u:s,this.iterationDuration=r?u:St(this.iterationDuration*i),this._offset*=i,this._delay*=i,this._loopDelay*=i,this}revert(){Zt(this,0,1,0,n.AUTO);const t=this._autoplay;return t&&t.linked&&t.linked===this&&t.revert(),this.cancel()}complete(t=0){return this.seek(this.duration,t).cancel()}then(t=S){const e=this.then,s=()=>{this.then=null,t(this),this.then=e,this._resolve=S};return new Promise(t=>(this._resolve=()=>t(s()),this.completed&&this._resolve(),this))}}const xe=t=>new Se(t,null,0).init();function we(t){const e=Y(t)?B.root.querySelectorAll(t):t;if(e instanceof NodeList||e instanceof HTMLCollection)return e}function Ce(e){if(j(e))return[];if(!t)return X(e)&&e.flat(1/0)||[e];if(X(e)){const t=e.flat(1/0),s=[];for(let e=0,i=t.length;e<i;e++){const i=t[e];if(!j(i)){const t=we(i);if(t)for(let e=0,i=t.length;e<i;e++){const i=t[e];if(!j(i)){let t=!1;for(let e=0,r=s.length;e<r;e++)if(s[e]===i){t=!0;break}t||s.push(i)}}else{let t=!1;for(let e=0,r=s.length;e<r;e++)if(s[e]===i){t=!0;break}t||s.push(i)}}}return s}const s=we(e);return s?Array.from(s):[e]}function $e(t){const e=Ce(t),s=e.length;for(let t=0;t<s;t++){const s=e[t];if(!s[a]){s[a]=!0;const t=G(s);(s.nodeType||t)&&(s[l]=!0,s[h]=t,s[d]={})}}return e}const Ee={deg:1,rad:180/ft,turn:360},Ne={},ke=(t,e,i,n=!1)=>{const o=e.u,a=e.n;if(e.t===r.UNIT&&o===i)return e;const l=a+o+i,h=Ne[l];if(q(h)||n){let r;if(o in Ee)r=a*Ee[o]/Ee[i];else{const e=100,n=t.cloneNode(),l=t.parentNode,h=l&&l!==s?l:s.body;h.appendChild(n);const d=n.style;d.width=e+o;const c=n.offsetWidth||e;d.width=e+i;const u=c/(n.offsetWidth||e);h.removeChild(n),r=u*a}e.n=r,Ne[l]=r}else e.n=h;return e.t,e.u=i,e},Re=t=>t,Ae=(t=1.68)=>e=>rt(e,+t),De={in:t=>e=>t(e),out:t=>e=>1-t(1-e),inOut:t=>e=>e<.5?t(2*e)/2:1-t(-2*e+2)/2,outIn:t=>e=>e<.5?(1-t(1-2*e))/2:(t(2*e-1)+1)/2},Oe=ft/2,Ie=2*ft,Le={[g]:Ae,Quad:Ae(2),Cubic:Ae(3),Quart:Ae(4),Quint:Ae(5),Sine:t=>1-at(t*Oe),Circ:t=>1-nt(1-t*t),Expo:t=>t?rt(2,10*t-10):0,Bounce:t=>{let e,s=4;for(;t<((e=rt(2,--s))-1)/11;);return 1/rt(4,3-s)-7.5625*rt((3*e-2)/22-t,2)},Back:(t=1.7)=>e=>(+t+1)*e*e*e-+t*e*e,Elastic:(t=1,e=.3)=>{const s=yt(+t,1,10),i=yt(+e,u,2),r=i/Ie*ut(1/s),n=Ie/i;return t=>0===t||1===t?t:-s*rt(2,-10*(1-t))*ot((1-t-r)*n)}},Be=(()=>{const t={linear:Re,none:Re};for(let e in De)for(let s in Le){const i=Le[s],r=De[e];t[e+s]=s===g||"Back"===s||"Elastic"===s?(t,e)=>r(i(t,e)):r(i)}return t})(),Me={linear:Re,none:Re},Fe=t=>{if(Me[t])return Me[t];if(t.indexOf("(")<=-1){const e=De[t]||t.includes("Back")||t.includes("Elastic")?Be[t]():Be[t];return e?Me[t]=e:Re}{const e=t.slice(0,-1).split("("),s=Be[e[0]];return s?Me[t]=s(...e[1].split(",")):Re}},Pe=["steps(","irregular(","linear(","cubicBezier("],Ve=t=>{if(Y(t))for(let e=0,s=Pe.length;e<s;e++)if(V(t,Pe[e]))return console.warn(`String syntax for \`ease: "${t}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${t}\``),Re;return W(t)?t:Y(t)?Fe(t):Re},ze=Ht(),Xe=Ht(),Ue={},He={func:null},Ye={func:null},We=[null],qe=[null,null],je={to:null};let Ge,Ze,Qe=0,Je=0;const Ke=(t,e)=>{const s={};if(X(t)){const e=[].concat(...t.map(t=>Object.keys(t))).filter(tt);for(let i=0,r=e.length;i<r;i++){const r=e[i],n=t.map(t=>{const e={};for(let s in t){const i=t[s];tt(s)?s===r&&(e.to=i):e[s]=i}return e});s[r]=n}}else{const i=Mt(e.duration,M.defaults.duration),r=Object.keys(t).map(e=>({o:parseFloat(e)/100,p:t[e]})).sort((t,e)=>t.o-e.o);r.forEach(t=>{const e=t.o,r=t.p;for(let t in r)if(tt(t)){let n=s[t];n||(n=s[t]=[]);const o=e*i;let a=n.length,l=n[a-1];const h={to:r[t]};let d=0;for(let t=0;t<a;t++)d+=n[t].duration;1===a&&(h.from=l.to),r.ease&&(h.ease=r.ease),h.duration=o-(a?d:0),n.push(h)}return t});for(let t in s){const e=s[t];let i;for(let t=0,s=e.length;t<s;t++){const s=e[t],r=s.ease;s.ease=i||void 0,i=r}e[0].duration||e.shift()}}return s};class ts extends Se{constructor(t,e,s,n,a=!1,l=0,h){super(e,s,n),this._head,this._tail,++Je;const d=$e(t),c=d.length,p=e.keyframes,f=p?wt(Ke(p,e),e):e,{id:g,delay:y,duration:v,ease:b,playbackEase:T,modifier:S,composition:x,onRender:w}=f,C=s?s.defaults:M.defaults,$=Mt(b,C.ease),E=Mt(T,C.playbackEase),N=E?Ve(E):null,k=!q($.ease),R=k?$.ease:Mt(b,N?"linear":C.ease),A=k?$.settlingDuration:Mt(v,C.duration),D=Mt(y,C.delay),O=S||C.modifier,I=q(x)&&c>=m?o.none:q(x)?C.composition:x,L=this._offset+(s?s._offset:0);k&&($.parent=this);let B=NaN,F=NaN,P=0,V=0;for(let t=0;t<c;t++){const e=d[t],n=l||t,c=h||d;let p=NaN,m=NaN;for(let t in f)if(tt(t)){const l=Vt(e,t),h=At(e,t),d=Jt(t,e,l);let g=f[t];const y=X(g);if(a&&!y&&(qe[0]=g,qe[1]=g,g=qe),y){const t=g.length,e=!U(g[0]);2===t&&e?(je.to=g,We[0]=je,Ge=We):t>2&&e?(Ge=[],g.forEach((t,e)=>{e?1===e?(qe[1]=t,Ge.push(qe)):Ge.push(t):qe[0]=t})):Ge=g}else We[0]=g,Ge=We;let v=null,b=null,T=NaN,S=0,x=0;for(let t=Ge.length;x<t;x++){const i=Ge[x];U(i)?Ze=i:(je.to=i,Ze=je),He.func=null,Ye.func=null;const a=Pt(Mt(Ze.composition,I),e,n,c,null,null),p=H(a)?a:o[a];v||p===o.none||(v=ce(e,d));const m=v?v._tail:null,f=s&&m&&m.parent.parent===s?m:b,g=Pt(Ze.to,e,n,c,He,f);let y;U(g)&&!q(g.to)?(Ze=g,y=g.to):y=g;const w=Pt(Ze.from,e,n,c,Ye,f),C=Ze.ease||R,$=Pt(C,e,n,c,null,f),E=W($)||Y($)?$:C,N=!q(E)&&!q(E.ease),k=N?E.ease:E,B=N?E.settlingDuration:Pt(Mt(Ze.duration,t>1?Pt(A,e,n,c,null,f)/t:A),e,n,c,null,f),M=Pt(Mt(Ze.delay,x?0:D),e,n,c,null,f),F=Ze.modifier||O,z=!q(w),G=!q(y),Z=X(y),Q=Z||z&&G,J=b?S:0,K=b?S+M:M,tt=_t(L+K,12),et=_t(L+J,12);V||!z&&!Z||(V=1);let st=b;if(p!==o.none){let t=v._head;for(;t&&t._absoluteStartTime<=tt;)if(t._isOverridden||(st=t),t=t._nextRep,t&&t._absoluteStartTime>=tt)for(;t;)pe(t),t=t._nextRep}if(Q){Yt(Z?Pt(y[0],e,n,c,Ye,f):w,ze),Yt(Z?Pt(y[1],e,n,c,He,f):y,Xe);const t=Xt(e,d,l,Ue);ze.t===r.NUMBER&&(st?st._valueType===r.UNIT&&(ze.t=r.UNIT,ze.u=st._unit):(Yt(t,qt),qt.t===r.UNIT&&(ze.t=r.UNIT,ze.u=qt.u)))}else G?Yt(y,Xe):b?Wt(b,Xe):Yt(s&&st&&st.parent.parent===s?st._value:Xt(e,d,l,Ue),Xe),z?Yt(w,ze):b?Wt(b,ze):Yt(s&&st&&st.parent.parent===s?st._value:Xt(e,d,l,Ue),ze);if(ze.o&&(ze.n=Ut(st?st._toNumber:Yt(Xt(e,d,l,Ue),qt).n,ze.n,ze.o)),Xe.o&&(Xe.n=Ut(ze.n,Xe.n,Xe.o)),ze.t!==Xe.t)if(ze.t===r.COMPLEX||Xe.t===r.COMPLEX){const t=ze.t===r.COMPLEX?ze:Xe,e=ze.t===r.COMPLEX?Xe:ze;e.t=r.COMPLEX,e.s=xt(t.s),e.d=t.d.map(()=>e.n)}else if(ze.t===r.UNIT||Xe.t===r.UNIT){const t=ze.t===r.UNIT?ze:Xe,e=ze.t===r.UNIT?Xe:ze;e.t=r.UNIT,e.u=t.u}else if(ze.t===r.COLOR||Xe.t===r.COLOR){const t=ze.t===r.COLOR?ze:Xe,e=ze.t===r.COLOR?Xe:ze;e.t=r.COLOR,e.d=t.d.map(()=>0)}if(ze.u!==Xe.u){let t=Xe.u?ze:Xe;t=ke(e,t,Xe.u?Xe.u:ze.u,!1)}if(Xe.d&&ze.d&&Xe.d.length!==ze.d.length){const t=ze.d.length>Xe.d.length?ze:Xe,e=t===ze?Xe:ze;e.d=t.d.map((t,s)=>q(e.d[s])?0:e.d[s]),e.s=xt(t.s)}const it=_t(+B||u,12);let rt=Ue[d];j(rt)||(Ue[d]=null);const nt=h?h.set:null;S=_t(K+it,12);const ot=ze.d,at=Xe.d,lt=Xe.s,ht={parent:this,id:Qe++,property:d,target:e,_value:null,_toFunc:He.func,_fromFunc:Ye.func,_ease:Ve(k),_fromNumbers:ot?xt(ot):_,_toNumbers:at?xt(at):_,_strings:lt?xt(lt):_,_fromNumber:ze.n,_toNumber:Xe.n,_numbers:ot?xt(ot):_,_number:ze.n,_unit:Xe.u,_modifier:F,_currentTime:0,_startTime:K,_delay:+M,_updateDuration:it,_changeDuration:it,_absoluteStartTime:tt,_absoluteUpdateStartTime:et,_absoluteEndTime:_t(L+S,12),_hasFromValue:z||Z?1:0,_tweenType:l,_setter:nt,_valueType:Xe.t,_composition:p,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:rt,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};p!==o.none&&me(ht,v);const dt=ht._valueType;if(dt===r.COMPLEX)ht._value=jt(ht,1,-1);else if(dt===r.UNIT)ht._value=`${F(ht._toNumber)}${ht._unit}`;else if(dt===r.COLOR){const t=Xe.d;ht._value=`rgba(${_t(t[0],0)},${_t(t[1],0)},${_t(t[2],0)},${t[3]})`}else ht._value=F(ht._toNumber);isNaN(T)&&(T=ht._startTime),b=ht,P++,Et(this,ht)}(isNaN(F)||T<F)&&(F=T),(isNaN(B)||S>B)&&(B=S),l===i.TRANSFORM&&(p=P-x,m=P)}if(!isNaN(p)){let t=0;Ct(this,e=>{t>=p&&t<m&&(e._renderTransforms=1,e._composition===o.blend&&Ct(se.animation,t=>{t.id===e.id&&(t._renderTransforms=1)})),t++})}}c||console.warn("No target found. Make sure the element you're trying to animate is accessible before creating your animation."),F?(Ct(this,t=>{t._startTime-t._delay||(t._delay-=F),t._startTime-=F}),B-=F):F=0,B||(B=u,this.iterationCount=0),this.targets=d,this.id=q(g)?Je:g,this.duration=B===u?u:Tt((B+this._loopDelay)*this.iterationCount-this._loopDelay)||u,this.onRender=w||C.onRender,this._ease=N,this._delay=F,this.iterationDuration=B,!this._autoplay&&V&&this.onRender(this)}stretch(t){const e=this.duration;if(e===St(t))return this;const s=t/e;return Ct(this,t=>{t._updateDuration=St(t._updateDuration*s),t._changeDuration=St(t._changeDuration*s),t._currentTime*=s,t._delay*=s,t._startTime*=s,t._absoluteStartTime*=s,t._absoluteUpdateStartTime*=s,t._absoluteEndTime*=s}),super.stretch(t)}refresh(){return Ct(this,t=>{const e=t._toFunc,s=t._fromFunc;(e||s)&&(s?(Yt(s(),ze),ze.u!==t._unit&&t.target[l]&&ke(t.target,ze,t._unit,!0),t._fromNumbers=xt(ze.d),t._fromNumber=ze.n):e&&(Yt(Xt(t.target,t.property,t._tweenType),qt),t._fromNumbers=xt(qt.d),t._fromNumber=qt.n),e&&(Yt(e(),Xe),t._toNumbers=xt(Xe.d),t._strings=xt(Xe.s),t._toNumber=Xe.o?Ut(t._fromNumber,Xe.n,Xe.o):Xe.n))}),this.duration===u&&this.restart(),this}revert(){return super.revert(),Kt(this)}then(t){return super.then(t)}}const es=(t,e)=>M.editor?M.editor.addAnimation(t,e):new ts(t,e,null,0,!1).init(),ss=(t,e)=>{if(V(e,"<")){const s="<"===e[1],i=t._tail,r=i?i._offset+i._delay:0;return s?r:r+i.duration}},is=(t,e)=>{let s=t.iterationDuration;if(s===u&&(s=0),q(e))return s;if(H(+e))return+e;const i=e,r=t?t.labels:null,n=!j(r),o=ss(t,i),a=!q(o),l=O.exec(i);if(l){const t=l[0],e=i.split(t),h=n&&e[0]?r[e[0]]:s,d=a?o:n?h:s,c=+e[1];return Ut(d,c,t[0])}return a?o:n?q(r[i])?s:r[i]:s};function rs(t){return Tt((t.iterationDuration+t._loopDelay)*t.iterationCount-t._loopDelay)||u}function ns(t,e,s,i,r,o){const a=H(t.duration)&&t.duration<=u?s-u:s;e.composition&&Zt(e,a,1,1,n.AUTO);const l=i?new ts(i,t,e,a,!1,r,o):new Se(t,e,a);return e.composition&&l.init(!0),Et(e,l),Ct(e,t=>{const s=t._offset+t._delay+t.duration;s>e.iterationDuration&&(e.iterationDuration=s)}),e.duration=rs(e),e}let os=0;class as extends Se{constructor(t={}){super(t,null,0),++os,this.id=q(t.id)?os:t.id,this.duration=0,this.labels={};const e=t.defaults,s=M.defaults;this.defaults=e?wt(e,s):s,this.composition=Mt(t.composition,!0),this.onRender=t.onRender||s.onRender;const i=Mt(t.playbackEase,s.playbackEase);this._ease=i?Ve(i):null,this.iterationDuration=0}add(t,e,s){const i=U(e),r=U(t);if(i||r){if(this._hasChildren=!0,i){const i=e,r=M.editor&&M.editor.addTimelineChild,n=s&&"Stagger"===s.type&&M.editor,o=W(s)?s:null;if(o||n){const e=Ce(t),n=this.duration,a=this.iterationDuration,l=i.id;let h=0;const d=e.length,c=r?r(t,i,this.id,s,d):null,u=o||M.editor.resolveStagger(s.defaultValue);e.forEach(t=>{const s={...c||i};this.duration=n,this.iterationDuration=a,q(l)||(s.id=l+"-"+h),ns(s,this,is(this,u(t,h,e,null,this)),t,h,e),h++})}else{const e=r?r(t,i,this.id,s):i,n=s&&s.type?s.defaultValue:s;ns(e,this,is(this,n),t)}}else ns(t,this,is(this,e));return this.composition&&this.init(!0),this}}sync(t,e){if(q(t)||t&&q(t.pause))return this;t.pause();const s=+(t.effect?t.effect.getTiming().duration:t.duration);q(t)||q(t.persist)||(t.persist=!0);const i=M.editor,r=i&&i.addTimelineChild;i&&i.addTimelineSync&&(e=i.addTimelineSync(t,e,this.id),i.addTimelineChild=null);const n=this.add(t,{currentTime:[0,s],duration:s,delay:0,ease:"linear",playbackEase:"linear"},e);return i&&(i.addTimelineChild=r),n}set(t,e,s){return q(e)?this:(e.duration=u,e.composition=o.replace,this.add(t,e,s))}call(t,e){return q(t)||t&&!W(t)?this:(M.editor&&M.editor.addTimelineCall&&(e=M.editor.addTimelineCall(t,e,this.id)),this.add({duration:0,delay:0,onComplete:()=>t(this)},e))}label(t,e){return q(t)||t&&!Y(t)||(M.editor&&M.editor.addTimelineLabel&&(e=M.editor.addTimelineLabel(t,e,this.id)),this.labels[t]=is(this,e)),this}remove(t,e){return ye(Ce(t),this,e),this}stretch(t){const e=this.duration;if(e===St(t))return this;const s=t/e,i=this.labels;Ct(this,t=>t.stretch(t.duration*s));for(let t in i)i[t]*=s;return super.stretch(t)}refresh(){return Ct(this,t=>{t.refresh&&t.refresh()}),this}revert(){return super.revert(),Ct(this,t=>t.revert,!0),Kt(this)}then(t){return super.then(t)}}const ls=t=>M.editor?M.editor.addTimeline(t):new as(t).init();class hs{constructor(t,e){B.current&&B.current.register(this);const s=()=>{if(this.callbacks.completed)return;let t=!0;for(let e in this.animations)if(!this.animations[e].paused&&t){t=!1;break}t&&this.callbacks.complete()},i={onBegin:()=>{this.callbacks.completed&&this.callbacks.reset(),this.callbacks.play()},onComplete:s,onPause:s},r={v:1,autoplay:!1},n={};if(this.targets=[],this.animations={},this.callbacks=null,!q(t)&&!q(e)){for(let t in e){const s=e[t];tt(t)?n[t]=s:V(t,"on")?r[t]=s:i[t]=s}this.callbacks=new ts({v:0},r);for(let e in n){const s=n[e],r=U(s);let a={},l="+=0";if(r){const t=s.unit;Y(t)&&(l+=t)}else a.duration=s;a[e]=r?wt({to:l},s):l;const h=wt(i,a);h.composition=o.replace,h.autoplay=!1;const d=this.animations[e]=new ts(t,h,null,0,!1).init();this.targets.length||this.targets.push(...d.targets),this[e]=(t,e,s)=>{const i=d._head;if(q(t)&&i){const t=i._numbers;return t&&t.length?t:i._modifier(i._number)}return Ct(d,e=>{if(X(t))for(let s=0,i=t.length;s<i;s++)q(e._numbers[s])||(e._fromNumbers[s]=e._modifier(e._numbers[s]),e._toNumbers[s]=t[s]);else e._fromNumber=e._modifier(e._number),e._toNumber=t;q(s)||(e._ease=Ve(s)),e._currentTime=0}),q(e)||d.stretch(e),d.reset(!0).resume(),this}}}}revert(){for(let t in this.animations)this[t]=S,this.animations[t].revert();return this.animations={},this.targets.length=0,this.callbacks&&this.callbacks.revert(),this}}const ds=(t,e)=>new hs(t,e),cs=(t,e)=>(+t).toFixed(e),us=(t,e,s)=>`${t}`.padStart(e,s),ps=(t,e,s)=>`${t}`.padEnd(e,s),ms=(t,e,s)=>((t-e)%(s-e)+(s-e))%(s-e)+e,fs=(t,e,s,i,r)=>i+(t-e)/(s-e)*(r-i),gs=t=>t*Math.PI/180,ys=t=>180*t/Math.PI,_s=(t,e,s,i)=>i?1===i?e:bt(t,e,1-Math.exp(-i*s*.1)):t;var vs=Object.freeze({__proto__:null,clamp:yt,damp:_s,degToRad:gs,lerp:bt,mapRange:fs,padEnd:ps,padStart:us,radToDeg:ys,round:_t,roundPad:cs,snap:vt,wrap:ms});const bs=10*m;class Ts{constructor(t={}){const e=!q(t.bounce)||!q(t.duration);this.timeStep=.02,this.restThreshold=5e-4,this.restDuration=200,this.maxDuration=6e4,this.maxRestSteps=this.restDuration/this.timeStep/m,this.maxIterations=this.maxDuration/this.timeStep/m,this.bn=yt(Mt(t.bounce,.5),-1,1),this.pd=yt(Mt(t.duration,628),10*M.timeScale,bs*M.timeScale),this.m=yt(Mt(t.mass,1),1,bs),this.s=yt(Mt(t.stiffness,100),u,bs),this.d=yt(Mt(t.damping,10),u,bs),this.v=yt(Mt(t.velocity,0),-1e4,bs),this.w0=0,this.zeta=0,this.wd=0,this.b=0,this.completed=!1,this.solverDuration=0,this.settlingDuration=0,this.parent=null,this.onComplete=t.onComplete||S,e&&this.calculateSDFromBD(),this.compute(),this.ease=t=>{const e=t*this.settlingDuration,s=this.completed,i=this.pd;return e>=i&&!s&&(this.completed=!0,this.onComplete(this.parent)),e<i&&s&&(this.completed=!1),0===t||1===t?t:this.solve(t*this.solverDuration)}}solve(t){const{zeta:e,w0:s,wd:i,b:r}=this;let n=t;return n=e<1?ht(-n*e*s)*(1*at(i*n)+r*ot(i*n)):1===e?(1+r*n)*ht(-n*s):((1+r)*ht((-e*s+i)*n)+(1-r)*ht((-e*s-i)*n))/2,1-n}calculateSDFromBD(){const t=1===M.timeScale?this.pd/m:this.pd;this.m=1,this.v=0,this.s=rt(2*ft/t,2),this.bn>=0?this.d=4*(1-this.bn)*ft/t:this.d=4*ft/(t*(1+this.bn)),this.s=_t(yt(this.s,u,bs),3),this.d=_t(yt(this.d,u,300),3)}calculateBDFromSD(){const t=2*ft/nt(this.s);this.pd=t*(1===M.timeScale?m:1);const e=this.d/(2*nt(this.s));this.bn=e<=1?1-this.d*t/(4*ft):4*ft/(this.d*t)-1,this.bn=_t(yt(this.bn,-1,1),3),this.pd=_t(yt(this.pd,10*M.timeScale,bs*M.timeScale),3)}compute(){const{maxRestSteps:t,maxIterations:e,restThreshold:s,timeStep:i,m:r,d:n,s:o,v:a}=this,l=this.w0=yt(nt(o/r),u,m),h=this.zeta=n/(2*nt(o*r));h<1?(this.wd=l*nt(1-h*h),this.b=(h*l-a)/this.wd):1===h?(this.wd=0,this.b=-a+l):(this.wd=l*nt(h*h-1),this.b=(h*l-a)/this.wd);let d=0,c=0,p=0;for(;c<=t&&p<=e;)lt(1-this.solve(d))<s?c++:c=0,this.solverDuration=d,d+=i,p++;this.settlingDuration=_t(this.solverDuration*m,0)*M.timeScale}get bounce(){return this.bn}set bounce(t){this.bn=yt(Mt(t,1),-1,1),this.calculateSDFromBD(),this.compute()}get duration(){return this.pd}set duration(t){this.pd=yt(Mt(t,1),10*M.timeScale,bs*M.timeScale),this.calculateSDFromBD(),this.compute()}get stiffness(){return this.s}set stiffness(t){this.s=yt(Mt(t,100),u,bs),this.calculateBDFromSD(),this.compute()}get damping(){return this.d}set damping(t){this.d=yt(Mt(t,10),u,bs),this.calculateBDFromSD(),this.compute()}get mass(){return this.m}set mass(t){this.m=yt(Mt(t,1),1,bs),this.compute()}get velocity(){return this.v}set velocity(t){this.v=yt(Mt(t,0),-1e4,bs),this.compute()}}const Ss=t=>new Ts(t),xs=t=>(console.warn("createSpring() is deprecated use spring() instead"),new Ts(t)),ws={_head:null,_tail:null},Cs=(t,e,s)=>{let i,r=ws._head;for(;r;){const n=r._next,o=r.$el===t,a=!e||r.property===e,l=!s||r.parent===s;if(o&&a&&l){i=r.animation;try{i.commitStyles()}catch{}i.cancel(),$t(ws,r);const t=r.parent;t&&(t._completed++,t.animations.length===t._completed&&(t.completed=!0,t.paused=!0,t.muteCallbacks||(t.onComplete(t),t._resolve(t))))}r=n}return i},$s=(t,e,s,i,r)=>{const n=e.animate(i,r),o=r.delay+ +r.duration*r.iterations;n.playbackRate=t._speed,t.paused&&n.pause(),t.duration<o&&(t.duration=o,t.controlAnimation=n),t.animations.push(n),Cs(e,s),Et(ws,{parent:t,animation:n,$el:e,property:s,_next:null,_prev:null});const a=()=>Cs(e,s,t);return n.oncancel=a,n.onremove=a,t.persist||(n.onfinish=a),n};function Es(t,e,s){const i=$e(t);if(!i.length)return;const[n]=i,o=Vt(n,e),a=Jt(e,n,o);let l=Xt(n,a);if(q(s))return l;if(Yt(l,qt),qt.t===r.NUMBER||qt.t===r.UNIT){if(!1===s)return qt.n;{const t=ke(n,qt,s,!1);return`${_t(t.n,M.precision)}${t.u}`}}}const Ns=(t,e)=>{if(!q(e))return M.editor&&M.editor.addSet?M.editor.addSet(t,e):(e.duration=u,e.composition=Mt(e.composition,o.none),new ts(t,e,null,0,!0).resume())},ks=(t,e,s)=>{const i=Ce(t);for(let t=0,r=i.length;t<r;t++)Cs(i[t],s,e&&e.controlAnimation&&e);return ye(i,e,s),i},Rs=t=>{t.cancelable&&t.preventDefault()};class As{constructor(t){this.el=t,this.zIndex=0,this.parentElement=null,this.classList={add:S,remove:S}}get x(){return this.el.x||0}set x(t){this.el.x=t}get y(){return this.el.y||0}set y(t){this.el.y=t}get width(){return this.el.width||0}set width(t){this.el.width=t}get height(){return this.el.height||0}set height(t){this.el.height=t}getBoundingClientRect(){return{top:this.y,right:this.x,bottom:this.y+this.height,left:this.x+this.width}}}class Ds{constructor(t){this.$el=t,this.inlineTransforms=[],this.point=new DOMPoint,this.inversedMatrix=this.getMatrix().inverse()}normalizePoint(t,e){return this.point.x=t,this.point.y=e,this.point.matrixTransform(this.inversedMatrix)}traverseUp(t){let e=this.$el.parentElement,i=0;for(;e&&e!==s;)t(e,i),e=e.parentElement,i++}getMatrix(){const t=new DOMMatrix;return this.traverseUp(e=>{const s=getComputedStyle(e).transform;if(s){const e=new DOMMatrix(s);t.preMultiplySelf(e)}}),t}remove(){this.traverseUp((t,e)=>{this.inlineTransforms[e]=t.style.transform,t.style.transform="none"})}revert(){this.traverseUp((t,e)=>{const s=this.inlineTransforms[e];""===s?t.style.removeProperty("transform"):t.style.transform=s})}}const Os=(t,e)=>t&&W(t)?t(e):t;let Is=0;class Ls{constructor(t,i={}){if(!t)return;B.current&&B.current.register(this);const r=i.x,n=i.y,o=i.trigger,a=i.modifier,l=i.releaseEase,h=l&&Ve(l),d=!q(l)&&!q(l.ease),c=U(r)&&!q(r.mapTo)?r.mapTo:"translateX",u=U(n)&&!q(n.mapTo)?n.mapTo:"translateY",m=Os(i.container,this);this.containerArray=X(m)?m:null,this.$container=m&&!this.containerArray?Ce(m)[0]:s.body,this.useWin=this.$container===s.body,this.$scrollContainer=this.useWin?e:this.$container,this.$target=U(t)?new As(t):Ce(t)[0],this.$trigger=Ce(o||t)[0],this.fixed="fixed"===Es(this.$target,"position"),this.isFinePointer=!0,this.containerPadding=[0,0,0,0],this.containerFriction=0,this.releaseContainerFriction=0,this.snapX=0,this.snapY=0,this.scrollSpeed=0,this.scrollThreshold=0,this.dragSpeed=0,this.dragThreshold=3,this.maxVelocity=0,this.minVelocity=0,this.velocityMultiplier=0,this.cursor=!1,this.releaseXSpring=d?l:Ss({mass:Mt(i.releaseMass,1),stiffness:Mt(i.releaseStiffness,80),damping:Mt(i.releaseDamping,20)}),this.releaseYSpring=d?l:Ss({mass:Mt(i.releaseMass,1),stiffness:Mt(i.releaseStiffness,80),damping:Mt(i.releaseDamping,20)}),this.releaseEase=h||Be.outQuint,this.hasReleaseSpring=d,this.onGrab=i.onGrab||S,this.onDrag=i.onDrag||S,this.onRelease=i.onRelease||S,this.onUpdate=i.onUpdate||S,this.onSettle=i.onSettle||S,this.onSnap=i.onSnap||S,this.onResize=i.onResize||S,this.onAfterResize=i.onAfterResize||S,this.disabled=[0,0];const f={};if(a&&(f.modifier=a),q(r)||!0===r)f[c]=0;else if(U(r)){const t=r,e={};t.modifier&&(e.modifier=t.modifier),t.composition&&(e.composition=t.composition),f[c]=e}else!1===r&&(f[c]=0,this.disabled[0]=1);if(q(n)||!0===n)f[u]=0;else if(U(n)){const t=n,e={};t.modifier&&(e.modifier=t.modifier),t.composition&&(e.composition=t.composition),f[u]=e}else!1===n&&(f[u]=0,this.disabled[1]=1);this.animate=new hs(this.$target,f),this.xProp=c,this.yProp=u,this.destX=0,this.destY=0,this.deltaX=0,this.deltaY=0,this.scroll={x:0,y:0},this.coords=[this.x,this.y,0,0],this.snapped=[0,0],this.pointer=[0,0,0,0,0,0,0,0],this.scrollView=[0,0],this.dragArea=[0,0,0,0],this.containerBounds=[-p,p,p,-p],this.scrollBounds=[0,0,0,0],this.targetBounds=[0,0,0,0],this.window=[0,0],this.velocityStack=[0,0,0],this.velocityStackIndex=0,this.velocityTime=z(),this.velocity=0,this.angle=0,this.cursorStyles=null,this.triggerStyles=null,this.bodyStyles=null,this.targetStyles=null,this.touchActionStyles=null,this.transforms=new Ds(this.$target),this.overshootCoords={x:0,y:0},this.overshootTicker=new Se({autoplay:!1,onUpdate:()=>{this.updated=!0,this.manual=!0,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,1),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,1)},onComplete:()=>{this.manual=!1,this.disabled[0]||this.animate[this.xProp](this.overshootCoords.x,0),this.disabled[1]||this.animate[this.yProp](this.overshootCoords.y,0)}},null,0).init(),this.updateTicker=new Se({autoplay:!1,onUpdate:()=>this.update()},null,0).init(),this.contained=!q(m),this.manual=!1,this.grabbed=!1,this.dragged=!1,this.updated=!1,this.released=!1,this.canScroll=!1,this.enabled=!1,this.initialized=!1,this.activeProp=this.disabled[1]?c:u,this.animate.callbacks.onRender=()=>{const t=this.updated,e=!(this.grabbed&&t)&&this.released,s=this.x,i=this.y,r=s-this.coords[2],n=i-this.coords[3];this.deltaX=r,this.deltaY=n,this.coords[2]=s,this.coords[3]=i,t&&(r||n)&&this.onUpdate(this),e?(this.computeVelocity(r,n),this.angle=mt(n,r)):this.updated=!1},this.animate.callbacks.onComplete=()=>{!this.grabbed&&this.released&&(this.released=!1),this.manual||(this.deltaX=0,this.deltaY=0,this.velocity=0,this.velocityStack[0]=0,this.velocityStack[1]=0,this.velocityStack[2]=0,this.velocityStackIndex=0,this.onSettle(this))},this.resizeTicker=new Se({autoplay:!1,duration:150*M.timeScale,onComplete:()=>{this.onResize(this),this.refresh(),this.onAfterResize(this)}}).init(),this.parameters=i,this.resizeObserver=new ResizeObserver(()=>{this.initialized?this.resizeTicker.restart():this.initialized=!0}),this.enable(),this.refresh(),this.resizeObserver.observe(this.$container),U(t)||this.resizeObserver.observe(this.$target)}computeVelocity(t,e){const s=this.velocityTime,i=z(),r=i-s;if(r<17)return this.velocity;this.velocityTime=i;const n=this.velocityStack,o=this.velocityMultiplier,a=this.minVelocity,l=this.maxVelocity,h=this.velocityStackIndex;n[h]=_t(yt(nt(t*t+e*e)/r*o,a,l),5);const d=pt(n[0],n[1],n[2]);return this.velocity=d,this.velocityStackIndex=(h+1)%3,d}setX(t,e=!1){if(this.disabled[0])return;const s=_t(t,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!e,this.destX=s,this.snapped[0]=vt(s,this.snapX),this.animate[this.xProp](s,0),this.manual=!1,this}setY(t,e=!1){if(this.disabled[1])return;const s=_t(t,5);return this.overshootTicker.pause(),this.manual=!0,this.updated=!e,this.destY=s,this.snapped[1]=vt(s,this.snapY),this.animate[this.yProp](s,0),this.manual=!1,this}get x(){return _t(this.animate[this.xProp](),M.precision)}set x(t){this.setX(t,!1)}get y(){return _t(this.animate[this.yProp](),M.precision)}set y(t){this.setY(t,!1)}get progressX(){return fs(this.x,this.containerBounds[3],this.containerBounds[1],0,1)}set progressX(t){this.setX(fs(t,0,1,this.containerBounds[3],this.containerBounds[1]),!1)}get progressY(){return fs(this.y,this.containerBounds[0],this.containerBounds[2],0,1)}set progressY(t){this.setY(fs(t,0,1,this.containerBounds[0],this.containerBounds[2]),!1)}updateScrollCoords(){const t=_t(this.useWin?e.scrollX:this.$container.scrollLeft,0),s=_t(this.useWin?e.scrollY:this.$container.scrollTop,0),[i,r,n,o]=this.containerPadding,a=this.scrollThreshold;this.scroll.x=t,this.scroll.y=s,this.scrollBounds[0]=s-this.targetBounds[0]+i-a,this.scrollBounds[1]=t-this.targetBounds[1]-r+a,this.scrollBounds[2]=s-this.targetBounds[2]-n+a,this.scrollBounds[3]=t-this.targetBounds[3]+o-a}updateBoundingValues(){const t=this.$container;if(!t)return;const i=this.x,r=this.y,n=this.coords[2],o=this.coords[3];this.coords[2]=0,this.coords[3]=0,this.setX(0,!0),this.setY(0,!0),this.transforms.remove();const a=this.window[0]=e.innerWidth,l=this.window[1]=e.innerHeight,h=this.useWin,d=t.scrollWidth,c=t.scrollHeight,u=this.fixed,p=t.getBoundingClientRect(),[m,f,g,y]=this.containerPadding;this.dragArea[0]=h?0:p.left,this.dragArea[1]=h?0:p.top,this.scrollView[0]=h?yt(d,a,d):d,this.scrollView[1]=h?yt(c,l,c):c,this.updateScrollCoords();const{width:_,height:v,left:b,top:T,right:S,bottom:x}=t.getBoundingClientRect();this.dragArea[2]=_t(h?yt(_,a,a):_,0),this.dragArea[3]=_t(h?yt(v,l,l):v,0);const w=Es(t,"overflow"),C="visible"===w,$="hidden"===w;if(this.canScroll=!u&&this.contained&&(t===s.body&&C||!$&&!C)&&(d>this.dragArea[2]+y-f||c>this.dragArea[3]+m-g)&&(!this.containerArray||this.containerArray&&!X(this.containerArray)),this.contained){const e=this.scroll.x,s=this.scroll.y,i=this.canScroll,r=this.$target.getBoundingClientRect(),n=i?h?0:t.scrollLeft:0,o=i?h?0:t.scrollTop:0,d=i?this.scrollView[0]-n-_:0,c=i?this.scrollView[1]-o-v:0;this.targetBounds[0]=_t(r.top+s-(h?0:T),0),this.targetBounds[1]=_t(r.right+e-(h?a:S),0),this.targetBounds[2]=_t(r.bottom+s-(h?l:x),0),this.targetBounds[3]=_t(r.left+e-(h?0:b),0),this.containerArray?(this.containerBounds[0]=this.containerArray[0]+m,this.containerBounds[1]=this.containerArray[1]-f,this.containerBounds[2]=this.containerArray[2]-g,this.containerBounds[3]=this.containerArray[3]+y):(this.containerBounds[0]=-_t(r.top-(u?yt(T,0,l):T)+o-m,0),this.containerBounds[1]=-_t(r.right-(u?yt(S,0,a):S)-d+f,0),this.containerBounds[2]=-_t(r.bottom-(u?yt(x,0,l):x)-c+g,0),this.containerBounds[3]=-_t(r.left-(u?yt(b,0,a):b)+n-y,0))}this.transforms.revert(),this.coords[2]=n,this.coords[3]=o,this.setX(i,!0),this.setY(r,!0)}isOutOfBounds(t,e,s){if(!this.contained)return 0;const[i,r,n,o]=t,[a,l]=this.disabled,h=!a&&e<o||!a&&e>r,d=!l&&s<i||!l&&s>n;return h&&!d?1:!h&&d?2:h&&d?3:0}refresh(){const t=this.parameters,i=t.x,r=t.y,n=Os(t.container,this),o=Os(t.containerPadding,this)||0,a=X(o)?o:[o,o,o,o],l=this.x,h=this.y,d=Os(t.cursor,this),c={onHover:"grab",onGrab:"grabbing"};if(d){const{onHover:t,onGrab:e}=d;t&&(c.onHover=t),e&&(c.onGrab=e)}const u=Os(t.dragThreshold,this),p={mouse:3,touch:7};if(H(u))p.mouse=u,p.touch=u;else if(u){const{mouse:t,touch:e}=u;q(t)||(p.mou