import { aW as l, b7 as $, h as Se, bN as We, aT as Te, bO as wt, bP as pt, e as xt, bQ as Dt } from "./index-6jcTChn4.js";
import { createContext as H, forwardRef as Mt, useContext as A, useState as U, useEffect as re, useLayoutEffect as _t, useRef as kt } from "react";
function D(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 j(e, t) {
  return e instanceof Date ? new e.constructor(t) : new Date(t);
}
function P(e, t) {
  const n = D(e);
  return isNaN(t) ? j(e, NaN) : (t && n.setDate(n.getDate() + t), n);
}
function S(e, t) {
  const n = D(e);
  if (isNaN(t))
    return j(e, NaN);
  if (!t)
    return n;
  const a = n.getDate(), r = j(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 we = 6048e5, Nt = 864e5;
let Pt = {};
function K() {
  return Pt;
}
function F(e, t) {
  var s, u, d, c;
  const n = K(), a = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((c = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : c.weekStartsOn) ?? 0, r = D(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 B(e) {
  return F(e, { weekStartsOn: 1 });
}
function qe(e) {
  const t = D(e), n = t.getFullYear(), a = j(e, 0);
  a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0);
  const r = B(a), o = j(e, 0);
  o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0);
  const i = B(o);
  return t.getTime() >= r.getTime() ? n + 1 : t.getTime() >= i.getTime() ? n : n - 1;
}
function Q(e) {
  const t = D(e);
  return t.setHours(0, 0, 0, 0), t;
}
function ne(e) {
  const t = D(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 T(e, t) {
  const n = Q(e), a = Q(t), r = +n - ne(n), o = +a - ne(a);
  return Math.round((r - o) / Nt);
}
function Ot(e) {
  const t = qe(e), n = j(e, 0);
  return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), B(n);
}
function be(e, t) {
  const n = t * 7;
  return P(e, n);
}
function Ct(e, t) {
  return S(e, t * 12);
}
function jt(e) {
  let t;
  return e.forEach(function(n) {
    const a = D(n);
    (t === void 0 || t < a || isNaN(Number(a))) && (t = a);
  }), t || /* @__PURE__ */ new Date(NaN);
}
function St(e) {
  let t;
  return e.forEach((n) => {
    const a = D(n);
    (!t || t > a || isNaN(+a)) && (t = a);
  }), t || /* @__PURE__ */ new Date(NaN);
}
function O(e, t) {
  const n = Q(e), a = Q(t);
  return +n == +a;
}
function pe(e) {
  return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
}
function Wt(e) {
  if (!pe(e) && typeof e != "number")
    return !1;
  const t = D(e);
  return !isNaN(Number(t));
}
function J(e, t) {
  const n = D(e), a = D(t), r = n.getFullYear() - a.getFullYear(), o = n.getMonth() - a.getMonth();
  return r * 12 + o;
}
function Tt(e, t, n) {
  const a = F(e, n), r = F(t, n), o = +a - ne(a), i = +r - ne(r);
  return Math.round((o - i) / we);
}
function xe(e) {
  const t = D(e), n = t.getMonth();
  return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
}
function C(e) {
  const t = D(e);
  return t.setDate(1), t.setHours(0, 0, 0, 0), t;
}
function Qe(e) {
  const t = D(e), n = j(e, 0);
  return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
}
function De(e, t) {
  var s, u, d, c;
  const n = K(), a = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((c = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : c.weekStartsOn) ?? 0, r = D(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 Xe(e) {
  return De(e, { weekStartsOn: 1 });
}
const Yt = {
  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"
  }
}, Ft = (e, t, n) => {
  let a;
  const r = Yt[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 ce(e) {
  return (t = {}) => {
    const n = t.width ? String(t.width) : e.defaultWidth;
    return e.formats[n] || e.formats[e.defaultWidth];
  };
}
const Lt = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, Et = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, It = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, Rt = {
  date: ce({
    formats: Lt,
    defaultWidth: "full"
  }),
  time: ce({
    formats: Et,
    defaultWidth: "full"
  }),
  dateTime: ce({
    formats: It,
    defaultWidth: "full"
  })
}, Bt = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, Ht = (e, t, n, a) => Bt[e];
function G(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 At = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, qt = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Qt = {
  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"
  ]
}, Xt = {
  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"
  ]
}, Gt = {
  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"
  }
}, Vt = {
  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"
  }
}, $t = (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";
}, Ut = {
  ordinalNumber: $t,
  era: G({
    values: At,
    defaultWidth: "wide"
  }),
  quarter: G({
    values: qt,
    defaultWidth: "wide",
    argumentCallback: (e) => e - 1
  }),
  month: G({
    values: Qt,
    defaultWidth: "wide"
  }),
  day: G({
    values: Xt,
    defaultWidth: "wide"
  }),
  dayPeriod: G({
    values: Gt,
    defaultWidth: "wide",
    formattingValues: Vt,
    defaultFormattingWidth: "wide"
  })
};
function V(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], u = Array.isArray(s) ? Kt(s, (f) => f.test(i)) : (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
      Jt(s, (f) => f.test(i))
    );
    let d;
    d = e.valueCallback ? e.valueCallback(u) : u, d = n.valueCallback ? (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
      n.valueCallback(d)
    ) : d;
    const c = t.slice(i.length);
    return { value: d, rest: c };
  };
}
function Jt(e, t) {
  for (const n in e)
    if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
      return n;
}
function Kt(e, t) {
  for (let n = 0; n < e.length; n++)
    if (t(e[n]))
      return n;
}
function zt(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 Zt = /^(\d+)(th|st|nd|rd)?/i, en = /\d+/i, tn = {
  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
}, nn = {
  any: [/^b/i, /^(a|c)/i]
}, an = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, rn = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, on = {
  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
}, sn = {
  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
  ]
}, ln = {
  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
}, un = {
  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]
}, cn = {
  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
}, dn = {
  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
  }
}, fn = {
  ordinalNumber: zt({
    matchPattern: Zt,
    parsePattern: en,
    valueCallback: (e) => parseInt(e, 10)
  }),
  era: V({
    matchPatterns: tn,
    defaultMatchWidth: "wide",
    parsePatterns: nn,
    defaultParseWidth: "any"
  }),
  quarter: V({
    matchPatterns: an,
    defaultMatchWidth: "wide",
    parsePatterns: rn,
    defaultParseWidth: "any",
    valueCallback: (e) => e + 1
  }),
  month: V({
    matchPatterns: on,
    defaultMatchWidth: "wide",
    parsePatterns: sn,
    defaultParseWidth: "any"
  }),
  day: V({
    matchPatterns: ln,
    defaultMatchWidth: "wide",
    parsePatterns: un,
    defaultParseWidth: "any"
  }),
  dayPeriod: V({
    matchPatterns: cn,
    defaultMatchWidth: "any",
    parsePatterns: dn,
    defaultParseWidth: "any"
  })
}, Ge = {
  code: "en-US",
  formatDistance: Ft,
  formatLong: Rt,
  formatRelative: Ht,
  localize: Ut,
  match: fn,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};
function hn(e) {
  const t = D(e);
  return T(t, Qe(t)) + 1;
}
function Ve(e) {
  const t = D(e), n = +B(t) - +Ot(t);
  return Math.round(n / we) + 1;
}
function $e(e, t) {
  var c, f, h, m;
  const n = D(e), a = n.getFullYear(), r = K(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((m = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, i = j(e, 0);
  i.setFullYear(a + 1, 0, o), i.setHours(0, 0, 0, 0);
  const s = F(i, t), u = j(e, 0);
  u.setFullYear(a, 0, o), u.setHours(0, 0, 0, 0);
  const d = F(u, t);
  return n.getTime() >= s.getTime() ? a + 1 : n.getTime() >= d.getTime() ? a : a - 1;
}
function mn(e, t) {
  var s, u, d, c;
  const n = K(), a = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((c = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : c.firstWeekContainsDate) ?? 1, r = $e(e, t), o = j(e, 0);
  return o.setFullYear(r, 0, a), o.setHours(0, 0, 0, 0), F(o, t);
}
function Ue(e, t) {
  const n = D(e), a = +F(n, t) - +mn(n, t);
  return Math.round(a / we) + 1;
}
function M(e, t) {
  const n = e < 0 ? "-" : "", a = Math.abs(e).toString().padStart(t, "0");
  return n + a;
}
const E = {
  // Year
  y(e, t) {
    const n = e.getFullYear(), a = n > 0 ? n : 1 - n;
    return M(t === "yy" ? a % 100 : a, t.length);
  },
  // Month
  M(e, t) {
    const n = e.getMonth();
    return t === "M" ? String(n + 1) : M(n + 1, 2);
  },
  // Day of the month
  d(e, t) {
    return M(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 M(e.getHours() % 12 || 12, t.length);
  },
  // Hour [0-23]
  H(e, t) {
    return M(e.getHours(), t.length);
  },
  // Minute
  m(e, t) {
    return M(e.getMinutes(), t.length);
  },
  // Second
  s(e, t) {
    return M(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 M(r, t.length);
  }
}, q = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, Ye = {
  // 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 E.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, n, a) {
    const r = $e(e, a), o = r > 0 ? r : 1 - r;
    if (t === "YY") {
      const i = o % 100;
      return M(i, 2);
    }
    return t === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : M(o, t.length);
  },
  // ISO week-numbering year
  R: function(e, t) {
    const n = qe(e);
    return M(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 M(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 M(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 M(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 E.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 M(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 = Ue(e, a);
    return t === "wo" ? n.ordinalNumber(r, { unit: "week" }) : M(r, t.length);
  },
  // ISO week of year
  I: function(e, t, n) {
    const a = Ve(e);
    return t === "Io" ? n.ordinalNumber(a, { unit: "week" }) : M(a, t.length);
  },
  // Day of the month
  d: function(e, t, n) {
    return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : E.d(e, t);
  },
  // Day of year
  D: function(e, t, n) {
    const a = hn(e);
    return t === "Do" ? n.ordinalNumber(a, { unit: "dayOfYear" }) : M(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 M(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 M(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 M(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 = q.noon : a === 0 ? r = q.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 = q.evening : a >= 12 ? r = q.afternoon : a >= 4 ? r = q.morning : r = q.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 E.h(e, t);
  },
  // Hour [0-23]
  H: function(e, t, n) {
    return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : E.H(e, t);
  },
  // Hour [0-11]
  K: function(e, t, n) {
    const a = e.getHours() % 12;
    return t === "Ko" ? n.ordinalNumber(a, { unit: "hour" }) : M(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" }) : M(a, t.length);
  },
  // Minute
  m: function(e, t, n) {
    return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : E.m(e, t);
  },
  // Second
  s: function(e, t, n) {
    return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : E.s(e, t);
  },
  // Fraction of second
  S: function(e, t) {
    return E.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 Le(a);
      case "XXXX":
      case "XX":
        return R(a);
      case "XXXXX":
      case "XXX":
      default:
        return R(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 Le(a);
      case "xxxx":
      case "xx":
        return R(a);
      case "xxxxx":
      case "xxx":
      default:
        return R(a, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, n) {
    const a = e.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Fe(a, ":");
      case "OOOO":
      default:
        return "GMT" + R(a, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, n) {
    const a = e.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Fe(a, ":");
      case "zzzz":
      default:
        return "GMT" + R(a, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, n) {
    const a = Math.trunc(e.getTime() / 1e3);
    return M(a, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, n) {
    const a = e.getTime();
    return M(a, t.length);
  }
};
function Fe(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 + M(o, 2);
}
function Le(e, t) {
  return e % 60 === 0 ? (e > 0 ? "-" : "+") + M(Math.abs(e) / 60, 2) : R(e, t);
}
function R(e, t = "") {
  const n = e > 0 ? "-" : "+", a = Math.abs(e), r = M(Math.trunc(a / 60), 2), o = M(a % 60, 2);
  return n + r + t + o;
}
const Ee = (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" });
  }
}, Je = (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" });
  }
}, vn = (e, t) => {
  const n = e.match(/(P+)(p+)?/) || [], a = n[1], r = n[2];
  if (!r)
    return Ee(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}}", Ee(a, t)).replace("{{time}}", Je(r, t));
}, yn = {
  p: Je,
  P: vn
}, bn = /^D+$/, gn = /^Y+$/, wn = ["D", "DD", "YY", "YYYY"];
function pn(e) {
  return bn.test(e);
}
function xn(e) {
  return gn.test(e);
}
function Dn(e, t, n) {
  const a = Mn(e, t, n);
  if (console.warn(a), wn.includes(e))
    throw new RangeError(a);
}
function Mn(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 _n = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, kn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Nn = /^'([^]*?)'?$/, Pn = /''/g, On = /[a-zA-Z]/;
function Y(e, t, n) {
  var c, f, h, m, g, x, w, k;
  const a = K(), r = (n == null ? void 0 : n.locale) ?? a.locale ?? Ge, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (c = n == null ? void 0 : n.locale) == null ? void 0 : c.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((m = (h = a.locale) == null ? void 0 : h.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, i = (n == null ? void 0 : n.weekStartsOn) ?? ((x = (g = n == null ? void 0 : n.locale) == null ? void 0 : g.options) == null ? void 0 : x.weekStartsOn) ?? a.weekStartsOn ?? ((k = (w = a.locale) == null ? void 0 : w.options) == null ? void 0 : k.weekStartsOn) ?? 0, s = D(e);
  if (!Wt(s))
    throw new RangeError("Invalid time value");
  let u = t.match(kn).map((p) => {
    const N = p[0];
    if (N === "p" || N === "P") {
      const I = yn[N];
      return I(p, r.formatLong);
    }
    return p;
  }).join("").match(_n).map((p) => {
    if (p === "''")
      return { isToken: !1, value: "'" };
    const N = p[0];
    if (N === "'")
      return { isToken: !1, value: Cn(p) };
    if (Ye[N])
      return { isToken: !0, value: p };
    if (N.match(On))
      throw new RangeError(
        "Format string contains an unescaped latin alphabet character `" + N + "`"
      );
    return { isToken: !1, value: p };
  });
  r.localize.preprocessor && (u = r.localize.preprocessor(s, u));
  const d = {
    firstWeekContainsDate: o,
    weekStartsOn: i,
    locale: r
  };
  return u.map((p) => {
    if (!p.isToken)
      return p.value;
    const N = p.value;
    (!(n != null && n.useAdditionalWeekYearTokens) && xn(N) || !(n != null && n.useAdditionalDayOfYearTokens) && pn(N)) && Dn(N, t, String(e));
    const I = Ye[N[0]];
    return I(s, N, r.localize, d);
  }).join("");
}
function Cn(e) {
  const t = e.match(Nn);
  return t ? t[1].replace(Pn, "'") : e;
}
function jn(e) {
  const t = D(e), n = t.getFullYear(), a = t.getMonth(), r = j(e, 0);
  return r.setFullYear(n, a + 1, 0), r.setHours(0, 0, 0, 0), r.getDate();
}
function Sn(e) {
  return Math.trunc(+D(e) / 1e3);
}
function Wn(e) {
  const t = D(e), n = t.getMonth();
  return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(0, 0, 0, 0), t;
}
function Tn(e, t) {
  return Tt(
    Wn(e),
    C(e),
    t
  ) + 1;
}
function ge(e, t) {
  const n = D(e), a = D(t);
  return n.getTime() > a.getTime();
}
function Ke(e, t) {
  const n = D(e), a = D(t);
  return +n < +a;
}
function Me(e, t) {
  const n = D(e), a = D(t);
  return n.getFullYear() === a.getFullYear() && n.getMonth() === a.getMonth();
}
function Yn(e, t) {
  const n = D(e), a = D(t);
  return n.getFullYear() === a.getFullYear();
}
function de(e, t) {
  return P(e, -t);
}
function fe(e, t) {
  const n = D(e), a = n.getFullYear(), r = n.getDate(), o = j(e, 0);
  o.setFullYear(a, t, 15), o.setHours(0, 0, 0, 0);
  const i = jn(o);
  return n.setMonth(t, Math.min(r, i)), n;
}
function Ie(e, t) {
  const n = D(e);
  return isNaN(+n) ? j(e, NaN) : (n.setFullYear(t), n);
}
var y = function() {
  return y = 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;
  }, y.apply(this, arguments);
};
function Fn(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 ze(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 z(e) {
  return e.mode === "multiple";
}
function Z(e) {
  return e.mode === "range";
}
function oe(e) {
  return e.mode === "single";
}
var Ln = {
  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 En(e, t) {
  return Y(e, "LLLL y", t);
}
function In(e, t) {
  return Y(e, "d", t);
}
function Rn(e, t) {
  return Y(e, "LLLL", t);
}
function Bn(e) {
  return "".concat(e);
}
function Hn(e, t) {
  return Y(e, "cccccc", t);
}
function An(e, t) {
  return Y(e, "yyyy", t);
}
var qn = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  formatCaption: En,
  formatDay: In,
  formatMonthCaption: Rn,
  formatWeekNumber: Bn,
  formatWeekdayName: Hn,
  formatYearCaption: An
}), Qn = function(e, t, n) {
  return Y(e, "do MMMM (EEEE)", n);
}, Xn = function() {
  return "Month: ";
}, Gn = function() {
  return "Go to next month";
}, Vn = function() {
  return "Go to previous month";
}, $n = function(e, t) {
  return Y(e, "cccc", t);
}, Un = function(e) {
  return "Week n. ".concat(e);
}, Jn = function() {
  return "Year: ";
}, Kn = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  labelDay: Qn,
  labelMonthDropdown: Xn,
  labelNext: Gn,
  labelPrevious: Vn,
  labelWeekNumber: Un,
  labelWeekday: $n,
  labelYearDropdown: Jn
});
function zn() {
  var e = "buttons", t = Ln, n = Ge, a = {}, r = {}, o = 1, i = {}, s = /* @__PURE__ */ new Date();
  return {
    captionLayout: e,
    classNames: t,
    formatters: qn,
    labels: Kn,
    locale: n,
    modifiersClassNames: a,
    modifiers: r,
    numberOfMonths: o,
    styles: i,
    today: s,
    mode: "default"
  };
}
function Zn(e) {
  var t = e.fromYear, n = e.toYear, a = e.fromMonth, r = e.toMonth, o = e.fromDate, i = e.toDate;
  return a ? o = C(a) : t && (o = new Date(t, 0, 1)), r ? i = xe(r) : n && (i = new Date(n, 11, 31)), {
    fromDate: o ? Q(o) : void 0,
    toDate: i ? Q(i) : void 0
  };
}
var Ze = H(void 0);
function ea(e) {
  var t, n = e.initialProps, a = zn(), r = Zn(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 u;
  (oe(n) || z(n) || Z(n)) && (u = n.onSelect);
  var d = y(y(y({}, a), n), { captionLayout: s, classNames: y(y({}, a.classNames), n.classNames), components: y({}, n.components), formatters: y(y({}, a.formatters), n.formatters), fromDate: o, labels: y(y({}, a.labels), n.labels), mode: n.mode || a.mode, modifiers: y(y({}, a.modifiers), n.modifiers), modifiersClassNames: y(y({}, a.modifiersClassNames), n.modifiersClassNames), onSelect: u, styles: y(y({}, a.styles), n.styles), toDate: i });
  return l.jsx(Ze.Provider, { value: d, children: e.children });
}
function _() {
  var e = A(Ze);
  if (!e)
    throw new Error("useDayPicker must be used within a DayPickerProvider.");
  return e;
}
function et(e) {
  var t = _(), n = t.locale, a = t.classNames, r = t.styles, o = t.formatters.formatCaption;
  return l.jsx("div", { className: a.caption_label, style: r.caption_label, "aria-live": "polite", role: "presentation", id: e.id, children: o(e.displayMonth, { locale: n }) });
}
function ta(e) {
  return l.jsx("svg", y({ width: "8px", height: "8px", viewBox: "0 0 120 120", "data-testid": "iconDropdown" }, e, { children: l.jsx("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 tt(e) {
  var t, n, a = e.onChange, r = e.value, o = e.children, i = e.caption, s = e.className, u = e.style, d = _(), c = (n = (t = d.components) === null || t === void 0 ? void 0 : t.IconDropdown) !== null && n !== void 0 ? n : ta;
  return l.jsxs("div", { className: s, style: u, children: [l.jsx("span", { className: d.classNames.vhidden, children: e["aria-label"] }), l.jsx("select", { name: e.name, "aria-label": e["aria-label"], className: d.classNames.dropdown, style: d.styles.dropdown, value: r, onChange: a, children: o }), l.jsxs("div", { className: d.classNames.caption_label, style: d.styles.caption_label, "aria-hidden": "true", children: [i, l.jsx(c, { className: d.classNames.dropdown_icon, style: d.styles.dropdown_icon })] })] });
}
function na(e) {
  var t, n = _(), a = n.fromDate, r = n.toDate, o = n.styles, i = n.locale, s = n.formatters.formatMonthCaption, u = n.classNames, d = n.components, c = n.labels.labelMonthDropdown;
  if (!a)
    return l.jsx(l.Fragment, {});
  if (!r)
    return l.jsx(l.Fragment, {});
  var f = [];
  if (Yn(a, r))
    for (var h = C(a), m = a.getMonth(); m <= r.getMonth(); m++)
      f.push(fe(h, m));
  else
    for (var h = C(/* @__PURE__ */ new Date()), m = 0; m <= 11; m++)
      f.push(fe(h, m));
  var g = function(w) {
    var k = Number(w.target.value), p = fe(C(e.displayMonth), k);
    e.onChange(p);
  }, x = (t = d == null ? void 0 : d.Dropdown) !== null && t !== void 0 ? t : tt;
  return l.jsx(x, { name: "months", "aria-label": c(), className: u.dropdown_month, style: o.dropdown_month, onChange: g, value: e.displayMonth.getMonth(), caption: s(e.displayMonth, { locale: i }), children: f.map(function(w) {
    return l.jsx("option", { value: w.getMonth(), children: s(w, { locale: i }) }, w.getMonth());
  }) });
}
function aa(e) {
  var t, n = e.displayMonth, a = _(), r = a.fromDate, o = a.toDate, i = a.locale, s = a.styles, u = a.classNames, d = a.components, c = a.formatters.formatYearCaption, f = a.labels.labelYearDropdown, h = [];
  if (!r)
    return l.jsx(l.Fragment, {});
  if (!o)
    return l.jsx(l.Fragment, {});
  for (var m = r.getFullYear(), g = o.getFullYear(), x = m; x <= g; x++)
    h.push(Ie(Qe(/* @__PURE__ */ new Date()), x));
  var w = function(p) {
    var N = Ie(C(n), Number(p.target.value));
    e.onChange(N);
  }, k = (t = d == null ? void 0 : d.Dropdown) !== null && t !== void 0 ? t : tt;
  return l.jsx(k, { name: "years", "aria-label": f(), className: u.dropdown_year, style: s.dropdown_year, onChange: w, value: n.getFullYear(), caption: c(n, { locale: i }), children: h.map(function(p) {
    return l.jsx("option", { value: p.getFullYear(), children: c(p, { locale: i }) }, p.getFullYear());
  }) });
}
function ra(e, t) {
  var n = U(e), a = n[0], r = n[1], o = t === void 0 ? a : t;
  return [o, r];
}
function oa(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, u = s === void 0 ? 1 : s;
  if (o && J(o, r) < 0) {
    var d = -1 * (u - 1);
    r = S(o, d);
  }
  return i && J(r, i) < 0 && (r = i), C(r);
}
function ia() {
  var e = _(), t = oa(e), n = ra(t, e.month), a = n[0], r = n[1], o = function(i) {
    var s;
    if (!e.disableNavigation) {
      var u = C(i);
      r(u), (s = e.onMonthChange) === null || s === void 0 || s.call(e, u);
    }
  };
  return [a, o];
}
function sa(e, t) {
  for (var n = t.reverseMonths, a = t.numberOfMonths, r = C(e), o = C(S(r, a)), i = J(o, r), s = [], u = 0; u < i; u++) {
    var d = S(r, u);
    s.push(d);
  }
  return n && (s = s.reverse()), s;
}
function la(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 = C(e);
    if (!n)
      return S(s, i);
    var u = J(n, e);
    if (!(u < o))
      return S(s, i);
  }
}
function ua(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 = C(e);
    if (!n)
      return S(s, -i);
    var u = J(s, n);
    if (!(u <= 0))
      return S(s, -i);
  }
}
var nt = H(void 0);
function ca(e) {
  var t = _(), n = ia(), a = n[0], r = n[1], o = sa(a, t), i = la(a, t), s = ua(a, t), u = function(f) {
    return o.some(function(h) {
      return Me(f, h);
    });
  }, d = function(f, h) {
    u(f) || (h && Ke(f, h) ? r(S(f, 1 + t.numberOfMonths * -1)) : r(f));
  }, c = {
    currentMonth: a,
    displayMonths: o,
    goToMonth: r,
    goToDate: d,
    previousMonth: s,
    nextMonth: i,
    isDateDisplayed: u
  };
  return l.jsx(nt.Provider, { value: c, children: e.children });
}
function ee() {
  var e = A(nt);
  if (!e)
    throw new Error("useNavigation must be used within a NavigationProvider");
  return e;
}
function Re(e) {
  var t, n = _(), a = n.classNames, r = n.styles, o = n.components, i = ee().goToMonth, s = function(c) {
    i(S(c, e.displayIndex ? -e.displayIndex : 0));
  }, u = (t = o == null ? void 0 : o.CaptionLabel) !== null && t !== void 0 ? t : et, d = l.jsx(u, { id: e.id, displayMonth: e.displayMonth });
  return l.jsxs("div", { className: a.caption_dropdowns, style: r.caption_dropdowns, children: [l.jsx("div", { className: a.vhidden, children: d }), l.jsx(na, { onChange: s, displayMonth: e.displayMonth }), l.jsx(aa, { onChange: s, displayMonth: e.displayMonth })] });
}
function da(e) {
  return l.jsx("svg", y({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: l.jsx("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 fa(e) {
  return l.jsx("svg", y({ width: "16px", height: "16px", viewBox: "0 0 120 120" }, e, { children: l.jsx("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 ae = Mt(function(e, t) {
  var n = _(), a = n.classNames, r = n.styles, o = [a.button_reset, a.button];
  e.className && o.push(e.className);
  var i = o.join(" "), s = y(y({}, r.button_reset), r.button);
  return e.style && Object.assign(s, e.style), l.jsx("button", y({}, e, { ref: t, type: "button", className: i, style: s }));
});
function ha(e) {
  var t, n, a = _(), r = a.dir, o = a.locale, i = a.classNames, s = a.styles, u = a.labels, d = u.labelPrevious, c = u.labelNext, f = a.components;
  if (!e.nextMonth && !e.previousMonth)
    return l.jsx(l.Fragment, {});
  var h = d(e.previousMonth, { locale: o }), m = [
    i.nav_button,
    i.nav_button_previous
  ].join(" "), g = c(e.nextMonth, { locale: o }), x = [
    i.nav_button,
    i.nav_button_next
  ].join(" "), w = (t = f == null ? void 0 : f.IconRight) !== null && t !== void 0 ? t : fa, k = (n = f == null ? void 0 : f.IconLeft) !== null && n !== void 0 ? n : da;
  return l.jsxs("div", { className: i.nav, style: s.nav, children: [!e.hidePrevious && l.jsx(ae, { name: "previous-month", "aria-label": h, className: m, style: s.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: r === "rtl" ? l.jsx(w, { className: i.nav_icon, style: s.nav_icon }) : l.jsx(k, { className: i.nav_icon, style: s.nav_icon }) }), !e.hideNext && l.jsx(ae, { name: "next-month", "aria-label": g, className: x, style: s.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: r === "rtl" ? l.jsx(k, { className: i.nav_icon, style: s.nav_icon }) : l.jsx(w, { className: i.nav_icon, style: s.nav_icon }) })] });
}
function Be(e) {
  var t = _().numberOfMonths, n = ee(), a = n.previousMonth, r = n.nextMonth, o = n.goToMonth, i = n.displayMonths, s = i.findIndex(function(g) {
    return Me(e.displayMonth, g);
  }), u = s === 0, d = s === i.length - 1, c = t > 1 && (u || !d), f = t > 1 && (d || !u), h = function() {
    a && o(a);
  }, m = function() {
    r && o(r);
  };
  return l.jsx(ha, { displayMonth: e.displayMonth, hideNext: c, hidePrevious: f, nextMonth: r, previousMonth: a, onPreviousClick: h, onNextClick: m });
}
function ma(e) {
  var t, n = _(), a = n.classNames, r = n.disableNavigation, o = n.styles, i = n.captionLayout, s = n.components, u = (t = s == null ? void 0 : s.CaptionLabel) !== null && t !== void 0 ? t : et, d;
  return r ? d = l.jsx(u, { id: e.id, displayMonth: e.displayMonth }) : i === "dropdown" ? d = l.jsx(Re, { displayMonth: e.displayMonth, id: e.id }) : i === "dropdown-buttons" ? d = l.jsxs(l.Fragment, { children: [l.jsx(Re, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id }), l.jsx(Be, { displayMonth: e.displayMonth, displayIndex: e.displayIndex, id: e.id })] }) : d = l.jsxs(l.Fragment, { children: [l.jsx(u, { id: e.id, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), l.jsx(Be, { displayMonth: e.displayMonth, id: e.id })] }), l.jsx("div", { className: a.caption, style: o.caption, children: d });
}
function va(e) {
  var t = _(), n = t.footer, a = t.styles, r = t.classNames.tfoot;
  return n ? l.jsx("tfoot", { className: r, style: a.tfoot, children: l.jsx("tr", { children: l.jsx("td", { colSpan: 8, children: n }) }) }) : l.jsx(l.Fragment, {});
}
function ya(e, t, n) {
  for (var a = n ? B(/* @__PURE__ */ new Date()) : F(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: t }), r = [], o = 0; o < 7; o++) {
    var i = P(a, o);
    r.push(i);
  }
  return r;
}
function ba() {
  var e = _(), t = e.classNames, n = e.styles, a = e.showWeekNumber, r = e.locale, o = e.weekStartsOn, i = e.ISOWeek, s = e.formatters.formatWeekdayName, u = e.labels.labelWeekday, d = ya(r, o, i);
  return l.jsxs("tr", { style: n.head_row, className: t.head_row, children: [a && l.jsx("td", { style: n.head_cell, className: t.head_cell }), d.map(function(c, f) {
    return l.jsx("th", { scope: "col", className: t.head_cell, style: n.head_cell, "aria-label": u(c, { locale: r }), children: s(c, { locale: r }) }, f);
  })] });
}
function ga() {
  var e, t = _(), n = t.classNames, a = t.styles, r = t.components, o = (e = r == null ? void 0 : r.HeadRow) !== null && e !== void 0 ? e : ba;
  return l.jsx("thead", { style: a.head, className: n.head, children: l.jsx(o, {}) });
}
function wa(e) {
  var t = _(), n = t.locale, a = t.formatters.formatDay;
  return l.jsx(l.Fragment, { children: a(e.date, { locale: n }) });
}
var _e = H(void 0);
function pa(e) {
  if (!z(e.initialProps)) {
    var t = {
      selected: void 0,
      modifiers: {
        disabled: []
      }
    };
    return l.jsx(_e.Provider, { value: t, children: e.children });
  }
  return l.jsx(xa, { initialProps: e.initialProps, children: e.children });
}
function xa(e) {
  var t = e.initialProps, n = e.children, a = t.selected, r = t.min, o = t.max, i = function(d, c, f) {
    var h, m;
    (h = t.onDayClick) === null || h === void 0 || h.call(t, d, c, f);
    var g = !!(c.selected && r && (a == null ? void 0 : a.length) === r);
    if (!g) {
      var x = !!(!c.selected && o && (a == null ? void 0 : a.length) === o);
      if (!x) {
        var w = a ? ze([], a, !0) : [];
        if (c.selected) {
          var k = w.findIndex(function(p) {
            return O(d, p);
          });
          w.splice(k, 1);
        } else
          w.push(d);
        (m = t.onSelect) === null || m === void 0 || m.call(t, w, d, c, f);
      }
    }
  }, s = {
    disabled: []
  };
  a && s.disabled.push(function(d) {
    var c = o && a.length > o - 1, f = a.some(function(h) {
      return O(h, d);
    });
    return !!(c && !f);
  });
  var u = {
    selected: a,
    onDayClick: i,
    modifiers: s
  };
  return l.jsx(_e.Provider, { value: u, children: n });
}
function ke() {
  var e = A(_e);
  if (!e)
    throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");
  return e;
}
function Da(e, t) {
  var n = t || {}, a = n.from, r = n.to;
  return a && r ? O(r, e) && O(a, e) ? void 0 : O(r, e) ? { from: r, to: void 0 } : O(a, e) ? void 0 : ge(a, e) ? { from: e, to: r } : { from: a, to: e } : r ? ge(e, r) ? { from: r, to: e } : { from: e, to: r } : a ? Ke(e, a) ? { from: e, to: a } : { from: a, to: e } : { from: e, to: void 0 };
}
var Ne = H(void 0);
function Ma(e) {
  if (!Z(e.initialProps)) {
    var t = {
      selected: void 0,
      modifiers: {
        range_start: [],
        range_end: [],
        range_middle: [],
        disabled: []
      }
    };
    return l.jsx(Ne.Provider, { value: t, children: e.children });
  }
  return l.jsx(_a, { initialProps: e.initialProps, children: e.children });
}
function _a(e) {
  var t = e.initialProps, n = e.children, a = t.selected, r = a || {}, o = r.from, i = r.to, s = t.min, u = t.max, d = function(m, g, x) {
    var w, k;
    (w = t.onDayClick) === null || w === void 0 || w.call(t, m, g, x);
    var p = Da(m, a);
    (k = t.onSelect) === null || k === void 0 || k.call(t, p, m, g, x);
  }, c = {
    range_start: [],
    range_end: [],
    range_middle: [],
    disabled: []
  };
  if (o ? (c.range_start = [o], i ? (c.range_end = [i], O(o, i) || (c.range_middle = [
    {
      after: o,
      before: i
    }
  ])) : c.range_end = [o]) : i && (c.range_start = [i], c.range_end = [i]), s && (o && !i && c.disabled.push({
    after: de(o, s - 1),
    before: P(o, s - 1)
  }), o && i && c.disabled.push({
    after: o,
    before: P(o, s - 1)
  }), !o && i && c.disabled.push({
    after: de(i, s - 1),
    before: P(i, s - 1)
  })), u) {
    if (o && !i && (c.disabled.push({
      before: P(o, -u + 1)
    }), c.disabled.push({
      after: P(o, u - 1)
    })), o && i) {
      var f = T(i, o) + 1, h = u - f;
      c.disabled.push({
        before: de(o, h)
      }), c.disabled.push({
        after: P(i, h)
      });
    }
    !o && i && (c.disabled.push({
      before: P(i, -u + 1)
    }), c.disabled.push({
      after: P(i, u - 1)
    }));
  }
  return l.jsx(Ne.Provider, { value: { selected: a, onDayClick: d, modifiers: c }, children: n });
}
function Pe() {
  var e = A(Ne);
  if (!e)
    throw new Error("useSelectRange must be used within a SelectRangeProvider");
  return e;
}
function te(e) {
  return Array.isArray(e) ? ze([], e, !0) : e !== void 0 ? [e] : [];
}
function ka(e) {
  var t = {};
  return Object.entries(e).forEach(function(n) {
    var a = n[0], r = n[1];
    t[a] = te(r);
  }), t;
}
var W;
(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";
})(W || (W = {}));
var Na = W.Selected, L = W.Disabled, Pa = W.Hidden, Oa = W.Today, he = W.RangeEnd, me = W.RangeMiddle, ve = W.RangeStart, Ca = W.Outside;
function ja(e, t, n) {
  var a, r = (a = {}, a[Na] = te(e.selected), a[L] = te(e.disabled), a[Pa] = te(e.hidden), a[Oa] = [e.today], a[he] = [], a[me] = [], a[ve] = [], a[Ca] = [], a);
  return e.fromDate && r[L].push({ before: e.fromDate }), e.toDate && r[L].push({ after: e.toDate }), z(e) ? r[L] = r[L].concat(t.modifiers[L]) : Z(e) && (r[L] = r[L].concat(n.modifiers[L]), r[ve] = n.modifiers[ve], r[me] = n.modifiers[me], r[he] = n.modifiers[he]), r;
}
var at = H(void 0);
function Sa(e) {
  var t = _(), n = ke(), a = Pe(), r = ja(t, n, a), o = ka(t.modifiers), i = y(y({}, r), o);
  return l.jsx(at.Provider, { value: i, children: e.children });
}
function rt() {
  var e = A(at);
  if (!e)
    throw new Error("useModifiers must be used within a ModifiersProvider");
  return e;
}
function Wa(e) {
  return !!(e && typeof e == "object" && "before" in e && "after" in e);
}
function Ta(e) {
  return !!(e && typeof e == "object" && "from" in e);
}
function Ya(e) {
  return !!(e && typeof e == "object" && "after" in e);
}
function Fa(e) {
  return !!(e && typeof e == "object" && "before" in e);
}
function La(e) {
  return !!(e && typeof e == "object" && "dayOfWeek" in e);
}
function Ea(e, t) {
  var n, a = t.from, r = t.to;
  if (a && r) {
    var o = T(r, a) < 0;
    o && (n = [r, a], a = n[0], r = n[1]);
    var i = T(e, a) >= 0 && T(r, e) >= 0;
    return i;
  }
  return r ? O(r, e) : a ? O(a, e) : !1;
}
function Ia(e) {
  return pe(e);
}
function Ra(e) {
  return Array.isArray(e) && e.every(pe);
}
function Ba(e, t) {
  return t.some(function(n) {
    if (typeof n == "boolean")
      return n;
    if (Ia(n))
      return O(e, n);
    if (Ra(n))
      return n.includes(e);
    if (Ta(n))
      return Ea(e, n);
    if (La(n))
      return n.dayOfWeek.includes(e.getDay());
    if (Wa(n)) {
      var a = T(n.before, e), r = T(n.after, e), o = a > 0, i = r < 0, s = ge(n.before, n.after);
      return s ? i && o : o || i;
    }
    return Ya(n) ? T(e, n.after) > 0 : Fa(n) ? T(n.before, e) > 0 : typeof n == "function" ? n(e) : !1;
  });
}
function Oe(e, t, n) {
  var a = Object.keys(t).reduce(function(o, i) {
    var s = t[i];
    return Ba(e, s) && o.push(i), o;
  }, []), r = {};
  return a.forEach(function(o) {
    return r[o] = !0;
  }), n && !Me(e, n) && (r.outside = !0), r;
}
function Ha(e, t) {
  for (var n = C(e[0]), a = xe(e[e.length - 1]), r, o, i = n; i <= a; ) {
    var s = Oe(i, t), u = !s.disabled && !s.hidden;
    if (!u) {
      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 Aa = 365;
function ot(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, u = r.weekStartsOn, d = r.fromDate, c = r.toDate, f = r.locale, h = {
    day: P,
    week: be,
    month: S,
    year: Ct,
    startOfWeek: function(w) {
      return r.ISOWeek ? B(w) : F(w, { locale: f, weekStartsOn: u });
    },
    endOfWeek: function(w) {
      return r.ISOWeek ? Xe(w) : De(w, { locale: f, weekStartsOn: u });
    }
  }, m = h[n](e, a === "after" ? 1 : -1);
  a === "before" && d ? m = jt([d, m]) : a === "after" && c && (m = St([c, m]));
  var g = !0;
  if (o) {
    var x = Oe(m, o);
    g = !x.disabled && !x.hidden;
  }
  return g ? m : s.count > Aa ? s.lastFocused : ot(m, {
    moveBy: n,
    direction: a,
    context: r,
    modifiers: o,
    retry: y(y({}, s), { count: s.count + 1 })
  });
}
var it = H(void 0);
function qa(e) {
  var t = ee(), n = rt(), a = U(), r = a[0], o = a[1], i = U(), s = i[0], u = i[1], d = Ha(t.displayMonths, n), c = r ?? (s && t.isDateDisplayed(s)) ? s : d, f = function() {
    u(r), o(void 0);
  }, h = function(w) {
    o(w);
  }, m = _(), g = function(w, k) {
    if (r) {
      var p = ot(r, {
        moveBy: w,
        direction: k,
        context: m,
        modifiers: n
      });
      O(r, p) || (t.goToDate(p, r), h(p));
    }
  }, x = {
    focusedDay: r,
    focusTarget: c,
    blur: f,
    focus: h,
    focusDayAfter: function() {
      return g("day", "after");
    },
    focusDayBefore: function() {
      return g("day", "before");
    },
    focusWeekAfter: function() {
      return g("week", "after");
    },
    focusWeekBefore: function() {
      return g("week", "before");
    },
    focusMonthBefore: function() {
      return g("month", "before");
    },
    focusMonthAfter: function() {
      return g("month", "after");
    },
    focusYearBefore: function() {
      return g("year", "before");
    },
    focusYearAfter: function() {
      return g("year", "after");
    },
    focusStartOfWeek: function() {
      return g("startOfWeek", "before");
    },
    focusEndOfWeek: function() {
      return g("endOfWeek", "after");
    }
  };
  return l.jsx(it.Provider, { value: x, children: e.children });
}
function Ce() {
  var e = A(it);
  if (!e)
    throw new Error("useFocusContext must be used within a FocusProvider");
  return e;
}
function Qa(e, t) {
  var n = rt(), a = Oe(e, n, t);
  return a;
}
var je = H(void 0);
function Xa(e) {
  if (!oe(e.initialProps)) {
    var t = {
      selected: void 0
    };
    return l.jsx(je.Provider, { value: t, children: e.children });
  }
  return l.jsx(Ga, { initialProps: e.initialProps, children: e.children });
}
function Ga(e) {
  var t = e.initialProps, n = e.children, a = function(o, i, s) {
    var u, d, c;
    if ((u = t.onDayClick) === null || u === void 0 || u.call(t, o, i, s), i.selected && !t.required) {
      (d = t.onSelect) === null || d === void 0 || d.call(t, void 0, o, i, s);
      return;
    }
    (c = t.onSelect) === null || c === void 0 || c.call(t, o, o, i, s);
  }, r = {
    selected: t.selected,
    onDayClick: a
  };
  return l.jsx(je.Provider, { value: r, children: n });
}
function st() {
  var e = A(je);
  if (!e)
    throw new Error("useSelectSingle must be used within a SelectSingleProvider");
  return e;
}
function Va(e, t) {
  var n = _(), a = st(), r = ke(), o = Pe(), i = Ce(), s = i.focusDayAfter, u = i.focusDayBefore, d = i.focusWeekAfter, c = i.focusWeekBefore, f = i.blur, h = i.focus, m = i.focusMonthBefore, g = i.focusMonthAfter, x = i.focusYearBefore, w = i.focusYearAfter, k = i.focusStartOfWeek, p = i.focusEndOfWeek, N = function(b) {
    var v, se, le, ue;
    oe(n) ? (v = a.onDayClick) === null || v === void 0 || v.call(a, e, t, b) : z(n) ? (se = r.onDayClick) === null || se === void 0 || se.call(r, e, t, b) : Z(n) ? (le = o.onDayClick) === null || le === void 0 || le.call(o, e, t, b) : (ue = n.onDayClick) === null || ue === void 0 || ue.call(n, e, t, b);
  }, I = function(b) {
    var v;
    h(e), (v = n.onDayFocus) === null || v === void 0 || v.call(n, e, t, b);
  }, ie = function(b) {
    var v;
    f(), (v = n.onDayBlur) === null || v === void 0 || v.call(n, e, t, b);
  }, X = function(b) {
    var v;
    (v = n.onDayMouseEnter) === null || v === void 0 || v.call(n, e, t, b);
  }, ut = function(b) {
    var v;
    (v = n.onDayMouseLeave) === null || v === void 0 || v.call(n, e, t, b);
  }, ct = function(b) {
    var v;
    (v = n.onDayPointerEnter) === null || v === void 0 || v.call(n, e, t, b);
  }, dt = function(b) {
    var v;
    (v = n.onDayPointerLeave) === null || v === void 0 || v.call(n, e, t, b);
  }, ft = function(b) {
    var v;
    (v = n.onDayTouchCancel) === null || v === void 0 || v.call(n, e, t, b);
  }, ht = function(b) {
    var v;
    (v = n.onDayTouchEnd) === null || v === void 0 || v.call(n, e, t, b);
  }, mt = function(b) {
    var v;
    (v = n.onDayTouchMove) === null || v === void 0 || v.call(n, e, t, b);
  }, vt = function(b) {
    var v;
    (v = n.onDayTouchStart) === null || v === void 0 || v.call(n, e, t, b);
  }, yt = function(b) {
    var v;
    (v = n.onDayKeyUp) === null || v === void 0 || v.call(n, e, t, b);
  }, bt = function(b) {
    var v;
    switch (b.key) {
      case "ArrowLeft":
        b.preventDefault(), b.stopPropagation(), n.dir === "rtl" ? s() : u();
        break;
      case "ArrowRight":
        b.preventDefault(), b.stopPropagation(), n.dir === "rtl" ? u() : s();
        break;
      case "ArrowDown":
        b.preventDefault(), b.stopPropagation(), d();
        break;
      case "ArrowUp":
        b.preventDefault(), b.stopPropagation(), c();
        break;
      case "PageUp":
        b.preventDefault(), b.stopPropagation(), b.shiftKey ? x() : m();
        break;
      case "PageDown":
        b.preventDefault(), b.stopPropagation(), b.shiftKey ? w() : g();
        break;
      case "Home":
        b.preventDefault(), b.stopPropagation(), k();
        break;
      case "End":
        b.preventDefault(), b.stopPropagation(), p();
        break;
    }
    (v = n.onDayKeyDown) === null || v === void 0 || v.call(n, e, t, b);
  }, gt = {
    onClick: N,
    onFocus: I,
    onBlur: ie,
    onKeyDown: bt,
    onKeyUp: yt,
    onMouseEnter: X,
    onMouseLeave: ut,
    onPointerEnter: ct,
    onPointerLeave: dt,
    onTouchCancel: ft,
    onTouchEnd: ht,
    onTouchMove: mt,
    onTouchStart: vt
  };
  return gt;
}
function $a() {
  var e = _(), t = st(), n = ke(), a = Pe(), r = oe(e) ? t.selected : z(e) ? n.selected : Z(e) ? a.selected : void 0;
  return r;
}
function Ua(e) {
  return Object.values(W).includes(e);
}
function Ja(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 (Ua(a)) {
      var o = e.classNames["day_".concat(a)];
      o && n.push(o);
    }
  }), n;
}
function Ka(e, t) {
  var n = y({}, e.styles.day);
  return Object.keys(t).forEach(function(a) {
    var r;
    n = y(y({}, n), (r = e.modifiersStyles) === null || r === void 0 ? void 0 : r[a]);
  }), n;
}
function za(e, t, n) {
  var a, r, o, i = _(), s = Ce(), u = Qa(e, t), d = Va(e, u), c = $a(), f = !!(i.onDayClick || i.mode !== "default");
  re(function() {
    var X;
    u.outside || s.focusedDay && f && O(s.focusedDay, e) && ((X = n.current) === null || X === void 0 || X.focus());
  }, [
    s.focusedDay,
    e,
    n,
    f,
    u.outside
  ]);
  var h = Ja(i, u).join(" "), m = Ka(i, u), g = !!(u.outside && !i.showOutsideDays || u.hidden), x = (o = (r = i.components) === null || r === void 0 ? void 0 : r.DayContent) !== null && o !== void 0 ? o : wa, w = l.jsx(x, { date: e, displayMonth: t, activeModifiers: u }), k = {
    style: m,
    className: h,
    children: w,
    role: "gridcell"
  }, p = s.focusTarget && O(s.focusTarget, e) && !u.outside, N = s.focusedDay && O(s.focusedDay, e), I = y(y(y({}, k), (a = { disabled: u.disabled, role: "gridcell" }, a["aria-selected"] = u.selected, a.tabIndex = N || p ? 0 : -1, a)), d), ie = {
    isButton: f,
    isHidden: g,
    activeModifiers: u,
    selectedDays: c,
    buttonProps: I,
    divProps: k
  };
  return ie;
}
function Za(e) {
  var t = kt(null), n = za(e.date, e.displayMonth, t);
  return n.isHidden ? l.jsx("div", { role: "gridcell" }) : n.isButton ? l.jsx(ae, y({ name: "day", ref: t }, n.buttonProps)) : l.jsx("div", y({}, n.divProps));
}
function er(e) {
  var t = e.number, n = e.dates, a = _(), r = a.onWeekNumberClick, o = a.styles, i = a.classNames, s = a.locale, u = a.labels.labelWeekNumber, d = a.formatters.formatWeekNumber, c = d(Number(t), { locale: s });
  if (!r)
    return l.jsx("span", { className: i.weeknumber, style: o.weeknumber, children: c });
  var f = u(Number(t), { locale: s }), h = function(m) {
    r(t, n, m);
  };
  return l.jsx(ae, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: h, children: c });
}
function tr(e) {
  var t, n, a = _(), r = a.styles, o = a.classNames, i = a.showWeekNumber, s = a.components, u = (t = s == null ? void 0 : s.Day) !== null && t !== void 0 ? t : Za, d = (n = s == null ? void 0 : s.WeekNumber) !== null && n !== void 0 ? n : er, c;
  return i && (c = l.jsx("td", { className: o.cell, style: r.cell, children: l.jsx(d, { number: e.weekNumber, dates: e.dates }) })), l.jsxs("tr", { className: o.row, style: r.row, children: [c, e.dates.map(function(f) {
    return l.jsx("td", { className: o.cell, style: r.cell, role: "presentation", children: l.jsx(u, { displayMonth: e.displayMonth, date: f }) }, Sn(f));
  })] });
}
function He(e, t, n) {
  for (var a = n != null && n.ISOWeek ? Xe(t) : De(t, n), r = n != null && n.ISOWeek ? B(e) : F(e, n), o = T(a, r), i = [], s = 0; s <= o; s++)
    i.push(P(r, s));
  var u = i.reduce(function(d, c) {
    var f = n != null && n.ISOWeek ? Ve(c) : Ue(c, n), h = d.find(function(m) {
      return m.weekNumber === f;
    });
    return h ? (h.dates.push(c), d) : (d.push({
      weekNumber: f,
      dates: [c]
    }), d);
  }, []);
  return u;
}
function nr(e, t) {
  var n = He(C(e), xe(e), t);
  if (t != null && t.useFixedWeeks) {
    var a = Tn(e, t);
    if (a < 6) {
      var r = n[n.length - 1], o = r.dates[r.dates.length - 1], i = be(o, 6 - a), s = He(be(o, 1), i, t);
      n.push.apply(n, s);
    }
  }
  return n;
}
function ar(e) {
  var t, n, a, r = _(), o = r.locale, i = r.classNames, s = r.styles, u = r.hideHead, d = r.fixedWeeks, c = r.components, f = r.weekStartsOn, h = r.firstWeekContainsDate, m = r.ISOWeek, g = nr(e.displayMonth, {
    useFixedWeeks: !!d,
    ISOWeek: m,
    locale: o,
    weekStartsOn: f,
    firstWeekContainsDate: h
  }), x = (t = c == null ? void 0 : c.Head) !== null && t !== void 0 ? t : ga, w = (n = c == null ? void 0 : c.Row) !== null && n !== void 0 ? n : tr, k = (a = c == null ? void 0 : c.Footer) !== null && a !== void 0 ? a : va;
  return l.jsxs("table", { id: e.id, className: i.table, style: s.table, role: "grid", "aria-labelledby": e["aria-labelledby"], children: [!u && l.jsx(x, {}), l.jsx("tbody", { className: i.tbody, style: s.tbody, children: g.map(function(p) {
    return l.jsx(w, { displayMonth: e.displayMonth, dates: p.dates, weekNumber: p.weekNumber }, p.weekNumber);
  }) }), l.jsx(k, { displayMonth: e.displayMonth })] });
}
function rr() {
  return !!(typeof window < "u" && window.document && window.document.createElement);
}
var or = rr() ? _t : re, ye = !1, ir = 0;
function Ae() {
  return "react-day-picker-".concat(++ir);
}
function sr(e) {
  var t, n = e ?? (ye ? Ae() : null), a = U(n), r = a[0], o = a[1];
  return or(function() {
    r === null && o(Ae());
  }, []), re(function() {
    ye === !1 && (ye = !0);
  }, []), (t = e ?? r) !== null && t !== void 0 ? t : void 0;
}
function lr(e) {
  var t, n, a = _(), r = a.dir, o = a.classNames, i = a.styles, s = a.components, u = ee().displayMonths, d = sr(a.id ? "".concat(a.id, "-").concat(e.displayIndex) : void 0), c = a.id ? "".concat(a.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], h = i.month, m = e.displayIndex === 0, g = e.displayIndex === u.length - 1, x = !m && !g;
  r === "rtl" && (t = [m, g], g = t[0], m = t[1]), m && (f.push(o.caption_start), h = y(y({}, h), i.caption_start)), g && (f.push(o.caption_end), h = y(y({}, h), i.caption_end)), x && (f.push(o.caption_between), h = y(y({}, h), i.caption_between));
  var w = (n = s == null ? void 0 : s.Caption) !== null && n !== void 0 ? n : ma;
  return l.jsxs("div", { className: f.join(" "), style: h, children: [l.jsx(w, { id: d, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), l.jsx(ar, { id: c, "aria-labelledby": d, displayMonth: e.displayMonth })] }, e.displayIndex);
}
function ur(e) {
  var t = _(), n = t.classNames, a = t.styles;
  return l.jsx("div", { className: n.months, style: a.months, children: e.children });
}
function cr(e) {
  var t, n, a = e.initialProps, r = _(), o = Ce(), i = ee(), s = U(!1), u = s[0], d = s[1];
  re(function() {
    r.initialFocus && o.focusTarget && (u || (o.focus(o.focusTarget), d(!0)));
  }, [
    r.initialFocus,
    u,
    o.focus,
    o.focusTarget,
    o
  ]);
  var c = [r.classNames.root, r.className];
  r.numberOfMonths > 1 && c.push(r.classNames.multiple_months), r.showWeekNumber && c.push(r.classNames.with_weeknumber);
  var f = y(y({}, r.styles.root), r.style), h = Object.keys(a).filter(function(g) {
    return g.startsWith("data-");
  }).reduce(function(g, x) {
    var w;
    return y(y({}, g), (w = {}, w[x] = a[x], w));
  }, {}), m = (n = (t = a.components) === null || t === void 0 ? void 0 : t.Months) !== null && n !== void 0 ? n : ur;
  return l.jsx("div", y({ className: c.join(" "), style: f, dir: r.dir, id: r.id, nonce: a.nonce, title: a.title, lang: a.lang }, h, { children: l.jsx(m, { children: i.displayMonths.map(function(g, x) {
    return l.jsx(lr, { displayIndex: x, displayMonth: g }, x);
  }) }) }));
}
function dr(e) {
  var t = e.children, n = Fn(e, ["children"]);
  return l.jsx(ea, { initialProps: n, children: l.jsx(ca, { children: l.jsx(Xa, { initialProps: n, children: l.jsx(pa, { initialProps: n, children: l.jsx(Ma, { initialProps: n, children: l.jsx(Sa, { children: l.jsx(qa, { children: t }) }) }) }) }) }) });
}
function fr(e) {
  return l.jsx(dr, y({}, e, { children: l.jsx(cr, { initialProps: e }) }));
}
function lt({
  className: e,
  classNames: t,
  fromDate: n,
  toDate: a,
  showOutsideDays: r = !0,
  ...o
}) {
  return /* @__PURE__ */ l.jsx(
    fr,
    {
      fromDate: n,
      toDate: a || void 0,
      showOutsideDays: r,
      className: $("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",
        nav_button: $(Se({ color: "minimal", variant: "icon" })),
        table: "w-full border-collapse space-y-1",
        row: "flex w-full mt-2 gap-0.5",
        cell: "h-8 w-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: $(
          Se({ 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__ */ l.jsxs("div", { className: "px-2", children: [
          /* @__PURE__ */ l.jsxs("span", { className: "text-emphasis font-semibold leading-none", children: [
            We(i.displayMonth).format("MMMM"),
            " "
          ] }),
          /* @__PURE__ */ l.jsx("span", { className: "text-subtle font-medium leading-none", children: We(i.displayMonth).format("YYYY") })
        ] }),
        IconLeft: () => /* @__PURE__ */ l.jsx(Te, { name: "chevron-left", className: "h-4 w-4 stroke-2" }),
        IconRight: () => /* @__PURE__ */ l.jsx(Te, { name: "chevron-right", className: "h-4 w-4 stroke-2" })
      },
      ...o
    }
  );
}
lt.displayName = "Calendar";
function vr({
  className: e,
  dates: t,
  minDate: n,
  maxDate: a,
  onDatesChange: r,
  disabled: o,
  withoutPopover: i,
  "data-testid": s
}) {
  function u(f) {
    if (t != null && t.endDate)
      r({ startDate: f, endDate: void 0 });
    else {
      const h = t.startDate ? f < t.startDate ? f : t.startDate : f, m = t.startDate ? f < t.startDate ? t.startDate : f : void 0;
      r({ startDate: h, endDate: m });
    }
  }
  const d = n ?? /* @__PURE__ */ new Date(), c = /* @__PURE__ */ l.jsx(
    lt,
    {
      initialFocus: !0,
      fromDate: n === null ? void 0 : d,
      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 ? c : /* @__PURE__ */ l.jsx("div", { className: $("grid gap-2", e), children: /* @__PURE__ */ l.jsxs(wt, { children: [
    /* @__PURE__ */ l.jsx(pt, { asChild: !0, children: /* @__PURE__ */ l.jsx(
      xt,
      {
        "data-testid": "date-range",
        color: "secondary",
        EndIcon: "calendar",
        className: $("justify-between text-left font-normal", !t && "text-subtle"),
        children: t != null && t.startDate ? t != null && t.endDate ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
          Y(t.startDate, "LLL dd, y"),
          " - ",
          Y(t.endDate, "LLL dd, y")
        ] }) : /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
          Y(t.startDate, "LLL dd, y"),
          " - End"
        ] }) : /* @__PURE__ */ l.jsx("span", { children: "Pick a date" })
      }
    ) }),
    /* @__PURE__ */ l.jsx(
      Dt,
      {
        className: "bg-default text-emphasis z-50 w-auto rounded-md border p-0 outline-none",
        align: "start",
        sideOffset: 4,
        side: "bottom",
        avoidCollisions: !1,
        children: c
      }
    )
  ] }) });
}
export {
  vr as DatePickerWithRange
};
