import { defineComponent, ref, reactive, unref, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrIncludeBooleanAttr, 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: "badges", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const saving = ref(false); const badges = ref([]); const showModal = ref(false); const showDeleteModal = ref(false); const editingBadge = ref(null); const deletingBadge = ref(null); ref(false); const toast = ref(null); const form = reactive({ name: "", description: "", icon_url: "" }); return (_ctx, _push, _parent, _attrs) => { _push(`

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

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

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

${ssrInterpolate(unref(t)("gamification.badges.error"))}

`); } else { _push(`
`); ssrRenderList(unref(badges), (badge) => { _push(``); }); _push(``); if (unref(badges).length === 0) { _push(``); } else { _push(``); } _push(`
${ssrInterpolate(unref(t)("gamification.badges.id"))}${ssrInterpolate(unref(t)("gamification.badges.name"))}${ssrInterpolate(unref(t)("gamification.badges.description"))}${ssrInterpolate(unref(t)("gamification.badges.icon"))}${ssrInterpolate(unref(t)("gamification.badges.actions"))}
${ssrInterpolate(badge.id)}${ssrInterpolate(badge.name)}${ssrInterpolate(badge.description || "—")}`); if (badge.icon_url) { _push(`
${ssrInterpolate(badge.icon_url)}
`); } else { _push(``); } _push(`
${ssrInterpolate(unref(t)("gamification.badges.no_items"))}
`); } if (unref(showModal)) { _push(`

${ssrInterpolate(unref(editingBadge) ? unref(t)("gamification.badges.edit_title") : unref(t)("gamification.badges.create_title"))}

${ssrInterpolate(unref(t)("gamification.badges.icon_hint"))}

`); if (unref(form).icon_url) { _push(`
${ssrInterpolate(unref(t)("gamification.badges.icon_preview"))}
`); } else { _push(``); } _push(`
`); } else { _push(``); } if (unref(showDeleteModal)) { _push(`

${ssrInterpolate(unref(t)("gamification.badges.delete_title"))}

${ssrInterpolate(unref(t)("gamification.badges.delete_confirm"))}

${ssrInterpolate(unref(deletingBadge)?.name)}

${ssrInterpolate(unref(deletingBadge)?.description)}

`); if (unref(saving)) { _push(``); } else { _push(``); } _push(` ${ssrInterpolate(unref(t)("gamification.badges.delete_btn"))}
`); } else { _push(``); } if (unref(toast)) { _push(`
${ssrInterpolate(unref(toast).message)}
`); } else { _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/badges.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as default }; //# sourceMappingURL=badges-BJ6bQeZt.js.map