#!/usr/bin/env node
import {
  getDomainDisplayName,
  orderDomains
} from "./chunk-BKJHAJQW.js";
import {
  CheckboxGrid
} from "./chunk-CIG7IKX3.js";
import {
  useWizardStore
} from "./chunk-WF6RM73R.js";
import {
  typedEntries
} from "./chunk-T4EXUIBY.js";
import {
  init_esm_shims
} from "./chunk-DHET7RCE.js";

// src/cli/components/wizard/domain-selection.tsx
init_esm_shims();
import { useMemo } from "react";
import { unique } from "remeda";
import { jsx } from "react/jsx-runtime";
var BUILT_IN_DOMAIN_DESCRIPTIONS = {
  web: "Frontend web applications",
  api: "Backend APIs and services",
  cli: "Command-line tools",
  mobile: "Mobile applications",
  shared: "Shared utilities and methodology"
};
var DomainSelection = ({ matrix }) => {
  const { selectedDomains, toggleDomain, setStep, setApproach, selectStack } = useWizardStore();
  const availableDomains = useMemo(() => {
    const matrixDomains = unique(
      typedEntries(matrix.categories).map(([, cat]) => cat?.domain).filter((d) => d != null)
    );
    const ordered = orderDomains(matrixDomains);
    return ordered.map((domain) => ({
      id: domain,
      label: getDomainDisplayName(domain),
      description: BUILT_IN_DOMAIN_DESCRIPTIONS[domain] ?? `${getDomainDisplayName(domain)} skills`
    }));
  }, [matrix]);
  const handleBack = () => {
    setApproach(null);
    selectStack(null);
  };
  return /* @__PURE__ */ jsx(
    CheckboxGrid,
    {
      title: "Select domains to configure",
      items: availableDomains,
      selectedIds: selectedDomains,
      onToggle: toggleDomain,
      onContinue: () => setStep("build"),
      onBack: handleBack,
      emptyMessage: "Please select at least one domain"
    }
  );
};

export {
  DomainSelection
};
//# sourceMappingURL=chunk-TGLRDEEL.js.map