@volter/browser-substrate 0.1.127 → 0.1.129

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 (76) hide show
  1. package/catalog/demand-input.json +53 -9
  2. package/catalog/published/profile.json +2 -2
  3. package/catalog/published/v1/artifacts/sha256/{1b9cf40b5fef1c5374163ef2113b3fb88f2ad42f1752dfca781fae19ce544d69 → 32a8577df160e6794769c43d32445e853901d13d523855834805f1b6c4e5b053} +291 -53
  4. package/catalog/published/v1/artifacts/sha256/{68562d9fa805450067cea188524d9f77406e42ce68a7f0f8e4487e422396d589 → 93be686b8b14eed59209c90575a3b0655f3b17b5dfee29bd14b5882e062f2f10} +1 -1
  5. package/catalog/published/v1/artifacts/sha256/{89a8b4623bc8d6a2ecd821119319bf81698dcad2cfbfd887f6a74e0ea0430f7f → dc314a5ae4e558ffed2223c92f35c37723de8ddf6f4d3b2ef391ee9d8f58b549} +0 -0
  6. package/catalog/published/v1/catalog.json +1 -1
  7. package/catalog/published/v1/catalogs/sha256/05968a229c8b3f8b54472842cf7fae36c242e29640c4bfdf4d016f544e56b081.json +1 -0
  8. package/catalog/published/v1/locks/sha256/3af9719f621c03e2a83da6c80d536a57cd3c6d0f0086cb951e0724da5711a37f.json +1 -0
  9. package/catalog/published/v1/locks/sha256/46706b8187f0bc2e5a40055a3ba4ca0af53efaea0fb7e5f2a45aa0b3fb959faa.json +1 -0
  10. package/catalog/published/v1/locks/sha256/5ad4971c6f31ba268b128955c90e1d90e9a01e5a3b06b34bdc214b96c8e40ea5.json +1 -0
  11. package/catalog/published/v1/locks/sha256/6ac7186f41b59833aa65e351ecf9427560505d3ccef7e0b7ed5d6b250d390830.json +1 -0
  12. package/catalog/published/v1/locks/sha256/6b19bd70f36722fb59cca788571fc2f39bdfef8c66fcfb3e09812d0abb75ef06.json +1 -0
  13. package/catalog/published/v1/locks/sha256/9f73e95455430082578e89f268afc8a9a98da1944fd69f54eb34fba5e4fc5ec6.json +1 -0
  14. package/catalog/published/v1/locks/sha256/aec5bc93f553bda0a67a18ba4413f4888bf37c6d5537355183152bdc662e467f.json +1 -0
  15. package/catalog/published/v1/locks/sha256/d0e7453e575b97ef49eda7af47be404cffed6305c7af65f0455391678e273fa1.json +1 -0
  16. package/catalog/published/v1/manifests/sha256/{30a3824e931aa35be70ffa821016a0e56f908b45aece725c40eef246680bb740.json → 135f0815dd73f023f167b42f6d4f83942921f5aedc3afd93c42e0ce3e33a942e.json} +1 -1
  17. package/catalog/published/v1/manifests/sha256/{11432ade27d2116b5c3026b6de4d6e8b10fd9655faf129425ad25e418cfcbe82.json → 1ec163cd43f374f601bd5c83a775779b96e59b696f2da5e83010f6c567493ab8.json} +1 -1
  18. package/catalog/published/v1/manifests/sha256/{3645cb8a9e31c0a28c155c0253cd41facc25457c1be5b8a5e1770932f0277c16.json → 43669217dada42ee14ce61e846cac029faeb4644149494ff6c71f4cc71ddf8dc.json} +1 -1
  19. package/catalog/published/v1/manifests/sha256/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51.json → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc.json} +1 -1
  20. package/catalog/published/v1/manifests/sha256/{e86de6ca9b27bcdc9c07c93f9692fe28ba48d2f2c1c654b02ea0abc8d0bd4a38.json → 94c1b8dbe2955e9f18d8ee7d6c2e5e053ac73ccfb9aaa4d6ea6657c1ff7dcb59.json} +1 -1
  21. package/catalog/published/v1/manifests/sha256/{1161ec6314238aa01c0d597718e18004a93203fd593835a3b48c086cf234ece7.json → 96c969923eb2e9dc2b9c78caac030cd76e94d1b514a4dcd4633899cebfa0d417.json} +1 -1
  22. package/catalog/published/v1/manifests/sha256/{8b6b3b8879df28fc4be628f86828940b3d20fda9ea1d6b84539033ca70a45c22.json → d29e6bbb3868157482ba637ecf76ce325e555883c4a950f90f04a2d06cfb1c96.json} +1 -1
  23. package/catalog/published/v1/manifests/sha256/{79c94079acafe68ae500563ac51fb8f65a152b3f31f8daca0254d65309098e58.json → e0a8fbd45b37daeb9063f193c96fbb8a597d8b9d801a84ddd119b69de15dae28.json} +1 -1
  24. package/dist/shell/assets/{node-execution-worker-b9ff60e496948d07.js → node-execution-worker-5794fb3c5541adf1.js} +19 -19
  25. package/dist/shell/assets/{runtime-worker-Dq5ipPG1.js → runtime-worker-DbsIaU2Q.js} +284 -46
  26. package/dist/shell/bundler-worker.js +11 -11
  27. package/dist/shell/node-execution-worker.js +1 -1
  28. package/package.json +1 -1
  29. package/catalog/published/v1/catalogs/sha256/b1cc6336b2f1002389365f0968a6eda9e27a7a5e2be6104f2c1c89ed2f26deef.json +0 -1
  30. package/catalog/published/v1/locks/sha256/0b0b4f610d3f1629e827fc1d59ed1ebf6ecc4555a47110f187c345b571621c40.json +0 -1
  31. package/catalog/published/v1/locks/sha256/197dee49bc598a979621159787b42389b4bb8efcfd6a98ba9fcdd15a69298444.json +0 -1
  32. package/catalog/published/v1/locks/sha256/5387bfcf58728267c5dcf5a82f229c27ca1f224af0425a197527e87a7d182241.json +0 -1
  33. package/catalog/published/v1/locks/sha256/55091d280ae4afd09819ab1f5d93b84177d5944cf9d059762fb89c90dbc7de08.json +0 -1
  34. package/catalog/published/v1/locks/sha256/7b1feb239590f2d12fca03c73b8b6dee8d18c1444e56eb9ba76aa921e6f27cc2.json +0 -1
  35. package/catalog/published/v1/locks/sha256/94335db9d1593480fe13279472183eb7c56ba5b51b6b69d69eef9cb6fd2f9cea.json +0 -1
  36. package/catalog/published/v1/locks/sha256/d0868c7ebe77418437e41d8369925be3726528c57efa820ef5364964ec3212f5.json +0 -1
  37. package/catalog/published/v1/locks/sha256/fc9917d01ec1bb8806f5a82102f25f612013a14bfa60e404283edbf43308ef8a.json +0 -1
  38. /package/catalog/published/v1/artifacts/sha256/{1b9cf40b5fef1c5374163ef2113b3fb88f2ad42f1752dfca781fae19ce544d69.headers.json → 32a8577df160e6794769c43d32445e853901d13d523855834805f1b6c4e5b053.headers.json} +0 -0
  39. /package/catalog/published/v1/artifacts/sha256/{68562d9fa805450067cea188524d9f77406e42ce68a7f0f8e4487e422396d589.headers.json → 93be686b8b14eed59209c90575a3b0655f3b17b5dfee29bd14b5882e062f2f10.headers.json} +0 -0
  40. /package/catalog/published/v1/artifacts/sha256/{89a8b4623bc8d6a2ecd821119319bf81698dcad2cfbfd887f6a74e0ea0430f7f.headers.json → dc314a5ae4e558ffed2223c92f35c37723de8ddf6f4d3b2ef391ee9d8f58b549.headers.json} +0 -0
  41. /package/catalog/published/v1/catalogs/sha256/{b1cc6336b2f1002389365f0968a6eda9e27a7a5e2be6104f2c1c89ed2f26deef.json.headers.json → 05968a229c8b3f8b54472842cf7fae36c242e29640c4bfdf4d016f544e56b081.json.headers.json} +0 -0
  42. /package/catalog/published/v1/locks/sha256/{0b0b4f610d3f1629e827fc1d59ed1ebf6ecc4555a47110f187c345b571621c40.json.headers.json → 3af9719f621c03e2a83da6c80d536a57cd3c6d0f0086cb951e0724da5711a37f.json.headers.json} +0 -0
  43. /package/catalog/published/v1/locks/sha256/{197dee49bc598a979621159787b42389b4bb8efcfd6a98ba9fcdd15a69298444.json.headers.json → 46706b8187f0bc2e5a40055a3ba4ca0af53efaea0fb7e5f2a45aa0b3fb959faa.json.headers.json} +0 -0
  44. /package/catalog/published/v1/locks/sha256/{5387bfcf58728267c5dcf5a82f229c27ca1f224af0425a197527e87a7d182241.json.headers.json → 5ad4971c6f31ba268b128955c90e1d90e9a01e5a3b06b34bdc214b96c8e40ea5.json.headers.json} +0 -0
  45. /package/catalog/published/v1/locks/sha256/{55091d280ae4afd09819ab1f5d93b84177d5944cf9d059762fb89c90dbc7de08.json.headers.json → 6ac7186f41b59833aa65e351ecf9427560505d3ccef7e0b7ed5d6b250d390830.json.headers.json} +0 -0
  46. /package/catalog/published/v1/locks/sha256/{7b1feb239590f2d12fca03c73b8b6dee8d18c1444e56eb9ba76aa921e6f27cc2.json.headers.json → 6b19bd70f36722fb59cca788571fc2f39bdfef8c66fcfb3e09812d0abb75ef06.json.headers.json} +0 -0
  47. /package/catalog/published/v1/locks/sha256/{94335db9d1593480fe13279472183eb7c56ba5b51b6b69d69eef9cb6fd2f9cea.json.headers.json → 9f73e95455430082578e89f268afc8a9a98da1944fd69f54eb34fba5e4fc5ec6.json.headers.json} +0 -0
  48. /package/catalog/published/v1/locks/sha256/{d0868c7ebe77418437e41d8369925be3726528c57efa820ef5364964ec3212f5.json.headers.json → aec5bc93f553bda0a67a18ba4413f4888bf37c6d5537355183152bdc662e467f.json.headers.json} +0 -0
  49. /package/catalog/published/v1/locks/sha256/{fc9917d01ec1bb8806f5a82102f25f612013a14bfa60e404283edbf43308ef8a.json.headers.json → d0e7453e575b97ef49eda7af47be404cffed6305c7af65f0455391678e273fa1.json.headers.json} +0 -0
  50. /package/catalog/published/v1/manifests/sha256/{11432ade27d2116b5c3026b6de4d6e8b10fd9655faf129425ad25e418cfcbe82.json.headers.json → 135f0815dd73f023f167b42f6d4f83942921f5aedc3afd93c42e0ce3e33a942e.json.headers.json} +0 -0
  51. /package/catalog/published/v1/manifests/sha256/{1161ec6314238aa01c0d597718e18004a93203fd593835a3b48c086cf234ece7.json.headers.json → 1ec163cd43f374f601bd5c83a775779b96e59b696f2da5e83010f6c567493ab8.json.headers.json} +0 -0
  52. /package/catalog/published/v1/manifests/sha256/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51.json.headers.json → 43669217dada42ee14ce61e846cac029faeb4644149494ff6c71f4cc71ddf8dc.json.headers.json} +0 -0
  53. /package/catalog/published/v1/manifests/sha256/{30a3824e931aa35be70ffa821016a0e56f908b45aece725c40eef246680bb740.json.headers.json → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc.json.headers.json} +0 -0
  54. /package/catalog/published/v1/manifests/sha256/{3645cb8a9e31c0a28c155c0253cd41facc25457c1be5b8a5e1770932f0277c16.json.headers.json → 94c1b8dbe2955e9f18d8ee7d6c2e5e053ac73ccfb9aaa4d6ea6657c1ff7dcb59.json.headers.json} +0 -0
  55. /package/catalog/published/v1/manifests/sha256/{79c94079acafe68ae500563ac51fb8f65a152b3f31f8daca0254d65309098e58.json.headers.json → 96c969923eb2e9dc2b9c78caac030cd76e94d1b514a4dcd4633899cebfa0d417.json.headers.json} +0 -0
  56. /package/catalog/published/v1/manifests/sha256/{8b6b3b8879df28fc4be628f86828940b3d20fda9ea1d6b84539033ca70a45c22.json.headers.json → d29e6bbb3868157482ba637ecf76ce325e555883c4a950f90f04a2d06cfb1c96.json.headers.json} +0 -0
  57. /package/catalog/published/v1/manifests/sha256/{e86de6ca9b27bcdc9c07c93f9692fe28ba48d2f2c1c654b02ea0abc8d0bd4a38.json.headers.json → e0a8fbd45b37daeb9063f193c96fbb8a597d8b9d801a84ddd119b69de15dae28.json.headers.json} +0 -0
  58. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/LICENSE.md +0 -0
  59. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/README.md +0 -0
  60. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/bin/esbuild +0 -0
  61. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/esbuild.wasm +0 -0
  62. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/esm/browser.d.ts +0 -0
  63. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/esm/browser.js +0 -0
  64. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/esm/browser.min.js +0 -0
  65. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/lib/browser.d.ts +0 -0
  66. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/lib/browser.js +0 -0
  67. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/lib/browser.min.js +0 -0
  68. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/lib/main.d.ts +0 -0
  69. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/lib/main.js +0 -0
  70. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/package.json +0 -0
  71. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/wasm_exec.js +0 -0
  72. /package/dist/shell/substrate/shell.compilers/{185af0dc999cdd5a65e3c807cecef50879dc1f52090f84200933bcc684977e51 → 7e51de08316b2f5e65975a118a3943eab41f82a095f171b0aeac7756b1aa0fdc}/wasm_exec_node.js +0 -0
  73. /package/dist/shell/substrate/shell.compilers/{1161ec6314238aa01c0d597718e18004a93203fd593835a3b48c086cf234ece7 → 96c969923eb2e9dc2b9c78caac030cd76e94d1b514a4dcd4633899cebfa0d417}/amaro.js +0 -0
  74. /package/dist/shell/substrate/shell.compilers/{8b6b3b8879df28fc4be628f86828940b3d20fda9ea1d6b84539033ca70a45c22 → d29e6bbb3868157482ba637ecf76ce325e555883c4a950f90f04a2d06cfb1c96}/bindings_wasm_bg.wasm +0 -0
  75. /package/dist/shell/substrate/shell.compilers/{8b6b3b8879df28fc4be628f86828940b3d20fda9ea1d6b84539033ca70a45c22 → d29e6bbb3868157482ba637ecf76ce325e555883c4a950f90f04a2d06cfb1c96}/package.json +0 -0
  76. /package/dist/shell/substrate/shell.compilers/{8b6b3b8879df28fc4be628f86828940b3d20fda9ea1d6b84539033ca70a45c22 → d29e6bbb3868157482ba637ecf76ce325e555883c4a950f90f04a2d06cfb1c96}/rollup.browser.js +0 -0
