@formatjs/intl-supportedvaluesof 3.1.1 → 3.1.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/README.md +11 -3
- package/index.d.ts +5 -12
- package/index.js +943 -194
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/polyfill-force.js +1027 -210
- package/polyfill-force.js.map +1 -1
- package/polyfill.iife.js +1033 -216
- package/polyfill.js +1028 -211
- package/polyfill.js.map +1 -1
- package/should-polyfill.js +1 -1
- package/should-polyfill.js.map +1 -1
package/index.js
CHANGED
|
@@ -9,16 +9,145 @@ function ToString(o) {
|
|
|
9
9
|
if (typeof o === "symbol") throw TypeErrorConstructor("Cannot convert a Symbol value to a string");
|
|
10
10
|
return StringConstructor(o);
|
|
11
11
|
}
|
|
12
|
+
Number.isInteger;
|
|
13
|
+
Number.isFinite;
|
|
14
|
+
Number.isSafeInteger;
|
|
15
|
+
const RangeErrorConstructor = RangeError;
|
|
16
|
+
const arrayApply = Reflect.apply;
|
|
17
|
+
Array.prototype.every;
|
|
18
|
+
const some = Array.prototype.some;
|
|
19
|
+
function arraySome(values, predicate) {
|
|
20
|
+
return arrayApply(some, values, [predicate]);
|
|
21
|
+
}
|
|
22
|
+
Array.prototype.includes;
|
|
23
|
+
const indexOf = Array.prototype.indexOf;
|
|
24
|
+
function arrayIndexOf(values, search) {
|
|
25
|
+
return arrayApply(indexOf, values, [search]);
|
|
26
|
+
}
|
|
27
|
+
const defineProperty = Object.defineProperty;
|
|
28
|
+
function setDataProperty(target, key, value) {
|
|
29
|
+
defineProperty(target, key, {
|
|
30
|
+
__proto__: null,
|
|
31
|
+
value,
|
|
32
|
+
writable: true,
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// packages/intl-supportedvaluesof/supported-entries.ts
|
|
38
|
+
const apply$2 = Reflect.apply;
|
|
39
|
+
const sort = Array.prototype.sort;
|
|
40
|
+
function supportedEntries(candidates, supported) {
|
|
41
|
+
const result = [];
|
|
42
|
+
for (let index = 0; index < candidates.length; index++) {
|
|
43
|
+
const entry = candidates[index];
|
|
44
|
+
if (supported(entry)) setDataProperty(result, `${result.length}`, entry);
|
|
45
|
+
}
|
|
46
|
+
apply$2(sort, result, []);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
12
49
|
// packages/intl-supportedvaluesof/memoize.ts
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
50
|
+
const descriptor = Object.getOwnPropertyDescriptor;
|
|
51
|
+
const getPrototypeOf = Object.getPrototypeOf;
|
|
52
|
+
const objectPrototype = Object.prototype;
|
|
53
|
+
const apply$1 = Reflect.apply;
|
|
54
|
+
const memoizeOptions = {
|
|
55
|
+
__proto__: null,
|
|
56
|
+
strategy: strategies.variadic
|
|
57
|
+
};
|
|
58
|
+
const availableCalendarsKey = Symbol.for("@formatjs/intl-datetimeformat/availableCalendars");
|
|
59
|
+
const hasTimeZoneKey = Symbol.for("@formatjs/intl-datetimeformat/hasTimeZone");
|
|
60
|
+
function ownValue(object, key) {
|
|
61
|
+
const property = descriptor(object, key);
|
|
62
|
+
return property && descriptor(property, "value")?.value;
|
|
63
|
+
}
|
|
64
|
+
function findProperty(owner, key) {
|
|
65
|
+
while (owner !== null && (typeof owner === "object" || typeof owner === "function") && owner !== objectPrototype) {
|
|
66
|
+
const property = descriptor(owner, key);
|
|
67
|
+
if (property) return property;
|
|
68
|
+
owner = getPrototypeOf(owner);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function resolvedOptions(Constructor) {
|
|
72
|
+
const property = findProperty(ownValue(Constructor, "prototype"), "resolvedOptions");
|
|
73
|
+
const method = property && ownValue(property, "value");
|
|
74
|
+
if (typeof method === "function") return (formatter) => apply$1(method, formatter, []);
|
|
75
|
+
}
|
|
76
|
+
let intl = ownValue(globalThis, "Intl");
|
|
77
|
+
function retainProbe(name, createProbe) {
|
|
78
|
+
const probes = /* @__PURE__ */ new WeakMap();
|
|
79
|
+
const readProbe = probes.get.bind(probes);
|
|
80
|
+
const writeProbe = probes.set.bind(probes);
|
|
81
|
+
let currentProbe;
|
|
82
|
+
const getProbe = () => {
|
|
83
|
+
intl ??= ownValue(globalThis, "Intl");
|
|
84
|
+
const property = intl && descriptor(intl, name);
|
|
85
|
+
const data = property && descriptor(property, "value");
|
|
86
|
+
if (!data) return currentProbe;
|
|
87
|
+
const candidate = data.value;
|
|
88
|
+
if (typeof candidate !== "function") return void 0;
|
|
89
|
+
const Constructor = candidate;
|
|
90
|
+
let probe = readProbe(Constructor);
|
|
91
|
+
if (probe === void 0) {
|
|
92
|
+
probe = createProbe(Constructor);
|
|
93
|
+
writeProbe(Constructor, probe);
|
|
94
|
+
}
|
|
95
|
+
currentProbe = probe;
|
|
96
|
+
return probe;
|
|
97
|
+
};
|
|
98
|
+
getProbe();
|
|
99
|
+
return getProbe;
|
|
100
|
+
}
|
|
101
|
+
function memoizeHost(Constructor, construct) {
|
|
102
|
+
const marker = findProperty(Constructor, "polyfilled");
|
|
103
|
+
return marker && ownValue(marker, "value") ? construct : memoize(construct, memoizeOptions);
|
|
104
|
+
}
|
|
105
|
+
const getDateTimeFormatProbe = retainProbe("DateTimeFormat", (Constructor) => {
|
|
106
|
+
const availableCalendars = ownValue(Constructor, availableCalendarsKey);
|
|
107
|
+
const hasTimeZone = ownValue(Constructor, hasTimeZoneKey);
|
|
108
|
+
return {
|
|
109
|
+
create: memoizeHost(Constructor, (locales, options) => new Constructor(locales, options)),
|
|
110
|
+
resolve: resolvedOptions(Constructor),
|
|
111
|
+
availableCalendars: typeof availableCalendars === "function" ? () => apply$1(availableCalendars, Constructor, []) : void 0,
|
|
112
|
+
hasTimeZone: typeof hasTimeZone === "function" ? (name) => apply$1(hasTimeZone, Constructor, [name]) : void 0
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
const getNumberFormatProbe = retainProbe("NumberFormat", (Constructor) => {
|
|
116
|
+
const property = findProperty(ownValue(Constructor, "prototype"), "format");
|
|
117
|
+
const getter = property && ownValue(property, "get");
|
|
118
|
+
const method = property && ownValue(property, "value");
|
|
119
|
+
const partsProperty = findProperty(ownValue(Constructor, "prototype"), "formatToParts");
|
|
120
|
+
const parts = partsProperty && ownValue(partsProperty, "value");
|
|
121
|
+
let format;
|
|
122
|
+
if (typeof getter === "function") format = (formatter, value) => apply$1(apply$1(getter, formatter, []), void 0, [value]);
|
|
123
|
+
else if (typeof method === "function") format = (formatter, value) => apply$1(method, formatter, [value]);
|
|
124
|
+
return {
|
|
125
|
+
create: memoizeHost(Constructor, (locales, options) => new Constructor(locales, options)),
|
|
126
|
+
resolve: resolvedOptions(Constructor),
|
|
127
|
+
format,
|
|
128
|
+
formatToParts: typeof parts === "function" ? (formatter, value) => apply$1(parts, formatter, [value]) : void 0
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
const getCollatorProbe = retainProbe("Collator", (Constructor) => ({
|
|
132
|
+
create: (locale) => new Constructor(locale),
|
|
133
|
+
resolve: resolvedOptions(Constructor)
|
|
134
|
+
}));
|
|
135
|
+
const getRelativeTimeFormatProbe = retainProbe("RelativeTimeFormat", (Constructor) => ({
|
|
136
|
+
create: (locale) => new Constructor(locale),
|
|
137
|
+
resolve: resolvedOptions(Constructor)
|
|
138
|
+
}));
|
|
139
|
+
const getCurrencyDisplayNamesProbe = retainProbe("DisplayNames", (Constructor) => {
|
|
140
|
+
const property = findProperty(ownValue(Constructor, "prototype"), "of");
|
|
141
|
+
const of = property && ownValue(property, "value");
|
|
142
|
+
return {
|
|
143
|
+
create: (locale) => new Constructor(locale, {
|
|
144
|
+
__proto__: null,
|
|
145
|
+
type: "currency",
|
|
146
|
+
fallback: "none"
|
|
147
|
+
}),
|
|
148
|
+
hasName: typeof of === "function" ? (formatter, code) => apply$1(of, formatter, [code]) !== void 0 : void 0
|
|
149
|
+
};
|
|
150
|
+
});
|
|
22
151
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/calendars.js
|
|
23
152
|
const calendars = [
|
|
24
153
|
"buddhist",
|
|
@@ -35,33 +164,548 @@ const calendars = [
|
|
|
35
164
|
"islamic-rgsa",
|
|
36
165
|
"islamic-tbla",
|
|
37
166
|
"islamic-umalqura",
|
|
38
|
-
"islamicc",
|
|
39
167
|
"iso8601",
|
|
40
168
|
"japanese",
|
|
41
169
|
"persian",
|
|
42
170
|
"roc"
|
|
43
171
|
];
|
|
172
|
+
const calendarCandidateLocales = {
|
|
173
|
+
"buddhist": [
|
|
174
|
+
"en",
|
|
175
|
+
"th",
|
|
176
|
+
"th-TH",
|
|
177
|
+
"th-Thai-TH"
|
|
178
|
+
],
|
|
179
|
+
"chinese": [
|
|
180
|
+
"en",
|
|
181
|
+
"zh",
|
|
182
|
+
"zh-CN",
|
|
183
|
+
"zh-Hans-CN",
|
|
184
|
+
"zh-HK",
|
|
185
|
+
"zh-Hant-HK",
|
|
186
|
+
"zh-MO",
|
|
187
|
+
"zh-Hant-MO",
|
|
188
|
+
"zh-TW",
|
|
189
|
+
"zh-Hant-TW"
|
|
190
|
+
],
|
|
191
|
+
"coptic": [
|
|
192
|
+
"en",
|
|
193
|
+
"ar",
|
|
194
|
+
"ar-EG",
|
|
195
|
+
"ar-Arab-EG"
|
|
196
|
+
],
|
|
197
|
+
"dangi": [
|
|
198
|
+
"en",
|
|
199
|
+
"ko",
|
|
200
|
+
"ko-KR",
|
|
201
|
+
"ko-Kore-KR"
|
|
202
|
+
],
|
|
203
|
+
"ethioaa": [
|
|
204
|
+
"en",
|
|
205
|
+
"ar",
|
|
206
|
+
"fa",
|
|
207
|
+
"sq",
|
|
208
|
+
"az",
|
|
209
|
+
"bn",
|
|
210
|
+
"zh",
|
|
211
|
+
"fr",
|
|
212
|
+
"ti",
|
|
213
|
+
"am",
|
|
214
|
+
"id",
|
|
215
|
+
"he",
|
|
216
|
+
"hi",
|
|
217
|
+
"ja",
|
|
218
|
+
"ko",
|
|
219
|
+
"dv",
|
|
220
|
+
"ms",
|
|
221
|
+
"ha",
|
|
222
|
+
"ur",
|
|
223
|
+
"th",
|
|
224
|
+
"tg",
|
|
225
|
+
"tk",
|
|
226
|
+
"tr",
|
|
227
|
+
"uz"
|
|
228
|
+
],
|
|
229
|
+
"ethiopic": [
|
|
230
|
+
"en",
|
|
231
|
+
"am",
|
|
232
|
+
"am-ET",
|
|
233
|
+
"am-Ethi-ET"
|
|
234
|
+
],
|
|
235
|
+
"gregory": [
|
|
236
|
+
"en",
|
|
237
|
+
"ar",
|
|
238
|
+
"ar-AE",
|
|
239
|
+
"ar-Arab-AE",
|
|
240
|
+
"fa",
|
|
241
|
+
"fa-AF",
|
|
242
|
+
"fa-Arab-AF",
|
|
243
|
+
"sq",
|
|
244
|
+
"sq-AL",
|
|
245
|
+
"sq-Latn-AL",
|
|
246
|
+
"az",
|
|
247
|
+
"az-AZ",
|
|
248
|
+
"az-Latn-AZ",
|
|
249
|
+
"bn",
|
|
250
|
+
"bn-BD",
|
|
251
|
+
"bn-Beng-BD",
|
|
252
|
+
"ar-BH",
|
|
253
|
+
"ar-Arab-BH",
|
|
254
|
+
"zh",
|
|
255
|
+
"zh-CN",
|
|
256
|
+
"zh-Hans-CN",
|
|
257
|
+
"fr",
|
|
258
|
+
"fr-DJ",
|
|
259
|
+
"fr-Latn-DJ",
|
|
260
|
+
"ar-DZ",
|
|
261
|
+
"ar-Arab-DZ",
|
|
262
|
+
"ar-EG",
|
|
263
|
+
"ar-Arab-EG",
|
|
264
|
+
"ar-EH",
|
|
265
|
+
"ar-Arab-EH",
|
|
266
|
+
"ti",
|
|
267
|
+
"ti-ER",
|
|
268
|
+
"ti-Ethi-ER",
|
|
269
|
+
"am",
|
|
270
|
+
"am-ET",
|
|
271
|
+
"am-Ethi-ET",
|
|
272
|
+
"zh-HK",
|
|
273
|
+
"zh-Hant-HK",
|
|
274
|
+
"id",
|
|
275
|
+
"id-ID",
|
|
276
|
+
"id-Latn-ID",
|
|
277
|
+
"he",
|
|
278
|
+
"he-IL",
|
|
279
|
+
"he-Hebr-IL",
|
|
280
|
+
"hi",
|
|
281
|
+
"hi-IN",
|
|
282
|
+
"hi-Deva-IN",
|
|
283
|
+
"ar-IQ",
|
|
284
|
+
"ar-Arab-IQ",
|
|
285
|
+
"fa-IR",
|
|
286
|
+
"fa-Arab-IR",
|
|
287
|
+
"ar-JO",
|
|
288
|
+
"ar-Arab-JO",
|
|
289
|
+
"ja",
|
|
290
|
+
"ja-JP",
|
|
291
|
+
"ja-Jpan-JP",
|
|
292
|
+
"ar-KM",
|
|
293
|
+
"ar-Arab-KM",
|
|
294
|
+
"ko",
|
|
295
|
+
"ko-KR",
|
|
296
|
+
"ko-Kore-KR",
|
|
297
|
+
"ar-KW",
|
|
298
|
+
"ar-Arab-KW",
|
|
299
|
+
"ar-LB",
|
|
300
|
+
"ar-Arab-LB",
|
|
301
|
+
"ar-LY",
|
|
302
|
+
"ar-Arab-LY",
|
|
303
|
+
"ar-MA",
|
|
304
|
+
"ar-Arab-MA",
|
|
305
|
+
"zh-MO",
|
|
306
|
+
"zh-Hant-MO",
|
|
307
|
+
"ar-MR",
|
|
308
|
+
"ar-Arab-MR",
|
|
309
|
+
"dv",
|
|
310
|
+
"dv-MV",
|
|
311
|
+
"dv-Thaa-MV",
|
|
312
|
+
"ms",
|
|
313
|
+
"ms-MY",
|
|
314
|
+
"ms-Latn-MY",
|
|
315
|
+
"ha",
|
|
316
|
+
"ha-NE",
|
|
317
|
+
"ha-Latn-NE",
|
|
318
|
+
"ar-OM",
|
|
319
|
+
"ar-Arab-OM",
|
|
320
|
+
"ur",
|
|
321
|
+
"ur-PK",
|
|
322
|
+
"ur-Arab-PK",
|
|
323
|
+
"ar-PS",
|
|
324
|
+
"ar-Arab-PS",
|
|
325
|
+
"ar-QA",
|
|
326
|
+
"ar-Arab-QA",
|
|
327
|
+
"ar-SA",
|
|
328
|
+
"ar-Arab-SA",
|
|
329
|
+
"ar-SD",
|
|
330
|
+
"ar-Arab-SD",
|
|
331
|
+
"ar-SY",
|
|
332
|
+
"ar-Arab-SY",
|
|
333
|
+
"ar-TD",
|
|
334
|
+
"ar-Arab-TD",
|
|
335
|
+
"th",
|
|
336
|
+
"th-TH",
|
|
337
|
+
"th-Thai-TH",
|
|
338
|
+
"tg",
|
|
339
|
+
"tg-TJ",
|
|
340
|
+
"tg-Cyrl-TJ",
|
|
341
|
+
"tk",
|
|
342
|
+
"tk-TM",
|
|
343
|
+
"tk-Latn-TM",
|
|
344
|
+
"ar-TN",
|
|
345
|
+
"ar-Arab-TN",
|
|
346
|
+
"tr",
|
|
347
|
+
"tr-TR",
|
|
348
|
+
"tr-Latn-TR",
|
|
349
|
+
"zh-TW",
|
|
350
|
+
"zh-Hant-TW",
|
|
351
|
+
"uz",
|
|
352
|
+
"uz-UZ",
|
|
353
|
+
"uz-Latn-UZ",
|
|
354
|
+
"sq-XK",
|
|
355
|
+
"sq-Latn-XK",
|
|
356
|
+
"ar-YE",
|
|
357
|
+
"ar-Arab-YE"
|
|
358
|
+
],
|
|
359
|
+
"hebrew": [
|
|
360
|
+
"en",
|
|
361
|
+
"he",
|
|
362
|
+
"he-IL",
|
|
363
|
+
"he-Hebr-IL"
|
|
364
|
+
],
|
|
365
|
+
"indian": [
|
|
366
|
+
"en",
|
|
367
|
+
"hi",
|
|
368
|
+
"hi-IN",
|
|
369
|
+
"hi-Deva-IN"
|
|
370
|
+
],
|
|
371
|
+
"islamic": [
|
|
372
|
+
"en",
|
|
373
|
+
"ar",
|
|
374
|
+
"ar-AE",
|
|
375
|
+
"ar-Arab-AE",
|
|
376
|
+
"fa",
|
|
377
|
+
"fa-AF",
|
|
378
|
+
"fa-Arab-AF",
|
|
379
|
+
"bn",
|
|
380
|
+
"bn-BD",
|
|
381
|
+
"bn-Beng-BD",
|
|
382
|
+
"ar-BH",
|
|
383
|
+
"ar-Arab-BH",
|
|
384
|
+
"fr",
|
|
385
|
+
"fr-DJ",
|
|
386
|
+
"fr-Latn-DJ",
|
|
387
|
+
"ar-DZ",
|
|
388
|
+
"ar-Arab-DZ",
|
|
389
|
+
"ar-EG",
|
|
390
|
+
"ar-Arab-EG",
|
|
391
|
+
"ar-EH",
|
|
392
|
+
"ar-Arab-EH",
|
|
393
|
+
"ti",
|
|
394
|
+
"ti-ER",
|
|
395
|
+
"ti-Ethi-ER",
|
|
396
|
+
"id",
|
|
397
|
+
"id-ID",
|
|
398
|
+
"id-Latn-ID",
|
|
399
|
+
"he",
|
|
400
|
+
"he-IL",
|
|
401
|
+
"he-Hebr-IL",
|
|
402
|
+
"ar-IQ",
|
|
403
|
+
"ar-Arab-IQ",
|
|
404
|
+
"fa-IR",
|
|
405
|
+
"fa-Arab-IR",
|
|
406
|
+
"ar-JO",
|
|
407
|
+
"ar-Arab-JO",
|
|
408
|
+
"ar-KM",
|
|
409
|
+
"ar-Arab-KM",
|
|
410
|
+
"ar-KW",
|
|
411
|
+
"ar-Arab-KW",
|
|
412
|
+
"ar-LB",
|
|
413
|
+
"ar-Arab-LB",
|
|
414
|
+
"ar-LY",
|
|
415
|
+
"ar-Arab-LY",
|
|
416
|
+
"ar-MA",
|
|
417
|
+
"ar-Arab-MA",
|
|
418
|
+
"ar-MR",
|
|
419
|
+
"ar-Arab-MR",
|
|
420
|
+
"ms",
|
|
421
|
+
"ms-MY",
|
|
422
|
+
"ms-Latn-MY",
|
|
423
|
+
"ha",
|
|
424
|
+
"ha-NE",
|
|
425
|
+
"ha-Latn-NE",
|
|
426
|
+
"ar-OM",
|
|
427
|
+
"ar-Arab-OM",
|
|
428
|
+
"ur",
|
|
429
|
+
"ur-PK",
|
|
430
|
+
"ur-Arab-PK",
|
|
431
|
+
"ar-PS",
|
|
432
|
+
"ar-Arab-PS",
|
|
433
|
+
"ar-QA",
|
|
434
|
+
"ar-Arab-QA",
|
|
435
|
+
"ar-SA",
|
|
436
|
+
"ar-Arab-SA",
|
|
437
|
+
"ar-SD",
|
|
438
|
+
"ar-Arab-SD",
|
|
439
|
+
"ar-SY",
|
|
440
|
+
"ar-Arab-SY",
|
|
441
|
+
"ar-TD",
|
|
442
|
+
"ar-Arab-TD",
|
|
443
|
+
"ar-TN",
|
|
444
|
+
"ar-Arab-TN",
|
|
445
|
+
"ar-YE",
|
|
446
|
+
"ar-Arab-YE"
|
|
447
|
+
],
|
|
448
|
+
"islamic-civil": [
|
|
449
|
+
"en",
|
|
450
|
+
"ar",
|
|
451
|
+
"ar-AE",
|
|
452
|
+
"ar-Arab-AE",
|
|
453
|
+
"fa",
|
|
454
|
+
"fa-AF",
|
|
455
|
+
"fa-Arab-AF",
|
|
456
|
+
"sq",
|
|
457
|
+
"sq-AL",
|
|
458
|
+
"sq-Latn-AL",
|
|
459
|
+
"az",
|
|
460
|
+
"az-AZ",
|
|
461
|
+
"az-Latn-AZ",
|
|
462
|
+
"bn",
|
|
463
|
+
"bn-BD",
|
|
464
|
+
"bn-Beng-BD",
|
|
465
|
+
"ar-BH",
|
|
466
|
+
"ar-Arab-BH",
|
|
467
|
+
"fr",
|
|
468
|
+
"fr-DJ",
|
|
469
|
+
"fr-Latn-DJ",
|
|
470
|
+
"ar-DZ",
|
|
471
|
+
"ar-Arab-DZ",
|
|
472
|
+
"ar-EG",
|
|
473
|
+
"ar-Arab-EG",
|
|
474
|
+
"ar-EH",
|
|
475
|
+
"ar-Arab-EH",
|
|
476
|
+
"ti",
|
|
477
|
+
"ti-ER",
|
|
478
|
+
"ti-Ethi-ER",
|
|
479
|
+
"id",
|
|
480
|
+
"id-ID",
|
|
481
|
+
"id-Latn-ID",
|
|
482
|
+
"he",
|
|
483
|
+
"he-IL",
|
|
484
|
+
"he-Hebr-IL",
|
|
485
|
+
"ar-IQ",
|
|
486
|
+
"ar-Arab-IQ",
|
|
487
|
+
"fa-IR",
|
|
488
|
+
"fa-Arab-IR",
|
|
489
|
+
"ar-JO",
|
|
490
|
+
"ar-Arab-JO",
|
|
491
|
+
"ar-KM",
|
|
492
|
+
"ar-Arab-KM",
|
|
493
|
+
"ar-KW",
|
|
494
|
+
"ar-Arab-KW",
|
|
495
|
+
"ar-LB",
|
|
496
|
+
"ar-Arab-LB",
|
|
497
|
+
"ar-LY",
|
|
498
|
+
"ar-Arab-LY",
|
|
499
|
+
"ar-MA",
|
|
500
|
+
"ar-Arab-MA",
|
|
501
|
+
"ar-MR",
|
|
502
|
+
"ar-Arab-MR",
|
|
503
|
+
"dv",
|
|
504
|
+
"dv-MV",
|
|
505
|
+
"dv-Thaa-MV",
|
|
506
|
+
"ms",
|
|
507
|
+
"ms-MY",
|
|
508
|
+
"ms-Latn-MY",
|
|
509
|
+
"ha",
|
|
510
|
+
"ha-NE",
|
|
511
|
+
"ha-Latn-NE",
|
|
512
|
+
"ar-OM",
|
|
513
|
+
"ar-Arab-OM",
|
|
514
|
+
"ur",
|
|
515
|
+
"ur-PK",
|
|
516
|
+
"ur-Arab-PK",
|
|
517
|
+
"ar-PS",
|
|
518
|
+
"ar-Arab-PS",
|
|
519
|
+
"ar-QA",
|
|
520
|
+
"ar-Arab-QA",
|
|
521
|
+
"ar-SD",
|
|
522
|
+
"ar-Arab-SD",
|
|
523
|
+
"ar-SY",
|
|
524
|
+
"ar-Arab-SY",
|
|
525
|
+
"ar-TD",
|
|
526
|
+
"ar-Arab-TD",
|
|
527
|
+
"tg",
|
|
528
|
+
"tg-TJ",
|
|
529
|
+
"tg-Cyrl-TJ",
|
|
530
|
+
"tk",
|
|
531
|
+
"tk-TM",
|
|
532
|
+
"tk-Latn-TM",
|
|
533
|
+
"ar-TN",
|
|
534
|
+
"ar-Arab-TN",
|
|
535
|
+
"tr",
|
|
536
|
+
"tr-TR",
|
|
537
|
+
"tr-Latn-TR",
|
|
538
|
+
"uz",
|
|
539
|
+
"uz-UZ",
|
|
540
|
+
"uz-Latn-UZ",
|
|
541
|
+
"sq-XK",
|
|
542
|
+
"sq-Latn-XK",
|
|
543
|
+
"ar-YE",
|
|
544
|
+
"ar-Arab-YE"
|
|
545
|
+
],
|
|
546
|
+
"islamic-rgsa": [
|
|
547
|
+
"en",
|
|
548
|
+
"ar",
|
|
549
|
+
"ar-SA",
|
|
550
|
+
"ar-Arab-SA"
|
|
551
|
+
],
|
|
552
|
+
"islamic-tbla": [
|
|
553
|
+
"en",
|
|
554
|
+
"ar",
|
|
555
|
+
"ar-AE",
|
|
556
|
+
"ar-Arab-AE",
|
|
557
|
+
"fa",
|
|
558
|
+
"fa-AF",
|
|
559
|
+
"fa-Arab-AF",
|
|
560
|
+
"sq",
|
|
561
|
+
"sq-AL",
|
|
562
|
+
"sq-Latn-AL",
|
|
563
|
+
"az",
|
|
564
|
+
"az-AZ",
|
|
565
|
+
"az-Latn-AZ",
|
|
566
|
+
"bn",
|
|
567
|
+
"bn-BD",
|
|
568
|
+
"bn-Beng-BD",
|
|
569
|
+
"ar-BH",
|
|
570
|
+
"ar-Arab-BH",
|
|
571
|
+
"fr",
|
|
572
|
+
"fr-DJ",
|
|
573
|
+
"fr-Latn-DJ",
|
|
574
|
+
"ar-DZ",
|
|
575
|
+
"ar-Arab-DZ",
|
|
576
|
+
"ar-EG",
|
|
577
|
+
"ar-Arab-EG",
|
|
578
|
+
"ar-EH",
|
|
579
|
+
"ar-Arab-EH",
|
|
580
|
+
"ti",
|
|
581
|
+
"ti-ER",
|
|
582
|
+
"ti-Ethi-ER",
|
|
583
|
+
"id",
|
|
584
|
+
"id-ID",
|
|
585
|
+
"id-Latn-ID",
|
|
586
|
+
"he",
|
|
587
|
+
"he-IL",
|
|
588
|
+
"he-Hebr-IL",
|
|
589
|
+
"ar-IQ",
|
|
590
|
+
"ar-Arab-IQ",
|
|
591
|
+
"fa-IR",
|
|
592
|
+
"fa-Arab-IR",
|
|
593
|
+
"ar-JO",
|
|
594
|
+
"ar-Arab-JO",
|
|
595
|
+
"ar-KM",
|
|
596
|
+
"ar-Arab-KM",
|
|
597
|
+
"ar-KW",
|
|
598
|
+
"ar-Arab-KW",
|
|
599
|
+
"ar-LB",
|
|
600
|
+
"ar-Arab-LB",
|
|
601
|
+
"ar-LY",
|
|
602
|
+
"ar-Arab-LY",
|
|
603
|
+
"ar-MA",
|
|
604
|
+
"ar-Arab-MA",
|
|
605
|
+
"ar-MR",
|
|
606
|
+
"ar-Arab-MR",
|
|
607
|
+
"dv",
|
|
608
|
+
"dv-MV",
|
|
609
|
+
"dv-Thaa-MV",
|
|
610
|
+
"ms",
|
|
611
|
+
"ms-MY",
|
|
612
|
+
"ms-Latn-MY",
|
|
613
|
+
"ha",
|
|
614
|
+
"ha-NE",
|
|
615
|
+
"ha-Latn-NE",
|
|
616
|
+
"ar-OM",
|
|
617
|
+
"ar-Arab-OM",
|
|
618
|
+
"ur",
|
|
619
|
+
"ur-PK",
|
|
620
|
+
"ur-Arab-PK",
|
|
621
|
+
"ar-PS",
|
|
622
|
+
"ar-Arab-PS",
|
|
623
|
+
"ar-QA",
|
|
624
|
+
"ar-Arab-QA",
|
|
625
|
+
"ar-SD",
|
|
626
|
+
"ar-Arab-SD",
|
|
627
|
+
"ar-SY",
|
|
628
|
+
"ar-Arab-SY",
|
|
629
|
+
"ar-TD",
|
|
630
|
+
"ar-Arab-TD",
|
|
631
|
+
"tg",
|
|
632
|
+
"tg-TJ",
|
|
633
|
+
"tg-Cyrl-TJ",
|
|
634
|
+
"tk",
|
|
635
|
+
"tk-TM",
|
|
636
|
+
"tk-Latn-TM",
|
|
637
|
+
"ar-TN",
|
|
638
|
+
"ar-Arab-TN",
|
|
639
|
+
"tr",
|
|
640
|
+
"tr-TR",
|
|
641
|
+
"tr-Latn-TR",
|
|
642
|
+
"uz",
|
|
643
|
+
"uz-UZ",
|
|
644
|
+
"uz-Latn-UZ",
|
|
645
|
+
"sq-XK",
|
|
646
|
+
"sq-Latn-XK",
|
|
647
|
+
"ar-YE",
|
|
648
|
+
"ar-Arab-YE"
|
|
649
|
+
],
|
|
650
|
+
"islamic-umalqura": [
|
|
651
|
+
"en",
|
|
652
|
+
"ar",
|
|
653
|
+
"ar-AE",
|
|
654
|
+
"ar-Arab-AE",
|
|
655
|
+
"ar-BH",
|
|
656
|
+
"ar-Arab-BH",
|
|
657
|
+
"ar-KW",
|
|
658
|
+
"ar-Arab-KW",
|
|
659
|
+
"ar-QA",
|
|
660
|
+
"ar-Arab-QA",
|
|
661
|
+
"ar-SA",
|
|
662
|
+
"ar-Arab-SA"
|
|
663
|
+
],
|
|
664
|
+
"iso8601": ["en"],
|
|
665
|
+
"japanese": [
|
|
666
|
+
"en",
|
|
667
|
+
"ja",
|
|
668
|
+
"ja-JP",
|
|
669
|
+
"ja-Jpan-JP"
|
|
670
|
+
],
|
|
671
|
+
"persian": [
|
|
672
|
+
"en",
|
|
673
|
+
"fa",
|
|
674
|
+
"fa-AF",
|
|
675
|
+
"fa-Arab-AF",
|
|
676
|
+
"fa-IR",
|
|
677
|
+
"fa-Arab-IR"
|
|
678
|
+
],
|
|
679
|
+
"roc": [
|
|
680
|
+
"en",
|
|
681
|
+
"zh",
|
|
682
|
+
"zh-TW",
|
|
683
|
+
"zh-Hant-TW"
|
|
684
|
+
]
|
|
685
|
+
};
|
|
44
686
|
// packages/intl-supportedvaluesof/get-supported-calendars.ts
|
|
45
|
-
/**
|
|
46
|
-
* Implementation: Tests if a calendar is supported by attempting to create
|
|
47
|
-
* a DateTimeFormat with that calendar and verifying it was accepted.
|
|
48
|
-
*
|
|
49
|
-
* CLDR Data: Candidate values come from CLDR calendar types
|
|
50
|
-
*/
|
|
51
|
-
function isSupportedCalendar(item) {
|
|
52
|
-
try {
|
|
53
|
-
return createMemoizedDateTimeFormat(`en-u-ca-${item}`).resolvedOptions().calendar === item;
|
|
54
|
-
} catch {}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* ECMA-402 Spec: Returns supported calendar identifiers
|
|
59
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
60
|
-
*
|
|
61
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
62
|
-
*/
|
|
63
687
|
function getSupportedCalendars() {
|
|
64
|
-
|
|
688
|
+
const probe = getDateTimeFormatProbe();
|
|
689
|
+
if (probe?.availableCalendars) try {
|
|
690
|
+
const available = probe.availableCalendars();
|
|
691
|
+
return supportedEntries(calendars, (calendar) => calendar === "iso8601" || arrayIndexOf(available, calendar) >= 0);
|
|
692
|
+
} catch {}
|
|
693
|
+
if (!probe?.resolve) return ["iso8601"];
|
|
694
|
+
const { create, resolve } = probe;
|
|
695
|
+
return supportedEntries(calendars, (calendar) => {
|
|
696
|
+
if (calendar === "iso8601") return true;
|
|
697
|
+
const options = {
|
|
698
|
+
__proto__: null,
|
|
699
|
+
calendar
|
|
700
|
+
};
|
|
701
|
+
return arraySome(calendarCandidateLocales[calendar], (locale) => {
|
|
702
|
+
try {
|
|
703
|
+
return resolve(create(`${locale}-u-ca-${calendar}`, options)).calendar === calendar;
|
|
704
|
+
} catch {
|
|
705
|
+
return false;
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
});
|
|
65
709
|
}
|
|
66
710
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/collations.js
|
|
67
711
|
const collations = [
|
|
@@ -385,71 +1029,26 @@ const collationCandidateLocales = {
|
|
|
385
1029
|
"zhuyin": ["zh", "zh-Hant"]
|
|
386
1030
|
};
|
|
387
1031
|
// packages/intl-supportedvaluesof/get-supported-collations.ts
|
|
388
|
-
function isSupportedCollation(collation) {
|
|
389
|
-
const candidates = collationCandidateLocales[collation] || ["en"];
|
|
390
|
-
for (const locale of candidates) try {
|
|
391
|
-
if (new Intl.Collator(`${locale}-u-co-${collation}`).resolvedOptions().collation === collation) return true;
|
|
392
|
-
} catch {}
|
|
393
|
-
return false;
|
|
394
|
-
}
|
|
395
1032
|
function getSupportedCollations() {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
const createMemoizedNumberFormat = memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
|
|
407
|
-
memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
|
|
408
|
-
memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
|
|
409
|
-
const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
410
|
-
strategies.variadic;
|
|
411
|
-
let providerIntl = globalThis.Intl;
|
|
412
|
-
function ownIntlProvider(name) {
|
|
413
|
-
const descriptor = providerIntl && getOwnPropertyDescriptor(providerIntl, name);
|
|
414
|
-
return (descriptor && getOwnPropertyDescriptor(descriptor, "value"))?.value;
|
|
415
|
-
}
|
|
416
|
-
let numberFormatProvider = ownIntlProvider("NumberFormat");
|
|
417
|
-
let listFormatProvider = ownIntlProvider("ListFormat");
|
|
418
|
-
const getFormatterPrototype = Object.getPrototypeOf;
|
|
419
|
-
const formatterPartsMethods = /* @__PURE__ */ new WeakMap();
|
|
420
|
-
const formatterPartsOwners = /* @__PURE__ */ new WeakMap();
|
|
421
|
-
const getPartsMethod = formatterPartsMethods.get.bind(formatterPartsMethods);
|
|
422
|
-
const setPartsMethod = formatterPartsMethods.set.bind(formatterPartsMethods);
|
|
423
|
-
const getPartsOwner = formatterPartsOwners.get.bind(formatterPartsOwners);
|
|
424
|
-
const setPartsOwner = formatterPartsOwners.set.bind(formatterPartsOwners);
|
|
425
|
-
function findFormatterPartsMethod(Constructor) {
|
|
426
|
-
const cached = getPartsMethod(Constructor);
|
|
427
|
-
if (cached) return cached;
|
|
428
|
-
let prototype = getOwnPropertyDescriptor(Constructor, "prototype")?.value;
|
|
429
|
-
while (prototype != null) {
|
|
430
|
-
const inherited = getPartsOwner(prototype);
|
|
431
|
-
if (inherited) {
|
|
432
|
-
setPartsMethod(Constructor, inherited);
|
|
433
|
-
return inherited;
|
|
1033
|
+
const probe = getCollatorProbe();
|
|
1034
|
+
if (!probe?.resolve) return [];
|
|
1035
|
+
const { create, resolve } = probe;
|
|
1036
|
+
return supportedEntries(collations, (collation) => {
|
|
1037
|
+
const candidates = collationCandidateLocales[collation] || ["en"];
|
|
1038
|
+
for (let index = 0; index < candidates.length; index++) {
|
|
1039
|
+
const locale = candidates[index];
|
|
1040
|
+
try {
|
|
1041
|
+
if (resolve(create(`${locale}-u-co-${collation}`)).collation === collation) return true;
|
|
1042
|
+
} catch {}
|
|
434
1043
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
prototype = getFormatterPrototype(prototype);
|
|
443
|
-
}
|
|
1044
|
+
return false;
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
// packages/ecma262-abstract/HasOwnProperty.js
|
|
1048
|
+
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
1049
|
+
function HasOwnProperty(o, prop) {
|
|
1050
|
+
return hasOwn(o, prop);
|
|
444
1051
|
}
|
|
445
|
-
if (typeof numberFormatProvider === "function") findFormatterPartsMethod(numberFormatProvider);
|
|
446
|
-
if (typeof listFormatProvider === "function") findFormatterPartsMethod(listFormatProvider);
|
|
447
|
-
const numberFormatMemoizers = /* @__PURE__ */ new WeakMap();
|
|
448
|
-
numberFormatMemoizers.get.bind(numberFormatMemoizers);
|
|
449
|
-
numberFormatMemoizers.set.bind(numberFormatMemoizers);
|
|
450
|
-
const listFormatMemoizers = /* @__PURE__ */ new WeakMap();
|
|
451
|
-
listFormatMemoizers.get.bind(listFormatMemoizers);
|
|
452
|
-
listFormatMemoizers.set.bind(listFormatMemoizers);
|
|
453
1052
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/currencies.js
|
|
454
1053
|
const currencies = [
|
|
455
1054
|
"ADP",
|
|
@@ -518,6 +1117,7 @@ const currencies = [
|
|
|
518
1117
|
"CLF",
|
|
519
1118
|
"CLP",
|
|
520
1119
|
"CNH",
|
|
1120
|
+
"CNX",
|
|
521
1121
|
"CNY",
|
|
522
1122
|
"COP",
|
|
523
1123
|
"COU",
|
|
@@ -720,6 +1320,7 @@ const currencies = [
|
|
|
720
1320
|
"VNN",
|
|
721
1321
|
"VUV",
|
|
722
1322
|
"WST",
|
|
1323
|
+
"XAD",
|
|
723
1324
|
"XAF",
|
|
724
1325
|
"XAG",
|
|
725
1326
|
"XAU",
|
|
@@ -759,44 +1360,64 @@ const currencies = [
|
|
|
759
1360
|
"ZWL",
|
|
760
1361
|
"ZWR"
|
|
761
1362
|
];
|
|
1363
|
+
const currencyCandidateLocales = { "XAD": ["en", "cv"] };
|
|
762
1364
|
// packages/intl-supportedvaluesof/get-supported-currencies.ts
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
*/
|
|
769
|
-
function isSupportedCurrency(currency) {
|
|
770
|
-
try {
|
|
771
|
-
const format = createMemoizedNumberFormat("en", {
|
|
772
|
-
style: "currency",
|
|
773
|
-
currencyDisplay: "name",
|
|
774
|
-
currency
|
|
775
|
-
}).format(123);
|
|
776
|
-
if (format.substring(0, 3) !== currency && format.substring(format.length - 3) !== currency) return true;
|
|
777
|
-
} catch {}
|
|
778
|
-
return false;
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* ECMA-402 Spec: Returns supported currency identifiers
|
|
782
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
783
|
-
*
|
|
784
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
785
|
-
*/
|
|
1365
|
+
const apply = Reflect.apply;
|
|
1366
|
+
const createObject = Object.create;
|
|
1367
|
+
const stringIndexOf = String.prototype.indexOf;
|
|
1368
|
+
const stringSlice = String.prototype.slice;
|
|
1369
|
+
const english = ["en"];
|
|
786
1370
|
function getSupportedCurrencies() {
|
|
1371
|
+
const probe = getNumberFormatProbe();
|
|
1372
|
+
if (!probe || !probe.formatToParts && !probe.format) return [];
|
|
1373
|
+
const { create, format, formatToParts } = probe;
|
|
1374
|
+
const namesProbe = getCurrencyDisplayNamesProbe();
|
|
1375
|
+
if (namesProbe && !namesProbe.hasName) return [];
|
|
1376
|
+
const namesByLocale = createObject(null);
|
|
787
1377
|
const ATOZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
788
|
-
const
|
|
789
|
-
for (
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
const
|
|
796
|
-
|
|
1378
|
+
const candidates = [];
|
|
1379
|
+
for (let index = 0; index < currencies.length; index++) {
|
|
1380
|
+
const currency = currencies[index];
|
|
1381
|
+
if (currency.length === 3) setDataProperty(candidates, `${candidates.length}`, currency);
|
|
1382
|
+
else if (currency.length === 5 && currency[3] === "~") {
|
|
1383
|
+
const start = apply(stringIndexOf, ATOZ, [currency[2]]);
|
|
1384
|
+
const end = apply(stringIndexOf, ATOZ, [currency[4]]);
|
|
1385
|
+
const prefix = currency[0] + currency[1];
|
|
1386
|
+
for (let i = start; i <= end; i++) setDataProperty(candidates, `${candidates.length}`, prefix + ATOZ[i]);
|
|
797
1387
|
}
|
|
798
1388
|
}
|
|
799
|
-
return
|
|
1389
|
+
return supportedEntries(candidates, (currency) => {
|
|
1390
|
+
return arraySome(HasOwnProperty(currencyCandidateLocales, currency) ? currencyCandidateLocales[currency] : english, (locale) => {
|
|
1391
|
+
try {
|
|
1392
|
+
if (namesProbe) {
|
|
1393
|
+
let names = namesByLocale[locale];
|
|
1394
|
+
if (names === void 0) {
|
|
1395
|
+
namesByLocale[locale] = null;
|
|
1396
|
+
names = namesByLocale[locale] = namesProbe.create(locale);
|
|
1397
|
+
}
|
|
1398
|
+
if (!names || !namesProbe.hasName?.(names, currency)) return false;
|
|
1399
|
+
}
|
|
1400
|
+
const formatter = create(locale, {
|
|
1401
|
+
__proto__: null,
|
|
1402
|
+
style: "currency",
|
|
1403
|
+
currencyDisplay: "name",
|
|
1404
|
+
currency
|
|
1405
|
+
});
|
|
1406
|
+
if (formatToParts) {
|
|
1407
|
+
const parts = formatToParts(formatter, 123);
|
|
1408
|
+
for (let i = 0; i < parts.length; i++) {
|
|
1409
|
+
const part = parts[i];
|
|
1410
|
+
if (part.type === "currency" && part.value !== currency) return true;
|
|
1411
|
+
}
|
|
1412
|
+
return false;
|
|
1413
|
+
}
|
|
1414
|
+
const text = format(formatter, 123);
|
|
1415
|
+
return apply(stringSlice, text, [0, 3]) !== currency && apply(stringSlice, text, [-3]) !== currency;
|
|
1416
|
+
} catch {
|
|
1417
|
+
return false;
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
});
|
|
800
1421
|
}
|
|
801
1422
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.number@0.0.0/node_modules/@formatjs_generated/cldr.number/numbering-systems.js
|
|
802
1423
|
const numberingSystemNames = [
|
|
@@ -898,28 +1519,183 @@ const numberingSystemNames = [
|
|
|
898
1519
|
"wara",
|
|
899
1520
|
"wcho"
|
|
900
1521
|
];
|
|
1522
|
+
const numericNumberingSystemNames = [
|
|
1523
|
+
"adlm",
|
|
1524
|
+
"ahom",
|
|
1525
|
+
"arab",
|
|
1526
|
+
"arabext",
|
|
1527
|
+
"bali",
|
|
1528
|
+
"beng",
|
|
1529
|
+
"bhks",
|
|
1530
|
+
"brah",
|
|
1531
|
+
"cakm",
|
|
1532
|
+
"cham",
|
|
1533
|
+
"deva",
|
|
1534
|
+
"diak",
|
|
1535
|
+
"fullwide",
|
|
1536
|
+
"gara",
|
|
1537
|
+
"gong",
|
|
1538
|
+
"gonm",
|
|
1539
|
+
"gujr",
|
|
1540
|
+
"gukh",
|
|
1541
|
+
"guru",
|
|
1542
|
+
"hanidec",
|
|
1543
|
+
"hmng",
|
|
1544
|
+
"hmnp",
|
|
1545
|
+
"java",
|
|
1546
|
+
"kali",
|
|
1547
|
+
"kawi",
|
|
1548
|
+
"khmr",
|
|
1549
|
+
"knda",
|
|
1550
|
+
"krai",
|
|
1551
|
+
"lana",
|
|
1552
|
+
"lanatham",
|
|
1553
|
+
"laoo",
|
|
1554
|
+
"latn",
|
|
1555
|
+
"lepc",
|
|
1556
|
+
"limb",
|
|
1557
|
+
"mathbold",
|
|
1558
|
+
"mathdbl",
|
|
1559
|
+
"mathmono",
|
|
1560
|
+
"mathsanb",
|
|
1561
|
+
"mathsans",
|
|
1562
|
+
"mlym",
|
|
1563
|
+
"modi",
|
|
1564
|
+
"mong",
|
|
1565
|
+
"mroo",
|
|
1566
|
+
"mtei",
|
|
1567
|
+
"mymr",
|
|
1568
|
+
"mymrepka",
|
|
1569
|
+
"mymrpao",
|
|
1570
|
+
"mymrshan",
|
|
1571
|
+
"mymrtlng",
|
|
1572
|
+
"nagm",
|
|
1573
|
+
"newa",
|
|
1574
|
+
"nkoo",
|
|
1575
|
+
"olck",
|
|
1576
|
+
"onao",
|
|
1577
|
+
"orya",
|
|
1578
|
+
"osma",
|
|
1579
|
+
"outlined",
|
|
1580
|
+
"rohg",
|
|
1581
|
+
"saur",
|
|
1582
|
+
"segment",
|
|
1583
|
+
"shrd",
|
|
1584
|
+
"sind",
|
|
1585
|
+
"sinh",
|
|
1586
|
+
"sora",
|
|
1587
|
+
"sund",
|
|
1588
|
+
"sunu",
|
|
1589
|
+
"takr",
|
|
1590
|
+
"talu",
|
|
1591
|
+
"tamldec",
|
|
1592
|
+
"telu",
|
|
1593
|
+
"thai",
|
|
1594
|
+
"tibt",
|
|
1595
|
+
"tirh",
|
|
1596
|
+
"tnsa",
|
|
1597
|
+
"tols",
|
|
1598
|
+
"vaii",
|
|
1599
|
+
"wara",
|
|
1600
|
+
"wcho"
|
|
1601
|
+
];
|
|
1602
|
+
const numberingSystemCandidateLocales = {
|
|
1603
|
+
"armn": ["en", "hy"],
|
|
1604
|
+
"armnlow": ["en"],
|
|
1605
|
+
"cyrl": ["en"],
|
|
1606
|
+
"ethi": [
|
|
1607
|
+
"en",
|
|
1608
|
+
"am",
|
|
1609
|
+
"om",
|
|
1610
|
+
"om-KE",
|
|
1611
|
+
"ti",
|
|
1612
|
+
"ti-ER"
|
|
1613
|
+
],
|
|
1614
|
+
"geor": ["en", "ka"],
|
|
1615
|
+
"grek": [
|
|
1616
|
+
"en",
|
|
1617
|
+
"el",
|
|
1618
|
+
"el-CY",
|
|
1619
|
+
"el-polyton"
|
|
1620
|
+
],
|
|
1621
|
+
"greklow": ["en"],
|
|
1622
|
+
"hanidays": ["en", "zh"],
|
|
1623
|
+
"hans": [
|
|
1624
|
+
"en",
|
|
1625
|
+
"zh",
|
|
1626
|
+
"zh-Hans",
|
|
1627
|
+
"zh-Hans-HK",
|
|
1628
|
+
"zh-Hans-MO",
|
|
1629
|
+
"zh-Hans-MY",
|
|
1630
|
+
"zh-Hans-SG"
|
|
1631
|
+
],
|
|
1632
|
+
"hansfin": [
|
|
1633
|
+
"en",
|
|
1634
|
+
"zh",
|
|
1635
|
+
"zh-Hans",
|
|
1636
|
+
"zh-Hans-HK",
|
|
1637
|
+
"zh-Hans-MO",
|
|
1638
|
+
"zh-Hans-MY",
|
|
1639
|
+
"zh-Hans-SG"
|
|
1640
|
+
],
|
|
1641
|
+
"hant": [
|
|
1642
|
+
"en",
|
|
1643
|
+
"zh-Hant",
|
|
1644
|
+
"yue",
|
|
1645
|
+
"yue-Hans",
|
|
1646
|
+
"yue-Hant",
|
|
1647
|
+
"yue-Hant-CN",
|
|
1648
|
+
"yue-Hant-MO",
|
|
1649
|
+
"zh-Hant-HK",
|
|
1650
|
+
"zh-Hant-MO",
|
|
1651
|
+
"zh-Hant-MY"
|
|
1652
|
+
],
|
|
1653
|
+
"hantfin": [
|
|
1654
|
+
"en",
|
|
1655
|
+
"zh-Hant",
|
|
1656
|
+
"yue",
|
|
1657
|
+
"yue-Hans",
|
|
1658
|
+
"yue-Hant",
|
|
1659
|
+
"yue-Hant-CN",
|
|
1660
|
+
"yue-Hant-MO",
|
|
1661
|
+
"zh-Hant-HK",
|
|
1662
|
+
"zh-Hant-MO",
|
|
1663
|
+
"zh-Hant-MY"
|
|
1664
|
+
],
|
|
1665
|
+
"hebr": [
|
|
1666
|
+
"en",
|
|
1667
|
+
"he",
|
|
1668
|
+
"yi"
|
|
1669
|
+
],
|
|
1670
|
+
"jpan": ["en", "ja"],
|
|
1671
|
+
"jpanfin": ["en", "ja"],
|
|
1672
|
+
"jpanyear": ["en", "ja"],
|
|
1673
|
+
"roman": ["en"],
|
|
1674
|
+
"romanlow": ["en"],
|
|
1675
|
+
"taml": [
|
|
1676
|
+
"en",
|
|
1677
|
+
"ta",
|
|
1678
|
+
"ta-LK",
|
|
1679
|
+
"ta-MY",
|
|
1680
|
+
"ta-SG"
|
|
1681
|
+
]
|
|
1682
|
+
};
|
|
901
1683
|
// packages/intl-supportedvaluesof/get-supported-numbering-systems.ts
|
|
902
|
-
/**
|
|
903
|
-
* Implementation: Tests if a numbering system is supported by attempting to create
|
|
904
|
-
* a NumberFormat with that numbering system and verifying it was accepted.
|
|
905
|
-
*
|
|
906
|
-
* CLDR Data: Candidate values come from CLDR numbering system types
|
|
907
|
-
*/
|
|
908
|
-
function isSupportedNumberingSystem(system) {
|
|
909
|
-
try {
|
|
910
|
-
const numberFormat = createMemoizedNumberFormat(`en-u-nu-${system}`);
|
|
911
|
-
if (numberFormat.resolvedOptions().numberingSystem === system && system === "latn" || numberFormat.format(123) !== "123") return true;
|
|
912
|
-
} catch {}
|
|
913
|
-
return false;
|
|
914
|
-
}
|
|
915
|
-
/**
|
|
916
|
-
* ECMA-402 Spec: Returns supported numbering system identifiers
|
|
917
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
918
|
-
*
|
|
919
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
920
|
-
*/
|
|
921
1684
|
function getSupportedNumberingSystems() {
|
|
922
|
-
|
|
1685
|
+
const number = getNumberFormatProbe();
|
|
1686
|
+
const date = getDateTimeFormatProbe();
|
|
1687
|
+
const relative = getRelativeTimeFormatProbe();
|
|
1688
|
+
return supportedEntries(numberingSystemNames, (system) => {
|
|
1689
|
+
if (arrayIndexOf(numericNumberingSystemNames, system) >= 0) return true;
|
|
1690
|
+
return arraySome(numberingSystemCandidateLocales[system], (candidate) => {
|
|
1691
|
+
const locale = `${candidate}-u-nu-${system}`;
|
|
1692
|
+
try {
|
|
1693
|
+
return number?.resolve?.(number.create(locale)).numberingSystem === system && date?.resolve?.(date.create(locale)).numberingSystem === system && relative?.resolve?.(relative.create(locale)).numberingSystem === system;
|
|
1694
|
+
} catch {
|
|
1695
|
+
return false;
|
|
1696
|
+
}
|
|
1697
|
+
});
|
|
1698
|
+
});
|
|
923
1699
|
}
|
|
924
1700
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/timezones.js
|
|
925
1701
|
const timezones = [
|
|
@@ -1374,27 +2150,25 @@ const timezones = [
|
|
|
1374
2150
|
"UTC"
|
|
1375
2151
|
];
|
|
1376
2152
|
// packages/intl-supportedvaluesof/get-supported-timezones.ts
|
|
1377
|
-
/**
|
|
1378
|
-
* Implementation: Tests if a timezone is supported by attempting to create
|
|
1379
|
-
* a DateTimeFormat with that timezone and verifying it was accepted.
|
|
1380
|
-
*
|
|
1381
|
-
* CLDR Data: Candidate values come from IANA Time Zone Database
|
|
1382
|
-
*/
|
|
1383
|
-
function isSupportedTimeZone(timeZone) {
|
|
1384
|
-
try {
|
|
1385
|
-
createMemoizedDateTimeFormat("en", { timeZone });
|
|
1386
|
-
return true;
|
|
1387
|
-
} catch {}
|
|
1388
|
-
return false;
|
|
1389
|
-
}
|
|
1390
|
-
/**
|
|
1391
|
-
* ECMA-402 Spec: Returns supported timezone identifiers
|
|
1392
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
1393
|
-
*
|
|
1394
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
1395
|
-
*/
|
|
1396
2153
|
function getSupportedTimeZones() {
|
|
1397
|
-
|
|
2154
|
+
const probe = getDateTimeFormatProbe();
|
|
2155
|
+
if (!probe) return ["UTC"];
|
|
2156
|
+
return supportedEntries(timezones, (timeZone) => {
|
|
2157
|
+
if (timeZone === "UTC") return true;
|
|
2158
|
+
if (probe.hasTimeZone) try {
|
|
2159
|
+
return probe.hasTimeZone(timeZone);
|
|
2160
|
+
} catch {}
|
|
2161
|
+
try {
|
|
2162
|
+
const options = {
|
|
2163
|
+
__proto__: null,
|
|
2164
|
+
timeZone
|
|
2165
|
+
};
|
|
2166
|
+
probe.create("en", options);
|
|
2167
|
+
return true;
|
|
2168
|
+
} catch {
|
|
2169
|
+
return false;
|
|
2170
|
+
}
|
|
2171
|
+
});
|
|
1398
2172
|
}
|
|
1399
2173
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/units.js
|
|
1400
2174
|
const units = [
|
|
@@ -1445,47 +2219,22 @@ const units = [
|
|
|
1445
2219
|
"milliliter"
|
|
1446
2220
|
];
|
|
1447
2221
|
// packages/intl-supportedvaluesof/get-supported-units.ts
|
|
1448
|
-
/**
|
|
1449
|
-
* Implementation: Tests if a unit is supported by attempting to create
|
|
1450
|
-
* a NumberFormat with that unit and verifying it was accepted.
|
|
1451
|
-
*
|
|
1452
|
-
* CLDR Data: Candidate values come from CLDR unit types
|
|
1453
|
-
*/
|
|
1454
|
-
function isSupportedUnit(unit) {
|
|
1455
|
-
try {
|
|
1456
|
-
return createMemoizedNumberFormat("en", {
|
|
1457
|
-
style: "unit",
|
|
1458
|
-
unit
|
|
1459
|
-
}).resolvedOptions().unit === unit;
|
|
1460
|
-
} catch {}
|
|
1461
|
-
return false;
|
|
1462
|
-
}
|
|
1463
|
-
/**
|
|
1464
|
-
* ECMA-402 Spec: Returns supported unit identifiers
|
|
1465
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
1466
|
-
*
|
|
1467
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
1468
|
-
*/
|
|
1469
2222
|
function getSupportedUnits() {
|
|
1470
|
-
return units
|
|
2223
|
+
return supportedEntries(units, () => true);
|
|
1471
2224
|
}
|
|
1472
2225
|
// packages/intl-supportedvaluesof/should-polyfill.ts
|
|
1473
2226
|
function shouldPolyfill() {
|
|
1474
|
-
return typeof Intl === "undefined" ||
|
|
2227
|
+
return typeof Intl === "undefined" || typeof Intl.supportedValuesOf !== "function";
|
|
1475
2228
|
}
|
|
1476
2229
|
// packages/intl-supportedvaluesof/index.ts
|
|
1477
2230
|
/**
|
|
1478
|
-
* ECMA-402
|
|
1479
|
-
* ECMA-402 §8.3.2 Intl.supportedValuesOf, step 1.
|
|
2231
|
+
* ECMA-402 §8.3.2 Intl.supportedValuesOf.
|
|
1480
2232
|
* https://tc39.es/ecma402/#sec-intl.supportedvaluesof
|
|
1481
|
-
* https://github.com/tc39/ecma402/blob/b1c961988b9a07894b1dc3dc2b5626ea48387d61/spec/intl.html#L103
|
|
1482
2233
|
*
|
|
1483
2234
|
* Returns an array containing the supported calendar, collation, currency,
|
|
1484
2235
|
* numbering systems, time zone, or unit values supported by the implementation.
|
|
1485
2236
|
*
|
|
1486
|
-
*
|
|
1487
|
-
* Intl formatters to determine runtime support rather than using static lists.
|
|
1488
|
-
* This ensures accuracy across different JavaScript engines and runtimes.
|
|
2237
|
+
* Units come from the spec. Other categories probe the installed formatters.
|
|
1489
2238
|
*
|
|
1490
2239
|
* @param key - The category of values to return
|
|
1491
2240
|
* @returns A sorted array of unique string values
|
|
@@ -1499,7 +2248,7 @@ const supportedValuesOf = { supportedValuesOf(key) {
|
|
|
1499
2248
|
case "numberingSystem": return getSupportedNumberingSystems();
|
|
1500
2249
|
case "timeZone": return getSupportedTimeZones();
|
|
1501
2250
|
case "unit": return getSupportedUnits();
|
|
1502
|
-
default: throw
|
|
2251
|
+
default: throw new RangeErrorConstructor("Invalid key: " + key);
|
|
1503
2252
|
}
|
|
1504
2253
|
} }.supportedValuesOf;
|
|
1505
2254
|
export { shouldPolyfill, supportedValuesOf };
|