'use strict';

var M7FR43QL_cjs = require('./M7FR43QL.cjs');
var _5GPMTH2I_cjs = require('./5GPMTH2I.cjs');
var _24WEKBY3_cjs = require('./24WEKBY3.cjs');
var esToolkit = require('es-toolkit');
var path = require('path');

// src/github/matrix.ts
_24WEKBY3_cjs.init_cjs_shims();
var TAG_SEPARATORS = [
  "-",
  "_"
];
var generateGithubMatrix = /* @__PURE__ */ _24WEKBY3_cjs.__name((images, directory) => {
  const createImageEntry = /* @__PURE__ */ _24WEKBY3_cjs.__name((image) => {
    const imageName = _5GPMTH2I_cjs.getImageName(image.name);
    const tags = TAG_SEPARATORS.map((separator) => M7FR43QL_cjs.getImageTag(image, separator));
    return {
      entry: {
        name: image.name,
        build_args: Object.entries({
          ...image.versions,
          ...image.dependencies
        }).sort().map(([key, value]) => `${esToolkit.constantCase(key)}_VERSION=${value}`),
        directory: path.join(directory, "docker", image.name),
        image_name: imageName,
        tags
      },
      image
    };
  }, "createImageEntry");
  const results = Object.values(images).map(createImageEntry);
  const imageEntries = results.map((r) => r.entry);
  const mirroredImages = results.filter((result) => result.image.mirrorRegistries?.length).flatMap((result) => result.image.mirrorRegistries.map((mirror) => ({
    name: result.entry.name,
    image_name: result.entry.image_name,
    tags: result.entry.tags,
    mirror
  })));
  return {
    images: imageEntries,
    mirroredImages
  };
}, "generateGithubMatrix");

exports.generateGithubMatrix = generateGithubMatrix;
//# sourceMappingURL=Y6ZP4DWX.cjs.map
//# sourceMappingURL=Y6ZP4DWX.cjs.map