@bikdotai/bik-component-library 0.0.868 → 0.0.869
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/bik-copilot/ControlledCopilot.js +1 -1
- package/dist/cjs/components/bik-copilot/ControlledCopilot.js.map +1 -1
- package/dist/cjs/components/bik-copilot/CopilotPanel.js +1 -1
- package/dist/cjs/components/bik-copilot/CopilotPanel.js.map +1 -1
- package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js +53 -12
- package/dist/cjs/components/bik-copilot/CopilotPanel.styled.js.map +1 -1
- package/dist/cjs/components/bik-copilot/copilotSelectionPrompt.js +2 -0
- package/dist/cjs/components/bik-copilot/copilotSelectionPrompt.js.map +1 -0
- package/dist/cjs/components/text-selection-ask/SelectionAskPill.js +2 -0
- package/dist/cjs/components/text-selection-ask/SelectionAskPill.js.map +1 -0
- package/dist/cjs/components/text-selection-ask/SelectionAskPill.styled.js +32 -0
- package/dist/cjs/components/text-selection-ask/SelectionAskPill.styled.js.map +1 -0
- package/dist/cjs/components/text-selection-ask/TextSelectionAsk.js +2 -0
- package/dist/cjs/components/text-selection-ask/TextSelectionAsk.js.map +1 -0
- package/dist/cjs/components/text-selection-ask/model.js +2 -0
- package/dist/cjs/components/text-selection-ask/model.js.map +1 -0
- package/dist/cjs/components/text-selection-ask/selectionText.js +2 -0
- package/dist/cjs/components/text-selection-ask/selectionText.js.map +1 -0
- package/dist/cjs/components/text-selection-ask/useTextSelectionAsk.js +2 -0
- package/dist/cjs/components/text-selection-ask/useTextSelectionAsk.js.map +1 -0
- package/dist/cjs/icons/Informational/Common UI/SquaresFour.js +2 -0
- package/dist/cjs/icons/Informational/Common UI/SquaresFour.js.map +1 -0
- package/dist/cjs/icons/index.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/bik-copilot/ControlledCopilot.js +34 -30
- package/dist/esm/components/bik-copilot/ControlledCopilot.js.map +1 -1
- package/dist/esm/components/bik-copilot/CopilotPanel.js +261 -237
- package/dist/esm/components/bik-copilot/CopilotPanel.js.map +1 -1
- package/dist/esm/components/bik-copilot/CopilotPanel.styled.d.ts +8 -0
- package/dist/esm/components/bik-copilot/CopilotPanel.styled.js +69 -25
- package/dist/esm/components/bik-copilot/CopilotPanel.styled.js.map +1 -1
- package/dist/esm/components/bik-copilot/copilotSelectionPrompt.d.ts +13 -0
- package/dist/esm/components/bik-copilot/copilotSelectionPrompt.js +8 -0
- package/dist/esm/components/bik-copilot/copilotSelectionPrompt.js.map +1 -0
- package/dist/esm/components/bik-copilot/model.d.ts +19 -0
- package/dist/esm/components/text-selection-ask/SelectionAskPill.d.ts +22 -0
- package/dist/esm/components/text-selection-ask/SelectionAskPill.js +44 -0
- package/dist/esm/components/text-selection-ask/SelectionAskPill.js.map +1 -0
- package/dist/esm/components/text-selection-ask/SelectionAskPill.styled.d.ts +5 -0
- package/dist/esm/components/text-selection-ask/SelectionAskPill.styled.js +37 -0
- package/dist/esm/components/text-selection-ask/SelectionAskPill.styled.js.map +1 -0
- package/dist/esm/components/text-selection-ask/TextSelectionAsk.d.ts +36 -0
- package/dist/esm/components/text-selection-ask/TextSelectionAsk.js +69 -0
- package/dist/esm/components/text-selection-ask/TextSelectionAsk.js.map +1 -0
- package/dist/esm/components/text-selection-ask/index.d.ts +7 -0
- package/dist/esm/components/text-selection-ask/model.d.ts +112 -0
- package/dist/esm/components/text-selection-ask/model.js +7 -0
- package/dist/esm/components/text-selection-ask/model.js.map +1 -0
- package/dist/esm/components/text-selection-ask/selectionText.d.ts +18 -0
- package/dist/esm/components/text-selection-ask/selectionText.js +7 -0
- package/dist/esm/components/text-selection-ask/selectionText.js.map +1 -0
- package/dist/esm/components/text-selection-ask/useTextSelectionAsk.d.ts +15 -0
- package/dist/esm/components/text-selection-ask/useTextSelectionAsk.js +53 -0
- package/dist/esm/components/text-selection-ask/useTextSelectionAsk.js.map +1 -0
- package/dist/esm/icons/Informational/Common UI/SquaresFour.d.ts +7 -0
- package/dist/esm/icons/Informational/Common UI/SquaresFour.js +33 -0
- package/dist/esm/icons/Informational/Common UI/SquaresFour.js.map +1 -0
- package/dist/esm/icons/Informational/Common UI/index.d.ts +1 -0
- package/dist/esm/icons/index.d.ts +25 -25
- package/dist/esm/icons/index.js +158 -156
- package/dist/esm/icons/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +403 -388
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotPanel.js","sources":["../../../../src/components/bik-copilot/CopilotPanel.tsx"],"sourcesContent":["import ArrowDownIcon from '@src/assets/icons/arrow_down.svg';\nimport AiStarsIcon from '@src/assets/icons/bik_ai_stars_icon.svg';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport RefreshIcon from '@src/assets/icons/refresh.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { DotPulse } from '../dot-pulse';\nimport { BodyCaption, BodySecondary, TitleSmall } from '../TypographyStyle';\nimport { CopilotFeedbackModal } from './CopilotFeedbackModal';\nimport {\n\tDisclaimer,\n\tEmptyState,\n\tEmptyStateIcon,\n\tErrorBanner,\n\tFollowUpChip,\n\tFollowUpList,\n\tFollowUpsLabel,\n\tHeaderActions,\n\tHeaderAvatar,\n\tHeaderBadge,\n\tHeaderText,\n\tHeaderTitleRow,\n\tHistoryLoader,\n\tIconAction,\n\tInputArea,\n\tInputWrapper,\n\tInterruptedNote,\n\tJumpToLatestButton,\n\tMessageAction,\n\tMessageActions,\n\tMessageBubble,\n\tMessageInput,\n\tMessagesArea,\n\tMessagesViewport,\n\tMessageTimestamp,\n\tPanelContainer,\n\tPanelHeader,\n\tScrollFade,\n\tSendButton,\n\tSuggestionChip,\n\tSuggestionList,\n\tThinkingBubble,\n\tThinkingLabel,\n\tToolCtaLink,\n\tToolCtaList,\n} from './CopilotPanel.styled';\nimport { isCopilotRegeneratePrompt } from './copilotRegenerate';\nimport { CopilotFeedbackDetail, CopilotPanelProps } from './model';\nimport { renderCopilotMarkdown } from './utils/markdown';\nimport { toolResultCtas } from './utils/toolCtas';\n\nconst MAX_INPUT_HEIGHT_PX = 96;\n\n/** Slack at the bottom of the scroller that still counts as \"at the latest\". */\nconst AT_BOTTOM_TOLERANCE_PX = 24;\n\n/** How long the copy button shows its confirmation before reverting. */\nconst COPIED_FEEDBACK_MS = 1800;\n\n/**\n * Writes text to the clipboard.\n *\n * `navigator.clipboard` is missing outside a secure context and can reject when\n * the document is not focused, so a hidden-textarea `execCommand` fallback keeps\n * the button working there rather than failing silently.\n */\nconst writeToClipboard = async (text: string): Promise<boolean> => {\n\ttry {\n\t\tif (navigator.clipboard?.writeText) {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\treturn true;\n\t\t}\n\t} catch {\n\t\t// Fall through to the legacy path.\n\t}\n\n\ttry {\n\t\tconst textarea = document.createElement('textarea');\n\t\ttextarea.value = text;\n\t\t// Off-screen rather than hidden: `display: none` cannot be selected.\n\t\ttextarea.setAttribute('readonly', '');\n\t\ttextarea.style.position = 'fixed';\n\t\ttextarea.style.top = '-1000px';\n\t\ttextarea.style.opacity = '0';\n\t\tdocument.body.appendChild(textarea);\n\t\ttextarea.select();\n\t\tconst copied = document.execCommand('copy');\n\t\tdocument.body.removeChild(textarea);\n\t\treturn copied;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** How close to the top counts as asking for the previous page. */\nconst NEAR_TOP_TOLERANCE_PX = 48;\n\nconst formatMessageTime = (timestamp: number): string => {\n\tif (!timestamp || !Number.isFinite(timestamp)) {\n\t\treturn '';\n\t}\n\tconst date = new Date(timestamp);\n\tif (Number.isNaN(date.getTime())) {\n\t\treturn '';\n\t}\n\treturn date.toLocaleTimeString('en-US', {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t});\n};\n\nconst SendArrowIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M12 19V5\" />\n\t\t<path d=\"M6 11l6-6 6 6\" />\n\t</svg>\n);\n\nconst ArrowRightIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 12h14\" />\n\t\t<path d=\"M13 6l6 6-6 6\" />\n\t</svg>\n);\n\nconst StopIcon = ({ size = 16 }: { size?: number }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth={size}\n\t\theight={size}\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" />\n\t</svg>\n);\n\nconst CopyIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n\t\t<path d=\"M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15\" />\n\t</svg>\n);\n\nconst CheckIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2.2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 13l4 4L19 7\" />\n\t</svg>\n);\n\nconst RegenerateIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M20 12a8 8 0 1 1-2.34-5.66\" />\n\t\t<path d=\"M20 4v4h-4\" />\n\t</svg>\n);\n\nconst ThumbUpIcon = ({ filled = false }: { filled?: boolean }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill={filled ? 'currentColor' : 'none'}\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3Z\" />\n\t\t<path d=\"M7 10l4.5-7a2 2 0 0 1 3.7 1.3L14.5 9H19a2 2 0 0 1 2 2.3l-1.1 7A2 2 0 0 1 18 20H7\" />\n\t</svg>\n);\n\nconst ThumbDownIcon = ({ filled = false }: { filled?: boolean }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill={filled ? 'currentColor' : 'none'}\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M7 14V3H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h3Z\" />\n\t\t<path d=\"M7 14l4.5 7a2 2 0 0 0 3.7-1.3L14.5 15H19a2 2 0 0 0 2-2.3l-1.1-7A2 2 0 0 0 18 4H7\" />\n\t</svg>\n);\n\n/**\n * Chat panel used by the copilot. Fully presentational: it renders the\n * transcript it is given and reports user intent through callbacks, so it works\n * against any backend.\n */\nexport const CopilotPanel: React.FC<CopilotPanelProps> = ({\n\tmessages,\n\tonSend,\n\tonClose,\n\ttitle = 'Copilot',\n\tbadge,\n\tsubtitle,\n\tavatar,\n\tplaceholder = 'Write your message...',\n\tdisclaimer = 'AI can make mistakes, Verify the responses.',\n\temptyStateTitle,\n\temptyStateSubtitle = 'Here are some things you can try',\n\tsuggestions,\n\tonSuggestionClick,\n\tshowRefresh = true,\n\tonRefresh,\n\tonRegenerate,\n\tonFeedback,\n\tdislikeTitle,\n\tdislikeSubtitle,\n\tdislikeReasons,\n\tdislikeNotePlaceholder,\n\tdislikeSubmitLabel,\n\tisThinking = false,\n\tthinkingLabel = 'Thinking',\n\tisStreaming = false,\n\tonStop,\n\tinterruptedLabel = 'This message was interrupted',\n\tfollowUpsLabel = 'Follow ups',\n\tonToolCtaClick,\n\thasMoreHistory = false,\n\tisLoadingHistory = false,\n\tonLoadOlderMessages,\n\thistoryLoadingLabel = 'Loading earlier messages',\n\tinputDisabled = false,\n\terrorMessage,\n\twidth,\n\theight,\n\tclassName,\n\tstyle,\n}) => {\n\tconst [input, setInput] = useState('');\n\tconst [isInputFocused, setIsInputFocused] = useState(false);\n\tconst [isAtLatest, setIsAtLatest] = useState(true);\n\t// Which reply is showing \"Copied\" — per message, so copying one does not tick\n\t// the button under another.\n\tconst [copiedMessageId, setCopiedMessageId] = useState<string | null>(null);\n\n\tconst [feedback, setFeedback] = useState<\n\t\tRecord<string, 'like' | 'dislike' | undefined>\n\t>({});\n\t// Which reply is being asked about. A thumbs-down opens the prompt and the\n\t// rating is reported once it is answered or dismissed -- so pressing the\n\t// thumb is never lost, and one thumb never becomes two ratings.\n\tconst [dislikePromptId, setDislikePromptId] = useState<string | null>(null);\n\tconst inputRef = useRef<HTMLTextAreaElement>(null);\n\tconst copiedTimeoutRef = useRef<number | null>(null);\n\tconst bottomRef = useRef<HTMLDivElement>(null);\n\tconst scrollerRef = useRef<HTMLDivElement>(null);\n\tconst lastScrollTopRef = useRef(0);\n\t// Distance from the bottom at the moment an older page was asked for. Older\n\t// messages land *above* the viewport, so without restoring against this the\n\t// content under the reader jumps down by the height of what arrived.\n\tconst anchorFromBottomRef = useRef<number | null>(null);\n\n\t// An assistant bubble is pushed the moment a turn starts, before any text has\n\t// arrived; the thinking indicator stands in for it until then, so rendering it\n\t// too would show an empty balloon next to the dots. A turn stopped before its\n\t// first token keeps its place, carrying only the interrupted note.\n\tconst visibleMessages = messages.filter(\n\t\t(message) =>\n\t\t\t(message.content.length > 0 || message.wasInterrupted) &&\n\t\t\t!isCopilotRegeneratePrompt(message.content),\n\t);\n\tconst isEmpty = visibleMessages.length === 0 && !isThinking;\n\tconst isTurnInFlight = isThinking || isStreaming;\n\tconst canSend = !inputDisabled && !isTurnInFlight && input.trim().length > 0;\n\t// Stopping is the only thing the button can do mid-answer, so it becomes the\n\t// stop button rather than sitting there disabled.\n\tconst canStop = isTurnInFlight && Boolean(onStop);\n\t// Only the newest reply's suggestions are on offer — older ones answer a\n\t// question the conversation has already moved past.\n\tconst newestMessage = visibleMessages[visibleMessages.length - 1];\n\tconst followUps =\n\t\t!isTurnInFlight && newestMessage?.role === 'assistant'\n\t\t\t? newestMessage.followUps\n\t\t\t: undefined;\n\t// A long answer that the reader has scrolled up from: the tail is clipped, so\n\t// the fade and the arrow say there is more below.\n\tconst showScrollAffordance = !isEmpty && !isAtLatest;\n\n\t// Following the conversation is the default, but a reader who has scrolled up\n\t// mid-answer must not be yanked back down by the next chunk.\n\tuseEffect(() => {\n\t\tif (!isAtLatest) {\n\t\t\treturn;\n\t\t}\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t}, [messages, isThinking, isAtLatest]);\n\n\t// Older messages have landed: put the reader back on the message they were\n\t// looking at, which is now that much further down.\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tconst anchor = anchorFromBottomRef.current;\n\t\tif (!scroller || anchor === null || isLoadingHistory) {\n\t\t\treturn;\n\t\t}\n\t\tanchorFromBottomRef.current = null;\n\t\tscroller.scrollTop = scroller.scrollHeight - anchor;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\t}, [messages, isLoadingHistory]);\n\n\tconst handleScroll = () => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\treturn;\n\t\t}\n\t\tconst distanceFromBottom =\n\t\t\tscroller.scrollHeight - scroller.scrollTop - scroller.clientHeight;\n\n\t\t// Reaching the top asks for the page before this one. The threshold gives\n\t\t// the request a head start, so the page is usually there by the time the\n\t\t// reader arrives.\n\t\tif (\n\t\t\tscroller.scrollTop <= NEAR_TOP_TOLERANCE_PX &&\n\t\t\thasMoreHistory &&\n\t\t\t!isLoadingHistory &&\n\t\t\tonLoadOlderMessages\n\t\t) {\n\t\t\tanchorFromBottomRef.current = scroller.scrollHeight - scroller.scrollTop;\n\t\t\tonLoadOlderMessages();\n\t\t}\n\t\t// Scrolling *up* is the only thing that detaches from the latest message:\n\t\t// growing content also pushes the bottom away, and auto-scroll itself only\n\t\t// ever moves down, so distance alone would flap mid-stream.\n\t\tconst scrolledUp = scroller.scrollTop < lastScrollTopRef.current - 1;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\n\t\tif (distanceFromBottom <= AT_BOTTOM_TOLERANCE_PX) {\n\t\t\tsetIsAtLatest(true);\n\t\t\treturn;\n\t\t}\n\t\tif (scrolledUp) {\n\t\t\tsetIsAtLatest(false);\n\t\t}\n\t};\n\n\tconst handleJumpToLatest = () => {\n\t\tsetIsAtLatest(true);\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t};\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tif (copiedTimeoutRef.current) {\n\t\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tconst handleCopyMessage = async (\n\t\tmessage: CopilotPanelProps['messages'][number],\n\t) => {\n\t\t// The raw markdown, not the rendered HTML — that is what a reader wants to\n\t\t// paste into a doc or a ticket.\n\t\tconst copied = await writeToClipboard(message.content);\n\t\tif (!copied) {\n\t\t\treturn;\n\t\t}\n\t\tif (copiedTimeoutRef.current) {\n\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t}\n\t\tsetCopiedMessageId(message.id);\n\t\tcopiedTimeoutRef.current = window.setTimeout(\n\t\t\t() => setCopiedMessageId(null),\n\t\t\tCOPIED_FEEDBACK_MS,\n\t\t);\n\t};\n\n\tconst handleFeedback = (messageId: string, vote: 'like' | 'dislike') => {\n\t\t// Pressing the same thumb again clears the vote. Nothing is reported for\n\t\t// that: the backend records ratings, not their absence.\n\t\tconst cleared = feedback[messageId] === vote;\n\t\tsetFeedback((previous) => ({\n\t\t\t...previous,\n\t\t\t[messageId]: previous[messageId] === vote ? undefined : vote,\n\t\t}));\n\t\t// Everything below sits outside the updater on purpose: React may run an\n\t\t// updater twice, which would report the same vote twice.\n\t\tif (cleared) {\n\t\t\tif (vote === 'dislike') {\n\t\t\t\tsetDislikePromptId((current) =>\n\t\t\t\t\tcurrent === messageId ? null : current,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (vote === 'like') {\n\t\t\tonFeedback?.(messageId, 'like');\n\t\t\treturn;\n\t\t}\n\t\t// A thumbs-down asks what went wrong first. Moving the prompt to another\n\t\t// reply still records the one it is leaving.\n\t\tif (dislikePromptId && dislikePromptId !== messageId) {\n\t\t\tonFeedback?.(dislikePromptId, 'dislike');\n\t\t}\n\t\tsetDislikePromptId(messageId);\n\t};\n\n\tconst reportDislike = (messageId: string, detail?: CopilotFeedbackDetail) => {\n\t\tsetDislikePromptId((current) => (current === messageId ? null : current));\n\t\tonFeedback?.(messageId, 'dislike', detail);\n\t};\n\n\tconst handleRegenerate = () => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonRegenerate?.();\n\t};\n\n\tconst handleSend = () => {\n\t\tconst trimmed = input.trim();\n\t\tif (!trimmed || inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSend(trimmed);\n\t\tsetInput('');\n\t\tconst textarea = inputRef.current;\n\t\tif (textarea) {\n\t\t\ttextarea.style.height = 'auto';\n\t\t}\n\t};\n\n\tconst handleInputChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\tsetInput(event.target.value);\n\t\tconst textarea = event.target;\n\t\ttextarea.style.height = 'auto';\n\t\ttextarea.style.height = `${Math.min(\n\t\t\ttextarea.scrollHeight,\n\t\t\tMAX_INPUT_HEIGHT_PX,\n\t\t)}px`;\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n\t\tif (event.key === 'Enter' && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSend();\n\t\t}\n\t};\n\n\tconst handleSuggestionClick = (\n\t\tsuggestion: NonNullable<CopilotPanelProps['suggestions']>[number],\n\t) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSuggestionClick?.(suggestion);\n\t\tonSend(suggestion.text);\n\t};\n\n\tconst handleFollowUpClick = (followUp: string) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSend(followUp);\n\t};\n\n\treturn (\n\t\t<PanelContainer\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, height, ...style }}\n\t\t\trole=\"dialog\"\n\t\t\taria-label={title}\n\t\t>\n\t\t\t<PanelHeader>\n\t\t\t\t<HeaderAvatar>\n\t\t\t\t\t{avatar ?? <AiStarsIcon width={18} height={18} />}\n\t\t\t\t</HeaderAvatar>\n\t\t\t\t<HeaderText>\n\t\t\t\t\t<HeaderTitleRow>\n\t\t\t\t\t\t<TitleSmall>{title}</TitleSmall>\n\t\t\t\t\t\t{badge && <HeaderBadge>{badge}</HeaderBadge>}\n\t\t\t\t\t</HeaderTitleRow>\n\t\t\t\t\t{subtitle && (\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t)}\n\t\t\t\t</HeaderText>\n\t\t\t\t<HeaderActions>\n\t\t\t\t\t{showRefresh && onRefresh && (\n\t\t\t\t\t\t<IconAction\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={onRefresh}\n\t\t\t\t\t\t\taria-label=\"Start a new conversation\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RefreshIcon width={16} height={16} />\n\t\t\t\t\t\t</IconAction>\n\t\t\t\t\t)}\n\t\t\t\t\t<IconAction\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close copilot\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CrossIcon width={18} height={18} />\n\t\t\t\t\t</IconAction>\n\t\t\t\t</HeaderActions>\n\t\t\t</PanelHeader>\n\n\t\t\t<MessagesViewport>\n\t\t\t\t<MessagesArea\n\t\t\t\t\tref={scrollerRef}\n\t\t\t\t\tonScroll={handleScroll}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Conversation\"\n\t\t\t\t>\n\t\t\t\t\t{isEmpty ? (\n\t\t\t\t\t\t<EmptyState>\n\t\t\t\t\t\t\t<EmptyStateIcon>\n\t\t\t\t\t\t\t\t<AiStarsIcon width={28} height={28} />\n\t\t\t\t\t\t\t</EmptyStateIcon>\n\t\t\t\t\t\t\t<BodySecondary style={{ fontWeight: 600 }}>\n\t\t\t\t\t\t\t\t{emptyStateTitle || title}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t{emptyStateSubtitle && (\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{emptyStateSubtitle}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{suggestions && suggestions.length > 0 && (\n\t\t\t\t\t\t\t\t<SuggestionList>\n\t\t\t\t\t\t\t\t\t{suggestions.map((suggestion) => (\n\t\t\t\t\t\t\t\t\t\t<SuggestionChip\n\t\t\t\t\t\t\t\t\t\t\tkey={suggestion.id}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled || isTurnInFlight}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleSuggestionClick(suggestion)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<AiStarsIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t\t{suggestion.text}\n\t\t\t\t\t\t\t\t\t\t</SuggestionChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</SuggestionList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</EmptyState>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{isLoadingHistory && (\n\t\t\t\t\t\t\t\t<HistoryLoader role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.content.placeholder} size={4} />\n\t\t\t\t\t\t\t\t\t{historyLoadingLabel}\n\t\t\t\t\t\t\t\t</HistoryLoader>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{visibleMessages.map((message) => {\n\t\t\t\t\t\t\t\tconst sentAt =\n\t\t\t\t\t\t\t\t\tmessage.role === 'user'\n\t\t\t\t\t\t\t\t\t\t? formatMessageTime(message.timestamp)\n\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<React.Fragment key={message.id}>\n\t\t\t\t\t\t\t\t\t\t{message.content.length > 0 && (\n\t\t\t\t\t\t\t\t\t\t\t<MessageBubble $role={message.role}>\n\t\t\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t__html: renderCopilotMarkdown(message.content),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ whiteSpace: 'pre-wrap' }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{message.content}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</MessageBubble>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{/* Tool CTAs (e.g. the support-portal link) — only once the\n\t\t\t\t\t\t\t\t\t\t reply has finished, so a button cannot flash mid-stream. */}\n\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' &&\n\t\t\t\t\t\t\t\t\t\t\t!message.isStreaming &&\n\t\t\t\t\t\t\t\t\t\t\t(() => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst ctas = toolResultCtas(message.toolResults);\n\t\t\t\t\t\t\t\t\t\t\t\tif (ctas.length === 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ToolCtaList>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ctas.map((cta) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ToolCtaLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={`${cta.tool}-${cta.url}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thref={cta.url}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonToolCtaClick?.({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttool: cta.tool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: cta.url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{cta.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ToolCtaLink>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ToolCtaList>\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t})()}\n\t\t\t\t\t\t\t\t\t\t{sentAt && <MessageTimestamp>{sentAt}</MessageTimestamp>}\n\t\t\t\t\t\t\t\t\t\t{message.wasInterrupted && interruptedLabel && (\n\t\t\t\t\t\t\t\t\t\t\t<InterruptedNote>\n\t\t\t\t\t\t\t\t\t\t\t\t<StopIcon size={12} />\n\t\t\t\t\t\t\t\t\t\t\t\t{interruptedLabel}\n\t\t\t\t\t\t\t\t\t\t\t</InterruptedNote>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{/* Only under a finished reply: mid-stream the text is still\n\t\t\t\t\t\t\t\t\t\t changing, so copying it would capture a partial answer. */}\n\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' &&\n\t\t\t\t\t\t\t\t\t\t\tmessage.content.length > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t!message.isStreaming && (\n\t\t\t\t\t\t\t\t\t\t\t\t<MessageActions>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => void handleCopyMessage(message)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-copied={copiedMessageId === message.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id ? 'Copied' : 'Copy'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'Response copied to clipboard'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'Copy response'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{copiedMessageId === message.id ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CopyIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{/* Only under the newest reply: regenerating appends a\n\t\t\t\t\t\t\t\t\t\t\t\t\t fresh turn at the end, so offering it against an\n\t\t\t\t\t\t\t\t\t\t\t\t\t older answer would not replace that answer. */}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{onRegenerate && message.id === newestMessage?.id && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={handleRegenerate}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled || isTurnInFlight}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Regenerate\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Regenerate response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<RegenerateIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleFeedback(message.id, 'like')}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-selected={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Good response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Good response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ThumbUpIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfilled={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleFeedback(message.id, 'dislike')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-selected={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Bad response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Bad response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ThumbDownIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfilled={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t</MessageActions>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{dislikePromptId === message.id && (\n\t\t\t\t\t\t\t\t\t\t\t<CopilotFeedbackModal\n\t\t\t\t\t\t\t\t\t\t\t\ttitle={dislikeTitle}\n\t\t\t\t\t\t\t\t\t\t\t\tsubtitle={dislikeSubtitle ?? `Help us improve ${title}`}\n\t\t\t\t\t\t\t\t\t\t\t\treasons={dislikeReasons}\n\t\t\t\t\t\t\t\t\t\t\t\tnotePlaceholder={dislikeNotePlaceholder}\n\t\t\t\t\t\t\t\t\t\t\t\tsubmitLabel={dislikeSubmitLabel}\n\t\t\t\t\t\t\t\t\t\t\t\tonSubmit={(detail) => reportDislike(message.id, detail)}\n\t\t\t\t\t\t\t\t\t\t\t\tonDismiss={() => reportDislike(message.id)}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{followUps && followUps.length > 0 && (\n\t\t\t\t\t\t\t\t<FollowUpList>\n\t\t\t\t\t\t\t\t\t{followUpsLabel && (\n\t\t\t\t\t\t\t\t\t\t<FollowUpsLabel>{followUpsLabel}</FollowUpsLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{followUps.map((followUp) => (\n\t\t\t\t\t\t\t\t\t\t<FollowUpChip\n\t\t\t\t\t\t\t\t\t\t\tkey={followUp}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleFollowUpClick(followUp)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowRightIcon />\n\t\t\t\t\t\t\t\t\t\t\t{followUp}\n\t\t\t\t\t\t\t\t\t\t</FollowUpChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</FollowUpList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{isThinking && (\n\t\t\t\t\t\t\t\t<ThinkingBubble role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<AiStarsIcon\n\t\t\t\t\t\t\t\t\t\twidth={14}\n\t\t\t\t\t\t\t\t\t\theight={14}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.brand}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{thinkingLabel && (\n\t\t\t\t\t\t\t\t\t\t<ThinkingLabel>{thinkingLabel}</ThinkingLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.background.brand} size={5} />\n\t\t\t\t\t\t\t\t</ThinkingBubble>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<div ref={bottomRef} />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</MessagesArea>\n\n\t\t\t\t<ScrollFade $visible={showScrollAffordance} aria-hidden=\"true\" />\n\t\t\t\t<JumpToLatestButton\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t$visible={showScrollAffordance}\n\t\t\t\t\tonClick={handleJumpToLatest}\n\t\t\t\t\ttabIndex={showScrollAffordance ? 0 : -1}\n\t\t\t\t\taria-label=\"Scroll to the latest message\"\n\t\t\t\t>\n\t\t\t\t\t<ArrowDownIcon width={16} height={16} />\n\t\t\t\t</JumpToLatestButton>\n\t\t\t</MessagesViewport>\n\n\t\t\t{errorMessage && <ErrorBanner role=\"alert\">{errorMessage}</ErrorBanner>}\n\n\t\t\t<InputArea>\n\t\t\t\t<InputWrapper $focused={isInputFocused}>\n\t\t\t\t\t<MessageInput\n\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\trows={1}\n\t\t\t\t\t\tvalue={input}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tonFocus={() => setIsInputFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsInputFocused(false)}\n\t\t\t\t\t/>\n\t\t\t\t\t<SendButton\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t$active={canStop || canSend}\n\t\t\t\t\t\tdisabled={!canStop && !canSend}\n\t\t\t\t\t\tonClick={canStop ? onStop : handleSend}\n\t\t\t\t\t\taria-label={canStop ? 'Stop generating' : 'Send message'}\n\t\t\t\t\t>\n\t\t\t\t\t\t{canStop ? <StopIcon /> : <SendArrowIcon />}\n\t\t\t\t\t</SendButton>\n\t\t\t\t</InputWrapper>\n\t\t\t</InputArea>\n\n\t\t\t{disclaimer && <Disclaimer>{disclaimer}</Disclaimer>}\n\t\t</PanelContainer>\n\t);\n};\n\nexport default CopilotPanel;\n"],"names":["MAX_INPUT_HEIGHT_PX","AT_BOTTOM_TOLERANCE_PX","COPIED_FEEDBACK_MS","writeToClipboard","text","textarea","copied","NEAR_TOP_TOLERANCE_PX","formatMessageTime","timestamp","date","SendArrowIcon","jsxs","jsx","ArrowRightIcon","StopIcon","size","CopyIcon","CheckIcon","RegenerateIcon","ThumbUpIcon","filled","ThumbDownIcon","CopilotPanel","messages","onSend","onClose","title","badge","subtitle","avatar","placeholder","disclaimer","emptyStateTitle","emptyStateSubtitle","suggestions","onSuggestionClick","showRefresh","onRefresh","onRegenerate","onFeedback","dislikeTitle","dislikeSubtitle","dislikeReasons","dislikeNotePlaceholder","dislikeSubmitLabel","isThinking","thinkingLabel","isStreaming","onStop","interruptedLabel","followUpsLabel","onToolCtaClick","hasMoreHistory","isLoadingHistory","onLoadOlderMessages","historyLoadingLabel","inputDisabled","errorMessage","width","height","className","style","input","setInput","useState","isInputFocused","setIsInputFocused","isAtLatest","setIsAtLatest","copiedMessageId","setCopiedMessageId","feedback","setFeedback","dislikePromptId","setDislikePromptId","inputRef","useRef","copiedTimeoutRef","bottomRef","scrollerRef","lastScrollTopRef","anchorFromBottomRef","visibleMessages","message","isCopilotRegeneratePrompt","isEmpty","isTurnInFlight","canSend","canStop","newestMessage","followUps","showScrollAffordance","useEffect","scroller","anchor","handleScroll","distanceFromBottom","scrolledUp","handleJumpToLatest","handleCopyMessage","handleFeedback","messageId","vote","cleared","previous","current","reportDislike","detail","handleRegenerate","handleSend","trimmed","handleInputChange","event","handleKeyDown","handleSuggestionClick","suggestion","handleFollowUpClick","followUp","PanelContainer","PanelHeader","HeaderAvatar","AiStarsIcon","HeaderText","HeaderTitleRow","TitleSmall","HeaderBadge","BodyCaption","COLORS","HeaderActions","IconAction","RefreshIcon","CrossIcon","MessagesViewport","MessagesArea","EmptyState","EmptyStateIcon","BodySecondary","SuggestionList","SuggestionChip","Fragment","HistoryLoader","DotPulse","sentAt","React","MessageBubble","renderCopilotMarkdown","ctas","toolResultCtas","ToolCtaList","cta","ToolCtaLink","MessageTimestamp","InterruptedNote","MessageActions","MessageAction","CopilotFeedbackModal","FollowUpList","FollowUpsLabel","FollowUpChip","ThinkingBubble","ThinkingLabel","ScrollFade","JumpToLatestButton","ArrowDownIcon","ErrorBanner","InputArea","InputWrapper","MessageInput","SendButton","Disclaimer"],"mappings":";;;;;;;;;;;;;;AAmDA,MAAMA,KAAsB,IAGtBC,KAAyB,IAGzBC,KAAqB,MASrBC,KAAmB,OAAOC,MAAmC;AAClE,MAAI;AACH,QAAI,UAAU,WAAW;AACxB,mBAAM,UAAU,UAAU,UAAUA,CAAI,GACjC;AAAA,EAET,QAAQ;AAAA,EAER;AAEA,MAAI;AACH,UAAMC,IAAW,SAAS,cAAc,UAAU;AAClD,IAAAA,EAAS,QAAQD,GAEjBC,EAAS,aAAa,YAAY,EAAE,GACpCA,EAAS,MAAM,WAAW,SAC1BA,EAAS,MAAM,MAAM,WACrBA,EAAS,MAAM,UAAU,KACzB,SAAS,KAAK,YAAYA,CAAQ,GAClCA,EAAS,OAAA;AACT,UAAMC,IAAS,SAAS,YAAY,MAAM;AAC1C,oBAAS,KAAK,YAAYD,CAAQ,GAC3BC;AAAA,EACR,QAAQ;AACP,WAAO;AAAA,EACR;AACD,GAGMC,KAAwB,IAExBC,KAAoB,CAACC,MAA8B;AACxD,MAAI,CAACA,KAAa,CAAC,OAAO,SAASA,CAAS;AAC3C,WAAO;AAER,QAAMC,IAAO,IAAI,KAAKD,CAAS;AAC/B,SAAI,OAAO,MAAMC,EAAK,QAAA,CAAS,IACvB,KAEDA,EAAK,mBAAmB,SAAS;AAAA,IACvC,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA,CACR;AACF,GAEMC,KAAgB,MACrB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,SAAQ;AAAA,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AAMA,EAAkB,EAAK;AAAA,YAAA;AAAA,UAAA;AAAA,UAEtC,gBAAAtD;AAAA,YAAC4J;AAAA,YAAA;AAAA,cACA,MAAK;AAAA,cACL,SAAShF,KAAWD;AAAA,cACpB,UAAU,CAACC,KAAW,CAACD;AAAA,cACvB,SAASC,IAAUxC,IAAS6D;AAAA,cAC5B,cAAYrB,IAAU,oBAAoB;AAAA,cAEzC,UAAAA,IAAU,gBAAA5E,EAACE,IAAA,CAAA,CAAS,sBAAMJ,IAAA,CAAA,CAAc;AAAA,YAAA;AAAA,UAAA;AAAA,QAC1C,EAAA,CACD,EAAA,CACD;AAAA,QAECqB,KAAc,gBAAAnB,EAAC6J,IAAA,EAAY,UAAA1I,EAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1C;"}
|
|
1
|
+
{"version":3,"file":"CopilotPanel.js","sources":["../../../../src/components/bik-copilot/CopilotPanel.tsx"],"sourcesContent":["import ArrowDownIcon from '@src/assets/icons/arrow_down.svg';\nimport AiStarsIcon from '@src/assets/icons/bik_ai_stars_icon.svg';\nimport CrossIcon from '@src/assets/icons/cross.svg';\nimport RefreshIcon from '@src/assets/icons/refresh.svg';\nimport React, { useEffect, useRef, useState } from 'react';\nimport { COLORS } from '@src/constants/Theme';\nimport { DotPulse } from '../dot-pulse';\nimport { BodyCaption, BodySecondary, TitleSmall } from '../TypographyStyle';\nimport { CopilotFeedbackModal } from './CopilotFeedbackModal';\nimport {\n\tAttachmentChip,\n\tAttachmentRemove,\n\tAttachmentText,\n\tDisclaimer,\n\tEmptyState,\n\tEmptyStateIcon,\n\tErrorBanner,\n\tFollowUpChip,\n\tFollowUpList,\n\tFollowUpsLabel,\n\tHeaderActions,\n\tHeaderAvatar,\n\tHeaderBadge,\n\tHeaderText,\n\tHeaderTitleRow,\n\tHistoryLoader,\n\tIconAction,\n\tInputArea,\n\tInputWrapper,\n\tInterruptedNote,\n\tJumpToLatestButton,\n\tMessageAction,\n\tMessageActions,\n\tMessageBubble,\n\tMessageInput,\n\tMessagesArea,\n\tMessagesViewport,\n\tMessageTimestamp,\n\tPanelContainer,\n\tPanelHeader,\n\tScrollFade,\n\tSendButton,\n\tSuggestionChip,\n\tSuggestionList,\n\tThinkingBubble,\n\tThinkingLabel,\n\tToolCtaLink,\n\tToolCtaList,\n} from './CopilotPanel.styled';\nimport { isCopilotRegeneratePrompt } from './copilotRegenerate';\nimport { buildCopilotSelectionPrompt } from './copilotSelectionPrompt';\nimport { CopilotFeedbackDetail, CopilotPanelProps } from './model';\nimport { renderCopilotMarkdown } from './utils/markdown';\nimport { toolResultCtas } from './utils/toolCtas';\n\nconst MAX_INPUT_HEIGHT_PX = 96;\n\n/** Slack at the bottom of the scroller that still counts as \"at the latest\". */\nconst AT_BOTTOM_TOLERANCE_PX = 24;\n\n/** How long the copy button shows its confirmation before reverting. */\nconst COPIED_FEEDBACK_MS = 1800;\n\n/**\n * Writes text to the clipboard.\n *\n * `navigator.clipboard` is missing outside a secure context and can reject when\n * the document is not focused, so a hidden-textarea `execCommand` fallback keeps\n * the button working there rather than failing silently.\n */\nconst writeToClipboard = async (text: string): Promise<boolean> => {\n\ttry {\n\t\tif (navigator.clipboard?.writeText) {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\treturn true;\n\t\t}\n\t} catch {\n\t\t// Fall through to the legacy path.\n\t}\n\n\ttry {\n\t\tconst textarea = document.createElement('textarea');\n\t\ttextarea.value = text;\n\t\t// Off-screen rather than hidden: `display: none` cannot be selected.\n\t\ttextarea.setAttribute('readonly', '');\n\t\ttextarea.style.position = 'fixed';\n\t\ttextarea.style.top = '-1000px';\n\t\ttextarea.style.opacity = '0';\n\t\tdocument.body.appendChild(textarea);\n\t\ttextarea.select();\n\t\tconst copied = document.execCommand('copy');\n\t\tdocument.body.removeChild(textarea);\n\t\treturn copied;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** How close to the top counts as asking for the previous page. */\nconst NEAR_TOP_TOLERANCE_PX = 48;\n\nconst formatMessageTime = (timestamp: number): string => {\n\tif (!timestamp || !Number.isFinite(timestamp)) {\n\t\treturn '';\n\t}\n\tconst date = new Date(timestamp);\n\tif (Number.isNaN(date.getTime())) {\n\t\treturn '';\n\t}\n\treturn date.toLocaleTimeString('en-US', {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t});\n};\n\nconst SendArrowIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"16\"\n\t\theight=\"16\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M12 19V5\" />\n\t\t<path d=\"M6 11l6-6 6 6\" />\n\t</svg>\n);\n\nconst ArrowRightIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 12h14\" />\n\t\t<path d=\"M13 6l6 6-6 6\" />\n\t</svg>\n);\n\nconst StopIcon = ({ size = 16 }: { size?: number }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth={size}\n\t\theight={size}\n\t\tfill=\"currentColor\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"7\" y=\"7\" width=\"10\" height=\"10\" rx=\"2\" />\n\t</svg>\n);\n\nconst CopyIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2\" />\n\t\t<path d=\"M15 5.5A1.5 1.5 0 0 0 13.5 4H5.5A1.5 1.5 0 0 0 4 5.5v8A1.5 1.5 0 0 0 5.5 15\" />\n\t</svg>\n);\n\nconst CheckIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"2.2\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M5 13l4 4L19 7\" />\n\t</svg>\n);\n\nconst RegenerateIcon = () => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M20 12a8 8 0 1 1-2.34-5.66\" />\n\t\t<path d=\"M20 4v4h-4\" />\n\t</svg>\n);\n\nconst ThumbUpIcon = ({ filled = false }: { filled?: boolean }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill={filled ? 'currentColor' : 'none'}\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M7 10v11H4a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1h3Z\" />\n\t\t<path d=\"M7 10l4.5-7a2 2 0 0 1 3.7 1.3L14.5 9H19a2 2 0 0 1 2 2.3l-1.1 7A2 2 0 0 1 18 20H7\" />\n\t</svg>\n);\n\nconst ThumbDownIcon = ({ filled = false }: { filled?: boolean }) => (\n\t<svg\n\t\tviewBox=\"0 0 24 24\"\n\t\twidth=\"14\"\n\t\theight=\"14\"\n\t\tfill={filled ? 'currentColor' : 'none'}\n\t\tstroke=\"currentColor\"\n\t\tstrokeWidth=\"1.8\"\n\t\tstrokeLinecap=\"round\"\n\t\tstrokeLinejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t>\n\t\t<path d=\"M7 14V3H4a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h3Z\" />\n\t\t<path d=\"M7 14l4.5 7a2 2 0 0 0 3.7-1.3L14.5 15H19a2 2 0 0 0 2-2.3l-1.1-7A2 2 0 0 0 18 4H7\" />\n\t</svg>\n);\n\n/**\n * Chat panel used by the copilot. Fully presentational: it renders the\n * transcript it is given and reports user intent through callbacks, so it works\n * against any backend.\n */\nexport const CopilotPanel: React.FC<CopilotPanelProps> = ({\n\tmessages,\n\tonSend,\n\tonClose,\n\ttitle = 'Copilot',\n\tbadge,\n\tsubtitle,\n\tavatar,\n\tplaceholder = 'Write your message...',\n\tdisclaimer = 'AI can make mistakes, Verify the responses.',\n\temptyStateTitle,\n\temptyStateSubtitle = 'Here are some things you can try',\n\tsuggestions,\n\tonSuggestionClick,\n\tshowRefresh = true,\n\tonRefresh,\n\tonRegenerate,\n\tonFeedback,\n\tdislikeTitle,\n\tdislikeSubtitle,\n\tdislikeReasons,\n\tdislikeNotePlaceholder,\n\tdislikeSubmitLabel,\n\tisThinking = false,\n\tthinkingLabel = 'Thinking',\n\tisStreaming = false,\n\tonStop,\n\tinterruptedLabel = 'This message was interrupted',\n\tfollowUpsLabel = 'Follow ups',\n\tonToolCtaClick,\n\thasMoreHistory = false,\n\tisLoadingHistory = false,\n\tonLoadOlderMessages,\n\thistoryLoadingLabel = 'Loading earlier messages',\n\tinputDisabled = false,\n\tattachment,\n\tonAttachmentRemove,\n\terrorMessage,\n\twidth,\n\theight,\n\tclassName,\n\tstyle,\n}) => {\n\tconst [input, setInput] = useState('');\n\tconst [isInputFocused, setIsInputFocused] = useState(false);\n\tconst [isAtLatest, setIsAtLatest] = useState(true);\n\t// Which reply is showing \"Copied\" — per message, so copying one does not tick\n\t// the button under another.\n\tconst [copiedMessageId, setCopiedMessageId] = useState<string | null>(null);\n\n\tconst [feedback, setFeedback] = useState<\n\t\tRecord<string, 'like' | 'dislike' | undefined>\n\t>({});\n\t// Which reply is being asked about. A thumbs-down opens the prompt and the\n\t// rating is reported once it is answered or dismissed -- so pressing the\n\t// thumb is never lost, and one thumb never becomes two ratings.\n\tconst [dislikePromptId, setDislikePromptId] = useState<string | null>(null);\n\tconst inputRef = useRef<HTMLTextAreaElement>(null);\n\tconst copiedTimeoutRef = useRef<number | null>(null);\n\tconst bottomRef = useRef<HTMLDivElement>(null);\n\tconst scrollerRef = useRef<HTMLDivElement>(null);\n\tconst lastScrollTopRef = useRef(0);\n\t// Distance from the bottom at the moment an older page was asked for. Older\n\t// messages land *above* the viewport, so without restoring against this the\n\t// content under the reader jumps down by the height of what arrived.\n\tconst anchorFromBottomRef = useRef<number | null>(null);\n\n\t// An assistant bubble is pushed the moment a turn starts, before any text has\n\t// arrived; the thinking indicator stands in for it until then, so rendering it\n\t// too would show an empty balloon next to the dots. A turn stopped before its\n\t// first token keeps its place, carrying only the interrupted note.\n\tconst visibleMessages = messages.filter(\n\t\t(message) =>\n\t\t\t(message.content.length > 0 || message.wasInterrupted) &&\n\t\t\t!isCopilotRegeneratePrompt(message.content),\n\t);\n\tconst isEmpty = visibleMessages.length === 0 && !isThinking;\n\tconst isTurnInFlight = isThinking || isStreaming;\n\tconst canSend =\n\t\t!inputDisabled &&\n\t\t!isTurnInFlight &&\n\t\t(input.trim().length > 0 || Boolean(attachment));\n\t// Stopping is the only thing the button can do mid-answer, so it becomes the\n\t// stop button rather than sitting there disabled.\n\tconst canStop = isTurnInFlight && Boolean(onStop);\n\t// Only the newest reply's suggestions are on offer — older ones answer a\n\t// question the conversation has already moved past.\n\tconst newestMessage = visibleMessages[visibleMessages.length - 1];\n\tconst followUps =\n\t\t!isTurnInFlight && newestMessage?.role === 'assistant'\n\t\t\t? newestMessage.followUps\n\t\t\t: undefined;\n\t// A long answer that the reader has scrolled up from: the tail is clipped, so\n\t// the fade and the arrow say there is more below.\n\tconst showScrollAffordance = !isEmpty && !isAtLatest;\n\n\t// Following the conversation is the default, but a reader who has scrolled up\n\t// mid-answer must not be yanked back down by the next chunk.\n\tuseEffect(() => {\n\t\tif (!isAtLatest) {\n\t\t\treturn;\n\t\t}\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t}, [messages, isThinking, isAtLatest]);\n\n\t// Older messages have landed: put the reader back on the message they were\n\t// looking at, which is now that much further down.\n\tuseEffect(() => {\n\t\tconst scroller = scrollerRef.current;\n\t\tconst anchor = anchorFromBottomRef.current;\n\t\tif (!scroller || anchor === null || isLoadingHistory) {\n\t\t\treturn;\n\t\t}\n\t\tanchorFromBottomRef.current = null;\n\t\tscroller.scrollTop = scroller.scrollHeight - anchor;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\t}, [messages, isLoadingHistory]);\n\n\tconst handleScroll = () => {\n\t\tconst scroller = scrollerRef.current;\n\t\tif (!scroller) {\n\t\t\treturn;\n\t\t}\n\t\tconst distanceFromBottom =\n\t\t\tscroller.scrollHeight - scroller.scrollTop - scroller.clientHeight;\n\n\t\t// Reaching the top asks for the page before this one. The threshold gives\n\t\t// the request a head start, so the page is usually there by the time the\n\t\t// reader arrives.\n\t\tif (\n\t\t\tscroller.scrollTop <= NEAR_TOP_TOLERANCE_PX &&\n\t\t\thasMoreHistory &&\n\t\t\t!isLoadingHistory &&\n\t\t\tonLoadOlderMessages\n\t\t) {\n\t\t\tanchorFromBottomRef.current = scroller.scrollHeight - scroller.scrollTop;\n\t\t\tonLoadOlderMessages();\n\t\t}\n\t\t// Scrolling *up* is the only thing that detaches from the latest message:\n\t\t// growing content also pushes the bottom away, and auto-scroll itself only\n\t\t// ever moves down, so distance alone would flap mid-stream.\n\t\tconst scrolledUp = scroller.scrollTop < lastScrollTopRef.current - 1;\n\t\tlastScrollTopRef.current = scroller.scrollTop;\n\n\t\tif (distanceFromBottom <= AT_BOTTOM_TOLERANCE_PX) {\n\t\t\tsetIsAtLatest(true);\n\t\t\treturn;\n\t\t}\n\t\tif (scrolledUp) {\n\t\t\tsetIsAtLatest(false);\n\t\t}\n\t};\n\n\tconst handleJumpToLatest = () => {\n\t\tsetIsAtLatest(true);\n\t\tbottomRef.current?.scrollIntoView({ behavior: 'smooth' });\n\t};\n\n\tuseEffect(\n\t\t() => () => {\n\t\t\tif (copiedTimeoutRef.current) {\n\t\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tconst handleCopyMessage = async (\n\t\tmessage: CopilotPanelProps['messages'][number],\n\t) => {\n\t\t// The raw markdown, not the rendered HTML — that is what a reader wants to\n\t\t// paste into a doc or a ticket.\n\t\tconst copied = await writeToClipboard(message.content);\n\t\tif (!copied) {\n\t\t\treturn;\n\t\t}\n\t\tif (copiedTimeoutRef.current) {\n\t\t\twindow.clearTimeout(copiedTimeoutRef.current);\n\t\t}\n\t\tsetCopiedMessageId(message.id);\n\t\tcopiedTimeoutRef.current = window.setTimeout(\n\t\t\t() => setCopiedMessageId(null),\n\t\t\tCOPIED_FEEDBACK_MS,\n\t\t);\n\t};\n\n\tconst handleFeedback = (messageId: string, vote: 'like' | 'dislike') => {\n\t\t// Pressing the same thumb again clears the vote. Nothing is reported for\n\t\t// that: the backend records ratings, not their absence.\n\t\tconst cleared = feedback[messageId] === vote;\n\t\tsetFeedback((previous) => ({\n\t\t\t...previous,\n\t\t\t[messageId]: previous[messageId] === vote ? undefined : vote,\n\t\t}));\n\t\t// Everything below sits outside the updater on purpose: React may run an\n\t\t// updater twice, which would report the same vote twice.\n\t\tif (cleared) {\n\t\t\tif (vote === 'dislike') {\n\t\t\t\tsetDislikePromptId((current) =>\n\t\t\t\t\tcurrent === messageId ? null : current,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (vote === 'like') {\n\t\t\tonFeedback?.(messageId, 'like');\n\t\t\treturn;\n\t\t}\n\t\t// A thumbs-down asks what went wrong first. Moving the prompt to another\n\t\t// reply still records the one it is leaving.\n\t\tif (dislikePromptId && dislikePromptId !== messageId) {\n\t\t\tonFeedback?.(dislikePromptId, 'dislike');\n\t\t}\n\t\tsetDislikePromptId(messageId);\n\t};\n\n\tconst reportDislike = (messageId: string, detail?: CopilotFeedbackDetail) => {\n\t\tsetDislikePromptId((current) => (current === messageId ? null : current));\n\t\tonFeedback?.(messageId, 'dislike', detail);\n\t};\n\n\tconst handleRegenerate = () => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonRegenerate?.();\n\t};\n\n\tconst handleSend = () => {\n\t\tconst trimmed = input.trim();\n\t\tif ((!trimmed && !attachment) || inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\t// The endpoint has no context field, so a quoted selection has to ride\n\t\t// inside the prompt itself.\n\t\tonSend(\n\t\t\tattachment ? buildCopilotSelectionPrompt(attachment, trimmed) : trimmed,\n\t\t);\n\t\tsetInput('');\n\t\t// The quote belongs to the turn that used it; the next question starts\n\t\t// clean unless the merchant selects something again.\n\t\tonAttachmentRemove?.();\n\t\tconst textarea = inputRef.current;\n\t\tif (textarea) {\n\t\t\ttextarea.style.height = 'auto';\n\t\t}\n\t};\n\n\t// A selection is attached so the merchant can ask about it, so the caret\n\t// should already be waiting for the question.\n\tuseEffect(() => {\n\t\tif (attachment) {\n\t\t\tinputRef.current?.focus();\n\t\t}\n\t}, [attachment]);\n\n\tconst handleInputChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n\t\tsetInput(event.target.value);\n\t\tconst textarea = event.target;\n\t\ttextarea.style.height = 'auto';\n\t\ttextarea.style.height = `${Math.min(\n\t\t\ttextarea.scrollHeight,\n\t\t\tMAX_INPUT_HEIGHT_PX,\n\t\t)}px`;\n\t};\n\n\tconst handleKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {\n\t\tif (event.key === 'Enter' && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSend();\n\t\t}\n\t};\n\n\tconst handleSuggestionClick = (\n\t\tsuggestion: NonNullable<CopilotPanelProps['suggestions']>[number],\n\t) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSuggestionClick?.(suggestion);\n\t\tonSend(suggestion.text);\n\t};\n\n\tconst handleFollowUpClick = (followUp: string) => {\n\t\tif (inputDisabled || isTurnInFlight) {\n\t\t\treturn;\n\t\t}\n\t\tonSend(followUp);\n\t};\n\n\treturn (\n\t\t<PanelContainer\n\t\t\tclassName={className}\n\t\t\tstyle={{ width, height, ...style }}\n\t\t\trole=\"dialog\"\n\t\t\taria-label={title}\n\t\t>\n\t\t\t<PanelHeader>\n\t\t\t\t<HeaderAvatar>\n\t\t\t\t\t{avatar ?? <AiStarsIcon width={18} height={18} />}\n\t\t\t\t</HeaderAvatar>\n\t\t\t\t<HeaderText>\n\t\t\t\t\t<HeaderTitleRow>\n\t\t\t\t\t\t<TitleSmall>{title}</TitleSmall>\n\t\t\t\t\t\t{badge && <HeaderBadge>{badge}</HeaderBadge>}\n\t\t\t\t\t</HeaderTitleRow>\n\t\t\t\t\t{subtitle && (\n\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t)}\n\t\t\t\t</HeaderText>\n\t\t\t\t<HeaderActions>\n\t\t\t\t\t{showRefresh && onRefresh && (\n\t\t\t\t\t\t<IconAction\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={onRefresh}\n\t\t\t\t\t\t\taria-label=\"Start a new conversation\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RefreshIcon width={16} height={16} />\n\t\t\t\t\t\t</IconAction>\n\t\t\t\t\t)}\n\t\t\t\t\t<IconAction\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={onClose}\n\t\t\t\t\t\taria-label=\"Close copilot\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CrossIcon width={18} height={18} />\n\t\t\t\t\t</IconAction>\n\t\t\t\t</HeaderActions>\n\t\t\t</PanelHeader>\n\n\t\t\t<MessagesViewport>\n\t\t\t\t<MessagesArea\n\t\t\t\t\tref={scrollerRef}\n\t\t\t\t\tonScroll={handleScroll}\n\t\t\t\t\trole=\"region\"\n\t\t\t\t\taria-label=\"Conversation\"\n\t\t\t\t>\n\t\t\t\t\t{isEmpty ? (\n\t\t\t\t\t\t<EmptyState>\n\t\t\t\t\t\t\t<EmptyStateIcon>\n\t\t\t\t\t\t\t\t<AiStarsIcon width={28} height={28} />\n\t\t\t\t\t\t\t</EmptyStateIcon>\n\t\t\t\t\t\t\t<BodySecondary style={{ fontWeight: 600 }}>\n\t\t\t\t\t\t\t\t{emptyStateTitle || title}\n\t\t\t\t\t\t\t</BodySecondary>\n\t\t\t\t\t\t\t{emptyStateSubtitle && (\n\t\t\t\t\t\t\t\t<BodyCaption color={COLORS.content.secondary}>\n\t\t\t\t\t\t\t\t\t{emptyStateSubtitle}\n\t\t\t\t\t\t\t\t</BodyCaption>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{suggestions && suggestions.length > 0 && (\n\t\t\t\t\t\t\t\t<SuggestionList>\n\t\t\t\t\t\t\t\t\t{suggestions.map((suggestion) => (\n\t\t\t\t\t\t\t\t\t\t<SuggestionChip\n\t\t\t\t\t\t\t\t\t\t\tkey={suggestion.id}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled || isTurnInFlight}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleSuggestionClick(suggestion)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<AiStarsIcon width={14} height={14} />\n\t\t\t\t\t\t\t\t\t\t\t{suggestion.text}\n\t\t\t\t\t\t\t\t\t\t</SuggestionChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</SuggestionList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</EmptyState>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{isLoadingHistory && (\n\t\t\t\t\t\t\t\t<HistoryLoader role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.content.placeholder} size={4} />\n\t\t\t\t\t\t\t\t\t{historyLoadingLabel}\n\t\t\t\t\t\t\t\t</HistoryLoader>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{visibleMessages.map((message) => {\n\t\t\t\t\t\t\t\tconst sentAt =\n\t\t\t\t\t\t\t\t\tmessage.role === 'user'\n\t\t\t\t\t\t\t\t\t\t? formatMessageTime(message.timestamp)\n\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<React.Fragment key={message.id}>\n\t\t\t\t\t\t\t\t\t\t{message.content.length > 0 && (\n\t\t\t\t\t\t\t\t\t\t\t<MessageBubble $role={message.role}>\n\t\t\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t__html: renderCopilotMarkdown(message.content),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div style={{ whiteSpace: 'pre-wrap' }}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{message.content}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</MessageBubble>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{/* Tool CTAs (e.g. the support-portal link) — only once the\n\t\t\t\t\t\t\t\t\t\t reply has finished, so a button cannot flash mid-stream. */}\n\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' &&\n\t\t\t\t\t\t\t\t\t\t\t!message.isStreaming &&\n\t\t\t\t\t\t\t\t\t\t\t(() => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst ctas = toolResultCtas(message.toolResults);\n\t\t\t\t\t\t\t\t\t\t\t\tif (ctas.length === 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ToolCtaList>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ctas.map((cta) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ToolCtaLink\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={`${cta.tool}-${cta.url}`}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thref={cta.url}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonToolCtaClick?.({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttool: cta.tool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: cta.url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{cta.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ToolCtaLink>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</ToolCtaList>\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t})()}\n\t\t\t\t\t\t\t\t\t\t{sentAt && <MessageTimestamp>{sentAt}</MessageTimestamp>}\n\t\t\t\t\t\t\t\t\t\t{message.wasInterrupted && interruptedLabel && (\n\t\t\t\t\t\t\t\t\t\t\t<InterruptedNote>\n\t\t\t\t\t\t\t\t\t\t\t\t<StopIcon size={12} />\n\t\t\t\t\t\t\t\t\t\t\t\t{interruptedLabel}\n\t\t\t\t\t\t\t\t\t\t\t</InterruptedNote>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{/* Only under a finished reply: mid-stream the text is still\n\t\t\t\t\t\t\t\t\t\t changing, so copying it would capture a partial answer. */}\n\t\t\t\t\t\t\t\t\t\t{message.role === 'assistant' &&\n\t\t\t\t\t\t\t\t\t\t\tmessage.content.length > 0 &&\n\t\t\t\t\t\t\t\t\t\t\t!message.isStreaming && (\n\t\t\t\t\t\t\t\t\t\t\t\t<MessageActions>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => void handleCopyMessage(message)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-copied={copiedMessageId === message.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id ? 'Copied' : 'Copy'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcopiedMessageId === message.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? 'Response copied to clipboard'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: 'Copy response'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{copiedMessageId === message.id ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CopyIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{/* Only under the newest reply: regenerating appends a\n\t\t\t\t\t\t\t\t\t\t\t\t\t fresh turn at the end, so offering it against an\n\t\t\t\t\t\t\t\t\t\t\t\t\t older answer would not replace that answer. */}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{onRegenerate && message.id === newestMessage?.id && (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={handleRegenerate}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled || isTurnInFlight}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Regenerate\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Regenerate response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<RegenerateIcon />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleFeedback(message.id, 'like')}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-selected={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Good response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Good response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ThumbUpIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfilled={feedback[message.id] === 'like'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MessageAction\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleFeedback(message.id, 'dislike')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-selected={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-pressed={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle=\"Bad response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label=\"Bad response\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ThumbDownIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfilled={feedback[message.id] === 'dislike'}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MessageAction>\n\t\t\t\t\t\t\t\t\t\t\t\t</MessageActions>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t{dislikePromptId === message.id && (\n\t\t\t\t\t\t\t\t\t\t\t<CopilotFeedbackModal\n\t\t\t\t\t\t\t\t\t\t\t\ttitle={dislikeTitle}\n\t\t\t\t\t\t\t\t\t\t\t\tsubtitle={dislikeSubtitle ?? `Help us improve ${title}`}\n\t\t\t\t\t\t\t\t\t\t\t\treasons={dislikeReasons}\n\t\t\t\t\t\t\t\t\t\t\t\tnotePlaceholder={dislikeNotePlaceholder}\n\t\t\t\t\t\t\t\t\t\t\t\tsubmitLabel={dislikeSubmitLabel}\n\t\t\t\t\t\t\t\t\t\t\t\tonSubmit={(detail) => reportDislike(message.id, detail)}\n\t\t\t\t\t\t\t\t\t\t\t\tonDismiss={() => reportDislike(message.id)}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</React.Fragment>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{followUps && followUps.length > 0 && (\n\t\t\t\t\t\t\t\t<FollowUpList>\n\t\t\t\t\t\t\t\t\t{followUpsLabel && (\n\t\t\t\t\t\t\t\t\t\t<FollowUpsLabel>{followUpsLabel}</FollowUpsLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t{followUps.map((followUp) => (\n\t\t\t\t\t\t\t\t\t\t<FollowUpChip\n\t\t\t\t\t\t\t\t\t\t\tkey={followUp}\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleFollowUpClick(followUp)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowRightIcon />\n\t\t\t\t\t\t\t\t\t\t\t{followUp}\n\t\t\t\t\t\t\t\t\t\t</FollowUpChip>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</FollowUpList>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{isThinking && (\n\t\t\t\t\t\t\t\t<ThinkingBubble role=\"status\" aria-live=\"polite\">\n\t\t\t\t\t\t\t\t\t<AiStarsIcon\n\t\t\t\t\t\t\t\t\t\twidth={14}\n\t\t\t\t\t\t\t\t\t\theight={14}\n\t\t\t\t\t\t\t\t\t\tcolor={COLORS.content.brand}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{thinkingLabel && (\n\t\t\t\t\t\t\t\t\t\t<ThinkingLabel>{thinkingLabel}</ThinkingLabel>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t<DotPulse color={COLORS.background.brand} size={5} />\n\t\t\t\t\t\t\t\t</ThinkingBubble>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<div ref={bottomRef} />\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</MessagesArea>\n\n\t\t\t\t<ScrollFade $visible={showScrollAffordance} aria-hidden=\"true\" />\n\t\t\t\t<JumpToLatestButton\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t$visible={showScrollAffordance}\n\t\t\t\t\tonClick={handleJumpToLatest}\n\t\t\t\t\ttabIndex={showScrollAffordance ? 0 : -1}\n\t\t\t\t\taria-label=\"Scroll to the latest message\"\n\t\t\t\t>\n\t\t\t\t\t<ArrowDownIcon width={16} height={16} />\n\t\t\t\t</JumpToLatestButton>\n\t\t\t</MessagesViewport>\n\n\t\t\t{errorMessage && <ErrorBanner role=\"alert\">{errorMessage}</ErrorBanner>}\n\n\t\t\t<InputArea>\n\t\t\t\t{attachment && (\n\t\t\t\t\t<AttachmentChip>\n\t\t\t\t\t\t<AiStarsIcon width={14} height={14} color={COLORS.content.brand} />\n\t\t\t\t\t\t<AttachmentText title={attachment}>{attachment}</AttachmentText>\n\t\t\t\t\t\t<AttachmentRemove\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tonClick={onAttachmentRemove}\n\t\t\t\t\t\t\taria-label=\"Remove the selected text\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CrossIcon width={12} height={12} />\n\t\t\t\t\t\t</AttachmentRemove>\n\t\t\t\t\t</AttachmentChip>\n\t\t\t\t)}\n\t\t\t\t<InputWrapper $focused={isInputFocused}>\n\t\t\t\t\t<MessageInput\n\t\t\t\t\t\tref={inputRef}\n\t\t\t\t\t\trows={1}\n\t\t\t\t\t\tvalue={input}\n\t\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\t\tdisabled={inputDisabled}\n\t\t\t\t\t\tonChange={handleInputChange}\n\t\t\t\t\t\tonKeyDown={handleKeyDown}\n\t\t\t\t\t\tonFocus={() => setIsInputFocused(true)}\n\t\t\t\t\t\tonBlur={() => setIsInputFocused(false)}\n\t\t\t\t\t/>\n\t\t\t\t\t<SendButton\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t$active={canStop || canSend}\n\t\t\t\t\t\tdisabled={!canStop && !canSend}\n\t\t\t\t\t\tonClick={canStop ? onStop : handleSend}\n\t\t\t\t\t\taria-label={canStop ? 'Stop generating' : 'Send message'}\n\t\t\t\t\t>\n\t\t\t\t\t\t{canStop ? <StopIcon /> : <SendArrowIcon />}\n\t\t\t\t\t</SendButton>\n\t\t\t\t</InputWrapper>\n\t\t\t</InputArea>\n\n\t\t\t{disclaimer && <Disclaimer>{disclaimer}</Disclaimer>}\n\t\t</PanelContainer>\n\t);\n};\n\nexport default CopilotPanel;\n"],"names":["MAX_INPUT_HEIGHT_PX","AT_BOTTOM_TOLERANCE_PX","COPIED_FEEDBACK_MS","writeToClipboard","text","textarea","copied","NEAR_TOP_TOLERANCE_PX","formatMessageTime","timestamp","date","SendArrowIcon","jsxs","jsx","ArrowRightIcon","StopIcon","size","CopyIcon","CheckIcon","RegenerateIcon","ThumbUpIcon","filled","ThumbDownIcon","CopilotPanel","messages","onSend","onClose","title","badge","subtitle","avatar","placeholder","disclaimer","emptyStateTitle","emptyStateSubtitle","suggestions","onSuggestionClick","showRefresh","onRefresh","onRegenerate","onFeedback","dislikeTitle","dislikeSubtitle","dislikeReasons","dislikeNotePlaceholder","dislikeSubmitLabel","isThinking","thinkingLabel","isStreaming","onStop","interruptedLabel","followUpsLabel","onToolCtaClick","hasMoreHistory","isLoadingHistory","onLoadOlderMessages","historyLoadingLabel","inputDisabled","attachment","onAttachmentRemove","errorMessage","width","height","className","style","input","setInput","useState","isInputFocused","setIsInputFocused","isAtLatest","setIsAtLatest","copiedMessageId","setCopiedMessageId","feedback","setFeedback","dislikePromptId","setDislikePromptId","inputRef","useRef","copiedTimeoutRef","bottomRef","scrollerRef","lastScrollTopRef","anchorFromBottomRef","visibleMessages","message","isCopilotRegeneratePrompt","isEmpty","isTurnInFlight","canSend","canStop","newestMessage","followUps","showScrollAffordance","useEffect","scroller","anchor","handleScroll","distanceFromBottom","scrolledUp","handleJumpToLatest","handleCopyMessage","handleFeedback","messageId","vote","cleared","previous","current","reportDislike","detail","handleRegenerate","handleSend","trimmed","buildCopilotSelectionPrompt","handleInputChange","event","handleKeyDown","handleSuggestionClick","suggestion","handleFollowUpClick","followUp","PanelContainer","PanelHeader","HeaderAvatar","AiStarsIcon","HeaderText","HeaderTitleRow","TitleSmall","HeaderBadge","BodyCaption","COLORS","HeaderActions","IconAction","RefreshIcon","CrossIcon","MessagesViewport","MessagesArea","EmptyState","EmptyStateIcon","BodySecondary","SuggestionList","SuggestionChip","Fragment","HistoryLoader","DotPulse","sentAt","React","MessageBubble","renderCopilotMarkdown","ctas","toolResultCtas","ToolCtaList","cta","ToolCtaLink","MessageTimestamp","InterruptedNote","MessageActions","MessageAction","CopilotFeedbackModal","FollowUpList","FollowUpsLabel","FollowUpChip","ThinkingBubble","ThinkingLabel","ScrollFade","JumpToLatestButton","ArrowDownIcon","ErrorBanner","InputArea","AttachmentChip","AttachmentText","AttachmentRemove","InputWrapper","MessageInput","SendButton","Disclaimer"],"mappings":";;;;;;;;;;;;;;;AAuDA,MAAMA,KAAsB,IAGtBC,KAAyB,IAGzBC,KAAqB,MASrBC,KAAmB,OAAOC,MAAmC;AAClE,MAAI;AACH,QAAI,UAAU,WAAW;AACxB,mBAAM,UAAU,UAAU,UAAUA,CAAI,GACjC;AAAA,EAET,QAAQ;AAAA,EAER;AAEA,MAAI;AACH,UAAMC,IAAW,SAAS,cAAc,UAAU;AAClD,IAAAA,EAAS,QAAQD,GAEjBC,EAAS,aAAa,YAAY,EAAE,GACpCA,EAAS,MAAM,WAAW,SAC1BA,EAAS,MAAM,MAAM,WACrBA,EAAS,MAAM,UAAU,KACzB,SAAS,KAAK,YAAYA,CAAQ,GAClCA,EAAS,OAAA;AACT,UAAMC,IAAS,SAAS,YAAY,MAAM;AAC1C,oBAAS,KAAK,YAAYD,CAAQ,GAC3BC;AAAA,EACR,QAAQ;AACP,WAAO;AAAA,EACR;AACD,GAGMC,KAAwB,IAExBC,KAAoB,CAACC,MAA8B;AACxD,MAAI,CAACA,KAAa,CAAC,OAAO,SAASA,CAAS;AAC3C,WAAO;AAER,QAAMC,IAAO,IAAI,KAAKD,CAAS;AAC/B,SAAI,OAAO,MAAMC,EAAK,QAAA,CAAS,IACvB,KAEDA,EAAK,mBAAmB,SAAS;AAAA,IACvC,MAAM;AAAA,IACN,QAAQ;AAAA,EAAA,CACR;AACF,GAEMC,KAAgB,MACrB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,SAAQ;AAAA,IACR,OAAM;AAAA,IACN,QAAO;AAAA,IACP,MAAK;AAAA,IACL,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,eAAc;AAAA,IACd,gB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GAAa,UAAAA,GAAW;AAAA,YAC/C,gBAAA7C;AAAA,cAAC+J;AAAA,cAAA;AAAA,gBACA,MAAK;AAAA,gBACL,SAASjH;AAAA,gBACT,cAAW;AAAA,gBAEX,UAAA,gBAAA9C,EAAC0H,IAAA,EAAU,OAAO,IAAI,QAAQ,GAAA,CAAI;AAAA,cAAA;AAAA,YAAA;AAAA,UACnC,GACD;AAAA,UAED,gBAAA3H,EAACiK,IAAA,EAAa,UAAUzG,IACvB,UAAA;AAAA,YAAA,gBAAAvD;AAAA,cAACiK;AAAA,cAAA;AAAA,gBACA,KAAKhG;AAAA,gBACL,MAAM;AAAA,gBACN,OAAOb;AAAA,gBACP,aAAAlC;AAAA,gBACA,UAAU0B;AAAA,gBACV,UAAU0D;AAAA,gBACV,WAAWE;AAAA,gBACX,SAAS,MAAMhD,GAAkB,EAAI;AAAA,gBACrC,QAAQ,MAAMA,GAAkB,EAAK;AAAA,cAAA;AAAA,YAAA;AAAA,YAEtC,gBAAAxD;AAAA,cAACkK;AAAA,cAAA;AAAA,gBACA,MAAK;AAAA,gBACL,SAASpF,KAAWD;AAAA,gBACpB,UAAU,CAACC,KAAW,CAACD;AAAA,gBACvB,SAASC,IAAU1C,IAAS+D;AAAA,gBAC5B,cAAYrB,IAAU,oBAAoB;AAAA,gBAEzC,UAAAA,IAAU,gBAAA9E,EAACE,IAAA,CAAA,CAAS,sBAAMJ,IAAA,CAAA,CAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAC1C,EAAA,CACD;AAAA,QAAA,GACD;AAAA,QAECqB,KAAc,gBAAAnB,EAACmK,IAAA,EAAY,UAAAhJ,EAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1C;"}
|
|
@@ -57,6 +57,14 @@ export declare const MessageAction: import('styled-components').StyledComponent<
|
|
|
57
57
|
export declare const ThinkingLabel: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
58
58
|
export declare const ErrorBanner: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
59
59
|
export declare const InputArea: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
60
|
+
/**
|
|
61
|
+
* The quoted selection above the input. Deliberately outside `InputWrapper` so
|
|
62
|
+
* it does not grow the field's focus ring, and truncated rather than wrapped —
|
|
63
|
+
* a long quote must not push the input off the panel.
|
|
64
|
+
*/
|
|
65
|
+
export declare const AttachmentChip: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
66
|
+
export declare const AttachmentText: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
67
|
+
export declare const AttachmentRemove: import('styled-components').StyledComponent<"button", any, {}, never>;
|
|
60
68
|
export declare const InputWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
61
69
|
$focused: boolean;
|
|
62
70
|
}, never>;
|
|
@@ -154,7 +154,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
154
154
|
outline: 2px solid ${e.stroke.brand};
|
|
155
155
|
outline-offset: 1px;
|
|
156
156
|
}
|
|
157
|
-
`,
|
|
157
|
+
`, y = n.div`
|
|
158
158
|
flex: 1;
|
|
159
159
|
display: flex;
|
|
160
160
|
flex-direction: column;
|
|
@@ -163,7 +163,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
163
163
|
gap: 8px;
|
|
164
164
|
text-align: center;
|
|
165
165
|
padding: 8px 4px;
|
|
166
|
-
`,
|
|
166
|
+
`, $ = n.div`
|
|
167
167
|
color: ${e.content.brand};
|
|
168
168
|
display: flex;
|
|
169
169
|
align-items: center;
|
|
@@ -286,7 +286,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
286
286
|
border-bottom-left-radius: 4px;
|
|
287
287
|
background: ${e.surface.grey};
|
|
288
288
|
border: 1px solid ${e.stroke.primary};
|
|
289
|
-
`,
|
|
289
|
+
`, A = n.div`
|
|
290
290
|
align-self: center;
|
|
291
291
|
display: inline-flex;
|
|
292
292
|
align-items: center;
|
|
@@ -296,7 +296,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
296
296
|
font-size: 11px;
|
|
297
297
|
line-height: 16px;
|
|
298
298
|
color: ${e.content.placeholder};
|
|
299
|
-
`,
|
|
299
|
+
`, L = n.div`
|
|
300
300
|
display: flex;
|
|
301
301
|
flex-direction: column;
|
|
302
302
|
align-items: stretch;
|
|
@@ -307,12 +307,12 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
307
307
|
font-size: 11px;
|
|
308
308
|
line-height: 16px;
|
|
309
309
|
color: ${e.content.placeholder};
|
|
310
|
-
`,
|
|
310
|
+
`, C = n.div`
|
|
311
311
|
display: flex;
|
|
312
312
|
flex-wrap: wrap;
|
|
313
313
|
gap: 8px;
|
|
314
314
|
margin-top: 8px;
|
|
315
|
-
`,
|
|
315
|
+
`, M = n.a`
|
|
316
316
|
display: inline-flex;
|
|
317
317
|
align-items: center;
|
|
318
318
|
gap: 6px;
|
|
@@ -337,7 +337,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
337
337
|
outline: 2px solid ${e.stroke.brand};
|
|
338
338
|
outline-offset: 2px;
|
|
339
339
|
}
|
|
340
|
-
`,
|
|
340
|
+
`, B = n.button`
|
|
341
341
|
display: flex;
|
|
342
342
|
align-items: center;
|
|
343
343
|
gap: 8px;
|
|
@@ -382,14 +382,14 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
382
382
|
flex-shrink: 0;
|
|
383
383
|
color: ${e.content.inactive};
|
|
384
384
|
}
|
|
385
|
-
`,
|
|
385
|
+
`, T = n.div`
|
|
386
386
|
align-self: flex-end;
|
|
387
387
|
margin-top: -6px;
|
|
388
388
|
font-family: Inter;
|
|
389
389
|
font-size: 11px;
|
|
390
390
|
line-height: 16px;
|
|
391
391
|
color: ${e.content.placeholder};
|
|
392
|
-
`,
|
|
392
|
+
`, E = n.div`
|
|
393
393
|
align-self: flex-start;
|
|
394
394
|
display: flex;
|
|
395
395
|
align-items: center;
|
|
@@ -464,6 +464,47 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
464
464
|
padding: 16px 16px 4px;
|
|
465
465
|
flex-shrink: 0;
|
|
466
466
|
`, U = n.div`
|
|
467
|
+
box-sizing: border-box;
|
|
468
|
+
display: flex;
|
|
469
|
+
align-items: center;
|
|
470
|
+
gap: 6px;
|
|
471
|
+
margin-bottom: 8px;
|
|
472
|
+
padding: 6px 8px;
|
|
473
|
+
border: 1px solid ${e.stroke.primary};
|
|
474
|
+
border-radius: 8px;
|
|
475
|
+
background: ${e.background.brandVeryLight};
|
|
476
|
+
|
|
477
|
+
svg {
|
|
478
|
+
flex-shrink: 0;
|
|
479
|
+
}
|
|
480
|
+
`, G = n.span`
|
|
481
|
+
flex: 1;
|
|
482
|
+
min-width: 0;
|
|
483
|
+
overflow: hidden;
|
|
484
|
+
white-space: nowrap;
|
|
485
|
+
text-overflow: ellipsis;
|
|
486
|
+
font-family: Inter;
|
|
487
|
+
font-size: 12px;
|
|
488
|
+
line-height: 16px;
|
|
489
|
+
color: ${e.content.primary};
|
|
490
|
+
`, R = n.button`
|
|
491
|
+
display: flex;
|
|
492
|
+
align-items: center;
|
|
493
|
+
justify-content: center;
|
|
494
|
+
flex-shrink: 0;
|
|
495
|
+
width: 16px;
|
|
496
|
+
height: 16px;
|
|
497
|
+
padding: 0;
|
|
498
|
+
border: none;
|
|
499
|
+
border-radius: 4px;
|
|
500
|
+
background: transparent;
|
|
501
|
+
color: ${e.content.secondary};
|
|
502
|
+
cursor: pointer;
|
|
503
|
+
|
|
504
|
+
&:hover {
|
|
505
|
+
background: ${e.background.brandLight};
|
|
506
|
+
}
|
|
507
|
+
`, V = n.div`
|
|
467
508
|
box-sizing: border-box;
|
|
468
509
|
min-height: 48px;
|
|
469
510
|
display: flex;
|
|
@@ -480,7 +521,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
480
521
|
box-shadow: inset 0 0 0 1px
|
|
481
522
|
${(o) => o.$focused ? e.stroke.brand : e.content.inactive};
|
|
482
523
|
}
|
|
483
|
-
`,
|
|
524
|
+
`, O = n.textarea`
|
|
484
525
|
flex: 1;
|
|
485
526
|
border: none;
|
|
486
527
|
outline: none;
|
|
@@ -501,7 +542,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
501
542
|
&:disabled {
|
|
502
543
|
cursor: not-allowed;
|
|
503
544
|
}
|
|
504
|
-
`,
|
|
545
|
+
`, N = n.button`
|
|
505
546
|
width: 24px;
|
|
506
547
|
height: 24px;
|
|
507
548
|
flex-shrink: 0;
|
|
@@ -524,7 +565,7 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
524
565
|
outline: 2px solid ${e.stroke.brand};
|
|
525
566
|
outline-offset: 1px;
|
|
526
567
|
}
|
|
527
|
-
`,
|
|
568
|
+
`, X = n.div`
|
|
528
569
|
padding: 4px 16px 16px;
|
|
529
570
|
text-align: center;
|
|
530
571
|
font-family: Inter;
|
|
@@ -534,40 +575,43 @@ const r = "#F9F9F9", t = 12, i = 8, d = n.div`
|
|
|
534
575
|
flex-shrink: 0;
|
|
535
576
|
`;
|
|
536
577
|
export {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
578
|
+
U as AttachmentChip,
|
|
579
|
+
R as AttachmentRemove,
|
|
580
|
+
G as AttachmentText,
|
|
581
|
+
X as Disclaimer,
|
|
582
|
+
y as EmptyState,
|
|
583
|
+
$ as EmptyStateIcon,
|
|
540
584
|
P as ErrorBanner,
|
|
541
|
-
|
|
542
|
-
|
|
585
|
+
B as FollowUpChip,
|
|
586
|
+
L as FollowUpList,
|
|
543
587
|
S as FollowUpsLabel,
|
|
544
588
|
b as HeaderActions,
|
|
545
589
|
p as HeaderAvatar,
|
|
546
590
|
g as HeaderBadge,
|
|
547
591
|
c as HeaderText,
|
|
548
592
|
x as HeaderTitleRow,
|
|
549
|
-
|
|
593
|
+
A as HistoryLoader,
|
|
550
594
|
f as IconAction,
|
|
551
595
|
_ as InputArea,
|
|
552
|
-
|
|
596
|
+
V as InputWrapper,
|
|
553
597
|
H as InterruptedNote,
|
|
554
598
|
k as JumpToLatestButton,
|
|
555
599
|
j as MessageAction,
|
|
556
|
-
|
|
600
|
+
E as MessageActions,
|
|
557
601
|
I as MessageBubble,
|
|
558
|
-
|
|
559
|
-
|
|
602
|
+
O as MessageInput,
|
|
603
|
+
T as MessageTimestamp,
|
|
560
604
|
h as MessagesArea,
|
|
561
605
|
u as MessagesViewport,
|
|
562
606
|
d as PanelContainer,
|
|
563
607
|
l as PanelHeader,
|
|
564
608
|
m as ScrollFade,
|
|
565
|
-
|
|
609
|
+
N as SendButton,
|
|
566
610
|
w as SuggestionChip,
|
|
567
611
|
v as SuggestionList,
|
|
568
612
|
z as ThinkingBubble,
|
|
569
613
|
F as ThinkingLabel,
|
|
570
|
-
|
|
571
|
-
|
|
614
|
+
M as ToolCtaLink,
|
|
615
|
+
C as ToolCtaList
|
|
572
616
|
};
|
|
573
617
|
//# sourceMappingURL=CopilotPanel.styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopilotPanel.styled.js","sources":["../../../../src/components/bik-copilot/CopilotPanel.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nconst USER_BUBBLE_BACKGROUND = '#F9F9F9';\n\nconst MESSAGE_GAP_PX = 12;\n\nconst MESSAGE_ACTIONS_GAP_PX = 8;\n\nexport const PanelContainer = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 0;\n\toverflow: hidden;\n\tbackground: ${COLORS.surface.standard};\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 16px;\n\tbox-shadow: 0 16px 48px rgba(40, 3, 78, 0.18);\n`;\n\nexport const PanelHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 16px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n\tflex-shrink: 0;\n`;\n\nexport const HeaderAvatar = styled.div`\n\twidth: 36px;\n\theight: 36px;\n\tflex-shrink: 0;\n\tborder-radius: 8px;\n\tbackground: ${COLORS.background.base};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcolor: ${COLORS.content.brand};\n\toverflow: hidden;\n`;\n\nexport const HeaderText = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n\tflex: 1;\n`;\n\nexport const HeaderTitleRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n`;\n\nexport const HeaderBadge = styled.span`\n\tpadding: 1px 6px;\n\tborder-radius: 4px;\n\tbackground: ${COLORS.background.brandLight};\n\tcolor: ${COLORS.content.brand};\n\tfont-size: 10px;\n\tfont-weight: 600;\n\tline-height: 16px;\n\twhite-space: nowrap;\n`;\n\nexport const HeaderActions = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n\tflex-shrink: 0;\n`;\n\nexport const IconAction = styled.button`\n\twidth: 28px;\n\theight: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 6px;\n\tbackground: transparent;\n\tcolor: ${COLORS.content.secondary};\n\tcursor: pointer;\n\ttransition: background 0.15s ease, color 0.15s ease;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.hovered};\n\t\tcolor: ${COLORS.content.primary};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n`;\n\n/**\n * Wraps the scroller so the bottom fade and the jump-to-latest button can be\n * absolutely positioned over it.\n */\nexport const MessagesViewport = styled.div`\n\tposition: relative;\n\tflex: 1;\n\tmin-height: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nexport const MessagesArea = styled.div`\n\tflex: 1;\n\tmin-height: 0;\n\toverflow-y: auto;\n\tpadding: 16px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: ${MESSAGE_GAP_PX}px;\n\n\t&::-webkit-scrollbar {\n\t\twidth: 6px;\n\t}\n\n\t&::-webkit-scrollbar-thumb {\n\t\tbackground: ${COLORS.background.inactive};\n\t\tborder-radius: 3px;\n\t}\n`;\n\n/**\n * Softens the cut-off edge of a long answer the reader has scrolled up from, so\n * the clipped line reads as continuing rather than as the end of the message.\n *\n * Two layers, because one element cannot ramp a gradient and a blur\n * independently: the element itself whitens the text out, and `::after` lays a\n * masked blur over it that strengthens towards the bottom. Browsers without\n * `backdrop-filter` still get the fade.\n */\nexport const ScrollFade = styled.div<{ $visible: boolean }>`\n\tposition: absolute;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\theight: 40px;\n\tpointer-events: none;\n\topacity: ${(props) => (props.$visible ? 1 : 0)};\n\ttransition: opacity 0.2s ease;\n\tbackground: linear-gradient(\n\t\tto bottom,\n\t\t${COLORS.surface.standard}00 0%,\n\t\t${COLORS.surface.standard}99 60%,\n\t\t${COLORS.surface.standard} 100%\n\t);\n\n\t&::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tinset: 0;\n\t\tbackdrop-filter: blur(1px);\n\t\t-webkit-backdrop-filter: blur(1px);\n\t\tmask-image: linear-gradient(to bottom, transparent 0%, #000 75%);\n\t\t-webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 75%);\n\t}\n`;\n\nexport const JumpToLatestButton = styled.button<{ $visible: boolean }>`\n\tposition: absolute;\n\tleft: 50%;\n\tbottom: 12px;\n\ttransform: translateX(-50%)\n\t\ttranslateY(${(props) => (props.$visible ? '0' : '6px')});\n\twidth: 32px;\n\theight: 32px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 999px;\n\tbackground: ${COLORS.background.inverse};\n\tcolor: ${COLORS.content.primaryInverse};\n\tbox-shadow: 0 2px 8px rgba(40, 3, 78, 0.16);\n\tcursor: pointer;\n\topacity: ${(props) => (props.$visible ? 1 : 0)};\n\t/* Hidden to the pointer and to focus order while it is faded out. */\n\tvisibility: ${(props) => (props.$visible ? 'visible' : 'hidden')};\n\ttransition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease,\n\t\tbackground 0.15s ease, color 0.15s ease;\n\n\t&:hover {\n\t\tbackground: ${COLORS.background.brandHovered};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n`;\n\nexport const EmptyState = styled.div`\n\tflex: 1;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\ttext-align: center;\n\tpadding: 8px 4px;\n`;\n\nexport const EmptyStateIcon = styled.div`\n\tcolor: ${COLORS.content.brand};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-bottom: 4px;\n`;\n\nexport const SuggestionList = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 8px;\n\tmargin-top: 12px;\n\twidth: 100%;\n`;\n\nexport const SuggestionChip = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tmax-width: 100%;\n\tpadding: 8px 14px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 999px;\n\tbackground: ${COLORS.surface.standard};\n\tcolor: ${COLORS.content.primary};\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 18px;\n\ttext-align: left;\n\tcursor: pointer;\n\ttransition: border-color 0.15s ease, background 0.15s ease;\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tborder-color: ${COLORS.stroke.brand};\n\t\tbackground: ${COLORS.background.brandVeryLight};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t}\n`;\n\nexport const MessageBubble = styled.div<{\n\t$role: 'user' | 'assistant' | 'system';\n}>`\n\tfont-family: Inter;\n\tfont-size: 14px;\n\tline-height: 20px;\n\tword-break: break-word;\n\toverflow-wrap: break-word;\n\n\t${(props) => {\n\t\tif (props.$role === 'user') {\n\t\t\treturn `\n\t\t\t\talign-self: flex-end;\n\t\t\t\tmargin-left: 32px;\n\t\t\t\tpadding: 10px 14px;\n\t\t\t\tborder-radius: 12px;\n\t\t\t\tbackground: ${USER_BUBBLE_BACKGROUND};\n\t\t\t\tcolor: ${COLORS.content.primary};\n\t\t\t`;\n\t\t}\n\t\tif (props.$role === 'system') {\n\t\t\treturn `\n\t\t\t\talign-self: center;\n\t\t\t\tmax-width: 90%;\n\t\t\t\tpadding: 6px 10px;\n\t\t\t\tborder-radius: 8px;\n\t\t\t\tbackground: ${COLORS.surface.grey};\n\t\t\t\tcolor: ${COLORS.content.secondary};\n\t\t\t\tfont-size: 12px;\n\t\t\t\ttext-align: center;\n\t\t\t`;\n\t\t}\n\t\treturn `\n\t\t\talign-self: stretch;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tcolor: ${COLORS.content.primary};\n\t\t`;\n\t}}\n\n\t/* Markdown emitted by renderCopilotMarkdown */\n\th1,\n\th2,\n\th3,\n\th4 {\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tmargin: 4px 0;\n\t}\n\n\tpre {\n\t\tbackground: ${COLORS.background.base};\n\t\tborder-radius: 6px;\n\t\tpadding: 8px;\n\t\tmargin: 6px 0;\n\t\toverflow-x: auto;\n\t\tfont-size: 12px;\n\t}\n\n\ta {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\n\tul,\n\tol {\n\t\tmargin: 4px 0;\n\t\tpadding-left: 20px;\n\t}\n\n\tli {\n\t\tmargin: 2px 0;\n\t}\n\n\tcode {\n\t\tbackground: ${COLORS.background.base};\n\t\tborder-radius: 4px;\n\t\tpadding: 1px 4px;\n\t\tfont-size: 12px;\n\t}\n`;\n\nexport const ThinkingBubble = styled.div`\n\talign-self: flex-start;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 12px 14px;\n\tborder-radius: 12px;\n\tborder-bottom-left-radius: 4px;\n\tbackground: ${COLORS.surface.grey};\n\tborder: 1px solid ${COLORS.stroke.primary};\n`;\n\n/** Sits above the oldest message while the page before it is fetched. */\nexport const HistoryLoader = styled.div`\n\talign-self: center;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 4px 0;\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n`;\n\nexport const FollowUpList = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: stretch;\n\tgap: 8px;\n\tmargin-top: 4px;\n`;\n\nexport const FollowUpsLabel = styled.div`\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n`;\n\nexport const ToolCtaList = styled.div`\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tmargin-top: 8px;\n`;\n\n// An anchor rather than a button: a real link so the browser handles the new\n// tab, middle-click and copy-link-address the way merchants expect.\nexport const ToolCtaLink = styled.a`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 8px 14px;\n\tborder: 1px solid ${COLORS.stroke.brand};\n\tborder-radius: 10px;\n\tbackground: ${COLORS.background.brandVeryLight};\n\tcolor: ${COLORS.content.brand};\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tfont-weight: 500;\n\tline-height: 18px;\n\ttext-decoration: none;\n\tcursor: pointer;\n\ttransition: background 0.15s ease, border-color 0.15s ease;\n\n\t&:hover {\n\t\tbackground: ${COLORS.background.brandLight};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 2px;\n\t}\n`;\n\nexport const FollowUpChip = styled.button`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 10px 14px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 10px;\n\tbackground: ${COLORS.surface.standard};\n\tcolor: ${COLORS.content.primary};\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 18px;\n\ttext-align: left;\n\tcursor: pointer;\n\ttransition: border-color 0.15s ease, background 0.15s ease;\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t\tcolor: ${COLORS.content.secondary};\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tborder-color: ${COLORS.stroke.brand};\n\t\tbackground: ${COLORS.background.brandVeryLight};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t}\n`;\n\n/**\n * Bubble-less on purpose: a stopped reply is a note about the transcript, not a\n * message in it.\n */\nexport const InterruptedNote = styled.div`\n\talign-self: flex-start;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-family: Inter;\n\tfont-size: 12px;\n\tline-height: 18px;\n\tcolor: ${COLORS.content.secondary};\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t\tcolor: ${COLORS.content.inactive};\n\t}\n`;\n\nexport const MessageTimestamp = styled.div`\n\talign-self: flex-end;\n\tmargin-top: -6px;\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n`;\n\n/**\n * Actions under a finished assistant reply. Kept low-contrast so a row of icons\n * under every message does not compete with the answer itself.\n */\nexport const MessageActions = styled.div`\n\talign-self: flex-start;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n\t/* Pulls back out of the scroller's row gap to land on 8px. */\n\tmargin-top: ${MESSAGE_ACTIONS_GAP_PX - MESSAGE_GAP_PX}px;\n`;\n\nexport const MessageAction = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 4px;\n\twidth: 28px;\n\theight: 28px;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: ${COLORS.content.placeholder};\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcursor: pointer;\n\ttransition: background 0.15s ease, color 0.15s ease;\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tbackground: ${COLORS.surface.hovered};\n\t\tcolor: ${COLORS.content.secondary};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t}\n\n\t/* Confirmation reads as success, not as another affordance. */\n\t&[data-copied='true'],\n\t&[data-copied='true']:hover {\n\t\tcolor: ${COLORS.content.positive};\n\t}\n\n\t/* A cast vote holds the brand colour, so it stays legible as chosen once the\n\t pointer moves away. */\n\t&[data-selected='true'],\n\t&[data-selected='true']:hover {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n`;\n\nexport const ThinkingLabel = styled.span`\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 20px;\n\tcolor: ${COLORS.content.secondary};\n`;\n\nexport const ErrorBanner = styled.div`\n\tmargin: 0 16px;\n\tpadding: 8px 10px;\n\tborder-radius: 8px;\n\tbackground: ${COLORS.background.negative.light};\n\tcolor: ${COLORS.content.negative};\n\tfont-family: Inter;\n\tfont-size: 12px;\n\tline-height: 18px;\n\tflex-shrink: 0;\n`;\n\nexport const InputArea = styled.div`\n\tpadding: 16px 16px 4px;\n\tflex-shrink: 0;\n`;\n\nexport const InputWrapper = styled.div<{ $focused: boolean }>`\n\tbox-sizing: border-box;\n\tmin-height: 48px;\n\tdisplay: flex;\n\talign-items: flex-end;\n\tgap: 8px;\n\tpadding: 12px;\n\tbox-shadow: inset 0 0 0 1px\n\t\t${(props) => (props.$focused ? COLORS.stroke.brand : COLORS.stroke.primary)};\n\tborder-radius: 12px;\n\tbackground: ${COLORS.surface.standard};\n\ttransition: box-shadow 0.15s ease;\n\n\t&:hover {\n\t\tbox-shadow: inset 0 0 0 1px\n\t\t\t${(props) =>\n\t\t\t\tprops.$focused ? COLORS.stroke.brand : COLORS.content.inactive};\n\t}\n`;\n\nexport const MessageInput = styled.textarea`\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tresize: none;\n\tbackground: transparent;\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 24px;\n\tcolor: ${COLORS.content.primary};\n\tmax-height: 96px;\n\tmin-height: 24px;\n\tpadding: 0;\n\n\t&::placeholder {\n\t\tcolor: ${COLORS.content.placeholder};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t}\n`;\n\nexport const SendButton = styled.button<{ $active: boolean }>`\n\twidth: 24px;\n\theight: 24px;\n\tflex-shrink: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 6px;\n\tbackground: ${(props) =>\n\t\tprops.$active ? COLORS.background.brand : COLORS.background.inactive};\n\tcolor: ${COLORS.content.primaryInverse};\n\tcursor: ${(props) => (props.$active ? 'pointer' : 'not-allowed')};\n\ttransition: background 0.15s ease;\n\n\t&:hover:not(:disabled) {\n\t\tbackground: ${COLORS.background.brandHovered};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n`;\n\nexport const Disclaimer = styled.div`\n\tpadding: 4px 16px 16px;\n\ttext-align: center;\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n\tflex-shrink: 0;\n`;\n"],"names":["USER_BUBBLE_BACKGROUND","MESSAGE_GAP_PX","MESSAGE_ACTIONS_GAP_PX","PanelContainer","styled","COLORS","PanelHeader","HeaderAvatar","HeaderText","HeaderTitleRow","HeaderBadge","HeaderActions","IconAction","MessagesViewport","MessagesArea","ScrollFade","props","JumpToLatestButton","EmptyState","EmptyStateIcon","SuggestionList","SuggestionChip","MessageBubble","ThinkingBubble","HistoryLoader","FollowUpList","FollowUpsLabel","ToolCtaList","ToolCtaLink","FollowUpChip","InterruptedNote","MessageTimestamp","MessageActions","MessageAction","ThinkingLabel","ErrorBanner","InputArea","InputWrapper","MessageInput","SendButton","Disclaimer"],"mappings":";;AAGA,MAAMA,IAAyB,WAEzBC,IAAiB,IAEjBC,IAAyB,GAElBC,IAAiBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,eAKtBC,EAAO,QAAQ,QAAQ;AAAA,qBACjBA,EAAO,OAAO,OAAO;AAAA;AAAA;AAAA,GAK7BC,IAAcF,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKNC,EAAO,OAAO,OAAO;AAAA;AAAA,GAIpCE,IAAeH,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,eAKpBC,EAAO,WAAW,IAAI;AAAA;AAAA;AAAA;AAAA,UAI3BA,EAAO,QAAQ,KAAK;AAAA;AAAA,GAIjBG,IAAaJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQpBK,IAAiBL,EAAO;AAAA;AAAA;AAAA;AAAA,GAMxBM,IAAcN,EAAO;AAAA;AAAA;AAAA,eAGnBC,EAAO,WAAW,UAAU;AAAA,UACjCA,EAAO,QAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,GAOjBM,IAAgBP,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOvBQ,IAAaR,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAUvBC,EAAO,QAAQ,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKlBA,EAAO,QAAQ,OAAO;AAAA,WAC3BA,EAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA,uBAIVA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AAA;AAAA;AAAA;AAAA;AAAA,UASzBC,EAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMrBA,EAAO,QAAQ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQxBkC,IAAanC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAUlB,CAACY,MACdA,EAAM,UAAUX,EAAO,WAAW,QAAQA,EAAO,WAAW,QAAQ;AAAA,UAC5DA,EAAO,QAAQ,cAAc;AAAA,WAC5B,CAACW,MAAWA,EAAM,UAAU,YAAY,aAAc;AAAA;AAAA;AAAA;AAAA,gBAIjDX,EAAO,WAAW,YAAY;AAAA;AAAA;AAAA;AAAA,uBAIvBA,EAAO,OAAO,KAAK;AAAA;AAAA;AAAA,GAK7BmC,IAAapC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMvBC,EAAO,QAAQ,WAAW;AAAA;AAAA;"}
|
|
1
|
+
{"version":3,"file":"CopilotPanel.styled.js","sources":["../../../../src/components/bik-copilot/CopilotPanel.styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { COLORS } from '@src/constants/Theme';\n\nconst USER_BUBBLE_BACKGROUND = '#F9F9F9';\n\nconst MESSAGE_GAP_PX = 12;\n\nconst MESSAGE_ACTIONS_GAP_PX = 8;\n\nexport const PanelContainer = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 0;\n\toverflow: hidden;\n\tbackground: ${COLORS.surface.standard};\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 16px;\n\tbox-shadow: 0 16px 48px rgba(40, 3, 78, 0.18);\n`;\n\nexport const PanelHeader = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 16px;\n\tborder-bottom: 1px solid ${COLORS.stroke.primary};\n\tflex-shrink: 0;\n`;\n\nexport const HeaderAvatar = styled.div`\n\twidth: 36px;\n\theight: 36px;\n\tflex-shrink: 0;\n\tborder-radius: 8px;\n\tbackground: ${COLORS.background.base};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tcolor: ${COLORS.content.brand};\n\toverflow: hidden;\n`;\n\nexport const HeaderText = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n\tflex: 1;\n`;\n\nexport const HeaderTitleRow = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n`;\n\nexport const HeaderBadge = styled.span`\n\tpadding: 1px 6px;\n\tborder-radius: 4px;\n\tbackground: ${COLORS.background.brandLight};\n\tcolor: ${COLORS.content.brand};\n\tfont-size: 10px;\n\tfont-weight: 600;\n\tline-height: 16px;\n\twhite-space: nowrap;\n`;\n\nexport const HeaderActions = styled.div`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n\tflex-shrink: 0;\n`;\n\nexport const IconAction = styled.button`\n\twidth: 28px;\n\theight: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 6px;\n\tbackground: transparent;\n\tcolor: ${COLORS.content.secondary};\n\tcursor: pointer;\n\ttransition: background 0.15s ease, color 0.15s ease;\n\n\t&:hover {\n\t\tbackground: ${COLORS.surface.hovered};\n\t\tcolor: ${COLORS.content.primary};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n`;\n\n/**\n * Wraps the scroller so the bottom fade and the jump-to-latest button can be\n * absolutely positioned over it.\n */\nexport const MessagesViewport = styled.div`\n\tposition: relative;\n\tflex: 1;\n\tmin-height: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n`;\n\nexport const MessagesArea = styled.div`\n\tflex: 1;\n\tmin-height: 0;\n\toverflow-y: auto;\n\tpadding: 16px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: ${MESSAGE_GAP_PX}px;\n\n\t&::-webkit-scrollbar {\n\t\twidth: 6px;\n\t}\n\n\t&::-webkit-scrollbar-thumb {\n\t\tbackground: ${COLORS.background.inactive};\n\t\tborder-radius: 3px;\n\t}\n`;\n\n/**\n * Softens the cut-off edge of a long answer the reader has scrolled up from, so\n * the clipped line reads as continuing rather than as the end of the message.\n *\n * Two layers, because one element cannot ramp a gradient and a blur\n * independently: the element itself whitens the text out, and `::after` lays a\n * masked blur over it that strengthens towards the bottom. Browsers without\n * `backdrop-filter` still get the fade.\n */\nexport const ScrollFade = styled.div<{ $visible: boolean }>`\n\tposition: absolute;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\theight: 40px;\n\tpointer-events: none;\n\topacity: ${(props) => (props.$visible ? 1 : 0)};\n\ttransition: opacity 0.2s ease;\n\tbackground: linear-gradient(\n\t\tto bottom,\n\t\t${COLORS.surface.standard}00 0%,\n\t\t${COLORS.surface.standard}99 60%,\n\t\t${COLORS.surface.standard} 100%\n\t);\n\n\t&::after {\n\t\tcontent: '';\n\t\tposition: absolute;\n\t\tinset: 0;\n\t\tbackdrop-filter: blur(1px);\n\t\t-webkit-backdrop-filter: blur(1px);\n\t\tmask-image: linear-gradient(to bottom, transparent 0%, #000 75%);\n\t\t-webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 75%);\n\t}\n`;\n\nexport const JumpToLatestButton = styled.button<{ $visible: boolean }>`\n\tposition: absolute;\n\tleft: 50%;\n\tbottom: 12px;\n\ttransform: translateX(-50%)\n\t\ttranslateY(${(props) => (props.$visible ? '0' : '6px')});\n\twidth: 32px;\n\theight: 32px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 999px;\n\tbackground: ${COLORS.background.inverse};\n\tcolor: ${COLORS.content.primaryInverse};\n\tbox-shadow: 0 2px 8px rgba(40, 3, 78, 0.16);\n\tcursor: pointer;\n\topacity: ${(props) => (props.$visible ? 1 : 0)};\n\t/* Hidden to the pointer and to focus order while it is faded out. */\n\tvisibility: ${(props) => (props.$visible ? 'visible' : 'hidden')};\n\ttransition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease,\n\t\tbackground 0.15s ease, color 0.15s ease;\n\n\t&:hover {\n\t\tbackground: ${COLORS.background.brandHovered};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n`;\n\nexport const EmptyState = styled.div`\n\tflex: 1;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\ttext-align: center;\n\tpadding: 8px 4px;\n`;\n\nexport const EmptyStateIcon = styled.div`\n\tcolor: ${COLORS.content.brand};\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-bottom: 4px;\n`;\n\nexport const SuggestionList = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 8px;\n\tmargin-top: 12px;\n\twidth: 100%;\n`;\n\nexport const SuggestionChip = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tmax-width: 100%;\n\tpadding: 8px 14px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 999px;\n\tbackground: ${COLORS.surface.standard};\n\tcolor: ${COLORS.content.primary};\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 18px;\n\ttext-align: left;\n\tcursor: pointer;\n\ttransition: border-color 0.15s ease, background 0.15s ease;\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tborder-color: ${COLORS.stroke.brand};\n\t\tbackground: ${COLORS.background.brandVeryLight};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t}\n`;\n\nexport const MessageBubble = styled.div<{\n\t$role: 'user' | 'assistant' | 'system';\n}>`\n\tfont-family: Inter;\n\tfont-size: 14px;\n\tline-height: 20px;\n\tword-break: break-word;\n\toverflow-wrap: break-word;\n\n\t${(props) => {\n\t\tif (props.$role === 'user') {\n\t\t\treturn `\n\t\t\t\talign-self: flex-end;\n\t\t\t\tmargin-left: 32px;\n\t\t\t\tpadding: 10px 14px;\n\t\t\t\tborder-radius: 12px;\n\t\t\t\tbackground: ${USER_BUBBLE_BACKGROUND};\n\t\t\t\tcolor: ${COLORS.content.primary};\n\t\t\t`;\n\t\t}\n\t\tif (props.$role === 'system') {\n\t\t\treturn `\n\t\t\t\talign-self: center;\n\t\t\t\tmax-width: 90%;\n\t\t\t\tpadding: 6px 10px;\n\t\t\t\tborder-radius: 8px;\n\t\t\t\tbackground: ${COLORS.surface.grey};\n\t\t\t\tcolor: ${COLORS.content.secondary};\n\t\t\t\tfont-size: 12px;\n\t\t\t\ttext-align: center;\n\t\t\t`;\n\t\t}\n\t\treturn `\n\t\t\talign-self: stretch;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tcolor: ${COLORS.content.primary};\n\t\t`;\n\t}}\n\n\t/* Markdown emitted by renderCopilotMarkdown */\n\th1,\n\th2,\n\th3,\n\th4 {\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tmargin: 4px 0;\n\t}\n\n\tpre {\n\t\tbackground: ${COLORS.background.base};\n\t\tborder-radius: 6px;\n\t\tpadding: 8px;\n\t\tmargin: 6px 0;\n\t\toverflow-x: auto;\n\t\tfont-size: 12px;\n\t}\n\n\ta {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n\n\tul,\n\tol {\n\t\tmargin: 4px 0;\n\t\tpadding-left: 20px;\n\t}\n\n\tli {\n\t\tmargin: 2px 0;\n\t}\n\n\tcode {\n\t\tbackground: ${COLORS.background.base};\n\t\tborder-radius: 4px;\n\t\tpadding: 1px 4px;\n\t\tfont-size: 12px;\n\t}\n`;\n\nexport const ThinkingBubble = styled.div`\n\talign-self: flex-start;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 12px 14px;\n\tborder-radius: 12px;\n\tborder-bottom-left-radius: 4px;\n\tbackground: ${COLORS.surface.grey};\n\tborder: 1px solid ${COLORS.stroke.primary};\n`;\n\n/** Sits above the oldest message while the page before it is fetched. */\nexport const HistoryLoader = styled.div`\n\talign-self: center;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 4px 0;\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n`;\n\nexport const FollowUpList = styled.div`\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: stretch;\n\tgap: 8px;\n\tmargin-top: 4px;\n`;\n\nexport const FollowUpsLabel = styled.div`\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n`;\n\nexport const ToolCtaList = styled.div`\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tmargin-top: 8px;\n`;\n\n// An anchor rather than a button: a real link so the browser handles the new\n// tab, middle-click and copy-link-address the way merchants expect.\nexport const ToolCtaLink = styled.a`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tpadding: 8px 14px;\n\tborder: 1px solid ${COLORS.stroke.brand};\n\tborder-radius: 10px;\n\tbackground: ${COLORS.background.brandVeryLight};\n\tcolor: ${COLORS.content.brand};\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tfont-weight: 500;\n\tline-height: 18px;\n\ttext-decoration: none;\n\tcursor: pointer;\n\ttransition: background 0.15s ease, border-color 0.15s ease;\n\n\t&:hover {\n\t\tbackground: ${COLORS.background.brandLight};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 2px;\n\t}\n`;\n\nexport const FollowUpChip = styled.button`\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 10px 14px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 10px;\n\tbackground: ${COLORS.surface.standard};\n\tcolor: ${COLORS.content.primary};\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 18px;\n\ttext-align: left;\n\tcursor: pointer;\n\ttransition: border-color 0.15s ease, background 0.15s ease;\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t\tcolor: ${COLORS.content.secondary};\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tborder-color: ${COLORS.stroke.brand};\n\t\tbackground: ${COLORS.background.brandVeryLight};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t}\n`;\n\n/**\n * Bubble-less on purpose: a stopped reply is a note about the transcript, not a\n * message in it.\n */\nexport const InterruptedNote = styled.div`\n\talign-self: flex-start;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-family: Inter;\n\tfont-size: 12px;\n\tline-height: 18px;\n\tcolor: ${COLORS.content.secondary};\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t\tcolor: ${COLORS.content.inactive};\n\t}\n`;\n\nexport const MessageTimestamp = styled.div`\n\talign-self: flex-end;\n\tmargin-top: -6px;\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n`;\n\n/**\n * Actions under a finished assistant reply. Kept low-contrast so a row of icons\n * under every message does not compete with the answer itself.\n */\nexport const MessageActions = styled.div`\n\talign-self: flex-start;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n\t/* Pulls back out of the scroller's row gap to land on 8px. */\n\tmargin-top: ${MESSAGE_ACTIONS_GAP_PX - MESSAGE_GAP_PX}px;\n`;\n\nexport const MessageAction = styled.button`\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 4px;\n\twidth: 28px;\n\theight: 28px;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: ${COLORS.content.placeholder};\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcursor: pointer;\n\ttransition: background 0.15s ease, color 0.15s ease;\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t}\n\n\t&:hover:not(:disabled) {\n\t\tbackground: ${COLORS.surface.hovered};\n\t\tcolor: ${COLORS.content.secondary};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t\topacity: 0.5;\n\t}\n\n\t/* Confirmation reads as success, not as another affordance. */\n\t&[data-copied='true'],\n\t&[data-copied='true']:hover {\n\t\tcolor: ${COLORS.content.positive};\n\t}\n\n\t/* A cast vote holds the brand colour, so it stays legible as chosen once the\n\t pointer moves away. */\n\t&[data-selected='true'],\n\t&[data-selected='true']:hover {\n\t\tcolor: ${COLORS.content.brand};\n\t}\n`;\n\nexport const ThinkingLabel = styled.span`\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 20px;\n\tcolor: ${COLORS.content.secondary};\n`;\n\nexport const ErrorBanner = styled.div`\n\tmargin: 0 16px;\n\tpadding: 8px 10px;\n\tborder-radius: 8px;\n\tbackground: ${COLORS.background.negative.light};\n\tcolor: ${COLORS.content.negative};\n\tfont-family: Inter;\n\tfont-size: 12px;\n\tline-height: 18px;\n\tflex-shrink: 0;\n`;\n\nexport const InputArea = styled.div`\n\tpadding: 16px 16px 4px;\n\tflex-shrink: 0;\n`;\n\n/**\n * The quoted selection above the input. Deliberately outside `InputWrapper` so\n * it does not grow the field's focus ring, and truncated rather than wrapped —\n * a long quote must not push the input off the panel.\n */\nexport const AttachmentChip = styled.div`\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tmargin-bottom: 8px;\n\tpadding: 6px 8px;\n\tborder: 1px solid ${COLORS.stroke.primary};\n\tborder-radius: 8px;\n\tbackground: ${COLORS.background.brandVeryLight};\n\n\tsvg {\n\t\tflex-shrink: 0;\n\t}\n`;\n\nexport const AttachmentText = styled.span`\n\tflex: 1;\n\tmin-width: 0;\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\tfont-family: Inter;\n\tfont-size: 12px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.primary};\n`;\n\nexport const AttachmentRemove = styled.button`\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-shrink: 0;\n\twidth: 16px;\n\theight: 16px;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: ${COLORS.content.secondary};\n\tcursor: pointer;\n\n\t&:hover {\n\t\tbackground: ${COLORS.background.brandLight};\n\t}\n`;\n\nexport const InputWrapper = styled.div<{ $focused: boolean }>`\n\tbox-sizing: border-box;\n\tmin-height: 48px;\n\tdisplay: flex;\n\talign-items: flex-end;\n\tgap: 8px;\n\tpadding: 12px;\n\tbox-shadow: inset 0 0 0 1px\n\t\t${(props) => (props.$focused ? COLORS.stroke.brand : COLORS.stroke.primary)};\n\tborder-radius: 12px;\n\tbackground: ${COLORS.surface.standard};\n\ttransition: box-shadow 0.15s ease;\n\n\t&:hover {\n\t\tbox-shadow: inset 0 0 0 1px\n\t\t\t${(props) =>\n\t\t\t\tprops.$focused ? COLORS.stroke.brand : COLORS.content.inactive};\n\t}\n`;\n\nexport const MessageInput = styled.textarea`\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tresize: none;\n\tbackground: transparent;\n\tfont-family: Inter;\n\tfont-size: 13px;\n\tline-height: 24px;\n\tcolor: ${COLORS.content.primary};\n\tmax-height: 96px;\n\tmin-height: 24px;\n\tpadding: 0;\n\n\t&::placeholder {\n\t\tcolor: ${COLORS.content.placeholder};\n\t}\n\n\t&:disabled {\n\t\tcursor: not-allowed;\n\t}\n`;\n\nexport const SendButton = styled.button<{ $active: boolean }>`\n\twidth: 24px;\n\theight: 24px;\n\tflex-shrink: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: none;\n\tborder-radius: 6px;\n\tbackground: ${(props) =>\n\t\tprops.$active ? COLORS.background.brand : COLORS.background.inactive};\n\tcolor: ${COLORS.content.primaryInverse};\n\tcursor: ${(props) => (props.$active ? 'pointer' : 'not-allowed')};\n\ttransition: background 0.15s ease;\n\n\t&:hover:not(:disabled) {\n\t\tbackground: ${COLORS.background.brandHovered};\n\t}\n\n\t&:focus-visible {\n\t\toutline: 2px solid ${COLORS.stroke.brand};\n\t\toutline-offset: 1px;\n\t}\n`;\n\nexport const Disclaimer = styled.div`\n\tpadding: 4px 16px 16px;\n\ttext-align: center;\n\tfont-family: Inter;\n\tfont-size: 11px;\n\tline-height: 16px;\n\tcolor: ${COLORS.content.placeholder};\n\tflex-shrink: 0;\n`;\n"],"names":["USER_BUBBLE_BACKGROUND","MESSAGE_GAP_PX","MESSAGE_ACTIONS_GAP_PX","PanelContainer","styled","COLORS","PanelHeader","HeaderAvatar","HeaderText","HeaderTitleRow","HeaderBadge","HeaderActions","IconAction","MessagesViewport","MessagesArea","ScrollFade","props","JumpToLatestButton","EmptyState","EmptyStateIcon","SuggestionList","SuggestionChip","MessageBubble","ThinkingBubble","HistoryLoader","FollowUpList","FollowUpsLabel","ToolCtaList","ToolCtaLink","FollowUpChip","InterruptedNote","MessageTimestamp","MessageActions","MessageAction","ThinkingLabel","ErrorBanner","InputArea","AttachmentChip","AttachmentText","AttachmentRemove","InputWrapper","MessageInput","SendButton","Disclaimer"],"mappings":";;AAGA,MAAMA,IAAyB,WAEzBC,IAAiB,IAEjBC,IAAyB,GAElBC,IAAiBC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,eAKtBC,EAAO,QAAQ,QAAQ;AAAA,qBACjBA,EAAO,OAAO,OAAO;AAAA;AAAA;AAAA,GAK7BC,IAAcF,EAAO;AAAA;AAAA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AAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAMrBA,EAAO,QAAQ,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQxBqC,IAAatC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAUlB,CAACY,MACdA,EAAM,UAAUX,EAAO,WAAW,QAAQA,EAAO,WAAW,QAAQ;AAAA,UAC5DA,EAAO,QAAQ,cAAc;AAAA,WAC5B,CAACW,MAAWA,EAAM,UAAU,YAAY,aAAc;AAAA;AAAA;AAAA;AAAA,gBAIjDX,EAAO,WAAW,YAAY;AAAA;AAAA;AAAA;AAAA,uBAIvBA,EAAO,OAAO,KAAK;AAAA;AAAA;AAAA,GAK7BsC,IAAavC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAMvBC,EAAO,QAAQ,WAAW;AAAA;AAAA;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prompt a turn carries when the merchant started it from something they
|
|
3
|
+
* selected on the page.
|
|
4
|
+
*
|
|
5
|
+
* `/bik-ai/copilot-chatbot` takes `user_query` and nothing else that could hold
|
|
6
|
+
* context, so the quoted text has to be part of the question itself. The page is
|
|
7
|
+
* referred to without naming it because the request already carries `route` —
|
|
8
|
+
* the quote is the part the merchant could not have described in words.
|
|
9
|
+
*
|
|
10
|
+
* The selection arrives already whitespace-collapsed and length-capped from
|
|
11
|
+
* `TextSelectionAsk`, so this only quotes it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const buildCopilotSelectionPrompt: (selection: string, question: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilotSelectionPrompt.js","sources":["../../../../src/components/bik-copilot/copilotSelectionPrompt.ts"],"sourcesContent":["/**\n * The prompt a turn carries when the merchant started it from something they\n * selected on the page.\n *\n * `/bik-ai/copilot-chatbot` takes `user_query` and nothing else that could hold\n * context, so the quoted text has to be part of the question itself. The page is\n * referred to without naming it because the request already carries `route` —\n * the quote is the part the merchant could not have described in words.\n *\n * The selection arrives already whitespace-collapsed and length-capped from\n * `TextSelectionAsk`, so this only quotes it.\n */\nexport const buildCopilotSelectionPrompt = (\n\tselection: string,\n\tquestion: string,\n): string => {\n\tconst quoted = `\"${selection.trim()}\"`;\n\tconst trimmedQuestion = question.trim();\n\treturn trimmedQuestion\n\t\t? `About ${quoted} on this page: ${trimmedQuestion}`\n\t\t: `Tell me about ${quoted} on this page.`;\n};\n"],"names":["buildCopilotSelectionPrompt","selection","question","quoted","trimmedQuestion"],"mappings":"AAYO,MAAMA,IAA8B,CAC1CC,GACAC,MACY;AACZ,QAAMC,IAAS,IAAIF,EAAU,KAAA,CAAM,KAC7BG,IAAkBF,EAAS,KAAA;AACjC,SAAOE,IACJ,SAASD,CAAM,kBAAkBC,CAAe,KAChD,iBAAiBD,CAAM;AAC3B;"}
|