'use strict';

var _2Z4Y2ZR3_cjs = require('./2Z4Y2ZR3.cjs');
var _5GPMTH2I_cjs = require('./5GPMTH2I.cjs');
var _24WEKBY3_cjs = require('./24WEKBY3.cjs');
var console = require('console');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var console__namespace = /*#__PURE__*/_interopNamespace(console);

// src/core/version-resolver.ts
_24WEKBY3_cjs.init_cjs_shims();
var resolveTypeVersions = /* @__PURE__ */ _24WEKBY3_cjs.__name((context, userVersions) => {
  const versions = {};
  for (const tool of context.tools) {
    const defaultVersion = _5GPMTH2I_cjs.getToolDefaultVersion(context, tool.name);
    const version = userVersions[tool.name] || defaultVersion;
    if (!version) {
      continue;
    }
    versions[tool.name] = version;
    if (version === defaultVersion) {
      continue;
    }
    const supportedVersions = _5GPMTH2I_cjs.getToolSupportedVersions(context, tool.name);
    if (!supportedVersions.includes(version)) {
      console__namespace.warn(`\u26A0\uFE0F  Version ${version} for ${tool.name} is not in the supported list.`);
      console__namespace.warn(`   Supported versions: ${supportedVersions.join(", ")}`);
      console__namespace.warn(`   Continuing with Docker availability as final validation...`);
    }
  }
  const combination = context.versionCombinations.find((combination2) => Object.entries(_5GPMTH2I_cjs.findToolVersionsForCombination(context, combination2)).every(([tool, version]) => versions[tool] === version));
  if (!combination) {
    throw new Error("Compatible combination of tool versions not found");
  }
  console__namespace.info(`\u2705 ${_2Z4Y2ZR3_cjs.getCombinationId(context, combination)} ${combination.description ? `(${combination.description})` : ""}`);
  return versions;
}, "resolveTypeVersions");

exports.resolveTypeVersions = resolveTypeVersions;
//# sourceMappingURL=A5X4BLYY.cjs.map
//# sourceMappingURL=A5X4BLYY.cjs.map