"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@aplus-frontend/utils"),y=require("dayjs"),s=(t,a=y().valueOf())=>y(f.getTimeFormatToZone(a,t??f.userTimezone)),u=(t,a)=>{const e=s(t,a);return[e.startOf("day"),e.endOf("day")]},p=(t,a)=>{const e=s(t,a);return[e.startOf("day").subtract(1,"day").startOf("day"),e.endOf("day").subtract(1,"day").endOf("day")]},O=(t,a)=>{const e=s(t,a);return[e.startOf("week").startOf("day"),e.endOf("week").endOf("day")]},c=(t,a)=>{const e=s(t,a);return[e.subtract(1,"week").startOf("week").startOf("day"),e.subtract(1,"week").endOf("week").endOf("day")]},h=(t,a)=>{const e=s(t,a);return[e.startOf("month").startOf("day"),e.endOf("month").endOf("day")]},i=(t,a)=>{const e=s(t,a);return[e.subtract(1,"month").startOf("month").startOf("day"),e.subtract(1,"month").endOf("month").endOf("day")]},m=(t,a)=>{const e=s(t,a),r=e.month(),l=Math.floor(r/3),d=e.month(l*3).date(1).startOf("day"),n=d.add(2,"month").endOf("month").endOf("day");return[d,n]},T=(t,a)=>{const r=s(t,a).subtract(3,"month"),l=r.month(),d=Math.floor(l/3),n=r.clone().month(d*3).date(1).startOf("day"),v=n.clone().add(2,"month").endOf("month").endOf("day");return[n,v]},b=(t,a)=>{const e=s(t,a);return[e.startOf("year").startOf("day"),e.endOf("year").endOf("day")]},G=(t,a)=>{const e=s(t,a);return[e.subtract(1,"year").startOf("year").startOf("day"),e.subtract(1,"year").endOf("year").endOf("day")]},o=(t,a,e)=>{const r=s(a,e);return[r.subtract(t-1,"day").startOf("day"),r.endOf("day")]},k=(t,a,e)=>[{label:e?e("ap.field.today"):"今天",value:u(t,a)},{label:e?e("ap.field.yesterday"):"昨天",value:p(t,a)},{label:e?e("ap.field.thisWeek"):"本周",value:O(t,a)},{label:e?e("ap.field.lastWeek"):"上周",value:c(t,a)},{label:e?e("ap.field.lastXDays",{day:7}):"近7天",value:o(7,t,a)},{label:e?e("ap.field.lastXDays",{day:30}):"近30天",value:o(30,t,a)},{label:e?e("ap.field.lastXDays",{day:90}):"近90天",value:o(90,t,a)},{label:e?e("ap.field.thisMonth"):"本月",value:h(t,a)},{label:e?e("ap.field.lastMonth"):"上月",value:i(t,a)},{label:e?e("ap.field.thisQuarter"):"本季度",value:m(t,a)},{label:e?e("ap.field.lastQuarter"):"上季度",value:T(t,a)},{label:e?e("ap.field.thisYear"):"本年",value:b(t,a)},{label:e?e("ap.field.lastYear"):"去年",value:G(t,a)}];exports.presetsDefault=k;exports.presetsGetLastMonth=i;exports.presetsGetLastQuarter=T;exports.presetsGetLastWeek=c;exports.presetsGetLastXDays=o;exports.presetsGetLastYear=G;exports.presetsGetThisMonth=h;exports.presetsGetThisQuarter=m;exports.presetsGetThisWeek=O;exports.presetsGetThisYear=b;exports.presetsGetTimezoneFormat=s;exports.presetsGetToday=u;exports.presetsGetYesterday=p;
