import { createDateRangeValue as T } from "../DateRangeCalendarPicker/helpers.js";
import { DICTIONARY as o } from "./dictionary.js";
const l = "M4LDateTimeRangePicker", D = "Open date time range picker", I = "Cancel", c = "Ok", i = "Day", C = "Days", M = 2, N = 688, u = '[role="gridcell"][aria-selected="true"], [role="menuitem"].Mui-selected, [role="menuitem"][aria-selected="true"]', d = '[role="combobox"], [role="listbox"], [role="option"], [role="radio"], button:not([role="gridcell"])', O = " - ", K = "Range", S = "00/00/0000 00:00:00 - 00/00/0000 00:00:00", L = "00/00/0000 00:00:00 AM - 00/00/0000 00:00:00 AM", y = {
  day: "00",
  hours: "00",
  minutes: "00",
  month: "00",
  period: "AM",
  seconds: "00",
  year: "0000"
}, P = T(null, null);
function _(t, e, E, n) {
  const a = new Date(t);
  return a.setHours(e, E, n, 0), a;
}
function A(t) {
  const e = new Date(t), n = (e.getDay() + 6) % 7;
  return e.setDate(e.getDate() - n), e.setHours(0, 0, 0, 0), e;
}
function s(t) {
  const e = A(t);
  return e.setDate(e.getDate() + 6), e.setHours(23, 59, 59, 0), e;
}
const G = [
  {
    id: "yesterday",
    dictionaryKey: o.SHORTCUT_YESTERDAY,
    label: "Yesterday",
    /**
     * Resolve the Yesterday shortcut range from the current adapter date.
     */
    resolveValue: (t) => {
      const e = new Date(t);
      return e.setDate(e.getDate() - 1), T(
        _(e, 0, 0, 0),
        _(e, 23, 59, 59)
      );
    }
  },
  {
    id: "today",
    dictionaryKey: o.SHORTCUT_TODAY,
    label: "Today",
    /**
     * Resolve the Today shortcut range from the current adapter date.
     */
    resolveValue: (t) => T(
      _(t, 0, 0, 0),
      _(t, 23, 59, 59)
    )
  },
  {
    id: "this-week",
    dictionaryKey: o.SHORTCUT_THIS_WEEK,
    label: "This week",
    /**
     * Resolve the current week shortcut range from the current adapter date.
     */
    resolveValue: (t) => T(
      A(t),
      s(t)
    )
  },
  {
    id: "last-week",
    dictionaryKey: o.SHORTCUT_LAST_WEEK,
    label: "Last week",
    /**
     * Resolve the previous week shortcut range from the current adapter date.
     */
    resolveValue: (t) => {
      const e = A(t), E = new Date(e);
      return E.setDate(E.getDate() - 7), T(
        _(E, 0, 0, 0),
        _(s(E), 23, 59, 59)
      );
    }
  },
  {
    id: "this-month",
    dictionaryKey: o.SHORTCUT_THIS_MONTH,
    label: "This month",
    /**
     * Resolve the current month shortcut range from the current adapter date.
     */
    resolveValue: (t) => {
      const e = new Date(t.getFullYear(), t.getMonth(), 1), E = new Date(t.getFullYear(), t.getMonth() + 1, 0);
      return T(
        _(e, 0, 0, 0),
        _(E, 23, 59, 59)
      );
    }
  }
];
export {
  L as DATE_TIME_RANGE_PICKER_AMPM_MASK,
  I as DATE_TIME_RANGE_PICKER_CANCEL_LABEL,
  c as DATE_TIME_RANGE_PICKER_CONFIRM_LABEL,
  C as DATE_TIME_RANGE_PICKER_DAYS_LABEL,
  i as DATE_TIME_RANGE_PICKER_DAY_LABEL,
  M as DATE_TIME_RANGE_PICKER_DEFAULT_CALENDARS,
  G as DATE_TIME_RANGE_PICKER_DEFAULT_SHORTCUTS,
  u as DATE_TIME_RANGE_PICKER_ENTER_SHORTCUT_CONFIRM_TARGET_SELECTOR,
  d as DATE_TIME_RANGE_PICKER_ENTER_SHORTCUT_IGNORE_TARGET_SELECTOR,
  l as DATE_TIME_RANGE_PICKER_KEY_COMPONENT,
  S as DATE_TIME_RANGE_PICKER_MILITARY_MASK,
  N as DATE_TIME_RANGE_PICKER_MIN_DESKTOP_LAYOUT_WIDTH,
  D as DATE_TIME_RANGE_PICKER_OPEN_BUTTON_LABEL,
  O as DATE_TIME_RANGE_PICKER_RANGE_SEPARATOR,
  y as DATE_TIME_RANGE_PICKER_SECTION_DEFAULTS,
  K as DATE_TIME_RANGE_PICKER_SELECTED_RANGE_LABEL,
  P as EMPTY_DATE_TIME_RANGE_PICKER_VALUE
};
