/** Per-language content overrides — keyed by language code e.g. "en", "sk" */ export interface LangOverride { /** Initial bot messages shown before the user sends anything */ initialMessages?: string[]; /** CTA popup text (window mode) */ ctaText?: string; /** Bot display name */ botName?: string; /** Welcome screen subtitle */ welcomeSubtitle?: string; /** Per-language tab title overrides (titles only — feed URLs/items are global). */ tabs?: { notifications?: { title?: string; }; help?: { title?: string; }; chat?: { title?: string; }; }; } export type NotificationTagVariant = 'neutral' | 'success' | 'warning' | 'danger'; export interface NotificationTag { label: string; variant?: NotificationTagVariant; } export interface NotificationItem { id?: string; title: string; message: string; /** Tag entries can be plain strings (rendered as 'neutral') or { label, variant } objects. */ tags?: Array; /** Verbatim string — host pre-formats. */ date?: string; cta?: { url: string; title: string; }; } export interface FaqItem { id?: string; question: string; answer: string; category?: string; } export interface ChatConfig { webhookUrl: string; webhookConfig?: { method?: 'POST' | 'GET'; headers?: Record; }; chatInputKey?: string; chatSessionKey?: string; metadata?: Record; showWelcomeScreen?: boolean; /** Global fallback initial messages — per-language overrides live in i18n[lang].initialMessages */ initialMessages?: string[]; allowFileUploads?: boolean; allowedFileExtensions?: string; /** Per-language content: initial messages, CTA text, bot name, welcome subtitle */ i18n?: Record; streaming?: boolean; botName?: string; theme?: string; /** Override individual CSS variables on the widget root, e.g. { '--t-avatar-bg': '#ff0000' } */ cssVars?: Record; mode?: 'window' | 'fullscreen' | 'mixed'; showCta?: boolean; ctaText?: string; ctaDelay?: number; ctaSound?: boolean; /** Hide the built-in settings UI (gear button, theme picker, settings modal). */ hideSettings?: boolean; /** Bot avatar. Built-in id (e.g. 'amara'), URL, or data URL. */ botAvatar?: string; /** Popup toggle button icon (window mode). Built-in id, URL, or data URL. */ toggleButtonIcon?: string; /** In fullscreen layout, present the chat as a bottom sheet (rounded top, drag handle, dimmed * backdrop above) instead of fully covering the viewport. Applies to mode 'fullscreen' and to * 'mixed' on mobile. Default: false. */ fullscreenSheet?: boolean; /** Sheet height as a CSS length (vh, %, px). Default: '75vh'. */ fullscreenSheetHeight?: string; /** Live-agent SSE stream. When set, the widget opens an EventSource against the ELIA backend * and receives agent replies pushed in real time. The bot turn (synchronous response from the * n8n webhook) keeps working exactly as before. */ agentStream?: { /** Base URL of the ELIA backend, e.g. 'https://api.elia-asistent.com'. */ apiBaseUrl: string; /** Tenant identifier — same UUID embedded in the n8n webhook URL. */ tenantId: string; }; /** Optional tabs above the chat panel. Tab is active iff its block has feedUrl OR items. */ tabs?: { notifications?: { title?: string; feedUrl?: string; items?: NotificationItem[]; }; help?: { title?: string; feedUrl?: string; items?: FaqItem[]; }; chat?: { title?: string; }; }; } export interface Attachment { name: string; url: string; size?: number; mimeType?: string; } export interface Message { id: string; role: 'user' | 'bot'; content: string; ts: number; attachments?: Attachment[]; /** * Delivery status for user messages. undefined on persisted history (treated as * 'sent') and on every bot message — bots don't have a sender-side delivery state. */ status?: 'sending' | 'sent' | 'failed'; } export interface Session { id: string; title: string; createdAt: number; } export interface ThemeDef { id: string; label: string; baseColor: string; accentColor: string; }