@formatjs/intl-listformat 8.3.1 → 8.3.2
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/index.d.ts +103 -68
- package/index.js +264 -84
- package/index.js.map +1 -0
- package/package.json +4 -5
- package/polyfill-force.d.ts +1 -1
- package/polyfill-force.js +398 -2
- package/polyfill-force.js.map +1 -0
- package/polyfill.d.ts +1 -1
- package/polyfill.iife.js +4688 -5452
- package/polyfill.js +983 -3
- package/polyfill.js.map +1 -0
- package/should-polyfill.d.ts +5 -1
- package/should-polyfill.js +583 -8
- package/should-polyfill.js.map +1 -0
- package/supported-locales.generated.d.ts +0 -1
- package/supported-locales.generated.js +0 -573
package/polyfill.js
CHANGED
|
@@ -1,5 +1,983 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { LookupSupportedLocales, ResolveLocale, match } from "@formatjs/intl-localematcher";
|
|
2
|
+
//#region packages/ecma402-abstract/CanonicalizeLocaleList.js
|
|
3
|
+
/**
|
|
4
|
+
* http://ecma-international.org/ecma-402/7.0/index.html#sec-canonicalizelocalelist
|
|
5
|
+
* @param locales
|
|
6
|
+
*/
|
|
7
|
+
function CanonicalizeLocaleList(locales) {
|
|
8
|
+
return Intl.getCanonicalLocales(locales);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region packages/ecma262-abstract/ToString.js
|
|
12
|
+
/**
|
|
13
|
+
* https://tc39.es/ecma262/#sec-tostring
|
|
14
|
+
*/
|
|
15
|
+
function ToString(o) {
|
|
16
|
+
if (typeof o === "symbol") throw TypeError("Cannot convert a Symbol value to a string");
|
|
17
|
+
return String(o);
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region packages/ecma402-abstract/GetOption.js
|
|
21
|
+
/**
|
|
22
|
+
* https://tc39.es/ecma402/#sec-getoption
|
|
23
|
+
* @param opts
|
|
24
|
+
* @param prop
|
|
25
|
+
* @param type
|
|
26
|
+
* @param values
|
|
27
|
+
* @param fallback
|
|
28
|
+
*/
|
|
29
|
+
function GetOption(opts, prop, type, values, fallback) {
|
|
30
|
+
if (typeof opts !== "object") throw new TypeError("Options must be an object");
|
|
31
|
+
let value = opts[prop];
|
|
32
|
+
if (value !== void 0) {
|
|
33
|
+
if (type !== "boolean" && type !== "string") throw new TypeError("invalid type");
|
|
34
|
+
if (type === "boolean") value = Boolean(value);
|
|
35
|
+
if (type === "string") value = ToString(value);
|
|
36
|
+
if (values !== void 0 && !values.filter((val) => val == value).length) throw new RangeError(`${value} is not within ${values.join(", ")}`);
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
return fallback;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region packages/ecma402-abstract/GetOptionsObject.js
|
|
43
|
+
/**
|
|
44
|
+
* https://tc39.es/ecma402/#sec-getoptionsobject
|
|
45
|
+
* @param options
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
function GetOptionsObject(options) {
|
|
49
|
+
if (typeof options === "undefined") return Object.create(null);
|
|
50
|
+
if (typeof options === "object") return options;
|
|
51
|
+
throw new TypeError("Options must be an object");
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js
|
|
55
|
+
function memoize(fn, options) {
|
|
56
|
+
const cache = options && options.cache ? options.cache : cacheDefault;
|
|
57
|
+
const serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
58
|
+
return (options && options.strategy ? options.strategy : strategyDefault)(fn, {
|
|
59
|
+
cache,
|
|
60
|
+
serializer
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function isPrimitive(value) {
|
|
64
|
+
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
65
|
+
}
|
|
66
|
+
function monadic(fn, cache, serializer, arg) {
|
|
67
|
+
const cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
68
|
+
let computedValue = cache.get(cacheKey);
|
|
69
|
+
if (typeof computedValue === "undefined") {
|
|
70
|
+
computedValue = fn.call(this, arg);
|
|
71
|
+
cache.set(cacheKey, computedValue);
|
|
72
|
+
}
|
|
73
|
+
return computedValue;
|
|
74
|
+
}
|
|
75
|
+
function variadic(fn, cache, serializer) {
|
|
76
|
+
const args = Array.prototype.slice.call(arguments, 3);
|
|
77
|
+
const cacheKey = serializer(args);
|
|
78
|
+
let computedValue = cache.get(cacheKey);
|
|
79
|
+
if (typeof computedValue === "undefined") {
|
|
80
|
+
computedValue = fn.apply(this, args);
|
|
81
|
+
cache.set(cacheKey, computedValue);
|
|
82
|
+
}
|
|
83
|
+
return computedValue;
|
|
84
|
+
}
|
|
85
|
+
function assemble(fn, context, strategy, cache, serialize) {
|
|
86
|
+
return strategy.bind(context, fn, cache, serialize);
|
|
87
|
+
}
|
|
88
|
+
function strategyDefault(fn, options) {
|
|
89
|
+
const strategy = fn.length === 1 ? monadic : variadic;
|
|
90
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
91
|
+
}
|
|
92
|
+
function strategyVariadic(fn, options) {
|
|
93
|
+
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
94
|
+
}
|
|
95
|
+
function strategyMonadic(fn, options) {
|
|
96
|
+
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
97
|
+
}
|
|
98
|
+
const serializerDefault = function() {
|
|
99
|
+
return JSON.stringify(arguments);
|
|
100
|
+
};
|
|
101
|
+
var ObjectWithoutPrototypeCache = class {
|
|
102
|
+
constructor() {
|
|
103
|
+
this.cache = Object.create(null);
|
|
104
|
+
}
|
|
105
|
+
get(key) {
|
|
106
|
+
return this.cache[key];
|
|
107
|
+
}
|
|
108
|
+
set(key, value) {
|
|
109
|
+
this.cache[key] = value;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const cacheDefault = { create: function create() {
|
|
113
|
+
return new ObjectWithoutPrototypeCache();
|
|
114
|
+
} };
|
|
115
|
+
const strategies = {
|
|
116
|
+
variadic: strategyVariadic,
|
|
117
|
+
monadic: strategyMonadic
|
|
118
|
+
};
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region packages/ecma402-abstract/utils.js
|
|
121
|
+
function setInternalSlot(map, pl, field, value) {
|
|
122
|
+
if (!map.get(pl)) map.set(pl, Object.create(null));
|
|
123
|
+
const slots = map.get(pl);
|
|
124
|
+
slots[field] = value;
|
|
125
|
+
}
|
|
126
|
+
function getInternalSlot(map, pl, field) {
|
|
127
|
+
return getMultiInternalSlots(map, pl, field)[field];
|
|
128
|
+
}
|
|
129
|
+
function getMultiInternalSlots(map, pl, ...fields) {
|
|
130
|
+
const slots = map.get(pl);
|
|
131
|
+
if (!slots) throw new TypeError(`${pl} InternalSlot has not been initialized`);
|
|
132
|
+
return fields.reduce((all, f) => {
|
|
133
|
+
all[f] = slots[f];
|
|
134
|
+
return all;
|
|
135
|
+
}, Object.create(null));
|
|
136
|
+
}
|
|
137
|
+
function isLiteralPart(patternPart) {
|
|
138
|
+
return patternPart.type === "literal";
|
|
139
|
+
}
|
|
140
|
+
function invariant(condition, message, Err = Error) {
|
|
141
|
+
if (!condition) throw new Err(message);
|
|
142
|
+
}
|
|
143
|
+
memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
|
|
144
|
+
memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
|
|
145
|
+
memoize((...args) => new Intl.Locale(...args), { strategy: strategies.variadic });
|
|
146
|
+
memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region packages/ecma402-abstract/PartitionPattern.js
|
|
149
|
+
/**
|
|
150
|
+
* Partition a pattern into a list of literals and placeholders
|
|
151
|
+
* https://tc39.es/ecma402/#sec-partitionpattern
|
|
152
|
+
* @param pattern
|
|
153
|
+
*/
|
|
154
|
+
function PartitionPattern(pattern) {
|
|
155
|
+
const result = [];
|
|
156
|
+
let beginIndex = pattern.indexOf("{");
|
|
157
|
+
let endIndex = 0;
|
|
158
|
+
let nextIndex = 0;
|
|
159
|
+
const length = pattern.length;
|
|
160
|
+
while (beginIndex < pattern.length && beginIndex > -1) {
|
|
161
|
+
endIndex = pattern.indexOf("}", beginIndex);
|
|
162
|
+
invariant(endIndex > beginIndex, `Invalid pattern ${pattern}`);
|
|
163
|
+
if (beginIndex > nextIndex) result.push({
|
|
164
|
+
type: "literal",
|
|
165
|
+
value: pattern.substring(nextIndex, beginIndex)
|
|
166
|
+
});
|
|
167
|
+
result.push({
|
|
168
|
+
type: pattern.substring(beginIndex + 1, endIndex),
|
|
169
|
+
value: void 0
|
|
170
|
+
});
|
|
171
|
+
nextIndex = endIndex + 1;
|
|
172
|
+
beginIndex = pattern.indexOf("{", nextIndex);
|
|
173
|
+
}
|
|
174
|
+
if (nextIndex < length) result.push({
|
|
175
|
+
type: "literal",
|
|
176
|
+
value: pattern.substring(nextIndex, length)
|
|
177
|
+
});
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region packages/ecma262-abstract/ToObject.js
|
|
182
|
+
/**
|
|
183
|
+
* https://tc39.es/ecma262/#sec-toobject
|
|
184
|
+
*/
|
|
185
|
+
function ToObject(arg) {
|
|
186
|
+
if (arg == null) throw new TypeError("undefined/null cannot be converted to object");
|
|
187
|
+
return Object(arg);
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region packages/ecma402-abstract/SupportedLocales.js
|
|
191
|
+
/**
|
|
192
|
+
* https://tc39.es/ecma402/#sec-supportedlocales
|
|
193
|
+
* @param availableLocales
|
|
194
|
+
* @param requestedLocales
|
|
195
|
+
* @param options
|
|
196
|
+
*/
|
|
197
|
+
function SupportedLocales(availableLocales, requestedLocales, options) {
|
|
198
|
+
let matcher = "best fit";
|
|
199
|
+
if (options !== void 0) {
|
|
200
|
+
options = ToObject(options);
|
|
201
|
+
matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
|
|
202
|
+
}
|
|
203
|
+
if (matcher === "best fit") return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
|
|
204
|
+
return LookupSupportedLocales(Array.from(availableLocales), requestedLocales);
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region packages/intl-listformat/index.ts
|
|
208
|
+
function validateInstance(instance, method) {
|
|
209
|
+
if (!(instance instanceof ListFormat)) throw new TypeError(`Method Intl.ListFormat.prototype.${method} called on incompatible receiver ${String(instance)}`);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* https://tc39.es/proposal-intl-list-format/#sec-createstringlistfromiterable
|
|
213
|
+
* @param iterable list
|
|
214
|
+
*/
|
|
215
|
+
function stringListFromIterable(iterable) {
|
|
216
|
+
if (typeof iterable !== "object") return [];
|
|
217
|
+
const elements = [];
|
|
218
|
+
const iterator = iterable[Symbol.iterator]();
|
|
219
|
+
let result;
|
|
220
|
+
while (true) {
|
|
221
|
+
result = iterator.next();
|
|
222
|
+
if (result.done) break;
|
|
223
|
+
if (typeof result.value !== "string") {
|
|
224
|
+
const nextValue = result.value;
|
|
225
|
+
throw new TypeError(`Iterable yielded ${nextValue} which is not a string`);
|
|
226
|
+
}
|
|
227
|
+
elements.push(result.value);
|
|
228
|
+
}
|
|
229
|
+
return elements;
|
|
230
|
+
}
|
|
231
|
+
function createPartsFromList(internalSlotMap, lf, list) {
|
|
232
|
+
const size = list.length;
|
|
233
|
+
if (size === 0) return [];
|
|
234
|
+
if (size === 2) return deconstructPattern(getInternalSlot(internalSlotMap, lf, "templatePair"), {
|
|
235
|
+
"0": {
|
|
236
|
+
type: "element",
|
|
237
|
+
value: list[0]
|
|
238
|
+
},
|
|
239
|
+
"1": {
|
|
240
|
+
type: "element",
|
|
241
|
+
value: list[1]
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
let parts = {
|
|
245
|
+
type: "element",
|
|
246
|
+
value: list[size - 1]
|
|
247
|
+
};
|
|
248
|
+
let i = size - 2;
|
|
249
|
+
while (i >= 0) {
|
|
250
|
+
let pattern;
|
|
251
|
+
if (i === 0) pattern = getInternalSlot(internalSlotMap, lf, "templateStart");
|
|
252
|
+
else if (i < size - 2) pattern = getInternalSlot(internalSlotMap, lf, "templateMiddle");
|
|
253
|
+
else pattern = getInternalSlot(internalSlotMap, lf, "templateEnd");
|
|
254
|
+
const head = {
|
|
255
|
+
type: "element",
|
|
256
|
+
value: list[i]
|
|
257
|
+
};
|
|
258
|
+
parts = deconstructPattern(pattern, {
|
|
259
|
+
"0": head,
|
|
260
|
+
"1": parts
|
|
261
|
+
});
|
|
262
|
+
i--;
|
|
263
|
+
}
|
|
264
|
+
return parts;
|
|
265
|
+
}
|
|
266
|
+
function deconstructPattern(pattern, placeables) {
|
|
267
|
+
const patternParts = PartitionPattern(pattern);
|
|
268
|
+
const result = [];
|
|
269
|
+
for (const patternPart of patternParts) {
|
|
270
|
+
const { type: part } = patternPart;
|
|
271
|
+
if (isLiteralPart(patternPart)) result.push({
|
|
272
|
+
type: "literal",
|
|
273
|
+
value: patternPart.value
|
|
274
|
+
});
|
|
275
|
+
else {
|
|
276
|
+
invariant(part in placeables, `${part} is missing from placables`);
|
|
277
|
+
const subst = placeables[part];
|
|
278
|
+
if (Array.isArray(subst)) result.push(...subst);
|
|
279
|
+
else result.push(subst);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return result;
|
|
283
|
+
}
|
|
284
|
+
var ListFormat = class ListFormat {
|
|
285
|
+
constructor(locales, options) {
|
|
286
|
+
if (!(this && this instanceof ListFormat ? this.constructor : void 0)) throw new TypeError("Intl.ListFormat must be called with 'new'");
|
|
287
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "initializedListFormat", true);
|
|
288
|
+
const requestedLocales = CanonicalizeLocaleList(locales);
|
|
289
|
+
const opt = Object.create(null);
|
|
290
|
+
const opts = GetOptionsObject(options);
|
|
291
|
+
opt.localeMatcher = GetOption(opts, "localeMatcher", "string", ["best fit", "lookup"], "best fit");
|
|
292
|
+
const { localeData } = ListFormat;
|
|
293
|
+
const r = ResolveLocale(ListFormat.availableLocales, requestedLocales, opt, ListFormat.relevantExtensionKeys, localeData, ListFormat.getDefaultLocale);
|
|
294
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "locale", r.locale);
|
|
295
|
+
const type = GetOption(opts, "type", "string", [
|
|
296
|
+
"conjunction",
|
|
297
|
+
"disjunction",
|
|
298
|
+
"unit"
|
|
299
|
+
], "conjunction");
|
|
300
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "type", type);
|
|
301
|
+
const style = GetOption(opts, "style", "string", [
|
|
302
|
+
"long",
|
|
303
|
+
"short",
|
|
304
|
+
"narrow"
|
|
305
|
+
], "long");
|
|
306
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "style", style);
|
|
307
|
+
const { dataLocale } = r;
|
|
308
|
+
const dataLocaleData = localeData[dataLocale];
|
|
309
|
+
invariant(!!dataLocaleData, `Missing locale data for ${dataLocale}`);
|
|
310
|
+
const templates = dataLocaleData[type][style];
|
|
311
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "templatePair", templates.pair);
|
|
312
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "templateStart", templates.start);
|
|
313
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "templateMiddle", templates.middle);
|
|
314
|
+
setInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "templateEnd", templates.end);
|
|
315
|
+
}
|
|
316
|
+
format(elements) {
|
|
317
|
+
validateInstance(this, "format");
|
|
318
|
+
let result = "";
|
|
319
|
+
const parts = createPartsFromList(ListFormat.__INTERNAL_SLOT_MAP__, this, stringListFromIterable(elements));
|
|
320
|
+
if (!Array.isArray(parts)) return parts.value;
|
|
321
|
+
for (const p of parts) result += p.value;
|
|
322
|
+
return result;
|
|
323
|
+
}
|
|
324
|
+
formatToParts(elements) {
|
|
325
|
+
validateInstance(this, "format");
|
|
326
|
+
const parts = createPartsFromList(ListFormat.__INTERNAL_SLOT_MAP__, this, stringListFromIterable(elements));
|
|
327
|
+
if (!Array.isArray(parts)) return [parts];
|
|
328
|
+
const result = [];
|
|
329
|
+
for (const part of parts) result.push({ ...part });
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
resolvedOptions() {
|
|
333
|
+
validateInstance(this, "resolvedOptions");
|
|
334
|
+
return {
|
|
335
|
+
locale: getInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "locale"),
|
|
336
|
+
type: getInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "type"),
|
|
337
|
+
style: getInternalSlot(ListFormat.__INTERNAL_SLOT_MAP__, this, "style")
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
static supportedLocalesOf(locales, options) {
|
|
341
|
+
return SupportedLocales(ListFormat.availableLocales, CanonicalizeLocaleList(locales), options);
|
|
342
|
+
}
|
|
343
|
+
static __addLocaleData(...data) {
|
|
344
|
+
for (const { data: d, locale } of data) {
|
|
345
|
+
const minimizedLocale = new Intl.Locale(locale).minimize().toString();
|
|
346
|
+
ListFormat.localeData[locale] = ListFormat.localeData[minimizedLocale] = d;
|
|
347
|
+
ListFormat.availableLocales.add(minimizedLocale);
|
|
348
|
+
ListFormat.availableLocales.add(locale);
|
|
349
|
+
if (!ListFormat.__defaultLocale) ListFormat.__defaultLocale = minimizedLocale;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
static {
|
|
353
|
+
this.localeData = {};
|
|
354
|
+
}
|
|
355
|
+
static {
|
|
356
|
+
this.availableLocales = /* @__PURE__ */ new Set();
|
|
357
|
+
}
|
|
358
|
+
static {
|
|
359
|
+
this.__defaultLocale = "";
|
|
360
|
+
}
|
|
361
|
+
static getDefaultLocale() {
|
|
362
|
+
return ListFormat.__defaultLocale;
|
|
363
|
+
}
|
|
364
|
+
static {
|
|
365
|
+
this.relevantExtensionKeys = [];
|
|
366
|
+
}
|
|
367
|
+
static {
|
|
368
|
+
this.polyfilled = true;
|
|
369
|
+
}
|
|
370
|
+
static {
|
|
371
|
+
this.__INTERNAL_SLOT_MAP__ = /* @__PURE__ */ new WeakMap();
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
try {
|
|
375
|
+
if (typeof Symbol !== "undefined") Object.defineProperty(ListFormat.prototype, Symbol.toStringTag, {
|
|
376
|
+
value: "Intl.ListFormat",
|
|
377
|
+
writable: false,
|
|
378
|
+
enumerable: false,
|
|
379
|
+
configurable: true
|
|
380
|
+
});
|
|
381
|
+
Object.defineProperty(ListFormat.prototype.constructor, "length", {
|
|
382
|
+
value: 0,
|
|
383
|
+
writable: false,
|
|
384
|
+
enumerable: false,
|
|
385
|
+
configurable: true
|
|
386
|
+
});
|
|
387
|
+
Object.defineProperty(ListFormat.supportedLocalesOf, "length", {
|
|
388
|
+
value: 1,
|
|
389
|
+
writable: false,
|
|
390
|
+
enumerable: false,
|
|
391
|
+
configurable: true
|
|
392
|
+
});
|
|
393
|
+
} catch {}
|
|
394
|
+
//#endregion
|
|
395
|
+
//#region packages/intl-listformat/supported-locales.generated.ts
|
|
396
|
+
const supportedLocales = [
|
|
397
|
+
"af",
|
|
398
|
+
"af-NA",
|
|
399
|
+
"agq",
|
|
400
|
+
"ak",
|
|
401
|
+
"am",
|
|
402
|
+
"ar",
|
|
403
|
+
"ar-AE",
|
|
404
|
+
"ar-BH",
|
|
405
|
+
"ar-DJ",
|
|
406
|
+
"ar-DZ",
|
|
407
|
+
"ar-EG",
|
|
408
|
+
"ar-EH",
|
|
409
|
+
"ar-ER",
|
|
410
|
+
"ar-IL",
|
|
411
|
+
"ar-IQ",
|
|
412
|
+
"ar-JO",
|
|
413
|
+
"ar-KM",
|
|
414
|
+
"ar-KW",
|
|
415
|
+
"ar-LB",
|
|
416
|
+
"ar-LY",
|
|
417
|
+
"ar-MA",
|
|
418
|
+
"ar-MR",
|
|
419
|
+
"ar-OM",
|
|
420
|
+
"ar-PS",
|
|
421
|
+
"ar-QA",
|
|
422
|
+
"ar-SA",
|
|
423
|
+
"ar-SD",
|
|
424
|
+
"ar-SO",
|
|
425
|
+
"ar-SS",
|
|
426
|
+
"ar-SY",
|
|
427
|
+
"ar-TD",
|
|
428
|
+
"ar-TN",
|
|
429
|
+
"ar-YE",
|
|
430
|
+
"as",
|
|
431
|
+
"asa",
|
|
432
|
+
"ast",
|
|
433
|
+
"az",
|
|
434
|
+
"az-Cyrl",
|
|
435
|
+
"az-Latn",
|
|
436
|
+
"bas",
|
|
437
|
+
"be",
|
|
438
|
+
"be-tarask",
|
|
439
|
+
"bem",
|
|
440
|
+
"bez",
|
|
441
|
+
"bg",
|
|
442
|
+
"bm",
|
|
443
|
+
"bn",
|
|
444
|
+
"bn-IN",
|
|
445
|
+
"bo",
|
|
446
|
+
"bo-IN",
|
|
447
|
+
"br",
|
|
448
|
+
"brx",
|
|
449
|
+
"bs",
|
|
450
|
+
"bs-Cyrl",
|
|
451
|
+
"bs-Latn",
|
|
452
|
+
"ca",
|
|
453
|
+
"ca-AD",
|
|
454
|
+
"ca-ES-valencia",
|
|
455
|
+
"ca-FR",
|
|
456
|
+
"ca-IT",
|
|
457
|
+
"ccp",
|
|
458
|
+
"ccp-IN",
|
|
459
|
+
"ce",
|
|
460
|
+
"ceb",
|
|
461
|
+
"cgg",
|
|
462
|
+
"chr",
|
|
463
|
+
"ckb",
|
|
464
|
+
"ckb-IR",
|
|
465
|
+
"cs",
|
|
466
|
+
"cy",
|
|
467
|
+
"da",
|
|
468
|
+
"da-GL",
|
|
469
|
+
"dav",
|
|
470
|
+
"de",
|
|
471
|
+
"de-AT",
|
|
472
|
+
"de-BE",
|
|
473
|
+
"de-CH",
|
|
474
|
+
"de-IT",
|
|
475
|
+
"de-LI",
|
|
476
|
+
"de-LU",
|
|
477
|
+
"dje",
|
|
478
|
+
"doi",
|
|
479
|
+
"dsb",
|
|
480
|
+
"dua",
|
|
481
|
+
"dyo",
|
|
482
|
+
"dz",
|
|
483
|
+
"ebu",
|
|
484
|
+
"ee",
|
|
485
|
+
"ee-TG",
|
|
486
|
+
"el",
|
|
487
|
+
"el-CY",
|
|
488
|
+
"en",
|
|
489
|
+
"en-001",
|
|
490
|
+
"en-150",
|
|
491
|
+
"en-AE",
|
|
492
|
+
"en-AG",
|
|
493
|
+
"en-AI",
|
|
494
|
+
"en-AS",
|
|
495
|
+
"en-AT",
|
|
496
|
+
"en-AU",
|
|
497
|
+
"en-BB",
|
|
498
|
+
"en-BE",
|
|
499
|
+
"en-BI",
|
|
500
|
+
"en-BM",
|
|
501
|
+
"en-BS",
|
|
502
|
+
"en-BW",
|
|
503
|
+
"en-BZ",
|
|
504
|
+
"en-CA",
|
|
505
|
+
"en-CC",
|
|
506
|
+
"en-CH",
|
|
507
|
+
"en-CK",
|
|
508
|
+
"en-CM",
|
|
509
|
+
"en-CX",
|
|
510
|
+
"en-CY",
|
|
511
|
+
"en-DE",
|
|
512
|
+
"en-DG",
|
|
513
|
+
"en-DK",
|
|
514
|
+
"en-DM",
|
|
515
|
+
"en-ER",
|
|
516
|
+
"en-FI",
|
|
517
|
+
"en-FJ",
|
|
518
|
+
"en-FK",
|
|
519
|
+
"en-FM",
|
|
520
|
+
"en-GB",
|
|
521
|
+
"en-GD",
|
|
522
|
+
"en-GG",
|
|
523
|
+
"en-GH",
|
|
524
|
+
"en-GI",
|
|
525
|
+
"en-GM",
|
|
526
|
+
"en-GU",
|
|
527
|
+
"en-GY",
|
|
528
|
+
"en-HK",
|
|
529
|
+
"en-IE",
|
|
530
|
+
"en-IL",
|
|
531
|
+
"en-IM",
|
|
532
|
+
"en-IN",
|
|
533
|
+
"en-IO",
|
|
534
|
+
"en-JE",
|
|
535
|
+
"en-JM",
|
|
536
|
+
"en-KE",
|
|
537
|
+
"en-KI",
|
|
538
|
+
"en-KN",
|
|
539
|
+
"en-KY",
|
|
540
|
+
"en-LC",
|
|
541
|
+
"en-LR",
|
|
542
|
+
"en-LS",
|
|
543
|
+
"en-MG",
|
|
544
|
+
"en-MH",
|
|
545
|
+
"en-MO",
|
|
546
|
+
"en-MP",
|
|
547
|
+
"en-MS",
|
|
548
|
+
"en-MT",
|
|
549
|
+
"en-MU",
|
|
550
|
+
"en-MW",
|
|
551
|
+
"en-MY",
|
|
552
|
+
"en-NA",
|
|
553
|
+
"en-NF",
|
|
554
|
+
"en-NG",
|
|
555
|
+
"en-NL",
|
|
556
|
+
"en-NR",
|
|
557
|
+
"en-NU",
|
|
558
|
+
"en-NZ",
|
|
559
|
+
"en-PG",
|
|
560
|
+
"en-PH",
|
|
561
|
+
"en-PK",
|
|
562
|
+
"en-PN",
|
|
563
|
+
"en-PR",
|
|
564
|
+
"en-PW",
|
|
565
|
+
"en-RW",
|
|
566
|
+
"en-SB",
|
|
567
|
+
"en-SC",
|
|
568
|
+
"en-SD",
|
|
569
|
+
"en-SE",
|
|
570
|
+
"en-SG",
|
|
571
|
+
"en-SH",
|
|
572
|
+
"en-SI",
|
|
573
|
+
"en-SL",
|
|
574
|
+
"en-SS",
|
|
575
|
+
"en-SX",
|
|
576
|
+
"en-SZ",
|
|
577
|
+
"en-TC",
|
|
578
|
+
"en-TK",
|
|
579
|
+
"en-TO",
|
|
580
|
+
"en-TT",
|
|
581
|
+
"en-TV",
|
|
582
|
+
"en-TZ",
|
|
583
|
+
"en-UG",
|
|
584
|
+
"en-UM",
|
|
585
|
+
"en-VC",
|
|
586
|
+
"en-VG",
|
|
587
|
+
"en-VI",
|
|
588
|
+
"en-VU",
|
|
589
|
+
"en-WS",
|
|
590
|
+
"en-ZA",
|
|
591
|
+
"en-ZM",
|
|
592
|
+
"en-ZW",
|
|
593
|
+
"eo",
|
|
594
|
+
"es",
|
|
595
|
+
"es-419",
|
|
596
|
+
"es-AR",
|
|
597
|
+
"es-BO",
|
|
598
|
+
"es-BR",
|
|
599
|
+
"es-BZ",
|
|
600
|
+
"es-CL",
|
|
601
|
+
"es-CO",
|
|
602
|
+
"es-CR",
|
|
603
|
+
"es-CU",
|
|
604
|
+
"es-DO",
|
|
605
|
+
"es-EA",
|
|
606
|
+
"es-EC",
|
|
607
|
+
"es-GQ",
|
|
608
|
+
"es-GT",
|
|
609
|
+
"es-HN",
|
|
610
|
+
"es-IC",
|
|
611
|
+
"es-MX",
|
|
612
|
+
"es-NI",
|
|
613
|
+
"es-PA",
|
|
614
|
+
"es-PE",
|
|
615
|
+
"es-PH",
|
|
616
|
+
"es-PR",
|
|
617
|
+
"es-PY",
|
|
618
|
+
"es-SV",
|
|
619
|
+
"es-US",
|
|
620
|
+
"es-UY",
|
|
621
|
+
"es-VE",
|
|
622
|
+
"et",
|
|
623
|
+
"eu",
|
|
624
|
+
"ewo",
|
|
625
|
+
"fa",
|
|
626
|
+
"fa-AF",
|
|
627
|
+
"ff",
|
|
628
|
+
"ff-Adlm",
|
|
629
|
+
"ff-Adlm-BF",
|
|
630
|
+
"ff-Adlm-CM",
|
|
631
|
+
"ff-Adlm-GH",
|
|
632
|
+
"ff-Adlm-GM",
|
|
633
|
+
"ff-Adlm-GW",
|
|
634
|
+
"ff-Adlm-LR",
|
|
635
|
+
"ff-Adlm-MR",
|
|
636
|
+
"ff-Adlm-NE",
|
|
637
|
+
"ff-Adlm-NG",
|
|
638
|
+
"ff-Adlm-SL",
|
|
639
|
+
"ff-Adlm-SN",
|
|
640
|
+
"ff-Latn",
|
|
641
|
+
"ff-Latn-BF",
|
|
642
|
+
"ff-Latn-CM",
|
|
643
|
+
"ff-Latn-GH",
|
|
644
|
+
"ff-Latn-GM",
|
|
645
|
+
"ff-Latn-GN",
|
|
646
|
+
"ff-Latn-GW",
|
|
647
|
+
"ff-Latn-LR",
|
|
648
|
+
"ff-Latn-MR",
|
|
649
|
+
"ff-Latn-NE",
|
|
650
|
+
"ff-Latn-NG",
|
|
651
|
+
"ff-Latn-SL",
|
|
652
|
+
"fi",
|
|
653
|
+
"fil",
|
|
654
|
+
"fo",
|
|
655
|
+
"fo-DK",
|
|
656
|
+
"fr",
|
|
657
|
+
"fr-BE",
|
|
658
|
+
"fr-BF",
|
|
659
|
+
"fr-BI",
|
|
660
|
+
"fr-BJ",
|
|
661
|
+
"fr-BL",
|
|
662
|
+
"fr-CA",
|
|
663
|
+
"fr-CD",
|
|
664
|
+
"fr-CF",
|
|
665
|
+
"fr-CG",
|
|
666
|
+
"fr-CH",
|
|
667
|
+
"fr-CI",
|
|
668
|
+
"fr-CM",
|
|
669
|
+
"fr-DJ",
|
|
670
|
+
"fr-DZ",
|
|
671
|
+
"fr-GA",
|
|
672
|
+
"fr-GF",
|
|
673
|
+
"fr-GN",
|
|
674
|
+
"fr-GP",
|
|
675
|
+
"fr-GQ",
|
|
676
|
+
"fr-HT",
|
|
677
|
+
"fr-KM",
|
|
678
|
+
"fr-LU",
|
|
679
|
+
"fr-MA",
|
|
680
|
+
"fr-MC",
|
|
681
|
+
"fr-MF",
|
|
682
|
+
"fr-MG",
|
|
683
|
+
"fr-ML",
|
|
684
|
+
"fr-MQ",
|
|
685
|
+
"fr-MR",
|
|
686
|
+
"fr-MU",
|
|
687
|
+
"fr-NC",
|
|
688
|
+
"fr-NE",
|
|
689
|
+
"fr-PF",
|
|
690
|
+
"fr-PM",
|
|
691
|
+
"fr-RE",
|
|
692
|
+
"fr-RW",
|
|
693
|
+
"fr-SC",
|
|
694
|
+
"fr-SN",
|
|
695
|
+
"fr-SY",
|
|
696
|
+
"fr-TD",
|
|
697
|
+
"fr-TG",
|
|
698
|
+
"fr-TN",
|
|
699
|
+
"fr-VU",
|
|
700
|
+
"fr-WF",
|
|
701
|
+
"fr-YT",
|
|
702
|
+
"fur",
|
|
703
|
+
"fy",
|
|
704
|
+
"ga",
|
|
705
|
+
"ga-GB",
|
|
706
|
+
"gd",
|
|
707
|
+
"gl",
|
|
708
|
+
"gsw",
|
|
709
|
+
"gsw-FR",
|
|
710
|
+
"gsw-LI",
|
|
711
|
+
"gu",
|
|
712
|
+
"guz",
|
|
713
|
+
"gv",
|
|
714
|
+
"ha",
|
|
715
|
+
"ha-GH",
|
|
716
|
+
"ha-NE",
|
|
717
|
+
"haw",
|
|
718
|
+
"he",
|
|
719
|
+
"hi",
|
|
720
|
+
"hr",
|
|
721
|
+
"hr-BA",
|
|
722
|
+
"hsb",
|
|
723
|
+
"hu",
|
|
724
|
+
"hy",
|
|
725
|
+
"ia",
|
|
726
|
+
"id",
|
|
727
|
+
"ig",
|
|
728
|
+
"ii",
|
|
729
|
+
"is",
|
|
730
|
+
"it",
|
|
731
|
+
"it-CH",
|
|
732
|
+
"it-SM",
|
|
733
|
+
"it-VA",
|
|
734
|
+
"ja",
|
|
735
|
+
"jgo",
|
|
736
|
+
"jmc",
|
|
737
|
+
"jv",
|
|
738
|
+
"ka",
|
|
739
|
+
"kab",
|
|
740
|
+
"kam",
|
|
741
|
+
"kde",
|
|
742
|
+
"kea",
|
|
743
|
+
"kgp",
|
|
744
|
+
"khq",
|
|
745
|
+
"ki",
|
|
746
|
+
"kk",
|
|
747
|
+
"kkj",
|
|
748
|
+
"kl",
|
|
749
|
+
"kln",
|
|
750
|
+
"km",
|
|
751
|
+
"kn",
|
|
752
|
+
"ko",
|
|
753
|
+
"ko-KP",
|
|
754
|
+
"kok",
|
|
755
|
+
"ks",
|
|
756
|
+
"ks-Arab",
|
|
757
|
+
"ksb",
|
|
758
|
+
"ksf",
|
|
759
|
+
"ksh",
|
|
760
|
+
"ku",
|
|
761
|
+
"kw",
|
|
762
|
+
"ky",
|
|
763
|
+
"lag",
|
|
764
|
+
"lb",
|
|
765
|
+
"lg",
|
|
766
|
+
"lkt",
|
|
767
|
+
"ln",
|
|
768
|
+
"ln-AO",
|
|
769
|
+
"ln-CF",
|
|
770
|
+
"ln-CG",
|
|
771
|
+
"lo",
|
|
772
|
+
"lrc",
|
|
773
|
+
"lrc-IQ",
|
|
774
|
+
"lt",
|
|
775
|
+
"lu",
|
|
776
|
+
"luo",
|
|
777
|
+
"luy",
|
|
778
|
+
"lv",
|
|
779
|
+
"mai",
|
|
780
|
+
"mas",
|
|
781
|
+
"mas-TZ",
|
|
782
|
+
"mer",
|
|
783
|
+
"mfe",
|
|
784
|
+
"mg",
|
|
785
|
+
"mgh",
|
|
786
|
+
"mgo",
|
|
787
|
+
"mi",
|
|
788
|
+
"mk",
|
|
789
|
+
"ml",
|
|
790
|
+
"mn",
|
|
791
|
+
"mni",
|
|
792
|
+
"mni-Beng",
|
|
793
|
+
"mr",
|
|
794
|
+
"ms",
|
|
795
|
+
"ms-BN",
|
|
796
|
+
"ms-ID",
|
|
797
|
+
"ms-SG",
|
|
798
|
+
"mt",
|
|
799
|
+
"mua",
|
|
800
|
+
"my",
|
|
801
|
+
"mzn",
|
|
802
|
+
"naq",
|
|
803
|
+
"nb",
|
|
804
|
+
"nb-SJ",
|
|
805
|
+
"nd",
|
|
806
|
+
"nds",
|
|
807
|
+
"nds-NL",
|
|
808
|
+
"ne",
|
|
809
|
+
"ne-IN",
|
|
810
|
+
"nl",
|
|
811
|
+
"nl-AW",
|
|
812
|
+
"nl-BE",
|
|
813
|
+
"nl-BQ",
|
|
814
|
+
"nl-CW",
|
|
815
|
+
"nl-SR",
|
|
816
|
+
"nl-SX",
|
|
817
|
+
"nmg",
|
|
818
|
+
"nn",
|
|
819
|
+
"nnh",
|
|
820
|
+
"no",
|
|
821
|
+
"nus",
|
|
822
|
+
"nyn",
|
|
823
|
+
"om",
|
|
824
|
+
"om-KE",
|
|
825
|
+
"or",
|
|
826
|
+
"os",
|
|
827
|
+
"os-RU",
|
|
828
|
+
"pa",
|
|
829
|
+
"pa-Arab",
|
|
830
|
+
"pa-Guru",
|
|
831
|
+
"pcm",
|
|
832
|
+
"pl",
|
|
833
|
+
"ps",
|
|
834
|
+
"ps-PK",
|
|
835
|
+
"pt",
|
|
836
|
+
"pt-AO",
|
|
837
|
+
"pt-CH",
|
|
838
|
+
"pt-CV",
|
|
839
|
+
"pt-GQ",
|
|
840
|
+
"pt-GW",
|
|
841
|
+
"pt-LU",
|
|
842
|
+
"pt-MO",
|
|
843
|
+
"pt-MZ",
|
|
844
|
+
"pt-PT",
|
|
845
|
+
"pt-ST",
|
|
846
|
+
"pt-TL",
|
|
847
|
+
"qu",
|
|
848
|
+
"qu-BO",
|
|
849
|
+
"qu-EC",
|
|
850
|
+
"rm",
|
|
851
|
+
"rn",
|
|
852
|
+
"ro",
|
|
853
|
+
"ro-MD",
|
|
854
|
+
"rof",
|
|
855
|
+
"ru",
|
|
856
|
+
"ru-BY",
|
|
857
|
+
"ru-KG",
|
|
858
|
+
"ru-KZ",
|
|
859
|
+
"ru-MD",
|
|
860
|
+
"ru-UA",
|
|
861
|
+
"rw",
|
|
862
|
+
"rwk",
|
|
863
|
+
"sa",
|
|
864
|
+
"sah",
|
|
865
|
+
"saq",
|
|
866
|
+
"sat",
|
|
867
|
+
"sat-Olck",
|
|
868
|
+
"sbp",
|
|
869
|
+
"sc",
|
|
870
|
+
"sd",
|
|
871
|
+
"sd-Arab",
|
|
872
|
+
"sd-Deva",
|
|
873
|
+
"se",
|
|
874
|
+
"se-FI",
|
|
875
|
+
"se-SE",
|
|
876
|
+
"seh",
|
|
877
|
+
"ses",
|
|
878
|
+
"sg",
|
|
879
|
+
"shi",
|
|
880
|
+
"shi-Latn",
|
|
881
|
+
"shi-Tfng",
|
|
882
|
+
"si",
|
|
883
|
+
"sk",
|
|
884
|
+
"sl",
|
|
885
|
+
"smn",
|
|
886
|
+
"sn",
|
|
887
|
+
"so",
|
|
888
|
+
"so-DJ",
|
|
889
|
+
"so-ET",
|
|
890
|
+
"so-KE",
|
|
891
|
+
"sq",
|
|
892
|
+
"sq-MK",
|
|
893
|
+
"sq-XK",
|
|
894
|
+
"sr",
|
|
895
|
+
"sr-Cyrl",
|
|
896
|
+
"sr-Cyrl-BA",
|
|
897
|
+
"sr-Cyrl-ME",
|
|
898
|
+
"sr-Cyrl-XK",
|
|
899
|
+
"sr-Latn",
|
|
900
|
+
"sr-Latn-BA",
|
|
901
|
+
"sr-Latn-ME",
|
|
902
|
+
"sr-Latn-XK",
|
|
903
|
+
"su",
|
|
904
|
+
"su-Latn",
|
|
905
|
+
"sv",
|
|
906
|
+
"sv-AX",
|
|
907
|
+
"sv-FI",
|
|
908
|
+
"sw",
|
|
909
|
+
"sw-CD",
|
|
910
|
+
"sw-KE",
|
|
911
|
+
"sw-UG",
|
|
912
|
+
"ta",
|
|
913
|
+
"ta-LK",
|
|
914
|
+
"ta-MY",
|
|
915
|
+
"ta-SG",
|
|
916
|
+
"te",
|
|
917
|
+
"teo",
|
|
918
|
+
"teo-KE",
|
|
919
|
+
"tg",
|
|
920
|
+
"th",
|
|
921
|
+
"ti",
|
|
922
|
+
"ti-ER",
|
|
923
|
+
"tk",
|
|
924
|
+
"to",
|
|
925
|
+
"tr",
|
|
926
|
+
"tr-CY",
|
|
927
|
+
"tt",
|
|
928
|
+
"twq",
|
|
929
|
+
"tzm",
|
|
930
|
+
"ug",
|
|
931
|
+
"uk",
|
|
932
|
+
"und",
|
|
933
|
+
"ur",
|
|
934
|
+
"ur-IN",
|
|
935
|
+
"uz",
|
|
936
|
+
"uz-Arab",
|
|
937
|
+
"uz-Cyrl",
|
|
938
|
+
"uz-Latn",
|
|
939
|
+
"vai",
|
|
940
|
+
"vai-Latn",
|
|
941
|
+
"vai-Vaii",
|
|
942
|
+
"vi",
|
|
943
|
+
"vun",
|
|
944
|
+
"wae",
|
|
945
|
+
"wo",
|
|
946
|
+
"xh",
|
|
947
|
+
"xog",
|
|
948
|
+
"yav",
|
|
949
|
+
"yi",
|
|
950
|
+
"yo",
|
|
951
|
+
"yo-BJ",
|
|
952
|
+
"yrl",
|
|
953
|
+
"yrl-CO",
|
|
954
|
+
"yrl-VE",
|
|
955
|
+
"yue",
|
|
956
|
+
"yue-Hans",
|
|
957
|
+
"yue-Hant",
|
|
958
|
+
"zgh",
|
|
959
|
+
"zh",
|
|
960
|
+
"zh-Hans",
|
|
961
|
+
"zh-Hans-HK",
|
|
962
|
+
"zh-Hans-MO",
|
|
963
|
+
"zh-Hans-SG",
|
|
964
|
+
"zh-Hant",
|
|
965
|
+
"zh-Hant-HK",
|
|
966
|
+
"zh-Hant-MO",
|
|
967
|
+
"zu"
|
|
968
|
+
];
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region packages/intl-listformat/should-polyfill.ts
|
|
971
|
+
function supportedLocalesOf(locale) {
|
|
972
|
+
if (!locale) return true;
|
|
973
|
+
const locales = Array.isArray(locale) ? locale : [locale];
|
|
974
|
+
return Intl.ListFormat.supportedLocalesOf(locales).length === locales.length;
|
|
975
|
+
}
|
|
976
|
+
function shouldPolyfill(locale = "en") {
|
|
977
|
+
if (!("ListFormat" in Intl) || !supportedLocalesOf(locale)) return locale ? match([locale], supportedLocales, "en") : void 0;
|
|
978
|
+
}
|
|
979
|
+
//#endregion
|
|
980
|
+
//#region packages/intl-listformat/polyfill.ts
|
|
3
981
|
if (shouldPolyfill()) {
|
|
4
982
|
Object.defineProperty(Intl, "ListFormat", {
|
|
5
983
|
value: ListFormat,
|
|
@@ -7,10 +985,12 @@ if (shouldPolyfill()) {
|
|
|
7
985
|
enumerable: false,
|
|
8
986
|
configurable: true
|
|
9
987
|
});
|
|
10
|
-
// Drain any locale data that was buffered before polyfill loaded
|
|
11
988
|
const buf = globalThis.__FORMATJS_LISTFORMAT_DATA__;
|
|
12
989
|
if (buf) {
|
|
13
990
|
for (const d of buf) ListFormat.__addLocaleData(d);
|
|
14
991
|
delete globalThis.__FORMATJS_LISTFORMAT_DATA__;
|
|
15
992
|
}
|
|
16
993
|
}
|
|
994
|
+
//#endregion
|
|
995
|
+
|
|
996
|
+
//# sourceMappingURL=polyfill.js.map
|