"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_primordials_object = require('../../primordials/object.js');

//#region src/external-tools/cdxgen/asset-names.ts
/**
* @file Upstream cdxgen release asset-name mapping per `platform-arch`. cdxgen
*   ships per-platform SEA binaries starting in v12.0.x — bare executables, no
*   archive wrapper, with companion `.sha256` sidecars. Each platform has both
*   a "full" variant (bundles bun + deno runtimes for those project types) and
*   a "slim" variant (no bundled runtimes; relies on the host having them when
*   needed). We ship the slim variants by default: socket-lib consumers run
*   cdxgen for npm/pip/maven/etc. SBOM generation where the bundled runtimes
*   aren't on the hot path, and the slim binary is ~3× smaller. Consumers that
*   need full (bun/deno project scanning) can override by passing `variant:
*   'full'`. Asset URLs:
*   https://github.com/CycloneDX/cdxgen/releases/download/v<X.Y.Z>/cdxgen-<os>-<arch>[-musl][-slim][.exe]
*   Reference: https://github.com/CycloneDX/cdxgen/releases. Single source of
*   truth: the SEA binary IS the install path. The legacy `@cyclonedx/cdxgen`
*   npm package is not used as a fallback — every platform-arch the fleet
*   supports has a SEA build, and routing through npm for unsupported targets
*   would silently use a different distribution (different bundle composition,
*   different startup cost, different version-pin surface). One install path;
*   one cached binary.
*/
function buildCdxgenAssetName(baseTriple, variant, ext) {
	return `cdxgen-${baseTriple}${variant === "slim" ? "-slim" : ""}${ext}`;
}
function getCdxgenAssetEntry(platformArch, variant = "slim") {
	return (variant === "full" ? CDXGEN_FULL_ASSET_MAP : CDXGEN_SLIM_ASSET_MAP)[platformArch];
}
/**
* Build the GitHub release-asset download URL for an upstream cdxgen binary.
* Returns `undefined` when no entry exists for the requested platform-arch.
*/
function getCdxgenDownloadUrl(opts) {
	const { platformArch, variant = "slim", version } = opts;
	const entry = getCdxgenAssetEntry(platformArch, variant);
	if (!entry) return;
	return `https://github.com/CycloneDX/cdxgen/releases/download/v${version}/` + entry.asset;
}
function makeCdxgenEntry(baseTriple, variant, ext = "") {
	return require_primordials_object.ObjectFreeze({
		__proto__: null,
		asset: buildCdxgenAssetName(baseTriple, variant, ext)
	});
}
function makeCdxgenPlatformMap(variant) {
	return require_primordials_object.ObjectFreeze({
		__proto__: null,
		"darwin-arm64": makeCdxgenEntry("darwin-arm64", variant),
		"darwin-x64": makeCdxgenEntry("darwin-amd64", variant),
		"linux-arm64": makeCdxgenEntry("linux-arm64", variant),
		"linux-arm64-musl": makeCdxgenEntry("linux-arm64-musl", variant),
		"linux-x64": makeCdxgenEntry("linux-amd64", variant),
		"linux-x64-musl": makeCdxgenEntry("linux-amd64-musl", variant),
		"win-arm64": makeCdxgenEntry("windows-arm64", variant, ".exe"),
		"win-x64": makeCdxgenEntry("windows-amd64", variant, ".exe")
	});
}
const CDXGEN_SLIM_ASSET_MAP = makeCdxgenPlatformMap("slim");
const CDXGEN_FULL_ASSET_MAP = makeCdxgenPlatformMap("full");

//#endregion
exports.CDXGEN_FULL_ASSET_MAP = CDXGEN_FULL_ASSET_MAP;
exports.CDXGEN_SLIM_ASSET_MAP = CDXGEN_SLIM_ASSET_MAP;
exports.buildCdxgenAssetName = buildCdxgenAssetName;
exports.getCdxgenAssetEntry = getCdxgenAssetEntry;
exports.getCdxgenDownloadUrl = getCdxgenDownloadUrl;
exports.makeCdxgenEntry = makeCdxgenEntry;
exports.makeCdxgenPlatformMap = makeCdxgenPlatformMap;