prometeo-design-system 2.9.6 → 2.9.8

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