@grapadigital/shared-app-modules 0.0.43

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