"use strict";
/* Socket Lib - Built with esbuild */
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var asset_names_exports = {};
__export(asset_names_exports, {
  CDXGEN_FULL_ASSET_MAP: () => CDXGEN_FULL_ASSET_MAP,
  CDXGEN_SLIM_ASSET_MAP: () => CDXGEN_SLIM_ASSET_MAP,
  buildCdxgenAssetName: () => buildCdxgenAssetName,
  getCdxgenAssetEntry: () => getCdxgenAssetEntry,
  getCdxgenDownloadUrl: () => getCdxgenDownloadUrl,
  makeCdxgenEntry: () => makeCdxgenEntry,
  makeCdxgenPlatformMap: () => makeCdxgenPlatformMap
});
module.exports = __toCommonJS(asset_names_exports);
var import_object = require("../../primordials/object");
function buildCdxgenAssetName(baseTriple, variant, ext) {
  const slim = variant === "slim" ? "-slim" : "";
  return `cdxgen-${baseTriple}${slim}${ext}`;
}
function getCdxgenAssetEntry(platformArch, variant = "slim") {
  const map = variant === "full" ? CDXGEN_FULL_ASSET_MAP : CDXGEN_SLIM_ASSET_MAP;
  return map[platformArch];
}
function getCdxgenDownloadUrl(opts) {
  const { platformArch, variant = "slim", version } = opts;
  const entry = getCdxgenAssetEntry(platformArch, variant);
  if (!entry) {
    return void 0;
  }
  return `https://github.com/CycloneDX/cdxgen/releases/download/v${version}/` + entry.asset;
}
function makeCdxgenEntry(baseTriple, variant, ext = "") {
  return (0, import_object.ObjectFreeze)({
    __proto__: null,
    asset: buildCdxgenAssetName(baseTriple, variant, ext)
  });
}
function makeCdxgenPlatformMap(variant) {
  return (0, import_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");
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  CDXGEN_FULL_ASSET_MAP,
  CDXGEN_SLIM_ASSET_MAP,
  buildCdxgenAssetName,
  getCdxgenAssetEntry,
  getCdxgenDownloadUrl,
  makeCdxgenEntry,
  makeCdxgenPlatformMap
});
