/**
 * Pre-serialized i18n bootstrap for inline script injection.
 *
 * JSON.stringify of the full {he, en} bundle runs ONCE per CF Worker isolate
 * at module initialization time (startup phase, not counted against the 10ms
 * per-request CPU budget). All requests in the same isolate reuse the string.
 *
 * Without this, define:vars in BaseLayout called JSON.stringify per-request,
 * costing ~4ms — enough to push auth pages over the Workers Free 10ms ceiling
 * when combined with the session-middleware Neon round-trip.
 */
import { he } from './he';
import { en } from './en';

// Escape </script> sequences to prevent early script tag termination.
export const I18N_BOOTSTRAP_SCRIPT = `window.__I18N__=${JSON.stringify({ he, en }).replace(/<\/script>/gi, '<\\/script>')};`;
