@byuckchon-frontend/utils 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.mjs +4904 -107
- package/dist/index.umd.js +6 -1
- package/dist/src/DateUtils/index.d.ts +14 -0
- package/dist/src/filterParams/index.d.ts +55 -0
- package/dist/src/handleError/index.d.ts +23 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/userAgent/index.d.ts +23 -0
- package/package.json +7 -4
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
const
|
|
2
|
-
formatPhoneNumber: (
|
|
3
|
-
const
|
|
4
|
-
if (/^1[568]\d{7}$/.test(
|
|
5
|
-
return
|
|
6
|
-
if (
|
|
7
|
-
if (
|
|
8
|
-
return
|
|
9
|
-
if (
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
if (/^0\d+/.test(
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
}
|
|
18
|
-
return
|
|
19
|
-
},
|
|
20
|
-
formatBizNumber: (
|
|
21
|
-
const
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
formatDate: (
|
|
25
|
-
if (!(
|
|
26
|
-
const
|
|
27
|
-
return `${
|
|
1
|
+
const Ii = () => ({
|
|
2
|
+
formatPhoneNumber: (i) => {
|
|
3
|
+
const a = (i ?? "").replace(/\D/g, "");
|
|
4
|
+
if (/^1[568]\d{7}$/.test(a))
|
|
5
|
+
return a.replace(/^(\d{4})(\d{4})$/, "$1-$2");
|
|
6
|
+
if (a.startsWith("02")) {
|
|
7
|
+
if (a.length === 9)
|
|
8
|
+
return a.replace(/^(\d{2})(\d{3})(\d{4})$/, "$1-$2-$3");
|
|
9
|
+
if (a.length === 10)
|
|
10
|
+
return a.replace(/^(\d{2})(\d{4})(\d{4})$/, "$1-$2-$3");
|
|
11
|
+
}
|
|
12
|
+
if (/^0\d+/.test(a)) {
|
|
13
|
+
if (a.length === 10)
|
|
14
|
+
return a.replace(/^(\d{3})(\d{3})(\d{4})$/, "$1-$2-$3");
|
|
15
|
+
if (a.length === 11)
|
|
16
|
+
return a.replace(/^(\d{3})(\d{4})(\d{4})$/, "$1-$2-$3");
|
|
17
|
+
}
|
|
18
|
+
return i;
|
|
19
|
+
},
|
|
20
|
+
formatBizNumber: (i) => {
|
|
21
|
+
const a = (i ?? "").replace(/\D/g, "");
|
|
22
|
+
return a.length === 10 ? a.replace(/^(\d{3})(\d{2})(\d{5})$/, "$1-$2-$3") : a.length === 13 ? a.replace(/^(\d{6})(\d{7})$/, "$1-$2") : String(i ?? "");
|
|
23
|
+
},
|
|
24
|
+
formatDate: (i) => {
|
|
25
|
+
if (!(i instanceof Date) || isNaN(i.getTime())) return "";
|
|
26
|
+
const a = i.getHours(), f = i.getMinutes(), l = a < 12 ? "오전" : "오후", u = a % 12 === 0 ? 12 : a % 12;
|
|
27
|
+
return `${l} ${u}시 ${f}분`;
|
|
28
28
|
},
|
|
29
29
|
Masker: {
|
|
30
30
|
/**
|
|
@@ -40,16 +40,16 @@ const C = () => ({
|
|
|
40
40
|
* Masker.maskName("홍길"); // "홍*"
|
|
41
41
|
* Masker.maskName("홍길동"); // "홍*동"
|
|
42
42
|
*/
|
|
43
|
-
maskName: (
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
47
|
-
if (
|
|
48
|
-
const [
|
|
49
|
-
return `${
|
|
50
|
-
}
|
|
51
|
-
const
|
|
52
|
-
return `${
|
|
43
|
+
maskName: (i) => {
|
|
44
|
+
const a = (i ?? "").trim(), f = [...a].length;
|
|
45
|
+
if (f <= 0) return "";
|
|
46
|
+
if (f === 1) return "*";
|
|
47
|
+
if (f === 2) {
|
|
48
|
+
const [b] = [...a];
|
|
49
|
+
return `${b}*`;
|
|
50
|
+
}
|
|
51
|
+
const l = [...a], u = l[0], m = l[f - 1], p = "*".repeat(f - 2);
|
|
52
|
+
return `${u}${p}${m}`;
|
|
53
53
|
},
|
|
54
54
|
/**
|
|
55
55
|
* 전화번호 마스킹
|
|
@@ -62,94 +62,4891 @@ const C = () => ({
|
|
|
62
62
|
* Masker.maskPhoneNumber("010-1234-5678"); // "010-****-5678"
|
|
63
63
|
* Masker.maskPhoneNumber("0212345678"); // "021****678" (하이픈 미포함 입력)
|
|
64
64
|
*/
|
|
65
|
-
maskPhoneNumber: (
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const [
|
|
70
|
-
return `${
|
|
71
|
-
|
|
72
|
-
)}-${
|
|
65
|
+
maskPhoneNumber: (i) => {
|
|
66
|
+
if (i.includes("-")) {
|
|
67
|
+
const m = i.split("-");
|
|
68
|
+
if (m.length === 3) {
|
|
69
|
+
const [p, b, d] = m;
|
|
70
|
+
return `${p}-${"*".repeat(
|
|
71
|
+
b.replace(/\D/g, "").length || 4
|
|
72
|
+
)}-${d}`;
|
|
73
73
|
}
|
|
74
|
-
if (
|
|
75
|
-
const [
|
|
76
|
-
return `${
|
|
74
|
+
if (m.length === 2) {
|
|
75
|
+
const [p, b] = m, d = b.replace(/\D/g, ""), w = d.slice(-4), h = Math.max(1, d.length - w.length);
|
|
76
|
+
return `${p}-${"*".repeat(h)}${w}`;
|
|
77
77
|
}
|
|
78
|
-
return
|
|
78
|
+
return i;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
return `${
|
|
80
|
+
const a = i.replace(/\D/g, "");
|
|
81
|
+
if (a.length < 8) return i;
|
|
82
|
+
const f = a.slice(0, 3), l = a.slice(-4), u = Math.max(1, a.length - (f.length + l.length));
|
|
83
|
+
return `${f}${"*".repeat(u)}${l}`;
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
commanizeData: (
|
|
87
|
-
const
|
|
88
|
-
if (!
|
|
89
|
-
const
|
|
90
|
-
return
|
|
86
|
+
commanizeData: (i) => {
|
|
87
|
+
const a = String(i ?? "").trim();
|
|
88
|
+
if (!a) return "";
|
|
89
|
+
const f = a.replace(/,/g, ""), l = f.startsWith("-") ? "-" : "", u = f.replace(/^-/, ""), [m, p] = u.split("."), b = m.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
90
|
+
return l + b + (p !== void 0 ? `.${p}` : "");
|
|
91
91
|
},
|
|
92
|
-
decommanizeData: (
|
|
93
|
-
}),
|
|
94
|
-
function
|
|
95
|
-
return
|
|
92
|
+
decommanizeData: (i) => i.replace(/,/g, "")
|
|
93
|
+
}), xn = /^[A-Za-z0-9]([A-Za-z0-9_.+-]*[A-Za-z0-9])?@[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?\.[A-Za-z]{2,}$/, On = /^010(\d{4})(\d{4})$/, Tn = /^(070|02|031|032|033|034|035|036|037|038|039|041|042|043|051|052|053|054|055|061|062|063|064|070|071|072)[0-9]{3,4}[0-9]{4}$/, En = /([0-9]{2}(0[1-9]|1[0-2])(0[1-9]|[1,2][0-9]|3[0,1]))/, Pn = /^(19[0-9][0-9]|20\d{2})(0[0-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])$/, Dn = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+~`\-={}[\]:;"'<>,.?/\\]).{10,}$/, Mn = /^d{2}([0]\d|[1][0-2])([0][1-9]|[1-2]\d|[3][0-1])[-]*[1-4]\d{6}$/, Rn = /^(?:[0-9]{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[1,2][0-9]|3[0,1]))-[1-8][0-9]{6}$/, kn = /^https?:\/\/(?:[-\w.])+(?:\.[a-zA-Z]{2,})+(?::\d+)?(?:\/[^\s]*)?$/i, An = /\.(jpg|jpeg|png|gif|pdf|doc|docx|xls|xlsx|ppt|pptx|txt|zip|rar)$/i;
|
|
94
|
+
function _n(t) {
|
|
95
|
+
return xn.test(t);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
return
|
|
97
|
+
function Nn(t) {
|
|
98
|
+
return On.test(t);
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return
|
|
100
|
+
function Cn(t) {
|
|
101
|
+
return Tn.test(t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
103
|
+
function Sn(t) {
|
|
104
|
+
return En.test(t);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
106
|
+
function Fn(t) {
|
|
107
|
+
return Pn.test(t);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return
|
|
109
|
+
function Ln(t) {
|
|
110
|
+
return Dn.test(t);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
112
|
+
function $n(t) {
|
|
113
|
+
return Mn.test(t);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
115
|
+
function qn(t) {
|
|
116
|
+
return Rn.test(t);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
const
|
|
120
|
-
if (
|
|
121
|
-
if (
|
|
118
|
+
function Hn(t) {
|
|
119
|
+
const e = t.replace(/-/gi, "").split("").map((n) => parseInt(n, 10));
|
|
120
|
+
if (e.length === 10) {
|
|
121
|
+
if (e.every((o) => o === 0))
|
|
122
122
|
return !1;
|
|
123
|
-
const
|
|
124
|
-
let
|
|
125
|
-
for (let
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
return
|
|
123
|
+
const n = [1, 3, 7, 1, 3, 7, 1, 3, 5];
|
|
124
|
+
let r = 0;
|
|
125
|
+
for (let o = 0; o < 9; o++)
|
|
126
|
+
r += n[o] * e[o];
|
|
127
|
+
const s = (10 - r % 10) % 10;
|
|
128
|
+
return e[9] === s;
|
|
129
129
|
}
|
|
130
130
|
return !1;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
return
|
|
134
|
-
}
|
|
135
|
-
function
|
|
136
|
-
const
|
|
137
|
-
return !(!
|
|
138
|
-
}
|
|
139
|
-
const
|
|
140
|
-
email:
|
|
141
|
-
phone:
|
|
142
|
-
homePhone:
|
|
143
|
-
birth6:
|
|
144
|
-
birth8:
|
|
145
|
-
password:
|
|
146
|
-
juminAfter2020:
|
|
147
|
-
juminBefore2020:
|
|
148
|
-
corporateRegiNumber:
|
|
149
|
-
url:
|
|
150
|
-
file:
|
|
132
|
+
function Bn(t) {
|
|
133
|
+
return kn.test(t);
|
|
134
|
+
}
|
|
135
|
+
function In(t, e = 10) {
|
|
136
|
+
const n = typeof t == "string" ? t : t.name;
|
|
137
|
+
return !(!An.test(n) || t instanceof File && t.size / 1048576 > e);
|
|
138
|
+
}
|
|
139
|
+
const vi = {
|
|
140
|
+
email: _n,
|
|
141
|
+
phone: Nn,
|
|
142
|
+
homePhone: Cn,
|
|
143
|
+
birth6: Sn,
|
|
144
|
+
birth8: Fn,
|
|
145
|
+
password: Ln,
|
|
146
|
+
juminAfter2020: qn,
|
|
147
|
+
juminBefore2020: $n,
|
|
148
|
+
corporateRegiNumber: Hn,
|
|
149
|
+
url: Bn,
|
|
150
|
+
file: In
|
|
151
|
+
};
|
|
152
|
+
function Rt(t, e) {
|
|
153
|
+
return function() {
|
|
154
|
+
return t.apply(e, arguments);
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
const { toString: vn } = Object.prototype, { getPrototypeOf: We } = Object, { iterator: Me, toStringTag: kt } = Symbol, Re = /* @__PURE__ */ ((t) => (e) => {
|
|
158
|
+
const n = vn.call(e);
|
|
159
|
+
return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
|
|
160
|
+
})(/* @__PURE__ */ Object.create(null)), q = (t) => (t = t.toLowerCase(), (e) => Re(e) === t), ke = (t) => (e) => typeof e === t, { isArray: se } = Array, ne = ke("undefined");
|
|
161
|
+
function de(t) {
|
|
162
|
+
return t !== null && !ne(t) && t.constructor !== null && !ne(t.constructor) && F(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
163
|
+
}
|
|
164
|
+
const At = q("ArrayBuffer");
|
|
165
|
+
function Yn(t) {
|
|
166
|
+
let e;
|
|
167
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && At(t.buffer), e;
|
|
168
|
+
}
|
|
169
|
+
const Wn = ke("string"), F = ke("function"), _t = ke("number"), he = (t) => t !== null && typeof t == "object", jn = (t) => t === !0 || t === !1, xe = (t) => {
|
|
170
|
+
if (Re(t) !== "object")
|
|
171
|
+
return !1;
|
|
172
|
+
const e = We(t);
|
|
173
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(kt in t) && !(Me in t);
|
|
174
|
+
}, Un = (t) => {
|
|
175
|
+
if (!he(t) || de(t))
|
|
176
|
+
return !1;
|
|
177
|
+
try {
|
|
178
|
+
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
|
|
179
|
+
} catch {
|
|
180
|
+
return !1;
|
|
181
|
+
}
|
|
182
|
+
}, zn = q("Date"), Qn = q("File"), Xn = q("Blob"), Vn = q("FileList"), Jn = (t) => he(t) && F(t.pipe), Gn = (t) => {
|
|
183
|
+
let e;
|
|
184
|
+
return t && (typeof FormData == "function" && t instanceof FormData || F(t.append) && ((e = Re(t)) === "formdata" || // detect form-data instance
|
|
185
|
+
e === "object" && F(t.toString) && t.toString() === "[object FormData]"));
|
|
186
|
+
}, Kn = q("URLSearchParams"), [Zn, er, tr, nr] = ["ReadableStream", "Request", "Response", "Headers"].map(q), rr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
187
|
+
function me(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
188
|
+
if (t === null || typeof t > "u")
|
|
189
|
+
return;
|
|
190
|
+
let r, s;
|
|
191
|
+
if (typeof t != "object" && (t = [t]), se(t))
|
|
192
|
+
for (r = 0, s = t.length; r < s; r++)
|
|
193
|
+
e.call(null, t[r], r, t);
|
|
194
|
+
else {
|
|
195
|
+
if (de(t))
|
|
196
|
+
return;
|
|
197
|
+
const o = n ? Object.getOwnPropertyNames(t) : Object.keys(t), i = o.length;
|
|
198
|
+
let a;
|
|
199
|
+
for (r = 0; r < i; r++)
|
|
200
|
+
a = o[r], e.call(null, t[a], a, t);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function Nt(t, e) {
|
|
204
|
+
if (de(t))
|
|
205
|
+
return null;
|
|
206
|
+
e = e.toLowerCase();
|
|
207
|
+
const n = Object.keys(t);
|
|
208
|
+
let r = n.length, s;
|
|
209
|
+
for (; r-- > 0; )
|
|
210
|
+
if (s = n[r], e === s.toLowerCase())
|
|
211
|
+
return s;
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
const J = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Ct = (t) => !ne(t) && t !== J;
|
|
215
|
+
function qe() {
|
|
216
|
+
const { caseless: t, skipUndefined: e } = Ct(this) && this || {}, n = {}, r = (s, o) => {
|
|
217
|
+
const i = t && Nt(n, o) || o;
|
|
218
|
+
xe(n[i]) && xe(s) ? n[i] = qe(n[i], s) : xe(s) ? n[i] = qe({}, s) : se(s) ? n[i] = s.slice() : (!e || !ne(s)) && (n[i] = s);
|
|
219
|
+
};
|
|
220
|
+
for (let s = 0, o = arguments.length; s < o; s++)
|
|
221
|
+
arguments[s] && me(arguments[s], r);
|
|
222
|
+
return n;
|
|
223
|
+
}
|
|
224
|
+
const sr = (t, e, n, { allOwnKeys: r } = {}) => (me(e, (s, o) => {
|
|
225
|
+
n && F(s) ? t[o] = Rt(s, n) : t[o] = s;
|
|
226
|
+
}, { allOwnKeys: r }), t), or = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), ir = (t, e, n, r) => {
|
|
227
|
+
t.prototype = Object.create(e.prototype, r), t.prototype.constructor = t, Object.defineProperty(t, "super", {
|
|
228
|
+
value: e.prototype
|
|
229
|
+
}), n && Object.assign(t.prototype, n);
|
|
230
|
+
}, ar = (t, e, n, r) => {
|
|
231
|
+
let s, o, i;
|
|
232
|
+
const a = {};
|
|
233
|
+
if (e = e || {}, t == null) return e;
|
|
234
|
+
do {
|
|
235
|
+
for (s = Object.getOwnPropertyNames(t), o = s.length; o-- > 0; )
|
|
236
|
+
i = s[o], (!r || r(i, t, e)) && !a[i] && (e[i] = t[i], a[i] = !0);
|
|
237
|
+
t = n !== !1 && We(t);
|
|
238
|
+
} while (t && (!n || n(t, e)) && t !== Object.prototype);
|
|
239
|
+
return e;
|
|
240
|
+
}, cr = (t, e, n) => {
|
|
241
|
+
t = String(t), (n === void 0 || n > t.length) && (n = t.length), n -= e.length;
|
|
242
|
+
const r = t.indexOf(e, n);
|
|
243
|
+
return r !== -1 && r === n;
|
|
244
|
+
}, ur = (t) => {
|
|
245
|
+
if (!t) return null;
|
|
246
|
+
if (se(t)) return t;
|
|
247
|
+
let e = t.length;
|
|
248
|
+
if (!_t(e)) return null;
|
|
249
|
+
const n = new Array(e);
|
|
250
|
+
for (; e-- > 0; )
|
|
251
|
+
n[e] = t[e];
|
|
252
|
+
return n;
|
|
253
|
+
}, lr = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && We(Uint8Array)), fr = (t, e) => {
|
|
254
|
+
const r = (t && t[Me]).call(t);
|
|
255
|
+
let s;
|
|
256
|
+
for (; (s = r.next()) && !s.done; ) {
|
|
257
|
+
const o = s.value;
|
|
258
|
+
e.call(t, o[0], o[1]);
|
|
259
|
+
}
|
|
260
|
+
}, dr = (t, e) => {
|
|
261
|
+
let n;
|
|
262
|
+
const r = [];
|
|
263
|
+
for (; (n = t.exec(e)) !== null; )
|
|
264
|
+
r.push(n);
|
|
265
|
+
return r;
|
|
266
|
+
}, hr = q("HTMLFormElement"), mr = (t) => t.toLowerCase().replace(
|
|
267
|
+
/[-_\s]([a-z\d])(\w*)/g,
|
|
268
|
+
function(n, r, s) {
|
|
269
|
+
return r.toUpperCase() + s;
|
|
270
|
+
}
|
|
271
|
+
), st = (({ hasOwnProperty: t }) => (e, n) => t.call(e, n))(Object.prototype), pr = q("RegExp"), St = (t, e) => {
|
|
272
|
+
const n = Object.getOwnPropertyDescriptors(t), r = {};
|
|
273
|
+
me(n, (s, o) => {
|
|
274
|
+
let i;
|
|
275
|
+
(i = e(s, o, t)) !== !1 && (r[o] = i || s);
|
|
276
|
+
}), Object.defineProperties(t, r);
|
|
277
|
+
}, wr = (t) => {
|
|
278
|
+
St(t, (e, n) => {
|
|
279
|
+
if (F(t) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
|
|
280
|
+
return !1;
|
|
281
|
+
const r = t[n];
|
|
282
|
+
if (F(r)) {
|
|
283
|
+
if (e.enumerable = !1, "writable" in e) {
|
|
284
|
+
e.writable = !1;
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
e.set || (e.set = () => {
|
|
288
|
+
throw Error("Can not rewrite read-only method '" + n + "'");
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}, yr = (t, e) => {
|
|
293
|
+
const n = {}, r = (s) => {
|
|
294
|
+
s.forEach((o) => {
|
|
295
|
+
n[o] = !0;
|
|
296
|
+
});
|
|
297
|
+
};
|
|
298
|
+
return se(t) ? r(t) : r(String(t).split(e)), n;
|
|
299
|
+
}, gr = () => {
|
|
300
|
+
}, br = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
|
|
301
|
+
function xr(t) {
|
|
302
|
+
return !!(t && F(t.append) && t[kt] === "FormData" && t[Me]);
|
|
303
|
+
}
|
|
304
|
+
const Or = (t) => {
|
|
305
|
+
const e = new Array(10), n = (r, s) => {
|
|
306
|
+
if (he(r)) {
|
|
307
|
+
if (e.indexOf(r) >= 0)
|
|
308
|
+
return;
|
|
309
|
+
if (de(r))
|
|
310
|
+
return r;
|
|
311
|
+
if (!("toJSON" in r)) {
|
|
312
|
+
e[s] = r;
|
|
313
|
+
const o = se(r) ? [] : {};
|
|
314
|
+
return me(r, (i, a) => {
|
|
315
|
+
const f = n(i, s + 1);
|
|
316
|
+
!ne(f) && (o[a] = f);
|
|
317
|
+
}), e[s] = void 0, o;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
return r;
|
|
321
|
+
};
|
|
322
|
+
return n(t, 0);
|
|
323
|
+
}, Tr = q("AsyncFunction"), Er = (t) => t && (he(t) || F(t)) && F(t.then) && F(t.catch), Ft = ((t, e) => t ? setImmediate : e ? ((n, r) => (J.addEventListener("message", ({ source: s, data: o }) => {
|
|
324
|
+
s === J && o === n && r.length && r.shift()();
|
|
325
|
+
}, !1), (s) => {
|
|
326
|
+
r.push(s), J.postMessage(n, "*");
|
|
327
|
+
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
328
|
+
typeof setImmediate == "function",
|
|
329
|
+
F(J.postMessage)
|
|
330
|
+
), Pr = typeof queueMicrotask < "u" ? queueMicrotask.bind(J) : typeof process < "u" && process.nextTick || Ft, Dr = (t) => t != null && F(t[Me]), c = {
|
|
331
|
+
isArray: se,
|
|
332
|
+
isArrayBuffer: At,
|
|
333
|
+
isBuffer: de,
|
|
334
|
+
isFormData: Gn,
|
|
335
|
+
isArrayBufferView: Yn,
|
|
336
|
+
isString: Wn,
|
|
337
|
+
isNumber: _t,
|
|
338
|
+
isBoolean: jn,
|
|
339
|
+
isObject: he,
|
|
340
|
+
isPlainObject: xe,
|
|
341
|
+
isEmptyObject: Un,
|
|
342
|
+
isReadableStream: Zn,
|
|
343
|
+
isRequest: er,
|
|
344
|
+
isResponse: tr,
|
|
345
|
+
isHeaders: nr,
|
|
346
|
+
isUndefined: ne,
|
|
347
|
+
isDate: zn,
|
|
348
|
+
isFile: Qn,
|
|
349
|
+
isBlob: Xn,
|
|
350
|
+
isRegExp: pr,
|
|
351
|
+
isFunction: F,
|
|
352
|
+
isStream: Jn,
|
|
353
|
+
isURLSearchParams: Kn,
|
|
354
|
+
isTypedArray: lr,
|
|
355
|
+
isFileList: Vn,
|
|
356
|
+
forEach: me,
|
|
357
|
+
merge: qe,
|
|
358
|
+
extend: sr,
|
|
359
|
+
trim: rr,
|
|
360
|
+
stripBOM: or,
|
|
361
|
+
inherits: ir,
|
|
362
|
+
toFlatObject: ar,
|
|
363
|
+
kindOf: Re,
|
|
364
|
+
kindOfTest: q,
|
|
365
|
+
endsWith: cr,
|
|
366
|
+
toArray: ur,
|
|
367
|
+
forEachEntry: fr,
|
|
368
|
+
matchAll: dr,
|
|
369
|
+
isHTMLForm: hr,
|
|
370
|
+
hasOwnProperty: st,
|
|
371
|
+
hasOwnProp: st,
|
|
372
|
+
// an alias to avoid ESLint no-prototype-builtins detection
|
|
373
|
+
reduceDescriptors: St,
|
|
374
|
+
freezeMethods: wr,
|
|
375
|
+
toObjectSet: yr,
|
|
376
|
+
toCamelCase: mr,
|
|
377
|
+
noop: gr,
|
|
378
|
+
toFiniteNumber: br,
|
|
379
|
+
findKey: Nt,
|
|
380
|
+
global: J,
|
|
381
|
+
isContextDefined: Ct,
|
|
382
|
+
isSpecCompliantForm: xr,
|
|
383
|
+
toJSONObject: Or,
|
|
384
|
+
isAsyncFn: Tr,
|
|
385
|
+
isThenable: Er,
|
|
386
|
+
setImmediate: Ft,
|
|
387
|
+
asap: Pr,
|
|
388
|
+
isIterable: Dr
|
|
389
|
+
};
|
|
390
|
+
function g(t, e, n, r, s) {
|
|
391
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), r && (this.request = r), s && (this.response = s, this.status = s.status ? s.status : null);
|
|
392
|
+
}
|
|
393
|
+
c.inherits(g, Error, {
|
|
394
|
+
toJSON: function() {
|
|
395
|
+
return {
|
|
396
|
+
// Standard
|
|
397
|
+
message: this.message,
|
|
398
|
+
name: this.name,
|
|
399
|
+
// Microsoft
|
|
400
|
+
description: this.description,
|
|
401
|
+
number: this.number,
|
|
402
|
+
// Mozilla
|
|
403
|
+
fileName: this.fileName,
|
|
404
|
+
lineNumber: this.lineNumber,
|
|
405
|
+
columnNumber: this.columnNumber,
|
|
406
|
+
stack: this.stack,
|
|
407
|
+
// Axios
|
|
408
|
+
config: c.toJSONObject(this.config),
|
|
409
|
+
code: this.code,
|
|
410
|
+
status: this.status
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
const Lt = g.prototype, $t = {};
|
|
415
|
+
[
|
|
416
|
+
"ERR_BAD_OPTION_VALUE",
|
|
417
|
+
"ERR_BAD_OPTION",
|
|
418
|
+
"ECONNABORTED",
|
|
419
|
+
"ETIMEDOUT",
|
|
420
|
+
"ERR_NETWORK",
|
|
421
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
422
|
+
"ERR_DEPRECATED",
|
|
423
|
+
"ERR_BAD_RESPONSE",
|
|
424
|
+
"ERR_BAD_REQUEST",
|
|
425
|
+
"ERR_CANCELED",
|
|
426
|
+
"ERR_NOT_SUPPORT",
|
|
427
|
+
"ERR_INVALID_URL"
|
|
428
|
+
// eslint-disable-next-line func-names
|
|
429
|
+
].forEach((t) => {
|
|
430
|
+
$t[t] = { value: t };
|
|
431
|
+
});
|
|
432
|
+
Object.defineProperties(g, $t);
|
|
433
|
+
Object.defineProperty(Lt, "isAxiosError", { value: !0 });
|
|
434
|
+
g.from = (t, e, n, r, s, o) => {
|
|
435
|
+
const i = Object.create(Lt);
|
|
436
|
+
c.toFlatObject(t, i, function(u) {
|
|
437
|
+
return u !== Error.prototype;
|
|
438
|
+
}, (l) => l !== "isAxiosError");
|
|
439
|
+
const a = t && t.message ? t.message : "Error", f = e == null && t ? t.code : e;
|
|
440
|
+
return g.call(i, a, f, n, r, s), t && i.cause == null && Object.defineProperty(i, "cause", { value: t, configurable: !0 }), i.name = t && t.name || "Error", o && Object.assign(i, o), i;
|
|
441
|
+
};
|
|
442
|
+
const Mr = null;
|
|
443
|
+
function He(t) {
|
|
444
|
+
return c.isPlainObject(t) || c.isArray(t);
|
|
445
|
+
}
|
|
446
|
+
function qt(t) {
|
|
447
|
+
return c.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
448
|
+
}
|
|
449
|
+
function ot(t, e, n) {
|
|
450
|
+
return t ? t.concat(e).map(function(s, o) {
|
|
451
|
+
return s = qt(s), !n && o ? "[" + s + "]" : s;
|
|
452
|
+
}).join(n ? "." : "") : e;
|
|
453
|
+
}
|
|
454
|
+
function Rr(t) {
|
|
455
|
+
return c.isArray(t) && !t.some(He);
|
|
456
|
+
}
|
|
457
|
+
const kr = c.toFlatObject(c, {}, null, function(e) {
|
|
458
|
+
return /^is[A-Z]/.test(e);
|
|
459
|
+
});
|
|
460
|
+
function Ae(t, e, n) {
|
|
461
|
+
if (!c.isObject(t))
|
|
462
|
+
throw new TypeError("target must be an object");
|
|
463
|
+
e = e || new FormData(), n = c.toFlatObject(n, {
|
|
464
|
+
metaTokens: !0,
|
|
465
|
+
dots: !1,
|
|
466
|
+
indexes: !1
|
|
467
|
+
}, !1, function(w, h) {
|
|
468
|
+
return !c.isUndefined(h[w]);
|
|
469
|
+
});
|
|
470
|
+
const r = n.metaTokens, s = n.visitor || u, o = n.dots, i = n.indexes, f = (n.Blob || typeof Blob < "u" && Blob) && c.isSpecCompliantForm(e);
|
|
471
|
+
if (!c.isFunction(s))
|
|
472
|
+
throw new TypeError("visitor must be a function");
|
|
473
|
+
function l(d) {
|
|
474
|
+
if (d === null) return "";
|
|
475
|
+
if (c.isDate(d))
|
|
476
|
+
return d.toISOString();
|
|
477
|
+
if (c.isBoolean(d))
|
|
478
|
+
return d.toString();
|
|
479
|
+
if (!f && c.isBlob(d))
|
|
480
|
+
throw new g("Blob is not supported. Use a Buffer instead.");
|
|
481
|
+
return c.isArrayBuffer(d) || c.isTypedArray(d) ? f && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
482
|
+
}
|
|
483
|
+
function u(d, w, h) {
|
|
484
|
+
let y = d;
|
|
485
|
+
if (d && !h && typeof d == "object") {
|
|
486
|
+
if (c.endsWith(w, "{}"))
|
|
487
|
+
w = r ? w : w.slice(0, -2), d = JSON.stringify(d);
|
|
488
|
+
else if (c.isArray(d) && Rr(d) || (c.isFileList(d) || c.endsWith(w, "[]")) && (y = c.toArray(d)))
|
|
489
|
+
return w = qt(w), y.forEach(function(M, _) {
|
|
490
|
+
!(c.isUndefined(M) || M === null) && e.append(
|
|
491
|
+
// eslint-disable-next-line no-nested-ternary
|
|
492
|
+
i === !0 ? ot([w], _, o) : i === null ? w : w + "[]",
|
|
493
|
+
l(M)
|
|
494
|
+
);
|
|
495
|
+
}), !1;
|
|
496
|
+
}
|
|
497
|
+
return He(d) ? !0 : (e.append(ot(h, w, o), l(d)), !1);
|
|
498
|
+
}
|
|
499
|
+
const m = [], p = Object.assign(kr, {
|
|
500
|
+
defaultVisitor: u,
|
|
501
|
+
convertValue: l,
|
|
502
|
+
isVisitable: He
|
|
503
|
+
});
|
|
504
|
+
function b(d, w) {
|
|
505
|
+
if (!c.isUndefined(d)) {
|
|
506
|
+
if (m.indexOf(d) !== -1)
|
|
507
|
+
throw Error("Circular reference detected in " + w.join("."));
|
|
508
|
+
m.push(d), c.forEach(d, function(y, E) {
|
|
509
|
+
(!(c.isUndefined(y) || y === null) && s.call(
|
|
510
|
+
e,
|
|
511
|
+
y,
|
|
512
|
+
c.isString(E) ? E.trim() : E,
|
|
513
|
+
w,
|
|
514
|
+
p
|
|
515
|
+
)) === !0 && b(y, w ? w.concat(E) : [E]);
|
|
516
|
+
}), m.pop();
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
if (!c.isObject(t))
|
|
520
|
+
throw new TypeError("data must be an object");
|
|
521
|
+
return b(t), e;
|
|
522
|
+
}
|
|
523
|
+
function it(t) {
|
|
524
|
+
const e = {
|
|
525
|
+
"!": "%21",
|
|
526
|
+
"'": "%27",
|
|
527
|
+
"(": "%28",
|
|
528
|
+
")": "%29",
|
|
529
|
+
"~": "%7E",
|
|
530
|
+
"%20": "+",
|
|
531
|
+
"%00": "\0"
|
|
532
|
+
};
|
|
533
|
+
return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) {
|
|
534
|
+
return e[r];
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
function je(t, e) {
|
|
538
|
+
this._pairs = [], t && Ae(t, this, e);
|
|
539
|
+
}
|
|
540
|
+
const Ht = je.prototype;
|
|
541
|
+
Ht.append = function(e, n) {
|
|
542
|
+
this._pairs.push([e, n]);
|
|
543
|
+
};
|
|
544
|
+
Ht.toString = function(e) {
|
|
545
|
+
const n = e ? function(r) {
|
|
546
|
+
return e.call(this, r, it);
|
|
547
|
+
} : it;
|
|
548
|
+
return this._pairs.map(function(s) {
|
|
549
|
+
return n(s[0]) + "=" + n(s[1]);
|
|
550
|
+
}, "").join("&");
|
|
551
|
+
};
|
|
552
|
+
function Ar(t) {
|
|
553
|
+
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
554
|
+
}
|
|
555
|
+
function Bt(t, e, n) {
|
|
556
|
+
if (!e)
|
|
557
|
+
return t;
|
|
558
|
+
const r = n && n.encode || Ar;
|
|
559
|
+
c.isFunction(n) && (n = {
|
|
560
|
+
serialize: n
|
|
561
|
+
});
|
|
562
|
+
const s = n && n.serialize;
|
|
563
|
+
let o;
|
|
564
|
+
if (s ? o = s(e, n) : o = c.isURLSearchParams(e) ? e.toString() : new je(e, n).toString(r), o) {
|
|
565
|
+
const i = t.indexOf("#");
|
|
566
|
+
i !== -1 && (t = t.slice(0, i)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
|
|
567
|
+
}
|
|
568
|
+
return t;
|
|
569
|
+
}
|
|
570
|
+
class at {
|
|
571
|
+
constructor() {
|
|
572
|
+
this.handlers = [];
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Add a new interceptor to the stack
|
|
576
|
+
*
|
|
577
|
+
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
|
578
|
+
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
|
579
|
+
*
|
|
580
|
+
* @return {Number} An ID used to remove interceptor later
|
|
581
|
+
*/
|
|
582
|
+
use(e, n, r) {
|
|
583
|
+
return this.handlers.push({
|
|
584
|
+
fulfilled: e,
|
|
585
|
+
rejected: n,
|
|
586
|
+
synchronous: r ? r.synchronous : !1,
|
|
587
|
+
runWhen: r ? r.runWhen : null
|
|
588
|
+
}), this.handlers.length - 1;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Remove an interceptor from the stack
|
|
592
|
+
*
|
|
593
|
+
* @param {Number} id The ID that was returned by `use`
|
|
594
|
+
*
|
|
595
|
+
* @returns {void}
|
|
596
|
+
*/
|
|
597
|
+
eject(e) {
|
|
598
|
+
this.handlers[e] && (this.handlers[e] = null);
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Clear all interceptors from the stack
|
|
602
|
+
*
|
|
603
|
+
* @returns {void}
|
|
604
|
+
*/
|
|
605
|
+
clear() {
|
|
606
|
+
this.handlers && (this.handlers = []);
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Iterate over all the registered interceptors
|
|
610
|
+
*
|
|
611
|
+
* This method is particularly useful for skipping over any
|
|
612
|
+
* interceptors that may have become `null` calling `eject`.
|
|
613
|
+
*
|
|
614
|
+
* @param {Function} fn The function to call for each interceptor
|
|
615
|
+
*
|
|
616
|
+
* @returns {void}
|
|
617
|
+
*/
|
|
618
|
+
forEach(e) {
|
|
619
|
+
c.forEach(this.handlers, function(r) {
|
|
620
|
+
r !== null && e(r);
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
const It = {
|
|
625
|
+
silentJSONParsing: !0,
|
|
626
|
+
forcedJSONParsing: !0,
|
|
627
|
+
clarifyTimeoutError: !1
|
|
628
|
+
}, _r = typeof URLSearchParams < "u" ? URLSearchParams : je, Nr = typeof FormData < "u" ? FormData : null, Cr = typeof Blob < "u" ? Blob : null, Sr = {
|
|
629
|
+
isBrowser: !0,
|
|
630
|
+
classes: {
|
|
631
|
+
URLSearchParams: _r,
|
|
632
|
+
FormData: Nr,
|
|
633
|
+
Blob: Cr
|
|
634
|
+
},
|
|
635
|
+
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
636
|
+
}, Ue = typeof window < "u" && typeof document < "u", Be = typeof navigator == "object" && navigator || void 0, Fr = Ue && (!Be || ["ReactNative", "NativeScript", "NS"].indexOf(Be.product) < 0), Lr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
637
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", $r = Ue && window.location.href || "http://localhost", qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
638
|
+
__proto__: null,
|
|
639
|
+
hasBrowserEnv: Ue,
|
|
640
|
+
hasStandardBrowserEnv: Fr,
|
|
641
|
+
hasStandardBrowserWebWorkerEnv: Lr,
|
|
642
|
+
navigator: Be,
|
|
643
|
+
origin: $r
|
|
644
|
+
}, Symbol.toStringTag, { value: "Module" })), C = {
|
|
645
|
+
...qr,
|
|
646
|
+
...Sr
|
|
647
|
+
};
|
|
648
|
+
function Hr(t, e) {
|
|
649
|
+
return Ae(t, new C.classes.URLSearchParams(), {
|
|
650
|
+
visitor: function(n, r, s, o) {
|
|
651
|
+
return C.isNode && c.isBuffer(n) ? (this.append(r, n.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
|
|
652
|
+
},
|
|
653
|
+
...e
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
function Br(t) {
|
|
657
|
+
return c.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
658
|
+
}
|
|
659
|
+
function Ir(t) {
|
|
660
|
+
const e = {}, n = Object.keys(t);
|
|
661
|
+
let r;
|
|
662
|
+
const s = n.length;
|
|
663
|
+
let o;
|
|
664
|
+
for (r = 0; r < s; r++)
|
|
665
|
+
o = n[r], e[o] = t[o];
|
|
666
|
+
return e;
|
|
667
|
+
}
|
|
668
|
+
function vt(t) {
|
|
669
|
+
function e(n, r, s, o) {
|
|
670
|
+
let i = n[o++];
|
|
671
|
+
if (i === "__proto__") return !0;
|
|
672
|
+
const a = Number.isFinite(+i), f = o >= n.length;
|
|
673
|
+
return i = !i && c.isArray(s) ? s.length : i, f ? (c.hasOwnProp(s, i) ? s[i] = [s[i], r] : s[i] = r, !a) : ((!s[i] || !c.isObject(s[i])) && (s[i] = []), e(n, r, s[i], o) && c.isArray(s[i]) && (s[i] = Ir(s[i])), !a);
|
|
674
|
+
}
|
|
675
|
+
if (c.isFormData(t) && c.isFunction(t.entries)) {
|
|
676
|
+
const n = {};
|
|
677
|
+
return c.forEachEntry(t, (r, s) => {
|
|
678
|
+
e(Br(r), s, n, 0);
|
|
679
|
+
}), n;
|
|
680
|
+
}
|
|
681
|
+
return null;
|
|
682
|
+
}
|
|
683
|
+
function vr(t, e, n) {
|
|
684
|
+
if (c.isString(t))
|
|
685
|
+
try {
|
|
686
|
+
return (e || JSON.parse)(t), c.trim(t);
|
|
687
|
+
} catch (r) {
|
|
688
|
+
if (r.name !== "SyntaxError")
|
|
689
|
+
throw r;
|
|
690
|
+
}
|
|
691
|
+
return (n || JSON.stringify)(t);
|
|
692
|
+
}
|
|
693
|
+
const pe = {
|
|
694
|
+
transitional: It,
|
|
695
|
+
adapter: ["xhr", "http", "fetch"],
|
|
696
|
+
transformRequest: [function(e, n) {
|
|
697
|
+
const r = n.getContentType() || "", s = r.indexOf("application/json") > -1, o = c.isObject(e);
|
|
698
|
+
if (o && c.isHTMLForm(e) && (e = new FormData(e)), c.isFormData(e))
|
|
699
|
+
return s ? JSON.stringify(vt(e)) : e;
|
|
700
|
+
if (c.isArrayBuffer(e) || c.isBuffer(e) || c.isStream(e) || c.isFile(e) || c.isBlob(e) || c.isReadableStream(e))
|
|
701
|
+
return e;
|
|
702
|
+
if (c.isArrayBufferView(e))
|
|
703
|
+
return e.buffer;
|
|
704
|
+
if (c.isURLSearchParams(e))
|
|
705
|
+
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
706
|
+
let a;
|
|
707
|
+
if (o) {
|
|
708
|
+
if (r.indexOf("application/x-www-form-urlencoded") > -1)
|
|
709
|
+
return Hr(e, this.formSerializer).toString();
|
|
710
|
+
if ((a = c.isFileList(e)) || r.indexOf("multipart/form-data") > -1) {
|
|
711
|
+
const f = this.env && this.env.FormData;
|
|
712
|
+
return Ae(
|
|
713
|
+
a ? { "files[]": e } : e,
|
|
714
|
+
f && new f(),
|
|
715
|
+
this.formSerializer
|
|
716
|
+
);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
return o || s ? (n.setContentType("application/json", !1), vr(e)) : e;
|
|
720
|
+
}],
|
|
721
|
+
transformResponse: [function(e) {
|
|
722
|
+
const n = this.transitional || pe.transitional, r = n && n.forcedJSONParsing, s = this.responseType === "json";
|
|
723
|
+
if (c.isResponse(e) || c.isReadableStream(e))
|
|
724
|
+
return e;
|
|
725
|
+
if (e && c.isString(e) && (r && !this.responseType || s)) {
|
|
726
|
+
const i = !(n && n.silentJSONParsing) && s;
|
|
727
|
+
try {
|
|
728
|
+
return JSON.parse(e, this.parseReviver);
|
|
729
|
+
} catch (a) {
|
|
730
|
+
if (i)
|
|
731
|
+
throw a.name === "SyntaxError" ? g.from(a, g.ERR_BAD_RESPONSE, this, null, this.response) : a;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
return e;
|
|
735
|
+
}],
|
|
736
|
+
/**
|
|
737
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
738
|
+
* timeout is not created.
|
|
739
|
+
*/
|
|
740
|
+
timeout: 0,
|
|
741
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
742
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
743
|
+
maxContentLength: -1,
|
|
744
|
+
maxBodyLength: -1,
|
|
745
|
+
env: {
|
|
746
|
+
FormData: C.classes.FormData,
|
|
747
|
+
Blob: C.classes.Blob
|
|
748
|
+
},
|
|
749
|
+
validateStatus: function(e) {
|
|
750
|
+
return e >= 200 && e < 300;
|
|
751
|
+
},
|
|
752
|
+
headers: {
|
|
753
|
+
common: {
|
|
754
|
+
Accept: "application/json, text/plain, */*",
|
|
755
|
+
"Content-Type": void 0
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
c.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
760
|
+
pe.headers[t] = {};
|
|
761
|
+
});
|
|
762
|
+
const Yr = c.toObjectSet([
|
|
763
|
+
"age",
|
|
764
|
+
"authorization",
|
|
765
|
+
"content-length",
|
|
766
|
+
"content-type",
|
|
767
|
+
"etag",
|
|
768
|
+
"expires",
|
|
769
|
+
"from",
|
|
770
|
+
"host",
|
|
771
|
+
"if-modified-since",
|
|
772
|
+
"if-unmodified-since",
|
|
773
|
+
"last-modified",
|
|
774
|
+
"location",
|
|
775
|
+
"max-forwards",
|
|
776
|
+
"proxy-authorization",
|
|
777
|
+
"referer",
|
|
778
|
+
"retry-after",
|
|
779
|
+
"user-agent"
|
|
780
|
+
]), Wr = (t) => {
|
|
781
|
+
const e = {};
|
|
782
|
+
let n, r, s;
|
|
783
|
+
return t && t.split(`
|
|
784
|
+
`).forEach(function(i) {
|
|
785
|
+
s = i.indexOf(":"), n = i.substring(0, s).trim().toLowerCase(), r = i.substring(s + 1).trim(), !(!n || e[n] && Yr[n]) && (n === "set-cookie" ? e[n] ? e[n].push(r) : e[n] = [r] : e[n] = e[n] ? e[n] + ", " + r : r);
|
|
786
|
+
}), e;
|
|
787
|
+
}, ct = Symbol("internals");
|
|
788
|
+
function ce(t) {
|
|
789
|
+
return t && String(t).trim().toLowerCase();
|
|
790
|
+
}
|
|
791
|
+
function Oe(t) {
|
|
792
|
+
return t === !1 || t == null ? t : c.isArray(t) ? t.map(Oe) : String(t);
|
|
793
|
+
}
|
|
794
|
+
function jr(t) {
|
|
795
|
+
const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
796
|
+
let r;
|
|
797
|
+
for (; r = n.exec(t); )
|
|
798
|
+
e[r[1]] = r[2];
|
|
799
|
+
return e;
|
|
800
|
+
}
|
|
801
|
+
const Ur = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
802
|
+
function Se(t, e, n, r, s) {
|
|
803
|
+
if (c.isFunction(r))
|
|
804
|
+
return r.call(this, e, n);
|
|
805
|
+
if (s && (e = n), !!c.isString(e)) {
|
|
806
|
+
if (c.isString(r))
|
|
807
|
+
return e.indexOf(r) !== -1;
|
|
808
|
+
if (c.isRegExp(r))
|
|
809
|
+
return r.test(e);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
function zr(t) {
|
|
813
|
+
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, r) => n.toUpperCase() + r);
|
|
814
|
+
}
|
|
815
|
+
function Qr(t, e) {
|
|
816
|
+
const n = c.toCamelCase(" " + e);
|
|
817
|
+
["get", "set", "has"].forEach((r) => {
|
|
818
|
+
Object.defineProperty(t, r + n, {
|
|
819
|
+
value: function(s, o, i) {
|
|
820
|
+
return this[r].call(this, e, s, o, i);
|
|
821
|
+
},
|
|
822
|
+
configurable: !0
|
|
823
|
+
});
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
let L = class {
|
|
827
|
+
constructor(e) {
|
|
828
|
+
e && this.set(e);
|
|
829
|
+
}
|
|
830
|
+
set(e, n, r) {
|
|
831
|
+
const s = this;
|
|
832
|
+
function o(a, f, l) {
|
|
833
|
+
const u = ce(f);
|
|
834
|
+
if (!u)
|
|
835
|
+
throw new Error("header name must be a non-empty string");
|
|
836
|
+
const m = c.findKey(s, u);
|
|
837
|
+
(!m || s[m] === void 0 || l === !0 || l === void 0 && s[m] !== !1) && (s[m || f] = Oe(a));
|
|
838
|
+
}
|
|
839
|
+
const i = (a, f) => c.forEach(a, (l, u) => o(l, u, f));
|
|
840
|
+
if (c.isPlainObject(e) || e instanceof this.constructor)
|
|
841
|
+
i(e, n);
|
|
842
|
+
else if (c.isString(e) && (e = e.trim()) && !Ur(e))
|
|
843
|
+
i(Wr(e), n);
|
|
844
|
+
else if (c.isObject(e) && c.isIterable(e)) {
|
|
845
|
+
let a = {}, f, l;
|
|
846
|
+
for (const u of e) {
|
|
847
|
+
if (!c.isArray(u))
|
|
848
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
849
|
+
a[l = u[0]] = (f = a[l]) ? c.isArray(f) ? [...f, u[1]] : [f, u[1]] : u[1];
|
|
850
|
+
}
|
|
851
|
+
i(a, n);
|
|
852
|
+
} else
|
|
853
|
+
e != null && o(n, e, r);
|
|
854
|
+
return this;
|
|
855
|
+
}
|
|
856
|
+
get(e, n) {
|
|
857
|
+
if (e = ce(e), e) {
|
|
858
|
+
const r = c.findKey(this, e);
|
|
859
|
+
if (r) {
|
|
860
|
+
const s = this[r];
|
|
861
|
+
if (!n)
|
|
862
|
+
return s;
|
|
863
|
+
if (n === !0)
|
|
864
|
+
return jr(s);
|
|
865
|
+
if (c.isFunction(n))
|
|
866
|
+
return n.call(this, s, r);
|
|
867
|
+
if (c.isRegExp(n))
|
|
868
|
+
return n.exec(s);
|
|
869
|
+
throw new TypeError("parser must be boolean|regexp|function");
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
has(e, n) {
|
|
874
|
+
if (e = ce(e), e) {
|
|
875
|
+
const r = c.findKey(this, e);
|
|
876
|
+
return !!(r && this[r] !== void 0 && (!n || Se(this, this[r], r, n)));
|
|
877
|
+
}
|
|
878
|
+
return !1;
|
|
879
|
+
}
|
|
880
|
+
delete(e, n) {
|
|
881
|
+
const r = this;
|
|
882
|
+
let s = !1;
|
|
883
|
+
function o(i) {
|
|
884
|
+
if (i = ce(i), i) {
|
|
885
|
+
const a = c.findKey(r, i);
|
|
886
|
+
a && (!n || Se(r, r[a], a, n)) && (delete r[a], s = !0);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
return c.isArray(e) ? e.forEach(o) : o(e), s;
|
|
890
|
+
}
|
|
891
|
+
clear(e) {
|
|
892
|
+
const n = Object.keys(this);
|
|
893
|
+
let r = n.length, s = !1;
|
|
894
|
+
for (; r--; ) {
|
|
895
|
+
const o = n[r];
|
|
896
|
+
(!e || Se(this, this[o], o, e, !0)) && (delete this[o], s = !0);
|
|
897
|
+
}
|
|
898
|
+
return s;
|
|
899
|
+
}
|
|
900
|
+
normalize(e) {
|
|
901
|
+
const n = this, r = {};
|
|
902
|
+
return c.forEach(this, (s, o) => {
|
|
903
|
+
const i = c.findKey(r, o);
|
|
904
|
+
if (i) {
|
|
905
|
+
n[i] = Oe(s), delete n[o];
|
|
906
|
+
return;
|
|
907
|
+
}
|
|
908
|
+
const a = e ? zr(o) : String(o).trim();
|
|
909
|
+
a !== o && delete n[o], n[a] = Oe(s), r[a] = !0;
|
|
910
|
+
}), this;
|
|
911
|
+
}
|
|
912
|
+
concat(...e) {
|
|
913
|
+
return this.constructor.concat(this, ...e);
|
|
914
|
+
}
|
|
915
|
+
toJSON(e) {
|
|
916
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
917
|
+
return c.forEach(this, (r, s) => {
|
|
918
|
+
r != null && r !== !1 && (n[s] = e && c.isArray(r) ? r.join(", ") : r);
|
|
919
|
+
}), n;
|
|
920
|
+
}
|
|
921
|
+
[Symbol.iterator]() {
|
|
922
|
+
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
923
|
+
}
|
|
924
|
+
toString() {
|
|
925
|
+
return Object.entries(this.toJSON()).map(([e, n]) => e + ": " + n).join(`
|
|
926
|
+
`);
|
|
927
|
+
}
|
|
928
|
+
getSetCookie() {
|
|
929
|
+
return this.get("set-cookie") || [];
|
|
930
|
+
}
|
|
931
|
+
get [Symbol.toStringTag]() {
|
|
932
|
+
return "AxiosHeaders";
|
|
933
|
+
}
|
|
934
|
+
static from(e) {
|
|
935
|
+
return e instanceof this ? e : new this(e);
|
|
936
|
+
}
|
|
937
|
+
static concat(e, ...n) {
|
|
938
|
+
const r = new this(e);
|
|
939
|
+
return n.forEach((s) => r.set(s)), r;
|
|
940
|
+
}
|
|
941
|
+
static accessor(e) {
|
|
942
|
+
const r = (this[ct] = this[ct] = {
|
|
943
|
+
accessors: {}
|
|
944
|
+
}).accessors, s = this.prototype;
|
|
945
|
+
function o(i) {
|
|
946
|
+
const a = ce(i);
|
|
947
|
+
r[a] || (Qr(s, i), r[a] = !0);
|
|
948
|
+
}
|
|
949
|
+
return c.isArray(e) ? e.forEach(o) : o(e), this;
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
L.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
953
|
+
c.reduceDescriptors(L.prototype, ({ value: t }, e) => {
|
|
954
|
+
let n = e[0].toUpperCase() + e.slice(1);
|
|
955
|
+
return {
|
|
956
|
+
get: () => t,
|
|
957
|
+
set(r) {
|
|
958
|
+
this[n] = r;
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
});
|
|
962
|
+
c.freezeMethods(L);
|
|
963
|
+
function Fe(t, e) {
|
|
964
|
+
const n = this || pe, r = e || n, s = L.from(r.headers);
|
|
965
|
+
let o = r.data;
|
|
966
|
+
return c.forEach(t, function(a) {
|
|
967
|
+
o = a.call(n, o, s.normalize(), e ? e.status : void 0);
|
|
968
|
+
}), s.normalize(), o;
|
|
969
|
+
}
|
|
970
|
+
function Yt(t) {
|
|
971
|
+
return !!(t && t.__CANCEL__);
|
|
972
|
+
}
|
|
973
|
+
function oe(t, e, n) {
|
|
974
|
+
g.call(this, t ?? "canceled", g.ERR_CANCELED, e, n), this.name = "CanceledError";
|
|
975
|
+
}
|
|
976
|
+
c.inherits(oe, g, {
|
|
977
|
+
__CANCEL__: !0
|
|
978
|
+
});
|
|
979
|
+
function Wt(t, e, n) {
|
|
980
|
+
const r = n.config.validateStatus;
|
|
981
|
+
!n.status || !r || r(n.status) ? t(n) : e(new g(
|
|
982
|
+
"Request failed with status code " + n.status,
|
|
983
|
+
[g.ERR_BAD_REQUEST, g.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
|
|
984
|
+
n.config,
|
|
985
|
+
n.request,
|
|
986
|
+
n
|
|
987
|
+
));
|
|
988
|
+
}
|
|
989
|
+
function Xr(t) {
|
|
990
|
+
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
|
|
991
|
+
return e && e[1] || "";
|
|
992
|
+
}
|
|
993
|
+
function Vr(t, e) {
|
|
994
|
+
t = t || 10;
|
|
995
|
+
const n = new Array(t), r = new Array(t);
|
|
996
|
+
let s = 0, o = 0, i;
|
|
997
|
+
return e = e !== void 0 ? e : 1e3, function(f) {
|
|
998
|
+
const l = Date.now(), u = r[o];
|
|
999
|
+
i || (i = l), n[s] = f, r[s] = l;
|
|
1000
|
+
let m = o, p = 0;
|
|
1001
|
+
for (; m !== s; )
|
|
1002
|
+
p += n[m++], m = m % t;
|
|
1003
|
+
if (s = (s + 1) % t, s === o && (o = (o + 1) % t), l - i < e)
|
|
1004
|
+
return;
|
|
1005
|
+
const b = u && l - u;
|
|
1006
|
+
return b ? Math.round(p * 1e3 / b) : void 0;
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function Jr(t, e) {
|
|
1010
|
+
let n = 0, r = 1e3 / e, s, o;
|
|
1011
|
+
const i = (l, u = Date.now()) => {
|
|
1012
|
+
n = u, s = null, o && (clearTimeout(o), o = null), t(...l);
|
|
1013
|
+
};
|
|
1014
|
+
return [(...l) => {
|
|
1015
|
+
const u = Date.now(), m = u - n;
|
|
1016
|
+
m >= r ? i(l, u) : (s = l, o || (o = setTimeout(() => {
|
|
1017
|
+
o = null, i(s);
|
|
1018
|
+
}, r - m)));
|
|
1019
|
+
}, () => s && i(s)];
|
|
1020
|
+
}
|
|
1021
|
+
const Ee = (t, e, n = 3) => {
|
|
1022
|
+
let r = 0;
|
|
1023
|
+
const s = Vr(50, 250);
|
|
1024
|
+
return Jr((o) => {
|
|
1025
|
+
const i = o.loaded, a = o.lengthComputable ? o.total : void 0, f = i - r, l = s(f), u = i <= a;
|
|
1026
|
+
r = i;
|
|
1027
|
+
const m = {
|
|
1028
|
+
loaded: i,
|
|
1029
|
+
total: a,
|
|
1030
|
+
progress: a ? i / a : void 0,
|
|
1031
|
+
bytes: f,
|
|
1032
|
+
rate: l || void 0,
|
|
1033
|
+
estimated: l && a && u ? (a - i) / l : void 0,
|
|
1034
|
+
event: o,
|
|
1035
|
+
lengthComputable: a != null,
|
|
1036
|
+
[e ? "download" : "upload"]: !0
|
|
1037
|
+
};
|
|
1038
|
+
t(m);
|
|
1039
|
+
}, n);
|
|
1040
|
+
}, ut = (t, e) => {
|
|
1041
|
+
const n = t != null;
|
|
1042
|
+
return [(r) => e[0]({
|
|
1043
|
+
lengthComputable: n,
|
|
1044
|
+
total: t,
|
|
1045
|
+
loaded: r
|
|
1046
|
+
}), e[1]];
|
|
1047
|
+
}, lt = (t) => (...e) => c.asap(() => t(...e)), Gr = C.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (n) => (n = new URL(n, C.origin), t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(
|
|
1048
|
+
new URL(C.origin),
|
|
1049
|
+
C.navigator && /(msie|trident)/i.test(C.navigator.userAgent)
|
|
1050
|
+
) : () => !0, Kr = C.hasStandardBrowserEnv ? (
|
|
1051
|
+
// Standard browser envs support document.cookie
|
|
1052
|
+
{
|
|
1053
|
+
write(t, e, n, r, s, o, i) {
|
|
1054
|
+
if (typeof document > "u") return;
|
|
1055
|
+
const a = [`${t}=${encodeURIComponent(e)}`];
|
|
1056
|
+
c.isNumber(n) && a.push(`expires=${new Date(n).toUTCString()}`), c.isString(r) && a.push(`path=${r}`), c.isString(s) && a.push(`domain=${s}`), o === !0 && a.push("secure"), c.isString(i) && a.push(`SameSite=${i}`), document.cookie = a.join("; ");
|
|
1057
|
+
},
|
|
1058
|
+
read(t) {
|
|
1059
|
+
if (typeof document > "u") return null;
|
|
1060
|
+
const e = document.cookie.match(new RegExp("(?:^|; )" + t + "=([^;]*)"));
|
|
1061
|
+
return e ? decodeURIComponent(e[1]) : null;
|
|
1062
|
+
},
|
|
1063
|
+
remove(t) {
|
|
1064
|
+
this.write(t, "", Date.now() - 864e5, "/");
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
) : (
|
|
1068
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
1069
|
+
{
|
|
1070
|
+
write() {
|
|
1071
|
+
},
|
|
1072
|
+
read() {
|
|
1073
|
+
return null;
|
|
1074
|
+
},
|
|
1075
|
+
remove() {
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
);
|
|
1079
|
+
function Zr(t) {
|
|
1080
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
1081
|
+
}
|
|
1082
|
+
function es(t, e) {
|
|
1083
|
+
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
1084
|
+
}
|
|
1085
|
+
function jt(t, e, n) {
|
|
1086
|
+
let r = !Zr(e);
|
|
1087
|
+
return t && (r || n == !1) ? es(t, e) : e;
|
|
1088
|
+
}
|
|
1089
|
+
const ft = (t) => t instanceof L ? { ...t } : t;
|
|
1090
|
+
function K(t, e) {
|
|
1091
|
+
e = e || {};
|
|
1092
|
+
const n = {};
|
|
1093
|
+
function r(l, u, m, p) {
|
|
1094
|
+
return c.isPlainObject(l) && c.isPlainObject(u) ? c.merge.call({ caseless: p }, l, u) : c.isPlainObject(u) ? c.merge({}, u) : c.isArray(u) ? u.slice() : u;
|
|
1095
|
+
}
|
|
1096
|
+
function s(l, u, m, p) {
|
|
1097
|
+
if (c.isUndefined(u)) {
|
|
1098
|
+
if (!c.isUndefined(l))
|
|
1099
|
+
return r(void 0, l, m, p);
|
|
1100
|
+
} else return r(l, u, m, p);
|
|
1101
|
+
}
|
|
1102
|
+
function o(l, u) {
|
|
1103
|
+
if (!c.isUndefined(u))
|
|
1104
|
+
return r(void 0, u);
|
|
1105
|
+
}
|
|
1106
|
+
function i(l, u) {
|
|
1107
|
+
if (c.isUndefined(u)) {
|
|
1108
|
+
if (!c.isUndefined(l))
|
|
1109
|
+
return r(void 0, l);
|
|
1110
|
+
} else return r(void 0, u);
|
|
1111
|
+
}
|
|
1112
|
+
function a(l, u, m) {
|
|
1113
|
+
if (m in e)
|
|
1114
|
+
return r(l, u);
|
|
1115
|
+
if (m in t)
|
|
1116
|
+
return r(void 0, l);
|
|
1117
|
+
}
|
|
1118
|
+
const f = {
|
|
1119
|
+
url: o,
|
|
1120
|
+
method: o,
|
|
1121
|
+
data: o,
|
|
1122
|
+
baseURL: i,
|
|
1123
|
+
transformRequest: i,
|
|
1124
|
+
transformResponse: i,
|
|
1125
|
+
paramsSerializer: i,
|
|
1126
|
+
timeout: i,
|
|
1127
|
+
timeoutMessage: i,
|
|
1128
|
+
withCredentials: i,
|
|
1129
|
+
withXSRFToken: i,
|
|
1130
|
+
adapter: i,
|
|
1131
|
+
responseType: i,
|
|
1132
|
+
xsrfCookieName: i,
|
|
1133
|
+
xsrfHeaderName: i,
|
|
1134
|
+
onUploadProgress: i,
|
|
1135
|
+
onDownloadProgress: i,
|
|
1136
|
+
decompress: i,
|
|
1137
|
+
maxContentLength: i,
|
|
1138
|
+
maxBodyLength: i,
|
|
1139
|
+
beforeRedirect: i,
|
|
1140
|
+
transport: i,
|
|
1141
|
+
httpAgent: i,
|
|
1142
|
+
httpsAgent: i,
|
|
1143
|
+
cancelToken: i,
|
|
1144
|
+
socketPath: i,
|
|
1145
|
+
responseEncoding: i,
|
|
1146
|
+
validateStatus: a,
|
|
1147
|
+
headers: (l, u, m) => s(ft(l), ft(u), m, !0)
|
|
1148
|
+
};
|
|
1149
|
+
return c.forEach(Object.keys({ ...t, ...e }), function(u) {
|
|
1150
|
+
const m = f[u] || s, p = m(t[u], e[u], u);
|
|
1151
|
+
c.isUndefined(p) && m !== a || (n[u] = p);
|
|
1152
|
+
}), n;
|
|
1153
|
+
}
|
|
1154
|
+
const Ut = (t) => {
|
|
1155
|
+
const e = K({}, t);
|
|
1156
|
+
let { data: n, withXSRFToken: r, xsrfHeaderName: s, xsrfCookieName: o, headers: i, auth: a } = e;
|
|
1157
|
+
if (e.headers = i = L.from(i), e.url = Bt(jt(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), a && i.set(
|
|
1158
|
+
"Authorization",
|
|
1159
|
+
"Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
|
|
1160
|
+
), c.isFormData(n)) {
|
|
1161
|
+
if (C.hasStandardBrowserEnv || C.hasStandardBrowserWebWorkerEnv)
|
|
1162
|
+
i.setContentType(void 0);
|
|
1163
|
+
else if (c.isFunction(n.getHeaders)) {
|
|
1164
|
+
const f = n.getHeaders(), l = ["content-type", "content-length"];
|
|
1165
|
+
Object.entries(f).forEach(([u, m]) => {
|
|
1166
|
+
l.includes(u.toLowerCase()) && i.set(u, m);
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
if (C.hasStandardBrowserEnv && (r && c.isFunction(r) && (r = r(e)), r || r !== !1 && Gr(e.url))) {
|
|
1171
|
+
const f = s && o && Kr.read(o);
|
|
1172
|
+
f && i.set(s, f);
|
|
1173
|
+
}
|
|
1174
|
+
return e;
|
|
1175
|
+
}, ts = typeof XMLHttpRequest < "u", ns = ts && function(t) {
|
|
1176
|
+
return new Promise(function(n, r) {
|
|
1177
|
+
const s = Ut(t);
|
|
1178
|
+
let o = s.data;
|
|
1179
|
+
const i = L.from(s.headers).normalize();
|
|
1180
|
+
let { responseType: a, onUploadProgress: f, onDownloadProgress: l } = s, u, m, p, b, d;
|
|
1181
|
+
function w() {
|
|
1182
|
+
b && b(), d && d(), s.cancelToken && s.cancelToken.unsubscribe(u), s.signal && s.signal.removeEventListener("abort", u);
|
|
1183
|
+
}
|
|
1184
|
+
let h = new XMLHttpRequest();
|
|
1185
|
+
h.open(s.method.toUpperCase(), s.url, !0), h.timeout = s.timeout;
|
|
1186
|
+
function y() {
|
|
1187
|
+
if (!h)
|
|
1188
|
+
return;
|
|
1189
|
+
const M = L.from(
|
|
1190
|
+
"getAllResponseHeaders" in h && h.getAllResponseHeaders()
|
|
1191
|
+
), S = {
|
|
1192
|
+
data: !a || a === "text" || a === "json" ? h.responseText : h.response,
|
|
1193
|
+
status: h.status,
|
|
1194
|
+
statusText: h.statusText,
|
|
1195
|
+
headers: M,
|
|
1196
|
+
config: t,
|
|
1197
|
+
request: h
|
|
1198
|
+
};
|
|
1199
|
+
Wt(function($) {
|
|
1200
|
+
n($), w();
|
|
1201
|
+
}, function($) {
|
|
1202
|
+
r($), w();
|
|
1203
|
+
}, S), h = null;
|
|
1204
|
+
}
|
|
1205
|
+
"onloadend" in h ? h.onloadend = y : h.onreadystatechange = function() {
|
|
1206
|
+
!h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(y);
|
|
1207
|
+
}, h.onabort = function() {
|
|
1208
|
+
h && (r(new g("Request aborted", g.ECONNABORTED, t, h)), h = null);
|
|
1209
|
+
}, h.onerror = function(_) {
|
|
1210
|
+
const S = _ && _.message ? _.message : "Network Error", H = new g(S, g.ERR_NETWORK, t, h);
|
|
1211
|
+
H.event = _ || null, r(H), h = null;
|
|
1212
|
+
}, h.ontimeout = function() {
|
|
1213
|
+
let _ = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1214
|
+
const S = s.transitional || It;
|
|
1215
|
+
s.timeoutErrorMessage && (_ = s.timeoutErrorMessage), r(new g(
|
|
1216
|
+
_,
|
|
1217
|
+
S.clarifyTimeoutError ? g.ETIMEDOUT : g.ECONNABORTED,
|
|
1218
|
+
t,
|
|
1219
|
+
h
|
|
1220
|
+
)), h = null;
|
|
1221
|
+
}, o === void 0 && i.setContentType(null), "setRequestHeader" in h && c.forEach(i.toJSON(), function(_, S) {
|
|
1222
|
+
h.setRequestHeader(S, _);
|
|
1223
|
+
}), c.isUndefined(s.withCredentials) || (h.withCredentials = !!s.withCredentials), a && a !== "json" && (h.responseType = s.responseType), l && ([p, d] = Ee(l, !0), h.addEventListener("progress", p)), f && h.upload && ([m, b] = Ee(f), h.upload.addEventListener("progress", m), h.upload.addEventListener("loadend", b)), (s.cancelToken || s.signal) && (u = (M) => {
|
|
1224
|
+
h && (r(!M || M.type ? new oe(null, t, h) : M), h.abort(), h = null);
|
|
1225
|
+
}, s.cancelToken && s.cancelToken.subscribe(u), s.signal && (s.signal.aborted ? u() : s.signal.addEventListener("abort", u)));
|
|
1226
|
+
const E = Xr(s.url);
|
|
1227
|
+
if (E && C.protocols.indexOf(E) === -1) {
|
|
1228
|
+
r(new g("Unsupported protocol " + E + ":", g.ERR_BAD_REQUEST, t));
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
h.send(o || null);
|
|
1232
|
+
});
|
|
1233
|
+
}, rs = (t, e) => {
|
|
1234
|
+
const { length: n } = t = t ? t.filter(Boolean) : [];
|
|
1235
|
+
if (e || n) {
|
|
1236
|
+
let r = new AbortController(), s;
|
|
1237
|
+
const o = function(l) {
|
|
1238
|
+
if (!s) {
|
|
1239
|
+
s = !0, a();
|
|
1240
|
+
const u = l instanceof Error ? l : this.reason;
|
|
1241
|
+
r.abort(u instanceof g ? u : new oe(u instanceof Error ? u.message : u));
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
let i = e && setTimeout(() => {
|
|
1245
|
+
i = null, o(new g(`timeout ${e} of ms exceeded`, g.ETIMEDOUT));
|
|
1246
|
+
}, e);
|
|
1247
|
+
const a = () => {
|
|
1248
|
+
t && (i && clearTimeout(i), i = null, t.forEach((l) => {
|
|
1249
|
+
l.unsubscribe ? l.unsubscribe(o) : l.removeEventListener("abort", o);
|
|
1250
|
+
}), t = null);
|
|
1251
|
+
};
|
|
1252
|
+
t.forEach((l) => l.addEventListener("abort", o));
|
|
1253
|
+
const { signal: f } = r;
|
|
1254
|
+
return f.unsubscribe = () => c.asap(a), f;
|
|
1255
|
+
}
|
|
1256
|
+
}, ss = function* (t, e) {
|
|
1257
|
+
let n = t.byteLength;
|
|
1258
|
+
if (n < e) {
|
|
1259
|
+
yield t;
|
|
1260
|
+
return;
|
|
1261
|
+
}
|
|
1262
|
+
let r = 0, s;
|
|
1263
|
+
for (; r < n; )
|
|
1264
|
+
s = r + e, yield t.slice(r, s), r = s;
|
|
1265
|
+
}, os = async function* (t, e) {
|
|
1266
|
+
for await (const n of is(t))
|
|
1267
|
+
yield* ss(n, e);
|
|
1268
|
+
}, is = async function* (t) {
|
|
1269
|
+
if (t[Symbol.asyncIterator]) {
|
|
1270
|
+
yield* t;
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
const e = t.getReader();
|
|
1274
|
+
try {
|
|
1275
|
+
for (; ; ) {
|
|
1276
|
+
const { done: n, value: r } = await e.read();
|
|
1277
|
+
if (n)
|
|
1278
|
+
break;
|
|
1279
|
+
yield r;
|
|
1280
|
+
}
|
|
1281
|
+
} finally {
|
|
1282
|
+
await e.cancel();
|
|
1283
|
+
}
|
|
1284
|
+
}, dt = (t, e, n, r) => {
|
|
1285
|
+
const s = os(t, e);
|
|
1286
|
+
let o = 0, i, a = (f) => {
|
|
1287
|
+
i || (i = !0, r && r(f));
|
|
1288
|
+
};
|
|
1289
|
+
return new ReadableStream({
|
|
1290
|
+
async pull(f) {
|
|
1291
|
+
try {
|
|
1292
|
+
const { done: l, value: u } = await s.next();
|
|
1293
|
+
if (l) {
|
|
1294
|
+
a(), f.close();
|
|
1295
|
+
return;
|
|
1296
|
+
}
|
|
1297
|
+
let m = u.byteLength;
|
|
1298
|
+
if (n) {
|
|
1299
|
+
let p = o += m;
|
|
1300
|
+
n(p);
|
|
1301
|
+
}
|
|
1302
|
+
f.enqueue(new Uint8Array(u));
|
|
1303
|
+
} catch (l) {
|
|
1304
|
+
throw a(l), l;
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
cancel(f) {
|
|
1308
|
+
return a(f), s.return();
|
|
1309
|
+
}
|
|
1310
|
+
}, {
|
|
1311
|
+
highWaterMark: 2
|
|
1312
|
+
});
|
|
1313
|
+
}, ht = 64 * 1024, { isFunction: be } = c, as = (({ Request: t, Response: e }) => ({
|
|
1314
|
+
Request: t,
|
|
1315
|
+
Response: e
|
|
1316
|
+
}))(c.global), {
|
|
1317
|
+
ReadableStream: mt,
|
|
1318
|
+
TextEncoder: pt
|
|
1319
|
+
} = c.global, wt = (t, ...e) => {
|
|
1320
|
+
try {
|
|
1321
|
+
return !!t(...e);
|
|
1322
|
+
} catch {
|
|
1323
|
+
return !1;
|
|
1324
|
+
}
|
|
1325
|
+
}, cs = (t) => {
|
|
1326
|
+
t = c.merge.call({
|
|
1327
|
+
skipUndefined: !0
|
|
1328
|
+
}, as, t);
|
|
1329
|
+
const { fetch: e, Request: n, Response: r } = t, s = e ? be(e) : typeof fetch == "function", o = be(n), i = be(r);
|
|
1330
|
+
if (!s)
|
|
1331
|
+
return !1;
|
|
1332
|
+
const a = s && be(mt), f = s && (typeof pt == "function" ? /* @__PURE__ */ ((d) => (w) => d.encode(w))(new pt()) : async (d) => new Uint8Array(await new n(d).arrayBuffer())), l = o && a && wt(() => {
|
|
1333
|
+
let d = !1;
|
|
1334
|
+
const w = new n(C.origin, {
|
|
1335
|
+
body: new mt(),
|
|
1336
|
+
method: "POST",
|
|
1337
|
+
get duplex() {
|
|
1338
|
+
return d = !0, "half";
|
|
1339
|
+
}
|
|
1340
|
+
}).headers.has("Content-Type");
|
|
1341
|
+
return d && !w;
|
|
1342
|
+
}), u = i && a && wt(() => c.isReadableStream(new r("").body)), m = {
|
|
1343
|
+
stream: u && ((d) => d.body)
|
|
1344
|
+
};
|
|
1345
|
+
s && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
|
|
1346
|
+
!m[d] && (m[d] = (w, h) => {
|
|
1347
|
+
let y = w && w[d];
|
|
1348
|
+
if (y)
|
|
1349
|
+
return y.call(w);
|
|
1350
|
+
throw new g(`Response type '${d}' is not supported`, g.ERR_NOT_SUPPORT, h);
|
|
1351
|
+
});
|
|
1352
|
+
});
|
|
1353
|
+
const p = async (d) => {
|
|
1354
|
+
if (d == null)
|
|
1355
|
+
return 0;
|
|
1356
|
+
if (c.isBlob(d))
|
|
1357
|
+
return d.size;
|
|
1358
|
+
if (c.isSpecCompliantForm(d))
|
|
1359
|
+
return (await new n(C.origin, {
|
|
1360
|
+
method: "POST",
|
|
1361
|
+
body: d
|
|
1362
|
+
}).arrayBuffer()).byteLength;
|
|
1363
|
+
if (c.isArrayBufferView(d) || c.isArrayBuffer(d))
|
|
1364
|
+
return d.byteLength;
|
|
1365
|
+
if (c.isURLSearchParams(d) && (d = d + ""), c.isString(d))
|
|
1366
|
+
return (await f(d)).byteLength;
|
|
1367
|
+
}, b = async (d, w) => {
|
|
1368
|
+
const h = c.toFiniteNumber(d.getContentLength());
|
|
1369
|
+
return h ?? p(w);
|
|
1370
|
+
};
|
|
1371
|
+
return async (d) => {
|
|
1372
|
+
let {
|
|
1373
|
+
url: w,
|
|
1374
|
+
method: h,
|
|
1375
|
+
data: y,
|
|
1376
|
+
signal: E,
|
|
1377
|
+
cancelToken: M,
|
|
1378
|
+
timeout: _,
|
|
1379
|
+
onDownloadProgress: S,
|
|
1380
|
+
onUploadProgress: H,
|
|
1381
|
+
responseType: $,
|
|
1382
|
+
headers: Ne,
|
|
1383
|
+
withCredentials: we = "same-origin",
|
|
1384
|
+
fetchOptions: Ke
|
|
1385
|
+
} = Ut(d), Ze = e || fetch;
|
|
1386
|
+
$ = $ ? ($ + "").toLowerCase() : "text";
|
|
1387
|
+
let ye = rs([E, M && M.toAbortSignal()], _), ae = null;
|
|
1388
|
+
const X = ye && ye.unsubscribe && (() => {
|
|
1389
|
+
ye.unsubscribe();
|
|
1390
|
+
});
|
|
1391
|
+
let et;
|
|
1392
|
+
try {
|
|
1393
|
+
if (H && l && h !== "get" && h !== "head" && (et = await b(Ne, y)) !== 0) {
|
|
1394
|
+
let U = new n(w, {
|
|
1395
|
+
method: "POST",
|
|
1396
|
+
body: y,
|
|
1397
|
+
duplex: "half"
|
|
1398
|
+
}), ee;
|
|
1399
|
+
if (c.isFormData(y) && (ee = U.headers.get("content-type")) && Ne.setContentType(ee), U.body) {
|
|
1400
|
+
const [Ce, ge] = ut(
|
|
1401
|
+
et,
|
|
1402
|
+
Ee(lt(H))
|
|
1403
|
+
);
|
|
1404
|
+
y = dt(U.body, ht, Ce, ge);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
c.isString(we) || (we = we ? "include" : "omit");
|
|
1408
|
+
const B = o && "credentials" in n.prototype, tt = {
|
|
1409
|
+
...Ke,
|
|
1410
|
+
signal: ye,
|
|
1411
|
+
method: h.toUpperCase(),
|
|
1412
|
+
headers: Ne.normalize().toJSON(),
|
|
1413
|
+
body: y,
|
|
1414
|
+
duplex: "half",
|
|
1415
|
+
credentials: B ? we : void 0
|
|
1416
|
+
};
|
|
1417
|
+
ae = o && new n(w, tt);
|
|
1418
|
+
let j = await (o ? Ze(ae, Ke) : Ze(w, tt));
|
|
1419
|
+
const nt = u && ($ === "stream" || $ === "response");
|
|
1420
|
+
if (u && (S || nt && X)) {
|
|
1421
|
+
const U = {};
|
|
1422
|
+
["status", "statusText", "headers"].forEach((rt) => {
|
|
1423
|
+
U[rt] = j[rt];
|
|
1424
|
+
});
|
|
1425
|
+
const ee = c.toFiniteNumber(j.headers.get("content-length")), [Ce, ge] = S && ut(
|
|
1426
|
+
ee,
|
|
1427
|
+
Ee(lt(S), !0)
|
|
1428
|
+
) || [];
|
|
1429
|
+
j = new r(
|
|
1430
|
+
dt(j.body, ht, Ce, () => {
|
|
1431
|
+
ge && ge(), X && X();
|
|
1432
|
+
}),
|
|
1433
|
+
U
|
|
1434
|
+
);
|
|
1435
|
+
}
|
|
1436
|
+
$ = $ || "text";
|
|
1437
|
+
let bn = await m[c.findKey(m, $) || "text"](j, d);
|
|
1438
|
+
return !nt && X && X(), await new Promise((U, ee) => {
|
|
1439
|
+
Wt(U, ee, {
|
|
1440
|
+
data: bn,
|
|
1441
|
+
headers: L.from(j.headers),
|
|
1442
|
+
status: j.status,
|
|
1443
|
+
statusText: j.statusText,
|
|
1444
|
+
config: d,
|
|
1445
|
+
request: ae
|
|
1446
|
+
});
|
|
1447
|
+
});
|
|
1448
|
+
} catch (B) {
|
|
1449
|
+
throw X && X(), B && B.name === "TypeError" && /Load failed|fetch/i.test(B.message) ? Object.assign(
|
|
1450
|
+
new g("Network Error", g.ERR_NETWORK, d, ae),
|
|
1451
|
+
{
|
|
1452
|
+
cause: B.cause || B
|
|
1453
|
+
}
|
|
1454
|
+
) : g.from(B, B && B.code, d, ae);
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
}, us = /* @__PURE__ */ new Map(), zt = (t) => {
|
|
1458
|
+
let e = t && t.env || {};
|
|
1459
|
+
const { fetch: n, Request: r, Response: s } = e, o = [
|
|
1460
|
+
r,
|
|
1461
|
+
s,
|
|
1462
|
+
n
|
|
1463
|
+
];
|
|
1464
|
+
let i = o.length, a = i, f, l, u = us;
|
|
1465
|
+
for (; a--; )
|
|
1466
|
+
f = o[a], l = u.get(f), l === void 0 && u.set(f, l = a ? /* @__PURE__ */ new Map() : cs(e)), u = l;
|
|
1467
|
+
return l;
|
|
1468
|
+
};
|
|
1469
|
+
zt();
|
|
1470
|
+
const ze = {
|
|
1471
|
+
http: Mr,
|
|
1472
|
+
xhr: ns,
|
|
1473
|
+
fetch: {
|
|
1474
|
+
get: zt
|
|
1475
|
+
}
|
|
1476
|
+
};
|
|
1477
|
+
c.forEach(ze, (t, e) => {
|
|
1478
|
+
if (t) {
|
|
1479
|
+
try {
|
|
1480
|
+
Object.defineProperty(t, "name", { value: e });
|
|
1481
|
+
} catch {
|
|
1482
|
+
}
|
|
1483
|
+
Object.defineProperty(t, "adapterName", { value: e });
|
|
1484
|
+
}
|
|
1485
|
+
});
|
|
1486
|
+
const yt = (t) => `- ${t}`, ls = (t) => c.isFunction(t) || t === null || t === !1;
|
|
1487
|
+
function fs(t, e) {
|
|
1488
|
+
t = c.isArray(t) ? t : [t];
|
|
1489
|
+
const { length: n } = t;
|
|
1490
|
+
let r, s;
|
|
1491
|
+
const o = {};
|
|
1492
|
+
for (let i = 0; i < n; i++) {
|
|
1493
|
+
r = t[i];
|
|
1494
|
+
let a;
|
|
1495
|
+
if (s = r, !ls(r) && (s = ze[(a = String(r)).toLowerCase()], s === void 0))
|
|
1496
|
+
throw new g(`Unknown adapter '${a}'`);
|
|
1497
|
+
if (s && (c.isFunction(s) || (s = s.get(e))))
|
|
1498
|
+
break;
|
|
1499
|
+
o[a || "#" + i] = s;
|
|
1500
|
+
}
|
|
1501
|
+
if (!s) {
|
|
1502
|
+
const i = Object.entries(o).map(
|
|
1503
|
+
([f, l]) => `adapter ${f} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1504
|
+
);
|
|
1505
|
+
let a = n ? i.length > 1 ? `since :
|
|
1506
|
+
` + i.map(yt).join(`
|
|
1507
|
+
`) : " " + yt(i[0]) : "as no adapter specified";
|
|
1508
|
+
throw new g(
|
|
1509
|
+
"There is no suitable adapter to dispatch the request " + a,
|
|
1510
|
+
"ERR_NOT_SUPPORT"
|
|
1511
|
+
);
|
|
1512
|
+
}
|
|
1513
|
+
return s;
|
|
1514
|
+
}
|
|
1515
|
+
const Qt = {
|
|
1516
|
+
/**
|
|
1517
|
+
* Resolve an adapter from a list of adapter names or functions.
|
|
1518
|
+
* @type {Function}
|
|
1519
|
+
*/
|
|
1520
|
+
getAdapter: fs,
|
|
1521
|
+
/**
|
|
1522
|
+
* Exposes all known adapters
|
|
1523
|
+
* @type {Object<string, Function|Object>}
|
|
1524
|
+
*/
|
|
1525
|
+
adapters: ze
|
|
1526
|
+
};
|
|
1527
|
+
function Le(t) {
|
|
1528
|
+
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1529
|
+
throw new oe(null, t);
|
|
1530
|
+
}
|
|
1531
|
+
function gt(t) {
|
|
1532
|
+
return Le(t), t.headers = L.from(t.headers), t.data = Fe.call(
|
|
1533
|
+
t,
|
|
1534
|
+
t.transformRequest
|
|
1535
|
+
), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Qt.getAdapter(t.adapter || pe.adapter, t)(t).then(function(r) {
|
|
1536
|
+
return Le(t), r.data = Fe.call(
|
|
1537
|
+
t,
|
|
1538
|
+
t.transformResponse,
|
|
1539
|
+
r
|
|
1540
|
+
), r.headers = L.from(r.headers), r;
|
|
1541
|
+
}, function(r) {
|
|
1542
|
+
return Yt(r) || (Le(t), r && r.response && (r.response.data = Fe.call(
|
|
1543
|
+
t,
|
|
1544
|
+
t.transformResponse,
|
|
1545
|
+
r.response
|
|
1546
|
+
), r.response.headers = L.from(r.response.headers))), Promise.reject(r);
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
const Xt = "1.13.2", _e = {};
|
|
1550
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1551
|
+
_e[t] = function(r) {
|
|
1552
|
+
return typeof r === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1553
|
+
};
|
|
1554
|
+
});
|
|
1555
|
+
const bt = {};
|
|
1556
|
+
_e.transitional = function(e, n, r) {
|
|
1557
|
+
function s(o, i) {
|
|
1558
|
+
return "[Axios v" + Xt + "] Transitional option '" + o + "'" + i + (r ? ". " + r : "");
|
|
1559
|
+
}
|
|
1560
|
+
return (o, i, a) => {
|
|
1561
|
+
if (e === !1)
|
|
1562
|
+
throw new g(
|
|
1563
|
+
s(i, " has been removed" + (n ? " in " + n : "")),
|
|
1564
|
+
g.ERR_DEPRECATED
|
|
1565
|
+
);
|
|
1566
|
+
return n && !bt[i] && (bt[i] = !0, console.warn(
|
|
1567
|
+
s(
|
|
1568
|
+
i,
|
|
1569
|
+
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
1570
|
+
)
|
|
1571
|
+
)), e ? e(o, i, a) : !0;
|
|
1572
|
+
};
|
|
1573
|
+
};
|
|
1574
|
+
_e.spelling = function(e) {
|
|
1575
|
+
return (n, r) => (console.warn(`${r} is likely a misspelling of ${e}`), !0);
|
|
1576
|
+
};
|
|
1577
|
+
function ds(t, e, n) {
|
|
1578
|
+
if (typeof t != "object")
|
|
1579
|
+
throw new g("options must be an object", g.ERR_BAD_OPTION_VALUE);
|
|
1580
|
+
const r = Object.keys(t);
|
|
1581
|
+
let s = r.length;
|
|
1582
|
+
for (; s-- > 0; ) {
|
|
1583
|
+
const o = r[s], i = e[o];
|
|
1584
|
+
if (i) {
|
|
1585
|
+
const a = t[o], f = a === void 0 || i(a, o, t);
|
|
1586
|
+
if (f !== !0)
|
|
1587
|
+
throw new g("option " + o + " must be " + f, g.ERR_BAD_OPTION_VALUE);
|
|
1588
|
+
continue;
|
|
1589
|
+
}
|
|
1590
|
+
if (n !== !0)
|
|
1591
|
+
throw new g("Unknown option " + o, g.ERR_BAD_OPTION);
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
const Te = {
|
|
1595
|
+
assertOptions: ds,
|
|
1596
|
+
validators: _e
|
|
1597
|
+
}, I = Te.validators;
|
|
1598
|
+
let G = class {
|
|
1599
|
+
constructor(e) {
|
|
1600
|
+
this.defaults = e || {}, this.interceptors = {
|
|
1601
|
+
request: new at(),
|
|
1602
|
+
response: new at()
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Dispatch a request
|
|
1607
|
+
*
|
|
1608
|
+
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
1609
|
+
* @param {?Object} config
|
|
1610
|
+
*
|
|
1611
|
+
* @returns {Promise} The Promise to be fulfilled
|
|
1612
|
+
*/
|
|
1613
|
+
async request(e, n) {
|
|
1614
|
+
try {
|
|
1615
|
+
return await this._request(e, n);
|
|
1616
|
+
} catch (r) {
|
|
1617
|
+
if (r instanceof Error) {
|
|
1618
|
+
let s = {};
|
|
1619
|
+
Error.captureStackTrace ? Error.captureStackTrace(s) : s = new Error();
|
|
1620
|
+
const o = s.stack ? s.stack.replace(/^.+\n/, "") : "";
|
|
1621
|
+
try {
|
|
1622
|
+
r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += `
|
|
1623
|
+
` + o) : r.stack = o;
|
|
1624
|
+
} catch {
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
throw r;
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
_request(e, n) {
|
|
1631
|
+
typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = K(this.defaults, n);
|
|
1632
|
+
const { transitional: r, paramsSerializer: s, headers: o } = n;
|
|
1633
|
+
r !== void 0 && Te.assertOptions(r, {
|
|
1634
|
+
silentJSONParsing: I.transitional(I.boolean),
|
|
1635
|
+
forcedJSONParsing: I.transitional(I.boolean),
|
|
1636
|
+
clarifyTimeoutError: I.transitional(I.boolean)
|
|
1637
|
+
}, !1), s != null && (c.isFunction(s) ? n.paramsSerializer = {
|
|
1638
|
+
serialize: s
|
|
1639
|
+
} : Te.assertOptions(s, {
|
|
1640
|
+
encode: I.function,
|
|
1641
|
+
serialize: I.function
|
|
1642
|
+
}, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), Te.assertOptions(n, {
|
|
1643
|
+
baseUrl: I.spelling("baseURL"),
|
|
1644
|
+
withXsrfToken: I.spelling("withXSRFToken")
|
|
1645
|
+
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1646
|
+
let i = o && c.merge(
|
|
1647
|
+
o.common,
|
|
1648
|
+
o[n.method]
|
|
1649
|
+
);
|
|
1650
|
+
o && c.forEach(
|
|
1651
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1652
|
+
(d) => {
|
|
1653
|
+
delete o[d];
|
|
1654
|
+
}
|
|
1655
|
+
), n.headers = L.concat(i, o);
|
|
1656
|
+
const a = [];
|
|
1657
|
+
let f = !0;
|
|
1658
|
+
this.interceptors.request.forEach(function(w) {
|
|
1659
|
+
typeof w.runWhen == "function" && w.runWhen(n) === !1 || (f = f && w.synchronous, a.unshift(w.fulfilled, w.rejected));
|
|
1660
|
+
});
|
|
1661
|
+
const l = [];
|
|
1662
|
+
this.interceptors.response.forEach(function(w) {
|
|
1663
|
+
l.push(w.fulfilled, w.rejected);
|
|
1664
|
+
});
|
|
1665
|
+
let u, m = 0, p;
|
|
1666
|
+
if (!f) {
|
|
1667
|
+
const d = [gt.bind(this), void 0];
|
|
1668
|
+
for (d.unshift(...a), d.push(...l), p = d.length, u = Promise.resolve(n); m < p; )
|
|
1669
|
+
u = u.then(d[m++], d[m++]);
|
|
1670
|
+
return u;
|
|
1671
|
+
}
|
|
1672
|
+
p = a.length;
|
|
1673
|
+
let b = n;
|
|
1674
|
+
for (; m < p; ) {
|
|
1675
|
+
const d = a[m++], w = a[m++];
|
|
1676
|
+
try {
|
|
1677
|
+
b = d(b);
|
|
1678
|
+
} catch (h) {
|
|
1679
|
+
w.call(this, h);
|
|
1680
|
+
break;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
try {
|
|
1684
|
+
u = gt.call(this, b);
|
|
1685
|
+
} catch (d) {
|
|
1686
|
+
return Promise.reject(d);
|
|
1687
|
+
}
|
|
1688
|
+
for (m = 0, p = l.length; m < p; )
|
|
1689
|
+
u = u.then(l[m++], l[m++]);
|
|
1690
|
+
return u;
|
|
1691
|
+
}
|
|
1692
|
+
getUri(e) {
|
|
1693
|
+
e = K(this.defaults, e);
|
|
1694
|
+
const n = jt(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1695
|
+
return Bt(n, e.params, e.paramsSerializer);
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
c.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1699
|
+
G.prototype[e] = function(n, r) {
|
|
1700
|
+
return this.request(K(r || {}, {
|
|
1701
|
+
method: e,
|
|
1702
|
+
url: n,
|
|
1703
|
+
data: (r || {}).data
|
|
1704
|
+
}));
|
|
1705
|
+
};
|
|
1706
|
+
});
|
|
1707
|
+
c.forEach(["post", "put", "patch"], function(e) {
|
|
1708
|
+
function n(r) {
|
|
1709
|
+
return function(o, i, a) {
|
|
1710
|
+
return this.request(K(a || {}, {
|
|
1711
|
+
method: e,
|
|
1712
|
+
headers: r ? {
|
|
1713
|
+
"Content-Type": "multipart/form-data"
|
|
1714
|
+
} : {},
|
|
1715
|
+
url: o,
|
|
1716
|
+
data: i
|
|
1717
|
+
}));
|
|
1718
|
+
};
|
|
1719
|
+
}
|
|
1720
|
+
G.prototype[e] = n(), G.prototype[e + "Form"] = n(!0);
|
|
1721
|
+
});
|
|
1722
|
+
let hs = class Vt {
|
|
1723
|
+
constructor(e) {
|
|
1724
|
+
if (typeof e != "function")
|
|
1725
|
+
throw new TypeError("executor must be a function.");
|
|
1726
|
+
let n;
|
|
1727
|
+
this.promise = new Promise(function(o) {
|
|
1728
|
+
n = o;
|
|
1729
|
+
});
|
|
1730
|
+
const r = this;
|
|
1731
|
+
this.promise.then((s) => {
|
|
1732
|
+
if (!r._listeners) return;
|
|
1733
|
+
let o = r._listeners.length;
|
|
1734
|
+
for (; o-- > 0; )
|
|
1735
|
+
r._listeners[o](s);
|
|
1736
|
+
r._listeners = null;
|
|
1737
|
+
}), this.promise.then = (s) => {
|
|
1738
|
+
let o;
|
|
1739
|
+
const i = new Promise((a) => {
|
|
1740
|
+
r.subscribe(a), o = a;
|
|
1741
|
+
}).then(s);
|
|
1742
|
+
return i.cancel = function() {
|
|
1743
|
+
r.unsubscribe(o);
|
|
1744
|
+
}, i;
|
|
1745
|
+
}, e(function(o, i, a) {
|
|
1746
|
+
r.reason || (r.reason = new oe(o, i, a), n(r.reason));
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
/**
|
|
1750
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
1751
|
+
*/
|
|
1752
|
+
throwIfRequested() {
|
|
1753
|
+
if (this.reason)
|
|
1754
|
+
throw this.reason;
|
|
1755
|
+
}
|
|
1756
|
+
/**
|
|
1757
|
+
* Subscribe to the cancel signal
|
|
1758
|
+
*/
|
|
1759
|
+
subscribe(e) {
|
|
1760
|
+
if (this.reason) {
|
|
1761
|
+
e(this.reason);
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
this._listeners ? this._listeners.push(e) : this._listeners = [e];
|
|
1765
|
+
}
|
|
1766
|
+
/**
|
|
1767
|
+
* Unsubscribe from the cancel signal
|
|
1768
|
+
*/
|
|
1769
|
+
unsubscribe(e) {
|
|
1770
|
+
if (!this._listeners)
|
|
1771
|
+
return;
|
|
1772
|
+
const n = this._listeners.indexOf(e);
|
|
1773
|
+
n !== -1 && this._listeners.splice(n, 1);
|
|
1774
|
+
}
|
|
1775
|
+
toAbortSignal() {
|
|
1776
|
+
const e = new AbortController(), n = (r) => {
|
|
1777
|
+
e.abort(r);
|
|
1778
|
+
};
|
|
1779
|
+
return this.subscribe(n), e.signal.unsubscribe = () => this.unsubscribe(n), e.signal;
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
1783
|
+
* cancels the `CancelToken`.
|
|
1784
|
+
*/
|
|
1785
|
+
static source() {
|
|
1786
|
+
let e;
|
|
1787
|
+
return {
|
|
1788
|
+
token: new Vt(function(s) {
|
|
1789
|
+
e = s;
|
|
1790
|
+
}),
|
|
1791
|
+
cancel: e
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
};
|
|
1795
|
+
function ms(t) {
|
|
1796
|
+
return function(n) {
|
|
1797
|
+
return t.apply(null, n);
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
function ps(t) {
|
|
1801
|
+
return c.isObject(t) && t.isAxiosError === !0;
|
|
1802
|
+
}
|
|
1803
|
+
const Ie = {
|
|
1804
|
+
Continue: 100,
|
|
1805
|
+
SwitchingProtocols: 101,
|
|
1806
|
+
Processing: 102,
|
|
1807
|
+
EarlyHints: 103,
|
|
1808
|
+
Ok: 200,
|
|
1809
|
+
Created: 201,
|
|
1810
|
+
Accepted: 202,
|
|
1811
|
+
NonAuthoritativeInformation: 203,
|
|
1812
|
+
NoContent: 204,
|
|
1813
|
+
ResetContent: 205,
|
|
1814
|
+
PartialContent: 206,
|
|
1815
|
+
MultiStatus: 207,
|
|
1816
|
+
AlreadyReported: 208,
|
|
1817
|
+
ImUsed: 226,
|
|
1818
|
+
MultipleChoices: 300,
|
|
1819
|
+
MovedPermanently: 301,
|
|
1820
|
+
Found: 302,
|
|
1821
|
+
SeeOther: 303,
|
|
1822
|
+
NotModified: 304,
|
|
1823
|
+
UseProxy: 305,
|
|
1824
|
+
Unused: 306,
|
|
1825
|
+
TemporaryRedirect: 307,
|
|
1826
|
+
PermanentRedirect: 308,
|
|
1827
|
+
BadRequest: 400,
|
|
1828
|
+
Unauthorized: 401,
|
|
1829
|
+
PaymentRequired: 402,
|
|
1830
|
+
Forbidden: 403,
|
|
1831
|
+
NotFound: 404,
|
|
1832
|
+
MethodNotAllowed: 405,
|
|
1833
|
+
NotAcceptable: 406,
|
|
1834
|
+
ProxyAuthenticationRequired: 407,
|
|
1835
|
+
RequestTimeout: 408,
|
|
1836
|
+
Conflict: 409,
|
|
1837
|
+
Gone: 410,
|
|
1838
|
+
LengthRequired: 411,
|
|
1839
|
+
PreconditionFailed: 412,
|
|
1840
|
+
PayloadTooLarge: 413,
|
|
1841
|
+
UriTooLong: 414,
|
|
1842
|
+
UnsupportedMediaType: 415,
|
|
1843
|
+
RangeNotSatisfiable: 416,
|
|
1844
|
+
ExpectationFailed: 417,
|
|
1845
|
+
ImATeapot: 418,
|
|
1846
|
+
MisdirectedRequest: 421,
|
|
1847
|
+
UnprocessableEntity: 422,
|
|
1848
|
+
Locked: 423,
|
|
1849
|
+
FailedDependency: 424,
|
|
1850
|
+
TooEarly: 425,
|
|
1851
|
+
UpgradeRequired: 426,
|
|
1852
|
+
PreconditionRequired: 428,
|
|
1853
|
+
TooManyRequests: 429,
|
|
1854
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
1855
|
+
UnavailableForLegalReasons: 451,
|
|
1856
|
+
InternalServerError: 500,
|
|
1857
|
+
NotImplemented: 501,
|
|
1858
|
+
BadGateway: 502,
|
|
1859
|
+
ServiceUnavailable: 503,
|
|
1860
|
+
GatewayTimeout: 504,
|
|
1861
|
+
HttpVersionNotSupported: 505,
|
|
1862
|
+
VariantAlsoNegotiates: 506,
|
|
1863
|
+
InsufficientStorage: 507,
|
|
1864
|
+
LoopDetected: 508,
|
|
1865
|
+
NotExtended: 510,
|
|
1866
|
+
NetworkAuthenticationRequired: 511,
|
|
1867
|
+
WebServerIsDown: 521,
|
|
1868
|
+
ConnectionTimedOut: 522,
|
|
1869
|
+
OriginIsUnreachable: 523,
|
|
1870
|
+
TimeoutOccurred: 524,
|
|
1871
|
+
SslHandshakeFailed: 525,
|
|
1872
|
+
InvalidSslCertificate: 526
|
|
1873
|
+
};
|
|
1874
|
+
Object.entries(Ie).forEach(([t, e]) => {
|
|
1875
|
+
Ie[e] = t;
|
|
1876
|
+
});
|
|
1877
|
+
function Jt(t) {
|
|
1878
|
+
const e = new G(t), n = Rt(G.prototype.request, e);
|
|
1879
|
+
return c.extend(n, G.prototype, e, { allOwnKeys: !0 }), c.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(s) {
|
|
1880
|
+
return Jt(K(t, s));
|
|
1881
|
+
}, n;
|
|
1882
|
+
}
|
|
1883
|
+
const A = Jt(pe);
|
|
1884
|
+
A.Axios = G;
|
|
1885
|
+
A.CanceledError = oe;
|
|
1886
|
+
A.CancelToken = hs;
|
|
1887
|
+
A.isCancel = Yt;
|
|
1888
|
+
A.VERSION = Xt;
|
|
1889
|
+
A.toFormData = Ae;
|
|
1890
|
+
A.AxiosError = g;
|
|
1891
|
+
A.Cancel = A.CanceledError;
|
|
1892
|
+
A.all = function(e) {
|
|
1893
|
+
return Promise.all(e);
|
|
1894
|
+
};
|
|
1895
|
+
A.spread = ms;
|
|
1896
|
+
A.isAxiosError = ps;
|
|
1897
|
+
A.mergeConfig = K;
|
|
1898
|
+
A.AxiosHeaders = L;
|
|
1899
|
+
A.formToJSON = (t) => vt(c.isHTMLForm(t) ? new FormData(t) : t);
|
|
1900
|
+
A.getAdapter = Qt.getAdapter;
|
|
1901
|
+
A.HttpStatusCode = Ie;
|
|
1902
|
+
A.default = A;
|
|
1903
|
+
const {
|
|
1904
|
+
Axios: ji,
|
|
1905
|
+
AxiosError: Ui,
|
|
1906
|
+
CanceledError: zi,
|
|
1907
|
+
isCancel: Qi,
|
|
1908
|
+
CancelToken: Xi,
|
|
1909
|
+
VERSION: Vi,
|
|
1910
|
+
all: Ji,
|
|
1911
|
+
Cancel: Gi,
|
|
1912
|
+
isAxiosError: Ki,
|
|
1913
|
+
spread: Zi,
|
|
1914
|
+
toFormData: ea,
|
|
1915
|
+
AxiosHeaders: ta,
|
|
1916
|
+
HttpStatusCode: na,
|
|
1917
|
+
formToJSON: ra,
|
|
1918
|
+
getAdapter: sa,
|
|
1919
|
+
mergeConfig: oa
|
|
1920
|
+
} = A, ia = ({ error: t, message: e = "알 수 없는 에러가 발생했습니다.", callback: n }) => A.isAxiosError(t) ? (n?.(), {
|
|
1921
|
+
type: "axios",
|
|
1922
|
+
message: t.response?.data?.message ?? e,
|
|
1923
|
+
status: t.response?.status
|
|
1924
|
+
}) : t instanceof Error ? (n?.(), {
|
|
1925
|
+
type: "client",
|
|
1926
|
+
message: t.message || e
|
|
1927
|
+
}) : (n?.(), {
|
|
1928
|
+
type: "unknown",
|
|
1929
|
+
message: e
|
|
1930
|
+
}), ws = (t, e = {}) => {
|
|
1931
|
+
const {
|
|
1932
|
+
removeUndefined: n = !0,
|
|
1933
|
+
removeNull: r = !0,
|
|
1934
|
+
removeEmptyString: s = !0,
|
|
1935
|
+
removeEmptyArray: o = !0,
|
|
1936
|
+
removeEmptyObject: i = !0,
|
|
1937
|
+
normalizeNumbers: a = !1,
|
|
1938
|
+
normalizeBooleans: f = !1,
|
|
1939
|
+
normalizeNested: l = !1
|
|
1940
|
+
} = e, u = (p) => {
|
|
1941
|
+
switch (!0) {
|
|
1942
|
+
case (n && p === void 0):
|
|
1943
|
+
return !0;
|
|
1944
|
+
case (r && p === null):
|
|
1945
|
+
return !0;
|
|
1946
|
+
case (s && p === ""):
|
|
1947
|
+
return !0;
|
|
1948
|
+
case (o && Array.isArray(p) && p.length === 0):
|
|
1949
|
+
return !0;
|
|
1950
|
+
case (i && typeof p == "object" && p !== null && !Array.isArray(p) && Object.keys(p).length === 0):
|
|
1951
|
+
return !0;
|
|
1952
|
+
default:
|
|
1953
|
+
return !1;
|
|
1954
|
+
}
|
|
1955
|
+
}, m = (p) => {
|
|
1956
|
+
if (typeof p == "object" && p !== null) {
|
|
1957
|
+
if (Array.isArray(p))
|
|
1958
|
+
return l ? p.map((b) => m(b)).filter((b) => !u(b)) : p;
|
|
1959
|
+
if (typeof p == "object")
|
|
1960
|
+
return l ? ws(p, e) : p;
|
|
1961
|
+
}
|
|
1962
|
+
if (typeof p == "string") {
|
|
1963
|
+
const b = p.trim();
|
|
1964
|
+
if (f) {
|
|
1965
|
+
const d = b.toLowerCase();
|
|
1966
|
+
if (d === "true") return !0;
|
|
1967
|
+
if (d === "false") return !1;
|
|
1968
|
+
}
|
|
1969
|
+
return b;
|
|
1970
|
+
}
|
|
1971
|
+
return a && typeof p == "number" ? String(p) : p;
|
|
1972
|
+
};
|
|
1973
|
+
return Object.fromEntries(
|
|
1974
|
+
Object.entries(t).map(([p, b]) => [p, m(b)]).filter(([, p]) => !u(p))
|
|
1975
|
+
);
|
|
151
1976
|
};
|
|
1977
|
+
function W() {
|
|
1978
|
+
return typeof window > "u" || "Deno" in globalThis;
|
|
1979
|
+
}
|
|
1980
|
+
function ys() {
|
|
1981
|
+
return !W();
|
|
1982
|
+
}
|
|
1983
|
+
function Gt() {
|
|
1984
|
+
return W() ? !1 : /ipad|iphone/i.test(navigator.userAgent);
|
|
1985
|
+
}
|
|
1986
|
+
function Kt() {
|
|
1987
|
+
return W() ? !1 : /Macintosh|MacIntel|MacPPC|Mac68K/.test(navigator.platform);
|
|
1988
|
+
}
|
|
1989
|
+
function Zt() {
|
|
1990
|
+
return W() ? !1 : /Android/i.test(navigator.userAgent);
|
|
1991
|
+
}
|
|
1992
|
+
function gs() {
|
|
1993
|
+
return W() ? !1 : /MSIE|Trident/i.test(navigator.userAgent);
|
|
1994
|
+
}
|
|
1995
|
+
function en() {
|
|
1996
|
+
return W() ? !1 : /KAKAOTALK/i.test(navigator.userAgent);
|
|
1997
|
+
}
|
|
1998
|
+
function Qe() {
|
|
1999
|
+
return W() ? !1 : Gt() ? "ios" : Zt() ? "android" : "web";
|
|
2000
|
+
}
|
|
2001
|
+
function bs() {
|
|
2002
|
+
const t = Qe();
|
|
2003
|
+
return t === "ios" || t === "android";
|
|
2004
|
+
}
|
|
2005
|
+
function xs() {
|
|
2006
|
+
if (W()) return "server";
|
|
2007
|
+
if (en()) return "kakao";
|
|
2008
|
+
const t = Qe();
|
|
2009
|
+
return t === "ios" || t === "android" ? t : Kt() ? "macos" : "web";
|
|
2010
|
+
}
|
|
2011
|
+
const aa = {
|
|
2012
|
+
isServer: W,
|
|
2013
|
+
isClient: ys,
|
|
2014
|
+
isIOS: Gt,
|
|
2015
|
+
isAndroid: Zt,
|
|
2016
|
+
isMacOS: Kt,
|
|
2017
|
+
isIE: gs,
|
|
2018
|
+
isKakaoWebView: en,
|
|
2019
|
+
isMobileWeb: bs,
|
|
2020
|
+
getOSByUserAgent: Qe,
|
|
2021
|
+
getPlatform: xs
|
|
2022
|
+
}, tn = 6048e5, Os = 864e5, nn = 6e4, rn = 36e5, Ts = 1e3, xt = Symbol.for("constructDateFrom");
|
|
2023
|
+
function N(t, e) {
|
|
2024
|
+
return typeof t == "function" ? t(e) : t && typeof t == "object" && xt in t ? t[xt](e) : t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
2025
|
+
}
|
|
2026
|
+
function O(t, e) {
|
|
2027
|
+
return N(e || t, t);
|
|
2028
|
+
}
|
|
2029
|
+
function sn(t, e, n) {
|
|
2030
|
+
const r = O(t, n?.in);
|
|
2031
|
+
return isNaN(e) ? N(n?.in || t, NaN) : (e && r.setDate(r.getDate() + e), r);
|
|
2032
|
+
}
|
|
2033
|
+
let Es = {};
|
|
2034
|
+
function ie() {
|
|
2035
|
+
return Es;
|
|
2036
|
+
}
|
|
2037
|
+
function Q(t, e) {
|
|
2038
|
+
const n = ie(), r = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = O(t, e?.in), o = s.getDay(), i = (o < r ? 7 : 0) + o - r;
|
|
2039
|
+
return s.setDate(s.getDate() - i), s.setHours(0, 0, 0, 0), s;
|
|
2040
|
+
}
|
|
2041
|
+
function re(t, e) {
|
|
2042
|
+
return Q(t, { ...e, weekStartsOn: 1 });
|
|
2043
|
+
}
|
|
2044
|
+
function on(t, e) {
|
|
2045
|
+
const n = O(t, e?.in), r = n.getFullYear(), s = N(n, 0);
|
|
2046
|
+
s.setFullYear(r + 1, 0, 4), s.setHours(0, 0, 0, 0);
|
|
2047
|
+
const o = re(s), i = N(n, 0);
|
|
2048
|
+
i.setFullYear(r, 0, 4), i.setHours(0, 0, 0, 0);
|
|
2049
|
+
const a = re(i);
|
|
2050
|
+
return n.getTime() >= o.getTime() ? r + 1 : n.getTime() >= a.getTime() ? r : r - 1;
|
|
2051
|
+
}
|
|
2052
|
+
function Pe(t) {
|
|
2053
|
+
const e = O(t), n = new Date(
|
|
2054
|
+
Date.UTC(
|
|
2055
|
+
e.getFullYear(),
|
|
2056
|
+
e.getMonth(),
|
|
2057
|
+
e.getDate(),
|
|
2058
|
+
e.getHours(),
|
|
2059
|
+
e.getMinutes(),
|
|
2060
|
+
e.getSeconds(),
|
|
2061
|
+
e.getMilliseconds()
|
|
2062
|
+
)
|
|
2063
|
+
);
|
|
2064
|
+
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
2065
|
+
}
|
|
2066
|
+
function Z(t, ...e) {
|
|
2067
|
+
const n = N.bind(
|
|
2068
|
+
null,
|
|
2069
|
+
t || e.find((r) => typeof r == "object")
|
|
2070
|
+
);
|
|
2071
|
+
return e.map(n);
|
|
2072
|
+
}
|
|
2073
|
+
function Ot(t, e) {
|
|
2074
|
+
const n = O(t, e?.in);
|
|
2075
|
+
return n.setHours(0, 0, 0, 0), n;
|
|
2076
|
+
}
|
|
2077
|
+
function an(t, e, n) {
|
|
2078
|
+
const [r, s] = Z(
|
|
2079
|
+
n?.in,
|
|
2080
|
+
t,
|
|
2081
|
+
e
|
|
2082
|
+
), o = Ot(r), i = Ot(s), a = +o - Pe(o), f = +i - Pe(i);
|
|
2083
|
+
return Math.round((a - f) / Os);
|
|
2084
|
+
}
|
|
2085
|
+
function Ps(t, e) {
|
|
2086
|
+
const n = on(t, e), r = N(t, 0);
|
|
2087
|
+
return r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0), re(r);
|
|
2088
|
+
}
|
|
2089
|
+
function fe(t, e) {
|
|
2090
|
+
const n = +O(t) - +O(e);
|
|
2091
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
2092
|
+
}
|
|
2093
|
+
function Ds(t) {
|
|
2094
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
2095
|
+
}
|
|
2096
|
+
function Ms(t) {
|
|
2097
|
+
return !(!Ds(t) && typeof t != "number" || isNaN(+O(t)));
|
|
2098
|
+
}
|
|
2099
|
+
function Rs(t, e, n) {
|
|
2100
|
+
const [r, s] = Z(
|
|
2101
|
+
n?.in,
|
|
2102
|
+
t,
|
|
2103
|
+
e
|
|
2104
|
+
), o = r.getFullYear() - s.getFullYear(), i = r.getMonth() - s.getMonth();
|
|
2105
|
+
return o * 12 + i;
|
|
2106
|
+
}
|
|
2107
|
+
function ks(t, e, n) {
|
|
2108
|
+
const [r, s] = Z(
|
|
2109
|
+
n?.in,
|
|
2110
|
+
t,
|
|
2111
|
+
e
|
|
2112
|
+
);
|
|
2113
|
+
return r.getFullYear() - s.getFullYear();
|
|
2114
|
+
}
|
|
2115
|
+
function cn(t, e, n) {
|
|
2116
|
+
const [r, s] = Z(
|
|
2117
|
+
n?.in,
|
|
2118
|
+
t,
|
|
2119
|
+
e
|
|
2120
|
+
), o = Tt(r, s), i = Math.abs(
|
|
2121
|
+
an(r, s)
|
|
2122
|
+
);
|
|
2123
|
+
r.setDate(r.getDate() - o * i);
|
|
2124
|
+
const a = +(Tt(r, s) === -o), f = o * (i - a);
|
|
2125
|
+
return f === 0 ? 0 : f;
|
|
2126
|
+
}
|
|
2127
|
+
function Tt(t, e) {
|
|
2128
|
+
const n = t.getFullYear() - e.getFullYear() || t.getMonth() - e.getMonth() || t.getDate() - e.getDate() || t.getHours() - e.getHours() || t.getMinutes() - e.getMinutes() || t.getSeconds() - e.getSeconds() || t.getMilliseconds() - e.getMilliseconds();
|
|
2129
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
2130
|
+
}
|
|
2131
|
+
function Xe(t) {
|
|
2132
|
+
return (e) => {
|
|
2133
|
+
const r = (t ? Math[t] : Math.trunc)(e);
|
|
2134
|
+
return r === 0 ? 0 : r;
|
|
2135
|
+
};
|
|
2136
|
+
}
|
|
2137
|
+
function As(t, e, n) {
|
|
2138
|
+
const [r, s] = Z(
|
|
2139
|
+
n?.in,
|
|
2140
|
+
t,
|
|
2141
|
+
e
|
|
2142
|
+
), o = (+r - +s) / rn;
|
|
2143
|
+
return Xe(n?.roundingMethod)(o);
|
|
2144
|
+
}
|
|
2145
|
+
function _s(t, e) {
|
|
2146
|
+
return +O(t) - +O(e);
|
|
2147
|
+
}
|
|
2148
|
+
function Ns(t, e, n) {
|
|
2149
|
+
const r = _s(t, e) / nn;
|
|
2150
|
+
return Xe(n?.roundingMethod)(r);
|
|
2151
|
+
}
|
|
2152
|
+
function Cs(t, e) {
|
|
2153
|
+
const n = O(t, e?.in);
|
|
2154
|
+
return n.setHours(23, 59, 59, 999), n;
|
|
2155
|
+
}
|
|
2156
|
+
function Ss(t, e) {
|
|
2157
|
+
const n = O(t, e?.in), r = n.getMonth();
|
|
2158
|
+
return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(23, 59, 59, 999), n;
|
|
2159
|
+
}
|
|
2160
|
+
function Fs(t, e) {
|
|
2161
|
+
const n = O(t, e?.in);
|
|
2162
|
+
return +Cs(n, e) == +Ss(n, e);
|
|
2163
|
+
}
|
|
2164
|
+
function Ls(t, e, n) {
|
|
2165
|
+
const [r, s, o] = Z(
|
|
2166
|
+
n?.in,
|
|
2167
|
+
t,
|
|
2168
|
+
t,
|
|
2169
|
+
e
|
|
2170
|
+
), i = fe(s, o), a = Math.abs(
|
|
2171
|
+
Rs(s, o)
|
|
2172
|
+
);
|
|
2173
|
+
if (a < 1) return 0;
|
|
2174
|
+
s.getMonth() === 1 && s.getDate() > 27 && s.setDate(30), s.setMonth(s.getMonth() - i * a);
|
|
2175
|
+
let f = fe(s, o) === -i;
|
|
2176
|
+
Fs(r) && a === 1 && fe(r, o) === 1 && (f = !1);
|
|
2177
|
+
const l = i * (a - +f);
|
|
2178
|
+
return l === 0 ? 0 : l;
|
|
2179
|
+
}
|
|
2180
|
+
function $s(t, e, n) {
|
|
2181
|
+
const r = cn(t, e, n) / 7;
|
|
2182
|
+
return Xe(n?.roundingMethod)(r);
|
|
2183
|
+
}
|
|
2184
|
+
function qs(t, e, n) {
|
|
2185
|
+
const [r, s] = Z(
|
|
2186
|
+
n?.in,
|
|
2187
|
+
t,
|
|
2188
|
+
e
|
|
2189
|
+
), o = fe(r, s), i = Math.abs(ks(r, s));
|
|
2190
|
+
r.setFullYear(1584), s.setFullYear(1584);
|
|
2191
|
+
const a = fe(r, s) === -o, f = o * (i - +a);
|
|
2192
|
+
return f === 0 ? 0 : f;
|
|
2193
|
+
}
|
|
2194
|
+
function Hs(t, e) {
|
|
2195
|
+
const n = O(t, e?.in);
|
|
2196
|
+
return n.setFullYear(n.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
2197
|
+
}
|
|
2198
|
+
const Bs = {
|
|
2199
|
+
lessThanXSeconds: {
|
|
2200
|
+
one: "less than a second",
|
|
2201
|
+
other: "less than {{count}} seconds"
|
|
2202
|
+
},
|
|
2203
|
+
xSeconds: {
|
|
2204
|
+
one: "1 second",
|
|
2205
|
+
other: "{{count}} seconds"
|
|
2206
|
+
},
|
|
2207
|
+
halfAMinute: "half a minute",
|
|
2208
|
+
lessThanXMinutes: {
|
|
2209
|
+
one: "less than a minute",
|
|
2210
|
+
other: "less than {{count}} minutes"
|
|
2211
|
+
},
|
|
2212
|
+
xMinutes: {
|
|
2213
|
+
one: "1 minute",
|
|
2214
|
+
other: "{{count}} minutes"
|
|
2215
|
+
},
|
|
2216
|
+
aboutXHours: {
|
|
2217
|
+
one: "about 1 hour",
|
|
2218
|
+
other: "about {{count}} hours"
|
|
2219
|
+
},
|
|
2220
|
+
xHours: {
|
|
2221
|
+
one: "1 hour",
|
|
2222
|
+
other: "{{count}} hours"
|
|
2223
|
+
},
|
|
2224
|
+
xDays: {
|
|
2225
|
+
one: "1 day",
|
|
2226
|
+
other: "{{count}} days"
|
|
2227
|
+
},
|
|
2228
|
+
aboutXWeeks: {
|
|
2229
|
+
one: "about 1 week",
|
|
2230
|
+
other: "about {{count}} weeks"
|
|
2231
|
+
},
|
|
2232
|
+
xWeeks: {
|
|
2233
|
+
one: "1 week",
|
|
2234
|
+
other: "{{count}} weeks"
|
|
2235
|
+
},
|
|
2236
|
+
aboutXMonths: {
|
|
2237
|
+
one: "about 1 month",
|
|
2238
|
+
other: "about {{count}} months"
|
|
2239
|
+
},
|
|
2240
|
+
xMonths: {
|
|
2241
|
+
one: "1 month",
|
|
2242
|
+
other: "{{count}} months"
|
|
2243
|
+
},
|
|
2244
|
+
aboutXYears: {
|
|
2245
|
+
one: "about 1 year",
|
|
2246
|
+
other: "about {{count}} years"
|
|
2247
|
+
},
|
|
2248
|
+
xYears: {
|
|
2249
|
+
one: "1 year",
|
|
2250
|
+
other: "{{count}} years"
|
|
2251
|
+
},
|
|
2252
|
+
overXYears: {
|
|
2253
|
+
one: "over 1 year",
|
|
2254
|
+
other: "over {{count}} years"
|
|
2255
|
+
},
|
|
2256
|
+
almostXYears: {
|
|
2257
|
+
one: "almost 1 year",
|
|
2258
|
+
other: "almost {{count}} years"
|
|
2259
|
+
}
|
|
2260
|
+
}, Is = (t, e, n) => {
|
|
2261
|
+
let r;
|
|
2262
|
+
const s = Bs[t];
|
|
2263
|
+
return typeof s == "string" ? r = s : e === 1 ? r = s.one : r = s.other.replace("{{count}}", e.toString()), n?.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
2264
|
+
};
|
|
2265
|
+
function $e(t) {
|
|
2266
|
+
return (e = {}) => {
|
|
2267
|
+
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
2268
|
+
return t.formats[n] || t.formats[t.defaultWidth];
|
|
2269
|
+
};
|
|
2270
|
+
}
|
|
2271
|
+
const vs = {
|
|
2272
|
+
full: "EEEE, MMMM do, y",
|
|
2273
|
+
long: "MMMM do, y",
|
|
2274
|
+
medium: "MMM d, y",
|
|
2275
|
+
short: "MM/dd/yyyy"
|
|
2276
|
+
}, Ys = {
|
|
2277
|
+
full: "h:mm:ss a zzzz",
|
|
2278
|
+
long: "h:mm:ss a z",
|
|
2279
|
+
medium: "h:mm:ss a",
|
|
2280
|
+
short: "h:mm a"
|
|
2281
|
+
}, Ws = {
|
|
2282
|
+
full: "{{date}} 'at' {{time}}",
|
|
2283
|
+
long: "{{date}} 'at' {{time}}",
|
|
2284
|
+
medium: "{{date}}, {{time}}",
|
|
2285
|
+
short: "{{date}}, {{time}}"
|
|
2286
|
+
}, js = {
|
|
2287
|
+
date: $e({
|
|
2288
|
+
formats: vs,
|
|
2289
|
+
defaultWidth: "full"
|
|
2290
|
+
}),
|
|
2291
|
+
time: $e({
|
|
2292
|
+
formats: Ys,
|
|
2293
|
+
defaultWidth: "full"
|
|
2294
|
+
}),
|
|
2295
|
+
dateTime: $e({
|
|
2296
|
+
formats: Ws,
|
|
2297
|
+
defaultWidth: "full"
|
|
2298
|
+
})
|
|
2299
|
+
}, Us = {
|
|
2300
|
+
lastWeek: "'last' eeee 'at' p",
|
|
2301
|
+
yesterday: "'yesterday at' p",
|
|
2302
|
+
today: "'today at' p",
|
|
2303
|
+
tomorrow: "'tomorrow at' p",
|
|
2304
|
+
nextWeek: "eeee 'at' p",
|
|
2305
|
+
other: "P"
|
|
2306
|
+
}, zs = (t, e, n, r) => Us[t];
|
|
2307
|
+
function ue(t) {
|
|
2308
|
+
return (e, n) => {
|
|
2309
|
+
const r = n?.context ? String(n.context) : "standalone";
|
|
2310
|
+
let s;
|
|
2311
|
+
if (r === "formatting" && t.formattingValues) {
|
|
2312
|
+
const i = t.defaultFormattingWidth || t.defaultWidth, a = n?.width ? String(n.width) : i;
|
|
2313
|
+
s = t.formattingValues[a] || t.formattingValues[i];
|
|
2314
|
+
} else {
|
|
2315
|
+
const i = t.defaultWidth, a = n?.width ? String(n.width) : t.defaultWidth;
|
|
2316
|
+
s = t.values[a] || t.values[i];
|
|
2317
|
+
}
|
|
2318
|
+
const o = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
2319
|
+
return s[o];
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
const Qs = {
|
|
2323
|
+
narrow: ["B", "A"],
|
|
2324
|
+
abbreviated: ["BC", "AD"],
|
|
2325
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
2326
|
+
}, Xs = {
|
|
2327
|
+
narrow: ["1", "2", "3", "4"],
|
|
2328
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
2329
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
2330
|
+
}, Vs = {
|
|
2331
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
2332
|
+
abbreviated: [
|
|
2333
|
+
"Jan",
|
|
2334
|
+
"Feb",
|
|
2335
|
+
"Mar",
|
|
2336
|
+
"Apr",
|
|
2337
|
+
"May",
|
|
2338
|
+
"Jun",
|
|
2339
|
+
"Jul",
|
|
2340
|
+
"Aug",
|
|
2341
|
+
"Sep",
|
|
2342
|
+
"Oct",
|
|
2343
|
+
"Nov",
|
|
2344
|
+
"Dec"
|
|
2345
|
+
],
|
|
2346
|
+
wide: [
|
|
2347
|
+
"January",
|
|
2348
|
+
"February",
|
|
2349
|
+
"March",
|
|
2350
|
+
"April",
|
|
2351
|
+
"May",
|
|
2352
|
+
"June",
|
|
2353
|
+
"July",
|
|
2354
|
+
"August",
|
|
2355
|
+
"September",
|
|
2356
|
+
"October",
|
|
2357
|
+
"November",
|
|
2358
|
+
"December"
|
|
2359
|
+
]
|
|
2360
|
+
}, Js = {
|
|
2361
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
2362
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
2363
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
2364
|
+
wide: [
|
|
2365
|
+
"Sunday",
|
|
2366
|
+
"Monday",
|
|
2367
|
+
"Tuesday",
|
|
2368
|
+
"Wednesday",
|
|
2369
|
+
"Thursday",
|
|
2370
|
+
"Friday",
|
|
2371
|
+
"Saturday"
|
|
2372
|
+
]
|
|
2373
|
+
}, Gs = {
|
|
2374
|
+
narrow: {
|
|
2375
|
+
am: "a",
|
|
2376
|
+
pm: "p",
|
|
2377
|
+
midnight: "mi",
|
|
2378
|
+
noon: "n",
|
|
2379
|
+
morning: "morning",
|
|
2380
|
+
afternoon: "afternoon",
|
|
2381
|
+
evening: "evening",
|
|
2382
|
+
night: "night"
|
|
2383
|
+
},
|
|
2384
|
+
abbreviated: {
|
|
2385
|
+
am: "AM",
|
|
2386
|
+
pm: "PM",
|
|
2387
|
+
midnight: "midnight",
|
|
2388
|
+
noon: "noon",
|
|
2389
|
+
morning: "morning",
|
|
2390
|
+
afternoon: "afternoon",
|
|
2391
|
+
evening: "evening",
|
|
2392
|
+
night: "night"
|
|
2393
|
+
},
|
|
2394
|
+
wide: {
|
|
2395
|
+
am: "a.m.",
|
|
2396
|
+
pm: "p.m.",
|
|
2397
|
+
midnight: "midnight",
|
|
2398
|
+
noon: "noon",
|
|
2399
|
+
morning: "morning",
|
|
2400
|
+
afternoon: "afternoon",
|
|
2401
|
+
evening: "evening",
|
|
2402
|
+
night: "night"
|
|
2403
|
+
}
|
|
2404
|
+
}, Ks = {
|
|
2405
|
+
narrow: {
|
|
2406
|
+
am: "a",
|
|
2407
|
+
pm: "p",
|
|
2408
|
+
midnight: "mi",
|
|
2409
|
+
noon: "n",
|
|
2410
|
+
morning: "in the morning",
|
|
2411
|
+
afternoon: "in the afternoon",
|
|
2412
|
+
evening: "in the evening",
|
|
2413
|
+
night: "at night"
|
|
2414
|
+
},
|
|
2415
|
+
abbreviated: {
|
|
2416
|
+
am: "AM",
|
|
2417
|
+
pm: "PM",
|
|
2418
|
+
midnight: "midnight",
|
|
2419
|
+
noon: "noon",
|
|
2420
|
+
morning: "in the morning",
|
|
2421
|
+
afternoon: "in the afternoon",
|
|
2422
|
+
evening: "in the evening",
|
|
2423
|
+
night: "at night"
|
|
2424
|
+
},
|
|
2425
|
+
wide: {
|
|
2426
|
+
am: "a.m.",
|
|
2427
|
+
pm: "p.m.",
|
|
2428
|
+
midnight: "midnight",
|
|
2429
|
+
noon: "noon",
|
|
2430
|
+
morning: "in the morning",
|
|
2431
|
+
afternoon: "in the afternoon",
|
|
2432
|
+
evening: "in the evening",
|
|
2433
|
+
night: "at night"
|
|
2434
|
+
}
|
|
2435
|
+
}, Zs = (t, e) => {
|
|
2436
|
+
const n = Number(t), r = n % 100;
|
|
2437
|
+
if (r > 20 || r < 10)
|
|
2438
|
+
switch (r % 10) {
|
|
2439
|
+
case 1:
|
|
2440
|
+
return n + "st";
|
|
2441
|
+
case 2:
|
|
2442
|
+
return n + "nd";
|
|
2443
|
+
case 3:
|
|
2444
|
+
return n + "rd";
|
|
2445
|
+
}
|
|
2446
|
+
return n + "th";
|
|
2447
|
+
}, eo = {
|
|
2448
|
+
ordinalNumber: Zs,
|
|
2449
|
+
era: ue({
|
|
2450
|
+
values: Qs,
|
|
2451
|
+
defaultWidth: "wide"
|
|
2452
|
+
}),
|
|
2453
|
+
quarter: ue({
|
|
2454
|
+
values: Xs,
|
|
2455
|
+
defaultWidth: "wide",
|
|
2456
|
+
argumentCallback: (t) => t - 1
|
|
2457
|
+
}),
|
|
2458
|
+
month: ue({
|
|
2459
|
+
values: Vs,
|
|
2460
|
+
defaultWidth: "wide"
|
|
2461
|
+
}),
|
|
2462
|
+
day: ue({
|
|
2463
|
+
values: Js,
|
|
2464
|
+
defaultWidth: "wide"
|
|
2465
|
+
}),
|
|
2466
|
+
dayPeriod: ue({
|
|
2467
|
+
values: Gs,
|
|
2468
|
+
defaultWidth: "wide",
|
|
2469
|
+
formattingValues: Ks,
|
|
2470
|
+
defaultFormattingWidth: "wide"
|
|
2471
|
+
})
|
|
2472
|
+
};
|
|
2473
|
+
function le(t) {
|
|
2474
|
+
return (e, n = {}) => {
|
|
2475
|
+
const r = n.width, s = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(s);
|
|
2476
|
+
if (!o)
|
|
2477
|
+
return null;
|
|
2478
|
+
const i = o[0], a = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], f = Array.isArray(a) ? no(a, (m) => m.test(i)) : (
|
|
2479
|
+
// [TODO] -- I challenge you to fix the type
|
|
2480
|
+
to(a, (m) => m.test(i))
|
|
2481
|
+
);
|
|
2482
|
+
let l;
|
|
2483
|
+
l = t.valueCallback ? t.valueCallback(f) : f, l = n.valueCallback ? (
|
|
2484
|
+
// [TODO] -- I challenge you to fix the type
|
|
2485
|
+
n.valueCallback(l)
|
|
2486
|
+
) : l;
|
|
2487
|
+
const u = e.slice(i.length);
|
|
2488
|
+
return { value: l, rest: u };
|
|
2489
|
+
};
|
|
2490
|
+
}
|
|
2491
|
+
function to(t, e) {
|
|
2492
|
+
for (const n in t)
|
|
2493
|
+
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
2494
|
+
return n;
|
|
2495
|
+
}
|
|
2496
|
+
function no(t, e) {
|
|
2497
|
+
for (let n = 0; n < t.length; n++)
|
|
2498
|
+
if (e(t[n]))
|
|
2499
|
+
return n;
|
|
2500
|
+
}
|
|
2501
|
+
function ro(t) {
|
|
2502
|
+
return (e, n = {}) => {
|
|
2503
|
+
const r = e.match(t.matchPattern);
|
|
2504
|
+
if (!r) return null;
|
|
2505
|
+
const s = r[0], o = e.match(t.parsePattern);
|
|
2506
|
+
if (!o) return null;
|
|
2507
|
+
let i = t.valueCallback ? t.valueCallback(o[0]) : o[0];
|
|
2508
|
+
i = n.valueCallback ? n.valueCallback(i) : i;
|
|
2509
|
+
const a = e.slice(s.length);
|
|
2510
|
+
return { value: i, rest: a };
|
|
2511
|
+
};
|
|
2512
|
+
}
|
|
2513
|
+
const so = /^(\d+)(th|st|nd|rd)?/i, oo = /\d+/i, io = {
|
|
2514
|
+
narrow: /^(b|a)/i,
|
|
2515
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
2516
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
2517
|
+
}, ao = {
|
|
2518
|
+
any: [/^b/i, /^(a|c)/i]
|
|
2519
|
+
}, co = {
|
|
2520
|
+
narrow: /^[1234]/i,
|
|
2521
|
+
abbreviated: /^q[1234]/i,
|
|
2522
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
2523
|
+
}, uo = {
|
|
2524
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
2525
|
+
}, lo = {
|
|
2526
|
+
narrow: /^[jfmasond]/i,
|
|
2527
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
2528
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
2529
|
+
}, fo = {
|
|
2530
|
+
narrow: [
|
|
2531
|
+
/^j/i,
|
|
2532
|
+
/^f/i,
|
|
2533
|
+
/^m/i,
|
|
2534
|
+
/^a/i,
|
|
2535
|
+
/^m/i,
|
|
2536
|
+
/^j/i,
|
|
2537
|
+
/^j/i,
|
|
2538
|
+
/^a/i,
|
|
2539
|
+
/^s/i,
|
|
2540
|
+
/^o/i,
|
|
2541
|
+
/^n/i,
|
|
2542
|
+
/^d/i
|
|
2543
|
+
],
|
|
2544
|
+
any: [
|
|
2545
|
+
/^ja/i,
|
|
2546
|
+
/^f/i,
|
|
2547
|
+
/^mar/i,
|
|
2548
|
+
/^ap/i,
|
|
2549
|
+
/^may/i,
|
|
2550
|
+
/^jun/i,
|
|
2551
|
+
/^jul/i,
|
|
2552
|
+
/^au/i,
|
|
2553
|
+
/^s/i,
|
|
2554
|
+
/^o/i,
|
|
2555
|
+
/^n/i,
|
|
2556
|
+
/^d/i
|
|
2557
|
+
]
|
|
2558
|
+
}, ho = {
|
|
2559
|
+
narrow: /^[smtwf]/i,
|
|
2560
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
2561
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
2562
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
2563
|
+
}, mo = {
|
|
2564
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
2565
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
2566
|
+
}, po = {
|
|
2567
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
2568
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
2569
|
+
}, wo = {
|
|
2570
|
+
any: {
|
|
2571
|
+
am: /^a/i,
|
|
2572
|
+
pm: /^p/i,
|
|
2573
|
+
midnight: /^mi/i,
|
|
2574
|
+
noon: /^no/i,
|
|
2575
|
+
morning: /morning/i,
|
|
2576
|
+
afternoon: /afternoon/i,
|
|
2577
|
+
evening: /evening/i,
|
|
2578
|
+
night: /night/i
|
|
2579
|
+
}
|
|
2580
|
+
}, yo = {
|
|
2581
|
+
ordinalNumber: ro({
|
|
2582
|
+
matchPattern: so,
|
|
2583
|
+
parsePattern: oo,
|
|
2584
|
+
valueCallback: (t) => parseInt(t, 10)
|
|
2585
|
+
}),
|
|
2586
|
+
era: le({
|
|
2587
|
+
matchPatterns: io,
|
|
2588
|
+
defaultMatchWidth: "wide",
|
|
2589
|
+
parsePatterns: ao,
|
|
2590
|
+
defaultParseWidth: "any"
|
|
2591
|
+
}),
|
|
2592
|
+
quarter: le({
|
|
2593
|
+
matchPatterns: co,
|
|
2594
|
+
defaultMatchWidth: "wide",
|
|
2595
|
+
parsePatterns: uo,
|
|
2596
|
+
defaultParseWidth: "any",
|
|
2597
|
+
valueCallback: (t) => t + 1
|
|
2598
|
+
}),
|
|
2599
|
+
month: le({
|
|
2600
|
+
matchPatterns: lo,
|
|
2601
|
+
defaultMatchWidth: "wide",
|
|
2602
|
+
parsePatterns: fo,
|
|
2603
|
+
defaultParseWidth: "any"
|
|
2604
|
+
}),
|
|
2605
|
+
day: le({
|
|
2606
|
+
matchPatterns: ho,
|
|
2607
|
+
defaultMatchWidth: "wide",
|
|
2608
|
+
parsePatterns: mo,
|
|
2609
|
+
defaultParseWidth: "any"
|
|
2610
|
+
}),
|
|
2611
|
+
dayPeriod: le({
|
|
2612
|
+
matchPatterns: po,
|
|
2613
|
+
defaultMatchWidth: "any",
|
|
2614
|
+
parsePatterns: wo,
|
|
2615
|
+
defaultParseWidth: "any"
|
|
2616
|
+
})
|
|
2617
|
+
}, un = {
|
|
2618
|
+
code: "en-US",
|
|
2619
|
+
formatDistance: Is,
|
|
2620
|
+
formatLong: js,
|
|
2621
|
+
formatRelative: zs,
|
|
2622
|
+
localize: eo,
|
|
2623
|
+
match: yo,
|
|
2624
|
+
options: {
|
|
2625
|
+
weekStartsOn: 0,
|
|
2626
|
+
firstWeekContainsDate: 1
|
|
2627
|
+
}
|
|
2628
|
+
};
|
|
2629
|
+
function go(t, e) {
|
|
2630
|
+
const n = O(t, e?.in);
|
|
2631
|
+
return an(n, Hs(n)) + 1;
|
|
2632
|
+
}
|
|
2633
|
+
function ln(t, e) {
|
|
2634
|
+
const n = O(t, e?.in), r = +re(n) - +Ps(n);
|
|
2635
|
+
return Math.round(r / tn) + 1;
|
|
2636
|
+
}
|
|
2637
|
+
function Ve(t, e) {
|
|
2638
|
+
const n = O(t, e?.in), r = n.getFullYear(), s = ie(), o = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, i = N(e?.in || t, 0);
|
|
2639
|
+
i.setFullYear(r + 1, 0, o), i.setHours(0, 0, 0, 0);
|
|
2640
|
+
const a = Q(i, e), f = N(e?.in || t, 0);
|
|
2641
|
+
f.setFullYear(r, 0, o), f.setHours(0, 0, 0, 0);
|
|
2642
|
+
const l = Q(f, e);
|
|
2643
|
+
return +n >= +a ? r + 1 : +n >= +l ? r : r - 1;
|
|
2644
|
+
}
|
|
2645
|
+
function bo(t, e) {
|
|
2646
|
+
const n = ie(), r = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, s = Ve(t, e), o = N(e?.in || t, 0);
|
|
2647
|
+
return o.setFullYear(s, 0, r), o.setHours(0, 0, 0, 0), Q(o, e);
|
|
2648
|
+
}
|
|
2649
|
+
function fn(t, e) {
|
|
2650
|
+
const n = O(t, e?.in), r = +Q(n, e) - +bo(n, e);
|
|
2651
|
+
return Math.round(r / tn) + 1;
|
|
2652
|
+
}
|
|
2653
|
+
function x(t, e) {
|
|
2654
|
+
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
2655
|
+
return n + r;
|
|
2656
|
+
}
|
|
2657
|
+
const z = {
|
|
2658
|
+
// Year
|
|
2659
|
+
y(t, e) {
|
|
2660
|
+
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
2661
|
+
return x(e === "yy" ? r % 100 : r, e.length);
|
|
2662
|
+
},
|
|
2663
|
+
// Month
|
|
2664
|
+
M(t, e) {
|
|
2665
|
+
const n = t.getMonth();
|
|
2666
|
+
return e === "M" ? String(n + 1) : x(n + 1, 2);
|
|
2667
|
+
},
|
|
2668
|
+
// Day of the month
|
|
2669
|
+
d(t, e) {
|
|
2670
|
+
return x(t.getDate(), e.length);
|
|
2671
|
+
},
|
|
2672
|
+
// AM or PM
|
|
2673
|
+
a(t, e) {
|
|
2674
|
+
const n = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
2675
|
+
switch (e) {
|
|
2676
|
+
case "a":
|
|
2677
|
+
case "aa":
|
|
2678
|
+
return n.toUpperCase();
|
|
2679
|
+
case "aaa":
|
|
2680
|
+
return n;
|
|
2681
|
+
case "aaaaa":
|
|
2682
|
+
return n[0];
|
|
2683
|
+
case "aaaa":
|
|
2684
|
+
default:
|
|
2685
|
+
return n === "am" ? "a.m." : "p.m.";
|
|
2686
|
+
}
|
|
2687
|
+
},
|
|
2688
|
+
// Hour [1-12]
|
|
2689
|
+
h(t, e) {
|
|
2690
|
+
return x(t.getHours() % 12 || 12, e.length);
|
|
2691
|
+
},
|
|
2692
|
+
// Hour [0-23]
|
|
2693
|
+
H(t, e) {
|
|
2694
|
+
return x(t.getHours(), e.length);
|
|
2695
|
+
},
|
|
2696
|
+
// Minute
|
|
2697
|
+
m(t, e) {
|
|
2698
|
+
return x(t.getMinutes(), e.length);
|
|
2699
|
+
},
|
|
2700
|
+
// Second
|
|
2701
|
+
s(t, e) {
|
|
2702
|
+
return x(t.getSeconds(), e.length);
|
|
2703
|
+
},
|
|
2704
|
+
// Fraction of second
|
|
2705
|
+
S(t, e) {
|
|
2706
|
+
const n = e.length, r = t.getMilliseconds(), s = Math.trunc(
|
|
2707
|
+
r * Math.pow(10, n - 3)
|
|
2708
|
+
);
|
|
2709
|
+
return x(s, e.length);
|
|
2710
|
+
}
|
|
2711
|
+
}, te = {
|
|
2712
|
+
midnight: "midnight",
|
|
2713
|
+
noon: "noon",
|
|
2714
|
+
morning: "morning",
|
|
2715
|
+
afternoon: "afternoon",
|
|
2716
|
+
evening: "evening",
|
|
2717
|
+
night: "night"
|
|
2718
|
+
}, Et = {
|
|
2719
|
+
// Era
|
|
2720
|
+
G: function(t, e, n) {
|
|
2721
|
+
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
2722
|
+
switch (e) {
|
|
2723
|
+
// AD, BC
|
|
2724
|
+
case "G":
|
|
2725
|
+
case "GG":
|
|
2726
|
+
case "GGG":
|
|
2727
|
+
return n.era(r, { width: "abbreviated" });
|
|
2728
|
+
// A, B
|
|
2729
|
+
case "GGGGG":
|
|
2730
|
+
return n.era(r, { width: "narrow" });
|
|
2731
|
+
// Anno Domini, Before Christ
|
|
2732
|
+
case "GGGG":
|
|
2733
|
+
default:
|
|
2734
|
+
return n.era(r, { width: "wide" });
|
|
2735
|
+
}
|
|
2736
|
+
},
|
|
2737
|
+
// Year
|
|
2738
|
+
y: function(t, e, n) {
|
|
2739
|
+
if (e === "yo") {
|
|
2740
|
+
const r = t.getFullYear(), s = r > 0 ? r : 1 - r;
|
|
2741
|
+
return n.ordinalNumber(s, { unit: "year" });
|
|
2742
|
+
}
|
|
2743
|
+
return z.y(t, e);
|
|
2744
|
+
},
|
|
2745
|
+
// Local week-numbering year
|
|
2746
|
+
Y: function(t, e, n, r) {
|
|
2747
|
+
const s = Ve(t, r), o = s > 0 ? s : 1 - s;
|
|
2748
|
+
if (e === "YY") {
|
|
2749
|
+
const i = o % 100;
|
|
2750
|
+
return x(i, 2);
|
|
2751
|
+
}
|
|
2752
|
+
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : x(o, e.length);
|
|
2753
|
+
},
|
|
2754
|
+
// ISO week-numbering year
|
|
2755
|
+
R: function(t, e) {
|
|
2756
|
+
const n = on(t);
|
|
2757
|
+
return x(n, e.length);
|
|
2758
|
+
},
|
|
2759
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
2760
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
2761
|
+
// | Year | `y` | `u` |
|
|
2762
|
+
// |------|-----|-----|
|
|
2763
|
+
// | AC 1 | 1 | 1 |
|
|
2764
|
+
// | BC 1 | 1 | 0 |
|
|
2765
|
+
// | BC 2 | 2 | -1 |
|
|
2766
|
+
// Also `yy` always returns the last two digits of a year,
|
|
2767
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
2768
|
+
u: function(t, e) {
|
|
2769
|
+
const n = t.getFullYear();
|
|
2770
|
+
return x(n, e.length);
|
|
2771
|
+
},
|
|
2772
|
+
// Quarter
|
|
2773
|
+
Q: function(t, e, n) {
|
|
2774
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
2775
|
+
switch (e) {
|
|
2776
|
+
// 1, 2, 3, 4
|
|
2777
|
+
case "Q":
|
|
2778
|
+
return String(r);
|
|
2779
|
+
// 01, 02, 03, 04
|
|
2780
|
+
case "QQ":
|
|
2781
|
+
return x(r, 2);
|
|
2782
|
+
// 1st, 2nd, 3rd, 4th
|
|
2783
|
+
case "Qo":
|
|
2784
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
2785
|
+
// Q1, Q2, Q3, Q4
|
|
2786
|
+
case "QQQ":
|
|
2787
|
+
return n.quarter(r, {
|
|
2788
|
+
width: "abbreviated",
|
|
2789
|
+
context: "formatting"
|
|
2790
|
+
});
|
|
2791
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2792
|
+
case "QQQQQ":
|
|
2793
|
+
return n.quarter(r, {
|
|
2794
|
+
width: "narrow",
|
|
2795
|
+
context: "formatting"
|
|
2796
|
+
});
|
|
2797
|
+
// 1st quarter, 2nd quarter, ...
|
|
2798
|
+
case "QQQQ":
|
|
2799
|
+
default:
|
|
2800
|
+
return n.quarter(r, {
|
|
2801
|
+
width: "wide",
|
|
2802
|
+
context: "formatting"
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2805
|
+
},
|
|
2806
|
+
// Stand-alone quarter
|
|
2807
|
+
q: function(t, e, n) {
|
|
2808
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
2809
|
+
switch (e) {
|
|
2810
|
+
// 1, 2, 3, 4
|
|
2811
|
+
case "q":
|
|
2812
|
+
return String(r);
|
|
2813
|
+
// 01, 02, 03, 04
|
|
2814
|
+
case "qq":
|
|
2815
|
+
return x(r, 2);
|
|
2816
|
+
// 1st, 2nd, 3rd, 4th
|
|
2817
|
+
case "qo":
|
|
2818
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
2819
|
+
// Q1, Q2, Q3, Q4
|
|
2820
|
+
case "qqq":
|
|
2821
|
+
return n.quarter(r, {
|
|
2822
|
+
width: "abbreviated",
|
|
2823
|
+
context: "standalone"
|
|
2824
|
+
});
|
|
2825
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2826
|
+
case "qqqqq":
|
|
2827
|
+
return n.quarter(r, {
|
|
2828
|
+
width: "narrow",
|
|
2829
|
+
context: "standalone"
|
|
2830
|
+
});
|
|
2831
|
+
// 1st quarter, 2nd quarter, ...
|
|
2832
|
+
case "qqqq":
|
|
2833
|
+
default:
|
|
2834
|
+
return n.quarter(r, {
|
|
2835
|
+
width: "wide",
|
|
2836
|
+
context: "standalone"
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
},
|
|
2840
|
+
// Month
|
|
2841
|
+
M: function(t, e, n) {
|
|
2842
|
+
const r = t.getMonth();
|
|
2843
|
+
switch (e) {
|
|
2844
|
+
case "M":
|
|
2845
|
+
case "MM":
|
|
2846
|
+
return z.M(t, e);
|
|
2847
|
+
// 1st, 2nd, ..., 12th
|
|
2848
|
+
case "Mo":
|
|
2849
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
2850
|
+
// Jan, Feb, ..., Dec
|
|
2851
|
+
case "MMM":
|
|
2852
|
+
return n.month(r, {
|
|
2853
|
+
width: "abbreviated",
|
|
2854
|
+
context: "formatting"
|
|
2855
|
+
});
|
|
2856
|
+
// J, F, ..., D
|
|
2857
|
+
case "MMMMM":
|
|
2858
|
+
return n.month(r, {
|
|
2859
|
+
width: "narrow",
|
|
2860
|
+
context: "formatting"
|
|
2861
|
+
});
|
|
2862
|
+
// January, February, ..., December
|
|
2863
|
+
case "MMMM":
|
|
2864
|
+
default:
|
|
2865
|
+
return n.month(r, { width: "wide", context: "formatting" });
|
|
2866
|
+
}
|
|
2867
|
+
},
|
|
2868
|
+
// Stand-alone month
|
|
2869
|
+
L: function(t, e, n) {
|
|
2870
|
+
const r = t.getMonth();
|
|
2871
|
+
switch (e) {
|
|
2872
|
+
// 1, 2, ..., 12
|
|
2873
|
+
case "L":
|
|
2874
|
+
return String(r + 1);
|
|
2875
|
+
// 01, 02, ..., 12
|
|
2876
|
+
case "LL":
|
|
2877
|
+
return x(r + 1, 2);
|
|
2878
|
+
// 1st, 2nd, ..., 12th
|
|
2879
|
+
case "Lo":
|
|
2880
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
2881
|
+
// Jan, Feb, ..., Dec
|
|
2882
|
+
case "LLL":
|
|
2883
|
+
return n.month(r, {
|
|
2884
|
+
width: "abbreviated",
|
|
2885
|
+
context: "standalone"
|
|
2886
|
+
});
|
|
2887
|
+
// J, F, ..., D
|
|
2888
|
+
case "LLLLL":
|
|
2889
|
+
return n.month(r, {
|
|
2890
|
+
width: "narrow",
|
|
2891
|
+
context: "standalone"
|
|
2892
|
+
});
|
|
2893
|
+
// January, February, ..., December
|
|
2894
|
+
case "LLLL":
|
|
2895
|
+
default:
|
|
2896
|
+
return n.month(r, { width: "wide", context: "standalone" });
|
|
2897
|
+
}
|
|
2898
|
+
},
|
|
2899
|
+
// Local week of year
|
|
2900
|
+
w: function(t, e, n, r) {
|
|
2901
|
+
const s = fn(t, r);
|
|
2902
|
+
return e === "wo" ? n.ordinalNumber(s, { unit: "week" }) : x(s, e.length);
|
|
2903
|
+
},
|
|
2904
|
+
// ISO week of year
|
|
2905
|
+
I: function(t, e, n) {
|
|
2906
|
+
const r = ln(t);
|
|
2907
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : x(r, e.length);
|
|
2908
|
+
},
|
|
2909
|
+
// Day of the month
|
|
2910
|
+
d: function(t, e, n) {
|
|
2911
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : z.d(t, e);
|
|
2912
|
+
},
|
|
2913
|
+
// Day of year
|
|
2914
|
+
D: function(t, e, n) {
|
|
2915
|
+
const r = go(t);
|
|
2916
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : x(r, e.length);
|
|
2917
|
+
},
|
|
2918
|
+
// Day of week
|
|
2919
|
+
E: function(t, e, n) {
|
|
2920
|
+
const r = t.getDay();
|
|
2921
|
+
switch (e) {
|
|
2922
|
+
// Tue
|
|
2923
|
+
case "E":
|
|
2924
|
+
case "EE":
|
|
2925
|
+
case "EEE":
|
|
2926
|
+
return n.day(r, {
|
|
2927
|
+
width: "abbreviated",
|
|
2928
|
+
context: "formatting"
|
|
2929
|
+
});
|
|
2930
|
+
// T
|
|
2931
|
+
case "EEEEE":
|
|
2932
|
+
return n.day(r, {
|
|
2933
|
+
width: "narrow",
|
|
2934
|
+
context: "formatting"
|
|
2935
|
+
});
|
|
2936
|
+
// Tu
|
|
2937
|
+
case "EEEEEE":
|
|
2938
|
+
return n.day(r, {
|
|
2939
|
+
width: "short",
|
|
2940
|
+
context: "formatting"
|
|
2941
|
+
});
|
|
2942
|
+
// Tuesday
|
|
2943
|
+
case "EEEE":
|
|
2944
|
+
default:
|
|
2945
|
+
return n.day(r, {
|
|
2946
|
+
width: "wide",
|
|
2947
|
+
context: "formatting"
|
|
2948
|
+
});
|
|
2949
|
+
}
|
|
2950
|
+
},
|
|
2951
|
+
// Local day of week
|
|
2952
|
+
e: function(t, e, n, r) {
|
|
2953
|
+
const s = t.getDay(), o = (s - r.weekStartsOn + 8) % 7 || 7;
|
|
2954
|
+
switch (e) {
|
|
2955
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
2956
|
+
case "e":
|
|
2957
|
+
return String(o);
|
|
2958
|
+
// Padded numerical value
|
|
2959
|
+
case "ee":
|
|
2960
|
+
return x(o, 2);
|
|
2961
|
+
// 1st, 2nd, ..., 7th
|
|
2962
|
+
case "eo":
|
|
2963
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
2964
|
+
case "eee":
|
|
2965
|
+
return n.day(s, {
|
|
2966
|
+
width: "abbreviated",
|
|
2967
|
+
context: "formatting"
|
|
2968
|
+
});
|
|
2969
|
+
// T
|
|
2970
|
+
case "eeeee":
|
|
2971
|
+
return n.day(s, {
|
|
2972
|
+
width: "narrow",
|
|
2973
|
+
context: "formatting"
|
|
2974
|
+
});
|
|
2975
|
+
// Tu
|
|
2976
|
+
case "eeeeee":
|
|
2977
|
+
return n.day(s, {
|
|
2978
|
+
width: "short",
|
|
2979
|
+
context: "formatting"
|
|
2980
|
+
});
|
|
2981
|
+
// Tuesday
|
|
2982
|
+
case "eeee":
|
|
2983
|
+
default:
|
|
2984
|
+
return n.day(s, {
|
|
2985
|
+
width: "wide",
|
|
2986
|
+
context: "formatting"
|
|
2987
|
+
});
|
|
2988
|
+
}
|
|
2989
|
+
},
|
|
2990
|
+
// Stand-alone local day of week
|
|
2991
|
+
c: function(t, e, n, r) {
|
|
2992
|
+
const s = t.getDay(), o = (s - r.weekStartsOn + 8) % 7 || 7;
|
|
2993
|
+
switch (e) {
|
|
2994
|
+
// Numerical value (same as in `e`)
|
|
2995
|
+
case "c":
|
|
2996
|
+
return String(o);
|
|
2997
|
+
// Padded numerical value
|
|
2998
|
+
case "cc":
|
|
2999
|
+
return x(o, e.length);
|
|
3000
|
+
// 1st, 2nd, ..., 7th
|
|
3001
|
+
case "co":
|
|
3002
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
3003
|
+
case "ccc":
|
|
3004
|
+
return n.day(s, {
|
|
3005
|
+
width: "abbreviated",
|
|
3006
|
+
context: "standalone"
|
|
3007
|
+
});
|
|
3008
|
+
// T
|
|
3009
|
+
case "ccccc":
|
|
3010
|
+
return n.day(s, {
|
|
3011
|
+
width: "narrow",
|
|
3012
|
+
context: "standalone"
|
|
3013
|
+
});
|
|
3014
|
+
// Tu
|
|
3015
|
+
case "cccccc":
|
|
3016
|
+
return n.day(s, {
|
|
3017
|
+
width: "short",
|
|
3018
|
+
context: "standalone"
|
|
3019
|
+
});
|
|
3020
|
+
// Tuesday
|
|
3021
|
+
case "cccc":
|
|
3022
|
+
default:
|
|
3023
|
+
return n.day(s, {
|
|
3024
|
+
width: "wide",
|
|
3025
|
+
context: "standalone"
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
},
|
|
3029
|
+
// ISO day of week
|
|
3030
|
+
i: function(t, e, n) {
|
|
3031
|
+
const r = t.getDay(), s = r === 0 ? 7 : r;
|
|
3032
|
+
switch (e) {
|
|
3033
|
+
// 2
|
|
3034
|
+
case "i":
|
|
3035
|
+
return String(s);
|
|
3036
|
+
// 02
|
|
3037
|
+
case "ii":
|
|
3038
|
+
return x(s, e.length);
|
|
3039
|
+
// 2nd
|
|
3040
|
+
case "io":
|
|
3041
|
+
return n.ordinalNumber(s, { unit: "day" });
|
|
3042
|
+
// Tue
|
|
3043
|
+
case "iii":
|
|
3044
|
+
return n.day(r, {
|
|
3045
|
+
width: "abbreviated",
|
|
3046
|
+
context: "formatting"
|
|
3047
|
+
});
|
|
3048
|
+
// T
|
|
3049
|
+
case "iiiii":
|
|
3050
|
+
return n.day(r, {
|
|
3051
|
+
width: "narrow",
|
|
3052
|
+
context: "formatting"
|
|
3053
|
+
});
|
|
3054
|
+
// Tu
|
|
3055
|
+
case "iiiiii":
|
|
3056
|
+
return n.day(r, {
|
|
3057
|
+
width: "short",
|
|
3058
|
+
context: "formatting"
|
|
3059
|
+
});
|
|
3060
|
+
// Tuesday
|
|
3061
|
+
case "iiii":
|
|
3062
|
+
default:
|
|
3063
|
+
return n.day(r, {
|
|
3064
|
+
width: "wide",
|
|
3065
|
+
context: "formatting"
|
|
3066
|
+
});
|
|
3067
|
+
}
|
|
3068
|
+
},
|
|
3069
|
+
// AM or PM
|
|
3070
|
+
a: function(t, e, n) {
|
|
3071
|
+
const s = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
3072
|
+
switch (e) {
|
|
3073
|
+
case "a":
|
|
3074
|
+
case "aa":
|
|
3075
|
+
return n.dayPeriod(s, {
|
|
3076
|
+
width: "abbreviated",
|
|
3077
|
+
context: "formatting"
|
|
3078
|
+
});
|
|
3079
|
+
case "aaa":
|
|
3080
|
+
return n.dayPeriod(s, {
|
|
3081
|
+
width: "abbreviated",
|
|
3082
|
+
context: "formatting"
|
|
3083
|
+
}).toLowerCase();
|
|
3084
|
+
case "aaaaa":
|
|
3085
|
+
return n.dayPeriod(s, {
|
|
3086
|
+
width: "narrow",
|
|
3087
|
+
context: "formatting"
|
|
3088
|
+
});
|
|
3089
|
+
case "aaaa":
|
|
3090
|
+
default:
|
|
3091
|
+
return n.dayPeriod(s, {
|
|
3092
|
+
width: "wide",
|
|
3093
|
+
context: "formatting"
|
|
3094
|
+
});
|
|
3095
|
+
}
|
|
3096
|
+
},
|
|
3097
|
+
// AM, PM, midnight, noon
|
|
3098
|
+
b: function(t, e, n) {
|
|
3099
|
+
const r = t.getHours();
|
|
3100
|
+
let s;
|
|
3101
|
+
switch (r === 12 ? s = te.noon : r === 0 ? s = te.midnight : s = r / 12 >= 1 ? "pm" : "am", e) {
|
|
3102
|
+
case "b":
|
|
3103
|
+
case "bb":
|
|
3104
|
+
return n.dayPeriod(s, {
|
|
3105
|
+
width: "abbreviated",
|
|
3106
|
+
context: "formatting"
|
|
3107
|
+
});
|
|
3108
|
+
case "bbb":
|
|
3109
|
+
return n.dayPeriod(s, {
|
|
3110
|
+
width: "abbreviated",
|
|
3111
|
+
context: "formatting"
|
|
3112
|
+
}).toLowerCase();
|
|
3113
|
+
case "bbbbb":
|
|
3114
|
+
return n.dayPeriod(s, {
|
|
3115
|
+
width: "narrow",
|
|
3116
|
+
context: "formatting"
|
|
3117
|
+
});
|
|
3118
|
+
case "bbbb":
|
|
3119
|
+
default:
|
|
3120
|
+
return n.dayPeriod(s, {
|
|
3121
|
+
width: "wide",
|
|
3122
|
+
context: "formatting"
|
|
3123
|
+
});
|
|
3124
|
+
}
|
|
3125
|
+
},
|
|
3126
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
3127
|
+
B: function(t, e, n) {
|
|
3128
|
+
const r = t.getHours();
|
|
3129
|
+
let s;
|
|
3130
|
+
switch (r >= 17 ? s = te.evening : r >= 12 ? s = te.afternoon : r >= 4 ? s = te.morning : s = te.night, e) {
|
|
3131
|
+
case "B":
|
|
3132
|
+
case "BB":
|
|
3133
|
+
case "BBB":
|
|
3134
|
+
return n.dayPeriod(s, {
|
|
3135
|
+
width: "abbreviated",
|
|
3136
|
+
context: "formatting"
|
|
3137
|
+
});
|
|
3138
|
+
case "BBBBB":
|
|
3139
|
+
return n.dayPeriod(s, {
|
|
3140
|
+
width: "narrow",
|
|
3141
|
+
context: "formatting"
|
|
3142
|
+
});
|
|
3143
|
+
case "BBBB":
|
|
3144
|
+
default:
|
|
3145
|
+
return n.dayPeriod(s, {
|
|
3146
|
+
width: "wide",
|
|
3147
|
+
context: "formatting"
|
|
3148
|
+
});
|
|
3149
|
+
}
|
|
3150
|
+
},
|
|
3151
|
+
// Hour [1-12]
|
|
3152
|
+
h: function(t, e, n) {
|
|
3153
|
+
if (e === "ho") {
|
|
3154
|
+
let r = t.getHours() % 12;
|
|
3155
|
+
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
3156
|
+
}
|
|
3157
|
+
return z.h(t, e);
|
|
3158
|
+
},
|
|
3159
|
+
// Hour [0-23]
|
|
3160
|
+
H: function(t, e, n) {
|
|
3161
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : z.H(t, e);
|
|
3162
|
+
},
|
|
3163
|
+
// Hour [0-11]
|
|
3164
|
+
K: function(t, e, n) {
|
|
3165
|
+
const r = t.getHours() % 12;
|
|
3166
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : x(r, e.length);
|
|
3167
|
+
},
|
|
3168
|
+
// Hour [1-24]
|
|
3169
|
+
k: function(t, e, n) {
|
|
3170
|
+
let r = t.getHours();
|
|
3171
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : x(r, e.length);
|
|
3172
|
+
},
|
|
3173
|
+
// Minute
|
|
3174
|
+
m: function(t, e, n) {
|
|
3175
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : z.m(t, e);
|
|
3176
|
+
},
|
|
3177
|
+
// Second
|
|
3178
|
+
s: function(t, e, n) {
|
|
3179
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : z.s(t, e);
|
|
3180
|
+
},
|
|
3181
|
+
// Fraction of second
|
|
3182
|
+
S: function(t, e) {
|
|
3183
|
+
return z.S(t, e);
|
|
3184
|
+
},
|
|
3185
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
3186
|
+
X: function(t, e, n) {
|
|
3187
|
+
const r = t.getTimezoneOffset();
|
|
3188
|
+
if (r === 0)
|
|
3189
|
+
return "Z";
|
|
3190
|
+
switch (e) {
|
|
3191
|
+
// Hours and optional minutes
|
|
3192
|
+
case "X":
|
|
3193
|
+
return Dt(r);
|
|
3194
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
3195
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
3196
|
+
// so this token always has the same output as `XX`
|
|
3197
|
+
case "XXXX":
|
|
3198
|
+
case "XX":
|
|
3199
|
+
return V(r);
|
|
3200
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
3201
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
3202
|
+
// so this token always has the same output as `XXX`
|
|
3203
|
+
case "XXXXX":
|
|
3204
|
+
case "XXX":
|
|
3205
|
+
// Hours and minutes with `:` delimiter
|
|
3206
|
+
default:
|
|
3207
|
+
return V(r, ":");
|
|
3208
|
+
}
|
|
3209
|
+
},
|
|
3210
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
3211
|
+
x: function(t, e, n) {
|
|
3212
|
+
const r = t.getTimezoneOffset();
|
|
3213
|
+
switch (e) {
|
|
3214
|
+
// Hours and optional minutes
|
|
3215
|
+
case "x":
|
|
3216
|
+
return Dt(r);
|
|
3217
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
3218
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
3219
|
+
// so this token always has the same output as `xx`
|
|
3220
|
+
case "xxxx":
|
|
3221
|
+
case "xx":
|
|
3222
|
+
return V(r);
|
|
3223
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
3224
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
3225
|
+
// so this token always has the same output as `xxx`
|
|
3226
|
+
case "xxxxx":
|
|
3227
|
+
case "xxx":
|
|
3228
|
+
// Hours and minutes with `:` delimiter
|
|
3229
|
+
default:
|
|
3230
|
+
return V(r, ":");
|
|
3231
|
+
}
|
|
3232
|
+
},
|
|
3233
|
+
// Timezone (GMT)
|
|
3234
|
+
O: function(t, e, n) {
|
|
3235
|
+
const r = t.getTimezoneOffset();
|
|
3236
|
+
switch (e) {
|
|
3237
|
+
// Short
|
|
3238
|
+
case "O":
|
|
3239
|
+
case "OO":
|
|
3240
|
+
case "OOO":
|
|
3241
|
+
return "GMT" + Pt(r, ":");
|
|
3242
|
+
// Long
|
|
3243
|
+
case "OOOO":
|
|
3244
|
+
default:
|
|
3245
|
+
return "GMT" + V(r, ":");
|
|
3246
|
+
}
|
|
3247
|
+
},
|
|
3248
|
+
// Timezone (specific non-location)
|
|
3249
|
+
z: function(t, e, n) {
|
|
3250
|
+
const r = t.getTimezoneOffset();
|
|
3251
|
+
switch (e) {
|
|
3252
|
+
// Short
|
|
3253
|
+
case "z":
|
|
3254
|
+
case "zz":
|
|
3255
|
+
case "zzz":
|
|
3256
|
+
return "GMT" + Pt(r, ":");
|
|
3257
|
+
// Long
|
|
3258
|
+
case "zzzz":
|
|
3259
|
+
default:
|
|
3260
|
+
return "GMT" + V(r, ":");
|
|
3261
|
+
}
|
|
3262
|
+
},
|
|
3263
|
+
// Seconds timestamp
|
|
3264
|
+
t: function(t, e, n) {
|
|
3265
|
+
const r = Math.trunc(+t / 1e3);
|
|
3266
|
+
return x(r, e.length);
|
|
3267
|
+
},
|
|
3268
|
+
// Milliseconds timestamp
|
|
3269
|
+
T: function(t, e, n) {
|
|
3270
|
+
return x(+t, e.length);
|
|
3271
|
+
}
|
|
3272
|
+
};
|
|
3273
|
+
function Pt(t, e = "") {
|
|
3274
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), s = Math.trunc(r / 60), o = r % 60;
|
|
3275
|
+
return o === 0 ? n + String(s) : n + String(s) + e + x(o, 2);
|
|
3276
|
+
}
|
|
3277
|
+
function Dt(t, e) {
|
|
3278
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + x(Math.abs(t) / 60, 2) : V(t, e);
|
|
3279
|
+
}
|
|
3280
|
+
function V(t, e = "") {
|
|
3281
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), s = x(Math.trunc(r / 60), 2), o = x(r % 60, 2);
|
|
3282
|
+
return n + s + e + o;
|
|
3283
|
+
}
|
|
3284
|
+
const Mt = (t, e) => {
|
|
3285
|
+
switch (t) {
|
|
3286
|
+
case "P":
|
|
3287
|
+
return e.date({ width: "short" });
|
|
3288
|
+
case "PP":
|
|
3289
|
+
return e.date({ width: "medium" });
|
|
3290
|
+
case "PPP":
|
|
3291
|
+
return e.date({ width: "long" });
|
|
3292
|
+
case "PPPP":
|
|
3293
|
+
default:
|
|
3294
|
+
return e.date({ width: "full" });
|
|
3295
|
+
}
|
|
3296
|
+
}, dn = (t, e) => {
|
|
3297
|
+
switch (t) {
|
|
3298
|
+
case "p":
|
|
3299
|
+
return e.time({ width: "short" });
|
|
3300
|
+
case "pp":
|
|
3301
|
+
return e.time({ width: "medium" });
|
|
3302
|
+
case "ppp":
|
|
3303
|
+
return e.time({ width: "long" });
|
|
3304
|
+
case "pppp":
|
|
3305
|
+
default:
|
|
3306
|
+
return e.time({ width: "full" });
|
|
3307
|
+
}
|
|
3308
|
+
}, xo = (t, e) => {
|
|
3309
|
+
const n = t.match(/(P+)(p+)?/) || [], r = n[1], s = n[2];
|
|
3310
|
+
if (!s)
|
|
3311
|
+
return Mt(t, e);
|
|
3312
|
+
let o;
|
|
3313
|
+
switch (r) {
|
|
3314
|
+
case "P":
|
|
3315
|
+
o = e.dateTime({ width: "short" });
|
|
3316
|
+
break;
|
|
3317
|
+
case "PP":
|
|
3318
|
+
o = e.dateTime({ width: "medium" });
|
|
3319
|
+
break;
|
|
3320
|
+
case "PPP":
|
|
3321
|
+
o = e.dateTime({ width: "long" });
|
|
3322
|
+
break;
|
|
3323
|
+
case "PPPP":
|
|
3324
|
+
default:
|
|
3325
|
+
o = e.dateTime({ width: "full" });
|
|
3326
|
+
break;
|
|
3327
|
+
}
|
|
3328
|
+
return o.replace("{{date}}", Mt(r, e)).replace("{{time}}", dn(s, e));
|
|
3329
|
+
}, ve = {
|
|
3330
|
+
p: dn,
|
|
3331
|
+
P: xo
|
|
3332
|
+
}, Oo = /^D+$/, To = /^Y+$/, Eo = ["D", "DD", "YY", "YYYY"];
|
|
3333
|
+
function hn(t) {
|
|
3334
|
+
return Oo.test(t);
|
|
3335
|
+
}
|
|
3336
|
+
function mn(t) {
|
|
3337
|
+
return To.test(t);
|
|
3338
|
+
}
|
|
3339
|
+
function Ye(t, e, n) {
|
|
3340
|
+
const r = Po(t, e, n);
|
|
3341
|
+
if (console.warn(r), Eo.includes(t)) throw new RangeError(r);
|
|
3342
|
+
}
|
|
3343
|
+
function Po(t, e, n) {
|
|
3344
|
+
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
3345
|
+
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
3346
|
+
}
|
|
3347
|
+
const Do = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Mo = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ro = /^'([^]*?)'?$/, ko = /''/g, Ao = /[a-zA-Z]/;
|
|
3348
|
+
function _o(t, e, n) {
|
|
3349
|
+
const r = ie(), s = r.locale ?? un, o = r.firstWeekContainsDate ?? r.locale?.options?.firstWeekContainsDate ?? 1, i = r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, a = O(t, n?.in);
|
|
3350
|
+
if (!Ms(a))
|
|
3351
|
+
throw new RangeError("Invalid time value");
|
|
3352
|
+
let f = e.match(Mo).map((u) => {
|
|
3353
|
+
const m = u[0];
|
|
3354
|
+
if (m === "p" || m === "P") {
|
|
3355
|
+
const p = ve[m];
|
|
3356
|
+
return p(u, s.formatLong);
|
|
3357
|
+
}
|
|
3358
|
+
return u;
|
|
3359
|
+
}).join("").match(Do).map((u) => {
|
|
3360
|
+
if (u === "''")
|
|
3361
|
+
return { isToken: !1, value: "'" };
|
|
3362
|
+
const m = u[0];
|
|
3363
|
+
if (m === "'")
|
|
3364
|
+
return { isToken: !1, value: No(u) };
|
|
3365
|
+
if (Et[m])
|
|
3366
|
+
return { isToken: !0, value: u };
|
|
3367
|
+
if (m.match(Ao))
|
|
3368
|
+
throw new RangeError(
|
|
3369
|
+
"Format string contains an unescaped latin alphabet character `" + m + "`"
|
|
3370
|
+
);
|
|
3371
|
+
return { isToken: !1, value: u };
|
|
3372
|
+
});
|
|
3373
|
+
s.localize.preprocessor && (f = s.localize.preprocessor(a, f));
|
|
3374
|
+
const l = {
|
|
3375
|
+
firstWeekContainsDate: o,
|
|
3376
|
+
weekStartsOn: i,
|
|
3377
|
+
locale: s
|
|
3378
|
+
};
|
|
3379
|
+
return f.map((u) => {
|
|
3380
|
+
if (!u.isToken) return u.value;
|
|
3381
|
+
const m = u.value;
|
|
3382
|
+
(mn(m) || hn(m)) && Ye(m, e, String(t));
|
|
3383
|
+
const p = Et[m[0]];
|
|
3384
|
+
return p(a, m, s.localize, l);
|
|
3385
|
+
}).join("");
|
|
3386
|
+
}
|
|
3387
|
+
function No(t) {
|
|
3388
|
+
const e = t.match(Ro);
|
|
3389
|
+
return e ? e[1].replace(ko, "'") : t;
|
|
3390
|
+
}
|
|
3391
|
+
function Co(t, e) {
|
|
3392
|
+
const n = O(t, e?.in);
|
|
3393
|
+
if (isNaN(+n))
|
|
3394
|
+
throw new RangeError("Invalid time value");
|
|
3395
|
+
let r = "", s = "";
|
|
3396
|
+
const o = "-", i = ":";
|
|
3397
|
+
{
|
|
3398
|
+
const a = x(n.getDate(), 2), f = x(n.getMonth() + 1, 2);
|
|
3399
|
+
r = `${x(n.getFullYear(), 4)}${o}${f}${o}${a}`;
|
|
3400
|
+
}
|
|
3401
|
+
{
|
|
3402
|
+
const a = n.getTimezoneOffset();
|
|
3403
|
+
if (a !== 0) {
|
|
3404
|
+
const b = Math.abs(a), d = x(Math.trunc(b / 60), 2), w = x(b % 60, 2);
|
|
3405
|
+
s = `${a < 0 ? "+" : "-"}${d}:${w}`;
|
|
3406
|
+
} else
|
|
3407
|
+
s = "Z";
|
|
3408
|
+
const f = x(n.getHours(), 2), l = x(n.getMinutes(), 2), u = x(n.getSeconds(), 2), m = r === "" ? "" : "T", p = [f, l, u].join(i);
|
|
3409
|
+
r = `${r}${m}${p}${s}`;
|
|
3410
|
+
}
|
|
3411
|
+
return r;
|
|
3412
|
+
}
|
|
3413
|
+
function So() {
|
|
3414
|
+
return Object.assign({}, ie());
|
|
3415
|
+
}
|
|
3416
|
+
function Fo(t, e) {
|
|
3417
|
+
const n = O(t, e?.in).getDay();
|
|
3418
|
+
return n === 0 ? 7 : n;
|
|
3419
|
+
}
|
|
3420
|
+
function Lo(t, e) {
|
|
3421
|
+
return +O(t) > +O(e);
|
|
3422
|
+
}
|
|
3423
|
+
function $o(t, e) {
|
|
3424
|
+
return +O(t) < +O(e);
|
|
3425
|
+
}
|
|
3426
|
+
function qo(t, e) {
|
|
3427
|
+
const n = Ho(e) ? new e(0) : N(e, 0);
|
|
3428
|
+
return n.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()), n.setHours(
|
|
3429
|
+
t.getHours(),
|
|
3430
|
+
t.getMinutes(),
|
|
3431
|
+
t.getSeconds(),
|
|
3432
|
+
t.getMilliseconds()
|
|
3433
|
+
), n;
|
|
3434
|
+
}
|
|
3435
|
+
function Ho(t) {
|
|
3436
|
+
return typeof t == "function" && t.prototype?.constructor === t;
|
|
3437
|
+
}
|
|
3438
|
+
const Bo = 10;
|
|
3439
|
+
class pn {
|
|
3440
|
+
subPriority = 0;
|
|
3441
|
+
validate(e, n) {
|
|
3442
|
+
return !0;
|
|
3443
|
+
}
|
|
3444
|
+
}
|
|
3445
|
+
class Io extends pn {
|
|
3446
|
+
constructor(e, n, r, s, o) {
|
|
3447
|
+
super(), this.value = e, this.validateValue = n, this.setValue = r, this.priority = s, o && (this.subPriority = o);
|
|
3448
|
+
}
|
|
3449
|
+
validate(e, n) {
|
|
3450
|
+
return this.validateValue(e, this.value, n);
|
|
3451
|
+
}
|
|
3452
|
+
set(e, n, r) {
|
|
3453
|
+
return this.setValue(e, n, this.value, r);
|
|
3454
|
+
}
|
|
3455
|
+
}
|
|
3456
|
+
class vo extends pn {
|
|
3457
|
+
priority = Bo;
|
|
3458
|
+
subPriority = -1;
|
|
3459
|
+
constructor(e, n) {
|
|
3460
|
+
super(), this.context = e || ((r) => N(n, r));
|
|
3461
|
+
}
|
|
3462
|
+
set(e, n) {
|
|
3463
|
+
return n.timestampIsSet ? e : N(e, qo(e, this.context));
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
class T {
|
|
3467
|
+
run(e, n, r, s) {
|
|
3468
|
+
const o = this.parse(e, n, r, s);
|
|
3469
|
+
return o ? {
|
|
3470
|
+
setter: new Io(
|
|
3471
|
+
o.value,
|
|
3472
|
+
this.validate,
|
|
3473
|
+
this.set,
|
|
3474
|
+
this.priority,
|
|
3475
|
+
this.subPriority
|
|
3476
|
+
),
|
|
3477
|
+
rest: o.rest
|
|
3478
|
+
} : null;
|
|
3479
|
+
}
|
|
3480
|
+
validate(e, n, r) {
|
|
3481
|
+
return !0;
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
class Yo extends T {
|
|
3485
|
+
priority = 140;
|
|
3486
|
+
parse(e, n, r) {
|
|
3487
|
+
switch (n) {
|
|
3488
|
+
// AD, BC
|
|
3489
|
+
case "G":
|
|
3490
|
+
case "GG":
|
|
3491
|
+
case "GGG":
|
|
3492
|
+
return r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
|
|
3493
|
+
// A, B
|
|
3494
|
+
case "GGGGG":
|
|
3495
|
+
return r.era(e, { width: "narrow" });
|
|
3496
|
+
// Anno Domini, Before Christ
|
|
3497
|
+
case "GGGG":
|
|
3498
|
+
default:
|
|
3499
|
+
return r.era(e, { width: "wide" }) || r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" });
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
set(e, n, r) {
|
|
3503
|
+
return n.era = r, e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3504
|
+
}
|
|
3505
|
+
incompatibleTokens = ["R", "u", "t", "T"];
|
|
3506
|
+
}
|
|
3507
|
+
const R = {
|
|
3508
|
+
month: /^(1[0-2]|0?\d)/,
|
|
3509
|
+
// 0 to 12
|
|
3510
|
+
date: /^(3[0-1]|[0-2]?\d)/,
|
|
3511
|
+
// 0 to 31
|
|
3512
|
+
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
3513
|
+
// 0 to 366
|
|
3514
|
+
week: /^(5[0-3]|[0-4]?\d)/,
|
|
3515
|
+
// 0 to 53
|
|
3516
|
+
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
3517
|
+
// 0 to 23
|
|
3518
|
+
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
3519
|
+
// 0 to 24
|
|
3520
|
+
hour11h: /^(1[0-1]|0?\d)/,
|
|
3521
|
+
// 0 to 11
|
|
3522
|
+
hour12h: /^(1[0-2]|0?\d)/,
|
|
3523
|
+
// 0 to 12
|
|
3524
|
+
minute: /^[0-5]?\d/,
|
|
3525
|
+
// 0 to 59
|
|
3526
|
+
second: /^[0-5]?\d/,
|
|
3527
|
+
// 0 to 59
|
|
3528
|
+
singleDigit: /^\d/,
|
|
3529
|
+
// 0 to 9
|
|
3530
|
+
twoDigits: /^\d{1,2}/,
|
|
3531
|
+
// 0 to 99
|
|
3532
|
+
threeDigits: /^\d{1,3}/,
|
|
3533
|
+
// 0 to 999
|
|
3534
|
+
fourDigits: /^\d{1,4}/,
|
|
3535
|
+
// 0 to 9999
|
|
3536
|
+
anyDigitsSigned: /^-?\d+/,
|
|
3537
|
+
singleDigitSigned: /^-?\d/,
|
|
3538
|
+
// 0 to 9, -0 to -9
|
|
3539
|
+
twoDigitsSigned: /^-?\d{1,2}/,
|
|
3540
|
+
// 0 to 99, -0 to -99
|
|
3541
|
+
threeDigitsSigned: /^-?\d{1,3}/,
|
|
3542
|
+
// 0 to 999, -0 to -999
|
|
3543
|
+
fourDigitsSigned: /^-?\d{1,4}/
|
|
3544
|
+
// 0 to 9999, -0 to -9999
|
|
3545
|
+
}, v = {
|
|
3546
|
+
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
3547
|
+
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
3548
|
+
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
3549
|
+
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
3550
|
+
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
3551
|
+
};
|
|
3552
|
+
function k(t, e) {
|
|
3553
|
+
return t && {
|
|
3554
|
+
value: e(t.value),
|
|
3555
|
+
rest: t.rest
|
|
3556
|
+
};
|
|
3557
|
+
}
|
|
3558
|
+
function P(t, e) {
|
|
3559
|
+
const n = e.match(t);
|
|
3560
|
+
return n ? {
|
|
3561
|
+
value: parseInt(n[0], 10),
|
|
3562
|
+
rest: e.slice(n[0].length)
|
|
3563
|
+
} : null;
|
|
3564
|
+
}
|
|
3565
|
+
function Y(t, e) {
|
|
3566
|
+
const n = e.match(t);
|
|
3567
|
+
if (!n)
|
|
3568
|
+
return null;
|
|
3569
|
+
if (n[0] === "Z")
|
|
3570
|
+
return {
|
|
3571
|
+
value: 0,
|
|
3572
|
+
rest: e.slice(1)
|
|
3573
|
+
};
|
|
3574
|
+
const r = n[1] === "+" ? 1 : -1, s = n[2] ? parseInt(n[2], 10) : 0, o = n[3] ? parseInt(n[3], 10) : 0, i = n[5] ? parseInt(n[5], 10) : 0;
|
|
3575
|
+
return {
|
|
3576
|
+
value: r * (s * rn + o * nn + i * Ts),
|
|
3577
|
+
rest: e.slice(n[0].length)
|
|
3578
|
+
};
|
|
3579
|
+
}
|
|
3580
|
+
function wn(t) {
|
|
3581
|
+
return P(R.anyDigitsSigned, t);
|
|
3582
|
+
}
|
|
3583
|
+
function D(t, e) {
|
|
3584
|
+
switch (t) {
|
|
3585
|
+
case 1:
|
|
3586
|
+
return P(R.singleDigit, e);
|
|
3587
|
+
case 2:
|
|
3588
|
+
return P(R.twoDigits, e);
|
|
3589
|
+
case 3:
|
|
3590
|
+
return P(R.threeDigits, e);
|
|
3591
|
+
case 4:
|
|
3592
|
+
return P(R.fourDigits, e);
|
|
3593
|
+
default:
|
|
3594
|
+
return P(new RegExp("^\\d{1," + t + "}"), e);
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
function De(t, e) {
|
|
3598
|
+
switch (t) {
|
|
3599
|
+
case 1:
|
|
3600
|
+
return P(R.singleDigitSigned, e);
|
|
3601
|
+
case 2:
|
|
3602
|
+
return P(R.twoDigitsSigned, e);
|
|
3603
|
+
case 3:
|
|
3604
|
+
return P(R.threeDigitsSigned, e);
|
|
3605
|
+
case 4:
|
|
3606
|
+
return P(R.fourDigitsSigned, e);
|
|
3607
|
+
default:
|
|
3608
|
+
return P(new RegExp("^-?\\d{1," + t + "}"), e);
|
|
3609
|
+
}
|
|
3610
|
+
}
|
|
3611
|
+
function Je(t) {
|
|
3612
|
+
switch (t) {
|
|
3613
|
+
case "morning":
|
|
3614
|
+
return 4;
|
|
3615
|
+
case "evening":
|
|
3616
|
+
return 17;
|
|
3617
|
+
case "pm":
|
|
3618
|
+
case "noon":
|
|
3619
|
+
case "afternoon":
|
|
3620
|
+
return 12;
|
|
3621
|
+
case "am":
|
|
3622
|
+
case "midnight":
|
|
3623
|
+
case "night":
|
|
3624
|
+
default:
|
|
3625
|
+
return 0;
|
|
3626
|
+
}
|
|
3627
|
+
}
|
|
3628
|
+
function yn(t, e) {
|
|
3629
|
+
const n = e > 0, r = n ? e : 1 - e;
|
|
3630
|
+
let s;
|
|
3631
|
+
if (r <= 50)
|
|
3632
|
+
s = t || 100;
|
|
3633
|
+
else {
|
|
3634
|
+
const o = r + 50, i = Math.trunc(o / 100) * 100, a = t >= o % 100;
|
|
3635
|
+
s = t + i - (a ? 100 : 0);
|
|
3636
|
+
}
|
|
3637
|
+
return n ? s : 1 - s;
|
|
3638
|
+
}
|
|
3639
|
+
function gn(t) {
|
|
3640
|
+
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
3641
|
+
}
|
|
3642
|
+
class Wo extends T {
|
|
3643
|
+
priority = 130;
|
|
3644
|
+
incompatibleTokens = ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"];
|
|
3645
|
+
parse(e, n, r) {
|
|
3646
|
+
const s = (o) => ({
|
|
3647
|
+
year: o,
|
|
3648
|
+
isTwoDigitYear: n === "yy"
|
|
3649
|
+
});
|
|
3650
|
+
switch (n) {
|
|
3651
|
+
case "y":
|
|
3652
|
+
return k(D(4, e), s);
|
|
3653
|
+
case "yo":
|
|
3654
|
+
return k(
|
|
3655
|
+
r.ordinalNumber(e, {
|
|
3656
|
+
unit: "year"
|
|
3657
|
+
}),
|
|
3658
|
+
s
|
|
3659
|
+
);
|
|
3660
|
+
default:
|
|
3661
|
+
return k(D(n.length, e), s);
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
validate(e, n) {
|
|
3665
|
+
return n.isTwoDigitYear || n.year > 0;
|
|
3666
|
+
}
|
|
3667
|
+
set(e, n, r) {
|
|
3668
|
+
const s = e.getFullYear();
|
|
3669
|
+
if (r.isTwoDigitYear) {
|
|
3670
|
+
const i = yn(
|
|
3671
|
+
r.year,
|
|
3672
|
+
s
|
|
3673
|
+
);
|
|
3674
|
+
return e.setFullYear(i, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3675
|
+
}
|
|
3676
|
+
const o = !("era" in n) || n.era === 1 ? r.year : 1 - r.year;
|
|
3677
|
+
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
class jo extends T {
|
|
3681
|
+
priority = 130;
|
|
3682
|
+
parse(e, n, r) {
|
|
3683
|
+
const s = (o) => ({
|
|
3684
|
+
year: o,
|
|
3685
|
+
isTwoDigitYear: n === "YY"
|
|
3686
|
+
});
|
|
3687
|
+
switch (n) {
|
|
3688
|
+
case "Y":
|
|
3689
|
+
return k(D(4, e), s);
|
|
3690
|
+
case "Yo":
|
|
3691
|
+
return k(
|
|
3692
|
+
r.ordinalNumber(e, {
|
|
3693
|
+
unit: "year"
|
|
3694
|
+
}),
|
|
3695
|
+
s
|
|
3696
|
+
);
|
|
3697
|
+
default:
|
|
3698
|
+
return k(D(n.length, e), s);
|
|
3699
|
+
}
|
|
3700
|
+
}
|
|
3701
|
+
validate(e, n) {
|
|
3702
|
+
return n.isTwoDigitYear || n.year > 0;
|
|
3703
|
+
}
|
|
3704
|
+
set(e, n, r, s) {
|
|
3705
|
+
const o = Ve(e, s);
|
|
3706
|
+
if (r.isTwoDigitYear) {
|
|
3707
|
+
const a = yn(
|
|
3708
|
+
r.year,
|
|
3709
|
+
o
|
|
3710
|
+
);
|
|
3711
|
+
return e.setFullYear(
|
|
3712
|
+
a,
|
|
3713
|
+
0,
|
|
3714
|
+
s.firstWeekContainsDate
|
|
3715
|
+
), e.setHours(0, 0, 0, 0), Q(e, s);
|
|
3716
|
+
}
|
|
3717
|
+
const i = !("era" in n) || n.era === 1 ? r.year : 1 - r.year;
|
|
3718
|
+
return e.setFullYear(i, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), Q(e, s);
|
|
3719
|
+
}
|
|
3720
|
+
incompatibleTokens = [
|
|
3721
|
+
"y",
|
|
3722
|
+
"R",
|
|
3723
|
+
"u",
|
|
3724
|
+
"Q",
|
|
3725
|
+
"q",
|
|
3726
|
+
"M",
|
|
3727
|
+
"L",
|
|
3728
|
+
"I",
|
|
3729
|
+
"d",
|
|
3730
|
+
"D",
|
|
3731
|
+
"i",
|
|
3732
|
+
"t",
|
|
3733
|
+
"T"
|
|
3734
|
+
];
|
|
3735
|
+
}
|
|
3736
|
+
class Uo extends T {
|
|
3737
|
+
priority = 130;
|
|
3738
|
+
parse(e, n) {
|
|
3739
|
+
return De(n === "R" ? 4 : n.length, e);
|
|
3740
|
+
}
|
|
3741
|
+
set(e, n, r) {
|
|
3742
|
+
const s = N(e, 0);
|
|
3743
|
+
return s.setFullYear(r, 0, 4), s.setHours(0, 0, 0, 0), re(s);
|
|
3744
|
+
}
|
|
3745
|
+
incompatibleTokens = [
|
|
3746
|
+
"G",
|
|
3747
|
+
"y",
|
|
3748
|
+
"Y",
|
|
3749
|
+
"u",
|
|
3750
|
+
"Q",
|
|
3751
|
+
"q",
|
|
3752
|
+
"M",
|
|
3753
|
+
"L",
|
|
3754
|
+
"w",
|
|
3755
|
+
"d",
|
|
3756
|
+
"D",
|
|
3757
|
+
"e",
|
|
3758
|
+
"c",
|
|
3759
|
+
"t",
|
|
3760
|
+
"T"
|
|
3761
|
+
];
|
|
3762
|
+
}
|
|
3763
|
+
class zo extends T {
|
|
3764
|
+
priority = 130;
|
|
3765
|
+
parse(e, n) {
|
|
3766
|
+
return De(n === "u" ? 4 : n.length, e);
|
|
3767
|
+
}
|
|
3768
|
+
set(e, n, r) {
|
|
3769
|
+
return e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
3770
|
+
}
|
|
3771
|
+
incompatibleTokens = ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"];
|
|
3772
|
+
}
|
|
3773
|
+
class Qo extends T {
|
|
3774
|
+
priority = 120;
|
|
3775
|
+
parse(e, n, r) {
|
|
3776
|
+
switch (n) {
|
|
3777
|
+
// 1, 2, 3, 4
|
|
3778
|
+
case "Q":
|
|
3779
|
+
case "QQ":
|
|
3780
|
+
return D(n.length, e);
|
|
3781
|
+
// 1st, 2nd, 3rd, 4th
|
|
3782
|
+
case "Qo":
|
|
3783
|
+
return r.ordinalNumber(e, { unit: "quarter" });
|
|
3784
|
+
// Q1, Q2, Q3, Q4
|
|
3785
|
+
case "QQQ":
|
|
3786
|
+
return r.quarter(e, {
|
|
3787
|
+
width: "abbreviated",
|
|
3788
|
+
context: "formatting"
|
|
3789
|
+
}) || r.quarter(e, {
|
|
3790
|
+
width: "narrow",
|
|
3791
|
+
context: "formatting"
|
|
3792
|
+
});
|
|
3793
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
3794
|
+
case "QQQQQ":
|
|
3795
|
+
return r.quarter(e, {
|
|
3796
|
+
width: "narrow",
|
|
3797
|
+
context: "formatting"
|
|
3798
|
+
});
|
|
3799
|
+
// 1st quarter, 2nd quarter, ...
|
|
3800
|
+
case "QQQQ":
|
|
3801
|
+
default:
|
|
3802
|
+
return r.quarter(e, {
|
|
3803
|
+
width: "wide",
|
|
3804
|
+
context: "formatting"
|
|
3805
|
+
}) || r.quarter(e, {
|
|
3806
|
+
width: "abbreviated",
|
|
3807
|
+
context: "formatting"
|
|
3808
|
+
}) || r.quarter(e, {
|
|
3809
|
+
width: "narrow",
|
|
3810
|
+
context: "formatting"
|
|
3811
|
+
});
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
validate(e, n) {
|
|
3815
|
+
return n >= 1 && n <= 4;
|
|
3816
|
+
}
|
|
3817
|
+
set(e, n, r) {
|
|
3818
|
+
return e.setMonth((r - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
3819
|
+
}
|
|
3820
|
+
incompatibleTokens = [
|
|
3821
|
+
"Y",
|
|
3822
|
+
"R",
|
|
3823
|
+
"q",
|
|
3824
|
+
"M",
|
|
3825
|
+
"L",
|
|
3826
|
+
"w",
|
|
3827
|
+
"I",
|
|
3828
|
+
"d",
|
|
3829
|
+
"D",
|
|
3830
|
+
"i",
|
|
3831
|
+
"e",
|
|
3832
|
+
"c",
|
|
3833
|
+
"t",
|
|
3834
|
+
"T"
|
|
3835
|
+
];
|
|
3836
|
+
}
|
|
3837
|
+
class Xo extends T {
|
|
3838
|
+
priority = 120;
|
|
3839
|
+
parse(e, n, r) {
|
|
3840
|
+
switch (n) {
|
|
3841
|
+
// 1, 2, 3, 4
|
|
3842
|
+
case "q":
|
|
3843
|
+
case "qq":
|
|
3844
|
+
return D(n.length, e);
|
|
3845
|
+
// 1st, 2nd, 3rd, 4th
|
|
3846
|
+
case "qo":
|
|
3847
|
+
return r.ordinalNumber(e, { unit: "quarter" });
|
|
3848
|
+
// Q1, Q2, Q3, Q4
|
|
3849
|
+
case "qqq":
|
|
3850
|
+
return r.quarter(e, {
|
|
3851
|
+
width: "abbreviated",
|
|
3852
|
+
context: "standalone"
|
|
3853
|
+
}) || r.quarter(e, {
|
|
3854
|
+
width: "narrow",
|
|
3855
|
+
context: "standalone"
|
|
3856
|
+
});
|
|
3857
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
3858
|
+
case "qqqqq":
|
|
3859
|
+
return r.quarter(e, {
|
|
3860
|
+
width: "narrow",
|
|
3861
|
+
context: "standalone"
|
|
3862
|
+
});
|
|
3863
|
+
// 1st quarter, 2nd quarter, ...
|
|
3864
|
+
case "qqqq":
|
|
3865
|
+
default:
|
|
3866
|
+
return r.quarter(e, {
|
|
3867
|
+
width: "wide",
|
|
3868
|
+
context: "standalone"
|
|
3869
|
+
}) || r.quarter(e, {
|
|
3870
|
+
width: "abbreviated",
|
|
3871
|
+
context: "standalone"
|
|
3872
|
+
}) || r.quarter(e, {
|
|
3873
|
+
width: "narrow",
|
|
3874
|
+
context: "standalone"
|
|
3875
|
+
});
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
validate(e, n) {
|
|
3879
|
+
return n >= 1 && n <= 4;
|
|
3880
|
+
}
|
|
3881
|
+
set(e, n, r) {
|
|
3882
|
+
return e.setMonth((r - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
3883
|
+
}
|
|
3884
|
+
incompatibleTokens = [
|
|
3885
|
+
"Y",
|
|
3886
|
+
"R",
|
|
3887
|
+
"Q",
|
|
3888
|
+
"M",
|
|
3889
|
+
"L",
|
|
3890
|
+
"w",
|
|
3891
|
+
"I",
|
|
3892
|
+
"d",
|
|
3893
|
+
"D",
|
|
3894
|
+
"i",
|
|
3895
|
+
"e",
|
|
3896
|
+
"c",
|
|
3897
|
+
"t",
|
|
3898
|
+
"T"
|
|
3899
|
+
];
|
|
3900
|
+
}
|
|
3901
|
+
class Vo extends T {
|
|
3902
|
+
incompatibleTokens = [
|
|
3903
|
+
"Y",
|
|
3904
|
+
"R",
|
|
3905
|
+
"q",
|
|
3906
|
+
"Q",
|
|
3907
|
+
"L",
|
|
3908
|
+
"w",
|
|
3909
|
+
"I",
|
|
3910
|
+
"D",
|
|
3911
|
+
"i",
|
|
3912
|
+
"e",
|
|
3913
|
+
"c",
|
|
3914
|
+
"t",
|
|
3915
|
+
"T"
|
|
3916
|
+
];
|
|
3917
|
+
priority = 110;
|
|
3918
|
+
parse(e, n, r) {
|
|
3919
|
+
const s = (o) => o - 1;
|
|
3920
|
+
switch (n) {
|
|
3921
|
+
// 1, 2, ..., 12
|
|
3922
|
+
case "M":
|
|
3923
|
+
return k(
|
|
3924
|
+
P(R.month, e),
|
|
3925
|
+
s
|
|
3926
|
+
);
|
|
3927
|
+
// 01, 02, ..., 12
|
|
3928
|
+
case "MM":
|
|
3929
|
+
return k(D(2, e), s);
|
|
3930
|
+
// 1st, 2nd, ..., 12th
|
|
3931
|
+
case "Mo":
|
|
3932
|
+
return k(
|
|
3933
|
+
r.ordinalNumber(e, {
|
|
3934
|
+
unit: "month"
|
|
3935
|
+
}),
|
|
3936
|
+
s
|
|
3937
|
+
);
|
|
3938
|
+
// Jan, Feb, ..., Dec
|
|
3939
|
+
case "MMM":
|
|
3940
|
+
return r.month(e, {
|
|
3941
|
+
width: "abbreviated",
|
|
3942
|
+
context: "formatting"
|
|
3943
|
+
}) || r.month(e, { width: "narrow", context: "formatting" });
|
|
3944
|
+
// J, F, ..., D
|
|
3945
|
+
case "MMMMM":
|
|
3946
|
+
return r.month(e, {
|
|
3947
|
+
width: "narrow",
|
|
3948
|
+
context: "formatting"
|
|
3949
|
+
});
|
|
3950
|
+
// January, February, ..., December
|
|
3951
|
+
case "MMMM":
|
|
3952
|
+
default:
|
|
3953
|
+
return r.month(e, { width: "wide", context: "formatting" }) || r.month(e, {
|
|
3954
|
+
width: "abbreviated",
|
|
3955
|
+
context: "formatting"
|
|
3956
|
+
}) || r.month(e, { width: "narrow", context: "formatting" });
|
|
3957
|
+
}
|
|
3958
|
+
}
|
|
3959
|
+
validate(e, n) {
|
|
3960
|
+
return n >= 0 && n <= 11;
|
|
3961
|
+
}
|
|
3962
|
+
set(e, n, r) {
|
|
3963
|
+
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
3964
|
+
}
|
|
3965
|
+
}
|
|
3966
|
+
class Jo extends T {
|
|
3967
|
+
priority = 110;
|
|
3968
|
+
parse(e, n, r) {
|
|
3969
|
+
const s = (o) => o - 1;
|
|
3970
|
+
switch (n) {
|
|
3971
|
+
// 1, 2, ..., 12
|
|
3972
|
+
case "L":
|
|
3973
|
+
return k(
|
|
3974
|
+
P(R.month, e),
|
|
3975
|
+
s
|
|
3976
|
+
);
|
|
3977
|
+
// 01, 02, ..., 12
|
|
3978
|
+
case "LL":
|
|
3979
|
+
return k(D(2, e), s);
|
|
3980
|
+
// 1st, 2nd, ..., 12th
|
|
3981
|
+
case "Lo":
|
|
3982
|
+
return k(
|
|
3983
|
+
r.ordinalNumber(e, {
|
|
3984
|
+
unit: "month"
|
|
3985
|
+
}),
|
|
3986
|
+
s
|
|
3987
|
+
);
|
|
3988
|
+
// Jan, Feb, ..., Dec
|
|
3989
|
+
case "LLL":
|
|
3990
|
+
return r.month(e, {
|
|
3991
|
+
width: "abbreviated",
|
|
3992
|
+
context: "standalone"
|
|
3993
|
+
}) || r.month(e, { width: "narrow", context: "standalone" });
|
|
3994
|
+
// J, F, ..., D
|
|
3995
|
+
case "LLLLL":
|
|
3996
|
+
return r.month(e, {
|
|
3997
|
+
width: "narrow",
|
|
3998
|
+
context: "standalone"
|
|
3999
|
+
});
|
|
4000
|
+
// January, February, ..., December
|
|
4001
|
+
case "LLLL":
|
|
4002
|
+
default:
|
|
4003
|
+
return r.month(e, { width: "wide", context: "standalone" }) || r.month(e, {
|
|
4004
|
+
width: "abbreviated",
|
|
4005
|
+
context: "standalone"
|
|
4006
|
+
}) || r.month(e, { width: "narrow", context: "standalone" });
|
|
4007
|
+
}
|
|
4008
|
+
}
|
|
4009
|
+
validate(e, n) {
|
|
4010
|
+
return n >= 0 && n <= 11;
|
|
4011
|
+
}
|
|
4012
|
+
set(e, n, r) {
|
|
4013
|
+
return e.setMonth(r, 1), e.setHours(0, 0, 0, 0), e;
|
|
4014
|
+
}
|
|
4015
|
+
incompatibleTokens = [
|
|
4016
|
+
"Y",
|
|
4017
|
+
"R",
|
|
4018
|
+
"q",
|
|
4019
|
+
"Q",
|
|
4020
|
+
"M",
|
|
4021
|
+
"w",
|
|
4022
|
+
"I",
|
|
4023
|
+
"D",
|
|
4024
|
+
"i",
|
|
4025
|
+
"e",
|
|
4026
|
+
"c",
|
|
4027
|
+
"t",
|
|
4028
|
+
"T"
|
|
4029
|
+
];
|
|
4030
|
+
}
|
|
4031
|
+
function Go(t, e, n) {
|
|
4032
|
+
const r = O(t, n?.in), s = fn(r, n) - e;
|
|
4033
|
+
return r.setDate(r.getDate() - s * 7), O(r, n?.in);
|
|
4034
|
+
}
|
|
4035
|
+
class Ko extends T {
|
|
4036
|
+
priority = 100;
|
|
4037
|
+
parse(e, n, r) {
|
|
4038
|
+
switch (n) {
|
|
4039
|
+
case "w":
|
|
4040
|
+
return P(R.week, e);
|
|
4041
|
+
case "wo":
|
|
4042
|
+
return r.ordinalNumber(e, { unit: "week" });
|
|
4043
|
+
default:
|
|
4044
|
+
return D(n.length, e);
|
|
4045
|
+
}
|
|
4046
|
+
}
|
|
4047
|
+
validate(e, n) {
|
|
4048
|
+
return n >= 1 && n <= 53;
|
|
4049
|
+
}
|
|
4050
|
+
set(e, n, r, s) {
|
|
4051
|
+
return Q(Go(e, r, s), s);
|
|
4052
|
+
}
|
|
4053
|
+
incompatibleTokens = [
|
|
4054
|
+
"y",
|
|
4055
|
+
"R",
|
|
4056
|
+
"u",
|
|
4057
|
+
"q",
|
|
4058
|
+
"Q",
|
|
4059
|
+
"M",
|
|
4060
|
+
"L",
|
|
4061
|
+
"I",
|
|
4062
|
+
"d",
|
|
4063
|
+
"D",
|
|
4064
|
+
"i",
|
|
4065
|
+
"t",
|
|
4066
|
+
"T"
|
|
4067
|
+
];
|
|
4068
|
+
}
|
|
4069
|
+
function Zo(t, e, n) {
|
|
4070
|
+
const r = O(t, n?.in), s = ln(r, n) - e;
|
|
4071
|
+
return r.setDate(r.getDate() - s * 7), r;
|
|
4072
|
+
}
|
|
4073
|
+
class ei extends T {
|
|
4074
|
+
priority = 100;
|
|
4075
|
+
parse(e, n, r) {
|
|
4076
|
+
switch (n) {
|
|
4077
|
+
case "I":
|
|
4078
|
+
return P(R.week, e);
|
|
4079
|
+
case "Io":
|
|
4080
|
+
return r.ordinalNumber(e, { unit: "week" });
|
|
4081
|
+
default:
|
|
4082
|
+
return D(n.length, e);
|
|
4083
|
+
}
|
|
4084
|
+
}
|
|
4085
|
+
validate(e, n) {
|
|
4086
|
+
return n >= 1 && n <= 53;
|
|
4087
|
+
}
|
|
4088
|
+
set(e, n, r) {
|
|
4089
|
+
return re(Zo(e, r));
|
|
4090
|
+
}
|
|
4091
|
+
incompatibleTokens = [
|
|
4092
|
+
"y",
|
|
4093
|
+
"Y",
|
|
4094
|
+
"u",
|
|
4095
|
+
"q",
|
|
4096
|
+
"Q",
|
|
4097
|
+
"M",
|
|
4098
|
+
"L",
|
|
4099
|
+
"w",
|
|
4100
|
+
"d",
|
|
4101
|
+
"D",
|
|
4102
|
+
"e",
|
|
4103
|
+
"c",
|
|
4104
|
+
"t",
|
|
4105
|
+
"T"
|
|
4106
|
+
];
|
|
4107
|
+
}
|
|
4108
|
+
const ti = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ni = [
|
|
4109
|
+
31,
|
|
4110
|
+
29,
|
|
4111
|
+
31,
|
|
4112
|
+
30,
|
|
4113
|
+
31,
|
|
4114
|
+
30,
|
|
4115
|
+
31,
|
|
4116
|
+
31,
|
|
4117
|
+
30,
|
|
4118
|
+
31,
|
|
4119
|
+
30,
|
|
4120
|
+
31
|
|
4121
|
+
];
|
|
4122
|
+
class ri extends T {
|
|
4123
|
+
priority = 90;
|
|
4124
|
+
subPriority = 1;
|
|
4125
|
+
parse(e, n, r) {
|
|
4126
|
+
switch (n) {
|
|
4127
|
+
case "d":
|
|
4128
|
+
return P(R.date, e);
|
|
4129
|
+
case "do":
|
|
4130
|
+
return r.ordinalNumber(e, { unit: "date" });
|
|
4131
|
+
default:
|
|
4132
|
+
return D(n.length, e);
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
validate(e, n) {
|
|
4136
|
+
const r = e.getFullYear(), s = gn(r), o = e.getMonth();
|
|
4137
|
+
return s ? n >= 1 && n <= ni[o] : n >= 1 && n <= ti[o];
|
|
4138
|
+
}
|
|
4139
|
+
set(e, n, r) {
|
|
4140
|
+
return e.setDate(r), e.setHours(0, 0, 0, 0), e;
|
|
4141
|
+
}
|
|
4142
|
+
incompatibleTokens = [
|
|
4143
|
+
"Y",
|
|
4144
|
+
"R",
|
|
4145
|
+
"q",
|
|
4146
|
+
"Q",
|
|
4147
|
+
"w",
|
|
4148
|
+
"I",
|
|
4149
|
+
"D",
|
|
4150
|
+
"i",
|
|
4151
|
+
"e",
|
|
4152
|
+
"c",
|
|
4153
|
+
"t",
|
|
4154
|
+
"T"
|
|
4155
|
+
];
|
|
4156
|
+
}
|
|
4157
|
+
class si extends T {
|
|
4158
|
+
priority = 90;
|
|
4159
|
+
subpriority = 1;
|
|
4160
|
+
parse(e, n, r) {
|
|
4161
|
+
switch (n) {
|
|
4162
|
+
case "D":
|
|
4163
|
+
case "DD":
|
|
4164
|
+
return P(R.dayOfYear, e);
|
|
4165
|
+
case "Do":
|
|
4166
|
+
return r.ordinalNumber(e, { unit: "date" });
|
|
4167
|
+
default:
|
|
4168
|
+
return D(n.length, e);
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
validate(e, n) {
|
|
4172
|
+
const r = e.getFullYear();
|
|
4173
|
+
return gn(r) ? n >= 1 && n <= 366 : n >= 1 && n <= 365;
|
|
4174
|
+
}
|
|
4175
|
+
set(e, n, r) {
|
|
4176
|
+
return e.setMonth(0, r), e.setHours(0, 0, 0, 0), e;
|
|
4177
|
+
}
|
|
4178
|
+
incompatibleTokens = [
|
|
4179
|
+
"Y",
|
|
4180
|
+
"R",
|
|
4181
|
+
"q",
|
|
4182
|
+
"Q",
|
|
4183
|
+
"M",
|
|
4184
|
+
"L",
|
|
4185
|
+
"w",
|
|
4186
|
+
"I",
|
|
4187
|
+
"d",
|
|
4188
|
+
"E",
|
|
4189
|
+
"i",
|
|
4190
|
+
"e",
|
|
4191
|
+
"c",
|
|
4192
|
+
"t",
|
|
4193
|
+
"T"
|
|
4194
|
+
];
|
|
4195
|
+
}
|
|
4196
|
+
function Ge(t, e, n) {
|
|
4197
|
+
const r = ie(), s = n?.weekStartsOn ?? n?.locale?.options?.weekStartsOn ?? r.weekStartsOn ?? r.locale?.options?.weekStartsOn ?? 0, o = O(t, n?.in), i = o.getDay(), f = (e % 7 + 7) % 7, l = 7 - s, u = e < 0 || e > 6 ? e - (i + l) % 7 : (f + l) % 7 - (i + l) % 7;
|
|
4198
|
+
return sn(o, u, n);
|
|
4199
|
+
}
|
|
4200
|
+
class oi extends T {
|
|
4201
|
+
priority = 90;
|
|
4202
|
+
parse(e, n, r) {
|
|
4203
|
+
switch (n) {
|
|
4204
|
+
// Tue
|
|
4205
|
+
case "E":
|
|
4206
|
+
case "EE":
|
|
4207
|
+
case "EEE":
|
|
4208
|
+
return r.day(e, {
|
|
4209
|
+
width: "abbreviated",
|
|
4210
|
+
context: "formatting"
|
|
4211
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
4212
|
+
// T
|
|
4213
|
+
case "EEEEE":
|
|
4214
|
+
return r.day(e, {
|
|
4215
|
+
width: "narrow",
|
|
4216
|
+
context: "formatting"
|
|
4217
|
+
});
|
|
4218
|
+
// Tu
|
|
4219
|
+
case "EEEEEE":
|
|
4220
|
+
return r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
4221
|
+
// Tuesday
|
|
4222
|
+
case "EEEE":
|
|
4223
|
+
default:
|
|
4224
|
+
return r.day(e, { width: "wide", context: "formatting" }) || r.day(e, {
|
|
4225
|
+
width: "abbreviated",
|
|
4226
|
+
context: "formatting"
|
|
4227
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
4228
|
+
}
|
|
4229
|
+
}
|
|
4230
|
+
validate(e, n) {
|
|
4231
|
+
return n >= 0 && n <= 6;
|
|
4232
|
+
}
|
|
4233
|
+
set(e, n, r, s) {
|
|
4234
|
+
return e = Ge(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
4235
|
+
}
|
|
4236
|
+
incompatibleTokens = ["D", "i", "e", "c", "t", "T"];
|
|
4237
|
+
}
|
|
4238
|
+
class ii extends T {
|
|
4239
|
+
priority = 90;
|
|
4240
|
+
parse(e, n, r, s) {
|
|
4241
|
+
const o = (i) => {
|
|
4242
|
+
const a = Math.floor((i - 1) / 7) * 7;
|
|
4243
|
+
return (i + s.weekStartsOn + 6) % 7 + a;
|
|
4244
|
+
};
|
|
4245
|
+
switch (n) {
|
|
4246
|
+
// 3
|
|
4247
|
+
case "e":
|
|
4248
|
+
case "ee":
|
|
4249
|
+
return k(D(n.length, e), o);
|
|
4250
|
+
// 3rd
|
|
4251
|
+
case "eo":
|
|
4252
|
+
return k(
|
|
4253
|
+
r.ordinalNumber(e, {
|
|
4254
|
+
unit: "day"
|
|
4255
|
+
}),
|
|
4256
|
+
o
|
|
4257
|
+
);
|
|
4258
|
+
// Tue
|
|
4259
|
+
case "eee":
|
|
4260
|
+
return r.day(e, {
|
|
4261
|
+
width: "abbreviated",
|
|
4262
|
+
context: "formatting"
|
|
4263
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
4264
|
+
// T
|
|
4265
|
+
case "eeeee":
|
|
4266
|
+
return r.day(e, {
|
|
4267
|
+
width: "narrow",
|
|
4268
|
+
context: "formatting"
|
|
4269
|
+
});
|
|
4270
|
+
// Tu
|
|
4271
|
+
case "eeeeee":
|
|
4272
|
+
return r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
4273
|
+
// Tuesday
|
|
4274
|
+
case "eeee":
|
|
4275
|
+
default:
|
|
4276
|
+
return r.day(e, { width: "wide", context: "formatting" }) || r.day(e, {
|
|
4277
|
+
width: "abbreviated",
|
|
4278
|
+
context: "formatting"
|
|
4279
|
+
}) || r.day(e, { width: "short", context: "formatting" }) || r.day(e, { width: "narrow", context: "formatting" });
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
validate(e, n) {
|
|
4283
|
+
return n >= 0 && n <= 6;
|
|
4284
|
+
}
|
|
4285
|
+
set(e, n, r, s) {
|
|
4286
|
+
return e = Ge(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
4287
|
+
}
|
|
4288
|
+
incompatibleTokens = [
|
|
4289
|
+
"y",
|
|
4290
|
+
"R",
|
|
4291
|
+
"u",
|
|
4292
|
+
"q",
|
|
4293
|
+
"Q",
|
|
4294
|
+
"M",
|
|
4295
|
+
"L",
|
|
4296
|
+
"I",
|
|
4297
|
+
"d",
|
|
4298
|
+
"D",
|
|
4299
|
+
"E",
|
|
4300
|
+
"i",
|
|
4301
|
+
"c",
|
|
4302
|
+
"t",
|
|
4303
|
+
"T"
|
|
4304
|
+
];
|
|
4305
|
+
}
|
|
4306
|
+
class ai extends T {
|
|
4307
|
+
priority = 90;
|
|
4308
|
+
parse(e, n, r, s) {
|
|
4309
|
+
const o = (i) => {
|
|
4310
|
+
const a = Math.floor((i - 1) / 7) * 7;
|
|
4311
|
+
return (i + s.weekStartsOn + 6) % 7 + a;
|
|
4312
|
+
};
|
|
4313
|
+
switch (n) {
|
|
4314
|
+
// 3
|
|
4315
|
+
case "c":
|
|
4316
|
+
case "cc":
|
|
4317
|
+
return k(D(n.length, e), o);
|
|
4318
|
+
// 3rd
|
|
4319
|
+
case "co":
|
|
4320
|
+
return k(
|
|
4321
|
+
r.ordinalNumber(e, {
|
|
4322
|
+
unit: "day"
|
|
4323
|
+
}),
|
|
4324
|
+
o
|
|
4325
|
+
);
|
|
4326
|
+
// Tue
|
|
4327
|
+
case "ccc":
|
|
4328
|
+
return r.day(e, {
|
|
4329
|
+
width: "abbreviated",
|
|
4330
|
+
context: "standalone"
|
|
4331
|
+
}) || r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
4332
|
+
// T
|
|
4333
|
+
case "ccccc":
|
|
4334
|
+
return r.day(e, {
|
|
4335
|
+
width: "narrow",
|
|
4336
|
+
context: "standalone"
|
|
4337
|
+
});
|
|
4338
|
+
// Tu
|
|
4339
|
+
case "cccccc":
|
|
4340
|
+
return r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
4341
|
+
// Tuesday
|
|
4342
|
+
case "cccc":
|
|
4343
|
+
default:
|
|
4344
|
+
return r.day(e, { width: "wide", context: "standalone" }) || r.day(e, {
|
|
4345
|
+
width: "abbreviated",
|
|
4346
|
+
context: "standalone"
|
|
4347
|
+
}) || r.day(e, { width: "short", context: "standalone" }) || r.day(e, { width: "narrow", context: "standalone" });
|
|
4348
|
+
}
|
|
4349
|
+
}
|
|
4350
|
+
validate(e, n) {
|
|
4351
|
+
return n >= 0 && n <= 6;
|
|
4352
|
+
}
|
|
4353
|
+
set(e, n, r, s) {
|
|
4354
|
+
return e = Ge(e, r, s), e.setHours(0, 0, 0, 0), e;
|
|
4355
|
+
}
|
|
4356
|
+
incompatibleTokens = [
|
|
4357
|
+
"y",
|
|
4358
|
+
"R",
|
|
4359
|
+
"u",
|
|
4360
|
+
"q",
|
|
4361
|
+
"Q",
|
|
4362
|
+
"M",
|
|
4363
|
+
"L",
|
|
4364
|
+
"I",
|
|
4365
|
+
"d",
|
|
4366
|
+
"D",
|
|
4367
|
+
"E",
|
|
4368
|
+
"i",
|
|
4369
|
+
"e",
|
|
4370
|
+
"t",
|
|
4371
|
+
"T"
|
|
4372
|
+
];
|
|
4373
|
+
}
|
|
4374
|
+
function ci(t, e, n) {
|
|
4375
|
+
const r = O(t, n?.in), s = Fo(r, n), o = e - s;
|
|
4376
|
+
return sn(r, o, n);
|
|
4377
|
+
}
|
|
4378
|
+
class ui extends T {
|
|
4379
|
+
priority = 90;
|
|
4380
|
+
parse(e, n, r) {
|
|
4381
|
+
const s = (o) => o === 0 ? 7 : o;
|
|
4382
|
+
switch (n) {
|
|
4383
|
+
// 2
|
|
4384
|
+
case "i":
|
|
4385
|
+
case "ii":
|
|
4386
|
+
return D(n.length, e);
|
|
4387
|
+
// 2nd
|
|
4388
|
+
case "io":
|
|
4389
|
+
return r.ordinalNumber(e, { unit: "day" });
|
|
4390
|
+
// Tue
|
|
4391
|
+
case "iii":
|
|
4392
|
+
return k(
|
|
4393
|
+
r.day(e, {
|
|
4394
|
+
width: "abbreviated",
|
|
4395
|
+
context: "formatting"
|
|
4396
|
+
}) || r.day(e, {
|
|
4397
|
+
width: "short",
|
|
4398
|
+
context: "formatting"
|
|
4399
|
+
}) || r.day(e, {
|
|
4400
|
+
width: "narrow",
|
|
4401
|
+
context: "formatting"
|
|
4402
|
+
}),
|
|
4403
|
+
s
|
|
4404
|
+
);
|
|
4405
|
+
// T
|
|
4406
|
+
case "iiiii":
|
|
4407
|
+
return k(
|
|
4408
|
+
r.day(e, {
|
|
4409
|
+
width: "narrow",
|
|
4410
|
+
context: "formatting"
|
|
4411
|
+
}),
|
|
4412
|
+
s
|
|
4413
|
+
);
|
|
4414
|
+
// Tu
|
|
4415
|
+
case "iiiiii":
|
|
4416
|
+
return k(
|
|
4417
|
+
r.day(e, {
|
|
4418
|
+
width: "short",
|
|
4419
|
+
context: "formatting"
|
|
4420
|
+
}) || r.day(e, {
|
|
4421
|
+
width: "narrow",
|
|
4422
|
+
context: "formatting"
|
|
4423
|
+
}),
|
|
4424
|
+
s
|
|
4425
|
+
);
|
|
4426
|
+
// Tuesday
|
|
4427
|
+
case "iiii":
|
|
4428
|
+
default:
|
|
4429
|
+
return k(
|
|
4430
|
+
r.day(e, {
|
|
4431
|
+
width: "wide",
|
|
4432
|
+
context: "formatting"
|
|
4433
|
+
}) || r.day(e, {
|
|
4434
|
+
width: "abbreviated",
|
|
4435
|
+
context: "formatting"
|
|
4436
|
+
}) || r.day(e, {
|
|
4437
|
+
width: "short",
|
|
4438
|
+
context: "formatting"
|
|
4439
|
+
}) || r.day(e, {
|
|
4440
|
+
width: "narrow",
|
|
4441
|
+
context: "formatting"
|
|
4442
|
+
}),
|
|
4443
|
+
s
|
|
4444
|
+
);
|
|
4445
|
+
}
|
|
4446
|
+
}
|
|
4447
|
+
validate(e, n) {
|
|
4448
|
+
return n >= 1 && n <= 7;
|
|
4449
|
+
}
|
|
4450
|
+
set(e, n, r) {
|
|
4451
|
+
return e = ci(e, r), e.setHours(0, 0, 0, 0), e;
|
|
4452
|
+
}
|
|
4453
|
+
incompatibleTokens = [
|
|
4454
|
+
"y",
|
|
4455
|
+
"Y",
|
|
4456
|
+
"u",
|
|
4457
|
+
"q",
|
|
4458
|
+
"Q",
|
|
4459
|
+
"M",
|
|
4460
|
+
"L",
|
|
4461
|
+
"w",
|
|
4462
|
+
"d",
|
|
4463
|
+
"D",
|
|
4464
|
+
"E",
|
|
4465
|
+
"e",
|
|
4466
|
+
"c",
|
|
4467
|
+
"t",
|
|
4468
|
+
"T"
|
|
4469
|
+
];
|
|
4470
|
+
}
|
|
4471
|
+
class li extends T {
|
|
4472
|
+
priority = 80;
|
|
4473
|
+
parse(e, n, r) {
|
|
4474
|
+
switch (n) {
|
|
4475
|
+
case "a":
|
|
4476
|
+
case "aa":
|
|
4477
|
+
case "aaa":
|
|
4478
|
+
return r.dayPeriod(e, {
|
|
4479
|
+
width: "abbreviated",
|
|
4480
|
+
context: "formatting"
|
|
4481
|
+
}) || r.dayPeriod(e, {
|
|
4482
|
+
width: "narrow",
|
|
4483
|
+
context: "formatting"
|
|
4484
|
+
});
|
|
4485
|
+
case "aaaaa":
|
|
4486
|
+
return r.dayPeriod(e, {
|
|
4487
|
+
width: "narrow",
|
|
4488
|
+
context: "formatting"
|
|
4489
|
+
});
|
|
4490
|
+
case "aaaa":
|
|
4491
|
+
default:
|
|
4492
|
+
return r.dayPeriod(e, {
|
|
4493
|
+
width: "wide",
|
|
4494
|
+
context: "formatting"
|
|
4495
|
+
}) || r.dayPeriod(e, {
|
|
4496
|
+
width: "abbreviated",
|
|
4497
|
+
context: "formatting"
|
|
4498
|
+
}) || r.dayPeriod(e, {
|
|
4499
|
+
width: "narrow",
|
|
4500
|
+
context: "formatting"
|
|
4501
|
+
});
|
|
4502
|
+
}
|
|
4503
|
+
}
|
|
4504
|
+
set(e, n, r) {
|
|
4505
|
+
return e.setHours(Je(r), 0, 0, 0), e;
|
|
4506
|
+
}
|
|
4507
|
+
incompatibleTokens = ["b", "B", "H", "k", "t", "T"];
|
|
4508
|
+
}
|
|
4509
|
+
class fi extends T {
|
|
4510
|
+
priority = 80;
|
|
4511
|
+
parse(e, n, r) {
|
|
4512
|
+
switch (n) {
|
|
4513
|
+
case "b":
|
|
4514
|
+
case "bb":
|
|
4515
|
+
case "bbb":
|
|
4516
|
+
return r.dayPeriod(e, {
|
|
4517
|
+
width: "abbreviated",
|
|
4518
|
+
context: "formatting"
|
|
4519
|
+
}) || r.dayPeriod(e, {
|
|
4520
|
+
width: "narrow",
|
|
4521
|
+
context: "formatting"
|
|
4522
|
+
});
|
|
4523
|
+
case "bbbbb":
|
|
4524
|
+
return r.dayPeriod(e, {
|
|
4525
|
+
width: "narrow",
|
|
4526
|
+
context: "formatting"
|
|
4527
|
+
});
|
|
4528
|
+
case "bbbb":
|
|
4529
|
+
default:
|
|
4530
|
+
return r.dayPeriod(e, {
|
|
4531
|
+
width: "wide",
|
|
4532
|
+
context: "formatting"
|
|
4533
|
+
}) || r.dayPeriod(e, {
|
|
4534
|
+
width: "abbreviated",
|
|
4535
|
+
context: "formatting"
|
|
4536
|
+
}) || r.dayPeriod(e, {
|
|
4537
|
+
width: "narrow",
|
|
4538
|
+
context: "formatting"
|
|
4539
|
+
});
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
set(e, n, r) {
|
|
4543
|
+
return e.setHours(Je(r), 0, 0, 0), e;
|
|
4544
|
+
}
|
|
4545
|
+
incompatibleTokens = ["a", "B", "H", "k", "t", "T"];
|
|
4546
|
+
}
|
|
4547
|
+
class di extends T {
|
|
4548
|
+
priority = 80;
|
|
4549
|
+
parse(e, n, r) {
|
|
4550
|
+
switch (n) {
|
|
4551
|
+
case "B":
|
|
4552
|
+
case "BB":
|
|
4553
|
+
case "BBB":
|
|
4554
|
+
return r.dayPeriod(e, {
|
|
4555
|
+
width: "abbreviated",
|
|
4556
|
+
context: "formatting"
|
|
4557
|
+
}) || r.dayPeriod(e, {
|
|
4558
|
+
width: "narrow",
|
|
4559
|
+
context: "formatting"
|
|
4560
|
+
});
|
|
4561
|
+
case "BBBBB":
|
|
4562
|
+
return r.dayPeriod(e, {
|
|
4563
|
+
width: "narrow",
|
|
4564
|
+
context: "formatting"
|
|
4565
|
+
});
|
|
4566
|
+
case "BBBB":
|
|
4567
|
+
default:
|
|
4568
|
+
return r.dayPeriod(e, {
|
|
4569
|
+
width: "wide",
|
|
4570
|
+
context: "formatting"
|
|
4571
|
+
}) || r.dayPeriod(e, {
|
|
4572
|
+
width: "abbreviated",
|
|
4573
|
+
context: "formatting"
|
|
4574
|
+
}) || r.dayPeriod(e, {
|
|
4575
|
+
width: "narrow",
|
|
4576
|
+
context: "formatting"
|
|
4577
|
+
});
|
|
4578
|
+
}
|
|
4579
|
+
}
|
|
4580
|
+
set(e, n, r) {
|
|
4581
|
+
return e.setHours(Je(r), 0, 0, 0), e;
|
|
4582
|
+
}
|
|
4583
|
+
incompatibleTokens = ["a", "b", "t", "T"];
|
|
4584
|
+
}
|
|
4585
|
+
class hi extends T {
|
|
4586
|
+
priority = 70;
|
|
4587
|
+
parse(e, n, r) {
|
|
4588
|
+
switch (n) {
|
|
4589
|
+
case "h":
|
|
4590
|
+
return P(R.hour12h, e);
|
|
4591
|
+
case "ho":
|
|
4592
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
4593
|
+
default:
|
|
4594
|
+
return D(n.length, e);
|
|
4595
|
+
}
|
|
4596
|
+
}
|
|
4597
|
+
validate(e, n) {
|
|
4598
|
+
return n >= 1 && n <= 12;
|
|
4599
|
+
}
|
|
4600
|
+
set(e, n, r) {
|
|
4601
|
+
const s = e.getHours() >= 12;
|
|
4602
|
+
return s && r < 12 ? e.setHours(r + 12, 0, 0, 0) : !s && r === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(r, 0, 0, 0), e;
|
|
4603
|
+
}
|
|
4604
|
+
incompatibleTokens = ["H", "K", "k", "t", "T"];
|
|
4605
|
+
}
|
|
4606
|
+
class mi extends T {
|
|
4607
|
+
priority = 70;
|
|
4608
|
+
parse(e, n, r) {
|
|
4609
|
+
switch (n) {
|
|
4610
|
+
case "H":
|
|
4611
|
+
return P(R.hour23h, e);
|
|
4612
|
+
case "Ho":
|
|
4613
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
4614
|
+
default:
|
|
4615
|
+
return D(n.length, e);
|
|
4616
|
+
}
|
|
4617
|
+
}
|
|
4618
|
+
validate(e, n) {
|
|
4619
|
+
return n >= 0 && n <= 23;
|
|
4620
|
+
}
|
|
4621
|
+
set(e, n, r) {
|
|
4622
|
+
return e.setHours(r, 0, 0, 0), e;
|
|
4623
|
+
}
|
|
4624
|
+
incompatibleTokens = ["a", "b", "h", "K", "k", "t", "T"];
|
|
4625
|
+
}
|
|
4626
|
+
class pi extends T {
|
|
4627
|
+
priority = 70;
|
|
4628
|
+
parse(e, n, r) {
|
|
4629
|
+
switch (n) {
|
|
4630
|
+
case "K":
|
|
4631
|
+
return P(R.hour11h, e);
|
|
4632
|
+
case "Ko":
|
|
4633
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
4634
|
+
default:
|
|
4635
|
+
return D(n.length, e);
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4638
|
+
validate(e, n) {
|
|
4639
|
+
return n >= 0 && n <= 11;
|
|
4640
|
+
}
|
|
4641
|
+
set(e, n, r) {
|
|
4642
|
+
return e.getHours() >= 12 && r < 12 ? e.setHours(r + 12, 0, 0, 0) : e.setHours(r, 0, 0, 0), e;
|
|
4643
|
+
}
|
|
4644
|
+
incompatibleTokens = ["h", "H", "k", "t", "T"];
|
|
4645
|
+
}
|
|
4646
|
+
class wi extends T {
|
|
4647
|
+
priority = 70;
|
|
4648
|
+
parse(e, n, r) {
|
|
4649
|
+
switch (n) {
|
|
4650
|
+
case "k":
|
|
4651
|
+
return P(R.hour24h, e);
|
|
4652
|
+
case "ko":
|
|
4653
|
+
return r.ordinalNumber(e, { unit: "hour" });
|
|
4654
|
+
default:
|
|
4655
|
+
return D(n.length, e);
|
|
4656
|
+
}
|
|
4657
|
+
}
|
|
4658
|
+
validate(e, n) {
|
|
4659
|
+
return n >= 1 && n <= 24;
|
|
4660
|
+
}
|
|
4661
|
+
set(e, n, r) {
|
|
4662
|
+
const s = r <= 24 ? r % 24 : r;
|
|
4663
|
+
return e.setHours(s, 0, 0, 0), e;
|
|
4664
|
+
}
|
|
4665
|
+
incompatibleTokens = ["a", "b", "h", "H", "K", "t", "T"];
|
|
4666
|
+
}
|
|
4667
|
+
class yi extends T {
|
|
4668
|
+
priority = 60;
|
|
4669
|
+
parse(e, n, r) {
|
|
4670
|
+
switch (n) {
|
|
4671
|
+
case "m":
|
|
4672
|
+
return P(R.minute, e);
|
|
4673
|
+
case "mo":
|
|
4674
|
+
return r.ordinalNumber(e, { unit: "minute" });
|
|
4675
|
+
default:
|
|
4676
|
+
return D(n.length, e);
|
|
4677
|
+
}
|
|
4678
|
+
}
|
|
4679
|
+
validate(e, n) {
|
|
4680
|
+
return n >= 0 && n <= 59;
|
|
4681
|
+
}
|
|
4682
|
+
set(e, n, r) {
|
|
4683
|
+
return e.setMinutes(r, 0, 0), e;
|
|
4684
|
+
}
|
|
4685
|
+
incompatibleTokens = ["t", "T"];
|
|
4686
|
+
}
|
|
4687
|
+
class gi extends T {
|
|
4688
|
+
priority = 50;
|
|
4689
|
+
parse(e, n, r) {
|
|
4690
|
+
switch (n) {
|
|
4691
|
+
case "s":
|
|
4692
|
+
return P(R.second, e);
|
|
4693
|
+
case "so":
|
|
4694
|
+
return r.ordinalNumber(e, { unit: "second" });
|
|
4695
|
+
default:
|
|
4696
|
+
return D(n.length, e);
|
|
4697
|
+
}
|
|
4698
|
+
}
|
|
4699
|
+
validate(e, n) {
|
|
4700
|
+
return n >= 0 && n <= 59;
|
|
4701
|
+
}
|
|
4702
|
+
set(e, n, r) {
|
|
4703
|
+
return e.setSeconds(r, 0), e;
|
|
4704
|
+
}
|
|
4705
|
+
incompatibleTokens = ["t", "T"];
|
|
4706
|
+
}
|
|
4707
|
+
class bi extends T {
|
|
4708
|
+
priority = 30;
|
|
4709
|
+
parse(e, n) {
|
|
4710
|
+
const r = (s) => Math.trunc(s * Math.pow(10, -n.length + 3));
|
|
4711
|
+
return k(D(n.length, e), r);
|
|
4712
|
+
}
|
|
4713
|
+
set(e, n, r) {
|
|
4714
|
+
return e.setMilliseconds(r), e;
|
|
4715
|
+
}
|
|
4716
|
+
incompatibleTokens = ["t", "T"];
|
|
4717
|
+
}
|
|
4718
|
+
class xi extends T {
|
|
4719
|
+
priority = 10;
|
|
4720
|
+
parse(e, n) {
|
|
4721
|
+
switch (n) {
|
|
4722
|
+
case "X":
|
|
4723
|
+
return Y(
|
|
4724
|
+
v.basicOptionalMinutes,
|
|
4725
|
+
e
|
|
4726
|
+
);
|
|
4727
|
+
case "XX":
|
|
4728
|
+
return Y(v.basic, e);
|
|
4729
|
+
case "XXXX":
|
|
4730
|
+
return Y(
|
|
4731
|
+
v.basicOptionalSeconds,
|
|
4732
|
+
e
|
|
4733
|
+
);
|
|
4734
|
+
case "XXXXX":
|
|
4735
|
+
return Y(
|
|
4736
|
+
v.extendedOptionalSeconds,
|
|
4737
|
+
e
|
|
4738
|
+
);
|
|
4739
|
+
case "XXX":
|
|
4740
|
+
default:
|
|
4741
|
+
return Y(v.extended, e);
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
set(e, n, r) {
|
|
4745
|
+
return n.timestampIsSet ? e : N(
|
|
4746
|
+
e,
|
|
4747
|
+
e.getTime() - Pe(e) - r
|
|
4748
|
+
);
|
|
4749
|
+
}
|
|
4750
|
+
incompatibleTokens = ["t", "T", "x"];
|
|
4751
|
+
}
|
|
4752
|
+
class Oi extends T {
|
|
4753
|
+
priority = 10;
|
|
4754
|
+
parse(e, n) {
|
|
4755
|
+
switch (n) {
|
|
4756
|
+
case "x":
|
|
4757
|
+
return Y(
|
|
4758
|
+
v.basicOptionalMinutes,
|
|
4759
|
+
e
|
|
4760
|
+
);
|
|
4761
|
+
case "xx":
|
|
4762
|
+
return Y(v.basic, e);
|
|
4763
|
+
case "xxxx":
|
|
4764
|
+
return Y(
|
|
4765
|
+
v.basicOptionalSeconds,
|
|
4766
|
+
e
|
|
4767
|
+
);
|
|
4768
|
+
case "xxxxx":
|
|
4769
|
+
return Y(
|
|
4770
|
+
v.extendedOptionalSeconds,
|
|
4771
|
+
e
|
|
4772
|
+
);
|
|
4773
|
+
case "xxx":
|
|
4774
|
+
default:
|
|
4775
|
+
return Y(v.extended, e);
|
|
4776
|
+
}
|
|
4777
|
+
}
|
|
4778
|
+
set(e, n, r) {
|
|
4779
|
+
return n.timestampIsSet ? e : N(
|
|
4780
|
+
e,
|
|
4781
|
+
e.getTime() - Pe(e) - r
|
|
4782
|
+
);
|
|
4783
|
+
}
|
|
4784
|
+
incompatibleTokens = ["t", "T", "X"];
|
|
4785
|
+
}
|
|
4786
|
+
class Ti extends T {
|
|
4787
|
+
priority = 40;
|
|
4788
|
+
parse(e) {
|
|
4789
|
+
return wn(e);
|
|
4790
|
+
}
|
|
4791
|
+
set(e, n, r) {
|
|
4792
|
+
return [N(e, r * 1e3), { timestampIsSet: !0 }];
|
|
4793
|
+
}
|
|
4794
|
+
incompatibleTokens = "*";
|
|
4795
|
+
}
|
|
4796
|
+
class Ei extends T {
|
|
4797
|
+
priority = 20;
|
|
4798
|
+
parse(e) {
|
|
4799
|
+
return wn(e);
|
|
4800
|
+
}
|
|
4801
|
+
set(e, n, r) {
|
|
4802
|
+
return [N(e, r), { timestampIsSet: !0 }];
|
|
4803
|
+
}
|
|
4804
|
+
incompatibleTokens = "*";
|
|
4805
|
+
}
|
|
4806
|
+
const Pi = {
|
|
4807
|
+
G: new Yo(),
|
|
4808
|
+
y: new Wo(),
|
|
4809
|
+
Y: new jo(),
|
|
4810
|
+
R: new Uo(),
|
|
4811
|
+
u: new zo(),
|
|
4812
|
+
Q: new Qo(),
|
|
4813
|
+
q: new Xo(),
|
|
4814
|
+
M: new Vo(),
|
|
4815
|
+
L: new Jo(),
|
|
4816
|
+
w: new Ko(),
|
|
4817
|
+
I: new ei(),
|
|
4818
|
+
d: new ri(),
|
|
4819
|
+
D: new si(),
|
|
4820
|
+
E: new oi(),
|
|
4821
|
+
e: new ii(),
|
|
4822
|
+
c: new ai(),
|
|
4823
|
+
i: new ui(),
|
|
4824
|
+
a: new li(),
|
|
4825
|
+
b: new fi(),
|
|
4826
|
+
B: new di(),
|
|
4827
|
+
h: new hi(),
|
|
4828
|
+
H: new mi(),
|
|
4829
|
+
K: new pi(),
|
|
4830
|
+
k: new wi(),
|
|
4831
|
+
m: new yi(),
|
|
4832
|
+
s: new gi(),
|
|
4833
|
+
S: new bi(),
|
|
4834
|
+
X: new xi(),
|
|
4835
|
+
x: new Oi(),
|
|
4836
|
+
t: new Ti(),
|
|
4837
|
+
T: new Ei()
|
|
4838
|
+
}, Di = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Mi = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Ri = /^'([^]*?)'?$/, ki = /''/g, Ai = /\S/, _i = /[a-zA-Z]/;
|
|
4839
|
+
function Ni(t, e, n, r) {
|
|
4840
|
+
const s = () => N(n, NaN), o = So(), i = o.locale ?? un, a = o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, f = o.weekStartsOn ?? o.locale?.options?.weekStartsOn ?? 0;
|
|
4841
|
+
if (!e)
|
|
4842
|
+
return t ? s() : O(n, r?.in);
|
|
4843
|
+
const l = {
|
|
4844
|
+
firstWeekContainsDate: a,
|
|
4845
|
+
weekStartsOn: f,
|
|
4846
|
+
locale: i
|
|
4847
|
+
}, u = [new vo(r?.in, n)], m = e.match(Mi).map((h) => {
|
|
4848
|
+
const y = h[0];
|
|
4849
|
+
if (y in ve) {
|
|
4850
|
+
const E = ve[y];
|
|
4851
|
+
return E(h, i.formatLong);
|
|
4852
|
+
}
|
|
4853
|
+
return h;
|
|
4854
|
+
}).join("").match(Di), p = [];
|
|
4855
|
+
for (let h of m) {
|
|
4856
|
+
mn(h) && Ye(h, e, t), hn(h) && Ye(h, e, t);
|
|
4857
|
+
const y = h[0], E = Pi[y];
|
|
4858
|
+
if (E) {
|
|
4859
|
+
const { incompatibleTokens: M } = E;
|
|
4860
|
+
if (Array.isArray(M)) {
|
|
4861
|
+
const S = p.find(
|
|
4862
|
+
(H) => M.includes(H.token) || H.token === y
|
|
4863
|
+
);
|
|
4864
|
+
if (S)
|
|
4865
|
+
throw new RangeError(
|
|
4866
|
+
`The format string mustn't contain \`${S.fullToken}\` and \`${h}\` at the same time`
|
|
4867
|
+
);
|
|
4868
|
+
} else if (E.incompatibleTokens === "*" && p.length > 0)
|
|
4869
|
+
throw new RangeError(
|
|
4870
|
+
`The format string mustn't contain \`${h}\` and any other token at the same time`
|
|
4871
|
+
);
|
|
4872
|
+
p.push({ token: y, fullToken: h });
|
|
4873
|
+
const _ = E.run(
|
|
4874
|
+
t,
|
|
4875
|
+
h,
|
|
4876
|
+
i.match,
|
|
4877
|
+
l
|
|
4878
|
+
);
|
|
4879
|
+
if (!_)
|
|
4880
|
+
return s();
|
|
4881
|
+
u.push(_.setter), t = _.rest;
|
|
4882
|
+
} else {
|
|
4883
|
+
if (y.match(_i))
|
|
4884
|
+
throw new RangeError(
|
|
4885
|
+
"Format string contains an unescaped latin alphabet character `" + y + "`"
|
|
4886
|
+
);
|
|
4887
|
+
if (h === "''" ? h = "'" : y === "'" && (h = Ci(h)), t.indexOf(h) === 0)
|
|
4888
|
+
t = t.slice(h.length);
|
|
4889
|
+
else
|
|
4890
|
+
return s();
|
|
4891
|
+
}
|
|
4892
|
+
}
|
|
4893
|
+
if (t.length > 0 && Ai.test(t))
|
|
4894
|
+
return s();
|
|
4895
|
+
const b = u.map((h) => h.priority).sort((h, y) => y - h).filter((h, y, E) => E.indexOf(h) === y).map(
|
|
4896
|
+
(h) => u.filter((y) => y.priority === h).sort((y, E) => E.subPriority - y.subPriority)
|
|
4897
|
+
).map((h) => h[0]);
|
|
4898
|
+
let d = O(n, r?.in);
|
|
4899
|
+
if (isNaN(+d)) return s();
|
|
4900
|
+
const w = {};
|
|
4901
|
+
for (const h of b) {
|
|
4902
|
+
if (!h.validate(d, l))
|
|
4903
|
+
return s();
|
|
4904
|
+
const y = h.set(d, w, l);
|
|
4905
|
+
Array.isArray(y) ? (d = y[0], Object.assign(w, y[1])) : d = y;
|
|
4906
|
+
}
|
|
4907
|
+
return d;
|
|
4908
|
+
}
|
|
4909
|
+
function Ci(t) {
|
|
4910
|
+
return t.match(Ri)[1].replace(ki, "'");
|
|
4911
|
+
}
|
|
4912
|
+
const Si = (t) => new Date(t.getTime() + 324e5), Fi = (t, e = "yyyy-MM-dd") => _o(t, e), Li = (t) => Co(t), $i = (t, e) => Ni(t, e ?? "yyyy-MM-dd", /* @__PURE__ */ new Date()), qi = (t, e) => $o(t, e) ? t : e, Hi = (t, e) => Lo(t, e) ? t : e, Bi = (t, e) => {
|
|
4913
|
+
const n = /* @__PURE__ */ new Date(), r = n >= t, o = { ...{
|
|
4914
|
+
direction: r ? "전" : "후",
|
|
4915
|
+
seconds: r ? "방금" : "잠시",
|
|
4916
|
+
minutes: "분",
|
|
4917
|
+
hours: "시간",
|
|
4918
|
+
days: "일",
|
|
4919
|
+
weeks: "주",
|
|
4920
|
+
months: "개월",
|
|
4921
|
+
years: "년"
|
|
4922
|
+
}, ...e }, i = [
|
|
4923
|
+
{ diffFunc: Ns, limit: 60, label: o.minutes },
|
|
4924
|
+
{ diffFunc: As, limit: 24, label: o.hours },
|
|
4925
|
+
{ diffFunc: cn, limit: 7, label: o.days },
|
|
4926
|
+
{ diffFunc: $s, limit: 5, label: o.weeks },
|
|
4927
|
+
{ diffFunc: Ls, limit: 12, label: o.months },
|
|
4928
|
+
{ diffFunc: qs, limit: 1 / 0, label: o.years }
|
|
4929
|
+
];
|
|
4930
|
+
for (const a of i) {
|
|
4931
|
+
const f = Math.abs(a.diffFunc(n, t));
|
|
4932
|
+
if (f >= 1 && f < a.limit) return `${f}${a.label} ${o.direction}`;
|
|
4933
|
+
}
|
|
4934
|
+
return r ? `${o.seconds} ${o.direction}` : `${o.seconds} ${o.direction}`;
|
|
4935
|
+
}, ca = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4936
|
+
__proto__: null,
|
|
4937
|
+
afterDate: Hi,
|
|
4938
|
+
beforeDate: qi,
|
|
4939
|
+
formatDate: Fi,
|
|
4940
|
+
parseDate: $i,
|
|
4941
|
+
relativeTime: Bi,
|
|
4942
|
+
toISO: Li,
|
|
4943
|
+
utcToKst: Si
|
|
4944
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
152
4945
|
export {
|
|
153
|
-
|
|
154
|
-
|
|
4946
|
+
Ii as FormatData,
|
|
4947
|
+
ca as dateUtils,
|
|
4948
|
+
ws as filterParams,
|
|
4949
|
+
ia as handleError,
|
|
4950
|
+
aa as userAgent,
|
|
4951
|
+
vi as validate
|
|
155
4952
|
};
|