@konstructio/ui 0.1.2-alpha.40 → 0.1.2-alpha.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/{Modal-CtAG97Ts.js → Modal-CjC-CIJ8.js} +2 -2
  2. package/dist/chevron-right-DYvXLeql.js +7 -0
  3. package/dist/{chevron-up-CRyLc5Ml.js → chevron-up-DEfvgPCw.js} +1 -1
  4. package/dist/components/Alert/Alert.js +2 -2
  5. package/dist/components/AlertDialog/AlertDialog.js +75 -49
  6. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
  7. package/dist/components/AlertDialog/components/index.js +1 -1
  8. package/dist/components/Badge/Badge.js +31 -30
  9. package/dist/components/Badge/Badge.variants.js +53 -16
  10. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  11. package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
  12. package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
  13. package/dist/components/Button/Button.js +1 -1
  14. package/dist/components/Card/Card.variants.js +4 -5
  15. package/dist/components/Checkbox/Checkbox.js +4 -4
  16. package/dist/components/Checkbox/Checkbox.variants.js +5 -1
  17. package/dist/components/Command/Command.js +2 -2
  18. package/dist/components/Command/components/Command.js +1 -1
  19. package/dist/components/Command/components/CommandEmpty.js +1 -1
  20. package/dist/components/Command/components/CommandGroup.js +1 -1
  21. package/dist/components/Command/components/CommandInput.js +2 -2
  22. package/dist/components/Command/components/CommandItem.js +1 -1
  23. package/dist/components/Command/components/CommandList.js +1 -1
  24. package/dist/components/Command/components/CommandSeparator.js +1 -1
  25. package/dist/components/Command/components/DialogContent.js +2 -2
  26. package/dist/components/Command/components/DialogOverlay.js +1 -1
  27. package/dist/components/Datepicker/DatePicker.js +1231 -1047
  28. package/dist/components/Dropdown/Dropdown.variants.js +3 -2
  29. package/dist/components/Dropdown/components/List/List.js +1 -1
  30. package/dist/components/Dropdown/components/Wrapper.js +42 -28
  31. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  32. package/dist/components/Filter/Filter.variants.js +6 -5
  33. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +73 -46
  34. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
  35. package/dist/components/Filter/components/ResetButton/ResetButton.js +28 -14
  36. package/dist/components/Input/Input.js +1 -1
  37. package/dist/components/Input/Input.variants.js +2 -2
  38. package/dist/components/Modal/Modal.js +1 -1
  39. package/dist/components/Modal/components/Body/Body.js +1 -1
  40. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  41. package/dist/components/Modal/components/Header/Header.js +1 -1
  42. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  43. package/dist/components/Modal/components/index.js +1 -1
  44. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +9 -9
  45. package/dist/components/NumberInput/NumberInput.js +2 -2
  46. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +358 -315
  47. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
  48. package/dist/components/PhoneNumberInput/components/Wrapper.js +58 -58
  49. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +2 -2
  50. package/dist/components/PhoneNumberInput/utils/index.js +1 -1
  51. package/dist/components/PieChart/PieChart.js +4 -4
  52. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  53. package/dist/components/Range/Range.js +1 -1
  54. package/dist/components/Slider/Slider.js +1 -1
  55. package/dist/components/Switch/Switch.js +2 -2
  56. package/dist/components/Tabs/Tabs.js +1 -1
  57. package/dist/components/Tabs/Tabs.variants.js +3 -2
  58. package/dist/components/Tabs/components/Content.js +1 -1
  59. package/dist/components/Tabs/components/List.js +1 -1
  60. package/dist/components/Tabs/components/Trigger.js +1 -1
  61. package/dist/components/Tag/Tag.js +1 -1
  62. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
  63. package/dist/components/TimePicker/TimePicker.js +1 -1
  64. package/dist/components/TimePicker/TimePicker.variants.js +20 -13
  65. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +23 -16
  66. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
  67. package/dist/components/Toast/Toast.js +8 -8
  68. package/dist/components/Tooltip/Tooltip.js +1 -1
  69. package/dist/components/Typography/Typography.js +11 -9
  70. package/dist/components/VirtualizedTable/VirtualizedTable.js +58 -54
  71. package/dist/components/VirtualizedTable/components/Actions/Actions.js +58 -26
  72. package/dist/components/VirtualizedTable/components/Body/Body.js +72 -46
  73. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +80 -77
  74. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
  75. package/dist/components/VirtualizedTable/components/Filter/Filter.js +37 -40
  76. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +19 -18
  77. package/dist/components/VirtualizedTable/components/Header/Header.js +49 -31
  78. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +36 -23
  79. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +74 -35
  80. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
  81. package/dist/components/index.js +1 -1
  82. package/dist/{index-mPY_8Y5v.js → index-AV6ZtGhy.js} +1 -1
  83. package/dist/{index-CigKKiZS.js → index-BG8O18ZY.js} +5 -3
  84. package/dist/{index-DrWQH0QF.js → index-BKjcReYh.js} +2 -2
  85. package/dist/{index--V_ZsiQe.js → index-BOE_3f_Z.js} +4 -4
  86. package/dist/{index-Dbt2vBmS.js → index-BlSRBdPy.js} +1 -1
  87. package/dist/{index-C3tHPg8y.js → index-BmVmDQGH.js} +2 -2
  88. package/dist/{index-BtQfgaSF.js → index-BvoZGpli.js} +2 -2
  89. package/dist/{index-2hB40Iuc.js → index-Byr10W8m.js} +6 -6
  90. package/dist/index-CPU02rhe.js +134 -0
  91. package/dist/{index-Ds6U2x4Z.js → index-CeZcoQDw.js} +11 -11
  92. package/dist/{index-CdwPV0FE.js → index-D9SSJ6om.js} +3 -3
  93. package/dist/{index-CIAmiWcw.js → index-DKfEnhKr.js} +2 -2
  94. package/dist/{index-CSFe9uC5.js → index-DMb4KD0b.js} +1 -1
  95. package/dist/{index-ohdbKsws.js → index-DtEcCIrM.js} +1 -1
  96. package/dist/{index-BbQkJE5L.js → index-Dy59FQl5.js} +1 -1
  97. package/dist/{index-DpW9ExsS.js → index-gSPwC-1I.js} +3 -3
  98. package/dist/{index-DH2Fnov1.js → index-vcSp8YRZ.js} +4 -4
  99. package/dist/index.d.ts +2 -1
  100. package/dist/index.js +1 -1
  101. package/dist/{libphonenumber-_7ZyKWA7.js → libphonenumber-FTwQ9nyV.js} +11 -11
  102. package/dist/package.json +21 -21
  103. package/dist/styles.css +1 -1
  104. package/dist/ui/civo-theme.css +11 -10
  105. package/dist/{x-DPU9OdYH.js → x-Eoa9FJjA.js} +1 -1
  106. package/package.json +21 -21
  107. package/dist/chevron-left-C4LEg1fH.js +0 -7
  108. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
  109. package/dist/index-C65LtGuU.js +0 -137
@@ -1,9 +1,9 @@
1
- import { jsx as Be } from "react/jsx-runtime";
2
- import l, { createContext as fn, useContext as dn, useCallback as H, useRef as De, useLayoutEffect as ln, useState as Oe, useEffect as hn, useMemo as ve } from "react";
3
- import { cn as fe } from "../../utils/index.js";
4
- import { datePickerVariants as mn } from "./DatePicker.variants.js";
5
- import { C as yn, a as gn } from "../../chevron-left-C4LEg1fH.js";
6
- import '../../DatePicker.css';function bn(e, t, r = "long") {
1
+ import { jsx as qe } from "react/jsx-runtime";
2
+ import h, { createContext as vn, useContext as Wn, useCallback as q, useRef as Se, useLayoutEffect as Sn, useState as Ce, useEffect as Nn, useMemo as Ne } from "react";
3
+ import { cn as V } from "../../utils/index.js";
4
+ import { datePickerVariants as Cn } from "./DatePicker.variants.js";
5
+ import { C as xn, a as Yn } from "../../chevron-right-DYvXLeql.js";
6
+ import '../../DatePicker.css';function Tn(e, t, r = "long") {
7
7
  return new Intl.DateTimeFormat("en-US", {
8
8
  // Enforces engine to render the time. Without the option JavaScriptCore omits it.
9
9
  hour: "numeric",
@@ -11,94 +11,94 @@ import '../../DatePicker.css';function bn(e, t, r = "long") {
11
11
  timeZoneName: r
12
12
  }).format(t).split(/\s/g).slice(2).join(" ");
13
13
  }
14
- const wn = {}, he = {};
15
- function se(e, t) {
14
+ const Pn = {}, ge = {};
15
+ function ie(e, t) {
16
16
  try {
17
- const n = (wn[e] ||= new Intl.DateTimeFormat("en-US", {
17
+ const n = (Pn[e] ||= new Intl.DateTimeFormat("en-US", {
18
18
  timeZone: e,
19
19
  timeZoneName: "longOffset"
20
20
  }).format)(t).split("GMT")[1];
21
- return n in he ? he[n] : Je(n, n.split(":"));
21
+ return n in ge ? ge[n] : it(n, n.split(":"));
22
22
  } catch {
23
- if (e in he) return he[e];
24
- const r = e?.match(pn);
25
- return r ? Je(e, r.slice(1)) : NaN;
23
+ if (e in ge) return ge[e];
24
+ const r = e?.match(En);
25
+ return r ? it(e, r.slice(1)) : NaN;
26
26
  }
27
27
  }
28
- const pn = /([+-]\d\d):?(\d\d)?/;
29
- function Je(e, t) {
28
+ const En = /([+-]\d\d):?(\d\d)?/;
29
+ function it(e, t) {
30
30
  const r = +(t[0] || 0), n = +(t[1] || 0), o = +(t[2] || 0) / 60;
31
- return he[e] = r * 60 + n > 0 ? r * 60 + n + o : r * 60 - n - o;
31
+ return ge[e] = r * 60 + n > 0 ? r * 60 + n + o : r * 60 - n - o;
32
32
  }
33
- class U extends Date {
33
+ class J extends Date {
34
34
  //#region static
35
35
  constructor(...t) {
36
- super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(se(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), lt(this), Re(this)) : this.setTime(Date.now());
36
+ super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ie(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), Mt(this), Qe(this)) : this.setTime(Date.now());
37
37
  }
38
38
  static tz(t, ...r) {
39
- return r.length ? new U(...r, t) : new U(Date.now(), t);
39
+ return r.length ? new J(...r, t) : new J(Date.now(), t);
40
40
  }
41
41
  //#endregion
42
42
  //#region time zone
43
43
  withTimeZone(t) {
44
- return new U(+this, t);
44
+ return new J(+this, t);
45
45
  }
46
46
  getTimezoneOffset() {
47
- const t = -se(this.timeZone, this);
47
+ const t = -ie(this.timeZone, this);
48
48
  return t > 0 ? Math.floor(t) : Math.ceil(t);
49
49
  }
50
50
  //#endregion
51
51
  //#region time
52
52
  setTime(t) {
53
- return Date.prototype.setTime.apply(this, arguments), Re(this), +this;
53
+ return Date.prototype.setTime.apply(this, arguments), Qe(this), +this;
54
54
  }
55
55
  //#endregion
56
56
  //#region date-fns integration
57
- [Symbol.for("constructDateFrom")](t) {
58
- return new U(+new Date(t), this.timeZone);
57
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
58
+ return new J(+new Date(t), this.timeZone);
59
59
  }
60
60
  //#endregion
61
61
  }
62
- const et = /^(get|set)(?!UTC)/;
62
+ const ct = /^(get|set)(?!UTC)/;
63
63
  Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
64
- if (!et.test(e)) return;
65
- const t = e.replace(et, "$1UTC");
66
- U.prototype[t] && (e.startsWith("get") ? U.prototype[e] = function() {
64
+ if (!ct.test(e)) return;
65
+ const t = e.replace(ct, "$1UTC");
66
+ J.prototype[t] && (e.startsWith("get") ? J.prototype[e] = function() {
67
67
  return this.internal[t]();
68
- } : (U.prototype[e] = function() {
69
- return Date.prototype[t].apply(this.internal, arguments), Mn(this), +this;
70
- }, U.prototype[t] = function() {
71
- return Date.prototype[t].apply(this, arguments), Re(this), +this;
68
+ } : (J.prototype[e] = function() {
69
+ return Date.prototype[t].apply(this.internal, arguments), _n(this), +this;
70
+ }, J.prototype[t] = function() {
71
+ return Date.prototype[t].apply(this, arguments), Qe(this), +this;
72
72
  }));
73
73
  });
74
- function Re(e) {
75
- e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-se(e.timeZone, e) * 60));
74
+ function Qe(e) {
75
+ e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-ie(e.timeZone, e) * 60));
76
76
  }
77
- function Mn(e) {
78
- Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), lt(e);
77
+ function _n(e) {
78
+ Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), Mt(e);
79
79
  }
80
- function lt(e) {
81
- const t = se(e.timeZone, e), r = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
80
+ function Mt(e) {
81
+ const t = ie(e.timeZone, e), r = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
82
82
  n.setUTCHours(n.getUTCHours() - 1);
83
- const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), a = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), s = o - a, i = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
84
- s && i && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + s);
83
+ const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), i = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), a = o - i, s = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
84
+ a && s && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + a);
85
85
  const c = o - r;
86
86
  c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
87
- const f = /* @__PURE__ */ new Date(+e);
88
- f.setUTCSeconds(0);
89
- const d = o > 0 ? f.getSeconds() : (f.getSeconds() - 60) % 60, u = Math.round(-(se(e.timeZone, e) * 60)) % 60;
90
- (u || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + d));
91
- const h = se(e.timeZone, e), b = h > 0 ? Math.floor(h) : Math.ceil(h), C = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - b, M = b !== r, O = C - c;
92
- if (M && O) {
93
- Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + O);
94
- const N = se(e.timeZone, e), p = N > 0 ? Math.floor(N) : Math.ceil(N), D = b - p;
87
+ const u = /* @__PURE__ */ new Date(+e);
88
+ u.setUTCSeconds(0);
89
+ const f = o > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, l = Math.round(-(ie(e.timeZone, e) * 60)) % 60;
90
+ (l || f) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + l), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + l + f));
91
+ const d = ie(e.timeZone, e), w = d > 0 ? Math.floor(d) : Math.ceil(d), N = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - w, k = w !== r, v = N - c;
92
+ if (k && v) {
93
+ Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + v);
94
+ const Y = ie(e.timeZone, e), p = Y > 0 ? Math.floor(Y) : Math.ceil(Y), D = w - p;
95
95
  D && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + D), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + D));
96
96
  }
97
97
  }
