import{Q as f}from"./vendor-datepicker--1DmXemW.js";import{d as p,e as g,a as v,w as V,f as h,i as k,j as H,m as M,x as S}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as _,r as $,u as x}from"./vendor-vue-reactivity-CheHbvBM.js";import"./vendor-vue-runtime-dom-B2rky8vu.js";import"./vendor-vue-shared-DrzsEcag.js";import"./vendor-date-fns-DoIqsk4U.js";const b={class:"ccb-single-timePicker"},A=p({__name:"SingleTime",props:{field:{}},emits:["update:modelValue"],setup(m,{emit:l}){const c=m,{field:d}=_(c),a=l,r=e=>{const{hours:t,minutes:s}=e,n=s.toString().padStart(2,"0");if(i.value)return`${t.toString().padStart(2,"0")}:${n}`;{const u=t>=12?"PM":"AM";return`${t%12||12}:${n} ${u}`}},i=g(()=>{var e,t;return((t=(e=d.value)==null?void 0:e.attributes)==null?void 0:t.format)||!1}),o=$(new Date);return v(()=>{if(o.value instanceof Date){const e={hours:o.value.getHours(),minutes:o.value.getMinutes(),seconds:o.value.getSeconds()};a("update:modelValue",r(e))}}),V(o,e=>{if(e){let t;e instanceof Date?t={hours:e.getHours(),minutes:e.getMinutes()}:t=e,a("update:modelValue",r(t))}}),(e,t)=>(k(),h("div",b,[H(x(f),{modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=s=>o.value=s),"time-picker":"","is-24":i.value,"minutes-grid-increment":"5",placeholder:"hh:mm"},{"input-icon":M(()=>t[1]||(t[1]=[S("i",{class:"ccb-icon-timepicker-light-clock"},null,-1)])),_:1},8,["modelValue","is-24"])]))}});export{A as default};
//# sourceMappingURL=SingleTime-BCcRnHP7.js.map
