var t,e;import{aX as i}from"./index-90c12cc1.js";class n{constructor(t,e){this.options=t,this.animation=i({...t}),this.currentStepAnimates={},this.next=0,this.$=e}_nvuePushAnimates(t,e){let i=this.currentStepAnimates[this.next],n={};if(n=i||{styles:{},config:{}},a.includes(t)){n.styles.transform||(n.styles.transform="");let i="";"rotate"===t&&(i="deg"),n.styles.transform+=`${t}(${e+i}) `}else n.styles[t]=`${e}`;this.currentStepAnimates[this.next]=n}_animateRun(t={},e={}){let i=this.$.$refs.ani.ref;if(i)return new Promise(((n,a)=>{nvueAnimation.transition(i,{styles:t,...e},(t=>{n()}))}))}_nvueNextAnimate(t,e=0,i){let n=t[e];if(n){let{styles:a,config:s}=n;this._animateRun(a,s).then((()=>{e+=1,this._nvueNextAnimate(t,e,i)}))}else this.currentStepAnimates={},"function"==typeof i&&i(),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 a=["matrix","matrix3d","rotate","rotate3d","rotateX","rotateY","rotateZ","scale","scale3d","scaleX","scaleY","scaleZ","skew","skewX","skewY","translate","translate3d","translateX","translateY","translateZ"];function s(t,e){if(e)return clearTimeout(e.timer),new n(t,e)}a.concat(["opacity","backgroundColor"],["width","height","left","right","top","bottom"]).forEach((t=>{n.prototype[t]=function(...e){return this.animation[t](...e),this}}));const r={props:{show:{type:Boolean,default:!0},color:{type:String,default:"#909193"},textColor:{type:String,default:"#909193"},vertical:{type:Boolean,default:!1},mode:{type:String,default:"spinner"},size:{type:[String,Number],default:24},textSize:{type:[String,Number],default:15},textStyle:{type:Object,default:()=>({})},text:{type:[String,Number],default:""},timingFunction:{type:String,default:"linear"},duration:{type:[String,Number],default:1200},inactiveColor:{type:String,default:""},...null==(e=null==(t=uni.$uv)?void 0:t.props)?void 0:e.loadingIcon}};export{s as c,r as p};
