@bikdotai/bik-component-library 0.0.870-beta.1 → 0.0.871
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/CopilotPanel.js +1 -1
- package/dist/cjs/components/bik-copilot/CopilotPanel.js.map +1 -1
- package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js +1 -1
- package/dist/cjs/components/bik-copilot/useCopilotStreamChat.js.map +1 -1
- package/dist/cjs/components/button/Button.js +1 -1
- package/dist/cjs/components/button/Button.js.map +1 -1
- package/dist/cjs/components/button/Button.styled.js +2 -2
- package/dist/cjs/components/button/Button.styled.js.map +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.js +1 -1
- package/dist/cjs/components/dropdown-button/DropdownButton.js.map +1 -1
- package/dist/cjs/components/tag/Tag.js +1 -1
- package/dist/cjs/components/tag/Tag.js.map +1 -1
- package/dist/cjs/components/tag/Tag.styled.js +4 -4
- package/dist/cjs/components/tag/Tag.styled.js.map +1 -1
- package/dist/cjs/components/tag/model.js.map +1 -1
- package/dist/cjs/icons/BIK AI specific/WandSparkles.js +1 -1
- package/dist/cjs/icons/BIK AI specific/WandSparkles.js.map +1 -1
- package/dist/esm/components/ProgressChecklist/ProgressChecklist.style.d.ts +59 -24
- package/dist/esm/components/QueryBuilder/components/Connectors/Connector.styled.d.ts +4 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNode.styled.d.ts +4 -1
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNode/Property/PropertyNodeUIWrapper.styled.d.ts +10 -3
- package/dist/esm/components/QueryBuilder/components/QueryBuilderNodes.styled.d.ts +7 -2
- package/dist/esm/components/TablePagination/TablePagination.styled.d.ts +8 -3
- package/dist/esm/components/TablePagination/TablePaginationCard.d.ts +4 -2
- package/dist/esm/components/TypographyStyle.d.ts +141 -62
- package/dist/esm/components/WhatsAppTextEditor/AIRephrase.styled.d.ts +5 -2
- package/dist/esm/components/WhatsAppTextEditor/CustomEditor.styled.d.ts +20 -7
- package/dist/esm/components/WhatsAppTextEditor/WhatsAppTextEditorHeader.d.ts +3 -1
- package/dist/esm/components/access-token-troubleshoot-dialog/AccessTokenTroubleshootDialog.styles.d.ts +26 -9
- package/dist/esm/components/accordion/Accordion.style.d.ts +10 -4
- package/dist/esm/components/action-button/ActionButton.styled.d.ts +5 -2
- package/dist/esm/components/adbanner/Banner.styled.d.ts +88 -20
- package/dist/esm/components/add-variableV2/AddVariableBox.styled.d.ts +4 -1
- package/dist/esm/components/add-variableV2/AddVariableV2.styled.d.ts +9 -4
- package/dist/esm/components/agent-builder/AgentBuilder.styled.d.ts +328 -186
- package/dist/esm/components/agent-listing/AgentListing.styled.d.ts +88 -49
- package/dist/esm/components/alerts/Alert.styled.d.ts +11 -5
- package/dist/esm/components/analytics-card/AnalyticsCard.styled.d.ts +8 -4
- package/dist/esm/components/analytics-chips-and-dropdowns/CommonStyles.d.ts +27 -18
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/ComparisonBarChart/ComparisonBarChart.styled.d.ts +26 -11
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/FunnelChart/FunnelChart.styled.d.ts +26 -11
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/HorizontalBarGraph/HorizontalGraph.styles.d.ts +5 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/LineChart/LineChart.styled.d.ts +12 -5
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/StackedBarChart/StackedBarChart.styles.d.ts +8 -3
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarAndLinearGraph/VerticalBarAndLinearGraph.styles.d.ts +17 -6
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/VerticalBarGraph/VerticalGraph.styles.d.ts +5 -2
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapStyled.d.ts +28 -11
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/heatmap/HeatMapVertical.d.ts +3 -1
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/linearChipGroupedChart/LinearChipGroupedChart.styled.d.ts +18 -7
- package/dist/esm/components/analytics-chips-and-dropdowns/chart/scoreBlock/ScoreBlock.styled.d.ts +18 -7
- package/dist/esm/components/avatar/Avatar.styled.d.ts +4 -2
- package/dist/esm/components/bik-chatbot/components/ChatWindow.d.ts +4 -2
- package/dist/esm/components/bik-copilot/ControlledCopilot.styled.d.ts +5 -2
- package/dist/esm/components/bik-copilot/CopilotBall.styled.d.ts +5 -2
- package/dist/esm/components/bik-copilot/CopilotFeedbackModal.styled.d.ts +32 -11
- package/dist/esm/components/bik-copilot/CopilotPanel.js +235 -244
- package/dist/esm/components/bik-copilot/CopilotPanel.js.map +1 -1
- package/dist/esm/components/bik-copilot/CopilotPanel.styled.d.ts +120 -43
- package/dist/esm/components/bik-copilot/model.d.ts +4 -2
- package/dist/esm/components/bik-copilot/useCopilotStreamChat.d.ts +0 -18
- package/dist/esm/components/bik-copilot/useCopilotStreamChat.js +168 -163
- package/dist/esm/components/bik-copilot/useCopilotStreamChat.js.map +1 -1
- package/dist/esm/components/bik-layout/BikSidebarV2/SidebarV2Styles.d.ts +49 -18
- package/dist/esm/components/bik-layout/CommonStyles.d.ts +88 -28
- package/dist/esm/components/bik-layout/SidebarStyles.d.ts +17 -7
- package/dist/esm/components/button/Button.js +19 -21
- package/dist/esm/components/button/Button.js.map +1 -1
- package/dist/esm/components/button/Button.styled.d.ts +4 -3
- package/dist/esm/components/button/Button.styled.js +5 -5
- package/dist/esm/components/button/Button.styled.js.map +1 -1
- package/dist/esm/components/button/model.d.ts +0 -5
- package/dist/esm/components/button/themes.d.ts +16 -2
- package/dist/esm/components/buttonGroup/ButtonGroupStyle.d.ts +9 -4
- package/dist/esm/components/card-selection-modal/CardSelectionModal.styled.d.ts +7 -2
- package/dist/esm/components/card-selector/CardSelector.styled.d.ts +8 -3
- package/dist/esm/components/carousel-preview/CarouselPreview.style.d.ts +9 -4
- package/dist/esm/components/carousel-secondary/CarouselSecondary.style.d.ts +23 -11
- package/dist/esm/components/channel-playground/shell/TestingPlayground.style.d.ts +74 -18
- package/dist/esm/components/checkBox/CheckBox.styled.d.ts +9 -4
- package/dist/esm/components/checkList/CheckList.styled.d.ts +4 -1
- package/dist/esm/components/code-block/CodeBlock.styled.d.ts +43 -20
- package/dist/esm/components/colourInput/ColourInput.styled.d.ts +7 -2
- package/dist/esm/components/connected-app-dialog/ConnectedAppDialog.styled.d.ts +49 -16
- package/dist/esm/components/country-code-picker/CountryCodePicker.styled.d.ts +8 -3
- package/dist/esm/components/country-code-picker/CountryPicker.styled.d.ts +8 -3
- package/dist/esm/components/curtain/Curtain.styled.d.ts +11 -5
- package/dist/esm/components/custom-date-time/CustomDateTime.styled.d.ts +4 -1
- package/dist/esm/components/dashboard-review-popup/DashboardReviewPopUp.styled.d.ts +7 -2
- package/dist/esm/components/dashboard-review-popup/components/FiveStar.styled.d.ts +7 -2
- package/dist/esm/components/dashboard-review-popup/components/Form.styled.d.ts +20 -7
- package/dist/esm/components/data-source-panel/DataSourcePanel.style.d.ts +13 -4
- package/dist/esm/components/datePicker/DatePicker.styled.d.ts +22 -15
- package/dist/esm/components/datePicker/DatePickerWrapper.styled.d.ts +8 -4
- package/dist/esm/components/discount-modal/DiscountModal.styled.d.ts +17 -6
- package/dist/esm/components/discount-modal/DynamicCoupon/DynamicCoupon.styled.d.ts +23 -8
- package/dist/esm/components/dropdown/ChipDropdown.d.ts +4 -2
- package/dist/esm/components/dropdown/Common.styled.d.ts +15 -6
- package/dist/esm/components/dropdown/OpenedDropdown/components/OpennedDropdown.styled.d.ts +12 -5
- package/dist/esm/components/dropdown/OpenedDropdown/components/description/Description.styled.d.ts +5 -2
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.d.ts +4 -1
- package/dist/esm/components/dropdown/OpenedDropdown/components/menu/MenuList.styled.d.ts +18 -4
- package/dist/esm/components/dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.d.ts +4 -1
- package/dist/esm/components/dropdown-button/DropdownButton.d.ts +0 -5
- package/dist/esm/components/dropdown-button/DropdownButton.js +3 -4
- package/dist/esm/components/dropdown-button/DropdownButton.js.map +1 -1
- package/dist/esm/components/dropdown-button/DropdownButton.style.d.ts +9 -5
- package/dist/esm/components/dual-icon-button/DualIconButton.styled.d.ts +12 -5
- package/dist/esm/components/file-uploader/FileUploaderStyle.d.ts +9 -4
- package/dist/esm/components/floating-action-button/FloatingActionButton.styles.d.ts +24 -13
- package/dist/esm/components/half-doughnut-chart/HalfDoughnutChart.styled.d.ts +29 -10
- package/dist/esm/components/icon-button/IconButton.styled.d.ts +4 -2
- package/dist/esm/components/input/Input.styled.d.ts +114 -29
- package/dist/esm/components/keywords-input/KeywordsInput.styled.d.ts +4 -1
- package/dist/esm/components/list-item/ListItem.styled.d.ts +4 -2
- package/dist/esm/components/list-item/themes.d.ts +1 -1
- package/dist/esm/components/modals/modal.styled.d.ts +16 -7
- package/dist/esm/components/multi-level-dropdown/MultiLevelDropdown.styled.d.ts +60 -22
- package/dist/esm/components/navigation-hyperlink/NavigationHyperlink.d.ts +3 -1
- package/dist/esm/components/pagination/Pagination.styled.d.ts +4 -1
- package/dist/esm/components/plans/DurationSelectorStyles.d.ts +4 -1
- package/dist/esm/components/plans/SubscriptionPlanSelector.d.ts +6 -2
- package/dist/esm/components/plans/SubscriptionPlanStyled.d.ts +9 -4
- package/dist/esm/components/postPicker/PostPicker.styled.d.ts +43 -13
- package/dist/esm/components/product-picker/ProductPicker.styled.d.ts +7 -2
- package/dist/esm/components/product-picker-v2/style.d.ts +82 -25
- package/dist/esm/components/progress-bar/ProgressBarComponent.d.ts +5 -2
- package/dist/esm/components/radioButton/RadioButton.styled.d.ts +8 -3
- package/dist/esm/components/radioList/RadioList.styled.d.ts +4 -1
- package/dist/esm/components/shimmer/ShimmerComponent/ShimmerStyled.d.ts +9 -4
- package/dist/esm/components/side-modal/SideModal.style.d.ts +25 -12
- package/dist/esm/components/spinner/Spinner.d.ts +4 -2
- package/dist/esm/components/states/StateComponent.styled.d.ts +20 -9
- package/dist/esm/components/stepper/Stepper.styled.d.ts +10 -4
- package/dist/esm/components/switch/Switch.d.ts +12 -6
- package/dist/esm/components/tabs/Tabs.styles.d.ts +30 -9
- package/dist/esm/components/tag/Tag.d.ts +1 -1
- package/dist/esm/components/tag/Tag.js +41 -48
- package/dist/esm/components/tag/Tag.js.map +1 -1
- package/dist/esm/components/tag/Tag.styled.d.ts +4 -5
- package/dist/esm/components/tag/Tag.styled.js +9 -6
- package/dist/esm/components/tag/Tag.styled.js.map +1 -1
- package/dist/esm/components/tag/model.d.ts +0 -11
- package/dist/esm/components/tag/model.js.map +1 -1
- package/dist/esm/components/template-context-mapper/Badge/index.d.ts +5 -2
- package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.style.d.ts +14 -5
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +4 -2
- package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorsPanel.d.ts +7 -2
- package/dist/esm/components/template-context-mapper/styles/TemplateAnalyticsStyles.d.ts +24 -6
- package/dist/esm/components/template-context-mapper/utils/TemplateConstants.d.ts +16 -8
- package/dist/esm/components/template-preview/EmailTemplatePreview.styled.d.ts +23 -10
- package/dist/esm/components/template-preview/RCS/RCSPreview.styled.d.ts +70 -20
- package/dist/esm/components/template-preview/SMS/SMSBubble.d.ts +7 -2
- package/dist/esm/components/template-preview/SmsTemplatePreview.styled.d.ts +27 -10
- package/dist/esm/components/template-preview/TemplatePreview.styled.d.ts +4 -1
- package/dist/esm/components/template-preview/WhatsApp/ChatHeader.style.d.ts +16 -5
- package/dist/esm/components/template-preview/WhatsApp/ChatUI.style.d.ts +53 -11
- package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.d.ts +3 -1
- package/dist/esm/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.d.ts +9 -3
- package/dist/esm/components/template-preview/webpush/WebpushPreview.styled.d.ts +4 -1
- package/dist/esm/components/testimonial-card/TestimonialCard.style.d.ts +30 -11
- package/dist/esm/components/text-selection-ask/SelectionAskPill.styled.d.ts +5 -2
- package/dist/esm/components/thumbnail/Thumbnail.styled.d.ts +4 -2
- package/dist/esm/components/toaster/Toaster.styled.d.ts +4 -2
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryCountIntentWiseModal.style.d.ts +4 -1
- package/dist/esm/components/unsatisfactory-response-list/UnsatisfactoryResponseList.style.d.ts +4 -1
- package/dist/esm/components/variable-picker-v3/styles.d.ts +15 -6
- package/dist/esm/components/vertical-full-screen-modal/styles.d.ts +15 -6
- package/dist/esm/components/whats-new/WhatsNew.styles.d.ts +18 -7
- package/dist/esm/editor/BikEditor.styles.d.ts +18 -7
- package/dist/esm/editor/extensions/editorDropdown.styles.d.ts +47 -12
- package/dist/esm/icons/BIK AI specific/WandSparkles.js +1 -1
- package/dist/esm/icons/BIK AI specific/WandSparkles.js.map +1 -1
- package/package.json +3 -3
|
@@ -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\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,MACr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C;"}
|
|
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 wasTurnInFlightRef = useRef(false);\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\tuseEffect(() => {\n\t\tconst turnJustEnded = wasTurnInFlightRef.current && !isTurnInFlight;\n\t\twasTurnInFlightRef.current = isTurnInFlight;\n\t\tif (turnJustEnded && !inputDisabled && !dislikePromptId) {\n\t\t\tinputRef.current?.focus();\n\t\t}\n\t}, [isTurnInFlight, inputDisabled, dislikePromptId]);\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{}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{!message.isRestored &&\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfeedback[message.id] === undefined && (\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<MessageAction\n\t\t\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\t\t\tonClick={() =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleFeedback(message.id, 'like')\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\ttitle=\"Good response\"\n\t\t\t\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\t\t\t>\n\t\t\t\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\t\t</MessageAction>\n\t\t\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\t\t\ttype=\"button\"\n\t\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\t\thandleFeedback(message.id, 'dislike')\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\ttitle=\"Bad response\"\n\t\t\t\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\t\t\t>\n\t\t\t\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\t\t</MessageAction>\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)}\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","wasTurnInFlightRef","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","turnJustEnded","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":";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cAAA;AAAA,YAAA;AAAA,UACnC,GACD;AAAA,UAED,gBAAA7H,EAACmK,IAAA,EAAa,UAAU3G,IACvB,UAAA;AAAA,YAAA,gBAAAvD;AAAA,cAACmK;AAAA,cAAA;AAAA,gBACA,KAAKlG;AAAA,gBACL,MAAM;AAAA,gBACN,OAAOb;AAAA,gBACP,aAAAlC;AAAA,gBACA,UAAU0B;AAAA,gBACV,UAAU4D;AAAA,gBACV,WAAWE;AAAA,gBACX,SAAS,MAAMlD,GAAkB,EAAI;AAAA,gBACrC,QAAQ,MAAMA,GAAkB,EAAK;AAAA,cAAA;AAAA,YAAA;AAAA,YAEtC,gBAAAxD;AAAA,cAACoK;AAAA,cAAA;AAAA,gBACA,MAAK;AAAA,gBACL,SAASrF,KAAWD;AAAA,gBACpB,UAAU,CAACC,KAAW,CAACD;AAAA,gBACvB,SAASC,IAAU3C,IAASgE;AAAA,gBAC5B,cAAYrB,IAAU,oBAAoB;AAAA,gBAEzC,UAAAA,IAAU,gBAAA/E,EAACE,IAAA,CAAA,CAAS,sBAAMJ,IAAA,CAAA,CAAc;AAAA,cAAA;AAAA,YAAA;AAAA,UAC1C,EAAA,CACD;AAAA,QAAA,GACD;AAAA,QAECqB,KAAc,gBAAAnB,EAACqK,IAAA,EAAY,UAAAlJ,EAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG1C;"}
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare const
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PanelContainer: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
3
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
4
|
+
}> & string;
|
|
5
|
+
export declare const PanelHeader: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
6
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
7
|
+
}> & string;
|
|
8
|
+
export declare const HeaderAvatar: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
9
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
10
|
+
}> & string;
|
|
11
|
+
export declare const HeaderText: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
12
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
13
|
+
}> & string;
|
|
14
|
+
export declare const HeaderTitleRow: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
15
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
16
|
+
}> & string;
|
|
17
|
+
export declare const HeaderBadge: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
18
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
19
|
+
}> & string;
|
|
20
|
+
export declare const HeaderActions: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
21
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
22
|
+
}> & string;
|
|
23
|
+
export declare const IconAction: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
24
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
25
|
+
}> & string;
|
|
9
26
|
/**
|
|
10
27
|
* Wraps the scroller so the bottom fade and the jump-to-latest button can be
|
|
11
28
|
* absolutely positioned over it.
|
|
12
29
|
*/
|
|
13
|
-
export declare const MessagesViewport: import('styled-components').
|
|
14
|
-
|
|
30
|
+
export declare const MessagesViewport: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
31
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
32
|
+
}> & string;
|
|
33
|
+
export declare const MessagesArea: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
34
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
35
|
+
}> & string;
|
|
15
36
|
/**
|
|
16
37
|
* Softens the cut-off edge of a long answer the reader has scrolled up from, so
|
|
17
38
|
* the clipped line reads as continuing rather than as the end of the message.
|
|
@@ -21,55 +42,111 @@ export declare const MessagesArea: import('styled-components').StyledComponent<"
|
|
|
21
42
|
* masked blur over it that strengthens towards the bottom. Browsers without
|
|
22
43
|
* `backdrop-filter` still get the fade.
|
|
23
44
|
*/
|
|
24
|
-
export declare const ScrollFade: import('styled-components').
|
|
45
|
+
export declare const ScrollFade: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
46
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
47
|
+
}, {
|
|
25
48
|
$visible: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare const JumpToLatestButton: import('styled-components').
|
|
49
|
+
}>> & string;
|
|
50
|
+
export declare const JumpToLatestButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
51
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
52
|
+
}, {
|
|
28
53
|
$visible: boolean;
|
|
29
|
-
}
|
|
30
|
-
export declare const EmptyState: import('styled-components').
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export declare const
|
|
34
|
-
|
|
54
|
+
}>> & string;
|
|
55
|
+
export declare const EmptyState: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
56
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
57
|
+
}> & string;
|
|
58
|
+
export declare const EmptyStateIcon: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
59
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
60
|
+
}> & string;
|
|
61
|
+
export declare const SuggestionList: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
62
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
63
|
+
}> & string;
|
|
64
|
+
export declare const SuggestionChip: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
65
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
66
|
+
}> & string;
|
|
67
|
+
export declare const MessageBubble: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
68
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
69
|
+
}, {
|
|
35
70
|
$role: 'user' | 'assistant' | 'system';
|
|
36
|
-
}
|
|
37
|
-
export declare const ThinkingBubble: import('styled-components').
|
|
71
|
+
}>> & string;
|
|
72
|
+
export declare const ThinkingBubble: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
73
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
74
|
+
}> & string;
|
|
38
75
|
/** Sits above the oldest message while the page before it is fetched. */
|
|
39
|
-
export declare const HistoryLoader: import('styled-components').
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export declare const
|
|
43
|
-
|
|
44
|
-
|
|
76
|
+
export declare const HistoryLoader: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
77
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
78
|
+
}> & string;
|
|
79
|
+
export declare const FollowUpList: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
80
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
81
|
+
}> & string;
|
|
82
|
+
export declare const FollowUpsLabel: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
83
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
84
|
+
}> & string;
|
|
85
|
+
export declare const ToolCtaList: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
86
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
87
|
+
}> & string;
|
|
88
|
+
export declare const ToolCtaLink: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "style"> & {
|
|
89
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
90
|
+
}> & string;
|
|
91
|
+
export declare const FollowUpChip: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
92
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
93
|
+
}> & string;
|
|
45
94
|
/**
|
|
46
95
|
* Bubble-less on purpose: a stopped reply is a note about the transcript, not a
|
|
47
96
|
* message in it.
|
|
48
97
|
*/
|
|
49
|
-
export declare const InterruptedNote: import('styled-components').
|
|
50
|
-
|
|
98
|
+
export declare const InterruptedNote: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
99
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
100
|
+
}> & string;
|
|
101
|
+
export declare const MessageTimestamp: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
102
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
103
|
+
}> & string;
|
|
51
104
|
/**
|
|
52
105
|
* Actions under a finished assistant reply. Kept low-contrast so a row of icons
|
|
53
106
|
* under every message does not compete with the answer itself.
|
|
54
107
|
*/
|
|
55
|
-
export declare const MessageActions: import('styled-components').
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export declare const
|
|
59
|
-
|
|
108
|
+
export declare const MessageActions: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
109
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
110
|
+
}> & string;
|
|
111
|
+
export declare const MessageAction: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
112
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
113
|
+
}> & string;
|
|
114
|
+
export declare const ThinkingLabel: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
115
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
116
|
+
}> & string;
|
|
117
|
+
export declare const ErrorBanner: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
118
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
119
|
+
}> & string;
|
|
120
|
+
export declare const InputArea: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
121
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
122
|
+
}> & string;
|
|
60
123
|
/**
|
|
61
124
|
* The quoted selection above the input. Deliberately outside `InputWrapper` so
|
|
62
125
|
* it does not grow the field's focus ring, and truncated rather than wrapped —
|
|
63
126
|
* a long quote must not push the input off the panel.
|
|
64
127
|
*/
|
|
65
|
-
export declare const AttachmentChip: import('styled-components').
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
export declare const
|
|
128
|
+
export declare const AttachmentChip: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
129
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
130
|
+
}> & string;
|
|
131
|
+
export declare const AttachmentText: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
132
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
133
|
+
}> & string;
|
|
134
|
+
export declare const AttachmentRemove: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
135
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
136
|
+
}> & string;
|
|
137
|
+
export declare const InputWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
138
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
139
|
+
}, {
|
|
69
140
|
$focused: boolean;
|
|
70
|
-
}
|
|
71
|
-
export declare const MessageInput: import('styled-components').
|
|
72
|
-
|
|
141
|
+
}>> & string;
|
|
142
|
+
export declare const MessageInput: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "style"> & {
|
|
143
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
144
|
+
}> & string;
|
|
145
|
+
export declare const SendButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
146
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
147
|
+
}, {
|
|
73
148
|
$active: boolean;
|
|
74
|
-
}
|
|
75
|
-
export declare const Disclaimer: import('styled-components').
|
|
149
|
+
}>> & string;
|
|
150
|
+
export declare const Disclaimer: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
151
|
+
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars | undefined;
|
|
152
|
+
}> & string;
|
|
@@ -136,8 +136,9 @@ export interface CopilotShellProps {
|
|
|
136
136
|
onRefresh?: () => void;
|
|
137
137
|
onRegenerate?: () => void;
|
|
138
138
|
/**
|
|
139
|
-
* Observes a cast thumbs-up or thumbs-down.
|
|
140
|
-
*
|
|
139
|
+
* Observes a cast thumbs-up or thumbs-down. A reply is rated once: both thumbs
|
|
140
|
+
* retire as soon as either is pressed, so this fires at most once per reply and
|
|
141
|
+
* there is no "unrated" to report.
|
|
141
142
|
*
|
|
142
143
|
* `BIKCopilot` records the vote itself, so a host only needs this to react to
|
|
143
144
|
* one as well; leaving it unset still records.
|
|
@@ -459,6 +460,7 @@ export interface CopilotMessage extends ChatMessage {
|
|
|
459
460
|
* a reload, so the transcript still says the reply is incomplete.
|
|
460
461
|
*/
|
|
461
462
|
wasInterrupted?: boolean;
|
|
463
|
+
isRestored?: boolean;
|
|
462
464
|
/**
|
|
463
465
|
* Prompts the backend suggests as the next question. Only the newest reply's
|
|
464
466
|
* are offered — older ones stay in the transcript but are not rendered.
|
|
@@ -1,20 +1,2 @@
|
|
|
1
1
|
import { UseCopilotStreamChatOptions, UseCopilotStreamChatResult } from './model';
|
|
2
|
-
/**
|
|
3
|
-
* Runs a merchant copilot conversation against the streaming
|
|
4
|
-
* `/bik-ai/copilot-chatbot` endpoint.
|
|
5
|
-
*
|
|
6
|
-
* Owns three things the endpoint's contract requires:
|
|
7
|
-
*
|
|
8
|
-
* 1. **The session id.** One per route. Navigating away and back to the same
|
|
9
|
-
* route continues that conversation, and so does a refresh: the ids live in
|
|
10
|
-
* memory but are recovered from the stored records, which is what keeps them
|
|
11
|
-
* lined up with the history the backend keys by them (see
|
|
12
|
-
* `copilotPageSession`).
|
|
13
|
-
* 2. **`previousResponseId`.** Absent on the first turn; from then on it is the
|
|
14
|
-
* `responseId` of the last `TEXT` event, which is what makes OpenAI replay the
|
|
15
|
-
* earlier turns server side. A turn that breaks halfway returns no
|
|
16
|
-
* `responseId`, and the backend means that — the next turn starts fresh.
|
|
17
|
-
* 3. **The transcript**, stored in IndexedDB under `{sessionId}:{route}` and
|
|
18
|
-
* written every turn, so leaving the page mid-conversation loses nothing.
|
|
19
|
-
*/
|
|
20
2
|
export declare const useCopilotStreamChat: ({ storeId, agent, route, messagesPath, feedbackPath, user, loadHistory, systemPrompt, sessionId: pinnedSessionId, persist, onError, onResponseComplete, onSessionIdChange, baseUrl, endpointPath, headers, authToken, getAuthToken, fetchImpl, }: UseCopilotStreamChatOptions) => UseCopilotStreamChatResult;
|