import { defineComponent, ref, computed, unref, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderStyle, ssrRenderAttr, ssrRenderClass } from "vue/server-renderer"; import "/app/node_modules/hookable/dist/index.mjs"; import "/app/node_modules/klona/dist/index.mjs"; import { a as useI18n } from "../server.mjs"; import "/app/node_modules/ofetch/dist/node.mjs"; import "#internal/nuxt/paths"; import "/app/node_modules/unctx/dist/index.mjs"; import "/app/node_modules/h3/dist/index.mjs"; import "pinia"; import "/app/node_modules/defu/dist/defu.mjs"; import "vue-router"; import "/app/node_modules/ufo/dist/index.mjs"; import "/app/node_modules/cookie-es/dist/index.mjs"; import "/app/node_modules/destr/dist/index.mjs"; import "/app/node_modules/ohash/dist/index.mjs"; import "/app/node_modules/@unhead/vue/dist/index.mjs"; import "@vue/devtools-api"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const stats = ref({ total_users: 0, active_users: 0, deleted_users: 0, banned_users: 0, new_users_today: 0, new_users_this_week: 0, new_users_this_month: 0, users_by_role: {}, users_by_plan: {}, users_by_language: {}, users_with_person: 0, users_without_person: 0, total_vehicles: 0, active_organizations_count: 0, total_memberships: 0, registration_trend: [] }); const registrationTrend = computed(() => { const trend = stats.value.registration_trend; if (!trend.length) return []; const maxCount = Math.max(...trend.map((d) => d.count)); return trend.map((d) => ({ date: d.date, count: d.count, height: maxCount > 0 ? d.count / maxCount * 100 : 0 })); }); function formatNumber(num) { return new Intl.NumberFormat().format(num); } const recentActivities = [ { text: "New user registered: john.doe@example.com", time: "2 minutes ago", dotColor: "bg-emerald-400" }, { text: "Vehicle #V-8842 added to catalog", time: "15 minutes ago", dotColor: "bg-cyan-400" }, { text: "Payment received: €120.00 from Garage XYZ", time: "1 hour ago", dotColor: "bg-emerald-400" }, { text: "System error: DVLA API timeout on request #4421", time: "2 hours ago", dotColor: "bg-rose-400" }, { text: "Permission updated for user: superadmin@sf.hu", time: "3 hours ago", dotColor: "bg-indigo-400" } ]; return (_ctx, _push, _parent, _attrs) => { _push(`

${ssrInterpolate(unref(t)("dashboard.title"))}

${ssrInterpolate(unref(t)("dashboard.subtitle"))}

`); if (unref(loading)) { _push(`
${ssrInterpolate(unref(t)("dashboard.loading"))}
`); } else if (unref(error)) { _push(`

${ssrInterpolate(unref(t)("dashboard.error"))}

`); } else { _push(`
`); if (unref(stats).new_users_this_month > 0) { _push(`+${ssrInterpolate(unref(stats).new_users_this_month)}`); } else { _push(``); } _push(`

${ssrInterpolate(unref(t)("dashboard.active_users"))}

${ssrInterpolate(formatNumber(unref(stats).active_users))}

${ssrInterpolate(formatNumber(unref(stats).new_users_this_month))} ${ssrInterpolate(unref(t)("dashboard.new_this_month"))}

${ssrInterpolate(unref(t)("dashboard.total_vehicles"))}

${ssrInterpolate(formatNumber(unref(stats).total_vehicles))}

${ssrInterpolate(unref(t)("dashboard.organizations"))}

${ssrInterpolate(formatNumber(unref(stats).active_organizations_count))}

${ssrInterpolate(formatNumber(unref(stats).total_memberships))} ${ssrInterpolate(unref(t)("dashboard.memberships"))}

${ssrInterpolate(unref(t)("dashboard.new_users"))}

${ssrInterpolate(formatNumber(unref(stats).new_users_this_month))}

${ssrInterpolate(formatNumber(unref(stats).new_users_today))} ${ssrInterpolate(unref(t)("dashboard.new_today"))}

${ssrInterpolate(unref(t)("dashboard.users_by_role"))}

`); ssrRenderList(unref(stats).users_by_role, (count, role) => { _push(`
${ssrInterpolate(role)}${ssrInterpolate(count)}
`); }); _push(`

${ssrInterpolate(unref(t)("dashboard.users_by_plan"))}

`); ssrRenderList(unref(stats).users_by_plan, (count, plan) => { _push(`
${ssrInterpolate(plan)}${ssrInterpolate(count)}
`); }); _push(`

${ssrInterpolate(unref(t)("dashboard.users_by_language"))}

`); ssrRenderList(unref(stats).users_by_language, (count, lang) => { _push(`
${ssrInterpolate(lang)}${ssrInterpolate(count)}
`); }); _push(`

${ssrInterpolate(unref(t)("dashboard.registration_trend"))}

`); ssrRenderList(unref(registrationTrend), (day, idx) => { _push(`
${ssrInterpolate(day.date)}: ${ssrInterpolate(day.count)}
`); }); _push(`

${ssrInterpolate(unref(t)("dashboard.quick_actions"))}

${ssrInterpolate(unref(t)("dashboard.recent_activity"))}

`); ssrRenderList(recentActivities, (activity, index) => { _push(`

${ssrInterpolate(activity.text)}

${ssrInterpolate(activity.time)}

`); }); _push(`
`); } _push(``); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/index.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=index-Cv2HQkhy.js.map