react-intl 8.0.6 → 8.0.7
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/package.json +5 -5
- package/react-intl.iife.js +78 -165
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intl",
|
|
3
3
|
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.7",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"author": "Eric Ferraiuolo <edf@ericf.me>",
|
|
7
7
|
"type": "module",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
15
15
|
"hoist-non-react-statics": "^3.3.2",
|
|
16
16
|
"tslib": "^2.8.0",
|
|
17
|
-
"@formatjs/
|
|
18
|
-
"@formatjs/
|
|
19
|
-
"@formatjs/
|
|
20
|
-
"intl-messageformat": "11.0.
|
|
17
|
+
"@formatjs/icu-messageformat-parser": "3.1.0",
|
|
18
|
+
"@formatjs/intl": "4.0.5",
|
|
19
|
+
"@formatjs/ecma402-abstract": "3.0.4",
|
|
20
|
+
"intl-messageformat": "11.0.5"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@types/react": "19",
|
package/react-intl.iife.js
CHANGED
|
@@ -703,8 +703,8 @@ var ReactIntl = (() => {
|
|
|
703
703
|
throw new Error("Invalid number skeleton");
|
|
704
704
|
}
|
|
705
705
|
var stem = stemAndOptions[0], options = stemAndOptions.slice(1);
|
|
706
|
-
for (var
|
|
707
|
-
var option = options_1[
|
|
706
|
+
for (var _a2 = 0, options_1 = options; _a2 < options_1.length; _a2++) {
|
|
707
|
+
var option = options_1[_a2];
|
|
708
708
|
if (option.length === 0) {
|
|
709
709
|
throw new Error("Invalid number skeleton");
|
|
710
710
|
}
|
|
@@ -2454,61 +2454,14 @@ var ReactIntl = (() => {
|
|
|
2454
2454
|
}
|
|
2455
2455
|
|
|
2456
2456
|
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/parser.js
|
|
2457
|
-
var _a;
|
|
2458
2457
|
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
|
|
2459
2458
|
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
2460
2459
|
function createLocation(start, end) {
|
|
2461
2460
|
return { start, end };
|
|
2462
2461
|
}
|
|
2463
|
-
var hasNativeStartsWith = !!String.prototype.startsWith && "_a".startsWith("a", 1);
|
|
2464
|
-
var hasNativeFromCodePoint = !!String.fromCodePoint;
|
|
2465
2462
|
var hasNativeFromEntries = !!Object.fromEntries;
|
|
2466
|
-
var hasNativeCodePointAt = !!String.prototype.codePointAt;
|
|
2467
2463
|
var hasTrimStart = !!String.prototype.trimStart;
|
|
2468
2464
|
var hasTrimEnd = !!String.prototype.trimEnd;
|
|
2469
|
-
var hasNativeIsSafeInteger = !!Number.isSafeInteger;
|
|
2470
|
-
var isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(n) {
|
|
2471
|
-
return typeof n === "number" && isFinite(n) && Math.floor(n) === n && Math.abs(n) <= 9007199254740991;
|
|
2472
|
-
};
|
|
2473
|
-
var REGEX_SUPPORTS_U_AND_Y = true;
|
|
2474
|
-
try {
|
|
2475
|
-
re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
2476
|
-
REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a";
|
|
2477
|
-
} catch (_b) {
|
|
2478
|
-
REGEX_SUPPORTS_U_AND_Y = false;
|
|
2479
|
-
}
|
|
2480
|
-
var re;
|
|
2481
|
-
var startsWith = hasNativeStartsWith ? (
|
|
2482
|
-
// Native
|
|
2483
|
-
function startsWith2(s, search, position) {
|
|
2484
|
-
return s.startsWith(search, position);
|
|
2485
|
-
}
|
|
2486
|
-
) : (
|
|
2487
|
-
// For IE11
|
|
2488
|
-
function startsWith3(s, search, position) {
|
|
2489
|
-
return s.slice(position, position + search.length) === search;
|
|
2490
|
-
}
|
|
2491
|
-
);
|
|
2492
|
-
var fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : (
|
|
2493
|
-
// IE11
|
|
2494
|
-
function fromCodePoint2() {
|
|
2495
|
-
var codePoints = [];
|
|
2496
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2497
|
-
codePoints[_i] = arguments[_i];
|
|
2498
|
-
}
|
|
2499
|
-
var elements = "";
|
|
2500
|
-
var length = codePoints.length;
|
|
2501
|
-
var i = 0;
|
|
2502
|
-
var code;
|
|
2503
|
-
while (length > i) {
|
|
2504
|
-
code = codePoints[i++];
|
|
2505
|
-
if (code > 1114111)
|
|
2506
|
-
throw RangeError(code + " is not a valid code point");
|
|
2507
|
-
elements += code < 65536 ? String.fromCharCode(code) : String.fromCharCode(((code -= 65536) >> 10) + 55296, code % 1024 + 56320);
|
|
2508
|
-
}
|
|
2509
|
-
return elements;
|
|
2510
|
-
}
|
|
2511
|
-
);
|
|
2512
2465
|
var fromEntries = (
|
|
2513
2466
|
// native
|
|
2514
2467
|
hasNativeFromEntries ? Object.fromEntries : (
|
|
@@ -2516,30 +2469,13 @@ var ReactIntl = (() => {
|
|
|
2516
2469
|
function fromEntries2(entries) {
|
|
2517
2470
|
var obj = {};
|
|
2518
2471
|
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
2519
|
-
var
|
|
2472
|
+
var _a2 = entries_1[_i], k = _a2[0], v = _a2[1];
|
|
2520
2473
|
obj[k] = v;
|
|
2521
2474
|
}
|
|
2522
2475
|
return obj;
|
|
2523
2476
|
}
|
|
2524
2477
|
)
|
|
2525
2478
|
);
|
|
2526
|
-
var codePointAt = hasNativeCodePointAt ? (
|
|
2527
|
-
// Native
|
|
2528
|
-
function codePointAt2(s, index) {
|
|
2529
|
-
return s.codePointAt(index);
|
|
2530
|
-
}
|
|
2531
|
-
) : (
|
|
2532
|
-
// IE 11
|
|
2533
|
-
function codePointAt3(s, index) {
|
|
2534
|
-
var size = s.length;
|
|
2535
|
-
if (index < 0 || index >= size) {
|
|
2536
|
-
return void 0;
|
|
2537
|
-
}
|
|
2538
|
-
var first = s.charCodeAt(index);
|
|
2539
|
-
var second;
|
|
2540
|
-
return first < 55296 || first > 56319 || index + 1 === size || (second = s.charCodeAt(index + 1)) < 56320 || second > 57343 ? first : (first - 55296 << 10) + (second - 56320) + 65536;
|
|
2541
|
-
}
|
|
2542
|
-
);
|
|
2543
2479
|
var trimStart = hasTrimStart ? (
|
|
2544
2480
|
// Native
|
|
2545
2481
|
function trimStart2(s) {
|
|
@@ -2562,33 +2498,13 @@ var ReactIntl = (() => {
|
|
|
2562
2498
|
return s.replace(SPACE_SEPARATOR_END_REGEX, "");
|
|
2563
2499
|
}
|
|
2564
2500
|
);
|
|
2565
|
-
|
|
2566
|
-
|
|
2501
|
+
var IDENTIFIER_PREFIX_RE = new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
2502
|
+
function matchIdentifierAtIndex(s, index) {
|
|
2503
|
+
var _a2;
|
|
2504
|
+
IDENTIFIER_PREFIX_RE.lastIndex = index;
|
|
2505
|
+
var match = IDENTIFIER_PREFIX_RE.exec(s);
|
|
2506
|
+
return (_a2 = match[1]) !== null && _a2 !== void 0 ? _a2 : "";
|
|
2567
2507
|
}
|
|
2568
|
-
var matchIdentifierAtIndex;
|
|
2569
|
-
if (REGEX_SUPPORTS_U_AND_Y) {
|
|
2570
|
-
IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
2571
|
-
matchIdentifierAtIndex = function matchIdentifierAtIndex2(s, index) {
|
|
2572
|
-
var _a3;
|
|
2573
|
-
IDENTIFIER_PREFIX_RE_1.lastIndex = index;
|
|
2574
|
-
var match = IDENTIFIER_PREFIX_RE_1.exec(s);
|
|
2575
|
-
return (_a3 = match[1]) !== null && _a3 !== void 0 ? _a3 : "";
|
|
2576
|
-
};
|
|
2577
|
-
} else {
|
|
2578
|
-
matchIdentifierAtIndex = function matchIdentifierAtIndex2(s, index) {
|
|
2579
|
-
var match = [];
|
|
2580
|
-
while (true) {
|
|
2581
|
-
var c = codePointAt(s, index);
|
|
2582
|
-
if (c === void 0 || _isWhiteSpace(c) || _isPatternSyntax(c)) {
|
|
2583
|
-
break;
|
|
2584
|
-
}
|
|
2585
|
-
match.push(c);
|
|
2586
|
-
index += c >= 65536 ? 2 : 1;
|
|
2587
|
-
}
|
|
2588
|
-
return fromCodePoint.apply(void 0, match);
|
|
2589
|
-
};
|
|
2590
|
-
}
|
|
2591
|
-
var IDENTIFIER_PREFIX_RE_1;
|
|
2592
2508
|
var Parser = (
|
|
2593
2509
|
/** @class */
|
|
2594
2510
|
function() {
|
|
@@ -2783,7 +2699,7 @@ var ReactIntl = (() => {
|
|
|
2783
2699
|
}
|
|
2784
2700
|
this.bump();
|
|
2785
2701
|
}
|
|
2786
|
-
return fromCodePoint.apply(
|
|
2702
|
+
return String.fromCodePoint.apply(String, codePoints);
|
|
2787
2703
|
};
|
|
2788
2704
|
Parser2.prototype.tryParseUnquoted = function(nestingLevel, parentArgType) {
|
|
2789
2705
|
if (this.isEOF()) {
|
|
@@ -2794,7 +2710,7 @@ var ReactIntl = (() => {
|
|
|
2794
2710
|
return null;
|
|
2795
2711
|
} else {
|
|
2796
2712
|
this.bump();
|
|
2797
|
-
return fromCodePoint(ch);
|
|
2713
|
+
return String.fromCodePoint(ch);
|
|
2798
2714
|
}
|
|
2799
2715
|
};
|
|
2800
2716
|
Parser2.prototype.parseArgument = function(nestingLevel, expectingCloseTag) {
|
|
@@ -2852,7 +2768,7 @@ var ReactIntl = (() => {
|
|
|
2852
2768
|
return { value, location };
|
|
2853
2769
|
};
|
|
2854
2770
|
Parser2.prototype.parseArgumentOptions = function(nestingLevel, expectingCloseTag, value, openingBracePosition) {
|
|
2855
|
-
var
|
|
2771
|
+
var _a2;
|
|
2856
2772
|
var typeStartPosition = this.clonePosition();
|
|
2857
2773
|
var argType = this.parseIdentifierIfPossible().value;
|
|
2858
2774
|
var typeEndPosition = this.clonePosition();
|
|
@@ -2883,7 +2799,7 @@ var ReactIntl = (() => {
|
|
|
2883
2799
|
return argCloseResult;
|
|
2884
2800
|
}
|
|
2885
2801
|
var location_1 = createLocation(openingBracePosition, this.clonePosition());
|
|
2886
|
-
if (styleAndLocation &&
|
|
2802
|
+
if (styleAndLocation && styleAndLocation.style.startsWith("::")) {
|
|
2887
2803
|
var skeleton = trimStart(styleAndLocation.style.slice(2));
|
|
2888
2804
|
if (argType === "number") {
|
|
2889
2805
|
var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
|
|
@@ -2920,7 +2836,7 @@ var ReactIntl = (() => {
|
|
|
2920
2836
|
type: argType === "number" ? TYPE.number : argType === "date" ? TYPE.date : TYPE.time,
|
|
2921
2837
|
value,
|
|
2922
2838
|
location: location_1,
|
|
2923
|
-
style: (
|
|
2839
|
+
style: (_a2 = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a2 !== void 0 ? _a2 : null
|
|
2924
2840
|
},
|
|
2925
2841
|
err: null
|
|
2926
2842
|
};
|
|
@@ -3038,7 +2954,7 @@ var ReactIntl = (() => {
|
|
|
3038
2954
|
var tokens = [];
|
|
3039
2955
|
try {
|
|
3040
2956
|
tokens = parseNumberSkeletonFromString(skeleton);
|
|
3041
|
-
} catch (
|
|
2957
|
+
} catch (_a2) {
|
|
3042
2958
|
return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);
|
|
3043
2959
|
}
|
|
3044
2960
|
return {
|
|
@@ -3052,7 +2968,7 @@ var ReactIntl = (() => {
|
|
|
3052
2968
|
};
|
|
3053
2969
|
};
|
|
3054
2970
|
Parser2.prototype.tryParsePluralOrSelectOptions = function(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
|
|
3055
|
-
var
|
|
2971
|
+
var _a2;
|
|
3056
2972
|
var hasOtherClause = false;
|
|
3057
2973
|
var options = [];
|
|
3058
2974
|
var parsedSelectors = /* @__PURE__ */ new Set();
|
|
@@ -3099,7 +3015,7 @@ var ReactIntl = (() => {
|
|
|
3099
3015
|
]);
|
|
3100
3016
|
parsedSelectors.add(selector);
|
|
3101
3017
|
this.bumpSpace();
|
|
3102
|
-
|
|
3018
|
+
_a2 = this.parseIdentifierIfPossible(), selector = _a2.value, selectorLocation = _a2.location;
|
|
3103
3019
|
}
|
|
3104
3020
|
if (options.length === 0) {
|
|
3105
3021
|
return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));
|
|
@@ -3133,7 +3049,7 @@ var ReactIntl = (() => {
|
|
|
3133
3049
|
return this.error(expectNumberError, location);
|
|
3134
3050
|
}
|
|
3135
3051
|
decimal *= sign;
|
|
3136
|
-
if (!isSafeInteger(decimal)) {
|
|
3052
|
+
if (!Number.isSafeInteger(decimal)) {
|
|
3137
3053
|
return this.error(invalidNumberError, location);
|
|
3138
3054
|
}
|
|
3139
3055
|
return { val: decimal, err: null };
|
|
@@ -3156,7 +3072,7 @@ var ReactIntl = (() => {
|
|
|
3156
3072
|
if (offset >= this.message.length) {
|
|
3157
3073
|
throw Error("out of bound");
|
|
3158
3074
|
}
|
|
3159
|
-
var code =
|
|
3075
|
+
var code = this.message.codePointAt(offset);
|
|
3160
3076
|
if (code === void 0) {
|
|
3161
3077
|
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
|
|
3162
3078
|
}
|
|
@@ -3187,7 +3103,7 @@ var ReactIntl = (() => {
|
|
|
3187
3103
|
}
|
|
3188
3104
|
};
|
|
3189
3105
|
Parser2.prototype.bumpIf = function(prefix) {
|
|
3190
|
-
if (
|
|
3106
|
+
if (this.message.startsWith(prefix, this.offset())) {
|
|
3191
3107
|
for (var i = 0; i < prefix.length; i++) {
|
|
3192
3108
|
this.bump();
|
|
3193
3109
|
}
|
|
@@ -3254,9 +3170,6 @@ var ReactIntl = (() => {
|
|
|
3254
3170
|
function _isWhiteSpace(c) {
|
|
3255
3171
|
return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233;
|
|
3256
3172
|
}
|
|
3257
|
-
function _isPatternSyntax(c) {
|
|
3258
|
-
return c >= 33 && c <= 35 || c === 36 || c >= 37 && c <= 39 || c === 40 || c === 41 || c === 42 || c === 43 || c === 44 || c === 45 || c >= 46 && c <= 47 || c >= 58 && c <= 59 || c >= 60 && c <= 62 || c >= 63 && c <= 64 || c === 91 || c === 92 || c === 93 || c === 94 || c === 96 || c === 123 || c === 124 || c === 125 || c === 126 || c === 161 || c >= 162 && c <= 165 || c === 166 || c === 167 || c === 169 || c === 171 || c === 172 || c === 174 || c === 176 || c === 177 || c === 182 || c === 187 || c === 191 || c === 215 || c === 247 || c >= 8208 && c <= 8213 || c >= 8214 && c <= 8215 || c === 8216 || c === 8217 || c === 8218 || c >= 8219 && c <= 8220 || c === 8221 || c === 8222 || c === 8223 || c >= 8224 && c <= 8231 || c >= 8240 && c <= 8248 || c === 8249 || c === 8250 || c >= 8251 && c <= 8254 || c >= 8257 && c <= 8259 || c === 8260 || c === 8261 || c === 8262 || c >= 8263 && c <= 8273 || c === 8274 || c === 8275 || c >= 8277 && c <= 8286 || c >= 8592 && c <= 8596 || c >= 8597 && c <= 8601 || c >= 8602 && c <= 8603 || c >= 8604 && c <= 8607 || c === 8608 || c >= 8609 && c <= 8610 || c === 8611 || c >= 8612 && c <= 8613 || c === 8614 || c >= 8615 && c <= 8621 || c === 8622 || c >= 8623 && c <= 8653 || c >= 8654 && c <= 8655 || c >= 8656 && c <= 8657 || c === 8658 || c === 8659 || c === 8660 || c >= 8661 && c <= 8691 || c >= 8692 && c <= 8959 || c >= 8960 && c <= 8967 || c === 8968 || c === 8969 || c === 8970 || c === 8971 || c >= 8972 && c <= 8991 || c >= 8992 && c <= 8993 || c >= 8994 && c <= 9e3 || c === 9001 || c === 9002 || c >= 9003 && c <= 9083 || c === 9084 || c >= 9085 && c <= 9114 || c >= 9115 && c <= 9139 || c >= 9140 && c <= 9179 || c >= 9180 && c <= 9185 || c >= 9186 && c <= 9254 || c >= 9255 && c <= 9279 || c >= 9280 && c <= 9290 || c >= 9291 && c <= 9311 || c >= 9472 && c <= 9654 || c === 9655 || c >= 9656 && c <= 9664 || c === 9665 || c >= 9666 && c <= 9719 || c >= 9720 && c <= 9727 || c >= 9728 && c <= 9838 || c === 9839 || c >= 9840 && c <= 10087 || c === 10088 || c === 10089 || c === 10090 || c === 10091 || c === 10092 || c === 10093 || c === 10094 || c === 10095 || c === 10096 || c === 10097 || c === 10098 || c === 10099 || c === 10100 || c === 10101 || c >= 10132 && c <= 10175 || c >= 10176 && c <= 10180 || c === 10181 || c === 10182 || c >= 10183 && c <= 10213 || c === 10214 || c === 10215 || c === 10216 || c === 10217 || c === 10218 || c === 10219 || c === 10220 || c === 10221 || c === 10222 || c === 10223 || c >= 10224 && c <= 10239 || c >= 10240 && c <= 10495 || c >= 10496 && c <= 10626 || c === 10627 || c === 10628 || c === 10629 || c === 10630 || c === 10631 || c === 10632 || c === 10633 || c === 10634 || c === 10635 || c === 10636 || c === 10637 || c === 10638 || c === 10639 || c === 10640 || c === 10641 || c === 10642 || c === 10643 || c === 10644 || c === 10645 || c === 10646 || c === 10647 || c === 10648 || c >= 10649 && c <= 10711 || c === 10712 || c === 10713 || c === 10714 || c === 10715 || c >= 10716 && c <= 10747 || c === 10748 || c === 10749 || c >= 10750 && c <= 11007 || c >= 11008 && c <= 11055 || c >= 11056 && c <= 11076 || c >= 11077 && c <= 11078 || c >= 11079 && c <= 11084 || c >= 11085 && c <= 11123 || c >= 11124 && c <= 11125 || c >= 11126 && c <= 11157 || c === 11158 || c >= 11159 && c <= 11263 || c >= 11776 && c <= 11777 || c === 11778 || c === 11779 || c === 11780 || c === 11781 || c >= 11782 && c <= 11784 || c === 11785 || c === 11786 || c === 11787 || c === 11788 || c === 11789 || c >= 11790 && c <= 11798 || c === 11799 || c >= 11800 && c <= 11801 || c === 11802 || c === 11803 || c === 11804 || c === 11805 || c >= 11806 && c <= 11807 || c === 11808 || c === 11809 || c === 11810 || c === 11811 || c === 11812 || c === 11813 || c === 11814 || c === 11815 || c === 11816 || c === 11817 || c >= 11818 && c <= 11822 || c === 11823 || c >= 11824 && c <= 11833 || c >= 11834 && c <= 11835 || c >= 11836 && c <= 11839 || c === 11840 || c === 11841 || c === 11842 || c >= 11843 && c <= 11855 || c >= 11856 && c <= 11857 || c === 11858 || c >= 11859 && c <= 11903 || c >= 12289 && c <= 12291 || c === 12296 || c === 12297 || c === 12298 || c === 12299 || c === 12300 || c === 12301 || c === 12302 || c === 12303 || c === 12304 || c === 12305 || c >= 12306 && c <= 12307 || c === 12308 || c === 12309 || c === 12310 || c === 12311 || c === 12312 || c === 12313 || c === 12314 || c === 12315 || c === 12316 || c === 12317 || c >= 12318 && c <= 12319 || c === 12320 || c === 12336 || c === 64830 || c === 64831 || c >= 65093 && c <= 65094;
|
|
3259
|
-
}
|
|
3260
3173
|
|
|
3261
3174
|
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/index.js
|
|
3262
3175
|
function pruneLocation(els) {
|
|
@@ -3531,34 +3444,34 @@ var ReactIntl = (() => {
|
|
|
3531
3444
|
}
|
|
3532
3445
|
return {
|
|
3533
3446
|
getNumberFormat: memoize(function() {
|
|
3534
|
-
var
|
|
3447
|
+
var _a2;
|
|
3535
3448
|
var args = [];
|
|
3536
3449
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3537
3450
|
args[_i] = arguments[_i];
|
|
3538
3451
|
}
|
|
3539
|
-
return new ((
|
|
3452
|
+
return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3540
3453
|
}, {
|
|
3541
3454
|
cache: createFastMemoizeCache(cache.number),
|
|
3542
3455
|
strategy: strategies.variadic
|
|
3543
3456
|
}),
|
|
3544
3457
|
getDateTimeFormat: memoize(function() {
|
|
3545
|
-
var
|
|
3458
|
+
var _a2;
|
|
3546
3459
|
var args = [];
|
|
3547
3460
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3548
3461
|
args[_i] = arguments[_i];
|
|
3549
3462
|
}
|
|
3550
|
-
return new ((
|
|
3463
|
+
return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3551
3464
|
}, {
|
|
3552
3465
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
3553
3466
|
strategy: strategies.variadic
|
|
3554
3467
|
}),
|
|
3555
3468
|
getPluralRules: memoize(function() {
|
|
3556
|
-
var
|
|
3469
|
+
var _a2;
|
|
3557
3470
|
var args = [];
|
|
3558
3471
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3559
3472
|
args[_i] = arguments[_i];
|
|
3560
3473
|
}
|
|
3561
|
-
return new ((
|
|
3474
|
+
return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3562
3475
|
}, {
|
|
3563
3476
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
3564
3477
|
strategy: strategies.variadic
|
|
@@ -3600,9 +3513,9 @@ var ReactIntl = (() => {
|
|
|
3600
3513
|
return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, void 0, _this.message);
|
|
3601
3514
|
};
|
|
3602
3515
|
this.resolvedOptions = function() {
|
|
3603
|
-
var
|
|
3516
|
+
var _a2;
|
|
3604
3517
|
return {
|
|
3605
|
-
locale: ((
|
|
3518
|
+
locale: ((_a2 = _this.resolvedLocale) === null || _a2 === void 0 ? void 0 : _a2.toString()) || Intl.NumberFormat.supportedLocalesOf(_this.locales)[0]
|
|
3606
3519
|
};
|
|
3607
3520
|
};
|
|
3608
3521
|
this.getAst = function() {
|
|
@@ -3801,8 +3714,8 @@ var ReactIntl = (() => {
|
|
|
3801
3714
|
__extends(MissingTranslationError2, _super);
|
|
3802
3715
|
function MissingTranslationError2(descriptor, locale) {
|
|
3803
3716
|
var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, 'Missing message: "'.concat(descriptor.id, '" for locale "').concat(locale, '", using ').concat(descriptor.defaultMessage ? "default message (".concat(typeof descriptor.defaultMessage === "string" ? descriptor.defaultMessage : descriptor.defaultMessage.map(function(e) {
|
|
3804
|
-
var
|
|
3805
|
-
return (
|
|
3717
|
+
var _a2;
|
|
3718
|
+
return (_a2 = e.value) !== null && _a2 !== void 0 ? _a2 : JSON.stringify(e);
|
|
3806
3719
|
}).join(), ")") : "id", " as fallback.")) || this;
|
|
3807
3720
|
_this.descriptor = descriptor;
|
|
3808
3721
|
return _this;
|
|
@@ -3886,34 +3799,34 @@ var ReactIntl = (() => {
|
|
|
3886
3799
|
var ListFormat = Intl.ListFormat;
|
|
3887
3800
|
var DisplayNames = Intl.DisplayNames;
|
|
3888
3801
|
var getDateTimeFormat = memoize(function() {
|
|
3889
|
-
var
|
|
3802
|
+
var _a2;
|
|
3890
3803
|
var args = [];
|
|
3891
3804
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3892
3805
|
args[_i] = arguments[_i];
|
|
3893
3806
|
}
|
|
3894
|
-
return new ((
|
|
3807
|
+
return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3895
3808
|
}, {
|
|
3896
3809
|
cache: createFastMemoizeCache2(cache.dateTime),
|
|
3897
3810
|
strategy: strategies.variadic
|
|
3898
3811
|
});
|
|
3899
3812
|
var getNumberFormat = memoize(function() {
|
|
3900
|
-
var
|
|
3813
|
+
var _a2;
|
|
3901
3814
|
var args = [];
|
|
3902
3815
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3903
3816
|
args[_i] = arguments[_i];
|
|
3904
3817
|
}
|
|
3905
|
-
return new ((
|
|
3818
|
+
return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3906
3819
|
}, {
|
|
3907
3820
|
cache: createFastMemoizeCache2(cache.number),
|
|
3908
3821
|
strategy: strategies.variadic
|
|
3909
3822
|
});
|
|
3910
3823
|
var getPluralRules = memoize(function() {
|
|
3911
|
-
var
|
|
3824
|
+
var _a2;
|
|
3912
3825
|
var args = [];
|
|
3913
3826
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3914
3827
|
args[_i] = arguments[_i];
|
|
3915
3828
|
}
|
|
3916
|
-
return new ((
|
|
3829
|
+
return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3917
3830
|
}, {
|
|
3918
3831
|
cache: createFastMemoizeCache2(cache.pluralRules),
|
|
3919
3832
|
strategy: strategies.variadic
|
|
@@ -3997,8 +3910,8 @@ var ReactIntl = (() => {
|
|
|
3997
3910
|
var mfFormats = IntlMessageFormat.formats;
|
|
3998
3911
|
return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });
|
|
3999
3912
|
}
|
|
4000
|
-
var formatMessage = function(
|
|
4001
|
-
var locale =
|
|
3913
|
+
var formatMessage = function(_a2, state, messageDescriptor, values, opts) {
|
|
3914
|
+
var locale = _a2.locale, formats = _a2.formats, messages = _a2.messages, defaultLocale = _a2.defaultLocale, defaultFormats = _a2.defaultFormats, fallbackOnEmptyString = _a2.fallbackOnEmptyString, onError = _a2.onError, timeZone = _a2.timeZone, defaultRichTextElements = _a2.defaultRichTextElements;
|
|
4002
3915
|
if (messageDescriptor === void 0) {
|
|
4003
3916
|
messageDescriptor = { id: "" };
|
|
4004
3917
|
}
|
|
@@ -4083,8 +3996,8 @@ var ReactIntl = (() => {
|
|
|
4083
3996
|
"numberingSystem",
|
|
4084
3997
|
"fractionalSecondDigits"
|
|
4085
3998
|
];
|
|
4086
|
-
function getFormatter(
|
|
4087
|
-
var locale =
|
|
3999
|
+
function getFormatter(_a2, type, getDateTimeFormat, options) {
|
|
4000
|
+
var locale = _a2.locale, formats = _a2.formats, onError = _a2.onError, timeZone = _a2.timeZone;
|
|
4088
4001
|
if (options === void 0) {
|
|
4089
4002
|
options = {};
|
|
4090
4003
|
}
|
|
@@ -4097,11 +4010,11 @@ var ReactIntl = (() => {
|
|
|
4097
4010
|
return getDateTimeFormat(locale, filteredOptions);
|
|
4098
4011
|
}
|
|
4099
4012
|
function formatDate(config, getDateTimeFormat) {
|
|
4100
|
-
var
|
|
4013
|
+
var _a2 = [];
|
|
4101
4014
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
4102
|
-
|
|
4015
|
+
_a2[_i - 2] = arguments[_i];
|
|
4103
4016
|
}
|
|
4104
|
-
var value =
|
|
4017
|
+
var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b;
|
|
4105
4018
|
var date = typeof value === "string" ? new Date(value || 0) : value;
|
|
4106
4019
|
try {
|
|
4107
4020
|
return getFormatter(config, "date", getDateTimeFormat, options).format(date);
|
|
@@ -4111,11 +4024,11 @@ var ReactIntl = (() => {
|
|
|
4111
4024
|
return String(date);
|
|
4112
4025
|
}
|
|
4113
4026
|
function formatTime(config, getDateTimeFormat) {
|
|
4114
|
-
var
|
|
4027
|
+
var _a2 = [];
|
|
4115
4028
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
4116
|
-
|
|
4029
|
+
_a2[_i - 2] = arguments[_i];
|
|
4117
4030
|
}
|
|
4118
|
-
var value =
|
|
4031
|
+
var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b;
|
|
4119
4032
|
var date = typeof value === "string" ? new Date(value || 0) : value;
|
|
4120
4033
|
try {
|
|
4121
4034
|
return getFormatter(config, "time", getDateTimeFormat, options).format(date);
|
|
@@ -4125,11 +4038,11 @@ var ReactIntl = (() => {
|
|
|
4125
4038
|
return String(date);
|
|
4126
4039
|
}
|
|
4127
4040
|
function formatDateTimeRange(config, getDateTimeFormat) {
|
|
4128
|
-
var
|
|
4041
|
+
var _a2 = [];
|
|
4129
4042
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
4130
|
-
|
|
4043
|
+
_a2[_i - 2] = arguments[_i];
|
|
4131
4044
|
}
|
|
4132
|
-
var from =
|
|
4045
|
+
var from = _a2[0], to = _a2[1], _b = _a2[2], options = _b === void 0 ? {} : _b;
|
|
4133
4046
|
var fromDate = typeof from === "string" ? new Date(from || 0) : from;
|
|
4134
4047
|
var toDate = typeof to === "string" ? new Date(to || 0) : to;
|
|
4135
4048
|
try {
|
|
@@ -4140,11 +4053,11 @@ var ReactIntl = (() => {
|
|
|
4140
4053
|
return String(fromDate);
|
|
4141
4054
|
}
|
|
4142
4055
|
function formatDateToParts(config, getDateTimeFormat) {
|
|
4143
|
-
var
|
|
4056
|
+
var _a2 = [];
|
|
4144
4057
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
4145
|
-
|
|
4058
|
+
_a2[_i - 2] = arguments[_i];
|
|
4146
4059
|
}
|
|
4147
|
-
var value =
|
|
4060
|
+
var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b;
|
|
4148
4061
|
var date = typeof value === "string" ? new Date(value || 0) : value;
|
|
4149
4062
|
try {
|
|
4150
4063
|
return getFormatter(config, "date", getDateTimeFormat, options).formatToParts(date);
|
|
@@ -4154,11 +4067,11 @@ var ReactIntl = (() => {
|
|
|
4154
4067
|
return [];
|
|
4155
4068
|
}
|
|
4156
4069
|
function formatTimeToParts(config, getDateTimeFormat) {
|
|
4157
|
-
var
|
|
4070
|
+
var _a2 = [];
|
|
4158
4071
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
4159
|
-
|
|
4072
|
+
_a2[_i - 2] = arguments[_i];
|
|
4160
4073
|
}
|
|
4161
|
-
var value =
|
|
4074
|
+
var value = _a2[0], _b = _a2[1], options = _b === void 0 ? {} : _b;
|
|
4162
4075
|
var date = typeof value === "string" ? new Date(value || 0) : value;
|
|
4163
4076
|
try {
|
|
4164
4077
|
return getFormatter(config, "time", getDateTimeFormat, options).formatToParts(date);
|
|
@@ -4175,8 +4088,8 @@ var ReactIntl = (() => {
|
|
|
4175
4088
|
"fallback",
|
|
4176
4089
|
"languageDisplay"
|
|
4177
4090
|
];
|
|
4178
|
-
function formatDisplayName(
|
|
4179
|
-
var locale =
|
|
4091
|
+
function formatDisplayName(_a2, getDisplayNames, value, options) {
|
|
4092
|
+
var locale = _a2.locale, onError = _a2.onError;
|
|
4180
4093
|
var DisplayNames = Intl.DisplayNames;
|
|
4181
4094
|
if (!DisplayNames) {
|
|
4182
4095
|
onError(new FormatError('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n', ErrorCode.MISSING_INTL_API));
|
|
@@ -4215,8 +4128,8 @@ var ReactIntl = (() => {
|
|
|
4215
4128
|
}, []);
|
|
4216
4129
|
return results.length === 1 ? results[0] : results.length === 0 ? "" : results;
|
|
4217
4130
|
}
|
|
4218
|
-
function formatListToParts(
|
|
4219
|
-
var locale =
|
|
4131
|
+
function formatListToParts(_a2, getListFormat, values, options) {
|
|
4132
|
+
var locale = _a2.locale, onError = _a2.onError;
|
|
4220
4133
|
if (options === void 0) {
|
|
4221
4134
|
options = {};
|
|
4222
4135
|
}
|
|
@@ -4246,8 +4159,8 @@ var ReactIntl = (() => {
|
|
|
4246
4159
|
|
|
4247
4160
|
// node_modules/.aspect_rules_js/@formatjs+intl@0.0.0/node_modules/@formatjs/intl/src/plural.js
|
|
4248
4161
|
var PLURAL_FORMAT_OPTIONS = ["type"];
|
|
4249
|
-
function formatPlural(
|
|
4250
|
-
var locale =
|
|
4162
|
+
function formatPlural(_a2, getPluralRules, value, options) {
|
|
4163
|
+
var locale = _a2.locale, onError = _a2.onError;
|
|
4251
4164
|
if (options === void 0) {
|
|
4252
4165
|
options = {};
|
|
4253
4166
|
}
|
|
@@ -4265,8 +4178,8 @@ var ReactIntl = (() => {
|
|
|
4265
4178
|
|
|
4266
4179
|
// node_modules/.aspect_rules_js/@formatjs+intl@0.0.0/node_modules/@formatjs/intl/src/relativeTime.js
|
|
4267
4180
|
var RELATIVE_TIME_FORMAT_OPTIONS = ["numeric", "style"];
|
|
4268
|
-
function getFormatter2(
|
|
4269
|
-
var locale =
|
|
4181
|
+
function getFormatter2(_a2, getRelativeTimeFormat, options) {
|
|
4182
|
+
var locale = _a2.locale, formats = _a2.formats, onError = _a2.onError;
|
|
4270
4183
|
if (options === void 0) {
|
|
4271
4184
|
options = {};
|
|
4272
4185
|
}
|
|
@@ -4321,8 +4234,8 @@ var ReactIntl = (() => {
|
|
|
4321
4234
|
"roundingIncrement",
|
|
4322
4235
|
"roundingMode"
|
|
4323
4236
|
];
|
|
4324
|
-
function getFormatter3(
|
|
4325
|
-
var locale =
|
|
4237
|
+
function getFormatter3(_a2, getNumberFormat, options) {
|
|
4238
|
+
var locale = _a2.locale, formats = _a2.formats, onError = _a2.onError;
|
|
4326
4239
|
if (options === void 0) {
|
|
4327
4240
|
options = {};
|
|
4328
4241
|
}
|
|
@@ -4436,8 +4349,8 @@ var ReactIntl = (() => {
|
|
|
4436
4349
|
// packages/react-intl/src/components/injectIntl.tsx
|
|
4437
4350
|
var hoistNonReactStaticsNs = __toESM(require_hoist_non_react_statics_cjs());
|
|
4438
4351
|
var React2 = __toESM(window.React);
|
|
4439
|
-
var
|
|
4440
|
-
var hoistNonReactStatics = (
|
|
4352
|
+
var _a;
|
|
4353
|
+
var hoistNonReactStatics = (_a = hoistNonReactStaticsNs.default) != null ? _a : hoistNonReactStaticsNs;
|
|
4441
4354
|
function getDisplayName(Component) {
|
|
4442
4355
|
return Component.displayName || Component.name || "Component";
|
|
4443
4356
|
}
|
|
@@ -4502,20 +4415,20 @@ var ReactIntl = (() => {
|
|
|
4502
4415
|
})(DisplayNameParts || {});
|
|
4503
4416
|
var FormattedNumberParts = (props) => {
|
|
4504
4417
|
const intl = useIntl();
|
|
4505
|
-
const
|
|
4418
|
+
const _a2 = props, { value, children } = _a2, formatProps = __objRest(_a2, ["value", "children"]);
|
|
4506
4419
|
return children(intl.formatNumberToParts(value, formatProps));
|
|
4507
4420
|
};
|
|
4508
4421
|
FormattedNumberParts.displayName = "FormattedNumberParts";
|
|
4509
4422
|
var FormattedListParts = (props) => {
|
|
4510
4423
|
const intl = useIntl();
|
|
4511
|
-
const
|
|
4424
|
+
const _a2 = props, { value, children } = _a2, formatProps = __objRest(_a2, ["value", "children"]);
|
|
4512
4425
|
return children(intl.formatListToParts(value, formatProps));
|
|
4513
4426
|
};
|
|
4514
4427
|
FormattedNumberParts.displayName = "FormattedNumberParts";
|
|
4515
4428
|
function createFormattedDateTimePartsComponent(name) {
|
|
4516
4429
|
const ComponentParts = (props) => {
|
|
4517
4430
|
const intl = useIntl();
|
|
4518
|
-
const
|
|
4431
|
+
const _a2 = props, { value, children } = _a2, formatProps = __objRest(_a2, ["value", "children"]);
|
|
4519
4432
|
const date = typeof value === "string" ? new Date(value || 0) : value;
|
|
4520
4433
|
const formattedParts = name === "formatDate" ? intl.formatDateToParts(date, formatProps) : intl.formatTimeToParts(date, formatProps);
|
|
4521
4434
|
return children(formattedParts);
|
|
@@ -4526,7 +4439,7 @@ var ReactIntl = (() => {
|
|
|
4526
4439
|
function createFormattedComponent(name) {
|
|
4527
4440
|
const Component = (props) => {
|
|
4528
4441
|
const intl = useIntl();
|
|
4529
|
-
const
|
|
4442
|
+
const _a2 = props, { value, children } = _a2, formatProps = __objRest(_a2, ["value", "children"]);
|
|
4530
4443
|
const formattedValue = intl[name](value, formatProps);
|
|
4531
4444
|
if (typeof children === "function") {
|
|
4532
4445
|
return children(formattedValue);
|
|
@@ -4563,8 +4476,8 @@ var ReactIntl = (() => {
|
|
|
4563
4476
|
}
|
|
4564
4477
|
return chunks;
|
|
4565
4478
|
};
|
|
4566
|
-
var createIntl2 = (
|
|
4567
|
-
var _b =
|
|
4479
|
+
var createIntl2 = (_a2, cache) => {
|
|
4480
|
+
var _b = _a2, { defaultRichTextElements: rawDefaultRichTextElements } = _b, config = __objRest(_b, ["defaultRichTextElements"]);
|
|
4568
4481
|
const defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(
|
|
4569
4482
|
rawDefaultRichTextElements
|
|
4570
4483
|
);
|
|
@@ -4599,7 +4512,7 @@ var ReactIntl = (() => {
|
|
|
4599
4512
|
var React5 = __toESM(window.React);
|
|
4600
4513
|
var FormattedDateTimeRange = (props) => {
|
|
4601
4514
|
const intl = useIntl();
|
|
4602
|
-
const
|
|
4515
|
+
const _a2 = props, { from, to, children } = _a2, formatProps = __objRest(_a2, ["from", "to", "children"]);
|
|
4603
4516
|
const formattedValue = intl.formatDateTimeRange(from, to, formatProps);
|
|
4604
4517
|
if (typeof children === "function") {
|
|
4605
4518
|
return children(formattedValue);
|
|
@@ -4613,7 +4526,7 @@ var ReactIntl = (() => {
|
|
|
4613
4526
|
// packages/react-intl/src/components/message.tsx
|
|
4614
4527
|
var React6 = __toESM(window.React);
|
|
4615
4528
|
function areEqual(prevProps, nextProps) {
|
|
4616
|
-
const
|
|
4529
|
+
const _a2 = prevProps, { values } = _a2, otherProps = __objRest(_a2, ["values"]);
|
|
4617
4530
|
const _b = nextProps, { values: nextValues } = _b, nextOtherProps = __objRest(_b, ["values"]);
|
|
4618
4531
|
return shallowEqual(nextValues, values) && shallowEqual(otherProps, nextOtherProps);
|
|
4619
4532
|
}
|
|
@@ -4766,7 +4679,7 @@ var ReactIntl = (() => {
|
|
|
4766
4679
|
}
|
|
4767
4680
|
var SimpleFormattedRelativeTime = (props) => {
|
|
4768
4681
|
const { formatRelativeTime: formatRelativeTime2, textComponent: Text } = useIntl();
|
|
4769
|
-
const
|
|
4682
|
+
const _a2 = props, { children, value, unit } = _a2, otherProps = __objRest(_a2, ["children", "value", "unit"]);
|
|
4770
4683
|
const formattedRelativeTime = formatRelativeTime2(value || 0, unit, otherProps);
|
|
4771
4684
|
if (typeof children === "function") {
|
|
4772
4685
|
return children(formattedRelativeTime);
|
|
@@ -4776,8 +4689,8 @@ var ReactIntl = (() => {
|
|
|
4776
4689
|
}
|
|
4777
4690
|
return React9.createElement(React9.Fragment, null, formattedRelativeTime);
|
|
4778
4691
|
};
|
|
4779
|
-
var FormattedRelativeTime = (
|
|
4780
|
-
var _b =
|
|
4692
|
+
var FormattedRelativeTime = (_a2) => {
|
|
4693
|
+
var _b = _a2, {
|
|
4781
4694
|
value = 0,
|
|
4782
4695
|
unit = "second",
|
|
4783
4696
|
updateIntervalInSeconds
|