intl-messageformat 10.5.14 → 10.7.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.
@@ -1,11 +1,71 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
1
+ // node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
2
+ function memoize(fn, options) {
3
+ var cache = options && options.cache ? options.cache : cacheDefault;
4
+ var serializer = options && options.serializer ? options.serializer : serializerDefault;
5
+ var strategy = options && options.strategy ? options.strategy : strategyDefault;
6
+ return strategy(fn, {
7
+ cache,
8
+ serializer
9
+ });
10
+ }
11
+ function isPrimitive(value) {
12
+ return value == null || typeof value === "number" || typeof value === "boolean";
13
+ }
14
+ function monadic(fn, cache, serializer, arg) {
15
+ var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
16
+ var computedValue = cache.get(cacheKey);
17
+ if (typeof computedValue === "undefined") {
18
+ computedValue = fn.call(this, arg);
19
+ cache.set(cacheKey, computedValue);
20
+ }
21
+ return computedValue;
22
+ }
23
+ function variadic(fn, cache, serializer) {
24
+ var args = Array.prototype.slice.call(arguments, 3);
25
+ var cacheKey = serializer(args);
26
+ var computedValue = cache.get(cacheKey);
27
+ if (typeof computedValue === "undefined") {
28
+ computedValue = fn.apply(this, args);
29
+ cache.set(cacheKey, computedValue);
30
+ }
31
+ return computedValue;
32
+ }
33
+ function assemble(fn, context, strategy, cache, serialize) {
34
+ return strategy.bind(context, fn, cache, serialize);
35
+ }
36
+ function strategyDefault(fn, options) {
37
+ var strategy = fn.length === 1 ? monadic : variadic;
38
+ return assemble(fn, this, strategy, options.cache.create(), options.serializer);
39
+ }
40
+ function strategyVariadic(fn, options) {
41
+ return assemble(fn, this, variadic, options.cache.create(), options.serializer);
42
+ }
43
+ function strategyMonadic(fn, options) {
44
+ return assemble(fn, this, monadic, options.cache.create(), options.serializer);
45
+ }
46
+ var serializerDefault = function() {
47
+ return JSON.stringify(arguments);
48
+ };
49
+ function ObjectWithoutPrototypeCache() {
50
+ this.cache = /* @__PURE__ */ Object.create(null);
51
+ }
52
+ ObjectWithoutPrototypeCache.prototype.get = function(key) {
53
+ return this.cache[key];
54
+ };
55
+ ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
56
+ this.cache[key] = value;
57
+ };
58
+ var cacheDefault = {
59
+ create: function create() {
60
+ return new ObjectWithoutPrototypeCache();
61
+ }
62
+ };
63
+ var strategies = {
64
+ variadic: strategyVariadic,
65
+ monadic: strategyMonadic
6
66
  };
7
67
 
