var w=Object.defineProperty;var y=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var m=(t,a,e)=>a in t?w(t,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[a]=e,p=(t,a)=>{for(var e in a||(a={}))$.call(a,e)&&m(t,e,a[e]);if(y)for(var e of y(a))T.call(a,e)&&m(t,e,a[e]);return t};import{b5 as g,L as B,b6 as C,_ as E,w as F}from"./index-Cy4uayzW.js";import{d as k,f as S,e as z,u as D,h as I,w as L,o as M,a2 as P,a3 as j,a5 as q,ac as A}from"./vue-vendor-CxLCUzY4.js";const G={startVal:{type:Number,default:0},endVal:{type:Number,default:2021},duration:{type:Number,default:1500},autoplay:{type:Boolean,default:!0},decimals:{type:Number,default:0,validator(t){return t>=0}},prefix:{type:String,default:""},suffix:{type:String,default:""},separator:{type:String,default:","},decimal:{type:String,default:"."},color:{type:String},useEasing:{type:Boolean,default:!0},transition:{type:String,default:"linear"}},H=k({name:"CountTo",props:G,emits:["onStarted","onFinished"],setup(t,{emit:a}){const e=S(t.startVal),u=S(!1);let r=g(e);const d=z(()=>h(D(r)));I(()=>{e.value=t.startVal}),L([()=>t.startVal,()=>t.endVal],()=>{t.autoplay&&s()}),M(()=>{t.autoplay&&s()});function s(){c(),e.value=t.endVal}function b(){e.value=t.startVal,c()}function c(){r=g(e,p({disabled:u,duration:t.duration,onFinished:()=>a("onFinished"),onStarted:()=>a("onStarted")},t.useEasing?{transition:C[t.transition]}:{}))}function h(n){if(!n&&n!==0)return"";const{decimals:x,decimal:V,separator:i,suffix:N,prefix:_}=t;n=Number(n).toFixed(x),n+="";const l=n.split(".");let o=l[0];const v=l.length>1?V+l[1]:"",f=/(\d+)(\d{3})/;if(i&&!B(i))for(;f.test(o);)o=o.replace(f,"$1"+i+"$2");return _+o+v+N}return{value:d,start:s,reset:b}}});function J(t,a,e,u,r,d){return P(),j("span",{style:A({color:t.color})},q(t.value),5)}const K=E(H,[["render",J]]),U=F(K);export{U as C};
