wi-chat 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("wi-chat/style.css");const e=require("vue"),N=require("wi-chat/parser"),T=require("wi-chat/tools"),K=require("@iframe-resizer/vue/iframe-resizer.vue"),ie=[{...N.knowledgeStreamParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Te))},{...N.iframePageParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>xt))},{...N.outputFileParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Vt))},{...N.collectClarificationsParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>yn))},{...N.agentActionParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>$n))}],X=o=>{const a=s=>{const t={};for(const r of s)!r.answerType||!r.component||(t[r.answerType]=r.component);return t};return{...a(ie),...a(o??[])}},ue=o=>(e.pushScopeId("data-v-efad55c8"),o=o(),e.popScopeId(),o),de={class:"flex justify-start"},pe={class:"ai-answer-bubble"},_e={key:0,class:"ai-answer-bubble__error"},fe={class:"ai-answer-bubble__body"},me={key:0,class:"ai-answer-bubble__status"},ve={key:2,class:"ai-answer-bubble__status"},we={key:3,class:"ai-answer-bubble__loading"},ye=ue(()=>e.createElementVNode("span",{class:"ai-answer-bubble__pulse"},null,-1)),ke=e.defineComponent({__name:"AiAnswerBubble",props:{answer:{},error:{type:Boolean,default:!1},stopped:{type:Boolean,default:!1},contentMap:{default:()=>X()}},setup(o){const a=o,s=e.computed(()=>{var r,c;return((c=(r=a.answer)==null?void 0:r.answer)==null?void 0:c.reports)??[]}),t=e.computed(()=>s.value.filter(r=>a.contentMap[r.answer_type]));return(r,c)=>(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",pe,[r.error?(e.openBlock(),e.createElementBlock("div",_e,"回答加载失败")):t.value.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(p,h)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.contentMap[p.answer_type]),{key:h,report:p},null,8,["report"]))),128))]),r.stopped?(e.openBlock(),e.createElementBlock("div",me,"回答已停止")):e.createCommentVNode("",!0)],64)):r.stopped?(e.openBlock(),e.createElementBlock("div",ve,"回答已停止")):s.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",we,[ye,e.createTextVNode("正在思考...")]))])]))}}),$=(o,a)=>{const s=o.__vccOpts||o;for(const[t,r]of a)s[t]=r;return s},he=$(ke,[["__scopeId","data-v-efad55c8"]]),ge=o=>(e.pushScopeId("data-v-de333356"),o=o(),e.popScopeId(),o),Ee=["data-wi-md-scope"],be=["aria-expanded"],Ve=ge(()=>e.createElementVNode("span",{class:"deep-thinking__title"},"深度思考",-1)),Se={class:"deep-thinking__count"},Be={class:"deep-thinking__list"},Ne={class:"deep-thinking__index"},Ce=["innerHTML"],$e=e.defineComponent({__name:"DeepThinkingSteps",props:{steps:{},expanded:{type:Boolean}},emits:["update:expanded"],setup(o,{emit:a}){const s=o,t=a,r={imageDownload:!1,tableDownload:!1},c=T.createStyleScope(),p={...r,styleScope:c.selector},h=new Map,v=u=>{let f=h.get(u);return f===void 0&&(h.size>500&&h.clear(),f=T.renderMarkdown(u,p),h.set(u,f)),f},w=e.computed(()=>s.steps.map(v));return(u,f)=>w.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"deep-thinking","data-wi-md-scope":e.unref(c).id},[e.createElementVNode("button",{type:"button",class:"deep-thinking__header","aria-expanded":u.expanded,onClick:f[0]||(f[0]=y=>t("update:expanded",!u.expanded))},[Ve,e.createElementVNode("span",Se,e.toDisplayString(w.value.length),1),e.createElementVNode("span",null,e.toDisplayString(u.expanded?"收起":"展开"),1)],8,be),e.withDirectives(e.createElementVNode("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(y,V)=>(e.openBlock(),e.createElementBlock("div",{key:V,class:"deep-thinking__item"},[e.createElementVNode("span",Ne,e.toDisplayString(V+1),1),e.createElementVNode("div",{class:"markdown-it",innerHTML:y},null,8,Ce)]))),128))],512),[[e.vShow,u.expanded]])],8,Ee)):e.createCommentVNode("",!0)}}),Ie=$($e,[["__scopeId","data-v-de333356"]]),xe=["data-wi-md-scope"],De=["innerHTML"],Oe=e.defineComponent({__name:"KnowledgeStreamResult",props:{report:{}},setup(o){const a=o,s={imageDownload:!1,tableDownload:!0},t=T.createStyleScope(),r={...s,styleScope:t.selector},c=w=>{var V;const f=w.target.closest(".wi-md-table-download");if(!f)return;w.preventDefault(),w.stopPropagation();const y=(V=f.closest(".wi-md-table-wrap"))==null?void 0:V.querySelector("table");y&&T.downloadTableAsExcel(y)},p=new Map,h=w=>{let u=p.get(w);return u===void 0&&(p.size>300&&p.clear(),u=T.renderMarkdown(w,r),p.set(w,u)),u},v=e.computed(()=>(a.report.values||[]).map(w=>h(w.answer||"")));return(w,u)=>(e.openBlock(),e.createElementBlock("div",{class:"knowledge-result","data-wi-md-scope":e.unref(t).id,onClick:c},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(f,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"markdown-it",innerHTML:f},null,8,De))),128))],8,xe))}}),G=$(Oe,[["__scopeId","data-v-857bc0d2"]]),Te=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"})),W=Symbol("wi-chat-output-file-config"),Pe=o=>{e.provide(W,o)},Me=new Set(["png","jpg","jpeg","gif","webp","bmp","svg","ico"]),Ae=new Set(["mp3","wav","ogg","m4a","aac","flac"]),Le=new Set(["mp4","webm","mov","avi","mkv"]),Ue=new Set(["doc","docx","xls","xlsx","ppt","pptx"]),je=new Set(["html","htm"]),Fe=new Set(["js","mjs","cjs","ts","tsx","jsx","vue","py","java","c","h","cpp","hpp","cs","go","rs","php","rb","sh","bash","bat","ps1","css","scss","less"]),Re=new Set(["txt","text","md","markdown","json","csv","log","xml","yaml","yml","ini","conf","env","toml","sql"]),ze=20,D=new Map,F=new Map,qe=(o,a)=>{if(!D.has(o)&&D.size>=ze){const s=D.keys().next().value;s!==void 0&&D.delete(s)}D.set(o,a)},Ke=o=>{const a=o.lastIndexOf(".");return a>=0?o.slice(a+1).toLowerCase():""},He=o=>Me.has(o)?"image":o==="pdf"?"pdf":je.has(o)?"html":Ae.has(o)?"audio":Le.has(o)?"video":Ue.has(o)?"office":Fe.has(o)?"code":Re.has(o)?"text":"unknown",Xe=o=>{const a=e.getCurrentInstance()?e.inject(W,{}):{},s=e.computed(()=>{var E;const i=e.toValue(o);return((E=i==null?void 0:i.values)==null?void 0:E.file_id)??(i==null?void 0:i.file_id)??""}),t=e.computed(()=>{var E;const i=e.toValue(o);return((E=i==null?void 0:i.values)==null?void 0:E.file_name)??(i==null?void 0:i.file_name)??"未命名文件"}),r=e.computed(()=>Ke(t.value)),c=e.computed(()=>He(r.value)),p=e.ref(!1),h=e.ref(!1),v=e.ref(""),w=e.ref(!1),u=e.ref(""),f=e.ref(""),y=e.ref(null),V=e.computed(()=>y.value?N.formatFileSize(y.value.size):""),S=()=>{f.value&&typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&URL.revokeObjectURL(f.value),f.value=""},I=async()=>{const i=s.value,E=t.value;if(!i)throw new Error("缺少文件 id,无法加载文件");const b=i||E,A=D.get(b);if(A)return A;let x=F.get(b);return x||(x=(async()=>{var L,U;if(a.loadFile)return a.loadFile(i);const C=(L=a.getFileUrl)==null?void 0:L.call(a,i);if(!C)throw new Error("未配置文件加载方式(请提供 loadFile 或 getFileUrl)");const _=await fetch(C,{headers:(U=a.getHeaders)==null?void 0:U.call(a)});if(!_.ok)throw new Error(`文件加载失败(HTTP ${_.status})`);return _.blob()})().then(C=>(qe(b,C),C)).finally(()=>F.delete(b)),F.set(b,x)),x},k=async()=>{h.value=!0,v.value="",w.value=!1,u.value="",S();try{const i=await I();y.value=i;const E=c.value;if(E==="office"){w.value=!0;return}if(E==="image"||E==="pdf"||E==="audio"||E==="video"){typeof URL<"u"&&typeof URL.createObjectURL=="function"&&(f.value=URL.createObjectURL(i));return}const b=await i.text();if(b.includes("\0")){w.value=!0;return}u.value=b}catch(i){v.value=i instanceof Error?i.message:String(i)}finally{h.value=!1}},g=async()=>{if(a.openPreview){a.openPreview({fileId:s.value,fileName:t.value,loadFile:I,download:M});return}p.value=!0,await k()},P=()=>{p.value=!1,h.value=!1,v.value="",w.value=!1,u.value="",S()},M=async()=>{try{const i=y.value??await I();if(y.value=i,a.downloadFile){a.downloadFile({fileId:s.value,fileName:t.value,blob:i});return}if(typeof document>"u"||typeof URL>"u")return;const E=URL.createObjectURL(i),b=document.createElement("a");b.href=E,b.download=t.value,document.body.appendChild(b),b.click(),b.remove(),URL.revokeObjectURL(E)}catch(i){v.value=i instanceof Error?i.message:String(i),!p.value&&!a.openPreview&&(p.value=!0)}},O=i=>{i.key==="Escape"&&p.value&&P()};return e.watch(p,i=>{typeof window>"u"||(i?window.addEventListener("keydown",O):window.removeEventListener("keydown",O))}),e.onBeforeUnmount(()=>{typeof window<"u"&&window.removeEventListener("keydown",O),S()}),{fileId:s,fileName:t,extension:r,previewKind:c,fileSize:V,visible:p,loading:h,error:v,unsupported:w,textContent:u,objectUrl:f,open:g,close:P,download:M}},z=o=>(e.pushScopeId("data-v-f61a91b5"),o=o(),e.popScopeId(),o),Ge={class:"wi-output-file"},We=["aria-label"],Ye=z(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M7 2.5h7l4 4V21.5H7z"}),e.createElementVNode("path",{d:"M14 2.5v4h4"})],-1)),Je=[Ye],Ze={class:"wi-output-file__info"},Qe=["title"],et={class:"wi-output-file__meta"},tt={class:"wi-output-file__ext"},nt={key:0,class:"wi-output-file__size"},ot=z(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 3v12"}),e.createElementVNode("path",{d:"m7 10 5 5 5-5"}),e.createElementVNode("path",{d:"M5 21h14"})],-1)),rt=[ot],at=["aria-label"],lt={class:"wi-output-file-drawer__head"},st={class:"wi-output-file-drawer__title"},ct={class:"wi-output-file-drawer__ext"},it=["title"],ut={key:0,class:"wi-output-file-drawer__size"},dt={class:"wi-output-file-drawer__actions"},pt={class:"wi-output-file-drawer__body"},_t={key:0,class:"wi-output-file-drawer__state"},ft={key:1,class:"wi-output-file-drawer__state is-error"},mt={key:2,class:"wi-output-file-drawer__state"},vt=z(()=>e.createElementVNode("p",null,"该文件类型暂不支持在线预览,请下载后查看。",-1)),wt=["src","alt"],yt=["src","title"],kt=["srcdoc","title"],ht=["src"],gt=["src"],Et={key:8,class:"wi-output-file-drawer__text"},bt=e.defineComponent({__name:"OutputFile",props:{report:{}},setup(o){const a=o,{fileName:s,extension:t,previewKind:r,fileSize:c,visible:p,loading:h,error:v,unsupported:w,textContent:u,objectUrl:f,open:y,close:V,download:S}=Xe(()=>a.report);return(I,k)=>(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{class:"wi-output-file__card",role:"button",tabindex:"0","aria-label":`预览文件 ${e.unref(s)}`,onClick:k[1]||(k[1]=(...g)=>e.unref(y)&&e.unref(y)(...g)),onKeydown:[k[2]||(k[2]=e.withKeys((...g)=>e.unref(y)&&e.unref(y)(...g),["enter"])),k[3]||(k[3]=e.withKeys(e.withModifiers((...g)=>e.unref(y)&&e.unref(y)(...g),["prevent"]),["space"]))]},[e.createElementVNode("span",{class:e.normalizeClass(["wi-output-file__icon",`is-${e.unref(r)}`])},Je,2),e.createElementVNode("div",Ze,[e.createElementVNode("div",{class:"wi-output-file__name",title:e.unref(s)},e.toDisplayString(e.unref(s)),9,Qe),e.createElementVNode("div",et,[e.createElementVNode("span",tt,e.toDisplayString(e.unref(t).toUpperCase()||"FILE"),1),e.unref(c)?(e.openBlock(),e.createElementBlock("span",nt,e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("button",{type:"button",class:"wi-output-file__download",title:"下载文件","aria-label":"下载文件",onClick:k[0]||(k[0]=e.withModifiers((...g)=>e.unref(S)&&e.unref(S)(...g),["stop"]))},rt)],40,We),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"wi-output-file-fade"},{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wi-output-file-mask",onClick:k[8]||(k[8]=e.withModifiers((...g)=>e.unref(V)&&e.unref(V)(...g),["self"]))},[e.createElementVNode("aside",{class:"wi-output-file-drawer",role:"dialog","aria-modal":"true","aria-label":`预览文件 ${e.unref(s)}`},[e.createElementVNode("header",lt,[e.createElementVNode("div",st,[e.createElementVNode("span",ct,e.toDisplayString(e.unref(t).toUpperCase()||"FILE"),1),e.createElementVNode("div",{class:"wi-output-file-drawer__name",title:e.unref(s)},e.toDisplayString(e.unref(s)),9,it),e.unref(c)?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",dt,[e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn",onClick:k[4]||(k[4]=(...g)=>e.unref(S)&&e.unref(S)(...g))},"下载"),e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn wi-output-file-drawer__btn--close",title:"关闭","aria-label":"关闭预览",onClick:k[5]||(k[5]=(...g)=>e.unref(V)&&e.unref(V)(...g))}," × ")])]),e.createElementVNode("div",pt,[e.unref(h)?(e.openBlock(),e.createElementBlock("div",_t,"文件加载中…")):e.unref(v)?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("p",null,e.toDisplayString(e.unref(v)),1),e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn",onClick:k[6]||(k[6]=(...g)=>e.unref(S)&&e.unref(S)(...g))},"下载文件")])):e.unref(w)?(e.openBlock(),e.createElementBlock("div",mt,[vt,e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn",onClick:k[7]||(k[7]=(...g)=>e.unref(S)&&e.unref(S)(...g))},"下载文件")])):e.unref(r)==="image"&&e.unref(f)?(e.openBlock(),e.createElementBlock("img",{key:3,class:"wi-output-file-drawer__image",src:e.unref(f),alt:e.unref(s)},null,8,wt)):e.unref(r)==="pdf"&&e.unref(f)?(e.openBlock(),e.createElementBlock("iframe",{key:4,class:"wi-output-file-drawer__frame",src:e.unref(f),title:e.unref(s)},null,8,yt)):e.unref(r)==="html"?(e.openBlock(),e.createElementBlock("iframe",{key:5,class:"wi-output-file-drawer__frame",srcdoc:e.unref(u),sandbox:"allow-scripts allow-forms allow-modals",title:e.unref(s)},null,8,kt)):e.unref(r)==="audio"&&e.unref(f)?(e.openBlock(),e.createElementBlock("audio",{key:6,class:"wi-output-file-drawer__media",src:e.unref(f),controls:""},null,8,ht)):e.unref(r)==="video"&&e.unref(f)?(e.openBlock(),e.createElementBlock("video",{key:7,class:"wi-output-file-drawer__media",src:e.unref(f),controls:""},null,8,gt)):(e.openBlock(),e.createElementBlock("pre",Et,e.toDisplayString(e.unref(u)),1))])],8,at)])):e.createCommentVNode("",!0)]),_:1})]))]))}}),Y=$(bt,[["__scopeId","data-v-f61a91b5"]]),Vt=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"})),St=()=>{var a,s;const o=(s=(a=window==null?void 0:window.globalConfig)==null?void 0:a.WebApiUrl)==null?void 0:s.MainUrl;return typeof o=="string"?o:""},Bt=()=>window.location.origin+window.location.pathname,R="access-session",Nt=()=>{const o=window.location.pathname.split("/").filter(a=>!!a).join("-");return o?`${o}-`:""},Ct=()=>{const o=`${Nt()}${R}`,a=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);!r||!r.endsWith(R)||r.slice(0,r.lastIndexOf(":"))!=="wi admin"&&(r.endsWith(`x-${R}`)||a.push(r))}const s=a.find(t=>t.endsWith(o))??a[0];if(!s)return"";try{const t=localStorage.getItem(s);if(!t||t==="undefined")return"";const r=JSON.parse(t);return r==null?"":String(r)}catch{return""}},J=Symbol("wi-chat-iframe-page-config"),$t=o=>{e.provide(J,o)},Z=(o,a)=>{const s=(a==null?void 0:a.mainUrl)!==void 0?String(e.toValue(a.mainUrl)):St(),t=(a==null?void 0:a.token)!==void 0?String(e.toValue(a.token)):Ct();return o.replace(/\{\{\s*MAIN_URL\s*\}\}/g,s).replace(/\{\{\s*SERVE_URL\s*\}\}/g,Bt()).replace(/\{\{\s*token\s*\}\}/g,t)},Q=o=>{const a=e.getCurrentInstance()?e.inject(J,{}):{},s=e.computed(()=>{var p;const r=e.toValue(o),c=((p=r==null?void 0:r.values)==null?void 0:p.url)??(r==null?void 0:r.url)??"";return c?a.resolveUrl?a.resolveUrl(c):Z(c,a):""}),t=e.computed(()=>{var c;const r=e.toValue(o);return((c=r==null?void 0:r.values)==null?void 0:c.srcdoc)??(r==null?void 0:r.srcdoc)??""});return{url:s,srcdoc:t}},H="data-wi-iframe-resizer-child",ee=o=>{if(!o)return!1;let a=null;try{a=o.contentDocument}catch{return!1}if(!a)return!1;const s=a.head||a.documentElement;if(!s)return!1;const t=a.defaultView;if(t!=null&&t.parentIframe||t!=null&&t.parentIFrame||a.querySelector(`script[${H}]`))return!1;const r=a.createElement("script");return r.textContent=N.IFRAME_RESIZER_CHILD_SCRIPT,r.setAttribute(H,""),s.appendChild(r),!0},It=e.defineComponent({__name:"IframePage",props:{report:{}},setup(o){const a=o,{url:s,srcdoc:t}=Q(()=>a.report),r=c=>{ee(c.target)};return(c,p)=>e.unref(s)?(e.openBlock(),e.createBlock(K,{key:0,class:"iframe-page__frame iframe-page__frame--url",license:"GPLv3",src:e.unref(s),width:"100%","warning-timeout":0,onLoad:r},null,8,["src"])):e.unref(t)?(e.openBlock(),e.createBlock(K,{key:1,class:"iframe-page iframe-page--srcdoc",license:"GPLv3",srcdoc:e.unref(t),width:"100%",frameborder:"no",border:"0",marginwidth:"0",marginheight:"0",scrolling:"no"},null,8,["srcdoc"])):e.createCommentVNode("",!0)}}),te=$(It,[["__scopeId","data-v-f4c94a4e"]]),xt=Object.freeze(Object.defineProperty({__proto__:null,default:te},Symbol.toStringTag,{value:"Module"})),q=o=>(e.pushScopeId("data-v-74053305"),o=o(),e.popScopeId(),o),Dt={class:"wi-clarify__header"},Ot={class:"wi-clarify__heading"},Tt=q(()=>e.createElementVNode("div",{class:"wi-clarify__eyebrow"},"需要补充信息",-1)),Pt={class:"wi-clarify__title"},Mt={key:0,class:"wi-clarify__desc"},At={class:"wi-clarify__status"},Lt={class:"wi-clarify__progress"},Ut={class:"wi-clarify__progress-track"},jt={key:0,class:"wi-clarify__panel"},Ft={class:"wi-clarify__question"},Rt={key:0,class:"wi-clarify__question-desc"},zt={key:1,class:"wi-clarify__binding"},qt={key:2,class:"wi-clarify__options"},Kt=["onClick"],Ht={class:"wi-clarify__option-indicator"},Xt={key:3,class:"wi-clarify__date"},Gt=["for"],Wt=["id","value"],Yt={class:"wi-clarify__text"},Jt={key:0,class:"wi-clarify__or"},Zt=q(()=>e.createElementVNode("span",null,"或者,用自己的话说明",-1)),Qt=[Zt],en=["for"],tn=["id","value","placeholder"],nn={class:"wi-clarify__dots","aria-label":"确认问题导航"},on=["aria-label","onClick"],rn={class:"wi-clarify__footer"},an=q(()=>e.createElementVNode("span",{class:"wi-clarify__confirm-text"},"取消后本次操作将停止等待这些回答",-1)),ln={class:"wi-clarify__actions"},sn={class:"wi-clarify__actions"},cn=["disabled"],un={key:1,class:"wi-clarify__result"},dn={class:"wi-clarify__result-icon"},pn={class:"wi-clarify__result-body"},_n={key:0,class:"wi-clarify__summary"},fn={key:1},mn={key:2},vn={key:2,class:"wi-clarify__feedback"},wn=e.defineComponent({__name:"ClarificationCard",props:{report:{}},setup(o){const a=o,s={requestId:"",title:"需要补充信息",description:"",items:[],status:"expired",resultMessage:"本次补充信息已失效(回答已结束)"},t=e.computed(()=>a.report.values??s),r=e.computed(()=>t.value.items??[]),c=e.ref(0),p=e.reactive({}),h=e.ref(!1),v=e.ref(""),w=()=>{Object.keys(p).forEach(n=>delete p[n]),r.value.forEach(n=>{const l={structuredValue:void 0,structuredValues:[],textValue:""};n.default!==void 0&&(n.input.type==="multi_select"?l.structuredValues=Array.isArray(n.default)?[...n.default]:[]:n.input.type==="text"?l.textValue=String(n.default):l.structuredValue=n.default),p[n.id]=l}),c.value=0};e.watch(()=>{var n;return(n=t.value)==null?void 0:n.requestId},w,{immediate:!0});const u=n=>(p[n]||(p[n]={structuredValue:void 0,structuredValues:[],textValue:""}),p[n]),f=e.computed(()=>{var n,l,d;return((n=t.value)==null?void 0:n.status)==="submitted"?"已提交":((l=t.value)==null?void 0:l.status)==="cancelled"?"已取消":((d=t.value)==null?void 0:d.status)==="expired"?"已失效":"等待回答"}),y=n=>{try{const l=JSON.stringify(n);return l===void 0?String(n):l}catch{return String(n)}},V=(n,l)=>y(n)===y(l),S=(n,l)=>{const d=u(n.id);return n.input.type==="multi_select"?d.structuredValues.some(m=>V(m,l)):V(d.structuredValue,l)},I=(n,l)=>{const d=u(n.id);if(d.textValue="",n.input.type==="multi_select"){const m=d.structuredValues.findIndex(B=>V(B,l));m>=0?d.structuredValues.splice(m,1):d.structuredValues.push(l);return}d.structuredValue=l},k=n=>{var l;return((l=n.target)==null?void 0:l.value)??""},g=(n,l)=>{const d=u(n.id);d.textValue=k(l),n.input.type!=="text"&&(d.structuredValue=void 0,d.structuredValues.splice(0))},P=(n,l)=>{const d=u(n.id);d.structuredValue=k(l),d.textValue=""},M=n=>{const l=u(n.id).structuredValue;return l==null?"":String(l)},O=n=>{var l;return((l=n.input.textInput)==null?void 0:l.placeholder)??n.input.placeholder??(n.input.type==="text"?"请输入需要补充的信息":"例如:使用阀门,或者说明你的具体要求")},i=n=>{const l=n.binding;if(!l)return"";const d=l.actionName?`动作:${l.actionName}`:"",m=l.parameterPath?`参数:${l.parameterPath}`:"";return[d,m].filter(Boolean).join(" · ")},E=n=>{const l=u(n.id);return n.input.type==="multi_select"?l.structuredValues.length>0:n.input.type==="single_select"?l.structuredValue!==void 0:n.input.type==="date"?!!l.structuredValue:!1},b=n=>!!u(n.id).textValue.trim()||E(n),A=n=>!n.required||b(n)?!0:(v.value=`请回答“${n.question}”`,!1),x=()=>{v.value="",c.value=Math.max(0,c.value-1)},C=()=>{!_.value||!A(_.value)||(v.value="",c.value=Math.min(r.value.length-1,c.value+1))},_=e.computed(()=>r.value[c.value]),L=(n,l)=>n.input.type==="date"?String(l??""):(Array.isArray(l)?l:[l]).map(m=>{var j;const B=(j=n.input.options)==null?void 0:j.find(ce=>V(ce.value,m));return(B==null?void 0:B.label)??String(m??"")}).filter(Boolean).join("、"),U=n=>{const l=u(n.id),d=l.textValue.trim();if(n.input.type==="text"||d||!E(n))return{id:n.id,mode:"text",value:d,displayText:d};const m=n.input.type==="multi_select"?[...l.structuredValues]:l.structuredValue;return{id:n.id,mode:"structured",value:m,displayText:L(n,m)}},ae=()=>{const n=r.value.findIndex(d=>d.required&&!b(d));if(n>=0){c.value=n,v.value=`请回答“${r.value[n].question}”`;return}v.value="";const l=r.value.map(U);N.submitClarification(t.value.requestId,l)||(v.value="本次补充信息已经处理")},le=()=>{h.value=!1,v.value="",N.cancelClarification(t.value.requestId)||(v.value="本次补充信息已经处理")},se=n=>{var l;return((l=r.value.find(d=>d.id===n))==null?void 0:l.question)??n};return(n,l)=>{var d;return e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["wi-clarify",`is-${t.value.status}`])},[e.createElementVNode("header",Dt,[e.createElementVNode("div",Ot,[Tt,e.createElementVNode("h3",Pt,e.toDisplayString(t.value.title),1),t.value.description?(e.openBlock(),e.createElementBlock("p",Mt,e.toDisplayString(t.value.description),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",At,e.toDisplayString(f.value),1)]),t.value.status==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Lt,[e.createElementVNode("span",null,"问题 "+e.toDisplayString(c.value+1)+" / "+e.toDisplayString(r.value.length),1),e.createElementVNode("div",Ut,[e.createElementVNode("span",{style:e.normalizeStyle({width:`${(c.value+1)/r.value.length*100}%`})},null,4)])]),_.value?(e.openBlock(),e.createElementBlock("div",jt,[e.createElementVNode("div",Ft,[e.createElementVNode("span",{class:e.normalizeClass(_.value.required?"wi-clarify__required":"wi-clarify__optional")},e.toDisplayString(_.value.required?"必填":"选填"),3),e.createElementVNode("h4",null,e.toDisplayString(_.value.question),1)]),_.value.description?(e.openBlock(),e.createElementBlock("p",Rt,e.toDisplayString(_.value.description),1)):e.createCommentVNode("",!0),i(_.value)?(e.openBlock(),e.createElementBlock("div",zt,e.toDisplayString(i(_.value)),1)):e.createCommentVNode("",!0),_.value.input.type==="single_select"||_.value.input.type==="multi_select"?(e.openBlock(),e.createElementBlock("div",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value.input.options,(m,B)=>(e.openBlock(),e.createElementBlock("button",{key:B,type:"button",class:e.normalizeClass(["wi-clarify__option",{"is-selected":S(_.value,m.value)}]),onClick:j=>I(_.value,m.value)},[e.createElementVNode("span",Ht,e.toDisplayString(S(_.value,m.value)?"✓":""),1),e.createElementVNode("span",null,e.toDisplayString(m.label),1)],10,Kt))),128))])):_.value.input.type==="date"?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("label",{for:`wi-clarify-date-${_.value.id}`},"选择日期",8,Gt),e.createElementVNode("input",{id:`wi-clarify-date-${_.value.id}`,type:"date",value:M(_.value),onInput:l[0]||(l[0]=m=>P(_.value,m))},null,40,Wt)])):e.createCommentVNode("",!0),e.createElementVNode("div",Yt,[_.value.input.type!=="text"?(e.openBlock(),e.createElementBlock("div",Jt,Qt)):e.createCommentVNode("",!0),e.createElementVNode("label",{for:`wi-clarify-text-${_.value.id}`},e.toDisplayString(_.value.input.type==="text"?"你的回答":"自然语言回答"),9,en),e.createElementVNode("textarea",{id:`wi-clarify-text-${_.value.id}`,value:u(_.value.id).textValue,placeholder:O(_.value),rows:"3",onInput:l[1]||(l[1]=m=>g(_.value,m))},null,40,tn)])])):e.createCommentVNode("",!0),e.createElementVNode("div",nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(m,B)=>(e.openBlock(),e.createElementBlock("button",{key:m.id,type:"button","aria-label":`查看第 ${B+1} 个问题`,class:e.normalizeClass({"is-active":B===c.value,"is-answered":b(m)}),onClick:j=>c.value=B},null,10,on))),128))]),e.createElementVNode("footer",rn,[h.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[an,e.createElementVNode("div",ln,[e.createElementVNode("button",{type:"button",class:"wi-clarify__btn wi-clarify__btn--secondary",onClick:l[2]||(l[2]=m=>h.value=!1)}," 继续填写 "),e.createElementVNode("button",{type:"button",class:"wi-clarify__btn wi-clarify__btn--danger",onClick:le},"确认取消")])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{type:"button",class:"wi-clarify__cancel",onClick:l[3]||(l[3]=m=>h.value=!0)},"取消"),e.createElementVNode("div",sn,[e.createElementVNode("button",{type:"button",class:"wi-clarify__btn wi-clarify__btn--secondary",disabled:c.value===0,onClick:x}," 上一项 ",8,cn),c.value<r.value.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-clarify__btn wi-clarify__btn--primary",onClick:C}," 下一项 ")):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wi-clarify__btn wi-clarify__btn--primary",onClick:ae},"提交全部"))])],64))])],64)):(e.openBlock(),e.createElementBlock("div",un,[e.createElementVNode("div",dn,e.toDisplayString(t.value.status==="submitted"?"✓":t.value.status==="cancelled"?"—":"!"),1),e.createElementVNode("div",pn,[e.createElementVNode("h4",null,e.toDisplayString(t.value.resultMessage||f.value),1),t.value.status==="submitted"&&((d=t.value.answers)!=null&&d.length)?(e.openBlock(),e.createElementBlock("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.answers,m=>(e.openBlock(),e.createElementBlock("div",{key:m.id},[e.createElementVNode("span",null,e.toDisplayString(se(m.id)),1),e.createElementVNode("strong",null,e.toDisplayString(m.displayText||"未填写"),1)]))),128))])):t.value.status==="cancelled"?(e.openBlock(),e.createElementBlock("p",fn,"本次确认未提交,工作流将收到取消结果。")):(e.openBlock(),e.createElementBlock("p",mn,"该确认项已失效,无法再提交。"))])])),v.value?(e.openBlock(),e.createElementBlock("div",vn,e.toDisplayString(v.value),1)):e.createCommentVNode("",!0)],2)}}}),ne=$(wn,[["__scopeId","data-v-74053305"]]),yn=Object.freeze(Object.defineProperty({__proto__:null,default:ne},Symbol.toStringTag,{value:"Module"})),oe=o=>(e.pushScopeId("data-v-14805363"),o=o(),e.popScopeId(),o),kn={class:"wi-agent-action__head"},hn={class:"wi-agent-action__icon","aria-hidden":"true"},gn={class:"wi-agent-action__title"},En=oe(()=>e.createElementVNode("span",{class:"wi-agent-action__label"},"执行操作",-1)),bn={class:"wi-agent-action__name"},Vn={class:"wi-agent-action__chip"},Sn={class:"wi-agent-action__message"},Bn={key:0,class:"wi-agent-action__args"},Nn=oe(()=>e.createElementVNode("summary",null,"查看参数",-1)),Cn=e.defineComponent({__name:"AgentActionStatus",props:{report:{}},setup(o){const a=o,s={id:"",name:"",arguments:{},status:"unknown",message:"执行状态未知(回答已结束)"},t=e.computed(()=>a.report.values??s),r=e.computed(()=>t.value.status==="running"?"●":t.value.status==="success"?"✓":t.value.status==="error"?"!":"?"),c=e.computed(()=>t.value.status==="running"?"执行中":t.value.status==="success"?"已完成":t.value.status==="error"?"执行失败":"状态未知"),p=e.computed(()=>{const v=t.value.arguments;return!!v&&typeof v=="object"&&Object.keys(v).length>0}),h=e.computed(()=>JSON.stringify(t.value.arguments??{},null,2));return(v,w)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["wi-agent-action",`is-${t.value.status}`])},[e.createElementVNode("header",kn,[e.createElementVNode("span",hn,e.toDisplayString(r.value),1),e.createElementVNode("div",gn,[En,e.createElementVNode("code",bn,e.toDisplayString(t.value.name||"未知操作"),1)]),e.createElementVNode("span",Vn,e.toDisplayString(c.value),1)]),e.createElementVNode("p",Sn,e.toDisplayString(t.value.message||c.value),1),p.value?(e.openBlock(),e.createElementBlock("details",Bn,[Nn,e.createElementVNode("pre",null,e.toDisplayString(h.value),1)])):e.createCommentVNode("",!0)],2))}}),re=$(Cn,[["__scopeId","data-v-14805363"]]),$n=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));exports.AgentActionStatus=re;exports.AiAnswerBubble=he;exports.ClarificationCard=ne;exports.DeepThinkingSteps=Ie;exports.IframePage=te;exports.KnowledgeStreamResult=G;exports.OutputFile=Y;exports.createAnswerContentMap=X;exports.injectIframeResizerChild=ee;exports.provideIframePageConfig=$t;exports.provideOutputFileConfig=Pe;exports.resolveIframePlaceholders=Z;exports.useIframePage=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("wi-chat/style.css");const e=require("vue"),N=require("wi-chat/parser"),T=require("wi-chat/tools"),H=require("@iframe-resizer/vue/iframe-resizer.vue"),ie=[{...N.knowledgeStreamParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Te))},{...N.iframePageParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>xt))},{...N.outputFileParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>Vt))},{...N.collectClarificationsParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>yn))},{...N.hostActionParser,component:e.defineAsyncComponent(()=>Promise.resolve().then(()=>$n))}],X=o=>{const s=a=>{const t={};for(const r of a)!r.answerType||!r.component||(t[r.answerType]=r.component);return t};return{...s(ie),...s(o??[])}},ue=o=>(e.pushScopeId("data-v-efad55c8"),o=o(),e.popScopeId(),o),de={class:"flex justify-start"},pe={class:"ai-answer-bubble"},_e={key:0,class:"ai-answer-bubble__error"},fe={class:"ai-answer-bubble__body"},me={key:0,class:"ai-answer-bubble__status"},ve={key:2,class:"ai-answer-bubble__status"},we={key:3,class:"ai-answer-bubble__loading"},ye=ue(()=>e.createElementVNode("span",{class:"ai-answer-bubble__pulse"},null,-1)),ke=e.defineComponent({__name:"AiAnswerBubble",props:{answer:{},error:{type:Boolean,default:!1},stopped:{type:Boolean,default:!1},contentMap:{default:()=>X()}},setup(o){const s=o,a=e.computed(()=>{var r,c;return((c=(r=s.answer)==null?void 0:r.answer)==null?void 0:c.reports)??[]}),t=e.computed(()=>a.value.filter(r=>s.contentMap[r.answer_type]));return(r,c)=>(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",pe,[r.error?(e.openBlock(),e.createElementBlock("div",_e,"回答加载失败")):t.value.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(p,h)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.contentMap[p.answer_type]),{key:h,report:p},null,8,["report"]))),128))]),r.stopped?(e.openBlock(),e.createElementBlock("div",me,"回答已停止")):e.createCommentVNode("",!0)],64)):r.stopped?(e.openBlock(),e.createElementBlock("div",ve,"回答已停止")):a.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",we,[ye,e.createTextVNode("正在思考...")]))])]))}}),$=(o,s)=>{const a=o.__vccOpts||o;for(const[t,r]of s)a[t]=r;return a},he=$(ke,[["__scopeId","data-v-efad55c8"]]),ge=o=>(e.pushScopeId("data-v-de333356"),o=o(),e.popScopeId(),o),Ee=["data-wi-md-scope"],be=["aria-expanded"],Ve=ge(()=>e.createElementVNode("span",{class:"deep-thinking__title"},"深度思考",-1)),Se={class:"deep-thinking__count"},Be={class:"deep-thinking__list"},Ne={class:"deep-thinking__index"},Ce=["innerHTML"],$e=e.defineComponent({__name:"DeepThinkingSteps",props:{steps:{},expanded:{type:Boolean}},emits:["update:expanded"],setup(o,{emit:s}){const a=o,t=s,r={imageDownload:!1,tableDownload:!1},c=T.createStyleScope(),p={...r,styleScope:c.selector},h=new Map,v=u=>{let f=h.get(u);return f===void 0&&(h.size>500&&h.clear(),f=T.renderMarkdown(u,p),h.set(u,f)),f},w=e.computed(()=>a.steps.map(v));return(u,f)=>w.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"deep-thinking","data-wi-md-scope":e.unref(c).id},[e.createElementVNode("button",{type:"button",class:"deep-thinking__header","aria-expanded":u.expanded,onClick:f[0]||(f[0]=y=>t("update:expanded",!u.expanded))},[Ve,e.createElementVNode("span",Se,e.toDisplayString(w.value.length),1),e.createElementVNode("span",null,e.toDisplayString(u.expanded?"收起":"展开"),1)],8,be),e.withDirectives(e.createElementVNode("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(y,V)=>(e.openBlock(),e.createElementBlock("div",{key:V,class:"deep-thinking__item"},[e.createElementVNode("span",Ne,e.toDisplayString(V+1),1),e.createElementVNode("div",{class:"markdown-it",innerHTML:y},null,8,Ce)]))),128))],512),[[e.vShow,u.expanded]])],8,Ee)):e.createCommentVNode("",!0)}}),Ie=$($e,[["__scopeId","data-v-de333356"]]),xe=["data-wi-md-scope"],De=["innerHTML"],Oe=e.defineComponent({__name:"KnowledgeStreamResult",props:{report:{}},setup(o){const s=o,a={imageDownload:!1,tableDownload:!0},t=T.createStyleScope(),r={...a,styleScope:t.selector},c=w=>{var V;const f=w.target.closest(".wi-md-table-download");if(!f)return;w.preventDefault(),w.stopPropagation();const y=(V=f.closest(".wi-md-table-wrap"))==null?void 0:V.querySelector("table");y&&T.downloadTableAsExcel(y)},p=new Map,h=w=>{let u=p.get(w);return u===void 0&&(p.size>300&&p.clear(),u=T.renderMarkdown(w,r),p.set(w,u)),u},v=e.computed(()=>(s.report.values||[]).map(w=>h(w.answer||"")));return(w,u)=>(e.openBlock(),e.createElementBlock("div",{class:"knowledge-result","data-wi-md-scope":e.unref(t).id,onClick:c},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(f,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"markdown-it",innerHTML:f},null,8,De))),128))],8,xe))}}),G=$(Oe,[["__scopeId","data-v-857bc0d2"]]),Te=Object.freeze(Object.defineProperty({__proto__:null,default:G},Symbol.toStringTag,{value:"Module"})),W=Symbol("wi-chat-output-file-config"),Pe=o=>{e.provide(W,o)},Me=new Set(["png","jpg","jpeg","gif","webp","bmp","svg","ico"]),Le=new Set(["mp3","wav","ogg","m4a","aac","flac"]),Ue=new Set(["mp4","webm","mov","avi","mkv"]),je=new Set(["doc","docx","xls","xlsx","ppt","pptx"]),Ae=new Set(["html","htm"]),Fe=new Set(["js","mjs","cjs","ts","tsx","jsx","vue","py","java","c","h","cpp","hpp","cs","go","rs","php","rb","sh","bash","bat","ps1","css","scss","less"]),Re=new Set(["txt","text","md","markdown","json","csv","log","xml","yaml","yml","ini","conf","env","toml","sql"]),ze=20,D=new Map,F=new Map,qe=(o,s)=>{if(!D.has(o)&&D.size>=ze){const a=D.keys().next().value;a!==void 0&&D.delete(a)}D.set(o,s)},He=o=>{const s=o.lastIndexOf(".");return s>=0?o.slice(s+1).toLowerCase():""},Ke=o=>Me.has(o)?"image":o==="pdf"?"pdf":Ae.has(o)?"html":Le.has(o)?"audio":Ue.has(o)?"video":je.has(o)?"office":Fe.has(o)?"code":Re.has(o)?"text":"unknown",Xe=o=>{const s=e.getCurrentInstance()?e.inject(W,{}):{},a=e.computed(()=>{var E;const i=e.toValue(o);return((E=i==null?void 0:i.values)==null?void 0:E.file_id)??(i==null?void 0:i.file_id)??""}),t=e.computed(()=>{var E;const i=e.toValue(o);return((E=i==null?void 0:i.values)==null?void 0:E.file_name)??(i==null?void 0:i.file_name)??"未命名文件"}),r=e.computed(()=>He(t.value)),c=e.computed(()=>Ke(r.value)),p=e.ref(!1),h=e.ref(!1),v=e.ref(""),w=e.ref(!1),u=e.ref(""),f=e.ref(""),y=e.ref(null),V=e.computed(()=>y.value?N.formatFileSize(y.value.size):""),S=()=>{f.value&&typeof URL<"u"&&typeof URL.revokeObjectURL=="function"&&URL.revokeObjectURL(f.value),f.value=""},I=async()=>{const i=a.value,E=t.value;if(!i)throw new Error("缺少文件 id,无法加载文件");const b=i||E,L=D.get(b);if(L)return L;let x=F.get(b);return x||(x=(async()=>{var U,j;if(s.loadFile)return s.loadFile(i);const C=(U=s.getFileUrl)==null?void 0:U.call(s,i);if(!C)throw new Error("未配置文件加载方式(请提供 loadFile 或 getFileUrl)");const _=await fetch(C,{headers:(j=s.getHeaders)==null?void 0:j.call(s)});if(!_.ok)throw new Error(`文件加载失败(HTTP ${_.status})`);return _.blob()})().then(C=>(qe(b,C),C)).finally(()=>F.delete(b)),F.set(b,x)),x},k=async()=>{h.value=!0,v.value="",w.value=!1,u.value="",S();try{const i=await I();y.value=i;const E=c.value;if(E==="office"){w.value=!0;return}if(E==="image"||E==="pdf"||E==="audio"||E==="video"){typeof URL<"u"&&typeof URL.createObjectURL=="function"&&(f.value=URL.createObjectURL(i));return}const b=await i.text();if(b.includes("\0")){w.value=!0;return}u.value=b}catch(i){v.value=i instanceof Error?i.message:String(i)}finally{h.value=!1}},g=async()=>{if(s.openPreview){s.openPreview({fileId:a.value,fileName:t.value,loadFile:I,download:M});return}p.value=!0,await k()},P=()=>{p.value=!1,h.value=!1,v.value="",w.value=!1,u.value="",S()},M=async()=>{try{const i=y.value??await I();if(y.value=i,s.downloadFile){s.downloadFile({fileId:a.value,fileName:t.value,blob:i});return}if(typeof document>"u"||typeof URL>"u")return;const E=URL.createObjectURL(i),b=document.createElement("a");b.href=E,b.download=t.value,document.body.appendChild(b),b.click(),b.remove(),URL.revokeObjectURL(E)}catch(i){v.value=i instanceof Error?i.message:String(i),!p.value&&!s.openPreview&&(p.value=!0)}},O=i=>{i.key==="Escape"&&p.value&&P()};return e.watch(p,i=>{typeof window>"u"||(i?window.addEventListener("keydown",O):window.removeEventListener("keydown",O))}),e.onBeforeUnmount(()=>{typeof window<"u"&&window.removeEventListener("keydown",O),S()}),{fileId:a,fileName:t,extension:r,previewKind:c,fileSize:V,visible:p,loading:h,error:v,unsupported:w,textContent:u,objectUrl:f,open:g,close:P,download:M}},z=o=>(e.pushScopeId("data-v-f61a91b5"),o=o(),e.popScopeId(),o),Ge={class:"wi-output-file"},We=["aria-label"],Ye=z(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M7 2.5h7l4 4V21.5H7z"}),e.createElementVNode("path",{d:"M14 2.5v4h4"})],-1)),Je=[Ye],Ze={class:"wi-output-file__info"},Qe=["title"],et={class:"wi-output-file__meta"},tt={class:"wi-output-file__ext"},nt={key:0,class:"wi-output-file__size"},ot=z(()=>e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M12 3v12"}),e.createElementVNode("path",{d:"m7 10 5 5 5-5"}),e.createElementVNode("path",{d:"M5 21h14"})],-1)),rt=[ot],st=["aria-label"],lt={class:"wi-output-file-drawer__head"},at={class:"wi-output-file-drawer__title"},ct={class:"wi-output-file-drawer__ext"},it=["title"],ut={key:0,class:"wi-output-file-drawer__size"},dt={class:"wi-output-file-drawer__actions"},pt={class:"wi-output-file-drawer__body"},_t={key:0,class:"wi-output-file-drawer__state"},ft={key:1,class:"wi-output-file-drawer__state is-error"},mt={key:2,class:"wi-output-file-drawer__state"},vt=z(()=>e.createElementVNode("p",null,"该文件类型暂不支持在线预览,请下载后查看。",-1)),wt=["src","alt"],yt=["src","title"],kt=["srcdoc","title"],ht=["src"],gt=["src"],Et={key:8,class:"wi-output-file-drawer__text"},bt=e.defineComponent({__name:"OutputFile",props:{report:{}},setup(o){const s=o,{fileName:a,extension:t,previewKind:r,fileSize:c,visible:p,loading:h,error:v,unsupported:w,textContent:u,objectUrl:f,open:y,close:V,download:S}=Xe(()=>s.report);return(I,k)=>(e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{class:"wi-output-file__card",role:"button",tabindex:"0","aria-label":`预览文件 ${e.unref(a)}`,onClick:k[1]||(k[1]=(...g)=>e.unref(y)&&e.unref(y)(...g)),onKeydown:[k[2]||(k[2]=e.withKeys((...g)=>e.unref(y)&&e.unref(y)(...g),["enter"])),k[3]||(k[3]=e.withKeys(e.withModifiers((...g)=>e.unref(y)&&e.unref(y)(...g),["prevent"]),["space"]))]},[e.createElementVNode("span",{class:e.normalizeClass(["wi-output-file__icon",`is-${e.unref(r)}`])},Je,2),e.createElementVNode("div",Ze,[e.createElementVNode("div",{class:"wi-output-file__name",title:e.unref(a)},e.toDisplayString(e.unref(a)),9,Qe),e.createElementVNode("div",et,[e.createElementVNode("span",tt,e.toDisplayString(e.unref(t).toUpperCase()||"FILE"),1),e.unref(c)?(e.openBlock(),e.createElementBlock("span",nt,e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("button",{type:"button",class:"wi-output-file__download",title:"下载文件","aria-label":"下载文件",onClick:k[0]||(k[0]=e.withModifiers((...g)=>e.unref(S)&&e.unref(S)(...g),["stop"]))},rt)],40,We),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"wi-output-file-fade"},{default:e.withCtx(()=>[e.unref(p)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"wi-output-file-mask",onClick:k[8]||(k[8]=e.withModifiers((...g)=>e.unref(V)&&e.unref(V)(...g),["self"]))},[e.createElementVNode("aside",{class:"wi-output-file-drawer",role:"dialog","aria-modal":"true","aria-label":`预览文件 ${e.unref(a)}`},[e.createElementVNode("header",lt,[e.createElementVNode("div",at,[e.createElementVNode("span",ct,e.toDisplayString(e.unref(t).toUpperCase()||"FILE"),1),e.createElementVNode("div",{class:"wi-output-file-drawer__name",title:e.unref(a)},e.toDisplayString(e.unref(a)),9,it),e.unref(c)?(e.openBlock(),e.createElementBlock("div",ut,e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",dt,[e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn",onClick:k[4]||(k[4]=(...g)=>e.unref(S)&&e.unref(S)(...g))},"下载"),e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn wi-output-file-drawer__btn--close",title:"关闭","aria-label":"关闭预览",onClick:k[5]||(k[5]=(...g)=>e.unref(V)&&e.unref(V)(...g))}," × ")])]),e.createElementVNode("div",pt,[e.unref(h)?(e.openBlock(),e.createElementBlock("div",_t,"文件加载中…")):e.unref(v)?(e.openBlock(),e.createElementBlock("div",ft,[e.createElementVNode("p",null,e.toDisplayString(e.unref(v)),1),e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn",onClick:k[6]||(k[6]=(...g)=>e.unref(S)&&e.unref(S)(...g))},"下载文件")])):e.unref(w)?(e.openBlock(),e.createElementBlock("div",mt,[vt,e.createElementVNode("button",{type:"button",class:"wi-output-file-drawer__btn",onClick:k[7]||(k[7]=(...g)=>e.unref(S)&&e.unref(S)(...g))},"下载文件")])):e.unref(r)==="image"&&e.unref(f)?(e.openBlock(),e.createElementBlock("img",{key:3,class:"wi-output-file-drawer__image",src:e.unref(f),alt:e.unref(a)},null,8,wt)):e.unref(r)==="pdf"&&e.unref(f)?(e.openBlock(),e.createElementBlock("iframe",{key:4,class:"wi-output-file-drawer__frame",src:e.unref(f),title:e.unref(a)},null,8,yt)):e.unref(r)==="html"?(e.openBlock(),e.createElementBlock("iframe",{key:5,class:"wi-output-file-drawer__frame",srcdoc:e.unref(u),sandbox:"allow-scripts allow-forms allow-modals",title:e.unref(a)},null,8,kt)):e.unref(r)==="audio"&&e.unref(f)?(e.openBlock(),e.createElementBlock("audio",{key:6,class:"wi-output-file-drawer__media",src:e.unref(f),controls:""},null,8,ht)):e.unref(r)==="video"&&e.unref(f)?(e.openBlock(),e.createElementBlock("video",{key:7,class:"wi-output-file-drawer__media",src:e.unref(f),controls:""},null,8,gt)):(e.openBlock(),e.createElementBlock("pre",Et,e.toDisplayString(e.unref(u)),1))])],8,st)])):e.createCommentVNode("",!0)]),_:1})]))]))}}),Y=$(bt,[["__scopeId","data-v-f61a91b5"]]),Vt=Object.freeze(Object.defineProperty({__proto__:null,default:Y},Symbol.toStringTag,{value:"Module"})),St=()=>{var s,a;const o=(a=(s=window==null?void 0:window.globalConfig)==null?void 0:s.WebApiUrl)==null?void 0:a.MainUrl;return typeof o=="string"?o:""},Bt=()=>window.location.origin+window.location.pathname,R="access-session",Nt=()=>{const o=window.location.pathname.split("/").filter(s=>!!s).join("-");return o?`${o}-`:""},Ct=()=>{const o=`${Nt()}${R}`,s=[];for(let t=0;t<localStorage.length;t++){const r=localStorage.key(t);!r||!r.endsWith(R)||r.slice(0,r.lastIndexOf(":"))!=="wi admin"&&(r.endsWith(`x-${R}`)||s.push(r))}const a=s.find(t=>t.endsWith(o))??s[0];if(!a)return"";try{const t=localStorage.getItem(a);if(!t||t==="undefined")return"";const r=JSON.parse(t);return r==null?"":String(r)}catch{return""}},J=Symbol("wi-chat-iframe-page-config"),$t=o=>{e.provide(J,o)},Z=(o,s)=>{const a=(s==null?void 0:s.mainUrl)!==void 0?String(e.toValue(s.mainUrl)):St(),t=(s==null?void 0:s.token)!==void 0?String(e.toValue(s.token)):Ct();return o.replace(/\{\{\s*MAIN_URL\s*\}\}/g,a).replace(/\{\{\s*SERVE_URL\s*\}\}/g,Bt()).replace(/\{\{\s*token\s*\}\}/g,t)},Q=o=>{const s=e.getCurrentInstance()?e.inject(J,{}):{},a=e.computed(()=>{var p;const r=e.toValue(o),c=((p=r==null?void 0:r.values)==null?void 0:p.url)??(r==null?void 0:r.url)??"";return c?s.resolveUrl?s.resolveUrl(c):Z(c,s):""}),t=e.computed(()=>{var c;const r=e.toValue(o);return((c=r==null?void 0:r.values)==null?void 0:c.srcdoc)??(r==null?void 0:r.srcdoc)??""});return{url:a,srcdoc:t}},K="data-wi-iframe-resizer-child",ee=o=>{if(!o)return!1;let s=null;try{s=o.contentDocument}catch{return!1}if(!s)return!1;const a=s.head||s.documentElement;if(!a)return!1;const t=s.defaultView;if(t!=null&&t.parentIframe||t!=null&&t.parentIFrame||s.querySelector(`script[${K}]`))return!1;const r=s.createElement("script");return r.textContent=N.IFRAME_RESIZER_CHILD_SCRIPT,r.setAttribute(K,""),a.appendChild(r),!0},It=e.defineComponent({__name:"IframePage",props:{report:{}},setup(o){const s=o,{url:a,srcdoc:t}=Q(()=>s.report),r=c=>{ee(c.target)};return(c,p)=>e.unref(a)?(e.openBlock(),e.createBlock(H,{key:0,class:"iframe-page__frame iframe-page__frame--url",license:"GPLv3",src:e.unref(a),width:"100%","warning-timeout":0,onLoad:r},null,8,["src"])):e.unref(t)?(e.openBlock(),e.createBlock(H,{key:1,class:"iframe-page iframe-page--srcdoc",license:"GPLv3",srcdoc:e.unref(t),width:"100%",frameborder:"no",border:"0",marginwidth:"0",marginheight:"0",scrolling:"no"},null,8,["srcdoc"])):e.createCommentVNode("",!0)}}),te=$(It,[["__scopeId","data-v-f4c94a4e"]]),xt=Object.freeze(Object.defineProperty({__proto__:null,default:te},Symbol.toStringTag,{value:"Module"})),q=o=>(e.pushScopeId("data-v-74053305"),o=o(),e.popScopeId(),o),Dt={class:"wi-clarify__header"},Ot={class:"wi-clarify__heading"},Tt=q(()=>e.createElementVNode("div",{class:"wi-clarify__eyebrow"},"需要补充信息",-1)),Pt={class:"wi-clarify__title"},Mt={key:0,class:"wi-clarify__desc"},Lt={class:"wi-clarify__status"},Ut={class:"wi-clarify__progress"},jt={class:"wi-clarify__progress-track"},At={key:0,class:"wi-clarify__panel"},Ft={class:"wi-clarify__question"},Rt={key:0,class:"wi-clarify__question-desc"},zt={key:1,class:"wi-clarify__binding"},qt={key:2,class:"wi-clarify__options"},Ht=["onClick"],Kt={class:"wi-clarify__option-indicator"},Xt={key:3,class:"wi-clarify__date"},Gt=["for"],Wt=["id","value"],Yt={class:"wi-clarify__text"},Jt={key:0,class:"wi-clarify__or"},Zt=q(()=>e.createElementVNode("span",null,"或者,用自己的话说明",-1)),Qt=[Zt],en=["for"],tn=["id","value","placeholder"],nn={class:"wi-clarify__dots","aria-label":"确认问题导航"},on=["aria-label","onClick"],rn={class:"wi-clarify__footer"},sn=q(()=>e.createElementVNode("span",{class:"wi-clarify__confirm-text"},"取消后本次操作将停止等待这些回答",-1)),ln={class:"wi-clarify__actions"},an={class:"wi-clarify__actions"},cn=["disabled"],un={key:1,class:"wi-clarify__result"},dn={class:"wi-clarify__result-icon"},pn={class:"wi-clarify__result-body"},_n={key:0,class:"wi-clarify__summary"},fn={key:1},mn={key:2},vn={key:2,class:"wi-clarify__feedback"},wn=e.defineComponent({__name:"ClarificationCard",props:{report:{}},setup(o){const s=o,a={requestId:"",title:"需要补充信息",description:"",items:[],status:"expired",resultMessage:"本次补充信息已失效(回答已结束)"},t=e.computed(()=>s.report.values??a),r=e.computed(()=>t.value.items??[]),c=e.ref(0),p=e.reactive({}),h=e.ref(!1),v=e.ref(""),w=()=>{Object.keys(p).forEach(n=>delete p[n]),r.value.forEach(n=>{const l={structuredValue:void 0,structuredValues:[],textValue:""};n.default!==void 0&&(n.input.type==="multi_select"?l.structuredValues=Array.isArray(n.default)?[...n.default]:[]:n.input.type==="text"?l.textValue=String(n.default):l.structuredValue=n.default),p[n.id]=l}),c.value=0};e.watch(()=>{var n;return(n=t.value)==null?void 0:n.requestId},w,{immediate:!0});const u=n=>(p[n]||(p[n]={structuredValue:void 0,structuredValues:[],textValue:""}),p[n]),f=e.computed(()=>{var n,l,d;return((n=t.value)==null?void 0:n.status)==="submitted"?"已提交":((l=t.value)==null?void 0:l.status)==="cancelled"?"已取消":((d=t.value)==null?void 0:d.status)==="expired"?"已失效":"等待回答"}),y=n=>{try{const l=JSON.stringify(n);return l===void 0?String(n):l}catch{return String(n)}},V=(n,l)=>y(n)===y(l),S=(n,l)=>{const d=u(n.id);return n.input.type==="multi_select"?d.structuredValues.some(m=>V(m,l)):V(d.structuredValue,l)},I=(n,l)=>{const d=u(n.id);if(d.textValue="",n.input.type==="multi_select"){const m=d.structuredValues.findIndex(B=>V(B,l));m>=0?d.structuredValues.splice(m,1):d.structuredValues.push(l);return}d.structuredValue=l},k=n=>{var l;return((l=n.target)==null?void 0:l.value)??""},g=(n,l)=>{const d=u(n.id);d.textValue=k(l),n.input.type!=="text"&&(d.structuredValue=void 0,d.structuredValues.splice(0))},P=(n,l)=>{const d=u(n.id);d.structuredValue=k(l),d.textValue=""},M=n=>{const l=u(n.id).structuredValue;return l==null?"":String(l)},O=n=>{var l;return((l=n.input.textInput)==null?void 0:l.placeholder)??n.input.placeholder??(n.input.type==="text"?"请输入需要补充的信息":"例如:使用阀门,或者说明你的具体要求")},i=n=>{const l=n.binding;if(!l)return"";const d=l.actionName?`动作:${l.actionName}`:"",m=l.parameterPath?`参数:${l.parameterPath}`:"";return[d,m].filter(Boolean).join(" · ")},E=n=>{const l=u(n.id);return n.input.type==="multi_select"?l.structuredValues.length>0:n.input.type==="single_select"?l.structuredValue!==void 0:n.input.type==="date"?!!l.structuredValue:!1},b=n=>!!u(n.id).textValue.trim()||E(n),L=n=>!n.required||b(n)?!0:(v.value=`请回答“${n.question}”`,!1),x=()=>{v.value="",c.value=Math.max(0,c.value-1)},C=()=>{!_.value||!L(_.value)||(v.value="",c.value=Math.min(r.value.length-1,c.value+1))},_=e.computed(()=>r.value[c.value]),U=(n,l)=>n.input.type==="date"?String(l??""):(Array.isArray(l)?l:[l]).map(m=>{var A;const B=(A=n.input.options)==null?void 0:A.find(ce=>V(ce.value,m));return(B==null?void 0:B.label)??String(m??"")}).filter(Boolean).join("、"),j=n=>{const l=u(n.id),d=l.textValue.trim();if(n.input.type==="text"||d||!E(n))return{id:n.id,mode:"text",value:d,displayText:d};const m=n.input.type==="multi_select"?[...l.structuredValues]:l.structuredValue;return{id:n.id,mode:"structured",value:m,displayText:U(n,m)}},se=()=>{const n=r.value.findIndex(d=>d.required&&!b(d));if(n>=0){c.value=n,v.value=`请回答“${r.value[n].question}”`;return}v.value="";const l=r.value.map(j);N.submitClarification(t.value.requestId,l)||(v.value="本次补充信息已经处理")},le=()=>{h.value=!1,v.value="",N.cancelClarification(t.value.requestId)||(v.value="本次补充信息已经处理")},ae=n=>{var l;return((l=r.value.find(d=>d.id===n))==null?void 0:l.question)??n};return(n,l)=>{var d;return e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["wi-clarify",`is-${t.value.status}`])},[e.createElementVNode("header",Dt,[e.createElementVNode("div",Ot,[Tt,e.createElementVNode("h3",Pt,e.toDisplayString(t.value.title),1),t.value.description?(e.openBlock(),e.createElementBlock("p",Mt,e.toDisplayString(t.value.description),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Lt,e.toDisplayString(f.value),1)]),t.value.status==="pending"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Ut,[e.createElementVNode("span",null,"问题 "+e.toDisplayString(c.value+1)+" / "+e.toDisplayString(r.value.length),1),e.createElementVNode("div",jt,[e.createElementVNode("span",{style:e.normalizeStyle({width:`${(c.value+1)/r.value.length*100}%`})},null,4)])]),_.value?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("div",Ft,[e.createElementVNode("span",{class:e.normalizeClass(_.value.required?"wi-clarify__required":"wi-clarify__optional")},e.toDisplayString(_.value.required?"必填":"选填"),3),e.createElementVNode("h4",null,e.toDisplayString(_.value.question),1)]),_.value.description?(e.openBlock(),e.createElementBlock("p",Rt,e.toDisplayString(_.value.description),1)):e.createCommentVNode("",!0),i(_.value)?(e.openBlock(),e.createElementBlock("div",zt,e.toDisplayString(i(_.value)),1)):e.createCommentVNode("",!0),_.value.input.type==="single_select"||_.value.input.type==="multi_select"?(e.openBlock(),e.createElementBlock("div",qt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value.input.options,(m,B)=>(e.openBlock(),e.createElementBlock("button",{key:B,type:"button",class:e.normalizeClass(["wi-clarify__option",{"is-selected":S(_.value,m.value)}]),onClick:A=>I(_.value,m.value)},[e.createElementVNode("span",Kt,e.toDisplayString(S(_.value,m.value)?"✓":""),1),e.createElementVNode("span",null,e.toDisplayString(m.label),1)],10,Ht))),128))])):_.value.input.type==="date"?(e.openBlock(),e.createElementBlock("div",Xt,[e.createElementVNode("label",{for:`wi-clarify-date-${_.value.id}`},"选择日期",8,Gt),e.createElementVNode("input",{id:`wi-clarify-date-${_.value.id}`,type:"date",value:M(_.value),onInput:l[0]||(l[0]=m=>P(_.value,m))},null,40,Wt)])):e.createCommentVNode("",!0),e.createElementVNode("div",Yt,[_.value.input.type!=="text"?(e.openBlock(),e.createElementBlock("div",Jt,Qt)):e.createCommentVNode("",!0),e.createElementVNode("label",{for:`wi-clarify-text-${_.value.id}`},e.toDisplayString(_.value.input.type==="text"?"你的回答":"自然语言回答"),9,en),e.createElementVNode("textarea",{id:`wi-clarify-text-${_.value.id}`,value:u(_.value.id).textValue,placeholder:O(_.value),rows:"3",onInput:l[1]||(l[1]=m=>g(_.value,m))},null,40,tn)])])):e.createCommentVNode("",!0),e.createElementVNode("div",nn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(m,B)=>(e.openBlock(),e.createElementBlock("button",{key:m.id,type:"button","aria-label":`查看第 ${B+1} 个问题`,class:e.normalizeClass({"is-active":B===c.value,"is-answered":b(m)}),onClick:A=>c.value=B},null,10,on))),128))]),e.createElementVNode("footer",rn,[h.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[sn,e.createElementVNode("div",ln,[e.createElementVNode("button",{type:"button",class:"wi-clarify__btn wi-clarify__btn--secondary",onClick:l[2]||(l[2]=m=>h.value=!1)}," 继续填写 "),e.createElementVNode("button",{type:"button",class:"wi-clarify__btn wi-clarify__btn--danger",onClick:le},"确认取消")])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{type:"button",class:"wi-clarify__cancel",onClick:l[3]||(l[3]=m=>h.value=!0)},"取消"),e.createElementVNode("div",an,[e.createElementVNode("button",{type:"button",class:"wi-clarify__btn wi-clarify__btn--secondary",disabled:c.value===0,onClick:x}," 上一项 ",8,cn),c.value<r.value.length-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"wi-clarify__btn wi-clarify__btn--primary",onClick:C}," 下一项 ")):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"wi-clarify__btn wi-clarify__btn--primary",onClick:se},"提交全部"))])],64))])],64)):(e.openBlock(),e.createElementBlock("div",un,[e.createElementVNode("div",dn,e.toDisplayString(t.value.status==="submitted"?"✓":t.value.status==="cancelled"?"—":"!"),1),e.createElementVNode("div",pn,[e.createElementVNode("h4",null,e.toDisplayString(t.value.resultMessage||f.value),1),t.value.status==="submitted"&&((d=t.value.answers)!=null&&d.length)?(e.openBlock(),e.createElementBlock("div",_n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.answers,m=>(e.openBlock(),e.createElementBlock("div",{key:m.id},[e.createElementVNode("span",null,e.toDisplayString(ae(m.id)),1),e.createElementVNode("strong",null,e.toDisplayString(m.displayText||"未填写"),1)]))),128))])):t.value.status==="cancelled"?(e.openBlock(),e.createElementBlock("p",fn,"本次确认未提交,工作流将收到取消结果。")):(e.openBlock(),e.createElementBlock("p",mn,"该确认项已失效,无法再提交。"))])])),v.value?(e.openBlock(),e.createElementBlock("div",vn,e.toDisplayString(v.value),1)):e.createCommentVNode("",!0)],2)}}}),ne=$(wn,[["__scopeId","data-v-74053305"]]),yn=Object.freeze(Object.defineProperty({__proto__:null,default:ne},Symbol.toStringTag,{value:"Module"})),oe=o=>(e.pushScopeId("data-v-bb5c9850"),o=o(),e.popScopeId(),o),kn={class:"wi-host-action__head"},hn={class:"wi-host-action__icon","aria-hidden":"true"},gn={class:"wi-host-action__title"},En=oe(()=>e.createElementVNode("span",{class:"wi-host-action__label"},"执行操作",-1)),bn={class:"wi-host-action__name"},Vn={class:"wi-host-action__chip"},Sn={class:"wi-host-action__message"},Bn={key:0,class:"wi-host-action__args"},Nn=oe(()=>e.createElementVNode("summary",null,"查看参数",-1)),Cn=e.defineComponent({__name:"HostActionStatus",props:{report:{}},setup(o){const s=o,a={id:"",name:"",arguments:{},status:"unknown",message:"执行状态未知(回答已结束)"},t=e.computed(()=>s.report.values??a),r=e.computed(()=>t.value.status==="running"?"●":t.value.status==="success"?"✓":t.value.status==="error"?"!":"?"),c=e.computed(()=>t.value.status==="running"?"执行中":t.value.status==="success"?"已完成":t.value.status==="error"?"执行失败":"状态未知"),p=e.computed(()=>{const v=t.value.arguments;return!!v&&typeof v=="object"&&Object.keys(v).length>0}),h=e.computed(()=>JSON.stringify(t.value.arguments??{},null,2));return(v,w)=>(e.openBlock(),e.createElementBlock("section",{class:e.normalizeClass(["wi-host-action",`is-${t.value.status}`])},[e.createElementVNode("header",kn,[e.createElementVNode("span",hn,e.toDisplayString(r.value),1),e.createElementVNode("div",gn,[En,e.createElementVNode("code",bn,e.toDisplayString(t.value.name||"未知操作"),1)]),e.createElementVNode("span",Vn,e.toDisplayString(c.value),1)]),e.createElementVNode("p",Sn,e.toDisplayString(t.value.message||c.value),1),p.value?(e.openBlock(),e.createElementBlock("details",Bn,[Nn,e.createElementVNode("pre",null,e.toDisplayString(h.value),1)])):e.createCommentVNode("",!0)],2))}}),re=$(Cn,[["__scopeId","data-v-bb5c9850"]]),$n=Object.freeze(Object.defineProperty({__proto__:null,default:re},Symbol.toStringTag,{value:"Module"}));exports.AiAnswerBubble=he;exports.ClarificationCard=ne;exports.DeepThinkingSteps=Ie;exports.HostActionStatus=re;exports.IframePage=te;exports.KnowledgeStreamResult=G;exports.OutputFile=Y;exports.createAnswerContentMap=X;exports.injectIframeResizerChild=ee;exports.provideIframePageConfig=$t;exports.provideOutputFileConfig=Pe;exports.resolveIframePlaceholders=Z;exports.useIframePage=Q;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -11,4 +11,4 @@ export { default as IframePage } from './iframePage/IframePage.vue';
11
11
  export { injectIframeResizerChild, provideIframePageConfig, resolveIframePlaceholders, useIframePage } from './iframePage/useIframePage';
12
12
  export type { IframePageConfig, UseIframePageReturn } from './iframePage/useIframePage';
13
13
  export { default as ClarificationCard } from './clarification/ClarificationCard.vue';
14
- export { default as AgentActionStatus } from './agentAction/AgentActionStatus.vue';
14
+ export { default as HostActionStatus } from './hostAction/HostActionStatus.vue';