//#region src/i18n/config.ts
let _config;
/**
* Initialize i18n config from virtual module data.
* Called during runtime initialization.
*/
function setI18nConfig(config) {
	_config = config;
}
/**
* Get the current i18n config.
* Returns null if i18n is not configured.
*/
function getI18nConfig() {
	return _config ?? null;
}
/**
* Check if i18n is enabled.
* Returns true when multiple locales are configured.
*/
function isI18nEnabled() {
	return _config != null && _config.locales.length > 1;
}
/**
* Resolve fallback locale chain for a given locale.
* Returns array of locales to try, from most preferred to least.
* Always ends with defaultLocale.
*/
function getFallbackChain(locale) {
	if (!_config) return [locale];
	const chain = [locale];
	let current = locale;
	const visited = new Set([locale]);
	while (_config.fallback?.[current]) {
		const next = _config.fallback[current];
		if (visited.has(next)) break;
		chain.push(next);
		visited.add(next);
		current = next;
	}
	if (!visited.has(_config.defaultLocale)) chain.push(_config.defaultLocale);
	return chain;
}

//#endregion
export { setI18nConfig as i, getI18nConfig as n, isI18nEnabled as r, getFallbackChain as t };
//# sourceMappingURL=config-DkxPrM9l.mjs.map