"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var ApiKeyStep_exports = {};
__export(ApiKeyStep_exports, {
  ApiKeyStep: () => ApiKeyStep,
  default: () => ApiKeyStep_default,
  getProviderEnvVar: () => getProviderEnvVar,
  hasApiKeyConfigured: () => hasApiKeyConfigured
});
module.exports = __toCommonJS(ApiKeyStep_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_ink = require("ink");
var import_agent_management = require("@dexto/agent-management");
function ApiKeyStep({ provider }) {
  const keyStatus = (0, import_agent_management.getProviderKeyStatus)(provider);
  if (keyStatus.hasApiKey) {
    return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "green", children: [
      "\u2713 ",
      keyStatus.envVar,
      " already set, press Enter to skip"
    ] });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ink.Text, { color: "yellowBright", children: [
    "No ",
    keyStatus.envVar,
    " configured"
  ] });
}
function getProviderEnvVar(provider) {
  const keyStatus = (0, import_agent_management.getProviderKeyStatus)(provider);
  return keyStatus.envVar;
}
function hasApiKeyConfigured(provider) {
  const keyStatus = (0, import_agent_management.getProviderKeyStatus)(provider);
  return keyStatus.hasApiKey;
}
var ApiKeyStep_default = ApiKeyStep;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ApiKeyStep,
  getProviderEnvVar,
  hasApiKeyConfigured
});
