import { aJ as l, aX as J, h as Se, bp as We, aH as Ye, bq as wt, br as pt, e as xt, bs as Dt } from "./index-THhC4TET.js";
import { createContext as H, forwardRef as Mt, useContext as A, useState as U, useEffect as ae, 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 C(e, t) {
  return e instanceof Date ? new e.constructor(t) : new Date(t);
}
function P(e, t) {
  const n = D(e);
  return isNaN(t) ? C(e, NaN) : (t && n.setDate(n.getDate() + t), n);
}
function S(e, t) {
  const n = D(e);
  if (isNaN(t))
    return C(e, NaN);
  if (!t)
    return n;
  const r = n.getDate(), a = C(e, n.getTime());
  a.setMonth(n.getMonth() + t + 1, 0);
  const o = a.getDate();
  return r >= o ? a : (n.setFullYear(
    a.getFullYear(),
    a.getMonth(),
    r
  ), n);
}
const we = 6048e5, Nt = 864e5;
let Pt = {};
function z() {
  return Pt;
}
function F(e, t) {
  var s, u, d, c;
  const n = z(), r = (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, a = D(e), o = a.getDay(), i = (o < r ? 7 : 0) + o - r;
  return a.setDate(a.getDate() - i), a.setHours(0, 0, 0, 0), a;
}
function B(e) {
  return F(e, { weekStartsOn: 1 });
}
function qe(e) {
  const t = D(e), n = t.getFullYear(), r = C(e, 0);
  r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
  const a = B(r), o = C(e, 0);
  o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0);
  const i = B(o);
  return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= i.getTime() ? n : n - 1;
}
function X(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 Y(e, t) {
  const n = X(e), r = X(t), a = +n - ne(n), o = +r - ne(r);
  return Math.round((a - o) / Nt);
}
function Ot(e) {
  const t = qe(e), n = C(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 jt(e, t) {
  return S(e, t * 12);
}
function Ct(e) {
  let t;
  return e.forEach(function(n) {
    const r = D(n);
    (t === void 0 || t < r || isNaN(Number(r))) && (t = r);
  }), t || /* @__PURE__ */ new Date(NaN);
}
function St(e) {
  let t;
  return e.forEach((n) => {
    const r = D(n);
    (!t || t > r || isNaN(+r)) && (t = r);
  }), t || /* @__PURE__ */ new Date(NaN);
}
function O(e, t) {
  const n = X(e), r = X(t);
  return +n == +r;
}
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 K(e, t) {
  const n = D(e), r = D(t), a = n.getFullYear() - r.getFullYear(), o = n.getMonth() - r.getMonth();
  return a * 12 + o;
}
function Yt(e, t, n) {
  const r = F(e, n), a = F(t, n), o = +r - ne(r), i = +a - ne(a);
  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 j(e) {
  const t = D(e);
  return t.setDate(1), t.setHours(0, 0, 0, 0), t;
}
function Xe(e) {
  const t = D(e), n = C(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 = z(), r = (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, a = D(e), o = a.getDay(), i = (o < r ? -7 : 0) + 6 - (o - r);
  return a.setDate(a.getDate() + i), a.setHours(23, 59, 59, 999), a;
}
function Qe(e) {
  return De(e, { weekStartsOn: 1 });
}
const Tt = {
  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 r;
  const a = Tt[e];
  return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
};
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, r) => Bt[e];
function G(e) {
  return (t, n) => {
    const r = n != null && n.context ? String(n.context) : "standalone";
    let a;
    if (r === "formatting" && e.formattingValues) {
      const i = e.defaultFormattingWidth || e.defaultWidth, s = n != null && n.width ? String(n.width) : i;
      a = e.formattingValues[s] || e.formattingValues[i];
    } else {
      const i = e.defaultWidth, s = n != null && n.width ? String(n.width) : e.defaultWidth;
      a = e.values[s] || e.values[i];
    }
    const o = e.argumentCallback ? e.argumentCallback(t) : t;
    return a[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"]
}, Xt = {
  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"
  ]
}, Qt = {
  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"
  }
}, $t = {
  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), r = n % 100;
  if (r > 20 || r < 10)
    switch (r % 10) {
      case 1:
        return n + "st";
      case 2:
        return n + "nd";
      case 3:
        return n + "rd";
    }
  return n + "th";
}, Ut = {
  ordinalNumber: Jt,
  era: G({
    values: At,
    defaultWidth: "wide"
  }),
  quarter: G({
    values: qt,
    defaultWidth: "wide",
    argumentCallback: (e) => e - 1
  }),
  month: G({
    values: Xt,
    defaultWidth: "wide"
  }),
  day: G({
    values: Qt,
    defaultWidth: "wide"
  }),
  dayPeriod: G({
    values: Gt,
    defaultWidth: "wide",
    formattingValues: $t,
    defaultFormattingWidth: "wide"
  })
};
function $(e) {
  return (t, n = {}) => {
    const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], o = t.match(a);
    if (!o)
      return null;
    const i = o[0], s = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(s) ? zt(s, (f) => f.test(i)) : (
      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
      Kt(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 Kt(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 Zt(e) {
  return (t, n = {}) => {
    const r = t.match(e.matchPattern);
    if (!r)
      return null;
    const a = r[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(a.length);
    return { value: i, rest: s };
  };
}
const Vt = /^(\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]
}, rn = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, an = {
  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: Vt,
    parsePattern: en,
    valueCallback: (e) => parseInt(e, 10)
  }),
  era: $({
    matchPatterns: tn,
    defaultMatchWidth: "wide",
    parsePatterns: nn,
    defaultParseWidth: "any"
  }),
  quarter: $({
    matchPatterns: rn,
    defaultMatchWidth: "wide",
    parsePatterns: an,
    defaultParseWidth: "any",
    valueCallback: (e) => e + 1
  }),
  month: $({
    matchPatterns: on,
    defaultMatchWidth: "wide",
    parsePatterns: sn,
    defaultParseWidth: "any"
  }),
  day: $({
    matchPatterns: ln,
    defaultMatchWidth: "wide",
    parsePatterns: un,
    defaultParseWidth: "any"
  }),
  dayPeriod: $({
    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 mn(e) {
  const t = D(e);
  return Y(t, Xe(t)) + 1;
}
function $e(e) {
  const t = D(e), n = +B(t) - +Ot(t);
  return Math.round(n / we) + 1;
}
function Je(e, t) {
  var c, f, m, h;
  const n = D(e), r = n.getFullYear(), a = z(), 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) ?? a.firstWeekContainsDate ?? ((h = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, i = C(e, 0);
  i.setFullYear(r + 1, 0, o), i.setHours(0, 0, 0, 0);
  const s = F(i, t), u = C(e, 0);
  u.setFullYear(r, 0, o), u.setHours(0, 0, 0, 0);
  const d = F(u, t);
  return n.getTime() >= s.getTime() ? r + 1 : n.getTime() >= d.getTime() ? r : r - 1;
}
function hn(e, t) {
  var s, u, d, c;
  const n = z(), r = (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, a = Je(e, t), o = C(e, 0);
  return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), F(o, t);
}
function Ue(e, t) {
  const n = D(e), r = +F(n, t) - +hn(n, t);
  return Math.round(r / we) + 1;
}
function M(e, t) {
  const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
  return n + r;
}
const E = {
  // Year
  y(e, t) {
    const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
    return M(t === "yy" ? r % 100 : r, 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, r = e.getMilliseconds(), a = Math.trunc(
      r * Math.pow(10, n - 3)
    );
    return M(a, t.length);
  }
}, q = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, Te = {
  // Era
  G: function(e, t, n) {
    const r = e.getFullYear() > 0 ? 1 : 0;
    switch (t) {
      case "G":
      case "GG":
      case "GGG":
        return n.era(r, { width: "abbreviated" });
      case "GGGGG":
        return n.era(r, { width: "narrow" });
      case "GGGG":
      default:
        return n.era(r, { width: "wide" });
    }
  },
  // Year
  y: function(e, t, n) {
    if (t === "yo") {
      const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
      return n.ordinalNumber(a, { unit: "year" });
    }
    return E.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, n, r) {
    const a = Je(e, r), o = a > 0 ? a : 1 - a;
    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 r = Math.ceil((e.getMonth() + 1) / 3);
    switch (t) {
      case "Q":
        return String(r);
      case "QQ":
        return M(r, 2);
      case "Qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      case "QQQ":
        return n.quarter(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return n.quarter(r, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return n.quarter(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(e, t, n) {
    const r = Math.ceil((e.getMonth() + 1) / 3);
    switch (t) {
      case "q":
        return String(r);
      case "qq":
        return M(r, 2);
      case "qo":
        return n.ordinalNumber(r, { unit: "quarter" });
      case "qqq":
        return n.quarter(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return n.quarter(r, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return n.quarter(r, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(e, t, n) {
    const r = e.getMonth();
    switch (t) {
      case "M":
      case "MM":
        return E.M(e, t);
      case "Mo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      case "MMM":
        return n.month(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return n.month(r, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return n.month(r, { width: "wide", context: "formatting" });
    }
  },
  // Stand-alone month
  L: function(e, t, n) {
    const r = e.getMonth();
    switch (t) {
      case "L":
        return String(r + 1);
      case "LL":
        return M(r + 1, 2);
      case "Lo":
        return n.ordinalNumber(r + 1, { unit: "month" });
      case "LLL":
        return n.month(r, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return n.month(r, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return n.month(r, { width: "wide", context: "standalone" });
    }
  },
  // Local week of year
  w: function(e, t, n, r) {
    const a = Ue(e, r);
    return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : M(a, t.length);
  },
  // ISO week of year
  I: function(e, t, n) {
    const r = $e(e);
    return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : M(r, 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 r = mn(e);
    return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : M(r, t.length);
  },
  // Day of week
  E: function(e, t, n) {
    const r = e.getDay();
    switch (t) {
      case "E":
      case "EE":
      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"
        });
    }
  },
  // Local day of week
  e: function(e, t, n, r) {
    const a = e.getDay(), o = (a - r.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(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"
        });
    }
  },
  // Stand-alone local day of week
  c: function(e, t, n, r) {
    const a = e.getDay(), o = (a - r.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(a, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return n.day(a, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return n.day(a, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return n.day(a, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(e, t, n) {
    const r = e.getDay(), a = r === 0 ? 7 : r;
    switch (t) {
      case "i":
        return String(a);
      case "ii":
        return M(a, t.length);
      case "io":
        return n.ordinalNumber(a, { unit: "day" });
      case "iii":
        return n.day(r, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return n.day(r, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return n.day(r, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return n.day(r, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(e, t, n) {
    const a = e.getHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(e, t, n) {
    const r = e.getHours();
    let a;
    switch (r === 12 ? a = q.noon : r === 0 ? a = q.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
      case "b":
      case "bb":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(e, t, n) {
    const r = e.getHours();
    let a;
    switch (r >= 17 ? a = q.evening : r >= 12 ? a = q.afternoon : r >= 4 ? a = q.morning : a = q.night, t) {
      case "B":
      case "BB":
      case "BBB":
        return n.dayPeriod(a, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return n.dayPeriod(a, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return n.dayPeriod(a, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(e, t, n) {
    if (t === "ho") {
      let r = e.getHours() % 12;
      return r === 0 && (r = 12), n.ordinalNumber(r, { 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 r = e.getHours() % 12;
    return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : M(r, t.length);
  },
  // Hour [1-24]
  k: function(e, t, n) {
    let r = e.getHours();
    return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : M(r, 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 r = e.getTimezoneOffset();
    if (r === 0)
      return "Z";
    switch (t) {
      case "X":
        return Le(r);
      case "XXXX":
      case "XX":
        return R(r);
      case "XXXXX":
      case "XXX":
      default:
        return R(r, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(e, t, n) {
    const r = e.getTimezoneOffset();
    switch (t) {
      case "x":
        return Le(r);
      case "xxxx":
      case "xx":
        return R(r);
      case "xxxxx":
      case "xxx":
      default:
        return R(r, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, n) {
    const r = e.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + Fe(r, ":");
      case "OOOO":
      default:
        return "GMT" + R(r, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, n) {
    const r = e.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + Fe(r, ":");
      case "zzzz":
      default:
        return "GMT" + R(r, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, n) {
    const r = Math.trunc(e.getTime() / 1e3);
    return M(r, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, n) {
    const r = e.getTime();
    return M(r, t.length);
  }
};
function Fe(e, t = "") {
  const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), o = r % 60;
  return o === 0 ? n + String(a) : n + String(a) + 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 ? "-" : "+", r = Math.abs(e), a = M(Math.trunc(r / 60), 2), o = M(r % 60, 2);
  return n + a + 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" });
  }
}, Ke = (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+)?/) || [], r = n[1], a = n[2];
  if (!a)
    return Ee(e, t);
  let o;
  switch (r) {
    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(r, t)).replace("{{time}}", Ke(a, t));
}, yn = {
  p: Ke,
  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 r = Mn(e, t, n);
  if (console.warn(r), wn.includes(e))
    throw new RangeError(r);
}
function Mn(e, t, n) {
  const r = e[0] === "Y" ? "years" : "days of the month";
  return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} 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 T(e, t, n) {
  var c, f, m, h, g, x, w, k;
  const r = z(), a = (n == null ? void 0 : n.locale) ?? r.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) ?? r.firstWeekContainsDate ?? ((h = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : h.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) ?? r.weekStartsOn ?? ((k = (w = r.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, a.formatLong);
    }
    return p;
  }).join("").match(_n).map((p) => {
    if (p === "''")
      return { isToken: !1, value: "'" };
    const N = p[0];
    if (N === "'")
      return { isToken: !1, value: jn(p) };
    if (Te[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 };
  });
  a.localize.preprocessor && (u = a.localize.preprocessor(s, u));
  const d = {
    firstWeekContainsDate: o,
    weekStartsOn: i,
    locale: a
  };
  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 = Te[N[0]];
    return I(s, N, a.localize, d);
  }).join("");
}
function jn(e) {
  const t = e.match(Nn);
  return t ? t[1].replace(Pn, "'") : e;
}
function Cn(e) {
  const t = D(e), n = t.getFullYear(), r = t.getMonth(), a = C(e, 0);
  return a.setFullYear(n, r + 1, 0), a.setHours(0, 0, 0, 0), a.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 Yn(e, t) {
  return Yt(
    Wn(e),
    j(e),
    t
  ) + 1;
}
function ge(e, t) {
  const n = D(e), r = D(t);
  return n.getTime() > r.getTime();
}
function ze(e, t) {
  const n = D(e), r = D(t);
  return +n < +r;
}
function Me(e, t) {
  const n = D(e), r = D(t);
  return n.getFullYear() === r.getFullYear() && n.getMonth() === r.getMonth();
}
function Tn(e, t) {
  const n = D(e), r = D(t);
  return n.getFullYear() === r.getFullYear();
}
function de(e, t) {
  return P(e, -t);
}
function fe(e, t) {
  const n = D(e), r = n.getFullYear(), a = n.getDate(), o = C(e, 0);
  o.setFullYear(r, t, 15), o.setHours(0, 0, 0, 0);
  const i = Cn(o);
  return n.setMonth(t, Math.min(a, i)), n;
}
function Ie(e, t) {
  const n = D(e);
  return isNaN(+n) ? C(e, NaN) : (n.setFullYear(t), n);
}
var y = function() {
  return y = Object.assign || function(t) {
    for (var n, r = 1, a = arguments.length; r < a; r++) {
      n = arguments[r];
      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 r in e)
    Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
      t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
  return n;
}
function Ze(e, t, n) {
  if (n || arguments.length === 2)
    for (var r = 0, a = t.length, o; r < a; r++)
      (o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);
  return e.concat(o || Array.prototype.slice.call(t));
}
function Z(e) {
  return e.mode === "multiple";
}
function V(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 T(e, "LLLL y", t);
}
function In(e, t) {
  return T(e, "d", t);
}
function Rn(e, t) {
  return T(e, "LLLL", t);
}
function Bn(e) {
  return "".concat(e);
}
function Hn(e, t) {
  return T(e, "cccccc", t);
}
function An(e, t) {
  return T(e, "yyyy", t);
}
var qn = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  formatCaption: En,
  formatDay: In,
  formatMonthCaption: Rn,
  formatWeekNumber: Bn,
  formatWeekdayName: Hn,
  formatYearCaption: An
}), Xn = function(e, t, n) {
  return T(e, "do MMMM (EEEE)", n);
}, Qn = function() {
  return "Month: ";
}, Gn = function() {
  return "Go to next month";
}, $n = function() {
  return "Go to previous month";
}, Jn = function(e, t) {
  return T(e, "cccc", t);
}, Un = function(e) {
  return "Week n. ".concat(e);
}, Kn = function() {
  return "Year: ";
}, zn = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  labelDay: Xn,
  labelMonthDropdown: Qn,
  labelNext: Gn,
  labelPrevious: $n,
  labelWeekNumber: Un,
  labelWeekday: Jn,
  labelYearDropdown: Kn
});
function Zn() {
  var e = "buttons", t = Ln, n = Ge, r = {}, a = {}, o = 1, i = {}, s = /* @__PURE__ */ new Date();
  return {
    captionLayout: e,
    classNames: t,
    formatters: qn,
    labels: zn,
    locale: n,
    modifiersClassNames: r,
    modifiers: a,
    numberOfMonths: o,
    styles: i,
    today: s,
    mode: "default"
  };
}
function Vn(e) {
  var t = e.fromYear, n = e.toYear, r = e.fromMonth, a = e.toMonth, o = e.fromDate, i = e.toDate;
  return r ? o = j(r) : t && (o = new Date(t, 0, 1)), a ? i = xe(a) : n && (i = new Date(n, 11, 31)), {
    fromDate: o ? X(o) : void 0,
    toDate: i ? X(i) : void 0
  };
}
var Ve = H(void 0);
function er(e) {
  var t, n = e.initialProps, r = Zn(), a = Vn(n), o = a.fromDate, i = a.toDate, s = (t = n.captionLayout) !== null && t !== void 0 ? t : r.captionLayout;
  s !== "buttons" && (!o || !i) && (s = "buttons");
  var u;
  (oe(n) || Z(n) || V(n)) && (u = n.onSelect);
  var d = y(y(y({}, r), n), { captionLayout: s, classNames: y(y({}, r.classNames), n.classNames), components: y({}, n.components), formatters: y(y({}, r.formatters), n.formatters), fromDate: o, labels: y(y({}, r.labels), n.labels), mode: n.mode || r.mode, modifiers: y(y({}, r.modifiers), n.modifiers), modifiersClassNames: y(y({}, r.modifiersClassNames), n.modifiersClassNames), onSelect: u, styles: y(y({}, r.styles), n.styles), toDate: i });
  return l.jsx(Ve.Provider, { value: d, children: e.children });
}
function _() {
  var e = A(Ve);
  if (!e)
    throw new Error("useDayPicker must be used within a DayPickerProvider.");
  return e;
}
function et(e) {
  var t = _(), n = t.locale, r = t.classNames, a = t.styles, o = t.formatters.formatCaption;
  return l.jsx("div", { className: r.caption_label, style: a.caption_label, "aria-live": "polite", role: "presentation", id: e.id, children: o(e.displayMonth, { locale: n }) });
}
function tr(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, r = e.onChange, a = 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 : tr;
  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: a, onChange: r, 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 nr(e) {
  var t, n = _(), r = n.fromDate, a = n.toDate, o = n.styles, i = n.locale, s = n.formatters.formatMonthCaption, u = n.classNames, d = n.components, c = n.labels.labelMonthDropdown;
  if (!r)
    return l.jsx(l.Fragment, {});
  if (!a)
    return l.jsx(l.Fragment, {});
  var f = [];
  if (Tn(r, a))
    for (var m = j(r), h = r.getMonth(); h <= a.getMonth(); h++)
      f.push(fe(m, h));
  else
    for (var m = j(/* @__PURE__ */ new Date()), h = 0; h <= 11; h++)
      f.push(fe(m, h));
  var g = function(w) {
    var k = Number(w.target.value), p = fe(j(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 rr(e) {
  var t, n = e.displayMonth, r = _(), a = r.fromDate, o = r.toDate, i = r.locale, s = r.styles, u = r.classNames, d = r.components, c = r.formatters.formatYearCaption, f = r.labels.labelYearDropdown, m = [];
  if (!a)
    return l.jsx(l.Fragment, {});
  if (!o)
    return l.jsx(l.Fragment, {});
  for (var h = a.getFullYear(), g = o.getFullYear(), x = h; x <= g; x++)
    m.push(Ie(Xe(/* @__PURE__ */ new Date()), x));
  var w = function(p) {
    var N = Ie(j(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: m.map(function(p) {
    return l.jsx("option", { value: p.getFullYear(), children: c(p, { locale: i }) }, p.getFullYear());
  }) });
}
function ar(e, t) {
  var n = U(e), r = n[0], a = n[1], o = t === void 0 ? r : t;
  return [o, a];
}
function or(e) {
  var t = e.month, n = e.defaultMonth, r = e.today, a = t || n || r || /* @__PURE__ */ new Date(), o = e.toDate, i = e.fromDate, s = e.numberOfMonths, u = s === void 0 ? 1 : s;
  if (o && K(o, a) < 0) {
    var d = -1 * (u - 1);
    a = S(o, d);
  }
  return i && K(a, i) < 0 && (a = i), j(a);
}
function ir() {
  var e = _(), t = or(e), n = ar(t, e.month), r = n[0], a = n[1], o = function(i) {
    var s;
    if (!e.disableNavigation) {
      var u = j(i);
      a(u), (s = e.onMonthChange) === null || s === void 0 || s.call(e, u);
    }
  };
  return [r, o];
}
function sr(e, t) {
  for (var n = t.reverseMonths, r = t.numberOfMonths, a = j(e), o = j(S(a, r)), i = K(o, a), s = [], u = 0; u < i; u++) {
    var d = S(a, u);
    s.push(d);
  }
  return n && (s = s.reverse()), s;
}
function lr(e, t) {
  if (!t.disableNavigation) {
    var n = t.toDate, r = t.pagedNavigation, a = t.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, s = j(e);
    if (!n)
      return S(s, i);
    var u = K(n, e);
    if (!(u < o))
      return S(s, i);
  }
}
function ur(e, t) {
  if (!t.disableNavigation) {
    var n = t.fromDate, r = t.pagedNavigation, a = t.numberOfMonths, o = a === void 0 ? 1 : a, i = r ? o : 1, s = j(e);
    if (!n)
      return S(s, -i);
    var u = K(s, n);
    if (!(u <= 0))
      return S(s, -i);
  }
}
var nt = H(void 0);
function cr(e) {
  var t = _(), n = ir(), r = n[0], a = n[1], o = sr(r, t), i = lr(r, t), s = ur(r, t), u = function(f) {
    return o.some(function(m) {
      return Me(f, m);
    });
  }, d = function(f, m) {
    u(f) || (m && ze(f, m) ? a(S(f, 1 + t.numberOfMonths * -1)) : a(f));
  }, c = {
    currentMonth: r,
    displayMonths: o,
    goToMonth: a,
    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 = _(), r = n.classNames, a = 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: r.caption_dropdowns, style: a.caption_dropdowns, children: [l.jsx("div", { className: r.vhidden, children: d }), l.jsx(nr, { onChange: s, displayMonth: e.displayMonth }), l.jsx(rr, { onChange: s, displayMonth: e.displayMonth })] });
}
function dr(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 fr(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 re = Mt(function(e, t) {
  var n = _(), r = n.classNames, a = n.styles, o = [r.button_reset, r.button];
  e.className && o.push(e.className);
  var i = o.join(" "), s = y(y({}, a.button_reset), a.button);
  return e.style && Object.assign(s, e.style), l.jsx("button", y({}, e, { ref: t, type: "button", className: i, style: s }));
});
function mr(e) {
  var t, n, r = _(), a = r.dir, o = r.locale, i = r.classNames, s = r.styles, u = r.labels, d = u.labelPrevious, c = u.labelNext, f = r.components;
  if (!e.nextMonth && !e.previousMonth)
    return l.jsx(l.Fragment, {});
  var m = d(e.previousMonth, { locale: o }), h = [
    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 : fr, k = (n = f == null ? void 0 : f.IconLeft) !== null && n !== void 0 ? n : dr;
  return l.jsxs("div", { className: i.nav, style: s.nav, children: [!e.hidePrevious && l.jsx(re, { name: "previous-month", "aria-label": m, className: h, style: s.nav_button_previous, disabled: !e.previousMonth, onClick: e.onPreviousClick, children: a === "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(re, { name: "next-month", "aria-label": g, className: x, style: s.nav_button_next, disabled: !e.nextMonth, onClick: e.onNextClick, children: a === "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(), r = n.previousMonth, a = 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), m = function() {
    r && o(r);
  }, h = function() {
    a && o(a);
  };
  return l.jsx(mr, { displayMonth: e.displayMonth, hideNext: c, hidePrevious: f, nextMonth: a, previousMonth: r, onPreviousClick: m, onNextClick: h });
}
function hr(e) {
  var t, n = _(), r = n.classNames, a = 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 a ? 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: r.caption, style: o.caption, children: d });
}
function vr(e) {
  var t = _(), n = t.footer, r = t.styles, a = t.classNames.tfoot;
  return n ? l.jsx("tfoot", { className: a, style: r.tfoot, children: l.jsx("tr", { children: l.jsx("td", { colSpan: 8, children: n }) }) }) : l.jsx(l.Fragment, {});
}
function yr(e, t, n) {
  for (var r = n ? B(/* @__PURE__ */ new Date()) : F(/* @__PURE__ */ new Date(), { locale: e, weekStartsOn: t }), a = [], o = 0; o < 7; o++) {
    var i = P(r, o);
    a.push(i);
  }
  return a;
}
function br() {
  var e = _(), t = e.classNames, n = e.styles, r = e.showWeekNumber, a = e.locale, o = e.weekStartsOn, i = e.ISOWeek, s = e.formatters.formatWeekdayName, u = e.labels.labelWeekday, d = yr(a, o, i);
  return l.jsxs("tr", { style: n.head_row, className: t.head_row, children: [r && 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: a }), children: s(c, { locale: a }) }, f);
  })] });
}
function gr() {
  var e, t = _(), n = t.classNames, r = t.styles, a = t.components, o = (e = a == null ? void 0 : a.HeadRow) !== null && e !== void 0 ? e : br;
  return l.jsx("thead", { style: r.head, className: n.head, children: l.jsx(o, {}) });
}
function wr(e) {
  var t = _(), n = t.locale, r = t.formatters.formatDay;
  return l.jsx(l.Fragment, { children: r(e.date, { locale: n }) });
}
var _e = H(void 0);
function pr(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(xr, { initialProps: e.initialProps, children: e.children });
}
function xr(e) {
  var t = e.initialProps, n = e.children, r = t.selected, a = t.min, o = t.max, i = function(d, c, f) {
    var m, h;
    (m = t.onDayClick) === null || m === void 0 || m.call(t, d, c, f);
    var g = !!(c.selected && a && (r == null ? void 0 : r.length) === a);
    if (!g) {
      var x = !!(!c.selected && o && (r == null ? void 0 : r.length) === o);
      if (!x) {
        var w = r ? Ze([], r, !0) : [];
        if (c.selected) {
          var k = w.findIndex(function(p) {
            return O(d, p);
          });
          w.splice(k, 1);
        } else
          w.push(d);
        (h = t.onSelect) === null || h === void 0 || h.call(t, w, d, c, f);
      }
    }
  }, s = {
    disabled: []
  };
  r && s.disabled.push(function(d) {
    var c = o && r.length > o - 1, f = r.some(function(m) {
      return O(m, d);
    });
    return !!(c && !f);
  });
  var u = {
    selected: r,
    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 Dr(e, t) {
  var n = t || {}, r = n.from, a = n.to;
  return r && a ? O(a, e) && O(r, e) ? void 0 : O(a, e) ? { from: a, to: void 0 } : O(r, e) ? void 0 : ge(r, e) ? { from: e, to: a } : { from: r, to: e } : a ? ge(e, a) ? { from: a, to: e } : { from: e, to: a } : r ? ze(e, r) ? { from: e, to: r } : { from: r, to: e } : { from: e, to: void 0 };
}
var Ne = H(void 0);
function Mr(e) {
  if (!V(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(_r, { initialProps: e.initialProps, children: e.children });
}
function _r(e) {
  var t = e.initialProps, n = e.children, r = t.selected, a = r || {}, o = a.from, i = a.to, s = t.min, u = t.max, d = function(h, g, x) {
    var w, k;
    (w = t.onDayClick) === null || w === void 0 || w.call(t, h, g, x);
    var p = Dr(h, r);
    (k = t.onSelect) === null || k === void 0 || k.call(t, p, h, 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 = Y(i, o) + 1, m = u - f;
      c.disabled.push({
        before: de(o, m)
      }), c.disabled.push({
        after: P(i, m)
      });
    }
    !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: r, 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 kr(e) {
  var t = {};
  return Object.entries(e).forEach(function(n) {
    var r = n[0], a = n[1];
    t[r] = te(a);
  }), 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 Nr = W.Selected, L = W.Disabled, Pr = W.Hidden, Or = W.Today, me = W.RangeEnd, he = W.RangeMiddle, ve = W.RangeStart, jr = W.Outside;
function Cr(e, t, n) {
  var r, a = (r = {}, r[Nr] = te(e.selected), r[L] = te(e.disabled), r[Pr] = te(e.hidden), r[Or] = [e.today], r[me] = [], r[he] = [], r[ve] = [], r[jr] = [], r);
  return e.fromDate && a[L].push({ before: e.fromDate }), e.toDate && a[L].push({ after: e.toDate }), Z(e) ? a[L] = a[L].concat(t.modifiers[L]) : V(e) && (a[L] = a[L].concat(n.modifiers[L]), a[ve] = n.modifiers[ve], a[he] = n.modifiers[he], a[me] = n.modifiers[me]), a;
}
var rt = H(void 0);
function Sr(e) {
  var t = _(), n = ke(), r = Pe(), a = Cr(t, n, r), o = kr(t.modifiers), i = y(y({}, a), o);
  return l.jsx(rt.Provider, { value: i, children: e.children });
}
function at() {
  var e = A(rt);
  if (!e)
    throw new Error("useModifiers must be used within a ModifiersProvider");
  return e;
}
function Wr(e) {
  return !!(e && typeof e == "object" && "before" in e && "after" in e);
}
function Yr(e) {
  return !!(e && typeof e == "object" && "from" in e);
}
function Tr(e) {
  return !!(e && typeof e == "object" && "after" in e);
}
function Fr(e) {
  return !!(e && typeof e == "object" && "before" in e);
}
function Lr(e) {
  return !!(e && typeof e == "object" && "dayOfWeek" in e);
}
function Er(e, t) {
  var n, r = t.from, a = t.to;
  if (r && a) {
    var o = Y(a, r) < 0;
    o && (n = [a, r], r = n[0], a = n[1]);
    var i = Y(e, r) >= 0 && Y(a, e) >= 0;
    return i;
  }
  return a ? O(a, e) : r ? O(r, e) : !1;
}
function Ir(e) {
  return pe(e);
}
function Rr(e) {
  return Array.isArray(e) && e.every(pe);
}
function Br(e, t) {
  return t.some(function(n) {
    if (typeof n == "boolean")
      return n;
    if (Ir(n))
      return O(e, n);
    if (Rr(n))
      return n.includes(e);
    if (Yr(n))
      return Er(e, n);
    if (Lr(n))
      return n.dayOfWeek.includes(e.getDay());
    if (Wr(n)) {
      var r = Y(n.before, e), a = Y(n.after, e), o = r > 0, i = a < 0, s = ge(n.before, n.after);
      return s ? i && o : o || i;
    }
    return Tr(n) ? Y(e, n.after) > 0 : Fr(n) ? Y(n.before, e) > 0 : typeof n == "function" ? n(e) : !1;
  });
}
function Oe(e, t, n) {
  var r = Object.keys(t).reduce(function(o, i) {
    var s = t[i];
    return Br(e, s) && o.push(i), o;
  }, []), a = {};
  return r.forEach(function(o) {
    return a[o] = !0;
  }), n && !Me(e, n) && (a.outside = !0), a;
}
function Hr(e, t) {
  for (var n = j(e[0]), r = xe(e[e.length - 1]), a, o, i = n; i <= r; ) {
    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), a || (a = i), i = P(i, 1);
  }
  return o || a;
}
var Ar = 365;
function ot(e, t) {
  var n = t.moveBy, r = t.direction, a = t.context, o = t.modifiers, i = t.retry, s = i === void 0 ? { count: 0, lastFocused: e } : i, u = a.weekStartsOn, d = a.fromDate, c = a.toDate, f = a.locale, m = {
    day: P,
    week: be,
    month: S,
    year: jt,
    startOfWeek: function(w) {
      return a.ISOWeek ? B(w) : F(w, { locale: f, weekStartsOn: u });
    },
    endOfWeek: function(w) {
      return a.ISOWeek ? Qe(w) : De(w, { locale: f, weekStartsOn: u });
    }
  }, h = m[n](e, r === "after" ? 1 : -1);
  r === "before" && d ? h = Ct([d, h]) : r === "after" && c && (h = St([c, h]));
  var g = !0;
  if (o) {
    var x = Oe(h, o);
    g = !x.disabled && !x.hidden;
  }
  return g ? h : s.count > Ar ? s.lastFocused : ot(h, {
    moveBy: n,
    direction: r,
    context: a,
    modifiers: o,
    retry: y(y({}, s), { count: s.count + 1 })
  });
}
var it = H(void 0);
function qr(e) {
  var t = ee(), n = at(), r = U(), a = r[0], o = r[1], i = U(), s = i[0], u = i[1], d = Hr(t.displayMonths, n), c = a ?? (s && t.isDateDisplayed(s)) ? s : d, f = function() {
    u(a), o(void 0);
  }, m = function(w) {
    o(w);
  }, h = _(), g = function(w, k) {
    if (a) {
      var p = ot(a, {
        moveBy: w,
        direction: k,
        context: h,
        modifiers: n
      });
      O(a, p) || (t.goToDate(p, a), m(p));
    }
  }, x = {
    focusedDay: a,
    focusTarget: c,
    blur: f,
    focus: m,
    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 je() {
  var e = A(it);
  if (!e)
    throw new Error("useFocusContext must be used within a FocusProvider");
  return e;
}
function Xr(e, t) {
  var n = at(), r = Oe(e, n, t);
  return r;
}
var Ce = H(void 0);
function Qr(e) {
  if (!oe(e.initialProps)) {
    var t = {
      selected: void 0
    };
    return l.jsx(Ce.Provider, { value: t, children: e.children });
  }
  return l.jsx(Gr, { initialProps: e.initialProps, children: e.children });
}
function Gr(e) {
  var t = e.initialProps, n = e.children, r = 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);
  }, a = {
    selected: t.selected,
    onDayClick: r
  };
  return l.jsx(Ce.Provider, { value: a, children: n });
}
function st() {
  var e = A(Ce);
  if (!e)
    throw new Error("useSelectSingle must be used within a SelectSingleProvider");
  return e;
}
function $r(e, t) {
  var n = _(), r = st(), a = ke(), o = Pe(), i = je(), s = i.focusDayAfter, u = i.focusDayBefore, d = i.focusWeekAfter, c = i.focusWeekBefore, f = i.blur, m = i.focus, h = 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 = r.onDayClick) === null || v === void 0 || v.call(r, e, t, b) : Z(n) ? (se = a.onDayClick) === null || se === void 0 || se.call(a, e, t, b) : V(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;
    m(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);
  }, Q = 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);
  }, mt = function(b) {
    var v;
    (v = n.onDayTouchEnd) === null || v === void 0 || v.call(n, e, t, b);
  }, ht = 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() : h();
        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: Q,
    onMouseLeave: ut,
    onPointerEnter: ct,
    onPointerLeave: dt,
    onTouchCancel: ft,
    onTouchEnd: mt,
    onTouchMove: ht,
    onTouchStart: vt
  };
  return gt;
}
function Jr() {
  var e = _(), t = st(), n = ke(), r = Pe(), a = oe(e) ? t.selected : Z(e) ? n.selected : V(e) ? r.selected : void 0;
  return a;
}
function Ur(e) {
  return Object.values(W).includes(e);
}
function Kr(e, t) {
  var n = [e.classNames.day];
  return Object.keys(t).forEach(function(r) {
    var a = e.modifiersClassNames[r];
    if (a)
      n.push(a);
    else if (Ur(r)) {
      var o = e.classNames["day_".concat(r)];
      o && n.push(o);
    }
  }), n;
}
function zr(e, t) {
  var n = y({}, e.styles.day);
  return Object.keys(t).forEach(function(r) {
    var a;
    n = y(y({}, n), (a = e.modifiersStyles) === null || a === void 0 ? void 0 : a[r]);
  }), n;
}
function Zr(e, t, n) {
  var r, a, o, i = _(), s = je(), u = Xr(e, t), d = $r(e, u), c = Jr(), f = !!(i.onDayClick || i.mode !== "default");
  ae(function() {
    var Q;
    u.outside || s.focusedDay && f && O(s.focusedDay, e) && ((Q = n.current) === null || Q === void 0 || Q.focus());
  }, [
    s.focusedDay,
    e,
    n,
    f,
    u.outside
  ]);
  var m = Kr(i, u).join(" "), h = zr(i, u), g = !!(u.outside && !i.showOutsideDays || u.hidden), x = (o = (a = i.components) === null || a === void 0 ? void 0 : a.DayContent) !== null && o !== void 0 ? o : wr, w = l.jsx(x, { date: e, displayMonth: t, activeModifiers: u }), k = {
    style: h,
    className: m,
    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), (r = { disabled: u.disabled, role: "gridcell" }, r["aria-selected"] = u.selected, r.tabIndex = N || p ? 0 : -1, r)), d), ie = {
    isButton: f,
    isHidden: g,
    activeModifiers: u,
    selectedDays: c,
    buttonProps: I,
    divProps: k
  };
  return ie;
}
function Vr(e) {
  var t = kt(null), n = Zr(e.date, e.displayMonth, t);
  return n.isHidden ? l.jsx("div", { role: "gridcell" }) : n.isButton ? l.jsx(re, y({ name: "day", ref: t }, n.buttonProps)) : l.jsx("div", y({}, n.divProps));
}
function ea(e) {
  var t = e.number, n = e.dates, r = _(), a = r.onWeekNumberClick, o = r.styles, i = r.classNames, s = r.locale, u = r.labels.labelWeekNumber, d = r.formatters.formatWeekNumber, c = d(Number(t), { locale: s });
  if (!a)
    return l.jsx("span", { className: i.weeknumber, style: o.weeknumber, children: c });
  var f = u(Number(t), { locale: s }), m = function(h) {
    a(t, n, h);
  };
  return l.jsx(re, { name: "week-number", "aria-label": f, className: i.weeknumber, style: o.weeknumber, onClick: m, children: c });
}
function ta(e) {
  var t, n, r = _(), a = r.styles, o = r.classNames, i = r.showWeekNumber, s = r.components, u = (t = s == null ? void 0 : s.Day) !== null && t !== void 0 ? t : Vr, d = (n = s == null ? void 0 : s.WeekNumber) !== null && n !== void 0 ? n : ea, c;
  return i && (c = l.jsx("td", { className: o.cell, style: a.cell, children: l.jsx(d, { number: e.weekNumber, dates: e.dates }) })), l.jsxs("tr", { className: o.row, style: a.row, children: [c, e.dates.map(function(f) {
    return l.jsx("td", { className: o.cell, style: a.cell, role: "presentation", children: l.jsx(u, { displayMonth: e.displayMonth, date: f }) }, Sn(f));
  })] });
}
function He(e, t, n) {
  for (var r = n != null && n.ISOWeek ? Qe(t) : De(t, n), a = n != null && n.ISOWeek ? B(e) : F(e, n), o = Y(r, a), i = [], s = 0; s <= o; s++)
    i.push(P(a, s));
  var u = i.reduce(function(d, c) {
    var f = n != null && n.ISOWeek ? $e(c) : Ue(c, n), m = d.find(function(h) {
      return h.weekNumber === f;
    });
    return m ? (m.dates.push(c), d) : (d.push({
      weekNumber: f,
      dates: [c]
    }), d);
  }, []);
  return u;
}
function na(e, t) {
  var n = He(j(e), xe(e), t);
  if (t != null && t.useFixedWeeks) {
    var r = Yn(e, t);
    if (r < 6) {
      var a = n[n.length - 1], o = a.dates[a.dates.length - 1], i = be(o, 6 - r), s = He(be(o, 1), i, t);
      n.push.apply(n, s);
    }
  }
  return n;
}
function ra(e) {
  var t, n, r, a = _(), o = a.locale, i = a.classNames, s = a.styles, u = a.hideHead, d = a.fixedWeeks, c = a.components, f = a.weekStartsOn, m = a.firstWeekContainsDate, h = a.ISOWeek, g = na(e.displayMonth, {
    useFixedWeeks: !!d,
    ISOWeek: h,
    locale: o,
    weekStartsOn: f,
    firstWeekContainsDate: m
  }), x = (t = c == null ? void 0 : c.Head) !== null && t !== void 0 ? t : gr, w = (n = c == null ? void 0 : c.Row) !== null && n !== void 0 ? n : ta, k = (r = c == null ? void 0 : c.Footer) !== null && r !== void 0 ? r : vr;
  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 aa() {
  return !!(typeof window < "u" && window.document && window.document.createElement);
}
var oa = aa() ? _t : ae, ye = !1, ia = 0;
function Ae() {
  return "react-day-picker-".concat(++ia);
}
function sa(e) {
  var t, n = e ?? (ye ? Ae() : null), r = U(n), a = r[0], o = r[1];
  return oa(function() {
    a === null && o(Ae());
  }, []), ae(function() {
    ye === !1 && (ye = !0);
  }, []), (t = e ?? a) !== null && t !== void 0 ? t : void 0;
}
function la(e) {
  var t, n, r = _(), a = r.dir, o = r.classNames, i = r.styles, s = r.components, u = ee().displayMonths, d = sa(r.id ? "".concat(r.id, "-").concat(e.displayIndex) : void 0), c = r.id ? "".concat(r.id, "-grid-").concat(e.displayIndex) : void 0, f = [o.month], m = i.month, h = e.displayIndex === 0, g = e.displayIndex === u.length - 1, x = !h && !g;
  a === "rtl" && (t = [h, g], g = t[0], h = t[1]), h && (f.push(o.caption_start), m = y(y({}, m), i.caption_start)), g && (f.push(o.caption_end), m = y(y({}, m), i.caption_end)), x && (f.push(o.caption_between), m = y(y({}, m), i.caption_between));
  var w = (n = s == null ? void 0 : s.Caption) !== null && n !== void 0 ? n : hr;
  return l.jsxs("div", { className: f.join(" "), style: m, children: [l.jsx(w, { id: d, displayMonth: e.displayMonth, displayIndex: e.displayIndex }), l.jsx(ra, { id: c, "aria-labelledby": d, displayMonth: e.displayMonth })] }, e.displayIndex);
}
function ua(e) {
  var t = _(), n = t.classNames, r = t.styles;
  return l.jsx("div", { className: n.months, style: r.months, children: e.children });
}
function ca(e) {
  var t, n, r = e.initialProps, a = _(), o = je(), i = ee(), s = U(!1), u = s[0], d = s[1];
  ae(function() {
    a.initialFocus && o.focusTarget && (u || (o.focus(o.focusTarget), d(!0)));
  }, [
    a.initialFocus,
    u,
    o.focus,
    o.focusTarget,
    o
  ]);
  var c = [a.classNames.root, a.className];
  a.numberOfMonths > 1 && c.push(a.classNames.multiple_months), a.showWeekNumber && c.push(a.classNames.with_weeknumber);
  var f = y(y({}, a.styles.root), a.style), m = Object.keys(r).filter(function(g) {
    return g.startsWith("data-");
  }).reduce(function(g, x) {
    var w;
    return y(y({}, g), (w = {}, w[x] = r[x], w));
  }, {}), h = (n = (t = r.components) === null || t === void 0 ? void 0 : t.Months) !== null && n !== void 0 ? n : ua;
  return l.jsx("div", y({ className: c.join(" "), style: f, dir: a.dir, id: a.id, nonce: r.nonce, title: r.title, lang: r.lang }, m, { children: l.jsx(h, { children: i.displayMonths.map(function(g, x) {
    return l.jsx(la, { displayIndex: x, displayMonth: g }, x);
  }) }) }));
}
function da(e) {
  var t = e.children, n = Fn(e, ["children"]);
  return l.jsx(er, { initialProps: n, children: l.jsx(cr, { children: l.jsx(Qr, { initialProps: n, children: l.jsx(pr, { initialProps: n, children: l.jsx(Mr, { initialProps: n, children: l.jsx(Sr, { children: l.jsx(qr, { children: t }) }) }) }) }) }) });
}
function fa(e) {
  return l.jsx(da, y({}, e, { children: l.jsx(ca, { initialProps: e }) }));
}
function lt({
  className: e,
  classNames: t,
  fromDate: n,
  toDate: r,
  showOutsideDays: a = !0,
  ...o
}) {
  return /* @__PURE__ */ l.jsx(
    fa,
    {
      fromDate: n || /* @__PURE__ */ new Date(),
      toDate: r || void 0,
      showOutsideDays: a,
      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",
        nav_button: J(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: J(
          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: "day-range-end",
        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(Ye, { name: "chevron-left", className: "h-4 w-4 stroke-2" }),
        IconRight: () => /* @__PURE__ */ l.jsx(Ye, { name: "chevron-right", className: "h-4 w-4 stroke-2" })
      },
      ...o
    }
  );
}
lt.displayName = "Calendar";
function va({
  className: e,
  dates: t,
  minDate: n,
  maxDate: r,
  onDatesChange: a,
  disabled: o
}) {
  function i(s) {
    s != null && s.from && !(s != null && s.to) ? a({ startDate: s.from, endDate: s.from }) : a({ startDate: s == null ? void 0 : s.from, endDate: s == null ? void 0 : s.to });
  }
  return /* @__PURE__ */ l.jsx("div", { className: J("grid gap-2", e), children: /* @__PURE__ */ l.jsxs(wt, { children: [
    /* @__PURE__ */ l.jsx(pt, { asChild: !0, children: /* @__PURE__ */ l.jsx(
      xt,
      {
        id: "date",
        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__ */ l.jsxs(l.Fragment, { children: [
          T(t.startDate, "LLL dd, y"),
          " - ",
          T(t.endDate, "LLL dd, y")
        ] }) : T(t.startDate, "LLL dd, y") : /* @__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,
        children: /* @__PURE__ */ l.jsx(
          lt,
          {
            initialFocus: !0,
            fromDate: n,
            toDate: r,
            mode: "range",
            defaultMonth: t == null ? void 0 : t.startDate,
            selected: { from: t == null ? void 0 : t.startDate, to: t == null ? void 0 : t.endDate },
            onSelect: (s) => i(s),
            numberOfMonths: 1,
            disabled: o
          }
        )
      }
    )
  ] }) });
}
export {
  va as DatePickerWithRange
};
