export function buildEventPath(token: string | null, path: string): string { const normalized = path.startsWith('/') ? path : `/${path}`; if (!token) { return normalized; } if (normalized === '/') { return `/e/${encodeURIComponent(token)}`; } return `/e/${encodeURIComponent(token)}${normalized}`; }