wi-chat 0.4.0 → 0.5.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.js +129 -123
- package/dist/core/useChat.d.ts +11 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +102 -74
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +3 -3
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.d.ts +1 -1
- package/dist/mobile-ui/index.js +26 -25
- package/dist/mobile-ui/inputbox/Inputbox.vue.d.ts +1 -1
- package/dist/page-context/extArgs.d.ts +46 -0
- package/dist/page-context/index.cjs +2 -0
- package/dist/page-context/index.d.ts +18 -0
- package/dist/page-context/index.js +48 -0
- package/dist/page-context/state.d.ts +10 -0
- package/dist/page-context/types.d.ts +218 -0
- package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +38 -0
- package/dist/parser/answerCom/actionExecute/clarification.d.ts +67 -0
- package/dist/parser/answerCom/actionExecute/parseActionExecute.d.ts +28 -0
- package/dist/parser/answerCom/actionExecute/types.d.ts +153 -0
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.d.ts +9 -0
- package/dist/parser/index.js +537 -251
- package/dist/parser/registry.d.ts +8 -1
- package/dist/parser/title.d.ts +27 -0
- package/dist/renderers/clarification/ClarificationCard.vue.d.ts +19 -0
- package/dist/renderers/index.cjs +1 -1
- package/dist/renderers/index.d.ts +1 -0
- package/dist/renderers/index.js +641 -354
- package/dist/renderers/style.css +1 -1
- package/dist/right-panel/RightPanel.vue.d.ts +43 -0
- package/dist/right-panel/RightPanelIcon.vue.d.ts +38 -0
- package/dist/right-panel/RightPanelTabs.vue.d.ts +39 -0
- package/dist/right-panel/icons.d.ts +48 -0
- package/dist/right-panel/index.cjs +2 -0
- package/dist/right-panel/index.d.ts +43 -0
- package/dist/right-panel/index.js +1004 -0
- package/dist/right-panel/panels/index.d.ts +7 -0
- package/dist/right-panel/panels/newtab/NewTabPanel.vue.d.ts +27 -0
- package/dist/right-panel/panels/newtab/defaults.d.ts +6 -0
- package/dist/right-panel/panels/newtab/index.d.ts +4 -0
- package/dist/right-panel/panels/web/WebPanel.vue.d.ts +28 -0
- package/dist/right-panel/panels/web/index.d.ts +4 -0
- package/dist/right-panel/panels/web/useWebview.d.ts +59 -0
- package/dist/right-panel/registry.d.ts +24 -0
- package/dist/right-panel/runtime.d.ts +45 -0
- package/dist/right-panel/scope.d.ts +34 -0
- package/dist/right-panel/shared/BrowserToolbar.vue.d.ts +23 -0
- package/dist/right-panel/shared/RightPanelToolList.vue.d.ts +48 -0
- package/dist/right-panel/style.css +1 -0
- package/dist/right-panel/types.d.ts +363 -0
- package/dist/right-panel/useRightPanel.d.ts +39 -0
- package/dist/right-panel/useRightPanelTabs.d.ts +14 -0
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +182 -162
- package/dist/tools/markdown/index.d.ts +1 -1
- package/dist/tools/markdown/renderMarkdown.d.ts +25 -0
- package/dist/web-ui/attach/AttachmentList.vue.d.ts +1 -1
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +3 -3
- package/dist/web-ui/envswitch/EnvSwitch.vue.d.ts +2 -2
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.d.ts +1 -1
- package/dist/web-ui/index.js +301 -295
- package/dist/web-ui/inputbox/Inputbox.vue.d.ts +4 -7
- package/dist/web-ui/style.css +1 -1
- package/package.json +13 -6
package/dist/web-ui/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("wi-chat/renderers"),e=require("vue"),N=require("element-plus"),F=require("wi-chat/parser"),L=require("wi-chat/tools"),I=r=>(e.pushScopeId("data-v-dc2d5f2b"),r=r(),e.popScopeId(),r),W={class:"wi-web-attach-card__icon"},H=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(r,{emit:g}){const n=r,a=g,u=e.computed(()=>{var o;return((o=n.item)==null?void 0:o.attachContent)||{}}),_=e.computed(()=>F.isImageAttachment(n.item)),v=e.computed(()=>F.resolveAttachPreviewUrl(n.item,n.baseURL,n.getFileUrl)),l=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 o=u.value;return!!(o.fileId||o.raw)}),i=()=>{a("click",n.item)},s=()=>{a("remove",n.item)},c=async()=>{a("download",n.item),await L.downloadAttachment(n.item,{baseURL:n.baseURL,getFileUrl:n.getFileUrl})};return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-attach-card",{"is-clickable":o.clickable||!!o.$attrs.onClick}]),onClick:i},[e.createElementVNode("div",W,[e.renderSlot(o.$slots,"icon",{item:o.item},()=>[_.value&&v.value?(e.openBlock(),e.createBlock(e.unref(N.ElImage),{key:0,src:v.value,"preview-src-list":[v.value],"zoom-rate":1.2,"preview-teleported":"",fit:"cover",class:"wi-web-attach-card__image",onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},{placeholder:e.withCtx(()=>[H]),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(c,["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(s,["stop"])}," × ")):e.createCommentVNode("",!0)],!0)])],2))}}),S=(r,g)=>{const n=r.__vccOpts||r;for(const[a,u]of g)n[a]=u;return n},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(r,{emit:g}){const n=r,a=g,u=e.computed(()=>(n.items||[]).map((s,c)=>{var p,b;const o=F.normalizeAttachment(s),d=(p=o.attachContent)==null?void 0:p.raw,w=((b=o.attachContent)==null?void 0:b.fileId)||(d?`${d.name}_${d.size}_${c}`:`${o.name}_${c}`);return{...o,key:w}})),_=(i,s)=>{a("remove",i,s)},v=(i,s)=>{a("click",i,s)},l=(i,s)=>{a("download",i,s)};return(i,s)=>u.value.length>0?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(c,o)=>(e.openBlock(),e.createBlock(M,{key:c.key||o,item:c,removable:i.removable,downloadable:i.downloadable,clickable:i.clickable||!!i.$attrs.onClick,"base-u-r-l":i.baseURL,"get-file-url":i.getFileUrl,onClick:d=>v(c,o),onRemove:d=>_(o,c),onDownload:d=>l(c,o)},{icon:e.withCtx(d=>[e.renderSlot(i.$slots,"icon",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),title:e.withCtx(d=>[e.renderSlot(i.$slots,"title",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),description:e.withCtx(d=>[e.renderSlot(i.$slots,"description",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),actions:e.withCtx(d=>[e.renderSlot(i.$slots,"actions",e.normalizeProps(e.guardReactiveProps(d)),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=r=>(e.pushScopeId("data-v-e3cdddb7"),r=r(),e.popScopeId(),r),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)),We=[qe],He=["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:{default:1024},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(r,{expose:g,emit:n}){const a=r,u=n,_=e.ref(null),v=e.ref(null),l=e.ref(!1),i=t=>F.parseRealtimeAttachment(t),s=e.ref([]),c=e.computed(()=>!!!(a.modelValue&&a.modelValue.trim())),o=t=>t?a.getFileUrl?a.getFileUrl(t):F.resolveRemoteFileUrl(t,a.baseURL,"/algorithm/get_file_data"):"",d=t=>{u("selectAgent",t),l.value=!1},w=t=>{u("update:incPrevQuestion",t?"N":"Y")},p=()=>{u("update:modelValue","")},b=()=>{v.value&&(v.value.value="",v.value.click())},y=t=>{const h=t.target;if(h.files&&h.files.length>0){const m=Array.from(h.files);for(const f of m)s.value.some(U=>{var z;const R=((z=U.attachContent)==null?void 0:z.raw)||U.raw;return R&&R.name===f.name&&R.size===f.size&&R.lastModified===f.lastModified})||s.value.push(i(f));const E=s.value.map(f=>{var $;return(($=f.attachContent)==null?void 0:$.raw)||f.raw}).filter(Boolean);u("update:files",E),u("update:attachments",[...s.value])}},C=t=>{var f;const h=s.value.splice(t,1)[0],m=((f=h==null?void 0:h.attachContent)==null?void 0:f.url)||(h==null?void 0:h.url);m&&m.startsWith("blob:")&&URL.revokeObjectURL(m);const E=s.value.map($=>{var U;return((U=$.attachContent)==null?void 0:U.raw)||$.raw}).filter(Boolean);u("update:files",E),u("update:attachments",[...s.value])},A=()=>{s.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)}),s.value=[],u("update:files",[]),u("update:attachments",[])},P=()=>{if(a.disabled||c.value)return;const t=a.modelValue||"",h=s.value.map(E=>{var f;return((f=E.attachContent)==null?void 0:f.raw)||E.raw}).filter(Boolean),m=[...s.value];u("submit",{text:t,files:h,attachments:m,agent:a.currentAgent}),s.value=[],u("update:files",[]),u("update:attachments",[])},B=t=>{t.isComposing||t.keyCode===229||(t.preventDefault(),P())};return e.onBeforeUnmount(()=>{A()}),g({clearFiles:A,getFiles:()=>s.value.map(t=>{var h;return((h=t.attachContent)==null?void 0:h.raw)||t.raw}).filter(Boolean),getAttachments:()=>s.value,focus:()=>{var t;(t=_.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,f;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)||((f=t.currentAgent)==null?void 0:f.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,f;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:$=>d(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===((f=t.currentAgent)==null?void 0:f.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":w},{default:e.withCtx(()=>[e.createTextVNode(" 忽略之前对话 ")]),_:1},8,["model-value"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(T,{items:s.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:_,"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=>u("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.toDisplayString((t.modelValue||"").length)+"/"+e.toDisplayString(t.maxlength),1)):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:p},We)]),_: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:b},Ye,8,He)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:v,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=>u("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&&c.value}]),onClick:P},tt,2)]),_:1}))])])])]))}}),O=S(ot,[["__scopeId","data-v-e3cdddb7"]]),lt=[{id:"recordset",answerType:"recordset",component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ct))}],D=r=>k.createAnswerContentMap([...lt,...r??[]]),nt=r=>(e.pushScopeId("data-v-bcad9562"),r=r(),e.popScopeId(),r),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(r,{expose:g,emit:n}){const a=r,u=n;k.provideOutputFileConfig(a.outputFileConfig??{getFileUrl:o=>{var d;return((d=a.getFileUrl)==null?void 0:d.call(a,o))??(a.baseURL?`${a.baseURL.replace(/\/$/,"")}/algorithm/get_file_data?file_id=${encodeURIComponent(o)}`:"")}});const _=e.ref(),{showScrollToBottom:v,forceScrollToBottom:l,requestScrollToBottom:i,onReachTop:s}=L.useAutoScroll(_),c=e.computed(()=>D(a.parsers));return e.watch(()=>a.messages[a.messages.length-1],()=>{i()},{deep:!0}),s(()=>u("loadOlder")),g({forceScrollToBottom:l,requestScrollToBottom:i}),(o,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:_,class:"wi-web-chat-messages"},[o.loading?(e.openBlock(),e.createElementBlock("div",at,"历史加载中...")):o.messages.length===0?(e.openBlock(),e.createElementBlock("div",st,[it,e.createElementVNode("div",rt,e.toDisplayString(o.emptyTitle),1),e.createElementVNode("div",ct,e.toDisplayString(o.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.messages,w=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w.id},[w.role==="user"?(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",ut,[w.attachments&&w.attachments.length>0?(e.openBlock(),e.createBlock(T,{key:0,class:"wi-web-chat-messages__attachments",items:w.attachments,"base-u-r-l":o.baseURL,"get-file-url":o.getFileUrl},null,8,["items","base-u-r-l","get-file-url"])):e.createCommentVNode("",!0),e.createElementVNode("div",pt,e.toDisplayString(w.content),1)])])):(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(k.DeepThinkingSteps),{steps:w.thinking.steps,expanded:w.thinking.expanded,"onUpdate:expanded":p=>u("updateThinkingExpanded",w,p)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(k.AiAnswerBubble),{answer:w.answer,error:w.error,stopped:w.stopped,"content-map":c.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(v)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-chat-messages__bottom",onClick:d[0]||(d[0]=(...w)=>e.unref(l)&&e.unref(l)(...w))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),j=S(ht,[["__scopeId","data-v-bcad9562"]]),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(r,{emit:g}){const n=r,a=g,u=l=>{a("submit",l)},_=()=>{n.hasMore&&a("loadOlder")},v=l=>{a("selectAgent",l)};return(l,i)=>(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:_,onUpdateThinkingExpanded:i[0]||(i[0]=(s,c)=>a("updateThinkingExpanded",s,c))},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":i[1]||(i[1]=s=>a("update:question",s)),"inc-prev-question":l.incPrevQuestion,"onUpdate:incPrevQuestion":i[2]||(i[2]=s=>a("update:incPrevQuestion",s)),"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:v,onSubmit:u,onStop:i[3]||(i[3]=s=>a("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=r=>(e.pushScopeId("data-v-96941d57"),r=r(),e.popScopeId(),r),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(r){const g=r,n=e.computed(()=>{var p;return((p=g.report)==null?void 0:p.values)??{}}),a=e.computed(()=>n.value.chart==="table"),u=e.computed(()=>n.value.title??""),_=e.computed(()=>(Array.isArray(n.value.cols)?n.value.cols:[]).map((b,y)=>({key:`c${y}`,title:(b==null?void 0:b.title)||(b==null?void 0:b.name)||`列${y+1}`}))),v=e.computed(()=>{const p=Number(n.value.max_cols);return Number.isFinite(p)&&p>0?p:1/0}),l=e.computed(()=>_.value.length>v.value),i=e.ref([]),s=e.computed(()=>new Set(i.value)),c=e.computed(()=>_.value.filter(p=>s.value.has(p.key)));e.watch(()=>_.value.map(p=>p.key).join("|"),()=>{i.value=_.value.slice(0,v.value).map(p=>p.key)},{immediate:!0});const o=e.computed(()=>(Array.isArray(n.value.values)?n.value.values:[]).map(b=>{const y={};return _.value.forEach((C,A)=>{y[C.key]=Array.isArray(b)?b[A]:void 0}),y})),d=e.ref(!1),w=(p,b)=>{const y=new Set(i.value);b?y.add(p):y.delete(p),i.value=_.value.filter(C=>y.has(C.key)).map(C=>C.key)};return(p,b)=>{const y=e.resolveComponent("el-checkbox"),C=e.resolveComponent("el-popover"),A=e.resolveComponent("el-table-column"),P=e.resolveComponent("el-table");return a.value?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,e.toDisplayString(u.value),1),l.value?(e.openBlock(),e.createBlock(C,{key:0,visible:d.value,"onUpdate:visible":b[0]||(b[0]=B=>d.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(_.value,B=>(e.openBlock(),e.createBlock(y,{key:B.key,class:"wi-web-recordset__column-item","model-value":s.value.has(B.key),"onUpdate:modelValue":t=>w(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":p.maxHeight},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.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=r=>(e.pushScopeId("data-v-94659445"),r=r(),e.popScopeId(),r),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(r,{emit:g}){const n=r,a=g,u=[{value:"local",label:"本地电脑",description:"在当前设备上执行,文件与终端直连本机",status:"已就绪",online:!0},{value:"cloud",label:"云电脑",description:"在云端环境中执行,算力与存储由服务端提供",status:"未连接",online:!1}],_={default:3,small:2},v=e.computed(()=>{const c=n.options??[];return c.length>0?c:u}),l=e.computed(()=>{if(!n.showHint)return null;const c=v.value;return c.find(o=>o.value===n.modelValue)??c[0]??null}),i=e.computed(()=>{const c=v.value,o=c.length||1,d=Math.max(c.findIndex(p=>p.value===n.modelValue),0),w=_[n.size]??_.default;return{width:`calc(${100/o}% - ${2*w/o}px)`,transform:`translateX(${d*100}%)`}}),s=c=>{n.disabled||c.disabled||c.value!==n.modelValue&&(a("update:modelValue",c.value),a("change",c))};return(c,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-env-switch",[`is-${c.size}`,{"is-disabled":c.disabled}]])},[e.createElementVNode("div",Nt,[e.createElementVNode("span",{class:"wi-web-env-switch__thumb",style:e.normalizeStyle(i.value)},null,4),e.createElementVNode("div",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,d=>(e.openBlock(),e.createElementBlock("button",{key:d.value,type:"button",class:e.normalizeClass(["wi-web-env-switch__item",{"is-active":d.value===c.modelValue,"is-disabled":d.disabled}]),disabled:c.disabled||d.disabled,onClick:w=>s(d)},[e.createElementVNode("span",At,[d.value==="cloud"?(e.openBlock(),e.createElementBlock("svg",It,Ft)):(e.openBlock(),e.createElementBlock("svg",Pt,xt))]),e.createElementVNode("span",zt,e.toDisplayString(d.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:()=>k.AiAnswerBubble});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>k.DeepThinkingSteps});Object.defineProperty(exports,"IframePage",{enumerable:!0,get:()=>k.IframePage});Object.defineProperty(exports,"KnowledgeStreamResult",{enumerable:!0,get:()=>k.KnowledgeStreamResult});Object.defineProperty(exports,"OutputFile",{enumerable:!0,get:()=>k.OutputFile});Object.defineProperty(exports,"createAnswerContentMap",{enumerable:!0,get:()=>k.createAnswerContentMap});Object.defineProperty(exports,"injectIframeResizerChild",{enumerable:!0,get:()=>k.injectIframeResizerChild});Object.defineProperty(exports,"provideIframePageConfig",{enumerable:!0,get:()=>k.provideIframePageConfig});Object.defineProperty(exports,"provideOutputFileConfig",{enumerable:!0,get:()=>k.provideOutputFileConfig});Object.defineProperty(exports,"resolveIframePlaceholders",{enumerable:!0,get:()=>k.resolveIframePlaceholders});Object.defineProperty(exports,"useIframePage",{enumerable:!0,get:()=>k.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"),N=require("element-plus"),F=require("wi-chat/parser"),L=require("wi-chat/tools"),I=r=>(e.pushScopeId("data-v-dc2d5f2b"),r=r(),e.popScopeId(),r),W={class:"wi-web-attach-card__icon"},H=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(r,{emit:k}){const n=r,a=k,u=e.computed(()=>{var o;return((o=n.item)==null?void 0:o.attachContent)||{}}),_=e.computed(()=>F.isImageAttachment(n.item)),v=e.computed(()=>F.resolveAttachPreviewUrl(n.item,n.baseURL,n.getFileUrl)),l=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 o=u.value;return!!(o.fileId||o.raw)}),i=()=>{a("click",n.item)},s=()=>{a("remove",n.item)},c=async()=>{a("download",n.item),await L.downloadAttachment(n.item,{baseURL:n.baseURL,getFileUrl:n.getFileUrl})};return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-attach-card",{"is-clickable":o.clickable||!!o.$attrs.onClick}]),onClick:i},[e.createElementVNode("div",W,[e.renderSlot(o.$slots,"icon",{item:o.item},()=>[_.value&&v.value?(e.openBlock(),e.createBlock(e.unref(N.ElImage),{key:0,src:v.value,"preview-src-list":[v.value],"zoom-rate":1.2,"preview-teleported":"",fit:"cover",class:"wi-web-attach-card__image",onClick:d[0]||(d[0]=e.withModifiers(()=>{},["stop"]))},{placeholder:e.withCtx(()=>[H]),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(c,["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(s,["stop"])}," × ")):e.createCommentVNode("",!0)],!0)])],2))}}),S=(r,k)=>{const n=r.__vccOpts||r;for(const[a,u]of k)n[a]=u;return n},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(r,{emit:k}){const n=r,a=k,u=e.computed(()=>(n.items||[]).map((s,c)=>{var p,b;const o=F.normalizeAttachment(s),d=(p=o.attachContent)==null?void 0:p.raw,w=((b=o.attachContent)==null?void 0:b.fileId)||(d?`${d.name}_${d.size}_${c}`:`${o.name}_${c}`);return{...o,key:w}})),_=(i,s)=>{a("remove",i,s)},v=(i,s)=>{a("click",i,s)},l=(i,s)=>{a("download",i,s)};return(i,s)=>u.value.length>0?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(c,o)=>(e.openBlock(),e.createBlock(M,{key:c.key||o,item:c,removable:i.removable,downloadable:i.downloadable,clickable:i.clickable||!!i.$attrs.onClick,"base-u-r-l":i.baseURL,"get-file-url":i.getFileUrl,onClick:d=>v(c,o),onRemove:d=>_(o,c),onDownload:d=>l(c,o)},{icon:e.withCtx(d=>[e.renderSlot(i.$slots,"icon",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),title:e.withCtx(d=>[e.renderSlot(i.$slots,"title",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),description:e.withCtx(d=>[e.renderSlot(i.$slots,"description",e.normalizeProps(e.guardReactiveProps(d)),void 0,!0)]),actions:e.withCtx(d=>[e.renderSlot(i.$slots,"actions",e.normalizeProps(e.guardReactiveProps(d)),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=r=>(e.pushScopeId("data-v-c6f1253a"),r=r(),e.popScopeId(),r),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)),We=[qe],He=["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(r,{expose:k,emit:n}){const a=r,u=n,_=e.ref(null),v=e.ref(null),l=e.ref(!1),i=t=>F.parseRealtimeAttachment(t),s=e.ref([]),c=e.computed(()=>!!!(a.modelValue&&a.modelValue.trim())),o=t=>t?a.getFileUrl?a.getFileUrl(t):F.resolveRemoteFileUrl(t,a.baseURL,"/algorithm/get_file_data"):"",d=t=>{u("selectAgent",t),l.value=!1},w=t=>{u("update:incPrevQuestion",t?"N":"Y")},p=()=>{u("update:modelValue","")},b=()=>{v.value&&(v.value.value="",v.value.click())},y=t=>{const h=t.target;if(h.files&&h.files.length>0){const m=Array.from(h.files);for(const f of m)s.value.some(U=>{var z;const R=((z=U.attachContent)==null?void 0:z.raw)||U.raw;return R&&R.name===f.name&&R.size===f.size&&R.lastModified===f.lastModified})||s.value.push(i(f));const E=s.value.map(f=>{var $;return(($=f.attachContent)==null?void 0:$.raw)||f.raw}).filter(Boolean);u("update:files",E),u("update:attachments",[...s.value])}},C=t=>{var f;const h=s.value.splice(t,1)[0],m=((f=h==null?void 0:h.attachContent)==null?void 0:f.url)||(h==null?void 0:h.url);m&&m.startsWith("blob:")&&URL.revokeObjectURL(m);const E=s.value.map($=>{var U;return((U=$.attachContent)==null?void 0:U.raw)||$.raw}).filter(Boolean);u("update:files",E),u("update:attachments",[...s.value])},A=()=>{s.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)}),s.value=[],u("update:files",[]),u("update:attachments",[])},P=()=>{if(a.disabled||c.value)return;const t=a.modelValue||"",h=s.value.map(E=>{var f;return((f=E.attachContent)==null?void 0:f.raw)||E.raw}).filter(Boolean),m=[...s.value];u("submit",{text:t,files:h,attachments:m,agent:a.currentAgent}),s.value=[],u("update:files",[]),u("update:attachments",[])},B=t=>{t.isComposing||t.keyCode===229||(t.preventDefault(),P())};return e.onBeforeUnmount(()=>{A()}),k({clearFiles:A,getFiles:()=>s.value.map(t=>{var h;return((h=t.attachContent)==null?void 0:h.raw)||t.raw}).filter(Boolean),getAttachments:()=>s.value,focus:()=>{var t;(t=_.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,f;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)||((f=t.currentAgent)==null?void 0:f.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,f;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:$=>d(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===((f=t.currentAgent)==null?void 0:f.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":w},{default:e.withCtx(()=>[e.createTextVNode(" 忽略之前对话 ")]),_:1},8,["model-value"])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Le,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(T,{items:s.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:_,"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=>u("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:p},We)]),_: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:b},Ye,8,He)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:v,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=>u("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&&c.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=r=>g.createAnswerContentMap([...lt,...r??[]]),nt=r=>(e.pushScopeId("data-v-bcad9562"),r=r(),e.popScopeId(),r),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(r,{expose:k,emit:n}){const a=r,u=n;g.provideOutputFileConfig(a.outputFileConfig??{getFileUrl:o=>{var d;return((d=a.getFileUrl)==null?void 0:d.call(a,o))??(a.baseURL?`${a.baseURL.replace(/\/$/,"")}/algorithm/get_file_data?file_id=${encodeURIComponent(o)}`:"")}});const _=e.ref(),{showScrollToBottom:v,forceScrollToBottom:l,requestScrollToBottom:i,onReachTop:s}=L.useAutoScroll(_),c=e.computed(()=>D(a.parsers));return e.watch(()=>a.messages[a.messages.length-1],()=>{i()},{deep:!0}),s(()=>u("loadOlder")),k({forceScrollToBottom:l,requestScrollToBottom:i}),(o,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"scrollEl",ref:_,class:"wi-web-chat-messages"},[o.loading?(e.openBlock(),e.createElementBlock("div",at,"历史加载中...")):o.messages.length===0?(e.openBlock(),e.createElementBlock("div",st,[it,e.createElementVNode("div",rt,e.toDisplayString(o.emptyTitle),1),e.createElementVNode("div",ct,e.toDisplayString(o.emptyDescription),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.messages,w=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w.id},[w.role==="user"?(e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",ut,[w.attachments&&w.attachments.length>0?(e.openBlock(),e.createBlock(T,{key:0,class:"wi-web-chat-messages__attachments",items:w.attachments,"base-u-r-l":o.baseURL,"get-file-url":o.getFileUrl},null,8,["items","base-u-r-l","get-file-url"])):e.createCommentVNode("",!0),e.createElementVNode("div",pt,e.toDisplayString(w.content),1)])])):(e.openBlock(),e.createElementBlock("div",mt,[e.createVNode(e.unref(g.DeepThinkingSteps),{steps:w.thinking.steps,expanded:w.thinking.expanded,"onUpdate:expanded":p=>u("updateThinkingExpanded",w,p)},null,8,["steps","expanded","onUpdate:expanded"]),e.createVNode(e.unref(g.AiAnswerBubble),{answer:w.answer,error:w.error,stopped:w.stopped,"content-map":c.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(v)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-web-chat-messages__bottom",onClick:d[0]||(d[0]=(...w)=>e.unref(l)&&e.unref(l)(...w))}," 回到底部 ")):e.createCommentVNode("",!0)]),_:1})],512))}}),j=S(ht,[["__scopeId","data-v-bcad9562"]]),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(r,{emit:k}){const n=r,a=k,u=l=>{a("submit",l)},_=()=>{n.hasMore&&a("loadOlder")},v=l=>{a("selectAgent",l)};return(l,i)=>(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:_,onUpdateThinkingExpanded:i[0]||(i[0]=(s,c)=>a("updateThinkingExpanded",s,c))},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":i[1]||(i[1]=s=>a("update:question",s)),"inc-prev-question":l.incPrevQuestion,"onUpdate:incPrevQuestion":i[2]||(i[2]=s=>a("update:incPrevQuestion",s)),"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:v,onSubmit:u,onStop:i[3]||(i[3]=s=>a("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=r=>(e.pushScopeId("data-v-96941d57"),r=r(),e.popScopeId(),r),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(r){const k=r,n=e.computed(()=>{var p;return((p=k.report)==null?void 0:p.values)??{}}),a=e.computed(()=>n.value.chart==="table"),u=e.computed(()=>n.value.title??""),_=e.computed(()=>(Array.isArray(n.value.cols)?n.value.cols:[]).map((b,y)=>({key:`c${y}`,title:(b==null?void 0:b.title)||(b==null?void 0:b.name)||`列${y+1}`}))),v=e.computed(()=>{const p=Number(n.value.max_cols);return Number.isFinite(p)&&p>0?p:1/0}),l=e.computed(()=>_.value.length>v.value),i=e.ref([]),s=e.computed(()=>new Set(i.value)),c=e.computed(()=>_.value.filter(p=>s.value.has(p.key)));e.watch(()=>_.value.map(p=>p.key).join("|"),()=>{i.value=_.value.slice(0,v.value).map(p=>p.key)},{immediate:!0});const o=e.computed(()=>(Array.isArray(n.value.values)?n.value.values:[]).map(b=>{const y={};return _.value.forEach((C,A)=>{y[C.key]=Array.isArray(b)?b[A]:void 0}),y})),d=e.ref(!1),w=(p,b)=>{const y=new Set(i.value);b?y.add(p):y.delete(p),i.value=_.value.filter(C=>y.has(C.key)).map(C=>C.key)};return(p,b)=>{const y=e.resolveComponent("el-checkbox"),C=e.resolveComponent("el-popover"),A=e.resolveComponent("el-table-column"),P=e.resolveComponent("el-table");return a.value?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,e.toDisplayString(u.value),1),l.value?(e.openBlock(),e.createBlock(C,{key:0,visible:d.value,"onUpdate:visible":b[0]||(b[0]=B=>d.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(_.value,B=>(e.openBlock(),e.createBlock(y,{key:B.key,class:"wi-web-recordset__column-item","model-value":s.value.has(B.key),"onUpdate:modelValue":t=>w(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":p.maxHeight},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.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=r=>(e.pushScopeId("data-v-94659445"),r=r(),e.popScopeId(),r),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(r,{emit:k}){const n=r,a=k,u=[{value:"local",label:"本地电脑",description:"在当前设备上执行,文件与终端直连本机",status:"已就绪",online:!0},{value:"cloud",label:"云电脑",description:"在云端环境中执行,算力与存储由服务端提供",status:"未连接",online:!1}],_={default:3,small:2},v=e.computed(()=>{const c=n.options??[];return c.length>0?c:u}),l=e.computed(()=>{if(!n.showHint)return null;const c=v.value;return c.find(o=>o.value===n.modelValue)??c[0]??null}),i=e.computed(()=>{const c=v.value,o=c.length||1,d=Math.max(c.findIndex(p=>p.value===n.modelValue),0),w=_[n.size]??_.default;return{width:`calc(${100/o}% - ${2*w/o}px)`,transform:`translateX(${d*100}%)`}}),s=c=>{n.disabled||c.disabled||c.value!==n.modelValue&&(a("update:modelValue",c.value),a("change",c))};return(c,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wi-web-env-switch",[`is-${c.size}`,{"is-disabled":c.disabled}]])},[e.createElementVNode("div",Nt,[e.createElementVNode("span",{class:"wi-web-env-switch__thumb",style:e.normalizeStyle(i.value)},null,4),e.createElementVNode("div",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,d=>(e.openBlock(),e.createElementBlock("button",{key:d.value,type:"button",class:e.normalizeClass(["wi-web-env-switch__item",{"is-active":d.value===c.modelValue,"is-disabled":d.disabled}]),disabled:c.disabled||d.disabled,onClick:w=>s(d)},[e.createElementVNode("span",At,[d.value==="cloud"?(e.openBlock(),e.createElementBlock("svg",It,Ft)):(e.openBlock(),e.createElementBlock("svg",Pt,xt))]),e.createElementVNode("span",zt,e.toDisplayString(d.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:()=>g.AiAnswerBubble});Object.defineProperty(exports,"ClarificationCard",{enumerable:!0,get:()=>g.ClarificationCard});Object.defineProperty(exports,"DeepThinkingSteps",{enumerable:!0,get:()=>g.DeepThinkingSteps});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=M;exports.AttachmentList=T;exports.ChatContainer=bt;exports.ChatMessagesView=j;exports.EnvSwitch=jt;exports.Inputbox=O;exports.RecordsetTable=q;exports.createWebAnswerContentMap=D;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/web-ui/index.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export { default as RecordsetTable } from './recordset/RecordsetTable.vue';
|
|
|
10
10
|
export { createWebAnswerContentMap } from './recordset/webAnswerContentMap';
|
|
11
11
|
export { default as EnvSwitch } from './envswitch/EnvSwitch.vue';
|
|
12
12
|
export type { ChatEnvType, ChatEnvOption } from './envswitch/types';
|
|
13
|
-
export { AiAnswerBubble, createAnswerContentMap, DeepThinkingSteps, IframePage, injectIframeResizerChild, KnowledgeStreamResult, OutputFile, provideIframePageConfig, provideOutputFileConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
|
|
13
|
+
export { AiAnswerBubble, ClarificationCard, createAnswerContentMap, DeepThinkingSteps, IframePage, injectIframeResizerChild, KnowledgeStreamResult, OutputFile, provideIframePageConfig, provideOutputFileConfig, resolveIframePlaceholders, useIframePage, } from 'wi-chat/renderers';
|
|
14
14
|
export type { AnswerContentMap, IframePageConfig, OutputFileConfig, OutputFilePreviewKind, OutputFilePreviewRequest, UseIframePageReturn, } from 'wi-chat/renderers';
|