@tricoteuses/assemblee 2.5.31 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +16 -6
- package/README.md +1 -19
- package/lib/amendements-CXmsqoof.js +170 -0
- package/lib/amendements-CZHXlq07.js +4198 -0
- package/lib/cleaners/acteurs.d.ts +2 -1
- package/lib/cleaners/amendements.d.ts +2 -1
- package/lib/cleaners/debats.d.ts +2 -1
- package/lib/cleaners/documents.d.ts +2 -1
- package/lib/cleaners/dossiers_legislatifs.d.ts +2 -1
- package/lib/cleaners/organes.d.ts +2 -1
- package/lib/cleaners/questions.d.ts +2 -1
- package/lib/cleaners/reunions.d.ts +2 -1
- package/lib/cleaners/scrutins.d.ts +2 -1
- package/lib/cleaners/xml.d.ts +5 -5
- package/lib/cleaners.js +186 -179
- package/lib/datasets.d.ts +5 -7
- package/lib/dossiers_legislatifs.d.ts +5 -2
- package/lib/file_systems.d.ts +9 -4
- package/lib/index.d.ts +24 -19
- package/lib/index.js +390 -1234
- package/lib/inserters.d.ts +466 -9
- package/lib/loaders.d.ts +13 -12
- package/lib/loaders.js +1900 -538
- package/lib/organes.d.ts +1 -1
- package/lib/parsers/compte_rendu.d.ts +2 -1
- package/lib/parsers/compte_rendu_commission.d.ts +1 -1
- package/lib/parsers/recherche_amendements.d.ts +2 -2
- package/lib/parsers/textes_lois.d.ts +1 -1
- package/lib/parsers.js +2109 -2075
- package/lib/questions-DTO3nK5V.js +2777 -0
- package/lib/questions-DXAzvI1T.js +230 -0
- package/lib/registries.d.ts +112 -0
- package/lib/schemas/clean/acteurs_et_organes.d.ts +2377 -0
- package/lib/schemas/clean/agendas.d.ts +830 -0
- package/lib/schemas/clean/amendements.d.ts +2305 -0
- package/lib/schemas/clean/debats.d.ts +300 -0
- package/lib/schemas/clean/dossiers_legislatifs.d.ts +1365 -0
- package/lib/schemas/clean/questions.d.ts +625 -0
- package/lib/schemas/clean/scrutins.d.ts +1137 -0
- package/lib/schemas/enriched/acteurs_et_organes.d.ts +112 -0
- package/lib/schemas/enriched/agendas.d.ts +501 -0
- package/lib/schemas/enriched/amendements.d.ts +1230 -0
- package/lib/schemas/enriched/debats.d.ts +308 -0
- package/lib/schemas/enriched/dossiers_legislatifs.d.ts +1131 -0
- package/lib/schemas/enriched/questions.d.ts +589 -0
- package/lib/schemas/enriched/scrutins.d.ts +1094 -0
- package/lib/schemas/raw/acteurs_et_organes.d.ts +5870 -0
- package/lib/schemas/raw/agendas.d.ts +1734 -0
- package/lib/schemas/raw/amendements.d.ts +4758 -0
- package/lib/schemas/raw/debats.d.ts +410 -0
- package/lib/schemas/raw/dossiers_legislatifs.d.ts +3252 -0
- package/lib/schemas/raw/questions.d.ts +983 -0
- package/lib/schemas/raw/scrutins.d.ts +2763 -0
- package/lib/scripts/retrieve_deputes_photos.d.ts +58 -4
- package/lib/scripts/retrieve_documents.d.ts +100 -12
- package/lib/scripts/retrieve_open_data.d.ts +75 -4
- package/lib/scripts/retrieve_videos.d.ts +1 -1
- package/lib/scripts/shared/cli_helpers.d.ts +103 -77
- package/lib/scripts/shared/photos.d.ts +106 -0
- package/lib/scripts/shared/utils.d.ts +4 -1
- package/lib/urls.d.ts +2 -2
- package/package.json +16 -12
- package/lib/amendements-40Z7OJLT.js +0 -682
- package/lib/amendements-J6Sx61n8.js +0 -154
- package/lib/datasets-Cb3wpfRH.js +0 -3580
- package/lib/parse-Ccs6wcUg.js +0 -2512
- package/lib/raw_types/acteurs_et_organes.d.ts +0 -464
- package/lib/raw_types/agendas.d.ts +0 -265
- package/lib/raw_types/amendements.d.ts +0 -365
- package/lib/raw_types/debats.d.ts +0 -140
- package/lib/raw_types/dossiers_legislatifs.d.ts +0 -567
- package/lib/raw_types/questions.d.ts +0 -115
- package/lib/raw_types/scrutins.d.ts +0 -187
- package/lib/schemas/acteurs_et_organes.json +0 -1167
- package/lib/schemas/agendas.json +0 -1757
- package/lib/schemas/amendements.json +0 -2087
- package/lib/schemas/compte_rendu_commission/CompteRenduCommission.json +0 -63
- package/lib/schemas/debats.json +0 -847
- package/lib/schemas/dossiers_legislatifs.json +0 -3884
- package/lib/schemas/legislatures.json +0 -17
- package/lib/schemas/questions.json +0 -711
- package/lib/schemas/scrutins.json +0 -701
- package/lib/scripts/copy-schemas.d.ts +0 -1
- package/lib/scripts/generate-json-schemas.d.ts +0 -1
- package/lib/shared_types/acteurs_et_organes.d.ts +0 -149
- package/lib/shared_types/dossiers_legislatifs.d.ts +0 -222
- package/lib/types/acteurs_et_organes.d.ts +0 -598
- package/lib/types/agendas.d.ts +0 -442
- package/lib/types/amendements.d.ts +0 -615
- package/lib/types/debats.d.ts +0 -186
- package/lib/types/dossiers_legislatifs.d.ts +0 -826
- package/lib/types/questions.d.ts +0 -203
- package/lib/types/scrutins.d.ts +0 -254
- /package/lib/{types/legislatures.d.ts → legislatures.d.ts} +0 -0
package/lib/parse-Ccs6wcUg.js
DELETED
|
@@ -1,2512 +0,0 @@
|
|
|
1
|
-
var ne = Object.defineProperty;
|
|
2
|
-
var re = (r, a, e) => a in r ? ne(r, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[a] = e;
|
|
3
|
-
var i = (r, a, e) => re(r, typeof a != "symbol" ? a + "" : a, e);
|
|
4
|
-
const ae = {
|
|
5
|
-
lessThanXSeconds: {
|
|
6
|
-
one: "less than a second",
|
|
7
|
-
other: "less than {{count}} seconds"
|
|
8
|
-
},
|
|
9
|
-
xSeconds: {
|
|
10
|
-
one: "1 second",
|
|
11
|
-
other: "{{count}} seconds"
|
|
12
|
-
},
|
|
13
|
-
halfAMinute: "half a minute",
|
|
14
|
-
lessThanXMinutes: {
|
|
15
|
-
one: "less than a minute",
|
|
16
|
-
other: "less than {{count}} minutes"
|
|
17
|
-
},
|
|
18
|
-
xMinutes: {
|
|
19
|
-
one: "1 minute",
|
|
20
|
-
other: "{{count}} minutes"
|
|
21
|
-
},
|
|
22
|
-
aboutXHours: {
|
|
23
|
-
one: "about 1 hour",
|
|
24
|
-
other: "about {{count}} hours"
|
|
25
|
-
},
|
|
26
|
-
xHours: {
|
|
27
|
-
one: "1 hour",
|
|
28
|
-
other: "{{count}} hours"
|
|
29
|
-
},
|
|
30
|
-
xDays: {
|
|
31
|
-
one: "1 day",
|
|
32
|
-
other: "{{count}} days"
|
|
33
|
-
},
|
|
34
|
-
aboutXWeeks: {
|
|
35
|
-
one: "about 1 week",
|
|
36
|
-
other: "about {{count}} weeks"
|
|
37
|
-
},
|
|
38
|
-
xWeeks: {
|
|
39
|
-
one: "1 week",
|
|
40
|
-
other: "{{count}} weeks"
|
|
41
|
-
},
|
|
42
|
-
aboutXMonths: {
|
|
43
|
-
one: "about 1 month",
|
|
44
|
-
other: "about {{count}} months"
|
|
45
|
-
},
|
|
46
|
-
xMonths: {
|
|
47
|
-
one: "1 month",
|
|
48
|
-
other: "{{count}} months"
|
|
49
|
-
},
|
|
50
|
-
aboutXYears: {
|
|
51
|
-
one: "about 1 year",
|
|
52
|
-
other: "about {{count}} years"
|
|
53
|
-
},
|
|
54
|
-
xYears: {
|
|
55
|
-
one: "1 year",
|
|
56
|
-
other: "{{count}} years"
|
|
57
|
-
},
|
|
58
|
-
overXYears: {
|
|
59
|
-
one: "over 1 year",
|
|
60
|
-
other: "over {{count}} years"
|
|
61
|
-
},
|
|
62
|
-
almostXYears: {
|
|
63
|
-
one: "almost 1 year",
|
|
64
|
-
other: "almost {{count}} years"
|
|
65
|
-
}
|
|
66
|
-
}, se = (r, a, e) => {
|
|
67
|
-
let t;
|
|
68
|
-
const n = ae[r];
|
|
69
|
-
return typeof n == "string" ? t = n : a === 1 ? t = n.one : t = n.other.replace("{{count}}", a.toString()), e?.addSuffix ? e.comparison && e.comparison > 0 ? "in " + t : t + " ago" : t;
|
|
70
|
-
};
|
|
71
|
-
function Y(r) {
|
|
72
|
-
return (a = {}) => {
|
|
73
|
-
const e = a.width ? String(a.width) : r.defaultWidth;
|
|
74
|
-
return r.formats[e] || r.formats[r.defaultWidth];
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
const ie = {
|
|
78
|
-
full: "EEEE, MMMM do, y",
|
|
79
|
-
long: "MMMM do, y",
|
|
80
|
-
medium: "MMM d, y",
|
|
81
|
-
short: "MM/dd/yyyy"
|
|
82
|
-
}, oe = {
|
|
83
|
-
full: "h:mm:ss a zzzz",
|
|
84
|
-
long: "h:mm:ss a z",
|
|
85
|
-
medium: "h:mm:ss a",
|
|
86
|
-
short: "h:mm a"
|
|
87
|
-
}, ue = {
|
|
88
|
-
full: "{{date}} 'at' {{time}}",
|
|
89
|
-
long: "{{date}} 'at' {{time}}",
|
|
90
|
-
medium: "{{date}}, {{time}}",
|
|
91
|
-
short: "{{date}}, {{time}}"
|
|
92
|
-
}, ce = {
|
|
93
|
-
date: Y({
|
|
94
|
-
formats: ie,
|
|
95
|
-
defaultWidth: "full"
|
|
96
|
-
}),
|
|
97
|
-
time: Y({
|
|
98
|
-
formats: oe,
|
|
99
|
-
defaultWidth: "full"
|
|
100
|
-
}),
|
|
101
|
-
dateTime: Y({
|
|
102
|
-
formats: ue,
|
|
103
|
-
defaultWidth: "full"
|
|
104
|
-
})
|
|
105
|
-
}, de = {
|
|
106
|
-
lastWeek: "'last' eeee 'at' p",
|
|
107
|
-
yesterday: "'yesterday at' p",
|
|
108
|
-
today: "'today at' p",
|
|
109
|
-
tomorrow: "'tomorrow at' p",
|
|
110
|
-
nextWeek: "eeee 'at' p",
|
|
111
|
-
other: "P"
|
|
112
|
-
}, le = (r, a, e, t) => de[r];
|
|
113
|
-
function x(r) {
|
|
114
|
-
return (a, e) => {
|
|
115
|
-
const t = e?.context ? String(e.context) : "standalone";
|
|
116
|
-
let n;
|
|
117
|
-
if (t === "formatting" && r.formattingValues) {
|
|
118
|
-
const o = r.defaultFormattingWidth || r.defaultWidth, d = e?.width ? String(e.width) : o;
|
|
119
|
-
n = r.formattingValues[d] || r.formattingValues[o];
|
|
120
|
-
} else {
|
|
121
|
-
const o = r.defaultWidth, d = e?.width ? String(e.width) : r.defaultWidth;
|
|
122
|
-
n = r.values[d] || r.values[o];
|
|
123
|
-
}
|
|
124
|
-
const s = r.argumentCallback ? r.argumentCallback(a) : a;
|
|
125
|
-
return n[s];
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
const me = {
|
|
129
|
-
narrow: ["B", "A"],
|
|
130
|
-
abbreviated: ["BC", "AD"],
|
|
131
|
-
wide: ["Before Christ", "Anno Domini"]
|
|
132
|
-
}, he = {
|
|
133
|
-
narrow: ["1", "2", "3", "4"],
|
|
134
|
-
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
135
|
-
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
136
|
-
}, fe = {
|
|
137
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
138
|
-
abbreviated: [
|
|
139
|
-
"Jan",
|
|
140
|
-
"Feb",
|
|
141
|
-
"Mar",
|
|
142
|
-
"Apr",
|
|
143
|
-
"May",
|
|
144
|
-
"Jun",
|
|
145
|
-
"Jul",
|
|
146
|
-
"Aug",
|
|
147
|
-
"Sep",
|
|
148
|
-
"Oct",
|
|
149
|
-
"Nov",
|
|
150
|
-
"Dec"
|
|
151
|
-
],
|
|
152
|
-
wide: [
|
|
153
|
-
"January",
|
|
154
|
-
"February",
|
|
155
|
-
"March",
|
|
156
|
-
"April",
|
|
157
|
-
"May",
|
|
158
|
-
"June",
|
|
159
|
-
"July",
|
|
160
|
-
"August",
|
|
161
|
-
"September",
|
|
162
|
-
"October",
|
|
163
|
-
"November",
|
|
164
|
-
"December"
|
|
165
|
-
]
|
|
166
|
-
}, we = {
|
|
167
|
-
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
168
|
-
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
169
|
-
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
170
|
-
wide: [
|
|
171
|
-
"Sunday",
|
|
172
|
-
"Monday",
|
|
173
|
-
"Tuesday",
|
|
174
|
-
"Wednesday",
|
|
175
|
-
"Thursday",
|
|
176
|
-
"Friday",
|
|
177
|
-
"Saturday"
|
|
178
|
-
]
|
|
179
|
-
}, ye = {
|
|
180
|
-
narrow: {
|
|
181
|
-
am: "a",
|
|
182
|
-
pm: "p",
|
|
183
|
-
midnight: "mi",
|
|
184
|
-
noon: "n",
|
|
185
|
-
morning: "morning",
|
|
186
|
-
afternoon: "afternoon",
|
|
187
|
-
evening: "evening",
|
|
188
|
-
night: "night"
|
|
189
|
-
},
|
|
190
|
-
abbreviated: {
|
|
191
|
-
am: "AM",
|
|
192
|
-
pm: "PM",
|
|
193
|
-
midnight: "midnight",
|
|
194
|
-
noon: "noon",
|
|
195
|
-
morning: "morning",
|
|
196
|
-
afternoon: "afternoon",
|
|
197
|
-
evening: "evening",
|
|
198
|
-
night: "night"
|
|
199
|
-
},
|
|
200
|
-
wide: {
|
|
201
|
-
am: "a.m.",
|
|
202
|
-
pm: "p.m.",
|
|
203
|
-
midnight: "midnight",
|
|
204
|
-
noon: "noon",
|
|
205
|
-
morning: "morning",
|
|
206
|
-
afternoon: "afternoon",
|
|
207
|
-
evening: "evening",
|
|
208
|
-
night: "night"
|
|
209
|
-
}
|
|
210
|
-
}, be = {
|
|
211
|
-
narrow: {
|
|
212
|
-
am: "a",
|
|
213
|
-
pm: "p",
|
|
214
|
-
midnight: "mi",
|
|
215
|
-
noon: "n",
|
|
216
|
-
morning: "in the morning",
|
|
217
|
-
afternoon: "in the afternoon",
|
|
218
|
-
evening: "in the evening",
|
|
219
|
-
night: "at night"
|
|
220
|
-
},
|
|
221
|
-
abbreviated: {
|
|
222
|
-
am: "AM",
|
|
223
|
-
pm: "PM",
|
|
224
|
-
midnight: "midnight",
|
|
225
|
-
noon: "noon",
|
|
226
|
-
morning: "in the morning",
|
|
227
|
-
afternoon: "in the afternoon",
|
|
228
|
-
evening: "in the evening",
|
|
229
|
-
night: "at night"
|
|
230
|
-
},
|
|
231
|
-
wide: {
|
|
232
|
-
am: "a.m.",
|
|
233
|
-
pm: "p.m.",
|
|
234
|
-
midnight: "midnight",
|
|
235
|
-
noon: "noon",
|
|
236
|
-
morning: "in the morning",
|
|
237
|
-
afternoon: "in the afternoon",
|
|
238
|
-
evening: "in the evening",
|
|
239
|
-
night: "at night"
|
|
240
|
-
}
|
|
241
|
-
}, pe = (r, a) => {
|
|
242
|
-
const e = Number(r), t = e % 100;
|
|
243
|
-
if (t > 20 || t < 10)
|
|
244
|
-
switch (t % 10) {
|
|
245
|
-
case 1:
|
|
246
|
-
return e + "st";
|
|
247
|
-
case 2:
|
|
248
|
-
return e + "nd";
|
|
249
|
-
case 3:
|
|
250
|
-
return e + "rd";
|
|
251
|
-
}
|
|
252
|
-
return e + "th";
|
|
253
|
-
}, ge = {
|
|
254
|
-
ordinalNumber: pe,
|
|
255
|
-
era: x({
|
|
256
|
-
values: me,
|
|
257
|
-
defaultWidth: "wide"
|
|
258
|
-
}),
|
|
259
|
-
quarter: x({
|
|
260
|
-
values: he,
|
|
261
|
-
defaultWidth: "wide",
|
|
262
|
-
argumentCallback: (r) => r - 1
|
|
263
|
-
}),
|
|
264
|
-
month: x({
|
|
265
|
-
values: fe,
|
|
266
|
-
defaultWidth: "wide"
|
|
267
|
-
}),
|
|
268
|
-
day: x({
|
|
269
|
-
values: we,
|
|
270
|
-
defaultWidth: "wide"
|
|
271
|
-
}),
|
|
272
|
-
dayPeriod: x({
|
|
273
|
-
values: ye,
|
|
274
|
-
defaultWidth: "wide",
|
|
275
|
-
formattingValues: be,
|
|
276
|
-
defaultFormattingWidth: "wide"
|
|
277
|
-
})
|
|
278
|
-
};
|
|
279
|
-
function M(r) {
|
|
280
|
-
return (a, e = {}) => {
|
|
281
|
-
const t = e.width, n = t && r.matchPatterns[t] || r.matchPatterns[r.defaultMatchWidth], s = a.match(n);
|
|
282
|
-
if (!s)
|
|
283
|
-
return null;
|
|
284
|
-
const o = s[0], d = t && r.parsePatterns[t] || r.parsePatterns[r.defaultParseWidth], b = Array.isArray(d) ? xe(d, (_) => _.test(o)) : (
|
|
285
|
-
// [TODO] -- I challenge you to fix the type
|
|
286
|
-
Pe(d, (_) => _.test(o))
|
|
287
|
-
);
|
|
288
|
-
let p;
|
|
289
|
-
p = r.valueCallback ? r.valueCallback(b) : b, p = e.valueCallback ? (
|
|
290
|
-
// [TODO] -- I challenge you to fix the type
|
|
291
|
-
e.valueCallback(p)
|
|
292
|
-
) : p;
|
|
293
|
-
const D = a.slice(o.length);
|
|
294
|
-
return { value: p, rest: D };
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
function Pe(r, a) {
|
|
298
|
-
for (const e in r)
|
|
299
|
-
if (Object.prototype.hasOwnProperty.call(r, e) && a(r[e]))
|
|
300
|
-
return e;
|
|
301
|
-
}
|
|
302
|
-
function xe(r, a) {
|
|
303
|
-
for (let e = 0; e < r.length; e++)
|
|
304
|
-
if (a(r[e]))
|
|
305
|
-
return e;
|
|
306
|
-
}
|
|
307
|
-
function J(r) {
|
|
308
|
-
return (a, e = {}) => {
|
|
309
|
-
const t = a.match(r.matchPattern);
|
|
310
|
-
if (!t) return null;
|
|
311
|
-
const n = t[0], s = a.match(r.parsePattern);
|
|
312
|
-
if (!s) return null;
|
|
313
|
-
let o = r.valueCallback ? r.valueCallback(s[0]) : s[0];
|
|
314
|
-
o = e.valueCallback ? e.valueCallback(o) : o;
|
|
315
|
-
const d = a.slice(n.length);
|
|
316
|
-
return { value: o, rest: d };
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
const Me = /^(\d+)(th|st|nd|rd)?/i, ke = /\d+/i, ve = {
|
|
320
|
-
narrow: /^(b|a)/i,
|
|
321
|
-
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
322
|
-
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
323
|
-
}, Te = {
|
|
324
|
-
any: [/^b/i, /^(a|c)/i]
|
|
325
|
-
}, De = {
|
|
326
|
-
narrow: /^[1234]/i,
|
|
327
|
-
abbreviated: /^q[1234]/i,
|
|
328
|
-
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
329
|
-
}, We = {
|
|
330
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
331
|
-
}, Ye = {
|
|
332
|
-
narrow: /^[jfmasond]/i,
|
|
333
|
-
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
334
|
-
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
335
|
-
}, Oe = {
|
|
336
|
-
narrow: [
|
|
337
|
-
/^j/i,
|
|
338
|
-
/^f/i,
|
|
339
|
-
/^m/i,
|
|
340
|
-
/^a/i,
|
|
341
|
-
/^m/i,
|
|
342
|
-
/^j/i,
|
|
343
|
-
/^j/i,
|
|
344
|
-
/^a/i,
|
|
345
|
-
/^s/i,
|
|
346
|
-
/^o/i,
|
|
347
|
-
/^n/i,
|
|
348
|
-
/^d/i
|
|
349
|
-
],
|
|
350
|
-
any: [
|
|
351
|
-
/^ja/i,
|
|
352
|
-
/^f/i,
|
|
353
|
-
/^mar/i,
|
|
354
|
-
/^ap/i,
|
|
355
|
-
/^may/i,
|
|
356
|
-
/^jun/i,
|
|
357
|
-
/^jul/i,
|
|
358
|
-
/^au/i,
|
|
359
|
-
/^s/i,
|
|
360
|
-
/^o/i,
|
|
361
|
-
/^n/i,
|
|
362
|
-
/^d/i
|
|
363
|
-
]
|
|
364
|
-
}, _e = {
|
|
365
|
-
narrow: /^[smtwf]/i,
|
|
366
|
-
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
367
|
-
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
368
|
-
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
369
|
-
}, Ce = {
|
|
370
|
-
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
371
|
-
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
372
|
-
}, He = {
|
|
373
|
-
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
374
|
-
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
375
|
-
}, Ee = {
|
|
376
|
-
any: {
|
|
377
|
-
am: /^a/i,
|
|
378
|
-
pm: /^p/i,
|
|
379
|
-
midnight: /^mi/i,
|
|
380
|
-
noon: /^no/i,
|
|
381
|
-
morning: /morning/i,
|
|
382
|
-
afternoon: /afternoon/i,
|
|
383
|
-
evening: /evening/i,
|
|
384
|
-
night: /night/i
|
|
385
|
-
}
|
|
386
|
-
}, qe = {
|
|
387
|
-
ordinalNumber: J({
|
|
388
|
-
matchPattern: Me,
|
|
389
|
-
parsePattern: ke,
|
|
390
|
-
valueCallback: (r) => parseInt(r, 10)
|
|
391
|
-
}),
|
|
392
|
-
era: M({
|
|
393
|
-
matchPatterns: ve,
|
|
394
|
-
defaultMatchWidth: "wide",
|
|
395
|
-
parsePatterns: Te,
|
|
396
|
-
defaultParseWidth: "any"
|
|
397
|
-
}),
|
|
398
|
-
quarter: M({
|
|
399
|
-
matchPatterns: De,
|
|
400
|
-
defaultMatchWidth: "wide",
|
|
401
|
-
parsePatterns: We,
|
|
402
|
-
defaultParseWidth: "any",
|
|
403
|
-
valueCallback: (r) => r + 1
|
|
404
|
-
}),
|
|
405
|
-
month: M({
|
|
406
|
-
matchPatterns: Ye,
|
|
407
|
-
defaultMatchWidth: "wide",
|
|
408
|
-
parsePatterns: Oe,
|
|
409
|
-
defaultParseWidth: "any"
|
|
410
|
-
}),
|
|
411
|
-
day: M({
|
|
412
|
-
matchPatterns: _e,
|
|
413
|
-
defaultMatchWidth: "wide",
|
|
414
|
-
parsePatterns: Ce,
|
|
415
|
-
defaultParseWidth: "any"
|
|
416
|
-
}),
|
|
417
|
-
dayPeriod: M({
|
|
418
|
-
matchPatterns: He,
|
|
419
|
-
defaultMatchWidth: "any",
|
|
420
|
-
parsePatterns: Ee,
|
|
421
|
-
defaultParseWidth: "any"
|
|
422
|
-
})
|
|
423
|
-
}, Ne = {
|
|
424
|
-
code: "en-US",
|
|
425
|
-
formatDistance: se,
|
|
426
|
-
formatLong: ce,
|
|
427
|
-
formatRelative: le,
|
|
428
|
-
localize: ge,
|
|
429
|
-
match: qe,
|
|
430
|
-
options: {
|
|
431
|
-
weekStartsOn: 0,
|
|
432
|
-
firstWeekContainsDate: 1
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
let Fe = {};
|
|
436
|
-
function C() {
|
|
437
|
-
return Fe;
|
|
438
|
-
}
|
|
439
|
-
const z = 6048e5, Dn = 864e5, Ie = 6e4, je = 36e5, Le = 1e3, $ = Symbol.for("constructDateFrom");
|
|
440
|
-
function y(r, a) {
|
|
441
|
-
return typeof r == "function" ? r(a) : r && typeof r == "object" && $ in r ? r[$](a) : r instanceof Date ? new r.constructor(a) : new Date(a);
|
|
442
|
-
}
|
|
443
|
-
function g(r, a) {
|
|
444
|
-
return y(a || r, r);
|
|
445
|
-
}
|
|
446
|
-
function V(r) {
|
|
447
|
-
const a = g(r), e = new Date(
|
|
448
|
-
Date.UTC(
|
|
449
|
-
a.getFullYear(),
|
|
450
|
-
a.getMonth(),
|
|
451
|
-
a.getDate(),
|
|
452
|
-
a.getHours(),
|
|
453
|
-
a.getMinutes(),
|
|
454
|
-
a.getSeconds(),
|
|
455
|
-
a.getMilliseconds()
|
|
456
|
-
)
|
|
457
|
-
);
|
|
458
|
-
return e.setUTCFullYear(a.getFullYear()), +r - +e;
|
|
459
|
-
}
|
|
460
|
-
function T(r, a) {
|
|
461
|
-
const e = C(), t = a?.weekStartsOn ?? a?.locale?.options?.weekStartsOn ?? e.weekStartsOn ?? e.locale?.options?.weekStartsOn ?? 0, n = g(r, a?.in), s = n.getDay(), o = (s < t ? 7 : 0) + s - t;
|
|
462
|
-
return n.setDate(n.getDate() - o), n.setHours(0, 0, 0, 0), n;
|
|
463
|
-
}
|
|
464
|
-
function O(r, a) {
|
|
465
|
-
return T(r, { ...a, weekStartsOn: 1 });
|
|
466
|
-
}
|
|
467
|
-
function Re(r, a) {
|
|
468
|
-
const e = g(r, a?.in), t = e.getFullYear(), n = y(e, 0);
|
|
469
|
-
n.setFullYear(t + 1, 0, 4), n.setHours(0, 0, 0, 0);
|
|
470
|
-
const s = O(n), o = y(e, 0);
|
|
471
|
-
o.setFullYear(t, 0, 4), o.setHours(0, 0, 0, 0);
|
|
472
|
-
const d = O(o);
|
|
473
|
-
return e.getTime() >= s.getTime() ? t + 1 : e.getTime() >= d.getTime() ? t : t - 1;
|
|
474
|
-
}
|
|
475
|
-
function $e(r, a) {
|
|
476
|
-
const e = Re(r, a), t = y(r, 0);
|
|
477
|
-
return t.setFullYear(e, 0, 4), t.setHours(0, 0, 0, 0), O(t);
|
|
478
|
-
}
|
|
479
|
-
function Qe(r, a) {
|
|
480
|
-
const e = g(r, a?.in), t = +O(e) - +$e(e);
|
|
481
|
-
return Math.round(t / z) + 1;
|
|
482
|
-
}
|
|
483
|
-
function B(r, a) {
|
|
484
|
-
const e = g(r, a?.in), t = e.getFullYear(), n = C(), s = a?.firstWeekContainsDate ?? a?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, o = y(a?.in || r, 0);
|
|
485
|
-
o.setFullYear(t + 1, 0, s), o.setHours(0, 0, 0, 0);
|
|
486
|
-
const d = T(o, a), b = y(a?.in || r, 0);
|
|
487
|
-
b.setFullYear(t, 0, s), b.setHours(0, 0, 0, 0);
|
|
488
|
-
const p = T(b, a);
|
|
489
|
-
return +e >= +d ? t + 1 : +e >= +p ? t : t - 1;
|
|
490
|
-
}
|
|
491
|
-
function Ae(r, a) {
|
|
492
|
-
const e = C(), t = a?.firstWeekContainsDate ?? a?.locale?.options?.firstWeekContainsDate ?? e.firstWeekContainsDate ?? e.locale?.options?.firstWeekContainsDate ?? 1, n = B(r, a), s = y(a?.in || r, 0);
|
|
493
|
-
return s.setFullYear(n, 0, t), s.setHours(0, 0, 0, 0), T(s, a);
|
|
494
|
-
}
|
|
495
|
-
function Xe(r, a) {
|
|
496
|
-
const e = g(r, a?.in), t = +T(e, a) - +Ae(e, a);
|
|
497
|
-
return Math.round(t / z) + 1;
|
|
498
|
-
}
|
|
499
|
-
function Wn(r, a) {
|
|
500
|
-
const e = r < 0 ? "-" : "", t = Math.abs(r).toString().padStart(a, "0");
|
|
501
|
-
return e + t;
|
|
502
|
-
}
|
|
503
|
-
const Q = (r, a) => {
|
|
504
|
-
switch (r) {
|
|
505
|
-
case "P":
|
|
506
|
-
return a.date({ width: "short" });
|
|
507
|
-
case "PP":
|
|
508
|
-
return a.date({ width: "medium" });
|
|
509
|
-
case "PPP":
|
|
510
|
-
return a.date({ width: "long" });
|
|
511
|
-
case "PPPP":
|
|
512
|
-
default:
|
|
513
|
-
return a.date({ width: "full" });
|
|
514
|
-
}
|
|
515
|
-
}, G = (r, a) => {
|
|
516
|
-
switch (r) {
|
|
517
|
-
case "p":
|
|
518
|
-
return a.time({ width: "short" });
|
|
519
|
-
case "pp":
|
|
520
|
-
return a.time({ width: "medium" });
|
|
521
|
-
case "ppp":
|
|
522
|
-
return a.time({ width: "long" });
|
|
523
|
-
case "pppp":
|
|
524
|
-
default:
|
|
525
|
-
return a.time({ width: "full" });
|
|
526
|
-
}
|
|
527
|
-
}, Je = (r, a) => {
|
|
528
|
-
const e = r.match(/(P+)(p+)?/) || [], t = e[1], n = e[2];
|
|
529
|
-
if (!n)
|
|
530
|
-
return Q(r, a);
|
|
531
|
-
let s;
|
|
532
|
-
switch (t) {
|
|
533
|
-
case "P":
|
|
534
|
-
s = a.dateTime({ width: "short" });
|
|
535
|
-
break;
|
|
536
|
-
case "PP":
|
|
537
|
-
s = a.dateTime({ width: "medium" });
|
|
538
|
-
break;
|
|
539
|
-
case "PPP":
|
|
540
|
-
s = a.dateTime({ width: "long" });
|
|
541
|
-
break;
|
|
542
|
-
case "PPPP":
|
|
543
|
-
default:
|
|
544
|
-
s = a.dateTime({ width: "full" });
|
|
545
|
-
break;
|
|
546
|
-
}
|
|
547
|
-
return s.replace("{{date}}", Q(t, a)).replace("{{time}}", G(n, a));
|
|
548
|
-
}, A = {
|
|
549
|
-
p: G,
|
|
550
|
-
P: Je
|
|
551
|
-
}, ze = /^D+$/, Ve = /^Y+$/, Be = ["D", "DD", "YY", "YYYY"];
|
|
552
|
-
function Ge(r) {
|
|
553
|
-
return ze.test(r);
|
|
554
|
-
}
|
|
555
|
-
function Ze(r) {
|
|
556
|
-
return Ve.test(r);
|
|
557
|
-
}
|
|
558
|
-
function X(r, a, e) {
|
|
559
|
-
const t = Ke(r, a, e);
|
|
560
|
-
if (console.warn(t), Be.includes(r)) throw new RangeError(t);
|
|
561
|
-
}
|
|
562
|
-
function Ke(r, a, e) {
|
|
563
|
-
const t = r[0] === "Y" ? "years" : "days of the month";
|
|
564
|
-
return `Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${a}\`) for formatting ${t} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
565
|
-
}
|
|
566
|
-
const Ue = {
|
|
567
|
-
lessThanXSeconds: {
|
|
568
|
-
one: "moins d’une seconde",
|
|
569
|
-
other: "moins de {{count}} secondes"
|
|
570
|
-
},
|
|
571
|
-
xSeconds: {
|
|
572
|
-
one: "1 seconde",
|
|
573
|
-
other: "{{count}} secondes"
|
|
574
|
-
},
|
|
575
|
-
halfAMinute: "30 secondes",
|
|
576
|
-
lessThanXMinutes: {
|
|
577
|
-
one: "moins d’une minute",
|
|
578
|
-
other: "moins de {{count}} minutes"
|
|
579
|
-
},
|
|
580
|
-
xMinutes: {
|
|
581
|
-
one: "1 minute",
|
|
582
|
-
other: "{{count}} minutes"
|
|
583
|
-
},
|
|
584
|
-
aboutXHours: {
|
|
585
|
-
one: "environ 1 heure",
|
|
586
|
-
other: "environ {{count}} heures"
|
|
587
|
-
},
|
|
588
|
-
xHours: {
|
|
589
|
-
one: "1 heure",
|
|
590
|
-
other: "{{count}} heures"
|
|
591
|
-
},
|
|
592
|
-
xDays: {
|
|
593
|
-
one: "1 jour",
|
|
594
|
-
other: "{{count}} jours"
|
|
595
|
-
},
|
|
596
|
-
aboutXWeeks: {
|
|
597
|
-
one: "environ 1 semaine",
|
|
598
|
-
other: "environ {{count}} semaines"
|
|
599
|
-
},
|
|
600
|
-
xWeeks: {
|
|
601
|
-
one: "1 semaine",
|
|
602
|
-
other: "{{count}} semaines"
|
|
603
|
-
},
|
|
604
|
-
aboutXMonths: {
|
|
605
|
-
one: "environ 1 mois",
|
|
606
|
-
other: "environ {{count}} mois"
|
|
607
|
-
},
|
|
608
|
-
xMonths: {
|
|
609
|
-
one: "1 mois",
|
|
610
|
-
other: "{{count}} mois"
|
|
611
|
-
},
|
|
612
|
-
aboutXYears: {
|
|
613
|
-
one: "environ 1 an",
|
|
614
|
-
other: "environ {{count}} ans"
|
|
615
|
-
},
|
|
616
|
-
xYears: {
|
|
617
|
-
one: "1 an",
|
|
618
|
-
other: "{{count}} ans"
|
|
619
|
-
},
|
|
620
|
-
overXYears: {
|
|
621
|
-
one: "plus d’un an",
|
|
622
|
-
other: "plus de {{count}} ans"
|
|
623
|
-
},
|
|
624
|
-
almostXYears: {
|
|
625
|
-
one: "presqu’un an",
|
|
626
|
-
other: "presque {{count}} ans"
|
|
627
|
-
}
|
|
628
|
-
}, Se = (r, a, e) => {
|
|
629
|
-
let t;
|
|
630
|
-
const n = Ue[r];
|
|
631
|
-
return typeof n == "string" ? t = n : a === 1 ? t = n.one : t = n.other.replace("{{count}}", String(a)), e?.addSuffix ? e.comparison && e.comparison > 0 ? "dans " + t : "il y a " + t : t;
|
|
632
|
-
}, et = {
|
|
633
|
-
full: "EEEE d MMMM y",
|
|
634
|
-
long: "d MMMM y",
|
|
635
|
-
medium: "d MMM y",
|
|
636
|
-
short: "dd/MM/y"
|
|
637
|
-
}, tt = {
|
|
638
|
-
full: "HH:mm:ss zzzz",
|
|
639
|
-
long: "HH:mm:ss z",
|
|
640
|
-
medium: "HH:mm:ss",
|
|
641
|
-
short: "HH:mm"
|
|
642
|
-
}, nt = {
|
|
643
|
-
full: "{{date}} 'à' {{time}}",
|
|
644
|
-
long: "{{date}} 'à' {{time}}",
|
|
645
|
-
medium: "{{date}}, {{time}}",
|
|
646
|
-
short: "{{date}}, {{time}}"
|
|
647
|
-
}, rt = {
|
|
648
|
-
date: Y({
|
|
649
|
-
formats: et,
|
|
650
|
-
defaultWidth: "full"
|
|
651
|
-
}),
|
|
652
|
-
time: Y({
|
|
653
|
-
formats: tt,
|
|
654
|
-
defaultWidth: "full"
|
|
655
|
-
}),
|
|
656
|
-
dateTime: Y({
|
|
657
|
-
formats: nt,
|
|
658
|
-
defaultWidth: "full"
|
|
659
|
-
})
|
|
660
|
-
}, at = {
|
|
661
|
-
lastWeek: "eeee 'dernier à' p",
|
|
662
|
-
yesterday: "'hier à' p",
|
|
663
|
-
today: "'aujourd’hui à' p",
|
|
664
|
-
tomorrow: "'demain à' p'",
|
|
665
|
-
nextWeek: "eeee 'prochain à' p",
|
|
666
|
-
other: "P"
|
|
667
|
-
}, st = (r, a, e, t) => at[r], it = {
|
|
668
|
-
narrow: ["av. J.-C", "ap. J.-C"],
|
|
669
|
-
abbreviated: ["av. J.-C", "ap. J.-C"],
|
|
670
|
-
wide: ["avant Jésus-Christ", "après Jésus-Christ"]
|
|
671
|
-
}, ot = {
|
|
672
|
-
narrow: ["T1", "T2", "T3", "T4"],
|
|
673
|
-
abbreviated: ["1er trim.", "2ème trim.", "3ème trim.", "4ème trim."],
|
|
674
|
-
wide: ["1er trimestre", "2ème trimestre", "3ème trimestre", "4ème trimestre"]
|
|
675
|
-
}, ut = {
|
|
676
|
-
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
677
|
-
abbreviated: [
|
|
678
|
-
"janv.",
|
|
679
|
-
"févr.",
|
|
680
|
-
"mars",
|
|
681
|
-
"avr.",
|
|
682
|
-
"mai",
|
|
683
|
-
"juin",
|
|
684
|
-
"juil.",
|
|
685
|
-
"août",
|
|
686
|
-
"sept.",
|
|
687
|
-
"oct.",
|
|
688
|
-
"nov.",
|
|
689
|
-
"déc."
|
|
690
|
-
],
|
|
691
|
-
wide: [
|
|
692
|
-
"janvier",
|
|
693
|
-
"février",
|
|
694
|
-
"mars",
|
|
695
|
-
"avril",
|
|
696
|
-
"mai",
|
|
697
|
-
"juin",
|
|
698
|
-
"juillet",
|
|
699
|
-
"août",
|
|
700
|
-
"septembre",
|
|
701
|
-
"octobre",
|
|
702
|
-
"novembre",
|
|
703
|
-
"décembre"
|
|
704
|
-
]
|
|
705
|
-
}, ct = {
|
|
706
|
-
narrow: ["D", "L", "M", "M", "J", "V", "S"],
|
|
707
|
-
short: ["di", "lu", "ma", "me", "je", "ve", "sa"],
|
|
708
|
-
abbreviated: ["dim.", "lun.", "mar.", "mer.", "jeu.", "ven.", "sam."],
|
|
709
|
-
wide: [
|
|
710
|
-
"dimanche",
|
|
711
|
-
"lundi",
|
|
712
|
-
"mardi",
|
|
713
|
-
"mercredi",
|
|
714
|
-
"jeudi",
|
|
715
|
-
"vendredi",
|
|
716
|
-
"samedi"
|
|
717
|
-
]
|
|
718
|
-
}, dt = {
|
|
719
|
-
narrow: {
|
|
720
|
-
am: "AM",
|
|
721
|
-
pm: "PM",
|
|
722
|
-
midnight: "minuit",
|
|
723
|
-
noon: "midi",
|
|
724
|
-
morning: "mat.",
|
|
725
|
-
afternoon: "ap.m.",
|
|
726
|
-
evening: "soir",
|
|
727
|
-
night: "mat."
|
|
728
|
-
},
|
|
729
|
-
abbreviated: {
|
|
730
|
-
am: "AM",
|
|
731
|
-
pm: "PM",
|
|
732
|
-
midnight: "minuit",
|
|
733
|
-
noon: "midi",
|
|
734
|
-
morning: "matin",
|
|
735
|
-
afternoon: "après-midi",
|
|
736
|
-
evening: "soir",
|
|
737
|
-
night: "matin"
|
|
738
|
-
},
|
|
739
|
-
wide: {
|
|
740
|
-
am: "AM",
|
|
741
|
-
pm: "PM",
|
|
742
|
-
midnight: "minuit",
|
|
743
|
-
noon: "midi",
|
|
744
|
-
morning: "du matin",
|
|
745
|
-
afternoon: "de l’après-midi",
|
|
746
|
-
evening: "du soir",
|
|
747
|
-
night: "du matin"
|
|
748
|
-
}
|
|
749
|
-
}, lt = (r, a) => {
|
|
750
|
-
const e = Number(r), t = a?.unit;
|
|
751
|
-
if (e === 0) return "0";
|
|
752
|
-
const n = ["year", "week", "hour", "minute", "second"];
|
|
753
|
-
let s;
|
|
754
|
-
return e === 1 ? s = t && n.includes(t) ? "ère" : "er" : s = "ème", e + s;
|
|
755
|
-
}, mt = ["MMM", "MMMM"], ht = {
|
|
756
|
-
preprocessor: (r, a) => r.getDate() === 1 || !a.some(
|
|
757
|
-
(t) => t.isToken && mt.includes(t.value)
|
|
758
|
-
) ? a : a.map(
|
|
759
|
-
(t) => t.isToken && t.value === "do" ? { isToken: !0, value: "d" } : t
|
|
760
|
-
),
|
|
761
|
-
ordinalNumber: lt,
|
|
762
|
-
era: x({
|
|
763
|
-
values: it,
|
|
764
|
-
defaultWidth: "wide"
|
|
765
|
-
}),
|
|
766
|
-
quarter: x({
|
|
767
|
-
values: ot,
|
|
768
|
-
defaultWidth: "wide",
|
|
769
|
-
argumentCallback: (r) => r - 1
|
|
770
|
-
}),
|
|
771
|
-
month: x({
|
|
772
|
-
values: ut,
|
|
773
|
-
defaultWidth: "wide"
|
|
774
|
-
}),
|
|
775
|
-
day: x({
|
|
776
|
-
values: ct,
|
|
777
|
-
defaultWidth: "wide"
|
|
778
|
-
}),
|
|
779
|
-
dayPeriod: x({
|
|
780
|
-
values: dt,
|
|
781
|
-
defaultWidth: "wide"
|
|
782
|
-
})
|
|
783
|
-
}, ft = /^(\d+)(ième|ère|ème|er|e)?/i, wt = /\d+/i, yt = {
|
|
784
|
-
narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
|
|
785
|
-
abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
|
|
786
|
-
wide: /^(avant Jésus-Christ|après Jésus-Christ)/i
|
|
787
|
-
}, bt = {
|
|
788
|
-
any: [/^av/i, /^ap/i]
|
|
789
|
-
}, pt = {
|
|
790
|
-
narrow: /^T?[1234]/i,
|
|
791
|
-
abbreviated: /^[1234](er|ème|e)? trim\.?/i,
|
|
792
|
-
wide: /^[1234](er|ème|e)? trimestre/i
|
|
793
|
-
}, gt = {
|
|
794
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
795
|
-
}, Pt = {
|
|
796
|
-
narrow: /^[jfmasond]/i,
|
|
797
|
-
abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
|
|
798
|
-
wide: /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i
|
|
799
|
-
}, xt = {
|
|
800
|
-
narrow: [
|
|
801
|
-
/^j/i,
|
|
802
|
-
/^f/i,
|
|
803
|
-
/^m/i,
|
|
804
|
-
/^a/i,
|
|
805
|
-
/^m/i,
|
|
806
|
-
/^j/i,
|
|
807
|
-
/^j/i,
|
|
808
|
-
/^a/i,
|
|
809
|
-
/^s/i,
|
|
810
|
-
/^o/i,
|
|
811
|
-
/^n/i,
|
|
812
|
-
/^d/i
|
|
813
|
-
],
|
|
814
|
-
any: [
|
|
815
|
-
/^ja/i,
|
|
816
|
-
/^f/i,
|
|
817
|
-
/^mar/i,
|
|
818
|
-
/^av/i,
|
|
819
|
-
/^ma/i,
|
|
820
|
-
/^juin/i,
|
|
821
|
-
/^juil/i,
|
|
822
|
-
/^ao/i,
|
|
823
|
-
/^s/i,
|
|
824
|
-
/^o/i,
|
|
825
|
-
/^n/i,
|
|
826
|
-
/^d/i
|
|
827
|
-
]
|
|
828
|
-
}, Mt = {
|
|
829
|
-
narrow: /^[lmjvsd]/i,
|
|
830
|
-
short: /^(di|lu|ma|me|je|ve|sa)/i,
|
|
831
|
-
abbreviated: /^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,
|
|
832
|
-
wide: /^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i
|
|
833
|
-
}, kt = {
|
|
834
|
-
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
835
|
-
any: [/^di/i, /^lu/i, /^ma/i, /^me/i, /^je/i, /^ve/i, /^sa/i]
|
|
836
|
-
}, vt = {
|
|
837
|
-
narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
|
|
838
|
-
any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
|
|
839
|
-
}, Tt = {
|
|
840
|
-
any: {
|
|
841
|
-
am: /^a/i,
|
|
842
|
-
pm: /^p/i,
|
|
843
|
-
midnight: /^min/i,
|
|
844
|
-
noon: /^mid/i,
|
|
845
|
-
morning: /mat/i,
|
|
846
|
-
afternoon: /ap/i,
|
|
847
|
-
evening: /soir/i,
|
|
848
|
-
night: /nuit/i
|
|
849
|
-
}
|
|
850
|
-
}, Dt = {
|
|
851
|
-
ordinalNumber: J({
|
|
852
|
-
matchPattern: ft,
|
|
853
|
-
parsePattern: wt,
|
|
854
|
-
valueCallback: (r) => parseInt(r)
|
|
855
|
-
}),
|
|
856
|
-
era: M({
|
|
857
|
-
matchPatterns: yt,
|
|
858
|
-
defaultMatchWidth: "wide",
|
|
859
|
-
parsePatterns: bt,
|
|
860
|
-
defaultParseWidth: "any"
|
|
861
|
-
}),
|
|
862
|
-
quarter: M({
|
|
863
|
-
matchPatterns: pt,
|
|
864
|
-
defaultMatchWidth: "wide",
|
|
865
|
-
parsePatterns: gt,
|
|
866
|
-
defaultParseWidth: "any",
|
|
867
|
-
valueCallback: (r) => r + 1
|
|
868
|
-
}),
|
|
869
|
-
month: M({
|
|
870
|
-
matchPatterns: Pt,
|
|
871
|
-
defaultMatchWidth: "wide",
|
|
872
|
-
parsePatterns: xt,
|
|
873
|
-
defaultParseWidth: "any"
|
|
874
|
-
}),
|
|
875
|
-
day: M({
|
|
876
|
-
matchPatterns: Mt,
|
|
877
|
-
defaultMatchWidth: "wide",
|
|
878
|
-
parsePatterns: kt,
|
|
879
|
-
defaultParseWidth: "any"
|
|
880
|
-
}),
|
|
881
|
-
dayPeriod: M({
|
|
882
|
-
matchPatterns: vt,
|
|
883
|
-
defaultMatchWidth: "any",
|
|
884
|
-
parsePatterns: Tt,
|
|
885
|
-
defaultParseWidth: "any"
|
|
886
|
-
})
|
|
887
|
-
}, Yn = {
|
|
888
|
-
code: "fr",
|
|
889
|
-
formatDistance: Se,
|
|
890
|
-
formatLong: rt,
|
|
891
|
-
formatRelative: st,
|
|
892
|
-
localize: ht,
|
|
893
|
-
match: Dt,
|
|
894
|
-
options: {
|
|
895
|
-
weekStartsOn: 1,
|
|
896
|
-
firstWeekContainsDate: 4
|
|
897
|
-
}
|
|
898
|
-
};
|
|
899
|
-
function Wt() {
|
|
900
|
-
return Object.assign({}, C());
|
|
901
|
-
}
|
|
902
|
-
function Yt(r, a) {
|
|
903
|
-
const e = Ot(a) ? new a(0) : y(a, 0);
|
|
904
|
-
return e.setFullYear(r.getFullYear(), r.getMonth(), r.getDate()), e.setHours(
|
|
905
|
-
r.getHours(),
|
|
906
|
-
r.getMinutes(),
|
|
907
|
-
r.getSeconds(),
|
|
908
|
-
r.getMilliseconds()
|
|
909
|
-
), e;
|
|
910
|
-
}
|
|
911
|
-
function Ot(r) {
|
|
912
|
-
return typeof r == "function" && r.prototype?.constructor === r;
|
|
913
|
-
}
|
|
914
|
-
const _t = 10;
|
|
915
|
-
class Z {
|
|
916
|
-
constructor() {
|
|
917
|
-
i(this, "subPriority", 0);
|
|
918
|
-
}
|
|
919
|
-
validate(a, e) {
|
|
920
|
-
return !0;
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
class Ct extends Z {
|
|
924
|
-
constructor(a, e, t, n, s) {
|
|
925
|
-
super(), this.value = a, this.validateValue = e, this.setValue = t, this.priority = n, s && (this.subPriority = s);
|
|
926
|
-
}
|
|
927
|
-
validate(a, e) {
|
|
928
|
-
return this.validateValue(a, this.value, e);
|
|
929
|
-
}
|
|
930
|
-
set(a, e, t) {
|
|
931
|
-
return this.setValue(a, e, this.value, t);
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
class Ht extends Z {
|
|
935
|
-
constructor(e, t) {
|
|
936
|
-
super();
|
|
937
|
-
i(this, "priority", _t);
|
|
938
|
-
i(this, "subPriority", -1);
|
|
939
|
-
this.context = e || ((n) => y(t, n));
|
|
940
|
-
}
|
|
941
|
-
set(e, t) {
|
|
942
|
-
return t.timestampIsSet ? e : y(e, Yt(e, this.context));
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
class c {
|
|
946
|
-
run(a, e, t, n) {
|
|
947
|
-
const s = this.parse(a, e, t, n);
|
|
948
|
-
return s ? {
|
|
949
|
-
setter: new Ct(
|
|
950
|
-
s.value,
|
|
951
|
-
this.validate,
|
|
952
|
-
this.set,
|
|
953
|
-
this.priority,
|
|
954
|
-
this.subPriority
|
|
955
|
-
),
|
|
956
|
-
rest: s.rest
|
|
957
|
-
} : null;
|
|
958
|
-
}
|
|
959
|
-
validate(a, e, t) {
|
|
960
|
-
return !0;
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
class Et extends c {
|
|
964
|
-
constructor() {
|
|
965
|
-
super(...arguments);
|
|
966
|
-
i(this, "priority", 140);
|
|
967
|
-
i(this, "incompatibleTokens", ["R", "u", "t", "T"]);
|
|
968
|
-
}
|
|
969
|
-
parse(e, t, n) {
|
|
970
|
-
switch (t) {
|
|
971
|
-
// AD, BC
|
|
972
|
-
case "G":
|
|
973
|
-
case "GG":
|
|
974
|
-
case "GGG":
|
|
975
|
-
return n.era(e, { width: "abbreviated" }) || n.era(e, { width: "narrow" });
|
|
976
|
-
// A, B
|
|
977
|
-
case "GGGGG":
|
|
978
|
-
return n.era(e, { width: "narrow" });
|
|
979
|
-
// Anno Domini, Before Christ
|
|
980
|
-
case "GGGG":
|
|
981
|
-
default:
|
|
982
|
-
return n.era(e, { width: "wide" }) || n.era(e, { width: "abbreviated" }) || n.era(e, { width: "narrow" });
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
set(e, t, n) {
|
|
986
|
-
return t.era = n, e.setFullYear(n, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
const f = {
|
|
990
|
-
month: /^(1[0-2]|0?\d)/,
|
|
991
|
-
// 0 to 12
|
|
992
|
-
date: /^(3[0-1]|[0-2]?\d)/,
|
|
993
|
-
// 0 to 31
|
|
994
|
-
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
|
|
995
|
-
// 0 to 366
|
|
996
|
-
week: /^(5[0-3]|[0-4]?\d)/,
|
|
997
|
-
// 0 to 53
|
|
998
|
-
hour23h: /^(2[0-3]|[0-1]?\d)/,
|
|
999
|
-
// 0 to 23
|
|
1000
|
-
hour24h: /^(2[0-4]|[0-1]?\d)/,
|
|
1001
|
-
// 0 to 24
|
|
1002
|
-
hour11h: /^(1[0-1]|0?\d)/,
|
|
1003
|
-
// 0 to 11
|
|
1004
|
-
hour12h: /^(1[0-2]|0?\d)/,
|
|
1005
|
-
// 0 to 12
|
|
1006
|
-
minute: /^[0-5]?\d/,
|
|
1007
|
-
// 0 to 59
|
|
1008
|
-
second: /^[0-5]?\d/,
|
|
1009
|
-
// 0 to 59
|
|
1010
|
-
singleDigit: /^\d/,
|
|
1011
|
-
// 0 to 9
|
|
1012
|
-
twoDigits: /^\d{1,2}/,
|
|
1013
|
-
// 0 to 99
|
|
1014
|
-
threeDigits: /^\d{1,3}/,
|
|
1015
|
-
// 0 to 999
|
|
1016
|
-
fourDigits: /^\d{1,4}/,
|
|
1017
|
-
// 0 to 9999
|
|
1018
|
-
anyDigitsSigned: /^-?\d+/,
|
|
1019
|
-
singleDigitSigned: /^-?\d/,
|
|
1020
|
-
// 0 to 9, -0 to -9
|
|
1021
|
-
twoDigitsSigned: /^-?\d{1,2}/,
|
|
1022
|
-
// 0 to 99, -0 to -99
|
|
1023
|
-
threeDigitsSigned: /^-?\d{1,3}/,
|
|
1024
|
-
// 0 to 999, -0 to -999
|
|
1025
|
-
fourDigitsSigned: /^-?\d{1,4}/
|
|
1026
|
-
// 0 to 9999, -0 to -9999
|
|
1027
|
-
}, k = {
|
|
1028
|
-
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
|
|
1029
|
-
basic: /^([+-])(\d{2})(\d{2})|Z/,
|
|
1030
|
-
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
|
|
1031
|
-
extended: /^([+-])(\d{2}):(\d{2})|Z/,
|
|
1032
|
-
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
|
|
1033
|
-
};
|
|
1034
|
-
function w(r, a) {
|
|
1035
|
-
return r && {
|
|
1036
|
-
value: a(r.value),
|
|
1037
|
-
rest: r.rest
|
|
1038
|
-
};
|
|
1039
|
-
}
|
|
1040
|
-
function l(r, a) {
|
|
1041
|
-
const e = a.match(r);
|
|
1042
|
-
return e ? {
|
|
1043
|
-
value: parseInt(e[0], 10),
|
|
1044
|
-
rest: a.slice(e[0].length)
|
|
1045
|
-
} : null;
|
|
1046
|
-
}
|
|
1047
|
-
function v(r, a) {
|
|
1048
|
-
const e = a.match(r);
|
|
1049
|
-
if (!e)
|
|
1050
|
-
return null;
|
|
1051
|
-
if (e[0] === "Z")
|
|
1052
|
-
return {
|
|
1053
|
-
value: 0,
|
|
1054
|
-
rest: a.slice(1)
|
|
1055
|
-
};
|
|
1056
|
-
const t = e[1] === "+" ? 1 : -1, n = e[2] ? parseInt(e[2], 10) : 0, s = e[3] ? parseInt(e[3], 10) : 0, o = e[5] ? parseInt(e[5], 10) : 0;
|
|
1057
|
-
return {
|
|
1058
|
-
value: t * (n * je + s * Ie + o * Le),
|
|
1059
|
-
rest: a.slice(e[0].length)
|
|
1060
|
-
};
|
|
1061
|
-
}
|
|
1062
|
-
function K(r) {
|
|
1063
|
-
return l(f.anyDigitsSigned, r);
|
|
1064
|
-
}
|
|
1065
|
-
function h(r, a) {
|
|
1066
|
-
switch (r) {
|
|
1067
|
-
case 1:
|
|
1068
|
-
return l(f.singleDigit, a);
|
|
1069
|
-
case 2:
|
|
1070
|
-
return l(f.twoDigits, a);
|
|
1071
|
-
case 3:
|
|
1072
|
-
return l(f.threeDigits, a);
|
|
1073
|
-
case 4:
|
|
1074
|
-
return l(f.fourDigits, a);
|
|
1075
|
-
default:
|
|
1076
|
-
return l(new RegExp("^\\d{1," + r + "}"), a);
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
function H(r, a) {
|
|
1080
|
-
switch (r) {
|
|
1081
|
-
case 1:
|
|
1082
|
-
return l(f.singleDigitSigned, a);
|
|
1083
|
-
case 2:
|
|
1084
|
-
return l(f.twoDigitsSigned, a);
|
|
1085
|
-
case 3:
|
|
1086
|
-
return l(f.threeDigitsSigned, a);
|
|
1087
|
-
case 4:
|
|
1088
|
-
return l(f.fourDigitsSigned, a);
|
|
1089
|
-
default:
|
|
1090
|
-
return l(new RegExp("^-?\\d{1," + r + "}"), a);
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
function N(r) {
|
|
1094
|
-
switch (r) {
|
|
1095
|
-
case "morning":
|
|
1096
|
-
return 4;
|
|
1097
|
-
case "evening":
|
|
1098
|
-
return 17;
|
|
1099
|
-
case "pm":
|
|
1100
|
-
case "noon":
|
|
1101
|
-
case "afternoon":
|
|
1102
|
-
return 12;
|
|
1103
|
-
case "am":
|
|
1104
|
-
case "midnight":
|
|
1105
|
-
case "night":
|
|
1106
|
-
default:
|
|
1107
|
-
return 0;
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
function U(r, a) {
|
|
1111
|
-
const e = a > 0, t = e ? a : 1 - a;
|
|
1112
|
-
let n;
|
|
1113
|
-
if (t <= 50)
|
|
1114
|
-
n = r || 100;
|
|
1115
|
-
else {
|
|
1116
|
-
const s = t + 50, o = Math.trunc(s / 100) * 100, d = r >= s % 100;
|
|
1117
|
-
n = r + o - (d ? 100 : 0);
|
|
1118
|
-
}
|
|
1119
|
-
return e ? n : 1 - n;
|
|
1120
|
-
}
|
|
1121
|
-
function S(r) {
|
|
1122
|
-
return r % 400 === 0 || r % 4 === 0 && r % 100 !== 0;
|
|
1123
|
-
}
|
|
1124
|
-
class qt extends c {
|
|
1125
|
-
constructor() {
|
|
1126
|
-
super(...arguments);
|
|
1127
|
-
i(this, "priority", 130);
|
|
1128
|
-
i(this, "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]);
|
|
1129
|
-
}
|
|
1130
|
-
parse(e, t, n) {
|
|
1131
|
-
const s = (o) => ({
|
|
1132
|
-
year: o,
|
|
1133
|
-
isTwoDigitYear: t === "yy"
|
|
1134
|
-
});
|
|
1135
|
-
switch (t) {
|
|
1136
|
-
case "y":
|
|
1137
|
-
return w(h(4, e), s);
|
|
1138
|
-
case "yo":
|
|
1139
|
-
return w(
|
|
1140
|
-
n.ordinalNumber(e, {
|
|
1141
|
-
unit: "year"
|
|
1142
|
-
}),
|
|
1143
|
-
s
|
|
1144
|
-
);
|
|
1145
|
-
default:
|
|
1146
|
-
return w(h(t.length, e), s);
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
validate(e, t) {
|
|
1150
|
-
return t.isTwoDigitYear || t.year > 0;
|
|
1151
|
-
}
|
|
1152
|
-
set(e, t, n) {
|
|
1153
|
-
const s = e.getFullYear();
|
|
1154
|
-
if (n.isTwoDigitYear) {
|
|
1155
|
-
const d = U(
|
|
1156
|
-
n.year,
|
|
1157
|
-
s
|
|
1158
|
-
);
|
|
1159
|
-
return e.setFullYear(d, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1160
|
-
}
|
|
1161
|
-
const o = !("era" in t) || t.era === 1 ? n.year : 1 - n.year;
|
|
1162
|
-
return e.setFullYear(o, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
|
-
class Nt extends c {
|
|
1166
|
-
constructor() {
|
|
1167
|
-
super(...arguments);
|
|
1168
|
-
i(this, "priority", 130);
|
|
1169
|
-
i(this, "incompatibleTokens", [
|
|
1170
|
-
"y",
|
|
1171
|
-
"R",
|
|
1172
|
-
"u",
|
|
1173
|
-
"Q",
|
|
1174
|
-
"q",
|
|
1175
|
-
"M",
|
|
1176
|
-
"L",
|
|
1177
|
-
"I",
|
|
1178
|
-
"d",
|
|
1179
|
-
"D",
|
|
1180
|
-
"i",
|
|
1181
|
-
"t",
|
|
1182
|
-
"T"
|
|
1183
|
-
]);
|
|
1184
|
-
}
|
|
1185
|
-
parse(e, t, n) {
|
|
1186
|
-
const s = (o) => ({
|
|
1187
|
-
year: o,
|
|
1188
|
-
isTwoDigitYear: t === "YY"
|
|
1189
|
-
});
|
|
1190
|
-
switch (t) {
|
|
1191
|
-
case "Y":
|
|
1192
|
-
return w(h(4, e), s);
|
|
1193
|
-
case "Yo":
|
|
1194
|
-
return w(
|
|
1195
|
-
n.ordinalNumber(e, {
|
|
1196
|
-
unit: "year"
|
|
1197
|
-
}),
|
|
1198
|
-
s
|
|
1199
|
-
);
|
|
1200
|
-
default:
|
|
1201
|
-
return w(h(t.length, e), s);
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
validate(e, t) {
|
|
1205
|
-
return t.isTwoDigitYear || t.year > 0;
|
|
1206
|
-
}
|
|
1207
|
-
set(e, t, n, s) {
|
|
1208
|
-
const o = B(e, s);
|
|
1209
|
-
if (n.isTwoDigitYear) {
|
|
1210
|
-
const b = U(
|
|
1211
|
-
n.year,
|
|
1212
|
-
o
|
|
1213
|
-
);
|
|
1214
|
-
return e.setFullYear(
|
|
1215
|
-
b,
|
|
1216
|
-
0,
|
|
1217
|
-
s.firstWeekContainsDate
|
|
1218
|
-
), e.setHours(0, 0, 0, 0), T(e, s);
|
|
1219
|
-
}
|
|
1220
|
-
const d = !("era" in t) || t.era === 1 ? n.year : 1 - n.year;
|
|
1221
|
-
return e.setFullYear(d, 0, s.firstWeekContainsDate), e.setHours(0, 0, 0, 0), T(e, s);
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
class Ft extends c {
|
|
1225
|
-
constructor() {
|
|
1226
|
-
super(...arguments);
|
|
1227
|
-
i(this, "priority", 130);
|
|
1228
|
-
i(this, "incompatibleTokens", [
|
|
1229
|
-
"G",
|
|
1230
|
-
"y",
|
|
1231
|
-
"Y",
|
|
1232
|
-
"u",
|
|
1233
|
-
"Q",
|
|
1234
|
-
"q",
|
|
1235
|
-
"M",
|
|
1236
|
-
"L",
|
|
1237
|
-
"w",
|
|
1238
|
-
"d",
|
|
1239
|
-
"D",
|
|
1240
|
-
"e",
|
|
1241
|
-
"c",
|
|
1242
|
-
"t",
|
|
1243
|
-
"T"
|
|
1244
|
-
]);
|
|
1245
|
-
}
|
|
1246
|
-
parse(e, t) {
|
|
1247
|
-
return H(t === "R" ? 4 : t.length, e);
|
|
1248
|
-
}
|
|
1249
|
-
set(e, t, n) {
|
|
1250
|
-
const s = y(e, 0);
|
|
1251
|
-
return s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0), O(s);
|
|
1252
|
-
}
|
|
1253
|
-
}
|
|
1254
|
-
class It extends c {
|
|
1255
|
-
constructor() {
|
|
1256
|
-
super(...arguments);
|
|
1257
|
-
i(this, "priority", 130);
|
|
1258
|
-
i(this, "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]);
|
|
1259
|
-
}
|
|
1260
|
-
parse(e, t) {
|
|
1261
|
-
return H(t === "u" ? 4 : t.length, e);
|
|
1262
|
-
}
|
|
1263
|
-
set(e, t, n) {
|
|
1264
|
-
return e.setFullYear(n, 0, 1), e.setHours(0, 0, 0, 0), e;
|
|
1265
|
-
}
|
|
1266
|
-
}
|
|
1267
|
-
class jt extends c {
|
|
1268
|
-
constructor() {
|
|
1269
|
-
super(...arguments);
|
|
1270
|
-
i(this, "priority", 120);
|
|
1271
|
-
i(this, "incompatibleTokens", [
|
|
1272
|
-
"Y",
|
|
1273
|
-
"R",
|
|
1274
|
-
"q",
|
|
1275
|
-
"M",
|
|
1276
|
-
"L",
|
|
1277
|
-
"w",
|
|
1278
|
-
"I",
|
|
1279
|
-
"d",
|
|
1280
|
-
"D",
|
|
1281
|
-
"i",
|
|
1282
|
-
"e",
|
|
1283
|
-
"c",
|
|
1284
|
-
"t",
|
|
1285
|
-
"T"
|
|
1286
|
-
]);
|
|
1287
|
-
}
|
|
1288
|
-
parse(e, t, n) {
|
|
1289
|
-
switch (t) {
|
|
1290
|
-
// 1, 2, 3, 4
|
|
1291
|
-
case "Q":
|
|
1292
|
-
case "QQ":
|
|
1293
|
-
return h(t.length, e);
|
|
1294
|
-
// 1st, 2nd, 3rd, 4th
|
|
1295
|
-
case "Qo":
|
|
1296
|
-
return n.ordinalNumber(e, { unit: "quarter" });
|
|
1297
|
-
// Q1, Q2, Q3, Q4
|
|
1298
|
-
case "QQQ":
|
|
1299
|
-
return n.quarter(e, {
|
|
1300
|
-
width: "abbreviated",
|
|
1301
|
-
context: "formatting"
|
|
1302
|
-
}) || n.quarter(e, {
|
|
1303
|
-
width: "narrow",
|
|
1304
|
-
context: "formatting"
|
|
1305
|
-
});
|
|
1306
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1307
|
-
case "QQQQQ":
|
|
1308
|
-
return n.quarter(e, {
|
|
1309
|
-
width: "narrow",
|
|
1310
|
-
context: "formatting"
|
|
1311
|
-
});
|
|
1312
|
-
// 1st quarter, 2nd quarter, ...
|
|
1313
|
-
case "QQQQ":
|
|
1314
|
-
default:
|
|
1315
|
-
return n.quarter(e, {
|
|
1316
|
-
width: "wide",
|
|
1317
|
-
context: "formatting"
|
|
1318
|
-
}) || n.quarter(e, {
|
|
1319
|
-
width: "abbreviated",
|
|
1320
|
-
context: "formatting"
|
|
1321
|
-
}) || n.quarter(e, {
|
|
1322
|
-
width: "narrow",
|
|
1323
|
-
context: "formatting"
|
|
1324
|
-
});
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
validate(e, t) {
|
|
1328
|
-
return t >= 1 && t <= 4;
|
|
1329
|
-
}
|
|
1330
|
-
set(e, t, n) {
|
|
1331
|
-
return e.setMonth((n - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
class Lt extends c {
|
|
1335
|
-
constructor() {
|
|
1336
|
-
super(...arguments);
|
|
1337
|
-
i(this, "priority", 120);
|
|
1338
|
-
i(this, "incompatibleTokens", [
|
|
1339
|
-
"Y",
|
|
1340
|
-
"R",
|
|
1341
|
-
"Q",
|
|
1342
|
-
"M",
|
|
1343
|
-
"L",
|
|
1344
|
-
"w",
|
|
1345
|
-
"I",
|
|
1346
|
-
"d",
|
|
1347
|
-
"D",
|
|
1348
|
-
"i",
|
|
1349
|
-
"e",
|
|
1350
|
-
"c",
|
|
1351
|
-
"t",
|
|
1352
|
-
"T"
|
|
1353
|
-
]);
|
|
1354
|
-
}
|
|
1355
|
-
parse(e, t, n) {
|
|
1356
|
-
switch (t) {
|
|
1357
|
-
// 1, 2, 3, 4
|
|
1358
|
-
case "q":
|
|
1359
|
-
case "qq":
|
|
1360
|
-
return h(t.length, e);
|
|
1361
|
-
// 1st, 2nd, 3rd, 4th
|
|
1362
|
-
case "qo":
|
|
1363
|
-
return n.ordinalNumber(e, { unit: "quarter" });
|
|
1364
|
-
// Q1, Q2, Q3, Q4
|
|
1365
|
-
case "qqq":
|
|
1366
|
-
return n.quarter(e, {
|
|
1367
|
-
width: "abbreviated",
|
|
1368
|
-
context: "standalone"
|
|
1369
|
-
}) || n.quarter(e, {
|
|
1370
|
-
width: "narrow",
|
|
1371
|
-
context: "standalone"
|
|
1372
|
-
});
|
|
1373
|
-
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
1374
|
-
case "qqqqq":
|
|
1375
|
-
return n.quarter(e, {
|
|
1376
|
-
width: "narrow",
|
|
1377
|
-
context: "standalone"
|
|
1378
|
-
});
|
|
1379
|
-
// 1st quarter, 2nd quarter, ...
|
|
1380
|
-
case "qqqq":
|
|
1381
|
-
default:
|
|
1382
|
-
return n.quarter(e, {
|
|
1383
|
-
width: "wide",
|
|
1384
|
-
context: "standalone"
|
|
1385
|
-
}) || n.quarter(e, {
|
|
1386
|
-
width: "abbreviated",
|
|
1387
|
-
context: "standalone"
|
|
1388
|
-
}) || n.quarter(e, {
|
|
1389
|
-
width: "narrow",
|
|
1390
|
-
context: "standalone"
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
validate(e, t) {
|
|
1395
|
-
return t >= 1 && t <= 4;
|
|
1396
|
-
}
|
|
1397
|
-
set(e, t, n) {
|
|
1398
|
-
return e.setMonth((n - 1) * 3, 1), e.setHours(0, 0, 0, 0), e;
|
|
1399
|
-
}
|
|
1400
|
-
}
|
|
1401
|
-
class Rt extends c {
|
|
1402
|
-
constructor() {
|
|
1403
|
-
super(...arguments);
|
|
1404
|
-
i(this, "incompatibleTokens", [
|
|
1405
|
-
"Y",
|
|
1406
|
-
"R",
|
|
1407
|
-
"q",
|
|
1408
|
-
"Q",
|
|
1409
|
-
"L",
|
|
1410
|
-
"w",
|
|
1411
|
-
"I",
|
|
1412
|
-
"D",
|
|
1413
|
-
"i",
|
|
1414
|
-
"e",
|
|
1415
|
-
"c",
|
|
1416
|
-
"t",
|
|
1417
|
-
"T"
|
|
1418
|
-
]);
|
|
1419
|
-
i(this, "priority", 110);
|
|
1420
|
-
}
|
|
1421
|
-
parse(e, t, n) {
|
|
1422
|
-
const s = (o) => o - 1;
|
|
1423
|
-
switch (t) {
|
|
1424
|
-
// 1, 2, ..., 12
|
|
1425
|
-
case "M":
|
|
1426
|
-
return w(
|
|
1427
|
-
l(f.month, e),
|
|
1428
|
-
s
|
|
1429
|
-
);
|
|
1430
|
-
// 01, 02, ..., 12
|
|
1431
|
-
case "MM":
|
|
1432
|
-
return w(h(2, e), s);
|
|
1433
|
-
// 1st, 2nd, ..., 12th
|
|
1434
|
-
case "Mo":
|
|
1435
|
-
return w(
|
|
1436
|
-
n.ordinalNumber(e, {
|
|
1437
|
-
unit: "month"
|
|
1438
|
-
}),
|
|
1439
|
-
s
|
|
1440
|
-
);
|
|
1441
|
-
// Jan, Feb, ..., Dec
|
|
1442
|
-
case "MMM":
|
|
1443
|
-
return n.month(e, {
|
|
1444
|
-
width: "abbreviated",
|
|
1445
|
-
context: "formatting"
|
|
1446
|
-
}) || n.month(e, { width: "narrow", context: "formatting" });
|
|
1447
|
-
// J, F, ..., D
|
|
1448
|
-
case "MMMMM":
|
|
1449
|
-
return n.month(e, {
|
|
1450
|
-
width: "narrow",
|
|
1451
|
-
context: "formatting"
|
|
1452
|
-
});
|
|
1453
|
-
// January, February, ..., December
|
|
1454
|
-
case "MMMM":
|
|
1455
|
-
default:
|
|
1456
|
-
return n.month(e, { width: "wide", context: "formatting" }) || n.month(e, {
|
|
1457
|
-
width: "abbreviated",
|
|
1458
|
-
context: "formatting"
|
|
1459
|
-
}) || n.month(e, { width: "narrow", context: "formatting" });
|
|
1460
|
-
}
|
|
1461
|
-
}
|
|
1462
|
-
validate(e, t) {
|
|
1463
|
-
return t >= 0 && t <= 11;
|
|
1464
|
-
}
|
|
1465
|
-
set(e, t, n) {
|
|
1466
|
-
return e.setMonth(n, 1), e.setHours(0, 0, 0, 0), e;
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
class $t extends c {
|
|
1470
|
-
constructor() {
|
|
1471
|
-
super(...arguments);
|
|
1472
|
-
i(this, "priority", 110);
|
|
1473
|
-
i(this, "incompatibleTokens", [
|
|
1474
|
-
"Y",
|
|
1475
|
-
"R",
|
|
1476
|
-
"q",
|
|
1477
|
-
"Q",
|
|
1478
|
-
"M",
|
|
1479
|
-
"w",
|
|
1480
|
-
"I",
|
|
1481
|
-
"D",
|
|
1482
|
-
"i",
|
|
1483
|
-
"e",
|
|
1484
|
-
"c",
|
|
1485
|
-
"t",
|
|
1486
|
-
"T"
|
|
1487
|
-
]);
|
|
1488
|
-
}
|
|
1489
|
-
parse(e, t, n) {
|
|
1490
|
-
const s = (o) => o - 1;
|
|
1491
|
-
switch (t) {
|
|
1492
|
-
// 1, 2, ..., 12
|
|
1493
|
-
case "L":
|
|
1494
|
-
return w(
|
|
1495
|
-
l(f.month, e),
|
|
1496
|
-
s
|
|
1497
|
-
);
|
|
1498
|
-
// 01, 02, ..., 12
|
|
1499
|
-
case "LL":
|
|
1500
|
-
return w(h(2, e), s);
|
|
1501
|
-
// 1st, 2nd, ..., 12th
|
|
1502
|
-
case "Lo":
|
|
1503
|
-
return w(
|
|
1504
|
-
n.ordinalNumber(e, {
|
|
1505
|
-
unit: "month"
|
|
1506
|
-
}),
|
|
1507
|
-
s
|
|
1508
|
-
);
|
|
1509
|
-
// Jan, Feb, ..., Dec
|
|
1510
|
-
case "LLL":
|
|
1511
|
-
return n.month(e, {
|
|
1512
|
-
width: "abbreviated",
|
|
1513
|
-
context: "standalone"
|
|
1514
|
-
}) || n.month(e, { width: "narrow", context: "standalone" });
|
|
1515
|
-
// J, F, ..., D
|
|
1516
|
-
case "LLLLL":
|
|
1517
|
-
return n.month(e, {
|
|
1518
|
-
width: "narrow",
|
|
1519
|
-
context: "standalone"
|
|
1520
|
-
});
|
|
1521
|
-
// January, February, ..., December
|
|
1522
|
-
case "LLLL":
|
|
1523
|
-
default:
|
|
1524
|
-
return n.month(e, { width: "wide", context: "standalone" }) || n.month(e, {
|
|
1525
|
-
width: "abbreviated",
|
|
1526
|
-
context: "standalone"
|
|
1527
|
-
}) || n.month(e, { width: "narrow", context: "standalone" });
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
validate(e, t) {
|
|
1531
|
-
return t >= 0 && t <= 11;
|
|
1532
|
-
}
|
|
1533
|
-
set(e, t, n) {
|
|
1534
|
-
return e.setMonth(n, 1), e.setHours(0, 0, 0, 0), e;
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
function Qt(r, a, e) {
|
|
1538
|
-
const t = g(r, e?.in), n = Xe(t, e) - a;
|
|
1539
|
-
return t.setDate(t.getDate() - n * 7), g(t, e?.in);
|
|
1540
|
-
}
|
|
1541
|
-
class At extends c {
|
|
1542
|
-
constructor() {
|
|
1543
|
-
super(...arguments);
|
|
1544
|
-
i(this, "priority", 100);
|
|
1545
|
-
i(this, "incompatibleTokens", [
|
|
1546
|
-
"y",
|
|
1547
|
-
"R",
|
|
1548
|
-
"u",
|
|
1549
|
-
"q",
|
|
1550
|
-
"Q",
|
|
1551
|
-
"M",
|
|
1552
|
-
"L",
|
|
1553
|
-
"I",
|
|
1554
|
-
"d",
|
|
1555
|
-
"D",
|
|
1556
|
-
"i",
|
|
1557
|
-
"t",
|
|
1558
|
-
"T"
|
|
1559
|
-
]);
|
|
1560
|
-
}
|
|
1561
|
-
parse(e, t, n) {
|
|
1562
|
-
switch (t) {
|
|
1563
|
-
case "w":
|
|
1564
|
-
return l(f.week, e);
|
|
1565
|
-
case "wo":
|
|
1566
|
-
return n.ordinalNumber(e, { unit: "week" });
|
|
1567
|
-
default:
|
|
1568
|
-
return h(t.length, e);
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
validate(e, t) {
|
|
1572
|
-
return t >= 1 && t <= 53;
|
|
1573
|
-
}
|
|
1574
|
-
set(e, t, n, s) {
|
|
1575
|
-
return T(Qt(e, n, s), s);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
function Xt(r, a, e) {
|
|
1579
|
-
const t = g(r, e?.in), n = Qe(t, e) - a;
|
|
1580
|
-
return t.setDate(t.getDate() - n * 7), t;
|
|
1581
|
-
}
|
|
1582
|
-
class Jt extends c {
|
|
1583
|
-
constructor() {
|
|
1584
|
-
super(...arguments);
|
|
1585
|
-
i(this, "priority", 100);
|
|
1586
|
-
i(this, "incompatibleTokens", [
|
|
1587
|
-
"y",
|
|
1588
|
-
"Y",
|
|
1589
|
-
"u",
|
|
1590
|
-
"q",
|
|
1591
|
-
"Q",
|
|
1592
|
-
"M",
|
|
1593
|
-
"L",
|
|
1594
|
-
"w",
|
|
1595
|
-
"d",
|
|
1596
|
-
"D",
|
|
1597
|
-
"e",
|
|
1598
|
-
"c",
|
|
1599
|
-
"t",
|
|
1600
|
-
"T"
|
|
1601
|
-
]);
|
|
1602
|
-
}
|
|
1603
|
-
parse(e, t, n) {
|
|
1604
|
-
switch (t) {
|
|
1605
|
-
case "I":
|
|
1606
|
-
return l(f.week, e);
|
|
1607
|
-
case "Io":
|
|
1608
|
-
return n.ordinalNumber(e, { unit: "week" });
|
|
1609
|
-
default:
|
|
1610
|
-
return h(t.length, e);
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
validate(e, t) {
|
|
1614
|
-
return t >= 1 && t <= 53;
|
|
1615
|
-
}
|
|
1616
|
-
set(e, t, n) {
|
|
1617
|
-
return O(Xt(e, n));
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
const zt = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Vt = [
|
|
1621
|
-
31,
|
|
1622
|
-
29,
|
|
1623
|
-
31,
|
|
1624
|
-
30,
|
|
1625
|
-
31,
|
|
1626
|
-
30,
|
|
1627
|
-
31,
|
|
1628
|
-
31,
|
|
1629
|
-
30,
|
|
1630
|
-
31,
|
|
1631
|
-
30,
|
|
1632
|
-
31
|
|
1633
|
-
];
|
|
1634
|
-
class Bt extends c {
|
|
1635
|
-
constructor() {
|
|
1636
|
-
super(...arguments);
|
|
1637
|
-
i(this, "priority", 90);
|
|
1638
|
-
i(this, "subPriority", 1);
|
|
1639
|
-
i(this, "incompatibleTokens", [
|
|
1640
|
-
"Y",
|
|
1641
|
-
"R",
|
|
1642
|
-
"q",
|
|
1643
|
-
"Q",
|
|
1644
|
-
"w",
|
|
1645
|
-
"I",
|
|
1646
|
-
"D",
|
|
1647
|
-
"i",
|
|
1648
|
-
"e",
|
|
1649
|
-
"c",
|
|
1650
|
-
"t",
|
|
1651
|
-
"T"
|
|
1652
|
-
]);
|
|
1653
|
-
}
|
|
1654
|
-
parse(e, t, n) {
|
|
1655
|
-
switch (t) {
|
|
1656
|
-
case "d":
|
|
1657
|
-
return l(f.date, e);
|
|
1658
|
-
case "do":
|
|
1659
|
-
return n.ordinalNumber(e, { unit: "date" });
|
|
1660
|
-
default:
|
|
1661
|
-
return h(t.length, e);
|
|
1662
|
-
}
|
|
1663
|
-
}
|
|
1664
|
-
validate(e, t) {
|
|
1665
|
-
const n = e.getFullYear(), s = S(n), o = e.getMonth();
|
|
1666
|
-
return s ? t >= 1 && t <= Vt[o] : t >= 1 && t <= zt[o];
|
|
1667
|
-
}
|
|
1668
|
-
set(e, t, n) {
|
|
1669
|
-
return e.setDate(n), e.setHours(0, 0, 0, 0), e;
|
|
1670
|
-
}
|
|
1671
|
-
}
|
|
1672
|
-
class Gt extends c {
|
|
1673
|
-
constructor() {
|
|
1674
|
-
super(...arguments);
|
|
1675
|
-
i(this, "priority", 90);
|
|
1676
|
-
i(this, "subpriority", 1);
|
|
1677
|
-
i(this, "incompatibleTokens", [
|
|
1678
|
-
"Y",
|
|
1679
|
-
"R",
|
|
1680
|
-
"q",
|
|
1681
|
-
"Q",
|
|
1682
|
-
"M",
|
|
1683
|
-
"L",
|
|
1684
|
-
"w",
|
|
1685
|
-
"I",
|
|
1686
|
-
"d",
|
|
1687
|
-
"E",
|
|
1688
|
-
"i",
|
|
1689
|
-
"e",
|
|
1690
|
-
"c",
|
|
1691
|
-
"t",
|
|
1692
|
-
"T"
|
|
1693
|
-
]);
|
|
1694
|
-
}
|
|
1695
|
-
parse(e, t, n) {
|
|
1696
|
-
switch (t) {
|
|
1697
|
-
case "D":
|
|
1698
|
-
case "DD":
|
|
1699
|
-
return l(f.dayOfYear, e);
|
|
1700
|
-
case "Do":
|
|
1701
|
-
return n.ordinalNumber(e, { unit: "date" });
|
|
1702
|
-
default:
|
|
1703
|
-
return h(t.length, e);
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
validate(e, t) {
|
|
1707
|
-
const n = e.getFullYear();
|
|
1708
|
-
return S(n) ? t >= 1 && t <= 366 : t >= 1 && t <= 365;
|
|
1709
|
-
}
|
|
1710
|
-
set(e, t, n) {
|
|
1711
|
-
return e.setMonth(0, n), e.setHours(0, 0, 0, 0), e;
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
function ee(r, a, e) {
|
|
1715
|
-
const t = g(r, e?.in);
|
|
1716
|
-
return isNaN(a) ? y(e?.in || r, NaN) : (a && t.setDate(t.getDate() + a), t);
|
|
1717
|
-
}
|
|
1718
|
-
function F(r, a, e) {
|
|
1719
|
-
const t = C(), n = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? t.weekStartsOn ?? t.locale?.options?.weekStartsOn ?? 0, s = g(r, e?.in), o = s.getDay(), b = (a % 7 + 7) % 7, p = 7 - n, D = a < 0 || a > 6 ? a - (o + p) % 7 : (b + p) % 7 - (o + p) % 7;
|
|
1720
|
-
return ee(s, D, e);
|
|
1721
|
-
}
|
|
1722
|
-
class Zt extends c {
|
|
1723
|
-
constructor() {
|
|
1724
|
-
super(...arguments);
|
|
1725
|
-
i(this, "priority", 90);
|
|
1726
|
-
i(this, "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]);
|
|
1727
|
-
}
|
|
1728
|
-
parse(e, t, n) {
|
|
1729
|
-
switch (t) {
|
|
1730
|
-
// Tue
|
|
1731
|
-
case "E":
|
|
1732
|
-
case "EE":
|
|
1733
|
-
case "EEE":
|
|
1734
|
-
return n.day(e, {
|
|
1735
|
-
width: "abbreviated",
|
|
1736
|
-
context: "formatting"
|
|
1737
|
-
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
1738
|
-
// T
|
|
1739
|
-
case "EEEEE":
|
|
1740
|
-
return n.day(e, {
|
|
1741
|
-
width: "narrow",
|
|
1742
|
-
context: "formatting"
|
|
1743
|
-
});
|
|
1744
|
-
// Tu
|
|
1745
|
-
case "EEEEEE":
|
|
1746
|
-
return n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
1747
|
-
// Tuesday
|
|
1748
|
-
case "EEEE":
|
|
1749
|
-
default:
|
|
1750
|
-
return n.day(e, { width: "wide", context: "formatting" }) || n.day(e, {
|
|
1751
|
-
width: "abbreviated",
|
|
1752
|
-
context: "formatting"
|
|
1753
|
-
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
validate(e, t) {
|
|
1757
|
-
return t >= 0 && t <= 6;
|
|
1758
|
-
}
|
|
1759
|
-
set(e, t, n, s) {
|
|
1760
|
-
return e = F(e, n, s), e.setHours(0, 0, 0, 0), e;
|
|
1761
|
-
}
|
|
1762
|
-
}
|
|
1763
|
-
class Kt extends c {
|
|
1764
|
-
constructor() {
|
|
1765
|
-
super(...arguments);
|
|
1766
|
-
i(this, "priority", 90);
|
|
1767
|
-
i(this, "incompatibleTokens", [
|
|
1768
|
-
"y",
|
|
1769
|
-
"R",
|
|
1770
|
-
"u",
|
|
1771
|
-
"q",
|
|
1772
|
-
"Q",
|
|
1773
|
-
"M",
|
|
1774
|
-
"L",
|
|
1775
|
-
"I",
|
|
1776
|
-
"d",
|
|
1777
|
-
"D",
|
|
1778
|
-
"E",
|
|
1779
|
-
"i",
|
|
1780
|
-
"c",
|
|
1781
|
-
"t",
|
|
1782
|
-
"T"
|
|
1783
|
-
]);
|
|
1784
|
-
}
|
|
1785
|
-
parse(e, t, n, s) {
|
|
1786
|
-
const o = (d) => {
|
|
1787
|
-
const b = Math.floor((d - 1) / 7) * 7;
|
|
1788
|
-
return (d + s.weekStartsOn + 6) % 7 + b;
|
|
1789
|
-
};
|
|
1790
|
-
switch (t) {
|
|
1791
|
-
// 3
|
|
1792
|
-
case "e":
|
|
1793
|
-
case "ee":
|
|
1794
|
-
return w(h(t.length, e), o);
|
|
1795
|
-
// 3rd
|
|
1796
|
-
case "eo":
|
|
1797
|
-
return w(
|
|
1798
|
-
n.ordinalNumber(e, {
|
|
1799
|
-
unit: "day"
|
|
1800
|
-
}),
|
|
1801
|
-
o
|
|
1802
|
-
);
|
|
1803
|
-
// Tue
|
|
1804
|
-
case "eee":
|
|
1805
|
-
return n.day(e, {
|
|
1806
|
-
width: "abbreviated",
|
|
1807
|
-
context: "formatting"
|
|
1808
|
-
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
1809
|
-
// T
|
|
1810
|
-
case "eeeee":
|
|
1811
|
-
return n.day(e, {
|
|
1812
|
-
width: "narrow",
|
|
1813
|
-
context: "formatting"
|
|
1814
|
-
});
|
|
1815
|
-
// Tu
|
|
1816
|
-
case "eeeeee":
|
|
1817
|
-
return n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
1818
|
-
// Tuesday
|
|
1819
|
-
case "eeee":
|
|
1820
|
-
default:
|
|
1821
|
-
return n.day(e, { width: "wide", context: "formatting" }) || n.day(e, {
|
|
1822
|
-
width: "abbreviated",
|
|
1823
|
-
context: "formatting"
|
|
1824
|
-
}) || n.day(e, { width: "short", context: "formatting" }) || n.day(e, { width: "narrow", context: "formatting" });
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
validate(e, t) {
|
|
1828
|
-
return t >= 0 && t <= 6;
|
|
1829
|
-
}
|
|
1830
|
-
set(e, t, n, s) {
|
|
1831
|
-
return e = F(e, n, s), e.setHours(0, 0, 0, 0), e;
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
class Ut extends c {
|
|
1835
|
-
constructor() {
|
|
1836
|
-
super(...arguments);
|
|
1837
|
-
i(this, "priority", 90);
|
|
1838
|
-
i(this, "incompatibleTokens", [
|
|
1839
|
-
"y",
|
|
1840
|
-
"R",
|
|
1841
|
-
"u",
|
|
1842
|
-
"q",
|
|
1843
|
-
"Q",
|
|
1844
|
-
"M",
|
|
1845
|
-
"L",
|
|
1846
|
-
"I",
|
|
1847
|
-
"d",
|
|
1848
|
-
"D",
|
|
1849
|
-
"E",
|
|
1850
|
-
"i",
|
|
1851
|
-
"e",
|
|
1852
|
-
"t",
|
|
1853
|
-
"T"
|
|
1854
|
-
]);
|
|
1855
|
-
}
|
|
1856
|
-
parse(e, t, n, s) {
|
|
1857
|
-
const o = (d) => {
|
|
1858
|
-
const b = Math.floor((d - 1) / 7) * 7;
|
|
1859
|
-
return (d + s.weekStartsOn + 6) % 7 + b;
|
|
1860
|
-
};
|
|
1861
|
-
switch (t) {
|
|
1862
|
-
// 3
|
|
1863
|
-
case "c":
|
|
1864
|
-
case "cc":
|
|
1865
|
-
return w(h(t.length, e), o);
|
|
1866
|
-
// 3rd
|
|
1867
|
-
case "co":
|
|
1868
|
-
return w(
|
|
1869
|
-
n.ordinalNumber(e, {
|
|
1870
|
-
unit: "day"
|
|
1871
|
-
}),
|
|
1872
|
-
o
|
|
1873
|
-
);
|
|
1874
|
-
// Tue
|
|
1875
|
-
case "ccc":
|
|
1876
|
-
return n.day(e, {
|
|
1877
|
-
width: "abbreviated",
|
|
1878
|
-
context: "standalone"
|
|
1879
|
-
}) || n.day(e, { width: "short", context: "standalone" }) || n.day(e, { width: "narrow", context: "standalone" });
|
|
1880
|
-
// T
|
|
1881
|
-
case "ccccc":
|
|
1882
|
-
return n.day(e, {
|
|
1883
|
-
width: "narrow",
|
|
1884
|
-
context: "standalone"
|
|
1885
|
-
});
|
|
1886
|
-
// Tu
|
|
1887
|
-
case "cccccc":
|
|
1888
|
-
return n.day(e, { width: "short", context: "standalone" }) || n.day(e, { width: "narrow", context: "standalone" });
|
|
1889
|
-
// Tuesday
|
|
1890
|
-
case "cccc":
|
|
1891
|
-
default:
|
|
1892
|
-
return n.day(e, { width: "wide", context: "standalone" }) || n.day(e, {
|
|
1893
|
-
width: "abbreviated",
|
|
1894
|
-
context: "standalone"
|
|
1895
|
-
}) || n.day(e, { width: "short", context: "standalone" }) || n.day(e, { width: "narrow", context: "standalone" });
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
validate(e, t) {
|
|
1899
|
-
return t >= 0 && t <= 6;
|
|
1900
|
-
}
|
|
1901
|
-
set(e, t, n, s) {
|
|
1902
|
-
return e = F(e, n, s), e.setHours(0, 0, 0, 0), e;
|
|
1903
|
-
}
|
|
1904
|
-
}
|
|
1905
|
-
function St(r, a) {
|
|
1906
|
-
const e = g(r, a?.in).getDay();
|
|
1907
|
-
return e === 0 ? 7 : e;
|
|
1908
|
-
}
|
|
1909
|
-
function en(r, a, e) {
|
|
1910
|
-
const t = g(r, e?.in), n = St(t, e), s = a - n;
|
|
1911
|
-
return ee(t, s, e);
|
|
1912
|
-
}
|
|
1913
|
-
class tn extends c {
|
|
1914
|
-
constructor() {
|
|
1915
|
-
super(...arguments);
|
|
1916
|
-
i(this, "priority", 90);
|
|
1917
|
-
i(this, "incompatibleTokens", [
|
|
1918
|
-
"y",
|
|
1919
|
-
"Y",
|
|
1920
|
-
"u",
|
|
1921
|
-
"q",
|
|
1922
|
-
"Q",
|
|
1923
|
-
"M",
|
|
1924
|
-
"L",
|
|
1925
|
-
"w",
|
|
1926
|
-
"d",
|
|
1927
|
-
"D",
|
|
1928
|
-
"E",
|
|
1929
|
-
"e",
|
|
1930
|
-
"c",
|
|
1931
|
-
"t",
|
|
1932
|
-
"T"
|
|
1933
|
-
]);
|
|
1934
|
-
}
|
|
1935
|
-
parse(e, t, n) {
|
|
1936
|
-
const s = (o) => o === 0 ? 7 : o;
|
|
1937
|
-
switch (t) {
|
|
1938
|
-
// 2
|
|
1939
|
-
case "i":
|
|
1940
|
-
case "ii":
|
|
1941
|
-
return h(t.length, e);
|
|
1942
|
-
// 2nd
|
|
1943
|
-
case "io":
|
|
1944
|
-
return n.ordinalNumber(e, { unit: "day" });
|
|
1945
|
-
// Tue
|
|
1946
|
-
case "iii":
|
|
1947
|
-
return w(
|
|
1948
|
-
n.day(e, {
|
|
1949
|
-
width: "abbreviated",
|
|
1950
|
-
context: "formatting"
|
|
1951
|
-
}) || n.day(e, {
|
|
1952
|
-
width: "short",
|
|
1953
|
-
context: "formatting"
|
|
1954
|
-
}) || n.day(e, {
|
|
1955
|
-
width: "narrow",
|
|
1956
|
-
context: "formatting"
|
|
1957
|
-
}),
|
|
1958
|
-
s
|
|
1959
|
-
);
|
|
1960
|
-
// T
|
|
1961
|
-
case "iiiii":
|
|
1962
|
-
return w(
|
|
1963
|
-
n.day(e, {
|
|
1964
|
-
width: "narrow",
|
|
1965
|
-
context: "formatting"
|
|
1966
|
-
}),
|
|
1967
|
-
s
|
|
1968
|
-
);
|
|
1969
|
-
// Tu
|
|
1970
|
-
case "iiiiii":
|
|
1971
|
-
return w(
|
|
1972
|
-
n.day(e, {
|
|
1973
|
-
width: "short",
|
|
1974
|
-
context: "formatting"
|
|
1975
|
-
}) || n.day(e, {
|
|
1976
|
-
width: "narrow",
|
|
1977
|
-
context: "formatting"
|
|
1978
|
-
}),
|
|
1979
|
-
s
|
|
1980
|
-
);
|
|
1981
|
-
// Tuesday
|
|
1982
|
-
case "iiii":
|
|
1983
|
-
default:
|
|
1984
|
-
return w(
|
|
1985
|
-
n.day(e, {
|
|
1986
|
-
width: "wide",
|
|
1987
|
-
context: "formatting"
|
|
1988
|
-
}) || n.day(e, {
|
|
1989
|
-
width: "abbreviated",
|
|
1990
|
-
context: "formatting"
|
|
1991
|
-
}) || n.day(e, {
|
|
1992
|
-
width: "short",
|
|
1993
|
-
context: "formatting"
|
|
1994
|
-
}) || n.day(e, {
|
|
1995
|
-
width: "narrow",
|
|
1996
|
-
context: "formatting"
|
|
1997
|
-
}),
|
|
1998
|
-
s
|
|
1999
|
-
);
|
|
2000
|
-
}
|
|
2001
|
-
}
|
|
2002
|
-
validate(e, t) {
|
|
2003
|
-
return t >= 1 && t <= 7;
|
|
2004
|
-
}
|
|
2005
|
-
set(e, t, n) {
|
|
2006
|
-
return e = en(e, n), e.setHours(0, 0, 0, 0), e;
|
|
2007
|
-
}
|
|
2008
|
-
}
|
|
2009
|
-
class nn extends c {
|
|
2010
|
-
constructor() {
|
|
2011
|
-
super(...arguments);
|
|
2012
|
-
i(this, "priority", 80);
|
|
2013
|
-
i(this, "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]);
|
|
2014
|
-
}
|
|
2015
|
-
parse(e, t, n) {
|
|
2016
|
-
switch (t) {
|
|
2017
|
-
case "a":
|
|
2018
|
-
case "aa":
|
|
2019
|
-
case "aaa":
|
|
2020
|
-
return n.dayPeriod(e, {
|
|
2021
|
-
width: "abbreviated",
|
|
2022
|
-
context: "formatting"
|
|
2023
|
-
}) || n.dayPeriod(e, {
|
|
2024
|
-
width: "narrow",
|
|
2025
|
-
context: "formatting"
|
|
2026
|
-
});
|
|
2027
|
-
case "aaaaa":
|
|
2028
|
-
return n.dayPeriod(e, {
|
|
2029
|
-
width: "narrow",
|
|
2030
|
-
context: "formatting"
|
|
2031
|
-
});
|
|
2032
|
-
case "aaaa":
|
|
2033
|
-
default:
|
|
2034
|
-
return n.dayPeriod(e, {
|
|
2035
|
-
width: "wide",
|
|
2036
|
-
context: "formatting"
|
|
2037
|
-
}) || n.dayPeriod(e, {
|
|
2038
|
-
width: "abbreviated",
|
|
2039
|
-
context: "formatting"
|
|
2040
|
-
}) || n.dayPeriod(e, {
|
|
2041
|
-
width: "narrow",
|
|
2042
|
-
context: "formatting"
|
|
2043
|
-
});
|
|
2044
|
-
}
|
|
2045
|
-
}
|
|
2046
|
-
set(e, t, n) {
|
|
2047
|
-
return e.setHours(N(n), 0, 0, 0), e;
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
class rn extends c {
|
|
2051
|
-
constructor() {
|
|
2052
|
-
super(...arguments);
|
|
2053
|
-
i(this, "priority", 80);
|
|
2054
|
-
i(this, "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]);
|
|
2055
|
-
}
|
|
2056
|
-
parse(e, t, n) {
|
|
2057
|
-
switch (t) {
|
|
2058
|
-
case "b":
|
|
2059
|
-
case "bb":
|
|
2060
|
-
case "bbb":
|
|
2061
|
-
return n.dayPeriod(e, {
|
|
2062
|
-
width: "abbreviated",
|
|
2063
|
-
context: "formatting"
|
|
2064
|
-
}) || n.dayPeriod(e, {
|
|
2065
|
-
width: "narrow",
|
|
2066
|
-
context: "formatting"
|
|
2067
|
-
});
|
|
2068
|
-
case "bbbbb":
|
|
2069
|
-
return n.dayPeriod(e, {
|
|
2070
|
-
width: "narrow",
|
|
2071
|
-
context: "formatting"
|
|
2072
|
-
});
|
|
2073
|
-
case "bbbb":
|
|
2074
|
-
default:
|
|
2075
|
-
return n.dayPeriod(e, {
|
|
2076
|
-
width: "wide",
|
|
2077
|
-
context: "formatting"
|
|
2078
|
-
}) || n.dayPeriod(e, {
|
|
2079
|
-
width: "abbreviated",
|
|
2080
|
-
context: "formatting"
|
|
2081
|
-
}) || n.dayPeriod(e, {
|
|
2082
|
-
width: "narrow",
|
|
2083
|
-
context: "formatting"
|
|
2084
|
-
});
|
|
2085
|
-
}
|
|
2086
|
-
}
|
|
2087
|
-
set(e, t, n) {
|
|
2088
|
-
return e.setHours(N(n), 0, 0, 0), e;
|
|
2089
|
-
}
|
|
2090
|
-
}
|
|
2091
|
-
class an extends c {
|
|
2092
|
-
constructor() {
|
|
2093
|
-
super(...arguments);
|
|
2094
|
-
i(this, "priority", 80);
|
|
2095
|
-
i(this, "incompatibleTokens", ["a", "b", "t", "T"]);
|
|
2096
|
-
}
|
|
2097
|
-
parse(e, t, n) {
|
|
2098
|
-
switch (t) {
|
|
2099
|
-
case "B":
|
|
2100
|
-
case "BB":
|
|
2101
|
-
case "BBB":
|
|
2102
|
-
return n.dayPeriod(e, {
|
|
2103
|
-
width: "abbreviated",
|
|
2104
|
-
context: "formatting"
|
|
2105
|
-
}) || n.dayPeriod(e, {
|
|
2106
|
-
width: "narrow",
|
|
2107
|
-
context: "formatting"
|
|
2108
|
-
});
|
|
2109
|
-
case "BBBBB":
|
|
2110
|
-
return n.dayPeriod(e, {
|
|
2111
|
-
width: "narrow",
|
|
2112
|
-
context: "formatting"
|
|
2113
|
-
});
|
|
2114
|
-
case "BBBB":
|
|
2115
|
-
default:
|
|
2116
|
-
return n.dayPeriod(e, {
|
|
2117
|
-
width: "wide",
|
|
2118
|
-
context: "formatting"
|
|
2119
|
-
}) || n.dayPeriod(e, {
|
|
2120
|
-
width: "abbreviated",
|
|
2121
|
-
context: "formatting"
|
|
2122
|
-
}) || n.dayPeriod(e, {
|
|
2123
|
-
width: "narrow",
|
|
2124
|
-
context: "formatting"
|
|
2125
|
-
});
|
|
2126
|
-
}
|
|
2127
|
-
}
|
|
2128
|
-
set(e, t, n) {
|
|
2129
|
-
return e.setHours(N(n), 0, 0, 0), e;
|
|
2130
|
-
}
|
|
2131
|
-
}
|
|
2132
|
-
class sn extends c {
|
|
2133
|
-
constructor() {
|
|
2134
|
-
super(...arguments);
|
|
2135
|
-
i(this, "priority", 70);
|
|
2136
|
-
i(this, "incompatibleTokens", ["H", "K", "k", "t", "T"]);
|
|
2137
|
-
}
|
|
2138
|
-
parse(e, t, n) {
|
|
2139
|
-
switch (t) {
|
|
2140
|
-
case "h":
|
|
2141
|
-
return l(f.hour12h, e);
|
|
2142
|
-
case "ho":
|
|
2143
|
-
return n.ordinalNumber(e, { unit: "hour" });
|
|
2144
|
-
default:
|
|
2145
|
-
return h(t.length, e);
|
|
2146
|
-
}
|
|
2147
|
-
}
|
|
2148
|
-
validate(e, t) {
|
|
2149
|
-
return t >= 1 && t <= 12;
|
|
2150
|
-
}
|
|
2151
|
-
set(e, t, n) {
|
|
2152
|
-
const s = e.getHours() >= 12;
|
|
2153
|
-
return s && n < 12 ? e.setHours(n + 12, 0, 0, 0) : !s && n === 12 ? e.setHours(0, 0, 0, 0) : e.setHours(n, 0, 0, 0), e;
|
|
2154
|
-
}
|
|
2155
|
-
}
|
|
2156
|
-
class on extends c {
|
|
2157
|
-
constructor() {
|
|
2158
|
-
super(...arguments);
|
|
2159
|
-
i(this, "priority", 70);
|
|
2160
|
-
i(this, "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]);
|
|
2161
|
-
}
|
|
2162
|
-
parse(e, t, n) {
|
|
2163
|
-
switch (t) {
|
|
2164
|
-
case "H":
|
|
2165
|
-
return l(f.hour23h, e);
|
|
2166
|
-
case "Ho":
|
|
2167
|
-
return n.ordinalNumber(e, { unit: "hour" });
|
|
2168
|
-
default:
|
|
2169
|
-
return h(t.length, e);
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
validate(e, t) {
|
|
2173
|
-
return t >= 0 && t <= 23;
|
|
2174
|
-
}
|
|
2175
|
-
set(e, t, n) {
|
|
2176
|
-
return e.setHours(n, 0, 0, 0), e;
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
class un extends c {
|
|
2180
|
-
constructor() {
|
|
2181
|
-
super(...arguments);
|
|
2182
|
-
i(this, "priority", 70);
|
|
2183
|
-
i(this, "incompatibleTokens", ["h", "H", "k", "t", "T"]);
|
|
2184
|
-
}
|
|
2185
|
-
parse(e, t, n) {
|
|
2186
|
-
switch (t) {
|
|
2187
|
-
case "K":
|
|
2188
|
-
return l(f.hour11h, e);
|
|
2189
|
-
case "Ko":
|
|
2190
|
-
return n.ordinalNumber(e, { unit: "hour" });
|
|
2191
|
-
default:
|
|
2192
|
-
return h(t.length, e);
|
|
2193
|
-
}
|
|
2194
|
-
}
|
|
2195
|
-
validate(e, t) {
|
|
2196
|
-
return t >= 0 && t <= 11;
|
|
2197
|
-
}
|
|
2198
|
-
set(e, t, n) {
|
|
2199
|
-
return e.getHours() >= 12 && n < 12 ? e.setHours(n + 12, 0, 0, 0) : e.setHours(n, 0, 0, 0), e;
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
class cn extends c {
|
|
2203
|
-
constructor() {
|
|
2204
|
-
super(...arguments);
|
|
2205
|
-
i(this, "priority", 70);
|
|
2206
|
-
i(this, "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]);
|
|
2207
|
-
}
|
|
2208
|
-
parse(e, t, n) {
|
|
2209
|
-
switch (t) {
|
|
2210
|
-
case "k":
|
|
2211
|
-
return l(f.hour24h, e);
|
|
2212
|
-
case "ko":
|
|
2213
|
-
return n.ordinalNumber(e, { unit: "hour" });
|
|
2214
|
-
default:
|
|
2215
|
-
return h(t.length, e);
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
validate(e, t) {
|
|
2219
|
-
return t >= 1 && t <= 24;
|
|
2220
|
-
}
|
|
2221
|
-
set(e, t, n) {
|
|
2222
|
-
const s = n <= 24 ? n % 24 : n;
|
|
2223
|
-
return e.setHours(s, 0, 0, 0), e;
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
class dn extends c {
|
|
2227
|
-
constructor() {
|
|
2228
|
-
super(...arguments);
|
|
2229
|
-
i(this, "priority", 60);
|
|
2230
|
-
i(this, "incompatibleTokens", ["t", "T"]);
|
|
2231
|
-
}
|
|
2232
|
-
parse(e, t, n) {
|
|
2233
|
-
switch (t) {
|
|
2234
|
-
case "m":
|
|
2235
|
-
return l(f.minute, e);
|
|
2236
|
-
case "mo":
|
|
2237
|
-
return n.ordinalNumber(e, { unit: "minute" });
|
|
2238
|
-
default:
|
|
2239
|
-
return h(t.length, e);
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
validate(e, t) {
|
|
2243
|
-
return t >= 0 && t <= 59;
|
|
2244
|
-
}
|
|
2245
|
-
set(e, t, n) {
|
|
2246
|
-
return e.setMinutes(n, 0, 0), e;
|
|
2247
|
-
}
|
|
2248
|
-
}
|
|
2249
|
-
class ln extends c {
|
|
2250
|
-
constructor() {
|
|
2251
|
-
super(...arguments);
|
|
2252
|
-
i(this, "priority", 50);
|
|
2253
|
-
i(this, "incompatibleTokens", ["t", "T"]);
|
|
2254
|
-
}
|
|
2255
|
-
parse(e, t, n) {
|
|
2256
|
-
switch (t) {
|
|
2257
|
-
case "s":
|
|
2258
|
-
return l(f.second, e);
|
|
2259
|
-
case "so":
|
|
2260
|
-
return n.ordinalNumber(e, { unit: "second" });
|
|
2261
|
-
default:
|
|
2262
|
-
return h(t.length, e);
|
|
2263
|
-
}
|
|
2264
|
-
}
|
|
2265
|
-
validate(e, t) {
|
|
2266
|
-
return t >= 0 && t <= 59;
|
|
2267
|
-
}
|
|
2268
|
-
set(e, t, n) {
|
|
2269
|
-
return e.setSeconds(n, 0), e;
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
class mn extends c {
|
|
2273
|
-
constructor() {
|
|
2274
|
-
super(...arguments);
|
|
2275
|
-
i(this, "priority", 30);
|
|
2276
|
-
i(this, "incompatibleTokens", ["t", "T"]);
|
|
2277
|
-
}
|
|
2278
|
-
parse(e, t) {
|
|
2279
|
-
const n = (s) => Math.trunc(s * Math.pow(10, -t.length + 3));
|
|
2280
|
-
return w(h(t.length, e), n);
|
|
2281
|
-
}
|
|
2282
|
-
set(e, t, n) {
|
|
2283
|
-
return e.setMilliseconds(n), e;
|
|
2284
|
-
}
|
|
2285
|
-
}
|
|
2286
|
-
class hn extends c {
|
|
2287
|
-
constructor() {
|
|
2288
|
-
super(...arguments);
|
|
2289
|
-
i(this, "priority", 10);
|
|
2290
|
-
i(this, "incompatibleTokens", ["t", "T", "x"]);
|
|
2291
|
-
}
|
|
2292
|
-
parse(e, t) {
|
|
2293
|
-
switch (t) {
|
|
2294
|
-
case "X":
|
|
2295
|
-
return v(
|
|
2296
|
-
k.basicOptionalMinutes,
|
|
2297
|
-
e
|
|
2298
|
-
);
|
|
2299
|
-
case "XX":
|
|
2300
|
-
return v(k.basic, e);
|
|
2301
|
-
case "XXXX":
|
|
2302
|
-
return v(
|
|
2303
|
-
k.basicOptionalSeconds,
|
|
2304
|
-
e
|
|
2305
|
-
);
|
|
2306
|
-
case "XXXXX":
|
|
2307
|
-
return v(
|
|
2308
|
-
k.extendedOptionalSeconds,
|
|
2309
|
-
e
|
|
2310
|
-
);
|
|
2311
|
-
case "XXX":
|
|
2312
|
-
default:
|
|
2313
|
-
return v(k.extended, e);
|
|
2314
|
-
}
|
|
2315
|
-
}
|
|
2316
|
-
set(e, t, n) {
|
|
2317
|
-
return t.timestampIsSet ? e : y(
|
|
2318
|
-
e,
|
|
2319
|
-
e.getTime() - V(e) - n
|
|
2320
|
-
);
|
|
2321
|
-
}
|
|
2322
|
-
}
|
|
2323
|
-
class fn extends c {
|
|
2324
|
-
constructor() {
|
|
2325
|
-
super(...arguments);
|
|
2326
|
-
i(this, "priority", 10);
|
|
2327
|
-
i(this, "incompatibleTokens", ["t", "T", "X"]);
|
|
2328
|
-
}
|
|
2329
|
-
parse(e, t) {
|
|
2330
|
-
switch (t) {
|
|
2331
|
-
case "x":
|
|
2332
|
-
return v(
|
|
2333
|
-
k.basicOptionalMinutes,
|
|
2334
|
-
e
|
|
2335
|
-
);
|
|
2336
|
-
case "xx":
|
|
2337
|
-
return v(k.basic, e);
|
|
2338
|
-
case "xxxx":
|
|
2339
|
-
return v(
|
|
2340
|
-
k.basicOptionalSeconds,
|
|
2341
|
-
e
|
|
2342
|
-
);
|
|
2343
|
-
case "xxxxx":
|
|
2344
|
-
return v(
|
|
2345
|
-
k.extendedOptionalSeconds,
|
|
2346
|
-
e
|
|
2347
|
-
);
|
|
2348
|
-
case "xxx":
|
|
2349
|
-
default:
|
|
2350
|
-
return v(k.extended, e);
|
|
2351
|
-
}
|
|
2352
|
-
}
|
|
2353
|
-
set(e, t, n) {
|
|
2354
|
-
return t.timestampIsSet ? e : y(
|
|
2355
|
-
e,
|
|
2356
|
-
e.getTime() - V(e) - n
|
|
2357
|
-
);
|
|
2358
|
-
}
|
|
2359
|
-
}
|
|
2360
|
-
class wn extends c {
|
|
2361
|
-
constructor() {
|
|
2362
|
-
super(...arguments);
|
|
2363
|
-
i(this, "priority", 40);
|
|
2364
|
-
i(this, "incompatibleTokens", "*");
|
|
2365
|
-
}
|
|
2366
|
-
parse(e) {
|
|
2367
|
-
return K(e);
|
|
2368
|
-
}
|
|
2369
|
-
set(e, t, n) {
|
|
2370
|
-
return [y(e, n * 1e3), { timestampIsSet: !0 }];
|
|
2371
|
-
}
|
|
2372
|
-
}
|
|
2373
|
-
class yn extends c {
|
|
2374
|
-
constructor() {
|
|
2375
|
-
super(...arguments);
|
|
2376
|
-
i(this, "priority", 20);
|
|
2377
|
-
i(this, "incompatibleTokens", "*");
|
|
2378
|
-
}
|
|
2379
|
-
parse(e) {
|
|
2380
|
-
return K(e);
|
|
2381
|
-
}
|
|
2382
|
-
set(e, t, n) {
|
|
2383
|
-
return [y(e, n), { timestampIsSet: !0 }];
|
|
2384
|
-
}
|
|
2385
|
-
}
|
|
2386
|
-
const bn = {
|
|
2387
|
-
G: new Et(),
|
|
2388
|
-
y: new qt(),
|
|
2389
|
-
Y: new Nt(),
|
|
2390
|
-
R: new Ft(),
|
|
2391
|
-
u: new It(),
|
|
2392
|
-
Q: new jt(),
|
|
2393
|
-
q: new Lt(),
|
|
2394
|
-
M: new Rt(),
|
|
2395
|
-
L: new $t(),
|
|
2396
|
-
w: new At(),
|
|
2397
|
-
I: new Jt(),
|
|
2398
|
-
d: new Bt(),
|
|
2399
|
-
D: new Gt(),
|
|
2400
|
-
E: new Zt(),
|
|
2401
|
-
e: new Kt(),
|
|
2402
|
-
c: new Ut(),
|
|
2403
|
-
i: new tn(),
|
|
2404
|
-
a: new nn(),
|
|
2405
|
-
b: new rn(),
|
|
2406
|
-
B: new an(),
|
|
2407
|
-
h: new sn(),
|
|
2408
|
-
H: new on(),
|
|
2409
|
-
K: new un(),
|
|
2410
|
-
k: new cn(),
|
|
2411
|
-
m: new dn(),
|
|
2412
|
-
s: new ln(),
|
|
2413
|
-
S: new mn(),
|
|
2414
|
-
X: new hn(),
|
|
2415
|
-
x: new fn(),
|
|
2416
|
-
t: new wn(),
|
|
2417
|
-
T: new yn()
|
|
2418
|
-
}, pn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, gn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Pn = /^'([^]*?)'?$/, xn = /''/g, Mn = /\S/, kn = /[a-zA-Z]/;
|
|
2419
|
-
function On(r, a, e, t) {
|
|
2420
|
-
const n = () => y(t?.in || e, NaN), s = Wt(), o = t?.locale ?? s.locale ?? Ne, d = t?.firstWeekContainsDate ?? t?.locale?.options?.firstWeekContainsDate ?? s.firstWeekContainsDate ?? s.locale?.options?.firstWeekContainsDate ?? 1, b = t?.weekStartsOn ?? t?.locale?.options?.weekStartsOn ?? s.weekStartsOn ?? s.locale?.options?.weekStartsOn ?? 0;
|
|
2421
|
-
if (!a)
|
|
2422
|
-
return r ? n() : g(e, t?.in);
|
|
2423
|
-
const p = {
|
|
2424
|
-
firstWeekContainsDate: d,
|
|
2425
|
-
weekStartsOn: b,
|
|
2426
|
-
locale: o
|
|
2427
|
-
}, D = [new Ht(t?.in, e)], _ = a.match(gn).map((u) => {
|
|
2428
|
-
const m = u[0];
|
|
2429
|
-
if (m in A) {
|
|
2430
|
-
const P = A[m];
|
|
2431
|
-
return P(u, o.formatLong);
|
|
2432
|
-
}
|
|
2433
|
-
return u;
|
|
2434
|
-
}).join("").match(pn), E = [];
|
|
2435
|
-
for (let u of _) {
|
|
2436
|
-
!t?.useAdditionalWeekYearTokens && Ze(u) && X(u, a, r), !t?.useAdditionalDayOfYearTokens && Ge(u) && X(u, a, r);
|
|
2437
|
-
const m = u[0], P = bn[m];
|
|
2438
|
-
if (P) {
|
|
2439
|
-
const { incompatibleTokens: j } = P;
|
|
2440
|
-
if (Array.isArray(j)) {
|
|
2441
|
-
const L = E.find(
|
|
2442
|
-
(R) => j.includes(R.token) || R.token === m
|
|
2443
|
-
);
|
|
2444
|
-
if (L)
|
|
2445
|
-
throw new RangeError(
|
|
2446
|
-
`The format string mustn't contain \`${L.fullToken}\` and \`${u}\` at the same time`
|
|
2447
|
-
);
|
|
2448
|
-
} else if (P.incompatibleTokens === "*" && E.length > 0)
|
|
2449
|
-
throw new RangeError(
|
|
2450
|
-
`The format string mustn't contain \`${u}\` and any other token at the same time`
|
|
2451
|
-
);
|
|
2452
|
-
E.push({ token: m, fullToken: u });
|
|
2453
|
-
const q = P.run(
|
|
2454
|
-
r,
|
|
2455
|
-
u,
|
|
2456
|
-
o.match,
|
|
2457
|
-
p
|
|
2458
|
-
);
|
|
2459
|
-
if (!q)
|
|
2460
|
-
return n();
|
|
2461
|
-
D.push(q.setter), r = q.rest;
|
|
2462
|
-
} else {
|
|
2463
|
-
if (m.match(kn))
|
|
2464
|
-
throw new RangeError(
|
|
2465
|
-
"Format string contains an unescaped latin alphabet character `" + m + "`"
|
|
2466
|
-
);
|
|
2467
|
-
if (u === "''" ? u = "'" : m === "'" && (u = vn(u)), r.indexOf(u) === 0)
|
|
2468
|
-
r = r.slice(u.length);
|
|
2469
|
-
else
|
|
2470
|
-
return n();
|
|
2471
|
-
}
|
|
2472
|
-
}
|
|
2473
|
-
if (r.length > 0 && Mn.test(r))
|
|
2474
|
-
return n();
|
|
2475
|
-
const te = D.map((u) => u.priority).sort((u, m) => m - u).filter((u, m, P) => P.indexOf(u) === m).map(
|
|
2476
|
-
(u) => D.filter((m) => m.priority === u).sort((m, P) => P.subPriority - m.subPriority)
|
|
2477
|
-
).map((u) => u[0]);
|
|
2478
|
-
let W = g(e, t?.in);
|
|
2479
|
-
if (isNaN(+W)) return n();
|
|
2480
|
-
const I = {};
|
|
2481
|
-
for (const u of te) {
|
|
2482
|
-
if (!u.validate(W, p))
|
|
2483
|
-
return n();
|
|
2484
|
-
const m = u.set(W, I, p);
|
|
2485
|
-
Array.isArray(m) ? (W = m[0], Object.assign(I, m[1])) : W = m;
|
|
2486
|
-
}
|
|
2487
|
-
return W;
|
|
2488
|
-
}
|
|
2489
|
-
function vn(r) {
|
|
2490
|
-
return r.match(Pn)[1].replace(xn, "'");
|
|
2491
|
-
}
|
|
2492
|
-
export {
|
|
2493
|
-
Wn as a,
|
|
2494
|
-
Qe as b,
|
|
2495
|
-
y as c,
|
|
2496
|
-
Xe as d,
|
|
2497
|
-
Re as e,
|
|
2498
|
-
B as f,
|
|
2499
|
-
V as g,
|
|
2500
|
-
C as h,
|
|
2501
|
-
Ne as i,
|
|
2502
|
-
Ze as j,
|
|
2503
|
-
Ge as k,
|
|
2504
|
-
A as l,
|
|
2505
|
-
Dn as m,
|
|
2506
|
-
je as n,
|
|
2507
|
-
Ie as o,
|
|
2508
|
-
On as p,
|
|
2509
|
-
Yn as q,
|
|
2510
|
-
g as t,
|
|
2511
|
-
X as w
|
|
2512
|
-
};
|