import { _ as __nuxt_component_0 } from './nuxt-link-1NBbHb-h.mjs'; import { defineComponent, ref, computed, watch, createVNode, resolveDynamicComponent, withCtx, openBlock, createBlock, createTextVNode, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderList, ssrRenderVNode, ssrRenderStyle, ssrRenderAttr, ssrIncludeBooleanAttr, ssrRenderComponent, ssrLooseContain, ssrLooseEqual } from 'vue/server-renderer'; import { useRoute, useRouter } from 'vue-router'; import { d as useCookie } from './server.mjs'; import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.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: "[id]", __ssrInlineRender: true, setup(__props) { const route = useRoute(); useRouter(); const loading = ref(true); const error = ref(false); const provider = ref(null); const actionLoading = ref(false); ref(null); const showRejectModal = ref(false); const rejectReason = ref(""); const showFlagModal = ref(false); const flagReason = ref(""); const showEditModal = ref(false); const editLoading = ref(false); const editForm = ref({}); const activeTab = ref("data"); const validations = ref([]); const validationsLoading = ref(false); const history = ref([]); const historyLoading = ref(false); const statusForm = ref({ status: "pending", validation_score: 0, reason: "" }); const statusLoading = ref(false); const tabs = [ { key: "data", label: "Adatok", icon: "svg" }, { key: "status", label: "St\xE1tusz", icon: "svg" }, { key: "validations", label: "Valid\xE1ci\xF3k", icon: "svg" }, { key: "history", label: "El\u0151zm\xE9nyek", icon: "svg" } ]; const statusBannerClass = computed(() => { var _a; switch ((_a = provider.value) == null ? void 0 : _a.status) { case "approved": return "bg-emerald-500/10 border-emerald-500/30"; case "pending": return "bg-amber-500/10 border-amber-500/30"; default: return "bg-rose-500/10 border-rose-500/30"; } }); const statusIconClass = computed(() => { var _a; switch ((_a = provider.value) == null ? void 0 : _a.status) { case "approved": return "bg-emerald-500/20 text-emerald-400"; case "pending": return "bg-amber-500/20 text-amber-400"; default: return "bg-rose-500/20 text-rose-400"; } }); const statusTextClass = computed(() => { var _a; switch ((_a = provider.value) == null ? void 0 : _a.status) { case "approved": return "text-emerald-400"; case "pending": return "text-amber-400"; default: return "text-rose-400"; } }); const statusSubtextClass = computed(() => { var _a; switch ((_a = provider.value) == null ? void 0 : _a.status) { case "approved": return "text-emerald-400/60"; case "pending": return "text-amber-400/60"; default: return "text-rose-400/60"; } }); function statusLabel(status) { switch (status) { case "approved": return "J\xF3v\xE1hagyva"; case "pending": return "F\xFCgg\u0151ben"; case "rejected": return "Elutas\xEDtva"; default: return "Ismeretlen"; } } function statusDescription(status) { switch (status) { case "approved": return "A szolg\xE1ltat\xF3 akt\xEDv \xE9s l\xE1that\xF3 a felhaszn\xE1l\xF3k sz\xE1m\xE1ra."; case "pending": return "A szolg\xE1ltat\xF3 m\xE9g nem lett j\xF3v\xE1hagyva, moder\xE1l\xE1sra v\xE1r."; case "rejected": return "A szolg\xE1ltat\xF3 elutas\xEDt\xE1sra ker\xFClt, nem l\xE1that\xF3 a felhaszn\xE1l\xF3k sz\xE1m\xE1ra."; default: return ""; } } function validationTypeLabel(type) { const labels = { phone_verified: "Telefon igazolt", email_verified: "Email igazolt", address_verified: "C\xEDm igazolt", website_verified: "Weboldal igazolt", manual_review: "K\xE9zi ellen\u0151rz\xE9s", community_vouch: "K\xF6z\xF6ss\xE9gi aj\xE1nl\xE1s", business_hours: "Nyitvatart\xE1s ellen\u0151rz\xF6tt", photo_evidence: "F\xE9nyk\xE9p bizony\xEDt\xE9k" }; return labels[type] || type; } function validationTypeClass(type) { const classes = { phone_verified: "bg-emerald-500/20 text-emerald-400", email_verified: "bg-blue-500/20 text-blue-400", address_verified: "bg-amber-500/20 text-amber-400", website_verified: "bg-purple-500/20 text-purple-400", manual_review: "bg-indigo-500/20 text-indigo-400", community_vouch: "bg-pink-500/20 text-pink-400", business_hours: "bg-cyan-500/20 text-cyan-400", photo_evidence: "bg-orange-500/20 text-orange-400" }; return classes[type] || "bg-slate-500/20 text-slate-400"; } function historyActionLabel(action) { const labels = { approve: "J\xF3v\xE1hagy\xE1s", reject: "Elutas\xEDt\xE1s", restore: "Vissza\xE1ll\xEDt\xE1s", flag: "Megjel\xF6l\xE9s", update: "M\xF3dos\xEDt\xE1s", delete: "T\xF6rl\xE9s", create: "L\xE9trehoz\xE1s" }; return labels[action] || action; } function historyActionClass(action) { const classes = { approve: "bg-emerald-500/20 text-emerald-400", reject: "bg-rose-500/20 text-rose-400", restore: "bg-blue-500/20 text-blue-400", flag: "bg-purple-500/20 text-purple-400", update: "bg-amber-500/20 text-amber-400", delete: "bg-red-500/20 text-red-400", create: "bg-green-500/20 text-green-400" }; return classes[action] || "bg-slate-500/20 text-slate-400"; } function historyDotClass(action) { const classes = { approve: "border-emerald-500 bg-emerald-500/30", reject: "border-rose-500 bg-rose-500/30", restore: "border-blue-500 bg-blue-500/30", flag: "border-purple-500 bg-purple-500/30", update: "border-amber-500 bg-amber-500/30", delete: "border-red-500 bg-red-500/30", create: "border-green-500 bg-green-500/30" }; return classes[action] || "border-slate-500 bg-slate-500/30"; } function formatDate(dateStr) { if (!dateStr) return "\u2014"; try { const d = new Date(dateStr); return d.toLocaleDateString("hu-HU", { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" }); } catch { return dateStr; } } function getHeaders() { const token = useCookie("access_token").value; const headers = { "Content-Type": "application/json" }; if (token) headers["Authorization"] = `Bearer ${token}`; return headers; } async function fetchValidations() { validationsLoading.value = true; try { const res = await $fetch(`/api/v1/admin/providers/${route.params.id}/validations`, { headers: getHeaders() }); validations.value = res || []; } catch (err) { console.error("Failed to fetch validations:", err); validations.value = []; } finally { validationsLoading.value = false; } } async function fetchHistory() { historyLoading.value = true; try { const res = await $fetch(`/api/v1/admin/providers/${route.params.id}/history`, { headers: getHeaders() }); history.value = res || []; } catch (err) { console.error("Failed to fetch history:", err); history.value = []; } finally { historyLoading.value = false; } } function onTabChange(tab) { if (tab === "validations" && validations.value.length === 0) { fetchValidations(); } if (tab === "history" && history.value.length === 0) { fetchHistory(); } } watch(activeTab, onTabChange); return (_ctx, _push, _parent, _attrs) => { var _a, _b, _c; const _component_NuxtLink = __nuxt_component_0; _push(`
Szolg\xE1ltat\xF3 #${ssrInterpolate(_ctx.$route.params.id)}
Hiba t\xF6rt\xE9nt a szolg\xE1ltat\xF3 bet\xF6lt\xE9se k\xF6zben.
A szolg\xE1ltat\xF3 nem tal\xE1lhat\xF3.
${ssrInterpolate(statusLabel(provider.value.status))}
${ssrInterpolate(statusDescription(provider.value.status))}
${ssrInterpolate(provider.value.source)}A szolg\xE1ltat\xF3 ${ssrInterpolate(provider.value.status === "rejected" ? "elutas\xEDt\xE1sra" : "megjel\xF6l\xE9sre")} ker\xFClt.
`); if (provider.value.status === "rejected") { _push(``); } else { _push(``); } _push(`M\xF3dos\xEDtsd a szolg\xE1ltat\xF3 st\xE1tusz\xE1t \xE9s valid\xE1ci\xF3s pontsz\xE1m\xE1t.
A szolg\xE1ltat\xF3hoz tartoz\xF3 gamification valid\xE1ci\xF3s bejegyz\xE9sek list\xE1ja.
`); if (validationsLoading.value) { _push(``); } else if (validations.value.length === 0) { _push(`Nincsenek valid\xE1ci\xF3s bejegyz\xE9sek ehhez a szolg\xE1ltat\xF3hoz.
Szavaz\xF3: ${ssrInterpolate(v.voter_name || `User #${v.voter_user_id}`)}
`); if ((_a2 = v.validation_metadata) == null ? void 0 : _a2.reason) { _push(`Indokl\xE1s: ${ssrInterpolate(v.validation_metadata.reason)}
`); } else { _push(``); } _push(`Id\u0151vonal: ki, mikor \xE9s mit v\xE1ltoztatott a szolg\xE1ltat\xF3val kapcsolatban.
`); if (historyLoading.value) { _push(``); } else if (history.value.length === 0) { _push(`Nincsenek el\u0151zm\xE9nyek ehhez a szolg\xE1ltat\xF3hoz.
Biztosan elutas\xEDtod a(z) ${ssrInterpolate((_a = provider.value) == null ? void 0 : _a.name)} szolg\xE1ltat\xF3t?
M\xF3dos\xEDtsd a(z) ${ssrInterpolate((_b = provider.value) == null ? void 0 : _b.name)} szolg\xE1ltat\xF3 adatait.
Biztosan megjel\xF6l\xF6d a(z) ${ssrInterpolate((_c = provider.value) == null ? void 0 : _c.name)} szolg\xE1ltat\xF3t?