peachsim 0.1.939 → 0.1.1399

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 (396) hide show
  1. package/README.md +28 -22
  2. package/cli/app-catalog.ts +29 -14
  3. package/cli/app-fonts.ts +5 -3
  4. package/cli/bridge-flow-runner.ts +40 -29
  5. package/cli/cloud-client.ts +57 -21
  6. package/cli/cloud-test-tunnel.ts +12 -18
  7. package/cli/commands/agent.ts +1 -1
  8. package/cli/commands/app-fonts.ts +3 -3
  9. package/cli/commands/assert.ts +8 -8
  10. package/cli/commands/auth.ts +8 -3
  11. package/cli/commands/box/bundle-plane.ts +13 -1
  12. package/cli/commands/box.ts +16 -5
  13. package/cli/commands/compat.ts +1 -1
  14. package/cli/commands/config.ts +2 -2
  15. package/cli/commands/control.ts +125 -71
  16. package/cli/commands/cpu-profile.ts +45 -1
  17. package/cli/commands/daemon.ts +131 -33
  18. package/cli/commands/debug.ts +24 -17
  19. package/cli/commands/desktop.ts +7 -1
  20. package/cli/commands/detect.ts +101 -0
  21. package/cli/commands/detox.ts +6 -6
  22. package/cli/commands/device.ts +12 -12
  23. package/cli/commands/electron.ts +32 -14
  24. package/cli/commands/flow.ts +49 -41
  25. package/cli/commands/guest-host.ts +39 -1
  26. package/cli/commands/inspect/core.ts +14 -8
  27. package/cli/commands/inspect/list.ts +1 -1
  28. package/cli/commands/inspect/settle.ts +5 -3
  29. package/cli/commands/inspect/settling.ts +229 -44
  30. package/cli/commands/inspect/wait-idle.ts +3 -2
  31. package/cli/commands/inspect.ts +105 -93
  32. package/cli/commands/install-cli.ts +36 -15
  33. package/cli/commands/install-desktop.ts +68 -195
  34. package/cli/commands/kotlin.ts +6 -5
  35. package/cli/commands/login.ts +5 -5
  36. package/cli/commands/maestro-compare.ts +554 -0
  37. package/cli/commands/maestro-generate.ts +6 -3
  38. package/cli/commands/maestro.ts +22 -0
  39. package/cli/commands/mode.ts +2 -2
  40. package/cli/commands/no-bridge-hint.ts +6 -2
  41. package/cli/commands/platform.ts +35 -6
  42. package/cli/commands/preview.ts +6 -0
  43. package/cli/commands/project-report.ts +10 -12
  44. package/cli/commands/record.ts +37 -37
  45. package/cli/commands/runtime.ts +9 -9
  46. package/cli/commands/screenshot-layers.ts +4 -4
  47. package/cli/commands/screenshot-mode.ts +2 -2
  48. package/cli/commands/screenshot.ts +8 -8
  49. package/cli/commands/screenshots-capture.ts +2 -2
  50. package/cli/commands/serve.ts +9 -12
  51. package/cli/commands/setup.ts +29 -14
  52. package/cli/commands/shell-boolean-mode.ts +2 -2
  53. package/cli/commands/show-touches-mode.ts +2 -2
  54. package/cli/commands/skills.ts +11 -11
  55. package/cli/commands/swift.ts +29 -11
  56. package/cli/commands/telemetry.ts +2 -2
  57. package/cli/commands/test.ts +5 -0
  58. package/cli/commands/three-mode.ts +3 -3
  59. package/cli/commands/timeline.ts +4 -4
  60. package/cli/commands/upgrade.ts +2 -2
  61. package/cli/commands/upload.ts +15 -15
  62. package/cli/commands/what-happened.ts +2 -2
  63. package/cli/current-sim.ts +6 -3
  64. package/cli/desktop-companion.ts +55 -149
  65. package/cli/dev-build-freshness.ts +2 -2
  66. package/cli/drivers/desktop.ts +17 -9
  67. package/cli/drivers/electron.ts +1 -2
  68. package/cli/drivers/playwright-sim-host.ts +11 -2
  69. package/cli/drivers/playwright.ts +35 -2
  70. package/cli/drivers/types.ts +8 -0
  71. package/cli/maestro-compare.ts +670 -0
  72. package/cli/outbound-endpoints.ts +46 -8
  73. package/cli/recording-access.ts +6 -6
  74. package/cli/run-registry.ts +1 -1
  75. package/cli/runtime-compat.ts +5 -1
  76. package/cli/send-to-box.ts +3 -3
  77. package/cli/shell-init.ts +2 -1
  78. package/cli/ws-bridge.ts +9 -5
  79. package/detox/element-types.ts +1 -0
  80. package/detox/gestures.ts +3 -3
  81. package/detox/index.ts +67 -38
  82. package/detox/navigation-lifecycle.ts +9 -6
  83. package/detox/proof-frame.cjs +6 -4
  84. package/dist-lib/agent-daemon-client.cjs +1 -1
  85. package/dist-lib/agent-events.cjs +1 -1
  86. package/dist-lib/attached-projects.cjs +1 -1
  87. package/dist-lib/auth/shared-session.cjs +1 -1
  88. package/dist-lib/backend-origin.cjs +1 -1
  89. package/dist-lib/beta.cjs +1 -1
  90. package/dist-lib/beta.mjs +1 -1
  91. package/dist-lib/bridge-constants.cjs +1 -1
  92. package/dist-lib/bridge-contract-input.cjs +42 -17
  93. package/dist-lib/bridge-contract-input.mjs +41 -16
  94. package/dist-lib/bridge-contract.cjs +1 -4
  95. package/dist-lib/bridge-contract.mjs +1 -3
  96. package/dist-lib/bundle-channel.cjs +2918 -550
  97. package/dist-lib/capture-contract.cjs +65 -24
  98. package/dist-lib/capture-contract.mjs +63 -24
  99. package/dist-lib/cloud-contract.cjs +2 -2
  100. package/dist-lib/cloud-contract.mjs +2 -2
  101. package/dist-lib/cloud-test-args.cjs +1 -1
  102. package/dist-lib/cloud-test-args.mjs +1 -1
  103. package/dist-lib/cloud.cjs +3 -3
  104. package/dist-lib/cloud.mjs +3 -3
  105. package/dist-lib/config.cjs +15 -5
  106. package/dist-lib/config.mjs +154 -0
  107. package/dist-lib/detox/index.cjs +495 -139
  108. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  109. package/dist-lib/expo-swift-bundle.cjs +1168 -238
  110. package/dist-lib/expo-swift-metadata.cjs +34 -23
  111. package/dist-lib/expo-swift-metadata.mjs +32 -23
  112. package/dist-lib/home-paths.cjs +2 -2
  113. package/dist-lib/host/bridge-host.cjs +2938 -654
  114. package/dist-lib/host/fetch-proxy-handler.cjs +14 -1
  115. package/dist-lib/host/fetch-proxy-overrides.cjs +7 -1
  116. package/dist-lib/host/fetch-proxy-overrides.mjs +5 -1
  117. package/dist-lib/host/replacement-module-handler.cjs +2 -2
  118. package/dist-lib/host/websocket-proxy.cjs +1 -1
  119. package/dist-lib/index.cjs +999 -353
  120. package/dist-lib/jump-to-source-babel.cjs +1 -1
  121. package/dist-lib/jump-to-source-native.cjs +1 -1
  122. package/dist-lib/kotlin-host.cjs +332 -19
  123. package/dist-lib/menu.cjs +1 -1
  124. package/dist-lib/menu.mjs +1 -1
  125. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  126. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  127. package/dist-lib/metro-production-bundle.cjs +7 -7
  128. package/dist-lib/metro-production-bundle.mjs +5 -5
  129. package/dist-lib/metro.cjs +688 -250
  130. package/dist-lib/native-app-identity-project.cjs +2647 -0
  131. package/dist-lib/native-app-identity-project.mjs +1257 -0
  132. package/dist-lib/native-app-identity.cjs +325 -25
  133. package/dist-lib/native-app-identity.mjs +323 -25
  134. package/dist-lib/native-firebase-metadata.cjs +1 -1
  135. package/dist-lib/native-firebase-metadata.mjs +1 -1
  136. package/dist-lib/plist.cjs +1 -1
  137. package/dist-lib/plist.mjs +1 -1
  138. package/dist-lib/profiles.cjs +1 -1
  139. package/dist-lib/public-brand.cjs +1 -1
  140. package/dist-lib/react-native-host-modules.cjs +5 -1
  141. package/dist-lib/react-native-host-modules.mjs +5 -1
  142. package/dist-lib/scripts/dev-server-scanner.cjs +57 -32
  143. package/dist-lib/sdk.cjs +231 -51
  144. package/dist-lib/sdk.mjs +231 -51
  145. package/dist-lib/skills.cjs +4107 -1374
  146. package/dist-lib/swift-compile.cjs +290 -30
  147. package/dist-lib/swift-compile.mjs +290 -30
  148. package/dist-lib/swift-package.cjs +143 -12
  149. package/dist-lib/swift-package.mjs +137 -11
  150. package/dist-lib/swift-submit.cjs +47 -5
  151. package/dist-lib/swift-submit.mjs +42 -5
  152. package/dist-lib/swift-toolchain.cjs +7 -2
  153. package/dist-lib/swift.cjs +1 -1
  154. package/dist-lib/vite-swift.cjs +1392 -458
  155. package/dist-lib/vite.cjs +13 -17
  156. package/dist-lib/worklet-executable.cjs +248 -33
  157. package/dist-lib/worklet-executable.mjs +248 -33
  158. package/install.sh +10 -1
  159. package/kotlin/{AppSources → AndroidViewSources}/android/content/res/Resources.kt +9 -9
  160. package/kotlin/AndroidViewSources/android/graphics/Canvas.kt +20 -0
  161. package/kotlin/AndroidViewSources/android/view/View.kt +211 -0
  162. package/kotlin/AndroidViewSources/android/widget/FrameLayout.kt +61 -0
  163. package/kotlin/AndroidViewSources/android/widget/LinearLayout.kt +49 -0
  164. package/kotlin/AppSources/android/view/Window.kt +36 -0
  165. package/kotlin/AppSources/android/view/WindowInsets.kt +9 -0
  166. package/kotlin/AppSources/android/view/WindowInsetsController.kt +5 -0
  167. package/kotlin/AppSources/android/window/OnBackInvokedDispatcher.kt +48 -0
  168. package/kotlin/AppSources/androidx/activity/OnBackPressedDispatcher.kt +20 -5
  169. package/kotlin/AppSources/androidx/compose/foundation/layout/WindowInsets.kt +15 -0
  170. package/kotlin/AppSources/androidx/compose/ui/platform/ComposeView.kt +2 -1
  171. package/kotlin/AppSources/dev/peach/app/PeachApp.kt +42 -50
  172. package/kotlin/ComposeSources/PeachComposeHost.kt +200 -84
  173. package/kotlin/ExpoComposeSources/PeachAndroidView.kt +87 -0
  174. package/kotlin/ExpoComposeSources/PeachExpoViewMount.kt +24 -0
  175. package/kotlin/ExpoComposeSources/dev/peach/expo/PeachExpoCompose.kt +28 -0
  176. package/kotlin/ExpoComposeSources/expo/modules/kotlin/views/ExpoComposeView.kt +70 -0
  177. package/kotlin/ExpoSources/dev/peach/expo/PeachExpoRuntime.kt +513 -0
  178. package/kotlin/ExpoSources/dev/peach/expo/PeachExpoTypes.kt +173 -0
  179. package/kotlin/ExpoSources/expo/modules/kotlin/AppContext.kt +20 -0
  180. package/kotlin/ExpoSources/expo/modules/kotlin/Promise.kt +19 -0
  181. package/kotlin/ExpoSources/expo/modules/kotlin/classcomponent/ClassComponentBuilder.kt +198 -0
  182. package/kotlin/ExpoSources/expo/modules/kotlin/exception/CodedException.kt +126 -0
  183. package/kotlin/ExpoSources/expo/modules/kotlin/functions/Functions.kt +132 -0
  184. package/kotlin/ExpoSources/expo/modules/kotlin/jni/JavaScriptTypedArray.kt +81 -0
  185. package/kotlin/ExpoSources/expo/modules/kotlin/modules/Module.kt +98 -0
  186. package/kotlin/ExpoSources/expo/modules/kotlin/objects/ObjectDefinitionBuilder.kt +236 -0
  187. package/kotlin/ExpoSources/expo/modules/kotlin/records/Record.kt +12 -0
  188. package/kotlin/ExpoSources/expo/modules/kotlin/runtime/Runtime.kt +9 -0
  189. package/kotlin/ExpoSources/expo/modules/kotlin/sharedobjects/SharedObject.kt +50 -0
  190. package/kotlin/ExpoSources/expo/modules/kotlin/sharedobjects/SharedObjectRegistry.kt +57 -0
  191. package/kotlin/ExpoSources/expo/modules/kotlin/sharedobjects/SharedRef.kt +19 -0
  192. package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/ConcreteTypedArrays.kt +158 -0
  193. package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/GenericTypedArray.kt +8 -0
  194. package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/TypedArray.kt +29 -0
  195. package/kotlin/ExpoSources/expo/modules/kotlin/typedarray/TypedArrayIterator.kt +9 -0
  196. package/kotlin/ExpoSources/expo/modules/kotlin/types/AnyType.kt +155 -0
  197. package/kotlin/ExpoSources/expo/modules/kotlin/types/Either.kt +91 -0
  198. package/kotlin/ExpoSources/expo/modules/kotlin/types/Enumerable.kt +6 -0
  199. package/kotlin/ExpoSources/expo/modules/kotlin/viewevent/ViewEvent.kt +54 -0
  200. package/kotlin/ExpoSources/expo/modules/kotlin/views/ExpoView.kt +23 -0
  201. package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewDefinitionBuilder.kt +71 -0
  202. package/kotlin/ExpoSources/expo/modules/kotlin/views/ViewProps.kt +35 -0
  203. package/kotlin/README.md +13 -3
  204. package/kotlin/Sources/android/os/Build.kt +17 -0
  205. package/kotlin/Sources/android/os/Handler.kt +35 -0
  206. package/kotlin/Sources/android/os/Looper.kt +17 -0
  207. package/kotlin/Sources/android/os/MessageQueue.kt +56 -0
  208. package/kotlin/Sources/android/os/SystemClock.kt +14 -0
  209. package/kotlin/Sources/android/util/Log.kt +64 -0
  210. package/kotlin/Sources/java/security/MessageDigest.kt +114 -0
  211. package/kotlin/Sources/kotlin/text/StringFormat.kt +9 -0
  212. package/kotlin/Sources/org/json/JSON.kt +44 -0
  213. package/kotlin/fixtures/counter/Counter.d.kt.ts +1 -0
  214. package/kotlin/fixtures/counter/Counter.kt +10 -3
  215. package/kotlin/fixtures/counter/CounterApp.native.tsx +1 -1
  216. package/kotlin/fixtures/counter/vite.config.ts +2 -2
  217. package/kotlin/fixtures/headless-counter/Headless.kt +7 -6
  218. package/kotlin/fixtures/import-animation/Animation.d.kt.ts +7 -0
  219. package/kotlin/fixtures/import-animation/Animation.kt +80 -0
  220. package/kotlin/fixtures/import-animation/ImportAnimation.native.tsx +13 -0
  221. package/kotlin/fixtures/import-animation/README.md +24 -0
  222. package/kotlin/fixtures/import-animation/app/_layout.tsx +4 -0
  223. package/kotlin/fixtures/import-animation/app/index+spa.tsx +1 -0
  224. package/kotlin/fixtures/import-animation/app/routes.d.ts +18 -0
  225. package/kotlin/fixtures/import-animation/package.json +23 -0
  226. package/kotlin/fixtures/import-animation/tsconfig.json +20 -0
  227. package/kotlin/fixtures/import-animation/vite.config.ts +20 -0
  228. package/kotlin/fixtures/import-editor/Editor.d.kt.ts +7 -0
  229. package/kotlin/fixtures/import-editor/Editor.kt +59 -0
  230. package/kotlin/fixtures/import-editor/ImportEditor.native.tsx +23 -0
  231. package/kotlin/fixtures/import-editor/README.md +27 -0
  232. package/kotlin/fixtures/import-editor/app/_layout.tsx +4 -0
  233. package/kotlin/fixtures/import-editor/app/index+spa.tsx +1 -0
  234. package/kotlin/fixtures/import-editor/package.json +23 -0
  235. package/kotlin/fixtures/import-editor/tsconfig.json +20 -0
  236. package/kotlin/fixtures/import-editor/vite.config.ts +20 -0
  237. package/kotlin/fixtures/import-effects/Effects.d.kt.ts +7 -0
  238. package/kotlin/fixtures/import-effects/Effects.kt +87 -0
  239. package/kotlin/fixtures/import-effects/ImportEffects.native.tsx +13 -0
  240. package/kotlin/fixtures/import-effects/README.md +19 -0
  241. package/kotlin/fixtures/import-effects/app/_layout.tsx +4 -0
  242. package/kotlin/fixtures/import-effects/app/index+spa.tsx +1 -0
  243. package/kotlin/fixtures/import-effects/package.json +23 -0
  244. package/kotlin/fixtures/import-effects/tsconfig.json +20 -0
  245. package/kotlin/fixtures/import-effects/vite.config.ts +20 -0
  246. package/kotlin/fixtures/import-layout/ImportLayout.native.tsx +13 -0
  247. package/kotlin/fixtures/import-layout/Layout.d.kt.ts +7 -0
  248. package/kotlin/fixtures/import-layout/Layout.kt +72 -0
  249. package/kotlin/fixtures/import-layout/README.md +24 -0
  250. package/kotlin/fixtures/import-layout/app/_layout.tsx +4 -0
  251. package/kotlin/fixtures/import-layout/app/index+spa.tsx +1 -0
  252. package/kotlin/fixtures/import-layout/package.json +23 -0
  253. package/kotlin/fixtures/import-layout/tsconfig.json +20 -0
  254. package/kotlin/fixtures/import-layout/vite.config.ts +20 -0
  255. package/kotlin/fixtures/import-navigation/ImportNavigation.native.tsx +18 -0
  256. package/kotlin/fixtures/import-navigation/Navigation.d.kt.ts +7 -0
  257. package/kotlin/fixtures/import-navigation/Navigation.kt +104 -0
  258. package/kotlin/fixtures/import-navigation/README.md +31 -0
  259. package/kotlin/fixtures/import-navigation/app/_layout.tsx +4 -0
  260. package/kotlin/fixtures/import-navigation/app/index+spa.tsx +1 -0
  261. package/kotlin/fixtures/import-navigation/package.json +23 -0
  262. package/kotlin/fixtures/import-navigation/tsconfig.json +20 -0
  263. package/kotlin/fixtures/import-navigation/vite.config.ts +20 -0
  264. package/kotlin/fixtures/import-overlays/ImportOverlays.native.tsx +29 -0
  265. package/kotlin/fixtures/import-overlays/Overlays.d.kt.ts +7 -0
  266. package/kotlin/fixtures/import-overlays/Overlays.kt +93 -0
  267. package/kotlin/fixtures/import-overlays/README.md +34 -0
  268. package/kotlin/fixtures/import-overlays/app/_layout.tsx +4 -0
  269. package/kotlin/fixtures/import-overlays/app/index+spa.tsx +1 -0
  270. package/kotlin/fixtures/import-overlays/package.json +23 -0
  271. package/kotlin/fixtures/import-overlays/tsconfig.json +20 -0
  272. package/kotlin/fixtures/import-overlays/vite.config.ts +20 -0
  273. package/kotlin/fixtures/import-scroll/ImportScroll.native.tsx +13 -0
  274. package/kotlin/fixtures/import-scroll/README.md +23 -0
  275. package/kotlin/fixtures/import-scroll/Scroll.d.kt.ts +7 -0
  276. package/kotlin/fixtures/import-scroll/Scroll.kt +91 -0
  277. package/kotlin/fixtures/import-scroll/app/_layout.tsx +4 -0
  278. package/kotlin/fixtures/import-scroll/app/index+spa.tsx +1 -0
  279. package/kotlin/fixtures/import-scroll/package.json +23 -0
  280. package/kotlin/fixtures/import-scroll/tsconfig.json +20 -0
  281. package/kotlin/fixtures/import-scroll/vite.config.ts +20 -0
  282. package/kotlin/fixtures/import-selection/ImportSelection.native.tsx +44 -0
  283. package/kotlin/fixtures/import-selection/README.md +32 -0
  284. package/kotlin/fixtures/import-selection/Selection.d.kt.ts +8 -0
  285. package/kotlin/fixtures/import-selection/Selection.kt +78 -0
  286. package/kotlin/fixtures/import-selection/app/_layout.tsx +4 -0
  287. package/kotlin/fixtures/import-selection/app/index+spa.tsx +1 -0
  288. package/kotlin/fixtures/import-selection/package.json +23 -0
  289. package/kotlin/fixtures/import-selection/tsconfig.json +20 -0
  290. package/kotlin/fixtures/import-selection/vite.config.ts +20 -0
  291. package/kotlin/fixtures/import-surfaces/ImportSurfaces.native.tsx +13 -0
  292. package/kotlin/fixtures/import-surfaces/README.md +22 -0
  293. package/kotlin/fixtures/import-surfaces/Surfaces.d.kt.ts +7 -0
  294. package/kotlin/fixtures/import-surfaces/Surfaces.kt +64 -0
  295. package/kotlin/fixtures/import-surfaces/app/_layout.tsx +4 -0
  296. package/kotlin/fixtures/import-surfaces/app/index+spa.tsx +1 -0
  297. package/kotlin/fixtures/import-surfaces/package.json +23 -0
  298. package/kotlin/fixtures/import-surfaces/tsconfig.json +20 -0
  299. package/kotlin/fixtures/import-surfaces/vite.config.ts +20 -0
  300. package/kotlin/fixtures/import-values/ImportValues.native.tsx +35 -0
  301. package/kotlin/fixtures/import-values/README.md +23 -0
  302. package/kotlin/fixtures/import-values/Values.d.kt.ts +11 -0
  303. package/kotlin/fixtures/import-values/Values.kt +66 -0
  304. package/kotlin/fixtures/import-values/app/_layout.tsx +4 -0
  305. package/kotlin/fixtures/import-values/app/index+spa.tsx +1 -0
  306. package/kotlin/fixtures/import-values/package.json +23 -0
  307. package/kotlin/fixtures/import-values/tsconfig.json +20 -0
  308. package/kotlin/fixtures/import-values/vite.config.ts +20 -0
  309. package/kotlin/fixtures/kotlin-app-variants/BarBehavior.kt +38 -0
  310. package/kotlin/fixtures/kotlin-app-variants/BarVisibility.kt +36 -0
  311. package/kotlin/fixtures/kotlin-app-variants/Ime.kt +3 -1
  312. package/kotlin/fixtures/kotlin-app-variants/TransientInsets.kt +50 -0
  313. package/kotlin/fork/NOTICE +6 -1
  314. package/kotlin/fork/README.md +15 -7
  315. package/kotlin/fork/build.sh +2 -0
  316. package/kotlin/fork/compose-worker-globals.patch +186 -4
  317. package/kotlin/fork/fork.json +2 -2
  318. package/kotlin/fork/skiko-worker-clock.patch +12 -0
  319. package/kotlin/toolchain.json +12 -12
  320. package/kotlin/tools/expo-types.main.kts +115 -0
  321. package/package.json +17 -23
  322. package/scripts/dev-server-scanner.ts +92 -66
  323. package/skills/contrast/SKILL.md +2 -2
  324. package/skills/peach-debug/SKILL.md +1 -1
  325. package/skills/peach-perf/SKILL.md +1 -1
  326. package/skills/peach-setup/SKILL.md +2 -1
  327. package/skills/peach-test/SKILL.md +8 -0
  328. package/src/assetCatalogContract.ts +43 -1
  329. package/src/bridge-contract-input.ts +46 -19
  330. package/src/bridge-contract.ts +0 -1
  331. package/src/bundle-channel.mjs +197 -84
  332. package/src/bundleGlobalFooter.ts +38 -0
  333. package/src/capture-contract.ts +107 -33
  334. package/src/cloud-contract.ts +5 -1
  335. package/src/cloud.ts +5 -2
  336. package/src/config.ts +22 -3
  337. package/src/configured-bundle-producer.ts +1 -1
  338. package/src/desktop-host-delivery.ts +95 -1
  339. package/src/expo-kotlin-bundle.ts +29 -0
  340. package/src/expo-kotlin-host.ts +201 -0
  341. package/src/expo-swift-host.ts +96 -76
  342. package/src/expoKotlinContract.ts +70 -0
  343. package/src/expoSwiftContract.ts +4 -25
  344. package/src/home-paths.ts +7 -4
  345. package/src/host/bridge-host.ts +23 -3
  346. package/src/host/fetch-proxy-handler.ts +13 -0
  347. package/src/host/fetch-proxy-overrides.ts +11 -0
  348. package/src/host/replacement-module-handler.ts +5 -2
  349. package/src/index.ts +3 -1
  350. package/src/kotlin-host.ts +463 -19
  351. package/src/metro-plugin.ts +56 -28
  352. package/src/metro-production-bundle.ts +2 -2
  353. package/src/native-app-identity-project.ts +190 -0
  354. package/src/native-app-identity.ts +398 -34
  355. package/src/native-firebase-config.ts +69 -15
  356. package/src/native-seam-manifest.ts +6 -0
  357. package/src/one-widget-discovery.ts +2 -1
  358. package/src/openstep-plist.ts +107 -0
  359. package/src/react-native-host-modules.ts +4 -0
  360. package/src/runtime-assets.ts +2 -2
  361. package/src/sim-client.ts +2 -2
  362. package/src/swift-binary-modules.ts +3 -1
  363. package/src/swift-compile.ts +286 -38
  364. package/src/swift-distribution-contract.ts +4 -0
  365. package/src/swift-distribution.lock.json +123 -12
  366. package/src/swift-distribution.ts +7 -3
  367. package/src/swift-host.ts +298 -83
  368. package/src/swift-package-manifest.ts +29 -2
  369. package/src/swift-package.ts +180 -10
  370. package/src/swift-packages.ts +4 -0
  371. package/src/swift-standin-emit.ts +4 -1
  372. package/src/swift-standins.ts +274 -15
  373. package/src/swift-submit.ts +62 -7
  374. package/src/swift-toolchain.ts +6 -1
  375. package/src/swiftContract.ts +126 -3
  376. package/src/vite-plugin-one.ts +13 -16
  377. package/src/vite-plugin-swift.ts +4 -5
  378. package/src/vite-plugin.ts +360 -144
  379. package/src/vite.d.ts +1 -1
  380. package/src/worker-system-chunks.ts +221 -0
  381. package/src/worklet-executable.ts +348 -38
  382. package/src/worklets-babel.ts +1 -1
  383. package/src/xcode-project.ts +243 -127
  384. package/dist-lib/agent-identity.cjs +0 -39
  385. package/dist-lib/agent-sessions.cjs +0 -760
  386. package/dist-lib/cli-constants.cjs +0 -32
  387. package/dist-lib/render-mode.cjs +0 -44
  388. package/kotlin/AppSources/android/view/View.kt +0 -74
  389. package/kotlin/AppSources/android/widget/FrameLayout.kt +0 -6
  390. package/src/render-mode.ts +0 -15
  391. /package/kotlin/{AppSources → AndroidViewSources}/android/content/Context.kt +0 -0
  392. /package/kotlin/{AppSources → AndroidViewSources}/android/content/res/Configuration.kt +0 -0
  393. /package/kotlin/{AppSources → AndroidViewSources}/android/graphics/Color.kt +0 -0
  394. /package/kotlin/{AppSources → AndroidViewSources}/android/util/DisplayMetrics.kt +0 -0
  395. /package/kotlin/{AppSources → AndroidViewSources}/dev/peach/app/JavaFormat.kt +0 -0
  396. /package/kotlin/{AppSources → Sources}/java/lang/Runnable.kt +0 -0
