@poe-platform/safe-js 0.1.468 → 0.1.469

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.
@@ -27,7 +27,7 @@ import {
27
27
  validateMigrationSemantics,
28
28
  validateSnapshotData,
29
29
  validateSnapshotMigration
30
- } from "./chunk-BNHG2QJQ.js";
30
+ } from "./chunk-J72Q6BW5.js";
31
31
 
32
32
  // packages/safe-js/src/migrate.ts
33
33
  import { createHash } from "node:crypto";
@@ -8249,4 +8249,4 @@ export {
8249
8249
  parseMcpConfig,
8250
8250
  makeMcpModule
8251
8251
  };
8252
- //# sourceMappingURL=chunk-7Z6JSD2L.js.map
8252
+ //# sourceMappingURL=chunk-566GCASZ.js.map
@@ -1,7 +1,3 @@
1
- import {
2
- __export
3
- } from "./chunk-4YIDX44G.js";
4
-
5
1
  // packages/safe-js/src/interp/internal-symbols.ts
6
2
  var internalSymbols = /* @__PURE__ */ new Set();
7
3
 
@@ -11230,14 +11226,6 @@ function decodeBase64(text, alphabet, mode, budget, maxLength = Number.MAX_SAFE_
11230
11226
  }
11231
11227
  }
11232
11228
 
11233
- // packages/safe-js/src/interp/numberformat-portable.ts
11234
- var numberformat_portable_exports = {};
11235
- __export(numberformat_portable_exports, {
11236
- createPortableNumberFormatter: () => createPortableNumberFormatter,
11237
- numberFormatterOptions: () => numberFormatterOptions,
11238
- numberFormatterResult: () => numberFormatterResult
11239
- });
11240
-
11241
11229
  // packages/safe-js/src/intl-data/dist/pluralrules-engine.js
11242
11230
  import { LookupSupportedLocales, ResolveLocale } from "@formatjs/intl-localematcher";
11243
11231
  import Decimal$1, { Decimal } from "@formatjs/bigdecimal";
