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