@next-bricks/ai 1.16.2 → 1.16.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"chunks/774.b65640d6.js","mappings":"sJAuDaA,GAAkBC,EAAAA,EAAAA,eAC7B,CAAC,GAGUC,EAAqBA,KAChCC,EAAAA,EAAAA,YAAWH,E,4ECrDPI,GAAcC,E,QAAAA,WAAyC,WAEtD,SAASC,IACd,OAAOC,IAAAA,cAAA,OAAKC,UAAU,gCACxB,CAEO,SAASC,IACd,OACEF,IAAAA,cAAA,OAAKC,UAAU,8BACbD,IAAAA,cAAA,OAAKC,UAAU,QACbD,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,aAIR,CAEO,SAASG,IACd,OACEH,IAAAA,cAAA,OAAKC,UAAU,0BACbD,IAAAA,cAACH,EAAW,CAACO,KAAK,UAAUC,IAAI,OAAOC,UAAQ,IAGrD,C,sFCxBMT,GAAcC,EAAAA,EAAAA,WAAyC,WAEtD,SAASS,EAAMC,GAMF,IANG,KACrBC,EAAI,QACJC,GAIDF,EACOG,GAASC,EAAAA,EAAAA,UAAQ,IAAe,SAATH,GAAiB,CAACA,KACzC,kBAAEI,IAAsBlB,EAAAA,EAAAA,KAExBmB,GAAYF,EAAAA,EAAAA,UAChB,SAAAG,EAAA,OAA6B,QAA7BA,EAAMF,aAAiB,EAAjBA,EAAmBG,YAAI,IAAAD,EAAAA,EAAI,EAAE,GACnC,CAACF,IAGGI,GAAaL,EAAAA,EAAAA,UAAQ,IAClBE,EAAUI,MAAMC,GAASA,EAAKC,KAAOV,KAC3C,CAACI,EAAWJ,IAEf,OAAQC,GAAUM,EAChBjB,IAAAA,cAACH,GAAWwB,EAAAA,EAAAA,GAAA,CACVpB,UAAU,UACNgB,EAAWb,KAAI,CACnBkB,MAAO,CACLC,MAAO,eAAFC,OAAiBP,EAAWb,KA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wHE,qwLAKh9D,KAE5O,QAAeP,EAAwBE,U,gJCPnCM,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,M","sources":["webpack:///./src/chat-view/ChatViewContext.ts","webpack:///./src/chat-view/components/Loading.tsx","webpack:///./src/chat-view/components/MessageItem/Avatar.tsx","webpack:///./src/chat-view/components/MessageItem/GuideItem.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/ProgressText.tsx","webpack:///./src/chat-view/components/MessageItem/MsgItemContext.ts","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CustomComponent.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/index.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/index.tsx","webpack:///./src/chat-view/components/MessageItem/TableItem.tsx","webpack:///./src/chat-view/components/MessageItem/TextItem.tsx","webpack:///./src/chat-view/components/MessageItem/Toolbar.tsx","webpack:///./src/chat-view/components/MessageItem/Time.tsx","webpack:///./src/chat-view/components/MessageItem/ContentTip.tsx","webpack:///./src/chat-view/components/MessageItem/index.tsx","webpack:///./src/chat-view/components/QuickAnswerList/index.tsx","webpack:///./src/chat-view/components/StopBtn.tsx","webpack:///./src/chat-view/components/MessageList.tsx","webpack:///./src/chat-view/components/utils/calculateAutoSizeStyle.ts","webpack:///./src/chat-view/components/SearchInput.tsx","webpack:///./src/chat-view/components/SessionList.tsx","webpack:///./src/chat-view/ChatService.ts","webpack:///./src/chat-view/hooks/useChatViewInfo.ts","webpack:///./src/chat-view/host-context.css","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CodeBlock.shadow.css","webpack:///./src/chat-view/components/MessageItem/Markdown/markdown.shadow.css","webpack:///./src/chat-view/components/QuickAnswerList/quickAnswerList.shadow.css","webpack:///./src/chat-view/components/loading.shadow.css","webpack:///./src/chat-view/styles.shadow.css","webpack:///./src/chat-view/host-context.css?1beb"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { AgentDetailItem } from \"./components/QuickAnswerList/index.js\";\nimport { SessionItem } from \"./ChatService.js\";\n\nexport type Role = \"guide\" | \"user\" | \"assistant\";\n\nexport interface MessageItemContent {\n type: \"guide\" | \"text\" | \"markdown\" | \"table\" | \"load\";\n text: string;\n examplePrompts?: string[];\n}\n\nexport interface MessageItem {\n role: Role;\n content: MessageItemContent;\n created?: number | string;\n key?: number | string;\n conversationId?: string;\n taskId?: string;\n agentId?: string;\n chatting?: boolean;\n tag?: {\n isLike?: boolean;\n };\n}\n\nexport interface QuickAnswerConfig {\n tip: string;\n list: AgentDetailItem[];\n}\ninterface ChatViewContextProps {\n sessionEnd: boolean;\n sessionLoading: boolean;\n activeSessionId?: string;\n sessionList: SessionItem[];\n msgEnd: boolean;\n msgLoading: boolean;\n msgList: MessageItem[];\n loading: boolean;\n chatting: boolean;\n searchStr: string;\n showLike: boolean;\n readonly: boolean;\n quickAnswerConfig?: QuickAnswerConfig;\n setAgent: (id: string) => void;\n handleIsLike: (id: string, isLike: boolean) => Promise<boolean>;\n handleChat: (str: string) => void;\n stopChat: () => void;\n checkSession: (id?: string, isInit?: boolean) => void;\n createSession: () => void;\n deleteSession: (ids: string[]) => Promise<boolean>;\n setSearchStr: (str: string) => void;\n querySessionHistory: (limit?: number) => void;\n}\n\nexport const ChatViewContext = createContext<ChatViewContextProps>(\n {} as ChatViewContextProps\n);\n\nexport const useChatViewContext = (): ChatViewContextProps =>\n useContext(ChatViewContext);\n","import React from \"react\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function MessageListLoading() {\n return <div className=\"message-list-loading-wrapper\"></div>;\n}\n\nexport function ChatItemLoading() {\n return (\n <div className=\"chart-item-loading-wrapper\">\n <div className=\"load\">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n );\n}\n\nexport function CommonLoading() {\n return (\n <div className=\"common-loading-wrapper\">\n <WrappedIcon icon=\"loading\" lib=\"antd\" spinning />\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { useChatViewContext, type Role } from \"../../ChatViewContext.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function Avatar({\n role,\n agentId,\n}: {\n role: Role;\n agentId?: string;\n}): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return !isUser && matchAgent ? (\n <WrappedIcon\n className=\"avatar\"\n {...matchAgent.icon}\n style={{\n color: `var(--theme-${matchAgent.icon.color}-color)`,\n background: `var(--theme-${matchAgent.icon.color}-background)`,\n }}\n />\n ) : (\n <div className={`avatar ${isUser ? \"user\" : \"robot\"}`} />\n );\n}\n","import React from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\ninterface GuideItemProps {\n text: string;\n prompts?: string[];\n}\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function GuideItem({ text, prompts }: GuideItemProps) {\n return (\n <div className=\"guide-item\">\n {text}\n <div className=\"prompts-list\">\n {prompts\n ? prompts.map((item, index) => (\n <WrappedLink key={index}>{item}</WrappedLink>\n ))\n : null}\n </div>\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\n\nexport function ProgressText({ text }: { text: string }): React.ReactNode {\n const renderText = useMemo(() => {\n // 文本末尾存在 \\n ```, 会导致在渲染快结束的时候突然有一个换行,在结束的时候,换行被干掉,导致页面闪动的情况\n // 所以在这里计算,如果文本将要关闭,则默认不然 \\n ``` 显示\n const newText = text.replace(/\\n[`]{0,3}$/, \"\");\n return newText;\n }, [text]);\n\n return <div className=\"progress-text\">{renderText}</div>;\n}\n","import { createContext, useContext } from \"react\";\nimport { MessageItem } from \"../../ChatViewContext\";\n\nexport const MsgItemContext = createContext<MessageItem>({} as MessageItem);\n\nexport const useMsgItemContext = (): MessageItem => useContext(MsgItemContext);\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n lazy,\n} from \"react\";\nimport {\n InstanceApi_postSearchV3,\n InstanceApi_PostSearchV3RequestBody,\n} from \"@next-api-sdk/cmdb-sdk\";\nimport { ChatItemLoading } from \"../../../Loading.js\";\nimport { useMsgItemContext } from \"../../MsgItemContext.js\";\nimport { getBasePath } from \"@next-core/runtime\";\nimport { http } from \"@next-core/http\";\n\nconst TableComponent = lazy(() => import(\"./Table/index.js\"));\nconst ChartComponent = lazy(() => import(\"./Chart/index.js\"));\n\ntype CustomLanguage =\n | \"easy_cmd_cmdb_instance_list\"\n | \"easy_cmd_monitor_dashboard\";\n\ninterface UseFetchDataProps {\n text: string;\n chatting: boolean;\n language: CustomLanguage;\n}\n\nfunction useFetchData({ text, chatting, language }: UseFetchDataProps) {\n const cahceTextRef = useRef<string>(\"\");\n const [isFetching, setIsFetching] = useState<boolean>(false);\n const [isEnd, setIsEnd] = useState<boolean>(false);\n const [isError, setIsError] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [parseData, setParseData] = useState<any>();\n const [data, setData] = useState<any>({});\n\n const requestPromise = useCallback(\n async (data: any) => {\n switch (language) {\n case \"easy_cmd_cmdb_instance_list\":\n return await InstanceApi_postSearchV3(data.objectId, {\n page: 1,\n page_size: 10,\n ...data,\n });\n case \"easy_cmd_monitor_dashboard\":\n return await http.request<any>(\n `${getBasePath()}/api/gateway/logic.data_exchange/api/v1/data_exchange/olap`,\n {\n method: \"POST\",\n body: text,\n }\n );\n }\n },\n [language, text, parseData]\n );\n\n const fetchData = useCallback(\n async (data: any) => {\n if (isFetching) return;\n setIsFetching(true);\n try {\n const response = await requestPromise(data);\n setData(response);\n setIsError(false);\n } catch {\n setIsError(true);\n }\n setIsFetching(false);\n setIsLoading(false);\n },\n [isFetching, requestPromise]\n );\n\n useEffect(() => {\n if (cahceTextRef.current !== text) {\n cahceTextRef.current = text;\n let data: InstanceApi_PostSearchV3RequestBody & { objectId: string };\n try {\n data = JSON.parse(text);\n } catch {\n setIsError(true);\n return;\n }\n setParseData(data);\n fetchData(data);\n }\n }, [text]);\n\n useEffect(() => {\n if (chatting) {\n if (text.match(/\\n[`]{0,3}$/)) {\n setIsEnd(true);\n }\n } else {\n setIsEnd(true);\n }\n }, [text, chatting, isFetching]);\n\n return {\n data,\n parseData,\n isError: isEnd && isError,\n isLoading: isLoading || isFetching,\n };\n}\n\nexport default function CustomComponent({\n text,\n language,\n}: {\n text: string;\n language: CustomLanguage;\n}) {\n const { chatting } = useMsgItemContext();\n\n const { data, parseData, isError, isLoading } = useFetchData({\n text,\n language,\n chatting: !!chatting,\n });\n\n const component = useMemo(() => {\n switch (language) {\n case \"easy_cmd_cmdb_instance_list\":\n return <TableComponent data={data?.list} params={parseData} />;\n case \"easy_cmd_monitor_dashboard\":\n return <ChartComponent data={data?.data} params={parseData} />;\n }\n }, [language, data, parseData]);\n\n return (\n <div className=\"custom-component-wrapper\">\n <div className=\"params\">\n <div className=\"params-tip\">【查询语句】: </div>\n <pre>\n <code>{text}</code>\n </pre>\n </div>\n {isLoading ? (\n <ChatItemLoading />\n ) : isError ? (\n <div className=\"error-tip\">【查询失败】</div>\n ) : (\n <>\n <div className=\"result-tip\">【查询结果】:</div>\n {component}\n </>\n )}\n </div>\n );\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { useNodeViewContext } from \"@prosemirror-adapter/react\";\nimport { ProgressText } from \"./ProgressText.js\";\nimport CustomComponent from \"./CustomComponent.js\";\n\nexport const CodeBlock = () => {\n const [language, setLanguage] = useState(\"\");\n const { contentRef, node } = useNodeViewContext();\n const defaultContent = useMemo(\n () => (\n <pre spellCheck={false}>\n <code ref={contentRef} />\n </pre>\n ),\n [contentRef]\n );\n\n const renderContent = useMemo(() => {\n if (!node.firstChild?.text) return null;\n const text = node.firstChild?.textContent;\n switch (language) {\n case \"easy_cmd_progress\":\n return <ProgressText text={text} />;\n case \"easy_cmd_cmdb_instance_list\":\n case \"easy_cmd_monitor_dashboard\":\n return <CustomComponent text={text} language={language} />;\n default:\n return defaultContent;\n }\n }, [node, language, defaultContent]);\n\n useEffect(() => {\n if (!language) {\n const {\n attrs: { language },\n } = node;\n if (language) {\n setLanguage(language);\n }\n }\n }, [node, language]);\n\n return renderContent;\n};\n","import React, { useEffect } from \"react\";\nimport {\n defaultValueCtx,\n Editor,\n rootCtx,\n editorViewOptionsCtx,\n} from \"@milkdown/core\";\nimport { EditorView } from \"prosemirror-view\";\nimport { Milkdown, useEditor, MilkdownProvider } from \"@milkdown/react\";\nimport { commonmark, codeBlockSchema } from \"@milkdown/preset-commonmark\";\nimport { nord } from \"@milkdown/theme-nord\";\nimport { gfm } from \"@milkdown/preset-gfm\";\nimport { prism } from \"@milkdown/plugin-prism\";\nimport { $view, replaceAll } from \"@milkdown/utils\";\nimport {\n ProsemirrorAdapterProvider,\n useNodeViewFactory,\n} from \"@prosemirror-adapter/react\";\nimport { CodeBlock } from \"./CodeBlock/index.js\";\n\nexport function MarkdownItem({ text }: { text: string }) {\n return (\n <div className=\"markdown-item\">\n <MilkdownProvider>\n <ProsemirrorAdapterProvider>\n <MarkdownDisplay value={text} />\n </ProsemirrorAdapterProvider>\n </MilkdownProvider>\n </div>\n );\n}\n\nfunction hasURLProtocol(url: any) {\n return (\n url.startsWith(\"http://\") ||\n url.startsWith(\"https://\") ||\n url.startsWith(\"file://\") ||\n url.startsWith(\"data:\") ||\n url.startsWith(\"ts://?ts\") ||\n url.startsWith(\"ts:?ts\")\n );\n}\n\nexport function MarkdownDisplay({ value }: { value: string }): React.ReactNode {\n const nodeViewFactory = useNodeViewFactory();\n\n const handleClick = (view: EditorView, pos: number) => {\n const found = view.state.tr.doc.nodeAt(pos);\n\n if (found && found.marks.length > 0) {\n const mark = found.marks.find((m) => m.type.name === \"link\");\n const href = mark?.attrs.href;\n let path: string;\n\n if (hasURLProtocol(href)) {\n path = href;\n } else {\n path = encodeURIComponent(href);\n }\n\n window.open(path, \"_blank\");\n }\n return true;\n };\n\n const { get } = useEditor((root) => {\n return Editor.make()\n .config((ctx) => {\n ctx.set(rootCtx, root);\n ctx.update(editorViewOptionsCtx, (prev: any) => ({\n ...prev,\n editable: () => false,\n handleClickOn: (view: EditorView, pos: number) =>\n handleClick(view, pos),\n }));\n value && ctx.set(defaultValueCtx, value);\n //拦截link的默认点击事件以支持通过新窗口弹出页面,如果后续有其他的定制化需求可以改用custom widget的方式写link widget\n const observer = new MutationObserver(() => {\n const links = Array.from(root.querySelectorAll(\"a\"));\n links.forEach((link) => {\n link.onclick = () => false;\n });\n });\n observer.observe(root, {\n childList: true,\n subtree: true,\n });\n })\n .config(nord)\n .use(prism)\n .use(gfm)\n .use(commonmark)\n .use(\n $view(codeBlockSchema.node, () =>\n nodeViewFactory({ component: CodeBlock })\n )\n );\n }, []);\n\n useEffect(() => {\n if (value !== undefined) {\n get()?.action(replaceAll(value));\n }\n }, [get, value]);\n\n return <Milkdown />;\n}\n","import React from \"react\";\n// import { wrapBrick } from \"@next-core/react-element\";\n// import type {\n// EoNextTable,\n// NextTableComponentProps,\n// } from \"@next-bricks/advanced/next-table\";\n\ninterface MarkdownItemProps {\n text: string;\n}\n\n// const WrappedNextTable = wrapBrick<EoNextTable, NextTableComponentProps>(\n// \"eo-next-table\"\n// );\n\nexport function TableItem({ text }: MarkdownItemProps) {\n // const parseContent = useMemo((): NextTableComponentProps => {\n // let content: NextTableComponentProps;\n // try {\n // content = JSON.parse(text);\n // } catch {\n // content = {} as NextTableComponentProps;\n // }\n // return content;\n // }, [text]);\n\n // return (\n // <div className=\"table-item\">\n // <WrappedNextTable pagination={false} {...parseContent} />\n // </div>\n // );\n return <div className=\"table-item\">{text}</div>;\n}\n","import React from \"react\";\n\ninterface TextItem {\n text: string;\n}\n\nexport function TextItem({ text }: TextItem) {\n return <div className=\"text-item\">{text}</div>;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { copyToClipboard as _copyToClipboard } from \"@next-bricks/basic/data-providers/copy-to-clipboard\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { MessageItem, useChatViewContext } from \"../../ChatViewContext\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport classNames from \"classnames\";\n\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst copyToClipboard = unwrapProvider<typeof _copyToClipboard>(\n \"basic.copy-to-clipboard\"\n);\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\n\nexport function Toolbar({\n role,\n content,\n chatting,\n taskId,\n tag,\n}: MessageItem): React.ReactNode {\n const isAssistant = useMemo(\n () => role === \"assistant\" && content.type !== \"load\",\n [role, content.type]\n );\n const isChattingItem = useMemo(() => chatting, [chatting]);\n const { showLike, readonly, handleIsLike } = useChatViewContext();\n\n const handleCopy = () => {\n copyToClipboard(content.text)\n .then(() => showNotification({ type: \"success\", message: \"复制成功\" }))\n .catch(() => showNotification({ type: \"error\", message: \"复制失败\" }));\n };\n\n const handleLikeOrIsLike = useCallback(\n async (islike: boolean) => {\n const result = await handleIsLike(taskId!, islike);\n showNotification({\n message: `${islike ? \"点赞\" : \"操作\"}${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n },\n [taskId, handleIsLike]\n );\n\n return isAssistant && !isChattingItem ? (\n <div className=\"toolbar\">\n {showLike && !readonly && (\n <>\n <WrappedToolTip content=\"点赞\" hoist>\n <WrapperIcon\n className={classNames(\"like\", {\n active: tag?.isLike === true,\n })}\n lib=\"easyops\"\n icon=\"like\"\n onClick={() => handleLikeOrIsLike(true)}\n />\n </WrappedToolTip>\n <WrappedToolTip content=\"还不够好\" hoist>\n <WrapperIcon\n className={classNames(\"unlike\", {\n active: tag?.isLike === false,\n })}\n lib=\"easyops\"\n icon=\"unlike\"\n onClick={() => handleLikeOrIsLike(false)}\n />\n </WrappedToolTip>\n <div className=\"split\" />\n </>\n )}\n <WrappedToolTip content=\"点击复制\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"copy\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import moment from \"moment\";\nimport React from \"react\";\n\nexport function Time({ time }: { time?: string | number }) {\n return (\n <div className=\"time\">\n {time\n ? typeof time === \"string\"\n ? time\n : moment(time).format(\"YYYY-MM-DD HH:mm:ss\")\n : null}\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { useChatViewContext, type MessageItem } from \"../../ChatViewContext\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function ContentTip({ role, content }: MessageItem): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n\n const { chatting, readonly, setSearchStr } = useChatViewContext();\n\n const handleCopy = () => {\n setSearchStr(content.text);\n };\n\n return !readonly && isUser && !chatting ? (\n <div className=\"content-tip\">\n <WrappedToolTip content=\"点击再次提问\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"edit\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport {\n MessageItem,\n MessageItemContent,\n useChatViewContext,\n} from \"../../ChatViewContext.js\";\nimport { GuideItem } from \"./GuideItem.js\";\nimport { MarkdownItem } from \"./Markdown/index.js\";\nimport { TableItem } from \"./TableItem.js\";\nimport { ChatItemLoading } from \"../Loading.js\";\nimport { TextItem } from \"./TextItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\nimport { Time } from \"./Time.js\";\nimport { ContentTip } from \"./ContentTip.js\";\nimport { MsgItemContext } from \"./MsgItemContext.js\";\n\nconst NOT_AGENT_MATCH = \"no_agent\";\n\nexport function MessageNode(props: MessageItem): React.ReactNode {\n const { content, created, role, agentId } = props;\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const getContentNode = useCallback((content: MessageItemContent) => {\n const { type, text, examplePrompts } = content;\n switch (type) {\n case \"guide\":\n return <GuideItem text={text} prompts={examplePrompts} />;\n case \"text\":\n return <TextItem text={text} />;\n case \"table\":\n return <TableItem text={text} />;\n case \"load\":\n return <ChatItemLoading />;\n case \"markdown\":\n default:\n return <MarkdownItem text={text} />;\n }\n }, []);\n\n const messageNode = useMemo(\n () => getContentNode(content),\n [content, getContentNode]\n );\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return (\n <MsgItemContext.Provider value={props}>\n <div className=\"message-box\">\n <div className=\"message-top\">\n {isUser\n ? \"我\"\n : !agentId || agentId === NOT_AGENT_MATCH || !matchAgent\n ? \"AI助手\"\n : matchAgent.name}\n <Time time={created} />\n </div>\n <div className=\"message-content\">\n <div className=\"wrapper\">\n <div className=\"content\">{messageNode}</div>\n\n <ContentTip {...props} />\n <Toolbar {...props} />\n </div>\n </div>\n </div>\n </MsgItemContext.Provider>\n );\n}\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useChatViewContext } from \"../../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport interface AgentDetailItem {\n name: string;\n description: string;\n icon: GeneralIconProps & { color: string };\n starterPrompts?: string[];\n instanceId: string;\n id: string;\n [key: string]: any;\n}\n\nconst CARD_ITEM_HEIGHT = 85;\nconst HEIGHT_GAP = 24;\n\nfunction QuickAnswerCardItem({\n name,\n description,\n icon,\n starterPrompts,\n}: AgentDetailItem) {\n const { setSearchStr } = useChatViewContext();\n\n const handleCardClick = () => {\n starterPrompts?.length && setSearchStr(starterPrompts[0]);\n };\n\n const iconColor = useMemo(() => icon?.color ?? \"geekblue\", [icon]);\n\n return (\n <div\n className=\"quick-answer-card-item\"\n style={{\n height: CARD_ITEM_HEIGHT,\n background: `linear-gradient(rgba(var(--theme-${iconColor}-color-rgb-channel), 0.1), rgba(var(--theme-${iconColor}-color-rgb-channel), 0.08))`,\n }}\n onClick={handleCardClick}\n >\n <div className=\"left\">\n <WrappedIcon\n className=\"icon\"\n {...(icon ?? {\n icon: \"default-app\",\n lib: \"easyops\",\n category: \"app\",\n })}\n style={{\n background: `rgba(var(--theme-${iconColor}-color-rgb-channel), 0.5)`,\n }}\n />\n </div>\n <div className=\"content\">\n <div className=\"title\">{name}</div>\n <div className=\"description\">{description}</div>\n </div>\n </div>\n );\n}\n\nexport function QuickAnswerList() {\n const { quickAnswerConfig, msgList, loading } = useChatViewContext();\n const [showMoreBtn, setShowMoreBtn] = useState<boolean>(false);\n const listRef = useRef<HTMLDivElement>(null);\n const hadClickShowMoreBtn = useRef<boolean>(false);\n\n const handleShowMoreClick = () => {\n hadClickShowMoreBtn.current = true;\n setShowMoreBtn(false);\n };\n\n useEffect(() => {\n const element = listRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (\n entry.contentRect.height >\n CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2\n ) {\n if (!hadClickShowMoreBtn.current) {\n setShowMoreBtn(true);\n }\n } else {\n setShowMoreBtn(false);\n }\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [showMoreBtn, quickAnswerConfig?.list]);\n\n return quickAnswerConfig?.list.length && msgList.length === 0 && !loading ? (\n <div className=\"quick-answer-wrapper\">\n <div className=\"tip\">\n {quickAnswerConfig.tip ??\n \"你好,我是运维数智人 — Murphy,我能为你提供以下服务:\"}\n </div>\n <div\n className=\"quick-answer-list\"\n style={{\n ...(showMoreBtn\n ? {\n maxHeight: CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2 + 10,\n overflow: \"hidden\",\n }\n : {}),\n }}\n ref={listRef}\n >\n {quickAnswerConfig.list.map((item) => (\n <QuickAnswerCardItem key={item.instanceId} {...item} />\n ))}\n </div>\n {showMoreBtn ? (\n <div className=\"show-more-wrapper\">\n <WrappedLink\n icon={{\n lib: \"antd\",\n icon: \"down\",\n }}\n className=\"show-more-btn\"\n onClick={handleShowMoreClick}\n >\n 显示更多\n </WrappedLink>\n </div>\n ) : null}\n </div>\n ) : null;\n}\n","import React from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function StopBtn() {\n const { stopChat } = useChatViewContext();\n\n const handleStopChat = () => {\n stopChat();\n };\n return (\n <div className=\"stop-responding-wrapper\">\n <WrappedLink className=\"stop-btn\" onClick={handleStopChat}>\n 停止生成\n </WrappedLink>\n </div>\n );\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { MessageItem, useChatViewContext } from \"../ChatViewContext\";\nimport { Avatar } from \"./MessageItem/Avatar.js\";\nimport classNames from \"classnames\";\nimport { CommonLoading, MessageListLoading } from \"./Loading.js\";\nimport { MessageNode } from \"./MessageItem/index.js\";\nimport { QuickAnswerList } from \"./QuickAnswerList/index.js\";\nimport { debounce } from \"lodash\";\nimport { StopBtn } from \"./StopBtn.js\";\n\ninterface MessageListProps {\n showAvatar?: boolean;\n}\n\nconst DEFAULT_OFFSET_HEIGHT = 80;\nconst CACHE_HEIGHT = 200;\n\nexport function MessageList({\n showAvatar = true,\n}: MessageListProps): React.ReactNode {\n const chatViewRef = useRef<HTMLDivElement>(null);\n const messgetListBoxRef = useRef<HTMLDivElement>(null);\n const [preHeight, setPreHeight] = useState<number>(0);\n const isCustomScroll = useRef<boolean>(false);\n\n const {\n msgLoading,\n msgEnd,\n msgList,\n loading,\n activeSessionId,\n chatting,\n checkSession,\n } = useChatViewContext();\n\n const getMsgItemNode = useCallback(\n (item: MessageItem, index: number = 0) => {\n return (\n <div\n className={classNames(\"message-item\", { user: item.role === \"user\" })}\n key={index}\n >\n {showAvatar && <Avatar role={item.role} agentId={item.agentId} />}\n <MessageNode {...item} />\n </div>\n );\n },\n [showAvatar]\n );\n\n const msgListNode = useMemo(() => {\n return msgList.map((item, index) => {\n if (item.chatting) {\n return (\n <>\n {getMsgItemNode(item, index)}\n {chatting && index === msgList.length - 1 ? <StopBtn /> : null}\n </>\n );\n } else {\n return getMsgItemNode(item, index);\n }\n });\n }, [msgList, chatting, getMsgItemNode]);\n\n const handleScroll = useCallback(() => {\n const messageList = chatViewRef.current;\n if (messageList) {\n const { scrollHeight, clientHeight, scrollTop } = messageList;\n // 滚动到底部所需的高度 = 总高度 - 视图高度\n const isBottom = scrollHeight - clientHeight === scrollTop;\n if (!isBottom) {\n isCustomScroll.current = true;\n } else if (isBottom && isCustomScroll.current) {\n // 自动吸低\n isCustomScroll.current = false;\n }\n if (\n !msgLoading &&\n !msgEnd &&\n scrollTop < CACHE_HEIGHT &&\n activeSessionId\n ) {\n checkSession();\n }\n }\n }, [msgEnd, msgLoading, activeSessionId, checkSession]);\n\n const debounceHandleScroll = debounce(handleScroll, 200);\n\n useEffect(() => {\n if (chatting || activeSessionId) {\n // 聊天或者会话变更时,重置滚动状态\n isCustomScroll.current = false;\n }\n }, [chatting, activeSessionId]);\n\n useEffect(() => {\n const element = messgetListBoxRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n let newHeight: number = 0;\n // 如果存在用户行为,不触发自动滚动行为\n if (isCustomScroll.current) return;\n for (const entry of entries) {\n newHeight = entry.contentRect.height - DEFAULT_OFFSET_HEIGHT;\n }\n if (!loading && !chatting) {\n // 高度变化,代表消息新增,自动滚动到最下\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n }\n if (newHeight > preHeight && chatting) {\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n setPreHeight(Math.max(preHeight, newHeight));\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [chatting, loading, preHeight]);\n\n return (\n <div\n className=\"chat-view\"\n ref={chatViewRef}\n onScroll={debounceHandleScroll}\n >\n <div className=\"message-list\">\n <div className=\"message-list-box\" ref={messgetListBoxRef}>\n {msgEnd && msgList.length ? (\n <div className=\"message-start-tip\">会话开始</div>\n ) : null}\n {msgLoading && <CommonLoading />}\n <QuickAnswerList />\n {msgListNode}\n </div>\n {loading && <MessageListLoading />}\n </div>\n </div>\n );\n}\n","const HIDDEN_TEXTAREA_STYLE = `\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n padding: 10px !important;\n pointer-events: none !important;\n`;\n\nconst SIZING_STYLE = [\n \"letter-spacing\",\n \"line-height\",\n \"padding-top\",\n \"padding-bottom\",\n \"font-family\",\n \"font-weight\",\n \"font-size\",\n \"font-variant\",\n \"text-rendering\",\n \"text-transform\",\n \"width\",\n \"text-indent\",\n \"padding-left\",\n \"padding-right\",\n \"border-width\",\n \"box-sizing\",\n \"word-break\",\n \"white-space\",\n];\nlet hiddenTextarea: HTMLTextAreaElement;\n\n/**\n * 计算 textare 高度\n * https://github.com/react-component/textarea/blob/1c0026fbe30e5f7dff1fca695b2cf262246381ca/src/calculateNodeHeight.tsx\n * */\nexport default function calculateAutoSizeStyle(\n uiTextNode: HTMLTextAreaElement,\n minRows: number | null = null,\n maxRows: number | null = null\n): React.CSSProperties {\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement(\"textarea\");\n hiddenTextarea.setAttribute(\"tab-index\", \"-1\");\n hiddenTextarea.setAttribute(\"aria-hidden\", \"true\");\n document.body.appendChild(hiddenTextarea);\n }\n\n const uiTextNodeStyle = window.getComputedStyle(uiTextNode);\n const sizingStyle = SIZING_STYLE.map(\n (name) => `${name}:${uiTextNodeStyle.getPropertyValue(name)}`\n ).join(\";\");\n\n // equal style\n hiddenTextarea.setAttribute(\n \"style\",\n `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`\n );\n hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || \"\";\n\n let minHeight: number | undefined = undefined;\n let maxHeight: number | undefined = undefined;\n // let overflowY: any;\n\n const borderSize = 2;\n const paddingSize = 20;\n let height = hiddenTextarea.scrollHeight - paddingSize + borderSize;\n\n if (minRows !== null || maxRows !== null) {\n // measure height of a textarea with a single row\n hiddenTextarea.value = \" \";\n const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;\n if (minRows !== null) {\n minHeight = singleRowHeight * minRows - paddingSize + borderSize;\n height = Math.max(paddingSize, height);\n }\n if (maxRows !== null) {\n maxHeight = singleRowHeight * maxRows - paddingSize + borderSize;\n // overflowY = height > maxHeight ? \"\" : \"hidden\";\n height = Math.min(maxHeight, height);\n }\n }\n\n const style: React.CSSProperties = {\n height,\n overflowY: \"scroll\",\n resize: \"none\",\n };\n\n if (minHeight) {\n style.minHeight = minHeight;\n }\n if (maxHeight) {\n style.maxHeight = maxHeight;\n }\n\n return style;\n}\n","import React, {\n ChangeEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport calculateAutoSizeStyle from \"./utils/calculateAutoSizeStyle.js\";\nimport classNames from \"classnames\";\nimport { useChatViewContext } from \"../ChatViewContext.js\";\nimport { AgentDetailItem } from \"./QuickAnswerList/index\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nconst PREFIX_WORD = \"@\";\n\nexport function SearchInput(): React.ReactNode {\n const [value, setValue] = useState<string>(\"\");\n const [active, setActive] = useState<boolean>(false);\n const [expand, setExpand] = useState<boolean>(false);\n const [autoSizeStyle, setAutoSizeStyle] = useState<React.CSSProperties>();\n const [isFillContent, setIsFillContent] = useState<boolean>(false);\n\n // mention\n const [mentionOpen, setMentionOpen] = useState<boolean>(false);\n const [matchPrefixIndex, setMatchPrefixIndex] = useState<number>(-1);\n const [matchAgentList, setMatchMentionList] = useState<AgentDetailItem[]>([]);\n const [matchMentionsIndex, setMatchMentionsIndex] = useState<number>(0);\n\n const mentionsRef = useRef<HTMLDivElement>(null);\n const searchInputBoxRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const hadExpanded = useRef<boolean>(false);\n const inputEndRef = useRef<boolean>(false);\n\n const {\n chatting,\n loading,\n searchStr,\n quickAnswerConfig,\n createSession,\n setSearchStr,\n handleChat,\n setAgent,\n } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const hadValue = useMemo(() => !!value, [value]);\n const defaultSize = useMemo(() => [1, 5], []);\n const disabled = useMemo(() => loading || chatting, [chatting, loading]);\n\n const matchPrefixInfo = useMemo(() => {\n const textareaElement = textareaRef.current!;\n if (matchPrefixIndex >= 0 && value) {\n const currentFocusIndex = textareaElement.selectionStart;\n let matchWord = \"\";\n for (let i = matchPrefixIndex + 1; i < currentFocusIndex; i++) {\n // 匹配中文英文数字\n if (/[\\u4e00-\\u9fa5]|\\w|\\d/.test(value[i]) || inputEndRef.current) {\n matchWord = matchWord + value[i];\n } else {\n setMatchPrefixIndex(-1);\n return false;\n }\n }\n return {\n start: matchPrefixIndex + 1,\n end: currentFocusIndex,\n word: matchWord,\n };\n }\n return false;\n }, [matchPrefixIndex, value]);\n\n const handleAgentItemSelect = useCallback(\n (item: AgentDetailItem) => {\n if (matchPrefixInfo) {\n const { start, end } = matchPrefixInfo;\n const valueList = value.split(\"\");\n const trimName = item.name.replace(/\\s+/g, \"\") + \" \";\n const focusIndex = start + trimName.length;\n valueList.splice(start, end - start, trimName);\n setValue(valueList.join(\"\"));\n setMatchPrefixIndex(-1);\n\n setTimeout(() => {\n textareaRef.current!.selectionStart = focusIndex;\n textareaRef.current!.selectionEnd = focusIndex;\n textareaRef.current!.focus();\n }, 0);\n }\n },\n [matchPrefixInfo, value]\n );\n\n const isShowMentions = useMemo(() => {\n return matchAgentList.length && mentionOpen;\n }, [matchAgentList, mentionOpen]);\n\n const mentions = useMemo(() => {\n return isShowMentions ? (\n <div className=\"mentions-list-wrapper\" ref={mentionsRef}>\n <div className=\"content\">\n <div className=\"mentions-title\">Agents</div>\n <div className=\"mentions-list\">\n {matchAgentList.slice(0, 10).map((item, index) => {\n return (\n <div\n className={classNames(\"mentions-item\", {\n active: index === matchMentionsIndex,\n })}\n key={index}\n onClick={() => handleAgentItemSelect(item)}\n >\n <WrappedIcon\n className=\"icon\"\n {...item.icon}\n style={{\n color: `var(--theme-${item.icon.color}-color)`,\n background: `var(--theme-${item.icon.color}-background)`,\n }}\n />\n <div className=\"name\">{item.name}</div>\n <div className=\"description\">{item.description}</div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n ) : null;\n }, [\n matchAgentList,\n matchMentionsIndex,\n isShowMentions,\n handleAgentItemSelect,\n ]);\n\n const computedAutoSize = useCallback(\n (size = defaultSize) => {\n if (hadExpanded.current && expand) return;\n const textareaElement = textareaRef.current as HTMLTextAreaElement;\n if (textareaElement) {\n const textareaStyles = calculateAutoSizeStyle(\n textareaElement,\n size[0],\n size[1]\n );\n\n setAutoSizeStyle(textareaStyles);\n }\n hadExpanded.current = expand;\n },\n [defaultSize, expand]\n );\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLTextAreaElement> | string): void => {\n const value = typeof e === \"string\" ? e : e.target.value;\n setValue(value);\n textareaRef.current!.value = value;\n },\n []\n );\n\n const handleCompositionStart = () => {\n inputEndRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n inputEndRef.current = false;\n };\n\n const hanldeCreateSession = () => {\n createSession();\n };\n\n const handleExpand = useCallback(() => {\n setExpand((value) => {\n return !value;\n });\n }, []);\n\n const matchFirstAgent = useCallback(\n (value: string) => {\n const regex = /@([\\u4e00-\\u9fa5|\\w|\\d]+)/g;\n\n // 在字符串中循环匹配正则表达式\n let match: RegExpExecArray | null;\n while ((match = regex.exec(value)) !== null) {\n if (match) {\n const agent = agentList?.find(\n (item) => item.name.replace(/\\s+/g, \"\") === match![1]\n );\n agent && setAgent(agent.id);\n if (agent) break;\n }\n }\n },\n [agentList, setAgent]\n );\n\n const handleSubmit = useCallback(() => {\n if (!hadValue || !textareaRef.current || disabled) return;\n\n matchFirstAgent(value);\n handleChat(value);\n\n setActive(false);\n setExpand(false);\n handleChange(\"\");\n textareaRef.current.blur();\n }, [value, hadValue, disabled, handleChat, handleChange, matchFirstAgent]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey && !inputEndRef.current) {\n e.preventDefault();\n if (isShowMentions) {\n handleAgentItemSelect(matchAgentList[matchMentionsIndex]);\n } else {\n handleSubmit();\n }\n }\n if (isShowMentions) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setMatchMentionsIndex((index) => Math.max(0, index - 1));\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setMatchMentionsIndex((index) =>\n Math.min(matchAgentList.length - 1, index + 1)\n );\n }\n }\n },\n [\n handleSubmit,\n handleAgentItemSelect,\n isShowMentions,\n matchAgentList,\n matchMentionsIndex,\n ]\n );\n\n const handleKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n const textareaElement = textareaRef.current!;\n\n const selectionIndex = textareaElement.selectionStart;\n const prefixWord = textareaElement.value[selectionIndex - 1];\n const beforeSelectionText = textareaElement.value.slice(\n 0,\n selectionIndex\n );\n const index = beforeSelectionText.lastIndexOf(PREFIX_WORD);\n\n if (\n e.key === \"Escape\" ||\n (!isShowMentions &&\n [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"].indexOf(e.key) !==\n -1)\n ) {\n setMatchPrefixIndex(-1);\n return;\n }\n\n if (prefixWord === PREFIX_WORD) {\n setMatchPrefixIndex(selectionIndex - 1);\n } else {\n setMatchPrefixIndex(index);\n }\n },\n [isShowMentions]\n );\n\n useEffect(() => {\n if (searchStr) {\n handleChange(searchStr.trim());\n textareaRef.current?.focus();\n setSearchStr(\"\");\n }\n }, [searchStr, disabled, setSearchStr, handleChange]);\n\n useEffect(() => {\n computedAutoSize(expand ? [20, 20] : undefined);\n }, [value, expand, computedAutoSize]);\n\n useEffect(() => {\n const searchInputBox = searchInputBoxRef.current;\n if (searchInputBox) {\n const observe = new ResizeObserver(() => {\n const { width: currentWidth } = searchInputBox.getBoundingClientRect();\n const FIT_CONTENT_WIDTH = 900;\n\n setIsFillContent(currentWidth < FIT_CONTENT_WIDTH);\n });\n\n observe.observe(searchInputBox);\n\n return () => {\n observe.disconnect();\n };\n }\n }, []);\n\n useEffect(() => {\n if (!chatting && textareaRef.current) {\n textareaRef.current?.focus();\n }\n }, [chatting]);\n\n useEffect(() => {\n if (agentList?.length && matchPrefixInfo) {\n const filterList =\n matchPrefixInfo.word === \"\"\n ? agentList\n : agentList.filter((item) =>\n item.name.includes(matchPrefixInfo.word)\n );\n\n setMatchMentionList(filterList);\n setMatchMentionsIndex(0);\n setMentionOpen(true);\n } else {\n setMatchMentionList([]);\n setMentionOpen(false);\n }\n }, [matchPrefixInfo, agentList]);\n\n useEffect(() => {\n if (matchMentionsIndex >= 0 && mentionsRef.current) {\n const element = mentionsRef.current.querySelector(\n \".mentions-item.active\"\n );\n element?.scrollIntoView({ block: \"nearest\" });\n }\n }, [matchMentionsIndex]);\n\n useEffect(() => {\n const handleDocumentClick = (e: any) => {\n const mentionsElemnt = mentionsRef.current;\n if (mentionsElemnt && !mentionsElemnt.contains(e.composedPath()[0])) {\n setMentionOpen(false);\n }\n };\n\n document.addEventListener(\"click\", handleDocumentClick);\n\n return () => {\n document.removeEventListener(\"click\", handleDocumentClick);\n };\n }, []);\n\n return (\n <div\n className={classNames(\"search-input-box\", {\n \"fill-content\": isFillContent,\n })}\n ref={searchInputBoxRef}\n >\n {mentions}\n <div\n className={classNames(\"input-box\", {\n active,\n disabled,\n expand,\n })}\n >\n <textarea\n value={value}\n ref={textareaRef}\n style={{\n ...autoSizeStyle,\n paddingRight: expand ? \"50px\" : \"140px\",\n }}\n placeholder={chatting ? \"回复中,请稍等...\" : \"提出你的想法...\"}\n onFocus={() => setActive(true)}\n onBlur={() => setActive(false)}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onKeyUpCapture={handleKeyUp}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n />\n <span className=\"suffix-icon\">\n <WrappedToolTip content=\"新增会话\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"plus-circle\"\n onClick={hanldeCreateSession}\n />\n </WrappedToolTip>\n {!expand && (\n <WrappedToolTip content=\"放大\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"arrows-alt\"\n onClick={handleExpand}\n />\n </WrappedToolTip>\n )}\n <div className=\"submit-split\"></div>\n <WrappedToolTip content=\"提交\">\n <WrappedIcon\n className={classNames(\"submit-btn\", {\n active: hadValue,\n disabled: !hadValue || disabled,\n })}\n lib={chatting ? \"antd\" : \"easyops\"}\n icon={chatting ? \"loading\" : \"release-management-fill\"}\n category={chatting ? \"\" : \"menu\"}\n spinning={chatting}\n onClick={handleSubmit}\n />\n </WrappedToolTip>\n </span>\n <span className=\"toolbar-icon\">\n {expand && (\n <WrappedToolTip content=\"缩小\">\n <WrappedIcon lib=\"antd\" icon=\"shrink\" onClick={handleExpand} />\n </WrappedToolTip>\n )}\n </span>\n </div>\n {hadValue && (\n <div className=\"search-input-toolbar\">\n <div className=\"input-tip\">Shift + Enter 换行</div>\n </div>\n )}\n </div>\n );\n}\n","import React, { useCallback, useEffect, useRef } from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport classNames from \"classnames\";\nimport { debounce } from \"lodash\";\nimport { SessionItem as SessionItemProps } from \"../ChatService\";\nimport { CommonLoading } from \"./Loading.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport type { showDialog as _showDialog } from \"@next-bricks/basic/data-providers/show-dialog/show-dialog\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\n\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst showDialog = unwrapProvider<typeof _showDialog>(\"basic.show-dialog\");\n\nconst SESSION_ITEM_HEIGHT = 42;\nconst BUFFER_NUMBER = 5;\nconst CACHE_HEIGHT = 100;\n\nexport function SessionList(): React.ReactNode {\n const { sessionEnd, sessionLoading, sessionList, querySessionHistory } =\n useChatViewContext();\n const sessionWrapperRef = useRef<HTMLDivElement>(null);\n const sessionListRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // 计算视图内可以展示多少条会话历史数据\n let limit = 20;\n const sessionWrapper = sessionWrapperRef.current;\n if (sessionWrapper) {\n // limit = 视图高度 % 单条高度 + 缓冲长度\n limit =\n Math.floor(sessionWrapper.clientHeight / SESSION_ITEM_HEIGHT) +\n BUFFER_NUMBER;\n }\n querySessionHistory(limit);\n }, []);\n\n const checkSessionList = useCallback(() => {\n if (sessionLoading || sessionEnd) return;\n const sessionList = sessionListRef.current;\n if (sessionList) {\n const { scrollTop, scrollHeight, clientHeight } = sessionList;\n // 如果滚动的高度 + 视图高度 + 缓冲高度 > 视图的滚动高度,请求新的数据\n if (scrollTop + clientHeight + CACHE_HEIGHT > scrollHeight) {\n querySessionHistory();\n }\n }\n }, [querySessionHistory, sessionLoading, sessionEnd]);\n\n const handleScroll = debounce(checkSessionList, 200);\n\n return (\n <div className=\"session-list-wrapper\" ref={sessionWrapperRef}>\n <div className=\"session-title\">历史对话</div>\n <div\n className=\"session-list\"\n ref={sessionListRef}\n onScroll={handleScroll}\n >\n {sessionList.map((item, index) => {\n return <SessionItem key={index} {...item} />;\n })}\n {sessionLoading && <CommonLoading />}\n {/* {sessionEnd && <div className=\"session-end-tip\">到底啦</div>} */}\n </div>\n </div>\n );\n}\n\nfunction SessionItem({ title, conversationId }: SessionItemProps) {\n const { activeSessionId, checkSession, deleteSession } = useChatViewContext();\n\n const handleCheckSession = useCallback(() => {\n checkSession(conversationId, true);\n }, [conversationId, checkSession]);\n\n const handleDeleteSession = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n showDialog({\n type: \"confirm\",\n title: \"会话删除确认\",\n content: `请输入 {{ expect }} 以确认删除`,\n expect: title.replace(/\\s+/g, \"\"),\n }).then(async () => {\n const result = await deleteSession([conversationId]);\n showNotification({\n message: `删除会话${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n });\n },\n [conversationId, deleteSession, title]\n );\n\n return (\n <div\n key={title}\n className={classNames(\"session-item\", {\n active: conversationId === activeSessionId,\n })}\n onClick={handleCheckSession}\n >\n <div className=\"content\">\n <div className=\"title\" title={title}>\n {title}\n </div>\n </div>\n\n <div className=\"session-close-btn\" onClick={handleDeleteSession}>\n <WrappedIcon icon=\"close\" lib=\"antd\" />\n </div>\n </div>\n );\n}\n","import { fetchEventSource } from \"@microsoft/fetch-event-source\";\nimport { http } from \"@next-core/http\";\nimport { getBasePath } from \"@next-core/runtime\";\nimport moment from \"moment\";\n\nexport interface SSEMessageItem {\n conversationId?: string;\n created: number | string;\n delta: {\n content: string;\n role: string;\n };\n taskId?: string;\n agentId?: string;\n}\n\nexport interface QueueItem {\n topic: string;\n message?: SSEMessageItem;\n}\n\nexport interface SessionItem {\n conversationId: string;\n isDelete: boolean;\n time: number;\n title: string;\n user: string;\n _row_id: string;\n}\n\nexport interface ChatItem {\n agentId: string;\n conversationId: string;\n input: string;\n output: string;\n taskId: string;\n time: number;\n inputTime: number;\n user: string;\n _row_id: string;\n tag: {\n isLike?: boolean;\n };\n}\n\nexport class ChatService {\n #debug: boolean;\n #ctrl?: AbortController;\n #agentId: string;\n #enterInterval: number;\n #charting = false;\n #isStartEmitEvent = false;\n #emitTimer: NodeJS.Timeout | undefined;\n #messageQueue: Array<QueueItem> = [];\n #subscribers: Record<string, Array<(msg?: SSEMessageItem) => void>> = {};\n #conversationId?: string;\n\n // 会话\n #sessionNextToken?: string;\n #cacheLimit?: number;\n\n // 消息\n #messageNextToken?: string;\n\n constructor({\n agentId,\n enterInterval = 50,\n debug = false,\n }: {\n agentId: string;\n enterInterval: number;\n debug: boolean;\n }) {\n this.#agentId = agentId;\n this.#enterInterval = enterInterval;\n this.#debug = debug;\n }\n\n enqueue(data: QueueItem) {\n this.#messageQueue.push(data);\n this.#startEmitEvent();\n }\n\n dequeue() {\n return this.#messageQueue.shift();\n }\n\n #clear() {\n this.#messageQueue.length = 0;\n }\n\n getMessageQueue() {\n return this.#messageQueue;\n }\n\n subscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (!this.#subscribers[topic]) {\n this.#subscribers[topic] = [];\n }\n this.#subscribers[topic].push(callback);\n }\n\n unsubscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (this.#subscribers[topic]) {\n this.#subscribers[topic] = this.#subscribers[topic].filter(\n (cb) => cb !== callback\n );\n }\n }\n\n notifySubscribers(data: QueueItem) {\n const topic = data.topic;\n if (this.#subscribers[topic]) {\n this.#subscribers[topic].forEach((callback) => {\n callback(data?.message);\n });\n }\n }\n\n async setChatItemIsLike(id: string, isLike: boolean): Promise<boolean> {\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.CommentDialogue/conversation/comment`,\n {\n method: \"POST\",\n body: JSON.stringify({\n taskId: id,\n isLike,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n setAgentId(id: string) {\n this.#agentId = id;\n }\n\n setConversationId(id?: string) {\n this.#conversationId = id;\n }\n\n async getSessionHistory(limit?: number): Promise<SessionItem[]> {\n if (limit) {\n this.#cacheLimit = limit;\n }\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: SessionItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.ListConversation/conversation/list`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: this.#cacheLimit ?? 20,\n next_token: this.#sessionNextToken,\n }),\n }\n );\n this.#sessionNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"session.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取会话历史失败\");\n }\n return [];\n }\n\n async getChatHistory(id?: string): Promise<ChatItem[]> {\n if (id) {\n this.setConversationId(id);\n this.#messageNextToken = \"\";\n }\n if (!this.#conversationId) return [];\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: ChatItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.GetAllDialogue/conversation/get/${this.#conversationId}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: 15,\n next_token: this.#messageNextToken,\n }),\n }\n );\n this.#messageNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"message.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取消息历史失败\");\n }\n return [];\n }\n\n async deleteSession(id: string[]): Promise<boolean> {\n if (!id.length) return false;\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.DeleteConversation/conversation/delete`,\n {\n method: \"POST\",\n body: JSON.stringify({\n conversationIds: id,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n splitWord(str: string) {\n if (!str) return [];\n // 单词长度小于 5 直接返回, 否则做单词分割处理\n if (str?.length < 5) return [str];\n const list = [];\n\n if (window.Intl) {\n const segmenterFr = new Intl.Segmenter(\"zh-Hans-CN\", {\n granularity: \"word\",\n });\n const iterator = segmenterFr.segment(str)[Symbol.iterator]();\n\n let nextWord = iterator.next();\n while (!nextWord.done) {\n list.push(nextWord.value.segment);\n nextWord = iterator.next();\n }\n } else {\n const customSplit = {\n [Symbol.split](str: string) {\n let pos = 0;\n const result = [];\n let cache = \"\";\n while (pos < str.length) {\n const matchStr = str.substring(pos, pos + 1);\n // 如果是中文,单个输出\n if (/[\\u4e00-\\u9fa5]/.test(matchStr)) {\n result.push(cache + matchStr);\n cache = \"\";\n } else {\n // 否则,遇到空格或者标点符号再分词\n if (!/\\s|[,。;《》?!,.:<>?!]]/.test(matchStr)) {\n cache = cache + matchStr;\n } else {\n result.push(cache + matchStr);\n cache = \"\";\n }\n }\n pos++;\n }\n if (cache) result.push(cache);\n return result;\n },\n };\n\n str.split(customSplit).forEach((word) => {\n list.push(word);\n });\n }\n\n return list;\n }\n\n async chat(str: string): Promise<void> {\n this.#ctrl = new AbortController();\n let hadMatchMessage = false;\n this.#charting = true;\n await fetchEventSource(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.manage.LLMChatProxy@1.0.0/api/aiops_chat/v1/chat/completions`,\n {\n method: \"POST\",\n signal: this.#ctrl.signal,\n body: JSON.stringify({\n agentId: this.#agentId,\n conversationId: this.#conversationId,\n input: str,\n stream: true,\n config: {\n debug: this.#debug,\n },\n }),\n headers: {\n \"giraffe-contract-name\": \"easyops.api.aiops_chat.manage.LLMChatProxy\",\n },\n onopen: async (response) => {\n if (response.ok) {\n // eslint-disable-next-line no-console\n console.log(\"open sse service success!\");\n } else {\n // eslint-disable-next-line no-console\n console.log(\"open sse service fail!\");\n }\n },\n onmessage: (msg) => {\n const { data } = msg;\n hadMatchMessage = true;\n if (data === \"[DONE]\") {\n this.#ctrl!.abort();\n return;\n }\n let result = {} as SSEMessageItem;\n try {\n result = JSON.parse(data);\n } catch {\n this.enqueue({\n topic: \"add\",\n message: {\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n delta: {\n role: \"assistant\",\n content: `\\`【数据格式错误】:\\` ${data}`,\n },\n agentId: this.#agentId,\n },\n });\n return;\n }\n if (!this.#conversationId) {\n this.setConversationId(result.conversationId);\n }\n const wordList = this.splitWord(result.delta.content);\n wordList.forEach((word) => {\n this.enqueue({\n topic: \"add\",\n message: {\n ...result,\n delta: {\n role: \"assistant\",\n content: word,\n },\n },\n });\n });\n },\n onclose: () => {\n // eslint-disable-next-line no-console\n console.log(\"close\");\n // 兜底逻辑,连接结束,并且没有数据返回\n if (!hadMatchMessage) {\n this.enqueue({\n topic: \"add\",\n message: {\n delta: {\n role: \"assistant\",\n content: \"`无法识别`\",\n },\n agentId: this.#agentId,\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n });\n }\n this.#ctrl!.abort();\n },\n onerror: (err) => {\n // eslint-disable-next-line no-console\n console.log(\"err\", err);\n this.#ctrl!.abort();\n },\n }\n );\n\n this.#charting = false;\n }\n\n stop() {\n clearInterval(this.#emitTimer);\n this.#ctrl && this.#ctrl?.abort();\n this.#charting = false;\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.#clear();\n this.notifySubscribers({ topic: \"stop\" });\n }\n\n #startEmitEvent() {\n if (this.#isStartEmitEvent) return;\n this.#isStartEmitEvent = true;\n // 轮训队列,每隔 #enterInterval(默认 50ms) 推出第一条数据,获取到 text,推送给组件,组件接受后进行渲染\n // 直到聊天结束,并且消息队列数据为空时,停止 emit\n this.#emitTimer = setInterval(() => {\n if (this.#charting || this.getMessageQueue().length) {\n const messageItem = this.dequeue()!;\n messageItem && this.notifySubscribers(messageItem);\n } else {\n clearInterval(this.#emitTimer);\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.notifySubscribers({ topic: \"finish\" });\n }\n }, this.#enterInterval);\n }\n}\n\n// export const chartService = new ChatService();\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { MessageItem } from \"../ChatViewContext.js\";\nimport moment from \"moment\";\nimport {\n ChatItem,\n ChatService,\n SessionItem,\n SSEMessageItem,\n} from \"../ChatService.js\";\n\nconst NEW_SESSION_ID = \"new_session_id\";\n\nexport function useChatViewInfo({\n agentId,\n sessionId,\n enterInterval = 50,\n debug,\n}: {\n agentId: string;\n sessionId?: string;\n enterInterval?: number;\n debug: boolean;\n}) {\n const [sessionEnd, setSessionEnd] = useState<boolean>(false);\n const [sessionLoading, setSessionLoading] = useState<boolean>(false);\n const [activeSessionId, setActiveSessionId] = useState<string>();\n const [loading, setLoading] = useState<boolean>(false);\n const [chatting, setChatting] = useState<boolean>(false);\n const [sessionList, setSessionList] = useState<SessionItem[]>([]);\n\n const [msgLoading, setMsgLoading] = useState<boolean>(false);\n const [msgEnd, setMsgEnd] = useState<boolean>(false);\n const [msgList, setMsgList] = useState<MessageItem[]>([]);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const chatingText = useRef<string>(\"\");\n const chatingMessageItem = useRef<MessageItem>();\n const chatService = useMemo(\n () =>\n new ChatService({\n agentId,\n enterInterval,\n debug,\n }),\n [agentId, enterInterval, debug]\n );\n\n const defaultNewSessionItem = useMemo(\n () =>\n ({\n conversationId: NEW_SESSION_ID,\n title: \"新建会话\",\n }) as SessionItem,\n []\n );\n\n const stopChat = useCallback(() => {\n chatService.stop();\n }, [chatService]);\n\n const setAgent = useCallback(\n (id: string) => {\n chatService.setAgentId(id);\n },\n [chatService]\n );\n\n const checkSession = useCallback(\n async (id?: string, isInit = false) => {\n if (isInit && id) {\n // 切换聊天,重制状态\n setMsgEnd(false);\n setMsgLoading(false);\n setLoading(true);\n setMsgList([]);\n setActiveSessionId(id);\n if (chatting) {\n stopChat();\n }\n } else {\n setMsgLoading(true);\n }\n // 如果是新建会话,不需要查询历史\n if (id === NEW_SESSION_ID) {\n // 重置会话id\n chatService.setConversationId();\n setMsgEnd(true);\n setLoading(false);\n return;\n }\n const list = await chatService.getChatHistory(id);\n const computedList = (list: ChatItem[]) => {\n const newList: MessageItem[] = [];\n list.forEach((item) => {\n newList.unshift(\n {\n taskId: item.taskId,\n role: \"user\",\n content: {\n type: \"text\",\n text: item.input,\n },\n key: `user_${item.taskId}`,\n created: item.time,\n },\n {\n agentId: item.agentId,\n taskId: item.taskId,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: item.output,\n },\n key: `assistant_${item.taskId}`,\n created: item.inputTime,\n tag: item.tag,\n }\n );\n });\n return newList.filter((item) => item.content.text);\n };\n setMsgList((preList) => {\n return computedList(list).concat(preList);\n });\n setMsgLoading(false);\n setLoading(false);\n },\n [chatService, chatting, stopChat]\n );\n\n const deleteSession = useCallback(\n async (ids: string[]): Promise<boolean> => {\n // 需要过滤新建会话, 因为新建会话在本地,还没上报到远端\n const filterIds = ids.filter((item) => item !== NEW_SESSION_ID);\n const result = await chatService.deleteSession(filterIds);\n if (result) {\n let deleteActiveSession = false;\n if (\n activeSessionId &&\n filterIds.includes(activeSessionId) &&\n activeSessionId !== NEW_SESSION_ID\n ) {\n // 如果删除会话包含当前会话,需要重置状态\n deleteActiveSession = true;\n // 清除会话id\n chatService.setConversationId();\n\n setMsgEnd(false);\n setMsgLoading(false);\n setMsgList([]);\n\n if (chatting) {\n stopChat();\n }\n }\n\n setSessionList((list) => {\n const newList = list.filter(\n (item) => !filterIds.includes(item.conversationId!)\n );\n if (deleteActiveSession) {\n // 已经选中的当前会话被删除,新建会话\n const hasNewOne = list.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n setLoading(false);\n\n setActiveSessionId(NEW_SESSION_ID);\n if (hasNewOne) {\n return newList;\n } else {\n return [defaultNewSessionItem].concat(newList);\n }\n }\n return newList;\n });\n }\n return result;\n },\n [activeSessionId, chatService, chatting, defaultNewSessionItem, stopChat]\n );\n\n const querySessionHistory = useCallback(\n async (limit?: number) => {\n setSessionLoading(true);\n const list = await chatService.getSessionHistory(limit);\n if (!activeSessionId) {\n // 如果没有 activeSessionId, 默认新增会话\n setActiveSessionId(NEW_SESSION_ID);\n }\n setSessionList((preList) => {\n return !activeSessionId\n ? [defaultNewSessionItem].concat([...preList, ...list])\n : preList.concat(list);\n });\n setSessionLoading(false);\n },\n [chatService, activeSessionId, defaultNewSessionItem]\n );\n\n const handleChat = useCallback(\n async (str: string) => {\n if (activeSessionId === NEW_SESSION_ID) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n title: item.conversationId === NEW_SESSION_ID ? str : item.title,\n }));\n });\n }\n setChatting(true);\n chatService.chat(str);\n setMsgList((list) => {\n return list.concat([\n {\n role: \"user\",\n content: {\n type: \"text\",\n text: str,\n },\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n {\n role: \"assistant\",\n content: {\n type: \"load\",\n text: \"\",\n },\n chatting: true,\n created: \"Now\",\n },\n ]);\n });\n },\n [chatService, activeSessionId]\n );\n\n const createSession = useCallback(() => {\n chatService.setConversationId();\n setMsgList([]);\n setActiveSessionId(NEW_SESSION_ID);\n const hasNewOne = sessionList.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n if (!hasNewOne) {\n setSessionList((preList) => {\n return [defaultNewSessionItem].concat(preList);\n });\n }\n }, [chatService, sessionList, defaultNewSessionItem]);\n\n const handleIsLike = useCallback(\n async (id: string, isLike: boolean): Promise<boolean> => {\n const result = await chatService.setChatItemIsLike(id, isLike);\n if (result) {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n tag:\n id === item.taskId\n ? {\n isLike,\n }\n : item.tag,\n }));\n });\n }\n return result;\n },\n [chatService]\n );\n\n useEffect(() => {\n if (sessionId) {\n checkSession(sessionId);\n }\n }, [sessionId]);\n\n useEffect(() => {\n // session listener\n const handleSessionEnd = () => {\n setSessionEnd(true);\n };\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n\n return () => {\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n };\n }, [chatService]);\n\n useEffect(() => {\n // chat listener\n const listener = (msgItem?: SSEMessageItem) => {\n if (!msgItem) return;\n chatingText.current = chatingText.current + msgItem.delta.content;\n if (activeSessionId === NEW_SESSION_ID && msgItem.conversationId) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n conversationId:\n item.conversationId === NEW_SESSION_ID\n ? msgItem.conversationId!\n : item.conversationId,\n }));\n });\n setActiveSessionId(msgItem.conversationId);\n }\n // eslint-disable-next-line no-console\n // console.log(chatingText.current);\n chatingMessageItem.current = {\n ...msgItem,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: chatingText.current,\n },\n chatting: true,\n created: moment(msgItem?.created).format(\"YYYY-MM-DD HH:mm:ss\"),\n };\n setMsgList((list) => {\n list.pop();\n return list.concat(chatingMessageItem.current!);\n });\n };\n const reset = () => {\n chatingText.current = \"\";\n setChatting(false);\n setLoading(false);\n chatingMessageItem.current = undefined;\n };\n const finishListener = () => {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n chatting: false,\n }));\n });\n reset();\n };\n const fetchEndListener = () => {\n setMsgEnd(true);\n };\n const stopListener = () => {\n if (chatingMessageItem.current) {\n const stopMessageItem: MessageItem = {\n ...chatingMessageItem.current,\n content: {\n type: \"markdown\",\n text:\n chatingMessageItem.current.content.text +\n \" \\\\\\n ` 对话被中断了 `\",\n },\n };\n setMsgList((list) => {\n list.pop();\n return msgList.concat(stopMessageItem);\n });\n } else {\n setMsgList((list) => {\n return list.filter((item) => item.content.type !== \"load\");\n });\n }\n reset();\n };\n chatService.subscribe(\"add\", listener);\n chatService.subscribe(\"finish\", finishListener);\n chatService.subscribe(\"stop\", stopListener);\n chatService.subscribe(\"message.fetch.end\", fetchEndListener);\n return () => {\n chatService.unsubscribe(\"add\", listener);\n chatService.unsubscribe(\"finish\", finishListener);\n chatService.unsubscribe(\"stop\", stopListener);\n chatService.unsubscribe(\"message.fetch.end\", fetchEndListener);\n };\n }, [chatService, activeSessionId, msgList]);\n\n return {\n sessionEnd,\n sessionLoading,\n loading,\n chatting,\n activeSessionId,\n sessionList,\n searchStr,\n msgEnd,\n msgLoading,\n msgList,\n setAgent,\n handleChat,\n stopChat,\n createSession,\n deleteSession,\n checkSession,\n setSearchStr,\n querySessionHistory,\n handleIsLike,\n };\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--message-box-bg:#f1f3f4;--search-input-icon-hover:#ddd;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.15)}html[data-theme=\"dark\"],\nhtml[data-theme=\"dark-v2\"]{--message-box-bg:rgba(255,255,255,0.16);--search-input-icon-hover:#383838;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.24)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.progress-text{position:relative;margin-left:12px;font-size:12px;color:var(--palette-gray-7);line-height:22px;min-height:22px}.progress-text::before{content:\"·\";font-size:16px;position:absolute;left:-10px;top:-4px}.custom-component-wrapper .params{margin-top:6px;border-radius:3px}.custom-component-wrapper .params pre{margin:4px 0}.custom-component-wrapper .params-tip,\n .custom-component-wrapper .error-tip,\n .custom-component-wrapper .result-tip{font-size:0.875em;color:rgb(94 129 172)}.custom-component-wrapper .empty-tip{font-size:12px;color:var(--palette-gray-7)}.custom-component-wrapper .table-wrapper .table-container{position:relative;box-sizing:border-box;margin:0;padding:0;font-size:14px;clear:both;max-width:100%;overflow:hidden}.custom-component-wrapper .table-wrapper .table-container .table-content{overflow-x:auto}.custom-component-wrapper .table-wrapper .table-container .table-content table{margin:4px 0}.custom-component-wrapper .table-wrapper .table-container .table-content table tr td{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.custom-component-wrapper .table-wrapper .open-more{margin-top:4px;font-size:12px;display:flex;justify-content:end}.custom-component-wrapper .chart-wrapper{background:#fff;margin-top:12px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:\"liga\" 0,none}.ProseMirror pre{white-space:pre-wrap}.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-32px;right:-2px;top:-2px;bottom:-2px;border:2px solid #8cf;pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,\n.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:\"\";left:0;right:0;top:0;bottom:0;background:rgba(200,200,255,0.4);pointer-events:none}.milkdown-theme-nord blockquote{border-left-width:4px;--tw-border-opacity:1;border-color:rgb(94 129 172/var(--tw-border-opacity));padding-left:1rem;font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-style:normal}.milkdown-theme-nord code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-weight:400;--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord pre code{color:inherit}.milkdown-theme-nord img{margin-top:0!important;margin-bottom:0!important;display:inline-block;max-width:100%}.milkdown-theme-nord.prose\n :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:400}.milkdown-theme-nord.prose\n :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker,\n.milkdown-theme-nord.prose\n :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose .tableWrapper{position:relative;margin-bottom:0.5rem;overflow-x:auto}.milkdown-theme-nord.prose table{font-size:0.875rem;line-height:1.25rem;--tw-shadow:0 4px 6px -1px rgb(0 0 0/0.1),0 2px 4px -2px rgb(0 0 0/0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){.milkdown-theme-nord.prose table{border-radius:0.5rem}}.milkdown-theme-nord.prose td,\n.milkdown-theme-nord.prose th{padding:0.75rem 1.5rem!important}.milkdown-theme-nord.prose tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.dark .milkdown-theme-nord.prose tr{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.milkdown-theme-nord.prose :where(td, th) p{margin:0!important}.milkdown-theme-nord.prose :where(td, th):nth-child(odd){background-color:var(--color-fill-bg-base-1)}.dark .milkdown-theme-nord.prose :where(td, th):nth-child(odd){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.milkdown-theme-nord.prose.ProseMirror .selectedCell:after{background-color:#88c0d04d}.milkdown-theme-nord.prose br[data-is-inline=\"true\"],\n.milkdown-theme-nord.prose br[data-is-inline=\"true\"]:after{content:\" \"}.prose{color:var(--color-normal-text)}.prose :where(p):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=\"lead\"]):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=\"not-prose\"] *)){color:var(--color-info);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600}.prose :where(a strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(ol):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=\"A\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"A\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"I\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"I\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"1\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=\"not-prose\"] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{color:var(--tw-prose-bullets)}.prose :where(hr):not(:where([class~=\"not-prose\"] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:500;font-style:italic;color:var(--color-auxiliary-text);border-left-width:0.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:\"\\\\201C\" \"\\\\201D\" \"\\\\2018\" \"\\\\2019\";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose\n :where(blockquote p:first-of-type):not(\n :where([class~=\"not-prose\"] *)\n )::before{content:open-quote}.prose\n :where(blockquote p:last-of-type):not(:where([class~=\"not-prose\"] *))::after{content:close-quote}.prose :where(h1):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:0.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=\"not-prose\"] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=\"not-prose\"] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:0.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;margin-top:1.5em;margin-bottom:0.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure > *):not(:where([class~=\"not-prose\"] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-captions);font-size:0.875em;line-height:1.4285714;margin-top:0.8571429em}.prose :where(code):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-code);font-weight:600;font-size:0.875em}.prose :where(code):not(:where([class~=\"not-prose\"] *))::before{content:\"\\`\"}.prose :where(code):not(:where([class~=\"not-prose\"] *))::after{content:\"\\`\"}.prose :where(a code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h1 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h2 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.875em}.prose :where(h3 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.9em}.prose :where(h4 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(pre):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:0.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:0.375rem;padding-top:0.8571429em;padding-right:1.1428571em;padding-bottom:0.8571429em;padding-left:1.1428571em}.prose :where(pre code):not(:where([class~=\"not-prose\"] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::before{content:none}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::after{content:none}.prose :where(table):not(:where([class~=\"not-prose\"] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:0.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;vertical-align:bottom;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose :where(tbody tr):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=\"not-prose\"] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=\"not-prose\"] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=\"not-prose\"] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=\"not-prose\"] *)){vertical-align:top}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgb(0 0 0/50%);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(video):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=\"not-prose\"] *)){margin-top:0.5em;margin-bottom:0.5em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(.prose > ul > li p):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose\n :where(.prose > ul > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ul > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose\n :where(.prose > ol > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ol > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose :where(hr + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h2 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h3 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h4 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=\"not-prose\"] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=\"not-prose\"] *)){padding-right:0}.prose :where(tbody td, tfoot td):not(:where([class~=\"not-prose\"] *)){padding-top:0.5714286em;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose\n :where(tbody td:first-child, tfoot td:first-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-left:0}.prose\n :where(tbody td:last-child, tfoot td:last-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-right:0}.prose :where(.prose > :first-child):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(.prose > :last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:0}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.isolate{isolation:isolate}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\\\\!table{display:table!important}.table{display:table}.inline-table{display:inline-table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row-group{display:table-row-group}.table-row{display:table-row}.flow-root{display:flow-root}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.list-item{display:list-item}.hidden{display:none}.flex-shrink{flex-shrink:1}.shrink{flex-shrink:1}.flex-grow{flex-grow:1}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.\\\\!transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.break-all{word-break:break-all}.rounded{border-radius:0.25rem}.border{border-width:1px}.text-justify{text-align:justify}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.lining-nums{--tw-numeric-figure:lining-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.overline{-webkit-text-decoration-line:overline;text-decoration-line:overline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0/0.1),0 1px 2px -1px rgb(0 0 0/0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4,0,0.2,1);transition-duration:150ms}.ease-in{transition-timing-function:cubic-bezier(0.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(0.4,0,0.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,0.2,1)}.milkdown{border-radius:0.25rem;margin:0;padding:0}.editor{margin-left:auto;margin-right:auto}:is(.dark .dark\\\\:prose-invert){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}code[class*=\"language-\"],\npre[class*=\"language-\"]{color:#f8f8f2;background:none;font-family:\"Fira Code\",Consolas,Monaco,\"Andale Mono\",\"Ubuntu Mono\",monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=\"language-\"]{padding:1em;margin:0.5em 0;overflow:auto;border-radius:0.3em}:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"]{background:#2e3440}:not(pre) > code[class*=\"language-\"]{padding:0.1em;border-radius:0.3em;white-space:normal}.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata{color:#636f88}.token.punctuation{color:#81a1c1}.namespace{opacity:0.7}.token.property,\n.token.tag,\n.token.constant,\n.token.symbol,\n.token.deleted{color:#81a1c1}.token.number{color:#b48ead}.token.boolean{color:#81a1c1}.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted{color:#a3be8c}.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string,\n.token.variable{color:#81a1c1}.token.atrule,\n.token.attr-value,\n.token.function,\n.token.class-name{color:#88c0d0}.token.keyword{color:#81a1c1}.token.regex,\n.token.important{color:#ebcb8b}.token.important,\n.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.quick-answer-wrapper{margin-top:20px;border-radius:6px;border:1px solid var(--color-border-divider-line);padding:16px 24px}.quick-answer-wrapper .tip{font-size:18px;margin-bottom:30px}.quick-answer-wrapper .quick-answer-list{display:grid;grid-gap:24px 16px;gap:24px 16px;border-radius:3px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item{position:relative;padding:16px;border-radius:6px;cursor:pointer;display:flex;padding:10px 20px;gap:12px;width:auto;box-sizing:border-box}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item:hover{box-shadow:var(--quick-answer-card-item-hover)}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .left .icon{font-size:20px;color:#fff;padding:8px;border-radius:6px;margin-top:4px}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content{flex:1;min-width:0}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .title{font-size:16px;font-weight:bold;color:var(--color-normal-text);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .description{color:var(--color-auxiliary-text);font-size:12px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.quick-answer-wrapper .show-more-wrapper{text-align:center;margin-top:20px}.quick-answer-wrapper .show-more-wrapper .show-more-btn{line-height:24px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after,\n .quick-answer-wrapper .show-more-wrapper .show-more-btn::before{content:\"- - - - -\";color:var(--color-text-divider-line);position:absolute}.quick-answer-wrapper .show-more-wrapper .show-more-btn::before{margin-left:-60px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"../assets/loading.gif\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.message-list-loading-wrapper{width:140px;height:140px;background-repeat:no-repeat;margin:auto;background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.chart-item-loading-wrapper{display:flex;padding:10px;font-size:40px;align-items:center;justify-content:center;color:#d2d3d4;border-radius:6px}.chart-item-loading-wrapper .load{display:inline-block;position:relative;width:64px;height:64px}.chart-item-loading-wrapper .load div{position:absolute;top:27px;width:11px;height:11px;border-radius:50%;background:#aaa8a8;animation-timing-function:cubic-bezier(0,1,1,0)}.chart-item-loading-wrapper .load div:nth-child(1){left:6px;animation:load1 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(2){left:6px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(3){left:26px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(4){left:45px;animation:load3 0.6s infinite}@keyframes load1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes load2{0%{transform:translate(0,0)}100%{transform:translate(19px,0)}}@keyframes load3{0%{transform:scale(1)}100%{transform:scale(0)}}.common-loading-wrapper{text-align:center;font-size:30px;color:#ddd}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./assets/user.png\", import.meta.url);\nvar ___CSS_LOADER_URL_IMPORT_1___ = new URL(\"./assets/robot.png\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\nvar ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block;height:100%}:host([hidden]){display:none}@media only screen and (min-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1556px}.chat-view-container .chat-view-content .search-input-box{width:1556px}}@media only screen and (min-width: 1440px) and (max-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1156px}.chat-view-container .chat-view-content .search-input-box{width:1156px}}@media only screen and (min-width: 804px) and (max-width: 1440px){.chat-view-container .chat-view-content .chat-view .message-list{width:804px}.chat-view-container .chat-view-content .search-input-box{width:804px}}@media only screen and (max-width: 804px){.chat-view-container .chat-view-content .chat-view .message-list{width:100%}.chat-view-container .chat-view-content .search-input-box{width:100%}}.chat-view-container{display:flex;flex-direction:row;width:100%;height:100%}.chat-view-selector{width:200px;padding:14px;border-right:1px solid var(--color-border-divider-line)}.chat-view-content{flex:1;display:flex;flex-direction:column;width:100%;gap:8px}.chat-view-content .chat-view-toolbar{background:#e0e4e5;padding:18px;display:flex;justify-content:space-between;align-items:center}.chat-view-content .chat-view-toolbar .username{color:#333333;font-weight:500;line-height:22px;font-size:16px}.chat-view-content .chat-view-toolbar .toolbar eo-icon{cursor:pointer}.chat-view-content .chat-view{max-width:100%;position:relative;display:flex;flex:1;flex-direction:column;box-sizing:border-box;overflow-y:auto}.session-list-wrapper{display:flex;flex-direction:column;height:100%}.session-list-wrapper .session-title{font-size:16px;color:var(--color-header-text);margin-bottom:16px}.session-list-wrapper .session-list{overflow-y:auto}.session-list-wrapper .session-list .session-item{display:flex;justify-content:space-between;cursor:pointer;border-radius:var(--small-border-radius);background-color:var(--third-menu-default-bg);padding:6px 16px;color:var(--color-header-text);margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item .content{width:0;flex:1}.session-list-wrapper .session-list .session-item .content .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item:hover .session-close-btn eo-icon{display:block}.session-list-wrapper .session-list .session-item:first-child{margin-top:0px}.session-list-wrapper .session-list .session-item.active{background-color:var(--third-menu-item-selected-bg);color:var(--color-brand)}.session-list-wrapper .session-list .session-item:hover,\n .session-list-wrapper .session-list .session-item.active:hover{color:var(--color-header-text);background-color:var(--third-menu-item-hover-bg)}.session-list-wrapper .session-list .session-item .session-close-btn{display:flex;align-items:center;cursor:pointer;font-size:12px}.session-list-wrapper .session-list .session-item .session-close-btn:hover{color:var(--color-error)}.session-list-wrapper .session-list .session-item .session-close-btn eo-icon{display:none}.message-list{display:flex;flex-direction:column;padding-bottom:30px;padding:12px;flex:1;margin:0 auto;max-width:100%;box-sizing:border-box}.message-list .message-list-box{display:flex;flex-direction:column;position:relative;gap:36px}.message-list .message-list-box .message-item{display:flex;gap:8px;padding-right:40px}.message-list .message-list-box .message-item.user{flex-direction:row-reverse;padding:0;padding-left:40px}.message-list .message-list-box .message-item.user .message-box{margin-bottom:0;overflow:hidden}.message-list .message-list-box .message-item.user .message-box .message-top{flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content{justify-content:end}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper{display:flex;flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content{background-color:#606f7c;color:#fff}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper:hover .content-tip{display:block}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip{display:none}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip eo-icon{padding:4px;color:#606f7c;cursor:pointer}.message-list .message-list-box .message-item .avatar{width:36px;height:36px;margin-top:32px;border-radius:50%;font-size:20px;display:flex;align-items:center;justify-content:center}.message-list .message-list-box .message-item .avatar.user{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.message-list .message-list-box .message-item .avatar.robot{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_1___})}.message-list .message-list-box .message-item .message-box{position:relative;flex:1;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content{display:flex;justify-content:start;position:relative}.message-list .message-list-box .message-item .message-box .message-content .wrapper{position:relative;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content{position:relative;padding:14px;border-radius:6px;overflow:hidden;background:var(--message-box-bg)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content .text-item{white-space:pre-wrap}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar{display:flex;gap:12px;justify-content:end;margin-top:4px}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar eo-icon{cursor:pointer;color:#606f7c}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar eo-icon.active{color:var(--color-brand)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar .split{width:1px;height:16px;background-color:#d9d9d9;margin-bottom:1px}.message-list .message-list-box .message-item .message-box .message-top{display:flex;margin-bottom:4px;color:#bec8ce;gap:8px}.message-list .message-list-box .message-item .message-box .message-top .time{min-height:22px}.message-list .message-list-box .stop-responding-wrapper{position:absolute;left:44px;bottom:-28px}.search-input-box{display:flex;flex-direction:column;height:75px;padding:12px;position:relative;margin:0 auto;max-width:100%;box-sizing:border-box}.search-input-box .mentions-list-wrapper{position:absolute;bottom:100%;left:12px;right:12px}.search-input-box .mentions-list-wrapper .content{background-color:var(--antd-input-bg);border-radius:6px;border:1px solid var(--palette-gray-4);padding:8px}.search-input-box .mentions-list-wrapper .content .mentions-title{font-size:14px;font-weight:bold;color:var(--color-strong-text);padding-bottom:8px}.search-input-box .mentions-list-wrapper .content .mentions-list{display:flex;flex-direction:column;gap:8px;max-height:300px;overflow-y:auto}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item{display:flex;flex-direction:row;align-items:center;gap:12px;padding:8px;border-radius:6px;cursor:pointer}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .icon{font-size:18px;padding:8px;border-radius:50%}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .name{color:var(--color-normal-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .description{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--color-disabled-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item:hover,\n .search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item.active{background:var(--palette-gray-3)}.search-input-box.fill-content{border-top:1px solid rgba(197,197,197,0.5)}.search-input-box .input-box{position:absolute;bottom:20px;left:12px;right:12px;display:inline-flex;padding:var(--input-affix-wrapper-padding);border-radius:var(--small-border-radius);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;color:var(--text-color-default);background-color:var(--antd-input-bg);border:1px solid var(--color-border-divider-line);transition:border-color 0.3s;overflow:visible}.search-input-box .input-box.active{border-color:var(--antd-input-focus-border-color)}.search-input-box .input-box.disabled{pointer-events:none;background:var(--input-outline-disabled);cursor:not-allowed}.search-input-box .input-box.expand textarea{padding-right:50px;margin-bottom:50px}.search-input-box .input-box textarea{width:100%;height:22px;font-size:18px;resize:none;padding:10px 50px 10px 10px;outline:none;border:none;line-height:20px;color:var(--color-normal-text);background-color:transparent;cursor:inherit;transition:all 300ms ease-out}.search-input-box .input-box textarea::placeholder{color:#b0b1b8}.search-input-box .input-box .suffix-icon{display:flex;align-items:center;gap:8px;position:absolute;right:12px;bottom:6px}.search-input-box .input-box .suffix-icon eo-tooltip{display:flex}.search-input-box .input-box .suffix-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .suffix-icon eo-icon:not(.disabled):hover{background:var(--search-input-icon-hover)}.search-input-box .input-box .suffix-icon .submit-split{width:1px;height:20px;background:#d1d1d1}.search-input-box .input-box .suffix-icon .submit-btn.active{color:var(--color-brand)}.search-input-box .input-box .suffix-icon .submit-btn.disabled{color:var(--color-disabled-text);cursor:not-allowed}.search-input-box .input-box .toolbar-icon{position:absolute;top:12px;right:14px}.search-input-box .input-box .toolbar-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .toolbar-icon eo-icon:hover{background:var(--search-input-icon-hover)}.search-input-box .search-input-toolbar{display:flex;justify-content:end;position:absolute;right:12px;bottom:0px}.search-input-box .search-input-toolbar .input-tip{font-size:12px;color:var(--color-secondary-text)}.message-start-tip,\n.session-end-tip{color:var(--color-disabled-text);font-size:12px;text-align:center;margin-top:12px;position:relative}.message-start-tip::after,\n .session-end-tip::after,\n .message-start-tip::before,\n .session-end-tip::before{content:\"- - -\";color:var(--color-disabled-text);position:absolute}.message-start-tip::before, .session-end-tip::before{margin-left:-35px}.message-start-tip::after, .session-end-tip::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n export default content && content.locals ? content.locals : undefined;\n"],"names":["ChatViewContext","createContext","useChatViewContext","useContext","WrappedIcon","wrapBrick","MessageListLoading","React","className","ChatItemLoading","CommonLoading","icon","lib","spinning","Avatar","_ref","role","agentId","isUser","useMemo","quickAnswerConfig","agentList","_quickAnswerConfig$li","list","matchAgent","find","item","id","_extends","style","color","concat","background","WrappedLink","GuideItem","text","prompts","map","index","key","ProgressText","renderText","replace","MsgItemContext","TableComponent","lazy","ChartComponent","CustomComponent","_ref4","language","chatting","data","parseData","isError","isLoading","cahceTextRef","useRef","isFetching","setIsFetching","useState","isEnd","setIsEnd","setIsError","setIsLoading","setParseData","setData","requestPromise","useCallback","_ref2","_asyncToGenerator","InstanceApi_postSearchV3","objectId","_objectSpread","page","page_size","http","request","getBasePath","method","body","_x","apply","arguments","fetchData","_ref3","response","_unused","_x2","useEffect","current","JSON","parse","_unused2","match","useFetchData","component","params","CodeBlock","setLanguage","contentRef","node","useNodeViewContext","defaultContent","spellCheck","ref","renderContent","_node$firstChild","_node$firstChild2","firstChild","textContent","attrs","MarkdownItem","MilkdownProvider","ProsemirrorAdapterProvider","MarkdownDisplay","value","nodeViewFactory","useNodeViewFactory","get","useEditor","root","Editor","make","config","ctx","set","rootCtx","update","editorViewOptionsCtx","prev","editable","handleClickOn","view","pos","handleClick","url","found","state","tr","doc","nodeAt","marks","length","path","mark","m","type","name","href","startsWith","encodeURIComponent","window","open","defaultValueCtx","MutationObserver","Array","from","querySelectorAll","forEach","link","onclick","observe","childList","subtree","nord","use","prism","gfm","commonmark","$view","codeBlockSchema","_get","undefined","action","replaceAll","Milkdown","TableItem","TextItem","WrapperIcon","WrappedToolTip","copyToClipboard","unwrapProvider","showNotification","Toolbar","content","taskId","tag","isAssistant","isChattingItem","showLike","readonly","handleIsLike","handleLikeOrIsLike","islike","result","message","hoist","classNames","active","isLike","onClick","handleCopy","then","catch","Time","time","moment","format","ContentTip","setSearchStr","NOT_AGENT_MATCH","MessageNode","props","created","getContentNode","examplePrompts","messageNode","Provider","CARD_ITEM_HEIGHT","HEIGHT_GAP","QuickAnswerCardItem","description","starterPrompts","iconColor","_icon$color","height","handleCardClick","category","QuickAnswerList","_quickAnswerConfig$ti","msgList","loading","showMoreBtn","setShowMoreBtn","listRef","hadClickShowMoreBtn","element","observer","ResizeObserver","entries","entry","contentRect","disconnect","tip","maxHeight","overflow","instanceId","handleShowMoreClick","StopBtn","stopChat","handleStopChat","DEFAULT_OFFSET_HEIGHT","CACHE_HEIGHT","MessageList","showAvatar","chatViewRef","messgetListBoxRef","preHeight","setPreHeight","isCustomScroll","msgLoading","msgEnd","activeSessionId","checkSession","getMsgItemNode","user","msgListNode","handleScroll","messageList","scrollHeight","clientHeight","scrollTop","isBottom","debounceHandleScroll","debounce","newHeight","scroll","top","Number","MAX_SAFE_INTEGER","Math","max","onScroll","hiddenTextarea","HIDDEN_TEXTAREA_STYLE","SIZING_STYLE","PREFIX_WORD","SearchInput","setValue","setActive","expand","setExpand","autoSizeStyle","setAutoSizeStyle","isFillContent","setIsFillContent","mentionOpen","setMentionOpen","matchPrefixIndex","setMatchPrefixIndex","matchAgentList","setMatchMentionList","matchMentionsIndex","setMatchMentionsIndex","mentionsRef","searchInputBoxRef","textareaRef","hadExpanded","inputEndRef","searchStr","createSession","handleChat","setAgent","hadValue","defaultSize","disabled","matchPrefixInfo","textareaElement","currentFocusIndex","selectionStart","matchWord","i","test","start","end","word","handleAgentItemSelect","valueList","split","trimName","focusIndex","splice","join","setTimeout","selectionEnd","focus","isShowMentions","mentions","slice","computedAutoSize","size","textareaStyles","uiTextNode","minRows","maxRows","document","createElement","setAttribute","appendChild","uiTextNodeStyle","getComputedStyle","sizingStyle","getPropertyValue","placeholder","minHeight","singleRowHeight","min","overflowY","resize","calculateAutoSizeStyle","handleChange","e","target","handleExpand","matchFirstAgent","regex","exec","agent","handleSubmit","blur","handleKeyDown","shiftKey","preventDefault","handleKeyUp","selectionIndex","prefixWord","lastIndexOf","indexOf","_textareaRef$current","trim","searchInputBox","width","currentWidth","getBoundingClientRect","_textareaRef$current2","filterList","filter","includes","querySelector","scrollIntoView","block","handleDocumentClick","mentionsElemnt","contains","composedPath","addEventListener","removeEventListener","paddingRight","onFocus","onBlur","onChange","onKeyDown","onKeyUpCapture","onCompositionStart","handleCompositionStart","onCompositionEnd","handleCompositionEnd","hanldeCreateSession","showDialog","SESSION_ITEM_HEIGHT","BUFFER_NUMBER","SessionList","sessionEnd","sessionLoading","sessionList","querySessionHistory","sessionWrapperRef","sessionListRef","limit","sessionWrapper","floor","checkSessionList","SessionItem","title","conversationId","deleteSession","handleCheckSession","handleDeleteSession","stopPropagation","expect","_debug","WeakMap","_ctrl","_agentId","_enterInterval","_charting","_isStartEmitEvent","_emitTimer","_messageQueue","_subscribers","_conversationId","_sessionNextToken","_cacheLimit","_messageNextToken","_ChatService_brand","WeakSet","ChatService","constructor","enterInterval","debug","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_classPrivateFieldSet","this","enqueue","_classPrivateFieldGet","push","_assertClassBrand","_startEmitEvent","call","dequeue","shift","getMessageQueue","subscribe","topic","callback","unsubscribe","cb","notifySubscribers","setChatItemIsLike","flag","code","stringify","setAgentId","setConversationId","getSessionHistory","_this","_classPrivateFieldGet2","conversations","next_token","console","error","getChatHistory","_this2","_unused3","conversationIds","_unused4","splitWord","str","Intl","iterator","Segmenter","granularity","segment","Symbol","nextWord","next","done","customSplit","cache","matchStr","substring","chat","_this3","AbortController","hadMatchMessage","fetchEventSource","signal","input","stream","headers","onopen","ok","log","onmessage","msg","_unused5","delta","abort","onclose","onerror","err","stop","_classPrivateFieldGet3","clearInterval","_clear","setInterval","messageItem","NEW_SESSION_ID","useChatViewInfo","sessionId","setSessionEnd","setSessionLoading","setActiveSessionId","setLoading","setChatting","setSessionList","setMsgLoading","setMsgEnd","setMsgList","chatingText","chatingMessageItem","chatService","defaultNewSessionItem","preList","newList","unshift","output","inputTime","computedList","ids","filterIds","deleteActiveSession","hasNewOne","_x3","_ref5","_x4","_ref6","_x5","_x6","handleSessionEnd","listener","msgItem","pop","reset","finishListener","fetchEndListener","stopListener","stopMessageItem","___CSS_LOADER_EXPORT___","module","toString","___CSS_LOADER_URL_IMPORT_0___","URL","___CSS_LOADER_URL_REPLACEMENT_0___","___CSS_LOADER_URL_IMPORT_1___","___CSS_LOADER_URL_REPLACEMENT_1___","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals"],"sourceRoot":""}
1
+ {"version":3,"file":"chunks/774.17d37fdf.js","mappings":"sJAuDaA,GAAkBC,EAAAA,EAAAA,eAC7B,CAAC,GAGUC,EAAqBA,KAChCC,EAAAA,EAAAA,YAAWH,E,4ECrDPI,GAAcC,E,QAAAA,WAAyC,WAEtD,SAASC,IACd,OAAOC,IAAAA,cAAA,OAAKC,UAAU,gCACxB,CAEO,SAASC,IACd,OACEF,IAAAA,cAAA,OAAKC,UAAU,8BACbD,IAAAA,cAAA,OAAKC,UAAU,QACbD,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,YACAA,IAAAA,cAAA,aAIR,CAEO,SAASG,IACd,OACEH,IAAAA,cAAA,OAAKC,UAAU,0BACbD,IAAAA,cAACH,EAAW,CAACO,KAAK,UAAUC,IAAI,OAAOC,UAAQ,IAGrD,C,sFCxBMT,GAAcC,EAAAA,EAAAA,WAAyC,WAEtD,SAASS,EAAMC,GAMF,IANG,KACrBC,EAAI,QACJC,GAIDF,EACOG,GAASC,EAAAA,EAAAA,UAAQ,IAAe,SAATH,GAAiB,CAACA,KACzC,kBAAEI,IAAsBlB,EAAAA,EAAAA,KAExBmB,GAAYF,EAAAA,EAAAA,UAChB,SAAAG,EAAA,OAA6B,QAA7BA,EAAMF,aAAiB,EAAjBA,EAAmBG,YAAI,IAAAD,EAAAA,EAAI,EAAE,GACnC,CAACF,I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AAO/hB,GAAI,uHAAuHmiB,+hCAAikC,KAEjuC,QAAeL,EAAwBE,U,4FCNnCC,EAAgC,IAAIC,IAAI,aACxCE,EAAgC,IAAIF,IAAI,YACxCJ,EAA0B,IAA4B,KACtDK,EAAqC,IAAgCF,GACrEI,EAAqC,IAAgCD,GAEzEN,EAAwBjH,KAAK,CAACkH,EAAO/hB,GAAI,qsJAC2hEmiB,uFAAwHE,qwLAKh9D,KAE5O,QAAeP,EAAwBE,U,gJCPnCM,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,M","sources":["webpack:///./src/chat-view/ChatViewContext.ts","webpack:///./src/chat-view/components/Loading.tsx","webpack:///./src/chat-view/components/MessageItem/Avatar.tsx","webpack:///./src/chat-view/components/MessageItem/GuideItem.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/ProgressText.tsx","webpack:///./src/chat-view/components/MessageItem/MsgItemContext.ts","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CustomComponent.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/index.tsx","webpack:///./src/chat-view/components/MessageItem/Markdown/index.tsx","webpack:///./src/chat-view/components/MessageItem/TableItem.tsx","webpack:///./src/chat-view/components/MessageItem/TextItem.tsx","webpack:///./src/chat-view/components/MessageItem/Toolbar.tsx","webpack:///./src/chat-view/components/MessageItem/Time.tsx","webpack:///./src/chat-view/components/MessageItem/ContentTip.tsx","webpack:///./src/chat-view/components/MessageItem/index.tsx","webpack:///./src/chat-view/components/QuickAnswerList/index.tsx","webpack:///./src/chat-view/components/StopBtn.tsx","webpack:///./src/chat-view/components/MessageList.tsx","webpack:///./src/chat-view/components/utils/calculateAutoSizeStyle.ts","webpack:///./src/chat-view/components/SearchInput.tsx","webpack:///./src/chat-view/components/SessionList.tsx","webpack:///./src/chat-view/ChatService.ts","webpack:///./src/chat-view/hooks/useChatViewInfo.ts","webpack:///./src/chat-view/host-context.css","webpack:///./src/chat-view/components/MessageItem/Markdown/CodeBlock/CodeBlock.shadow.css","webpack:///./src/chat-view/components/MessageItem/Markdown/markdown.shadow.css","webpack:///./src/chat-view/components/QuickAnswerList/quickAnswerList.shadow.css","webpack:///./src/chat-view/components/loading.shadow.css","webpack:///./src/chat-view/styles.shadow.css","webpack:///./src/chat-view/host-context.css?1beb"],"sourcesContent":["import { createContext, useContext } from \"react\";\nimport { AgentDetailItem } from \"./components/QuickAnswerList/index.js\";\nimport { SessionItem } from \"./ChatService.js\";\n\nexport type Role = \"guide\" | \"user\" | \"assistant\";\n\nexport interface MessageItemContent {\n type: \"guide\" | \"text\" | \"markdown\" | \"table\" | \"load\";\n text: string;\n examplePrompts?: string[];\n}\n\nexport interface MessageItem {\n role: Role;\n content: MessageItemContent;\n created?: number | string;\n key?: number | string;\n conversationId?: string;\n taskId?: string;\n agentId?: string;\n chatting?: boolean;\n tag?: {\n isLike?: boolean;\n };\n}\n\nexport interface QuickAnswerConfig {\n tip: string;\n list: AgentDetailItem[];\n}\ninterface ChatViewContextProps {\n sessionEnd: boolean;\n sessionLoading: boolean;\n activeSessionId?: string;\n sessionList: SessionItem[];\n msgEnd: boolean;\n msgLoading: boolean;\n msgList: MessageItem[];\n loading: boolean;\n chatting: boolean;\n searchStr: string;\n showLike: boolean;\n readonly: boolean;\n quickAnswerConfig?: QuickAnswerConfig;\n setAgent: (id: string) => void;\n handleIsLike: (id: string, isLike: boolean) => Promise<boolean>;\n handleChat: (str: string) => void;\n stopChat: () => void;\n checkSession: (id?: string, isInit?: boolean) => void;\n createSession: () => void;\n deleteSession: (ids: string[]) => Promise<boolean>;\n setSearchStr: (str: string) => void;\n querySessionHistory: (limit?: number) => void;\n}\n\nexport const ChatViewContext = createContext<ChatViewContextProps>(\n {} as ChatViewContextProps\n);\n\nexport const useChatViewContext = (): ChatViewContextProps =>\n useContext(ChatViewContext);\n","import React from \"react\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function MessageListLoading() {\n return <div className=\"message-list-loading-wrapper\"></div>;\n}\n\nexport function ChatItemLoading() {\n return (\n <div className=\"chart-item-loading-wrapper\">\n <div className=\"load\">\n <div></div>\n <div></div>\n <div></div>\n <div></div>\n </div>\n </div>\n );\n}\n\nexport function CommonLoading() {\n return (\n <div className=\"common-loading-wrapper\">\n <WrappedIcon icon=\"loading\" lib=\"antd\" spinning />\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { useChatViewContext, type Role } from \"../../ChatViewContext.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function Avatar({\n role,\n agentId,\n}: {\n role: Role;\n agentId?: string;\n}): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return !isUser && matchAgent ? (\n <WrappedIcon\n className=\"avatar\"\n {...matchAgent.icon}\n style={{\n color: `var(--theme-${matchAgent.icon.color}-color)`,\n background: `var(--theme-${matchAgent.icon.color}-background)`,\n }}\n />\n ) : (\n <div className={`avatar ${isUser ? \"user\" : \"robot\"}`} />\n );\n}\n","import React from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\ninterface GuideItemProps {\n text: string;\n prompts?: string[];\n}\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function GuideItem({ text, prompts }: GuideItemProps) {\n return (\n <div className=\"guide-item\">\n {text}\n <div className=\"prompts-list\">\n {prompts\n ? prompts.map((item, index) => (\n <WrappedLink key={index}>{item}</WrappedLink>\n ))\n : null}\n </div>\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\n\nexport function ProgressText({ text }: { text: string }): React.ReactNode {\n const renderText = useMemo(() => {\n // 文本末尾存在 \\n ```, 会导致在渲染快结束的时候突然有一个换行,在结束的时候,换行被干掉,导致页面闪动的情况\n // 所以在这里计算,如果文本将要关闭,则默认不然 \\n ``` 显示\n const newText = text.replace(/\\n[`]{0,3}$/, \"\");\n return newText;\n }, [text]);\n\n return <div className=\"progress-text\">{renderText}</div>;\n}\n","import { createContext, useContext } from \"react\";\nimport { MessageItem } from \"../../ChatViewContext\";\n\nexport const MsgItemContext = createContext<MessageItem>({} as MessageItem);\n\nexport const useMsgItemContext = (): MessageItem => useContext(MsgItemContext);\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n lazy,\n} from \"react\";\nimport {\n InstanceApi_postSearchV3,\n InstanceApi_PostSearchV3RequestBody,\n} from \"@next-api-sdk/cmdb-sdk\";\nimport { ChatItemLoading } from \"../../../Loading.js\";\nimport { useMsgItemContext } from \"../../MsgItemContext.js\";\nimport { getBasePath } from \"@next-core/runtime\";\nimport { http } from \"@next-core/http\";\n\nconst TableComponent = lazy(() => import(\"./Table/index.js\"));\nconst ChartComponent = lazy(() => import(\"./Chart/index.js\"));\n\ntype CustomLanguage =\n | \"easy_cmd_cmdb_instance_list\"\n | \"easy_cmd_monitor_dashboard\";\n\ninterface UseFetchDataProps {\n text: string;\n chatting: boolean;\n language: CustomLanguage;\n}\n\nfunction useFetchData({ text, chatting, language }: UseFetchDataProps) {\n const cahceTextRef = useRef<string>(\"\");\n const [isFetching, setIsFetching] = useState<boolean>(false);\n const [isEnd, setIsEnd] = useState<boolean>(false);\n const [isError, setIsError] = useState<boolean>(false);\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [parseData, setParseData] = useState<any>();\n const [data, setData] = useState<any>({});\n\n const requestPromise = useCallback(\n async (data: any) => {\n switch (language) {\n case \"easy_cmd_cmdb_instance_list\":\n return await InstanceApi_postSearchV3(data.objectId, {\n page: 1,\n page_size: 10,\n ...data,\n });\n case \"easy_cmd_monitor_dashboard\":\n return await http.request<any>(\n `${getBasePath()}/api/gateway/logic.data_exchange/api/v1/data_exchange/olap`,\n {\n method: \"POST\",\n body: text,\n }\n );\n }\n },\n [language, text, parseData]\n );\n\n const fetchData = useCallback(\n async (data: any) => {\n if (isFetching) return;\n setIsFetching(true);\n try {\n const response = await requestPromise(data);\n setData(response);\n setIsError(false);\n } catch {\n setIsError(true);\n }\n setIsFetching(false);\n setIsLoading(false);\n },\n [isFetching, requestPromise]\n );\n\n useEffect(() => {\n if (cahceTextRef.current !== text) {\n cahceTextRef.current = text;\n let data: InstanceApi_PostSearchV3RequestBody & { objectId: string };\n try {\n data = JSON.parse(text);\n } catch {\n setIsError(true);\n return;\n }\n setParseData(data);\n fetchData(data);\n }\n }, [text]);\n\n useEffect(() => {\n if (chatting) {\n if (text.match(/\\n[`]{0,3}$/)) {\n setIsEnd(true);\n }\n } else {\n setIsEnd(true);\n }\n }, [text, chatting, isFetching]);\n\n return {\n data,\n parseData,\n isError: isEnd && isError,\n isLoading: isLoading || isFetching,\n };\n}\n\nexport default function CustomComponent({\n text,\n language,\n}: {\n text: string;\n language: CustomLanguage;\n}) {\n const { chatting } = useMsgItemContext();\n\n const { data, parseData, isError, isLoading } = useFetchData({\n text,\n language,\n chatting: !!chatting,\n });\n\n const component = useMemo(() => {\n switch (language) {\n case \"easy_cmd_cmdb_instance_list\":\n return <TableComponent data={data?.list} params={parseData} />;\n case \"easy_cmd_monitor_dashboard\":\n return <ChartComponent data={data?.data} params={parseData} />;\n }\n }, [language, data, parseData]);\n\n return (\n <div className=\"custom-component-wrapper\">\n <div className=\"params\">\n <div className=\"params-tip\">【查询语句】: </div>\n <pre>\n <code>{text}</code>\n </pre>\n </div>\n {isLoading ? (\n <ChatItemLoading />\n ) : isError ? (\n <div className=\"error-tip\">【查询失败】</div>\n ) : (\n <>\n <div className=\"result-tip\">【查询结果】:</div>\n {component}\n </>\n )}\n </div>\n );\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { useNodeViewContext } from \"@prosemirror-adapter/react\";\nimport { ProgressText } from \"./ProgressText.js\";\nimport CustomComponent from \"./CustomComponent.js\";\n\nexport const CodeBlock = () => {\n const [language, setLanguage] = useState(\"\");\n const { contentRef, node } = useNodeViewContext();\n const defaultContent = useMemo(\n () => (\n <pre spellCheck={false}>\n <code ref={contentRef} />\n </pre>\n ),\n [contentRef]\n );\n\n const renderContent = useMemo(() => {\n if (!node.firstChild?.text) return null;\n const text = node.firstChild?.textContent;\n switch (language) {\n case \"easy_cmd_progress\":\n return <ProgressText text={text} />;\n case \"easy_cmd_cmdb_instance_list\":\n case \"easy_cmd_monitor_dashboard\":\n return <CustomComponent text={text} language={language} />;\n default:\n return defaultContent;\n }\n }, [node, language, defaultContent]);\n\n useEffect(() => {\n if (!language) {\n const {\n attrs: { language },\n } = node;\n if (language) {\n setLanguage(language);\n }\n }\n }, [node, language]);\n\n return renderContent;\n};\n","import React, { useEffect } from \"react\";\nimport {\n defaultValueCtx,\n Editor,\n rootCtx,\n editorViewOptionsCtx,\n} from \"@milkdown/core\";\nimport { EditorView } from \"prosemirror-view\";\nimport { Milkdown, useEditor, MilkdownProvider } from \"@milkdown/react\";\nimport { commonmark, codeBlockSchema } from \"@milkdown/preset-commonmark\";\nimport { nord } from \"@milkdown/theme-nord\";\nimport { gfm } from \"@milkdown/preset-gfm\";\nimport { prism } from \"@milkdown/plugin-prism\";\nimport { $view, replaceAll } from \"@milkdown/utils\";\nimport {\n ProsemirrorAdapterProvider,\n useNodeViewFactory,\n} from \"@prosemirror-adapter/react\";\nimport { CodeBlock } from \"./CodeBlock/index.js\";\n\nexport function MarkdownItem({ text }: { text: string }) {\n return (\n <div className=\"markdown-item\">\n <MilkdownProvider>\n <ProsemirrorAdapterProvider>\n <MarkdownDisplay value={text} />\n </ProsemirrorAdapterProvider>\n </MilkdownProvider>\n </div>\n );\n}\n\nfunction hasURLProtocol(url: any) {\n return (\n url.startsWith(\"http://\") ||\n url.startsWith(\"https://\") ||\n url.startsWith(\"file://\") ||\n url.startsWith(\"data:\") ||\n url.startsWith(\"ts://?ts\") ||\n url.startsWith(\"ts:?ts\")\n );\n}\n\nexport function MarkdownDisplay({ value }: { value: string }): React.ReactNode {\n const nodeViewFactory = useNodeViewFactory();\n\n const handleClick = (view: EditorView, pos: number) => {\n const found = view.state.tr.doc.nodeAt(pos);\n\n if (found && found.marks.length > 0) {\n const mark = found.marks.find((m) => m.type.name === \"link\");\n const href = mark?.attrs.href;\n let path: string;\n\n if (hasURLProtocol(href)) {\n path = href;\n } else {\n path = encodeURIComponent(href);\n }\n\n window.open(path, \"_blank\");\n }\n return true;\n };\n\n const { get } = useEditor((root) => {\n return Editor.make()\n .config((ctx) => {\n ctx.set(rootCtx, root);\n ctx.update(editorViewOptionsCtx, (prev: any) => ({\n ...prev,\n editable: () => false,\n handleClickOn: (view: EditorView, pos: number) =>\n handleClick(view, pos),\n }));\n value && ctx.set(defaultValueCtx, value);\n //拦截link的默认点击事件以支持通过新窗口弹出页面,如果后续有其他的定制化需求可以改用custom widget的方式写link widget\n const observer = new MutationObserver(() => {\n const links = Array.from(root.querySelectorAll(\"a\"));\n links.forEach((link) => {\n link.onclick = () => false;\n });\n });\n observer.observe(root, {\n childList: true,\n subtree: true,\n });\n })\n .config(nord)\n .use(prism)\n .use(gfm)\n .use(commonmark)\n .use(\n $view(codeBlockSchema.node, () =>\n nodeViewFactory({ component: CodeBlock })\n )\n );\n }, []);\n\n useEffect(() => {\n if (value !== undefined) {\n get()?.action(replaceAll(value));\n }\n }, [get, value]);\n\n return <Milkdown />;\n}\n","import React from \"react\";\n// import { wrapBrick } from \"@next-core/react-element\";\n// import type {\n// EoNextTable,\n// NextTableComponentProps,\n// } from \"@next-bricks/advanced/next-table\";\n\ninterface MarkdownItemProps {\n text: string;\n}\n\n// const WrappedNextTable = wrapBrick<EoNextTable, NextTableComponentProps>(\n// \"eo-next-table\"\n// );\n\nexport function TableItem({ text }: MarkdownItemProps) {\n // const parseContent = useMemo((): NextTableComponentProps => {\n // let content: NextTableComponentProps;\n // try {\n // content = JSON.parse(text);\n // } catch {\n // content = {} as NextTableComponentProps;\n // }\n // return content;\n // }, [text]);\n\n // return (\n // <div className=\"table-item\">\n // <WrappedNextTable pagination={false} {...parseContent} />\n // </div>\n // );\n return <div className=\"table-item\">{text}</div>;\n}\n","import React from \"react\";\n\ninterface TextItem {\n text: string;\n}\n\nexport function TextItem({ text }: TextItem) {\n return <div className=\"text-item\">{text}</div>;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { copyToClipboard as _copyToClipboard } from \"@next-bricks/basic/data-providers/copy-to-clipboard\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { MessageItem, useChatViewContext } from \"../../ChatViewContext\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport classNames from \"classnames\";\n\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst copyToClipboard = unwrapProvider<typeof _copyToClipboard>(\n \"basic.copy-to-clipboard\"\n);\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\n\nexport function Toolbar({\n role,\n content,\n chatting,\n taskId,\n tag,\n}: MessageItem): React.ReactNode {\n const isAssistant = useMemo(\n () => role === \"assistant\" && content.type !== \"load\",\n [role, content.type]\n );\n const isChattingItem = useMemo(() => chatting, [chatting]);\n const { showLike, readonly, handleIsLike } = useChatViewContext();\n\n const handleCopy = () => {\n copyToClipboard(content.text)\n .then(() => showNotification({ type: \"success\", message: \"复制成功\" }))\n .catch(() => showNotification({ type: \"error\", message: \"复制失败\" }));\n };\n\n const handleLikeOrIsLike = useCallback(\n async (islike: boolean) => {\n const result = await handleIsLike(taskId!, islike);\n showNotification({\n message: `${islike ? \"点赞\" : \"操作\"}${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n },\n [taskId, handleIsLike]\n );\n\n return isAssistant && !isChattingItem ? (\n <div className=\"toolbar\">\n {showLike && !readonly && (\n <>\n <WrappedToolTip content=\"点赞\" hoist>\n <WrapperIcon\n className={classNames(\"like\", {\n active: tag?.isLike === true,\n })}\n lib=\"easyops\"\n icon=\"like\"\n onClick={() => handleLikeOrIsLike(true)}\n />\n </WrappedToolTip>\n <WrappedToolTip content=\"还不够好\" hoist>\n <WrapperIcon\n className={classNames(\"unlike\", {\n active: tag?.isLike === false,\n })}\n lib=\"easyops\"\n icon=\"unlike\"\n onClick={() => handleLikeOrIsLike(false)}\n />\n </WrappedToolTip>\n <div className=\"split\" />\n </>\n )}\n <WrappedToolTip content=\"点击复制\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"copy\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import moment from \"moment\";\nimport React from \"react\";\n\nexport function Time({ time }: { time?: string | number }) {\n return (\n <div className=\"time\">\n {time\n ? typeof time === \"string\"\n ? time\n : moment(time).format(\"YYYY-MM-DD HH:mm:ss\")\n : null}\n </div>\n );\n}\n","import React, { useMemo } from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport { useChatViewContext, type MessageItem } from \"../../ChatViewContext\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrapperIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nexport function ContentTip({ role, content }: MessageItem): React.ReactNode {\n const isUser = useMemo(() => role === \"user\", [role]);\n\n const { chatting, readonly, setSearchStr } = useChatViewContext();\n\n const handleCopy = () => {\n setSearchStr(content.text);\n };\n\n return !readonly && isUser && !chatting ? (\n <div className=\"content-tip\">\n <WrappedToolTip content=\"点击再次提问\" hoist>\n <WrapperIcon lib=\"antd\" icon=\"edit\" onClick={handleCopy} />\n </WrappedToolTip>\n </div>\n ) : null;\n}\n","import React, { useCallback, useMemo } from \"react\";\nimport {\n MessageItem,\n MessageItemContent,\n useChatViewContext,\n} from \"../../ChatViewContext.js\";\nimport { GuideItem } from \"./GuideItem.js\";\nimport { MarkdownItem } from \"./Markdown/index.js\";\nimport { TableItem } from \"./TableItem.js\";\nimport { ChatItemLoading } from \"../Loading.js\";\nimport { TextItem } from \"./TextItem.js\";\nimport { Toolbar } from \"./Toolbar.js\";\nimport { Time } from \"./Time.js\";\nimport { ContentTip } from \"./ContentTip.js\";\nimport { MsgItemContext } from \"./MsgItemContext.js\";\n\nconst NOT_AGENT_MATCH = \"no_agent\";\n\nexport function MessageNode(props: MessageItem): React.ReactNode {\n const { content, created, role, agentId } = props;\n const isUser = useMemo(() => role === \"user\", [role]);\n const { quickAnswerConfig } = useChatViewContext();\n\n const getContentNode = useCallback((content: MessageItemContent) => {\n const { type, text, examplePrompts } = content;\n switch (type) {\n case \"guide\":\n return <GuideItem text={text} prompts={examplePrompts} />;\n case \"text\":\n return <TextItem text={text} />;\n case \"table\":\n return <TableItem text={text} />;\n case \"load\":\n return <ChatItemLoading />;\n case \"markdown\":\n default:\n return <MarkdownItem text={text} />;\n }\n }, []);\n\n const messageNode = useMemo(\n () => getContentNode(content),\n [content, getContentNode]\n );\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const matchAgent = useMemo(() => {\n return agentList.find((item) => item.id === agentId);\n }, [agentList, agentId]);\n\n return (\n <MsgItemContext.Provider value={props}>\n <div className=\"message-box\">\n <div className=\"message-top\">\n {isUser\n ? \"我\"\n : !agentId || agentId === NOT_AGENT_MATCH || !matchAgent\n ? \"AI助手\"\n : matchAgent.name}\n <Time time={created} />\n </div>\n <div className=\"message-content\">\n <div className=\"wrapper\">\n <div className=\"content\">{messageNode}</div>\n\n <ContentTip {...props} />\n <Toolbar {...props} />\n </div>\n </div>\n </div>\n </MsgItemContext.Provider>\n );\n}\n","import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useChatViewContext } from \"../../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport interface AgentDetailItem {\n name: string;\n description: string;\n icon: GeneralIconProps & { color: string };\n starterPrompts?: string[];\n instanceId: string;\n id: string;\n [key: string]: any;\n}\n\nconst CARD_ITEM_HEIGHT = 85;\nconst HEIGHT_GAP = 24;\n\nfunction QuickAnswerCardItem({\n name,\n description,\n icon,\n starterPrompts,\n}: AgentDetailItem) {\n const { setSearchStr } = useChatViewContext();\n\n const handleCardClick = () => {\n starterPrompts?.length && setSearchStr(starterPrompts[0]);\n };\n\n const iconColor = useMemo(() => icon?.color ?? \"geekblue\", [icon]);\n\n return (\n <div\n className=\"quick-answer-card-item\"\n style={{\n height: CARD_ITEM_HEIGHT,\n background: `linear-gradient(rgba(var(--theme-${iconColor}-color-rgb-channel), 0.1), rgba(var(--theme-${iconColor}-color-rgb-channel), 0.08))`,\n }}\n onClick={handleCardClick}\n >\n <div className=\"left\">\n <WrappedIcon\n className=\"icon\"\n {...(icon ?? {\n icon: \"default-app\",\n lib: \"easyops\",\n category: \"app\",\n })}\n style={{\n background: `rgba(var(--theme-${iconColor}-color-rgb-channel), 0.5)`,\n }}\n />\n </div>\n <div className=\"content\">\n <div className=\"title\">{name}</div>\n <div className=\"description\">{description}</div>\n </div>\n </div>\n );\n}\n\nexport function QuickAnswerList() {\n const { quickAnswerConfig, msgList, loading } = useChatViewContext();\n const [showMoreBtn, setShowMoreBtn] = useState<boolean>(false);\n const listRef = useRef<HTMLDivElement>(null);\n const hadClickShowMoreBtn = useRef<boolean>(false);\n\n const handleShowMoreClick = () => {\n hadClickShowMoreBtn.current = true;\n setShowMoreBtn(false);\n };\n\n useEffect(() => {\n const element = listRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (\n entry.contentRect.height >\n CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2\n ) {\n if (!hadClickShowMoreBtn.current) {\n setShowMoreBtn(true);\n }\n } else {\n setShowMoreBtn(false);\n }\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [showMoreBtn, quickAnswerConfig?.list]);\n\n return quickAnswerConfig?.list.length && msgList.length === 0 && !loading ? (\n <div className=\"quick-answer-wrapper\">\n <div className=\"tip\">\n {quickAnswerConfig.tip ??\n \"你好,我是运维数智人 — Murphy,我能为你提供以下服务:\"}\n </div>\n <div\n className=\"quick-answer-list\"\n style={{\n ...(showMoreBtn\n ? {\n maxHeight: CARD_ITEM_HEIGHT * 3 + HEIGHT_GAP * 2 + 10,\n overflow: \"hidden\",\n }\n : {}),\n }}\n ref={listRef}\n >\n {quickAnswerConfig.list.map((item) => (\n <QuickAnswerCardItem key={item.instanceId} {...item} />\n ))}\n </div>\n {showMoreBtn ? (\n <div className=\"show-more-wrapper\">\n <WrappedLink\n icon={{\n lib: \"antd\",\n icon: \"down\",\n }}\n className=\"show-more-btn\"\n onClick={handleShowMoreClick}\n >\n 显示更多\n </WrappedLink>\n </div>\n ) : null}\n </div>\n ) : null;\n}\n","import React from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type { Link, LinkProps } from \"@next-bricks/basic/link\";\n\nconst WrappedLink = wrapBrick<Link, LinkProps>(\"eo-link\");\n\nexport function StopBtn() {\n const { stopChat } = useChatViewContext();\n\n const handleStopChat = () => {\n stopChat();\n };\n return (\n <div className=\"stop-responding-wrapper\">\n <WrappedLink className=\"stop-btn\" onClick={handleStopChat}>\n 停止生成\n </WrappedLink>\n </div>\n );\n}\n","import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { MessageItem, useChatViewContext } from \"../ChatViewContext\";\nimport { Avatar } from \"./MessageItem/Avatar.js\";\nimport classNames from \"classnames\";\nimport { CommonLoading, MessageListLoading } from \"./Loading.js\";\nimport { MessageNode } from \"./MessageItem/index.js\";\nimport { QuickAnswerList } from \"./QuickAnswerList/index.js\";\nimport { debounce } from \"lodash\";\nimport { StopBtn } from \"./StopBtn.js\";\n\ninterface MessageListProps {\n showAvatar?: boolean;\n}\n\nconst DEFAULT_OFFSET_HEIGHT = 80;\nconst CACHE_HEIGHT = 200;\n\nexport function MessageList({\n showAvatar = true,\n}: MessageListProps): React.ReactNode {\n const chatViewRef = useRef<HTMLDivElement>(null);\n const messgetListBoxRef = useRef<HTMLDivElement>(null);\n const [preHeight, setPreHeight] = useState<number>(0);\n const isCustomScroll = useRef<boolean>(false);\n\n const {\n msgLoading,\n msgEnd,\n msgList,\n loading,\n activeSessionId,\n chatting,\n checkSession,\n } = useChatViewContext();\n\n const getMsgItemNode = useCallback(\n (item: MessageItem, index: number = 0) => {\n return (\n <div\n className={classNames(\"message-item\", { user: item.role === \"user\" })}\n key={index}\n >\n {showAvatar && <Avatar role={item.role} agentId={item.agentId} />}\n <MessageNode {...item} />\n </div>\n );\n },\n [showAvatar]\n );\n\n const msgListNode = useMemo(() => {\n return msgList.map((item, index) => {\n if (item.chatting) {\n return (\n <>\n {getMsgItemNode(item, index)}\n {chatting && index === msgList.length - 1 ? <StopBtn /> : null}\n </>\n );\n } else {\n return getMsgItemNode(item, index);\n }\n });\n }, [msgList, chatting, getMsgItemNode]);\n\n const handleScroll = useCallback(() => {\n const messageList = chatViewRef.current;\n if (messageList) {\n const { scrollHeight, clientHeight, scrollTop } = messageList;\n // 滚动到底部所需的高度 = 总高度 - 视图高度\n const isBottom = scrollHeight - clientHeight === scrollTop;\n if (!isBottom) {\n isCustomScroll.current = true;\n } else if (isBottom && isCustomScroll.current) {\n // 自动吸低\n isCustomScroll.current = false;\n }\n if (\n !msgLoading &&\n !msgEnd &&\n scrollTop < CACHE_HEIGHT &&\n activeSessionId\n ) {\n checkSession();\n }\n }\n }, [msgEnd, msgLoading, activeSessionId, checkSession]);\n\n const debounceHandleScroll = debounce(handleScroll, 200);\n\n useEffect(() => {\n if (chatting || activeSessionId) {\n // 聊天或者会话变更时,重置滚动状态\n isCustomScroll.current = false;\n }\n }, [chatting, activeSessionId]);\n\n useEffect(() => {\n const element = messgetListBoxRef.current;\n if (element) {\n const observer = new ResizeObserver((entries) => {\n let newHeight: number = 0;\n // 如果存在用户行为,不触发自动滚动行为\n if (isCustomScroll.current) return;\n for (const entry of entries) {\n newHeight = entry.contentRect.height - DEFAULT_OFFSET_HEIGHT;\n }\n if (!loading && !chatting) {\n // 高度变化,代表消息新增,自动滚动到最下\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n }\n if (newHeight > preHeight && chatting) {\n chatViewRef.current!.scroll({\n top: Number.MAX_SAFE_INTEGER,\n });\n setPreHeight(Math.max(preHeight, newHeight));\n }\n });\n observer.observe(element);\n return () => observer.disconnect();\n }\n }, [chatting, loading, preHeight]);\n\n return (\n <div\n className=\"chat-view\"\n ref={chatViewRef}\n onScroll={debounceHandleScroll}\n >\n <div className=\"message-list\">\n <div className=\"message-list-box\" ref={messgetListBoxRef}>\n {msgEnd && msgList.length ? (\n <div className=\"message-start-tip\">会话开始</div>\n ) : null}\n {msgLoading && <CommonLoading />}\n <QuickAnswerList />\n {msgListNode}\n </div>\n {loading && <MessageListLoading />}\n </div>\n </div>\n );\n}\n","const HIDDEN_TEXTAREA_STYLE = `\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n padding: 10px !important;\n pointer-events: none !important;\n`;\n\nconst SIZING_STYLE = [\n \"letter-spacing\",\n \"line-height\",\n \"padding-top\",\n \"padding-bottom\",\n \"font-family\",\n \"font-weight\",\n \"font-size\",\n \"font-variant\",\n \"text-rendering\",\n \"text-transform\",\n \"width\",\n \"text-indent\",\n \"padding-left\",\n \"padding-right\",\n \"border-width\",\n \"box-sizing\",\n \"word-break\",\n \"white-space\",\n];\nlet hiddenTextarea: HTMLTextAreaElement;\n\n/**\n * 计算 textare 高度\n * https://github.com/react-component/textarea/blob/1c0026fbe30e5f7dff1fca695b2cf262246381ca/src/calculateNodeHeight.tsx\n * */\nexport default function calculateAutoSizeStyle(\n uiTextNode: HTMLTextAreaElement,\n minRows: number | null = null,\n maxRows: number | null = null\n): React.CSSProperties {\n if (!hiddenTextarea) {\n hiddenTextarea = document.createElement(\"textarea\");\n hiddenTextarea.setAttribute(\"tab-index\", \"-1\");\n hiddenTextarea.setAttribute(\"aria-hidden\", \"true\");\n document.body.appendChild(hiddenTextarea);\n }\n\n const uiTextNodeStyle = window.getComputedStyle(uiTextNode);\n const sizingStyle = SIZING_STYLE.map(\n (name) => `${name}:${uiTextNodeStyle.getPropertyValue(name)}`\n ).join(\";\");\n\n // equal style\n hiddenTextarea.setAttribute(\n \"style\",\n `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`\n );\n hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || \"\";\n\n let minHeight: number | undefined = undefined;\n let maxHeight: number | undefined = undefined;\n // let overflowY: any;\n\n const borderSize = 2;\n const paddingSize = 20;\n let height = hiddenTextarea.scrollHeight - paddingSize + borderSize;\n\n if (minRows !== null || maxRows !== null) {\n // measure height of a textarea with a single row\n hiddenTextarea.value = \" \";\n const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;\n if (minRows !== null) {\n minHeight = singleRowHeight * minRows - paddingSize + borderSize;\n height = Math.max(paddingSize, height);\n }\n if (maxRows !== null) {\n maxHeight = singleRowHeight * maxRows - paddingSize + borderSize;\n // overflowY = height > maxHeight ? \"\" : \"hidden\";\n height = Math.min(maxHeight, height);\n }\n }\n\n const style: React.CSSProperties = {\n height,\n overflowY: \"scroll\",\n resize: \"none\",\n };\n\n if (minHeight) {\n style.minHeight = minHeight;\n }\n if (maxHeight) {\n style.maxHeight = maxHeight;\n }\n\n return style;\n}\n","import React, {\n ChangeEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport type { EoTooltip, ToolTipProps } from \"@next-bricks/basic/tooltip\";\nimport calculateAutoSizeStyle from \"./utils/calculateAutoSizeStyle.js\";\nimport classNames from \"classnames\";\nimport { useChatViewContext } from \"../ChatViewContext.js\";\nimport { AgentDetailItem } from \"./QuickAnswerList/index\";\n\nconst WrappedToolTip = wrapBrick<EoTooltip, ToolTipProps>(\"eo-tooltip\");\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\n\nconst PREFIX_WORD = \"@\";\n\nexport function SearchInput(): React.ReactNode {\n const [value, setValue] = useState<string>(\"\");\n const [active, setActive] = useState<boolean>(false);\n const [expand, setExpand] = useState<boolean>(false);\n const [autoSizeStyle, setAutoSizeStyle] = useState<React.CSSProperties>();\n const [isFillContent, setIsFillContent] = useState<boolean>(false);\n\n // mention\n const [mentionOpen, setMentionOpen] = useState<boolean>(false);\n const [matchPrefixIndex, setMatchPrefixIndex] = useState<number>(-1);\n const [matchAgentList, setMatchMentionList] = useState<AgentDetailItem[]>([]);\n const [matchMentionsIndex, setMatchMentionsIndex] = useState<number>(0);\n\n const mentionsRef = useRef<HTMLDivElement>(null);\n const searchInputBoxRef = useRef<HTMLDivElement>(null);\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const hadExpanded = useRef<boolean>(false);\n const inputEndRef = useRef<boolean>(false);\n\n const {\n chatting,\n loading,\n searchStr,\n quickAnswerConfig,\n createSession,\n setSearchStr,\n handleChat,\n setAgent,\n } = useChatViewContext();\n\n const agentList = useMemo(\n () => quickAnswerConfig?.list ?? [],\n [quickAnswerConfig]\n );\n\n const hadValue = useMemo(() => !!value, [value]);\n const defaultSize = useMemo(() => [1, 5], []);\n const disabled = useMemo(() => loading || chatting, [chatting, loading]);\n\n const matchPrefixInfo = useMemo(() => {\n const textareaElement = textareaRef.current!;\n if (matchPrefixIndex >= 0 && value) {\n const currentFocusIndex = textareaElement.selectionStart;\n let matchWord = \"\";\n for (let i = matchPrefixIndex + 1; i < currentFocusIndex; i++) {\n // 匹配中文英文数字\n if (/[\\u4e00-\\u9fa5]|\\w|\\d/.test(value[i]) || inputEndRef.current) {\n matchWord = matchWord + value[i];\n } else {\n setMatchPrefixIndex(-1);\n return false;\n }\n }\n return {\n start: matchPrefixIndex + 1,\n end: currentFocusIndex,\n word: matchWord,\n };\n }\n return false;\n }, [matchPrefixIndex, value]);\n\n const handleAgentItemSelect = useCallback(\n (item: AgentDetailItem) => {\n if (matchPrefixInfo) {\n const { start, end } = matchPrefixInfo;\n const valueList = value.split(\"\");\n const trimName = item.name.replace(/\\s+/g, \"\") + \" \";\n const focusIndex = start + trimName.length;\n valueList.splice(start, end - start, trimName);\n setValue(valueList.join(\"\"));\n setMatchPrefixIndex(-1);\n\n setTimeout(() => {\n textareaRef.current!.selectionStart = focusIndex;\n textareaRef.current!.selectionEnd = focusIndex;\n textareaRef.current!.focus();\n }, 0);\n }\n },\n [matchPrefixInfo, value]\n );\n\n const isShowMentions = useMemo(() => {\n return matchAgentList.length && mentionOpen;\n }, [matchAgentList, mentionOpen]);\n\n const mentions = useMemo(() => {\n return isShowMentions ? (\n <div className=\"mentions-list-wrapper\" ref={mentionsRef}>\n <div className=\"content\">\n <div className=\"mentions-title\">Agents</div>\n <div className=\"mentions-list\">\n {matchAgentList.slice(0, 10).map((item, index) => {\n return (\n <div\n className={classNames(\"mentions-item\", {\n active: index === matchMentionsIndex,\n })}\n key={index}\n onClick={() => handleAgentItemSelect(item)}\n >\n <WrappedIcon\n className=\"icon\"\n {...item.icon}\n style={{\n color: `var(--theme-${item.icon.color}-color)`,\n background: `var(--theme-${item.icon.color}-background)`,\n }}\n />\n <div className=\"name\">{item.name}</div>\n <div className=\"description\">{item.description}</div>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n ) : null;\n }, [\n matchAgentList,\n matchMentionsIndex,\n isShowMentions,\n handleAgentItemSelect,\n ]);\n\n const computedAutoSize = useCallback(\n (size = defaultSize) => {\n if (hadExpanded.current && expand) return;\n const textareaElement = textareaRef.current as HTMLTextAreaElement;\n if (textareaElement) {\n const textareaStyles = calculateAutoSizeStyle(\n textareaElement,\n size[0],\n size[1]\n );\n\n setAutoSizeStyle(textareaStyles);\n }\n hadExpanded.current = expand;\n },\n [defaultSize, expand]\n );\n\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLTextAreaElement> | string): void => {\n const value = typeof e === \"string\" ? e : e.target.value;\n setValue(value);\n textareaRef.current!.value = value;\n },\n []\n );\n\n const handleCompositionStart = () => {\n inputEndRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n inputEndRef.current = false;\n };\n\n const hanldeCreateSession = () => {\n createSession();\n };\n\n const handleExpand = useCallback(() => {\n setExpand((value) => {\n return !value;\n });\n }, []);\n\n const matchFirstAgent = useCallback(\n (value: string) => {\n const regex = /@([\\u4e00-\\u9fa5|\\w|\\d]+)/g;\n\n // 在字符串中循环匹配正则表达式\n let match: RegExpExecArray | null;\n while ((match = regex.exec(value)) !== null) {\n if (match) {\n const agent = agentList?.find(\n (item) => item.name.replace(/\\s+/g, \"\") === match![1]\n );\n agent && setAgent(agent.id);\n if (agent) break;\n }\n }\n },\n [agentList, setAgent]\n );\n\n const handleSubmit = useCallback(() => {\n if (!hadValue || !textareaRef.current || disabled) return;\n\n matchFirstAgent(value);\n handleChat(value);\n\n setActive(false);\n setExpand(false);\n handleChange(\"\");\n textareaRef.current.blur();\n }, [value, hadValue, disabled, handleChat, handleChange, matchFirstAgent]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === \"Enter\" && !e.shiftKey && !inputEndRef.current) {\n e.preventDefault();\n if (isShowMentions) {\n handleAgentItemSelect(matchAgentList[matchMentionsIndex]);\n } else {\n handleSubmit();\n }\n }\n if (isShowMentions) {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n setMatchMentionsIndex((index) => Math.max(0, index - 1));\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n setMatchMentionsIndex((index) =>\n Math.min(matchAgentList.length - 1, index + 1)\n );\n }\n }\n },\n [\n handleSubmit,\n handleAgentItemSelect,\n isShowMentions,\n matchAgentList,\n matchMentionsIndex,\n ]\n );\n\n const handleKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n const textareaElement = textareaRef.current!;\n\n const selectionIndex = textareaElement.selectionStart;\n const prefixWord = textareaElement.value[selectionIndex - 1];\n const beforeSelectionText = textareaElement.value.slice(\n 0,\n selectionIndex\n );\n const index = beforeSelectionText.lastIndexOf(PREFIX_WORD);\n\n if (\n e.key === \"Escape\" ||\n (!isShowMentions &&\n [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"].indexOf(e.key) !==\n -1)\n ) {\n setMatchPrefixIndex(-1);\n return;\n }\n\n if (prefixWord === PREFIX_WORD) {\n setMatchPrefixIndex(selectionIndex - 1);\n } else {\n setMatchPrefixIndex(index);\n }\n },\n [isShowMentions]\n );\n\n useEffect(() => {\n if (searchStr) {\n handleChange(searchStr.trim());\n textareaRef.current?.focus();\n setSearchStr(\"\");\n }\n }, [searchStr, disabled, setSearchStr, handleChange]);\n\n useEffect(() => {\n computedAutoSize(expand ? [20, 20] : undefined);\n }, [value, expand, computedAutoSize]);\n\n useEffect(() => {\n const searchInputBox = searchInputBoxRef.current;\n if (searchInputBox) {\n const observe = new ResizeObserver(() => {\n const { width: currentWidth } = searchInputBox.getBoundingClientRect();\n const FIT_CONTENT_WIDTH = 900;\n\n setIsFillContent(currentWidth < FIT_CONTENT_WIDTH);\n });\n\n observe.observe(searchInputBox);\n\n return () => {\n observe.disconnect();\n };\n }\n }, []);\n\n useEffect(() => {\n if (!chatting && textareaRef.current) {\n textareaRef.current?.focus();\n }\n }, [chatting]);\n\n useEffect(() => {\n if (agentList?.length && matchPrefixInfo) {\n const filterList =\n matchPrefixInfo.word === \"\"\n ? agentList\n : agentList.filter((item) =>\n item.name.includes(matchPrefixInfo.word)\n );\n\n setMatchMentionList(filterList);\n setMatchMentionsIndex(0);\n setMentionOpen(true);\n } else {\n setMatchMentionList([]);\n setMentionOpen(false);\n }\n }, [matchPrefixInfo, agentList]);\n\n useEffect(() => {\n if (matchMentionsIndex >= 0 && mentionsRef.current) {\n const element = mentionsRef.current.querySelector(\n \".mentions-item.active\"\n );\n element?.scrollIntoView({ block: \"nearest\" });\n }\n }, [matchMentionsIndex]);\n\n useEffect(() => {\n const handleDocumentClick = (e: any) => {\n const mentionsElemnt = mentionsRef.current;\n if (mentionsElemnt && !mentionsElemnt.contains(e.composedPath()[0])) {\n setMentionOpen(false);\n }\n };\n\n document.addEventListener(\"click\", handleDocumentClick);\n\n return () => {\n document.removeEventListener(\"click\", handleDocumentClick);\n };\n }, []);\n\n return (\n <div\n className={classNames(\"search-input-box\", {\n \"fill-content\": isFillContent,\n })}\n ref={searchInputBoxRef}\n >\n {mentions}\n <div\n className={classNames(\"input-box\", {\n active,\n disabled,\n expand,\n })}\n >\n <textarea\n value={value}\n ref={textareaRef}\n style={{\n ...autoSizeStyle,\n paddingRight: expand ? \"50px\" : \"140px\",\n }}\n placeholder={chatting ? \"回复中,请稍等...\" : \"提出你的想法...\"}\n onFocus={() => setActive(true)}\n onBlur={() => setActive(false)}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onKeyUpCapture={handleKeyUp}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n />\n <span className=\"suffix-icon\">\n <WrappedToolTip content=\"新增会话\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"plus-circle\"\n onClick={hanldeCreateSession}\n />\n </WrappedToolTip>\n {!expand && (\n <WrappedToolTip content=\"放大\">\n <WrappedIcon\n lib=\"antd\"\n icon=\"arrows-alt\"\n onClick={handleExpand}\n />\n </WrappedToolTip>\n )}\n <div className=\"submit-split\"></div>\n <WrappedToolTip content=\"提交\">\n <WrappedIcon\n className={classNames(\"submit-btn\", {\n active: hadValue,\n disabled: !hadValue || disabled,\n })}\n lib={chatting ? \"antd\" : \"easyops\"}\n icon={chatting ? \"loading\" : \"release-management-fill\"}\n category={chatting ? \"\" : \"menu\"}\n spinning={chatting}\n onClick={handleSubmit}\n />\n </WrappedToolTip>\n </span>\n <span className=\"toolbar-icon\">\n {expand && (\n <WrappedToolTip content=\"缩小\">\n <WrappedIcon lib=\"antd\" icon=\"shrink\" onClick={handleExpand} />\n </WrappedToolTip>\n )}\n </span>\n </div>\n {hadValue && (\n <div className=\"search-input-toolbar\">\n <div className=\"input-tip\">Shift + Enter 换行</div>\n </div>\n )}\n </div>\n );\n}\n","import React, { useCallback, useEffect, useRef } from \"react\";\nimport { useChatViewContext } from \"../ChatViewContext\";\nimport classNames from \"classnames\";\nimport { debounce } from \"lodash\";\nimport { SessionItem as SessionItemProps } from \"../ChatService\";\nimport { CommonLoading } from \"./Loading.js\";\nimport type {\n GeneralIcon,\n GeneralIconProps,\n} from \"@next-bricks/icons/general-icon\";\nimport { wrapBrick } from \"@next-core/react-element\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport type { showDialog as _showDialog } from \"@next-bricks/basic/data-providers/show-dialog/show-dialog\";\nimport type { showNotification as _showNotification } from \"@next-bricks/basic/data-providers/show-notification/show-notification\";\n\nconst showNotification = unwrapProvider<typeof _showNotification>(\n \"basic.show-notification\"\n);\nconst WrappedIcon = wrapBrick<GeneralIcon, GeneralIconProps>(\"eo-icon\");\nconst showDialog = unwrapProvider<typeof _showDialog>(\"basic.show-dialog\");\n\nconst SESSION_ITEM_HEIGHT = 42;\nconst BUFFER_NUMBER = 5;\nconst CACHE_HEIGHT = 100;\n\nexport function SessionList(): React.ReactNode {\n const { sessionEnd, sessionLoading, sessionList, querySessionHistory } =\n useChatViewContext();\n const sessionWrapperRef = useRef<HTMLDivElement>(null);\n const sessionListRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n // 计算视图内可以展示多少条会话历史数据\n let limit = 20;\n const sessionWrapper = sessionWrapperRef.current;\n if (sessionWrapper) {\n // limit = 视图高度 % 单条高度 + 缓冲长度\n limit =\n Math.floor(sessionWrapper.clientHeight / SESSION_ITEM_HEIGHT) +\n BUFFER_NUMBER;\n }\n querySessionHistory(limit);\n }, []);\n\n const checkSessionList = useCallback(() => {\n if (sessionLoading || sessionEnd) return;\n const sessionList = sessionListRef.current;\n if (sessionList) {\n const { scrollTop, scrollHeight, clientHeight } = sessionList;\n // 如果滚动的高度 + 视图高度 + 缓冲高度 > 视图的滚动高度,请求新的数据\n if (scrollTop + clientHeight + CACHE_HEIGHT > scrollHeight) {\n querySessionHistory();\n }\n }\n }, [querySessionHistory, sessionLoading, sessionEnd]);\n\n const handleScroll = debounce(checkSessionList, 200);\n\n return (\n <div className=\"session-list-wrapper\" ref={sessionWrapperRef}>\n <div className=\"session-title\">历史对话</div>\n <div\n className=\"session-list\"\n ref={sessionListRef}\n onScroll={handleScroll}\n >\n {sessionList.map((item, index) => {\n return <SessionItem key={index} {...item} />;\n })}\n {sessionLoading && <CommonLoading />}\n {/* {sessionEnd && <div className=\"session-end-tip\">到底啦</div>} */}\n </div>\n </div>\n );\n}\n\nfunction SessionItem({ title, conversationId }: SessionItemProps) {\n const { activeSessionId, checkSession, deleteSession } = useChatViewContext();\n\n const handleCheckSession = useCallback(() => {\n checkSession(conversationId, true);\n }, [conversationId, checkSession]);\n\n const handleDeleteSession = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n showDialog({\n type: \"confirm\",\n title: \"会话删除确认\",\n content: `请输入 {{ expect }} 以确认删除`,\n expect: title.replace(/\\s+/g, \"\"),\n }).then(async () => {\n const result = await deleteSession([conversationId]);\n showNotification({\n message: `删除会话${result ? \"成功\" : \"失败\"}`,\n type: result ? \"success\" : \"error\",\n });\n });\n },\n [conversationId, deleteSession, title]\n );\n\n return (\n <div\n key={title}\n className={classNames(\"session-item\", {\n active: conversationId === activeSessionId,\n })}\n onClick={handleCheckSession}\n >\n <div className=\"content\">\n <div className=\"title\" title={title}>\n {title}\n </div>\n </div>\n\n <div className=\"session-close-btn\" onClick={handleDeleteSession}>\n <WrappedIcon icon=\"close\" lib=\"antd\" />\n </div>\n </div>\n );\n}\n","import { fetchEventSource } from \"@microsoft/fetch-event-source\";\nimport { http } from \"@next-core/http\";\nimport { getBasePath } from \"@next-core/runtime\";\nimport moment from \"moment\";\n\nexport interface SSEMessageItem {\n conversationId?: string;\n created: number | string;\n delta: {\n content: string;\n role: string;\n };\n taskId?: string;\n agentId?: string;\n}\n\nexport interface QueueItem {\n topic: string;\n message?: SSEMessageItem;\n}\n\nexport interface SessionItem {\n conversationId: string;\n isDelete: boolean;\n time: number;\n title: string;\n user: string;\n _row_id: string;\n}\n\nexport interface ChatItem {\n agentId: string;\n conversationId: string;\n input: string;\n output: string;\n taskId: string;\n time: number;\n inputTime: number;\n user: string;\n _row_id: string;\n tag: {\n isLike?: boolean;\n };\n}\n\nexport class ChatService {\n #debug: boolean;\n #ctrl?: AbortController;\n #agentId: string;\n #enterInterval: number;\n #charting = false;\n #isStartEmitEvent = false;\n #emitTimer: NodeJS.Timeout | undefined;\n #messageQueue: Array<QueueItem> = [];\n #subscribers: Record<string, Array<(msg?: SSEMessageItem) => void>> = {};\n #conversationId?: string;\n\n // 会话\n #sessionNextToken?: string;\n #cacheLimit?: number;\n\n // 消息\n #messageNextToken?: string;\n\n constructor({\n agentId,\n enterInterval = 50,\n debug = false,\n }: {\n agentId: string;\n enterInterval: number;\n debug: boolean;\n }) {\n this.#agentId = agentId;\n this.#enterInterval = enterInterval;\n this.#debug = debug;\n }\n\n enqueue(data: QueueItem) {\n this.#messageQueue.push(data);\n this.#startEmitEvent();\n }\n\n dequeue() {\n return this.#messageQueue.shift();\n }\n\n #clear() {\n this.#messageQueue.length = 0;\n }\n\n getMessageQueue() {\n return this.#messageQueue;\n }\n\n subscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (!this.#subscribers[topic]) {\n this.#subscribers[topic] = [];\n }\n this.#subscribers[topic].push(callback);\n }\n\n unsubscribe(topic: string, callback: (msg?: SSEMessageItem) => void) {\n if (this.#subscribers[topic]) {\n this.#subscribers[topic] = this.#subscribers[topic].filter(\n (cb) => cb !== callback\n );\n }\n }\n\n notifySubscribers(data: QueueItem) {\n const topic = data.topic;\n if (this.#subscribers[topic]) {\n this.#subscribers[topic].forEach((callback) => {\n callback(data?.message);\n });\n }\n }\n\n async setChatItemIsLike(id: string, isLike: boolean): Promise<boolean> {\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.CommentDialogue/conversation/comment`,\n {\n method: \"POST\",\n body: JSON.stringify({\n taskId: id,\n isLike,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n setAgentId(id: string) {\n this.#agentId = id;\n }\n\n setConversationId(id?: string) {\n this.#conversationId = id;\n }\n\n async getSessionHistory(limit?: number): Promise<SessionItem[]> {\n if (limit) {\n this.#cacheLimit = limit;\n }\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: SessionItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.ListConversation/conversation/list`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: this.#cacheLimit ?? 20,\n next_token: this.#sessionNextToken,\n }),\n }\n );\n this.#sessionNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"session.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取会话历史失败\");\n }\n return [];\n }\n\n async getChatHistory(id?: string): Promise<ChatItem[]> {\n if (id) {\n this.setConversationId(id);\n this.#messageNextToken = \"\";\n }\n if (!this.#conversationId) return [];\n try {\n const {\n data: { conversations, next_token },\n } = await http.request<{\n data: {\n conversations: ChatItem[];\n next_token: string;\n previous_token: string;\n };\n }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.GetAllDialogue/conversation/get/${this.#conversationId}`,\n {\n method: \"POST\",\n body: JSON.stringify({\n limit: 15,\n next_token: this.#messageNextToken,\n }),\n }\n );\n this.#messageNextToken = next_token;\n if (!next_token) {\n this.notifySubscribers({ topic: \"message.fetch.end\" });\n }\n return conversations;\n } catch {\n // eslint-disable-next-line no-console\n console.error(\"获取消息历史失败\");\n }\n return [];\n }\n\n async deleteSession(id: string[]): Promise<boolean> {\n if (!id.length) return false;\n let flag: boolean = false;\n try {\n const { code } = await http.request<{ code: number }>(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.conversation.DeleteConversation/conversation/delete`,\n {\n method: \"POST\",\n body: JSON.stringify({\n conversationIds: id,\n }),\n }\n );\n if (code === 0) {\n flag = true;\n }\n } catch {\n flag = false;\n }\n return flag;\n }\n\n splitWord(str: string) {\n if (!str) return [];\n // 单词长度小于 5 直接返回, 否则做单词分割处理\n if (str?.length < 5) return [str];\n const list = [];\n\n if (window.Intl) {\n const segmenterFr = new Intl.Segmenter(\"zh-Hans-CN\", {\n granularity: \"word\",\n });\n const iterator = segmenterFr.segment(str)[Symbol.iterator]();\n\n let nextWord = iterator.next();\n while (!nextWord.done) {\n list.push(nextWord.value.segment);\n nextWord = iterator.next();\n }\n } else {\n const customSplit = {\n [Symbol.split](str: string) {\n let pos = 0;\n const result = [];\n let cache = \"\";\n while (pos < str.length) {\n const matchStr = str.substring(pos, pos + 1);\n // 如果是中文,单个输出\n if (/[\\u4e00-\\u9fa5]/.test(matchStr)) {\n result.push(cache + matchStr);\n cache = \"\";\n } else {\n // 否则,遇到空格或者标点符号再分词\n if (!/\\s|[,。;《》?!,.:<>?!]]/.test(matchStr)) {\n cache = cache + matchStr;\n } else {\n result.push(cache + matchStr);\n cache = \"\";\n }\n }\n pos++;\n }\n if (cache) result.push(cache);\n return result;\n },\n };\n\n str.split(customSplit).forEach((word) => {\n list.push(word);\n });\n }\n\n return list;\n }\n\n async chat(str: string): Promise<void> {\n this.#ctrl = new AbortController();\n let hadMatchMessage = false;\n this.#charting = true;\n await fetchEventSource(\n `${getBasePath()}api/gateway/easyops.api.aiops_chat.manage.LLMChatProxy@1.0.0/api/aiops_chat/v1/chat/completions`,\n {\n method: \"POST\",\n signal: this.#ctrl.signal,\n body: JSON.stringify({\n agentId: this.#agentId,\n conversationId: this.#conversationId,\n input: str,\n stream: true,\n config: {\n debug: this.#debug,\n },\n }),\n headers: {\n \"giraffe-contract-name\": \"easyops.api.aiops_chat.manage.LLMChatProxy\",\n },\n onopen: async (response) => {\n if (response.ok) {\n // eslint-disable-next-line no-console\n console.log(\"open sse service success!\");\n } else {\n // eslint-disable-next-line no-console\n console.log(\"open sse service fail!\");\n }\n },\n onmessage: (msg) => {\n const { data } = msg;\n hadMatchMessage = true;\n if (data === \"[DONE]\") {\n this.#ctrl!.abort();\n return;\n }\n let result = {} as SSEMessageItem;\n try {\n result = JSON.parse(data);\n } catch {\n this.enqueue({\n topic: \"add\",\n message: {\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n delta: {\n role: \"assistant\",\n content: `\\`【数据格式错误】:\\` ${data}`,\n },\n agentId: this.#agentId,\n },\n });\n return;\n }\n if (!this.#conversationId) {\n this.setConversationId(result.conversationId);\n }\n const wordList = this.splitWord(result.delta.content);\n wordList.forEach((word) => {\n this.enqueue({\n topic: \"add\",\n message: {\n ...result,\n delta: {\n role: \"assistant\",\n content: word,\n },\n },\n });\n });\n },\n onclose: () => {\n // eslint-disable-next-line no-console\n console.log(\"close\");\n // 兜底逻辑,连接结束,并且没有数据返回\n if (!hadMatchMessage) {\n this.enqueue({\n topic: \"add\",\n message: {\n delta: {\n role: \"assistant\",\n content: \"`无法识别`\",\n },\n agentId: this.#agentId,\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n });\n }\n this.#ctrl!.abort();\n },\n onerror: (err) => {\n // eslint-disable-next-line no-console\n console.log(\"err\", err);\n this.#ctrl!.abort();\n },\n }\n );\n\n this.#charting = false;\n }\n\n stop() {\n clearInterval(this.#emitTimer);\n this.#ctrl && this.#ctrl?.abort();\n this.#charting = false;\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.#clear();\n this.notifySubscribers({ topic: \"stop\" });\n }\n\n #startEmitEvent() {\n if (this.#isStartEmitEvent) return;\n this.#isStartEmitEvent = true;\n // 轮训队列,每隔 #enterInterval(默认 50ms) 推出第一条数据,获取到 text,推送给组件,组件接受后进行渲染\n // 直到聊天结束,并且消息队列数据为空时,停止 emit\n this.#emitTimer = setInterval(() => {\n if (this.#charting || this.getMessageQueue().length) {\n const messageItem = this.dequeue()!;\n messageItem && this.notifySubscribers(messageItem);\n } else {\n clearInterval(this.#emitTimer);\n this.#emitTimer = undefined;\n this.#isStartEmitEvent = false;\n this.notifySubscribers({ topic: \"finish\" });\n }\n }, this.#enterInterval);\n }\n}\n\n// export const chartService = new ChatService();\n","import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { MessageItem } from \"../ChatViewContext.js\";\nimport moment from \"moment\";\nimport {\n ChatItem,\n ChatService,\n SessionItem,\n SSEMessageItem,\n} from \"../ChatService.js\";\n\nconst NEW_SESSION_ID = \"new_session_id\";\n\nexport function useChatViewInfo({\n agentId,\n sessionId,\n enterInterval = 50,\n debug,\n}: {\n agentId: string;\n sessionId?: string;\n enterInterval?: number;\n debug: boolean;\n}) {\n const [sessionEnd, setSessionEnd] = useState<boolean>(false);\n const [sessionLoading, setSessionLoading] = useState<boolean>(false);\n const [activeSessionId, setActiveSessionId] = useState<string>();\n const [loading, setLoading] = useState<boolean>(false);\n const [chatting, setChatting] = useState<boolean>(false);\n const [sessionList, setSessionList] = useState<SessionItem[]>([]);\n\n const [msgLoading, setMsgLoading] = useState<boolean>(false);\n const [msgEnd, setMsgEnd] = useState<boolean>(false);\n const [msgList, setMsgList] = useState<MessageItem[]>([]);\n const [searchStr, setSearchStr] = useState<string>(\"\");\n const chatingText = useRef<string>(\"\");\n const chatingMessageItem = useRef<MessageItem>();\n const chatService = useMemo(\n () =>\n new ChatService({\n agentId,\n enterInterval,\n debug,\n }),\n [agentId, enterInterval, debug]\n );\n\n const defaultNewSessionItem = useMemo(\n () =>\n ({\n conversationId: NEW_SESSION_ID,\n title: \"新建会话\",\n }) as SessionItem,\n []\n );\n\n const stopChat = useCallback(() => {\n chatService.stop();\n }, [chatService]);\n\n const setAgent = useCallback(\n (id: string) => {\n chatService.setAgentId(id);\n },\n [chatService]\n );\n\n const checkSession = useCallback(\n async (id?: string, isInit = false) => {\n if (isInit && id) {\n // 切换聊天,重制状态\n setMsgEnd(false);\n setMsgLoading(false);\n setLoading(true);\n setMsgList([]);\n setActiveSessionId(id);\n if (chatting) {\n stopChat();\n }\n } else {\n setMsgLoading(true);\n }\n // 如果是新建会话,不需要查询历史\n if (id === NEW_SESSION_ID) {\n // 重置会话id\n chatService.setConversationId();\n setMsgEnd(true);\n setLoading(false);\n return;\n }\n const list = await chatService.getChatHistory(id);\n const computedList = (list: ChatItem[]) => {\n const newList: MessageItem[] = [];\n list.forEach((item) => {\n newList.unshift(\n {\n taskId: item.taskId,\n role: \"user\",\n content: {\n type: \"text\",\n text: item.input,\n },\n key: `user_${item.taskId}`,\n created: item.time,\n },\n {\n agentId: item.agentId,\n taskId: item.taskId,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: item.output,\n },\n key: `assistant_${item.taskId}`,\n created: item.inputTime,\n tag: item.tag,\n }\n );\n });\n return newList.filter((item) => item.content.text);\n };\n setMsgList((preList) => {\n return computedList(list).concat(preList);\n });\n setMsgLoading(false);\n setLoading(false);\n },\n [chatService, chatting, stopChat]\n );\n\n const deleteSession = useCallback(\n async (ids: string[]): Promise<boolean> => {\n // 需要过滤新建会话, 因为新建会话在本地,还没上报到远端\n const filterIds = ids.filter((item) => item !== NEW_SESSION_ID);\n const result = await chatService.deleteSession(filterIds);\n if (result) {\n let deleteActiveSession = false;\n if (\n activeSessionId &&\n filterIds.includes(activeSessionId) &&\n activeSessionId !== NEW_SESSION_ID\n ) {\n // 如果删除会话包含当前会话,需要重置状态\n deleteActiveSession = true;\n // 清除会话id\n chatService.setConversationId();\n\n setMsgEnd(false);\n setMsgLoading(false);\n setMsgList([]);\n\n if (chatting) {\n stopChat();\n }\n }\n\n setSessionList((list) => {\n const newList = list.filter(\n (item) => !filterIds.includes(item.conversationId!)\n );\n if (deleteActiveSession) {\n // 已经选中的当前会话被删除,新建会话\n const hasNewOne = list.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n setLoading(false);\n\n setActiveSessionId(NEW_SESSION_ID);\n if (hasNewOne) {\n return newList;\n } else {\n return [defaultNewSessionItem].concat(newList);\n }\n }\n return newList;\n });\n }\n return result;\n },\n [activeSessionId, chatService, chatting, defaultNewSessionItem, stopChat]\n );\n\n const querySessionHistory = useCallback(\n async (limit?: number) => {\n setSessionLoading(true);\n const list = await chatService.getSessionHistory(limit);\n if (!activeSessionId) {\n // 如果没有 activeSessionId, 默认新增会话\n setActiveSessionId(NEW_SESSION_ID);\n }\n setSessionList((preList) => {\n return !activeSessionId\n ? [defaultNewSessionItem].concat([...preList, ...list])\n : preList.concat(list);\n });\n setSessionLoading(false);\n },\n [chatService, activeSessionId, defaultNewSessionItem]\n );\n\n const handleChat = useCallback(\n async (str: string) => {\n if (activeSessionId === NEW_SESSION_ID) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n title: item.conversationId === NEW_SESSION_ID ? str : item.title,\n }));\n });\n }\n setChatting(true);\n chatService.chat(str);\n setMsgList((list) => {\n return list.concat([\n {\n role: \"user\",\n content: {\n type: \"text\",\n text: str,\n },\n created: moment().format(\"YYYY-MM-DD HH:mm:ss\"),\n },\n {\n role: \"assistant\",\n content: {\n type: \"load\",\n text: \"\",\n },\n chatting: true,\n created: \"Now\",\n },\n ]);\n });\n },\n [chatService, activeSessionId]\n );\n\n const createSession = useCallback(() => {\n chatService.setConversationId();\n setMsgList([]);\n setActiveSessionId(NEW_SESSION_ID);\n const hasNewOne = sessionList.find(\n (item) => item.conversationId === NEW_SESSION_ID\n );\n if (!hasNewOne) {\n setSessionList((preList) => {\n return [defaultNewSessionItem].concat(preList);\n });\n }\n }, [chatService, sessionList, defaultNewSessionItem]);\n\n const handleIsLike = useCallback(\n async (id: string, isLike: boolean): Promise<boolean> => {\n const result = await chatService.setChatItemIsLike(id, isLike);\n if (result) {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n tag:\n id === item.taskId\n ? {\n isLike,\n }\n : item.tag,\n }));\n });\n }\n return result;\n },\n [chatService]\n );\n\n useEffect(() => {\n if (sessionId) {\n checkSession(sessionId);\n }\n }, [sessionId]);\n\n useEffect(() => {\n // session listener\n const handleSessionEnd = () => {\n setSessionEnd(true);\n };\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n\n return () => {\n chatService.subscribe(\"session.fetch.end\", handleSessionEnd);\n };\n }, [chatService]);\n\n useEffect(() => {\n // chat listener\n const listener = (msgItem?: SSEMessageItem) => {\n if (!msgItem) return;\n chatingText.current = chatingText.current + msgItem.delta.content;\n if (activeSessionId === NEW_SESSION_ID && msgItem.conversationId) {\n // 如果当前会话属于新建会话,更新会话历史数据\n setSessionList((list) => {\n return list.map((item) => ({\n ...item,\n conversationId:\n item.conversationId === NEW_SESSION_ID\n ? msgItem.conversationId!\n : item.conversationId,\n }));\n });\n setActiveSessionId(msgItem.conversationId);\n }\n // eslint-disable-next-line no-console\n // console.log(chatingText.current);\n chatingMessageItem.current = {\n ...msgItem,\n role: \"assistant\",\n content: {\n type: \"markdown\",\n text: chatingText.current,\n },\n chatting: true,\n created: moment(msgItem?.created).format(\"YYYY-MM-DD HH:mm:ss\"),\n };\n setMsgList((list) => {\n list.pop();\n return list.concat(chatingMessageItem.current!);\n });\n };\n const reset = () => {\n chatingText.current = \"\";\n setChatting(false);\n setLoading(false);\n chatingMessageItem.current = undefined;\n };\n const finishListener = () => {\n setMsgList((list) => {\n return list.map((item) => ({\n ...item,\n chatting: false,\n }));\n });\n reset();\n };\n const fetchEndListener = () => {\n setMsgEnd(true);\n };\n const stopListener = () => {\n if (chatingMessageItem.current) {\n const stopMessageItem: MessageItem = {\n ...chatingMessageItem.current,\n content: {\n type: \"markdown\",\n text:\n chatingMessageItem.current.content.text +\n \" \\\\\\n ` 对话被中断了 `\",\n },\n };\n setMsgList((list) => {\n list.pop();\n return msgList.concat(stopMessageItem);\n });\n } else {\n setMsgList((list) => {\n return list.filter((item) => item.content.type !== \"load\");\n });\n }\n reset();\n };\n chatService.subscribe(\"add\", listener);\n chatService.subscribe(\"finish\", finishListener);\n chatService.subscribe(\"stop\", stopListener);\n chatService.subscribe(\"message.fetch.end\", fetchEndListener);\n return () => {\n chatService.unsubscribe(\"add\", listener);\n chatService.unsubscribe(\"finish\", finishListener);\n chatService.unsubscribe(\"stop\", stopListener);\n chatService.unsubscribe(\"message.fetch.end\", fetchEndListener);\n };\n }, [chatService, activeSessionId, msgList]);\n\n return {\n sessionEnd,\n sessionLoading,\n loading,\n chatting,\n activeSessionId,\n sessionList,\n searchStr,\n msgEnd,\n msgLoading,\n msgList,\n setAgent,\n handleChat,\n stopChat,\n createSession,\n deleteSession,\n checkSession,\n setSearchStr,\n querySessionHistory,\n handleIsLike,\n };\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root{--message-box-bg:#f1f3f4;--search-input-icon-hover:#ddd;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.15)}html[data-theme=\"dark\"],\nhtml[data-theme=\"dark-v2\"]{--message-box-bg:rgba(255,255,255,0.16);--search-input-icon-hover:#383838;--quick-answer-card-item-hover:0px 7px 8px 0px rgba(0,0,0,0.24)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.progress-text{position:relative;margin-left:12px;font-size:12px;color:var(--palette-gray-7);line-height:22px;min-height:22px}.progress-text::before{content:\"·\";font-size:16px;position:absolute;left:-10px;top:-4px}.custom-component-wrapper .params{margin-top:6px;border-radius:3px}.custom-component-wrapper .params pre{margin:4px 0}.custom-component-wrapper .params-tip,\n .custom-component-wrapper .error-tip,\n .custom-component-wrapper .result-tip{font-size:0.875em;color:rgb(94 129 172)}.custom-component-wrapper .empty-tip{font-size:12px;color:var(--palette-gray-7)}.custom-component-wrapper .table-wrapper .table-container{position:relative;box-sizing:border-box;margin:0;padding:0;font-size:14px;clear:both;max-width:100%;overflow:hidden}.custom-component-wrapper .table-wrapper .table-container .table-content{overflow-x:auto}.custom-component-wrapper .table-wrapper .table-container .table-content table{margin:4px 0}.custom-component-wrapper .table-wrapper .table-container .table-content table tr td{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.custom-component-wrapper .table-wrapper .open-more{margin-top:4px;font-size:12px;display:flex;justify-content:end}.custom-component-wrapper .chart-wrapper{background:#fff;margin-top:12px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;font-variant-ligatures:none;font-feature-settings:\"liga\" 0,none}.ProseMirror pre{white-space:pre-wrap}.ProseMirror li{position:relative}.ProseMirror-hideselection *::selection{background:transparent}.ProseMirror-hideselection *::-moz-selection{background:transparent}.ProseMirror-hideselection{caret-color:transparent}.ProseMirror-selectednode{outline:2px solid #8cf}li.ProseMirror-selectednode{outline:none}li.ProseMirror-selectednode:after{content:\"\";position:absolute;left:-32px;right:-2px;top:-2px;bottom:-2px;border:2px solid #8cf;pointer-events:none}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important}.ProseMirror .tableWrapper{overflow-x:auto}.ProseMirror table{border-collapse:collapse;table-layout:fixed;width:100%;overflow:hidden}.ProseMirror td,\n.ProseMirror th{vertical-align:top;box-sizing:border-box;position:relative}.ProseMirror .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;z-index:20;background-color:#adf;pointer-events:none}.ProseMirror.resize-cursor{cursor:ew-resize;cursor:col-resize}.ProseMirror .selectedCell:after{z-index:2;position:absolute;content:\"\";left:0;right:0;top:0;bottom:0;background:rgba(200,200,255,0.4);pointer-events:none}.milkdown-theme-nord blockquote{border-left-width:4px;--tw-border-opacity:1;border-color:rgb(94 129 172/var(--tw-border-opacity));padding-left:1rem;font-family:ui-serif,Georgia,Cambria,Times New Roman,Times,serif;font-style:normal}.milkdown-theme-nord code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-weight:400;--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord pre code{color:inherit}.milkdown-theme-nord img{margin-top:0!important;margin-bottom:0!important;display:inline-block;max-width:100%}.milkdown-theme-nord.prose\n :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:400}.milkdown-theme-nord.prose\n :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker,\n.milkdown-theme-nord.prose\n :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{--tw-text-opacity:1;color:rgb(94 129 172/var(--tw-text-opacity))}.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(blockquote p:first-of-type):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):before,\n.milkdown-theme-nord.prose\n :where(code):not(:where([class~=\"not-prose\"] *)):after{content:\"\"}.milkdown-theme-nord.prose .tableWrapper{position:relative;margin-bottom:0.5rem;overflow-x:auto}.milkdown-theme-nord.prose table{font-size:0.875rem;line-height:1.25rem;--tw-shadow:0 4px 6px -1px rgb(0 0 0/0.1),0 2px 4px -2px rgb(0 0 0/0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){.milkdown-theme-nord.prose table{border-radius:0.5rem}}.milkdown-theme-nord.prose td,\n.milkdown-theme-nord.prose th{padding:0.75rem 1.5rem!important}.milkdown-theme-nord.prose tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.dark .milkdown-theme-nord.prose tr{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.milkdown-theme-nord.prose :where(td, th) p{margin:0!important}.milkdown-theme-nord.prose :where(td, th):nth-child(odd){background-color:var(--color-fill-bg-base-1)}.dark .milkdown-theme-nord.prose :where(td, th):nth-child(odd){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.milkdown-theme-nord.prose.ProseMirror .selectedCell:after{background-color:#88c0d04d}.milkdown-theme-nord.prose br[data-is-inline=\"true\"],\n.milkdown-theme-nord.prose br[data-is-inline=\"true\"]:after{content:\" \"}.prose{color:var(--color-normal-text)}.prose :where(p):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=\"lead\"]):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=\"not-prose\"] *)){color:var(--color-info);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600}.prose :where(a strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(ol):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol[type=\"A\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"A\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-alpha}.prose :where(ol[type=\"a\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-alpha}.prose :where(ol[type=\"I\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"I\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:upper-roman}.prose :where(ol[type=\"i\" s]):not(:where([class~=\"not-prose\"] *)){list-style-type:lower-roman}.prose :where(ol[type=\"1\"]):not(:where([class~=\"not-prose\"] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=\"not-prose\"] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-left:1.625em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *))::marker{color:var(--tw-prose-bullets)}.prose :where(hr):not(:where([class~=\"not-prose\"] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=\"not-prose\"] *)){font-weight:500;font-style:italic;color:var(--color-auxiliary-text);border-left-width:0.25rem;border-left-color:var(--tw-prose-quote-borders);quotes:\"\\\\201C\" \"\\\\201D\" \"\\\\2018\" \"\\\\2019\";margin-top:1.6em;margin-bottom:1.6em;padding-left:1em}.prose\n :where(blockquote p:first-of-type):not(\n :where([class~=\"not-prose\"] *)\n )::before{content:open-quote}.prose\n :where(blockquote p:last-of-type):not(:where([class~=\"not-prose\"] *))::after{content:close-quote}.prose :where(h1):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:0.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=\"not-prose\"] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=\"not-prose\"] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:0.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;margin-top:1.5em;margin-bottom:0.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=\"not-prose\"] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure > *):not(:where([class~=\"not-prose\"] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-captions);font-size:0.875em;line-height:1.4285714;margin-top:0.8571429em}.prose :where(code):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-code);font-weight:600;font-size:0.875em}.prose :where(code):not(:where([class~=\"not-prose\"] *))::before{content:\"\\`\"}.prose :where(code):not(:where([class~=\"not-prose\"] *))::after{content:\"\\`\"}.prose :where(a code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h1 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(h2 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.875em}.prose :where(h3 code):not(:where([class~=\"not-prose\"] *)){color:inherit;font-size:0.9em}.prose :where(h4 code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(thead th code):not(:where([class~=\"not-prose\"] *)){color:inherit}.prose :where(pre):not(:where([class~=\"not-prose\"] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:0.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:0.375rem;padding-top:0.8571429em;padding-right:1.1428571em;padding-bottom:0.8571429em;padding-left:1.1428571em}.prose :where(pre code):not(:where([class~=\"not-prose\"] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::before{content:none}.prose :where(pre code):not(:where([class~=\"not-prose\"] *))::after{content:none}.prose :where(table):not(:where([class~=\"not-prose\"] *)){width:100%;table-layout:auto;text-align:left;margin-top:2em;margin-bottom:2em;font-size:0.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=\"not-prose\"] *)){color:var(--color-strong-text);font-weight:600;vertical-align:bottom;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose :where(tbody tr):not(:where([class~=\"not-prose\"] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=\"not-prose\"] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=\"not-prose\"] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=\"not-prose\"] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=\"not-prose\"] *)){vertical-align:top}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgb(0 0 0/50%);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(video):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(figure):not(:where([class~=\"not-prose\"] *)){margin-top:2em;margin-bottom:2em}.prose :where(li):not(:where([class~=\"not-prose\"] *)){margin-top:0.5em;margin-bottom:0.5em}.prose :where(ol > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(ul > li):not(:where([class~=\"not-prose\"] *)){padding-left:0.375em}.prose :where(.prose > ul > li p):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose\n :where(.prose > ul > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ul > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose\n :where(.prose > ol > li > *:first-child):not(:where([class~=\"not-prose\"] *)){margin-top:1.25em}.prose\n :where(.prose > ol > li > *:last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:1.25em}.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~=\"not-prose\"] *)){margin-top:0.75em;margin-bottom:0.75em}.prose :where(hr + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h2 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h3 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(h4 + *):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=\"not-prose\"] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=\"not-prose\"] *)){padding-right:0}.prose :where(tbody td, tfoot td):not(:where([class~=\"not-prose\"] *)){padding-top:0.5714286em;padding-right:0.5714286em;padding-bottom:0.5714286em;padding-left:0.5714286em}.prose\n :where(tbody td:first-child, tfoot td:first-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-left:0}.prose\n :where(tbody td:last-child, tfoot td:last-child):not(\n :where([class~=\"not-prose\"] *)\n ){padding-right:0}.prose :where(.prose > :first-child):not(:where([class~=\"not-prose\"] *)){margin-top:0}.prose :where(.prose > :last-child):not(:where([class~=\"not-prose\"] *)){margin-bottom:0}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:-webkit-sticky;position:sticky}.isolate{isolation:isolate}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\\\\!table{display:table!important}.table{display:table}.inline-table{display:inline-table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row-group{display:table-row-group}.table-row{display:table-row}.flow-root{display:flow-root}.grid{display:grid}.inline-grid{display:inline-grid}.contents{display:contents}.list-item{display:list-item}.hidden{display:none}.flex-shrink{flex-shrink:1}.shrink{flex-shrink:1}.flex-grow{flex-grow:1}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.\\\\!transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize{resize:both}.flex-wrap{flex-wrap:wrap}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.break-all{word-break:break-all}.rounded{border-radius:0.25rem}.border{border-width:1px}.text-justify{text-align:justify}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal:ordinal;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.lining-nums{--tw-numeric-figure:lining-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-feature-settings:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.underline{-webkit-text-decoration-line:underline;text-decoration-line:underline}.overline{-webkit-text-decoration-line:overline;text-decoration-line:overline}.line-through{-webkit-text-decoration-line:line-through;text-decoration-line:line-through}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0/0.1),0 1px 2px -1px rgb(0 0 0/0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.blur{--tw-blur:blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4,0,0.2,1);transition-duration:150ms}.ease-in{transition-timing-function:cubic-bezier(0.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(0.4,0,0.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,0.2,1)}.milkdown{border-radius:0.25rem;margin:0;padding:0}.editor{margin-left:auto;margin-right:auto}:is(.dark .dark\\\\:prose-invert){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}code[class*=\"language-\"],\npre[class*=\"language-\"]{color:#f8f8f2;background:none;font-family:\"Fira Code\",Consolas,Monaco,\"Andale Mono\",\"Ubuntu Mono\",monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=\"language-\"]{padding:1em;margin:0.5em 0;overflow:auto;border-radius:0.3em}:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"]{background:#2e3440}:not(pre) > code[class*=\"language-\"]{padding:0.1em;border-radius:0.3em;white-space:normal}.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata{color:#636f88}.token.punctuation{color:#81a1c1}.namespace{opacity:0.7}.token.property,\n.token.tag,\n.token.constant,\n.token.symbol,\n.token.deleted{color:#81a1c1}.token.number{color:#b48ead}.token.boolean{color:#81a1c1}.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted{color:#a3be8c}.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string,\n.token.variable{color:#81a1c1}.token.atrule,\n.token.attr-value,\n.token.function,\n.token.class-name{color:#88c0d0}.token.keyword{color:#81a1c1}.token.regex,\n.token.important{color:#ebcb8b}.token.important,\n.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.quick-answer-wrapper{margin-top:20px;border-radius:6px;border:1px solid var(--color-border-divider-line);padding:16px 24px}.quick-answer-wrapper .tip{font-size:18px;margin-bottom:30px}.quick-answer-wrapper .quick-answer-list{display:grid;grid-gap:24px 16px;gap:24px 16px;border-radius:3px;grid-template-columns:repeat(auto-fill,minmax(250px,1fr))}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item{position:relative;padding:16px;border-radius:6px;cursor:pointer;display:flex;padding:10px 20px;gap:12px;width:auto;box-sizing:border-box}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item:hover{box-shadow:var(--quick-answer-card-item-hover)}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .left .icon{font-size:20px;color:#fff;padding:8px;border-radius:6px;margin-top:4px}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content{flex:1;min-width:0}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .title{font-size:16px;font-weight:bold;color:var(--color-normal-text);text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.quick-answer-wrapper .quick-answer-list .quick-answer-card-item .content .description{color:var(--color-auxiliary-text);font-size:12px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.quick-answer-wrapper .show-more-wrapper{text-align:center;margin-top:20px}.quick-answer-wrapper .show-more-wrapper .show-more-btn{line-height:24px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after,\n .quick-answer-wrapper .show-more-wrapper .show-more-btn::before{content:\"- - - - -\";color:var(--color-text-divider-line);position:absolute}.quick-answer-wrapper .show-more-wrapper .show-more-btn::before{margin-left:-60px}.quick-answer-wrapper .show-more-wrapper .show-more-btn::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"../assets/loading.gif\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.message-list-loading-wrapper{width:140px;height:140px;background-repeat:no-repeat;margin:auto;background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.chart-item-loading-wrapper{display:flex;padding:10px;font-size:40px;align-items:center;justify-content:center;color:#d2d3d4;border-radius:6px}.chart-item-loading-wrapper .load{display:inline-block;position:relative;width:64px;height:64px}.chart-item-loading-wrapper .load div{position:absolute;top:27px;width:11px;height:11px;border-radius:50%;background:#aaa8a8;animation-timing-function:cubic-bezier(0,1,1,0)}.chart-item-loading-wrapper .load div:nth-child(1){left:6px;animation:load1 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(2){left:6px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(3){left:26px;animation:load2 0.6s infinite}.chart-item-loading-wrapper .load div:nth-child(4){left:45px;animation:load3 0.6s infinite}@keyframes load1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes load2{0%{transform:translate(0,0)}100%{transform:translate(19px,0)}}@keyframes load3{0%{transform:scale(1)}100%{transform:scale(0)}}.common-loading-wrapper{text-align:center;font-size:30px;color:#ddd}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nimport ___CSS_LOADER_GET_URL_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/getUrl.js\";\nvar ___CSS_LOADER_URL_IMPORT_0___ = new URL(\"./assets/user.png\", import.meta.url);\nvar ___CSS_LOADER_URL_IMPORT_1___ = new URL(\"./assets/robot.png\", import.meta.url);\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\nvar ___CSS_LOADER_URL_REPLACEMENT_0___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_0___);\nvar ___CSS_LOADER_URL_REPLACEMENT_1___ = ___CSS_LOADER_GET_URL_IMPORT___(___CSS_LOADER_URL_IMPORT_1___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block;height:100%}:host([hidden]){display:none}@media only screen and (min-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1556px}.chat-view-container .chat-view-content .search-input-box{width:1556px}}@media only screen and (min-width: 1440px) and (max-width: 1920px){.chat-view-container .chat-view-content .chat-view .message-list{width:1156px}.chat-view-container .chat-view-content .search-input-box{width:1156px}}@media only screen and (min-width: 804px) and (max-width: 1440px){.chat-view-container .chat-view-content .chat-view .message-list{width:804px}.chat-view-container .chat-view-content .search-input-box{width:804px}}@media only screen and (max-width: 804px){.chat-view-container .chat-view-content .chat-view .message-list{width:100%}.chat-view-container .chat-view-content .search-input-box{width:100%}}.chat-view-container{display:flex;flex-direction:row;width:100%;height:100%}.chat-view-selector{width:200px;padding:14px;border-right:1px solid var(--color-border-divider-line)}.chat-view-content{flex:1;display:flex;flex-direction:column;width:100%;gap:8px}.chat-view-content .chat-view-toolbar{background:#e0e4e5;padding:18px;display:flex;justify-content:space-between;align-items:center}.chat-view-content .chat-view-toolbar .username{color:#333333;font-weight:500;line-height:22px;font-size:16px}.chat-view-content .chat-view-toolbar .toolbar eo-icon{cursor:pointer}.chat-view-content .chat-view{max-width:100%;position:relative;display:flex;flex:1;flex-direction:column;box-sizing:border-box;overflow-y:auto}.session-list-wrapper{display:flex;flex-direction:column;height:100%}.session-list-wrapper .session-title{font-size:16px;color:var(--color-header-text);margin-bottom:16px}.session-list-wrapper .session-list{overflow-y:auto}.session-list-wrapper .session-list .session-item{display:flex;justify-content:space-between;cursor:pointer;border-radius:var(--small-border-radius);background-color:var(--third-menu-default-bg);padding:6px 16px;color:var(--color-header-text);margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item .content{width:0;flex:1}.session-list-wrapper .session-list .session-item .content .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-list-wrapper .session-list .session-item:hover .session-close-btn eo-icon{display:block}.session-list-wrapper .session-list .session-item:first-child{margin-top:0px}.session-list-wrapper .session-list .session-item.active{background-color:var(--third-menu-item-selected-bg);color:var(--color-brand)}.session-list-wrapper .session-list .session-item:hover,\n .session-list-wrapper .session-list .session-item.active:hover{color:var(--color-header-text);background-color:var(--third-menu-item-hover-bg)}.session-list-wrapper .session-list .session-item .session-close-btn{display:flex;align-items:center;cursor:pointer;font-size:12px}.session-list-wrapper .session-list .session-item .session-close-btn:hover{color:var(--color-error)}.session-list-wrapper .session-list .session-item .session-close-btn eo-icon{display:none}.message-list{display:flex;flex-direction:column;padding-bottom:30px;padding:12px;flex:1;margin:0 auto;max-width:100%;box-sizing:border-box}.message-list .message-list-box{display:flex;flex-direction:column;position:relative;gap:36px}.message-list .message-list-box .message-item{display:flex;gap:8px;padding-right:40px}.message-list .message-list-box .message-item.user{flex-direction:row-reverse;padding:0;padding-left:40px}.message-list .message-list-box .message-item.user .message-box{margin-bottom:0;overflow:hidden}.message-list .message-list-box .message-item.user .message-box .message-top{flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content{justify-content:end}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper{display:flex;flex-direction:row-reverse}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content{background-color:#606f7c;color:#fff}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper:hover .content-tip{display:block}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip{display:none}.message-list .message-list-box .message-item.user .message-box .message-content .wrapper .content-tip eo-icon{padding:4px;color:#606f7c;cursor:pointer}.message-list .message-list-box .message-item .avatar{width:36px;height:36px;margin-top:32px;border-radius:50%;font-size:20px;display:flex;align-items:center;justify-content:center}.message-list .message-list-box .message-item .avatar.user{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_0___})}.message-list .message-list-box .message-item .avatar.robot{background-image:url(${___CSS_LOADER_URL_REPLACEMENT_1___})}.message-list .message-list-box .message-item .message-box{position:relative;flex:1;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content{display:flex;justify-content:start;position:relative}.message-list .message-list-box .message-item .message-box .message-content .wrapper{position:relative;overflow:hidden}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content{position:relative;padding:14px;border-radius:6px;overflow:hidden;background:var(--message-box-bg)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .content .text-item{white-space:pre-wrap}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar{display:flex;gap:12px;justify-content:end;margin-top:4px}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar eo-icon{cursor:pointer;color:#606f7c}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar eo-icon.active{color:var(--color-brand)}.message-list .message-list-box .message-item .message-box .message-content .wrapper .toolbar .split{width:1px;height:16px;background-color:#d9d9d9;margin-bottom:1px}.message-list .message-list-box .message-item .message-box .message-top{display:flex;margin-bottom:4px;color:#bec8ce;gap:8px}.message-list .message-list-box .message-item .message-box .message-top .time{min-height:22px}.message-list .message-list-box .stop-responding-wrapper{position:absolute;left:44px;bottom:-28px}.search-input-box{display:flex;flex-direction:column;height:75px;padding:12px;position:relative;margin:0 auto;max-width:100%;box-sizing:border-box}.search-input-box .mentions-list-wrapper{position:absolute;bottom:100%;left:12px;right:12px}.search-input-box .mentions-list-wrapper .content{background-color:var(--antd-input-bg);border-radius:6px;border:1px solid var(--palette-gray-4);padding:8px}.search-input-box .mentions-list-wrapper .content .mentions-title{font-size:14px;font-weight:bold;color:var(--color-strong-text);padding-bottom:8px}.search-input-box .mentions-list-wrapper .content .mentions-list{display:flex;flex-direction:column;gap:8px;max-height:300px;overflow-y:auto}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item{display:flex;flex-direction:row;align-items:center;gap:12px;padding:8px;border-radius:6px;cursor:pointer}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .icon{font-size:18px;padding:8px;border-radius:50%}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .name{color:var(--color-normal-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item .description{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--color-disabled-text)}.search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item:hover,\n .search-input-box .mentions-list-wrapper .content .mentions-list .mentions-item.active{background:var(--palette-gray-3)}.search-input-box.fill-content{border-top:1px solid rgba(197,197,197,0.5)}.search-input-box .input-box{position:absolute;bottom:20px;left:12px;right:12px;display:inline-flex;padding:var(--input-affix-wrapper-padding);border-radius:var(--small-border-radius);height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;color:var(--text-color-default);background-color:var(--antd-input-bg);border:1px solid var(--color-border-divider-line);transition:border-color 0.3s;overflow:visible}.search-input-box .input-box.active{border-color:var(--antd-input-focus-border-color)}.search-input-box .input-box.disabled{pointer-events:none;background:var(--input-outline-disabled);cursor:not-allowed}.search-input-box .input-box.expand textarea{padding-right:50px;margin-bottom:50px}.search-input-box .input-box textarea{width:100%;height:22px;font-size:18px;resize:none;padding:10px 50px 10px 10px;outline:none;border:none;line-height:20px;color:var(--color-normal-text);background-color:transparent;cursor:inherit;transition:all 300ms ease-out}.search-input-box .input-box textarea::placeholder{color:#b0b1b8}.search-input-box .input-box .suffix-icon{display:flex;align-items:center;gap:8px;position:absolute;right:12px;bottom:6px}.search-input-box .input-box .suffix-icon eo-tooltip{display:flex}.search-input-box .input-box .suffix-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .suffix-icon eo-icon:not(.disabled):hover{background:var(--search-input-icon-hover)}.search-input-box .input-box .suffix-icon .submit-split{width:1px;height:20px;background:#d1d1d1}.search-input-box .input-box .suffix-icon .submit-btn.active{color:var(--color-brand)}.search-input-box .input-box .suffix-icon .submit-btn.disabled{color:var(--color-disabled-text);cursor:not-allowed}.search-input-box .input-box .toolbar-icon{position:absolute;top:12px;right:14px}.search-input-box .input-box .toolbar-icon eo-icon{font-size:20px;cursor:pointer;padding:6px;border-radius:3px}.search-input-box .input-box .toolbar-icon eo-icon:hover{background:var(--search-input-icon-hover)}.search-input-box .search-input-toolbar{display:flex;justify-content:end;position:absolute;right:12px;bottom:0px}.search-input-box .search-input-toolbar .input-tip{font-size:12px;color:var(--color-secondary-text)}.message-start-tip,\n.session-end-tip{color:var(--color-disabled-text);font-size:12px;text-align:center;margin-top:12px;position:relative}.message-start-tip::after,\n .session-end-tip::after,\n .message-start-tip::before,\n .session-end-tip::before{content:\"- - -\";color:var(--color-disabled-text);position:absolute}.message-start-tip::before, .session-end-tip::before{margin-left:-35px}.message-start-tip::after, .session-end-tip::after{margin-left:10px}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[0].use[1]!../../../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!./host-context.css\";\n export default content && content.locals ? content.locals : undefined;\n"],"names":["ChatViewContext","createContext","useChatViewContext","useContext","WrappedIcon","wrapBrick","MessageListLoading","React","className","ChatItemLoading","CommonLoading","icon","lib","spinning","Avatar","_ref","role","agentId","isUser","useMemo","quickAnswerConfig","agentList","_quickAnswerConfig$li","list","matchAgent","find","item","id","_extends","style","color","concat","background","WrappedLink","GuideItem","text","prompts","map","index","key","ProgressText","renderText","replace","MsgItemContext","TableComponent","lazy","ChartComponent","CustomComponent","_ref4","language","chatting","data","parseData","isError","isLoading","cahceTextRef","useRef","isFetching","setIsFetching","useState","isEnd","setIsEnd","setIsError","setIsLoading","setParseData","setData","requestPromise","useCallback","_ref2","_asyncToGenerator","InstanceApi_postSearchV3","objectId","_objectSpread","page","page_size","http","request","getBasePath","method","body","_x","apply","arguments","fetchData","_ref3","response","_unused","_x2","useEffect","current","JSON","parse","_unused2","match","useFetchData","component","params","CodeBlock","setLanguage","contentRef","node","useNodeViewContext","defaultContent","spellCheck","ref","renderContent","_node$firstChild","_node$firstChild2","firstChild","textContent","attrs","MarkdownItem","MilkdownProvider","ProsemirrorAdapterProvider","MarkdownDisplay","value","nodeViewFactory","useNodeViewFactory","get","useEditor","root","Editor","make","config","ctx","set","rootCtx","update","editorViewOptionsCtx","prev","editable","handleClickOn","view","pos","handleClick","url","found","state","tr","doc","nodeAt","marks","length","path","mark","m","type","name","href","startsWith","encodeURIComponent","window","open","defaultValueCtx","MutationObserver","Array","from","querySelectorAll","forEach","link","onclick","observe","childList","subtree","nord","use","prism","gfm","commonmark","$view","codeBlockSchema","_get","undefined","action","replaceAll","Milkdown","TableItem","TextItem","WrapperIcon","WrappedToolTip","copyToClipboard","unwrapProvider","showNotification","Toolbar","content","taskId","tag","isAssistant","isChattingItem","showLike","readonly","handleIsLike","handleLikeOrIsLike","islike","result","message","hoist","classNames","active","isLike","onClick","handleCopy","then","catch","Time","time","moment","format","ContentTip","setSearchStr","NOT_AGENT_MATCH","MessageNode","props","created","getContentNode","examplePrompts","messageNode","Provider","CARD_ITEM_HEIGHT","HEIGHT_GAP","QuickAnswerCardItem","description","starterPrompts","iconColor","_icon$color","height","handleCardClick","category","QuickAnswerList","_quickAnswerConfig$ti","msgList","loading","showMoreBtn","setShowMoreBtn","listRef","hadClickShowMoreBtn","element","observer","ResizeObserver","entries","entry","contentRect","disconnect","tip","maxHeight","overflow","instanceId","handleShowMoreClick","StopBtn","stopChat","handleStopChat","DEFAULT_OFFSET_HEIGHT","CACHE_HEIGHT","MessageList","showAvatar","chatViewRef","messgetListBoxRef","preHeight","setPreHeight","isCustomScroll","msgLoading","msgEnd","activeSessionId","checkSession","getMsgItemNode","user","msgListNode","handleScroll","messageList","scrollHeight","clientHeight","scrollTop","isBottom","debounceHandleScroll","debounce","newHeight","scroll","top","Number","MAX_SAFE_INTEGER","Math","max","onScroll","hiddenTextarea","HIDDEN_TEXTAREA_STYLE","SIZING_STYLE","PREFIX_WORD","SearchInput","setValue","setActive","expand","setExpand","autoSizeStyle","setAutoSizeStyle","isFillContent","setIsFillContent","mentionOpen","setMentionOpen","matchPrefixIndex","setMatchPrefixIndex","matchAgentList","setMatchMentionList","matchMentionsIndex","setMatchMentionsIndex","mentionsRef","searchInputBoxRef","textareaRef","hadExpanded","inputEndRef","searchStr","createSession","handleChat","setAgent","hadValue","defaultSize","disabled","matchPrefixInfo","textareaElement","currentFocusIndex","selectionStart","matchWord","i","test","start","end","word","handleAgentItemSelect","valueList","split","trimName","focusIndex","splice","join","setTimeout","selectionEnd","focus","isShowMentions","mentions","slice","computedAutoSize","size","textareaStyles","uiTextNode","minRows","maxRows","document","createElement","setAttribute","appendChild","uiTextNodeStyle","getComputedStyle","sizingStyle","getPropertyValue","placeholder","minHeight","singleRowHeight","min","overflowY","resize","calculateAutoSizeStyle","handleChange","e","target","handleExpand","matchFirstAgent","regex","exec","agent","handleSubmit","blur","handleKeyDown","shiftKey","preventDefault","handleKeyUp","selectionIndex","prefixWord","lastIndexOf","indexOf","_textareaRef$current","trim","searchInputBox","width","currentWidth","getBoundingClientRect","_textareaRef$current2","filterList","filter","includes","querySelector","scrollIntoView","block","handleDocumentClick","mentionsElemnt","contains","composedPath","addEventListener","removeEventListener","paddingRight","onFocus","onBlur","onChange","onKeyDown","onKeyUpCapture","onCompositionStart","handleCompositionStart","onCompositionEnd","handleCompositionEnd","hanldeCreateSession","showDialog","SESSION_ITEM_HEIGHT","BUFFER_NUMBER","SessionList","sessionEnd","sessionLoading","sessionList","querySessionHistory","sessionWrapperRef","sessionListRef","limit","sessionWrapper","floor","checkSessionList","SessionItem","title","conversationId","deleteSession","handleCheckSession","handleDeleteSession","stopPropagation","expect","_debug","WeakMap","_ctrl","_agentId","_enterInterval","_charting","_isStartEmitEvent","_emitTimer","_messageQueue","_subscribers","_conversationId","_sessionNextToken","_cacheLimit","_messageNextToken","_ChatService_brand","WeakSet","ChatService","constructor","enterInterval","debug","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_classPrivateFieldSet","this","enqueue","_classPrivateFieldGet","push","_assertClassBrand","_startEmitEvent","call","dequeue","shift","getMessageQueue","subscribe","topic","callback","unsubscribe","cb","notifySubscribers","setChatItemIsLike","flag","code","stringify","setAgentId","setConversationId","getSessionHistory","_this","_classPrivateFieldGet2","conversations","next_token","console","error","getChatHistory","_this2","_unused3","conversationIds","_unused4","splitWord","str","Intl","iterator","Segmenter","granularity","segment","Symbol","nextWord","next","done","customSplit","cache","matchStr","substring","chat","_this3","AbortController","hadMatchMessage","fetchEventSource","signal","input","stream","headers","onopen","ok","log","onmessage","msg","_unused5","delta","abort","onclose","onerror","err","stop","_classPrivateFieldGet3","clearInterval","_clear","setInterval","messageItem","NEW_SESSION_ID","useChatViewInfo","sessionId","setSessionEnd","setSessionLoading","setActiveSessionId","setLoading","setChatting","setSessionList","setMsgLoading","setMsgEnd","setMsgList","chatingText","chatingMessageItem","chatService","defaultNewSessionItem","preList","newList","unshift","output","inputTime","computedList","ids","filterIds","deleteActiveSession","hasNewOne","_x3","_ref5","_x4","_ref6","_x5","_x6","handleSessionEnd","listener","msgItem","pop","reset","finishListener","fetchEndListener","stopListener","stopMessageItem","___CSS_LOADER_EXPORT___","module","toString","___CSS_LOADER_URL_IMPORT_0___","URL","___CSS_LOADER_URL_REPLACEMENT_0___","___CSS_LOADER_URL_IMPORT_1___","___CSS_LOADER_URL_REPLACEMENT_1___","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals"],"sourceRoot":""}