98
- class J extends U {
98
+ class H extends J {
99
99
  //#region static
100
100
  static tz(t, ...r) {
101
- return r.length ? new J(...r, t) : new J(Date.now(), t);
101
+ return r.length ? new H(...r, t) : new H(Date.now(), t);
102
102
  }
103
103
  //#endregion
104
104
  //#region representation
@@ -115,7 +115,7 @@ class J extends U {
115
115
  }
116
116
  toTimeString() {
117
117
  const t = this.internal.toUTCString().split(" ")[4], [r, n, o] = this.tzComponents();
118
- return `${t} GMT${r}${n}${o} (${bn(this.timeZone, this)})`;
118
+ return `${t} GMT${r}${n}${o} (${Tn(this.timeZone, this)})`;
119
119
  }
120
120
  toLocaleString(t, r) {
121
121
  return Date.prototype.toLocaleString.call(this, t, {
@@ -143,60 +143,60 @@ class J extends U {
143
143
  }
144
144
  //#endregion
145
145
  withTimeZone(t) {
146
- return new J(+this, t);
146
+ return new H(+this, t);
147
147
  }
148
148
  //#region date-fns integration
149
- [Symbol.for("constructDateFrom")](t) {
150
- return new J(+new Date(t), this.timeZone);
149
+ [/* @__PURE__ */ Symbol.for("constructDateFrom")](t) {
150
+ return new H(+new Date(t), this.timeZone);
151
151
  }
152
152
  //#endregion
153
153
  }
154
- const ht = 6048e5, kn = 864e5, tt = Symbol.for("constructDateFrom");
154
+ const kt = 6048e5, Fn = 864e5, ut = /* @__PURE__ */ Symbol.for("constructDateFrom");
155
155
  function B(e, t) {
156
- return typeof e == "function" ? e(t) : e && typeof e == "object" && tt in e ? e[tt](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
156
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && ut in e ? e[ut](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
157
157
  }
158
- function E(e, t) {
158
+ function P(e, t) {
159
159
  return B(t || e, e);
160
160
  }
161
- function mt(e, t, r) {
162
- const n = E(e, r?.in);
161
+ function Dt(e, t, r) {
162
+ const n = P(e, r?.in);
163
163
  return isNaN(t) ? B(e, NaN) : (t && n.setDate(n.getDate() + t), n);
164
164
  }
165
- function yt(e, t, r) {
166
- const n = E(e, r?.in);
165
+ function Ot(e, t, r) {
166
+ const n = P(e, r?.in);
167
167
  if (isNaN(t)) return B(e, NaN);
168
168
  if (!t)
169
169
  return n;
170
- const o = n.getDate(), a = B(e, n.getTime());
171
- a.setMonth(n.getMonth() + t + 1, 0);
172
- const s = a.getDate();
173
- return o >= s ? a : (n.setFullYear(
174
- a.getFullYear(),
175
- a.getMonth(),
170
+ const o = n.getDate(), i = B(e, n.getTime());
171
+ i.setMonth(n.getMonth() + t + 1, 0);
172
+ const a = i.getDate();
173
+ return o >= a ? i : (n.setFullYear(
174
+ i.getFullYear(),
175
+ i.getMonth(),
176
176
  o
177
177
  ), n);
178
178
  }
179
- let Dn = {};
180
- function ge() {
181
- return Dn;
179
+ let Bn = {};
180
+ function Me() {
181
+ return Bn;
182
182
  }
183
- function ce(e, t) {
184
- const r = ge(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = E(e, t?.in), a = o.getDay(), s = (a < n ? 7 : 0) + a - n;
185
- return o.setDate(o.getDate() - s), o.setHours(0, 0, 0, 0), o;
183
+ function de(e, t) {
184
+ const r = Me(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in), i = o.getDay(), a = (i < n ? 7 : 0) + i - n;
185
+ return o.setDate(o.getDate() - a), o.setHours(0, 0, 0, 0), o;
186
186
  }
187
- function me(e, t) {
188
- return ce(e, { ...t, weekStartsOn: 1 });
187
+ function we(e, t) {
188
+ return de(e, { ...t, weekStartsOn: 1 });
189
189
  }
190
- function gt(e, t) {
191
- const r = E(e, t?.in), n = r.getFullYear(), o = B(r, 0);
190
+ function vt(e, t) {
191
+ const r = P(e, t?.in), n = r.getFullYear(), o = B(r, 0);
192
192
  o.setFullYear(n + 1, 0, 4), o.setHours(0, 0, 0, 0);
193
- const a = me(o), s = B(r, 0);
194
- s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0);
195
- const i = me(s);
196
- return r.getTime() >= a.getTime() ? n + 1 : r.getTime() >= i.getTime() ? n : n - 1;
193
+ const i = we(o), a = B(r, 0);
194
+ a.setFullYear(n, 0, 4), a.setHours(0, 0, 0, 0);
195
+ const s = we(a);
196
+ return r.getTime() >= i.getTime() ? n + 1 : r.getTime() >= s.getTime() ? n : n - 1;
197
197
  }
198
- function nt(e) {
199
- const t = E(e), r = new Date(
198
+ function lt(e) {
199
+ const t = P(e), r = new Date(
200
200
  Date.UTC(
201
201
  t.getFullYear(),
202
202
  t.getMonth(),
@@ -209,123 +209,123 @@ function nt(e) {
209
209
  );
210
210
  return r.setUTCFullYear(t.getFullYear()), +e - +r;
211
211
  }
212
- function ue(e, ...t) {
212
+ function he(e, ...t) {
213
213
  const r = B.bind(
214
214
  null,
215
215
  t.find((n) => typeof n == "object")
216
216
  );
217
217
  return t.map(r);
218
218
  }
219
- function ye(e, t) {
220
- const r = E(e, t?.in);
219
+ function pe(e, t) {
220
+ const r = P(e, t?.in);
221
221
  return r.setHours(0, 0, 0, 0), r;
222
222
  }
223
- function bt(e, t, r) {
224
- const [n, o] = ue(
223
+ function Ve(e, t, r) {
224
+ const [n, o] = he(
225
225
  r?.in,
226
226
  e,
227
227
  t
228
- ), a = ye(n), s = ye(o), i = +a - nt(a), c = +s - nt(s);
229
- return Math.round((i - c) / kn);
228
+ ), i = pe(n), a = pe(o), s = +i - lt(i), c = +a - lt(a);
229
+ return Math.round((s - c) / Fn);
230
230
  }
231
- function vn(e, t) {
232
- const r = gt(e, t), n = B(e, 0);
233
- return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), me(n);
231
+ function In(e, t) {
232
+ const r = vt(e, t), n = B(e, 0);
233
+ return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), we(n);
234
234
  }
235
- function On(e, t, r) {
236
- return mt(e, t * 7, r);
235
+ function Hn(e, t, r) {
236
+ return Dt(e, t * 7, r);
237
237
  }
238
- function Wn(e, t, r) {
239
- return yt(e, t * 12, r);
238
+ function An(e, t, r) {
239
+ return Ot(e, t * 12, r);
240
240
  }
241
- function Sn(e, t) {
241
+ function qn(e, t) {
242
242
  let r, n = t?.in;
243
243
  return e.forEach((o) => {
244
244
  !n && typeof o == "object" && (n = B.bind(null, o));
245
- const a = E(o, n);
246
- (!r || r < a || isNaN(+a)) && (r = a);
245
+ const i = P(o, n);
246
+ (!r || r < i || isNaN(+i)) && (r = i);
247
247
  }), B(n, r || NaN);
248
248
  }
249
- function Cn(e, t) {
249
+ function jn(e, t) {
250
250
  let r, n = t?.in;
251
251
  return e.forEach((o) => {
252
252
  !n && typeof o == "object" && (n = B.bind(null, o));
253
- const a = E(o, n);
254
- (!r || r > a || isNaN(+a)) && (r = a);
253
+ const i = P(o, n);
254
+ (!r || r > i || isNaN(+i)) && (r = i);
255
255
  }), B(n, r || NaN);
256
256
  }
257
- function Nn(e, t, r) {
258
- const [n, o] = ue(
257
+ function Gn(e, t, r) {
258
+ const [n, o] = he(
259
259
  r?.in,
260
260
  e,
261
261
  t
262
262
  );
263
- return +ye(n) == +ye(o);
263
+ return +pe(n) == +pe(o);
264
264
  }
265
- function wt(e) {
265
+ function Wt(e) {
266
266
  return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
267
267
  }
268
- function xn(e) {
269
- return !(!wt(e) && typeof e != "number" || isNaN(+E(e)));
268
+ function $n(e) {
269
+ return !(!Wt(e) && typeof e != "number" || isNaN(+P(e)));
270
270
  }
271
- function Tn(e, t, r) {
272
- const [n, o] = ue(
271
+ function St(e, t, r) {
272
+ const [n, o] = he(
273
273
  r?.in,
274
274
  e,
275
275
  t
276
- ), a = n.getFullYear() - o.getFullYear(), s = n.getMonth() - o.getMonth();
277
- return a * 12 + s;
276
+ ), i = n.getFullYear() - o.getFullYear(), a = n.getMonth() - o.getMonth();
277
+ return i * 12 + a;
278
278
  }
279
- function Yn(e, t) {
280
- const r = E(e, t?.in), n = r.getMonth();
279
+ function Rn(e, t) {
280
+ const r = P(e, t?.in), n = r.getMonth();
281
281
  return r.setFullYear(r.getFullYear(), n + 1, 0), r.setHours(23, 59, 59, 999), r;
282
282
  }
283
- function pt(e, t) {
284
- const [r, n] = ue(e, t.start, t.end);
283
+ function Nt(e, t) {
284
+ const [r, n] = he(e, t.start, t.end);
285
285
  return { start: r, end: n };
286
286
  }
287
- function En(e, t) {
288
- const { start: r, end: n } = pt(t?.in, e);
287
+ function zn(e, t) {
288
+ const { start: r, end: n } = Nt(t?.in, e);
289
289
  let o = +r > +n;
290
- const a = o ? +r : +n, s = o ? n : r;
291
- s.setHours(0, 0, 0, 0), s.setDate(1);
292
- let i = 1;
290
+ const i = o ? +r : +n, a = o ? n : r;
291
+ a.setHours(0, 0, 0, 0), a.setDate(1);
292
+ let s = 1;
293
293
  const c = [];
294
- for (; +s <= a; )
295
- c.push(B(r, s)), s.setMonth(s.getMonth() + i);
294
+ for (; +a <= i; )
295
+ c.push(B(r, a)), a.setMonth(a.getMonth() + s);
296
296
  return o ? c.reverse() : c;
297
297
  }
298
- function Pn(e, t) {
299
- const r = E(e, t?.in);
298
+ function Qn(e, t) {
299
+ const r = P(e, t?.in);
300
300
  return r.setDate(1), r.setHours(0, 0, 0, 0), r;
301
301
  }
302
- function _n(e, t) {
303
- const r = E(e, t?.in), n = r.getFullYear();
302
+ function Vn(e, t) {
303
+ const r = P(e, t?.in), n = r.getFullYear();
304
304
  return r.setFullYear(n + 1, 0, 0), r.setHours(23, 59, 59, 999), r;
305
305
  }
306
- function Mt(e, t) {
307
- const r = E(e, t?.in);
306
+ function Ct(e, t) {
307
+ const r = P(e, t?.in);
308
308
  return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
309
309
  }
310
- function Fn(e, t) {
311
- const { start: r, end: n } = pt(t?.in, e);
310
+ function Xn(e, t) {
311
+ const { start: r, end: n } = Nt(t?.in, e);
312
312
  let o = +r > +n;
313
- const a = o ? +r : +n, s = o ? n : r;
314
- s.setHours(0, 0, 0, 0), s.setMonth(0, 1);
315
- let i = 1;
313
+ const i = o ? +r : +n, a = o ? n : r;
314
+ a.setHours(0, 0, 0, 0), a.setMonth(0, 1);
315
+ let s = 1;
316
316
  const c = [];
317
- for (; +s <= a; )
318
- c.push(B(r, s)), s.setFullYear(s.getFullYear() + i);
317
+ for (; +a <= i; )
318
+ c.push(B(r, a)), a.setFullYear(a.getFullYear() + s);
319
319
  return o ? c.reverse() : c;
320
320
  }
321
- function kt(e, t) {
322
- const r = ge(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = E(e, t?.in), a = o.getDay(), s = (a < n ? -7 : 0) + 6 - (a - n);
323
- return o.setDate(o.getDate() + s), o.setHours(23, 59, 59, 999), o;
321
+ function xt(e, t) {
322
+ const r = Me(), n = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = P(e, t?.in), i = o.getDay(), a = (i < n ? -7 : 0) + 6 - (i - n);
323
+ return o.setDate(o.getDate() + a), o.setHours(23, 59, 59, 999), o;
324
324
  }
325
- function Bn(e, t) {
326
- return kt(e, { ...t, weekStartsOn: 1 });
325
+ function Un(e, t) {
326
+ return xt(e, { ...t, weekStartsOn: 1 });
327
327
  }
328
- const In = {
328
+ const Zn = {
329
329
  lessThanXSeconds: {
330
330
  one: "less than a second",
331
331
  other: "less than {{count}} seconds"
@@ -387,77 +387,77 @@ const In = {
387
387
  one: "almost 1 year",
388
388
  other: "almost {{count}} years"
389
389
  }
390
- }, An = (e, t, r) => {
390
+ }, Kn = (e, t, r) => {
391
391
  let n;
392
- const o = In[e];
392
+ const o = Zn[e];
393
393
  return typeof o == "string" ? n = o : t === 1 ? n = o.one : n = o.other.replace("{{count}}", t.toString()), r?.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
394
394
  };
395
- function Ie(e) {
395
+ function je(e) {
396
396
  return (t = {}) => {
397
397
  const r = t.width ? String(t.width) : e.defaultWidth;
398
398
  return e.formats[r] || e.formats[e.defaultWidth];
399
399
  };
400
400
  }
401
- const Hn = {
401
+ const Jn = {
402
402
  full: "EEEE, MMMM do, y",
403
403
  long: "MMMM do, y",
404
404
  medium: "MMM d, y",
405
405
  short: "MM/dd/yyyy"
406
- }, qn = {
406
+ }, Ln = {
407
407
  full: "h:mm:ss a zzzz",
408
408
  long: "h:mm:ss a z",
409
409
  medium: "h:mm:ss a",
410
410
  short: "h:mm a"
411
- }, jn = {
411
+ }, er = {
412
412
  full: "{{date}} 'at' {{time}}",
413
413
  long: "{{date}} 'at' {{time}}",
414
414
  medium: "{{date}}, {{time}}",
415
415
  short: "{{date}}, {{time}}"
416
- }, Rn = {
417
- date: Ie({
418
- formats: Hn,
416
+ }, tr = {
417
+ date: je({
418
+ formats: Jn,
419
419
  defaultWidth: "full"
420
420
  }),
421
- time: Ie({
422
- formats: qn,
421
+ time: je({
422
+ formats: Ln,
423
423
  defaultWidth: "full"
424
424
  }),
425
- dateTime: Ie({
426
- formats: jn,
425
+ dateTime: je({
426
+ formats: er,
427
427
  defaultWidth: "full"
428
428
  })
429
- }, $n = {
429
+ }, nr = {
430
430
  lastWeek: "'last' eeee 'at' p",
431
431
  yesterday: "'yesterday at' p",
432
432
  today: "'today at' p",
433
433
  tomorrow: "'tomorrow at' p",
434
434
  nextWeek: "eeee 'at' p",
435
435
  other: "P"
436
- }, Gn = (e, t, r, n) => $n[e];
437
- function de(e) {
436
+ }, rr = (e, t, r, n) => nr[e];
437
+ function me(e) {
438
438
  return (t, r) => {
439
439
  const n = r?.context ? String(r.context) : "standalone";
440
440
  let o;
441
441
  if (n === "formatting" && e.formattingValues) {
442
- const s = e.defaultFormattingWidth || e.defaultWidth, i = r?.width ? String(r.width) : s;
443
- o = e.formattingValues[i] || e.formattingValues[s];
442
+ const a = e.defaultFormattingWidth || e.defaultWidth, s = r?.width ? String(r.width) : a;
443
+ o = e.formattingValues[s] || e.formattingValues[a];
444
444
  } else {
445
- const s = e.defaultWidth, i = r?.width ? String(r.width) : e.defaultWidth;
446
- o = e.values[i] || e.values[s];
445
+ const a = e.defaultWidth, s = r?.width ? String(r.width) : e.defaultWidth;
446
+ o = e.values[s] || e.values[a];
447
447
  }
448
- const a = e.argumentCallback ? e.argumentCallback(t) : t;
449
- return o[a];
448
+ const i = e.argumentCallback ? e.argumentCallback(t) : t;
449
+ return o[i];
450
450
  };
451
451
  }
452
- const zn = {
452
+ const or = {
453
453
  narrow: ["B", "A"],
454
454
  abbreviated: ["BC", "AD"],
455
455
  wide: ["Before Christ", "Anno Domini"]
456
- }, Qn = {
456
+ }, sr = {
457
457
  narrow: ["1", "2", "3", "4"],
458
458
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
459
459
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
460
- }, Xn = {
460
+ }, ar = {
461
461
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
462
462
  abbreviated: [
463
463
  "Jan",
@@ -487,7 +487,7 @@ const zn = {
487
487
  "November",
488
488
  "December"
489
489
  ]
490
- }, Zn = {
490
+ }, ir = {
491
491
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
492
492
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
493
493
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
@@ -500,7 +500,7 @@ const zn = {
500
500
  "Friday",
501
501
  "Saturday"
502
502
  ]
503
- }, Un = {
503
+ }, cr = {
504
504
  narrow: {
505
505
  am: "a",
506
506
  pm: "p",
@@ -531,7 +531,7 @@ const zn = {
531
531
  evening: "evening",
532
532
  night: "night"
533
533
  }
534
- }, Vn = {
534
+ }, ur = {
535
535
  narrow: {
536
536
  am: "a",
537
537
  pm: "p",
@@ -562,7 +562,7 @@ const zn = {
562
562
  evening: "in the evening",
563
563
  night: "at night"
564
564
  }
565
- }, Ln = (e, t) => {
565
+ }, lr = (e, t) => {
566
566
  const r = Number(e), n = r % 100;
567
567
  if (n > 20 || n < 10)
568
568
  switch (n % 10) {
@@ -574,89 +574,89 @@ const zn = {
574
574
  return r + "rd";
575
575
  }
576
576
  return r + "th";
577
- }, Kn = {
578
- ordinalNumber: Ln,
579
- era: de({
580
- values: zn,
577
+ }, fr = {
578
+ ordinalNumber: lr,
579
+ era: me({
580
+ values: or,
581
581
  defaultWidth: "wide"
582
582
  }),
583
- quarter: de({
584
- values: Qn,
583
+ quarter: me({
584
+ values: sr,
585
585
  defaultWidth: "wide",
586
586
  argumentCallback: (e) => e - 1
587
587
  }),
588
- month: de({
589
- values: Xn,
588
+ month: me({
589
+ values: ar,
590
590
  defaultWidth: "wide"
591
591
  }),
592
- day: de({
593
- values: Zn,
592
+ day: me({
593
+ values: ir,
594
594
  defaultWidth: "wide"
595
595
  }),
596
- dayPeriod: de({
597
- values: Un,
596
+ dayPeriod: me({
597
+ values: cr,
598
598
  defaultWidth: "wide",
599
- formattingValues: Vn,
599
+ formattingValues: ur,
600
600
  defaultFormattingWidth: "wide"
601
601
  })
602
602
  };
603
- function le(e) {
603
+ function ye(e) {
604
604
  return (t, r = {}) => {
605
- const n = r.width, o = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], a = t.match(o);
606
- if (!a)
605
+ const n = r.width, o = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], i = t.match(o);
606
+ if (!i)
607
607
  return null;
608
- const s = a[0], i = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(i) ? er(i, (u) => u.test(s)) : (
608
+ const a = i[0], s = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(s) ? hr(s, (l) => l.test(a)) : (
609
609
  // [TODO] -- I challenge you to fix the type
610
- Jn(i, (u) => u.test(s))
610
+ dr(s, (l) => l.test(a))
611
611
  );
612
- let f;
613
- f = e.valueCallback ? e.valueCallback(c) : c, f = r.valueCallback ? (
612
+ let u;
613
+ u = e.valueCallback ? e.valueCallback(c) : c, u = r.valueCallback ? (
614
614
  // [TODO] -- I challenge you to fix the type
615
- r.valueCallback(f)
616
- ) : f;
617
- const d = t.slice(s.length);
618
- return { value: f, rest: d };
615
+ r.valueCallback(u)
616
+ ) : u;
617
+ const f = t.slice(a.length);
618
+ return { value: u, rest: f };
619
619
  };
620
620
  }
621
- function Jn(e, t) {
621
+ function dr(e, t) {
622
622
  for (const r in e)
623
623
  if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
624
624
  return r;
625
625
  }
626
- function er(e, t) {
626
+ function hr(e, t) {
627
627
  for (let r = 0; r < e.length; r++)
628
628
  if (t(e[r]))
629
629
  return r;
630
630
  }
631
- function tr(e) {
631
+ function mr(e) {
632
632
  return (t, r = {}) => {
633
633
  const n = t.match(e.matchPattern);
634
634
  if (!n) return null;
635
- const o = n[0], a = t.match(e.parsePattern);
636
- if (!a) return null;
637
- let s = e.valueCallback ? e.valueCallback(a[0]) : a[0];
638
- s = r.valueCallback ? r.valueCallback(s) : s;
639
- const i = t.slice(o.length);
640
- return { value: s, rest: i };
635
+ const o = n[0], i = t.match(e.parsePattern);
636
+ if (!i) return null;
637
+ let a = e.valueCallback ? e.valueCallback(i[0]) : i[0];
638
+ a = r.valueCallback ? r.valueCallback(a) : a;
639
+ const s = t.slice(o.length);
640
+ return { value: a, rest: s };
641
641
  };
642
642
  }
643
- const nr = /^(\d+)(th|st|nd|rd)?/i, rr = /\d+/i, or = {
643
+ const yr = /^(\d+)(th|st|nd|rd)?/i, gr = /\d+/i, br = {
644
644
  narrow: /^(b|a)/i,
645
645
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
646
646
  wide: /^(before christ|before common era|anno domini|common era)/i
647
- }, sr = {
647
+ }, wr = {
648
648
  any: [/^b/i, /^(a|c)/i]
649
- }, ar = {
649
+ }, pr = {
650
650
  narrow: /^[1234]/i,
651
651
  abbreviated: /^q[1234]/i,
652
652
  wide: /^[1234](th|st|nd|rd)? quarter/i
653
- }, ir = {
653
+ }, Mr = {
654
654
  any: [/1/i, /2/i, /3/i, /4/i]
655
- }, cr = {
655
+ }, kr = {
656
656
  narrow: /^[jfmasond]/i,
657
657
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
658
658
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
659
- }, ur = {
659
+ }, Dr = {
660
660
  narrow: [
661
661
  /^j/i,
662
662
  /^f/i,
@@ -685,18 +685,18 @@ const nr = /^(\d+)(th|st|nd|rd)?/i, rr = /\d+/i, or = {
685
685
  /^n/i,
686
686
  /^d/i
687
687
  ]
688
- }, fr = {
688
+ }, Or = {
689
689
  narrow: /^[smtwf]/i,
690
690
  short: /^(su|mo|tu|we|th|fr|sa)/i,
691
691
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
692
692
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
693
- }, dr = {
693
+ }, vr = {
694
694
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
695
695
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
696
- }, lr = {
696
+ }, Wr = {
697
697
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
698
698
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
699
- }, hr = {
699
+ }, Sr = {
700
700
  any: {
701
701
  am: /^a/i,
702
702
  pm: /^p/i,
@@ -707,84 +707,84 @@ const nr = /^(\d+)(th|st|nd|rd)?/i, rr = /\d+/i, or = {
707
707
  evening: /evening/i,
708
708
  night: /night/i
709
709
  }
710
- }, mr = {
711
- ordinalNumber: tr({
712
- matchPattern: nr,
713
- parsePattern: rr,
710
+ }, Nr = {
711
+ ordinalNumber: mr({
712
+ matchPattern: yr,
713
+ parsePattern: gr,
714
714
  valueCallback: (e) => parseInt(e, 10)
715
715
  }),
716
- era: le({
717
- matchPatterns: or,
716
+ era: ye({
717
+ matchPatterns: br,
718
718
  defaultMatchWidth: "wide",
719
- parsePatterns: sr,
719
+ parsePatterns: wr,
720
720
  defaultParseWidth: "any"
721
721
  }),
722
- quarter: le({
723
- matchPatterns: ar,
722
+ quarter: ye({
723
+ matchPatterns: pr,
724
724
  defaultMatchWidth: "wide",
725
- parsePatterns: ir,
725
+ parsePatterns: Mr,
726
726
  defaultParseWidth: "any",
727
727
  valueCallback: (e) => e + 1
728
728
  }),
729
- month: le({
730
- matchPatterns: cr,
729
+ month: ye({
730
+ matchPatterns: kr,
731
731
  defaultMatchWidth: "wide",
732
- parsePatterns: ur,
732
+ parsePatterns: Dr,
733
733
  defaultParseWidth: "any"
734
734
  }),
735
- day: le({
736
- matchPatterns: fr,
735
+ day: ye({
736
+ matchPatterns: Or,
737
737
  defaultMatchWidth: "wide",
738
- parsePatterns: dr,
738
+ parsePatterns: vr,
739
739
  defaultParseWidth: "any"
740
740
  }),
741
- dayPeriod: le({
742
- matchPatterns: lr,
741
+ dayPeriod: ye({
742
+ matchPatterns: Wr,
743
743
  defaultMatchWidth: "any",
744
- parsePatterns: hr,
744
+ parsePatterns: Sr,
745
745
  defaultParseWidth: "any"
746
746
  })
747
- }, $e = {
747
+ }, fe = {
748
748
  code: "en-US",
749
- formatDistance: An,
750
- formatLong: Rn,
751
- formatRelative: Gn,
752
- localize: Kn,
753
- match: mr,
749
+ formatDistance: Kn,
750
+ formatLong: tr,
751
+ formatRelative: rr,
752
+ localize: fr,
753
+ match: Nr,
754
754
  options: {
755
755
  weekStartsOn: 0,
756
756
  firstWeekContainsDate: 1
757
757
  }
758
758
  };
759
- function yr(e, t) {
760
- const r = E(e, t?.in);
761
- return bt(r, Mt(r)) + 1;
762
- }
763
- function Dt(e, t) {
764
- const r = E(e, t?.in), n = +me(r) - +vn(r);
765
- return Math.round(n / ht) + 1;
766
- }
767
- function vt(e, t) {
768
- const r = E(e, t?.in), n = r.getFullYear(), o = ge(), a = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, s = B(t?.in || e, 0);
769
- s.setFullYear(n + 1, 0, a), s.setHours(0, 0, 0, 0);
770
- const i = ce(s, t), c = B(t?.in || e, 0);
771
- c.setFullYear(n, 0, a), c.setHours(0, 0, 0, 0);
772
- const f = ce(c, t);
773
- return +r >= +i ? n + 1 : +r >= +f ? n : n - 1;
774
- }
775
- function gr(e, t) {
776
- const r = ge(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = vt(e, t), a = B(t?.in || e, 0);
777
- return a.setFullYear(o, 0, n), a.setHours(0, 0, 0, 0), ce(a, t);
778
- }
779
- function Ot(e, t) {
780
- const r = E(e, t?.in), n = +ce(r, t) - +gr(r, t);
781
- return Math.round(n / ht) + 1;
759
+ function Cr(e, t) {
760
+ const r = P(e, t?.in);
761
+ return Ve(r, Ct(r)) + 1;
762
+ }
763
+ function Xe(e, t) {
764
+ const r = P(e, t?.in), n = +we(r) - +In(r);
765
+ return Math.round(n / kt) + 1;
766
+ }
767
+ function Yt(e, t) {
768
+ const r = P(e, t?.in), n = r.getFullYear(), o = Me(), i = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, a = B(t?.in || e, 0);
769
+ a.setFullYear(n + 1, 0, i), a.setHours(0, 0, 0, 0);
770
+ const s = de(a, t), c = B(t?.in || e, 0);
771
+ c.setFullYear(n, 0, i), c.setHours(0, 0, 0, 0);
772
+ const u = de(c, t);
773
+ return +r >= +s ? n + 1 : +r >= +u ? n : n - 1;
774
+ }
775
+ function xr(e, t) {
776
+ const r = Me(), n = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, o = Yt(e, t), i = B(t?.in || e, 0);
777
+ return i.setFullYear(o, 0, n), i.setHours(0, 0, 0, 0), de(i, t);
778
+ }
779
+ function Ue(e, t) {
780
+ const r = P(e, t?.in), n = +de(r, t) - +xr(r, t);
781
+ return Math.round(n / kt) + 1;
782
782
  }
783
783
  function T(e, t) {
784
784
  const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
785
785
  return r + n;
786
786
  }
787
- const re = {
787
+ const se = {
788
788
  // Year
789
789
  y(e, t) {
790
790
  const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
@@ -810,7 +810,6 @@ const re = {
810
810
  return r;
811
811
  case "aaaaa":
812
812
  return r[0];
813
- case "aaaa":
814
813
  default:
815
814
  return r === "am" ? "a.m." : "p.m.";
816
815
  }
@@ -838,14 +837,14 @@ const re = {
838
837
  );
839
838
  return T(o, t.length);
840
839
  }
841
- }, ie = {
840
+ }, ue = {
842
841
  midnight: "midnight",
843
842
  noon: "noon",
844
843
  morning: "morning",
845
844
  afternoon: "afternoon",
846
845
  evening: "evening",
847
846
  night: "night"
848
- }, rt = {
847
+ }, ft = {
849
848
  // Era
850
849
  G: function(e, t, r) {
851
850
  const n = e.getFullYear() > 0 ? 1 : 0;
@@ -858,8 +857,6 @@ const re = {
858
857
  // A, B
859
858
  case "GGGGG":
860
859
  return r.era(n, { width: "narrow" });
861
- // Anno Domini, Before Christ
862
- case "GGGG":
863
860
  default:
864
861
  return r.era(n, { width: "wide" });
865
862
  }
@@ -870,20 +867,20 @@ const re = {
870
867
  const n = e.getFullYear(), o = n > 0 ? n : 1 - n;
871
868
  return r.ordinalNumber(o, { unit: "year" });
872
869
  }
873
- return re.y(e, t);
870
+ return se.y(e, t);
874
871
  },
875
872
  // Local week-numbering year
876
873
  Y: function(e, t, r, n) {
877
- const o = vt(e, n), a = o > 0 ? o : 1 - o;
874
+ const o = Yt(e, n), i = o > 0 ? o : 1 - o;
878
875
  if (t === "YY") {
879
- const s = a % 100;
880
- return T(s, 2);
876
+ const a = i % 100;
877
+ return T(a, 2);
881
878
  }
882
- return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : T(a, t.length);
879
+ return t === "Yo" ? r.ordinalNumber(i, { unit: "year" }) : T(i, t.length);
883
880
  },
884
881
  // ISO week-numbering year
885
882
  R: function(e, t) {
886
- const r = gt(e);
883
+ const r = vt(e);
887
884
  return T(r, t.length);
888
885
  },
889
886
  // Extended year. This is a single number designating the year of this calendar system.
@@ -924,8 +921,6 @@ const re = {
924
921
  width: "narrow",
925
922
  context: "formatting"
926
923
  });
927
- // 1st quarter, 2nd quarter, ...
928
- case "QQQQ":
929
924
  default:
930
925
  return r.quarter(n, {
931
926
  width: "wide",
@@ -958,8 +953,6 @@ const re = {
958
953
  width: "narrow",
959
954
  context: "standalone"
960
955
  });
961
- // 1st quarter, 2nd quarter, ...
962
- case "qqqq":
963
956
  default:
964
957
  return r.quarter(n, {
965
958
  width: "wide",
@@ -973,7 +966,7 @@ const re = {
973
966
  switch (t) {
974
967
  case "M":
975
968
  case "MM":
976
- return re.M(e, t);
969
+ return se.M(e, t);
977
970
  // 1st, 2nd, ..., 12th
978
971
  case "Mo":
979
972
  return r.ordinalNumber(n + 1, { unit: "month" });
@@ -989,8 +982,6 @@ const re = {
989
982
  width: "narrow",
990
983
  context: "formatting"
991
984
  });
992
- // January, February, ..., December
993
- case "MMMM":
994
985
  default:
995
986
  return r.month(n, { width: "wide", context: "formatting" });
996
987
  }
@@ -1020,29 +1011,27 @@ const re = {
1020
1011
  width: "narrow",
1021
1012
  context: "standalone"
1022
1013
  });
1023
- // January, February, ..., December
1024
- case "LLLL":
1025
1014
  default:
1026
1015
  return r.month(n, { width: "wide", context: "standalone" });
1027
1016
  }
1028
1017
  },
1029
1018
  // Local week of year
1030
1019
  w: function(e, t, r, n) {
1031
- const o = Ot(e, n);
1020
+ const o = Ue(e, n);
1032
1021
  return t === "wo" ? r.ordinalNumber(o, { unit: "week" }) : T(o, t.length);
1033
1022
  },
1034
1023
  // ISO week of year
1035
1024
  I: function(e, t, r) {
1036
- const n = Dt(e);
1025
+ const n = Xe(e);
1037
1026
  return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : T(n, t.length);
1038
1027
  },
1039
1028
  // Day of the month
1040
1029
  d: function(e, t, r) {
1041
- return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : re.d(e, t);
1030
+ return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : se.d(e, t);
1042
1031
  },
1043
1032
  // Day of year
1044
1033
  D: function(e, t, r) {
1045
- const n = yr(e);
1034
+ const n = Cr(e);
1046
1035
  return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : T(n, t.length);
1047
1036
  },
1048
1037
  // Day of week
@@ -1069,8 +1058,6 @@ const re = {
1069
1058
  width: "short",
1070
1059
  context: "formatting"
1071
1060
  });
1072
- // Tuesday
1073
- case "EEEE":
1074
1061
  default:
1075
1062
  return r.day(n, {
1076
1063
  width: "wide",
@@ -1080,17 +1067,17 @@ const re = {
1080
1067
  },
1081
1068
  // Local day of week
1082
1069
  e: function(e, t, r, n) {
1083
- const o = e.getDay(), a = (o - n.weekStartsOn + 8) % 7 || 7;
1070
+ const o = e.getDay(), i = (o - n.weekStartsOn + 8) % 7 || 7;
1084
1071
  switch (t) {
1085
1072
  // Numerical value (Nth day of week with current locale or weekStartsOn)
1086
1073
  case "e":
1087
- return String(a);
1074
+ return String(i);
1088
1075
  // Padded numerical value
1089
1076
  case "ee":
1090
- return T(a, 2);
1077
+ return T(i, 2);
1091
1078
  // 1st, 2nd, ..., 7th
1092
1079
  case "eo":
1093
- return r.ordinalNumber(a, { unit: "day" });
1080
+ return r.ordinalNumber(i, { unit: "day" });
1094
1081
  case "eee":
1095
1082
  return r.day(o, {
1096
1083
  width: "abbreviated",
@@ -1108,8 +1095,6 @@ const re = {
1108
1095
  width: "short",
1109
1096
  context: "formatting"
1110
1097
  });
1111
- // Tuesday
1112
- case "eeee":
1113
1098
  default:
1114
1099
  return r.day(o, {
1115
1100
  width: "wide",
@@ -1119,17 +1104,17 @@ const re = {
1119
1104
  },
1120
1105
  // Stand-alone local day of week
1121
1106
  c: function(e, t, r, n) {
1122
- const o = e.getDay(), a = (o - n.weekStartsOn + 8) % 7 || 7;
1107
+ const o = e.getDay(), i = (o - n.weekStartsOn + 8) % 7 || 7;
1123
1108
  switch (t) {
1124
1109
  // Numerical value (same as in `e`)
1125
1110
  case "c":
1126
- return String(a);
1111
+ return String(i);
1127
1112
  // Padded numerical value
1128
1113
  case "cc":
1129
- return T(a, t.length);
1114
+ return T(i, t.length);
1130
1115
  // 1st, 2nd, ..., 7th
1131
1116
  case "co":
1132
- return r.ordinalNumber(a, { unit: "day" });
1117
+ return r.ordinalNumber(i, { unit: "day" });
1133
1118
  case "ccc":
1134
1119
  return r.day(o, {
1135
1120
  width: "abbreviated",
@@ -1147,8 +1132,6 @@ const re = {
1147
1132
  width: "short",
1148
1133
  context: "standalone"
1149
1134
  });
1150
- // Tuesday
1151
- case "cccc":
1152
1135
  default:
1153
1136
  return r.day(o, {
1154
1137
  width: "wide",
@@ -1187,8 +1170,6 @@ const re = {
1187
1170
  width: "short",
1188
1171
  context: "formatting"
1189
1172
  });
1190
- // Tuesday
1191
- case "iiii":
1192
1173
  default:
1193
1174
  return r.day(n, {
1194
1175
  width: "wide",
@@ -1216,7 +1197,6 @@ const re = {
1216
1197
  width: "narrow",
1217
1198
  context: "formatting"
1218
1199
  });
1219
- case "aaaa":
1220
1200
  default:
1221
1201
  return r.dayPeriod(o, {
1222
1202
  width: "wide",
@@ -1228,7 +1208,7 @@ const re = {
1228
1208
  b: function(e, t, r) {
1229
1209
  const n = e.getHours();
1230
1210
  let o;
1231
- switch (n === 12 ? o = ie.noon : n === 0 ? o = ie.midnight : o = n / 12 >= 1 ? "pm" : "am", t) {
1211
+ switch (n === 12 ? o = ue.noon : n === 0 ? o = ue.midnight : o = n / 12 >= 1 ? "pm" : "am", t) {
1232
1212
  case "b":
1233
1213
  case "bb":
1234
1214
  return r.dayPeriod(o, {
@@ -1245,7 +1225,6 @@ const re = {
1245
1225
  width: "narrow",
1246
1226
  context: "formatting"
1247
1227
  });
1248
- case "bbbb":
1249
1228
  default:
1250
1229
  return r.dayPeriod(o, {
1251
1230
  width: "wide",
@@ -1257,7 +1236,7 @@ const re = {
1257
1236
  B: function(e, t, r) {
1258
1237
  const n = e.getHours();
1259
1238
  let o;
1260
- switch (n >= 17 ? o = ie.evening : n >= 12 ? o = ie.afternoon : n >= 4 ? o = ie.morning : o = ie.night, t) {
1239
+ switch (n >= 17 ? o = ue.evening : n >= 12 ? o = ue.afternoon : n >= 4 ? o = ue.morning : o = ue.night, t) {
1261
1240
  case "B":
1262
1241
  case "BB":
1263
1242
  case "BBB":
@@ -1270,7 +1249,6 @@ const re = {
1270
1249
  width: "narrow",
1271
1250
  context: "formatting"
1272
1251
  });
1273
- case "BBBB":
1274
1252
  default:
1275
1253
  return r.dayPeriod(o, {
1276
1254
  width: "wide",
@@ -1284,11 +1262,11 @@ const re = {
1284
1262
  let n = e.getHours() % 12;
1285
1263
  return n === 0 && (n = 12), r.ordinalNumber(n, { unit: "hour" });
1286
1264
  }
1287
- return re.h(e, t);
1265
+ return se.h(e, t);
1288
1266
  },
1289
1267
  // Hour [0-23]
1290
1268
  H: function(e, t, r) {
1291
- return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : re.H(e, t);
1269
+ return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : se.H(e, t);
1292
1270
  },
1293
1271
  // Hour [0-11]
1294
1272
  K: function(e, t, r) {
@@ -1302,15 +1280,15 @@ const re = {
1302
1280
  },
1303
1281
  // Minute
1304
1282
  m: function(e, t, r) {
1305
- return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : re.m(e, t);
1283
+ return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : se.m(e, t);
1306
1284
  },
1307
1285
  // Second
1308
1286
  s: function(e, t, r) {
1309
- return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : re.s(e, t);
1287
+ return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : se.s(e, t);
1310
1288
  },
1311
1289
  // Fraction of second
1312
1290
  S: function(e, t) {
1313
- return re.S(e, t);
1291
+ return se.S(e, t);
1314
1292
  },
1315
1293
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1316
1294
  X: function(e, t, r) {
@@ -1320,21 +1298,16 @@ const re = {
1320
1298
  switch (t) {
1321
1299
  // Hours and optional minutes
1322
1300
  case "X":
1323
- return st(n);
1301
+ return ht(n);
1324
1302
  // Hours, minutes and optional seconds without `:` delimiter
1325
1303
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1326
1304
  // so this token always has the same output as `XX`
1327
1305
  case "XXXX":
1328
1306
  case "XX":
1329
- return oe(n);
1330
- // Hours, minutes and optional seconds with `:` delimiter
1331
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1332
- // so this token always has the same output as `XXX`
1333
- case "XXXXX":
1334
- case "XXX":
1307
+ return ae(n);
1335
1308
  // Hours and minutes with `:` delimiter
1336
1309
  default:
1337
- return oe(n, ":");
1310
+ return ae(n, ":");
1338
1311
  }
1339
1312
  },
1340
1313
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
@@ -1343,21 +1316,16 @@ const re = {
1343
1316
  switch (t) {
1344
1317
  // Hours and optional minutes
1345
1318
  case "x":
1346
- return st(n);
1319
+ return ht(n);
1347
1320
  // Hours, minutes and optional seconds without `:` delimiter
1348
1321
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1349
1322
  // so this token always has the same output as `xx`
1350
1323
  case "xxxx":
1351
1324
  case "xx":
1352
- return oe(n);
1353
- // Hours, minutes and optional seconds with `:` delimiter
1354
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1355
- // so this token always has the same output as `xxx`
1356
- case "xxxxx":
1357
- case "xxx":
1325
+ return ae(n);
1358
1326
  // Hours and minutes with `:` delimiter
1359
1327
  default:
1360
- return oe(n, ":");
1328
+ return ae(n, ":");
1361
1329
  }
1362
1330
  },
1363
1331
  // Timezone (GMT)
@@ -1368,11 +1336,9 @@ const re = {
1368
1336
  case "O":
1369
1337
  case "OO":
1370
1338
  case "OOO":
1371
- return "GMT" + ot(n, ":");
1372
- // Long
1373
- case "OOOO":
1339
+ return "GMT" + dt(n, ":");
1374
1340
  default:
1375
- return "GMT" + oe(n, ":");
1341
+ return "GMT" + ae(n, ":");
1376
1342
  }
1377
1343
  },
1378
1344
  // Timezone (specific non-location)
@@ -1383,11 +1349,9 @@ const re = {
1383
1349
  case "z":
1384
1350
  case "zz":
1385
1351
  case "zzz":
1386
- return "GMT" + ot(n, ":");
1387
- // Long
1388
- case "zzzz":
1352
+ return "GMT" + dt(n, ":");
1389
1353
  default:
1390
- return "GMT" + oe(n, ":");
1354
+ return "GMT" + ae(n, ":");
1391
1355
  }
1392
1356
  },
1393
1357
  // Seconds timestamp
@@ -1400,18 +1364,18 @@ const re = {
1400
1364
  return T(+e, t.length);
1401
1365
  }
1402
1366
  };
1403
- function ot(e, t = "") {
1404
- const r = e > 0 ? "-" : "+", n = Math.abs(e), o = Math.trunc(n / 60), a = n % 60;
1405
- return a === 0 ? r + String(o) : r + String(o) + t + T(a, 2);
1367
+ function dt(e, t = "") {
1368
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), o = Math.trunc(n / 60), i = n % 60;
1369
+ return i === 0 ? r + String(o) : r + String(o) + t + T(i, 2);
1406
1370
  }
1407
- function st(e, t) {
1408
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) : oe(e, t);
1371
+ function ht(e, t) {
1372
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) : ae(e, t);
1409
1373
  }
1410
- function oe(e, t = "") {
1411
- const r = e > 0 ? "-" : "+", n = Math.abs(e), o = T(Math.trunc(n / 60), 2), a = T(n % 60, 2);
1412
- return r + o + t + a;
1374
+ function ae(e, t = "") {
1375
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), o = T(Math.trunc(n / 60), 2), i = T(n % 60, 2);
1376
+ return r + o + t + i;
1413
1377
  }
1414
- const at = (e, t) => {
1378
+ const mt = (e, t) => {
1415
1379
  switch (e) {
1416
1380
  case "P":
1417
1381
  return t.date({ width: "short" });
@@ -1419,11 +1383,10 @@ const at = (e, t) => {
1419
1383
  return t.date({ width: "medium" });
1420
1384
  case "PPP":
1421
1385
  return t.date({ width: "long" });
1422
- case "PPPP":
1423
1386
  default:
1424
1387
  return t.date({ width: "full" });
1425
1388
  }
1426
- }, Wt = (e, t) => {
1389
+ }, Tt = (e, t) => {
1427
1390
  switch (e) {
1428
1391
  case "p":
1429
1392
  return t.time({ width: "short" });
@@ -1431,149 +1394,179 @@ const at = (e, t) => {
1431
1394
  return t.time({ width: "medium" });
1432
1395
  case "ppp":
1433
1396
  return t.time({ width: "long" });
1434
- case "pppp":
1435
1397
  default:
1436
1398
  return t.time({ width: "full" });
1437
1399
  }
1438
- }, br = (e, t) => {
1400
+ }, Yr = (e, t) => {
1439
1401
  const r = e.match(/(P+)(p+)?/) || [], n = r[1], o = r[2];
1440
1402
  if (!o)
1441
- return at(e, t);
1442
- let a;
1403
+ return mt(e, t);
1404
+ let i;
1443
1405
  switch (n) {
1444
1406
  case "P":
1445
- a = t.dateTime({ width: "short" });
1407
+ i = t.dateTime({ width: "short" });
1446
1408
  break;
1447
1409
  case "PP":
1448
- a = t.dateTime({ width: "medium" });
1410
+ i = t.dateTime({ width: "medium" });
1449
1411
  break;
1450
1412
  case "PPP":
1451
- a = t.dateTime({ width: "long" });
1413
+ i = t.dateTime({ width: "long" });
1452
1414
  break;
1453
- case "PPPP":
1454
1415
  default:
1455
- a = t.dateTime({ width: "full" });
1416
+ i = t.dateTime({ width: "full" });
1456
1417
  break;
1457
1418
  }
1458
- return a.replace("{{date}}", at(n, t)).replace("{{time}}", Wt(o, t));
1459
- }, wr = {
1460
- p: Wt,
1461
- P: br
1462
- }, pr = /^D+$/, Mr = /^Y+$/, kr = ["D", "DD", "YY", "YYYY"];
1463
- function Dr(e) {
1464
- return pr.test(e);
1419
+ return i.replace("{{date}}", mt(n, t)).replace("{{time}}", Tt(o, t));
1420
+ }, Tr = {
1421
+ p: Tt,
1422
+ P: Yr
1423
+ }, Pr = /^D+$/, Er = /^Y+$/, _r = ["D", "DD", "YY", "YYYY"];
1424
+ function Fr(e) {
1425
+ return Pr.test(e);
1465
1426
  }
1466
- function vr(e) {
1467
- return Mr.test(e);
1427
+ function Br(e) {
1428
+ return Er.test(e);
1468
1429
  }
1469
- function Or(e, t, r) {
1470
- const n = Wr(e, t, r);
1471
- if (console.warn(n), kr.includes(e)) throw new RangeError(n);
1430
+ function Ir(e, t, r) {
1431
+ const n = Hr(e, t, r);
1432
+ if (console.warn(n), _r.includes(e)) throw new RangeError(n);
1472
1433
  }
1473
- function Wr(e, t, r) {
1434
+ function Hr(e, t, r) {
1474
1435
  const n = e[0] === "Y" ? "years" : "days of the month";
1475
1436
  return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1476
1437
  }
1477
- const Sr = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Cr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Nr = /^'([^]*?)'?$/, xr = /''/g, Tr = /[a-zA-Z]/;
1478
- function Yr(e, t, r) {
1479
- const n = ge(), o = r?.locale ?? n.locale ?? $e, a = r?.firstWeekContainsDate ?? r?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, i = E(e, r?.in);
1480
- if (!xn(i))
1438
+ const Ar = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, qr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, jr = /^'([^]*?)'?$/, Gr = /''/g, $r = /[a-zA-Z]/;
1439
+ function be(e, t, r) {
1440
+ const n = Me(), o = r?.locale ?? n.locale ?? fe, i = r?.firstWeekContainsDate ?? r?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, a = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = P(e, r?.in);
1441
+ if (!$n(s))
1481
1442
  throw new RangeError("Invalid time value");
1482
- let c = t.match(Cr).map((d) => {
1483
- const u = d[0];
1484
- if (u === "p" || u === "P") {
1485
- const h = wr[u];
1486
- return h(d, o.formatLong);
1443
+ let c = t.match(qr).map((f) => {
1444
+ const l = f[0];
1445
+ if (l === "p" || l === "P") {
1446
+ const d = Tr[l];
1447
+ return d(f, o.formatLong);
1487
1448
  }
1488
- return d;
1489
- }).join("").match(Sr).map((d) => {
1490
- if (d === "''")
1449
+ return f;
1450
+ }).join("").match(Ar).map((f) => {
1451
+ if (f === "''")
1491
1452
  return { isToken: !1, value: "'" };
1492
- const u = d[0];
1493
- if (u === "'")
1494
- return { isToken: !1, value: Er(d) };
1495
- if (rt[u])
1496
- return { isToken: !0, value: d };
1497
- if (u.match(Tr))
1453
+ const l = f[0];
1454
+ if (l === "'")
1455
+ return { isToken: !1, value: Rr(f) };
1456
+ if (ft[l])
1457
+ return { isToken: !0, value: f };
1458
+ if (l.match($r))
1498
1459
  throw new RangeError(
1499
- "Format string contains an unescaped latin alphabet character `" + u + "`"
1460
+ "Format string contains an unescaped latin alphabet character `" + l + "`"
1500
1461
  );
1501
- return { isToken: !1, value: d };
1462
+ return { isToken: !1, value: f };
1502
1463
  });
1503
- o.localize.preprocessor && (c = o.localize.preprocessor(i, c));
1504
- const f = {
1505
- firstWeekContainsDate: a,
1506
- weekStartsOn: s,
1464
+ o.localize.preprocessor && (c = o.localize.preprocessor(s, c));
1465
+ const u = {
1466
+ firstWeekContainsDate: i,
1467
+ weekStartsOn: a,
1507
1468
  locale: o
1508
1469
  };
1509
- return c.map((d) => {
1510
- if (!d.isToken) return d.value;
1511
- const u = d.value;
1512
- (!r?.useAdditionalWeekYearTokens && vr(u) || !r?.useAdditionalDayOfYearTokens && Dr(u)) && Or(u, t, String(e));
1513
- const h = rt[u[0]];
1514
- return h(i, u, o.localize, f);
1470
+ return c.map((f) => {
1471
+ if (!f.isToken) return f.value;
1472
+ const l = f.value;
1473
+ (!r?.useAdditionalWeekYearTokens && Br(l) || !r?.useAdditionalDayOfYearTokens && Fr(l)) && Ir(l, t, String(e));
1474
+ const d = ft[l[0]];
1475
+ return d(s, l, o.localize, u);
1515
1476
  }).join("");
1516
1477
  }
1517
- function Er(e) {
1518
- const t = e.match(Nr);
1519
- return t ? t[1].replace(xr, "'") : e;
1478
+ function Rr(e) {
1479
+ const t = e.match(jr);
1480
+ return t ? t[1].replace(Gr, "'") : e;
1520
1481
  }
1521
- function Pr(e, t) {
1522
- const r = E(e, t?.in), n = r.getFullYear(), o = r.getMonth(), a = B(r, 0);
1523
- return a.setFullYear(n, o + 1, 0), a.setHours(0, 0, 0, 0), a.getDate();
1482
+ function zr(e, t) {
1483
+ const r = P(e, t?.in), n = r.getFullYear(), o = r.getMonth(), i = B(r, 0);
1484
+ return i.setFullYear(n, o + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
1524
1485
  }
1525
- function _r(e, t) {
1526
- return E(e, t?.in).getMonth();
1486
+ function Qr(e, t) {
1487
+ return P(e, t?.in).getMonth();
1527
1488
  }
1528
- function Fr(e, t) {
1529
- return E(e, t?.in).getFullYear();
1489
+ function Vr(e, t) {
1490
+ return P(e, t?.in).getFullYear();
1530
1491
  }
1531
- function Br(e, t) {
1532
- return +E(e) > +E(t);
1492
+ function Xr(e, t) {
1493
+ return +P(e) > +P(t);
1533
1494
  }
1534
- function Ir(e, t) {
1535
- return +E(e) < +E(t);
1495
+ function Ur(e, t) {
1496
+ return +P(e) < +P(t);
1536
1497
  }
1537
- function Ar(e, t, r) {
1538
- const [n, o] = ue(
1498
+ function Zr(e, t, r) {
1499
+ const [n, o] = he(
1539
1500
  r?.in,
1540
1501
  e,
1541
1502
  t
1542
1503
  );
1543
1504
  return n.getFullYear() === o.getFullYear() && n.getMonth() === o.getMonth();
1544
1505
  }
1545
- function Hr(e, t, r) {
1546
- const [n, o] = ue(
1506
+ function Kr(e, t, r) {
1507
+ const [n, o] = he(
1547
1508
  r?.in,
1548
1509
  e,
1549
1510
  t
1550
1511
  );
1551
1512
  return n.getFullYear() === o.getFullYear();
1552
1513
  }
1553
- function qr(e, t, r) {
1554
- const n = E(e, r?.in), o = n.getFullYear(), a = n.getDate(), s = B(e, 0);
1555
- s.setFullYear(o, t, 15), s.setHours(0, 0, 0, 0);
1556
- const i = Pr(s);
1557
- return n.setMonth(t, Math.min(a, i)), n;
1514
+ function Jr(e, t, r) {
1515
+ const n = P(e, r?.in), o = n.getFullYear(), i = n.getDate(), a = B(e, 0);
1516
+ a.setFullYear(o, t, 15), a.setHours(0, 0, 0, 0);
1517
+ const s = zr(a);
1518
+ return n.setMonth(t, Math.min(i, s)), n;
1558
1519
  }
1559
- function jr(e, t, r) {
1560
- const n = E(e, r?.in);
1520
+ function Lr(e, t, r) {
1521
+ const n = P(e, r?.in);
1561
1522
  return isNaN(+n) ? B(e, NaN) : (n.setFullYear(t), n);
1562
1523
  }
1563
- const it = 5, Rr = 4;
1564
- function $r(e, t) {
1565
- const r = t.startOfMonth(e), n = r.getDay() > 0 ? r.getDay() : 7, o = t.addDays(e, -n + 1), a = t.addDays(o, it * 7 - 1);
1566
- return t.getMonth(e) === t.getMonth(a) ? it : Rr;
1524
+ const yt = 5, eo = 4;
1525
+ function to(e, t) {
1526
+ const r = t.startOfMonth(e), n = r.getDay() > 0 ? r.getDay() : 7, o = t.addDays(e, -n + 1), i = t.addDays(o, yt * 7 - 1);
1527
+ return t.getMonth(e) === t.getMonth(i) ? yt : eo;
1567
1528
  }
1568
- function St(e, t) {
1529
+ function Pt(e, t) {
1569
1530
  const r = t.startOfMonth(e), n = r.getDay();
1570
- return n === 1 ? r : n === 0 ? t.addDays(r, -1 * 6) : t.addDays(r, -1 * (n - 1));
1531
+ return n === 1 ? r : n === 0 ? t.addDays(r, -6) : t.addDays(r, -1 * (n - 1));
1571
1532
  }
1572
- function Gr(e, t) {
1573
- const r = St(e, t), n = $r(e, t);
1533
+ function no(e, t) {
1534
+ const r = Pt(e, t), n = to(e, t);
1574
1535
  return t.addDays(r, n * 7 - 1);
1575
1536
  }
1576
- class j {
1537
+ const Et = {
1538
+ ...fe,
1539
+ labels: {
1540
+ labelDayButton: (e, t, r, n) => {
1541
+ let o;
1542
+ n && typeof n.format == "function" ? o = n.format.bind(n) : o = (a, s) => be(a, s, { locale: fe, ...r });
1543
+ let i = o(e, "PPPP");
1544
+ return t.today && (i = `Today, ${i}`), t.selected && (i = `${i}, selected`), i;
1545
+ },
1546
+ labelMonthDropdown: "Choose the Month",
1547
+ labelNext: "Go to the Next Month",
1548
+ labelPrevious: "Go to the Previous Month",
1549
+ labelWeekNumber: (e) => `Week ${e}`,
1550
+ labelYearDropdown: "Choose the Year",
1551
+ labelGrid: (e, t, r) => {
1552
+ let n;
1553
+ return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, i) => be(o, i, { locale: fe, ...t }), n(e, "LLLL yyyy");
1554
+ },
1555
+ labelGridcell: (e, t, r, n) => {
1556
+ let o;
1557
+ n && typeof n.format == "function" ? o = n.format.bind(n) : o = (a, s) => be(a, s, { locale: fe, ...r });
1558
+ let i = o(e, "PPPP");
1559
+ return t?.today && (i = `Today, ${i}`), i;
1560
+ },
1561
+ labelNav: "Navigation bar",
1562
+ labelWeekNumberHeader: "Week Number",
1563
+ labelWeekday: (e, t, r) => {
1564
+ let n;
1565
+ return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, i) => be(o, i, { locale: fe, ...t }), n(e, "cccc");
1566
+ }
1567
+ }
1568
+ };
1569
+ class G {
1577
1570
  /**
1578
1571
  * Creates an instance of `DateLib`.
1579
1572
  *
@@ -1581,18 +1574,18 @@ class j {
1581
1574
  * @param overrides Custom overrides for the date library functions.
1582
1575
  */
1583
1576
  constructor(t, r) {
1584
- this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? J.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, o, a) => this.overrides?.newDate ? this.overrides.newDate(n, o, a) : this.options.timeZone ? new J(n, o, a, this.options.timeZone) : new Date(n, o, a), this.addDays = (n, o) => this.overrides?.addDays ? this.overrides.addDays(n, o) : mt(n, o), this.addMonths = (n, o) => this.overrides?.addMonths ? this.overrides.addMonths(n, o) : yt(n, o), this.addWeeks = (n, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, o) : On(n, o), this.addYears = (n, o) => this.overrides?.addYears ? this.overrides.addYears(n, o) : Wn(n, o), this.differenceInCalendarDays = (n, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, o) : bt(n, o), this.differenceInCalendarMonths = (n, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, o) : Tn(n, o), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : En(n), this.eachYearOfInterval = (n) => {
1585
- const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : Fn(n), a = new Set(o.map((i) => this.getYear(i)));
1586
- if (a.size === o.length)
1577
+ this.Date = Date, this.today = () => this.overrides?.today ? this.overrides.today() : this.options.timeZone ? H.tz(this.options.timeZone) : new this.Date(), this.newDate = (n, o, i) => this.overrides?.newDate ? this.overrides.newDate(n, o, i) : this.options.timeZone ? new H(n, o, i, this.options.timeZone) : new Date(n, o, i), this.addDays = (n, o) => this.overrides?.addDays ? this.overrides.addDays(n, o) : Dt(n, o), this.addMonths = (n, o) => this.overrides?.addMonths ? this.overrides.addMonths(n, o) : Ot(n, o), this.addWeeks = (n, o) => this.overrides?.addWeeks ? this.overrides.addWeeks(n, o) : Hn(n, o), this.addYears = (n, o) => this.overrides?.addYears ? this.overrides.addYears(n, o) : An(n, o), this.differenceInCalendarDays = (n, o) => this.overrides?.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, o) : Ve(n, o), this.differenceInCalendarMonths = (n, o) => this.overrides?.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, o) : St(n, o), this.eachMonthOfInterval = (n) => this.overrides?.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : zn(n), this.eachYearOfInterval = (n) => {
1578
+ const o = this.overrides?.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : Xn(n), i = new Set(o.map((s) => this.getYear(s)));
1579
+ if (i.size === o.length)
1587
1580
  return o;
1588
- const s = [];
1589
- return a.forEach((i) => {
1590
- s.push(new Date(i, 0, 1));
1591
- }), s;
1592
- }, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : Gr(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : Bn(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Yn(n), this.endOfWeek = (n, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, o) : kt(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : _n(n), this.format = (n, o, a) => {
1593
- const s = this.overrides?.format ? this.overrides.format(n, o, this.options) : Yr(n, o, this.options);
1594
- return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s;
1595
- }, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Dt(n), this.getMonth = (n, o) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : _r(n, this.options), this.getYear = (n, o) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : Fr(n, this.options), this.getWeek = (n, o) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Ot(n, this.options), this.isAfter = (n, o) => this.overrides?.isAfter ? this.overrides.isAfter(n, o) : Br(n, o), this.isBefore = (n, o) => this.overrides?.isBefore ? this.overrides.isBefore(n, o) : Ir(n, o), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : wt(n), this.isSameDay = (n, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, o) : Nn(n, o), this.isSameMonth = (n, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, o) : Ar(n, o), this.isSameYear = (n, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, o) : Hr(n, o), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : Sn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : Cn(n), this.setMonth = (n, o) => this.overrides?.setMonth ? this.overrides.setMonth(n, o) : qr(n, o), this.setYear = (n, o) => this.overrides?.setYear ? this.overrides.setYear(n, o) : jr(n, o), this.startOfBroadcastWeek = (n, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : St(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : ye(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : me(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Pn(n), this.startOfWeek = (n, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : ce(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : Mt(n), this.options = { locale: $e, ...t }, this.overrides = r;
1581
+ const a = [];
1582
+ return i.forEach((s) => {
1583
+ a.push(new Date(s, 0, 1));
1584
+ }), a;
1585
+ }, this.endOfBroadcastWeek = (n) => this.overrides?.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : no(n, this), this.endOfISOWeek = (n) => this.overrides?.endOfISOWeek ? this.overrides.endOfISOWeek(n) : Un(n), this.endOfMonth = (n) => this.overrides?.endOfMonth ? this.overrides.endOfMonth(n) : Rn(n), this.endOfWeek = (n, o) => this.overrides?.endOfWeek ? this.overrides.endOfWeek(n, o) : xt(n, this.options), this.endOfYear = (n) => this.overrides?.endOfYear ? this.overrides.endOfYear(n) : Vn(n), this.format = (n, o, i) => {
1586
+ const a = this.overrides?.format ? this.overrides.format(n, o, this.options) : be(n, o, this.options);
1587
+ return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(a) : a;
1588
+ }, this.getISOWeek = (n) => this.overrides?.getISOWeek ? this.overrides.getISOWeek(n) : Xe(n), this.getMonth = (n, o) => this.overrides?.getMonth ? this.overrides.getMonth(n, this.options) : Qr(n, this.options), this.getYear = (n, o) => this.overrides?.getYear ? this.overrides.getYear(n, this.options) : Vr(n, this.options), this.getWeek = (n, o) => this.overrides?.getWeek ? this.overrides.getWeek(n, this.options) : Ue(n, this.options), this.isAfter = (n, o) => this.overrides?.isAfter ? this.overrides.isAfter(n, o) : Xr(n, o), this.isBefore = (n, o) => this.overrides?.isBefore ? this.overrides.isBefore(n, o) : Ur(n, o), this.isDate = (n) => this.overrides?.isDate ? this.overrides.isDate(n) : Wt(n), this.isSameDay = (n, o) => this.overrides?.isSameDay ? this.overrides.isSameDay(n, o) : Gn(n, o), this.isSameMonth = (n, o) => this.overrides?.isSameMonth ? this.overrides.isSameMonth(n, o) : Zr(n, o), this.isSameYear = (n, o) => this.overrides?.isSameYear ? this.overrides.isSameYear(n, o) : Kr(n, o), this.max = (n) => this.overrides?.max ? this.overrides.max(n) : qn(n), this.min = (n) => this.overrides?.min ? this.overrides.min(n) : jn(n), this.setMonth = (n, o) => this.overrides?.setMonth ? this.overrides.setMonth(n, o) : Jr(n, o), this.setYear = (n, o) => this.overrides?.setYear ? this.overrides.setYear(n, o) : Lr(n, o), this.startOfBroadcastWeek = (n, o) => this.overrides?.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : Pt(n, this), this.startOfDay = (n) => this.overrides?.startOfDay ? this.overrides.startOfDay(n) : pe(n), this.startOfISOWeek = (n) => this.overrides?.startOfISOWeek ? this.overrides.startOfISOWeek(n) : we(n), this.startOfMonth = (n) => this.overrides?.startOfMonth ? this.overrides.startOfMonth(n) : Qn(n), this.startOfWeek = (n, o) => this.overrides?.startOfWeek ? this.overrides.startOfWeek(n, this.options) : de(n, this.options), this.startOfYear = (n) => this.overrides?.startOfYear ? this.overrides.startOfYear(n) : Ct(n), this.options = { locale: Et, ...t }, this.overrides = r;
1596
1589
  }
1597
1590
  /**
1598
1591
  * Generates a mapping of Arabic digits (0-9) to the target numbering system
@@ -1636,7 +1629,7 @@ class j {
1636
1629
  */
1637
1630
  getMonthYearOrder() {
1638
1631
  const t = this.options.locale?.code;
1639
- return t && j.yearFirstLocales.has(t) ? "year-first" : "month-first";
1632
+ return t && G.yearFirstLocales.has(t) ? "year-first" : "month-first";
1640
1633
  }
1641
1634
  /**
1642
1635
  * Formats the month/year pair respecting locale conventions.
@@ -1644,10 +1637,10 @@ class j {
1644
1637
  * @since 9.11.0
1645
1638
  */
1646
1639
  formatMonthYear(t) {
1647
- const { locale: r, timeZone: n, numerals: o } = this.options, a = r?.code;
1648
- if (a && j.yearFirstLocales.has(a))
1640
+ const { locale: r, timeZone: n, numerals: o } = this.options, i = r?.code;
1641
+ if (i && G.yearFirstLocales.has(i))
1649
1642
  try {
1650
- return new Intl.DateTimeFormat(a, {
1643
+ return new Intl.DateTimeFormat(i, {
1651
1644
  month: "long",
1652
1645
  year: "numeric",
1653
1646
  timeZone: n,
@@ -1655,11 +1648,11 @@ class j {
1655
1648
  }).format(t);
1656
1649
  } catch {
1657
1650
  }
1658
- const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
1659
- return this.format(t, s);
1651
+ const a = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
1652
+ return this.format(t, a);
1660
1653
  }
1661
1654
  }
1662
- j.yearFirstLocales = /* @__PURE__ */ new Set([
1655
+ G.yearFirstLocales = /* @__PURE__ */ new Set([
1663
1656
  "eu",
1664
1657
  "hu",
1665
1658
  "ja",
@@ -1678,9 +1671,9 @@ j.yearFirstLocales = /* @__PURE__ */ new Set([
1678
1671
  "zh-HK",
1679
1672
  "zh-TW"
1680
1673
  ]);
1681
- const V = new j();
1682
- class Ct {
1683
- constructor(t, r, n = V) {
1674
+ const L = new G();
1675
+ class _t {
1676
+ constructor(t, r, n = L) {
1684
1677
  this.date = t, this.displayMonth = r, this.outside = !!(r && !n.isSameMonth(t, r)), this.dateLib = n, this.isoDate = n.format(t, "yyyy-MM-dd"), this.displayMonthId = n.format(r, "yyyy-MM"), this.dateMonthId = n.format(t, "yyyy-MM");
1685
1678
  }
1686
1679
  /**
@@ -1694,45 +1687,45 @@ class Ct {
1694
1687
  return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
1695
1688
  }
1696
1689
  }
1697
- class zr {
1690
+ class ro {
1698
1691
  constructor(t, r) {
1699
1692
  this.date = t, this.weeks = r;
1700
1693
  }
1701
1694
  }
1702
- class Qr {
1695
+ class oo {
1703
1696
  constructor(t, r) {
1704
1697
  this.days = r, this.weekNumber = t;
1705
1698
  }
1706
1699
  }
1707
- function Xr(e) {
1708
- return l.createElement("button", { ...e });
1700
+ function so(e) {
1701
+ return h.createElement("button", { ...e });
1709
1702
  }
1710
- function Zr(e) {
1711
- return l.createElement("span", { ...e });
1703
+ function ao(e) {
1704
+ return h.createElement("span", { ...e });
1712
1705
  }
1713
- function Ur(e) {
1706
+ function io(e) {
1714
1707
  const { size: t = 24, orientation: r = "left", className: n } = e;
1715
1708
  return (
1716
1709
  // biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
1717
- l.createElement(
1710
+ h.createElement(
1718
1711
  "svg",
1719
1712
  { className: n, width: t, height: t, viewBox: "0 0 24 24" },
1720
- r === "up" && l.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
1721
- r === "down" && l.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
1722
- r === "left" && l.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
1723
- r === "right" && l.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
1713
+ r === "up" && h.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
1714
+ r === "down" && h.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
1715
+ r === "left" && h.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
1716
+ r === "right" && h.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
1724
1717
  )
1725
1718
  );
1726
1719
  }
1727
- function Vr(e) {
1720
+ function co(e) {
1728
1721
  const { day: t, modifiers: r, ...n } = e;
1729
- return l.createElement("td", { ...n });
1722
+ return h.createElement("td", { ...n });
1730
1723
  }
1731
- function Lr(e) {
1732
- const { day: t, modifiers: r, ...n } = e, o = l.useRef(null);
1733
- return l.useEffect(() => {
1724
+ function uo(e) {
1725
+ const { day: t, modifiers: r, ...n } = e, o = h.useRef(null);
1726
+ return h.useEffect(() => {
1734
1727
  r.focused && o.current?.focus();
1735
- }, [r.focused]), l.createElement("button", { ref: o, ...n });
1728
+ }, [r.focused]), h.createElement("button", { ref: o, ...n });
1736
1729
  }
1737
1730
  var y;
1738
1731
  (function(e) {
@@ -1742,187 +1735,187 @@ var _;
1742
1735
  (function(e) {
1743
1736
  e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
1744
1737
  })(_ || (_ = {}));
1745
- var z;
1738
+ var U;
1746
1739
  (function(e) {
1747
1740
  e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
1748
- })(z || (z = {}));
1749
- var q;
1741
+ })(U || (U = {}));
1742
+ var j;
1750
1743
  (function(e) {
1751
1744
  e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
1752
- })(q || (q = {}));
1753
- function Kr(e) {
1754
- const { options: t, className: r, components: n, classNames: o, ...a } = e, s = [o[y.Dropdown], r].join(" "), i = t?.find(({ value: c }) => c === a.value);
1755
- return l.createElement(
1745
+ })(j || (j = {}));
1746
+ function lo(e) {
1747
+ const { options: t, className: r, components: n, classNames: o, ...i } = e, a = [o[y.Dropdown], r].join(" "), s = t?.find(({ value: c }) => c === i.value);
1748
+ return h.createElement(
1756
1749
  "span",
1757
- { "data-disabled": a.disabled, className: o[y.DropdownRoot] },
1758
- l.createElement(n.Select, { className: s, ...a }, t?.map(({ value: c, label: f, disabled: d }) => l.createElement(n.Option, { key: c, value: c, disabled: d }, f))),
1759
- l.createElement(
1750
+ { "data-disabled": i.disabled, className: o[y.DropdownRoot] },
1751
+ h.createElement(n.Select, { className: a, ...i }, t?.map(({ value: c, label: u, disabled: f }) => h.createElement(n.Option, { key: c, value: c, disabled: f }, u))),
1752
+ h.createElement(
1760
1753
  "span",
1761
1754
  { className: o[y.CaptionLabel], "aria-hidden": !0 },
1762
- i?.label,
1763
- l.createElement(n.Chevron, { orientation: "down", size: 18, className: o[y.Chevron] })
1755
+ s?.label,
1756
+ h.createElement(n.Chevron, { orientation: "down", size: 18, className: o[y.Chevron] })
1764
1757
  )
1765
1758
  );
1766
1759
  }
1767
- function Jr(e) {
1768
- return l.createElement("div", { ...e });
1760
+ function fo(e) {
1761
+ return h.createElement("div", { ...e });
1769
1762
  }
1770
- function eo(e) {
1771
- return l.createElement("div", { ...e });
1763
+ function ho(e) {
1764
+ return h.createElement("div", { ...e });
1772
1765
  }
1773
- function to(e) {
1766
+ function mo(e) {
1774
1767
  const { calendarMonth: t, displayIndex: r, ...n } = e;
1775
- return l.createElement("div", { ...n }, e.children);
1768
+ return h.createElement("div", { ...n }, e.children);
1776
1769
  }
1777
- function no(e) {
1770
+ function yo(e) {
1778
1771
  const { calendarMonth: t, displayIndex: r, ...n } = e;
1779
- return l.createElement("div", { ...n });
1772
+ return h.createElement("div", { ...n });
1780
1773
  }
1781
- function ro(e) {
1782
- return l.createElement("table", { ...e });
1774
+ function go(e) {
1775
+ return h.createElement("table", { ...e });
1783
1776
  }
1784
- function oo(e) {
1785
- return l.createElement("div", { ...e });
1777
+ function bo(e) {
1778
+ return h.createElement("div", { ...e });
1786
1779
  }
1787
- const Nt = fn(void 0);
1788
- function be() {
1789
- const e = dn(Nt);
1780
+ const Ft = vn(void 0);
1781
+ function ke() {
1782
+ const e = Wn(Ft);
1790
1783
  if (e === void 0)
1791
1784
  throw new Error("useDayPicker() must be used within a custom component.");
1792
1785
  return e;
1793
1786
  }
1794
- function so(e) {
1795
- const { components: t } = be();
1796
- return l.createElement(t.Dropdown, { ...e });
1787
+ function wo(e) {
1788
+ const { components: t } = ke();
1789
+ return h.createElement(t.Dropdown, { ...e });
1797
1790
  }
1798
- function ao(e) {
1799
- const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...a } = e, { components: s, classNames: i, labels: { labelPrevious: c, labelNext: f } } = be(), d = H((h) => {
1800
- o && r?.(h);
1801
- }, [o, r]), u = H((h) => {
1802
- n && t?.(h);
1791
+ function po(e) {
1792
+ const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...i } = e, { components: a, classNames: s, labels: { labelPrevious: c, labelNext: u } } = ke(), f = q((d) => {
1793
+ o && r?.(d);
1794
+ }, [o, r]), l = q((d) => {
1795
+ n && t?.(d);
1803
1796
  }, [n, t]);
1804
- return l.createElement(
1797
+ return h.createElement(
1805
1798
  "nav",
1806
- { ...a },
1807
- l.createElement(
1808
- s.PreviousMonthButton,
1809
- { type: "button", className: i[y.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": c(n), onClick: u },
1810
- l.createElement(s.Chevron, { disabled: n ? void 0 : !0, className: i[y.Chevron], orientation: "left" })
1799
+ { ...i },
1800
+ h.createElement(
1801
+ a.PreviousMonthButton,
1802
+ { type: "button", className: s[y.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": c(n), onClick: l },
1803
+ h.createElement(a.Chevron, { disabled: n ? void 0 : !0, className: s[y.Chevron], orientation: "left" })
1811
1804
  ),
1812
- l.createElement(
1813
- s.NextMonthButton,
1814
- { type: "button", className: i[y.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": f(o), onClick: d },
1815
- l.createElement(s.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: i[y.Chevron] })
1805
+ h.createElement(
1806
+ a.NextMonthButton,
1807
+ { type: "button", className: s[y.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": u(o), onClick: f },
1808
+ h.createElement(a.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: s[y.Chevron] })
1816
1809
  )
1817
1810
  );
1818
1811
  }
1819
- function io(e) {
1820
- const { components: t } = be();
1821
- return l.createElement(t.Button, { ...e });
1812
+ function Mo(e) {
1813
+ const { components: t } = ke();
1814
+ return h.createElement(t.Button, { ...e });
1822
1815
  }
1823
- function co(e) {
1824
- return l.createElement("option", { ...e });
1816
+ function ko(e) {
1817
+ return h.createElement("option", { ...e });
1825
1818
  }
1826
- function uo(e) {
1827
- const { components: t } = be();
1828
- return l.createElement(t.Button, { ...e });
1819
+ function Do(e) {
1820
+ const { components: t } = ke();
1821
+ return h.createElement(t.Button, { ...e });
1829
1822
  }
1830
- function fo(e) {
1823
+ function Oo(e) {
1831
1824
  const { rootRef: t, ...r } = e;
1832
- return l.createElement("div", { ...r, ref: t });
1825
+ return h.createElement("div", { ...r, ref: t });
1833
1826
  }
1834
- function lo(e) {
1835
- return l.createElement("select", { ...e });
1827
+ function vo(e) {
1828
+ return h.createElement("select", { ...e });
1836
1829
  }
1837
- function ho(e) {
1830
+ function Wo(e) {
1838
1831
  const { week: t, ...r } = e;
1839
- return l.createElement("tr", { ...r });
1832
+ return h.createElement("tr", { ...r });
1840
1833
  }
1841
- function mo(e) {
1842
- return l.createElement("th", { ...e });
1834
+ function So(e) {
1835
+ return h.createElement("th", { ...e });
1843
1836
  }
1844
- function yo(e) {
1845
- return l.createElement(
1837
+ function No(e) {
1838
+ return h.createElement(
1846
1839
  "thead",
1847
1840
  { "aria-hidden": !0 },
1848
- l.createElement("tr", { ...e })
1841
+ h.createElement("tr", { ...e })
1849
1842
  );
1850
1843
  }
1851
- function go(e) {
1844
+ function Co(e) {
1852
1845
  const { week: t, ...r } = e;
1853
- return l.createElement("th", { ...r });
1846
+ return h.createElement("th", { ...r });
1854
1847
  }
1855
- function bo(e) {
1856
- return l.createElement("th", { ...e });
1848
+ function xo(e) {
1849
+ return h.createElement("th", { ...e });
1857
1850
  }
1858
- function wo(e) {
1859
- return l.createElement("tbody", { ...e });
1851
+ function Yo(e) {
1852
+ return h.createElement("tbody", { ...e });
1860
1853
  }
1861
- function po(e) {
1862
- const { components: t } = be();
1863
- return l.createElement(t.Dropdown, { ...e });
1854
+ function To(e) {
1855
+ const { components: t } = ke();
1856
+ return h.createElement(t.Dropdown, { ...e });
1864
1857
  }
1865
- const Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Button: Xr, CaptionLabel: Zr, Chevron: Ur, Day: Vr, DayButton: Lr, Dropdown: Kr, DropdownNav: Jr, Footer: eo, Month: to, MonthCaption: no, MonthGrid: ro, Months: oo, MonthsDropdown: so, Nav: ao, NextMonthButton: io, Option: co, PreviousMonthButton: uo, Root: fo, Select: lo, Week: ho, WeekNumber: go, WeekNumberHeader: bo, Weekday: mo, Weekdays: yo, Weeks: wo, YearsDropdown: po }, Symbol.toStringTag, { value: "Module" }));
1866
- function ee(e, t, r = !1, n = V) {
1867
- let { from: o, to: a } = e;
1868
- const { differenceInCalendarDays: s, isSameDay: i } = n;
1869
- return o && a ? (s(a, o) < 0 && ([o, a] = [a, o]), s(t, o) >= (r ? 1 : 0) && s(a, t) >= (r ? 1 : 0)) : !r && a ? i(a, t) : !r && o ? i(o, t) : !1;
1858
+ const Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Button: so, CaptionLabel: ao, Chevron: io, Day: co, DayButton: uo, Dropdown: lo, DropdownNav: fo, Footer: ho, Month: mo, MonthCaption: yo, MonthGrid: go, Months: bo, MonthsDropdown: wo, Nav: po, NextMonthButton: Mo, Option: ko, PreviousMonthButton: Do, Root: Oo, Select: vo, Week: Wo, WeekNumber: Co, WeekNumberHeader: xo, Weekday: So, Weekdays: No, Weeks: Yo, YearsDropdown: To }, Symbol.toStringTag, { value: "Module" }));
1859
+ function ne(e, t, r = !1, n = L) {
1860
+ let { from: o, to: i } = e;
1861
+ const { differenceInCalendarDays: a, isSameDay: s } = n;
1862
+ return o && i ? (a(i, o) < 0 && ([o, i] = [i, o]), a(t, o) >= (r ? 1 : 0) && a(i, t) >= (r ? 1 : 0)) : !r && i ? s(i, t) : !r && o ? s(o, t) : !1;
1870
1863
  }
1871
- function Ge(e) {
1864
+ function Ze(e) {
1872
1865
  return !!(e && typeof e == "object" && "before" in e && "after" in e);
1873
1866
  }
1874
- function We(e) {
1867
+ function xe(e) {
1875
1868
  return !!(e && typeof e == "object" && "from" in e);
1876
1869
  }
1877
- function ze(e) {
1870
+ function Ke(e) {
1878
1871
  return !!(e && typeof e == "object" && "after" in e);
1879
1872
  }
1880
- function Qe(e) {
1873
+ function Je(e) {
1881
1874
  return !!(e && typeof e == "object" && "before" in e);
1882
1875
  }
1883
- function xt(e) {
1876
+ function Bt(e) {
1884
1877
  return !!(e && typeof e == "object" && "dayOfWeek" in e);
1885
1878
  }
1886
- function Tt(e, t) {
1879
+ function It(e, t) {
1887
1880
  return Array.isArray(e) && e.every(t.isDate);
1888
1881
  }
1889
- function te(e, t, r = V) {
1890
- const n = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: a, isAfter: s } = r;
1891
- return n.some((i) => {
1892
- if (typeof i == "boolean")
1893
- return i;
1894
- if (r.isDate(i))
1895
- return o(e, i);
1896
- if (Tt(i, r))
1897
- return i.includes(e);
1898
- if (We(i))
1899
- return ee(i, e, !1, r);
1900
- if (xt(i))
1901
- return Array.isArray(i.dayOfWeek) ? i.dayOfWeek.includes(e.getDay()) : i.dayOfWeek === e.getDay();
1902
- if (Ge(i)) {
1903
- const c = a(i.before, e), f = a(i.after, e), d = c > 0, u = f < 0;
1904
- return s(i.before, i.after) ? u && d : d || u;
1882
+ function re(e, t, r = L) {
1883
+ const n = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: i, isAfter: a } = r;
1884
+ return n.some((s) => {
1885
+ if (typeof s == "boolean")
1886
+ return s;
1887
+ if (r.isDate(s))
1888
+ return o(e, s);
1889
+ if (It(s, r))
1890
+ return s.some((c) => o(e, c));
1891
+ if (xe(s))
1892
+ return ne(s, e, !1, r);
1893
+ if (Bt(s))
1894
+ return Array.isArray(s.dayOfWeek) ? s.dayOfWeek.includes(e.getDay()) : s.dayOfWeek === e.getDay();
1895
+ if (Ze(s)) {
1896
+ const c = i(s.before, e), u = i(s.after, e), f = c > 0, l = u < 0;
1897
+ return a(s.before, s.after) ? l && f : f || l;
1905
1898
  }
1906
- return ze(i) ? a(e, i.after) > 0 : Qe(i) ? a(i.before, e) > 0 : typeof i == "function" ? i(e) : !1;
1899
+ return Ke(s) ? i(e, s.after) > 0 : Je(s) ? i(s.before, e) > 0 : typeof s == "function" ? s(e) : !1;
1907
1900
  });
1908
1901
  }
1909
- function ko(e, t, r, n, o) {
1910
- const { disabled: a, hidden: s, modifiers: i, showOutsideDays: c, broadcastCalendar: f, today: d = o.today() } = t, { isSameDay: u, isSameMonth: h, startOfMonth: b, isBefore: v, endOfMonth: C, isAfter: M } = o, O = r && b(r), N = n && C(n), p = {
1902
+ function Eo(e, t, r, n, o) {
1903
+ const { disabled: i, hidden: a, modifiers: s, showOutsideDays: c, broadcastCalendar: u, today: f = o.today() } = t, { isSameDay: l, isSameMonth: d, startOfMonth: w, isBefore: O, endOfMonth: N, isAfter: k } = o, v = r && w(r), Y = n && N(n), p = {
1911
1904
  [_.focused]: [],
1912
1905
  [_.outside]: [],
1913
1906
  [_.disabled]: [],
1914
1907
  [_.hidden]: [],
1915
1908
  [_.today]: []
1916
1909
  }, D = {};
1917
- for (const g of e) {
1918
- const { date: m, displayMonth: W } = g, P = !!(W && !h(m, W)), I = !!(O && v(m, O)), F = !!(N && M(m, N)), Q = !!(a && te(m, a, o)), ne = !!(s && te(m, s, o)) || I || F || // Broadcast calendar will show outside days as default
1919
- !f && !c && P || f && c === !1 && P, L = u(m, d);
1920
- P && p.outside.push(g), Q && p.disabled.push(g), ne && p.hidden.push(g), L && p.today.push(g), i && Object.keys(i).forEach((R) => {
1921
- const ae = i?.[R];
1922
- ae && te(m, ae, o) && (D[R] ? D[R].push(g) : D[R] = [g]);
1910
+ for (const b of e) {
1911
+ const { date: m, displayMonth: W } = b, E = !!(W && !d(m, W)), I = !!(v && O(m, v)), F = !!(Y && k(m, Y)), Z = !!(i && re(m, i, o)), oe = !!(a && re(m, a, o)) || I || F || // Broadcast calendar will show outside days as default
1912
+ !u && !c && E || u && c === !1 && E, ee = l(m, f);
1913
+ E && p.outside.push(b), Z && p.disabled.push(b), oe && p.hidden.push(b), ee && p.today.push(b), s && Object.keys(s).forEach(($) => {
1914
+ const ce = s?.[$];
1915
+ ce && re(m, ce, o) && (D[$] ? D[$].push(b) : D[$] = [b]);
1923
1916
  });
1924
1917
  }
1925
- return (g) => {
1918
+ return (b) => {
1926
1919
  const m = {
1927
1920
  [_.focused]: !1,
1928
1921
  [_.disabled]: !1,
@@ -1930,12 +1923,12 @@ function ko(e, t, r, n, o) {
1930
1923
  [_.outside]: !1,
1931
1924
  [_.today]: !1
1932
1925
  }, W = {};
1933
- for (const P in p) {
1934
- const I = p[P];
1935
- m[P] = I.some((F) => F === g);
1926
+ for (const E in p) {
1927
+ const I = p[E];
1928
+ m[E] = I.some((F) => F === b);
1936
1929
  }
1937
- for (const P in D)
1938
- W[P] = D[P].some((I) => I === g);
1930
+ for (const E in D)
1931
+ W[E] = D[E].some((I) => I === b);
1939
1932
  return {
1940
1933
  ...m,
1941
1934
  // custom modifiers should override all the previous ones
@@ -1943,16 +1936,16 @@ function ko(e, t, r, n, o) {
1943
1936
  };
1944
1937
  };
1945
1938
  }
1946
- function Do(e, t, r = {}) {
1947
- return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [a]) => (r[a] ? o.push(r[a]) : t[_[a]] ? o.push(t[_[a]]) : t[z[a]] && o.push(t[z[a]]), o), [t[y.Day]]);
1939
+ function _o(e, t, r = {}) {
1940
+ return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [i]) => (r[i] ? o.push(r[i]) : t[_[i]] ? o.push(t[_[i]]) : t[U[i]] && o.push(t[U[i]]), o), [t[y.Day]]);
1948
1941
  }
1949
- function vo(e) {
1942
+ function Fo(e) {
1950
1943
  return {
1951
- ...Mo,
1944
+ ...Po,
1952
1945
  ...e
1953
1946
  };
1954
1947
  }
1955
- function Oo(e) {
1948
+ function Bo(e) {
1956
1949
  const t = {
1957
1950
  "data-mode": e.mode ?? void 0,
1958
1951
  "data-required": "required" in e ? e.required : void 0,
@@ -1965,58 +1958,115 @@ function Oo(e) {
1965
1958
  r.startsWith("data-") && (t[r] = n);
1966
1959
  }), t;
1967
1960
  }
1968
- function Wo() {
1961
+ function Io() {
1969
1962
  const e = {};
1970
1963
  for (const t in y)
1971
1964
  e[y[t]] = `rdp-${y[t]}`;
1972
1965
  for (const t in _)
1973
1966
  e[_[t]] = `rdp-${_[t]}`;
1974
- for (const t in z)
1975
- e[z[t]] = `rdp-${z[t]}`;
1976
- for (const t in q)
1977
- e[q[t]] = `rdp-${q[t]}`;
1967
+ for (const t in U)
1968
+ e[U[t]] = `rdp-${U[t]}`;
1969
+ for (const t in j)
1970
+ e[j[t]] = `rdp-${j[t]}`;
1978
1971
  return e;
1979
1972
  }
1980
- function Yt(e, t, r) {
1981
- return (r ?? new j(t)).formatMonthYear(e);
1973
+ function Ht(e, t, r) {
1974
+ return (r ?? new G(t)).formatMonthYear(e);
1982
1975
  }
1983
- const So = Yt;
1984
- function Co(e, t, r) {
1985
- return (r ?? new j(t)).format(e, "d");
1976
+ const Ho = Ht;
1977
+ function Ao(e, t, r) {
1978
+ return (r ?? new G(t)).format(e, "d");
1986
1979
  }
1987
- function No(e, t = V) {
1980
+ function qo(e, t = L) {
1988
1981
  return t.format(e, "LLLL");
1989
1982
  }
1990
- function xo(e, t, r) {
1991
- return (r ?? new j(t)).format(e, "cccccc");
1983
+ function jo(e, t, r) {
1984
+ return (r ?? new G(t)).format(e, "cccccc");
1992
1985
  }
1993
- function To(e, t = V) {
1986
+ function Go(e, t = L) {
1994
1987
  return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
1995
1988
  }
1996
- function Yo() {
1989
+ function $o() {
1997
1990
  return "";
1998
1991
  }
1999
- function Et(e, t = V) {
1992
+ function At(e, t = L) {
2000
1993
  return t.format(e, "yyyy");
2001
1994
  }
2002
- const Eo = Et, Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, formatCaption: Yt, formatDay: Co, formatMonthCaption: So, formatMonthDropdown: No, formatWeekNumber: To, formatWeekNumberHeader: Yo, formatWeekdayName: xo, formatYearCaption: Eo, formatYearDropdown: Et }, Symbol.toStringTag, { value: "Module" }));
2003
- function _o(e) {
1995
+ const Ro = At, zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, formatCaption: Ht, formatDay: Ao, formatMonthCaption: Ho, formatMonthDropdown: qo, formatWeekNumber: Go, formatWeekNumberHeader: $o, formatWeekdayName: jo, formatYearCaption: Ro, formatYearDropdown: At }, Symbol.toStringTag, { value: "Module" }));
1996
+ function Qo(e) {
2004
1997
  return e?.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e?.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
2005
- ...Po,
1998
+ ...zo,
2006
1999
  ...e
2007
2000
  };
2008
2001
  }
2009
- function Fo(e, t, r, n, o) {
2010
- const { startOfMonth: a, startOfYear: s, endOfYear: i, eachMonthOfInterval: c, getMonth: f } = o;
2002
+ function Le(e, t, r, n) {
2003
+ let o = (n ?? new G(r)).format(e, "PPPP");
2004
+ return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
2005
+ }
2006
+ const Vo = Le;
2007
+ function et(e, t, r) {
2008
+ return (r ?? new G(t)).formatMonthYear(e);
2009
+ }
2010
+ const Xo = et;
2011
+ function qt(e, t, r, n) {
2012
+ let o = (n ?? new G(r)).format(e, "PPPP");
2013
+ return t?.today && (o = `Today, ${o}`), o;
2014
+ }
2015
+ function jt(e) {
2016
+ return "Choose the Month";
2017
+ }
2018
+ function Gt() {
2019
+ return "";
2020
+ }
2021
+ const Uo = "Go to the Next Month";
2022
+ function $t(e, t) {
2023
+ return Uo;
2024
+ }
2025
+ function Rt(e) {
2026
+ return "Go to the Previous Month";
2027
+ }
2028
+ function zt(e, t, r) {
2029
+ return (r ?? new G(t)).format(e, "cccc");
2030
+ }
2031
+ function Qt(e, t) {
2032
+ return `Week ${e}`;
2033
+ }
2034
+ function Vt(e) {
2035
+ return "Week Number";
2036
+ }
2037
+ function Xt(e) {
2038
+ return "Choose the Year";
2039
+ }
2040
+ const Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, labelCaption: Xo, labelDay: Vo, labelDayButton: Le, labelGrid: et, labelGridcell: qt, labelMonthDropdown: jt, labelNav: Gt, labelNext: $t, labelPrevious: Rt, labelWeekNumber: Qt, labelWeekNumberHeader: Vt, labelWeekday: zt, labelYearDropdown: Xt }, Symbol.toStringTag, { value: "Module" })), X = (e, t, r) => t || (r ? typeof r == "function" ? r : (...n) => r : e);
2041
+ function Ko(e, t) {
2042
+ const r = t.locale?.labels ?? {};
2043
+ return {
2044
+ ...Zo,
2045
+ ...e ?? {},
2046
+ labelDayButton: X(Le, e?.labelDayButton, r.labelDayButton),
2047
+ labelMonthDropdown: X(jt, e?.labelMonthDropdown, r.labelMonthDropdown),
2048
+ labelNext: X($t, e?.labelNext, r.labelNext),
2049
+ labelPrevious: X(Rt, e?.labelPrevious, r.labelPrevious),
2050
+ labelWeekNumber: X(Qt, e?.labelWeekNumber, r.labelWeekNumber),
2051
+ labelYearDropdown: X(Xt, e?.labelYearDropdown, r.labelYearDropdown),
2052
+ labelGrid: X(et, e?.labelGrid, r.labelGrid),
2053
+ labelGridcell: X(qt, e?.labelGridcell, r.labelGridcell),
2054
+ labelNav: X(Gt, e?.labelNav, r.labelNav),
2055
+ labelWeekNumberHeader: X(Vt, e?.labelWeekNumberHeader, r.labelWeekNumberHeader),
2056
+ labelWeekday: X(zt, e?.labelWeekday, r.labelWeekday)
2057
+ };
2058
+ }
2059
+ function Jo(e, t, r, n, o) {
2060
+ const { startOfMonth: i, startOfYear: a, endOfYear: s, eachMonthOfInterval: c, getMonth: u } = o;
2011
2061
  return c({
2012
- start: s(e),
2013
- end: i(e)
2014
- }).map((h) => {
2015
- const b = n.formatMonthDropdown(h, o), v = f(h), C = t && h < a(t) || r && h > a(r) || !1;
2016
- return { value: v, label: b, disabled: C };
2062
+ start: a(e),
2063
+ end: s(e)
2064
+ }).map((d) => {
2065
+ const w = n.formatMonthDropdown(d, o), O = u(d), N = t && d < i(t) || r && d > i(r) || !1;
2066
+ return { value: O, label: w, disabled: N };
2017
2067
  });
2018
2068
  }
2019
- function Bo(e, t = {}, r = {}) {
2069
+ function Lo(e, t = {}, r = {}) {
2020
2070
  let n = { ...t?.[y.Day] };
2021
2071
  return Object.entries(e).filter(([, o]) => o === !0).forEach(([o]) => {
2022
2072
  n = {
@@ -2025,243 +2075,301 @@ function Bo(e, t = {}, r = {}) {
2025
2075
  };
2026
2076
  }), n;
2027
2077
  }
2028
- function Io(e, t, r, n) {
2029
- const o = n ?? e.today(), a = r ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), s = [];
2030
- for (let i = 0; i < 7; i++) {
2031
- const c = e.addDays(a, i);
2032
- s.push(c);
2078
+ function es(e, t, r, n) {
2079
+ const o = n ?? e.today(), i = r ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), a = [];
2080
+ for (let s = 0; s < 7; s++) {
2081
+ const c = e.addDays(i, s);
2082
+ a.push(c);
2033
2083
  }
2034
- return s;
2084
+ return a;
2035
2085
  }
2036
- function Ao(e, t, r, n, o = !1) {
2086
+ function ts(e, t, r, n, o = !1) {
2037
2087
  if (!e || !t)
2038
2088
  return;
2039
- const { startOfYear: a, endOfYear: s, eachYearOfInterval: i, getYear: c } = n, f = a(e), d = s(t), u = i({ start: f, end: d });
2040
- return o && u.reverse(), u.map((h) => {
2041
- const b = r.formatYearDropdown(h, n);
2089
+ const { startOfYear: i, endOfYear: a, eachYearOfInterval: s, getYear: c } = n, u = i(e), f = a(t), l = s({ start: u, end: f });
2090
+ return o && l.reverse(), l.map((d) => {
2091
+ const w = r.formatYearDropdown(d, n);
2042
2092
  return {
2043
- value: c(h),
2044
- label: b,
2093
+ value: c(d),
2094
+ label: w,
2045
2095
  disabled: !1
2046
2096
  };
2047
2097
  });
2048
2098
  }
2049
- function Pt(e, t, r, n) {
2050
- let o = (n ?? new j(r)).format(e, "PPPP");
2051
- return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
2052
- }
2053
- const Ho = Pt;
2054
- function _t(e, t, r) {
2055
- return (r ?? new j(t)).formatMonthYear(e);
2056
- }
2057
- const qo = _t;
2058
- function jo(e, t, r, n) {
2059
- let o = (n ?? new j(r)).format(e, "PPPP");
2060
- return t?.today && (o = `Today, ${o}`), o;
2061
- }
2062
- function Ro(e) {
2063
- return "Choose the Month";
2064
- }
2065
- function $o() {
2066
- return "";
2067
- }
2068
- function Go(e) {
2069
- return "Go to the Next Month";
2070
- }
2071
- function zo(e) {
2072
- return "Go to the Previous Month";
2073
- }
2074
- function Qo(e, t, r) {
2075
- return (r ?? new j(t)).format(e, "cccc");
2076
- }
2077
- function Xo(e, t) {
2078
- return `Week ${e}`;
2079
- }
2080
- function Zo(e) {
2081
- return "Week Number";
2082
- }
2083
- function Uo(e) {
2084
- return "Choose the Year";
2099
+ function ns(e, t = {}) {
2100
+ const { weekStartsOn: r, locale: n } = t, o = r ?? n?.options?.weekStartsOn ?? 0, i = (s) => {
2101
+ const c = typeof s == "number" || typeof s == "string" ? new Date(s) : s;
2102
+ return new H(c.getFullYear(), c.getMonth(), c.getDate(), 12, 0, 0, e);
2103
+ }, a = (s) => {
2104
+ const c = i(s);
2105
+ return new Date(c.getFullYear(), c.getMonth(), c.getDate(), 0, 0, 0, 0);
2106
+ };
2107
+ return {
2108
+ today: () => i(H.tz(e)),
2109
+ newDate: (s, c, u) => new H(s, c, u, 12, 0, 0, e),
2110
+ startOfDay: (s) => i(s),
2111
+ startOfWeek: (s, c) => {
2112
+ const u = i(s), f = c?.weekStartsOn ?? o, l = (u.getDay() - f + 7) % 7;
2113
+ return u.setDate(u.getDate() - l), u;
2114
+ },
2115
+ startOfISOWeek: (s) => {
2116
+ const c = i(s), u = (c.getDay() - 1 + 7) % 7;
2117
+ return c.setDate(c.getDate() - u), c;
2118
+ },
2119
+ startOfMonth: (s) => {
2120
+ const c = i(s);
2121
+ return c.setDate(1), c;
2122
+ },
2123
+ startOfYear: (s) => {
2124
+ const c = i(s);
2125
+ return c.setMonth(0, 1), c;
2126
+ },
2127
+ endOfWeek: (s, c) => {
2128
+ const u = i(s), d = (((c?.weekStartsOn ?? o) + 6) % 7 - u.getDay() + 7) % 7;
2129
+ return u.setDate(u.getDate() + d), u;
2130
+ },
2131
+ endOfISOWeek: (s) => {
2132
+ const c = i(s), u = (7 - c.getDay()) % 7;
2133
+ return c.setDate(c.getDate() + u), c;
2134
+ },
2135
+ endOfMonth: (s) => {
2136
+ const c = i(s);
2137
+ return c.setMonth(c.getMonth() + 1, 0), c;
2138
+ },
2139
+ endOfYear: (s) => {
2140
+ const c = i(s);
2141
+ return c.setMonth(11, 31), c;
2142
+ },
2143
+ eachMonthOfInterval: (s) => {
2144
+ const c = i(s.start), u = i(s.end), f = [], l = new H(c.getFullYear(), c.getMonth(), 1, 12, 0, 0, e), d = u.getFullYear() * 12 + u.getMonth();
2145
+ for (; l.getFullYear() * 12 + l.getMonth() <= d; )
2146
+ f.push(new H(l, e)), l.setMonth(l.getMonth() + 1, 1);
2147
+ return f;
2148
+ },
2149
+ // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
2150
+ // mutate the same TZDate, and return it.
2151
+ addDays: (s, c) => {
2152
+ const u = i(s);
2153
+ return u.setDate(u.getDate() + c), u;
2154
+ },
2155
+ addWeeks: (s, c) => {
2156
+ const u = i(s);
2157
+ return u.setDate(u.getDate() + c * 7), u;
2158
+ },
2159
+ addMonths: (s, c) => {
2160
+ const u = i(s);
2161
+ return u.setMonth(u.getMonth() + c), u;
2162
+ },
2163
+ addYears: (s, c) => {
2164
+ const u = i(s);
2165
+ return u.setFullYear(u.getFullYear() + c), u;
2166
+ },
2167
+ eachYearOfInterval: (s) => {
2168
+ const c = i(s.start), u = i(s.end), f = [], l = new H(c.getFullYear(), 0, 1, 12, 0, 0, e);
2169
+ for (; l.getFullYear() <= u.getFullYear(); )
2170
+ f.push(new H(l, e)), l.setFullYear(l.getFullYear() + 1, 0, 1);
2171
+ return f;
2172
+ },
2173
+ getWeek: (s, c) => {
2174
+ const u = a(s);
2175
+ return Ue(u, {
2176
+ weekStartsOn: c?.weekStartsOn ?? o,
2177
+ firstWeekContainsDate: c?.firstWeekContainsDate ?? n?.options?.firstWeekContainsDate ?? 1
2178
+ });
2179
+ },
2180
+ getISOWeek: (s) => {
2181
+ const c = a(s);
2182
+ return Xe(c);
2183
+ },
2184
+ differenceInCalendarDays: (s, c) => {
2185
+ const u = a(s), f = a(c);
2186
+ return Ve(u, f);
2187
+ },
2188
+ differenceInCalendarMonths: (s, c) => {
2189
+ const u = a(s), f = a(c);
2190
+ return St(u, f);
2191
+ }
2192
+ };
2085
2193
  }
2086
- const Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, labelCaption: qo, labelDay: Ho, labelDayButton: Pt, labelGrid: _t, labelGridcell: jo, labelMonthDropdown: Ro, labelNav: $o, labelNext: Go, labelPrevious: zo, labelWeekNumber: Xo, labelWeekNumberHeader: Zo, labelWeekday: Qo, labelYearDropdown: Uo }, Symbol.toStringTag, { value: "Module" })), we = (e) => e instanceof HTMLElement ? e : null, Ae = (e) => [
2194
+ const De = (e) => e instanceof HTMLElement ? e : null, Ge = (e) => [
2087
2195
  ...e.querySelectorAll("[data-animated-month]") ?? []
2088
- ], Lo = (e) => we(e.querySelector("[data-animated-month]")), He = (e) => we(e.querySelector("[data-animated-caption]")), qe = (e) => we(e.querySelector("[data-animated-weeks]")), Ko = (e) => we(e.querySelector("[data-animated-nav]")), Jo = (e) => we(e.querySelector("[data-animated-weekdays]"));
2089
- function es(e, t, { classNames: r, months: n, focused: o, dateLib: a }) {
2090
- const s = De(null), i = De(n), c = De(!1);
2091
- ln(() => {
2092
- const f = i.current;
2093
- if (i.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
2196
+ ], rs = (e) => De(e.querySelector("[data-animated-month]")), $e = (e) => De(e.querySelector("[data-animated-caption]")), Re = (e) => De(e.querySelector("[data-animated-weeks]")), os = (e) => De(e.querySelector("[data-animated-nav]")), ss = (e) => De(e.querySelector("[data-animated-weekdays]"));
2197
+ function as(e, t, { classNames: r, months: n, focused: o, dateLib: i }) {
2198
+ const a = Se(null), s = Se(n), c = Se(!1);
2199
+ Sn(() => {
2200
+ const u = s.current;
2201
+ if (s.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
2094
2202
  !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
2095
- n.length === 0 || f.length === 0 || n.length !== f.length)
2203
+ n.length === 0 || u.length === 0 || n.length !== u.length)
2096
2204
  return;
2097
- const d = a.isSameMonth(n[0].date, f[0].date), u = a.isAfter(n[0].date, f[0].date), h = u ? r[q.caption_after_enter] : r[q.caption_before_enter], b = u ? r[q.weeks_after_enter] : r[q.weeks_before_enter], v = s.current, C = e.current.cloneNode(!0);
2098
- if (C instanceof HTMLElement ? (Ae(C).forEach((p) => {
2205
+ const f = i.isSameMonth(n[0].date, u[0].date), l = i.isAfter(n[0].date, u[0].date), d = l ? r[j.caption_after_enter] : r[j.caption_before_enter], w = l ? r[j.weeks_after_enter] : r[j.weeks_before_enter], O = a.current, N = e.current.cloneNode(!0);
2206
+ if (N instanceof HTMLElement ? (Ge(N).forEach((p) => {
2099
2207
  if (!(p instanceof HTMLElement))
2100
2208
  return;
2101
- const D = Lo(p);
2209
+ const D = rs(p);
2102
2210
  D && p.contains(D) && p.removeChild(D);
2103
- const g = He(p);
2104
- g && g.classList.remove(h);
2105
- const m = qe(p);
2106
- m && m.classList.remove(b);
2107
- }), s.current = C) : s.current = null, c.current || d || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
2211
+ const b = $e(p);
2212
+ b && b.classList.remove(d);
2213
+ const m = Re(p);
2214
+ m && m.classList.remove(w);
2215
+ }), a.current = N) : a.current = null, c.current || f || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
2108
2216
  o)
2109
2217
  return;
2110
- const M = v instanceof HTMLElement ? Ae(v) : [], O = Ae(e.current);
2111
- if (O?.every((N) => N instanceof HTMLElement) && M && M.every((N) => N instanceof HTMLElement)) {
2218
+ const k = O instanceof HTMLElement ? Ge(O) : [], v = Ge(e.current);
2219
+ if (v?.every((Y) => Y instanceof HTMLElement) && k && k.every((Y) => Y instanceof HTMLElement)) {
2112
2220
  c.current = !0, e.current.style.isolation = "isolate";
2113
- const N = Ko(e.current);
2114
- N && (N.style.zIndex = "1"), O.forEach((p, D) => {
2115
- const g = M[D];
2116
- if (!g)
2221
+ const Y = os(e.current);
2222
+ Y && (Y.style.zIndex = "1"), v.forEach((p, D) => {
2223
+ const b = k[D];
2224
+ if (!b)
2117
2225
  return;
2118
2226
  p.style.position = "relative", p.style.overflow = "hidden";
2119
- const m = He(p);
2120
- m && m.classList.add(h);
2121
- const W = qe(p);
2122
- W && W.classList.add(b);
2123
- const P = () => {
2124
- c.current = !1, e.current && (e.current.style.isolation = ""), N && (N.style.zIndex = ""), m && m.classList.remove(h), W && W.classList.remove(b), p.style.position = "", p.style.overflow = "", p.contains(g) && p.removeChild(g);
2227
+ const m = $e(p);
2228
+ m && m.classList.add(d);
2229
+ const W = Re(p);
2230
+ W && W.classList.add(w);
2231
+ const E = () => {
2232
+ c.current = !1, e.current && (e.current.style.isolation = ""), Y && (Y.style.zIndex = ""), m && m.classList.remove(d), W && W.classList.remove(w), p.style.position = "", p.style.overflow = "", p.contains(b) && p.removeChild(b);
2125
2233
  };
2126
- g.style.pointerEvents = "none", g.style.position = "absolute", g.style.overflow = "hidden", g.setAttribute("aria-hidden", "true");
2127
- const I = Jo(g);
2234
+ b.style.pointerEvents = "none", b.style.position = "absolute", b.style.overflow = "hidden", b.setAttribute("aria-hidden", "true");
2235
+ const I = ss(b);
2128
2236
  I && (I.style.opacity = "0");
2129
- const F = He(g);
2130
- F && (F.classList.add(u ? r[q.caption_before_exit] : r[q.caption_after_exit]), F.addEventListener("animationend", P));
2131
- const Q = qe(g);
2132
- Q && Q.classList.add(u ? r[q.weeks_before_exit] : r[q.weeks_after_exit]), p.insertBefore(g, p.firstChild);
2237
+ const F = $e(b);
2238
+ F && (F.classList.add(l ? r[j.caption_before_exit] : r[j.caption_after_exit]), F.addEventListener("animationend", E));
2239
+ const Z = Re(b);
2240
+ Z && Z.classList.add(l ? r[j.weeks_before_exit] : r[j.weeks_after_exit]), p.insertBefore(b, p.firstChild);
2133
2241
  });
2134
2242
  }
2135
2243
  });
2136
2244
  }
2137
- function ts(e, t, r, n) {
2138
- const o = e[0], a = e[e.length - 1], { ISOWeek: s, fixedWeeks: i, broadcastCalendar: c } = r ?? {}, { addDays: f, differenceInCalendarDays: d, differenceInCalendarMonths: u, endOfBroadcastWeek: h, endOfISOWeek: b, endOfMonth: v, endOfWeek: C, isAfter: M, startOfBroadcastWeek: O, startOfISOWeek: N, startOfWeek: p } = n, D = c ? O(o, n) : s ? N(o) : p(o), g = c ? h(a) : s ? b(v(a)) : C(v(a)), m = t && (c ? h(t) : s ? b(t) : C(t)), W = m && M(g, m) ? m : g, P = d(W, D), I = u(a, o) + 1, F = [];
2139
- for (let L = 0; L <= P; L++) {
2140
- const R = f(D, L);
2141
- F.push(R);
2245
+ function is(e, t, r, n) {
2246
+ const o = e[0], i = e[e.length - 1], { ISOWeek: a, fixedWeeks: s, broadcastCalendar: c } = r ?? {}, { addDays: u, differenceInCalendarDays: f, differenceInCalendarMonths: l, endOfBroadcastWeek: d, endOfISOWeek: w, endOfMonth: O, endOfWeek: N, isAfter: k, startOfBroadcastWeek: v, startOfISOWeek: Y, startOfWeek: p } = n, D = c ? v(o, n) : a ? Y(o) : p(o), b = c ? d(i) : a ? w(O(i)) : N(O(i)), m = t && (c ? d(t) : a ? w(t) : N(t)), W = m && k(b, m) ? m : b, E = f(W, D), I = l(i, o) + 1, F = [];
2247
+ for (let ee = 0; ee <= E; ee++) {
2248
+ const $ = u(D, ee);
2249
+ F.push($);
2142
2250
  }
2143
- const ne = (c ? 35 : 42) * I;
2144
- if (i && F.length < ne) {
2145
- const L = ne - F.length;
2146
- for (let R = 0; R < L; R++) {
2147
- const ae = f(F[F.length - 1], 1);
2148
- F.push(ae);
2251
+ const oe = (c ? 35 : 42) * I;
2252
+ if (s && F.length < oe) {
2253
+ const ee = oe - F.length;
2254
+ for (let $ = 0; $ < ee; $++) {
2255
+ const ce = u(F[F.length - 1], 1);
2256
+ F.push(ce);
2149
2257
  }
2150
2258
  }
2151
2259
  return F;
2152
2260
  }
2153
- function ns(e) {
2261
+ function cs(e) {
2154
2262
  const t = [];
2155
2263
  return e.reduce((r, n) => {
2156
- const o = n.weeks.reduce((a, s) => a.concat(s.days.slice()), t.slice());
2264
+ const o = n.weeks.reduce((i, a) => i.concat(a.days.slice()), t.slice());
2157
2265
  return r.concat(o.slice());
2158
2266
  }, t.slice());
2159
2267
  }
2160
- function rs(e, t, r, n) {
2161
- const { numberOfMonths: o = 1 } = r, a = [];
2162
- for (let s = 0; s < o; s++) {
2163
- const i = n.addMonths(e, s);
2164
- if (t && i > t)
2268
+ function us(e, t, r, n) {
2269
+ const { numberOfMonths: o = 1 } = r, i = [];
2270
+ for (let a = 0; a < o; a++) {
2271
+ const s = n.addMonths(e, a);
2272
+ if (t && s > t)
2165
2273
  break;
2166
- a.push(i);
2274
+ i.push(s);
2167
2275
  }
2168
- return a;
2169
- }
2170
- function ct(e, t, r, n) {
2171
- const { month: o, defaultMonth: a, today: s = n.today(), numberOfMonths: i = 1 } = e;
2172
- let c = o || a || s;
2173
- const { differenceInCalendarMonths: f, addMonths: d, startOfMonth: u } = n;
2174
- if (r && f(r, c) < i - 1) {
2175
- const h = -1 * (i - 1);
2176
- c = d(r, h);
2276
+ return i;
2277
+ }
2278
+ function gt(e, t, r, n) {
2279
+ const { month: o, defaultMonth: i, today: a = n.today(), numberOfMonths: s = 1 } = e;
2280
+ let c = o || i || a;
2281
+ const { differenceInCalendarMonths: u, addMonths: f, startOfMonth: l } = n;
2282
+ if (r && u(r, c) < s - 1) {
2283
+ const d = -1 * (s - 1);
2284
+ c = f(r, d);
2177
2285
  }
2178
- return t && f(c, t) < 0 && (c = t), u(c);
2286
+ return t && u(c, t) < 0 && (c = t), l(c);
2179
2287
  }
2180
- function os(e, t, r, n) {
2181
- const { addDays: o, endOfBroadcastWeek: a, endOfISOWeek: s, endOfMonth: i, endOfWeek: c, getISOWeek: f, getWeek: d, startOfBroadcastWeek: u, startOfISOWeek: h, startOfWeek: b } = n, v = e.reduce((C, M) => {
2182
- const O = r.broadcastCalendar ? u(M, n) : r.ISOWeek ? h(M) : b(M), N = r.broadcastCalendar ? a(M) : r.ISOWeek ? s(i(M)) : c(i(M)), p = t.filter((W) => W >= O && W <= N), D = r.broadcastCalendar ? 35 : 42;
2288
+ function ls(e, t, r, n) {
2289
+ const { addDays: o, endOfBroadcastWeek: i, endOfISOWeek: a, endOfMonth: s, endOfWeek: c, getISOWeek: u, getWeek: f, startOfBroadcastWeek: l, startOfISOWeek: d, startOfWeek: w } = n, O = e.reduce((N, k) => {
2290
+ const v = r.broadcastCalendar ? l(k, n) : r.ISOWeek ? d(k) : w(k), Y = r.broadcastCalendar ? i(k) : r.ISOWeek ? a(s(k)) : c(s(k)), p = t.filter((W) => W >= v && W <= Y), D = r.broadcastCalendar ? 35 : 42;
2183
2291
  if (r.fixedWeeks && p.length < D) {
2184
- const W = t.filter((P) => {
2292
+ const W = t.filter((E) => {
2185
2293
  const I = D - p.length;
2186
- return P > N && P <= o(N, I);
2294
+ return E > Y && E <= o(Y, I);
2187
2295
  });
2188
2296
  p.push(...W);
2189
2297
  }
2190
- const g = p.reduce((W, P) => {
2191
- const I = r.ISOWeek ? f(P) : d(P), F = W.find((ne) => ne.weekNumber === I), Q = new Ct(P, M, n);
2192
- return F ? F.days.push(Q) : W.push(new Qr(I, [Q])), W;
2193
- }, []), m = new zr(M, g);
2194
- return C.push(m), C;
2298
+ const b = p.reduce((W, E) => {
2299
+ const I = r.ISOWeek ? u(E) : f(E), F = W.find((oe) => oe.weekNumber === I), Z = new _t(E, k, n);
2300
+ return F ? F.days.push(Z) : W.push(new oo(I, [Z])), W;
2301
+ }, []), m = new ro(k, b);
2302
+ return N.push(m), N;
2195
2303
  }, []);
2196
- return r.reverseMonths ? v.reverse() : v;
2304
+ return r.reverseMonths ? O.reverse() : O;
2197
2305
  }
2198
- function ss(e, t) {
2306
+ function fs(e, t) {
2199
2307
  let { startMonth: r, endMonth: n } = e;
2200
- const { startOfYear: o, startOfDay: a, startOfMonth: s, endOfMonth: i, addYears: c, endOfYear: f, newDate: d, today: u } = t, { fromYear: h, toYear: b, fromMonth: v, toMonth: C } = e;
2201
- !r && v && (r = v), !r && h && (r = t.newDate(h, 0, 1)), !n && C && (n = C), !n && b && (n = d(b, 11, 31));
2202
- const M = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
2203
- return r ? r = s(r) : h ? r = d(h, 0, 1) : !r && M && (r = o(c(e.today ?? u(), -100))), n ? n = i(n) : b ? n = d(b, 11, 31) : !n && M && (n = f(e.today ?? u())), [
2204
- r && a(r),
2205
- n && a(n)
2308
+ const { startOfYear: o, startOfDay: i, startOfMonth: a, endOfMonth: s, addYears: c, endOfYear: u, newDate: f, today: l } = t, { fromYear: d, toYear: w, fromMonth: O, toMonth: N } = e;
2309
+ !r && O && (r = O), !r && d && (r = t.newDate(d, 0, 1)), !n && N && (n = N), !n && w && (n = f(w, 11, 31));
2310
+ const k = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
2311
+ return r ? r = a(r) : d ? r = f(d, 0, 1) : !r && k && (r = o(c(e.today ?? l(), -100))), n ? n = s(n) : w ? n = f(w, 11, 31) : !n && k && (n = u(e.today ?? l())), [
2312
+ r && i(r),
2313
+ n && i(n)
2206
2314
  ];
2207
2315
  }
2208
- function as(e, t, r, n) {
2316
+ function ds(e, t, r, n) {
2209
2317
  if (r.disableNavigation)
2210
2318
  return;
2211
- const { pagedNavigation: o, numberOfMonths: a = 1 } = r, { startOfMonth: s, addMonths: i, differenceInCalendarMonths: c } = n, f = o ? a : 1, d = s(e);
2319
+ const { pagedNavigation: o, numberOfMonths: i = 1 } = r, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: c } = n, u = o ? i : 1, f = a(e);
2212
2320
  if (!t)
2213
- return i(d, f);
2214
- if (!(c(t, e) < a))
2215
- return i(d, f);
2321
+ return s(f, u);
2322
+ if (!(c(t, e) < i))
2323
+ return s(f, u);
2216
2324
  }
2217
- function is(e, t, r, n) {
2325
+ function hs(e, t, r, n) {
2218
2326
  if (r.disableNavigation)
2219
2327
  return;
2220
- const { pagedNavigation: o, numberOfMonths: a } = r, { startOfMonth: s, addMonths: i, differenceInCalendarMonths: c } = n, f = o ? a ?? 1 : 1, d = s(e);
2328
+ const { pagedNavigation: o, numberOfMonths: i } = r, { startOfMonth: a, addMonths: s, differenceInCalendarMonths: c } = n, u = o ? i ?? 1 : 1, f = a(e);
2221
2329
  if (!t)
2222
- return i(d, -f);
2223
- if (!(c(d, t) <= 0))
2224
- return i(d, -f);
2330
+ return s(f, -u);
2331
+ if (!(c(f, t) <= 0))
2332
+ return s(f, -u);
2225
2333
  }
2226
- function cs(e) {
2334
+ function ms(e) {
2227
2335
  const t = [];
2228
2336
  return e.reduce((r, n) => r.concat(n.weeks.slice()), t.slice());
2229
2337
  }
2230
- function Se(e, t) {
2231
- const [r, n] = Oe(e);
2338
+ function Ye(e, t) {
2339
+ const [r, n] = Ce(e);
2232
2340
  return [t === void 0 ? r : t, n];
2233
2341
  }
2234
- function us(e, t) {
2235
- const [r, n] = ss(e, t), { startOfMonth: o, endOfMonth: a } = t, s = ct(e, r, n, t), [i, c] = Se(
2236
- s,
2342
+ function ys(e, t) {
2343
+ const [r, n] = fs(e, t), { startOfMonth: o, endOfMonth: i } = t, a = gt(e, r, n, t), [s, c] = Ye(
2344
+ a,
2237
2345
  // initialMonth is always computed from props.month if provided
2238
- e.month ? s : void 0
2346
+ e.month ? a : void 0
2239
2347
  );
2240
- hn(() => {
2241
- const D = ct(e, r, n, t);
2348
+ Nn(() => {
2349
+ const D = gt(e, r, n, t);
2242
2350
  c(D);
2243
2351
  }, [e.timeZone]);
2244
- const { months: f, weeks: d, days: u, previousMonth: h, nextMonth: b } = ve(() => {
2245
- const D = rs(i, n, { numberOfMonths: e.numberOfMonths }, t), g = ts(D, e.endMonth ? a(e.endMonth) : void 0, {
2352
+ const { months: u, weeks: f, days: l, previousMonth: d, nextMonth: w } = Ne(() => {
2353
+ const D = us(s, n, { numberOfMonths: e.numberOfMonths }, t), b = is(D, e.endMonth ? i(e.endMonth) : void 0, {
2246
2354
  ISOWeek: e.ISOWeek,
2247
2355
  fixedWeeks: e.fixedWeeks,
2248
2356
  broadcastCalendar: e.broadcastCalendar
2249
- }, t), m = os(D, g, {
2357
+ }, t), m = ls(D, b, {
2250
2358
  broadcastCalendar: e.broadcastCalendar,
2251
2359
  fixedWeeks: e.fixedWeeks,
2252
2360
  ISOWeek: e.ISOWeek,
2253
2361
  reverseMonths: e.reverseMonths
2254
- }, t), W = cs(m), P = ns(m), I = is(i, r, e, t), F = as(i, n, e, t);
2362
+ }, t), W = ms(m), E = cs(m), I = hs(s, r, e, t), F = ds(s, n, e, t);
2255
2363
  return {
2256
2364
  months: m,
2257
2365
  weeks: W,
2258
- days: P,
2366
+ days: E,
2259
2367
  previousMonth: I,
2260
2368
  nextMonth: F
2261
2369
  };
2262
2370
  }, [
2263
2371
  t,
2264
- i.getTime(),
2372
+ s.getTime(),
2265
2373
  n?.getTime(),
2266
2374
  r?.getTime(),
2267
2375
  e.disableNavigation,
@@ -2272,178 +2380,178 @@ function us(e, t) {
2272
2380
  e.numberOfMonths,
2273
2381
  e.pagedNavigation,
2274
2382
  e.reverseMonths
2275
- ]), { disableNavigation: v, onMonthChange: C } = e, M = (D) => d.some((g) => g.days.some((m) => m.isEqualTo(D))), O = (D) => {
2276
- if (v)
2383
+ ]), { disableNavigation: O, onMonthChange: N } = e, k = (D) => f.some((b) => b.days.some((m) => m.isEqualTo(D))), v = (D) => {
2384
+ if (O)
2277
2385
  return;
2278
- let g = o(D);
2279
- r && g < o(r) && (g = o(r)), n && g > o(n) && (g = o(n)), c(g), C?.(g);
2386
+ let b = o(D);
2387
+ r && b < o(r) && (b = o(r)), n && b > o(n) && (b = o(n)), c(b), N?.(b);
2280
2388
  };
2281
2389
  return {
2282
- months: f,
2283
- weeks: d,
2284
- days: u,
2390
+ months: u,
2391
+ weeks: f,
2392
+ days: l,
2285
2393
  navStart: r,
2286
2394
  navEnd: n,
2287
- previousMonth: h,
2288
- nextMonth: b,
2289
- goToMonth: O,
2395
+ previousMonth: d,
2396
+ nextMonth: w,
2397
+ goToMonth: v,
2290
2398
  goToDay: (D) => {
2291
- M(D) || O(D.date);
2399
+ k(D) || v(D.date);
2292
2400
  }
2293
2401
  };
2294
2402
  }
2295
- var Z;
2403
+ var K;
2296
2404
  (function(e) {
2297
2405
  e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
2298
- })(Z || (Z = {}));
2299
- function ut(e) {
2406
+ })(K || (K = {}));
2407
+ function bt(e) {
2300
2408
  return !e[_.disabled] && !e[_.hidden] && !e[_.outside];
2301
2409
  }
2302
- function fs(e, t, r, n) {
2303
- let o, a = -1;
2304
- for (const s of e) {
2305
- const i = t(s);
2306
- ut(i) && (i[_.focused] && a < Z.FocusedModifier ? (o = s, a = Z.FocusedModifier) : n?.isEqualTo(s) && a < Z.LastFocused ? (o = s, a = Z.LastFocused) : r(s.date) && a < Z.Selected ? (o = s, a = Z.Selected) : i[_.today] && a < Z.Today && (o = s, a = Z.Today));
2410
+ function gs(e, t, r, n) {
2411
+ let o, i = -1;
2412
+ for (const a of e) {
2413
+ const s = t(a);
2414
+ bt(s) && (s[_.focused] && i < K.FocusedModifier ? (o = a, i = K.FocusedModifier) : n?.isEqualTo(a) && i < K.LastFocused ? (o = a, i = K.LastFocused) : r(a.date) && i < K.Selected ? (o = a, i = K.Selected) : s[_.today] && i < K.Today && (o = a, i = K.Today));
2307
2415
  }
2308
- return o || (o = e.find((s) => ut(t(s)))), o;
2416
+ return o || (o = e.find((a) => bt(t(a)))), o;
2309
2417
  }
2310
- function ds(e, t, r, n, o, a, s) {
2311
- const { ISOWeek: i, broadcastCalendar: c } = a, { addDays: f, addMonths: d, addWeeks: u, addYears: h, endOfBroadcastWeek: b, endOfISOWeek: v, endOfWeek: C, max: M, min: O, startOfBroadcastWeek: N, startOfISOWeek: p, startOfWeek: D } = s;
2418
+ function bs(e, t, r, n, o, i, a) {
2419
+ const { ISOWeek: s, broadcastCalendar: c } = i, { addDays: u, addMonths: f, addWeeks: l, addYears: d, endOfBroadcastWeek: w, endOfISOWeek: O, endOfWeek: N, max: k, min: v, startOfBroadcastWeek: Y, startOfISOWeek: p, startOfWeek: D } = a;
2312
2420
  let m = {
2313
- day: f,
2314
- week: u,
2315
- month: d,
2316
- year: h,
2317
- startOfWeek: (W) => c ? N(W, s) : i ? p(W) : D(W),
2318
- endOfWeek: (W) => c ? b(W) : i ? v(W) : C(W)
2421
+ day: u,
2422
+ week: l,
2423
+ month: f,
2424
+ year: d,
2425
+ startOfWeek: (W) => c ? Y(W, a) : s ? p(W) : D(W),
2426
+ endOfWeek: (W) => c ? w(W) : s ? O(W) : N(W)
2319
2427
  }[e](r, t === "after" ? 1 : -1);
2320
- return t === "before" && n ? m = M([n, m]) : t === "after" && o && (m = O([o, m])), m;
2428
+ return t === "before" && n ? m = k([n, m]) : t === "after" && o && (m = v([o, m])), m;
2321
2429
  }
2322
- function Ft(e, t, r, n, o, a, s, i = 0) {
2323
- if (i > 365)
2430
+ function Ut(e, t, r, n, o, i, a, s = 0) {
2431
+ if (s > 365)
2324
2432
  return;
2325
- const c = ds(e, t, r.date, n, o, a, s), f = !!(a.disabled && te(c, a.disabled, s)), d = !!(a.hidden && te(c, a.hidden, s)), u = c, h = new Ct(c, u, s);
2326
- return !f && !d ? h : Ft(e, t, h, n, o, a, s, i + 1);
2433
+ const c = bs(e, t, r.date, n, o, i, a), u = !!(i.disabled && re(c, i.disabled, a)), f = !!(i.hidden && re(c, i.hidden, a)), l = c, d = new _t(c, l, a);
2434
+ return !u && !f ? d : Ut(e, t, d, n, o, i, a, s + 1);
2327
2435
  }
2328
- function ls(e, t, r, n, o) {
2329
- const { autoFocus: a } = e, [s, i] = Oe(), c = fs(t.days, r, n || (() => !1), s), [f, d] = Oe(a ? c : void 0);
2436
+ function ws(e, t, r, n, o) {
2437
+ const { autoFocus: i } = e, [a, s] = Ce(), c = gs(t.days, r, n || (() => !1), a), [u, f] = Ce(i ? c : void 0);
2330
2438
  return {
2331
- isFocusTarget: (C) => !!c?.isEqualTo(C),
2332
- setFocused: d,
2333
- focused: f,
2439
+ isFocusTarget: (N) => !!c?.isEqualTo(N),
2440
+ setFocused: f,
2441
+ focused: u,
2334
2442
  blur: () => {
2335
- i(f), d(void 0);
2443
+ s(u), f(void 0);
2336
2444
  },
2337
- moveFocus: (C, M) => {
2338
- if (!f)
2445
+ moveFocus: (N, k) => {
2446
+ if (!u)
2339
2447
  return;
2340
- const O = Ft(C, M, f, t.navStart, t.navEnd, e, o);
2341
- O && (e.disableNavigation && !t.days.some((p) => p.isEqualTo(O)) || (t.goToDay(O), d(O)));
2448
+ const v = Ut(N, k, u, t.navStart, t.navEnd, e, o);
2449
+ v && (e.disableNavigation && !t.days.some((p) => p.isEqualTo(v)) || (t.goToDay(v), f(v)));
2342
2450
  }
2343
2451
  };
2344
2452
  }
2345
- function hs(e, t) {
2346
- const { selected: r, required: n, onSelect: o } = e, [a, s] = Se(r, o ? r : void 0), i = o ? r : a, { isSameDay: c } = t, f = (b) => i?.some((v) => c(v, b)) ?? !1, { min: d, max: u } = e;
2453
+ function ps(e, t) {
2454
+ const { selected: r, required: n, onSelect: o } = e, [i, a] = Ye(r, o ? r : void 0), s = o ? r : i, { isSameDay: c } = t, u = (w) => s?.some((O) => c(O, w)) ?? !1, { min: f, max: l } = e;
2347
2455
  return {
2348
- selected: i,
2349
- select: (b, v, C) => {
2350
- let M = [...i ?? []];
2351
- if (f(b)) {
2352
- if (i?.length === d || n && i?.length === 1)
2456
+ selected: s,
2457
+ select: (w, O, N) => {
2458
+ let k = [...s ?? []];
2459
+ if (u(w)) {
2460
+ if (s?.length === f || n && s?.length === 1)
2353
2461
  return;
2354
- M = i?.filter((O) => !c(O, b));
2462
+ k = s?.filter((v) => !c(v, w));
2355
2463
  } else
2356
- i?.length === u ? M = [b] : M = [...M, b];
2357
- return o || s(M), o?.(M, b, v, C), M;
2464
+ s?.length === l ? k = [w] : k = [...k, w];
2465
+ return o || a(k), o?.(k, w, O, N), k;
2358
2466
  },
2359
- isSelected: f
2467
+ isSelected: u
2360
2468
  };
2361
2469
  }
2362
- function ms(e, t, r = 0, n = 0, o = !1, a = V) {
2363
- const { from: s, to: i } = t || {}, { isSameDay: c, isAfter: f, isBefore: d } = a;
2364
- let u;
2365
- if (!s && !i)
2366
- u = { from: e, to: r > 0 ? void 0 : e };
2367
- else if (s && !i)
2368
- c(s, e) ? r === 0 ? u = { from: s, to: e } : o ? u = { from: s, to: void 0 } : u = void 0 : d(e, s) ? u = { from: e, to: s } : u = { from: s, to: e };
2369
- else if (s && i)
2370
- if (c(s, e) && c(i, e))
2371
- o ? u = { from: s, to: i } : u = void 0;
2470
+ function Ms(e, t, r = 0, n = 0, o = !1, i = L) {
2471
+ const { from: a, to: s } = t || {}, { isSameDay: c, isAfter: u, isBefore: f } = i;
2472
+ let l;
2473
+ if (!a && !s)
2474
+ l = { from: e, to: r > 0 ? void 0 : e };
2475
+ else if (a && !s)
2476
+ c(a, e) ? r === 0 ? l = { from: a, to: e } : o ? l = { from: a, to: void 0 } : l = void 0 : f(e, a) ? l = { from: e, to: a } : l = { from: a, to: e };
2477
+ else if (a && s)
2478
+ if (c(a, e) && c(s, e))
2479
+ o ? l = { from: a, to: s } : l = void 0;
2480
+ else if (c(a, e))
2481
+ l = { from: a, to: r > 0 ? void 0 : e };
2372
2482
  else if (c(s, e))
2373
- u = { from: s, to: r > 0 ? void 0 : e };
2374
- else if (c(i, e))
2375
- u = { from: e, to: r > 0 ? void 0 : e };
2376
- else if (d(e, s))
2377
- u = { from: e, to: i };
2378
- else if (f(e, s))
2379
- u = { from: s, to: e };
2380
- else if (f(e, i))
2381
- u = { from: s, to: e };
2483
+ l = { from: e, to: r > 0 ? void 0 : e };
2484
+ else if (f(e, a))
2485
+ l = { from: e, to: s };
2486
+ else if (u(e, a))
2487
+ l = { from: a, to: e };
2488
+ else if (u(e, s))
2489
+ l = { from: a, to: e };
2382
2490
  else
2383
2491
  throw new Error("Invalid range");
2384
- if (u?.from && u?.to) {
2385
- const h = a.differenceInCalendarDays(u.to, u.from);
2386
- n > 0 && h > n ? u = { from: e, to: void 0 } : r > 1 && h < r && (u = { from: e, to: void 0 });
2492
+ if (l?.from && l?.to) {
2493
+ const d = i.differenceInCalendarDays(l.to, l.from);
2494
+ n > 0 && d > n ? l = { from: e, to: void 0 } : r > 1 && d < r && (l = { from: e, to: void 0 });
2387
2495
  }
2388
- return u;
2496
+ return l;
2389
2497
  }
2390
- function ys(e, t, r = V) {
2498
+ function ks(e, t, r = L) {
2391
2499
  const n = Array.isArray(t) ? t : [t];
2392
2500
  let o = e.from;
2393
- const a = r.differenceInCalendarDays(e.to, e.from), s = Math.min(a, 6);
2394
- for (let i = 0; i <= s; i++) {
2501
+ const i = r.differenceInCalendarDays(e.to, e.from), a = Math.min(i, 6);
2502
+ for (let s = 0; s <= a; s++) {
2395
2503
  if (n.includes(o.getDay()))
2396
2504
  return !0;
2397
2505
  o = r.addDays(o, 1);
2398
2506
  }
2399
2507
  return !1;
2400
2508
  }
2401
- function ft(e, t, r = V) {
2402
- return ee(e, t.from, !1, r) || ee(e, t.to, !1, r) || ee(t, e.from, !1, r) || ee(t, e.to, !1, r);
2509
+ function wt(e, t, r = L) {
2510
+ return ne(e, t.from, !1, r) || ne(e, t.to, !1, r) || ne(t, e.from, !1, r) || ne(t, e.to, !1, r);
2403
2511
  }
2404
- function gs(e, t, r = V) {
2512
+ function Ds(e, t, r = L) {
2405
2513
  const n = Array.isArray(t) ? t : [t];
2406
- if (n.filter((i) => typeof i != "function").some((i) => typeof i == "boolean" ? i : r.isDate(i) ? ee(e, i, !1, r) : Tt(i, r) ? i.some((c) => ee(e, c, !1, r)) : We(i) ? i.from && i.to ? ft(e, { from: i.from, to: i.to }, r) : !1 : xt(i) ? ys(e, i.dayOfWeek, r) : Ge(i) ? r.isAfter(i.before, i.after) ? ft(e, {
2407
- from: r.addDays(i.after, 1),
2408
- to: r.addDays(i.before, -1)
2409
- }, r) : te(e.from, i, r) || te(e.to, i, r) : ze(i) || Qe(i) ? te(e.from, i, r) || te(e.to, i, r) : !1))
2514
+ if (n.filter((s) => typeof s != "function").some((s) => typeof s == "boolean" ? s : r.isDate(s) ? ne(e, s, !1, r) : It(s, r) ? s.some((c) => ne(e, c, !1, r)) : xe(s) ? s.from && s.to ? wt(e, { from: s.from, to: s.to }, r) : !1 : Bt(s) ? ks(e, s.dayOfWeek, r) : Ze(s) ? r.isAfter(s.before, s.after) ? wt(e, {
2515
+ from: r.addDays(s.after, 1),
2516
+ to: r.addDays(s.before, -1)
2517
+ }, r) : re(e.from, s, r) || re(e.to, s, r) : Ke(s) || Je(s) ? re(e.from, s, r) || re(e.to, s, r) : !1))
2410
2518
  return !0;
2411
- const s = n.filter((i) => typeof i == "function");
2412
- if (s.length) {
2413
- let i = e.from;
2519
+ const a = n.filter((s) => typeof s == "function");
2520
+ if (a.length) {
2521
+ let s = e.from;
2414
2522
  const c = r.differenceInCalendarDays(e.to, e.from);
2415
- for (let f = 0; f <= c; f++) {
2416
- if (s.some((d) => d(i)))
2523
+ for (let u = 0; u <= c; u++) {
2524
+ if (a.some((f) => f(s)))
2417
2525
  return !0;
2418
- i = r.addDays(i, 1);
2526
+ s = r.addDays(s, 1);
2419
2527
  }
2420
2528
  }
2421
2529
  return !1;
2422
2530
  }
2423
- function bs(e, t) {
2424
- const { disabled: r, excludeDisabled: n, selected: o, required: a, onSelect: s } = e, [i, c] = Se(o, s ? o : void 0), f = s ? o : i;
2531
+ function Os(e, t) {
2532
+ const { disabled: r, excludeDisabled: n, selected: o, required: i, onSelect: a } = e, [s, c] = Ye(o, a ? o : void 0), u = a ? o : s;
2425
2533
  return {
2426
- selected: f,
2427
- select: (h, b, v) => {
2428
- const { min: C, max: M } = e, O = h ? ms(h, f, C, M, a, t) : void 0;
2429
- return n && r && O?.from && O.to && gs({ from: O.from, to: O.to }, r, t) && (O.from = h, O.to = void 0), s || c(O), s?.(O, h, b, v), O;
2534
+ selected: u,
2535
+ select: (d, w, O) => {
2536
+ const { min: N, max: k } = e, v = d ? Ms(d, u, N, k, i, t) : void 0;
2537
+ return n && r && v?.from && v.to && Ds({ from: v.from, to: v.to }, r, t) && (v.from = d, v.to = void 0), a || c(v), a?.(v, d, w, O), v;
2430
2538
  },
2431
- isSelected: (h) => f && ee(f, h, !1, t)
2539
+ isSelected: (d) => u && ne(u, d, !1, t)
2432
2540
  };
2433
2541
  }
2434
- function ws(e, t) {
2435
- const { selected: r, required: n, onSelect: o } = e, [a, s] = Se(r, o ? r : void 0), i = o ? r : a, { isSameDay: c } = t;
2542
+ function vs(e, t) {
2543
+ const { selected: r, required: n, onSelect: o } = e, [i, a] = Ye(r, o ? r : void 0), s = o ? r : i, { isSameDay: c } = t;
2436
2544
  return {
2437
- selected: i,
2438
- select: (u, h, b) => {
2439
- let v = u;
2440
- return !n && i && i && c(u, i) && (v = void 0), o || s(v), o?.(v, u, h, b), v;
2545
+ selected: s,
2546
+ select: (l, d, w) => {
2547
+ let O = l;
2548
+ return !n && s && s && c(l, s) && (O = void 0), o || a(O), o?.(O, l, d, w), O;
2441
2549
  },
2442
- isSelected: (u) => i ? c(i, u) : !1
2550
+ isSelected: (l) => s ? c(s, l) : !1
2443
2551
  };
2444
2552
  }
2445
- function ps(e, t) {
2446
- const r = ws(e, t), n = hs(e, t), o = bs(e, t);
2553
+ function Ws(e, t) {
2554
+ const r = vs(e, t), n = ps(e, t), o = Os(e, t);
2447
2555
  switch (e.mode) {
2448
2556
  case "single":
2449
2557
  return r;
@@ -2455,58 +2563,64 @@ function ps(e, t) {
2455
2563
  return;
2456
2564
  }
2457
2565
  }
2458
- function A(e, t) {
2459
- return e instanceof J && e.timeZone === t ? e : new J(e, t);
2566
+ function R(e, t) {
2567
+ return e instanceof H && e.timeZone === t ? e : new H(e, t);
2460
2568
  }
2461
- function dt(e, t) {
2462
- return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? A(e, t) : Array.isArray(e) ? e.map((r) => r instanceof Date ? A(r, t) : r) : We(e) ? {
2569
+ function le(e, t, r) {
2570
+ return R(e, t);
2571
+ }
2572
+ function pt(e, t, r) {
2573
+ return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? le(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? le(n, t) : n) : xe(e) ? {
2463
2574
  ...e,
2464
- from: e.from ? A(e.from, t) : e.from,
2465
- to: e.to ? A(e.to, t) : e.to
2466
- } : Ge(e) ? {
2467
- before: A(e.before, t),
2468
- after: A(e.after, t)
2469
- } : ze(e) ? {
2470
- after: A(e.after, t)
2471
- } : Qe(e) ? {
2472
- before: A(e.before, t)
2575
+ from: e.from ? R(e.from, t) : e.from,
2576
+ to: e.to ? R(e.to, t) : e.to
2577
+ } : Ze(e) ? {
2578
+ before: le(e.before, t),
2579
+ after: le(e.after, t)
2580
+ } : Ke(e) ? {
2581
+ after: le(e.after, t)
2582
+ } : Je(e) ? {
2583
+ before: le(e.before, t)
2473
2584
  } : e;
2474
2585
  }
2475
- function je(e, t) {
2476
- return e && (Array.isArray(e) ? e.map((r) => dt(r, t)) : dt(e, t));
2586
+ function ze(e, t, r) {
2587
+ return e && (Array.isArray(e) ? e.map((n) => pt(n, t)) : pt(e, t));
2477
2588
  }
2478
- function Ms(e) {
2589
+ function Ss(e) {
2479
2590
  let t = e;
2480
2591
  const r = t.timeZone;
2481
2592
  if (r && (t = {
2482
2593
  ...e,
2483
2594
  timeZone: r
2484
- }, t.today && (t.today = A(t.today, r)), t.month && (t.month = A(t.month, r)), t.defaultMonth && (t.defaultMonth = A(t.defaultMonth, r)), t.startMonth && (t.startMonth = A(t.startMonth, r)), t.endMonth && (t.endMonth = A(t.endMonth, r)), t.mode === "single" && t.selected ? t.selected = A(t.selected, r) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((k) => A(k, r)) : t.mode === "range" && t.selected && (t.selected = {
2485
- from: t.selected.from ? A(t.selected.from, r) : t.selected.from,
2486
- to: t.selected.to ? A(t.selected.to, r) : t.selected.to
2487
- }), t.disabled !== void 0 && (t.disabled = je(t.disabled, r)), t.hidden !== void 0 && (t.hidden = je(t.hidden, r)), t.modifiers)) {
2488
- const k = {};
2489
- Object.keys(t.modifiers).forEach((Y) => {
2490
- k[Y] = je(t.modifiers?.[Y], r);
2491
- }), t.modifiers = k;
2595
+ }, t.today && (t.today = R(t.today, r)), t.month && (t.month = R(t.month, r)), t.defaultMonth && (t.defaultMonth = R(t.defaultMonth, r)), t.startMonth && (t.startMonth = R(t.startMonth, r)), t.endMonth && (t.endMonth = R(t.endMonth, r)), t.mode === "single" && t.selected ? t.selected = R(t.selected, r) : t.mode === "multiple" && t.selected ? t.selected = t.selected?.map((M) => R(M, r)) : t.mode === "range" && t.selected && (t.selected = {
2596
+ from: t.selected.from ? R(t.selected.from, r) : t.selected.from,
2597
+ to: t.selected.to ? R(t.selected.to, r) : t.selected.to
2598
+ }), t.disabled !== void 0 && (t.disabled = ze(t.disabled, r)), t.hidden !== void 0 && (t.hidden = ze(t.hidden, r)), t.modifiers)) {
2599
+ const M = {};
2600
+ Object.keys(t.modifiers).forEach((x) => {
2601
+ M[x] = ze(t.modifiers?.[x], r);
2602
+ }), t.modifiers = M;
2492
2603
  }
2493
- const { components: n, formatters: o, labels: a, dateLib: s, locale: i, classNames: c } = ve(() => {
2494
- const k = { ...$e, ...t.locale };
2604
+ const { components: n, formatters: o, labels: i, dateLib: a, locale: s, classNames: c } = Ne(() => {
2605
+ const M = { ...Et, ...t.locale }, x = t.broadcastCalendar ? 1 : t.weekStartsOn, g = t.noonSafe && t.timeZone ? ns(t.timeZone, {
2606
+ weekStartsOn: x,
2607
+ locale: M
2608
+ }) : void 0, C = t.dateLib && g ? { ...g, ...t.dateLib } : t.dateLib ?? g, A = new G({
2609
+ locale: M,
2610
+ weekStartsOn: x,
2611
+ firstWeekContainsDate: t.firstWeekContainsDate,
2612
+ useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
2613
+ useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
2614
+ timeZone: t.timeZone,
2615
+ numerals: t.numerals
2616
+ }, C);
2495
2617
  return {
2496
- dateLib: new j({
2497
- locale: k,
2498
- weekStartsOn: t.broadcastCalendar ? 1 : t.weekStartsOn,
2499
- firstWeekContainsDate: t.firstWeekContainsDate,
2500
- useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
2501
- useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
2502
- timeZone: t.timeZone,
2503
- numerals: t.numerals
2504
- }, t.dateLib),
2505
- components: vo(t.components),
2506
- formatters: _o(t.formatters),
2507
- labels: { ...Vo, ...t.labels },
2508
- locale: k,
2509
- classNames: { ...Wo(), ...t.classNames }
2618
+ dateLib: A,
2619
+ components: Fo(t.components),
2620
+ formatters: Qo(t.formatters),
2621
+ labels: Ko(t.labels, A.options),
2622
+ locale: M,
2623
+ classNames: { ...Io(), ...t.classNames }
2510
2624
  };
2511
2625
  }, [
2512
2626
  t.locale,
@@ -2518,115 +2632,116 @@ function Ms(e) {
2518
2632
  t.timeZone,
2519
2633
  t.numerals,
2520
2634
  t.dateLib,
2635
+ t.noonSafe,
2521
2636
  t.components,
2522
2637
  t.formatters,
2523
2638
  t.labels,
2524
2639
  t.classNames
2525
2640
  ]);
2526
- t.today || (t = { ...t, today: s.today() });
2527
- const { captionLayout: f, mode: d, navLayout: u, numberOfMonths: h = 1, onDayBlur: b, onDayClick: v, onDayFocus: C, onDayKeyDown: M, onDayMouseEnter: O, onDayMouseLeave: N, onNextClick: p, onPrevClick: D, showWeekNumber: g, styles: m } = t, { formatCaption: W, formatDay: P, formatMonthDropdown: I, formatWeekNumber: F, formatWeekNumberHeader: Q, formatWeekdayName: ne, formatYearDropdown: L } = o, R = us(t, s), { days: ae, months: pe, navStart: Ce, navEnd: Ne, previousMonth: $, nextMonth: G, goToMonth: K } = R, xe = ko(ae, t, Ce, Ne, s), { isSelected: Te, select: Ye, selected: Me } = ps(t, s) ?? {}, { blur: Xe, focused: Ze, isFocusTarget: Bt, moveFocus: Ue, setFocused: ke } = ls(t, R, xe, Te ?? (() => !1), s), { labelDayButton: It, labelGridcell: At, labelGrid: Ht, labelMonthDropdown: qt, labelNav: Ve, labelPrevious: jt, labelNext: Rt, labelWeekday: $t, labelWeekNumber: Gt, labelWeekNumberHeader: zt, labelYearDropdown: Qt } = a, Xt = ve(() => Io(s, t.ISOWeek, t.broadcastCalendar, t.today), [s, t.ISOWeek, t.broadcastCalendar, t.today]), Le = d !== void 0 || v !== void 0, Ee = H(() => {
2528
- $ && (K($), D?.($));
2529
- }, [$, K, D]), Pe = H(() => {
2530
- G && (K(G), p?.(G));
2531
- }, [K, G, p]), Zt = H((k, Y) => (w) => {
2532
- w.preventDefault(), w.stopPropagation(), ke(k), !Y.disabled && (Ye?.(k.date, Y, w), v?.(k.date, Y, w));
2533
- }, [Ye, v, ke]), Ut = H((k, Y) => (w) => {
2534
- ke(k), C?.(k.date, Y, w);
2535
- }, [C, ke]), Vt = H((k, Y) => (w) => {
2536
- Xe(), b?.(k.date, Y, w);
2537
- }, [Xe, b]), Lt = H((k, Y) => (w) => {
2538
- const x = {
2641
+ t.today || (t = { ...t, today: a.today() });
2642
+ const { captionLayout: u, mode: f, navLayout: l, numberOfMonths: d = 1, onDayBlur: w, onDayClick: O, onDayFocus: N, onDayKeyDown: k, onDayMouseEnter: v, onDayMouseLeave: Y, onNextClick: p, onPrevClick: D, showWeekNumber: b, styles: m } = t, { formatCaption: W, formatDay: E, formatMonthDropdown: I, formatWeekNumber: F, formatWeekNumberHeader: Z, formatWeekdayName: oe, formatYearDropdown: ee } = o, $ = ys(t, a), { days: ce, months: Oe, navStart: Te, navEnd: Pe, previousMonth: z, nextMonth: Q, goToMonth: te } = $, Ee = Eo(ce, t, Te, Pe, a), { isSelected: _e, select: Fe, selected: ve } = Ws(t, a) ?? {}, { blur: tt, focused: nt, isFocusTarget: Zt, moveFocus: rt, setFocused: We } = ws(t, $, Ee, _e ?? (() => !1), a), { labelDayButton: Kt, labelGridcell: Jt, labelGrid: Lt, labelMonthDropdown: en, labelNav: ot, labelPrevious: tn, labelNext: nn, labelWeekday: rn, labelWeekNumber: on, labelWeekNumberHeader: sn, labelYearDropdown: an } = i, cn = Ne(() => es(a, t.ISOWeek, t.broadcastCalendar, t.today), [a, t.ISOWeek, t.broadcastCalendar, t.today]), st = f !== void 0 || O !== void 0, Be = q(() => {
2643
+ z && (te(z), D?.(z));
2644
+ }, [z, te, D]), Ie = q(() => {
2645
+ Q && (te(Q), p?.(Q));
2646
+ }, [te, Q, p]), un = q((M, x) => (g) => {
2647
+ g.preventDefault(), g.stopPropagation(), We(M), !x.disabled && (Fe?.(M.date, x, g), O?.(M.date, x, g));
2648
+ }, [Fe, O, We]), ln = q((M, x) => (g) => {
2649
+ We(M), N?.(M.date, x, g);
2650
+ }, [N, We]), fn = q((M, x) => (g) => {
2651
+ tt(), w?.(M.date, x, g);
2652
+ }, [tt, w]), dn = q((M, x) => (g) => {
2653
+ const C = {
2539
2654
  ArrowLeft: [
2540
- w.shiftKey ? "month" : "day",
2655
+ g.shiftKey ? "month" : "day",
2541
2656
  t.dir === "rtl" ? "after" : "before"
2542
2657
  ],
2543
2658
  ArrowRight: [
2544
- w.shiftKey ? "month" : "day",
2659
+ g.shiftKey ? "month" : "day",
2545
2660
  t.dir === "rtl" ? "before" : "after"
2546
2661
  ],
2547
- ArrowDown: [w.shiftKey ? "year" : "week", "after"],
2548
- ArrowUp: [w.shiftKey ? "year" : "week", "before"],
2549
- PageUp: [w.shiftKey ? "year" : "month", "before"],
2550
- PageDown: [w.shiftKey ? "year" : "month", "after"],
2662
+ ArrowDown: [g.shiftKey ? "year" : "week", "after"],
2663
+ ArrowUp: [g.shiftKey ? "year" : "week", "before"],
2664
+ PageUp: [g.shiftKey ? "year" : "month", "before"],
2665
+ PageDown: [g.shiftKey ? "year" : "month", "after"],
2551
2666
  Home: ["startOfWeek", "before"],
2552
2667
  End: ["endOfWeek", "after"]
2553
2668
  };
2554
- if (x[w.key]) {
2555
- w.preventDefault(), w.stopPropagation();
2556
- const [X, S] = x[w.key];
2557
- Ue(X, S);
2669
+ if (C[g.key]) {
2670
+ g.preventDefault(), g.stopPropagation();
2671
+ const [A, S] = C[g.key];
2672
+ rt(A, S);
2558
2673
  }
2559
- M?.(k.date, Y, w);
2560
- }, [Ue, M, t.dir]), Kt = H((k, Y) => (w) => {
2561
- O?.(k.date, Y, w);
2562
- }, [O]), Jt = H((k, Y) => (w) => {
2563
- N?.(k.date, Y, w);
2564
- }, [N]), en = H((k) => (Y) => {
2565
- const w = Number(Y.target.value), x = s.setMonth(s.startOfMonth(k), w);
2566
- K(x);
2567
- }, [s, K]), tn = H((k) => (Y) => {
2568
- const w = Number(Y.target.value), x = s.setYear(s.startOfMonth(k), w);
2569
- K(x);
2570
- }, [s, K]), { className: nn, style: rn } = ve(() => ({
2674
+ k?.(M.date, x, g);
2675
+ }, [rt, k, t.dir]), hn = q((M, x) => (g) => {
2676
+ v?.(M.date, x, g);
2677
+ }, [v]), mn = q((M, x) => (g) => {
2678
+ Y?.(M.date, x, g);
2679
+ }, [Y]), yn = q((M) => (x) => {
2680
+ const g = Number(x.target.value), C = a.setMonth(a.startOfMonth(M), g);
2681
+ te(C);
2682
+ }, [a, te]), gn = q((M) => (x) => {
2683
+ const g = Number(x.target.value), C = a.setYear(a.startOfMonth(M), g);
2684
+ te(C);
2685
+ }, [a, te]), { className: bn, style: wn } = Ne(() => ({
2571
2686
  className: [c[y.Root], t.className].filter(Boolean).join(" "),
2572
2687
  style: { ...m?.[y.Root], ...t.style }
2573
- }), [c, t.className, t.style, m]), on = Oo(t), Ke = De(null);
2574
- es(Ke, !!t.animate, {
2688
+ }), [c, t.className, t.style, m]), pn = Bo(t), at = Se(null);
2689
+ as(at, !!t.animate, {
2575
2690
  classNames: c,
2576
- months: pe,
2577
- focused: Ze,
2578
- dateLib: s
2691
+ months: Oe,
2692
+ focused: nt,
2693
+ dateLib: a
2579
2694
  });
2580
- const sn = {
2695
+ const Mn = {
2581
2696
  dayPickerProps: t,
2582
- selected: Me,
2583
- select: Ye,
2584
- isSelected: Te,
2585
- months: pe,
2586
- nextMonth: G,
2587
- previousMonth: $,
2588
- goToMonth: K,
2589
- getModifiers: xe,
2697
+ selected: ve,
2698
+ select: Fe,
2699
+ isSelected: _e,
2700
+ months: Oe,
2701
+ nextMonth: Q,
2702
+ previousMonth: z,
2703
+ goToMonth: te,
2704
+ getModifiers: Ee,
2590
2705
  components: n,
2591
2706
  classNames: c,
2592
2707
  styles: m,
2593
- labels: a,
2708
+ labels: i,
2594
2709
  formatters: o
2595
2710
  };
2596
- return l.createElement(
2597
- Nt.Provider,
2598
- { value: sn },
2599
- l.createElement(
2711
+ return h.createElement(
2712
+ Ft.Provider,
2713
+ { value: Mn },
2714
+ h.createElement(
2600
2715
  n.Root,
2601
- { rootRef: t.animate ? Ke : void 0, className: nn, style: rn, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...on },
2602
- l.createElement(
2716
+ { rootRef: t.animate ? at : void 0, className: bn, style: wn, dir: t.dir, id: t.id, lang: t.lang, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...pn },
2717
+ h.createElement(
2603
2718
  n.Months,
2604
2719
  { className: c[y.Months], style: m?.[y.Months] },
2605
- !t.hideNavigation && !u && l.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": Ve(), onPreviousClick: Ee, onNextClick: Pe, previousMonth: $, nextMonth: G }),
2606
- pe.map((k, Y) => l.createElement(
2720
+ !t.hideNavigation && !l && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": ot(), onPreviousClick: Be, onNextClick: Ie, previousMonth: z, nextMonth: Q }),
2721
+ Oe.map((M, x) => h.createElement(
2607
2722
  n.Month,
2608
2723
  {
2609
2724
  "data-animated-month": t.animate ? "true" : void 0,
2610
2725
  className: c[y.Month],
2611
2726
  style: m?.[y.Month],
2612
2727
  // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
2613
- key: Y,
2614
- displayIndex: Y,
2615
- calendarMonth: k
2728
+ key: x,
2729
+ displayIndex: x,
2730
+ calendarMonth: M
2616
2731
  },
2617
- u === "around" && !t.hideNavigation && Y === 0 && l.createElement(
2732
+ l === "around" && !t.hideNavigation && x === 0 && h.createElement(
2618
2733
  n.PreviousMonthButton,
2619
- { type: "button", className: c[y.PreviousMonthButton], tabIndex: $ ? void 0 : -1, "aria-disabled": $ ? void 0 : !0, "aria-label": jt($), onClick: Ee, "data-animated-button": t.animate ? "true" : void 0 },
2620
- l.createElement(n.Chevron, { disabled: $ ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
2734
+ { type: "button", className: c[y.PreviousMonthButton], tabIndex: z ? void 0 : -1, "aria-disabled": z ? void 0 : !0, "aria-label": tn(z), onClick: Be, "data-animated-button": t.animate ? "true" : void 0 },
2735
+ h.createElement(n.Chevron, { disabled: z ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
2621
2736
  ),
2622
- l.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[y.MonthCaption], style: m?.[y.MonthCaption], calendarMonth: k, displayIndex: Y }, f?.startsWith("dropdown") ? l.createElement(
2737
+ h.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[y.MonthCaption], style: m?.[y.MonthCaption], calendarMonth: M, displayIndex: x }, u?.startsWith("dropdown") ? h.createElement(
2623
2738
  n.DropdownNav,
2624
2739
  { className: c[y.Dropdowns], style: m?.[y.Dropdowns] },
2625
2740
  (() => {
2626
- const w = f === "dropdown" || f === "dropdown-months" ? l.createElement(n.MonthsDropdown, { key: "month", className: c[y.MonthsDropdown], "aria-label": qt(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: en(k.date), options: Fo(k.date, Ce, Ne, o, s), style: m?.[y.Dropdown], value: s.getMonth(k.date) }) : l.createElement("span", { key: "month" }, I(k.date, s)), x = f === "dropdown" || f === "dropdown-years" ? l.createElement(n.YearsDropdown, { key: "year", className: c[y.YearsDropdown], "aria-label": Qt(s.options), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: tn(k.date), options: Ao(Ce, Ne, o, s, !!t.reverseYears), style: m?.[y.Dropdown], value: s.getYear(k.date) }) : l.createElement("span", { key: "year" }, L(k.date, s));
2627
- return s.getMonthYearOrder() === "year-first" ? [x, w] : [w, x];
2741
+ const g = u === "dropdown" || u === "dropdown-months" ? h.createElement(n.MonthsDropdown, { key: "month", className: c[y.MonthsDropdown], "aria-label": en(), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: yn(M.date), options: Jo(M.date, Te, Pe, o, a), style: m?.[y.Dropdown], value: a.getMonth(M.date) }) : h.createElement("span", { key: "month" }, I(M.date, a)), C = u === "dropdown" || u === "dropdown-years" ? h.createElement(n.YearsDropdown, { key: "year", className: c[y.YearsDropdown], "aria-label": an(a.options), classNames: c, components: n, disabled: !!t.disableNavigation, onChange: gn(M.date), options: ts(Te, Pe, o, a, !!t.reverseYears), style: m?.[y.Dropdown], value: a.getYear(M.date) }) : h.createElement("span", { key: "year" }, ee(M.date, a));
2742
+ return a.getMonthYearOrder() === "year-first" ? [C, g] : [g, C];
2628
2743
  })(),
2629
- l.createElement("span", { role: "status", "aria-live": "polite", style: {
2744
+ h.createElement("span", { role: "status", "aria-live": "polite", style: {
2630
2745
  border: 0,
2631
2746
  clip: "rect(0 0 0 0)",
2632
2747
  height: "1px",
@@ -2637,106 +2752,175 @@ function Ms(e) {
2637
2752
  width: "1px",
2638
2753
  whiteSpace: "nowrap",
2639
2754
  wordWrap: "normal"
2640
- } }, W(k.date, s.options, s))
2641
- ) : l.createElement(n.CaptionLabel, { className: c[y.CaptionLabel], role: "status", "aria-live": "polite" }, W(k.date, s.options, s))),
2642
- u === "around" && !t.hideNavigation && Y === h - 1 && l.createElement(
2755
+ } }, W(M.date, a.options, a))
2756
+ ) : h.createElement(n.CaptionLabel, { className: c[y.CaptionLabel], role: "status", "aria-live": "polite" }, W(M.date, a.options, a))),
2757
+ l === "around" && !t.hideNavigation && x === d - 1 && h.createElement(
2643
2758
  n.NextMonthButton,
2644
- { type: "button", className: c[y.NextMonthButton], tabIndex: G ? void 0 : -1, "aria-disabled": G ? void 0 : !0, "aria-label": Rt(G), onClick: Pe, "data-animated-button": t.animate ? "true" : void 0 },
2645
- l.createElement(n.Chevron, { disabled: G ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
2759
+ { type: "button", className: c[y.NextMonthButton], tabIndex: Q ? void 0 : -1, "aria-disabled": Q ? void 0 : !0, "aria-label": nn(Q), onClick: Ie, "data-animated-button": t.animate ? "true" : void 0 },
2760
+ h.createElement(n.Chevron, { disabled: Q ? void 0 : !0, className: c[y.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
2646
2761
  ),
2647
- Y === h - 1 && u === "after" && !t.hideNavigation && l.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": Ve(), onPreviousClick: Ee, onNextClick: Pe, previousMonth: $, nextMonth: G }),
2648
- l.createElement(
2762
+ x === d - 1 && l === "after" && !t.hideNavigation && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[y.Nav], style: m?.[y.Nav], "aria-label": ot(), onPreviousClick: Be, onNextClick: Ie, previousMonth: z, nextMonth: Q }),
2763
+ h.createElement(
2649
2764
  n.MonthGrid,
2650
- { role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": Ht(k.date, s.options, s) || void 0, className: c[y.MonthGrid], style: m?.[y.MonthGrid] },
2651
- !t.hideWeekdays && l.createElement(
2765
+ { role: "grid", "aria-multiselectable": f === "multiple" || f === "range", "aria-label": Lt(M.date, a.options, a) || void 0, className: c[y.MonthGrid], style: m?.[y.MonthGrid] },
2766
+ !t.hideWeekdays && h.createElement(
2652
2767
  n.Weekdays,
2653
2768
  { "data-animated-weekdays": t.animate ? "true" : void 0, className: c[y.Weekdays], style: m?.[y.Weekdays] },
2654
- g && l.createElement(n.WeekNumberHeader, { "aria-label": zt(s.options), className: c[y.WeekNumberHeader], style: m?.[y.WeekNumberHeader], scope: "col" }, Q()),
2655
- Xt.map((w) => l.createElement(n.Weekday, { "aria-label": $t(w, s.options, s), className: c[y.Weekday], key: String(w), style: m?.[y.Weekday], scope: "col" }, ne(w, s.options, s)))
2769
+ b && h.createElement(n.WeekNumberHeader, { "aria-label": sn(a.options), className: c[y.WeekNumberHeader], style: m?.[y.WeekNumberHeader], scope: "col" }, Z()),
2770
+ cn.map((g) => h.createElement(n.Weekday, { "aria-label": rn(g, a.options, a), className: c[y.Weekday], key: String(g), style: m?.[y.Weekday], scope: "col" }, oe(g, a.options, a)))
2656
2771
  ),
2657
- l.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[y.Weeks], style: m?.[y.Weeks] }, k.weeks.map((w) => l.createElement(
2772
+ h.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[y.Weeks], style: m?.[y.Weeks] }, M.weeks.map((g) => h.createElement(
2658
2773
  n.Week,
2659
- { className: c[y.Week], key: w.weekNumber, style: m?.[y.Week], week: w },
2660
- g && l.createElement(n.WeekNumber, { week: w, style: m?.[y.WeekNumber], "aria-label": Gt(w.weekNumber, {
2661
- locale: i
2662
- }), className: c[y.WeekNumber], scope: "row", role: "rowheader" }, F(w.weekNumber, s)),
2663
- w.days.map((x) => {
2664
- const { date: X } = x, S = xe(x);
2665
- if (S[_.focused] = !S.hidden && !!Ze?.isEqualTo(x), S[z.selected] = Te?.(X) || S.selected, We(Me)) {
2666
- const { from: _e, to: Fe } = Me;
2667
- S[z.range_start] = !!(_e && Fe && s.isSameDay(X, _e)), S[z.range_end] = !!(_e && Fe && s.isSameDay(X, Fe)), S[z.range_middle] = ee(Me, X, !0, s);
2774
+ { className: c[y.Week], key: g.weekNumber, style: m?.[y.Week], week: g },
2775
+ b && h.createElement(n.WeekNumber, { week: g, style: m?.[y.WeekNumber], "aria-label": on(g.weekNumber, {
2776
+ locale: s
2777
+ }), className: c[y.WeekNumber], scope: "row", role: "rowheader" }, F(g.weekNumber, a)),
2778
+ g.days.map((C) => {
2779
+ const { date: A } = C, S = Ee(C);
2780
+ if (S[_.focused] = !S.hidden && !!nt?.isEqualTo(C), S[U.selected] = _e?.(A) || S.selected, xe(ve)) {
2781
+ const { from: He, to: Ae } = ve;
2782
+ S[U.range_start] = !!(He && Ae && a.isSameDay(A, He)), S[U.range_end] = !!(He && Ae && a.isSameDay(A, Ae)), S[U.range_middle] = ne(ve, A, !0, a);
2668
2783
  }
2669
- const an = Bo(S, m, t.modifiersStyles), cn = Do(S, c, t.modifiersClassNames), un = !Le && !S.hidden ? At(X, S, s.options, s) : void 0;
2670
- return l.createElement(n.Day, { key: `${x.isoDate}_${x.displayMonthId}`, day: x, modifiers: S, className: cn.join(" "), style: an, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": un, "data-day": x.isoDate, "data-month": x.outside ? x.dateMonthId : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": x.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && Le ? l.createElement(n.DayButton, { className: c[y.DayButton], style: m?.[y.DayButton], type: "button", day: x, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: Bt(x) ? 0 : -1, "aria-label": It(X, S, s.options, s), onClick: Zt(x, S), onBlur: Vt(x, S), onFocus: Ut(x, S), onKeyDown: Lt(x, S), onMouseEnter: Kt(x, S), onMouseLeave: Jt(x, S) }, P(X, s.options, s)) : !S.hidden && P(x.date, s.options, s));
2784
+ const kn = Lo(S, m, t.modifiersStyles), Dn = _o(S, c, t.modifiersClassNames), On = !st && !S.hidden ? Jt(A, S, a.options, a) : void 0;
2785
+ return h.createElement(n.Day, { key: `${C.isoDate}_${C.displayMonthId}`, day: C, modifiers: S, className: Dn.join(" "), style: kn, role: "gridcell", "aria-selected": S.selected || void 0, "aria-label": On, "data-day": C.isoDate, "data-month": C.outside ? C.dateMonthId : void 0, "data-selected": S.selected || void 0, "data-disabled": S.disabled || void 0, "data-hidden": S.hidden || void 0, "data-outside": C.outside || void 0, "data-focused": S.focused || void 0, "data-today": S.today || void 0 }, !S.hidden && st ? h.createElement(n.DayButton, { className: c[y.DayButton], style: m?.[y.DayButton], type: "button", day: C, modifiers: S, disabled: !S.focused && S.disabled || void 0, "aria-disabled": S.focused && S.disabled || void 0, tabIndex: Zt(C) ? 0 : -1, "aria-label": Kt(A, S, a.options, a), onClick: un(C, S), onBlur: fn(C, S), onFocus: ln(C, S), onKeyDown: dn(C, S), onMouseEnter: hn(C, S), onMouseLeave: mn(C, S) }, E(A, a.options, a)) : !S.hidden && E(C.date, a.options, a));
2671
2786
  })
2672
2787
  )))
2673
2788
  )
2674
2789
  ))
2675
2790
  ),
2676
- t.footer && l.createElement(n.Footer, { className: c[y.Footer], style: m?.[y.Footer], role: "status", "aria-live": "polite" }, t.footer)
2791
+ t.footer && h.createElement(n.Footer, { className: c[y.Footer], style: m?.[y.Footer], role: "status", "aria-live": "polite" }, t.footer)
2677
2792
  )
2678
2793
  );
2679
2794
  }
2680
- const ks = ({
2795
+ const Ns = ({
2681
2796
  className: e,
2682
2797
  showOutsideDays: t = !0,
2683
2798
  animate: r = !0,
2684
2799
  arrowClassName: n,
2685
2800
  monthsClassName: o,
2686
- defaultSelected: a,
2687
- onSelect: s,
2688
- ...i
2801
+ defaultSelected: i,
2802
+ onSelect: a,
2803
+ ...s
2689
2804
  }) => {
2690
- const [c, f] = Oe(
2691
- () => a
2692
- ), d = H(
2693
- (u) => {
2694
- u && (f(u), s?.(u));
2805
+ const [c, u] = Ce(
2806
+ () => i
2807
+ ), f = q(
2808
+ (l) => {
2809
+ l && (u(l), a?.(l));
2695
2810
  },
2696
- [s]
2811
+ [a]
2697
2812
  );
2698
- return /* @__PURE__ */ Be(
2699
- Ms,
2813
+ return /* @__PURE__ */ qe(
2814
+ Ss,
2700
2815
  {
2701
- className: fe(mn({ className: e })),
2816
+ className: V(Cn({ className: e })),
2702
2817
  animate: r,
2703
2818
  mode: "single",
2704
2819
  selected: c,
2705
- onSelect: d,
2820
+ onSelect: f,
2706
2821
  showOutsideDays: t,
2707
2822
  role: "dialog",
2708
2823
  "aria-label": "Datepicker",
2709
2824
  classNames: {
2710
- chevron: "cursor-pointer text-slate-500 w-5 h-5 text-slate-500 w-4 h-4",
2711
- day_button: "h-[30px] aria-selected:opacity-100 font-semibold hover:rounded-full cursor-pointer rounded-full w-[30px]",
2825
+ chevron: V(
2826
+ "cursor-pointer",
2827
+ "text-slate-500",
2828
+ "w-5",
2829
+ "h-5",
2830
+ "text-slate-500",
2831
+ "w-4",
2832
+ "h-4",
2833
+ "dark:text-metal-200"
2834
+ ),
2835
+ day_button: V(
2836
+ "h-[30px]",
2837
+ "aria-selected:opacity-100",
2838
+ "font-semibold",
2839
+ "hover:rounded-full",
2840
+ "cursor-pointer",
2841
+ "rounded-full",
2842
+ "w-[30px]"
2843
+ ),
2712
2844
  day: "text-center text-sm leading-5",
2713
- month_caption: "text-slate-700 font-semibold text-sm pl-1 h-8 flex items-center",
2714
- months: fe(
2715
- "flex flex-col relative px-5 py-4 rounded-lg shadow-md px-6 py-4 w-[307px] justify-center items-center",
2845
+ month_caption: V(
2846
+ "text-slate-700",
2847
+ "font-semibold",
2848
+ "text-sm",
2849
+ "pl-1",
2850
+ "h-8",
2851
+ "flex",
2852
+ "items-center",
2853
+ "dark:text-white"
2854
+ ),
2855
+ months: V(
2856
+ "flex",
2857
+ "flex-col",
2858
+ "relative",
2859
+ "px-5",
2860
+ "py-4",
2861
+ "rounded-lg",
2862
+ "shadow-md",
2863
+ "px-6",
2864
+ "py-4",
2865
+ "w-[307px]",
2866
+ "justify-center",
2867
+ "items-center",
2868
+ "border",
2869
+ "border-transparent",
2870
+ "dark:bg-metal-800",
2871
+ "dark:border-metal-700",
2716
2872
  o
2717
2873
  ),
2718
2874
  month: "flex flex-col gap-4",
2719
- nav: fe(
2720
- "absolute right-4 top-3.5 flex justify-center items-center gap-1",
2875
+ nav: V(
2876
+ "absolute",
2877
+ "right-4",
2878
+ "top-3.5",
2879
+ "flex",
2880
+ "justify-center",
2881
+ "items-center",
2882
+ "gap-1",
2721
2883
  n
2722
2884
  ),
2723
- outside: "text-slate-400",
2724
- selected: "[&>button]:bg-blue-600 [&>button]:text-white [&>button]:hover:bg-blue-700 [&>button]:transition-all [&>button]:duration-300 [&>button]:rounded-full",
2885
+ outside: "text-slate-400 dark:text-metal-500",
2886
+ selected: V(
2887
+ "[&>button]:bg-blue-600",
2888
+ "[&>button]:text-white",
2889
+ "[&>button]:hover:bg-blue-700",
2890
+ "[&>button]:transition-all",
2891
+ "[&>button]:duration-300",
2892
+ "[&>button]:rounded-full",
2893
+ "dark:[&>button]:bg-aurora-500",
2894
+ "dark:[&>button]:hover:bg-aurora-500",
2895
+ "dark:[&>button]:text-metal-900"
2896
+ ),
2725
2897
  table: "w-full",
2726
- weekdays: "text-slate-500",
2727
- weeks: "text-slate-700 [&>tr>td]:border-transparent [&>tr>td]:border-r-[8px] [&>tr>td]:last:border-r-0",
2898
+ weekdays: "text-slate-500 dark:text-metal-300",
2899
+ weeks: V(
2900
+ "text-slate-700",
2901
+ "[&>tr>td]:border-transparent",
2902
+ "[&>tr>td]:border-r-[8px]",
2903
+ "[&>tr>td]:last:border-r-0",
2904
+ "dark:text-white"
2905
+ ),
2728
2906
  weekday: "font-semibold text-sm uppercase text-sm",
2729
- today: "text-blue-600 data-[selected=true]:text-white",
2730
- month_grid: '[&>thead]:table-header-group [&>thead]:relative [&>thead]:after:block [&>thead]:after:content-[" "] [&>thead]:after:h-4'
2907
+ today: "text-blue-600 dark:text-aurora-500 data-[selected=true]:text-white",
2908
+ month_grid: V(
2909
+ "[&>thead]:table-header-group",
2910
+ "[&>thead]:relative",
2911
+ "[&>thead]:after:block",
2912
+ '[&>thead]:after:content-[" "]',
2913
+ "[&>thead]:after:h-4"
2914
+ )
2731
2915
  },
2732
2916
  components: {
2733
- Chevron: ({ className: u, ...h }) => h.orientation === "left" ? /* @__PURE__ */ Be(yn, { className: fe(u), ...h }) : /* @__PURE__ */ Be(gn, { className: fe(u), ...h })
2917
+ Chevron: ({ className: l, ...d }) => d.orientation === "left" ? /* @__PURE__ */ qe(xn, { className: V(l), ...d }) : /* @__PURE__ */ qe(Yn, { className: V(l), ...d })
2734
2918
  },
2735
- ...i
2919
+ ...s
2736
2920
  }
2737
2921
  );
2738
2922
  };
2739
- ks.displayName = "DatePicker";
2923
+ Ns.displayName = "KonstructDatePicker";
2740
2924
  export {
2741
- ks as DatePicker
2925
+ Ns as DatePicker
2742
2926
  };