@@ -0,0 +1,2647 @@
1
+ /*! peach v0.1.1399 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
+ let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
+ "use strict";
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
33
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
+
35
+ // ../../node_modules/plist/lib/parse.js
36
+ var require_parse = __commonJS({
37
+ "../../node_modules/plist/lib/parse.js"(exports2) {
38
+ var { DOMParser } = require("@xmldom/xmldom");
39
+ exports2.parse = parse;
40
+ var TEXT_NODE = 3;
41
+ var CDATA_NODE = 4;
42
+ var COMMENT_NODE = 8;
43
+ function shouldIgnoreNode(node) {
44
+ return node.nodeType === TEXT_NODE || node.nodeType === COMMENT_NODE || node.nodeType === CDATA_NODE;
45
+ }
46
+ function isEmptyNode(node) {
47
+ if (!node.childNodes || node.childNodes.length === 0) {
48
+ return true;
49
+ } else {
50
+ return false;
51
+ }
52
+ }
53
+ function invariant(test, message) {
54
+ if (!test) {
55
+ throw new Error(message);
56
+ }
57
+ }
58
+ function parse(xml) {
59
+ var doc = new DOMParser().parseFromString(xml, "text/xml");
60
+ invariant(
61
+ doc.documentElement.nodeName === "plist",
62
+ "malformed document. First element should be <plist>"
63
+ );
64
+ var plist3 = parsePlistXML(doc.documentElement);
65
+ if (plist3.length == 1) plist3 = plist3[0];
66
+ return plist3;
67
+ }
68
+ function parsePlistXML(node) {
69
+ var i, new_obj, key, val, new_arr, res, counter, type;
70
+ if (!node) return null;
71
+ if (node.nodeName === "plist") {
72
+ new_arr = [];
73
+ if (isEmptyNode(node)) {
74
+ return new_arr;
75
+ }
76
+ for (i = 0; i < node.childNodes.length; i++) {
77
+ if (!shouldIgnoreNode(node.childNodes[i])) {
78
+ new_arr.push(parsePlistXML(node.childNodes[i]));
79
+ }
80
+ }
81
+ return new_arr;
82
+ } else if (node.nodeName === "dict") {
83
+ new_obj = {};
84
+ key = null;
85
+ counter = 0;
86
+ if (isEmptyNode(node)) {
87
+ return new_obj;
88
+ }
89
+ for (i = 0; i < node.childNodes.length; i++) {
90
+ if (shouldIgnoreNode(node.childNodes[i])) continue;
91
+ if (counter % 2 === 0) {
92
+ invariant(
93
+ node.childNodes[i].nodeName === "key",
94
+ "Missing key while parsing <dict/>."
95
+ );
96
+ key = parsePlistXML(node.childNodes[i]);
97
+ } else {
98
+ invariant(
99
+ node.childNodes[i].nodeName !== "key",
100
+ 'Unexpected key "' + parsePlistXML(node.childNodes[i]) + '" while parsing <dict/>.'
101
+ );
102
+ new_obj[key] = parsePlistXML(node.childNodes[i]);
103
+ }
104
+ counter += 1;
105
+ }
106
+ if (counter % 2 === 1) {
107
+ new_obj[key] = "";
108
+ }
109
+ return new_obj;
110
+ } else if (node.nodeName === "array") {
111
+ new_arr = [];
112
+ if (isEmptyNode(node)) {
113
+ return new_arr;
114
+ }
115
+ for (i = 0; i < node.childNodes.length; i++) {
116
+ if (!shouldIgnoreNode(node.childNodes[i])) {
117
+ res = parsePlistXML(node.childNodes[i]);
118
+ if (null != res) new_arr.push(res);
119
+ }
120
+ }
121
+ return new_arr;
122
+ } else if (node.nodeName === "#text") {
123
+ } else if (node.nodeName === "key") {
124
+ if (isEmptyNode(node)) {
125
+ return "";
126
+ }
127
+ invariant(
128
+ node.childNodes[0].nodeValue !== "__proto__",
129
+ "__proto__ keys can lead to prototype pollution. More details on CVE-2022-22912"
130
+ );
131
+ return node.childNodes[0].nodeValue;
132
+ } else if (node.nodeName === "string") {
133
+ res = "";
134
+ if (isEmptyNode(node)) {
135
+ return res;
136
+ }
137
+ for (i = 0; i < node.childNodes.length; i++) {
138
+ var type = node.childNodes[i].nodeType;
139
+ if (type === TEXT_NODE || type === CDATA_NODE) {
140
+ res += node.childNodes[i].nodeValue;
141
+ }
142
+ }
143
+ return res;
144
+ } else if (node.nodeName === "integer") {
145
+ invariant(!isEmptyNode(node), 'Cannot parse "" as integer.');
146
+ return parseInt(node.childNodes[0].nodeValue, 10);
147
+ } else if (node.nodeName === "real") {
148
+ invariant(!isEmptyNode(node), 'Cannot parse "" as real.');
149
+ res = "";
150
+ for (i = 0; i < node.childNodes.length; i++) {
151
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
152
+ res += node.childNodes[i].nodeValue;
153
+ }
154
+ }
155
+ return parseFloat(res);
156
+ } else if (node.nodeName === "data") {
157
+ res = "";
158
+ if (isEmptyNode(node)) {
159
+ return Buffer.from(res, "base64");
160
+ }
161
+ for (i = 0; i < node.childNodes.length; i++) {
162
+ if (node.childNodes[i].nodeType === TEXT_NODE) {
163
+ res += node.childNodes[i].nodeValue.replace(/\s+/g, "");
164
+ }
165
+ }
166
+ return Buffer.from(res, "base64");
167
+ } else if (node.nodeName === "date") {
168
+ invariant(!isEmptyNode(node), 'Cannot parse "" as Date.');
169
+ return new Date(node.childNodes[0].nodeValue);
170
+ } else if (node.nodeName === "null") {
171
+ return null;
172
+ } else if (node.nodeName === "true") {
173
+ return true;
174
+ } else if (node.nodeName === "false") {
175
+ return false;
176
+ } else {
177
+ throw new Error("Invalid PLIST tag " + node.nodeName);
178
+ }
179
+ }
180
+ }
181
+ });
182
+
183
+ // ../../node_modules/plist/lib/build.js
184
+ var require_build = __commonJS({
185
+ "../../node_modules/plist/lib/build.js"(exports2) {
186
+ var base64 = require("base64-js");
187
+ var xmlbuilder = require("xmlbuilder");
188
+ exports2.build = build;
189
+ function ISODateString(d) {
190
+ function pad(n) {
191
+ return n < 10 ? "0" + n : n;
192
+ }
193
+ return d.getUTCFullYear() + "-" + pad(d.getUTCMonth() + 1) + "-" + pad(d.getUTCDate()) + "T" + pad(d.getUTCHours()) + ":" + pad(d.getUTCMinutes()) + ":" + pad(d.getUTCSeconds()) + "Z";
194
+ }
195
+ var toString = Object.prototype.toString;
196
+ function type(obj) {
197
+ var m = toString.call(obj).match(/\[object (.*)\]/);
198
+ return m ? m[1] : m;
199
+ }
200
+ function build(obj, opts) {
201
+ var XMLHDR = {
202
+ version: "1.0",
203
+ encoding: "UTF-8"
204
+ };
205
+ var XMLDTD = {
206
+ pubid: "-//Apple//DTD PLIST 1.0//EN",
207
+ sysid: "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
208
+ };
209
+ var doc = xmlbuilder.create("plist");
210
+ doc.dec(XMLHDR.version, XMLHDR.encoding, XMLHDR.standalone);
211
+ doc.dtd(XMLDTD.pubid, XMLDTD.sysid);
212
+ doc.att("version", "1.0");
213
+ walk_obj(obj, doc);
214
+ if (!opts) opts = {};
215
+ opts.pretty = opts.pretty !== false;
216
+ return doc.end(opts);
217
+ }
218
+ function walk_obj(next, next_child) {
219
+ var tag_type, i, prop;
220
+ var name = type(next);
221
+ if ("Undefined" == name) {
222
+ return;
223
+ } else if (Array.isArray(next)) {
224
+ next_child = next_child.ele("array");
225
+ for (i = 0; i < next.length; i++) {
226
+ walk_obj(next[i], next_child);
227
+ }
228
+ } else if (Buffer.isBuffer(next)) {
229
+ next_child.ele("data").raw(next.toString("base64"));
230
+ } else if ("Object" == name) {
231
+ next_child = next_child.ele("dict");
232
+ for (prop in next) {
233
+ if (next.hasOwnProperty(prop)) {
234
+ next_child.ele("key").txt(prop);
235
+ walk_obj(next[prop], next_child);
236
+ }
237
+ }
238
+ } else if ("Number" == name) {
239
+ tag_type = next % 1 === 0 ? "integer" : "real";
240
+ next_child.ele(tag_type).txt(next.toString());
241
+ } else if ("BigInt" == name) {
242
+ next_child.ele("integer").txt(next);
243
+ } else if ("Date" == name) {
244
+ next_child.ele("date").txt(ISODateString(new Date(next)));
245
+ } else if ("Boolean" == name) {
246
+ next_child.ele(next ? "true" : "false");
247
+ } else if ("String" == name) {
248
+ next_child.ele("string").txt(next);
249
+ } else if ("ArrayBuffer" == name) {
250
+ next_child.ele("data").raw(base64.fromByteArray(next));
251
+ } else if (next && next.buffer && "ArrayBuffer" == type(next.buffer)) {
252
+ next_child.ele("data").raw(base64.fromByteArray(new Uint8Array(next.buffer), next_child));
253
+ } else if ("Null" === name) {
254
+ next_child.ele("null").txt("");
255
+ }
256
+ }
257
+ }
258
+ });
259
+
260
+ // ../../node_modules/plist/index.js
261
+ var require_plist = __commonJS({
262
+ "../../node_modules/plist/index.js"(exports2) {
263
+ var parserFunctions = require_parse();
264
+ Object.keys(parserFunctions).forEach(function(k) {
265
+ exports2[k] = parserFunctions[k];
266
+ });
267
+ var builderFunctions = require_build();
268
+ Object.keys(builderFunctions).forEach(function(k) {
269
+ exports2[k] = builderFunctions[k];
270
+ });
271
+ }
272
+ });
273
+
274
+ // ../../node_modules/json5/lib/unicode.js
275
+ var require_unicode = __commonJS({
276
+ "../../node_modules/json5/lib/unicode.js"(exports2, module2) {
277
+ module2.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
278
+ module2.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
279
+ module2.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
280
+ }
281
+ });
282
+
283
+ // ../../node_modules/json5/lib/util.js
284
+ var require_util = __commonJS({
285
+ "../../node_modules/json5/lib/util.js"(exports2, module2) {
286
+ var unicode = require_unicode();
287
+ module2.exports = {
288
+ isSpaceSeparator(c) {
289
+ return typeof c === "string" && unicode.Space_Separator.test(c);
290
+ },
291
+ isIdStartChar(c) {
292
+ return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
293
+ },
294
+ isIdContinueChar(c) {
295
+ return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
296
+ },
297
+ isDigit(c) {
298
+ return typeof c === "string" && /[0-9]/.test(c);
299
+ },
300
+ isHexDigit(c) {
301
+ return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
302
+ }
303
+ };
304
+ }
305
+ });
306
+
307
+ // ../../node_modules/json5/lib/parse.js
308
+ var require_parse2 = __commonJS({
309
+ "../../node_modules/json5/lib/parse.js"(exports2, module2) {
310
+ var util = require_util();
311
+ var source;
312
+ var parseState;
313
+ var stack;
314
+ var pos;
315
+ var line;
316
+ var column;
317
+ var token;
318
+ var key;
319
+ var root;
320
+ module2.exports = function parse(text2, reviver) {
321
+ source = String(text2);
322
+ parseState = "start";
323
+ stack = [];
324
+ pos = 0;
325
+ line = 1;
326
+ column = 0;
327
+ token = void 0;
328
+ key = void 0;
329
+ root = void 0;
330
+ do {
331
+ token = lex();
332
+ parseStates[parseState]();
333
+ } while (token.type !== "eof");
334
+ if (typeof reviver === "function") {
335
+ return internalize({ "": root }, "", reviver);
336
+ }
337
+ return root;
338
+ };
339
+ function internalize(holder, name, reviver) {
340
+ const value = holder[name];
341
+ if (value != null && typeof value === "object") {
342
+ if (Array.isArray(value)) {
343
+ for (let i = 0; i < value.length; i++) {
344
+ const key2 = String(i);
345
+ const replacement = internalize(value, key2, reviver);
346
+ if (replacement === void 0) {
347
+ delete value[key2];
348
+ } else {
349
+ Object.defineProperty(value, key2, {
350
+ value: replacement,
351
+ writable: true,
352
+ enumerable: true,
353
+ configurable: true
354
+ });
355
+ }
356
+ }
357
+ } else {
358
+ for (const key2 in value) {
359
+ const replacement = internalize(value, key2, reviver);
360
+ if (replacement === void 0) {
361
+ delete value[key2];
362
+ } else {
363
+ Object.defineProperty(value, key2, {
364
+ value: replacement,
365
+ writable: true,
366
+ enumerable: true,
367
+ configurable: true
368
+ });
369
+ }
370
+ }
371
+ }
372
+ }
373
+ return reviver.call(holder, name, value);
374
+ }
375
+ var lexState;
376
+ var buffer;
377
+ var doubleQuote;
378
+ var sign;
379
+ var c;
380
+ function lex() {
381
+ lexState = "default";
382
+ buffer = "";
383
+ doubleQuote = false;
384
+ sign = 1;
385
+ for (; ; ) {
386
+ c = peek();
387
+ const token2 = lexStates[lexState]();
388
+ if (token2) {
389
+ return token2;
390
+ }
391
+ }
392
+ }
393
+ function peek() {
394
+ if (source[pos]) {
395
+ return String.fromCodePoint(source.codePointAt(pos));
396
+ }
397
+ }
398
+ function read() {
399
+ const c2 = peek();
400
+ if (c2 === "\n") {
401
+ line++;
402
+ column = 0;
403
+ } else if (c2) {
404
+ column += c2.length;
405
+ } else {
406
+ column++;
407
+ }
408
+ if (c2) {
409
+ pos += c2.length;
410
+ }
411
+ return c2;
412
+ }
413
+ var lexStates = {
414
+ default() {
415
+ switch (c) {
416
+ case " ":
417
+ case "\v":
418
+ case "\f":
419
+ case " ":
420
+ case "\xA0":
421
+ case "\uFEFF":
422
+ case "\n":
423
+ case "\r":
424
+ case "\u2028":
425
+ case "\u2029":
426
+ read();
427
+ return;
428
+ case "/":
429
+ read();
430
+ lexState = "comment";
431
+ return;
432
+ case void 0:
433
+ read();
434
+ return newToken("eof");
435
+ }
436
+ if (util.isSpaceSeparator(c)) {
437
+ read();
438
+ return;
439
+ }
440
+ return lexStates[parseState]();
441
+ },
442
+ comment() {
443
+ switch (c) {
444
+ case "*":
445
+ read();
446
+ lexState = "multiLineComment";
447
+ return;
448
+ case "/":
449
+ read();
450
+ lexState = "singleLineComment";
451
+ return;
452
+ }
453
+ throw invalidChar(read());
454
+ },
455
+ multiLineComment() {
456
+ switch (c) {
457
+ case "*":
458
+ read();
459
+ lexState = "multiLineCommentAsterisk";
460
+ return;
461
+ case void 0:
462
+ throw invalidChar(read());
463
+ }
464
+ read();
465
+ },
466
+ multiLineCommentAsterisk() {
467
+ switch (c) {
468
+ case "*":
469
+ read();
470
+ return;
471
+ case "/":
472
+ read();
473
+ lexState = "default";
474
+ return;
475
+ case void 0:
476
+ throw invalidChar(read());
477
+ }
478
+ read();
479
+ lexState = "multiLineComment";
480
+ },
481
+ singleLineComment() {
482
+ switch (c) {
483
+ case "\n":
484
+ case "\r":
485
+ case "\u2028":
486
+ case "\u2029":
487
+ read();
488
+ lexState = "default";
489
+ return;
490
+ case void 0:
491
+ read();
492
+ return newToken("eof");
493
+ }
494
+ read();
495
+ },
496
+ value() {
497
+ switch (c) {
498
+ case "{":
499
+ case "[":
500
+ return newToken("punctuator", read());
501
+ case "n":
502
+ read();
503
+ literal("ull");
504
+ return newToken("null", null);
505
+ case "t":
506
+ read();
507
+ literal("rue");
508
+ return newToken("boolean", true);
509
+ case "f":
510
+ read();
511
+ literal("alse");
512
+ return newToken("boolean", false);
513
+ case "-":
514
+ case "+":
515
+ if (read() === "-") {
516
+ sign = -1;
517
+ }
518
+ lexState = "sign";
519
+ return;
520
+ case ".":
521
+ buffer = read();
522
+ lexState = "decimalPointLeading";
523
+ return;
524
+ case "0":
525
+ buffer = read();
526
+ lexState = "zero";
527
+ return;
528
+ case "1":
529
+ case "2":
530
+ case "3":
531
+ case "4":
532
+ case "5":
533
+ case "6":
534
+ case "7":
535
+ case "8":
536
+ case "9":
537
+ buffer = read();
538
+ lexState = "decimalInteger";
539
+ return;
540
+ case "I":
541
+ read();
542
+ literal("nfinity");
543
+ return newToken("numeric", Infinity);
544
+ case "N":
545
+ read();
546
+ literal("aN");
547
+ return newToken("numeric", NaN);
548
+ case '"':
549
+ case "'":
550
+ doubleQuote = read() === '"';
551
+ buffer = "";
552
+ lexState = "string";
553
+ return;
554
+ }
555
+ throw invalidChar(read());
556
+ },
557
+ identifierNameStartEscape() {
558
+ if (c !== "u") {
559
+ throw invalidChar(read());
560
+ }
561
+ read();
562
+ const u = unicodeEscape();
563
+ switch (u) {
564
+ case "$":
565
+ case "_":
566
+ break;
567
+ default:
568
+ if (!util.isIdStartChar(u)) {
569
+ throw invalidIdentifier();
570
+ }
571
+ break;
572
+ }
573
+ buffer += u;
574
+ lexState = "identifierName";
575
+ },
576
+ identifierName() {
577
+ switch (c) {
578
+ case "$":
579
+ case "_":
580
+ case "\u200C":
581
+ case "\u200D":
582
+ buffer += read();
583
+ return;
584
+ case "\\":
585
+ read();
586
+ lexState = "identifierNameEscape";
587
+ return;
588
+ }
589
+ if (util.isIdContinueChar(c)) {
590
+ buffer += read();
591
+ return;
592
+ }
593
+ return newToken("identifier", buffer);
594
+ },
595
+ identifierNameEscape() {
596
+ if (c !== "u") {
597
+ throw invalidChar(read());
598
+ }
599
+ read();
600
+ const u = unicodeEscape();
601
+ switch (u) {
602
+ case "$":
603
+ case "_":
604
+ case "\u200C":
605
+ case "\u200D":
606
+ break;
607
+ default:
608
+ if (!util.isIdContinueChar(u)) {
609
+ throw invalidIdentifier();
610
+ }
611
+ break;
612
+ }
613
+ buffer += u;
614
+ lexState = "identifierName";
615
+ },
616
+ sign() {
617
+ switch (c) {
618
+ case ".":
619
+ buffer = read();
620
+ lexState = "decimalPointLeading";
621
+ return;
622
+ case "0":
623
+ buffer = read();
624
+ lexState = "zero";
625
+ return;
626
+ case "1":
627
+ case "2":
628
+ case "3":
629
+ case "4":
630
+ case "5":
631
+ case "6":
632
+ case "7":
633
+ case "8":
634
+ case "9":
635
+ buffer = read();
636
+ lexState = "decimalInteger";
637
+ return;
638
+ case "I":
639
+ read();
640
+ literal("nfinity");
641
+ return newToken("numeric", sign * Infinity);
642
+ case "N":
643
+ read();
644
+ literal("aN");
645
+ return newToken("numeric", NaN);
646
+ }
647
+ throw invalidChar(read());
648
+ },
649
+ zero() {
650
+ switch (c) {
651
+ case ".":
652
+ buffer += read();
653
+ lexState = "decimalPoint";
654
+ return;
655
+ case "e":
656
+ case "E":
657
+ buffer += read();
658
+ lexState = "decimalExponent";
659
+ return;
660
+ case "x":
661
+ case "X":
662
+ buffer += read();
663
+ lexState = "hexadecimal";
664
+ return;
665
+ }
666
+ return newToken("numeric", sign * 0);
667
+ },
668
+ decimalInteger() {
669
+ switch (c) {
670
+ case ".":
671
+ buffer += read();
672
+ lexState = "decimalPoint";
673
+ return;
674
+ case "e":
675
+ case "E":
676
+ buffer += read();
677
+ lexState = "decimalExponent";
678
+ return;
679
+ }
680
+ if (util.isDigit(c)) {
681
+ buffer += read();
682
+ return;
683
+ }
684
+ return newToken("numeric", sign * Number(buffer));
685
+ },
686
+ decimalPointLeading() {
687
+ if (util.isDigit(c)) {
688
+ buffer += read();
689
+ lexState = "decimalFraction";
690
+ return;
691
+ }
692
+ throw invalidChar(read());
693
+ },
694
+ decimalPoint() {
695
+ switch (c) {
696
+ case "e":
697
+ case "E":
698
+ buffer += read();
699
+ lexState = "decimalExponent";
700
+ return;
701
+ }
702
+ if (util.isDigit(c)) {
703
+ buffer += read();
704
+ lexState = "decimalFraction";
705
+ return;
706
+ }
707
+ return newToken("numeric", sign * Number(buffer));
708
+ },
709
+ decimalFraction() {
710
+ switch (c) {
711
+ case "e":
712
+ case "E":
713
+ buffer += read();
714
+ lexState = "decimalExponent";
715
+ return;
716
+ }
717
+ if (util.isDigit(c)) {
718
+ buffer += read();
719
+ return;
720
+ }
721
+ return newToken("numeric", sign * Number(buffer));
722
+ },
723
+ decimalExponent() {
724
+ switch (c) {
725
+ case "+":
726
+ case "-":
727
+ buffer += read();
728
+ lexState = "decimalExponentSign";
729
+ return;
730
+ }
731
+ if (util.isDigit(c)) {
732
+ buffer += read();
733
+ lexState = "decimalExponentInteger";
734
+ return;
735
+ }
736
+ throw invalidChar(read());
737
+ },
738
+ decimalExponentSign() {
739
+ if (util.isDigit(c)) {
740
+ buffer += read();
741
+ lexState = "decimalExponentInteger";
742
+ return;
743
+ }
744
+ throw invalidChar(read());
745
+ },
746
+ decimalExponentInteger() {
747
+ if (util.isDigit(c)) {
748
+ buffer += read();
749
+ return;
750
+ }
751
+ return newToken("numeric", sign * Number(buffer));
752
+ },
753
+ hexadecimal() {
754
+ if (util.isHexDigit(c)) {
755
+ buffer += read();
756
+ lexState = "hexadecimalInteger";
757
+ return;
758
+ }
759
+ throw invalidChar(read());
760
+ },
761
+ hexadecimalInteger() {
762
+ if (util.isHexDigit(c)) {
763
+ buffer += read();
764
+ return;
765
+ }
766
+ return newToken("numeric", sign * Number(buffer));
767
+ },
768
+ string() {
769
+ switch (c) {
770
+ case "\\":
771
+ read();
772
+ buffer += escape();
773
+ return;
774
+ case '"':
775
+ if (doubleQuote) {
776
+ read();
777
+ return newToken("string", buffer);
778
+ }
779
+ buffer += read();
780
+ return;
781
+ case "'":
782
+ if (!doubleQuote) {
783
+ read();
784
+ return newToken("string", buffer);
785
+ }
786
+ buffer += read();
787
+ return;
788
+ case "\n":
789
+ case "\r":
790
+ throw invalidChar(read());
791
+ case "\u2028":
792
+ case "\u2029":
793
+ separatorChar(c);
794
+ break;
795
+ case void 0:
796
+ throw invalidChar(read());
797
+ }
798
+ buffer += read();
799
+ },
800
+ start() {
801
+ switch (c) {
802
+ case "{":
803
+ case "[":
804
+ return newToken("punctuator", read());
805
+ }
806
+ lexState = "value";
807
+ },
808
+ beforePropertyName() {
809
+ switch (c) {
810
+ case "$":
811
+ case "_":
812
+ buffer = read();
813
+ lexState = "identifierName";
814
+ return;
815
+ case "\\":
816
+ read();
817
+ lexState = "identifierNameStartEscape";
818
+ return;
819
+ case "}":
820
+ return newToken("punctuator", read());
821
+ case '"':
822
+ case "'":
823
+ doubleQuote = read() === '"';
824
+ lexState = "string";
825
+ return;
826
+ }
827
+ if (util.isIdStartChar(c)) {
828
+ buffer += read();
829
+ lexState = "identifierName";
830
+ return;
831
+ }
832
+ throw invalidChar(read());
833
+ },
834
+ afterPropertyName() {
835
+ if (c === ":") {
836
+ return newToken("punctuator", read());
837
+ }
838
+ throw invalidChar(read());
839
+ },
840
+ beforePropertyValue() {
841
+ lexState = "value";
842
+ },
843
+ afterPropertyValue() {
844
+ switch (c) {
845
+ case ",":
846
+ case "}":
847
+ return newToken("punctuator", read());
848
+ }
849
+ throw invalidChar(read());
850
+ },
851
+ beforeArrayValue() {
852
+ if (c === "]") {
853
+ return newToken("punctuator", read());
854
+ }
855
+ lexState = "value";
856
+ },
857
+ afterArrayValue() {
858
+ switch (c) {
859
+ case ",":
860
+ case "]":
861
+ return newToken("punctuator", read());
862
+ }
863
+ throw invalidChar(read());
864
+ },
865
+ end() {
866
+ throw invalidChar(read());
867
+ }
868
+ };
869
+ function newToken(type, value) {
870
+ return {
871
+ type,
872
+ value,
873
+ line,
874
+ column
875
+ };
876
+ }
877
+ function literal(s) {
878
+ for (const c2 of s) {
879
+ const p = peek();
880
+ if (p !== c2) {
881
+ throw invalidChar(read());
882
+ }
883
+ read();
884
+ }
885
+ }
886
+ function escape() {
887
+ const c2 = peek();
888
+ switch (c2) {
889
+ case "b":
890
+ read();
891
+ return "\b";
892
+ case "f":
893
+ read();
894
+ return "\f";
895
+ case "n":
896
+ read();
897
+ return "\n";
898
+ case "r":
899
+ read();
900
+ return "\r";
901
+ case "t":
902
+ read();
903
+ return " ";
904
+ case "v":
905
+ read();
906
+ return "\v";
907
+ case "0":
908
+ read();
909
+ if (util.isDigit(peek())) {
910
+ throw invalidChar(read());
911
+ }
912
+ return "\0";
913
+ case "x":
914
+ read();
915
+ return hexEscape();
916
+ case "u":
917
+ read();
918
+ return unicodeEscape();
919
+ case "\n":
920
+ case "\u2028":
921
+ case "\u2029":
922
+ read();
923
+ return "";
924
+ case "\r":
925
+ read();
926
+ if (peek() === "\n") {
927
+ read();
928
+ }
929
+ return "";
930
+ case "1":
931
+ case "2":
932
+ case "3":
933
+ case "4":
934
+ case "5":
935
+ case "6":
936
+ case "7":
937
+ case "8":
938
+ case "9":
939
+ throw invalidChar(read());
940
+ case void 0:
941
+ throw invalidChar(read());
942
+ }
943
+ return read();
944
+ }
945
+ function hexEscape() {
946
+ let buffer2 = "";
947
+ let c2 = peek();
948
+ if (!util.isHexDigit(c2)) {
949
+ throw invalidChar(read());
950
+ }
951
+ buffer2 += read();
952
+ c2 = peek();
953
+ if (!util.isHexDigit(c2)) {
954
+ throw invalidChar(read());
955
+ }
956
+ buffer2 += read();
957
+ return String.fromCodePoint(parseInt(buffer2, 16));
958
+ }
959
+ function unicodeEscape() {
960
+ let buffer2 = "";
961
+ let count = 4;
962
+ while (count-- > 0) {
963
+ const c2 = peek();
964
+ if (!util.isHexDigit(c2)) {
965
+ throw invalidChar(read());
966
+ }
967
+ buffer2 += read();
968
+ }
969
+ return String.fromCodePoint(parseInt(buffer2, 16));
970
+ }
971
+ var parseStates = {
972
+ start() {
973
+ if (token.type === "eof") {
974
+ throw invalidEOF();
975
+ }
976
+ push();
977
+ },
978
+ beforePropertyName() {
979
+ switch (token.type) {
980
+ case "identifier":
981
+ case "string":
982
+ key = token.value;
983
+ parseState = "afterPropertyName";
984
+ return;
985
+ case "punctuator":
986
+ pop();
987
+ return;
988
+ case "eof":
989
+ throw invalidEOF();
990
+ }
991
+ },
992
+ afterPropertyName() {
993
+ if (token.type === "eof") {
994
+ throw invalidEOF();
995
+ }
996
+ parseState = "beforePropertyValue";
997
+ },
998
+ beforePropertyValue() {
999
+ if (token.type === "eof") {
1000
+ throw invalidEOF();
1001
+ }
1002
+ push();
1003
+ },
1004
+ beforeArrayValue() {
1005
+ if (token.type === "eof") {
1006
+ throw invalidEOF();
1007
+ }
1008
+ if (token.type === "punctuator" && token.value === "]") {
1009
+ pop();
1010
+ return;
1011
+ }
1012
+ push();
1013
+ },
1014
+ afterPropertyValue() {
1015
+ if (token.type === "eof") {
1016
+ throw invalidEOF();
1017
+ }
1018
+ switch (token.value) {
1019
+ case ",":
1020
+ parseState = "beforePropertyName";
1021
+ return;
1022
+ case "}":
1023
+ pop();
1024
+ }
1025
+ },
1026
+ afterArrayValue() {
1027
+ if (token.type === "eof") {
1028
+ throw invalidEOF();
1029
+ }
1030
+ switch (token.value) {
1031
+ case ",":
1032
+ parseState = "beforeArrayValue";
1033
+ return;
1034
+ case "]":
1035
+ pop();
1036
+ }
1037
+ },
1038
+ end() {
1039
+ }
1040
+ };
1041
+ function push() {
1042
+ let value;
1043
+ switch (token.type) {
1044
+ case "punctuator":
1045
+ switch (token.value) {
1046
+ case "{":
1047
+ value = {};
1048
+ break;
1049
+ case "[":
1050
+ value = [];
1051
+ break;
1052
+ }
1053
+ break;
1054
+ case "null":
1055
+ case "boolean":
1056
+ case "numeric":
1057
+ case "string":
1058
+ value = token.value;
1059
+ break;
1060
+ }
1061
+ if (root === void 0) {
1062
+ root = value;
1063
+ } else {
1064
+ const parent = stack[stack.length - 1];
1065
+ if (Array.isArray(parent)) {
1066
+ parent.push(value);
1067
+ } else {
1068
+ Object.defineProperty(parent, key, {
1069
+ value,
1070
+ writable: true,
1071
+ enumerable: true,
1072
+ configurable: true
1073
+ });
1074
+ }
1075
+ }
1076
+ if (value !== null && typeof value === "object") {
1077
+ stack.push(value);
1078
+ if (Array.isArray(value)) {
1079
+ parseState = "beforeArrayValue";
1080
+ } else {
1081
+ parseState = "beforePropertyName";
1082
+ }
1083
+ } else {
1084
+ const current = stack[stack.length - 1];
1085
+ if (current == null) {
1086
+ parseState = "end";
1087
+ } else if (Array.isArray(current)) {
1088
+ parseState = "afterArrayValue";
1089
+ } else {
1090
+ parseState = "afterPropertyValue";
1091
+ }
1092
+ }
1093
+ }
1094
+ function pop() {
1095
+ stack.pop();
1096
+ const current = stack[stack.length - 1];
1097
+ if (current == null) {
1098
+ parseState = "end";
1099
+ } else if (Array.isArray(current)) {
1100
+ parseState = "afterArrayValue";
1101
+ } else {
1102
+ parseState = "afterPropertyValue";
1103
+ }
1104
+ }
1105
+ function invalidChar(c2) {
1106
+ if (c2 === void 0) {
1107
+ return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
1108
+ }
1109
+ return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
1110
+ }
1111
+ function invalidEOF() {
1112
+ return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
1113
+ }
1114
+ function invalidIdentifier() {
1115
+ column -= 5;
1116
+ return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
1117
+ }
1118
+ function separatorChar(c2) {
1119
+ console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
1120
+ }
1121
+ function formatChar(c2) {
1122
+ const replacements = {
1123
+ "'": "\\'",
1124
+ '"': '\\"',
1125
+ "\\": "\\\\",
1126
+ "\b": "\\b",
1127
+ "\f": "\\f",
1128
+ "\n": "\\n",
1129
+ "\r": "\\r",
1130
+ " ": "\\t",
1131
+ "\v": "\\v",
1132
+ "\0": "\\0",
1133
+ "\u2028": "\\u2028",
1134
+ "\u2029": "\\u2029"
1135
+ };
1136
+ if (replacements[c2]) {
1137
+ return replacements[c2];
1138
+ }
1139
+ if (c2 < " ") {
1140
+ const hexString = c2.charCodeAt(0).toString(16);
1141
+ return "\\x" + ("00" + hexString).substring(hexString.length);
1142
+ }
1143
+ return c2;
1144
+ }
1145
+ function syntaxError(message) {
1146
+ const err = new SyntaxError(message);
1147
+ err.lineNumber = line;
1148
+ err.columnNumber = column;
1149
+ return err;
1150
+ }
1151
+ }
1152
+ });
1153
+
1154
+ // ../../node_modules/json5/lib/stringify.js
1155
+ var require_stringify = __commonJS({
1156
+ "../../node_modules/json5/lib/stringify.js"(exports2, module2) {
1157
+ var util = require_util();
1158
+ module2.exports = function stringify(value, replacer, space) {
1159
+ const stack = [];
1160
+ let indent = "";
1161
+ let propertyList;
1162
+ let replacerFunc;
1163
+ let gap = "";
1164
+ let quote;
1165
+ if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
1166
+ space = replacer.space;
1167
+ quote = replacer.quote;
1168
+ replacer = replacer.replacer;
1169
+ }
1170
+ if (typeof replacer === "function") {
1171
+ replacerFunc = replacer;
1172
+ } else if (Array.isArray(replacer)) {
1173
+ propertyList = [];
1174
+ for (const v of replacer) {
1175
+ let item;
1176
+ if (typeof v === "string") {
1177
+ item = v;
1178
+ } else if (typeof v === "number" || v instanceof String || v instanceof Number) {
1179
+ item = String(v);
1180
+ }
1181
+ if (item !== void 0 && propertyList.indexOf(item) < 0) {
1182
+ propertyList.push(item);
1183
+ }
1184
+ }
1185
+ }
1186
+ if (space instanceof Number) {
1187
+ space = Number(space);
1188
+ } else if (space instanceof String) {
1189
+ space = String(space);
1190
+ }
1191
+ if (typeof space === "number") {
1192
+ if (space > 0) {
1193
+ space = Math.min(10, Math.floor(space));
1194
+ gap = " ".substr(0, space);
1195
+ }
1196
+ } else if (typeof space === "string") {
1197
+ gap = space.substr(0, 10);
1198
+ }
1199
+ return serializeProperty("", { "": value });
1200
+ function serializeProperty(key, holder) {
1201
+ let value2 = holder[key];
1202
+ if (value2 != null) {
1203
+ if (typeof value2.toJSON5 === "function") {
1204
+ value2 = value2.toJSON5(key);
1205
+ } else if (typeof value2.toJSON === "function") {
1206
+ value2 = value2.toJSON(key);
1207
+ }
1208
+ }
1209
+ if (replacerFunc) {
1210
+ value2 = replacerFunc.call(holder, key, value2);
1211
+ }
1212
+ if (value2 instanceof Number) {
1213
+ value2 = Number(value2);
1214
+ } else if (value2 instanceof String) {
1215
+ value2 = String(value2);
1216
+ } else if (value2 instanceof Boolean) {
1217
+ value2 = value2.valueOf();
1218
+ }
1219
+ switch (value2) {
1220
+ case null:
1221
+ return "null";
1222
+ case true:
1223
+ return "true";
1224
+ case false:
1225
+ return "false";
1226
+ }
1227
+ if (typeof value2 === "string") {
1228
+ return quoteString(value2, false);
1229
+ }
1230
+ if (typeof value2 === "number") {
1231
+ return String(value2);
1232
+ }
1233
+ if (typeof value2 === "object") {
1234
+ return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
1235
+ }
1236
+ return void 0;
1237
+ }
1238
+ function quoteString(value2) {
1239
+ const quotes = {
1240
+ "'": 0.1,
1241
+ '"': 0.2
1242
+ };
1243
+ const replacements = {
1244
+ "'": "\\'",
1245
+ '"': '\\"',
1246
+ "\\": "\\\\",
1247
+ "\b": "\\b",
1248
+ "\f": "\\f",
1249
+ "\n": "\\n",
1250
+ "\r": "\\r",
1251
+ " ": "\\t",
1252
+ "\v": "\\v",
1253
+ "\0": "\\0",
1254
+ "\u2028": "\\u2028",
1255
+ "\u2029": "\\u2029"
1256
+ };
1257
+ let product = "";
1258
+ for (let i = 0; i < value2.length; i++) {
1259
+ const c = value2[i];
1260
+ switch (c) {
1261
+ case "'":
1262
+ case '"':
1263
+ quotes[c]++;
1264
+ product += c;
1265
+ continue;
1266
+ case "\0":
1267
+ if (util.isDigit(value2[i + 1])) {
1268
+ product += "\\x00";
1269
+ continue;
1270
+ }
1271
+ }
1272
+ if (replacements[c]) {
1273
+ product += replacements[c];
1274
+ continue;
1275
+ }
1276
+ if (c < " ") {
1277
+ let hexString = c.charCodeAt(0).toString(16);
1278
+ product += "\\x" + ("00" + hexString).substring(hexString.length);
1279
+ continue;
1280
+ }
1281
+ product += c;
1282
+ }
1283
+ const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
1284
+ product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
1285
+ return quoteChar + product + quoteChar;
1286
+ }
1287
+ function serializeObject(value2) {
1288
+ if (stack.indexOf(value2) >= 0) {
1289
+ throw TypeError("Converting circular structure to JSON5");
1290
+ }
1291
+ stack.push(value2);
1292
+ let stepback = indent;
1293
+ indent = indent + gap;
1294
+ let keys = propertyList || Object.keys(value2);
1295
+ let partial = [];
1296
+ for (const key of keys) {
1297
+ const propertyString = serializeProperty(key, value2);
1298
+ if (propertyString !== void 0) {
1299
+ let member = serializeKey(key) + ":";
1300
+ if (gap !== "") {
1301
+ member += " ";
1302
+ }
1303
+ member += propertyString;
1304
+ partial.push(member);
1305
+ }
1306
+ }
1307
+ let final;
1308
+ if (partial.length === 0) {
1309
+ final = "{}";
1310
+ } else {
1311
+ let properties;
1312
+ if (gap === "") {
1313
+ properties = partial.join(",");
1314
+ final = "{" + properties + "}";
1315
+ } else {
1316
+ let separator = ",\n" + indent;
1317
+ properties = partial.join(separator);
1318
+ final = "{\n" + indent + properties + ",\n" + stepback + "}";
1319
+ }
1320
+ }
1321
+ stack.pop();
1322
+ indent = stepback;
1323
+ return final;
1324
+ }
1325
+ function serializeKey(key) {
1326
+ if (key.length === 0) {
1327
+ return quoteString(key, true);
1328
+ }
1329
+ const firstChar = String.fromCodePoint(key.codePointAt(0));
1330
+ if (!util.isIdStartChar(firstChar)) {
1331
+ return quoteString(key, true);
1332
+ }
1333
+ for (let i = firstChar.length; i < key.length; i++) {
1334
+ if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
1335
+ return quoteString(key, true);
1336
+ }
1337
+ }
1338
+ return key;
1339
+ }
1340
+ function serializeArray(value2) {
1341
+ if (stack.indexOf(value2) >= 0) {
1342
+ throw TypeError("Converting circular structure to JSON5");
1343
+ }
1344
+ stack.push(value2);
1345
+ let stepback = indent;
1346
+ indent = indent + gap;
1347
+ let partial = [];
1348
+ for (let i = 0; i < value2.length; i++) {
1349
+ const propertyString = serializeProperty(String(i), value2);
1350
+ partial.push(propertyString !== void 0 ? propertyString : "null");
1351
+ }
1352
+ let final;
1353
+ if (partial.length === 0) {
1354
+ final = "[]";
1355
+ } else {
1356
+ if (gap === "") {
1357
+ let properties = partial.join(",");
1358
+ final = "[" + properties + "]";
1359
+ } else {
1360
+ let separator = ",\n" + indent;
1361
+ let properties = partial.join(separator);
1362
+ final = "[\n" + indent + properties + ",\n" + stepback + "]";
1363
+ }
1364
+ }
1365
+ stack.pop();
1366
+ indent = stepback;
1367
+ return final;
1368
+ }
1369
+ };
1370
+ }
1371
+ });
1372
+
1373
+ // ../../node_modules/json5/lib/index.js
1374
+ var require_lib = __commonJS({
1375
+ "../../node_modules/json5/lib/index.js"(exports2, module2) {
1376
+ var parse = require_parse2();
1377
+ var stringify = require_stringify();
1378
+ var JSON52 = {
1379
+ parse,
1380
+ stringify
1381
+ };
1382
+ module2.exports = JSON52;
1383
+ }
1384
+ });
1385
+
1386
+ // src/native-app-identity-project.ts
1387
+ var native_app_identity_project_exports = {};
1388
+ __export(native_app_identity_project_exports, {
1389
+ readNativeAppIdentityFromProject: () => readNativeAppIdentityFromProject,
1390
+ readNativeAppIdentityFromXcodeTarget: () => readNativeAppIdentityFromXcodeTarget
1391
+ });
1392
+ module.exports = __toCommonJS(native_app_identity_project_exports);
1393
+ var import_node_fs2 = __toESM(require("node:fs"), 1);
1394
+ var import_node_path3 = __toESM(require("node:path"), 1);
1395
+
1396
+ // src/openstep-plist.ts
1397
+ var isDict = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1398
+ var str = (value) => typeof value === "string" ? value : void 0;
1399
+ var list = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
1400
+ function parseOpenStepPlist(text2) {
1401
+ let i = 0;
1402
+ const fail = (message) => {
1403
+ const line = text2.slice(0, i).split("\n").length;
1404
+ throw new Error(`project.pbxproj line ${line}: ${message}`);
1405
+ };
1406
+ const skip = () => {
1407
+ for (; ; ) {
1408
+ const ch = text2[i];
1409
+ if (ch === " " || ch === " " || ch === "\n" || ch === "\r") i++;
1410
+ else if (ch === "/" && text2[i + 1] === "*") {
1411
+ const end = text2.indexOf("*/", i + 2);
1412
+ if (end < 0) fail("unterminated comment");
1413
+ i = end + 2;
1414
+ } else if (ch === "/" && text2[i + 1] === "/") {
1415
+ const end = text2.indexOf("\n", i);
1416
+ i = end < 0 ? text2.length : end + 1;
1417
+ } else return;
1418
+ }
1419
+ };
1420
+ const quoted = () => {
1421
+ i++;
1422
+ let out = "";
1423
+ for (; ; ) {
1424
+ const ch = text2[i++];
1425
+ if (ch === void 0) fail("unterminated string");
1426
+ if (ch === '"') return out;
1427
+ if (ch !== "\\") {
1428
+ out += ch;
1429
+ continue;
1430
+ }
1431
+ const next = text2[i++];
1432
+ if (next === "n") out += "\n";
1433
+ else if (next === "t") out += " ";
1434
+ else if (next === "r") out += "\r";
1435
+ else if (next === "U") {
1436
+ out += String.fromCharCode(parseInt(text2.slice(i, i + 4), 16));
1437
+ i += 4;
1438
+ } else out += next;
1439
+ }
1440
+ };
1441
+ const value = () => {
1442
+ skip();
1443
+ const ch = text2[i];
1444
+ if (ch === "{") {
1445
+ i++;
1446
+ const dict = {};
1447
+ for (; ; ) {
1448
+ skip();
1449
+ if (text2[i] === "}") {
1450
+ i++;
1451
+ return dict;
1452
+ }
1453
+ const key = value();
1454
+ if (typeof key !== "string") fail("dictionary key is not a string");
1455
+ skip();
1456
+ if (text2[i++] !== "=") fail("expected =");
1457
+ if (Object.hasOwn(dict, key)) fail(`duplicate key ${key}`);
1458
+ dict[key] = value();
1459
+ skip();
1460
+ if (text2[i++] !== ";") fail("expected ;");
1461
+ }
1462
+ }
1463
+ if (ch === "(") {
1464
+ i++;
1465
+ const list2 = [];
1466
+ for (; ; ) {
1467
+ skip();
1468
+ if (text2[i] === ")") {
1469
+ i++;
1470
+ return list2;
1471
+ }
1472
+ list2.push(value());
1473
+ skip();
1474
+ if (text2[i] === ",") i++;
1475
+ else if (text2[i] !== ")") fail("expected , or )");
1476
+ }
1477
+ }
1478
+ if (ch === '"') return quoted();
1479
+ const start = i;
1480
+ while (i < text2.length && /[A-Za-z0-9_$+/:.\-<>]/.test(text2[i])) i++;
1481
+ if (i === start) fail(`unexpected ${JSON.stringify(ch ?? "end of file")}`);
1482
+ return text2.slice(start, i);
1483
+ };
1484
+ if (text2.startsWith("// !$*UTF8*$!")) i = text2.indexOf("\n") + 1;
1485
+ const root = value();
1486
+ skip();
1487
+ if (i !== text2.length) fail("trailing content");
1488
+ return root;
1489
+ }
1490
+
1491
+ // src/native-app-identity.ts
1492
+ function canExtractNativeAppIdentity(platform) {
1493
+ return platform === "ios";
1494
+ }
1495
+
1496
+ // src/plist.ts
1497
+ var import_plist = __toESM(require_plist(), 1);
1498
+ function parsePlistSource(source) {
1499
+ return import_plist.default.parse(source);
1500
+ }
1501
+
1502
+ // src/xcode-project.ts
1503
+ var import_node_fs = __toESM(require("node:fs"), 1);
1504
+ var import_node_path2 = __toESM(require("node:path"), 1);
1505
+ var import_plist2 = __toESM(require_plist(), 1);
1506
+
1507
+ // src/xcode-json-project.ts
1508
+ var import_node_path = __toESM(require("node:path"), 1);
1509
+ var import_json5 = __toESM(require_lib(), 1);
1510
+ var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
1511
+ var text = (value) => typeof value === "string" ? value : void 0;
1512
+ var items = (value) => Array.isArray(value) ? value : [];
1513
+ var PHASE_ISA = {
1514
+ "compile-sources": "PBXSourcesBuildPhase",
1515
+ resources: "PBXResourcesBuildPhase",
1516
+ frameworks: "PBXFrameworksBuildPhase",
1517
+ headers: "PBXHeadersBuildPhase",
1518
+ copy: "PBXCopyFilesBuildPhase",
1519
+ script: "PBXShellScriptBuildPhase"
1520
+ };
1521
+ function readXcodeJsonProject(xcodeproj, source) {
1522
+ const json = import_json5.default.parse(source);
1523
+ if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
1524
+ const projectDir = import_node_path.default.dirname(xcodeproj);
1525
+ const objects = {};
1526
+ let next = 0;
1527
+ const add = (entry, id) => {
1528
+ const key = id ?? `XCPROJ${(next++).toString(16).toUpperCase().padStart(18, "0")}`;
1529
+ objects[key] = entry;
1530
+ return key;
1531
+ };
1532
+ const locate = (raw, groupDir) => {
1533
+ if (raw.startsWith("<USER:")) return null;
1534
+ const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
1535
+ if (base) {
1536
+ if (base[1] === "PROJECT")
1537
+ return { sourceTree: "<absolute>", path: import_node_path.default.join(projectDir, base[2]) };
1538
+ if (base[1] === "PRODUCTS")
1539
+ return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
1540
+ return null;
1541
+ }
1542
+ const unescaped = raw.replaceAll("\\<", "<");
1543
+ if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
1544
+ if (unescaped.startsWith("~")) return null;
1545
+ return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path.default.join(groupDir, unescaped) };
1546
+ };
1547
+ const memberships = [];
1548
+ const folders = [];
1549
+ const projectFiles = [];
1550
+ const root = { id: "", name: "", dir: projectDir, parent: null, children: [] };
1551
+ const walk = (entries, parent) => entries.flatMap((entry) => {
1552
+ if (!isObject(entry)) return [];
1553
+ const kind = text(entry.kind) ?? "file-reference";
1554
+ const raw = text(entry.path) ?? "";
1555
+ const located = raw === "" ? null : locate(raw, parent.dir);
1556
+ const name = text(entry.name) ?? import_node_path.default.basename(raw);
1557
+ const node = { id: "", name, dir: null, parent, children: [] };
1558
+ if (kind === "group" || kind === "variant-group" || kind === "version-group") {
1559
+ node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
1560
+ const childIds = walk(items(entry.children), node);
1561
+ node.id = add(
1562
+ kind === "version-group" && located ? {
1563
+ isa: "PBXFileReference",
1564
+ ...located,
1565
+ lastKnownFileType: "wrapper.xcdatamodel"
1566
+ } : {
1567
+ isa: kind === "variant-group" ? "PBXVariantGroup" : "PBXGroup",
1568
+ children: childIds,
1569
+ ...kind === "variant-group" ? {} : { sourceTree: "<absolute>", path: node.dir ?? "" },
1570
+ name
1571
+ },
1572
+ text(entry.id)
1573
+ );
1574
+ } else if (kind === "folder") {
1575
+ node.id = add(
1576
+ {
1577
+ isa: "PBXFileSystemSynchronizedRootGroup",
1578
+ ...located ?? { sourceTree: "SDKROOT", path: raw }
1579
+ },
1580
+ text(entry.id)
1581
+ );
1582
+ folders.push({ id: node.id, folder: entry });
1583
+ } else {
1584
+ node.id = add(
1585
+ {
1586
+ isa: "PBXFileReference",
1587
+ ...located ?? { sourceTree: "SDKROOT", path: raw },
1588
+ name
1589
+ },
1590
+ text(entry.id)
1591
+ );
1592
+ if (located?.sourceTree === "<absolute>" && located.path.endsWith(".xcodeproj"))
1593
+ projectFiles.push(node.id);
1594
+ }
1595
+ parent.children.push(node);
1596
+ for (const membership of items(entry["target-membership"])) {
1597
+ if (kind !== "folder") memberships.push({ refId: node.id, entry: membership });
1598
+ }
1599
+ return [node.id];
1600
+ });
1601
+ const mainGroupChildren = walk(items(json.files), root);
1602
+ const mainGroup = add({
1603
+ isa: "PBXGroup",
1604
+ children: mainGroupChildren,
1605
+ sourceTree: "<absolute>",
1606
+ path: projectDir
1607
+ });
1608
+ root.id = mainGroup;
1609
+ const lookup = (reference, from = root) => {
1610
+ if (isObject(reference)) {
1611
+ const anchor = lookupNode(reference.anchor, root);
1612
+ return anchor ? lookup(reference["relative-path"], anchor) : void 0;
1613
+ }
1614
+ if (Array.isArray(reference)) {
1615
+ return lookupNode(
1616
+ reference.map(
1617
+ (component) => isObject(component) ? text(component.name) ?? "" : text(component) ?? ""
1618
+ ).join("/"),
1619
+ from
1620
+ )?.id;
1621
+ }
1622
+ return lookupNode(reference, from)?.id;
1623
+ };
1624
+ const lookupNode = (reference, from) => {
1625
+ const value = text(reference);
1626
+ if (value === void 0) return void 0;
1627
+ if (value.startsWith("id:")) {
1628
+ const id = value.slice(3);
1629
+ const find = (node2) => node2.id === id ? node2 : node2.children.map(find).find(Boolean);
1630
+ return find(root);
1631
+ }
1632
+ let node = from;
1633
+ for (const component of value.split("/")) {
1634
+ if (!node) return void 0;
1635
+ node = component === "." ? node : component === ".." ? node.parent ?? void 0 : node.children.find((child) => child.name === component);
1636
+ }
1637
+ return node;
1638
+ };
1639
+ const configurations = items(json.configurations).flatMap((entry) => {
1640
+ const name = isObject(entry) ? text(entry.name) : text(entry);
1641
+ return name ? [{ name, file: isObject(entry) ? entry.file : void 0 }] : [];
1642
+ });
1643
+ const settingsOf = (value) => Object.fromEntries(
1644
+ Object.entries(isObject(value) ? value : {}).flatMap(
1645
+ ([key, setting]) => typeof setting === "string" ? [[key, setting]] : Array.isArray(setting) ? [
1646
+ [
1647
+ key,
1648
+ setting.filter((item) => typeof item === "string")
1649
+ ]
1650
+ ] : []
1651
+ )
1652
+ );
1653
+ const configurationList = (settings, specialized) => add({
1654
+ isa: "XCConfigurationList",
1655
+ defaultConfigurationName: text(json["default-configuration"]) ?? "Debug",
1656
+ buildConfigurations: configurations.map(({ name, file }) => {
1657
+ const base = lookup(specialized.has(name) ? specialized.get(name) : file);
1658
+ return add({
1659
+ isa: "XCBuildConfiguration",
1660
+ name,
1661
+ buildSettings: settings,
1662
+ ...base ? { baseConfigurationReference: base } : {}
1663
+ });
1664
+ })
1665
+ });
1666
+ const packageIds = /* @__PURE__ */ new Map();
1667
+ for (const entry of items(json.packages)) {
1668
+ if (!isObject(entry)) continue;
1669
+ const repository = text(entry.repository);
1670
+ const local = text(entry.path);
1671
+ const name = local !== void 0 ? import_node_path.default.basename(import_node_path.default.resolve(import_node_path.default.dirname(xcodeproj), local)) : import_node_path.default.basename(repository ?? "").replace(/\.git$/, "");
1672
+ const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({ isa: "XCRemoteSwiftPackageReference", repositoryURL: repository ?? "" });
1673
+ packageIds.set(name.toLowerCase(), id);
1674
+ }
1675
+ const productDependency = (entry) => add({
1676
+ isa: "XCSwiftPackageProductDependency",
1677
+ productName: text(entry["product-name"]) ?? "",
1678
+ // xcode finds a product by name across packages when none is named
1679
+ ...packageIds.has(text(entry.package)?.toLowerCase() ?? "") ? { package: packageIds.get(text(entry.package).toLowerCase()) } : {}
1680
+ });
1681
+ const proxy = (entry, remote, proxyType) => add({
1682
+ isa: "PBXContainerItemProxy",
1683
+ containerPortal: lookup(entry.project) ?? "",
1684
+ proxyType,
1685
+ remoteGlobalIDString: remote ?? "",
1686
+ remoteInfo: text(entry.target) ?? ""
1687
+ });
1688
+ const phases = /* @__PURE__ */ new Map();
1689
+ const targetIds = /* @__PURE__ */ new Map();
1690
+ const targets = [];
1691
+ for (const entry of items(json.targets)) {
1692
+ if (!isObject(entry)) continue;
1693
+ const name = text(entry.name) ?? "";
1694
+ const productType = text(entry["product-type"]);
1695
+ const target = {
1696
+ isa: text(entry.kind) === "aggregate" ? "PBXAggregateTarget" : "PBXNativeTarget",
1697
+ name,
1698
+ productName: name,
1699
+ productType: productType ? `com.apple.product-type.${productType}` : text(entry["full-product-type"]) ?? "",
1700
+ buildPhases: [],
1701
+ dependencies: [],
1702
+ packageProductDependencies: [],
1703
+ fileSystemSynchronizedGroups: []
1704
+ };
1705
+ const product = lookup(entry.product);
1706
+ if (product) target.productReference = product;
1707
+ const id = add(target, text(entry.id));
1708
+ targetIds.set(name, id);
1709
+ targets.push({ id, target, entry });
1710
+ for (const phase of items(entry["build-phases"])) {
1711
+ const kind = isObject(phase) ? text(phase.kind) : text(phase);
1712
+ const isa = kind ? PHASE_ISA[kind] : void 0;
1713
+ if (!kind || !isa) continue;
1714
+ const phaseName = isObject(phase) ? text(phase.name) : void 0;
1715
+ const phaseId = add(
1716
+ { isa, files: [] },
1717
+ isObject(phase) ? text(phase.id) : void 0
1718
+ );
1719
+ target.buildPhases.push(phaseId);
1720
+ phases.set([name, kind, phaseName].filter(Boolean).join("/"), phaseId);
1721
+ phases.set(`id:${phaseId}`, phaseId);
1722
+ }
1723
+ }
1724
+ const phaseFiles = (reference, targetName) => {
1725
+ const value = text(reference);
1726
+ if (value === void 0) return null;
1727
+ const key = value.startsWith("id:") || !targetName ? value : `${targetName}/${value}`;
1728
+ const phase = objects[phases.get(key) ?? ""];
1729
+ return phase && typeof phase === "object" && !Array.isArray(phase) && Array.isArray(phase.files) ? phase.files : null;
1730
+ };
1731
+ for (const { refId, entry } of memberships) {
1732
+ const files = phaseFiles(isObject(entry) ? entry["build-phase"] : entry);
1733
+ files?.push(add({ isa: "PBXBuildFile", fileRef: refId }));
1734
+ }
1735
+ for (const { target, entry } of targets) {
1736
+ const name = text(entry.name) ?? "";
1737
+ target.buildConfigurationList = configurationList(
1738
+ settingsOf(entry["build-settings"]),
1739
+ new Map(
1740
+ items(entry["specialized-configurations"]).flatMap(
1741
+ (configuration) => isObject(configuration) && text(configuration.name) ? [[text(configuration.name), configuration.file]] : []
1742
+ )
1743
+ )
1744
+ );
1745
+ for (const dependency of items(entry.dependencies)) {
1746
+ const kind = isObject(dependency) ? text(dependency.kind) ?? "localTarget" : "localTarget";
1747
+ if (kind === "package" && isObject(dependency)) {
1748
+ ;
1749
+ target.dependencies.push(
1750
+ add({ isa: "PBXTargetDependency", productRef: productDependency(dependency) })
1751
+ );
1752
+ } else if (kind === "remoteTarget" && isObject(dependency)) {
1753
+ ;
1754
+ target.dependencies.push(
1755
+ add({
1756
+ isa: "PBXTargetDependency",
1757
+ targetProxy: proxy(dependency, text(dependency["target-id"]), "1")
1758
+ })
1759
+ );
1760
+ } else {
1761
+ const local = isObject(dependency) ? text(dependency.target) : text(dependency);
1762
+ const id = local ? targetIds.get(local) : void 0;
1763
+ if (id)
1764
+ target.dependencies.push(
1765
+ add({ isa: "PBXTargetDependency", target: id })
1766
+ );
1767
+ }
1768
+ }
1769
+ for (const member of items(entry["package-product-members"])) {
1770
+ if (!isObject(member)) continue;
1771
+ const dependency = productDependency(member);
1772
+ target.packageProductDependencies.push(dependency);
1773
+ const buildFile = member["build-phase"];
1774
+ phaseFiles(isObject(buildFile) ? buildFile["build-phase"] : buildFile, name)?.push(
1775
+ add({ isa: "PBXBuildFile", productRef: dependency })
1776
+ );
1777
+ }
1778
+ }
1779
+ for (const imported of items(json["imported-products"])) {
1780
+ if (!isObject(imported)) continue;
1781
+ const reference = add({
1782
+ isa: "PBXReferenceProxy",
1783
+ path: text(imported.name) ?? text(imported.path) ?? "",
1784
+ sourceTree: "BUILT_PRODUCTS_DIR",
1785
+ remoteRef: proxy(imported, text(imported["product-id"]), "2")
1786
+ });
1787
+ for (const membership of items(imported["target-membership"])) {
1788
+ phaseFiles(isObject(membership) ? membership["build-phase"] : membership)?.push(
1789
+ add({ isa: "PBXBuildFile", fileRef: reference })
1790
+ );
1791
+ }
1792
+ }
1793
+ for (const { id, folder } of folders) {
1794
+ const exceptions = [];
1795
+ for (const exception of items(folder["membership-exceptions"])) {
1796
+ if (!isObject(exception)) continue;
1797
+ const target = targetIds.get(text(exception.target) ?? "");
1798
+ if (!target) continue;
1799
+ exceptions.push(
1800
+ add({
1801
+ isa: "PBXFileSystemSynchronizedBuildFileExceptionSet",
1802
+ target,
1803
+ membershipExceptions: [
1804
+ ...items(exception.exclusions),
1805
+ ...items(exception.inclusions)
1806
+ ].flatMap((member) => typeof member === "string" ? [member] : [])
1807
+ })
1808
+ );
1809
+ }
1810
+ const group = objects[id];
1811
+ if (group && typeof group === "object" && !Array.isArray(group))
1812
+ group.exceptions = exceptions;
1813
+ for (const owner of items(folder["target-membership"])) {
1814
+ const target = targets.find(
1815
+ (candidate) => candidate.id === targetIds.get(text(owner) ?? "")
1816
+ );
1817
+ target?.target.fileSystemSynchronizedGroups?.push(id);
1818
+ }
1819
+ }
1820
+ const localizations = isObject(json.localizations) ? json.localizations : {};
1821
+ const project = add({
1822
+ isa: "PBXProject",
1823
+ mainGroup,
1824
+ projectDirPath: "",
1825
+ developmentRegion: text(localizations.development) ?? "en",
1826
+ buildConfigurationList: configurationList(
1827
+ settingsOf(json["build-settings"]),
1828
+ /* @__PURE__ */ new Map()
1829
+ ),
1830
+ targets: targets.map((entry) => entry.id),
1831
+ packageReferences: [...packageIds.values()],
1832
+ projectReferences: projectFiles.map((ProjectRef) => ({ ProjectRef }))
1833
+ });
1834
+ return { objects, rootObject: project };
1835
+ }
1836
+ function isJsonObject(value) {
1837
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1838
+ }
1839
+
1840
+ // src/xcode-project.ts
1841
+ var APPLICATION = "com.apple.product-type.application";
1842
+ var MODULE_PRODUCTS = /* @__PURE__ */ new Set([
1843
+ "com.apple.product-type.framework",
1844
+ "com.apple.product-type.framework.static",
1845
+ "com.apple.product-type.library.static",
1846
+ "com.apple.product-type.library.dynamic"
1847
+ ]);
1848
+ var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
1849
+ var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
1850
+ var CONDITIONS = {
1851
+ sdk: "iphonesimulator",
1852
+ arch: "arm64",
1853
+ variant: "normal"
1854
+ };
1855
+ function walkFiles(dir) {
1856
+ if (!import_node_fs.default.existsSync(dir)) return [];
1857
+ const out = [];
1858
+ for (const entry of import_node_fs.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
1859
+ if (entry.name.startsWith(".")) continue;
1860
+ const full = import_node_path2.default.join(dir, entry.name);
1861
+ if (entry.isDirectory()) out.push(...walkFiles(full));
1862
+ else if (entry.isFile()) out.push(full);
1863
+ }
1864
+ return out;
1865
+ }
1866
+ var isDirectory = (dir) => import_node_fs.default.existsSync(dir) && import_node_fs.default.statSync(dir).isDirectory();
1867
+ function readXcconfig(file, read) {
1868
+ if (read.includes(file) || !import_node_fs.default.existsSync(file)) return {};
1869
+ read.push(file);
1870
+ const settings = {};
1871
+ for (const raw of import_node_fs.default.readFileSync(file, "utf8").split("\n")) {
1872
+ const line = raw.replace(/\/\/.*$/, "").trim();
1873
+ const include = /^#include\??\s+"([^"]+)"/.exec(line);
1874
+ if (include) {
1875
+ Object.assign(
1876
+ settings,
1877
+ readXcconfig(import_node_path2.default.resolve(import_node_path2.default.dirname(file), include[1]), read)
1878
+ );
1879
+ continue;
1880
+ }
1881
+ const setting = /^([A-Za-z_][A-Za-z0-9_]*(?:\[[^\]]*\])*)\s*=\s*(.*)$/.exec(line);
1882
+ if (setting)
1883
+ settings[setting[1].replace(/\s+/g, "")] = setting[2].replace(/;$/, "").trim();
1884
+ }
1885
+ return settings;
1886
+ }
1887
+ function applyConditions(raw, configuration) {
1888
+ const plain = {};
1889
+ const conditional = {};
1890
+ for (const [key, value] of Object.entries(raw)) {
1891
+ const bracket = key.indexOf("[");
1892
+ if (bracket === -1) {
1893
+ plain[key] = value;
1894
+ continue;
1895
+ }
1896
+ const matches = [...key.slice(bracket).matchAll(/\[([^=\]]+)=([^\]]*)\]/g)].every(
1897
+ ([, name, pattern]) => {
1898
+ const actual = name === "config" ? configuration : CONDITIONS[name];
1899
+ return actual !== void 0 && new RegExp(
1900
+ `^${pattern.replace(/[.+^${}()|\\]/g, "\\$&").replaceAll("*", ".*").replaceAll("?", ".")}$`
1901
+ ).test(actual);
1902
+ }
1903
+ );
1904
+ if (matches) conditional[key.slice(0, bracket)] = value;
1905
+ }
1906
+ return { ...plain, ...conditional };
1907
+ }
1908
+ function applyOperator(value, operator) {
1909
+ if (operator.startsWith("default=")) return value === "" ? operator.slice(8) : value;
1910
+ switch (operator) {
1911
+ case "lower":
1912
+ return value.toLowerCase();
1913
+ case "upper":
1914
+ return value.toUpperCase();
1915
+ case "rfc1034identifier":
1916
+ return value.replace(/[^A-Za-z0-9-]/g, "-").replace(/^[0-9]/, "-");
1917
+ case "identifier":
1918
+ case "c99extidentifier":
1919
+ return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
1920
+ }
1921
+ throw new Error(`unsupported build setting operator :${operator}`);
1922
+ }
1923
+ function decodeXml(text2) {
1924
+ return text2.replaceAll("&quot;", '"').replaceAll("&apos;", "'").replaceAll("&lt;", "<").replaceAll("&gt;", ">").replaceAll("&amp;", "&");
1925
+ }
1926
+ function workspaceReferences(workspace) {
1927
+ const data = import_node_path2.default.join(workspace, "contents.xcworkspacedata");
1928
+ if (!import_node_fs.default.existsSync(data))
1929
+ throw new Error(`${workspace} has no contents.xcworkspacedata`);
1930
+ const container = import_node_path2.default.dirname(workspace);
1931
+ const locate = (location, base) => {
1932
+ const colon = location.indexOf(":");
1933
+ const kind = location.slice(0, colon);
1934
+ const rest = location.slice(colon + 1);
1935
+ if (kind === "group") return import_node_path2.default.resolve(base, rest);
1936
+ if (kind === "container" || kind === "self") return import_node_path2.default.resolve(container, rest);
1937
+ if (kind === "absolute") return import_node_path2.default.resolve(rest);
1938
+ throw new Error(`${import_node_path2.default.basename(workspace)} has an unsupported location ${location}`);
1939
+ };
1940
+ const groups = [container];
1941
+ const references = [];
1942
+ for (const [, closing, tag, attributes, selfClosing] of import_node_fs.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
1943
+ if (closing) {
1944
+ if (tag === "Group") groups.pop();
1945
+ continue;
1946
+ }
1947
+ const base = groups.at(-1);
1948
+ const location = /\blocation\s*=\s*"([^"]*)"/.exec(attributes)?.[1];
1949
+ const resolved = location ? locate(decodeXml(location), base) : base;
1950
+ if (tag === "FileRef") references.push(resolved);
1951
+ else if (!selfClosing) groups.push(resolved);
1952
+ }
1953
+ return references;
1954
+ }
1955
+ var loaded = /* @__PURE__ */ new Map();
1956
+ function xcodeProjectFile(xcodeproj) {
1957
+ for (const name of ["project.pbxproj", "project.xcproj"]) {
1958
+ const file = import_node_path2.default.join(xcodeproj, name);
1959
+ if (import_node_fs.default.existsSync(file)) return file;
1960
+ }
1961
+ return null;
1962
+ }
1963
+ function loadProject(xcodeproj) {
1964
+ const projectFile = xcodeProjectFile(xcodeproj);
1965
+ if (!projectFile)
1966
+ throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
1967
+ const mtimeMs = import_node_fs.default.statSync(projectFile).mtimeMs;
1968
+ const cached = loaded.get(projectFile);
1969
+ if (cached?.mtimeMs === mtimeMs) return cached.project;
1970
+ const source = import_node_fs.default.readFileSync(projectFile, "utf8");
1971
+ const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
1972
+ if (!isDict(root) || !isDict(root.objects)) {
1973
+ throw new Error(`${projectFile} has no objects table`);
1974
+ }
1975
+ const objects = root.objects;
1976
+ const object = (id) => {
1977
+ const found = id === void 0 ? void 0 : objects[id];
1978
+ return isDict(found) ? found : void 0;
1979
+ };
1980
+ const project = object(str(root.rootObject));
1981
+ if (!project || project.isa !== "PBXProject") {
1982
+ throw new Error(`${projectFile} has no PBXProject root`);
1983
+ }
1984
+ const projectDir = import_node_fs.default.realpathSync(
1985
+ import_node_path2.default.resolve(import_node_path2.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
1986
+ );
1987
+ const parent = /* @__PURE__ */ new Map();
1988
+ for (const [id, entry] of Object.entries(objects)) {
1989
+ if (!isDict(entry)) continue;
1990
+ if (entry.isa === "PBXGroup" || entry.isa === "PBXVariantGroup") {
1991
+ for (const child of list(entry.children)) parent.set(child, id);
1992
+ }
1993
+ }
1994
+ const resolvedPaths = /* @__PURE__ */ new Map();
1995
+ const resolvePath = (id) => {
1996
+ if (resolvedPaths.has(id)) return resolvedPaths.get(id);
1997
+ const entry = object(id);
1998
+ let result2 = null;
1999
+ if (entry) {
2000
+ const own = str(entry.path) ?? "";
2001
+ const tree = str(entry.sourceTree) ?? "<group>";
2002
+ if (tree === "<absolute>") result2 = own;
2003
+ else if (tree === "SOURCE_ROOT") result2 = import_node_path2.default.join(projectDir, own);
2004
+ else if (tree === "<group>") {
2005
+ const up = parent.get(id);
2006
+ const base = up ? resolvePath(up) : projectDir;
2007
+ result2 = base === null ? null : import_node_path2.default.join(base, own);
2008
+ }
2009
+ }
2010
+ resolvedPaths.set(id, result2);
2011
+ return result2;
2012
+ };
2013
+ const result = {
2014
+ xcodeproj,
2015
+ projectFile,
2016
+ objects,
2017
+ project,
2018
+ projectDir,
2019
+ object,
2020
+ resolvePath
2021
+ };
2022
+ loaded.set(projectFile, { mtimeMs, project: result });
2023
+ return result;
2024
+ }
2025
+ function defaultConfiguration(project) {
2026
+ const configList = project.object(str(project.project.buildConfigurationList));
2027
+ const names = list(configList?.buildConfigurations).flatMap(
2028
+ (id) => str(project.object(id)?.name) ?? []
2029
+ );
2030
+ return names.includes("Debug") ? "Debug" : str(configList?.defaultConfigurationName) ?? names[0] ?? "Debug";
2031
+ }
2032
+ function targetSettings(ref, configuration, builtins) {
2033
+ const { project, target } = ref;
2034
+ const xcconfigs = [];
2035
+ const level = (listId) => {
2036
+ const configList = project.object(listId);
2037
+ const configs = list(configList?.buildConfigurations).map(project.object);
2038
+ const config = configs.find((entry) => entry?.name === configuration) ?? configs.find((entry) => entry?.name === str(configList?.defaultConfigurationName));
2039
+ if (!config) return [];
2040
+ const name = str(config.name) ?? configuration;
2041
+ const base = str(config.baseConfigurationReference);
2042
+ const own = isDict(config.buildSettings) ? config.buildSettings : {};
2043
+ const baseFile = base ? project.resolvePath(base) : null;
2044
+ const read = [];
2045
+ const fromFile = baseFile ? readXcconfig(baseFile, read) : {};
2046
+ xcconfigs.push(...read);
2047
+ return [
2048
+ applyConditions(fromFile, name),
2049
+ applyConditions(
2050
+ Object.fromEntries(
2051
+ Object.entries(own).flatMap(
2052
+ ([key, value]) => typeof value === "string" ? [[key, value]] : Array.isArray(value) ? [[key, list(value).join(" ")]] : []
2053
+ )
2054
+ ),
2055
+ name
2056
+ )
2057
+ ];
2058
+ };
2059
+ const levels = [
2060
+ { ...builtins, CONFIGURATION: configuration },
2061
+ ...level(str(project.project.buildConfigurationList)),
2062
+ ...level(str(target.buildConfigurationList))
2063
+ ];
2064
+ const resolving = /* @__PURE__ */ new Set();
2065
+ const valueAt = (key, top) => {
2066
+ let at = top;
2067
+ while (at >= 0 && levels[at][key] === void 0) at--;
2068
+ if (at < 0) return derived(key);
2069
+ const marker = `${key}@${at}`;
2070
+ if (resolving.has(marker))
2071
+ throw new Error(`${str(target.name)} has a cyclic build setting ${key}`);
2072
+ resolving.add(marker);
2073
+ const value = expand(
2074
+ levels[at][key],
2075
+ (name) => name === "inherited" ? valueAt(key, at - 1) : valueAt(name, levels.length - 1)
2076
+ );
2077
+ resolving.delete(marker);
2078
+ return value;
2079
+ };
2080
+ const derived = (key) => {
2081
+ const get = (name) => valueAt(name, levels.length - 1);
2082
+ switch (key) {
2083
+ case "PRODUCT_NAME":
2084
+ return get("TARGET_NAME");
2085
+ case "PRODUCT_MODULE_NAME":
2086
+ return applyOperator(get("PRODUCT_NAME"), "c99extidentifier");
2087
+ case "EXECUTABLE_NAME":
2088
+ return get("PRODUCT_NAME");
2089
+ case "AppIdentifierPrefix":
2090
+ case "TeamIdentifierPrefix": {
2091
+ const team = get("DEVELOPMENT_TEAM");
2092
+ return get("CODE_SIGNING_ALLOWED") !== "NO" && team ? `${team}.` : "";
2093
+ }
2094
+ }
2095
+ return "";
2096
+ };
2097
+ return {
2098
+ get: (key) => valueAt(key, levels.length - 1),
2099
+ keys: new Set(levels.flatMap((values) => Object.keys(values))),
2100
+ xcconfigs
2101
+ };
2102
+ }
2103
+ function settingList(value) {
2104
+ const items2 = [];
2105
+ for (const [, quoted, plain] of value.matchAll(
2106
+ /"((?:\\.|[^"\\])*)"|((?:\\.|[^\s"])+)/g
2107
+ ))
2108
+ items2.push((quoted ?? plain).replace(/\\(.)/g, "$1"));
2109
+ return items2;
2110
+ }
2111
+ function compilationConditions(settings) {
2112
+ const flags = settingList(settings("OTHER_SWIFT_FLAGS"));
2113
+ const defined = flags.flatMap(
2114
+ (flag, index) => flag === "-D" ? flags[index + 1] ?? [] : flag.startsWith("-D") ? flag.slice(2) : []
2115
+ );
2116
+ return [
2117
+ .../* @__PURE__ */ new Set([
2118
+ ...settingList(settings("SWIFT_ACTIVE_COMPILATION_CONDITIONS")),
2119
+ ...defined
2120
+ ])
2121
+ ];
2122
+ }
2123
+ function expand(value, lookup) {
2124
+ return value.replace(
2125
+ /\$(?:\(([A-Za-z_][A-Za-z0-9_]*)((?::[^)]*)?)\)|\{([A-Za-z_][A-Za-z0-9_]*)((?::[^}]*)?)\}|([A-Za-z_][A-Za-z0-9_]*))/g,
2126
+ (_match, paren, parenOps, brace, braceOps, bare) => {
2127
+ const name = paren ?? brace ?? bare;
2128
+ const operators = parenOps ?? braceOps ?? "";
2129
+ return operators.split(":").slice(1).reduce((current, operator) => applyOperator(current, operator), lookup(name));
2130
+ }
2131
+ );
2132
+ }
2133
+ function targetMembers(ref, settings, options = {}) {
2134
+ const { project, target, id: targetId } = ref;
2135
+ const targetName = str(target.name) ?? targetId;
2136
+ const sources = /* @__PURE__ */ new Set();
2137
+ const allSources = /* @__PURE__ */ new Set();
2138
+ const resources = /* @__PURE__ */ new Set();
2139
+ const addResource = (file) => {
2140
+ if (isDirectory(file)) {
2141
+ for (const inner of walkFiles(file)) resources.add(inner);
2142
+ } else if (import_node_fs.default.existsSync(file)) resources.add(file);
2143
+ };
2144
+ const fileRefPaths = (refId) => {
2145
+ const entry = project.object(refId);
2146
+ if (!entry) return [];
2147
+ if (entry.isa === "PBXVariantGroup") {
2148
+ return list(entry.children).flatMap((child) => {
2149
+ const resolved2 = project.resolvePath(child);
2150
+ return resolved2 ? [resolved2] : [];
2151
+ });
2152
+ }
2153
+ const resolved = project.resolvePath(refId);
2154
+ return resolved ? [resolved] : [];
2155
+ };
2156
+ const scriptForOutput = /* @__PURE__ */ new Map();
2157
+ const noteScriptOutput = (raw, script) => {
2158
+ const expanded = expand(raw, settings);
2159
+ if (!expanded.endsWith(".swift")) return;
2160
+ const absolute = import_node_path2.default.isAbsolute(expanded) ? import_node_path2.default.normalize(expanded) : import_node_path2.default.resolve(project.projectDir, expanded);
2161
+ if (!scriptForOutput.has(absolute)) scriptForOutput.set(absolute, script);
2162
+ };
2163
+ for (const phaseId of list(target.buildPhases)) {
2164
+ const phase = project.object(phaseId);
2165
+ if (phase?.isa !== "PBXShellScriptBuildPhase") continue;
2166
+ const script = str(phase.name) ?? phaseId;
2167
+ for (const raw of list(phase.outputPaths)) noteScriptOutput(raw, script);
2168
+ for (const listPath of list(phase.outputFileListPaths)) {
2169
+ const expandedList = expand(listPath, settings);
2170
+ const absoluteList = import_node_path2.default.isAbsolute(expandedList) ? expandedList : import_node_path2.default.resolve(project.projectDir, expandedList);
2171
+ if (!import_node_fs.default.existsSync(absoluteList)) continue;
2172
+ for (const line of import_node_fs.default.readFileSync(absoluteList, "utf8").split("\n")) {
2173
+ const trimmed = line.trim();
2174
+ if (trimmed === "" || trimmed.startsWith("#")) continue;
2175
+ noteScriptOutput(trimmed, script);
2176
+ }
2177
+ }
2178
+ }
2179
+ for (const phaseId of list(target.buildPhases)) {
2180
+ const phase = project.object(phaseId);
2181
+ if (phase?.isa !== "PBXSourcesBuildPhase" && phase?.isa !== "PBXResourcesBuildPhase")
2182
+ continue;
2183
+ for (const buildFileId of list(phase.files)) {
2184
+ for (const file of fileRefPaths(str(project.object(buildFileId)?.fileRef) ?? "")) {
2185
+ if (phase.isa === "PBXSourcesBuildPhase") {
2186
+ if (!import_node_fs.default.existsSync(file)) {
2187
+ if (options.requireSources === false) continue;
2188
+ const script = scriptForOutput.get(import_node_path2.default.normalize(file));
2189
+ throw new Error(
2190
+ script ? `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName}: missing source ${file}`
2191
+ );
2192
+ }
2193
+ allSources.add(file);
2194
+ if (file.endsWith(".swift")) sources.add(file);
2195
+ } else if (phase.isa === "PBXResourcesBuildPhase") addResource(file);
2196
+ }
2197
+ }
2198
+ }
2199
+ for (const [file, script] of scriptForOutput) {
2200
+ if (sources.has(file) || allSources.has(file)) continue;
2201
+ if (!import_node_fs.default.existsSync(file)) {
2202
+ if (options.requireSources === false) continue;
2203
+ throw new Error(
2204
+ `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)`
2205
+ );
2206
+ }
2207
+ allSources.add(file);
2208
+ sources.add(file);
2209
+ }
2210
+ const addSynchronized = (folder, relative) => {
2211
+ const file = import_node_path2.default.join(folder, relative);
2212
+ if (NEVER_MEMBER.test(relative)) return;
2213
+ if (file.endsWith(".swift")) {
2214
+ if (!relative.split("/").some((segment) => BUNDLE_DIR.test(segment))) {
2215
+ sources.add(file);
2216
+ allSources.add(file);
2217
+ }
2218
+ } else if (/\.(h|m|mm|c|cpp|metal)$/.test(file)) {
2219
+ if (!file.endsWith(".h")) allSources.add(file);
2220
+ } else resources.add(file);
2221
+ };
2222
+ const owned = new Set(list(target.fileSystemSynchronizedGroups));
2223
+ for (const [groupId, group] of Object.entries(project.objects)) {
2224
+ if (!isDict(group) || group.isa !== "PBXFileSystemSynchronizedRootGroup") continue;
2225
+ const folder = project.resolvePath(groupId);
2226
+ if (!folder) continue;
2227
+ const exceptions = /* @__PURE__ */ new Set();
2228
+ for (const exceptionId of list(group.exceptions)) {
2229
+ const exception = project.object(exceptionId);
2230
+ if (exception?.target !== targetId) continue;
2231
+ for (const relative of list(exception.membershipExceptions))
2232
+ exceptions.add(relative);
2233
+ }
2234
+ if (owned.has(groupId)) {
2235
+ for (const file of walkFiles(folder)) {
2236
+ const relative = import_node_path2.default.relative(folder, file).split(import_node_path2.default.sep).join("/");
2237
+ if ([...exceptions].some(
2238
+ (exception) => relative === exception || relative.startsWith(`${exception}/`)
2239
+ ))
2240
+ continue;
2241
+ addSynchronized(folder, relative);
2242
+ }
2243
+ } else {
2244
+ for (const relative of exceptions) {
2245
+ const file = import_node_path2.default.join(folder, relative);
2246
+ if (isDirectory(file)) {
2247
+ for (const inner of walkFiles(file))
2248
+ addSynchronized(
2249
+ folder,
2250
+ import_node_path2.default.relative(folder, inner).split(import_node_path2.default.sep).join("/")
2251
+ );
2252
+ } else if (import_node_fs.default.existsSync(file)) addSynchronized(folder, relative);
2253
+ }
2254
+ }
2255
+ }
2256
+ return {
2257
+ sources: [...sources].sort(),
2258
+ resources: [...resources].sort(),
2259
+ allSources: [...allSources].sort()
2260
+ };
2261
+ }
2262
+ function commonAncestor(dirs) {
2263
+ let common = dirs[0];
2264
+ for (const dir of dirs) {
2265
+ while (common !== import_node_path2.default.dirname(common) && import_node_path2.default.relative(common, dir).startsWith(".."))
2266
+ common = import_node_path2.default.dirname(common);
2267
+ }
2268
+ return common;
2269
+ }
2270
+ function workspaceProjects(xcodeprojOrWorkspace) {
2271
+ const listed = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? workspaceReferences(xcodeprojOrWorkspace) : [xcodeprojOrWorkspace];
2272
+ const projects = [];
2273
+ const projectAt = /* @__PURE__ */ new Map();
2274
+ const addProject = (xcodeproj) => {
2275
+ if (!xcodeProjectFile(xcodeproj)) return;
2276
+ const key = import_node_fs.default.realpathSync(xcodeproj);
2277
+ if (projectAt.has(key) || key.split(import_node_path2.default.sep).includes("Pods")) return;
2278
+ const project = loadProject(key);
2279
+ projectAt.set(key, project);
2280
+ projects.push(project);
2281
+ const nested = project.project.projectReferences;
2282
+ if (Array.isArray(nested)) {
2283
+ for (const entry of nested) {
2284
+ const ref = isDict(entry) ? str(entry.ProjectRef) : void 0;
2285
+ const resolved = ref ? project.resolvePath(ref) : null;
2286
+ if (resolved) addProject(resolved);
2287
+ }
2288
+ }
2289
+ };
2290
+ for (const reference of listed)
2291
+ if (reference.endsWith(".xcodeproj")) addProject(reference);
2292
+ if (projects.length === 0) {
2293
+ throw new Error(`${import_node_path2.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
2294
+ }
2295
+ return { listed, projects, projectAt };
2296
+ }
2297
+ var targetRefs = /* @__PURE__ */ new WeakMap();
2298
+ function nativeTargets(project) {
2299
+ let refs = targetRefs.get(project);
2300
+ if (!refs) {
2301
+ refs = list(project.project.targets).flatMap((id) => {
2302
+ const target = project.object(id);
2303
+ return target?.isa === "PBXNativeTarget" ? [{ project, id, target }] : [];
2304
+ });
2305
+ targetRefs.set(project, refs);
2306
+ }
2307
+ return refs;
2308
+ }
2309
+ function listXcodeAppTargets(xcodeprojOrWorkspace) {
2310
+ return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(nativeTargets).filter((ref) => ref.target.productType === APPLICATION).map((ref) => str(ref.target.name) ?? ref.id);
2311
+ }
2312
+ function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
2313
+ const xcodeprojOrWorkspace = import_node_fs.default.realpathSync(input);
2314
+ const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
2315
+ const { listed, projects, projectAt } = workspaceProjects(xcodeprojOrWorkspace);
2316
+ const allTargets = projects.flatMap(nativeTargets);
2317
+ const appTargets = allTargets.filter((ref) => ref.target.productType === APPLICATION);
2318
+ const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
2319
+ const container = import_node_path2.default.basename(xcodeprojOrWorkspace);
2320
+ const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
2321
+ if (named.length !== 1) {
2322
+ throw new Error(
2323
+ targetName && named.length === 0 ? `${container} has no application target ${targetName}; it has ${appTargetNames.join(", ") || "none"}` : targetName ? `${container} has ${named.length} application targets named ${targetName}; open its .xcodeproj` : `${container} has ${appTargetNames.length} application targets (${appTargetNames.join(", ") || "none"}); pass --target`
2324
+ );
2325
+ }
2326
+ const app = named[0];
2327
+ const configuration = configurationName ?? defaultConfiguration(app.project);
2328
+ const byProduct = /* @__PURE__ */ new Map();
2329
+ for (const ref of allTargets) {
2330
+ const product = ref.project.object(str(ref.target.productReference));
2331
+ const file = str(product?.path);
2332
+ if (file && !byProduct.has(import_node_path2.default.basename(file)))
2333
+ byProduct.set(import_node_path2.default.basename(file), ref);
2334
+ }
2335
+ const proxied = (project, proxyId) => {
2336
+ const proxy = project.object(proxyId);
2337
+ if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
2338
+ const portal = str(proxy.containerPortal);
2339
+ const portalPath = project.resolvePath(portal ?? "");
2340
+ const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs.default.existsSync(portalPath) ? projectAt.get(import_node_fs.default.realpathSync(portalPath)) : void 0;
2341
+ const remote = str(proxy.remoteGlobalIDString);
2342
+ if (!owner || !remote) return void 0;
2343
+ return nativeTargets(owner).find(
2344
+ (ref) => ref.id === remote || str(ref.target.productReference) === remote
2345
+ );
2346
+ };
2347
+ const dependenciesOf = (ref) => {
2348
+ const { project, target } = ref;
2349
+ const found = [];
2350
+ for (const dependencyId of list(target.dependencies)) {
2351
+ const dependency = project.object(dependencyId);
2352
+ const direct = str(dependency?.target);
2353
+ const resolved = direct ? nativeTargets(project).find((candidate) => candidate.id === direct) : proxied(project, str(dependency?.targetProxy));
2354
+ if (resolved) found.push(resolved);
2355
+ }
2356
+ for (const phaseId of list(target.buildPhases)) {
2357
+ const phase = project.object(phaseId);
2358
+ if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
2359
+ for (const buildFileId of list(phase.files)) {
2360
+ const file = project.object(str(project.object(buildFileId)?.fileRef));
2361
+ const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path2.default.basename(str(file.path) ?? "")) : void 0;
2362
+ if (resolved) found.push(resolved);
2363
+ }
2364
+ }
2365
+ return found.filter(
2366
+ (candidate) => MODULE_PRODUCTS.has(str(candidate.target.productType) ?? "")
2367
+ );
2368
+ };
2369
+ const order = [];
2370
+ const visited = /* @__PURE__ */ new Set();
2371
+ const visit = (ref) => {
2372
+ if (visited.has(ref)) return;
2373
+ visited.add(ref);
2374
+ for (const dependency of dependenciesOf(ref)) visit(dependency);
2375
+ order.push(ref);
2376
+ };
2377
+ visit(app);
2378
+ const xcconfigs = /* @__PURE__ */ new Set();
2379
+ const moduleTarget = (ref) => {
2380
+ const name = str(ref.target.name) ?? ref.id;
2381
+ const {
2382
+ get: settings2,
2383
+ keys,
2384
+ xcconfigs: read
2385
+ } = targetSettings(ref, configuration, {
2386
+ TARGET_NAME: name,
2387
+ PROJECT_NAME: import_node_path2.default.basename(ref.project.xcodeproj, ".xcodeproj"),
2388
+ SRCROOT: ref.project.projectDir,
2389
+ SOURCE_ROOT: ref.project.projectDir,
2390
+ PROJECT_DIR: ref.project.projectDir,
2391
+ DEVELOPMENT_LANGUAGE: str(ref.project.project.developmentRegion) ?? "en"
2392
+ });
2393
+ for (const file of read) xcconfigs.add(file);
2394
+ const swiftVersion = Number.parseFloat(settings2("SWIFT_VERSION") || "5");
2395
+ return {
2396
+ settings: settings2,
2397
+ keys,
2398
+ module: {
2399
+ name,
2400
+ moduleName: applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier"),
2401
+ ...targetMembers(ref, settings2, options),
2402
+ languageMode: swiftVersion >= 6 ? 6 : 5,
2403
+ mainActorIsolation: settings2("SWIFT_DEFAULT_ACTOR_ISOLATION") === "MainActor",
2404
+ defines: compilationConditions(settings2)
2405
+ }
2406
+ };
2407
+ };
2408
+ const { settings, keys: settingKeys, module: module2 } = moduleTarget(app);
2409
+ const frameworks = order.slice(0, -1).map((ref) => moduleTarget(ref).module);
2410
+ const expandValue = (value) => {
2411
+ if (typeof value === "string") return expand(value, settings);
2412
+ if (Array.isArray(value)) return value.map(expandValue);
2413
+ if (typeof value === "object" && !(value instanceof Date) && !Buffer.isBuffer(value)) {
2414
+ return Object.fromEntries(
2415
+ Object.entries(value).map(([key, value2]) => [key, expandValue(value2)])
2416
+ );
2417
+ }
2418
+ return value;
2419
+ };
2420
+ const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path2.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
2421
+ const sourceInfo = infoPlistFile ? import_plist2.default.parse(import_node_fs.default.readFileSync(infoPlistFile, "utf8")) : {};
2422
+ if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
2423
+ throw new Error(`${module2.name} Info.plist must contain a dictionary`);
2424
+ }
2425
+ const info = {};
2426
+ for (const [key, value] of Object.entries(sourceInfo)) info[key] = expandValue(value);
2427
+ for (const key of settingKeys) {
2428
+ if (!key.startsWith("INFOPLIST_KEY_") || key.endsWith("_Generation")) continue;
2429
+ const value = settings(key);
2430
+ info[key.slice("INFOPLIST_KEY_".length)] = value === "YES" ? true : value === "NO" ? false : value;
2431
+ }
2432
+ if (settings("INFOPLIST_KEY_UIApplicationSceneManifest_Generation") === "YES" && info.UIApplicationSceneManifest === void 0) {
2433
+ info.UIApplicationSceneManifest = {
2434
+ UIApplicationSupportsMultipleScenes: true,
2435
+ UISceneConfigurations: {}
2436
+ };
2437
+ }
2438
+ const localPackageDirs = [
2439
+ ...listed.filter((reference) => import_node_fs.default.existsSync(import_node_path2.default.join(reference, "Package.swift"))),
2440
+ ...projects.flatMap(
2441
+ (project) => Object.entries(project.objects).flatMap(([id, entry]) => {
2442
+ if (!isDict(entry)) return [];
2443
+ const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path2.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
2444
+ return candidate && import_node_fs.default.existsSync(import_node_path2.default.join(candidate, "Package.swift")) ? [candidate] : [];
2445
+ })
2446
+ )
2447
+ ];
2448
+ const linkedProducts = [];
2449
+ const binaryFrameworks = /* @__PURE__ */ new Map();
2450
+ for (const { project, target } of order) {
2451
+ const productDependencies = [
2452
+ ...list(target.packageProductDependencies),
2453
+ ...list(target.dependencies).flatMap((id) => {
2454
+ const productRef = str(project.object(id)?.productRef);
2455
+ return productRef ? [productRef] : [];
2456
+ })
2457
+ ];
2458
+ for (const dependencyId of productDependencies) {
2459
+ const dependency = project.object(dependencyId);
2460
+ const product = str(dependency?.productName)?.replace(/^plugin:/, "");
2461
+ if (!dependency || !product || linkedProducts.some((entry) => entry.product === product))
2462
+ continue;
2463
+ const reference = project.object(str(dependency.package));
2464
+ linkedProducts.push({
2465
+ product,
2466
+ source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
2467
+ kind: "local",
2468
+ dir: import_node_path2.default.resolve(
2469
+ project.projectDir,
2470
+ str(reference.relativePath) ?? ""
2471
+ )
2472
+ } : { kind: "unnamed" }
2473
+ });
2474
+ }
2475
+ for (const phaseId of list(target.buildPhases)) {
2476
+ const phase = project.object(phaseId);
2477
+ if (phase?.isa !== "PBXFrameworksBuildPhase") continue;
2478
+ for (const buildFileId of list(phase.files)) {
2479
+ const fileId = str(project.object(buildFileId)?.fileRef);
2480
+ const file = project.object(fileId);
2481
+ const tree = str(file?.sourceTree);
2482
+ const name = /([^/]+)\.(xc)?framework$/.exec(str(file?.path) ?? "")?.[1];
2483
+ if (file?.isa !== "PBXFileReference" || !name) continue;
2484
+ if (tree === "BUILT_PRODUCTS_DIR" || tree === "SDKROOT" || tree === "DEVELOPER_DIR")
2485
+ continue;
2486
+ const resolved = fileId ? project.resolvePath(fileId) : null;
2487
+ if (!binaryFrameworks.get(name)) binaryFrameworks.set(name, resolved);
2488
+ }
2489
+ }
2490
+ }
2491
+ const resolvedFile = import_node_path2.default.join(
2492
+ workspace ?? import_node_path2.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
2493
+ "xcshareddata",
2494
+ "swiftpm",
2495
+ "Package.resolved"
2496
+ );
2497
+ const used = order.map((ref) => ref.project);
2498
+ return {
2499
+ ...module2,
2500
+ rootDir: commonAncestor(
2501
+ [
2502
+ workspace ? import_node_path2.default.dirname(workspace) : app.project.projectDir,
2503
+ ...used.map((project) => project.projectDir),
2504
+ ...localPackageDirs,
2505
+ ...linkedProducts.flatMap(
2506
+ ({ source }) => source.kind === "local" && import_node_fs.default.existsSync(source.dir) ? [source.dir] : []
2507
+ )
2508
+ ].map((dir) => import_node_fs.default.realpathSync(dir))
2509
+ ),
2510
+ projectFiles: [
2511
+ .../* @__PURE__ */ new Set([...used.map((project) => project.projectFile), ...xcconfigs])
2512
+ ].sort(),
2513
+ appIconName: settings("ASSETCATALOG_COMPILER_APPICON_NAME"),
2514
+ infoPlist: import_plist2.default.build(info),
2515
+ infoPlistFile,
2516
+ frameworks,
2517
+ linkedProducts,
2518
+ localPackageDirs: [
2519
+ ...new Set(localPackageDirs.map((dir) => import_node_fs.default.realpathSync(dir)))
2520
+ ].sort(),
2521
+ binaryFrameworks: [...binaryFrameworks].map(([name, file]) => ({ name, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
2522
+ packageResolved: import_node_fs.default.existsSync(resolvedFile) ? resolvedFile : null,
2523
+ appTargets: appTargetNames,
2524
+ configuration,
2525
+ settings
2526
+ };
2527
+ }
2528
+
2529
+ // src/native-app-identity-project.ts
2530
+ function isRecord(value) {
2531
+ return typeof value === "object" && value !== null && !Array.isArray(value);
2532
+ }
2533
+ function nonEmptyString(value) {
2534
+ return typeof value === "string" && value.length > 0 ? value : void 0;
2535
+ }
2536
+ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSource) {
2537
+ const dictionary = parseInfoPlist(app.infoPlist);
2538
+ if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
2539
+ const settings = app.settings;
2540
+ const bundleIdentifier = nonEmptyString(dictionary.CFBundleIdentifier) ?? nonEmptyString(settings?.("PRODUCT_BUNDLE_IDENTIFIER"));
2541
+ if (!bundleIdentifier) throw new Error("native app has no bundle identifier");
2542
+ const appVersion = nonEmptyString(dictionary.CFBundleShortVersionString) ?? nonEmptyString(settings?.("MARKETING_VERSION"));
2543
+ const buildVersion = nonEmptyString(dictionary.CFBundleVersion) ?? nonEmptyString(settings?.("CURRENT_PROJECT_VERSION"));
2544
+ if (!appVersion || !buildVersion) {
2545
+ throw new Error("native app has no version or build version");
2546
+ }
2547
+ const bundleName = nonEmptyString(dictionary.CFBundleName) ?? nonEmptyString(settings?.("PRODUCT_NAME")) ?? app.name;
2548
+ const applicationDisplayName = nonEmptyString(dictionary.CFBundleDisplayName);
2549
+ const applicationName = applicationDisplayName ?? bundleName;
2550
+ const declaredBackgroundColor = dictionary.RCTRootViewBackgroundColor;
2551
+ const rootViewBackgroundColor = typeof declaredBackgroundColor === "number" && Number.isInteger(declaredBackgroundColor) ? declaredBackgroundColor : void 0;
2552
+ const alternateIconNames = /* @__PURE__ */ new Set();
2553
+ const icons = dictionary.CFBundleIcons;
2554
+ const alternates = isRecord(icons) ? icons.CFBundleAlternateIcons : void 0;
2555
+ if (isRecord(alternates)) {
2556
+ for (const name of Object.keys(alternates)) {
2557
+ if (name) alternateIconNames.add(name);
2558
+ }
2559
+ }
2560
+ const alternateSetting = settings?.("ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES") ?? "";
2561
+ for (const match of alternateSetting.replace(/\\"/g, '"').matchAll(/"([^"]*)"|([^\s(),]+)/g)) {
2562
+ const val = match[1] ?? match[2];
2563
+ if (val) alternateIconNames.add(val);
2564
+ }
2565
+ const permissionUsageDescriptions = {};
2566
+ for (const [key, value] of Object.entries(dictionary)) {
2567
+ if (!/^NS.*UsageDescription$/.test(key) && key !== "NSLocationTemporaryUsageDescriptionDictionary") {
2568
+ continue;
2569
+ }
2570
+ permissionUsageDescriptions[key] = value;
2571
+ }
2572
+ const querySchemes = dictionary.LSApplicationQueriesSchemes;
2573
+ const urlQuerySchemes = Array.isArray(querySchemes) ? querySchemes : [];
2574
+ const intentIds = dictionary.OneAppIntentIdentifiers;
2575
+ const appIntentIdentifiers = Array.isArray(intentIds) && intentIds.every((v) => typeof v === "string") ? intentIds : [];
2576
+ const backgroundIds = dictionary.BGTaskSchedulerPermittedIdentifiers;
2577
+ const backgroundTaskIdentifiers = Array.isArray(backgroundIds) && backgroundIds.every((v) => typeof v === "string") ? backgroundIds : [];
2578
+ const declaredModes = dictionary.UIBackgroundModes;
2579
+ const backgroundModes = Array.isArray(declaredModes) && declaredModes.every((v) => typeof v === "string") ? declaredModes : [];
2580
+ const supportedInterfaceOrientations = Array.isArray(dictionary.UISupportedInterfaceOrientations) && dictionary.UISupportedInterfaceOrientations.every((v) => typeof v === "string") ? dictionary.UISupportedInterfaceOrientations : [];
2581
+ const ipadSupportedInterfaceOrientations = Array.isArray(dictionary["UISupportedInterfaceOrientations~ipad"]) && dictionary["UISupportedInterfaceOrientations~ipad"].every(
2582
+ (v) => typeof v === "string"
2583
+ ) ? dictionary["UISupportedInterfaceOrientations~ipad"] : [];
2584
+ const defaultScreenOrientationMask = nonEmptyString(
2585
+ dictionary.EXDefaultScreenOrientationMask
2586
+ );
2587
+ const shareIntoAppGroupId = nonEmptyString(dictionary.ExpoShareIntoAppGroupId);
2588
+ return {
2589
+ applicationName,
2590
+ ...applicationDisplayName ? { applicationDisplayName } : {},
2591
+ ...rootViewBackgroundColor !== void 0 ? { rootViewBackgroundColor } : {},
2592
+ bundleName,
2593
+ appVersion,
2594
+ buildVersion,
2595
+ bundleIdentifier,
2596
+ platform: "ios",
2597
+ supportedInterfaceOrientations,
2598
+ ipadSupportedInterfaceOrientations,
2599
+ ...defaultScreenOrientationMask ? { defaultScreenOrientationMask } : {},
2600
+ alternateIconNames: [...alternateIconNames],
2601
+ permissionUsageDescriptions,
2602
+ urlQuerySchemes,
2603
+ ...shareIntoAppGroupId ? { shareIntoAppGroupId } : {},
2604
+ backgroundTaskIdentifiers,
2605
+ backgroundModes,
2606
+ appIntentIdentifiers
2607
+ };
2608
+ }
2609
+ function readNativeAppIdentityFromProject(projectRoot, platform, parseInfoPlist = parsePlistSource, iosTarget) {
2610
+ if (!canExtractNativeAppIdentity(platform)) return null;
2611
+ const iosRoot = import_node_path3.default.join(projectRoot, "ios");
2612
+ if (!import_node_fs2.default.existsSync(iosRoot)) return null;
2613
+ const projects = import_node_fs2.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
2614
+ if (projects.length === 0) return null;
2615
+ if (projects.length > 1 && !iosTarget) {
2616
+ throw new Error("native app identity requires a selected Xcode project");
2617
+ }
2618
+ let project = projects[0];
2619
+ if (iosTarget && projects.length > 1) {
2620
+ const matches = projects.filter(
2621
+ (entry) => listXcodeAppTargets(import_node_path3.default.join(iosRoot, entry.name)).includes(iosTarget)
2622
+ );
2623
+ if (matches.length === 0) {
2624
+ throw new Error(`native app identity has no application target ${iosTarget}`);
2625
+ }
2626
+ if (matches.length > 1) {
2627
+ throw new Error(
2628
+ `native app identity target ${iosTarget} is ambiguous across ${matches.map((entry) => entry.name).join(", ")}`
2629
+ );
2630
+ }
2631
+ project = matches[0];
2632
+ }
2633
+ const xcodeproj = import_node_path3.default.join(iosRoot, project.name);
2634
+ const appTargets = listXcodeAppTargets(xcodeproj);
2635
+ if (!iosTarget && appTargets.length > 1) {
2636
+ throw new Error("native app identity requires a selected app target");
2637
+ }
2638
+ const app = readXcodeAppTarget(xcodeproj, iosTarget ?? appTargets[0], "Release", {
2639
+ requireSources: false
2640
+ });
2641
+ return readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
2642
+ }
2643
+ // Annotate the CommonJS export names for ESM import in node:
2644
+ 0 && (module.exports = {
2645
+ readNativeAppIdentityFromProject,
2646
+ readNativeAppIdentityFromXcodeTarget
2647
+ });