@formatjs/intl-locale 2.4.37 → 2.4.41
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.js +64 -64
- package/lib/index.js +3 -3
- package/package.json +3 -3
- package/polyfill.iife.js +119 -119
- package/polyfill.js +1 -1
package/index.js
CHANGED
|
@@ -4,25 +4,25 @@ exports.Locale = void 0;
|
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
6
6
|
var intl_getcanonicallocales_1 = require("@formatjs/intl-getcanonicallocales");
|
|
7
|
-
var get_internal_slots_1 = tslib_1.__importDefault(require("./get_internal_slots"));
|
|
7
|
+
var get_internal_slots_1 = (0, tslib_1.__importDefault)(require("./get_internal_slots"));
|
|
8
8
|
var RELEVANT_EXTENSION_KEYS = ['ca', 'co', 'hc', 'kf', 'kn', 'nu'];
|
|
9
9
|
var UNICODE_TYPE_REGEX = /^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;
|
|
10
10
|
function applyOptionsToTag(tag, options) {
|
|
11
|
-
ecma402_abstract_1.invariant(typeof tag === 'string', 'language tag must be a string');
|
|
12
|
-
ecma402_abstract_1.invariant(intl_getcanonicallocales_1.isStructurallyValidLanguageTag(tag), 'malformed language tag', RangeError);
|
|
13
|
-
var language = ecma402_abstract_1.GetOption(options, 'language', 'string', undefined, undefined);
|
|
11
|
+
(0, ecma402_abstract_1.invariant)(typeof tag === 'string', 'language tag must be a string');
|
|
12
|
+
(0, ecma402_abstract_1.invariant)((0, intl_getcanonicallocales_1.isStructurallyValidLanguageTag)(tag), 'malformed language tag', RangeError);
|
|
13
|
+
var language = (0, ecma402_abstract_1.GetOption)(options, 'language', 'string', undefined, undefined);
|
|
14
14
|
if (language !== undefined) {
|
|
15
|
-
ecma402_abstract_1.invariant(intl_getcanonicallocales_1.isUnicodeLanguageSubtag(language), 'Malformed unicode_language_subtag', RangeError);
|
|
15
|
+
(0, ecma402_abstract_1.invariant)((0, intl_getcanonicallocales_1.isUnicodeLanguageSubtag)(language), 'Malformed unicode_language_subtag', RangeError);
|
|
16
16
|
}
|
|
17
|
-
var script = ecma402_abstract_1.GetOption(options, 'script', 'string', undefined, undefined);
|
|
17
|
+
var script = (0, ecma402_abstract_1.GetOption)(options, 'script', 'string', undefined, undefined);
|
|
18
18
|
if (script !== undefined) {
|
|
19
|
-
ecma402_abstract_1.invariant(intl_getcanonicallocales_1.isUnicodeScriptSubtag(script), 'Malformed unicode_script_subtag', RangeError);
|
|
19
|
+
(0, ecma402_abstract_1.invariant)((0, intl_getcanonicallocales_1.isUnicodeScriptSubtag)(script), 'Malformed unicode_script_subtag', RangeError);
|
|
20
20
|
}
|
|
21
|
-
var region = ecma402_abstract_1.GetOption(options, 'region', 'string', undefined, undefined);
|
|
21
|
+
var region = (0, ecma402_abstract_1.GetOption)(options, 'region', 'string', undefined, undefined);
|
|
22
22
|
if (region !== undefined) {
|
|
23
|
-
ecma402_abstract_1.invariant(intl_getcanonicallocales_1.isUnicodeRegionSubtag(region), 'Malformed unicode_region_subtag', RangeError);
|
|
23
|
+
(0, ecma402_abstract_1.invariant)((0, intl_getcanonicallocales_1.isUnicodeRegionSubtag)(region), 'Malformed unicode_region_subtag', RangeError);
|
|
24
24
|
}
|
|
25
|
-
var languageId = intl_getcanonicallocales_1.parseUnicodeLanguageId(tag);
|
|
25
|
+
var languageId = (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(tag);
|
|
26
26
|
if (language !== undefined) {
|
|
27
27
|
languageId.lang = language;
|
|
28
28
|
}
|
|
@@ -32,12 +32,12 @@ function applyOptionsToTag(tag, options) {
|
|
|
32
32
|
if (region !== undefined) {
|
|
33
33
|
languageId.region = region;
|
|
34
34
|
}
|
|
35
|
-
return Intl.getCanonicalLocales(intl_getcanonicallocales_1.emitUnicodeLocaleId(tslib_1.__assign(tslib_1.__assign({}, intl_getcanonicallocales_1.parseUnicodeLocaleId(tag)), { lang: languageId })))[0];
|
|
35
|
+
return Intl.getCanonicalLocales((0, intl_getcanonicallocales_1.emitUnicodeLocaleId)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (0, intl_getcanonicallocales_1.parseUnicodeLocaleId)(tag)), { lang: languageId })))[0];
|
|
36
36
|
}
|
|
37
37
|
function applyUnicodeExtensionToTag(tag, options, relevantExtensionKeys) {
|
|
38
38
|
var unicodeExtension;
|
|
39
39
|
var keywords = [];
|
|
40
|
-
var ast = intl_getcanonicallocales_1.parseUnicodeLocaleId(tag);
|
|
40
|
+
var ast = (0, intl_getcanonicallocales_1.parseUnicodeLocaleId)(tag);
|
|
41
41
|
for (var _i = 0, _a = ast.extensions; _i < _a.length; _i++) {
|
|
42
42
|
var ext = _a[_i];
|
|
43
43
|
if (ext.type === 'u') {
|
|
@@ -57,10 +57,10 @@ function applyUnicodeExtensionToTag(tag, options, relevantExtensionKeys) {
|
|
|
57
57
|
value = entry[1];
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
ecma402_abstract_1.invariant(key in options, key
|
|
60
|
+
(0, ecma402_abstract_1.invariant)(key in options, "".concat(key, " must be in options"));
|
|
61
61
|
var optionsValue = options[key];
|
|
62
62
|
if (optionsValue !== undefined) {
|
|
63
|
-
ecma402_abstract_1.invariant(typeof optionsValue === 'string', "Value for "
|
|
63
|
+
(0, ecma402_abstract_1.invariant)(typeof optionsValue === 'string', "Value for ".concat(key, " must be a string"));
|
|
64
64
|
value = optionsValue;
|
|
65
65
|
if (entry) {
|
|
66
66
|
entry[1] = value;
|
|
@@ -83,7 +83,7 @@ function applyUnicodeExtensionToTag(tag, options, relevantExtensionKeys) {
|
|
|
83
83
|
else {
|
|
84
84
|
unicodeExtension.keywords = keywords;
|
|
85
85
|
}
|
|
86
|
-
result.locale = Intl.getCanonicalLocales(intl_getcanonicallocales_1.emitUnicodeLocaleId(ast))[0];
|
|
86
|
+
result.locale = Intl.getCanonicalLocales((0, intl_getcanonicallocales_1.emitUnicodeLocaleId)(ast))[0];
|
|
87
87
|
return result;
|
|
88
88
|
}
|
|
89
89
|
function mergeUnicodeLanguageId(lang, script, region, variants, replacement) {
|
|
@@ -100,45 +100,45 @@ function mergeUnicodeLanguageId(lang, script, region, variants, replacement) {
|
|
|
100
100
|
lang: !lang || lang === 'und' ? replacement.lang : lang,
|
|
101
101
|
script: script || replacement.script,
|
|
102
102
|
region: region || replacement.region,
|
|
103
|
-
variants: tslib_1.__spreadArray(tslib_1.__spreadArray([], variants), replacement.variants),
|
|
103
|
+
variants: (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], variants, true), replacement.variants, true),
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
function addLikelySubtags(tag) {
|
|
107
|
-
var ast = intl_getcanonicallocales_1.parseUnicodeLocaleId(tag);
|
|
107
|
+
var ast = (0, intl_getcanonicallocales_1.parseUnicodeLocaleId)(tag);
|
|
108
108
|
var unicodeLangId = ast.lang;
|
|
109
109
|
var lang = unicodeLangId.lang, script = unicodeLangId.script, region = unicodeLangId.region, variants = unicodeLangId.variants;
|
|
110
110
|
if (script && region) {
|
|
111
|
-
var match_1 = intl_getcanonicallocales_1.likelySubtags[intl_getcanonicallocales_1.emitUnicodeLanguageId({ lang: lang, script: script, region: region, variants: [] })];
|
|
111
|
+
var match_1 = intl_getcanonicallocales_1.likelySubtags[(0, intl_getcanonicallocales_1.emitUnicodeLanguageId)({ lang: lang, script: script, region: region, variants: [] })];
|
|
112
112
|
if (match_1) {
|
|
113
|
-
var parts_1 = intl_getcanonicallocales_1.parseUnicodeLanguageId(match_1);
|
|
113
|
+
var parts_1 = (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(match_1);
|
|
114
114
|
ast.lang = mergeUnicodeLanguageId(undefined, undefined, undefined, variants, parts_1);
|
|
115
|
-
return intl_getcanonicallocales_1.emitUnicodeLocaleId(ast);
|
|
115
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLocaleId)(ast);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
if (script) {
|
|
119
|
-
var match_2 = intl_getcanonicallocales_1.likelySubtags[intl_getcanonicallocales_1.emitUnicodeLanguageId({ lang: lang, script: script, variants: [] })];
|
|
119
|
+
var match_2 = intl_getcanonicallocales_1.likelySubtags[(0, intl_getcanonicallocales_1.emitUnicodeLanguageId)({ lang: lang, script: script, variants: [] })];
|
|
120
120
|
if (match_2) {
|
|
121
|
-
var parts_2 = intl_getcanonicallocales_1.parseUnicodeLanguageId(match_2);
|
|
121
|
+
var parts_2 = (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(match_2);
|
|
122
122
|
ast.lang = mergeUnicodeLanguageId(undefined, undefined, region, variants, parts_2);
|
|
123
|
-
return intl_getcanonicallocales_1.emitUnicodeLocaleId(ast);
|
|
123
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLocaleId)(ast);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
if (region) {
|
|
127
|
-
var match_3 = intl_getcanonicallocales_1.likelySubtags[intl_getcanonicallocales_1.emitUnicodeLanguageId({ lang: lang, region: region, variants: [] })];
|
|
127
|
+
var match_3 = intl_getcanonicallocales_1.likelySubtags[(0, intl_getcanonicallocales_1.emitUnicodeLanguageId)({ lang: lang, region: region, variants: [] })];
|
|
128
128
|
if (match_3) {
|
|
129
|
-
var parts_3 = intl_getcanonicallocales_1.parseUnicodeLanguageId(match_3);
|
|
129
|
+
var parts_3 = (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(match_3);
|
|
130
130
|
ast.lang = mergeUnicodeLanguageId(undefined, script, undefined, variants, parts_3);
|
|
131
|
-
return intl_getcanonicallocales_1.emitUnicodeLocaleId(ast);
|
|
131
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLocaleId)(ast);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
var match = intl_getcanonicallocales_1.likelySubtags[lang] ||
|
|
135
|
-
intl_getcanonicallocales_1.likelySubtags[intl_getcanonicallocales_1.emitUnicodeLanguageId({ lang: 'und', script: script, variants: [] })];
|
|
135
|
+
intl_getcanonicallocales_1.likelySubtags[(0, intl_getcanonicallocales_1.emitUnicodeLanguageId)({ lang: 'und', script: script, variants: [] })];
|
|
136
136
|
if (!match) {
|
|
137
137
|
throw new Error("No match for addLikelySubtags");
|
|
138
138
|
}
|
|
139
|
-
var parts = intl_getcanonicallocales_1.parseUnicodeLanguageId(match);
|
|
139
|
+
var parts = (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(match);
|
|
140
140
|
ast.lang = mergeUnicodeLanguageId(undefined, script, region, variants, parts);
|
|
141
|
-
return intl_getcanonicallocales_1.emitUnicodeLocaleId(ast);
|
|
141
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLocaleId)(ast);
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
144
|
* From: https://github.com/unicode-org/icu/blob/4231ca5be053a22a1be24eb891817458c97db709/icu4j/main/classes/core/src/com/ibm/icu/util/ULocale.java#L2395
|
|
@@ -149,23 +149,23 @@ function removeLikelySubtags(tag) {
|
|
|
149
149
|
if (!maxLocale) {
|
|
150
150
|
return tag;
|
|
151
151
|
}
|
|
152
|
-
maxLocale = intl_getcanonicallocales_1.emitUnicodeLanguageId(tslib_1.__assign(tslib_1.__assign({}, intl_getcanonicallocales_1.parseUnicodeLanguageId(maxLocale)), { variants: [] }));
|
|
153
|
-
var ast = intl_getcanonicallocales_1.parseUnicodeLocaleId(tag);
|
|
152
|
+
maxLocale = (0, intl_getcanonicallocales_1.emitUnicodeLanguageId)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(maxLocale)), { variants: [] }));
|
|
153
|
+
var ast = (0, intl_getcanonicallocales_1.parseUnicodeLocaleId)(tag);
|
|
154
154
|
var _a = ast.lang, lang = _a.lang, script = _a.script, region = _a.region, variants = _a.variants;
|
|
155
|
-
var trial = addLikelySubtags(intl_getcanonicallocales_1.emitUnicodeLanguageId({ lang: lang, variants: [] }));
|
|
155
|
+
var trial = addLikelySubtags((0, intl_getcanonicallocales_1.emitUnicodeLanguageId)({ lang: lang, variants: [] }));
|
|
156
156
|
if (trial === maxLocale) {
|
|
157
|
-
return intl_getcanonicallocales_1.emitUnicodeLocaleId(tslib_1.__assign(tslib_1.__assign({}, ast), { lang: mergeUnicodeLanguageId(lang, undefined, undefined, variants) }));
|
|
157
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLocaleId)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, ast), { lang: mergeUnicodeLanguageId(lang, undefined, undefined, variants) }));
|
|
158
158
|
}
|
|
159
159
|
if (region) {
|
|
160
|
-
var trial_1 = addLikelySubtags(intl_getcanonicallocales_1.emitUnicodeLanguageId({ lang: lang, region: region, variants: [] }));
|
|
160
|
+
var trial_1 = addLikelySubtags((0, intl_getcanonicallocales_1.emitUnicodeLanguageId)({ lang: lang, region: region, variants: [] }));
|
|
161
161
|
if (trial_1 === maxLocale) {
|
|
162
|
-
return intl_getcanonicallocales_1.emitUnicodeLocaleId(tslib_1.__assign(tslib_1.__assign({}, ast), { lang: mergeUnicodeLanguageId(lang, undefined, region, variants) }));
|
|
162
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLocaleId)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, ast), { lang: mergeUnicodeLanguageId(lang, undefined, region, variants) }));
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
if (script) {
|
|
166
|
-
var trial_2 = addLikelySubtags(intl_getcanonicallocales_1.emitUnicodeLanguageId({ lang: lang, script: script, variants: [] }));
|
|
166
|
+
var trial_2 = addLikelySubtags((0, intl_getcanonicallocales_1.emitUnicodeLanguageId)({ lang: lang, script: script, variants: [] }));
|
|
167
167
|
if (trial_2 === maxLocale) {
|
|
168
|
-
return intl_getcanonicallocales_1.emitUnicodeLocaleId(tslib_1.__assign(tslib_1.__assign({}, ast), { lang: mergeUnicodeLanguageId(lang, script, undefined, variants) }));
|
|
168
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLocaleId)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, ast), { lang: mergeUnicodeLanguageId(lang, script, undefined, variants) }));
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
return tag;
|
|
@@ -201,42 +201,42 @@ var Locale = /** @class */ (function () {
|
|
|
201
201
|
}
|
|
202
202
|
var internalSlots;
|
|
203
203
|
if (typeof tag === 'object' &&
|
|
204
|
-
(internalSlots = get_internal_slots_1.default(tag)) &&
|
|
204
|
+
(internalSlots = (0, get_internal_slots_1.default)(tag)) &&
|
|
205
205
|
internalSlots.initializedLocale) {
|
|
206
206
|
tag = internalSlots.locale;
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
209
209
|
tag = tag.toString();
|
|
210
210
|
}
|
|
211
|
-
internalSlots = get_internal_slots_1.default(this);
|
|
212
|
-
var options = ecma402_abstract_1.CoerceOptionsToObject(opts);
|
|
211
|
+
internalSlots = (0, get_internal_slots_1.default)(this);
|
|
212
|
+
var options = (0, ecma402_abstract_1.CoerceOptionsToObject)(opts);
|
|
213
213
|
tag = applyOptionsToTag(tag, options);
|
|
214
214
|
var opt = Object.create(null);
|
|
215
|
-
var calendar = ecma402_abstract_1.GetOption(options, 'calendar', 'string', undefined, undefined);
|
|
215
|
+
var calendar = (0, ecma402_abstract_1.GetOption)(options, 'calendar', 'string', undefined, undefined);
|
|
216
216
|
if (calendar !== undefined) {
|
|
217
217
|
if (!UNICODE_TYPE_REGEX.test(calendar)) {
|
|
218
218
|
throw new RangeError('invalid calendar');
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
opt.ca = calendar;
|
|
222
|
-
var collation = ecma402_abstract_1.GetOption(options, 'collation', 'string', undefined, undefined);
|
|
222
|
+
var collation = (0, ecma402_abstract_1.GetOption)(options, 'collation', 'string', undefined, undefined);
|
|
223
223
|
if (collation !== undefined) {
|
|
224
224
|
if (!UNICODE_TYPE_REGEX.test(collation)) {
|
|
225
225
|
throw new RangeError('invalid collation');
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
opt.co = collation;
|
|
229
|
-
var hc = ecma402_abstract_1.GetOption(options, 'hourCycle', 'string', ['h11', 'h12', 'h23', 'h24'], undefined);
|
|
229
|
+
var hc = (0, ecma402_abstract_1.GetOption)(options, 'hourCycle', 'string', ['h11', 'h12', 'h23', 'h24'], undefined);
|
|
230
230
|
opt.hc = hc;
|
|
231
|
-
var kf = ecma402_abstract_1.GetOption(options, 'caseFirst', 'string', ['upper', 'lower', 'false'], undefined);
|
|
231
|
+
var kf = (0, ecma402_abstract_1.GetOption)(options, 'caseFirst', 'string', ['upper', 'lower', 'false'], undefined);
|
|
232
232
|
opt.kf = kf;
|
|
233
|
-
var _kn = ecma402_abstract_1.GetOption(options, 'numeric', 'boolean', undefined, undefined);
|
|
233
|
+
var _kn = (0, ecma402_abstract_1.GetOption)(options, 'numeric', 'boolean', undefined, undefined);
|
|
234
234
|
var kn;
|
|
235
235
|
if (_kn !== undefined) {
|
|
236
236
|
kn = String(_kn);
|
|
237
237
|
}
|
|
238
238
|
opt.kn = kn;
|
|
239
|
-
var numberingSystem = ecma402_abstract_1.GetOption(options, 'numberingSystem', 'string', undefined, undefined);
|
|
239
|
+
var numberingSystem = (0, ecma402_abstract_1.GetOption)(options, 'numberingSystem', 'string', undefined, undefined);
|
|
240
240
|
if (numberingSystem !== undefined) {
|
|
241
241
|
if (!UNICODE_TYPE_REGEX.test(numberingSystem)) {
|
|
242
242
|
throw new RangeError('Invalid numberingSystem');
|
|
@@ -252,7 +252,7 @@ var Locale = /** @class */ (function () {
|
|
|
252
252
|
internalSlots.caseFirst = r.kf;
|
|
253
253
|
}
|
|
254
254
|
if (relevantExtensionKeys.indexOf('kn') > -1) {
|
|
255
|
-
internalSlots.numeric = ecma402_abstract_1.SameValue(r.kn, 'true');
|
|
255
|
+
internalSlots.numeric = (0, ecma402_abstract_1.SameValue)(r.kn, 'true');
|
|
256
256
|
}
|
|
257
257
|
internalSlots.numberingSystem = r.nu;
|
|
258
258
|
}
|
|
@@ -260,7 +260,7 @@ var Locale = /** @class */ (function () {
|
|
|
260
260
|
* https://www.unicode.org/reports/tr35/#Likely_Subtags
|
|
261
261
|
*/
|
|
262
262
|
Locale.prototype.maximize = function () {
|
|
263
|
-
var locale = get_internal_slots_1.default(this).locale;
|
|
263
|
+
var locale = (0, get_internal_slots_1.default)(this).locale;
|
|
264
264
|
try {
|
|
265
265
|
var maximizedLocale = addLikelySubtags(locale);
|
|
266
266
|
return new Locale(maximizedLocale);
|
|
@@ -273,7 +273,7 @@ var Locale = /** @class */ (function () {
|
|
|
273
273
|
* https://www.unicode.org/reports/tr35/#Likely_Subtags
|
|
274
274
|
*/
|
|
275
275
|
Locale.prototype.minimize = function () {
|
|
276
|
-
var locale = get_internal_slots_1.default(this).locale;
|
|
276
|
+
var locale = (0, get_internal_slots_1.default)(this).locale;
|
|
277
277
|
try {
|
|
278
278
|
var minimizedLocale = removeLikelySubtags(locale);
|
|
279
279
|
return new Locale(minimizedLocale);
|
|
@@ -283,54 +283,54 @@ var Locale = /** @class */ (function () {
|
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
285
|
Locale.prototype.toString = function () {
|
|
286
|
-
return get_internal_slots_1.default(this).locale;
|
|
286
|
+
return (0, get_internal_slots_1.default)(this).locale;
|
|
287
287
|
};
|
|
288
288
|
Object.defineProperty(Locale.prototype, "baseName", {
|
|
289
289
|
get: function () {
|
|
290
|
-
var locale = get_internal_slots_1.default(this).locale;
|
|
291
|
-
return intl_getcanonicallocales_1.emitUnicodeLanguageId(intl_getcanonicallocales_1.parseUnicodeLanguageId(locale));
|
|
290
|
+
var locale = (0, get_internal_slots_1.default)(this).locale;
|
|
291
|
+
return (0, intl_getcanonicallocales_1.emitUnicodeLanguageId)((0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(locale));
|
|
292
292
|
},
|
|
293
293
|
enumerable: false,
|
|
294
294
|
configurable: true
|
|
295
295
|
});
|
|
296
296
|
Object.defineProperty(Locale.prototype, "calendar", {
|
|
297
297
|
get: function () {
|
|
298
|
-
return get_internal_slots_1.default(this).calendar;
|
|
298
|
+
return (0, get_internal_slots_1.default)(this).calendar;
|
|
299
299
|
},
|
|
300
300
|
enumerable: false,
|
|
301
301
|
configurable: true
|
|
302
302
|
});
|
|
303
303
|
Object.defineProperty(Locale.prototype, "collation", {
|
|
304
304
|
get: function () {
|
|
305
|
-
return get_internal_slots_1.default(this).collation;
|
|
305
|
+
return (0, get_internal_slots_1.default)(this).collation;
|
|
306
306
|
},
|
|
307
307
|
enumerable: false,
|
|
308
308
|
configurable: true
|
|
309
309
|
});
|
|
310
310
|
Object.defineProperty(Locale.prototype, "hourCycle", {
|
|
311
311
|
get: function () {
|
|
312
|
-
return get_internal_slots_1.default(this).hourCycle;
|
|
312
|
+
return (0, get_internal_slots_1.default)(this).hourCycle;
|
|
313
313
|
},
|
|
314
314
|
enumerable: false,
|
|
315
315
|
configurable: true
|
|
316
316
|
});
|
|
317
317
|
Object.defineProperty(Locale.prototype, "caseFirst", {
|
|
318
318
|
get: function () {
|
|
319
|
-
return get_internal_slots_1.default(this).caseFirst;
|
|
319
|
+
return (0, get_internal_slots_1.default)(this).caseFirst;
|
|
320
320
|
},
|
|
321
321
|
enumerable: false,
|
|
322
322
|
configurable: true
|
|
323
323
|
});
|
|
324
324
|
Object.defineProperty(Locale.prototype, "numeric", {
|
|
325
325
|
get: function () {
|
|
326
|
-
return get_internal_slots_1.default(this).numeric;
|
|
326
|
+
return (0, get_internal_slots_1.default)(this).numeric;
|
|
327
327
|
},
|
|
328
328
|
enumerable: false,
|
|
329
329
|
configurable: true
|
|
330
330
|
});
|
|
331
331
|
Object.defineProperty(Locale.prototype, "numberingSystem", {
|
|
332
332
|
get: function () {
|
|
333
|
-
return get_internal_slots_1.default(this).numberingSystem;
|
|
333
|
+
return (0, get_internal_slots_1.default)(this).numberingSystem;
|
|
334
334
|
},
|
|
335
335
|
enumerable: false,
|
|
336
336
|
configurable: true
|
|
@@ -340,8 +340,8 @@ var Locale = /** @class */ (function () {
|
|
|
340
340
|
* https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.language
|
|
341
341
|
*/
|
|
342
342
|
get: function () {
|
|
343
|
-
var locale = get_internal_slots_1.default(this).locale;
|
|
344
|
-
return intl_getcanonicallocales_1.parseUnicodeLanguageId(locale).lang;
|
|
343
|
+
var locale = (0, get_internal_slots_1.default)(this).locale;
|
|
344
|
+
return (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(locale).lang;
|
|
345
345
|
},
|
|
346
346
|
enumerable: false,
|
|
347
347
|
configurable: true
|
|
@@ -351,8 +351,8 @@ var Locale = /** @class */ (function () {
|
|
|
351
351
|
* https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.script
|
|
352
352
|
*/
|
|
353
353
|
get: function () {
|
|
354
|
-
var locale = get_internal_slots_1.default(this).locale;
|
|
355
|
-
return intl_getcanonicallocales_1.parseUnicodeLanguageId(locale).script;
|
|
354
|
+
var locale = (0, get_internal_slots_1.default)(this).locale;
|
|
355
|
+
return (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(locale).script;
|
|
356
356
|
},
|
|
357
357
|
enumerable: false,
|
|
358
358
|
configurable: true
|
|
@@ -362,8 +362,8 @@ var Locale = /** @class */ (function () {
|
|
|
362
362
|
* https://tc39.es/proposal-intl-locale/#sec-Intl.Locale.prototype.region
|
|
363
363
|
*/
|
|
364
364
|
get: function () {
|
|
365
|
-
var locale = get_internal_slots_1.default(this).locale;
|
|
366
|
-
return intl_getcanonicallocales_1.parseUnicodeLanguageId(locale).region;
|
|
365
|
+
var locale = (0, get_internal_slots_1.default)(this).locale;
|
|
366
|
+
return (0, intl_getcanonicallocales_1.parseUnicodeLanguageId)(locale).region;
|
|
367
367
|
},
|
|
368
368
|
enumerable: false,
|
|
369
369
|
configurable: true
|
package/lib/index.js
CHANGED
|
@@ -54,10 +54,10 @@ function applyUnicodeExtensionToTag(tag, options, relevantExtensionKeys) {
|
|
|
54
54
|
value = entry[1];
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
invariant(key in options, key
|
|
57
|
+
invariant(key in options, "".concat(key, " must be in options"));
|
|
58
58
|
var optionsValue = options[key];
|
|
59
59
|
if (optionsValue !== undefined) {
|
|
60
|
-
invariant(typeof optionsValue === 'string', "Value for "
|
|
60
|
+
invariant(typeof optionsValue === 'string', "Value for ".concat(key, " must be a string"));
|
|
61
61
|
value = optionsValue;
|
|
62
62
|
if (entry) {
|
|
63
63
|
entry[1] = value;
|
|
@@ -97,7 +97,7 @@ function mergeUnicodeLanguageId(lang, script, region, variants, replacement) {
|
|
|
97
97
|
lang: !lang || lang === 'und' ? replacement.lang : lang,
|
|
98
98
|
script: script || replacement.script,
|
|
99
99
|
region: region || replacement.region,
|
|
100
|
-
variants: __spreadArray(__spreadArray([], variants), replacement.variants),
|
|
100
|
+
variants: __spreadArray(__spreadArray([], variants, true), replacement.variants, true),
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
function addLikelySubtags(tag) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-locale",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.41",
|
|
4
4
|
"description": "Intl.Locale polyfill",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"url": "https://github.com/formatjs/formatjs/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@formatjs/ecma402-abstract": "1.
|
|
28
|
-
"@formatjs/intl-getcanonicallocales": "1.
|
|
27
|
+
"@formatjs/ecma402-abstract": "1.11.0",
|
|
28
|
+
"@formatjs/intl-getcanonicallocales": "1.8.0",
|
|
29
29
|
"tslib": "^2.1.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/polyfill.iife.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __markAsModule = function(target) {
|
|
9
|
-
return __defProp(target, "__esModule", {value: true});
|
|
9
|
+
return __defProp(target, "__esModule", { value: true });
|
|
10
10
|
};
|
|
11
11
|
var __commonJS = function(cb, mod) {
|
|
12
12
|
return function __require() {
|
|
13
|
-
return mod || (0, cb[Object.keys(cb)[0]])((mod = {exports: {}}).exports, mod), mod.exports;
|
|
13
|
+
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
var __reExport = function(target, module, desc) {
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
for (var keys = __getOwnPropNames(module), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
19
|
key = keys[i];
|
|
20
20
|
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
21
|
-
__defProp(target, key, {get: function(k) {
|
|
21
|
+
__defProp(target, key, { get: function(k) {
|
|
22
22
|
return module[k];
|
|
23
|
-
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable});
|
|
23
|
+
}.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
|
|
24
24
|
}
|
|
25
25
|
return target;
|
|
26
26
|
};
|
|
27
27
|
var __toModule = function(module) {
|
|
28
|
-
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? {get: function() {
|
|
28
|
+
return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: function() {
|
|
29
29
|
return module.default;
|
|
30
|
-
}, enumerable: true} : {value: module, enumerable: true})), module);
|
|
30
|
+
}, enumerable: true } : { value: module, enumerable: true })), module);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
// node_modules/tslib/tslib.js
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
function createExporter(exports2, previous) {
|
|
72
72
|
if (exports2 !== root) {
|
|
73
73
|
if (typeof Object.create === "function") {
|
|
74
|
-
Object.defineProperty(exports2, "__esModule", {value: true});
|
|
74
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
75
75
|
} else {
|
|
76
76
|
exports2.__esModule = true;
|
|
77
77
|
}
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
})(function(exporter) {
|
|
84
|
-
var extendStatics = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(d, b) {
|
|
84
|
+
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
|
|
85
85
|
d.__proto__ = b;
|
|
86
86
|
} || function(d, b) {
|
|
87
87
|
for (var p in b)
|
|
@@ -165,12 +165,12 @@
|
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
167
|
__generator = function(thisArg, body) {
|
|
168
|
-
var _ = {label: 0, sent: function() {
|
|
168
|
+
var _ = { label: 0, sent: function() {
|
|
169
169
|
if (t[0] & 1)
|
|
170
170
|
throw t[1];
|
|
171
171
|
return t[1];
|
|
172
|
-
}, trys: [], ops: []}, f, y, t, g;
|
|
173
|
-
return g = {next: verb(0), "throw": verb(1), "return": verb(2)}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
172
|
+
}, trys: [], ops: [] }, f, y, t, g;
|
|
173
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
174
174
|
return this;
|
|
175
175
|
}), g;
|
|
176
176
|
function verb(n) {
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
break;
|
|
195
195
|
case 4:
|
|
196
196
|
_.label++;
|
|
197
|
-
return {value: op[1], done: false};
|
|
197
|
+
return { value: op[1], done: false };
|
|
198
198
|
case 5:
|
|
199
199
|
_.label++;
|
|
200
200
|
y = op[1];
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
}
|
|
238
238
|
if (op[0] & 5)
|
|
239
239
|
throw op[1];
|
|
240
|
-
return {value: op[0] ? op[1] : void 0, done: true};
|
|
240
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
241
241
|
}
|
|
242
242
|
};
|
|
243
243
|
__exportStar = function(m, o) {
|
|
@@ -248,9 +248,9 @@
|
|
|
248
248
|
__createBinding = Object.create ? function(o, m, k, k2) {
|
|
249
249
|
if (k2 === void 0)
|
|
250
250
|
k2 = k;
|
|
251
|
-
Object.defineProperty(o, k2, {enumerable: true, get: function() {
|
|
251
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() {
|
|
252
252
|
return m[k];
|
|
253
|
-
}});
|
|
253
|
+
} });
|
|
254
254
|
} : function(o, m, k, k2) {
|
|
255
255
|
if (k2 === void 0)
|
|
256
256
|
k2 = k;
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
next: function() {
|
|
266
266
|
if (o && i >= o.length)
|
|
267
267
|
o = void 0;
|
|
268
|
-
return {value: o && o[i++], done: !o};
|
|
268
|
+
return { value: o && o[i++], done: !o };
|
|
269
269
|
}
|
|
270
270
|
};
|
|
271
271
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
280
280
|
ar.push(r.value);
|
|
281
281
|
} catch (error) {
|
|
282
|
-
e = {error: error};
|
|
282
|
+
e = { error: error };
|
|
283
283
|
} finally {
|
|
284
284
|
try {
|
|
285
285
|
if (r && !r.done && (m = i["return"]))
|
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
}, i;
|
|
364
364
|
function verb(n, f) {
|
|
365
365
|
i[n] = o[n] ? function(v) {
|
|
366
|
-
return (p = !p) ? {value: __await(o[n](v)), done: n === "return"} : f ? f(v) : v;
|
|
366
|
+
return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v;
|
|
367
367
|
} : f;
|
|
368
368
|
}
|
|
369
369
|
};
|
|
@@ -383,20 +383,20 @@
|
|
|
383
383
|
}
|
|
384
384
|
function settle(resolve, reject, d, v) {
|
|
385
385
|
Promise.resolve(v).then(function(v2) {
|
|
386
|
-
resolve({value: v2, done: d});
|
|
386
|
+
resolve({ value: v2, done: d });
|
|
387
387
|
}, reject);
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
390
|
__makeTemplateObject = function(cooked, raw) {
|
|
391
391
|
if (Object.defineProperty) {
|
|
392
|
-
Object.defineProperty(cooked, "raw", {value: raw});
|
|
392
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
393
393
|
} else {
|
|
394
394
|
cooked.raw = raw;
|
|
395
395
|
}
|
|
396
396
|
return cooked;
|
|
397
397
|
};
|
|
398
398
|
var __setModuleDefault = Object.create ? function(o, v) {
|
|
399
|
-
Object.defineProperty(o, "default", {enumerable: true, value: v});
|
|
399
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
400
400
|
} : function(o, v) {
|
|
401
401
|
o["default"] = v;
|
|
402
402
|
};
|
|
@@ -413,7 +413,7 @@
|
|
|
413
413
|
return result;
|
|
414
414
|
};
|
|
415
415
|
__importDefault = function(mod) {
|
|
416
|
-
return mod && mod.__esModule ? mod : {"default": mod};
|
|
416
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
417
417
|
};
|
|
418
418
|
__classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
419
419
|
if (kind === "a" && !f)
|
|
@@ -463,7 +463,7 @@
|
|
|
463
463
|
var require_utils = __commonJS({
|
|
464
464
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js": function(exports) {
|
|
465
465
|
"use strict";
|
|
466
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
466
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
467
467
|
exports.invariant = exports.UNICODE_EXTENSION_SEQUENCE_REGEX = void 0;
|
|
468
468
|
exports.UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
469
469
|
function invariant2(condition, message, Err) {
|
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
var require_BestAvailableLocale = __commonJS({
|
|
483
483
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestAvailableLocale.js": function(exports) {
|
|
484
484
|
"use strict";
|
|
485
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
485
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
486
486
|
exports.BestAvailableLocale = void 0;
|
|
487
487
|
function BestAvailableLocale(availableLocales, locale) {
|
|
488
488
|
var candidate = locale;
|
|
@@ -508,16 +508,16 @@
|
|
|
508
508
|
var require_LookupMatcher = __commonJS({
|
|
509
509
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupMatcher.js": function(exports) {
|
|
510
510
|
"use strict";
|
|
511
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
511
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
512
512
|
exports.LookupMatcher = void 0;
|
|
513
513
|
var utils_1 = require_utils();
|
|
514
514
|
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
515
515
|
function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
516
|
-
var result = {locale: ""};
|
|
516
|
+
var result = { locale: "" };
|
|
517
517
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
518
518
|
var locale = requestedLocales_1[_i];
|
|
519
519
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
520
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
520
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
521
521
|
if (availableLocale) {
|
|
522
522
|
result.locale = availableLocale;
|
|
523
523
|
if (locale !== noExtensionLocale) {
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
var require_BestFitMatcher = __commonJS({
|
|
538
538
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestFitMatcher.js": function(exports) {
|
|
539
539
|
"use strict";
|
|
540
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
540
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
541
541
|
exports.BestFitMatcher = void 0;
|
|
542
542
|
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
543
543
|
var utils_1 = require_utils();
|
|
@@ -574,7 +574,7 @@
|
|
|
574
574
|
foundLocale = minimizedRequestedLocale;
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
|
-
foundLocale = BestAvailableLocale_1.BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
577
|
+
foundLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
578
578
|
}
|
|
579
579
|
return {
|
|
580
580
|
locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
|
|
@@ -588,13 +588,13 @@
|
|
|
588
588
|
var require_UnicodeExtensionValue = __commonJS({
|
|
589
589
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/UnicodeExtensionValue.js": function(exports) {
|
|
590
590
|
"use strict";
|
|
591
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
591
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
592
592
|
exports.UnicodeExtensionValue = void 0;
|
|
593
593
|
var utils_1 = require_utils();
|
|
594
594
|
function UnicodeExtensionValue(extension, key) {
|
|
595
|
-
utils_1.invariant(key.length === 2, "key must have 2 elements");
|
|
595
|
+
(0, utils_1.invariant)(key.length === 2, "key must have 2 elements");
|
|
596
596
|
var size = extension.length;
|
|
597
|
-
var searchValue = "-"
|
|
597
|
+
var searchValue = "-".concat(key, "-");
|
|
598
598
|
var pos = extension.indexOf(searchValue);
|
|
599
599
|
if (pos !== -1) {
|
|
600
600
|
var start = pos + 4;
|
|
@@ -621,7 +621,7 @@
|
|
|
621
621
|
}
|
|
622
622
|
return extension.slice(start, end);
|
|
623
623
|
}
|
|
624
|
-
searchValue = "-"
|
|
624
|
+
searchValue = "-".concat(key);
|
|
625
625
|
pos = extension.indexOf(searchValue);
|
|
626
626
|
if (pos !== -1 && pos + 3 === size) {
|
|
627
627
|
return "";
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
var require_ResolveLocale = __commonJS({
|
|
637
637
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/ResolveLocale.js": function(exports) {
|
|
638
638
|
"use strict";
|
|
639
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
639
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
640
640
|
exports.ResolveLocale = void 0;
|
|
641
641
|
var LookupMatcher_1 = require_LookupMatcher();
|
|
642
642
|
var BestFitMatcher_1 = require_BestFitMatcher();
|
|
@@ -646,40 +646,40 @@
|
|
|
646
646
|
var matcher = options.localeMatcher;
|
|
647
647
|
var r;
|
|
648
648
|
if (matcher === "lookup") {
|
|
649
|
-
r = LookupMatcher_1.LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
649
|
+
r = (0, LookupMatcher_1.LookupMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
650
650
|
} else {
|
|
651
|
-
r = BestFitMatcher_1.BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
651
|
+
r = (0, BestFitMatcher_1.BestFitMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
652
652
|
}
|
|
653
653
|
var foundLocale = r.locale;
|
|
654
|
-
var result = {locale: "", dataLocale: foundLocale};
|
|
654
|
+
var result = { locale: "", dataLocale: foundLocale };
|
|
655
655
|
var supportedExtension = "-u";
|
|
656
656
|
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
657
657
|
var key = relevantExtensionKeys_1[_i];
|
|
658
|
-
utils_1.invariant(foundLocale in localeData, "Missing locale data for "
|
|
658
|
+
(0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
|
|
659
659
|
var foundLocaleData = localeData[foundLocale];
|
|
660
|
-
utils_1.invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data "
|
|
660
|
+
(0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
|
|
661
661
|
var keyLocaleData = foundLocaleData[key];
|
|
662
|
-
utils_1.invariant(Array.isArray(keyLocaleData), "keyLocaleData for "
|
|
662
|
+
(0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
|
|
663
663
|
var value = keyLocaleData[0];
|
|
664
|
-
utils_1.invariant(typeof value === "string" || value === null, "value must be string or null but got "
|
|
664
|
+
(0, utils_1.invariant)(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
|
|
665
665
|
var supportedExtensionAddition = "";
|
|
666
666
|
if (r.extension) {
|
|
667
|
-
var requestedValue = UnicodeExtensionValue_1.UnicodeExtensionValue(r.extension, key);
|
|
667
|
+
var requestedValue = (0, UnicodeExtensionValue_1.UnicodeExtensionValue)(r.extension, key);
|
|
668
668
|
if (requestedValue !== void 0) {
|
|
669
669
|
if (requestedValue !== "") {
|
|
670
670
|
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
671
671
|
value = requestedValue;
|
|
672
|
-
supportedExtensionAddition = "-"
|
|
672
|
+
supportedExtensionAddition = "-".concat(key, "-").concat(value);
|
|
673
673
|
}
|
|
674
674
|
} else if (~requestedValue.indexOf("true")) {
|
|
675
675
|
value = "true";
|
|
676
|
-
supportedExtensionAddition = "-"
|
|
676
|
+
supportedExtensionAddition = "-".concat(key);
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
if (key in options) {
|
|
681
681
|
var optionsValue = options[key];
|
|
682
|
-
utils_1.invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
682
|
+
(0, utils_1.invariant)(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
683
683
|
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
684
684
|
if (optionsValue !== value) {
|
|
685
685
|
value = optionsValue;
|
|
@@ -712,7 +712,7 @@
|
|
|
712
712
|
var require_LookupSupportedLocales = __commonJS({
|
|
713
713
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupSupportedLocales.js": function(exports) {
|
|
714
714
|
"use strict";
|
|
715
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
715
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
716
716
|
exports.LookupSupportedLocales = void 0;
|
|
717
717
|
var utils_1 = require_utils();
|
|
718
718
|
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
@@ -721,7 +721,7 @@
|
|
|
721
721
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
722
722
|
var locale = requestedLocales_1[_i];
|
|
723
723
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
724
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
724
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
725
725
|
if (availableLocale) {
|
|
726
726
|
subset.push(availableLocale);
|
|
727
727
|
}
|
|
@@ -736,7 +736,7 @@
|
|
|
736
736
|
var require_intl_localematcher = __commonJS({
|
|
737
737
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/index.js": function(exports) {
|
|
738
738
|
"use strict";
|
|
739
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
739
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
740
740
|
exports.ResolveLocale = exports.LookupSupportedLocales = exports.match = void 0;
|
|
741
741
|
var ResolveLocale_1 = require_ResolveLocale();
|
|
742
742
|
function match(requestedLocales, availableLocales, defaultLocale, opts) {
|
|
@@ -744,7 +744,7 @@
|
|
|
744
744
|
all.add(l);
|
|
745
745
|
return all;
|
|
746
746
|
}, new Set());
|
|
747
|
-
return ResolveLocale_1.ResolveLocale(locales, requestedLocales, {
|
|
747
|
+
return (0, ResolveLocale_1.ResolveLocale)(locales, requestedLocales, {
|
|
748
748
|
localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
|
|
749
749
|
}, [], {}, function() {
|
|
750
750
|
return defaultLocale;
|
|
@@ -752,13 +752,13 @@
|
|
|
752
752
|
}
|
|
753
753
|
exports.match = match;
|
|
754
754
|
var LookupSupportedLocales_1 = require_LookupSupportedLocales();
|
|
755
|
-
Object.defineProperty(exports, "LookupSupportedLocales", {enumerable: true, get: function() {
|
|
755
|
+
Object.defineProperty(exports, "LookupSupportedLocales", { enumerable: true, get: function() {
|
|
756
756
|
return LookupSupportedLocales_1.LookupSupportedLocales;
|
|
757
|
-
}});
|
|
757
|
+
} });
|
|
758
758
|
var ResolveLocale_2 = require_ResolveLocale();
|
|
759
|
-
Object.defineProperty(exports, "ResolveLocale", {enumerable: true, get: function() {
|
|
759
|
+
Object.defineProperty(exports, "ResolveLocale", { enumerable: true, get: function() {
|
|
760
760
|
return ResolveLocale_2.ResolveLocale;
|
|
761
|
-
}});
|
|
761
|
+
} });
|
|
762
762
|
}
|
|
763
763
|
});
|
|
764
764
|
|
|
@@ -766,7 +766,7 @@
|
|
|
766
766
|
var require_parser = __commonJS({
|
|
767
767
|
"bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/src/parser.js": function(exports) {
|
|
768
768
|
"use strict";
|
|
769
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
769
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
770
770
|
exports.parseUnicodeLocaleId = exports.parseUnicodeLanguageId = exports.isUnicodeVariantSubtag = exports.isUnicodeScriptSubtag = exports.isUnicodeRegionSubtag = exports.isStructurallyValidLanguageTag = exports.isUnicodeLanguageSubtag = exports.SEPARATOR = void 0;
|
|
771
771
|
var tslib_1 = require_tslib();
|
|
772
772
|
var ALPHANUM_1_8 = /^[a-z0-9]{1,8}$/i;
|
|
@@ -815,7 +815,7 @@
|
|
|
815
815
|
throw new RangeError("Missing unicode_language_subtag");
|
|
816
816
|
}
|
|
817
817
|
if (lang === "root") {
|
|
818
|
-
return {lang: "root", variants: []};
|
|
818
|
+
return { lang: "root", variants: [] };
|
|
819
819
|
}
|
|
820
820
|
if (!isUnicodeLanguageSubtag2(lang)) {
|
|
821
821
|
throw new RangeError("Malformed unicode_language_subtag");
|
|
@@ -832,7 +832,7 @@
|
|
|
832
832
|
while (chunks.length && isUnicodeVariantSubtag(chunks[0])) {
|
|
833
833
|
var variant = chunks.shift();
|
|
834
834
|
if (variant in variants) {
|
|
835
|
-
throw new RangeError('Duplicate variant "'
|
|
835
|
+
throw new RangeError('Duplicate variant "'.concat(variant, '"'));
|
|
836
836
|
}
|
|
837
837
|
variants[variant] = 1;
|
|
838
838
|
}
|
|
@@ -903,7 +903,7 @@
|
|
|
903
903
|
value.push(chunks.shift());
|
|
904
904
|
}
|
|
905
905
|
if (!value.length) {
|
|
906
|
-
throw new RangeError('Missing tvalue for tkey "'
|
|
906
|
+
throw new RangeError('Missing tvalue for tkey "'.concat(key, '"'));
|
|
907
907
|
}
|
|
908
908
|
fields.push([key, value.join(exports.SEPARATOR)]);
|
|
909
909
|
}
|
|
@@ -941,7 +941,7 @@
|
|
|
941
941
|
}
|
|
942
942
|
function parseExtensions(chunks) {
|
|
943
943
|
if (!chunks.length) {
|
|
944
|
-
return {extensions: []};
|
|
944
|
+
return { extensions: [] };
|
|
945
945
|
}
|
|
946
946
|
var extensions = [];
|
|
947
947
|
var unicodeExtension;
|
|
@@ -980,7 +980,7 @@
|
|
|
980
980
|
throw new RangeError("Malformed extension type");
|
|
981
981
|
}
|
|
982
982
|
if (type in otherExtensionMap) {
|
|
983
|
-
throw new RangeError("There can only be 1 -"
|
|
983
|
+
throw new RangeError("There can only be 1 -".concat(type, "- extension"));
|
|
984
984
|
}
|
|
985
985
|
var extension = {
|
|
986
986
|
type: type,
|
|
@@ -991,12 +991,12 @@
|
|
|
991
991
|
break;
|
|
992
992
|
}
|
|
993
993
|
} while (chunks.length);
|
|
994
|
-
return {extensions: extensions};
|
|
994
|
+
return { extensions: extensions };
|
|
995
995
|
}
|
|
996
996
|
function parseUnicodeLocaleId2(locale) {
|
|
997
997
|
var chunks = locale.split(exports.SEPARATOR);
|
|
998
998
|
var lang = parseUnicodeLanguageId2(chunks);
|
|
999
|
-
return tslib_1.__assign({lang: lang}, parseExtensions(chunks));
|
|
999
|
+
return (0, tslib_1.__assign)({ lang: lang }, parseExtensions(chunks));
|
|
1000
1000
|
}
|
|
1001
1001
|
exports.parseUnicodeLocaleId = parseUnicodeLocaleId2;
|
|
1002
1002
|
}
|
|
@@ -1006,14 +1006,14 @@
|
|
|
1006
1006
|
var require_emitter = __commonJS({
|
|
1007
1007
|
"bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/src/emitter.js": function(exports) {
|
|
1008
1008
|
"use strict";
|
|
1009
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
1009
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1010
1010
|
exports.emitUnicodeLocaleId = exports.emitUnicodeLanguageId = void 0;
|
|
1011
1011
|
var tslib_1 = require_tslib();
|
|
1012
1012
|
function emitUnicodeLanguageId2(lang) {
|
|
1013
1013
|
if (!lang) {
|
|
1014
1014
|
return "";
|
|
1015
1015
|
}
|
|
1016
|
-
return tslib_1.__spreadArray([lang.lang, lang.script, lang.region], lang.variants || []).filter(Boolean).join("-");
|
|
1016
|
+
return (0, tslib_1.__spreadArray)([lang.lang, lang.script, lang.region], lang.variants || [], true).filter(Boolean).join("-");
|
|
1017
1017
|
}
|
|
1018
1018
|
exports.emitUnicodeLanguageId = emitUnicodeLanguageId2;
|
|
1019
1019
|
function emitUnicodeLocaleId2(_a) {
|
|
@@ -1024,14 +1024,14 @@
|
|
|
1024
1024
|
chunks.push(ext.type);
|
|
1025
1025
|
switch (ext.type) {
|
|
1026
1026
|
case "u":
|
|
1027
|
-
chunks.push.apply(chunks, tslib_1.__spreadArray(tslib_1.__spreadArray([], ext.attributes), ext.keywords.reduce(function(all, kv) {
|
|
1027
|
+
chunks.push.apply(chunks, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], ext.attributes, false), ext.keywords.reduce(function(all, kv) {
|
|
1028
1028
|
return all.concat(kv);
|
|
1029
|
-
}, [])));
|
|
1029
|
+
}, []), false));
|
|
1030
1030
|
break;
|
|
1031
1031
|
case "t":
|
|
1032
|
-
chunks.push.apply(chunks, tslib_1.__spreadArray([emitUnicodeLanguageId2(ext.lang)], ext.fields.reduce(function(all, kv) {
|
|
1032
|
+
chunks.push.apply(chunks, (0, tslib_1.__spreadArray)([emitUnicodeLanguageId2(ext.lang)], ext.fields.reduce(function(all, kv) {
|
|
1033
1033
|
return all.concat(kv);
|
|
1034
|
-
}, [])));
|
|
1034
|
+
}, []), false));
|
|
1035
1035
|
break;
|
|
1036
1036
|
default:
|
|
1037
1037
|
chunks.push(ext.value);
|
|
@@ -1048,7 +1048,7 @@
|
|
|
1048
1048
|
var require_aliases_generated = __commonJS({
|
|
1049
1049
|
"bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/src/aliases.generated.js": function(exports) {
|
|
1050
1050
|
"use strict";
|
|
1051
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
1051
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1052
1052
|
exports.variantAlias = exports.scriptAlias = exports.territoryAlias = exports.languageAlias = void 0;
|
|
1053
1053
|
exports.languageAlias = {
|
|
1054
1054
|
"aa-saaho": "ssy",
|
|
@@ -2189,7 +2189,7 @@
|
|
|
2189
2189
|
var require_likelySubtags_generated = __commonJS({
|
|
2190
2190
|
"bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/src/likelySubtags.generated.js": function(exports) {
|
|
2191
2191
|
"use strict";
|
|
2192
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
2192
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2193
2193
|
exports.likelySubtags = void 0;
|
|
2194
2194
|
exports.likelySubtags = {
|
|
2195
2195
|
"aa": "aa-Latn-ET",
|
|
@@ -4056,7 +4056,7 @@
|
|
|
4056
4056
|
var require_canonicalizer = __commonJS({
|
|
4057
4057
|
"bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/src/canonicalizer.js": function(exports) {
|
|
4058
4058
|
"use strict";
|
|
4059
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
4059
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4060
4060
|
exports.canonicalizeUnicodeLocaleId = exports.canonicalizeUnicodeLanguageId = void 0;
|
|
4061
4061
|
var tslib_1 = require_tslib();
|
|
4062
4062
|
var aliases_generated_1 = require_aliases_generated();
|
|
@@ -4093,7 +4093,7 @@
|
|
|
4093
4093
|
return e1.type < e2.type ? -1 : e1.type > e2.type ? 1 : 0;
|
|
4094
4094
|
}
|
|
4095
4095
|
function mergeVariants(v1, v2) {
|
|
4096
|
-
var result = tslib_1.__spreadArray([], v1);
|
|
4096
|
+
var result = (0, tslib_1.__spreadArray)([], v1, true);
|
|
4097
4097
|
for (var _i = 0, v2_1 = v2; _i < v2_1.length; _i++) {
|
|
4098
4098
|
var v = v2_1[_i];
|
|
4099
4099
|
if (v1.indexOf(v) < 0) {
|
|
@@ -4108,11 +4108,11 @@
|
|
|
4108
4108
|
var replacedLang_1 = "";
|
|
4109
4109
|
for (var _i = 0, _a = unicodeLanguageId.variants; _i < _a.length; _i++) {
|
|
4110
4110
|
var variant = _a[_i];
|
|
4111
|
-
if (replacedLang_1 = aliases_generated_1.languageAlias[emitter_1.emitUnicodeLanguageId({
|
|
4111
|
+
if (replacedLang_1 = aliases_generated_1.languageAlias[(0, emitter_1.emitUnicodeLanguageId)({
|
|
4112
4112
|
lang: unicodeLanguageId.lang,
|
|
4113
4113
|
variants: [variant]
|
|
4114
4114
|
})]) {
|
|
4115
|
-
var replacedLangAst = parser_1.parseUnicodeLanguageId(replacedLang_1.split(parser_1.SEPARATOR));
|
|
4115
|
+
var replacedLangAst = (0, parser_1.parseUnicodeLanguageId)(replacedLang_1.split(parser_1.SEPARATOR));
|
|
4116
4116
|
finalLangAst = {
|
|
4117
4117
|
lang: replacedLangAst.lang,
|
|
4118
4118
|
script: finalLangAst.script || replacedLangAst.script,
|
|
@@ -4124,14 +4124,14 @@
|
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
4126
4126
|
if (finalLangAst.script && finalLangAst.region) {
|
|
4127
|
-
var replacedLang_2 = aliases_generated_1.languageAlias[emitter_1.emitUnicodeLanguageId({
|
|
4127
|
+
var replacedLang_2 = aliases_generated_1.languageAlias[(0, emitter_1.emitUnicodeLanguageId)({
|
|
4128
4128
|
lang: finalLangAst.lang,
|
|
4129
4129
|
script: finalLangAst.script,
|
|
4130
4130
|
region: finalLangAst.region,
|
|
4131
4131
|
variants: []
|
|
4132
4132
|
})];
|
|
4133
4133
|
if (replacedLang_2) {
|
|
4134
|
-
var replacedLangAst = parser_1.parseUnicodeLanguageId(replacedLang_2.split(parser_1.SEPARATOR));
|
|
4134
|
+
var replacedLangAst = (0, parser_1.parseUnicodeLanguageId)(replacedLang_2.split(parser_1.SEPARATOR));
|
|
4135
4135
|
finalLangAst = {
|
|
4136
4136
|
lang: replacedLangAst.lang,
|
|
4137
4137
|
script: replacedLangAst.script,
|
|
@@ -4141,13 +4141,13 @@
|
|
|
4141
4141
|
}
|
|
4142
4142
|
}
|
|
4143
4143
|
if (finalLangAst.region) {
|
|
4144
|
-
var replacedLang_3 = aliases_generated_1.languageAlias[emitter_1.emitUnicodeLanguageId({
|
|
4144
|
+
var replacedLang_3 = aliases_generated_1.languageAlias[(0, emitter_1.emitUnicodeLanguageId)({
|
|
4145
4145
|
lang: finalLangAst.lang,
|
|
4146
4146
|
region: finalLangAst.region,
|
|
4147
4147
|
variants: []
|
|
4148
4148
|
})];
|
|
4149
4149
|
if (replacedLang_3) {
|
|
4150
|
-
var replacedLangAst = parser_1.parseUnicodeLanguageId(replacedLang_3.split(parser_1.SEPARATOR));
|
|
4150
|
+
var replacedLangAst = (0, parser_1.parseUnicodeLanguageId)(replacedLang_3.split(parser_1.SEPARATOR));
|
|
4151
4151
|
finalLangAst = {
|
|
4152
4152
|
lang: replacedLangAst.lang,
|
|
4153
4153
|
script: finalLangAst.script || replacedLangAst.script,
|
|
@@ -4156,12 +4156,12 @@
|
|
|
4156
4156
|
};
|
|
4157
4157
|
}
|
|
4158
4158
|
}
|
|
4159
|
-
var replacedLang = aliases_generated_1.languageAlias[emitter_1.emitUnicodeLanguageId({
|
|
4159
|
+
var replacedLang = aliases_generated_1.languageAlias[(0, emitter_1.emitUnicodeLanguageId)({
|
|
4160
4160
|
lang: finalLangAst.lang,
|
|
4161
4161
|
variants: []
|
|
4162
4162
|
})];
|
|
4163
4163
|
if (replacedLang) {
|
|
4164
|
-
var replacedLangAst = parser_1.parseUnicodeLanguageId(replacedLang.split(parser_1.SEPARATOR));
|
|
4164
|
+
var replacedLangAst = (0, parser_1.parseUnicodeLanguageId)(replacedLang.split(parser_1.SEPARATOR));
|
|
4165
4165
|
finalLangAst = {
|
|
4166
4166
|
lang: replacedLangAst.lang,
|
|
4167
4167
|
script: finalLangAst.script || replacedLangAst.script,
|
|
@@ -4176,13 +4176,13 @@
|
|
|
4176
4176
|
if (regionAlias) {
|
|
4177
4177
|
var regions = regionAlias.split(" ");
|
|
4178
4178
|
replacedRegion = regions[0];
|
|
4179
|
-
var likelySubtag = likelySubtags_generated_1.likelySubtags[emitter_1.emitUnicodeLanguageId({
|
|
4179
|
+
var likelySubtag = likelySubtags_generated_1.likelySubtags[(0, emitter_1.emitUnicodeLanguageId)({
|
|
4180
4180
|
lang: finalLangAst.lang,
|
|
4181
4181
|
script: finalLangAst.script,
|
|
4182
4182
|
variants: []
|
|
4183
4183
|
})];
|
|
4184
4184
|
if (likelySubtag) {
|
|
4185
|
-
var likelyRegion = parser_1.parseUnicodeLanguageId(likelySubtag.split(parser_1.SEPARATOR)).region;
|
|
4185
|
+
var likelyRegion = (0, parser_1.parseUnicodeLanguageId)(likelySubtag.split(parser_1.SEPARATOR)).region;
|
|
4186
4186
|
if (likelyRegion && regions.indexOf(likelyRegion) > -1) {
|
|
4187
4187
|
replacedRegion = likelyRegion;
|
|
4188
4188
|
}
|
|
@@ -4204,9 +4204,9 @@
|
|
|
4204
4204
|
var variant = finalLangAst.variants[i].toLowerCase();
|
|
4205
4205
|
if (aliases_generated_1.variantAlias[variant]) {
|
|
4206
4206
|
var alias = aliases_generated_1.variantAlias[variant];
|
|
4207
|
-
if (parser_1.isUnicodeVariantSubtag(alias)) {
|
|
4207
|
+
if ((0, parser_1.isUnicodeVariantSubtag)(alias)) {
|
|
4208
4208
|
finalLangAst.variants[i] = alias;
|
|
4209
|
-
} else if (parser_1.isUnicodeLanguageSubtag(alias)) {
|
|
4209
|
+
} else if ((0, parser_1.isUnicodeLanguageSubtag)(alias)) {
|
|
4210
4210
|
finalLangAst.lang = alias;
|
|
4211
4211
|
}
|
|
4212
4212
|
}
|
|
@@ -4251,7 +4251,7 @@
|
|
|
4251
4251
|
var require_types = __commonJS({
|
|
4252
4252
|
"bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/src/types.js": function(exports) {
|
|
4253
4253
|
"use strict";
|
|
4254
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
4254
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4255
4255
|
}
|
|
4256
4256
|
});
|
|
4257
4257
|
|
|
@@ -4259,7 +4259,7 @@
|
|
|
4259
4259
|
var require_intl_getcanonicallocales = __commonJS({
|
|
4260
4260
|
"bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/index.js": function(exports) {
|
|
4261
4261
|
"use strict";
|
|
4262
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
4262
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4263
4263
|
exports.isUnicodeLanguageSubtag = exports.isUnicodeScriptSubtag = exports.isUnicodeRegionSubtag = exports.isStructurallyValidLanguageTag = exports.parseUnicodeLanguageId = exports.parseUnicodeLocaleId = exports.getCanonicalLocales = void 0;
|
|
4264
4264
|
var tslib_1 = require_tslib();
|
|
4265
4265
|
var parser_1 = require_parser();
|
|
@@ -4275,7 +4275,7 @@
|
|
|
4275
4275
|
}
|
|
4276
4276
|
for (var _i = 0, locales_1 = locales; _i < locales_1.length; _i++) {
|
|
4277
4277
|
var locale = locales_1[_i];
|
|
4278
|
-
var canonicalizedTag = emitter_1.emitUnicodeLocaleId(canonicalizer_1.canonicalizeUnicodeLocaleId(parser_1.parseUnicodeLocaleId(locale)));
|
|
4278
|
+
var canonicalizedTag = (0, emitter_1.emitUnicodeLocaleId)((0, canonicalizer_1.canonicalizeUnicodeLocaleId)((0, parser_1.parseUnicodeLocaleId)(locale)));
|
|
4279
4279
|
if (seen.indexOf(canonicalizedTag) < 0) {
|
|
4280
4280
|
seen.push(canonicalizedTag);
|
|
4281
4281
|
}
|
|
@@ -4287,27 +4287,27 @@
|
|
|
4287
4287
|
}
|
|
4288
4288
|
exports.getCanonicalLocales = getCanonicalLocales;
|
|
4289
4289
|
var parser_2 = require_parser();
|
|
4290
|
-
Object.defineProperty(exports, "parseUnicodeLocaleId", {enumerable: true, get: function() {
|
|
4290
|
+
Object.defineProperty(exports, "parseUnicodeLocaleId", { enumerable: true, get: function() {
|
|
4291
4291
|
return parser_2.parseUnicodeLocaleId;
|
|
4292
|
-
}});
|
|
4293
|
-
Object.defineProperty(exports, "parseUnicodeLanguageId", {enumerable: true, get: function() {
|
|
4292
|
+
} });
|
|
4293
|
+
Object.defineProperty(exports, "parseUnicodeLanguageId", { enumerable: true, get: function() {
|
|
4294
4294
|
return parser_2.parseUnicodeLanguageId;
|
|
4295
|
-
}});
|
|
4296
|
-
Object.defineProperty(exports, "isStructurallyValidLanguageTag", {enumerable: true, get: function() {
|
|
4295
|
+
} });
|
|
4296
|
+
Object.defineProperty(exports, "isStructurallyValidLanguageTag", { enumerable: true, get: function() {
|
|
4297
4297
|
return parser_2.isStructurallyValidLanguageTag;
|
|
4298
|
-
}});
|
|
4299
|
-
Object.defineProperty(exports, "isUnicodeRegionSubtag", {enumerable: true, get: function() {
|
|
4298
|
+
} });
|
|
4299
|
+
Object.defineProperty(exports, "isUnicodeRegionSubtag", { enumerable: true, get: function() {
|
|
4300
4300
|
return parser_2.isUnicodeRegionSubtag;
|
|
4301
|
-
}});
|
|
4302
|
-
Object.defineProperty(exports, "isUnicodeScriptSubtag", {enumerable: true, get: function() {
|
|
4301
|
+
} });
|
|
4302
|
+
Object.defineProperty(exports, "isUnicodeScriptSubtag", { enumerable: true, get: function() {
|
|
4303
4303
|
return parser_2.isUnicodeScriptSubtag;
|
|
4304
|
-
}});
|
|
4305
|
-
Object.defineProperty(exports, "isUnicodeLanguageSubtag", {enumerable: true, get: function() {
|
|
4304
|
+
} });
|
|
4305
|
+
Object.defineProperty(exports, "isUnicodeLanguageSubtag", { enumerable: true, get: function() {
|
|
4306
4306
|
return parser_2.isUnicodeLanguageSubtag;
|
|
4307
|
-
}});
|
|
4308
|
-
tslib_1.__exportStar(require_types(), exports);
|
|
4309
|
-
tslib_1.__exportStar(require_emitter(), exports);
|
|
4310
|
-
tslib_1.__exportStar(require_likelySubtags_generated(), exports);
|
|
4307
|
+
} });
|
|
4308
|
+
(0, tslib_1.__exportStar)(require_types(), exports);
|
|
4309
|
+
(0, tslib_1.__exportStar)(require_emitter(), exports);
|
|
4310
|
+
(0, tslib_1.__exportStar)(require_likelySubtags_generated(), exports);
|
|
4311
4311
|
}
|
|
4312
4312
|
});
|
|
4313
4313
|
|
|
@@ -4369,7 +4369,7 @@
|
|
|
4369
4369
|
if (values !== void 0 && !values.filter(function(val) {
|
|
4370
4370
|
return val == value;
|
|
4371
4371
|
}).length) {
|
|
4372
|
-
throw new RangeError(value
|
|
4372
|
+
throw new RangeError("".concat(value, " is not within ").concat(values.join(", ")));
|
|
4373
4373
|
}
|
|
4374
4374
|
return value;
|
|
4375
4375
|
}
|
|
@@ -4441,8 +4441,8 @@
|
|
|
4441
4441
|
var S_UNICODE_REGEX = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/;
|
|
4442
4442
|
|
|
4443
4443
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/format_to_parts.js
|
|
4444
|
-
var CARET_S_UNICODE_REGEX = new RegExp("^"
|
|
4445
|
-
var S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source
|
|
4444
|
+
var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
|
|
4445
|
+
var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
|
|
4446
4446
|
|
|
4447
4447
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
|
|
4448
4448
|
var import_intl_localematcher = __toModule(require_intl_localematcher());
|
|
@@ -4512,7 +4512,7 @@
|
|
|
4512
4512
|
if (region !== void 0) {
|
|
4513
4513
|
languageId.region = region;
|
|
4514
4514
|
}
|
|
4515
|
-
return Intl.getCanonicalLocales((0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, (0, import_intl_getcanonicallocales.parseUnicodeLocaleId)(tag)), {lang: languageId})))[0];
|
|
4515
|
+
return Intl.getCanonicalLocales((0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, (0, import_intl_getcanonicallocales.parseUnicodeLocaleId)(tag)), { lang: languageId })))[0];
|
|
4516
4516
|
}
|
|
4517
4517
|
function applyUnicodeExtensionToTag(tag, options, relevantExtensionKeys) {
|
|
4518
4518
|
var unicodeExtension;
|
|
@@ -4537,10 +4537,10 @@
|
|
|
4537
4537
|
value = entry[1];
|
|
4538
4538
|
}
|
|
4539
4539
|
}
|
|
4540
|
-
invariant(key in options, key
|
|
4540
|
+
invariant(key in options, "".concat(key, " must be in options"));
|
|
4541
4541
|
var optionsValue = options[key];
|
|
4542
4542
|
if (optionsValue !== void 0) {
|
|
4543
|
-
invariant(typeof optionsValue === "string", "Value for "
|
|
4543
|
+
invariant(typeof optionsValue === "string", "Value for ".concat(key, " must be a string"));
|
|
4544
4544
|
value = optionsValue;
|
|
4545
4545
|
if (entry) {
|
|
4546
4546
|
entry[1] = value;
|
|
@@ -4580,7 +4580,7 @@
|
|
|
4580
4580
|
lang: !lang || lang === "und" ? replacement.lang : lang,
|
|
4581
4581
|
script: script || replacement.script,
|
|
4582
4582
|
region: region || replacement.region,
|
|
4583
|
-
variants: (0, import_tslib2.__spreadArray)((0, import_tslib2.__spreadArray)([], variants), replacement.variants)
|
|
4583
|
+
variants: (0, import_tslib2.__spreadArray)((0, import_tslib2.__spreadArray)([], variants, true), replacement.variants, true)
|
|
4584
4584
|
};
|
|
4585
4585
|
}
|
|
4586
4586
|
function addLikelySubtags(tag) {
|
|
@@ -4588,7 +4588,7 @@
|
|
|
4588
4588
|
var unicodeLangId = ast.lang;
|
|
4589
4589
|
var lang = unicodeLangId.lang, script = unicodeLangId.script, region = unicodeLangId.region, variants = unicodeLangId.variants;
|
|
4590
4590
|
if (script && region) {
|
|
4591
|
-
var match_1 = import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({lang: lang, script: script, region: region, variants: []})];
|
|
4591
|
+
var match_1 = import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({ lang: lang, script: script, region: region, variants: [] })];
|
|
4592
4592
|
if (match_1) {
|
|
4593
4593
|
var parts_1 = (0, import_intl_getcanonicallocales.parseUnicodeLanguageId)(match_1);
|
|
4594
4594
|
ast.lang = mergeUnicodeLanguageId(void 0, void 0, void 0, variants, parts_1);
|
|
@@ -4596,7 +4596,7 @@
|
|
|
4596
4596
|
}
|
|
4597
4597
|
}
|
|
4598
4598
|
if (script) {
|
|
4599
|
-
var match_2 = import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({lang: lang, script: script, variants: []})];
|
|
4599
|
+
var match_2 = import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({ lang: lang, script: script, variants: [] })];
|
|
4600
4600
|
if (match_2) {
|
|
4601
4601
|
var parts_2 = (0, import_intl_getcanonicallocales.parseUnicodeLanguageId)(match_2);
|
|
4602
4602
|
ast.lang = mergeUnicodeLanguageId(void 0, void 0, region, variants, parts_2);
|
|
@@ -4604,14 +4604,14 @@
|
|
|
4604
4604
|
}
|
|
4605
4605
|
}
|
|
4606
4606
|
if (region) {
|
|
4607
|
-
var match_3 = import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({lang: lang, region: region, variants: []})];
|
|
4607
|
+
var match_3 = import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({ lang: lang, region: region, variants: [] })];
|
|
4608
4608
|
if (match_3) {
|
|
4609
4609
|
var parts_3 = (0, import_intl_getcanonicallocales.parseUnicodeLanguageId)(match_3);
|
|
4610
4610
|
ast.lang = mergeUnicodeLanguageId(void 0, script, void 0, variants, parts_3);
|
|
4611
4611
|
return (0, import_intl_getcanonicallocales.emitUnicodeLocaleId)(ast);
|
|
4612
4612
|
}
|
|
4613
4613
|
}
|
|
4614
|
-
var match = import_intl_getcanonicallocales.likelySubtags[lang] || import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({lang: "und", script: script, variants: []})];
|
|
4614
|
+
var match = import_intl_getcanonicallocales.likelySubtags[lang] || import_intl_getcanonicallocales.likelySubtags[(0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({ lang: "und", script: script, variants: [] })];
|
|
4615
4615
|
if (!match) {
|
|
4616
4616
|
throw new Error("No match for addLikelySubtags");
|
|
4617
4617
|
}
|
|
@@ -4624,23 +4624,23 @@
|
|
|
4624
4624
|
if (!maxLocale) {
|
|
4625
4625
|
return tag;
|
|
4626
4626
|
}
|
|
4627
|
-
maxLocale = (0, import_intl_getcanonicallocales.emitUnicodeLanguageId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, (0, import_intl_getcanonicallocales.parseUnicodeLanguageId)(maxLocale)), {variants: []}));
|
|
4627
|
+
maxLocale = (0, import_intl_getcanonicallocales.emitUnicodeLanguageId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, (0, import_intl_getcanonicallocales.parseUnicodeLanguageId)(maxLocale)), { variants: [] }));
|
|
4628
4628
|
var ast = (0, import_intl_getcanonicallocales.parseUnicodeLocaleId)(tag);
|
|
4629
4629
|
var _a = ast.lang, lang = _a.lang, script = _a.script, region = _a.region, variants = _a.variants;
|
|
4630
|
-
var trial = addLikelySubtags((0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({lang: lang, variants: []}));
|
|
4630
|
+
var trial = addLikelySubtags((0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({ lang: lang, variants: [] }));
|
|
4631
4631
|
if (trial === maxLocale) {
|
|
4632
|
-
return (0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, ast), {lang: mergeUnicodeLanguageId(lang, void 0, void 0, variants)}));
|
|
4632
|
+
return (0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, ast), { lang: mergeUnicodeLanguageId(lang, void 0, void 0, variants) }));
|
|
4633
4633
|
}
|
|
4634
4634
|
if (region) {
|
|
4635
|
-
var trial_1 = addLikelySubtags((0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({lang: lang, region: region, variants: []}));
|
|
4635
|
+
var trial_1 = addLikelySubtags((0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({ lang: lang, region: region, variants: [] }));
|
|
4636
4636
|
if (trial_1 === maxLocale) {
|
|
4637
|
-
return (0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, ast), {lang: mergeUnicodeLanguageId(lang, void 0, region, variants)}));
|
|
4637
|
+
return (0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, ast), { lang: mergeUnicodeLanguageId(lang, void 0, region, variants) }));
|
|
4638
4638
|
}
|
|
4639
4639
|
}
|
|
4640
4640
|
if (script) {
|
|
4641
|
-
var trial_2 = addLikelySubtags((0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({lang: lang, script: script, variants: []}));
|
|
4641
|
+
var trial_2 = addLikelySubtags((0, import_intl_getcanonicallocales.emitUnicodeLanguageId)({ lang: lang, script: script, variants: [] }));
|
|
4642
4642
|
if (trial_2 === maxLocale) {
|
|
4643
|
-
return (0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, ast), {lang: mergeUnicodeLanguageId(lang, script, void 0, variants)}));
|
|
4643
|
+
return (0, import_intl_getcanonicallocales.emitUnicodeLocaleId)((0, import_tslib2.__assign)((0, import_tslib2.__assign)({}, ast), { lang: mergeUnicodeLanguageId(lang, script, void 0, variants) }));
|
|
4644
4644
|
}
|
|
4645
4645
|
}
|
|
4646
4646
|
return tag;
|
package/polyfill.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var _1 = require("./");
|
|
4
4
|
var should_polyfill_1 = require("./should-polyfill");
|
|
5
|
-
if (should_polyfill_1.shouldPolyfill()) {
|
|
5
|
+
if ((0, should_polyfill_1.shouldPolyfill)()) {
|
|
6
6
|
Object.defineProperty(Intl, 'Locale', {
|
|
7
7
|
value: _1.Locale,
|
|
8
8
|
writable: true,
|