wi-chat 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +737 -322
- package/dist/core/useAnswerActions.d.ts +61 -0
- package/dist/core/useChat.d.ts +90 -15
- package/dist/core/useChatAuth.d.ts +96 -0
- package/dist/core/useChatRooms.d.ts +66 -0
- package/dist/core/useKeepAlive.d.ts +41 -0
- package/dist/core/useLlm.d.ts +73 -0
- package/dist/core/useRunningGroups.d.ts +58 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +119 -108
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +8 -8
- package/dist/mobile-ui/chat/ChatMessagesView.vue.d.ts +6 -6
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.js +104 -104
- package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +6 -6
- package/dist/page-context/index.js +2 -4
- package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +1 -7
- package/dist/parser/answerCom/actionExecute/clarification.d.ts +15 -3
- package/dist/parser/answerCom/actionExecute/constants.d.ts +10 -0
- package/dist/parser/answerCom/actionExecute/parseCollectClarifications.d.ts +3 -2
- package/dist/parser/answerCom/actionExecute/parseHostAction.d.ts +3 -2
- package/dist/parser/answerCom/actionExecute/types.d.ts +3 -3
- package/dist/parser/answerCom/generic/parseGeneric.d.ts +52 -0
- package/dist/parser/answerCom/generic/types.d.ts +75 -0
- package/dist/parser/answerCom/outputFile/parseOutputFile.d.ts +7 -6
- package/dist/parser/answerCom/outputFile/types.d.ts +15 -5
- package/dist/parser/answerCom/presentFiles/parsePresentFiles.d.ts +58 -0
- package/dist/parser/answerCom/presentFiles/types.d.ts +27 -0
- package/dist/parser/answerMeta.d.ts +71 -0
- package/dist/parser/deepThinking/parseDeepThinking.d.ts +8 -0
- package/dist/parser/history/history.d.ts +9 -0
- package/dist/parser/history/index.d.ts +1 -1
- package/dist/parser/index.cjs +6 -2
- package/dist/parser/index.d.ts +13 -4
- package/dist/parser/index.js +640 -457
- package/dist/parser/message.d.ts +9 -0
- package/dist/parser/registry.d.ts +1 -1
- package/dist/parser/runTime.d.ts +29 -0
- package/dist/renderers/TextAnswer-BgKGvG_o.cjs +2 -0
- package/dist/renderers/TextAnswer-PQwV3K7v.js +5 -0
- package/dist/renderers/aiAnswer/AiAnswerBubble.vue.d.ts +4 -4
- package/dist/renderers/answerCard/AnswerCard.vue.d.ts +65 -0
- package/dist/renderers/answerCard/AnswerToolbar.vue.d.ts +42 -0
- package/dist/renderers/answerConfig.d.ts +33 -0
- package/dist/renderers/clarification/ClarificationCard.vue.d.ts +3 -3
- package/dist/renderers/deepThinking/DeepThinkingSteps.vue.d.ts +4 -4
- package/dist/renderers/deviceLastValue/DeviceLastValue.vue.d.ts +37 -0
- package/dist/renderers/hostAction/HostActionStatus.vue.d.ts +3 -3
- package/dist/renderers/iframePage/IframePage.vue.d.ts +3 -3
- package/dist/renderers/index.cjs +6 -1
- package/dist/renderers/index.d.ts +14 -0
- package/dist/renderers/index.js +1504 -607
- package/dist/renderers/knowledgeStream/KnowledgeStreamResult.vue.d.ts +3 -3
- package/dist/renderers/media/MediaAnswer.vue.d.ts +19 -0
- package/dist/renderers/outputFile/OutputFile.vue.d.ts +3 -3
- package/dist/renderers/outputFile/OutputFileLink.vue.d.ts +19 -0
- package/dist/renderers/outputFile/localFile.d.ts +46 -0
- package/dist/renderers/outputFile/useOutputFile.d.ts +32 -3
- package/dist/renderers/presentFiles/PresentFiles.vue.d.ts +19 -0
- package/dist/renderers/recordset/RecordsetView.vue.d.ts +19 -0
- package/dist/renderers/sqlQuery/SqlQuery.vue.d.ts +19 -0
- package/dist/renderers/style.css +1 -1
- package/dist/renderers/text/TextAnswer.vue.d.ts +19 -0
- package/dist/request/api.d.ts +121 -1
- package/dist/request/client.d.ts +6 -0
- package/dist/request/index.cjs +4 -2
- package/dist/request/index.d.ts +4 -2
- package/dist/request/index.js +754 -181
- package/dist/request/ws.d.ts +11 -86
- package/dist/request/wsCore.d.ts +104 -0
- package/dist/request/wsSession.d.ts +353 -0
- package/dist/right-panel/RightPanel.vue.d.ts +6 -6
- package/dist/right-panel/RightPanelIcon.vue.d.ts +4 -4
- package/dist/right-panel/RightPanelTabs.vue.d.ts +9 -5
- package/dist/right-panel/index.cjs +1 -1
- package/dist/right-panel/index.d.ts +1 -1
- package/dist/right-panel/index.js +617 -537
- package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +4 -4
- package/dist/right-panel/panels/web/WebPanel.vue.d.ts +3 -3
- package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +3 -3
- package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +5 -5
- package/dist/right-panel/style.css +1 -1
- package/dist/right-panel/types.d.ts +10 -0
- package/dist/theme/index.js +2 -4
- package/dist/tools/index.cjs +5 -5
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +323 -217
- package/dist/tools/markdown/MarkdownContent.vue.d.ts +5 -5
- package/dist/tools/markdown/index.d.ts +2 -0
- package/dist/tools/markdown/interactions.d.ts +39 -0
- package/dist/tools/markdown/sanitize.d.ts +6 -0
- package/dist/tools/style.css +1 -1
- package/dist/tools/useAutoScroll.d.ts +3 -3
- package/dist/web-ui/attach/AttachmentCard.vue.d.ts +6 -6
- package/dist/web-ui/attach/AttachmentList.vue.d.ts +6 -6
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +10 -10
- package/dist/web-ui/chat/ChatMessagesView.vue.d.ts +6 -6
- package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +6 -6
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.js +630 -635
- package/dist/web-ui/inputbox/Inputbox.vue.d.ts +11 -11
- package/dist/web-ui/recordset/RecordsetTable.vue.d.ts +4 -4
- package/dist/web-ui/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { MarkdownRenderOptions } from './renderMarkdown';
|
|
2
2
|
|
|
3
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
source: string;
|
|
5
5
|
renderOptions?: MarkdownRenderOptions;
|
|
6
6
|
}>, {
|
|
7
7
|
source: string;
|
|
8
8
|
renderOptions: () => {};
|
|
9
|
-
}
|
|
9
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
10
10
|
source: string;
|
|
11
11
|
renderOptions?: MarkdownRenderOptions;
|
|
12
12
|
}>, {
|
|
13
13
|
source: string;
|
|
14
14
|
renderOptions: () => {};
|
|
15
|
-
}
|
|
15
|
+
}>>> & Readonly<{}>, {
|
|
16
16
|
source: string;
|
|
17
|
-
renderOptions:
|
|
18
|
-
}, {}>;
|
|
17
|
+
renderOptions: MarkdownRenderOptions;
|
|
18
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
19
|
export default _default;
|
|
20
20
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
21
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { renderMarkdown, createStyleScope } from './renderMarkdown';
|
|
2
2
|
export type { MarkdownRenderOptions } from './renderMarkdown';
|
|
3
|
+
export { bindMarkdownInteractions, writeClipboard } from './interactions';
|
|
4
|
+
export type { BindMarkdownInteractionsOptions } from './interactions';
|
|
3
5
|
export { default as MarkdownContent } from './MarkdownContent.vue';
|
|
4
6
|
export { openImagePreview, closeImagePreview } from './imagePreview';
|
|
5
7
|
export { downloadTableAsExcel } from './tableDownload';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** bindMarkdownInteractions 入参 */
|
|
2
|
+
export interface BindMarkdownInteractionsOptions {
|
|
3
|
+
/**
|
|
4
|
+
* 收集「同一容器内全部图片」的根节点(图片预览左右切换用)
|
|
5
|
+
*
|
|
6
|
+
* 不传时使用绑定元素本身;图片预览需要跨多个 markdown 片段串联时,
|
|
7
|
+
* 可传入更高层的容器。
|
|
8
|
+
*/
|
|
9
|
+
imageRoot?: () => HTMLElement | null | undefined;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 复制文本到剪贴板。
|
|
13
|
+
*
|
|
14
|
+
* 三层策略,覆盖 http(非安全上下文)、iOS Safari、老浏览器的差异:
|
|
15
|
+
* 1. `navigator.clipboard.writeText`:首选,但**仅 https / localhost** 等安全上下文可用,
|
|
16
|
+
* http 页面下 `navigator.clipboard` 直接是 undefined;
|
|
17
|
+
* 2. `document.execCommand('copy')` + 隐藏 textarea:http 下的主力方案;
|
|
18
|
+
* 3. iOS Safari 对普通 `<textarea>` 的 `select()` 无效,必须 `contentEditable` + `setSelectionRange` + 手动 `focus`,
|
|
19
|
+
* 否则选区为空、复制出来是空串。
|
|
20
|
+
*
|
|
21
|
+
* 与旧实现的区别:失败会 **reject**,调用方据此展示「复制失败」而不是一律显示「已复制」。
|
|
22
|
+
* @param text 待复制的纯文本
|
|
23
|
+
* @returns 复制成功 resolve,全部方案均失败时 reject
|
|
24
|
+
*/
|
|
25
|
+
export declare const writeClipboard: (text: string) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* 在容器上委托 markdown 输出的点击交互
|
|
28
|
+
*
|
|
29
|
+
* 处理范围:代码块复制、代码块折叠/展开、图片下载、图片预览、表格导出 Excel。
|
|
30
|
+
*
|
|
31
|
+
* 同一份 HTML 可能被多层容器同时绑定(组件内一层 + 宿主兜底一层),
|
|
32
|
+
* 内层先处理并 `preventDefault`,外层看到默认行为已被阻止就直接跳过,
|
|
33
|
+
* 避免重复执行(复制两次、折叠两次互相抵消)。
|
|
34
|
+
*
|
|
35
|
+
* @param target 承载 markdown HTML 的容器,传空值时不绑定
|
|
36
|
+
* @param options 可选配置,见 {@link BindMarkdownInteractionsOptions}
|
|
37
|
+
* @returns 解绑函数,容器销毁时调用
|
|
38
|
+
*/
|
|
39
|
+
export declare const bindMarkdownInteractions: (target: HTMLElement | null | undefined, options?: BindMarkdownInteractionsOptions) => (() => void);
|
package/dist/tools/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.wi-markdown{color:var(--wi-chat-text);font-size:14px;line-height:1.75;word-break:break-word;overflow-wrap:break-word}.wi-markdown>:first-child{margin-top:0}.wi-markdown>:last-child{margin-bottom:0}.wi-markdown p{margin:.5em 0}.wi-markdown h1,.wi-markdown h2,.wi-markdown h3,.wi-markdown h4,.wi-markdown h5,.wi-markdown h6{margin:1em 0 .5em;font-weight:600}.wi-markdown h1{font-size:1.5em}.wi-markdown h2{font-size:1.3em}.wi-markdown h3{font-size:1.15em}.wi-markdown h4,.wi-markdown h5,.wi-markdown h6{font-size:1em}.wi-markdown a{color:var(--wi-chat-primary)}.wi-markdown img{max-width:100%}.wi-markdown blockquote{margin:.5em 0;padding:.25em 1em;border-left:3px solid color-mix(in srgb,var(--wi-chat-primary) 40%,transparent);color:var(--wi-chat-text-secondary);background:color-mix(in srgb,var(--wi-chat-primary) 6%,transparent)}.wi-markdown hr{border:0;border-top:1px solid var(--wi-chat-border);margin:1em 0}.wi-markdown code{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.92em}.wi-markdown :not(pre)>code{padding:.15em .4em;border-radius:4px;background:var(--wi-chat-code-bg)}.wi-markdown .wi-md-block{margin:1em 0;border:1px solid var(--wi-chat-border);border-radius:var(--wi-chat-radius);overflow:hidden;background:var(--wi-chat-bg)}.wi-markdown .wi-md-block-header{display:flex;justify-content:space-between;align-items:center;padding:
|
|
1
|
+
@charset "UTF-8";.wi-markdown{color:var(--wi-chat-text);font-size:14px;line-height:1.75;word-break:break-word;overflow-wrap:break-word}.wi-markdown.wi-markdown--muted{color:var(--wi-chat-text-secondary);font-size:13px}.wi-markdown>:first-child{margin-top:0}.wi-markdown>:last-child{margin-bottom:0}.wi-markdown p{margin:.5em 0}.wi-markdown h1,.wi-markdown h2,.wi-markdown h3,.wi-markdown h4,.wi-markdown h5,.wi-markdown h6{margin:1em 0 .5em;font-weight:600}.wi-markdown h1{font-size:1.5em}.wi-markdown h2{font-size:1.3em}.wi-markdown h3{font-size:1.15em}.wi-markdown h4,.wi-markdown h5,.wi-markdown h6{font-size:1em}.wi-markdown a{color:var(--wi-chat-primary)}.wi-markdown img{max-width:100%}.wi-markdown blockquote{margin:.5em 0;padding:.25em 1em;border-left:3px solid color-mix(in srgb,var(--wi-chat-primary) 40%,transparent);color:var(--wi-chat-text-secondary);background:color-mix(in srgb,var(--wi-chat-primary) 6%,transparent)}.wi-markdown hr{border:0;border-top:1px solid var(--wi-chat-border);margin:1em 0}.wi-markdown code{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:.92em}.wi-markdown :not(pre)>code{padding:.15em .4em;border-radius:4px;background:var(--wi-chat-code-bg)}.wi-markdown .wi-md-block{margin:1em 0;border:1px solid var(--wi-chat-border);border-radius:var(--wi-chat-radius);overflow:hidden;background:var(--wi-chat-bg);max-width:100%}.wi-markdown .wi-md-block-header{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:34px;padding:4px 12px;background:var(--wi-chat-header-bg);border-bottom:1px solid var(--wi-chat-border);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color .2s ease}.wi-markdown .wi-md-block-header:hover{background:color-mix(in srgb,var(--wi-chat-primary) 6%,var(--wi-chat-header-bg))}.wi-markdown .wi-md-block-header:focus-visible{outline:2px solid var(--wi-chat-primary);outline-offset:-2px}.wi-markdown .wi-md-block-header .wi-md-copy,.wi-markdown .wi-md-block-header .wi-md-toggle{cursor:pointer}.wi-markdown .wi-md-block-header-left,.wi-markdown .wi-md-block-header-right{display:flex;align-items:center;gap:8px}.wi-markdown .wi-md-lang{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;font-weight:600;line-height:1;color:var(--wi-chat-text-secondary)}.wi-markdown .wi-md-copy,.wi-markdown .wi-md-toggle{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:24px;height:24px;padding:0 4px;border:0;border-radius:4px;background:none;color:var(--wi-chat-text-secondary);cursor:pointer;white-space:nowrap;flex:none;transition:background-color .2s ease,color .2s ease}.wi-markdown .wi-md-copy:hover,.wi-markdown .wi-md-toggle:hover{background:color-mix(in srgb,var(--wi-chat-primary) 10%,transparent);color:var(--wi-chat-primary)}.wi-markdown .wi-md-copy.wi-md-copied{color:#22863a}.wi-markdown .wi-md-copy.wi-md-copied svg,.wi-markdown .wi-md-copy.wi-md-copy-failed svg{display:none}.wi-markdown .wi-md-copy.wi-md-copied:after{content:"已复制";font-size:12px;line-height:1}.wi-markdown .wi-md-copy.wi-md-copy-failed{color:#cf222e}.wi-markdown .wi-md-copy.wi-md-copy-failed:after{content:"复制失败";font-size:12px;line-height:1}.wi-markdown .wi-md-code{margin:0;padding:14px 16px;max-width:100%;overflow-x:auto;font-size:13px;line-height:1.65;-moz-tab-size:4;tab-size:4;background:var(--wi-chat-code-bg)}.wi-markdown .wi-md-code code{background:transparent;padding:0}.wi-markdown .wi-md-block.wi-md-collapsed .wi-md-code{display:none}.wi-markdown .wi-md-block.wi-md-collapsed .wi-md-toggle svg{transform:rotate(-90deg);transition:transform .2s}.wi-markdown .wi-md-table{width:100%;border-collapse:collapse;margin:1em 0}.wi-markdown .wi-md-table thead{background:color-mix(in srgb,var(--wi-chat-primary) 8%,transparent)}.wi-markdown .wi-md-table th,.wi-markdown .wi-md-table td{padding:8px 10px;border:1px solid var(--wi-chat-border);text-align:center}.wi-markdown .wi-md-table th{font-weight:600}.wi-markdown .wi-md-list{margin:.5em 0;padding-left:0;list-style:none}.wi-markdown .wi-md-list-item{position:relative;margin:.25em 0;padding-left:1.5em}.wi-markdown .wi-md-list-ordered{counter-reset:wi-md-counter}.wi-markdown .wi-md-list-ordered>.wi-md-list-item:before{counter-increment:wi-md-counter;content:counter(wi-md-counter) ".";position:absolute;left:0;top:0;font-weight:600;min-width:1.2em;text-align:right}.wi-markdown .wi-md-list-bullet>.wi-md-list-item:before{content:"•";position:absolute;left:0;top:0;font-weight:700}.wi-markdown .wi-md-image-wrap{display:inline-block;position:relative;max-width:100%;cursor:zoom-in}.wi-markdown .wi-md-image-wrap:hover{opacity:.9}.wi-markdown .wi-md-image-download{position:absolute;top:8px;right:8px;display:flex;align-items:center;justify-content:center;width:28px;height:28px;background:#00000080;border-radius:4px;cursor:pointer;color:#fff;opacity:0;transition:opacity .2s ease;z-index:10}.wi-markdown .wi-md-image-wrap:hover .wi-md-image-download{opacity:1}.wi-markdown .wi-md-image-download:hover{background:#000000b3}.wi-markdown .wi-md-table-wrap{position:relative}.wi-markdown .wi-md-table-download{position:absolute;top:4px;right:4px;display:inline-flex;align-items:center;justify-content:center;padding:4px;border:1px solid var(--wi-chat-border);border-radius:4px;background:var(--wi-chat-bg);color:var(--wi-chat-text-secondary);cursor:pointer;opacity:0;transition:opacity .2s ease;z-index:10}.wi-markdown .wi-md-table-wrap:hover .wi-md-table-download{opacity:1}.wi-markdown .wi-md-table-download:hover{color:var(--wi-chat-primary);border-color:var(--wi-chat-primary)}
|
|
@@ -11,7 +11,7 @@ export interface OnReachTopOptions {
|
|
|
11
11
|
* useAutoScroll 返回值
|
|
12
12
|
*/
|
|
13
13
|
export interface UseAutoScrollReturn {
|
|
14
|
-
/** 是否显示"回到底部"
|
|
14
|
+
/** 是否显示"回到底部"按钮(距底部超过阈值时为 true;内容不足一屏时恒为 false) */
|
|
15
15
|
showScrollToBottom: Ref<boolean>;
|
|
16
16
|
/** 强制滚动到底部:等待渲染完成(nextTick + 一帧)后执行,并重置自动滚动状态为开启 */
|
|
17
17
|
forceScrollToBottom: () => Promise<void>;
|
|
@@ -20,8 +20,8 @@ export interface UseAutoScrollReturn {
|
|
|
20
20
|
/** 立即按当前滚动位置重算状态(内容被整体替换后外部可主动调用;观察器已自动触发,一般不用手调) */
|
|
21
21
|
syncScrollState: () => void;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* 重置滚动状态:滚动位置归零、重新开启自动滚动、隐藏按钮,并清空触顶状态。
|
|
24
|
+
* 用于「整表替换」场景(如切换会话时消息被清空),避免上一会话的按钮状态 / 上翻态 / 触顶态滞留。
|
|
25
25
|
*/
|
|
26
26
|
resetScrollState: () => void;
|
|
27
27
|
/** 注册"滚动触顶"回调(触发一次后需离开顶部区域才能再次触发;触发期间防重入),供向上翻页加载更早历史 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatAttachment } from 'wi-chat/parser';
|
|
2
2
|
|
|
3
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
/** 附件数据对象 */
|
|
5
5
|
item: ChatAttachment<any>;
|
|
6
6
|
/** 是否可点击 */
|
|
@@ -19,7 +19,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
19
19
|
downloadable: any;
|
|
20
20
|
baseURL: string;
|
|
21
21
|
getFileUrl: any;
|
|
22
|
-
}
|
|
22
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
23
|
click: (item: ChatAttachment<any>) => void;
|
|
24
24
|
remove: (item: ChatAttachment<any>) => void;
|
|
25
25
|
download: (item: ChatAttachment<any>) => void;
|
|
@@ -42,17 +42,17 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
42
42
|
downloadable: any;
|
|
43
43
|
baseURL: string;
|
|
44
44
|
getFileUrl: any;
|
|
45
|
-
}>>> & {
|
|
45
|
+
}>>> & Readonly<{
|
|
46
46
|
onClick?: (item: ChatAttachment<any>) => any;
|
|
47
|
-
onDownload?: (item: ChatAttachment<any>) => any;
|
|
48
47
|
onRemove?: (item: ChatAttachment<any>) => any;
|
|
49
|
-
|
|
48
|
+
onDownload?: (item: ChatAttachment<any>) => any;
|
|
49
|
+
}>, {
|
|
50
50
|
baseURL: string;
|
|
51
51
|
clickable: boolean;
|
|
52
52
|
removable: boolean;
|
|
53
53
|
downloadable: boolean;
|
|
54
54
|
getFileUrl: (fileId: string) => string;
|
|
55
|
-
}, {}>, {
|
|
55
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
56
56
|
icon?(_: {
|
|
57
57
|
item: ChatAttachment<any>;
|
|
58
58
|
}): any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AttachmentItem } from './types';
|
|
2
2
|
|
|
3
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
/** 附件列表,支持标准 AttachmentItem 对象数组或原生 File 对象数组 */
|
|
5
5
|
items?: any[];
|
|
6
6
|
/** 是否支持删除,默认 false */
|
|
@@ -20,7 +20,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
20
20
|
clickable: boolean;
|
|
21
21
|
baseURL: string;
|
|
22
22
|
getFileUrl: any;
|
|
23
|
-
}
|
|
23
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
24
|
remove: (index: number, item: AttachmentItem<any>) => void;
|
|
25
25
|
click: (item: AttachmentItem<any>, index: number) => void;
|
|
26
26
|
download: (item: AttachmentItem<any>, index: number) => void;
|
|
@@ -44,18 +44,18 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
44
44
|
clickable: boolean;
|
|
45
45
|
baseURL: string;
|
|
46
46
|
getFileUrl: any;
|
|
47
|
-
}>>> & {
|
|
47
|
+
}>>> & Readonly<{
|
|
48
48
|
onClick?: (item: AttachmentItem<any>, index: number) => any;
|
|
49
|
-
onDownload?: (item: AttachmentItem<any>, index: number) => any;
|
|
50
49
|
onRemove?: (index: number, item: AttachmentItem<any>) => any;
|
|
51
|
-
|
|
50
|
+
onDownload?: (item: AttachmentItem<any>, index: number) => any;
|
|
51
|
+
}>, {
|
|
52
52
|
items: any[];
|
|
53
53
|
baseURL: string;
|
|
54
54
|
clickable: boolean;
|
|
55
55
|
removable: boolean;
|
|
56
56
|
downloadable: boolean;
|
|
57
57
|
getFileUrl: (fileId: string) => string;
|
|
58
|
-
}, {}>, {
|
|
58
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
59
59
|
icon?(_: {
|
|
60
60
|
item: AttachmentItem<any>;
|
|
61
61
|
}): any;
|
|
@@ -2,7 +2,7 @@ import { AnswerParser, AssistantMessage, Message } from 'wi-chat/parser';
|
|
|
2
2
|
import { OutputFileConfig } from 'wi-chat/renderers';
|
|
3
3
|
import { ChatAgentItem, ChatSubmitPayload } from './types';
|
|
4
4
|
|
|
5
|
-
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
6
6
|
/** 当前分组消息列表 */
|
|
7
7
|
messages: Message[];
|
|
8
8
|
/** 自定义回答类型 parser */
|
|
@@ -53,7 +53,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
53
53
|
emptyTitle: string;
|
|
54
54
|
emptyDescription: string;
|
|
55
55
|
disabled: boolean;
|
|
56
|
-
}
|
|
56
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
57
57
|
"update:question": (value: string) => void;
|
|
58
58
|
"update:incPrevQuestion": (value: "Y" | "N") => void;
|
|
59
59
|
submit: (payload: ChatSubmitPayload) => void;
|
|
@@ -112,15 +112,15 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
112
112
|
emptyTitle: string;
|
|
113
113
|
emptyDescription: string;
|
|
114
114
|
disabled: boolean;
|
|
115
|
-
}>>> & {
|
|
115
|
+
}>>> & Readonly<{
|
|
116
|
+
onStop?: () => any;
|
|
116
117
|
onSubmit?: (payload: ChatSubmitPayload) => any;
|
|
117
118
|
onLoadOlder?: () => any;
|
|
118
|
-
onUpdateThinkingExpanded?: (message: AssistantMessage, expanded: boolean) => any;
|
|
119
|
-
onStop?: () => any;
|
|
120
119
|
onSelectAgent?: (agent: ChatAgentItem) => any;
|
|
120
|
+
onUpdateThinkingExpanded?: (message: AssistantMessage, expanded: boolean) => any;
|
|
121
121
|
"onUpdate:incPrevQuestion"?: (value: "Y" | "N") => any;
|
|
122
122
|
"onUpdate:question"?: (value: string) => any;
|
|
123
|
-
}
|
|
123
|
+
}>, {
|
|
124
124
|
placeholder: string;
|
|
125
125
|
question: string;
|
|
126
126
|
parsers: AnswerParser<any>[];
|
|
@@ -129,14 +129,14 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
129
129
|
loading: boolean;
|
|
130
130
|
getFileUrl: (fileId: string) => string;
|
|
131
131
|
disabled: boolean;
|
|
132
|
-
emptyTitle: string;
|
|
133
|
-
emptyDescription: string;
|
|
134
132
|
talking: boolean;
|
|
133
|
+
session: string;
|
|
135
134
|
agentList: ChatAgentItem[];
|
|
136
135
|
currentAgent: ChatAgentItem;
|
|
137
|
-
session: string;
|
|
138
136
|
hasMore: boolean;
|
|
139
|
-
|
|
137
|
+
emptyTitle: string;
|
|
138
|
+
emptyDescription: string;
|
|
139
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
140
140
|
messages?(_: {}): any;
|
|
141
141
|
"above-input"?(_: {}): any;
|
|
142
142
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnswerParser, AssistantMessage, Message } from 'wi-chat/parser';
|
|
2
2
|
import { OutputFileConfig } from 'wi-chat/renderers';
|
|
3
3
|
|
|
4
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
5
|
/** 当前分组消息列表 */
|
|
6
6
|
messages: Message[];
|
|
7
7
|
/** 自定义回答类型 parser(component 字段会注册进共享 contentMap) */
|
|
@@ -25,12 +25,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
25
25
|
loading: boolean;
|
|
26
26
|
emptyTitle: string;
|
|
27
27
|
emptyDescription: string;
|
|
28
|
-
}
|
|
28
|
+
}>>, {
|
|
29
29
|
/** 强制滚动到底部 */
|
|
30
30
|
forceScrollToBottom: () => Promise<void>;
|
|
31
31
|
/** 自动滚动开启时请求滚动到底部 */
|
|
32
32
|
requestScrollToBottom: () => Promise<void>;
|
|
33
|
-
},
|
|
33
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
34
34
|
loadOlder: () => void;
|
|
35
35
|
updateThinkingExpanded: (message: AssistantMessage, expanded: boolean) => void;
|
|
36
36
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -57,17 +57,17 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
57
57
|
loading: boolean;
|
|
58
58
|
emptyTitle: string;
|
|
59
59
|
emptyDescription: string;
|
|
60
|
-
}>>> & {
|
|
60
|
+
}>>> & Readonly<{
|
|
61
61
|
onLoadOlder?: () => any;
|
|
62
62
|
onUpdateThinkingExpanded?: (message: AssistantMessage, expanded: boolean) => any;
|
|
63
|
-
}
|
|
63
|
+
}>, {
|
|
64
64
|
parsers: AnswerParser[];
|
|
65
65
|
baseURL: string;
|
|
66
66
|
loading: boolean;
|
|
67
67
|
getFileUrl: (fileId: string) => string;
|
|
68
68
|
emptyTitle: string;
|
|
69
69
|
emptyDescription: string;
|
|
70
|
-
}, {}>;
|
|
70
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
71
71
|
export default _default;
|
|
72
72
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
73
73
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatEnvOption, ChatEnvType } from './types';
|
|
2
2
|
|
|
3
|
-
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
/** 当前选中的运行环境(v-model) */
|
|
5
5
|
modelValue?: ChatEnvType;
|
|
6
6
|
/** 选项列表;不传时使用内置的「本地电脑 / 云电脑」两项 */
|
|
@@ -17,7 +17,7 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
17
17
|
disabled: boolean;
|
|
18
18
|
size: string;
|
|
19
19
|
showHint: boolean;
|
|
20
|
-
}
|
|
20
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
21
21
|
"update:modelValue": (value: ChatEnvType) => void;
|
|
22
22
|
change: (option: ChatEnvOption) => void;
|
|
23
23
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
@@ -37,16 +37,16 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
37
37
|
disabled: boolean;
|
|
38
38
|
size: string;
|
|
39
39
|
showHint: boolean;
|
|
40
|
-
}>>> & {
|
|
40
|
+
}>>> & Readonly<{
|
|
41
41
|
onChange?: (option: ChatEnvOption) => any;
|
|
42
42
|
"onUpdate:modelValue"?: (value: ChatEnvType) => any;
|
|
43
|
-
}
|
|
44
|
-
options: ChatEnvOption[];
|
|
43
|
+
}>, {
|
|
45
44
|
size: 'default' | 'small';
|
|
45
|
+
options: ChatEnvOption[];
|
|
46
46
|
disabled: boolean;
|
|
47
47
|
modelValue: ChatEnvType;
|
|
48
48
|
showHint: boolean;
|
|
49
|
-
}, {}>;
|
|
49
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
50
50
|
export default _default;
|
|
51
51
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
52
52
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
package/dist/web-ui/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("wi-chat/renderers"),e=require("vue"),N=require("element-plus"),F=require("wi-chat/parser"),L=require("wi-chat/tools"),I=d=>(e.pushScopeId("data-v-dc2d5f2b"),d=d(),e.popScopeId(),d),H={class:"wi-web-attach-card__icon"},W=I(()=>e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)),K=I(()=>e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)),Y={key:1,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},X=e.createStaticVNode('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>',5),Z=[X],G={key:2,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},J=I(()=>e.createElementVNode("path",{d:"M18 20V10"},null,-1)),ee=I(()=>e.createElementVNode("path",{d:"M12 20V4"},null,-1)),te=I(()=>e.createElementVNode("path",{d:"M6 20v-6"},null,-1)),oe=[J,ee,te],le={key:3,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},ne=e.createStaticVNode('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>',5),ae=[ne],se={class:"wi-web-attach-card__info"},ie=["title"],re={key:0,class:"wi-web-attach-card__size"},ce={class:"wi-web-attach-card__actions"},de=I(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),e.createElementVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"})],-1)),ue=[de],pe=e.defineComponent({__name:"AttachmentCard",props:{item:{},clickable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["click","remove","download"],setup(d,{emit:g}){const a=d,s=g,p=e.computed(()=>{var o;return((o=a.item)==null?void 0:o.attachContent)||{}}),w=e.computed(()=>F.isImageAttachment(a.item)),_=e.computed(()=>F.resolveAttachPreviewUrl(a.item,a.baseURL,a.getFileUrl)),l=e.computed(()=>{if(a.removable)return!1;if(a.downloadable!==void 0)return a.downloadable;if(a.item.type&&a.item.type!=="file")return!1;const o=p.value;return!!(o.fileId||o.raw)}),c=()=>{s("click",a.item)},i=()=>{s("remove",a.item)},u=async()=>{s("download",a.item),await L.downloadAttachment(a.item,{baseURL:a.baseURL,getFileUrl:a.getFileUrl})};return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-attach-card",{"is-clickable":o.clickable||!!o.$attrs.onClick}]),onClick:c},[e.createElementVNode("div",H,[e.renderSlot(o.$slots,"icon",{item:o.item},()=>[w.value&&_.value?(e.openBlock(),e.createBlock(e.unref(N.ElImage),{key:0,src:_.value,"preview-src-list":[_.value],"zoom-rate":1.2,"preview-teleported":"",fit:"cover",class:"wi-web-attach-card__image",onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},{placeholder:e.withCtx(()=>[W]),error:e.withCtx(()=>[K]),_:1},8,["src","preview-src-list"])):o.item.type==="table"?(e.openBlock(),e.createElementBlock("svg",Y,Z)):o.item.type==="metric"?(e.openBlock(),e.createElementBlock("svg",G,oe)):(e.openBlock(),e.createElementBlock("svg",le,ae))],!0)]),e.createElementVNode("div",se,[e.createElementVNode("div",{class:"wi-web-attach-card__name",title:o.item.name},[e.renderSlot(o.$slots,"title",{item:o.item},()=>[e.createTextVNode(e.toDisplayString(o.item.name),1)],!0)],8,ie),o.item.description||o.$slots.description?(e.openBlock(),e.createElementBlock("div",re,[e.renderSlot(o.$slots,"description",{item:o.item},()=>[e.createTextVNode(e.toDisplayString(o.item.description),1)],!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ce,[e.renderSlot(o.$slots,"actions",{item:o.item},()=>[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__download",title:"下载附件",onClick:e.withModifiers(u,["stop"])},ue)):e.createCommentVNode("",!0),o.removable?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__delete",title:"删除附件",onClick:e.withModifiers(i,["stop"])}," × ")):e.createCommentVNode("",!0)],!0)])],2))}}),S=(d,g)=>{const a=d.__vccOpts||d;for(const[s,p]of g)a[s]=p;return a},M=S(pe,[["__scopeId","data-v-dc2d5f2b"]]),me={key:0,class:"wi-web-attachment-list"},he=e.defineComponent({__name:"AttachmentList",props:{items:{default:()=>[]},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},clickable:{type:Boolean,default:!1},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["remove","click","download"],setup(d,{emit:g}){const a=d,s=g,p=e.computed(()=>(a.items||[]).map((i,u)=>{var r,v;const o=F.normalizeAttachment(i),n=(r=o.attachContent)==null?void 0:r.raw,k=((v=o.attachContent)==null?void 0:v.fileId)||(n?`${n.name}_${n.size}_${u}`:`${o.name}_${u}`);return{...o,key:k}})),w=(c,i)=>{s("remove",c,i)},_=(c,i)=>{s("click",c,i)},l=(c,i)=>{s("download",c,i)};return(c,i)=>p.value.length>0?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(u,o)=>(e.openBlock(),e.createBlock(M,{key:u.key||o,item:u,removable:c.removable,downloadable:c.downloadable,clickable:c.clickable||!!c.$attrs.onClick,"base-u-r-l":c.baseURL,"get-file-url":c.getFileUrl,onClick:n=>_(u,o),onRemove:n=>w(o,u),onDownload:n=>l(u,o)},{icon:e.withCtx(n=>[e.renderSlot(c.$slots,"icon",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),title:e.withCtx(n=>[e.renderSlot(c.$slots,"title",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),description:e.withCtx(n=>[e.renderSlot(c.$slots,"description",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),actions:e.withCtx(n=>[e.renderSlot(c.$slots,"actions",e.normalizeProps(e.guardReactiveProps(n)),void 0,!0)]),_:2},1032,["item","removable","downloadable","clickable","base-u-r-l","get-file-url","onClick","onRemove","onDownload"]))),128))])):e.createCommentVNode("",!0)}}),T=S(he,[["__scopeId","data-v-ff76d134"]]),V=d=>(e.pushScopeId("data-v-c6f1253a"),d=d(),e.popScopeId(),d),we={class:"wi-web-inputbox"},_e={key:0,class:"wi-web-inputbox__top-bar"},ve={key:0,class:"wi-web-inputbox__agent-bar"},be={class:"wi-web-inputbox__agent-icon-wrapper"},fe=["src"],ge={key:1,class:"wi-web-inputbox__agent-svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ke=V(()=>e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"},null,-1)),ye=V(()=>e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"},null,-1)),Be=[ke,ye],Ee={class:"wi-web-inputbox__agent-title"},Ve=V(()=>e.createElementVNode("path",{d:"M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",fill:"currentColor"},null,-1)),Ce=[Ve],Ne={class:"wi-web-agent-list"},$e=V(()=>e.createElementVNode("div",{class:"wi-web-agent-list__header"},"切换智能体",-1)),Se={key:0,class:"wi-web-agent-list__empty"},Ae=["onClick"],Ie={class:"wi-web-agent-item__left"},Ue=["src"],Fe={key:1,class:"wi-web-agent-item__avatar-fallback"},Pe=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"}),e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"})],-1)),Re=[Pe],Te={class:"wi-web-agent-item__title"},xe={key:0,class:"wi-web-agent-item__check"},ze={key:1,class:"wi-web-inputbox__options"},Le={class:"wi-web-inputbox__main"},Me={key:0,class:"wi-web-inputbox__attachments"},Oe={class:"wi-web-inputbox__footer"},De={class:"wi-web-inputbox__footer-left"},je={class:"wi-web-inputbox__footer-right"},Qe={key:0,class:"wi-web-inputbox__counter"},qe=V(()=>e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("path",{d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896z m0 85.333333a362.666667 362.666667 0 1 0 0 725.333334 362.666667 362.666667 0 0 0 0-725.333334z m120.746667 181.333334a42.666667 42.666667 0 0 1 54.826666 4.693333l5.546667 6.357334a42.666667 42.666667 0 0 1-4.693333 54.826666l-6.357334 5.546667-114.730666 114.773333 114.730666 114.730667a42.666667 42.666667 0 0 1 5.461334 54.826666l-5.461334 6.357334a42.666667 42.666667 0 0 1-54.826666 5.461333l-6.357334-5.461333-114.730666-114.730667-114.730667 114.730667a42.666667 42.666667 0 0 1-54.826667 5.461333l-6.357333-5.461333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333 114.730667-114.730667-114.730667-114.773333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333a42.666667 42.666667 0 0 1 54.826667-5.461334l6.357333 5.461334 114.730667 114.730666 114.730666-114.730666a42.666667 42.666667 0 0 1 24.32-11.434667z"})],-1)),He=[qe],We=["disabled"],Ke=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)),Ye=[Ke],Xe=["accept"],Ze=V(()=>e.createElementVNode("div",{class:"wi-web-inputbox__divider"},null,-1)),Ge=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})],-1)),Je=[Ge],et=V(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor"},[e.createElementVNode("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})],-1)),tt=[et],ot=e.defineComponent({__name:"Inputbox",props:{modelValue:{default:""},placeholder:{default:'"↑↓"切换历史输入,"⇧↵"换行'},disabled:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},maxlength:{},autosize:{type:[Object,Boolean],default:()=>({minRows:3,maxRows:8})},showAgentBar:{type:Boolean,default:!0},showUpload:{type:Boolean,default:!0},showWordLimit:{type:Boolean,default:!0},accept:{default:".csv,.txt,.pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg,.gif,.mp4"},agentList:{default:()=>[]},currentAgent:{default:null},defaultAgentTitle:{default:"系统默认智能体"},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},incPrevQuestion:{default:"Y"},showIncPrevQuestion:{type:Boolean,default:!0}},emits:["update:modelValue","submit","stop","selectAgent","update:files","update:attachments","update:incPrevQuestion"],setup(d,{expose:g,emit:a}){const s=d,p=a,w=e.ref(null),_=e.ref(null),l=e.ref(!1),c=t=>F.parseRealtimeAttachment(t),i=e.ref([]),u=e.computed(()=>!!!(s.modelValue&&s.modelValue.trim())),o=t=>t?s.getFileUrl?s.getFileUrl(t):F.resolveRemoteFileUrl(t,s.baseURL,"/algorithm/get_file_data"):"",n=t=>{p("selectAgent",t),l.value=!1},k=t=>{p("update:incPrevQuestion",t?"N":"Y")},r=()=>{p("update:modelValue","")},v=()=>{_.value&&(_.value.value="",_.value.click())},y=t=>{const h=t.target;if(h.files&&h.files.length>0){const m=Array.from(h.files);for(const b of m)i.value.some(U=>{var z;const R=((z=U.attachContent)==null?void 0:z.raw)||U.raw;return R&&R.name===b.name&&R.size===b.size&&R.lastModified===b.lastModified})||i.value.push(c(b));const E=i.value.map(b=>{var $;return(($=b.attachContent)==null?void 0:$.raw)||b.raw}).filter(Boolean);p("update:files",E),p("update:attachments",[...i.value])}},C=t=>{var b;const h=i.value.splice(t,1)[0],m=((b=h==null?void 0:h.attachContent)==null?void 0:b.url)||(h==null?void 0:h.url);m&&m.startsWith("blob:")&&URL.revokeObjectURL(m);const E=i.value.map($=>{var U;return((U=$.attachContent)==null?void 0:U.raw)||$.raw}).filter(Boolean);p("update:files",E),p("update:attachments",[...i.value])},A=()=>{i.value.forEach(t=>{var m;const h=((m=t==null?void 0:t.attachContent)==null?void 0:m.url)||(t==null?void 0:t.url);h&&h.startsWith("blob:")&&URL.revokeObjectURL(h)}),i.value=[],p("update:files",[]),p("update:attachments",[])},P=()=>{if(s.disabled||u.value)return;const t=s.modelValue||"",h=i.value.map(E=>{var b;return((b=E.attachContent)==null?void 0:b.raw)||E.raw}).filter(Boolean),m=[...i.value];p("submit",{text:t,files:h,attachments:m,agent:s.currentAgent}),i.value=[],p("update:files",[]),p("update:attachments",[])},B=t=>{t.isComposing||t.keyCode===229||(t.preventDefault(),P())};return e.onBeforeUnmount(()=>{A()}),g({clearFiles:A,getFiles:()=>i.value.map(t=>{var h;return((h=t.attachContent)==null?void 0:h.raw)||t.raw}).filter(Boolean),getAttachments:()=>i.value,focus:()=>{var t;(t=w.value)==null||t.focus()}}),(t,h)=>(e.openBlock(),e.createElementBlock("div",we,[t.showAgentBar||t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",_e,[t.showAgentBar?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(e.unref(N.ElPopover),{visible:l.value,"onUpdate:visible":h[0]||(h[0]=m=>l.value=m),placement:"top-start",width:260,trigger:"click","popper-class":"wi-web-agent-popover"},{reference:e.withCtx(()=>{var m,E,b;return[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__agent-btn",{"is-disabled":t.disabled||t.talking}])},[e.createElementVNode("div",be,[(m=t.currentAgent)!=null&&m.image_id&&o(t.currentAgent.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:o(t.currentAgent.image_id),class:"wi-web-inputbox__agent-avatar"},null,8,fe)):(e.openBlock(),e.createElementBlock("svg",ge,Be))]),e.createElementVNode("span",Ee," @"+e.toDisplayString(((E=t.currentAgent)==null?void 0:E.entry_title)||((b=t.currentAgent)==null?void 0:b.entry_id)||t.defaultAgentTitle),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["wi-web-inputbox__agent-arrow",{"is-active":l.value}]),viewBox:"0 0 1024 1024",width:"12",height:"12"},Ce,2))],2)]}),default:e.withCtx(()=>[e.createElementVNode("div",Ne,[$e,!t.agentList||t.agentList.length===0?(e.openBlock(),e.createElementBlock("div",Se," 暂无可选智能体 ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.agentList,m=>{var E,b;return e.openBlock(),e.createElementBlock("div",{key:m.entry_id,class:e.normalizeClass(["wi-web-agent-item",{"is-active":m.entry_id===((E=t.currentAgent)==null?void 0:E.entry_id)}]),onClick:$=>n(m)},[e.createElementVNode("div",Ie,[m.image_id&&o(m.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:o(m.image_id),class:"wi-web-agent-item__avatar"},null,8,Ue)):(e.openBlock(),e.createElementBlock("div",Fe,Re)),e.createElementVNode("span",Te,e.toDisplayString(m.entry_title||m.entry_id),1)]),m.entry_id===((b=t.currentAgent)==null?void 0:b.entry_id)?(e.openBlock(),e.createElementBlock("span",xe,"✓")):e.createCommentVNode("",!0)],10,Ae)}),128))])]),_:1},8,["visible"])])):e.createCommentVNode("",!0),t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(e.unref(N.ElCheckbox),{class:"wi-web-inputbox__ignore-prev","model-value":t.incPrevQuestion==="N","onUpdate:modelValue":k},{default:e.withCtx(()=>[e.createTextVNode(" 忽略之前对话 ")]),_:1},8,["model-value"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[i.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(T,{items:i.value,"base-u-r-l":t.baseURL,"get-file-url":t.getFileUrl,removable:"",onRemove:C},null,8,["items","base-u-r-l","get-file-url"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(N.ElInput),{ref_key:"textareaRef",ref:w,"model-value":t.modelValue,type:"textarea",resize:"none",maxlength:t.maxlength,autosize:t.autosize,placeholder:t.placeholder,disabled:t.disabled||t.talking,class:"wi-web-inputbox__textarea","onUpdate:modelValue":h[1]||(h[1]=m=>p("update:modelValue",m)),onKeydown:e.withKeys(e.withModifiers(B,["exact"]),["enter"])},null,8,["model-value","maxlength","autosize","placeholder","disabled","onKeydown"]),e.createElementVNode("div",Oe,[e.createElementVNode("div",De,[e.renderSlot(t.$slots,"footer-left",{},void 0,!0)]),e.createElementVNode("div",je,[t.showWordLimit?(e.openBlock(),e.createElementBlock("div",Qe,[e.createTextVNode(e.toDisplayString((t.modelValue||"").length),1),t.maxlength?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("/"+e.toDisplayString(t.maxlength),1)],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.modelValue&&!t.disabled&&!t.talking?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:1,content:"清除",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",onClick:r},He)]),_:1})):e.createCommentVNode("",!0),t.showUpload?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:2,content:"上传附件",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",disabled:t.disabled||t.talking,onClick:v},Ye,8,We)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:_,type:"file",multiple:"",accept:t.accept,class:"wi-web-inputbox__hidden-file",onChange:y},null,40,Xe),Ze,t.talking?(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:3,content:"停止生成",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",onClick:h[2]||(h[2]=m=>p("stop"))},Je)]),_:1})):(e.openBlock(),e.createBlock(e.unref(N.ElTooltip),{key:4,content:"发送",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send",{"is-disabled":t.disabled||!t.talking&&u.value}]),onClick:P},tt,2)]),_:1}))])])])]))}}),O=S(ot,[["__scopeId","data-v-c6f1253a"]]),lt=[{id:"recordset",answerType:"recordset",component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ct))}],D=d=>f.createAnswerContentMap([...lt,...d??[]]),nt=d=>(e.pushScopeId("data-v-c18f2f94"),d=d(),e.popScopeId(),d),at={key:0,class:"wi-web-chat-messages__loading"},st={key:1,class:"wi-web-chat-messages__empty"},it=nt(()=>e.createElementVNode("div",{class:"wi-web-chat-messages__empty-logo"},"WI",-1)),rt={class:"wi-web-chat-messages__empty-title"},ct={class:"wi-web-chat-messages__empty-description"},dt={key:0,class:"wi-web-chat-messages__user"},ut={class:"wi-web-chat-messages__user-wrapper"},pt={class:"wi-web-chat-messages__user-bubble"},mt={key:1,class:"wi-web-chat-messages__assistant"},ht=e.defineComponent({__name:"ChatMessagesView",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"}},emits:["loadOlder","updateThinkingExpanded"],setup(d,{expose:g,emit:a}){const s=d,p=a;f.provideOutputFileConfig(s.outputFileConfig??{getFileUrl:n=>{var k;return((k=s.getFileUrl)==null?void 0:k.call(s,n))??(s.baseURL?`${s.baseURL.replace(/\/$/,"")}/algorithm/get_file_data?file_id=${encodeURIComponent(n)}`:"")}});const w=e.ref(),{showScrollToBottom:_,forceScrollToBottom:l,requestScrollToBottom:c,resetScrollState:i,onReachTop:u}=L.useAutoScroll(w),o=e.computed(()=>D(s.parsers));return e.watch(()=>s.messages.length===0,n=>{n&&i()}),e.watch(()=>s.messages[s.messages.length-1],()=>{c()},{deep:!0}),u(()=>p("loadOlder")),g({forceScrollToBottom:l,requestScrollToBottom:c}),(n,k)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:w,class:"wi-web-chat-messages"},[n.loading?(e.openBlock(),e.createElementBlock("div",at,"历史加载中...")):n.messages.length===0?(e.openBlock(),e.createElementBlock("div",st,[it,e.createElementVNode("div",rt,e.toDisplayString(n.emptyTitle),1),e.createElementVNode("div",ct,e.toDisplayString(n.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.messages,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.id},[r.role==="user"?(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",ut,[r.attachments&&r.attachments.length>0?(e.openBlock(),e.createBlock(T,{key:0,class:"wi-web-chat-messages__attachments",items:r.attachments,"base-u-r-l":n.baseURL,"get-file-url":n.getFileUrl},null,8,["items","base-u-r-l","get-file-url"])):e.createCommentVNode("",!0),e.createElementVNode("div",pt,e.toDisplayString(r.content),1)])])):(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(f.DeepThinkingSteps),{steps:r.thinking.steps,expanded:r.thinking.expanded,"onUpdate:expanded":v=>p("updateThinkingExpanded",r,v)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(f.AiAnswerBubble),{answer:r.answer,error:r.error,stopped:r.stopped,"content-map":o.value},null,8,["answer","error","stopped","content-map"])]))],64))),128)),e.createVNode(e.Transition,{name:"wi-web-chat-messages-fade"},{default:e.withCtx(()=>[e.unref(_)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-chat-messages__bottom",onClick:k[0]||(k[0]=(...r)=>e.unref(l)&&e.unref(l)(...r))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),j=S(ht,[["__scopeId","data-v-c18f2f94"]]),wt={class:"wi-web-chat-container"},_t={class:"wi-web-chat-container__footer"},vt=e.defineComponent({__name:"ChatContainer",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},session:{default:""},question:{default:""},incPrevQuestion:{default:"Y"},agentList:{default:()=>[]},currentAgent:{default:null},placeholder:{default:"请输入问题,按 Enter 发送,Shift+Enter 换行"},hasMore:{type:Boolean,default:!0},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"},disabled:{type:Boolean,default:!1}},emits:["update:question","update:incPrevQuestion","submit","stop","selectAgent","loadOlder","updateThinkingExpanded"],setup(d,{emit:g}){const a=d,s=g,p=l=>{s("submit",l)},w=()=>{a.hasMore&&s("loadOlder")},_=l=>{s("selectAgent",l)};return(l,c)=>(e.openBlock(),e.createElementBlock("section",wt,[e.renderSlot(l.$slots,"messages",{},()=>[e.createVNode(j,{messages:l.messages,parsers:l.parsers,"base-u-r-l":l.baseURL,"get-file-url":l.getFileUrl,"output-file-config":l.outputFileConfig,loading:l.loading,"empty-title":l.emptyTitle,"empty-description":l.emptyDescription,onLoadOlder:w,onUpdateThinkingExpanded:c[0]||(c[0]=(i,u)=>s("updateThinkingExpanded",i,u))},null,8,["messages","parsers","base-u-r-l","get-file-url","output-file-config","loading","empty-title","empty-description"])],!0),e.renderSlot(l.$slots,"above-input",{},void 0,!0),e.createElementVNode("footer",_t,[e.createVNode(O,{"model-value":l.question,"onUpdate:modelValue":c[1]||(c[1]=i=>s("update:question",i)),"inc-prev-question":l.incPrevQuestion,"onUpdate:incPrevQuestion":c[2]||(c[2]=i=>s("update:incPrevQuestion",i)),"base-u-r-l":l.baseURL,disabled:l.disabled||!l.session,talking:l.talking,"agent-list":l.agentList,"current-agent":l.currentAgent,placeholder:l.placeholder,"get-file-url":l.getFileUrl,onSelectAgent:_,onSubmit:p,onStop:c[3]||(c[3]=i=>s("stop"))},null,8,["model-value","inc-prev-question","base-u-r-l","disabled","talking","agent-list","current-agent","placeholder","get-file-url"])])]))}}),bt=S(vt,[["__scopeId","data-v-8663b501"]]),Q=d=>(e.pushScopeId("data-v-96941d57"),d=d(),e.popScopeId(),d),ft={key:0,class:"wi-web-recordset"},gt={class:"wi-web-recordset__header"},kt={class:"wi-web-recordset__title"},yt=Q(()=>e.createElementVNode("button",{type:"button",class:"wi-web-recordset__columns-btn",title:"选择展示列"},[e.createElementVNode("svg",{class:"wi-web-recordset__columns-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.createElementVNode("path",{d:"M9 4v16M15 4v16"})]),e.createElementVNode("span",null,"列")],-1)),Bt={class:"wi-web-recordset__columns-panel"},Et=Q(()=>e.createElementVNode("div",{class:"wi-web-recordset__columns-panel-title"},"选择展示列",-1)),Vt=e.defineComponent({__name:"RecordsetTable",props:{report:{},maxHeight:{default:420}},setup(d){const g=d,a=e.computed(()=>{var r;return((r=g.report)==null?void 0:r.values)??{}}),s=e.computed(()=>a.value.chart==="table"),p=e.computed(()=>a.value.title??""),w=e.computed(()=>(Array.isArray(a.value.cols)?a.value.cols:[]).map((v,y)=>({key:`c${y}`,title:(v==null?void 0:v.title)||(v==null?void 0:v.name)||`列${y+1}`}))),_=e.computed(()=>{const r=Number(a.value.max_cols);return Number.isFinite(r)&&r>0?r:1/0}),l=e.computed(()=>w.value.length>_.value),c=e.ref([]),i=e.computed(()=>new Set(c.value)),u=e.computed(()=>w.value.filter(r=>i.value.has(r.key)));e.watch(()=>w.value.map(r=>r.key).join("|"),()=>{c.value=w.value.slice(0,_.value).map(r=>r.key)},{immediate:!0});const o=e.computed(()=>(Array.isArray(a.value.values)?a.value.values:[]).map(v=>{const y={};return w.value.forEach((C,A)=>{y[C.key]=Array.isArray(v)?v[A]:void 0}),y})),n=e.ref(!1),k=(r,v)=>{const y=new Set(c.value);v?y.add(r):y.delete(r),c.value=w.value.filter(C=>y.has(C.key)).map(C=>C.key)};return(r,v)=>{const y=e.resolveComponent("el-checkbox"),C=e.resolveComponent("el-popover"),A=e.resolveComponent("el-table-column"),P=e.resolveComponent("el-table");return s.value?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,e.toDisplayString(p.value),1),l.value?(e.openBlock(),e.createBlock(C,{key:0,visible:n.value,"onUpdate:visible":v[0]||(v[0]=B=>n.value=B),placement:"bottom-end",width:220,trigger:"click","popper-class":"wi-web-recordset-columns-popper"},{reference:e.withCtx(()=>[yt]),default:e.withCtx(()=>[e.createElementVNode("div",Bt,[Et,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,B=>(e.openBlock(),e.createBlock(y,{key:B.key,class:"wi-web-recordset__column-item","model-value":i.value.has(B.key),"onUpdate:modelValue":t=>k(B.key,!!t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B.title),1)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["visible"])):e.createCommentVNode("",!0)]),e.createVNode(P,{data:o.value,border:"",size:"small",class:"wi-web-recordset__table","max-height":r.maxHeight},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,B=>(e.openBlock(),e.createBlock(A,{key:B.key,prop:B.key,label:B.title,"min-width":"120","show-overflow-tooltip":""},null,8,["prop","label"]))),128))]),_:1},8,["data","max-height"])])):e.createCommentVNode("",!0)}}}),q=S(Vt,[["__scopeId","data-v-96941d57"]]),Ct=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),x=d=>(e.pushScopeId("data-v-94659445"),d=d(),e.popScopeId(),d),Nt={class:"wi-web-env-switch__track"},$t={class:"wi-web-env-switch__items"},St=["disabled","onClick"],At={class:"wi-web-env-switch__icon"},It={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},Ut=x(()=>e.createElementVNode("path",{d:"M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z"},null,-1)),Ft=[Ut],Pt={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},Rt=x(()=>e.createElementVNode("rect",{x:"2.5",y:"4",width:"19",height:"12",rx:"2","stroke-linejoin":"round"},null,-1)),Tt=x(()=>e.createElementVNode("path",{d:"M8.5 20h7M12 16v4"},null,-1)),xt=[Rt,Tt],zt={class:"wi-web-env-switch__label"},Lt={key:0,class:"wi-web-env-switch__hint"},Mt={class:"wi-web-env-switch__hint-text"},Ot={key:0,class:"wi-web-env-switch__hint-status"},Dt=e.defineComponent({__name:"EnvSwitch",props:{modelValue:{default:"local"},options:{default:()=>[]},disabled:{type:Boolean,default:!1},size:{default:"default"},showHint:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(d,{emit:g}){const a=d,s=g,p=[{value:"local",label:"本地电脑",description:"在当前设备上执行,文件与终端直连本机",status:"已就绪",online:!0},{value:"cloud",label:"云电脑",description:"在云端环境中执行,算力与存储由服务端提供",status:"未连接",online:!1}],w={default:3,small:2},_=e.computed(()=>{const u=a.options??[];return u.length>0?u:p}),l=e.computed(()=>{if(!a.showHint)return null;const u=_.value;return u.find(o=>o.value===a.modelValue)??u[0]??null}),c=e.computed(()=>{const u=_.value,o=u.length||1,n=Math.max(u.findIndex(r=>r.value===a.modelValue),0),k=w[a.size]??w.default;return{width:`calc(${100/o}% - ${2*k/o}px)`,transform:`translateX(${n*100}%)`}}),i=u=>{a.disabled||u.disabled||u.value!==a.modelValue&&(s("update:modelValue",u.value),s("change",u))};return(u,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-env-switch",[`is-${u.size}`,{"is-disabled":u.disabled}]])},[e.createElementVNode("div",Nt,[e.createElementVNode("span",{class:"wi-web-env-switch__thumb",style:e.normalizeStyle(c.value)},null,4),e.createElementVNode("div",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,n=>(e.openBlock(),e.createElementBlock("button",{key:n.value,type:"button",class:e.normalizeClass(["wi-web-env-switch__item",{"is-active":n.value===u.modelValue,"is-disabled":n.disabled}]),disabled:u.disabled||n.disabled,onClick:k=>i(n)},[e.createElementVNode("span",At,[n.value==="cloud"?(e.openBlock(),e.createElementBlock("svg",It,Ft)):(e.openBlock(),e.createElementBlock("svg",Pt,xt))]),e.createElementVNode("span",zt,e.toDisplayString(n.label),1)],10,St))),128))])]),l.value?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("span",Mt,e.toDisplayString(l.value.description),1),l.value.status?(e.openBlock(),e.createElementBlock("span",Ot,[e.createElementVNode("i",{class:e.normalizeClass(["wi-web-env-switch__dot",{"is-online":l.value.online}])},null,2),e.createTextVNode(" "+e.toDisplayString(l.value.status),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),jt=S(Dt,[["__scopeId","data-v-94659445"]]);Object.defineProperty(exports,"AiAnswerBubble",{enumerable:!0,get:()=>f.AiAnswerBubble});Object.defineProperty(exports,"ClarificationCard",{enumerable:!0,get:()=>f.ClarificationCard});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>f.DeepThinkingSteps});Object.defineProperty(exports,"HostActionStatus",{enumerable:!0,get:()=>f.HostActionStatus});Object.defineProperty(exports,"IframePage",{enumerable:!0,get:()=>f.IframePage});Object.defineProperty(exports,"KnowledgeStreamResult",{enumerable:!0,get:()=>f.KnowledgeStreamResult});Object.defineProperty(exports,"OutputFile",{enumerable:!0,get:()=>f.OutputFile});Object.defineProperty(exports,"createAnswerContentMap",{enumerable:!0,get:()=>f.createAnswerContentMap});Object.defineProperty(exports,"injectIframeResizerChild",{enumerable:!0,get:()=>f.injectIframeResizerChild});Object.defineProperty(exports,"provideIframePageConfig",{enumerable:!0,get:()=>f.provideIframePageConfig});Object.defineProperty(exports,"provideOutputFileConfig",{enumerable:!0,get:()=>f.provideOutputFileConfig});Object.defineProperty(exports,"resolveIframePlaceholders",{enumerable:!0,get:()=>f.resolveIframePlaceholders});Object.defineProperty(exports,"useIframePage",{enumerable:!0,get:()=>f.useIframePage});exports.AttachmentCard=M;exports.AttachmentList=T;exports.ChatContainer=bt;exports.ChatMessagesView=j;exports.EnvSwitch=jt;exports.Inputbox=O;exports.RecordsetTable=q;exports.createWebAnswerContentMap=D;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("wi-chat/renderers"),e=require("vue"),_=require("element-plus"),S=require("wi-chat/parser"),T=require("wi-chat/tools"),D={class:"wi-web-attach-card__icon"},j={key:1,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},Q={key:2,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},q={key:3,viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2"},H={class:"wi-web-attach-card__info"},W=["title"],K={key:0,class:"wi-web-attach-card__size"},Y={class:"wi-web-attach-card__actions"},X=e.defineComponent({__name:"AttachmentCard",props:{item:{},clickable:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["click","remove","download"],setup(t,{emit:y}){const n=t,a=y,m=e.computed(()=>{var s;return((s=n.item)==null?void 0:s.attachContent)||{}}),v=e.computed(()=>S.isImageAttachment(n.item)),f=e.computed(()=>S.resolveAttachPreviewUrl(n.item,n.baseURL,n.getFileUrl)),p=e.computed(()=>{if(n.removable)return!1;if(n.downloadable!==void 0)return n.downloadable;if(n.item.type&&n.item.type!=="file")return!1;const s=m.value;return!!(s.fileId||s.raw)}),d=()=>{a("click",n.item)},i=()=>{a("remove",n.item)},u=async()=>{a("download",n.item),await T.downloadAttachment(n.item,{baseURL:n.baseURL,getFileUrl:n.getFileUrl})};return(s,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-attach-card",{"is-clickable":t.clickable||!!s.$attrs.onClick}]),onClick:d},[e.createElementVNode("div",D,[e.renderSlot(s.$slots,"icon",{item:t.item},()=>[v.value&&f.value?(e.openBlock(),e.createBlock(e.unref(_.ElImage),{key:0,src:f.value,"preview-src-list":[f.value],"zoom-rate":1.2,"preview-teleported":"",fit:"cover",class:"wi-web-attach-card__image",onClick:l[0]||(l[0]=e.withModifiers(()=>{},["stop"]))},{placeholder:e.withCtx(()=>[...l[1]||(l[1]=[e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)])]),error:e.withCtx(()=>[...l[2]||(l[2]=[e.createElementVNode("div",{class:"wi-web-attach-card__image-fallback"},[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.createElementVNode("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.createElementVNode("polyline",{points:"21 15 16 10 5 21"})])],-1)])]),_:1},8,["src","preview-src-list"])):t.item.type==="table"?(e.openBlock(),e.createElementBlock("svg",j,[...l[3]||(l[3]=[e.createStaticVNode('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>',5)])])):t.item.type==="metric"?(e.openBlock(),e.createElementBlock("svg",Q,[...l[4]||(l[4]=[e.createElementVNode("path",{d:"M18 20V10"},null,-1),e.createElementVNode("path",{d:"M12 20V4"},null,-1),e.createElementVNode("path",{d:"M6 20v-6"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",q,[...l[5]||(l[5]=[e.createStaticVNode('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>',5)])]))],!0)]),e.createElementVNode("div",H,[e.createElementVNode("div",{class:"wi-web-attach-card__name",title:t.item.name},[e.renderSlot(s.$slots,"title",{item:t.item},()=>[e.createTextVNode(e.toDisplayString(t.item.name),1)],!0)],8,W),t.item.description||s.$slots.description?(e.openBlock(),e.createElementBlock("div",K,[e.renderSlot(s.$slots,"description",{item:t.item},()=>[e.createTextVNode(e.toDisplayString(t.item.description),1)],!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Y,[e.renderSlot(s.$slots,"actions",{item:t.item},()=>[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__download",title:"下载附件",onClick:e.withModifiers(u,["stop"])},[...l[6]||(l[6]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),e.createElementVNode("line",{x1:"12",y1:"15",x2:"12",y2:"3"})],-1)])])):e.createCommentVNode("",!0),t.removable?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wi-web-attach-card__action-btn wi-web-attach-card__delete",title:"删除附件",onClick:e.withModifiers(i,["stop"])}," × ")):e.createCommentVNode("",!0)],!0)])],2))}}),N=(t,y)=>{const n=t.__vccOpts||t;for(const[a,m]of y)n[a]=m;return n},R=N(X,[["__scopeId","data-v-dc2d5f2b"]]),Z={key:0,class:"wi-web-attachment-list"},G=e.defineComponent({__name:"AttachmentList",props:{items:{default:()=>[]},removable:{type:Boolean,default:!1},downloadable:{type:Boolean,default:void 0},clickable:{type:Boolean,default:!1},baseURL:{default:""},getFileUrl:{type:Function,default:void 0}},emits:["remove","click","download"],setup(t,{emit:y}){const n=t,a=y,m=e.computed(()=>(n.items||[]).map((i,u)=>{var r,b;const s=S.normalizeAttachment(i),l=(r=s.attachContent)==null?void 0:r.raw,k=((b=s.attachContent)==null?void 0:b.fileId)||(l?`${l.name}_${l.size}_${u}`:`${s.name}_${u}`);return{...s,key:k}})),v=(d,i)=>{a("remove",d,i)},f=(d,i)=>{a("click",d,i)},p=(d,i)=>{a("download",d,i)};return(d,i)=>m.value.length>0?(e.openBlock(),e.createElementBlock("div",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(u,s)=>(e.openBlock(),e.createBlock(R,{key:u.key||s,item:u,removable:t.removable,downloadable:t.downloadable,clickable:t.clickable||!!d.$attrs.onClick,"base-u-r-l":t.baseURL,"get-file-url":t.getFileUrl,onClick:l=>f(u,s),onRemove:l=>v(s,u),onDownload:l=>p(u,s)},{icon:e.withCtx(l=>[e.renderSlot(d.$slots,"icon",e.mergeProps({ref_for:!0},l),void 0,!0)]),title:e.withCtx(l=>[e.renderSlot(d.$slots,"title",e.mergeProps({ref_for:!0},l),void 0,!0)]),description:e.withCtx(l=>[e.renderSlot(d.$slots,"description",e.mergeProps({ref_for:!0},l),void 0,!0)]),actions:e.withCtx(l=>[e.renderSlot(d.$slots,"actions",e.mergeProps({ref_for:!0},l),void 0,!0)]),_:3},8,["item","removable","downloadable","clickable","base-u-r-l","get-file-url","onClick","onRemove","onDownload"]))),128))])):e.createCommentVNode("",!0)}}),P=N(G,[["__scopeId","data-v-ff76d134"]]),J={class:"wi-web-inputbox"},ee={key:0,class:"wi-web-inputbox__top-bar"},te={key:0,class:"wi-web-inputbox__agent-bar"},le={class:"wi-web-inputbox__agent-icon-wrapper"},oe=["src"],ne={key:1,class:"wi-web-inputbox__agent-svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ae={class:"wi-web-inputbox__agent-title"},ie={class:"wi-web-agent-list"},se={key:0,class:"wi-web-agent-list__empty"},re=["onClick"],ce={class:"wi-web-agent-item__left"},de=["src"],ue={key:1,class:"wi-web-agent-item__avatar-fallback"},me={class:"wi-web-agent-item__title"},we={key:0,class:"wi-web-agent-item__check"},pe={key:1,class:"wi-web-inputbox__options"},be={class:"wi-web-inputbox__main"},ve={key:0,class:"wi-web-inputbox__attachments"},fe={class:"wi-web-inputbox__footer"},he={class:"wi-web-inputbox__footer-left"},ge={class:"wi-web-inputbox__footer-right"},ke={key:0,class:"wi-web-inputbox__counter"},ye=["disabled"],Be=["accept"],Ee=e.defineComponent({__name:"Inputbox",props:{modelValue:{default:""},placeholder:{default:'"↑↓"切换历史输入,"⇧↵"换行'},disabled:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},maxlength:{},autosize:{type:[Object,Boolean],default:()=>({minRows:3,maxRows:8})},showAgentBar:{type:Boolean,default:!0},showUpload:{type:Boolean,default:!0},showWordLimit:{type:Boolean,default:!0},accept:{default:".csv,.txt,.pdf,.doc,.docx,.xls,.xlsx,.png,.jpg,.jpeg,.gif,.mp4"},agentList:{default:()=>[]},currentAgent:{default:null},defaultAgentTitle:{default:"系统默认智能体"},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},incPrevQuestion:{default:"Y"},showIncPrevQuestion:{type:Boolean,default:!0}},emits:["update:modelValue","submit","stop","selectAgent","update:files","update:attachments","update:incPrevQuestion"],setup(t,{expose:y,emit:n}){const a=t,m=n,v=e.ref(null),f=e.ref(null),p=e.ref(!1),d=c=>S.parseRealtimeAttachment(c),i=e.ref([]),u=e.computed(()=>!!!(a.modelValue&&a.modelValue.trim())),s=c=>c?a.getFileUrl?a.getFileUrl(c):S.resolveRemoteFileUrl(c,a.baseURL,"/algorithm/get_file_data"):"",l=c=>{m("selectAgent",c),p.value=!1},k=c=>{m("update:incPrevQuestion",c?"N":"Y")},r=()=>{m("update:modelValue","")},b=()=>{f.value&&(f.value.value="",f.value.click())},B=c=>{const o=c.target;if(o.files&&o.files.length>0){const w=Array.from(o.files);for(const h of w)i.value.some(A=>{var I;const F=((I=A.attachContent)==null?void 0:I.raw)||A.raw;return F&&F.name===h.name&&F.size===h.size&&F.lastModified===h.lastModified})||i.value.push(d(h));const V=i.value.map(h=>{var x;return((x=h.attachContent)==null?void 0:x.raw)||h.raw}).filter(Boolean);m("update:files",V),m("update:attachments",[...i.value])}},C=c=>{var h;const o=i.value.splice(c,1)[0],w=((h=o==null?void 0:o.attachContent)==null?void 0:h.url)||(o==null?void 0:o.url);w&&w.startsWith("blob:")&&URL.revokeObjectURL(w);const V=i.value.map(x=>{var A;return((A=x.attachContent)==null?void 0:A.raw)||x.raw}).filter(Boolean);m("update:files",V),m("update:attachments",[...i.value])},$=()=>{i.value.forEach(c=>{var w;const o=((w=c==null?void 0:c.attachContent)==null?void 0:w.url)||(c==null?void 0:c.url);o&&o.startsWith("blob:")&&URL.revokeObjectURL(o)}),i.value=[],m("update:files",[]),m("update:attachments",[])},U=()=>{if(a.disabled||u.value)return;const c=a.modelValue||"",o=i.value.map(V=>{var h;return((h=V.attachContent)==null?void 0:h.raw)||V.raw}).filter(Boolean),w=[...i.value];m("submit",{text:c,files:o,attachments:w,agent:a.currentAgent}),i.value=[],m("update:files",[]),m("update:attachments",[])},E=c=>{c.isComposing||c.keyCode===229||(c.preventDefault(),U())};return e.onBeforeUnmount(()=>{$()}),y({clearFiles:$,getFiles:()=>i.value.map(c=>{var o;return((o=c.attachContent)==null?void 0:o.raw)||c.raw}).filter(Boolean),getAttachments:()=>i.value,focus:()=>{var c;(c=v.value)==null||c.focus()}}),(c,o)=>(e.openBlock(),e.createElementBlock("div",J,[t.showAgentBar||t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",ee,[t.showAgentBar?(e.openBlock(),e.createElementBlock("div",te,[e.createVNode(e.unref(_.ElPopover),{visible:p.value,"onUpdate:visible":o[0]||(o[0]=w=>p.value=w),placement:"top-start",width:260,trigger:"click","popper-class":"wi-web-agent-popover"},{reference:e.withCtx(()=>{var w,V,h;return[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__agent-btn",{"is-disabled":t.disabled||t.talking}])},[e.createElementVNode("div",le,[(w=t.currentAgent)!=null&&w.image_id&&s(t.currentAgent.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:s(t.currentAgent.image_id),class:"wi-web-inputbox__agent-avatar"},null,8,oe)):(e.openBlock(),e.createElementBlock("svg",ne,[...o[3]||(o[3]=[e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"},null,-1),e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"},null,-1)])]))]),e.createElementVNode("span",ae," @"+e.toDisplayString(((V=t.currentAgent)==null?void 0:V.entry_title)||((h=t.currentAgent)==null?void 0:h.entry_id)||t.defaultAgentTitle),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["wi-web-inputbox__agent-arrow",{"is-active":p.value}]),viewBox:"0 0 1024 1024",width:"12",height:"12"},[...o[4]||(o[4]=[e.createElementVNode("path",{d:"M840.4 300H183.6c-19.7 0-30.7 22.7-18.5 37.1l328.4 388.7c9.5 11.2 27.5 11.2 37 0l328.4-388.7c12.2-14.4 1.2-37.1-18.5-37.1z",fill:"currentColor"},null,-1)])],2))],2)]}),default:e.withCtx(()=>[e.createElementVNode("div",ie,[o[6]||(o[6]=e.createElementVNode("div",{class:"wi-web-agent-list__header"},"切换智能体",-1)),!t.agentList||t.agentList.length===0?(e.openBlock(),e.createElementBlock("div",se," 暂无可选智能体 ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.agentList,w=>{var V,h;return e.openBlock(),e.createElementBlock("div",{key:w.entry_id,class:e.normalizeClass(["wi-web-agent-item",{"is-active":w.entry_id===((V=t.currentAgent)==null?void 0:V.entry_id)}]),onClick:x=>l(w)},[e.createElementVNode("div",ce,[w.image_id&&s(w.image_id)?(e.openBlock(),e.createElementBlock("img",{key:0,src:s(w.image_id),class:"wi-web-agent-item__avatar"},null,8,de)):(e.openBlock(),e.createElementBlock("div",ue,[...o[5]||(o[5]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("circle",{cx:"12",cy:"8",r:"4"}),e.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"})],-1)])])),e.createElementVNode("span",me,e.toDisplayString(w.entry_title||w.entry_id),1)]),w.entry_id===((h=t.currentAgent)==null?void 0:h.entry_id)?(e.openBlock(),e.createElementBlock("span",we,"✓")):e.createCommentVNode("",!0)],10,re)}),128))])]),_:1},8,["visible"])])):e.createCommentVNode("",!0),t.showIncPrevQuestion?(e.openBlock(),e.createElementBlock("div",pe,[e.createVNode(e.unref(_.ElCheckbox),{class:"wi-web-inputbox__ignore-prev","model-value":t.incPrevQuestion==="N","onUpdate:modelValue":k},{default:e.withCtx(()=>[...o[7]||(o[7]=[e.createTextVNode(" 忽略之前对话 ",-1)])]),_:1},8,["model-value"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",be,[i.value.length>0?(e.openBlock(),e.createElementBlock("div",ve,[e.createVNode(P,{items:i.value,"base-u-r-l":t.baseURL,"get-file-url":t.getFileUrl,removable:"",onRemove:C},null,8,["items","base-u-r-l","get-file-url"])])):e.createCommentVNode("",!0),e.createVNode(e.unref(_.ElInput),{ref_key:"textareaRef",ref:v,"model-value":t.modelValue,type:"textarea",resize:"none",maxlength:t.maxlength,autosize:t.autosize,placeholder:t.placeholder,disabled:t.disabled||t.talking,class:"wi-web-inputbox__textarea","onUpdate:modelValue":o[1]||(o[1]=w=>m("update:modelValue",w)),onKeydown:e.withKeys(e.withModifiers(E,["exact"]),["enter"])},null,8,["model-value","maxlength","autosize","placeholder","disabled","onKeydown"]),e.createElementVNode("div",fe,[e.createElementVNode("div",he,[e.renderSlot(c.$slots,"footer-left",{},void 0,!0)]),e.createElementVNode("div",ge,[t.showWordLimit?(e.openBlock(),e.createElementBlock("div",ke,[e.createTextVNode(e.toDisplayString((t.modelValue||"").length),1),t.maxlength?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("/"+e.toDisplayString(t.maxlength),1)],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.modelValue&&!t.disabled&&!t.talking?(e.openBlock(),e.createBlock(e.unref(_.ElTooltip),{key:1,content:"清除",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",onClick:r},[...o[8]||(o[8]=[e.createElementVNode("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("path",{d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896z m0 85.333333a362.666667 362.666667 0 1 0 0 725.333334 362.666667 362.666667 0 0 0 0-725.333334z m120.746667 181.333334a42.666667 42.666667 0 0 1 54.826666 4.693333l5.546667 6.357334a42.666667 42.666667 0 0 1-4.693333 54.826666l-6.357334 5.546667-114.730666 114.773333 114.730666 114.730667a42.666667 42.666667 0 0 1 5.461334 54.826666l-5.461334 6.357334a42.666667 42.666667 0 0 1-54.826666 5.461333l-6.357334-5.461333-114.730666-114.730667-114.730667 114.730667a42.666667 42.666667 0 0 1-54.826667 5.461333l-6.357333-5.461333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333 114.730667-114.730667-114.730667-114.773333a42.666667 42.666667 0 0 1-5.461333-54.826667l5.461333-6.357333a42.666667 42.666667 0 0 1 54.826667-5.461334l6.357333 5.461334 114.730667 114.730666 114.730666-114.730666a42.666667 42.666667 0 0 1 24.32-11.434667z"})],-1)])])]),_:1})):e.createCommentVNode("",!0),t.showUpload?(e.openBlock(),e.createBlock(e.unref(_.ElTooltip),{key:2,content:"上传附件",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"wi-web-inputbox__icon-btn",disabled:t.disabled||t.talking,onClick:b},[...o[9]||(o[9]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})],-1)])],8,ye)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:f,type:"file",multiple:"",accept:t.accept,class:"wi-web-inputbox__hidden-file",onChange:B},null,40,Be),o[12]||(o[12]=e.createElementVNode("div",{class:"wi-web-inputbox__divider"},null,-1)),t.talking?(e.openBlock(),e.createBlock(e.unref(_.ElTooltip),{key:3,content:"停止生成",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",onClick:o[2]||(o[2]=w=>m("stop"))},[...o[10]||(o[10]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor"},[e.createElementVNode("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})],-1)])])]),_:1})):(e.openBlock(),e.createBlock(e.unref(_.ElTooltip),{key:4,content:"发送",placement:"top"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send",{"is-disabled":t.disabled||!t.talking&&u.value}]),onClick:U},[...o[11]||(o[11]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor"},[e.createElementVNode("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})],-1)])],2)]),_:1}))])])])]))}}),L=N(Ee,[["__scopeId","data-v-c6f1253a"]]),Ve=[{id:"recordset",answerType:"recordset",component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>je))}],M=t=>g.createAnswerContentMap([...Ve,...t??[]]),Ce={key:0,class:"wi-web-chat-messages__loading"},_e={key:1,class:"wi-web-chat-messages__empty"},xe={class:"wi-web-chat-messages__empty-title"},Ne={class:"wi-web-chat-messages__empty-description"},$e={key:0,class:"wi-web-chat-messages__user"},Ae={class:"wi-web-chat-messages__user-wrapper"},Se={class:"wi-web-chat-messages__user-bubble"},Ue={key:1,class:"wi-web-chat-messages__assistant"},Fe=e.defineComponent({__name:"ChatMessagesView",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"}},emits:["loadOlder","updateThinkingExpanded"],setup(t,{expose:y,emit:n}){const a=t,m=n;g.provideOutputFileConfig(a.outputFileConfig??{getFileUrl:l=>{var k;return((k=a.getFileUrl)==null?void 0:k.call(a,l))??(a.baseURL?`${a.baseURL.replace(/\/$/,"")}/algorithm/get_file_data?file_id=${encodeURIComponent(l)}`:"")}});const v=e.ref(),{showScrollToBottom:f,forceScrollToBottom:p,requestScrollToBottom:d,resetScrollState:i,onReachTop:u}=T.useAutoScroll(v),s=e.computed(()=>M(a.parsers));return e.watch(()=>a.messages.length===0,l=>{l&&i()}),e.watch(()=>a.messages[a.messages.length-1],()=>{d()},{deep:!0}),u(()=>m("loadOlder")),y({forceScrollToBottom:p,requestScrollToBottom:d}),(l,k)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:v,class:"wi-web-chat-messages"},[t.loading?(e.openBlock(),e.createElementBlock("div",Ce,"历史加载中...")):t.messages.length===0?(e.openBlock(),e.createElementBlock("div",_e,[k[1]||(k[1]=e.createElementVNode("div",{class:"wi-web-chat-messages__empty-logo"},"WI",-1)),e.createElementVNode("div",xe,e.toDisplayString(t.emptyTitle),1),e.createElementVNode("div",Ne,e.toDisplayString(t.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messages,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.id},[r.role==="user"?(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("div",Ae,[r.attachments&&r.attachments.length>0?(e.openBlock(),e.createBlock(P,{key:0,class:"wi-web-chat-messages__attachments",items:r.attachments,"base-u-r-l":t.baseURL,"get-file-url":t.getFileUrl},null,8,["items","base-u-r-l","get-file-url"])):e.createCommentVNode("",!0),e.createElementVNode("div",Se,e.toDisplayString(r.content),1)])])):(e.openBlock(),e.createElementBlock("div",Ue,[e.createVNode(e.unref(g.DeepThinkingSteps),{steps:r.thinking.steps,expanded:r.thinking.expanded,"onUpdate:expanded":b=>m("updateThinkingExpanded",r,b)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(g.AiAnswerBubble),{answer:r.answer,error:r.error,stopped:r.stopped,"content-map":s.value},null,8,["answer","error","stopped","content-map"])]))],64))),128)),e.createVNode(e.Transition,{name:"wi-web-chat-messages-fade"},{default:e.withCtx(()=>[e.unref(f)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-chat-messages__bottom",onClick:k[0]||(k[0]=(...r)=>e.unref(p)&&e.unref(p)(...r))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),z=N(Fe,[["__scopeId","data-v-c18f2f94"]]),Pe={class:"wi-web-chat-container"},Ie={class:"wi-web-chat-container__footer"},Te=e.defineComponent({__name:"ChatContainer",props:{messages:{},parsers:{default:()=>[]},baseURL:{default:""},getFileUrl:{type:Function,default:void 0},outputFileConfig:{},loading:{type:Boolean,default:!1},talking:{type:Boolean,default:!1},session:{default:""},question:{default:""},incPrevQuestion:{default:"Y"},agentList:{default:()=>[]},currentAgent:{default:null},placeholder:{default:"请输入问题,按 Enter 发送,Shift+Enter 换行"},hasMore:{type:Boolean,default:!0},emptyTitle:{default:"输入问题,开始与 AI 对话"},emptyDescription:{default:"回答内容由共享渲染层统一分发"},disabled:{type:Boolean,default:!1}},emits:["update:question","update:incPrevQuestion","submit","stop","selectAgent","loadOlder","updateThinkingExpanded"],setup(t,{emit:y}){const n=t,a=y,m=p=>{a("submit",p)},v=()=>{n.hasMore&&a("loadOlder")},f=p=>{a("selectAgent",p)};return(p,d)=>(e.openBlock(),e.createElementBlock("section",Pe,[e.renderSlot(p.$slots,"messages",{},()=>[e.createVNode(z,{messages:t.messages,parsers:t.parsers,"base-u-r-l":t.baseURL,"get-file-url":t.getFileUrl,"output-file-config":t.outputFileConfig,loading:t.loading,"empty-title":t.emptyTitle,"empty-description":t.emptyDescription,onLoadOlder:v,onUpdateThinkingExpanded:d[0]||(d[0]=(i,u)=>a("updateThinkingExpanded",i,u))},null,8,["messages","parsers","base-u-r-l","get-file-url","output-file-config","loading","empty-title","empty-description"])],!0),e.renderSlot(p.$slots,"above-input",{},void 0,!0),e.createElementVNode("footer",Ie,[e.createVNode(L,{"model-value":t.question,"onUpdate:modelValue":d[1]||(d[1]=i=>a("update:question",i)),"inc-prev-question":t.incPrevQuestion,"onUpdate:incPrevQuestion":d[2]||(d[2]=i=>a("update:incPrevQuestion",i)),"base-u-r-l":t.baseURL,disabled:t.disabled||!t.session,talking:t.talking,"agent-list":t.agentList,"current-agent":t.currentAgent,placeholder:t.placeholder,"get-file-url":t.getFileUrl,onSelectAgent:f,onSubmit:m,onStop:d[3]||(d[3]=i=>a("stop"))},null,8,["model-value","inc-prev-question","base-u-r-l","disabled","talking","agent-list","current-agent","placeholder","get-file-url"])])]))}}),Re=N(Te,[["__scopeId","data-v-abbb30d6"]]),Le={key:0,class:"wi-web-recordset"},Me={class:"wi-web-recordset__header"},ze={class:"wi-web-recordset__title"},Oe={class:"wi-web-recordset__columns-panel"},De=e.defineComponent({__name:"RecordsetTable",props:{report:{},maxHeight:{default:420}},setup(t){const y=t,n=e.computed(()=>{var r;return((r=y.report)==null?void 0:r.values)??{}}),a=e.computed(()=>n.value.chart==="table"),m=e.computed(()=>n.value.title??""),v=e.computed(()=>(Array.isArray(n.value.cols)?n.value.cols:[]).map((b,B)=>({key:`c${B}`,title:(b==null?void 0:b.title)||(b==null?void 0:b.name)||`列${B+1}`}))),f=e.computed(()=>{const r=Number(n.value.max_cols);return Number.isFinite(r)&&r>0?r:1/0}),p=e.computed(()=>v.value.length>f.value),d=e.ref([]),i=e.computed(()=>new Set(d.value)),u=e.computed(()=>v.value.filter(r=>i.value.has(r.key)));e.watch(()=>v.value.map(r=>r.key).join("|"),()=>{d.value=v.value.slice(0,f.value).map(r=>r.key)},{immediate:!0});const s=e.computed(()=>(Array.isArray(n.value.values)?n.value.values:[]).map(b=>{const B={};return v.value.forEach((C,$)=>{B[C.key]=Array.isArray(b)?b[$]:void 0}),B})),l=e.ref(!1),k=(r,b)=>{const B=new Set(d.value);b?B.add(r):B.delete(r),d.value=v.value.filter(C=>B.has(C.key)).map(C=>C.key)};return(r,b)=>{const B=e.resolveComponent("el-checkbox"),C=e.resolveComponent("el-popover"),$=e.resolveComponent("el-table-column"),U=e.resolveComponent("el-table");return a.value?(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("div",Me,[e.createElementVNode("div",ze,e.toDisplayString(m.value),1),p.value?(e.openBlock(),e.createBlock(C,{key:0,visible:l.value,"onUpdate:visible":b[0]||(b[0]=E=>l.value=E),placement:"bottom-end",width:220,trigger:"click","popper-class":"wi-web-recordset-columns-popper"},{reference:e.withCtx(()=>[...b[1]||(b[1]=[e.createElementVNode("button",{type:"button",class:"wi-web-recordset__columns-btn",title:"选择展示列"},[e.createElementVNode("svg",{class:"wi-web-recordset__columns-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.createElementVNode("path",{d:"M9 4v16M15 4v16"})]),e.createElementVNode("span",null,"列")],-1)])]),default:e.withCtx(()=>[e.createElementVNode("div",Oe,[b[2]||(b[2]=e.createElementVNode("div",{class:"wi-web-recordset__columns-panel-title"},"选择展示列",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,E=>(e.openBlock(),e.createBlock(B,{key:E.key,class:"wi-web-recordset__column-item","model-value":i.value.has(E.key),"onUpdate:modelValue":c=>k(E.key,!!c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E.title),1)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["visible"])):e.createCommentVNode("",!0)]),e.createVNode(U,{data:s.value,border:"",size:"small",class:"wi-web-recordset__table","max-height":t.maxHeight},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,E=>(e.openBlock(),e.createBlock($,{key:E.key,prop:E.key,label:E.title,"min-width":"120","show-overflow-tooltip":""},null,8,["prop","label"]))),128))]),_:1},8,["data","max-height"])])):e.createCommentVNode("",!0)}}}),O=N(De,[["__scopeId","data-v-96941d57"]]),je=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"})),Qe={class:"wi-web-env-switch__track"},qe={class:"wi-web-env-switch__items"},He=["disabled","onClick"],We={class:"wi-web-env-switch__icon"},Ke={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},Ye={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round"},Xe={class:"wi-web-env-switch__label"},Ze={key:0,class:"wi-web-env-switch__hint"},Ge={class:"wi-web-env-switch__hint-text"},Je={key:0,class:"wi-web-env-switch__hint-status"},et=e.defineComponent({__name:"EnvSwitch",props:{modelValue:{default:"local"},options:{default:()=>[]},disabled:{type:Boolean,default:!1},size:{default:"default"},showHint:{type:Boolean,default:!0}},emits:["update:modelValue","change"],setup(t,{emit:y}){const n=t,a=y,m=[{value:"local",label:"本地电脑",description:"在当前设备上执行,文件与终端直连本机",status:"已就绪",online:!0},{value:"cloud",label:"云电脑",description:"在云端环境中执行,算力与存储由服务端提供",status:"未连接",online:!1}],v={default:3,small:2},f=e.computed(()=>{const u=n.options??[];return u.length>0?u:m}),p=e.computed(()=>{if(!n.showHint)return null;const u=f.value;return u.find(s=>s.value===n.modelValue)??u[0]??null}),d=e.computed(()=>{const u=f.value,s=u.length||1,l=Math.max(u.findIndex(r=>r.value===n.modelValue),0),k=v[n.size]??v.default;return{width:`calc(${100/s}% - ${2*k/s}px)`,transform:`translateX(${l*100}%)`}}),i=u=>{n.disabled||u.disabled||u.value!==n.modelValue&&(a("update:modelValue",u.value),a("change",u))};return(u,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-env-switch",[`is-${t.size}`,{"is-disabled":t.disabled}]])},[e.createElementVNode("div",Qe,[e.createElementVNode("span",{class:"wi-web-env-switch__thumb",style:e.normalizeStyle(d.value)},null,4),e.createElementVNode("div",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,l=>(e.openBlock(),e.createElementBlock("button",{key:l.value,type:"button",class:e.normalizeClass(["wi-web-env-switch__item",{"is-active":l.value===t.modelValue,"is-disabled":l.disabled}]),disabled:t.disabled||l.disabled,onClick:k=>i(l)},[e.createElementVNode("span",We,[l.value==="cloud"?(e.openBlock(),e.createElementBlock("svg",Ke,[...s[0]||(s[0]=[e.createElementVNode("path",{d:"M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Ye,[...s[1]||(s[1]=[e.createElementVNode("rect",{x:"2.5",y:"4",width:"19",height:"12",rx:"2","stroke-linejoin":"round"},null,-1),e.createElementVNode("path",{d:"M8.5 20h7M12 16v4"},null,-1)])]))]),e.createElementVNode("span",Xe,e.toDisplayString(l.label),1)],10,He))),128))])]),p.value?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("span",Ge,e.toDisplayString(p.value.description),1),p.value.status?(e.openBlock(),e.createElementBlock("span",Je,[e.createElementVNode("i",{class:e.normalizeClass(["wi-web-env-switch__dot",{"is-online":p.value.online}])},null,2),e.createTextVNode(" "+e.toDisplayString(p.value.status),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),tt=N(et,[["__scopeId","data-v-94659445"]]);Object.defineProperty(exports,"AiAnswerBubble",{enumerable:!0,get:()=>g.AiAnswerBubble});Object.defineProperty(exports,"ClarificationCard",{enumerable:!0,get:()=>g.ClarificationCard});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>g.DeepThinkingSteps});Object.defineProperty(exports,"HostActionStatus",{enumerable:!0,get:()=>g.HostActionStatus});Object.defineProperty(exports,"IframePage",{enumerable:!0,get:()=>g.IframePage});Object.defineProperty(exports,"KnowledgeStreamResult",{enumerable:!0,get:()=>g.KnowledgeStreamResult});Object.defineProperty(exports,"OutputFile",{enumerable:!0,get:()=>g.OutputFile});Object.defineProperty(exports,"createAnswerContentMap",{enumerable:!0,get:()=>g.createAnswerContentMap});Object.defineProperty(exports,"injectIframeResizerChild",{enumerable:!0,get:()=>g.injectIframeResizerChild});Object.defineProperty(exports,"provideIframePageConfig",{enumerable:!0,get:()=>g.provideIframePageConfig});Object.defineProperty(exports,"provideOutputFileConfig",{enumerable:!0,get:()=>g.provideOutputFileConfig});Object.defineProperty(exports,"resolveIframePlaceholders",{enumerable:!0,get:()=>g.resolveIframePlaceholders});Object.defineProperty(exports,"useIframePage",{enumerable:!0,get:()=>g.useIframePage});exports.AttachmentCard=R;exports.AttachmentList=P;exports.ChatContainer=Re;exports.ChatMessagesView=z;exports.EnvSwitch=tt;exports.Inputbox=L;exports.RecordsetTable=O;exports.createWebAnswerContentMap=M;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|