"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/bazel/asset-names.ts
/**
* @file Upstream Bazel release asset-name mapping per `platform-arch`. Bazel's
*   GitHub Releases use a consistent naming pattern
*   (`bazel-<version>-<os>-<arch>[.exe]`); this leaf encodes the platform-arch
*   → suffix map so the bazelisk-style downloader can build the right URL
*   without spreading the convention. Bazel publishes native binaries for 5 of
*   socket's 8 targets. The 3 gap targets use compat-layer fallbacks:
*
*   - `linux-x64-musl` / `linux-arm64-musl` → glibc binary + gcompat (user must
*     `apk add gcompat` on Alpine)
*   - `win-arm64` → Windows x64 binary via Prism emulation Callers can read
*     `BAZEL_ASSET_MAP[platformArch].native` to see whether the binary is
*     native to the target or runs under a compat layer.
*/
const BAZEL_ASSET_MAP = require_primordials_object.ObjectFreeze({
	__proto__: null,
	"darwin-arm64": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "darwin-arm64",
		native: true,
		note: void 0
	}),
	"darwin-x64": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "darwin-x86_64",
		native: true,
		note: void 0
	}),
	"linux-arm64": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "linux-arm64",
		native: true,
		note: void 0
	}),
	"linux-arm64-musl": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "linux-arm64",
		native: false,
		note: "Runs under gcompat on Alpine; `apk add gcompat` required."
	}),
	"linux-x64": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "linux-x86_64",
		native: true,
		note: void 0
	}),
	"linux-x64-musl": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "linux-x86_64",
		native: false,
		note: "Runs under gcompat on Alpine; `apk add gcompat` required."
	}),
	"win-arm64": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "windows-x86_64.exe",
		native: false,
		note: "Runs under Prism x86_64 emulation on Windows ARM64."
	}),
	"win-x64": require_primordials_object.ObjectFreeze({
		__proto__: null,
		suffix: "windows-x86_64.exe",
		native: true,
		note: void 0
	})
});
function getBazelAssetEntry(platformArch) {
	return BAZEL_ASSET_MAP[platformArch];
}
/**
* Build the GitHub release-asset download URL for an upstream Bazel binary.
* Returns `undefined` when no entry exists for the requested platform-arch.
*
* Note: the underlying asset may be a compat-layer build (see
* `BazelAssetEntry.native`). Callers that require a native binary should check
* `getBazelAssetEntry(platformArch).native` before downloading.
*
* Reference: https://github.com/bazelbuild/bazel/releases.
*
* @example
*   ;```typescript
*   const url = getBazelDownloadUrl({
*     version: '7.4.1',
*     platformArch: 'darwin-arm64',
*   })
*   // → 'https://github.com/bazelbuild/bazel/releases/download/7.4.1/bazel-7.4.1-darwin-arm64'
*   ```
*/
function getBazelDownloadUrl(opts) {
	const { platformArch, version } = opts;
	const entry = BAZEL_ASSET_MAP[platformArch];
	if (!entry) return;
	return `https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-${entry.suffix}`;
}

//#endregion
exports.BAZEL_ASSET_MAP = BAZEL_ASSET_MAP;
exports.getBazelAssetEntry = getBazelAssetEntry;
exports.getBazelDownloadUrl = getBazelDownloadUrl;