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