@formatjs/intl-datetimeformat 4.2.3 → 4.3.0
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 +1 -1
- package/lib/should-polyfill.d.ts +1 -1
- package/lib/should-polyfill.d.ts.map +1 -1
- package/lib/should-polyfill.js +7 -2
- package/lib/src/abstract/FormatDateTimePattern.js +1 -1
- package/lib/src/abstract/InitializeDateTimeFormat.js +3 -3
- package/lib/src/abstract/skeleton.js +1 -1
- package/lib/src/core.js +1 -1
- package/lib/src/packer.js +2 -2
- package/lib/supported-locales.d.ts +2 -0
- package/lib/supported-locales.d.ts.map +1 -0
- package/lib/supported-locales.js +2 -0
- package/package.json +3 -3
- package/polyfill-force.js +7 -7
- package/polyfill.iife.js +82 -71
- package/polyfill.js +8 -8
- package/should-polyfill.d.ts +1 -1
- package/should-polyfill.d.ts.map +1 -1
- package/should-polyfill.js +7 -2
- package/src/abstract/BasicFormatMatcher.js +2 -2
- package/src/abstract/BestFitFormatMatcher.js +3 -3
- package/src/abstract/DateTimeStyleFormat.js +3 -3
- package/src/abstract/FormatDateTime.js +1 -1
- package/src/abstract/FormatDateTimePattern.js +3 -3
- package/src/abstract/FormatDateTimeRange.js +1 -1
- package/src/abstract/FormatDateTimeRangeToParts.js +1 -1
- package/src/abstract/FormatDateTimeToParts.js +2 -2
- package/src/abstract/InitializeDateTimeFormat.js +30 -30
- package/src/abstract/PartitionDateTimePattern.js +2 -2
- package/src/abstract/PartitionDateTimeRangePattern.js +9 -9
- package/src/abstract/ToDateTimeOptions.js +1 -1
- package/src/abstract/ToLocalTime.js +10 -10
- package/src/abstract/skeleton.js +3 -3
- package/src/core.js +43 -43
- package/src/packer.js +3 -3
- package/src/to_locale_string.js +2 -2
- package/supported-locales.d.ts +2 -0
- package/supported-locales.d.ts.map +1 -0
- package/supported-locales.js +5 -0
- package/test262-main.js +1 -1
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, mod2) {
|
|
12
12
|
return function __require() {
|
|
13
|
-
return mod2 || (0, cb[Object.keys(cb)[0]])((mod2 = {exports: {}}).exports, mod2), mod2.exports;
|
|
13
|
+
return mod2 || (0, cb[Object.keys(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
var __reExport = function(target, module, desc) {
|
|
@@ -18,23 +18,23 @@
|
|
|
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
|
// bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js
|
|
34
34
|
var require_utils = __commonJS({
|
|
35
35
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/utils.js": function(exports) {
|
|
36
36
|
"use strict";
|
|
37
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.invariant = exports.UNICODE_EXTENSION_SEQUENCE_REGEX = void 0;
|
|
39
39
|
exports.UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
40
40
|
function invariant2(condition, message, Err) {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
var require_BestAvailableLocale = __commonJS({
|
|
54
54
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestAvailableLocale.js": function(exports) {
|
|
55
55
|
"use strict";
|
|
56
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
57
|
exports.BestAvailableLocale = void 0;
|
|
58
58
|
function BestAvailableLocale(availableLocales, locale) {
|
|
59
59
|
var candidate = locale;
|
|
@@ -79,16 +79,16 @@
|
|
|
79
79
|
var require_LookupMatcher = __commonJS({
|
|
80
80
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupMatcher.js": function(exports) {
|
|
81
81
|
"use strict";
|
|
82
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
82
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
83
83
|
exports.LookupMatcher = void 0;
|
|
84
84
|
var utils_1 = require_utils();
|
|
85
85
|
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
86
86
|
function LookupMatcher(availableLocales, requestedLocales, getDefaultLocale) {
|
|
87
|
-
var result = {locale: ""};
|
|
87
|
+
var result = { locale: "" };
|
|
88
88
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
89
89
|
var locale = requestedLocales_1[_i];
|
|
90
90
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
91
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
91
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
92
92
|
if (availableLocale) {
|
|
93
93
|
result.locale = availableLocale;
|
|
94
94
|
if (locale !== noExtensionLocale) {
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
var require_BestFitMatcher = __commonJS({
|
|
109
109
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/BestFitMatcher.js": function(exports) {
|
|
110
110
|
"use strict";
|
|
111
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
111
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
112
112
|
exports.BestFitMatcher = void 0;
|
|
113
113
|
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
114
114
|
var utils_1 = require_utils();
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
foundLocale = minimizedRequestedLocale;
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
148
|
-
foundLocale = BestAvailableLocale_1.BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
148
|
+
foundLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(minimizedAvailableLocales, maximizedRequestedLocale);
|
|
149
149
|
}
|
|
150
150
|
return {
|
|
151
151
|
locale: foundLocale && minimizedAvailableLocaleMap[foundLocale] || getDefaultLocale()
|
|
@@ -159,13 +159,13 @@
|
|
|
159
159
|
var require_UnicodeExtensionValue = __commonJS({
|
|
160
160
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/UnicodeExtensionValue.js": function(exports) {
|
|
161
161
|
"use strict";
|
|
162
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
162
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
163
163
|
exports.UnicodeExtensionValue = void 0;
|
|
164
164
|
var utils_1 = require_utils();
|
|
165
165
|
function UnicodeExtensionValue(extension, key) {
|
|
166
|
-
utils_1.invariant(key.length === 2, "key must have 2 elements");
|
|
166
|
+
(0, utils_1.invariant)(key.length === 2, "key must have 2 elements");
|
|
167
167
|
var size = extension.length;
|
|
168
|
-
var searchValue = "-"
|
|
168
|
+
var searchValue = "-".concat(key, "-");
|
|
169
169
|
var pos = extension.indexOf(searchValue);
|
|
170
170
|
if (pos !== -1) {
|
|
171
171
|
var start = pos + 4;
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
}
|
|
193
193
|
return extension.slice(start, end);
|
|
194
194
|
}
|
|
195
|
-
searchValue = "-"
|
|
195
|
+
searchValue = "-".concat(key);
|
|
196
196
|
pos = extension.indexOf(searchValue);
|
|
197
197
|
if (pos !== -1 && pos + 3 === size) {
|
|
198
198
|
return "";
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
var require_ResolveLocale = __commonJS({
|
|
208
208
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/ResolveLocale.js": function(exports) {
|
|
209
209
|
"use strict";
|
|
210
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
210
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
211
211
|
exports.ResolveLocale = void 0;
|
|
212
212
|
var LookupMatcher_1 = require_LookupMatcher();
|
|
213
213
|
var BestFitMatcher_1 = require_BestFitMatcher();
|
|
@@ -217,40 +217,40 @@
|
|
|
217
217
|
var matcher = options.localeMatcher;
|
|
218
218
|
var r;
|
|
219
219
|
if (matcher === "lookup") {
|
|
220
|
-
r = LookupMatcher_1.LookupMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
220
|
+
r = (0, LookupMatcher_1.LookupMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
221
221
|
} else {
|
|
222
|
-
r = BestFitMatcher_1.BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale);
|
|
222
|
+
r = (0, BestFitMatcher_1.BestFitMatcher)(availableLocales, requestedLocales, getDefaultLocale);
|
|
223
223
|
}
|
|
224
224
|
var foundLocale = r.locale;
|
|
225
|
-
var result = {locale: "", dataLocale: foundLocale};
|
|
225
|
+
var result = { locale: "", dataLocale: foundLocale };
|
|
226
226
|
var supportedExtension = "-u";
|
|
227
227
|
for (var _i = 0, relevantExtensionKeys_1 = relevantExtensionKeys; _i < relevantExtensionKeys_1.length; _i++) {
|
|
228
228
|
var key = relevantExtensionKeys_1[_i];
|
|
229
|
-
utils_1.invariant(foundLocale in localeData, "Missing locale data for "
|
|
229
|
+
(0, utils_1.invariant)(foundLocale in localeData, "Missing locale data for ".concat(foundLocale));
|
|
230
230
|
var foundLocaleData = localeData[foundLocale];
|
|
231
|
-
utils_1.invariant(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data "
|
|
231
|
+
(0, utils_1.invariant)(typeof foundLocaleData === "object" && foundLocaleData !== null, "locale data ".concat(key, " must be an object"));
|
|
232
232
|
var keyLocaleData = foundLocaleData[key];
|
|
233
|
-
utils_1.invariant(Array.isArray(keyLocaleData), "keyLocaleData for "
|
|
233
|
+
(0, utils_1.invariant)(Array.isArray(keyLocaleData), "keyLocaleData for ".concat(key, " must be an array"));
|
|
234
234
|
var value = keyLocaleData[0];
|
|
235
|
-
utils_1.invariant(typeof value === "string" || value === null, "value must be string or null but got "
|
|
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
236
|
var supportedExtensionAddition = "";
|
|
237
237
|
if (r.extension) {
|
|
238
|
-
var requestedValue = UnicodeExtensionValue_1.UnicodeExtensionValue(r.extension, key);
|
|
238
|
+
var requestedValue = (0, UnicodeExtensionValue_1.UnicodeExtensionValue)(r.extension, key);
|
|
239
239
|
if (requestedValue !== void 0) {
|
|
240
240
|
if (requestedValue !== "") {
|
|
241
241
|
if (~keyLocaleData.indexOf(requestedValue)) {
|
|
242
242
|
value = requestedValue;
|
|
243
|
-
supportedExtensionAddition = "-"
|
|
243
|
+
supportedExtensionAddition = "-".concat(key, "-").concat(value);
|
|
244
244
|
}
|
|
245
245
|
} else if (~requestedValue.indexOf("true")) {
|
|
246
246
|
value = "true";
|
|
247
|
-
supportedExtensionAddition = "-"
|
|
247
|
+
supportedExtensionAddition = "-".concat(key);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
if (key in options) {
|
|
252
252
|
var optionsValue = options[key];
|
|
253
|
-
utils_1.invariant(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
253
|
+
(0, utils_1.invariant)(typeof optionsValue === "string" || typeof optionsValue === "undefined" || optionsValue === null, "optionsValue must be String, Undefined or Null");
|
|
254
254
|
if (~keyLocaleData.indexOf(optionsValue)) {
|
|
255
255
|
if (optionsValue !== value) {
|
|
256
256
|
value = optionsValue;
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
var require_LookupSupportedLocales = __commonJS({
|
|
284
284
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/abstract/LookupSupportedLocales.js": function(exports) {
|
|
285
285
|
"use strict";
|
|
286
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
286
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
287
287
|
exports.LookupSupportedLocales = void 0;
|
|
288
288
|
var utils_1 = require_utils();
|
|
289
289
|
var BestAvailableLocale_1 = require_BestAvailableLocale();
|
|
@@ -292,7 +292,7 @@
|
|
|
292
292
|
for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
|
|
293
293
|
var locale = requestedLocales_1[_i];
|
|
294
294
|
var noExtensionLocale = locale.replace(utils_1.UNICODE_EXTENSION_SEQUENCE_REGEX, "");
|
|
295
|
-
var availableLocale = BestAvailableLocale_1.BestAvailableLocale(availableLocales, noExtensionLocale);
|
|
295
|
+
var availableLocale = (0, BestAvailableLocale_1.BestAvailableLocale)(availableLocales, noExtensionLocale);
|
|
296
296
|
if (availableLocale) {
|
|
297
297
|
subset.push(availableLocale);
|
|
298
298
|
}
|
|
@@ -307,35 +307,35 @@
|
|
|
307
307
|
var require_intl_localematcher = __commonJS({
|
|
308
308
|
"bazel-out/darwin-fastbuild/bin/packages/intl-localematcher/index.js": function(exports) {
|
|
309
309
|
"use strict";
|
|
310
|
-
Object.defineProperty(exports, "__esModule", {value: true});
|
|
310
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
311
311
|
exports.ResolveLocale = exports.LookupSupportedLocales = exports.match = void 0;
|
|
312
312
|
var ResolveLocale_1 = require_ResolveLocale();
|
|
313
|
-
function
|
|
313
|
+
function match2(requestedLocales, availableLocales, defaultLocale, opts) {
|
|
314
314
|
var locales = availableLocales.reduce(function(all, l) {
|
|
315
315
|
all.add(l);
|
|
316
316
|
return all;
|
|
317
317
|
}, new Set());
|
|
318
|
-
return ResolveLocale_1.ResolveLocale(locales, requestedLocales, {
|
|
318
|
+
return (0, ResolveLocale_1.ResolveLocale)(locales, requestedLocales, {
|
|
319
319
|
localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || "best fit"
|
|
320
320
|
}, [], {}, function() {
|
|
321
321
|
return defaultLocale;
|
|
322
322
|
}).locale;
|
|
323
323
|
}
|
|
324
|
-
exports.match =
|
|
324
|
+
exports.match = match2;
|
|
325
325
|
var LookupSupportedLocales_1 = require_LookupSupportedLocales();
|
|
326
|
-
Object.defineProperty(exports, "LookupSupportedLocales", {enumerable: true, get: function() {
|
|
326
|
+
Object.defineProperty(exports, "LookupSupportedLocales", { enumerable: true, get: function() {
|
|
327
327
|
return LookupSupportedLocales_1.LookupSupportedLocales;
|
|
328
|
-
}});
|
|
328
|
+
} });
|
|
329
329
|
var ResolveLocale_2 = require_ResolveLocale();
|
|
330
|
-
Object.defineProperty(exports, "ResolveLocale", {enumerable: true, get: function() {
|
|
330
|
+
Object.defineProperty(exports, "ResolveLocale", { enumerable: true, get: function() {
|
|
331
331
|
return ResolveLocale_2.ResolveLocale;
|
|
332
|
-
}});
|
|
332
|
+
} });
|
|
333
333
|
}
|
|
334
334
|
});
|
|
335
335
|
|
|
336
336
|
// node_modules/tslib/tslib.es6.js
|
|
337
337
|
var extendStatics = function(d, b) {
|
|
338
|
-
extendStatics = Object.setPrototypeOf || {__proto__: []} instanceof Array && function(d2, b2) {
|
|
338
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
339
339
|
d2.__proto__ = b2;
|
|
340
340
|
} || function(d2, b2) {
|
|
341
341
|
for (var p in b2)
|
|
@@ -654,7 +654,7 @@
|
|
|
654
654
|
if (val !== void 0) {
|
|
655
655
|
val = Number(val);
|
|
656
656
|
if (isNaN(val) || val < min || val > max) {
|
|
657
|
-
throw new RangeError(val
|
|
657
|
+
throw new RangeError("".concat(val, " is outside of range [").concat(min, ", ").concat(max, "]"));
|
|
658
658
|
}
|
|
659
659
|
return Math.floor(val);
|
|
660
660
|
}
|
|
@@ -686,7 +686,7 @@
|
|
|
686
686
|
if (values !== void 0 && !values.filter(function(val) {
|
|
687
687
|
return val == value;
|
|
688
688
|
}).length) {
|
|
689
|
-
throw new RangeError(value
|
|
689
|
+
throw new RangeError("".concat(value, " is not within ").concat(values.join(", ")));
|
|
690
690
|
}
|
|
691
691
|
return value;
|
|
692
692
|
}
|
|
@@ -785,8 +785,8 @@
|
|
|
785
785
|
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]/;
|
|
786
786
|
|
|
787
787
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/format_to_parts.js
|
|
788
|
-
var CARET_S_UNICODE_REGEX = new RegExp("^"
|
|
789
|
-
var S_DOLLAR_UNICODE_REGEX = new RegExp(S_UNICODE_REGEX.source
|
|
788
|
+
var CARET_S_UNICODE_REGEX = new RegExp("^".concat(S_UNICODE_REGEX.source));
|
|
789
|
+
var S_DOLLAR_UNICODE_REGEX = new RegExp("".concat(S_UNICODE_REGEX.source, "$"));
|
|
790
790
|
|
|
791
791
|
// bazel-out/darwin-fastbuild/bin/packages/ecma402-abstract/lib/NumberFormat/InitializeNumberFormat.js
|
|
792
792
|
var import_intl_localematcher = __toModule(require_intl_localematcher());
|
|
@@ -800,7 +800,7 @@
|
|
|
800
800
|
var length = pattern.length;
|
|
801
801
|
while (beginIndex < pattern.length && beginIndex > -1) {
|
|
802
802
|
endIndex = pattern.indexOf("}", beginIndex);
|
|
803
|
-
invariant(endIndex > beginIndex, "Invalid pattern "
|
|
803
|
+
invariant(endIndex > beginIndex, "Invalid pattern ".concat(pattern));
|
|
804
804
|
if (beginIndex > nextIndex) {
|
|
805
805
|
result.push({
|
|
806
806
|
type: "literal",
|
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
// bazel-out/darwin-fastbuild/bin/packages/intl-datetimeformat/lib/src/abstract/FormatDateTimePattern.js
|
|
1085
1085
|
function pad(n) {
|
|
1086
1086
|
if (n < 10) {
|
|
1087
|
-
return "0"
|
|
1087
|
+
return "0".concat(n);
|
|
1088
1088
|
}
|
|
1089
1089
|
return String(n);
|
|
1090
1090
|
}
|
|
@@ -1127,7 +1127,7 @@
|
|
|
1127
1127
|
nf3Options.useGrouping = false;
|
|
1128
1128
|
nf3 = new Intl.NumberFormat(locale, nf3Options);
|
|
1129
1129
|
}
|
|
1130
|
-
var tm = ToLocalTime(x, internalSlots.calendar, internalSlots.timeZone, {tzData: tzData});
|
|
1130
|
+
var tm = ToLocalTime(x, internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
|
|
1131
1131
|
var result = [];
|
|
1132
1132
|
for (var _i = 0, patternParts_1 = patternParts; _i < patternParts_1.length; _i++) {
|
|
1133
1133
|
var patternPart = patternParts_1[_i];
|
|
@@ -1297,9 +1297,9 @@
|
|
|
1297
1297
|
// bazel-out/darwin-fastbuild/bin/packages/intl-datetimeformat/lib/src/abstract/skeleton.js
|
|
1298
1298
|
var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
1299
1299
|
var expPatternTrimmer = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
|
|
1300
|
-
function matchSkeletonPattern(
|
|
1301
|
-
var len =
|
|
1302
|
-
switch (
|
|
1300
|
+
function matchSkeletonPattern(match2, result) {
|
|
1301
|
+
var len = match2.length;
|
|
1302
|
+
switch (match2[0]) {
|
|
1303
1303
|
case "G":
|
|
1304
1304
|
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
1305
1305
|
return "{era}";
|
|
@@ -1437,7 +1437,7 @@
|
|
|
1437
1437
|
var literals = [];
|
|
1438
1438
|
var pattern12 = pattern.replace(/'{2}/g, "{apostrophe}").replace(/'(.*?)'/g, function(_, literal) {
|
|
1439
1439
|
literals.push(literal);
|
|
1440
|
-
return "$$"
|
|
1440
|
+
return "$$".concat(literals.length - 1, "$$");
|
|
1441
1441
|
}).replace(DATE_TIME_REGEX, function(m) {
|
|
1442
1442
|
return matchSkeletonPattern(m, result || {});
|
|
1443
1443
|
});
|
|
@@ -1471,8 +1471,8 @@
|
|
|
1471
1471
|
patternParts: []
|
|
1472
1472
|
};
|
|
1473
1473
|
var _a = processDateTimePattern(rawPattern_1, intervalResult), pattern_1 = _a[0], pattern12_1 = _a[1];
|
|
1474
|
-
result.rangePatterns[key] = __assign(__assign({}, intervalResult), {patternParts: splitRangePattern(pattern_1)});
|
|
1475
|
-
result.rangePatterns12[key] = __assign(__assign({}, intervalResult), {patternParts: splitRangePattern(pattern12_1)});
|
|
1474
|
+
result.rangePatterns[key] = __assign(__assign({}, intervalResult), { patternParts: splitRangePattern(pattern_1) });
|
|
1475
|
+
result.rangePatterns12[key] = __assign(__assign({}, intervalResult), { patternParts: splitRangePattern(pattern12_1) });
|
|
1476
1476
|
}
|
|
1477
1477
|
}
|
|
1478
1478
|
if (intervalFormatFallback) {
|
|
@@ -1517,13 +1517,13 @@
|
|
|
1517
1517
|
function splitRangePattern(pattern) {
|
|
1518
1518
|
var PART_REGEX = /\{(.*?)\}/g;
|
|
1519
1519
|
var parts = {};
|
|
1520
|
-
var
|
|
1520
|
+
var match2;
|
|
1521
1521
|
var splitIndex = 0;
|
|
1522
|
-
while (
|
|
1523
|
-
if (!(
|
|
1524
|
-
parts[
|
|
1522
|
+
while (match2 = PART_REGEX.exec(pattern)) {
|
|
1523
|
+
if (!(match2[0] in parts)) {
|
|
1524
|
+
parts[match2[0]] = match2.index;
|
|
1525
1525
|
} else {
|
|
1526
|
-
splitIndex =
|
|
1526
|
+
splitIndex = match2.index;
|
|
1527
1527
|
break;
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
@@ -1601,7 +1601,7 @@
|
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
1603
|
var skeletonFormat = __assign({}, bestFormat);
|
|
1604
|
-
var patternFormat = {rawPattern: bestFormat.rawPattern};
|
|
1604
|
+
var patternFormat = { rawPattern: bestFormat.rawPattern };
|
|
1605
1605
|
processDateTimePattern(bestFormat.rawPattern, patternFormat);
|
|
1606
1606
|
for (var prop in skeletonFormat) {
|
|
1607
1607
|
var skeletonValue = skeletonFormat[prop];
|
|
@@ -1795,10 +1795,10 @@
|
|
|
1795
1795
|
var timeZone = options.timeZone;
|
|
1796
1796
|
if (timeZone !== void 0) {
|
|
1797
1797
|
timeZone = String(timeZone);
|
|
1798
|
-
if (!IsValidTimeZoneName(timeZone, {tzData: tzData, uppercaseLinks: uppercaseLinks})) {
|
|
1798
|
+
if (!IsValidTimeZoneName(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks })) {
|
|
1799
1799
|
throw new RangeError("Invalid timeZoneName");
|
|
1800
1800
|
}
|
|
1801
|
-
timeZone = CanonicalizeTimeZoneName(timeZone, {tzData: tzData, uppercaseLinks: uppercaseLinks});
|
|
1801
|
+
timeZone = CanonicalizeTimeZoneName(timeZone, { tzData: tzData, uppercaseLinks: uppercaseLinks });
|
|
1802
1802
|
} else {
|
|
1803
1803
|
timeZone = getDefaultTimeZone();
|
|
1804
1804
|
}
|
|
@@ -1815,10 +1815,10 @@
|
|
|
1815
1815
|
opt.timeZoneName = GetOption(options, "timeZoneName", "string", ["short", "long"], void 0);
|
|
1816
1816
|
opt.fractionalSecondDigits = GetNumberOption(options, "fractionalSecondDigits", 1, 3, void 0);
|
|
1817
1817
|
var dataLocaleData = localeData[dataLocale];
|
|
1818
|
-
invariant(!!dataLocaleData, "Missing locale data for "
|
|
1818
|
+
invariant(!!dataLocaleData, "Missing locale data for ".concat(dataLocale));
|
|
1819
1819
|
var formats = dataLocaleData.formats[calendar];
|
|
1820
1820
|
if (!formats) {
|
|
1821
|
-
throw new RangeError('Calendar "'
|
|
1821
|
+
throw new RangeError('Calendar "'.concat(calendar, '" is not supported. Try setting "calendar" to 1 of the following: ').concat(Object.keys(dataLocaleData.formats).join(", ")));
|
|
1822
1822
|
}
|
|
1823
1823
|
var formatMatcher = GetOption(options, "formatMatcher", "string", ["basic", "best fit"], "best fit");
|
|
1824
1824
|
var dateStyle = GetOption(options, "dateStyle", "string", ["full", "long", "medium", "short"], void 0);
|
|
@@ -1841,7 +1841,7 @@
|
|
|
1841
1841
|
var prop = DATE_TIME_PROPS_1[_i];
|
|
1842
1842
|
var p = opt[prop];
|
|
1843
1843
|
if (p !== void 0) {
|
|
1844
|
-
throw new TypeError("Intl.DateTimeFormat can't set option "
|
|
1844
|
+
throw new TypeError("Intl.DateTimeFormat can't set option ".concat(prop, " when ").concat(dateStyle ? "dateStyle" : "timeStyle", " is used"));
|
|
1845
1845
|
}
|
|
1846
1846
|
}
|
|
1847
1847
|
bestFormat = DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData);
|
|
@@ -1913,8 +1913,8 @@
|
|
|
1913
1913
|
}
|
|
1914
1914
|
var getInternalSlots2 = implDetails.getInternalSlots, tzData = implDetails.tzData;
|
|
1915
1915
|
var internalSlots = getInternalSlots2(dtf);
|
|
1916
|
-
var tm1 = ToLocalTime(x, internalSlots.calendar, internalSlots.timeZone, {tzData: tzData});
|
|
1917
|
-
var tm2 = ToLocalTime(y, internalSlots.calendar, internalSlots.timeZone, {tzData: tzData});
|
|
1916
|
+
var tm1 = ToLocalTime(x, internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
|
|
1917
|
+
var tm2 = ToLocalTime(y, internalSlots.calendar, internalSlots.timeZone, { tzData: tzData });
|
|
1918
1918
|
var pattern = internalSlots.pattern, rangePatterns = internalSlots.rangePatterns;
|
|
1919
1919
|
var rangePattern;
|
|
1920
1920
|
var dateFieldsPracticallyEqual = true;
|
|
@@ -2106,7 +2106,7 @@
|
|
|
2106
2106
|
var internalSlots = getInternalSlots(this);
|
|
2107
2107
|
var dataLocale = internalSlots.dataLocale;
|
|
2108
2108
|
var dataLocaleData = DateTimeFormat.localeData[dataLocale];
|
|
2109
|
-
invariant(dataLocaleData !== void 0, "Cannot load locale-dependent data for "
|
|
2109
|
+
invariant(dataLocaleData !== void 0, "Cannot load locale-dependent data for ".concat(dataLocale, "."));
|
|
2110
2110
|
};
|
|
2111
2111
|
defineProperty(DateTimeFormat, "supportedLocalesOf", {
|
|
2112
2112
|
value: function supportedLocalesOf(locales, options) {
|
|
@@ -2225,7 +2225,7 @@
|
|
|
2225
2225
|
}
|
|
2226
2226
|
var _loop_1 = function(d2, locale2) {
|
|
2227
2227
|
var dateFormat = d2.dateFormat, timeFormat = d2.timeFormat, dateTimeFormat = d2.dateTimeFormat, formats = d2.formats, intervalFormats = d2.intervalFormats, rawData = __rest(d2, ["dateFormat", "timeFormat", "dateTimeFormat", "formats", "intervalFormats"]);
|
|
2228
|
-
var processedData = __assign(__assign({}, rawData), {dateFormat: {
|
|
2228
|
+
var processedData = __assign(__assign({}, rawData), { dateFormat: {
|
|
2229
2229
|
full: parseDateTimeSkeleton(dateFormat.full),
|
|
2230
2230
|
long: parseDateTimeSkeleton(dateFormat.long),
|
|
2231
2231
|
medium: parseDateTimeSkeleton(dateFormat.medium),
|
|
@@ -2240,7 +2240,7 @@
|
|
|
2240
2240
|
long: parseDateTimeSkeleton(dateTimeFormat.long).pattern,
|
|
2241
2241
|
medium: parseDateTimeSkeleton(dateTimeFormat.medium).pattern,
|
|
2242
2242
|
short: parseDateTimeSkeleton(dateTimeFormat.short).pattern
|
|
2243
|
-
}, formats: {}});
|
|
2243
|
+
}, formats: {} });
|
|
2244
2244
|
var _loop_2 = function(calendar2) {
|
|
2245
2245
|
processedData.formats[calendar2] = Object.keys(formats[calendar2]).map(function(skeleton) {
|
|
2246
2246
|
return parseDateTimeSkeleton(skeleton, formats[calendar2][skeleton], intervalFormats[skeleton], intervalFormats.intervalFormatFallback);
|
|
@@ -2292,6 +2292,12 @@
|
|
|
2292
2292
|
} catch (e) {
|
|
2293
2293
|
}
|
|
2294
2294
|
|
|
2295
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-datetimeformat/lib/should-polyfill.js
|
|
2296
|
+
var import_intl_localematcher4 = __toModule(require_intl_localematcher());
|
|
2297
|
+
|
|
2298
|
+
// bazel-out/darwin-fastbuild/bin/packages/intl-datetimeformat/lib/supported-locales.js
|
|
2299
|
+
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", "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-US-POSIX", "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", "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", "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", "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", "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"];
|
|
2300
|
+
|
|
2295
2301
|
// bazel-out/darwin-fastbuild/bin/packages/intl-datetimeformat/lib/should-polyfill.js
|
|
2296
2302
|
function supportsDateStyle() {
|
|
2297
2303
|
try {
|
|
@@ -2330,7 +2336,12 @@
|
|
|
2330
2336
|
return Intl.DateTimeFormat.supportedLocalesOf(locales).length === locales.length;
|
|
2331
2337
|
}
|
|
2332
2338
|
function shouldPolyfill(locale) {
|
|
2333
|
-
|
|
2339
|
+
if (locale === void 0) {
|
|
2340
|
+
locale = "en";
|
|
2341
|
+
}
|
|
2342
|
+
if (!("DateTimeFormat" in Intl) || !("formatToParts" in Intl.DateTimeFormat.prototype) || !("formatRange" in Intl.DateTimeFormat.prototype) || hasChromeLt71Bug() || hasUnthrownDateTimeStyleBug() || !supportsDateStyle() || !supportedLocalesOf2(locale)) {
|
|
2343
|
+
return locale ? (0, import_intl_localematcher4.match)([locale], supportedLocales, "en") : void 0;
|
|
2344
|
+
}
|
|
2334
2345
|
}
|
|
2335
2346
|
|
|
2336
2347
|
// bazel-out/darwin-fastbuild/bin/packages/intl-datetimeformat/lib/src/to_locale_string.js
|
|
@@ -2349,7 +2360,7 @@
|
|
|
2349
2360
|
|
|
2350
2361
|
// bazel-out/darwin-fastbuild/bin/packages/intl-datetimeformat/lib/polyfill.js
|
|
2351
2362
|
if (shouldPolyfill()) {
|
|
2352
|
-
defineProperty(Intl, "DateTimeFormat", {value: DateTimeFormat});
|
|
2363
|
+
defineProperty(Intl, "DateTimeFormat", { value: DateTimeFormat });
|
|
2353
2364
|
defineProperty(Date.prototype, "toLocaleString", {
|
|
2354
2365
|
value: function toLocaleString2(locales, options) {
|
|
2355
2366
|
return toLocaleString(this, locales, options);
|
package/polyfill.js
CHANGED
|
@@ -4,21 +4,21 @@ var _1 = require("./");
|
|
|
4
4
|
var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
5
5
|
var should_polyfill_1 = require("./should-polyfill");
|
|
6
6
|
var to_locale_string_1 = require("./src/to_locale_string");
|
|
7
|
-
if (should_polyfill_1.shouldPolyfill()) {
|
|
8
|
-
ecma402_abstract_1.defineProperty(Intl, 'DateTimeFormat', { value: _1.DateTimeFormat });
|
|
9
|
-
ecma402_abstract_1.defineProperty(Date.prototype, 'toLocaleString', {
|
|
7
|
+
if ((0, should_polyfill_1.shouldPolyfill)()) {
|
|
8
|
+
(0, ecma402_abstract_1.defineProperty)(Intl, 'DateTimeFormat', { value: _1.DateTimeFormat });
|
|
9
|
+
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleString', {
|
|
10
10
|
value: function toLocaleString(locales, options) {
|
|
11
|
-
return to_locale_string_1.toLocaleString(this, locales, options);
|
|
11
|
+
return (0, to_locale_string_1.toLocaleString)(this, locales, options);
|
|
12
12
|
},
|
|
13
13
|
});
|
|
14
|
-
ecma402_abstract_1.defineProperty(Date.prototype, 'toLocaleDateString', {
|
|
14
|
+
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleDateString', {
|
|
15
15
|
value: function toLocaleDateString(locales, options) {
|
|
16
|
-
return to_locale_string_1.toLocaleDateString(this, locales, options);
|
|
16
|
+
return (0, to_locale_string_1.toLocaleDateString)(this, locales, options);
|
|
17
17
|
},
|
|
18
18
|
});
|
|
19
|
-
ecma402_abstract_1.defineProperty(Date.prototype, 'toLocaleTimeString', {
|
|
19
|
+
(0, ecma402_abstract_1.defineProperty)(Date.prototype, 'toLocaleTimeString', {
|
|
20
20
|
value: function toLocaleTimeString(locales, options) {
|
|
21
|
-
return to_locale_string_1.toLocaleTimeString(this, locales, options);
|
|
21
|
+
return (0, to_locale_string_1.toLocaleTimeString)(this, locales, options);
|
|
22
22
|
},
|
|
23
23
|
});
|
|
24
24
|
}
|
package/should-polyfill.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function shouldPolyfill(locale?: string |
|
|
1
|
+
export declare function shouldPolyfill(locale?: string): string | undefined;
|
|
2
2
|
//# sourceMappingURL=should-polyfill.d.ts.map
|
package/should-polyfill.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-datetimeformat/should-polyfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-datetimeformat/should-polyfill.ts"],"names":[],"mappings":"AAyDA,wBAAgB,cAAc,CAAC,MAAM,SAAO,GAAG,MAAM,GAAG,SAAS,CAYhE"}
|
package/should-polyfill.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.shouldPolyfill = void 0;
|
|
4
|
+
var intl_localematcher_1 = require("@formatjs/intl-localematcher");
|
|
5
|
+
var supported_locales_1 = require("./supported-locales");
|
|
4
6
|
function supportsDateStyle() {
|
|
5
7
|
try {
|
|
6
8
|
return !!new Intl.DateTimeFormat(undefined, {
|
|
@@ -49,12 +51,15 @@ function supportedLocalesOf(locale) {
|
|
|
49
51
|
return (Intl.DateTimeFormat.supportedLocalesOf(locales).length === locales.length);
|
|
50
52
|
}
|
|
51
53
|
function shouldPolyfill(locale) {
|
|
52
|
-
|
|
54
|
+
if (locale === void 0) { locale = 'en'; }
|
|
55
|
+
if (!('DateTimeFormat' in Intl) ||
|
|
53
56
|
!('formatToParts' in Intl.DateTimeFormat.prototype) ||
|
|
54
57
|
!('formatRange' in Intl.DateTimeFormat.prototype) ||
|
|
55
58
|
hasChromeLt71Bug() ||
|
|
56
59
|
hasUnthrownDateTimeStyleBug() ||
|
|
57
60
|
!supportsDateStyle() ||
|
|
58
|
-
!supportedLocalesOf(locale))
|
|
61
|
+
!supportedLocalesOf(locale)) {
|
|
62
|
+
return locale ? (0, intl_localematcher_1.match)([locale], supported_locales_1.supportedLocales, 'en') : undefined;
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
65
|
exports.shouldPolyfill = shouldPolyfill;
|
|
@@ -12,7 +12,7 @@ var utils_1 = require("./utils");
|
|
|
12
12
|
function BasicFormatMatcher(options, formats) {
|
|
13
13
|
var bestScore = -Infinity;
|
|
14
14
|
var bestFormat = formats[0];
|
|
15
|
-
ecma402_abstract_1.invariant(Array.isArray(formats), 'formats should be a list of things');
|
|
15
|
+
(0, ecma402_abstract_1.invariant)(Array.isArray(formats), 'formats should be a list of things');
|
|
16
16
|
for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {
|
|
17
17
|
var format = formats_1[_i];
|
|
18
18
|
var score = 0;
|
|
@@ -56,6 +56,6 @@ function BasicFormatMatcher(options, formats) {
|
|
|
56
56
|
bestFormat = format;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
return tslib_1.__assign({}, bestFormat);
|
|
59
|
+
return (0, tslib_1.__assign)({}, bestFormat);
|
|
60
60
|
}
|
|
61
61
|
exports.BasicFormatMatcher = BasicFormatMatcher;
|
|
@@ -71,7 +71,7 @@ exports.bestFitFormatMatcherScore = bestFitFormatMatcherScore;
|
|
|
71
71
|
function BestFitFormatMatcher(options, formats) {
|
|
72
72
|
var bestScore = -Infinity;
|
|
73
73
|
var bestFormat = formats[0];
|
|
74
|
-
ecma402_abstract_1.invariant(Array.isArray(formats), 'formats should be a list of things');
|
|
74
|
+
(0, ecma402_abstract_1.invariant)(Array.isArray(formats), 'formats should be a list of things');
|
|
75
75
|
for (var _i = 0, formats_1 = formats; _i < formats_1.length; _i++) {
|
|
76
76
|
var format = formats_1[_i];
|
|
77
77
|
var score = bestFitFormatMatcherScore(options, format);
|
|
@@ -80,9 +80,9 @@ function BestFitFormatMatcher(options, formats) {
|
|
|
80
80
|
bestFormat = format;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
var skeletonFormat = tslib_1.__assign({}, bestFormat);
|
|
83
|
+
var skeletonFormat = (0, tslib_1.__assign)({}, bestFormat);
|
|
84
84
|
var patternFormat = { rawPattern: bestFormat.rawPattern };
|
|
85
|
-
skeleton_1.processDateTimePattern(bestFormat.rawPattern, patternFormat);
|
|
85
|
+
(0, skeleton_1.processDateTimePattern)(bestFormat.rawPattern, patternFormat);
|
|
86
86
|
// Kinda following https://github.com/unicode-org/icu/blob/dd50e38f459d84e9bf1b0c618be8483d318458ad/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java
|
|
87
87
|
// Method adjustFieldTypes
|
|
88
88
|
for (var prop in skeletonFormat) {
|
|
@@ -5,14 +5,14 @@ var ecma402_abstract_1 = require("@formatjs/ecma402-abstract");
|
|
|
5
5
|
function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
|
|
6
6
|
var dateFormat, timeFormat;
|
|
7
7
|
if (timeStyle !== undefined) {
|
|
8
|
-
ecma402_abstract_1.invariant(timeStyle === 'full' ||
|
|
8
|
+
(0, ecma402_abstract_1.invariant)(timeStyle === 'full' ||
|
|
9
9
|
timeStyle === 'long' ||
|
|
10
10
|
timeStyle === 'medium' ||
|
|
11
11
|
timeStyle === 'short', 'invalid timeStyle');
|
|
12
12
|
timeFormat = dataLocaleData.timeFormat[timeStyle];
|
|
13
13
|
}
|
|
14
14
|
if (dateStyle !== undefined) {
|
|
15
|
-
ecma402_abstract_1.invariant(dateStyle === 'full' ||
|
|
15
|
+
(0, ecma402_abstract_1.invariant)(dateStyle === 'full' ||
|
|
16
16
|
dateStyle === 'long' ||
|
|
17
17
|
dateStyle === 'medium' ||
|
|
18
18
|
dateStyle === 'short', 'invalid dateStyle');
|
|
@@ -48,7 +48,7 @@ function DateTimeStyleFormat(dateStyle, timeStyle, dataLocaleData) {
|
|
|
48
48
|
if (timeStyle !== undefined) {
|
|
49
49
|
return timeFormat;
|
|
50
50
|
}
|
|
51
|
-
ecma402_abstract_1.invariant(dateStyle !== undefined, 'dateStyle should not be undefined');
|
|
51
|
+
(0, ecma402_abstract_1.invariant)(dateStyle !== undefined, 'dateStyle should not be undefined');
|
|
52
52
|
return dateFormat;
|
|
53
53
|
}
|
|
54
54
|
exports.DateTimeStyleFormat = DateTimeStyleFormat;
|
|
@@ -8,7 +8,7 @@ var PartitionDateTimePattern_1 = require("./PartitionDateTimePattern");
|
|
|
8
8
|
* @param x
|
|
9
9
|
*/
|
|
10
10
|
function FormatDateTime(dtf, x, implDetails) {
|
|
11
|
-
var parts = PartitionDateTimePattern_1.PartitionDateTimePattern(dtf, x, implDetails);
|
|
11
|
+
var parts = (0, PartitionDateTimePattern_1.PartitionDateTimePattern)(dtf, x, implDetails);
|
|
12
12
|
var result = '';
|
|
13
13
|
for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
|
|
14
14
|
var part = parts_1[_i];
|