import { jsxs as r, jsx as t, Fragment as ze } from "react/jsx-runtime";
import { useMemo as pe, useState as o, useEffect as k, useCallback as Ke } from "react";
import { useNavigate as We, useSearchParams as qe } from "react-router-dom";
import { useTranslation as Ce } from "react-i18next";
import { AlertTriangle as Je, X as Z, Search as _, Filter as ve, RotateCcw as Xe, ChevronDown as I, ArrowUpDown as He, Loader2 as F, Plus as Qe, UserCog as Ye, Cloud as C, Mail as ee, Shield as fe, Eye as be, Edit2 as ge, UserX as Ne, UserCheck as te, Trash2 as L, Users as Ze } from "lucide-react";
import { a as ke, u as _e, w as et, x as tt, v as g, P as at, V as st, c as rt, S as U, A as R, R as E, y as lt, z as ye, B as we } from "./index-CeEMms9z.js";
function it() {
  const { currentTenant: a, hasGlobalRoles: c, isGlobalView: n } = ke(), { currentModuleCode: N, getCurrentModule: y, isLoading: O, menu: V } = _e();
  return c && !n && a && N && !O && V ? {
    isRestrictedModule: !y(),
    tenantName: a?.name || null
  } : { isRestrictedModule: !1, tenantName: null };
}
function nt() {
  const { t: a } = Ce("admin"), { isRestrictedModule: c, tenantName: n } = it();
  return c ? /* @__PURE__ */ r(
    "div",
    {
      className: "flex items-center gap-3 px-4 py-2.5 border bg-amber-500/10 border-amber-500/20 rounded-[var(--radius-card)]",
      children: [
        /* @__PURE__ */ t(
          "div",
          {
            className: "flex-shrink-0 w-8 h-8 flex items-center justify-center bg-amber-500/10 rounded-[var(--radius-card)]",
            children: /* @__PURE__ */ t(Je, { className: "w-4 h-4 text-amber-600" })
          }
        ),
        /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
          /* @__PURE__ */ t("span", { className: "font-medium text-amber-700", children: a("scope.banner.restrictedModule", "Module restreint") }),
          /* @__PURE__ */ t("p", { className: "text-xs text-amber-600/70 mt-0.5", children: a(
            "scope.banner.restrictedModuleDesc",
            `Le tenant "{{tenantName}}" n'a pas accès à ce module. Données affichées grâce à vos privilèges administrateur.`,
            { tenantName: n }
          ) })
        ] })
      ]
    }
  ) : null;
}
function ct(a, c) {
  const [n, N] = o(a);
  return k(() => {
    const y = setTimeout(() => N(a), c);
    return () => clearTimeout(y);
  }, [a, c]), n;
}
const ot = {
  search: "",
  status: "all",
  roleId: "",
  source: "all",
  userType: "",
  sortBy: "lastname",
  sortDesc: !1
};
function vt() {
  const { t: a } = Ce("admin"), c = We(), [n, N] = qe(), y = et("users"), { currentTenant: O, isGlobalView: V } = ke(), { hasPermission: D } = tt(), P = D("administration.users.create"), d = D("administration.users.update"), m = D("administration.users.delete"), Te = pe(() => ({
    search: n.get("search") || "",
    status: n.get("status") || "all",
    roleId: n.get("roleId") || "",
    source: n.get("source") || "all",
    userType: n.get("userType") || "",
    sortBy: n.get("sortBy") || "lastname",
    sortDesc: n.get("sortDesc") === "true"
  }), [n]), [u, Ae] = o([]), [ae, Ie] = o([]), [p, se] = o(!0), [l, G] = o(Te), [S, re] = o(!1), [v, j] = o(parseInt(n.get("page") || "1")), [De, Pe] = o(1), [z, Se] = o(0), [je, $] = o(!1), [w, $e] = o(null), [h, f] = o({
    email: "",
    password: "",
    firstName: "",
    lastName: "",
    roleIds: []
  }), [K, le] = o(!1), [ie, W] = o(null), [B, q] = o(null), [T, Be] = o("table");
  k(() => {
    if (!B) return;
    const e = setTimeout(() => q(null), 4e3);
    return () => clearTimeout(e);
  }, [B]), k(() => {
    const e = {
      search: n.get("search") || "",
      status: n.get("status") || "all",
      roleId: n.get("roleId") || "",
      source: n.get("source") || "all",
      userType: n.get("userType") || "",
      sortBy: n.get("sortBy") || "lastname",
      sortDesc: n.get("sortDesc") === "true"
    };
    JSON.stringify(e) !== JSON.stringify(l) && G(e);
    const s = parseInt(n.get("page") || "1");
    s !== v && j(s);
  }, [n]);
  const ne = ct(l.search, 300), A = pe(() => {
    let e = 0;
    return l.status !== "all" && e++, l.roleId && e++, l.source !== "all" && e++, l.userType && e++, e;
  }, [l]), b = Ke(async () => {
    try {
      se(!0);
      const e = await g.users.getAll({
        page: v,
        pageSize: 20,
        search: ne || void 0,
        isActive: l.status === "all" ? void 0 : l.status === "active",
        entraOnly: l.source === "entra" ? !0 : void 0,
        roleId: l.roleId || void 0,
        userType: l.userType || void 0,
        sortBy: l.sortBy || void 0,
        sortDesc: l.sortDesc
      });
      Ae(e.items), Pe(e.totalPages), Se(e.totalCount);
    } catch (e) {
      console.error("Failed to load users:", e);
    } finally {
      se(!1);
    }
  }, [v, ne, l.status, l.source, l.roleId, l.userType, l.sortBy, l.sortDesc]);
  k(() => {
    const e = new URLSearchParams();
    l.search && e.set("search", l.search), l.status !== "all" && e.set("status", l.status), l.roleId && e.set("roleId", l.roleId), l.source !== "all" && e.set("source", l.source), l.userType && e.set("userType", l.userType), l.sortBy !== "lastname" && e.set("sortBy", l.sortBy), l.sortDesc && e.set("sortDesc", "true"), v > 1 && e.set("page", v.toString()), N(e, { replace: !0 });
  }, [l, v, N]);
  const Me = async () => {
    try {
      const e = await g.roles.getAll();
      Ie(e);
    } catch (e) {
      console.error("Failed to load roles:", e);
    }
  };
  k(() => {
    b();
  }, [b, O?.id, V]), k(() => {
    Me();
  }, []);
  const Fe = () => {
    G(ot), j(1);
  }, x = (e, s) => {
    G((i) => ({ ...i, [e]: s })), j(1);
  }, Le = () => {
    c("/administration/users/create");
  }, ce = async (e) => {
    try {
      const s = await g.users.getById(e.id);
      $e(e), f({
        email: s.email,
        password: "",
        firstName: s.firstName,
        lastName: s.lastName,
        roleIds: s.roles.map((i) => i.id)
      }), W(null), $(!0);
    } catch (s) {
      console.error("Failed to load user details:", s);
    }
  }, Ue = async (e) => {
    if (e.preventDefault(), !!w) {
      le(!0), W(null);
      try {
        const s = {
          email: h.email !== w.email ? h.email : void 0,
          firstName: h.firstName,
          lastName: h.lastName,
          roleIds: h.roleIds
        };
        await g.users.update(w.id, s), q(a("users.updated", { defaultValue: "Utilisateur mis à jour" })), $(!1), b();
      } catch (s) {
        const i = s instanceof Error ? s.message : "An error occurred";
        W(i);
      } finally {
        le(!1);
      }
    }
  }, J = async (e, s) => {
    s?.stopPropagation();
    try {
      e.isActive ? await g.users.deactivate(e.id) : await g.users.activate(e.id), b();
    } catch (i) {
      console.error("Failed to toggle user status:", i);
    }
  }, M = async (e, s) => {
    if (s?.stopPropagation(), !!confirm(a("users.confirmDelete", { name: e.fullName })))
      try {
        await g.users.delete(e.id), b();
      } catch (i) {
        console.error("Failed to delete user:", i);
      }
  }, Re = (e) => {
    f((s) => ({
      ...s,
      roleIds: s.roleIds?.includes(e) ? s.roleIds.filter((i) => i !== e) : [...s.roleIds || [], e]
    }));
  }, X = u.filter((e) => e.isActive), H = u.filter((e) => !e.isActive), Ee = Math.floor(X.length * 0.3), oe = (e, s) => e ? s ? "text-[var(--text-tertiary)] hover:text-[var(--warning-text)] hover:bg-[var(--warning-bg)]" : "text-[var(--text-tertiary)] hover:text-[var(--success-text)] hover:bg-[var(--success-bg)]" : "opacity-50 cursor-not-allowed text-[var(--text-tertiary)]", de = (e, s, i) => e ? i(s ? "users.deactivate" : "users.activate") : i("common.noPermission", "Permission insuffisante"), me = (e) => e ? "text-[var(--text-tertiary)] hover:text-[var(--info-text)] hover:bg-[var(--info-bg)]" : "opacity-50 cursor-not-allowed text-[var(--text-tertiary)]", ue = (e, s) => e ? s("common.edit") : s("common.noPermission", "Permission insuffisante"), Q = (e) => e ? "text-[var(--text-tertiary)] hover:text-[var(--error-text)] hover:bg-[var(--error-bg)]" : "opacity-50 cursor-not-allowed text-[var(--text-tertiary)]", Y = (e, s) => e ? s("common.delete") : s("common.noPermission", "Permission insuffisante"), Oe = (e) => {
    const s = {
      Direct: "bg-[var(--info-bg)] text-[var(--info-text)]",
      Group: "bg-[var(--info-bg)]/50 text-[var(--info-text)]",
      Both: "bg-[var(--success-bg)] text-[var(--success-text)]"
    }, i = {
      Direct: a("users.membershipDirect", "Direct"),
      Group: a("users.membershipGroup", "Via groupe"),
      Both: a("users.membershipBoth", "Mixte")
    };
    return { color: s[e] || "", label: i[e] || "" };
  }, Ve = () => /* @__PURE__ */ t("div", { className: "card overflow-hidden", children: /* @__PURE__ */ r("table", { className: "w-full", children: [
    /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ r("tr", { className: "bg-[var(--bg-secondary)]", children: [
      /* @__PURE__ */ t("th", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ t("input", { type: "checkbox", className: "w-4 h-4 rounded border-[var(--border-color)]" }) }),
      /* @__PURE__ */ t("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider", children: a("users.columns.name") }),
      /* @__PURE__ */ t("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider hidden md:table-cell", children: a("users.columns.email") }),
      /* @__PURE__ */ t("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider hidden lg:table-cell", children: a("users.columns.role") }),
      /* @__PURE__ */ t("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider", children: a("users.columns.status") }),
      /* @__PURE__ */ t("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider hidden xl:table-cell", children: a("users.columns.source", "Source") }),
      /* @__PURE__ */ t("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider hidden xl:table-cell", children: a("users.columns.group", "Groupe") }),
      y.map((e) => /* @__PURE__ */ t("th", { className: "text-left px-4 py-3 text-xs font-semibold text-[var(--text-tertiary)] uppercase tracking-wider hidden xl:table-cell", style: e.width ? { width: e.width } : void 0, children: e.label }, e.key)),
      /* @__PURE__ */ t("th", { className: "w-32 px-4 py-3" })
    ] }) }),
    /* @__PURE__ */ r("tbody", { className: "divide-y divide-[var(--border-color)]", children: [
      p && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 8, className: "px-6 py-16 text-center", children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-3", children: [
        /* @__PURE__ */ t(F, { className: "w-8 h-8 animate-spin text-[var(--color-accent-500)]" }),
        /* @__PURE__ */ t("span", { className: "text-sm text-[var(--text-secondary)]", children: "Chargement..." })
      ] }) }) }),
      !p && u.length === 0 && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 8, className: "px-6 py-16 text-center", children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-3", children: [
        /* @__PURE__ */ t("div", { className: "w-16 h-16 rounded-full bg-[var(--bg-secondary)] flex items-center justify-center", children: /* @__PURE__ */ t(_, { className: "w-8 h-8 text-[var(--text-tertiary)]" }) }),
        /* @__PURE__ */ t("span", { className: "text-[var(--text-secondary)]", children: a("users.noUsers") })
      ] }) }) }),
      !p && u.length > 0 && u.map((e) => /* @__PURE__ */ r(
        "tr",
        {
          className: "group hover:bg-[var(--bg-hover)] transition-all cursor-pointer",
          onClick: () => c(`/administration/users/${e.id}`),
          children: [
            /* @__PURE__ */ t("td", { className: "px-4 py-3", onClick: (s) => s.stopPropagation(), children: /* @__PURE__ */ t("input", { type: "checkbox", className: "w-4 h-4 rounded border-[var(--border-color)]" }) }),
            /* @__PURE__ */ t("td", { className: "px-4 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
              /* @__PURE__ */ r("div", { className: "relative", children: [
                /* @__PURE__ */ t(R, { name: e.fullName }),
                e.entraObjectId && /* @__PURE__ */ t("div", { className: "absolute -bottom-0.5 -right-0.5 w-4 h-4 rounded-full bg-[var(--info-dot)] flex items-center justify-center ring-2 ring-[var(--bg-card)]", title: a("users.syncedWithAad"), children: /* @__PURE__ */ t(C, { className: "w-2.5 h-2.5 text-white" }) })
              ] }),
              /* @__PURE__ */ r("div", { className: "min-w-0", children: [
                /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
                  /* @__PURE__ */ t("p", { className: "font-medium text-[var(--text-primary)] group-hover:text-primary-600 transition-colors truncate", children: e.fullName }),
                  e.entraObjectId && /* @__PURE__ */ r("span", { className: "hidden sm:inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-[var(--info-bg)] text-[var(--info-text)]", children: [
                    /* @__PURE__ */ t(C, { className: "w-2.5 h-2.5" }),
                    "AAD"
                  ] })
                ] }),
                /* @__PURE__ */ r("p", { className: "text-sm text-[var(--text-tertiary)] truncate md:hidden flex items-center gap-1", children: [
                  /* @__PURE__ */ t(ee, { className: "w-3 h-3" }),
                  e.email
                ] })
              ] })
            ] }) }),
            /* @__PURE__ */ t("td", { className: "px-4 py-3 hidden md:table-cell", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[var(--text-secondary)]", children: [
              /* @__PURE__ */ t(ee, { className: "w-4 h-4 text-[var(--text-tertiary)]" }),
              /* @__PURE__ */ t("span", { className: "truncate", children: e.email })
            ] }) }),
            /* @__PURE__ */ t("td", { className: "px-4 py-3 hidden lg:table-cell", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1.5", children: e.roles.length > 0 ? e.roles.map((s, i) => /* @__PURE__ */ t(
              E,
              {
                role: s,
                variant: s.toLowerCase().includes("admin") ? "accent" : "default",
                icon: /* @__PURE__ */ t(fe, { className: "w-3 h-3" })
              },
              `${s}-${i}`
            )) : /* @__PURE__ */ t("span", { className: "text-sm text-[var(--text-tertiary)] italic", children: "Aucun rôle" }) }) }),
            /* @__PURE__ */ t("td", { className: "px-4 py-3", children: /* @__PURE__ */ t(
              lt,
              {
                status: e.isActive ? "active" : "inactive",
                label: e.isActive ? a("users.status.active") : a("users.status.inactive")
              }
            ) }),
            /* @__PURE__ */ t("td", { className: "px-4 py-3 hidden xl:table-cell", children: (() => {
              const { color: s, label: i } = Oe(e.membershipSource);
              return /* @__PURE__ */ t("span", { className: `inline-flex items-center gap-1 px-2 py-1 rounded-md text-xs font-medium ${s}`, children: i });
            })() }),
            /* @__PURE__ */ t("td", { className: "px-4 py-3 hidden xl:table-cell", children: e.primaryGroupId ? /* @__PURE__ */ r(
              "button",
              {
                onClick: (s) => {
                  s.stopPropagation(), c(`/administration/groups/${e.primaryGroupId}`);
                },
                className: "inline-flex items-center gap-1.5 px-2 py-1 rounded-md text-xs font-medium bg-[var(--bg-secondary)] hover:bg-[var(--bg-hover)] text-[var(--text-secondary)] hover:text-primary-600 transition-colors",
                children: [
                  /* @__PURE__ */ t(Ze, { className: "w-3 h-3" }),
                  e.primaryGroupName
                ]
              }
            ) : /* @__PURE__ */ t("span", { className: "text-[var(--text-tertiary)]", children: "—" }) }),
            y.map((s) => /* @__PURE__ */ t("td", { className: "px-4 py-3 hidden xl:table-cell text-[var(--text-secondary)]", children: s.render(e, { tableId: "users", rowIndex: u.indexOf(e) }) }, s.key)),
            /* @__PURE__ */ t("td", { className: "px-4 py-3", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-end gap-1", onClick: (s) => s.stopPropagation(), children: [
              /* @__PURE__ */ t(
                "button",
                {
                  onClick: () => c(`/administration/users/${e.id}`),
                  className: "p-2 rounded-lg text-[var(--text-tertiary)] hover:text-[var(--color-accent-600)] hover:bg-[var(--bg-hover)] transition-all",
                  title: a("users.view"),
                  children: /* @__PURE__ */ t(be, { className: "w-4 h-4" })
                }
              ),
              /* @__PURE__ */ t(
                "button",
                {
                  onClick: (s) => {
                    s.stopPropagation(), ce(e);
                  },
                  disabled: !d,
                  className: me(d),
                  title: ue(d, a),
                  children: /* @__PURE__ */ t(ge, { className: "w-4 h-4" })
                }
              ),
              /* @__PURE__ */ t(
                "button",
                {
                  onClick: (s) => J(e, s),
                  disabled: !d,
                  className: `p-2 rounded-lg transition-all ${oe(d, e.isActive)}`,
                  title: de(d, e.isActive, a),
                  children: e.isActive ? /* @__PURE__ */ t(Ne, { className: "w-4 h-4" }) : /* @__PURE__ */ t(te, { className: "w-4 h-4" })
                }
              ),
              e.userType !== "System" && e.userType !== "LocalAdmin" && /* @__PURE__ */ t(
                "button",
                {
                  onClick: (s) => M(e, s),
                  disabled: !m,
                  className: `p-2 rounded-lg transition-all ${m ? "text-[var(--text-tertiary)] hover:text-[var(--error-text)] hover:bg-[var(--error-bg)]" : "opacity-50 cursor-not-allowed text-[var(--text-tertiary)]"}`,
                  title: m ? a("common.delete") : a("common.noPermission", "Permission insuffisante"),
                  children: /* @__PURE__ */ t(L, { className: "w-4 h-4" })
                }
              ),
              /* @__PURE__ */ t(U, { name: "users.table.row.actions", context: { user: e, reload: b } })
            ] }) })
          ]
        },
        e.id
      ))
    ] })
  ] }) }), he = () => /* @__PURE__ */ r("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", children: [
    p && /* @__PURE__ */ r("div", { className: "col-span-full flex flex-col items-center justify-center py-16", children: [
      /* @__PURE__ */ t(F, { className: "w-8 h-8 animate-spin text-[var(--color-accent-500)]" }),
      /* @__PURE__ */ t("span", { className: "mt-3 text-sm text-[var(--text-secondary)]", children: a("common.loading") })
    ] }),
    !p && u.length === 0 && /* @__PURE__ */ r("div", { className: "col-span-full flex flex-col items-center justify-center py-16", children: [
      /* @__PURE__ */ t("div", { className: "w-16 h-16 rounded-lg bg-[var(--bg-secondary)] flex items-center justify-center mb-3", children: /* @__PURE__ */ t(_, { className: "w-8 h-8 text-[var(--text-tertiary)]" }) }),
      /* @__PURE__ */ t("span", { className: "text-[var(--text-secondary)]", children: a("users.noUsers") })
    ] }),
    !p && u.length > 0 && u.map((e) => /* @__PURE__ */ r(
      "div",
      {
        role: "button",
        tabIndex: 0,
        onClick: () => c(`/administration/users/${e.id}`),
        onKeyDown: (s) => {
          (s.key === "Enter" || s.key === " ") && (s.preventDefault(), c(`/administration/users/${e.id}`));
        },
        className: "bg-[var(--bg-card)] border-2 border-[var(--color-accent-200)]/40 rounded-[var(--radius-card)] overflow-hidden transition-all hover:shadow-lg hover:border-[var(--color-accent-400)]/60 cursor-pointer flex flex-col text-left",
        children: [
          /* @__PURE__ */ t("div", { className: "bg-[var(--color-accent-50)]/30 p-4 border-b border-[var(--color-accent-200)]/40", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
            /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
              /* @__PURE__ */ r("div", { className: "relative", children: [
                /* @__PURE__ */ t(R, { name: e.fullName, size: "lg", className: "rounded-lg" }),
                e.entraObjectId && /* @__PURE__ */ t("div", { className: "absolute -bottom-0.5 -right-0.5 w-5 h-5 rounded-full bg-[var(--info-text)] flex items-center justify-center ring-2 ring-[var(--bg-card)]", title: a("users.syncedWithAad"), children: /* @__PURE__ */ t(C, { className: "w-3 h-3 text-white" }) })
              ] }),
              /* @__PURE__ */ r("div", { children: [
                /* @__PURE__ */ t("h3", { className: "font-semibold text-[var(--text-primary)] truncate", children: e.fullName }),
                /* @__PURE__ */ r("p", { className: "text-xs text-[var(--text-tertiary)] truncate flex items-center gap-1", children: [
                  /* @__PURE__ */ t(ee, { className: "w-3 h-3" }),
                  e.email
                ] })
              ] })
            ] }),
            /* @__PURE__ */ r("div", { className: "flex flex-col items-end gap-1", children: [
              /* @__PURE__ */ t("span", { className: `inline-flex items-center gap-1.5 px-2 py-0.5 text-xs rounded-full font-medium ${e.isActive ? "bg-[var(--success-bg)] text-[var(--success-text)]" : "bg-[var(--bg-secondary)] text-[var(--text-secondary)]"}`, children: e.isActive ? a("users.status.active") : a("users.status.inactive") }),
              e.entraObjectId && /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-[var(--info-bg)] text-[var(--info-text)]", children: [
                /* @__PURE__ */ t(C, { className: "w-2.5 h-2.5" }),
                "AAD"
              ] })
            ] })
          ] }) }),
          /* @__PURE__ */ r("div", { className: "p-4 flex flex-col flex-1", children: [
            /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 mb-3", children: [
              e.roles.length > 0 ? e.roles.slice(0, 2).map((s, i) => /* @__PURE__ */ t(
                E,
                {
                  role: s,
                  variant: s.toLowerCase().includes("admin") ? "accent" : "default",
                  icon: /* @__PURE__ */ t(fe, { className: "w-3 h-3" })
                },
                `${s}-${i}`
              )) : /* @__PURE__ */ t("span", { className: "text-xs text-[var(--text-muted)]", children: "Aucun rôle" }),
              e.roles.length > 2 && /* @__PURE__ */ r("span", { className: "text-xs px-2 py-0.5 rounded-md bg-[var(--bg-secondary)] text-[var(--text-muted)]", children: [
                "+",
                e.roles.length - 2
              ] })
            ] }),
            /* @__PURE__ */ t(U, { name: "users.card.content", context: { user: e } }),
            /* @__PURE__ */ t("div", { className: "flex-1" }),
            /* @__PURE__ */ r("div", { className: "flex items-center justify-end gap-1 pt-3 border-t border-[var(--border-color)]", onClick: (s) => s.stopPropagation(), children: [
              /* @__PURE__ */ t(
                "button",
                {
                  onClick: () => c(`/administration/users/${e.id}`),
                  className: "p-2 rounded-lg text-[var(--text-tertiary)] hover:text-primary-600 hover:bg-[var(--accent-bg)] transition-all",
                  title: a("users.view"),
                  children: /* @__PURE__ */ t(be, { className: "w-4 h-4" })
                }
              ),
              /* @__PURE__ */ t(
                "button",
                {
                  onClick: (s) => {
                    s.stopPropagation(), ce(e);
                  },
                  disabled: !d,
                  className: `p-2 rounded-lg transition-all ${me(d)}`,
                  title: ue(d, a),
                  children: /* @__PURE__ */ t(ge, { className: "w-4 h-4" })
                }
              ),
              /* @__PURE__ */ t(
                "button",
                {
                  onClick: (s) => J(e, s),
                  disabled: !d,
                  className: `p-2 rounded-lg transition-all ${oe(d, e.isActive)}`,
                  title: de(d, e.isActive, a),
                  children: e.isActive ? /* @__PURE__ */ t(Ne, { className: "w-4 h-4" }) : /* @__PURE__ */ t(te, { className: "w-4 h-4" })
                }
              ),
              e.userType !== "System" && e.userType !== "LocalAdmin" && /* @__PURE__ */ t(
                "button",
                {
                  onClick: (s) => M(e, s),
                  disabled: !m,
                  className: `p-2 rounded-lg transition-all ${Q(m)}`,
                  title: Y(m, a),
                  children: /* @__PURE__ */ t(L, { className: "w-4 h-4" })
                }
              )
            ] })
          ] })
        ]
      },
      e.id
    ))
  ] }), Ge = () => /* @__PURE__ */ t("div", { className: "flex gap-6 overflow-x-auto pb-4", children: p ? /* @__PURE__ */ r("div", { className: "flex-1 flex flex-col items-center justify-center py-16", children: [
    /* @__PURE__ */ t(F, { className: "w-8 h-8 animate-spin text-[var(--color-accent-500)]" }),
    /* @__PURE__ */ t("span", { className: "mt-3 text-sm text-[var(--text-secondary)]", children: a("common.loading") })
  ] }) : /* @__PURE__ */ r(ze, { children: [
    /* @__PURE__ */ t(ye, { title: "Actifs", count: X.length, color: "success", children: X.map((e) => /* @__PURE__ */ r(we, { onClick: () => c(`/administration/users/${e.id}`), children: [
      /* @__PURE__ */ r("div", { className: "flex items-center gap-3 mb-3", children: [
        /* @__PURE__ */ r("div", { className: "relative", children: [
          /* @__PURE__ */ t(R, { name: e.fullName, size: "sm" }),
          e.entraObjectId && /* @__PURE__ */ t("div", { className: "absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 rounded-full bg-[var(--info-dot)] flex items-center justify-center ring-2 ring-[var(--bg-card)]", title: a("users.syncedWithAad"), children: /* @__PURE__ */ t(C, { className: "w-2 h-2 text-white" }) })
        ] }),
        /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
          /* @__PURE__ */ t("p", { className: "font-medium text-sm text-[var(--text-primary)] truncate", children: e.fullName }),
          /* @__PURE__ */ t("p", { className: "text-xs text-[var(--text-tertiary)] truncate", children: e.email })
        ] })
      ] }),
      /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
        e.roles.length > 0 ? /* @__PURE__ */ t(
          E,
          {
            role: e.roles[0],
            variant: e.roles[0].toLowerCase().includes("admin") ? "accent" : "default"
          }
        ) : /* @__PURE__ */ t("span", { className: "text-xs text-[var(--text-muted)]", children: "-" }),
        /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
          e.userType !== "System" && e.userType !== "LocalAdmin" && /* @__PURE__ */ t(
            "button",
            {
              type: "button",
              onClick: (s) => M(e, s),
              disabled: !m,
              className: `p-1 rounded transition-all ${Q(m)}`,
              title: Y(m, a),
              children: /* @__PURE__ */ t(L, { className: "w-3.5 h-3.5" })
            }
          ),
          /* @__PURE__ */ t("span", { className: "text-xs text-[var(--text-muted)]", children: a("users.kanban.online", "En ligne") })
        ] })
      ] })
    ] }, e.id)) }),
    /* @__PURE__ */ r(ye, { title: "Inactifs", count: H.length, color: "error", children: [
      H.map((e) => /* @__PURE__ */ r(we, { onClick: () => c(`/administration/users/${e.id}`), children: [
        /* @__PURE__ */ r("div", { className: "flex items-center gap-3 mb-3", children: [
          /* @__PURE__ */ r("div", { className: "relative", children: [
            /* @__PURE__ */ t(R, { name: e.fullName, size: "sm" }),
            e.entraObjectId && /* @__PURE__ */ t("div", { className: "absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 rounded-full bg-[var(--info-dot)] flex items-center justify-center ring-2 ring-[var(--bg-card)]", title: a("users.syncedWithAad"), children: /* @__PURE__ */ t(C, { className: "w-2 h-2 text-white" }) })
          ] }),
          /* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
            /* @__PURE__ */ t("p", { className: "font-medium text-sm text-[var(--text-primary)] truncate", children: e.fullName }),
            /* @__PURE__ */ t("p", { className: "text-xs text-[var(--text-tertiary)] truncate", children: e.email })
          ] })
        ] }),
        /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
          e.roles.length > 0 ? /* @__PURE__ */ t(E, { role: e.roles[0] }) : /* @__PURE__ */ t("span", { className: "text-xs text-[var(--text-muted)]", children: "-" }),
          /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
            /* @__PURE__ */ t(
              "button",
              {
                type: "button",
                onClick: (s) => J(e, s),
                disabled: !d,
                className: `text-xs px-2 py-1 rounded transition-opacity ${d ? "bg-[var(--success-bg)] text-[var(--success-text)] hover:opacity-80" : "opacity-50 cursor-not-allowed bg-[var(--bg-secondary)] text-[var(--text-tertiary)]"}`,
                title: d ? void 0 : a("common.noPermission", "Permission insuffisante"),
                children: a("users.kanban.reactivate", "Réactiver")
              }
            ),
            e.userType !== "System" && e.userType !== "LocalAdmin" && /* @__PURE__ */ t(
              "button",
              {
                type: "button",
                onClick: (s) => M(e, s),
                disabled: !m,
                className: `p-1 rounded transition-all ${Q(m)}`,
                title: Y(m, a),
                children: /* @__PURE__ */ t(L, { className: "w-3.5 h-3.5" })
              }
            )
          ] })
        ] })
      ] }, e.id)),
      H.length === 0 && /* @__PURE__ */ r("div", { className: "border border-dashed border-[var(--border-color)] rounded-lg p-6 text-center", children: [
        /* @__PURE__ */ t(te, { className: "w-6 h-6 mx-auto mb-2 text-[var(--text-muted)]" }),
        /* @__PURE__ */ t("p", { className: "text-xs text-[var(--text-muted)]", children: a("users.kanban.noInactiveUsers", "Aucun utilisateur inactif") })
      ] })
    ] })
  ] }) });
  return /* @__PURE__ */ r(
    at,
    {
      title: a("users.title"),
      subtitle: `${z} utilisateurs • ${Ee} en ligne`,
      icon: /* @__PURE__ */ t(Ye, { className: "w-6 h-6" }),
      breadcrumbs: [
        { label: a("header.title"), href: "/administration" },
        { label: a("users.title") }
      ],
      actions: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ t(U, { name: "users.header.actions", context: { users: u, totalCount: z, reload: b } }),
        /* @__PURE__ */ r(
          "button",
          {
            onClick: Le,
            disabled: !P,
            className: `btn btn-primary ${P ? "" : "opacity-50 cursor-not-allowed"}`,
            title: P ? void 0 : a("common.noPermission", "Permission insuffisante"),
            children: [
              /* @__PURE__ */ t(Qe, { className: "w-4 h-4" }),
              a("users.create.button")
            ]
          }
        )
      ] }),
      children: [
        /* @__PURE__ */ t(nt, {}),
        B && /* @__PURE__ */ r("div", { role: "status", className: "mb-4 p-3 rounded-[var(--radius-card)] bg-[var(--success-bg)] border border-[var(--success-border)] text-[var(--success-text)] text-sm flex items-center justify-between gap-3", children: [
          /* @__PURE__ */ t("span", { children: B }),
          /* @__PURE__ */ t(
            "button",
            {
              type: "button",
              onClick: () => q(null),
              className: "p-1 hover:bg-[var(--success-bg)]/80 rounded transition-colors",
              "aria-label": a("common.close", "Fermer"),
              children: /* @__PURE__ */ t(Z, { className: "w-4 h-4" })
            }
          )
        ] }),
        /* @__PURE__ */ t("div", { className: "card p-4", children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-4", children: [
          /* @__PURE__ */ r("div", { className: "flex flex-col md:flex-row md:items-center justify-between gap-4", children: [
            /* @__PURE__ */ r("div", { className: "flex items-center gap-3 flex-1", children: [
              /* @__PURE__ */ r("div", { className: "relative flex-1 max-w-md", children: [
                !l.search && /* @__PURE__ */ t(_, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-muted)] pointer-events-none" }),
                /* @__PURE__ */ t(
                  "input",
                  {
                    type: "text",
                    value: l.search,
                    onChange: (e) => x("search", e.target.value),
                    placeholder: a("users.filters.searchPlaceholder"),
                    className: "input w-full",
                    style: l.search ? void 0 : { paddingLeft: "2.5rem" }
                  }
                ),
                l.search && /* @__PURE__ */ t(
                  "button",
                  {
                    onClick: () => x("search", ""),
                    className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-[var(--bg-secondary)]",
                    children: /* @__PURE__ */ t(Z, { className: "w-3 h-3 text-[var(--text-tertiary)]" })
                  }
                )
              ] }),
              /* @__PURE__ */ r(
                "button",
                {
                  onClick: () => re(!S),
                  className: `btn ${S ? "btn-primary" : "btn-secondary"} relative`,
                  children: [
                    /* @__PURE__ */ t(ve, { className: "w-4 h-4" }),
                    /* @__PURE__ */ t("span", { className: "hidden sm:inline", children: a("users.filters.title") }),
                    A > 0 && /* @__PURE__ */ t("span", { className: "absolute -top-1.5 -right-1.5 w-5 h-5 rounded-full bg-[var(--color-accent-500)] text-white text-xs flex items-center justify-center", children: A })
                  ]
                }
              ),
              A > 0 && /* @__PURE__ */ t(
                "button",
                {
                  onClick: Fe,
                  className: "btn btn-ghost text-[var(--text-tertiary)] hover:text-[var(--text-primary)]",
                  title: a("users.filters.reset"),
                  children: /* @__PURE__ */ t(Xe, { className: "w-4 h-4" })
                }
              )
            ] }),
            /* @__PURE__ */ t("div", { className: "hidden md:block", children: /* @__PURE__ */ t(
              st,
              {
                viewMode: T,
                onChange: Be,
                tableLabel: "Table",
                cardsLabel: "Cards",
                kanbanLabel: "Kanban"
              }
            ) })
          ] }),
          S && /* @__PURE__ */ r("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 gap-4 pt-4 border-t border-[var(--border-color)]", children: [
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ t("label", { className: "block text-xs font-medium text-[var(--text-tertiary)] mb-1.5", children: a("users.filters.status") }),
              /* @__PURE__ */ r("div", { className: "relative", children: [
                /* @__PURE__ */ r(
                  "select",
                  {
                    value: l.status,
                    onChange: (e) => x("status", e.target.value),
                    className: "input w-full appearance-none pr-8",
                    children: [
                      /* @__PURE__ */ t("option", { value: "all", children: a("users.filters.allStatuses") }),
                      /* @__PURE__ */ t("option", { value: "active", children: a("users.filters.activeOnly") }),
                      /* @__PURE__ */ t("option", { value: "inactive", children: a("users.filters.inactiveOnly") })
                    ]
                  }
                ),
                /* @__PURE__ */ t(I, { className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-tertiary)] pointer-events-none" })
              ] })
            ] }),
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ t("label", { className: "block text-xs font-medium text-[var(--text-tertiary)] mb-1.5", children: a("users.filters.role") }),
              /* @__PURE__ */ r("div", { className: "relative", children: [
                /* @__PURE__ */ r(
                  "select",
                  {
                    value: l.roleId,
                    onChange: (e) => x("roleId", e.target.value),
                    className: "input w-full appearance-none pr-8",
                    children: [
                      /* @__PURE__ */ t("option", { value: "", children: a("users.filters.allRoles") }),
                      ae.map((e) => /* @__PURE__ */ t("option", { value: e.id, children: e.name }, e.id))
                    ]
                  }
                ),
                /* @__PURE__ */ t(I, { className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-tertiary)] pointer-events-none" })
              ] })
            ] }),
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ t("label", { className: "block text-xs font-medium text-[var(--text-tertiary)] mb-1.5", children: a("users.filters.source") }),
              /* @__PURE__ */ r("div", { className: "relative", children: [
                /* @__PURE__ */ r(
                  "select",
                  {
                    value: l.source,
                    onChange: (e) => x("source", e.target.value),
                    className: "input w-full appearance-none pr-8",
                    children: [
                      /* @__PURE__ */ t("option", { value: "all", children: a("users.filters.allSources") }),
                      /* @__PURE__ */ t("option", { value: "entra", children: a("users.filters.entraOnly") }),
                      /* @__PURE__ */ t("option", { value: "local", children: a("users.filters.localOnly") })
                    ]
                  }
                ),
                /* @__PURE__ */ t(I, { className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-tertiary)] pointer-events-none" })
              ] })
            ] }),
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ t("label", { className: "block text-xs font-medium text-[var(--text-tertiary)] mb-1.5", children: a("users.filters.userType") }),
              /* @__PURE__ */ r("div", { className: "relative", children: [
                /* @__PURE__ */ r(
                  "select",
                  {
                    value: l.userType,
                    onChange: (e) => x("userType", e.target.value),
                    className: "input w-full appearance-none pr-8",
                    children: [
                      /* @__PURE__ */ t("option", { value: "", children: a("users.filters.allTypes") }),
                      /* @__PURE__ */ t("option", { value: "User", children: a("users.filters.typeUser") }),
                      /* @__PURE__ */ t("option", { value: "System", children: a("users.filters.typeSystem") }),
                      /* @__PURE__ */ t("option", { value: "LocalAdmin", children: a("users.filters.typeLocalAdmin") })
                    ]
                  }
                ),
                /* @__PURE__ */ t(I, { className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-tertiary)] pointer-events-none" })
              ] })
            ] }),
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ t("label", { className: "block text-xs font-medium text-[var(--text-tertiary)] mb-1.5", children: a("users.filters.sortBy") }),
              /* @__PURE__ */ r("div", { className: "flex gap-2", children: [
                /* @__PURE__ */ r("div", { className: "relative flex-1", children: [
                  /* @__PURE__ */ r(
                    "select",
                    {
                      value: l.sortBy,
                      onChange: (e) => x("sortBy", e.target.value),
                      className: "input w-full appearance-none pr-8",
                      children: [
                        /* @__PURE__ */ t("option", { value: "lastname", children: a("users.filters.sortName") }),
                        /* @__PURE__ */ t("option", { value: "email", children: a("users.filters.sortEmail") }),
                        /* @__PURE__ */ t("option", { value: "lastlogin", children: a("users.filters.sortLastLogin") }),
                        /* @__PURE__ */ t("option", { value: "createdat", children: a("users.filters.sortCreatedAt") }),
                        /* @__PURE__ */ t("option", { value: "status", children: a("users.filters.sortStatus") })
                      ]
                    }
                  ),
                  /* @__PURE__ */ t(I, { className: "absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-tertiary)] pointer-events-none" })
                ] }),
                /* @__PURE__ */ t(
                  "button",
                  {
                    onClick: () => x("sortDesc", !l.sortDesc),
                    className: `btn ${l.sortDesc ? "btn-primary" : "btn-secondary"} px-2.5`,
                    title: l.sortDesc ? a("users.filters.sortDesc") : a("users.filters.sortAsc"),
                    children: /* @__PURE__ */ t(He, { className: "w-4 h-4" })
                  }
                )
              ] })
            ] })
          ] }),
          A > 0 && !S && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-sm text-[var(--text-tertiary)]", children: [
            /* @__PURE__ */ t(ve, { className: "w-4 h-4" }),
            /* @__PURE__ */ t("span", { children: a("users.filters.activeFilters", { count: A }) }),
            /* @__PURE__ */ t(
              "button",
              {
                onClick: () => re(!0),
                className: "text-[var(--color-accent-600)] hover:underline",
                children: a("users.filters.title")
              }
            )
          ] })
        ] }) }),
        /* @__PURE__ */ t("div", { className: "md:hidden", children: he() }),
        /* @__PURE__ */ r("div", { className: "hidden md:block", children: [
          T === "table" && Ve(),
          T === "cards" && he(),
          T === "kanban" && Ge()
        ] }),
        T !== "kanban" && /* @__PURE__ */ t(
          rt,
          {
            page: v,
            totalPages: De,
            totalCount: z,
            pageSize: 20,
            onPageChange: j,
            itemLabel: "utilisateurs"
          }
        ),
        je && w && /* @__PURE__ */ t("div", { className: "fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50", children: /* @__PURE__ */ r("div", { className: "card w-full max-w-lg p-6 m-4 max-h-[90vh] overflow-y-auto", children: [
          /* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-6", children: [
            /* @__PURE__ */ t("h2", { className: "text-xl font-bold text-[var(--text-primary)]", children: a("users.edit") }),
            /* @__PURE__ */ t("button", { onClick: () => $(!1), className: "btn btn-ghost p-2", children: /* @__PURE__ */ t(Z, { className: "w-5 h-5" }) })
          ] }),
          ie && /* @__PURE__ */ t("div", { className: "mb-4 p-3 rounded-lg bg-[var(--error-bg)] text-[var(--error-text)] text-sm border border-[var(--error-border)]", children: ie }),
          /* @__PURE__ */ r("form", { onSubmit: Ue, className: "space-y-4", children: [
            /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-4", children: [
              /* @__PURE__ */ r("div", { children: [
                /* @__PURE__ */ t("label", { htmlFor: "user-firstName", className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: a("users.form.firstName") }),
                /* @__PURE__ */ t(
                  "input",
                  {
                    id: "user-firstName",
                    name: "firstName",
                    type: "text",
                    required: !0,
                    value: h.firstName,
                    onChange: (e) => f((s) => ({ ...s, firstName: e.target.value })),
                    autoComplete: "given-name",
                    "aria-label": a("users.form.firstName"),
                    className: "input w-full"
                  }
                )
              ] }),
              /* @__PURE__ */ r("div", { children: [
                /* @__PURE__ */ t("label", { htmlFor: "user-lastName", className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: a("users.form.lastName") }),
                /* @__PURE__ */ t(
                  "input",
                  {
                    id: "user-lastName",
                    name: "lastName",
                    type: "text",
                    required: !0,
                    value: h.lastName,
                    onChange: (e) => f((s) => ({ ...s, lastName: e.target.value })),
                    autoComplete: "family-name",
                    "aria-label": a("users.form.lastName"),
                    className: "input w-full"
                  }
                )
              ] })
            ] }),
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ t("label", { htmlFor: "user-email", className: "block text-sm font-medium text-[var(--text-secondary)] mb-1", children: a("users.columns.email") }),
              /* @__PURE__ */ t(
                "input",
                {
                  id: "user-email",
                  name: "email",
                  type: "email",
                  required: !0,
                  value: h.email,
                  onChange: (e) => f((s) => ({ ...s, email: e.target.value })),
                  autoComplete: "email",
                  "aria-label": a("users.columns.email"),
                  className: "input w-full"
                }
              )
            ] }),
            /* @__PURE__ */ r("div", { children: [
              /* @__PURE__ */ t("label", { className: "block text-sm font-medium text-[var(--text-secondary)] mb-2", children: a("users.form.roles") }),
              /* @__PURE__ */ t("div", { className: "space-y-2 max-h-48 overflow-y-auto p-3 border border-[var(--border-color)] rounded-lg bg-[var(--bg-secondary)]", children: ae.map((e) => /* @__PURE__ */ r("label", { htmlFor: `user-role-${e.id}`, className: "flex items-center gap-3 cursor-pointer p-2 rounded-lg hover:bg-[var(--bg-hover)] transition-colors", children: [
                /* @__PURE__ */ t(
                  "input",
                  {
                    id: `user-role-${e.id}`,
                    name: `role-${e.id}`,
                    type: "checkbox",
                    checked: h.roleIds?.includes(e.id) || !1,
                    onChange: () => Re(e.id),
                    className: "w-4 h-4 rounded border-[var(--border-color)] text-primary-600 focus:ring-primary-500",
                    "aria-label": e.name
                  }
                ),
                /* @__PURE__ */ r("div", { children: [
                  /* @__PURE__ */ t("span", { className: "text-[var(--text-primary)] font-medium", children: e.name }),
                  e.description && /* @__PURE__ */ t("p", { className: "text-xs text-[var(--text-tertiary)]", children: e.description })
                ] })
              ] }, e.id)) })
            ] }),
            /* @__PURE__ */ t(
              U,
              {
                name: "users.form.fields.after",
                context: {
                  formData: h,
                  onChange: (e, s) => {
                    if (e.startsWith("ext.")) {
                      const i = e.substring(4);
                      f((xe) => ({
                        ...xe,
                        ext: { ...xe.ext || {}, [i]: s }
                      }));
                    } else
                      f((i) => ({ ...i, [e]: s }));
                  },
                  disabled: K,
                  isEditing: !!w,
                  user: w
                }
              }
            ),
            /* @__PURE__ */ r("div", { className: "flex justify-end gap-2 pt-4", children: [
              /* @__PURE__ */ t(
                "button",
                {
                  type: "button",
                  onClick: () => $(!1),
                  className: "btn btn-secondary",
                  children: a("common.cancel")
                }
              ),
              /* @__PURE__ */ r(
                "button",
                {
                  type: "submit",
                  disabled: K,
                  className: "btn btn-primary disabled:opacity-50",
                  children: [
                    K && /* @__PURE__ */ t(F, { className: "w-4 h-4 animate-spin" }),
                    a("common.save")
                  ]
                }
              )
            ] })
          ] })
        ] }) })
      ]
    }
  );
}
export {
  vt as UsersPage
};
//# sourceMappingURL=UsersPage-rT3sFx_o.js.map
