"use strict";var t=Object.defineProperty,e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,r=(e,n,i)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,s=(t,s)=>{for(var a in s||(s={}))n.call(s,a)&&r(t,a,s[a]);if(e)for(var a of e(s))i.call(s,a)&&r(t,a,s[a]);return t},a=require("../../../../common/vendor.js");class o{constructor(t,e){this.options=t,this.animation=a.index.createAnimation(s({},t)),this.currentStepAnimates={},this.next=0,this.$=e}_nvuePushAnimates(t,e){let n=this.currentStepAnimates[this.next],i={};if(i=n||{styles:{},config:{}},l.includes(t)){i.styles.transform||(i.styles.transform="");let n="";"rotate"===t&&(n="deg"),i.styles.transform+=`${t}(${e+n}) `}else i.styles[t]=`${e}`;this.currentStepAnimates[this.next]=i}_animateRun(t={},e={}){let n=this.$.$refs.ani.ref;if(n)return new Promise(((i,r)=>{nvueAnimation.transition(n,s({styles:t},e),(t=>{i()}))}))}_nvueNextAnimate(t,e=0,n){let i=t[e];if(i){let{styles:r,config:s}=i;this._animateRun(r,s).then((()=>{e+=1,this._nvueNextAnimate(t,e,n)}))}else this.currentStepAnimates={},"function"==typeof n&&n(),this.isEnd=!0}step(t={}){return this.animation.step(t),this}run(t){this.$.animationData=this.animation.export(),this.$.timer=setTimeout((()=>{"function"==typeof t&&t()}),this.$.durationTime)}}const l=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];l.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((t=>{o.prototype[t]=function(...e){return this.animation[t](...e),this}})),exports.createAnimation=function(t,e){if(e)return clearTimeout(e.timer),new o(t,e)};
