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