@@ -6955,12 +6955,12 @@ function registerHandle(handle) {
6955
6955
  heldBy.set(handle, currentOwner());
6956
6956
  const token = heldBy.get(handle);
6957
6957
  if (token != null) {
6958
- let owned = allOwned.get(token);
6959
- if (!owned) {
6960
- owned = /* @__PURE__ */ new Set();
6961
- allOwned.set(token, owned);
6958
+ let owned2 = allOwned.get(token);
6959
+ if (!owned2) {
6960
+ owned2 = /* @__PURE__ */ new Set();
6961
+ allOwned.set(token, owned2);
6962
6962
  }
6963
- owned.add(handle);
6963
+ owned2.add(handle);
6964
6964
  }
6965
6965
  refHeld.add(handle);
6966
6966
  activeHandles.add(handle);
@@ -6985,9 +6985,9 @@ function releaseHandle(handle) {
6985
6985
  drop(handle);
6986
6986
  const token = heldBy.get(handle);
6987
6987
  if (token != null) {
6988
- const owned = allOwned.get(token);
6989
- owned == null ? void 0 : owned.delete(handle);
6990
- if ((owned == null ? void 0 : owned.size) === 0) allOwned.delete(token);
6988
+ const owned2 = allOwned.get(token);
6989
+ owned2 == null ? void 0 : owned2.delete(handle);
6990
+ if ((owned2 == null ? void 0 : owned2.size) === 0) allOwned.delete(token);
6991
6991
  }
6992
6992
  heldBy.delete(handle);
6993
6993
  refHeld.delete(handle);
@@ -7038,18 +7038,18 @@ function __adoptHandle(handle, token) {
7038
7038
  drop(handle);
7039
7039
  const previous = heldBy.get(handle);
7040
7040
  if (previous != null) {
7041
- const owned = allOwned.get(previous);
7042
- owned == null ? void 0 : owned.delete(handle);
7043
- if ((owned == null ? void 0 : owned.size) === 0) allOwned.delete(previous);
7041
+ const owned2 = allOwned.get(previous);
7042
+ owned2 == null ? void 0 : owned2.delete(handle);
7043
+ if ((owned2 == null ? void 0 : owned2.size) === 0) allOwned.delete(previous);
7044
7044
  }
7045
7045
  heldBy.set(handle, token);
7046
7046
  if (token !== null) {
7047
- let owned = allOwned.get(token);
7048
- if (!owned) {
7049
- owned = /* @__PURE__ */ new Set();
7050
- allOwned.set(token, owned);
7047
+ let owned2 = allOwned.get(token);
7048
+ if (!owned2) {
7049
+ owned2 = /* @__PURE__ */ new Set();
7050
+ allOwned.set(token, owned2);
7051
7051
  }
7052
- owned.add(handle);
7052
+ owned2.add(handle);
7053
7053
  }
7054
7054
  hold(handle);
7055
7055
  }
@@ -8699,15 +8699,15 @@ function createFsBindings(Bytes = () => Buffer$9) {
8699
8699
  },
8700
8700
  /** Node's fast path for `readFile` with an encoding it can decode itself. */
8701
8701
  readFileUtf8(path2, flags) {
8702
- const owned = typeof path2 !== "number";
8703
- const fd2 = owned ? fsBinding2.open(path2, flags, 438) : path2;
8702
+ const owned2 = typeof path2 !== "number";
8703
+ const fd2 = owned2 ? fsBinding2.open(path2, flags, 438) : path2;
8704
8704
  try {
8705
8705
  const file = fileFor(fd2);
8706
8706
  const bytes2 = new Uint8Array(file.tree.statSync(file.path).size);
8707
8707
  const length = fsBinding2.read(fd2, bytes2, 0, bytes2.length, -1);
8708
8708
  return new TextDecoder().decode(bytes2.subarray(0, length));
8709
8709
  } finally {
8710
- if (owned) fsBinding2.close(fd2);
8710
+ if (owned2) fsBinding2.close(fd2);
8711
8711
  }
8712
8712
  },
8713
8713
  // ---- writing ------------------------------------------------------------
@@ -8795,12 +8795,12 @@ function createFsBindings(Bytes = () => Buffer$9) {
8795
8795
  return fsBinding2.writeBuffer(fd2, bytes2, 0, bytes2.length, position ?? null, req);
8796
8796
  },
8797
8797
  writeFileUtf8(path2, data2, flags, mode) {
8798
- const owned = typeof path2 !== "number";
8799
- const fd2 = owned ? fsBinding2.open(path2, flags, mode) : path2;
8798
+ const owned2 = typeof path2 !== "number";
8799
+ const fd2 = owned2 ? fsBinding2.open(path2, flags, mode) : path2;
8800
8800
  try {
8801
8801
  fsBinding2.writeString(fd2, data2, null, "utf8");
8802
8802
  } finally {
8803
- if (owned) fsBinding2.close(fd2);
8803
+ if (owned2) fsBinding2.close(fd2);
8804
8804
  }
8805
8805
  return void 0;
8806
8806
  },
@@ -9704,7 +9704,7 @@ function syncChildRefusal() {
9704
9704
  if (engineModuleURL() === null) return "the engine cannot name its own module, so a thread cannot load one";
9705
9705
  return null;
9706
9706
  }
9707
- function warmSyncChild() {
9707
+ function warmSyncChild(required = false) {
9708
9708
  if (globalThis.__substrateSyncChildThread === true) return;
9709
9709
  if (service || syncChildRefusal() !== null) return;
9710
9710
  const WorkerClass = workerClass();
@@ -9714,7 +9714,14 @@ function warmSyncChild() {
9714
9714
  const source = workerSource();
9715
9715
  const inBrowser = typeof globalThis.WorkerGlobalScope !== "undefined" || typeof globalThis.document !== "undefined";
9716
9716
  const url2 = inBrowser && typeof Blob === "function" && typeof URL.createObjectURL === "function" ? URL.createObjectURL(new Blob([source], { type: "text/javascript" })) : new URL(`data:text/javascript,${encodeURIComponent(source)}`);
9717
- const worker2 = new WorkerClass(url2, { type: "module" });
9717
+ let worker2;
9718
+ try {
9719
+ worker2 = new WorkerClass(url2, { type: "module" });
9720
+ } catch (cause) {
9721
+ if (typeof url2 === "string" && url2.startsWith("blob:")) URL.revokeObjectURL(url2);
9722
+ if (required) throw cause;
9723
+ return;
9724
+ }
9718
9725
  const started = { control, toParent, toWorker, worker: worker2 };
9719
9726
  const failed = (event) => {
9720
9727
  started.failure = String((event == null ? void 0 : event.message) ?? event);
@@ -9831,7 +9838,7 @@ function runSyncChild(request) {
9831
9838
  const refusal = syncChildRefusal();
9832
9839
  if (refusal !== null) throw new Error(refusal);
9833
9840
  if (hostVfs === null) throw new Error("the engine has no filesystem for a child to run on");
9834
- if (!service) warmSyncChild();
9841
+ if (!service) warmSyncChild(true);
9835
9842
  const active2 = service;
9836
9843
  if (Atomics.load(active2.control, STARTED) !== 1) {
9837
9844
  Atomics.wait(active2.control, STARTED, 0, START_WAIT_MS);
@@ -31258,9 +31265,9 @@ function nodeTimeout(id2) {
31258
31265
  function timerHandleOf(id2) {
31259
31266
  return id2 && typeof id2 === "object" && "_id" in id2 ? id2._id : id2;
31260
31267
  }
31261
- function createTimersModule(owned) {
31262
- const schedule = (owned == null ? void 0 : owned.setTimeout) ?? globalThis.setTimeout.bind(globalThis);
31263
- const cancel = (owned == null ? void 0 : owned.clearTimeout) ?? ((id2) => globalThis.clearTimeout(timerHandleOf(id2)));
31268
+ function createTimersModule(owned2) {
31269
+ const schedule = (owned2 == null ? void 0 : owned2.setTimeout) ?? globalThis.setTimeout.bind(globalThis);
31270
+ const cancel = (owned2 == null ? void 0 : owned2.clearTimeout) ?? ((id2) => globalThis.clearTimeout(timerHandleOf(id2)));
31264
31271
  const unenroll = (item) => {
31265
31272
  if (item._idleTimeoutId) cancel(item._idleTimeoutId);
31266
31273
  item._idleTimeoutId = null;
@@ -31339,10 +31346,10 @@ function createTimersModule(owned) {
31339
31346
  const handle = timerHandleOf(id2);
31340
31347
  return realm.clearImmediate ? realm.clearImmediate(handle) : globalThis.clearTimeout(handle);
31341
31348
  },
31342
- ...owned ? {
31343
- ...owned,
31344
- setImmediate: (fn2, ...args) => owned.setTimeout(fn2, 0, ...args),
31345
- clearImmediate: owned.clearTimeout
31349
+ ...owned2 ? {
31350
+ ...owned2,
31351
+ setImmediate: (fn2, ...args) => owned2.setTimeout(fn2, 0, ...args),
31352
+ clearImmediate: owned2.clearTimeout
31346
31353
  } : {},
31347
31354
  active: active2,
31348
31355
  enroll,
@@ -31878,12 +31885,225 @@ function createProcess(options) {
31878
31885
  };
31879
31886
  return proc;
31880
31887
  }
31888
+ const owned = /* @__PURE__ */ new WeakMap();
31889
+ const tracked = /* @__PURE__ */ new WeakMap();
31890
+ const globals = /* @__PURE__ */ new WeakMap();
31891
+ const modules = /* @__PURE__ */ new WeakMap();
31892
+ function pendingGuestPorts(process2) {
31893
+ let count = 0;
31894
+ for (const state of owned.get(process2) ?? []) if (state.referenced && !state.closed) count++;
31895
+ return count;
31896
+ }
31897
+ function stopGuestPorts(process2) {
31898
+ for (const state of [...owned.get(process2) ?? []]) state.close();
31899
+ }
31900
+ function track(process2, port) {
31901
+ var _a3, _b3;
31902
+ if (!port || typeof port !== "object" || typeof port.postMessage !== "function" || typeof port.close !== "function" || typeof port.start !== "function") throw new TypeError("MessagePort method called with an invalid receiver");
31903
+ if (tracked.has(port)) return port;
31904
+ let entries = owned.get(process2);
31905
+ if (!entries) {
31906
+ entries = /* @__PURE__ */ new Set();
31907
+ owned.set(process2, entries);
31908
+ }
31909
+ const collection = entries;
31910
+ const original = {};
31911
+ for (const key of ["ref", "unref", "start", "close", "on", "addListener", "once", "prependListener", "prependOnceListener", "removeListener", "off", "removeAllListeners", "addEventListener", "removeEventListener", "postMessage"]) {
31912
+ if (typeof port[key] === "function") original[key] = port[key].bind(port);
31913
+ }
31914
+ const state = { port, referenced: false, closed: false, close: () => port.close() };
31915
+ tracked.set(port, state);
31916
+ collection.add(state);
31917
+ const release2 = () => {
31918
+ state.closed = true;
31919
+ state.referenced = false;
31920
+ collection.delete(state);
31921
+ };
31922
+ const define = (key, value) => Object.defineProperty(port, key, { value, writable: true, configurable: true });
31923
+ define("ref", () => {
31924
+ var _a4;
31925
+ if (!state.closed) {
31926
+ state.referenced = true;
31927
+ return (_a4 = original.ref) == null ? void 0 : _a4.call(original);
31928
+ }
31929
+ });
31930
+ define("unref", () => {
31931
+ var _a4;
31932
+ state.referenced = false;
31933
+ return (_a4 = original.unref) == null ? void 0 : _a4.call(original);
31934
+ });
31935
+ define("hasRef", () => state.closed ? void 0 : state.referenced);
31936
+ define("close", (callback) => {
31937
+ if (typeof callback === "function") port.once("close", callback);
31938
+ if (state.closed) return;
31939
+ release2();
31940
+ original.close();
31941
+ });
31942
+ if (original.on) original.on("close", release2);
31943
+ else (_a3 = original.addEventListener) == null ? void 0 : _a3.call(original, "close", release2, { once: true });
31944
+ (_b3 = original.unref) == null ? void 0 : _b3.call(original);
31945
+ state.close = () => {
31946
+ if (state.closed) return;
31947
+ release2();
31948
+ original.close();
31949
+ };
31950
+ const activate = (previous, current3) => {
31951
+ var _a4;
31952
+ if (state.closed) return;
31953
+ if (previous === 0 && current3 > 0) {
31954
+ port.ref();
31955
+ (_a4 = original.start) == null ? void 0 : _a4.call(original);
31956
+ } else if (previous > 0 && current3 === 0) port.unref();
31957
+ };
31958
+ if (original.on && typeof port.listenerCount === "function") {
31959
+ for (const name of ["on", "addListener", "once", "prependListener", "prependOnceListener", "removeListener", "off", "removeAllListeners"]) if (original[name]) {
31960
+ define(name, (...args) => {
31961
+ const previous = port.listenerCount("message");
31962
+ const result = original[name](...args);
31963
+ activate(previous, port.listenerCount("message"));
31964
+ return result;
31965
+ });
31966
+ }
31967
+ return port;
31968
+ }
31969
+ const listeners = /* @__PURE__ */ new Map();
31970
+ const count = () => {
31971
+ var _a4;
31972
+ return [...((_a4 = listeners.get("message")) == null ? void 0 : _a4.values()) ?? []].reduce((n8, values) => n8 + values.length, 0);
31973
+ };
31974
+ const remove2 = (type2, listener, options) => {
31975
+ var _a4;
31976
+ const capture = typeof options === "boolean" ? options : !!(options == null ? void 0 : options.capture);
31977
+ const records = (_a4 = listeners.get(type2)) == null ? void 0 : _a4.get(listener);
31978
+ const record = records == null ? void 0 : records.find((value) => value.capture === capture);
31979
+ if (!record) return;
31980
+ const previous = count();
31981
+ records.splice(records.indexOf(record), 1);
31982
+ if (!records.length) listeners.get(type2).delete(listener);
31983
+ original.removeEventListener(type2, record.invoke, capture);
31984
+ activate(previous, count());
31985
+ };
31986
+ const add = (type2, listener, options, data2 = false) => {
31987
+ var _a4, _b4;
31988
+ if (listener == null || ((_a4 = options == null ? void 0 : options.signal) == null ? void 0 : _a4.aborted)) return;
31989
+ const capture = typeof options === "boolean" ? options : !!(options == null ? void 0 : options.capture);
31990
+ let byListener = listeners.get(type2);
31991
+ if (!byListener) {
31992
+ byListener = /* @__PURE__ */ new Map();
31993
+ listeners.set(type2, byListener);
31994
+ }
31995
+ let records = byListener.get(listener);
31996
+ if (!records) {
31997
+ records = [];
31998
+ byListener.set(listener, records);
31999
+ }
32000
+ if (records.some((record) => record.capture === capture)) return;
32001
+ const previous = count();
32002
+ const invoke = (event) => {
32003
+ var _a5;
32004
+ if (options == null ? void 0 : options.once) remove2(type2, listener, capture);
32005
+ if (state.closed && type2 !== "close") return;
32006
+ try {
32007
+ if (typeof listener === "function") listener.call(port, data2 ? event.data : event);
32008
+ else (_a5 = listener.handleEvent) == null ? void 0 : _a5.call(listener, event);
32009
+ } catch (error) {
32010
+ if (!__reportUncaughtException(process2, error)) throw error;
32011
+ }
32012
+ };
32013
+ records.push({ capture, invoke });
32014
+ original.addEventListener(type2, invoke, options);
32015
+ (_b4 = options == null ? void 0 : options.signal) == null ? void 0 : _b4.addEventListener("abort", () => remove2(type2, listener, capture), { once: true });
32016
+ activate(previous, count());
32017
+ };
32018
+ define("addEventListener", add);
32019
+ define("removeEventListener", remove2);
32020
+ define("on", (type2, listener) => {
32021
+ add(type2, listener, void 0, true);
32022
+ return port;
32023
+ });
32024
+ define("addListener", port.on);
32025
+ define("once", (type2, listener) => {
32026
+ add(type2, listener, { once: true }, true);
32027
+ return port;
32028
+ });
32029
+ define("off", (type2, listener) => {
32030
+ remove2(type2, listener);
32031
+ return port;
32032
+ });
32033
+ define("removeListener", port.off);
32034
+ define("removeAllListeners", (type2) => {
32035
+ var _a4;
32036
+ for (const name of type2 === void 0 ? [...listeners.keys()] : [type2]) {
32037
+ for (const [listener, records] of [...((_a4 = listeners.get(name)) == null ? void 0 : _a4.entries()) ?? []]) for (const record of [...records]) remove2(name, listener, record.capture);
32038
+ }
32039
+ return port;
32040
+ });
32041
+ define("listenerCount", (type2) => {
32042
+ var _a4;
32043
+ return [...((_a4 = listeners.get(type2)) == null ? void 0 : _a4.values()) ?? []].reduce((n8, values) => n8 + values.length, 0);
32044
+ });
32045
+ for (const type2 of ["message", "messageerror"]) {
32046
+ let handler = null;
32047
+ Object.defineProperty(port, "on" + type2, { configurable: true, get: () => handler, set(value) {
32048
+ if (handler) remove2(type2, handler);
32049
+ handler = typeof value === "function" ? value : null;
32050
+ if (handler) add(type2, handler);
32051
+ } });
32052
+ }
32053
+ return port;
32054
+ }
32055
+ function classes(process2, Channel, PortConstructor) {
32056
+ const MessageChannel3 = function() {
32057
+ if (!new.target) throw new TypeError("MessageChannel must be constructed with new");
32058
+ const channel = Reflect.construct(Channel, []);
32059
+ track(process2, channel.port1);
32060
+ track(process2, channel.port2);
32061
+ return channel;
32062
+ };
32063
+ const MessagePort2 = function(...args) {
32064
+ if (!new.target) throw new TypeError("MessagePort must be constructed with new");
32065
+ return track(process2, Reflect.construct(PortConstructor, args));
32066
+ };
32067
+ MessagePort2.prototype = Object.create(PortConstructor.prototype);
32068
+ for (const name of ["ref", "unref", "hasRef", "close", "on", "once", "addListener", "off", "removeListener", "removeAllListeners", "addEventListener", "removeEventListener"]) {
32069
+ Object.defineProperty(MessagePort2.prototype, name, { configurable: true, writable: true, value: function(...args) {
32070
+ return track(process2, this)[name](...args);
32071
+ } });
32072
+ }
32073
+ MessageChannel3.prototype = Channel.prototype;
32074
+ Object.defineProperty(MessagePort2, Symbol.hasInstance, { value: (value) => value instanceof PortConstructor });
32075
+ Object.defineProperty(MessageChannel3, Symbol.hasInstance, { value: (value) => value instanceof Channel });
32076
+ return { MessageChannel: MessageChannel3, MessagePort: MessagePort2 };
32077
+ }
32078
+ function guestMessageGlobals(process2) {
32079
+ let result = globals.get(process2);
32080
+ if (!result) {
32081
+ result = classes(process2, globalThis.MessageChannel, globalThis.MessagePort);
32082
+ globals.set(process2, result);
32083
+ }
32084
+ return result;
32085
+ }
32086
+ function guestMessageModule(process2, original, hostTransport = false) {
32087
+ let cache2 = modules.get(process2);
32088
+ if (!cache2) {
32089
+ cache2 = /* @__PURE__ */ new WeakMap();
32090
+ modules.set(process2, cache2);
32091
+ }
32092
+ let result = cache2.get(original);
32093
+ if (!result) {
32094
+ result = { ...original, ...hostTransport ? guestMessageGlobals(process2) : classes(process2, original.MessageChannel, original.MessagePort) };
32095
+ result.default = result;
32096
+ cache2.set(original, result);
32097
+ }
32098
+ return result;
32099
+ }
31881
32100
  const __substratePendingTimers = /* @__PURE__ */ new WeakMap();
31882
32101
  function pendingGuestTimers(process2) {
31883
32102
  var _a3;
31884
- return ((_a3 = __substratePendingTimers.get(process2)) == null ? void 0 : _a3.size) ?? 0;
32103
+ return (((_a3 = __substratePendingTimers.get(process2)) == null ? void 0 : _a3.size) ?? 0) + pendingGuestPorts(process2);
31885
32104
  }
31886
32105
  function stopGuestTimers(process2) {
32106
+ stopGuestPorts(process2);
31887
32107
  const held = __substratePendingTimers.get(process2);
31888
32108
  if (!held) return;
31889
32109
  const host = globalThis;
@@ -31920,7 +32140,7 @@ function guestTimerFunctions(process2, host) {
31920
32140
  if (!__reportUncaughtException(process2, error)) throw error;
31921
32141
  }
31922
32142
  };
31923
- const track = (id2) => {
32143
+ const track2 = (id2) => {
31924
32144
  held.add(id2);
31925
32145
  if (id2 && typeof id2 === "object" && typeof id2.unref === "function") {
31926
32146
  const handle = id2;
@@ -31945,10 +32165,10 @@ function guestTimerFunctions(process2, host) {
31945
32165
  held.delete(id2);
31946
32166
  call(...args);
31947
32167
  }, ms2, ...rest));
31948
- return track(id2);
32168
+ return track2(id2);
31949
32169
  },
31950
32170
  setInterval(fn2, ms2, ...rest) {
31951
- return track(nodeTimeout(hostSetInterval.call(host, inProcess(fn2), ms2, ...rest)));
32171
+ return track2(nodeTimeout(hostSetInterval.call(host, inProcess(fn2), ms2, ...rest)));
31952
32172
  },
31953
32173
  clearTimeout(id2) {
31954
32174
  held.delete(id2);
@@ -75574,8 +75794,8 @@ function treeForRun() {
75574
75794
  }
75575
75795
  function shellOf(tree2) {
75576
75796
  if (tree2) {
75577
- const owned = shells.get(tree2);
75578
- if (owned) return owned;
75797
+ const owned2 = shells.get(tree2);
75798
+ if (owned2) return owned2;
75579
75799
  }
75580
75800
  return bashInstance && vfsAdapter ? { bash: bashInstance, adapter: vfsAdapter } : null;
75581
75801
  }
@@ -79964,7 +80184,14 @@ function __substrateGuestGlobal(process2) {
79964
80184
  Worker: { value: void 0, writable: true, configurable: true, enumerable: true },
79965
80185
  self: { value: void 0, writable: true, configurable: true, enumerable: true }
79966
80186
  });
79967
- const isLocalGlobal = (key) => ["Promise", "navigator", "Navigator", "Worker", "self"].includes(key);
80187
+ const browserTransportGlobals = ["postMessage", "onmessage", "onmessageerror", "close", "addEventListener", "removeEventListener", "dispatchEvent"];
80188
+ for (const key of browserTransportGlobals) Object.defineProperty(localGlobals, key, {
80189
+ value: void 0,
80190
+ writable: true,
80191
+ configurable: true,
80192
+ enumerable: true
80193
+ });
80194
+ const isLocalGlobal = (key) => ["Promise", "navigator", "Navigator", "Worker", "self", ...browserTransportGlobals].includes(key);
79968
80195
  guest = new Proxy(localGlobals, {
79969
80196
  get(target, key) {
79970
80197
  var _a3, _b3, _c3;
@@ -79975,6 +80202,7 @@ function __substrateGuestGlobal(process2) {
79975
80202
  if (isLocalGlobal(key)) return Reflect.get(target, key, guest);
79976
80203
  if (key === "globalThis" || key === "global") return guest;
79977
80204
  if (shadowed(target, key)) return Reflect.get(target, key, guest);
80205
+ if (key === "MessageChannel" || key === "MessagePort") return guestMessageGlobals(process2)[key];
79978
80206
  const value = Reflect.get(host, key, host);
79979
80207
  if (["setTimeout", "clearTimeout", "setInterval", "clearInterval"].includes(key) && typeof value === "function") {
79980
80208
  if (((_a3 = boundGlobals.get(key)) == null ? void 0 : _a3.original) !== value) {
@@ -81352,7 +81580,7 @@ function createRequire(vfs2, fsShim, process2, currentDir, moduleCache, options,
81352
81580
  const importMetaUrl = resolvedPath.startsWith("data:") ? resolvedPath : "file://" + resolvedPath;
81353
81581
  const strictBody = code2.startsWith(__substrateModuleMarker);
81354
81582
  if (!scoped) code2 = __substrateScopeGlobalCalls(code2);
81355
- const wrappedCode = `(function($exports, $require, $module, $filename, $dirname, $process, $console, $importMeta, $dynamicImport, __substrateGuestGlobal, __substrateGuestConstructor) { var exports = $exports; var require = $require; var module = $module; var __filename = $filename; var __dirname = $dirname; var process = $process; var console = $console; var import_meta = $importMeta; var __dynamicImport = $dynamicImport; var document = void 0, window = void 0, location = void 0; var globalThis = __substrateGuestGlobal($process); var global = globalThis; var Buffer = globalThis.Buffer; var queueMicrotask = globalThis.queueMicrotask, atob = globalThis.atob, btoa = globalThis.btoa, structuredClone = globalThis.structuredClone, setTimeout = globalThis.setTimeout, clearTimeout = globalThis.clearTimeout, setInterval = globalThis.setInterval, clearInterval = globalThis.clearInterval; globalThis.process = $process; global.process = $process; with ({ __proto__: null, get Worker() { return globalThis.Worker; }, set Worker(value) { globalThis.Worker = value; }, get self() { return globalThis.self; }, set self(value) { globalThis.self = value; }, get navigator() { return globalThis.navigator; }, set navigator(value) { globalThis.navigator = value; }, get Navigator() { return globalThis.Navigator; }, set Navigator(value) { globalThis.Navigator = value; }, get Promise() { return globalThis.Promise; }, set Promise(value) { globalThis.Promise = value; }, get fetch() { return globalThis.fetch; }, set fetch(value) { globalThis.fetch = value; } }) { return (function() {${code2}
81583
+ const wrappedCode = `(function($exports, $require, $module, $filename, $dirname, $process, $console, $importMeta, $dynamicImport, __substrateGuestGlobal, __substrateGuestConstructor) { var exports = $exports; var require = $require; var module = $module; var __filename = $filename; var __dirname = $dirname; var process = $process; var console = $console; var import_meta = $importMeta; var __dynamicImport = $dynamicImport; var document = void 0, window = void 0, location = void 0; var globalThis = __substrateGuestGlobal($process); var global = globalThis; var Buffer = globalThis.Buffer; var queueMicrotask = globalThis.queueMicrotask, atob = globalThis.atob, btoa = globalThis.btoa, structuredClone = globalThis.structuredClone, setTimeout = globalThis.setTimeout, clearTimeout = globalThis.clearTimeout, setInterval = globalThis.setInterval, clearInterval = globalThis.clearInterval; globalThis.process = $process; global.process = $process; with ({ __proto__: null, get MessageChannel() { return globalThis.MessageChannel; }, set MessageChannel(value) { globalThis.MessageChannel = value; }, get MessagePort() { return globalThis.MessagePort; }, set MessagePort(value) { globalThis.MessagePort = value; }, get Worker() { return globalThis.Worker; }, set Worker(value) { globalThis.Worker = value; }, get self() { return globalThis.self; }, set self(value) { globalThis.self = value; }, get postMessage() { return globalThis.postMessage; }, set postMessage(value) { globalThis.postMessage = value; }, get onmessage() { return globalThis.onmessage; }, set onmessage(value) { globalThis.onmessage = value; }, get onmessageerror() { return globalThis.onmessageerror; }, set onmessageerror(value) { globalThis.onmessageerror = value; }, get close() { return globalThis.close; }, set close(value) { globalThis.close = value; }, get addEventListener() { return globalThis.addEventListener; }, set addEventListener(value) { globalThis.addEventListener = value; }, get removeEventListener() { return globalThis.removeEventListener; }, set removeEventListener(value) { globalThis.removeEventListener = value; }, get dispatchEvent() { return globalThis.dispatchEvent; }, set dispatchEvent(value) { globalThis.dispatchEvent = value; }, get navigator() { return globalThis.navigator; }, set navigator(value) { globalThis.navigator = value; }, get Navigator() { return globalThis.Navigator; }, set Navigator(value) { globalThis.Navigator = value; }, get Promise() { return globalThis.Promise; }, set Promise(value) { globalThis.Promise = value; }, get fetch() { return globalThis.fetch; }, set fetch(value) { globalThis.fetch = value; } }) { return (function() {${code2}
81356
81584
  }).call(${strictBody ? "void 0" : "$module.exports"}); }
81357
81585
  })${__substrateSourceURL(resolvedPath)}`;
81358
81586
  let bodyKind = code2.includes(__substrateTopLevelAwaitMarker) ? "async" : code2.includes(__substrateAwaitMarker) ? "generator" : "sync";
@@ -81476,7 +81704,7 @@ function createRequire(vfs2, fsShim, process2, currentDir, moduleCache, options,
81476
81704
  if (id2 === "worker_threads") {
81477
81705
  const bridge = globalThis[Symbol.for("@volter/browser-node/threads")];
81478
81706
  const module = bridge && typeof bridge.module === "function" ? bridge.module(vfs2, process2, builtinModules.worker_threads) : void 0;
81479
- if (module) return module;
81707
+ return guestMessageModule(process2, module ?? workerThreadsShim, !module);
81480
81708
  }
81481
81709
  if (id2 === "module") {
81482
81710
  return __substrateModule();
@@ -81730,7 +81958,7 @@ class Runtime {
81730
81958
  const importMetaUrl = "file://" + filename;
81731
81959
  const strictBody = code2.startsWith(__substrateModuleMarker);
81732
81960
  code2 = __substrateScopeGlobalCalls(code2);
81733
- const wrappedCode = `(function($exports, $require, $module, $filename, $dirname, $process, $console, $importMeta, $dynamicImport, __substrateGuestGlobal, __substrateGuestConstructor) { var exports = $exports; var require = $require; var module = $module; var __filename = $filename; var __dirname = $dirname; var process = $process; var console = $console; var import_meta = $importMeta; var __dynamicImport = $dynamicImport; var document = void 0, window = void 0, location = void 0; var globalThis = __substrateGuestGlobal($process); var global = globalThis; var Buffer = globalThis.Buffer; var queueMicrotask = globalThis.queueMicrotask, atob = globalThis.atob, btoa = globalThis.btoa, structuredClone = globalThis.structuredClone, setTimeout = globalThis.setTimeout, clearTimeout = globalThis.clearTimeout, setInterval = globalThis.setInterval, clearInterval = globalThis.clearInterval; globalThis.process = $process; global.process = $process; with ({ __proto__: null, get Worker() { return globalThis.Worker; }, set Worker(value) { globalThis.Worker = value; }, get self() { return globalThis.self; }, set self(value) { globalThis.self = value; }, get navigator() { return globalThis.navigator; }, set navigator(value) { globalThis.navigator = value; }, get Navigator() { return globalThis.Navigator; }, set Navigator(value) { globalThis.Navigator = value; }, get Promise() { return globalThis.Promise; }, set Promise(value) { globalThis.Promise = value; }, get fetch() { return globalThis.fetch; }, set fetch(value) { globalThis.fetch = value; } }) { return (function() {${code2}
81961
+ const wrappedCode = `(function($exports, $require, $module, $filename, $dirname, $process, $console, $importMeta, $dynamicImport, __substrateGuestGlobal, __substrateGuestConstructor) { var exports = $exports; var require = $require; var module = $module; var __filename = $filename; var __dirname = $dirname; var process = $process; var console = $console; var import_meta = $importMeta; var __dynamicImport = $dynamicImport; var document = void 0, window = void 0, location = void 0; var globalThis = __substrateGuestGlobal($process); var global = globalThis; var Buffer = globalThis.Buffer; var queueMicrotask = globalThis.queueMicrotask, atob = globalThis.atob, btoa = globalThis.btoa, structuredClone = globalThis.structuredClone, setTimeout = globalThis.setTimeout, clearTimeout = globalThis.clearTimeout, setInterval = globalThis.setInterval, clearInterval = globalThis.clearInterval; globalThis.process = $process; global.process = $process; with ({ __proto__: null, get MessageChannel() { return globalThis.MessageChannel; }, set MessageChannel(value) { globalThis.MessageChannel = value; }, get MessagePort() { return globalThis.MessagePort; }, set MessagePort(value) { globalThis.MessagePort = value; }, get Worker() { return globalThis.Worker; }, set Worker(value) { globalThis.Worker = value; }, get self() { return globalThis.self; }, set self(value) { globalThis.self = value; }, get postMessage() { return globalThis.postMessage; }, set postMessage(value) { globalThis.postMessage = value; }, get onmessage() { return globalThis.onmessage; }, set onmessage(value) { globalThis.onmessage = value; }, get onmessageerror() { return globalThis.onmessageerror; }, set onmessageerror(value) { globalThis.onmessageerror = value; }, get close() { return globalThis.close; }, set close(value) { globalThis.close = value; }, get addEventListener() { return globalThis.addEventListener; }, set addEventListener(value) { globalThis.addEventListener = value; }, get removeEventListener() { return globalThis.removeEventListener; }, set removeEventListener(value) { globalThis.removeEventListener = value; }, get dispatchEvent() { return globalThis.dispatchEvent; }, set dispatchEvent(value) { globalThis.dispatchEvent = value; }, get navigator() { return globalThis.navigator; }, set navigator(value) { globalThis.navigator = value; }, get Navigator() { return globalThis.Navigator; }, set Navigator(value) { globalThis.Navigator = value; }, get Promise() { return globalThis.Promise; }, set Promise(value) { globalThis.Promise = value; }, get fetch() { return globalThis.fetch; }, set fetch(value) { globalThis.fetch = value; } }) { return (function() {${code2}
81734
81962
  }).call(${strictBody ? "void 0" : "$module.exports"}); }
81735
81963
  })${__substrateSourceURL(filename)}`;
81736
81964
  const dynamicImport = createDynamicImport(require2, this.process, filename.startsWith("data:") ? filename : `file://${filename}`);
@@ -81789,8 +82017,18 @@ class Runtime {
81789
82017
  real = this.vfs.realpathSync(filename);
81790
82018
  } catch {
81791
82019
  }
81792
- const code2 = this.vfs.readFileSync(real, "utf8");
81793
- return this.execute(code2, real);
82020
+ const require2 = createRequire(
82021
+ this.vfs,
82022
+ this.fsShim,
82023
+ this.process,
82024
+ dirname(real),
82025
+ this.moduleCache,
82026
+ this.options,
82027
+ this.processedCodeCache
82028
+ );
82029
+ if (!this.process.mainModule) this.process.__substrateMainPending = real;
82030
+ const exports$1 = require2(real);
82031
+ return { exports: exports$1, module: this.moduleCache[real] };
81794
82032
  }
81795
82033
  /**
81796
82034
  * Run a file from the virtual file system (async - for IRuntime interface)
@@ -81944,7 +82182,7 @@ forGuestRealm(() => {
81944
82182
  promise.then(void 0, () => {
81945
82183
  });
81946
82184
  const source = args[0];
81947
- const track = (controller) => {
82185
+ const track2 = (controller) => {
81948
82186
  const close2 = controller.close;
81949
82187
  const error = controller.error;
81950
82188
  if (typeof close2 === "function") controller.close = function(...rest) {
@@ -81964,7 +82202,7 @@ forGuestRealm(() => {
81964
82202
  const wrapped = Object.create(source ?? null);
81965
82203
  wrapped.start = (controller) => {
81966
82204
  var _a3;
81967
- track(controller);
82205
+ track2(controller);
81968
82206
  try {
81969
82207
  return (_a3 = source == null ? void 0 : source.start) == null ? void 0 : _a3.call(source, controller);
81970
82208
  } catch (cause) {