import { jsx as d, jsxs as O, Fragment as T } from "react/jsx-runtime";
import { M as J, aw as Ye, ax as Fe, N as Le, ay as Dt, az as Mt, r as _t, aA as kt } from "./index-ZQlxzdt5.js";
import { createContext as q, forwardRef as Nt, useContext as Q, useState as K, useEffect as ie, useLayoutEffect as xt, useRef as Pt } from "react";
function M(e) {
  const t = Object.prototype.toString.call(e);
  return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
}
function W(e, t) {
  return e instanceof Date ? new e.constructor(t) : new Date(t);
}
function P(e, t) {
  const n = M(e);
  return isNaN(t) ? W(e, NaN) : (t && n.setDate(n.getDate() + t), n);
}
function Y(e, t) {
  const n = M(e);
  if (isNaN(t))
    return W(e, NaN);
  if (!t)
    return n;
  const a = n.getDate(), r = W(e, n.getTime());
  r.setMonth(n.getMonth() + t + 1, 0);
  const o = r.getDate();
  return a >= o ? r : (n.setFullYear(
    r.getFullYear(),
    r.getMonth(),
    a
  ), n);
}
const De = 6048e5, Ot = 864e5;
let Ct = {};
function Z() {
  return Ct;
}
function I(e, t) {
  var s, l, c, u;
  const n = Z(), a = (t == null ? void 0 : t.weekStartsOn) ?? ((l = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((u = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : u.weekStartsOn) ?? 0, r = M(e), o = r.getDay(), i = (o < a ? 7 : 0) + o - a;
  return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r;
}
function A(e) {
  return I(e, { weekStartsOn: 1 });
}
function Xe(e) {
  const t = M(e), n = t.getFullYear(), a = W(e, 0);
  a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
  const r = A(a), o = W(e, 0);
  o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0);
  const i = A(o);
  return t.getTime() >= r.getTime() ? n + 1 : t.getTime() >= i.getTime() ? n : n - 1;
}
function G(e) {
  const t = M(e);
  return t.setHours(0, 0, 0, 0), t;
}
function re(e) {
  const t = M(e), n = new Date(
    Date.UTC(
      t.getFullYear(),
      t.getMonth(),
      t.getDate(),
      t.getHours(),
      t.getMinutes(),
      t.getSeconds(),
      t.getMilliseconds()
    )
  );
  return n.setUTCFullYear(t.getFullYear()), +e - +n;
}
function L(e, t) {
  const n = G(e), a = G(t), r = +n - re(n), o = +a - re(a);
  return Math.round((r - o) / Ot);
}
function St(e) {
  const t = Xe(e), n = W(e, 0);
  return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), A(n);
}
function we(e, t) {
  const n = t * 7;
  return P(e, n);
}
function Wt(e, t) {
  return Y(e, t * 12);
}
function Tt(e) {
  let t;
  return e.forEach(function(n) {
    const a = M(n);
    (t === void 0 || t < a || isNaN(Number(a))) && (t = a);
  }), t || /* @__PURE__ */ new Date(NaN);
}
function Yt(e) {
  let t;
  return e.forEach((n) => {
    const a = M(n);
    (!t || t > a || isNaN(+a)) && (t = a);
  }), t || /* @__PURE__ */ new Date(NaN);
}
function C(e, t) {
  const n = G(e), a = G(t);
  return +n == +a;
}
function Me(e) {
  return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
}
function Ft(e) {
  if (!Me(e) && typeof e != "number")
    return !1;
  const t = M(e);
  return !isNaN(Number(t));
}
function z(e, t) {
  const n = M(e), a = M(t), r = n.getFullYear() - a.getFullYear(), o = n.getMonth() - a.getMonth();
  return r * 12 + o;
}
function Lt(e, t, n) {
  const a = I(e, n), r = I(t, n), o = +a - re(a), i = +r - re(r);
  return Math.round((o - i) / De);
}
function _e(e) {
  const t = M(e), n = t.getMonth();
  return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
}
function S(e) {
  const t = M(e);
  return t.setDate(1), t.setHours(0, 0, 0, 0), t;
}
function Ge(e) {
  const t = M(e), n = W(e, 0);
  return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
}
function ke(e, t) {
  var s, l, c, u;
  const n = Z(), a = (t == null ? void 0 : t.weekStartsOn) ?? ((l = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : l.weekStartsOn) ?? n.weekStartsOn ?? ((u = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : u.weekStartsOn) ?? 0, r = M(e), o = r.getDay(), i = (o < a ? -7 : 0) + 6 - (o - a);
  return r.setDate(r.getDate() + i), r.setHours(23, 59, 59, 999), r;
}
function Ve(e) {
  return ke(e, { weekStartsOn: 1 });
}
const Et = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
}, It = (e, t, n) => {
  let a;
  const r = Et[e];
  return typeof r == "string" ? a = r : t === 1 ? a = r.one : a = r.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + a : a + " ago" : a;
};
function fe(e) {
  return (t = {}) => {
    const n = t.width ? String(t.width) : e.defaultWidth;
    return e.formats[n] || e.formats[e.defaultWidth];
  };
}
const Rt = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, Bt = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, jt = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, Ht = {
  date: fe({
    formats: Rt,
    defaultWidth: "full"
  }),
  time: fe({
    formats: Bt,
    defaultWidth: "full"
  }),
  dateTime: fe({
    formats: jt,
    defaultWidth: "full"
  })
}, At = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, qt = (e, t, n, a) => At[e];
function $(e) {
  return (t, n) => {
    const a = n != null && n.context ? String(n.context) : "standalone";
    let r;
    if (a === "formatting" && e.formattingValues) {
      const i = e.defaultFormattingWidth || e.defaultWidth, s = n != null && n.width ? String(n.width) : i;
      r = e.formattingValues[s] || e.formattingValues[i];
    } else {
      const i = e.defaultWidth, s = n != null && n.width ? String(n.width) : e.defaultWidth;
      r = e.values[s] || e.values[i];
    }
    const o = e.argumentCallback ? e.argumentCallback(t) : t;
    return r[o];
  };
}
const Qt = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, Xt = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Gt = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec"
  ],
  wide: [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ]
}, Vt = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
  ]
}, $t = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
}, Ut = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
}, Jt = (e, t) => {
  const n = Number(e), a = n % 100;
  if (a > 20 || a < 10)
    switch (a % 10) {
      case 1:
        return n + "st";
      case 2:
        return n + "nd";
      case 3:
        return n + "rd";
    }
  return n + "th";
}, Kt = {
  ordinalNumber: Jt,
  era: $({
    values: Qt,
    defaultWidth: "wide"
  }),
  quarter: $({
    values: Xt,
    defaultWidth: "wide",
    argumentCallback: (e) => e - 1
  }),
  month: $({
    values: Gt,
    defaultWidth: "wide"
  }),
  day: $({
    values: Vt,
    defaultWidth: "wide"
  }),
  dayPeriod: $({
    values: $t,
    defaultWidth: "wide",
    formattingValues: Ut,
    defaultFormattingWidth: "wide"
  })
};
function U(e) {
  return (t, n = {}) => {
    const a = n.width, r = a && e.matchPatterns[a] || e.matchPatterns[e.defaultMatchWidth], o = t.match(r);
    if (!o)
      return null;
    const i = o[0], s = a && e.parsePatterns[a] || e.parsePatterns[e.defaultParseWidth], l = Array.isArray(s) ? Zt(s, (h) => h.test(i)) : (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
      zt(s, (h) => h.test(i))
    );
    let c;
    c = e.valueCallback ? e.valueCallback(l) : l, c = n.valueCallback ? (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
      n.valueCallback(c)
    ) : c;
    const u = t.slice(i.length);
    return { value: c, rest: u };
  };
}
function zt(e, t) {
  for (const n in e)
    if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
      return n;
}
function Zt(e, t) {
  for (let n = 0; n < e.length; n++)
    if (t(e[n]))
      return n;
}
function en(e) {
  return (t, n = {}) => {
    const a = t.match(e.matchPattern);
    if (!a)
      return null;
    const r = a[0], o = t.match(e.parsePattern);
    if (!o)
      return null;
    let i = e.valueCallback ? e.valueCallback(o[0]) : o[0];
    i = n.valueCallback ? n.valueCallback(i) : i;
    const s = t.slice(r.length);
    return { value: i, rest: s };
  };
}
const tn = /^(\d+)(th|st|nd|rd)?/i, nn = /\d+/i, an = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
}, rn = {
  any: [/^b/i, /^(a|c)/i]
}, on = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, sn = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, ln = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, un = {
  narrow: [
    /^j/i,
    /^f/i,
    /^m/i,
    /^a/i,
    /^m/i,
    /^j/i,
    /^j/i,
    /^a/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ],
  any: [
    /^ja/i,
    /^f/i,
    /^mar/i,
    /^ap/i,
    /^may/i,
    /^jun/i,
    /^jul/i,
    /^au/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ]
}, cn = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, dn = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, fn = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, hn = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
}, mn = {
  ordinalNumber: en({
    matchPattern: tn,
    parsePattern: nn,
    valueCallback: (e) => parseInt(e, 10)
  }),
  era: U({
    matchPatterns: an,
    defaultMatchWidth: "wide",
    parsePatterns: rn,
    defaultParseWidth: "any"
  }),
  quarter: U({
    matchPatterns: on,
    defaultMatchWidth: "wide",
    parsePatterns: sn,
    defaultParseWidth: "any",
    valueCallback: (e) => e + 1
  }),
  month: U({
    matchPatterns: ln,
    defaultMatchWidth: "wide",
    parsePatterns: un,
    defaultParseWidth: "any"
  }),
  day: U({
    matchPatterns: cn,
    defaultMatchWidth: "wide",
    parsePatterns: dn,
    defaultParseWidth: "any"
  }),
  dayPeriod: U({
    matchPatterns: fn,
    defaultMatchWidth: "any",
    parsePatterns: hn,
    defaultParseWidth: "any"
  })
}, $e = {
  code: "en-US",
  formatDistance: It,
  formatLong: Ht,
  formatRelative: qt,
  localize: Kt,
  match: mn,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
function vn(e) {
  const t = M(e);
  return L(t, Ge(t)) + 1;
}
function Ue(e) {
  const t = M(e), n = +A(t) - +St(t);
  return Math.round(n / De) + 1;
}
function Je(e, t) {
  var u, h, m, f;
  const n = M(e), a = n.getFullYear(), r = Z(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((h = (u = t == null ? void 0 : t.locale) == null ? void 0 : u.options) == null ? void 0 : h.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((f = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = W(e, 0);
  i.setFullYear(a + 1, 0, o), i.setHours(0, 0, 0, 0);
  const s = I(i, t), l = W(e, 0);
  l.setFullYear(a, 0, o), l.setHours(0, 0, 0, 0);
  const c = I(l, t);
  return n.getTime() >= s.getTime() ? a + 1 : n.getTime() >= c.getTime() ? a : a - 1;
}
function yn(e, t) {
  var s, l, c, u;
  const n = Z(), a = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((l = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : l.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((u = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : u.firstWeekContainsDate) ?? 1, r = Je(e, t), o = W(e, 0);
  return o.setFullYear(r, 0, a), o.setHours(0, 0, 0, 0), I(o, t);
}
function Ke(e, t) {
  const n = M(e), a = +I(n, t) - +yn(n, t);
  return Math.round(a / De) + 1;
}
function _(e, t) {
  const n = e < 0 ? "-" : "", a = Math.abs(e).toString().padStart(t, "0");
  return n + a;
}
const B = {
  // Year
  y(e, t) {
    const n = e.getFullYear(), a = n > 0 ? n : 1 - n;
    return _(t === "yy" ? a % 100 : a, t.length);
  },
  // Month
  M(e, t) {
    const n = e.getMonth();
    return t === "M" ? String(n + 1) : _(n + 1, 2);
  },
  // Day of the month
  d(e, t) {
    return _(e.getDate(), t.length);
  },
  // AM or PM
  a(e, t) {
    const n = e.getHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return n.toUpperCase();
      case "aaa":
        return n;
      case "aaaaa":
        return n[0];
      case "aaaa":
      default:
        return n === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h(e, t) {
    return _(e.getHours() % 12 || 12, t.length);
  },
  // Hour [0-23]
  H(e, t) {
    return _(e.getHours(), t.length);
  },
  // Minute
  m(e, t) {
    return _(e.getMinutes(), t.length);
  },
  // Second
  s(e, t) {
    return _(e.getSeconds(), t.length);
  },
  // Fraction of second
  S(e, t) {
    const n = t.length, a = e.getMilliseconds(), r = Math.trunc(
      a * Math.pow(10, n - 3)
    );
    return _(r, t.length);
  }
}, X = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, Ee = {
  // Era
  G: function(e, t, n) {
    const a = e.getFullYear() > 0 ? 1 : 0;
    switch (t) {
      case "G":
      case "GG":
      case "GGG":
        return n.era(a, { width: "abbreviated" });
      case "GGGGG":
        return n.era(a, { width: "narrow" });
      case "GGGG":
      default:
        return n.era(a, { width: "wide" });
    }
  },
  // Year
  y: function(e, t, n) {
    if (t === "yo") {
      const a = e.getFullYear(), r = a > 0 ? a : 1 - a;
      return n.ordinalNumber(r, { unit: "year" });
    }
    return B.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, n, a) {
    const r = Je(e, a), o = r > 0 ? r : 1 - r;
    if (t === "YY") {
      const i = o % 100;
      return _(i, 2);
    }
    return t === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : _(o, t.length);
  },
  // ISO week-numbering year
  R: function(e, t) {
    const n = Xe(e);
    return _(n, t.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(e, t) {
    const n = e.getFullYear();
    return _(n, t.length);
  },
  // Quarter
  Q: function(e, t, n) {
    const a = Math.ceil((e.getMonth() + 1) / 3);
    switch (t) {
      case "Q":
        return String(a);
      case "QQ":
        return _(a, 2);
      case "Qo":
        return n.ordinalNumber(a, { unit: "quarter" });
      case "QQQ":
        return n.quarter(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return n.quarter(a, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return n.quarter(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(e, t, n) {
    const a = Math.ceil((e.getMonth() + 1) / 3);
    switch (t) {
      case "q":
        return String(a);
      case "qq":
        return _(a, 2);
      case "qo":
        return n.ordinalNumber(a, { unit: "quarter" });
      case "qqq":
        return n.quarter(a, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return n.quarter(a, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return n.quarter(a, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(e, t, n) {
    const a = e.getMonth();
    switch (t) {
      case "M":
      case "MM":
        return B.M(e, t);
      case "Mo":
        return n.ordinalNumber(a + 1, { unit: "month" });
      case "MMM":
        return n.month(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return n.month(a, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return n.month(a, { width: "wide", context: "formatting" });
    }
  },
  // Stand-alone month
  L: function(e, t, n) {
    const a = e.getMonth();
    switch (t) {
      case "L":
        return String(a + 1);
      case "LL":
        return _(a + 1, 2);
      case "Lo":
        return n.ordinalNumber(a + 1, { unit: "month" });
      case "LLL":
        return n.month(a, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return n.month(a, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return n.month(a, { width: "wide", context: "standalone" });
    }
  },
  // Local week of year
  w: function(e, t, n, a) {
    const r = Ke(e, a);
    return t === "wo" ? n.ordinalNumber(r, { unit: "week" }) : _(r, t.length);
  },
  // ISO week of year
  I: function(e, t, n) {
    const a = Ue(e);
    return t === "Io" ? n.ordinalNumber(a, { unit: "week" }) : _(a, t.length);
  },
  // Day of the month
  d: function(e, t, n) {
    return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : B.d(e, t);
  },
  // Day of year
  D: function(e, t, n) {
    const a = vn(e);
    return t === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : _(a, t.length);
  },
  // Day of week
  E: function(e, t, n) {
    const a = e.getDay();
    switch (t) {
      case "E":
      case "EE":
      case "EEE":
        return n.day(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return n.day(a, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return n.day(a, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return n.day(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(e, t, n, a) {
    const r = e.getDay(), o = (r - a.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "e":
        return String(o);
      case "ee":
        return _(o, 2);
      case "eo":
        return n.ordinalNumber(o, { unit: "day" });
      case "eee":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(e, t, n, a) {
    const r = e.getDay(), o = (r - a.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "c":
        return String(o);
      case "cc":
        return _(o, t.length);
      case "co":
        return n.ordinalNumber(o, { unit: "day" });
      case "ccc":
        return n.day(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return n.day(r, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return n.day(r, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return n.day(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(e, t, n) {
    const a = e.getDay(), r = a === 0 ? 7 : a;
    switch (t) {
      case "i":
        return String(r);
      case "ii":
        return _(r, t.length);
      case "io":
        return n.ordinalNumber(r, { unit: "day" });
      case "iii":
        return n.day(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return n.day(a, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return n.day(a, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return n.day(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(e, t, n) {
    const r = e.getHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return n.dayPeriod(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return n.dayPeriod(r, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return n.dayPeriod(r, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return n.dayPeriod(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(e, t, n) {
    const a = e.getHours();
    let r;
    switch (a === 12 ? r = X.noon : a === 0 ? r = X.midnight : r = a / 12 >= 1 ? "pm" : "am", t) {
      case "b":
      case "bb":
        return n.dayPeriod(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return n.dayPeriod(r, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return n.dayPeriod(r, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return n.dayPeriod(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(e, t, n) {
    const a = e.getHours();
    let r;
    switch (a >= 17 ? r = X.evening : a >= 12 ? r = X.afternoon : a >= 4 ? r = X.morning : r = X.night, t) {
      case "B":
      case "BB":
      case "BBB":
        return n.dayPeriod(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return n.dayPeriod(r, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return n.dayPeriod(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(e, t, n) {
    if (t === "ho") {
      let a = e.getHours() % 12;
      return a === 0 && (a = 12), n.ordinalNumber(a, { unit: "hour" });
    }
    return B.h(e, t);
  },
  // Hour [0-23]
  H: function(e, t, n) {
    return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : B.H(e, t);
  },
  // Hour [0-11]
  K: function(e, t, n) {
    const a = e.getHours() % 12;
    return t === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) : _(a, t.length);
  },
  // Hour [1-24]
  k: function(e, t, n) {
    let a = e.getHours();
    return a === 0 && (a = 24), t === "ko" ? n.ordinalNumber(a, { unit: "hour" }) : _(a, t.length);
  },
  // Minute
  m: function(e, t, n) {
    return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : B.m(e, t);
  },
  // Second
  s: function(e, t, n) {
    return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : B.s(e, t);
  },
  // Fraction of second
  S: function(e, t) {
    return B.S(e, t);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(e, t, n) {
    const a = e.getTimezoneOffset();
    if (a === 0)
      return "Z";
    switch (t) {
      case "X":
        return Re(a);
      case "XXXX":
      case "XX":
        return H(a);
      case "XXXXX":
      case "XXX":
      default:
        return H(a, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(e, t, n) {
    const a = e.getTimezoneOffset();
    switch (t) {
      case "x":
        return Re(a);
      case "xxxx":
      case "xx":
        return H(a);
      case "xxxxx":
      case "xxx":
      default:
        return H(a, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, n) {
    const a = e.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Ie(a, ":");
      case "OOOO":
      default:
        return "GMT" + H(a, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, n) {
    const a = e.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Ie(a, ":");
      case "zzzz":
      default:
        return "GMT" + H(a, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, n) {
    const a = Math.trunc(e.getTime() / 1e3);
    return _(a, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, n) {
    const a = e.getTime();
    return _(a, t.length);
  }
};
function Ie(e, t = "") {
  const n = e > 0 ? "-" : "+", a = Math.abs(e), r = Math.trunc(a / 60), o = a % 60;
  return o === 0 ? n + String(r) : n + String(r) + t + _(o, 2);
}
function Re(e, t) {
  return e % 60 === 0 ? (e > 0 ? "-" : "+") + _(Math.abs(e) / 60, 2) : H(e, t);
}
function H(e, t = "") {
  const n = e > 0 ? "-" : "+", a = Math.abs(e), r = _(Math.trunc(a / 60), 2), o = _(a % 60, 2);
  return n + r + t + o;
}
const Be = (e, t) => {
  switch (e) {
    case "P":
      return t.date({ width: "short" });
    case "PP":
      return t.date({ width: "medium" });
    case "PPP":
      return t.date({ width: "long" });
    case "PPPP":
    default:
      return t.date({ width: "full" });
  }
}, ze = (e, t) => {
  switch (e) {
    case "p":
      return t.time({ width: "short" });
    case "pp":
      return t.time({ width: "medium" });
    case "ppp":
      return t.time({ width: "long" });
    case "pppp":
    default:
      return t.time({ width: "full" });
  }
}, bn = (e, t) => {
  const n = e.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
  if (!r)
    return Be(e, t);
  let o;
  switch (a) {
    case "P":
      o = t.dateTime({ width: "short" });
      break;
    case "PP":
      o = t.dateTime({ width: "medium" });
      break;
    case "PPP":
      o = t.dateTime({ width: "long" });
      break;
    case "PPPP":
    default:
      o = t.dateTime({ width: "full" });
      break;
  }
  return o.replace("{{date}}", Be(a, t)).replace("{{time}}", ze(r, t));
}, gn = {
  p: ze,
  P: bn
}, wn = /^D+$/, pn = /^Y+$/, Dn = ["D", "DD", "YY", "YYYY"];
function Mn(e) {
  return wn.test(e);
}
function _n(e) {
  return pn.test(e);
}
function kn(e, t, n) {
  const a = Nn(e, t, n);
  if (console.warn(a), Dn.includes(e))
    throw new RangeError(a);
}
function Nn(e, t, n) {
  const a = e[0] === "Y" ? "years" : "days of the month";
  return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}
const xn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Pn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, On = /^'([^]*?)'?$/, Cn = /''/g, Sn = /[a-zA-Z]/;
function E(e, t, n) {
  var u, h, m, f, y, D, w, N;
  const a = Z(), r = (n == null ? void 0 : n.locale) ?? a.locale ?? $e, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((h = (u = n == null ? void 0 : n.locale) == null ? void 0 : u.options) == null ? void 0 : h.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((f = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = (n == null ? void 0 : n.weekStartsOn) ?? ((D = (y = n == null ? void 0 : n.locale) == null ? void 0 : y.options) == null ? void 0 : D.weekStartsOn) ?? a.weekStartsOn ?? ((N = (w = a.locale) == null ? void 0 : w.options) == null ? void 0 : N.weekStartsOn) ?? 0, s = M(e);
  if (!Ft(s))
    throw new RangeError("Invalid time value");
  let l = t.match(Pn).map((p) => {
    const x = p[0];
    if (x === "p" || x === "P") {
      const j = gn[x];
      return j(p, r.formatLong);
    }
    return p;
  }).join("").match(xn).map((p) => {
    if (p === "''")
      return { isToken: !1, value: "'" };
    const x = p[0];
    if (x === "'")
      return { isToken: !1, value: Wn(p) };
    if (Ee[x])
      return { isToken: !0, value: p };
    if (x.match(Sn))
      throw new RangeError(
        "Format string contains an unescaped latin alphabet character `" + x + "`"
      );
    return { isToken: !1, value: p };
  });
  r.localize.preprocessor && (l = r.localize.preprocessor(s, l));
  const c = {
    firstWeekContainsDate: o,
    weekStartsOn: i,
    locale: r
  };
  return l.map((p) => {
    if (!p.isToken)
      return p.value;
    const x = p.value;
    (!(n != null && n.useAdditionalWeekYearTokens) && _n(x) || !(n != null && n.useAdditionalDayOfYearTokens) && Mn(x)) && kn(x, t, String(e));
    const j = Ee[x[0]];
    return j(s, x, r.localize, c);
  }).join("");
}
function Wn(e) {
  const t = e.match(On);
  return t ? t[1].replace(Cn, "'") : e;
}
function Tn(e) {
  const t = M(e), n = t.getFullYear(), a = t.getMonth(), r = W(e, 0);
  return r.setFullYear(n, a + 1, 0), r.setHours(0, 0, 0, 0), r.getDate();
}
function Yn(e) {
  return Math.trunc(+M(e) / 1e3);
}
function Fn(e) {
  const t = M(e), n = t.getMonth();
  return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(0, 0, 0, 0), t;
}
function Ln(e, t) {
  return Lt(
    Fn(e),
    S(e),
    t
  ) + 1;
}
function pe(e, t) {
  const n = M(e), a = M(t);
  return n.getTime() > a.getTime();
}
function Ze(e, t) {
  const n = M(e), a = M(t);
  return +n < +a;
}
function Ne(e, t) {
  const n = M(e), a = M(t);
  return n.getFullYear() === a.getFullYear() && n.getMonth() === a.getMonth();
}
function En(e, t) {
  const n = M(e), a = M(t);
  return n.getFullYear() === a.getFullYear();
}
function he(e, t) {
  return P(e, -t);
}
function me(e, t) {
  const n = M(e), a = n.getFullYear(), r = n.getDate(), o = W(e, 0);
  o.setFullYear(a, t, 15), o.setHours(0, 0, 0, 0);
  const i = Tn(o);
  return n.setMonth(t, Math.min(r, i)), n;
}
function je(e, t) {
  const n = M(e);
  return isNaN(+n) ? W(e, NaN) : (n.setFullYear(t), n);
}
var b = function() {
  return b = Object.assign || function(t) {
    for (var n, a = 1, r = arguments.length; a < r; a++) {
      n = arguments[a];
      for (var o in n)
        Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
    }
    return t;
  }, b.apply(this, arguments);
};
function In(e, t) {
  var n = {};
  for (var a in e)
    Object.prototype.hasOwnProperty.call(e, a) && t.indexOf(a) < 0 && (n[a] = e[a]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var r = 0, a = Object.getOwnPropertySymbols(e); r < a.length; r++)
      t.indexOf(a[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, a[r]) && (n[a[r]] = e[a[r]]);
  return n;
}
function et(e, t, n) {
  if (n || arguments.length === 2)
    for (var a = 0, r = t.length, o; a < r; a++)
      (o || !(a in t)) && (o || (o = Array.prototype.slice.call(t, 0, a)), o[a] = t[a]);
  return e.concat(o || Array.prototype.slice.call(t));
}
function ee(e) {
  return e.mode === "multiple";
}
function te(e) {
  return e.mode === "range";
}
function se(e) {
  return e.mode === "single";
}
var Rn = {
  root: "rdp",
  multiple_months: "rdp-multiple_months",
  with_weeknumber: "rdp-with_weeknumber",
  vhidden: "rdp-vhidden",
  button_reset: "rdp-button_reset",
  button: "rdp-button",
  caption: "rdp-caption",
  caption_start: "rdp-caption_start",
  caption_end: "rdp-caption_end",
  caption_between: "rdp-caption_between",
  caption_label: "rdp-caption_label",
  caption_dropdowns: "rdp-caption_dropdowns",
  dropdown: "rdp-dropdown",
  dropdown_month: "rdp-dropdown_month",
  dropdown_year: "rdp-dropdown_year",
  dropdown_icon: "rdp-dropdown_icon",
  months: "rdp-months",
  month: "rdp-month",
  table: "rdp-table",
  tbody: "rdp-tbody",
  tfoot: "rdp-tfoot",
  head: "rdp-head",
  head_row: "rdp-head_row",
  head_cell: "rdp-head_cell",
  nav: "rdp-nav",
  nav_button: "rdp-nav_button",
  nav_button_previous: "rdp-nav_button_previous",
  nav_button_next: "rdp-nav_button_next",
  nav_icon: "rdp-nav_icon",
  row: "rdp-row",
  weeknumber: "rdp-weeknumber",
  cell: "rdp-cell",
  day: "rdp-day",
  day_today: "rdp-day_today",
  day_outside: "rdp-day_outside",
  day_selected: "rdp-day_selected",
  day_disabled: "rdp-day_disabled",
  day_hidden: "rdp-day_hidden",
  day_range_start: "rdp-day_range_start",
  day_range_end: "rdp-day_range_end",
  day_range_middle: "rdp-day_range_middle"
};
function Bn(e, t) {
  return E(e, "LLLL y", t);
}
function jn(e, t) {
  return E(e, "d", t);
}
function Hn(e, t) {
  return E(e, "LLLL", t);
}
function An(e) {
  return "".concat(e);
}
function qn(e, t) {
  return E(e, "cccccc", t);
}
function Qn(e, t) {
  return E(e, "yyyy", t);
}
var Xn = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  formatCaption: Bn,
  formatDay: jn,
  formatMonthCaption: Hn,
  formatWeekNumber: An,
  formatWeekdayName: qn,
  formatYearCaption: Qn
}), Gn = function(e, t, n) {
  return E(e, "do MMMM (EEEE)", n);
}, Vn = function() {
  return "Month: ";
}, $n = function() {
  return "Go to next month";
}, Un = function() {
  return "Go to previous month";
}, Jn = function(e, t) {
  return E(e, "cccc", t);
}, Kn = function(e) {
  return "Week n. ".concat(e);
}, zn = function() {
  return "Year: ";
}, Zn = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  labelDay: Gn,
  labelMonthDropdown: Vn,
  labelNext: $n,
  labelPrevious: Un,
  labelWeekNumber: Kn,
  labelWeekday: Jn,
  labelYearDropdown: zn
});
function ea() {
  var e = "buttons", t = Rn, n = $e, a = {}, r = {}, o = 1, i = {}, s = /* @__PURE__ */ new Date();
  return {
    captionLayout: e,
    classNames: t,
    formatters: Xn,
    labels: Zn,
    locale: n,
    modifiersClassNames: a,
    modifiers: r,
    numberOfMonths: o,
    styles: i,
    today: s,
    mode: "default"
  };
}
function ta(e) {
  var t = e.fromYear, n = e.toYear, a = e.fromMonth, r = e.toMonth, o = e.fromDate, i = e.toDate;
  return a ? o = S(a) : t && (o = new Date(t, 0, 1)), r ? i = _e(r) : n && (i = new Date(n, 11, 31)), {
    fromDate: o ? G(o) : void 0,
    toDate: i ? G(i) : void 0
  };
}
var tt = q(void 0);
function na(e) {
  var t, n = e.initialProps, a = ea(), r = ta(n), o = r.fromDate, i = r.toDate, s = (t = n.captionLayout) !== null && t !== void 0 ? t : a.captionLayout;
  s !== "buttons" && (!o || !i) && (s = "buttons");
  var l;
  (se(n) || ee(n) || te(n)) && (l = n.onSelect);
  var c = b(b(b({}, a), n), { captionLayout: s, classNames: b(b({}, a.classNames), n.classNames), components: b({}, n.components), formatters: b(b({}, a.formatters), n.formatters), fromDate: o, labels: b(b({}, a.labels), n.labels), mode: n.mode || a.mode, modifiers: b(b({}, a.modifiers), n.modifiers), modifiersClassNames: b(b({}, a.modifiersClassNames), n.modifiersClassNames), onSelect: l, styles: b(b({}, a.styles), n.styles), toDate: i });
  return d(tt.Provider, { value: c, children: e.children });
}
function k() {
  var e = Q(tt);
  if (!e)
    throw new Error("useDayPicker must be used within a DayPickerProvider.");
  return e;
}
function nt(e) {
  var t = k(), n = t.locale, a = t.classNames, r = t.styles, o = t.formatters.formatCaption;
  return d("div", { className: a.caption_label, style: r.caption_label, "aria-live": "polite", role: "presentation", id: e.id, children: o(e.displayMonth, { locale: n }) });
}
function aa(e) {
  return d("svg", b({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, e, { children: d("path", { d: "M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z", fill: "currentColor", fillRule: "nonzero" }) }));
}
function at(e) {
  var t, n, a = e.onChange, r = e.value, o = e.children, i = e.caption, s = e.className, l = e.style, c = k(), u = (n = (t = c.components) === null || t === void 0 ? void 0 : t.IconDropdown) !== null && n !== void 0 ? n : aa;
  return O("div", { className: s, style: l, children: [d("span", { className: c.classNames.vhidden, children: e["aria-label"] }), d("select", { name: e.name, "aria-label": e["aria-label"], className: c.classNames.dropdown, style: c.styles.dropdown, value: r, onChange: a, children: o }), O("div", { className: c.classNames.caption_label, style: c.styles.caption_label, "aria-hidden": "true", children: [i, d(u, { className: c.classNames.dropdown_icon, style: c.styles.dropdown_icon })] })] });
}
function ra(e) {
  var t, n = k(), a = n.fromDate, r = n.toDate, o = n.styles, i = n.locale, s = n.formatters.formatMonthCaption, l = n.classNames, c = n.components, u = n.labels.labelMonthDropdown;
  if (!a)
    return d(T, {});
  if (!r)
    return d(T, {});
  var h = [];
  if (En(a, r))
    for (var m = S(a), f = a.getMonth(); f <= r.getMonth(); f++)
      h.push(me(m, f));
  else
    for (var m = S(/* @__PURE__ */ new Date()), f = 0; f <= 11; f++)
      h.push(me(m, f));
  var y = function(w) {
    var N = Number(w.target.value), p = me(S(e.displayMonth), N);
    e.onChange(p);
  }, D = (t = c == null ? void 0 : c.Dropdown) !== null && t !== void 0 ? t : at;
  return d(D, { name: "months", "aria-label": u(), className: l.dropdown_month, style: o.dropdown_month, onChange: y, value: e.displayMonth.getMonth(), caption: s(e.displayMonth, { locale: i }), children: h.map(function(w) {
    return d("option", { value: w.getMonth(), children: s(w, { locale: i }) }, w.getMonth());
  }) });
}
function oa(e) {
  var t, n = e.displayMonth, a = k(), r = a.fromDate, o = a.toDate, i = a.locale, s = a.styles, l = a.classNames, c = a.components, u = a.formatters.formatYearCaption, h = a.labels.labelYearDropdown, m = [];
  if (!r)
    return d(T, {});
  if (!o)
    return d(T, {});
  for (var f = r.getFullYear(), y = o.getFullYear(), D = f; D <= y; D++)
    m.push(je(Ge(/* @__PURE__ */ new Date()), D));
  var w = function(p) {
    var x = je(S(n), Number(p.target.value));
    e.onChange(x);
  }, N = (t = c == null ? void 0 : c.Dropdown) !== null && t !== void 0 ? t : at;
  return d(N, { name: "years", "aria-label": h(), className: l.dropdown_year, style: s.dropdown_year, onChange: w, value: n.getFullYear(), caption: u(n, { locale: i }), children: m.map(function(p) {
    return d("option", { value: p.getFullYear(), children: u(p, { locale: i }) }, p.getFullYear());
  }) });
}
function ia(e, t) {
  var n = K(e), a = n[0], r = n[1], o = t === void 0 ? a : t;
  return [o, r];
}
function sa(e) {
  var t = e.month, n = e.defaultMonth, a = e.today, r = t || n || a || /* @__PURE__ */ new Date(), o = e.toDate, i = e.fromDate, s = e.numberOfMonths, l = s === void 0 ? 1 : s;
  if (o && z(o, r) < 0) {
    var c = -1 * (l - 1);
    r = Y(o, c);
  }
  return i && z(r, i) < 0 && (r = i), S(r);
}
function la() {
  var e = k(), t = sa(e), n = ia(t, e.month), a = n[0], r = n[1], o = function(i) {
    var s;
    if (!e.disableNavigation) {
      var l = S(i);
      r(l), (s = e.onMonthChange) === null || s === void 0 || s.call(e, l);
    }
  };
  return [a, o];
}
function ua(e, t) {
  for (var n = t.reverseMonths, a = t.numberOfMonths, r = S(e), o = S(Y(r, a)), i = z(o, r), s = [], l = 0; l < i; l++) {
    var c = Y(r, l);
    s.push(c);
  }
  return n && (s = s.reverse()), s;
}
function ca(e, t) {
  if (!t.disableNavigation) {
    var n = t.toDate, a = t.pagedNavigation, r = t.numberOfMonths, o = r === void 0 ? 1 : r, i = a ? o : 1, s = S(e);
    if (!n)
      return Y(s, i);
    var l = z(n, e);
    if (!(l < o))
      return Y(s, i);
  }
}
function da(e, t) {
  if (!t.disableNavigation) {
    var n = t.fromDate, a = t.pagedNavigation, r = t.numberOfMonths, o = r === void 0 ? 1 : r, i = a ? o : 1, s = S(e);
    if (!n)
      return Y(s, -i);
    var l = z(s, n);
    if (!(l <= 0))
      return Y(s, -i);
  }
}
var rt = q(void 0);
function fa(e) {
  var t = k(), n = la(), a = n[0], r = n[1], o = ua(a, t), i = ca(a, t), s = da(a, t), l = function(h) {
    return o.some(function(m) {
      return Ne(h, m);
    });
  }, c = function(h, m) {
    l(h) || (m && Ze(h, m) ? r(Y(h, 1 + t.numberOfMonths * -1)) : r(h));
  }, u = {
    currentMonth: a,
    displayMonths: o,
    goToMonth: r,
    goToDate: c,
    previousMonth: s,
    nextMonth: i,
    isDateDisplayed: l
  };
  return d(rt.Provider, { value: u, children: e.children });
}
function ne() {
  var e = Q(rt);
  if (!e)
    throw new Error("useNavigation must be used within a NavigationProvider");
  return e;
}
function He(e) {
  var t, n = k(), a = n.classNames, r = n.styles, o = n.components, i = ne().goToMonth, s = function(u) {
    i(Y(u, e.displayIndex ? -e.displayIndex : 0));
  }, l = (t = o == null ? void 0 : o.CaptionLabel) !== null && t !== void 0 ? t : nt, c = d(l, { id: e.id, displayMonth: e.displayMonth });
  return O("div", { className: a.caption_dropdowns, style: r.caption_dropdowns, children: [d("div", { className: a.vhidden, children: c }), d(ra, { onChange: s, displayMonth: e.displayMonth }), d(oa, { onChange: s, displayMonth: e.displayMonth })] });
}
function ha(e) {
  return d("svg", b({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: d("path", { d: "M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z", fill: "currentColor", fillRule: "nonzero" }) }));
}
function ma(e) {
  return d("svg", b({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: d("path", { d: "M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z", fill: "currentColor" }) }));
}
var oe = Nt(function(e, t) {
  var n = k(), a = n.classNames, r = n.styles, o = [a.button_reset, a.button];
  e.className && o.push(e.className);
  var i = o.join(" "), s = b(b({}, r.button_reset), r.button);
  return e.style && Object.assign(s, e.style), d("button", b({}, e, { ref: t, type: "button", className: i, style: s }));
});
function va(e) {
  var t, n, a = k(), r = a.dir, o = a.locale, i = a.classNames, s = a.styles, l = a.labels, c = l.labelPrevious, u = l.labelNext, h = a.components;
  if (!e.nextMonth && !e.previousMonth)
    return d(T, {});
  var m = c(e.previousMonth, { locale: o }), f = [
    i.nav_button,
    i.nav_button_previous
  ].join(" "), y = u(e.nextMonth, { locale: o }), D = [
    i.nav_button,
    i.nav_button_next
  ].join(" "), w = (t = h == null ? void 0 : h.IconRight) !== null && t !== void 0 ? t : ma, N = (n = h == null ? void 0 : h.IconLeft) !== null && n !== void 0 ? n : ha;
  return O("div", { className: i.nav, style: s.nav, children: [!e.hidePrevious && d(oe, { name: "previous-month", "aria-label": m, className: f, style: s.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: r === "rtl" ? d(w, { className: i.nav_icon, style: s.nav_icon }) : d(N, { className: i.nav_icon, style: s.nav_icon }) }), !e.hideNext && d(oe, { name: "next-month", "aria-label": y, className: D, style: s.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: r === "rtl" ? d(N, { className: i.nav_icon, style: s.nav_icon }) : d(w, { className: i.nav_icon, style: s.nav_icon }) })] });
}
function Ae(e) {
  var t = k().numberOfMonths, n = ne(), a = n.previousMonth, r = n.nextMonth, o = n.goToMonth, i = n.displayMonths, s = i.findIndex(function(y) {
    return Ne(e.displayMonth, y);
  }), l = s === 0, c = s === i.length - 1, u = t > 1 && (l || !c), h = t > 1 && (c || !l), m = function() {
    a && o(a);
  }, f = function() {
    r && o(r);
  };
  return d(va, { displayMonth: e.displayMonth, hideNext: u, hidePrevious: h, nextMonth: r, previousMonth: a, onPreviousClick: m, onNextClick: f });
}
function ya(e) {
  var t, n = k(), a = n.classNames, r = n.disableNavigation, o = n.styles, i = n.captionLayout, s = n.components, l = (t = s == null ? void 0 : s.CaptionLabel) !== null && t !== void 0 ? t : nt, c;
  return r ? c = d(l, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? c = d(He, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? c = O(T, { children: [d(He, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), d(Ae, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : c = O(T, { children: [d(l, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), d(Ae, { displayMonth: e.displayMonth, id: e.id })] }), d("div", { className: a.caption, style: o.caption, children: c });
}
function ba(e) {
  var t = k(), n = t.footer, a = t.styles, r = t.classNames.tfoot;
  return n ? d("tfoot", { className: r, style: a.tfoot, children: d("tr", { children: d("td", { colSpan: 8, children: n }) }) }) : d(T, {});
}
function ga(e, t, n) {
  for (var a = n ? A(/* @__PURE__ */ new Date()) : I(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: t }), r = [], o = 0; o < 7; o++) {
    var i = P(a, o);
    r.push(i);
  }
  return r;
}
function wa() {
  var e = k(), t = e.classNames, n = e.styles, a = e.showWeekNumber, r = e.locale, o = e.weekStartsOn, i = e.ISOWeek, s = e.formatters.formatWeekdayName, l = e.labels.labelWeekday, c = ga(r, o, i);
  return O("tr", { style: n.head_row, className: t.head_row, children: [a && d("td", { style: n.head_cell, className: t.head_cell }), c.map(function(u, h) {
    return d("th", { scope: "col", className: t.head_cell, style: n.head_cell, "aria-label": l(u, { locale: r }), children: s(u, { locale: r }) }, h);
  })] });
}
function pa() {
  var e, t = k(), n = t.classNames, a = t.styles, r = t.components, o = (e = r == null ? void 0 : r.HeadRow) !== null && e !== void 0 ? e : wa;
  return d("thead", { style: a.head, className: n.head, children: d(o, {}) });
}
function Da(e) {
  var t = k(), n = t.locale, a = t.formatters.formatDay;
  return d(T, { children: a(e.date, { locale: n }) });
}
var xe = q(void 0);
function Ma(e) {
  if (!ee(e.initialProps)) {
    var t = {
      selected: void 0,
      modifiers: {
        disabled: []
      }
    };
    return d(xe.Provider, { value: t, children: e.children });
  }
  return d(_a, { initialProps: e.initialProps, children: e.children });
}
function _a(e) {
  var t = e.initialProps, n = e.children, a = t.selected, r = t.min, o = t.max, i = function(c, u, h) {
    var m, f;
    (m = t.onDayClick) === null || m === void 0 || m.call(t, c, u, h);
    var y = !!(u.selected && r && (a == null ? void 0 : a.length) === r);
    if (!y) {
      var D = !!(!u.selected && o && (a == null ? void 0 : a.length) === o);
      if (!D) {
        var w = a ? et([], a, !0) : [];
        if (u.selected) {
          var N = w.findIndex(function(p) {
            return C(c, p);
          });
          w.splice(N, 1);
        } else
          w.push(c);
        (f = t.onSelect) === null || f === void 0 || f.call(t, w, c, u, h);
      }
    }
  }, s = {
    disabled: []
  };
  a && s.disabled.push(function(c) {
    var u = o && a.length > o - 1, h = a.some(function(m) {
      return C(m, c);
    });
    return !!(u && !h);
  });
  var l = {
    selected: a,
    onDayClick: i,
    modifiers: s
  };
  return d(xe.Provider, { value: l, children: n });
}
function Pe() {
  var e = Q(xe);
  if (!e)
    throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");
  return e;
}
function ka(e, t) {
  var n = t || {}, a = n.from, r = n.to;
  return a && r ? C(r, e) && C(a, e) ? void 0 : C(r, e) ? { from: r, to: void 0 } : C(a, e) ? void 0 : pe(a, e) ? { from: e, to: r } : { from: a, to: e } : r ? pe(e, r) ? { from: r, to: e } : { from: e, to: r } : a ? Ze(e, a) ? { from: e, to: a } : { from: a, to: e } : { from: e, to: void 0 };
}
var Oe = q(void 0);
function Na(e) {
  if (!te(e.initialProps)) {
    var t = {
      selected: void 0,
      modifiers: {
        range_start: [],
        range_end: [],
        range_middle: [],
        disabled: []
      }
    };
    return d(Oe.Provider, { value: t, children: e.children });
  }
  return d(xa, { initialProps: e.initialProps, children: e.children });
}
function xa(e) {
  var t = e.initialProps, n = e.children, a = t.selected, r = a || {}, o = r.from, i = r.to, s = t.min, l = t.max, c = function(f, y, D) {
    var w, N;
    (w = t.onDayClick) === null || w === void 0 || w.call(t, f, y, D);
    var p = ka(f, a);
    (N = t.onSelect) === null || N === void 0 || N.call(t, p, f, y, D);
  }, u = {
    range_start: [],
    range_end: [],
    range_middle: [],
    disabled: []
  };
  if (o ? (u.range_start = [o], i ? (u.range_end = [i], C(o, i) || (u.range_middle = [
    {
      after: o,
      before: i
    }
  ])) : u.range_end = [o]) : i && (u.range_start = [i], u.range_end = [i]), s && (o && !i && u.disabled.push({
    after: he(o, s - 1),
    before: P(o, s - 1)
  }), o && i && u.disabled.push({
    after: o,
    before: P(o, s - 1)
  }), !o && i && u.disabled.push({
    after: he(i, s - 1),
    before: P(i, s - 1)
  })), l) {
    if (o && !i && (u.disabled.push({
      before: P(o, -l + 1)
    }), u.disabled.push({
      after: P(o, l - 1)
    })), o && i) {
      var h = L(i, o) + 1, m = l - h;
      u.disabled.push({
        before: he(o, m)
      }), u.disabled.push({
        after: P(i, m)
      });
    }
    !o && i && (u.disabled.push({
      before: P(i, -l + 1)
    }), u.disabled.push({
      after: P(i, l - 1)
    }));
  }
  return d(Oe.Provider, { value: { selected: a, onDayClick: c, modifiers: u }, children: n });
}
function Ce() {
  var e = Q(Oe);
  if (!e)
    throw new Error("useSelectRange must be used within a SelectRangeProvider");
  return e;
}
function ae(e) {
  return Array.isArray(e) ? et([], e, !0) : e !== void 0 ? [e] : [];
}
function Pa(e) {
  var t = {};
  return Object.entries(e).forEach(function(n) {
    var a = n[0], r = n[1];
    t[a] = ae(r);
  }), t;
}
var F;
(function(e) {
  e.Outside = "outside", e.Disabled = "disabled", e.Selected = "selected", e.Hidden = "hidden", e.Today = "today", e.RangeStart = "range_start", e.RangeEnd = "range_end", e.RangeMiddle = "range_middle";
})(F || (F = {}));
var Oa = F.Selected, R = F.Disabled, Ca = F.Hidden, Sa = F.Today, ve = F.RangeEnd, ye = F.RangeMiddle, be = F.RangeStart, Wa = F.Outside;
function Ta(e, t, n) {
  var a, r = (a = {}, a[Oa] = ae(e.selected), a[R] = ae(e.disabled), a[Ca] = ae(e.hidden), a[Sa] = [e.today], a[ve] = [], a[ye] = [], a[be] = [], a[Wa] = [], a);
  return e.fromDate && r[R].push({ before: e.fromDate }), e.toDate && r[R].push({ after: e.toDate }), ee(e) ? r[R] = r[R].concat(t.modifiers[R]) : te(e) && (r[R] = r[R].concat(n.modifiers[R]), r[be] = n.modifiers[be], r[ye] = n.modifiers[ye], r[ve] = n.modifiers[ve]), r;
}
var ot = q(void 0);
function Ya(e) {
  var t = k(), n = Pe(), a = Ce(), r = Ta(t, n, a), o = Pa(t.modifiers), i = b(b({}, r), o);
  return d(ot.Provider, { value: i, children: e.children });
}
function it() {
  var e = Q(ot);
  if (!e)
    throw new Error("useModifiers must be used within a ModifiersProvider");
  return e;
}
function Fa(e) {
  return !!(e && typeof e == "object" && "before" in e && "after" in e);
}
function La(e) {
  return !!(e && typeof e == "object" && "from" in e);
}
function Ea(e) {
  return !!(e && typeof e == "object" && "after" in e);
}
function Ia(e) {
  return !!(e && typeof e == "object" && "before" in e);
}
function Ra(e) {
  return !!(e && typeof e == "object" && "dayOfWeek" in e);
}
function Ba(e, t) {
  var n, a = t.from, r = t.to;
  if (a && r) {
    var o = L(r, a) < 0;
    o && (n = [r, a], a = n[0], r = n[1]);
    var i = L(e, a) >= 0 && L(r, e) >= 0;
    return i;
  }
  return r ? C(r, e) : a ? C(a, e) : !1;
}
function ja(e) {
  return Me(e);
}
function Ha(e) {
  return Array.isArray(e) && e.every(Me);
}
function Aa(e, t) {
  return t.some(function(n) {
    if (typeof n == "boolean")
      return n;
    if (ja(n))
      return C(e, n);
    if (Ha(n))
      return n.includes(e);
    if (La(n))
      return Ba(e, n);
    if (Ra(n))
      return n.dayOfWeek.includes(e.getDay());
    if (Fa(n)) {
      var a = L(n.before, e), r = L(n.after, e), o = a > 0, i = r < 0, s = pe(n.before, n.after);
      return s ? i && o : o || i;
    }
    return Ea(n) ? L(e, n.after) > 0 : Ia(n) ? L(n.before, e) > 0 : typeof n == "function" ? n(e) : !1;
  });
}
function Se(e, t, n) {
  var a = Object.keys(t).reduce(function(o, i) {
    var s = t[i];
    return Aa(e, s) && o.push(i), o;
  }, []), r = {};
  return a.forEach(function(o) {
    return r[o] = !0;
  }), n && !Ne(e, n) && (r.outside = !0), r;
}
function qa(e, t) {
  for (var n = S(e[0]), a = _e(e[e.length - 1]), r, o, i = n; i <= a; ) {
    var s = Se(i, t), l = !s.disabled && !s.hidden;
    if (!l) {
      i = P(i, 1);
      continue;
    }
    if (s.selected)
      return i;
    s.today && !o && (o = i), r || (r = i), i = P(i, 1);
  }
  return o || r;
}
var Qa = 365;
function st(e, t) {
  var n = t.moveBy, a = t.direction, r = t.context, o = t.modifiers, i = t.retry, s = i === void 0 ? { count: 0, lastFocused: e } : i, l = r.weekStartsOn, c = r.fromDate, u = r.toDate, h = r.locale, m = {
    day: P,
    week: we,
    month: Y,
    year: Wt,
    startOfWeek: function(w) {
      return r.ISOWeek ? A(w) : I(w, { locale: h, weekStartsOn: l });
    },
    endOfWeek: function(w) {
      return r.ISOWeek ? Ve(w) : ke(w, { locale: h, weekStartsOn: l });
    }
  }, f = m[n](e, a === "after" ? 1 : -1);
  a === "before" && c ? f = Tt([c, f]) : a === "after" && u && (f = Yt([u, f]));
  var y = !0;
  if (o) {
    var D = Se(f, o);
    y = !D.disabled && !D.hidden;
  }
  return y ? f : s.count > Qa ? s.lastFocused : st(f, {
    moveBy: n,
    direction: a,
    context: r,
    modifiers: o,
    retry: b(b({}, s), { count: s.count + 1 })
  });
}
var lt = q(void 0);
function Xa(e) {
  var t = ne(), n = it(), a = K(), r = a[0], o = a[1], i = K(), s = i[0], l = i[1], c = qa(t.displayMonths, n), u = r ?? (s && t.isDateDisplayed(s)) ? s : c, h = function() {
    l(r), o(void 0);
  }, m = function(w) {
    o(w);
  }, f = k(), y = function(w, N) {
    if (r) {
      var p = st(r, {
        moveBy: w,
        direction: N,
        context: f,
        modifiers: n
      });
      C(r, p) || (t.goToDate(p, r), m(p));
    }
  }, D = {
    focusedDay: r,
    focusTarget: u,
    blur: h,
    focus: m,
    focusDayAfter: function() {
      return y("day", "after");
    },
    focusDayBefore: function() {
      return y("day", "before");
    },
    focusWeekAfter: function() {
      return y("week", "after");
    },
    focusWeekBefore: function() {
      return y("week", "before");
    },
    focusMonthBefore: function() {
      return y("month", "before");
    },
    focusMonthAfter: function() {
      return y("month", "after");
    },
    focusYearBefore: function() {
      return y("year", "before");
    },
    focusYearAfter: function() {
      return y("year", "after");
    },
    focusStartOfWeek: function() {
      return y("startOfWeek", "before");
    },
    focusEndOfWeek: function() {
      return y("endOfWeek", "after");
    }
  };
  return d(lt.Provider, { value: D, children: e.children });
}
function We() {
  var e = Q(lt);
  if (!e)
    throw new Error("useFocusContext must be used within a FocusProvider");
  return e;
}
function Ga(e, t) {
  var n = it(), a = Se(e, n, t);
  return a;
}
var Te = q(void 0);
function Va(e) {
  if (!se(e.initialProps)) {
    var t = {
      selected: void 0
    };
    return d(Te.Provider, { value: t, children: e.children });
  }
  return d($a, { initialProps: e.initialProps, children: e.children });
}
function $a(e) {
  var t = e.initialProps, n = e.children, a = function(o, i, s) {
    var l, c, u;
    if ((l = t.onDayClick) === null || l === void 0 || l.call(t, o, i, s), i.selected && !t.required) {
      (c = t.onSelect) === null || c === void 0 || c.call(t, void 0, o, i, s);
      return;
    }
    (u = t.onSelect) === null || u === void 0 || u.call(t, o, o, i, s);
  }, r = {
    selected: t.selected,
    onDayClick: a
  };
  return d(Te.Provider, { value: r, children: n });
}
function ut() {
  var e = Q(Te);
  if (!e)
    throw new Error("useSelectSingle must be used within a SelectSingleProvider");
  return e;
}
function Ua(e, t) {
  var n = k(), a = ut(), r = Pe(), o = Ce(), i = We(), s = i.focusDayAfter, l = i.focusDayBefore, c = i.focusWeekAfter, u = i.focusWeekBefore, h = i.blur, m = i.focus, f = i.focusMonthBefore, y = i.focusMonthAfter, D = i.focusYearBefore, w = i.focusYearAfter, N = i.focusStartOfWeek, p = i.focusEndOfWeek, x = function(g) {
    var v, ue, ce, de;
    se(n) ? (v = a.onDayClick) === null || v === void 0 || v.call(a, e, t, g) : ee(n) ? (ue = r.onDayClick) === null || ue === void 0 || ue.call(r, e, t, g) : te(n) ? (ce = o.onDayClick) === null || ce === void 0 || ce.call(o, e, t, g) : (de = n.onDayClick) === null || de === void 0 || de.call(n, e, t, g);
  }, j = function(g) {
    var v;
    m(e), (v = n.onDayFocus) === null || v === void 0 || v.call(n, e, t, g);
  }, le = function(g) {
    var v;
    h(), (v = n.onDayBlur) === null || v === void 0 || v.call(n, e, t, g);
  }, V = function(g) {
    var v;
    (v = n.onDayMouseEnter) === null || v === void 0 || v.call(n, e, t, g);
  }, dt = function(g) {
    var v;
    (v = n.onDayMouseLeave) === null || v === void 0 || v.call(n, e, t, g);
  }, ft = function(g) {
    var v;
    (v = n.onDayPointerEnter) === null || v === void 0 || v.call(n, e, t, g);
  }, ht = function(g) {
    var v;
    (v = n.onDayPointerLeave) === null || v === void 0 || v.call(n, e, t, g);
  }, mt = function(g) {
    var v;
    (v = n.onDayTouchCancel) === null || v === void 0 || v.call(n, e, t, g);
  }, vt = function(g) {
    var v;
    (v = n.onDayTouchEnd) === null || v === void 0 || v.call(n, e, t, g);
  }, yt = function(g) {
    var v;
    (v = n.onDayTouchMove) === null || v === void 0 || v.call(n, e, t, g);
  }, bt = function(g) {
    var v;
    (v = n.onDayTouchStart) === null || v === void 0 || v.call(n, e, t, g);
  }, gt = function(g) {
    var v;
    (v = n.onDayKeyUp) === null || v === void 0 || v.call(n, e, t, g);
  }, wt = function(g) {
    var v;
    switch (g.key) {
      case "ArrowLeft":
        g.preventDefault(), g.stopPropagation(), n.dir === "rtl" ? s() : l();
        break;
      case "ArrowRight":
        g.preventDefault(), g.stopPropagation(), n.dir === "rtl" ? l() : s();
        break;
      case "ArrowDown":
        g.preventDefault(), g.stopPropagation(), c();
        break;
      case "ArrowUp":
        g.preventDefault(), g.stopPropagation(), u();
        break;
      case "PageUp":
        g.preventDefault(), g.stopPropagation(), g.shiftKey ? D() : f();
        break;
      case "PageDown":
        g.preventDefault(), g.stopPropagation(), g.shiftKey ? w() : y();
        break;
      case "Home":
        g.preventDefault(), g.stopPropagation(), N();
        break;
      case "End":
        g.preventDefault(), g.stopPropagation(), p();
        break;
    }
    (v = n.onDayKeyDown) === null || v === void 0 || v.call(n, e, t, g);
  }, pt = {
    onClick: x,
    onFocus: j,
    onBlur: le,
    onKeyDown: wt,
    onKeyUp: gt,
    onMouseEnter: V,
    onMouseLeave: dt,
    onPointerEnter: ft,
    onPointerLeave: ht,
    onTouchCancel: mt,
    onTouchEnd: vt,
    onTouchMove: yt,
    onTouchStart: bt
  };
  return pt;
}
function Ja() {
  var e = k(), t = ut(), n = Pe(), a = Ce(), r = se(e) ? t.selected : ee(e) ? n.selected : te(e) ? a.selected : void 0;
  return r;
}
function Ka(e) {
  return Object.values(F).includes(e);
}
function za(e, t) {
  var n = [e.classNames.day];
  return Object.keys(t).forEach(function(a) {
    var r = e.modifiersClassNames[a];
    if (r)
      n.push(r);
    else if (Ka(a)) {
      var o = e.classNames["day_".concat(a)];
      o && n.push(o);
    }
  }), n;
}
function Za(e, t) {
  var n = b({}, e.styles.day);
  return Object.keys(t).forEach(function(a) {
    var r;
    n = b(b({}, n), (r = e.modifiersStyles) === null || r === void 0 ? void 0 : r[a]);
  }), n;
}
function er(e, t, n) {
  var a, r, o, i = k(), s = We(), l = Ga(e, t), c = Ua(e, l), u = Ja(), h = !!(i.onDayClick || i.mode !== "default");
  ie(function() {
    var V;
    l.outside || s.focusedDay && h && C(s.focusedDay, e) && ((V = n.current) === null || V === void 0 || V.focus());
  }, [
    s.focusedDay,
    e,
    n,
    h,
    l.outside
  ]);
  var m = za(i, l).join(" "), f = Za(i, l), y = !!(l.outside && !i.showOutsideDays || l.hidden), D = (o = (r = i.components) === null || r === void 0 ? void 0 : r.DayContent) !== null && o !== void 0 ? o : Da, w = d(D, { date: e, displayMonth: t, activeModifiers: l }), N = {
    style: f,
    className: m,
    children: w,
    role: "gridcell"
  }, p = s.focusTarget && C(s.focusTarget, e) && !l.outside, x = s.focusedDay && C(s.focusedDay, e), j = b(b(b({}, N), (a = { disabled: l.disabled, role: "gridcell" }, a["aria-selected"] = l.selected, a.tabIndex = x || p ? 0 : -1, a)), c), le = {
    isButton: h,
    isHidden: y,
    activeModifiers: l,
    selectedDays: u,
    buttonProps: j,
    divProps: N
  };
  return le;
}
function tr(e) {
  var t = Pt(null), n = er(e.date, e.displayMonth, t);
  return n.isHidden ? d("div", { role: "gridcell" }) : n.isButton ? d(oe, b({ name: "day", ref: t }, n.buttonProps)) : d("div", b({}, n.divProps));
}
function nr(e) {
  var t = e.number, n = e.dates, a = k(), r = a.onWeekNumberClick, o = a.styles, i = a.classNames, s = a.locale, l = a.labels.labelWeekNumber, c = a.formatters.formatWeekNumber, u = c(Number(t), { locale: s });
  if (!r)
    return d("span", { className: i.weeknumber, style: o.weeknumber, children: u });
  var h = l(Number(t), { locale: s }), m = function(f) {
    r(t, n, f);
  };
  return d(oe, { name: "week-number", "aria-label": h, className: i.weeknumber, style: o.weeknumber, onClick: m, children: u });
}
function ar(e) {
  var t, n, a = k(), r = a.styles, o = a.classNames, i = a.showWeekNumber, s = a.components, l = (t = s == null ? void 0 : s.Day) !== null && t !== void 0 ? t : tr, c = (n = s == null ? void 0 : s.WeekNumber) !== null && n !== void 0 ? n : nr, u;
  return i && (u = d("td", { className: o.cell, style: r.cell, children: d(c, { number: e.weekNumber, dates: e.dates }) })), O("tr", { className: o.row, style: r.row, children: [u, e.dates.map(function(h) {
    return d("td", { className: o.cell, style: r.cell, role: "presentation", children: d(l, { displayMonth: e.displayMonth, date: h }) }, Yn(h));
  })] });
}
function qe(e, t, n) {
  for (var a = n != null && n.ISOWeek ? Ve(t) : ke(t, n), r = n != null && n.ISOWeek ? A(e) : I(e, n), o = L(a, r), i = [], s = 0; s <= o; s++)
    i.push(P(r, s));
  var l = i.reduce(function(c, u) {
    var h = n != null && n.ISOWeek ? Ue(u) : Ke(u, n), m = c.find(function(f) {
      return f.weekNumber === h;
    });
    return m ? (m.dates.push(u), c) : (c.push({
      weekNumber: h,
      dates: [u]
    }), c);
  }, []);
  return l;
}
function rr(e, t) {
  var n = qe(S(e), _e(e), t);
  if (t != null && t.useFixedWeeks) {
    var a = Ln(e, t);
    if (a < 6) {
      var r = n[n.length - 1], o = r.dates[r.dates.length - 1], i = we(o, 6 - a), s = qe(we(o, 1), i, t);
      n.push.apply(n, s);
    }
  }
  return n;
}
function or(e) {
  var t, n, a, r = k(), o = r.locale, i = r.classNames, s = r.styles, l = r.hideHead, c = r.fixedWeeks, u = r.components, h = r.weekStartsOn, m = r.firstWeekContainsDate, f = r.ISOWeek, y = rr(e.displayMonth, {
    useFixedWeeks: !!c,
    ISOWeek: f,
    locale: o,
    weekStartsOn: h,
    firstWeekContainsDate: m
  }), D = (t = u == null ? void 0 : u.Head) !== null && t !== void 0 ? t : pa, w = (n = u == null ? void 0 : u.Row) !== null && n !== void 0 ? n : ar, N = (a = u == null ? void 0 : u.Footer) !== null && a !== void 0 ? a : ba;
  return O("table", { id: e.id, className: i.table, style: s.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!l && d(D, {}), d("tbody", { className: i.tbody, style: s.tbody, children: y.map(function(p) {
    return d(w, { displayMonth: e.displayMonth, dates: p.dates, weekNumber: p.weekNumber }, p.weekNumber);
  }) }), d(N, { displayMonth: e.displayMonth })] });
}
function ir() {
  return !!(typeof window < "u" && window.document && window.document.createElement);
}
var sr = ir() ? xt : ie, ge = !1, lr = 0;
function Qe() {
  return "react-day-picker-".concat(++lr);
}
function ur(e) {
  var t, n = e ?? (ge ? Qe() : null), a = K(n), r = a[0], o = a[1];
  return sr(function() {
    r === null && o(Qe());
  }, []), ie(function() {
    ge === !1 && (ge = !0);
  }, []), (t = e ?? r) !== null && t !== void 0 ? t : void 0;
}
function cr(e) {
  var t, n, a = k(), r = a.dir, o = a.classNames, i = a.styles, s = a.components, l = ne().displayMonths, c = ur(a.id ? "".concat(a.id, "-").concat(e.displayIndex) : void 0), u = a.id ? "".concat(a.id, "-grid-").concat(e.displayIndex) : void 0, h = [o.month], m = i.month, f = e.displayIndex === 0, y = e.displayIndex === l.length - 1, D = !f && !y;
  r === "rtl" && (t = [f, y], y = t[0], f = t[1]), f && (h.push(o.caption_start), m = b(b({}, m), i.caption_start)), y && (h.push(o.caption_end), m = b(b({}, m), i.caption_end)), D && (h.push(o.caption_between), m = b(b({}, m), i.caption_between));
  var w = (n = s == null ? void 0 : s.Caption) !== null && n !== void 0 ? n : ya;
  return O("div", { className: h.join(" "), style: m, children: [d(w, { id: c, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), d(or, { id: u, "aria-labelledby": c, displayMonth: e.displayMonth })] }, e.displayIndex);
}
function dr(e) {
  var t = k(), n = t.classNames, a = t.styles;
  return d("div", { className: n.months, style: a.months, children: e.children });
}
function fr(e) {
  var t, n, a = e.initialProps, r = k(), o = We(), i = ne(), s = K(!1), l = s[0], c = s[1];
  ie(function() {
    r.initialFocus && o.focusTarget && (l || (o.focus(o.focusTarget), c(!0)));
  }, [
    r.initialFocus,
    l,
    o.focus,
    o.focusTarget,
    o
  ]);
  var u = [r.classNames.root, r.className];
  r.numberOfMonths > 1 && u.push(r.classNames.multiple_months), r.showWeekNumber && u.push(r.classNames.with_weeknumber);
  var h = b(b({}, r.styles.root), r.style), m = Object.keys(a).filter(function(y) {
    return y.startsWith("data-");
  }).reduce(function(y, D) {
    var w;
    return b(b({}, y), (w = {}, w[D] = a[D], w));
  }, {}), f = (n = (t = a.components) === null || t === void 0 ? void 0 : t.Months) !== null && n !== void 0 ? n : dr;
  return d("div", b({ className: u.join(" "), style: h, dir: r.dir, id: r.id, nonce: a.nonce, title: a.title, lang: a.lang }, m, { children: d(f, { children: i.displayMonths.map(function(y, D) {
    return d(cr, { displayIndex: D, displayMonth: y }, D);
  }) }) }));
}
function hr(e) {
  var t = e.children, n = In(e, ["children"]);
  return d(na, { initialProps: n, children: d(fa, { children: d(Va, { initialProps: n, children: d(Ma, { initialProps: n, children: d(Na, { initialProps: n, children: d(Ya, { children: d(Xa, { children: t }) }) }) }) }) }) });
}
function mr(e) {
  return d(hr, b({}, e, { children: d(fr, { initialProps: e }) }));
}
function ct({
  className: e,
  classNames: t,
  fromDate: n,
  toDate: a,
  showOutsideDays: r = !0,
  ...o
}) {
  return /* @__PURE__ */ d(
    mr,
    {
      fromDate: n,
      toDate: a || void 0,
      showOutsideDays: r,
      className: J("p-3", e),
      classNames: {
        months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
        month: "space-y-4",
        caption: "flex pt-1 relative items-center justify-between",
        caption_label: "text-sm font-medium",
        nav: "flex items-center",
        head: "",
        head_row: "flex w-full items-center justify-between",
        head_cell: "w-8 md:w-11 h-8 text-sm font-medium text-default text-center",
        nav_button: J(Ye({ color: "minimal", variant: "icon" })),
        table: "w-full border-collapse space-y-1",
        row: "flex w-full mt-0.5 gap-0.5",
        cell: "w-8 h-8 md:h-11 md:w-11 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
        day: J(
          Ye({ color: "minimal" }),
          "w-8 h-8 md:h-11 md:w-11 p-0 text-sm font-medium aria-selected:opacity-100 inline-flex items-center justify-center"
        ),
        day_range_end: "hover:!bg-inverted hover:!text-inverted",
        day_range_start: "hover:!bg-inverted hover:!text-inverted",
        day_selected: "bg-inverted text-inverted",
        day_today: "",
        day_outside: "",
        day_disabled: "text-muted opacity-50",
        day_range_middle: "aria-selected:bg-emphasis aria-selected:text-emphasis",
        day_hidden: "invisible",
        ...t
      },
      components: {
        CaptionLabel: (i) => /* @__PURE__ */ O("div", { className: "px-2", children: [
          /* @__PURE__ */ O("span", { className: "text-emphasis font-semibold leading-none", children: [
            Fe(i.displayMonth).format("MMMM"),
            " "
          ] }),
          /* @__PURE__ */ d("span", { className: "text-subtle font-medium leading-none", children: Fe(i.displayMonth).format("YYYY") })
        ] }),
        IconLeft: () => /* @__PURE__ */ d(Le, { name: "chevron-left", className: "h-4 w-4 stroke-2" }),
        IconRight: () => /* @__PURE__ */ d(Le, { name: "chevron-right", className: "h-4 w-4 stroke-2" })
      },
      ...o
    }
  );
}
ct.displayName = "Calendar";
function gr({
  className: e,
  dates: t,
  minDate: n,
  maxDate: a,
  onDatesChange: r,
  disabled: o,
  withoutPopover: i,
  "data-testid": s,
  strictlyBottom: l,
  allowPastDates: c = !1
}) {
  function u(f) {
    if (c)
      if (t != null && t.endDate)
        r({ startDate: f, endDate: void 0 });
      else {
        const y = t.startDate ? f < t.startDate ? f : t.startDate : f, D = t.startDate ? f < t.startDate ? t.startDate : f : void 0;
        r({ startDate: y, endDate: D });
      }
    else
      t.startDate ? t.endDate ? f.getTime() === t.startDate.getTime() || f.getTime() === t.endDate.getTime() ? r({ startDate: f, endDate: void 0 }) : f < t.startDate ? r({ startDate: f, endDate: void 0 }) : r({ startDate: t.startDate, endDate: f }) : f < t.startDate ? r({ startDate: f, endDate: t.startDate }) : r({ startDate: t.startDate, endDate: f }) : r({ startDate: f, endDate: void 0 });
  }
  const m = /* @__PURE__ */ d(
    ct,
    {
      initialFocus: !0,
      fromDate: c && n === null ? void 0 : n ?? /* @__PURE__ */ new Date(),
      toDate: a,
      mode: "range",
      defaultMonth: t == null ? void 0 : t.startDate,
      selected: { from: t == null ? void 0 : t.startDate, to: t == null ? void 0 : t.endDate },
      onDayClick: (f) => u(f),
      numberOfMonths: 1,
      disabled: o,
      "data-testid": s
    }
  );
  return i ? m : /* @__PURE__ */ d("div", { className: J("grid gap-2", e), children: /* @__PURE__ */ O(Dt, { children: [
    /* @__PURE__ */ d(Mt, { asChild: !0, children: /* @__PURE__ */ d(
      _t,
      {
        "data-testid": "date-range",
        color: "secondary",
        EndIcon: "calendar",
        className: J("justify-between text-left font-normal", !t && "text-subtle"),
        children: t != null && t.startDate ? t != null && t.endDate ? /* @__PURE__ */ O(T, { children: [
          E(t.startDate, "LLL dd, y"),
          " - ",
          E(t.endDate, "LLL dd, y")
        ] }) : /* @__PURE__ */ O(T, { children: [
          E(t.startDate, "LLL dd, y"),
          " - End"
        ] }) : /* @__PURE__ */ d("span", { children: "Pick a date" })
      }
    ) }),
    /* @__PURE__ */ d(
      kt,
      {
        className: "bg-default text-emphasis z-50 w-auto rounded-md border p-0 outline-none",
        align: "start",
        sideOffset: 4,
        side: l ? "bottom" : void 0,
        avoidCollisions: !l,
        children: m
      }
    )
  ] }) });
}
export {
  gr as DatePickerWithRange
};
