@poe-platform/safe-js 0.1.727 → 0.1.729

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.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/dist/safe-js/chunks/{chunk-GZT57PW4.js → chunk-2S4YRXI6.js} +2 -2
  3. package/dist/safe-js/chunks/{chunk-EBNKJYZV.js → chunk-EA7AHM2X.js} +2 -2
  4. package/dist/safe-js/chunks/{chunk-EZEB4AIH.js → chunk-EN724VH3.js} +3 -3
  5. package/dist/safe-js/chunks/{chunk-4QDOJTAL.js → chunk-LRSWTDIV.js} +6 -5
  6. package/dist/safe-js/chunks/chunk-LRSWTDIV.js.map +7 -0
  7. package/dist/safe-js/chunks/{chunk-IZX26NC7.js → chunk-MRULOD5J.js} +2 -2
  8. package/dist/safe-js/chunks/{chunk-VW2VLHK2.js → chunk-MVLDRXWS.js} +2 -2
  9. package/dist/safe-js/chunks/{chunk-ZSIY6K54.js → chunk-S5YDMMM3.js} +64 -58
  10. package/dist/safe-js/chunks/{chunk-ZSIY6K54.js.map → chunk-S5YDMMM3.js.map} +3 -3
  11. package/dist/safe-js/chunks/{chunk-ZTKMQHXB.js → chunk-VIMROAQA.js} +2 -2
  12. package/dist/safe-js/chunks/{chunk-TFLQJ5NE.js → chunk-W3IY6FKO.js} +2 -2
  13. package/dist/safe-js/chunks/{chunk-RXESEKV6.js → chunk-XX57YCGZ.js} +6 -7
  14. package/dist/safe-js/chunks/chunk-XX57YCGZ.js.map +7 -0
  15. package/dist/safe-js/chunks/{cli-runtime-OZPDDD6M.js → cli-runtime-6VVBO2SS.js} +10 -10
  16. package/dist/safe-js/chunks/{dump-3TMEMH6D.js → dump-UNYK24YS.js} +3 -3
  17. package/dist/safe-js/chunks/{fs-YSBEA2WW.js → fs-AOV77RQC.js} +3 -3
  18. package/dist/safe-js/chunks/{harness-YC3FLN5N.js → harness-ZIEO7NAV.js} +3 -3
  19. package/dist/safe-js/chunks/{mcp-3GOG43VR.js → mcp-WBM7ZOAN.js} +3 -3
  20. package/dist/safe-js/chunks/{migration-file-IFKOIPNA.js → migration-file-3SWGNDS2.js} +4 -4
  21. package/dist/safe-js/chunks/{restore-ZOAQTM7X.js → restore-FCTWPLU3.js} +4 -4
  22. package/dist/safe-js/chunks/{run-XH62V323.js → run-ESJHEXCE.js} +6 -6
  23. package/dist/safe-js/chunks/{runtime-modules-BUR3QGOJ.js → runtime-modules-7V6BWCRK.js} +3 -3
  24. package/dist/safe-js/cli.js +2 -2
  25. package/dist/safe-js/core.js +5 -5
  26. package/dist/safe-js/index.js +11 -12
  27. package/dist/safe-js/index.js.map +2 -2
  28. package/package.json +3 -2
  29. package/dist/safe-js/chunks/chunk-4QDOJTAL.js.map +0 -7
  30. package/dist/safe-js/chunks/chunk-RXESEKV6.js.map +0 -7
  31. /package/dist/safe-js/chunks/{chunk-GZT57PW4.js.map → chunk-2S4YRXI6.js.map} +0 -0
  32. /package/dist/safe-js/chunks/{chunk-EBNKJYZV.js.map → chunk-EA7AHM2X.js.map} +0 -0
  33. /package/dist/safe-js/chunks/{chunk-EZEB4AIH.js.map → chunk-EN724VH3.js.map} +0 -0
  34. /package/dist/safe-js/chunks/{chunk-IZX26NC7.js.map → chunk-MRULOD5J.js.map} +0 -0
  35. /package/dist/safe-js/chunks/{chunk-VW2VLHK2.js.map → chunk-MVLDRXWS.js.map} +0 -0
  36. /package/dist/safe-js/chunks/{chunk-ZTKMQHXB.js.map → chunk-VIMROAQA.js.map} +0 -0
  37. /package/dist/safe-js/chunks/{chunk-TFLQJ5NE.js.map → chunk-W3IY6FKO.js.map} +0 -0
  38. /package/dist/safe-js/chunks/{cli-runtime-OZPDDD6M.js.map → cli-runtime-6VVBO2SS.js.map} +0 -0
  39. /package/dist/safe-js/chunks/{dump-3TMEMH6D.js.map → dump-UNYK24YS.js.map} +0 -0
  40. /package/dist/safe-js/chunks/{fs-YSBEA2WW.js.map → fs-AOV77RQC.js.map} +0 -0
  41. /package/dist/safe-js/chunks/{harness-YC3FLN5N.js.map → harness-ZIEO7NAV.js.map} +0 -0
  42. /package/dist/safe-js/chunks/{mcp-3GOG43VR.js.map → mcp-WBM7ZOAN.js.map} +0 -0
  43. /package/dist/safe-js/chunks/{migration-file-IFKOIPNA.js.map → migration-file-3SWGNDS2.js.map} +0 -0
  44. /package/dist/safe-js/chunks/{restore-ZOAQTM7X.js.map → restore-FCTWPLU3.js.map} +0 -0
  45. /package/dist/safe-js/chunks/{run-XH62V323.js.map → run-ESJHEXCE.js.map} +0 -0
  46. /package/dist/safe-js/chunks/{runtime-modules-BUR3QGOJ.js.map → runtime-modules-7V6BWCRK.js.map} +0 -0
