@alfadocs/ui-kit 0.42.0 → 0.44.0

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 (94) hide show
  1. package/dist/_chunks/{ar-Cn_NxqkN.js → ar-DEz65ZJW.js} +2 -2
  2. package/dist/_chunks/bmi-calculator-DFPWL2OJ.js +273 -0
  3. package/dist/_chunks/{booking-4mCw3Mpl.js → booking-CtLwaxkK.js} +4 -4
  4. package/dist/_chunks/{calculator-dialog-B74fqpFZ.js → calculator-dialog-D-nfvteH.js} +2 -2
  5. package/dist/_chunks/{chart-Cbt0_sKv.js → chart-Cg3e9EH9.js} +101 -99
  6. package/dist/_chunks/{cycle-calculator-DsZbyzX6.js → cycle-calculator-ChHBcjet.js} +65 -56
  7. package/dist/_chunks/{date-picker-CvQfs6Xh.js → date-picker-Bq7xhMA-.js} +109 -108
  8. package/dist/_chunks/date-picker-variants-DLi1Va_e.js +3238 -0
  9. package/dist/_chunks/{date-range-picker-U9fn1g9d.js → date-range-picker-DcXuI9y7.js} +20 -19
  10. package/dist/_chunks/{date-time-picker-Cva0ZCWw.js → date-time-picker-RimumeLR.js} +18 -17
  11. package/dist/_chunks/{de-BMM2H7Bs.js → de-bTBGdjPS.js} +2 -2
  12. package/dist/_chunks/dialog-BTpZV6It.js +223 -0
  13. package/dist/_chunks/{due-date-calculator-s_CBgaFs.js → due-date-calculator-CYXKLoof.js} +65 -45
  14. package/dist/_chunks/{editable-currency-cell-renderer-BhUkRiPZ.js → editable-currency-cell-renderer-9jqwDv5x.js} +2 -2
  15. package/dist/_chunks/{el-BYPonAaK.js → el-BWG5RXxa.js} +6 -6
  16. package/dist/_chunks/{es-CMkVCQ4F.js → es-DfO_G435.js} +2 -2
  17. package/dist/_chunks/{fr-BcuWxqft.js → fr-BTn24bs8.js} +2 -2
  18. package/dist/_chunks/{gestation-BXEgDGmP.js → gestation-mWF4AXea.js} +3 -3
  19. package/dist/_chunks/gestational-age-calculator-sRmoqgVr.js +190 -0
  20. package/dist/_chunks/{header-CTZWX-tm.js → header-Ce1Br27u.js} +70 -75
  21. package/dist/_chunks/{hi-wkq_rQAh.js → hi-Dj3oYd84.js} +2 -2
  22. package/dist/_chunks/insert-result-CoC1oo6R.js +334 -0
  23. package/dist/_chunks/{isSameWeek-Bim5ftRd.js → isSameWeek-HfxKk6Lz.js} +2 -2
  24. package/dist/_chunks/{it-GiQrQ9p4.js → it-Y85ofIQQ.js} +7 -7
  25. package/dist/_chunks/{ja-qfYg3Rua.js → ja-CQ7J6YoA.js} +2 -2
  26. package/dist/_chunks/{marketplace-app-shell-kVAVycz_.js → marketplace-app-shell-Dc5cTIt8.js} +186 -149
  27. package/dist/_chunks/{nl-xOogO4sZ.js → nl-D9kHCmp3.js} +2 -2
  28. package/dist/_chunks/{patient-shell-lDX3wwu6.js → patient-shell-CnT4L8gn.js} +2 -2
  29. package/dist/_chunks/{pl-GnOW6eGK.js → pl-B3Smqpkr.js} +3 -3
  30. package/dist/_chunks/{pregnancy-weight-gain-B7kBK-ZR.js → pregnancy-weight-gain-C5YhfYnL.js} +60 -50
  31. package/dist/_chunks/{pt-_bV5b5RW.js → pt-D3J-1c_7.js} +6 -6
  32. package/dist/_chunks/{ro-BEcyh5Nj.js → ro-BKAbbEA3.js} +2 -2
  33. package/dist/_chunks/{ru-Bi86hqMf.js → ru-BeG8f0Ep.js} +3 -3
  34. package/dist/_chunks/{sign-document-QHfcNKFj.js → sign-document-B-3k_0LO.js} +165 -137
  35. package/dist/_chunks/{sq-BujHSAWu.js → sq-_hRPaeUy.js} +6 -6
  36. package/dist/_chunks/subDays-Dv7q9S7u.js +8 -0
  37. package/dist/_chunks/{sv-C8AeDrTA.js → sv-g009fSpe.js} +2 -2
  38. package/dist/_chunks/{tab-bar-C4II-7ej.js → tab-bar-Xetknddo.js} +53 -34
  39. package/dist/_chunks/{tr-CMSs_Vgf.js → tr-OKUOuhMW.js} +2 -2
  40. package/dist/_chunks/{unit-converter-D1UrEUxa.js → unit-converter-Ds9jalbN.js} +78 -67
  41. package/dist/_chunks/{zh-CN-eXB-PFu4.js → zh-CN-De4zwEhx.js} +3 -3
  42. package/dist/agent-catalog.json +1 -1
  43. package/dist/components/_shared/calendar-class-names.d.ts +8 -0
  44. package/dist/components/_shared/index.d.ts +2 -0
  45. package/dist/components/_shared/insert-result.d.ts +149 -4
  46. package/dist/components/badge/badge.d.ts +1 -1
  47. package/dist/components/bmi-calculator/bmi-calculator.d.ts +6 -0
  48. package/dist/components/bmi-calculator/index.js +1 -1
  49. package/dist/components/booking/index.js +1 -1
  50. package/dist/components/calculator-dialog/index.js +1 -1
  51. package/dist/components/card/card.d.ts +1 -1
  52. package/dist/components/chart/chart.d.ts +10 -0
  53. package/dist/components/chart/index.js +1 -1
  54. package/dist/components/cycle-calculator/cycle-calculator.d.ts +6 -0
  55. package/dist/components/cycle-calculator/index.js +1 -1
  56. package/dist/components/data-table/index.js +1 -1
  57. package/dist/components/date-picker/date-picker.d.ts +0 -1
  58. package/dist/components/date-picker/index.js +1 -1
  59. package/dist/components/date-range-picker/date-range-picker.d.ts +0 -1
  60. package/dist/components/date-range-picker/index.js +1 -1
  61. package/dist/components/date-time-picker/date-time-picker.d.ts +0 -1
  62. package/dist/components/date-time-picker/index.js +1 -1
  63. package/dist/components/dialog/dialog.d.ts +1 -0
  64. package/dist/components/dialog/index.js +1 -1
  65. package/dist/components/due-date-calculator/due-date-calculator.d.ts +6 -0
  66. package/dist/components/due-date-calculator/index.js +2 -2
  67. package/dist/components/gestational-age-calculator/gestational-age-calculator.d.ts +6 -0
  68. package/dist/components/gestational-age-calculator/index.js +1 -1
  69. package/dist/components/header/header.d.ts +8 -0
  70. package/dist/components/header/index.js +1 -1
  71. package/dist/components/index.d.ts +1 -1
  72. package/dist/components/pregnancy-weight-gain/index.js +1 -1
  73. package/dist/components/pregnancy-weight-gain/pregnancy-weight-gain.d.ts +6 -0
  74. package/dist/components/public-header/public-header.d.ts +1 -1
  75. package/dist/components/sign-document/index.js +1 -1
  76. package/dist/components/sign-document/sign-document.d.ts +12 -0
  77. package/dist/components/stat/stat.d.ts +1 -1
  78. package/dist/components/tab-bar/index.d.ts +1 -1
  79. package/dist/components/tab-bar/index.js +1 -1
  80. package/dist/components/tab-bar/tab-bar.d.ts +44 -1
  81. package/dist/components/unit-converter/index.js +1 -1
  82. package/dist/components/unit-converter/unit-converter.d.ts +6 -0
  83. package/dist/index.js +504 -502
  84. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  85. package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +57 -1
  86. package/dist/patterns/patient-shell/index.js +1 -1
  87. package/dist/tokens.css +1411 -2
  88. package/package.json +1 -1
  89. package/dist/_chunks/bmi-calculator-D4juUcyF.js +0 -219
  90. package/dist/_chunks/dialog-Cee13rHU.js +0 -215
  91. package/dist/_chunks/gestational-age-calculator-CWOG3bkI.js +0 -178
  92. package/dist/_chunks/insert-result-DtQQeSSf.js +0 -227
  93. package/dist/_chunks/react-day-picker-CdtIiKjx.js +0 -3174
  94. package/dist/_chunks/subDays-_T9YeKPX.js +0 -8
