peachsim 0.1.2610 → 0.1.2612

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 (130) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +1213 -684
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-L2SFCOHG.mjs → acorn-QO4N4OBM.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-MK4DOEDN.mjs → chunk-252KNQUF.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-ZZB2LFYV.mjs → chunk-3ZTDI2MF.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-WZHEW7Z7.mjs → chunk-4JTACUL3.mjs} +1 -1
  30. package/dist-lib/esm-chunks/{chunk-WBQFHIGS.mjs → chunk-6VWQEI2U.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-FP447MCW.mjs → chunk-6ZP7JWNX.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-X74N3K5N.mjs → chunk-7OAXAYW7.mjs} +4 -4
  33. package/dist-lib/esm-chunks/{chunk-XN74REO2.mjs → chunk-BWWPWGZW.mjs} +1 -1
  34. package/dist-lib/esm-chunks/{chunk-W3LNUIUA.mjs → chunk-GRDRKYB5.mjs} +6 -6
  35. package/dist-lib/esm-chunks/{chunk-VDLPNJ6P.mjs → chunk-HEPU5HEE.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-2LJTZ2KG.mjs → chunk-HHQHP6NX.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-MJP4WOSX.mjs → chunk-HQGPI7FM.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-RN73P2DY.mjs → chunk-LDYLSTVC.mjs} +5 -5
  39. package/dist-lib/esm-chunks/{chunk-YLUD2UET.mjs → chunk-O5VA25UA.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-CUBTZPSZ.mjs → chunk-PDKX5WGD.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-KTAGV5U6.mjs → chunk-PPDXMRAA.mjs} +6 -6
  42. package/dist-lib/esm-chunks/{chunk-EYSNLE5V.mjs → chunk-THHH7IPK.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-N3M5KT33.mjs → chunk-UGPX2JTI.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-73NIGS7D.mjs → chunk-VAIU3RSQ.mjs} +14 -14
  45. package/dist-lib/esm-chunks/{chunk-N7XU2WWO.mjs → chunk-VM5QGKMB.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-HMTSU22Q.mjs → chunk-WMQA6U5H.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-EU5WMP5O.mjs → chunk-WTTIS3AY.mjs} +2 -2
  48. package/dist-lib/esm-chunks/{chunk-YVLXYLNV.mjs → chunk-XPVBWRWY.mjs} +1 -1
  49. package/dist-lib/esm-chunks/{chunk-42NDD4R7.mjs → chunk-YAK7RNDV.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-YYGSN3BN.mjs → chunk-ZRJG25JE.mjs} +3 -3
  51. package/dist-lib/esm-chunks/{metro-layout-parser-VDPXJ7LW.mjs → metro-layout-parser-UUA4AJ2Q.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-HRPDLN2P.mjs → swift-package-prebuilt-EVJIROFN.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-5DOGMU3M.mjs → swift-sdk-app-module-M5TKMPU6.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-W3UU4H4L.mjs → swift-sdk-image-4FST3VAH.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-OJWD6ZOH.mjs → swift-sdk-image-producer-4DUU7RUD.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +11 -6
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +1544 -1015
  61. package/dist-lib/host/fetch-proxy-handler.cjs +2 -2
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +676 -171
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +76 -65
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +2100 -1632
  95. package/dist-lib/swift-compile.cjs +1 -1
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/package.json +1 -1
  123. package/src/android-gradle-sources.ts +97 -2
  124. package/src/androidGradleContract.ts +11 -0
  125. package/src/gitignore.ts +9 -4
  126. package/src/kotlin-app.ts +37 -4
  127. package/src/kotlin-gradle-library-plan.ts +142 -0
  128. package/src/kotlin-host.ts +32 -3
  129. package/src/kotlin-library-sources.ts +320 -0
  130. package/src/kotlin-maven-sources.ts +0 -7
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2612 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -273,8 +273,8 @@ function getDefaultPortForProtocol(protocol) {
273
273
  return protocol === "https:" ? 443 : 80;
274
274
  }
275
275
  function isBaseServerUrl(url) {
276
- const path140 = url.pathname || "/";
277
- return (path140 === "/" || path140 === "") && !url.search && !url.hash;
276
+ const path143 = url.pathname || "/";
277
+ return (path143 === "/" || path143 === "") && !url.search && !url.hash;
278
278
  }
279
279
  async function resolvePortViaServerScan(port) {
280
280
  try {
@@ -4687,10 +4687,10 @@ function* nativePackageVersionsWalk(projectRoot) {
4687
4687
  const manifest = yield* readManifest(import_path2.default.join(appRoot, "package.json"));
4688
4688
  if (!manifest) throw new Error("app package.json must contain an object");
4689
4689
  const readInstalledPackage = createInstalledPackageReader();
4690
- const pending = [{ root: appRoot, manifest }];
4690
+ const pending2 = [{ root: appRoot, manifest }];
4691
4691
  const visited = /* @__PURE__ */ new Set();
4692
4692
  const needed = /* @__PURE__ */ new Map();
4693
- for (let next = pending.pop(); next; next = pending.pop()) {
4693
+ for (let next = pending2.pop(); next; next = pending2.pop()) {
4694
4694
  const root = yield* realpath(next.root);
4695
4695
  if (visited.has(root)) continue;
4696
4696
  visited.add(root);
@@ -4710,7 +4710,7 @@ function* nativePackageVersionsWalk(projectRoot) {
4710
4710
  if (!installed) continue;
4711
4711
  if (nativeNames.has(name3) && !needed.has(name3))
4712
4712
  needed.set(name3, (yield* readInstalledPackage(appRoot, name3)) ?? installed);
4713
- pending.push(installed);
4713
+ pending2.push(installed);
4714
4714
  }
4715
4715
  }
4716
4716
  }
@@ -5768,13 +5768,13 @@ function detectPackageManager(root, files2 = nodeRepoFileReader) {
5768
5768
  }
5769
5769
  function scanRepository(root) {
5770
5770
  const directories = [];
5771
- const pending = [{ dir: root, depth: 0 }];
5771
+ const pending2 = [{ dir: root, depth: 0 }];
5772
5772
  let entries2 = 0;
5773
5773
  let cursor = 0;
5774
5774
  let truncated = false;
5775
5775
  let unreadable = 0;
5776
- while (cursor < pending.length && entries2 < 2e5 && directories.length < 1e4) {
5777
- const next = pending[cursor++];
5776
+ while (cursor < pending2.length && entries2 < 2e5 && directories.length < 1e4) {
5777
+ const next = pending2[cursor++];
5778
5778
  if (!next) break;
5779
5779
  directories.push(next.dir);
5780
5780
  let handle;
@@ -5794,7 +5794,7 @@ function scanRepository(root) {
5794
5794
  truncated = true;
5795
5795
  continue;
5796
5796
  }
5797
- pending.push({ dir: (0, import_node_path8.join)(next.dir, entry.name), depth: next.depth + 1 });
5797
+ pending2.push({ dir: (0, import_node_path8.join)(next.dir, entry.name), depth: next.depth + 1 });
5798
5798
  }
5799
5799
  } finally {
5800
5800
  handle.closeSync();
@@ -5802,7 +5802,7 @@ function scanRepository(root) {
5802
5802
  }
5803
5803
  return {
5804
5804
  directories: directories.sort(),
5805
- truncated: truncated || cursor < pending.length || entries2 >= 2e5,
5805
+ truncated: truncated || cursor < pending2.length || entries2 >= 2e5,
5806
5806
  unreadable
5807
5807
  };
5808
5808
  }
@@ -5813,8 +5813,8 @@ function metadataValue(value, key2) {
5813
5813
  if (!value || typeof value !== "object") return void 0;
5814
5814
  return Object.getOwnPropertyDescriptor(value, key2)?.value;
5815
5815
  }
5816
- function readProjectJson(path140, files2 = nodeRepoFileReader) {
5817
- const text7 = readProjectMetadata(path140, files2);
5816
+ function readProjectJson(path143, files2 = nodeRepoFileReader) {
5817
+ const text7 = readProjectMetadata(path143, files2);
5818
5818
  if (text7 === null) return null;
5819
5819
  try {
5820
5820
  const value = JSON.parse(text7);
@@ -5971,8 +5971,8 @@ function globToRegexSource(pattern) {
5971
5971
  i += 2;
5972
5972
  continue;
5973
5973
  }
5974
- out += ".*";
5975
- i += 2;
5974
+ while (i < pattern.length && pattern[i] === "*") i++;
5975
+ out += "[^/]*";
5976
5976
  continue;
5977
5977
  }
5978
5978
  out += "[^/]*";
@@ -5995,7 +5995,7 @@ function globToRegexSource(pattern) {
5995
5995
  if (j < pattern.length) {
5996
5996
  let body = pattern.slice(i + 1, j);
5997
5997
  if (body.startsWith("!")) body = `^${body.slice(1)}`;
5998
- out += `[${body}]`;
5998
+ out += `(?!/)[${body}]`;
5999
5999
  i = j + 1;
6000
6000
  continue;
6001
6001
  }
@@ -6027,7 +6027,12 @@ function compileRule(rawLine) {
6027
6027
  }
6028
6028
  const body = globToRegexSource(pattern);
6029
6029
  const prefix = anchored ? "^" : "(?:^|/)";
6030
- const regex2 = new RegExp(`${prefix}${body}$`, "i");
6030
+ let regex2;
6031
+ try {
6032
+ regex2 = new RegExp(`${prefix}${body}$`, "i");
6033
+ } catch {
6034
+ return null;
6035
+ }
6031
6036
  return { negative, directoryOnly, regex: regex2 };
6032
6037
  }
6033
6038
  function normalizePath(input) {
@@ -6066,16 +6071,16 @@ function createGitignoreMatcher() {
6066
6071
  return matcher;
6067
6072
  },
6068
6073
  test(relativePath2) {
6069
- const { path: path140, isDirectory: isDirectory5 } = normalizePath(relativePath2);
6070
- if (!path140) return { ignored: false, unignored: false };
6071
- const parts = path140.split("/");
6074
+ const { path: path143, isDirectory: isDirectory5 } = normalizePath(relativePath2);
6075
+ if (!path143) return { ignored: false, unignored: false };
6076
+ const parts = path143.split("/");
6072
6077
  let prefix = "";
6073
6078
  for (let i = 0; i < parts.length - 1; i++) {
6074
6079
  prefix = prefix ? `${prefix}/${parts[i]}` : parts[i];
6075
6080
  const parent = matchSingle(prefix, true);
6076
6081
  if (parent.ignored) return { ignored: true, unignored: false };
6077
6082
  }
6078
- return matchSingle(path140, isDirectory5);
6083
+ return matchSingle(path143, isDirectory5);
6079
6084
  },
6080
6085
  ignores(relativePath2) {
6081
6086
  return matcher.test(relativePath2).ignored;
@@ -10615,8 +10620,8 @@ export *
10615
10620
  }`;
10616
10621
  }
10617
10622
  function swiftPackageIdentity(url) {
10618
- const path140 = url.endsWith("/") ? url.slice(0, -1) : url;
10619
- return (path140.split("/").pop() ?? path140).replace(/\.git$/, "").toLowerCase();
10623
+ const path143 = url.endsWith("/") ? url.slice(0, -1) : url;
10624
+ return (path143.split("/").pop() ?? path143).replace(/\.git$/, "").toLowerCase();
10620
10625
  }
10621
10626
  function clangSettingEntries(settings, tool) {
10622
10627
  return (settings ?? []).flatMap(
@@ -11262,10 +11267,10 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11262
11267
  const enclosing = scopes.length > 0 ? scopes[scopes.length - 1].prefix : [];
11263
11268
  if (scope2?.[3] === "enum" && opens > 0 && /(^|\s)(public|open)\s/.test(scope2[2] ?? "") && !/\bwhere\b/.test(first.masked) && first.masked[scope2.index + scope2[0].length] !== "<") {
11264
11269
  const name3 = scope2[4];
11265
- const path140 = scopeOf(name3, enclosing, false);
11266
- if (!byPath.has(path140.join(".")) && (path140.length === 1 || byPath.has(path140.slice(0, -1).join(".")))) {
11270
+ const path143 = scopeOf(name3, enclosing, false);
11271
+ if (!byPath.has(path143.join(".")) && (path143.length === 1 || byPath.has(path143.slice(0, -1).join(".")))) {
11267
11272
  const keptAttrs = [...(scope2[1] ?? "").matchAll(/@\w+(?:\([^)]*\))?/g)].map((attr) => attr[0]).filter((attr) => !attr.startsWith("@objc"));
11268
- const id = `s:peach-synthesized-${module2}-${path140.join(".")}`;
11273
+ const id = `s:peach-synthesized-${module2}-${path143.join(".")}`;
11269
11274
  const body = [];
11270
11275
  let inner = 1;
11271
11276
  let closed = false;
@@ -11320,15 +11325,15 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11320
11325
  symbols.push({
11321
11326
  kind: { identifier: "swift.enum" },
11322
11327
  identifier: { precise: id },
11323
- pathComponents: path140,
11328
+ pathComponents: path143,
11324
11329
  declarationFragments: fragments,
11325
11330
  accessLevel: "public"
11326
11331
  });
11327
- if (path140.length > 1)
11332
+ if (path143.length > 1)
11328
11333
  relationships.push({
11329
11334
  kind: "memberOf",
11330
11335
  source: id,
11331
- target: byPath.get(path140.slice(0, -1).join("."))
11336
+ target: byPath.get(path143.slice(0, -1).join("."))
11332
11337
  });
11333
11338
  for (const kase of cases) {
11334
11339
  const memberId = `${id}-${kase.leaf}`;
@@ -11337,7 +11342,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11337
11342
  symbols.push({
11338
11343
  kind: { identifier: "swift.enum.case" },
11339
11344
  identifier: { precise: memberId },
11340
- pathComponents: [...path140, kase.leaf],
11345
+ pathComponents: [...path143, kase.leaf],
11341
11346
  declarationFragments: [
11342
11347
  { kind: "keyword", spelling: "case" },
11343
11348
  { kind: "text", spelling: " " },
@@ -11353,7 +11358,7 @@ function synthesizedInterfaceEnums(interfaceText, module2, graphs2) {
11353
11358
  symbols.push({
11354
11359
  kind: { identifier: "swift.init" },
11355
11360
  identifier: { precise: initId },
11356
- pathComponents: [...path140, "init(rawValue:)"],
11361
+ pathComponents: [...path143, "init(rawValue:)"],
11357
11362
  declarationFragments: [
11358
11363
  { kind: "keyword", spelling: "init" },
11359
11364
  { kind: "text", spelling: "?(" },
@@ -11432,7 +11437,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11432
11437
  })
11433
11438
  )
11434
11439
  );
11435
- const trap = (path140) => `fatalError("${path140} is ${options2.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
11440
+ const trap = (path143) => `fatalError("${path143} is ${options2.placeholder === void 0 ? "a binary framework" : "a placeholder"} peach cannot run")`;
11436
11441
  const skipped = [];
11437
11442
  const behavior = options2.behavior ?? /* @__PURE__ */ new Map();
11438
11443
  const used = /* @__PURE__ */ new Set();
@@ -11783,34 +11788,34 @@ function emitSwiftStandin(sourceGraphs, options2) {
11783
11788
  lines.push(...physical);
11784
11789
  owners.push(...physical.map(() => current2));
11785
11790
  };
11786
- const emitAt = (path140, line) => {
11787
- if (omit.has(path140)) return;
11791
+ const emitAt = (path143, line) => {
11792
+ if (omit.has(path143)) return;
11788
11793
  const previous = current2;
11789
- current2 = path140;
11794
+ current2 = path143;
11790
11795
  emit(line);
11791
11796
  current2 = previous;
11792
11797
  };
11793
11798
  const emitInertState = (id, indent2, build2) => {
11794
- const path140 = pathOf(byId.get(id));
11799
+ const path143 = pathOf(byId.get(id));
11795
11800
  emitAt(hiddenInit(id), `${indent2}init(_peachInert: Void) { ${build2} }`);
11796
11801
  const list2 = conforms.get(id) ?? [];
11797
11802
  const has = (name3) => (children.get(id) ?? []).some((member) => leaf(member) === name3);
11798
11803
  if (list2.includes("Encodable") && !has("encode(to:)"))
11799
11804
  emitAt(
11800
- `${path140}.encode(to:)`,
11805
+ `${path143}.encode(to:)`,
11801
11806
  `${indent2}public func encode(to encoder: Encoder) throws {}`
11802
11807
  );
11803
11808
  if (list2.includes("Decodable") && !has("init(from:)"))
11804
11809
  emitAt(
11805
- `${path140}.init(from:)`,
11810
+ `${path143}.init(from:)`,
11806
11811
  `${indent2}public init(from decoder: Decoder) throws { self.init(_peachInert: ()) }`
11807
11812
  );
11808
11813
  };
11809
11814
  const scoped = (body) => (symbol2, ...rest) => {
11810
- const path140 = pathOf(symbol2);
11811
- if (omit.has(path140)) return void skipped.push({ path: path140, reason: omit.get(path140) });
11815
+ const path143 = pathOf(symbol2);
11816
+ if (omit.has(path143)) return void skipped.push({ path: path143, reason: omit.get(path143) });
11812
11817
  const previous = current2;
11813
- current2 = path140;
11818
+ current2 = path143;
11814
11819
  try {
11815
11820
  body(symbol2, ...rest);
11816
11821
  } finally {
@@ -11842,7 +11847,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11842
11847
  };
11843
11848
  const emitMember = scoped(
11844
11849
  (member, indent2, context) => {
11845
- const path140 = pathOf(member);
11850
+ const path143 = pathOf(member);
11846
11851
  if (TYPE_KINDS.has(member.kind.identifier)) {
11847
11852
  const origin = origins.get(member.identifier.precise)?.split(".")[0];
11848
11853
  const parent = owner.get(member.identifier.precise);
@@ -11859,7 +11864,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11859
11864
  ))
11860
11865
  return;
11861
11866
  if (!MEMBER_KINDS.has(member.kind.identifier)) {
11862
- skipped.push({ path: path140, reason: `unhandled ${member.kind.identifier}` });
11867
+ skipped.push({ path: path143, reason: `unhandled ${member.kind.identifier}` });
11863
11868
  return;
11864
11869
  }
11865
11870
  const { 1: spelledAttrs, 2: rest } = LEADING_ATTRS.exec(text(member));
@@ -11870,15 +11875,15 @@ function emitSwiftStandin(sourceGraphs, options2) {
11870
11875
  const selector = context.inClass && !options2.inert && member.kind.identifier === "swift.type.method" && !/\basync\b/.test(rest) ? /^c:objc\(cs\)\w+\(cm\)([A-Za-z_][A-Za-z_0-9:]*)$/.exec(
11871
11876
  member.identifier.precise
11872
11877
  )?.[1] : void 0;
11873
- const attrs = options2.unobjc?.has(path140) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : `${wrapped}${selector ? `@objc(${selector}) ` : ""}`;
11878
+ const attrs = options2.unobjc?.has(path143) ? wrapped.replace(/@objc(?:\([^)]*\))?\s*/g, "") : `${wrapped}${selector ? `@objc(${selector}) ` : ""}`;
11874
11879
  const modifiers = /^((?:(?:required|final|override|convenience|unowned(?:\(\w+\))?|weak|lazy|nonisolated|mutating|nonmutating) )*)(.*)$/s.exec(
11875
11880
  rest
11876
11881
  );
11877
11882
  const flags = new Set(
11878
11883
  modifiers[1].trim().split(/\s+/).filter(Boolean).map((flag) => flag.replace(/\(.*/, ""))
11879
11884
  );
11880
- const requiredInit = context.inClass && !!options2.requiredInits?.has(path140);
11881
- const restatesRequired = context.inClass && path140.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
11885
+ const requiredInit = context.inClass && !!options2.requiredInits?.has(path143);
11886
+ const restatesRequired = context.inClass && path143.endsWith(".init()") && [...superChain(owner.get(member.identifier.precise) ?? "")].some(
11882
11887
  (at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
11883
11888
  );
11884
11889
  const protocolInit = member.kind.identifier === "swift.init" && /^c:objc\(pl\)\w+\(im\).*::SYNTHESIZED::c:objc\(cs\)/.test(
@@ -11888,7 +11893,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11888
11893
  const final = context.inClass && flags.has("final") ? "final " : "";
11889
11894
  const mutating = flags.has("mutating") ? "mutating " : flags.has("nonmutating") ? "nonmutating " : "";
11890
11895
  let core = `${flags.has("convenience") ? "convenience " : ""}${modifiers[2]}`;
11891
- for (const type of options2.unwrappedParameters?.get(path140) ?? [])
11896
+ for (const type of options2.unwrappedParameters?.get(path143) ?? [])
11892
11897
  core = core.replace(
11893
11898
  new RegExp(
11894
11899
  `(:\\s*(?:\\w+\\.)*${type.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})(?=\\s*[,)])`,
@@ -11896,12 +11901,12 @@ function emitSwiftStandin(sourceGraphs, options2) {
11896
11901
  ),
11897
11902
  "$1!"
11898
11903
  );
11899
- const override = context.inClass && !options2.plain?.has(path140) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options2.forcedOverride?.has(path140) || isObjC(member) && path140.endsWith(".init()")) ? "override " : "";
11904
+ const override = context.inClass && !options2.plain?.has(path143) && !restatesRequired && (flags.has("override") || overrides.has(member.identifier.precise) || options2.forcedOverride?.has(path143) || isObjC(member) && path143.endsWith(".init()")) ? "override " : "";
11900
11905
  const head = `${indent2}${attrs}${access(member, context.openOwner)} ${required ? "required " : ""}${final}${override}${mutating}`;
11901
- const measured = behavior.get(path140);
11902
- if (measured) used.add(path140);
11906
+ const measured = behavior.get(path143);
11907
+ if (measured) used.add(path143);
11903
11908
  const overloadBody = /\basync\b/.test(core) ? measured?.asyncBody : /\bResult</.test(core) ? measured?.resultBody : void 0;
11904
- const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(path140));
11909
+ const body = overloadBody ?? measured?.body ?? (options2.inert ? inertBody(member) : trap(path143));
11905
11910
  switch (member.kind.identifier) {
11906
11911
  case "swift.property":
11907
11912
  case "swift.type.property":
@@ -11914,13 +11919,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
11914
11919
  const parameter = !measured && !options2.inert && !settable && /:\s*some\s/.test(decl) ? opaqueParameter(member) : void 0;
11915
11920
  const getter = parameter ? `return ({ () -> ${parameter} in ${body} })()` : body;
11916
11921
  const computed = decl.replace(/^((?:static |class )*)let /, "$1var ");
11917
- const wrapper = options2.projections?.get(path140);
11922
+ const wrapper = options2.projections?.get(path143);
11918
11923
  if (wrapper) {
11919
11924
  const type = /^var\s+`?\w+`?\s*:\s*(.+)$/s.exec(computed)?.[1];
11920
- const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path140]);
11925
+ const initial = type && inertValue(type, /* @__PURE__ */ new Set(), [path143]);
11921
11926
  if (!initial)
11922
11927
  return void skipped.push({
11923
- path: path140,
11928
+ path: path143,
11924
11929
  reason: `wrapped by ${wrapper} with no inert initial value`
11925
11930
  });
11926
11931
  const own2 = new RegExp(
@@ -11941,7 +11946,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
11941
11946
  return;
11942
11947
  }
11943
11948
  emit(
11944
- `${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(path140))} }` : ""} }`
11949
+ `${head.replace(/@NSCopying\b\s*/g, "")}${computed} { get${effects} { ${getter} }${settable && !effects ? ` ${parsed2.nonmutating ? "nonmutating " : ""}set { ${measured?.set ?? (options2.inert ? "" : trap(path143))} }` : ""} }`
11945
11950
  );
11946
11951
  return;
11947
11952
  }
@@ -12000,7 +12005,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12000
12005
  };
12001
12006
  const emitType = scoped(
12002
12007
  (symbol2, indent2) => {
12003
- const path140 = pathOf(symbol2);
12008
+ const path143 = pathOf(symbol2);
12004
12009
  const id = symbol2.identifier.precise;
12005
12010
  const inner = `${indent2} `;
12006
12011
  switch (symbol2.kind.identifier) {
@@ -12017,10 +12022,10 @@ function emitSwiftStandin(sourceGraphs, options2) {
12017
12022
  case "swift.class": {
12018
12023
  const shape = header(symbol2, "class", indent2);
12019
12024
  if (!shape)
12020
- return void skipped.push({ path: path140, reason: `unparsed class ${text(symbol2)}` });
12021
- const parent = options2.superclasses?.get(path140) ?? superclass.get(id);
12025
+ return void skipped.push({ path: path143, reason: `unparsed class ${text(symbol2)}` });
12026
+ const parent = options2.superclasses?.get(path143) ?? superclass.get(id);
12022
12027
  const blocked = classBlocked(id);
12023
- if (blocked) return void skipped.push({ path: path140, reason: blocked });
12028
+ if (blocked) return void skipped.push({ path: path143, reason: blocked });
12024
12029
  const ancestors = /* @__PURE__ */ new Set();
12025
12030
  const inherited = /* @__PURE__ */ new Set();
12026
12031
  for (let at = superId.get(id); at; at = superId.get(at)) {
@@ -12036,7 +12041,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12036
12041
  "Equatable",
12037
12042
  "CustomStringConvertible",
12038
12043
  "CustomDebugStringConvertible"
12039
- ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(path140)?.has(name3.split(/::|\./).pop()) && !options2.unconformed?.get(path140)?.has(name3)
12044
+ ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options2.unconformed?.get(path143)?.has(name3.split(/::|\./).pop()) && !options2.unconformed?.get(path143)?.has(name3)
12040
12045
  )
12041
12046
  ].filter((name3, at, all2) => all2.indexOf(name3) === at);
12042
12047
  const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
@@ -12048,9 +12053,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
12048
12053
  `${indent2}${shape.attrs}${objcName ? `@objc(${objcName}) ` : ""}${shape.final}${open ? "open" : "public"} class ${shape.name}${shape.generics}${list2.length ? `: ${list2.join(", ")}` : ""}${selfConforming(shape.where)} {`
12049
12054
  );
12050
12055
  const members2 = membersOf(id);
12051
- const extra = options2.behavior?.get(path140)?.members;
12056
+ const extra = options2.behavior?.get(path143)?.members;
12052
12057
  if (extra) {
12053
- used.add(path140);
12058
+ used.add(path143);
12054
12059
  emit(`${inner}${extra}`);
12055
12060
  }
12056
12061
  for (const member of members2)
@@ -12106,11 +12111,11 @@ function emitSwiftStandin(sourceGraphs, options2) {
12106
12111
  if (protocol && member.kind.identifier === "swift.method" && leaf(member).endsWith("()") && have.has(`instance|leaf|${leaf(member).slice(0, -2)}`))
12107
12112
  propertyWitnesses.push({
12108
12113
  owner: current2,
12109
- head: `extension ${pathOf(protocol)} where Self: ${path140} {`,
12114
+ head: `extension ${pathOf(protocol)} where Self: ${path143} {`,
12110
12115
  member,
12111
- path: path140
12116
+ path: path143
12112
12117
  });
12113
- else emitWitness(member, inner, path140, open && isObjC(member));
12118
+ else emitWitness(member, inner, path143, open && isObjC(member));
12114
12119
  }
12115
12120
  }
12116
12121
  if (options2.inert && designated2 && classBuild(id) === "hidden")
@@ -12118,13 +12123,13 @@ function emitSwiftStandin(sourceGraphs, options2) {
12118
12123
  const coder = members2.some((member) => leaf(member) === "init(coder:)");
12119
12124
  if (designated2 && !coder && externalRoot(id) !== "NSObject" && externalRoot(id) !== null)
12120
12125
  emit(
12121
- `${inner}public required init${options2.coderNonfailable?.has(path140) ? "" : "?"}(coder: NSCoder) { ${options2.inert && !options2.coderNonfailable?.has(path140) ? "return nil" : trap(`${path140}.init(coder:)`)} }`
12126
+ `${inner}public required init${options2.coderNonfailable?.has(path143) ? "" : "?"}(coder: NSCoder) { ${options2.inert && !options2.coderNonfailable?.has(path143) ? "return nil" : trap(`${path143}.init(coder:)`)} }`
12122
12127
  );
12123
12128
  if (designated2 && !members2.some((member) => leaf(member) === "init()") && [...superChain(id)].some(
12124
12129
  (at) => options2.requiredInits?.has(`${pathOf(byId.get(at))}.init()`)
12125
12130
  ))
12126
12131
  emit(
12127
- `${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${path140}.init()`)} }`
12132
+ `${inner}public required init() { ${options2.inert ? superInit(id) : trap(`${path143}.init()`)} }`
12128
12133
  );
12129
12134
  emit(`${indent2}}`);
12130
12135
  return;
@@ -12132,7 +12137,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12132
12137
  case "swift.struct": {
12133
12138
  const shape = header(symbol2, "struct", indent2);
12134
12139
  if (!shape)
12135
- return void skipped.push({ path: path140, reason: `unparsed struct ${text(symbol2)}` });
12140
+ return void skipped.push({ path: path143, reason: `unparsed struct ${text(symbol2)}` });
12136
12141
  const members2 = membersOf(id);
12137
12142
  const raw2 = rawType(members2);
12138
12143
  const list2 = inheritance(id);
@@ -12172,7 +12177,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12172
12177
  emitInertState(
12173
12178
  id,
12174
12179
  inner,
12175
- raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path140]) ?? "0"}` : ""
12180
+ raw2 ? `self.rawValue = ${inertValue(raw2, /* @__PURE__ */ new Set(), [path143]) ?? "0"}` : ""
12176
12181
  );
12177
12182
  emit(`${indent2}}`);
12178
12183
  return;
@@ -12180,7 +12185,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12180
12185
  case "swift.enum": {
12181
12186
  const shape = header(symbol2, "enum", indent2);
12182
12187
  if (!shape)
12183
- return void skipped.push({ path: path140, reason: `unparsed enum ${text(symbol2)}` });
12188
+ return void skipped.push({ path: path143, reason: `unparsed enum ${text(symbol2)}` });
12184
12189
  const members2 = membersOf(id);
12185
12190
  const cases = members2.filter(
12186
12191
  (member) => member.kind.identifier === "swift.enum.case"
@@ -12190,7 +12195,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12190
12195
  const missing2 = raw2 ? cases.filter((member) => !values.has(member.identifier.precise)) : [];
12191
12196
  if (raw2 && (isObjC(symbol2) || /^c:@C?M@[^@]+@E@/.test(id)) && missing2.length > 0)
12192
12197
  return void skipped.push({
12193
- path: path140,
12198
+ path: path143,
12194
12199
  reason: `no header value for ${missing2.map(leaf).join(", ")}`
12195
12200
  });
12196
12201
  const list2 = inheritance(id, raw2 ?? void 0).filter(
@@ -12229,8 +12234,8 @@ function emitSwiftStandin(sourceGraphs, options2) {
12229
12234
  });
12230
12235
  }
12231
12236
  if (options2.inert) {
12232
- const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(path140, /* @__PURE__ */ new Set(), []);
12233
- emitInertState(id, inner, value === null ? trap(path140) : `self = ${value}`);
12237
+ const value = options2.trapped?.has(hiddenInit(id)) ? null : inertValue(path143, /* @__PURE__ */ new Set(), []);
12238
+ emitInertState(id, inner, value === null ? trap(path143) : `self = ${value}`);
12234
12239
  }
12235
12240
  emit(`${indent2}}`);
12236
12241
  return;
@@ -12239,14 +12244,14 @@ function emitSwiftStandin(sourceGraphs, options2) {
12239
12244
  const shape = header(symbol2, "protocol", indent2);
12240
12245
  if (!shape)
12241
12246
  return void skipped.push({
12242
- path: path140,
12247
+ path: path143,
12243
12248
  reason: `unparsed protocol ${text(symbol2)}`
12244
12249
  });
12245
12250
  const native = nativeObjcProtocols.has(id);
12246
12251
  const objcName = native ? /^c:objc\(pl\)(\w+)$/.exec(id)?.[1] : void 0;
12247
12252
  if (native && !objcName)
12248
12253
  return void skipped.push({
12249
- path: path140,
12254
+ path: path143,
12250
12255
  reason: `unknown Objective-C protocol identity ${id}`
12251
12256
  });
12252
12257
  const list2 = [
@@ -12274,7 +12279,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12274
12279
  }
12275
12280
  emit(`${indent2}}`);
12276
12281
  if (defaults.length > 0) {
12277
- emit(`${indent2}extension ${path140} {`);
12282
+ emit(`${indent2}extension ${path143} {`);
12278
12283
  for (const member of defaults) {
12279
12284
  const decl = text(member);
12280
12285
  if (optional3.has(member.identifier.precise) && member.kind.identifier === "swift.method" && !decl.replace(/\([^)]*\)/g, "").includes("->") && !/ async\b/.test(decl))
@@ -12368,7 +12373,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12368
12373
  return null;
12369
12374
  };
12370
12375
  const emitGlobal = scoped((symbol2) => {
12371
- const path140 = pathOf(symbol2);
12376
+ const path143 = pathOf(symbol2);
12372
12377
  const kind = symbol2.kind.identifier;
12373
12378
  if (kind === "swift.func" || kind === "swift.func.op" || kind === "swift.method" || kind === "swift.type.method") {
12374
12379
  const { 1: attrs, 2: rest } = LEADING_ATTRS.exec(text(symbol2));
@@ -12377,20 +12382,20 @@ function emitSwiftStandin(sourceGraphs, options2) {
12377
12382
  if (leaf(symbol2).endsWith("(_:)") && !/^(?:prefix|infix|postfix)\b/.test(spelled2))
12378
12383
  spelled2 = `prefix ${spelled2}`;
12379
12384
  }
12380
- const measured = behavior.get(path140);
12381
- if (measured) used.add(path140);
12385
+ const measured = behavior.get(path143);
12386
+ if (measured) used.add(path143);
12382
12387
  const overloadBody = /\basync\b/.test(spelled2) ? measured?.asyncBody : /\bResult</.test(spelled2) ? measured?.resultBody : void 0;
12383
12388
  emit(
12384
- `${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path140))} }`
12389
+ `${attrs}public ${spelled2} { ${overloadBody ?? measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path143))} }`
12385
12390
  );
12386
12391
  } else if (kind === "swift.var") {
12387
12392
  const parsed2 = splitAccessors(text(symbol2).replace(/^let /, "var "));
12388
- const measured = behavior.get(path140);
12389
- if (measured) used.add(path140);
12393
+ const measured = behavior.get(path143);
12394
+ if (measured) used.add(path143);
12390
12395
  emit(
12391
- `public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path140))} }`
12396
+ `public ${parsed2.decl} { ${measured?.body ?? (options2.inert ? inertBody(symbol2) : trap(path143))} }`
12392
12397
  );
12393
- } else skipped.push({ path: path140, reason: `unhandled top-level ${kind}` });
12398
+ } else skipped.push({ path: path143, reason: `unhandled top-level ${kind}` });
12394
12399
  });
12395
12400
  const cExports = new Set(
12396
12401
  [...byId.values()].flatMap((symbol2) => {
@@ -12407,7 +12412,7 @@ function emitSwiftStandin(sourceGraphs, options2) {
12407
12412
  return !name3 || !cExports.has(`${name3}|${text(symbol2)}`);
12408
12413
  }).sort((a, b) => pathOf(a).localeCompare(pathOf(b)));
12409
12414
  for (const symbol2 of roots) {
12410
- const path140 = pathOf(symbol2);
12415
+ const path143 = pathOf(symbol2);
12411
12416
  if (TYPE_KINDS.has(symbol2.kind.identifier)) emitType(symbol2, "");
12412
12417
  else emitGlobal(symbol2);
12413
12418
  }
@@ -12487,9 +12492,9 @@ function emitSwiftStandin(sourceGraphs, options2) {
12487
12492
  "#endif",
12488
12493
  ""
12489
12494
  ];
12490
- for (const path140 of behavior.keys())
12491
- if (!used.has(path140))
12492
- skipped.push({ path: path140, reason: "behavior names no emitted declaration" });
12495
+ for (const path143 of behavior.keys())
12496
+ if (!used.has(path143))
12497
+ skipped.push({ path: path143, reason: "behavior names no emitted declaration" });
12493
12498
  return {
12494
12499
  source: `${[...banner, ...lines].join("\n")}
12495
12500
  `,
@@ -14780,9 +14785,9 @@ function originalColumn(line, column) {
14780
14785
  }
14781
14786
  function designTimeDiagnostic(output, files2) {
14782
14787
  const rewritten = /* @__PURE__ */ new Map();
14783
- const linesOf = (path140) => {
14788
+ const linesOf = (path143) => {
14784
14789
  const file = Object.keys(files2).find(
14785
- (name3) => name3.endsWith(".swift") && (path140 === name3 || path140.endsWith(`/${name3}`))
14790
+ (name3) => name3.endsWith(".swift") && (path143 === name3 || path143.endsWith(`/${name3}`))
14786
14791
  );
14787
14792
  if (file === void 0) return null;
14788
14793
  let lines = rewritten.get(file);
@@ -16131,18 +16136,18 @@ function* guestLinkLines(file) {
16131
16136
  try {
16132
16137
  const decoder = new import_node_string_decoder.StringDecoder("utf8");
16133
16138
  const buffer = Buffer.allocUnsafe(64 * 1024);
16134
- let pending = "";
16139
+ let pending2 = "";
16135
16140
  let count;
16136
16141
  while ((count = (0, import_node_fs28.readSync)(input, buffer, 0, buffer.length, null)) > 0) {
16137
- const text7 = pending + decoder.write(buffer.subarray(0, count));
16142
+ const text7 = pending2 + decoder.write(buffer.subarray(0, count));
16138
16143
  let start = 0;
16139
16144
  for (let end = text7.indexOf("\n"); end !== -1; end = text7.indexOf("\n", start)) {
16140
16145
  yield text7.slice(start, end);
16141
16146
  start = end + 1;
16142
16147
  }
16143
- pending = text7.slice(start);
16148
+ pending2 = text7.slice(start);
16144
16149
  }
16145
- yield pending + decoder.end();
16150
+ yield pending2 + decoder.end();
16146
16151
  } finally {
16147
16152
  (0, import_node_fs28.closeSync)(input);
16148
16153
  }
@@ -20121,25 +20126,25 @@ function vectorSection(id, count, parts) {
20121
20126
  }
20122
20127
  function rewriteSections(bytes, sections, changes) {
20123
20128
  const out = [bytes.subarray(0, 8)];
20124
- const pending = new Map(changes);
20129
+ const pending2 = new Map(changes);
20125
20130
  const flushBefore = (id) => {
20126
- for (const [missing2, section2] of pending) {
20131
+ for (const [missing2, section2] of pending2) {
20127
20132
  if (SECTION_ORDER.indexOf(missing2) >= SECTION_ORDER.indexOf(id)) continue;
20128
20133
  if (section2) out.push(section2);
20129
- pending.delete(missing2);
20134
+ pending2.delete(missing2);
20130
20135
  }
20131
20136
  };
20132
20137
  for (const s of sections) {
20133
20138
  if (s.id !== 0) flushBefore(s.id);
20134
- if (!pending.has(s.id)) {
20139
+ if (!pending2.has(s.id)) {
20135
20140
  out.push(bytes.subarray(s.offset, s.end));
20136
20141
  continue;
20137
20142
  }
20138
- const section2 = pending.get(s.id);
20139
- pending.delete(s.id);
20143
+ const section2 = pending2.get(s.id);
20144
+ pending2.delete(s.id);
20140
20145
  if (section2) out.push(section2);
20141
20146
  }
20142
- for (const section2 of pending.values()) if (section2) out.push(section2);
20147
+ for (const section2 of pending2.values()) if (section2) out.push(section2);
20143
20148
  return Buffer.concat(out);
20144
20149
  }
20145
20150
  function entries(bytes, section2, entry) {
@@ -25768,15 +25773,15 @@ function projectOutputFile(root, file, user) {
25768
25773
  return real;
25769
25774
  }
25770
25775
  function removeProjectLinks(root) {
25771
- const pending = [root];
25772
- for (let directory2 = pending.pop(); directory2; directory2 = pending.pop()) {
25776
+ const pending2 = [root];
25777
+ for (let directory2 = pending2.pop(); directory2; directory2 = pending2.pop()) {
25773
25778
  for (const entry of (0, import_node_fs36.readdirSync)(directory2, { withFileTypes: true })) {
25774
25779
  const full = import_node_path34.default.join(directory2, entry.name);
25775
25780
  if (directory2 === root && entry.name === ".build") continue;
25776
25781
  if (directory2 === root && entry.name.startsWith(".peach-modules-")) {
25777
25782
  (0, import_node_fs36.rmSync)(full, { recursive: true, force: true });
25778
25783
  } else if (entry.isSymbolicLink()) (0, import_node_fs36.rmSync)(full);
25779
- else if (entry.isDirectory()) pending.push(full);
25784
+ else if (entry.isDirectory()) pending2.push(full);
25780
25785
  }
25781
25786
  }
25782
25787
  }
@@ -25896,13 +25901,13 @@ function swiftSdkGuestLookups(moduleRoot, sdkRoot, objects) {
25896
25901
  const shared = /* @__PURE__ */ new Set();
25897
25902
  const sdkWeakReferences = /* @__PURE__ */ new Map();
25898
25903
  for (const objects2 of groups.values())
25899
- for (const { path: path140, bytes } of objects2) {
25904
+ for (const { path: path143, bytes } of objects2) {
25900
25905
  const defined = guestWasmSymbols(bytes);
25901
25906
  for (const name3 of defined.defined) symbols.add(name3);
25902
25907
  for (const name3 of defined.tags) shared.add(name3);
25903
25908
  for (const name3 of defined.globals) shared.add(name3);
25904
25909
  if (defined.weakUndefined.length)
25905
- sdkWeakReferences.set(path140, new Set(defined.weakUndefined));
25910
+ sdkWeakReferences.set(path143, new Set(defined.weakUndefined));
25906
25911
  }
25907
25912
  return createGuestImageLedger({
25908
25913
  images,
@@ -29391,7 +29396,7 @@ function dumpInputs(dir, xcode) {
29391
29396
  swiftCodeScan(source).lineStarts,
29392
29397
  (line) => line.replace(
29393
29398
  MANIFEST_HOST_OS,
29394
- (match, os24) => (os24 === "macOS" ? "true" : "false").padEnd(match.length)
29399
+ (match, os25) => (os25 === "macOS" ? "true" : "false").padEnd(match.length)
29395
29400
  )
29396
29401
  );
29397
29402
  if (projected !== source) overlays.push({ name: name3, source: projected });
@@ -29463,8 +29468,8 @@ async function prepareSwiftPackageManifest(dir, xcode) {
29463
29468
  await prepareSwiftManifestToolchain();
29464
29469
  const { command, env, key: key2, overlays, cached: cached2 } = dumpInputs(dir, xcode);
29465
29470
  if (import_node_fs41.default.existsSync(cached2)) return;
29466
- const pending = manifestPreparations.get(key2);
29467
- if (pending) return pending;
29471
+ const pending2 = manifestPreparations.get(key2);
29472
+ if (pending2) return pending2;
29468
29473
  const work = (async () => {
29469
29474
  import_node_fs41.default.mkdirSync(cacheDir2, { recursive: true });
29470
29475
  const scratch2 = import_node_fs41.default.mkdtempSync(import_node_path39.default.join(cacheDir2, `${key2}-`));
@@ -29531,12 +29536,12 @@ function defaultTraits(manifest) {
29531
29536
  ])
29532
29537
  );
29533
29538
  const enabled = /* @__PURE__ */ new Set();
29534
- const pending = [...traits.get("default") ?? []];
29535
- while (pending.length > 0) {
29536
- const name3 = pending.pop();
29539
+ const pending2 = [...traits.get("default") ?? []];
29540
+ while (pending2.length > 0) {
29541
+ const name3 = pending2.pop();
29537
29542
  if (enabled.has(name3)) continue;
29538
29543
  enabled.add(name3);
29539
- pending.push(...traits.get(name3) ?? []);
29544
+ pending2.push(...traits.get(name3) ?? []);
29540
29545
  }
29541
29546
  return enabled;
29542
29547
  }
@@ -30020,9 +30025,9 @@ async function swiftDistributionRoot(signal) {
30020
30025
  "swift-distributions",
30021
30026
  `${lock.id}-${host2}-${lock.hosts[host2].sha256}`
30022
30027
  );
30023
- let pending = installs.get(dir);
30024
- if (pending?.controller.signal.aborted) pending = void 0;
30025
- if (!pending) {
30028
+ let pending2 = installs.get(dir);
30029
+ if (pending2?.controller.signal.aborted) pending2 = void 0;
30030
+ if (!pending2) {
30026
30031
  const controller = new AbortController();
30027
30032
  const promise = (async () => {
30028
30033
  if (!import_node_fs42.default.existsSync(import_node_path40.default.join(dir, SWIFT_DISTRIBUTION_MANIFEST))) {
@@ -30051,10 +30056,10 @@ async function swiftDistributionRoot(signal) {
30051
30056
  })().finally(() => {
30052
30057
  if (installs.get(dir)?.controller === controller) installs.delete(dir);
30053
30058
  });
30054
- pending = { promise, controller, clients: 0 };
30055
- installs.set(dir, pending);
30059
+ pending2 = { promise, controller, clients: 0 };
30060
+ installs.set(dir, pending2);
30056
30061
  }
30057
- const current2 = pending;
30062
+ const current2 = pending2;
30058
30063
  current2.clients++;
30059
30064
  let released = false;
30060
30065
  const release = () => {
@@ -30384,13 +30389,13 @@ function lockDirectoryFor(root) {
30384
30389
  function acquireSwiftRootReadHold(root) {
30385
30390
  const directory2 = lockDirectoryFor(root);
30386
30391
  const token = (0, import_node_crypto26.randomUUID)();
30387
- const pending = import_node_path41.default.join(directory2, `pending.reader.${token}`);
30392
+ const pending2 = import_node_path41.default.join(directory2, `pending.reader.${token}`);
30388
30393
  const reader = import_node_path41.default.join(directory2, `reader.${token}`);
30389
- (0, import_node_fs43.writeFileSync)(pending, JSON.stringify(ownIdentity(process.pid)));
30394
+ (0, import_node_fs43.writeFileSync)(pending2, JSON.stringify(ownIdentity(process.pid)));
30390
30395
  try {
30391
- (0, import_node_fs43.linkSync)(pending, reader);
30396
+ (0, import_node_fs43.linkSync)(pending2, reader);
30392
30397
  } finally {
30393
- (0, import_node_fs43.rmSync)(pending, { force: true });
30398
+ (0, import_node_fs43.rmSync)(pending2, { force: true });
30394
30399
  }
30395
30400
  let released = false;
30396
30401
  return {
@@ -30441,7 +30446,7 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
30441
30446
  );
30442
30447
  if (!ownRow) throw new Error(`swift root lock cannot find process ${process.pid}`);
30443
30448
  const owner = JSON.stringify({ pid: process.pid, start: ownRow.start });
30444
- const pending = import_node_path41.default.join(directory2, `pending.${token}`);
30449
+ const pending2 = import_node_path41.default.join(directory2, `pending.${token}`);
30445
30450
  let held = 0;
30446
30451
  let announced = 0;
30447
30452
  let current2 = null;
@@ -30480,14 +30485,14 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
30480
30485
  }
30481
30486
  }
30482
30487
  }
30483
- (0, import_node_fs43.writeFileSync)(pending, owner);
30488
+ (0, import_node_fs43.writeFileSync)(pending2, owner);
30484
30489
  try {
30485
- (0, import_node_fs43.linkSync)(pending, import_node_path41.default.join(directory2, name(newest + 1, "owner")));
30490
+ (0, import_node_fs43.linkSync)(pending2, import_node_path41.default.join(directory2, name(newest + 1, "owner")));
30486
30491
  } catch (error) {
30487
30492
  if (errorCode(error) === "EEXIST") continue;
30488
30493
  throw error;
30489
30494
  } finally {
30490
- (0, import_node_fs43.rmSync)(pending, { force: true });
30495
+ (0, import_node_fs43.rmSync)(pending2, { force: true });
30491
30496
  }
30492
30497
  const numbers = generationNumbers(directory2);
30493
30498
  if (numbers.at(-1) !== newest + 1) {
@@ -30508,7 +30513,7 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
30508
30513
  register(child) {
30509
30514
  const index = children.push(child);
30510
30515
  if (child.pid === void 0) throw new Error("could not register compiler process");
30511
- const childPending = `${pending}.child.${index}`;
30516
+ const childPending = `${pending2}.child.${index}`;
30512
30517
  try {
30513
30518
  (0, import_node_fs43.writeFileSync)(childPending, JSON.stringify(ownIdentity(child.pid)));
30514
30519
  (0, import_node_fs43.linkSync)(childPending, import_node_path41.default.join(directory2, name(held, `child.${index}`)));
@@ -33311,7 +33316,7 @@ async function compileGuestLink(options2) {
33311
33316
  let lazyFunctions = [];
33312
33317
  let dyldSymbols = [];
33313
33318
  const bundlePaths = new Map(
33314
- options2.resourceBundles.map(({ target, path: path140 }) => [target, path140])
33319
+ options2.resourceBundles.map(({ target, path: path143 }) => [target, path143])
33315
33320
  );
33316
33321
  const imageMetadata = (products) => {
33317
33322
  const source = sourceImages.map((image) => {
@@ -34575,8 +34580,8 @@ function sourceEntryPath() {
34575
34580
  return null;
34576
34581
  }
34577
34582
  }
34578
- function isCliEntry(path140) {
34579
- const name3 = (0, import_node_path49.basename)(path140);
34583
+ function isCliEntry(path143) {
34584
+ const name3 = (0, import_node_path49.basename)(path143);
34580
34585
  return name3 === "bin.ts" || name3 === "bin.js";
34581
34586
  }
34582
34587
  function rnxSelfInvocation() {
@@ -34732,16 +34737,16 @@ function collectSwiftSourceClosure(files2, roots, swiftCodeMask2, extensionMembe
34732
34737
  sources.set(file, references);
34733
34738
  }
34734
34739
  const included = /* @__PURE__ */ new Set();
34735
- const pending = [...roots];
34740
+ const pending2 = [...roots];
34736
34741
  const seen = /* @__PURE__ */ new Set();
34737
- while (pending.length) {
34738
- const name3 = pending.pop();
34742
+ while (pending2.length) {
34743
+ const name3 = pending2.pop();
34739
34744
  if (seen.has(name3)) continue;
34740
34745
  seen.add(name3);
34741
34746
  for (const file of owners.get(name3) ?? []) {
34742
34747
  if (included.has(file)) continue;
34743
34748
  included.add(file);
34744
- for (const reference of sources.get(file)) pending.push(reference);
34749
+ for (const reference of sources.get(file)) pending2.push(reference);
34745
34750
  }
34746
34751
  }
34747
34752
  return Object.fromEntries(Object.entries(files2).filter(([file]) => included.has(file)));
@@ -35534,7 +35539,7 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
35534
35539
  );
35535
35540
  const names = /* @__PURE__ */ new Set([...frameworks, ...targets.map((target) => target.name)]);
35536
35541
  const entriesByPrefix = new Map(
35537
- targets.map(({ path: path140 }) => [path140 === "." ? "" : `${path140}/`, []])
35542
+ targets.map(({ path: path143 }) => [path143 === "." ? "" : `${path143}/`, []])
35538
35543
  );
35539
35544
  const targetByPrefix = /* @__PURE__ */ new Map();
35540
35545
  for (const target of targets) {
@@ -38808,14 +38813,14 @@ function readCompiledArtifact(directory2, hash) {
38808
38813
  function saveCompiledArtifact(root, artifact) {
38809
38814
  const directory2 = import_node_path55.default.join(root, "artifact");
38810
38815
  (0, import_node_fs55.mkdirSync)(directory2, { recursive: true });
38811
- const pending = (0, import_node_fs55.mkdtempSync)(import_node_path55.default.join(root, ".artifact-"));
38816
+ const pending2 = (0, import_node_fs55.mkdtempSync)(import_node_path55.default.join(root, ".artifact-"));
38812
38817
  try {
38813
- (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending, "app.wasm"), artifact.bytes);
38814
- (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending, "icu.gz"), artifact.icu.gzip);
38818
+ (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending2, "app.wasm"), artifact.bytes);
38819
+ (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending2, "icu.gz"), artifact.icu.gzip);
38815
38820
  if (artifact.sdk)
38816
- (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending, "sdk-binding.bin"), artifact.sdk.binding.bytes);
38821
+ (0, import_node_fs55.writeFileSync)(import_node_path55.default.join(pending2, "sdk-binding.bin"), artifact.sdk.binding.bytes);
38817
38822
  (0, import_node_fs55.writeFileSync)(
38818
- import_node_path55.default.join(pending, "artifact.json"),
38823
+ import_node_path55.default.join(pending2, "artifact.json"),
38819
38824
  JSON.stringify({
38820
38825
  hash: artifact.hash,
38821
38826
  wasm: (0, import_node_crypto34.createHash)("sha256").update(artifact.bytes).digest("hex"),
@@ -38830,10 +38835,10 @@ function saveCompiledArtifact(root, artifact) {
38830
38835
  const outputs = ["app.wasm", "icu.gz"];
38831
38836
  if (artifact.sdk) outputs.push("sdk-binding.bin");
38832
38837
  for (const file of [...outputs, "artifact.json"]) {
38833
- (0, import_node_fs55.renameSync)(import_node_path55.default.join(pending, file), import_node_path55.default.join(directory2, file));
38838
+ (0, import_node_fs55.renameSync)(import_node_path55.default.join(pending2, file), import_node_path55.default.join(directory2, file));
38834
38839
  }
38835
38840
  } finally {
38836
- (0, import_node_fs55.rmSync)(pending, { recursive: true, force: true });
38841
+ (0, import_node_fs55.rmSync)(pending2, { recursive: true, force: true });
38837
38842
  }
38838
38843
  }
38839
38844
  function vanished(error) {
@@ -39032,7 +39037,7 @@ function frameworkLinkClosure(scratch2, roots) {
39032
39037
  const dependencies = /* @__PURE__ */ new Map();
39033
39038
  const moduleMaps = /* @__PURE__ */ new Map();
39034
39039
  const objcHeaders = /* @__PURE__ */ new Map();
39035
- let pending = null;
39040
+ let pending2 = null;
39036
39041
  let compiling = null;
39037
39042
  for (const line of (0, import_node_fs55.readFileSync)(import_node_path55.default.join(scratch2, "release.yaml"), "utf8").split(
39038
39043
  "\n"
@@ -39040,12 +39045,12 @@ function frameworkLinkClosure(scratch2, roots) {
39040
39045
  const phony = phonyHeader.exec(line);
39041
39046
  const shell = shellHeader.exec(line);
39042
39047
  if (phony) {
39043
- pending = { kind: "phony", name: phony[1] };
39048
+ pending2 = { kind: "phony", name: phony[1] };
39044
39049
  compiling = null;
39045
39050
  continue;
39046
39051
  }
39047
39052
  if (shell) {
39048
- pending = { kind: "shell", name: shell[1] };
39053
+ pending2 = { kind: "shell", name: shell[1] };
39049
39054
  compiling = shell[1];
39050
39055
  continue;
39051
39056
  }
@@ -39060,12 +39065,12 @@ function frameworkLinkClosure(scratch2, roots) {
39060
39065
  if (objcHeader) objcHeaders.set(compiling, JSON.parse(objcHeader));
39061
39066
  compiling = null;
39062
39067
  }
39063
- if (!pending) continue;
39068
+ if (!pending2) continue;
39064
39069
  if (line.startsWith(" inputs:")) {
39065
39070
  const paths = [...line.matchAll(/"([^"]*)"/g)].map((match) => match[1]);
39066
- if (pending.kind === "phony") {
39071
+ if (pending2.kind === "phony") {
39067
39072
  objects.set(
39068
- pending.name,
39073
+ pending2.name,
39069
39074
  paths.filter((file) => file.endsWith(".o"))
39070
39075
  );
39071
39076
  } else {
@@ -39074,12 +39079,12 @@ function frameworkLinkClosure(scratch2, roots) {
39074
39079
  const module2 = /\/Modules\/([^/]+)\.swiftmodule$/.exec(file);
39075
39080
  const object8 = /\/release\/([^/]+)\.build\/.+\.o$/.exec(file);
39076
39081
  if (module2) deps.add(module2[1]);
39077
- else if (object8 && object8[1] !== pending.name) deps.add(object8[1]);
39082
+ else if (object8 && object8[1] !== pending2.name) deps.add(object8[1]);
39078
39083
  }
39079
- dependencies.set(pending.name, deps);
39084
+ dependencies.set(pending2.name, deps);
39080
39085
  }
39081
- pending = null;
39082
- } else if (!line.startsWith(" ") && line.trim() !== "") pending = null;
39086
+ pending2 = null;
39087
+ } else if (!line.startsWith(" ") && line.trim() !== "") pending2 = null;
39083
39088
  }
39084
39089
  const modules = /* @__PURE__ */ new Set();
39085
39090
  const stack = [...roots];
@@ -41560,17 +41565,17 @@ function visit(node, visitor) {
41560
41565
  } else
41561
41566
  visit_(null, node, visitor_, Object.freeze([]));
41562
41567
  }
41563
- function visit_(key2, node, visitor, path140) {
41564
- const ctrl = callVisitor(key2, node, visitor, path140);
41568
+ function visit_(key2, node, visitor, path143) {
41569
+ const ctrl = callVisitor(key2, node, visitor, path143);
41565
41570
  if (isNode(ctrl) || isPair(ctrl)) {
41566
- replaceNode(key2, path140, ctrl);
41567
- return visit_(key2, ctrl, visitor, path140);
41571
+ replaceNode(key2, path143, ctrl);
41572
+ return visit_(key2, ctrl, visitor, path143);
41568
41573
  }
41569
41574
  if (typeof ctrl !== "symbol") {
41570
41575
  if (isCollection(node)) {
41571
- path140 = Object.freeze(path140.concat(node));
41576
+ path143 = Object.freeze(path143.concat(node));
41572
41577
  for (let i = 0; i < node.items.length; ++i) {
41573
- const ci = visit_(i, node.items[i], visitor, path140);
41578
+ const ci = visit_(i, node.items[i], visitor, path143);
41574
41579
  if (typeof ci === "number")
41575
41580
  i = ci - 1;
41576
41581
  else if (ci === BREAK)
@@ -41581,13 +41586,13 @@ function visit_(key2, node, visitor, path140) {
41581
41586
  }
41582
41587
  }
41583
41588
  } else if (isPair(node)) {
41584
- path140 = Object.freeze(path140.concat(node));
41585
- const ck = visit_("key", node.key, visitor, path140);
41589
+ path143 = Object.freeze(path143.concat(node));
41590
+ const ck = visit_("key", node.key, visitor, path143);
41586
41591
  if (ck === BREAK)
41587
41592
  return BREAK;
41588
41593
  else if (ck === REMOVE)
41589
41594
  node.key = null;
41590
- const cv = visit_("value", node.value, visitor, path140);
41595
+ const cv = visit_("value", node.value, visitor, path143);
41591
41596
  if (cv === BREAK)
41592
41597
  return BREAK;
41593
41598
  else if (cv === REMOVE)
@@ -41605,17 +41610,17 @@ async function visitAsync(node, visitor) {
41605
41610
  } else
41606
41611
  await visitAsync_(null, node, visitor_, Object.freeze([]));
41607
41612
  }
41608
- async function visitAsync_(key2, node, visitor, path140) {
41609
- const ctrl = await callVisitor(key2, node, visitor, path140);
41613
+ async function visitAsync_(key2, node, visitor, path143) {
41614
+ const ctrl = await callVisitor(key2, node, visitor, path143);
41610
41615
  if (isNode(ctrl) || isPair(ctrl)) {
41611
- replaceNode(key2, path140, ctrl);
41612
- return visitAsync_(key2, ctrl, visitor, path140);
41616
+ replaceNode(key2, path143, ctrl);
41617
+ return visitAsync_(key2, ctrl, visitor, path143);
41613
41618
  }
41614
41619
  if (typeof ctrl !== "symbol") {
41615
41620
  if (isCollection(node)) {
41616
- path140 = Object.freeze(path140.concat(node));
41621
+ path143 = Object.freeze(path143.concat(node));
41617
41622
  for (let i = 0; i < node.items.length; ++i) {
41618
- const ci = await visitAsync_(i, node.items[i], visitor, path140);
41623
+ const ci = await visitAsync_(i, node.items[i], visitor, path143);
41619
41624
  if (typeof ci === "number")
41620
41625
  i = ci - 1;
41621
41626
  else if (ci === BREAK)
@@ -41626,13 +41631,13 @@ async function visitAsync_(key2, node, visitor, path140) {
41626
41631
  }
41627
41632
  }
41628
41633
  } else if (isPair(node)) {
41629
- path140 = Object.freeze(path140.concat(node));
41630
- const ck = await visitAsync_("key", node.key, visitor, path140);
41634
+ path143 = Object.freeze(path143.concat(node));
41635
+ const ck = await visitAsync_("key", node.key, visitor, path143);
41631
41636
  if (ck === BREAK)
41632
41637
  return BREAK;
41633
41638
  else if (ck === REMOVE)
41634
41639
  node.key = null;
41635
- const cv = await visitAsync_("value", node.value, visitor, path140);
41640
+ const cv = await visitAsync_("value", node.value, visitor, path143);
41636
41641
  if (cv === BREAK)
41637
41642
  return BREAK;
41638
41643
  else if (cv === REMOVE)
@@ -41659,23 +41664,23 @@ function initVisitor(visitor) {
41659
41664
  }
41660
41665
  return visitor;
41661
41666
  }
41662
- function callVisitor(key2, node, visitor, path140) {
41667
+ function callVisitor(key2, node, visitor, path143) {
41663
41668
  if (typeof visitor === "function")
41664
- return visitor(key2, node, path140);
41669
+ return visitor(key2, node, path143);
41665
41670
  if (isMap(node))
41666
- return visitor.Map?.(key2, node, path140);
41671
+ return visitor.Map?.(key2, node, path143);
41667
41672
  if (isSeq(node))
41668
- return visitor.Seq?.(key2, node, path140);
41673
+ return visitor.Seq?.(key2, node, path143);
41669
41674
  if (isPair(node))
41670
- return visitor.Pair?.(key2, node, path140);
41675
+ return visitor.Pair?.(key2, node, path143);
41671
41676
  if (isScalar(node))
41672
- return visitor.Scalar?.(key2, node, path140);
41677
+ return visitor.Scalar?.(key2, node, path143);
41673
41678
  if (isAlias(node))
41674
- return visitor.Alias?.(key2, node, path140);
41679
+ return visitor.Alias?.(key2, node, path143);
41675
41680
  return void 0;
41676
41681
  }
41677
- function replaceNode(key2, path140, node) {
41678
- const parent = path140[path140.length - 1];
41682
+ function replaceNode(key2, path143, node) {
41683
+ const parent = path143[path143.length - 1];
41679
41684
  if (isCollection(parent)) {
41680
41685
  parent.items[key2] = node;
41681
41686
  } else if (isPair(parent)) {
@@ -42275,10 +42280,10 @@ var init_createNode = __esm({
42275
42280
  });
42276
42281
 
42277
42282
  // ../../node_modules/yaml/browser/dist/nodes/Collection.js
42278
- function collectionFromPath(schema4, path140, value) {
42283
+ function collectionFromPath(schema4, path143, value) {
42279
42284
  let v9 = value;
42280
- for (let i = path140.length - 1; i >= 0; --i) {
42281
- const k = path140[i];
42285
+ for (let i = path143.length - 1; i >= 0; --i) {
42286
+ const k = path143[i];
42282
42287
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
42283
42288
  const a = [];
42284
42289
  a[k] = v9;
@@ -42303,7 +42308,7 @@ var init_Collection = __esm({
42303
42308
  init_createNode();
42304
42309
  init_identity();
42305
42310
  init_Node();
42306
- isEmptyPath = (path140) => path140 == null || typeof path140 === "object" && !!path140[Symbol.iterator]().next().done;
42311
+ isEmptyPath = (path143) => path143 == null || typeof path143 === "object" && !!path143[Symbol.iterator]().next().done;
42307
42312
  Collection = class extends NodeBase {
42308
42313
  constructor(type, schema4) {
42309
42314
  super(type);
@@ -42333,11 +42338,11 @@ var init_Collection = __esm({
42333
42338
  * be a Pair instance or a `{ key, value }` object, which may not have a key
42334
42339
  * that already exists in the map.
42335
42340
  */
42336
- addIn(path140, value) {
42337
- if (isEmptyPath(path140))
42341
+ addIn(path143, value) {
42342
+ if (isEmptyPath(path143))
42338
42343
  this.add(value);
42339
42344
  else {
42340
- const [key2, ...rest] = path140;
42345
+ const [key2, ...rest] = path143;
42341
42346
  const node = this.get(key2, true);
42342
42347
  if (isCollection(node))
42343
42348
  node.addIn(rest, value);
@@ -42351,8 +42356,8 @@ var init_Collection = __esm({
42351
42356
  * Removes a value from the collection.
42352
42357
  * @returns `true` if the item was found and removed.
42353
42358
  */
42354
- deleteIn(path140) {
42355
- const [key2, ...rest] = path140;
42359
+ deleteIn(path143) {
42360
+ const [key2, ...rest] = path143;
42356
42361
  if (rest.length === 0)
42357
42362
  return this.delete(key2);
42358
42363
  const node = this.get(key2, true);
@@ -42366,8 +42371,8 @@ var init_Collection = __esm({
42366
42371
  * scalar values from their surrounding node; to disable set `keepScalar` to
42367
42372
  * `true` (collections are always returned intact).
42368
42373
  */
42369
- getIn(path140, keepScalar) {
42370
- const [key2, ...rest] = path140;
42374
+ getIn(path143, keepScalar) {
42375
+ const [key2, ...rest] = path143;
42371
42376
  const node = this.get(key2, true);
42372
42377
  if (rest.length === 0)
42373
42378
  return !keepScalar && isScalar(node) ? node.value : node;
@@ -42385,8 +42390,8 @@ var init_Collection = __esm({
42385
42390
  /**
42386
42391
  * Checks if the collection includes a value with the key `key`.
42387
42392
  */
42388
- hasIn(path140) {
42389
- const [key2, ...rest] = path140;
42393
+ hasIn(path143) {
42394
+ const [key2, ...rest] = path143;
42390
42395
  if (rest.length === 0)
42391
42396
  return this.has(key2);
42392
42397
  const node = this.get(key2, true);
@@ -42396,8 +42401,8 @@ var init_Collection = __esm({
42396
42401
  * Sets a value in this collection. For `!!set`, `value` needs to be a
42397
42402
  * boolean to add/remove the item from the set.
42398
42403
  */
42399
- setIn(path140, value) {
42400
- const [key2, ...rest] = path140;
42404
+ setIn(path143, value) {
42405
+ const [key2, ...rest] = path143;
42401
42406
  if (rest.length === 0) {
42402
42407
  this.set(key2, value);
42403
42408
  } else {
@@ -44831,9 +44836,9 @@ var init_Document = __esm({
44831
44836
  this.contents.add(value);
44832
44837
  }
44833
44838
  /** Adds a value to the document. */
44834
- addIn(path140, value) {
44839
+ addIn(path143, value) {
44835
44840
  if (assertCollection(this.contents))
44836
- this.contents.addIn(path140, value);
44841
+ this.contents.addIn(path143, value);
44837
44842
  }
44838
44843
  /**
44839
44844
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -44908,14 +44913,14 @@ var init_Document = __esm({
44908
44913
  * Removes a value from the document.
44909
44914
  * @returns `true` if the item was found and removed.
44910
44915
  */
44911
- deleteIn(path140) {
44912
- if (isEmptyPath(path140)) {
44916
+ deleteIn(path143) {
44917
+ if (isEmptyPath(path143)) {
44913
44918
  if (this.contents == null)
44914
44919
  return false;
44915
44920
  this.contents = null;
44916
44921
  return true;
44917
44922
  }
44918
- return assertCollection(this.contents) ? this.contents.deleteIn(path140) : false;
44923
+ return assertCollection(this.contents) ? this.contents.deleteIn(path143) : false;
44919
44924
  }
44920
44925
  /**
44921
44926
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -44930,10 +44935,10 @@ var init_Document = __esm({
44930
44935
  * scalar values from their surrounding node; to disable set `keepScalar` to
44931
44936
  * `true` (collections are always returned intact).
44932
44937
  */
44933
- getIn(path140, keepScalar) {
44934
- if (isEmptyPath(path140))
44938
+ getIn(path143, keepScalar) {
44939
+ if (isEmptyPath(path143))
44935
44940
  return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
44936
- return isCollection(this.contents) ? this.contents.getIn(path140, keepScalar) : void 0;
44941
+ return isCollection(this.contents) ? this.contents.getIn(path143, keepScalar) : void 0;
44937
44942
  }
44938
44943
  /**
44939
44944
  * Checks if the document includes a value with the key `key`.
@@ -44944,10 +44949,10 @@ var init_Document = __esm({
44944
44949
  /**
44945
44950
  * Checks if the document includes a value at `path`.
44946
44951
  */
44947
- hasIn(path140) {
44948
- if (isEmptyPath(path140))
44952
+ hasIn(path143) {
44953
+ if (isEmptyPath(path143))
44949
44954
  return this.contents !== void 0;
44950
- return isCollection(this.contents) ? this.contents.hasIn(path140) : false;
44955
+ return isCollection(this.contents) ? this.contents.hasIn(path143) : false;
44951
44956
  }
44952
44957
  /**
44953
44958
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -44964,13 +44969,13 @@ var init_Document = __esm({
44964
44969
  * Sets a value in this document. For `!!set`, `value` needs to be a
44965
44970
  * boolean to add/remove the item from the set.
44966
44971
  */
44967
- setIn(path140, value) {
44968
- if (isEmptyPath(path140)) {
44972
+ setIn(path143, value) {
44973
+ if (isEmptyPath(path143)) {
44969
44974
  this.contents = value;
44970
44975
  } else if (this.contents == null) {
44971
- this.contents = collectionFromPath(this.schema, Array.from(path140), value);
44976
+ this.contents = collectionFromPath(this.schema, Array.from(path143), value);
44972
44977
  } else if (assertCollection(this.contents)) {
44973
- this.contents.setIn(path140, value);
44978
+ this.contents.setIn(path143, value);
44974
44979
  }
44975
44980
  }
44976
44981
  /**
@@ -46875,15 +46880,15 @@ function visit2(cst, visitor) {
46875
46880
  cst = { start: cst.start, value: cst.value };
46876
46881
  _visit(Object.freeze([]), cst, visitor);
46877
46882
  }
46878
- function _visit(path140, item, visitor) {
46879
- let ctrl = visitor(item, path140);
46883
+ function _visit(path143, item, visitor) {
46884
+ let ctrl = visitor(item, path143);
46880
46885
  if (typeof ctrl === "symbol")
46881
46886
  return ctrl;
46882
46887
  for (const field of ["key", "value"]) {
46883
46888
  const token = item[field];
46884
46889
  if (token && "items" in token) {
46885
46890
  for (let i = 0; i < token.items.length; ++i) {
46886
- const ci = _visit(Object.freeze(path140.concat([[field, i]])), token.items[i], visitor);
46891
+ const ci = _visit(Object.freeze(path143.concat([[field, i]])), token.items[i], visitor);
46887
46892
  if (typeof ci === "number")
46888
46893
  i = ci - 1;
46889
46894
  else if (ci === BREAK2)
@@ -46894,10 +46899,10 @@ function _visit(path140, item, visitor) {
46894
46899
  }
46895
46900
  }
46896
46901
  if (typeof ctrl === "function" && field === "key")
46897
- ctrl = ctrl(item, path140);
46902
+ ctrl = ctrl(item, path143);
46898
46903
  }
46899
46904
  }
46900
- return typeof ctrl === "function" ? ctrl(item, path140) : ctrl;
46905
+ return typeof ctrl === "function" ? ctrl(item, path143) : ctrl;
46901
46906
  }
46902
46907
  var BREAK2, SKIP2, REMOVE2;
46903
46908
  var init_cst_visit = __esm({
@@ -46908,9 +46913,9 @@ var init_cst_visit = __esm({
46908
46913
  visit2.BREAK = BREAK2;
46909
46914
  visit2.SKIP = SKIP2;
46910
46915
  visit2.REMOVE = REMOVE2;
46911
- visit2.itemAtPath = (cst, path140) => {
46916
+ visit2.itemAtPath = (cst, path143) => {
46912
46917
  let item = cst;
46913
- for (const [field, index] of path140) {
46918
+ for (const [field, index] of path143) {
46914
46919
  const tok = item?.[field];
46915
46920
  if (tok && "items" in tok) {
46916
46921
  item = tok.items[index];
@@ -46919,9 +46924,9 @@ var init_cst_visit = __esm({
46919
46924
  }
46920
46925
  return item;
46921
46926
  };
46922
- visit2.parentCollection = (cst, path140) => {
46923
- const parent = visit2.itemAtPath(cst, path140.slice(0, -1));
46924
- const field = path140[path140.length - 1][0];
46927
+ visit2.parentCollection = (cst, path143) => {
46928
+ const parent = visit2.itemAtPath(cst, path143.slice(0, -1));
46929
+ const field = path143[path143.length - 1][0];
46925
46930
  const coll = parent?.[field];
46926
46931
  if (coll && "items" in coll)
46927
46932
  return coll;
@@ -48224,14 +48229,14 @@ var init_parser = __esm({
48224
48229
  case "scalar":
48225
48230
  case "single-quoted-scalar":
48226
48231
  case "double-quoted-scalar": {
48227
- const fs103 = this.flowScalar(this.type);
48232
+ const fs106 = this.flowScalar(this.type);
48228
48233
  if (atNextItem || it.value) {
48229
- map2.items.push({ start, key: fs103, sep: [] });
48234
+ map2.items.push({ start, key: fs106, sep: [] });
48230
48235
  this.onKeyLine = true;
48231
48236
  } else if (it.sep) {
48232
- this.stack.push(fs103);
48237
+ this.stack.push(fs106);
48233
48238
  } else {
48234
- Object.assign(it, { key: fs103, sep: [] });
48239
+ Object.assign(it, { key: fs106, sep: [] });
48235
48240
  this.onKeyLine = true;
48236
48241
  }
48237
48242
  return;
@@ -48359,13 +48364,13 @@ var init_parser = __esm({
48359
48364
  case "scalar":
48360
48365
  case "single-quoted-scalar":
48361
48366
  case "double-quoted-scalar": {
48362
- const fs103 = this.flowScalar(this.type);
48367
+ const fs106 = this.flowScalar(this.type);
48363
48368
  if (!it || it.value)
48364
- fc.items.push({ start: [], key: fs103, sep: [] });
48369
+ fc.items.push({ start: [], key: fs106, sep: [] });
48365
48370
  else if (it.sep)
48366
- this.stack.push(fs103);
48371
+ this.stack.push(fs106);
48367
48372
  else
48368
- Object.assign(it, { key: fs103, sep: [] });
48373
+ Object.assign(it, { key: fs106, sep: [] });
48369
48374
  return;
48370
48375
  }
48371
48376
  case "flow-map-end":
@@ -52174,9 +52179,9 @@ var init_podspec_ruby = __esm({
52174
52179
  }
52175
52180
  // ---- errors
52176
52181
  exceptionClass(name3) {
52177
- const path140 = name3.split("::");
52182
+ const path143 = name3.split("::");
52178
52183
  let module2 = this.object;
52179
- for (const part of path140) {
52184
+ for (const part of path143) {
52180
52185
  const next = module2.consts.get(part);
52181
52186
  if (!(next instanceof RModule))
52182
52187
  throw new UnsupportedRuby(`no exception class ${name3}`);
@@ -59000,16 +59005,16 @@ var init_pods_files = __esm({
59000
59005
  };
59001
59006
  unique = (values) => [...new Set(values)];
59002
59007
  XCFramework = class {
59003
- constructor(targetName, path140) {
59008
+ constructor(targetName, path143) {
59004
59009
  this.targetName = targetName;
59005
- this.path = path140;
59006
- const plist2 = parsePlistBytes(import_node_fs65.default.readFileSync(`${path140}/Info.plist`));
59010
+ this.path = path143;
59011
+ const plist2 = parsePlistBytes(import_node_fs65.default.readFileSync(`${path143}/Info.plist`));
59007
59012
  if (!isRecord(plist2) || !Array.isArray(plist2.AvailableLibraries))
59008
- throw new Error(`${path140}/Info.plist declares no AvailableLibraries`);
59013
+ throw new Error(`${path143}/Info.plist declares no AvailableLibraries`);
59009
59014
  this.slices = plist2.AvailableLibraries.map((library) => {
59010
59015
  if (!isRecord(library) || typeof library.LibraryIdentifier !== "string" || typeof library.LibraryPath !== "string" || typeof library.SupportedPlatform !== "string")
59011
- throw new Error(`${path140}/Info.plist has an invalid library entry`);
59012
- const root = `${path140}/${library.LibraryIdentifier}`;
59016
+ throw new Error(`${path143}/Info.plist has an invalid library entry`);
59017
+ const root = `${path143}/${library.LibraryIdentifier}`;
59013
59018
  const slicePath = `${root}/${library.LibraryPath}`;
59014
59019
  const extension = slicePath.slice(slicePath.lastIndexOf("."));
59015
59020
  const packaging = extension === ".framework" ? "framework" : extension === ".a" || extension === ".dylib" ? "library" : null;
@@ -59031,7 +59036,7 @@ var init_pods_files = __esm({
59031
59036
  }).sort((a, b) => byBytes2(a.identifier, b.identifier));
59032
59037
  if (this.slices.length === 0)
59033
59038
  throw new Error(
59034
- `XCFramework at ${path140} does not contain any frameworks or libraries.`
59039
+ `XCFramework at ${path143} does not contain any frameworks or libraries.`
59035
59040
  );
59036
59041
  }
59037
59042
  slices;
@@ -60885,9 +60890,9 @@ echo "SUCCESS" > "\${SCRIPT_OUTPUT_FILE_0}"
60885
60890
  DEFAULT_SHELL_SCRIPT = "# Type a script or drag a script file from your workspace to insert its path.\n";
60886
60891
  stringList2 = (value) => Array.isArray(value) && value.every((item) => typeof item === "string") ? value : null;
60887
60892
  UserProject = class {
60888
- constructor(table, path140, objectVersion) {
60893
+ constructor(table, path143, objectVersion) {
60889
60894
  this.table = table;
60890
- this.path = path140;
60895
+ this.path = path143;
60891
60896
  this.objectVersion = objectVersion;
60892
60897
  }
60893
60898
  get projectDir() {
@@ -67978,14 +67983,14 @@ function addAsset(into, asset) {
67978
67983
  function checkStack(dir, type, devices2) {
67979
67984
  const sets = (parent, allowed) => (0, import_node_fs76.readdirSync)(parent, { withFileTypes: true }).flatMap((entry) => {
67980
67985
  if (entry.name.startsWith(".") || entry.isFile()) return [];
67981
- const path140 = (0, import_node_path76.join)(parent, entry.name);
67986
+ const path143 = (0, import_node_path76.join)(parent, entry.name);
67982
67987
  const extension = (0, import_node_path76.extname)(entry.name);
67983
67988
  if (!entry.isDirectory() || !allowed.includes(extension))
67984
67989
  return refuse(
67985
- path140,
67990
+ path143,
67986
67991
  `image stack content other than ${allowed.join(", ")} is unproven`
67987
67992
  );
67988
- return [{ path: path140, extension }];
67993
+ return [{ path: path143, extension }];
67989
67994
  });
67990
67995
  for (const layer of sets(dir, [`.${type}layer`, ".imageset", ".colorset"])) {
67991
67996
  if (layer.extension !== `.${type}layer`) continue;
@@ -67997,37 +68002,37 @@ function checkStack(dir, type, devices2) {
67997
68002
  function walk2(dir, into, devices2, extensions) {
67998
68003
  for (const entry of (0, import_node_fs76.readdirSync)(dir, { withFileTypes: true })) {
67999
68004
  if (entry.name.startsWith(".") || entry.isFile()) continue;
68000
- const path140 = (0, import_node_path76.join)(dir, entry.name);
68001
- if (!entry.isDirectory()) return refuse(path140, "it is neither a file nor a directory");
68005
+ const path143 = (0, import_node_path76.join)(dir, entry.name);
68006
+ if (!entry.isDirectory()) return refuse(path143, "it is neither a file nor a directory");
68002
68007
  const extension = (0, import_node_path76.extname)(entry.name).slice(1);
68003
68008
  const type = extension.toLowerCase();
68004
68009
  const base2 = entry.name.slice(0, entry.name.length - extension.length - 1);
68005
68010
  if (type !== extension && knownTypes.has(type))
68006
- return refuse(path140, "its type extension is not lowercase");
68011
+ return refuse(path143, "its type extension is not lowercase");
68007
68012
  if (type === "colorset" || type === "imageset" || type === "symbolset") {
68008
68013
  addAsset(into, {
68009
68014
  kind: type === "colorset" ? "color" : "image",
68010
68015
  name: base2,
68011
- ...assetState(path140, type, devices2),
68016
+ ...assetState(path143, type, devices2),
68012
68017
  extensions,
68013
- source: path140
68018
+ source: path143
68014
68019
  });
68015
68020
  continue;
68016
68021
  }
68017
68022
  if (silentTypes.has(type)) continue;
68018
68023
  if (stackTypes.has(type)) {
68019
- checkStack(path140, type, devices2);
68024
+ checkStack(path143, type, devices2);
68020
68025
  continue;
68021
68026
  }
68022
- if (unprovenTypes.has(type)) return refuse(path140, `${type} assets are unproven`);
68027
+ if (unprovenTypes.has(type)) return refuse(path143, `${type} assets are unproven`);
68023
68028
  const name3 = type === "spriteatlas" ? base2 : entry.name;
68024
- if (!folderProperties((0, import_node_path76.join)(path140, "Contents.json")).namespace) {
68025
- walk2(path140, into, devices2, extensions);
68029
+ if (!folderProperties((0, import_node_path76.join)(path143, "Contents.json")).namespace) {
68030
+ walk2(path143, into, devices2, extensions);
68026
68031
  continue;
68027
68032
  }
68028
- const child = into.namespaces.get(name3) ?? scope(path140);
68033
+ const child = into.namespaces.get(name3) ?? scope(path143);
68029
68034
  into.namespaces.set(name3, child);
68030
- walk2(path140, child, devices2, extensions);
68035
+ walk2(path143, child, devices2, extensions);
68031
68036
  }
68032
68037
  }
68033
68038
  function words(name3) {
@@ -68074,11 +68079,11 @@ function members(into, kind, prefix, extensions) {
68074
68079
  const assets2 = /* @__PURE__ */ new Set();
68075
68080
  const out = [];
68076
68081
  for (const entry of entries2) {
68077
- const path140 = `${prefix}${entry.name}`;
68082
+ const path143 = `${prefix}${entry.name}`;
68078
68083
  const source = entry.child ? entry.child.source : entry.asset.source;
68079
68084
  if (Array.from(entry.name).some((char) => char.charCodeAt(0) > 127))
68080
68085
  refuse(source, "its name is not ASCII");
68081
- const named = (text8) => `The \\"${escape(path140)}\\" ${text8}`;
68086
+ const named = (text8) => `The \\"${escape(path143)}\\" ${text8}`;
68082
68087
  if (entry.child) {
68083
68088
  const text8 = symbol(entry.name, true);
68084
68089
  if (!text8)
@@ -68101,9 +68106,9 @@ function members(into, kind, prefix, extensions) {
68101
68106
  namespaces.add(text8);
68102
68107
  out.push({
68103
68108
  type: "namespace",
68104
- path: path140,
68109
+ path: path143,
68105
68110
  symbol: spelled(text8),
68106
- members: members(entry.child, kind, `${path140}/`, extensions)
68111
+ members: members(entry.child, kind, `${path143}/`, extensions)
68107
68112
  });
68108
68113
  }
68109
68114
  continue;
@@ -68130,7 +68135,7 @@ function members(into, kind, prefix, extensions) {
68130
68135
  else if (!omitted)
68131
68136
  out.push({
68132
68137
  type: "asset",
68133
- path: path140,
68138
+ path: path143,
68134
68139
  name: entry.name,
68135
68140
  symbol: spelled(text7),
68136
68141
  thinnable: asset.thinnable,
@@ -68411,8 +68416,8 @@ var init_xcode_asset_symbols = __esm({
68411
68416
  import_node_path76 = require("node:path");
68412
68417
  Refusal = class extends Error {
68413
68418
  };
68414
- refuse = (path140, reason) => {
68415
- throw new Refusal(`Generated asset symbols are unproven for ${path140}: ${reason}`);
68419
+ refuse = (path143, reason) => {
68420
+ throw new Refusal(`Generated asset symbols are unproven for ${path143}: ${reason}`);
68416
68421
  };
68417
68422
  isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
68418
68423
  scope = (source) => ({
@@ -68858,11 +68863,11 @@ function catalogDigest(directory2) {
68858
68863
  for (const entry of (0, import_node_fs77.readdirSync)(dir, { withFileTypes: true }).sort(
68859
68864
  (a, b) => a.name.localeCompare(b.name)
68860
68865
  )) {
68861
- const path140 = (0, import_node_path77.join)(dir, entry.name);
68862
- if (entry.isDirectory()) walk4(path140);
68863
- else if (entry.isFile() && (0, import_node_fs77.statSync)(path140).size <= 64 * 1024 * 1024)
68864
- hashes.push([(0, import_node_path77.relative)(directory2, path140), sha2562((0, import_node_fs77.readFileSync)(path140))]);
68865
- else throw new Error(`Unsupported asset catalog entry: ${path140}`);
68866
+ const path143 = (0, import_node_path77.join)(dir, entry.name);
68867
+ if (entry.isDirectory()) walk4(path143);
68868
+ else if (entry.isFile() && (0, import_node_fs77.statSync)(path143).size <= 64 * 1024 * 1024)
68869
+ hashes.push([(0, import_node_path77.relative)(directory2, path143), sha2562((0, import_node_fs77.readFileSync)(path143))]);
68870
+ else throw new Error(`Unsupported asset catalog entry: ${path143}`);
68866
68871
  }
68867
68872
  };
68868
68873
  walk4(directory2);
@@ -68873,7 +68878,7 @@ function symbolSource(plan, root) {
68873
68878
  const known = symbolTexts.get(key2);
68874
68879
  if (known !== void 0) return { status: "source", text: known };
68875
68880
  const source = assetSymbolSource(
68876
- plan.catalogs.map(({ path: path140 }) => (0, import_node_path77.join)(root, path140)),
68881
+ plan.catalogs.map(({ path: path143 }) => (0, import_node_path77.join)(root, path143)),
68877
68882
  plan.settings
68878
68883
  );
68879
68884
  if (source.status === "source") symbolTexts.set(key2, source.text);
@@ -68932,9 +68937,9 @@ function planAssetSymbols(resources, root, settings) {
68932
68937
  `Generated asset symbols are proven only for TARGETED_DEVICE_FAMILY 1, 2, 1,2, 1,7, 1,3,7, 1,2,6 or 1,2,7; this target resolves to "${families}".`
68933
68938
  );
68934
68939
  const plan = {
68935
- catalogs: catalogs.map((path140) => ({
68936
- path: path140,
68937
- sha256: catalogDigest((0, import_node_path77.join)(root, path140))
68940
+ catalogs: catalogs.map((path143) => ({
68941
+ path: path143,
68942
+ sha256: catalogDigest((0, import_node_path77.join)(root, path143))
68938
68943
  })),
68939
68944
  settings: { deployment: target, devices: devices2, extensions: extensions === "YES" }
68940
68945
  };
@@ -73166,10 +73171,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
73166
73171
  if (!isDict(entry)) return [];
73167
73172
  if (entry.isa === "PBXFileSystemSynchronizedRootGroup") {
73168
73173
  const folder = project2.resolvePath(id);
73169
- const pending = folder ? [folder] : [];
73174
+ const pending2 = folder ? [folder] : [];
73170
73175
  const packages = [];
73171
- while (pending.length > 0) {
73172
- const dir = pending.pop();
73176
+ while (pending2.length > 0) {
73177
+ const dir = pending2.pop();
73173
73178
  if (import_node_fs79.default.existsSync(import_node_path80.default.join(dir, "Package.swift"))) {
73174
73179
  packages.push(dir);
73175
73180
  continue;
@@ -73177,7 +73182,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
73177
73182
  if (!isDirectory3(dir)) continue;
73178
73183
  for (const child of import_node_fs79.default.readdirSync(dir, { withFileTypes: true }))
73179
73184
  if (child.isDirectory() && !child.name.startsWith("."))
73180
- pending.push(import_node_path80.default.join(dir, child.name));
73185
+ pending2.push(import_node_path80.default.join(dir, child.name));
73181
73186
  }
73182
73187
  return packages;
73183
73188
  }
@@ -73668,14 +73673,14 @@ function localPackageDirectories(root, app) {
73668
73673
  }
73669
73674
  async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, podsEnvironment = reactNativePodsEnvironment()) {
73670
73675
  const key2 = JSON.stringify([app, everyByte, sourceOnly, podsEnvironment]);
73671
- let pending = hashing.get(key2);
73672
- if (!pending) {
73673
- pending = walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment).finally(
73676
+ let pending2 = hashing.get(key2);
73677
+ if (!pending2) {
73678
+ pending2 = walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment).finally(
73674
73679
  () => hashing.delete(key2)
73675
73680
  );
73676
- hashing.set(key2, pending);
73681
+ hashing.set(key2, pending2);
73677
73682
  }
73678
- const inputs2 = await pending;
73683
+ const inputs2 = await pending2;
73679
73684
  signal?.throwIfAborted();
73680
73685
  return inputs2;
73681
73686
  }
@@ -74829,8 +74834,8 @@ async function ensureCompose(toolchain) {
74829
74834
  }
74830
74835
  function ensureToolchain(toolchain) {
74831
74836
  const key2 = JSON.stringify(toolchain);
74832
- const pending = toolchains.get(key2);
74833
- if (pending) return pending;
74837
+ const pending2 = toolchains.get(key2);
74838
+ if (pending2) return pending2;
74834
74839
  const ready = (async () => {
74835
74840
  const dir = import_node_path83.default.join(kotlinHome(), toolchain.compiler.version);
74836
74841
  const compilerDir = import_node_path83.default.join(dir, `compiler-${toolchain.compiler.sha256}`);
@@ -77303,13 +77308,13 @@ function packageNativeRequests(dir) {
77303
77308
  }
77304
77309
  function dependencyNativeOwners(appDir, manifest) {
77305
77310
  const owners = /* @__PURE__ */ new Map();
77306
- const pending = Object.keys({
77311
+ const pending2 = Object.keys({
77307
77312
  ...manifest?.devDependencies,
77308
77313
  ...manifest?.dependencies
77309
77314
  }).map((name3) => ({ from: appDir, name: name3 }));
77310
77315
  const visited = /* @__PURE__ */ new Set();
77311
- for (let index = 0; index < pending.length; index++) {
77312
- const { from, name: name3 } = pending[index];
77316
+ for (let index = 0; index < pending2.length; index++) {
77317
+ const { from, name: name3 } = pending2[index];
77313
77318
  const dir = installedPackageDir(from, name3);
77314
77319
  if (!dir || visited.has(dir)) continue;
77315
77320
  visited.add(dir);
@@ -77324,7 +77329,7 @@ function dependencyNativeOwners(appDir, manifest) {
77324
77329
  ...dependency?.dependencies,
77325
77330
  ...isRecord(optional3) ? optional3 : {}
77326
77331
  }))
77327
- pending.push({ from: dir, name: child });
77332
+ pending2.push({ from: dir, name: child });
77328
77333
  }
77329
77334
  return owners;
77330
77335
  }
@@ -77499,7 +77504,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
77499
77504
  expoModule: moduleDir ? (0, import_node_path88.relative)(appDir, moduleDir) || "." : null,
77500
77505
  optional: optional3,
77501
77506
  swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
77502
- (path140) => path140.endsWith(".swift") && [...(readSmallFile(path140) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
77507
+ (path143) => path143.endsWith(".swift") && [...(readSmallFile(path143) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
77503
77508
  (match) => match[1] === name3
77504
77509
  )
77505
77510
  ) : false,
@@ -79592,26 +79597,26 @@ var init_native_preparation = __esm({
79592
79597
  const token = params.get(NATIVE_PREPARE_QUERY_PARAM);
79593
79598
  const inputs2 = token ? watchNativeInputs(root) : void 0;
79594
79599
  const key2 = inputs2 ? `${owner}\0${resolveActiveRuntimeRoot() ?? ""}` : owner;
79595
- let pending = this.compiling;
79600
+ let pending2 = this.compiling;
79596
79601
  if (inputs2) {
79597
79602
  const prepared = this.prepared.get(inputs2);
79598
- if (prepared) pending = prepared;
79603
+ if (prepared) pending2 = prepared;
79599
79604
  else {
79600
- pending = /* @__PURE__ */ new Map();
79601
- this.prepared.set(inputs2, pending);
79605
+ pending2 = /* @__PURE__ */ new Map();
79606
+ this.prepared.set(inputs2, pending2);
79602
79607
  }
79603
79608
  }
79604
- let preparation = pending.get(key2);
79609
+ let preparation = pending2.get(key2);
79605
79610
  if (!preparation || preparation.ready && !reusable(preparation.ready.value)) {
79606
79611
  const next = { result: Promise.resolve().then(compile2) };
79607
79612
  preparation = next;
79608
- pending.set(key2, next);
79613
+ pending2.set(key2, next);
79609
79614
  void next.result.then(
79610
79615
  (value2) => {
79611
- if (!inputs2 || !reusable(value2)) pending.delete(key2);
79616
+ if (!inputs2 || !reusable(value2)) pending2.delete(key2);
79612
79617
  else next.ready = { value: value2 };
79613
79618
  },
79614
- () => pending.delete(key2)
79619
+ () => pending2.delete(key2)
79615
79620
  );
79616
79621
  }
79617
79622
  const value = await preparation.result;
@@ -80484,12 +80489,12 @@ function installedNativeLibraries(providers, projectRoot, moduleRoot, iosTarget,
80484
80489
  function installedPodBinaries(directory2) {
80485
80490
  if (!import_node_fs93.default.existsSync(directory2)) return [];
80486
80491
  const binaries = [];
80487
- const pending = [directory2];
80488
- for (let current2 = pending.pop(); current2; current2 = pending.pop())
80492
+ const pending2 = [directory2];
80493
+ for (let current2 = pending2.pop(); current2; current2 = pending2.pop())
80489
80494
  for (const entry of import_node_fs93.default.readdirSync(current2, { withFileTypes: true })) {
80490
80495
  const file = import_node_path95.default.join(current2, entry.name);
80491
80496
  if (entry.isDirectory() && BINARY_BUNDLE.test(entry.name)) binaries.push(file);
80492
- else if (entry.isDirectory()) pending.push(file);
80497
+ else if (entry.isDirectory()) pending2.push(file);
80493
80498
  else if (entry.name.endsWith(".a")) binaries.push(file);
80494
80499
  else if (SOURCE.test(entry.name)) return [];
80495
80500
  }
@@ -80744,10 +80749,10 @@ var require_path_parse = __commonJS({
80744
80749
  code === 45 || /* - */
80745
80750
  code === 46;
80746
80751
  }
80747
- function State(path140) {
80752
+ function State(path143) {
80748
80753
  this.index = 0;
80749
- this.path = path140;
80750
- this.max = path140.length;
80754
+ this.path = path143;
80755
+ this.max = path143.length;
80751
80756
  this.result = [];
80752
80757
  this.param = 0;
80753
80758
  this.err = "";
@@ -81121,7 +81126,7 @@ var require_a2c = __commonJS({
81121
81126
  }
81122
81127
  return sign * Math.acos(dot);
81123
81128
  }
81124
- function get_arc_center(x1, y1, x2, y2, fa, fs103, rx, ry, sin_phi, cos_phi) {
81129
+ function get_arc_center(x1, y1, x2, y2, fa, fs106, rx, ry, sin_phi, cos_phi) {
81125
81130
  var x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
81126
81131
  var y1p = -sin_phi * (x1 - x2) / 2 + cos_phi * (y1 - y2) / 2;
81127
81132
  var rx_sq = rx * rx;
@@ -81133,7 +81138,7 @@ var require_a2c = __commonJS({
81133
81138
  radicant = 0;
81134
81139
  }
81135
81140
  radicant /= rx_sq * y1p_sq + ry_sq * x1p_sq;
81136
- radicant = Math.sqrt(radicant) * (fa === fs103 ? -1 : 1);
81141
+ radicant = Math.sqrt(radicant) * (fa === fs106 ? -1 : 1);
81137
81142
  var cxp = radicant * rx / ry * y1p;
81138
81143
  var cyp = radicant * -ry / rx * x1p;
81139
81144
  var cx = cos_phi * cxp - sin_phi * cyp + (x1 + x2) / 2;
@@ -81144,10 +81149,10 @@ var require_a2c = __commonJS({
81144
81149
  var v2y = (-y1p - cyp) / ry;
81145
81150
  var theta1 = unit_vector_angle(1, 0, v1x, v1y);
81146
81151
  var delta_theta = unit_vector_angle(v1x, v1y, v2x, v2y);
81147
- if (fs103 === 0 && delta_theta > 0) {
81152
+ if (fs106 === 0 && delta_theta > 0) {
81148
81153
  delta_theta -= TAU;
81149
81154
  }
81150
- if (fs103 === 1 && delta_theta < 0) {
81155
+ if (fs106 === 1 && delta_theta < 0) {
81151
81156
  delta_theta += TAU;
81152
81157
  }
81153
81158
  return [cx, cy, theta1, delta_theta];
@@ -81160,7 +81165,7 @@ var require_a2c = __commonJS({
81160
81165
  var y2 = Math.sin(theta1 + delta_theta);
81161
81166
  return [x1, y1, x1 - y1 * alpha, y1 + x1 * alpha, x2 + y2 * alpha, y2 - x2 * alpha, x2, y2];
81162
81167
  }
81163
- module2.exports = function a2c(x1, y1, x2, y2, fa, fs103, rx, ry, phi) {
81168
+ module2.exports = function a2c(x1, y1, x2, y2, fa, fs106, rx, ry, phi) {
81164
81169
  var sin_phi = Math.sin(phi * TAU / 360);
81165
81170
  var cos_phi = Math.cos(phi * TAU / 360);
81166
81171
  var x1p = cos_phi * (x1 - x2) / 2 + sin_phi * (y1 - y2) / 2;
@@ -81178,7 +81183,7 @@ var require_a2c = __commonJS({
81178
81183
  rx *= Math.sqrt(lambda);
81179
81184
  ry *= Math.sqrt(lambda);
81180
81185
  }
81181
- var cc = get_arc_center(x1, y1, x2, y2, fa, fs103, rx, ry, sin_phi, cos_phi);
81186
+ var cc = get_arc_center(x1, y1, x2, y2, fa, fs106, rx, ry, sin_phi, cos_phi);
81182
81187
  var result = [];
81183
81188
  var theta1 = cc[2];
81184
81189
  var delta_theta = cc[3];
@@ -81267,11 +81272,11 @@ var require_svgpath = __commonJS({
81267
81272
  var matrix = require_matrix();
81268
81273
  var a2c = require_a2c();
81269
81274
  var ellipse = require_ellipse();
81270
- function SvgPath(path140) {
81275
+ function SvgPath(path143) {
81271
81276
  if (!(this instanceof SvgPath)) {
81272
- return new SvgPath(path140);
81277
+ return new SvgPath(path143);
81273
81278
  }
81274
- var pstate = pathParse(path140);
81279
+ var pstate = pathParse(path143);
81275
81280
  this.segments = pstate.segments;
81276
81281
  this.err = pstate.err;
81277
81282
  this.__stack = [];
@@ -81754,8 +81759,8 @@ function imagesetFiles(images) {
81754
81759
  function bundleImageRenditionKey(file, scale) {
81755
81760
  return extOf(file) === ".svg" ? `${file}/${scale}x.png` : file;
81756
81761
  }
81757
- function flatScale(path140) {
81758
- const match = /@([23])x\.[^./]+$/.exec(path140);
81762
+ function flatScale(path143) {
81763
+ const match = /@([23])x\.[^./]+$/.exec(path143);
81759
81764
  return match ? Number(match[1]) : 1;
81760
81765
  }
81761
81766
  function providesNamespace(text7) {
@@ -81782,8 +81787,8 @@ function catalogEntryName(contentsPath, kind, readText2) {
81782
81787
  }
81783
81788
  return segments.join("/");
81784
81789
  }
81785
- function isFlatResourceImage(path140) {
81786
- return path140.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path140));
81790
+ function isFlatResourceImage(path143) {
81791
+ return path143.split("/").includes("Resources") && RASTER_EXTENSIONS.has(extOf(path143));
81787
81792
  }
81788
81793
  function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
81789
81794
  const table = [];
@@ -81796,7 +81801,7 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
81796
81801
  seen.set(bundlePath, names);
81797
81802
  return { bundlePath, names };
81798
81803
  };
81799
- const catalogs = paths.filter((path140) => baseOf(path140) === "Contents.json");
81804
+ const catalogs = paths.filter((path143) => baseOf(path143) === "Contents.json");
81800
81805
  for (const contentsPath of catalogs) {
81801
81806
  const name3 = catalogEntryName(contentsPath, ".imageset", readText2);
81802
81807
  if (name3 === null) continue;
@@ -81829,16 +81834,16 @@ function enumerateBundleImages(paths, readText2, bundleForFile = () => ".") {
81829
81834
  ...intent === "template" || intent === "original" ? { renderingMode: intent } : {}
81830
81835
  });
81831
81836
  }
81832
- for (const path140 of paths) {
81833
- if (!isFlatResourceImage(path140)) continue;
81834
- const filename = baseOf(path140);
81837
+ for (const path143 of paths) {
81838
+ if (!isFlatResourceImage(path143)) continue;
81839
+ const filename = baseOf(path143);
81835
81840
  const name3 = filename.slice(0, -extOf(filename).length);
81836
- const { bundlePath, names } = namesFor(path140);
81841
+ const { bundlePath, names } = namesFor(path143);
81837
81842
  if (name3 === "" || names.has(name3)) continue;
81838
81843
  names.add(name3);
81839
81844
  const scaledFilename = filename.replace(/@[23]x(?=\.[^./]+$)/, "");
81840
81845
  const fileNames = (scaledFilename === filename ? [filename] : [filename, scaledFilename]).filter((lookup2) => !names.has(lookup2));
81841
- table.push({ name: name3, file: path140, scale: flatScale(path140), bundlePath, fileNames });
81846
+ table.push({ name: name3, file: path143, scale: flatScale(path143), bundlePath, fileNames });
81842
81847
  }
81843
81848
  return table;
81844
81849
  }
@@ -81873,7 +81878,7 @@ function colorsetValue(color) {
81873
81878
  }
81874
81879
  function enumerateBundleColors(paths, readText2) {
81875
81880
  const table = {};
81876
- for (const contentsPath of paths.filter((path140) => baseOf(path140) === "Contents.json")) {
81881
+ for (const contentsPath of paths.filter((path143) => baseOf(path143) === "Contents.json")) {
81877
81882
  const name3 = catalogEntryName(contentsPath, ".colorset", readText2);
81878
81883
  if (name3 === null || name3 in table) continue;
81879
81884
  let colors;
@@ -81937,8 +81942,8 @@ function axisExtremes(points) {
81937
81942
  function pathBounds(d) {
81938
81943
  const xs = [];
81939
81944
  const ys = [];
81940
- for (const path140 of d)
81941
- (0, import_svgpath.default)(path140).abs().unshort().unarc().iterate((segment3, _index, x, y) => {
81945
+ for (const path143 of d)
81946
+ (0, import_svgpath.default)(path143).abs().unshort().unarc().iterate((segment3, _index, x, y) => {
81942
81947
  const [command, ...args] = segment3;
81943
81948
  if (command === "M" || command === "L") {
81944
81949
  xs.push(Number(args[0]));
@@ -82004,7 +82009,7 @@ function guide(elements, id, axis) {
82004
82009
  }
82005
82010
  function enumerateBundleSymbols(paths, readText2, bundleForFile) {
82006
82011
  const table = {};
82007
- for (const contentsPath of paths.filter((path140) => baseOf(path140) === "Contents.json")) {
82012
+ for (const contentsPath of paths.filter((path143) => baseOf(path143) === "Contents.json")) {
82008
82013
  const name3 = catalogEntryName(contentsPath, ".symbolset", readText2);
82009
82014
  if (name3 === null) continue;
82010
82015
  const bundle = bundleForFile(contentsPath);
@@ -82070,8 +82075,8 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
82070
82075
  advance,
82071
82076
  box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
82072
82077
  ...bearings ? { customLayout: { bearings, verticalOutset, descent } } : {},
82073
- layers: d.map((path140) => ({
82074
- d: (0, import_svgpath.default)(path140).abs().scale(em).translate(translateX, translateY).round(3).toString()
82078
+ layers: d.map((path143) => ({
82079
+ d: (0, import_svgpath.default)(path143).abs().scale(em).translate(translateX, translateY).round(3).toString()
82075
82080
  }))
82076
82081
  };
82077
82082
  table[vectorKey] = vector;
@@ -82082,13 +82087,13 @@ function enumerateBundleSymbols(paths, readText2, bundleForFile) {
82082
82087
  }
82083
82088
  return table;
82084
82089
  }
82085
- function isCopiedResource(path140, copiedBundle, copyLooseRasters) {
82086
- const segments = path140.split("/");
82090
+ function isCopiedResource(path143, copiedBundle, copyLooseRasters) {
82091
+ const segments = path143.split("/");
82087
82092
  if (segments.some((segment3) => /\.(atlasc|bundle|storyboardc|nib|momd)$/.test(segment3)))
82088
82093
  return true;
82089
82094
  if (segments.some((segment3) => /\.xcdatamodeld?$/.test(segment3))) return false;
82090
82095
  if (copiedBundle) return true;
82091
- const ext = extOf(path140);
82096
+ const ext = extOf(path143);
82092
82097
  if (ext === ".json" || ext === ".xcstrings") return true;
82093
82098
  return !COMPILED_EXTENSIONS.has(ext) && (copyLooseRasters || !RASTER_EXTENSIONS.has(ext)) && !segments.some((segment3) => segment3.endsWith(".xcassets"));
82094
82099
  }
@@ -82096,7 +82101,7 @@ function enumerateBundleResources(paths, { copiedBundle = false, copyLooseRaster
82096
82101
  const found = [];
82097
82102
  const seen = /* @__PURE__ */ new Set();
82098
82103
  const ordered = [...paths].filter(
82099
- (path140) => path140.split("/").includes("Resources") && path140.split("/").every((segment3) => segment3 !== "" && segment3 !== "..") && isCopiedResource(path140, copiedBundle, copyLooseRasters)
82104
+ (path143) => path143.split("/").includes("Resources") && path143.split("/").every((segment3) => segment3 !== "" && segment3 !== "..") && isCopiedResource(path143, copiedBundle, copyLooseRasters)
82100
82105
  ).sort((a, b) => {
82101
82106
  const aDepth = a.split("/").length;
82102
82107
  const bDepth = b.split("/").length;
@@ -82244,31 +82249,31 @@ function tokens(text7) {
82244
82249
  }
82245
82250
  return result;
82246
82251
  }
82247
- function qualified(language, key2, path140) {
82248
- return `(${language}: ${key2}${path140 === "" ? "" : "|==|" + path140})`;
82252
+ function qualified(language, key2, path143) {
82253
+ return `(${language}: ${key2}${path143 === "" ? "" : "|==|" + path143})`;
82249
82254
  }
82250
- function requiresNumber(language, key2, path140) {
82255
+ function requiresNumber(language, key2, path143) {
82251
82256
  return Error(
82252
- "Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path140)
82257
+ "Plural variation requires referencing the number in the string. To maintain grammatical correctness for strings that do not reference the number of items, use separate top-level strings for one and greater than one. " + qualified(language, key2, path143)
82253
82258
  );
82254
82259
  }
82255
- function moreThanOne(language, key2, path140) {
82260
+ function moreThanOne(language, key2, path143) {
82256
82261
  return Error(
82257
- "Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path140)
82262
+ "Cannot infer format specifier for string group because more than one numerical specifier was found " + qualified(language, key2, path143)
82258
82263
  );
82259
82264
  }
82260
82265
  function schemaPath(segments) {
82261
82266
  return segments.map((segment3) => `'${segment3}'`).join(" -> ");
82262
82267
  }
82263
- function checkUnitShape(node, path140) {
82268
+ function checkUnitShape(node, path143) {
82264
82269
  const raw2 = node.stringUnit;
82265
82270
  if (raw2 === void 0)
82266
- throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path140)}`);
82271
+ throw Error(`Missing required key 'stringUnit' inside ${schemaPath(path143)}`);
82267
82272
  if (raw2 === null)
82268
- throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path140)}`);
82273
+ throw Error(`Missing required value for key 'stringUnit' inside ${schemaPath(path143)}`);
82269
82274
  if (!isRecord6(raw2))
82270
- throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path140)}`);
82271
- const unitPath = [...path140, "stringUnit"];
82275
+ throw Error(`Expected dictionary for key 'stringUnit' inside ${schemaPath(path143)}`);
82276
+ const unitPath = [...path143, "stringUnit"];
82272
82277
  if (!Object.hasOwn(raw2, "state"))
82273
82278
  throw Error(`Missing required key 'state' inside ${schemaPath(unitPath)}`);
82274
82279
  const state = raw2.state;
@@ -82285,38 +82290,38 @@ function checkUnitShape(node, path140) {
82285
82290
  throw Error(`Expected string for key 'value' inside ${schemaPath(unitPath)}`);
82286
82291
  return value;
82287
82292
  }
82288
- function checkPluralShape(node, path140) {
82293
+ function checkPluralShape(node, path143) {
82289
82294
  for (const [category, raw2] of Object.entries(node)) {
82290
- const categoryPath = [...path140, category];
82295
+ const categoryPath = [...path143, category];
82291
82296
  if (raw2 === null)
82292
82297
  throw Error(
82293
- `Missing required value for key '${category}' inside ${schemaPath(path140)}`
82298
+ `Missing required value for key '${category}' inside ${schemaPath(path143)}`
82294
82299
  );
82295
82300
  if (!isRecord6(raw2))
82296
- throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path140)}`);
82301
+ throw Error(`Expected dictionary for key '${category}' inside ${schemaPath(path143)}`);
82297
82302
  checkUnitShape(raw2, categoryPath);
82298
82303
  }
82299
82304
  }
82300
- function checkLocalizationShape(node, path140, deviceValue = false) {
82305
+ function checkLocalizationShape(node, path143, deviceValue = false) {
82301
82306
  if (node === null)
82302
82307
  throw Error(
82303
- `Missing required value for key '${path140[path140.length - 1]}' inside ${schemaPath(path140.slice(0, -1))}`
82308
+ `Missing required value for key '${path143[path143.length - 1]}' inside ${schemaPath(path143.slice(0, -1))}`
82304
82309
  );
82305
82310
  if (!isRecord6(node))
82306
82311
  throw Error(
82307
- `Expected dictionary for key '${path140[path140.length - 1]}' inside ${schemaPath(path140.slice(0, -1))}`
82312
+ `Expected dictionary for key '${path143[path143.length - 1]}' inside ${schemaPath(path143.slice(0, -1))}`
82308
82313
  );
82309
- if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path140);
82314
+ if (Object.hasOwn(node, "variations")) checkVariationsShape(node.variations, path143);
82310
82315
  if (!deviceValue && Object.hasOwn(node, "substitutions"))
82311
- checkSubstitutionsShape(node.substitutions, path140);
82312
- if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path140);
82316
+ checkSubstitutionsShape(node.substitutions, path143);
82317
+ if (!Object.hasOwn(node, "variations")) checkUnitShape(node, path143);
82313
82318
  }
82314
- function checkVariationsShape(variations, path140) {
82319
+ function checkVariationsShape(variations, path143) {
82315
82320
  if (variations === null)
82316
- throw Error(`Missing required value for key 'variations' inside ${schemaPath(path140)}`);
82321
+ throw Error(`Missing required value for key 'variations' inside ${schemaPath(path143)}`);
82317
82322
  if (!isRecord6(variations))
82318
- throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path140)}`);
82319
- const variationsPath = [...path140, "variations"];
82323
+ throw Error(`Expected dictionary for key 'variations' inside ${schemaPath(path143)}`);
82324
+ const variationsPath = [...path143, "variations"];
82320
82325
  for (const [type, raw2] of Object.entries(variations)) {
82321
82326
  if (raw2 === null)
82322
82327
  throw Error(
@@ -82342,11 +82347,11 @@ function checkVariationsShape(variations, path140) {
82342
82347
  }
82343
82348
  }
82344
82349
  }
82345
- function checkSubstitutionsShape(substitutions, path140) {
82350
+ function checkSubstitutionsShape(substitutions, path143) {
82346
82351
  if (substitutions === null) return;
82347
82352
  if (!isRecord6(substitutions))
82348
- throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path140)}`);
82349
- const substitutionsPath = [...path140, "substitutions"];
82353
+ throw Error(`Expected dictionary for key 'substitutions' inside ${schemaPath(path143)}`);
82354
+ const substitutionsPath = [...path143, "substitutions"];
82350
82355
  for (const [name3, raw2] of Object.entries(substitutions)) {
82351
82356
  const subPath = [...substitutionsPath, name3];
82352
82357
  if (raw2 === null)
@@ -82388,10 +82393,10 @@ function scanSpecs(forms) {
82388
82393
  }
82389
82394
  return specs;
82390
82395
  }
82391
- function inferPlural(forms, language, key2, path140) {
82396
+ function inferPlural(forms, language, key2, path143) {
82392
82397
  const specs = scanSpecs(forms);
82393
- if (specs.size === 0) throw requiresNumber(language, key2, path140);
82394
- if (specs.size > 1) throw moreThanOne(language, key2, path140);
82398
+ if (specs.size === 0) throw requiresNumber(language, key2, path143);
82399
+ if (specs.size > 1) throw moreThanOne(language, key2, path143);
82395
82400
  return [...specs.values()][0] ?? { specifier: "", argument: 0 };
82396
82401
  }
82397
82402
  function unit(value) {
@@ -82547,13 +82552,13 @@ function substitutionRules(format, subs, resolver, language, refPath) {
82547
82552
  );
82548
82553
  const reaches = (from, target) => {
82549
82554
  const seen = /* @__PURE__ */ new Set();
82550
- const pending = [...edges.get(from) ?? []];
82551
- while (pending.length > 0) {
82552
- const name3 = pending.pop() ?? "";
82555
+ const pending2 = [...edges.get(from) ?? []];
82556
+ while (pending2.length > 0) {
82557
+ const name3 = pending2.pop() ?? "";
82553
82558
  if (name3 === target) return true;
82554
82559
  if (seen.has(name3)) continue;
82555
82560
  seen.add(name3);
82556
- pending.push(...edges.get(name3) ?? []);
82561
+ pending2.push(...edges.get(name3) ?? []);
82557
82562
  }
82558
82563
  return false;
82559
82564
  };
@@ -82860,8 +82865,8 @@ function plist(value, depth) {
82860
82865
  }
82861
82866
  function compileStringCatalog(source, name3) {
82862
82867
  return Object.fromEntries(
82863
- Object.entries(compileCatalogTables(source, name3)).map(([path140, table]) => [
82864
- path140,
82868
+ Object.entries(compileCatalogTables(source, name3)).map(([path143, table]) => [
82869
+ path143,
82865
82870
  '<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n' + plist(table, 0) + "</plist>\n"
82866
82871
  ])
82867
82872
  );
@@ -88427,8 +88432,8 @@ function withBuiltinStandinBehavior(behavior) {
88427
88432
  for (const [module2, members2] of Object.entries(BUILTIN_STANDIN_BEHAVIOR))
88428
88433
  merged[module2] = {
88429
88434
  ...Object.fromEntries(
88430
- Object.entries(members2).map(([path140, entry]) => [
88431
- path140,
88435
+ Object.entries(members2).map(([path143, entry]) => [
88436
+ path143,
88432
88437
  { ...entry, builtin: true }
88433
88438
  ])
88434
88439
  ),
@@ -88941,8 +88946,8 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88941
88946
  );
88942
88947
  const revision = import_node_path110.default.join(staging, "revisions", STANDIN_SOURCE_DIGEST.slice(0, 32));
88943
88948
  const stageTree = () => {
88944
- const pending = import_node_path110.default.join(staging, `pending.${process.pid}`);
88945
- import_node_fs108.default.rmSync(pending, { recursive: true, force: true });
88949
+ const pending2 = import_node_path110.default.join(staging, `pending.${process.pid}`);
88950
+ import_node_fs108.default.rmSync(pending2, { recursive: true, force: true });
88946
88951
  for (const framework of frameworks) {
88947
88952
  const swift = declared.get(framework);
88948
88953
  if (swift) {
@@ -88951,7 +88956,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88951
88956
  swift.declared,
88952
88957
  swift.imports,
88953
88958
  swift.sdkHeader,
88954
- pending
88959
+ pending2
88955
88960
  );
88956
88961
  continue;
88957
88962
  }
@@ -88959,7 +88964,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88959
88964
  if (import_node_fs108.default.existsSync(import_node_path110.default.join(framework, part)))
88960
88965
  import_node_fs108.default.cpSync(
88961
88966
  import_node_path110.default.join(framework, part),
88962
- import_node_path110.default.join(pending, "frameworks", import_node_path110.default.basename(framework), part),
88967
+ import_node_path110.default.join(pending2, "frameworks", import_node_path110.default.basename(framework), part),
88963
88968
  {
88964
88969
  recursive: true,
88965
88970
  dereference: true,
@@ -88971,7 +88976,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88971
88976
  );
88972
88977
  if (surface && "modulemap" in surface) {
88973
88978
  const modules = import_node_path110.default.join(
88974
- pending,
88979
+ pending2,
88975
88980
  "frameworks",
88976
88981
  import_node_path110.default.basename(framework),
88977
88982
  "Modules"
@@ -88983,7 +88988,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88983
88988
  }
88984
88989
  }
88985
88990
  for (const [index, directory2] of headers.entries()) {
88986
- import_node_fs108.default.cpSync(directory2, import_node_path110.default.join(pending, "headers", String(index)), {
88991
+ import_node_fs108.default.cpSync(directory2, import_node_path110.default.join(pending2, "headers", String(index)), {
88987
88992
  recursive: true,
88988
88993
  dereference: true,
88989
88994
  ...standalone ? {
@@ -88994,7 +88999,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
88994
88999
  (item) => "headers" in item && item.headers === directory2
88995
89000
  );
88996
89001
  if (surface && "modulemap" in surface) {
88997
- const modulemap = import_node_path110.default.join(pending, "headers", String(index), "module.modulemap");
89002
+ const modulemap = import_node_path110.default.join(pending2, "headers", String(index), "module.modulemap");
88998
89003
  import_node_fs108.default.rmSync(modulemap, { force: true });
88999
89004
  import_node_fs108.default.copyFileSync(surface.modulemap, modulemap);
89000
89005
  }
@@ -89002,7 +89007,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
89002
89007
  const contents2 = (0, import_node_crypto64.createHash)("sha256");
89003
89008
  for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
89004
89009
  const modulemap = import_node_path110.default.join(
89005
- pending,
89010
+ pending2,
89006
89011
  "frameworks",
89007
89012
  import_node_path110.default.basename(framework),
89008
89013
  "Modules/module.modulemap"
@@ -89018,16 +89023,16 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
89018
89023
  )
89019
89024
  );
89020
89025
  }
89021
- for (const relative4 of import_node_fs108.default.readdirSync(pending, { recursive: true, encoding: "utf8" }).sort()) {
89022
- const file = import_node_path110.default.join(pending, relative4);
89026
+ for (const relative4 of import_node_fs108.default.readdirSync(pending2, { recursive: true, encoding: "utf8" }).sort()) {
89027
+ const file = import_node_path110.default.join(pending2, relative4);
89023
89028
  contents2.update(`${relative4}\0`);
89024
89029
  if (import_node_fs108.default.statSync(file).isFile()) contents2.update(import_node_fs108.default.readFileSync(file));
89025
89030
  }
89026
89031
  const name3 = contents2.digest("hex").slice(0, 32);
89027
89032
  try {
89028
- import_node_fs108.default.renameSync(pending, import_node_path110.default.join(staging, name3));
89033
+ import_node_fs108.default.renameSync(pending2, import_node_path110.default.join(staging, name3));
89029
89034
  } catch (error) {
89030
- import_node_fs108.default.rmSync(pending, { recursive: true, force: true });
89035
+ import_node_fs108.default.rmSync(pending2, { recursive: true, force: true });
89031
89036
  if (!import_node_fs108.default.existsSync(import_node_path110.default.join(staging, name3))) throw error;
89032
89037
  }
89033
89038
  import_node_fs108.default.mkdirSync(import_node_path110.default.dirname(revision), { recursive: true });
@@ -89180,9 +89185,9 @@ function generatedModuleMap(text7, framework) {
89180
89185
  import_node_fs108.default.mkdirSync(dir, { recursive: true });
89181
89186
  const file = import_node_path110.default.join(dir, "module.modulemap");
89182
89187
  if (!import_node_fs108.default.existsSync(file)) {
89183
- const pending = `${file}.${process.pid}.tmp`;
89184
- import_node_fs108.default.writeFileSync(pending, text7);
89185
- import_node_fs108.default.renameSync(pending, file);
89188
+ const pending2 = `${file}.${process.pid}.tmp`;
89189
+ import_node_fs108.default.writeFileSync(pending2, text7);
89190
+ import_node_fs108.default.renameSync(pending2, file);
89186
89191
  }
89187
89192
  return file;
89188
89193
  }
@@ -90768,9 +90773,9 @@ async function sourceStandins(binaries, toolchain, provided, behavior) {
90768
90773
  for (const [target, reason] of gaps) result.gaps.set(target, reason);
90769
90774
  if (result.gaps.size === 0 && isRecord(receipt)) {
90770
90775
  import_node_fs108.default.mkdirSync(import_node_path110.default.dirname(cached2), { recursive: true });
90771
- const pending = `${cached2}.${process.pid}.tmp`;
90772
- import_node_fs108.default.writeFileSync(pending, JSON.stringify({ ...receipt, generation }));
90773
- import_node_fs108.default.renameSync(pending, cached2);
90776
+ const pending2 = `${cached2}.${process.pid}.tmp`;
90777
+ import_node_fs108.default.writeFileSync(pending2, JSON.stringify({ ...receipt, generation }));
90778
+ import_node_fs108.default.renameSync(pending2, cached2);
90774
90779
  }
90775
90780
  return result;
90776
90781
  } finally {
@@ -91019,9 +91024,9 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
91019
91024
  }
91020
91025
  const publish2 = (value) => {
91021
91026
  import_node_fs108.default.mkdirSync(import_node_path110.default.dirname(cached2), { recursive: true });
91022
- const pending = `${cached2}.${process.pid}.tmp`;
91023
- import_node_fs108.default.writeFileSync(pending, JSON.stringify(value));
91024
- import_node_fs108.default.renameSync(pending, cached2);
91027
+ const pending2 = `${cached2}.${process.pid}.tmp`;
91028
+ import_node_fs108.default.writeFileSync(pending2, JSON.stringify(value));
91029
+ import_node_fs108.default.renameSync(pending2, cached2);
91025
91030
  built.set(id, value);
91026
91031
  };
91027
91032
  let result;
@@ -91119,7 +91124,7 @@ function standinDependencies(binaries, packages, provided) {
91119
91124
  for (const candidate of packages.moduleSources)
91120
91125
  byModule.set(swiftTargetModuleName(candidate.target), candidate);
91121
91126
  const shipped = /* @__PURE__ */ new Set();
91122
- const pending = [];
91127
+ const pending2 = [];
91123
91128
  const read = (dir, sources) => sources.flatMap(
91124
91129
  (source) => swiftImportNames(import_node_fs108.default.readFileSync(import_node_path110.default.join(dir, source), "utf8"))
91125
91130
  );
@@ -91133,21 +91138,21 @@ function standinDependencies(binaries, packages, provided) {
91133
91138
  for (const binary2 of binaries) {
91134
91139
  if (binary2.placeholder !== void 0) {
91135
91140
  shipped.add(swiftTargetModuleName(binary2.target));
91136
- pending.push(...read(binary2.dir, binary2.placeholder.sources));
91141
+ pending2.push(...read(binary2.dir, binary2.placeholder.sources));
91137
91142
  continue;
91138
91143
  }
91139
91144
  if (binary2.publicHeaders !== void 0) continue;
91140
91145
  for (const surface of binarySurfaces(binary2)) {
91141
91146
  shipped.add(surface.module);
91142
- pending.push(...surfaceImports(surface));
91147
+ pending2.push(...surfaceImports(surface));
91143
91148
  }
91144
91149
  }
91145
91150
  const selected = /* @__PURE__ */ new Map();
91146
- for (let module2 = pending.pop(); module2 !== void 0; module2 = pending.pop()) {
91151
+ for (let module2 = pending2.pop(); module2 !== void 0; module2 = pending2.pop()) {
91147
91152
  const candidate = byModule.get(module2);
91148
91153
  if (!candidate || shipped.has(module2) || selected.has(module2)) continue;
91149
91154
  selected.set(module2, candidate);
91150
- pending.push(
91155
+ pending2.push(
91151
91156
  ...candidate.moduleSources ? read(candidate.dir, candidate.moduleSources.sources) : binarySurfaces(candidate).flatMap(surfaceImports)
91152
91157
  );
91153
91158
  }
@@ -91717,7 +91722,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91717
91722
  const generated = new Map(
91718
91723
  products?.files.map(({ path: declared, file }) => [declared, file])
91719
91724
  );
91720
- const pending = new Set(
91725
+ const pending2 = new Set(
91721
91726
  app.frameworks.flatMap((target) => {
91722
91727
  const compatibility = target.swift?.compatibility;
91723
91728
  return compatibility ? [
@@ -91733,7 +91738,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91733
91738
  sources.set(file, import_node_fs109.default.readFileSync(generatedFile));
91734
91739
  return;
91735
91740
  }
91736
- if (pending.has(file)) return;
91741
+ if (pending2.has(file)) return;
91737
91742
  if (sources.has(file)) return;
91738
91743
  const resolved = header ? import_node_fs109.default.realpathSync.native(file) : file;
91739
91744
  if (resolved !== file) links[file] = resolved;
@@ -91922,7 +91927,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91922
91927
  if (moduleMap2) {
91923
91928
  const requested = import_node_path111.default.resolve(app.rootDir, moduleMap2);
91924
91929
  const file = products ? requested : app.moduleMapSources?.[requested] ?? requested;
91925
- if (generated.has(file) || !pending.has(file) && import_node_fs109.default.existsSync(file))
91930
+ if (generated.has(file) || !pending2.has(file) && import_node_fs109.default.existsSync(file))
91926
91931
  queue.push({ file });
91927
91932
  }
91928
91933
  const directory2 = ["-I", "-F", "-iquote", "-isystem", "-iframework"].includes(
@@ -91952,7 +91957,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
91952
91957
  const availableHeader = (candidate) => {
91953
91958
  const source = productHeaders[candidate] ?? candidate;
91954
91959
  if (generated.has(source)) return source;
91955
- if (pending.has(source)) return null;
91960
+ if (pending2.has(source)) return null;
91956
91961
  let regular = regularFiles.get(source);
91957
91962
  if (regular === void 0) {
91958
91963
  const parent = import_node_path111.default.dirname(source);
@@ -93785,7 +93790,7 @@ function resolveSwiftPackages(options2) {
93785
93790
  headers.set(name3, import_node_path113.default.relative(binary2.dir, dir));
93786
93791
  };
93787
93792
  visit3(pkg, binary2.target);
93788
- binary2.headerDependencies = [...headers].map(([module2, path140]) => ({ module: module2, path: path140 }));
93793
+ binary2.headerDependencies = [...headers].map(([module2, path143]) => ({ module: module2, path: path143 }));
93789
93794
  }
93790
93795
  for (const owner of options2.owners ?? []) {
93791
93796
  const found = productClosure(owner.products);
@@ -94253,7 +94258,7 @@ var init_swift_cxx_reachable = __esm({
94253
94258
  // src/swift-pdf-raster.ts
94254
94259
  function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageBytes: Infinity, imageTotalBytes: Infinity }) {
94255
94260
  const rendered = /* @__PURE__ */ new Map();
94256
- const pending = /* @__PURE__ */ new Map();
94261
+ const pending2 = /* @__PURE__ */ new Map();
94257
94262
  const renderer = process.platform === "darwin" ? "30774891a9db216d" : "pdfium-1";
94258
94263
  const cache = cacheDir();
94259
94264
  const cached2 = (sha2565) => import_node_path115.default.join(cache, `swift-pdf-png-${renderer}-${sha2565}.png`);
@@ -94267,22 +94272,22 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
94267
94272
  rendered.set(sha2565, bytes);
94268
94273
  };
94269
94274
  for (const input of inputs2) {
94270
- if (rendered.has(input.sha256) || pending.has(input.sha256)) continue;
94275
+ if (rendered.has(input.sha256) || pending2.has(input.sha256)) continue;
94271
94276
  let bytes;
94272
94277
  try {
94273
94278
  bytes = import_node_fs113.default.readFileSync(cached2(input.sha256));
94274
94279
  } catch {
94275
- pending.set(input.sha256, input);
94280
+ pending2.set(input.sha256, input);
94276
94281
  continue;
94277
94282
  }
94278
94283
  record5(input, bytes);
94279
94284
  }
94280
- if (!pending.size) return rendered;
94285
+ if (!pending2.size) return rendered;
94281
94286
  const work = import_node_fs113.default.mkdtempSync(import_node_path115.default.join(import_node_os23.default.tmpdir(), "swift-pdf-png-"));
94282
94287
  let cacheWork;
94283
94288
  let writeCache = true;
94284
94289
  try {
94285
- const requests = [...pending.values()].map((input, index) => ({
94290
+ const requests = [...pending2.values()].map((input, index) => ({
94286
94291
  ...input,
94287
94292
  file: import_node_path115.default.resolve(input.file),
94288
94293
  output: import_node_path115.default.join(work, `${index}.png`)
@@ -94816,7 +94821,7 @@ async function buildXcodeLayout(root) {
94816
94821
  });
94817
94822
  if (framework.moduleName !== module2 || framework.allSources.length === 0)
94818
94823
  throw new Error(`${project2}: ${target} did not produce source module ${module2}`);
94819
- if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path: path140 }) => path140))
94824
+ if (framework.linkedProducts.length > 0 || framework.binaryFrameworks.some(({ path: path143 }) => path143))
94820
94825
  throw new Error(
94821
94826
  `${project2}: ${target} has external dependencies outside the source framework build`
94822
94827
  );
@@ -97823,11 +97828,11 @@ function stringList3(value) {
97823
97828
  function externalSpecMembers(root, requested) {
97824
97829
  const children = (spec) => Array.isArray(spec.subspecs) ? spec.subspecs.filter(object7) : [];
97825
97830
  const chains = /* @__PURE__ */ new Map();
97826
- const select = (path140) => {
97827
- const key2 = path140.join("/");
97831
+ const select = (path143) => {
97832
+ const key2 = path143.join("/");
97828
97833
  if (chains.has(key2)) return;
97829
97834
  const chain = [root];
97830
- for (const part of path140) {
97835
+ for (const part of path143) {
97831
97836
  const child = children(chain.at(-1)).find((sub) => sub.name === part);
97832
97837
  if (!child) throw new Error(`${String(root.name)} has no subspec ${key2}`);
97833
97838
  chain.push(child);
@@ -97836,7 +97841,7 @@ function externalSpecMembers(root, requested) {
97836
97841
  const spec = chain.at(-1);
97837
97842
  const defaults = stringList3(spec.default_subspecs ?? spec.default_subspec);
97838
97843
  const activated = defaults[0] === "none" ? [] : defaults.length > 0 ? defaults : children(spec).map((sub) => String(sub.name));
97839
- for (const name3 of activated) select([...path140, ...name3.split("/")]);
97844
+ for (const name3 of activated) select([...path143, ...name3.split("/")]);
97840
97845
  for (const member of chain)
97841
97846
  for (const dependencies of [member.dependencies, iosOf(member)?.dependencies])
97842
97847
  for (const dependency of object7(dependencies) ? Object.keys(dependencies) : []) {
@@ -98478,10 +98483,10 @@ async function collectTurboSources(options2) {
98478
98483
  throw new Error(`TurboModule source is not UTF-8: ${disk}`);
98479
98484
  add(key2, text7);
98480
98485
  result.sources.push({ file: key2, source: disk, sha256: sha2564(bytes) });
98481
- pending.push({ key: key2, targetName, label, root, relative: relative4 });
98486
+ pending2.push({ key: key2, targetName, label, root, relative: relative4 });
98482
98487
  return key2;
98483
98488
  };
98484
- const pending = [];
98489
+ const pending2 = [];
98485
98490
  const pendingCodegen = [];
98486
98491
  const dependencyHeader = nitroDependencyReader(reactNative.version, reactNative.root);
98487
98492
  const dependencyTrees = /* @__PURE__ */ new Set();
@@ -99601,7 +99606,7 @@ async function collectTurboSources(options2) {
99601
99606
  );
99602
99607
  }
99603
99608
  for (; ; ) {
99604
- for (let next = pending.shift(); next; next = pending.shift())
99609
+ for (let next = pending2.shift(); next; next = pending2.shift())
99605
99610
  scanText(next, result.files[next.key]);
99606
99611
  let addedDep = false;
99607
99612
  for (let i = deferredDepUnits.length - 1; i >= 0; i--) {
@@ -99621,7 +99626,7 @@ async function collectTurboSources(options2) {
99621
99626
  if (pendingCodegen.length) {
99622
99627
  codegen ??= (await runInstalledTurboCodegen(options2.appRoot, options2.codegenDir)).generatedRoot;
99623
99628
  for (const { from, include, quoted: quoted2 } of pendingCodegen) resolve4(from, include, quoted2);
99624
- for (let next = pending.shift(); next; next = pending.shift())
99629
+ for (let next = pending2.shift(); next; next = pending2.shift())
99625
99630
  scanText(next, result.files[next.key]);
99626
99631
  }
99627
99632
  for (const file of textualSources) {
@@ -102926,17 +102931,17 @@ async function prebuiltReactNativeCore(project2, reactNativeRoot, moduleRoot, mo
102926
102931
  const entry = reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode);
102927
102932
  let dir = fetchNativeEntry("react-native", entry.name, entry.key);
102928
102933
  if (!dir) {
102929
- let pending = building.get(entry.key);
102930
- if (!pending) {
102934
+ let pending2 = building.get(entry.key);
102935
+ if (!pending2) {
102931
102936
  console.error(
102932
102937
  `[peach] no published React Native ${entry.name} core at ${NATIVE_PREBUILT_ORIGIN}/${nativeEntryPrefix("react-native", entry.name, entry.key)}; building it locally`
102933
102938
  );
102934
- pending = Promise.resolve().then(() => (init_react_native_core_build(), react_native_core_build_exports)).then(
102939
+ pending2 = Promise.resolve().then(() => (init_react_native_core_build(), react_native_core_build_exports)).then(
102935
102940
  ({ buildReactNativeCore: buildReactNativeCore2 }) => buildReactNativeCore2(project2, reactNativeRoot, mode, moduleRoot)
102936
102941
  ).finally(() => building.delete(entry.key));
102937
- building.set(entry.key, pending);
102942
+ building.set(entry.key, pending2);
102938
102943
  }
102939
- dir = await pending;
102944
+ dir = await pending2;
102940
102945
  }
102941
102946
  const file = import_node_path123.default.join(dir, "core.json");
102942
102947
  const descriptor = JSON.parse(
@@ -104073,9 +104078,9 @@ function hashPackageTree(root, options2) {
104073
104078
  (a, b) => options2.compareNames(a.name, b.name)
104074
104079
  )) {
104075
104080
  if (entry.name === "node_modules") continue;
104076
- const path140 = `${relative4}${entry.name}`;
104077
- if (entry.isDirectory()) walk4((0, import_node_path127.join)(directory2, entry.name), `${path140}/`);
104078
- else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(path140);
104081
+ const path143 = `${relative4}${entry.name}`;
104082
+ if (entry.isDirectory()) walk4((0, import_node_path127.join)(directory2, entry.name), `${path143}/`);
104083
+ else if (entry.isFile() && !options2.skipFile?.(entry.name)) files2.push(path143);
104079
104084
  }
104080
104085
  };
104081
104086
  walk4(root, "");
@@ -104242,14 +104247,14 @@ var init_nitro_superset = __esm({
104242
104247
  nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
104243
104248
  published = /* @__PURE__ */ new Map();
104244
104249
  publishedMetadata = (url) => {
104245
- let pending = published.get(url);
104246
- if (!pending) {
104247
- pending = fetch(url).then(
104250
+ let pending2 = published.get(url);
104251
+ if (!pending2) {
104252
+ pending2 = fetch(url).then(
104248
104253
  async (response) => response.ok ? readNitroMetadata(await response.json()) : null
104249
104254
  ).catch(() => null);
104250
- published.set(url, pending);
104255
+ published.set(url, pending2);
104251
104256
  }
104252
- return pending;
104257
+ return pending2;
104253
104258
  };
104254
104259
  }
104255
104260
  });
@@ -104811,7 +104816,7 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
104811
104816
  `;
104812
104817
  const chunks = [];
104813
104818
  let depth = 0;
104814
- let pending = [];
104819
+ let pending2 = [];
104815
104820
  let hadBrace = false;
104816
104821
  let activeEnum = null;
104817
104822
  let memberLines = [];
@@ -104830,29 +104835,29 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
104830
104835
  if (depth === 0 && !hadBrace && /^\s*(?:@\w+(?:\([^)]*\))?\s+)*private\b/.test(maskedLine)) {
104831
104836
  return [[name3, source]];
104832
104837
  }