@@ -1568,7 +1568,8 @@ async function invokeBuiltinClosure(closure, args, budget, context, thisValue, c
1568
1568
  }
1569
1569
 
1570
1570
  // packages/safe-js/src/interp/host-call.ts
1571
- import { createHash, randomUUID } from "node:crypto";
1571
+ import { sha256 } from "@noble/hashes/sha2.js";
1572
+ import { bytesToHex } from "@noble/hashes/utils.js";
1572
1573
 
1573
1574
  // packages/safe-js/src/interp/promise-tracker.ts
1574
1575
  import { AsyncLocalStorage as AsyncLocalStorage4 } from "node:async_hooks";
@@ -2091,7 +2092,7 @@ function restoreRegexProperties(value, data, decode) {
2091
2092
  }
2092
2093
 
2093
2094
  // packages/safe-js/src/snapshot/validation.ts
2094
- import { types as types21 } from "node:util";
2095
+ import { types as types20 } from "node:util";
2095
2096
 
2096
2097
  // packages/safe-js/src/parse/dynamic-source.ts
2097
2098
  function createModuleSource(body, owner) {
@@ -2481,7 +2482,6 @@ function sandboxDeleteProperty(value, key, budget, context) {
2481
2482
  }
2482
2483
 
2483
2484
  // packages/safe-js/src/interp/date.ts
2484
- import { types as types7 } from "node:util";
2485
2485
  var NativeDate = Date;
2486
2486
  var readTime = NativeDate.prototype.getTime;
2487
2487
  var writeTime = NativeDate.prototype.setTime;
@@ -2498,10 +2498,16 @@ function dateTime(value) {
2498
2498
  return Reflect.apply(readTime, value, []);
2499
2499
  }
2500
2500
  function copyNativeDate(value) {
2501
- if (!types7.isDate(value)) return void 0;
2501
+ if (typeof value !== "object" || value === null) return void 0;
2502
+ let time;
2503
+ try {
2504
+ time = Reflect.apply(readTime, value, []);
2505
+ } catch {
2506
+ return void 0;
2507
+ }
2502
2508
  if (Object.getPrototypeOf(value) !== NativeDate.prototype)
2503
2509
  throw new TypeError("Date subclasses are not supported.");
2504
- return createSandboxDate(dateTime(value));
2510
+ return createSandboxDate(time);
2505
2511
  }
2506
2512
  function exportDate(value) {
2507
2513
  return new NativeDate(dateTime(value));
@@ -2616,7 +2622,7 @@ function serializedDateTime(value) {
2616
2622
  }
2617
2623
 
2618
2624
  // packages/safe-js/src/interp/host-capabilities.ts
2619
- import { types as types8 } from "node:util";
2625
+ import { types as types7 } from "node:util";
2620
2626
  var MAX_INDEXED_LENGTH = 65536;
2621
2627
  var MAX_NAMED_KEYS = 65536;
2622
2628
  var MAX_NAMED_KEY_CODE_UNITS = 1048576;
@@ -2680,7 +2686,7 @@ function createLiveHostObject(definition, controller) {
2680
2686
  if (typeof data[key] !== "number" || !Number.isInteger(data[key]) || data[key] < 1 || data[key] > maximum)
2681
2687
  throw new RangeError(`Guest expando ${key} must be an integer from 1 to ${maximum}.`);
2682
2688
  }
2683
- if (data.assertActive !== void 0 && (typeof data.assertActive !== "function" || types8.isProxy(data.assertActive) || types8.isAsyncFunction(data.assertActive) || types8.isGeneratorFunction(data.assertActive)))
2689
+ if (data.assertActive !== void 0 && (typeof data.assertActive !== "function" || types7.isProxy(data.assertActive) || types7.isAsyncFunction(data.assertActive) || types7.isGeneratorFunction(data.assertActive)))
2684
2690
  throw new TypeError("Guest expando assertActive must be a synchronous function, not a proxy.");
2685
2691
  expandos = {
2686
2692
  // Owned writes invalidate descriptor projections; descendants stay live.
@@ -2715,7 +2721,7 @@ function createLiveHostObject(definition, controller) {
2715
2721
  for (const name of ["keys", "get", "set", "delete"]) {
2716
2722
  const operation = data[name];
2717
2723
  if (operation === void 0 && (name === "set" || name === "delete")) continue;
2718
- if (typeof operation !== "function" || types8.isProxy(operation) || types8.isAsyncFunction(operation) || types8.isGeneratorFunction(operation))
2724
+ if (typeof operation !== "function" || types7.isProxy(operation) || types7.isAsyncFunction(operation) || types7.isGeneratorFunction(operation))
2719
2725
  throw new TypeError(`Named ${name} must be a synchronous non-generator function, not a proxy.`);
2720
2726
  }
2721
2727
  if (typeof data.maxKeys !== "number" || !Number.isInteger(data.maxKeys) || data.maxKeys < 1 || data.maxKeys > MAX_NAMED_KEYS)
@@ -3014,7 +3020,7 @@ function namedMutationKeys(state, key, create3) {
3014
3020
  function namedKeys(state) {
3015
3021
  const named = state.named;
3016
3022
  return state.controller.read(named.keys, (value) => {
3017
- if (!Array.isArray(value) || types8.isProxy(value))
3023
+ if (!Array.isArray(value) || types7.isProxy(value))
3018
3024
  throw new TypeError("Named keys must be a dense own-data array of strings, not a proxy.");
3019
3025
  const length = Object.getOwnPropertyDescriptor(value, "length").value;
3020
3026
  if (length > named.maxKeys) throw new RangeError("Named keys exceed maxKeys.");
@@ -3051,7 +3057,7 @@ function expandoKeyUnits(key) {
3051
3057
  }
3052
3058
  function assertExpandoActive(state) {
3053
3059
  const result = state.expandos?.assertActive?.();
3054
- if (types8.isPromise(result)) void Promise.resolve(result).catch(() => void 0);
3060
+ if (types7.isPromise(result)) void Promise.resolve(result).catch(() => void 0);
3055
3061
  if (result !== void 0) throw new TypeError("Guest expando assertActive must return undefined.");
3056
3062
  }
3057
3063
  function validateExpandoKey(state, key, create3 = true) {
@@ -17762,7 +17768,7 @@ async function sandboxSetProperty(target, key, value, receiver, budget, context)
17762
17768
  }
17763
17769
 
17764
17770
  // packages/safe-js/src/interp/methods/string.ts
17765
- import { types as types10 } from "node:util";
17771
+ import { types as types9 } from "node:util";
17766
17772
 
17767
17773
  // packages/safe-js/src/interp/intl-collator.ts
17768
17774
  var NativeCollator = Intl.Collator;
@@ -17886,13 +17892,13 @@ async function createStringHtml(value, [tag, attribute], argument, budget, conte
17886
17892
  }
17887
17893
 
17888
17894
  // packages/safe-js/src/interp/methods/string-search.ts
17889
- import { types as types9 } from "node:util";
17895
+ import { types as types8 } from "node:util";
17890
17896
  async function callStringSearch(value, method, args, budget, context) {
17891
17897
  const search = args[0];
17892
17898
  let text;
17893
17899
  const release = retainValues(budget, () => [value, ...args, text]);
17894
17900
  try {
17895
- if (types9.isRegExp(search)) throw new TypeError("String search does not accept unbranded host RegExp values.");
17901
+ if (types8.isRegExp(search)) throw new TypeError("String search does not accept unbranded host RegExp values.");
17896
17902
  if (method !== "indexOf" && method !== "lastIndexOf" && search !== null && typeof search === "object") {
17897
17903
  const match = context?.getProperty !== void 0 ? await context.getProperty(search, Symbol.match) : await sandboxGetProperty(search, Symbol.match, search, budget, context);
17898
17904
  if (match === void 0 ? isSandboxRegex(search) : Boolean(match))
@@ -18046,7 +18052,7 @@ function callStringMethod(value, methodName, args, budget, callClosure = async (
18046
18052
  };
18047
18053
  const symbol = methodName === "match" ? Symbol.match : methodName === "search" ? Symbol.search : methodName === "matchAll" ? Symbol.matchAll : methodName === "replace" || methodName === "replaceAll" ? Symbol.replace : methodName === "split" ? Symbol.split : void 0;
18048
18054
  const pattern = args[0];
18049
- if (symbol !== void 0 && types10.isRegExp(pattern))
18055
+ if (symbol !== void 0 && types9.isRegExp(pattern))
18050
18056
  throw new TypeError(`String#${methodName} does not accept unbranded host RegExp values.`);
18051
18057
  if (symbol === void 0 || pattern === null || pattern === void 0) return fallback();
18052
18058
  const readProperty = (key) => context?.getProperty !== void 0 ? context.getProperty(pattern, key) : key === "flags" && isSandboxRegex(pattern) && getSandboxPropertyDescriptor(pattern, key, budget) === void 0 ? getRegexMember(pattern, key, budget, context) : getSandboxDataProperty(pattern, key, budget);
@@ -19005,7 +19011,7 @@ function formatNumber(value, methodName, argument, budget) {
19005
19011
  }
19006
19012
 
19007
19013
  // packages/safe-js/src/interp/host-bridge.ts
19008
- import { types as types19 } from "node:util";
19014
+ import { types as types18 } from "node:util";
19009
19015
 
19010
19016
  // packages/safe-js/src/interp/promise-state.ts
19011
19017
  var promiseStates = /* @__PURE__ */ new WeakMap();
@@ -19017,7 +19023,7 @@ var importedPromiseSnapshots = /* @__PURE__ */ new WeakMap();
19017
19023
  var moduleFunctionOrigins = /* @__PURE__ */ new WeakMap();
19018
19024
 
19019
19025
  // packages/safe-js/src/interp/temporal-instant.ts
19020
- import { types as types11 } from "node:util";
19026
+ import { types as types10 } from "node:util";
19021
19027
  import { Temporal as TemporalBackend } from "temporal-polyfill/full/implementation";
19022
19028
  var nativeTemporal = Object.getOwnPropertyDescriptor(globalThis, "Temporal")?.value;
19023
19029
  var NativeInstant = nativeTemporal !== null && typeof nativeTemporal === "object" ? Object.getOwnPropertyDescriptor(nativeTemporal, "Instant")?.value : void 0;
@@ -19034,7 +19040,7 @@ function createHostTemporalInstant(epoch) {
19034
19040
  return value;
19035
19041
  }
19036
19042
  function hostTemporalInstantEpoch(value) {
19037
- if (typeof value !== "object" || value === null || types11.isProxy(value)) return void 0;
19043
+ if (typeof value !== "object" || value === null || types10.isProxy(value)) return void 0;
19038
19044
  const prototype = Object.getPrototypeOf(value);
19039
19045
  const readEpoch = hostEpochReaders.get(prototype);
19040
19046
  if (readEpoch !== void 0) return Reflect.apply(readEpoch, value, []);
@@ -19062,7 +19068,7 @@ function temporalInstantEpoch(value) {
19062
19068
 
19063
19069
  // packages/safe-js/src/interp/temporal-duration.ts
19064
19070
  import { Temporal as TemporalBackend2 } from "temporal-polyfill/full/implementation";
19065
- import { types as types12 } from "node:util";
19071
+ import { types as types11 } from "node:util";
19066
19072
  var nativeTemporal2 = Object.getOwnPropertyDescriptor(globalThis, "Temporal")?.value;
19067
19073
  var NativeDuration = nativeTemporal2 !== null && typeof nativeTemporal2 === "object" ? Object.getOwnPropertyDescriptor(nativeTemporal2, "Duration")?.value : void 0;
19068
19074
  var HostDuration = NativeDuration ?? TemporalBackend2.Duration;
@@ -19089,7 +19095,7 @@ function createHostTemporalDuration(fields2) {
19089
19095
  return value;
19090
19096
  }
19091
19097
  function hostTemporalDurationFields(value) {
19092
- if (typeof value !== "object" || value === null || types12.isProxy(value)) return void 0;
19098
+ if (typeof value !== "object" || value === null || types11.isProxy(value)) return void 0;
19093
19099
  const prototype = Object.getPrototypeOf(value);
19094
19100
  let readers = hostFieldReaders.get(prototype);
19095
19101
  if (readers === void 0) {
@@ -19101,7 +19107,7 @@ function hostTemporalDurationFields(value) {
19101
19107
  }
19102
19108
  var durations = /* @__PURE__ */ new WeakMap();
19103
19109
  function createSandboxTemporalDuration(input = {}) {
19104
- if (input === null || typeof input !== "object" || types12.isProxy(input))
19110
+ if (input === null || typeof input !== "object" || types11.isProxy(input))
19105
19111
  throw new TypeError("Duration fields must be an ordinary data record.");
19106
19112
  const fields2 = /* @__PURE__ */ Object.create(null);
19107
19113
  let sign = 0;
@@ -19141,7 +19147,7 @@ function temporalDurationFields(value) {
19141
19147
  }
19142
19148
 
19143
19149
  // packages/safe-js/src/interp/temporal-plain-time.ts
19144
- import { types as types13 } from "node:util";
19150
+ import { types as types12 } from "node:util";
19145
19151
  import { Temporal as TemporalBackend3 } from "temporal-polyfill/full/implementation";
19146
19152
  var timeFieldLimits = { hour: 24, minute: 60, second: 60, millisecond: 1e3, microsecond: 1e3, nanosecond: 1e3 };
19147
19153
  var temporalPlainTimeFieldNames = Object.freeze(Object.keys(timeFieldLimits));
@@ -19159,7 +19165,7 @@ function createHostTemporalPlainTime(fields2) {
19159
19165
  return value;
19160
19166
  }
19161
19167
  function hostTemporalPlainTimeFields(value) {
19162
- if (typeof value !== "object" || value === null || types13.isProxy(value)) return void 0;
19168
+ if (typeof value !== "object" || value === null || types12.isProxy(value)) return void 0;
19163
19169
  const prototype = Object.getPrototypeOf(value);
19164
19170
  let readers = hostFieldReaders2.get(prototype);
19165
19171
  if (readers === void 0) {
@@ -19171,7 +19177,7 @@ function hostTemporalPlainTimeFields(value) {
19171
19177
  }
19172
19178
  var times = /* @__PURE__ */ new WeakMap();
19173
19179
  function createSandboxTemporalPlainTime(input = {}) {
19174
- if (input === null || typeof input !== "object" || types13.isProxy(input))
19180
+ if (input === null || typeof input !== "object" || types12.isProxy(input))
19175
19181
  throw new TypeError("PlainTime fields must be an ordinary data record.");
19176
19182
  const fields2 = /* @__PURE__ */ Object.create(null);
19177
19183
  for (const name of temporalPlainTimeFieldNames) {
@@ -19197,7 +19203,7 @@ function temporalPlainTimeFields(value) {
19197
19203
  }
19198
19204
 
19199
19205
  // packages/safe-js/src/interp/temporal-plain-date-time.ts
19200
- import { types as types14 } from "node:util";
19206
+ import { types as types13 } from "node:util";
19201
19207
  import { Temporal as Backend } from "temporal-polyfill/full/implementation";
19202
19208
  var temporalPlainDateTimeNumericFields = Object.freeze([
19203
19209
  "isoYear",
@@ -19229,7 +19235,7 @@ function createHostTemporalPlainDateTime(fields2) {
19229
19235
  return value;
19230
19236
  }
19231
19237
  function hostTemporalPlainDateTimeFields(value) {
19232
- if (value === null || typeof value !== "object" || types14.isProxy(value)) return void 0;
19238
+ if (value === null || typeof value !== "object" || types13.isProxy(value)) return void 0;
19233
19239
  const prototype = Object.getPrototypeOf(value);
19234
19240
  let readers = hostReaders.get(prototype);
19235
19241
  if (readers === void 0) {
@@ -19244,7 +19250,7 @@ function hostTemporalPlainDateTimeFields(value) {
19244
19250
  });
19245
19251
  }
19246
19252
  function createSandboxTemporalPlainDateTime(input) {
19247
- if (input === null || typeof input !== "object" || types14.isProxy(input))
19253
+ if (input === null || typeof input !== "object" || types13.isProxy(input))
19248
19254
  throw new TypeError("PlainDateTime fields must be an ordinary data record.");
19249
19255
  const fields2 = /* @__PURE__ */ Object.create(null);
19250
19256
  for (const [index, name] of temporalPlainDateTimeNumericFields.entries()) {
@@ -19285,7 +19291,7 @@ function temporalPlainDateTimeFields(value) {
19285
19291
  }
19286
19292
 
19287
19293
  // packages/safe-js/src/interp/temporal-plain-date.ts
19288
- import { types as types15 } from "node:util";
19294
+ import { types as types14 } from "node:util";
19289
19295
  import { Temporal as Backend2 } from "temporal-polyfill/full/implementation";
19290
19296
  var temporalPlainDateNumericFields = Object.freeze(["isoYear", "isoMonth", "isoDay"]);
19291
19297
  var dates2 = /* @__PURE__ */ new WeakMap();
@@ -19304,7 +19310,7 @@ function createHostTemporalPlainDate(fields2) {
19304
19310
  return value;
19305
19311
  }
19306
19312
  function hostTemporalPlainDateFields(value) {
19307
- if (value === null || typeof value !== "object" || types15.isProxy(value)) return void 0;
19313
+ if (value === null || typeof value !== "object" || types14.isProxy(value)) return void 0;
19308
19314
  const prototype = Object.getPrototypeOf(value);
19309
19315
  let readers = hostReaders2.get(prototype);
19310
19316
  if (readers === void 0) {
@@ -19319,7 +19325,7 @@ function hostTemporalPlainDateFields(value) {
19319
19325
  });
19320
19326
  }
19321
19327
  function createSandboxTemporalPlainDate(input) {
19322
- if (input === null || typeof input !== "object" || types15.isProxy(input))
19328
+ if (input === null || typeof input !== "object" || types14.isProxy(input))
19323
19329
  throw new TypeError("PlainDate fields must be an ordinary data record.");
19324
19330
  const fields2 = /* @__PURE__ */ Object.create(null);
19325
19331
  for (const name of temporalPlainDateNumericFields) {
@@ -19353,7 +19359,7 @@ function temporalPlainDateFields(value) {
19353
19359
  }
19354
19360
 
19355
19361
  // packages/safe-js/src/interp/temporal-plain-month-day.ts
19356
- import { types as types16 } from "node:util";
19362
+ import { types as types15 } from "node:util";
19357
19363
  import { Temporal as Backend3 } from "temporal-polyfill/full/implementation";
19358
19364
  var monthDays = /* @__PURE__ */ new WeakMap();
19359
19365
  var nativeTemporal6 = Object.getOwnPropertyDescriptor(globalThis, "Temporal")?.value;
@@ -19368,7 +19374,7 @@ function createHostTemporalPlainMonthDay(fields2) {
19368
19374
  return value;
19369
19375
  }
19370
19376
  function hostTemporalPlainMonthDayFields(value) {
19371
- if (value === null || typeof value !== "object" || types16.isProxy(value)) return void 0;
19377
+ if (value === null || typeof value !== "object" || types15.isProxy(value)) return void 0;
19372
19378
  const prototype = Object.getPrototypeOf(value);
19373
19379
  let format5 = hostFormatters.get(prototype);
19374
19380
  if (format5 === void 0) {
@@ -19380,7 +19386,7 @@ function hostTemporalPlainMonthDayFields(value) {
19380
19386
  return hostTemporalPlainDateFields(Reflect.apply(dateFrom, Backend3.PlainDate, [text]));
19381
19387
  }
19382
19388
  function createSandboxTemporalPlainMonthDay(input) {
19383
- if (input === null || typeof input !== "object" || types16.isProxy(input))
19389
+ if (input === null || typeof input !== "object" || types15.isProxy(input))
19384
19390
  throw new TypeError("PlainMonthDay fields must be an ordinary data record.");
19385
19391
  const fields2 = /* @__PURE__ */ Object.create(null);
19386
19392
  for (const name of temporalPlainDateNumericFields) {
@@ -19414,7 +19420,7 @@ function temporalPlainMonthDayFields(value) {
19414
19420
  }
19415
19421
 
19416
19422
  // packages/safe-js/src/interp/temporal-plain-year-month.ts
19417
- import { types as types17 } from "node:util";
19423
+ import { types as types16 } from "node:util";
19418
19424
  import { Temporal as Backend4 } from "temporal-polyfill/full/implementation";
19419
19425
  var yearMonths = /* @__PURE__ */ new WeakMap();
19420
19426
  var nativeTemporal7 = Object.getOwnPropertyDescriptor(globalThis, "Temporal")?.value;
@@ -19431,7 +19437,7 @@ function createHostTemporalPlainYearMonth(fields2) {
19431
19437
  return value;
19432
19438
  }
19433
19439
  function hostTemporalPlainYearMonthFields(value) {
19434
- if (value === null || typeof value !== "object" || types17.isProxy(value)) return void 0;
19440
+ if (value === null || typeof value !== "object" || types16.isProxy(value)) return void 0;
19435
19441
  const prototype = Object.getPrototypeOf(value);
19436
19442
  let readers = hostReaders3.get(prototype);
19437
19443
  if (readers === void 0) {
@@ -19449,7 +19455,7 @@ function hostTemporalPlainYearMonthFields(value) {
19449
19455
  };
19450
19456
  }
19451
19457
  function createSandboxTemporalPlainYearMonth(input) {
19452
- if (input === null || typeof input !== "object" || types17.isProxy(input))
19458
+ if (input === null || typeof input !== "object" || types16.isProxy(input))
19453
19459
  throw new TypeError("PlainYearMonth fields must be an ordinary data record.");
19454
19460
  const fields2 = /* @__PURE__ */ Object.create(null);
19455
19461
  for (const name of temporalPlainDateNumericFields) {
@@ -19483,7 +19489,7 @@ function temporalPlainYearMonthFields(value) {
19483
19489
  }
19484
19490
 
19485
19491
  // packages/safe-js/src/interp/temporal-zoned-date-time.ts
19486
- import { types as types18 } from "node:util";
19492
+ import { types as types17 } from "node:util";
19487
19493
  import { Temporal as Backend5 } from "temporal-polyfill/full/implementation";
19488
19494
  var dates3 = /* @__PURE__ */ new WeakMap();
19489
19495
  var nativeTemporal8 = Object.getOwnPropertyDescriptor(globalThis, "Temporal")?.value;
@@ -19501,7 +19507,7 @@ function createHostTemporalZonedDateTime(fields2) {
19501
19507
  return value;
19502
19508
  }
19503
19509
  function hostTemporalZonedDateTimeFields(value) {
19504
- if (value === null || typeof value !== "object" || types18.isProxy(value)) return void 0;
19510
+ if (value === null || typeof value !== "object" || types17.isProxy(value)) return void 0;
19505
19511
  const prototype = Object.getPrototypeOf(value);
19506
19512
  let readers = hostReaders4.get(prototype);
19507
19513
  if (readers === void 0) {
@@ -19516,7 +19522,7 @@ function hostTemporalZonedDateTimeFields(value) {
19516
19522
  }));
19517
19523
  }
19518
19524
  function createSandboxTemporalZonedDateTime(input) {
19519
- if (input === null || typeof input !== "object" || types18.isProxy(input))
19525
+ if (input === null || typeof input !== "object" || types17.isProxy(input))
19520
19526
  throw new TypeError("ZonedDateTime fields must be an ordinary data record.");
19521
19527
  const epoch = Object.getOwnPropertyDescriptor(input, "epochNanoseconds");
19522
19528
  const zone = Object.getOwnPropertyDescriptor(input, "timeZone");
@@ -22318,7 +22324,7 @@ function executeHostCall(record4, restored, invoke, stackFrames, options, span,
22318
22324
  try {
22319
22325
  result = invoke();
22320
22326
  } catch (error) {
22321
- if (!types19.isProxy(error) && error instanceof HostCallResumabilityError) {
22327
+ if (!types18.isProxy(error) && error instanceof HostCallResumabilityError) {
22322
22328
  throw error;
22323
22329
  }
22324
22330
  const reason = createHostErrorValue(error, stackFrames, options.budget, span);
@@ -22418,8 +22424,8 @@ function copyHostResultToSandbox(result, stackFrames, options) {
22418
22424
  return value;
22419
22425
  }
22420
22426
  function createHostErrorValue(reason, stackFrames, budget, span, state = { seen: /* @__PURE__ */ new WeakMap() }, chargeBudget = false) {
22421
- const proxy = types19.isProxy(reason);
22422
- const nativeError = !proxy && (types19.isNativeError(reason) || reason instanceof Error);
22427
+ const proxy = types18.isProxy(reason);
22428
+ const nativeError = !proxy && (types18.isNativeError(reason) || reason instanceof Error);
22423
22429
  if (nativeError) {
22424
22430
  const existing = state.seen.get(reason);
22425
22431
  if (existing !== void 0) return existing;
@@ -22459,7 +22465,7 @@ function createHostErrorValue(reason, stackFrames, budget, span, state = { seen:
22459
22465
  }
22460
22466
  function readHostErrorDiagnostic(error, key, fallback) {
22461
22467
  let current = error;
22462
- while (current !== null && !types19.isProxy(current)) {
22468
+ while (current !== null && !types18.isProxy(current)) {
22463
22469
  const descriptor = Object.getOwnPropertyDescriptor(current, key);
22464
22470
  if (descriptor !== void 0) {
22465
22471
  if (descriptor.get !== void 0 && descriptor.get === domExceptionDiagnostics[key]) {
@@ -22642,7 +22648,7 @@ function isPromiseLike2(value) {
22642
22648
  return typeof value === "object" && value !== null && "then" in value;
22643
22649
  }
22644
22650
  function isFatalBridgeError(error) {
22645
- return !types19.isProxy(error) && (error instanceof HostCallResumabilityError || error instanceof SandboxError && (error.code === "budgetExceeded" || error.code === "reentry"));
22651
+ return !types18.isProxy(error) && (error instanceof HostCallResumabilityError || error instanceof SandboxError && (error.code === "budgetExceeded" || error.code === "reentry"));
22646
22652
  }
22647
22653
  function wrapHostPromiseWithSignal(promise, signal) {
22648
22654
  if (signal === void 0) {
@@ -22698,7 +22704,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
22698
22704
  if (value.description !== void 0) budget.allocateString(value.description);
22699
22705
  return value;
22700
22706
  }
22701
- if (types19.isNativeError(value) || value instanceof Error) {
22707
+ if (types18.isNativeError(value) || value instanceof Error) {
22702
22708
  return createHostErrorValue(value, stackFrames, budget, void 0, state, true);
22703
22709
  }
22704
22710
  if (options.errorData && (typeof value === "function" || isSandboxClosure(value) || isSandboxPromise(value) || value instanceof Promise)) {
@@ -22734,7 +22740,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
22734
22740
  }
22735
22741
  return deepCopyToSandbox(value);
22736
22742
  }
22737
- if (isSandboxRegex(value) || types19.isRegExp(value)) {
22743
+ if (isSandboxRegex(value) || types18.isRegExp(value)) {
22738
22744
  const existing = state.seen.get(value);
22739
22745
  if (existing !== void 0) return existing;
22740
22746
  const sandbox = isSandboxRegex(value);
@@ -22955,8 +22961,8 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
22955
22961
  const promiseIdentities = state.promiseIdentities ??= /* @__PURE__ */ new WeakMap();
22956
22962
  const existing = state.seen.get(value) ?? promiseIdentities.get(value);
22957
22963
  if (existing !== void 0) return existing;
22958
- const descriptors2 = types19.isPromise(value) ? nativePromiseDataProperties(value) : [];
22959
- const observed = types19.isPromise(value) ? Reflect.apply(Promise.prototype.then, value, [(settled) => settled]) : Promise.resolve(value);
22964
+ const descriptors2 = types18.isPromise(value) ? nativePromiseDataProperties(value) : [];
22965
+ const observed = types18.isPromise(value) ? Reflect.apply(Promise.prototype.then, value, [(settled) => settled]) : Promise.resolve(value);
22960
22966
  const promise = wrapHostPromiseWithSignal(observed, options.signal).then(
22961
22967
  (resolved) => {
22962
22968
  try {
@@ -22988,7 +22994,7 @@ function copyHostValueToSandbox(value, stackFrames, options, state, path) {
22988
22994
  importedPromises.add(sandboxPromise);
22989
22995
  state.seen.set(value, sandboxPromise);
22990
22996
  promiseIdentities.set(value, sandboxPromise);
22991
- if (types19.isPromise(value)) {
22997
+ if (types18.isPromise(value)) {
22992
22998
  const properties = getPromiseProperties(sandboxPromise);
22993
22999
  const hasSymbols = descriptors2.some(([key]) => typeof key === "symbol");
22994
23000
  for (const [index, [key, descriptor]] of descriptors2.entries()) {
@@ -23213,7 +23219,7 @@ function describeThrownReason(reason) {
23213
23219
  return "Host operation failed.";
23214
23220
  }
23215
23221
  function readStringProperty(value, key) {
23216
- if (types19.isProxy(value)) return void 0;
23222
+ if (types18.isProxy(value)) return void 0;
23217
23223
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
23218
23224
  return descriptor !== void 0 && "value" in descriptor && typeof descriptor.value === "string" ? descriptor.value : void 0;
23219
23225
  }
@@ -23557,7 +23563,7 @@ async function callSetMethod(target, methodName, args, options, stack = []) {
23557
23563
  }
23558
23564
 
23559
23565
  // packages/safe-js/src/interp/globals/error.ts
23560
- import { types as types20 } from "node:util";
23566
+ import { types as types19 } from "node:util";
23561
23567
  var errorConstructorNames = /* @__PURE__ */ new WeakMap();
23562
23568
  var errorNames = [
23563
23569
  "Error",
@@ -23637,7 +23643,7 @@ function createErrorPrototypes(budget, constructors2) {
23637
23643
  sandbox: true,
23638
23644
  name: "isError",
23639
23645
  length: 1,
23640
- call: ([value]) => typeof value === "object" && value !== null && (sandboxErrorTypes.has(value) || types20.isNativeError(value))
23646
+ call: ([value]) => typeof value === "object" && value !== null && (sandboxErrorTypes.has(value) || types19.isNativeError(value))
23641
23647
  });
23642
23648
  Object.defineProperty(materializeFunctionProperties(constructors2.Error), "isError", {
23643
23649
  value: isError,
@@ -43079,7 +43085,7 @@ function validateDumpEnvelope(snapshot, options = {}) {
43079
43085
  dataPrototypes: /* @__PURE__ */ new WeakSet()
43080
43086
  };
43081
43087
  if (canPreflightRunSnapshotScalars(root)) validateRunSnapshotScalars(root);
43082
- if (types21.isProxy(root)) fail("invalidType", "$", "proxy objects are not snapshot data");
43088
+ if (types20.isProxy(root)) fail("invalidType", "$", "proxy objects are not snapshot data");
43083
43089
  snapshotDataEntries(root, "$", state.dataPrototypes);
43084
43090
  if (root.version !== 1 && root.version !== DUMP_FORMAT_VERSION) {
43085
43091
  fail("unsupportedVersion", "$.version", `expected ${DUMP_FORMAT_VERSION}`);
@@ -43257,7 +43263,7 @@ function validateDumpReferences(value, path, depth, state, heapIds, heap, role =
43257
43263
  }
43258
43264
  }
43259
43265
  function hasPlainDataFields(value, keys) {
43260
- if (value === null || typeof value !== "object" || types21.isProxy(value)) return false;
43266
+ if (value === null || typeof value !== "object" || types20.isProxy(value)) return false;
43261
43267
  const prototype = Object.getPrototypeOf(value);
43262
43268
  if (prototype !== null && prototype !== Object.prototype) return false;
43263
43269
  return keys.every((key) => {
@@ -43644,7 +43650,7 @@ function validateArgumentsProperties(record4, path) {
43644
43650
  }
43645
43651
  }
43646
43652
  function validateSnapshotProxy(value, path, dataPropertiesOnly = false) {
43647
- if (!types21.isProxy(value)) return;
43653
+ if (!types20.isProxy(value)) return;
43648
43654
  if (!dataPropertiesOnly && isTrackedIntrinsicObject(value)) {
43649
43655
  const prototype = Object.getPrototypeOf(value);
43650
43656
  if (prototype !== null && prototype !== (Array.isArray(value) ? Array.prototype : Object.prototype))
@@ -44339,7 +44345,7 @@ var HostCallJournal = class {
44339
44345
  compilation,
44340
44346
  reachableSchedulingIds
44341
44347
  );
44342
- const restoredRunId = replayRecords[0]?.runId ?? records2[0]?.runId ?? randomUUID();
44348
+ const restoredRunId = replayRecords[0]?.runId ?? records2[0]?.runId ?? globalThis.crypto.randomUUID();
44343
44349
  validateRestoredRecords(records2, restoredRunId, sourceHash);
44344
44350
  for (const record4 of records2) {
44345
44351
  const replayRecord = replayRecords[readCallOrdinal(record4) - 1];
@@ -44363,7 +44369,7 @@ var HostCallJournal = class {
44363
44369
  }
44364
44370
  }
44365
44371
  }
44366
- this.runId = records2[0]?.runId ?? randomUUID();
44372
+ this.runId = records2[0]?.runId ?? globalThis.crypto.randomUUID();
44367
44373
  this.records = records2.map((record4) => ({
44368
44374
  ...record4,
44369
44375
  ...record4.functions === void 0 ? {} : { functions: [...record4.functions] },
@@ -45351,7 +45357,7 @@ function callIdentityMatches(record4, input) {
45351
45357
  return record4.moduleId === input.moduleId && record4.operation === input.operation && record4.argumentDigest === input.argumentDigest && record4.policy === input.policy;
45352
45358
  }
45353
45359
  function digestHostCallArguments(args, sharedArguments) {
45354
- return createHash("sha256").update(stableStringify(args, sharedArguments)).digest("hex");
45360
+ return bytesToHex(sha256(new TextEncoder().encode(stableStringify(args, sharedArguments))));
45355
45361
  }
45356
45362
  function validateProof(record4, proof) {
45357
45363
  if (proof.callbackDisposition !== void 0 && proof.callbackDisposition !== "joined" && proof.callbackDisposition !== "detached") {
@@ -49380,4 +49386,4 @@ authorization of the copyright holder.
49380
49386
  SPDX-License-Identifier: Unicode-3.0
49381
49387
 
49382
49388
  */
49383
- //# sourceMappingURL=chunk-ZSIY6K54.js.map
49389
+ //# sourceMappingURL=chunk-S5YDMMM3.js.map