@@ -18284,7 +18272,6 @@ var localeData = Object.freeze({
18284
18272
 
18285
18273
  // packages/safe-js/src/interp/numberformat-numbering.ts
18286
18274
  var NativeNumberFormat = Intl.NumberFormat;
18287
- var nativeUnits = new Set(Intl.supportedValuesOf("unit"));
18288
18275
  function localizeNumberParts(parts, locale, options) {
18289
18276
  parts = parts.flatMap((part) => {
18290
18277
  if (part.type !== "minusSign" && part.type !== "plusSign") return [part];
@@ -18298,16 +18285,12 @@ function localizeNumberParts(parts, locale, options) {
18298
18285
  return separated;
18299
18286
  });
18300
18287
  const numberingSystem = options.numberingSystem;
18301
- const pluralType = options.style === "unit" ? "unit" : options.style === "currency" && options.currencyDisplay === "name" ? "currency" : void 0;
18302
- const nativePlural = pluralType !== "unit" || typeof options.unit === "string" && options.unit.split("-per-").every((unit) => nativeUnits.has(unit));
18303
- const integralPlural = pluralType !== void 0 && nativePlural && options.notation === "standard" && !parts.some((part) => part.type === "fraction");
18304
- if (numberingSystem === "latn" && !integralPlural) return parts;
18288
+ if (numberingSystem === "latn") return parts;
18305
18289
  const digitFormatter = new NativeNumberFormat(locale, { numberingSystem, useGrouping: false });
18306
18290
  const digits = Array.from({ length: 10 }, (_, digit) => digitFormatter.formatToParts(digit).find((part) => part.type === "integer").value);
18307
18291
  const sourceFormatter = new NumberFormat(locale, { numberingSystem, useGrouping: false });
18308
18292
  const sourceDigits = Array.from({ length: 10 }, (_, digit) => sourceFormatter.formatToParts(digit).find((part) => part.type === "integer").value);
18309
18293
  const result = [];
18310
- let roundedInteger;
18311
18294
  for (let index = 0; index < parts.length; index++) {
18312
18295
  const part = parts[index];
18313
18296
  if (part.type === "exponentMinusSign") {
@@ -18340,7 +18323,6 @@ function localizeNumberParts(parts, locale, options) {
18340
18323
  const digit = sourceDigits.indexOf(char);
18341
18324
  return digit < 0 ? char : String(digit);
18342
18325
  }).join("");
18343
- roundedInteger = ascii;
18344
18326
  const grouping = options.useGrouping;
18345
18327
  const formatter = new NativeNumberFormat(locale, {
18346
18328
  numberingSystem,
@@ -18366,21 +18348,6 @@ function localizeNumberParts(parts, locale, options) {
18366
18348
  }
18367
18349
  for (const value of grouped) result.push({ ...part, type: value.type, value: value.value });
18368
18350
  }
18369
- if (integralPlural && roundedInteger !== void 0) {
18370
- const native = new NativeNumberFormat(locale, {
18371
- style: options.style,
18372
- unit: options.unit,
18373
- unitDisplay: options.unitDisplay,
18374
- currency: options.currency,
18375
- currencyDisplay: "name",
18376
- maximumFractionDigits: 0,
18377
- minimumFractionDigits: 0
18378
- });
18379
- const word = native.formatToParts(BigInt(roundedInteger)).find((part) => part.type === pluralType)?.value;
18380
- if (word !== void 0) {
18381
- for (const part of result) if (part.type === pluralType) part.value = word;
18382
- }
18383
- }
18384
18351
  return result;
18385
18352
  }
18386
18353
  function addNumberingSystem(data, locale, numberingSystem) {
@@ -18505,15 +18472,19 @@ function numberFormatterResult(formatter, method, values) {
18505
18472
  // packages/safe-js/src/interp/numberformat-backend.ts
18506
18473
  var NativeNumberFormat3 = Intl.NumberFormat;
18507
18474
  var modernNative = new NativeNumberFormat3("en", { maximumFractionDigits: 0, ...{ roundingMode: "floor" } }).format(1.9) === "1" && typeof Object.getOwnPropertyDescriptor(NativeNumberFormat3.prototype, "formatRange")?.value === "function";
18508
- var portable = modernNative ? void 0 : numberformat_portable_exports;
18475
+ var portableFormatters = /* @__PURE__ */ new WeakSet();
18509
18476
  function createNumberFormatter(locales2, options) {
18510
- return portable === void 0 ? new NativeNumberFormat3(locales2, options) : portable.createPortableNumberFormatter(locales2, options);
18477
+ if (modernNative && options.style !== "unit" && !(options.style === "currency" && options.currencyDisplay === "name"))
18478
+ return new NativeNumberFormat3(locales2, options);
18479
+ const formatter = createPortableNumberFormatter(locales2, options);
18480
+ portableFormatters.add(formatter);
18481
+ return formatter;
18511
18482
  }
18512
18483
  function numberFormatterOptions2(formatter) {
18513
- return portable === void 0 ? { ...formatter.resolvedOptions() } : portable.numberFormatterOptions(formatter);
18484
+ return portableFormatters.has(formatter) ? numberFormatterOptions(formatter) : { ...formatter.resolvedOptions() };
18514
18485
  }
18515
18486
  function numberFormatterResult2(formatter, method, values) {
18516
- return portable === void 0 ? Reflect.apply(Reflect.get(formatter, method), formatter, values) : portable.numberFormatterResult(formatter, method, values);
18487
+ return portableFormatters.has(formatter) ? numberFormatterResult(formatter, method, values) : Reflect.apply(Reflect.get(formatter, method), formatter, values);
18517
18488
  }
18518
18489
 
18519
18490
  // packages/safe-js/src/interp/intl-digit-options.ts
@@ -56735,4 +56706,4 @@ authorization of the copyright holder.
56735
56706
  SPDX-License-Identifier: Unicode-3.0
56736
56707
 
56737
56708
  */
56738
- //# sourceMappingURL=chunk-BNHG2QJQ.js.map
56709
+ //# sourceMappingURL=chunk-J72Q6BW5.js.map