import{ref as r,onUnmounted as k,createElementBlock as m,openBlock as v,createTextVNode as y,createCommentVNode as S,toDisplayString as s,unref as u}from"/vue.js";const h={class:"nc-clock"},H={key:0},B=Object.assign({name:"NcClock"},{__name:"nc-clock",props:{displaySeconds:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:void 0}},setup(a){const n=a;function o(e){return e<10?"0"+e:e}function c(){return new Date}function l(){return o(c().getSeconds())}function i(){return o(c().getMinutes())}function d(e){let t=c().getHours();return e&&t>12&&(t=t-12),o(t)}const f=r(i()),p=r(d(n.twelveHour)),g=r(l()),_=setInterval(function(){f.value=i(),p.value=d(n.twelveHour),n.displaySeconds&&(g.value=l())},1e3);return k(()=>{clearInterval(_)}),(e,t)=>(v(),m("span",h,[y(s(u(p))+":"+s(u(f)),1),a.displaySeconds?(v(),m("span",H,":"+s(u(g)),1)):S("",!0)]))}});export{B as default};
