@formatjs/intl-numberformat 7.4.0 → 7.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/polyfill.iife.js +238 -348
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-numberformat",
3
- "version": "7.4.0",
3
+ "version": "7.4.3",
4
4
  "description": "Ponyfill for ES2020 Intl.NumberFormat",
5
5
  "keywords": [
6
6
  "polyfill",
@@ -22,8 +22,8 @@
22
22
  "url": "git+https://github.com/formatjs/formatjs.git"
23
23
  },
24
24
  "dependencies": {
25
- "@formatjs/ecma402-abstract": "1.11.1",
26
- "@formatjs/intl-localematcher": "0.2.22",
25
+ "@formatjs/ecma402-abstract": "1.11.4",
26
+ "@formatjs/intl-localematcher": "0.2.25",
27
27
  "tslib": "^2.1.0"
28
28
  },
29
29
  "bugs": {
package/polyfill.iife.js CHANGED
@@ -1,338 +1,4 @@
1
1
  (function() {
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __markAsModule = function(target) {
9
- return __defProp(target, "__esModule", { value: true });
10
- };
11
- var __commonJS = function(cb, mod) {
12
- return function __require() {
13
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
- };
15
- };
16
- var __reExport = function(target, module, copyDefault, desc) {
17
- if (module && typeof module === "object" || typeof module === "function")
18
- for (var keys = __getOwnPropNames(module), i = 0, n = keys.length, key; i < n; i++) {
19
- key = keys[i];
20
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
21
- __defProp(target, key, { get: function(k) {
22
- return module[k];
23
- }.bind(null, key), enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
24
- }
25
- return target;
26
- };
27
- var __toESM = function(module, isNodeMode) {
28
- return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", !isNodeMode && module && module.__esModule ? { get: function() {
29
- return module.default;
30
- }, enumerable: true } : { value: module, enumerable: true })), module);
31
- };
32
-
33
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js
34
- var require_utils = __commonJS({
35
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js": function(exports) {
36
- "use strict";
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.invariant = exports.UNICODE_EXTENSION_SEQUENCE_REGEX = void 0;
39
- exports.UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
40
- function invariant2(condition, message, Err) {
41
- if (Err === void 0) {
42
- Err = Error;
43
- }
44
- if (!condition) {
45
- throw new Err(message);
46
- }
47
- }
48
- exports.invariant = invariant2;
49
- }
50
- });
51
-
52
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestAvailableLocale.js
53
- var require_BestAvailableLocale = __commonJS({
54
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestAvailableLocale.js": function(exports) {
55
- "use strict";
56
- Object.defineProperty(exports, "__esModule", { value: true });
57
- exports.BestAvailableLocale = void 0;
58
- function BestAvailableLocale(availableLocales, locale) {
59
- var candidate = locale;
60
- while (true) {
61
- if (availableLocales.has(candidate)) {
62
- return candidate;
63
- }
64
- var pos = candidate.lastIndexOf("-");
65
- if (!~pos) {
66
- return void 0;
67
- }
68
- if (pos >= 2 && candidate[pos - 2] === "-") {
69
- pos -= 2;
70
- }
71
- candidate = candidate.slice(0, pos);
72
- }
73
- }
74
- exports.BestAvailableLocale = BestAvailableLocale;
75
- }
76
- });
77
-
78
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupMatcher.js
79
- var require_LookupMatcher = __commonJS({
80
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupMatcher.js": function(exports) {
81
- "use strict";
82
- Object.defineProperty(exports, "__esModule", { value: true });
83
- exports.LookupMatcher = void 0;
84
- var utils_1 = require_utils();
85
- var BestAvailableLocale_1 = require_BestAvailableLocale();
86
- function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
87
- var result = { locale: "" };
88
- for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
89
- var locale = requestedLocales_1[_i];
90
- var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
91
- var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
92
- if (availableLocale) {
93
- result.locale = availableLocale;
94
- if (locale !== noExtensionLocale) {
95
- result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);
96
- }
97
- return result;
98
- }
99
- }
100
- result.locale = getDefaultLocale();
101
- return result;
102
- }
103
- exports.LookupMatcher = LookupMatcher;
104
- }
105
- });
106
-
107
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestFitMatcher.js
108
- var require_BestFitMatcher = __commonJS({
109
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestFitMatcher.js": function(exports) {
110
- "use strict";
111
- Object.defineProperty(exports, "__esModule", { value: true });
112
- exports.BestFitMatcher = void 0;
113
- var BestAvailableLocale_1 = require_BestAvailableLocale();
114
- var utils_1 = require_utils();
115
- function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
116
- var minimizedAvailableLocaleMap = {};
117
- availableLocales.forEach(function(l2) {
118
- return minimizedAvailableLocaleMap[l2] = l2;
119
- });
120
- var minimizedAvailableLocales = /* @__PURE__ */ new Set();
121
- availableLocales.forEach(function(locale2) {
122
- var minimizedLocale = new Intl.Locale(locale2).minimize().toString();
123
- minimizedAvailableLocaleMap[minimizedLocale] = locale2;
124
- minimizedAvailableLocales.add(minimizedLocale);
125
- });
126
- var foundLocale;
127
- for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
128
- var l = requestedLocales_1[_i];
129
- if (foundLocale) {
130
- break;
131
- }
132
- var noExtensionLocale = l.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
133
- if (availableLocales.has(noExtensionLocale)) {
134
- foundLocale = noExtensionLocale;
135
- break;
136
- }
137
- if (minimizedAvailableLocales.has(noExtensionLocale)) {
138
- foundLocale = noExtensionLocale;
139
- break;
140
- }
141
- var locale = new Intl.Locale(noExtensionLocale);
142
- var maximizedRequestedLocale = locale.maximize().toString();
143
- var minimizedRequestedLocale = locale.minimize().toString();
144
- if (minimizedAvailableLocales.has(minimizedRequestedLocale)) {
145
- foundLocale = minimizedRequestedLocale;
146
- break;
147
- }
148
- foundLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(minimizedAvailableLocales, maximizedRequestedLocale);
149
- }
150
- return {
151
- locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
152
- };
153
- }
154
- exports.BestFitMatcher = BestFitMatcher;
155
- }
156
- });
157
-
158
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/UnicodeExtensionValue.js
159
- var require_UnicodeExtensionValue = __commonJS({
160
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/UnicodeExtensionValue.js": function(exports) {
161
- "use strict";
162
- Object.defineProperty(exports, "__esModule", { value: true });
163
- exports.UnicodeExtensionValue = void 0;
164
- var utils_1 = require_utils();
165
- function UnicodeExtensionValue(extension, key) {
166
- (0, utils_1.invariant)(key.length === 2, "key must have 2 elements");
167
- var size = extension.length;
168
- var searchValue = "-".concat(key, "-");
169
- var pos = extension.indexOf(searchValue);
170
- if (pos !== -1) {
171
- var start = pos + 4;
172
- var end = start;
173
- var k = start;
174
- var done = false;
175
- while (!done) {
176
- var e = extension.indexOf("-", k);
177
- var len = void 0;
178
- if (e === -1) {
179
- len = size - k;
180
- } else {
181
- len = e - k;
182
- }
183
- if (len === 2) {
184
- done = true;
185
- } else if (e === -1) {
186
- end = size;
187
- done = true;
188
- } else {
189
- end = e;
190
- k = e + 1;
191
- }
192
- }
193
- return extension.slice(start, end);
194
- }
195
- searchValue = "-".concat(key);
196
- pos = extension.indexOf(searchValue);
197
- if (pos !== -1 && pos + 3 === size) {
198
- return "";
199
- }
200
- return void 0;
201
- }
202
- exports.UnicodeExtensionValue = UnicodeExtensionValue;
203
- }
204
- });
205
-
206
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/ResolveLocale.js
207
- var require_ResolveLocale = __commonJS({
208
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/ResolveLocale.js": function(exports) {
209
- "use strict";
210
- Object.defineProperty(exports, "__esModule", { value: true });
211
- exports.ResolveLocale = void 0;
212
- var LookupMatcher_1 = require_LookupMatcher();
213
- var BestFitMatcher_1 = require_BestFitMatcher();
214
- var utils_1 = require_utils();
215
- var UnicodeExtensionValue_1 = require_UnicodeExtensionValue();
216
- function ResolveLocale2(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
217
- var matcher = options.localeMatcher;
218
- var r;
219
- if (matcher === "lookup") {
220
- r = (0, LookupMatcher_1.LookupMatcher)(availableLocales, requestedLocales, getDefaultLocale);
221
- } else {
222
- r = (0, BestFitMatcher_1.BestFitMatcher)(availableLocales, requestedLocales, getDefaultLocale);
223
- }
224
- var foundLocale = r.locale;
225
- var result = { locale: "", dataLocale: foundLocale };
226
- var supportedExtension = "-u";
227
- for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
228
- var key = relevantExtensionKeys_1[_i];
229
- (0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
230
- var foundLocaleData = localeData[foundLocale];
231
- (0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
232
- var keyLocaleData = foundLocaleData[key];
233
- (0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
234
- var value = keyLocaleData[0];
235
- (0, utils_1.invariant)(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
236
- var supportedExtensionAddition = "";
237
- if (r.extension) {
238
- var requestedValue = (0, UnicodeExtensionValue_1.UnicodeExtensionValue)(r.extension, key);
239
- if (requestedValue !== void 0) {
240
- if (requestedValue !== "") {
241
- if (~keyLocaleData.indexOf(requestedValue)) {
242
- value = requestedValue;
243
- supportedExtensionAddition = "-".concat(key, "-").concat(value);
244
- }
245
- } else if (~requestedValue.indexOf("true")) {
246
- value = "true";
247
- supportedExtensionAddition = "-".concat(key);
248
- }
249
- }
250
- }
251
- if (key in options) {
252
- var optionsValue = options[key];
253
- (0, utils_1.invariant)(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
254
- if (~keyLocaleData.indexOf(optionsValue)) {
255
- if (optionsValue !== value) {
256
- value = optionsValue;
257
- supportedExtensionAddition = "";
258
- }
259
- }
260
- }
261
- result[key] = value;
262
- supportedExtension += supportedExtensionAddition;
263
- }
264
- if (supportedExtension.length > 2) {
265
- var privateIndex = foundLocale.indexOf("-x-");
266
- if (privateIndex === -1) {
267
- foundLocale = foundLocale + supportedExtension;
268
- } else {
269
- var preExtension = foundLocale.slice(0, privateIndex);
270
- var postExtension = foundLocale.slice(privateIndex, foundLocale.length);
271
- foundLocale = preExtension + supportedExtension + postExtension;
272
- }
273
- foundLocale = Intl.getCanonicalLocales(foundLocale)[0];
274
- }
275
- result.locale = foundLocale;
276
- return result;
277
- }
278
- exports.ResolveLocale = ResolveLocale2;
279
- }
280
- });
281
-
282
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupSupportedLocales.js
283
- var require_LookupSupportedLocales = __commonJS({
284
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupSupportedLocales.js": function(exports) {
285
- "use strict";
286
- Object.defineProperty(exports, "__esModule", { value: true });
287
- exports.LookupSupportedLocales = void 0;
288
- var utils_1 = require_utils();
289
- var BestAvailableLocale_1 = require_BestAvailableLocale();
290
- function LookupSupportedLocales2(availableLocales, requestedLocales) {
291
- var subset = [];
292
- for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
293
- var locale = requestedLocales_1[_i];
294
- var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
295
- var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
296
- if (availableLocale) {
297
- subset.push(availableLocale);
298
- }
299
- }
300
- return subset;
301
- }
302
- exports.LookupSupportedLocales = LookupSupportedLocales2;
303
- }
304
- });
305
-
306
- // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/index.js
307
- var require_intl_localematcher = __commonJS({
308
- "bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/index.js": function(exports) {
309
- "use strict";
310
- Object.defineProperty(exports, "__esModule", { value: true });
311
- exports.ResolveLocale = exports.LookupSupportedLocales = exports.match = void 0;
312
- var ResolveLocale_1 = require_ResolveLocale();
313
- function match2(requestedLocales, availableLocales, defaultLocale, opts) {
314
- var locales = availableLocales.reduce(function(all, l) {
315
- all.add(l);
316
- return all;
317
- }, /* @__PURE__ */ new Set());
318
- return (0, ResolveLocale_1.ResolveLocale)(locales, requestedLocales, {
319
- localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
320
- }, [], {}, function() {
321
- return defaultLocale;
322
- }).locale;
323
- }
324
- exports.match = match2;
325
- var LookupSupportedLocales_1 = require_LookupSupportedLocales();
326
- Object.defineProperty(exports, "LookupSupportedLocales", { enumerable: true, get: function() {
327
- return LookupSupportedLocales_1.LookupSupportedLocales;
328
- } });
329
- var ResolveLocale_2 = require_ResolveLocale();
330
- Object.defineProperty(exports, "ResolveLocale", { enumerable: true, get: function() {
331
- return ResolveLocale_2.ResolveLocale;
332
- } });
333
- }
334
- });
335
-
336
2
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/CanonicalizeLocaleList.js
337
3
  function CanonicalizeLocaleList(locales) {
338
4
  return Intl.getCanonicalLocales(locales);
@@ -413,7 +79,7 @@
413
79
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/CoerceOptionsToObject.js
414
80
  function CoerceOptionsToObject(options) {
415
81
  if (typeof options === "undefined") {
416
- return Object.create(null);
82
+ return /* @__PURE__ */ Object.create(null);
417
83
  }
418
84
  return ToObject(options);
419
85
  }
@@ -1175,13 +841,241 @@
1175
841
  return result;
1176
842
  }
1177
843
 
1178
- // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
1179
- var import_intl_localematcher = __toESM(require_intl_localematcher());
844
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/CanonicalizeLocaleList.js
845
+ function CanonicalizeLocaleList2(locales) {
846
+ return Intl.getCanonicalLocales(locales);
847
+ }
848
+
849
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/utils.js
850
+ var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
851
+ function invariant2(condition, message, Err) {
852
+ if (Err === void 0) {
853
+ Err = Error;
854
+ }
855
+ if (!condition) {
856
+ throw new Err(message);
857
+ }
858
+ }
859
+
860
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/BestAvailableLocale.js
861
+ function BestAvailableLocale(availableLocales, locale) {
862
+ var candidate = locale;
863
+ while (true) {
864
+ if (availableLocales.has(candidate)) {
865
+ return candidate;
866
+ }
867
+ var pos = candidate.lastIndexOf("-");
868
+ if (!~pos) {
869
+ return void 0;
870
+ }
871
+ if (pos >= 2 && candidate[pos - 2] === "-") {
872
+ pos -= 2;
873
+ }
874
+ candidate = candidate.slice(0, pos);
875
+ }
876
+ }
877
+
878
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/LookupMatcher.js
879
+ function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
880
+ var result = { locale: "" };
881
+ for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
882
+ var locale = requestedLocales_1[_i];
883
+ var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
884
+ var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
885
+ if (availableLocale) {
886
+ result.locale = availableLocale;
887
+ if (locale !== noExtensionLocale) {
888
+ result.extension = locale.slice(noExtensionLocale.length + 1, locale.length);
889
+ }
890
+ return result;
891
+ }
892
+ }
893
+ result.locale = getDefaultLocale();
894
+ return result;
895
+ }
896
+
897
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/BestFitMatcher.js
898
+ function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
899
+ var minimizedAvailableLocaleMap = {};
900
+ var availableLocaleMap = {};
901
+ var canonicalizedLocaleMap = {};
902
+ var minimizedAvailableLocales = /* @__PURE__ */ new Set();
903
+ availableLocales.forEach(function(locale2) {
904
+ var minimizedLocale = new Intl.Locale(locale2).minimize().toString();
905
+ var canonicalizedLocale = Intl.getCanonicalLocales(locale2)[0] || locale2;
906
+ minimizedAvailableLocaleMap[minimizedLocale] = locale2;
907
+ availableLocaleMap[locale2] = locale2;
908
+ canonicalizedLocaleMap[canonicalizedLocale] = locale2;
909
+ minimizedAvailableLocales.add(minimizedLocale);
910
+ minimizedAvailableLocales.add(locale2);
911
+ minimizedAvailableLocales.add(canonicalizedLocale);
912
+ });
913
+ var foundLocale;
914
+ for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
915
+ var l = requestedLocales_1[_i];
916
+ if (foundLocale) {
917
+ break;
918
+ }
919
+ var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
920
+ if (availableLocales.has(noExtensionLocale)) {
921
+ foundLocale = noExtensionLocale;
922
+ break;
923
+ }
924
+ if (minimizedAvailableLocales.has(noExtensionLocale)) {
925
+ foundLocale = noExtensionLocale;
926
+ break;
927
+ }
928
+ var locale = new Intl.Locale(noExtensionLocale);
929
+ var maximizedRequestedLocale = locale.maximize().toString();
930
+ var minimizedRequestedLocale = locale.minimize().toString();
931
+ if (minimizedAvailableLocales.has(minimizedRequestedLocale)) {
932
+ foundLocale = minimizedRequestedLocale;
933
+ break;
934
+ }
935
+ foundLocale = BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
936
+ }
937
+ if (!foundLocale) {
938
+ return { locale: getDefaultLocale() };
939
+ }
940
+ return {
941
+ locale: availableLocaleMap[foundLocale] || canonicalizedLocaleMap[foundLocale] || minimizedAvailableLocaleMap[foundLocale] || foundLocale
942
+ };
943
+ }
944
+
945
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/UnicodeExtensionValue.js
946
+ function UnicodeExtensionValue(extension, key) {
947
+ invariant2(key.length === 2, "key must have 2 elements");
948
+ var size = extension.length;
949
+ var searchValue = "-".concat(key, "-");
950
+ var pos = extension.indexOf(searchValue);
951
+ if (pos !== -1) {
952
+ var start = pos + 4;
953
+ var end = start;
954
+ var k = start;
955
+ var done = false;
956
+ while (!done) {
957
+ var e = extension.indexOf("-", k);
958
+ var len = void 0;
959
+ if (e === -1) {
960
+ len = size - k;
961
+ } else {
962
+ len = e - k;
963
+ }
964
+ if (len === 2) {
965
+ done = true;
966
+ } else if (e === -1) {
967
+ end = size;
968
+ done = true;
969
+ } else {
970
+ end = e;
971
+ k = e + 1;
972
+ }
973
+ }
974
+ return extension.slice(start, end);
975
+ }
976
+ searchValue = "-".concat(key);
977
+ pos = extension.indexOf(searchValue);
978
+ if (pos !== -1 && pos + 3 === size) {
979
+ return "";
980
+ }
981
+ return void 0;
982
+ }
983
+
984
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/ResolveLocale.js
985
+ function ResolveLocale(availableLocales, requestedLocales, options, relevantExtensionKeys, localeData, getDefaultLocale) {
986
+ var matcher = options.localeMatcher;
987
+ var r;
988
+ if (matcher === "lookup") {
989
+ r = LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
990
+ } else {
991
+ r = BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
992
+ }
993
+ var foundLocale = r.locale;
994
+ var result = { locale: "", dataLocale: foundLocale };
995
+ var supportedExtension = "-u";
996
+ for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
997
+ var key = relevantExtensionKeys_1[_i];
998
+ invariant2(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
999
+ var foundLocaleData = localeData[foundLocale];
1000
+ invariant2(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
1001
+ var keyLocaleData = foundLocaleData[key];
1002
+ invariant2(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
1003
+ var value = keyLocaleData[0];
1004
+ invariant2(typeof value === "string" || value === null, "value must be string or null but got ".concat(typeof value, " in key ").concat(key));
1005
+ var supportedExtensionAddition = "";
1006
+ if (r.extension) {
1007
+ var requestedValue = UnicodeExtensionValue(r.extension, key);
1008
+ if (requestedValue !== void 0) {
1009
+ if (requestedValue !== "") {
1010
+ if (~keyLocaleData.indexOf(requestedValue)) {
1011
+ value = requestedValue;
1012
+ supportedExtensionAddition = "-".concat(key, "-").concat(value);
1013
+ }
1014
+ } else if (~requestedValue.indexOf("true")) {
1015
+ value = "true";
1016
+ supportedExtensionAddition = "-".concat(key);
1017
+ }
1018
+ }
1019
+ }
1020
+ if (key in options) {
1021
+ var optionsValue = options[key];
1022
+ invariant2(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
1023
+ if (~keyLocaleData.indexOf(optionsValue)) {
1024
+ if (optionsValue !== value) {
1025
+ value = optionsValue;
1026
+ supportedExtensionAddition = "";
1027
+ }
1028
+ }
1029
+ }
1030
+ result[key] = value;
1031
+ supportedExtension += supportedExtensionAddition;
1032
+ }
1033
+ if (supportedExtension.length > 2) {
1034
+ var privateIndex = foundLocale.indexOf("-x-");
1035
+ if (privateIndex === -1) {
1036
+ foundLocale = foundLocale + supportedExtension;
1037
+ } else {
1038
+ var preExtension = foundLocale.slice(0, privateIndex);
1039
+ var postExtension = foundLocale.slice(privateIndex, foundLocale.length);
1040
+ foundLocale = preExtension + supportedExtension + postExtension;
1041
+ }
1042
+ foundLocale = Intl.getCanonicalLocales(foundLocale)[0];
1043
+ }
1044
+ result.locale = foundLocale;
1045
+ return result;
1046
+ }
1047
+
1048
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/abstract/LookupSupportedLocales.js
1049
+ function LookupSupportedLocales(availableLocales, requestedLocales) {
1050
+ var subset = [];
1051
+ for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
1052
+ var locale = requestedLocales_1[_i];
1053
+ var noExtensionLocale = locale.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, "");
1054
+ var availableLocale = BestAvailableLocale(availableLocales, noExtensionLocale);
1055
+ if (availableLocale) {
1056
+ subset.push(availableLocale);
1057
+ }
1058
+ }
1059
+ return subset;
1060
+ }
1061
+
1062
+ // bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/lib/index.js
1063
+ function match(requestedLocales, availableLocales, defaultLocale, opts) {
1064
+ var locales = availableLocales.reduce(function(all, l) {
1065
+ all.add(l);
1066
+ return all;
1067
+ }, /* @__PURE__ */ new Set());
1068
+ return ResolveLocale(locales, CanonicalizeLocaleList2(requestedLocales), {
1069
+ localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
1070
+ }, [], {}, function() {
1071
+ return defaultLocale;
1072
+ }).locale;
1073
+ }
1180
1074
 
1181
1075
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/SetNumberFormatUnitOptions.js
1182
1076
  function SetNumberFormatUnitOptions(nf, options, _a) {
1183
1077
  if (options === void 0) {
1184
- options = Object.create(null);
1078
+ options = /* @__PURE__ */ Object.create(null);
1185
1079
  }
1186
1080
  var getInternalSlots2 = _a.getInternalSlots;
1187
1081
  var internalSlots = getInternalSlots2(nf);
@@ -1250,7 +1144,7 @@
1250
1144
  var getInternalSlots2 = _a.getInternalSlots, localeData = _a.localeData, availableLocales = _a.availableLocales, numberingSystemNames2 = _a.numberingSystemNames, getDefaultLocale = _a.getDefaultLocale, currencyDigitsData2 = _a.currencyDigitsData;
1251
1145
  var requestedLocales = CanonicalizeLocaleList(locales);
1252
1146
  var options = CoerceOptionsToObject(opts);
1253
- var opt = Object.create(null);
1147
+ var opt = /* @__PURE__ */ Object.create(null);
1254
1148
  var matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
1255
1149
  opt.localeMatcher = matcher;
1256
1150
  var numberingSystem = GetOption(options, "numberingSystem", "string", void 0, void 0);
@@ -1258,7 +1152,7 @@
1258
1152
  throw RangeError("Invalid numberingSystems: ".concat(numberingSystem));
1259
1153
  }
1260
1154
  opt.nu = numberingSystem;
1261
- var r = (0, import_intl_localematcher.ResolveLocale)(availableLocales, requestedLocales, opt, ["nu"], localeData, getDefaultLocale);
1155
+ var r = ResolveLocale(availableLocales, requestedLocales, opt, ["nu"], localeData, getDefaultLocale);
1262
1156
  var dataLocaleData = localeData[r.dataLocale];
1263
1157
  invariant(!!dataLocaleData, "Missing locale data for ".concat(r.dataLocale));
1264
1158
  var internalSlots = getInternalSlots2(nf);
@@ -1294,7 +1188,6 @@
1294
1188
  }
