@still-forest/canopy 0.24.0 → 0.25.1

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