import { jsxs as r, jsx as e } from "react/jsx-runtime";
import { useState as m } from "react";
import { Link as T } from "react-router-dom";
import { useTranslation as C } from "react-i18next";
import { Building2 as x, Users as A, Briefcase as P, MapPin as b, ArrowLeft as j, ChevronDown as u, Search as S, GitMerge as p, Plus as k, Check as v, Cloud as E, Edit2 as $, PowerOff as B, Power as M, Trash2 as G, AlertTriangle as L, History as R, Info as q } from "lucide-react";
const h = [
  { name: "Acme Corporation SA", code: "ACME", description: "Siège principal Suisse", source: "entra", userCount: 42, status: "active" },
  { name: "TechVision GmbH", code: "TECHV", description: "Filiale Allemagne", source: "entra", userCount: 18, status: "active" },
  { name: "InnoSuisse Sàrl", code: "INNOS", description: "Division Innovation", source: "manual", userCount: 7, status: "active" },
  { name: "DataCorp SAS", code: "DATAC", description: "", source: "manual", userCount: 0, status: "inactive" },
  { name: "AlphaNet BV", code: "ALPHA", description: "Partenaire Benelux", source: "manual", userCount: 3, status: "active" }
], f = [
  { name: "Siège Zurich", code: "ZRH", city: "Zurich", country: "CH", source: "entra", userCount: 34, status: "active" },
  { name: "Bureau Genève", code: "GVA", city: "Genève", country: "CH", source: "manual", userCount: 12, status: "active" },
  { name: "Office Berlin", code: "BER", city: "Berlin", country: "DE", source: "entra", userCount: 8, status: "active" }
], U = [
  { date: "2026-02-20", target: "TechVision GmbH", sources: ["TechVision AG", "TechVision Ltd"], usersAffected: 6, operator: "admin@acme.ch" },
  { date: "2026-01-15", target: "Département Marketing", sources: ["Marketing Digital"], usersAffected: 3, operator: "rh@acme.ch" }
], D = [
  { method: "GET", path: "/api/administration/users/references/companies", handler: "GetCompanies", permission: "administration.users.read" },
  { method: "POST", path: "/api/administration/users/references/companies", handler: "CreateCompany", permission: "administration.users.update" },
  { method: "PUT", path: "/api/administration/users/references/companies/{id}", handler: "UpdateCompany", permission: "administration.users.update" },
  { method: "PATCH", path: "/api/administration/users/references/companies/{id}/activate", handler: "ActivateCompany", permission: "administration.users.update" },
  { method: "PATCH", path: "/api/administration/users/references/companies/{id}/deactivate", handler: "DeactivateCompany", permission: "administration.users.update" },
  { method: "DELETE", path: "/api/administration/users/references/companies/{id}", handler: "DeleteCompany", permission: "administration.users.delete" },
  { method: "GET", path: "/api/administration/users/references/departments", handler: "GetDepartments", permission: "administration.users.read" },
  { method: "POST", path: "/api/administration/users/references/departments", handler: "CreateDepartment", permission: "administration.users.update" },
  { method: "PUT", path: "/api/administration/users/references/departments/{id}", handler: "UpdateDepartment", permission: "administration.users.update" },
  { method: "GET", path: "/api/administration/users/references/job-titles", handler: "GetJobTitles", permission: "administration.users.read" },
  { method: "POST", path: "/api/administration/users/references/job-titles", handler: "CreateJobTitle", permission: "administration.users.update" },
  { method: "PUT", path: "/api/administration/users/references/job-titles/{id}", handler: "UpdateJobTitle", permission: "administration.users.update" },
  { method: "GET", path: "/api/administration/users/references/offices", handler: "GetOffices", permission: "administration.users.read" },
  { method: "POST", path: "/api/administration/users/references/offices", handler: "CreateOffice", permission: "administration.users.update" },
  { method: "PUT", path: "/api/administration/users/references/offices/{id}", handler: "UpdateOffice", permission: "administration.users.update" },
  { method: "POST", path: "/api/administration/users/references/merge", handler: "MergeReferences", permission: "administration.users.update" },
  { method: "POST", path: "/api/administration/users/references/merge/preview", handler: "PreviewMerge", permission: "administration.users.read" },
  { method: "GET", path: "/api/administration/users/references/merge/history", handler: "GetMergeHistory", permission: "administration.users.read" }
], H = [
  { id: "BR-001", category: "Validation", statement: "Le code est obligatoire à la création et ne peut pas être modifié après coup — il sert d'identifiant technique unique." },
  { id: "BR-002", category: "Validation", statement: "Le nom d'affichage est obligatoire pour toute référence (société, département, poste, bureau)." },
  { id: "BR-003", category: "Scope", statement: "Les référentiels sont strictement scoped au tenant sélectionné — aucune vue globale multi-tenant n'est possible." },
  { id: "BR-004", category: "Sécurité", statement: "Les références synchronisées depuis Microsoft Entra ID sont en lecture seule : nom et code ne peuvent pas être modifiés manuellement." },
  { id: "BR-005", category: "Logique métier", statement: "Une référence ne peut être supprimée que si aucun utilisateur ne lui est affecté (userCount = 0). Une référence Entra ne peut jamais être supprimée manuellement." },
  { id: "BR-006", category: "Fusion", statement: "La fusion (Merge) transfère tous les utilisateurs des référentiels source vers la référence cible, puis désactive les sources fusionnées." },
  { id: "BR-007", category: "Fusion", statement: "Une prévisualisation est disponible avant toute fusion : elle indique le nombre exact d'utilisateurs qui seront réaffectés." },
  { id: "BR-008", category: "Bureaux", statement: "Les bureaux disposent de champs supplémentaires (adresse, ville, pays) qui n'existent pas pour les autres types de référentiel." },
  { id: "BR-009", category: "Logique métier", statement: "Une référence désactivée reste visible dans la liste mais n'est plus proposée lors de l'affectation des utilisateurs." }
], O = {
  GET: "bg-[var(--info-bg)] text-[var(--info-text)] border-[var(--info-border)]",
  POST: "bg-[var(--success-bg)] text-[var(--success-text)] border-[var(--success-border)]",
  PUT: "bg-[var(--warning-bg)] text-[var(--warning-text)] border-[var(--warning-border)]",
  PATCH: "bg-[var(--warning-bg)] text-[var(--warning-text)] border-[var(--warning-border)]",
  DELETE: "bg-[var(--error-bg)] text-[var(--error-text)] border-[var(--error-border)]"
}, V = {
  Validation: "bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20",
  Scope: "bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20",
  Sécurité: "bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20",
  "Logique métier": "bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20",
  Fusion: "bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20",
  Bureaux: "bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20"
};
function s({ text: t }) {
  return /* @__PURE__ */ r("div", { className: "flex items-start gap-2 p-2.5 rounded-lg border-l-2 border-[var(--color-accent-500)] bg-[var(--bg-secondary)] text-sm text-[var(--text-secondary)]", children: [
    /* @__PURE__ */ e(q, { className: "w-4 h-4 mt-0.5 flex-shrink-0 text-[var(--color-accent-600)]" }),
    /* @__PURE__ */ e("span", { children: t })
  ] });
}
function z() {
  const { t } = C("docsAdministrationUsersReferences"), [i, g] = m("companies"), [c, y] = m(!1), [l, N] = m(!1), w = [
    { id: "companies", label: t("tabs.companies"), icon: x, count: h.length },
    { id: "departments", label: t("tabs.departments"), icon: A, count: 8 },
    { id: "jobTitles", label: t("tabs.jobTitles"), icon: P, count: 12 },
    { id: "offices", label: t("tabs.offices"), icon: b, count: f.length }
  ];
  return /* @__PURE__ */ r("div", { className: "space-y-8", children: [
    /* @__PURE__ */ r(
      T,
      {
        to: "/docs/business/administration/users",
        className: "inline-flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--color-accent-600)] transition-colors",
        children: [
          /* @__PURE__ */ e(j, { className: "w-4 h-4" }),
          t("nav.backToUsers")
        ]
      }
    ),
    /* @__PURE__ */ r("div", { children: [
      /* @__PURE__ */ r("h1", { className: "text-3xl font-bold mb-4 flex items-center gap-3", children: [
        /* @__PURE__ */ e(x, { className: "w-8 h-8 text-[var(--color-accent-600)]" }),
        t("title")
      ] }),
      /* @__PURE__ */ e("p", { className: "text-xl text-[var(--color-accent-600)] font-medium mb-2", children: t("summary") }),
      /* @__PURE__ */ e("p", { className: "text-lg text-[var(--text-secondary)]", children: t("subtitle") }),
      /* @__PURE__ */ r("div", { className: "flex gap-4 mt-3 text-sm text-[var(--text-secondary)]", children: [
        /* @__PURE__ */ r("span", { children: [
          "9 ",
          t("header.businessRules")
        ] }),
        /* @__PURE__ */ r("span", { children: [
          "18 ",
          t("header.apiEndpoints")
        ] }),
        /* @__PURE__ */ r("span", { children: [
          "4 ",
          t("header.referenceTypes")
        ] })
      ] })
    ] }),
    /* @__PURE__ */ r("section", { id: "objectif", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "1" }),
        t("sections.objective")
      ] }),
      /* @__PURE__ */ e("div", { className: "p-6 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] leading-relaxed", children: t("objective") }) })
    ] }),
    /* @__PURE__ */ r("section", { id: "acces", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "2" }),
        t("sections.access")
      ] }),
      /* @__PURE__ */ r("div", { className: "p-6 space-y-4 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("div", { className: "text-sm font-medium text-[var(--text-secondary)] mb-2", children: t("access.navigation") }),
          /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-sm flex-wrap", children: [
            /* @__PURE__ */ e("span", { className: "px-3 py-1.5 rounded-lg bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border-color)] font-medium", children: "Platform" }),
            /* @__PURE__ */ e("span", { className: "text-[var(--text-tertiary)]", children: "›" }),
            /* @__PURE__ */ e("span", { className: "px-3 py-1.5 rounded-lg bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border-color)] font-medium", children: "Administration" }),
            /* @__PURE__ */ e("span", { className: "text-[var(--text-tertiary)]", children: "›" }),
            /* @__PURE__ */ e("span", { className: "px-3 py-1.5 rounded-lg bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border-color)] font-medium", children: t("access.usersModule") }),
            /* @__PURE__ */ e("span", { className: "text-[var(--text-tertiary)]", children: "›" }),
            /* @__PURE__ */ e("span", { className: "px-3 py-1.5 rounded-lg bg-[var(--color-accent-600)]/10 text-[var(--color-accent-700)] border border-[var(--color-accent-500)]/20 font-medium", children: t("title") })
          ] })
        ] }),
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("div", { className: "text-sm font-medium text-[var(--text-secondary)] mb-1", children: "URL" }),
          /* @__PURE__ */ e("code", { className: "text-sm px-3 py-1.5 bg-[var(--bg-secondary)] rounded-lg break-all", children: "/administration/users/references" })
        ] }),
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("div", { className: "text-sm font-medium text-[var(--text-secondary)] mb-1", children: t("access.permission") }),
          /* @__PURE__ */ e("code", { className: "text-sm px-3 py-1.5 bg-[var(--bg-secondary)] rounded-lg break-all", children: "administration.users.read" })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ r("section", { id: "interface", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "3" }),
        t("sections.interface")
      ] }),
      /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] mb-4", children: t("interface.desc") }),
      /* @__PURE__ */ r("div", { className: "overflow-hidden mb-4 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
        /* @__PURE__ */ r("div", { className: "p-4 border-b border-[var(--border-color)] bg-[var(--bg-secondary)]", children: [
          /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-xs text-[var(--text-secondary)] mb-2", children: [
            /* @__PURE__ */ e("span", { children: "Administration" }),
            /* @__PURE__ */ e("span", { children: "›" }),
            /* @__PURE__ */ e("span", { children: t("access.usersModule") }),
            /* @__PURE__ */ e("span", { children: "›" }),
            /* @__PURE__ */ e("span", { className: "text-[var(--text-primary)]", children: t("title") })
          ] }),
          /* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ r("div", { children: [
            /* @__PURE__ */ e("h3", { className: "text-lg font-semibold", children: t("title") }),
            /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: t("interface.headerSubtitle") })
          ] }) })
        ] }),
        /* @__PURE__ */ e("div", { className: "px-4 pt-4 pb-2", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3 p-3 rounded-lg border border-[var(--border-color)] bg-[var(--bg-secondary)] text-sm", children: [
          /* @__PURE__ */ e(x, { className: "w-4 h-4 text-[var(--text-secondary)]" }),
          /* @__PURE__ */ e("span", { className: "font-medium text-[var(--text-primary)]", children: "Acme Corp SA" }),
          /* @__PURE__ */ e(u, { className: "w-4 h-4 text-[var(--text-tertiary)] ml-auto" })
        ] }) }),
        /* @__PURE__ */ e("div", { className: "flex gap-0 border-b border-[var(--border-color)] px-4", children: w.map((a) => {
          const n = a.icon;
          return /* @__PURE__ */ r(
            "button",
            {
              onClick: () => g(a.id),
              className: `flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors border-b-2 -mb-px ${i === a.id ? "border-[var(--color-accent-500)] text-[var(--color-accent-600)]" : "border-transparent text-[var(--text-secondary)]"}`,
              children: [
                /* @__PURE__ */ e(n, { className: "w-4 h-4" }),
                a.label,
                /* @__PURE__ */ e("span", { className: "text-xs px-1.5 py-0.5 rounded-full bg-[var(--bg-secondary)] text-[var(--text-secondary)]", children: a.count })
              ]
            },
            a.id
          );
        }) }),
        /* @__PURE__ */ r("div", { className: "flex items-center gap-3 p-4", children: [
          /* @__PURE__ */ r("div", { className: "relative flex-1 max-w-xs", children: [
            /* @__PURE__ */ e(S, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-tertiary)]" }),
            /* @__PURE__ */ e("div", { className: "pl-9 pr-4 py-2 rounded-lg border border-[var(--border-color)] bg-[var(--bg-primary)] text-sm text-[var(--text-tertiary)]", children: t("interface.searchPlaceholder") })
          ] }),
          /* @__PURE__ */ e("div", { className: "px-3 py-2 rounded-lg border border-[var(--border-color)] bg-[var(--bg-primary)] text-sm text-[var(--text-secondary)]", children: t("interface.statusFilter") }),
          /* @__PURE__ */ e("div", { className: "px-3 py-2 rounded-lg border border-[var(--border-color)] bg-[var(--bg-primary)] text-sm text-[var(--text-secondary)]", children: t("interface.sourceFilter") }),
          /* @__PURE__ */ r("div", { className: "flex items-center gap-1 ml-auto", children: [
            /* @__PURE__ */ r(
              "button",
              {
                onClick: () => y(!c),
                className: `flex items-center gap-2 px-3 py-2 rounded-lg text-sm border transition-colors ${c ? "bg-[var(--warning-bg)] text-[var(--warning-text)] border-[var(--warning-border)]" : "bg-[var(--bg-secondary)] text-[var(--text-secondary)] border-[var(--border-color)]"}`,
                children: [
                  /* @__PURE__ */ e(p, { className: "w-4 h-4" }),
                  t("interface.mergeMode")
                ]
              }
            ),
            /* @__PURE__ */ r("button", { className: "flex items-center gap-2 px-3 py-2 rounded-lg bg-[var(--color-accent-600)] text-white text-sm", children: [
              /* @__PURE__ */ e(k, { className: "w-4 h-4" }),
              t("interface.addButton")
            ] })
          ] })
        ] }),
        /* @__PURE__ */ e("div", { className: "px-4 pb-4", children: /* @__PURE__ */ e("div", { className: "border border-[var(--border-color)] rounded-lg overflow-hidden", children: /* @__PURE__ */ r("table", { className: "w-full text-sm", children: [
          /* @__PURE__ */ e("thead", { className: "bg-[var(--bg-secondary)]", children: /* @__PURE__ */ r("tr", { children: [
            c && /* @__PURE__ */ e("th", { className: "w-10 px-4 py-3" }),
            /* @__PURE__ */ e("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase", children: t("interface.columns.name") }),
            /* @__PURE__ */ e("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase", children: t("interface.columns.code") }),
            /* @__PURE__ */ e("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase", children: t("interface.columns.source") }),
            /* @__PURE__ */ e("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase", children: t("interface.columns.users") }),
            /* @__PURE__ */ e("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase", children: t("interface.columns.status") }),
            i === "offices" && /* @__PURE__ */ e("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase", children: t("interface.columns.location") }),
            /* @__PURE__ */ e("th", { className: "text-right px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase", children: t("interface.columns.actions") })
          ] }) }),
          /* @__PURE__ */ e("tbody", { className: "divide-y divide-[var(--border-color)]", children: (i === "offices" ? f : h).map((a, n) => {
            const o = a.source === "entra", d = a.status === "active";
            return /* @__PURE__ */ r("tr", { className: "hover:bg-[var(--bg-hover)] transition-colors", children: [
              c && /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: `w-4 h-4 rounded border-2 ${n === 1 ? "bg-[var(--color-accent-500)] border-[var(--color-accent-500)]" : "border-[var(--border-color)]"} flex items-center justify-center`, children: n === 1 && /* @__PURE__ */ e(v, { className: "w-3 h-3 text-white" }) }) }),
              /* @__PURE__ */ r("td", { className: "px-4 py-3", children: [
                /* @__PURE__ */ e("div", { className: "font-medium text-[var(--text-primary)]", children: a.name }),
                "description" in a && a.description && /* @__PURE__ */ e("div", { className: "text-xs text-[var(--text-tertiary)]", children: a.description })
              ] }),
              /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e("code", { className: "text-xs bg-[var(--bg-secondary)] px-2 py-0.5 rounded break-all", children: a.code }) }),
              /* @__PURE__ */ e("td", { className: "px-4 py-3", children: o ? /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-[var(--info-bg)] text-[var(--info-text)]", children: [
                /* @__PURE__ */ e(E, { className: "w-3 h-3" }),
                "Entra"
              ] }) : /* @__PURE__ */ e("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-[var(--bg-secondary)] text-[var(--text-secondary)]", children: t("interface.sourceManual") }) }),
              /* @__PURE__ */ e("td", { className: "px-4 py-3 text-[var(--text-primary)]", children: a.userCount }),
              /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e("span", { className: `inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${d ? "bg-[var(--success-bg)] text-[var(--success-text)] border border-[var(--success-border)]" : "bg-[var(--bg-secondary)] text-[var(--text-secondary)] border border-[var(--border-color)]"}`, children: t(d ? "interface.statusActive" : "interface.statusInactive") }) }),
              i === "offices" && /* @__PURE__ */ e("td", { className: "px-4 py-3 text-sm text-[var(--text-secondary)]", children: "city" in a ? `${a.city}, ${a.country}` : "—" }),
              /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-end gap-1", children: [
                !o && /* @__PURE__ */ e("button", { className: "p-1.5 rounded hover:bg-[var(--bg-secondary)] text-[var(--text-secondary)]", children: /* @__PURE__ */ e($, { className: "w-3.5 h-3.5" }) }),
                /* @__PURE__ */ e("button", { className: `p-1.5 rounded hover:bg-[var(--bg-secondary)] ${d ? "text-[var(--warning-text)]" : "text-[var(--success-text)]"}`, children: d ? /* @__PURE__ */ e(B, { className: "w-3.5 h-3.5" }) : /* @__PURE__ */ e(M, { className: "w-3.5 h-3.5" }) }),
                !o && a.userCount === 0 && /* @__PURE__ */ e("button", { className: "p-1.5 rounded hover:bg-[var(--bg-secondary)] text-[var(--error-text)]", children: /* @__PURE__ */ e(G, { className: "w-3.5 h-3.5" }) }),
                o && /* @__PURE__ */ e("span", { className: "text-xs text-[var(--text-tertiary)] italic px-2", children: t("interface.entraManaged") })
              ] }) })
            ] }, `${a.source}-${a.name}-${n}`);
          }) })
        ] }) }) }),
        c && /* @__PURE__ */ r("div", { className: "mx-4 mb-4 p-3 rounded-lg bg-[var(--warning-bg)] border border-[var(--warning-border)] flex items-center gap-3", children: [
          /* @__PURE__ */ e(L, { className: "w-4 h-4 text-[var(--warning-text)]" }),
          /* @__PURE__ */ r("span", { className: "text-sm text-[var(--warning-text)]", children: [
            "1 ",
            t("interface.mergeSelected")
          ] }),
          /* @__PURE__ */ r("button", { className: "ml-auto flex items-center gap-2 px-3 py-1.5 rounded-lg bg-[var(--color-accent-600)] text-white text-sm", children: [
            /* @__PURE__ */ e(p, { className: "w-4 h-4" }),
            t("interface.mergeTo")
          ] })
        ] })
      ] }),
      /* @__PURE__ */ r("div", { className: "space-y-2", children: [
        /* @__PURE__ */ e(s, { text: t("annotations.tenantScope") }),
        /* @__PURE__ */ e(s, { text: t("annotations.tabs") }),
        /* @__PURE__ */ e(s, { text: t("annotations.entraProtection") }),
        /* @__PURE__ */ e(s, { text: t("annotations.deleteCondition") }),
        /* @__PURE__ */ e(s, { text: t("annotations.mergeMode") })
      ] })
    ] }),
    /* @__PURE__ */ r("section", { id: "formulaire", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "4" }),
        t("sections.createForm")
      ] }),
      /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] mb-4", children: t("form.desc") }),
      /* @__PURE__ */ r("div", { className: "p-6 mb-4 max-w-lg bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
        /* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: t("form.title") }),
        /* @__PURE__ */ r("div", { className: "space-y-4", children: [
          /* @__PURE__ */ r("div", { children: [
            /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: [
              t("form.codeLabel"),
              " *"
            ] }),
            /* @__PURE__ */ e("div", { className: "px-3 py-2 rounded-lg border border-[var(--border-color)] bg-[var(--bg-secondary)] text-sm text-[var(--text-tertiary)]", children: t("form.codePlaceholder") }),
            /* @__PURE__ */ e("p", { className: "text-xs text-[var(--text-tertiary)] mt-1", children: t("form.codeHint") })
          ] }),
          /* @__PURE__ */ r("div", { children: [
            /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: [
              t("form.nameLabel"),
              " *"
            ] }),
            /* @__PURE__ */ e("div", { className: "px-3 py-2 rounded-lg border border-[var(--color-accent-500)] bg-[var(--bg-primary)] text-sm text-[var(--text-primary)]", children: "Acme Corporation SA" })
          ] }),
          /* @__PURE__ */ r("div", { children: [
            /* @__PURE__ */ e("label", { className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: t("form.descriptionLabel") }),
            /* @__PURE__ */ e("div", { className: "px-3 py-2 rounded-lg border border-[var(--border-color)] bg-[var(--bg-primary)] text-sm text-[var(--text-tertiary)] h-16", children: t("form.descriptionPlaceholder") })
          ] }),
          /* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)] border border-[var(--border-color)] text-xs text-[var(--text-secondary)]", children: [
            /* @__PURE__ */ e(b, { className: "w-3.5 h-3.5 inline mr-1" }),
            t("form.officeFieldsNote")
          ] })
        ] }),
        /* @__PURE__ */ r("div", { className: "flex justify-end gap-3 mt-6", children: [
          /* @__PURE__ */ e("button", { className: "px-4 py-2 rounded-lg bg-[var(--bg-secondary)] text-[var(--text-secondary)] text-sm", children: t("form.cancel") }),
          /* @__PURE__ */ e("button", { className: "px-4 py-2 rounded-lg bg-[var(--color-accent-600)] text-white text-sm", children: t("form.save") })
        ] })
      ] }),
      /* @__PURE__ */ r("div", { className: "space-y-2", children: [
        /* @__PURE__ */ e(s, { text: t("annotations.codeImmutable") }),
        /* @__PURE__ */ e(s, { text: t("annotations.officeExtraFields") })
      ] })
    ] }),
    /* @__PURE__ */ r("section", { id: "fusion", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "5" }),
        t("sections.mergeFeature")
      ] }),
      /* @__PURE__ */ e("p", { className: "text-[var(--text-secondary)] mb-4", children: t("merge.desc") }),
      /* @__PURE__ */ r("div", { className: "grid md:grid-cols-2 gap-6 mb-4", children: [
        /* @__PURE__ */ r("div", { className: "p-5 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
          /* @__PURE__ */ r("h3", { className: "font-semibold mb-3 flex items-center gap-2", children: [
            /* @__PURE__ */ e(p, { className: "w-4 h-4 text-[var(--warning-text)]" }),
            t("merge.previewTitle")
          ] }),
          /* @__PURE__ */ r("div", { className: "space-y-3 text-sm", children: [
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ e("div", { className: "text-[var(--text-secondary)] mb-1", children: t("merge.target") }),
              /* @__PURE__ */ e("div", { className: "p-2 rounded-lg bg-[var(--success-bg)] border border-[var(--success-border)] font-medium text-[var(--success-text)]", children: "TechVision GmbH" })
            ] }),
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ e("div", { className: "text-[var(--text-secondary)] mb-1", children: t("merge.sources") }),
              /* @__PURE__ */ r("div", { className: "space-y-1", children: [
                /* @__PURE__ */ e("div", { className: "p-2 rounded-lg bg-[var(--error-bg)] border border-[var(--error-border)] text-[var(--text-primary)]", children: "TechVision AG" }),
                /* @__PURE__ */ e("div", { className: "p-2 rounded-lg bg-[var(--error-bg)] border border-[var(--error-border)] text-[var(--text-primary)]", children: "TechVision Ltd" })
              ] })
            ] }),
            /* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-[var(--warning-bg)] border border-[var(--warning-border)] text-[var(--warning-text)]", children: [
              /* @__PURE__ */ r("span", { className: "font-semibold", children: [
                "6 ",
                t("merge.usersAffected")
              ] }),
              " — ",
              t("merge.usersWillBeReassigned")
            ] })
          ] })
        ] }),
        /* @__PURE__ */ r("div", { className: "p-5 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
          /* @__PURE__ */ r("h3", { className: "font-semibold mb-3 flex items-center gap-2", children: [
            /* @__PURE__ */ e(R, { className: "w-4 h-4 text-[var(--text-secondary)]" }),
            t("merge.historyTitle")
          ] }),
          /* @__PURE__ */ e("div", { className: "space-y-3", children: U.map((a, n) => /* @__PURE__ */ r("div", { className: "p-3 rounded-lg bg-[var(--bg-secondary)] border border-[var(--border-color)] text-sm", children: [
            /* @__PURE__ */ r("div", { className: "flex items-start justify-between", children: [
              /* @__PURE__ */ r("div", { children: [
                /* @__PURE__ */ e("div", { className: "font-medium text-[var(--text-primary)]", children: a.target }),
                /* @__PURE__ */ r("div", { className: "text-xs text-[var(--text-tertiary)]", children: [
                  "← ",
                  a.sources.join(", ")
                ] })
              ] }),
              /* @__PURE__ */ e("span", { className: "text-xs text-[var(--text-tertiary)]", children: a.date })
            ] }),
            /* @__PURE__ */ r("div", { className: "mt-1 text-xs text-[var(--text-secondary)]", children: [
              a.usersAffected,
              " ",
              t("merge.usersAffected"),
              " · ",
              a.operator
            ] })
          ] }, `merge-${a.date}-${n}`)) })
        ] })
      ] }),
      /* @__PURE__ */ r("div", { className: "space-y-2", children: [
        /* @__PURE__ */ e(s, { text: t("annotations.mergePreview") }),
        /* @__PURE__ */ e(s, { text: t("annotations.mergeHistory") }),
        /* @__PURE__ */ e(s, { text: t("annotations.mergeIrreversible") })
      ] })
    ] }),
    /* @__PURE__ */ r("section", { id: "usecases", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "6" }),
        t("sections.useCases")
      ] }),
      /* @__PURE__ */ e("div", { className: "grid md:grid-cols-3 gap-4", children: ["uc1", "uc2", "uc3"].map((a) => /* @__PURE__ */ r("div", { className: "p-5 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
        /* @__PURE__ */ e("div", { className: "font-semibold mb-1 text-[var(--color-accent-600)]", children: t(`useCases.${a}.persona`) }),
        /* @__PURE__ */ e("div", { className: "text-sm font-medium text-[var(--text-primary)] mb-2", children: t(`useCases.${a}.goal`) }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: t(`useCases.${a}.scenario`) })
      ] }, a)) })
    ] }),
    /* @__PURE__ */ r("section", { id: "fonctionnalites", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "7" }),
        t("sections.features")
      ] }),
      /* @__PURE__ */ e("div", { className: "grid md:grid-cols-2 gap-4", children: ["f1", "f2", "f3", "f4", "f5"].map((a) => /* @__PURE__ */ r("div", { className: "p-5 flex gap-3 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
        /* @__PURE__ */ e("div", { className: "w-8 h-8 rounded-lg bg-[var(--color-accent-600)]/10 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e(v, { className: "w-4 h-4 text-[var(--color-accent-600)]" }) }),
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("div", { className: "font-medium text-[var(--text-primary)] mb-1", children: t(`features.${a}.title`) }),
          /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: t(`features.${a}.desc`) })
        ] })
      ] }, a)) })
    ] }),
    /* @__PURE__ */ r("section", { id: "faq", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r("h2", { className: "text-2xl font-bold mb-4 flex items-center gap-2", children: [
        /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "8" }),
        t("sections.faq")
      ] }),
      /* @__PURE__ */ e("div", { className: "space-y-4", children: ["q1", "q2", "q3", "q4", "q5"].map((a) => /* @__PURE__ */ r("div", { className: "p-5 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
        /* @__PURE__ */ e("h3", { className: "font-medium text-[var(--text-primary)] mb-2", children: t(`faq.${a}.question`) }),
        /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: t(`faq.${a}.answer`) })
      ] }, a)) })
    ] }),
    /* @__PURE__ */ r("section", { id: "technique", className: "scroll-mt-4", children: [
      /* @__PURE__ */ r(
        "button",
        {
          onClick: () => N(!l),
          className: "w-full flex items-center justify-between text-2xl font-bold p-4 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)] hover:bg-[var(--bg-secondary)] transition-colors",
          children: [
            /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
              /* @__PURE__ */ e("span", { className: "w-8 h-8 rounded-full bg-[var(--color-accent-600)] text-white flex items-center justify-center text-sm", children: "9" }),
              t("sections.technicalRef")
            ] }),
            /* @__PURE__ */ e(u, { className: `w-5 h-5 text-[var(--text-secondary)] transition-transform ${l ? "rotate-180" : ""}` })
          ]
        }
      ),
      l && /* @__PURE__ */ r("div", { className: "p-6 mt-2 space-y-6 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-[var(--radius-card)]", children: [
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold text-lg mb-3", children: t("tech.businessRules") }),
          /* @__PURE__ */ e("div", { className: "space-y-2", children: H.map((a) => /* @__PURE__ */ r("div", { className: "flex items-start gap-3 p-3 rounded-lg border border-[var(--border-color)]", children: [
            /* @__PURE__ */ e("code", { className: "text-xs px-2 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-secondary)] flex-shrink-0 mt-0.5", children: a.id }),
            /* @__PURE__ */ e("span", { className: `text-xs px-2 py-0.5 rounded font-medium flex-shrink-0 mt-0.5 ${V[a.category] || "bg-[var(--bg-secondary)] text-[var(--text-secondary)]"}`, children: a.category }),
            /* @__PURE__ */ e("p", { className: "text-sm text-[var(--text-secondary)]", children: a.statement })
          ] }, a.id)) })
        ] }),
        /* @__PURE__ */ r("div", { children: [
          /* @__PURE__ */ e("h3", { className: "font-semibold text-lg mb-3", children: t("tech.apiEndpoints") }),
          /* @__PURE__ */ e("div", { className: "space-y-1.5", children: D.map((a, n) => /* @__PURE__ */ r("div", { className: "flex items-center gap-3 text-sm p-2 rounded-lg hover:bg-[var(--bg-secondary)] transition-colors", children: [
            /* @__PURE__ */ e("span", { className: `px-2 py-0.5 rounded text-xs font-mono font-bold border ${O[a.method]}`, children: a.method }),
            /* @__PURE__ */ e("code", { className: "flex-1 text-xs text-[var(--text-primary)] break-all", children: a.path }),
            /* @__PURE__ */ e("span", { className: "text-xs text-[var(--text-tertiary)] hidden lg:block", children: a.handler }),
            /* @__PURE__ */ e("code", { className: "text-xs px-2 py-0.5 rounded bg-[var(--bg-secondary)] text-[var(--text-tertiary)] hidden xl:block break-all", children: a.permission })
          ] }, `ep-${a.method}-${a.path}-${n}`)) })
        ] })
      ] })
    ] })
  ] });
}
export {
  z as default
};
//# sourceMappingURL=index-x_chx42N.js.map
