@pequity/squirrel 11.0.1 → 11.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/chunks/index.js +374 -216
- package/dist/cjs/chunks/p-btn.js +1 -1
- package/dist/cjs/dateLocale.js +1221 -280
- package/dist/cjs/index.js +19 -8
- package/dist/cjs/inputClasses.js +3 -3
- package/dist/es/chunks/index.js +374 -216
- package/dist/es/chunks/p-btn.js +2 -2
- package/dist/es/dateLocale.js +1221 -280
- package/dist/es/index.js +48 -37
- package/dist/es/inputClasses.js +4 -4
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -2
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -2
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +3 -1
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +2 -2
- package/package.json +31 -31
- package/squirrel/components/p-btn/p-btn.spec.js +15 -5
- package/squirrel/components/p-drawer/p-drawer.spec.js +16 -11
- package/squirrel/components/p-dropdown/p-dropdown.spec.js +15 -10
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +44 -27
- package/squirrel/components/p-pagination/p-pagination.spec.js +22 -30
- package/squirrel/components/p-select-btn/p-select-btn.spec.js +35 -27
- package/squirrel/components/p-select-list/p-select-list.spec.js +44 -27
- package/squirrel/components/p-select-pill/p-select-pill.spec.js +7 -6
- package/squirrel/components/p-table/p-table.spec.js +50 -43
- package/squirrel/components/p-tabs-pills/p-tabs-pills.spec.js +10 -8
- package/squirrel/locales/de-DE.json +47 -0
- package/squirrel/locales/es-ES.json +47 -0
- package/squirrel/plugin/index.spec.ts +32 -12
- package/squirrel/plugin/index.ts +6 -2
- package/squirrel/utils/dateLocale.spec.ts +9 -5
- package/squirrel/utils/dateLocale.ts +7 -3
- /package/squirrel/locales/{fr-CA.json → fr-FR.json} +0 -0
package/dist/es/dateLocale.js
CHANGED
|
@@ -1,81 +1,174 @@
|
|
|
1
|
-
const formatDistanceLocale$
|
|
1
|
+
const formatDistanceLocale$3 = {
|
|
2
2
|
lessThanXSeconds: {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
standalone: {
|
|
4
|
+
one: "weniger als 1 Sekunde",
|
|
5
|
+
other: "weniger als {{count}} Sekunden"
|
|
6
|
+
},
|
|
7
|
+
withPreposition: {
|
|
8
|
+
one: "weniger als 1 Sekunde",
|
|
9
|
+
other: "weniger als {{count}} Sekunden"
|
|
10
|
+
}
|
|
5
11
|
},
|
|
6
12
|
xSeconds: {
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
standalone: {
|
|
14
|
+
one: "1 Sekunde",
|
|
15
|
+
other: "{{count}} Sekunden"
|
|
16
|
+
},
|
|
17
|
+
withPreposition: {
|
|
18
|
+
one: "1 Sekunde",
|
|
19
|
+
other: "{{count}} Sekunden"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
halfAMinute: {
|
|
23
|
+
standalone: "eine halbe Minute",
|
|
24
|
+
withPreposition: "einer halben Minute"
|
|
9
25
|
},
|
|
10
|
-
halfAMinute: "half a minute",
|
|
11
26
|
lessThanXMinutes: {
|
|
12
|
-
|
|
13
|
-
|
|
27
|
+
standalone: {
|
|
28
|
+
one: "weniger als 1 Minute",
|
|
29
|
+
other: "weniger als {{count}} Minuten"
|
|
30
|
+
},
|
|
31
|
+
withPreposition: {
|
|
32
|
+
one: "weniger als 1 Minute",
|
|
33
|
+
other: "weniger als {{count}} Minuten"
|
|
34
|
+
}
|
|
14
35
|
},
|
|
15
36
|
xMinutes: {
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
standalone: {
|
|
38
|
+
one: "1 Minute",
|
|
39
|
+
other: "{{count}} Minuten"
|
|
40
|
+
},
|
|
41
|
+
withPreposition: {
|
|
42
|
+
one: "1 Minute",
|
|
43
|
+
other: "{{count}} Minuten"
|
|
44
|
+
}
|
|
18
45
|
},
|
|
19
46
|
aboutXHours: {
|
|
20
|
-
|
|
21
|
-
|
|
47
|
+
standalone: {
|
|
48
|
+
one: "etwa 1 Stunde",
|
|
49
|
+
other: "etwa {{count}} Stunden"
|
|
50
|
+
},
|
|
51
|
+
withPreposition: {
|
|
52
|
+
one: "etwa 1 Stunde",
|
|
53
|
+
other: "etwa {{count}} Stunden"
|
|
54
|
+
}
|
|
22
55
|
},
|
|
23
56
|
xHours: {
|
|
24
|
-
|
|
25
|
-
|
|
57
|
+
standalone: {
|
|
58
|
+
one: "1 Stunde",
|
|
59
|
+
other: "{{count}} Stunden"
|
|
60
|
+
},
|
|
61
|
+
withPreposition: {
|
|
62
|
+
one: "1 Stunde",
|
|
63
|
+
other: "{{count}} Stunden"
|
|
64
|
+
}
|
|
26
65
|
},
|
|
27
66
|
xDays: {
|
|
28
|
-
|
|
29
|
-
|
|
67
|
+
standalone: {
|
|
68
|
+
one: "1 Tag",
|
|
69
|
+
other: "{{count}} Tage"
|
|
70
|
+
},
|
|
71
|
+
withPreposition: {
|
|
72
|
+
one: "1 Tag",
|
|
73
|
+
other: "{{count}} Tagen"
|
|
74
|
+
}
|
|
30
75
|
},
|
|
31
76
|
aboutXWeeks: {
|
|
32
|
-
|
|
33
|
-
|
|
77
|
+
standalone: {
|
|
78
|
+
one: "etwa 1 Woche",
|
|
79
|
+
other: "etwa {{count}} Wochen"
|
|
80
|
+
},
|
|
81
|
+
withPreposition: {
|
|
82
|
+
one: "etwa 1 Woche",
|
|
83
|
+
other: "etwa {{count}} Wochen"
|
|
84
|
+
}
|
|
34
85
|
},
|
|
35
86
|
xWeeks: {
|
|
36
|
-
|
|
37
|
-
|
|
87
|
+
standalone: {
|
|
88
|
+
one: "1 Woche",
|
|
89
|
+
other: "{{count}} Wochen"
|
|
90
|
+
},
|
|
91
|
+
withPreposition: {
|
|
92
|
+
one: "1 Woche",
|
|
93
|
+
other: "{{count}} Wochen"
|
|
94
|
+
}
|
|
38
95
|
},
|
|
39
96
|
aboutXMonths: {
|
|
40
|
-
|
|
41
|
-
|
|
97
|
+
standalone: {
|
|
98
|
+
one: "etwa 1 Monat",
|
|
99
|
+
other: "etwa {{count}} Monate"
|
|
100
|
+
},
|
|
101
|
+
withPreposition: {
|
|
102
|
+
one: "etwa 1 Monat",
|
|
103
|
+
other: "etwa {{count}} Monaten"
|
|
104
|
+
}
|
|
42
105
|
},
|
|
43
106
|
xMonths: {
|
|
44
|
-
|
|
45
|
-
|
|
107
|
+
standalone: {
|
|
108
|
+
one: "1 Monat",
|
|
109
|
+
other: "{{count}} Monate"
|
|
110
|
+
},
|
|
111
|
+
withPreposition: {
|
|
112
|
+
one: "1 Monat",
|
|
113
|
+
other: "{{count}} Monaten"
|
|
114
|
+
}
|
|
46
115
|
},
|
|
47
116
|
aboutXYears: {
|
|
48
|
-
|
|
49
|
-
|
|
117
|
+
standalone: {
|
|
118
|
+
one: "etwa 1 Jahr",
|
|
119
|
+
other: "etwa {{count}} Jahre"
|
|
120
|
+
},
|
|
121
|
+
withPreposition: {
|
|
122
|
+
one: "etwa 1 Jahr",
|
|
123
|
+
other: "etwa {{count}} Jahren"
|
|
124
|
+
}
|
|
50
125
|
},
|
|
51
126
|
xYears: {
|
|
52
|
-
|
|
53
|
-
|
|
127
|
+
standalone: {
|
|
128
|
+
one: "1 Jahr",
|
|
129
|
+
other: "{{count}} Jahre"
|
|
130
|
+
},
|
|
131
|
+
withPreposition: {
|
|
132
|
+
one: "1 Jahr",
|
|
133
|
+
other: "{{count}} Jahren"
|
|
134
|
+
}
|
|
54
135
|
},
|
|
55
136
|
overXYears: {
|
|
56
|
-
|
|
57
|
-
|
|
137
|
+
standalone: {
|
|
138
|
+
one: "mehr als 1 Jahr",
|
|
139
|
+
other: "mehr als {{count}} Jahre"
|
|
140
|
+
},
|
|
141
|
+
withPreposition: {
|
|
142
|
+
one: "mehr als 1 Jahr",
|
|
143
|
+
other: "mehr als {{count}} Jahren"
|
|
144
|
+
}
|
|
58
145
|
},
|
|
59
146
|
almostXYears: {
|
|
60
|
-
|
|
61
|
-
|
|
147
|
+
standalone: {
|
|
148
|
+
one: "fast 1 Jahr",
|
|
149
|
+
other: "fast {{count}} Jahre"
|
|
150
|
+
},
|
|
151
|
+
withPreposition: {
|
|
152
|
+
one: "fast 1 Jahr",
|
|
153
|
+
other: "fast {{count}} Jahren"
|
|
154
|
+
}
|
|
62
155
|
}
|
|
63
156
|
};
|
|
64
|
-
const formatDistance$
|
|
157
|
+
const formatDistance$3 = (token, count, options) => {
|
|
65
158
|
let result;
|
|
66
|
-
const tokenValue = formatDistanceLocale$
|
|
159
|
+
const tokenValue = options?.addSuffix ? formatDistanceLocale$3[token].withPreposition : formatDistanceLocale$3[token].standalone;
|
|
67
160
|
if (typeof tokenValue === "string") {
|
|
68
161
|
result = tokenValue;
|
|
69
162
|
} else if (count === 1) {
|
|
70
163
|
result = tokenValue.one;
|
|
71
164
|
} else {
|
|
72
|
-
result = tokenValue.other.replace("{{count}}", count
|
|
165
|
+
result = tokenValue.other.replace("{{count}}", String(count));
|
|
73
166
|
}
|
|
74
167
|
if (options?.addSuffix) {
|
|
75
168
|
if (options.comparison && options.comparison > 0) {
|
|
76
169
|
return "in " + result;
|
|
77
170
|
} else {
|
|
78
|
-
return
|
|
171
|
+
return "vor " + result;
|
|
79
172
|
}
|
|
80
173
|
}
|
|
81
174
|
return result;
|
|
@@ -87,47 +180,51 @@ function buildFormatLongFn(args) {
|
|
|
87
180
|
return format;
|
|
88
181
|
};
|
|
89
182
|
}
|
|
90
|
-
const dateFormats$
|
|
91
|
-
full: "EEEE, MMMM
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
183
|
+
const dateFormats$3 = {
|
|
184
|
+
full: "EEEE, do MMMM y",
|
|
185
|
+
// Montag, 7. Januar 2018
|
|
186
|
+
long: "do MMMM y",
|
|
187
|
+
// 7. Januar 2018
|
|
188
|
+
medium: "do MMM y",
|
|
189
|
+
// 7. Jan. 2018
|
|
190
|
+
short: "dd.MM.y"
|
|
191
|
+
// 07.01.2018
|
|
95
192
|
};
|
|
96
|
-
const timeFormats$
|
|
97
|
-
full: "
|
|
98
|
-
long: "
|
|
99
|
-
medium: "
|
|
100
|
-
short: "
|
|
193
|
+
const timeFormats$3 = {
|
|
194
|
+
full: "HH:mm:ss zzzz",
|
|
195
|
+
long: "HH:mm:ss z",
|
|
196
|
+
medium: "HH:mm:ss",
|
|
197
|
+
short: "HH:mm"
|
|
101
198
|
};
|
|
102
|
-
const dateTimeFormats$
|
|
103
|
-
full: "{{date}} '
|
|
104
|
-
long: "{{date}} '
|
|
105
|
-
medium: "{{date}}
|
|
106
|
-
short: "{{date}}
|
|
199
|
+
const dateTimeFormats$3 = {
|
|
200
|
+
full: "{{date}} 'um' {{time}}",
|
|
201
|
+
long: "{{date}} 'um' {{time}}",
|
|
202
|
+
medium: "{{date}} {{time}}",
|
|
203
|
+
short: "{{date}} {{time}}"
|
|
107
204
|
};
|
|
108
|
-
const formatLong$
|
|
205
|
+
const formatLong$3 = {
|
|
109
206
|
date: buildFormatLongFn({
|
|
110
|
-
formats: dateFormats$
|
|
207
|
+
formats: dateFormats$3,
|
|
111
208
|
defaultWidth: "full"
|
|
112
209
|
}),
|
|
113
210
|
time: buildFormatLongFn({
|
|
114
|
-
formats: timeFormats$
|
|
211
|
+
formats: timeFormats$3,
|
|
115
212
|
defaultWidth: "full"
|
|
116
213
|
}),
|
|
117
214
|
dateTime: buildFormatLongFn({
|
|
118
|
-
formats: dateTimeFormats$
|
|
215
|
+
formats: dateTimeFormats$3,
|
|
119
216
|
defaultWidth: "full"
|
|
120
217
|
})
|
|
121
218
|
};
|
|
122
|
-
const formatRelativeLocale$
|
|
123
|
-
lastWeek: "'
|
|
124
|
-
yesterday: "'
|
|
125
|
-
today: "'
|
|
126
|
-
tomorrow: "'
|
|
127
|
-
nextWeek: "eeee '
|
|
219
|
+
const formatRelativeLocale$3 = {
|
|
220
|
+
lastWeek: "'letzten' eeee 'um' p",
|
|
221
|
+
yesterday: "'gestern um' p",
|
|
222
|
+
today: "'heute um' p",
|
|
223
|
+
tomorrow: "'morgen um' p",
|
|
224
|
+
nextWeek: "eeee 'um' p",
|
|
128
225
|
other: "P"
|
|
129
226
|
};
|
|
130
|
-
const formatRelative$
|
|
227
|
+
const formatRelative$3 = (token, _date, _baseDate, _options) => formatRelativeLocale$3[token];
|
|
131
228
|
function buildLocalizeFn(args) {
|
|
132
229
|
return (value, options) => {
|
|
133
230
|
const context = options?.context ? String(options.context) : "standalone";
|
|
@@ -145,139 +242,1029 @@ function buildLocalizeFn(args) {
|
|
|
145
242
|
return valuesArray[index];
|
|
146
243
|
};
|
|
147
244
|
}
|
|
245
|
+
const eraValues$3 = {
|
|
246
|
+
narrow: ["v.Chr.", "n.Chr."],
|
|
247
|
+
abbreviated: ["v.Chr.", "n.Chr."],
|
|
248
|
+
wide: ["vor Christus", "nach Christus"]
|
|
249
|
+
};
|
|
250
|
+
const quarterValues$3 = {
|
|
251
|
+
narrow: ["1", "2", "3", "4"],
|
|
252
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
253
|
+
wide: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"]
|
|
254
|
+
};
|
|
255
|
+
const monthValues$3 = {
|
|
256
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
257
|
+
abbreviated: [
|
|
258
|
+
"Jan",
|
|
259
|
+
"Feb",
|
|
260
|
+
"Mär",
|
|
261
|
+
"Apr",
|
|
262
|
+
"Mai",
|
|
263
|
+
"Jun",
|
|
264
|
+
"Jul",
|
|
265
|
+
"Aug",
|
|
266
|
+
"Sep",
|
|
267
|
+
"Okt",
|
|
268
|
+
"Nov",
|
|
269
|
+
"Dez"
|
|
270
|
+
],
|
|
271
|
+
wide: [
|
|
272
|
+
"Januar",
|
|
273
|
+
"Februar",
|
|
274
|
+
"März",
|
|
275
|
+
"April",
|
|
276
|
+
"Mai",
|
|
277
|
+
"Juni",
|
|
278
|
+
"Juli",
|
|
279
|
+
"August",
|
|
280
|
+
"September",
|
|
281
|
+
"Oktober",
|
|
282
|
+
"November",
|
|
283
|
+
"Dezember"
|
|
284
|
+
]
|
|
285
|
+
};
|
|
286
|
+
const formattingMonthValues = {
|
|
287
|
+
narrow: monthValues$3.narrow,
|
|
288
|
+
abbreviated: [
|
|
289
|
+
"Jan.",
|
|
290
|
+
"Feb.",
|
|
291
|
+
"März",
|
|
292
|
+
"Apr.",
|
|
293
|
+
"Mai",
|
|
294
|
+
"Juni",
|
|
295
|
+
"Juli",
|
|
296
|
+
"Aug.",
|
|
297
|
+
"Sep.",
|
|
298
|
+
"Okt.",
|
|
299
|
+
"Nov.",
|
|
300
|
+
"Dez."
|
|
301
|
+
],
|
|
302
|
+
wide: monthValues$3.wide
|
|
303
|
+
};
|
|
304
|
+
const dayValues$3 = {
|
|
305
|
+
narrow: ["S", "M", "D", "M", "D", "F", "S"],
|
|
306
|
+
short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
|
|
307
|
+
abbreviated: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
|
|
308
|
+
wide: [
|
|
309
|
+
"Sonntag",
|
|
310
|
+
"Montag",
|
|
311
|
+
"Dienstag",
|
|
312
|
+
"Mittwoch",
|
|
313
|
+
"Donnerstag",
|
|
314
|
+
"Freitag",
|
|
315
|
+
"Samstag"
|
|
316
|
+
]
|
|
317
|
+
};
|
|
318
|
+
const dayPeriodValues$3 = {
|
|
319
|
+
narrow: {
|
|
320
|
+
am: "vm.",
|
|
321
|
+
pm: "nm.",
|
|
322
|
+
midnight: "Mitternacht",
|
|
323
|
+
noon: "Mittag",
|
|
324
|
+
morning: "Morgen",
|
|
325
|
+
afternoon: "Nachm.",
|
|
326
|
+
evening: "Abend",
|
|
327
|
+
night: "Nacht"
|
|
328
|
+
},
|
|
329
|
+
abbreviated: {
|
|
330
|
+
am: "vorm.",
|
|
331
|
+
pm: "nachm.",
|
|
332
|
+
midnight: "Mitternacht",
|
|
333
|
+
noon: "Mittag",
|
|
334
|
+
morning: "Morgen",
|
|
335
|
+
afternoon: "Nachmittag",
|
|
336
|
+
evening: "Abend",
|
|
337
|
+
night: "Nacht"
|
|
338
|
+
},
|
|
339
|
+
wide: {
|
|
340
|
+
am: "vormittags",
|
|
341
|
+
pm: "nachmittags",
|
|
342
|
+
midnight: "Mitternacht",
|
|
343
|
+
noon: "Mittag",
|
|
344
|
+
morning: "Morgen",
|
|
345
|
+
afternoon: "Nachmittag",
|
|
346
|
+
evening: "Abend",
|
|
347
|
+
night: "Nacht"
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
const formattingDayPeriodValues$2 = {
|
|
351
|
+
narrow: {
|
|
352
|
+
am: "vm.",
|
|
353
|
+
pm: "nm.",
|
|
354
|
+
midnight: "Mitternacht",
|
|
355
|
+
noon: "Mittag",
|
|
356
|
+
morning: "morgens",
|
|
357
|
+
afternoon: "nachm.",
|
|
358
|
+
evening: "abends",
|
|
359
|
+
night: "nachts"
|
|
360
|
+
},
|
|
361
|
+
abbreviated: {
|
|
362
|
+
am: "vorm.",
|
|
363
|
+
pm: "nachm.",
|
|
364
|
+
midnight: "Mitternacht",
|
|
365
|
+
noon: "Mittag",
|
|
366
|
+
morning: "morgens",
|
|
367
|
+
afternoon: "nachmittags",
|
|
368
|
+
evening: "abends",
|
|
369
|
+
night: "nachts"
|
|
370
|
+
},
|
|
371
|
+
wide: {
|
|
372
|
+
am: "vormittags",
|
|
373
|
+
pm: "nachmittags",
|
|
374
|
+
midnight: "Mitternacht",
|
|
375
|
+
noon: "Mittag",
|
|
376
|
+
morning: "morgens",
|
|
377
|
+
afternoon: "nachmittags",
|
|
378
|
+
evening: "abends",
|
|
379
|
+
night: "nachts"
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
const ordinalNumber$3 = (dirtyNumber) => {
|
|
383
|
+
const number = Number(dirtyNumber);
|
|
384
|
+
return number + ".";
|
|
385
|
+
};
|
|
386
|
+
const localize$3 = {
|
|
387
|
+
ordinalNumber: ordinalNumber$3,
|
|
388
|
+
era: buildLocalizeFn({
|
|
389
|
+
values: eraValues$3,
|
|
390
|
+
defaultWidth: "wide"
|
|
391
|
+
}),
|
|
392
|
+
quarter: buildLocalizeFn({
|
|
393
|
+
values: quarterValues$3,
|
|
394
|
+
defaultWidth: "wide",
|
|
395
|
+
argumentCallback: (quarter) => quarter - 1
|
|
396
|
+
}),
|
|
397
|
+
month: buildLocalizeFn({
|
|
398
|
+
values: monthValues$3,
|
|
399
|
+
formattingValues: formattingMonthValues,
|
|
400
|
+
defaultWidth: "wide"
|
|
401
|
+
}),
|
|
402
|
+
day: buildLocalizeFn({
|
|
403
|
+
values: dayValues$3,
|
|
404
|
+
defaultWidth: "wide"
|
|
405
|
+
}),
|
|
406
|
+
dayPeriod: buildLocalizeFn({
|
|
407
|
+
values: dayPeriodValues$3,
|
|
408
|
+
defaultWidth: "wide",
|
|
409
|
+
formattingValues: formattingDayPeriodValues$2,
|
|
410
|
+
defaultFormattingWidth: "wide"
|
|
411
|
+
})
|
|
412
|
+
};
|
|
413
|
+
function buildMatchFn(args) {
|
|
414
|
+
return (string, options = {}) => {
|
|
415
|
+
const width = options.width;
|
|
416
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
417
|
+
const matchResult = string.match(matchPattern);
|
|
418
|
+
if (!matchResult) {
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
const matchedString = matchResult[0];
|
|
422
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
423
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
424
|
+
// [TODO] -- I challenge you to fix the type
|
|
425
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
426
|
+
);
|
|
427
|
+
let value;
|
|
428
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
429
|
+
value = options.valueCallback ? (
|
|
430
|
+
// [TODO] -- I challenge you to fix the type
|
|
431
|
+
options.valueCallback(value)
|
|
432
|
+
) : value;
|
|
433
|
+
const rest = string.slice(matchedString.length);
|
|
434
|
+
return { value, rest };
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
function findKey(object, predicate) {
|
|
438
|
+
for (const key in object) {
|
|
439
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
440
|
+
return key;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return void 0;
|
|
444
|
+
}
|
|
445
|
+
function findIndex(array, predicate) {
|
|
446
|
+
for (let key = 0; key < array.length; key++) {
|
|
447
|
+
if (predicate(array[key])) {
|
|
448
|
+
return key;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return void 0;
|
|
452
|
+
}
|
|
453
|
+
function buildMatchPatternFn(args) {
|
|
454
|
+
return (string, options = {}) => {
|
|
455
|
+
const matchResult = string.match(args.matchPattern);
|
|
456
|
+
if (!matchResult) return null;
|
|
457
|
+
const matchedString = matchResult[0];
|
|
458
|
+
const parseResult = string.match(args.parsePattern);
|
|
459
|
+
if (!parseResult) return null;
|
|
460
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
461
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
462
|
+
const rest = string.slice(matchedString.length);
|
|
463
|
+
return { value, rest };
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
const matchOrdinalNumberPattern$3 = /^(\d+)(\.)?/i;
|
|
467
|
+
const parseOrdinalNumberPattern$3 = /\d+/i;
|
|
468
|
+
const matchEraPatterns$3 = {
|
|
469
|
+
narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
|
|
470
|
+
abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
|
|
471
|
+
wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
|
|
472
|
+
};
|
|
473
|
+
const parseEraPatterns$3 = {
|
|
474
|
+
any: [/^v/i, /^n/i]
|
|
475
|
+
};
|
|
476
|
+
const matchQuarterPatterns$3 = {
|
|
477
|
+
narrow: /^[1234]/i,
|
|
478
|
+
abbreviated: /^q[1234]/i,
|
|
479
|
+
wide: /^[1234](\.)? Quartal/i
|
|
480
|
+
};
|
|
481
|
+
const parseQuarterPatterns$3 = {
|
|
482
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
483
|
+
};
|
|
484
|
+
const matchMonthPatterns$3 = {
|
|
485
|
+
narrow: /^[jfmasond]/i,
|
|
486
|
+
abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
|
|
487
|
+
wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
|
|
488
|
+
};
|
|
489
|
+
const parseMonthPatterns$3 = {
|
|
490
|
+
narrow: [
|
|
491
|
+
/^j/i,
|
|
492
|
+
/^f/i,
|
|
493
|
+
/^m/i,
|
|
494
|
+
/^a/i,
|
|
495
|
+
/^m/i,
|
|
496
|
+
/^j/i,
|
|
497
|
+
/^j/i,
|
|
498
|
+
/^a/i,
|
|
499
|
+
/^s/i,
|
|
500
|
+
/^o/i,
|
|
501
|
+
/^n/i,
|
|
502
|
+
/^d/i
|
|
503
|
+
],
|
|
504
|
+
any: [
|
|
505
|
+
/^j[aä]/i,
|
|
506
|
+
/^f/i,
|
|
507
|
+
/^mär/i,
|
|
508
|
+
/^ap/i,
|
|
509
|
+
/^mai/i,
|
|
510
|
+
/^jun/i,
|
|
511
|
+
/^jul/i,
|
|
512
|
+
/^au/i,
|
|
513
|
+
/^s/i,
|
|
514
|
+
/^o/i,
|
|
515
|
+
/^n/i,
|
|
516
|
+
/^d/i
|
|
517
|
+
]
|
|
518
|
+
};
|
|
519
|
+
const matchDayPatterns$3 = {
|
|
520
|
+
narrow: /^[smdmf]/i,
|
|
521
|
+
short: /^(so|mo|di|mi|do|fr|sa)/i,
|
|
522
|
+
abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
|
|
523
|
+
wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
|
|
524
|
+
};
|
|
525
|
+
const parseDayPatterns$3 = {
|
|
526
|
+
any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i]
|
|
527
|
+
};
|
|
528
|
+
const matchDayPeriodPatterns$3 = {
|
|
529
|
+
narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
|
|
530
|
+
abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
|
|
531
|
+
wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
|
|
532
|
+
};
|
|
533
|
+
const parseDayPeriodPatterns$3 = {
|
|
534
|
+
any: {
|
|
535
|
+
am: /^v/i,
|
|
536
|
+
pm: /^n/i,
|
|
537
|
+
midnight: /^Mitte/i,
|
|
538
|
+
noon: /^Mitta/i,
|
|
539
|
+
morning: /morgens/i,
|
|
540
|
+
afternoon: /nachmittags/i,
|
|
541
|
+
// will never be matched. Afternoon is matched by `pm`
|
|
542
|
+
evening: /abends/i,
|
|
543
|
+
night: /nachts/i
|
|
544
|
+
// will never be matched. Night is matched by `pm`
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
const match$3 = {
|
|
548
|
+
ordinalNumber: buildMatchPatternFn({
|
|
549
|
+
matchPattern: matchOrdinalNumberPattern$3,
|
|
550
|
+
parsePattern: parseOrdinalNumberPattern$3,
|
|
551
|
+
valueCallback: (value) => parseInt(value)
|
|
552
|
+
}),
|
|
553
|
+
era: buildMatchFn({
|
|
554
|
+
matchPatterns: matchEraPatterns$3,
|
|
555
|
+
defaultMatchWidth: "wide",
|
|
556
|
+
parsePatterns: parseEraPatterns$3,
|
|
557
|
+
defaultParseWidth: "any"
|
|
558
|
+
}),
|
|
559
|
+
quarter: buildMatchFn({
|
|
560
|
+
matchPatterns: matchQuarterPatterns$3,
|
|
561
|
+
defaultMatchWidth: "wide",
|
|
562
|
+
parsePatterns: parseQuarterPatterns$3,
|
|
563
|
+
defaultParseWidth: "any",
|
|
564
|
+
valueCallback: (index) => index + 1
|
|
565
|
+
}),
|
|
566
|
+
month: buildMatchFn({
|
|
567
|
+
matchPatterns: matchMonthPatterns$3,
|
|
568
|
+
defaultMatchWidth: "wide",
|
|
569
|
+
parsePatterns: parseMonthPatterns$3,
|
|
570
|
+
defaultParseWidth: "any"
|
|
571
|
+
}),
|
|
572
|
+
day: buildMatchFn({
|
|
573
|
+
matchPatterns: matchDayPatterns$3,
|
|
574
|
+
defaultMatchWidth: "wide",
|
|
575
|
+
parsePatterns: parseDayPatterns$3,
|
|
576
|
+
defaultParseWidth: "any"
|
|
577
|
+
}),
|
|
578
|
+
dayPeriod: buildMatchFn({
|
|
579
|
+
matchPatterns: matchDayPeriodPatterns$3,
|
|
580
|
+
defaultMatchWidth: "wide",
|
|
581
|
+
parsePatterns: parseDayPeriodPatterns$3,
|
|
582
|
+
defaultParseWidth: "any"
|
|
583
|
+
})
|
|
584
|
+
};
|
|
585
|
+
const de = {
|
|
586
|
+
code: "de",
|
|
587
|
+
formatDistance: formatDistance$3,
|
|
588
|
+
formatLong: formatLong$3,
|
|
589
|
+
formatRelative: formatRelative$3,
|
|
590
|
+
localize: localize$3,
|
|
591
|
+
match: match$3,
|
|
592
|
+
options: {
|
|
593
|
+
weekStartsOn: 1,
|
|
594
|
+
firstWeekContainsDate: 4
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
const formatDistanceLocale$2 = {
|
|
598
|
+
lessThanXSeconds: {
|
|
599
|
+
one: "less than a second",
|
|
600
|
+
other: "less than {{count}} seconds"
|
|
601
|
+
},
|
|
602
|
+
xSeconds: {
|
|
603
|
+
one: "1 second",
|
|
604
|
+
other: "{{count}} seconds"
|
|
605
|
+
},
|
|
606
|
+
halfAMinute: "half a minute",
|
|
607
|
+
lessThanXMinutes: {
|
|
608
|
+
one: "less than a minute",
|
|
609
|
+
other: "less than {{count}} minutes"
|
|
610
|
+
},
|
|
611
|
+
xMinutes: {
|
|
612
|
+
one: "1 minute",
|
|
613
|
+
other: "{{count}} minutes"
|
|
614
|
+
},
|
|
615
|
+
aboutXHours: {
|
|
616
|
+
one: "about 1 hour",
|
|
617
|
+
other: "about {{count}} hours"
|
|
618
|
+
},
|
|
619
|
+
xHours: {
|
|
620
|
+
one: "1 hour",
|
|
621
|
+
other: "{{count}} hours"
|
|
622
|
+
},
|
|
623
|
+
xDays: {
|
|
624
|
+
one: "1 day",
|
|
625
|
+
other: "{{count}} days"
|
|
626
|
+
},
|
|
627
|
+
aboutXWeeks: {
|
|
628
|
+
one: "about 1 week",
|
|
629
|
+
other: "about {{count}} weeks"
|
|
630
|
+
},
|
|
631
|
+
xWeeks: {
|
|
632
|
+
one: "1 week",
|
|
633
|
+
other: "{{count}} weeks"
|
|
634
|
+
},
|
|
635
|
+
aboutXMonths: {
|
|
636
|
+
one: "about 1 month",
|
|
637
|
+
other: "about {{count}} months"
|
|
638
|
+
},
|
|
639
|
+
xMonths: {
|
|
640
|
+
one: "1 month",
|
|
641
|
+
other: "{{count}} months"
|
|
642
|
+
},
|
|
643
|
+
aboutXYears: {
|
|
644
|
+
one: "about 1 year",
|
|
645
|
+
other: "about {{count}} years"
|
|
646
|
+
},
|
|
647
|
+
xYears: {
|
|
648
|
+
one: "1 year",
|
|
649
|
+
other: "{{count}} years"
|
|
650
|
+
},
|
|
651
|
+
overXYears: {
|
|
652
|
+
one: "over 1 year",
|
|
653
|
+
other: "over {{count}} years"
|
|
654
|
+
},
|
|
655
|
+
almostXYears: {
|
|
656
|
+
one: "almost 1 year",
|
|
657
|
+
other: "almost {{count}} years"
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
const formatDistance$2 = (token, count, options) => {
|
|
661
|
+
let result;
|
|
662
|
+
const tokenValue = formatDistanceLocale$2[token];
|
|
663
|
+
if (typeof tokenValue === "string") {
|
|
664
|
+
result = tokenValue;
|
|
665
|
+
} else if (count === 1) {
|
|
666
|
+
result = tokenValue.one;
|
|
667
|
+
} else {
|
|
668
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
669
|
+
}
|
|
670
|
+
if (options?.addSuffix) {
|
|
671
|
+
if (options.comparison && options.comparison > 0) {
|
|
672
|
+
return "in " + result;
|
|
673
|
+
} else {
|
|
674
|
+
return result + " ago";
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
return result;
|
|
678
|
+
};
|
|
679
|
+
const dateFormats$2 = {
|
|
680
|
+
full: "EEEE, MMMM do, y",
|
|
681
|
+
long: "MMMM do, y",
|
|
682
|
+
medium: "MMM d, y",
|
|
683
|
+
short: "MM/dd/yyyy"
|
|
684
|
+
};
|
|
685
|
+
const timeFormats$2 = {
|
|
686
|
+
full: "h:mm:ss a zzzz",
|
|
687
|
+
long: "h:mm:ss a z",
|
|
688
|
+
medium: "h:mm:ss a",
|
|
689
|
+
short: "h:mm a"
|
|
690
|
+
};
|
|
691
|
+
const dateTimeFormats$2 = {
|
|
692
|
+
full: "{{date}} 'at' {{time}}",
|
|
693
|
+
long: "{{date}} 'at' {{time}}",
|
|
694
|
+
medium: "{{date}}, {{time}}",
|
|
695
|
+
short: "{{date}}, {{time}}"
|
|
696
|
+
};
|
|
697
|
+
const formatLong$2 = {
|
|
698
|
+
date: buildFormatLongFn({
|
|
699
|
+
formats: dateFormats$2,
|
|
700
|
+
defaultWidth: "full"
|
|
701
|
+
}),
|
|
702
|
+
time: buildFormatLongFn({
|
|
703
|
+
formats: timeFormats$2,
|
|
704
|
+
defaultWidth: "full"
|
|
705
|
+
}),
|
|
706
|
+
dateTime: buildFormatLongFn({
|
|
707
|
+
formats: dateTimeFormats$2,
|
|
708
|
+
defaultWidth: "full"
|
|
709
|
+
})
|
|
710
|
+
};
|
|
711
|
+
const formatRelativeLocale$2 = {
|
|
712
|
+
lastWeek: "'last' eeee 'at' p",
|
|
713
|
+
yesterday: "'yesterday at' p",
|
|
714
|
+
today: "'today at' p",
|
|
715
|
+
tomorrow: "'tomorrow at' p",
|
|
716
|
+
nextWeek: "eeee 'at' p",
|
|
717
|
+
other: "P"
|
|
718
|
+
};
|
|
719
|
+
const formatRelative$2 = (token, _date, _baseDate, _options) => formatRelativeLocale$2[token];
|
|
720
|
+
const eraValues$2 = {
|
|
721
|
+
narrow: ["B", "A"],
|
|
722
|
+
abbreviated: ["BC", "AD"],
|
|
723
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
724
|
+
};
|
|
725
|
+
const quarterValues$2 = {
|
|
726
|
+
narrow: ["1", "2", "3", "4"],
|
|
727
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
728
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
729
|
+
};
|
|
730
|
+
const monthValues$2 = {
|
|
731
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
732
|
+
abbreviated: [
|
|
733
|
+
"Jan",
|
|
734
|
+
"Feb",
|
|
735
|
+
"Mar",
|
|
736
|
+
"Apr",
|
|
737
|
+
"May",
|
|
738
|
+
"Jun",
|
|
739
|
+
"Jul",
|
|
740
|
+
"Aug",
|
|
741
|
+
"Sep",
|
|
742
|
+
"Oct",
|
|
743
|
+
"Nov",
|
|
744
|
+
"Dec"
|
|
745
|
+
],
|
|
746
|
+
wide: [
|
|
747
|
+
"January",
|
|
748
|
+
"February",
|
|
749
|
+
"March",
|
|
750
|
+
"April",
|
|
751
|
+
"May",
|
|
752
|
+
"June",
|
|
753
|
+
"July",
|
|
754
|
+
"August",
|
|
755
|
+
"September",
|
|
756
|
+
"October",
|
|
757
|
+
"November",
|
|
758
|
+
"December"
|
|
759
|
+
]
|
|
760
|
+
};
|
|
761
|
+
const dayValues$2 = {
|
|
762
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
763
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
764
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
765
|
+
wide: [
|
|
766
|
+
"Sunday",
|
|
767
|
+
"Monday",
|
|
768
|
+
"Tuesday",
|
|
769
|
+
"Wednesday",
|
|
770
|
+
"Thursday",
|
|
771
|
+
"Friday",
|
|
772
|
+
"Saturday"
|
|
773
|
+
]
|
|
774
|
+
};
|
|
775
|
+
const dayPeriodValues$2 = {
|
|
776
|
+
narrow: {
|
|
777
|
+
am: "a",
|
|
778
|
+
pm: "p",
|
|
779
|
+
midnight: "mi",
|
|
780
|
+
noon: "n",
|
|
781
|
+
morning: "morning",
|
|
782
|
+
afternoon: "afternoon",
|
|
783
|
+
evening: "evening",
|
|
784
|
+
night: "night"
|
|
785
|
+
},
|
|
786
|
+
abbreviated: {
|
|
787
|
+
am: "AM",
|
|
788
|
+
pm: "PM",
|
|
789
|
+
midnight: "midnight",
|
|
790
|
+
noon: "noon",
|
|
791
|
+
morning: "morning",
|
|
792
|
+
afternoon: "afternoon",
|
|
793
|
+
evening: "evening",
|
|
794
|
+
night: "night"
|
|
795
|
+
},
|
|
796
|
+
wide: {
|
|
797
|
+
am: "a.m.",
|
|
798
|
+
pm: "p.m.",
|
|
799
|
+
midnight: "midnight",
|
|
800
|
+
noon: "noon",
|
|
801
|
+
morning: "morning",
|
|
802
|
+
afternoon: "afternoon",
|
|
803
|
+
evening: "evening",
|
|
804
|
+
night: "night"
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
const formattingDayPeriodValues$1 = {
|
|
808
|
+
narrow: {
|
|
809
|
+
am: "a",
|
|
810
|
+
pm: "p",
|
|
811
|
+
midnight: "mi",
|
|
812
|
+
noon: "n",
|
|
813
|
+
morning: "in the morning",
|
|
814
|
+
afternoon: "in the afternoon",
|
|
815
|
+
evening: "in the evening",
|
|
816
|
+
night: "at night"
|
|
817
|
+
},
|
|
818
|
+
abbreviated: {
|
|
819
|
+
am: "AM",
|
|
820
|
+
pm: "PM",
|
|
821
|
+
midnight: "midnight",
|
|
822
|
+
noon: "noon",
|
|
823
|
+
morning: "in the morning",
|
|
824
|
+
afternoon: "in the afternoon",
|
|
825
|
+
evening: "in the evening",
|
|
826
|
+
night: "at night"
|
|
827
|
+
},
|
|
828
|
+
wide: {
|
|
829
|
+
am: "a.m.",
|
|
830
|
+
pm: "p.m.",
|
|
831
|
+
midnight: "midnight",
|
|
832
|
+
noon: "noon",
|
|
833
|
+
morning: "in the morning",
|
|
834
|
+
afternoon: "in the afternoon",
|
|
835
|
+
evening: "in the evening",
|
|
836
|
+
night: "at night"
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
const ordinalNumber$2 = (dirtyNumber, _options) => {
|
|
840
|
+
const number = Number(dirtyNumber);
|
|
841
|
+
const rem100 = number % 100;
|
|
842
|
+
if (rem100 > 20 || rem100 < 10) {
|
|
843
|
+
switch (rem100 % 10) {
|
|
844
|
+
case 1:
|
|
845
|
+
return number + "st";
|
|
846
|
+
case 2:
|
|
847
|
+
return number + "nd";
|
|
848
|
+
case 3:
|
|
849
|
+
return number + "rd";
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
return number + "th";
|
|
853
|
+
};
|
|
854
|
+
const localize$2 = {
|
|
855
|
+
ordinalNumber: ordinalNumber$2,
|
|
856
|
+
era: buildLocalizeFn({
|
|
857
|
+
values: eraValues$2,
|
|
858
|
+
defaultWidth: "wide"
|
|
859
|
+
}),
|
|
860
|
+
quarter: buildLocalizeFn({
|
|
861
|
+
values: quarterValues$2,
|
|
862
|
+
defaultWidth: "wide",
|
|
863
|
+
argumentCallback: (quarter) => quarter - 1
|
|
864
|
+
}),
|
|
865
|
+
month: buildLocalizeFn({
|
|
866
|
+
values: monthValues$2,
|
|
867
|
+
defaultWidth: "wide"
|
|
868
|
+
}),
|
|
869
|
+
day: buildLocalizeFn({
|
|
870
|
+
values: dayValues$2,
|
|
871
|
+
defaultWidth: "wide"
|
|
872
|
+
}),
|
|
873
|
+
dayPeriod: buildLocalizeFn({
|
|
874
|
+
values: dayPeriodValues$2,
|
|
875
|
+
defaultWidth: "wide",
|
|
876
|
+
formattingValues: formattingDayPeriodValues$1,
|
|
877
|
+
defaultFormattingWidth: "wide"
|
|
878
|
+
})
|
|
879
|
+
};
|
|
880
|
+
const matchOrdinalNumberPattern$2 = /^(\d+)(th|st|nd|rd)?/i;
|
|
881
|
+
const parseOrdinalNumberPattern$2 = /\d+/i;
|
|
882
|
+
const matchEraPatterns$2 = {
|
|
883
|
+
narrow: /^(b|a)/i,
|
|
884
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
885
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
886
|
+
};
|
|
887
|
+
const parseEraPatterns$2 = {
|
|
888
|
+
any: [/^b/i, /^(a|c)/i]
|
|
889
|
+
};
|
|
890
|
+
const matchQuarterPatterns$2 = {
|
|
891
|
+
narrow: /^[1234]/i,
|
|
892
|
+
abbreviated: /^q[1234]/i,
|
|
893
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
894
|
+
};
|
|
895
|
+
const parseQuarterPatterns$2 = {
|
|
896
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
897
|
+
};
|
|
898
|
+
const matchMonthPatterns$2 = {
|
|
899
|
+
narrow: /^[jfmasond]/i,
|
|
900
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
901
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
902
|
+
};
|
|
903
|
+
const parseMonthPatterns$2 = {
|
|
904
|
+
narrow: [
|
|
905
|
+
/^j/i,
|
|
906
|
+
/^f/i,
|
|
907
|
+
/^m/i,
|
|
908
|
+
/^a/i,
|
|
909
|
+
/^m/i,
|
|
910
|
+
/^j/i,
|
|
911
|
+
/^j/i,
|
|
912
|
+
/^a/i,
|
|
913
|
+
/^s/i,
|
|
914
|
+
/^o/i,
|
|
915
|
+
/^n/i,
|
|
916
|
+
/^d/i
|
|
917
|
+
],
|
|
918
|
+
any: [
|
|
919
|
+
/^ja/i,
|
|
920
|
+
/^f/i,
|
|
921
|
+
/^mar/i,
|
|
922
|
+
/^ap/i,
|
|
923
|
+
/^may/i,
|
|
924
|
+
/^jun/i,
|
|
925
|
+
/^jul/i,
|
|
926
|
+
/^au/i,
|
|
927
|
+
/^s/i,
|
|
928
|
+
/^o/i,
|
|
929
|
+
/^n/i,
|
|
930
|
+
/^d/i
|
|
931
|
+
]
|
|
932
|
+
};
|
|
933
|
+
const matchDayPatterns$2 = {
|
|
934
|
+
narrow: /^[smtwf]/i,
|
|
935
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
936
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
937
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
938
|
+
};
|
|
939
|
+
const parseDayPatterns$2 = {
|
|
940
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
941
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
942
|
+
};
|
|
943
|
+
const matchDayPeriodPatterns$2 = {
|
|
944
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
945
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
946
|
+
};
|
|
947
|
+
const parseDayPeriodPatterns$2 = {
|
|
948
|
+
any: {
|
|
949
|
+
am: /^a/i,
|
|
950
|
+
pm: /^p/i,
|
|
951
|
+
midnight: /^mi/i,
|
|
952
|
+
noon: /^no/i,
|
|
953
|
+
morning: /morning/i,
|
|
954
|
+
afternoon: /afternoon/i,
|
|
955
|
+
evening: /evening/i,
|
|
956
|
+
night: /night/i
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
const match$2 = {
|
|
960
|
+
ordinalNumber: buildMatchPatternFn({
|
|
961
|
+
matchPattern: matchOrdinalNumberPattern$2,
|
|
962
|
+
parsePattern: parseOrdinalNumberPattern$2,
|
|
963
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
964
|
+
}),
|
|
965
|
+
era: buildMatchFn({
|
|
966
|
+
matchPatterns: matchEraPatterns$2,
|
|
967
|
+
defaultMatchWidth: "wide",
|
|
968
|
+
parsePatterns: parseEraPatterns$2,
|
|
969
|
+
defaultParseWidth: "any"
|
|
970
|
+
}),
|
|
971
|
+
quarter: buildMatchFn({
|
|
972
|
+
matchPatterns: matchQuarterPatterns$2,
|
|
973
|
+
defaultMatchWidth: "wide",
|
|
974
|
+
parsePatterns: parseQuarterPatterns$2,
|
|
975
|
+
defaultParseWidth: "any",
|
|
976
|
+
valueCallback: (index) => index + 1
|
|
977
|
+
}),
|
|
978
|
+
month: buildMatchFn({
|
|
979
|
+
matchPatterns: matchMonthPatterns$2,
|
|
980
|
+
defaultMatchWidth: "wide",
|
|
981
|
+
parsePatterns: parseMonthPatterns$2,
|
|
982
|
+
defaultParseWidth: "any"
|
|
983
|
+
}),
|
|
984
|
+
day: buildMatchFn({
|
|
985
|
+
matchPatterns: matchDayPatterns$2,
|
|
986
|
+
defaultMatchWidth: "wide",
|
|
987
|
+
parsePatterns: parseDayPatterns$2,
|
|
988
|
+
defaultParseWidth: "any"
|
|
989
|
+
}),
|
|
990
|
+
dayPeriod: buildMatchFn({
|
|
991
|
+
matchPatterns: matchDayPeriodPatterns$2,
|
|
992
|
+
defaultMatchWidth: "any",
|
|
993
|
+
parsePatterns: parseDayPeriodPatterns$2,
|
|
994
|
+
defaultParseWidth: "any"
|
|
995
|
+
})
|
|
996
|
+
};
|
|
997
|
+
const enUS = {
|
|
998
|
+
code: "en-US",
|
|
999
|
+
formatDistance: formatDistance$2,
|
|
1000
|
+
formatLong: formatLong$2,
|
|
1001
|
+
formatRelative: formatRelative$2,
|
|
1002
|
+
localize: localize$2,
|
|
1003
|
+
match: match$2,
|
|
1004
|
+
options: {
|
|
1005
|
+
weekStartsOn: 0,
|
|
1006
|
+
firstWeekContainsDate: 1
|
|
1007
|
+
}
|
|
1008
|
+
};
|
|
1009
|
+
const formatDistanceLocale$1 = {
|
|
1010
|
+
lessThanXSeconds: {
|
|
1011
|
+
one: "menos de un segundo",
|
|
1012
|
+
other: "menos de {{count}} segundos"
|
|
1013
|
+
},
|
|
1014
|
+
xSeconds: {
|
|
1015
|
+
one: "1 segundo",
|
|
1016
|
+
other: "{{count}} segundos"
|
|
1017
|
+
},
|
|
1018
|
+
halfAMinute: "medio minuto",
|
|
1019
|
+
lessThanXMinutes: {
|
|
1020
|
+
one: "menos de un minuto",
|
|
1021
|
+
other: "menos de {{count}} minutos"
|
|
1022
|
+
},
|
|
1023
|
+
xMinutes: {
|
|
1024
|
+
one: "1 minuto",
|
|
1025
|
+
other: "{{count}} minutos"
|
|
1026
|
+
},
|
|
1027
|
+
aboutXHours: {
|
|
1028
|
+
one: "alrededor de 1 hora",
|
|
1029
|
+
other: "alrededor de {{count}} horas"
|
|
1030
|
+
},
|
|
1031
|
+
xHours: {
|
|
1032
|
+
one: "1 hora",
|
|
1033
|
+
other: "{{count}} horas"
|
|
1034
|
+
},
|
|
1035
|
+
xDays: {
|
|
1036
|
+
one: "1 día",
|
|
1037
|
+
other: "{{count}} días"
|
|
1038
|
+
},
|
|
1039
|
+
aboutXWeeks: {
|
|
1040
|
+
one: "alrededor de 1 semana",
|
|
1041
|
+
other: "alrededor de {{count}} semanas"
|
|
1042
|
+
},
|
|
1043
|
+
xWeeks: {
|
|
1044
|
+
one: "1 semana",
|
|
1045
|
+
other: "{{count}} semanas"
|
|
1046
|
+
},
|
|
1047
|
+
aboutXMonths: {
|
|
1048
|
+
one: "alrededor de 1 mes",
|
|
1049
|
+
other: "alrededor de {{count}} meses"
|
|
1050
|
+
},
|
|
1051
|
+
xMonths: {
|
|
1052
|
+
one: "1 mes",
|
|
1053
|
+
other: "{{count}} meses"
|
|
1054
|
+
},
|
|
1055
|
+
aboutXYears: {
|
|
1056
|
+
one: "alrededor de 1 año",
|
|
1057
|
+
other: "alrededor de {{count}} años"
|
|
1058
|
+
},
|
|
1059
|
+
xYears: {
|
|
1060
|
+
one: "1 año",
|
|
1061
|
+
other: "{{count}} años"
|
|
1062
|
+
},
|
|
1063
|
+
overXYears: {
|
|
1064
|
+
one: "más de 1 año",
|
|
1065
|
+
other: "más de {{count}} años"
|
|
1066
|
+
},
|
|
1067
|
+
almostXYears: {
|
|
1068
|
+
one: "casi 1 año",
|
|
1069
|
+
other: "casi {{count}} años"
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
const formatDistance$1 = (token, count, options) => {
|
|
1073
|
+
let result;
|
|
1074
|
+
const tokenValue = formatDistanceLocale$1[token];
|
|
1075
|
+
if (typeof tokenValue === "string") {
|
|
1076
|
+
result = tokenValue;
|
|
1077
|
+
} else if (count === 1) {
|
|
1078
|
+
result = tokenValue.one;
|
|
1079
|
+
} else {
|
|
1080
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
1081
|
+
}
|
|
1082
|
+
if (options?.addSuffix) {
|
|
1083
|
+
if (options.comparison && options.comparison > 0) {
|
|
1084
|
+
return "en " + result;
|
|
1085
|
+
} else {
|
|
1086
|
+
return "hace " + result;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
return result;
|
|
1090
|
+
};
|
|
1091
|
+
const dateFormats$1 = {
|
|
1092
|
+
full: "EEEE, d 'de' MMMM 'de' y",
|
|
1093
|
+
long: "d 'de' MMMM 'de' y",
|
|
1094
|
+
medium: "d MMM y",
|
|
1095
|
+
short: "dd/MM/y"
|
|
1096
|
+
};
|
|
1097
|
+
const timeFormats$1 = {
|
|
1098
|
+
full: "HH:mm:ss zzzz",
|
|
1099
|
+
long: "HH:mm:ss z",
|
|
1100
|
+
medium: "HH:mm:ss",
|
|
1101
|
+
short: "HH:mm"
|
|
1102
|
+
};
|
|
1103
|
+
const dateTimeFormats$1 = {
|
|
1104
|
+
full: "{{date}} 'a las' {{time}}",
|
|
1105
|
+
long: "{{date}} 'a las' {{time}}",
|
|
1106
|
+
medium: "{{date}}, {{time}}",
|
|
1107
|
+
short: "{{date}}, {{time}}"
|
|
1108
|
+
};
|
|
1109
|
+
const formatLong$1 = {
|
|
1110
|
+
date: buildFormatLongFn({
|
|
1111
|
+
formats: dateFormats$1,
|
|
1112
|
+
defaultWidth: "full"
|
|
1113
|
+
}),
|
|
1114
|
+
time: buildFormatLongFn({
|
|
1115
|
+
formats: timeFormats$1,
|
|
1116
|
+
defaultWidth: "full"
|
|
1117
|
+
}),
|
|
1118
|
+
dateTime: buildFormatLongFn({
|
|
1119
|
+
formats: dateTimeFormats$1,
|
|
1120
|
+
defaultWidth: "full"
|
|
1121
|
+
})
|
|
1122
|
+
};
|
|
1123
|
+
const formatRelativeLocale$1 = {
|
|
1124
|
+
lastWeek: "'el' eeee 'pasado a la' p",
|
|
1125
|
+
yesterday: "'ayer a la' p",
|
|
1126
|
+
today: "'hoy a la' p",
|
|
1127
|
+
tomorrow: "'mañana a la' p",
|
|
1128
|
+
nextWeek: "eeee 'a la' p",
|
|
1129
|
+
other: "P"
|
|
1130
|
+
};
|
|
1131
|
+
const formatRelativeLocalePlural = {
|
|
1132
|
+
lastWeek: "'el' eeee 'pasado a las' p",
|
|
1133
|
+
yesterday: "'ayer a las' p",
|
|
1134
|
+
today: "'hoy a las' p",
|
|
1135
|
+
tomorrow: "'mañana a las' p",
|
|
1136
|
+
nextWeek: "eeee 'a las' p",
|
|
1137
|
+
other: "P"
|
|
1138
|
+
};
|
|
1139
|
+
const formatRelative$1 = (token, date, _baseDate, _options) => {
|
|
1140
|
+
if (date.getHours() !== 1) {
|
|
1141
|
+
return formatRelativeLocalePlural[token];
|
|
1142
|
+
} else {
|
|
1143
|
+
return formatRelativeLocale$1[token];
|
|
1144
|
+
}
|
|
1145
|
+
};
|
|
148
1146
|
const eraValues$1 = {
|
|
149
|
-
narrow: ["
|
|
150
|
-
abbreviated: ["
|
|
151
|
-
wide: ["
|
|
1147
|
+
narrow: ["AC", "DC"],
|
|
1148
|
+
abbreviated: ["AC", "DC"],
|
|
1149
|
+
wide: ["antes de cristo", "después de cristo"]
|
|
152
1150
|
};
|
|
153
1151
|
const quarterValues$1 = {
|
|
154
1152
|
narrow: ["1", "2", "3", "4"],
|
|
155
|
-
abbreviated: ["
|
|
156
|
-
wide: ["
|
|
1153
|
+
abbreviated: ["T1", "T2", "T3", "T4"],
|
|
1154
|
+
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
|
|
157
1155
|
};
|
|
158
1156
|
const monthValues$1 = {
|
|
159
|
-
narrow: ["
|
|
1157
|
+
narrow: ["e", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
|
160
1158
|
abbreviated: [
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
1159
|
+
"ene",
|
|
1160
|
+
"feb",
|
|
1161
|
+
"mar",
|
|
1162
|
+
"abr",
|
|
1163
|
+
"may",
|
|
1164
|
+
"jun",
|
|
1165
|
+
"jul",
|
|
1166
|
+
"ago",
|
|
1167
|
+
"sep",
|
|
1168
|
+
"oct",
|
|
1169
|
+
"nov",
|
|
1170
|
+
"dic"
|
|
173
1171
|
],
|
|
174
1172
|
wide: [
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
1173
|
+
"enero",
|
|
1174
|
+
"febrero",
|
|
1175
|
+
"marzo",
|
|
1176
|
+
"abril",
|
|
1177
|
+
"mayo",
|
|
1178
|
+
"junio",
|
|
1179
|
+
"julio",
|
|
1180
|
+
"agosto",
|
|
1181
|
+
"septiembre",
|
|
1182
|
+
"octubre",
|
|
1183
|
+
"noviembre",
|
|
1184
|
+
"diciembre"
|
|
187
1185
|
]
|
|
188
1186
|
};
|
|
189
1187
|
const dayValues$1 = {
|
|
190
|
-
narrow: ["
|
|
191
|
-
short: ["
|
|
192
|
-
abbreviated: ["
|
|
1188
|
+
narrow: ["d", "l", "m", "m", "j", "v", "s"],
|
|
1189
|
+
short: ["do", "lu", "ma", "mi", "ju", "vi", "sá"],
|
|
1190
|
+
abbreviated: ["dom", "lun", "mar", "mié", "jue", "vie", "sáb"],
|
|
193
1191
|
wide: [
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
1192
|
+
"domingo",
|
|
1193
|
+
"lunes",
|
|
1194
|
+
"martes",
|
|
1195
|
+
"miércoles",
|
|
1196
|
+
"jueves",
|
|
1197
|
+
"viernes",
|
|
1198
|
+
"sábado"
|
|
201
1199
|
]
|
|
202
1200
|
};
|
|
203
1201
|
const dayPeriodValues$1 = {
|
|
204
1202
|
narrow: {
|
|
205
1203
|
am: "a",
|
|
206
1204
|
pm: "p",
|
|
207
|
-
midnight: "
|
|
208
|
-
noon: "
|
|
209
|
-
morning: "
|
|
210
|
-
afternoon: "
|
|
211
|
-
evening: "
|
|
212
|
-
night: "
|
|
1205
|
+
midnight: "mn",
|
|
1206
|
+
noon: "md",
|
|
1207
|
+
morning: "mañana",
|
|
1208
|
+
afternoon: "tarde",
|
|
1209
|
+
evening: "tarde",
|
|
1210
|
+
night: "noche"
|
|
213
1211
|
},
|
|
214
1212
|
abbreviated: {
|
|
215
1213
|
am: "AM",
|
|
216
1214
|
pm: "PM",
|
|
217
|
-
midnight: "
|
|
218
|
-
noon: "
|
|
219
|
-
morning: "
|
|
220
|
-
afternoon: "
|
|
221
|
-
evening: "
|
|
222
|
-
night: "
|
|
1215
|
+
midnight: "medianoche",
|
|
1216
|
+
noon: "mediodia",
|
|
1217
|
+
morning: "mañana",
|
|
1218
|
+
afternoon: "tarde",
|
|
1219
|
+
evening: "tarde",
|
|
1220
|
+
night: "noche"
|
|
223
1221
|
},
|
|
224
1222
|
wide: {
|
|
225
1223
|
am: "a.m.",
|
|
226
1224
|
pm: "p.m.",
|
|
227
|
-
midnight: "
|
|
228
|
-
noon: "
|
|
229
|
-
morning: "
|
|
230
|
-
afternoon: "
|
|
231
|
-
evening: "
|
|
232
|
-
night: "
|
|
1225
|
+
midnight: "medianoche",
|
|
1226
|
+
noon: "mediodia",
|
|
1227
|
+
morning: "mañana",
|
|
1228
|
+
afternoon: "tarde",
|
|
1229
|
+
evening: "tarde",
|
|
1230
|
+
night: "noche"
|
|
233
1231
|
}
|
|
234
1232
|
};
|
|
235
1233
|
const formattingDayPeriodValues = {
|
|
236
1234
|
narrow: {
|
|
237
1235
|
am: "a",
|
|
238
1236
|
pm: "p",
|
|
239
|
-
midnight: "
|
|
240
|
-
noon: "
|
|
241
|
-
morning: "
|
|
242
|
-
afternoon: "
|
|
243
|
-
evening: "
|
|
244
|
-
night: "
|
|
1237
|
+
midnight: "mn",
|
|
1238
|
+
noon: "md",
|
|
1239
|
+
morning: "de la mañana",
|
|
1240
|
+
afternoon: "de la tarde",
|
|
1241
|
+
evening: "de la tarde",
|
|
1242
|
+
night: "de la noche"
|
|
245
1243
|
},
|
|
246
1244
|
abbreviated: {
|
|
247
1245
|
am: "AM",
|
|
248
1246
|
pm: "PM",
|
|
249
|
-
midnight: "
|
|
250
|
-
noon: "
|
|
251
|
-
morning: "
|
|
252
|
-
afternoon: "
|
|
253
|
-
evening: "
|
|
254
|
-
night: "
|
|
1247
|
+
midnight: "medianoche",
|
|
1248
|
+
noon: "mediodia",
|
|
1249
|
+
morning: "de la mañana",
|
|
1250
|
+
afternoon: "de la tarde",
|
|
1251
|
+
evening: "de la tarde",
|
|
1252
|
+
night: "de la noche"
|
|
255
1253
|
},
|
|
256
1254
|
wide: {
|
|
257
1255
|
am: "a.m.",
|
|
258
1256
|
pm: "p.m.",
|
|
259
|
-
midnight: "
|
|
260
|
-
noon: "
|
|
261
|
-
morning: "
|
|
262
|
-
afternoon: "
|
|
263
|
-
evening: "
|
|
264
|
-
night: "
|
|
1257
|
+
midnight: "medianoche",
|
|
1258
|
+
noon: "mediodia",
|
|
1259
|
+
morning: "de la mañana",
|
|
1260
|
+
afternoon: "de la tarde",
|
|
1261
|
+
evening: "de la tarde",
|
|
1262
|
+
night: "de la noche"
|
|
265
1263
|
}
|
|
266
1264
|
};
|
|
267
1265
|
const ordinalNumber$1 = (dirtyNumber, _options) => {
|
|
268
1266
|
const number = Number(dirtyNumber);
|
|
269
|
-
|
|
270
|
-
if (rem100 > 20 || rem100 < 10) {
|
|
271
|
-
switch (rem100 % 10) {
|
|
272
|
-
case 1:
|
|
273
|
-
return number + "st";
|
|
274
|
-
case 2:
|
|
275
|
-
return number + "nd";
|
|
276
|
-
case 3:
|
|
277
|
-
return number + "rd";
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
return number + "th";
|
|
1267
|
+
return number + "º";
|
|
281
1268
|
};
|
|
282
1269
|
const localize$1 = {
|
|
283
1270
|
ordinalNumber: ordinalNumber$1,
|
|
@@ -288,7 +1275,7 @@ const localize$1 = {
|
|
|
288
1275
|
quarter: buildLocalizeFn({
|
|
289
1276
|
values: quarterValues$1,
|
|
290
1277
|
defaultWidth: "wide",
|
|
291
|
-
argumentCallback: (quarter) => quarter - 1
|
|
1278
|
+
argumentCallback: (quarter) => Number(quarter) - 1
|
|
292
1279
|
}),
|
|
293
1280
|
month: buildLocalizeFn({
|
|
294
1281
|
values: monthValues$1,
|
|
@@ -305,85 +1292,36 @@ const localize$1 = {
|
|
|
305
1292
|
defaultFormattingWidth: "wide"
|
|
306
1293
|
})
|
|
307
1294
|
};
|
|
308
|
-
|
|
309
|
-
return (string, options = {}) => {
|
|
310
|
-
const width = options.width;
|
|
311
|
-
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
312
|
-
const matchResult = string.match(matchPattern);
|
|
313
|
-
if (!matchResult) {
|
|
314
|
-
return null;
|
|
315
|
-
}
|
|
316
|
-
const matchedString = matchResult[0];
|
|
317
|
-
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
318
|
-
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
319
|
-
// [TODO] -- I challenge you to fix the type
|
|
320
|
-
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
321
|
-
);
|
|
322
|
-
let value;
|
|
323
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
324
|
-
value = options.valueCallback ? (
|
|
325
|
-
// [TODO] -- I challenge you to fix the type
|
|
326
|
-
options.valueCallback(value)
|
|
327
|
-
) : value;
|
|
328
|
-
const rest = string.slice(matchedString.length);
|
|
329
|
-
return { value, rest };
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
function findKey(object, predicate) {
|
|
333
|
-
for (const key in object) {
|
|
334
|
-
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
335
|
-
return key;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
return void 0;
|
|
339
|
-
}
|
|
340
|
-
function findIndex(array, predicate) {
|
|
341
|
-
for (let key = 0; key < array.length; key++) {
|
|
342
|
-
if (predicate(array[key])) {
|
|
343
|
-
return key;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
return void 0;
|
|
347
|
-
}
|
|
348
|
-
function buildMatchPatternFn(args) {
|
|
349
|
-
return (string, options = {}) => {
|
|
350
|
-
const matchResult = string.match(args.matchPattern);
|
|
351
|
-
if (!matchResult) return null;
|
|
352
|
-
const matchedString = matchResult[0];
|
|
353
|
-
const parseResult = string.match(args.parsePattern);
|
|
354
|
-
if (!parseResult) return null;
|
|
355
|
-
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
356
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
357
|
-
const rest = string.slice(matchedString.length);
|
|
358
|
-
return { value, rest };
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
const matchOrdinalNumberPattern$1 = /^(\d+)(th|st|nd|rd)?/i;
|
|
1295
|
+
const matchOrdinalNumberPattern$1 = /^(\d+)(º)?/i;
|
|
362
1296
|
const parseOrdinalNumberPattern$1 = /\d+/i;
|
|
363
1297
|
const matchEraPatterns$1 = {
|
|
364
|
-
narrow: /^(
|
|
365
|
-
abbreviated: /^(
|
|
366
|
-
wide: /^(
|
|
1298
|
+
narrow: /^(ac|dc|a|d)/i,
|
|
1299
|
+
abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
|
|
1300
|
+
wide: /^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i
|
|
367
1301
|
};
|
|
368
1302
|
const parseEraPatterns$1 = {
|
|
369
|
-
any: [/^
|
|
1303
|
+
any: [/^ac/i, /^dc/i],
|
|
1304
|
+
wide: [
|
|
1305
|
+
/^(antes de cristo|antes de la era com[uú]n)/i,
|
|
1306
|
+
/^(despu[eé]s de cristo|era com[uú]n)/i
|
|
1307
|
+
]
|
|
370
1308
|
};
|
|
371
1309
|
const matchQuarterPatterns$1 = {
|
|
372
1310
|
narrow: /^[1234]/i,
|
|
373
|
-
abbreviated: /^
|
|
374
|
-
wide: /^[1234](
|
|
1311
|
+
abbreviated: /^T[1234]/i,
|
|
1312
|
+
wide: /^[1234](º)? trimestre/i
|
|
375
1313
|
};
|
|
376
1314
|
const parseQuarterPatterns$1 = {
|
|
377
1315
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
378
1316
|
};
|
|
379
1317
|
const matchMonthPatterns$1 = {
|
|
380
|
-
narrow: /^[
|
|
381
|
-
abbreviated: /^(
|
|
382
|
-
wide: /^(
|
|
1318
|
+
narrow: /^[efmajsond]/i,
|
|
1319
|
+
abbreviated: /^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,
|
|
1320
|
+
wide: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i
|
|
383
1321
|
};
|
|
384
1322
|
const parseMonthPatterns$1 = {
|
|
385
1323
|
narrow: [
|
|
386
|
-
/^
|
|
1324
|
+
/^e/i,
|
|
387
1325
|
/^f/i,
|
|
388
1326
|
/^m/i,
|
|
389
1327
|
/^a/i,
|
|
@@ -397,51 +1335,53 @@ const parseMonthPatterns$1 = {
|
|
|
397
1335
|
/^d/i
|
|
398
1336
|
],
|
|
399
1337
|
any: [
|
|
400
|
-
/^
|
|
401
|
-
/^
|
|
1338
|
+
/^en/i,
|
|
1339
|
+
/^feb/i,
|
|
402
1340
|
/^mar/i,
|
|
403
|
-
/^
|
|
1341
|
+
/^abr/i,
|
|
404
1342
|
/^may/i,
|
|
405
1343
|
/^jun/i,
|
|
406
1344
|
/^jul/i,
|
|
407
|
-
/^
|
|
408
|
-
/^
|
|
409
|
-
/^
|
|
410
|
-
/^
|
|
411
|
-
/^
|
|
1345
|
+
/^ago/i,
|
|
1346
|
+
/^sep/i,
|
|
1347
|
+
/^oct/i,
|
|
1348
|
+
/^nov/i,
|
|
1349
|
+
/^dic/i
|
|
412
1350
|
]
|
|
413
1351
|
};
|
|
414
1352
|
const matchDayPatterns$1 = {
|
|
415
|
-
narrow: /^[
|
|
416
|
-
short: /^(
|
|
417
|
-
abbreviated: /^(
|
|
418
|
-
wide: /^(
|
|
1353
|
+
narrow: /^[dlmjvs]/i,
|
|
1354
|
+
short: /^(do|lu|ma|mi|ju|vi|s[áa])/i,
|
|
1355
|
+
abbreviated: /^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,
|
|
1356
|
+
wide: /^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i
|
|
419
1357
|
};
|
|
420
1358
|
const parseDayPatterns$1 = {
|
|
421
|
-
narrow: [/^
|
|
422
|
-
any: [/^
|
|
1359
|
+
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^j/i, /^v/i, /^s/i],
|
|
1360
|
+
any: [/^do/i, /^lu/i, /^ma/i, /^mi/i, /^ju/i, /^vi/i, /^sa/i]
|
|
423
1361
|
};
|
|
424
1362
|
const matchDayPeriodPatterns$1 = {
|
|
425
|
-
narrow: /^(a|p|
|
|
426
|
-
any: /^([ap]\.?\s?m\.?|
|
|
1363
|
+
narrow: /^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,
|
|
1364
|
+
any: /^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i
|
|
427
1365
|
};
|
|
428
1366
|
const parseDayPeriodPatterns$1 = {
|
|
429
1367
|
any: {
|
|
430
1368
|
am: /^a/i,
|
|
431
1369
|
pm: /^p/i,
|
|
432
|
-
midnight: /^
|
|
433
|
-
noon: /^
|
|
434
|
-
morning: /
|
|
435
|
-
afternoon: /
|
|
436
|
-
evening: /
|
|
437
|
-
night: /
|
|
1370
|
+
midnight: /^mn/i,
|
|
1371
|
+
noon: /^md/i,
|
|
1372
|
+
morning: /mañana/i,
|
|
1373
|
+
afternoon: /tarde/i,
|
|
1374
|
+
evening: /tarde/i,
|
|
1375
|
+
night: /noche/i
|
|
438
1376
|
}
|
|
439
1377
|
};
|
|
440
1378
|
const match$1 = {
|
|
441
1379
|
ordinalNumber: buildMatchPatternFn({
|
|
442
1380
|
matchPattern: matchOrdinalNumberPattern$1,
|
|
443
1381
|
parsePattern: parseOrdinalNumberPattern$1,
|
|
444
|
-
valueCallback: (value)
|
|
1382
|
+
valueCallback: function(value) {
|
|
1383
|
+
return parseInt(value, 10);
|
|
1384
|
+
}
|
|
445
1385
|
}),
|
|
446
1386
|
era: buildMatchFn({
|
|
447
1387
|
matchPatterns: matchEraPatterns$1,
|
|
@@ -475,15 +1415,15 @@ const match$1 = {
|
|
|
475
1415
|
defaultParseWidth: "any"
|
|
476
1416
|
})
|
|
477
1417
|
};
|
|
478
|
-
const
|
|
479
|
-
code: "
|
|
1418
|
+
const es = {
|
|
1419
|
+
code: "es",
|
|
480
1420
|
formatDistance: formatDistance$1,
|
|
481
1421
|
formatLong: formatLong$1,
|
|
482
1422
|
formatRelative: formatRelative$1,
|
|
483
1423
|
localize: localize$1,
|
|
484
1424
|
match: match$1,
|
|
485
1425
|
options: {
|
|
486
|
-
weekStartsOn:
|
|
1426
|
+
weekStartsOn: 1,
|
|
487
1427
|
firstWeekContainsDate: 1
|
|
488
1428
|
}
|
|
489
1429
|
};
|
|
@@ -569,6 +1509,38 @@ const formatDistance = (token, count, options) => {
|
|
|
569
1509
|
}
|
|
570
1510
|
return result;
|
|
571
1511
|
};
|
|
1512
|
+
const dateFormats = {
|
|
1513
|
+
full: "EEEE d MMMM y",
|
|
1514
|
+
long: "d MMMM y",
|
|
1515
|
+
medium: "d MMM y",
|
|
1516
|
+
short: "dd/MM/y"
|
|
1517
|
+
};
|
|
1518
|
+
const timeFormats = {
|
|
1519
|
+
full: "HH:mm:ss zzzz",
|
|
1520
|
+
long: "HH:mm:ss z",
|
|
1521
|
+
medium: "HH:mm:ss",
|
|
1522
|
+
short: "HH:mm"
|
|
1523
|
+
};
|
|
1524
|
+
const dateTimeFormats = {
|
|
1525
|
+
full: "{{date}} 'à' {{time}}",
|
|
1526
|
+
long: "{{date}} 'à' {{time}}",
|
|
1527
|
+
medium: "{{date}}, {{time}}",
|
|
1528
|
+
short: "{{date}}, {{time}}"
|
|
1529
|
+
};
|
|
1530
|
+
const formatLong = {
|
|
1531
|
+
date: buildFormatLongFn({
|
|
1532
|
+
formats: dateFormats,
|
|
1533
|
+
defaultWidth: "full"
|
|
1534
|
+
}),
|
|
1535
|
+
time: buildFormatLongFn({
|
|
1536
|
+
formats: timeFormats,
|
|
1537
|
+
defaultWidth: "full"
|
|
1538
|
+
}),
|
|
1539
|
+
dateTime: buildFormatLongFn({
|
|
1540
|
+
formats: dateTimeFormats,
|
|
1541
|
+
defaultWidth: "full"
|
|
1542
|
+
})
|
|
1543
|
+
};
|
|
572
1544
|
const formatRelativeLocale = {
|
|
573
1545
|
lastWeek: "eeee 'dernier à' p",
|
|
574
1546
|
yesterday: "'hier à' p",
|
|
@@ -830,54 +1802,23 @@ const match = {
|
|
|
830
1802
|
defaultParseWidth: "any"
|
|
831
1803
|
})
|
|
832
1804
|
};
|
|
833
|
-
const
|
|
834
|
-
|
|
835
|
-
long: "d MMMM y",
|
|
836
|
-
medium: "d MMM y",
|
|
837
|
-
short: "yy-MM-dd"
|
|
838
|
-
};
|
|
839
|
-
const timeFormats = {
|
|
840
|
-
full: "HH:mm:ss zzzz",
|
|
841
|
-
long: "HH:mm:ss z",
|
|
842
|
-
medium: "HH:mm:ss",
|
|
843
|
-
short: "HH:mm"
|
|
844
|
-
};
|
|
845
|
-
const dateTimeFormats = {
|
|
846
|
-
full: "{{date}} 'à' {{time}}",
|
|
847
|
-
long: "{{date}} 'à' {{time}}",
|
|
848
|
-
medium: "{{date}}, {{time}}",
|
|
849
|
-
short: "{{date}}, {{time}}"
|
|
850
|
-
};
|
|
851
|
-
const formatLong = {
|
|
852
|
-
date: buildFormatLongFn({
|
|
853
|
-
formats: dateFormats,
|
|
854
|
-
defaultWidth: "full"
|
|
855
|
-
}),
|
|
856
|
-
time: buildFormatLongFn({
|
|
857
|
-
formats: timeFormats,
|
|
858
|
-
defaultWidth: "full"
|
|
859
|
-
}),
|
|
860
|
-
dateTime: buildFormatLongFn({
|
|
861
|
-
formats: dateTimeFormats,
|
|
862
|
-
defaultWidth: "full"
|
|
863
|
-
})
|
|
864
|
-
};
|
|
865
|
-
const frCA = {
|
|
866
|
-
code: "fr-CA",
|
|
1805
|
+
const fr = {
|
|
1806
|
+
code: "fr",
|
|
867
1807
|
formatDistance,
|
|
868
1808
|
formatLong,
|
|
869
1809
|
formatRelative,
|
|
870
1810
|
localize,
|
|
871
1811
|
match,
|
|
872
|
-
// Unique for fr-CA
|
|
873
1812
|
options: {
|
|
874
|
-
weekStartsOn:
|
|
875
|
-
firstWeekContainsDate:
|
|
1813
|
+
weekStartsOn: 1,
|
|
1814
|
+
firstWeekContainsDate: 4
|
|
876
1815
|
}
|
|
877
1816
|
};
|
|
878
1817
|
const localeMap = {
|
|
879
|
-
"
|
|
880
|
-
"en-US": enUS
|
|
1818
|
+
"de-DE": de,
|
|
1819
|
+
"en-US": enUS,
|
|
1820
|
+
"es-ES": es,
|
|
1821
|
+
"fr-FR": fr
|
|
881
1822
|
};
|
|
882
1823
|
const isValidLocaleCode = (code) => code in localeMap;
|
|
883
1824
|
const getDateFnsLocale = (localeCode) => isValidLocaleCode(localeCode) ? localeMap[localeCode] : enUS;
|