import { _ as __nuxt_component_0 } from './nuxt-link-1NBbHb-h.mjs'; import { defineComponent, ref, unref, withCtx, openBlock, createBlock, createVNode, createTextVNode, toDisplayString, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderComponent, ssrRenderList, ssrRenderClass } from 'vue/server-renderer'; import { a as useI18n } 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 'vue-router'; 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 { t } = useI18n(); const loading = ref(true); const error = ref(false); const stats = ref({ total_users: 0, active_season: null, pending_contributions: 0, today_xp: 0 }); const recentLedger = ref([]); const topLeaderboard = ref([]); return (_ctx, _push, _parent, _attrs) => { const _component_NuxtLink = __nuxt_component_0; _push(`

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

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

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

${ssrInterpolate(unref(t)("gamification.dashboard.load_error"))}

`); } else { _push(`

${ssrInterpolate(unref(t)("gamification.dashboard.total_users"))}

${ssrInterpolate(unref(stats).total_users)}

${ssrInterpolate(unref(t)("gamification.dashboard.active_season"))}

${ssrInterpolate(unref(stats).active_season || unref(t)("gamification.dashboard.none"))}

${ssrInterpolate(unref(t)("gamification.dashboard.pending_contributions"))}

${ssrInterpolate(unref(stats).pending_contributions)}

${ssrInterpolate(unref(t)("gamification.dashboard.today_xp"))}

${ssrInterpolate(unref(stats).today_xp)}

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

`); _push(ssrRenderComponent(_component_NuxtLink, { to: "/gamification/point-rules", class: "flex items-center gap-3 px-4 py-3 bg-slate-700/50 hover:bg-slate-700 rounded-lg text-sm text-slate-300 hover:text-white transition" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(` ${ssrInterpolate(unref(t)("gamification.dashboard.manage_point_rules"))}`); } else { return [ (openBlock(), createBlock("svg", { class: "w-5 h-5 text-amber-400 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, [ createVNode("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" }) ])), createTextVNode(" " + toDisplayString(unref(t)("gamification.dashboard.manage_point_rules")), 1) ]; } }), _: 1 }, _parent)); _push(ssrRenderComponent(_component_NuxtLink, { to: "/gamification/badges", class: "flex items-center gap-3 px-4 py-3 bg-slate-700/50 hover:bg-slate-700 rounded-lg text-sm text-slate-300 hover:text-white transition" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(` ${ssrInterpolate(unref(t)("gamification.dashboard.manage_badges"))}`); } else { return [ (openBlock(), createBlock("svg", { class: "w-5 h-5 text-violet-400 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, [ createVNode("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" }) ])), createTextVNode(" " + toDisplayString(unref(t)("gamification.dashboard.manage_badges")), 1) ]; } }), _: 1 }, _parent)); _push(ssrRenderComponent(_component_NuxtLink, { to: "/gamification/seasons", class: "flex items-center gap-3 px-4 py-3 bg-slate-700/50 hover:bg-slate-700 rounded-lg text-sm text-slate-300 hover:text-white transition" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(` ${ssrInterpolate(unref(t)("gamification.dashboard.manage_seasons"))}`); } else { return [ (openBlock(), createBlock("svg", { class: "w-5 h-5 text-emerald-400 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" }, [ createVNode("path", { "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) ])), createTextVNode(" " + toDisplayString(unref(t)("gamification.dashboard.manage_seasons")), 1) ]; } }), _: 1 }, _parent)); _push(`

${ssrInterpolate(unref(t)("gamification.dashboard.recent_ledger"))}

`); if (unref(recentLedger).length === 0) { _push(`
${ssrInterpolate(unref(t)("gamification.dashboard.no_ledger_entries"))}
`); } else { _push(`
`); ssrRenderList(unref(recentLedger), (entry) => { _push(`

${ssrInterpolate(entry.reason)}

${ssrInterpolate(entry.created_at)}

${ssrInterpolate(entry.points >= 0 ? "+" : "")}${ssrInterpolate(entry.points)}
`); }); _push(`
`); } _push(`

${ssrInterpolate(unref(t)("gamification.dashboard.top_5_leaderboard"))}

`); _push(ssrRenderComponent(_component_NuxtLink, { to: "/gamification/leaderboard", class: "text-sm text-indigo-400 hover:text-indigo-300 transition" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`${ssrInterpolate(unref(t)("gamification.dashboard.full_leaderboard"))} \u2192 `); } else { return [ createTextVNode(toDisplayString(unref(t)("gamification.dashboard.full_leaderboard")) + " \u2192 ", 1) ]; } }), _: 1 }, _parent)); _push(`
`); if (unref(topLeaderboard).length === 0) { _push(`
${ssrInterpolate(unref(t)("gamification.dashboard.no_leaderboard_data"))}
`); } else { _push(`
`); ssrRenderList(unref(topLeaderboard), (entry, idx) => { _push(`
#${ssrInterpolate(idx + 1)}

${ssrInterpolate(entry.user_name)}

${ssrInterpolate(unref(t)("gamification.dashboard.level"))} ${ssrInterpolate(entry.level)} \xB7 ${ssrInterpolate(entry.xp)} ${ssrInterpolate(unref(t)("gamification.dashboard.xp_abbr"))}

${ssrInterpolate(entry.total_points)} ${ssrInterpolate(unref(t)("gamification.dashboard.points"))}
`); }); _push(`
`); } _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/gamification/index.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=index-kkjYgRlj.mjs.map