/**
 * Sanitizes text for display in toast messages to prevent XSS.
 * Escapes common HTML entities - defense-in-depth since svelte-sonner renders as text.
 */
export function sanitizeText(text: string): string {
	const map: Record<string, string> = {
		'&': '&amp;',
		'<': '&lt;',
		'>': '&gt;',
		'"': '&quot;',
		"'": '&#x27;'
	};
	return text.replace(/[&<>"']/g, (ch) => map[ch] || ch);
}
