@formatjs/intl-pluralrules 6.3.7 → 6.3.8

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/polyfill.iife.js CHANGED
@@ -3828,13 +3828,6 @@ function SupportedLocales(availableLocales, requestedLocales, options) {
3828
3828
  //#endregion
3829
3829
  //#region node_modules/.aspect_rules_js/@formatjs+bigdecimal@0.0.0/node_modules/@formatjs/bigdecimal/index.js
3830
3830
  const DIV_PRECISION = 40;
3831
- var SpecialValue = /* @__PURE__ */ function(SpecialValue) {
3832
- SpecialValue[SpecialValue["NONE"] = 0] = "NONE";
3833
- SpecialValue[SpecialValue["NAN"] = 1] = "NAN";
3834
- SpecialValue[SpecialValue["POSITIVE_INFINITY"] = 2] = "POSITIVE_INFINITY";
3835
- SpecialValue[SpecialValue["NEGATIVE_INFINITY"] = 3] = "NEGATIVE_INFINITY";
3836
- return SpecialValue;
3837
- }(SpecialValue || {});
3838
3831
  function removeTrailingZeros(mantissa, exponent) {
3839
3832
  if (mantissa === 0n) return [0n, 0];
3840
3833
  while (mantissa % 10n === 0n) {
@@ -3880,19 +3873,19 @@ function parseDecimalString(s) {
3880
3873
  if (s === "NaN") return {
3881
3874
  mantissa: 0n,
3882
3875
  exponent: 0,
3883
- special: SpecialValue.NAN,
3876
+ special: 1,
3884
3877
  negativeZero: false
3885
3878
  };
3886
3879
  if (s === "Infinity" || s === "+Infinity") return {
3887
3880
  mantissa: 0n,
3888
3881
  exponent: 0,
3889
- special: SpecialValue.POSITIVE_INFINITY,
3882
+ special: 2,
3890
3883
  negativeZero: false
3891
3884
  };
3892
3885
  if (s === "-Infinity") return {
3893
3886
  mantissa: 0n,
3894
3887
  exponent: 0,
3895
- special: SpecialValue.NEGATIVE_INFINITY,
3888
+ special: 3,
3896
3889
  negativeZero: false
3897
3890
  };
3898
3891
  let negative = false;
@@ -3924,7 +3917,7 @@ function parseDecimalString(s) {
3924
3917
  if (combined === "" || combined === "0" || /^0+$/.test(combined)) return {
3925
3918
  mantissa: 0n,
3926
3919
  exponent: 0,
3927
- special: SpecialValue.NONE,
3920
+ special: 0,
3928
3921
  negativeZero: negative
3929
3922
  };
3930
3923
  let mantissa = BigInt(combined);
@@ -3933,7 +3926,7 @@ function parseDecimalString(s) {
3933
3926
  return {
3934
3927
  mantissa: normMantissa,
3935
3928
  exponent: normExponent,
3936
- special: SpecialValue.NONE,
3929
+ special: 0,
3937
3930
  negativeZero: false
3938
3931
  };
3939
3932
  }
@@ -3943,7 +3936,7 @@ var BigDecimal = class BigDecimal {
3943
3936
  const [m, e] = removeTrailingZeros(value, 0);
3944
3937
  this._mantissa = m;
3945
3938
  this._exponent = e;
3946
- this._special = SpecialValue.NONE;
3939
+ this._special = 0;
3947
3940
  this._negativeZero = false;
3948
3941
  return;
3949
3942
  }
@@ -3951,28 +3944,28 @@ var BigDecimal = class BigDecimal {
3951
3944
  if (Number.isNaN(value)) {
3952
3945
  this._mantissa = 0n;
3953
3946
  this._exponent = 0;
3954
- this._special = SpecialValue.NAN;
3947
+ this._special = 1;
3955
3948
  this._negativeZero = false;
3956
3949
  return;
3957
3950
  }
3958
3951
  if (value === Infinity) {
3959
3952
  this._mantissa = 0n;
3960
3953
  this._exponent = 0;
3961
- this._special = SpecialValue.POSITIVE_INFINITY;
3954
+ this._special = 2;
3962
3955
  this._negativeZero = false;
3963
3956
  return;
3964
3957
  }
3965
3958
  if (value === -Infinity) {
3966
3959
  this._mantissa = 0n;
3967
3960
  this._exponent = 0;
3968
- this._special = SpecialValue.NEGATIVE_INFINITY;
3961
+ this._special = 3;
3969
3962
  this._negativeZero = false;
3970
3963
  return;
3971
3964
  }
3972
3965
  if (value === 0) {
3973
3966
  this._mantissa = 0n;
3974
3967
  this._exponent = 0;
3975
- this._special = SpecialValue.NONE;
3968
+ this._special = 0;
3976
3969
  this._negativeZero = Object.is(value, -0);
3977
3970
  return;
3978
3971
  }
@@ -4000,32 +3993,32 @@ var BigDecimal = class BigDecimal {
4000
3993
  if (this._special || other._special) return this._specialArith(other, "times");
4001
3994
  if (this._mantissa === 0n || other._mantissa === 0n) {
4002
3995
  const negZero = this._isSignNegative() ? !other._isSignNegative() : other._isSignNegative();
4003
- return BigDecimal._create(0n, 0, SpecialValue.NONE, negZero);
3996
+ return BigDecimal._create(0n, 0, 0, negZero);
4004
3997
  }
4005
3998
  const [nm, ne] = removeTrailingZeros(this._mantissa * other._mantissa, this._exponent + other._exponent);
4006
- return BigDecimal._create(nm, ne, SpecialValue.NONE, false);
3999
+ return BigDecimal._create(nm, ne, 0, false);
4007
4000
  }
4008
4001
  div(y) {
4009
4002
  const other = BigDecimal._coerce(y);
4010
4003
  if (this._special || other._special) return this._specialArith(other, "div");
4011
4004
  if (other._mantissa === 0n) {
4012
- if (this._mantissa === 0n) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4005
+ if (this._mantissa === 0n) return BigDecimal._create(0n, 0, 1, false);
4013
4006
  const neg = this._isSignNegative() !== other._isSignNegative();
4014
- return BigDecimal._create(0n, 0, neg ? SpecialValue.NEGATIVE_INFINITY : SpecialValue.POSITIVE_INFINITY, false);
4007
+ return BigDecimal._create(0n, 0, neg ? 3 : 2, false);
4015
4008
  }
4016
4009
  if (this._mantissa === 0n) {
4017
4010
  const negZero = this._isSignNegative() !== other._isSignNegative();
4018
- return BigDecimal._create(0n, 0, SpecialValue.NONE, negZero);
4011
+ return BigDecimal._create(0n, 0, 0, negZero);
4019
4012
  }
4020
4013
  const [nm, ne] = removeTrailingZeros(this._mantissa * bigintPow10(DIV_PRECISION) / other._mantissa, this._exponent - other._exponent - DIV_PRECISION);
4021
- return BigDecimal._create(nm, ne, SpecialValue.NONE, false);
4014
+ return BigDecimal._create(nm, ne, 0, false);
4022
4015
  }
4023
4016
  plus(y) {
4024
4017
  const other = BigDecimal._coerce(y);
4025
4018
  if (this._special || other._special) return this._specialArith(other, "plus");
4026
4019
  if (this._mantissa === 0n && other._mantissa === 0n) {
4027
4020
  const negZero = this._negativeZero && other._negativeZero;
4028
- return BigDecimal._create(0n, 0, SpecialValue.NONE, negZero);
4021
+ return BigDecimal._create(0n, 0, 0, negZero);
4029
4022
  }
4030
4023
  if (this._mantissa === 0n) return other;
4031
4024
  if (other._mantissa === 0n) return this;
@@ -4037,9 +4030,9 @@ var BigDecimal = class BigDecimal {
4037
4030
  if (e1 > minE) m1 *= bigintPow10(e1 - minE);
4038
4031
  if (e2 > minE) m2 *= bigintPow10(e2 - minE);
4039
4032
  const sum = m1 + m2;
4040
- if (sum === 0n) return BigDecimal._create(0n, 0, SpecialValue.NONE, false);
4033
+ if (sum === 0n) return BigDecimal._create(0n, 0, 0, false);
4041
4034
  const [nm, ne] = removeTrailingZeros(sum, minE);
4042
- return BigDecimal._create(nm, ne, SpecialValue.NONE, false);
4035
+ return BigDecimal._create(nm, ne, 0, false);
4043
4036
  }
4044
4037
  minus(y) {
4045
4038
  return this.plus(BigDecimal._coerce(y).negated());
@@ -4047,11 +4040,11 @@ var BigDecimal = class BigDecimal {
4047
4040
  mod(y) {
4048
4041
  const other = BigDecimal._coerce(y);
4049
4042
  if (this._special || other._special) {
4050
- if (this._special === SpecialValue.NAN || other._special === SpecialValue.NAN) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4051
- if (this._special === SpecialValue.POSITIVE_INFINITY || this._special === SpecialValue.NEGATIVE_INFINITY) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4052
- if (other._special === SpecialValue.POSITIVE_INFINITY || other._special === SpecialValue.NEGATIVE_INFINITY) return this;
4043
+ if (this._special === 1 || other._special === 1) return BigDecimal._create(0n, 0, 1, false);
4044
+ if (this._special === 2 || this._special === 3) return BigDecimal._create(0n, 0, 1, false);
4045
+ if (other._special === 2 || other._special === 3) return this;
4053
4046
  }
4054
- if (other._mantissa === 0n) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4047
+ if (other._mantissa === 0n) return BigDecimal._create(0n, 0, 1, false);
4055
4048
  if (this._mantissa === 0n) return this;
4056
4049
  let m1 = this._mantissa;
4057
4050
  let m2 = other._mantissa;
@@ -4061,34 +4054,34 @@ var BigDecimal = class BigDecimal {
4061
4054
  if (e1 > minE) m1 *= bigintPow10(e1 - minE);
4062
4055
  if (e2 > minE) m2 *= bigintPow10(e2 - minE);
4063
4056
  const remainder = m1 % m2;
4064
- if (remainder === 0n) return BigDecimal._create(0n, 0, SpecialValue.NONE, false);
4057
+ if (remainder === 0n) return BigDecimal._create(0n, 0, 0, false);
4065
4058
  const [nm, ne] = removeTrailingZeros(remainder, minE);
4066
- return BigDecimal._create(nm, ne, SpecialValue.NONE, false);
4059
+ return BigDecimal._create(nm, ne, 0, false);
4067
4060
  }
4068
4061
  abs() {
4069
- if (this._special === SpecialValue.NAN) return this;
4070
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return BigDecimal._create(0n, 0, SpecialValue.POSITIVE_INFINITY, false);
4062
+ if (this._special === 1) return this;
4063
+ if (this._special === 3) return BigDecimal._create(0n, 0, 2, false);
4071
4064
  return BigDecimal._create(bigintAbs(this._mantissa), this._exponent, this._special, false);
4072
4065
  }
4073
4066
  negated() {
4074
- if (this._special === SpecialValue.NAN) return this;
4075
- if (this._special === SpecialValue.POSITIVE_INFINITY) return BigDecimal._create(0n, 0, SpecialValue.NEGATIVE_INFINITY, false);
4076
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return BigDecimal._create(0n, 0, SpecialValue.POSITIVE_INFINITY, false);
4077
- if (this._mantissa === 0n) return BigDecimal._create(0n, 0, SpecialValue.NONE, !this._negativeZero);
4078
- return BigDecimal._create(-this._mantissa, this._exponent, SpecialValue.NONE, false);
4067
+ if (this._special === 1) return this;
4068
+ if (this._special === 2) return BigDecimal._create(0n, 0, 3, false);
4069
+ if (this._special === 3) return BigDecimal._create(0n, 0, 2, false);
4070
+ if (this._mantissa === 0n) return BigDecimal._create(0n, 0, 0, !this._negativeZero);
4071
+ return BigDecimal._create(-this._mantissa, this._exponent, 0, false);
4079
4072
  }
4080
4073
  pow(n) {
4081
- if (this._special === SpecialValue.NAN) return this;
4074
+ if (this._special === 1) return this;
4082
4075
  if (n === 0) return new BigDecimal(1);
4083
4076
  if (n < 0) return new BigDecimal(1).div(this.pow(-n));
4084
- if (this._special === SpecialValue.POSITIVE_INFINITY) return this;
4085
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return n % 2 === 0 ? BigDecimal._create(0n, 0, SpecialValue.POSITIVE_INFINITY, false) : this;
4077
+ if (this._special === 2) return this;
4078
+ if (this._special === 3) return n % 2 === 0 ? BigDecimal._create(0n, 0, 2, false) : this;
4086
4079
  if (this._mantissa === 0n) return new BigDecimal(0);
4087
4080
  const [nm, ne] = removeTrailingZeros(this._mantissa ** BigInt(n), this._exponent * n);
4088
- return BigDecimal._create(nm, ne, SpecialValue.NONE, false);
4081
+ return BigDecimal._create(nm, ne, 0, false);
4089
4082
  }
4090
4083
  floor() {
4091
- if (this._special !== SpecialValue.NONE) return this;
4084
+ if (this._special !== 0) return this;
4092
4085
  if (this._mantissa === 0n) return this;
4093
4086
  if (this._exponent >= 0) return this;
4094
4087
  const divisor = bigintPow10(-this._exponent);
@@ -4097,29 +4090,29 @@ var BigDecimal = class BigDecimal {
4097
4090
  if (m < 0n && m % divisor !== 0n) q -= 1n;
4098
4091
  if (q === 0n) {
4099
4092
  const negZero = this._mantissa < 0n;
4100
- return BigDecimal._create(0n, 0, SpecialValue.NONE, negZero);
4093
+ return BigDecimal._create(0n, 0, 0, negZero);
4101
4094
  }
4102
4095
  const [nm, ne] = removeTrailingZeros(q, 0);
4103
- return BigDecimal._create(nm, ne, SpecialValue.NONE, false);
4096
+ return BigDecimal._create(nm, ne, 0, false);
4104
4097
  }
4105
4098
  ceil() {
4106
- if (this._special !== SpecialValue.NONE) return this;
4099
+ if (this._special !== 0) return this;
4107
4100
  if (this._mantissa === 0n) return this;
4108
4101
  if (this._exponent >= 0) return this;
4109
4102
  const divisor = bigintPow10(-this._exponent);
4110
4103
  const m = this._mantissa;
4111
4104
  let q = m / divisor;
4112
4105
  if (m > 0n && m % divisor !== 0n) q += 1n;
4113
- if (q === 0n) return BigDecimal._create(0n, 0, SpecialValue.NONE, false);
4106
+ if (q === 0n) return BigDecimal._create(0n, 0, 0, false);
4114
4107
  const [nm, ne] = removeTrailingZeros(q, 0);
4115
- return BigDecimal._create(nm, ne, SpecialValue.NONE, false);
4108
+ return BigDecimal._create(nm, ne, 0, false);
4116
4109
  }
4117
4110
  log(base) {
4118
- if (this._special === SpecialValue.NAN) return this;
4119
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4120
- if (this._special === SpecialValue.POSITIVE_INFINITY) return BigDecimal._create(0n, 0, SpecialValue.POSITIVE_INFINITY, false);
4121
- if (this._mantissa < 0n) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4122
- if (this._mantissa === 0n) return BigDecimal._create(0n, 0, SpecialValue.NEGATIVE_INFINITY, false);
4111
+ if (this._special === 1) return this;
4112
+ if (this._special === 3) return BigDecimal._create(0n, 0, 1, false);
4113
+ if (this._special === 2) return BigDecimal._create(0n, 0, 2, false);
4114
+ if (this._mantissa < 0n) return BigDecimal._create(0n, 0, 1, false);
4115
+ if (this._mantissa === 0n) return BigDecimal._create(0n, 0, 3, false);
4123
4116
  if (base === 10) return this._log10();
4124
4117
  const log10x = this._log10();
4125
4118
  const log10b = new BigDecimal(Math.log10(base));
@@ -4139,18 +4132,18 @@ var BigDecimal = class BigDecimal {
4139
4132
  }
4140
4133
  eq(y) {
4141
4134
  const other = BigDecimal._coerce(y);
4142
- if (this._special === SpecialValue.NAN || other._special === SpecialValue.NAN) return false;
4135
+ if (this._special === 1 || other._special === 1) return false;
4143
4136
  if (this._special !== other._special) return false;
4144
- if (this._special !== SpecialValue.NONE) return true;
4137
+ if (this._special !== 0) return true;
4145
4138
  if (this._mantissa === 0n && other._mantissa === 0n) return true;
4146
4139
  return this._mantissa === other._mantissa && this._exponent === other._exponent;
4147
4140
  }
4148
4141
  _compareTo(other) {
4149
- if (this._special === SpecialValue.NAN || other._special === SpecialValue.NAN) return NaN;
4150
- if (this._special === SpecialValue.POSITIVE_INFINITY) return other._special === SpecialValue.POSITIVE_INFINITY ? 0 : 1;
4151
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return other._special === SpecialValue.NEGATIVE_INFINITY ? 0 : -1;
4152
- if (other._special === SpecialValue.POSITIVE_INFINITY) return -1;
4153
- if (other._special === SpecialValue.NEGATIVE_INFINITY) return 1;
4142
+ if (this._special === 1 || other._special === 1) return NaN;
4143
+ if (this._special === 2) return other._special === 2 ? 0 : 1;
4144
+ if (this._special === 3) return other._special === 3 ? 0 : -1;
4145
+ if (other._special === 2) return -1;
4146
+ if (other._special === 3) return 1;
4154
4147
  const thisZero = this._mantissa === 0n;
4155
4148
  const otherZero = other._mantissa === 0n;
4156
4149
  if (thisZero && otherZero) return 0;
@@ -4184,30 +4177,30 @@ var BigDecimal = class BigDecimal {
4184
4177
  return c === 0 || c === 1;
4185
4178
  }
4186
4179
  isZero() {
4187
- return this._special === SpecialValue.NONE && this._mantissa === 0n;
4180
+ return this._special === 0 && this._mantissa === 0n;
4188
4181
  }
4189
4182
  isNaN() {
4190
- return this._special === SpecialValue.NAN;
4183
+ return this._special === 1;
4191
4184
  }
4192
4185
  isFinite() {
4193
- return this._special === SpecialValue.NONE;
4186
+ return this._special === 0;
4194
4187
  }
4195
4188
  isNegative() {
4196
- if (this._special === SpecialValue.NAN) return false;
4197
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return true;
4198
- if (this._special === SpecialValue.POSITIVE_INFINITY) return false;
4189
+ if (this._special === 1) return false;
4190
+ if (this._special === 3) return true;
4191
+ if (this._special === 2) return false;
4199
4192
  if (this._mantissa === 0n) return this._negativeZero;
4200
4193
  return this._mantissa < 0n;
4201
4194
  }
4202
4195
  isPositive() {
4203
- if (this._special === SpecialValue.NAN) return false;
4204
- if (this._special === SpecialValue.POSITIVE_INFINITY) return true;
4205
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return false;
4196
+ if (this._special === 1) return false;
4197
+ if (this._special === 2) return true;
4198
+ if (this._special === 3) return false;
4206
4199
  if (this._mantissa === 0n) return !this._negativeZero;
4207
4200
  return this._mantissa > 0n;
4208
4201
  }
4209
4202
  isInteger() {
4210
- if (this._special !== SpecialValue.NONE) return false;
4203
+ if (this._special !== 0) return false;
4211
4204
  if (this._mantissa === 0n) return true;
4212
4205
  return this._exponent >= 0;
4213
4206
  }
@@ -4215,16 +4208,16 @@ var BigDecimal = class BigDecimal {
4215
4208
  return this.toString();
4216
4209
  }
4217
4210
  toNumber() {
4218
- if (this._special === SpecialValue.NAN) return NaN;
4219
- if (this._special === SpecialValue.POSITIVE_INFINITY) return Infinity;
4220
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return -Infinity;
4211
+ if (this._special === 1) return NaN;
4212
+ if (this._special === 2) return Infinity;
4213
+ if (this._special === 3) return -Infinity;
4221
4214
  if (this._mantissa === 0n) return this._negativeZero ? -0 : 0;
4222
4215
  return Number(this.toString());
4223
4216
  }
4224
4217
  toString() {
4225
- if (this._special === SpecialValue.NAN) return "NaN";
4226
- if (this._special === SpecialValue.POSITIVE_INFINITY) return "Infinity";
4227
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return "-Infinity";
4218
+ if (this._special === 1) return "NaN";
4219
+ if (this._special === 2) return "Infinity";
4220
+ if (this._special === 3) return "-Infinity";
4228
4221
  if (this._mantissa === 0n) return "0";
4229
4222
  const negative = this._mantissa < 0n;
4230
4223
  const absStr = bigintAbs(this._mantissa).toString();
@@ -4243,12 +4236,12 @@ var BigDecimal = class BigDecimal {
4243
4236
  }
4244
4237
  static pow(base, exp) {
4245
4238
  const n = typeof exp === "number" ? exp : exp.toNumber();
4246
- if (typeof base === "number" && base === 10) return BigDecimal._create(1n, n, SpecialValue.NONE, false);
4239
+ if (typeof base === "number" && base === 10) return BigDecimal._create(1n, n, 0, false);
4247
4240
  return (base instanceof BigDecimal ? base : new BigDecimal(base)).pow(n);
4248
4241
  }
4249
4242
  static set(_config) {}
4250
4243
  _isSignNegative() {
4251
- if (this._special === SpecialValue.NEGATIVE_INFINITY) return true;
4244
+ if (this._special === 3) return true;
4252
4245
  if (this._mantissa < 0n) return true;
4253
4246
  if (this._mantissa === 0n) return this._negativeZero;
4254
4247
  return false;
@@ -4256,38 +4249,38 @@ var BigDecimal = class BigDecimal {
4256
4249
  _specialArith(other, op) {
4257
4250
  const a = this._special;
4258
4251
  const b = other._special;
4259
- if (a === SpecialValue.NAN || b === SpecialValue.NAN) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4252
+ if (a === 1 || b === 1) return BigDecimal._create(0n, 0, 1, false);
4260
4253
  const aNeg = this._isSignNegative();
4261
4254
  const bNeg = other._isSignNegative();
4262
- const aInf = a === SpecialValue.POSITIVE_INFINITY || a === SpecialValue.NEGATIVE_INFINITY;
4263
- const bInf = b === SpecialValue.POSITIVE_INFINITY || b === SpecialValue.NEGATIVE_INFINITY;
4255
+ const aInf = a === 2 || a === 3;
4256
+ const bInf = b === 2 || b === 3;
4264
4257
  if (op === "times") {
4265
4258
  if (aInf || bInf) {
4266
- if (aInf && other._mantissa === 0n && !bInf || bInf && this._mantissa === 0n && !aInf) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4259
+ if (aInf && other._mantissa === 0n && !bInf || bInf && this._mantissa === 0n && !aInf) return BigDecimal._create(0n, 0, 1, false);
4267
4260
  const neg = aNeg !== bNeg;
4268
- return BigDecimal._create(0n, 0, neg ? SpecialValue.NEGATIVE_INFINITY : SpecialValue.POSITIVE_INFINITY, false);
4261
+ return BigDecimal._create(0n, 0, neg ? 3 : 2, false);
4269
4262
  }
4270
4263
  }
4271
4264
  if (op === "div") {
4272
- if (aInf && bInf) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4265
+ if (aInf && bInf) return BigDecimal._create(0n, 0, 1, false);
4273
4266
  if (aInf) {
4274
4267
  const neg = aNeg !== bNeg;
4275
- return BigDecimal._create(0n, 0, neg ? SpecialValue.NEGATIVE_INFINITY : SpecialValue.POSITIVE_INFINITY, false);
4268
+ return BigDecimal._create(0n, 0, neg ? 3 : 2, false);
4276
4269
  }
4277
4270
  if (bInf) {
4278
4271
  const negZero = aNeg !== bNeg;
4279
- return BigDecimal._create(0n, 0, SpecialValue.NONE, negZero);
4272
+ return BigDecimal._create(0n, 0, 0, negZero);
4280
4273
  }
4281
4274
  }
4282
4275
  if (op === "plus") {
4283
4276
  if (aInf && bInf) {
4284
- if (aNeg !== bNeg) return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4277
+ if (aNeg !== bNeg) return BigDecimal._create(0n, 0, 1, false);
4285
4278
  return this;
4286
4279
  }
4287
4280
  if (aInf) return this;
4288
4281
  if (bInf) return other;
4289
4282
  }
4290
- return BigDecimal._create(0n, 0, SpecialValue.NAN, false);
4283
+ return BigDecimal._create(0n, 0, 1, false);
4291
4284
  }
4292
4285
  };
4293
4286
  //#endregion
@@ -4401,6 +4394,23 @@ function repeat(s, times) {
4401
4394
  for (let i = 0; i < arr.length; i++) arr[i] = s;
4402
4395
  return arr.join("");
4403
4396
  }
4397
+ function defineProperty(target, name, { value }) {
4398
+ Object.defineProperty(target, name, {
4399
+ configurable: true,
4400
+ enumerable: false,
4401
+ writable: true,
4402
+ value
4403
+ });
4404
+ }
4405
+ function ensureIntl() {
4406
+ if (typeof Intl === "undefined") Object.defineProperty(globalThis, "Intl", {
4407
+ configurable: true,
4408
+ enumerable: false,
4409
+ writable: true,
4410
+ value: {}
4411
+ });
4412
+ return Intl;
4413
+ }
4404
4414
  function invariant$1(condition, message, Err = Error) {
4405
4415
  if (!condition) throw new Err(message);
4406
4416
  }
@@ -5285,17 +5295,13 @@ function supportedLocalesOf(locale) {
5285
5295
  return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
5286
5296
  }
5287
5297
  function shouldPolyfill(locale = "en") {
5288
- if (!("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale)) return locale ? match([locale], supportedLocales, "en") : void 0;
5298
+ if (typeof Intl === "undefined" || !("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale)) return locale ? match([locale], supportedLocales, "en") : void 0;
5289
5299
  }
5290
5300
  //#endregion
5291
5301
  //#region packages/intl-pluralrules/polyfill.ts
5302
+ const intl = ensureIntl();
5292
5303
  if (shouldPolyfill()) {
5293
- Object.defineProperty(Intl, "PluralRules", {
5294
- value: PluralRules,
5295
- writable: true,
5296
- enumerable: false,
5297
- configurable: true
5298
- });
5304
+ defineProperty(intl, "PluralRules", { value: PluralRules });
5299
5305
  const buf = globalThis.__FORMATJS_PLURALRULES_DATA__;
5300
5306
  if (buf) {
5301
5307
  for (const d of buf) PluralRules.__addLocaleData(d);
package/polyfill.js CHANGED
@@ -242,6 +242,23 @@ function repeat(s, times) {
242
242
  for (let i = 0; i < arr.length; i++) arr[i] = s;
243
243
  return arr.join("");
244
244
  }
245
+ function defineProperty(target, name, { value }) {
246
+ Object.defineProperty(target, name, {
247
+ configurable: true,
248
+ enumerable: false,
249
+ writable: true,
250
+ value
251
+ });
252
+ }
253
+ function ensureIntl() {
254
+ if (typeof Intl === "undefined") Object.defineProperty(globalThis, "Intl", {
255
+ configurable: true,
256
+ enumerable: false,
257
+ writable: true,
258
+ value: {}
259
+ });
260
+ return Intl;
261
+ }
245
262
  function invariant$1(condition, message, Err = Error) {
246
263
  if (!condition) throw new Err(message);
247
264
  }
@@ -1354,17 +1371,13 @@ function supportedLocalesOf(locale) {
1354
1371
  return Intl.PluralRules.supportedLocalesOf(locales).length === locales.length;
1355
1372
  }
1356
1373
  function shouldPolyfill(locale = "en") {
1357
- if (!("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale)) return locale ? match([locale], supportedLocales, "en") : void 0;
1374
+ if (typeof Intl === "undefined" || !("PluralRules" in Intl) || new Intl.PluralRules("en", { minimumFractionDigits: 2 }).select(1) === "one" || !supportedLocalesOf(locale)) return locale ? match([locale], supportedLocales, "en") : void 0;
1358
1375
  }
1359
1376
  //#endregion
1360
1377
  //#region packages/intl-pluralrules/polyfill.ts
1378
+ const intl = ensureIntl();
1361
1379
  if (shouldPolyfill()) {
1362
- Object.defineProperty(Intl, "PluralRules", {
1363
- value: PluralRules,
1364
- writable: true,
1365
- enumerable: false,
1366
- configurable: true
1367
- });
1380
+ defineProperty(intl, "PluralRules", { value: PluralRules });
1368
1381
  const buf = globalThis.__FORMATJS_PLURALRULES_DATA__;
1369
1382
  if (buf) {
1370
1383
  for (const d of buf) PluralRules.__addLocaleData(d);