"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@aplus-frontend/utils"),d=require("dayjs"),m=require("lodash-unified"),i=require("../date/constant.js"),y=require("../hooks/use-date-timezone.js"),B=e.defineComponent({name:"ApFieldDateRangeRead",__name:"read",props:{mode:{},class:{},style:{},emptyText:{default:"--"},customReadMode:{},id:{},defaultPickerValue:{},placeholder:{},disabled:{type:[Boolean,Array]},disabledTime:{},ranges:{},separator:{type:[Object,String,Number,Boolean,null,Array]},allowEmpty:{},onCalendarChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},direction:{},autocomplete:{},activePickerIndex:{},dateRender:{},panelRender:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},allowClear:{type:Boolean},autofocus:{type:Boolean},tabindex:{},open:{type:Boolean},defaultOpen:{type:Boolean},inputReadOnly:{type:Boolean},suffixIcon:{type:[Object,String,Number,Boolean,null,Array]},clearIcon:{type:[Object,String,Number,Boolean,null,Array]},getPopupContainer:{},inputRender:{},onOpenChange:{},onContextmenu:{},onKeydown:{},role:{},name:{},picker:{},prefixCls:{},disabledDate:{},showWeek:{type:Boolean},monthCellRender:{},locale:{},size:{},bordered:{type:Boolean},variant:{},showTime:{type:[Boolean,Object]},showNow:{type:Boolean},order:{type:Boolean},defaultOpenValue:{},showHour:{type:Boolean},showMinute:{type:Boolean},showSecond:{type:Boolean},use12Hours:{type:Boolean},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},value:{},defaultValue:{},"onUpdate:value":{},onChange:{},onOk:{},format:{default:"Y-D"},shownFormat:{},timezone:{},readModeSeparator:{},presets:{type:[Array,Boolean,Object]}},setup(a){const o=a,{currentTimezone:n}=y.useDateTimezone(o),l=e.computed(()=>{const t=o.value;if(m.isNil(t)||!t?.length)return t;const u=n.value?s.getTimeFormatToZone(o.value[0],n.value):o.value?.[0],c=o.timezone?s.getTimeFormatToZone(o.value[1],n.value):o.value?.[1];return[d(u),d(c)]}),p=e.computed(()=>i.ApFieldDatePresetFormats.indexOf(o.format)>-1),r=e.computed(()=>p.value?i.PRESET_FORMAT_MAP[o.format]:o.format);return(t,u)=>l.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(l.value[0]?.format(r.value))+" ",1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.readModeSeparator))),e.createTextVNode(" "+e.toDisplayString(l.value[1]?.format(r.value)),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(a.emptyText),1)],64))}});exports.default=B;
