import { jsx as a, jsxs as r, Fragment as v } from "react/jsx-runtime";
import { useState as d, useEffect as k, useMemo as m } from "react";
import { useParams as L, useNavigate as R } from "react-router-dom";
import { useTranslation as $ } from "react-i18next";
import { Loader2 as S, ArrowLeft as P, AlertTriangle as q, BookOpen as G, Layers as M, Database as U, Zap as B, Clock as j, Shield as H, Code2 as z, FileCode2 as F, Brain as O, Check as J, Copy as W } from "lucide-react";
import { B as Z, i as V } from "./index-Dh9kUeDn.js";
import { aiApi as _ } from "./aiApi-BvJVWOlD.js";
const h = {
  User: {
    paginated: !0,
    fields: [
      { name: "id", type: "Guid", description: "Unique user identifier" },
      { name: "email", type: "string", description: "User email address" },
      { name: "firstName", type: "string", description: "First name", nullable: !0 },
      { name: "lastName", type: "string", description: "Last name", nullable: !0 },
      { name: "displayName", type: "string", description: "Display name", nullable: !0 },
      { name: "isActive", type: "boolean", description: "Account active status" },
      { name: "createdAt", type: "DateTime", description: "Creation date (UTC)" },
      { name: "updatedAt", type: "DateTime", description: "Last update date (UTC)", nullable: !0 },
      { name: "roles", type: "string[]", description: "Assigned role names" },
      { name: "tenantIds", type: "Guid[]", description: "Associated tenant identifiers" }
    ]
  },
  Tenant: {
    paginated: !0,
    fields: [
      { name: "id", type: "Guid", description: "Unique tenant identifier" },
      { name: "name", type: "string", description: "Tenant name" },
      { name: "slug", type: "string", description: "URL-friendly slug" },
      { name: "type", type: "string", description: "Tenant type (B2C/B2B)" },
      { name: "status", type: "string", description: "Current status" },
      { name: "description", type: "string", description: "Tenant description", nullable: !0 },
      { name: "createdAt", type: "DateTime", description: "Creation date (UTC)" },
      { name: "updatedAt", type: "DateTime", description: "Last update date (UTC)", nullable: !0 },
      { name: "memberCount", type: "int", description: "Number of active members" }
    ]
  },
  Role: {
    paginated: !0,
    fields: [
      { name: "id", type: "Guid", description: "Unique role identifier" },
      { name: "name", type: "string", description: "Role display name" },
      { name: "shortName", type: "string", description: "Short name", nullable: !0 },
      { name: "code", type: "string", description: "Unique role code", nullable: !0 },
      { name: "category", type: "string", description: "Role category" },
      { name: "description", type: "string", description: "Role description", nullable: !0 },
      { name: "isSystem", type: "boolean", description: "System-managed role flag" },
      { name: "createdAt", type: "DateTime", description: "Creation date (UTC)" },
      { name: "updatedAt", type: "DateTime", description: "Last update date (UTC)", nullable: !0 },
      { name: "permissions", type: "string[]", description: "Assigned permission codes" }
    ]
  },
  Ticket: {
    paginated: !0,
    fields: [
      { name: "id", type: "Guid", description: "Unique ticket identifier" },
      { name: "title", type: "string", description: "Ticket title" },
      { name: "type", type: "string", description: "Ticket type (Incident/Request/Task)" },
      { name: "status", type: "string", description: "Current status" },
      { name: "priority", type: "string", description: "Priority level" },
      { name: "assignedToUserId", type: "Guid", description: "Assigned user", nullable: !0 },
      { name: "createdByUserId", type: "Guid", description: "Creator user" },
      { name: "tenantId", type: "Guid", description: "Owning tenant", nullable: !0 },
      { name: "createdAt", type: "DateTime", description: "Creation date (UTC)" },
      { name: "updatedAt", type: "DateTime", description: "Last update date (UTC)", nullable: !0 },
      { name: "resolvedAt", type: "DateTime", description: "Resolution date", nullable: !0 },
      { name: "closedAt", type: "DateTime", description: "Closing date", nullable: !0 }
    ]
  },
  NavigationApplication: {
    paginated: !1,
    fields: [
      { name: "id", type: "Guid", description: "Application identifier" },
      { name: "code", type: "string", description: "Application code" },
      { name: "label", type: "string", description: "Display label" },
      { name: "modules", type: "Module[]", description: "Child modules" },
      { name: "modules[].id", type: "Guid", description: "Module identifier" },
      { name: "modules[].code", type: "string", description: "Module code" },
      { name: "modules[].label", type: "string", description: "Module display label" }
    ]
  }
}, Q = {
  users: [
    { name: "tenantId", type: "UUID", default: "(requis)", description: "ID du tenant - scope aux utilisateurs de ce tenant" },
    { name: "page", type: "int", default: "1", description: "Numero de page (commence a 1)" },
    { name: "pageSize", type: "int", default: "100", description: "Elements par page (max 1000)" },
    { name: "modifiedSince", type: "DateTime?", default: "null", description: "Filtre incremental UTC" },
    { name: "isActive", type: "bool?", default: "null", description: "Filtre par statut actif/inactif" }
  ],
  tenants: [
    { name: "tenantId", type: "UUID", default: "(requis)", description: "ID du tenant a exporter" },
    { name: "page", type: "int", default: "1", description: "Numero de page (commence a 1)" },
    { name: "pageSize", type: "int", default: "100", description: "Elements par page (max 1000)" },
    { name: "modifiedSince", type: "DateTime?", default: "null", description: "Filtre incremental UTC" }
  ],
  roles: [
    { name: "tenantId", type: "UUID", default: "(requis)", description: "ID du tenant - exporte les roles de ce tenant" },
    { name: "page", type: "int", default: "1", description: "Numero de page (commence a 1)" },
    { name: "pageSize", type: "int", default: "100", description: "Elements par page (max 1000)" },
    { name: "modifiedSince", type: "DateTime?", default: "null", description: "Filtre incremental UTC" }
  ],
  tickets: [
    { name: "tenantId", type: "UUID", default: "(requis)", description: "ID du tenant - exporte les tickets de ce tenant" },
    { name: "page", type: "int", default: "1", description: "Numero de page (commence a 1)" },
    { name: "pageSize", type: "int", default: "100", description: "Elements par page (max 500)" },
    { name: "modifiedSince", type: "DateTime?", default: "null", description: "Filtre incremental UTC" }
  ],
  navigation: []
};
function Y(e) {
  switch (e) {
    case "Guid":
      return '"3fa85f64-5717-4562-b3fc-2c963f66afa6"';
    case "string":
      return '"..."';
    case "boolean":
      return "true";
    case "int":
      return "0";
    case "DateTime":
      return '"2026-01-15T10:30:00Z"';
    case "string[]":
      return '["item1", "item2"]';
    case "Guid[]":
      return '["uuid1", "uuid2"]';
    default:
      return '"..."';
  }
}
function K(e) {
  e.push("## 1. Authentification (HMAC-JWT Assertion)"), e.push(""), e.push("### Etape 1 : Creer une assertion JWT signee HMAC-SHA256"), e.push(""), e.push("```"), e.push('Header: { "alg": "HS256", "typ": "JWT" }'), e.push("Payload: {"), e.push('  "sub": "<YOUR_CLIENT_ID>",          // ton clientId'), e.push('  "iat": <timestamp-unix-actuel>,     // timestamp Unix actuel'), e.push('  "exp": <timestamp-unix + 300>,      // expiration (max 5 min apres iat)'), e.push('  "jti": "<uuid-unique>"              // nonce anti-replay'), e.push("}"), e.push("Signature: HMAC-SHA256(header.payload, Base64Decode(clientSecret))"), e.push("```"), e.push(""), e.push("**Important** : Le `clientSecret` est encode en Base64. Tu dois le **decoder** avant de l'utiliser comme cle HMAC."), e.push(""), e.push("### Etape 2 : Echanger l'assertion contre un access token"), e.push(""), e.push("```http"), e.push("POST {baseUrl}/api/auth/external-app/token"), e.push("Content-Type: application/json"), e.push(""), e.push('{ "assertion": "<jwt-assertion-de-etape-1>" }'), e.push("```"), e.push(""), e.push("**Reponse succes (200)** :"), e.push("```json"), e.push("{"), e.push('  "accessToken": "eyJhbGciOiJIUz...",'), e.push('  "expiresAt": "2026-02-25T11:00:00Z",'), e.push('  "permissions": ["administration.users.read", ...]'), e.push("}"), e.push("```"), e.push(""), e.push("Cache le token et renouvelle-le 5 min avant `expiresAt`."), e.push(""), e.push("---"), e.push("");
}
function X(e, t) {
  t !== "navigation" && (e.push("## 2. Isolation par tenant (OBLIGATOIRE)"), e.push(""), e.push("Le parametre `tenantId` (UUID) est **obligatoire** en query string. Il scope l'export aux donnees du tenant specifie. Sans ce parametre, l'API retourne une erreur 400."), e.push(""), e.push("---"), e.push(""));
}
function ee(e, t) {
  e.push(`## 3. Endpoint : ${t.name}`), e.push(""), e.push("```http"), e.push(`GET {baseUrl}${t.routeTemplate}`), e.push("Authorization: Bearer <accessToken>"), e.push("```"), e.push("");
}
function te(e, t) {
  if (t.length > 0) {
    e.push("**Parametres (query string)** :"), e.push(""), e.push("| Parametre | Type | Defaut | Description |"), e.push("|-----------|------|--------|-------------|");
    for (const s of t)
      e.push(`| \`${s.name}\` | ${s.type} | ${s.default} | ${s.description} |`);
    e.push("");
  } else
    e.push("**Aucun parametre** - appel direct sans query string."), e.push("");
}
const D = (e, t) => {
  const s = [], n = t ? "      " : "    ";
  for (let o = 0; o < e.fields.length; o++) {
    const c = e.fields[o];
    if (c.name.includes("[].")) continue;
    const x = o < e.fields.length - 1 ? "," : "";
    s.push(`${n}"${c.name}": ${Y(c.type)}${x}  // ${c.type}${c.nullable ? "?" : ""} - ${c.description}`);
  }
  return s;
}, ae = (e) => {
  const t = [];
  return t.push("**Reponse (paginee)** :"), t.push("```json"), t.push("{"), t.push('  "items": ['), t.push("    {"), t.push(...D(e, !0)), t.push("    }"), t.push("  ],"), t.push('  "page": 1,'), t.push('  "pageSize": 100,'), t.push('  "totalCount": 250,'), t.push('  "totalPages": 3,'), t.push('  "hasMore": true'), t.push("}"), t.push("```"), t;
}, re = (e) => {
  const t = [];
  return t.push("**Reponse (tableau direct, NON pagine)** :"), t.push("```json"), t.push("["), t.push("  {"), t.push(...D(e, !1)), t.push("  }"), t.push("]"), t.push("```"), t;
};
function ne(e, t) {
  return t ? ae(e) : re(e);
}
function se(e, t) {
  if (t) {
    const s = ne(t, t.paginated);
    e.push(...s), e.push("");
  }
}
function ie(e, t) {
  e.push(`**Rate limit** : ${t.defaultRateLimitPerMinute} requetes/minute | Page size max : ${t.defaultMaxPageSize}`), e.push(""), e.push("---"), e.push("");
}
function oe(e, t) {
  t?.paginated && (e.push("## 4. Pagination"), e.push(""), e.push("Boucle tant que `hasMore === true`, en incrementant `page`. Les resultats sont tries par `createdAt ASC`."), e.push(""), e.push("## 5. Synchronisation incrementale"), e.push(""), e.push("Utilise `modifiedSince` pour ne recuperer que les changements :"), e.push("1. Premiere synchro : appelle sans `modifiedSince` (recupere tout)"), e.push("2. Stocke `DateTime.UtcNow` du debut de la synchro"), e.push("3. Synchros suivantes : passe `modifiedSince=<timestamp-stocke>`"), e.push(""), e.push("---"), e.push(""));
}
function ce(e) {
  e.push("## 6. Rate Limiting"), e.push(""), e.push("Quand tu depasses la limite :"), e.push("```"), e.push("HTTP/1.1 429 Too Many Requests"), e.push("Retry-After: 42"), e.push("```"), e.push("Lis le header `Retry-After` et attends. Implemente un backoff exponentiel."), e.push(""), e.push("---"), e.push("");
}
function de(e) {
  e.push("## 7. Gestion des erreurs"), e.push(""), e.push("| HTTP | Action |"), e.push("|------|--------|"), e.push("| 200 | Traite les donnees |"), e.push("| 400 | tenantId manquant ou invalide |"), e.push("| 401 | Renouvelle le token et relance |"), e.push("| 403 | Acces export non accorde - contacte l'admin |"), e.push("| 404 | Tenant non trouve - verifie le tenantId |"), e.push("| 429 | Attends `Retry-After` secondes |"), e.push("| 500 | Retry avec backoff exponentiel |");
}
function pe(e) {
  const t = h[e.entityType], s = Q[e.code] || [], n = [];
  return n.push("## Contexte"), n.push(""), n.push(`Tu dois implementer un client HTTP qui consomme l'endpoint **${e.name}** de l'API DataExport de SmartStack en mode machine-to-machine (M2M). L'application s'authentifie avec un \`clientId\` et un \`clientSecret\`, obtient un token JWT, puis appelle l'endpoint d'export.`), n.push(""), n.push("---"), n.push(""), K(n), X(n, e.code), ee(n, e), te(n, s), se(n, t), ie(n, e), oe(n, t), ce(n), de(n), n.join(`
`);
}
function le(e) {
  const t = "https://your-api.smartstack.app", s = e.routeTemplate, n = h[e.entityType]?.paginated;
  let o = `curl -X GET "${t}${s}`;
  return n && (o += "?page=1&pageSize=100"), o += `" \\
  -H "Authorization: Bearer <API_KEY>" \\
  -H "Accept: application/json"`, o;
}
const me = (e) => {
  if (e.name === "modules") return [{ id: "...", code: "users", label: "Users" }];
  switch (e.type) {
    case "Guid":
      return "3fa85f64-5717-4562-b3fc-2c963f66afa6";
    case "string":
      return e.nullable ? null : `example-${e.name}`;
    case "boolean":
      return !0;
    case "int":
      return 42;
    case "DateTime":
      return e.nullable ? null : "2026-02-25T10:00:00Z";
    case "string[]":
      return ["value1", "value2"];
    case "Guid[]":
      return ["3fa85f64-5717-4562-b3fc-2c963f66afa6"];
    default:
      return "...";
  }
}, ue = (e) => {
  const t = {};
  for (const s of e.fields)
    s.name.includes("[].") || (t[s.name] = me(s));
  return t;
};
function he(e) {
  const t = h[e.entityType];
  if (!t) return "// Schema not available";
  const s = ue(t), n = t.paginated ? { items: [s], page: 1, pageSize: 100, totalCount: 1, totalPages: 1, hasMore: !1 } : [s];
  return JSON.stringify(n, null, 2);
}
function u({ text: e }) {
  const [t, s] = d(!1);
  return /* @__PURE__ */ a(
    "button",
    {
      onClick: async () => {
        await navigator.clipboard.writeText(e), s(!0), setTimeout(() => s(!1), 2e3);
      },
      className: "absolute top-2 right-2 p-1.5 rounded-md bg-[var(--bg-secondary)] hover:bg-[var(--bg-hover)] text-[var(--text-tertiary)] transition-colors",
      title: "Copy",
      children: t ? /* @__PURE__ */ a(J, { className: "h-4 w-4 text-[var(--success-text)]" }) : /* @__PURE__ */ a(W, { className: "h-4 w-4" })
    }
  );
}
function xe({ prompt: e }) {
  return /* @__PURE__ */ a("div", { className: "space-y-3", children: e.blocks.filter((t) => t.isEnabled !== !1).sort((t, s) => t.displayOrder - s.displayOrder).map((t) => /* @__PURE__ */ r("div", { className: "rounded-lg border border-[var(--border-color)] overflow-hidden", children: [
    /* @__PURE__ */ r("div", { className: "flex items-center gap-2 px-4 py-2 bg-[var(--bg-secondary)] border-b border-[var(--border-color)]", children: [
      /* @__PURE__ */ a("span", { className: "inline-flex items-center rounded-full bg-[var(--info-bg)] px-2 py-0.5 text-xs font-medium text-[var(--info-text)]", children: t.blockType }),
      t.label && /* @__PURE__ */ a("span", { className: "text-sm font-medium text-[var(--text-primary)]", children: t.label })
    ] }),
    /* @__PURE__ */ r("div", { className: "relative p-4", children: [
      /* @__PURE__ */ a(u, { text: t.content }),
      /* @__PURE__ */ a("pre", { className: "text-sm font-mono text-[var(--text-secondary)] whitespace-pre-wrap pr-10", children: t.content })
    ] })
  ] }, t.id)) });
}
function fe({ variables: e, t }) {
  return /* @__PURE__ */ r("div", { children: [
    /* @__PURE__ */ a("h4", { className: "text-sm font-medium text-[var(--text-tertiary)] mb-2", children: t("externalApps.apis.catalog.detail.variables") }),
    /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: e.map((s) => /* @__PURE__ */ a("code", { className: "rounded bg-[var(--bg-secondary)] px-2 py-1 text-xs font-mono text-[var(--color-primary-600)]", children: `{${s}}` }, s)) })
  ] });
}
function ye({ t: e, prompt: t }) {
  return /* @__PURE__ */ r("div", { className: "space-y-4", children: [
    /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
      /* @__PURE__ */ r("div", { children: [
        /* @__PURE__ */ a("h3", { className: "font-medium text-[var(--text-primary)]", children: t.name }),
        /* @__PURE__ */ r("p", { className: "text-sm text-[var(--text-tertiary)]", children: [
          "v",
          t.version,
          " · ",
          t.status,
          t.description && /* @__PURE__ */ r(v, { children: [
            " · ",
            t.description
          ] })
        ] })
      ] }),
      /* @__PURE__ */ a(
        "a",
        {
          href: `/administration/ai/skills/${t.id}`,
          className: "text-sm text-[var(--color-primary-600)] hover:underline",
          children: e("externalApps.apis.catalog.detail.viewPrompt")
        }
      )
    ] }),
    (t.blocks?.length ?? 0) > 0 && /* @__PURE__ */ a(xe, { prompt: t }),
    (t.variables?.length ?? 0) > 0 && /* @__PURE__ */ a(fe, { variables: t.variables, t: e })
  ] });
}
function ge({ t: e, endpoint: t, generatedPrompt: s }) {
  return /* @__PURE__ */ r("div", { className: "space-y-4", children: [
    /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
      /* @__PURE__ */ r("div", { children: [
        /* @__PURE__ */ a("h3", { className: "font-medium text-[var(--text-primary)]", children: e("externalApps.apis.catalog.detail.generatedPromptTitle") }),
        /* @__PURE__ */ a("p", { className: "text-sm text-[var(--text-tertiary)]", children: e("externalApps.apis.catalog.detail.generatedPromptHint", { code: `data-export-${t.code}` }) })
      ] }),
      /* @__PURE__ */ a(u, { text: s })
    ] }),
    /* @__PURE__ */ a("pre", { className: "rounded-lg bg-[var(--bg-secondary)] p-4 text-sm font-mono text-[var(--text-primary)] whitespace-pre-wrap overflow-x-auto max-h-[600px] overflow-y-auto leading-relaxed", children: s })
  ] });
}
async function ve(e) {
  const t = [
    `data-export-${e}`,
    `export-${e}`,
    e
  ];
  for (const s of t)
    try {
      const n = await _.skills.getByCode(s);
      if (n) return n;
    } catch {
    }
  return null;
}
function Ue() {
  const { t: e } = $("admin"), { endpointCode: t } = L(), s = R(), [n, o] = d(null), [c, x] = d(null), [f, b] = d(!1), [E, N] = d(!0), [T, A] = d(null);
  k(() => {
    let i = !1;
    return (async () => {
      try {
        N(!0);
        const p = await V.externalApps.getApiEndpoints();
        if (i) return;
        const g = p.find((l) => l.code === t);
        if (!g) {
          A("Endpoint not found");
          return;
        }
        o(g), b(!0);
        try {
          const l = await ve(g.code);
          !i && l && x(l);
        } catch {
        } finally {
          i || b(!1);
        }
      } catch (p) {
        i || A(p instanceof Error ? p.message : "Failed to load endpoint");
      } finally {
        i || N(!1);
      }
    })(), () => {
      i = !0;
    };
  }, [t]);
  const y = m(() => n ? h[n.entityType] : null, [n]), w = m(() => n ? le(n) : "", [n]), C = m(() => n ? he(n) : "", [n]), I = m(() => n ? pe(n) : "", [n]);
  return E ? /* @__PURE__ */ a("div", { className: "flex h-96 items-center justify-center", children: /* @__PURE__ */ a(S, { className: "h-8 w-8 animate-spin text-[var(--color-primary-600)]" }) }) : T || !n ? /* @__PURE__ */ r("div", { className: "space-y-4", children: [
    /* @__PURE__ */ r("button", { onClick: () => s(-1), className: "flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors", children: [
      /* @__PURE__ */ a(P, { className: "h-4 w-4" }),
      e("common:back")
    ] }),
    /* @__PURE__ */ a("div", { className: "rounded-lg border border-[var(--error-border)] bg-[var(--error-bg)] p-4", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
      /* @__PURE__ */ a(q, { className: "h-5 w-5 text-[var(--error-text)]" }),
      /* @__PURE__ */ a("p", { className: "text-[var(--error-text)]", children: T || "Endpoint not found" })
    ] }) })
  ] }) : /* @__PURE__ */ r("div", { className: "space-y-6", children: [
    /* @__PURE__ */ a(
      Z,
      {
        items: [
          { label: e("externalApps.navigation.api"), href: "/api" },
          { label: e("externalApps.apis.catalog.title"), href: "/api/apis/catalog" },
          { label: n.name }
        ]
      }
    ),
    /* @__PURE__ */ r("div", { className: "flex items-start gap-4", children: [
      /* @__PURE__ */ a("button", { onClick: () => s(-1), className: "mt-1 p-2 rounded-md hover:bg-[var(--bg-hover)] text-[var(--text-secondary)] transition-colors", children: /* @__PURE__ */ a(P, { className: "h-5 w-5" }) }),
      /* @__PURE__ */ r("div", { className: "flex-1", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
          /* @__PURE__ */ a(G, { className: "h-7 w-7 text-[var(--color-accent-600)]" }),
          /* @__PURE__ */ a("h1", { className: "text-3xl font-bold text-[var(--text-primary)]", children: n.name }),
          /* @__PURE__ */ a("div", { className: "inline-flex items-center gap-2 rounded-full px-2.5 py-0.5 text-xs font-medium", children: n.isActive ? /* @__PURE__ */ r(v, { children: [
            /* @__PURE__ */ a("div", { className: "h-2 w-2 rounded-full bg-[var(--success-text)]" }),
            /* @__PURE__ */ a("span", { className: "text-[var(--success-text)]", children: e("externalApps.apis.catalog.active") })
          ] }) : /* @__PURE__ */ r(v, { children: [
            /* @__PURE__ */ a("div", { className: "h-2 w-2 rounded-full bg-[var(--warning-text)]" }),
            /* @__PURE__ */ a("span", { className: "text-[var(--warning-text)]", children: e("externalApps.apis.catalog.inactive") })
          ] }) })
        ] }),
        n.description && /* @__PURE__ */ a("p", { className: "mt-2 text-[var(--text-secondary)]", children: n.description })
      ] })
    ] }),
    /* @__PURE__ */ r("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
      /* @__PURE__ */ r("div", { className: "card p-4 border border-[var(--border-color)]", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[var(--text-tertiary)] mb-1", children: [
          /* @__PURE__ */ a(M, { className: "h-4 w-4" }),
          /* @__PURE__ */ a("span", { className: "text-xs font-medium uppercase", children: e("externalApps.apis.catalog.columns.application") })
        ] }),
        /* @__PURE__ */ a("span", { className: "inline-flex items-center rounded-full bg-[var(--info-bg)] px-2.5 py-0.5 text-sm font-medium text-[var(--info-text)]", children: n.applicationLabel })
      ] }),
      /* @__PURE__ */ r("div", { className: "card p-4 border border-[var(--border-color)]", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[var(--text-tertiary)] mb-1", children: [
          /* @__PURE__ */ a(U, { className: "h-4 w-4" }),
          /* @__PURE__ */ a("span", { className: "text-xs font-medium uppercase", children: e("externalApps.apis.catalog.columns.module") })
        ] }),
        /* @__PURE__ */ a("span", { className: "text-sm font-medium text-[var(--text-primary)]", children: n.moduleLabel })
      ] }),
      /* @__PURE__ */ r("div", { className: "card p-4 border border-[var(--border-color)]", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[var(--text-tertiary)] mb-1", children: [
          /* @__PURE__ */ a(B, { className: "h-4 w-4" }),
          /* @__PURE__ */ a("span", { className: "text-xs font-medium uppercase", children: e("externalApps.apis.catalog.columns.rateLimit") })
        ] }),
        /* @__PURE__ */ r("span", { className: "text-sm font-medium text-[var(--text-primary)]", children: [
          n.defaultRateLimitPerMinute,
          "/min"
        ] })
      ] }),
      /* @__PURE__ */ r("div", { className: "card p-4 border border-[var(--border-color)]", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[var(--text-tertiary)] mb-1", children: [
          /* @__PURE__ */ a(j, { className: "h-4 w-4" }),
          /* @__PURE__ */ a("span", { className: "text-xs font-medium uppercase", children: e("externalApps.apis.catalog.columns.maxPageSize") })
        ] }),
        /* @__PURE__ */ a("span", { className: "text-sm font-medium text-[var(--text-primary)]", children: n.defaultMaxPageSize })
      ] })
    ] }),
    /* @__PURE__ */ r("div", { className: "card border border-[var(--border-color)]", children: [
      /* @__PURE__ */ a("div", { className: "px-6 py-4 border-b border-[var(--border-color)]", children: /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)]", children: e("externalApps.apis.catalog.detail.technical") }) }),
      /* @__PURE__ */ r("div", { className: "p-6 grid grid-cols-1 md:grid-cols-2 gap-6", children: [
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ a("label", { className: "text-xs font-medium uppercase text-[var(--text-tertiary)]", children: e("externalApps.apis.catalog.columns.route") }),
          /* @__PURE__ */ a("div", { className: "mt-1 flex items-center gap-2", children: /* @__PURE__ */ r("code", { className: "rounded-md bg-[var(--bg-secondary)] px-3 py-1.5 text-sm font-mono text-[var(--color-primary-600)]", children: [
            "GET ",
            n.routeTemplate
          ] }) })
        ] }),
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ a("label", { className: "text-xs font-medium uppercase text-[var(--text-tertiary)]", children: e("externalApps.apis.catalog.columns.permission") }),
          /* @__PURE__ */ r("div", { className: "mt-1 flex items-center gap-2", children: [
            /* @__PURE__ */ a(H, { className: "h-4 w-4 text-[var(--warning-text)]" }),
            /* @__PURE__ */ a("code", { className: "rounded-md bg-[var(--bg-secondary)] px-3 py-1.5 text-sm font-mono text-[var(--text-primary)]", children: n.requiredPermission })
          ] })
        ] }),
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ a("label", { className: "text-xs font-medium uppercase text-[var(--text-tertiary)]", children: e("externalApps.apis.catalog.columns.entityType") }),
          /* @__PURE__ */ r("div", { className: "mt-1 flex items-center gap-2", children: [
            /* @__PURE__ */ a(U, { className: "h-4 w-4 text-[var(--text-tertiary)]" }),
            /* @__PURE__ */ a("span", { className: "text-sm font-medium text-[var(--text-primary)]", children: n.entityType })
          ] })
        ] }),
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ a("label", { className: "text-xs font-medium uppercase text-[var(--text-tertiary)]", children: e("externalApps.apis.catalog.columns.code") }),
          /* @__PURE__ */ a("div", { className: "mt-1", children: /* @__PURE__ */ a("code", { className: "rounded-md bg-[var(--bg-secondary)] px-3 py-1.5 text-sm font-mono text-[var(--text-primary)]", children: n.code }) })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ r("div", { className: "card border border-[var(--border-color)]", children: [
      /* @__PURE__ */ a("div", { className: "px-6 py-4 border-b border-[var(--border-color)]", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ a(z, { className: "h-5 w-5 text-[var(--text-tertiary)]" }),
        /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)]", children: e("externalApps.apis.catalog.detail.curlExample") })
      ] }) }),
      /* @__PURE__ */ r("div", { className: "p-6 relative", children: [
        /* @__PURE__ */ a(u, { text: w }),
        /* @__PURE__ */ a("pre", { className: "rounded-lg bg-[var(--bg-secondary)] p-4 text-sm font-mono text-[var(--text-primary)] overflow-x-auto whitespace-pre-wrap", children: w })
      ] })
    ] }),
    y && /* @__PURE__ */ r("div", { className: "card border border-[var(--border-color)]", children: [
      /* @__PURE__ */ a("div", { className: "px-6 py-4 border-b border-[var(--border-color)]", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ a(F, { className: "h-5 w-5 text-[var(--text-tertiary)]" }),
          /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)]", children: e("externalApps.apis.catalog.detail.responseSchema") })
        ] }),
        y.paginated && /* @__PURE__ */ a("span", { className: "inline-flex items-center rounded-full bg-[var(--info-bg)] px-2.5 py-0.5 text-xs font-medium text-[var(--info-text)]", children: e("externalApps.apis.catalog.detail.paginated") })
      ] }) }),
      /* @__PURE__ */ a("div", { className: "overflow-x-auto", children: /* @__PURE__ */ r("table", { className: "w-full", children: [
        /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ r("tr", { className: "bg-[var(--bg-secondary)]", children: [
          /* @__PURE__ */ a("th", { className: "text-left px-6 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider", children: e("externalApps.apis.catalog.detail.field") }),
          /* @__PURE__ */ a("th", { className: "text-left px-6 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider", children: e("externalApps.apis.catalog.detail.type") }),
          /* @__PURE__ */ a("th", { className: "text-left px-6 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider", children: e("externalApps.apis.catalog.detail.nullable") }),
          /* @__PURE__ */ a("th", { className: "text-left px-6 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider", children: e("externalApps.apis.catalog.detail.fieldDescription") })
        ] }) }),
        /* @__PURE__ */ a("tbody", { className: "divide-y divide-[var(--border-color)]", children: y.fields.map((i) => /* @__PURE__ */ r("tr", { className: "hover:bg-[var(--bg-hover)] transition-colors", children: [
          /* @__PURE__ */ a("td", { className: "px-6 py-3", children: /* @__PURE__ */ a("code", { className: "text-sm font-mono text-[var(--color-primary-600)]", children: i.name }) }),
          /* @__PURE__ */ a("td", { className: "px-6 py-3", children: /* @__PURE__ */ a("code", { className: "rounded bg-[var(--bg-secondary)] px-2 py-0.5 text-xs font-mono text-[var(--text-secondary)]", children: i.type }) }),
          /* @__PURE__ */ a("td", { className: "px-6 py-3 text-sm text-[var(--text-secondary)]", children: i.nullable ? "?" : "-" }),
          /* @__PURE__ */ a("td", { className: "px-6 py-3 text-sm text-[var(--text-secondary)]", children: i.description })
        ] }, i.name)) })
      ] }) }),
      /* @__PURE__ */ r("div", { className: "border-t border-[var(--border-color)] p-6", children: [
        /* @__PURE__ */ a("h3", { className: "text-sm font-semibold text-[var(--text-tertiary)] uppercase mb-3", children: e("externalApps.apis.catalog.detail.jsonExample") }),
        /* @__PURE__ */ r("div", { className: "relative", children: [
          /* @__PURE__ */ a(u, { text: C }),
          /* @__PURE__ */ a("pre", { className: "rounded-lg bg-[var(--bg-secondary)] p-4 text-sm font-mono text-[var(--text-primary)] overflow-x-auto max-h-96 overflow-y-auto", children: C })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ r("div", { className: "card border border-[var(--border-color)]", children: [
      /* @__PURE__ */ r("div", { className: "px-6 py-4 border-b border-[var(--border-color)]", children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
          /* @__PURE__ */ a(O, { className: "h-5 w-5 text-[var(--color-accent-600)]" }),
          /* @__PURE__ */ a("h2", { className: "text-lg font-semibold text-[var(--text-primary)]", children: e("externalApps.apis.catalog.detail.dedicatedPrompt") })
        ] }),
        /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-[var(--text-tertiary)]", children: e("externalApps.apis.catalog.detail.promptDescription") })
      ] }),
      /* @__PURE__ */ r("div", { className: "p-6", children: [
        f && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[var(--text-tertiary)]", children: [
          /* @__PURE__ */ a(S, { className: "h-4 w-4 animate-spin" }),
          /* @__PURE__ */ a("span", { className: "text-sm", children: e("common:loading") })
        ] }),
        !f && c && /* @__PURE__ */ a(ye, { t: e, prompt: c }),
        !f && !c && /* @__PURE__ */ a(ge, { t: e, endpoint: n, generatedPrompt: I })
      ] })
    ] })
  ] });
}
export {
  Ue as ApiCatalogDetailPage
};
//# sourceMappingURL=ApiCatalogDetailPage-C8wwDt6g.js.map