1295
1189
 
1296
1190
  // bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/SupportedLocales.js
1297
- var import_intl_localematcher2 = __toESM(require_intl_localematcher());
1298
1191
  function SupportedLocales(availableLocales, requestedLocales, options) {
1299
1192
  var matcher = "best fit";
1300
1193
  if (options !== void 0) {
@@ -1302,9 +1195,9 @@
1302
1195
  matcher = GetOption(options, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
1303
1196
  }
1304
1197
  if (matcher === "best fit") {
1305
- return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
1198
+ return LookupSupportedLocales(availableLocales, requestedLocales);
1306
1199
  }
1307
- return (0, import_intl_localematcher2.LookupSupportedLocales)(availableLocales, requestedLocales);
1200
+ return LookupSupportedLocales(availableLocales, requestedLocales);
1308
1201
  }
1309
1202
 
1310
1203
  // bazel-out/darwin-fastbuild/bin/packages/intl-numberformat/lib/src/currency-digits.generated.js
@@ -1318,7 +1211,7 @@
1318
1211
  function getInternalSlots(x) {
1319
1212
  var internalSlots = internalSlotMap.get(x);
1320
1213
  if (!internalSlots) {
1321
- internalSlots = Object.create(null);
1214
+ internalSlots = /* @__PURE__ */ Object.create(null);
1322
1215
  internalSlotMap.set(x, internalSlots);
1323
1216
  }
1324
1217
  return internalSlots;
@@ -1526,9 +1419,6 @@
1526
1419
  return numberFormat.format(x);
1527
1420
  }
1528
1421
 
1529
- // bazel-out/darwin-fastbuild/bin/packages/intl-numberformat/lib/should-polyfill.js
1530
- var import_intl_localematcher3 = __toESM(require_intl_localematcher());
1531
-
1532
1422
  // bazel-out/darwin-fastbuild/bin/packages/intl-numberformat/lib/supported-locales.js
1533
1423
  var supportedLocales = ["af-NA", "af", "agq", "ak", "am", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", "ar-SY", "ar-TD", "ar-TN", "ar-YE", "ar", "as", "asa", "ast", "az-Cyrl", "az-Latn", "az", "bas", "be-tarask", "be", "bem", "bez", "bg", "bm", "bn-IN", "bn", "bo-IN", "bo", "br", "brx", "bs-Cyrl", "bs-Latn", "bs", "ca-AD", "ca-ES-valencia", "ca-FR", "ca-IT", "ca", "ccp-IN", "ccp", "ce", "ceb", "cgg", "chr", "ckb-IR", "ckb", "cs", "cy", "da-GL", "da", "dav", "de-AT", "de-BE", "de-CH", "de-IT", "de-LI", "de-LU", "de", "dje", "doi", "dsb", "dua", "dyo", "dz", "ebu", "ee-TG", "ee", "el-CY", "el", "en-001", "en-150", "en-AE", "en-AG", "en-AI", "en-AS", "en-AT", "en-AU", "en-BB", "en-BE", "en-BI", "en-BM", "en-BS", "en-BW", "en-BZ", "en-CA", "en-CC", "en-CH", "en-CK", "en-CM", "en-CX", "en-CY", "en-DE", "en-DG", "en-DK", "en-DM", "en-ER", "en-FI", "en-FJ", "en-FK", "en-FM", "en-GB", "en-GD", "en-GG", "en-GH", "en-GI", "en-GM", "en-GU", "en-GY", "en-HK", "en-IE", "en-IL", "en-IM", "en-IN", "en-IO", "en-JE", "en-JM", "en-KE", "en-KI", "en-KN", "en-KY", "en-LC", "en-LR", "en-LS", "en-MG", "en-MH", "en-MO", "en-MP", "en-MS", "en-MT", "en-MU", "en-MW", "en-MY", "en-NA", "en-NF", "en-NG", "en-NL", "en-NR", "en-NU", "en-NZ", "en-PG", "en-PH", "en-PK", "en-PN", "en-PR", "en-PW", "en-RW", "en-SB", "en-SC", "en-SD", "en-SE", "en-SG", "en-SH", "en-SI", "en-SL", "en-SS", "en-SX", "en-SZ", "en-TC", "en-TK", "en-TO", "en-TT", "en-TV", "en-TZ", "en-UG", "en-UM", "en-VC", "en-VG", "en-VI", "en-VU", "en-WS", "en-ZA", "en-ZM", "en-ZW", "en", "eo", "es-419", "es-AR", "es-BO", "es-BR", "es-BZ", "es-CL", "es-CO", "es-CR", "es-CU", "es-DO", "es-EA", "es-EC", "es-GQ", "es-GT", "es-HN", "es-IC", "es-MX", "es-NI", "es-PA", "es-PE", "es-PH", "es-PR", "es-PY", "es-SV", "es-US", "es-UY", "es-VE", "es", "et", "eu", "ewo", "fa-AF", "fa", "ff-Adlm-BF", "ff-Adlm-CM", "ff-Adlm-GH", "ff-Adlm-GM", "ff-Adlm-GW", "ff-Adlm-LR", "ff-Adlm-MR", "ff-Adlm-NE", "ff-Adlm-NG", "ff-Adlm-SL", "ff-Adlm-SN", "ff-Adlm", "ff-Latn-BF", "ff-Latn-CM", "ff-Latn-GH", "ff-Latn-GM", "ff-Latn-GN", "ff-Latn-GW", "ff-Latn-LR", "ff-Latn-MR", "ff-Latn-NE", "ff-Latn-NG", "ff-Latn-SL", "ff-Latn", "ff", "fi", "fil", "fo-DK", "fo", "fr-BE", "fr-BF", "fr-BI", "fr-BJ", "fr-BL", "fr-CA", "fr-CD", "fr-CF", "fr-CG", "fr-CH", "fr-CI", "fr-CM", "fr-DJ", "fr-DZ", "fr-GA", "fr-GF", "fr-GN", "fr-GP", "fr-GQ", "fr-HT", "fr-KM", "fr-LU", "fr-MA", "fr-MC", "fr-MF", "fr-MG", "fr-ML", "fr-MQ", "fr-MR", "fr-MU", "fr-NC", "fr-NE", "fr-PF", "fr-PM", "fr-RE", "fr-RW", "fr-SC", "fr-SN", "fr-SY", "fr-TD", "fr-TG", "fr-TN", "fr-VU", "fr-WF", "fr-YT", "fr", "fur", "fy", "ga-GB", "ga", "gd", "gl", "gsw-FR", "gsw-LI", "gsw", "gu", "guz", "gv", "ha-GH", "ha-NE", "ha", "haw", "he", "hi", "hr-BA", "hr", "hsb", "hu", "hy", "ia", "id", "ig", "ii", "is", "it-CH", "it-SM", "it-VA", "it", "ja", "jgo", "jmc", "jv", "ka", "kab", "kam", "kde", "kea", "kgp", "khq", "ki", "kk", "kkj", "kl", "kln", "km", "kn", "ko-KP", "ko", "kok", "ks-Arab", "ks", "ksb", "ksf", "ksh", "ku", "kw", "ky", "lag", "lb", "lg", "lkt", "ln-AO", "ln-CF", "ln-CG", "ln", "lo", "lrc-IQ", "lrc", "lt", "lu", "luo", "luy", "lv", "mai", "mas-TZ", "mas", "mer", "mfe", "mg", "mgh", "mgo", "mi", "mk", "ml", "mn", "mni-Beng", "mni", "mr", "ms-BN", "ms-ID", "ms-SG", "ms", "mt", "mua", "my", "mzn", "naq", "nb-SJ", "nb", "nd", "nds-NL", "nds", "ne-IN", "ne", "nl-AW", "nl-BE", "nl-BQ", "nl-CW", "nl-SR", "nl-SX", "nl", "nmg", "nn", "nnh", "no", "nus", "nyn", "om-KE", "om", "or", "os-RU", "os", "pa-Arab", "pa-Guru", "pa", "pcm", "pl", "ps-PK", "ps", "pt-AO", "pt-CH", "pt-CV", "pt-GQ", "pt-GW", "pt-LU", "pt-MO", "pt-MZ", "pt-PT", "pt-ST", "pt-TL", "pt", "qu-BO", "qu-EC", "qu", "rm", "rn", "ro-MD", "ro", "rof", "ru-BY", "ru-KG", "ru-KZ", "ru-MD", "ru-UA", "ru", "rw", "rwk", "sa", "sah", "saq", "sat-Olck", "sat", "sbp", "sc", "sd-Arab", "sd-Deva", "sd", "se-FI", "se-SE", "se", "seh", "ses", "sg", "shi-Latn", "shi-Tfng", "shi", "si", "sk", "sl", "smn", "sn", "so-DJ", "so-ET", "so-KE", "so", "sq-MK", "sq-XK", "sq", "sr-Cyrl-BA", "sr-Cyrl-ME", "sr-Cyrl-XK", "sr-Cyrl", "sr-Latn-BA", "sr-Latn-ME", "sr-Latn-XK", "sr-Latn", "sr", "su-Latn", "su", "sv-AX", "sv-FI", "sv", "sw-CD", "sw-KE", "sw-UG", "sw", "ta-LK", "ta-MY", "ta-SG", "ta", "te", "teo-KE", "teo", "tg", "th", "ti-ER", "ti", "tk", "to", "tr-CY", "tr", "tt", "twq", "tzm", "ug", "uk", "und", "ur-IN", "ur", "uz-Arab", "uz-Cyrl", "uz-Latn", "uz", "vai-Latn", "vai-Vaii", "vai", "vi", "vun", "wae", "wo", "xh", "xog", "yav", "yi", "yo-BJ", "yo", "yrl-CO", "yrl-VE", "yrl", "yue-Hans", "yue-Hant", "yue", "zgh", "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG", "zh-Hans", "zh-Hant-HK", "zh-Hant-MO", "zh-Hant", "zh", "zu"];
1534
1424
 
@@ -1564,7 +1454,7 @@
1564
1454
  locale = "en";
1565
1455
  }
1566
1456
  if (typeof Intl === "undefined" || !("NumberFormat" in Intl) || !supportsES2020() || onlySupportsEn() || !supportedLocalesOf2(locale)) {
1567
- return locale ? (0, import_intl_localematcher3.match)([locale], supportedLocales, "en") : void 0;
1457
+ return locale ? match([locale], supportedLocales, "en") : void 0;
1568
1458
  }
1569
1459
  }
1570
1460