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

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