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