import{U as e,r as t,G as a,j as r,ab as i,o as n,b as s,t as l}from"./vendor-jA_NIjzi.js";import{_ as u}from"./common-store-kFD1YPwN.js";const o={key:0},d={key:1},v=u({__name:"TimeData",props:{timeObj:{type:String,default:""},timeDay:{type:Number,default:0},id:{type:Number,default:0},finishedText:{type:String,default:""}},emits:["closeTime"],setup(u,{emit:v}){const m=u,{t:f}=e(),p=v,S=t(0),c=a((()=>new Date(m.timeObj).getTime()+24*m.timeDay*60*60*1e3)),h=t(null),y=a((()=>{if(S.value>0){const e=Math.floor(S.value/864e5),t=Math.floor(S.value%864e5/36e5),a=Math.floor(S.value%36e5/6e4),r=Math.floor(S.value%6e4/1e3);return e>0?f("countdown.with_days",{days:e,hours:String(t).padStart(2,"0"),minutes:String(a).padStart(2,"0"),seconds:String(r).padStart(2,"0")}):f("countdown.without_days",{hours:String(t).padStart(2,"0"),minutes:String(a).padStart(2,"0"),seconds:String(r).padStart(2,"0")})}return m.finishedText?m.finishedText:""}));return r((()=>{clearInterval(h.value),S.value=c.value-Date.now(),h.value=setInterval((()=>{S.value=c.value-Date.now(),S.value<=0&&(p("remainingTime",m.id),clearInterval(h.value))}),1e3)})),i((()=>{clearInterval(h.value)})),(e,t)=>S.value>0?(n(),s("div",o,l(y.value),1)):(n(),s("div",d,l(m.finishedText),1))}},[["__file","TimeData.vue"]]);export{v as T};
