System.register(["./vue-legacy.js?v=1723125373998"],(function(e,t){"use strict";var n,r,o,i,a;return{setters:[e=>{n=e.l,r=e.r,o=e.I,i=e.x,a=e.y}],execute:function(){const t={duration:{type:Number,default:0},active:{type:Boolean,default:!0},precision:{type:Number,default:0},render:Function,onFinish:Function};e("_",n({name:"Countdown",props:t,setup(e){let t=null,n=0,s=!1;const c=r(0);o((()=>{c.value=e.duration}));let l=-1;const u=()=>{var r;const{precision:o}=e,i=(a=performance.now(),e.duration-n+l-a);var a;if(i<=0)return c.value=0,d(),void(s||(s=!0,null===(r=e.onFinish)||void 0===r||r.call(e)));let f;switch(o){case 3:case 2:f=i%34;break;case 1:f=i%100;break;default:f=i%1e3}c.value=i,t=window.setTimeout((()=>{u()}),f)},d=()=>{null!==t&&(window.clearTimeout(t),t=null)};i((()=>{o((()=>{if(e.active)l=performance.now(),u();else{const e=performance.now();-1!==l&&(n+=e-l),d()}}))})),a((()=>{d()}));const f={reset:function(){c.value=e.duration,n=0,l=performance.now(),e.active&&s&&u(),s=!1}};return Object.assign(f,{distance:c,getTimeInfo:function(e){return{hours:Math.floor(e/36e5),minutes:Math.floor(e%36e5/6e4),seconds:Math.floor(e%6e4/1e3),milliseconds:Math.floor(e%1e3)}},getDisplayValue:function(t){const{hours:n,minutes:r,seconds:o,milliseconds:i}=t,{precision:a}=e;return 0===a?`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}:${String(o).padStart(2,"0")}.${String(Math.floor(i/(1===a?100:2===a?10:1))).padStart(a,"0")}`}})},render(){const{render:e,precision:t,distance:n,getTimeInfo:r,getDisplayValue:o}=this;let i;switch(t){case 0:i=r(n+999),i.milliseconds=0;break;case 1:i=r(n+99),i.milliseconds=100*Math.floor(i.milliseconds/100);break;case 2:i=r(n+9),i.milliseconds=10*Math.floor(i.milliseconds/10);break;case 3:i=r(n)}return e?e(i):o(i)}}))}}}));
