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