#!/usr/bin/env node
import {
  getDomainDisplayName
} from "./chunk-NRCKIHND.js";
import {
  ViewTitle
} from "./chunk-B4QYXVPZ.js";
import {
  CLI_COLORS
} from "./chunk-FTD5Z6QD.js";
import {
  init_esm_shims
} from "./chunk-DHET7RCE.js";

// src/cli/components/wizard/step-confirm.tsx
init_esm_shims();
import { Box, Text, useInput } from "ink";
import { jsx, jsxs } from "react/jsx-runtime";
var StepConfirm = ({
  onComplete,
  stackName,
  selectedDomains,
  domainSelections,
  technologyCount,
  skillCount,
  agentCount,
  installMode,
  onBack
}) => {
  useInput((_input, key) => {
    if (key.return) {
      onComplete();
    }
    if (key.escape && onBack) {
      onBack();
    }
  });
  const domainsText = selectedDomains?.map(getDomainDisplayName).join(" + ") || "";
  const title = stackName ? `Ready to install ${stackName}` : `Ready to install your custom stack${domainsText ? ` (${domainsText})` : ""}`;
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 2, children: [
    /* @__PURE__ */ jsx(ViewTitle, { children: title }),
    /* @__PURE__ */ jsx(Text, { children: " " }),
    domainSelections && selectedDomains && !stackName && /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginBottom: 1, children: selectedDomains.map((domain) => {
      const selections = domainSelections[domain] || {};
      const techs = Object.values(selections).flat();
      if (techs.length === 0) return null;
      return /* @__PURE__ */ jsxs(Text, { children: [
        /* @__PURE__ */ jsxs(Text, { bold: true, children: [
          getDomainDisplayName(domain),
          ":"
        ] }),
        " ",
        /* @__PURE__ */ jsx(Text, { children: techs.join(", ") })
      ] }, domain);
    }) }),
    /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginY: 1, children: [
      technologyCount !== void 0 && /* @__PURE__ */ jsxs(Text, { children: [
        /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Technologies:" }),
        " ",
        /* @__PURE__ */ jsx(Text, { bold: true, children: technologyCount })
      ] }),
      skillCount !== void 0 && /* @__PURE__ */ jsxs(Text, { children: [
        /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Skills:" }),
        " ",
        /* @__PURE__ */ jsx(Text, { bold: true, children: skillCount }),
        " ",
        /* @__PURE__ */ jsx(Text, { color: CLI_COLORS.PRIMARY, children: "(all verified)" })
      ] }),
      agentCount !== void 0 && /* @__PURE__ */ jsxs(Text, { children: [
        /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Agents:" }),
        " ",
        /* @__PURE__ */ jsx(Text, { bold: true, children: agentCount })
      ] }),
      installMode && /* @__PURE__ */ jsxs(Text, { children: [
        /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Install mode:" }),
        " ",
        /* @__PURE__ */ jsx(Text, { bold: true, children: installMode === "plugin" ? "Plugin" : "Local" })
      ] })
    ] }),
    /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "ENTER install ESC go back" }) })
  ] });
};

export {
  StepConfirm
};
//# sourceMappingURL=chunk-DVW6ASTO.js.map