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