import { formatI18n } from "./format.js";
import { serverLocaleOrFallback } from "./locale.js";
import goals_en_default, { judgeReason } from "./locales/goals.en.js";
import goals_zh_default from "./locales/goals.zh.js";
//#region src/i18n/goals-bundle.ts
/** Canonical English strings for judge parse / API contract (from `goals.en.json`). */
const JUDGE_REASON_EN = judgeReason;
const byLocale = {
	en: goals_en_default,
	zh: goals_zh_default
};
function goalsMessages(locale) {
	return byLocale[serverLocaleOrFallback(locale)];
}
function goalsJudgeReason(id, locale) {
	return goalsMessages(locale).judgeReason[id] ?? judgeReason[id] ?? String(id);
}
function goalsJudgeResponseLanguageNote(locale) {
	return goalsMessages(locale).judge.responseLanguageNote;
}
function goalsContinuationPlainTemplate(locale) {
	return goalsMessages(locale).continuation.plain;
}
function goalsContinuationChecklistTemplate(locale) {
	return goalsMessages(locale).continuation.checklist;
}
function goalsChecklistProgressSuffix(done, total, locale) {
	if (total <= 0) return "";
	return formatI18n(goalsMessages(locale).checklistProgressSuffix, {
		done,
		total
	});
}
function goalsEvaluateCopy(locale) {
	const ev = goalsMessages(locale).evaluate;
	return {
		pauseBudget: (turnsUsed, maxTurns) => formatI18n(ev.pauseBudget, {
			turnsUsed,
			maxTurns
		}),
		pauseParse: (failures) => formatI18n(ev.pauseParse, { failures }),
		goalAchieved: (reason) => formatI18n(ev.goalAchieved, { reason }),
		continuingWithProgress: (turnsUsed, maxTurns, progressSuffix, reason) => formatI18n(ev.continuingWithProgress, {
			turnsUsed,
			maxTurns,
			progressSuffix,
			reason
		}),
		continuing: (turnsUsed, maxTurns, reason) => formatI18n(ev.continuing, {
			turnsUsed,
			maxTurns,
			reason
		}),
		checklistReady: (n) => formatI18n(ev.checklistReady, { n }),
		decomposedReason: (n) => formatI18n(ev.decomposedReason, { n }),
		decomposeFallbackReason: (detail) => formatI18n(ev.decomposeFallbackReason, { detail }),
		noChecklistFallback: () => ev.noChecklistFallback
	};
}
//#endregion
export { JUDGE_REASON_EN, goalsChecklistProgressSuffix, goalsContinuationChecklistTemplate, goalsContinuationPlainTemplate, goalsEvaluateCopy, goalsJudgeReason, goalsJudgeResponseLanguageNote, goalsMessages };

//# sourceMappingURL=goals-bundle.js.map