104833
- const enumMatch = depth === 0 && !hadBrace && pending.every((item) => item.trim() === "" || item.trim().startsWith("//")) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
104838
+ const enumMatch = depth === 0 && !hadBrace && pending2.every((item) => item.trim() === "" || item.trim().startsWith("//")) ? /^enum (OneSDK_\w+)\s*\{\s*$/.exec(maskedLine) : null;
104834
104839
  if (enumMatch && delta === 1) {
104835
104840
  const enumName = enumMatch[1];
104836
- const prefix = pending.filter((item) => item.trim() !== "");
104841
+ const prefix = pending2.filter((item) => item.trim() !== "");
104837
104842
  chunks.push({
104838
104843
  kind: "top",
104839
104844
  text: [...prefix, `enum ${enumName} {}`].join("\n")
104840
104845
  });
104841
- pending = [];
104846
+ pending2 = [];
104842
104847
  activeEnum = enumName;
104843
104848
  depth = 1;
104844
104849
  continue;
104845
104850
  }
104846
- if (depth === 0 && !hadBrace && line.trim() === "" && pending.length === 0) {
104851
+ if (depth === 0 && !hadBrace && line.trim() === "" && pending2.length === 0) {
104847
104852
  continue;
104848
104853
  }
104849
- pending.push(line);
104854
+ pending2.push(line);
104850
104855
  if (delta !== 0 || depth > 0) hadBrace = true;
104851
104856
  depth += delta;
104852
104857
  if (depth < 0) return [[name3, source]];
104853
104858
  if (hadBrace && depth === 0) {
104854
- chunks.push({ kind: "top", text: pending.join("\n") });
104855
- pending = [];
104859
+ chunks.push({ kind: "top", text: pending2.join("\n") });
104860
+ pending2 = [];
104856
104861
  hadBrace = false;
104857
104862
  }
104858
104863
  } else {
@@ -104893,7 +104898,7 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
104893
104898
  }
104894
104899
  }
