@preventive/triage 1.0.0-alpha.9 → 1.0.0-alpha.90
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.
- package/LICENSE-APACHE +202 -0
- package/README.md +16 -0
- package/api/reap.ts +16 -78
- package/cli.js +6 -0
- package/client/dependency-paths.d.ts +3 -0
- package/client/dependency-paths.js +36 -0
- package/client/finding-link.js +305 -0
- package/client/linked-findings.d.ts +1 -0
- package/client/linked-findings.js +115 -0
- package/common/bundle-commit.d.ts +1 -0
- package/common/bundle-commit.js +4 -0
- package/common/bundle-compare-diff.d.ts +6 -0
- package/common/bundle-compare-diff.js +378 -0
- package/common/bundle-compare-inputs.d.ts +3 -0
- package/common/bundle-compare-inputs.js +141 -0
- package/common/bundle-compare-versions.js +172 -0
- package/common/bundle-comparison.d.ts +8 -0
- package/common/bundle-comparison.js +69 -0
- package/common/bundle-imports.js +20 -0
- package/common/bundle-metadata.d.ts +15 -0
- package/common/bundle-metadata.js +226 -0
- package/common/bundle-pkg-of.d.ts +1 -0
- package/common/bundle-pkg-of.js +90 -0
- package/common/bundle-reasons.d.ts +6 -0
- package/common/bundle-reasons.js +58 -0
- package/common/bundle-source-links.d.ts +6 -0
- package/common/bundle-source-links.js +216 -0
- package/common/bundle-sourcemap.d.ts +10 -0
- package/common/bundle-sourcemap.js +100 -0
- package/common/bundle-sources.d.ts +10 -0
- package/common/bundle-sources.js +374 -0
- package/common/bundle-stats.js +41 -0
- package/common/bundle-tabs.js +1 -0
- package/common/code-language.js +80 -0
- package/common/default-scan-models.ts +37 -0
- package/common/dependency-reviews.d.ts +19 -0
- package/common/dependency-reviews.js +67 -0
- package/common/finding-duplicates.js +63 -0
- package/common/finding-filters.js +313 -0
- package/common/finding-id.js +47 -0
- package/common/finding-repo.d.ts +5 -0
- package/common/finding-repo.js +67 -0
- package/common/github-issue-labels.d.ts +3 -0
- package/common/github-issue-labels.js +42 -0
- package/common/github-pr.ts +56 -0
- package/common/gzip.js +59 -0
- package/common/line-diff.d.ts +15 -0
- package/common/line-diff.js +188 -0
- package/common/linked-workspace-groups.js +63 -0
- package/common/managed/agent-tasks.ts +292 -0
- package/common/managed/comments.ts +43 -0
- package/common/managed/dependency-routes.js +25 -0
- package/common/managed/directory-packages.ts +28 -0
- package/common/managed/finding-detail.d.ts +5 -0
- package/common/managed/finding-detail.js +75 -0
- package/common/managed/finding-values.d.ts +2 -0
- package/common/managed/finding-values.js +138 -0
- package/common/managed/github-agents.ts +114 -0
- package/common/managed/github-logins.ts +49 -0
- package/common/managed/lite-name.d.ts +2 -0
- package/common/managed/lite-name.js +20 -0
- package/common/managed/npm-packages.d.ts +9 -0
- package/common/managed/npm-packages.js +63 -0
- package/common/managed/permissions.ts +31 -0
- package/common/managed/report-content.ts +72 -0
- package/common/managed/report-filter.ts +120 -0
- package/common/managed/repository-alias.ts +65 -0
- package/common/managed/review-view-routes.js +23 -0
- package/common/managed/risk-routes.js +30 -0
- package/common/managed/roles.ts +48 -0
- package/common/managed/routes.d.ts +2 -0
- package/common/managed/routes.js +386 -0
- package/common/managed/scan-models.ts +6 -0
- package/common/managed/stasis-config.ts +7 -0
- package/common/managed/team-app.d.ts +19 -0
- package/common/managed/team-app.js +129 -0
- package/common/managed/team-filters.js +26 -0
- package/common/managed/triage.ts +83 -0
- package/common/managed/upload-seal.ts +126 -0
- package/common/npm-token.d.ts +2 -0
- package/common/npm-token.js +14 -0
- package/common/pretty-json.js +123 -0
- package/common/pretty-kinds.js +20 -0
- package/common/pretty-print.d.ts +7 -0
- package/common/pretty-print.js +41 -0
- package/common/pretty-sourcemap.js +70 -0
- package/common/repo-commit.d.ts +4 -0
- package/common/repo-commit.js +30 -0
- package/common/revalidation-conflicts.js +48 -0
- package/common/revalidation-input-groups.js +56 -0
- package/common/scan-server.ts +13 -0
- package/common/security-links.d.ts +5 -0
- package/common/security-links.js +33 -0
- package/common/server-info.ts +46 -0
- package/common/sourcemap-listing.js +78 -0
- package/common/sourcemap-mappings.js +136 -0
- package/common/sourcemap-unlist.js +85 -0
- package/common/stasis-files.d.ts +5 -0
- package/common/stasis-files.js +20 -0
- package/common/stasis-tgz.d.ts +6 -0
- package/common/stasis-tgz.js +27 -0
- package/common/utf8.d.ts +3 -0
- package/common/utf8.js +45 -0
- package/common/whitespace-insensitive.js +19 -0
- package/common/workspace-app.js +91 -0
- package/common/workspace-groups.js +176 -0
- package/out/activity.js +2 -0
- package/out/brotli-fallback.js +3 -3
- package/out/chunk-2XUEZHIP.js +28 -0
- package/out/chunk-3DOSBILK.js +4 -0
- package/out/chunk-55YIWY3H.js +5 -0
- package/out/chunk-5AVGKFMR.js +1 -0
- package/out/chunk-5PWEAEA5.js +1 -0
- package/out/chunk-6VOB5WXX.js +2 -0
- package/out/chunk-6Y6PZ2BU.js +9 -0
- package/out/chunk-74JZTGTO.js +11 -0
- package/out/chunk-7BKKYVWR.js +7 -0
- package/out/chunk-7C7DWL7I.js +1 -0
- package/out/chunk-7HP2VYIC.js +2 -0
- package/out/chunk-7YFJUT2P.js +1 -0
- package/out/chunk-A4BBBHQU.js +1 -0
- package/out/chunk-B64CTMVU.js +4 -0
- package/out/chunk-BEKYZCPX.js +14 -0
- package/out/chunk-BZJU5EEV.js +1 -0
- package/out/chunk-C4Z6ZBXV.js +10 -0
- package/out/chunk-CJVMNJDZ.js +3 -0
- package/out/chunk-CU3FPB3P.js +1 -0
- package/out/chunk-DEVAORP2.js +1 -0
- package/out/chunk-DUASGS2O.js +8 -0
- package/out/chunk-EEJA7JBI.js +13 -0
- package/out/chunk-ESXA7KID.js +1 -0
- package/out/chunk-FSU2PLJL.js +1 -0
- package/out/chunk-GO7FT4OD.js +1 -0
- package/out/chunk-GX5UXWT4.js +1 -0
- package/out/chunk-HGWFRZNC.js +267 -0
- package/out/chunk-IYPY47MC.js +1 -0
- package/out/chunk-JZAROLQT.js +40 -0
- package/out/chunk-K4XJHM2T.js +1 -0
- package/out/chunk-KP2XM324.js +6 -0
- package/out/chunk-LRWB6QVO.js +1 -0
- package/out/chunk-LVSLM7HB.js +1 -0
- package/out/chunk-LVW7WWV4.js +1 -0
- package/out/chunk-N57OWFKY.js +15 -0
- package/out/chunk-NRPC74AM.js +1 -0
- package/out/chunk-OOJM4CTU.js +1 -0
- package/out/chunk-PKLVXUEI.js +11 -0
- package/out/chunk-PLGH63UC.js +2 -0
- package/out/chunk-PNHBZGDD.js +1 -0
- package/out/chunk-PWFUOLZK.js +17 -0
- package/out/chunk-PXK7EU4V.js +1 -0
- package/out/chunk-QD3IBSF4.js +7 -0
- package/out/chunk-QI66YA4F.js +1 -0
- package/out/chunk-QRKFPLA4.js +80 -0
- package/out/chunk-R3NZFXVR.js +1 -0
- package/out/chunk-R5O6FAW4.js +2 -0
- package/out/chunk-RAM3GDAD.js +1 -0
- package/out/chunk-RPNO56H2.js +1 -0
- package/out/chunk-SMNFBOLO.js +10 -0
- package/out/chunk-SSPDMA6D.js +1 -0
- package/out/chunk-SZTCJVZJ.js +55 -0
- package/out/chunk-SZWPYLPC.js +1 -0
- package/out/chunk-TKPNRQNN.js +3 -0
- package/out/chunk-TUII34K2.js +1 -0
- package/out/chunk-UJP4PQJA.js +1 -0
- package/out/chunk-UJSJMXEG.js +1 -0
- package/out/chunk-UR4WYMIP.js +1 -0
- package/out/chunk-UTYWTUTC.js +1 -0
- package/out/chunk-VHEXSGGP.js +1 -0
- package/out/chunk-VYYUMYVW.js +9 -0
- package/out/chunk-WBK5ZN4K.js +3 -0
- package/out/chunk-WCDYSIKG.js +1 -0
- package/out/chunk-XM4RLC4A.js +2 -0
- package/out/chunk-XRAAYXPR.js +1 -0
- package/out/chunk-ZQHLECTI.js +1 -0
- package/out/client-managed-import.js +4 -0
- package/out/client-managed.js +35 -0
- package/out/client-sync.js +11 -17
- package/out/compare.js +26 -0
- package/out/dialogs.js +40 -0
- package/out/github-issue-authorized.html +3 -0
- package/out/github-issue-authorized.js +1 -0
- package/out/graph.js +19 -5
- package/out/index.html +105 -25
- package/out/prism.js +14 -10
- package/out/scan.js +2 -0
- package/out/stasis.svg +20 -0
- package/out/terminal.js +367 -39
- package/out/view.css +1 -1
- package/out/view.js +19 -148
- package/package.json +416 -64
- package/risk/actions/findings.js +161 -0
- package/risk/actions/resolve.js +287 -0
- package/risk/actions/scripts/commands.js +182 -0
- package/risk/actions/scripts/grade.js +113 -0
- package/risk/actions/scripts/packages.js +123 -0
- package/risk/actions/scripts/shell.js +169 -0
- package/risk/actions/uses.js +94 -0
- package/risk/actions/workflow.js +183 -0
- package/risk/files/characters.js +354 -0
- package/risk/files/hosts.js +206 -0
- package/risk/files/readability.js +185 -0
- package/risk/files/runs-code.js +568 -0
- package/risk/files/script.js +420 -0
- package/risk/files/source-map-link.js +43 -0
- package/risk/files/stamps.js +47 -0
- package/risk/index.d.ts +309 -0
- package/risk/index.js +12 -0
- package/risk/npm/assess.js +303 -0
- package/risk/npm/combined.js +68 -0
- package/risk/npm/compare.js +236 -0
- package/risk/npm/dependencies.js +172 -0
- package/risk/npm/diff.js +79 -0
- package/risk/npm/downloads.js +84 -0
- package/risk/npm/files.js +445 -0
- package/risk/npm/held.js +67 -0
- package/risk/npm/install-scripts.js +34 -0
- package/risk/npm/malware.js +38 -0
- package/risk/npm/manifest.js +65 -0
- package/risk/npm/new-dependency.js +60 -0
- package/risk/npm/old-version.js +108 -0
- package/risk/npm/registry.js +401 -0
- package/risk/npm/release.js +85 -0
- package/risk/npm/score.js +59 -0
- package/risk/npm/specs.js +124 -0
- package/risk/npm/tarball.js +169 -0
- package/server-common/database-config.ts +16 -0
- package/server-common/initialize.ts +18 -0
- package/server-common/npm-advisories.ts +101 -0
- package/{server → server-common}/origin.ts +5 -5
- package/server-common/reap.ts +48 -0
- package/server-common/scan-config.ts +19 -0
- package/server-common/standalone.ts +29 -0
- package/server-common/storage-crypto.ts +182 -0
- package/server-common/storage-log.ts +38 -0
- package/server-common/vercel-blob.ts +103 -0
- package/server-e2e/app.ts +487 -0
- package/{server → server-e2e}/bus-receiver.ts +2 -1
- package/{server → server-e2e}/cli.js +9 -4
- package/{server → server-e2e}/config.ts +52 -42
- package/{server → server-e2e}/db-neon.ts +2 -2
- package/{server → server-e2e}/db-revision-sql.ts +1 -1
- package/{server → server-e2e}/db-stmt.ts +2 -2
- package/{server → server-e2e}/db.ts +7 -7
- package/{server → server-e2e}/http.ts +44 -13
- package/{server → server-e2e}/hub.ts +40 -9
- package/server-e2e/index.ts +17 -0
- package/server-e2e/lifecycle.ts +95 -0
- package/{server → server-e2e}/neon-driver.ts +2 -2
- package/{server → server-e2e}/npm-proxy.ts +12 -145
- package/{server → server-e2e}/objstore/blob-vercel.ts +10 -114
- package/{server → server-e2e}/objstore/blob.ts +1 -1
- package/{server → server-e2e}/objstore/fetch-mint-guard.ts +2 -2
- package/{server → server-e2e}/objstore/handlers.ts +9 -8
- package/{server → server-e2e}/objstore/init.ts +19 -27
- package/{server → server-e2e}/objstore/reaper.ts +1 -1
- package/{server → server-e2e}/objstore/rest-deny.ts +1 -1
- package/{server → server-e2e}/objstore/rest-mint.ts +3 -3
- package/{server → server-e2e}/objstore/rest.ts +3 -3
- package/{server → server-e2e}/objstore/store-neon.ts +6 -10
- package/{server → server-e2e}/objstore/store.ts +7 -7
- package/{server → server-e2e}/objstore/tokens.ts +2 -2
- package/{server → server-e2e}/pubsub.ts +12 -9
- package/{server → server-e2e}/sign.ts +4 -4
- package/{server → server-e2e}/sse-server.ts +3 -3
- package/{server → server-e2e}/static.ts +18 -17
- package/{server → server-e2e}/sync-handlers.ts +56 -30
- package/{server → server-e2e}/ws-server.ts +20 -9
- package/server-managed/activity.ts +269 -0
- package/server-managed/agent-merges.ts +109 -0
- package/server-managed/app-agents.ts +23 -0
- package/server-managed/avatar-store.ts +21 -0
- package/server-managed/blob-store.ts +26 -0
- package/server-managed/brotli.ts +10 -0
- package/server-managed/bundle-advisories.ts +176 -0
- package/server-managed/bundle-advisory-inventory.ts +85 -0
- package/server-managed/bundle-build-diagnostics.d.ts +10 -0
- package/server-managed/bundle-build-diagnostics.js +23 -0
- package/server-managed/bundle-build-leases.ts +41 -0
- package/server-managed/bundle-build-worker.js +387 -0
- package/server-managed/bundle-build.ts +328 -0
- package/server-managed/bundle-cache.ts +261 -0
- package/server-managed/bundle-catalog.ts +29 -0
- package/server-managed/bundle-commits.ts +133 -0
- package/server-managed/bundle-dependency-reviews.ts +91 -0
- package/server-managed/bundle-store.ts +24 -0
- package/server-managed/bundle-summary-cache.ts +139 -0
- package/server-managed/bundle-validation.ts +33 -0
- package/server-managed/bundle.ts +151 -0
- package/server-managed/cache-storage.ts +20 -0
- package/server-managed/cli.js +21 -0
- package/server-managed/combined.ts +43 -0
- package/server-managed/comments.ts +138 -0
- package/server-managed/commit-coauthors.ts +105 -0
- package/server-managed/commit-lockfiles.ts +78 -0
- package/server-managed/comparison.ts +51 -0
- package/server-managed/config.ts +163 -0
- package/server-managed/content-access.ts +15 -0
- package/server-managed/crypto.ts +25 -0
- package/server-managed/db-methods.ts +1950 -0
- package/server-managed/db-neon.ts +401 -0
- package/server-managed/db-schema.ts +271 -0
- package/server-managed/db-table-names.ts +22 -0
- package/server-managed/db.ts +150 -0
- package/server-managed/dependabot-access.ts +85 -0
- package/server-managed/dependabot-alerts.ts +197 -0
- package/server-managed/dependency-review-comments.ts +158 -0
- package/server-managed/dependency-reviews.ts +369 -0
- package/server-managed/github-accounts.ts +59 -0
- package/server-managed/github-actions.ts +71 -0
- package/server-managed/github-app.ts +347 -0
- package/server-managed/github-errors.ts +92 -0
- package/server-managed/github-graphql.ts +42 -0
- package/server-managed/github-issue-links.ts +264 -0
- package/server-managed/github-issue-oauth.ts +30 -0
- package/server-managed/github-issues.ts +169 -0
- package/server-managed/github-link-oauth.ts +56 -0
- package/server-managed/github-links.ts +204 -0
- package/server-managed/github-metadata.ts +218 -0
- package/server-managed/github-oauth.ts +264 -0
- package/server-managed/github-pulls.ts +290 -0
- package/server-managed/github-requests.ts +181 -0
- package/server-managed/github-users.ts +53 -0
- package/server-managed/github-values.ts +26 -0
- package/server-managed/history-windows.ts +172 -0
- package/server-managed/http-response.ts +76 -0
- package/server-managed/http.ts +6722 -0
- package/server-managed/import-triage.ts +51 -0
- package/server-managed/index.ts +204 -0
- package/server-managed/kept-briefly.ts +37 -0
- package/server-managed/kept.ts +28 -0
- package/server-managed/known-listings.ts +112 -0
- package/server-managed/link-reports.ts +149 -0
- package/server-managed/listed-activity.ts +39 -0
- package/server-managed/locked-packages.ts +234 -0
- package/server-managed/lockfile-scope.ts +58 -0
- package/server-managed/lru.ts +30 -0
- package/server-managed/managed-issues.ts +92 -0
- package/server-managed/management-catalog.ts +45 -0
- package/server-managed/management.ts +116 -0
- package/server-managed/npm-delta-worker.js +203 -0
- package/server-managed/npm-delta.ts +277 -0
- package/server-managed/npm-insights.ts +455 -0
- package/server-managed/npm-kept.ts +274 -0
- package/server-managed/npm-loads.ts +259 -0
- package/server-managed/npm-manifest.ts +117 -0
- package/server-managed/npm-packages.ts +477 -0
- package/server-managed/npm-patch-paths.ts +86 -0
- package/server-managed/npm-patch.ts +457 -0
- package/server-managed/npm-provenance.ts +127 -0
- package/server-managed/npm-risk.ts +310 -0
- package/server-managed/object-storage-disk.ts +147 -0
- package/server-managed/object-storage-vercel.ts +71 -0
- package/server-managed/object-storage.ts +82 -0
- package/server-managed/package-entry-points.ts +127 -0
- package/server-managed/pretty-copies.ts +22 -0
- package/server-managed/pretty-format.d.ts +4 -0
- package/server-managed/pretty-format.js +27 -0
- package/server-managed/pretty-print.ts +444 -0
- package/server-managed/public-workspace.ts +242 -0
- package/server-managed/pull-comment-reviews.ts +161 -0
- package/server-managed/pull-dependencies.ts +370 -0
- package/server-managed/pull-dependency-reviews.ts +458 -0
- package/server-managed/pull-reviews.ts +202 -0
- package/server-managed/pulse-walk.ts +164 -0
- package/server-managed/queue.ts +54 -0
- package/server-managed/release-commits.ts +85 -0
- package/server-managed/rename-diff-worker.js +30 -0
- package/server-managed/rename-diff.ts +237 -0
- package/server-managed/repo-path.ts +21 -0
- package/server-managed/report-migration.ts +32 -0
- package/server-managed/report-opening.ts +77 -0
- package/server-managed/report-query.ts +10 -0
- package/server-managed/report-response.ts +16 -0
- package/server-managed/report-sources.ts +185 -0
- package/server-managed/report-store.ts +77 -0
- package/server-managed/repository-actions.ts +220 -0
- package/server-managed/repository-agents.ts +422 -0
- package/server-managed/repository-aliases.ts +119 -0
- package/server-managed/repository-browser.ts +362 -0
- package/server-managed/repository-changes.ts +280 -0
- package/server-managed/repository-code.ts +222 -0
- package/server-managed/repository-dependency-reviews.ts +220 -0
- package/server-managed/repository-discovery.ts +83 -0
- package/server-managed/repository-history.ts +444 -0
- package/server-managed/repository-issues.ts +293 -0
- package/server-managed/repository-policy.ts +27 -0
- package/server-managed/repository-pulls.ts +207 -0
- package/server-managed/repository-pulse.ts +409 -0
- package/server-managed/repository-risk-assess.ts +179 -0
- package/server-managed/repository-risk-audit.ts +145 -0
- package/server-managed/repository-risk-caches.ts +56 -0
- package/server-managed/repository-risk-kept.ts +86 -0
- package/server-managed/repository-risk-read.ts +296 -0
- package/server-managed/repository-risk-stasis.ts +61 -0
- package/server-managed/repository-risk-turn.ts +97 -0
- package/server-managed/repository-risk.ts +528 -0
- package/server-managed/repository-squashes.ts +160 -0
- package/server-managed/repository-stamp.ts +41 -0
- package/server-managed/request-timing.ts +63 -0
- package/server-managed/reviewed-dependencies.ts +170 -0
- package/server-managed/revisions.ts +35 -0
- package/server-managed/scan-downloads.ts +121 -0
- package/server-managed/session.ts +132 -0
- package/server-managed/slugs.ts +38 -0
- package/server-managed/solidity-entry-points.ts +71 -0
- package/server-managed/sql-postgres.ts +34 -0
- package/server-managed/sql.ts +107 -0
- package/server-managed/stasis-config.ts +147 -0
- package/server-managed/stasis-dependencies.ts +280 -0
- package/server-managed/static.ts +28 -0
- package/server-managed/storage-command.ts +16 -0
- package/server-managed/storage-db.ts +183 -0
- package/server-managed/storage-encryption.ts +288 -0
- package/server-managed/storage-maintenance.ts +259 -0
- package/server-managed/storage-payload.ts +121 -0
- package/server-managed/storage-stores.ts +91 -0
- package/server-managed/storage.ts +82 -0
- package/server-managed/team-app-summaries.ts +57 -0
- package/server-managed/team-app.ts +162 -0
- package/server-managed/team-catalog.ts +7 -0
- package/server-managed/team-feed.ts +180 -0
- package/server-managed/team-icons.ts +50 -0
- package/server-managed/team-npm-scopes.ts +103 -0
- package/server-managed/team-progress.ts +77 -0
- package/server-managed/team-reports.ts +369 -0
- package/server-managed/triage-response.ts +16 -0
- package/server-managed/type-only-proof.js +181 -0
- package/server-managed/type-only-worker.js +31 -0
- package/server-managed/type-only.ts +135 -0
- package/server-managed/uploads.ts +106 -0
- package/server-managed/upstream-cache.ts +275 -0
- package/server-managed/view-as.ts +58 -0
- package/server-managed/worker-turns.ts +76 -0
- package/server-managed/workspace-shares.ts +170 -0
- package/server.ts +70 -0
- package/strip-types-loader.js +13 -10
- package/server/index.ts +0 -480
- package/server/lifecycle.ts +0 -208
- /package/{LICENSE → LICENSE-MIT} +0 -0
- /package/{server → server-e2e}/auth.ts +0 -0
- /package/{server → server-e2e}/config.example.json +0 -0
- /package/{server → server-e2e}/objstore/blob-fs.ts +0 -0
- /package/{server → server-e2e}/objstore/fs.ts +0 -0
- /package/{server → server-e2e}/objstore/sign.ts +0 -0
- /package/{server → server-e2e}/peer.ts +0 -0
- /package/{server → server-e2e}/sse-session.ts +0 -0
- /package/{server → server-e2e}/util.ts +0 -0
- /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{a as e}from"./chunk-GO7FT4OD.js";import{b as t,c as n,d as r,e as i}from"./chunk-RAM3GDAD.js";import{c as a,d as o,e as s,f as c,h as l,k as u,l as d,m as f,o as p,q as m}from"./chunk-WBK5ZN4K.js";import"./chunk-N57OWFKY.js";import{a as h}from"./chunk-7YFJUT2P.js";import"./chunk-PXK7EU4V.js";import{m as g,q as _,s as v,w as y}from"./chunk-KP2XM324.js";import"./chunk-DUASGS2O.js";import{b}from"./chunk-IYPY47MC.js";import"./chunk-QRKFPLA4.js";import"./chunk-TUII34K2.js";import"./chunk-OOJM4CTU.js";function x(e){if(e instanceof Uint8Array)return{proven:!1,reason:`unsupported`,at:null};if(typeof e!=`string`)throw TypeError(`a text must be a string or its UTF-8 bytes, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a text must be a well-formed string`);return{proven:!1,reason:`unsupported`,at:null}}var S=e=>e.subarray(0,8e3).includes(0),C=(e,t)=>(e+Math.imul(t,97)>>>0)%107927,w=e=>Uint8Array.from({length:256},(t,n)=>Number(n===10||e.includes(String.fromCodePoint(n)))),T=w(``),E=w(`,;={}`);function D(e,t=T){let n=!S(e),r=new Map,i=(e,t)=>r.set(e,(r.get(e)??0)+t),a=0,o=0,s=0;for(let r=0;r<e.length;r++){let c=e[r];if(n&&c===13&&e[r+1]===10)continue;let l=a;a=(a<<7^o>>>25)+c>>>0,o=(o<<7^l>>>25)>>>0,!(++s<64&&t[c]===0)&&(i(C(a,o),s),s=0,a=0,o=0)}s>0&&i(C(a,o),s);let c=Uint32Array.from(r.keys()).sort();return{hashes:c,bytes:Float64Array.from(c,e=>r.get(e)),total:r.values().reduce((e,t)=>e+t,0)}}function ee(e,t){let n=0;for(let r=0,i=0;r<e.hashes.length&&i<t.hashes.length;)e.hashes[r]<t.hashes[i]?r++:e.hashes[r]>t.hashes[i]?i++:n+=Math.min(e.bytes[r++],t.bytes[i++]);return n}function te(e,t,n){let r=0,i=e.total,a=t.total;for(let o=0,s=0;o<e.hashes.length&&s<t.hashes.length;)if(e.hashes[o]<t.hashes[s]?i-=e.bytes[o++]:(e.hashes[o]>t.hashes[s]||(r+=Math.min(e.bytes[o],t.bytes[s]),i-=e.bytes[o++]),a-=t.bytes[s++]),(r+Math.min(i,a))*6e4<n)return 0;return r}function O(e,t,n,r,i=!1){if(e===null||t===null||t.length===0)return 0;let a=Math.abs(e.length-t.length),o=Math.max(e.length,t.length);if(o*(6e4-n)<a*6e4)return 0;let s=r(e),c=r(t),l=i?te(s,c,n*o):ee(s,c);return Math.trunc(l*6e4/o)}var k=/^[\w-]{6,}$/u,A=/[\dA-Z]/u,ne=/^(?:\.[\w-]+)+$/u,re=/^[\w-]{8,32}$/u;function j(e){let t=[];for(let n=e.length-1;n>0;n--){if(e[n]!==`-`&&e[n]!==`.`)continue;let r=e.indexOf(`.`,n+1),i=e.slice(r),a=e.slice(n+1,r);r!==-1&&re.test(a)&&ne.test(i)&&/[A-Za-z]/u.test(a)&&A.test(a)&&t.push([e.slice(0,n),a,i])}return t}var ie=e=>e.replaceAll(/\d/gu,`0`).replaceAll(/[a-z]/gu,`a`).replaceAll(/[A-Z]/gu,`A`);function ae(e,t){let n=j(t);for(let[t,r,i]of j(e)){let e=n.find(e=>e[2]===i);if(e&&e[1]!==r)return e[0]===t&&ie(e[1])!==ie(r)}return!1}function oe(e){let t=e.lastIndexOf(`/`),n=e.slice(t+1),r=n.lastIndexOf(`.`),i=r>0?n.slice(r):``;return{name:n,key:`${e.slice(0,t+1)}\0${i}\0${n.length}`}}function se(e,t){let n=e.length,r=0;for(;r<e.length&&e[r]===t[r];)r++;for(;n>r&&e[n-1]===t[n-1];)n--;for(;r>0&&!`-._`.includes(e[r-1]);)r--;for(;n<e.length&&e[n]!==`.`;)n++;let i=e.slice(r,n),a=t.slice(r,n);return r>0&&k.test(i)&&k.test(a)&&(A.test(i)||A.test(a))}function ce({sources:e,dests:t,pairs:n,used:r,record:i,punctuatedScoreOf:a},{remaining:o,open:s},c,l){let u=(e,t)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>[t,oe(e[t].path)])),d=u(t,s),f=u(e,o),p=Map.groupBy(f.keys(),e=>f.get(e).key),m=Map.groupBy(d.keys(),e=>d.get(e).key),h=[];for(let[e,t]of m){let n=p.get(e)??[];for(let e of t)for(let t of n)se(f.get(t).name,d.get(e).name)&&h.push({s:t,d:e})}let g=Map.groupBy(h,({d:e})=>e),_=Map.groupBy(h,({s:e})=>e),v=[];for(let{s:e,d:t}of h){let n=_.get(e).length===1&&g.get(t).length===1&&ae(f.get(e).name,d.get(t).name),r=a(e,t,n?0:c);(n||r>=c)&&v.push({s:e,d:t,score:r})}let y=[],b=new Set,x=new Set;for(let e of v.sort((e,t)=>t.score-e.score))n.has(e.d)||r.has(e.s)||(x.has(e.s)||b.has(e.d)||l(e)?(y.push(e),x.add(e.s),b.add(e.d)):i(e.d,e.s,e.score));return y}var le=/(?<![\p{L}\p{N}_$])(?:0[box][\d_a-f]+n?|\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d+)?n?)|(?<![\p{N}.])\.\d[\d_]*(?:e[+-]?\d+)?/giu;function ue(e){let t=e.toLowerCase(),n=/^0[box]|n$/u.test(t)?null:/^([^e]*)(?:e([+-]?)0*(\d+))?$/u.exec(t);if(!n)return t;let[,r=``,i=``,a=``]=n,o=(r.startsWith(`.`)?`0${r}`:r).replace(/(\.\d+?)0+$/u,`$1`).replace(/\.$/u,``),s=/^0+$/u.test(a);return a===``||s&&o.includes(`.`)?o:`${o}e${i===`-`&&!s?`-`:``}${a}`}var de=e=>e.replaceAll(le,ue).replaceAll(/,(?=(?:\s|\/\/[^\n\r\u2028\u2029]*(?![^\n\r\u2028\u2029])|\/\*(?:[^*]|\*(?!\/))*\*\/)*[\])}>])/gu,``).replaceAll(/(?<!\\)\\+(?=["'])/gu,e=>e.slice(e.length%2)).replaceAll(/[\s();]/gu,``).replaceAll(`'`,`"`);function fe(e,t){let n=e.length;if(n!==t.length)return!1;let r=0;if(n>=32&&(e.byteOffset&3)==(t.byteOffset&3)){for(let n=4-(e.byteOffset&3)&3;r<n;r++)if(e[r]!==t[r])return!1;let i=n-r>>>2,a=new Int32Array(e.buffer,e.byteOffset+r,i),o=new Int32Array(t.buffer,t.byteOffset+r,i);for(let e=0;e<i;e++)if(a[e]!==o[e])return!1;r+=i*4}for(;r<n;r++)if(e[r]!==t[r])return!1;return!0}var M=class extends Error{constructor(e,t,n){let r=n===void 0?``:` in the ${n} tree`;super(t===void 0?e:`${e}: ${JSON.stringify(t)}${r}`),this.name=`CompareError`,this.path=t,this.tree=n}},pe=new Set([`file`,`contiguous-file`]),me=new Set([`fifo`,`character-device`,`block-device`]),he=/(?:^|\/)\.{0,2}(?:\/|$)/u;function ge(e){if(!Number.isInteger(e)||e<0||e>4095)throw RangeError(`a mode must be an integer from 0 to 0o7777, not ${e}`)}function _e(e,t,n,r){if(typeof e!=`string`)throw TypeError(`an entry's name must be a string, not ${typeof e}`);if(e!==`.`||t!==`directory`){if(r?e===``:he.test(e))throw new M(r?`a name must not be empty`:"a name must be a relative path with no empty, `.` or `..` segment",e,n);if(!e.isWellFormed())throw new M(`a name must be well-formed Unicode`,e,n)}}function ve(e,t,n){if(typeof e!=`string`||e===``)throw new M(`a link must name its target`,t,n);if(!e.isWellFormed())throw new M(`a link target must be well-formed Unicode`,t,n);return e}function ye(e){if(e===void 0)return new Uint8Array;if(e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`a file's data must be a string or a Uint8Array, not ${typeof e}`);if(!e.isWellFormed())throw TypeError(`a file's text must be well-formed Unicode`);return e}var N=e=>typeof e==`string`?h(e):e;function be(e,t,n){if(typeof e!=`object`||!e)throw TypeError(`an entry must be an object, not ${e===null?`null`:typeof e}`);let{name:r,type:i=`file`,mode:a,linkname:o,data:s}=e;if(_e(r,i,t,n),a!==void 0&&ge(a),pe.has(i))return{path:r,type:`file`,mode:a??420,data:ye(s)};if(i===`symlink`||i===`hardlink`)return{path:r,type:i,target:ve(o,r,t)};if(i===`directory`)return{path:r,type:i};throw me.has(i)?new M(`a ${i} is neither a file nor a link`,r,t):TypeError(`${JSON.stringify(i)} is not an entry type`)}function P(e,t){return e.type===t.type?e.type===`symlink`?e.target===t.target:e.data===t.data?!0:typeof e.data==`string`&&typeof t.data==`string`?!1:fe(N(e.data),N(t.data)):!1}function xe(e,t,n){let r=new Set([e.path]),i=t.get(e.target);for(;i?.type===`hardlink`;){if(r.has(i.path))throw new M(`a hard link leads back to itself`,e.path,n);r.add(i.path),i=t.get(i.target)}if(i===void 0||i.type===`directory`)throw new M(`a hard link must name a file or a link in the tree`,e.path,n);return{...i,path:e.path}}function F(e,t,n){let r=new Map;for(let i of e){let e=be(i,t,n);if(e.type!==`directory`||e.path!==`.`){if(r.has(e.path))throw new M(`a name is given twice`,e.path,t);r.set(e.path,e)}}let i=new Map;for(let[e,a]of r){for(let i=n?-1:e.lastIndexOf(`/`);i>0;i=e.lastIndexOf(`/`,i-1)){let n=r.get(e.slice(0,i));if(n!==void 0&&n.type!==`directory`)throw new M(`a path lies under a ${n.type===`symlink`?`link`:`file`}`,e,t)}a.type===`hardlink`?i.set(e,xe(a,r,t)):a.type!==`directory`&&i.set(e,a)}return i}var Se=100,Ce=4,I=e=>e.slice(e.lastIndexOf(`/`)+1);function L(t,n){if(t.type===`symlink`)return`l${t.target}`;let r=n(t);return`f${r.length}:${e(r)}`}function we({sources:e,dests:t,sourceNames:n,destNames:r,used:i,record:a,bytes:o}){let s=Map.groupBy(e.keys(),t=>L(e[t],o));for(let c=0;c<t.length;c++){let l=-1,u=Se;for(let a of s.get(L(t[c],o))??[])if(!i.has(a)&&P(e[a],t[c])&&((l===-1||n[a]===r[c])&&(l=a),n[a]===r[c]||--u===0))break;l!==-1&&a(c,l,6e4)}}var Te=new Map([[`.ts`,`.js`],[`.mts`,`.mjs`],[`.cts`,`.cjs`],[`.tsx`,`.jsx`]]),R=new Map([...[`.js`,`.mjs`,`.cjs`,`.jsx`,`.ts`,`.mts`,`.cts`,`.tsx`].map(e=>[e,`script`]),...[`.css`,`.scss`,`.sass`,`.less`].map(e=>[e,`style`])]);function z(e){let t=e.split(`/`),n=t.pop(),r=n.lastIndexOf(`.`);return r>0?{dirs:t,stem:n.slice(0,r),extension:n.slice(r)}:{dirs:t,stem:n,extension:``}}function B(e){let{dirs:t,stem:n,extension:r}=z(e);return JSON.stringify([t.map(e=>e===`lib`||e===`src`?null:e),n,Te.get(r)??r])}function Ee(e){let{dirs:t,stem:n,extension:r}=z(e),i=[n,R.get(r)??r],a=t.lastIndexOf(`node_modules`),o=a===-1?0:a+(t[a+1]?.startsWith(`@`)?3:2),s=[JSON.stringify([...i,t])];for(let e=o;e<t.length;e++)s.push(JSON.stringify([...i,t.toSpliced(e,1,null)]));return s}var V=(e,t)=>Math.max(t,e+Math.trunc((6e4-e)/2));function H({pairs:e,used:t,scoreOf:n},{remaining:r,open:i},{s:a,d:o,score:s},c){let l=V(s,c);return i.some(t=>t!==o&&!e.has(t)&&n(a,t,l)>=l)||r.some(e=>e!==a&&!t.has(e)&&n(e,o,l)>=l)}function De(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=Map.groupBy(t.remaining.filter(e=>i[e].type===`file`),e=>B(i[e].path)),d=t.open.filter(e=>a[e].type===`file`).flatMap(e=>(u.get(B(a[e].path))??[]).map(t=>({s:t,d:e,score:l(t,e,0)})));for(let i of d.sort((e,t)=>t.score-e.score))o.has(i.d)||s.has(i.s)||n&&H(e,t,i,r)||c(i.d,i.s,i.score)}function Oe(e,t,n,r){let{sources:i,dests:a,pairs:o,used:s,record:c,scoreOf:l}=e,u=new Map,d=(e,t,n)=>new Map(t.filter(t=>e[t].type===`file`).map(t=>{let r=Ee(e[t].path);for(let e of r)(u.get(e)??u.set(e,{sources:[],dests:[]}).get(e))[n].push(t);return[t,r]})),f=d(a,t.open.filter(e=>!o.has(e)),`dests`),p=d(i,t.remaining.filter(e=>!s.has(e)),`sources`),m=(e,t)=>{let n=new Set(e.flatMap(e=>u.get(e)[t]));return n.size===1?[...n][0]:-1};for(let[i,a]of p){let o=m(a,`dests`);if(o===-1||m(f.get(o),`sources`)!==i)continue;let s={s:i,d:o,score:l(i,o,0)};n&&H(e,t,s,r)||c(o,i,s.score)}}function ke(e,t,n){let r=G(e),i=t<6e4&&r.remaining.length*r.open.length<=n*n;De(e,r,i,t),Oe(e,r,i,t)}function U(e,t){let n=new Map;for(let r of t)n.set(e[r],n.has(e[r])?-1:r);return n}function Ae({sourceNames:e,destNames:t,record:n,scoreOf:r},{remaining:i,open:a},o){let s=U(t,a),c=U(e,i);for(let t of i){let i=s.get(e[t]);if(i===void 0||i===-1||c.get(e[t])===-1)continue;let a=r(t,i,o);a>=o&&n(i,t,a)}}var W=(e,t)=>t.score-e.score||t.nameScore-e.nameScore;function je(e,t){if(e.length<Ce){e.push(t);return}let n=0;for(let t=1;t<e.length;t++)W(e[t],e[n])>0&&(n=t);W(e[n],t)>0&&(e[n]=t)}function Me({sourceNames:e,destNames:t,pairs:n,used:r,record:i,scoreOf:a},{remaining:o,open:s},c,l){let u=[];for(let n of s){let r=[];for(let i of o)je(r,{score:a(i,n,c),nameScore:+(e[i]===t[n]),dst:n,src:i});u.push(...r)}let d=0,f=e=>{for(;d<l.length&&V(l[d].score,c)>e;d++){let{s:e,d:t,score:a}=l[d];!n.has(t)&&!r.has(e)&&i(t,e,a)}};for(let{dst:e,src:t,score:a}of u.sort(W)){if(a<c)break;f(a),!n.has(e)&&!r.has(t)&&i(e,t,a)}f(-1/0)}function Ne(e){if(e.type!==`file`||!R.has(z(e.path).extension))return null;let t=typeof e.data==`string`?e.data:a(e);return t===void 0?null:N(de(t))}var Pe=2048,Fe=(e,t)=>t<Pe?K(e):e+Math.trunc((6e4-e)/10);function Ie(e,t){let n=new Map,r=new Map,i=e=>r.has(e)?r.get(e):r.set(e,Ne(e)).get(e),a=e=>n.get(e)??n.set(e,D(e,E)).get(e);Me({...e,scoreOf:(n,r)=>{let[o,s]=[i(e.sources[n]),i(e.dests[r])],c=Fe(t,Math.max(o?.length??0,s?.length??0)),l=O(o,s,c,a);return l>=c?l:0}},G(e),Fe(t,Pe),[])}var G=({sources:e,dests:t,pairs:n,used:r})=>({remaining:e.keys().filter(e=>!r.has(e)).toArray(),open:t.keys().filter(e=>!n.has(e)).toArray()}),K=e=>V(e,e);function Le(e,t,{minimum:n,limit:r,byPath:i,byForm:a=!1}){let o=new Map,s=new Set;if(e.length===0||t.length===0)return o;let c=new Map,l=new Map,u=new Map,d=e=>e.type===`file`?l.get(e)??l.set(e,N(e.data)).get(e):null,f=e=>c.get(e)??c.set(e,D(e)).get(e),p=e=>u.get(e)??u.set(e,D(e,E)).get(e),m={sources:e,dests:t,pairs:o,used:s,sourceNames:e.map(e=>I(e.path)),destNames:t.map(e=>I(e.path)),record(e,t,n){o.set(e,{source:t,score:n}),s.add(t)},bytes:d,scoreOf:(n,r,i)=>O(d(e[n]),d(t[r]),i,f),punctuatedScoreOf:(n,r,i)=>O(d(e[n]),d(t[r]),i,p,!0)};if(we(m),i&&ke(m,n,r),n>=6e4)return o;Ae(m,G(m),K(n));let h=G(m);if(h.remaining.length*h.open.length>r*r)return o;let g=i?ce(m,h,K(n),e=>H(m,h,e,n)):[];return Me(m,G(m),n,g),a&&Ie(m,n),o}var Re=50,ze=1e3;function q(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e.codePointAt(r)-t.codePointAt(r);return e.length-t.length}function Be(e){if(e===!1)return null;let t=e===!0?Re:e;if(typeof t!=`number`)throw TypeError(`renames must be a boolean or a percentage, not ${typeof e}`);if(!(t>0&&t<=100))throw RangeError(`renames must be a percentage above 0 and at most 100, not ${e}`);return Math.max(1,Math.trunc(6e4*t/100))}function Ve({renamesByPath:e,renamesByForm:t,renameLimit:n,renameGroup:r,paths:i,lines:a}){if(o(`renamesByPath`,e),o(`renamesByForm`,t),s(`renameLimit`,n),r!==null&&typeof r!=`function`)throw TypeError(`renameGroup must be a function, not ${typeof r}`);if(i!==`tree`&&i!==`keys`)throw RangeError(`paths must be 'tree' or 'keys', not ${i}`);o(`lines`,a)}var He=(e,t)=>P(e,t)&&(e.type!==`file`||e.mode===t.mode),J=(e,t,n,r=null)=>({status:e,old:t,new:n,similarity:r}),Ue=/\.d\.(?:[^./]+\.)?[cm]?ts$/u,We=e=>e.endsWith(`.mts`)?`module`:e.endsWith(`.cts`)?`commonjs`:null,Ge=/^export\s*\{\s*\}\s*;?$/u;function Ke(e){if(e===null)return{proven:!0,runtime:``,loads:!1};try{return a(e)===void 0?{proven:!1}:x(e.data)}catch{return{proven:!1}}}function qe(e){if(![e.old,e.new].filter(e=>e!==null).every(e=>e.type===`file`&&Ue.test(e.path))||e.old&&e.new&&e.old.mode!==e.new.mode)return e;let t=Ke(e.new),n=Ke(e.old);return!n.proven||!t.proven||n.runtime!==t.runtime&&!(e.old===null&&Ge.test(t.runtime))||n.loads&&e.old&&e.new&&e.old.path!==e.new.path&&We(e.old.path)!==We(e.new.path)?e:{...e,typeOnly:!0}}function Je(e,t){let n=[],r=[],i=[];for(let[n,a]of e){let e=t.get(n);e===void 0?i.push(a):e.type===a.type?He(a,e)||r.push(J(`modified`,a,e)):r.push(J(`type-changed`,a,e))}for(let[r,i]of t)e.has(r)||n.push(i);return i.sort((e,t)=>q(e.path,t.path)),n.sort((e,t)=>q(e.path,t.path)),{changes:r,deleted:i,added:n}}function Ye(e,t,{group:n,...r}){if(n===null)return Le(e,t,r);let i=new Map,a=e=>Map.groupBy(e.keys(),t=>n(e[t].path)),o=a(e);for(let[n,s]of a(t)){let a=o.get(n);if(a!==void 0)for(let[n,{source:o,score:c}]of Le(a.map(t=>e[t]),s.map(e=>t[e]),r))i.set(s[n],{source:a[o],score:c})}return i}function Xe(e,t,{renames:n=!0,renamesByPath:r=!0,renamesByForm:i=!1,renameLimit:a=ze,renameGroup:o=null,paths:s=`tree`,lines:u=!0,horizon:d,whitespace:f,ignoreCase:p,shortest:m}={}){let h=Be(n);Ve({renamesByPath:r,renamesByForm:i,renameLimit:a,renameGroup:o,paths:s,lines:u});let g=c({horizon:d,whitespace:f,ignoreCase:p,shortest:m}),_=s===`keys`,{changes:v,deleted:y,added:b}=Je(F(e,`old`,_),F(t,`new`,_)),x=h===null?new Map:Ye(y,b,{minimum:h,limit:a,byPath:r,byForm:i,group:o});for(let[e,t]of b.entries()){let n=x.get(e);v.push(n===void 0?J(`added`,null,t):J(`renamed`,y[n.source],t,Math.trunc(n.score*100/6e4)))}let S=new Set(x.values().map(({source:e})=>e));for(let[e,t]of y.entries())S.has(e)||v.push(J(`deleted`,t,null));return v.sort((e,t)=>q((e.new??e.old).path,(t.new??t.old).path)),(u?v.map(e=>({...e,...l(e.old,e.new,g)})):v).map(qe)}function Y(e,t,n){let r=new Map,i=new Set,a=0;for(let o of e){let e=u(n,o);e===null||!t.has(e)||(r.set(o,e),i.add(e),e!==o&&a++)}for(let n of e)r.has(n)||!t.has(n)||i.has(n)||(r.set(n,n),i.add(n));let o=r.size;for(let a of e){if(r.has(a))continue;let e=u(n,a)??d(n,a);for(;t.has(e)||i.has(e);)e=`../${e}`;r.set(a,e),i.add(e)}return{paths:r,paired:o,moved:a}}function Ze(e,t){let n=new Set(e),r=new Set(t),i=(e,t)=>{let n=new Map;for(let r of e)for(let e=r.indexOf(`/`);e!==-1;e=r.indexOf(`/`,e+1)){let i=r.slice(0,e+1);t.has(r.slice(e+1))&&n.set(i,(n.get(i)??0)+1)}let r=null,i=!1;for(let[e,t]of n)t>(n.get(r)??0)?[r,i]=[e,!1]:t===n.get(r)&&(i=!0);return i?null:r},a=Y(n,r,null).paired,o=[[{base:``,other:i(r,n)},n],[{base:i(n,r),other:``},r]].filter(([e])=>e.base!==null&&e.other!==null).map(([e,t])=>({root:e,side:t,...Y(n,r,e)})).filter(({side:e,paired:t,moved:n})=>t>a&&n*2>=e.size);return o.length===2&&o[0].paired===o[1].paired?null:o.toSorted((e,t)=>t.paired-e.paired)[0]?.root??null}function X(e,t){let n=[...e],r=new Set(t),i=Ze(n,r);return{root:i,paths:Y(n,r,i).paths}}function Qe(e,t,n){if(!e&&!t)return null;let r=[...e??[]],i=Map.groupBy(r,([,e])=>e),a=new Map(i.entries().map(([e,t])=>[e,f(n,e,t.map(([t])=>t.slice(e.length+1)))]));return new Map([...r.map(([e,t])=>[n.paths.get(e)??e,a.get(t)]),...t??[]])}function $e(e,t,n=new Map,i=new Map,a=null,o=()=>!1){let s=e=>{let t=n.get(e)??i.get(e);return t===void 0?[...new Set([e,ot(a,e)??e])]:[t]},c=[],l=[],u=[],d=new Set;for(let n of e.values()){let e=s(n.parent).map(e=>t.get(r(e,n.specifier,n.conditions,n.platform))).find(Boolean),a=i.get(n.target)??n.target;if(e){if(d.add(e.key),!s(n.target).includes(e.target)){let{target:t,...n}=e;c.push({...n,baseTarget:a,otherTarget:t})}continue}let u=s(n.parent).find(o);if(u===void 0)continue;let{specifier:f,conditions:p,platform:m}=n;l.push({key:r(u,f,p,m),parent:u,specifier:f,conditions:p,platform:m,baseTarget:a,otherTarget:null})}for(let e of t.values()){if(d.has(e.key)||!o(e.parent))continue;let{target:t,...n}=e;u.push({...n,baseTarget:null,otherTarget:t})}for(let e of[c,l,u])e.sort((e,t)=>e.key.localeCompare(t.key));return{changed:c,onlyBase:l,onlyOther:u,totalChanges:c.length+l.length+u.length}}function Z(e){return g(e)??0}function et(e,t){return e===t||e?.format===`base64`&&t?.format===`base64`&&e.data===t.data||e?.format===`digest`&&t?.format===`digest`&&e.digest===t.digest}function tt(e){if(e?.npmExecutable instanceof Set)return t=>({executable:e.npmExecutable.has(t)});if(e?.kind!==`stasis`||!e.bundle)return null;let{formats:t,executable:n,entries:r}=e.bundle;return e=>({format:t?.get(e),executable:n?.has(e)??!1,entry:r?.has(e)??!1})}function nt(e,t){return!e||!t?[]:[`format`,`executable`,`entry`].filter(n=>e[n]!==t[n]).map(n=>({field:n,from:e[n],to:t[n]}))}function Q(e){return(t,n)=>Math.abs(n.delta)-Math.abs(t.delta)||t[e].localeCompare(n[e])}function $(e){return(t,n)=>n.bytes-t.bytes||t[e].localeCompare(n[e])}function rt(e,t){return typeof e==`string`?`\0text\0${e.toWellFormed()}`:e?.format===`base64`?`\0base64\0${e.data}`:e?.format===`digest`?`\0digest\0${e.digest}`:`\0none\0${t}`}var it=250;function at(e,t,n,r,i){let a=(e,t,n)=>e.filter(({path:e})=>e!==``&&e.isWellFormed()).map(({path:e},r)=>({name:e,data:rt(t.get(e),`${n}${r}`)})),o={paths:`keys`,renameGroup:i,renameLimit:it,renamesByForm:!0,lines:!1},s=Xe(a(e,n,`a`),a(t,r,`b`),o);return new Map(s.filter(({status:e})=>e===`renamed`).map(e=>[e.old.path,e.new.path]))}function ot(e,t){return e?e.base===``?`${e.other}${t}`:t.startsWith(e.base)?t.slice(e.base.length):null:t}function st(){return{baseBytes:0,otherBytes:0,onlyBaseFiles:0,onlyOtherFiles:0,changedFiles:0}}function ct(e,t,n,r=X(e.keys(),t.keys()),i=[]){let{root:a,paths:o}=r,s=new Map([...o].map(([e,t])=>[t,e]));e=new Map([...e].map(([e,t])=>[o.get(e),t]));let c=e=>s.get(e)===e?{}:{basePath:s.get(e)},l=(e,t)=>{let n=nt(i[0]?.(e),i[1]?.(t));return n.length>0?{meta:n}:{}},u=[],d=[],f=[],p=0,m=0,h=0,g=0,_=0,v=0,y=new Map,b=e=>{let t=n(e),r=y.get(t);return r||(r=st(),y.set(t,r)),r},x=new Set([...e.keys(),...t.keys()]);for(let n of x){let r=e.has(n),i=t.has(n),a=b(n);if(r&&i){let r=e.get(n),i=t.get(n),o=et(r,i),u=l(s.get(n),n),d=Z(r),h=o?d:Z(i);if(p+=d,m+=h,a.baseBytes+=d,a.otherBytes+=h,o&&!u.meta)v++;else{let e=h-d;f.push({path:n,...c(n),baseBytes:d,otherBytes:h,delta:e,...u,...o?{modified:!1}:{}}),_+=e,a.changedFiles++}}else if(r){let t=Z(e.get(n));p+=t,h+=t,a.baseBytes+=t,a.onlyBaseFiles++,u.push({path:n,...c(n),bytes:t})}else{let e=Z(t.get(n));m+=e,g+=e,a.otherBytes+=e,a.onlyOtherFiles++,d.push({path:n,bytes:e})}}let S=at(u,d,e,t,n);if(S.size>0){let n=new Set(S.values());for(let[n,r]of S){let i=e.get(n),a=t.get(r),o=et(i,a),c=Z(i),u=o?c:Z(a);h-=c,g-=u,f.push({path:r,renamedFrom:n,basePath:s.get(n),baseBytes:c,otherBytes:u,delta:u-c,modified:!o,...l(s.get(n),r)}),_+=u-c;let d=b(n);d.onlyBaseFiles--,d.onlyOtherFiles--,d.changedFiles++}u.splice(0,u.length,...u.filter(e=>!S.has(e.path))),d.splice(0,d.length,...d.filter(e=>!n.has(e.path)))}let C=[],w=[],T=[],E=[];for(let[e,t]of y){let n=t.baseBytes>0||t.onlyBaseFiles>0||t.changedFiles>0,r=t.otherBytes>0||t.onlyOtherFiles>0||t.changedFiles>0,i=t.onlyBaseFiles+t.onlyOtherFiles+t.changedFiles;n&&!r?C.push({pkg:e,bytes:t.baseBytes}):r&&!n?w.push({pkg:e,bytes:t.otherBytes}):i>0||t.baseBytes!==t.otherBytes?T.push({pkg:e,baseBytes:t.baseBytes,otherBytes:t.otherBytes,delta:t.otherBytes-t.baseBytes}):E.push({pkg:e,bytes:t.baseBytes})}return u.sort($(`path`)),d.sort($(`path`)),f.sort(Q(`path`)),C.sort($(`pkg`)),w.sort($(`pkg`)),T.sort(Q(`pkg`)),{totals:{baseFiles:e.size,baseBytes:p,otherFiles:t.size,otherBytes:m,onlyBaseFiles:u.length,onlyBaseBytes:h,onlyOtherFiles:d.length,onlyOtherBytes:g,changedFiles:f.length,renamedFiles:S.size,changedDelta:_,unchangedFiles:v,fileDelta:t.size-e.size,byteDelta:m-p,identical:u.length===0&&d.length===0&&f.length===0},files:{onlyBase:u,onlyOther:d,changed:f,root:a,basePaths:o},packages:{onlyBase:C,onlyOther:w,changed:T,unchanged:E}}}function lt(e,r,a=null){let[o,s]=[e,r],[c,l]=t(o,s,a),u=n(o,c),d=n(s,l),f=X(u.keys(),d.keys()),h=Qe(_(o),_(s),f),g=ct(u,d,e=>b(e,{packageDir:h?.get(e)}),f,[tt(o),tt(s)]),x=y(o),S=y(s),C=(e,t)=>{let n=0;for(let r of t)n+=e.get(r)??0;return n};Object.assign(g.totals,{baseLines:C(x,u.keys()),otherLines:C(S,d.keys())});for(let e of g.files.onlyBase)e.lines=x.get(e.basePath??e.path)??0;for(let e of g.files.onlyOther)e.lines=S.get(e.path)??0;for(let e of g.files.changed)Object.assign(e,{baseLines:x.get(e.basePath??e.path)??0,otherLines:S.get(e.path)??0});let w=new Set([...g.files.onlyOther,...g.files.changed.filter(e=>e.modified!==!1)].map(e=>e.path));g.resolutions=$e(i(o,c),i(s,l),new Map(g.files.changed.filter(e=>e.renamedFrom!=null).map(e=>[e.basePath,e.path])),g.files.basePaths,g.files.root,e=>d.has(e)&&!w.has(e));let T=e=>b(``,{packageDir:e}),E=v(o,c?u.keys():null,T),D=v(s,l?d.keys():null,T);return g.versionUpdates=m(E,D),g.packageRows=p(g.packages,E,D),g.scope=a??``,g}export{lt as prepareComparison};
|
|
@@ -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
|
+
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};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{c as e}from"./chunk-WCDYSIKG.js";import{a as t}from"./chunk-QI66YA4F.js";import{H as n,I as r,J as i,K as a,M as o,Q as s,b as c,h as l,m as u,n as d,s as f,u as ee}from"./chunk-LVW7WWV4.js";import{a as p}from"./chunk-DEVAORP2.js";import"./chunk-ZQHLECTI.js";import{d as m,h,i as g,j as _,p as te,r as ne,s as re}from"./chunk-7HP2VYIC.js";import"./chunk-PXK7EU4V.js";import"./chunk-OOJM4CTU.js";var v=[`PODS`,`DEPENDENCIES`,`SPEC REPOS`,`EXTERNAL SOURCES`,`CHECKOUT OPTIONS`,`SPEC CHECKSUMS`,`PODFILE CHECKSUM`,`COCOAPODS`],ie=e=>({yesNo:e>=10,dates:e>=13}),ae=new Set([`null`,`Null`,`NULL`,`~`,``,`true`,`True`,`TRUE`,`false`,`False`,`FALSE`]),oe=new Set([`yes`,`Yes`,`YES`,`no`,`No`,`NO`,`on`,`On`,`ON`,`off`,`Off`,`OFF`]),se=[/^[-+]?\d+$/u,/^00[0-7]+$/u,/^0x[\dA-Fa-f]+$/u,/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/u,/^[-+]?\.(?:inf|Inf|INF)$/u,/^\.(?:nan|NaN|NAN)$/u],ce=/^(?:\d{4}-\d\d-\d\d|\d{4}-\d\d?-\d\d?(?:[Tt]|[ \t]+)\d\d?:\d\d:\d\d(?:.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d\d)?))?)$/u,y=/^\w[\w/ ()~<>=.:`,-]*$/u,le=/^:[a-z_][a-z0-9_]*$/u;function ue(e,t){return ae.has(e)||se.some(t=>t.test(e))?!0:t.yesNo&&oe.has(e)||t.dates&&ce.test(e)}var b=e=>JSON.stringify(e).replace(/#(?=[{$@])/gu,`\\#`);function de(e,t){return ue(e,t)?`'${e}'`:y.test(e)&&!e.endsWith(`:`)?e:b(e)}var fe=e=>e.replaceAll(`Σ`,`σ`).toLowerCase();function pe(e){if(e.kind===`seq`)return e.items.length===0?``:pe(e.items[0]);if(e.kind===`map`)return e.entries.map(({key:e})=>fe(String(e.value))).sort(t)[0]??``;if(e.type===`boolean`){if(e.value)throw _(`true, which YAMLHelper fails to sort`,e.line);return``}return fe(e.value)}function me(e,n=e=>e){return e.map(e=>[pe(n(e)),e]).sort((e,n)=>t(e[0],n[0])).map(([,e])=>e)}function x(e,t){return e.type===`symbol`?`:${e.value}`:e.type===`boolean`?String(e.value):de(e.value,t)}var S=e=>e.kind!==`scalar`,he=e=>e.kind===`seq`?e.items.length:e.entries.length,C=e=>e.replaceAll(`
|
|
2
|
+
`,`
|
|
3
|
+
`);function ge(e,t){return e.kind===`seq`?_e(e.items,t):e.kind===`map`?ve(e.entries,t):x(e,t)}function _e(e,t){return e.length===0?`[]`:`- ${me(e).map(e=>{let n=ge(e,t);return S(e)&&he(e)>1?C(n):n}).join(`
|
|
4
|
+
- `)}`}function ve(e,t,n,r=`
|
|
5
|
+
`){if(e.length===0)return`{}`;let i=me(e,e=>e.key);if(n!==void 0){let e=n.flatMap(e=>i.filter(({key:t})=>t.type===`string`&&t.value===e));i=[...e,...i.filter(t=>!e.includes(t))]}return i.map(({key:e,value:n})=>{let r=ge(n,t);return S(n)?`${x(e,t)}:
|
|
6
|
+
${C(r)}`:`${x(e,t)}: ${r}`}).join(r)}var ye=(e,t)=>`${ve(e.entries,t,v,`
|
|
7
|
+
|
|
8
|
+
`)}
|
|
9
|
+
`;function be(e,t,n,r,i){let a=ye(t,n),o=r?a.replaceAll(`
|
|
10
|
+
`,`\r
|
|
11
|
+
`):a;if(e===o)return;let s=r?`\r
|
|
12
|
+
`:`
|
|
13
|
+
`,[c,l]=[e.split(s),o.split(s)],u=l.findIndex((e,t)=>e!==c[t]),d=`as CocoaPods ${i} writes it`;throw u===c.length?new m(`line ${u}: expected a line end, ${d}`):u===-1||u===l.length-1?new m(`line ${u===-1?l.length:u+1}: expected the end of the file, ${d}`):new m(`line ${u+1}: expected ${h(l[u])}, ${d}, found ${h(c[u])}`)}function xe(e){return e===void 0?`nothing`:e.kind===`seq`?`a sequence`:e.kind===`map`?`a mapping`:e.type===`string`?`the string ${h(e.value)}`:`the ${e.type} ${String(e.value)}`}var{refuse:w}=c(xe);function T(e,t,n){if(e?.kind!==`scalar`||e.type!==t)throw w(`a ${t}`,e,n);return e.value}var E=(e,t)=>d(T(e,`string`,t),t),D=f(E);function O(e,t){if(e===void 0)return[];if(e.kind!==`seq`)throw w(`a sequence`,e,t);return e.items}function k(e,t){if(e===void 0)return[];if(e.kind!==`map`)throw w(`a mapping`,e,t);return e.entries.map(({key:e,value:n})=>[e,n,g(t,e.type===`symbol`?`:${e.value}`:String(e.value))])}var A=[`type`,`flatten`,`sha1`,`sha256`,`headers`],j={__proto__:null,git:[`commit`,`tag`,`branch`,`submodules`],hg:[`revision`,`tag`,`branch`],http:A,scp:A,svn:[`revision`,`tag`,`folder`,`externals`,`checkout`]},M=e=>e===`type`?`fileType`:e,Se=new Set([`submodules`,`flatten`,`externals`,`checkout`]),Ce=new Set([`zip`,`tgz`,`tar`,`tbz`,`txz`,`dmg`]),N=D(i,`a sha1 in lowercase hex`),we={__proto__:null,sha1:N,sha256:D(r,`a sha256 in lowercase hex`),type:D(e=>Ce.has(e),`a type of file CocoaPods extracts`)},P={__proto__:null,git:{option:`commit`,given:D(e=>/^[\da-f]{4,64}$/iu.test(e),`a commit's hash, and locks no commit`),kept:n,as:`the full commit hash CocoaPods keeps, as git rev-parse writes it`},hg:{option:`revision`,given:D(e=>/^[\da-f]{4,40}$/iu.test(e),`a changeset's hash, and locks no revision`),kept:i,as:`the full changeset hash CocoaPods keeps, as hg id writes it`},svn:{option:`revision`,given:D(e=>/^\d+$/u.test(e),`a revision's number, and locks no revision`),kept:e=>/^\d+$/u.test(e),as:`the revision number CocoaPods keeps, as svn export writes it`}},F={__proto__:null,http:D(s,`an http(s) URL`),scp:D(e=>e.startsWith(`scp://`)&&URL.canParse(e),`an scp:// URL`)};function Te(e,t){if(/^(?:\/|[A-Za-z]:)/u.test(e))throw new m(`${h(e)} is absolute, and only reads on the machine that wrote it`,t);if(e.startsWith(`~`))throw new m(`${h(e)} is from a home directory, and only reads on the machine that wrote it`,t);if(e.includes(`\\`)||e.includes(`//`))throw new m(`${h(e)} is not a path from the Podfile's directory`,t);return e}var Ee=new Set([`revision`,`tag`,`branch`,`folder`]);function De(e,t,n,r){if(Se.has(t))return T(n,`boolean`,r);if(t===`headers`)return O(n,r).map((e,t)=>E(e,`${r}[${t}]`));if(t in we)return we[t](n,r);let i=E(n,r);if(e===`git`&&(t===`branch`||t===`tag`)&&a(i,r),e!==`git`&&Ee.has(t)&&(i.startsWith(`-`)||i.includes(` --`)))throw new m(`${h(i)} starts with "-", or has " --" in it, which ${e} would read as an option`,r);return t===P[e]?.option?P[e].given(n,r):i}var Oe=(e,t,n)=>o((F[e]??E)(t,n),n);function ke(e,t){let n=[],r=Object.create(null);for(let[i,a,o]of k(e,t)){if(i.type!==`symbol`&&i.type!==`string`)throw new m(`the ${i.type} ${String(i.value)} as a key, where a symbol or a string names an option`,o);let e={name:i.value,string:i.type===`string`,node:a,where:o};n.push(e),e.string||(r[e.name]=e)}return{list:n,symbols:r}}function Ae({list:e,symbols:t},n){let r=Object.keys(t),i=r.filter(e=>e in j);if(i.length===0)throw new m(`names no source CocoaPods knows: :podspec, :path, or one of :git, :hg, :http, :scp and :svn`,n);if(i.length>1)throw new m(`both :${i[0]} and :${i[1]}, which CocoaPods reads as no source at all`,n);let a=e.find(e=>e.string);if(a!==void 0)throw new m(`a key that is not a symbol, which cocoapods-downloader reads as one and the rest of CocoaPods passes over`,a.where);let[o]=i,s=r.find(e=>e!==o&&!j[o].includes(e));if(s!==void 0)throw new m(`an option cocoapods-downloader does not take of :${o}`,t[s].where);let c={type:o,url:Oe(o,t[o].node,t[o].where)};for(let e of j[o]){let n=t[e];c[M(e)]=n===void 0?void 0:De(o,e,n.node,n.where)}return c}function je(e,t){if(e?.kind===`scalar`&&(e.type===`string`||e.type===`boolean`))return e.value;throw w(`a string or a boolean`,e,t)}function Me(e,t){let n=ke(e,t),{symbols:r}=n,i=[`podspec`,`path`].find(e=>e in r);if(i===void 0)return Ae(n,t);let a=Object.create(null);for(let{name:e,string:t,node:r,where:o}of n.list)if(t||e!==i){if(!t&&(e===`podspec`||e===`path`||e in j))throw new m(`beside :${i}, which CocoaPods reads alone`,o);if(e in a)throw new m(`both :${e} and ${h(e)}, where options has each name once`,o);a[e]=je(r,o)}let{node:o,where:s}=r[i],c=E(o,s);return i===`podspec`&&/^https?:/iu.test(c)?F.http(o,s):Te(c,s),{type:i,[i]:c,options:a}}var Ne=(e,t)=>Ae(ke(e,t),t);function Pe(e){if(e.type===`git`){let t=[`commit`,`branch`,`tag`].filter(t=>e[t]!==void 0).map(t=>`, ${t} \`${e[t]}\``);return`from \`${e.url}\`${t.join(``)}`}if(e.type===`hg`||e.type===`svn`)return`from \`${e.url}\``;if(e.type===`podspec`||e.type===`path`)return`from \`${e[e.type]}\``}var Fe=e=>[[e.type,e.url],...j[e.type].map(t=>[t,e[M(t)]])].filter(([,e])=>e!==void 0),Ie=e=>typeof e==`boolean`?String(e):b(e),I=String.raw`"(?:[^"\\]|\\.)*"`,L=new RegExp(String.raw`(?::(\w+)=>|(\w+): )(${I}|true|false|\[(?:${I}(?:, ${I})*)?\])(?:, |$)`,`uy`),Le=new RegExp(I,`gu`);function Re(e){if(e.endsWith(`, `))return;let t=new Map,n=new Set;for(L.lastIndex=0;L.lastIndex<e.length;){let r=L.exec(e);if(r===null||t.has(r[1]??r[2]))return;n.add(r[1]===void 0),t.set(r[1]??r[2],r[3])}return n.size===1?t:void 0}var ze=(e,t)=>JSON.stringify((e.match(Le)??[]).sort())===JSON.stringify(t.map(b).sort());function Be(e,t){let n=/^from `\{(.+)\}`$/u.exec(e),r=n===null?void 0:Re(n[1]),i=Fe(t);return r===void 0||r.size!==i.length?!1:i.every(([e,t])=>{let n=r.get(e);return n===void 0?!1:Array.isArray(t)?n.startsWith(`[`)&&ze(n,t):n===Ie(t)})}function Ve(e,t,n){let r=Pe(t);if(r===void 0?Be(e,t):e===r)return;let i=r===void 0?`the options of EXTERNAL SOURCES, as Ruby's Hash#inspect writes them`:h(r);throw new m(`${h(e)} is not ${i}, as CocoaPods describes the external source`,n)}var R=Symbol(`any`);function He(e){let{type:t,url:n,tag:r,submodules:i}=e,a=P[t].option,o=e[a]!==void 0||r!==void 0?e:{type:t,url:n,[a]:R,submodules:i||void 0};return t===`git`&&e.branch!==void 0?[{...e,branch:void 0,commit:R},o]:[o]}function Ue(e,t){let n=P[e.type];for(let r of j[e.type]){let[i,a]=[e[M(r)],t[M(r)]];if(!(a===R?i!==void 0&&n.kept(i):i===a))return i===void 0?`no :${r}, which CocoaPods keeps of this download`:a===void 0?`a :${r}, which CocoaPods does not keep of this download`:a===R?`${h(i)} is not ${n.as}`:`another :${r} than EXTERNAL SOURCES has`}}function We(e,t,n,r){if(e.type===`path`){if(t!==void 0)throw new m(`checkout options of a pod by :path, which CocoaPods keeps none of`,n);return}if(e.type===`podspec`)return;if(t===void 0)throw new m(`no checkout options, which CocoaPods keeps of a pod by :${e.type}`,r);if(t.type!==e.type||t.url!==e.url)throw new m(`not by the :${e.type} and URL EXTERNAL SOURCES has`,n);if(P[e.type]===void 0){if(j[e.type].map(M).some(n=>JSON.stringify(t[n])!==JSON.stringify(e[n])))throw new m(`other than the options EXTERNAL SOURCES has, which CocoaPods keeps as they are of a file`,n);return}let i=He(e).map(e=>Ue(t,e));if(!i.includes(void 0))throw new m(i[0],n)}var z=f(l),B=String.raw`(?!\.)[!-'*-.0-[\]-~]+`,Ge=RegExp(`^${B}(?:/${B})*$`,`u`),V=z(e=>e.length<=1024&&Ge.test(e),`a pod's name`),Ke=e=>e.split(`/`,1)[0];function H(e,t){if(V(e,t).includes(`/`))throw new m(`${h(e)} is a subspec's name, where a root's is`,t);return e}var qe=/^\d+(?:\.[\dA-Za-z-]+)*(?:\+[\dA-Za-z.-]+)?$/u,U=e=>qe.test(e),Je=z(U,`a version`);function Ye(e,t){let n=/^(\S+) \((.+)\)$/u.exec(e);if(n===null)throw new m(`${h(e)} is not a pod and its version, as CocoaPods writes them`,t);let r=Je(n[2],t);return{name:V(n[1],t),version:r}}function Xe(t,n){let r=t.split(`, `);for(let[t,i]of r.entries()){if(e(i,U)===void 0)throw new m(`${h(i)} is not a requirement, as CocoaPods writes one`,n);if(t>0&&r[t-1]>i)throw new m(`${h(i)} after ${h(r[t-1])}, where CocoaPods sorts requirements`,n)}if(t===`>= 0`)throw new m(`">= 0", which CocoaPods writes as no requirement at all`,n);return r}function W(e,t){let n=/^(\S+)(?: \((.+)\))?$/u.exec(e);if(n===null)throw new m(`${h(e)} is not a dependency, as CocoaPods writes one`,t);let r=V(n[1],t);return n[2]?.startsWith("from `")?{name:r,requirements:[],description:n[2]}:{name:r,requirements:n[2]===void 0?[]:Xe(n[2],t),description:void 0}}function Ze(e,t){let{name:n,requirements:r,description:i}=W(e,t);if(i!==void 0)throw new m(`${h(e)} names an external source, which only the Podfile's dependencies do`,t);return{name:n,requirements:r}}var Qe=/^[^\d.:-]?[\p{Alpha}_ \t\n\v\f\r!@#$%^&*(){}<>|/\\~;=]/u,$e=/^-?\d{4}-\d{1,2}-\d{1,2}(?:[Tt]|[ \t\n\v\f\r]+)\d{1,2}:\d\d:\d\d(?:\.\d*)?(?:[ \t\n\v\f\r]*(?:Z|[-+]\d{1,2}:?(?:\d\d)?))?$/u,et=/^\d{4}-(?:1[012]|0\d|\d)-(?:[12]\d|3[01]|0\d|\d)$/u,tt=/^[-+]?\d[\d_]*(?::[0-5]?\d){1,2}(?:\.[\d_]*)?$/u,nt=/^[-+]?(?:\d[\d_,]*)?\.\d*(?:[eE][-+]\d+)?$/u,rt=[/^[-+]?0b[01_,]+$/u,/^[-+]?0[0-7_,]+$/u,/^[-+]?(?:0|[1-9][\d_,]*)$/u,/^[-+]?0x[\dA-Fa-f_,]+$/u];function it(e){return e===``?`null`:Qe.test(e)||e.includes(`
|
|
14
|
+
`)?e.length>5||/^[^ytonf~]/iu.test(e)?`string`:e===`~`||/^null$/iu.test(e)?`null`:/^(?:yes|true|on|no|false|off)$/iu.test(e)?`boolean`:`string`:$e.test(e)?`a time`:et.test(e)?`a date`:/^[-+]?\.inf$/iu.test(e)||/^\.nan$/iu.test(e)?`a float`:/^:./u.test(e)?`a symbol`:tt.test(e)?`a number`:nt.test(e)&&!/^[-+]?\.$/u.test(e)?`a float`:rt.some(t=>t.test(e))?`an integer`:`string`}function at(e){let t=it(e);return{type:t,value:t===`boolean`?/^(?:yes|true|on)$/iu.test(e):e}}var ot=/[^\p{L}\p{M}\p{N}\p{P}\p{S}\p{Zs}]/u,st=/^"(?:[^"\\]|\\["\\])*"/u,ct=/^"(?:[^"\\]|\\["\\])*(\\[^"\\])/u,lt=/^'((?:[^']|'')*)'/u,ut=8,G=1024,K=e=>e===`-`||e.startsWith(`- `);function q(e){for(re(e);e.line!==void 0;re(e)){let t=te(e.line),n=e.line.slice(t);if(n!==``){if(n.startsWith(`#`))throw _(`a comment, which CocoaPods does not write`,e.number);e.current={indent:t,text:n,number:e.number};return}}e.current=void 0}var J=(e,t,n)=>({kind:`scalar`,type:e,value:t,line:n});function dt(e,t){let n=st.exec(e);if(n!==null)return[J(`string`,JSON.parse(n[0]),t),e.slice(n[0].length)];let r=lt.exec(e);if(r!==null)return[J(`string`,r[1].replaceAll(`''`,`'`),t),e.slice(r[0].length)];let i=ct.exec(e)?.[1];throw _(i===void 0?`a quoted scalar with no closing quote in ${h(e)}`:`${h(i)}, an escape this reader does not take: CocoaPods writes \\# before {, $ and @, which Psych does not read back`,t)}function ft(e,t){if(le.test(e))return J(`symbol`,e.slice(1),t);if(!y.test(e)||e.endsWith(` `)||e.endsWith(`:`)||e.includes(`: `))throw _(`${h(e)} is not a scalar as CocoaPods writes one`,t);let{type:n,value:r}=at(e);if(n!==`string`&&n!==`boolean`)throw _(`${h(e)}, which Psych reads as ${n}, where a Podfile.lock holds a string, a symbol, true or false`,t);return J(n,r,t)}function Y(e,t){if(e===`[]`)return{kind:`seq`,items:[]};if(e===`{}`)return{kind:`map`,entries:[]};if(e.startsWith(`"`)||e.startsWith(`'`)){let[n,r]=dt(e,t);if(r!==``)throw _(`${h(r)} after a quoted scalar`,t);return n}return ft(e,t)}function pt(e,t){let n,r;if(e.startsWith(`"`)||e.startsWith(`'`)){if([n,r]=dt(e,t),r!==`:`&&!r.startsWith(`: `))return null}else{let i=/:(?: |$)/u.exec(e);if(i===null)return null;n=ft(e.slice(0,i.index),t),r=e.slice(i.index)}let i=e.length-r.length;if(i>G&&[...e.slice(0,i)].length>G)throw _(`a key longer than ${G} characters, which Psych does not read`,t);let a=r.slice(2);if(a.startsWith(` `))throw _(`more than one space after ":"`,t);return{key:n,value:a}}function mt(e,t){if(t>ut)throw _(`nested deeper than a Podfile.lock is`,e.current.number)}function ht(e,t,n){let{number:r,text:i}=e.current;return i!==`[]`&&i!==`{}`?(K(i)?gt:X)(e,t,n):(q(e),Y(i,r))}function X(e,t,n,r){mt(e,n);let i={kind:`map`,entries:[]},a=new Set;do{let{number:o,text:s}=e.current;if(r??=pt(s,o),r===null)throw _(`expected a mapping key, found ${h(s)}`,o);let{key:c}=r,l=`${c.type}:${c.value}`;if(a.has(l))throw _(`a second ${h(String(c.value))}`,o);a.add(l),q(e);let u;if(r.value!==``)u=Y(r.value,o);else if(e.current?.indent>t)u=ht(e,e.current.indent,n+1);else if(e.current?.indent===t&&K(e.current.text))u=gt(e,t,n+1);else throw _(`nothing under ${h(String(c.value))}`,o);i.entries.push({key:c,value:u}),r=void 0}while(e.current?.indent===t);return i}function gt(e,t,n){mt(e,n);let r={kind:`seq`,items:[]};for(;e.current?.indent===t&&K(e.current.text);){let{number:i,text:a}=e.current,o=a.slice(2);if(o===``||o.startsWith(` `))throw _(`expected one space and a value after "-"`,i);let s=pt(o,i);s===null?(r.items.push(Y(o,i)),q(e)):r.items.push(X(e,t+2,n+1,s))}return r}function _t(e){let t=ne(e,ot);if(q(t),t.current===void 0)throw _(`an empty file, where CocoaPods writes its version at least`,0);if(t.current.indent!==0||K(t.current.text))throw _(`expected a mapping at column 0`,t.current.number);let n=X(t,0,0);if(t.current!==void 0)throw _(`bad indentation`,t.current.number);return{root:n,crlf:t.crlf===!0}}var Z=e=>g(``,e),Q=e=>(e?.items??e?.entries)?.length===0;function vt(e){let t=Object.create(null);for(let{key:n,value:r}of e.entries){if(n.type!==`string`||!v.includes(n.value))throw _(`unsupported section ${h(String(n.value))}`,n.line);if(Q(r))throw _(`an empty ${n.value}, which CocoaPods leaves out`,n.line);t[n.value]=r}return t}function yt(e){if(e===void 0)throw new m(`expected COCOAPODS, the version of CocoaPods that wrote the file, which it always writes`);let t=E(e,`COCOAPODS`),n=/^(\d+)\.(\d+)\.\d+(?:\.(?:beta|rc)\.\d+)?$/u.exec(t);if(n===null||Number(n[1])!==1||Number(n[2])<5||Number(n[2])>17)throw new m(`${h(t)} is not a version of CocoaPods from 1.5 to 1.17, which this reader reads`,`COCOAPODS`);return{version:t,rules:ie(Number(n[2]))}}function bt(e,t){let n=new Set;return O(e,t).map((e,r)=>{let i=`${t}[${r}]`,a=E(e,i),o=Ze(a,i);if(n.has(a))throw new m(`a second ${h(a)}, where CocoaPods lists each dependency of a pod once`,i);return n.add(a),o})}function xt(e){let t=Object.create(null),n=new Map;for(let[r,i]of O(e,`PODS`).entries()){let e=`PODS[${r}]`;if(i.kind===`seq`||i.kind===`map`&&i.entries.length!==1)throw new m(`expected a pod, or one pod and what it depends on`,e);let{key:a,value:o}=i.kind===`map`?i.entries[0]:{key:i},s=g(e,String(a.value));if(Q(o))throw new m(`none it depends on, where CocoaPods writes the pod alone`,s);let c=bt(o,s),{name:l,version:u}=Ye(E(a,e),e);if(l in t)throw new m(`a second ${h(l)}`,e);t[l]={name:l,root:Ke(l),version:u,dependencies:c},n.set(l,e)}return{pods:t,placeOf:n}}function St(e,t){let n=Object.create(null);for(let r of Object.values(e)){let e=n[r.root]??={name:r.root,version:r.version,pods:[],checksum:void 0,repo:void 0,external:void 0,checkout:void 0};if(e.version!==r.version)throw new m(`at ${h(r.version)}, where its root's other pods are at ${h(e.version)}`,t.get(r.name));e.pods.push(r.name)}return n}function $(e,t,n){let r=new Map;for(let[i,a,o]of k(e,Z(t)))r.set(H(T(i,`string`,o),o),{value:n(a,o),where:o});return r}var Ct=D(e=>!/\s/u.test(e),`a spec repo's URL or name`);function wt(e){let t=new Map;for(let[n,r,i]of k(e,Z(`SPEC REPOS`))){let e=o(Ct(n,i),i);if(Q(r))throw new m(`no pod of the spec repo, where CocoaPods leaves it out`,i);for(let[n,a]of O(r,i).entries()){let r=`${i}[${n}]`,o=H(E(a,r),r);if(t.has(o))throw new m(`${h(o)} is in ${h(t.get(o).value)} too`,r);t.set(o,{value:e,where:r})}}return t}function Tt(e,t,{checksums:n,repos:r,externals:i,checkouts:a}){for(let[t,o]of[[n,`checksum`],[r,`repo`],[i,`external`],[a,`checkout`]])for(let[n,{value:r,where:i}]of t){if(!(n in e))throw new m(`${h(n)} is the root of no pod in PODS`,i);e[n][o]=r}for(let[e,{where:t}]of a)if(!i.has(e))throw new m(`${h(e)} has no external source, and CocoaPods keeps checkout options of none other`,t);for(let[t,{value:n,where:o}]of i){if(r.has(t))throw new m(`${h(t)} is from an external source and a spec repo both`,o);We(n,e[t].checkout,a.get(t)?.where,o)}for(let n of Object.values(e)){let e=t.get(n.pods[0]);if(n.checksum===void 0)throw new m(`no checksum of ${h(n.name)} in SPEC CHECKSUMS, which CocoaPods writes of every podspec`,e);if(n.repo===void 0&&n.external===void 0)throw new m(`${h(n.name)} is from no spec repo and no external source`,e)}}function Et(e,t,n,r){let i=new Set;for(let{name:r,description:a,where:o}of e){if(!(r in t))throw new m(`${h(r)} is no pod in PODS`,o);if(a===void 0)continue;let{root:e}=t[r];if(n[e].external===void 0)throw new m(`${h(e)} has no external source in EXTERNAL SOURCES`,o);Ve(a,n[e].external,o),i.add(e)}for(let[e,{where:t}]of r)if(!i.has(e))throw new m(`${h(e)} is from an external source no dependency of the Podfile names`,t)}function Dt(e,t,n){let r=new Set(e.map(e=>e.name));for(let e of r)for(let n of t[e]?.dependencies??[])r.add(n.name);let i=Object.values(t).find(e=>!r.has(e.name));if(i!==void 0)throw new m(`${h(i.name)} is not one the Podfile's dependencies lead to, which CocoaPods would not install`,n.get(i.name))}function Ot(e){if(e===void 0||e instanceof Uint8Array)return e;if(typeof e!=`string`)throw TypeError(`expected the Podfile as a string or a Uint8Array`);if(!e.isWellFormed())throw TypeError(`expected the Podfile as well-formed text, or its bytes`);return new TextEncoder().encode(e)}async function kt(e,t){if(t===void 0)throw new m(`no PODFILE CHECKSUM to hold the Podfile to, which CocoaPods writes of a Podfile it reads from a file`);let n=p(new Uint8Array(await crypto.subtle.digest(`SHA-1`,e)));if(n!==t)throw new m(`not the sha1 of the Podfile given, ${n}: the lockfile was written for another Podfile`,Z(`PODFILE CHECKSUM`))}async function At(e,t={}){if(typeof e!=`string`)throw TypeError(`expected a string`);let n=Ot(ee(t,[`podfile`]).podfile),{root:r,crlf:i}=_t(e),a=vt(r),{version:o,rules:s}=yt(a.COCOAPODS),c=u(a,`PODFILE CHECKSUM`,``,N),{pods:l,placeOf:d}=xt(a.PODS),f=St(l,d),p={checksums:$(a[`SPEC CHECKSUMS`],`SPEC CHECKSUMS`,N),repos:wt(a[`SPEC REPOS`]),externals:$(a[`EXTERNAL SOURCES`],`EXTERNAL SOURCES`,Me),checkouts:$(a[`CHECKOUT OPTIONS`],`CHECKOUT OPTIONS`,Ne)},m=O(a.DEPENDENCIES,`DEPENDENCIES`).map((e,t)=>{let n=`DEPENDENCIES[${t}]`;return{...W(E(e,n),n),where:n}});be(e,r,s,i,o),Tt(f,d,p),Et(m,l,f,p.externals);let h=m.map(({name:e,requirements:t,description:n})=>({name:e,requirements:t,external:n!==void 0}));return Dt(h,l,d),n!==void 0&&await kt(n,c),{cocoapods:o,podfileChecksum:c,pods:l,roots:f,dependencies:h}}export{m as LockfileError,At as parsePodfileLock};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./chunk-QRKFPLA4.js";var t=new Set([`overview`,`graph`,`treemap`,`compare`,`advisories`,`issues`,`code`,`search`,`terminal`]),n=/^\d+$/u;function r(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(n<32||n===127)return!0}return!1}var i=512;function a(e){return typeof e==`string`&&e.length>0&&e.length<=i&&!r(e)}function o(e){return a(e)&&!n.test(e)}function s(e){return e===`completed`||e===`not_planned`||e===`duplicate`?e:`unknown`}function c(e){let[t,n,r]=e.split(`/`);return r===void 0&&t!==void 0&&n!==void 0&&t.length<=39&&/^[a-zA-Z\d](?:-?[a-zA-Z\d])*$/u.test(t)&&n.length<=100&&n!==`.`&&n!==`..`&&/^[a-zA-Z\d._-]+$/u.test(n)}function l(e,t){if(typeof e!=`string`||e.length>2048)return null;let n;try{n=new URL(e)}catch{return null}if(n.href!==e||n.origin!==`https://github.com`||n.username||n.password)return null;let r=t.exec(n.pathname);if(!r)return null;let i=`${r[1]}/${r[2]}`,a=Number(r[3]);return!c(i)||!Number.isSafeInteger(a)||a<=0?null:{repo:i,number:a}}function u(e){return l(e,/^\/([^/]+)\/([^/]+)\/pull\/(\d+)(?:\/(?:files|commits|checks))?\/?$/u)}function d(e){return l(e,/^\/([^/]+)\/([^/]+)\/issues\/(\d+)\/?$/u)}function f(e){let t=u(e);if(t)return{...t,kind:`pull`};let n=d(e);return n?{...n,kind:`issue`}:null}function p(e){return`${e.repo.toLowerCase()}#${e.kind}:${e.number}`}var m=/^(?=.{1,214}$)(?:@[\w.-]+\/[\w-]|[\dA-Za-z])[\w.-]*$/u,h=/^(?=.{1,256}$)[\dA-Za-z][\w.+-]*$/u,ee=/^@[\da-z~-][\w.~-]*$/u,te=/^[\da-f]{64}$/u;function g(e){return typeof e==`string`&&m.test(e)}function _(e){return typeof e==`string`&&h.test(e)}function v(e){return typeof e==`string`&&te.test(e)}function y(e){return typeof e==`string`&&e.length>0&&e.length<=1024&&!/[\p{Cc}\\]/u.test(e)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}function ne(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase(),n=t.startsWith(`@`)?t:`@${t}`;return n.length<=214&&ee.test(n)?n:null}function re(e,t){if(t?.reviewedBases)return e.base??null;let n=e.patch&&e.was?.includes(e.version)?e.version:e.was?.find(t=>t!==e.version);return n?{name:e.name,version:n}:null}var b=new Set([`pulls`,`versions`,`branch`,`reviews`]),x=e=>[e?.repoId,e?.number].every(e=>Number.isSafeInteger(e)&&e>0);function S(e){return e.view===`workspace-dependencies`?x(e.pullReview)?{pullReview:{repoId:e.pullReview.repoId,number:e.pullReview.number}}:e.dependencyTab==null?{}:{dependencyTab:e.dependencyTab}:{}}function C(e,t){let{dependencyTab:n=`pulls`,pullReview:r}=S(t);return b.has(n)?r?`/team/${e}/dependencies/review/${r.repoId}/${r.number}`:`/team/${e}/dependencies${n===`pulls`?``:`/${n}`}`:null}function w(e){let t=/^\/team\/([A-Za-z0-9_-]+)\/dependencies\/(?:([a-z]+)|review\/([1-9]\d{0,14})\/([1-9]\d{0,14}))$/u.exec(e);if(t)return t[3]?{view:`workspace-dependencies`,teamSlug:t[1],pullReview:{repoId:Number(t[3]),number:Number(t[4])}}:b.has(t[2])?{view:`workspace-dependencies`,teamSlug:t[1],dependencyTab:t[2]}:null}var T=Object.freeze({all:`all`,team:`team`,repo:`repository`}),E=(e,t)=>e===`team`?typeof t==`string`&&/^[A-Za-z0-9_-]+$/u.test(t):e===`repo`&&Number.isSafeInteger(t)&&t>0;function ie(e){let t=e.riskScope??`team`,n=e.riskTarget??null;return!Object.hasOwn(T,t)||n!=null&&!E(t,n)?null:`/manage/risk/${T[t]}${n==null?``:`/${n}`}`}function ae(e){if(e===`/manage/risk/team`||e===`/manage/repositories/risk`)return{view:`manage-repo-risk`};if(!e.startsWith(`/manage/risk/`))return;let t=/^\/manage\/risk\/(?:(all)|(team)\/([A-Za-z0-9_-]+)|repository(?:\/([1-9]\d*))?)$/u.exec(e);if(!t)return null;if(t[1])return{view:`manage-repo-risk`,riskScope:`all`};let[n,r]=t[2]?[`team`,t[3]]:[`repo`,t[4]==null?null:Number(t[4])];return r!=null&&!E(n,r)?null:{view:`manage-repo-risk`,riskScope:n,...r==null?{}:{riskTarget:r}}}var D=[[`whitespace`,`hideWhitespace`],[`type-only`,`hideTypes`]],O=[[`on`,`indented`],[`folded`,`folded`]];function k(e){let t=D.filter(([,t])=>e[t]===!0).map(([e])=>e),n=O.find(([,t])=>t===e.pretty)?.[0];return[...t.length>0?[`hide=${t.join(`,`)}`]:[],...n?[`pretty=${n}`]:[]]}function A(e){let t=new Set(e.getAll(`hide`).flatMap(e=>e.split(`,`))),n=O.find(([t])=>t===e.get(`pretty`))?.[1];return{...Object.fromEntries(D.filter(([e])=>t.has(e)).map(([,e])=>[e,!0])),...n?{pretty:n}:{}}}var j=e=>typeof e==`string`&&e.length>0&&e.length<=256&&!/[\p{Cc}]/u.test(e);function M(t){let n=t.get(`repo`),r=new Set((t.get(`severity`)??``).split(`,`)),i=e.filter(e=>r.has(e)),a={...j(n)?{repo:n}:{},...i.length>0?{severities:i}:{}};return Object.keys(a).length>0?{filters:a}:{}}function oe(t){let n=e.filter(e=>t?.severities?.includes(e)),r=[...j(t?.repo)?[`repo=${encodeURIComponent(t.repo).replaceAll(`%2F`,`/`)}`]:[],...n.length>0?[`severity=${n.join(`,`)}`]:[]];return r.length>0?`?${r.join(`&`)}`:``}var N=new Set([`code`,`diff`]),se=e=>N.has(e)?`code`:`overview`,P=e=>N.has(e)?{compareMode:`code`}:{},F=e=>N.has(e)?`/code`:``,I=Object.freeze({manage:`/manage`,"manage-bundles":`/manage/bundle`,"manage-scans":`/manage/scans`,"manage-reports":`/manage/report`,"manage-repos":`/manage/repositories`,"manage-repo-risk":`/manage/risk`,"admin-users":`/manage/users`,"manage-teams":`/manage/team`,"manage-import":`/manage/import`,"manage-links":`/manage/links`,"manage-deduplication":`/manage/deduplication`,"manage-history":`/manage/history`}),L=new Set([`workspace-reports`,`workspace-bundles`,`workspace-repositories`,`workspace-dependencies`,`workspace-risk`]);function R(e){if(!o(e)||e===`.`||e===`..`)return null;try{return`/finding/${encodeURIComponent(e)}`}catch{return null}}function z(e){if(!e)return null;if(e.view===`home`)return`/`;if(e.view===`reviews`)return`/my/reviews`;if(e.view===`profile`)return`/my/profile`;if(e.view===`npm`)return H(e);if(e.view===`repository-code`)return ue(e);if(L.has(e.view))return/^[A-Za-z0-9_-]+$/u.test(e.teamSlug??``)?e.view===`workspace-dependencies`?C(e.teamSlug,e):`/team/${e.teamSlug}/${e.view.slice(10)}`:null;if(e.view===`bundles`){if(!/^[A-Za-z0-9_-]+$/u.test(e.bundleSlug??``)||[e.teamSlug,e.compareSlug].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e)))return null;let n=e.bundleTab??`overview`;if(!t.has(n))return null;let r=e.teamSlug?`/team/${e.teamSlug}`:`/manage`,i=n===`code`&&Z(e.file)?`/${e.file}`:``,a=i&&Z(e.line)?`#L${e.line}${Z(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``,o=n===`compare`&&e.compareSlug!=null?`/${e.compareSlug}${F(e.compareMode)}`:``;return`${r}/bundle/${e.bundleSlug}${n===`overview`?``:`/${n}`}${i}${o}${a}`}if(e.view===`manage-repo-risk`)return ie(e);if(Object.hasOwn(I,e.view)){let t=I[e.view];return e.view===`manage-deduplication`&&e.linkId?`${t}?report=${encodeURIComponent(e.linkId)}`:e.view===`manage-bundles`&&Number.isSafeInteger(e.createRepoId)&&e.createRepoId>0?`${t}?createRepo=${e.createRepoId}`:e.view===`manage-scans`&&e.scanMode===`link`?`${t}?mode=link`:e.view===`manage-scans`&&e.bundleId?`${t}?bundle=${encodeURIComponent(e.bundleId)}${e.scanMode===`dependencies`?`&mode=dependencies`:``}`:e.view===`manage-history`&&e.actor?`${t}?actor=${encodeURIComponent(e.actor)}`:t}if(![`findings`,`files`].includes(e.view)||!e.teamSlug||[e.teamSlug,e.reportSlug].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e)))return null;let n=`/team/${encodeURIComponent(e.teamSlug)}`,r=e.reportSlug?`/report/${encodeURIComponent(e.reportSlug)}`:``;if(e.finding){let t=R(e.finding.id);return e.view===`findings`&&t?`${n}${r}${t}`:null}return e.view===`files`?`${n}${r}/files`:`${n}${r}${r?``:oe(e.filters)}`}var B=new Set([`overview`,`code`,`search`,`compare`,`review`,`treemap`]),V=e=>v(e?.hash)&&(e.repoId==null?e.commit==null&&e.path==null:(Y(e.repoId)||typeof e.repoId==`string`&&c(e.repoId))&&q.test(e.commit??``)&&(e.path==null||y(e.path)));function H(e){if(e.packageName==null)return`/npm`;let t=e.bundleTab??`overview`;if(!g(e.packageName)||e.packageSpec!=null&&!_(e.packageSpec)||!B.has(t)||e.compareSpec!=null&&!_(e.compareSpec))return null;if(t===`review`){if(e.reviewPackage!=null&&!g(e.reviewPackage)||e.reviewSpec!=null&&!_(e.reviewSpec)||e.patch!=null&&!V(e.patch)||e.basePatch!=null&&(!v(e.basePatch)||e.reviewPackage==null))return null;let t=e.reviewPackage==null?``:`/${e.reviewPackage}${e.reviewSpec==null?``:`@${e.reviewSpec}`}`,{patch:n}=e,r=[...n==null?[]:[`patch=${n.hash}`],...n?.repoId==null?[]:[`repo=${n.repoId}&commit=${n.commit}`],...n?.path==null?[]:[`path=${n.path.split(`/`).map(encodeURIComponent).join(`/`)}`],...e.basePatch==null?[]:[`basePatch=${e.basePatch}`],...k(e)].join(`&`);return`/npm/${e.packageName}${e.packageSpec==null?``:`@${e.packageSpec}`}/review${t}${r?`?${r}`:``}`}let n=t===`code`&&Z(e.file)?`/${e.file}`:``,r=n&&Z(e.line)?`#L${e.line}${Z(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``,i=t===`compare`&&e.compareSpec!=null?`/${e.compareSpec}${F(e.compareMode)}`:``;return`/npm/${e.packageName}${e.packageSpec==null?``:`@${e.packageSpec}`}${t===`overview`?``:`/${t}`}${n}${i}${r}`}function U(e,t,n){let r=/^\/npm\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?\/review(?:\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?)?$/u.exec(e);if(r){if(!g(r[1])||r[2]!=null&&!_(r[2])||r[3]!=null&&!g(r[3])||r[4]!=null&&!_(r[4]))return null;let e=r[3]&&/^\d+\.\d+\.\d+(?:[-+].*)?$/u.test(r[3])&&r[4]==null,t=[`repo`,`commit`,`path`].some(e=>n.has(e))?{repoId:/^[1-9]\d*$/u.test(n.get(`repo`)??``)?Number(n.get(`repo`)):n.get(`repo`),commit:n.get(`commit`)}:{},i=n.has(`patch`)?{hash:n.get(`patch`),...t,...n.has(`path`)?{path:n.get(`path`)}:{}}:null,a=n.get(`basePatch`);return i&&!V(i)||a!==null&&(!v(a)||!r[3])?null:{view:`npm`,packageName:r[1],packageSpec:r[2]??null,bundleTab:`review`,...r[3]?{reviewPackage:e?r[1]:r[3],reviewSpec:e?r[3]:r[4]??null}:{},...i?{patch:i}:{},...a?{basePatch:a}:{},...A(n)}}let i=/^\/npm(?:\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(code|search|compare|treemap)(?:\/([^/]+)(?:\/([a-z]+))?)?)?)?$/u.exec(e);if(!i)return;if(i[1]==null)return{view:`npm`};if(!g(i[1])||i[2]!=null&&!_(i[2]))return null;let a={view:`npm`,packageName:i[1],packageSpec:i[2]??null,bundleTab:i[3]??`overview`};if(i[4]==null)return a;if(a.bundleTab===`compare`)return _(i[4])&&(i[5]==null||N.has(i[5]))?{...a,compareSpec:i[4],...P(i[5])}:null;if(a.bundleTab!==`code`)return null;let o=Number(i[4]);return!i[5]&&/^[1-9]\d*$/u.test(i[4])&&Number.isSafeInteger(o)?{...a,file:o,...Q(t)}:null}var W=new Set([`code`,`search`,`treemap`,`compare`,`commits`,`issues`,`pulls`,`agents`,`pulse`,`replay`,`risk`]),G=new Set([`commits`,`issues`,`pulls`,`agents`,`pulse`,`replay`,`risk`]),ce=new Map([[`issues`,new Set([`closed`])],[`pulls`,new Set([`closed`])],[`pulse`,new Set([`week`,`quarter`,`year`])],[`replay`,new Set([`100`,`1000`])]]),le=/^[a-z][a-z\d-]{0,31}$/u,K=(e,t)=>e===`agents`?typeof t==`string`&&le.test(t)&&t!==`all`:ce.get(e)?.has(t)===!0,q=/^[a-f\d]{40}$/u,J=500,Y=e=>Number.isSafeInteger(e)&&e>0;function X(e){return typeof e==`string`&&(e===``||e.length<=J&&!/[\p{Cc}\\]/u.test(e)&&e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`&&e===e.trim()))}function ue(e){let t=e.bundleTab??`code`,n=e.path??``;if(!Y(e.repoId)||e.commit!=null&&!q.test(e.commit)||!X(n)||!W.has(t)||e.compareCommit!=null&&!q.test(e.compareCommit))return null;let r=n?`?path=${n.split(`/`).map(encodeURIComponent).join(`/`)}`:``;if(e.commit==null)return`/repo/${e.repoId}${r}`;let i=t===`code`&&Z(e.file)?`/code/${e.file}`:t===`code`?``:`/${t}`,a=t===`compare`&&e.compareCommit!=null?`/${e.compareCommit}${F(e.compareMode)}`:``,o=K(t,e.subtab)?`/${e.subtab}`:``,s=t===`code`&&Z(e.file)&&Z(e.line)?`#L${e.line}${Z(e.endLine)&&e.endLine>e.line?`-L${e.endLine}`:``}`:``;return`/repo/${e.repoId}/${e.commit}${i}${a}${o}${r}${s}`}function de(e){let t=/^\/(?:repo|manage\/code)\/([1-9]\d*)(?:\/([a-f\d]{40})(?:\/(code|search|treemap|compare|commits|history|issues|pulls|agents|pulse|replay|risk)(?:\/([^/]+)(?:\/([a-z]+))?)?)?)?$/u.exec(e.pathname.replace(/\/$/u,``));if(!t)return;let n=Number(t[1]),r=e.searchParams.get(`path`)??``,i=t[3]===`history`?`commits`:t[3]??`code`;if(!Y(n)||!X(r))return null;let a={view:`repository-code`,repoId:n,commit:t[2]??null,path:r,bundleTab:i};if(t[4]==null)return a;if(i===`compare`)return q.test(t[4])&&(t[5]==null||N.has(t[5]))?{...a,compareCommit:t[4],...P(t[5])}:null;if(G.has(i))return t[5]==null&&K(i,t[4])?{...a,subtab:t[4]}:null;let o=Number(t[4]);return i===`code`&&t[5]==null&&/^[1-9]\d*$/u.test(t[4])&&Number.isSafeInteger(o)?{...a,file:o,...Q(e.hash)}:null}function Z(e){return Number.isSafeInteger(e)&&e>0}function Q(e){let t=/^#L([1-9]\d*)(?:-L([1-9]\d*))?$/u.exec(e),[n,r]=t?[Number(t[1]),Number(t[2]??t[1])]:[];return!Z(n)||!Z(r)?{}:n===r?{line:n}:{line:Math.min(n,r),endLine:Math.max(n,r)}}function fe(e){let n=e.pathname.replace(/\/$/u,``)||`/`;if(n===`/`||n===`/index.html`)return{view:`home`};if(n===`/my/reviews`)return{view:`reviews`};if(n===`/my/profile`){let t=e.searchParams.get(`link-error`);return{view:`profile`,...t&&/^[a-z-]{1,64}$/u.test(t)?{linkError:t}:{}}}let r=Object.keys(I).find(e=>I[e]===n);if(r){let t=Number(e.searchParams.get(`createRepo`));return{view:r,...r===`manage-deduplication`&&e.searchParams.get(`report`)?{linkId:e.searchParams.get(`report`)}:{},...r===`manage-bundles`&&Number.isSafeInteger(t)&&t>0?{createRepoId:t}:{},...r===`manage-history`&&e.searchParams.get(`actor`)?{actor:e.searchParams.get(`actor`)}:{},...r===`manage-scans`?e.searchParams.get(`mode`)===`link`?{scanMode:`link`}:e.searchParams.get(`bundle`)?{bundleId:e.searchParams.get(`bundle`),...e.searchParams.get(`mode`)===`dependencies`?{scanMode:`dependencies`}:{}}:{}:{}}}let a=/^(?:\/team\/([A-Za-z0-9_-]+)|\/manage)\/bundle\/([A-Za-z0-9_-]+)(?:\/([a-z]+)(?:\/([A-Za-z0-9_-]+)(?:\/([a-z]+))?)?)?$/u.exec(n);if(a){let n=a[3]??`overview`;if(!t.has(n))return null;let r={view:`bundles`,teamSlug:a[1]??null,bundleSlug:a[2],bundleTab:n};if(a[4]==null)return r;if(n===`compare`)return a[5]==null||N.has(a[5])?{...r,compareSlug:a[4],...P(a[5])}:null;let i=Number(a[4]);return n!==`code`||a[5]||!/^[1-9]\d*$/u.test(a[4])||!Number.isSafeInteger(i)?null:{...r,file:i,...Q(e.hash)}}let o=U(n,e.hash,e.searchParams);if(o!==void 0)return o;let s=de(e);if(s!==void 0)return s;let c=/^\/team\/([A-Za-z0-9_-]+)\/(reports|bundles|repositories|dependencies|risk)$/u.exec(n);if(c)return{view:`workspace-${c[2]}`,teamSlug:c[1]};let l=w(n);if(l!==void 0)return l;let u=/^\/team\/([^/]+)(?:\/report\/([^/]+))?(?:\/(files)|\/finding\/([^/]+))?$/u.exec(n);if(!u)return ae(n)??null;try{let t=decodeURIComponent(u[1]),n=u[2]?decodeURIComponent(u[2]):null;if([t,n].some(e=>e!=null&&!/^[A-Za-z0-9_-]+$/u.test(e))||u[4]?.length>i*9)return null;let r=u[4]?decodeURIComponent(u[4]):null;return r!=null&&!R(r)?null:u[3]?{view:`files`,teamSlug:t,reportSlug:n}:r==null?{view:`findings`,teamSlug:t,reportSlug:n,...n==null?M(e.searchParams):{}}:{view:`findings`,teamSlug:t,reportSlug:n,finding:{id:r}}}catch{return null}}function $(e,t,n=[]){if(L.has(e.view)){let n=t.filter(t=>t.slug===e.teamSlug);return n.length===1?{view:e.view,teamId:n[0].id,...S(e)}:null}if(e.view===`bundles`){let{teamSlug:r,bundleSlug:i,compareSlug:a,compareMode:o,...s}=e,c=r==null?[]:t.filter(e=>e.slug===r);if(r!=null&&c.length!==1)return null;let l=c[0],u=r==null?n:t.flatMap(e=>e.bundles??[]),d=e=>new Set(u.filter(t=>t.slug===e).map(e=>e.id)),f=d(i),p=(l?.bundles??n).find(e=>e.slug===i);if(!i||!p||f.size!==1)return null;let m=a==null?null:d(a),h=m?.size===1?{compareId:[...m][0],...P(o)}:{};return{...s,teamId:l?.id??null,bundleId:p.id,...h}}if(![`findings`,`files`].includes(e.view))return e;let{teamSlug:r,reportSlug:i,...a}=e,o=t.filter(e=>e.slug===r),s=r&&o.length===1?o[0]:null,c=i==null?new Set:new Set(t.flatMap(e=>e.reports??[]).filter(e=>e.slug===i).map(e=>e.id)),l=i!=null&&c.size===1?[...c][0]:null;return a.finding?{...a,teamId:s?.id??null,reportId:l,teamOnly:i==null}:s?i==null?{...a,teamId:s.id,reportId:null}:(s.reports??[]).some(e=>e.id===l)?{...a,teamId:s.id,reportId:l}:null:null}function pe(e,t,n=[]){if(L.has(e.view)){let n=t.find(t=>t.id===e.teamId),r={view:e.view,teamSlug:n?.slug,...S(e)};return n?.slug&&$(r,t)?r:null}if(e.view===`bundles`){let{teamId:r,bundleId:i,compareId:a,compareMode:o,...s}=e,c=t.find(e=>e.id===r);if(r!=null&&!c?.slug)return null;let l=(c?.bundles??n).find(e=>e.id===i);if(!l?.slug)return null;let u=a==null?null:(r==null?n:t.flatMap(e=>e.bundles??[])).find(e=>e.id===a),d={...s,teamSlug:c?.slug??null,bundleSlug:l.slug,...u?.slug?{compareSlug:u.slug,...P(o)}:{}},f=$(d,t,n);if(!f)return null;if(d.compareSlug!=null&&f.compareId!==a){let{compareSlug:e,compareMode:t,...n}=d;return n}return d}if(![`findings`,`files`].includes(e.view))return e;let{teamId:r,reportId:i,...a}=e,o=t.find(e=>e.id===r),s=i==null?null:o?.reports?.find(e=>e.id===i);if(!o?.slug||i!=null&&!s?.slug)return null;let c={...a,teamSlug:o.slug,reportSlug:s?.slug??null},l=$(c,t);return l?.teamId===o.id&&l.reportId===(s?.id??null)?c:null}export{t as a,i as b,o as c,s as d,u as e,d as f,f as g,p as h,g as i,_ as j,v as k,y as l,ne as m,re as n,b as o,se as p,P as q,I as r,z as s,B as t,W as u,G as v,K as w,fe as x,$ as y,pe as z};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var e={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},t=e=>(...t)=>({_$litDirective$:e,values:t}),n=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};export{e as a,t as b,n as c};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
lit-html/directive.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*)
|
|
10
|
+
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as e}from"./chunk-ESXA7KID.js";import{d as t,e as n,g as r,h as i,i as a}from"./chunk-SZTCJVZJ.js";import{r as o}from"./chunk-BZJU5EEV.js";import{J as s}from"./chunk-QRKFPLA4.js";import{a as c}from"./chunk-TUII34K2.js";var l=[`dependencies`,`security`],u={dependencies:`Dependencies`,security:`Security`},d=e(),f=Object.freeze(d.models),p=d.defaultModel,m=`x-upload-encryption`,h=1,g=1,_={name:`X25519`},v=34,y=1048576,b=65536,ee=`deepview-managed-upload.v1.content-key`;function x(e,t){let n=new Uint8Array(12);return new DataView(n.buffer).setUint32(7,e),n[11]=+!!t,n}async function S(e,t,n){let r=await crypto.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveKey`]);return await crypto.subtle.deriveKey({name:`HKDF`,hash:`SHA-256`,salt:t,info:c(ee)},r,{name:`AES-GCM`,length:256},!1,[n])}async function C(e){let t=new Uint8Array(await e.slice(0,b).arrayBuffer());if(t.includes(0))return!1;try{return new TextDecoder(`utf-8`,{fatal:!0}).decode(t,{stream:!0}),!0}catch{return!1}}async function w(e,t,n){let r=await C(e),[i,a]=await Promise.all([crypto.subtle.importKey(`raw`,t,_,!1,[]),crypto.subtle.generateKey(_,!1,[`deriveBits`])]),o=new Uint8Array(v);o[0]=h,o[1]=r?g:0,o.set(new Uint8Array(await crypto.subtle.exportKey(`raw`,a.publicKey)),2);let s=await S(await crypto.subtle.deriveBits({name:`X25519`,public:i},a.privateKey,256),o,`encrypt`),c=[new Blob([o])],l=new Uint8Array(y),u=0,d=0,f=async e=>{c.push(new Blob([await crypto.subtle.encrypt({name:`AES-GCM`,iv:x(d++,e)},s,l.subarray(0,u))])),u=0},p=(r?e.stream().pipeThrough(new CompressionStream(`gzip`)):e.stream()).getReader();try{for(let e=await p.read();!e.done;e=await p.read()){n?.throwIfAborted();for(let t=0;t<e.value.length;){u===y&&await f(!1);let n=Math.min(y-u,e.value.length-t);l.set(e.value.subarray(t,t+n),u),u+=n,t+=n}}}catch(e){throw await p.cancel(e).catch(()=>{}),e}return await f(!0),new Blob(c)}var T=null,E=0;function D(){return T?.user.role??null}function O(e){if(e!==null&&!i(e))throw TypeError(`Unknown managed preview role: ${e}. Expected ${r.join(`, `)}.`);E++,T=e===null?null:{user:{id:`preview:${e}`,login:e,name:e[0].toUpperCase()+e.slice(1),role:e,avatarUrl:null,lastSeenAt:Date.now(),lastActivityAt:null},csrfToken:null}}function k(e,t){let n=new URL(e,`http://managed-preview.invalid`).pathname,r=(t?.method??`GET`).toUpperCase();if(r===`POST`&&n===`/api/auth/logout`)return Response.json({ok:!0});if(r!==`GET`)throw Error(`Changes are not saved in the managed UI preview`);if(n===`/api/auth/session`)return Response.json(T);if(n===`/api/teams`)return Response.json({teams:[]});if(n.startsWith(`/api/admin/`)&&!a(T.user.role,`manage`)||[`/api/admin/users`,`/api/admin/teams`,`/api/admin/repositories`,`/api/admin/repositories/aliases`,`/api/admin/repositories/risk`].includes(n)&&T.user.role!==`admin`)return Response.json({error:`forbidden`},{status:403});if(n===`/api/admin/repositories/risk`)return new Response(`{"type":"repos","repos":[]}
|
|
2
|
+
{"type":"done"}
|
|
3
|
+
`,{headers:{"content-type":`application/x-ndjson`}});let i={"/api/admin/users":{users:[T.user]},"/api/admin/teams":{teams:[],users:[T.user],repos:[],permissions:l},"/api/admin/links":{shares:[]},"/api/admin/repositories":{repositories:[],total:0,connectedCount:0,installUrl:null,tokenMissing:!1},"/api/admin/repositories/aliases":{aliases:[],repos:[]},"/api/admin/repositories/resolve":{location:null},"/api/admin/reports":{reports:[],repos:[],maxBytes:26214400},"/api/admin/bundles":{bundles:[],repos:[],maxBytes:0xc800000},"/api/admin/history":{history:[],total:0,page:1,limit:100,filters:{repos:[],users:[]}},"/api/admin/scan/models":{models:f,defaultModel:p},"/api/admin/scan-results":{bundles:[],results:[]},"/api/auth/profile":{profile:{login:T.user.login,name:T.user.name,githubName:T.user.name,nameAccount:null,avatarAccount:null,accounts:[]}}};return Object.hasOwn(i,n)?Response.json(i[n]):Response.json({error:`not-found`},{status:404})}var A=3145728,te=new Set([`/api/admin/reports`,`/api/admin/bundles`,`/api/admin/deduplication`]);async function ne(e,t){let n=await t(`/api/admin/uploads/key`,{credentials:`same-origin`,signal:e.signal});if(n.status===404||n.status===405)return e;if(!n.ok)return n;let r=(await n.json())?.key;if(typeof r!=`string`)throw TypeError(`The server sent an invalid upload key`);let i=new Headers(e.headers);return i.set(m,`1`),{...e,headers:i,body:await w(e.body,Uint8Array.fromBase64(r,{alphabet:`base64url`}),e.signal)}}async function re(e,t,n){let r=null;if(e!==`/api/admin/deduplication`&&t.body.size>A){let i=await n(`/api/config`,{credentials:`same-origin`,signal:t.signal});if(!i.ok)return i;let a=(await i.json()).managed,o=a?.uploadMaxBytes?.[e.endsWith(`/reports`)?`reports`:`bundles`];if(Number.isSafeInteger(o)&&o>0&&t.body.size>o)return Response.json({error:`too-large`},{status:413});let s=a?.uploadChunkBytes;Number.isSafeInteger(s)&&s>0&&s<=A&&(r=s)}let i=await ne(t,n);return i instanceof Response?i:r==null||i.body.size<=A?await n(e,i):await ae(e,i,n,r)}var ie=3;async function ae(e,t,n,r){let i=t.body,a=crypto.randomUUID(),o=e.endsWith(`/reports`)?`reports`:`bundles`,s=Math.ceil(i.size/r),c=new Headers(t.headers);c.set(`content-type`,`application/octet-stream`);let l=0,u=!1;try{let d=null,f=!1,p=(await Promise.allSettled(Array.from({length:Math.min(ie,s)},async()=>{for(;!f&&l<s;){let e=l++;try{let s=await n(`/api/admin/uploads/${o}/${a}/${e}`,{...t,headers:c,body:i.slice(e*r,(e+1)*r)});s.ok||(d??=s,f=!0)}catch(e){throw f=!0,e}}}))).find(e=>e.status===`rejected`);if(p)throw p.reason;if(d)return d;let m=new Headers(t.headers);m.set(`x-upload-id`,a),m.set(`x-upload-parts`,String(s)),m.set(`x-upload-size`,String(i.size));let h=await n(e,{...t,headers:m,body:``});return u=h.ok,h}finally{if(!u&&l>0){let e=new Headers(t.headers);e.set(`x-upload-parts`,String(l)),await n(`/api/admin/uploads/${o}/${a}`,{...t,method:`DELETE`,headers:e,body:void 0,signal:AbortSignal.timeout(1e4)}).catch(()=>{})}}}async function j(e){await e.json().then(e=>e?.error,()=>null)===`view-only`&&globalThis.document?.dispatchEvent(new CustomEvent(`managed-view-only`))}async function M(e,n){if(n?.signal?.throwIfAborted(),T)return k(e,n);let r=E;async function i(e,n){if(r!==E)throw new DOMException(`Managed session changed`,`AbortError`);let i=t();if(i){if(new URL(e,globalThis.location.origin).origin!==globalThis.location.origin)throw Error(`Public workspace requests must be same-origin`);let t=new Headers(n?.headers);t.set(`x-deepview-share`,i.token),n={...n,headers:t,credentials:`omit`,redirect:`error`}}let a=await fetch(e,{...n,cache:`no-store`});if(r!==E)throw new DOMException(`Managed session changed`,`AbortError`);return a.status===403&&![`GET`,`HEAD`].includes((n?.method??`GET`).toUpperCase())&&j(a.clone()),a}return n?.method===`POST`&&te.has(e)&&n.body instanceof Blob?await re(e,n,i):await i(e,n)}async function N(e,t=null,n={}){let r;try{r=await M(e,{credentials:`same-origin`,headers:{accept:`application/json`},...n})}catch{return t}if(r.status===401||r.status===403)return null;if(!r.ok)return t;try{return await r.json()}catch{return t}}var P=(e,t)=>[...new Set([...e?.keys()??[],...t.keys()])].filter(n=>e?.get(n)!==t.get(n)),F=e=>new Map([...Map.groupBy(e,([e])=>e)].map(([e,t])=>[e,JSON.stringify(t.map(([,e])=>e).toSorted())])),I=new class{constructor(e=()=>{}){this.resources=new Map,this.session=null,this.teamCatalog=null,this.reportCatalog=null,this.bundleCatalog=null,this.generation=0,this.sessionController=new AbortController,this.notify=e}setSession(e){(this.session?.id!==e?.id||this.session?.role!==e?.role)&&this.reset(),this.session=e}reset(){this.generation++,this.sessionController.abort(),this.sessionController=new AbortController,this.invalidate(),this.session=null,this.teamCatalog=null,this.reportCatalog=null,this.bundleCatalog=null}setReportCatalog(e){let t=new Map(e.map(e=>[e.id,JSON.stringify([e.cacheKey??null,e.reports.map(e=>[e.id,e.cacheKey??null,e.visible!==!1]).toSorted(),(e.bundles??[]).map(e=>[e.id,e.filename,e.repoFullName,e.repoDirectory??``]).toSorted()])])),n=new Set(P(this.teamCatalog,t).map(e=>`team:${e}`));for(let e of this.resources.keys())if(e.startsWith(`reports:content:team:`)){let[n]=e.slice(21).split(`:`);t.has(n)&&this.teamCatalog?.get(n)===t.get(n)||this.invalidate([e])}this.teamCatalog=t;let r=F(e.flatMap(e=>e.reports.map(t=>[t.id,JSON.stringify([e.id,t.cacheKey??null])]))),i=new Set([...n,...P(this.reportCatalog,r)]);this.reportCatalog=r;for(let e of this.resources.keys()){if(!e.startsWith(`reports:content:`)||e.startsWith(`reports:content:team:`))continue;let t=e.slice(16);(!r.has(t)||i.has(t))&&(this.invalidate([e]),i.add(t))}let a=F(e.flatMap(e=>(e.bundles??[]).map(t=>[t.id,JSON.stringify([e.id,e.cacheKey??null,t.filename,t.repoFullName,t.repoDirectory??``])]))),o=P(this.bundleCatalog,a);for(let e of o)i.add(`bundle:${e}`),this.invalidate([`bundle-metadata:${e}`]);let s=o.length>0;this.bundleCatalog=a;for(let e of this.resources.keys()){if(!e.startsWith(`report-sources:`)&&!e.startsWith(`finding-history:`))continue;let[,t,r]=e.split(`:`);(t?n.has(`team:${t}`):s||i.has(r))&&this.invalidate([e])}return i}read(e){return this.resources.get(e)?.data}invalidate(e){for(let[t,n]of this.resources)e&&!e.some(e=>t===e||t.startsWith(`${e}:`))||(n.controller?.abort(),this.resources.delete(t))}async mutate(e,t){let n=this.generation,r;try{r=await e()}catch(e){throw n===this.generation&&e?.name!==`AbortError`&&this.notify(`Couldn't save changes: ${e?.message??e}`),e}if(n!==this.generation)throw new DOMException(`Managed session changed`,`AbortError`);return this.invalidate(t),r}async load(e,t,n,{signal:r,apply:i=()=>{},retryInvalidated:a=!1}={}){let o=this.generation;for(;;){r?.throwIfAborted();let s=this.resources.get(e);if(s||(s={},this.resources.set(e,s)),s.data!==void 0&&i(s.data),!s.pending){let e=s.controller=new AbortController;s.pending=(async()=>{try{let t=await n(e.signal);return e.signal.throwIfAborted(),s.data=t,t}catch(n){throw!e.signal.aborted&&n?.name!==`AbortError`&&this.notify(`Couldn't refresh ${t}: ${n?.message??n}`),n}})().finally(()=>{s.pending=null})}try{let t=await s.pending;if(r?.throwIfAborted(),this.resources.get(e)!==s)throw new DOMException(`Managed data changed`,`AbortError`);return i(t),t}catch(t){if(!a||t?.name!==`AbortError`||r?.aborted||o!==this.generation||this.resources.get(e)===s)throw t}}}}(e=>{document.dispatchEvent(new CustomEvent(`managed-notice`,{detail:{message:e}}))});function L(e){I.setSession(e)}function R(e){return I.setReportCatalog(e)}function z(){I.reset()}var B=new Set([`findings`,`groups`,`links`]),V=-1,H=e=>typeof e==`object`&&!!e&&!Array.isArray(e),U=e=>Array.isArray(e?.findings)?`findings`:Array.isArray(e?.groups)?`groups`:null;function W(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0,configurable:!0}):e[t]=n}function G(e,{values:t=null,keys:n=null}={}){if(!H(e))return e;let r=new Map(H(t)?Object.entries(t).filter(([,e])=>Array.isArray(e)):[]),i=Array.isArray(n),a=!0,o=(e,t)=>Number.isInteger(t)&&r.has(e)?r.get(e)[t]:t,s=e=>{for(let[t,n]of r)Number.isInteger(e[t])&&W(e,t,n[e[t]]);return e},c=e=>{let t=n[e[0]];if(!Array.isArray(t)||t.length!==e.length-1)return a=!1,null;let r={};for(let[n,i]of t.entries())W(r,i,o(i,e[n+1]));return r},l=e=>i&&Array.isArray(e)&&Number.isInteger(e[0]),u=e=>l(e)?e[0]===V?e[1]:c(e):H(e)?s(e):e,d=e=>Array.isArray(e)&&!l(e)?e.map(u):u(e);if(e.repo!=null&&(e.repo=o(`repo`,e.repo)),!H(e.data))return e;for(let t in e.data)!B.has(t)&&r.has(t)&&W(e.data,t,o(t,e.data[t]));let f=U(e.data);return f&&(e.data[f]=e.data[f].map(d)),a?e:null}async function K({fallback:e=null,sent:r}={}){let i=t()||D()!==null?void 0:await r;if(i===null)return null;let a=q(i);if(a!==void 0)return a;let o;try{let r=t(),i=await M(r?n(r):`/api/auth/session`,{credentials:`same-origin`,headers:{accept:`application/json`}});if(i.status===401||i.status===403)return null;if(!i.ok)return e;o=await i.json()}catch{return e}let s=q(o);return s===void 0?e:s}function q(e){let n=e?.user;if(n===null)return null;if(n!==void 0&&typeof n.login==`string`)return{id:n.id,login:n.login,name:typeof n.name==`string`?n.name:null,avatarUrl:typeof n.avatarUrl==`string`?n.avatarUrl:null,role:typeof n.role==`string`?n.role:`none`,csrfToken:typeof e.csrfToken==`string`?e.csrfToken:null,...t()?{publicShare:!0}:{},...typeof e.viewer?.login==`string`?{viewer:{id:e.viewer.id,login:e.viewer.login,name:typeof e.viewer.name==`string`?e.viewer.name:null}}:{},...!t()&&e.dependencyReview===!0?{dependencyReview:!0}:{}}}function J(e){let t=t=>Number.isSafeInteger(e?.[t])&&e[t]>=0;return e?.appMode===!1?{appMode:!1,...t(`appReports`)&&{appReports:e.appReports},...t(`findings`)&&{findings:e.findings}}:e?.appMode===!0&&t(`appFindings`)?{appMode:!0,appFindings:e.appFindings}:null}function oe(e){if(typeof e?.sha!=`string`||typeof e.github!=`string`||!Array.isArray(e.tags))return null;let t=e.details,n=e=>typeof e==`string`?e:null,r=e=>Number.isSafeInteger(e)?e:null;return{sha:e.sha,github:e.github,tags:e.tags.filter(e=>typeof e==`string`),details:typeof t?.subject==`string`?{subject:t.subject,authorName:n(t.authorName),authorLogin:n(t.authorLogin),authoredAt:r(t.authoredAt),committedAt:r(t.committedAt)}:null}}var Y=e=>Number.isSafeInteger(e?.id)&&e.id>0&&typeof e.login==`string`?{id:e.id,login:e.login}:null;async function se({fallback:e=[],signal:r,onRevision:i}={}){let a=t(),o=a?await N(n(a),null,{signal:r}):null,s=a?{teams:o?.team?[o.team]:[]}:await N(`/api/teams`,{teams:e},{signal:r}),c=s?.teams;return Array.isArray(c)?(i?.(typeof s.revision==`string`?s.revision:null),c.filter(e=>e!=null&&typeof e.id==`string`&&typeof e.name==`string`).map(e=>({id:e.id,slug:e.slug,name:e.name,...!a&&Y(e.icon)?{icon:Y(e.icon)}:{},...!a&&e.dependencyReview===!0?{dependencyReview:!0}:{},...e.permissions?{permissions:{dependencies:e.permissions.dependencies===!0,security:e.permissions.security===!0}}:{},...typeof e.cacheKey==`string`?{cacheKey:e.cacheKey}:{},...J(e.app)?{app:J(e.app)}:{},repos:Array.isArray(e.repos)?e.repos.filter(e=>Number.isSafeInteger(e?.repoId)&&e.repoId>0&&typeof e.fullName==`string`).map(e=>({repoId:e.repoId,fullName:e.fullName,path:typeof e.path==`string`&&e.path?e.path:null})):[],reports:Array.isArray(e.reports)?e.reports.filter(e=>e!=null&&typeof e.id==`string`&&typeof e.filename==`string`).map(e=>({id:e.id,slug:e.slug,filename:e.filename,visible:e.visible!==!1,...e.analyzer===null||typeof e.analyzer==`string`?{analyzer:e.analyzer}:{},repoFullName:typeof e.repoFullName==`string`?e.repoFullName:``,repoDirectory:typeof e.repoDirectory==`string`?e.repoDirectory:``,...Number.isSafeInteger(e.findings)&&e.findings>=0?{findings:e.findings}:{},...typeof e.bundleId==`string`?{bundleId:e.bundleId}:{},...typeof e.cacheKey==`string`?{cacheKey:e.cacheKey}:{}})):[],bundles:Array.isArray(e.bundles)?e.bundles.filter(e=>e!=null&&typeof e.id==`string`&&typeof e.filename==`string`).map(e=>({id:e.id,slug:e.slug,integrity:e.integrity,byteSize:e.byteSize,repoId:e.repoId,filename:e.filename,kind:e.kind,visible:e.visible!==!1,summary:e.summary??null,summaryRetryAt:Number.isSafeInteger(e.summaryRetryAt)&&e.summaryRetryAt>0?e.summaryRetryAt:null,repoDirectory:typeof e.repoDirectory==`string`?e.repoDirectory:``,repoFullName:typeof e.repoFullName==`string`?e.repoFullName:``,commitInfo:oe(e.commitInfo)})):[]}))):s==null?[]:e}function X(e){return e?.links===void 0?[]:Array.isArray(e.links)&&e.links.every(e=>Array.isArray(e)&&e.length>=2&&e.every(e=>typeof e==`string`))?e.links:null}function Z(e){return s(e?.data)===null||typeof e.repo?.directory!=`string`||e.repo.github!==null&&typeof e.repo.github!=`string`||X(e)===null?null:{data:e.data,repo:e.repo,...e.links?{links:e.links}:{}}}async function ce(e,{signal:t}={}){return Z(await N(`/api/reports/${encodeURIComponent(e)}`,null,{signal:t}))}async function le(e,{signal:t}={}){let n=[...new Set(e)];if(n.length===0)return[];let r=await N(`/api/reports/query`,null,{method:`POST`,signal:t,headers:{accept:`application/json`,"content-type":`application/json`},body:JSON.stringify({ids:n})});if(!Array.isArray(r?.reports)||r.reports.length!==n.length)return null;let i=new Map;for(let e of r.reports){let t=Z(e);if(!t||!n.includes(e.id)||i.has(e.id))return null;i.set(e.id,t)}let a=X(r);return a===null?null:e.map(e=>({...i.get(e),...a.length>0?{links:a}:{}}))}async function ue(e,{signal:t,reportId:n=null,lite:r=!1}={}){let i=new URLSearchParams(n===null?{}:{reportId:n});r&&i.set(`lite`,`1`);let a=await N(`/api/teams/${encodeURIComponent(e)}/reports${i.size>0?`?${i}`:``}`,null,{signal:t});if(!Array.isArray(a?.reports))return null;let o=[],s=new Set;for(let e of a.reports){let t=Z(G(e,a));if(!t||typeof e.id!=`string`||typeof e.filename!=`string`||s.has(e.id))return null;s.add(e.id),o.push({id:e.id,filename:e.filename,...t,...e.opensAsApp===!0?{opensAsApp:!0}:{}})}let c=X(a);return c===null?null:(Object.defineProperties(o,{links:{value:c},...[`rows`,`app`].includes(a.folded)?{folded:{value:a.folded},lens:{value:a.lens??null}}:{}}),o)}function Q(e){return e?`?team=${encodeURIComponent(e)}`:``}async function de(e,{reportId:t,...n}={}){let r=t==null?``:`?reportId=${encodeURIComponent(t)}`,i=await N(`/api/teams/${encodeURIComponent(e)}/annotations${r}`,null,n),{reports:a,entries:o,comments:s,issues:c={}}=i??{};if(!a||typeof a!=`object`||Array.isArray(a)||!o||typeof o!=`object`||Array.isArray(o)||!Array.isArray(s)||!c||typeof c!=`object`||Array.isArray(c)||Object.values(a).some(e=>!Array.isArray(e)||e.some(e=>typeof e!=`string`))||s.some(e=>!e||typeof e.findingId!=`string`))return null;let l=new Map;for(let[e,t]of s.entries()){let n=t.findingId,r=l.get(n)??[];r.push(e),l.set(n,r)}let u=new Map,d=new Map,f=typeof i.revision==`string`?i.revision:null;return Object.assign(e=>{if(!Object.hasOwn(a,e))return null;if(d.has(e))return d.get(e);let t=JSON.stringify(a[e]),n=u.get(t);if(!n){let r=[...new Set(a[e])],i=r.flatMap(e=>l.get(e)??[]);n={entries:Object.fromEntries(r.filter(e=>Object.hasOwn(o,e)).map(e=>[e,o[e]])),comments:i.toSorted((e,t)=>e-t).map(e=>s[e]),issues:Object.fromEntries(r.filter(e=>Object.hasOwn(c,e)).map(e=>[e,c[e]]))},u.set(t,n)}return d.set(e,n),n},{revision:f})}async function fe(e,t,n){let r=(await N(`/api/reports/${encodeURIComponent(e)}/triage${Q(t)}`,null,n))?.entries;return typeof r==`object`&&r&&!Array.isArray(r)?r:null}async function pe(e,n,r=null){if(t())return[];let i=r===null?``:`?reportId=${encodeURIComponent(r)}`,a=await N(`/api/teams/${encodeURIComponent(e)}/fixes${i}`,null,{signal:n});return Array.isArray(a?.fixes)?a.fixes:null}async function me(e,t,n){let r=await N(`/api/reports/${encodeURIComponent(e)}/comments${Q(t)}`,null,n);return Array.isArray(r?.comments)?r.comments:null}async function he(e,{findingId:t,body:n,commentId:r=null,version:i},a,o){let s=r==null?``:`/${encodeURIComponent(r)}`;try{let c=await M(`/api/reports/${encodeURIComponent(e)}/comments${s}${Q(o)}`,{method:r==null?`POST`:`PATCH`,credentials:`same-origin`,headers:{"content-type":`application/json`,...a?{"x-csrf-token":a}:{}},body:JSON.stringify(r==null?{findingId:t,body:n}:{body:n,version:i})});return{status:c.status,comment:c.ok?(await c.json()).comment:null}}catch{return{status:0,comment:null}}}async function ge(e,t,n,r,i){try{return(await M(`/api/reports/${encodeURIComponent(e)}/comments/${encodeURIComponent(t)}${Q(i)}`,{method:`DELETE`,credentials:`same-origin`,headers:{"content-type":`application/json`,...r?{"x-csrf-token":r}:{}},body:JSON.stringify({version:n})})).status}catch{return 0}}async function $(e,t,n,r){try{return(await M(`/api/reports/${encodeURIComponent(e)}/triage${Q(r)}`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`,...n?{"x-csrf-token":n}:{}},body:JSON.stringify({entries:t})})).status}catch{return 0}}function _e(e){e&&(location.href=e)}async function ve(e){if(t())location.href=`/`;else{try{await M(`/api/auth/logout`,{method:`POST`,credentials:`same-origin`,headers:e?{"x-csrf-token":e}:{}})}catch{}location.reload()}}async function ye(e,t){let n=await M(`/api/auth/view-as`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`,...t?{"x-csrf-token":t}:{}},body:JSON.stringify({userId:e})});if(!n.ok)throw Error(`HTTP ${n.status}`);location.assign(`/`)}async function be(e){try{await M(`/api/auth/view-as`,{method:`DELETE`,credentials:`same-origin`,headers:e?{"x-csrf-token":e}:{}})}catch{}location.assign(o[`admin-users`])}async function xe(e){let t=await M(`/api/teams/${encodeURIComponent(e)}/share`,{credentials:`same-origin`});if(!t.ok)throw Error(`Could not load public links (${t.status})`);return(await t.json()).shares}async function Se(e,t,{id:n,revoke:r=!1,dependencies:i=!1,security:a=!1}={}){let o=n?`/${encodeURIComponent(n)}`:``,s=await M(`/api/teams/${encodeURIComponent(e)}/share${o}`,{method:r?`DELETE`:n?`PATCH`:`POST`,credentials:`same-origin`,headers:{"x-csrf-token":t,"content-type":`application/json`},...r?{}:{body:JSON.stringify({dependencies:i,security:a})}});if(!s.ok)throw Error(`Could not ${r?`revoke`:n?`update`:`create`} public link (${s.status})`);return s.json()}async function Ce(e,t){let n=await M(`/api/bundles/${encodeURIComponent(e)}/download`,{credentials:`same-origin`});if(!n.ok)throw Error(`Could not download bundle (${n.status})`);let r=URL.createObjectURL(await n.blob()),i=document.createElement(`a`);i.href=r,i.download=t,i.click(),setTimeout(()=>URL.revokeObjectURL(r),6e4)}export{u as a,D as b,O as c,M as d,N as e,I as f,L as g,R as h,z as i,K as j,se as k,ce as l,le as m,ue as n,Q as o,de as p,fe as q,pe as r,me as s,he as t,ge as u,$ as v,_e as w,ve as x,ye as y,be as z,xe as A,Se as B,Ce as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,i as t,j as n}from"./chunk-GX5UXWT4.js";import{C as r,D as i,Q as a,s as o}from"./chunk-LVW7WWV4.js";import{d as s,f as c,h as l}from"./chunk-7HP2VYIC.js";var u=`[0-9]+`,d=`[-_.]?(alpha|a|beta|b|preview|pre|c|rc)[-_.]?(${u})?`,f=`-(${u})|[-_.]?(post|rev|r)[-_.]?(${u})?`,p=`[-_.]?dev[-_.]?(${u})?`,ee=RegExp(`^v?(?:(${u})!)?(${u}(?:\\.${u})*)(?:${d})?(?:${f})?(?:(${p}))?(?:\\+([a-z0-9]+(?:[-_.][a-z0-9]+)*))?$`,`iu`),m={__proto__:null,alpha:`a`,a:`a`,beta:`b`,b:`b`,preview:`rc`,pre:`rc`,c:`rc`,rc:`rc`},h=e=>e.replace(/^0+(?=\d)/u,``);function g(e){let t=/^[\0-\u007F]*$/u.test(e)?ee.exec(e):null;if(t===null)return;let[,n,r,i,a,o,s,c,l,u,d]=t;return{epoch:h(n??`0`),release:r.split(`.`).map(h),pre:i===void 0?void 0:`${m[i.toLowerCase()]}${h(a??`0`)}`,post:o===void 0&&s===void 0?void 0:h(o??c??`0`),dev:l===void 0?void 0:h(u??`0`),local:d?.toLowerCase().split(/[-_.]/u).map(e=>/^\d+$/u.test(e)?h(e):e)}}function _({epoch:e,release:t,pre:n,post:r,dev:i,local:a}){let o=e===`0`?``:`${e}!`;return o+=t.join(`.`),n!==void 0&&(o+=n),r!==void 0&&(o+=`.post${r}`),i!==void 0&&(o+=`.dev${i}`),a!==void 0&&(o+=`+${a.join(`.`)}`),o}function v(e){let t=e.release.length;for(;t>1&&e.release[t-1]===`0`;)t--;return _({...e,release:e.release.slice(0,t)})}var y=e=>v(g(e)),b=n(e=>g(e)!==void 0,`a version`);function x(e,t){let n=_(g(b(e,t)));if(n!==e)throw new s(`${l(e)} is not a version in normal form, ${l(n)}`,t);return e}function S(e){let[t,n]=[0,e.length];for(;t<n&&(e[t]===` `||e[t]===` `);)t++;for(;n>t&&(e[n-1]===` `||e[n-1]===` `);)n--;return e.slice(t,n)}var C=/^v?(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*\.\*$/iu,w=/^(===|~=|==|!=|<=|>=|<|>)[ \t]*(.*)$/su;function te(e){let t=w.exec(e);if(t===null)return!1;let[,n,r]=t;if(n===`===`)return/^[^\s;)]+$/u.test(r);if((n===`==`||n===`!=`)&&C.test(r))return!0;let i=g(r);return i!==void 0&&(n!==`~=`||i.release.length>=2)&&(i.local===void 0||n===`==`||n===`!=`)}var T=e=>e.split(`,`).every(e=>te(S(e))),E=n(T,`a list of version specifiers`),D=/^(?:[\dA-Za-z]|[\dA-Za-z][\w.-]*[\dA-Za-z])$/u,O=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,k=e=>D.test(e),A=e=>e.toLowerCase().replace(/[-_.]+/gu,`-`),j=n(k,`a package name`);function M(t,n){if(!O.test(e(t,n)))throw new s(k(t)?`${l(t)} is not a name in normal form, ${l(A(t))}`:`${l(t)} is not a name`,n);return t}var N=new Set([`python_version`,`python_full_version`,`os_name`,`sys_platform`,`platform_release`,`platform_system`,`platform_version`,`platform_machine`,`platform_python_implementation`,`implementation_name`,`implementation_version`,`extra`,`extras`,`dependency_groups`]),P=new Set([`and`,`or`,`in`,`not`]),F=/[ \t]*(?:([()])|('[^']*'|"[^"]*")|(===|==|!=|<=|>=|~=|<|>)|([A-Za-z_][\w.]*)|(.|$))/gsuy,I=64;function L(e){let t=[];for(let[,n,r,i,a,o]of e.matchAll(F)){if(o===``)break;if(n!==void 0)t.push(n);else if(r!==void 0)t.push(`string`);else if(i!==void 0)t.push(`op`);else if(P.has(a))t.push(a);else if(N.has(a))t.push(`variable`);else return}return t}function R(e,t,n){let r=B(e,t,n);for(;r!==-1&&(e[r]===`and`||e[r]===`or`);)r=B(e,r+1,n);return r}var z=(e,t)=>e===`variable`&&t===`string`||e===`string`&&t===`variable`;function B(e,t,n){if(e[t]===`(`){if(n>=I)return-1;let r=R(e,t+1,n+1);return r!==-1&&e[r]===`)`?r+1:-1}let r=e[t+1],i=r===`op`||r===`in`?1:r===`not`&&e[t+2]===`in`?2:0;return i>0&&z(e[t],e[t+1+i])?t+1+i+1:-1}function V(e){let t=/[[\p{Cc}\p{Zl}\p{Zp}]--\t]/v.test(e)?void 0:L(e);return t!==void 0&&t.length>0&&R(t,0,0)===t.length}var H=n(V,`an environment marker`),U=/^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?[ \t]*(?:\[([^\]]*)\])?[ \t]*(.*)$/su;function W(e){let[,t,n]=U.exec(e)??[];if(n===void 0||t!==void 0&&S(t)!==``&&!t.split(`,`).every(e=>k(S(e))))return!1;if(n.startsWith(`@`)){let[,e,t]=/^@[ \t]*([^ \t]*)(.*)$/su.exec(n),r=/^(?:[ \t]+;[ \t]*(.*))?$/su.exec(t);return URL.canParse(e)&&r!==null&&(r[1]===void 0||V(r[1]))}let r=n.indexOf(`;`),i=S(r===-1?n:n.slice(0,r));if(i.startsWith(`(`)){if(!i.endsWith(`)`))return!1;i=i.slice(1,-1)}return(i===``||T(i))&&(r===-1||V(S(n.slice(r+1))))}var G=n(W,`a requirement`),K=/^([\w.]+)-([^-]*)(?:-\d[^-]*)?-[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?:-\w+(?:\.\w+)*){2}\.whl$/u;function q(e){let[,t,n]=K.exec(e)??[];if(t===void 0||t.includes(`__`))return;let r=g(n);return r===void 0?void 0:{name:A(t),version:r}}function J(e){let t=/^(.*)\.(?:tar\.gz|zip)$/su.exec(e)?.[1],n=t?.lastIndexOf(`-`)??-1;if(n===-1)return;let r=g(t.slice(n+1));return r===void 0?void 0:{name:A(t.slice(0,n)),version:r}}var Y={__proto__:null,md5:32,sha1:40,sha224:56,sha256:64,sha384:96,sha512:128,sha3_224:56,sha3_256:64,sha3_384:96,sha3_512:128,blake2b:128,blake2s:64};function X(e,t,n,r){if(t.length!==n||!/^[\da-f]*$/u.test(t))throw new s(`${l(t)} is not a ${e} digest in lowercase hex`,r);return t}function Z(t,n,r){let i=e(t,n).indexOf(`:`),a=t.slice(0,i);if(i===-1||!Object.hasOwn(r,a))throw new s(`${l(t)} is not a hash of ${Object.keys(r).join(`, `)}`,n);return X(a,t.slice(i+1),r[a],n),t}var ne=o(t)(a,`an http(s) URL`);function Q(t,n){if(/^(?:\/|\\|[A-Za-z]:)/u.test(e(t,n)))throw new s(`${l(t)} is absolute, and only reads on the machine that wrote it`,n);return r(t,n)}var re=(e,t)=>i(Q(e,t),t),$=e=>e.slice(e.lastIndexOf(`/`)+1);function ie({name:e,path:t,pathname:n}){return e===void 0?t===void 0?c(()=>decodeURIComponent($(n)),()=>{}):$(t):e}export{v as a,y as b,b as c,x as d,E as e,A as f,j as g,M as h,H as i,G as j,q as k,J as l,Y as m,X as n,Z as o,ne as p,Q as q,re as r,ie as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as e,c as t}from"./chunk-ZQHLECTI.js";import{f as n,g as r,i,j as a,k as o,m as s}from"./chunk-PXK7EU4V.js";var c,l,u,d=12336,f=26214,p=`0123456789ABCDEFabcdef`,m=`Input is not a hex string`;function h(t){c||=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));let n=t.length;if(r){if(!l){l=new Uint16Array(256);let e=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);for(let t=0;t<256;t++){let n=c[t];e[2*t]=n.charCodeAt(0),e[2*t+1]=n.charCodeAt(1)}}let r=new Uint16Array(n),i=0;for(let e=t.length-3;!(i>=e);i+=4){let e=t[i],n=t[i+1],a=t[i+2],o=t[i+3];r[i]=l[e],r[i+1]=l[n],r[i+2]=l[a],r[i+3]=l[o]}for(;i<n;i++)r[i]=l[t[i]];return e(r)}return i(t,0,n,c)}function g(e){if(typeof e!=`string`)throw TypeError(o);if(e.length%2!=0)throw SyntaxError(m);let r=e.length/2,i=new Uint8Array(r);if(n){if(!u){u=new Uint8Array(f+1);let e=new Uint8Array(2),t=new Uint16Array(e.buffer,e.byteOffset,1),n=[...p].map(e=>[e.charCodeAt(0),parseInt(e,16)]);for(let[r,i]of n){e[0]=r;for(let[r,a]of n)e[1]=r,u[t[0]]=i<<4|a}}let n=t(e,m),a=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2),o=0;for(let e=r-3;o<e;o+=4){let e=a[o],t=a[o+1],n=a[o+2],r=a[o+3],s=u[e],c=u[t],l=u[n],f=u[r];if(!s&&e!==d||!c&&t!==d||!l&&n!==d||!f&&r!==d)throw SyntaxError(m);i[o]=s,i[o+1]=c,i[o+2]=l,i[o+3]=f}for(;o<r;){let e=a[o],t=u[e];if(!t&&e!==d)throw SyntaxError(m);i[o++]=t}}else{if(!u){u=new Int8Array(128).fill(-1);for(let e=0;e<16;e++){let t=e.toString(16);u[t.charCodeAt(0)]=u[t.toUpperCase().charCodeAt(0)]=e}}let t=0;for(let n=0;n<r;n++){let r=e.charCodeAt(t++),a=e.charCodeAt(t++),o=u[r]<<4|u[a];if(o<0||(127|r|a)!=127)throw SyntaxError(m);i[n]=o}}return i}var{toHex:_}=Uint8Array.prototype;function v(e){return a(e),e.length===0?``:_&&e.toHex===_?e.toHex():h(e)}var y=Uint8Array.fromHex?(e,t=`uint8`)=>s(Uint8Array.fromHex(e),t):(e,t=`uint8`)=>s(g(e),t);export{v as a,y as b};
|