@preventive/triage 1.0.0-alpha.8 → 1.0.0-alpha.80

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 (442) hide show
  1. package/LICENSE-APACHE +202 -0
  2. package/README.md +16 -0
  3. package/api/reap.ts +16 -78
  4. package/cli.js +6 -0
  5. package/client/dependency-paths.d.ts +3 -0
  6. package/client/dependency-paths.js +36 -0
  7. package/client/finding-link.js +305 -0
  8. package/client/linked-findings.d.ts +1 -0
  9. package/client/linked-findings.js +115 -0
  10. package/common/bundle-commit.d.ts +1 -0
  11. package/common/bundle-commit.js +4 -0
  12. package/common/bundle-compare-diff.d.ts +6 -0
  13. package/common/bundle-compare-diff.js +377 -0
  14. package/common/bundle-compare-inputs.d.ts +3 -0
  15. package/common/bundle-compare-inputs.js +141 -0
  16. package/common/bundle-compare-versions.js +172 -0
  17. package/common/bundle-comparison.d.ts +8 -0
  18. package/common/bundle-comparison.js +69 -0
  19. package/common/bundle-imports.js +20 -0
  20. package/common/bundle-metadata.d.ts +15 -0
  21. package/common/bundle-metadata.js +226 -0
  22. package/common/bundle-pkg-of.d.ts +1 -0
  23. package/common/bundle-pkg-of.js +90 -0
  24. package/common/bundle-reasons.d.ts +6 -0
  25. package/common/bundle-reasons.js +58 -0
  26. package/common/bundle-source-links.d.ts +6 -0
  27. package/common/bundle-source-links.js +216 -0
  28. package/common/bundle-sourcemap.d.ts +10 -0
  29. package/common/bundle-sourcemap.js +100 -0
  30. package/common/bundle-sources.d.ts +10 -0
  31. package/common/bundle-sources.js +374 -0
  32. package/common/bundle-stats.js +41 -0
  33. package/common/bundle-tabs.js +1 -0
  34. package/common/code-language.js +66 -0
  35. package/common/default-scan-models.ts +36 -0
  36. package/common/dependency-reviews.d.ts +18 -0
  37. package/common/dependency-reviews.js +64 -0
  38. package/common/finding-duplicates.js +63 -0
  39. package/common/finding-filters.js +313 -0
  40. package/common/finding-id.js +47 -0
  41. package/common/finding-repo.d.ts +5 -0
  42. package/common/finding-repo.js +67 -0
  43. package/common/github-issue-labels.d.ts +1 -0
  44. package/common/github-issue-labels.js +11 -0
  45. package/common/github-pr.ts +56 -0
  46. package/common/gzip.js +59 -0
  47. package/common/line-diff.d.ts +14 -0
  48. package/common/line-diff.js +181 -0
  49. package/common/linked-workspace-groups.js +63 -0
  50. package/common/managed/agent-tasks.ts +292 -0
  51. package/common/managed/comments.ts +43 -0
  52. package/common/managed/dependency-routes.js +25 -0
  53. package/common/managed/directory-packages.ts +28 -0
  54. package/common/managed/finding-detail.d.ts +5 -0
  55. package/common/managed/finding-detail.js +75 -0
  56. package/common/managed/finding-values.d.ts +2 -0
  57. package/common/managed/finding-values.js +138 -0
  58. package/common/managed/github-agents.ts +114 -0
  59. package/common/managed/github-logins.ts +49 -0
  60. package/common/managed/lite-name.d.ts +2 -0
  61. package/common/managed/lite-name.js +20 -0
  62. package/common/managed/npm-packages.d.ts +9 -0
  63. package/common/managed/npm-packages.js +63 -0
  64. package/common/managed/permissions.ts +31 -0
  65. package/common/managed/report-content.ts +72 -0
  66. package/common/managed/report-filter.ts +120 -0
  67. package/common/managed/repository-alias.ts +65 -0
  68. package/common/managed/review-view-routes.js +23 -0
  69. package/common/managed/risk-routes.js +30 -0
  70. package/common/managed/roles.ts +41 -0
  71. package/common/managed/routes.d.ts +2 -0
  72. package/common/managed/routes.js +385 -0
  73. package/common/managed/scan-models.ts +6 -0
  74. package/common/managed/stasis-config.ts +7 -0
  75. package/common/managed/team-app.d.ts +19 -0
  76. package/common/managed/team-app.js +129 -0
  77. package/common/managed/team-filters.js +26 -0
  78. package/common/managed/triage.ts +83 -0
  79. package/common/managed/upload-seal.ts +126 -0
  80. package/common/pretty-json.js +98 -0
  81. package/common/pretty-kinds.js +20 -0
  82. package/common/pretty-print.d.ts +6 -0
  83. package/common/pretty-print.js +36 -0
  84. package/common/pretty-sourcemap.js +70 -0
  85. package/common/repo-commit.d.ts +4 -0
  86. package/common/repo-commit.js +30 -0
  87. package/common/revalidation-conflicts.js +48 -0
  88. package/common/revalidation-input-groups.js +56 -0
  89. package/common/save-error-reason.ts +20 -7
  90. package/common/scan-server.ts +13 -0
  91. package/common/security-links.d.ts +5 -0
  92. package/common/security-links.js +33 -0
  93. package/common/server-info.ts +46 -0
  94. package/common/sourcemap-listing.js +78 -0
  95. package/common/sourcemap-mappings.js +136 -0
  96. package/common/sourcemap-unlist.js +85 -0
  97. package/common/stasis-files.d.ts +5 -0
  98. package/common/stasis-files.js +20 -0
  99. package/common/stasis-tgz.d.ts +6 -0
  100. package/common/stasis-tgz.js +27 -0
  101. package/common/utf8.d.ts +3 -0
  102. package/common/utf8.js +45 -0
  103. package/common/whitespace-insensitive.js +19 -0
  104. package/common/workspace-app.js +91 -0
  105. package/common/workspace-groups.js +176 -0
  106. package/out/activity.js +2 -0
  107. package/out/brotli-fallback.js +3 -3
  108. package/out/chunk-2XUEZHIP.js +28 -0
  109. package/out/chunk-55YIWY3H.js +5 -0
  110. package/out/chunk-5AVGKFMR.js +1 -0
  111. package/out/chunk-5CJKUV53.js +1 -0
  112. package/out/chunk-5EAVJAD2.js +3 -0
  113. package/out/chunk-5M2X3QPK.js +6 -0
  114. package/out/chunk-5QWPKTCE.js +40 -0
  115. package/out/chunk-6CCSTJWB.js +1 -0
  116. package/out/chunk-6VOB5WXX.js +2 -0
  117. package/out/chunk-6Y6PZ2BU.js +9 -0
  118. package/out/chunk-74JZTGTO.js +11 -0
  119. package/out/chunk-7BKKYVWR.js +7 -0
  120. package/out/chunk-7C7DWL7I.js +1 -0
  121. package/out/chunk-7HP2VYIC.js +2 -0
  122. package/out/chunk-7YFJUT2P.js +1 -0
  123. package/out/chunk-7YO4QV5P.js +1 -0
  124. package/out/chunk-A4BBBHQU.js +1 -0
  125. package/out/chunk-B64CTMVU.js +4 -0
  126. package/out/chunk-BEKYZCPX.js +14 -0
  127. package/out/chunk-C4Z6ZBXV.js +10 -0
  128. package/out/chunk-CU3FPB3P.js +1 -0
  129. package/out/chunk-DEVAORP2.js +1 -0
  130. package/out/chunk-DUASGS2O.js +8 -0
  131. package/out/chunk-DUS5ARE2.js +53 -0
  132. package/out/chunk-EEJA7JBI.js +13 -0
  133. package/out/chunk-FSU2PLJL.js +1 -0
  134. package/out/chunk-GBMAXAYK.js +3 -0
  135. package/out/chunk-GO7FT4OD.js +1 -0
  136. package/out/chunk-GX5UXWT4.js +1 -0
  137. package/out/chunk-ITUKKCCK.js +10 -0
  138. package/out/chunk-IYPY47MC.js +1 -0
  139. package/out/chunk-JXBRWLMA.js +4 -0
  140. package/out/chunk-K4XJHM2T.js +1 -0
  141. package/out/chunk-LBD3M3J6.js +1 -0
  142. package/out/chunk-LVSLM7HB.js +1 -0
  143. package/out/chunk-LVW7WWV4.js +1 -0
  144. package/out/chunk-MV66NL3G.js +3 -0
  145. package/out/chunk-N57OWFKY.js +15 -0
  146. package/out/chunk-NRPC74AM.js +1 -0
  147. package/out/chunk-OOJM4CTU.js +1 -0
  148. package/out/chunk-OWSEQOL5.js +1 -0
  149. package/out/chunk-PKLVXUEI.js +11 -0
  150. package/out/chunk-PLGH63UC.js +2 -0
  151. package/out/chunk-PNHBZGDD.js +1 -0
  152. package/out/chunk-PTFYDJUP.js +1 -0
  153. package/out/chunk-PWFUOLZK.js +17 -0
  154. package/out/chunk-PXK7EU4V.js +1 -0
  155. package/out/chunk-QD3IBSF4.js +7 -0
  156. package/out/chunk-QI66YA4F.js +1 -0
  157. package/out/chunk-QRKFPLA4.js +80 -0
  158. package/out/chunk-R3NZFXVR.js +1 -0
  159. package/out/chunk-R5O6FAW4.js +2 -0
  160. package/out/chunk-RPNO56H2.js +1 -0
  161. package/out/chunk-SSPDMA6D.js +1 -0
  162. package/out/chunk-SZWPYLPC.js +1 -0
  163. package/out/chunk-TUII34K2.js +1 -0
  164. package/out/chunk-UJP4PQJA.js +1 -0
  165. package/out/chunk-UJSJMXEG.js +1 -0
  166. package/out/chunk-UR4WYMIP.js +1 -0
  167. package/out/chunk-VHEXSGGP.js +1 -0
  168. package/out/chunk-VYYUMYVW.js +9 -0
  169. package/out/chunk-VZPPX6MV.js +1 -0
  170. package/out/chunk-WCDYSIKG.js +1 -0
  171. package/out/chunk-XM4RLC4A.js +2 -0
  172. package/out/chunk-YKCRCNYZ.js +266 -0
  173. package/out/chunk-ZQHLECTI.js +1 -0
  174. package/out/client-managed-import.js +4 -0
  175. package/out/client-managed.js +37 -0
  176. package/out/client-sync.js +11 -17
  177. package/out/compare.js +26 -0
  178. package/out/dialogs.js +40 -0
  179. package/out/github-issue-authorized.html +3 -0
  180. package/out/github-issue-authorized.js +1 -0
  181. package/out/graph.js +19 -4
  182. package/out/index.html +104 -24
  183. package/out/prism.js +14 -10
  184. package/out/scan.js +2 -0
  185. package/out/stasis.svg +20 -0
  186. package/out/terminal.js +367 -39
  187. package/out/view.css +1 -1
  188. package/out/view.js +19 -147
  189. package/package.json +409 -64
  190. package/risk/actions/findings.js +161 -0
  191. package/risk/actions/resolve.js +287 -0
  192. package/risk/actions/scripts/commands.js +182 -0
  193. package/risk/actions/scripts/grade.js +113 -0
  194. package/risk/actions/scripts/packages.js +123 -0
  195. package/risk/actions/scripts/shell.js +169 -0
  196. package/risk/actions/uses.js +94 -0
  197. package/risk/actions/workflow.js +183 -0
  198. package/risk/files/characters.js +341 -0
  199. package/risk/files/hosts.js +206 -0
  200. package/risk/files/readability.js +185 -0
  201. package/risk/files/runs-code.js +563 -0
  202. package/risk/files/script.js +402 -0
  203. package/risk/files/source-map-link.js +43 -0
  204. package/risk/files/stamps.js +47 -0
  205. package/risk/index.d.ts +294 -0
  206. package/risk/index.js +12 -0
  207. package/risk/npm/assess.js +285 -0
  208. package/risk/npm/combined.js +68 -0
  209. package/risk/npm/compare.js +236 -0
  210. package/risk/npm/dependencies.js +172 -0
  211. package/risk/npm/diff.js +79 -0
  212. package/risk/npm/downloads.js +84 -0
  213. package/risk/npm/files.js +445 -0
  214. package/risk/npm/held.js +67 -0
  215. package/risk/npm/install-scripts.js +34 -0
  216. package/risk/npm/malware.js +38 -0
  217. package/risk/npm/manifest.js +65 -0
  218. package/risk/npm/new-dependency.js +60 -0
  219. package/risk/npm/old-version.js +108 -0
  220. package/risk/npm/registry.js +393 -0
  221. package/risk/npm/release.js +85 -0
  222. package/risk/npm/score.js +59 -0
  223. package/risk/npm/specs.js +124 -0
  224. package/risk/npm/tarball.js +169 -0
  225. package/server-common/database-config.ts +16 -0
  226. package/server-common/initialize.ts +18 -0
  227. package/server-common/npm-advisories.ts +101 -0
  228. package/{server → server-common}/origin.ts +5 -5
  229. package/server-common/reap.ts +48 -0
  230. package/server-common/scan-config.ts +19 -0
  231. package/server-common/standalone.ts +29 -0
  232. package/server-common/storage-crypto.ts +182 -0
  233. package/server-common/storage-log.ts +38 -0
  234. package/server-common/vercel-blob.ts +103 -0
  235. package/server-e2e/app.ts +487 -0
  236. package/{server → server-e2e}/bus-receiver.ts +2 -1
  237. package/{server → server-e2e}/cli.js +9 -4
  238. package/{server → server-e2e}/config.ts +50 -42
  239. package/{server → server-e2e}/db-neon.ts +2 -2
  240. package/{server → server-e2e}/db-revision-sql.ts +1 -1
  241. package/{server → server-e2e}/db-stmt.ts +2 -2
  242. package/{server → server-e2e}/db.ts +7 -7
  243. package/{server → server-e2e}/http.ts +44 -13
  244. package/{server → server-e2e}/hub.ts +40 -9
  245. package/server-e2e/index.ts +17 -0
  246. package/server-e2e/lifecycle.ts +95 -0
  247. package/{server → server-e2e}/neon-driver.ts +2 -2
  248. package/{server → server-e2e}/npm-proxy.ts +12 -145
  249. package/{server → server-e2e}/objstore/blob-vercel.ts +10 -114
  250. package/{server → server-e2e}/objstore/blob.ts +1 -1
  251. package/{server → server-e2e}/objstore/fetch-mint-guard.ts +2 -2
  252. package/{server → server-e2e}/objstore/handlers.ts +9 -8
  253. package/{server → server-e2e}/objstore/init.ts +19 -27
  254. package/{server → server-e2e}/objstore/reaper.ts +1 -1
  255. package/{server → server-e2e}/objstore/rest-deny.ts +1 -1
  256. package/{server → server-e2e}/objstore/rest-mint.ts +3 -3
  257. package/{server → server-e2e}/objstore/rest.ts +3 -3
  258. package/{server → server-e2e}/objstore/store-neon.ts +6 -10
  259. package/{server → server-e2e}/objstore/store.ts +7 -7
  260. package/{server → server-e2e}/objstore/tokens.ts +2 -2
  261. package/{server → server-e2e}/pubsub.ts +12 -9
  262. package/{server → server-e2e}/sign.ts +4 -4
  263. package/{server → server-e2e}/sse-server.ts +60 -33
  264. package/{server → server-e2e}/static.ts +18 -17
  265. package/{server → server-e2e}/sync-handlers.ts +64 -30
  266. package/{server → server-e2e}/ws-server.ts +20 -9
  267. package/server-managed/activity.ts +247 -0
  268. package/server-managed/agent-merges.ts +109 -0
  269. package/server-managed/app-agents.ts +23 -0
  270. package/server-managed/avatar-store.ts +13 -0
  271. package/server-managed/blob-store.ts +26 -0
  272. package/server-managed/brotli.ts +10 -0
  273. package/server-managed/bundle-advisories.ts +79 -0
  274. package/server-managed/bundle-advisory-inventory.ts +85 -0
  275. package/server-managed/bundle-build-diagnostics.d.ts +10 -0
  276. package/server-managed/bundle-build-diagnostics.js +23 -0
  277. package/server-managed/bundle-build-leases.ts +41 -0
  278. package/server-managed/bundle-build-worker.js +380 -0
  279. package/server-managed/bundle-build.ts +326 -0
  280. package/server-managed/bundle-cache.ts +261 -0
  281. package/server-managed/bundle-catalog.ts +29 -0
  282. package/server-managed/bundle-commits.ts +133 -0
  283. package/server-managed/bundle-dependency-reviews.ts +91 -0
  284. package/server-managed/bundle-store.ts +24 -0
  285. package/server-managed/bundle-summary-cache.ts +139 -0
  286. package/server-managed/bundle-validation.ts +33 -0
  287. package/server-managed/bundle.ts +151 -0
  288. package/server-managed/cache-storage.ts +20 -0
  289. package/server-managed/cli.js +21 -0
  290. package/server-managed/combined.ts +43 -0
  291. package/server-managed/comments.ts +138 -0
  292. package/server-managed/commit-coauthors.ts +105 -0
  293. package/server-managed/commit-lockfiles.ts +78 -0
  294. package/server-managed/comparison.ts +51 -0
  295. package/server-managed/config.ts +163 -0
  296. package/server-managed/content-access.ts +15 -0
  297. package/server-managed/crypto.ts +25 -0
  298. package/server-managed/db-methods.ts +1914 -0
  299. package/server-managed/db-neon.ts +398 -0
  300. package/server-managed/db-schema.ts +263 -0
  301. package/server-managed/db-table-names.ts +22 -0
  302. package/server-managed/db.ts +149 -0
  303. package/server-managed/dependabot-access.ts +61 -0
  304. package/server-managed/dependabot-alerts.ts +180 -0
  305. package/server-managed/dependency-review-comments.ts +143 -0
  306. package/server-managed/dependency-reviews.ts +369 -0
  307. package/server-managed/github-accounts.ts +59 -0
  308. package/server-managed/github-actions.ts +71 -0
  309. package/server-managed/github-app.ts +347 -0
  310. package/server-managed/github-errors.ts +92 -0
  311. package/server-managed/github-graphql.ts +42 -0
  312. package/server-managed/github-issue-links.ts +264 -0
  313. package/server-managed/github-issue-oauth.ts +30 -0
  314. package/server-managed/github-issues.ts +157 -0
  315. package/server-managed/github-link-oauth.ts +56 -0
  316. package/server-managed/github-links.ts +204 -0
  317. package/server-managed/github-metadata.ts +213 -0
  318. package/server-managed/github-oauth.ts +264 -0
  319. package/server-managed/github-pulls.ts +257 -0
  320. package/server-managed/github-requests.ts +181 -0
  321. package/server-managed/github-users.ts +30 -0
  322. package/server-managed/github-values.ts +26 -0
  323. package/server-managed/history-windows.ts +172 -0
  324. package/server-managed/http-response.ts +76 -0
  325. package/server-managed/http.ts +6324 -0
  326. package/server-managed/import-triage.ts +51 -0
  327. package/server-managed/index.ts +204 -0
  328. package/server-managed/kept-briefly.ts +37 -0
  329. package/server-managed/kept.ts +28 -0
  330. package/server-managed/link-reports.ts +149 -0
  331. package/server-managed/listed-activity.ts +39 -0
  332. package/server-managed/locked-packages.ts +234 -0
  333. package/server-managed/lockfile-scope.ts +58 -0
  334. package/server-managed/lru.ts +30 -0
  335. package/server-managed/managed-issues.ts +92 -0
  336. package/server-managed/management-catalog.ts +45 -0
  337. package/server-managed/management.ts +116 -0
  338. package/server-managed/npm-delta-worker.js +142 -0
  339. package/server-managed/npm-delta.ts +277 -0
  340. package/server-managed/npm-insights.ts +455 -0
  341. package/server-managed/npm-kept.ts +265 -0
  342. package/server-managed/npm-loads.ts +259 -0
  343. package/server-managed/npm-manifest.ts +117 -0
  344. package/server-managed/npm-packages.ts +469 -0
  345. package/server-managed/npm-patch-paths.ts +86 -0
  346. package/server-managed/npm-patch.ts +455 -0
  347. package/server-managed/npm-provenance.ts +127 -0
  348. package/server-managed/npm-risk.ts +287 -0
  349. package/server-managed/object-storage-disk.ts +147 -0
  350. package/server-managed/object-storage-vercel.ts +71 -0
  351. package/server-managed/object-storage.ts +82 -0
  352. package/server-managed/package-entry-points.ts +127 -0
  353. package/server-managed/pretty-copies.ts +22 -0
  354. package/server-managed/pretty-format.d.ts +3 -0
  355. package/server-managed/pretty-format.js +13 -0
  356. package/server-managed/pretty-print.ts +442 -0
  357. package/server-managed/public-workspace.ts +243 -0
  358. package/server-managed/pull-comment-reviews.ts +161 -0
  359. package/server-managed/pull-dependencies.ts +370 -0
  360. package/server-managed/pull-dependency-reviews.ts +407 -0
  361. package/server-managed/pull-reviews.ts +202 -0
  362. package/server-managed/queue.ts +54 -0
  363. package/server-managed/release-commits.ts +85 -0
  364. package/server-managed/rename-diff-worker.js +30 -0
  365. package/server-managed/rename-diff.ts +237 -0
  366. package/server-managed/repo-path.ts +21 -0
  367. package/server-managed/report-migration.ts +32 -0
  368. package/server-managed/report-opening.ts +77 -0
  369. package/server-managed/report-query.ts +10 -0
  370. package/server-managed/report-response.ts +16 -0
  371. package/server-managed/report-sources.ts +185 -0
  372. package/server-managed/report-store.ts +77 -0
  373. package/server-managed/repository-actions.ts +220 -0
  374. package/server-managed/repository-agents.ts +422 -0
  375. package/server-managed/repository-aliases.ts +119 -0
  376. package/server-managed/repository-browser.ts +361 -0
  377. package/server-managed/repository-changes.ts +280 -0
  378. package/server-managed/repository-code.ts +222 -0
  379. package/server-managed/repository-dependency-reviews.ts +182 -0
  380. package/server-managed/repository-discovery.ts +83 -0
  381. package/server-managed/repository-history.ts +428 -0
  382. package/server-managed/repository-issues.ts +293 -0
  383. package/server-managed/repository-policy.ts +27 -0
  384. package/server-managed/repository-pulls.ts +207 -0
  385. package/server-managed/repository-pulse.ts +477 -0
  386. package/server-managed/repository-risk-assess.ts +108 -0
  387. package/server-managed/repository-risk-audit.ts +78 -0
  388. package/server-managed/repository-risk-caches.ts +37 -0
  389. package/server-managed/repository-risk-read.ts +260 -0
  390. package/server-managed/repository-risk-stasis.ts +61 -0
  391. package/server-managed/repository-risk-turn.ts +97 -0
  392. package/server-managed/repository-risk.ts +516 -0
  393. package/server-managed/repository-squashes.ts +160 -0
  394. package/server-managed/repository-stamp.ts +41 -0
  395. package/server-managed/request-timing.ts +63 -0
  396. package/server-managed/reviewed-dependencies.ts +170 -0
  397. package/server-managed/revisions.ts +35 -0
  398. package/server-managed/scan-downloads.ts +121 -0
  399. package/server-managed/session.ts +132 -0
  400. package/server-managed/slugs.ts +38 -0
  401. package/server-managed/solidity-entry-points.ts +71 -0
  402. package/server-managed/sql-postgres.ts +34 -0
  403. package/server-managed/sql.ts +107 -0
  404. package/server-managed/stasis-config.ts +147 -0
  405. package/server-managed/stasis-dependencies.ts +221 -0
  406. package/server-managed/static.ts +28 -0
  407. package/server-managed/storage-command.ts +16 -0
  408. package/server-managed/storage-db.ts +183 -0
  409. package/server-managed/storage-encryption.ts +288 -0
  410. package/server-managed/storage-maintenance.ts +259 -0
  411. package/server-managed/storage-payload.ts +121 -0
  412. package/server-managed/storage-stores.ts +91 -0
  413. package/server-managed/storage.ts +82 -0
  414. package/server-managed/team-app-summaries.ts +56 -0
  415. package/server-managed/team-app.ts +156 -0
  416. package/server-managed/team-catalog.ts +7 -0
  417. package/server-managed/team-feed.ts +180 -0
  418. package/server-managed/team-npm-scopes.ts +103 -0
  419. package/server-managed/team-reports.ts +368 -0
  420. package/server-managed/triage-response.ts +16 -0
  421. package/server-managed/type-only-proof.js +161 -0
  422. package/server-managed/type-only-worker.js +31 -0
  423. package/server-managed/type-only.ts +135 -0
  424. package/server-managed/uploads.ts +106 -0
  425. package/server-managed/upstream-cache.ts +256 -0
  426. package/server-managed/view-as.ts +58 -0
  427. package/server-managed/worker-turns.ts +76 -0
  428. package/server-managed/workspace-shares.ts +170 -0
  429. package/server.ts +70 -0
  430. package/strip-types-loader.js +13 -10
  431. package/server/index.ts +0 -480
  432. package/server/lifecycle.ts +0 -208
  433. /package/{LICENSE → LICENSE-MIT} +0 -0
  434. /package/{server → server-e2e}/auth.ts +0 -0
  435. /package/{server → server-e2e}/config.example.json +0 -0
  436. /package/{server → server-e2e}/objstore/blob-fs.ts +0 -0
  437. /package/{server → server-e2e}/objstore/fs.ts +0 -0
  438. /package/{server → server-e2e}/objstore/sign.ts +0 -0
  439. /package/{server → server-e2e}/peer.ts +0 -0
  440. /package/{server → server-e2e}/sse-session.ts +0 -0
  441. /package/{server → server-e2e}/util.ts +0 -0
  442. /package/{server → server-e2e}/validation.ts +0 -0
