import { AddMessageFeedbackBody } from '@botpress/webchat-client'; import { ClassAttributes } from '../../../node_modules/@types/react'; import { Client } from '@botpress/webchat-client'; import { ComponentProps } from '../../../node_modules/@types/react'; import { ComponentProps as ComponentProps_2 } from '../../node_modules/@types/react'; import { LatestWebchatConfig as Configuration } from '@bpinternal/shared'; import { Context } from '../../node_modules/@types/react'; import { ConversationStarter } from '@bpinternal/shared'; import { ConversationStarterDisplayStyle } from '@bpinternal/shared'; import { createEventEmitter } from '@bpinternal/shared'; import { CSSProperties } from '../../node_modules/@types/react'; import * as Dialog from '@radix-ui/react-dialog'; import { Dispatch } from '../../node_modules/@types/react'; import { EventEmitter } from '@bpinternal/shared'; import { ForwardRefExoticComponent } from '../../../node_modules/@types/react'; import { ForwardRefExoticComponent as ForwardRefExoticComponent_2 } from 'react'; import { ForwardRefExoticComponent as ForwardRefExoticComponent_3 } from '../../../../node_modules/@types/react'; import { HTMLAttributes } from '../../../node_modules/@types/react'; import { IntegrationError } from '@botpress/webchat-client'; import { JSX } from 'react/jsx-runtime'; import { JSX as JSX_2 } from '../../node_modules/@types/react'; import { LatestWebchatTheme } from '@bpinternal/shared'; import { ListConversationsResponse } from '@botpress/webchat-client'; import { LucideIcon } from 'lucide-react'; import { MemoExoticComponent } from '../../../node_modules/@types/react'; import { Message as Message_2 } from '@botpress/webchat-client'; import { MessageStreamAbort } from '@botpress/webchat-client'; import { MessageStreamComplete } from '@botpress/webchat-client'; import { MessageStreamDelta } from '@botpress/webchat-client'; import { MessageStreamSnapshot } from '@botpress/webchat-client'; import { NamedExoticComponent } from '../../../node_modules/@types/react'; import { PersistOptions } from 'zustand/middleware'; import { ReactNode } from '../../node_modules/@types/react'; import { ReactNode as ReactNode_2 } from '../../../node_modules/@types/react'; import { Ref } from '../../../node_modules/@types/react'; import { RefAttributes } from '../../../node_modules/@types/react'; import { RefAttributes as RefAttributes_2 } from 'react'; import { RefAttributes as RefAttributes_3 } from '../../../../node_modules/@types/react'; import { RefObject } from '../../node_modules/@types/react'; import { SetStateAction } from '../../node_modules/@types/react'; import { StateStorage } from 'zustand/middleware'; import { StoreApi } from 'zustand'; import { UseBoundStore } from 'zustand'; import { User } from '@botpress/webchat-client'; import { UserCredentials } from '@botpress/webchat-client'; declare type Action = { label: string; value: string; variant: 'action' | 'link'; }; export declare const ActionButton: ({ text, buttonValue, variant, groupId, reusable, sendMessage, isReadOnly }: Props_7) => JSX.Element; export declare const ActionButtons: ({ actions, groupId, reusable, sendMessage, isReadOnly }: Props_8) => JSX.Element | null; declare type AnyEvent = ValueOf<{ [K in keyof WebchatEvents]: { type: K; payload: WebchatEvents[K]; }; }>; export declare const ar: WebchatTranslations; declare const Audio_2: ({ url, isReadOnly }: Props_12) => JSX.Element; export { Audio_2 as Audio } export declare type AudioBlock = { type: 'audio'; url: string; }; export declare const Avatar: ({ userId, src, containerClassName, imageClassName, fallbackClassName, children, }: AvatarProps) => JSX.Element; declare type AvatarProps = { userId?: string; src?: string; containerClassName?: string; imageClassName?: string; fallbackClassName?: string; children?: ReactNode; }; export declare const Bloc: ({ items, ctx }: Props_19) => JSX.Element; export declare type BlocBlock = { type: 'bloc'; items: LeafBlock[]; }; export declare type BlocIntegrationMessageItems = Extract['items']; /** Context passed through the block rendering tree */ export declare type BlockContext = { direction: 'incoming' | 'outgoing' | 'system'; messageId: string; isStreaming?: boolean; isReadOnly?: boolean; sendMessage?: ScopedClient['sendMessage']; /** All citation entries on the message (`metadata.citations`); renderers pick * the entries whose `path` matches their own field via `citationPath`. */ citations?: CitationEntry[]; /** Pre-built Sources footer for cited messages. Renderers that carry both * prompt text AND interactive controls (choice, dropdown) place this between * the text and the controls so Sources sits under the answer, above the * pills; other blocks let `Message` append it after the content. */ footer?: ReactNode; }; export declare type BlockMessage = { id: string; timestamp: Date; block: MessageBlock; conversationId?: string; authorId?: string; disableInput?: boolean; status?: 'pending' | 'processing' | 'processed' | 'failed' | 'skipped'; feedback?: 'positive' | 'negative'; metadata?: { clientMessageId?: string; delivered?: boolean; [k: string]: any; }; }; export declare const BOT_IS_BLOCKED = "This bot has temporarily paused.\nPlease check back later."; declare type BoundChatSoundStore = ReturnType; declare type BoundWebchatClientStore = ReturnType; export declare const Bubble: ({ ctx, children }: Props_9) => JSX.Element; /** @deprecated Use ActionButton */ export declare const Button: ({ text, buttonValue, variant, groupId, reusable, sendMessage, isReadOnly }: Props_7) => JSX.Element; declare type ByType = { [Type in M['type']]: Extract; }; export declare const Card: ({ imageUrl, title, subtitle, actions, ctx, citationBasePath }: Props_17) => JSX.Element; export declare type CardAction = { label: string; value: string; variant: 'action' | 'link'; }; export declare type CardBlock = { type: 'card'; imageUrl?: string; title?: string; subtitle?: string; actions: CardAction[]; /** Payload dot-path of this card ("root" for a standalone card, * "root.items.N" inside a carousel) — citation paths derive from it. */ citationBasePath?: string; }; export declare const Carousel: ({ cards, ctx }: Props_14) => JSX.Element; export declare type CarouselBlock = { type: 'carousel'; cards: CardBlock[]; }; export declare const Chat: ({ connected, configuration, isTyping, messages, user, isLoading, isReadOnly, disableComposer, error, participants, closeWindow, sendMessage, addMessageFeedback, uploadFile, listConversations, restartConversation, clientId, storageKey, soundOn, toggleSound, disableSendButton, conversationId, expanded, onToggleExpand, locale, onComposerTextChange, ...props }: ChatProps) => JSX.Element; export declare type ChatProps = { className?: string; configuration: Configuration; messages: BlockMessage[]; participants: User[]; connected?: boolean; disableComposer?: boolean; isReadOnly?: boolean; isLoading?: boolean; isTyping?: boolean; clientId?: string; closeWindow?: () => void; restartConversation?: (conversationid?: string) => void; user?: UserCredentials; sendMessage?: ScopedClient['sendMessage']; addMessageFeedback?: (messageId: string, feedback: Feedback) => Promise; uploadFile?: ScopedClient['uploadFile']; listConversations?: ScopedClient['listConversations']; error?: WebchatError; soundOn?: boolean; toggleSound?: () => void; storageKey?: string; disableSendButton?: boolean; conversationId?: string; expanded?: boolean; onToggleExpand?: () => void; locale?: Partial; /** Fired on every composer keystroke; used to report the end user's typing upstream. */ onComposerTextChange?: (text: string) => void; }; declare type ChatSoundStore = { soundOn: boolean; setSoundEnabled: (enabled: boolean) => void; toggleSound: () => void; }; export declare const Choice: ({ text, options, groupId, ctx }: Props_18) => JSX.Element; export declare type ChoiceBlock = { type: 'choice'; text: string; options: { label: string; value: string; }[]; groupId: string; disableFreeText?: boolean; }; declare type Citation = { id: number; source: CitationSource; tag?: string; offset?: number; }; /** One entry of `metadata.citations`. */ declare type CitationEntry = { path: string; citation: Citation; }; declare type CitationSource = { url?: string; title?: string; favicon?: string; file?: string; knowledgeBase?: string; [k: string]: unknown; }; export declare type ClientStates = 'connecting' | 'connected' | 'error' | 'disconnected'; declare type ClientStates_2 = 'connecting' | 'connected' | 'error' | 'disconnected'; export declare const commonApiErrorMap: { [key in 'MethodNotFound' | 'QuotaExceeded' | 'Forbidden']: WebchatError; }; declare type CommonWebchatProps = { on: EventEmitter['on']; messages: BlockMessage[]; newConversation: (conversationId?: string) => void; participants: User[]; soundOn: boolean; toggleSound: () => void; disableSendButton: boolean; error?: WebchatError; }; export declare type ComposableIntegrationMessagePayload = Extract>; declare type ComposableIntegrationMessageTypes = 'audio' | 'bloc' | 'file' | 'image' | 'location' | 'markdown' | 'text' | 'video'; export declare const Composer: NamedExoticComponent & RefAttributes>; export declare const CONFIG_ACCESS_DENIED = "Access denied to configuration file. Please check your credentials or your configuration URL and try again."; export { Configuration } export declare const Container: { ({ children, className, uploadFile, allowFileUpload, storageKey, conversationId, ...props }: Props_3): JSX.Element; displayName: string; }; export declare const ConversationHistory: { ({ className, onConversationClick, onNewConversation, onClose, isLoading, conversations, botAvatar, botName, ...props }: ComponentProps<"div"> & ConversationHistoryProps): JSX.Element; displayName: string; }; declare type ConversationHistoryProps = { onConversationClick?: (conversationId: string) => void; onNewConversation?: () => void; onClose?: () => void; isLoading?: boolean; conversations: Conversations; botAvatar?: string; botName?: string; }; declare type Conversations = ConversationWithLastMessage[]; declare type ConversationWithLastMessage = ListConversationsResponse['conversations'][number] & { lastMessage: NonNullable & { author: { type: 'bot' | 'user'; }; }; }; declare const createChatSoundStore: (storeName: string) => UseBoundStore, "setState" | "devtools"> & { setState(partial: ChatSoundStore | Partial | ((state: ChatSoundStore) => ChatSoundStore | Partial), replace?: false | undefined, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): void; setState(state: ChatSoundStore | ((state: ChatSoundStore) => ChatSoundStore), replace: true, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): void; devtools: { cleanup: () => void; }; }, "setState" | "persist"> & { setState(partial: ChatSoundStore | Partial | ((state: ChatSoundStore) => ChatSoundStore | Partial), replace?: false | undefined, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): unknown; setState(state: ChatSoundStore | ((state: ChatSoundStore) => ChatSoundStore), replace: true, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): unknown; persist: { setOptions: (options: Partial>) => void; clearStorage: () => void; rehydrate: () => Promise | void; hasHydrated: () => boolean; onHydrate: (fn: (state: ChatSoundStore) => void) => () => void; onFinishHydration: (fn: (state: ChatSoundStore) => void) => () => void; getOptions: () => Partial>; }; }>; export declare const createCookieStorage: (cookieDomain?: string) => StateStorage; declare const createWebchatClientStore: (storeName: string, storageLocation?: StorageLocation, cookieDomain?: string) => UseBoundStore, "setState" | "devtools"> & { setState(partial: WebchatClientStore | Partial | ((state: WebchatClientStore) => WebchatClientStore | Partial), replace?: false | undefined, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): void; setState(state: WebchatClientStore | ((state: WebchatClientStore) => WebchatClientStore), replace: true, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): void; devtools: { cleanup: () => void; }; }, "setState" | "persist"> & { setState(partial: WebchatClientStore | Partial | ((state: WebchatClientStore) => WebchatClientStore | Partial), replace?: false | undefined, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): unknown; setState(state: WebchatClientStore | ((state: WebchatClientStore) => WebchatClientStore), replace: true, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): unknown; persist: { setOptions: (options: Partial>) => void; clearStorage: () => void; rehydrate: () => Promise | void; hasHydrated: () => boolean; onHydrate: (fn: (state: WebchatClientStore) => void) => () => void; onFinishHydration: (fn: (state: WebchatClientStore) => void) => () => void; getOptions: () => Partial>; }; }>; export declare type CustomBlock = { type: 'custom'; name: string; url: string; data?: unknown; }; export declare type CustomRendererProps = CustomBlock & { direction: 'incoming' | 'outgoing' | 'system'; }; export declare const de: WebchatTranslations; export declare const defaultTranslations: { readonly 'composer.placeholder': "Type your message..."; readonly 'composer.sendButton.ariaLabel': "Send Message Button"; readonly 'composer.voiceButton.ariaLabel': "Voice Input Button"; readonly 'composer.fileButton.ariaLabel': "Upload File Button"; readonly 'composer.messageInput.ariaLabel': "Message Input"; readonly 'composer.emojiButton.ariaLabel': "Emoji Picker Button"; readonly 'fileAttachment.uploadError': "Upload Error"; readonly 'fileAttachment.fallbackExtension': "File"; readonly 'fileAttachment.removeButton.ariaLabel': "Remove File Button"; readonly 'header.defaultBotName': "Bot"; readonly 'header.expandButton.ariaLabel': "Expand Header Button"; readonly 'header.sound.enable': "Enable chat sounds"; readonly 'header.sound.disable': "Disable chat sounds"; readonly 'header.menu.ariaLabel': "More options"; readonly 'header.expand': "Expand window"; readonly 'header.collapse': "Collapse window"; readonly 'header.mute': "Mute"; readonly 'header.unmute': "Unmute"; readonly 'conversationHistory.title': "Conversations"; readonly 'conversationHistory.empty': "No conversation started yet"; readonly 'conversationHistory.newConversation': "New conversation"; readonly 'conversationHistory.sentAttachment': "Sent an attachment"; readonly 'conversationHistory.showButton.ariaLabel': "Show Recent Conversations Button"; readonly 'restartConversation.title': "Create New Conversation"; readonly 'restartConversation.description': "This will clear the current conversation and start a new one."; readonly 'restartConversation.confirm': "New conversation"; readonly 'restartConversation.cancel': "Cancel"; readonly 'restartConversation.button.ariaLabel': "Restart Conversation Button"; readonly 'closeButton.ariaLabel': "Close Chatbot Button"; readonly 'feedback.title': "Help us improve"; readonly 'feedback.description': "Please provide feedback to help us improve."; readonly 'feedback.confirm': "Send feedback"; readonly 'feedback.cancel': "Cancel"; readonly 'feedback.placeholder': "Let us know what went wrong..."; readonly 'error.configuration': "Configuration error"; readonly 'error.bot': "Bot error"; readonly 'error.network': "Network error"; readonly 'error.disconnected': "Disconnected"; readonly 'error.unexpected': "Unexpected error"; readonly 'dropdown.placeholder': "Select..."; readonly 'message.status.delivered': "Delivered"; readonly 'date.today': "Today"; readonly 'date.yesterday': "Yesterday"; readonly 'hitl.passedToTeam': "Passed to the support team"; readonly 'hitl.findingAgent': "Finding you an agent…"; readonly 'hitl.supportAgent': "Support agent"; readonly 'hitl.defaultAgentName': "An agent"; readonly 'hitl.agentJoined': "{name} joined the conversation"; readonly 'hitl.agentTransferred': "Transferred to {name}"; readonly 'hitl.agentLabel': "{name} · Support"; readonly 'hitl.ticketClosedBy': "{name} closed the ticket"; readonly 'hitl.ticketClosed': "Ticket closed"; readonly 'hitl.waiting.title': "Waiting for an agent…"; readonly 'hitl.waiting.sub': "Usually a few minutes. Replies arrive here."; readonly 'hitl.waiting.longTitle': "Still waiting — this is taking longer than usual"; readonly 'hitl.waiting.longSub': "You can close this window — the reply will land right here."; readonly 'csat.question': "How did {name} do?"; readonly 'csat.questionGeneric': "How did we do?"; readonly 'csat.sub': "One tap — optional. You can keep typing below."; readonly 'csat.rate': "Rate this chat"; readonly 'csat.commentPlaceholder': "Add a comment — optional"; readonly 'csat.sendComment': "Send comment"; readonly 'csat.thanks': "Thanks — sent to the team"; }; export declare function deriveHitlStatus(messages: { metadata?: Record; timestamp: Date; }[]): HitlStatus; export declare function detectLocale(language?: string): WebchatTranslations; export declare type Dimensions = { width: number; height: number; }; export declare const Dropdown: ({ text, options, reusable, ctx }: Props_15) => JSX.Element; export declare type DropdownBlock = { type: 'dropdown'; text?: string; options: { label: string; value: string; }[]; reusable?: boolean; }; export declare function enrichMessage(messages: BlockMessage[], participants: User[], currentUserId: string, botName?: string, botAvatar?: string): RichBlockMessage[]; declare type ErrorProps = { error: WebchatError; restartConversation?: () => void; closeWindow?: () => void; }; export declare function ErrorState({ error, restartConversation, closeWindow }: ErrorProps): JSX.Element; export declare const es: WebchatTranslations; declare type EventError = Error & { type: 'error'; }; declare type Events = WebchatEvents & { '*': AnyEvent; }; declare type Events_2 = { [key: string]: string; }; export declare const Fab: ForwardRefExoticComponent & HTMLAttributes & { imgUrl?: string; }, "ref"> & RefAttributes>; export declare type Feedback = AddMessageFeedbackBody; declare const File_2: ({ title, url, isReadOnly }: Props_16) => JSX.Element; export { File_2 as File } export declare type FileBlock = { type: 'file'; url: string; title?: string; }; export declare type FileType = (typeof fileTypes)[number]; export declare const fileTypes: readonly ["audio", "file", "image", "video"]; export declare const fr: WebchatTranslations; export declare function generateThemeOverride(theme: LatestWebchatTheme): Record; export declare function generateThemeStylesheet(theme: LatestWebchatTheme): string; export declare const getUseChatSoundStore: (name?: string) => BoundChatSoundStore; export declare const getUseWebchatClientStore: (name?: string, storageLocation?: StorageLocation, cookieDomain?: string) => BoundWebchatClientStore; export declare const Header: ({ closeWindow, configuration, showConversationHistory, soundOn, toggleSound, clientId, expanded, onToggleExpand, hitlStatus, }: HeaderProps) => JSX.Element; declare type HeaderProps = { showConversationHistory?: () => void; closeWindow?: () => void; clientId?: string; soundOn?: boolean; toggleSound?: () => void; configuration: Pick; expanded?: boolean; onToggleExpand?: () => void; /** Live handoff state: 'waiting' pulses an amber "finding you an agent" * status line; 'agent' swaps the header identity to the assigned agent * while the ticket is active. */ hitlStatus?: HitlStatus; }; /** * The widget's live handoff state, derived from the lifecycle markers in the * message stream (in order): * ticket_opened → waiting · agent_assigned → agent · ticket_closed → bot. * Drives the header (amber "finding an agent" pulse / agent identity) and the * in-stream waiting block. */ export declare type HitlStatus = { mode: 'bot'; } | { mode: 'waiting'; since: Date; message?: string; hidden?: boolean; } | { mode: 'agent'; agentName?: string; agentAvatarUrl?: string; }; export declare const IconButton: ({ icon: Icon, label, onClick, className, style, size }: Props_4) => JSX.Element; export declare type ImageBlock = { type: 'image'; url: string; orientation?: 'portrait' | 'landscape' | 'square' | 'auto'; }; export declare const ImageComponent: ForwardRefExoticComponent_3>; export declare type InputModalProps = { title?: string; description?: string; confirmButtonText: string; cancelButtonText: string; onConfirm?: () => void; onCancel?: () => void; initialValue?: T; Content?: ({ setValue }: { value: T | undefined; setValue: (value: T) => void; }) => ReactNode; }; export declare type IntegrationMessage = Message_2; export declare type IntegrationMessagePayloadByType = ByType; export declare function integrationMessageToBlockMessage(message: IntegrationMessage): BlockMessage; declare type IntegrationMessageTypes = IntegrationMessage['payload']['type']; export declare const INVALID_API_URL = "Invalid API URL.\nPlease use a valid API URL."; export declare const INVALID_BOTPRESS_URL = "Invalid URL.\nPlease make sure your client ID and API URL are valid"; export declare const INVALID_CLIENT_ID = "Invalid Client ID.\nPlease use a valid Botpress Client ID."; export declare const INVALID_CONFIG_URL = "Invalid config URL.\nPlease make sure your config URL is valid"; export declare const INVALID_CONFIGURATION = "Invalid webchat configuration.\nPlease make sure your config file is valid"; export declare const INVALID_MESSAGE_CONTENT_TYPE = "Unable to process the message.\nPlease start a new conversation."; export declare function isCommonApiErrorType(type: string): type is keyof typeof commonApiErrorMap; export declare function isEventError(thrown: unknown): thrown is EventError; export declare const isFileType: (type: string) => type is FileType; export declare function isIntegrationError(thrown: unknown): thrown is IntegrationError; export declare function isWebhookHandlerErrorType(type: string): type is keyof typeof webhookHandlerErrorMap; export declare const it: WebchatTranslations; export declare const ja: WebchatTranslations; export declare const ko: WebchatTranslations; /** Leaf block types that can appear inside a bloc */ export declare type LeafBlock = TextBlock | ImageBlock | VideoBlock | AudioBlock | FileBlock | LocationBlock; declare const Location_2: ({ latitude, longitude, title, isReadOnly }: Props_13) => JSX.Element; export { Location_2 as Location } export declare type LocationBlock = { type: 'location'; latitude: number; longitude: number; title?: string; }; export declare const MainCard: ({ title, subtitle, botAvatar, botName, onClick }: MainCardProps) => JSX.Element; declare type MainCardProps = { title: string; subtitle?: string; botAvatar?: string; botName?: string; onClick?: () => void; }; export declare const mapToWebchatError: (thrown: unknown) => WebchatError; export declare const Message: ({ direction, block, disableInput, children, sender, id, authorId, isReadOnly, isLastDeliveredMessage, isLastMessage, sendMessage, showAvatar, renderers, addMessageFeedback, feedback, timestamp, metadata, citationsEnabled, }: MessageProps) => JSX.Element; export declare type MessageBlock = TextBlock | ImageBlock | VideoBlock | AudioBlock | FileBlock | LocationBlock | CardBlock | CarouselBlock | ChoiceBlock | DropdownBlock | BlocBlock | CustomBlock; export declare const MessageContext: Context; declare type MessageContextVaue = { isLoading: string[]; setIsLoading: Dispatch>; }; export declare const MessageList: MemoExoticComponent<({ className, messages, isTyping, botAvatar, botName, botDescription, sendMessage, hitlWaiting, addMessageFeedback, citationsEnabled, showMarquee, showDateSystemMessage, showMessageStatus, showIncomingMessageAvatar, showOutgoingMessageAvatar, homePageEnabled, welcomeHeading, welcomeSubtitle, mainCardEnabled, mainCardTitle, mainCardSubtitle, onMainCardClick, conversationStartersEnabled, conversationStarters, conversationStartersDisplayStyle, renderers, ...props }: ComponentProps<"div"> & MessageListProps) => JSX.Element>; declare type MessageListProps = { messages?: RichBlockMessage[]; isTyping?: boolean; botAvatar?: string; botName?: string; botDescription?: string; sendMessage?: ScopedClient['sendMessage']; /** Set while a HITL ticket is waiting for an agent — renders the in-stream * waiting block under the messages (dots + "you're in line"). */ hitlWaiting?: { since: Date; message?: string; }; addMessageFeedback?: (messageId: string, feedback: Feedback) => Promise; /** Inline citation pills + Sources footer (undefined = enabled). */ citationsEnabled?: boolean; showMarquee?: boolean; showDateSystemMessage?: boolean; showMessageStatus?: boolean; showIncomingMessageAvatar?: boolean; showOutgoingMessageAvatar?: boolean; homePageEnabled?: boolean; welcomeHeading?: string; welcomeSubtitle?: string; mainCardEnabled?: boolean; mainCardTitle?: string; mainCardSubtitle?: string; onMainCardClick?: () => void; conversationStartersEnabled?: boolean; conversationStarters?: ConversationStarter[]; conversationStartersDisplayStyle?: ConversationStarterDisplayStyle; renderers?: MessageRenderers; }; export declare const MessagePreview: ForwardRefExoticComponent & HTMLAttributes & { avatarUrl?: string; botName?: string; description?: string; onClose?: () => void; }, "ref"> & RefAttributes>; declare type MessageProps = { children?: ReactNode_2; sendMessage?: ScopedClient['sendMessage']; isReadOnly?: boolean; isLastDeliveredMessage?: boolean; /** False when a newer message exists — an unanswered CSAT card collapses to its quiet row. */ isLastMessage?: boolean; showAvatar?: boolean; renderers?: MessageRenderers; addMessageFeedback?: (messageId: string, feedback: Feedback) => Promise; /** Inline citation pills + Sources footer. Undefined = enabled at the * component level; Chat passes the config gate (`citationsEnabled === true`, * off by default so unversioned existing bots keep their behavior). */ citationsEnabled?: boolean; } & Omit & { block?: RichBlockMessage['block']; }; export declare type MessageRenderers = { custom?: React.FC; }; export { MessageStreamAbort } export { MessageStreamComplete } export { MessageStreamDelta } export { MessageStreamSnapshot } export declare const MISSING_API_URL = "The API url is required to initialize the webchat."; export declare const MISSING_BOT_ID = "The Bot ID is required to initialize the webchat."; export declare const MISSING_CLIENT_ID = "The Client ID is required to initialize the webchat."; export declare const MISSING_CONFIG_URL = "No config URL provided."; export declare function Modal({ open, onOpenChange, children, }: { open?: boolean; onOpenChange?: (open: boolean) => void; children: ReactNode_2; }): JSX.Element; export declare namespace Modal { var Button: ForwardRefExoticComponent_2>; var Close: ForwardRefExoticComponent_2>; var Content: typeof ModalContent; } declare function ModalContent({ title, description, onConfirm, onCancel, confirmButtonText, cancelButtonText, children, }: { title?: string; description?: string; onConfirm?: () => void; onCancel?: () => void; confirmButtonText?: string; cancelButtonText?: string; children: ReactNode_2; }): JSX.Element; export declare const ModalContext: Context; declare type ModalContextValue = { showInputModal?: (props: InputModalProps) => Promise; }; export declare const ModalProvider: ({ children }: { children: ReactNode; }) => JSX.Element; export declare const MotionProvider: ({ children }: { children: ReactNode; }) => JSX.Element; export declare const NETWORK_ERROR = "Please check your internet connection and refresh the page."; export declare const NOT_A_PARTICIPANT = "Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page"; export declare type Options = { timeout?: number; }; declare type Props = { adminSecret?: string; user?: UserCredentials; conversationId?: string; clientId: string; botId?: string; apiUrl?: string; storageKey?: string; storageLocation?: StorageLocation; soundEnabled?: boolean; clientHeaders?: Record; }; declare type Props_10 = { url: string; orientation?: ImageBlock['orientation']; }; declare type Props_11 = { url: string; isReadOnly?: boolean; }; declare type Props_12 = { url: string; isReadOnly?: boolean; }; declare type Props_13 = { latitude: number; longitude: number; title?: string; isReadOnly?: boolean; }; declare type Props_14 = { cards: CardBlock[]; ctx: BlockContext; }; declare type Props_15 = { text?: string; options: { label: string; value: string; }[]; reusable?: boolean; ctx: BlockContext; }; declare type Props_16 = { url: string; title?: string; isReadOnly?: boolean; }; declare type Props_17 = CardBlock & { ctx: BlockContext; }; declare type Props_18 = ChoiceBlock & { ctx: BlockContext; }; declare type Props_19 = { items: LeafBlock[]; ctx: BlockContext; }; declare type Props_2 = ComponentProps<'div'> & { inputRef?: Ref; disableComposer?: boolean; isReadOnly?: boolean; allowFileUpload?: boolean; disableSendButton?: boolean; connected?: boolean; sendMessage?: ScopedClient['sendMessage']; uploadFile?: ScopedClient['uploadFile']; storageKey?: string; conversationId?: string; onTextChange?: (text: string) => void; statusText?: ReactNode_2; } & Pick; declare type Props_20 = Partial; declare type Props_3 = ComponentProps<'div'> & { uploadFile?: ScopedClient['uploadFile']; allowFileUpload?: boolean; storageKey?: string; conversationId?: string; }; declare type Props_4 = { icon: LucideIcon; label: string; onClick?: (e: React.SyntheticEvent) => void; className?: string; style?: React.CSSProperties; size?: number; }; declare type Props_5 = { clientId: string; apiUrl?: string; storageKey?: string; user?: UserCredentials; conversationId?: string; configuration?: Configuration; } & ComponentProps_2<'div'>; declare type Props_6 = { text: string; ctx: BlockContext; /** When true, render without bubble wrapper (used inside Card/Choice) */ bare?: boolean; /** Payload dot-path of this text (e.g. "root.text") — selects the citation * entries from `ctx.citations` whose pills splice into THIS text. */ citationPath?: string; /** Added to citation offsets when the rendered text was prefixed after the * offsets were recorded (e.g. a card title rendered as `#### ${title}`). */ citationOffsetShift?: number; }; declare type Props_7 = { text: string; buttonValue: string; variant: 'action' | 'link'; reusable?: boolean; groupId?: string; sendMessage?: ScopedClient['sendMessage']; isReadOnly?: boolean; }; declare type Props_8 = { actions: Action[]; groupId?: string; reusable?: boolean; sendMessage?: ScopedClient['sendMessage']; isReadOnly?: boolean; }; declare type Props_9 = { ctx: BlockContext; children: ReactNode_2; }; export declare const pt: WebchatTranslations; export declare const QUOTA_EXCEEDED = "This bot has temporarily paused.\nPlease check back later."; export declare function renderBlock(block: MessageBlock, ctx: BlockContext): JSX_2.Element; export declare const resolveStarterIcon: (icon?: string) => LucideIcon; /** * Resolves the translation map for the webchat: pick the base bundle for `language` * (or auto-detect from navigator.language when omitted), then merge any custom string * `overrides` on top. Overrides win per-key, so a site can localize into an unsupported * language or tweak individual strings on top of a built-in bundle. */ export declare function resolveTranslations(language?: string, overrides?: Partial): WebchatTranslations; export declare const retryWithBackoff: (fn: () => Promise, maxAttempts?: number, delayMs?: number) => Promise; export declare type RichBlockMessage = BlockMessage & { direction: 'incoming' | 'outgoing' | 'system'; sender: { name: string; avatar?: string; }; }; export declare type ScopedClient = { sendMessage: (payload: IntegrationMessage['payload'], metadata?: Record) => Promise; sendEvent: (event: Record, options?: { bindConversation?: boolean; bindUser?: boolean; }) => Promise; uploadFile: (file: File) => Promise<{ fileUrl: string; name: string; type: FileType; fileId: string; }>; getUser: () => Promise; updateUser: (user: UserProfile) => Promise; listConversations: () => ReturnType; }; export declare const _setDebugEnabled: (enabled: boolean) => void; export declare const _setTrackFn: (fn: typeof _trackFn) => void; export declare const SOUND_EFFECTS: { readonly chatMessageNotification: string; }; export declare const SSE_DISCONNECTED_ERROR = "You've been disconnected from the conversation.\nPlease refresh the page."; export declare const STARTER_ICON_NAMES: string[]; export declare const Starters: MemoExoticComponent<({ enabled, starters, displayStyle, sendMessage }: StartersProps) => JSX.Element | null>; declare type StartersProps = { enabled?: boolean; starters?: ConversationStarter[]; displayStyle?: ConversationStarterDisplayStyle; sendMessage?: ScopedClient['sendMessage']; }; export declare type StorageLocation = 'sessionStorage' | 'localStorage' | 'cookieStorage'; export declare type StyleOptions = { className?: string; style?: CSSProperties; }; /** * StylesheetProvider component that manages theme styles and font loading */ export declare const StylesheetProvider: ({ color, fontFamily, themeMode, headerVariant }: Props_20) => JSX.Element; declare const Text_2: ({ text, ctx, bare, citationPath, citationOffsetShift }: Props_6) => JSX.Element; export { Text_2 as Text } export declare type TextBlock = { type: 'text'; text: string; value?: string; /** Dot-path of this text in the original message payload (e.g. "root.text", * "root.markdown", "root.items.0.payload.text") — matches citation entries. */ citationPath?: string; }; declare type ToPayloadType = { [K in T]: { type: K; }; }[T]; declare let _trackFn: ((event: string, properties?: Record) => void) | null; export declare const TypingIndicator: MemoExoticComponent<({ ...props }: ComponentProps<"div">) => JSX.Element>; export declare function useActiveConversation(): UseActiveConversationReturn; declare type UseActiveConversationReturn = { conversationId?: string; messages: BlockMessage[]; participants: User[]; sendMessage: ScopedClient['sendMessage']; saveMessageFeedback: (messageId: string, feedback: Feedback) => Promise; sendEvent: ScopedClient['sendEvent']; uploadFile: ScopedClient['uploadFile']; status: ClientStates; on: ReturnType>['on']; error?: WebchatError; isTyping: boolean; isAwaitingResponse: boolean; upsertMessageStream: (input: MessageStreamDelta) => void; completeMessageStream: (input: MessageStreamComplete) => void; abortMessageStream: (input: MessageStreamAbort) => void; }; export declare function useConversationList({ userCredentials, listConversations, clientId, }: UseConversationListParams): UseConversationListReturn; declare type UseConversationListParams = { userCredentials?: UserCredentials; listConversations?: Client['listConversations']; clientId?: string; }; declare type UseConversationListReturn = { conversations: Conversations; isLoading: boolean; error?: WebchatError; refresh: () => Promise; }; export declare function useConversations(): UseConversationsReturn; declare type UseConversationsReturn = { listConversations?: () => Promise; openConversation: (conversationId?: string) => void; }; export declare type UseImageSizeResult = [Dimensions | null, { loading: boolean; error: string | null; }]; export declare function useMessageContext(): MessageContextVaue; export declare function useModalContext(): ModalContextValue; /** * Reports the end user's presence to the conversation as a `userPresence` custom event so a * human agent (e.g. in Desk) can tell whether the visitor is around: * - `online` — stream connected, tab present, active within the last AWAY_MS * - `away` — connected but the tab has been blurred or idle for AWAY_MS * - `offline` — stream disconnected, or the tab is being closed * Only the transitions are emitted (deduped against the last reported state). */ export declare function usePresenceEmitter({ enabled, connected }: UsePresenceEmitterProps): void; declare type UsePresenceEmitterProps = { /** Gate — only emit when the bot reports presence upstream (agentPresenceEnabled). */ enabled?: boolean; /** Whether the webchat client's event stream is connected (drives online vs offline). */ connected?: boolean; }; export { User } export declare function useReadIndicator(): { onMessageReceived: (messageId: string) => void; }; export declare type UserProfile = Omit; export declare type UserResponse = Awaited>['user']; export declare function useSound({ storageKey, soundEnabled }: UseSoundProps): UseSoundReturn; declare type UseSoundProps = { storageKey?: string; soundEnabled?: boolean; }; declare type UseSoundReturn = { soundOn: boolean; toggleSound: () => void; playNotificationSound: () => void; }; /** * Reports the end user's typing to the conversation as a `userTyping` custom event so a human * agent (e.g. in Desk) can see when the visitor is composing. Returns an `onTextChange` handler * to wire to the composer; it is `undefined` when disabled so nothing is emitted. */ export declare function useTypingEmitter({ enabled }: UseTypingEmitterProps): { onTextChange: ((text: string) => void) | undefined; }; declare type UseTypingEmitterProps = { /** Gate — only emit when the bot reports presence upstream (agentPresenceEnabled). */ enabled?: boolean; }; export declare const useUser: () => UseUserReturn; declare type UseUserReturn = { getUser?: () => Promise; updateUser?: (user: UserProfile) => Promise; userCredentials?: UserCredentials; }; /** * @deprecated This hook is deprecated. Use WebchatProvider with useActiveConversation, useConversations, and useUser instead. * * Migration guide: * ```typescript * // Old: * const { messages, sendMessage, client } = useWebchat({ clientId, ... }) * * // New: * * const { messages, sendMessage } = useActiveConversation() * const { listConversations, openConversation } = useConversations() * const { getUser, updateUser } = useUser() * * ``` */ export declare function useWebchat({ apiUrl, clientId, storageKey, storageLocation, adminSecret, soundEnabled, clientHeaders, ...props }: Props): UseWebchatReturn; export declare function useWebchatContext(): WebchatContextValue; /** * @deprecated Use WebchatProvider with useActiveConversation, useConversations, and useUser instead */ declare type UseWebchatReturn = (CommonWebchatProps & { clientState: 'connected'; client: ScopedClient; conversationId: string; user?: UserCredentials; isTyping: boolean; }) | (CommonWebchatProps & { clientState: 'connecting' | 'error' | 'disconnected'; client: undefined; conversationId: undefined; user: undefined; isTyping: undefined; }); export declare const useWebchatStore: UseBoundStore, "setState" | "devtools"> & { setState(partial: WebchatStore | Partial | ((state: WebchatStore) => WebchatStore | Partial), replace?: false | undefined, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): void; setState(state: WebchatStore | ((state: WebchatStore) => WebchatStore), replace: true, action?: (string | { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; type: string; }) | undefined): void; devtools: { cleanup: () => void; }; }>; declare type ValueOf = T[keyof T]; export declare const Video: ({ url, isReadOnly }: Props_11) => JSX.Element; export declare type VideoBlock = { type: 'video'; url: string; }; export declare const Webchat: ({ clientId, storageKey, configuration, apiUrl, user: userCredentials, conversationId, ...props }: Props_5) => JSX.Element; declare type WebchatClientActions = { setUser: (userId?: UserCredentials) => void; setConversationId: (conversationId?: string) => void; clearAll: () => void; }; export declare type WebchatClientState = { user?: UserCredentials; conversationId?: string; }; declare type WebchatClientStore = WebchatClientState & WebchatClientActions; export declare type WebchatContextValue = { client: Client | undefined; userCredentials: UserCredentials | undefined; conversationId: string | undefined; openConversation: (params: { conversationId?: string; userToken?: string; }) => Promise; clientState: ClientStates_2; setClientState: (state: ClientStates_2) => void; error: WebchatError | undefined; setError: (error?: WebchatError) => void; isTyping: boolean; isAwaitingResponse: boolean; setAwaitingResponse: (state: boolean, timeout?: number) => void; upsertMessageStream: (input: MessageStreamDelta) => void; completeMessageStream: (input: MessageStreamComplete) => void; abortMessageStream: (input: MessageStreamAbort) => void; emitter: ReturnType>; }; export declare type WebchatError = ({ type: 'configuration'; message: typeof MISSING_CLIENT_ID | typeof MISSING_API_URL | typeof MISSING_BOT_ID | typeof INVALID_CLIENT_ID | typeof INVALID_CONFIGURATION | typeof MISSING_CONFIG_URL; } | { type: 'bot'; message: typeof BOT_IS_BLOCKED | typeof QUOTA_EXCEEDED | typeof NOT_A_PARTICIPANT; } | { type: 'network'; message: typeof NETWORK_ERROR | typeof SSE_DISCONNECTED_ERROR; } | { type: string; message: string; }) & { id?: string; }; export declare type WebchatEvents = { conversation: string | undefined; message: BlockMessage; messageUpdated: BlockMessage; messageSent: IntegrationMessage['payload']; error: Error; webchatVisibility: 'show' | 'hide' | 'toggle'; webchatConfig: Record; customEvent: Record; isTyping: { isTyping: boolean; timeout: number; }; participantAdded: User; participantRemoved: string; }; export declare function WebchatProvider({ clientId, apiUrl, storageKey, storageLocation, adminSecret, clientHeaders, children, ...props }: WebchatProviderProps): JSX.Element; declare type WebchatProviderProps = { clientId: string; apiUrl?: string; userCredentials?: UserCredentials; conversationId?: string; adminSecret?: string; storageKey?: string; storageLocation?: StorageLocation; clientHeaders?: Record; children: ReactNode; }; declare type WebchatStore = { messageContainerRef: RefObject; setMessageContainerRef: (ref: RefObject) => void; portalContainer: HTMLElement | null; setPortalContainer: (container: HTMLElement | null) => void; eventEmitter: EventEmitter; }; export declare type WebchatTranslations = { [K in keyof typeof defaultTranslations]: string; }; export declare const webhookHandlerErrorMap: { [key in 'ResourceNotFound' | 'Forbidden']: WebchatError; }; export declare const WelcomeHero: ({ heading, subtitle }: WelcomeHeroProps) => JSX.Element; declare type WelcomeHeroProps = { heading: string; subtitle?: string; }; export { }