import { init_esm_shims, __name } from './4RNWLMHM.js';

// src/core/compatibility.ts
init_esm_shims();
function findBestCompatibleCombination(userVersions, matrix) {
  const scoredCombinations = matrix.combinations.map((combo) => {
    let matchScore = 0;
    let conflicts = 0;
    for (const [tool, userVersion] of Object.entries(userVersions)) {
      const comboVersion = combo.versions[tool];
      if (comboVersion !== void 0) {
        if (comboVersion === userVersion) {
          matchScore++;
        } else {
          conflicts++;
        }
      }
    }
    return {
      combo,
      matchScore,
      conflicts
    };
  });
  scoredCombinations.sort((a, b) => {
    if (a.conflicts !== b.conflicts) {
      return a.conflicts - b.conflicts;
    }
    return b.matchScore - a.matchScore;
  });
  return scoredCombinations[0]?.combo;
}
__name(findBestCompatibleCombination, "findBestCompatibleCombination");

export { findBestCompatibleCombination };
//# sourceMappingURL=HR64SZQX.js.map
//# sourceMappingURL=HR64SZQX.js.map