@@ -0,0 +1,5 @@
1
+ import{a as e,e as t}from"./chunk-UJSJMXEG.js";import{A as n,B as r,C as i,E as a,F as o,G as s,H as c,M as l,O as u,Q as ee,S as d,a as f,d as p,e as m,f as te,i as ne,m as h,n as g,o as re,p as ie,q as _,r as v,u as ae,v as oe,x as y,z as se}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{d as b,e as ce,f as x,g as le,h as S,i as C,j as ue,l as de,m as fe}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";function w(e,t=new Set){if(t.has(e))return;t.add(e);let{parent:n}=e;if(n===void 0)return;let r=w(n,t);return r===void 0?n.bundleDependencies?.includes(e.folder)||e.edgesIn.some(e=>w(e.from,t)===n)?n:void 0:r}var pe=({parent:e})=>e!==void 0&&(e.bundleDependencies!==void 0||pe(e)),me=e=>pe(e)?w(e):void 0;function he(e,t){let n=me(e);return n!==void 0&&n!==t}function ge(e,t){let n=me(e);if(e.inBundle!==(n!==void 0))throw new b(n===void 0?`set, where nothing bundles it`:`expected true, as ${S(n.location)} bundles it`,C(e.where,`inBundle`));let{resolution:r}=e;if(n===void 0||n===t){if(r===void 0)throw new b(`expected where it comes from, resolved or an integrity`,e.where)}else if(r!==void 0){let t=r.type===`git`||r.tarball!==void 0?`resolved`:`integrity`;throw new b(`npm takes it from the tarball of ${S(n.location)}, and from nothing else`,C(e.where,t))}}function _e(e){let t=e.get(``);for(let n of e.values())n.kind===`package`&&ge(n,t)}var T=e=>e?.endsWith(`.git`)?e.slice(0,-4):e;function E(e,t,n){let r=T(t);return e&&r?{user:e,project:r,committish:n}:void 0}var ve=e=>t=>{let[,n,r,i]=t.pathname.split(`/`,4);return i===e?void 0:E(n,r,t.hash.slice(1))},D={__proto__:null,github:{protocols:[`git:`,`http:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`github.com`,extract:e=>{let[,t,n,r,i]=e.pathname.split(`/`,5);if(!(r&&r!==`tree`))return E(t,n,r?i:e.hash.slice(1))}},bitbucket:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`bitbucket.org`,extract:ve(`get`)},gitlab:{protocols:[`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gitlab.com`,extract:e=>{let t=e.pathname.slice(1);if(t.includes(`/-/`)||t.includes(`/archive.tar.gz`))return;let n=t.split(`/`),r=n.pop();return E(n.join(`/`),r,e.hash.slice(1))}},gist:{protocols:[`git:`,`git+ssh:`,`git+https:`,`ssh:`,`https:`],domain:`gist.github.com`,extract:e=>{let[,t,n,r]=e.pathname.split(`/`,4);if(r!==`raw`&&(t||n))return{user:n?t:null,project:T(n||t),committish:e.hash.slice(1)}}},sourcehut:{protocols:[`git+ssh:`,`https:`],domain:`git.sr.ht`,extract:ve(`archive`)}},ye=new Map(Object.entries(D).map(([e,t])=>[t.domain,e])),be=new Map(Object.keys(D).map(e=>[`${e}:`,e])),xe=new Set([`git+ssh:`,`ssh:`,`git+https:`,`git:`,`http:`,`https:`,`git+http:`,...be.keys()]);function Se(e){let t=e.indexOf(`#`),n=e=>e===-1||t>-1&&e>t,r=e.indexOf(`/`);return n(e.search(/\s/u))&&r>0&&(t>-1?e[t-1]!==`/`:!e.endsWith(`/`))&&!e.startsWith(`.`)&&n(e.indexOf(`@`))&&n(e.indexOf(`:`))&&n(e.indexOf(`/`,r+1))}var O=(e,t,n)=>{let r=e.indexOf(n);return e.lastIndexOf(t,r>-1?r:1/0)};function Ce(e){let t=e.indexOf(`:`);if(xe.has(e.slice(0,t+1))||e.slice(t,t+3)===`://`)return e;let n=e.indexOf(`@`);return n>-1?n>t?`git+ssh://${e}`:e:`${e.slice(0,t+1)}//${e.slice(t+1)}`}function we(e){let t=e,n=O(t,`:`,`#`);return n>O(t,`@`,`#`)&&(t=`${t.slice(0,n)}/${t.slice(n+1)}`),O(t,`:`,`#`)===-1&&!t.includes(`//`)&&(t=`git+ssh://${t}`),t}var k=e=>e&&decodeURIComponent(e);function Te(e){let t=e.pathname.startsWith(`/`)?e.pathname.slice(1):e.pathname,n=t.indexOf(`@`);n>-1&&(t=t.slice(n+1));let r=t.lastIndexOf(`/`),i=T(k(t.slice(r+1)));return{user:r>-1&&k(t.slice(0,r))||null,project:i,committish:k(e.hash.slice(1))||null}}function A(e){if(!e)return;let t=Ce(Se(e)?`github:${e}`:e),n=URL.parse(t)??URL.parse(we(t));if(n===null)return;let r=be.get(n.protocol),i=r??ye.get(n.hostname.replace(/^www\./u,``));if(i!==void 0)try{if(r!==void 0)return{type:i,...Te(n)};if(!D[i].protocols.includes(n.protocol))return;let e=D[i].extract(n);return e===void 0?void 0:{type:i,user:k(e.user),project:k(e.project),committish:k(e.committish)||null}}catch(e){if(e instanceof URIError)return;throw e}}function Ee({type:e,user:t,project:n,committish:r},i){let a=i&&r?`#${r}`:``;return e===`gist`?`git@${D[e].domain}:${n}.git${a}`:`git@${D[e].domain}:${t}/${n}.git${a}`}var De=/^(?:[Gg][Ii][Tt]\+)?[A-Za-z]+:/u,Oe=/^[^@]+@[^.:]+\.[^:]+:.+$/iu,j=/\.(?:tgz|tar\.gz|tar)$/iu,ke=e=>j.test(e),M=/^git(?:\+(?:https?|rsync|ftp|ssh))?:/u,N=(e,t)=>new b(`${S(e)} is ${t}`);function Ae(e,t){let n=j.test(e)?`file`:`directory`;if(/^file:/iu.test(e)&&!e.startsWith(`file:`))throw N(e,`a path whose "file:" npm reads in another case otherwise`);let r=e.startsWith(`file:`)?e.slice(5):e;if(/^(?:[/~]|[A-Za-z]:)/u.test(r))throw N(e,`a path from the root, a drive or the home directory, which a lockfile does not hold`);return{type:n,path:o(t,r)}}function P(e,t){let n={committish:null,range:null};for(let r of t?t.split(`::`):[]){let[t,i]=r.includes(`:`)?r.split(`:`):[void 0,r];if(t===`path`)throw N(e,`a subdirectory of a repository, which is not supported`);if(t!==void 0&&t!==`semver`)throw N(e,`a git spec with ${S(t)}, which npm passes over`);if(n.committish!==null||n.range!==null)throw N(e,`a git spec with two refs or ranges, which npm refuses`);t===void 0?n.committish=i:n.range=je(e,i)}return n}var je=(e,t)=>x(()=>decodeURIComponent(t),()=>{throw N(e,`a git spec npm cannot decode`)});function Me(e){let t=e.startsWith(`git+ssh:`)?/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/iu.exec(e):null;if(t!==null&&!/:\d+(?:\/|$)/u.test(t[1]))return{type:`git`,hosted:void 0,fetchSpec:t[1],...P(e,t[2])};let n=URL.parse(e);if(n===null)throw N(e,`not a URL npm reads`);if(n.protocol===`http:`||n.protocol===`https:`)return{type:`remote`,url:e};if(!M.test(n.protocol))throw N(e,`of a protocol npm does not read, ${S(n.protocol)}`);let r=P(e,n.hash.slice(1));return n.hash=``,{type:`git`,hosted:void 0,fetchSpec:n.href.replace(/^git\+/u,``),...r}}function Ne(e,t,n){let r=t.trim();if(n===void 0)return{type:`registry`,name:e,fetchSpec:r,kind:void 0};let i=`tag`;if(n.valid(r,!0)===null?n.validRange(r,!0)!==null&&(i=`range`):i=`version`,i===`tag`&&encodeURIComponent(r)!==r)throw N(t,`a tag npm refuses, of a character a URL escapes`);return{type:`registry`,name:e,fetchSpec:r,kind:i}}function F(e,t,n,r){if(/^(?:file:|[.]|~\/|\/|[A-Za-z]:)/iu.test(t))return Ae(t,n);if(/^npm:/iu.test(t))return Fe(t,n,r);let i=A(t);return i===void 0?De.test(t)?Me(t):t.includes(`/`)||j.test(t)?Ae(t,n):Ne(e,t,r):{type:`git`,hosted:i,fetchSpec:void 0,...P(t,i.committish)}}function Pe(e,t,n){let r=e.indexOf(`@`,1),i=r>0?e.slice(0,r):e;return De.test(e)?F(void 0,e,t,n):Oe.test(e)?F(void 0,`git+ssh://${e}`,t,n):!i.startsWith(`@`)&&(i.includes(`/`)||j.test(i))?F(void 0,e,t,n):F(y(i,void 0),r>0&&e.slice(r+1)||`*`,t,n)}function Fe(e,t,n){let r=Pe(e.slice(4),t,n);if(r.type===`alias`)throw N(e,`an alias of an alias, which npm refuses`);if(r.type!==`registry`||r.name===void 0)throw N(e,`an alias of no package of the registry, which npm refuses`);return{type:`alias`,sub:r}}var I=(e,t,n,r)=>F(e,t||`*`,n,r),Ie=e=>F(void 0,e,`.`,void 0),L=[`dev`,`optional`,`devOptional`,`peer`],Le=[`name`,`version`,`dependencies`,`optionalDependencies`,`peerDependencies`,`peerDependenciesMeta`,`bundleDependencies`,`acceptDependencies`,`funding`,`engines`,`os`,`cpu`,`libc`,`license`,`hasInstallScript`,`bin`,`deprecated`,`workspaces`,...L],Re={link:[`link`,`resolved`],importer:[...Le,`devDependencies`],package:[...Le,`resolved`,`integrity`,`inBundle`]},ze={hasShrinkwrap:`a shrinkwrap of its own, which is not supported`,extraneous:`nothing leads to it, and npm prunes it rather than install it`};function R(e,t){if(typeof e==`object`&&e&&Object.keys(e).length===0)throw new b(`expected what npm writes, which leaves an empty ${Array.isArray(e)?`sequence`:`mapping`} out`,t);return e}var Be=e=>(t,n)=>ie(R(t,n),n,e),z=(e,t)=>_(R(e,t),t,y),Ve=(e,t)=>y(g(e,t),t),He=(e,t)=>re(R(e,t),t,y),B=(e,t)=>re(R(e,t),t),V=e=>(t,n)=>Array.isArray(t)?B(t,n):e(t,n),Ue=Be((e,t,n)=>(y(n,t),{optional:h(m(e,t),`optional`,t,ne)??!1}));function We(e,t){return typeof e==`string`?g(e,t):(m(R(e,t),t),{type:h(e,`type`,t,g),url:h(e,`url`,t,g)})}var Ge=(e,t)=>Array.isArray(e)?R(e,t).map((e,n)=>We(e,`${t}[${n}]`)):We(e,t);function Ke(e,t,i){if(!n(i)||/[/:]/u.test(i))throw new b(`${S(i)} is not the name of a bin, as npm writes one`,t);if(!r(g(e,t).replace(/\/$/u,``)))throw new b(`${S(e)} is not a path within the package, as npm writes a bin's`,t);return e}var qe=V((e,t)=>(m(R(e,t),t,[`packages`,`nohoist`]),h(e,`nohoist`,t,B),B(e.packages,C(t,`packages`)))),Je={__proto__:null,dependencies:z,optionalDependencies:z,peerDependencies:z,devDependencies:(e,t)=>_(e,t,y),peerDependenciesMeta:Ue,acceptDependencies:z,bundleDependencies:He,funding:Ge,engines:V((e,t)=>_(R(e,t),t)),os:B,cpu:B,libc:B,license:V(g),bin:Be(Ke),deprecated:g,workspaces:qe};function Ye(e,t){let n=Object.fromEntries(L.map(n=>[n,v(e[n],C(t,n))]));if(n.devOptional&&(n.dev||n.optional))throw new b(`set beside dev or optional, where npm leaves it out`,C(t,`devOptional`));return n}var Xe=(e,t)=>u(e,t)&&e;function Ze(e,t,n,r){if(e.startsWith(`file:`)){if(!ke(e))throw new b(`${S(e)} is a directory, which npm packs again at every install: not supported`,r);i(e.slice(5),r)}else{if(!ee(e))throw new b(`${S(e)} is not an http(s) URL, a file: tarball or a git URL`,r);if(A(e)!==void 0)throw new b(`${S(e)} is a repository to npm, which it reads as one on a git host`,r);d(e,t,n,r)}}function Qe(e,t,n,r){let i=C(t,`resolved`),a=h(e,`resolved`,t,g),o=h(e,`integrity`,t,Xe);if(a===void 0)return o===void 0?void 0:{type:`tarball`,tarball:void 0,integrity:o};if(M.test(a)){if(o!==void 0)throw new b(`an integrity, which npm does not check for a git repository`,C(t,`integrity`));let e=a.lastIndexOf(`#`);if(e===-1||!c(a.slice(e+1)))throw new b(`expected a full commit hash after the "#" of ${S(a)}`,i);return{type:`git`,repo:l(a.slice(0,e),i),commit:a.slice(e+1)}}if(Ze(a,n,r,i),o===void 0)throw new b(`expected an integrity, which npm checks the tarball with`,t);return{type:`tarball`,tarball:a,integrity:o}}function $e(e){let t=e.split(`/`),n=t.at(-1);return t.at(-2)?.startsWith(`@`)?`${t.at(-2)}/${n}`:n}function et(e,t){if(m(e,t,Re.link,ze),e.link!==!0)throw p(`true`,e.link,C(t,`link`));return e.resolved===``?``:i(e.resolved,C(t,`resolved`))}function tt(e,t,n,r){m(e,t,Re[n],ze);let i=Object.create(null);for(let[n,r]of Object.entries(Je))i[n]=h(e,n,t,r);if(n===`importer`&&r!==void 0&&i.bundleDependencies!==void 0)throw new b(`a bundle of a directory, which is not supported`,C(t,`bundleDependencies`));let a=h(e,`name`,t,Ve);if(a!==void 0&&a===r)throw new b(`the name of its folder, which npm leaves out`,C(t,`name`));let o=h(e,`version`,t,n===`package`?se:g);if(n===`package`&&o===void 0&&!M.test(e.resolved??``))throw new b(`expected a version, which only a package from a git repository is read without`,C(t,`version`));let s={name:a??r,version:o,...i,hasInstallScript:v(e.hasInstallScript,C(t,`hasInstallScript`)),flags:Ye(e,t)};return n===`package`&&(s.resolution=Qe(e,t,s.name,o),s.inBundle=v(e.inBundle,C(t,`inBundle`))),s}var H=`packages`,nt=/^(?:(.+)\/)?node_modules\/((?:@[^/]+\/)?[^/]+)$/u;function rt(e,t){if(e===``)return{kind:`root`,parent:void 0,folder:void 0};i(e,t);let n=nt.exec(e);if(n!==null){if(n[2]===`node_modules`)throw new b(`a folder named "node_modules", which no package is`,t);return{kind:`package`,parent:n[1]??``,folder:y(n[2],t)}}let r=e.split(`/`);if(r.includes(`node_modules`))throw new b(`in a node_modules, but none of its packages`,t);if(r.every(e=>e===`..`))throw new b(`a directory the project is in, which is not supported`,t);return{kind:`importer`,parent:void 0,folder:$e(e)}}function it(e,t,n){let{kind:r,parent:i,folder:a}=rt(e,n),o={location:e,where:n,kind:r,parentLocation:i,folder:a,parent:void 0,fsParent:void 0,children:new Map,links:[],edges:new Map,edgesIn:[]};if(t?.link===void 0)return Object.assign(o,tt(t,n,r===`package`?`package`:`importer`,a));if(r!==`package`)throw new b(`a link outside a node_modules, where npm writes none`,n);return Object.assign(o,{kind:`link`,targetLocation:et(t,n),target:void 0})}function at(e,t){let n=t.get(e.parentLocation);if(n===void 0)throw new b(`in the node_modules of ${S(e.parentLocation)}, which the lockfile does not have`,e.where);if(n.kind===`link`)throw new b(`in the node_modules of ${S(e.parentLocation)}, a link, in which npm installs nothing`,e.where);let r=e.folder.toLowerCase(),i=n.children.get(r);if(i!==void 0)throw new b(`in the folder of ${S(i.location)} to npm, which takes names in one case`,e.where);n.children.set(r,e),e.parent=n}function ot(e,t){let n=t.get(e.targetLocation),r=C(e.where,`resolved`);if(n===void 0)throw new b(`${S(e.targetLocation)} is not in the lockfile, where npm looks for what a link leads to`,r);if(n.kind===`link`)throw new b(`${S(e.targetLocation)} is a link, where npm links the project, a directory or a package`,r);e.target=n,n.links.push(e)}function st(e,t){let n=e.location.split(`/`);for(;n.pop()!==void 0&&n.at(-1)!==`..`;){let e=t.get(n.join(`/`));if(e!==void 0)return e}}var U=e=>e.parent??e.fsParent,W=e=>e.kind===`link`?e.target:e,G=e=>e.location||`.`;function ct(e,t){let n=t.toLowerCase();for(let t=e;t!==void 0;t=U(t)){let e=t.children.get(n);if(e!==void 0)return e}}function lt(e){let t=new Map;for(let[n,r,i]of te(e,H))t.set(n,it(n,r,i));t.has(``)||t.set(``,it(``,Object.create(null),C(H,``)));for(let e of t.values())e.parentLocation!==void 0&&at(e,t),e.kind===`link`&&ot(e,t);for(let e of t.values())if(e.kind===`importer`){if(e.links.length===0)throw new b(`a directory no link leads to, of which npm installs nothing`,e.where);e.fsParent=st(e,t)}return t}function ut(n){let r=n.get(``),i=C(r.where,`workspaces`),a=new Map;for(let[o,s]of(r.workspaces??[]).entries()){let r=e(s.replace(/^\.?\/+/u,``),`${i}[${o}]`);for(let e of n.values()){if(e.kind!==`importer`||a.get(e.name)===e||!t(r,e.location))continue;let n=y(e.name,C(e.where,`name`));if(a.has(n))throw new b(`the name of the workspace ${S(a.get(n).location)} too, of which npm keeps one`,e.where);a.set(n,e)}}return a}var dt={__proto__:null,workspace:`workspaces`,peer:`peerDependencies`,peerOptional:`peerDependencies`,prod:`dependencies`,optional:`optionalDependencies`,dev:`devDependencies`},ft=e=>e.type===`workspace`?C(e.from.where,`workspaces`):C(C(e.from.where,dt[e.type]),e.name);function pt(e,t,n){let r=(t,n,r)=>{let i=t.toLowerCase(),a=e.edges.get(i);if(a?.type===`workspace`)return;let o={name:t,type:n,spec:r,accept:e.acceptDependencies?.[t],from:e,to:void 0};if(a!==void 0&&a.name!==t)throw new b(`${S(a.name)} too, to npm, which takes names in one case`,ft(o));e.edges.delete(i),e.edges.set(i,o)};if(e.kind===`root`)for(let[e,{location:n}]of t)r(e,`workspace`,`file:${n}`);let i=e.peerDependenciesMeta??Object.create(null),a=n?[]:Object.entries(e.peerDependencies??{});for(let[e,t]of a)i[e]?.optional||r(e,`peer`,t);for(let[e,t]of a)i[e]?.optional&&r(e,`peerOptional`,t);for(let t of e.parent===void 0?[`prod`,`optional`,`dev`]:[`prod`,`optional`])for(let[n,i]of Object.entries(e[dt[t]]??{}))r(n,t,i)}function mt(e,t,n){for(let r of e.values())r.kind!==`link`&&pt(r,t,n);for(let t of e.values())for(let e of t.edges.values())e.to=ct(t,e.name),e.to?.edgesIn.push(e)}var K=[...L,`extraneous`],ht=e=>new Map([...e.values()].map(e=>[e,Object.fromEntries(K.map(t=>[t,e.kind!==`root`]))]));function gt(e,t,n){if(!e.get(t)[n])for(let r=U(t);r!==void 0&&e.get(r)[n];r=U(r))e.get(r)[n]=!1}function _t(e,t){let[n,r,i]=[t===`dev`,t===`optional`||t===`peerOptional`,t.startsWith(`peer`)];return{extraneous:!e.extraneous&&!(i&&r),dev:!e.dev&&!n,optional:!e.optional&&!r,devOptional:!e.devOptional&&!e.dev&&!e.optional&&!n&&!r,peer:!e.peer&&!i}}function vt(e,t){let n=ht(e),r=new Set,i=[e.get(``)];for(;i.length>0;){let e=i.pop();r.add(e);let a=n.get(e);if(gt(n,e,`extraneous`),e.kind===`link`){let o=n.get(e.target),s=K.filter(e=>o[e]&&!a[e]);if(t)Object.assign(o,a);else for(let e of s)o[e]=!1;(t||s.length>0||!r.has(e.target))&&i.push(e.target)}else for(let{type:t,to:r}of e.edges.values()){if(r===void 0)continue;let e=_t(a,t),o=n.get(r),s=K.filter(t=>o[t]&&e[t]);for(let e of s)o[e]=!1;s.length>0&&i.push(r)}}return n}function yt(e,t,n){let r=[e],i=new Set;for(;r.length>0;){let e=r.pop();i.has(e)||(i.add(e),r.push(...n(e,t(e))))}}function bt(e){let t=ht(e),n=(e,n)=>{if(!t.get(e)[n])return;let r=e=>Object.assign(t.get(e),{extraneous:!1,[n]:!1});yt(e,e=>{r(e),e.kind===`link`&&r(e.target)},e=>[...W(e).edges.values()].filter(({type:e,to:r})=>r!==void 0&&t.get(r)[n]&&(n!==`peer`&&e===`peer`||e===`prod`)).map(({to:e})=>e))},r=e=>{let i=t.get(e);i.extraneous=!1;for(let n of K)gt(t,e,n);if(e.kind===`link`){for(let n of L)t.get(e.target)[n]=i[n];return r(e.target)}for(let{type:r,to:a}of e.edges.values()){if(a===void 0)continue;t.get(a).extraneous=!1;let e=_t(i,r);for(let t of[`peer`,`devOptional`,`dev`,`optional`])e[t]&&n(a,t)}return e};return yt(e.get(``),r,(e,t)=>[...t.edges.values()].map(({to:e})=>e).filter(e=>e!==void 0)),t}function xt(e,t,n){for(let r of e.values()){let e=t.get(r);if(e.extraneous)return new b(`nothing installed leads to it, so ${n} takes it as extraneous, and prunes it`,r.where);if(r.kind===`link`)continue;let i={...e,devOptional:e.devOptional&&!e.dev&&!e.optional},a=L.find(e=>r.flags[e]!==i[e]);if(a!==void 0)return new b(`expected ${i[a]?`true`:`none`}, as ${n} sets it from what depends on it`,C(r.where,a))}}var q=[e=>vt(e,!1),e=>vt(e,!0),bt];function St(e){let[t,n,r]=e.split(`.`).map(Number);return t>11||t===11&&n>=18?q[0]:q[t===11&&(n>6||n===6&&r>=3)?1:2]}function Ct(e,t,n=t===void 0?`npm`:`npm ${t}`){let r=xt(e,(t===void 0?q[0]:St(t))(e),n);if(r!==void 0&&(t!==void 0||q.slice(1).every(t=>xt(e,t(e),`npm`)!==void 0)))throw r}var wt=64;function J(e,t){if(typeof e!=`object`||!e)return e;if(t>wt)throw new b(`nested more than ${wt} deep, as npm writes nothing`);if(Array.isArray(e))return e.map(e=>J(e,t+1));let n=Object.create(null);for(let[r,i]of Object.entries(e))n[r]=J(i,t+1);return n}function Tt(e,t){let n=e.split(`
2
+ `),r=t.split(`
3
+ `),i=0;for(;n[i]===r[i];)i++;if(i===r.length-1&&i===n.length)return ue(`expected a line end after the last "}"`,i-1);let a=i<n.length?S(n[i]):`the end of the file`;return ue(`expected ${i<r.length?S(r[i]):`the end of the file`}, as npm writes it, found ${a}`,i)}function Et(e){de(e,`npm`);let[t,n]=fe(e,`npm`),r=x(()=>JSON.parse(e),e=>ce(`not JSON: ${e.message}`)),i=J(r,0),a=`${JSON.stringify(r,null,n)}
4
+ `.replaceAll(`
5
+ `,t);if(a!==e)throw Tt(e,a);return i}var Dt=/^[\dA-Fa-f]{40,64}$/u;function Ot(e){let t=e.resolution?.tarball;return t?.startsWith(`file:`)?a(t.slice(5),`..`):G(e)}var Y=e=>S(e.location);function kt(e,{fetchSpec:t,kind:n},r){if(n===void 0||n===`range`&&t===`*`)return;if(n===`tag`)return e.kind===`link`||!/^https?:/u.test(e.resolution?.tarball??``)?`is a tag, which npm holds met by a tarball from a URL alone, and ${Y(e)} is none`:void 0;let{version:i}=W(e);return r.satisfies(i??``,t,!0)?void 0:`is not satisfied by ${Y(e)}, ${i??`of no version`}`}function At(e,t,n){let{resolution:r,version:i}=e;if(e.kind===`link`||r?.type!==`git`)return`asks for a git repository, and ${Y(e)} is from none`;let a=Ie(`${r.repo}#${r.commit}`),o=Dt.test(t.committish??``);if(!(t.hosted===void 0?a.hosted===void 0&&a.fetchSpec===t.fetchSpec:a.hosted!==void 0&&Ee(t.hosted,o)===Ee(a.hosted,o)))return`asks for another repository than ${Y(e)} is from${o?`, or another commit`:``}`;if(!(t.range===null||n===void 0||n.satisfies(i??``,t.range,!0)))return`asks for a version of the repository ${Y(e)} is not, ${i??`of no version`}`}function jt(e,t,n){switch(t.type){case`registry`:return kt(e,t,n);case`alias`:return kt(e,t.sub,n);case`directory`:return e.kind===`link`&&G(e.target)===t.path?void 0:`asks for a link to ${S(t.path)}, and ${Y(e)} is ${e.kind===`link`?`one to ${S(G(e.target))}`:`no link`}`;case`file`:case`remote`:{let n=t.type===`file`?`file:${t.path}`:t.url;return e.kind!==`link`&&e.resolution?.tarball===n?void 0:`asks for the tarball ${S(n)}, and ${Y(e)} is from another`}default:return At(e,t,n)}}function Mt(e,t){let{name:n}=W(e);if(t.type===`alias`&&n!==t.sub.name)return`asks for ${S(t.sub.name)}, and ${Y(e)} is ${S(n)}, which npm does not check`;let{committish:r}=t;if(t.type===`git`&&Dt.test(r??``)&&r.toLowerCase()!==e.resolution.commit)return`asks for another commit than ${Y(e)} is of, which npm does not check of a repository on no host it knows`}function Nt(e,t,n){let{from:r,to:i,spec:a}=e;if(e.type.startsWith(`peer`)&&i.parent===r&&r.parent!==void 0)return`${S(a)} is met in the node_modules of the package that asks for it, which npm holds a peer not to be`;if(i.folder!==e.name)return`is met by ${Y(i)}, which npm takes for it, though the names are in other cases`;let o=a=>{let o=I(e.name,a,Ot(r),t);return jt(i,o,t)??(n?Mt(i,o):void 0)},s=o(a);if(!(s===void 0||e.accept!==void 0&&o(e.accept)===void 0))return`${S(a)} ${s}, so npm would install another`}function Pt(e,t){return x(()=>Nt(e,t,!1)===void 0,e=>{if(e instanceof b)return!1;throw e})}function Ft(e,t){if(e.type===`peerOptional`)return;let n=ft(e);if(e.to===void 0)throw new b(`${S(e.spec)} is met by nothing where npm looks for ${S(e.name)}, so npm would install it`,n);let r=le(()=>Nt(e,t,!0),n);if(r!==void 0)throw new b(r,n)}function It(e,t){let n=new Set([e.get(``)]);for(let e of n){let r=new Set(e.kind===`package`?e.bundleDependencies:[]);for(let i of e.edges.values()){r.has(i.name)||Ft(i,t);let e=i.to===void 0?void 0:W(i.to);e!==void 0&&!e.location.startsWith(`../`)&&n.add(e)}}}var Lt=[`version`,`resolved`,`integrity`,`bundled`,...L,`requires`,`dependencies`,`from`],X=e=>e.location===``?`the project`:S(e.location);function Rt(e){let[t,n,r]=e.split(`.`).map(Number);return t===9||t===10&&(n<9||n===9&&r<=2)||t===11&&n<2}function zt(e,t){let n=[],r;for(let i of e.edgesIn){let e=i.from.location.split(`node_modules`),a=[e.length,e.at(-1)],o=r===void 0?-1:a[0]-r[0]||a[1].localeCompare(r[1],`en`);o>0||!Pt(i,t)||(o<0?[n,r]=[[i],a]:n.push(i))}return n}function Bt(e,t){let n=s(e,t);return`file:${n===`.`?``:n}`}function Vt(e,t){let n=G(t.from),r=I(e.folder,t.spec,n,void 0),i=`${e.folder}@${t.spec}`;return r.type===`file`?{type:`file`,save:Bt(n,r.path),raw:i}:r.type===`remote`?{type:`remote`,save:r.url,raw:i}:{type:r.type,raw:i}}function Ht(e,t,n){if(e.kind===`link`)return{version:`file:${n(e.target.location)}`};let{resolution:r}=e,i=r?.type===`git`?`${r.repo}#${r.commit}`:r?.tarball,a;r?.type===`git`?a=`git`:i!==void 0&&(a=i.startsWith(`file:`)?`file`:`remote`);let o=t===void 0?{type:a,save:i,raw:i}:Vt(e,t);return o.type===`file`||o.type===`remote`?{version:o.save}:o.type===`git`||a===`git`?{version:i,from:o.raw}:{version:e.name===e.folder?e.version:`npm:${e.name}@${e.version}`,resolved:a===`remote`?i:void 0}}var Ut=e=>[...new Map(e.map(e=>[JSON.stringify(e),e])).values()];function Z(e,t,n,r){if(e===t)return;let i=t===void 0?`none`:typeof t==`string`?S(t):String(t);throw new b(`expected ${i}, found ${f(e)}, as npm writes it of ${X(r)}`,n)}var Q=(e,t,n,r,i)=>Z(e[t],n,C(r,t),i);function Wt(e,t,n,r){let{path:i}=le(()=>I(e.name,e.spec,t,void 0),r);return n(Bt(t,i))}function Gt(e,t,n){if(e.edges.size===0)return;let r=Object.create(null);for(let i of e.edges.values())i.type.startsWith(`peer`)||(r[i.name]=i.spec.startsWith(`file:`)?Wt(i,G(e),t,C(n,i.name)):i.spec);return r}function Kt(e,t,n,r){let i=Gt(t,n,r);if(i===void 0)return Z(e,void 0,r,t);let a=m(e,r);for(let[e,n]of Object.entries(a)){if(!Object.hasOwn(i,e))throw new b(`${X(t)} asks for no such package, or for a peer, which npm leaves out`,C(r,e));if(n!==i[e])throw new b(`expected ${S(i[e])}, as ${X(t)} asks for it, found ${f(n)}, which npm writes there of an override alone, not read here`,C(r,e))}let o=Object.keys(i).find(e=>!Object.hasOwn(a,e));if(o!==void 0)throw new b(`expected ${S(o)}, which ${X(t)} asks for`,r)}function qt(e,t,n,r,i){let a=new Set([...t.children.values()].filter(e=>!r.includes(W(e).location)));if(a.size===0)return Z(e,void 0,n,t);let o=[...r,t.location],s=e===void 0?Object.create(null):m(e,n);for(let[e,r]of Object.entries(s)){let s=t.children.get(e.toLowerCase()),c=`${t.location===``?``:`${t.location}/`}node_modules/${e}`;if(s===void 0||s.folder!==e)throw new b(`${S(c)} is not in packages`,C(n,e));if(!a.has(s))throw new b(`${S(c)} links to ${S(G(W(s)))}, which this is under already, and npm leaves it out`,C(n,e));Xt(r,s,C(n,e),o,i)}let c=a.values().find(e=>!Object.hasOwn(s,e.folder));if(c!==void 0)throw new b(`expected ${S(c.folder)}, as npm writes ${S(c.location)} of packages`,n)}function Jt(e,t,n,r,i){if(t!==void 0&&e===void 0){if(i.resolved!==void 0)throw new b(`expected ${S(t)}: npm leaves it out of every entry or of none, and ${i.resolved} has it`,n);i.omitted??=n}else if(Z(e,t,n,r),e!==void 0){if(i.omitted!==void 0)throw new b(`expected none: npm leaves it out of every entry or of none, and ${i.omitted} has none`,n);i.resolved??=n}}function Yt(e,t){let{semver:n,escape:r,own:i,root:a}=t;if(!i.has(e)){let t=e.kind===`link`?[]:zt(e,n),o=Ut(t.length===0?[Ht(e,void 0,r)]:t.map(t=>Ht(e,t,r)));i.set(e,{heads:o,bundled:he(e,a)||void 0})}return i.get(e)}function Xt(e,t,n,r,i){m(e,n,Lt);let{heads:a,bundled:o}=Yt(t,i),s=a.find(({version:t,from:n})=>t===e.version&&n===e.from)??a[0];Q(e,`version`,s.version,n,t),Q(e,`from`,s.from,n,t),Jt(e.resolved,s.resolved,C(n,`resolved`),t,i),Q(e,`bundled`,o,n,t),Q(e,`integrity`,t.resolution?.integrity,n,t);for(let r of L)Q(e,r,t.flags?.[r]||void 0,n,t);let c=W(t);Kt(e.requires,c,i.escape,C(n,`requires`)),qt(e.dependencies,c,C(n,`dependencies`),r,i)}function $(e,t,n,r,i={}){let a=e=>e.includes(`#`)?(i.hash=!0,r?e.replaceAll(`#`,`%23`):e):e,o=t.get(``);qt(e,o,`dependencies`,[],{semver:n,escape:a,own:new Map,root:o,omitted:void 0,resolved:void 0})}var Zt=`9.0.0`;function Qt(e,t,n,r){if(r!==void 0)return $(e,t,n,Rt(r));let i={hash:!1};try{$(e,t,n,!1,i)}catch(r){if(!(r instanceof b)||!i.hash)throw r;try{$(e,t,n,!0)}catch{throw r}Ct(t,Zt,`an npm that writes a "#" as "%23"`)}}var $t=[`checkVersions`,`semver`,`legacyPeerDeps`,`npm`],en=[`satisfies`,`valid`,`validRange`],tn=[`name`,`version`,`lockfileVersion`,`requires`,`packages`,...L];function nn(e){let{semver:t,legacyPeerDeps:n=!1,npm:r}=ae(e,$t),i=oe(e,en);if(typeof n!=`boolean`)throw TypeError(`legacyPeerDeps: expected a boolean`);if(r!==void 0&&!(/^\d+\.\d+\.\d+$/u.test(r)&&Number(r.split(`.`)[0])>=9))throw TypeError(`npm: expected a version of npm 9 or later, such as 11.12.1`);if(r===`11.6.1`||r===`11.6.2`)throw TypeError(`npm: ${r} works the flags out in a way not read here`);return{semver:i?t:void 0,legacyPeerDeps:n,npm:r}}function rn(e){let t=m(e,void 0).lockfileVersion;if(t!==2&&t!==3)throw new b(`unsupported version: expected 2 or 3, found ${f(t)}`,`lockfileVersion`);if(m(e,void 0,t===2?[...tn,`dependencies`]:tn),e.requires!==!0)throw p(`true`,e.requires,`requires`);return t}function an(e,t){let n=g(e.name,`name`);if(t.name!==void 0&&t.name!==n)throw new b(`expected the project's, ${S(t.name)}`,`name`);if(e.version!==t.version)throw new b(t.version===void 0?`a version, where the project has none`:`expected the project's, ${S(t.version)}`,`version`);let r=L.find(n=>v(e[n],n)!==t.flags[n]);if(r!==void 0)throw new b(`expected ${t.flags[r]?`true`:`none`}, as the project's in packages`,r);return{name:n,version:t.version}}var on=e=>e.kind===`link`?`link:${G(e.target)}`:e.location;function sn(e){let t=Object.create(null);for(let n of e.edges.values())t[n.name]={type:n.type,spec:n.spec,accept:n.accept,target:n.to===void 0?void 0:on(n.to)};return t}function cn(e){let{name:t,version:n,os:r,cpu:i,libc:a,license:o,funding:s,deprecated:c,hasInstallScript:l,flags:u}=e;return{name:t,version:n,edges:sn(e),bundleDependencies:e.bundleDependencies??[],engines:e.engines??Object.create(null),os:r,cpu:i,libc:a,bin:e.bin??Object.create(null),license:o,funding:s,deprecated:c,hasInstallScript:l,...u,devOptional:u.devOptional||u.dev||u.optional}}function ln(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{semver:n,legacyPeerDeps:r,npm:i}=nn(t),a=Et(e),o=rn(a),s=lt(a.packages),c=s.get(``),l=ut(s);mt(s,l,r),It(s,n),Ct(s,i),_e(s),o===2&&Qt(a.dependencies,s,n,i);let u=an(a,c),ee=new Set(l.values()),d=Object.create(null),f=Object.create(null),p=Object.create(null);for(let e of new Set([c,...s.values()]))e.kind===`link`?p[e.location]=G(e.target):e.kind===`package`?f[e.location]={...cn(e),resolution:e.resolution,inBundle:e.inBundle}:d[G(e)]={...cn(e),workspace:ee.has(e),workspaces:e.workspaces??[]};return{lockfileVersion:o,...u,importers:d,packages:f,links:p}}export{b as LockfileError,ln as parseNpmLockfile};
@@ -0,0 +1 @@
1
+ import{j as e,t}from"./chunk-PLGH63UC.js";import"./chunk-7YFJUT2P.js";import"./chunk-PXK7EU4V.js";import{b as n}from"./chunk-DUASGS2O.js";import"./chunk-OOJM4CTU.js";var r=536870912,i=e=>btoa(Array.from(e,e=>String.fromCodePoint(e)).join(``));async function a(a,{limit:o=r}={}){let s=await e(a,`gzip`,{limit:o}),c=t(s),l=new Map(await Promise.all(c.filter(e=>e.type!==`directory`).map(async({data:e})=>[e,`sha512-${i(new Uint8Array(await crypto.subtle.digest(`SHA-512`,e)))}`])));return{bundle:n.fromTar(c,{integrityOf:e=>l.get(e)}),size:s.length}}var o=async(e,t)=>(await a(e,t)).bundle;export{r as MAX_STASIS_TGZ_BYTES,o as parseStasisTgz,a as readStasisTgz};
@@ -0,0 +1 @@
1
+ import{Va as e,Xa as t}from"./chunk-DUS5ARE2.js";import{n,q as r,w as i}from"./chunk-5M2X3QPK.js";import{a}from"./chunk-74JZTGTO.js";import{b as o}from"./chunk-IYPY47MC.js";import{D as s,J as c,L as l,q as u}from"./chunk-QRKFPLA4.js";function d(e){let{data:t}=l(e);return t&&f(t)>0?t:null}function f(e){return(c(e)??[]).filter(t=>(Array.isArray(t)?t:[t]).some(t=>t&&typeof t==`object`&&u(t,t.source??e.source))).length}function p(e,t){let n=[],r=new Map;for(let{name:t,content:i,fallbackRepo:a}of e){if(typeof i!=`string`)continue;let e=d(i);if(!e)continue;let o=c(e),l=s(e)??s({repo:{github:a}}),u=new Set(l?[l]:[]);if(!l)for(let e of o.flat()){if(/(?:^|\/)(?:node_modules|dependencies)\//u.test(e?.file??``))continue;let t=s(e);t&&u.add(t)}for(let e of u)r.set(e,{id:e,label:e});n.push({id:t,filename:t,repoIds:[...u],analyzer:e.source,appFindings:f(e)})}let i=new Set(n.map(e=>e.id));return{merge:{bundles:[],results:[]},link:{reports:n,repositories:[...r.values()],workspaces:t.map(e=>({id:e.id,label:e.name,reports:e.reports.filter(e=>i.has(e))})).filter(e=>e.reports.length>0)}}}function m(e,t){let n=(e.reports??[]).filter(e=>e.visible&&e.repoId!=null).flatMap(e=>{let t=d(e.content??``);return t?[{id:e.id,filename:e.filename,repoIds:[e.repoId],repo:e.repoFullName,directory:e.repoDirectory,analyzer:e.analyzer,appFindings:f(t)}]:[]}),r=new Map((e.repos??[]).map(e=>[e.repoId,{id:e.repoId,label:e.fullName}]));for(let e of n)r.has(e.repoIds[0])||r.set(e.repoIds[0],{id:e.repoIds[0],label:e.repo??String(e.repoIds[0])});let i=t.results??[],o=new Set(i.map(e=>e.bundleId));return{merge:{bundles:(t.bundles??[]).filter(e=>o.has(e.id)).map(e=>({...e,size:a(e.byteSize)})),results:i},link:{repositories:[...r.values()].filter(e=>n.some(t=>t.repoIds.includes(e.id))),reports:n}}}var h=new Map([[`openai/gpt-6-astra`,`GPT-6 Astra`],[`openai/gpt-6-astra-pro`,`GPT-6 Astra Pro`],[`openai/gpt-5.6-sol`,`GPT-5.6 Sol`],[`openai/gpt-5.6-terra`,`GPT-5.6 Terra`],[`openai/gpt-5.6-luna`,`GPT-5.6 Luna`],[`anthropic/claude-fable-5.1`,`Claude Fable 5.1`],[`anthropic/claude-opus-5`,`Claude Opus 5`],[`anthropic/claude-sonnet-5`,`Claude Sonnet 5`],[`moonshotai/kimi-k3`,`Kimi K3`],[`z-ai/glm-5.3`,`GLM 5.3`],[`qwen/qwen3.8-max`,`Qwen3.8 Max`],[`qwen/qwen4-max`,`Qwen4 Max`],[`deepseek/deepseek-v4.1-flash`,`DeepSeek V4.1 Flash`],[`deepseek/deepseek-v4-pro`,`DeepSeek V4 Pro`]]),g=new Map([[`openai`,`OpenAI`],[`anthropic`,`Anthropic`],[`moonshotai`,`Moonshot AI`],[`google`,`Google`],[`nvidia`,`NVIDIA`],[`qwen`,`Qwen`],[`deepseek`,`DeepSeek`],[`x-ai`,`xAI`],[`z-ai`,`Z.ai`],[`mistralai`,`Mistral AI`],[`meta`,`Meta`],[`unbiased`,`Unbiased`]]),_=new Map([[`meta-llama`,`meta`]]),v=new Map([[`gpt`,`GPT`],[`gptoss`,`GPT OSS`],[`oss`,`OSS`],[`o`,`O`],[`ai`,`AI`],[`api`,`API`],[`4o`,`4o`],[`k3`,`K3`],[`k4`,`K4`],[`qwen`,`Qwen`],[`kimi`,`Kimi`],[`mimo`,`MiMo`],[`gemini`,`Gemini`],[`claude`,`Claude`],[`fable`,`Fable`],[`opus`,`Opus`],[`sonnet`,`Sonnet`],[`astra`,`Astra`],[`terra`,`Terra`],[`luna`,`Luna`],[`codex`,`Codex`],[`deepseek`,`DeepSeek`],[`nemotron`,`Nemotron`],[`gemma`,`Gemma`]]);function y(e){let t=e.replace(/:free$/u,``).replaceAll(`_`,`-`).split(`-`).filter(Boolean),n=[];for(let e=0;e<t.length;e++){let r=t[e],i=t[e+1];if(/^\d+$/u.test(r)&&/^\d+$/u.test(i??``)){n.push(`${r}.${i}`),e++;continue}let a=v.get(r.toLowerCase());n.push(a??(/^(?:[a-z]+\d+|\d+[a-z]+)$/iu.test(r)?r.toUpperCase():r[0]?.toUpperCase()+r.slice(1)))}return n.join(` `).replace(/^GPT (\d)/u,`GPT-$1`)}function b(e){return h.get(e)??y(e.includes(`/`)?e.slice(e.indexOf(`/`)+1):e)}function x(e){let t=e.includes(`/`)?e.split(`/`)[0].replace(/^~/u,``):`other`,n=_.get(t)??t;return{key:n,name:g.get(n)??(n===`other`?`Other`:y(n))}}function S(e){return e===`xhigh`?`Extra high`:e?e[0].toUpperCase()+e.slice(1):`Unavailable`}function C(e){return e.efforts.includes(`max`)?`max`:e.efforts.at(-1)??null}async function w(e,t=fetch){let n=await t(`/api/admin/scan/models`,{credentials:`same-origin`,headers:{accept:`application/json`},signal:e});if(!n.ok)throw Error(`HTTP ${n.status}`);return T(await n.json())}function T(e){if(!Array.isArray(e?.models))throw Error(`No model catalogue returned`);let t=e.models.filter(e=>typeof e?.id==`string`&&e.id.length>0).map(e=>({id:e.id,efforts:Array.isArray(e.efforts)?[...new Set(e.efforts.filter(e=>typeof e==`string`&&e.length>0))]:[]}));if(t.length===0)throw Error(`No models available`);return{models:t,defaultModel:t.find(t=>t.id===e.defaultModel)?.id??t[0].id}}function E(e,t=[]){let n=new Map,r=e.flatMap(e=>{let r=t.filter(t=>t.bundles?.includes(e.integrity));return(r.length>0?r.map(e=>({id:e.id,label:e.name})):[{id:`unattached`,label:`Unattached`}]).map(t=>(n.set(t.id,t),{id:e.integrity,integrity:e.integrity,filename:e.name,repoId:t.id,repo:t.label,files:null,reasons:[],size:`—`}))});return{repositories:[...n.values()],bundles:r,reports:[],scans:[]}}function D(s,c){if(c.error)throw Error(c.error);let l=r(c),u=c.kind===`stasis`?c.bundle?.formats:null,d=i(c),f=[...n(c)].filter(([,e])=>e!=null).map(([e,t])=>({path:e,format:u?.get(e)??null,bytes:t,lines:d.get(e)??0,size:a(t),module:o(e,{packageDir:l?.get(e)})})),p=e(c,f.map(e=>e.path)),m=[{id:`all`,label:`All`,filePaths:null},...t(p).map(e=>{let t;return{...e,get filePaths(){return t??=[...p.files(e.id)]}}})];return{...s,files:f,reasons:m,size:a(c.size)}}export{E as a,D as b,p as c,m as d,b as e,x as f,S as g,C as h,w as i,T as j};
@@ -0,0 +1,3 @@
1
+ import{b as e,c as t,s as n,x as r}from"./chunk-LBD3M3J6.js";import{a as i}from"./chunk-TUII34K2.js";var a=3,o=4,s=/^[\w-]{4}$/u,c=/^[\w-]{8}$/u,l=`AAAA`,u={report:`deepview/finding-link/report/v1
2
+ `,workspace:`deepview/finding-link/workspace/v1
3
+ `},d=new Map;function f(e,t){return`${e}\0${t}`}function p(e){return typeof e==`string`&&s.test(e)}async function m(e,t){let n=u[e];if(!n||typeof t!=`string`||!t)return null;let r=f(e,t),o=d.get(r);if(o!==void 0)return o;let s;try{let e=await crypto.subtle.digest(`SHA-256`,i(n+t));s=new Uint8Array(e).slice(0,a).toBase64({alphabet:`base64url`,omitPadding:!0})}catch{return null}return d.set(r,s),s}function h(e,t){return typeof t!=`string`||!t?null:d.get(f(e,t))??null}function g(e,t){let n=[];for(let[r,i]of[[`report`,e],[`workspace`,t]])if(i==null||i===``)n.push(l);else{if(!p(i))throw TypeError(`encodeFindingRef: ${r} must be a link hint token, not a name`);n.push(i)}return n.every(e=>e===l)?null:n[0]===l?`w${n[1]}`:n.join(``)}function _(e){let t=[e.slice(0,o),e.slice(o)].map(e=>e===l?null:e);return{report:t[0],workspace:t[1]}}function v({id:e,report:n,workspace:r}={}){if(!t(e))throw TypeError(`encodeFindingRef: a persistent finding id is required`);let i=[`finding=${encodeURIComponent(e)}`],a=g(n,r);return a&&i.push(`v=${a}`),i.join(`&`)}function y(e,t){let n=v(e);return typeof location>`u`?`${t??``}#${n}`:`${location.origin}${t??location.pathname}#${n}`}function b(n){let r=typeof n==`string`?n:typeof location>`u`?``:location.hash;if(!r)return null;let i=r.replace(/^#/u,``);if(!i)return null;let a={id:null,report:null,workspace:null};for(let n of i.split(`&`)){let r=n.indexOf(`=`);if(r<0)continue;let i=n.slice(0,r),o=n.slice(r+1);if(!o)continue;if(i===`v`){if(o.length===5&&o[0]===`w`&&p(o.slice(1))){let e=o.slice(1);Object.assign(a,{report:null,workspace:e===l?null:e});continue}if(!c.test(o))continue;Object.assign(a,_(o));continue}if(i!==`finding`||o.length>e*3)continue;let s;try{s=decodeURIComponent(o)}catch{continue}t(s)&&(a.id=s)}return a.id?a:null}function x(e,{managed:t=!1}={}){if(typeof location>`u`)return null;let i;try{i=new URL(e)}catch{return null}if(i.href!==e||i.protocol!==location.protocol||i.host!==location.host||i.username||i.password)return null;let a=r(i);if(a?.finding)return{id:a.finding.id,fragment:v(a.finding),path:n(a)};if(t&&a?.view!==`home`&&!/\/(?:index|view)\.html$/u.test(i.pathname))return null;let o=b(i.hash);if(!o)return null;let s=v(o);return{id:o.id,fragment:s,path:`/#${s}`}}function S(e,t){if(typeof e!=`string`)return!1;let n=e.replaceAll(`\\`,`/`);return n.startsWith(`${t}/`)||n.includes(`/${t}/`)}function C(e){let t=!1;for(let n of e){for(let e of n.groups??[])for(let n of e){if(S(n.file,`node_modules`))return`node_modules`;S(n.file,`vendor`)&&(t=!0)}let e=n.tree?w(n.tree):n.treeDependencies;if(e===`node_modules`)return`node_modules`;e===`vendor`&&(t=!0)}return t?`vendor`:`dependencies`}function w(e){let t=!1;for(let n of Object.keys(e??{})){if(S(n,`node_modules`))return`node_modules`;S(n,`vendor`)&&(t=!0)}return t?`vendor`:null}export{S as a,C as b,m as c,h as d,v as e,y as f,b as g,x as h};
@@ -0,0 +1,6 @@
1
+ import{b as e}from"./chunk-DUASGS2O.js";import{a as t}from"./chunk-IYPY47MC.js";import{a as n}from"./chunk-QRKFPLA4.js";import{b as r}from"./chunk-TUII34K2.js";var i=/^webpack(?:-internal)?:\/\/[^/]*\//u,a=/^[a-z][\d+.a-z-]*:/iu,o=/^file:/iu,s=/^(?:file|ftp|https?|wss?):/iu,c=/^(?:[a-z][\d+.a-z-]*:\/\/[^/]*\/?|\/\/[^/]+\/|[a-z]:\/|\/)?/iu,l=e=>c.exec(e)[0],u=e=>l(e).includes(`://`),d=e=>e.replace(u(e)?/[#?].*$/su:/\?.*$/su,``),f=e=>e.slice(e.lastIndexOf(`/`)+1),p=(e,t)=>URL.parse(e,t)?.href??null;function m(e){let t=l(e),n=t.includes(`://`)&&p(e);if(n)return n;let r=[];for(let n of e.slice(t.length).split(`/`))n===``||n===`.`||(n===`..`?r.length>0&&r.at(-1)!==`..`?r.pop():t||r.push(`..`):r.push(n));let i=/^[a-z]:\/$/iu.test(t)?t.toUpperCase():t.startsWith(`//`)?t.toLowerCase():t;return i?i.replace(/\/?$/u,`/`)+r.join(`/`):r.join(`/`)||`.`}function h(e,t){let n=l(t);return u(e)&&!n.includes(`:`)?p(t,e)??m(`${e}/../${t}`):m(n===`/`?l(e).replace(/\/?$/u,``)+t:n?t:`${e}/../${t}`)}function ee(e){try{return decodeURIComponent(e)}catch{return e}}function g(e,t){let n=e.replaceAll(`\\`,`/`);if(i.test(n))return m(n.replace(i,``));let r=s.test(n)?p(n)??n:n,c=/^file:\/\/([^/#]*)([^#]*)/isu.exec(r);if(c){let[,e,t]=c;return m(ee(e&&e.toLowerCase()!==`localhost`?`//${e}${t}`:t).replace(/^\/(?=[a-z]:\/)/iu,``))}if(a.test(r)&&!l(r).includes(`:`))return r;if(t===void 0)return m(r);if(o.test(t)&&!l(r))return g(p(r,t)??r);let d=g(t);return l(r)&&!u(d)?m(r):h(d,r)}var te=/^(?:@[\dA-Za-z~-][\w.~-]*\/)?[\dA-Za-z~-][\w.~-]*$/u;function _(e){let t=e.split(`/`).slice(0,e.startsWith(`@`)?2:1).join(`/`);return te.test(t)?t:null}var ne=new Set([`.pnpm`,`.bun`,`.deno`]),re=/^\d+\.\d+\.\d+(?:-[\d.a-z-]+)?(?:\+[\d.a-z-]+)?$/iu;function ie(e,t){let n=`${t.replace(`/`,`+`)}@`,r=e.startsWith(n)?e.slice(n.length).split(/[(_]/u)[0]:null;return re.test(r)?r:null}function ae(e){let t=d(e).split(`/`),n=t.lastIndexOf(`node_modules`),r=n<0?null:_(t.slice(n+1).join(`/`));if(r===null)return null;let i=n+1+r.split(`/`).length;if(i>=t.length||t.slice(i).includes(``))return null;let a=t.slice(0,i).join(`/`);return{name:r,version:ne.has(t[n-2])?ie(t[n-1],r):null,root:a,path:e.slice(a.length+1)}}var oe=new Map([[`js`,`jsx`],[`mjs`,`jsx`],[`cjs`,`jsx`],[`jsx`,`jsx`],[`es`,`jsx`],[`es6`,`jsx`],[`ts`,`ts`],[`mts`,`ts`],[`cts`,`ts`],[`tsx`,`tsx`],[`json`,`json`]]);function se(e){let t=f(d(e));return/^[\w-]+$/u.test(t)?`jsx`:oe.get(/\.([\da-z]+)$/iu.exec(t)?.[1].toLowerCase())??null}var ce=[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.tsx`,`.mts`,`.cts`,`.json`],le=[`.ios`,`.android`,`.web`];function ue(e){let t=e.map(e=>/\.[a-z]+(?=\.\w+$)/u.exec(f(d(e.path??``)))?.[0]),[[n,r],[,i]]=le.map(e=>[e,t.filter(t=>t===e).length]).toSorted((e,t)=>t[1]-e[1]);return[...r===i?[]:[n],`.native`,``,`.browser`,`.node`]}var de=new Map([[`.js`,[`.ts`,`.tsx`]],[`.jsx`,[`.tsx`]],[`.mjs`,[`.mts`]],[`.cjs`,[`.cts`]]]),fe=[`index`,`main`,`browser`,`node`],pe=[``,`src/`,`lib/`,`dist/`,`build/`],me=new Set([`lib`,`dist`,`build`,`out`,`esm`,`cjs`]);function*he(e,t){yield e;let n=/\.[^./]+$/u.exec(e)?.[0];for(let t of de.get(n)??[])yield e.slice(0,-n.length)+t;for(let n of e.endsWith(`/`)?[`${e}index`]:[e,`${e}/index`])for(let e of ce)for(let r of t)yield n+r+e;if(n)for(let r of t.filter(Boolean))yield e.slice(0,-n.length)+r+n}function*ge(e){let t=e;for(;;){t.startsWith(`src/`)||(yield`src/${t}`),t!==e&&(yield t);let n=t.indexOf(`/`);if(n<0||!me.has(t.slice(0,n)))return;t=t.slice(n+1)}}function _e(e){let t=new Map,n=new Map,r=new Map;for(let i of e)i.path!==null&&t.set(i.path,i),i.package&&(n.set(i.package.name,(n.get(i.package.name)??new Set).add(i.package.root)),(r.get(i.package.root)??r.set(i.package.root,[]).get(i.package.root)).push(i));return{byPath:t,roots:n,byRoot:r,platforms:ue(e),found:new Map}}function v(e,t){if(!e.found.has(t)){let n=d(t),r=he(n,e.platforms).map(e=>e+t.slice(n.length));e.found.set(t,e.byPath.get(r.find(t=>e.byPath.has(t)))??null)}return e.found.get(t)}function ve(e,t,n){let r=e.roots.get(n);if(!r)return null;let i=t.path.split(`/`);for(let e=i.length-1;e>=0;e--){let t=[...i.slice(0,e),`node_modules`,n].join(`/`);if(r.has(t))return t}return r.size===1?[...r][0]:null}var ye=new Set(`assert.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.domain.events.fs.http.http2.https.inspector.module.net.os.path.perf_hooks.process.punycode.querystring.readline.repl.stream.string_decoder.sys.timers.tls.trace_events.tty.url.util.v8.vm.wasi.worker_threads.zlib._http_agent._http_client._http_common._http_incoming._http_outgoing._http_server._stream_duplex._stream_passthrough._stream_readable._stream_transform._stream_wrap._stream_writable._tls_common._tls_wrap.assert/strict.dns/promises.fs/promises.inspector/promises.path/posix.path/win32.readline/promises.stream/consumers.stream/promises.stream/web.timers/promises.util/types`.split(`.`));function be(e){if(e.startsWith(`node:`)||ye.has(e))return{builtin:!0};let t=_(d(e));return t===null?{}:{package:t}}function xe(){let e=[],t=new Map,n=(n,r,i)=>{let a=t.get(n)??t.set(n,new Set).get(n);a.has(r)||(a.add(r),e.push(i))};return{edges:e,add:n,link:(e,t,r)=>{e&&t&&t!==e&&n(e,t,{from:e,to:t,kind:r})}}}function Se(e,t){for(let n of fe)for(let r of pe){let i=v(e,`${t}/${r}${n}`);if(i)return i}let n=e.byRoot.get(t);return n?.length===1?n[0]:null}function Ce(e,t,n,r){return/^\/[^?]/u.test(n)?v(e,t+n)??ge(n.slice(1)).map(n=>v(e,`${t}/${n}`)).find(Boolean):v(e,t+n)??r(e,t)}function we(e,t,n,r=Se){let i=/^(?:\.{1,2}|[a-z]:)?\\/iu.test(n)?n.replaceAll(`\\`,`/`):n,o=s.test(i);if(o||/^(?:\.{1,2}(?:\/|$)|\/|[a-z]:\/)/iu.test(i)||u(i)){let n=o?g(i):h(t.path,i),r=v(e,n);return r?{to:r}:{to:null,path:n}}if(a.test(i)&&e.byPath.has(i))return{to:e.byPath.get(i)};let c=_(d(n)),l=c===null?null:ve(e,t,c);if(l===null)return{to:null,...be(n)};let f=Ce(e,l,n.slice(c.length),r);return f?{to:f}:{to:null,package:c}}var y=class extends Error{name=`SourceMapError`},Te=new Uint8Array(128).fill(255);for(let[e,t]of[...`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/,;`].entries())Te[t.codePointAt(0)]=e;function b(e){let t=new Int32Array(e.length*2);return t.set(e),t}function Ee(e){let{starts:t,columns:n,sources:r,names:i}=e;for(let e=0;e+1<t.length;e++){let[a,o]=[t[e],t[e+1]],s=a+1;for(;s<o&&n[s-1]<=n[s];)s++;if(s>=o)continue;let c=Array.from(n.subarray(a,o),(e,t)=>[e,r[a+t],i[a+t]]).sort((e,t)=>e[0]-t[0]);for(let[e,[t,o,s]]of c.entries())[n[a+e],r[a+e],i[a+e]]=[t,o,s]}return e}function De(e){let t=[0],n=new Int32Array(1024),r=new Int32Array(1024),i=new Int32Array(1024),a=0;for(let{mappings:o,files:s,line:c,column:l,names:u,nameCount:d}of e){if(typeof o!=`string`)throw new y(`mappings is not a string`);for(;t.length<=c;)t.push(a);let e=[0,0,0,0,0],f=0,p=0,m=1,h=l;for(let c=0;c<=o.length;c++){let l=c<o.length?Te[o.codePointAt(c)]??255:64;if(l<32){if(p+=l*m,f===5)throw new y(`mappings: a segment of more than 5 fields at ${c}`);e[f++]+=p%2?(1-p)/2:p/2,p=0,m=1}else if(l<64){if(p+=(l-32)*m,m*=32,m>2**30)throw new y(`mappings: a value at ${c} runs past 32 bits`)}else{if(l===255)throw new y(`mappings: ${JSON.stringify(o[c])} at ${c} is not a base64 digit`);if(m!==1)throw new y(`mappings: the value before ${c} is cut off`);if(f>0){if(f===2||f===3)throw new y(`mappings: a segment of ${f} fields before ${c}`);let t=f===1?-1:s[e[1]];if(t===void 0)throw new y(`mappings: source ${e[1]} before ${c} is not in sources`);if(e[0]<0)throw new y(`mappings: a negative generated column before ${c}`);a===n.length&&([n,r,i]=[b(n),b(r),b(i)]),n[a]=e[0]+h,r[a]=t,i[a++]=f===5&&e[4]>=0&&e[4]<d?u+e[4]:-1,f=0}l===65&&(t.push(a),e[0]=0,h=0)}}}return t.push(a),Ee({starts:Int32Array.from(t),columns:n.slice(0,a),sources:r.slice(0,a),names:i.slice(0,a)})}var x=new WeakMap,S=e=>x.get(e),C=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function w(e,t){if(!e)throw new y(t)}function T(e,t){if(e===void 0)return[];w(Array.isArray(e),`${t} is not an array`);for(let n of e)w(typeof n==`string`||n===null,`${t} holds ${JSON.stringify(n)}`);return e}function Oe(e,t,n,r){let i=e.bySource.get(t);if(i!==void 0)return e.files[i].content??=n,e.files[i].ignored||=r,i;let a=t===null?null:g(t,e.mapPath);return e.files.push({source:t,path:a,package:a===null?null:ae(a),content:n,ignored:r}),t!==null&&e.bySource.set(t,e.files.length-1),e.files.length-1}function E(e,t,n,r){w(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),w(e.sourceRoot===void 0||typeof e.sourceRoot==`string`,`sourceRoot is not a string`);let i=T(e.sources,`sources`),a=T(e.sourcesContent,`sourcesContent`),o=e.ignoreList??e.x_google_ignoreList??[];w(Array.isArray(o)&&o.every(e=>Number.isInteger(e)&&e>=0&&e<i.length),`ignoreList is not a list of indices into sources`);let s=new Set(o),c=e.sourceRoot?e.sourceRoot.replace(/\/?$/u,`/`):``,l=i.map((e,n)=>Oe(t,e===null?null:c+e,a[n]??null,s.has(n))),u=Array.isArray(e.names)?e.names:[];t.parts.push({mappings:e.mappings,files:l,line:n,column:r,names:t.names.length,nameCount:u.length}),t.names.push(...u)}function ke(e,t){w(e.version===3,`version ${JSON.stringify(e.version)} is not 3`),w(Array.isArray(e.sections),`sections is not an array`);for(let[n,r]of e.sections.entries()){let{offset:i,map:a}=C(r)?r:{};w(C(i)&&[i.line,i.column].every(e=>Number.isInteger(e)&&e>=0),`sections[${n}].offset is not a line and a column`),w(C(a)&&a.sections===void 0,`sections[${n}].map is not a plain source map`);let o=e.sections[n-1]?.offset;w(!o||o.line<i.line||o.line===i.line&&o.column<=i.column,`sections[${n}] starts before sections[${n-1}]`),E(a,t,i.line,i.column)}}function Ae(e,t={}){if(!C(t))throw TypeError(`readSourceMap: options is not an object`);if(t.path!==void 0&&typeof t.path!=`string`)throw TypeError(`readSourceMap: options.path is not a string`);let n=e;if(typeof e==`string`||e instanceof Uint8Array)try{let t=typeof e==`string`?e:new TextDecoder(`utf-8`,{fatal:!0}).decode(e);n=JSON.parse(t.replace(/^\)\]\}'[^\n]*\n/u,``))}catch(e){throw new y(`not JSON: ${e.message}`,{cause:e})}w(C(n),`not a JSON object`);let r={files:[],bySource:new Map,mapPath:t.path,parts:[],names:[]};n.sections===void 0?E(n,r,0,0):ke(n,r);let i={files:r.files};return x.set(i,{...De(r.parts),nameList:r.names}),i}var je=/\r\n?|[\n\u2028\u2029]/gu;function Me(e){let t=[0];for(let n of e.matchAll(je))t.push(n.index+n[0].length);return t}function D(e,t,n,r){let[i,a]=[t,n];for(;i<a;){let t=i+a>>1;e[t]<=r?i=t+1:a=t}return i-1}function O(e,t){let n=D(e,0,e.length,t);return[n,t-e[n]]}function Ne(e,[t,n]){if(t>=e.starts.length-1)return-1;let r=e.starts[t],i=D(e.columns,r,e.starts[t+1],n);return i<r?-1:i}function Pe(e,t,n,r){let i=S(e),a=O(t,n),[o,s]=O(t,r),c=new Map,l=Ne(i,a);for(let e=a[0];e<=o&&e<i.starts.length-1;e++){let t=e===a[0]&&l>=0?l:i.starts[e];for(let n=t;n<i.starts[e+1];n++){let t=i.sources[n];if(e===o&&i.columns[n]>=s)break;t>=0&&c.set(t,(c.get(t)??0)+1)}}let[u]=[...c].reduce((e,t)=>t[1]>e[1]?t:e,[-1,0]);return u<0?null:e.files[u]}var k=/\s+/uy,A=`
2
+ \r\u2028\u2029`,j=/[\n\r\u2028\u2029]/gu,Fe=/[\n\r\u2028\u2029]/u,M=/[\w$\u0080-￿]+/uy,Ie=new Set([`return`,`typeof`,`instanceof`,`in`,`of`,`new`,`delete`,`void`,`throw`,`case`,`default`,`extends`,`do`,`else`,`yield`,`await`]),Le=new Set([`if`,`while`,`for`,`with`]),Re=new Set([`break`,`continue`,`debugger`]),ze=new Set([`(`,`[`,"${",`,`,`=`,`:`,`?`,`!`,`~`,`+`,`-`,`*`,`/`,`%`,`&`,`|`,`^`,`<`,`>`]);function Be(e,t){return e?.type===`word`?t&&[`return`,`yield`].includes(e.value)?!1:Ie.has(e.value)&&![`do`,`else`].includes(e.value):ze.has(e?.value)}function Ve(e){let t=e.at(-1);return t?.type===`word`&&(Le.has(t.value)||t.value===`await`&&e.at(-2)?.value===`for`)}function He(e){return e?e.type===`word`?Ie.has(e.value)||Re.has(e.value)||e.label===!0:e.value===`)`?e.control:e.value===`}`?!e.object:e.type===`punctuator`&&![`++`,`--`,`]`].includes(e.value):!0}var Ue=(e,t)=>e.startsWith(`\r
3
+ `,t+1)?3:2,We=/\\(?:u\{([\da-f]+)\}|u([\da-f]{4})|x([\da-f]{2})|([0-3][0-7]{0,2}|[4-7][0-7]?)|(\r\n|[\n\r\u2028\u2029])|(.))/giu,Ge={b:`\b`,f:`\f`,n:`
4
+ `,r:`\r`,t:` `,v:`\v`};function Ke(e){return e.includes(`\\`)?e.replace(We,(e,t,n,r,i,a,o)=>{if(a!==void 0)return``;if(i!==void 0)return String.fromCodePoint(Number.parseInt(i,8));let s=Number.parseInt(t??n??r,16);return Number.isNaN(s)?Ge[o]??o:String.fromCodePoint(Math.min(s,1114111))}):e}function qe(e,t){let n=e[t],r=t+1;for(;r<e.length&&e[r]!==n&&!A.includes(e[r]);)r+=e[r]===`\\`?Ue(e,r):1;return[e[r]===n?Ke(e.slice(t+1,r)):null,r+1]}function Je(e,t){let n=t+1,r=!1;for(;n<e.length&&!A.includes(e[n])&&(r||e[n]!==`/`);)e[n]===`\\`?n++:e[n]===`[`?r=!0:e[n]===`]`&&(r=!1),n++;return M.lastIndex=n+1,M.test(e)?M.lastIndex:n+1}function Ye(e,t,n){for(let r=t;r<e.length;r++)if(e[r]===`\\`)r++;else{if(e[r]==="`")return r+1;if(e[r]===`$`&&e[r+1]===`{`)return n.push(`template`),r+2}return e.length}function Xe(e){let t=[],n=[],r=[],i=0,a=0;for(;i<e.length;){let o=t.length;if(k.lastIndex=i,k.test(e)&&(i=k.lastIndex),i>=e.length)break;let s=e[i],c=e[i+1];if(M.lastIndex=i,s===`/`&&c===`/`)j.lastIndex=i+2,i=j.test(e)?j.lastIndex-1:e.length;else if(s===`/`&&c===`*`){let t=e.indexOf(`*/`,i+2);i=t<0?e.length:t+2}else if(s===`"`||s===`'`){let[n,r]=qe(e,i);t.push({type:`string`,value:n}),i=r}else if(s==="`"||s===`}`&&n.at(-1)===`template`){s===`}`&&n.pop();let r=n.length,a=Ye(e,i+1,n),o=s==="`"&&n.length===r&&e[a-1]==="`";t.push({type:`string`,value:o?Ke(e.slice(i+1,a-1)):null}),n.length>r&&t.push({type:`punctuator`,value:"${"}),i=a}else if(s===`/`&&He(t.at(-1)))i=Je(e,i),t.push({type:`regex`});else if(M.test(e)){let n=Re.has(t.at(-1)?.value)&&!Fe.test(e.slice(a,i));t.push({type:`word`,value:e.slice(i,M.lastIndex),...n&&{label:n}}),i=M.lastIndex}else{s===`{`&&n.push(Be(t.at(-1),Fe.test(e.slice(a,i)))?`object`:`block`);let o=s===`}`?n.pop():void 0;s===`(`&&r.push(Ve(t));let l=(s===`+`||s===`-`)&&c===s||s===`=`&&c===`>`?s+c:s;t.push({type:`punctuator`,value:l,...s===`)`&&{control:r.pop()===!0},...s===`}`&&{object:o===`object`}}),i+=l.length}t.length>o&&(a=i)}return t}var N=e=>e?.type===`string`&&e.value!==null,Ze=new Set([`type`,`typeof`]),Qe=(e,t)=>e[t+1]?.type===`word`&&(e[t+1].value!==`as`||e[t+2]?.type!==`word`||e[t+2].value===`as`);function $e(e,t){let n=!1;for(let r=t+1;r<e.length&&e[r].value!==`}`;r++)if(!(r>t+1&&e[r-1].value!==`,`)){if(!Ze.has(e[r].value)||!Qe(e,r))return!1;n=!0}return n}function et(e,t){for(let n=t;n<e.length;n++){let{value:r}=e[n];if(r===`;`||n>t&&(r===`import`||r===`export`))return null;if(r===`from`&&N(e[n+1]))return e[n+1].value}return null}function tt(e,t){let[n,r,i]=[e[t].value,e[t+1],e[t+2]],a=n===`import`?`import`:`export-from`;if(n===`import`&&N(r))return{kind:a,specifier:r.value};if(Ze.has(r?.value)&&![`,`,`from`].includes(i?.value)||r?.value===`{`&&$e(e,t+1)||n===`export`&&![`{`,`*`].includes(r?.value)||n===`import`&&r?.type!==`word`&&![`{`,`*`].includes(r?.value))return null;let o=et(e,t+1);return o===null?null:{kind:a,specifier:o}}function nt(e,t){let[n,r]=[e[t+2],e[t+3]];if(n?.value!==`)`)return N(n)&&[`)`,`,`].includes(r?.value)?n.value:null}function rt(e,t=new Set){let n=Xe(e),r=[];for(let[e,i]of n.entries()){if(i.type!==`word`||[`.`,`#`,`function`].includes(n[e-1]?.value)||n[e-1]?.value===`=`&&n[e-3]?.value===`type`&&n[e-4]?.value===`import`)continue;let a=n[e+1]?.value===`(`,o=a?nt(n,e):void 0;if((i.value===`require`||t.has(i.value))&&o!==void 0)r.push({kind:`require`,specifier:o,...i.value!==`require`&&{callee:i.value}});else if(i.value===`import`&&a)o!==void 0&&r.push({kind:`dynamic-import`,specifier:o});else if(i.value===`import`||i.value===`export`){let t=tt(n,e);t&&r.push(t)}}return r}var it=/^[\w$]*__d\(/gmu,at=([e,t,n,...r])=>(typeof e==`number`||typeof e==`string`)&&(t===void 0||typeof t==`object`)&&(n===void 0||typeof n==`string`)&&r.length===0;function ot(e){let t=/\);?\s*$/u.exec(e)?.index,n=null,r=t===void 0?-1:e.lastIndexOf(`},`,t);for(;r>=0&&/[\d"]/u.test(e[r+2]);){let i;try{i=JSON.parse(`[${e.slice(r+2,t)}]`)}catch{break}if(!at(i))break;n=i,r=r>0?e.lastIndexOf(`},`,r-1):-1}return n}function st(e){let t=/^[^(]*\(\s*(?:function\s*[\w$]*\s*)?\(([^)]*)\)/u.exec(e)?.[1].split(`,`).slice(1,4).map(e=>e.trim().replaceAll(`$`,`\\$`));if(!t?.length)return[];let n=e.matchAll(RegExp(`(?<=[^\\w$.#]|\\.\\.\\.)(?:${t.join(`|`)})\\((\\d+|"(?:[^"\\\\]|\\\\.)*")[,)]`,`gu`));return[...new Set([...n].map(e=>JSON.parse(e[1])))]}function ct(e,t){if(Array.isArray(e))return e;let n=Object.entries(e??{}).filter(([e])=>/^\d+$/u.test(e)).map(([,e])=>e);return n.length>0?n:st(t)}function lt(e,t){let n=new Map(t.files.map((e,t)=>[e,t])),r=e.flatMap((e,t)=>e.file?[{k:t,at:n.get(e.file)}]:[]);for(let n=0;n<(r[0]?.k??0);n++)e[n].file=t.files[r[0].at-r[0].k+n]??null;for(let[n,{k:i,at:a}]of r.entries()){let o=r[n+1];if(!(o&&o.at-a!==o.k-i))for(let n=i+1;n<(o?.k??e.length);n++)e[n].file=t.files[a+n-i]??null}}function ut(e,t){let n=[...e.matchAll(it)].map(e=>e.index);if(n.length===0)return null;let r=Me(e),i=t=>e.slice(r[t],r[t+1]),a=[];for(let[o,s]of n.entries()){let[c]=O(r,s),[l]=O(r,(n[o+1]??e.length)-1),u=ot(i(l));for(;!u&&l>c;)u=ot(i(--l));if(!u)throw Error(`bundleEdges: the Metro module at line ${c+1} ends in no define params`);let d=r[l+1]??e.length;a.push({id:u[0],file:Pe(t,r,s,d),dependencies:ct(u[1],e.slice(s,d))})}lt(a,t);let o=new Map(a.map(e=>[e.id,e])),{edges:s,link:c}=xe();for(let{file:e,dependencies:t}of a)for(let n of t)c(e,o.get(n)?.file,`dependency`);return s}var dt=e=>e.path!==null&&![`json`,null].includes(se(e.path)),ft=e=>e.path!==null&&se(e.path)===null;function pt(e){let t=/^_([A-Za-z]+)\d+$/u.exec(e)?.[1];if(t)return[t,`interopRequireDefault`];let n=/^_(interopRequire(?:Default|Wildcard)|jsx(?:Dev)?Runtime|callSuper)$/u.exec(e)?.[1];return n===`callSuper`?[`getPrototypeOf`,`possibleConstructorReturn`,`interopRequireDefault`]:n?[n]:[]}var mt={jsxRuntime:`react/jsx-runtime`,jsxDevRuntime:`react/jsx-dev-runtime`};function ht(e){let{sources:t,names:n,nameList:r}=S(e),i=new Map,a=new Map,o=e.files.map(()=>new Set);for(let e=0;e<n.length;e++)n[e]<0||t[e]<0||(a.has(n[e])||a.set(n[e],pt(r[n[e]]).length>0),a.get(n[e])&&o[t[e]].add(r[n[e]]));for(let[t,n]of o.entries()){if(n.size===0)continue;let r=e.files[t],a=new Set(Array.from((r.content??``).matchAll(/(?:function|var|let|const)\s+(_[A-Za-z]+\d*)\b/gu),e=>e[1])),o=[...n].filter(e=>!a.has(e)&&!a.has(e.replace(/\d+$/u,``))).flatMap(pt);o.length>0&&i.set(r,o.map(e=>mt[e]??`@babel/runtime/helpers/${e}`))}return i}function gt(e,t){let n=new Map;for(let[r,i]of e){let e=n.get(r)??n.set(r,new Map).get(r);for(let n of i)e.set(n,we(t,r,n,()=>null))}let r=new Set([...n.values()].flatMap(e=>[...e.values()].map(e=>e.to))),i=(e,n)=>t.byRoot.get(n).find(e=>!r.has(e))??t.byRoot.get(n)[0];return(e,r)=>{let a=n.get(e)?.get(r);return a?.to?a:we(t,e,r,i)}}var _t=e=>/(?:^|\/)__prelude__$/u.test(e.source??``),vt=e=>e?.package?.name===`metro-runtime`&&e.package.path===`src/polyfills/require.js`;function yt(e){if(!e.files.some(_t)&&!vt(e.files[0]))return null;if(!e.files.some(e=>e.content!==null&&!_t(e)&&!vt(e)))throw Error("bundleEdges: the Metro map carries no sourcesContent, which its edges are read from; pass the bundle as `code`");let t=_e(e.files),n=e.files[e.files.findIndex(ft)+1],r=e.files.find(e=>e.package?.name===`metro-runtime`&&e.package.path===`src/modules/asyncRequire.js`),i=new Map(e.files.filter(e=>e.content!==null&&dt(e)).map(e=>[e,rt(e.content)])),a=ht(e),o=gt([...[...i].map(([e,t])=>[e,t.flatMap(({specifier:e})=>e===null?[]:[e])]),...a],t),{edges:s,add:c,link:l}=xe();for(let t of e.files){ft(t)&&l(t,n,`dependency`);for(let{kind:e,specifier:n}of i.get(t)??[]){let i=n===null?{to:null}:o(t,n);i.to!==t&&c(t,`${e}\0${JSON.stringify(n)}`,{from:t,kind:e,specifier:n,...i}),e===`dynamic-import`&&l(t,r,`dependency`)}for(let e of a.get(t)??[])l(t,o(t,e).to,`dependency`)}return s}var bt=(e,t)=>t==null?yt(e):ut(t,e);function xt(e,t){let n=bt(e,t);if(!n)throw Error(`bundleEdges: not a Metro ${t==null?`map`:`bundle`}; edges-lite.js reads only those, edges.js reads others`);return{edges:n}}function St(e){let t=JSON.parse(e.replace(/^\)\]\}'[^\n]*\n/u,``)),n=Ae(t),r=t.sections?t.sections.reduce((e,t)=>e+(t.map.names?.length??0),0):t.names?.length??null;return{json:{version:t.version,file:t.file,sourceRoot:t.sourceRoot},map:n,namesCount:r}}function P(e){if(e.map)return e.map.files.flatMap(e=>e.source===null?[]:[[e.source,e.content]]);let t=e.json?.sourcesContent??[];return(e.json?.sources??[]).map((e,n)=>[e,t[n]??null])}function Ct(e,t){let n=new Map;for(let{from:r,to:i,specifier:a}of t(e).edges){if(r.source===null||i?.source==null||i.source===r.source)continue;let e=typeof a==`string`?[r.source,i.source,a]:[r.source,i.source];n.set(e.join(`\0`),e)}return[...n.values()]}function wt(e){try{return xt(e)}catch{return{edges:[]}}}var Tt=Object.freeze([]);function F(e){return e?.edges?e.edges:e?.map?(e.edges=Ct(e.map,wt),e.edges):Tt}var I=new WeakMap,L=new WeakMap;function Et(e){let t=F(e);if(!I.has(t)){let e=new Map;for(let[n,r]of t)e.has(n)||e.set(n,new Set),e.get(n).add(r);I.set(t,e)}return I.get(t)}function Dt(e){let t=F(e);if(!L.has(t)){let e=new Map;for(let[n,r,i]of t)i!==void 0&&(e.has(n)||e.set(n,new Map),e.get(n).set(i,r));L.set(t,e)}return L.get(t)}var R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap;function W(t){if(t?.metadataOnly)return new Map;let n=t?.bundle??t?.json;if(n&&R.has(n))return R.get(n);let r=new Map;if(!t)return r;if(t.kind===`stasis`){if(!t.bundle)return r;let n=t.bundle.formats;for(let[i,a]of t.bundle.sources)typeof a==`string`&&(e.isResourceFormat(n?.get(i))||r.set(i,a))}else if(t.kind===`sourcemap`)for(let[e,n]of P(t))typeof n==`string`&&r.set(e,n);return n&&R.set(n,r),r}function Ot(e){let t=1;for(let n=e.indexOf(`
5
+ `);n!==-1;n=e.indexOf(`
6
+ `,n+1))t++;return t}var kt=new WeakMap;function At(e){let t=kt.get(e);if(!t){let n=[...e.keys()].toSorted();t={paths:n,numbers:new Map(n.map((e,t)=>[e,t+1]))},kt.set(e,t)}return t}function jt(e,t,n){let r=Array.isArray(t)?t:[];return{integrity:e.integrity,kind:`sourcemap`,size:e.size,...Array.isArray(n)?{npmExecutable:new Set(n.filter(e=>typeof e==`string`))}:{},json:{version:3,sources:r.map(([e])=>e),sourcesContent:r.map(([,,e])=>typeof e==`string`?e:null)},fileSizes:new Map(r.map(([e,t])=>[e,t])),npmBinaries:new Map(r.filter(([,,e,t])=>typeof e!=`string`&&typeof t==`string`).map(([e,t,,n,r])=>[e,{size:t,digest:n,...typeof r==`string`?{link:r}:{}}]))}}var Mt=(e,t)=>e?.npmBinaries?.get(t)?.link;function Nt(e,t){if(t.startsWith(`/`))return null;let n=e.split(`/`).slice(0,-1);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e!==`..`)n.push(e);else if(n.pop()===void 0)return null}return n.join(`/`)}function G(e){let t=e?.bundle??e?.json;if(t&&z.has(t))return z.get(t);let n=new Map(W(e));for(let[t,r]of e?.npmBinaries??[])n.set(t,{format:`digest`,...r});if(e?.kind===`stasis`&&e.bundle){let t=e.bundle.formats;for(let[r,i]of e.bundle.sources){if(typeof i!=`string`)continue;let e=t?.get(r);e===`resource`?n.set(r,i):e===`resource:base64`&&n.set(r,{format:`base64`,data:i})}}return t&&z.set(t,n),n}var Pt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function Ft(e){let t=e.endsWith(`=`);if(t?e.length%4!=0||e.at(-3)===`=`:e.length%4==1)return null;let n=t?e.slice(0,e.endsWith(`==`)?-2:-1):e;if(/[^A-Za-z0-9+/]/u.test(n))return null;let r=n.length%4;return r>1&&Pt.indexOf(n.at(-1))&(r===2?15:3)?null:Math.floor(n.length*3/4)}function It(e){return typeof e==`string`?r(e):e?.format===`digest`?e.size:e?.format===`base64`?Ft(e.data):null}function K(e){if(e?.fileSizes)return e.fileSizes;let t=e?.bundle??e?.json;if(t&&B.has(t))return B.get(t);let n=new Map,r=G(e),i=e?.kind===`stasis`?e.bundle?.sources.keys():e&&P(e).map(([e])=>e);for(let e of i??[])n.set(e,It(r.get(e)));return t&&B.set(t,n),n}function Lt(e){if(e?.metadataOnly)return e.unsizedFiles??new Set;let t=K(e);if(U.has(t))return U.get(t);let n=new Set;for(let r of G(e).keys())t.get(r)===null&&n.add(r);return U.set(t,n),n}function Rt(t){let n=K(t);if(H.has(n))return H.get(n);let r=Lt(t),i=t?.kind===`stasis`?t.bundle?.formats:null,a=new Map;for(let[o,s]of n)s===null&&!r.has(o)||a.set(o,e.isResourceFormat(i?.get(o))||t?.npmBinaries?.has(o)?`resource`:`source`);return H.set(n,a),a}function zt(t){let n=K(t),r=t?.kind===`stasis`?t.bundle?.formats:null;if(!r||r.size===0)return n;if(V.has(n))return V.get(n);let i=new Map;for(let[t,a]of n)e.isResourceFormat(r.get(t))||i.set(t,a);return V.set(n,i),i}var q=new WeakMap;function Bt(e){if(e?.kind!==`stasis`||!e.bundle?.modules)return null;if(q.has(e.bundle))return q.get(e.bundle);let t=new Map;for(let[n,r]of e.bundle.modules)for(let e of Object.keys(r.files))t.set(n===`.`?e:`${n}/${e}`,n);return q.set(e.bundle,t),t}function Vt(e,n=null){let r=new Map;if(e?.kind!==`stasis`||!e.bundle?.modules)return r;for(let[i,a]of e.bundle.modules){if(i===`.`||n&&!n.has(i))continue;let e=a?.repo?.github,o=t(a?.repo?.commit);if(typeof e!=`string`||e===``||!o)continue;let s=typeof a.repo.directory==`string`?a.repo.directory:``;r.set(i,{github:e,...s?{directory:s}:{},commit:o})}return r}function Ht(e,t=null,n=(e,t)=>t.name){let r=new Map;if(e?.kind!==`stasis`||!e.bundle?.modules)return r;let i=t===null?null:Bt(e),a=t===null?null:new Set([...t].map(e=>i?.get(e)));for(let[t,i]of e.bundle.modules){if(a&&!a.has(t)||!t.includes(`node_modules`)||!i?.name||typeof i.version!=`string`||!i.version)continue;let e=n(t,i),o=r.get(e);o||(o=new Set,r.set(e,o)),o.add(i.version)}return r}var Ut={__proto__:null,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`jsx`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsx:`tsx`,json:`json`,css:`css`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,yml:`yaml`,yaml:`yaml`,sh:`bash`,bash:`bash`,md:`markdown`,markdown:`markdown`,sol:`solidity`,php:`php`,phtml:`php`,rs:`rust`,rb:`ruby`,podspec:`ruby`,py:`python`,pyw:`python`,pyi:`python`,java:`java`,swift:`swift`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,"c++":`cpp`,hpp:`cpp`,hh:`cpp`,hxx:`cpp`,"h++":`cpp`,h:`cpp`,c:`c`,m:`objectivec`,mm:`objectivec`},Wt={__proto__:null,module:`javascript`,commonjs:`javascript`,"module-typescript":`typescript`,"commonjs-typescript":`typescript`,json:`json`,solidity:`solidity`,php:`php`,shell:`bash`,rust:`rust`,java:`java`,swift:`swift`,objc:`objectivec`,objcpp:`objectivec`,c:`c`,"c-header":`c`,cpp:`cpp`,"cpp-header":`cpp`,ruby:`ruby`,podspec:`ruby`,podfile:`ruby`,fastlane:`ruby`,"podfile-lock":`yaml`,xml:`markup`};function Gt(e){if(typeof e!=`string`)return!1;let t=e.length-1,n=0;for(;n<t&&/\s/u.test(e[n]);)n++;for(;t>n&&/\s/u.test(e[t]);)t--;return n<t&&e[n]===`{`&&e[t]===`}`}function J(e,t,n){if(typeof t==`string`&&Wt[t])return Wt[t];if(typeof e!=`string`)return null;let r=e.slice(e.lastIndexOf(`/`)+1),i=r.lastIndexOf(`.`);if(i<=0)return null;let a=r.slice(i+1).toLowerCase();return a===`map`?Gt(n)?`json`:null:Ut[a]??null}var Kt=Object.freeze({javascript:`JavaScript`,jsx:`JSX`,typescript:`TypeScript`,tsx:`TSX`,json:`JSON`,css:`CSS`,markup:`HTML`,yaml:`YAML`,bash:`Shell`,markdown:`Markdown`,solidity:`Solidity`,php:`PHP`,rust:`Rust`,ruby:`Ruby`,java:`Java`,cpp:`C++`,c:`C`,objectivec:`Objective-C`,python:`Python`,go:`Go`,kotlin:`Kotlin`,swift:`Swift`,dart:`Dart`,sql:`SQL`,lua:`Lua`,csharp:`C#`,scala:`Scala`,vue:`Vue`,svelte:`Svelte`}),qt=Object.freeze({py:`python`,pyw:`python`,go:`go`,kt:`kotlin`,kts:`kotlin`,swift:`swift`,dart:`dart`,sql:`sql`,lua:`lua`,cs:`csharp`,scala:`scala`,sc:`scala`,vue:`vue`,svelte:`svelte`});function Jt(e){let t=typeof e==`string`?e.slice(e.lastIndexOf(`/`)+1):``,n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1).trim().toLowerCase():``,i=J(e)??qt[r];return i?{key:i,label:Kt[i]??i}:r?{key:`extension:${r}`,label:`.${r}`}:{key:`other`,label:`Other`}}function Y(e,t){let n=new Map,r=0,i=0;for(let[a,o]of e){let e=Jt(a),s=n.get(e.key)??{...e,files:0,lines:0,bytes:0};s.files++,s.lines+=o,s.bytes+=t.get(a)??0,n.set(e.key,s),i+=o,r+=t.get(a)??0}return{files:e.size,lines:i,bytes:r,languages:[...n.values()].toSorted((e,t)=>t.lines-e.lines||e.label.localeCompare(t.label))}}var X=6,Z=new WeakMap,Yt=new Set([`terminal`,`code`,`search`,`compare`]);function Xt(e,t=null){return!!t||Yt.has(e)}var Zt=/^sha512-[A-Za-z0-9+/]{86}==$/u;function Qt(e){if(e.fileHashes)return Promise.resolve(e.fileHashes);if(Z.has(e))return Z.get(e);let t=(async()=>{let t=[...W(e)],r=new Map;for(let e=0;e<t.length;e+=32){let i=await Promise.all(t.slice(e,e+32).map(async([e,t])=>[e,await n(t)]));for(let[e,t]of i)r.set(e,t)}return e.fileHashes=r,r})();return Z.set(e,t),t.catch(()=>Z.delete(e)),t}function $t(e){if(typeof e!=`string`)return 0;let t=/\S/gu,n=/[\r\n]/gu,r=0;for(;t.test(e)&&(r++,n.lastIndex=t.lastIndex,n.test(e));)t.lastIndex=n.lastIndex;return r}function Q(e){return e.lineCounts??=new Map([...W(e)].map(([e,t])=>[e,$t(t)]))}function $(e){return e instanceof Map?Object.fromEntries([...e].map(([e,t])=>[e,$(t)])):e}async function en(e){let t=await Qt(e),n=K(e),i=Q(e),a={version:X,integrity:e.integrity,kind:e.kind,size:e.size,codeStats:Y(i,n),files:[...n].map(([e,n])=>[e,n,t.get(e)??null,i.get(e)??null])},o=Lt(e);if(o.size>0&&(a.unsized=[...o]),e.kind===`sourcemap`){let{version:t,file:n,sourceRoot:i,names:o}=e.json,s=P(e);a.json={version:t,file:n,sourceRoot:i,sources:s.map(([e])=>e)},a.sourceSizes=s.map(([,e])=>typeof e==`string`?r(e):null),a.namesCount=e.namesCount??o?.length??null;let c=new Map(a.files.map(([e],t)=>[e,t]));a.edges=F(e).map(([e,t,...n])=>[c.get(e),c.get(t),...n])}else{let t=e.bundle,r={version:t.version,config:t.config,repo:t.repo,package:t.package,formats:$(t.formats),imports:$(t.imports),reason:t.reason,executable:[...t.executable]};if(t.version===0)r.sources=Object.fromEntries([...n.keys()].map(e=>[e,null]));else{let e={},n={};for(let[r,i]of t.modules){let t=r.split(`/`).includes(`node_modules`)?e:n;Object.defineProperty(t,r,{enumerable:!0,value:{name:i.name,version:i.version,ecosystem:i.ecosystem,repo:i.repo,files:Object.fromEntries(Object.keys(i.files).map(e=>[e,null]))}})}r.modules=e,t.config.scope===`full`&&(r.sources=n,r.entries=[...t.entries])}a.bundle=r}return a}function tn(t,n){if(![1,2,3,4,5,X].includes(t?.version)||t.integrity!==n||![`stasis`,`sourcemap`].includes(t.kind)||!Number.isSafeInteger(t.size)||t.size<0||!Array.isArray(t.files))throw Error(`Invalid bundle metadata`);let r=t.version!==X,i=t.version===1,a=new Map,o=new Map,s=new Map;for(let e of t.files){if(!Array.isArray(e)||e.length!==4&&!(i&&e.length===3))throw Error(`Invalid bundle metadata file`);let[t,n,r,c]=e;if(typeof t!=`string`||o.has(t)||n!==null&&(!Number.isSafeInteger(n)||n<0)||r!==null&&(typeof r!=`string`||!Zt.test(r))||n===null&&r!==null||i&&n!==null&&r===null||c!=null&&(!Number.isSafeInteger(c)||c<0))throw Error(`Invalid bundle metadata file`);o.set(t,n),r!==null&&a.set(t,r),c!=null&&s.set(t,c)}let c=new Set(t.unsized??[]);if(t.unsized!==void 0&&(i||!Array.isArray(t.unsized)||c.size!==t.unsized.length)||[...c].some(e=>typeof e!=`string`||!o.has(e)||o.get(e)!==null))throw Error(`Invalid bundle metadata`);let l={integrity:n,kind:t.kind,size:t.size,metadataOnly:!0,fileSizes:o,fileHashes:a,lineCounts:s,unsizedFiles:c,stale:r};if(t.kind===`stasis`){l.bundle=e.fromJSON(t.bundle);let n=l.bundle.sources;if(n.size!==o.size||[...n.keys()].some(e=>!o.has(e)))throw Error(`Invalid bundle metadata inventory`);let r=l.bundle.formats;if(!i&&[...o].some(([t,n])=>a.has(t)!==(n!==null&&!e.isResourceFormat(r.get(t))))||[...c].some(e=>r.get(e)!==`resource:base64`))throw Error(`Invalid bundle metadata inventory`)}else{if(!t.json||typeof t.json!=`object`||![null,void 0].includes(t.namesCount)&&(!Number.isSafeInteger(t.namesCount)||t.namesCount<0))throw Error(`Invalid sourcemap metadata`);if(!Array.isArray(t.json.sources)||t.json.sources.some(e=>!o.has(e))||!Array.isArray(t.sourceSizes)||t.sourceSizes.length!==t.json.sources.length||t.sourceSizes.some(e=>e!==null&&(!Number.isSafeInteger(e)||e<0))||[...o].some(([e,t])=>a.has(e)!==(t!==null))||c.size>0)throw Error(`Invalid sourcemap inventory`);l.json=t.json,l.sourceSizes=t.sourceSizes,l.namesCount=t.namesCount,t.edges!==void 0&&(l.edges=nn(t.edges,t.files))}if(t.codeStats===void 0)l.codeStats=Y(s,o);else{let e=t.codeStats,n=e=>Number.isSafeInteger(e)&&e>=0;if(!e||![e.files,e.lines,e.bytes].every(n)||!Array.isArray(e.languages)||e.languages.some(e=>!e||typeof e.key!=`string`||typeof e.label!=`string`||![e.files,e.lines,e.bytes].every(n)))throw Error(`Invalid bundle code stats`);l.codeStats=e}return l}function nn(e,t){if(!Array.isArray(e))throw TypeError(`Invalid sourcemap edges`);return e.map(e=>{if(!Array.isArray(e)||![2,3].includes(e.length)||e[0]===e[1]||e.length===3&&typeof e[2]!=`string`||e.slice(0,2).some(e=>!Number.isSafeInteger(e)||e<0||e>=t.length))throw Error(`Invalid sourcemap edges`);return[t[e[0]][0],t[e[1]][0],...e.slice(2)]})}function rn(t,{integrity:n,kind:r,size:i}){if(r===`stasis`)return{integrity:n,kind:r,size:i,bundle:e.parse(t)};if(r!==`sourcemap`)throw Error(`Unsupported bundle format`);return{integrity:n,kind:r,size:i,...St(t)}}export{J as a,Y as b,F as c,Et as d,Dt as e,W as f,Ot as g,At as h,jt as i,Mt as j,Nt as k,G as l,It as m,K as n,Rt as o,zt as p,Bt as q,Vt as r,Ht as s,Xt as t,Qt as u,$t as v,Q as w,en as x,tn as y,rn as z};
@@ -0,0 +1,40 @@
1
+ import{b as e,h as t}from"./chunk-5EAVJAD2.js";import{a as n}from"./chunk-74JZTGTO.js";import{a as r,b as i,e as a}from"./chunk-IYPY47MC.js";import{B as o,b as s,c,i as l,x as u,z as d}from"./chunk-ITUKKCCK.js";import{a as f,b as p,c as m}from"./chunk-C4Z6ZBXV.js";import{A as h,B as g,D as _,E as v,b as y,c as b,d as x,j as S,m as C,p as w,s as T,t as E,w as D,z as O}from"./chunk-QRKFPLA4.js";import{c as k,f as A,g as j,i as ee}from"./chunk-2XUEZHIP.js";var te=p(class extends m{constructor(e){if(super(e),e.type!==f.ATTRIBUTE||e.name!==`class`||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return` `+Object.keys(e).filter(t=>e[t]).join(` `)+` `}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(` `).split(/\s/).filter(e=>e!==``)));for(let e in t)t[e]&&!this.nt?.has(e)&&this.st.add(e);return this.render(t)}let n=e.element.classList;for(let e of this.st)e in t||(n.remove(e),this.st.delete(e));for(let e in t){let r=!!t[e];r===this.st.has(e)||this.nt?.has(e)||(r?(n.add(e),this.st.add(e)):(n.remove(e),this.st.delete(e)))}return A}});function ne(e){let t=typeof e==`string`?e.trim():``;return/^[0-9a-f]{7,64}$/iu.test(t)?t:``}function re(e){return ne(e?.commit)}function M(e,t){return typeof e==`string`&&typeof t==`string`&&e!==``&&e.toLowerCase()===t.toLowerCase()}function ie(e,t){return M(t,_(e))?re(e?.repo):``}function ae(e,t){let n=e?.advisory?.package,r=e?.repo?.github;if(typeof n!=`string`||n===``||typeof r!=`string`||r===``)return!1;let i=_({repo:{github:r}}),a=i?.split(`/`)[1].toLowerCase();return a!==n.toLowerCase()&&a!==n.replace(/^@[^/]+\//u,``).toLowerCase()?!1:!M(i,typeof t==`string`&&t!==``?_({repo:{github:t}})??t:``)}function oe(e,t){if(!ae(e,t))return e;let{repo:n,...r}=e;return{...r,_repoIgnored:!0}}var se=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`),ce=e=>s(e)?e:se(c(String(e))),le=globalThis.trustedTypes?.createPolicy(`deepview`,{createHTML:ce,createScriptURL:e=>{let t=new URL(e,globalThis.location.href);if(t.origin!==globalThis.location.origin)throw TypeError(`Not a same-origin script: ${t.href}`);return t.href}}),ue=e=>le?le.createHTML(e):ce(e),de=e=>le?le.createScriptURL(String(e)):e,N={showAll:!1,packagesView:!1,dependencyPackagesView:!1,flowPackagesView:!1,bundleIssues:!1,bundleLayout:`graph`,lockfileLayout:`dependencies`,bundleReason:null,bundleReasonFor:null,selected:null,focusedPkg:null,topPkgsTab:`issues`,selectedSeverities:new Set,selectedColors:new Set,pathFilter:``,hidden:new Set,solo:null,graphState:null,layoutCache:null,keptViewport:null};function fe({keepViewport:e=!1}={}){N.graphState?._cleanup?N.graphState._cleanup({keepViewport:e}):e||(N.keptViewport=null),N.graphState=null}function P(e){return e.id??String(e._id)}function pe(e){let t=w(e);return t!==``&&t!==`revalidation`}var me=[{value:`confirmed`,label:`Confirmed`,kinds:[`confirmed`,`partial`,`revalidation`]},{value:`unreachable`,label:`Unreachable`,kinds:[`unreachable`]},{value:`refuted`,label:`Refuted`,kinds:[`refuted`]}],he={value:`unrevalidated`,label:`Not revalidated`,kinds:[``]},ge=[...me,he];function _e(e){return ge.find(t=>t.value===e)}function ve(e){return _e(e)?.kinds??null}var ye=[``,`exclude`,`only`];function be(e,t){let n=ve(e);return n?.includes(`partial`)?t===`only`?[`partial`]:t===`exclude`?[`confirmed`]:n:n}function F(e){if(e.confidence!==void 0)return e.confidence;if(e.critical===!0||e._source)return 10}var xe=e=>e.confidence!==void 0||e.critical===!0;function Se(e){return e.every(e=>e.every(e=>F(e)!==void 0))&&e.some(e=>e.some(xe))}function Ce(e,t,n){return e.some(e=>{let r=[`refuted`,`unreachable`].includes(n(e))?0:F(e);return r===void 0?t===0:r>=t})}function we(e,t){let n=e.map(t).filter(e=>e.length>0);if(!n.some(e=>e.some(e=>F(e)!==void 0)))return 0;let r=e=>n.reduce((t,n)=>t+ +!!n.some(t=>(F(t)??-1)>=e),0),i;for(i=r(6)<=25?6:r(7)<=25?7:8;i>0&&r(i)===0;)i--;for(;i>0&&r(i-1)===r(i);)i--;return i}function Te(e,t){return Se(e)?t:0}function Ee(e,t,n){let r=new Set(e.ruledOutIds??[]);for(let t of e)for(let e of t)([`refuted`,`unreachable`].includes(n(e))||e._opensAsApp===!0)&&r.add(P(e));for(let i of e){let e=t(i);if(e.length!==0&&e.some(e=>be(`confirmed`,``).includes(n(e)||(e._source&&!e._sourcePass?`revalidation`:``)))){for(let e of i)if(r.add(P(e)),e.isApp&&Array.isArray(e.revalidateInputs))for(let t of e.revalidateInputs)t&&r.add(t)}}return r}function De(e,t,n,r){let i=Te(e,t),a=e.filter(e=>Ce(e,i,r)),o=new Set(be(`confirmed`,``));return e.some(e=>e.some(e=>o.has(r(e))))?a.every(e=>e.every(e=>n.has(P(e)))):!1}function Oe(e,{tabs:t,kindOf:n,severityMode:r}){let i=e.map(t).filter(e=>e.length>0),a=Ee(e,t,n);if(!De(i,we(e,t),a,n))return!1;let o=Te(i,6);return i.every(e=>!Ce(e,o,n)||!e.some(e=>C(e,r)!==`low`)||e.every(e=>a.has(P(e))))}function ke(e){if(!e)return e;let t="`".repeat(Math.max(0,...[...e.matchAll(/`+/gu)].map(e=>e[0].length))+1),n=/^`|`$/u.test(e)||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${t}${n}${e}${n}${t}`}var I=!0;function Ae(e,t=!1){I=e!==!1&&!t}function je(){return I}function L(e){return I?w(e):``}function Me(e){return w(e)!==``}function Ne(e){return e.some(e=>(e.groups??[]).some(e=>e.some(pe)))}function Pe(e){let t=L(e);return t&&t!==`revalidation`?t:null}function Fe(e){return L(e)===`revalidation`}var Ie=new Set([`refuted`,`unreachable`]);function Le(e){return Ie.has(L(e))}function Re(e,t=!1){let n=new Set(e);n.delete(``);let r=me.filter(e=>e.kinds.some(e=>n.has(e)));return t&&n.size>0?[...r,he]:r}function ze(e){return RegExp(`(^|/)${e}/`,`u`)}function Be(e){return RegExp(`^(?:.*/)?${e}/(?:@[^/]+/[^/]+|[^/]+)/(.*)$`,`u`)}var Ve=ze(`node_modules`),He=ze(`vendor`),R=`node_modules`,Ue=ze(R),We=Be(R),Ge=(e,t)=>e?.length===t.length&&e.every((e,n)=>e===t[n]),Ke=null;function qe(t){if(Ge(Ke,t))return;Ke=[...t];let n=e(t);n!==R&&(R=n,Ue=ze(n),We=Be(n))}function Je(){return R}function z(e){return Ue.test(e)}var Ye=new WeakSet;function Xe(e){let t=!1;for(let n of e??[])for(let e of n.groups??[])for(let n of e){if(n.isApp!==!1)continue;let e=Ye.has(n);`isUpstream`in n&&!e||(z(n.file)?(n.isUpstream!==!0&&(t=!0),n.isUpstream=!0,Ye.add(n)):e&&(t=!0,delete n.isUpstream,Ye.delete(n)))}return t}function Ze(e){let t=typeof e==`string`?e:``;return Ve.test(t)||He.test(t)||Ue.test(t)}var Qe=/^(.*(?:^|\/)node_modules\/(?:@[^/]+\/[^/]+|[^/]+))(?:\/|$)/u;function $e(e){return Qe.exec(typeof e==`string`?e:``)?.[1]??null}function et(e){if(typeof e!=`object`||!e)return null;for(let[t,n]of Object.entries(e))if(typeof n?.name==`string`&&n.name!==``)return`${t}:${n.name}@${typeof n.version==`string`?n.version:``}`;return null}var tt=null,nt={byRoot:new Map,byPackage:new Map},rt=e=>`${e?._managedReportId??``}\0${e?._reportName??``}`,it=(e,t)=>`${rt(e)}\0${t}`,at=e=>_({repo:{github:e.id}})??e.id;function ot(e,t){if(e===null)return null;let n=V(t),r=V(e),[i,a]=[r.commit.toLowerCase(),n.commit.toLowerCase()];return!M(at(r),at(n))||r.prefix!==n.prefix||!(i.startsWith(a)||a.startsWith(i))?null:a.length>i.length?t:e}function st(e){let t=Array.isArray(e)?e:[],n=t.flatMap(e=>[e,e?.groups]);if(Ge(tt,n))return;tt=n;let r=new Map,i=new Map,a=(e,t,n)=>e.set(t,e.has(t)?ot(e.get(t),n):n);for(let e of t)for(let t of e?.groups??[])for(let e of t){if(!e||e._repoIgnored||ae(e,e._repoFallback))continue;let t=V(e.repo);if(!t.id||!t.commit)continue;let n=$e(e.file),o=et(e.package);if(n!==null){let t=it(e,n),r=i.get(t),a=r===void 0?e.repo:r&&r.pkg===o?ot(r.repo,e.repo):null;i.set(t,a&&{repo:a,pkg:o})}o!==null&&!o.endsWith(`@`)&&a(r,o,e.repo)}nt={byRoot:i,byPackage:r}}function ct(e){return Number.isFinite(e)?n(e):null}function lt(e){if(e.length<=1)return{prefix:``,stripped:[...e]};let t=e.map(e=>e.split(`/`)),n=Math.min(...t.map(e=>e.length)),r=0;for(;r<n-1&&t.every(e=>e[r]===t[0][r]);)r++;return r>0&&t[0][r-1].startsWith(`@`)&&r--,r>0&&t[0][r-1]===`node_modules`&&r--,r===0?{prefix:``,stripped:[...e]}:{prefix:`${t[0].slice(0,r).join(`/`)}/`,stripped:t.map(e=>e.slice(r).join(`/`))}}function ut(e){return e.match(We)?.[1]??e}var B={on:new WeakMap,off:new WeakMap};function dt(e){let t=I?B.on:B.off,n=t.get(e);if(n===void 0){let r=I?[Pe(e),e.revalidateVerdict,e.revalidateRecommendation]:[];n=[e.file,e.title,e.description,e.impact,e.reproduction,an(e),e.recommendation,e.confidenceReason,...r,e.discoveredIn,e.repo?.github].filter(Boolean).join(`
2
+ `).toLowerCase(),t.set(e,n)}return n}function ft(e){B.on.delete(e),B.off.delete(e)}function pt(e){return[typeof e?.category==`string`?e.category.trim():``,T(e,I)].filter(Boolean).join(` · `)}function mt(e){if(e.length===0)return``;let t=e[0];for(let n=1;n<e.length;n++){for(;t&&!e[n].startsWith(t);)t=t.slice(0,-1);if(!t)return``}return t}function ht(e){if(!e)return``;let t=e.match(/github\.com\/([^/?#]+\/[^/?#]+?)(?:\.git)?(?:[/?#]|$)/iu);return t?t[1]:e}function gt(e){if(!e)return null;let t=e.trim().replace(/\/$/u,``);return t?/^https?:\/\//iu.test(t)?t:/^github\.com\//iu.test(t)?`https://${t}`:`https://github.com/${t}`:null}var _t=/^(?:@[\w.-]+\/)?[\w.-]+@[^/\s@]+$/u;function vt(e){return _t.test(e||``)}function V(e){if(e==null||typeof e==`string`)return{id:e??``,prefix:``,commit:``};let t=v(e);return{id:typeof e.github==`string`?e.github:``,prefix:t?`${t}/`:``,commit:re(e)}}function yt(e,t,n,r=``){if(vt(e))return null;let i=V(t),a=V(n),o=ne(r);if(i.id){let t=_({repo:{github:i.id}}),n=gt(t??i.id),r=M(t,_({repo:{github:a.id}}));return`${n}/blob/${i.commit||(r?a.commit:``)||(r||!Ze(e)?o:``)||`HEAD`}/${i.prefix}${ut(e)}`}if(z(e))return null;let s=gt(a.id);return s?`${s}/blob/${a.commit||o||`HEAD`}/${a.prefix}${e}`:null}function bt(e,t){let n=e?.file??``,r=H(e,t);return r?k`<a href="${xt(r)}" target="_blank" rel="noopener">${n}</a>`:n}function xt(e){return e.replace(wt,``)}function St({start:e,end:t}){return t>e?`#L${e}-L${t}`:`#L${e}`}function H(e,t){if(!e)return null;if(g(e.location))return e.location;let n=yt(e.file,e.repo,t,e.auditedCommit);if(!n)return null;let r=K(e.line);if(r)return`${n}${St(r)}`;let i=parseInt(e.line,10);return Number.isFinite(i)?`${n}#L${i}`:n}var Ct=/^https?:\/\/(?:www\.)?github\.com\/([^/\s]+\/[^/\s]+)\/(?:blob|tree|blame)\/[^/\s]+\/(\S+)$/u,wt=/#L(\d+)(?:-L?(\d+))?$/u;function Tt(e){let t=typeof e==`string`?Ct.exec(e):null;if(!t)return``;let n=wt.exec(t[2]);return n?`${t[1]}/${t[2].slice(0,n.index)}:${n[2]?`${n[1]}-${n[2]}`:n[1]}`:`${t[1]}/${t[2]}`}function Et(e,t){let n=[],r=0;for(let[i,a]of t)n.push(e.slice(r,i),e.slice(i,a)),r=a;return n.push(e.slice(r)),n}var Dt=/^(?:\s+\S|[-*+] |\d+[.)] |>|#{1,6}(?:[ \t]|$)|\||`{3}|~{3})/u;function Ot(e){return e.split(/(\n{2,})/u).map(e=>{if(/^\n+$/u.test(e))return e;let t=e.split(`
3
+ `);return t.some(e=>Dt.test(e)||W.test(e))?e:t.map(e=>e.trim()).filter(Boolean).join(` `)}).join(``)}function kt(e,t,n){let r=t?/^\n*/u.exec(e)[0]:``,i=e.slice(r.length),a=n?/\n*$/u.exec(i)[0]:``;return r+Ot(i.slice(0,i.length-a.length))+a}function At(e){if(!e)return e;let t=e.replaceAll(`\r
4
+ `,`
5
+ `),n=y(t);if(n.length===0)return Ot(t);let r=Et(t,n);return r.map((e,t)=>t%2||!e?e:kt(e,t>0,t<r.length-1)).join(``)}var jt=/^( *)(`{3,}|~{3,})(.*)$/u,Mt=/^[a-z0-9+#._-]{1,20}$/u;function Nt(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function Pt(e){let t=e.split(`
6
+ `),n=jt.exec(t[0]),r=(n?.[2]??"```").slice(0,3),i=(n?.[3]??``).trim().split(/\s+/u)[0].toLowerCase(),a=!!(t.length>1?jt.exec(t.at(-1)):null)?.[2].startsWith(r),o=n?.[1].length??0,s=t.slice(1,a?-1:void 0);return{lang:Mt.test(i)?i:``,code:(o>0?s.map(e=>Nt(e,o)):s).join(`
7
+ `)}}function Ft(e){let t=y(e||``);return t.length===0?[e]:Et(e,t).flatMap((e,t)=>{if(t%2)return[Pt(e)];let n=(t>0?e.replace(/^\n+/u,``):e).replace(/\n+$/u,``);return n?[n]:[]})}var U=/^( *)(?:[-*+]|(\d{1,9})[.)]) +(?=\S)/u,W=/^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/u;function It(e){return/^ */u.exec(e)[0].length}function Lt(e){let t=y(e),n=e.split(`
8
+ `),r=[],i=0;for(let e of n)r.push(i),i+=e.length+1;return{lines:n,inCode:e=>b(t,r[e])}}function Rt(e){let t=typeof e==`string`?e:``;if(!t)return[e];let{lines:n,inCode:r}=Lt(t),i=e=>!r(e)&&!W.test(n[e])&&U.test(n[e]),a=[],o=0,s=0,c=e=>{let t=n.slice(o,e).join(`
9
+ `).replace(/^\n+/u,``).replace(/\n+$/u,``);t.trim()&&a.push(t)};for(;s<n.length;){if(!i(s)){s++;continue}c(s);let e=U.exec(n[s]),t=!!e[2],l=[],u=null,d=!1;for(;s<n.length;){let e=n[s];if(!r(s)){if(!e.trim()){u.lines.push(``),d=!0,s++;continue}let n=It(e),r=W.test(e)?null:U.exec(e);if(r&&(!u||n<u.column)){if(!!r[2]!==t)break;u&&l.push(G(u.lines)),u={column:r[0].length,lines:[e.slice(r[0].length)]},d=!1,s++;continue}if(n<u.column&&(d||zt.test(e)||W.test(e)||Ht.test(e)))break}u.lines.push(Nt(e,u.column)),d=!1,s++}u&&l.push(G(u.lines)),a.push({ordered:t,start:t?Number(e[2]):null,items:l}),o=s}return a.length===0?[e]:(c(n.length),a)}var zt=/^ {0,3}(#{1,6})[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/u,Bt=/^ {0,3}-+[ \t]*$/u;function Vt(e){let t=e.split(`
10
+ `),n=[],r=0,i=e=>{let i=t.slice(r,e).join(`
11
+ `).replaceAll(/^(?:[ \t]*\n)+|(?:\n[ \t]*)+$/gu,``);i.trim()&&n.push(i)};return t.forEach((e,a)=>{let o=zt.exec(e),s=W.test(e)&&(a===r||!t[a-1].trim()||!Bt.test(e));!o&&!s||(i(a),n.push(o?{level:o[1].length,text:o[2]}:{rule:!0}),r=a+1)}),n.length===0?[e]:(i(t.length),n)}var Ht=/^ {0,3}>/u,Ut=/^ {0,3}> ?/u,Wt=/^[ \t]*\[!(note|tip|important|warning|caution)\][ \t]*$/iu,Gt=/^ {0,3}(?:`{3}|~{3})/u,Kt=/^(?: {0,3}> ?| *(?:[-*+]|\d{1,9}[.)])(?: +|$))*/u,qt=16,Jt=e=>zt.test(e)||W.test(e)||Gt.test(e);function Yt(e,t){let n=jt.exec(t);return n?e?n[2][0]===e[0]&&n[2].length>=e.length&&!n[3].trim()?``:e:n[2][0]==="`"&&n[3].includes("`")?``:n[2]:e}function G(e){let t=0,n=e.length;for(;t<n&&!e[t].trim();)t++;for(;n>t&&!e[n-1].trim();)n--;return e.slice(t,n).join(`
12
+ `)}function Xt(e,{alerts:t=!0}={}){let n=typeof e==`string`?e:``;if(!/^ {0,3}>/mu.test(n))return[e];let{lines:r,inCode:i}=Lt(n),a=e=>Ht.test(r[e])&&!i(e),o=[],s=0,c=0;for(;c<r.length;){if(!a(c)){c++;continue}c>s&&o.push(r.slice(s,c).join(`
13
+ `));let e=[],n=``,i=!1;for(;c<r.length;c++){let t=r[c];if(a(c)){let r=t.replace(Ut,``),a=n!==``;n=Yt(n,r);let o=r.replace(Kt,``);i=!a&&!n&&o.trim()!==``&&!Jt(o),e.push(r)}else if(i&&t.trim()&&!Jt(t)&&!U.test(t))e.push(t);else break}let l=t?Wt.exec(e[0]):null,u=l?G(e.slice(1)):``;o.push({quote:!0,alert:u?l[1].toLowerCase():null,body:u||G(e)}),s=c}return s<r.length&&o.push(r.slice(s).join(`
14
+ `)),o}function Zt(e,t=qt){return t<=0?e:Xt(e).map(e=>typeof e==`string`?e:Zt(e.body,t-1)).join(`
15
+ `)}var Qt=/^(\d+)(?:\s*-\s*(\d+))?$/u;function K(e){if(typeof e==`number`)return Number.isFinite(e)&&e>=1?{start:Math.floor(e),end:Math.floor(e)}:null;let t=Qt.exec(String(e??``).trim());if(!t)return null;let n=parseInt(t[1],10),r=t[2]===void 0?n:parseInt(t[2],10);return!Number.isFinite(n)||n<1||!Number.isFinite(r)||r<1?null:{start:Math.min(n,r),end:Math.max(n,r)}}function $t(e){return e?e.start===e.end?String(e.start):`${e.start}-${e.end}`:``}function en(e){if(e&&typeof e==`object`){let t=K(e.start);if(!t)return null;let n=K(e.end)??t;return{start:t.start,end:Math.max(t.start,n.end)}}return K(e)}function tn(e,t,n=4){let r=typeof e==`string`&&e!==``?e.split(`
16
+ `):[];if(r.length===0)return{text:``,startLine:1,lines:[]};let i=en(t),a=i&&{start:Math.min(i.start,r.length),end:Math.min(i.end,r.length)},o=a?Math.max(1,a.start-n):1,s=a?Math.min(r.length,a.end+n):Math.min(r.length,n*2+1),c=r.slice(o-1,s);return{text:c.join(`
17
+ `),startLine:o,lines:c}}function nn(e,t,n,r,i=null){if(g(e?.url))return e.url;let a=e?.file;if(typeof a!=`string`||a===``)return null;let o=t?.file??``,s=t?.repo?.github,c=t?.auditedCommit,l=t=>H({file:a,line:e?.line,...t},n);if(r===0&&a===o)return String(e?.line??``).trim()===String(t?.line??``).trim()?H(t,n):l({repo:t.repo,auditedCommit:c});if(V(e?.repo).id)return l({repo:e.repo});let u=$e(a),d=et(e?.package),f=d===null?u!==null&&u===$e(o):d===et(t?.package);if(s&&f)return l({repo:t.repo,auditedCommit:c});let p=u===null?null:nt.byRoot.get(it(t,u)),m=(d===null?null:nt.byPackage.get(d))??(p&&(d===null||p.pkg===d)?p.repo:null);if(m)return l({repo:m});if(Ze(a)){let t=i?.(e);return t?l({file:t.file,repo:t.repo}):null}return s&&!Ze(o)?l({repo:t.repo,auditedCommit:c}):l({auditedCommit:c})}function rn(e,{spaced:t=!1,link:n=e=>e.url,lineLinks:r=!1}={}){let i=Array.isArray(e?.evidence)?e.evidence:[];return i.length===0?``:i.map((e,t)=>{let i=O(e),a=n(e,t),o=[`${t+1}. ${a?`[${i}](${a})`:r?ke(i):i}`],s=r?sn(h(e),a):h(e);if(s)for(let e of s.split(`
18
+ `))o.push(` ${e}`);return o.join(`
19
+ `)}).join(t?`
20
+
21
+ `:`
22
+ `)}function an(e,{repoFallback:t,shipped:n=null}={}){let r=t!==void 0,i=rn(e,{link:r?(r,i)=>nn(r,e,t,i,n):void 0,lineLinks:r});return i?`**Evidence:**
23
+ ${i}`:``}var on=/\(\s*(?:lines?|L)\s*(\d+)(?:\s*(?:-|–|—|to)\s*L?(\d+))?\s*\)/giu;function sn(e,t){if(!e||!t||!Ct.test(t)||!/\(\s*(?:lines?|L)\s*\d/iu.test(e))return e;let n=xt(t),r=e=>{let t=cn(e);return e.replaceAll(on,(e,r,i,a)=>{let o=b(t,a)?null:K(i?`${r}-${i}`:r);return o?`([${e.slice(1,-1).trim()}](${n}${St(o)}))`:e})};return Et(e,y(e)).map((e,t)=>t%2?e:r(e)).join(``)}function cn(e){let t=[],n=[...e.matchAll(/`+/gu)].map(e=>[e.index,e.index+e[0].length]),r=[],i=new Map;for(let e=n.length-1;e>=0;e--){let t=n[e][1]-n[e][0];r[e]=i.get(t),i.set(t,e)}for(let e=0;e<n.length;e++)r[e]!==void 0&&(t.push([n[e][0],n[r[e]][1]]),e=r[e]);let[a,o,s,c]=[`
24
+ `,`]`,`)`,`>`].map(t=>{let n=Array.from({length:e.length+1},()=>1/0);for(let r=e.length-1;r>=0;r--)n[r]=e[r]===t?r:n[r+1];return n}),l=t.length,u=0;for(let n=0;n<e.length;n++){for(;u<l&&t[u][1]<=n;)u++;if(u<l&&t[u][0]<=n){n=t[u][1]-1;continue}let r=-1;if(e[n]===`[`&&o[n+1]<a[n]){r=o[n+1]+1;let t=e[r]===`(`?s[r]:e[r]===`[`?o[r+1]:1/0;t<a[r]&&(r=t+1)}else if(e[n]===`<`&&c[n+1]<a[n])r=c[n+1]+1;else if((e[n]===`h`||e[n]===`H`)&&/^https?:\/\//iu.test(e.slice(n,n+8))&&!/\w/u.test(e[n-1]??``))for(r=n;r<e.length&&!/\s/u.test(e[r]);)r++;r>n&&(t.push([n,r]),n=r-1)}t.sort((e,t)=>e[0]-t[0]);let d=[];for(let[e,n]of t){let t=d.at(-1);t&&e<t[1]?t[1]=Math.max(t[1],n):d.push([e,n])}return d}function ln(e){let t=/^\[([^\]]+)\]\(([^)\s]+)\)$/u.exec(e);return!t||!g(t[2])?null:{label:x(t[1].trim())||t[2],url:t[2]}}function un(e,t){let n=parseInt(e?.line,10);if(!Number.isFinite(n))return j;let r=H(e,t),i=`line ${n}`;return r?k`<a href="${r}" target="_blank" rel="noopener">${i}</a>`:i}function dn(e,t){return!e||!t?null:`${/^https?:/iu.test(e)?e.replace(/\/$/u,``):`https://github.com/${e}`}/commit/${t}`}var fn=[[`Impact`,`impact`],[`Reproduction`,`reproduction`],[`Recommendation`,`recommendation`],[`Confidence reason`,`confidenceReason`],[`Revalidation verdict`,`revalidateVerdict`],[`Revalidation recommendation`,`revalidateRecommendation`]];function pn(e,t){let n=[];t&&n.push(`Repo: ${t}`);let r=O(e);r&&n.push(`Location: ${r}`),e?.confidence!=null&&n.push(`Confidence: ${e.confidence}/10`);let i=L(e);i&&n.push(`Revalidation: ${i}`);let a=[];n.length>0&&a.push(n.join(`
25
+ `));let{title:o,body:s}=D(e);o&&a.push(`# ${o}`),s&&a.push(s.trim());let c=rn(e,{spaced:!0});c&&a.push(`# Evidence
26
+
27
+ ${c}`);for(let[t,n]of fn){if(!I&&n.startsWith(`revalidate`))continue;let r=E(e?.[n],e)?.trim();r&&a.push(`# ${t}
28
+
29
+ ${r}`)}return a.join(`
30
+
31
+ `)}function mn(e,{title:t,body:n,labels:r=[]}={}){let i=gt(e);if(!i)return null;try{if(new URL(i).host.toLowerCase()!==`github.com`)return null}catch{return null}let a=new URLSearchParams;t&&a.set(`title`,t),n&&a.set(`body`,n),r.length>0&&a.set(`labels`,r.join(`,`));let o=a.toString();return o?`${i}/issues/new?${o}`:`${i}/issues/new`}var hn=/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u,gn=/^[a-zA-Z\d._-]+$/u,_n=/^[1-9]\d{0,9}$/u,vn=/^[a-fA-F\d]{7,40}$/u,yn=/^#[\w-]+$/u,bn=/^GHSA(?:-[0-9a-z]{4}){3}$/u;function xn(e){return e.length<=39&&hn.test(e)}function Sn(e){return e.length<=100&&e!==`.`&&e!==`..`&&gn.test(e)}function Cn(e){let t;try{t=new URL(e)}catch{return null}if(t.href!==e||t.protocol!==`https:`||t.hostname.toLowerCase()!==`github.com`||t.port||t.username||t.password)return null;let n=t.pathname.split(`/`);if(n.at(-1)===``&&n.pop(),n.length===3&&n[1]===`advisories`){let e=n[2];return bn.test(e)?{url:`https://github.com/advisories/${e}`,label:e}:null}if(n.length===6&&n[3]===`security`&&n[4]===`advisories`){let[,e,t,,,r]=n;return!xn(e)||!Sn(t)||!bn.test(r)?null:{url:`https://github.com/${e}/${t}/security/advisories/${r}`,label:r}}if(n.length!==5)return null;let[,r,i,a,o]=n;if(!xn(r)||!Sn(i))return null;let s=a===`commit`?vn.test(o)&&`@${o.slice(0,7)}`:(a===`issues`||a===`pull`)&&_n.test(o)&&`#${o}`;return s?{url:`https://github.com/${r}/${i}/${a}/${o}${yn.test(t.hash)?t.hash:``}`,label:`${r}/${i}${s}`}:null}var wn=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/u;function Tn(e){if(typeof e!=`string`)return null;let t=En(e);return t!==e||wn.test(e)?t.slice(0,8):null}function En(e){let t=String(e);return t.startsWith(`https://chatgpt.com/codex/cloud/security/findings/`)?t.slice(50):t}function Dn(e,n){let r=t(e,{managed:n});if(!r)return null;let i=Tn(r.id);return{url:n?r.path:`#${r.fragment}`,label:i?`finding ${i}`:`finding`,self:!0}}var On=/https?:\/\/[^\s<>"'`(){}[\]|\\^]+/giu,kn=new Set([`)`,`.`,`,`,`!`,`?`,`;`,`:`,`'`,`"`,`*`,`]`,`}`,`>`]);function An(e){let t=e.length;for(;t>0&&kn.has(e[t-1]);)t--;return t===e.length?e:e.slice(0,t)}function jn(e,{managed:t=!1}={}){if(typeof e!=`string`||e.length===0)return[];let n=[],r=0;On.lastIndex=0;let i;for(;(i=On.exec(e))!==null;){let a=An(i[0]),o=a?Cn(a)??Dn(a,t):null;o&&(i.index>r&&n.push(e.slice(r,i.index)),n.push(o),r=i.index+a.length,On.lastIndex=r)}return r<e.length&&n.push(e.slice(r)),n}var Mn={commit:d},Nn=8;function Pn(e){let t;try{t=e?JSON.parse(e):null}catch{return null}let n=e=>typeof e==`string`&&e?e:null;return t&&{tags:Array.isArray(t.tags)?t.tags.filter(n):[],details:typeof t.title==`string`?{title:t.title,authorName:n(t.authorName),authorLogin:n(t.authorLogin),date:Number.isSafeInteger(t.date)?t.date:null}:null}}function q(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n!==void 0&&(r.textContent=n),r}function J(e,t,n,r){let i=q(e,t);return i.innerHTML=ue(n),i.append(q(`span`,``,r)),i}function Fn({title:e,authorName:t,authorLogin:n,date:r}){let i=q(`span`,`tooltip-commit-meta`,[t&&n&&t!==n?`${t} (@${n})`:t??(n&&`@${n}`),r===null?``:new Date(r).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`})].filter(Boolean).join(` · `)),a=q(`div`,`tooltip-commit-details`);return a.append(...e?[q(`span`,`tooltip-commit-message`,e)]:[],i),a}var Y;function In(){return Y||(Y=document.createElement(`div`),Y.id=`styled-tooltip`,Y.setAttribute(`popover`,`manual`),document.body.append(Y),Y)}function Ln(e){typeof e.showPopover==`function`&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}var X=null,Rn=``,Z=null,Q=null,zn=0,Bn=0,Vn=!1;function Hn(){if(!Vn){Vn=!0,document.addEventListener(`mousemove`,e=>{zn=e.clientX,Bn=e.clientY},{passive:!0});for(let e of[`pointerdown`,`wheel`,`scroll`])document.addEventListener(e,()=>$(),{capture:!0,passive:!0});document.addEventListener(`keydown`,e=>{e.key===`Escape`&&$()}),window.addEventListener(`blur`,()=>$())}}var Un=100,Wn=14,Gn=8,Kn=8;function qn(e,{placement:t=`cursor`}={}){Hn(),clearTimeout(Z),Z=null,Q=null,e.prepareTooltip?.(e),t=e.dataset.tooltipPlacement??t;let n=In(),i=e.dataset.tooltip??``,a=Object.hasOwn(Mn,e.dataset.tooltipIcon??``)?e.dataset.tooltipIcon:``,s=e.dataset.tooltipRepo??``,c=r(e.dataset.tooltipCommit),f=Pn(e.dataset.tooltipCommitInfo),p=[`stasis`,`sourcemap`].includes(e.dataset.tooltipBundle)?e.dataset.tooltipBundle:``,m=e.dataset.tooltipStats??``,h=e.dataset.tooltipBuilt===`true`,g=e.dataset.tooltipPackage??``,_=e.dataset.tooltipEcosystem??``,v=e.dataset.tooltipVersion??``,y=e.dataset.tooltipFiles??``,b=e.dataset.tooltipLoc??``,x=e.dataset.tooltipSize??``,S=e.tooltipContent??null,C=S??JSON.stringify([i,a,s,c,f,p,m,h,g,_,v,y,b,x]);if(!i){$();return}if(X===e&&Rn===C)return;if(n.textContent=a||S?``:i,S){let e=q(`div`,`tooltip-rich`);ee(S,e),n.append(e)}if(a&&n.append(J(`span`,`tooltip-text`,Mn[a],i)),g){let t=q(`div`,`tooltip-package`),r=(e.querySelector(`[data-tooltip-package-icon] svg`)??e.querySelector(`svg`))?.cloneNode(!0);r&&t.append(r);let i=q(`span`,`tooltip-package-details`),a=(e,t)=>/^\d+$/u.test(e)?`${Number(e).toLocaleString()} ${t}`:``;for(let e of[g,v,a(y,y===`1`?`file`:`files`),a(b,`LoC`),x].filter(Boolean))i.append(q(`span`,``,e));t.append(i),n.append(t)}if(s||c){let e=s?J(`div`,`tooltip-repo`,u,s):q(`div`,`tooltip-repo`);if(c&&e.append(J(`span`,`tooltip-commit`,d,c.slice(0,7))),n.append(e),c&&f?.tags.length){let e=q(`div`,`tooltip-tags`);for(let t of f.tags.slice(0,Nn))e.append(J(`span`,`tooltip-tag`,o,t));f.tags.length>Nn&&e.append(q(`span`,`tooltip-tag-more`,`+${(f.tags.length-Nn).toLocaleString()} more`)),n.append(e)}}if(f?.details&&n.append(Fn(f.details)),p||m||h){let e=[p===`stasis`?`Stasis`:p===`sourcemap`?`Sourcemap`:``,h?`Built on server`:``,m].filter(Boolean).join(` · `);if(p===`stasis`){let t=q(`div`,`tooltip-bundle`),r=document.createElement(`img`);r.src=`./stasis.svg`,r.alt=``,t.append(r,q(`span`,``,e)),n.append(t)}else n.append(J(`div`,`tooltip-bundle`,l,e))}Ln(n),n.style.left=`0px`,n.style.top=`0px`,n.style.transform=`none`,n.classList.add(`visible`);let w=zn,T=Bn+Wn;if(t===`right`||t===`right-start`){let n=e.getBoundingClientRect();w=n.right+Gn,T=n.top+(t===`right`?n.height/2:0)}let E=window.innerWidth-n.offsetWidth-Kn,D=Math.max(Kn,Math.min(w,E));n.style.left=`${Math.round(D)}px`;let O=n.offsetHeight,k=t===`right`?T-O/2:T,A=window.innerHeight-O-Kn,j=Math.max(Kn,Math.min(k,A));n.style.top=`${Math.round(j)}px`,X=e,Rn=C}function $(e){e&&!e.contains(X)&&!e.contains(Q)||(clearTimeout(Z),Z=null,Q=null,Y&&(Y.classList.remove(`visible`),typeof Y.hidePopover==`function`&&Y.matches(`:popover-open`)&&Y.hidePopover()),X=null)}function Jn(e,{gate:t,placement:n}={}){Hn();let r=()=>e.isConnected!==!1&&(!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&(!t||t(e));r()?e===X||e===Q||($(),Q=e,Z=setTimeout(()=>{Z=null,Q=null,r()&&qn(e,{placement:n})},Un)):$()}var Yn=new WeakSet;function Xn(e,t){for(let n of e.composedPath()){if(n===t)break;if(n.nodeType===1&&Object.hasOwn(n.dataset,`tooltip`))return n}return null}function Zn(e,t){!e||Yn.has(e)||(Yn.add(e),e.ownerDocument&&Hn(),e.addEventListener(`mouseover`,n=>{if(n.buttons){$();return}let r=Xn(n,e);r?r!==X&&Jn(r,t):$()}),e.addEventListener(`mouseout`,t=>{let n=Xn(t,e),r=t.relatedTarget?.closest?.(`[data-tooltip]`)??null;n&&n===r||$()}),e.addEventListener(`scroll`,()=>$(e),{capture:!0,passive:!0}))}var Qn=e=>Zn(e,{gate:e=>!Object.hasOwn(e.dataset,`tooltipTruncated`)||e.scrollWidth>e.clientWidth}),$n=!1;function er(){$n||($n=!0,Hn(),document.addEventListener(`tooltip-root-connected`,e=>{Zn(e.composedPath()[0]?.shadowRoot)}),document.body.addEventListener(`mouseover`,e=>{if(e.target.closest(`[data-tooltip-managed]`))return;if(e.buttons){$();return}let t=e.target.closest(`[data-tooltip]`);!t||t===X||Jn(t)}),document.body.addEventListener(`mouseout`,e=>{e.target.closest(`[data-tooltip-managed]`)||e.relatedTarget?.closest?.(`[data-tooltip-managed]`)||!X&&!Z||(X??Q)?.contains(e.relatedTarget)||$()}))}function tr(e){return`tree-`+e.replaceAll(/[^\w-]+/gu,`_`)}var nr=()=>Object.fromEntries(S.map(e=>[e,0]));function rr(e,t){let n=new Map;for(let r of e)for(let e of r){n.has(e.file)||n.set(e.file,nr());let r=n.get(e.file),i=C(e,t);r[i]!==void 0&&r[i]++}return n}var ir={trees:[],merged:null};function ar(e){let t=e.map(e=>e?.tree??null);return t.length===ir.trees.length&&t.every((e,t)=>e===ir.trees[t])||(ir={trees:t,merged:or(e)}),ir.merged}function or(e){let t=null;for(let n of e)if(n?.tree){t||={};for(let e of Object.keys(n.tree)){let r=n.tree[e];if(!t[e]){t[e]={...r,imports:[...r.imports??[]]};continue}let i=new Set(t[e].imports);for(let n of r.imports??[])i.has(n)||(i.add(n),t[e].imports.push(n));t[e].size==null&&r.size!=null&&(t[e].size=r.size)}}return t}function sr(e,t){let n=Object.keys(e),r=new Map(n.map((e,t)=>[e,t])),i=n.map(()=>nr()),a=n.map(()=>[]);for(let[t,i]of n.entries())for(let n of e[i].imports??[]){let e=r.get(n);e!==void 0&&a[e].push(t)}let o=new Uint32Array(n.length),s=0;for(let[e,n]of t){let t=r.get(e);if(t===void 0||!n)continue;let c=S.map(e=>[e,n[e]??0]).filter(([,e])=>e!==0);if(c.length===0)continue;let l=++s,u=[],d=e=>{o[e]!==l&&(o[e]=l,u.push(e))};for(let e of a[t])d(e);for(;u.length>0;){let e=u.pop();for(let[t,n]of c)i[e][t]+=n;for(let t of a[e])d(t)}}return new Map(n.map((e,t)=>[e,i[t]]))}function cr(e,t,n){return lr(t.get(e))>0||lr(n.get(e))>0}function lr(e){return e?S.reduce((t,n)=>t+(e[n]??0),0):0}var ur={dark:`#0c0c0c`,light:`#f6f8fa`,pink:`#fff0f7`,w95:`#fff`,paper:`#fff`};function dr(){let e=typeof document>`u`?null:document.body?.classList;return[`paper`,`pink`,`w95`,`light`].find(t=>e?.contains(`theme-${t}`))??`dark`}var fr=()=>ur[dr()];function pr(e){let t=[1,3,5].map(t=>{let n=parseInt(e.slice(t,t+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4});return t[0]*.2126+t[1]*.7152+t[2]*.0722>.18?`#000`:`#fff`}function mr(e){if(!e)return null;let t=e.match(RegExp(`^(?:.*/)?${Je()}/(@[^/]+/[^/]+|[^/]+)`,`u`));return t?t[1]:`__own__`}function hr(e){return new Set(e.filter(e=>!z(e)))}var gr=[`#4e9af1`,`#f28e2b`,`#59a14f`,`#e15759`,`#76b7b2`,`#edc948`,`#b07aa1`,`#ff9da7`,`#9c755f`,`#5cd1e5`,`#f1ce63`,`#d37295`,`#a0cbe8`,`#86bcb6`,`#8cd17d`,`#b6992d`,`#499894`,`#e15759`,`#e879c7`,`#d4a6c8`],_r=[`#2f8aef`,`#d2691e`,`#2ea043`,`#e63946`,`#2e9a92`,`#b88817`,`#9560e8`,`#d24a9c`,`#8a5d40`,`#0891b2`,`#a07a14`,`#c14e8e`,`#1f7ad0`,`#549b94`,`#3fb95f`,`#a07a14`,`#2a8278`,`#cb2c40`,`#c026d3`,`#965f93`],vr=()=>dr()===`dark`?gr:_r,yr=new Map;function br(e){let t=vr();return t[e%t.length]}var xr=()=>dr()===`dark`?`#6e7681`:`#8c959f`;function Sr(e){let t=vr(),n=e??`__own__`,r=`${t===_r?`l`:`d`}:${n}`;if(yr.has(r))return yr.get(r);let i=0;for(let e of n)i=i*37+e.codePointAt(0)|0;let a=t[((i%t.length+t.length)%t.length*7+3)%t.length];return yr.set(r,a),a}function Cr(e,t){if(!t||t===`/`||t===`__own__`)return e;for(let n of[`node_modules`,`dependencies`,Je()]){let r=n+`/`+t+`/`,i=e.indexOf(r);if(i>=0)return e.slice(i+r.length)}return e.startsWith(t+`/`)?e.slice(t.length+1):e}function wr(e){let t=e.origFile??e.file,n=Cr(t,e.pkg),r=n===t?t:`${a(e.pkg)}/${n}`;return r===t?e.file:r}var Tr={package:`@babel/core`,path:/^lib\/config\//u},Er={package:`@babel/core`,path:/^lib\/config\/files\/(?:module-types|plugins)\.js$/u},Dr=Object.freeze([{id:`react-native-codegen-discovery`,reason:`Codegen discovers package metadata and React Native configuration.`,from:{package:`react-native`,path:/^scripts\/codegen\/generate-artifacts-executor\.js$/u},to:{path:/(?:^|\/)(?:package\.json|react-native\.config\.js)$/u}},{id:`react-native-release-version`,reason:`The CLI release checker reads the installed React Native version.`,from:{package:`@react-native-community/cli-tools`,path:/^build\/releaseChecker\/index\.js$/u},to:{package:`react-native`,path:/^package\.json$/u}},{id:`react-native-platform-config`,reason:`React Native configuration loads platform CLIs supplied by the host project.`,from:{package:`react-native`,path:/^react-native\.config\.js$/u},to:{package:/^@react-native-community\/cli-platform-(?:android|ios)$/u,path:/^build\/index\.js$/u}},{id:`babel-project-config`,reason:`Babel discovers project configuration.`,from:Tr,to:{path:/(?:^|\/)babel\.config\.js$/u}},{id:`babel-typescript-preset`,reason:`Babel configuration loads the TypeScript preset.`,from:Tr,to:{package:`@babel/preset-typescript`,path:/./u}},{id:`babel-react-native-preset`,reason:`Babel config loaders load the configured React Native preset.`,from:Er,to:{package:`@react-native/babel-preset`,path:/^(?:src\/)?index\.js$/u}},{id:`babel-reanimated-plugin`,reason:`Babel config loaders load the configured Reanimated plugin, including scoped copies.`,from:Er,to:{package:/^(?:@[^/]+\/)?react-native-reanimated$/u,path:/^plugin\/index\.js$/u}},{id:`babel-transform-plugin`,reason:`Babel config loaders load configured transform plugins.`,from:Er,to:{package:/^@babel\/plugin-transform-[^/]+$/u,path:/^lib\/index\.js$/u}},{id:`cosmiconfig-config`,reason:`Cosmiconfig loads discovered configuration, including dependency configuration.`,from:{package:`cosmiconfig`,path:/^dist\/loaders\.js$/u},to:{path:/\.config\.js$/u}},{id:`import-fresh-own-config`,reason:`import-fresh loads host-project configuration.`,from:{package:`import-fresh`,path:/./u},to:{path:/\.config\.js$/u},ownSourceOnly:!0}].map(e=>Object.freeze({...e,from:Object.freeze(e.from),to:Object.freeze(e.to)})));function Or(e){return typeof e==`string`&&!e.includes(`\\`)&&!e.includes(`:`)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e!==`node_modules`)}function kr(e,t){let n=e.package;return n!==void 0&&t.ownSource===!0?!1:(n===void 0||(typeof n==`string`?n===t.package:n.test(t.package??``)))&&e.path.test(t.path)}function Ar(e,t){if(e?.ownSource!==!0&&Or(e?.path)&&Or(t?.path))return Dr.find(n=>(!n.ownSourceOnly||t.ownSource===!0)&&kr(n.from,e)&&kr(n.to,t))}function jr(e,t){let n=e.split(/(?:^|\/)node_modules\//u).slice(1).at(-1)?.match(/^(@[^/]+\/[^/]+|[^/]+)\/(.+)$/u);return{package:n?.[1],path:n?.[2]??e.replace(/^\/+/u,``),ownSource:t??i(e)===`__own__`}}function Mr(e,t,n,r){return!Ar(jr(e,r),jr(t,n))}function Nr(e,t=e=>e.file){let n=new Map(e.nodes.map(e=>[e.file,e])),r=new Map(e.nodes.map(e=>[t(e),new Set]));for(let[i,a]of e.importsOf){let o=n.get(i);if(o)for(let s of a){let a=n.get(s);a&&Mr(o.origFile??i,a.origFile??s,e.ownSourceFiles?.has(s),e.ownSourceFiles?.has(i))&&r.get(t(o)).add(t(a))}}return r}var Pr=class{constructor(e){this.nodes=[...e];for(let[e,t]of this.nodes.entries())t.position=e;for(let e=(this.nodes.length>>1)-1;e>=0;e--)this.down(e)}before(e,t){return Math.abs(e.balance)>Math.abs(t.balance)||Math.abs(e.balance)===Math.abs(t.balance)&&(e.balance>t.balance||e.balance===t.balance&&e.tie<t.tie)}swap(e,t){let n=this.nodes,r=n[e];n[e]=n[t],n[t]=r,n[e].position=e,n[t].position=t}down(e){let t=this.nodes;for(;2*e+1<t.length;){let n=2*e+1;if(n+1<t.length&&this.before(t[n+1],t[n])&&n++,!this.before(t[n],t[e]))break;this.swap(e,n),e=n}}update(e){if(e.position<0)return;let t=e.position;for(;t>0;){let n=t-1>>1;if(!this.before(e,this.nodes[n]))break;this.swap(t,n),t=n}this.down(t)}take(){let e=this.nodes[0],t=this.nodes.pop();return e.position=-1,this.nodes.length>0&&(this.nodes[0]=t,t.position=0,this.down(0)),e}};function Fr(e,t){for(let n=0;n<8;n++){let r=!1;for(let i=0;i<e.length-1;i++){let a=n%2?e.length-2-i:i,o=e[a],s=e[a+1];(t.get(s)?.get(o)?.cycleCount??0)<=(t.get(o)?.get(s)?.cycleCount??0)||(e[a]=s,e[a+1]=o,r=!0)}if(!r)break}return e}function Ir(e){let t=[],n=new Set;for(let t of e.values())t.outgoing.sort((e,t)=>t[1]-e[1]||e[0].tie-t[0].tie);for(let r of e.values()){if(n.has(r))continue;let e=[{node:r,next:0}];for(n.add(r);e.length>0;){let r=e.at(-1);if(r.next===r.node.outgoing.length){t.push(r.node.id),e.pop();continue}let i=r.node.outgoing[r.next++][0];n.has(i)||(n.add(i),e.push({node:i,next:0}))}}return t.toReversed()}function Lr(e,t){let n=new Map(e.map((e,t)=>[e,t])),r=0;for(let e of t.values())for(let[t,i]of e.outgoing)n.get(e.id)<n.get(t.id)&&(r+=i);return r}function Rr(e,t){let n=Lr(e,t),r=n,i=0;for(let a=0;a<e.length-1;a++)n-=t.get(e[a]).originalBalance,n>r&&(r=n,i=a+1);return[...e.slice(i),...e.slice(0,i)]}function zr(e,t){if(e.length<2)return e;let n=new Map(e.map((e,t)=>[e,{id:e,tie:t,balance:0,incoming:[],outgoing:[]}]));for(let e of n.values())for(let r of t.get(e.id)?.values()??[]){let t=n.get(r.to);!t||t===e||!r.cycleCount||(e.outgoing.push([t,r.cycleCount]),t.incoming.push([e,r.cycleCount]),e.balance+=r.cycleCount,t.balance-=r.cycleCount)}for(let e of n.values())e.originalBalance=e.balance;let r=[],i=new Pr(n.values()),a=[];for(;i.nodes.length>0;){let e=i.take();e.balance>=0?r.push(e.id):a.push(e.id);for(let[t,n]of e.outgoing)t.position<0||(t.balance+=n,i.update(t));for(let[t,n]of e.incoming)t.position<0||(t.balance-=n,i.update(t))}let o=e,s=Lr(e,n);for(let i of[[...r,...a.toReversed()],Ir(n),e,e.toReversed()]){let e=Fr(Rr(i,n),t),r=Lr(e,n);r>s&&(o=e,s=r)}return o}function Br(e,t){let n=new Set(e),r=new Map(e.map(e=>[e,[]]));for(let[e,i]of t)for(let t of i)n.has(e)&&n.has(t)&&r.get(t).push(e);let i=[],a=new Set;for(let r of e){if(a.has(r))continue;a.add(r);let e=[[r,(t.get(r)??[])[Symbol.iterator]()]];for(;e.length>0;){let[r,o]=e.at(-1),s=o.next();s.done?(i.push(r),e.pop()):n.has(s.value)&&!a.has(s.value)&&(a.add(s.value),e.push([s.value,(t.get(s.value)??[])[Symbol.iterator]()]))}}let o=new Map,s=[];for(let e of i.toReversed()){if(o.has(e))continue;let t=[],n=s.length,i=[e];for(o.set(e,n);i.length>0;){let e=i.pop();t.push(e);for(let t of r.get(e))o.has(t)||(o.set(t,n),i.push(t))}s.push(t.toSorted())}return{groups:s,componentOf:o}}function Vr(e,t){let{groups:n,componentOf:r}=Br(e,t),i=n.map(()=>0),a=n.map(()=>new Set);for(let[e,n]of t)for(let t of n){let n=r.get(e),o=r.get(t);n!==o&&!a[n].has(o)&&(a[n].add(o),i[o]++)}let o=[...i],s=[];o.forEach((e,t)=>{e||s.push(t)});for(let e of s)for(let t of a[e])--o[t]===0&&s.push(t);return{groups:n,componentOf:r,next:a,incoming:i,order:s}}function Hr(e,{expanded:t=new Set,order:n=`structure`,query:r=``,neighborhood:i=null,cyclesOnly:o=!1}={}){let s=new Map,c=new Map,l=new Map;for(let n of e.nodes){let e=t.has(n.pkg),r=`${e?`f`:`p`}:${e?n.file:n.pkg}`;s.has(r)||s.set(r,{id:r,pkg:n.pkg,file:e?n.file:null,label:e?wr(n):a(n.pkg),files:[],size:0,issues:0,incoming:0,outgoing:0,importers:0,dependencies:0});let i=s.get(r);i.files.push(n.file),i.size+=n.size??0,i.issues+=n.totalIssues??0,c.set(n.file,r),l.set(n.file,n.origFile??n.file)}let u=new Map,d=new Set,f=new Set,p=new Map([...s.keys()].map(e=>[e,new Set])),m=0;for(let[t,n]of e.importsOf){let r=c.get(t);if(r)for(let i of new Set(n)){let n=c.get(i);if(!n)continue;u.has(r)||u.set(r,new Map),u.get(r).has(n)||u.get(r).set(n,{from:r,to:n,count:0,cycleCount:0,examples:[]});let a=u.get(r).get(n);a.count++;let h=Mr(l.get(t),l.get(i),e.ownSourceFiles?.has(i),e.ownSourceFiles?.has(t));a.examples.length<80&&(!o||h)&&a.examples.push([t,i]),m++,s.get(r).outgoing++,s.get(n).incoming++,r!==n&&(f.add(r),d.add(n)),h&&(a.cycleCount++,(r!==n||s.get(r).file)&&p.get(r).add(n))}}let h=[...s.keys()].toSorted(),{groups:g,componentOf:_}=Br(h,p),v=new Set(g.flatMap(e=>e.length>1||p.get(e[0]).has(e[0])?e:[]));for(let e of s.values())e.cyclic=v.has(e.id),e.component=_.get(e.id);let y=e.ownSourcePackages??new Set(e.layerRoots?.roots??[]),b=e=>e.pkg===`__own__`?0:y.has(e.pkg)?1:2,x=e=>d.has(e.id)&&f.has(e.id)?0:1,S=new Map(g.map((e,t)=>[t,e.reduce((e,t)=>Math.min(e,b(s.get(t))),2)])),C=(e,t)=>e.pkg.localeCompare(t.pkg)||e.label.localeCompare(t.label),w=new Map;if(n===`structure`){for(let e of g)if(!(e.length<2))for(let t of Map.groupBy(e,e=>b(s.get(e))).values())zr(t.toSorted((e,t)=>C(s.get(e),s.get(t))),u).forEach((e,t)=>w.set(e,t))}if(o){m=0,d.clear(),f.clear();for(let e of s.values())e.incoming=0,e.outgoing=0}for(let[e,t]of u){for(let n of t.values())if(n.cyclic=n.cycleCount>0&&v.has(e)&&_.get(e)===_.get(n.to)&&(e!==n.to||s.get(e).file!==null),o){if(!n.cyclic){t.delete(n.to);continue}n.count=n.cycleCount,m+=n.count,s.get(e).outgoing+=n.count,s.get(n.to).incoming+=n.count,e!==n.to&&(f.add(e),d.add(n.to))}t.size===0&&u.delete(e)}for(let[e,t]of u)for(let n of t.keys())e!==n&&(s.get(e).dependencies++,s.get(n).importers++);let T=r.trim().toLowerCase(),E=new Set(h.filter(e=>!T||s.get(e).files.some(e=>e.toLowerCase().includes(T))||s.get(e).label.toLowerCase().includes(T))),D=new Set(i?[i]:E);if(T||i)for(let[e,t]of u)for(let n of t.keys())(i?e===i:E.has(e))&&D.add(n),(i?n===i:E.has(n))&&D.add(e);let O=(e,t)=>{if(n===`structure`){let n=S.get(e.component)-S.get(t.component);if(n)return n;let r=x(e)-x(t);if(r)return r;let i=e.component-t.component;if(i)return i}let r=b(e)-b(t);if(r)return r;if(n===`importers`)return t.importers-e.importers||C(e,t);if(n===`imports`)return t.dependencies-e.dependencies||C(e,t);let i=x(e)-x(t);if(i)return i;if(n===`structure`&&e.component===t.component){let n=(w.get(e.id)??0)-(w.get(t.id)??0);if(n)return n}return C(e,t)},k=[...s.values()].filter(e=>D.has(e.id)&&(!o||e.cyclic)).toSorted(O),A=new Map(k.map((e,t)=>[e.id,t])),j=[];for(let[e,t]of u)if(A.has(e))for(let n of t.values())A.has(n.to)&&j.push({...n,row:A.get(e),col:A.get(n.to)});return{rows:k,byId:s,cells:u,visibleCells:j,index:A,matches:E,importCount:m,totalRows:s.size,cycleCount:g.filter(e=>v.has(e[0])).length}}export{te as a,ie as b,ae as c,oe as d,ue as e,de as f,N as g,fe as h,P as i,pe as j,he as k,_e as l,ve as m,ye as n,be as o,F as p,Se as q,we as r,Ee as s,De as t,Oe as u,ke as v,Ae as w,je as x,L as y,Me as z,Ne as A,Pe as B,Fe as C,Le as D,Re as E,qe as F,Je as G,z as H,Xe as I,st as J,ct as K,lt as L,dt as M,ft as N,pt as O,mt as P,ht as Q,bt as R,H as S,Tt as T,At as U,Ft as V,Rt as W,Vt as X,qt as Y,Xt as Z,Zt as _,K as $,$t as aa,tn as ba,nn as ca,an as da,ln as ea,un as fa,dn as ga,pn as ha,mn as ia,Tn as ja,En as ka,jn as la,qn as ma,$ as na,Jn as oa,Zn as pa,Qn as qa,er as ra,tr as sa,rr as ta,ar as ua,sr as va,cr as wa,lr as xa,ur as ya,dr as za,fr as Aa,pr as Ba,mr as Ca,hr as Da,br as Ea,xr as Fa,Sr as Ga,zr as Ha,Cr as Ia,wr as Ja,Mr as Ka,Nr as La,Br as Ma,Vr as Na,Hr as Oa};
32
+ /*! Bundled license information:
33
+
34
+ lit-html/directives/class-map.js:
35
+ (**
36
+ * @license
37
+ * Copyright 2018 Google LLC
38
+ * SPDX-License-Identifier: BSD-3-Clause
39
+ *)
40
+ */
@@ -0,0 +1 @@
1
+ function e(e=null){let t=[`anthropic/claude-opus-5.5`,`anthropic/claude-fable-5.2`,`anthropic/claude-sonnet-5.5`,`anthropic/claude-haiku-5.5`,`openai/gpt-6.2-astra`,`openai/gpt-6.2-astra-pro`,`openai/gpt-6.2-sol`,`openai/gpt-6.2-sol-pro`,`openai/gpt-6.1-terra`,`openai/gpt-6.1-terra-pro`,`openai/gpt-6-luna`,`openai/gpt-6-luna-pro`,`moonshotai/kimi-k3.1-pro`,`moonshotai/kimi-k3`,`google/gemini-4-carbon`,`google/gemini-4-argon`,`google/gemini-4-hydrogen`,`google/gemma-4-31b-it`,`x-ai/grok-4.7`,`z-ai/glm-5.3`,`qwen/qwen4-max`,`deepseek/deepseek-v4.1-flash`,`deepseek/deepseek-v4-pro`,`mistralai/mistral-large-4-0`],n=e===`moonshot`?`moonshotai`:e,r=t.filter(t=>![`anthropic`,`openai`,`moonshot`].includes(e??``)||t.startsWith(`${n}/`)).map(e=>({id:e,efforts:[`low`,`medium`,`high`,`xhigh`,`max`]}));return{models:r,defaultModel:r[0].id}}export{e as a};
@@ -0,0 +1,2 @@
1
+ var e=`:host{display:flex;flex-direction:column;position:relative;padding:0 clamp(1rem,3vw,3rem) 3rem;color:var(--text);container-type:inline-size;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:.875rem;line-height:1.5;--page-width: 76rem;--panel:color-mix(in srgb, var(--bg) 50%, var(--surface));--panel-hover:color-mix(in srgb, var(--text) 3%, var(--panel))}*,*:before,*:after{box-sizing:border-box}button,summary,select,label,legend,h1,h2,h3,.section-heading,.ui-hint,.page-intro>.intro,.count,.result-count,.repository-count,.breadcrumb-separator,.list-head,.report-list-head,.history-head,.bundle-group-head,.drop-copy,.local-import-copy,.location-field>span,.empty:not(.error,[role=alert]),.msg:not(.error,[role=alert]),.local-import-message:not(.error,[role=status]),.data-empty,.revision-empty{cursor:default;user-select:none;-webkit-user-select:none}input:not([type=checkbox],[type=radio]),textarea,[contenteditable],pre,code,.mono{cursor:text;user-select:text;-webkit-user-select:text}.wrap{width:100%;max-width:var(--page-width);margin:0 auto;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:none;scrollbar-gutter:stable}.manage-header{position:sticky;top:0;z-index:2}.wrap:has(>.manage-list){display:flex;flex-direction:column;overflow:hidden;scrollbar-gutter:auto}.wrap:has(>.manage-list)>:not(.manage-list){flex:none}.manage-list{position:relative;flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.manage-list.has-intro{margin-top:calc(-.45rem - 1px);padding-top:calc(.45rem + 1px)}.manage-nav button{flex:0 0 auto;position:relative;min-height:3.7rem;padding:.9rem 0;border:0;border-radius:0;color:var(--muted);background:none;font-size:.8rem;font-weight:500;white-space:nowrap}.manage-nav button:hover,.manage-nav button[aria-current=page]{color:var(--text)}.manage-nav button[aria-current=page]:after{content:"";position:absolute;bottom:.6rem;inset-inline:0;height:2px;background:var(--accent);border-radius:var(--ui-radius, 2px)}.manage-nav button:focus-visible{outline-offset:-3px}.head{display:flex;align-items:center;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem}h1,.head h1{margin:0;font-size:1.9rem;font-weight:600;letter-spacing:-.045em;line-height:1.2}.count{display:inline-flex;align-items:center;justify-content:center;min-width:1.6rem;padding:.12rem .5rem;border:1px solid var(--border);border-radius:6px;color:var(--muted);background:var(--surface);font-size:.73rem;font-weight:500;font-variant-numeric:tabular-nums}button,input,select{font:inherit}button,a,input,select{-webkit-app-region:no-drag}button,a{transition:background .15s,color .15s,border-color .15s}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}input:not([type=checkbox],[type=radio]):focus{outline:none;border-color:var(--accent)}button:disabled,select:disabled{opacity:.45}input:not([type=checkbox]),select{min-width:0;min-height:2.25rem;padding:.45rem .65rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--bg);color:var(--text);font-size:.8rem}input::placeholder{color:var(--muted)}input[type=checkbox]{accent-color:var(--accent);cursor:default}.btn,.drop-browse{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:2.25rem;height:auto;padding:.45rem .8rem;border:1px solid var(--border);border-radius:var(--ui-radius, 7px);background:var(--surface);color:var(--text);font-size:.8rem;font-weight:500;text-decoration:none;white-space:nowrap}.btn:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--surface-active);border-color:var(--muted)}.btn.primary,.drop-browse{color:var(--bg);background:var(--accent);border-color:var(--accent)}.btn.primary:hover:not(:disabled),.drop-browse:hover:not(:disabled){background:var(--accent);filter:brightness(1.08)}.btn svg,.icon-btn svg{width:1rem;height:1rem}.icon-btn{display:inline-grid;place-items:center;flex:0 0 auto;width:2rem;height:2rem;padding:0;border:1px solid transparent;border-radius:var(--ui-radius, 5px);color:var(--muted);background:transparent}.icon-btn:hover:not(:disabled){color:var(--text);background:var(--surface-active)}.icon-btn.danger:hover:not(:disabled){color:var(--critical);background:rgb(from var(--critical) r g b / .1)}.avatar{color:var(--accent);background:color-mix(in srgb,var(--accent) 12%,var(--bg));border:1px solid color-mix(in srgb,var(--accent) 16%,var(--border))}.avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.avatar img.broken{display:none}.breadcrumb{display:flex;align-items:center;flex-basis:100%;gap:.4rem;margin-bottom:.8rem}.breadcrumb-manage{padding:.1rem 0;border:0;background:transparent;color:var(--muted);font-size:.78rem}.breadcrumb-manage:hover{color:var(--text)}.breadcrumb-separator{color:var(--muted)}.breadcrumb .breadcrumb-current{margin:0;color:var(--text);font-size:.85rem;font-weight:500}.msg{margin:1rem 0;padding:1.1rem 1.25rem;border:1px solid var(--border);border-radius:var(--ui-radius, 9px);color:var(--muted);font-size:.85rem}.msg.error{color:var(--critical);border-color:color-mix(in srgb,var(--critical) 35%,var(--border))}.empty{padding:3.5rem 1.5rem;border:1px dashed var(--border);border-radius:var(--ui-radius, 10px);color:var(--muted);text-align:center}.empty strong{display:block;margin-bottom:.4rem;color:var(--text);font-size:.95rem;font-weight:500}.empty p{margin:0;font-size:.85rem}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@container (max-width: 35rem){.drop-copy>span{display:none}.manage-nav button{min-height:3.25rem}h1,.head h1{font-size:1.65rem}}@media(prefers-reduced-motion:reduce){button,a{transition:none}}.collection-toolbar input{flex:1;max-width:26rem;min-width:10rem}.collection-toolbar select{min-width:10rem}.result-count{text-align:right;white-space:nowrap;margin-left:auto;color:var(--muted);font-size:.75rem;font-variant-numeric:tabular-nums}@container (max-width: 35rem){.collection-toolbar input{flex-basis:100%;max-width:none}}.manage-nav{display:flex;gap:1.35rem;align-items:stretch;overflow-x:auto;scrollbar-width:thin;border-bottom:1px solid var(--border);margin-bottom:1.5rem;padding:0 .1rem}.wrap>:not(.manage-header),.manage-nav{-webkit-app-region:no-drag;app-region:no-drag}@media(display-mode:window-controls-overlay){.manage-header{display:flow-root}.manage-header:before{content:"";float:right;width:var(--wco-right-toolbar, 0px);height:var(--wco-titlebar-height)}.manage-nav{width:max-content;max-width:100%;border-bottom:0}.manage-nav button{min-height:var(--wco-titlebar-height);padding-block:.35rem}.manage-nav button[aria-current=page]:after{bottom:0}}.intro{margin:0 0 1.25rem;max-width:46rem;color:var(--muted);font-size:.875rem;line-height:1.65}.collection-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem;margin-bottom:.85rem}.page-intro{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.5rem 1rem;margin-bottom:1.25rem}.page-intro .intro{margin:0}.page-intro>.btn{margin-block:calc(-.45rem - 1px)}a{cursor:default}.loading-rows{border:1px solid var(--border);border-radius:var(--ui-radius, 10px);overflow:hidden}.loading-row{display:grid;align-content:center;gap:.6rem;min-height:4.25rem;padding:.85rem 1rem}.loading-row+.loading-row{border-top:1px solid var(--border)}.loading-row span{width:40%;height:.65rem;border-radius:3px;background:color-mix(in srgb,var(--muted) 15%,transparent)}.loading-row span+span{width:65%;height:.5rem}.dropzone{position:absolute;inset:.6rem;z-index:5;display:grid;place-items:center;border:2px dashed var(--accent);border-radius:var(--ui-radius, 10px);background:rgb(from var(--bg) r g b / .94);color:var(--accent);font-weight:600;pointer-events:none}.drop-card{display:flex;align-items:center;gap:.75rem;margin-bottom:1rem;padding:.7rem .85rem;border:1px dashed color-mix(in srgb,var(--muted) 35%,var(--border));border-radius:var(--ui-radius, 8px);background:var(--panel)}.drop-icon{display:grid;place-items:center;flex-shrink:0;width:1.8rem;height:1.8rem;color:var(--muted)}.drop-icon svg{width:1.1rem;height:1.1rem}.drop-copy{min-width:0;display:flex;align-items:baseline;flex-wrap:wrap;gap:.2rem .6rem}.drop-copy strong{font-size:.8rem;font-weight:500}.drop-copy>span{color:var(--muted);font-size:.75rem}.drop-browse{min-width:7rem;margin-left:auto;flex-shrink:0}.content-hidden .filename,.content-hidden .report-name,.content-hidden .report-uploader{color:var(--muted)}.status{display:inline-flex;align-items:center;gap:.3rem;width:fit-content;padding:.1rem .4rem;border:1px solid var(--border);border-radius:5px;color:var(--muted);font-size:.65rem}.status:before{content:"";width:.25rem;height:.25rem;border-radius:50%;background:currentcolor}.status.visible{color:var(--green);border-color:rgb(from var(--green) r g b / .2);background:rgb(from var(--green) r g b / .06)}:host-context(body.theme-w95) *{overscroll-behavior:none}
2
+ `;export{e as a};
@@ -0,0 +1,9 @@
1
+ import{b as e,c as t,d as n}from"./chunk-K4XJHM2T.js";import{a as r}from"./chunk-QI66YA4F.js";import{a as i,c as a,d as o,f as s,g as c}from"./chunk-GX5UXWT4.js";import{H as l,I as u,M as d,R as f,h as p,k as m,m as h,u as g}from"./chunk-LVW7WWV4.js";import"./chunk-ZQHLECTI.js";import{a as _,e as v,f as y,g as b}from"./chunk-VYYUMYVW.js";import{d as x,h as S,i as C}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var w=/[/?<>\\:*|"]|[^\P{Cc}\u007F]/gu,T=/^\.+$/u,E=/^(?:con|prn|aux|nul|com\d|lpt\d)(?:\..*)?$/iu,D=/(?<![. ])[. ]+$/u,O=new TextEncoder,k=new Uint8Array(255),A=e=>e.slice(0,O.encodeInto(e,k).read);function j(e,{windows:t,truncate:n,replacement:r}){if(typeof e!=`string`||typeof r!=`string`)throw TypeError(`expected a string`);let i=e.replaceAll(w,()=>r).replace(T,()=>r);return t&&(i=i.replace(E,()=>r).replace(D,()=>r)),n?A(i):i}var M=new Set([`version`,`url`,`git`,`rev`,`branch`,`tag`,`project_root`]),N=e=>[!1,!0].map(t=>j(e,{windows:t,truncate:!0,replacement:`-`}));function P(e,t,n,r){for(let[i,a]of N(t).entries()){let t=e.get(`${i}/${a}`);if(t!==void 0)throw new x(`installed in the folder ${S(a)}, as ${S(t)} is`,r);e.set(`${i}/${a}`,n)}}function F(e,t){if(e===void 0||s(e,t)===``)throw new x(`expected a version, which Soldeer requires`,t);return e}function I(e,t){if(typeof e==`string`)return{kind:`registry`,version:F(e,t)};a(e,t);let n=Object.keys(e).find(e=>!M.has(e));if(n!==void 0)throw new x(`a field Soldeer does not read`,C(t,n));for(let n of M)n!==`version`&&h(e,n,t,s);let{url:r,git:i,rev:o}=e,c=i===void 0?r===void 0?`registry`:`URL`:`git`,l={kind:c,version:F(e.version,C(t,`version`)),url:r,git:i,rev:o},u=[`rev`,`branch`,`tag`].filter(t=>e[t]!==void 0);if(i===void 0&&u.length>0)throw new x(`a field Soldeer ignores without a git repository`,C(t,u[0]));if(i!==void 0&&r!==void 0)throw new x(`a url beside a git repository, which Soldeer refuses`,C(t,`url`));if(u.length>1)throw new x(`${u.join(` and `)}, of which Soldeer takes one alone`,t);if(c!==`registry`&&l.version.includes(`=`))throw new x(`${S(l.version)} has an "=", which Soldeer refuses in the version of what it does not resolve`,C(t,`version`));return l}function L(r,i){let a=i.split(`,`),o=t(i)?.map((e,t)=>e.op===`^`&&!/^ *\^/u.test(a[t])?{...e,op:`=`}:e),s=e(r);if(o!==void 0&&s!==void 0)return n(o,s);let[c,l]=[N(r),N(i)];return c[0]===l[0]&&c[1]===l[1]}var R={http:`a registry`,git:`a git`,private:`a private registry`},z={registry:[`http`,`private`],URL:[`http`],git:[`git`]};function B(e,t,n){let{kind:r}=t;if(!z[r].includes(e.type))throw new x(`a ${r} dependency, whose entry is ${R[e.type]} one`,n);let i=r!==`registry`;if(i?e.version!==t.version:!L(e.version,t.version))throw new x(`${S(t.version)}, which its entry's version, ${S(e.version)}, ${i?`is not`:`does not satisfy`}`,C(n,`version`));for(let r of[`url`,`git`,`rev`])if(t[r]!==void 0&&t[r]!==e[r])throw new x(`${S(t[r])}, where its entry has ${S(e[r])}`,C(n,r))}var V=[`remappings_generate`,`remappings_regenerate`,`remappings_version`,`recursive_deps`],H=[...V,`remappings_prefix`,`remappings_location`];function U(e,t){if(e===void 0)return;a(e,t,H);for(let n of V)h(e,n,t,c);h(e,`remappings_prefix`,t,s);let n=e.remappings_location;if(![void 0,`txt`,`config`].includes(n))throw new x(`expected "txt" or "config", found ${i(n)}`,C(t,`remappings_location`));if(e.recursive_deps===!0)throw new x(`has Soldeer install what each dependency depends on too, which the lockfile does not have`,C(t,`recursive_deps`))}function W(e,t){if(e!==void 0&&y(a(e,t)))throw new x(`an inline table, from which Soldeer reads no dependency`,t);return m(e)}function G(e,t){a(e,`config`),U(e.soldeer,`config.soldeer`);let n=W(e.dependencies,`config.dependencies`),r=new Map;for(let[e,i,a]of o(n,`config.dependencies`)){let n=I(i,a);P(r,e,e,a);let o=t[e];if(o===void 0)throw new x(`no entry in the lockfile, which Soldeer then resolves anew`,a);B(o,n,a)}for(let e of Object.keys(t))if(!Object.hasOwn(n,e))throw new x(`nothing in the config asks for it, and Soldeer drops it`,C(`dependencies`,e))}var K=[`name`,`version`,`git`,`url`,`rev`,`checksum`,`integrity`],q={http:[`name`,`version`,`url`,`checksum`,`integrity`],git:[`name`,`version`,`git`,`rev`],private:[`name`,`version`,`checksum`,`integrity`]},J={http:`a url`,git:`a git repository`,private:`neither a url nor a git repository`},Y=e=>e!==``&&![...e].some(e=>e<=`\x1F`||e===`\x7F`||e===`"`||e===`\\`);function X(e,t,n){let r=p(e[t],n);if(!Y(r))throw new x(`${S(r)} is empty, or has a quote, backslash or control character, which this reader does not take`,n);if((t===`checksum`||t===`integrity`)&&!u(r))throw new x(`${S(r)} is not a hex sha256`,n);if(t===`rev`&&!l(r))throw new x(`${S(r)} is not a full commit hash, as Soldeer writes`,n);if(t===`url`&&!f(r))throw new x(`${S(r)} is not an http(s) URL`,n);return t===`git`&&d(r,n),r}function Z(e,t){let n=`dependencies[${t}]`;if(!v(e))throw new x(`expected a table`,n);typeof e.name==`string`&&Y(e.name)&&(n=C(`dependencies`,e.name));for(let t of Object.keys(e)){if(t===`source`)throw new x(`a field of Soldeer 0.3 and older, whose entries 0.4 and later do not read`,C(n,t));if(!K.includes(t))throw new x(`unsupported field ${S(t)}`,C(n,t))}if(e.url!==void 0&&e.git!==void 0)throw new x(`both a url and a git repository, which Soldeer refuses`,n);let r=e.url===void 0?e.git===void 0?`private`:`git`:`http`,i={type:r};for(let t of q[r]){if(e[t]===void 0)throw new x(`expected ${t}, which Soldeer requires of an entry with ${J[r]}`,n);i[t]=X(e,t,C(n,t))}let a=K.find(t=>e[t]!==void 0&&!q[r].includes(t));if(a!==void 0)throw new x(`a field Soldeer does not write for an entry with ${J[r]}`,C(n,a));return[i,n]}function Q(e,t){let n=e===void 0?[]:[`version = ${e}`];if(t.length===0)return`${[...n,`dependencies = []`].join(`
2
+ `)}
3
+ `;let r=t.map(e=>[`[[dependencies]]`,...q[e.type].map(t=>`${t} = "${e[t]}"`)].join(`
4
+ `));return`${[...n,...r].join(`
5
+
6
+ `)}
7
+ `}function $(e,t){if(e===t)return;let[n,r]=[e.split(`
8
+ `),t.split(`
9
+ `)],i=r.findIndex((e,t)=>e!==n[t]);throw i===-1?new x(`line ${r.length}: expected the end of the file, as Soldeer writes it`):i===n.length?new x(`line ${i}: expected a newline at its end, as Soldeer writes it`):new x(`line ${i+1}: expected ${S(r[i])}, as Soldeer writes it, found ${S(n[i])}`)}function ee(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{config:n}=g(t,[`config`]),i=b(e),a=Object.keys(i).find(e=>e!==`version`&&e!==`dependencies`);if(a!==void 0)throw new x(`unsupported field ${S(a)}`,C(``,a));let{version:o}=i;if(o!==void 0&&o!==1&&o!==2)throw new x(`expected 1, for Soldeer 0.11 and older, or 2, the formats Soldeer 0.12 knows`,`version`);if(!Array.isArray(i.dependencies))throw new x(`expected an array of tables, which Soldeer requires`,`dependencies`);let s=Object.create(null),c=[],l=new Map;for(let[e,t]of i.dependencies.entries()){let[n,i]=Z(t,e);if(n.name in s)throw new x(`a second entry of the name, where Soldeer writes one`,i);let a=c.at(-1)?.name;if(a!==void 0&&r(a,n.name)>0)throw new x(`after ${S(a)}, where Soldeer sorts entries by name`,i);P(l,`${n.name}-${n.version}`,n.name,i),s[n.name]=n,c.push(n)}return $(e,Q(o,c)),n!==void 0&&G(n,s),{lockfileVersion:o??1,dependencies:s}}export{x as LockfileError,_ as TomlError,ee as parseSoldeerLockfile};
@@ -0,0 +1,11 @@
1
+ import{c as e}from"./chunk-PWFUOLZK.js";import{b as t,c as n}from"./chunk-C4Z6ZBXV.js";import{a as r,c as i,g as a,j as o}from"./chunk-2XUEZHIP.js";var s=`:host{display:inline-flex;flex-shrink:0;vertical-align:middle;--switch-track-width: 26px;--switch-track-height: 14px}button,.checkbox-mode{align-items:center;gap:8px;box-sizing:border-box;height:30px;margin:0;padding:0 .6rem;border:1px solid var(--border);border-radius:var(--ui-radius, 4px);background:transparent;color:var(--muted);font:inherit;font-size:.78rem;font-weight:500;line-height:1;white-space:nowrap;cursor:default}button{display:var(--switch-button-display, inline-flex);&:hover:not(:disabled){color:var(--text);background:rgb(from var(--text) r g b / .04)}&[aria-pressed=true]{color:var(--text)}&:disabled{opacity:.4}&:focus-visible{outline:1px solid var(--accent);outline-offset:-2px}}.checkbox-mode{display:var(--switch-checkbox-display, none);border:0;color:var(--text);&:has(:disabled){opacity:.4}& input{width:.85rem;height:.85rem;margin:0;accent-color:var(--accent)}}.track{position:relative;flex-shrink:0;width:var(--switch-track-width);height:var(--switch-track-height);background:var(--border);border-radius:var(--ui-radius, 8px);transition:background .15s;&:after{content:"";position:absolute;top:2px;left:2px;width:calc(var(--switch-track-height) - 4px);height:calc(var(--switch-track-height) - 4px);border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}}button[aria-pressed=true] .track{background:color-mix(in oklch,var(--accent) 22%,transparent);&:after{transform:translate(calc(var(--switch-track-width) - var(--switch-track-height)));background:var(--accent)}}:host([borderless]) :is(button,.checkbox-mode){height:100%;border:0;border-radius:0}:host([compact]){--switch-track-width: 22px;--switch-track-height: 12px}:host([compact]) :is(button,.checkbox-mode){height:auto;gap:7px;padding:2px 8px;border-radius:var(--ui-radius, 6px);font-size:.68rem;line-height:1.2}:host-context(body.theme-w95){.checkbox-mode{padding:0 4px;color:#000;font-size:11px;font-weight:400}.checkbox-mode input{appearance:none;width:13px;height:13px;background:#fff;box-shadow:var(--w95-sunken);&:checked{background:var(--w95-check),#fff}}}
2
+ `,c=class extends o{static properties={checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},label:{type:String},accessibleLabel:{type:String,attribute:`accessible-label`}};static styles=r(s);constructor(){super(),this.checked=!1,this.disabled=!1,this.label=``,this.accessibleLabel=``}_checkboxClick(e){(this.disabled||e.target.tagName!==`INPUT`)&&e.stopPropagation()}render(){return i`<button type="button" part="button" aria-pressed="${String(this.checked)}" aria-label="${this.accessibleLabel||this.label}" ?disabled="${this.disabled}"><span>${this.label}</span><span class="track" part="track" aria-hidden="true"></span></button> <label class="checkbox-mode" @click="${this._checkboxClick}"><input type="checkbox" part="checkbox" .checked="${this.checked}" ?disabled="${this.disabled}" aria-label="${this.accessibleLabel||this.label}"> <span>${this.label}</span></label>`}};customElements.get(`mode-switch`)||customElements.define(`mode-switch`,c);function l(e){return!Number.isFinite(e)||e<0?`—`:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KiB`:e<0x40000000?`${(e/1048576).toFixed(1)} MiB`:`${(e/0x40000000).toFixed(1)} GiB`}function u(e){return Array.isArray(e)?e.reduce((e,t)=>({bytes:e.bytes!=null&&Number.isFinite(t.bytes)?e.bytes+t.bytes:null,lines:e.lines!=null&&Number.isFinite(t.lines)?e.lines+t.lines:null}),{bytes:0,lines:0}):{bytes:null,lines:null}}function d(e,t,n){if(Array.isArray(e?.files))return{files:t.length,lines:u(t).lines,packages:new Set(t.map(e=>e.module)).size};let r=e=>Number.isSafeInteger(e)&&e>=0?e:null,i=e?.summary;return{files:r(i?.[n===`code`?`codeFiles`:`files`]),lines:r(i?.lines),packages:null}}function f(e){return(e??[]).filter(e=>![`resource:base64`,`directory`].includes(e.format))}var p=t(class extends n{constructor(){super(...arguments),this.key=a}render(e,t){return this.key=e,t}update(t,[n,r]){return n!==this.key&&(e(t),this.key=n),r}});export{l as a,u as b,d as c,f as d,p as e};
3
+ /*! Bundled license information:
4
+
5
+ lit-html/directives/keyed.js:
6
+ (**
7
+ * @license
8
+ * Copyright 2021 Google LLC
9
+ * SPDX-License-Identifier: BSD-3-Clause
10
+ *)
11
+ */
@@ -0,0 +1,7 @@
1
+ import{a as e}from"./chunk-TUII34K2.js";var t=`/api/config`,n=`http://127.0.0.1:3123/`;function r(e){if(typeof e!=`string`||!e.trim())return null;try{let t=new URL(e);return![`http:`,`https:`].includes(t.protocol)||t.username||t.password||t.search||t.hash?null:(t.pathname=t.pathname.replace(/\/+$/u,``)+`/`,t.href)}catch{return null}}var i=`deepview.sync.serverInfo`,a=`deepview.sync.standaloneProbe`;function o(){try{return localStorage.getItem(a)===`1`}catch{return!1}}function s(){try{localStorage.setItem(a,`1`)}catch{}}function c(e){return e===`managed+e2e`||e===`e2e+managed`}function l(e,t){return(e===`managed`||c(e))&&/^\/(?:team|manage|npm|my|repo)(?:\/|$)/u.test(t)}function u(e,t=null){return t&&(c(e)||e===t)?t:e===`managed`||e===`managed+e2e`?`managed`:`e2e`}function d(e,t){return e&&c(e.mode)&&t.mode===`e2e`?{...e,githubNewIssueLabels:t.githubNewIssueLabels??``,...t.deepviewScanServer?{deepviewScanServer:t.deepviewScanServer}:{}}:t}function f(e){if(typeof e!=`object`||!e)return null;let t=e.mode;if(t!==`e2e`&&t!==`managed`&&t!==`managed+e2e`&&t!==`e2e+managed`)return null;let n=null,i=e.managed;if(typeof i==`object`&&i){let e=i.loginPath,t=i.cookieName;typeof e==`string`&&typeof t==`string`&&(n={loginPath:e,cookieName:t},i.allowShare===!0&&(n.allowShare=!0))}let a=t===`managed`?null:r(e.deepviewScanServer),o=e.githubNewIssueLabels;return{mode:t,managed:n,...a?{deepviewScanServer:a}:{},...typeof o==`string`&&o.length<=4096?{githubNewIssueLabels:o}:{}}}async function p(){try{let e=await fetch(t,{credentials:`same-origin`,cache:`no-store`,headers:{accept:`application/json`}});if(e.status===404)return`standalone`;if(!e.ok)return null;let n=await e.json(),r=f(n);return r&&n.session!==void 0?{...r,session:n.session}:r}catch{return null}}async function m(e,t=3e3){let n;try{return await Promise.race([e,new Promise(e=>{n=setTimeout(()=>e(null),t)})])}catch{return null}finally{clearTimeout(n)}}function h(){try{let e=localStorage.getItem(i);if(e==null)return null;let t=f(JSON.parse(e));return t?{mode:t.mode,managed:t.managed}:null}catch{return null}}function g(e){try{localStorage.setItem(i,JSON.stringify({mode:e.mode,managed:e.managed})),localStorage.removeItem(a)}catch{}}var _=`deepview.objstore-presence.`;function v(e){return _+e}function y(e){try{let t=localStorage.getItem(v(e));if(!t)return null;let n=JSON.parse(t);return!n||typeof n!=`object`?null:{names:n.names&&typeof n.names==`object`?n.names:{},bundles:n.bundles&&typeof n.bundles==`object`?n.bundles:{},bundleNames:n.bundleNames&&typeof n.bundleNames==`object`?n.bundleNames:{},baselines:b(n.baselines,n.localVersions)}}catch{return null}}function b(e,t){let n={};if(t&&typeof t==`object`)for(let[e,r]of Object.entries(t))Number.isSafeInteger(r)&&r>=0&&(n[e]={version:r,incarnation:null,synced:!0,hash:null});if(e&&typeof e==`object`)for(let[t,r]of Object.entries(e))!r||typeof r!=`object`||!Number.isSafeInteger(r.version)||r.version<0||r.incarnation!=null&&typeof r.incarnation!=`string`||(n[t]={version:r.version,incarnation:r.incarnation??null,synced:r.synced===!0,hash:typeof r.hash==`string`?r.hash:null});return n}function x(e,t,n,r){let i=y(e),a=Object.entries((t===`bundle`?i?.bundles:i?.names)??{}).find(([,e])=>e===n)?.[0],o=i?.baselines?.[a];return{synced:a!==void 0&&(t===`bundle`||o?.synced===!0&&o.hash===r),cached:!0}}var S=`deepview-objstore.v1.put`,C=`deepview-objstore.v1.delete`,w=`deepview-objstore.v1.fetch`,T=`deepview-objstore.v1.fetch-rest`,E=`deepview-objstore.v1.put-rest`,D=`deepview-objstore.v1.delete-rest`;function O(e){return e==null?``:String(e)}function k(e){return e??``}function A(t,n){return e([S,t.workspaceTag,t.resourceTag,O(t.prevVersion),k(t.prevIncarnation),t.contentHash,String(t.expectedLength),n].join(`
2
+ `))}function j(t,n){return e([C,t.workspaceTag,t.resourceTag,O(t.prevVersion),k(t.prevIncarnation),n].join(`
3
+ `))}function M(t,n,r){return e([w,t,n,r].join(`
4
+ `))}async function N(e,t){return new Uint8Array(await crypto.subtle.sign({name:`Ed25519`},e,t)).toBase64({alphabet:`base64url`,omitPadding:!0})}function P(e,t,n){return N(e,A(t,n))}function F(e,t,n){return N(e,j(t,n))}function I(e,t,n,r){return N(e,M(t,n,r))}function L(t,n,r){return e([T,t,n,String(r)].join(`
5
+ `))}function R(e,t,n,r){return N(e,L(t,n,r))}function z(t,n){return e([E,t.workspaceTag,t.resourceTag,O(t.prevVersion),k(t.prevIncarnation),t.contentHash,String(t.expectedLength),String(n)].join(`
6
+ `))}function B(e,t,n){return N(e,z(t,n))}function V(t,n){return e([D,t.workspaceTag,t.resourceTag,O(t.prevVersion),k(t.prevIncarnation),String(n)].join(`
7
+ `))}function H(e,t,n){return N(e,V(t,n))}async function U(e){let t=await crypto.subtle.digest(`SHA-256`,e);return new Uint8Array(t).toBase64({alphabet:`base64url`,omitPadding:!0})}export{n as a,r as b,o as c,s as d,c as e,l as f,u as g,d as h,f as i,p as j,m as k,h as l,g as m,v as n,y as o,x as p,P as q,F as r,I as s,R as t,B as u,H as v,U as w};
@@ -0,0 +1 @@
1
+ function e(e){return e===`inprogress`||e===`fixed`||e===`invalid`||e===`deleted`||e===`ignored`?e:void 0}function t(t){if(t)return e(t.triage)??(t.deleted?`deleted`:void 0)}function n(e){let n=t(e);return n===void 0||n===`ignored`}function r(e){return!e||!e.color&&!t(e)&&!e.comment&&!e.fix&&!(e.ignoredReports&&e.ignoredReports.length>0)&&e.flagged===void 0}function i(e,t,n){let r=e.get(t)?.ignoredReports;return Array.isArray(r)&&r.includes(n)}function a(e,t){return Array.isArray(e?.scopedIgnoredReports)&&e.scopedIgnoredReports.includes(t)}function o(t){if(!t||typeof t!=`object`)return;let n=t,i={};typeof n.color==`string`&&n.color&&(i.color=n.color);let a=e(n.triage)??(n.deleted?`deleted`:void 0);if(a&&(i.triage=a),typeof n.comment==`string`&&n.comment&&(i.comment=n.comment),typeof n.fix==`string`&&n.fix&&(i.fix=n.fix),typeof n.flagged==`boolean`&&(i.flagged=n.flagged),Array.isArray(n.ignoredReports)){let e=n.ignoredReports.filter(e=>typeof e==`string`&&e.length>0);e.length>0&&(i.ignoredReports=e)}if(Array.isArray(n.scopedIgnoredReports)&&i.ignoredReports){let e=[...new Set(n.scopedIgnoredReports.filter(e=>typeof e==`string`&&i.ignoredReports.includes(e)))];e.length>0&&(i.scopedIgnoredReports=e)}return r(i)?void 0:i}function s(e,t){let n=e??[],r=t??[];if(n.length!==r.length)return!1;if(n.length===0)return!0;let i=new Set(n);for(let e of r)if(!i.has(e))return!1;return!0}function c(e,n){let r=e??{},i=n??{};return(r.color??``)===(i.color??``)&&(t(r)??``)===(t(i)??``)&&(r.comment??``)===(i.comment??``)&&(r.fix??``)===(i.fix??``)&&r.flagged===i.flagged&&s(r.ignoredReports,i.ignoredReports)&&s(r.scopedIgnoredReports,i.scopedIgnoredReports)}function l(e,t,n){let r=e.get(t),i=o({...r,...n});return i===void 0?e.delete(t):!c(r,i)&&(e.set(t,i),!0)}function u(e,t,n){let r=o(n),i=e.get(t);return r===void 0?e.delete(t):!c(i,r)&&(e.set(t,r),!0)}function d(e,t,n,r,i=!1){let a=new Set(e.get(t)?.ignoredReports??[]);r?a.add(n):a.delete(n);let o=new Set(e.get(t)?.scopedIgnoredReports??[]);return r&&i&&o.add(n),l(e,t,{ignoredReports:a.size>0?[...a]:void 0,scopedIgnoredReports:[...o]})}async function f(e){let t=await crypto.subtle.digest(`SHA-512`,e);return`sha512-${new Uint8Array(t).toBase64()}`}export{t as a,n as b,i as c,a as d,o as e,l as f,u as g,d as h,f as i};
@@ -0,0 +1,2 @@
1
+ var e=/[\p{Cc}\p{Zl}\p{Zp}\p{Bidi_Control}]/gu,t=(e,t)=>e.length>t?e.slice(0,e.codePointAt(t-1)>65535?t-1:t):e,n=e=>`U+${e.codePointAt(0).toString(16).toUpperCase().padStart(4,`0`)}`,r=t=>JSON.stringify(t).replaceAll(e,e=>`\\u${e.codePointAt(0).toString(16).padStart(4,`0`)}`);function i(e){let n=t(e,64);return n===e?r(e):`${r(n)}...`}var a=class extends Error{constructor(e,t){super(t===void 0?e:`${e} at line ${t+1}`),this.name=new.target.name,this.line=t}},o=class extends Error{constructor(e,t){super(t===void 0?e:`${t}: ${e}`),this.name=`LockfileError`,this.where=t}},s=(e,t)=>{throw new o(e,t)};function c(e,t){try{return e()}catch(e){return t(e)}}var l=(e,t)=>c(e,e=>{throw e instanceof o&&e.where===void 0?new o(e.message,t):e});function u(e){let n=t(e,200);return r(n===e?e:`${n}\u2026`)}var d=/^[A-Za-z_$][\w$]*$/u;function f(e,t){return d.test(t)?e===``?t:`${e}.${t}`:`${e}[${u(t)}]`}var p=(e,t)=>new o(`${e} at line ${Math.max(t,0)+1}`),m=/[\p{Cc}\p{Cs}\uFEFF\uFFFE\uFFFF\u2028\u2029]/u,h=[`<<<<<<<`,`=======`,`>>>>>>>`];function g(e,t){if(h.every(t=>e.includes(t)))throw new o(`${t} reads a file with ${h.map(e=>u(e)).join(`, `)} in it as a merge conflict`)}function _(e,t){let n=/^\{(\r?\n)([\t ]+)"/u.exec(e);if(n===null)throw p(`expected "{" alone on the first line and an indented key on the next, as ${t} writes the file`,0);return n.slice(1)}function v(e,t){t.lastIndex=e.pos;let n=t.exec(e.text);return n!==null&&(e.pos=t.lastIndex),n}var y=(e,t)=>t<e.length?u(e.slice(t)):`the end of the line`,b=e=>/^ */u.exec(e)[0].length,x=2**20,S=(e,t)=>({text:e,forbidden:t,pos:0,number:-1,line:void 0,crlf:void 0});function C(e){let{text:t,pos:r}=e;if(e.line=void 0,r>=t.length)return;let i=t.indexOf(`
2
+ `,r);i===-1&&(i=t.length),e.pos=i+1,e.number++;let a=i<t.length&&t[i-1]===`\r`,o=t.slice(r,a?i-1:i);if(o.length>x)throw p(`a line longer than ${x} characters`,e.number);let s=e.forbidden.exec(o)?.[0];if(s!==void 0)throw p(`${n(s)} is not allowed`,e.number);if(i<t.length&&a!==(e.crlf??=a))throw p(`a ${a?`CRLF`:`LF`} line end, after ${e.crlf?`CRLF`:`LF`} ones`,e.number);e.line=o}function w(e,t,n){let r=t+1;for(;r<e.length&&e[r]!==`"`;)r+=e[r]===`\\`?2:1;if(r>=e.length)throw p(`a string with no closing quote`,n);let i=e.slice(t,++r);if(!i.includes(`\\`))return[i.slice(1,-1),r];let a=c(()=>JSON.parse(i),()=>{throw p(`${u(i)} is not a string as JSON writes it`,n)});if(JSON.stringify(a)!==i)throw p(`${u(i)} is not written as JSON writes ${u(a)}`,n);return[a,r]}export{n as a,i as b,a as c,o as d,s as e,c as f,l as g,u as h,f as i,p as j,m as k,g as l,_ as m,v as n,y as o,b as p,x as q,S as r,C as s,w as t};
@@ -0,0 +1 @@
1
+ import{f as e,g as t,j as n,k as r,l as i,m as a}from"./chunk-PXK7EU4V.js";var o=t,s=t?new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}):null,{isWellFormed:c}=String.prototype;function l(e,t,n){if(t||e.length===n.length)return n;if(c){if(c.call(e))return n;throw TypeError(i)}let r=0,a=n.length-3;for(;r<=a;){let t=n.indexOf(239,r);if(t===-1||t>a)break;if(r=t+1,n[t+1]===191&&n[t+2]===189){if(e===d(n))return n;throw TypeError(i)}}return n}function u(t,n=!1){if(typeof t!=`string`)throw TypeError(r);return t.length===0?new Uint8Array:l(t,n,e.encode(t))}function d(e,t=!1){return n(e),e.byteLength===0?``:t?o.decode(e):s.decode(e)}var f=(e,t=`uint8`)=>a(u(e,!1),t),p=(e,t=`uint8`)=>a(u(e,!0),t),m=e=>d(e,!1),h=e=>d(e,!0);export{f as a,p as b,m as c,h as d};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-NRPC74AM.js";import{a as t,d as n,f as r,h as i}from"./chunk-7C7DWL7I.js";import{d as a}from"./chunk-PNHBZGDD.js";import{a as o,b as s}from"./chunk-5EAVJAD2.js";import{c}from"./chunk-LBD3M3J6.js";import{C as l,D as u,G as d,J as f,K as p,L as m,O as h,q as g}from"./chunk-QRKFPLA4.js";import{a as _}from"./chunk-TUII34K2.js";function v(e,t){let n=s([{groups:[e],tree:t.tree,treeDependencies:t.treeDependencies}]);for(let r of e)l(r,t),r.isApp??=g(r,r.source??t.source),r._depsDirectory=n}function y(e,t){return!(e.isApp??g(e,e._source??e.source))&&o(e.file,e._depsDirectory??t??s([{groups:[[e]]}]))}function ee(e,n,r){let i=t(n);return i===`ignored`&&y(e,r)?void 0:i}function b(e,n,a,o){let s=n.id??String(n._id),c=n._reportName??``;y(n,o)&&(a===`ignored`||a===`untriaged`)?(t(e.get(s))!==`ignored`&&r(e,s,{triage:void 0}),i(e,s,c,a===`ignored`,!0)):(r(e,s,{triage:a===`untriaged`?void 0:a}),a!==`ignored`&&a!==`untriaged`&&i(e,s,c,!1))}function x(e,a){let o=new Set;for(let t of e.values()){let e=t?.ignoredReports;if(!e?.length)continue;let r=new Set(e).size!==e.length;for(let i of e)(r||!n(t,i))&&o.add(i)}if(o.size===0)return!1;let c=!1;for(let l of a){let a=(l.groups??[]).flat();if(!a.some(e=>o.has(e._reportName??l.name??l.fileName??``)))continue;let u=s([l]),d=e=>({...e,_source:e._source??e.source??l.source}),f=new Set(a.filter(e=>y(d(e),u)).map(e=>e.id??String(e._id)));for(let o of a){let a=o.id??String(o._id),s=o._reportName??l.name??l.fileName??``,p=e.get(a);p?.ignoredReports?.includes(s)&&(n(p,s)||y(d(o),u)||(t(p)||(c=r(e,a,{triage:`ignored`})||c),f.has(a)||(c=i(e,a,s,!1)||c)))}for(let t of a){if(!y(d(t),u))continue;let n=t.id??String(t._id),r=t._reportName??l.name??l.fileName??``;e.get(n)?.ignoredReports?.includes(r)&&(c=i(e,n,r,!0,!0)||c)}}return c}async function S(e,t){let r=new Set(Object.values(e??{}).flatMap(e=>Array.isArray(e?.ignoredReports)?e.ignoredReports.filter(t=>typeof t==`string`&&!n(e,t)):[])),i=[];for(let e of r){let n;try{let r=await t(e);if(typeof r!=`string`)continue;n=await h(r)}catch{continue}n&&i.push({...n.data,name:e,groups:[n.findings]})}return i}async function C(e,t){if(e!=null&&(typeof e!=`object`||Array.isArray(e)))return{entries:e,changed:!1};let n=new Map(Object.entries(e??{})),r=x(n,await S(e,t));return{entries:Object.fromEntries(n),changed:r}}var w=`links`;function T(e){if(typeof e==`string`)return e.length>0?e:null;if(!e||typeof e!=`object`||Array.isArray(e))return null;let{id:t}=e;return typeof t==`string`&&t.length>0?t:null}function E(e){if(typeof e==`string`&&!/^\s*\[/u.test(e))return null;let t;try{t=JSON.parse(e)}catch{return null}if(!Array.isArray(t)||t.length===0)return null;let n=[],r=0;for(let e of t){if(!Array.isArray(e))return null;let t=new Set;for(let n of e){let e=T(n);if(e===null)return null;c(e)?t.add(e):r++}t.size>1&&n.push([...t])}return{groups:n,skipped:r}}function D(e){let t=new Set;for(let n of e)for(let e of n)t.add(e);return t.size}function te(e,t){for(let n of e)for(let e of n){let r=t.get(e);r||t.set(e,r=new Set);for(let t of n)t!==e&&r.add(t)}return t}var O=1,k=16,A=12,j=1+k+A+16,M=1+k+A;async function N(e,t){let n=await crypto.subtle.importKey(`raw`,_(e),`PBKDF2`,!1,[`deriveKey`]);return crypto.subtle.deriveKey({name:`PBKDF2`,hash:`SHA-256`,salt:t,iterations:3e6},n,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}function P(e){return!(e instanceof Uint8Array)||e.length<j?!1:e[0]===O}async function F(e,t){if(!(e instanceof Uint8Array))throw TypeError(`encryptWithPassword: plaintext Uint8Array required`);if(typeof t!=`string`||!t)throw TypeError(`encryptWithPassword: password required`);let n=new Uint8Array(M+e.length+16);n[0]=O,crypto.getRandomValues(n.subarray(1,1+k)),crypto.getRandomValues(n.subarray(1+k,M));let r=n.subarray(1,1+k),i=n.subarray(1+k,M),a=await N(t,r),o=new Uint8Array(await crypto.subtle.encrypt({name:`AES-GCM`,iv:i,additionalData:n.subarray(0,M)},a,e));return n.set(o,M),n}async function ne(e,t){if(typeof t!=`string`||!t)throw TypeError(`tryDecryptWithPassword: password required`);if(!(e instanceof Uint8Array)||e.length<j||e[0]!==O)return{ok:!1,reason:`malformed`};let n=e.subarray(1,1+k),r=e.subarray(1+k,M),i=e.subarray(M),a=await N(t,n),o;try{o=new Uint8Array(await crypto.subtle.decrypt({name:`AES-GCM`,iv:r,additionalData:e.subarray(0,M)},a,i))}catch{return{ok:!1,reason:`wrong-password`}}return{ok:!0,plaintext:o}}async function I(e,t,n){if(!n||typeof n.malformedMsg!=`string`||typeof n.wrongPasswordMsg!=`string`)throw TypeError(`decryptWithPasswordOrThrow: { malformedMsg, wrongPasswordMsg } strings required`);let r=await ne(e,t);if(r.ok)return r.plaintext;throw r.reason===`wrong-password`?Error(n.wrongPasswordMsg):Error(n.malformedMsg)}var L=P,R=F;function z(e,t){return I(e,t,{malformedMsg:`malformed encrypted bundle`,wrongPasswordMsg:`wrong password or corrupt bundle`})}var B=1,V=1024,H=1024,U=200,W=0x6400000,G=Math.ceil(W*4/3)+16,K=512,q=64;function J(e){if(!e||typeof e!=`object`)return`payload is not an object`;if(e.version!==B)return`unsupported export version: ${e.version}`;if(!e.workspace||typeof e.workspace!=`object`)return`workspace metadata missing`;if(typeof e.workspace.id!=`string`)return`workspace.id must be a string`;if(typeof e.workspace.name!=`string`)return`workspace.name must be a string`;if(typeof e.workspace.privateKey!=`string`)return`workspace.privateKey must be a string`;if(e.workspace.createdAt!==void 0&&!Number.isFinite(e.workspace.createdAt))return`workspace.createdAt must be a finite number or omitted`;if(!Array.isArray(e.reports))return`reports field must be an array`;if(e.reports.length>H)return`reports count (${e.reports.length}) exceeds cap (${H})`;if(e.bundles!==void 0){if(!Array.isArray(e.bundles))return`bundles field must be an array when present`;if(e.bundles.length>V)return`bundles count (${e.bundles.length}) exceeds cap (${V})`;for(let t of e.bundles){if(typeof t!=`string`)return`bundles entries must be strings`;if(t.length>U)return`bundle integrity exceeds per-entry length cap (${U})`}}if(e.bundleBlobs!==void 0){if(!Array.isArray(e.bundleBlobs))return`bundleBlobs field must be an array when present`;if(e.bundleBlobs.length>q)return`bundleBlobs count (${e.bundleBlobs.length}) exceeds cap (${q})`;for(let t of e.bundleBlobs){if(!t||typeof t!=`object`||Array.isArray(t))return`bundleBlobs entries must be objects`;if(typeof t.integrity!=`string`||t.integrity.length===0)return`bundleBlobs.integrity must be a non-empty string`;if(t.integrity.length>U)return`bundleBlobs.integrity exceeds per-entry length cap (${U})`;if(typeof t.name!=`string`||t.name.length===0)return`bundleBlobs.name must be a non-empty string`;if(t.name.length>K)return`bundleBlobs.name exceeds per-entry length cap (${K})`;if(t.name.includes(`\0`))return`bundleBlobs.name cannot contain NUL`;if(typeof t.data!=`string`)return`bundleBlobs.data must be a base64 string`;if(t.data.length>G)return`bundleBlobs.data exceeds per-blob size cap (${W} bytes raw)`}}return null}async function Y(e){return new Uint8Array(await e.arrayBuffer())}async function X(e,t){if(L(e)){if(typeof t!=`string`||!t)throw TypeError(`parseWorkspaceBundleBytes: password required for encrypted bundle`);let n=await z(e,t);try{return Z(await a(n))}catch(e){throw Error(`wrong password or corrupt bundle`,{cause:e})}}let n;try{n=await a(e)}catch(e){throw Error(`gzip decompression failed: ${e.message}`,{cause:e})}return Z(n)}function Z(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`payload is not JSON: ${e.message}`,{cause:e})}let n=J(t);if(n===null)return t;let r=n.includes(`exceeds cap`);throw Error(r?n:`not a deepview workspace export: ${n}`)}function Q(e,t){let n=e.trimStart().startsWith(`[`)?E(e):null;if(n)return{data:{source:`links`,findings:[],links:n.groups},format:`links`,reason:null};let r=m(e);if(r.data!=null||p(e,t)!==`codex`)return r;try{return{data:{type:`security`,source:`codex-security`,findings:d(e).flatMap(e=>e.data.findings)},format:`codex`,reason:null}}catch(e){return{data:null,format:null,reason:e instanceof Error?e.message:`Invalid Codex CSV`}}}function re(e,t){let n=Q(e,t);return n.data==null?Promise.resolve(null):h(JSON.stringify(n.data))}function ie(e){let t=new Set;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n;typeof e.file==`string`&&e.file&&t.add(e.file);for(let n of Array.isArray(e.evidence)?e.evidence:[])typeof n?.file==`string`&&n.file&&t.add(n.file)}return t}function $(e){let t=(f(e)??[]).flat().filter(e=>typeof e==`object`&&!!e),n=s([{groups:[t],tree:e?.tree}]);return{directory:n,own:t.filter(e=>!o(e.file,n))}}function ae(e){let t=new Map;for(let n of $(e).own){let e=u(n);e&&t.set(e.toLowerCase(),e)}return t.size===1?[...t.values()][0]:null}function oe(t){let{directory:n,own:r}=$(t);return e([...ie(r)].filter(e=>!o(e,n)))}var se=[`inprogress`,`fixed`,`invalid`,`deleted`,`ignored`];function ce(e){return typeof e==`string`&&se.includes(e)}function le(e){if(e===null)return null;if(typeof e!=`object`||Array.isArray(e))return`invalid`;let t=e,n={},r=t.color;if(r!=null){if(typeof r!=`string`||r.length>50)return`invalid`;r!==``&&(n.color=r)}let i=t.triage;if(i!=null){if(!ce(i))return`invalid`;n.triage=i}for(let e of[`comment`,`fix`]){let r=t[e];if(r!=null){if(typeof r!=`string`||r.length>1e4)return`invalid`;r!==``&&(n[e]=r)}}let a=t.flagged;if(a!=null){if(typeof a!=`boolean`)return`invalid`;n.flagged=a}return n}export{v as a,y as b,ee as c,b as d,x as e,S as f,C as g,w as h,E as i,D as j,te as k,F as l,I as m,L as n,R as o,H as p,Y as q,X as r,Z as s,Q as t,re as u,ae as v,oe as w,le as x};
@@ -0,0 +1 @@
1
+ function e({importers:e={},packages:n={}},{name:r,versions:i=[]}){let a=new Map,o=new Map,s=new Map,c=[...Object.entries(e).map(([e,t])=>[`link:${e}`,t]),...Object.entries(n)];for(let[t,{name:n=``,version:r=``}]of c){let i=t.startsWith(`link:`)&&Object.hasOwn(e,t.slice(5));s.set(t,{id:t,name:i?t.slice(5)===`.`?`Project`:t.slice(5):n,ecosystem:i?``:`npm`,version:r,own:i,root:i})}let l=e=>s.has(e)?e:e.startsWith(`link:`)&&s.has(e.slice(5))?e.slice(5):null;for(let[e,{dependencies:t=[]}]of c)for(let n of t.map(l))n===null||n===e||((o.get(e)??o.set(e,new Set).get(e)).add(n),(a.get(n)??a.set(n,new Set).get(n)).add(e));return t(s,o,a,e=>e.name===r&&(i.length===0||i.includes(e.version)))}function t(e,t,n,r){let i=[];for(let t of e.values())!t.own&&r(t)&&(t.target=!0,i.push(t.id));let a=new Set(i),o=[...i];for(let e=0;e<o.length;e++)for(let t of n.get(o[e])??[])a.has(t)||(a.add(t),o.push(t));let s=e=>new Map([...a].map(t=>[t,new Set([...e.get(t)??[]].filter(e=>a.has(e)))]));return{nodes:new Map([...e].filter(([e])=>a.has(e))),imports:s(t),importedBy:s(n),targets:i}}export{e as a,t as b};
@@ -0,0 +1,4 @@
1
+ import{a as e,b as t,c as n,d as r}from"./chunk-UJP4PQJA.js";import{a as i,b as a,c as o,d as s,e as c}from"./chunk-UJSJMXEG.js";import{C as l,F as u,H as d,J as f,M as p,O as m,Q as h,S as g,e as _,f as v,h as y,k as b,m as x,n as S,o as C,p as w,u as T,v as E,w as D,x as O,z as k}from"./chunk-LVW7WWV4.js";import{b as ee}from"./chunk-DEVAORP2.js";import{d as te}from"./chunk-ZQHLECTI.js";import{a as ne,d as A,h as j,i as M,j as N,k as P,l as re,o as ie,p as F,r as ae,s as I,t as oe}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var se=[`name`,`version`,`uid`,`resolved`,`integrity`,`dependencies`,`optionalDependencies`];function ce(e,t){let n=e.indexOf(`@`,1);if(n===-1)throw new A(`${j(e)} is not a pattern of the form name@range`,t);return{name:O(e.slice(0,n),t),range:e.slice(n+1)}}function le(e){if(!e.startsWith(`npm:`))return;let t=e.slice(4),n=t.indexOf(`@`,1);return n===-1?{name:t,range:``}:{name:t.slice(0,n),range:t.slice(n+1)}}var ue=new Set([`github.com`,`gitlab.com`,`bitbucket.com`,`bitbucket.org`]);function L(e){if(/^(?:git:|git\+.+:|ssh:|https?:.+\.git(?:$|#.))/u.test(e))return!0;let t=URL.parse(e);return t!==null&&ue.has(t.hostname)&&`${t.pathname}${t.search}`.split(`/`).filter(Boolean).length===2}var de=/^[^:@%/\s.-][^:@%/\s]*\/[^:@\s/%][^:@\s/%#]*(?:#.*)?$/u;function R(e){return L(e)?`git`:/^https?:\/\//u.test(e)||!e.includes(`@`)&&/\.(?:tgz|tar\.gz)$/u.test(e)?`tarball`:e.startsWith(`github:`)||de.test(e)?`github`:/^(?:file:|\.{1,2}\/|\/)/u.test(e)?`file`:/^(link|gitlab|gist|bitbucket):/u.exec(e)?.[1]??`registry`}var fe={github:{host:`github.com`,archive:e=>[`https://codeload.github.com/${e}/tar.gz/`,``]},gitlab:{host:`gitlab.com`,archive:e=>[`https://gitlab.com/${e}/repository/archive.tar.gz?ref=`,``]},bitbucket:{host:`bitbucket.org`,archive:e=>[`https://bitbucket.org/${e}/get/`,`.tar.gz`]}};function pe(e){let t=e.split(`@`),n=(t.length>2?`${t[1]}@${t[2]}`:e).replace(/#.*/u,``).replace(/^.*:/u,``).replace(/.git$/u,``).split(`/`);return n.length<2?void 0:n.slice(-2).join(`/`)}function z(e){let t=e.replace(/^(?:file|link):/u,``);return t.startsWith(`/`)?`/${t.split(`/`).filter(e=>e!==``&&e!==`.`).join(`/`)}`:u(`.`,t)}function me(e,t,n){let r=k(e,t);if(n!==void 0&&n.valid(r)===null)throw new A(`${j(r)} is not a version semver reads`,t);return r}function he(e,t,n,r,i){if(e.startsWith(`file:`))l(e.slice(e.startsWith(`file:./`)?7:5),r);else if(!h(e))throw new A(`${j(e)} is not an http(s) URL, a file: path or a git URL`,r);if(t!==void 0&&!f(t))throw new A(`${j(t)} is not the hex sha1 of a tarball`,r);let a=n===void 0?void 0:m(n,i).get(`sha1`);if(t!==void 0&&a!==void 0&&a.slice(5)!==te(ee(t)))throw new A(`${j(a)} is not the sha1 after the "#" of resolved`,i);return{type:`tarball`,tarball:e,sha1:t,integrity:n}}function ge(e,t){let n=M(t,`resolved`),r=M(t,`integrity`);if(e.resolved===void 0){if(e.integrity!==void 0)throw new A(`an integrity, with nothing resolved`,r);return}let[i,a,...o]=S(e.resolved,n).split(`#`);if(o.length>0)throw new A(`more than one "#", of which yarn reads the first alone`,n);if(!L(i))return he(i,a,e.integrity,n,r);if(e.integrity!==void 0)throw new A(`an integrity, which yarn does not check for a git repository`,r);if(a===void 0||!d(a))throw new A(`expected a full commit hash after the "#" of ${j(i)}`,n);return{type:`git`,repo:p(i,n),commit:a}}function B(e){if(e!==void 0)return e.type===`git`?`${e.repo}#${e.commit}`:e.tarball.replace(/^file:\.\//u,`file:`)}var _e=e=>e===void 0?`nothing, as for a directory`:e.type===`git`?`a git repository`:`a file: tarball`;function ve(e,t,n){let[r]=e,i=e.find(e=>e.name!==r.name);if(i!==void 0)throw new A(`${j(r.key)} and ${j(i.key)} give it two names, of which yarn installs it under one alone`,n);if(t.name!==void 0){let e=y(t.name,M(n,`name`)),i=e===r.name?`the name its patterns give, which yarn does not write`:`yarn installs this as ${j(e)}, and leaves ${j(r.name)} out, which its patterns ask for`;throw new A(i,M(n,`name`))}let a=e.filter(e=>e.source===`registry`).map(({key:e,name:t,alias:r})=>[e,r===void 0?t:O(r.name,n)]),o=a.find(([,e])=>e!==a[0][1]);if(o!==void 0)throw new A(`${j(a[0][0])} and ${j(o[0])} ask for two packages, ${j(a[0][1])} and ${j(o[1])}`,n);return a[0]?.[1]}function ye({range:e,source:t},n){let r=e.split(`#`)[0];if(t===`file`||t===`link`)return n===void 0;if(t===`tarball`)return n?.tarball===r;if(t===`git`)return n?.repo===r;if(t===`gist`)return n?.repo===`https://gist.github.com/${r.slice(5)}.git`;let{host:i,archive:a}=fe[t],o=pe(e);if(o===void 0||n===void 0)return!1;if(n.type===`git`)return n.repo===`git+ssh://git@${i}/${o}.git`;let[s,c]=a(o),{tarball:l}=n;return l.startsWith(s)&&l.endsWith(c)&&d(l.slice(s.length,l.length-c.length))}function be(e,t){let[n,...r]=e.filter(e=>e.source===`file`||e.source===`link`),i=r.find(e=>n.source===`link`||e.source===`link`||z(e.range)!==z(n.range));if(i!==void 0)throw new A(`${j(n.key)} and ${j(i.key)} share an entry, where yarn writes one for each`,t)}function xe(e,t,{asks:n,version:r},i){let a=e.filter(e=>e.source!==`registry`),o=a.find(e=>!ye(e,t));if(o!==void 0)throw new A(`${j(o.key)} resolves to another source than it names`,M(i,`resolved`));be(e,i);let s=e.find(e=>e.source===`registry`);if((a.length===0||a.some(e=>e.source===`tarball`))&&t?.type===`tarball`&&t.sha1===void 0&&t.integrity===void 0)throw new A(`a tarball with no hash, neither a sha1 after "#" nor an integrity, where yarn writes the sha1`,M(i,`resolved`));if(s!==void 0){if(a.length>0)return{registry:s.key,sources:a.map(e=>e.key)};if(t===void 0&&e.length===1)return{registry:s.key,sources:[]};if(t?.type!==`tarball`||t.tarball.startsWith(`file:`))throw new A(`${j(s.key)} asks for the registry, and resolves to ${_e(t)}`,i);g(t.tarball,n,r,M(i,`resolved`))}}function Se(e,t,n){let r=Object.create(null);for(let[i,a,o]of v(b(e),t)){let e=`${O(i,o)}@${y(a,o)}`;r[i]=e,n.push({targets:r,name:i,range:a,pattern:e,where:o})}return r}function Ce({keys:e,fields:n},r,i){_(n,r,se);let a=e.map(e=>{let{name:t,range:n}=ce(e,M(``,e));return{key:e,name:t,range:n,source:R(n),alias:le(n)}}),o=ve(a,n,r),s=me(n.version,M(r,`version`),i),c=ge(n,r),l=xe(a,c,{asks:o,version:s},r),u=[],{dependencies:d,optionalDependencies:f}=t(n,r,(e,t)=>Se(e,t,u)),p=x(n,`uid`,r,y);if(p===s)throw new A(`the version, which yarn does not write as a uid`,M(r,`uid`));return{pkg:{patterns:e,name:a[0].name,version:s,uid:p,resolution:c,dependencies:d,optionalDependencies:f},patterns:a,handed:l,requests:u}}var we=/^(?![vV=]?\d|[xX*](?:\.|$))[A-Za-z][\w.-]*$/u;function V(e,t){return t===void 0?!/[:/@#]/u.test(e)&&!we.test(e):t.validRange(e)!==null}function Te(e,t,n,r,i){let a=e=>e.source===`registry`&&V(e.range,r),o=t.find(a)??n.patterns.find(a);if(o!==void 0)throw new A(`is ${e.name} ${e.version}, as ${j(n.key)} is, and yarn gives ${j(o.key)} whichever it resolves first`,i)}var H=({integrity:e})=>e===void 0?new Map:m(e),U=e=>JSON.stringify(Object.entries(e).sort(([e],[t])=>e<t?-1:1));function W(e,t,n,r){for(let i of[`dependencies`,`optionalDependencies`])if(U(e[i])!==U(t[i]))throw new A(`other ${i} ${n}`,M(r,i))}function Ee(e,t,n){let r=`than ${j(t.patterns[0])}, of the same ${e.resolution.type===`git`?`commit`:`tarball`}`;if(e.version!==t.version)throw new A(`another version ${r}`,M(n,`version`));W(e,t,r,n);let[i,a]=[e.resolution,t.resolution];if(i.sha1!==void 0&&a.sha1!==void 0&&i.sha1!==a.sha1)throw new A(`another sha1 ${r}`,M(n,`resolved`));let o=H(a);for(let[e,t]of H(i))if(o.has(e)&&o.get(e)!==t)throw new A(`another ${e} integrity ${r}`,M(n,`integrity`))}function De(e,t){let n=Object.create(null),r=[],i=[],a=[],o=new Map,s=new Map,c=new Map;for(let l of e){let[e]=l.keys,u=M(``,e),d=Ce(l,u,t),{pkg:f}=d;for(let e of l.keys)n[e]=f;r.push(...d.patterns),i.push(...d.requests),d.handed!==void 0&&a.push({pkg:f,...d.handed});let p=d.patterns.find(e=>e.source===`file`),m=l.fields.resolved??(p===void 0?void 0:`
2
+ ${z(p.range)}`),h=m===void 0?void 0:`${f.name}
3
+ ${m}`;if(o.has(h))throw new A(`resolves as ${j(o.get(h))} does, which yarn writes as one entry`,u);h!==void 0&&o.set(h,e);let g=B(f.resolution);if(g!==void 0){let e=s.get(g)??s.set(g,[]).get(g);e.length>0&&Ee(f,e[0],u),e.push(f)}if(d.handed?.sources.length===0)continue;let _=`${f.name}
4
+ ${f.version}`,v=c.get(_);v===void 0?c.set(_,{key:e,patterns:d.patterns}):Te(f,d.patterns,v,t,u)}for(let e of a)e.other=s.get(B(e.pkg.resolution))?.find(t=>t!==e.pkg);return{packages:n,patterns:r,requests:i,mixed:a}}var G=`manifests`;function Oe(e,t,n){let r=/^(?:file|link):/u.exec(e)?.[0];if(r===void 0&&!e.startsWith(`/`))return e;let i=e.slice(r?.length??0);if(i.startsWith(`/`)||/^[A-Za-z]:/u.test(i))throw new A(`${j(e)} is an absolute path`,n);let a=l(u(t,i),n);return`${r}${a!==`.`&&/^\.(?:\/|$)/u.test(i)&&!/^\.{0,2}\//u.test(a)?`./`:``}${a}`}var K=(e,t,n)=>n===void 0?e.version===t||void 0:n.satisfies(e.version,t,{loose:!0});function q({name:e,range:t,pattern:n,where:r},i,a){let o=i.get(e);if(o!==void 0&&K(o,t,a)===!0)throw new A(`${j(n)} is satisfied by the workspace ${j(o.dir)}, which yarn links instead`,r)}function J({name:e,range:t,pattern:n,where:r},i,a){let o=i?.get(e);if(o===void 0)throw new A(`${j(n)} is not a pattern of the lockfile${i===void 0?`, nor a workspace's, as only the manifests may say`:``}`,r);if(K(o,t,a)===!1)throw new A(`${j(n)} is not a pattern of the lockfile, nor satisfied by the workspace ${j(o.dir)}, ${o.version}`,r);return`link:${o.dir}`}function Y(e,t,n,r){for(let i of e)i.pattern in t||(i.targets[i.name]=J(i,n,r))}function X(e,{packages:t,workspaces:n,semver:r}){return e.pattern in t?(q(e,n,r),e.pattern):J(e,n,r)}var ke=[`optionalDependencies`,`dependencies`,`devDependencies`];function Ae(t,n,r,i){let a=new Map;for(let e of ke)for(let[n,i,o]of v(b(t[e]),M(r,e))){if(n===`//`)continue;let t=y(i,o),r=a.get(n)??a.set(n,{kind:e,value:t,here:o,range:void 0}).get(n);r.range===void 0&&t!==``&&t!==`*`&&(r.range=t)}let o=Object.create(null);for(let t of e)o[t]=Object.create(null);for(let[e,{kind:t,value:r,here:s,range:c}]of a){let a=Oe(c??r,n,s);o[t][e]=X({name:e,range:a,pattern:`${O(e,s)}@${a}`,where:s},i)}return o}function je(e,t,n){let r=[];for(let[a,o,s]of v(b(e),t)){if(a===`//`)continue;if(/\/$|\/\/|\*$/u.test(a))throw new A(`${j(a)} is a path yarn ignores`,s);let e=a.match(/(?:@[^/]+\/)?[^/]+/gu)??[a],t=i(e.length===1?`**/${a}`:a,s),c=O(e.at(-1),s),l=e.slice(0,-1).find(e=>e!==`**`&&!D(e.replaceAll(/[*?]/gu,`x`)));if(l!==void 0)throw new A(`${j(l)} is not a package name, or a glob of one`,s);let u=y(o,s);if(R(u)===`registry`&&!V(u,n))throw new A(`${j(u)} is a range yarn ignores in a resolution: neither a semver range nor a source`,s);r.push({path:a,tests:t,name:c,range:u,pattern:`${c}@${u}`,where:s})}return r}function Me(t,r,i){let a=Object.values(t).flatMap(t=>e.map(e=>t[e])),o=n([i.map(e=>e.pattern).filter(e=>e in r),...a],r);if(o!==void 0)throw new A(`nothing asks for it: no manifest, no package and no resolution`,M(``,o))}function Ne(e,t){let n=e.workspaces;if(n===void 0)return[];let r=M(t,`workspaces`),a=n;Array.isArray(n)||(_(n,r,[`packages`,`nohoist`]),x(n,`nohoist`,r,C),a=n.packages===void 0?[]:n.packages,r=M(r,`packages`));let o=C(a,r);if(o.length>0&&e.private!==!0)throw new A(`expected true, as yarn has workspaces in a private project alone`,M(t,`private`));return o.map((e,t)=>i(e.replace(/^(?:\.\/)+/u,``).replace(/(?<!\/)\/+$/u,``),`${r}[${t}]`))}var Pe={__proto__:null,depdenencies:`dependencies`,dependancies:`dependencies`,dependecies:`dependencies`,depends:`dependencies`,"dev-dependencies":`devDependencies`,devDependences:`devDependencies`,devDepenencies:`devDependencies`,devEependencies:`devDependencies`,devdependencies:`devDependencies`},Fe=/^[\s\dA-Za-z.+=-]{1,256}$/u;function Ie(e,t,n){let r=S(e,t);if(!Fe.test(r))throw new A(`${j(r)} is not a version`,t);if(n===void 0)return r;let i=n.clean(r,{loose:!0});if(i===null)throw new A(`${j(r)} is not a version semver reads`,t);return i}function Le(e,t,n,r,i){for(let e of Object.keys(Pe))if(Object.hasOwn(t,e))throw new A(`a field yarn does not read, for ${j(Pe[e])}`,M(n,e));if(l(e,n)===`.`)return;if(r.length===0)throw new A(`expected workspaces, as there are manifests of workspaces`,M(M(G,`.`),`workspaces`));if(e.split(`/`).includes(`node_modules`)||!r.some(t=>c(t,e)))throw new A("not a workspace the root's `workspaces` finds",n);if(t.resolutions!==void 0)throw new A(`a workspace's, which yarn does not read`,M(n,`resolutions`));let a=M(n,`name`),o=O(y(t.name,a),a);if(t.version===void 0)throw new A(`expected a version, without which yarn ignores the workspace`,M(n,`version`));return{name:o,dir:e,version:Ie(t.version,M(n,`version`),i)}}function Re(e,t,n,r){_(e,G);let i=M(G,`.`),a=e[`.`];if(a===void 0)throw new A(`expected the manifest beside the lockfile, "."`,G);let o=Ne(_(a,i),i),s=new Map;for(let[t,n,i]of v(e,G)){let e=Le(t,_(n,i),i,o,r);if(e!==void 0){if(s.has(e.name))throw new A(`the name of the workspace ${j(s.get(e.name).dir)} too`,M(i,`name`));s.set(e.name,e)}}for(let e of n)e.pattern in t&&q(e,s,r);Y(n,t,s,r);let c={packages:t,workspaces:s,semver:r},l=w(e,G,(e,t,n)=>Ae(e,n,t,c)),u=je(a.resolutions,M(i,`resolutions`),r);for(let e of u){if(!(e.pattern in t)&&!s.has(e.name))throw new A(`${j(e.pattern)} is not a pattern of the lockfile, where yarn records every resolution's`,e.where);e.target=X(e,c)}return Me(l,t,u),{importers:l,workspaces:s,rules:u,aggregated:Array.isArray(a.workspaces?.packages??a.workspaces)}}var ze=`workspace-aggregator-00000000-0000-0000-0000-000000000000`;function Be(t,{importers:n,workspaces:r,rules:i,aggregated:c},l){let u=i.map(e=>e.tests),d=(e,t)=>t.split(`/`).reduce((e,t)=>e.map((e,n)=>o(u[n],e,t)),e),f=e=>e.startsWith(`link:`)?n[e.slice(5)]:t[e],p=(e,t,r,i)=>{let a=e.patterns===void 0?M(G,Object.keys(n).find(t=>n[t]===e)):M(``,e.patterns[0]);return new A(`${j(e[t][r])} ${i}`,M(M(a,t),r))},m=new Map,h=[],g=new Set,_=new Map,v=(e,t,n,r)=>{let i=e[t][n],a=r===void 0||r.pattern===i,o=a?_.get(i):g.has(i)?r:void 0;if(o!==void 0)throw p(e,t,n,`is asked for both where the resolution ${j(o.path)} applies and where none does, and yarn writes one entry for both`);a?g.add(i):_.set(i,r)},y=new Set,x=(e,t)=>{if(y.has(e))return;let n=m.get(e)??new Set,r=t.join();n.has(r)||(m.set(e,n.add(r)),h.push([e,t]))},S=n[`.`],C=u.map(e=>a(e,1)),w=d(C,ze),T=new Map,E=[],D=(e,n)=>t[e.target]===n||l.get(n)?.sources[0]===e.target,O=(e,n,a,o)=>{let m=e[n][a],h=d(o,a),g=t[m],_=l.get(g),y=_===void 0?``:`the resolution ${j(_.rule.path)} resolves to`,b=e===S&&(!c||r.has(a)),C=e===S&&!b?d(w,a):h,O=i.find((e,t)=>e.name===a&&s(u[t],C[t]));if(b){if(_!==void 0)throw p(e,n,a,`is given what ${y}, which yarn applies to no dependency of the root's own`);if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)} as the resolution ${j(O.path)} says, which yarn ignores for the root's own dependencies`);return v(e,n,a,void 0),x(f(m),h)}if(O!==void 0&&!D(O,g))throw p(e,n,a,`is not given ${j(O.pattern)}, which the resolution ${j(O.path)} resolves it to`);if(_?.sources.includes(m))throw p(e,n,a,`asks for what ${y}, as a dependency of its own`);if(_!==void 0&&!_.sources.includes(O?.target))throw p(e,n,a,`is given what ${y}, which yarn does not apply to it here`);v(e,n,a,O),e===S&&O!==void 0&&T.set(m,O),O===void 0?x(f(m),h):O.target.startsWith(`link:`)&&E.push([e[n],a,O.target])},k=()=>{for(;h.length>0;){let[t,n]=h.pop();for(let r of e)for(let e of Object.keys(b(t[r])))O(t,r,e,n)}};for(let e of i)e.pattern in t&&(g.add(e.pattern),x(t[e.pattern],d(C,e.name)));k(),y=new Set(m.keys());for(let t of e)for(let e of Object.keys(S[t]))O(S,t,e,C);for(let[e,{dir:t}]of r)x(n[t],d(w,e));k();for(let[e,t,n]of E)e[t]=n;return{plain:g,own:T}}function Ve(e,t,n,r,i){for(let{key:a,range:o,source:s,alias:c}of t){let t=n?.own.get(a);if(s!==`registry`||t===void 0&&n?.plain.has(a)===!1)continue;let l=c?.range??o,{version:u}=e[a];if(l===``||r.satisfies(u,l)||r.validRange(l)===null)continue;let d=i?`and no resolution gives it`:`which only a resolution may excuse, as the manifests would say`;throw t!==void 0&&(d=`which the root asks for before the resolution ${j(t.path)} applies, so yarn takes it as outdated`),new A(`${u} does not satisfy ${j(l)}, ${d}`,M(``,a))}}function He(e,t,n){let r=t?.workspaces.get(e.name);if(r===void 0)return;let i=t.rules.find(e=>e.target===`link:${r.dir}`);if(i===void 0)return;let a=`than the workspace ${j(r.dir)}, which the resolution ${j(i.path)} gives it`;if(e.version!==r.version)throw new A(`another version ${a}, ${r.version}`,M(n,`version`));return W(e,t.importers[r.dir],a,n),i}function Ue({packages:e,patterns:t,mixed:n},r,i){let a=new Map;for(let{pkg:e,registry:t,sources:i,other:o}of n){let n=M(``,e.patterns[0]);if(i.length===0){let i=He(e,r,n);if(i===void 0)throw new A(`${j(t)} asks for the registry, and resolves to nothing, ${r===void 0?`which only a resolution to a workspace may, as the manifests would say`:`as for a directory`}`,n);a.set(e,{sources:[i.target],rule:i});continue}if(r===void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(i[0])} names, which only a resolution may, as the manifests would say`,n);let s=i.find(e=>!r.rules.some(t=>t.pattern===e));if(s!==void 0)throw new A(`${j(t)} asks for the registry, and is given what ${j(s)} names, which no resolution does`,n);let c=r.rules.find(e=>i.includes(e.pattern));if(o!==void 0)throw new A(`asks for what the resolution ${j(c.path)} resolves to, as a dependency of its own`,M(``,o.patterns[0]));a.set(e,{sources:i,rule:c})}let o=r!==void 0&&r.rules.length>0?Be(e,r,a):void 0;i!==void 0&&Ve(e,t,o,i,r!==void 0);for(let[t,{sources:n}]of a)n[0].startsWith(`link:`)&&delete e[t.patterns[0]]}var We=[`# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.`,`# yarn lockfile v1`],Ge=/^# yarn lockfile v(\d+)$/u,Ke=/[:\s\\",[\]]/u,qe=e=>e.startsWith(`true`)||e.startsWith(`false`)||Ke.test(e)||!/^[A-Za-z]/u.test(e),Je=/[A-Za-z][^\s:\\",[\]]*/uy;function Ye(e,t,n){let[r,i]=oe(e,t,n);if(r.includes(`\\"`))throw N(`${j(r)} is a string yarn reads to another quote`,n);let a=P.exec(r)?.[0];if(a!==void 0)throw N(`an escape for ${ne(a)}, which is not allowed`,n);if(!qe(r))throw N(`${j(r)} is quoted, where yarn writes it bare`,n);return[r,i]}function Xe(e,t,n){if(e[t]===`"`)return Ye(e,t,n);Je.lastIndex=t;let r=Je.exec(e)?.[0];if(r===void 0)throw N(`expected a string, found ${ie(e,t)}`,n);if(qe(r))throw N(`${j(r)} is bare, where yarn quotes it`,n);return[r,t+r.length]}function Z(e,t,n){let[r,i]=Xe(e,t,n);if(r===``)throw N(`an empty key, which yarn does not read`,n);return[r,i]}function Ze(e,t,n){let[r,i]=Xe(e,t,n);if(r.startsWith(`null`)&&e[t]!==`"`)throw N(`${j(r)} is bare, and read as null by some readers`,n);return Q(e,i,n),r}function Q(e,t,n){if(t!==e.length)throw N(`expected the end of the line, found ${j(e.slice(t))}`,n)}function Qe(e,t){if(e.line!==t)throw N(`expected yarn's header, ${j(t)}`,e.number);I(e)}function $e(e){Qe(e,We[0]);let t=Ge.exec(e.line??``)?.[1];if(t!==void 0&&t!==`1`)throw N(`unsupported version: expected "1", found ${j(t)}`,e.number);for(Qe(e,We[1]);e.line?.startsWith(`#`);I(e)){if(/^yarn lockfile v\d+$/u.test(e.line.slice(1).trim()))throw N(`a second lockfile version`,e.number);if(e.line===`#`)throw N(`a comment of "#" alone, which @yarnpkg/parsers does not read`,e.number)}}function $(e,t,n,r,i){let a=Object.create(null);for(let n=e.line;n?.startsWith(` `)&&F(n)>t-2;n=e.line){if(F(n)!==t)throw N(`expected ${t} spaces of indentation, found ${F(n)}`,e.number);let[r,o]=Z(n,t,e.number);i(a,r,o,n,e.number)}if(Object.keys(a).length===0)throw N(n,r);return a}var et=(e,t,n)=>$(e,4,`expected what ${j(t)} holds below it`,n,(n,r,i,a,o)=>{if(a[i]!==` `)throw N(`expected a space and a range after ${j(r)}`,o);let s=Ze(a,i+1,o);if(r in n)throw N(`${j(r)} is in ${j(t)} twice`,o);n[r]=s,I(e)}),tt=(e,t)=>$(e,2,`expected the fields of the entry below it`,t,(t,n,r,i,a)=>{if(n in t)throw N(`the field ${j(n)} twice`,a);if(i[r]===`:`)Q(i,r+1,a),I(e),t[n]=et(e,n,a);else{if(i[r]!==` `)throw N(`expected a space and a value, or ":", after ${j(n)}`,a);t[n]=Ze(i,r+1,a),I(e)}});function nt(e,t){let{line:n,number:r}=e,i=[];for(let e=0;;){let[a,o]=Z(n,e,r);if(t.has(a))throw N(`${j(a)} is a key ${t.get(a)===r?`twice`:`at line ${t.get(a)+1} too`}`,r);if(t.set(a,r),i.push(a),n[o]===`:`){Q(n,o+1,r);break}if(!n.startsWith(`, `,o))throw N(`expected ", " and a pattern, or ":", after ${j(a)}`,r);e=o+2}return I(e),{keys:i,fields:tt(e,r)}}function rt(e){re(e,`yarn`);let t=ae(e,P);I(t),$e(t);let n=[],r=new Map,i;for(let e=t.line;e!==void 0;e=t.line)if(e===``)n.length>0&&(i??=t.number),I(t);else{if(e.startsWith(` `))throw i===void 0?N(`expected an entry, at column 0`,t.number):N(`a blank line within an entry`,i);if(e.startsWith(`#`))throw N(`a comment, which yarn writes in the header alone`,t.number);i=void 0,n.push(nt(t,r))}return n}var it=[`manifests`,`checkVersions`,`semver`],at=[`clean`,`satisfies`,`valid`,`validRange`];function ot(e,t){let n=t===void 0?()=>({dev:void 0,optional:void 0,devOptional:void 0}):r(e,t);for(let t of new Set(Object.values(e)))Object.assign(t,n(t))}function st(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let{manifests:n,semver:r}=T(t,it);E(t,at);let i=De(rt(e),r),{packages:a,requests:o}=i;n===void 0&&Y(o,a);let s=n===void 0?void 0:Re(n,a,o,r);return Ue(i,s,r),ot(a,s?.importers),{packages:a,importers:s?.importers}}export{A as LockfileError,st as parseYarn1Lockfile};