import{u as w}from"./callbackStore-BhxBUA6V.js";import{T as g}from"./TimeDropdown-CEXz5F14.js";import{d as B,a as C,w as D,f as H,i as U,x as m,j as V}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{r as I}from"./vendor-vue-reactivity-CheHbvBM.js";import"./vendor-pinia-BSPefQhS.js";import"./vendor-vue-shared-DrzsEcag.js";import"./vendor-vue3-html2pdf-KR020wX8.js";import"./vendor-html2pdf.js-B-tok4Ns.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-html2canvas-BfYXEYrK.js";import"./vendor-vue-runtime-dom-B2rky8vu.js";const y={class:"ccb-range-timePicker"},F={class:"ccb-range-timePicker__from"},N={class:"ccb-range-timePicker__to"},J=B({__name:"RangeTime",props:{format:{type:Boolean},minInterval:{},modelValue:{}},emits:["update:modelValue"],setup(_,{emit:k}){var f,h;const b=w(),a=_,M=k,l=e=>{const t=e.match(/(\d+)h/),o=e.match(/(\d+)m/),s=t?parseInt(t[1])*60:0,u=o?parseInt(o[1]):0;return s+u},r=I(((f=a.modelValue)==null?void 0:f.from)||v()),n=I(((h=a.modelValue)==null?void 0:h.to)||v());C(()=>{a.minInterval&&p(r.value)});const d=e=>{const[t,o]=e.toLowerCase().split(" "),[s,u]=t.split(":").map(Number);let c=s;return o==="pm"&&s!==12?c=s+12:o==="am"&&s===12&&(c=0),{hours:c,minutes:u,seconds:0}};b.add("updateRangeTimePicker",e=>{r.value=d(e.start),n.value=a.minInterval?i(r.value,l(a.minInterval)):d(e.end)});const P=e=>{const t=new Date;return t.setHours(e.hours),t.setMinutes(e.minutes),t.setSeconds(e.seconds||0),t},p=e=>{if(r.value=e,a.minInterval){const t=l(a.minInterval);n.value=i(e,t)}},T=e=>{if(n.value=e,a.minInterval){const t=l(a.minInterval);r.value=i(e,-t)}},i=(e,t)=>{const o=P(e);return o.setMinutes(o.getMinutes()+t),{hours:o.getHours(),minutes:o.getMinutes(),seconds:0}};D([r,n],e=>{Array.isArray(e)&&M("update:modelValue",e)});function v(){const e=new Date;return{hours:e.getHours(),minutes:e.getMinutes(),seconds:0}}return(e,t)=>(U(),H("div",y,[m("div",F,[V(g,{modelValue:r.value,"onUpdate:modelValue":[t[0]||(t[0]=o=>r.value=o),p],format:e.format},null,8,["modelValue","format"])]),t[2]||(t[2]=m("div",{class:"ccb-range-timePicker__separator"},[m("span",null,"to")],-1)),m("div",N,[V(g,{modelValue:n.value,"onUpdate:modelValue":[t[1]||(t[1]=o=>n.value=o),T],format:e.format},null,8,["modelValue","format"])])]))}});export{J as default};
//# sourceMappingURL=RangeTime-C0UTHUn5.js.map
