Files
service-finder/frontend_admin/.output/server/chunks/build/index-Bd_e7zBi.mjs
2026-06-29 14:11:15 +00:00

331 lines
38 KiB
JavaScript

import { _ as __nuxt_component_0 } from './nuxt-link-Ci8vU-Yt.mjs';
import { defineComponent, ref, computed, withCtx, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderList, ssrRenderComponent, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual } from 'vue/server-renderer';
import { useRoute, useRouter } from 'vue-router';
import { c as useAuthStore } from './server.mjs';
import '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'node:crypto';
import 'node:url';
import 'pinia';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';
import 'unhead/plugins';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "index",
__ssrInlineRender: true,
setup(__props) {
const route = useRoute();
useRouter();
const auth = useAuthStore();
route.params.id;
const loading = ref(true);
const error = ref(null);
const user = ref(null);
const memberships = ref([]);
const membershipsLoading = ref(false);
const activeTab = ref("profile");
const showEditModal = ref(false);
const saving = ref(false);
const editForm = ref({
email: "",
preferred_language: "",
region_code: "",
preferred_currency: "",
subscription_plan: "",
subscription_expires_at: "",
scope_level: "",
scope_id: "",
is_active: true,
is_vip: false,
person_last_name: "",
person_first_name: "",
person_phone: "",
person_mothers_last_name: "",
person_mothers_first_name: "",
person_birth_place: "",
person_birth_date: ""
});
const notification = ref({ show: false, type: "success", message: "" });
const tabs = [
{ key: "profile", label: "users.details.profile_tab" },
{ key: "memberships", label: "users.details.memberships_tab" }
];
const userDisplayName = computed(() => {
if (!user.value) return "";
const p = user.value.person;
if ((p == null ? void 0 : p.last_name) || (p == null ? void 0 : p.first_name)) {
return [p.last_name, p.first_name].filter(Boolean).join(" ");
}
return user.value.email || "User #" + user.value.id;
});
const statusLabel = computed(() => {
var _a;
if (!user.value) return "";
const map = {
active: "Active",
inactive: "Inactive",
deleted: "Deleted",
banned: "Banned"
};
return map[(_a = user.value.status) == null ? void 0 : _a.toLowerCase()] || user.value.status || "Active";
});
const statusBadgeClass = computed(() => {
var _a;
if (!user.value) return "";
const map = {
active: "bg-emerald-500/10 text-emerald-400",
inactive: "bg-slate-500/10 text-slate-400",
deleted: "bg-red-500/10 text-red-400",
banned: "bg-red-500/10 text-red-400"
};
return map[(_a = user.value.status) == null ? void 0 : _a.toLowerCase()] || "bg-emerald-500/10 text-emerald-400";
});
const statusDotClass = computed(() => {
var _a;
if (!user.value) return "";
const map = {
active: "bg-emerald-400",
inactive: "bg-slate-400",
deleted: "bg-red-400",
banned: "bg-red-400"
};
return map[(_a = user.value.status) == null ? void 0 : _a.toLowerCase()] || "bg-emerald-400";
});
const hasEditPermission = computed(() => {
var _a, _b;
if (auth.isAdmin) return true;
return !!((_b = (_a = auth.user) == null ? void 0 : _a.system_capabilities) == null ? void 0 : _b["users:edit"]);
});
function getInitials(name) {
if (!name) return "?";
return name.split(" ").map((w) => w[0]).join("").toUpperCase().slice(0, 2);
}
function getInitialsColor(name) {
const colors = [
"bg-red-500",
"bg-yellow-500",
"bg-green-500",
"bg-blue-500",
"bg-indigo-500",
"bg-purple-500",
"bg-pink-500",
"bg-teal-500"
];
let hash = 0;
for (let i = 0; i < (name || "").length; i++) {
hash = name.charCodeAt(i) + ((hash << 5) - hash);
}
return colors[Math.abs(hash) % colors.length];
}
function formatDate(date) {
if (!date) return "";
try {
return new Date(date).toLocaleDateString("en-GB", {
year: "numeric",
month: "short",
day: "numeric"
});
} catch {
return String(date);
}
}
function roleLabel(role) {
const map = {
admin: "Admin",
user: "User",
staff: "Staff",
superadmin: "Superadmin"
};
return map[role == null ? void 0 : role.toLowerCase()] || role || "User";
}
function roleBadgeClass(role) {
const map = {
admin: "bg-purple-500/10 text-purple-400",
user: "bg-blue-500/10 text-blue-400",
staff: "bg-cyan-500/10 text-cyan-400",
superadmin: "bg-amber-500/10 text-amber-400"
};
return map[role == null ? void 0 : role.toLowerCase()] || "bg-slate-500/10 text-slate-400";
}
function planBadgeClass(plan) {
const map = {
FREE: "bg-slate-500/10 text-slate-400",
PREMIUM: "bg-emerald-500/10 text-emerald-400",
ENTERPRISE: "bg-amber-500/10 text-amber-400"
};
return map[plan == null ? void 0 : plan.toUpperCase()] || "bg-slate-500/10 text-slate-400";
}
function orgRoleLabel(role) {
const map = {
admin: "Admin",
manager: "Manager",
member: "Member",
owner: "Owner"
};
return map[role == null ? void 0 : role.toLowerCase()] || role || "Member";
}
function memberStatusLabel(status) {
const map = {
active: "Active",
invited: "Invited",
suspended: "Suspended",
inactive: "Inactive"
};
return map[status == null ? void 0 : status.toLowerCase()] || status || "Unknown";
}
function memberStatusBadgeClass(status) {
const map = {
active: "bg-emerald-500/10 text-emerald-400",
invited: "bg-blue-500/10 text-blue-400",
suspended: "bg-red-500/10 text-red-400",
inactive: "bg-slate-500/10 text-slate-400"
};
return map[status == null ? void 0 : status.toLowerCase()] || "bg-slate-500/10 text-slate-400";
}
function memberStatusDotClass(status) {
const map = {
active: "bg-emerald-400",
invited: "bg-blue-400",
suspended: "bg-red-400",
inactive: "bg-slate-400"
};
return map[status == null ? void 0 : status.toLowerCase()] || "bg-slate-400";
}
return (_ctx, _push, _parent, _attrs) => {
var _a;
const _component_NuxtLink = __nuxt_component_0;
_push(`<div${ssrRenderAttrs(_attrs)}>`);
if (loading.value) {
_push(`<div class="flex items-center justify-center py-20"><div class="flex flex-col items-center gap-3"><svg class="w-8 h-8 text-indigo-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg><p class="text-slate-400 text-sm">${ssrInterpolate(_ctx.$t("users.details.loading"))}</p></div></div>`);
} else if (error.value) {
_push(`<div class="flex flex-col items-center justify-center py-20 text-center"><svg class="w-12 h-12 text-red-500 mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"></path></svg><p class="text-red-400 text-sm mb-2">${ssrInterpolate(error.value)}</p><button class="px-4 py-2 text-sm bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition">${ssrInterpolate(_ctx.$t("users.details.retry"))}</button></div>`);
} else if (user.value) {
_push(`<!--[--><div class="mb-8"><button class="inline-flex items-center gap-1.5 text-sm text-slate-400 hover:text-white transition mb-4"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg> ${ssrInterpolate(_ctx.$t("users.details.back"))}</button><div class="flex items-center justify-between"><div class="flex items-center gap-4"><div class="${ssrRenderClass([getInitialsColor(userDisplayName.value), "w-12 h-12 rounded-xl flex items-center justify-center text-lg font-bold text-white"])}">${ssrInterpolate(getInitials(userDisplayName.value))}</div><div><div class="flex items-center gap-3"><h1 class="text-2xl font-bold text-white">${ssrInterpolate(userDisplayName.value)}</h1><span class="${ssrRenderClass([statusBadgeClass.value, "inline-flex items-center px-3 py-1 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([statusDotClass.value, "w-1.5 h-1.5 rounded-full mr-1.5"])}"></span> ${ssrInterpolate(statusLabel.value)}</span>`);
if (user.value.is_vip) {
_push(`<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-500/10 text-yellow-400"><svg class="w-3 h-3 mr-1" fill="currentColor" viewBox="0 0 20 20"><path d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"></path></svg> VIP </span>`);
} else {
_push(`<!---->`);
}
_push(`</div><p class="text-sm text-slate-400 mt-0.5">${ssrInterpolate(user.value.email)} `);
if ((_a = user.value.person) == null ? void 0 : _a.phone) {
_push(`<span class="ml-2 text-slate-500">\xB7 ${ssrInterpolate(user.value.person.phone)}</span>`);
} else {
_push(`<!---->`);
}
_push(`</p></div></div><div class="flex items-center gap-3">`);
if (hasEditPermission.value) {
_push(`<button class="inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-indigo-600/20 text-indigo-300 hover:bg-indigo-600/30 rounded-lg transition"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg> ${ssrInterpolate(_ctx.$t("users.details.edit"))}</button>`);
} else {
_push(`<!---->`);
}
_push(`</div></div></div><div class="border-b border-slate-700 mb-6"><nav class="flex gap-6"><!--[-->`);
ssrRenderList(tabs, (tab) => {
_push(`<button class="${ssrRenderClass([activeTab.value === tab.key ? "text-indigo-400 border-indigo-400" : "text-slate-400 border-transparent hover:text-slate-300", "pb-3 text-sm font-medium transition border-b-2 -mb-px"])}">${ssrInterpolate(_ctx.$t(tab.label))}</button>`);
});
_push(`<!--]--></nav></div>`);
if (activeTab.value === "profile") {
_push(`<div class="space-y-6"><div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-indigo-500/10 text-indigo-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("users.details.account_info"))}</h3></div><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.user_id"))}</label><p class="text-sm text-white font-mono">${ssrInterpolate(user.value.id)}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.email"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.email)}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.role"))}</label><span class="${ssrRenderClass([roleBadgeClass(user.value.role), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(roleLabel(user.value.role))}</span></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.registration_date"))}</label><p class="text-sm text-white">${ssrInterpolate(formatDate(user.value.created_at))}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.last_login"))}</label><p class="text-sm text-white">${ssrInterpolate(formatDate(user.value.last_login_at) || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.ui_mode"))}</label><p class="text-sm text-white capitalize">${ssrInterpolate(user.value.ui_mode || "personal")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.language"))}</label><p class="text-sm text-white uppercase">${ssrInterpolate(user.value.preferred_language || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.region"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.region_code || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.currency"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.preferred_currency || "\u2014")}</p></div></div></div><div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-emerald-500/10 text-emerald-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("users.details.subscription_info"))}</h3></div><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.package"))}</label><span class="${ssrRenderClass([planBadgeClass(user.value.subscription_plan), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(user.value.subscription_plan || "\u2014")}</span></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.subscription_expires"))}</label><p class="text-sm text-white">${ssrInterpolate(formatDate(user.value.subscription_expires_at) || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.scope_level"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.scope_level || "individual")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.max_vehicles"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.max_vehicles)}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.max_garages"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.max_garages)}</p></div></div></div>`);
if (user.value.person) {
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6"><div class="flex items-center gap-3 mb-5"><div class="p-2 rounded-lg bg-cyan-500/10 text-cyan-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("users.details.personal_info"))}</h3></div><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.last_name"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.person.last_name || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.first_name"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.person.first_name || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.phone"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.person.phone || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.birth_place"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.person.birth_place || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.birth_date"))}</label><p class="text-sm text-white">${ssrInterpolate(formatDate(user.value.person.birth_date) || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.mothers_name"))}</label><p class="text-sm text-white">${ssrInterpolate([user.value.person.mothers_last_name, user.value.person.mothers_first_name].filter(Boolean).join(" ") || "\u2014")}</p></div></div>`);
if (user.value.person.address) {
_push(`<div class="mt-6 pt-6 border-t border-slate-700"><h4 class="text-sm font-semibold text-slate-300 mb-3">${ssrInterpolate(_ctx.$t("users.details.address"))}</h4><div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.zip"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.person.address.address_zip || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.city"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.person.address.address_city || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.street"))}</label><p class="text-sm text-white">${ssrInterpolate([user.value.person.address.address_street_type, user.value.person.address.address_street_name].filter(Boolean).join(" ") || "\u2014")}</p></div><div><label class="block text-xs text-slate-400 mb-1">${ssrInterpolate(_ctx.$t("users.details.house_number"))}</label><p class="text-sm text-white">${ssrInterpolate(user.value.person.address.address_house_number || "\u2014")}</p></div></div></div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
} else {
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-6 text-center"><svg class="w-10 h-10 text-slate-600 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg><p class="text-sm text-slate-400">${ssrInterpolate(_ctx.$t("users.details.no_person_record"))}</p></div>`);
}
_push(`</div>`);
} else {
_push(`<!---->`);
}
if (activeTab.value === "memberships") {
_push(`<div class="space-y-6"><div class="flex items-center justify-between"><div class="flex items-center gap-3"><div class="p-2 rounded-lg bg-purple-500/10 text-purple-400"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16l3.5-2 3.5 2 3.5-2 3.5 2M10 8.5a.5.5 0 11-1 0 .5.5 0 011 0zm5 5a.5.5 0 11-1 0 .5.5 0 011 0z"></path></svg></div><div><h3 class="text-base font-semibold text-white">${ssrInterpolate(_ctx.$t("users.details.memberships"))}</h3><p class="text-xs text-slate-400 mt-0.5">${ssrInterpolate(_ctx.$t("users.details.memberships_count", { count: memberships.value.length }))}</p></div></div></div>`);
if (membershipsLoading.value) {
_push(`<div class="flex items-center justify-center py-12"><svg class="w-6 h-6 text-indigo-400 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg></div>`);
} else if (memberships.value.length === 0) {
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl p-12 text-center"><svg class="w-10 h-10 text-slate-600 mx-auto mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg><p class="text-sm text-slate-400">${ssrInterpolate(_ctx.$t("users.details.no_memberships"))}</p></div>`);
} else {
_push(`<div class="bg-slate-800/50 border border-slate-700 rounded-xl overflow-hidden"><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="border-b border-slate-700"><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("users.details.org_name"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("users.details.org_role"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("users.details.member_status"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("users.details.joined_at"))}</th><th class="text-left px-4 py-3 text-xs font-medium text-slate-400 uppercase tracking-wider">${ssrInterpolate(_ctx.$t("users.details.verified"))}</th></tr></thead><tbody><!--[-->`);
ssrRenderList(memberships.value, (m) => {
_push(`<tr class="border-b border-slate-700/50 last:border-b-0 hover:bg-slate-700/30 transition"><td class="px-4 py-3">`);
_push(ssrRenderComponent(_component_NuxtLink, {
to: "/garages/" + m.organization_id,
class: "text-sm font-medium text-white hover:text-indigo-400 hover:underline transition-colors"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(m.organization_display_name || m.organization_name)}`);
} else {
return [
createTextVNode(toDisplayString(m.organization_display_name || m.organization_name), 1)
];
}
}),
_: 2
}, _parent));
_push(`</td><td class="px-4 py-3"><span class="${ssrRenderClass([roleBadgeClass(m.role), "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium"])}">${ssrInterpolate(orgRoleLabel(m.role))}</span></td><td class="px-4 py-3"><span class="${ssrRenderClass([memberStatusBadgeClass(m.status), "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium"])}"><span class="${ssrRenderClass([memberStatusDotClass(m.status), "w-1.5 h-1.5 rounded-full"])}"></span> ${ssrInterpolate(memberStatusLabel(m.status))}</span></td><td class="px-4 py-3 text-slate-300 text-xs">${ssrInterpolate(formatDate(m.joined_at) || "\u2014")}</td><td class="px-4 py-3">`);
if (m.is_verified) {
_push(`<span class="inline-flex items-center gap-1 text-xs text-emerald-400"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg> ${ssrInterpolate(_ctx.$t("users.details.verified_yes"))}</span>`);
} else {
_push(`<span class="text-xs text-slate-500">${ssrInterpolate(_ctx.$t("users.details.verified_no"))}</span>`);
}
_push(`</td></tr>`);
});
_push(`<!--]--></tbody></table></div></div>`);
}
_push(`</div>`);
} else {
_push(`<!---->`);
}
if (showEditModal.value) {
_push(`<div class="fixed inset-0 z-50 flex items-center justify-center p-4"><div class="absolute inset-0 bg-black/60 backdrop-blur-sm"></div><div class="relative w-full max-w-2xl bg-slate-800 border border-slate-700 rounded-2xl shadow-2xl max-h-[90vh] overflow-hidden flex flex-col"><div class="px-6 py-4 border-b border-slate-700 flex items-center justify-between flex-shrink-0"><h3 class="text-lg font-semibold text-white">${ssrInterpolate(_ctx.$t("users.details.edit_user"))}</h3><button class="p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-700 transition"><svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button></div><div class="flex-1 overflow-y-auto p-6 space-y-5"><div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.email"))}</label><input${ssrRenderAttr("value", editForm.value.email)} type="email" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.preferred_language"))}</label><select class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"><option value="hu"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.preferred_language) ? ssrLooseContain(editForm.value.preferred_language, "hu") : ssrLooseEqual(editForm.value.preferred_language, "hu")) ? " selected" : ""}>HU</option><option value="en"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.preferred_language) ? ssrLooseContain(editForm.value.preferred_language, "en") : ssrLooseEqual(editForm.value.preferred_language, "en")) ? " selected" : ""}>EN</option><option value="de"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.preferred_language) ? ssrLooseContain(editForm.value.preferred_language, "de") : ssrLooseEqual(editForm.value.preferred_language, "de")) ? " selected" : ""}>DE</option><option value="ro"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.preferred_language) ? ssrLooseContain(editForm.value.preferred_language, "ro") : ssrLooseEqual(editForm.value.preferred_language, "ro")) ? " selected" : ""}>RO</option></select></div></div><div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.region"))}</label><input${ssrRenderAttr("value", editForm.value.region_code)} type="text" maxlength="5" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.currency"))}</label><input${ssrRenderAttr("value", editForm.value.preferred_currency)} type="text" maxlength="3" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div></div><div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.package"))}</label><select class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"><option value="FREE"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.subscription_plan) ? ssrLooseContain(editForm.value.subscription_plan, "FREE") : ssrLooseEqual(editForm.value.subscription_plan, "FREE")) ? " selected" : ""}>FREE</option><option value="PREMIUM"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.subscription_plan) ? ssrLooseContain(editForm.value.subscription_plan, "PREMIUM") : ssrLooseEqual(editForm.value.subscription_plan, "PREMIUM")) ? " selected" : ""}>PREMIUM</option><option value="ENTERPRISE"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.subscription_plan) ? ssrLooseContain(editForm.value.subscription_plan, "ENTERPRISE") : ssrLooseEqual(editForm.value.subscription_plan, "ENTERPRISE")) ? " selected" : ""}>ENTERPRISE</option></select></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.subscription_expires"))}</label><input${ssrRenderAttr("value", editForm.value.subscription_expires_at)} type="datetime-local" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div></div><div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.scope_level"))}</label><select class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"><option value="individual"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.scope_level) ? ssrLooseContain(editForm.value.scope_level, "individual") : ssrLooseEqual(editForm.value.scope_level, "individual")) ? " selected" : ""}>individual</option><option value="organization"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.scope_level) ? ssrLooseContain(editForm.value.scope_level, "organization") : ssrLooseEqual(editForm.value.scope_level, "organization")) ? " selected" : ""}>organization</option><option value="group"${ssrIncludeBooleanAttr(Array.isArray(editForm.value.scope_level) ? ssrLooseContain(editForm.value.scope_level, "group") : ssrLooseEqual(editForm.value.scope_level, "group")) ? " selected" : ""}>group</option></select></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.scope_id"))}</label><input${ssrRenderAttr("value", editForm.value.scope_id)} type="text" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div></div><div class="flex items-center gap-6 pt-2"><label class="flex items-center gap-2 cursor-pointer"><input${ssrIncludeBooleanAttr(Array.isArray(editForm.value.is_active) ? ssrLooseContain(editForm.value.is_active, null) : editForm.value.is_active) ? " checked" : ""} type="checkbox" class="rounded border-slate-600 bg-slate-700 text-indigo-600 focus:ring-indigo-500/50"><span class="text-sm text-slate-300">${ssrInterpolate(_ctx.$t("users.details.is_active"))}</span></label><label class="flex items-center gap-2 cursor-pointer"><input${ssrIncludeBooleanAttr(Array.isArray(editForm.value.is_vip) ? ssrLooseContain(editForm.value.is_vip, null) : editForm.value.is_vip) ? " checked" : ""} type="checkbox" class="rounded border-slate-600 bg-slate-700 text-indigo-600 focus:ring-indigo-500/50"><span class="text-sm text-slate-300">${ssrInterpolate(_ctx.$t("users.details.is_vip"))}</span></label></div><div class="border-t border-slate-700 pt-5"><h4 class="text-sm font-semibold text-white mb-4">${ssrInterpolate(_ctx.$t("users.details.personal_info"))}</h4><div class="grid grid-cols-1 md:grid-cols-2 gap-4"><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.last_name"))}</label><input${ssrRenderAttr("value", editForm.value.person_last_name)} type="text" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.first_name"))}</label><input${ssrRenderAttr("value", editForm.value.person_first_name)} type="text" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.phone"))}</label><input${ssrRenderAttr("value", editForm.value.person_phone)} type="text" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.mothers_name"))}</label><input${ssrRenderAttr("value", editForm.value.person_mothers_last_name)} type="text" placeholder="Last name" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.mothers_first_name"))}</label><input${ssrRenderAttr("value", editForm.value.person_mothers_first_name)} type="text" placeholder="First name" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.birth_place"))}</label><input${ssrRenderAttr("value", editForm.value.person_birth_place)} type="text" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div><div><label class="block text-xs font-medium text-slate-400 mb-1.5">${ssrInterpolate(_ctx.$t("users.details.birth_date"))}</label><input${ssrRenderAttr("value", editForm.value.person_birth_date)} type="date" class="w-full px-3 py-2 text-sm bg-slate-700/50 border border-slate-600 rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500"></div></div></div></div><div class="px-6 py-4 border-t border-slate-700 flex items-center justify-end gap-3 flex-shrink-0"><button class="px-4 py-2 text-sm font-medium text-slate-300 hover:text-white bg-slate-700/50 hover:bg-slate-700 rounded-lg transition">${ssrInterpolate(_ctx.$t("users.details.cancel"))}</button><button${ssrIncludeBooleanAttr(saving.value) ? " disabled" : ""} class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-indigo-600 text-white hover:bg-indigo-500 rounded-lg transition disabled:opacity-50">`);
if (saving.value) {
_push(`<svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>`);
} else {
_push(`<!---->`);
}
_push(` ${ssrInterpolate(saving.value ? _ctx.$t("users.details.saving") : _ctx.$t("users.details.save"))}</button></div></div></div>`);
} else {
_push(`<!---->`);
}
if (notification.value.show) {
_push(`<div class="${ssrRenderClass([notification.value.type === "success" ? "bg-emerald-600 text-white" : "bg-red-600 text-white", "fixed bottom-6 right-6 z-50 px-5 py-3 rounded-xl shadow-2xl text-sm font-medium transition-all"])}"><div class="flex items-center gap-2">`);
if (notification.value.type === "success") {
_push(`<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`);
} else {
_push(`<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>`);
}
_push(` ${ssrInterpolate(notification.value.message)}</div></div>`);
} else {
_push(`<!---->`);
}
_push(`<!--]-->`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
};
}
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/users/[id]/index.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export { _sfc_main as default };
//# sourceMappingURL=index-Bd_e7zBi.mjs.map