import { getPrevMonth as c, getPrevYear as f, getNextYear as d, getNextMonth as S } from "./components/calendar/utils.js";
import { subDays as y, getLastDayOfMonth as M, getFirstDayOfMonth as g, getIsSameDay as p, formatDate as l } from "./dateUtils.js";
const r = /* @__PURE__ */ new Date(), o = y(r, 1), u = c(r.getMonth()), D = u === 11 ? r.getFullYear() - 1 : r.getFullYear(), h = g(D, u), T = M(D, u), e = {
  today: "TODAY",
  yesterday: "YESTERDAY",
  last7Days: "LASTSEVEN",
  last28Days: "LASTTWENTYEIGHT",
  lastMonth: "LASTMONTH",
  custom: "CUSTOM"
}, n = {
  [e.today]: {
    label: "Today",
    value: e.today,
    dateRange: r
  },
  [e.yesterday]: {
    label: "Yesterday",
    value: e.yesterday,
    dateRange: o
  },
  [e.last7Days]: {
    label: "Last 7 Days",
    value: e.last7Days,
    dateRange: { start: y(o, 6), end: o }
  },
  [e.last28Days]: {
    label: "Last 28 Days",
    value: e.last28Days,
    dateRange: { start: y(o, 27), end: o }
  },
  [e.lastMonth]: {
    label: "Last Month",
    value: e.lastMonth,
    dateRange: { start: h, end: T }
  }
}, L = [
  n[e.today],
  n[e.yesterday],
  n[e.last7Days],
  n[e.last28Days],
  n[e.lastMonth]
], O = (t = []) => {
  const a = t.find(
    (s) => s.value === e.custom
  ) ?? {
    label: "Custom",
    value: e.custom
  };
  return [
    ...t.filter(({ value: s }) => s !== e.custom),
    a
  ];
}, N = (t = []) => t.length > 1, H = {
  placement: "bottom-start",
  modifiers: [
    {
      name: "offset",
      options: {
        offset: [0, 2]
      }
    },
    {
      name: "preventOverflow",
      options: {
        altAxis: !0
      }
    },
    {
      name: "computeStyles",
      options: {
        adaptive: !1
      }
    }
  ]
};
function C(t, a) {
  return [
    {
      month: c(t),
      year: f(t, a)
    },
    {
      month: t,
      year: a
    },
    {
      month: S(t),
      year: d(t, a)
    }
  ];
}
function I(t, a) {
  return a ? a instanceof Date ? a.getMonth() : a.start.getMonth() : t.getMonth();
}
function x(t, a, s, v) {
  if (p(t.start, t.end))
    return l(t.start, a, s);
  const m = l(t.start, a, s), i = l(t.end, a, s);
  return `${m} - ${i}`;
}
const F = {
  January: 0,
  December: 11
}, P = 82.53;
export {
  P as CALENDAR_HEADER_HEIGHT,
  e as CommonSelectorValue,
  F as JS_MONTHS,
  n as commonDateSelector,
  L as commonDateSelectors,
  x as formatInputValue,
  I as getCurrentMonth,
  C as getInitialMonths,
  O as getSelectors,
  H as popperOptions,
  u as prevMonth,
  N as shouldUseSelectorsProp,
  D as year
};