104895
104900
  }
104896
- if (depth !== 0 || activeEnum !== null || pending.some((item) => item.trim() !== "" && !item.trim().startsWith("//")) || chunks.length < shardCount) {
104901
+ if (depth !== 0 || activeEnum !== null || pending2.some((item) => item.trim() !== "" && !item.trim().startsWith("//")) || chunks.length < shardCount) {
104897
104902
  return [[name3, source]];
104898
104903
  }
104899
104904
  const totalChars = chunks.reduce((sum, chunk) => sum + chunk.text.length, 0);
@@ -105105,7 +105110,7 @@ var init_expo_eager_seam_contract = __esm({
105105
105110
 
105106
105111
  // src/expo-native-compiler-digest.ts
105107
105112
  function expoNativeCompilerDigestValue() {
105108
- return true ? "063ea654f918d8764bcbbeaea78e9081a16d94a0f988df0f1ea04cfa28f52753" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
105113
+ return true ? "bb35d3d7190ca4daafe4d1b7234ffcf4363d65e94ca03eb1092ca87ac7310bea" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
105109
105114
  }
105110
105115
  var import_node_crypto78;
105111
105116
  var init_expo_native_compiler_digest = __esm({
@@ -105838,14 +105843,14 @@ async function lookup(appRoot) {
105838
105843
  const app = await expoNativeInputs(appRoot);
105839
105844
  if (!app) return null;
105840
105845
  const url = expoNativeEntryUrl(nativeEntryKey(app.inputs), "metadata.json");
105841
- let pending = published2.get(url);
105842
- if (!pending) {
105843
- pending = fetch(url).then(
105846
+ let pending2 = published2.get(url);
105847
+ if (!pending2) {
105848
+ pending2 = fetch(url).then(
105844
105849
  async (response) => response.ok ? readExpoNativeEntry(await response.json()) : null
105845
105850
  ).catch(() => null);
105846
- published2.set(url, pending);
105851
+ published2.set(url, pending2);
105847
105852
  }
105848
- const entry = await pending;
105853
+ const entry = await pending2;
105849
105854
  if (!entry) return null;
105850
105855
  const digests2 = await expoNativePackageDigests(app.packages);
105851
105856
  return (0, import_node_util17.isDeepStrictEqual)(digests2, entry.packages) ? entry : null;
@@ -105853,12 +105858,12 @@ async function lookup(appRoot) {
105853
105858
  function prebuiltExpoNative(appRoot, iosTarget) {
105854
105859
  if (iosTarget !== void 0) return Promise.resolve(null);
105855
105860
  const root = import_node_fs131.default.realpathSync(appRoot);
105856
- let pending = lookups.get(root);
105857
- if (!pending) {
105858
- pending = answer(root).finally(() => lookups.delete(root));
105859
- lookups.set(root, pending);
105861
+ let pending2 = lookups.get(root);
105862
+ if (!pending2) {
105863
+ pending2 = answer(root).finally(() => lookups.delete(root));
105864
+ lookups.set(root, pending2);
105860
105865
  }
105861
- return pending;
105866
+ return pending2;
105862
105867
  }
105863
105868
  async function prebuiltAppTarget(appRoot, signal, dependencies = "lockfile") {
105864
105869
  const prepared = await prepareExpoNativeProject(
@@ -107270,7 +107275,7 @@ ${source}`;
107270
107275
  const name3 = moduleMapName(text7);
107271
107276
  return name3 && provided.has(name3) && /\bumbrella\s+header\s+"[^"]+"/.test(text7) ? [{ file, text: text7, name: name3, reached: /* @__PURE__ */ new Set() }] : [];
107272
107277
  });
107273
- const pending = [
107278
+ const pending2 = [
107274
107279
  ...units.flatMap((unit2) => Object.entries(unit2.files)),
107275
107280
  ...units.flatMap(
107276
107281
  (unit2) => (unit2.nativeTargets ?? []).flatMap(
@@ -107286,8 +107291,8 @@ ${source}`;
107286
107291
  )
107287
107292
  ];
107288
107293
  const visited = /* @__PURE__ */ new Set();
107289
- while (pending.length) {
107290
- const [file, source] = pending.pop();
107294
+ while (pending2.length) {
107295
+ const [file, source] = pending2.pop();
107291
107296
  if (visited.has(file)) continue;
107292
107297
  visited.add(file);
107293
107298
  for (const match of source.matchAll(/#\s*(?:import|include)\s*[<"]([^>"]+)[>"]/g)) {
@@ -107298,12 +107303,12 @@ ${source}`;
107298
107303
  const candidate = import_node_path136.default.posix.join(import_node_path136.default.posix.dirname(map3.file), include);
107299
107304
  if (support[candidate] === void 0) continue;
107300
107305
  map3.reached.add(header);
107301
- pending.push([candidate, support[candidate]]);
107306
+ pending2.push([candidate, support[candidate]]);
107302
107307
  }
107303
107308
  const relative4 = import_node_path136.default.posix.normalize(
107304
107309
  import_node_path136.default.posix.join(import_node_path136.default.posix.dirname(file), include)
107305
107310
  );
107306
- if (support[relative4] !== void 0) pending.push([relative4, support[relative4]]);
107311
+ if (support[relative4] !== void 0) pending2.push([relative4, support[relative4]]);
107307
107312
  }
107308
107313
  }
107309
107314
  for (const map3 of maps) {
@@ -109250,12 +109255,12 @@ async function resolveExpoAndroidAutolinking(appRoot) {
109250
109255
  const root = import_node_fs135.default.realpathSync(appRoot);
109251
109256
  const existing = resolving.get(root);
109252
109257
  if (existing) return existing;
109253
- const pending = resolveAndroidModules(root);
109254
- resolving.set(root, pending);
109258
+ const pending2 = resolveAndroidModules(root);
109259
+ resolving.set(root, pending2);
109255
109260
  try {
109256
- return await pending;
109261
+ return await pending2;
109257
109262
  } finally {
109258
- if (resolving.get(root) === pending) resolving.delete(root);
109263
+ if (resolving.get(root) === pending2) resolving.delete(root);
109259
109264
  }
109260
109265
  }
109261
109266
  async function resolveAndroidModules(appRoot) {
@@ -109433,6 +109438,7 @@ async function resolveAndroidGradleSources(request) {
109433
109438
  }
109434
109439
  );
109435
109440
  const dependencySources = includeDependencySources ? readDependencySources(value.dependencySources) : void 0;
109441
+ const dependencyGraph = includeDependencySources ? readDependencyGraph(value.dependencyGraph) : void 0;
109436
109442
  return {
109437
109443
  projectDir,
109438
109444
  projectPath: value.projectPath,
@@ -109450,13 +109456,43 @@ async function resolveAndroidGradleSources(request) {
109450
109456
  linkedResourcePackage: linkedResource("linkedResourcePackage")
109451
109457
  } : {},
109452
109458
  dependencies,
109453
- ...dependencySources ? { dependencySources } : {}
109459
+ ...dependencySources ? { dependencySources, dependencyGraph } : {}
109454
109460
  };
109455
109461
  });
109456
109462
  } finally {
109457
109463
  import_node_fs136.default.rmSync(work, { recursive: true, force: true });
109458
109464
  }
109459
109465
  }
109466
+ function readDependencyGraph(value) {
109467
+ if (!isRecord(value) || !Array.isArray(value.javaClasspath) || !value.javaClasspath.every(
109468
+ (file) => typeof file === "string" && import_node_path139.default.isAbsolute(file)
109469
+ )) {
109470
+ throw new Error("Gradle printed invalid module graphs");
109471
+ }
109472
+ return {
109473
+ compile: readModules(value.compile),
109474
+ runtime: readModules(value.runtime),
109475
+ javaClasspath: value.javaClasspath.map(String)
109476
+ };
109477
+ }
109478
+ function readModules(value) {
109479
+ if (!Array.isArray(value)) throw new Error("Gradle printed an invalid module graph");
109480
+ const modules = value.map((entry) => {
109481
+ if (!isRecord(entry) || typeof entry.coordinate !== "string" || !/^[^:]+:[^:]+:[^:]+$/.test(entry.coordinate) || !Array.isArray(entry.dependencies) || !entry.dependencies.every((coordinate) => typeof coordinate === "string") || !Array.isArray(entry.jars) || !entry.jars.every((file) => typeof file === "string" && import_node_path139.default.isAbsolute(file)))
109482
+ throw new Error("Gradle printed an invalid module");
109483
+ return {
109484
+ coordinate: entry.coordinate,
109485
+ dependencies: entry.dependencies.map(String),
109486
+ jars: entry.jars.map(String)
109487
+ };
109488
+ });
109489
+ const coordinates = new Set(modules.map(({ coordinate }) => coordinate));
109490
+ if (coordinates.size !== modules.length || modules.some(
109491
+ ({ dependencies }) => dependencies.some((dependency) => !coordinates.has(dependency))
109492
+ ))
109493
+ throw new Error("Gradle printed duplicate modules or unresolved module edges");
109494
+ return modules;
109495
+ }
109460
109496
  function readDependencySources(value) {
109461
109497
  if (!Array.isArray(value)) throw new Error("Gradle printed invalid dependency sources");
109462
109498
  const coordinates = /* @__PURE__ */ new Set();
@@ -109518,6 +109554,42 @@ def resolveDependencySources = { project, configurations ->
109518
109554
  }
109519
109555
  }.sort { it.group + ':' + it.name + ':' + it.version }
109520
109556
  }
109557
+ def moduleCoordinate = { id -> id.group + ':' + id.module + ':' + id.version }
109558
+ def resolveModuleGraph = { configuration ->
109559
+ def classArtifacts = configuration.incoming.artifactView { view ->
109560
+ view.attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, 'android-classes-jar')
109561
+ }.artifacts.artifacts.findAll { it.id.componentIdentifier instanceof ModuleComponentIdentifier }
109562
+ def classJars = classArtifacts.groupBy { moduleCoordinate(it.id.componentIdentifier) }
109563
+ def resolution = configuration.incoming.resolutionResult
109564
+ def byCoordinate = [:]
109565
+ def seen = [] as Set
109566
+ def visit
109567
+ visit = { component, selectedVariant ->
109568
+ if (!seen.add([component.id, selectedVariant])) return
109569
+ def edges = component.getDependenciesForVariant(selectedVariant).findAll { edge ->
109570
+ if (edge.constraint) return false
109571
+ if (!(edge instanceof ResolvedDependencyResult)) {
109572
+ throw new GradleException('Unresolved Android dependency: ' + edge.requested, edge.failure)
109573
+ }
109574
+ def category = edge.resolvedVariant.attributes.getAttribute(Category.CATEGORY_ATTRIBUTE)?.name
109575
+ category != Category.REGULAR_PLATFORM && category != Category.ENFORCED_PLATFORM
109576
+ }
109577
+ if (component.id instanceof ModuleComponentIdentifier) {
109578
+ def coordinate = moduleCoordinate(component.id)
109579
+ def entry = byCoordinate.get(coordinate, [coordinate:coordinate, dependencies:[] as Set,
109580
+ jars:classJars.get(coordinate, []).collect { it.file.absolutePath }.unique().sort()])
109581
+ edges.findAll { it.selected.id instanceof ModuleComponentIdentifier }.each { edge ->
109582
+ entry.dependencies.add(moduleCoordinate(edge.selected.id))
109583
+ }
109584
+ }
109585
+ edges.each { edge -> visit(edge.selected, edge.resolvedVariant) }
109586
+ }
109587
+ visit(resolution.rootComponent.get(), resolution.rootVariant.get())
109588
+ def modules = byCoordinate.values().collect { entry ->
109589
+ [coordinate:entry.coordinate, dependencies:entry.dependencies.toList().sort(), jars:entry.jars]
109590
+ }.sort { it.coordinate }
109591
+ [modules:modules, classpath:classArtifacts.collect { it.file.absolutePath }.unique()]
109592
+ }
109521
109593
  gradle.beforeProject { project ->
109522
109594
  def directory = project.projectDir.canonicalPath
109523
109595
  if (project.rootProject.projectDir.canonicalPath != request.root || !request.projects.contains(directory)) return
@@ -109621,10 +109693,17 @@ gradle.projectsEvaluated {
109621
109693
  linkedResourcePackage = packages[0].outputFile
109622
109694
  }
109623
109695
  def bootClasspath = []
109624
- if (request.includeJavaClasspath || runtimeClasses != null) {
109696
+ if (request.includeJavaClasspath || runtimeClasses != null || request.includeDependencySources) {
109625
109697
  def sdk = project.extensions.getByName('androidComponents').sdkComponents
109626
109698
  bootClasspath = sdk.bootClasspath.get().collect { it.asFile }
109627
109699
  }
109700
+ def dependencyGraph = null
109701
+ if (request.includeDependencySources) {
109702
+ def compile = resolveModuleGraph(configurations[0])
109703
+ def runtime = resolveModuleGraph(configurations[1])
109704
+ dependencyGraph = [compile:compile.modules, runtime:runtime.modules,
109705
+ javaClasspath:(bootClasspath.collect { it.absolutePath } + compile.classpath).unique()]
109706
+ }
109628
109707
  new File(request.output, index.toString() + '.json').text = JsonOutput.toJson([
109629
109708
  projectDir:project.projectDir.canonicalPath,
109630
109709
  projectPath:project.path,
@@ -109638,6 +109717,7 @@ gradle.projectsEvaluated {
109638
109717
  dependencies:dependencies,
109639
109718
  dependencySources:request.includeDependencySources
109640
109719
  ? resolveDependencySources(project, configurations) : null,
109720
+ dependencyGraph:dependencyGraph,
109641
109721
  javaClasspath:request.includeJavaClasspath
109642
109722
  ? (bootClasspath + javac.classpath.files.findAll { it.exists() }).unique().collect { it.absolutePath } : null,
109643
109723
  runtimeJavaClasspath:runtimeClasses != null
@@ -110182,21 +110262,21 @@ function peachKotlinModuleRoot() {
110182
110262
  const root = import_node_path144.default.join(parent, digest3);
110183
110263
  import_node_fs141.default.mkdirSync(parent, { recursive: true });
110184
110264
  if (!import_node_fs141.default.existsSync(root)) {
110185
- const pending = import_node_fs141.default.mkdtempSync(import_node_path144.default.join(parent, ".install-"));
110265
+ const pending2 = import_node_fs141.default.mkdtempSync(import_node_path144.default.join(parent, ".install-"));
110186
110266
  try {
110187
110267
  for (const [name3, contents2] of Object.entries(files2)) {
110188
- const file = import_node_path144.default.join(pending, name3);
110268
+ const file = import_node_path144.default.join(pending2, name3);
110189
110269
  import_node_fs141.default.mkdirSync(import_node_path144.default.dirname(file), { recursive: true });
110190
110270
  import_node_fs141.default.writeFileSync(file, Buffer.from(contents2, "base64"));
110191
110271
  }
110192
110272
  try {
110193
- import_node_fs141.default.renameSync(pending, root);
110273
+ import_node_fs141.default.renameSync(pending2, root);
110194
110274
  } catch (error) {
110195
110275
  if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY")
110196
110276
  throw error;
110197
110277
  }
110198
110278
  } finally {
110199
- import_node_fs141.default.rmSync(pending, { recursive: true, force: true });
110279
+ import_node_fs141.default.rmSync(pending2, { recursive: true, force: true });
110200
110280
  }
110201
110281
  }
110202
110282
  for (const [name3, contents2] of Object.entries(files2)) {
@@ -110273,6 +110353,430 @@ var init_kotlin_browser_seams = __esm({
110273
110353
  }
110274
110354
  });
110275
110355
 
110356
+ // src/kotlin-library-sources.ts
110357
+ function runCompiler2(file, args, options2, operation) {
110358
+ return new Promise((resolve4, reject) => {
110359
+ const child = (0, import_node_child_process69.spawn)(file, args, options2);
110360
+ child.once("error", reject);
110361
+ child.once("close", (code, signal) => {
110362
+ if (code === 0) resolve4();
110363
+ else reject(new Error(operation + " stopped with " + (code ?? signal)));
110364
+ });
110365
+ });
110366
+ }
110367
+ function kotlinFragmentFlags(filename, kotlinSources2, translatedSources) {
110368
+ const input = JSON.parse(import_node_fs142.default.readFileSync(filename, "utf8"));
110369
+ if (!Array.isArray(input) || !input.length)
110370
+ throw new Error("Kotlin fragments must be a nonempty array");
110371
+ const fragments = input.map(
110372
+ (fragment) => {
110373
+ if (!isRecord(fragment) || typeof fragment.name !== "string" || !/^[a-zA-Z][a-zA-Z0-9_]*$/.test(fragment.name) || !Array.isArray(fragment.sources) || !fragment.sources.every((source) => typeof source === "string") || !Array.isArray(fragment.refines) || !fragment.refines.every((parent) => typeof parent === "string") || fragment.java !== void 0 && typeof fragment.java !== "boolean")
110374
+ throw new Error(
110375
+ "Each Kotlin fragment needs a name, source paths and refined fragments"
110376
+ );
110377
+ return {
110378
+ name: fragment.name,
110379
+ sources: fragment.sources.map((source) => import_node_path145.default.resolve(source)),
110380
+ refines: fragment.refines,
110381
+ java: fragment.java === true
110382
+ };
110383
+ }
110384
+ );
110385
+ const names = new Set(fragments.map(({ name: name3 }) => name3));
110386
+ const refined = new Set(fragments.flatMap(({ refines }) => refines));
110387
+ const [platform2, ...otherPlatforms] = [...names].filter((name3) => !refined.has(name3));
110388
+ const javaFragments = fragments.filter(({ java }) => java);
110389
+ if (names.size !== fragments.length || [...refined].some((name3) => !names.has(name3)) || !platform2 || otherPlatforms.length || javaFragments.length > 1)
110390
+ throw new Error(
110391
+ "Kotlin fragments need unique names, known parents, one platform fragment and at most one Java source fragment"
110392
+ );
110393
+ const sources = fragments.flatMap(({ sources: sources2 }) => sources2);
110394
+ const selected = new Set(kotlinSources2);
110395
+ if (sources.length !== selected.size || new Set(sources).size !== sources.length || sources.some((source) => !selected.has(source)) || [...sources, ...translatedSources].some((source) => source.includes(",")))
110396
+ throw new Error("Each Kotlin library source must belong to exactly one fragment");
110397
+ const mappings = fragments.flatMap(
110398
+ ({ name: name3, sources: sources2 }) => sources2.map((source) => `${name3}:${source}`)
110399
+ );
110400
+ const javaFragment = javaFragments[0]?.name ?? platform2;
110401
+ mappings.push(...translatedSources.map((source) => `${javaFragment}:${source}`));
110402
+ const edges = fragments.flatMap(
110403
+ ({ name: name3, refines }) => refines.map((parent) => `${name3}:${parent}`)
110404
+ );
110405
+ return [
110406
+ "-Xmulti-platform",
110407
+ `-Xfragments=${[...names].join(",")}`,
110408
+ ...edges.length ? [`-Xfragment-refines=${edges.join(",")}`] : [],
110409
+ `-Xfragment-sources=${mappings.join(",")}`
110410
+ ];
110411
+ }
110412
+ async function compileKotlinLibrarySources(input) {
110413
+ const output = import_node_path145.default.resolve(input.output);
110414
+ const name3 = import_node_path145.default.basename(output, ".klib");
110415
+ if (!name3 || !output.endsWith(".klib") || input.source.kind === "files" && !input.source.java.length && !input.source.kotlin.length)
110416
+ throw new Error("Android library compilation requires sources and a KLIB output");
110417
+ const { ready, sdkRoot, libraries } = input;
110418
+ const parent = import_node_path145.default.dirname(output);
110419
+ import_node_fs142.default.mkdirSync(parent, { recursive: true });
110420
+ const work = import_node_fs142.default.mkdtempSync(import_node_path145.default.join(parent, ".android-library-"));
110421
+ try {
110422
+ const compileLibraries = [...libraries, ...input.dependencies];
110423
+ let javaSources;
110424
+ if (input.source.kind === "resources") {
110425
+ const generated = import_node_path145.default.join(work, "resources");
110426
+ await runKotlinTool(
110427
+ ready,
110428
+ sdkRoot,
110429
+ "dev.peach.tools.platform.AndroidResourceClassesKt",
110430
+ [import_node_path145.default.resolve(input.source.archive), generated]
110431
+ );
110432
+ javaSources = import_node_fs142.default.readdirSync(generated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".java")).sort().map((file) => import_node_path145.default.join(generated, file));
110433
+ } else {
110434
+ javaSources = input.source.java;
110435
+ }
110436
+ const kotlinSources2 = input.source.kind === "files" ? input.source.kotlin.map((file) => import_node_path145.default.resolve(file)) : [];
110437
+ const commonSources = (input.commonSources ?? []).map((file) => import_node_path145.default.resolve(file));
110438
+ if (commonSources.length && input.kotlinFragments)
110439
+ throw new Error("Choose common sources or a Kotlin fragment graph");
110440
+ if (commonSources.some((file) => file.includes(",") || !kotlinSources2.includes(file)))
110441
+ throw new Error("Common Kotlin sources must be included in the library source list");
110442
+ const kotlinJvmAbi = input.kotlinJvmAbi && import_node_path145.default.resolve(input.kotlinJvmAbi);
110443
+ if (kotlinJvmAbi && (!javaSources.length || !kotlinSources2.length || !kotlinJvmAbi.endsWith(".jar") || !input.javaClasspath.some((file) => import_node_path145.default.resolve(file) === kotlinJvmAbi)))
110444
+ throw new Error(
110445
+ "The Kotlin JVM ABI must be a JAR on the mixed library\u2019s Java classpath"
110446
+ );
110447
+ const dependencyAbiFlags = [];
110448
+ if (input.dependencyJvmAbi) {
110449
+ const dependencyPaths = new Set(
110450
+ input.dependencies.map((file) => import_node_path145.default.resolve(file))
110451
+ );
110452
+ const classpathPaths = new Set(
110453
+ input.javaClasspath.map((file) => import_node_path145.default.resolve(file))
110454
+ );
110455
+ const value = JSON.parse(import_node_fs142.default.readFileSync(input.dependencyJvmAbi, "utf8"));
110456
+ if (!Array.isArray(value) || !value.length || !javaSources.length)
110457
+ throw new Error(
110458
+ "Dependency JVM ABIs require Java sources and a nonempty array of KLIB/JAR pairs"
110459
+ );
110460
+ for (const pair of value) {
110461
+ if (!isRecord(pair) || typeof pair.klib !== "string" || typeof pair.jar !== "string")
110462
+ throw new Error("Each dependency JVM ABI requires a klib and a jar path");
110463
+ const klib = import_node_path145.default.resolve(pair.klib);
110464
+ const jar = import_node_path145.default.resolve(pair.jar);
110465
+ if (!klib.endsWith(".klib") || !dependencyPaths.has(klib) || !jar.endsWith(".jar") || !classpathPaths.has(jar) || jar === kotlinJvmAbi)
110466
+ throw new Error(
110467
+ "Dependency JVM ABI pairs must refer to a dependency KLIB and its Java classpath JAR"
110468
+ );
110469
+ dependencyAbiFlags.push("--dependency-jvm-abi", klib, jar);
110470
+ }
110471
+ }
110472
+ let translatedSources = [];
110473
+ if (javaSources.length) {
110474
+ const platform2 = import_node_path145.default.join(work, "platform.txt");
110475
+ const members2 = kotlinToolCommand(
110476
+ ready,
110477
+ sdkRoot,
110478
+ "dev.peach.tools.platform.KlibClassesKt",
110479
+ [
110480
+ ...compileLibraries.map((file) => import_node_path145.default.resolve(file)),
110481
+ ...kotlinJvmAbi ? ["--same-library-jvm-abi", kotlinJvmAbi] : [],
110482
+ ...dependencyAbiFlags
110483
+ ]
110484
+ );
110485
+ const fd = import_node_fs142.default.openSync(platform2, "w");
110486
+ try {
110487
+ await runCompiler2(
110488
+ members2.file,
110489
+ members2.args,
110490
+ { stdio: ["ignore", fd, "inherit"] },
110491
+ "Android library " + name3 + " metadata read"
110492
+ );
110493
+ } finally {
110494
+ import_node_fs142.default.closeSync(fd);
110495
+ }
110496
+ const sourceList = import_node_path145.default.join(work, "sources.txt");
110497
+ import_node_fs142.default.writeFileSync(
110498
+ sourceList,
110499
+ javaSources.map((file) => import_node_path145.default.resolve(file)).join("\n")
110500
+ );
110501
+ const translated = import_node_path145.default.join(work, "translated");
110502
+ const diagnostics = await runKotlinTool(
110503
+ ready,
110504
+ sdkRoot,
110505
+ "dev.peach.tools.java.JavaTranslatorKt",
110506
+ [
110507
+ "--target",
110508
+ "wasm",
110509
+ "--release",
110510
+ input.release,
110511
+ "--classpath",
110512
+ input.javaClasspath.map((file) => import_node_path145.default.resolve(file)).join(import_node_path145.default.delimiter),
110513
+ "--platform",
110514
+ platform2,
110515
+ ...input.processorPath ? ["--processorpath", input.processorPath] : [],
110516
+ "--out",
110517
+ translated,
110518
+ `@${sourceList}`
110519
+ ]
110520
+ );
110521
+ if (/^refuses /m.test(diagnostics))
110522
+ throw new Error(
110523
+ `Android library ${name3} requires unsupported platform members:
110524
+ ${diagnostics.trimEnd()}`
110525
+ );
110526
+ translatedSources = input.kotlinFragments ? import_node_fs142.default.readdirSync(translated, { recursive: true, encoding: "utf8" }).filter((file) => file.endsWith(".kt")).sort().map((file) => import_node_path145.default.join(translated, file)) : [translated];
110527
+ }
110528
+ const multiplatform = input.kotlinFragments ? kotlinFragmentFlags(input.kotlinFragments, kotlinSources2, translatedSources) : commonSources.length ? ["-Xmulti-platform", `-Xcommon-sources=${commonSources.join(",")}`] : [];
110529
+ const language = input.kotlinLanguage ?? "2.1";
110530
+ const raw2 = import_node_path145.default.join(work, "raw");
110531
+ await runCompiler2(
110532
+ ready.kotlinc,
110533
+ [
110534
+ "-J-Xmx4g",
110535
+ "-Xwasm-target=js",
110536
+ "-nowarn",
110537
+ `-Xplugin=${import_node_path145.default.join(sdkRoot, "plugin.jar")}`,
110538
+ "-P",
110539
+ "plugin:dev.peach.jni:android=true",
110540
+ "-language-version",
110541
+ language,
110542
+ "-api-version",
110543
+ language,
110544
+ ...(input.kotlinOptIns ?? []).map((marker) => `-opt-in=${marker}`),
110545
+ ...multiplatform,
110546
+ "-libraries",
110547
+ compileLibraries.join(import_node_path145.default.delimiter),
110548
+ "-ir-output-dir",
110549
+ raw2,
110550
+ "-ir-output-name",
110551
+ name3,
110552
+ ...kotlinSources2,
110553
+ ...translatedSources
110554
+ ],
110555
+ { stdio: "inherit", env: { ...process.env, JAVA_HOME: ready.javaHome } },
110556
+ "Android library " + name3 + " compilation"
110557
+ );
110558
+ const compiled = import_node_path145.default.join(raw2, `${name3}.klib`);
110559
+ if (!javaSources.length) {
110560
+ import_node_fs142.default.renameSync(compiled, output);
110561
+ return;
110562
+ }
110563
+ const normalized = import_node_path145.default.join(work, "normalized.klib");
110564
+ await runKotlinTool(ready, sdkRoot, "dev.peach.tools.platform.JavaPlatformTypesKt", [
110565
+ compiled,
110566
+ normalized,
110567
+ "--java-classes"
110568
+ ]);
110569
+ import_node_fs142.default.renameSync(normalized, output);
110570
+ } finally {
110571
+ import_node_fs142.default.rmSync(work, { recursive: true, force: true });
110572
+ }
110573
+ }
110574
+ var import_node_child_process69, import_node_fs142, import_node_path145;
110575
+ var init_kotlin_library_sources = __esm({
110576
+ "src/kotlin-library-sources.ts"() {
110577
+ "use strict";
110578
+ import_node_child_process69 = require("node:child_process");
110579
+ import_node_fs142 = __toESM(require("node:fs"), 1);
110580
+ import_node_path145 = __toESM(require("node:path"), 1);
110581
+ init_is_record();
110582
+ init_kotlin_toolchain();
110583
+ }
110584
+ });
110585
+
110586
+ // src/kotlin-maven-sources.ts
110587
+ function zipSources(bytes, where) {
110588
+ let end = -1;
110589
+ const earliest = Math.max(0, bytes.length - 22 - 65535);
110590
+ for (let index = bytes.length - 22; index >= earliest; index--) {
110591
+ if (bytes.readUInt32LE(index) === 101010256) {
110592
+ end = index;
110593
+ break;
110594
+ }
110595
+ }
110596
+ if (end < 0) throw new Error(`${where}: sources jar is not a zip`);
110597
+ const count = bytes.readUInt16LE(end + 8);
110598
+ if (count !== bytes.readUInt16LE(end + 10))
110599
+ throw new Error(`${where}: sources jar spans zip disks`);
110600
+ let offset = bytes.readUInt32LE(end + 16);
110601
+ if (offset === 4294967295) throw new Error(`${where}: sources jar is zip64`);
110602
+ const entries2 = [];
110603
+ let totalExtractedBytes = 0;
110604
+ for (let index = 0; index < count; index++) {
110605
+ if (bytes.readUInt32LE(offset) !== 33639248)
110606
+ throw new Error(`${where}: sources jar has a broken central directory`);
110607
+ const flags = bytes.readUInt16LE(offset + 8);
110608
+ const method = bytes.readUInt16LE(offset + 10);
110609
+ const compressed = bytes.readUInt32LE(offset + 20);
110610
+ const uncompressed = bytes.readUInt32LE(offset + 24);
110611
+ const nameLength = bytes.readUInt16LE(offset + 28);
110612
+ const extraLength = bytes.readUInt16LE(offset + 30);
110613
+ const commentLength = bytes.readUInt16LE(offset + 32);
110614
+ const localOffset = bytes.readUInt32LE(offset + 42);
110615
+ const name3 = bytes.toString("utf8", offset + 46, offset + 46 + nameLength);
110616
+ offset += 46 + nameLength + extraLength + commentLength;
110617
+ if (name3.endsWith("/")) continue;
110618
+ if (flags & 1) throw new Error(`${where}: ${name3} is encrypted`);
110619
+ if (name3.includes("\0") || name3.includes("\\") || name3.includes("\n") || name3.includes("\r") || name3.startsWith("/") || name3.split("/").includes(".."))
110620
+ throw new Error(`${where}: ${name3} escapes the sources jar`);
110621
+ if (!name3.endsWith(".kt") && !name3.endsWith(".java")) continue;
110622
+ if (uncompressed > MAX_SOURCE_ENTRY_BYTES || totalExtractedBytes + uncompressed > MAX_TOTAL_EXTRACTED_BYTES) {
110623
+ throw new Error(`${where}: ${name3} exceeds sources jar extraction budget`);
110624
+ }
110625
+ if (bytes.readUInt32LE(localOffset) !== 67324752)
110626
+ throw new Error(`${where}: ${name3} has no local header`);
110627
+ const localName = bytes.readUInt16LE(localOffset + 26);
110628
+ const localExtra = bytes.readUInt16LE(localOffset + 28);
110629
+ const start = localOffset + 30 + localName + localExtra;
110630
+ if (start + compressed > bytes.byteLength)
110631
+ throw new Error(`${where}: ${name3} exceeds sources jar bounds`);
110632
+ const remainingBudget = Math.min(
110633
+ MAX_SOURCE_ENTRY_BYTES,
110634
+ MAX_TOTAL_EXTRACTED_BYTES - totalExtractedBytes
110635
+ );
110636
+ const payload = bytes.subarray(start, start + compressed);
110637
+ let data = null;
110638
+ if (method === 0) {
110639
+ if (payload.byteLength > remainingBudget) {
110640
+ throw new Error(`${where}: ${name3} exceeds sources jar extraction budget`);
110641
+ }
110642
+ data = Buffer.from(payload);
110643
+ } else if (method === 8) {
110644
+ data = (0, import_node_zlib9.inflateRawSync)(payload, { maxOutputLength: remainingBudget });
110645
+ }
110646
+ if (!data) throw new Error(`${where}: ${name3} uses zip method ${method}`);
110647
+ totalExtractedBytes += data.byteLength;
110648
+ if (totalExtractedBytes > MAX_TOTAL_EXTRACTED_BYTES) {
110649
+ throw new Error(`${where}: sources jar exceeds extraction budget`);
110650
+ }
110651
+ entries2.push({ name: name3, data });
110652
+ }
110653
+ return entries2;
110654
+ }
110655
+ function extract(bytes, where) {
110656
+ const key2 = (0, import_node_crypto87.createHash)("sha256").update(bytes).digest("hex");
110657
+ const cached2 = pending.get(key2);
110658
+ if (cached2) return cached2;
110659
+ const request = (async () => {
110660
+ const dest = import_node_path146.default.join(import_node_os29.default.tmpdir(), "peach-maven-sources", key2);
110661
+ const marker = import_node_path146.default.join(dest, ".complete");
110662
+ if (!import_node_fs143.default.existsSync(marker)) {
110663
+ const sources = zipSources(bytes, where);
110664
+ const staging = `${dest}.partial-${process.pid}`;
110665
+ import_node_fs143.default.rmSync(staging, { recursive: true, force: true });
110666
+ const stagingRoot = import_node_path146.default.resolve(staging);
110667
+ import_node_fs143.default.mkdirSync(stagingRoot, { recursive: true });
110668
+ for (const entry of sources) {
110669
+ const file = import_node_path146.default.resolve(stagingRoot, entry.name);
110670
+ if (!file.startsWith(`${stagingRoot}${import_node_path146.default.sep}`)) {
110671
+ throw new Error(`${where}: ${entry.name} escapes the sources jar`);
110672
+ }
110673
+ import_node_fs143.default.mkdirSync(import_node_path146.default.dirname(file), { recursive: true });
110674
+ import_node_fs143.default.writeFileSync(file, entry.data);
110675
+ }
110676
+ import_node_fs143.default.writeFileSync(import_node_path146.default.join(staging, ".complete"), "");
110677
+ try {
110678
+ import_node_fs143.default.renameSync(staging, dest);
110679
+ } catch (error) {
110680
+ import_node_fs143.default.rmSync(staging, { recursive: true, force: true });
110681
+ if (!import_node_fs143.default.existsSync(marker)) throw error;
110682
+ }
110683
+ }
110684
+ const files2 = import_node_fs143.default.readdirSync(dest, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path146.default.join(entry.parentPath, entry.name)).sort();
110685
+ return {
110686
+ directory: dest,
110687
+ java: files2.filter((file) => file.endsWith(".java")),
110688
+ kotlin: files2.filter((file) => file.endsWith(".kt"))
110689
+ };
110690
+ })().catch((error) => {
110691
+ pending.delete(key2);
110692
+ throw error;
110693
+ });
110694
+ pending.set(key2, request);
110695
+ return request;
110696
+ }
110697
+ function readSourcesJar(archive, where) {
110698
+ if (import_node_fs143.default.statSync(archive).size > MAX_SOURCES_JAR_BYTES)
110699
+ throw new Error(`${where}: ${archive} exceeds sources jar size limit`);
110700
+ return import_node_fs143.default.readFileSync(archive);
110701
+ }
110702
+ function readMavenSourcesArchive(archive) {
110703
+ return extract(readSourcesJar(archive, archive), archive);
110704
+ }
110705
+ var import_node_crypto87, import_node_fs143, import_node_os29, import_node_path146, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
110706
+ var init_kotlin_maven_sources = __esm({
110707
+ "src/kotlin-maven-sources.ts"() {
110708
+ "use strict";
110709
+ import_node_crypto87 = require("node:crypto");
110710
+ import_node_fs143 = __toESM(require("node:fs"), 1);
110711
+ import_node_os29 = __toESM(require("node:os"), 1);
110712
+ import_node_path146 = __toESM(require("node:path"), 1);
110713
+ import_node_zlib9 = require("node:zlib");
110714
+ pending = /* @__PURE__ */ new Map();
110715
+ MAX_SOURCES_JAR_BYTES = 64 * 1024 * 1024;
110716
+ MAX_SOURCE_ENTRY_BYTES = 16 * 1024 * 1024;
110717
+ MAX_TOTAL_EXTRACTED_BYTES = 64 * 1024 * 1024;
110718
+ }
110719
+ });
110720
+
110721
+ // src/kotlin-gradle-library-plan.ts
110722
+ async function compileKotlinGradleLibraries(input) {
110723
+ const compiled = /* @__PURE__ */ new Map();
110724
+ for (const library of input.plan.libraries) {
110725
+ const { java: archiveJava, kotlin } = await readMavenSourcesArchive(library.archive);
110726
+ const java = archiveJava.filter((file) => import_node_path147.default.basename(file) !== "module-info.java");
110727
+ const dependencies = library.dependencies.map((name4) => {
110728
+ const dependency = compiled.get(name4);
110729
+ if (!dependency) throw new Error(`${library.coordinate} depends on missing ${name4}`);
110730
+ return dependency;
110731
+ });
110732
+ const classpath = [
110733
+ .../* @__PURE__ */ new Set([
110734
+ ...library.jars,
110735
+ ...dependencies.flatMap(({ jars }) => jars),
110736
+ ...input.plan.classpath
110737
+ ])
110738
+ ];
110739
+ const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
110740
+ const suffix = (0, import_node_crypto88.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
110741
+ const klib = import_node_path147.default.join(input.output, `${name3}-${suffix}.klib`);
110742
+ const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
110743
+ const abiPairs = java.length ? dependencies.flatMap(
110744
+ ({ klib: klib2, jars }) => jars.length === 1 ? [{ klib: klib2, jar: jars[0] }] : []
110745
+ ) : [];
110746
+ const dependencyJvmAbi = abiPairs.length ? `${klib}.json` : void 0;
110747
+ if (dependencyJvmAbi) {
110748
+ import_node_fs144.default.mkdirSync(input.output, { recursive: true });
110749
+ import_node_fs144.default.writeFileSync(dependencyJvmAbi, JSON.stringify(abiPairs));
110750
+ }
110751
+ await compileKotlinLibrarySources({
110752
+ ready: input.ready,
110753
+ sdkRoot: input.sdkRoot,
110754
+ libraries: input.libraries,
110755
+ source: { kind: "files", java, kotlin },
110756
+ javaClasspath: classpath,
110757
+ release: "17",
110758
+ kotlinJvmAbi,
110759
+ dependencyJvmAbi,
110760
+ kotlinLanguage: input.language,
110761
+ dependencies: dependencies.map(({ klib: klib2 }) => klib2),
110762
+ output: klib
110763
+ });
110764
+ compiled.set(library.coordinate, { klib, jars: library.jars });
110765
+ }
110766
+ return [...compiled.values()].map(({ klib }) => klib);
110767
+ }
110768
+ var import_node_crypto88, import_node_fs144, import_node_path147;
110769
+ var init_kotlin_gradle_library_plan = __esm({
110770
+ "src/kotlin-gradle-library-plan.ts"() {
110771
+ "use strict";
110772
+ import_node_crypto88 = require("node:crypto");
110773
+ import_node_fs144 = __toESM(require("node:fs"), 1);
110774
+ import_node_path147 = __toESM(require("node:path"), 1);
110775
+ init_kotlin_library_sources();
110776
+ init_kotlin_maven_sources();
110777
+ }
110778
+ });
110779
+
110276
110780
  // src/kotlin-instance-source.ts
110277
110781
  function bindingNames(pattern) {
110278
110782
  if (pattern.type === "Identifier") return [pattern.name];
@@ -110407,7 +110911,7 @@ var init_kotlin_instance_source = __esm({
110407
110911
 
110408
110912
  // src/kotlin-skiko-source.ts
110409
110913
  function kotlinSkikoSource(loader) {
110410
- const upstream = (0, import_acorn4.parse)((0, import_node_zlib9.gunzipSync)(loader).toString("utf8"), {
110914
+ const upstream = (0, import_acorn4.parse)((0, import_node_zlib10.gunzipSync)(loader).toString("utf8"), {
110411
110915
  ecmaVersion: "latest",
110412
110916
  sourceType: "module"
110413
110917
  });
@@ -110435,11 +110939,11 @@ function kotlinSkikoSource(loader) {
110435
110939
  ""
110436
110940
  ].join("\n");
110437
110941
  }
110438
- var import_node_zlib9, import_acorn4;
110942
+ var import_node_zlib10, import_acorn4;
110439
110943
  var init_kotlin_skiko_source = __esm({
110440
110944
  "src/kotlin-skiko-source.ts"() {
110441
110945
  "use strict";
110442
- import_node_zlib9 = require("node:zlib");
110946
+ import_node_zlib10 = require("node:zlib");
110443
110947
  import_acorn4 = require("peachsim/vendor/acorn");
110444
110948
  }
110445
110949
  });
@@ -110541,16 +111045,16 @@ __export(kotlin_host_exports, {
110541
111045
  });
110542
111046
  function loadKotlinSdk(moduleRoot, toolchain) {
110543
111047
  return installKotlinSdkArchive(
110544
- import_node_fs142.default.readFileSync(import_node_path145.default.join(moduleRoot, "sdk.tar.gz")),
111048
+ import_node_fs145.default.readFileSync(import_node_path148.default.join(moduleRoot, "sdk.tar.gz")),
110545
111049
  toolchain.compiler
110546
111050
  );
110547
111051
  }
110548
111052
  function appKotlinLanguage(root) {
110549
- const reactNative = import_node_path145.default.dirname(
110550
- (0, import_node_module23.createRequire)(import_node_path145.default.join(root, "package.json")).resolve("react-native/package.json")
111053
+ const reactNative = import_node_path148.default.dirname(
111054
+ (0, import_node_module23.createRequire)(import_node_path148.default.join(root, "package.json")).resolve("react-native/package.json")
110551
111055
  );
110552
- const versions = import_node_fs142.default.readFileSync(
110553
- import_node_path145.default.join(reactNative, "gradle", "libs.versions.toml"),
111056
+ const versions = import_node_fs145.default.readFileSync(
111057
+ import_node_path148.default.join(reactNative, "gradle", "libs.versions.toml"),
110554
111058
  "utf8"
110555
111059
  );
110556
111060
  const match = /^kotlin\s*=\s*"(\d+)\.(\d+)/m.exec(versions);
@@ -110561,9 +111065,9 @@ function appKotlinLanguage(root) {
110561
111065
  function kotlinSources(root, skip = SKIP_DIRS) {
110562
111066
  const sources = [];
110563
111067
  const walk4 = (dir) => {
110564
- for (const entry of import_node_fs142.default.readdirSync(dir, { withFileTypes: true })) {
111068
+ for (const entry of import_node_fs145.default.readdirSync(dir, { withFileTypes: true })) {
110565
111069
  if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
110566
- const full = import_node_path145.default.join(dir, entry.name);
111070
+ const full = import_node_path148.default.join(dir, entry.name);
110567
111071
  if (entry.isDirectory()) walk4(full);
110568
111072
  else if (entry.isFile() && entry.name.endsWith(".kt")) sources.push(full);
110569
111073
  }
@@ -110620,7 +111124,7 @@ function entrySource(ids) {
110620
111124
  ].join("\n");
110621
111125
  }
110622
111126
  function buildsDir() {
110623
- return import_node_path145.default.join(kotlinHome(), "builds");
111127
+ return import_node_path148.default.join(kotlinHome(), "builds");
110624
111128
  }
110625
111129
  async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
110626
111130
  const { kotlinSourceId, nativeSourceContract, renderKotlinSourceGlue } = await import("vxrn/native-source-contract");
@@ -110633,7 +111137,7 @@ async function kotlinArtifact(root, moduleRoot, origin, target = "app") {
110633
111137
  const viewIds = [];
110634
111138
  let usesCompose = false;
110635
111139
  for (const file of sources) {
110636
- const source = import_node_fs142.default.readFileSync(file, "utf8");
111140
+ const source = import_node_fs145.default.readFileSync(file, "utf8");
110637
111141
  if (/\bandroidx\.compose\./.test(source)) usesCompose = true;
110638
111142
  const contract = nativeSourceContract(file, source);
110639
111143
  if (contract.modules.length === 0 && contract.views.length === 0) continue;
@@ -110722,11 +111226,11 @@ function readExpoTypes(output) {
110722
111226
  });
110723
111227
  }
110724
111228
  async function scanSources(tool, parse16, toolchain, moduleRoot, files2) {
110725
- const digest3 = (0, import_node_crypto87.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
111229
+ const digest3 = (0, import_node_crypto89.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
110726
111230
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
110727
- digest3.update(import_node_fs142.default.readFileSync(import_node_path145.default.join(moduleRoot, "sdk.tar.gz")));
111231
+ digest3.update(import_node_fs145.default.readFileSync(import_node_path148.default.join(moduleRoot, "sdk.tar.gz")));
110728
111232
  digest3.update(tool);
110729
- for (const file of files2) digest3.update(`${file}\0${import_node_fs142.default.readFileSync(file, "utf8")}\0`);
111233
+ for (const file of files2) digest3.update(`${file}\0${import_node_fs145.default.readFileSync(file, "utf8")}\0`);
110730
111234
  const key2 = digest3.digest("hex");
110731
111235
  let scan3 = toolScans.get(key2);
110732
111236
  if (!scan3) {
@@ -110741,7 +111245,7 @@ async function scanSources(tool, parse16, toolchain, moduleRoot, files2) {
110741
111245
  async function scanExpoTypes(toolchain, moduleRoot, sources) {
110742
111246
  const candidates = sources.filter(
110743
111247
  (file) => /\bRecord\b|\benum\s+class\b|\bExpoComposeView\b|\bExpoView\b|\bComposeProps\b|:\s*(?:[A-Za-z0-9_.]+\.)?(?:View|FrameLayout|LinearLayout|ViewGroup)\b/.test(
110744
- import_node_fs142.default.readFileSync(file, "utf8")
111248
+ import_node_fs145.default.readFileSync(file, "utf8")
110745
111249
  )
110746
111250
  );
110747
111251
  if (candidates.length === 0) return [];
@@ -110885,7 +111389,7 @@ function expoTypeSources(files2) {
110885
111389
  )
110886
111390
  ];
110887
111391
  if (edits.length > 0 || views.length > 0) {
110888
- let text7 = import_node_fs142.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
111392
+ let text7 = import_node_fs145.default.readFileSync(file.file, "utf8").replaceAll("\r\n", "\n");
110889
111393
  for (const { range: range3, owner, field } of edits.sort((a, b) => b.range[0] - a.range[0]))
110890
111394
  text7 = `${text7.slice(0, range3[0])}dev.peach.expo.PeachExpoTypes.initial(${owner}::class, ${literal2(field.key)}, ${field.required}) { ${text7.slice(range3[0], range3[1])} }${text7.slice(range3[1])}`;
110891
111395
  if (views.length > 0) {
@@ -110901,7 +111405,7 @@ function expoTypeSources(files2) {
110901
111405
  `${file.package ? `${file.package}.` : ""}peachExpoViews${index}()`
110902
111406
  );
110903
111407
  }
110904
- const name3 = `PeachExpoSource_${index}_${import_node_path145.default.basename(file.file)}`;
111408
+ const name3 = `PeachExpoSource_${index}_${import_node_path148.default.basename(file.file)}`;
110905
111409
  generated[name3] = text7;
110906
111410
  origins[name3] = file.file;
110907
111411
  }
@@ -110943,7 +111447,7 @@ async function expoKotlinArtifact(root, moduleRoot, origin, modules) {
110943
111447
  const language = appKotlinLanguage(root);
110944
111448
  const scanned = await scanExpoTypes(toolchain, moduleRoot, modules.sources);
110945
111449
  const usesCompose = scanned.some((file) => file.views.length > 0) || modules.sources.some(
110946
- (file) => /\bandroidx\.compose\./.test(import_node_fs142.default.readFileSync(file, "utf8"))
111450
+ (file) => /\bandroidx\.compose\./.test(import_node_fs145.default.readFileSync(file, "utf8"))
110947
111451
  );
110948
111452
  const types2 = expoTypeSources(scanned);
110949
111453
  const rewritten = new Set(Object.values(types2.origins));
@@ -111109,6 +111613,7 @@ async function kotlinAppArtifact(app, moduleRoot, origin) {
111109
111613
  kotlinOptIns: app.kotlinOptIns,
111110
111614
  sources: app.sources,
111111
111615
  javaSpecs: app.javaSources,
111616
+ gradleLibraries: app.gradleLibraries,
111112
111617
  generated,
111113
111618
  sdkProfile: "app",
111114
111619
  usesCompose: true,
@@ -111161,7 +111666,7 @@ function appResourceSources(app) {
111161
111666
  entries: app.drawables.map((drawable) => ({
111162
111667
  name: drawable.name,
111163
111668
  init: `listOf(
111164
- ${drawable.files.map((file) => drawableInit(file, import_node_path145.default.relative(app.moduleDir, file.file))).join(",\n")}
111669
+ ${drawable.files.map((file) => drawableInit(file, import_node_path148.default.relative(app.moduleDir, file.file))).join(",\n")}
111165
111670
  )`
111166
111671
  }))
111167
111672
  },
@@ -111285,7 +111790,7 @@ function drawableInit(drawable, file) {
111285
111790
  if (drawable.kind === "xml") return `PeachDrawable.Xml(${where})`;
111286
111791
  if (drawable.kind === "bitmap")
111287
111792
  return `PeachDrawable.Bitmap(${where}, ${drawable.ninePatch}, ${literal2(
111288
- import_node_fs142.default.readFileSync(drawable.file).toString("base64")
111793
+ import_node_fs145.default.readFileSync(drawable.file).toString("base64")
111289
111794
  )})`;
111290
111795
  const vector = drawable.vector;
111291
111796
  const float3 = (value) => `${value}f`;
@@ -111347,11 +111852,12 @@ async function compileKotlin(input, origin) {
111347
111852
  usesCompose,
111348
111853
  usesSerialization = false,
111349
111854
  viewModels,
111350
- javaSpecs = []
111855
+ javaSpecs = [],
111856
+ gradleLibraries
111351
111857
  } = input;
111352
111858
  const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
111353
- const plugin = import_node_path145.default.join(sdk2.root, "plugin.jar");
111354
- const sdkLibrary = import_node_path145.default.join(sdk2.root, `${sdkProfile}.klib`);
111859
+ const plugin = import_node_path148.default.join(sdk2.root, "plugin.jar");
111860
+ const sdkLibrary = import_node_path148.default.join(sdk2.root, `${sdkProfile}.klib`);
111355
111861
  const javaRead = javaSpecs.length ? await readJavaModuleSpecs(javaSpecs, sdk2.root, await ensureToolchain(toolchain)) : null;
111356
111862
  const java = javaRead && javaRead.specs.some((spec) => !spec.application) ? { ...javaRead, specs: javaRead.specs.filter((spec) => !spec.application) } : null;
111357
111863
  const applicationJava = javaRead?.specs.filter((spec) => spec.application) ?? [];
@@ -111379,10 +111885,10 @@ async function compileKotlin(input, origin) {
111379
111885
  };
111380
111886
  const inputs2 = sources.map((file) => ({
111381
111887
  file,
111382
- bytes: import_node_fs142.default.readFileSync(file)
111888
+ bytes: import_node_fs145.default.readFileSync(file)
111383
111889
  }));
111384
111890
  const { composeArchive, ...compilerInputs } = toolchain;
111385
- const digest3 = (0, import_node_crypto87.createHash)("sha256");
111891
+ const digest3 = (0, import_node_crypto89.createHash)("sha256");
111386
111892
  digest3.update(
111387
111893
  JSON.stringify({
111388
111894
  format: BUILD_FORMAT,
@@ -111396,7 +111902,17 @@ async function compileKotlin(input, origin) {
111396
111902
  })
111397
111903
  );
111398
111904
  for (const { file, bytes } of inputs2)
111399
- digest3.update(import_node_path145.default.relative(root, file)).update("\0").update(bytes).update("\0");
111905
+ digest3.update(import_node_path148.default.relative(root, file)).update("\0").update(bytes).update("\0");
111906
+ if (gradleLibraries) {
111907
+ digest3.update(JSON.stringify(gradleLibraries));
111908
+ const files2 = /* @__PURE__ */ new Set([
111909
+ ...gradleLibraries.classpath,
111910
+ ...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
111911
+ ]);
111912
+ for (const file of files2) {
111913
+ digest3.update((0, import_node_crypto89.createHash)("sha256").update(import_node_fs145.default.readFileSync(file)).digest());
111914
+ }
111915
+ }
111400
111916
  if (viewModels) digest3.update(viewModels.toolClass);
111401
111917
  for (const [name3, text7] of Object.entries(generated))
111402
111918
  digest3.update(`${name3}\0${text7}\0`);
@@ -111405,49 +111921,49 @@ async function compileKotlin(input, origin) {
111405
111921
  url: `${origin}${KOTLIN_ARTIFACT_PREFIX}${hash}/app.mjs`,
111406
111922
  hash
111407
111923
  };
111408
- const out = import_node_path145.default.join(buildsDir(), hash);
111409
- if (import_node_fs142.default.existsSync(import_node_path145.default.join(out, "js", "app.wasm"))) return artifact;
111410
- const pending = builds.get(hash);
111411
- if (pending) return pending;
111924
+ const out = import_node_path148.default.join(buildsDir(), hash);
111925
+ if (import_node_fs145.default.existsSync(import_node_path148.default.join(out, "js", "app.wasm"))) return artifact;
111926
+ const pending2 = builds.get(hash);
111927
+ if (pending2) return pending2;
111412
111928
  const build2 = (async () => {
111413
111929
  const ready = await ensureToolchain(toolchain);
111414
111930
  const { kotlinc } = ready;
111415
- const libraries = [...ready.libraries, sdkLibrary, import_node_path145.default.join(sdk2.root, "java.klib")];
111931
+ const libraries = [...ready.libraries, sdkLibrary, import_node_path148.default.join(sdk2.root, "java.klib")];
111416
111932
  const compose = usesCompose ? await ensureCompose(toolchain) : null;
111417
111933
  if (compose) libraries.push(...compose.libraries);
111418
- import_node_fs142.default.mkdirSync(buildsDir(), { recursive: true });
111419
- const work = import_node_fs142.default.mkdtempSync(import_node_path145.default.join(buildsDir(), `${hash}-`));
111420
- const javaLibrary = java ? import_node_path145.default.join(work, "java-abi", "java-abi.klib") : null;
111934
+ import_node_fs145.default.mkdirSync(buildsDir(), { recursive: true });
111935
+ const work = import_node_fs145.default.mkdtempSync(import_node_path148.default.join(buildsDir(), `${hash}-`));
111936
+ const javaLibrary = java ? import_node_path148.default.join(work, "java-abi", "java-abi.klib") : null;
111421
111937
  if (javaLibrary) libraries.push(javaLibrary);
111422
- const generatedDir = import_node_path145.default.join(work, "generated");
111423
- import_node_fs142.default.mkdirSync(generatedDir);
111938
+ const generatedDir = import_node_path148.default.join(work, "generated");
111939
+ import_node_fs145.default.mkdirSync(generatedDir);
111424
111940
  for (const [name3, text7] of Object.entries(generated))
111425
- import_node_fs142.default.writeFileSync(import_node_path145.default.join(generatedDir, name3), text7);
111941
+ import_node_fs145.default.writeFileSync(import_node_path148.default.join(generatedDir, name3), text7);
111426
111942
  const compiledSources = inputs2.map(({ file, bytes }, index) => {
111427
- const target = import_node_path145.default.join(work, "sources", String(index), import_node_path145.default.basename(file));
111428
- import_node_fs142.default.mkdirSync(import_node_path145.default.dirname(target), { recursive: true });
111429
- import_node_fs142.default.writeFileSync(target, bytes);
111943
+ const target = import_node_path148.default.join(work, "sources", String(index), import_node_path148.default.basename(file));
111944
+ import_node_fs145.default.mkdirSync(import_node_path148.default.dirname(target), { recursive: true });
111945
+ import_node_fs145.default.writeFileSync(target, bytes);
111430
111946
  return { file, target };
111431
111947
  });
111432
- const common2 = [
111948
+ const common2 = () => [
111433
111949
  // the full upstream Compose graph exceeds kotlinc's 512 mib default heap.
111434
111950
  "-J-Xmx2g",
111435
111951
  "-Xallow-kotlin-package",
111436
111952
  "-Xwasm-target=js",
111437
111953
  "-libraries",
111438
- libraries.join(import_node_path145.default.delimiter)
111954
+ libraries.join(import_node_path148.default.delimiter)
111439
111955
  ];
111440
111956
  const compileKlib = (outputDir) => run15(
111441
111957
  kotlinc,
111442
111958
  [
111443
- ...common2,
111959
+ ...common2(),
111444
111960
  `-Xplugin=${plugin}`,
111445
- `-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path145.default.delimiter)}`,
111961
+ `-Xfriend-modules=${[sdkLibrary, ...javaLibrary ? [javaLibrary] : []].join(import_node_path148.default.delimiter)}`,
111446
111962
  ...usesCompose ? [
111447
- `-Xplugin=${import_node_path145.default.resolve(import_node_path145.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
111963
+ `-Xplugin=${import_node_path148.default.resolve(import_node_path148.default.dirname(kotlinc), "../lib/compose-compiler-plugin.jar")}`
111448
111964
  ] : [],
111449
111965
  ...usesSerialization ? [
111450
- `-Xplugin=${import_node_path145.default.resolve(import_node_path145.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
111966
+ `-Xplugin=${import_node_path148.default.resolve(import_node_path148.default.dirname(kotlinc), "../lib/kotlinx-serialization-compiler-plugin.jar")}`
111451
111967
  ] : [],
111452
111968
  "-language-version",
111453
111969
  language,
@@ -111461,11 +111977,23 @@ async function compileKotlin(input, origin) {
111461
111977
  "-ir-output-name",
111462
111978
  "app",
111463
111979
  ...compiledSources.map(({ target }) => target),
111464
- ...Object.keys(generated).map((name3) => import_node_path145.default.join(generatedDir, name3))
111980
+ ...Object.keys(generated).map((name3) => import_node_path148.default.join(generatedDir, name3))
111465
111981
  ],
111466
111982
  { maxBuffer: 16 * 1024 * 1024 }
111467
111983
  );
111468
111984
  try {
111985
+ if (gradleLibraries) {
111986
+ libraries.push(
111987
+ ...await compileKotlinGradleLibraries({
111988
+ plan: gradleLibraries,
111989
+ ready,
111990
+ sdkRoot: sdk2.root,
111991
+ libraries: libraries.filter((library) => library !== javaLibrary),
111992
+ language,
111993
+ output: import_node_path148.default.join(work, "gradle-libraries")
111994
+ })
111995
+ );
111996
+ }
111469
111997
  if (java)
111470
111998
  await compileJavaModuleAbi({
111471
111999
  specs: java,
@@ -111480,49 +112008,49 @@ async function compileKotlin(input, origin) {
111480
112008
  if (viewModels && inputs2.some(
111481
112009
  ({ file, bytes }) => sources.includes(file) && bytes.includes("ViewModel")
111482
112010
  )) {
111483
- await compileKlib(import_node_path145.default.join(work, "abi"));
112011
+ await compileKlib(import_node_path148.default.join(work, "abi"));
111484
112012
  const stdout = await runKotlinTool(
111485
112013
  ready,
111486
112014
  sdk2.root,
111487
112015
  viewModels.toolClass,
111488
- [import_node_path145.default.join(work, "abi")],
112016
+ [import_node_path148.default.join(work, "abi")],
111489
112017
  64 * 1024 * 1024
111490
112018
  );
111491
- import_node_fs142.default.writeFileSync(
111492
- import_node_path145.default.join(generatedDir, viewModels.file),
112019
+ import_node_fs145.default.writeFileSync(
112020
+ import_node_path148.default.join(generatedDir, viewModels.file),
111493
112021
  viewModels.render(viewModelClasses(readAbiClasses(stdout)))
111494
112022
  );
111495
112023
  }
111496
- await compileKlib(import_node_path145.default.join(work, "klib"));
112024
+ await compileKlib(import_node_path148.default.join(work, "klib"));
111497
112025
  await run15(
111498
112026
  kotlinc,
111499
112027
  [
111500
- ...common2,
112028
+ ...common2(),
111501
112029
  "-nowarn",
111502
112030
  "-Xpartial-linkage-loglevel=error",
111503
- `-Xinclude=${import_node_path145.default.join(work, "klib")}`,
112031
+ `-Xinclude=${import_node_path148.default.join(work, "klib")}`,
111504
112032
  "-Xir-produce-js",
111505
112033
  "-Xir-dce",
111506
112034
  "-ir-output-dir",
111507
- import_node_path145.default.join(work, "js"),
112035
+ import_node_path148.default.join(work, "js"),
111508
112036
  "-ir-output-name",
111509
112037
  "app"
111510
112038
  ],
111511
112039
  { maxBuffer: 16 * 1024 * 1024 }
111512
112040
  );
111513
112041
  if (compose) {
111514
- import_node_fs142.default.writeFileSync(
111515
- import_node_path145.default.join(work, "js", "skiko.mjs"),
111516
- kotlinSkikoSource(import_node_fs142.default.readFileSync(compose.loader))
112042
+ import_node_fs145.default.writeFileSync(
112043
+ import_node_path148.default.join(work, "js", "skiko.mjs"),
112044
+ kotlinSkikoSource(import_node_fs145.default.readFileSync(compose.loader))
111517
112045
  );
111518
112046
  }
111519
112047
  if (usesCompose) {
111520
112048
  for (const library of toolchain.composeJsLibraries) {
111521
112049
  let imported = false;
111522
- for (const file of import_node_fs142.default.readdirSync(import_node_path145.default.join(work, "js"))) {
112050
+ for (const file of import_node_fs145.default.readdirSync(import_node_path148.default.join(work, "js"))) {
111523
112051
  if (!file.endsWith(".mjs")) continue;
111524
- const target = import_node_path145.default.join(work, "js", file);
111525
- const source = import_node_fs142.default.readFileSync(target, "utf8");
112052
+ const target = import_node_path148.default.join(work, "js", file);
112053
+ const source = import_node_fs145.default.readFileSync(target, "utf8");
111526
112054
  let next = source;
111527
112055
  for (const quote3 of ["'", '"'])
111528
112056
  next = next.replaceAll(
@@ -111530,11 +112058,11 @@ async function compileKotlin(input, origin) {
111530
112058
  `from ${quote3}./${library.file}${quote3}`
111531
112059
  );
111532
112060
  if (next === source) continue;
111533
- import_node_fs142.default.writeFileSync(target, next);
112061
+ import_node_fs145.default.writeFileSync(target, next);
111534
112062
  imported = true;
111535
112063
  }
111536
112064
  if (!imported) continue;
111537
- const archive = import_node_path145.default.join(
112065
+ const archive = import_node_path148.default.join(
111538
112066
  kotlinHome(),
111539
112067
  toolchain.compiler.version,
111540
112068
  library.name
@@ -111543,24 +112071,24 @@ async function compileKotlin(input, origin) {
111543
112071
  const { stdout } = await run15("tar", ["-xOf", archive, library.archiveEntry], {
111544
112072
  maxBuffer: 16 * 1024 * 1024
111545
112073
  });
111546
- import_node_fs142.default.writeFileSync(import_node_path145.default.join(work, "js", library.file), stdout);
112074
+ import_node_fs145.default.writeFileSync(import_node_path148.default.join(work, "js", library.file), stdout);
111547
112075
  }
111548
112076
  }
111549
112077
  } catch (error) {
111550
- import_node_fs142.default.rmSync(work, { recursive: true, force: true });
112078
+ import_node_fs145.default.rmSync(work, { recursive: true, force: true });
111551
112079
  let output = isRecord(error) ? `${String(error.stderr ?? "")}${String(error.stdout ?? "")}` : "";
111552
112080
  for (const [name3, source] of Object.entries(origins))
111553
- output = output.replaceAll(import_node_path145.default.join(generatedDir, name3), source);
112081
+ output = output.replaceAll(import_node_path148.default.join(generatedDir, name3), source);
111554
112082
  for (const [index, spec] of applicationJava.entries())
111555
112083
  output = output.replaceAll(
111556
- import_node_path145.default.join(generatedDir, `JavaApplication${index}.kt`),
112084
+ import_node_path148.default.join(generatedDir, `JavaApplication${index}.kt`),
111557
112085
  spec.file
111558
112086
  );
111559
112087
  for (const { file, target } of compiledSources)
111560
- output = output.replaceAll(target, file).replaceAll(import_node_path145.default.relative(process.cwd(), target), file);
112088
+ output = output.replaceAll(target, file).replaceAll(import_node_path148.default.relative(process.cwd(), target), file);
111561
112089
  for (const [index, spec] of (java?.specs ?? []).entries())
111562
112090
  output = output.replaceAll(
111563
- import_node_path145.default.join(work, "java-abi", `Spec${index}.kt`),
112091
+ import_node_path148.default.join(work, "java-abi", `Spec${index}.kt`),
111564
112092
  spec.file
111565
112093
  );
111566
112094
  output = output.replace(
@@ -111573,20 +112101,20 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111573
112101
  );
111574
112102
  }
111575
112103
  const seams = [kotlinNodeDetection];
111576
- const js = import_node_fs142.default.readdirSync(import_node_path145.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
112104
+ const js = import_node_fs145.default.readdirSync(import_node_path148.default.join(work, "js")).filter((file) => file.endsWith(".mjs"));
111577
112105
  if (js.some(
111578
- (file) => import_node_fs142.default.readFileSync(import_node_path145.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
112106
+ (file) => import_node_fs145.default.readFileSync(import_node_path148.default.join(work, "js", file), "utf8").includes("'kotlinx.coroutines.")
111579
112107
  ))
111580
112108
  seams.push(kotlinCoroutineDispatcher);
111581
112109
  for (const [from, to] of seams) {
111582
112110
  let patched = 0;
111583
112111
  for (const file of js) {
111584
- const target = import_node_path145.default.join(work, "js", file);
111585
- const text7 = import_node_fs142.default.readFileSync(target, "utf8");
112112
+ const target = import_node_path148.default.join(work, "js", file);
112113
+ const text7 = import_node_fs145.default.readFileSync(target, "utf8");
111586
112114
  const next = text7.replaceAll(from, to);
111587
112115
  if (next !== text7) {
111588
112116
  patched++;
111589
- import_node_fs142.default.writeFileSync(target, next);
112117
+ import_node_fs145.default.writeFileSync(target, next);
111590
112118
  }
111591
112119
  }
111592
112120
  if (patched === 0)
@@ -111594,11 +112122,11 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111594
112122
  `kotlin output no longer contains ${from}; recheck how it detects its host in Peach`
111595
112123
  );
111596
112124
  }
111597
- const entry = import_node_path145.default.join(work, "js/app.mjs");
111598
- const entrySource2 = import_node_fs142.default.readFileSync(entry, "utf8");
111599
- const importsPath = import_node_path145.default.join(work, "js/app.import-object.mjs");
112125
+ const entry = import_node_path148.default.join(work, "js/app.mjs");
112126
+ const entrySource2 = import_node_fs145.default.readFileSync(entry, "utf8");
112127
+ const importsPath = import_node_path148.default.join(work, "js/app.import-object.mjs");
111600
112128
  const importsFactory = kotlinInstanceSource(
111601
- import_node_fs142.default.readFileSync(importsPath, "utf8"),
112129
+ import_node_fs145.default.readFileSync(importsPath, "utf8"),
111602
112130
  "createKotlinImportObject"
111603
112131
  );
111604
112132
  const runtimeFactory = kotlinInstanceSource(
@@ -111606,9 +112134,9 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111606
112134
  "createKotlinInstance",
111607
112135
  /* @__PURE__ */ new Map([["./app.import-object.mjs", "createKotlinImportObject"]])
111608
112136
  );
111609
- import_node_fs142.default.writeFileSync(importsPath, importsFactory.source);
111610
- import_node_fs142.default.writeFileSync(import_node_path145.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
111611
- import_node_fs142.default.writeFileSync(
112137
+ import_node_fs145.default.writeFileSync(importsPath, importsFactory.source);
112138
+ import_node_fs145.default.writeFileSync(import_node_path148.default.join(work, "js/app-runtime.mjs"), runtimeFactory.source);
112139
+ import_node_fs145.default.writeFileSync(
111612
112140
  entry,
111613
112141
  [
111614
112142
  "import { createKotlinInstance } from './app-runtime.mjs';",
@@ -111621,10 +112149,10 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111621
112149
  ].join("\n")
111622
112150
  );
111623
112151
  try {
111624
- import_node_fs142.default.renameSync(work, out);
112152
+ import_node_fs145.default.renameSync(work, out);
111625
112153
  } catch (error) {
111626
- if (!import_node_fs142.default.existsSync(import_node_path145.default.join(out, "js", "app.wasm"))) throw error;
111627
- import_node_fs142.default.rmSync(work, { recursive: true, force: true });
112154
+ if (!import_node_fs145.default.existsSync(import_node_path148.default.join(out, "js", "app.wasm"))) throw error;
112155
+ import_node_fs145.default.rmSync(work, { recursive: true, force: true });
111628
112156
  }
111629
112157
  return artifact;
111630
112158
  })().finally(() => builds.delete(hash));
@@ -111632,24 +112160,24 @@ ${output.trim() || (error instanceof Error ? error.message : String(error))}`
111632
112160
  return build2;
111633
112161
  }
111634
112162
  function kotlinArtifactFiles(hash) {
111635
- const dir = import_node_path145.default.join(buildsDir(), hash, "js");
111636
- return import_node_fs142.default.readdirSync(dir).sort().map((name3) => {
111637
- const contentType = CONTENT_TYPES[import_node_path145.default.extname(name3)];
112163
+ const dir = import_node_path148.default.join(buildsDir(), hash, "js");
112164
+ return import_node_fs145.default.readdirSync(dir).sort().map((name3) => {
112165
+ const contentType = CONTENT_TYPES[import_node_path148.default.extname(name3)];
111638
112166
  if (!contentType) throw new Error(`unexpected kotlin artifact file ${name3}`);
111639
- return { name: name3, bytes: import_node_fs142.default.readFileSync(import_node_path145.default.join(dir, name3)), contentType };
112167
+ return { name: name3, bytes: import_node_fs145.default.readFileSync(import_node_path148.default.join(dir, name3)), contentType };
111640
112168
  });
111641
112169
  }
111642
112170
  function serveKotlinArtifact(pathname, res) {
111643
112171
  if (!pathname.startsWith(KOTLIN_ARTIFACT_PREFIX)) return false;
111644
112172
  const [hash, file, ...rest] = pathname.slice(KOTLIN_ARTIFACT_PREFIX.length).split("/");
111645
- const type = file ? CONTENT_TYPES[import_node_path145.default.extname(file)] : void 0;
112173
+ const type = file ? CONTENT_TYPES[import_node_path148.default.extname(file)] : void 0;
111646
112174
  if (!hash || !/^[0-9a-f]+$/.test(hash) || !file || rest.length > 0 || !type || file.includes("..")) {
111647
112175
  res.statusCode = 404;
111648
112176
  res.end("not a kotlin artifact");
111649
112177
  return true;
111650
112178
  }
111651
- const target = import_node_path145.default.join(buildsDir(), hash, "js", file);
111652
- if (!import_node_fs142.default.existsSync(target)) {
112179
+ const target = import_node_path148.default.join(buildsDir(), hash, "js", file);
112180
+ if (!import_node_fs145.default.existsSync(target)) {
111653
112181
  res.statusCode = 404;
111654
112182
  res.end(`kotlin artifact ${hash}/${file} was not built`);
111655
112183
  return true;
@@ -111657,7 +112185,7 @@ function serveKotlinArtifact(pathname, res) {
111657
112185
  res.setHeader("access-control-allow-origin", "*");
111658
112186
  res.setHeader("content-type", type);
111659
112187
  res.setHeader("cache-control", "public, max-age=31536000, immutable");
111660
- res.end(import_node_fs142.default.readFileSync(target));
112188
+ res.end(import_node_fs145.default.readFileSync(target));
111661
112189
  return true;
111662
112190
  }
111663
112191
  async function serveKotlinRequest(pathname, res, app) {
@@ -111674,15 +112202,15 @@ async function serveKotlinRequest(pathname, res, app) {
111674
112202
  }
111675
112203
  return true;
111676
112204
  }
111677
- var import_node_child_process69, import_node_crypto87, import_node_fs142, import_node_module23, import_node_path145, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
112205
+ var import_node_child_process70, import_node_crypto89, import_node_fs145, import_node_module23, import_node_path148, import_node_util22, run15, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal2, CONTENT_TYPES;
111678
112206
  var init_kotlin_host = __esm({
111679
112207
  "src/kotlin-host.ts"() {
111680
112208
  "use strict";
111681
- import_node_child_process69 = require("node:child_process");
111682
- import_node_crypto87 = require("node:crypto");
111683
- import_node_fs142 = __toESM(require("node:fs"), 1);
112209
+ import_node_child_process70 = require("node:child_process");
112210
+ import_node_crypto89 = require("node:crypto");
112211
+ import_node_fs145 = __toESM(require("node:fs"), 1);
111684
112212
  import_node_module23 = require("node:module");
111685
- import_node_path145 = __toESM(require("node:path"), 1);
112213
+ import_node_path148 = __toESM(require("node:path"), 1);
111686
112214
  import_node_util22 = require("node:util");
111687
112215
  init_kotlinDiscoveryContract();
111688
112216
  init_android_bridge_packages();
@@ -111690,13 +112218,14 @@ var init_kotlin_host = __esm({
111690
112218
  init_is_record();
111691
112219
  init_java_module_abi();
111692
112220
  init_kotlin_browser_seams();
112221
+ init_kotlin_gradle_library_plan();
111693
112222
  init_kotlin_instance_source();
111694
112223
  init_kotlin_sdk();
111695
112224
  init_kotlin_skiko_source();
111696
112225
  init_kotlin_toolchain();
111697
112226
  init_kotlin_view_models();
111698
112227
  init_kotlin_module();
111699
- run15 = (0, import_node_util22.promisify)(import_node_child_process69.execFile);
112228
+ run15 = (0, import_node_util22.promisify)(import_node_child_process70.execFile);
111700
112229
  KOTLIN_ARTIFACT_PREFIX = "/__peach/kotlin-artifact/";
111701
112230
  SKIP_DIRS = /* @__PURE__ */ new Set([
111702
112231
  "node_modules",
@@ -111800,8 +112329,8 @@ async function collectExpoKotlinModules(appRoot) {
111800
112329
  for (const project2 of entry.projects) {
111801
112330
  if (!isRecord(project2) || typeof project2.sourceDir !== "string" || !Array.isArray(project2.modules))
111802
112331
  throw new Error("invalid Expo Android project");
111803
- const sourceDir = import_node_fs143.default.realpathSync(project2.sourceDir);
111804
- const installed = sourceDir.split(import_node_path146.default.sep).includes("node_modules");
112332
+ const sourceDir = import_node_fs146.default.realpathSync(project2.sourceDir);
112333
+ const installed = sourceDir.split(import_node_path149.default.sep).includes("node_modules");
111805
112334
  if (installed) {
111806
112335
  if (typeof entry.packageName !== "string") continue;
111807
112336
  if (peachAnsweredNativePackages().has(entry.packageName)) {
@@ -111829,9 +112358,9 @@ async function collectExpoKotlinModules(appRoot) {
111829
112358
  group.unsupported ??= reason;
111830
112359
  };
111831
112360
  const walk4 = (dir) => {
111832
- if (!import_node_fs143.default.existsSync(dir)) return;
111833
- for (const child of import_node_fs143.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
111834
- const file = import_node_path146.default.join(dir, child.name);
112361
+ if (!import_node_fs146.default.existsSync(dir)) return;
112362
+ for (const child of import_node_fs146.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
112363
+ const file = import_node_path149.default.join(dir, child.name);
111835
112364
  if (child.isSymbolicLink()) reject(`Expo Kotlin source is a symlink: ${file}`);
111836
112365
  else if (child.isDirectory()) walk4(file);
111837
112366
  else if (child.name.endsWith(".java"))
@@ -111839,8 +112368,8 @@ async function collectExpoKotlinModules(appRoot) {
111839
112368
  else if (child.name.endsWith(".kt")) group.sources.push(file);
111840
112369
  }
111841
112370
  };
111842
- walk4(import_node_path146.default.join(sourceDir, "src", "main", "java"));
111843
- walk4(import_node_path146.default.join(sourceDir, "src", "main", "kotlin"));
112371
+ walk4(import_node_path149.default.join(sourceDir, "src", "main", "java"));
112372
+ walk4(import_node_path149.default.join(sourceDir, "src", "main", "kotlin"));
111844
112373
  result.push(group);
111845
112374
  }
111846
112375
  }
@@ -111853,7 +112382,7 @@ async function collectBridgePackages(appRoot) {
111853
112382
  );
111854
112383
  const app = androidAppSources(appRoot);
111855
112384
  if (!app || !app.kotlin.some(
111856
- (file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs143.default.readFileSync(file, "utf8"))
112385
+ (file) => /\b(?:Base|Turbo)?ReactPackage\b/.test(import_node_fs146.default.readFileSync(file, "utf8"))
111857
112386
  ))
111858
112387
  return dependencies;
111859
112388
  const { scanBridgeFiles: scanBridgeFiles2 } = await Promise.resolve().then(() => (init_kotlin_host(), kotlin_host_exports));
@@ -111944,12 +112473,12 @@ async function compileExpoKotlinModules(root, origin) {
111944
112473
  }
111945
112474
  }
111946
112475
  }
111947
- var import_node_fs143, import_node_path146;
112476
+ var import_node_fs146, import_node_path149;
111948
112477
  var init_expo_kotlin_host = __esm({
111949
112478
  "src/expo-kotlin-host.ts"() {
111950
112479
  "use strict";
111951
- import_node_fs143 = __toESM(require("node:fs"), 1);
111952
- import_node_path146 = __toESM(require("node:path"), 1);
112480
+ import_node_fs146 = __toESM(require("node:fs"), 1);
112481
+ import_node_path149 = __toESM(require("node:path"), 1);
111953
112482
  init_android_autolinking();
111954
112483
  init_android_bridge_dependencies();
111955
112484
  init_android_bridge_packages();
@@ -112371,16 +112900,16 @@ var init_replacementModule = __esm({
112371
112900
 
112372
112901
  // src/host/replacement-module-handler.ts
112373
112902
  function resolveReplacementModuleFile(fromFile, specifier) {
112374
- const base2 = import_node_path151.default.resolve(import_node_path151.default.dirname(fromFile), specifier);
112903
+ const base2 = import_node_path154.default.resolve(import_node_path154.default.dirname(fromFile), specifier);
112375
112904
  const candidates = [
112376
112905
  ...REPLACEMENT_MODULE_EXTENSIONS.some(
112377
- (ext) => ext === import_node_path151.default.extname(base2).toLowerCase()
112906
+ (ext) => ext === import_node_path154.default.extname(base2).toLowerCase()
112378
112907
  ) ? [base2] : [],
112379
112908
  ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base2 + ext),
112380
- ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path151.default.join(base2, `index${ext}`))
112909
+ ...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path154.default.join(base2, `index${ext}`))
112381
112910
  ];
112382
112911
  const found = candidates.find(
112383
- (candidate) => (0, import_node_fs147.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
112912
+ (candidate) => (0, import_node_fs150.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
112384
112913
  );
112385
112914
  if (!found) {
112386
112915
  throw new Error(
@@ -112389,13 +112918,13 @@ function resolveReplacementModuleFile(fromFile, specifier) {
112389
112918
  }
112390
112919
  return found;
112391
112920
  }
112392
- var import_node_fs147, import_promises12, import_node_path151;
112921
+ var import_node_fs150, import_promises12, import_node_path154;
112393
112922
  var init_replacement_module_handler = __esm({
112394
112923
  "src/host/replacement-module-handler.ts"() {
112395
112924
  "use strict";
112396
- import_node_fs147 = require("node:fs");
112925
+ import_node_fs150 = require("node:fs");
112397
112926
  import_promises12 = __toESM(require("node:fs/promises"), 1);
112398
- import_node_path151 = __toESM(require("node:path"), 1);
112927
+ import_node_path154 = __toESM(require("node:path"), 1);
112399
112928
  init_replacementModule();
112400
112929
  init_backend_origin();
112401
112930
  }
@@ -112425,14 +112954,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
112425
112954
  const neededPackages = /* @__PURE__ */ new Set();
112426
112955
  const factories = [];
112427
112956
  const visit3 = (filePath) => {
112428
- const real = import_node_fs148.default.realpathSync(filePath);
112957
+ const real = import_node_fs151.default.realpathSync(filePath);
112429
112958
  const previous = files2.get(real);
112430
112959
  if (previous !== void 0) return previous;
112431
112960
  const id = "peach-config-file:" + files2.size;
112432
112961
  files2.set(real, id);
112433
112962
  const compiled = compileReplacementModule({
112434
112963
  filePath: real,
112435
- source: import_node_fs148.default.readFileSync(real, "utf8"),
112964
+ source: import_node_fs151.default.readFileSync(real, "utf8"),
112436
112965
  runtimePackages,
112437
112966
  localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
112438
112967
  });
@@ -112456,7 +112985,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
112456
112985
  if (!entries2 || typeof entries2 !== "object") continue;
112457
112986
  for (const resolution2 of Object.values(entries2)) {
112458
112987
  if (resolution2 && typeof resolution2 === "object" && "file" in resolution2 && typeof resolution2.file === "string") {
112459
- resolution2.file = visit3(import_node_path152.default.resolve(resolution2.file));
112988
+ resolution2.file = visit3(import_node_path155.default.resolve(resolution2.file));
112460
112989
  }
112461
112990
  }
112462
112991
  }
@@ -112480,12 +113009,12 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
112480
113009
  const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
112481
113010
  return prefix + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
112482
113011
  }
112483
- var import_node_fs148, import_node_path152, import_sucrase5, import_terser, PREFIX_START, PREFIX_END;
113012
+ var import_node_fs151, import_node_path155, import_sucrase5, import_terser, PREFIX_START, PREFIX_END;
112484
113013
  var init_configured_bundle_producer = __esm({
112485
113014
  "src/configured-bundle-producer.ts"() {
112486
113015
  "use strict";
112487
- import_node_fs148 = __toESM(require("node:fs"), 1);
112488
- import_node_path152 = __toESM(require("node:path"), 1);
113016
+ import_node_fs151 = __toESM(require("node:fs"), 1);
113017
+ import_node_path155 = __toESM(require("node:path"), 1);
112489
113018
  init_bundle_global_footer();
112490
113019
  import_sucrase5 = require("peachsim/vendor/sucrase");
112491
113020
  import_terser = require("peachsim/vendor/terser");
@@ -112508,11 +113037,11 @@ __export(bundle_channel_exports, {
112508
113037
  snapshotOneProductionBundle: () => snapshotOneProductionBundle
112509
113038
  });
112510
113039
  module.exports = __toCommonJS(bundle_channel_exports);
112511
- var import_node_crypto89 = require("node:crypto");
112512
- var import_node_fs149 = require("node:fs");
112513
- var import_node_path153 = require("node:path");
113040
+ var import_node_crypto91 = require("node:crypto");
113041
+ var import_node_fs152 = require("node:fs");
113042
+ var import_node_path156 = require("node:path");
112514
113043
  var import_node_vm = require("node:vm");
112515
- var import_node_zlib10 = require("node:zlib");
113044
+ var import_node_zlib11 = require("node:zlib");
112516
113045
  init_backend_origin();
112517
113046
  init_dev_bundle_resolution();
112518
113047
  init_home_paths();
@@ -112677,16 +113206,16 @@ init_package_versions();
112677
113206
  init_process_group();
112678
113207
 
112679
113208
  // cli/app-catalog.ts
112680
- var import_node_fs146 = __toESM(require("node:fs"), 1);
112681
- var import_node_path150 = __toESM(require("node:path"), 1);
113209
+ var import_node_fs149 = __toESM(require("node:fs"), 1);
113210
+ var import_node_path153 = __toESM(require("node:path"), 1);
112682
113211
  init_bundleAssets();
112683
113212
  init_expo_native_workspace();
112684
113213
 
112685
113214
  // src/host/staged-host-files.ts
112686
113215
  var import_node_async_hooks4 = require("node:async_hooks");
112687
- var import_node_crypto88 = require("node:crypto");
112688
- var import_node_fs144 = __toESM(require("node:fs"), 1);
112689
- var import_node_path147 = __toESM(require("node:path"), 1);
113216
+ var import_node_crypto90 = require("node:crypto");
113217
+ var import_node_fs147 = __toESM(require("node:fs"), 1);
113218
+ var import_node_path150 = __toESM(require("node:path"), 1);
112690
113219
 
112691
113220
  // ../peach-kit/src/uttype-mime.ts
112692
113221
  var MIME_BY_EXTENSION = {
@@ -112761,17 +113290,17 @@ async function captureStagedHostFiles(prepare3) {
112761
113290
  const value = await stagedCapture.run(names, prepare3);
112762
113291
  return {
112763
113292
  value,
112764
- files: new Map([...names].map((name3) => [name3, import_node_path147.default.join(stagedDir(), name3)]))
113293
+ files: new Map([...names].map((name3) => [name3, import_node_path150.default.join(stagedDir(), name3)]))
112765
113294
  };
112766
113295
  }
112767
113296
  var STAGED_PREFIX = "/__peach/staged/";
112768
113297
  var STAGED_NAME = /^([a-f0-9]{64})(\.[a-z0-9]{1,10})?$/;
112769
113298
  var STAGED_RETENTION_MS = 30 * 24 * 60 * 60 * 1e3;
112770
113299
  function stagedDir() {
112771
- return import_node_path147.default.join(cacheDir(), "staged");
113300
+ return import_node_path150.default.join(cacheDir(), "staged");
112772
113301
  }
112773
113302
  function stageHostFile(filePath, origin) {
112774
- return stageHostBytes(import_node_fs144.default.readFileSync(filePath), origin, import_node_path147.default.extname(filePath));
113303
+ return stageHostBytes(import_node_fs147.default.readFileSync(filePath), origin, import_node_path150.default.extname(filePath));
112775
113304
  }
112776
113305
  function stageHostBytes(bytes, origin, extension = "") {
112777
113306
  const directory2 = prepareStagedDirectory();
@@ -112779,72 +113308,72 @@ function stageHostBytes(bytes, origin, extension = "") {
112779
113308
  }
112780
113309
  async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
112781
113310
  const directory2 = prepareStagedDirectory();
112782
- const inputDigest = (0, import_node_crypto88.createHash)("sha256").update(input).digest("hex");
112783
- const index = import_node_path147.default.join(
113311
+ const inputDigest = (0, import_node_crypto90.createHash)("sha256").update(input).digest("hex");
113312
+ const index = import_node_path150.default.join(
112784
113313
  directory2,
112785
- `derived-${(0, import_node_crypto88.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
113314
+ `derived-${(0, import_node_crypto90.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
112786
113315
  );
112787
- const recorded = import_node_fs144.default.existsSync(index) ? import_node_fs144.default.readFileSync(index, "utf8") : "";
112788
- if (STAGED_NAME.test(recorded) && import_node_fs144.default.existsSync(import_node_path147.default.join(directory2, recorded))) {
113316
+ const recorded = import_node_fs147.default.existsSync(index) ? import_node_fs147.default.readFileSync(index, "utf8") : "";
113317
+ if (STAGED_NAME.test(recorded) && import_node_fs147.default.existsSync(import_node_path150.default.join(directory2, recorded))) {
112789
113318
  const now = /* @__PURE__ */ new Date();
112790
- import_node_fs144.default.utimesSync(index, now, now);
112791
- import_node_fs144.default.utimesSync(import_node_path147.default.join(directory2, recorded), now, now);
113319
+ import_node_fs147.default.utimesSync(index, now, now);
113320
+ import_node_fs147.default.utimesSync(import_node_path150.default.join(directory2, recorded), now, now);
112792
113321
  stagedCapture.getStore()?.add(recorded);
112793
113322
  return new URL(STAGED_PREFIX + recorded, origin).toString();
112794
113323
  }
112795
113324
  const staged = writeStagedBytes(await derive(), origin, extension, directory2);
112796
- const temporary = import_node_path147.default.join(directory2, (0, import_node_crypto88.randomUUID)());
113325
+ const temporary = import_node_path150.default.join(directory2, (0, import_node_crypto90.randomUUID)());
112797
113326
  try {
112798
- import_node_fs144.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
113327
+ import_node_fs147.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
112799
113328
  flag: "wx"
112800
113329
  });
112801
- import_node_fs144.default.renameSync(temporary, index);
113330
+ import_node_fs147.default.renameSync(temporary, index);
112802
113331
  } finally {
112803
- import_node_fs144.default.rmSync(temporary, { force: true });
113332
+ import_node_fs147.default.rmSync(temporary, { force: true });
112804
113333
  }
112805
113334
  return staged;
112806
113335
  }
112807
113336
  function prepareStagedDirectory() {
112808
113337
  const directory2 = stagedDir();
112809
- import_node_fs144.default.mkdirSync(directory2, { recursive: true });
113338
+ import_node_fs147.default.mkdirSync(directory2, { recursive: true });
112810
113339
  const now = Date.now();
112811
- for (const entry of import_node_fs144.default.readdirSync(directory2, { withFileTypes: true })) {
113340
+ for (const entry of import_node_fs147.default.readdirSync(directory2, { withFileTypes: true })) {
112812
113341
  if (!entry.isFile()) continue;
112813
- const stale = import_node_path147.default.join(directory2, entry.name);
112814
- const stat = import_node_fs144.default.statSync(stale, { throwIfNoEntry: false });
113342
+ const stale = import_node_path150.default.join(directory2, entry.name);
113343
+ const stat = import_node_fs147.default.statSync(stale, { throwIfNoEntry: false });
112815
113344
  if (stat && now - stat.mtimeMs > STAGED_RETENTION_MS)
112816
- import_node_fs144.default.rmSync(stale, { force: true });
113345
+ import_node_fs147.default.rmSync(stale, { force: true });
112817
113346
  }
112818
113347
  return directory2;
112819
113348
  }
112820
113349
  function writeStagedBytes(bytes, origin, extension, directory2) {
112821
- const digest3 = (0, import_node_crypto88.createHash)("sha256").update(bytes).digest("hex");
113350
+ const digest3 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
112822
113351
  extension = extension.toLowerCase();
112823
113352
  const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
112824
113353
  stagedCapture.getStore()?.add(name3);
112825
- const destination = import_node_path147.default.join(directory2, name3);
113354
+ const destination = import_node_path150.default.join(directory2, name3);
112826
113355
  const now = Date.now();
112827
- if (import_node_fs144.default.existsSync(destination)) {
112828
- import_node_fs144.default.utimesSync(destination, new Date(now), new Date(now));
113356
+ if (import_node_fs147.default.existsSync(destination)) {
113357
+ import_node_fs147.default.utimesSync(destination, new Date(now), new Date(now));
112829
113358
  } else {
112830
- const temporary = import_node_path147.default.join(directory2, (0, import_node_crypto88.randomUUID)());
113359
+ const temporary = import_node_path150.default.join(directory2, (0, import_node_crypto90.randomUUID)());
112831
113360
  try {
112832
- import_node_fs144.default.writeFileSync(temporary, bytes, { flag: "wx" });
112833
- import_node_fs144.default.renameSync(temporary, destination);
113361
+ import_node_fs147.default.writeFileSync(temporary, bytes, { flag: "wx" });
113362
+ import_node_fs147.default.renameSync(temporary, destination);
112834
113363
  } finally {
112835
- import_node_fs144.default.rmSync(temporary, { force: true });
113364
+ import_node_fs147.default.rmSync(temporary, { force: true });
112836
113365
  }
112837
113366
  }
112838
113367
  return new URL(STAGED_PREFIX + name3, origin).toString();
112839
113368
  }
112840
113369
 
112841
113370
  // src/one-native-app-catalog.ts
112842
- var import_node_path149 = __toESM(require("node:path"), 1);
113371
+ var import_node_path152 = __toESM(require("node:path"), 1);
112843
113372
  init_is_record();
112844
113373
 
112845
113374
  // src/one-native-app-config.ts
112846
- var import_node_fs145 = __toESM(require("node:fs"), 1);
112847
- var import_node_path148 = __toESM(require("node:path"), 1);
113375
+ var import_node_fs148 = __toESM(require("node:fs"), 1);
113376
+ var import_node_path151 = __toESM(require("node:path"), 1);
112848
113377
  var import_acorn5 = require("peachsim/vendor/acorn");
112849
113378
  var import_sucrase4 = require("peachsim/vendor/sucrase");
112850
113379
  init_estree_walk();
@@ -112867,13 +113396,13 @@ var MODULE_EXTENSIONS = [
112867
113396
  ];
112868
113397
  function oneConfigPath(root) {
112869
113398
  for (const name3 of CONFIG_FILES) {
112870
- const file = import_node_path148.default.join(root, name3);
112871
- if (import_node_fs145.default.existsSync(file)) return file;
113399
+ const file = import_node_path151.default.join(root, name3);
113400
+ if (import_node_fs148.default.existsSync(file)) return file;
112872
113401
  }
112873
113402
  return null;
112874
113403
  }
112875
113404
  function readModule2(file) {
112876
- const { code } = (0, import_sucrase4.transform)(import_node_fs145.default.readFileSync(file, "utf8"), {
113405
+ const { code } = (0, import_sucrase4.transform)(import_node_fs148.default.readFileSync(file, "utf8"), {
112877
113406
  transforms: /\.[cm]?tsx?$/.test(file) ? ["typescript"] : [],
112878
113407
  disableESTransforms: true
112879
113408
  });
@@ -112897,9 +113426,9 @@ function resolveName(module2, name3, seen) {
112897
113426
  if (!source.startsWith(".")) continue;
112898
113427
  for (const specifier of statement.specifiers) {
112899
113428
  if (specifier.type !== "ImportSpecifier" || specifier.local.name !== name3) continue;
112900
- const base2 = import_node_path148.default.resolve(import_node_path148.default.dirname(module2.file), source);
113429
+ const base2 = import_node_path151.default.resolve(import_node_path151.default.dirname(module2.file), source);
112901
113430
  const target = MODULE_EXTENSIONS.map((ext) => base2 + ext).find(
112902
- (file) => import_node_fs145.default.existsSync(file) && import_node_fs145.default.statSync(file).isFile()
113431
+ (file) => import_node_fs148.default.existsSync(file) && import_node_fs148.default.statSync(file).isFile()
112903
113432
  );
112904
113433
  if (!target) return NOT_STATIC;
112905
113434
  const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : String(specifier.imported.value);
@@ -112983,7 +113512,7 @@ function readOneNativeAppCatalog(root) {
112983
113512
  const ios = readOneNativeApp(root)?.ios;
112984
113513
  if (!isRecord(ios)) return null;
112985
113514
  const accentColor = parseAccent(ios.accentColor);
112986
- const assetCatalog = typeof ios.assetCatalog === "string" ? import_node_path149.default.resolve(root, ios.assetCatalog) : null;
113515
+ const assetCatalog = typeof ios.assetCatalog === "string" ? import_node_path152.default.resolve(root, ios.assetCatalog) : null;
112987
113516
  return accentColor || assetCatalog ? { accentColor, assetCatalog } : null;
112988
113517
  }
112989
113518
 
@@ -112993,21 +113522,21 @@ var ACCENT_BUILD_SETTING = /ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = "?(
112993
113522
  var PLIST_ACCENT = /<key>NSAccentColorName<\/key>\s*<string>([^<]+)<\/string>/;
112994
113523
  function listDir2(dir) {
112995
113524
  try {
112996
- return import_node_fs146.default.readdirSync(dir, { withFileTypes: true });
113525
+ return import_node_fs149.default.readdirSync(dir, { withFileTypes: true });
112997
113526
  } catch {
112998
113527
  return [];
112999
113528
  }
113000
113529
  }
113001
113530
  function readText(file) {
113002
113531
  try {
113003
- return import_node_fs146.default.readFileSync(file, "utf8");
113532
+ return import_node_fs149.default.readFileSync(file, "utf8");
113004
113533
  } catch {
113005
113534
  return null;
113006
113535
  }
113007
113536
  }
113008
113537
  function catalogFiles(dir, found) {
113009
113538
  for (const entry of listDir2(dir)) {
113010
- const full = import_node_path150.default.join(dir, entry.name);
113539
+ const full = import_node_path153.default.join(dir, entry.name);
113011
113540
  if (entry.isDirectory()) catalogFiles(full, found);
113012
113541
  else if (entry.name === "Contents.json") found.push(full);
113013
113542
  }
@@ -113055,38 +113584,38 @@ async function stageCatalogSvg(file, scale, origin, bytes) {
113055
113584
  );
113056
113585
  }
113057
113586
  function stageCatalogImage(file, scale, origin) {
113058
- if (import_node_path150.default.extname(file).toLowerCase() === ".svg")
113059
- return stageCatalogSvg(file, scale, origin, import_node_fs146.default.readFileSync(file));
113587
+ if (import_node_path153.default.extname(file).toLowerCase() === ".svg")
113588
+ return stageCatalogSvg(file, scale, origin, import_node_fs149.default.readFileSync(file));
113060
113589
  return stageHostFile(file, origin);
113061
113590
  }
113062
113591
  async function discoverAppCatalog(appDir, assetOrigin) {
113063
- if (!import_node_fs146.default.existsSync(import_node_path150.default.join(appDir, "ios")) && findExpoAppConfig(appDir)) {
113064
- const packageJson = readText(import_node_path150.default.join(appDir, "package.json"));
113592
+ if (!import_node_fs149.default.existsSync(import_node_path153.default.join(appDir, "ios")) && findExpoAppConfig(appDir)) {
113593
+ const packageJson = readText(import_node_path153.default.join(appDir, "package.json"));
113065
113594
  if (packageJson) {
113066
113595
  const manifest = JSON.parse(packageJson);
113067
113596
  if (declaresNativeDependency(manifest, "expo") || declaresNativeDependency(manifest, "one"))
113068
113597
  appDir = (await prepareExpoNativeProject(appDir)).app;
113069
113598
  }
113070
113599
  }
113071
- const iosDir = import_node_path150.default.join(appDir, "ios");
113600
+ const iosDir = import_node_path153.default.join(appDir, "ios");
113072
113601
  const target = listDir2(iosDir).find(
113073
- (entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(import_node_path150.default.join(iosDir, entry.name)).some(
113602
+ (entry) => entry.isDirectory() && entry.name !== "Pods" && listDir2(import_node_path153.default.join(iosDir, entry.name)).some(
113074
113603
  (file) => /^AppDelegate\.(swift|mm|m)$/.test(file.name)
113075
113604
  )
113076
113605
  );
113077
113606
  if (!target) return null;
113078
- const targetDir = import_node_path150.default.join(iosDir, target.name);
113607
+ const targetDir = import_node_path153.default.join(iosDir, target.name);
113079
113608
  const files2 = [];
113080
113609
  for (const entry of listDir2(targetDir)) {
113081
113610
  if (entry.isDirectory() && entry.name.endsWith(".xcassets"))
113082
- catalogFiles(import_node_path150.default.join(targetDir, entry.name), files2);
113611
+ catalogFiles(import_node_path153.default.join(targetDir, entry.name), files2);
113083
113612
  }
113084
113613
  const relative4 = files2.map(
113085
- (file) => import_node_path150.default.relative(targetDir, file).split(import_node_path150.default.sep).join(import_node_path150.default.posix.sep)
113614
+ (file) => import_node_path153.default.relative(targetDir, file).split(import_node_path153.default.sep).join(import_node_path153.default.posix.sep)
113086
113615
  );
113087
- const readContents2 = (candidate) => readText(import_node_path150.default.join(targetDir, candidate));
113616
+ const readContents2 = (candidate) => readText(import_node_path153.default.join(targetDir, candidate));
113088
113617
  const pbxproj = listDir2(iosDir).find((entry) => entry.name.endsWith(".xcodeproj"));
113089
- const accentName = readText(import_node_path150.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path150.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
113618
+ const accentName = readText(import_node_path153.default.join(targetDir, "Info.plist"))?.match(PLIST_ACCENT)?.[1] ?? (pbxproj ? readText(import_node_path153.default.join(iosDir, pbxproj.name, "project.pbxproj"))?.match(
113090
113619
  ACCENT_BUILD_SETTING
113091
113620
  )?.[1] : void 0) ?? null;
113092
113621
  return readAssetCatalog(
@@ -113099,7 +113628,7 @@ async function discoverAppCatalog(appDir, assetOrigin) {
113099
113628
  );
113100
113629
  return null;
113101
113630
  }
113102
- return stageCatalogImage(import_node_path150.default.join(targetDir, file), scale, assetOrigin);
113631
+ return stageCatalogImage(import_node_path153.default.join(targetDir, file), scale, assetOrigin);
113103
113632
  },
113104
113633
  accentName
113105
113634
  );
@@ -113124,7 +113653,7 @@ async function discoverProjectOneNativeAppCatalog(projectRoot, assetOrigin) {
113124
113653
  }
113125
113654
 
113126
113655
  // src/bundle-channel.mjs
113127
- var digest2 = (bytes) => (0, import_node_crypto89.createHash)("sha256").update(bytes).digest("hex");
113656
+ var digest2 = (bytes) => (0, import_node_crypto91.createHash)("sha256").update(bytes).digest("hex");
113128
113657
  var segment2 = /^[a-zA-Z0-9._-]+$/;
113129
113658
  function packagedAssetDirectory(location) {
113130
113659
  const parsed2 = new URL(location, "https://packaged.invalid");
@@ -113230,11 +113759,11 @@ async function prepareChannel({
113230
113759
  files2.set(asset.path, asset.bytes);
113231
113760
  }
113232
113761
  }
113233
- const identity2 = (0, import_node_crypto89.createHash)("sha256").update(bundle).update(icon);
113234
- for (const [path140, bytes] of [...files2].sort(
113762
+ const identity2 = (0, import_node_crypto91.createHash)("sha256").update(bundle).update(icon);
113763
+ for (const [path143, bytes] of [...files2].sort(
113235
113764
  ([a], [b]) => a < b ? -1 : a > b ? 1 : 0
113236
113765
  )) {
113237
- identity2.update(JSON.stringify([path140, digest2(bytes)]));
113766
+ identity2.update(JSON.stringify([path143, digest2(bytes)]));
113238
113767
  }
113239
113768
  if (native) identity2.update(JSON.stringify(native.metadata));
113240
113769
  if (oneSDK) identity2.update(JSON.stringify(oneSDK.metadata));
@@ -113244,7 +113773,7 @@ async function prepareChannel({
113244
113773
  const releaseKey = `${prefix}/peach/releases/${identity2.digest("hex")}`;
113245
113774
  const assetBaseUrl = `${origin.origin}/${releaseKey}/`;
113246
113775
  const directories = new Set(
113247
- [...files2.keys()].map((path140) => path140.slice(0, path140.lastIndexOf("/")))
113776
+ [...files2.keys()].map((path143) => path143.slice(0, path143.lastIndexOf("/")))
113248
113777
  );
113249
113778
  let locations = 0;
113250
113779
  const { stripRolldownBundleInventoryFooter, attachRolldownBundleInventory } = (await loadCliRuntime()).rolldown_bundle_inventory;
@@ -113258,12 +113787,12 @@ async function prepareChannel({
113258
113787
  /("?httpServerLocation"?\s*:\s*)(?:"((?:[^"\\]|\\.)*)"|`([^`\\$]*)`)/g,
113259
113788
  (match, property, quoted2, template) => {
113260
113789
  const location = quoted2 === void 0 ? template : JSON.parse(`"${quoted2}"`);
113261
- const path140 = packagedAssetDirectory(location);
113262
- if (!directories.has(path140)) {
113790
+ const path143 = packagedAssetDirectory(location);
113791
+ if (!directories.has(path143)) {
113263
113792
  throw new Error(`bundle asset location has no packaged files: ${location}`);
113264
113793
  }
113265
113794
  locations++;
113266
- return `${property}${JSON.stringify(new URL(path140, assetBaseUrl).href)}`;
113795
+ return `${property}${JSON.stringify(new URL(path143, assetBaseUrl).href)}`;
113267
113796
  }
113268
113797
  );
113269
113798
  if (assets2.some((asset) => !asset.path.startsWith("assets/native-catalog/")) && !locations)
@@ -113271,7 +113800,7 @@ async function prepareChannel({
113271
113800
  const attached = insertNativeBundleFooters(
113272
113801
  source,
113273
113802
  { oneSDK, expoSwift, expoKotlin, nitro, turbo },
113274
- (path140) => new URL(path140, assetBaseUrl).href
113803
+ (path143) => new URL(path143, assetBaseUrl).href
113275
113804
  );
113276
113805
  source = attached.source;
113277
113806
  if (appCatalog) {
@@ -113309,10 +113838,10 @@ async function prepareChannel({
113309
113838
  contentType: "application/javascript"
113310
113839
  },
113311
113840
  { key: `${releaseKey}/icon.png`, bytes: icon, contentType: "image/png" },
113312
- ...[...files2].map(([path140, bytes]) => ({
113313
- key: `${releaseKey}/${path140}`,
113841
+ ...[...files2].map(([path143, bytes]) => ({
113842
+ key: `${releaseKey}/${path143}`,
113314
113843
  bytes,
113315
- contentType: nativeAssets.get(path140)?.contentType ?? {
113844
+ contentType: nativeAssets.get(path143)?.contentType ?? {
113316
113845
  png: "image/png",
113317
113846
  jpg: "image/jpeg",
113318
113847
  jpeg: "image/jpeg",
@@ -113321,23 +113850,23 @@ async function prepareChannel({
113321
113850
  ttf: "font/ttf",
113322
113851
  otf: "font/otf",
113323
113852
  wav: "audio/wav"
113324
- }[path140.split(".").pop()] ?? "application/octet-stream"
113853
+ }[path143.split(".").pop()] ?? "application/octet-stream"
113325
113854
  }))
113326
113855
  ];
113327
113856
  return { platform: platform2, key: `${prefix}/${channelKey(platform2)}`, metadata, objects };
113328
113857
  }
113329
113858
  function brotliCompressCached(bytes) {
113330
- const file = (0, import_node_path153.join)(cacheDir(), "bundle-channel-brotli", `${digest2(bytes)}-q11-w24.br`);
113331
- if ((0, import_node_fs149.existsSync)(file)) return (0, import_node_fs149.readFileSync)(file);
113332
- const compressed = (0, import_node_zlib10.brotliCompressSync)(bytes, {
113859
+ const file = (0, import_node_path156.join)(cacheDir(), "bundle-channel-brotli", `${digest2(bytes)}-q11-w24.br`);
113860
+ if ((0, import_node_fs152.existsSync)(file)) return (0, import_node_fs152.readFileSync)(file);
113861
+ const compressed = (0, import_node_zlib11.brotliCompressSync)(bytes, {
113333
113862
  params: {
113334
- [import_node_zlib10.constants.BROTLI_PARAM_QUALITY]: 11,
113335
- [import_node_zlib10.constants.BROTLI_PARAM_LGWIN]: 24
113863
+ [import_node_zlib11.constants.BROTLI_PARAM_QUALITY]: 11,
113864
+ [import_node_zlib11.constants.BROTLI_PARAM_LGWIN]: 24
113336
113865
  }
113337
113866
  });
113338
- (0, import_node_fs149.mkdirSync)((0, import_node_path153.dirname)(file), { recursive: true });
113339
- (0, import_node_fs149.writeFileSync)(`${file}.${process.pid}`, compressed);
113340
- (0, import_node_fs149.renameSync)(`${file}.${process.pid}`, file);
113867
+ (0, import_node_fs152.mkdirSync)((0, import_node_path156.dirname)(file), { recursive: true });
113868
+ (0, import_node_fs152.writeFileSync)(`${file}.${process.pid}`, compressed);
113869
+ (0, import_node_fs152.renameSync)(`${file}.${process.pid}`, file);
113341
113870
  return compressed;
113342
113871
  }
113343
113872
  async function publishBundleChannel(release, { put, fetchObject = fetch }) {
@@ -113388,15 +113917,15 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
113388
113917
  const directory2 = packagedAssetDirectory(asset.httpServerLocation);
113389
113918
  if (asset.files) {
113390
113919
  for (const file of asset.files) {
113391
- const path140 = `${directory2}/${(0, import_node_path153.basename)(file)}`;
113392
- if (!assets2.has(path140)) assets2.set(path140, (0, import_node_fs149.readFileSync)(file));
113920
+ const path143 = `${directory2}/${(0, import_node_path156.basename)(file)}`;
113921
+ if (!assets2.has(path143)) assets2.set(path143, (0, import_node_fs152.readFileSync)(file));
113393
113922
  }
113394
113923
  continue;
113395
113924
  }
113396
113925
  for (const scale of asset.scales) {
113397
113926
  const file = `${asset.name}${scale === 1 ? "" : `@${scale}x`}.${asset.type}`;
113398
- const path140 = `${directory2}/${file}`;
113399
- if (!assets2.has(path140)) assets2.set(path140, await readAssetFile(asset, file));
113927
+ const path143 = `${directory2}/${file}`;
113928
+ if (!assets2.has(path143)) assets2.set(path143, await readAssetFile(asset, file));
113400
113929
  }
113401
113930
  }
113402
113931
  let appCatalog = null;
@@ -113410,11 +113939,11 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
113410
113939
  images: Object.fromEntries(Object.entries(captured.value.images).map(([name3, variants]) => [
113411
113940
  name3,
113412
113941
  variants.map((image) => {
113413
- const file = (0, import_node_path153.basename)(new URL(image.uri).pathname);
113942
+ const file = (0, import_node_path156.basename)(new URL(image.uri).pathname);
113414
113943
  const staged = captured.files.get(file);
113415
113944
  if (!staged) throw new Error("app catalog image was not staged");
113416
113945
  const resource = `assets/native-catalog/${file}`;
113417
- assets2.set(resource, (0, import_node_fs149.readFileSync)(staged));
113946
+ assets2.set(resource, (0, import_node_fs152.readFileSync)(staged));
113418
113947
  return { ...image, uri: resource };
113419
113948
  })
113420
113949
  ]))
@@ -113435,7 +113964,7 @@ async function packagePlatformBundle(projectRoot, platform2, bundle, { config, v
113435
113964
  versions
113436
113965
  )
113437
113966
  ),
113438
- assets: [...assets2].map(([path140, bytes]) => ({ path: path140, bytes })),
113967
+ assets: [...assets2].map(([path143, bytes]) => ({ path: path143, bytes })),
113439
113968
  ...await buildNativeBundles(projectRoot, platform2, configuration)
113440
113969
  };
113441
113970
  }
@@ -113515,12 +114044,12 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
113515
114044
  const inputs2 = await readPackagingInputs(projectRoot);
113516
114045
  const snapshots = [];
113517
114046
  for (const platform2 of platforms2) {
113518
- const out = await mkdtemp((0, import_node_path153.join)(tmpdir3(), "peach-production-bundle-"));
114047
+ const out = await mkdtemp((0, import_node_path156.join)(tmpdir3(), "peach-production-bundle-"));
113519
114048
  try {
113520
114049
  await promisify21(execFile22)(
113521
114050
  runtimeExecutable,
113522
114051
  [
113523
- (0, import_node_path153.join)(projectRoot, "node_modules/.bin/react-native"),
114052
+ (0, import_node_path156.join)(projectRoot, "node_modules/.bin/react-native"),
113524
114053
  "bundle",
113525
114054
  "--platform",
113526
114055
  platform2,
@@ -113531,19 +114060,19 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
113531
114060
  "--entry-file",
113532
114061
  entryFile,
113533
114062
  "--bundle-output",
113534
- (0, import_node_path153.join)(out, "bundle.js"),
114063
+ (0, import_node_path156.join)(out, "bundle.js"),
113535
114064
  "--assets-dest",
113536
- (0, import_node_path153.join)(out, "assets"),
114065
+ (0, import_node_path156.join)(out, "assets"),
113537
114066
  "--sourcemap-output",
113538
- (0, import_node_path153.join)(out, "bundle.js.map")
114067
+ (0, import_node_path156.join)(out, "bundle.js.map")
113539
114068
  ],
113540
114069
  { cwd: projectRoot, env: { ...process.env, ...env, NODE_ENV: "production" } }
113541
114070
  );
113542
114071
  snapshots.push(
113543
- await packagePlatformBundle(projectRoot, platform2, await readFile4((0, import_node_path153.join)(out, "bundle.js")), {
114072
+ await packagePlatformBundle(projectRoot, platform2, await readFile4((0, import_node_path156.join)(out, "bundle.js")), {
113544
114073
  ...inputs2,
113545
114074
  configuration: "Release",
113546
- readAssetFile: (asset, file) => readFile4((0, import_node_path153.join)(out, asset.httpServerLocation, file))
114075
+ readAssetFile: (asset, file) => readFile4((0, import_node_path156.join)(out, asset.httpServerLocation, file))
113547
114076
  })
113548
114077
  );
113549
114078
  } finally {
@@ -113553,15 +114082,15 @@ async function snapshotOneProductionBundle(projectRoot, entryFile, env = {}, { r
113553
114082
  return { platforms: snapshots };
113554
114083
  }
113555
114084
  async function snapshotOneDevBundle(projectRoot, env = {}, { runtimeExecutable = process.execPath, platforms: platforms2 = ["ios", "android"] } = {}) {
113556
- const { spawn: spawn13 } = await import("node:child_process");
114085
+ const { spawn: spawn14 } = await import("node:child_process");
113557
114086
  const { createServer: createServer2 } = await import("node:net");
113558
114087
  const { createRequire: createRequire24 } = await import("node:module");
113559
- const onePackage = createRequire24((0, import_node_path153.join)(projectRoot, "package.json")).resolve(
114088
+ const onePackage = createRequire24((0, import_node_path156.join)(projectRoot, "package.json")).resolve(
113560
114089
  "one/package.json"
113561
114090
  );
113562
- const oneBin = (0, import_node_path153.join)(
113563
- (0, import_node_path153.dirname)(onePackage),
113564
- JSON.parse((0, import_node_fs149.readFileSync)(onePackage, "utf8")).bin.one
114091
+ const oneBin = (0, import_node_path156.join)(
114092
+ (0, import_node_path156.dirname)(onePackage),
114093
+ JSON.parse((0, import_node_fs152.readFileSync)(onePackage, "utf8")).bin.one
113565
114094
  );
113566
114095
  const port = await new Promise((resolve4, reject) => {
113567
114096
  const server = createServer2().listen(0, "127.0.0.1", () => {
@@ -113569,7 +114098,7 @@ async function snapshotOneDevBundle(projectRoot, env = {}, { runtimeExecutable =
113569
114098
  server.close(() => resolve4(port2));
113570
114099
  }).on("error", reject);
113571
114100
  });
113572
- const child = spawn13(runtimeExecutable, [oneBin, "dev", "--port", String(port)], {
114101
+ const child = spawn14(runtimeExecutable, [oneBin, "dev", "--port", String(port)], {
113573
114102
  cwd: projectRoot,
113574
114103
  env: { ...process.env, ...env, CI: "1", PEACH_NO_OPEN: "1" },
113575
114104
  stdio: ["ignore", "inherit", "inherit"],