8
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/tslib.es6.js
68
+ // node_modules/.aspect_rules_js/tslib@2.7.0/node_modules/tslib/tslib.es6.mjs
9
69
  var __assign = function() {
10
70
  __assign = Object.assign || function __assign2(t) {
11
71
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -19,7 +79,7 @@ var __assign = function() {
19
79
  return __assign.apply(this, arguments);
20
80
  };
21
81
 
22
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/error.js
82
+ // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/error.js
23
83
  var ErrorKind;
24
84
  (function(ErrorKind2) {
25
85
  ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
@@ -50,7 +110,7 @@ var ErrorKind;
50
110
  ErrorKind2[ErrorKind2["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
51
111
  })(ErrorKind || (ErrorKind = {}));
52
112
 
53
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/types.js
113
+ // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/types.js
54
114
  var TYPE;
55
115
  (function(TYPE2) {
56
116
  TYPE2[TYPE2["literal"] = 0] = "literal";
@@ -102,10 +162,10 @@ function isDateTimeSkeleton(el) {
102
162
  return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime);
103
163
  }
104
164
 
105
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js
165
+ // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js
106
166
  var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
107
167
 
108
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js
168
+ // node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js
109
169
  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;
110
170
  function parseDateTimeSkeleton(skeleton) {
111
171
  var result = {};
@@ -206,10 +266,10 @@ function parseDateTimeSkeleton(skeleton) {
206
266
  return result;
207
267
  }
208
268
 
209
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js
269
+ // node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js
210
270
  var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
211
271
 
212
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/number.js
272
+ // node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/number.js
213
273
  function parseNumberSkeletonFromString(skeleton) {
214
274
  if (skeleton.length === 0) {
215
275
  throw new Error("Number skeleton cannot be empty");
@@ -496,7 +556,7 @@ function parseNumberSkeleton(tokens) {
496
556
  return result;
497
557
  }
498
558
 
499
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js
559
+ // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js
500
560
  var timeData = {
501
561
  "001": [
502
562
  "H",
@@ -1907,7 +1967,7 @@ var timeData = {
1907
1967
  ]
1908
1968
  };
1909
1969
 
1910
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js
1970
+ // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js
1911
1971
  function getBestPattern(skeleton, locale) {
1912
1972
  var skeletonCopy = "";
1913
1973
  for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {
@@ -1969,7 +2029,7 @@ function getDefaultHourSymbolFromLocale(locale) {
1969
2029
  return hourCycles[0];
1970
2030
  }
1971
2031
 
1972
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js
2032
+ // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js
1973
2033
  var _a;
1974
2034
  var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
1975
2035
  var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
@@ -2774,7 +2834,7 @@ function _isPatternSyntax(c) {
2774
2834
  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;
2775
2835
  }
2776
2836
 
2777
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/index.js
2837
+ // node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/index.js
2778
2838
  function pruneLocation(els) {
2779
2839
  els.forEach(function(el) {
2780
2840
  delete el.location;
@@ -2810,80 +2870,13 @@ function parse(message, opts) {
2810
2870
  return result.val;
2811
2871
  }
2812
2872
 
2813
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
2814
- function memoize(fn, options) {
2815
- var cache = options && options.cache ? options.cache : cacheDefault;
2816
- var serializer = options && options.serializer ? options.serializer : serializerDefault;
2817
- var strategy = options && options.strategy ? options.strategy : strategyDefault;
2818
- return strategy(fn, {
2819
- cache,
2820
- serializer
2821
- });
2822
- }
2823
- function isPrimitive(value) {
2824
- return value == null || typeof value === "number" || typeof value === "boolean";
2825
- }
2826
- function monadic(fn, cache, serializer, arg) {
2827
- var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
2828
- var computedValue = cache.get(cacheKey);
2829
- if (typeof computedValue === "undefined") {
2830
- computedValue = fn.call(this, arg);
2831
- cache.set(cacheKey, computedValue);
2832
- }
2833
- return computedValue;
2834
- }
2835
- function variadic(fn, cache, serializer) {
2836
- var args = Array.prototype.slice.call(arguments, 3);
2837
- var cacheKey = serializer(args);
2838
- var computedValue = cache.get(cacheKey);
2839
- if (typeof computedValue === "undefined") {
2840
- computedValue = fn.apply(this, args);
2841
- cache.set(cacheKey, computedValue);
2842
- }
2843
- return computedValue;
2844
- }
2845
- function assemble(fn, context, strategy, cache, serialize) {
2846
- return strategy.bind(context, fn, cache, serialize);
2847
- }
2848
- function strategyDefault(fn, options) {
2849
- var strategy = fn.length === 1 ? monadic : variadic;
2850
- return assemble(fn, this, strategy, options.cache.create(), options.serializer);
2851
- }
2852
- function strategyVariadic(fn, options) {
2853
- return assemble(fn, this, variadic, options.cache.create(), options.serializer);
2854
- }
2855
- function strategyMonadic(fn, options) {
2856
- return assemble(fn, this, monadic, options.cache.create(), options.serializer);
2857
- }
2858
- var serializerDefault = function() {
2859
- return JSON.stringify(arguments);
2860
- };
2861
- function ObjectWithoutPrototypeCache() {
2862
- this.cache = /* @__PURE__ */ Object.create(null);
2863
- }
2864
- ObjectWithoutPrototypeCache.prototype.get = function(key) {
2865
- return this.cache[key];
2866
- };
2867
- ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
2868
- this.cache[key] = value;
2869
- };
2870
- var cacheDefault = {
2871
- create: function create() {
2872
- return new ObjectWithoutPrototypeCache();
2873
- }
2874
- };
2875
- var strategies = {
2876
- variadic: strategyVariadic,
2877
- monadic: strategyMonadic
2878
- };
2879
-
2880
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/error.js
2881
- var ErrorCode;
2882
- (function(ErrorCode2) {
2873
+ // packages/intl-messageformat/src/error.ts
2874
+ var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
2883
2875
  ErrorCode2["MISSING_VALUE"] = "MISSING_VALUE";
2884
2876
  ErrorCode2["INVALID_VALUE"] = "INVALID_VALUE";
2885
2877
  ErrorCode2["MISSING_INTL_API"] = "MISSING_INTL_API";
2886
- })(ErrorCode || (ErrorCode = {}));
2878
+ return ErrorCode2;
2879
+ })(ErrorCode || {});
2887
2880
  var FormatError = class extends Error {
2888
2881
  code;
2889
2882
  /**
@@ -2905,33 +2898,47 @@ var FormatError = class extends Error {
2905
2898
  };
2906
2899
  var InvalidValueError = class extends FormatError {
2907
2900
  constructor(variableId, value, options, originalMessage) {
2908
- super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join('", "')}"`, ErrorCode.INVALID_VALUE, originalMessage);
2901
+ super(
2902
+ `Invalid values for "${variableId}": "${value}". Options are "${Object.keys(
2903
+ options
2904
+ ).join('", "')}"`,
2905
+ "INVALID_VALUE" /* INVALID_VALUE */,
2906
+ originalMessage
2907
+ );
2909
2908
  }
2910
2909
  };
2911
2910
  var InvalidValueTypeError = class extends FormatError {
2912
2911
  constructor(value, type, originalMessage) {
2913
- super(`Value for "${value}" must be of type ${type}`, ErrorCode.INVALID_VALUE, originalMessage);
2912
+ super(
2913
+ `Value for "${value}" must be of type ${type}`,
2914
+ "INVALID_VALUE" /* INVALID_VALUE */,
2915
+ originalMessage
2916
+ );
2914
2917
  }
2915
2918
  };
2916
2919
  var MissingValueError = class extends FormatError {
2917
2920
  constructor(variableId, originalMessage) {
2918
- super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, ErrorCode.MISSING_VALUE, originalMessage);
2921
+ super(
2922
+ `The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`,
2923
+ "MISSING_VALUE" /* MISSING_VALUE */,
2924
+ originalMessage
2925
+ );
2919
2926
  }
2920
2927
  };
2921
2928
 
2922
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/formatters.js
2923
- var PART_TYPE;
2924
- (function(PART_TYPE2) {
2929
+ // packages/intl-messageformat/src/formatters.ts
2930
+ var PART_TYPE = /* @__PURE__ */ ((PART_TYPE2) => {
2925
2931
  PART_TYPE2[PART_TYPE2["literal"] = 0] = "literal";
2926
2932
  PART_TYPE2[PART_TYPE2["object"] = 1] = "object";
2927
- })(PART_TYPE || (PART_TYPE = {}));
2933
+ return PART_TYPE2;
2934
+ })(PART_TYPE || {});
2928
2935
  function mergeLiteral(parts) {
2929
2936
  if (parts.length < 2) {
2930
2937
  return parts;
2931
2938
  }
2932
2939
  return parts.reduce((all, part) => {
2933
2940
  const lastPart = all[all.length - 1];
2934
- if (!lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal) {
2941
+ if (!lastPart || lastPart.type !== 0 /* literal */ || part.type !== 0 /* literal */) {
2935
2942
  all.push(part);
2936
2943
  } else {
2937
2944
  lastPart.value += part.value;
@@ -2946,7 +2953,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
2946
2953
  if (els.length === 1 && isLiteralElement(els[0])) {
2947
2954
  return [
2948
2955
  {
2949
- type: PART_TYPE.literal,
2956
+ type: 0 /* literal */,
2950
2957
  value: els[0].value
2951
2958
  }
2952
2959
  ];
@@ -2955,7 +2962,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
2955
2962
  for (const el of els) {
2956
2963
  if (isLiteralElement(el)) {
2957
2964
  result.push({
2958
- type: PART_TYPE.literal,
2965
+ type: 0 /* literal */,
2959
2966
  value: el.value
2960
2967
  });
2961
2968
  continue;
@@ -2963,7 +2970,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
2963
2970
  if (isPoundElement(el)) {
2964
2971
  if (typeof currentPluralValue === "number") {
2965
2972
  result.push({
2966
- type: PART_TYPE.literal,
2973
+ type: 0 /* literal */,
2967
2974
  value: formatters.getNumberFormat(locales).format(currentPluralValue)
2968
2975
  });
2969
2976
  }
@@ -2979,7 +2986,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
2979
2986
  value = typeof value === "string" || typeof value === "number" ? String(value) : "";
2980
2987
  }
2981
2988
  result.push({
2982
- type: typeof value === "string" ? PART_TYPE.literal : PART_TYPE.object,
2989
+ type: typeof value === "string" ? 0 /* literal */ : 1 /* object */,
2983
2990
  value
2984
2991
  });
2985
2992
  continue;
@@ -2987,7 +2994,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
2987
2994
  if (isDateElement(el)) {
2988
2995
  const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
2989
2996
  result.push({
2990
- type: PART_TYPE.literal,
2997
+ type: 0 /* literal */,
2991
2998
  value: formatters.getDateTimeFormat(locales, style).format(value)
2992
2999
  });
2993
3000
  continue;
@@ -2995,7 +3002,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
2995
3002
  if (isTimeElement(el)) {
2996
3003
  const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium;
2997
3004
  result.push({
2998
- type: PART_TYPE.literal,
3005
+ type: 0 /* literal */,
2999
3006
  value: formatters.getDateTimeFormat(locales, style).format(value)
3000
3007
  });
3001
3008
  continue;
@@ -3006,7 +3013,7 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
3006
3013
  value = value * (style.scale || 1);
3007
3014
  }
3008
3015
  result.push({
3009
- type: PART_TYPE.literal,
3016
+ type: 0 /* literal */,
3010
3017
  value: formatters.getNumberFormat(locales, style).format(value)
3011
3018
  });
3012
3019
  continue;
@@ -3017,48 +3024,82 @@ function formatToParts(els, locales, formatters, formats, values, currentPluralV
3017
3024
  if (!isFormatXMLElementFn(formatFn)) {
3018
3025
  throw new InvalidValueTypeError(value2, "function", originalMessage);
3019
3026
  }
3020
- const parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);
3027
+ const parts = formatToParts(
3028
+ children,
3029
+ locales,
3030
+ formatters,
3031
+ formats,
3032
+ values,
3033
+ currentPluralValue
3034
+ );
3021
3035
  let chunks = formatFn(parts.map((p) => p.value));
3022
3036
  if (!Array.isArray(chunks)) {
3023
3037
  chunks = [chunks];
3024
3038
  }
3025
- result.push(...chunks.map((c) => {
3026
- return {
3027
- type: typeof c === "string" ? PART_TYPE.literal : PART_TYPE.object,
3028
- value: c
3029
- };
3030
- }));
3039
+ result.push(
3040
+ ...chunks.map((c) => {
3041
+ return {
3042
+ type: typeof c === "string" ? 0 /* literal */ : 1 /* object */,
3043
+ value: c
3044
+ };
3045
+ })
3046
+ );
3031
3047
  }
3032
3048
  if (isSelectElement(el)) {
3033
3049
  const opt = el.options[value] || el.options.other;
3034
3050
  if (!opt) {
3035
- throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
3051
+ throw new InvalidValueError(
3052
+ el.value,
3053
+ value,
3054
+ Object.keys(el.options),
3055
+ originalMessage
3056
+ );
3036
3057
  }
3037
- result.push(...formatToParts(opt.value, locales, formatters, formats, values));
3058
+ result.push(
3059
+ ...formatToParts(opt.value, locales, formatters, formats, values)
3060
+ );
3038
3061
  continue;
3039
3062
  }
3040
3063
  if (isPluralElement(el)) {
3041
3064
  let opt = el.options[`=${value}`];
3042
3065
  if (!opt) {
3043
3066
  if (!Intl.PluralRules) {
3044
- throw new FormatError(`Intl.PluralRules is not available in this environment.
3067
+ throw new FormatError(
3068
+ `Intl.PluralRules is not available in this environment.
3045
3069
  Try polyfilling it using "@formatjs/intl-pluralrules"
3046
- `, ErrorCode.MISSING_INTL_API, originalMessage);
3070
+ `,
3071
+ "MISSING_INTL_API" /* MISSING_INTL_API */,
3072
+ originalMessage
3073
+ );
3047
3074
  }
3048
3075
  const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(value - (el.offset || 0));
3049
3076
  opt = el.options[rule] || el.options.other;
3050
3077
  }
3051
3078
  if (!opt) {
3052
- throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
3079
+ throw new InvalidValueError(
3080
+ el.value,
3081
+ value,
3082
+ Object.keys(el.options),
3083
+ originalMessage
3084
+ );
3053
3085
  }
3054
- result.push(...formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
3086
+ result.push(
3087
+ ...formatToParts(
3088
+ opt.value,
3089
+ locales,
3090
+ formatters,
3091
+ formats,
3092
+ values,
3093
+ value - (el.offset || 0)
3094
+ )
3095
+ );
3055
3096
  continue;
3056
3097
  }
3057
3098
  }
3058
3099
  return mergeLiteral(result);
3059
3100
  }
3060
3101
 
3061
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/core.js
3102
+ // packages/intl-messageformat/src/core.ts
3062
3103
  function mergeConfig(c1, c2) {
3063
3104
  if (!c2) {
3064
3105
  return c1;
@@ -3079,10 +3120,13 @@ function mergeConfigs(defaultConfig, configs) {
3079
3120
  if (!configs) {
3080
3121
  return defaultConfig;
3081
3122
  }
3082
- return Object.keys(defaultConfig).reduce((all, k) => {
3083
- all[k] = mergeConfig(defaultConfig[k], configs[k]);
3084
- return all;
3085
- }, { ...defaultConfig });
3123
+ return Object.keys(defaultConfig).reduce(
3124
+ (all, k) => {
3125
+ all[k] = mergeConfig(defaultConfig[k], configs[k]);
3126
+ return all;
3127
+ },
3128
+ { ...defaultConfig }
3129
+ );
3086
3130
  }
3087
3131
  function createFastMemoizeCache(store) {
3088
3132
  return {
@@ -3118,7 +3162,7 @@ function createDefaultFormatters(cache = {
3118
3162
  })
3119
3163
  };
3120
3164
  }
3121
- var _IntlMessageFormat = class {
3165
+ var IntlMessageFormat = class _IntlMessageFormat {
3122
3166
  ast;
3123
3167
  locales;
3124
3168
  resolvedLocale;
@@ -3136,7 +3180,9 @@ var _IntlMessageFormat = class {
3136
3180
  if (typeof message === "string") {
3137
3181
  this.message = message;
3138
3182
  if (!_IntlMessageFormat.__parse) {
3139
- throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
3183
+ throw new TypeError(
3184
+ "IntlMessageFormat.__parse must be set to process `message` of type `string`"
3185
+ );
3140
3186
  }
3141
3187
  const { formatters, ...parseOpts } = opts || {};
3142
3188
  this.ast = _IntlMessageFormat.__parse(message, {
@@ -3157,109 +3203,119 @@ var _IntlMessageFormat = class {
3157
3203
  if (parts.length === 1) {
3158
3204
  return parts[0].value;
3159
3205
  }
3160
- const result = parts.reduce((all, part) => {
3161
- if (!all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] !== "string") {
3162
- all.push(part.value);
3163
- } else {
3164
- all[all.length - 1] += part.value;
3165
- }
3166
- return all;
3167
- }, []);
3206
+ const result = parts.reduce(
3207
+ (all, part) => {
3208
+ if (!all.length || part.type !== 0 /* literal */ || typeof all[all.length - 1] !== "string") {
3209
+ all.push(part.value);
3210
+ } else {
3211
+ all[all.length - 1] += part.value;
3212
+ }
3213
+ return all;
3214
+ },
3215
+ []
3216
+ );
3168
3217
  if (result.length <= 1) {
3169
3218
  return result[0] || "";
3170
3219
  }
3171
3220
  return result;
3172
3221
  };
3173
- formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message);
3222
+ formatToParts = (values) => formatToParts(
3223
+ this.ast,
3224
+ this.locales,
3225
+ this.formatters,
3226
+ this.formats,
3227
+ values,
3228
+ void 0,
3229
+ this.message
3230
+ );
3174
3231
  resolvedOptions = () => ({
3175
3232
  locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0]
3176
3233
  });
3177
3234
  getAst = () => this.ast;
3235
+ static memoizedDefaultLocale = null;
3178
3236
  static get defaultLocale() {
3179
3237
  if (!_IntlMessageFormat.memoizedDefaultLocale) {
3180
3238
  _IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
3181
3239
  }
3182
3240
  return _IntlMessageFormat.memoizedDefaultLocale;
3183
3241
  }
3184
- };
3185
- var IntlMessageFormat = _IntlMessageFormat;
3186
- __publicField(IntlMessageFormat, "memoizedDefaultLocale", null);
3187
- __publicField(IntlMessageFormat, "resolveLocale", (locales) => {
3188
- if (typeof Intl.Locale === "undefined") {
3189
- return;
3190
- }
3191
- const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
3192
- if (supportedLocales.length > 0) {
3193
- return new Intl.Locale(supportedLocales[0]);
3194
- }
3195
- return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
3196
- });
3197
- __publicField(IntlMessageFormat, "__parse", parse);
3198
- // Default format options used as the prototype of the `formats` provided to the
3199
- // constructor. These are used when constructing the internal Intl.NumberFormat
3200
- // and Intl.DateTimeFormat instances.
3201
- __publicField(IntlMessageFormat, "formats", {
3202
- number: {
3203
- integer: {
3204
- maximumFractionDigits: 0
3205
- },
3206
- currency: {
3207
- style: "currency"
3208
- },
3209
- percent: {
3210
- style: "percent"
3242
+ static resolveLocale = (locales) => {
3243
+ if (typeof Intl.Locale === "undefined") {
3244
+ return;
3211
3245
  }
3212
- },
3213
- date: {
3214
- short: {
3215
- month: "numeric",
3216
- day: "numeric",
3217
- year: "2-digit"
3218
- },
3219
- medium: {
3220
- month: "short",
3221
- day: "numeric",
3222
- year: "numeric"
3223
- },
3224
- long: {
3225
- month: "long",
3226
- day: "numeric",
3227
- year: "numeric"
3228
- },
3229
- full: {
3230
- weekday: "long",
3231
- month: "long",
3232
- day: "numeric",
3233
- year: "numeric"
3246
+ const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
3247
+ if (supportedLocales.length > 0) {
3248
+ return new Intl.Locale(supportedLocales[0]);
3234
3249
  }
3235
- },
3236
- time: {
3237
- short: {
3238
- hour: "numeric",
3239
- minute: "numeric"
3240
- },
3241
- medium: {
3242
- hour: "numeric",
3243
- minute: "numeric",
3244
- second: "numeric"
3250
+ return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
3251
+ };
3252
+ static __parse = parse;
3253
+ // Default format options used as the prototype of the `formats` provided to the
3254
+ // constructor. These are used when constructing the internal Intl.NumberFormat
3255
+ // and Intl.DateTimeFormat instances.
3256
+ static formats = {
3257
+ number: {
3258
+ integer: {
3259
+ maximumFractionDigits: 0
3260
+ },
3261
+ currency: {
3262
+ style: "currency"
3263
+ },
3264
+ percent: {
3265
+ style: "percent"
3266
+ }
3245
3267
  },
3246
- long: {
3247
- hour: "numeric",
3248
- minute: "numeric",
3249
- second: "numeric",
3250
- timeZoneName: "short"
3268
+ date: {
3269
+ short: {
3270
+ month: "numeric",
3271
+ day: "numeric",
3272
+ year: "2-digit"
3273
+ },
3274
+ medium: {
3275
+ month: "short",
3276
+ day: "numeric",
3277
+ year: "numeric"
3278
+ },
3279
+ long: {
3280
+ month: "long",
3281
+ day: "numeric",
3282
+ year: "numeric"
3283
+ },
3284
+ full: {
3285
+ weekday: "long",
3286
+ month: "long",
3287
+ day: "numeric",
3288
+ year: "numeric"
3289
+ }
3251
3290
  },
3252
- full: {
3253
- hour: "numeric",
3254
- minute: "numeric",
3255
- second: "numeric",
3256
- timeZoneName: "short"
3291
+ time: {
3292
+ short: {
3293
+ hour: "numeric",
3294
+ minute: "numeric"
3295
+ },
3296
+ medium: {
3297
+ hour: "numeric",
3298
+ minute: "numeric",
3299
+ second: "numeric"
3300
+ },
3301
+ long: {
3302
+ hour: "numeric",
3303
+ minute: "numeric",
3304
+ second: "numeric",
3305
+ timeZoneName: "short"
3306
+ },
3307
+ full: {
3308
+ hour: "numeric",
3309
+ minute: "numeric",
3310
+ second: "numeric",
3311
+ timeZoneName: "short"
3312
+ }
3257
3313
  }
3258
- }
3259
- });
3314
+ };
3315
+ };
3260
3316
 
3261
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-messageformat/lib_esnext/index.js
3262
- var lib_esnext_default = IntlMessageFormat;
3317
+ // packages/intl-messageformat/index.ts
3318
+ var intl_messageformat_default = IntlMessageFormat;
3263
3319
  export {
3264
3320
  ErrorCode,
3265
3321
  FormatError,
@@ -3268,7 +3324,7 @@ export {
3268
3324
  InvalidValueTypeError,
3269
3325
  MissingValueError,
3270
3326
  PART_TYPE,
3271
- lib_esnext_default as default,
3327
+ intl_messageformat_default as default,
3272
3328
  formatToParts,
3273
3329
  isFormatXMLElementFn
3274
3330
  };