import { defineComponent, ref, reactive, computed, unref, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrInterpolate, ssrIncludeBooleanAttr, ssrRenderAttr, ssrRenderList, ssrRenderClass } from 'vue/server-renderer';
import { a as useI18n } 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 '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: "config",
__ssrInlineRender: true,
setup(__props) {
const { t } = useI18n();
const loading = ref(true);
const error = ref(false);
const saving = ref(false);
const formError = ref("");
const toast = ref("");
const lastSaved = ref("");
const showRawJson = ref(false);
const rawJson = ref("");
const rawJsonError = ref("");
const multiplierKeys = ["L0", "L1", "L2", "L3"];
const xpLogic = reactive({ baseXp: 500, exponent: 1.5 });
const penaltyLogic = reactive({
recoveryRate: 0.5,
thresholds: { level1: 100, level2: 500, level3: 1e3 },
multipliers: { L0: 1, L1: 0.5, L2: 0.1, L3: 0 }
});
const conversionLogic = reactive({ socialToCreditRate: 100 });
const levelRewards = reactive({ creditsPer10Levels: 50 });
const calculator = reactive({ level: 5, activities: 3, socialPoints: 50 });
const calculatedDailyXp = computed(() => {
return Math.round(xpLogic.baseXp * Math.pow(calculator.activities, xpLogic.exponent));
});
const calculatedLevelUpXp = computed(() => {
return calculator.level * 1e3;
});
const calculatedSocialCredit = computed(() => {
return conversionLogic.socialToCreditRate * calculator.socialPoints;
});
const calculatedDaysToLevelUp = computed(() => {
const daily = calculatedDailyXp.value;
if (daily <= 0) return "\u221E";
return Math.ceil(calculatedLevelUpXp.value / daily) + " " + t("gamification.config.days");
});
function formatNumber(n) {
return new Intl.NumberFormat("hu-HU").format(n);
}
return (_ctx, _push, _parent, _attrs) => {
_push(`
${ssrInterpolate(unref(t)("gamification.config.title"))}
${ssrInterpolate(unref(t)("gamification.config.subtitle"))}
`);
if (unref(loading)) {
_push(`
${ssrInterpolate(unref(t)("gamification.config.loading"))} `);
} else if (unref(error)) {
_push(`
${ssrInterpolate(unref(t)("gamification.config.load_error"))}
`);
} else {
_push(`
${ssrInterpolate(unref(t)("gamification.config.last_saved"))} ${ssrInterpolate(unref(lastSaved) ? unref(lastSaved) : "\u2014")}
${ssrInterpolate(unref(t)("gamification.config.xp_logic"))}
${ssrInterpolate(unref(t)("gamification.config.conversion_logic"))}
${ssrInterpolate(unref(t)("gamification.config.penalty_logic"))}
`);
ssrRenderList(multiplierKeys, (key) => {
_push(`
`);
});
_push(`
${ssrInterpolate(unref(t)("gamification.config.level_rewards"))}
${ssrInterpolate(unref(t)("gamification.config.impact_calculator"))}
${ssrInterpolate(unref(t)("gamification.config.calculator_hint"))}
${ssrInterpolate(unref(t)("gamification.config.estimated_results"))}
${ssrInterpolate(unref(t)("gamification.config.daily_xp"))}${ssrInterpolate(formatNumber(unref(calculatedDailyXp)))}
${ssrInterpolate(unref(t)("gamification.config.level_up_xp"))}${ssrInterpolate(formatNumber(unref(calculatedLevelUpXp)))}
${ssrInterpolate(unref(t)("gamification.config.social_credit"))}${ssrInterpolate(formatNumber(unref(calculatedSocialCredit)))}
${ssrInterpolate(unref(t)("gamification.config.days_to_level_up"))}${ssrInterpolate(unref(calculatedDaysToLevelUp))}
`);
if (unref(showRawJson)) {
_push(`
`);
if (unref(rawJsonError)) {
_push(`
${ssrInterpolate(unref(rawJsonError))}
`);
} else {
_push(``);
}
_push(`
`);
} else {
_push(``);
}
_push(`
`);
}
if (unref(formError)) {
_push(`
${ssrInterpolate(unref(formError))}
`);
} else {
_push(``);
}
if (unref(toast)) {
_push(`
${ssrInterpolate(unref(toast))}
`);
} 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/config.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const config = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0bf5a572"]]);
export { config as default };
//# sourceMappingURL=config-ChjtE2V1.mjs.map