import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  messages_default
} from "./chunk-QBRIDBYB.js";
import {
  DevCenterComponent,
  createI18n,
  external_exports,
  require_lib,
  require_react,
  useTranslation
} from "./chunk-HPSJVSZT.js";
import {
  __toESM,
  init_esm_shims
} from "./chunk-4EFJZ3GQ.js";

// src/components/GenerateCommand/generateFlows.ts
init_esm_shims();
var import_react = __toESM(require_react(), 1);
var import_variant = __toESM(require_lib(), 1);
var DevCenterGenerateFlow = (0, import_variant.variant)((0, import_variant.types)(DevCenterComponent));
var getGenerateFlowByKey = (key, t) => {
  return (0, import_variant.match)(key, {
    "dashboard-page": () => ({
      title: t("generate_command.flow.dashboard_page"),
      value: DevCenterGenerateFlow.DashboardPage()
    }),
    "dashboard-modal": () => ({
      title: t("generate_command.flow.dashboard_modal"),
      value: DevCenterGenerateFlow.DashboardModal()
    }),
    "dashboard-plugin": () => ({
      title: t("generate_command.flow.dashboard_plugin"),
      value: DevCenterGenerateFlow.DashboardPlugin()
    }),
    "dashboard-menu-plugin": () => ({
      title: t("generate_command.flow.dashboard_menu_plugin"),
      value: DevCenterGenerateFlow.DashboardMenuPlugin()
    }),
    "custom-element": () => ({
      title: t("generate_command.flow.custom_element"),
      value: DevCenterGenerateFlow.CustomElement()
    }),
    "embedded-script": () => ({
      title: t("generate_command.flow.embedded_script"),
      value: DevCenterGenerateFlow.EmbeddedScript()
    }),
    "site-plugin": () => ({
      title: t("generate_command.flow.site_plugin"),
      value: DevCenterGenerateFlow.SitePlugin()
    }),
    api: () => ({
      title: t("generate_command.flow.api.title"),
      value: DevCenterGenerateFlow.Api()
    }),
    event: () => ({
      title: t("generate_command.flow.event"),
      value: DevCenterGenerateFlow.Event()
    }),
    "service-plugin": () => ({
      title: t("generate_command.flow.service_plugin"),
      value: DevCenterGenerateFlow.ServicePlugin()
    })
  });
};
var generateFlowKeyToSelectOption = (key, t) => {
  const { title, value } = getGenerateFlowByKey(key, t);
  return {
    key,
    title,
    value
  };
};
var useGenerateFlows = () => {
  const { t } = useTranslation();
  return (0, import_react.useMemo)(() => {
    return [
      {
        title: t("generate_command.flow.dashboard_category"),
        items: [
          // Uncomment after SidebarCategory is open to public
          // {
          //   key: 'sidebar-category',
          //   title: t('generate_command.flow.sidebar_category'),
          //   value: DevCenterGenerateFlow.DashboardSidebarCategory(),
          // },
          generateFlowKeyToSelectOption("dashboard-page", t),
          generateFlowKeyToSelectOption("dashboard-modal", t),
          generateFlowKeyToSelectOption("dashboard-plugin", t),
          generateFlowKeyToSelectOption("dashboard-menu-plugin", t)
        ]
      },
      {
        title: t("generate_command.flow.site_category"),
        items: [
          generateFlowKeyToSelectOption("custom-element", t),
          generateFlowKeyToSelectOption("embedded-script", t),
          generateFlowKeyToSelectOption("site-plugin", t)
        ]
      },
      {
        title: t("generate_command.flow.backend_category"),
        items: [
          generateFlowKeyToSelectOption("api", t),
          generateFlowKeyToSelectOption("event", t),
          generateFlowKeyToSelectOption("service-plugin", t)
        ]
      }
    ];
  }, [t]);
};

// src/components/GenerateCommand/docsExtensionType.ts
init_esm_shims();
var import_variant2 = __toESM(require_lib(), 1);
var docsExtensionTypeSchema = external_exports.enum([
  "DASHBOARD_PAGE",
  "DASHBOARD_MODAL",
  "DASHBOARD_PLUGIN",
  "DASHBOARD_MENU_PLUGIN",
  "SITE_WIDGET",
  "EMBEDDED_SCRIPT",
  "SITE_PLUGIN",
  "WEB_METHOD",
  "HTTP_FUNCTION",
  "BACKEND_EVENT",
  "SERVICE_PLUGIN"
]);
var getGenerateFlowByDocsExtensionType = (type, t) => {
  return (0, import_variant2.match)(type, {
    DASHBOARD_PAGE: () => {
      return generateFlowKeyToSelectOption("dashboard-page", t);
    },
    DASHBOARD_MODAL: () => {
      return generateFlowKeyToSelectOption("dashboard-modal", t);
    },
    DASHBOARD_PLUGIN: () => {
      return generateFlowKeyToSelectOption("dashboard-plugin", t);
    },
    DASHBOARD_MENU_PLUGIN: () => {
      return generateFlowKeyToSelectOption("dashboard-menu-plugin", t);
    },
    SITE_WIDGET: () => {
      return generateFlowKeyToSelectOption("custom-element", t);
    },
    EMBEDDED_SCRIPT: () => {
      return generateFlowKeyToSelectOption("embedded-script", t);
    },
    SITE_PLUGIN: () => {
      return generateFlowKeyToSelectOption("site-plugin", t);
    },
    WEB_METHOD: () => {
      return generateFlowKeyToSelectOption("api", t);
    },
    HTTP_FUNCTION: () => {
      return generateFlowKeyToSelectOption("api", t);
    },
    BACKEND_EVENT: () => {
      return generateFlowKeyToSelectOption("event", t);
    },
    SERVICE_PLUGIN: () => {
      return generateFlowKeyToSelectOption("service-plugin", t);
    }
  });
};

// src/i18n.ts
init_esm_shims();
function createI18nT() {
  const i18n = createI18n(messages_default);
  return i18n.t.bind(i18n);
}

export {
  createI18nT,
  useGenerateFlows,
  docsExtensionTypeSchema,
  getGenerateFlowByDocsExtensionType
};
//# sourceMappingURL=chunk-CKC77TV4.js.map