"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("dayjs"),d=require("lodash-unified"),l=require("vue");require("../../config-provider/index.js");const n=require("../../utils/data-range-persets.js"),o=require("../../config-provider/hooks/use-locale.js"),D=t=>{const s=l.ref(u().valueOf()),{t:a}=o.useLocale();return{presets:l.computed(()=>{if(t.presets===!0)return n.presetsDefault(t?.timezone?.value,s.value,a)?.filter(({value:e})=>e.every(r=>t.disabledDate?!t.disabledDate(r):!0));if(typeof t.presets=="object"&&!Array.isArray(t.presets)){const e=d.merge({},{today:!0,yesterday:!0,thisWeek:!0,lastWeek:!0,last7Days:!0,last30Days:!0,last90Days:!0,thisMonth:!0,lastMonth:!0,thisQuarter:!0,lastQuarter:!0,thisYear:!0,lastYear:!0},t.presets),r=[e.today,e.yesterday,e.thisWeek,e.lastWeek,e.last7Days,e.last30Days,e.last90Days,e.thisMonth,e.lastMonth,e.thisQuarter,e.lastQuarter,e.thisYear,e.lastYear];return n.presetsDefault(t?.timezone?.value,s.value,a)?.filter(({value:i},c)=>i.every(y=>t.disabledDate?!t.disabledDate(y):!0)&&r[c])}else return t?.presets?.map?.(e=>({label:e.label,value:e?.value?.filter(r=>r!==null)}))}),changeCurrentDate:()=>{s.value=u().valueOf()}}};exports.useDefaultPresets=D;