@@ -1,3174 +0,0 @@
1
- import { c as Yn } from "./createLucideIcon-CrFbzy84.js";
2
- import m, { createContext as xn, useContext as Tn, useCallback as $, useRef as Ce, useLayoutEffect as Pn, useState as Ye, useEffect as Wt, useMemo as Ne } from "react";
3
- import { t as P, c as I, n as be, s as Qe, d as En, e as St, i as _n } from "./isSameDay-DUEiAT0G.js";
4
- import { jsx as dt } from "react/jsx-runtime";
5
- import { C as Fn } from "./chevron-left-CX1jqD2M.js";
6
- import { C as Bn } from "./chevron-right-BrpYejk0.js";
7
- import { c as xe } from "./index-D2ZczOXr.js";
8
- /**
9
- * @license lucide-react v1.8.0 - ISC
10
- *
11
- * This source code is licensed under the ISC license.
12
- * See the LICENSE file in the root directory of this source tree.
13
- */
14
- const In = [
15
- ["path", { d: "M8 2v4", key: "1cmpym" }],
16
- ["path", { d: "M16 2v4", key: "4m81vk" }],
17
- ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
18
- ["path", { d: "M3 10h18", key: "8toen8" }]
19
- ], Ho = Yn("calendar", In);
20
- function An(e, t, n = "long") {
21
- return new Intl.DateTimeFormat("en-US", {
22
- // Enforces engine to render the time. Without the option JavaScriptCore omits it.
23
- hour: "numeric",
24
- timeZone: e,
25
- timeZoneName: n
26
- }).format(t).split(/\s/g).slice(2).join(" ");
27
- }
28
- const qe = {}, ge = {};
29
- function ie(e, t) {
30
- try {
31
- const r = (qe[e] || (qe[e] = new Intl.DateTimeFormat("en-US", {
32
- timeZone: e,
33
- timeZoneName: "longOffset"
34
- }).format))(t).split("GMT")[1];
35
- return r in ge ? ge[r] : ft(r, r.split(":"));
36
- } catch {
37
- if (e in ge) return ge[e];
38
- const n = e == null ? void 0 : e.match(Hn);
39
- return n ? ft(e, n.slice(1)) : NaN;
40
- }
41
- }
42
- const Hn = /([+-]\d\d):?(\d\d)?/;
43
- function ft(e, t) {
44
- const n = +(t[0] || 0), r = +(t[1] || 0), a = +(t[2] || 0) / 60;
45
- return ge[e] = n * 60 + r > 0 ? n * 60 + r + a : n * 60 - r - a;
46
- }
47
- class J extends Date {
48
- //#region static
49
- constructor(...t) {
50
- super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(ie(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), pt(this), Xe(this)) : this.setTime(Date.now());
51
- }
52
- static tz(t, ...n) {
53
- return n.length ? new J(...n, t) : new J(Date.now(), t);
54
- }
55
- //#endregion
56
- //#region time zone
57
- withTimeZone(t) {
58
- return new J(+this, t);
59
- }
60
- getTimezoneOffset() {
61
- const t = -ie(this.timeZone, this);
62
- return t > 0 ? Math.floor(t) : Math.ceil(t);
63
- }
64
- //#endregion
65
- //#region time
66
- setTime(t) {
67
- return Date.prototype.setTime.apply(this, arguments), Xe(this), +this;
68
- }
69
- //#endregion
70
- //#region date-fns integration
71
- [Symbol.for("constructDateFrom")](t) {
72
- return new J(+new Date(t), this.timeZone);
73
- }
74
- //#endregion
75
- }
76
- const lt = /^(get|set)(?!UTC)/;
77
- Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
78
- if (!lt.test(e)) return;
79
- const t = e.replace(lt, "$1UTC");
80
- J.prototype[t] && (e.startsWith("get") ? J.prototype[e] = function() {
81
- return this.internal[t]();
82
- } : (J.prototype[e] = function() {
83
- return Date.prototype[t].apply(this.internal, arguments), qn(this), +this;
84
- }, J.prototype[t] = function() {
85
- return Date.prototype[t].apply(this, arguments), Xe(this), +this;
86
- }));
87
- });
88
- function Xe(e) {
89
- e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-ie(e.timeZone, e) * 60));
90
- }
91
- function qn(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()), pt(e);
93
- }
94
- function pt(e) {
95
- const t = ie(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 a = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), o = -(/* @__PURE__ */ new Date(+r)).getTimezoneOffset(), s = a - o, i = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
98
- s && i && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + s);
99
- const c = a - n;
100
- c && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + c);
101
- const u = /* @__PURE__ */ new Date(+e);
102
- u.setUTCSeconds(0);
103
- const d = a > 0 ? u.getSeconds() : (u.getSeconds() - 60) % 60, f = Math.round(-(ie(e.timeZone, e) * 60)) % 60;
104
- (f || d) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + f), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + f + d));
105
- const h = ie(e.timeZone, e), y = h > 0 ? Math.floor(h) : Math.ceil(h), W = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - y, v = y !== n, C = W - c;
106
- if (v && C) {
107
- Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + C);
108
- const M = ie(e.timeZone, e), g = M > 0 ? Math.floor(M) : Math.ceil(M), S = y - g;
109
- S && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + S), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + S));
110
- }
111
- }
112
- class A extends J {
113
- //#region static
114
- static tz(t, ...n) {
115
- return n.length ? new A(...n, t) : new A(Date.now(), t);
116
- }
117
- //#endregion
118
- //#region representation
119
- toISOString() {
120
- const [t, n, r] = this.tzComponents(), a = `${t}${n}:${r}`;
121
- return this.internal.toISOString().slice(0, -1) + a;
122
- }
123
- toString() {
124
- return `${this.toDateString()} ${this.toTimeString()}`;
125
- }
126
- toDateString() {
127
- const [t, n, r, a] = this.internal.toUTCString().split(" ");
128
- return `${t == null ? void 0 : t.slice(0, -1)} ${r} ${n} ${a}`;
129
- }
130
- toTimeString() {
131
- const t = this.internal.toUTCString().split(" ")[4], [n, r, a] = this.tzComponents();
132
- return `${t} GMT${n}${r}${a} (${An(this.timeZone, this)})`;
133
- }
134
- toLocaleString(t, n) {
135
- return Date.prototype.toLocaleString.call(this, t, {
136
- ...n,
137
- timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
138
- });
139
- }
140
- toLocaleDateString(t, n) {
141
- return Date.prototype.toLocaleDateString.call(this, t, {
142
- ...n,
143
- timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
144
- });
145
- }
146
- toLocaleTimeString(t, n) {
147
- return Date.prototype.toLocaleTimeString.call(this, t, {
148
- ...n,
149
- timeZone: (n == null ? void 0 : n.timeZone) || this.timeZone
150
- });
151
- }
152
- //#endregion
153
- //#region private
154
- tzComponents() {
155
- const t = this.getTimezoneOffset(), n = t > 0 ? "-" : "+", r = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), a = String(Math.abs(t) % 60).padStart(2, "0");
156
- return [n, r, a];
157
- }
158
- //#endregion
159
- withTimeZone(t) {
160
- return new A(+this, t);
161
- }
162
- //#region date-fns integration
163
- [Symbol.for("constructDateFrom")](t) {
164
- return new A(+new Date(t), this.timeZone);
165
- }
166
- //#endregion
167
- }
168
- function Ct(e, t, n) {
169
- const r = P(e, n == null ? void 0 : n.in);
170
- return isNaN(t) ? I((n == null ? void 0 : n.in) || e, NaN) : (t && r.setDate(r.getDate() + t), r);
171
- }
172
- function Nt(e, t, n) {
173
- const r = P(e, n == null ? void 0 : n.in);
174
- if (isNaN(t)) return I(e, NaN);
175
- if (!t)
176
- return r;
177
- const a = r.getDate(), o = I(e, r.getTime());
178
- o.setMonth(r.getMonth() + t + 1, 0);
179
- const s = o.getDate();
180
- return a >= s ? o : (r.setFullYear(
181
- o.getFullYear(),
182
- o.getMonth(),
183
- a
184
- ), r);
185
- }
186
- let jn = {};
187
- function ke() {
188
- return jn;
189
- }
190
- function fe(e, t) {
191
- var i, c, u, d;
192
- const n = ke(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((d = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : d.weekStartsOn) ?? 0, a = P(e, t == null ? void 0 : t.in), o = a.getDay(), s = (o < r ? 7 : 0) + o - r;
193
- return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
194
- }
195
- function we(e, t) {
196
- return fe(e, { ...t, weekStartsOn: 1 });
197
- }
198
- function Yt(e, t) {
199
- const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = I(n, 0);
200
- a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
201
- const o = we(a), s = I(n, 0);
202
- s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0);
203
- const i = we(s);
204
- return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= i.getTime() ? r : r - 1;
205
- }
206
- function ht(e) {
207
- const t = P(e), n = new Date(
208
- Date.UTC(
209
- t.getFullYear(),
210
- t.getMonth(),
211
- t.getDate(),
212
- t.getHours(),
213
- t.getMinutes(),
214
- t.getSeconds(),
215
- t.getMilliseconds()
216
- )
217
- );
218
- return n.setUTCFullYear(t.getFullYear()), +e - +n;
219
- }
220
- function Ke(e, t, n) {
221
- const [r, a] = be(
222
- n == null ? void 0 : n.in,
223
- e,
224
- t
225
- ), o = Qe(r), s = Qe(a), i = +o - ht(o), c = +s - ht(s);
226
- return Math.round((i - c) / En);
227
- }
228
- function zn(e, t) {
229
- const n = Yt(e, t), r = I(e, 0);
230
- return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), we(r);
231
- }
232
- function Gn(e, t, n) {
233
- return Ct(e, t * 7, n);
234
- }
235
- function $n(e, t, n) {
236
- return Nt(e, t * 12, n);
237
- }
238
- function Rn(e, t) {
239
- let n, r = t == null ? void 0 : t.in;
240
- return e.forEach((a) => {
241
- !r && typeof a == "object" && (r = I.bind(null, a));
242
- const o = P(a, r);
243
- (!n || n < o || isNaN(+o)) && (n = o);
244
- }), I(r, n || NaN);
245
- }
246
- function Vn(e, t) {
247
- let n, r = t == null ? void 0 : t.in;
248
- return e.forEach((a) => {
249
- !r && typeof a == "object" && (r = I.bind(null, a));
250
- const o = P(a, r);
251
- (!n || n > o || isNaN(+o)) && (n = o);
252
- }), I(r, n || NaN);
253
- }
254
- function xt(e) {
255
- return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
256
- }
257
- function Un(e) {
258
- return !(!xt(e) && typeof e != "number" || isNaN(+P(e)));
259
- }
260
- function Tt(e, t, n) {
261
- const [r, a] = be(
262
- n == null ? void 0 : n.in,
263
- e,
264
- t
265
- ), o = r.getFullYear() - a.getFullYear(), s = r.getMonth() - a.getMonth();
266
- return o * 12 + s;
267
- }
268
- function Qn(e, t) {
269
- const n = P(e, t == null ? void 0 : t.in), r = n.getMonth();
270
- return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
271
- }
272
- function Pt(e, t) {
273
- const [n, r] = be(e, t.start, t.end);
274
- return { start: n, end: r };
275
- }
276
- function Xn(e, t) {
277
- const { start: n, end: r } = Pt(t == null ? void 0 : t.in, e);
278
- let a = +n > +r;
279
- const o = a ? +n : +r, s = a ? r : n;
280
- s.setHours(0, 0, 0, 0), s.setDate(1);
281
- let i = 1;
282
- const c = [];
283
- for (; +s <= o; )
284
- c.push(I(n, s)), s.setMonth(s.getMonth() + i);
285
- return a ? c.reverse() : c;
286
- }
287
- function Kn(e, t) {
288
- const n = P(e, t == null ? void 0 : t.in);
289
- return n.setDate(1), n.setHours(0, 0, 0, 0), n;
290
- }
291
- function Jn(e, t) {
292
- const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear();
293
- return n.setFullYear(r + 1, 0, 0), n.setHours(23, 59, 59, 999), n;
294
- }
295
- function Et(e, t) {
296
- const n = P(e, t == null ? void 0 : t.in);
297
- return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
298
- }
299
- function Zn(e, t) {
300
- const { start: n, end: r } = Pt(t == null ? void 0 : t.in, e);
301
- let a = +n > +r;
302
- const o = a ? +n : +r, s = a ? r : n;
303
- s.setHours(0, 0, 0, 0), s.setMonth(0, 1);
304
- let i = 1;
305
- const c = [];
306
- for (; +s <= o; )
307
- c.push(I(n, s)), s.setFullYear(s.getFullYear() + i);
308
- return a ? c.reverse() : c;
309
- }
310
- function _t(e, t) {
311
- var i, c, u, d;
312
- const n = ke(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((d = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : d.weekStartsOn) ?? 0, a = P(e, t == null ? void 0 : t.in), o = a.getDay(), s = (o < r ? -7 : 0) + 6 - (o - r);
313
- return a.setDate(a.getDate() + s), a.setHours(23, 59, 59, 999), a;
314
- }
315
- function Ln(e, t) {
316
- return _t(e, { ...t, weekStartsOn: 1 });
317
- }
318
- const er = {
319
- lessThanXSeconds: {
320
- one: "less than a second",
321
- other: "less than {{count}} seconds"
322
- },
323
- xSeconds: {
324
- one: "1 second",
325
- other: "{{count}} seconds"
326
- },
327
- halfAMinute: "half a minute",
328
- lessThanXMinutes: {
329
- one: "less than a minute",
330
- other: "less than {{count}} minutes"
331
- },
332
- xMinutes: {
333
- one: "1 minute",
334
- other: "{{count}} minutes"
335
- },
336
- aboutXHours: {
337
- one: "about 1 hour",
338
- other: "about {{count}} hours"
339
- },
340
- xHours: {
341
- one: "1 hour",
342
- other: "{{count}} hours"
343
- },
344
- xDays: {
345
- one: "1 day",
346
- other: "{{count}} days"
347
- },
348
- aboutXWeeks: {
349
- one: "about 1 week",
350
- other: "about {{count}} weeks"
351
- },
352
- xWeeks: {
353
- one: "1 week",
354
- other: "{{count}} weeks"
355
- },
356
- aboutXMonths: {
357
- one: "about 1 month",
358
- other: "about {{count}} months"
359
- },
360
- xMonths: {
361
- one: "1 month",
362
- other: "{{count}} months"
363
- },
364
- aboutXYears: {
365
- one: "about 1 year",
366
- other: "about {{count}} years"
367
- },
368
- xYears: {
369
- one: "1 year",
370
- other: "{{count}} years"
371
- },
372
- overXYears: {
373
- one: "over 1 year",
374
- other: "over {{count}} years"
375
- },
376
- almostXYears: {
377
- one: "almost 1 year",
378
- other: "almost {{count}} years"
379
- }
380
- }, tr = (e, t, n) => {
381
- let r;
382
- const a = er[e];
383
- return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
384
- };
385
- function je(e) {
386
- return (t = {}) => {
387
- const n = t.width ? String(t.width) : e.defaultWidth;
388
- return e.formats[n] || e.formats[e.defaultWidth];
389
- };
390
- }
391
- const nr = {
392
- full: "EEEE, MMMM do, y",
393
- long: "MMMM do, y",
394
- medium: "MMM d, y",
395
- short: "MM/dd/yyyy"
396
- }, rr = {
397
- full: "h:mm:ss a zzzz",
398
- long: "h:mm:ss a z",
399
- medium: "h:mm:ss a",
400
- short: "h:mm a"
401
- }, ar = {
402
- full: "{{date}} 'at' {{time}}",
403
- long: "{{date}} 'at' {{time}}",
404
- medium: "{{date}}, {{time}}",
405
- short: "{{date}}, {{time}}"
406
- }, or = {
407
- date: je({
408
- formats: nr,
409
- defaultWidth: "full"
410
- }),
411
- time: je({
412
- formats: rr,
413
- defaultWidth: "full"
414
- }),
415
- dateTime: je({
416
- formats: ar,
417
- defaultWidth: "full"
418
- })
419
- }, sr = {
420
- lastWeek: "'last' eeee 'at' p",
421
- yesterday: "'yesterday at' p",
422
- today: "'today at' p",
423
- tomorrow: "'tomorrow at' p",
424
- nextWeek: "eeee 'at' p",
425
- other: "P"
426
- }, ir = (e, t, n, r) => sr[e];
427
- function me(e) {
428
- return (t, n) => {
429
- const r = n != null && n.context ? String(n.context) : "standalone";
430
- let a;
431
- if (r === "formatting" && e.formattingValues) {
432
- const s = e.defaultFormattingWidth || e.defaultWidth, i = n != null && n.width ? String(n.width) : s;
433
- a = e.formattingValues[i] || e.formattingValues[s];
434
- } else {
435
- const s = e.defaultWidth, i = n != null && n.width ? String(n.width) : e.defaultWidth;
436
- a = e.values[i] || e.values[s];
437
- }
438
- const o = e.argumentCallback ? e.argumentCallback(t) : t;
439
- return a[o];
440
- };
441
- }
442
- const cr = {
443
- narrow: ["B", "A"],
444
- abbreviated: ["BC", "AD"],
445
- wide: ["Before Christ", "Anno Domini"]
446
- }, ur = {
447
- narrow: ["1", "2", "3", "4"],
448
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
449
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
450
- }, dr = {
451
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
452
- abbreviated: [
453
- "Jan",
454
- "Feb",
455
- "Mar",
456
- "Apr",
457
- "May",
458
- "Jun",
459
- "Jul",
460
- "Aug",
461
- "Sep",
462
- "Oct",
463
- "Nov",
464
- "Dec"
465
- ],
466
- wide: [
467
- "January",
468
- "February",
469
- "March",
470
- "April",
471
- "May",
472
- "June",
473
- "July",
474
- "August",
475
- "September",
476
- "October",
477
- "November",
478
- "December"
479
- ]
480
- }, fr = {
481
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
482
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
483
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
484
- wide: [
485
- "Sunday",
486
- "Monday",
487
- "Tuesday",
488
- "Wednesday",
489
- "Thursday",
490
- "Friday",
491
- "Saturday"
492
- ]
493
- }, lr = {
494
- narrow: {
495
- am: "a",
496
- pm: "p",
497
- midnight: "mi",
498
- noon: "n",
499
- morning: "morning",
500
- afternoon: "afternoon",
501
- evening: "evening",
502
- night: "night"
503
- },
504
- abbreviated: {
505
- am: "AM",
506
- pm: "PM",
507
- midnight: "midnight",
508
- noon: "noon",
509
- morning: "morning",
510
- afternoon: "afternoon",
511
- evening: "evening",
512
- night: "night"
513
- },
514
- wide: {
515
- am: "a.m.",
516
- pm: "p.m.",
517
- midnight: "midnight",
518
- noon: "noon",
519
- morning: "morning",
520
- afternoon: "afternoon",
521
- evening: "evening",
522
- night: "night"
523
- }
524
- }, hr = {
525
- narrow: {
526
- am: "a",
527
- pm: "p",
528
- midnight: "mi",
529
- noon: "n",
530
- morning: "in the morning",
531
- afternoon: "in the afternoon",
532
- evening: "in the evening",
533
- night: "at night"
534
- },
535
- abbreviated: {
536
- am: "AM",
537
- pm: "PM",
538
- midnight: "midnight",
539
- noon: "noon",
540
- morning: "in the morning",
541
- afternoon: "in the afternoon",
542
- evening: "in the evening",
543
- night: "at night"
544
- },
545
- wide: {
546
- am: "a.m.",
547
- pm: "p.m.",
548
- midnight: "midnight",
549
- noon: "noon",
550
- morning: "in the morning",
551
- afternoon: "in the afternoon",
552
- evening: "in the evening",
553
- night: "at night"
554
- }
555
- }, mr = (e, t) => {
556
- const n = Number(e), r = n % 100;
557
- if (r > 20 || r < 10)
558
- switch (r % 10) {
559
- case 1:
560
- return n + "st";
561
- case 2:
562
- return n + "nd";
563
- case 3:
564
- return n + "rd";
565
- }
566
- return n + "th";
567
- }, yr = {
568
- ordinalNumber: mr,
569
- era: me({
570
- values: cr,
571
- defaultWidth: "wide"
572
- }),
573
- quarter: me({
574
- values: ur,
575
- defaultWidth: "wide",
576
- argumentCallback: (e) => e - 1
577
- }),
578
- month: me({
579
- values: dr,
580
- defaultWidth: "wide"
581
- }),
582
- day: me({
583
- values: fr,
584
- defaultWidth: "wide"
585
- }),
586
- dayPeriod: me({
587
- values: lr,
588
- defaultWidth: "wide",
589
- formattingValues: hr,
590
- defaultFormattingWidth: "wide"
591
- })
592
- };
593
- function ye(e) {
594
- return (t, n = {}) => {
595
- const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], o = t.match(a);
596
- if (!o)
597
- return null;
598
- const s = o[0], i = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(i) ? Mr(i, (f) => f.test(s)) : (
599
- // [TODO] -- I challenge you to fix the type
600
- gr(i, (f) => f.test(s))
601
- );
602
- let u;
603
- u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? (
604
- // [TODO] -- I challenge you to fix the type
605
- n.valueCallback(u)
606
- ) : u;
607
- const d = t.slice(s.length);
608
- return { value: u, rest: d };
609
- };
610
- }
611
- function gr(e, t) {
612
- for (const n in e)
613
- if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
614
- return n;
615
- }
616
- function Mr(e, t) {
617
- for (let n = 0; n < e.length; n++)
618
- if (t(e[n]))
619
- return n;
620
- }
621
- function wr(e) {
622
- return (t, n = {}) => {
623
- const r = t.match(e.matchPattern);
624
- if (!r) return null;
625
- const a = r[0], o = t.match(e.parsePattern);
626
- if (!o) return null;
627
- let s = e.valueCallback ? e.valueCallback(o[0]) : o[0];
628
- s = n.valueCallback ? n.valueCallback(s) : s;
629
- const i = t.slice(a.length);
630
- return { value: s, rest: i };
631
- };
632
- }
633
- const br = /^(\d+)(th|st|nd|rd)?/i, kr = /\d+/i, vr = {
634
- narrow: /^(b|a)/i,
635
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
636
- wide: /^(before christ|before common era|anno domini|common era)/i
637
- }, Dr = {
638
- any: [/^b/i, /^(a|c)/i]
639
- }, Or = {
640
- narrow: /^[1234]/i,
641
- abbreviated: /^q[1234]/i,
642
- wide: /^[1234](th|st|nd|rd)? quarter/i
643
- }, Wr = {
644
- any: [/1/i, /2/i, /3/i, /4/i]
645
- }, Sr = {
646
- narrow: /^[jfmasond]/i,
647
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
648
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
649
- }, pr = {
650
- narrow: [
651
- /^j/i,
652
- /^f/i,
653
- /^m/i,
654
- /^a/i,
655
- /^m/i,
656
- /^j/i,
657
- /^j/i,
658
- /^a/i,
659
- /^s/i,
660
- /^o/i,
661
- /^n/i,
662
- /^d/i
663
- ],
664
- any: [
665
- /^ja/i,
666
- /^f/i,
667
- /^mar/i,
668
- /^ap/i,
669
- /^may/i,
670
- /^jun/i,
671
- /^jul/i,
672
- /^au/i,
673
- /^s/i,
674
- /^o/i,
675
- /^n/i,
676
- /^d/i
677
- ]
678
- }, Cr = {
679
- narrow: /^[smtwf]/i,
680
- short: /^(su|mo|tu|we|th|fr|sa)/i,
681
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
682
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
683
- }, Nr = {
684
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
685
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
686
- }, Yr = {
687
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
688
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
689
- }, xr = {
690
- any: {
691
- am: /^a/i,
692
- pm: /^p/i,
693
- midnight: /^mi/i,
694
- noon: /^no/i,
695
- morning: /morning/i,
696
- afternoon: /afternoon/i,
697
- evening: /evening/i,
698
- night: /night/i
699
- }
700
- }, Tr = {
701
- ordinalNumber: wr({
702
- matchPattern: br,
703
- parsePattern: kr,
704
- valueCallback: (e) => parseInt(e, 10)
705
- }),
706
- era: ye({
707
- matchPatterns: vr,
708
- defaultMatchWidth: "wide",
709
- parsePatterns: Dr,
710
- defaultParseWidth: "any"
711
- }),
712
- quarter: ye({
713
- matchPatterns: Or,
714
- defaultMatchWidth: "wide",
715
- parsePatterns: Wr,
716
- defaultParseWidth: "any",
717
- valueCallback: (e) => e + 1
718
- }),
719
- month: ye({
720
- matchPatterns: Sr,
721
- defaultMatchWidth: "wide",
722
- parsePatterns: pr,
723
- defaultParseWidth: "any"
724
- }),
725
- day: ye({
726
- matchPatterns: Cr,
727
- defaultMatchWidth: "wide",
728
- parsePatterns: Nr,
729
- defaultParseWidth: "any"
730
- }),
731
- dayPeriod: ye({
732
- matchPatterns: Yr,
733
- defaultMatchWidth: "any",
734
- parsePatterns: xr,
735
- defaultParseWidth: "any"
736
- })
737
- }, se = {
738
- code: "en-US",
739
- formatDistance: tr,
740
- formatLong: or,
741
- formatRelative: ir,
742
- localize: yr,
743
- match: Tr,
744
- options: {
745
- weekStartsOn: 0,
746
- firstWeekContainsDate: 1
747
- }
748
- }, Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
749
- __proto__: null,
750
- enUS: se
751
- }, Symbol.toStringTag, { value: "Module" }));
752
- function Er(e, t) {
753
- const n = P(e, t == null ? void 0 : t.in);
754
- return Ke(n, Et(n)) + 1;
755
- }
756
- function Je(e, t) {
757
- const n = P(e, t == null ? void 0 : t.in), r = +we(n) - +zn(n);
758
- return Math.round(r / St) + 1;
759
- }
760
- function Ft(e, t) {
761
- var d, f, h, y;
762
- const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = ke(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((f = (d = t == null ? void 0 : t.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((y = (h = a.locale) == null ? void 0 : h.options) == null ? void 0 : y.firstWeekContainsDate) ?? 1, s = I((t == null ? void 0 : t.in) || e, 0);
763
- s.setFullYear(r + 1, 0, o), s.setHours(0, 0, 0, 0);
764
- const i = fe(s, t), c = I((t == null ? void 0 : t.in) || e, 0);
765
- c.setFullYear(r, 0, o), c.setHours(0, 0, 0, 0);
766
- const u = fe(c, t);
767
- return +n >= +i ? r + 1 : +n >= +u ? r : r - 1;
768
- }
769
- function _r(e, t) {
770
- var i, c, u, d;
771
- const n = ke(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((d = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : d.firstWeekContainsDate) ?? 1, a = Ft(e, t), o = I((t == null ? void 0 : t.in) || e, 0);
772
- return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), fe(o, t);
773
- }
774
- function Ze(e, t) {
775
- const n = P(e, t == null ? void 0 : t.in), r = +fe(n, t) - +_r(n, t);
776
- return Math.round(r / St) + 1;
777
- }
778
- function T(e, t) {
779
- const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
780
- return n + r;
781
- }
782
- const ae = {
783
- // Year
784
- y(e, t) {
785
- const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
786
- return T(t === "yy" ? r % 100 : r, t.length);
787
- },
788
- // Month
789
- M(e, t) {
790
- const n = e.getMonth();
791
- return t === "M" ? String(n + 1) : T(n + 1, 2);
792
- },
793
- // Day of the month
794
- d(e, t) {
795
- return T(e.getDate(), t.length);
796
- },
797
- // AM or PM
798
- a(e, t) {
799
- const n = e.getHours() / 12 >= 1 ? "pm" : "am";
800
- switch (t) {
801
- case "a":
802
- case "aa":
803
- return n.toUpperCase();
804
- case "aaa":
805
- return n;
806
- case "aaaaa":
807
- return n[0];
808
- case "aaaa":
809
- default:
810
- return n === "am" ? "a.m." : "p.m.";
811
- }
812
- },
813
- // Hour [1-12]
814
- h(e, t) {
815
- return T(e.getHours() % 12 || 12, t.length);
816
- },
817
- // Hour [0-23]
818
- H(e, t) {
819
- return T(e.getHours(), t.length);
820
- },
821
- // Minute
822
- m(e, t) {
823
- return T(e.getMinutes(), t.length);
824
- },
825
- // Second
826
- s(e, t) {
827
- return T(e.getSeconds(), t.length);
828
- },
829
- // Fraction of second
830
- S(e, t) {
831
- const n = t.length, r = e.getMilliseconds(), a = Math.trunc(
832
- r * Math.pow(10, n - 3)
833
- );
834
- return T(a, t.length);
835
- }
836
- }, ue = {
837
- midnight: "midnight",
838
- noon: "noon",
839
- morning: "morning",
840
- afternoon: "afternoon",
841
- evening: "evening",
842
- night: "night"
843
- }, mt = {
844
- // Era
845
- G: function(e, t, n) {
846
- const r = e.getFullYear() > 0 ? 1 : 0;
847
- switch (t) {
848
- // AD, BC
849
- case "G":
850
- case "GG":
851
- case "GGG":
852
- return n.era(r, { width: "abbreviated" });
853
- // A, B
854
- case "GGGGG":
855
- return n.era(r, { width: "narrow" });
856
- // Anno Domini, Before Christ
857
- case "GGGG":
858
- default:
859
- return n.era(r, { width: "wide" });
860
- }
861
- },
862
- // Year
863
- y: function(e, t, n) {
864
- if (t === "yo") {
865
- const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
866
- return n.ordinalNumber(a, { unit: "year" });
867
- }
868
- return ae.y(e, t);
869
- },
870
- // Local week-numbering year
871
- Y: function(e, t, n, r) {
872
- const a = Ft(e, r), o = a > 0 ? a : 1 - a;
873
- if (t === "YY") {
874
- const s = o % 100;
875
- return T(s, 2);
876
- }
877
- return t === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : T(o, t.length);
878
- },
879
- // ISO week-numbering year
880
- R: function(e, t) {
881
- const n = Yt(e);
882
- return T(n, t.length);
883
- },
884
- // Extended year. This is a single number designating the year of this calendar system.
885
- // The main difference between `y` and `u` localizers are B.C. years:
886
- // | Year | `y` | `u` |
887
- // |------|-----|-----|
888
- // | AC 1 | 1 | 1 |
889
- // | BC 1 | 1 | 0 |
890
- // | BC 2 | 2 | -1 |
891
- // Also `yy` always returns the last two digits of a year,
892
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
893
- u: function(e, t) {
894
- const n = e.getFullYear();
895
- return T(n, t.length);
896
- },
897
- // Quarter
898
- Q: function(e, t, n) {
899
- const r = Math.ceil((e.getMonth() + 1) / 3);
900
- switch (t) {
901
- // 1, 2, 3, 4
902
- case "Q":
903
- return String(r);
904
- // 01, 02, 03, 04
905
- case "QQ":
906
- return T(r, 2);
907
- // 1st, 2nd, 3rd, 4th
908
- case "Qo":
909
- return n.ordinalNumber(r, { unit: "quarter" });
910
- // Q1, Q2, Q3, Q4
911
- case "QQQ":
912
- return n.quarter(r, {
913
- width: "abbreviated",
914
- context: "formatting"
915
- });
916
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
917
- case "QQQQQ":
918
- return n.quarter(r, {
919
- width: "narrow",
920
- context: "formatting"
921
- });
922
- // 1st quarter, 2nd quarter, ...
923
- case "QQQQ":
924
- default:
925
- return n.quarter(r, {
926
- width: "wide",
927
- context: "formatting"
928
- });
929
- }
930
- },
931
- // Stand-alone quarter
932
- q: function(e, t, n) {
933
- const r = Math.ceil((e.getMonth() + 1) / 3);
934
- switch (t) {
935
- // 1, 2, 3, 4
936
- case "q":
937
- return String(r);
938
- // 01, 02, 03, 04
939
- case "qq":
940
- return T(r, 2);
941
- // 1st, 2nd, 3rd, 4th
942
- case "qo":
943
- return n.ordinalNumber(r, { unit: "quarter" });
944
- // Q1, Q2, Q3, Q4
945
- case "qqq":
946
- return n.quarter(r, {
947
- width: "abbreviated",
948
- context: "standalone"
949
- });
950
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
951
- case "qqqqq":
952
- return n.quarter(r, {
953
- width: "narrow",
954
- context: "standalone"
955
- });
956
- // 1st quarter, 2nd quarter, ...
957
- case "qqqq":
958
- default:
959
- return n.quarter(r, {
960
- width: "wide",
961
- context: "standalone"
962
- });
963
- }
964
- },
965
- // Month
966
- M: function(e, t, n) {
967
- const r = e.getMonth();
968
- switch (t) {
969
- case "M":
970
- case "MM":
971
- return ae.M(e, t);
972
- // 1st, 2nd, ..., 12th
973
- case "Mo":
974
- return n.ordinalNumber(r + 1, { unit: "month" });
975
- // Jan, Feb, ..., Dec
976
- case "MMM":
977
- return n.month(r, {
978
- width: "abbreviated",
979
- context: "formatting"
980
- });
981
- // J, F, ..., D
982
- case "MMMMM":
983
- return n.month(r, {
984
- width: "narrow",
985
- context: "formatting"
986
- });
987
- // January, February, ..., December
988
- case "MMMM":
989
- default:
990
- return n.month(r, { width: "wide", context: "formatting" });
991
- }
992
- },
993
- // Stand-alone month
994
- L: function(e, t, n) {
995
- const r = e.getMonth();
996
- switch (t) {
997
- // 1, 2, ..., 12
998
- case "L":
999
- return String(r + 1);
1000
- // 01, 02, ..., 12
1001
- case "LL":
1002
- return T(r + 1, 2);
1003
- // 1st, 2nd, ..., 12th
1004
- case "Lo":
1005
- return n.ordinalNumber(r + 1, { unit: "month" });
1006
- // Jan, Feb, ..., Dec
1007
- case "LLL":
1008
- return n.month(r, {
1009
- width: "abbreviated",
1010
- context: "standalone"
1011
- });
1012
- // J, F, ..., D
1013
- case "LLLLL":
1014
- return n.month(r, {
1015
- width: "narrow",
1016
- context: "standalone"
1017
- });
1018
- // January, February, ..., December
1019
- case "LLLL":
1020
- default:
1021
- return n.month(r, { width: "wide", context: "standalone" });
1022
- }
1023
- },
1024
- // Local week of year
1025
- w: function(e, t, n, r) {
1026
- const a = Ze(e, r);
1027
- return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : T(a, t.length);
1028
- },
1029
- // ISO week of year
1030
- I: function(e, t, n) {
1031
- const r = Je(e);
1032
- return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : T(r, t.length);
1033
- },
1034
- // Day of the month
1035
- d: function(e, t, n) {
1036
- return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : ae.d(e, t);
1037
- },
1038
- // Day of year
1039
- D: function(e, t, n) {
1040
- const r = Er(e);
1041
- return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : T(r, t.length);
1042
- },
1043
- // Day of week
1044
- E: function(e, t, n) {
1045
- const r = e.getDay();
1046
- switch (t) {
1047
- // Tue
1048
- case "E":
1049
- case "EE":
1050
- case "EEE":
1051
- return n.day(r, {
1052
- width: "abbreviated",
1053
- context: "formatting"
1054
- });
1055
- // T
1056
- case "EEEEE":
1057
- return n.day(r, {
1058
- width: "narrow",
1059
- context: "formatting"
1060
- });
1061
- // Tu
1062
- case "EEEEEE":
1063
- return n.day(r, {
1064
- width: "short",
1065
- context: "formatting"
1066
- });
1067
- // Tuesday
1068
- case "EEEE":
1069
- default:
1070
- return n.day(r, {
1071
- width: "wide",
1072
- context: "formatting"
1073
- });
1074
- }
1075
- },
1076
- // Local day of week
1077
- e: function(e, t, n, r) {
1078
- const a = e.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
1079
- switch (t) {
1080
- // Numerical value (Nth day of week with current locale or weekStartsOn)
1081
- case "e":
1082
- return String(o);
1083
- // Padded numerical value
1084
- case "ee":
1085
- return T(o, 2);
1086
- // 1st, 2nd, ..., 7th
1087
- case "eo":
1088
- return n.ordinalNumber(o, { unit: "day" });
1089
- case "eee":
1090
- return n.day(a, {
1091
- width: "abbreviated",
1092
- context: "formatting"
1093
- });
1094
- // T
1095
- case "eeeee":
1096
- return n.day(a, {
1097
- width: "narrow",
1098
- context: "formatting"
1099
- });
1100
- // Tu
1101
- case "eeeeee":
1102
- return n.day(a, {
1103
- width: "short",
1104
- context: "formatting"
1105
- });
1106
- // Tuesday
1107
- case "eeee":
1108
- default:
1109
- return n.day(a, {
1110
- width: "wide",
1111
- context: "formatting"
1112
- });
1113
- }
1114
- },
1115
- // Stand-alone local day of week
1116
- c: function(e, t, n, r) {
1117
- const a = e.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
1118
- switch (t) {
1119
- // Numerical value (same as in `e`)
1120
- case "c":
1121
- return String(o);
1122
- // Padded numerical value
1123
- case "cc":
1124
- return T(o, t.length);
1125
- // 1st, 2nd, ..., 7th
1126
- case "co":
1127
- return n.ordinalNumber(o, { unit: "day" });
1128
- case "ccc":
1129
- return n.day(a, {
1130
- width: "abbreviated",
1131
- context: "standalone"
1132
- });
1133
- // T
1134
- case "ccccc":
1135
- return n.day(a, {
1136
- width: "narrow",
1137
- context: "standalone"
1138
- });
1139
- // Tu
1140
- case "cccccc":
1141
- return n.day(a, {
1142
- width: "short",
1143
- context: "standalone"
1144
- });
1145
- // Tuesday
1146
- case "cccc":
1147
- default:
1148
- return n.day(a, {
1149
- width: "wide",
1150
- context: "standalone"
1151
- });
1152
- }
1153
- },
1154
- // ISO day of week
1155
- i: function(e, t, n) {
1156
- const r = e.getDay(), a = r === 0 ? 7 : r;
1157
- switch (t) {
1158
- // 2
1159
- case "i":
1160
- return String(a);
1161
- // 02
1162
- case "ii":
1163
- return T(a, t.length);
1164
- // 2nd
1165
- case "io":
1166
- return n.ordinalNumber(a, { unit: "day" });
1167
- // Tue
1168
- case "iii":
1169
- return n.day(r, {
1170
- width: "abbreviated",
1171
- context: "formatting"
1172
- });
1173
- // T
1174
- case "iiiii":
1175
- return n.day(r, {
1176
- width: "narrow",
1177
- context: "formatting"
1178
- });
1179
- // Tu
1180
- case "iiiiii":
1181
- return n.day(r, {
1182
- width: "short",
1183
- context: "formatting"
1184
- });
1185
- // Tuesday
1186
- case "iiii":
1187
- default:
1188
- return n.day(r, {
1189
- width: "wide",
1190
- context: "formatting"
1191
- });
1192
- }
1193
- },
1194
- // AM or PM
1195
- a: function(e, t, n) {
1196
- const a = e.getHours() / 12 >= 1 ? "pm" : "am";
1197
- switch (t) {
1198
- case "a":
1199
- case "aa":
1200
- return n.dayPeriod(a, {
1201
- width: "abbreviated",
1202
- context: "formatting"
1203
- });
1204
- case "aaa":
1205
- return n.dayPeriod(a, {
1206
- width: "abbreviated",
1207
- context: "formatting"
1208
- }).toLowerCase();
1209
- case "aaaaa":
1210
- return n.dayPeriod(a, {
1211
- width: "narrow",
1212
- context: "formatting"
1213
- });
1214
- case "aaaa":
1215
- default:
1216
- return n.dayPeriod(a, {
1217
- width: "wide",
1218
- context: "formatting"
1219
- });
1220
- }
1221
- },
1222
- // AM, PM, midnight, noon
1223
- b: function(e, t, n) {
1224
- const r = e.getHours();
1225
- let a;
1226
- switch (r === 12 ? a = ue.noon : r === 0 ? a = ue.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
1227
- case "b":
1228
- case "bb":
1229
- return n.dayPeriod(a, {
1230
- width: "abbreviated",
1231
- context: "formatting"
1232
- });
1233
- case "bbb":
1234
- return n.dayPeriod(a, {
1235
- width: "abbreviated",
1236
- context: "formatting"
1237
- }).toLowerCase();
1238
- case "bbbbb":
1239
- return n.dayPeriod(a, {
1240
- width: "narrow",
1241
- context: "formatting"
1242
- });
1243
- case "bbbb":
1244
- default:
1245
- return n.dayPeriod(a, {
1246
- width: "wide",
1247
- context: "formatting"
1248
- });
1249
- }
1250
- },
1251
- // in the morning, in the afternoon, in the evening, at night
1252
- B: function(e, t, n) {
1253
- const r = e.getHours();
1254
- let a;
1255
- switch (r >= 17 ? a = ue.evening : r >= 12 ? a = ue.afternoon : r >= 4 ? a = ue.morning : a = ue.night, t) {
1256
- case "B":
1257
- case "BB":
1258
- case "BBB":
1259
- return n.dayPeriod(a, {
1260
- width: "abbreviated",
1261
- context: "formatting"
1262
- });
1263
- case "BBBBB":
1264
- return n.dayPeriod(a, {
1265
- width: "narrow",
1266
- context: "formatting"
1267
- });
1268
- case "BBBB":
1269
- default:
1270
- return n.dayPeriod(a, {
1271
- width: "wide",
1272
- context: "formatting"
1273
- });
1274
- }
1275
- },
1276
- // Hour [1-12]
1277
- h: function(e, t, n) {
1278
- if (t === "ho") {
1279
- let r = e.getHours() % 12;
1280
- return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
1281
- }
1282
- return ae.h(e, t);
1283
- },
1284
- // Hour [0-23]
1285
- H: function(e, t, n) {
1286
- return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : ae.H(e, t);
1287
- },
1288
- // Hour [0-11]
1289
- K: function(e, t, n) {
1290
- const r = e.getHours() % 12;
1291
- return t === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : T(r, t.length);
1292
- },
1293
- // Hour [1-24]
1294
- k: function(e, t, n) {
1295
- let r = e.getHours();
1296
- return r === 0 && (r = 24), t === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : T(r, t.length);
1297
- },
1298
- // Minute
1299
- m: function(e, t, n) {
1300
- return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : ae.m(e, t);
1301
- },
1302
- // Second
1303
- s: function(e, t, n) {
1304
- return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : ae.s(e, t);
1305
- },
1306
- // Fraction of second
1307
- S: function(e, t) {
1308
- return ae.S(e, t);
1309
- },
1310
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1311
- X: function(e, t, n) {
1312
- const r = e.getTimezoneOffset();
1313
- if (r === 0)
1314
- return "Z";
1315
- switch (t) {
1316
- // Hours and optional minutes
1317
- case "X":
1318
- return gt(r);
1319
- // Hours, minutes and optional seconds without `:` delimiter
1320
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1321
- // so this token always has the same output as `XX`
1322
- case "XXXX":
1323
- case "XX":
1324
- return oe(r);
1325
- // Hours, minutes and optional seconds with `:` delimiter
1326
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1327
- // so this token always has the same output as `XXX`
1328
- case "XXXXX":
1329
- case "XXX":
1330
- // Hours and minutes with `:` delimiter
1331
- default:
1332
- return oe(r, ":");
1333
- }
1334
- },
1335
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1336
- x: function(e, t, n) {
1337
- const r = e.getTimezoneOffset();
1338
- switch (t) {
1339
- // Hours and optional minutes
1340
- case "x":
1341
- return gt(r);
1342
- // Hours, minutes and optional seconds without `:` delimiter
1343
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1344
- // so this token always has the same output as `xx`
1345
- case "xxxx":
1346
- case "xx":
1347
- return oe(r);
1348
- // Hours, minutes and optional seconds with `:` delimiter
1349
- // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1350
- // so this token always has the same output as `xxx`
1351
- case "xxxxx":
1352
- case "xxx":
1353
- // Hours and minutes with `:` delimiter
1354
- default:
1355
- return oe(r, ":");
1356
- }
1357
- },
1358
- // Timezone (GMT)
1359
- O: function(e, t, n) {
1360
- const r = e.getTimezoneOffset();
1361
- switch (t) {
1362
- // Short
1363
- case "O":
1364
- case "OO":
1365
- case "OOO":
1366
- return "GMT" + yt(r, ":");
1367
- // Long
1368
- case "OOOO":
1369
- default:
1370
- return "GMT" + oe(r, ":");
1371
- }
1372
- },
1373
- // Timezone (specific non-location)
1374
- z: function(e, t, n) {
1375
- const r = e.getTimezoneOffset();
1376
- switch (t) {
1377
- // Short
1378
- case "z":
1379
- case "zz":
1380
- case "zzz":
1381
- return "GMT" + yt(r, ":");
1382
- // Long
1383
- case "zzzz":
1384
- default:
1385
- return "GMT" + oe(r, ":");
1386
- }
1387
- },
1388
- // Seconds timestamp
1389
- t: function(e, t, n) {
1390
- const r = Math.trunc(+e / 1e3);
1391
- return T(r, t.length);
1392
- },
1393
- // Milliseconds timestamp
1394
- T: function(e, t, n) {
1395
- return T(+e, t.length);
1396
- }
1397
- };
1398
- function yt(e, t = "") {
1399
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), o = r % 60;
1400
- return o === 0 ? n + String(a) : n + String(a) + t + T(o, 2);
1401
- }
1402
- function gt(e, t) {
1403
- return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) : oe(e, t);
1404
- }
1405
- function oe(e, t = "") {
1406
- const n = e > 0 ? "-" : "+", r = Math.abs(e), a = T(Math.trunc(r / 60), 2), o = T(r % 60, 2);
1407
- return n + a + t + o;
1408
- }
1409
- const Mt = (e, t) => {
1410
- switch (e) {
1411
- case "P":
1412
- return t.date({ width: "short" });
1413
- case "PP":
1414
- return t.date({ width: "medium" });
1415
- case "PPP":
1416
- return t.date({ width: "long" });
1417
- case "PPPP":
1418
- default:
1419
- return t.date({ width: "full" });
1420
- }
1421
- }, Bt = (e, t) => {
1422
- switch (e) {
1423
- case "p":
1424
- return t.time({ width: "short" });
1425
- case "pp":
1426
- return t.time({ width: "medium" });
1427
- case "ppp":
1428
- return t.time({ width: "long" });
1429
- case "pppp":
1430
- default:
1431
- return t.time({ width: "full" });
1432
- }
1433
- }, Fr = (e, t) => {
1434
- const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
1435
- if (!a)
1436
- return Mt(e, t);
1437
- let o;
1438
- switch (r) {
1439
- case "P":
1440
- o = t.dateTime({ width: "short" });
1441
- break;
1442
- case "PP":
1443
- o = t.dateTime({ width: "medium" });
1444
- break;
1445
- case "PPP":
1446
- o = t.dateTime({ width: "long" });
1447
- break;
1448
- case "PPPP":
1449
- default:
1450
- o = t.dateTime({ width: "full" });
1451
- break;
1452
- }
1453
- return o.replace("{{date}}", Mt(r, t)).replace("{{time}}", Bt(a, t));
1454
- }, Br = {
1455
- p: Bt,
1456
- P: Fr
1457
- }, Ir = /^D+$/, Ar = /^Y+$/, Hr = ["D", "DD", "YY", "YYYY"];
1458
- function qr(e) {
1459
- return Ir.test(e);
1460
- }
1461
- function jr(e) {
1462
- return Ar.test(e);
1463
- }
1464
- function zr(e, t, n) {
1465
- const r = Gr(e, t, n);
1466
- if (console.warn(r), Hr.includes(e)) throw new RangeError(r);
1467
- }
1468
- function Gr(e, t, n) {
1469
- const r = e[0] === "Y" ? "years" : "days of the month";
1470
- 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`;
1471
- }
1472
- const $r = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Rr = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Vr = /^'([^]*?)'?$/, Ur = /''/g, Qr = /[a-zA-Z]/;
1473
- function Me(e, t, n) {
1474
- var d, f, h, y, D, W, v, C;
1475
- const r = ke(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? se, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((f = (d = n == null ? void 0 : n.locale) == null ? void 0 : d.options) == null ? void 0 : f.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((y = (h = r.locale) == null ? void 0 : h.options) == null ? void 0 : y.firstWeekContainsDate) ?? 1, s = (n == null ? void 0 : n.weekStartsOn) ?? ((W = (D = n == null ? void 0 : n.locale) == null ? void 0 : D.options) == null ? void 0 : W.weekStartsOn) ?? r.weekStartsOn ?? ((C = (v = r.locale) == null ? void 0 : v.options) == null ? void 0 : C.weekStartsOn) ?? 0, i = P(e, n == null ? void 0 : n.in);
1476
- if (!Un(i))
1477
- throw new RangeError("Invalid time value");
1478
- let c = t.match(Rr).map((M) => {
1479
- const g = M[0];
1480
- if (g === "p" || g === "P") {
1481
- const S = Br[g];
1482
- return S(M, a.formatLong);
1483
- }
1484
- return M;
1485
- }).join("").match($r).map((M) => {
1486
- if (M === "''")
1487
- return { isToken: !1, value: "'" };
1488
- const g = M[0];
1489
- if (g === "'")
1490
- return { isToken: !1, value: Xr(M) };
1491
- if (mt[g])
1492
- return { isToken: !0, value: M };
1493
- if (g.match(Qr))
1494
- throw new RangeError(
1495
- "Format string contains an unescaped latin alphabet character `" + g + "`"
1496
- );
1497
- return { isToken: !1, value: M };
1498
- });
1499
- a.localize.preprocessor && (c = a.localize.preprocessor(i, c));
1500
- const u = {
1501
- firstWeekContainsDate: o,
1502
- weekStartsOn: s,
1503
- locale: a
1504
- };
1505
- return c.map((M) => {
1506
- if (!M.isToken) return M.value;
1507
- const g = M.value;
1508
- (!(n != null && n.useAdditionalWeekYearTokens) && jr(g) || !(n != null && n.useAdditionalDayOfYearTokens) && qr(g)) && zr(g, t, String(e));
1509
- const S = mt[g[0]];
1510
- return S(i, g, a.localize, u);
1511
- }).join("");
1512
- }
1513
- function Xr(e) {
1514
- const t = e.match(Vr);
1515
- return t ? t[1].replace(Ur, "'") : e;
1516
- }
1517
- function Kr(e, t) {
1518
- const n = P(e, t == null ? void 0 : t.in), r = n.getFullYear(), a = n.getMonth(), o = I(n, 0);
1519
- return o.setFullYear(r, a + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
1520
- }
1521
- function Jr(e, t) {
1522
- return P(e, t == null ? void 0 : t.in).getMonth();
1523
- }
1524
- function Zr(e, t) {
1525
- return P(e, t == null ? void 0 : t.in).getFullYear();
1526
- }
1527
- function Lr(e, t) {
1528
- return +P(e) > +P(t);
1529
- }
1530
- function ea(e, t) {
1531
- return +P(e) < +P(t);
1532
- }
1533
- function ta(e, t, n) {
1534
- const [r, a] = be(
1535
- n == null ? void 0 : n.in,
1536
- e,
1537
- t
1538
- );
1539
- return r.getFullYear() === a.getFullYear() && r.getMonth() === a.getMonth();
1540
- }
1541
- function na(e, t, n) {
1542
- const [r, a] = be(
1543
- n == null ? void 0 : n.in,
1544
- e,
1545
- t
1546
- );
1547
- return r.getFullYear() === a.getFullYear();
1548
- }
1549
- function ra(e, t, n) {
1550
- const r = P(e, n == null ? void 0 : n.in), a = r.getFullYear(), o = r.getDate(), s = I(e, 0);
1551
- s.setFullYear(a, t, 15), s.setHours(0, 0, 0, 0);
1552
- const i = Kr(s);
1553
- return r.setMonth(t, Math.min(o, i)), r;
1554
- }
1555
- function aa(e, t, n) {
1556
- const r = P(e, n == null ? void 0 : n.in);
1557
- return isNaN(+r) ? I(e, NaN) : (r.setFullYear(t), r);
1558
- }
1559
- const wt = 5, oa = 4;
1560
- function sa(e, t) {
1561
- const n = t.startOfMonth(e), r = n.getDay() > 0 ? n.getDay() : 7, a = t.addDays(e, -r + 1), o = t.addDays(a, wt * 7 - 1);
1562
- return t.getMonth(e) === t.getMonth(o) ? wt : oa;
1563
- }
1564
- function It(e, t) {
1565
- const n = t.startOfMonth(e), r = n.getDay();
1566
- return r === 1 ? n : r === 0 ? t.addDays(n, -6) : t.addDays(n, -1 * (r - 1));
1567
- }
1568
- function ia(e, t) {
1569
- const n = It(e, t), r = sa(e, t);
1570
- return t.addDays(n, r * 7 - 1);
1571
- }
1572
- const At = {
1573
- ...se,
1574
- labels: {
1575
- labelDayButton: (e, t, n, r) => {
1576
- let a;
1577
- r && typeof r.format == "function" ? a = r.format.bind(r) : a = (s, i) => Me(s, i, { locale: se, ...n });
1578
- let o = a(e, "PPPP");
1579
- return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
1580
- },
1581
- labelMonthDropdown: "Choose the Month",
1582
- labelNext: "Go to the Next Month",
1583
- labelPrevious: "Go to the Previous Month",
1584
- labelWeekNumber: (e) => `Week ${e}`,
1585
- labelYearDropdown: "Choose the Year",
1586
- labelGrid: (e, t, n) => {
1587
- let r;
1588
- return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (a, o) => Me(a, o, { locale: se, ...t }), r(e, "LLLL yyyy");
1589
- },
1590
- labelGridcell: (e, t, n, r) => {
1591
- let a;
1592
- r && typeof r.format == "function" ? a = r.format.bind(r) : a = (s, i) => Me(s, i, { locale: se, ...n });
1593
- let o = a(e, "PPPP");
1594
- return t != null && t.today && (o = `Today, ${o}`), o;
1595
- },
1596
- labelNav: "Navigation bar",
1597
- labelWeekNumberHeader: "Week Number",
1598
- labelWeekday: (e, t, n) => {
1599
- let r;
1600
- return n && typeof n.format == "function" ? r = n.format.bind(n) : r = (a, o) => Me(a, o, { locale: se, ...t }), r(e, "cccc");
1601
- }
1602
- }
1603
- };
1604
- class j {
1605
- /**
1606
- * Creates an instance of `DateLib`.
1607
- *
1608
- * @param options Configuration options for the date library.
1609
- * @param overrides Custom overrides for the date library functions.
1610
- */
1611
- constructor(t, n) {
1612
- this.Date = Date, this.today = () => {
1613
- var r;
1614
- return (r = this.overrides) != null && r.today ? this.overrides.today() : this.options.timeZone ? A.tz(this.options.timeZone) : new this.Date();
1615
- }, this.newDate = (r, a, o) => {
1616
- var s;
1617
- return (s = this.overrides) != null && s.newDate ? this.overrides.newDate(r, a, o) : this.options.timeZone ? new A(r, a, o, this.options.timeZone) : new Date(r, a, o);
1618
- }, this.addDays = (r, a) => {
1619
- var o;
1620
- return (o = this.overrides) != null && o.addDays ? this.overrides.addDays(r, a) : Ct(r, a);
1621
- }, this.addMonths = (r, a) => {
1622
- var o;
1623
- return (o = this.overrides) != null && o.addMonths ? this.overrides.addMonths(r, a) : Nt(r, a);
1624
- }, this.addWeeks = (r, a) => {
1625
- var o;
1626
- return (o = this.overrides) != null && o.addWeeks ? this.overrides.addWeeks(r, a) : Gn(r, a);
1627
- }, this.addYears = (r, a) => {
1628
- var o;
1629
- return (o = this.overrides) != null && o.addYears ? this.overrides.addYears(r, a) : $n(r, a);
1630
- }, this.differenceInCalendarDays = (r, a) => {
1631
- var o;
1632
- return (o = this.overrides) != null && o.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(r, a) : Ke(r, a);
1633
- }, this.differenceInCalendarMonths = (r, a) => {
1634
- var o;
1635
- return (o = this.overrides) != null && o.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(r, a) : Tt(r, a);
1636
- }, this.eachMonthOfInterval = (r) => {
1637
- var a;
1638
- return (a = this.overrides) != null && a.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(r) : Xn(r);
1639
- }, this.eachYearOfInterval = (r) => {
1640
- var i;
1641
- const a = (i = this.overrides) != null && i.eachYearOfInterval ? this.overrides.eachYearOfInterval(r) : Zn(r), o = new Set(a.map((c) => this.getYear(c)));
1642
- if (o.size === a.length)
1643
- return a;
1644
- const s = [];
1645
- return o.forEach((c) => {
1646
- s.push(new Date(c, 0, 1));
1647
- }), s;
1648
- }, this.endOfBroadcastWeek = (r) => {
1649
- var a;
1650
- return (a = this.overrides) != null && a.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(r) : ia(r, this);
1651
- }, this.endOfISOWeek = (r) => {
1652
- var a;
1653
- return (a = this.overrides) != null && a.endOfISOWeek ? this.overrides.endOfISOWeek(r) : Ln(r);
1654
- }, this.endOfMonth = (r) => {
1655
- var a;
1656
- return (a = this.overrides) != null && a.endOfMonth ? this.overrides.endOfMonth(r) : Qn(r);
1657
- }, this.endOfWeek = (r, a) => {
1658
- var o;
1659
- return (o = this.overrides) != null && o.endOfWeek ? this.overrides.endOfWeek(r, a) : _t(r, this.options);
1660
- }, this.endOfYear = (r) => {
1661
- var a;
1662
- return (a = this.overrides) != null && a.endOfYear ? this.overrides.endOfYear(r) : Jn(r);
1663
- }, this.format = (r, a, o) => {
1664
- var i;
1665
- const s = (i = this.overrides) != null && i.format ? this.overrides.format(r, a, this.options) : Me(r, a, this.options);
1666
- return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(s) : s;
1667
- }, this.getISOWeek = (r) => {
1668
- var a;
1669
- return (a = this.overrides) != null && a.getISOWeek ? this.overrides.getISOWeek(r) : Je(r);
1670
- }, this.getMonth = (r, a) => {
1671
- var o;
1672
- return (o = this.overrides) != null && o.getMonth ? this.overrides.getMonth(r, this.options) : Jr(r, this.options);
1673
- }, this.getYear = (r, a) => {
1674
- var o;
1675
- return (o = this.overrides) != null && o.getYear ? this.overrides.getYear(r, this.options) : Zr(r, this.options);
1676
- }, this.getWeek = (r, a) => {
1677
- var o;
1678
- return (o = this.overrides) != null && o.getWeek ? this.overrides.getWeek(r, this.options) : Ze(r, this.options);
1679
- }, this.isAfter = (r, a) => {
1680
- var o;
1681
- return (o = this.overrides) != null && o.isAfter ? this.overrides.isAfter(r, a) : Lr(r, a);
1682
- }, this.isBefore = (r, a) => {
1683
- var o;
1684
- return (o = this.overrides) != null && o.isBefore ? this.overrides.isBefore(r, a) : ea(r, a);
1685
- }, this.isDate = (r) => {
1686
- var a;
1687
- return (a = this.overrides) != null && a.isDate ? this.overrides.isDate(r) : xt(r);
1688
- }, this.isSameDay = (r, a) => {
1689
- var o;
1690
- return (o = this.overrides) != null && o.isSameDay ? this.overrides.isSameDay(r, a) : _n(r, a);
1691
- }, this.isSameMonth = (r, a) => {
1692
- var o;
1693
- return (o = this.overrides) != null && o.isSameMonth ? this.overrides.isSameMonth(r, a) : ta(r, a);
1694
- }, this.isSameYear = (r, a) => {
1695
- var o;
1696
- return (o = this.overrides) != null && o.isSameYear ? this.overrides.isSameYear(r, a) : na(r, a);
1697
- }, this.max = (r) => {
1698
- var a;
1699
- return (a = this.overrides) != null && a.max ? this.overrides.max(r) : Rn(r);
1700
- }, this.min = (r) => {
1701
- var a;
1702
- return (a = this.overrides) != null && a.min ? this.overrides.min(r) : Vn(r);
1703
- }, this.setMonth = (r, a) => {
1704
- var o;
1705
- return (o = this.overrides) != null && o.setMonth ? this.overrides.setMonth(r, a) : ra(r, a);
1706
- }, this.setYear = (r, a) => {
1707
- var o;
1708
- return (o = this.overrides) != null && o.setYear ? this.overrides.setYear(r, a) : aa(r, a);
1709
- }, this.startOfBroadcastWeek = (r, a) => {
1710
- var o;
1711
- return (o = this.overrides) != null && o.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(r, this) : It(r, this);
1712
- }, this.startOfDay = (r) => {
1713
- var a;
1714
- return (a = this.overrides) != null && a.startOfDay ? this.overrides.startOfDay(r) : Qe(r);
1715
- }, this.startOfISOWeek = (r) => {
1716
- var a;
1717
- return (a = this.overrides) != null && a.startOfISOWeek ? this.overrides.startOfISOWeek(r) : we(r);
1718
- }, this.startOfMonth = (r) => {
1719
- var a;
1720
- return (a = this.overrides) != null && a.startOfMonth ? this.overrides.startOfMonth(r) : Kn(r);
1721
- }, this.startOfWeek = (r, a) => {
1722
- var o;
1723
- return (o = this.overrides) != null && o.startOfWeek ? this.overrides.startOfWeek(r, this.options) : fe(r, this.options);
1724
- }, this.startOfYear = (r) => {
1725
- var a;
1726
- return (a = this.overrides) != null && a.startOfYear ? this.overrides.startOfYear(r) : Et(r);
1727
- }, this.options = { locale: At, ...t }, this.overrides = n;
1728
- }
1729
- /**
1730
- * Generates a mapping of Arabic digits (0-9) to the target numbering system
1731
- * digits.
1732
- *
1733
- * @since 9.5.0
1734
- * @returns A record mapping Arabic digits to the target numerals.
1735
- */
1736
- getDigitMap() {
1737
- const { numerals: t = "latn" } = this.options, n = new Intl.NumberFormat("en-US", {
1738
- numberingSystem: t
1739
- }), r = {};
1740
- for (let a = 0; a < 10; a++)
1741
- r[a.toString()] = n.format(a);
1742
- return r;
1743
- }
1744
- /**
1745
- * Replaces Arabic digits in a string with the target numbering system digits.
1746
- *
1747
- * @since 9.5.0
1748
- * @param input The string containing Arabic digits.
1749
- * @returns The string with digits replaced.
1750
- */
1751
- replaceDigits(t) {
1752
- const n = this.getDigitMap();
1753
- return t.replace(/\d/g, (r) => n[r] || r);
1754
- }
1755
- /**
1756
- * Formats a number using the configured numbering system.
1757
- *
1758
- * @since 9.5.0
1759
- * @param value The number to format.
1760
- * @returns The formatted number as a string.
1761
- */
1762
- formatNumber(t) {
1763
- return this.replaceDigits(t.toString());
1764
- }
1765
- /**
1766
- * Returns the preferred ordering for month and year labels for the current
1767
- * locale.
1768
- */
1769
- getMonthYearOrder() {
1770
- var n;
1771
- const t = (n = this.options.locale) == null ? void 0 : n.code;
1772
- return t && j.yearFirstLocales.has(t) ? "year-first" : "month-first";
1773
- }
1774
- /**
1775
- * Formats the month/year pair respecting locale conventions.
1776
- *
1777
- * @since 9.11.0
1778
- */
1779
- formatMonthYear(t) {
1780
- const { locale: n, timeZone: r, numerals: a } = this.options, o = n == null ? void 0 : n.code;
1781
- if (o && j.yearFirstLocales.has(o))
1782
- try {
1783
- return new Intl.DateTimeFormat(o, {
1784
- month: "long",
1785
- year: "numeric",
1786
- timeZone: r,
1787
- numberingSystem: a
1788
- }).format(t);
1789
- } catch {
1790
- }
1791
- const s = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
1792
- return this.format(t, s);
1793
- }
1794
- }
1795
- j.yearFirstLocales = /* @__PURE__ */ new Set([
1796
- "eu",
1797
- "hu",
1798
- "ja",
1799
- "ja-Hira",
1800
- "ja-JP",
1801
- "ko",
1802
- "ko-KR",
1803
- "lt",
1804
- "lt-LT",
1805
- "lv",
1806
- "lv-LV",
1807
- "mn",
1808
- "mn-MN",
1809
- "zh",
1810
- "zh-CN",
1811
- "zh-HK",
1812
- "zh-TW"
1813
- ]);
1814
- const Z = new j();
1815
- class Ht {
1816
- constructor(t, n, r = Z) {
1817
- this.date = t, this.displayMonth = n, this.outside = !!(n && !r.isSameMonth(t, n)), this.dateLib = r, this.isoDate = r.format(t, "yyyy-MM-dd"), this.displayMonthId = r.format(n, "yyyy-MM"), this.dateMonthId = r.format(t, "yyyy-MM");
1818
- }
1819
- /**
1820
- * Checks if this day is equal to another `CalendarDay`, considering both the
1821
- * date and the displayed month.
1822
- *
1823
- * @param day The `CalendarDay` to compare with.
1824
- * @returns `true` if the days are equal, otherwise `false`.
1825
- */
1826
- isEqualTo(t) {
1827
- return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
1828
- }
1829
- }
1830
- class ca {
1831
- constructor(t, n) {
1832
- this.date = t, this.weeks = n;
1833
- }
1834
- }
1835
- class ua {
1836
- constructor(t, n) {
1837
- this.days = n, this.weekNumber = t;
1838
- }
1839
- }
1840
- function da(e) {
1841
- return m.createElement("button", { ...e });
1842
- }
1843
- function fa(e) {
1844
- return m.createElement("span", { ...e });
1845
- }
1846
- function la(e) {
1847
- const { size: t = 24, orientation: n = "left", className: r } = e;
1848
- return (
1849
- // biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
1850
- m.createElement(
1851
- "svg",
1852
- { className: r, width: t, height: t, viewBox: "0 0 24 24" },
1853
- n === "up" && m.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
1854
- n === "down" && m.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
1855
- n === "left" && m.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
1856
- n === "right" && m.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
1857
- )
1858
- );
1859
- }
1860
- function ha(e) {
1861
- const { day: t, modifiers: n, ...r } = e;
1862
- return m.createElement("td", { ...r });
1863
- }
1864
- function ma(e) {
1865
- const { day: t, modifiers: n, ...r } = e, a = m.useRef(null);
1866
- return m.useEffect(() => {
1867
- var o;
1868
- n.focused && ((o = a.current) == null || o.focus());
1869
- }, [n.focused]), m.createElement("button", { ref: a, ...r });
1870
- }
1871
- var w;
1872
- (function(e) {
1873
- 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";
1874
- })(w || (w = {}));
1875
- var _;
1876
- (function(e) {
1877
- e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
1878
- })(_ || (_ = {}));
1879
- var X;
1880
- (function(e) {
1881
- e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
1882
- })(X || (X = {}));
1883
- var q;
1884
- (function(e) {
1885
- 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";
1886
- })(q || (q = {}));
1887
- function ya(e) {
1888
- const { options: t, className: n, components: r, classNames: a, ...o } = e, s = [a[w.Dropdown], n].join(" "), i = t == null ? void 0 : t.find(({ value: c }) => c === o.value);
1889
- return m.createElement(
1890
- "span",
1891
- { "data-disabled": o.disabled, className: a[w.DropdownRoot] },
1892
- m.createElement(r.Select, { className: s, ...o }, t == null ? void 0 : t.map(({ value: c, label: u, disabled: d }) => m.createElement(r.Option, { key: c, value: c, disabled: d }, u))),
1893
- m.createElement(
1894
- "span",
1895
- { className: a[w.CaptionLabel], "aria-hidden": !0 },
1896
- i == null ? void 0 : i.label,
1897
- m.createElement(r.Chevron, { orientation: "down", size: 18, className: a[w.Chevron] })
1898
- )
1899
- );
1900
- }
1901
- function ga(e) {
1902
- return m.createElement("div", { ...e });
1903
- }
1904
- function Ma(e) {
1905
- return m.createElement("div", { ...e });
1906
- }
1907
- function wa(e) {
1908
- const { calendarMonth: t, displayIndex: n, ...r } = e;
1909
- return m.createElement("div", { ...r }, e.children);
1910
- }
1911
- function ba(e) {
1912
- const { calendarMonth: t, displayIndex: n, ...r } = e;
1913
- return m.createElement("div", { ...r });
1914
- }
1915
- function ka(e) {
1916
- return m.createElement("table", { ...e });
1917
- }
1918
- function va(e) {
1919
- return m.createElement("div", { ...e });
1920
- }
1921
- const qt = xn(void 0);
1922
- function ve() {
1923
- const e = Tn(qt);
1924
- if (e === void 0)
1925
- throw new Error("useDayPicker() must be used within a custom component.");
1926
- return e;
1927
- }
1928
- function Da(e) {
1929
- const { components: t } = ve();
1930
- return m.createElement(t.Dropdown, { ...e });
1931
- }
1932
- function Oa(e) {
1933
- const { onPreviousClick: t, onNextClick: n, previousMonth: r, nextMonth: a, ...o } = e, { components: s, classNames: i, labels: { labelPrevious: c, labelNext: u } } = ve(), d = $((h) => {
1934
- a && (n == null || n(h));
1935
- }, [a, n]), f = $((h) => {
1936
- r && (t == null || t(h));
1937
- }, [r, t]);
1938
- return m.createElement(
1939
- "nav",
1940
- { ...o },
1941
- m.createElement(
1942
- s.PreviousMonthButton,
1943
- { type: "button", className: i[w.PreviousMonthButton], tabIndex: r ? void 0 : -1, "aria-disabled": r ? void 0 : !0, "aria-label": c(r), onClick: f },
1944
- m.createElement(s.Chevron, { disabled: r ? void 0 : !0, className: i[w.Chevron], orientation: "left" })
1945
- ),
1946
- m.createElement(
1947
- s.NextMonthButton,
1948
- { type: "button", className: i[w.NextMonthButton], tabIndex: a ? void 0 : -1, "aria-disabled": a ? void 0 : !0, "aria-label": u(a), onClick: d },
1949
- m.createElement(s.Chevron, { disabled: a ? void 0 : !0, orientation: "right", className: i[w.Chevron] })
1950
- )
1951
- );
1952
- }
1953
- function Wa(e) {
1954
- const { components: t } = ve();
1955
- return m.createElement(t.Button, { ...e });
1956
- }
1957
- function Sa(e) {
1958
- return m.createElement("option", { ...e });
1959
- }
1960
- function pa(e) {
1961
- const { components: t } = ve();
1962
- return m.createElement(t.Button, { ...e });
1963
- }
1964
- function Ca(e) {
1965
- const { rootRef: t, ...n } = e;
1966
- return m.createElement("div", { ...n, ref: t });
1967
- }
1968
- function Na(e) {
1969
- return m.createElement("select", { ...e });
1970
- }
1971
- function Ya(e) {
1972
- const { week: t, ...n } = e;
1973
- return m.createElement("tr", { ...n });
1974
- }
1975
- function xa(e) {
1976
- return m.createElement("th", { ...e });
1977
- }
1978
- function Ta(e) {
1979
- return m.createElement(
1980
- "thead",
1981
- { "aria-hidden": !0 },
1982
- m.createElement("tr", { ...e })
1983
- );
1984
- }
1985
- function Pa(e) {
1986
- const { week: t, ...n } = e;
1987
- return m.createElement("th", { ...n });
1988
- }
1989
- function Ea(e) {
1990
- return m.createElement("th", { ...e });
1991
- }
1992
- function _a(e) {
1993
- return m.createElement("tbody", { ...e });
1994
- }
1995
- function Fa(e) {
1996
- const { components: t } = ve();
1997
- return m.createElement(t.Dropdown, { ...e });
1998
- }
1999
- const Ba = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2000
- __proto__: null,
2001
- Button: da,
2002
- CaptionLabel: fa,
2003
- Chevron: la,
2004
- Day: ha,
2005
- DayButton: ma,
2006
- Dropdown: ya,
2007
- DropdownNav: ga,
2008
- Footer: Ma,
2009
- Month: wa,
2010
- MonthCaption: ba,
2011
- MonthGrid: ka,
2012
- Months: va,
2013
- MonthsDropdown: Da,
2014
- Nav: Oa,
2015
- NextMonthButton: Wa,
2016
- Option: Sa,
2017
- PreviousMonthButton: pa,
2018
- Root: Ca,
2019
- Select: Na,
2020
- Week: Ya,
2021
- WeekNumber: Pa,
2022
- WeekNumberHeader: Ea,
2023
- Weekday: xa,
2024
- Weekdays: Ta,
2025
- Weeks: _a,
2026
- YearsDropdown: Fa
2027
- }, Symbol.toStringTag, { value: "Module" }));
2028
- function te(e, t, n = !1, r = Z) {
2029
- let { from: a, to: o } = e;
2030
- const { differenceInCalendarDays: s, isSameDay: i } = r;
2031
- return a && o ? (s(o, a) < 0 && ([a, o] = [o, a]), s(t, a) >= (n ? 1 : 0) && s(o, t) >= (n ? 1 : 0)) : !n && o ? i(o, t) : !n && a ? i(a, t) : !1;
2032
- }
2033
- function Le(e) {
2034
- return !!(e && typeof e == "object" && "before" in e && "after" in e);
2035
- }
2036
- function Te(e) {
2037
- return !!(e && typeof e == "object" && "from" in e);
2038
- }
2039
- function et(e) {
2040
- return !!(e && typeof e == "object" && "after" in e);
2041
- }
2042
- function tt(e) {
2043
- return !!(e && typeof e == "object" && "before" in e);
2044
- }
2045
- function jt(e) {
2046
- return !!(e && typeof e == "object" && "dayOfWeek" in e);
2047
- }
2048
- function zt(e, t) {
2049
- return Array.isArray(e) && e.every(t.isDate);
2050
- }
2051
- function ne(e, t, n = Z) {
2052
- const r = Array.isArray(t) ? t : [t], { isSameDay: a, differenceInCalendarDays: o, isAfter: s } = n;
2053
- return r.some((i) => {
2054
- if (typeof i == "boolean")
2055
- return i;
2056
- if (n.isDate(i))
2057
- return a(e, i);
2058
- if (zt(i, n))
2059
- return i.some((c) => a(e, c));
2060
- if (Te(i))
2061
- return te(i, e, !1, n);
2062
- if (jt(i))
2063
- return Array.isArray(i.dayOfWeek) ? i.dayOfWeek.includes(e.getDay()) : i.dayOfWeek === e.getDay();
2064
- if (Le(i)) {
2065
- const c = o(i.before, e), u = o(i.after, e), d = c > 0, f = u < 0;
2066
- return s(i.before, i.after) ? f && d : d || f;
2067
- }
2068
- return et(i) ? o(e, i.after) > 0 : tt(i) ? o(i.before, e) > 0 : typeof i == "function" ? i(e) : !1;
2069
- });
2070
- }
2071
- function Ia(e, t, n, r, a) {
2072
- const { disabled: o, hidden: s, modifiers: i, showOutsideDays: c, broadcastCalendar: u, today: d = a.today() } = t, { isSameDay: f, isSameMonth: h, startOfMonth: y, isBefore: D, endOfMonth: W, isAfter: v } = a, C = n && y(n), M = r && W(r), g = {
2073
- [_.focused]: [],
2074
- [_.outside]: [],
2075
- [_.disabled]: [],
2076
- [_.hidden]: [],
2077
- [_.today]: []
2078
- }, S = {};
2079
- for (const k of e) {
2080
- const { date: l, displayMonth: p } = k, E = !!(p && !h(l, p)), B = !!(C && D(l, C)), F = !!(M && v(l, M)), z = !!(o && ne(l, o, a)), re = !!(s && ne(l, s, a)) || B || F || // Broadcast calendar will show outside days as default
2081
- !u && !c && E || u && c === !1 && E, L = f(l, d);
2082
- E && g.outside.push(k), z && g.disabled.push(k), re && g.hidden.push(k), L && g.today.push(k), i && Object.keys(i).forEach((G) => {
2083
- const ce = i == null ? void 0 : i[G];
2084
- ce && ne(l, ce, a) && (S[G] ? S[G].push(k) : S[G] = [k]);
2085
- });
2086
- }
2087
- return (k) => {
2088
- const l = {
2089
- [_.focused]: !1,
2090
- [_.disabled]: !1,
2091
- [_.hidden]: !1,
2092
- [_.outside]: !1,
2093
- [_.today]: !1
2094
- }, p = {};
2095
- for (const E in g) {
2096
- const B = g[E];
2097
- l[E] = B.some((F) => F === k);
2098
- }
2099
- for (const E in S)
2100
- p[E] = S[E].some((B) => B === k);
2101
- return {
2102
- ...l,
2103
- // custom modifiers should override all the previous ones
2104
- ...p
2105
- };
2106
- };
2107
- }
2108
- function Aa(e, t, n = {}) {
2109
- return Object.entries(e).filter(([, a]) => a === !0).reduce((a, [o]) => (n[o] ? a.push(n[o]) : t[_[o]] ? a.push(t[_[o]]) : t[X[o]] && a.push(t[X[o]]), a), [t[w.Day]]);
2110
- }
2111
- function Ha(e) {
2112
- return {
2113
- ...Ba,
2114
- ...e
2115
- };
2116
- }
2117
- function qa(e) {
2118
- const t = {
2119
- "data-mode": e.mode ?? void 0,
2120
- "data-required": "required" in e ? e.required : void 0,
2121
- "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
2122
- "data-week-numbers": e.showWeekNumber || void 0,
2123
- "data-broadcast-calendar": e.broadcastCalendar || void 0,
2124
- "data-nav-layout": e.navLayout || void 0
2125
- };
2126
- return Object.entries(e).forEach(([n, r]) => {
2127
- n.startsWith("data-") && (t[n] = r);
2128
- }), t;
2129
- }
2130
- function ja() {
2131
- const e = {};
2132
- for (const t in w)
2133
- e[w[t]] = `rdp-${w[t]}`;
2134
- for (const t in _)
2135
- e[_[t]] = `rdp-${_[t]}`;
2136
- for (const t in X)
2137
- e[X[t]] = `rdp-${X[t]}`;
2138
- for (const t in q)
2139
- e[q[t]] = `rdp-${q[t]}`;
2140
- return e;
2141
- }
2142
- function Gt(e, t, n) {
2143
- return (n ?? new j(t)).formatMonthYear(e);
2144
- }
2145
- const za = Gt;
2146
- function Ga(e, t, n) {
2147
- return (n ?? new j(t)).format(e, "d");
2148
- }
2149
- function $a(e, t = Z) {
2150
- return t.format(e, "LLLL");
2151
- }
2152
- function Ra(e, t, n) {
2153
- return (n ?? new j(t)).format(e, "cccccc");
2154
- }
2155
- function Va(e, t = Z) {
2156
- return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
2157
- }
2158
- function Ua() {
2159
- return "";
2160
- }
2161
- function $t(e, t = Z) {
2162
- return t.format(e, "yyyy");
2163
- }
2164
- const Qa = $t, Xa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2165
- __proto__: null,
2166
- formatCaption: Gt,
2167
- formatDay: Ga,
2168
- formatMonthCaption: za,
2169
- formatMonthDropdown: $a,
2170
- formatWeekNumber: Va,
2171
- formatWeekNumberHeader: Ua,
2172
- formatWeekdayName: Ra,
2173
- formatYearCaption: Qa,
2174
- formatYearDropdown: $t
2175
- }, Symbol.toStringTag, { value: "Module" }));
2176
- function Ka(e) {
2177
- return e != null && e.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e != null && e.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
2178
- ...Xa,
2179
- ...e
2180
- };
2181
- }
2182
- function nt(e, t, n, r) {
2183
- let a = (r ?? new j(n)).format(e, "PPPP");
2184
- return t.today && (a = `Today, ${a}`), t.selected && (a = `${a}, selected`), a;
2185
- }
2186
- const Ja = nt;
2187
- function rt(e, t, n) {
2188
- return (n ?? new j(t)).formatMonthYear(e);
2189
- }
2190
- const Za = rt;
2191
- function Rt(e, t, n, r) {
2192
- let a = (r ?? new j(n)).format(e, "PPPP");
2193
- return t != null && t.today && (a = `Today, ${a}`), a;
2194
- }
2195
- function Vt(e) {
2196
- return "Choose the Month";
2197
- }
2198
- function Ut() {
2199
- return "";
2200
- }
2201
- const La = "Go to the Next Month";
2202
- function Qt(e, t) {
2203
- return La;
2204
- }
2205
- function Xt(e) {
2206
- return "Go to the Previous Month";
2207
- }
2208
- function Kt(e, t, n) {
2209
- return (n ?? new j(t)).format(e, "cccc");
2210
- }
2211
- function Jt(e, t) {
2212
- return `Week ${e}`;
2213
- }
2214
- function Zt(e) {
2215
- return "Week Number";
2216
- }
2217
- function Lt(e) {
2218
- return "Choose the Year";
2219
- }
2220
- const eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2221
- __proto__: null,
2222
- labelCaption: Za,
2223
- labelDay: Ja,
2224
- labelDayButton: nt,
2225
- labelGrid: rt,
2226
- labelGridcell: Rt,
2227
- labelMonthDropdown: Vt,
2228
- labelNav: Ut,
2229
- labelNext: Qt,
2230
- labelPrevious: Xt,
2231
- labelWeekNumber: Jt,
2232
- labelWeekNumberHeader: Zt,
2233
- labelWeekday: Kt,
2234
- labelYearDropdown: Lt
2235
- }, Symbol.toStringTag, { value: "Module" })), Q = (e, t, n) => t || (n ? typeof n == "function" ? n : (...r) => n : e);
2236
- function to(e, t) {
2237
- var r;
2238
- const n = ((r = t.locale) == null ? void 0 : r.labels) ?? {};
2239
- return {
2240
- ...eo,
2241
- ...e ?? {},
2242
- labelDayButton: Q(nt, e == null ? void 0 : e.labelDayButton, n.labelDayButton),
2243
- labelMonthDropdown: Q(Vt, e == null ? void 0 : e.labelMonthDropdown, n.labelMonthDropdown),
2244
- labelNext: Q(Qt, e == null ? void 0 : e.labelNext, n.labelNext),
2245
- labelPrevious: Q(Xt, e == null ? void 0 : e.labelPrevious, n.labelPrevious),
2246
- labelWeekNumber: Q(Jt, e == null ? void 0 : e.labelWeekNumber, n.labelWeekNumber),
2247
- labelYearDropdown: Q(Lt, e == null ? void 0 : e.labelYearDropdown, n.labelYearDropdown),
2248
- labelGrid: Q(rt, e == null ? void 0 : e.labelGrid, n.labelGrid),
2249
- labelGridcell: Q(Rt, e == null ? void 0 : e.labelGridcell, n.labelGridcell),
2250
- labelNav: Q(Ut, e == null ? void 0 : e.labelNav, n.labelNav),
2251
- labelWeekNumberHeader: Q(Zt, e == null ? void 0 : e.labelWeekNumberHeader, n.labelWeekNumberHeader),
2252
- labelWeekday: Q(Kt, e == null ? void 0 : e.labelWeekday, n.labelWeekday)
2253
- };
2254
- }
2255
- function no(e, t, n, r, a) {
2256
- const { startOfMonth: o, startOfYear: s, endOfYear: i, eachMonthOfInterval: c, getMonth: u } = a;
2257
- return c({
2258
- start: s(e),
2259
- end: i(e)
2260
- }).map((h) => {
2261
- const y = r.formatMonthDropdown(h, a), D = u(h), W = t && h < o(t) || n && h > o(n) || !1;
2262
- return { value: D, label: y, disabled: W };
2263
- });
2264
- }
2265
- function ro(e, t = {}, n = {}) {
2266
- let r = { ...t == null ? void 0 : t[w.Day] };
2267
- return Object.entries(e).filter(([, a]) => a === !0).forEach(([a]) => {
2268
- r = {
2269
- ...r,
2270
- ...n == null ? void 0 : n[a]
2271
- };
2272
- }), r;
2273
- }
2274
- function ao(e, t, n, r) {
2275
- const a = r ?? e.today(), o = n ? e.startOfBroadcastWeek(a, e) : t ? e.startOfISOWeek(a) : e.startOfWeek(a), s = [];
2276
- for (let i = 0; i < 7; i++) {
2277
- const c = e.addDays(o, i);
2278
- s.push(c);
2279
- }
2280
- return s;
2281
- }
2282
- function oo(e, t, n, r, a = !1) {
2283
- if (!e || !t)
2284
- return;
2285
- const { startOfYear: o, endOfYear: s, eachYearOfInterval: i, getYear: c } = r, u = o(e), d = s(t), f = i({ start: u, end: d });
2286
- return a && f.reverse(), f.map((h) => {
2287
- const y = n.formatYearDropdown(h, r);
2288
- return {
2289
- value: c(h),
2290
- label: y,
2291
- disabled: !1
2292
- };
2293
- });
2294
- }
2295
- function so(e, t = {}) {
2296
- var i;
2297
- const { weekStartsOn: n, locale: r } = t, a = n ?? ((i = r == null ? void 0 : r.options) == null ? void 0 : i.weekStartsOn) ?? 0, o = (c) => {
2298
- const u = typeof c == "number" || typeof c == "string" ? new Date(c) : c;
2299
- return new A(u.getFullYear(), u.getMonth(), u.getDate(), 12, 0, 0, e);
2300
- }, s = (c) => {
2301
- const u = o(c);
2302
- return new Date(u.getFullYear(), u.getMonth(), u.getDate(), 0, 0, 0, 0);
2303
- };
2304
- return {
2305
- today: () => o(A.tz(e)),
2306
- newDate: (c, u, d) => new A(c, u, d, 12, 0, 0, e),
2307
- startOfDay: (c) => o(c),
2308
- startOfWeek: (c, u) => {
2309
- const d = o(c), f = (u == null ? void 0 : u.weekStartsOn) ?? a, h = (d.getDay() - f + 7) % 7;
2310
- return d.setDate(d.getDate() - h), d;
2311
- },
2312
- startOfISOWeek: (c) => {
2313
- const u = o(c), d = (u.getDay() - 1 + 7) % 7;
2314
- return u.setDate(u.getDate() - d), u;
2315
- },
2316
- startOfMonth: (c) => {
2317
- const u = o(c);
2318
- return u.setDate(1), u;
2319
- },
2320
- startOfYear: (c) => {
2321
- const u = o(c);
2322
- return u.setMonth(0, 1), u;
2323
- },
2324
- endOfWeek: (c, u) => {
2325
- const d = o(c), y = ((((u == null ? void 0 : u.weekStartsOn) ?? a) + 6) % 7 - d.getDay() + 7) % 7;
2326
- return d.setDate(d.getDate() + y), d;
2327
- },
2328
- endOfISOWeek: (c) => {
2329
- const u = o(c), d = (7 - u.getDay()) % 7;
2330
- return u.setDate(u.getDate() + d), u;
2331
- },
2332
- endOfMonth: (c) => {
2333
- const u = o(c);
2334
- return u.setMonth(u.getMonth() + 1, 0), u;
2335
- },
2336
- endOfYear: (c) => {
2337
- const u = o(c);
2338
- return u.setMonth(11, 31), u;
2339
- },
2340
- eachMonthOfInterval: (c) => {
2341
- const u = o(c.start), d = o(c.end), f = [], h = new A(u.getFullYear(), u.getMonth(), 1, 12, 0, 0, e), y = d.getFullYear() * 12 + d.getMonth();
2342
- for (; h.getFullYear() * 12 + h.getMonth() <= y; )
2343
- f.push(new A(h, e)), h.setMonth(h.getMonth() + 1, 1);
2344
- return f;
2345
- },
2346
- // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
2347
- // mutate the same TZDate, and return it.
2348
- addDays: (c, u) => {
2349
- const d = o(c);
2350
- return d.setDate(d.getDate() + u), d;
2351
- },
2352
- addWeeks: (c, u) => {
2353
- const d = o(c);
2354
- return d.setDate(d.getDate() + u * 7), d;
2355
- },
2356
- addMonths: (c, u) => {
2357
- const d = o(c);
2358
- return d.setMonth(d.getMonth() + u), d;
2359
- },
2360
- addYears: (c, u) => {
2361
- const d = o(c);
2362
- return d.setFullYear(d.getFullYear() + u), d;
2363
- },
2364
- eachYearOfInterval: (c) => {
2365
- const u = o(c.start), d = o(c.end), f = [], h = new A(u.getFullYear(), 0, 1, 12, 0, 0, e);
2366
- for (; h.getFullYear() <= d.getFullYear(); )
2367
- f.push(new A(h, e)), h.setFullYear(h.getFullYear() + 1, 0, 1);
2368
- return f;
2369
- },
2370
- getWeek: (c, u) => {
2371
- var f;
2372
- const d = s(c);
2373
- return Ze(d, {
2374
- weekStartsOn: (u == null ? void 0 : u.weekStartsOn) ?? a,
2375
- firstWeekContainsDate: (u == null ? void 0 : u.firstWeekContainsDate) ?? ((f = r == null ? void 0 : r.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1
2376
- });
2377
- },
2378
- getISOWeek: (c) => {
2379
- const u = s(c);
2380
- return Je(u);
2381
- },
2382
- differenceInCalendarDays: (c, u) => {
2383
- const d = s(c), f = s(u);
2384
- return Ke(d, f);
2385
- },
2386
- differenceInCalendarMonths: (c, u) => {
2387
- const d = s(c), f = s(u);
2388
- return Tt(d, f);
2389
- }
2390
- };
2391
- }
2392
- const De = (e) => e instanceof HTMLElement ? e : null, ze = (e) => [
2393
- ...e.querySelectorAll("[data-animated-month]") ?? []
2394
- ], io = (e) => De(e.querySelector("[data-animated-month]")), Ge = (e) => De(e.querySelector("[data-animated-caption]")), $e = (e) => De(e.querySelector("[data-animated-weeks]")), co = (e) => De(e.querySelector("[data-animated-nav]")), uo = (e) => De(e.querySelector("[data-animated-weekdays]"));
2395
- function fo(e, t, { classNames: n, months: r, focused: a, dateLib: o }) {
2396
- const s = Ce(null), i = Ce(r), c = Ce(!1);
2397
- Pn(() => {
2398
- const u = i.current;
2399
- if (i.current = r, !t || !e.current || // safety check because the ref can be set to anything by consumers
2400
- !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
2401
- r.length === 0 || u.length === 0 || r.length !== u.length)
2402
- return;
2403
- const d = o.isSameMonth(r[0].date, u[0].date), f = o.isAfter(r[0].date, u[0].date), h = f ? n[q.caption_after_enter] : n[q.caption_before_enter], y = f ? n[q.weeks_after_enter] : n[q.weeks_before_enter], D = s.current, W = e.current.cloneNode(!0);
2404
- if (W instanceof HTMLElement ? (ze(W).forEach((g) => {
2405
- if (!(g instanceof HTMLElement))
2406
- return;
2407
- const S = io(g);
2408
- S && g.contains(S) && g.removeChild(S);
2409
- const k = Ge(g);
2410
- k && k.classList.remove(h);
2411
- const l = $e(g);
2412
- l && l.classList.remove(y);
2413
- }), s.current = W) : 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
2414
- a)
2415
- return;
2416
- const v = D instanceof HTMLElement ? ze(D) : [], C = ze(e.current);
2417
- if (C != null && C.every((M) => M instanceof HTMLElement) && v && v.every((M) => M instanceof HTMLElement)) {
2418
- c.current = !0, e.current.style.isolation = "isolate";
2419
- const M = co(e.current);
2420
- M && (M.style.zIndex = "1"), C.forEach((g, S) => {
2421
- const k = v[S];
2422
- if (!k)
2423
- return;
2424
- g.style.position = "relative", g.style.overflow = "hidden";
2425
- const l = Ge(g);
2426
- l && l.classList.add(h);
2427
- const p = $e(g);
2428
- p && p.classList.add(y);
2429
- const E = () => {
2430
- c.current = !1, e.current && (e.current.style.isolation = ""), M && (M.style.zIndex = ""), l && l.classList.remove(h), p && p.classList.remove(y), g.style.position = "", g.style.overflow = "", g.contains(k) && g.removeChild(k);
2431
- };
2432
- k.style.pointerEvents = "none", k.style.position = "absolute", k.style.overflow = "hidden", k.setAttribute("aria-hidden", "true");
2433
- const B = uo(k);
2434
- B && (B.style.opacity = "0");
2435
- const F = Ge(k);
2436
- F && (F.classList.add(f ? n[q.caption_before_exit] : n[q.caption_after_exit]), F.addEventListener("animationend", E));
2437
- const z = $e(k);
2438
- z && z.classList.add(f ? n[q.weeks_before_exit] : n[q.weeks_after_exit]), g.insertBefore(k, g.firstChild);
2439
- });
2440
- }
2441
- });
2442
- }
2443
- function lo(e, t, n, r) {
2444
- const a = e[0], o = e[e.length - 1], { ISOWeek: s, fixedWeeks: i, broadcastCalendar: c } = n ?? {}, { addDays: u, differenceInCalendarDays: d, differenceInCalendarMonths: f, endOfBroadcastWeek: h, endOfISOWeek: y, endOfMonth: D, endOfWeek: W, isAfter: v, startOfBroadcastWeek: C, startOfISOWeek: M, startOfWeek: g } = r, S = c ? C(a, r) : s ? M(a) : g(a), k = c ? h(o) : s ? y(D(o)) : W(D(o)), l = t && (c ? h(t) : s ? y(t) : W(t)), p = l && v(k, l) ? l : k, E = d(p, S), B = f(o, a) + 1, F = [];
2445
- for (let L = 0; L <= E; L++) {
2446
- const G = u(S, L);
2447
- F.push(G);
2448
- }
2449
- const re = (c ? 35 : 42) * B;
2450
- if (i && F.length < re) {
2451
- const L = re - F.length;
2452
- for (let G = 0; G < L; G++) {
2453
- const ce = u(F[F.length - 1], 1);
2454
- F.push(ce);
2455
- }
2456
- }
2457
- return F;
2458
- }
2459
- function ho(e) {
2460
- const t = [];
2461
- return e.reduce((n, r) => {
2462
- const a = r.weeks.reduce((o, s) => o.concat(s.days.slice()), t.slice());
2463
- return n.concat(a.slice());
2464
- }, t.slice());
2465
- }
2466
- function mo(e, t, n, r) {
2467
- const { numberOfMonths: a = 1 } = n, o = [];
2468
- for (let s = 0; s < a; s++) {
2469
- const i = r.addMonths(e, s);
2470
- if (t && i > t)
2471
- break;
2472
- o.push(i);
2473
- }
2474
- return o;
2475
- }
2476
- function bt(e, t, n, r) {
2477
- const { month: a, defaultMonth: o, today: s = r.today(), numberOfMonths: i = 1 } = e;
2478
- let c = a || o || s;
2479
- const { differenceInCalendarMonths: u, addMonths: d, startOfMonth: f } = r;
2480
- if (n && u(n, c) < i - 1) {
2481
- const h = -1 * (i - 1);
2482
- c = d(n, h);
2483
- }
2484
- return t && u(c, t) < 0 && (c = t), f(c);
2485
- }
2486
- function yo(e, t, n, r) {
2487
- const { addDays: a, endOfBroadcastWeek: o, endOfISOWeek: s, endOfMonth: i, endOfWeek: c, getISOWeek: u, getWeek: d, startOfBroadcastWeek: f, startOfISOWeek: h, startOfWeek: y } = r, D = e.reduce((W, v) => {
2488
- const C = n.broadcastCalendar ? f(v, r) : n.ISOWeek ? h(v) : y(v), M = n.broadcastCalendar ? o(v) : n.ISOWeek ? s(i(v)) : c(i(v)), g = t.filter((p) => p >= C && p <= M), S = n.broadcastCalendar ? 35 : 42;
2489
- if (n.fixedWeeks && g.length < S) {
2490
- const p = t.filter((E) => {
2491
- const B = S - g.length;
2492
- return E > M && E <= a(M, B);
2493
- });
2494
- g.push(...p);
2495
- }
2496
- const k = g.reduce((p, E) => {
2497
- const B = n.ISOWeek ? u(E) : d(E), F = p.find((re) => re.weekNumber === B), z = new Ht(E, v, r);
2498
- return F ? F.days.push(z) : p.push(new ua(B, [z])), p;
2499
- }, []), l = new ca(v, k);
2500
- return W.push(l), W;
2501
- }, []);
2502
- return n.reverseMonths ? D.reverse() : D;
2503
- }
2504
- function go(e, t) {
2505
- let { startMonth: n, endMonth: r } = e;
2506
- const { startOfYear: a, startOfDay: o, startOfMonth: s, endOfMonth: i, addYears: c, endOfYear: u, newDate: d, today: f } = t, { fromYear: h, toYear: y, fromMonth: D, toMonth: W } = e;
2507
- !n && D && (n = D), !n && h && (n = t.newDate(h, 0, 1)), !r && W && (r = W), !r && y && (r = d(y, 11, 31));
2508
- const v = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
2509
- return n ? n = s(n) : h ? n = d(h, 0, 1) : !n && v && (n = a(c(e.today ?? f(), -100))), r ? r = i(r) : y ? r = d(y, 11, 31) : !r && v && (r = u(e.today ?? f())), [
2510
- n && o(n),
2511
- r && o(r)
2512
- ];
2513
- }
2514
- function Mo(e, t, n, r) {
2515
- if (n.disableNavigation)
2516
- return;
2517
- const { pagedNavigation: a, numberOfMonths: o = 1 } = n, { startOfMonth: s, addMonths: i, differenceInCalendarMonths: c } = r, u = a ? o : 1, d = s(e);
2518
- if (!t)
2519
- return i(d, u);
2520
- if (!(c(t, e) < o))
2521
- return i(d, u);
2522
- }
2523
- function wo(e, t, n, r) {
2524
- if (n.disableNavigation)
2525
- return;
2526
- const { pagedNavigation: a, numberOfMonths: o } = n, { startOfMonth: s, addMonths: i, differenceInCalendarMonths: c } = r, u = a ? o ?? 1 : 1, d = s(e);
2527
- if (!t)
2528
- return i(d, -u);
2529
- if (!(c(d, t) <= 0))
2530
- return i(d, -u);
2531
- }
2532
- function bo(e) {
2533
- const t = [];
2534
- return e.reduce((n, r) => n.concat(r.weeks.slice()), t.slice());
2535
- }
2536
- function Pe(e, t) {
2537
- const [n, r] = Ye(e);
2538
- return [t === void 0 ? n : t, r];
2539
- }
2540
- function ko(e, t) {
2541
- var S;
2542
- const [n, r] = go(e, t), { startOfMonth: a, endOfMonth: o } = t, s = bt(e, n, r, t), [i, c] = Pe(
2543
- s,
2544
- // initialMonth is always computed from props.month if provided
2545
- e.month ? s : void 0
2546
- );
2547
- Wt(() => {
2548
- const k = bt(e, n, r, t);
2549
- c(k);
2550
- }, [e.timeZone]);
2551
- const { months: u, weeks: d, days: f, previousMonth: h, nextMonth: y } = Ne(() => {
2552
- const k = mo(i, r, { numberOfMonths: e.numberOfMonths }, t), l = lo(k, e.endMonth ? o(e.endMonth) : void 0, {
2553
- ISOWeek: e.ISOWeek,
2554
- fixedWeeks: e.fixedWeeks,
2555
- broadcastCalendar: e.broadcastCalendar
2556
- }, t), p = yo(k, l, {
2557
- broadcastCalendar: e.broadcastCalendar,
2558
- fixedWeeks: e.fixedWeeks,
2559
- ISOWeek: e.ISOWeek,
2560
- reverseMonths: e.reverseMonths
2561
- }, t), E = bo(p), B = ho(p), F = wo(i, n, e, t), z = Mo(i, r, e, t);
2562
- return {
2563
- months: p,
2564
- weeks: E,
2565
- days: B,
2566
- previousMonth: F,
2567
- nextMonth: z
2568
- };
2569
- }, [
2570
- t,
2571
- i.getTime(),
2572
- r == null ? void 0 : r.getTime(),
2573
- n == null ? void 0 : n.getTime(),
2574
- e.disableNavigation,
2575
- e.broadcastCalendar,
2576
- (S = e.endMonth) == null ? void 0 : S.getTime(),
2577
- e.fixedWeeks,
2578
- e.ISOWeek,
2579
- e.numberOfMonths,
2580
- e.pagedNavigation,
2581
- e.reverseMonths
2582
- ]), { disableNavigation: D, onMonthChange: W } = e, v = (k) => d.some((l) => l.days.some((p) => p.isEqualTo(k))), C = (k) => {
2583
- if (D)
2584
- return;
2585
- let l = a(k);
2586
- n && l < a(n) && (l = a(n)), r && l > a(r) && (l = a(r)), c(l), W == null || W(l);
2587
- };
2588
- return {
2589
- months: u,
2590
- weeks: d,
2591
- days: f,
2592
- navStart: n,
2593
- navEnd: r,
2594
- previousMonth: h,
2595
- nextMonth: y,
2596
- goToMonth: C,
2597
- goToDay: (k) => {
2598
- v(k) || C(k.date);
2599
- }
2600
- };
2601
- }
2602
- var K;
2603
- (function(e) {
2604
- e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
2605
- })(K || (K = {}));
2606
- function kt(e) {
2607
- return !e[_.disabled] && !e[_.hidden] && !e[_.outside];
2608
- }
2609
- function vo(e, t, n, r) {
2610
- let a, o = -1;
2611
- for (const s of e) {
2612
- const i = t(s);
2613
- kt(i) && (i[_.focused] && o < K.FocusedModifier ? (a = s, o = K.FocusedModifier) : r != null && r.isEqualTo(s) && o < K.LastFocused ? (a = s, o = K.LastFocused) : n(s.date) && o < K.Selected ? (a = s, o = K.Selected) : i[_.today] && o < K.Today && (a = s, o = K.Today));
2614
- }
2615
- return a || (a = e.find((s) => kt(t(s)))), a;
2616
- }
2617
- function Do(e, t, n, r, a, o, s) {
2618
- const { ISOWeek: i, broadcastCalendar: c } = o, { addDays: u, addMonths: d, addWeeks: f, addYears: h, endOfBroadcastWeek: y, endOfISOWeek: D, endOfWeek: W, max: v, min: C, startOfBroadcastWeek: M, startOfISOWeek: g, startOfWeek: S } = s;
2619
- let l = {
2620
- day: u,
2621
- week: f,
2622
- month: d,
2623
- year: h,
2624
- startOfWeek: (p) => c ? M(p, s) : i ? g(p) : S(p),
2625
- endOfWeek: (p) => c ? y(p) : i ? D(p) : W(p)
2626
- }[e](n, t === "after" ? 1 : -1);
2627
- return t === "before" && r ? l = v([r, l]) : t === "after" && a && (l = C([a, l])), l;
2628
- }
2629
- function en(e, t, n, r, a, o, s, i = 0) {
2630
- if (i > 365)
2631
- return;
2632
- const c = Do(e, t, n.date, r, a, o, s), u = !!(o.disabled && ne(c, o.disabled, s)), d = !!(o.hidden && ne(c, o.hidden, s)), f = c, h = new Ht(c, f, s);
2633
- return !u && !d ? h : en(e, t, h, r, a, o, s, i + 1);
2634
- }
2635
- function Oo(e, t, n, r, a) {
2636
- const { autoFocus: o } = e, [s, i] = Ye(), c = vo(t.days, n, r || (() => !1), s), [u, d] = Ye(o ? c : void 0);
2637
- return {
2638
- isFocusTarget: (W) => !!(c != null && c.isEqualTo(W)),
2639
- setFocused: d,
2640
- focused: u,
2641
- blur: () => {
2642
- i(u), d(void 0);
2643
- },
2644
- moveFocus: (W, v) => {
2645
- if (!u)
2646
- return;
2647
- const C = en(W, v, u, t.navStart, t.navEnd, e, a);
2648
- C && (e.disableNavigation && !t.days.some((g) => g.isEqualTo(C)) || (t.goToDay(C), d(C)));
2649
- }
2650
- };
2651
- }
2652
- function Wo(e, t) {
2653
- const { selected: n, required: r, onSelect: a } = e, [o, s] = Pe(n, a ? n : void 0), i = a ? n : o, { isSameDay: c } = t, u = (y) => (i == null ? void 0 : i.some((D) => c(D, y))) ?? !1, { min: d, max: f } = e;
2654
- return {
2655
- selected: i,
2656
- select: (y, D, W) => {
2657
- let v = [...i ?? []];
2658
- if (u(y)) {
2659
- if ((i == null ? void 0 : i.length) === d || r && (i == null ? void 0 : i.length) === 1)
2660
- return;
2661
- v = i == null ? void 0 : i.filter((C) => !c(C, y));
2662
- } else
2663
- (i == null ? void 0 : i.length) === f ? v = [y] : v = [...v, y];
2664
- return a || s(v), a == null || a(v, y, D, W), v;
2665
- },
2666
- isSelected: u
2667
- };
2668
- }
2669
- function So(e, t, n = 0, r = 0, a = !1, o = Z) {
2670
- const { from: s, to: i } = t || {}, { isSameDay: c, isAfter: u, isBefore: d } = o;
2671
- let f;
2672
- if (!s && !i)
2673
- f = { from: e, to: n > 0 ? void 0 : e };
2674
- else if (s && !i)
2675
- c(s, e) ? n === 0 ? f = { from: s, to: e } : a ? f = { from: s, to: void 0 } : f = void 0 : d(e, s) ? f = { from: e, to: s } : f = { from: s, to: e };
2676
- else if (s && i)
2677
- if (c(s, e) && c(i, e))
2678
- a ? f = { from: s, to: i } : f = void 0;
2679
- else if (c(s, e))
2680
- f = { from: s, to: n > 0 ? void 0 : e };
2681
- else if (c(i, e))
2682
- f = { from: e, to: n > 0 ? void 0 : e };
2683
- else if (d(e, s))
2684
- f = { from: e, to: i };
2685
- else if (u(e, s))
2686
- f = { from: s, to: e };
2687
- else if (u(e, i))
2688
- f = { from: s, to: e };
2689
- else
2690
- throw new Error("Invalid range");
2691
- if (f != null && f.from && (f != null && f.to)) {
2692
- const h = o.differenceInCalendarDays(f.to, f.from);
2693
- r > 0 && h > r ? f = { from: e, to: void 0 } : n > 1 && h < n && (f = { from: e, to: void 0 });
2694
- }
2695
- return f;
2696
- }
2697
- function po(e, t, n = Z) {
2698
- const r = Array.isArray(t) ? t : [t];
2699
- let a = e.from;
2700
- const o = n.differenceInCalendarDays(e.to, e.from), s = Math.min(o, 6);
2701
- for (let i = 0; i <= s; i++) {
2702
- if (r.includes(a.getDay()))
2703
- return !0;
2704
- a = n.addDays(a, 1);
2705
- }
2706
- return !1;
2707
- }
2708
- function vt(e, t, n = Z) {
2709
- return te(e, t.from, !1, n) || te(e, t.to, !1, n) || te(t, e.from, !1, n) || te(t, e.to, !1, n);
2710
- }
2711
- function Co(e, t, n = Z) {
2712
- const r = Array.isArray(t) ? t : [t];
2713
- if (r.filter((i) => typeof i != "function").some((i) => typeof i == "boolean" ? i : n.isDate(i) ? te(e, i, !1, n) : zt(i, n) ? i.some((c) => te(e, c, !1, n)) : Te(i) ? i.from && i.to ? vt(e, { from: i.from, to: i.to }, n) : !1 : jt(i) ? po(e, i.dayOfWeek, n) : Le(i) ? n.isAfter(i.before, i.after) ? vt(e, {
2714
- from: n.addDays(i.after, 1),
2715
- to: n.addDays(i.before, -1)
2716
- }, n) : ne(e.from, i, n) || ne(e.to, i, n) : et(i) || tt(i) ? ne(e.from, i, n) || ne(e.to, i, n) : !1))
2717
- return !0;
2718
- const s = r.filter((i) => typeof i == "function");
2719
- if (s.length) {
2720
- let i = e.from;
2721
- const c = n.differenceInCalendarDays(e.to, e.from);
2722
- for (let u = 0; u <= c; u++) {
2723
- if (s.some((d) => d(i)))
2724
- return !0;
2725
- i = n.addDays(i, 1);
2726
- }
2727
- }
2728
- return !1;
2729
- }
2730
- function No(e, t) {
2731
- const { disabled: n, excludeDisabled: r, resetOnSelect: a, selected: o, required: s, onSelect: i } = e, [c, u] = Pe(o, i ? o : void 0), d = i ? o : c;
2732
- return {
2733
- selected: d,
2734
- select: (y, D, W) => {
2735
- const { min: v, max: C } = e;
2736
- let M;
2737
- if (y) {
2738
- const g = d == null ? void 0 : d.from, S = d == null ? void 0 : d.to, k = !!g && !!S, l = !!g && !!S && t.isSameDay(g, S) && t.isSameDay(y, g);
2739
- a && (k || !(d != null && d.from)) ? !s && l ? M = void 0 : M = { from: y, to: void 0 } : M = So(y, d, v, C, s, t);
2740
- }
2741
- return r && n && (M != null && M.from) && M.to && Co({ from: M.from, to: M.to }, n, t) && (M.from = y, M.to = void 0), i || u(M), i == null || i(M, y, D, W), M;
2742
- },
2743
- isSelected: (y) => d && te(d, y, !1, t)
2744
- };
2745
- }
2746
- function Yo(e, t) {
2747
- const { selected: n, required: r, onSelect: a } = e, [o, s] = Pe(n, a ? n : void 0), i = a ? n : o, { isSameDay: c } = t;
2748
- return {
2749
- selected: i,
2750
- select: (f, h, y) => {
2751
- let D = f;
2752
- return !r && i && i && c(f, i) && (D = void 0), a || s(D), a == null || a(D, f, h, y), D;
2753
- },
2754
- isSelected: (f) => i ? c(i, f) : !1
2755
- };
2756
- }
2757
- function xo(e, t) {
2758
- const n = Yo(e, t), r = Wo(e, t), a = No(e, t);
2759
- switch (e.mode) {
2760
- case "single":
2761
- return n;
2762
- case "multiple":
2763
- return r;
2764
- case "range":
2765
- return a;
2766
- default:
2767
- return;
2768
- }
2769
- }
2770
- function R(e, t) {
2771
- return e instanceof A && e.timeZone === t ? e : new A(e, t);
2772
- }
2773
- function de(e, t, n) {
2774
- return R(e, t);
2775
- }
2776
- function Dt(e, t, n) {
2777
- return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? de(e, t) : Array.isArray(e) ? e.map((r) => r instanceof Date ? de(r, t) : r) : Te(e) ? {
2778
- ...e,
2779
- from: e.from ? R(e.from, t) : e.from,
2780
- to: e.to ? R(e.to, t) : e.to
2781
- } : Le(e) ? {
2782
- before: de(e.before, t),
2783
- after: de(e.after, t)
2784
- } : et(e) ? {
2785
- after: de(e.after, t)
2786
- } : tt(e) ? {
2787
- before: de(e.before, t)
2788
- } : e;
2789
- }
2790
- function Re(e, t, n) {
2791
- return e && (Array.isArray(e) ? e.map((r) => Dt(r, t)) : Dt(e, t));
2792
- }
2793
- function qo(e) {
2794
- var ut;
2795
- let t = e;
2796
- const n = t.timeZone;
2797
- if (n && (t = {
2798
- ...e,
2799
- timeZone: n
2800
- }, t.today && (t.today = R(t.today, n)), t.month && (t.month = R(t.month, n)), t.defaultMonth && (t.defaultMonth = R(t.defaultMonth, n)), t.startMonth && (t.startMonth = R(t.startMonth, n)), t.endMonth && (t.endMonth = R(t.endMonth, n)), t.mode === "single" && t.selected ? t.selected = R(t.selected, n) : t.mode === "multiple" && t.selected ? t.selected = (ut = t.selected) == null ? void 0 : ut.map((O) => R(O, n)) : t.mode === "range" && t.selected && (t.selected = {
2801
- from: t.selected.from ? R(t.selected.from, n) : t.selected.from,
2802
- to: t.selected.to ? R(t.selected.to, n) : t.selected.to
2803
- }), t.disabled !== void 0 && (t.disabled = Re(t.disabled, n)), t.hidden !== void 0 && (t.hidden = Re(t.hidden, n)), t.modifiers)) {
2804
- const O = {};
2805
- Object.keys(t.modifiers).forEach((x) => {
2806
- var b;
2807
- O[x] = Re((b = t.modifiers) == null ? void 0 : b[x], n);
2808
- }), t.modifiers = O;
2809
- }
2810
- const { components: r, formatters: a, labels: o, dateLib: s, locale: i, classNames: c } = Ne(() => {
2811
- const O = { ...At, ...t.locale }, x = t.broadcastCalendar ? 1 : t.weekStartsOn, b = t.noonSafe && t.timeZone ? so(t.timeZone, {
2812
- weekStartsOn: x,
2813
- locale: O
2814
- }) : void 0, Y = t.dateLib && b ? { ...b, ...t.dateLib } : t.dateLib ?? b, H = new j({
2815
- locale: O,
2816
- weekStartsOn: x,
2817
- firstWeekContainsDate: t.firstWeekContainsDate,
2818
- useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
2819
- useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
2820
- timeZone: t.timeZone,
2821
- numerals: t.numerals
2822
- }, Y);
2823
- return {
2824
- dateLib: H,
2825
- components: Ha(t.components),
2826
- formatters: Ka(t.formatters),
2827
- labels: to(t.labels, H.options),
2828
- locale: O,
2829
- classNames: { ...ja(), ...t.classNames }
2830
- };
2831
- }, [
2832
- t.locale,
2833
- t.broadcastCalendar,
2834
- t.weekStartsOn,
2835
- t.firstWeekContainsDate,
2836
- t.useAdditionalWeekYearTokens,
2837
- t.useAdditionalDayOfYearTokens,
2838
- t.timeZone,
2839
- t.numerals,
2840
- t.dateLib,
2841
- t.noonSafe,
2842
- t.components,
2843
- t.formatters,
2844
- t.labels,
2845
- t.classNames
2846
- ]);
2847
- t.today || (t = { ...t, today: s.today() });
2848
- const { captionLayout: u, mode: d, navLayout: f, numberOfMonths: h = 1, onDayBlur: y, onDayClick: D, onDayFocus: W, onDayKeyDown: v, onDayMouseEnter: C, onDayMouseLeave: M, onNextClick: g, onPrevClick: S, showWeekNumber: k, styles: l } = t, { formatCaption: p, formatDay: E, formatMonthDropdown: B, formatWeekNumber: F, formatWeekNumberHeader: z, formatWeekdayName: re, formatYearDropdown: L } = a, G = ko(t, s), { days: ce, months: Oe, navStart: Ee, navEnd: _e, previousMonth: V, nextMonth: U, goToMonth: ee } = G, Fe = Ia(ce, t, Ee, _e, s), { isSelected: le, select: he, selected: We } = xo(t, s) ?? {}, { blur: at, focused: Se, isFocusTarget: tn, moveFocus: ot, setFocused: pe } = Oo(t, G, Fe, le ?? (() => !1), s), { labelDayButton: nn, labelGridcell: rn, labelGrid: an, labelMonthDropdown: on, labelNav: st, labelPrevious: sn, labelNext: cn, labelWeekday: un, labelWeekNumber: dn, labelWeekNumberHeader: fn, labelYearDropdown: ln } = o, hn = Ne(() => ao(s, t.ISOWeek, t.broadcastCalendar, t.today), [s, t.ISOWeek, t.broadcastCalendar, t.today]), it = d !== void 0 || D !== void 0, Be = $(() => {
2849
- V && (ee(V), S == null || S(V));
2850
- }, [V, ee, S]), Ie = $(() => {
2851
- U && (ee(U), g == null || g(U));
2852
- }, [ee, U, g]), mn = $((O, x) => (b) => {
2853
- b.preventDefault(), b.stopPropagation(), pe(O), !x.disabled && (he == null || he(O.date, x, b), D == null || D(O.date, x, b));
2854
- }, [he, D, pe]), yn = $((O, x) => (b) => {
2855
- pe(O), W == null || W(O.date, x, b);
2856
- }, [W, pe]), gn = $((O, x) => (b) => {
2857
- at(), y == null || y(O.date, x, b);
2858
- }, [at, y]), Mn = $((O, x) => (b) => {
2859
- const Y = {
2860
- ArrowLeft: [
2861
- b.shiftKey ? "month" : "day",
2862
- t.dir === "rtl" ? "after" : "before"
2863
- ],
2864
- ArrowRight: [
2865
- b.shiftKey ? "month" : "day",
2866
- t.dir === "rtl" ? "before" : "after"
2867
- ],
2868
- ArrowDown: [b.shiftKey ? "year" : "week", "after"],
2869
- ArrowUp: [b.shiftKey ? "year" : "week", "before"],
2870
- PageUp: [b.shiftKey ? "year" : "month", "before"],
2871
- PageDown: [b.shiftKey ? "year" : "month", "after"],
2872
- Home: ["startOfWeek", "before"],
2873
- End: ["endOfWeek", "after"]
2874
- };
2875
- if (Y[b.key]) {
2876
- b.preventDefault(), b.stopPropagation();
2877
- const [H, N] = Y[b.key];
2878
- ot(H, N);
2879
- }
2880
- v == null || v(O.date, x, b);
2881
- }, [ot, v, t.dir]), wn = $((O, x) => (b) => {
2882
- C == null || C(O.date, x, b);
2883
- }, [C]), bn = $((O, x) => (b) => {
2884
- M == null || M(O.date, x, b);
2885
- }, [M]), kn = $((O) => (x) => {
2886
- const b = Number(x.target.value), Y = s.setMonth(s.startOfMonth(O), b);
2887
- ee(Y);
2888
- }, [s, ee]), vn = $((O) => (x) => {
2889
- const b = Number(x.target.value), Y = s.setYear(s.startOfMonth(O), b);
2890
- ee(Y);
2891
- }, [s, ee]), { className: Dn, style: On } = Ne(() => ({
2892
- className: [c[w.Root], t.className].filter(Boolean).join(" "),
2893
- style: { ...l == null ? void 0 : l[w.Root], ...t.style }
2894
- }), [c, t.className, t.style, l]), Wn = qa(t), ct = Ce(null);
2895
- fo(ct, !!t.animate, {
2896
- classNames: c,
2897
- months: Oe,
2898
- focused: Se,
2899
- dateLib: s
2900
- });
2901
- const Sn = {
2902
- dayPickerProps: t,
2903
- selected: We,
2904
- select: he,
2905
- isSelected: le,
2906
- months: Oe,
2907
- nextMonth: U,
2908
- previousMonth: V,
2909
- goToMonth: ee,
2910
- getModifiers: Fe,
2911
- components: r,
2912
- classNames: c,
2913
- styles: l,
2914
- labels: o,
2915
- formatters: a
2916
- };
2917
- return m.createElement(
2918
- qt.Provider,
2919
- { value: Sn },
2920
- m.createElement(
2921
- r.Root,
2922
- { rootRef: t.animate ? ct : void 0, className: Dn, style: On, dir: t.dir, id: t.id, lang: t.lang ?? i.code, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...Wn },
2923
- m.createElement(
2924
- r.Months,
2925
- { className: c[w.Months], style: l == null ? void 0 : l[w.Months] },
2926
- !t.hideNavigation && !f && m.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[w.Nav], style: l == null ? void 0 : l[w.Nav], "aria-label": st(), onPreviousClick: Be, onNextClick: Ie, previousMonth: V, nextMonth: U }),
2927
- Oe.map((O, x) => m.createElement(
2928
- r.Month,
2929
- {
2930
- "data-animated-month": t.animate ? "true" : void 0,
2931
- className: c[w.Month],
2932
- style: l == null ? void 0 : l[w.Month],
2933
- // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
2934
- key: x,
2935
- displayIndex: x,
2936
- calendarMonth: O
2937
- },
2938
- f === "around" && !t.hideNavigation && x === 0 && m.createElement(
2939
- r.PreviousMonthButton,
2940
- { type: "button", className: c[w.PreviousMonthButton], tabIndex: V ? void 0 : -1, "aria-disabled": V ? void 0 : !0, "aria-label": sn(V), onClick: Be, "data-animated-button": t.animate ? "true" : void 0 },
2941
- m.createElement(r.Chevron, { disabled: V ? void 0 : !0, className: c[w.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
2942
- ),
2943
- m.createElement(r.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: c[w.MonthCaption], style: l == null ? void 0 : l[w.MonthCaption], calendarMonth: O, displayIndex: x }, u != null && u.startsWith("dropdown") ? m.createElement(
2944
- r.DropdownNav,
2945
- { className: c[w.Dropdowns], style: l == null ? void 0 : l[w.Dropdowns] },
2946
- (() => {
2947
- const b = u === "dropdown" || u === "dropdown-months" ? m.createElement(r.MonthsDropdown, { key: "month", className: c[w.MonthsDropdown], "aria-label": on(), classNames: c, components: r, disabled: !!t.disableNavigation, onChange: kn(O.date), options: no(O.date, Ee, _e, a, s), style: l == null ? void 0 : l[w.Dropdown], value: s.getMonth(O.date) }) : m.createElement("span", { key: "month" }, B(O.date, s)), Y = u === "dropdown" || u === "dropdown-years" ? m.createElement(r.YearsDropdown, { key: "year", className: c[w.YearsDropdown], "aria-label": ln(s.options), classNames: c, components: r, disabled: !!t.disableNavigation, onChange: vn(O.date), options: oo(Ee, _e, a, s, !!t.reverseYears), style: l == null ? void 0 : l[w.Dropdown], value: s.getYear(O.date) }) : m.createElement("span", { key: "year" }, L(O.date, s));
2948
- return s.getMonthYearOrder() === "year-first" ? [Y, b] : [b, Y];
2949
- })(),
2950
- m.createElement("span", { role: "status", "aria-live": "polite", style: {
2951
- border: 0,
2952
- clip: "rect(0 0 0 0)",
2953
- height: "1px",
2954
- margin: "-1px",
2955
- overflow: "hidden",
2956
- padding: 0,
2957
- position: "absolute",
2958
- width: "1px",
2959
- whiteSpace: "nowrap",
2960
- wordWrap: "normal"
2961
- } }, p(O.date, s.options, s))
2962
- ) : m.createElement(r.CaptionLabel, { className: c[w.CaptionLabel], role: "status", "aria-live": "polite" }, p(O.date, s.options, s))),
2963
- f === "around" && !t.hideNavigation && x === h - 1 && m.createElement(
2964
- r.NextMonthButton,
2965
- { type: "button", className: c[w.NextMonthButton], tabIndex: U ? void 0 : -1, "aria-disabled": U ? void 0 : !0, "aria-label": cn(U), onClick: Ie, "data-animated-button": t.animate ? "true" : void 0 },
2966
- m.createElement(r.Chevron, { disabled: U ? void 0 : !0, className: c[w.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
2967
- ),
2968
- x === h - 1 && f === "after" && !t.hideNavigation && m.createElement(r.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: c[w.Nav], style: l == null ? void 0 : l[w.Nav], "aria-label": st(), onPreviousClick: Be, onNextClick: Ie, previousMonth: V, nextMonth: U }),
2969
- m.createElement(
2970
- r.MonthGrid,
2971
- { role: "grid", "aria-multiselectable": d === "multiple" || d === "range", "aria-label": an(O.date, s.options, s) || void 0, className: c[w.MonthGrid], style: l == null ? void 0 : l[w.MonthGrid] },
2972
- !t.hideWeekdays && m.createElement(
2973
- r.Weekdays,
2974
- { "data-animated-weekdays": t.animate ? "true" : void 0, className: c[w.Weekdays], style: l == null ? void 0 : l[w.Weekdays] },
2975
- k && m.createElement(r.WeekNumberHeader, { "aria-label": fn(s.options), className: c[w.WeekNumberHeader], style: l == null ? void 0 : l[w.WeekNumberHeader], scope: "col" }, z()),
2976
- hn.map((b) => m.createElement(r.Weekday, { "aria-label": un(b, s.options, s), className: c[w.Weekday], key: String(b), style: l == null ? void 0 : l[w.Weekday], scope: "col" }, re(b, s.options, s)))
2977
- ),
2978
- m.createElement(r.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: c[w.Weeks], style: l == null ? void 0 : l[w.Weeks] }, O.weeks.map((b) => m.createElement(
2979
- r.Week,
2980
- { className: c[w.Week], key: b.weekNumber, style: l == null ? void 0 : l[w.Week], week: b },
2981
- k && m.createElement(r.WeekNumber, { week: b, style: l == null ? void 0 : l[w.WeekNumber], "aria-label": dn(b.weekNumber, {
2982
- locale: i
2983
- }), className: c[w.WeekNumber], scope: "row", role: "rowheader" }, F(b.weekNumber, s)),
2984
- b.days.map((Y) => {
2985
- const { date: H } = Y, N = Fe(Y);
2986
- if (N[_.focused] = !N.hidden && !!(Se != null && Se.isEqualTo(Y)), N[X.selected] = (le == null ? void 0 : le(H)) || N.selected, Te(We)) {
2987
- const { from: Ae, to: He } = We;
2988
- N[X.range_start] = !!(Ae && He && s.isSameDay(H, Ae)), N[X.range_end] = !!(Ae && He && s.isSameDay(H, He)), N[X.range_middle] = te(We, H, !0, s);
2989
- }
2990
- const pn = ro(N, l, t.modifiersStyles), Cn = Aa(N, c, t.modifiersClassNames), Nn = !it && !N.hidden ? rn(H, N, s.options, s) : void 0;
2991
- return m.createElement(r.Day, { key: `${Y.isoDate}_${Y.displayMonthId}`, day: Y, modifiers: N, className: Cn.join(" "), style: pn, role: "gridcell", "aria-selected": N.selected || void 0, "aria-label": Nn, "data-day": Y.isoDate, "data-month": Y.outside ? Y.dateMonthId : void 0, "data-selected": N.selected || void 0, "data-disabled": N.disabled || void 0, "data-hidden": N.hidden || void 0, "data-outside": Y.outside || void 0, "data-focused": N.focused || void 0, "data-today": N.today || void 0 }, !N.hidden && it ? m.createElement(r.DayButton, { className: c[w.DayButton], style: l == null ? void 0 : l[w.DayButton], type: "button", day: Y, modifiers: N, disabled: !N.focused && N.disabled || void 0, "aria-disabled": N.focused && N.disabled || void 0, tabIndex: tn(Y) ? 0 : -1, "aria-label": nn(H, N, s.options, s), onClick: mn(Y, N), onBlur: gn(Y, N), onFocus: yn(Y, N), onKeyDown: Mn(Y, N), onMouseEnter: wn(Y, N), onMouseLeave: bn(Y, N) }, E(H, s.options, s)) : !N.hidden && E(Y.date, s.options, s));
2992
- })
2993
- )))
2994
- )
2995
- ))
2996
- ),
2997
- t.footer && m.createElement(r.Footer, { className: c[w.Footer], style: l == null ? void 0 : l[w.Footer], role: "status", "aria-live": "polite" }, t.footer)
2998
- )
2999
- );
3000
- }
3001
- const Ot = {
3002
- en: () => Promise.resolve().then(() => Pr).then((e) => e.enUS),
3003
- it: () => import("./it-GiQrQ9p4.js").then((e) => e.it),
3004
- de: () => import("./de-BMM2H7Bs.js").then((e) => e.de),
3005
- es: () => import("./es-CMkVCQ4F.js").then((e) => e.es),
3006
- fr: () => import("./fr-BcuWxqft.js").then((e) => e.fr),
3007
- pt: () => import("./pt-_bV5b5RW.js").then((e) => e.pt),
3008
- nl: () => import("./nl-xOogO4sZ.js").then((e) => e.nl),
3009
- pl: () => import("./pl-GnOW6eGK.js").then((e) => e.pl),
3010
- ro: () => import("./ro-BEcyh5Nj.js").then((e) => e.ro),
3011
- ru: () => import("./ru-Bi86hqMf.js").then((e) => e.ru),
3012
- sv: () => import("./sv-C8AeDrTA.js").then((e) => e.sv),
3013
- el: () => import("./el-BYPonAaK.js").then((e) => e.el),
3014
- ja: () => import("./ja-qfYg3Rua.js").then((e) => e.ja),
3015
- zh: () => import("./zh-CN-eXB-PFu4.js").then((e) => e.zhCN),
3016
- hi: () => import("./hi-wkq_rQAh.js").then((e) => e.hi),
3017
- ar: () => import("./ar-Cn_NxqkN.js").then((e) => e.ar),
3018
- tr: () => import("./tr-CMSs_Vgf.js").then((e) => e.tr),
3019
- sq: () => import("./sq-BujHSAWu.js").then((e) => e.sq)
3020
- };
3021
- async function To(e) {
3022
- const t = e.toLowerCase().split("-")[0];
3023
- return (Ot[t] ?? Ot.en)();
3024
- }
3025
- const Ve = /* @__PURE__ */ new Map();
3026
- function jo(e) {
3027
- const t = e.toLowerCase().split("-")[0], [n, r] = Ye(
3028
- () => Ve.get(t)
3029
- );
3030
- return Wt(() => {
3031
- const a = Ve.get(t);
3032
- if (a) {
3033
- r(a);
3034
- return;
3035
- }
3036
- let o = !1;
3037
- return To(t).then((s) => {
3038
- Ve.set(t, s), o || r(s);
3039
- }), () => {
3040
- o = !0;
3041
- };
3042
- }, [t]), n;
3043
- }
3044
- const Ue = {
3045
- en: "dd/MM/yyyy",
3046
- "en-us": "MM/dd/yyyy",
3047
- de: "dd.MM.yyyy",
3048
- fr: "dd/MM/yyyy",
3049
- es: "dd/MM/yyyy",
3050
- it: "dd/MM/yyyy",
3051
- pt: "dd/MM/yyyy",
3052
- nl: "dd-MM-yyyy",
3053
- pl: "dd.MM.yyyy",
3054
- cs: "dd.MM.yyyy",
3055
- da: "dd.MM.yyyy",
3056
- sv: "yyyy-MM-dd",
3057
- fi: "dd.MM.yyyy",
3058
- nb: "dd.MM.yyyy",
3059
- ja: "yyyy/MM/dd",
3060
- zh: "yyyy/MM/dd",
3061
- ko: "yyyy.MM.dd",
3062
- ar: "dd/MM/yyyy",
3063
- he: "dd.MM.yyyy"
3064
- };
3065
- function zo(e) {
3066
- const t = e.toLowerCase();
3067
- return Ue[t] ?? Ue[t.split("-")[0]] ?? Ue.en;
3068
- }
3069
- function Go(e, t, n) {
3070
- const r = [];
3071
- return e && r.push({ before: e }), t && r.push({ after: t }), Array.isArray(n) ? r.push(...n) : typeof n == "function" && r.push(n), r.length === 1 ? r[0] : r;
3072
- }
3073
- function $o({ orientation: e }) {
3074
- return e === "left" ? /* @__PURE__ */ dt(Fn, { className: "ds:size-4 ds:rtl:-scale-x-100" }) : /* @__PURE__ */ dt(Bn, { className: "ds:size-4 ds:rtl:-scale-x-100" });
3075
- }
3076
- const Ro = xe(
3077
- [
3078
- "ds:relative ds:flex ds:items-center ds:w-full",
3079
- // Soft-chrome look — matches `INPUT_SURFACE_CHROME` so the trigger
3080
- // shares the fill + halo with TextInput / Select / NumberInput.
3081
- "ds:rounded-[var(--radius-sm)] ds:border ds:bg-input ds:text-foreground",
3082
- "ds:shadow-[var(--shadow-input)]",
3083
- "ds:placeholder:text-muted-foreground",
3084
- "ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
3085
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
3086
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
3087
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
3088
- ].join(" "),
3089
- {
3090
- variants: {
3091
- size: {
3092
- sm: "ds:h-8 ds:text-[length:var(--font-size-sm)] ds:ps-3 ds:pe-10",
3093
- md: "ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)] ds:ps-3 ds:pe-10",
3094
- lg: "ds:h-12 ds:text-[length:var(--font-size-lg)] ds:ps-4 ds:pe-12"
3095
- },
3096
- tone: {
3097
- default: "ds:border-border",
3098
- error: "ds:border-destructive"
3099
- }
3100
- },
3101
- defaultVariants: {
3102
- size: "md",
3103
- tone: "default"
3104
- }
3105
- }
3106
- ), Vo = xe(
3107
- "ds:absolute ds:inset-y-0 ds:end-0 ds:flex ds:items-center ds:pointer-events-none ds:text-muted-foreground",
3108
- {
3109
- variants: {
3110
- size: {
3111
- sm: "ds:pe-3 ds:[&_svg]:size-4",
3112
- md: "ds:pe-3 ds:[&_svg]:size-4",
3113
- lg: "ds:pe-4 ds:[&_svg]:size-5"
3114
- }
3115
- },
3116
- defaultVariants: { size: "md" }
3117
- }
3118
- ), Uo = xe(
3119
- [
3120
- "ds:z-[var(--z-popover)] ds:rounded-[var(--radius-md)]",
3121
- "ds:border ds:border-border ds:bg-background ds:shadow-[var(--shadow-lg)]",
3122
- "ds:p-[var(--spacing-md)]"
3123
- ].join(" ")
3124
- ), Qo = xe(
3125
- [
3126
- "ds:w-full ds:text-start ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
3127
- "ds:rounded-[var(--radius-sm)] ds:text-[length:var(--font-size-sm)] ds:text-foreground",
3128
- "ds:hover:bg-muted ds:cursor-pointer",
3129
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
3130
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
3131
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
3132
- ].join(" ")
3133
- );
3134
- export {
3135
- we as A,
3136
- Ze as B,
3137
- Ho as C,
3138
- qo as D,
3139
- Je as E,
3140
- ht as F,
3141
- se as G,
3142
- Br as H,
3143
- jr as I,
3144
- zr as J,
3145
- qr as K,
3146
- Un as L,
3147
- Ct as a,
3148
- Gn as b,
3149
- Go as c,
3150
- Ke as d,
3151
- _t as e,
3152
- Qn as f,
3153
- zo as g,
3154
- Kn as h,
3155
- Lr as i,
3156
- Me as j,
3157
- Vo as k,
3158
- $o as l,
3159
- Uo as m,
3160
- ea as n,
3161
- je as o,
3162
- Qo as p,
3163
- me as q,
3164
- ye as r,
3165
- fe as s,
3166
- Ro as t,
3167
- jo as u,
3168
- wr as v,
3169
- Nt as w,
3170
- ta as x,
3171
- ke as y,
3172
- Ft as z
3173
- };
3174
- //# sourceMappingURL=react-day-picker-CdtIiKjx.js.map