__vite_ssr_exportName__("locale", () => { try { return locale } catch {} });
__vite_ssr_exportName__("dateLongue", () => { try { return dateLongue } catch {} });
__vite_ssr_exportName__("dateHeure", () => { try { return dateHeure } catch {} });
__vite_ssr_exportName__("remplir", () => { try { return remplir } catch {} });
__vite_ssr_exportName__("montantFcfa", () => { try { return montantFcfa } catch {} });
__vite_ssr_exportName__("pourcentage", () => { try { return pourcentage } catch {} });
const LOCALES = {
	fr: "fr-CI",
	en: "en-GB"
};
function locale(langue) {
	return LOCALES[langue] ?? langue;
};
/** « 2 mars 2009 » pour une date ISO AAAA-MM-JJ (sans fuseau). */
function dateLongue(localeOuLangue, iso) {
	const [annee, mois, jour] = iso.split("-").map(Number);
	const date = new Date(Date.UTC(annee ?? 1970, (mois ?? 1) - 1, jour ?? 1));
	return new Intl.DateTimeFormat(LOCALES[localeOuLangue] ?? localeOuLangue, {
		day: "numeric",
		month: "long",
		year: "numeric",
		timeZone: "UTC"
	}).format(date);
};
/** « 26 novembre 2026 à 08:00 », heure d'Abidjan (UTC+0, sans heure d'été). */
function dateHeure(localeOuLangue, date) {
	return new Intl.DateTimeFormat(LOCALES[localeOuLangue] ?? localeOuLangue, {
		dateStyle: "long",
		timeStyle: "short",
		timeZone: "Africa/Abidjan"
	}).format(typeof date === "string" ? new Date(date) : date);
};
/** Remplit un modèle déjà traduit : `remplir('Résultats : {n}', { n: 3 })`. */
function remplir(modele, parametres) {
	return modele.replace(/\{(\w+)\}/g, (brut, nom) => nom in parametres ? String(parametres[nom]) : brut);
};
/** « 25 000 000 F CFA » (francs CFA, sans décimales). */
function montantFcfa(localeOuLangue, montant) {
	return new Intl.NumberFormat(LOCALES[localeOuLangue] ?? localeOuLangue, {
		style: "currency",
		currency: "XOF",
		maximumFractionDigits: 0
	}).format(montant);
};
/** Taux en parties par million -> « 2,5 » (pour « 2,5 % »). */
function pourcentage(localeOuLangue, tauxPpm) {
	return new Intl.NumberFormat(LOCALES[localeOuLangue] ?? localeOuLangue, { maximumFractionDig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ChD;AACF;;AAUO,SAAS,YAAY,gBAAwB,SAAyB;CAC3E,OAAO,IAAI,KAAK,aAAa,QAAQ,mBAAmB,gBAAgB;EACtE,OAAO;EACP,UAAU;EACV,uBAAuB;CACzB,CAAC,CAAC,CAAC,OAAO,OAAO;AACnB;;AAGO,SAAS,YAAY,gBAAwB,SAAyB;CAC3E,OAAO,IAAI,KAAK,aAAa,QAAQ,mBAAmB,gBAAgB,EACtE,uBAAuB,EACzB,CAAC,CAAC,CAAC,OAAO,UAAU,GAAM;AAC5B","names":[],"ignoreList":[],"sources":["format.ts"],"sourcesContent":["/**\n * Formats d'affichage et libellés pré-traduits pour les îlots React.\n * Les îlots n'importent pas @notariat-ci/i18n (tout le dictionnaire serait livré au navigateur) :\n * ils reçoivent leurs textes déjà traduits, avec des modèles « {x} » remplis par `remplir`.\n */\nimport type { Statut } from '@notariat-ci/annuaire';\nimport type { Langue } from '@notariat-ci/i18n';\n\nconst LOCALES: Readonly<Partial<Record<string, string>>> = { fr: 'fr-CI', en: 'en-GB' };\n\nexport function locale(langue: Langue): string {\n  return LOCALES[langue] ?? langue;\n}\n\n/** « 2 mars 2009 » pour une date ISO AAAA-MM-JJ (sans fuseau). */\nexport function dateLongue(localeOuLangue: string, iso: string): string {\n  const [annee, mois, jour] = iso.split('-').map(Number);\n  const date = new Date(Date.UTC(annee ?? 1970, (mois ?? 1) - 1, jour ?? 1));\n  return new Intl.DateTimeFormat(LOCALES[localeOuLangue] ?? localeOuLangue, {\n    day: 'numeric',\n    month: 'long',\n    year: 'numeric',\n    timeZone: 'UTC',\n  }).format(date);\n}\n\n/** « 26 novembre 2026 à 08:00 », heure d'Abidjan (UTC+0, sans heure d'été). */\nexport function dateHeure(localeOuLangue: string, date: Date | string): string {\n  return new Intl.DateTimeFormat(LOCALES[localeOuLangue] ?? localeOuLangue, {\n    dateStyle: 'long',\n    timeStyle: 'short',\n    timeZone: 'Africa/Abidjan',\n  }).format(typeof date === 'string' ? new Date(date) : date);\n}\n\n/** Remplit un modèle déjà traduit : `remplir('Résultats : {n}', { n: 3 })`. */\nexport function remplir(modele: string, parametres: Record<string, string | number>): string {\n  return modele.replace(/\\{(\\w+)\\}/g, (brut, nom: string) =>\n    nom in parametres ? String(parametres[nom]) : brut,\n  );\n}\n\n/** Libellés d'un statut, aux deux genres. */\nexport interface LibellesStatut {\n  masculin: string;\n  feminin: string;\n}\nexport type LibellesStatuts = Readonly<Record<Statut, LibellesStatut>>;\n\n/** « 25 000 000 F CFA » (francs CFA, sans décimales). */\nexport function montantFcfa(localeOuLangue: string, montant: number): string {\n  return new Intl.NumberFormat(LOCALES[localeOuLangue] ?? localeOuLangue, {\n    style: 'currency',\n    currency: 'XOF',\n    maximumFractionDigits: 0,\n  }).format(montant);\n}\n\n/** Taux en parties par million -> « 2,5 » (pour « 2,5 % »). */\nexport function pourcentage(localeOuLangue: string, tauxPpm: number): string {\n  return new Intl.NumberFormat(LOCALES[localeOuLangue] ?? localeOuLangue, {\n    maximumFractionDigits: 4,\n  }).format(tauxPpm / 10_000);\n}\n"],"file":"/src/lib/format.ts"}