| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- var Ue=Object.defineProperty;var Ge=(c,e,t)=>e in c?Ue(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t;var w=(c,e,t)=>Ge(c,typeof e!="symbol"?e+"":e,t);import{_ as T,o as _,d as $,e as k,c as Q,f as C,h as A,l as Ve,m as P,g as L,w as Z,F as Xe,n as Ke,p as ee,r as S,q as ae,s as ze,k as Je,v as Ye,x as Ae,y as et,u as tt,i as nt}from"./index-CV-b1sqb.js";import{L as st}from"./LayoutExperience-Di0ppgmQ.js";import{C as it}from"./ContentContainer-BHCaXtzf.js";import{C as ot}from"./ChatAsideMenu-BvUkIqqv.js";import{j as Ie,a as xe}from"./utils-nRFFHnCp.js";import{u as rt}from"./use-all-agents-XeaNTQ9D.js";import"./Header-BJnGagkP.js";import"./Header.vue_vue_type_style_index_0_scoped_0b4b82f2_lang-CmyFc8-Z.js";import"./use-current-user-eSXbuPAj.js";/* empty css */const lt={},at={class:"dialog-aside-left"};function ct(c,e){return _(),$("div",at,e[0]||(e[0]=[k("div",null,"对话左侧边栏",-1)]))}const ut=T(lt,[["render",ct],["__scopeId","data-v-76fa4cd7"]]),ht={},pt={class:"dialog-header"};function dt(c,e){return _(),$("div",pt,e[0]||(e[0]=[k("div",null,"对话顶部",-1)]))}const ft=T(ht,[["render",dt],["__scopeId","data-v-6d289eea"]]),gt={class:"dialog-welcome-content"},_t={__name:"DialogWelcome",props:{suggestion:Object},setup(c){return(e,t)=>(_(),$("div",gt,t[0]||(t[0]=[k("div",null,"对话欢迎内容:欢迎内容应该按照agent进行配置,最好是从后端进行返回",-1)])))}},mt=T(_t,[["__scopeId","data-v-d67ff057"]]),kt={class:"dialog-item-select question-select"},bt={__name:"BtnSelectItem",props:{is_selected:Boolean},emits:["change"],setup(c,{emit:e}){return(t,n)=>(_(),$("div",kt))}},qe=T(bt,[["__scopeId","data-v-b88b55f4"]]),xt={class:"dialog-chat-answer-content"},wt={key:0},yt=["innerHTML"],$t={__name:"DialogContent",props:{type:String,content:String,is_loading:Boolean},setup(c){return(e,t)=>{const n=Q("a-spin");return _(),$("div",xt,[c.is_loading?(_(),$("div",wt,[C(n)])):A("",!0),c.is_loading?A("",!0):(_(),$("div",{key:1,innerHTML:c.content},null,8,yt)),Ve(e.$slots,"default",{},void 0,!0)])}}},Le=T($t,[["__scopeId","data-v-0ebd5503"]]),vt={class:"dialog-item dialog-question"},St={class:"dialog-main question-main"},Rt={class:"dialog-content question-content"},Ct={__name:"DialogQuestion",props:{show_select:!0,question:Object},setup(c){const e=c,t=P(()=>e.show_select===!0),n=()=>{};return(i,s)=>(_(),$("div",vt,[t.value?(_(),L(qe,{key:0,onChange:n})):A("",!0),k("div",St,[k("div",Rt,[k("div",null,[C(Le,{content:c.question.content},null,8,["content"])])]),s[0]||(s[0]=k("div",{class:"dialog-icon question-icon"},null,-1))])]))}},Tt=T(Ct,[["__scopeId","data-v-725008a0"]]),zt={class:"dialog-actions-container"},At={__name:"DialogActions",emits:["copy","retry","share"],setup(c,{emit:e}){const t=e,n=()=>{t("copy")},i=()=>{t("retry")},s=()=>{t("share")},o=()=>{},r=()=>{};return(u,l)=>(_(),$("div",zt,[k("div",{class:"dialog-action-part dialog-action-left"},[k("div",{class:"action-btn-item",onClick:n},"复制"),k("div",{class:"action-btn-item",onClick:i},"再试一次"),k("div",{class:"action-btn-item",onClick:s},"分享")]),k("div",{class:"dialog-action-part dialog-action-right"},[k("div",{class:"action-btn-item",onClick:o},"赞"),k("div",{class:"action-btn-item",onClick:r},"踩")])]))}},It=T(At,[["__scopeId","data-v-3e5fc44a"]]),qt={__name:"BtnStopChat",emits:["stop"],setup(c,{emit:e}){const t=e,n=()=>{t("stop")};return(i,s)=>(_(),$("div",{onClick:n},"停止生成"))}};function ce(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let W=ce();function Be(c){W=c}const X={exec:()=>null};function x(c,e=""){let t=typeof c=="string"?c:c.source;const n={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(z.caret,"$1"),t=t.replace(i,o),n},getRegex:()=>new RegExp(t,e)};return n}const z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:c=>new RegExp(`^( {0,3}${c})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:c=>new RegExp(`^ {0,${Math.min(3,c-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:c=>new RegExp(`^ {0,${Math.min(3,c-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:c=>new RegExp(`^ {0,${Math.min(3,c-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:c=>new RegExp(`^ {0,${Math.min(3,c-1)}}#`),htmlBeginRegex:c=>new RegExp(`^ {0,${Math.min(3,c-1)}}<(?:[a-z].*>|!--)`,"i")},Lt=/^(?:[ \t]*(?:\n|$))+/,Bt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Et=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,J=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Dt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ee=/(?:[*+-]|\d{1,9}[.)])/,De=x(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ue=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Pt=/^[^\n]+/,he=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Mt=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",he).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Nt=x(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ee).getRegex(),ie="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,jt=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",pe).replace("tag",ie).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pe=x(ue).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),Ft=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pe).getRegex(),de={blockquote:Ft,code:Bt,def:Mt,fences:Et,heading:Dt,hr:J,html:jt,lheading:De,list:Nt,newline:Lt,paragraph:Pe,table:X,text:Pt},we=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex(),Zt={...de,table:we,paragraph:x(ue).replace("hr",J).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",we).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ie).getRegex()},Ot={...de,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(ue).replace("hr",J).replace("heading",` *#{1,6} *[^
- ]`).replace("lheading",De).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Me=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ne=/^( {2,}|\\)\n(?!\s*$)/,Ht=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,oe=/[\p{P}\p{S}]/u,fe=/[\s\p{P}\p{S}]/u,je=/[^\s\p{P}\p{S}]/u,Qt=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,fe).getRegex(),Ut=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Gt=x(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,oe).getRegex(),Vt=x("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,je).replace(/punctSpace/g,fe).replace(/punct/g,oe).getRegex(),Xt=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,je).replace(/punctSpace/g,fe).replace(/punct/g,oe).getRegex(),Kt=x(/\\(punct)/,"gu").replace(/punct/g,oe).getRegex(),Jt=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Yt=x(pe).replace("(?:-->|$)","-->").getRegex(),en=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Yt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),te=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,tn=x(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fe=x(/^!?\[(label)\]\[(ref)\]/).replace("label",te).replace("ref",he).getRegex(),Ze=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",he).getRegex(),nn=x("reflink|nolink(?!\\()","g").replace("reflink",Fe).replace("nolink",Ze).getRegex(),ge={_backpedal:X,anyPunctuation:Kt,autolink:Jt,blockSkip:Ut,br:Ne,code:Wt,del:X,emStrongLDelim:Gt,emStrongRDelimAst:Vt,emStrongRDelimUnd:Xt,escape:Me,link:tn,nolink:Ze,punctuation:Qt,reflink:Fe,reflinkSearch:nn,tag:en,text:Ht,url:X},sn={...ge,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",te).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te).getRegex()},le={...ge,escape:x(Me).replace("])","~|])").getRegex(),url:x(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},on={...le,br:x(Ne).replace("{2,}","*").getRegex(),text:x(le.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Y={normal:de,gfm:Zt,pedantic:Ot},G={normal:ge,gfm:le,breaks:on,pedantic:sn},rn={"&":"&","<":"<",">":">",'"':""","'":"'"},ye=c=>rn[c];function D(c,e){if(e){if(z.escapeTest.test(c))return c.replace(z.escapeReplace,ye)}else if(z.escapeTestNoEncode.test(c))return c.replace(z.escapeReplaceNoEncode,ye);return c}function $e(c){try{c=encodeURI(c).replace(z.percentDecode,"%")}catch{return null}return c}function ve(c,e){var s;const t=c.replace(z.findPipe,(o,r,u)=>{let l=!1,a=r;for(;--a>=0&&u[a]==="\\";)l=!l;return l?"|":" |"}),n=t.split(z.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(z.slashPipe,"|");return n}function V(c,e,t){const n=c.length;if(n===0)return"";let i=0;for(;i<n;){const s=c.charAt(n-i-1);if(s===e&&!t)i++;else if(s!==e&&t)i++;else break}return c.slice(0,n-i)}function ln(c,e){if(c.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<c.length;n++)if(c[n]==="\\")n++;else if(c[n]===e[0])t++;else if(c[n]===e[1]&&(t--,t<0))return n;return-1}function Se(c,e,t,n,i){const s=e.href,o=e.title||null,r=c[1].replace(i.other.outputLinkReplace,"$1");if(c[0].charAt(0)!=="!"){n.state.inLink=!0;const u={type:"link",raw:t,href:s,title:o,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,u}return{type:"image",raw:t,href:s,title:o,text:r}}function an(c,e,t){const n=c.match(t.other.indentCodeCompensation);if(n===null)return e;const i=n[1];return e.split(`
- `).map(s=>{const o=s.match(t.other.beginningSpace);if(o===null)return s;const[r]=o;return r.length>=i.length?s.slice(i.length):s}).join(`
- `)}class ne{constructor(e){w(this,"options");w(this,"rules");w(this,"lexer");this.options=e||W}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:V(n,`
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=an(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const i=V(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:V(t[0],`
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=V(t[0],`
- `).split(`
- `),i="",s="";const o=[];for(;n.length>0;){let r=!1;const u=[];let l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))u.push(n[l]),r=!0;else if(!r)u.push(n[l]);else break;n=n.slice(l);const a=u.join(`
- `),p=a.replace(this.rules.other.blockquoteSetextReplace,`
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
- ${a}`:a,s=s?`${s}
- ${p}`:p;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=h,n.length===0)break;const d=o.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){const f=d,g=f.raw+`
- `+n.join(`
- `),m=this.blockquote(g);o[o.length-1]=m,i=i.substring(0,i.length-f.raw.length)+m.raw,s=s.substring(0,s.length-f.text.length)+m.text;break}else if((d==null?void 0:d.type)==="list"){const f=d,g=f.raw+`
- `+n.join(`
- `),m=this.list(g);o[o.length-1]=m,i=i.substring(0,i.length-d.raw.length)+m.raw,s=s.substring(0,s.length-f.raw.length)+m.raw,n=g.substring(o.at(-1).raw.length).split(`
- `);continue}}return{type:"blockquote",raw:i,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let r=!1;for(;e;){let l=!1,a="",p="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let h=t[2].split(`
- `,1)[0].replace(this.rules.other.listReplaceTabs,N=>" ".repeat(3*N.length)),d=e.split(`
- `,1)[0],f=!h.trim(),g=0;if(this.options.pedantic?(g=2,p=h.trimStart()):f?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=h.slice(g),g+=t[1].length),f&&this.rules.other.blankLine.test(d)&&(a+=d+`
- `,e=e.substring(d.length+1),l=!0),!l){const N=this.rules.other.nextBulletRegex(g),y=this.rules.other.hrRegex(g),R=this.rules.other.fencesBeginRegex(g),M=this.rules.other.headingBeginRegex(g),H=this.rules.other.htmlBeginRegex(g);for(;e;){const U=e.split(`
- `,1)[0];let j;if(d=U,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),j=d):j=d.replace(this.rules.other.tabCharGlobal," "),R.test(d)||M.test(d)||H.test(d)||N.test(d)||y.test(d))break;if(j.search(this.rules.other.nonSpaceChar)>=g||!d.trim())p+=`
- `+j.slice(g);else{if(f||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(h)||M.test(h)||y.test(h))break;p+=`
- `+d}!f&&!d.trim()&&(f=!0),a+=U+`
- `,e=e.substring(U.length+1),h=j.slice(g)}}s.loose||(r?s.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(r=!0));let m=null,B;this.options.gfm&&(m=this.rules.other.listIsTask.exec(p),m&&(B=m[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:a,task:!!m,checked:B,loose:!1,text:p,tokens:[]}),s.raw+=a}const u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const a=s.items[l].tokens.filter(h=>h.type==="space"),p=a.length>0&&a.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=p}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:s}}}table(e){var r;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=ve(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(r=t[3])!=null&&r.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const u of i)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<n.length;u++)o.header.push({text:n[u],tokens:this.lexer.inline(n[u]),header:!0,align:o.align[u]});for(const u of s)o.rows.push(ve(u,o.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[a]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=V(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=ln(t[2],"()");if(o>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),Se(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Se(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...i[0]].length-1;let r,u,l=o,a=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+o);(i=p.exec(t))!=null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(u=[...r].length,i[3]||i[4]){l+=u;continue}else if((i[5]||i[6])&&o%3&&!((o+u)%3)){a+=u;continue}if(l-=u,l>0)continue;u=Math.min(u,u+l+a);const h=[...i[0]][0].length,d=e.slice(0,o+i.index+h+u);if(Math.min(o,u)%2){const g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}const f=d.slice(2,-2);return{type:"strong",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,s;if(t[2]==="@")i=t[0],s="mailto:"+i;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);i=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class I{constructor(e){w(this,"tokens");w(this,"options");w(this,"state");w(this,"tokenizer");w(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||W,this.options.tokenizer=this.options.tokenizer||new ne,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:z,block:Y.normal,inline:G.normal};this.options.pedantic?(t.block=Y.pedantic,t.inline=G.pedantic):this.options.gfm&&(t.block=Y.gfm,this.options.breaks?t.inline=G.breaks:t.inline=G.gfm),this.tokenizer.rules=t}static get rules(){return{block:Y,inline:G}}static lex(e,t){return new I(t).lex(e)}static lexInline(e,t){return new I(t).inlineTokens(e)}lex(e){e=e.replace(z.carriageReturn,`
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var i,s,o;for(this.options.pedantic&&(e=e.replace(z.tabCharGlobal," ").replace(z.spaceLine,""));e;){let r;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(l=>(r=l.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const l=t.at(-1);r.raw.length===1&&l!==void 0?l.raw+=`
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const l=t.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=`
- `+r.raw,l.text+=`
- `+r.text,this.inlineQueue.at(-1).src=l.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const l=t.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=`
- `+r.raw,l.text+=`
- `+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let u=e;if((o=this.options.extensions)!=null&&o.startBlock){let l=1/0;const a=e.slice(1);let p;this.options.extensions.startBlock.forEach(h=>{p=h.call({lexer:this},a),typeof p=="number"&&p>=0&&(l=Math.min(l,p))}),l<1/0&&l>=0&&(u=e.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(u))){const l=t.at(-1);n&&(l==null?void 0:l.type)==="paragraph"?(l.raw+=`
- `+r.raw,l.text+=`
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(r),n=u.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const l=t.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=`
- `+r.raw,l.text+=`
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(r);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var r,u,l;let n=e,i=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)a.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let a;if((u=(r=this.options.extensions)==null?void 0:r.inline)!=null&&u.some(h=>(a=h.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const h=t.at(-1);a.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=a.raw,h.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,n,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let p=e;if((l=this.options.extensions)!=null&&l.startInline){let h=1/0;const d=e.slice(1);let f;this.options.extensions.startInline.forEach(g=>{f=g.call({lexer:this},d),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(p=e.substring(0,h+1))}if(a=this.tokenizer.inlineText(p)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),s=!0;const h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=a.raw,h.text+=a.text):t.push(a);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class se{constructor(e){w(this,"options");w(this,"parser");this.options=e||W}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const i=(o=(t||"").match(z.notSpaceStart))==null?void 0:o[0],s=e.replace(z.endingNewline,"")+`
- `;return i?'<pre><code class="language-'+D(i)+'">'+(n?s:D(s,!0))+`</code></pre>
- `:"<pre><code>"+(n?s:D(s,!0))+`</code></pre>
- `}blockquote({tokens:e}){return`<blockquote>
- ${this.parser.parse(e)}</blockquote>
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
- `}hr(e){return`<hr>
- `}list(e){const t=e.ordered,n=e.start;let i="";for(let r=0;r<e.items.length;r++){const u=e.items[r];i+=this.listitem(u)}const s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
- `+i+"</"+s+`>
- `}listitem(e){var n;let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+D(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
- `}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let i="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];n="";for(let r=0;r<o.length;r++)n+=this.tablecell(o[r]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
- <thead>
- `+t+`</thead>
- `+i+`</table>
- `}tablerow({text:e}){return`<tr>
- ${e}</tr>
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${D(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),s=$e(e);if(s===null)return i;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+D(t)+'"'),o+=">"+i+"</a>",o}image({href:e,title:t,text:n}){const i=$e(e);if(i===null)return D(n);e=i;let s=`<img src="${e}" alt="${n}"`;return t&&(s+=` title="${D(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:D(e.text)}}class _e{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class q{constructor(e){w(this,"options");w(this,"renderer");w(this,"textRenderer");this.options=e||W,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _e}static parse(e,t){return new q(t).parse(e)}static parseInline(e,t){return new q(t).parseInline(e)}parse(e,t=!0){var i,s;let n="";for(let o=0;o<e.length;o++){const r=e[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[r.type]){const l=r,a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){n+=a||"";continue}}const u=r;switch(u.type){case"space":{n+=this.renderer.space(u);continue}case"hr":{n+=this.renderer.hr(u);continue}case"heading":{n+=this.renderer.heading(u);continue}case"code":{n+=this.renderer.code(u);continue}case"table":{n+=this.renderer.table(u);continue}case"blockquote":{n+=this.renderer.blockquote(u);continue}case"list":{n+=this.renderer.list(u);continue}case"html":{n+=this.renderer.html(u);continue}case"paragraph":{n+=this.renderer.paragraph(u);continue}case"text":{let l=u,a=this.renderer.text(l);for(;o+1<e.length&&e[o+1].type==="text";)l=e[++o],a+=`
- `+this.renderer.text(l);t?n+=this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):n+=a;continue}default:{const l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,t=this.renderer){var i,s;let n="";for(let o=0;o<e.length;o++){const r=e[o];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[r.type]){const l=this.options.extensions.renderers[r.type].call({parser:this},r);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=l||"";continue}}const u=r;switch(u.type){case"escape":{n+=t.text(u);break}case"html":{n+=t.html(u);break}case"link":{n+=t.link(u);break}case"image":{n+=t.image(u);break}case"strong":{n+=t.strong(u);break}case"em":{n+=t.em(u);break}case"codespan":{n+=t.codespan(u);break}case"br":{n+=t.br(u);break}case"del":{n+=t.del(u);break}case"text":{n+=t.text(u);break}default:{const l='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}}class K{constructor(e){w(this,"options");w(this,"block");this.options=e||W}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?I.lex:I.lexInline}provideParser(){return this.block?q.parse:q.parseInline}}w(K,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Oe{constructor(...e){w(this,"defaults",ce());w(this,"options",this.setOptions);w(this,"parse",this.parseMarkdown(!0));w(this,"parseInline",this.parseMarkdown(!1));w(this,"Parser",q);w(this,"Renderer",se);w(this,"TextRenderer",_e);w(this,"Lexer",I);w(this,"Tokenizer",ne);w(this,"Hooks",K);this.use(...e)}walkTokens(e,t){var i,s;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const r=o;for(const u of r.header)n=n.concat(this.walkTokens(u.tokens,t));for(const u of r.rows)for(const l of u)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{const r=o;n=n.concat(this.walkTokens(r.items,t));break}default:{const r=o;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[r.type]?this.defaults.extensions.childTokens[r.type].forEach(u=>{const l=r[u].flat(1/0);n=n.concat(this.walkTokens(l,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...r){let u=s.renderer.apply(this,r);return u===!1&&(u=o.apply(this,r)),u}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),n.renderer){const s=this.defaults.renderer||new se(this.defaults);for(const o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const r=o,u=n.renderer[r],l=s[r];s[r]=(...a)=>{let p=u.apply(s,a);return p===!1&&(p=l.apply(s,a)),p||""}}i.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new ne(this.defaults);for(const o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const r=o,u=n.tokenizer[r],l=s[r];s[r]=(...a)=>{let p=u.apply(s,a);return p===!1&&(p=l.apply(s,a)),p}}i.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new K;for(const o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const r=o,u=n.hooks[r],l=s[r];K.passThroughHooks.has(o)?s[r]=a=>{if(this.defaults.async)return Promise.resolve(u.call(s,a)).then(h=>l.call(s,h));const p=u.call(s,a);return l.call(s,p)}:s[r]=(...a)=>{let p=u.apply(s,a);return p===!1&&(p=l.apply(s,a)),p}}i.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,o=n.walkTokens;i.walkTokens=function(r){let u=[];return u.push(o.call(this,r)),s&&(u=u.concat(s.call(this,r))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return I.lex(e,t??this.defaults)}parser(e,t){return q.parse(e,t??this.defaults)}parseMarkdown(e){return(n,i)=>{const s={...i},o={...this.defaults,...s},r=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const u=o.hooks?o.hooks.provideLexer():e?I.lex:I.lexInline,l=o.hooks?o.hooks.provideParser():e?q.parse:q.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(a=>u(a,o)).then(a=>o.hooks?o.hooks.processAllTokens(a):a).then(a=>o.walkTokens?Promise.all(this.walkTokens(a,o.walkTokens)).then(()=>a):a).then(a=>l(a,o)).then(a=>o.hooks?o.hooks.postprocess(a):a).catch(r);try{o.hooks&&(n=o.hooks.preprocess(n));let a=u(n,o);o.hooks&&(a=o.hooks.processAllTokens(a)),o.walkTokens&&this.walkTokens(a,o.walkTokens);let p=l(a,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(a){return r(a)}}}onError(e,t){return n=>{if(n.message+=`
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+D(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const O=new Oe;function b(c,e){return O.parse(c,e)}b.options=b.setOptions=function(c){return O.setOptions(c),b.defaults=O.defaults,Be(b.defaults),b};b.getDefaults=ce;b.defaults=W;b.use=function(...c){return O.use(...c),b.defaults=O.defaults,Be(b.defaults),b};b.walkTokens=function(c,e){return O.walkTokens(c,e)};b.parseInline=O.parseInline;b.Parser=q;b.parser=q.parse;b.Renderer=se;b.TextRenderer=_e;b.Lexer=I;b.lexer=I.lex;b.Tokenizer=ne;b.Hooks=K;b.parse=b;b.options;b.setOptions;b.use;b.walkTokens;b.parseInline;q.parse;I.lex;const cn=new Oe,un="refference-flag",hn=c=>c.replace(/##\d\$\$/g,' <span class="circle"></span>');function pn(c){if(!c)return"";let e=hn(c);c.indexOf("![]")<0;var i=cn.parse(e).replace("<a href=",'<a target="_blank" href=').replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi,function(u,l){const a=document.createElement("div");a.innerHTML=u;const p=a.querySelector("img"),h=p.src,d=p.alt;return`<span class="xiaoshuhuitu-image-container" data-src="${h}" data-alt="${d}"></span>`});const s=/<span class="circle" data-list-index="\d"><\/span>/g;let o=0;return i.replaceAll(s,function(u,l,a,p){let h=u.replace("></span>",`data-flag-index="${o}"></span>`);return h=h.replace('class="circle"',`class="refflag-refflag-refflag ${un}"`),o++,h})}const dn={class:"dialog-item dialog-anwser"},fn={class:"dialog-main answer-main"},gn={class:"dialog-content answer-content"},_n={__name:"DialogAnswer",props:{show_select:!0,answer:Object},emits:["stop","retry","select"],setup(c,{emit:e}){const t=c,n=e,i=P(()=>t.show_select===!0),s=P(()=>t.answer.client_custom_chat_status),o=P(()=>s.value===0),r=P(()=>{const d=t.answer.content;console.log(d,"str::str");const f=pn(d);return console.log(f,"answer_string::answer_string"),f}),u=()=>{n("select")},l=()=>{n("stop")},a=()=>{},p=()=>{},h=()=>{n("retry")};return(d,f)=>(_(),$("div",dn,[i.value?(_(),L(qe,{key:0,onChange:u})):A("",!0),k("div",fn,[f[0]||(f[0]=k("div",{class:"dialog-icon answer-icon"},null,-1)),k("div",gn,[k("div",null,[C(Le,{content:r.value,is_loading:o.value},{default:Z(()=>[s.value===2?(_(),L(It,{key:0,class:"answer-actions-btns",onCopy:a,onShare:p,onRetry:h})):A("",!0)]),_:1},8,["content","is_loading"]),s.value===1?(_(),L(qt,{key:0,onStop:l})):A("",!0)])])])]))}},mn=T(_n,[["__scopeId","data-v-ac3131be"]]),kn={class:"dialog-item-container"},bn={__name:"DialogItem",props:{dialog:Object},emits:["stop","retry","select"],setup(c,{emit:e}){const t=c,n=e,i=P(()=>({content:t.dialog.question})),s=P(()=>{const l=t.dialog,a={};return l.answer&&(a.content=l.answer),a.client_custom_chat_status=l.client_custom_chat_status,a}),o=()=>{n("stop")},r=()=>{n("retry")},u=()=>{n("select")};return(l,a)=>(_(),$("div",kn,[C(Tt,{question:i.value},null,8,["question"]),C(mn,{answer:s.value,onStop:o,onRetry:r,onSelect:u},null,8,["answer"])]))}},xn=T(bn,[["__scopeId","data-v-8f1dfc4b"]]),wn={class:"dialog-suggestion"},yn={__name:"DialogSuggestion",props:{suggestion:Object},setup(c){return(e,t)=>(_(),$("div",wn,t[0]||(t[0]=[k("div",null,"对话推荐项,当一轮对话结束后,可能有其他推荐的内容项目,在对话结束处进行展示。",-1)])))}},$n=T(yn,[["__scopeId","data-v-c9a060e3"]]),vn={class:"dialog-list"},Sn={__name:"DialogList",props:{height:Number,agent_id:String,list:Array,suggestion:Array},setup(c){const e=c,t=P(()=>({height:e.height+"px",overflow:"auto"}));return(n,i)=>{const s=Q("a-scrollbar");return _(),L(s,{type:"track",style:ee(t.value)},{default:Z(()=>[k("div",vn,[(_(!0),$(Xe,null,Ke(c.list,(o,r)=>(_(),L(xn,{dialog:o,index:r,key:o.id},null,8,["dialog","index"]))),128)),c.suggestion.length!==0?(_(),L($n,{key:0,suggestion:c.suggestion},null,8,["suggestion"])):A("",!0)])]),_:1},8,["style"])}}},Rn=T(Sn,[["__scopeId","data-v-f81c0e87"]]),Cn={class:"dialog-input-actions"},Tn={class:"dialog-input-action-right"},zn={__name:"InputActions",props:{disabled:{type:Boolean,default:!1,required:!1},enable_file_upload:{type:Boolean,default:!0,required:!1},enable_frequent_question:{type:Boolean,default:!0,required:!1},enable_voice_recognition:{type:Boolean,default:!1,required:!1},file_upload_type:{type:String,default:"*",required:!1},file_upload_limit:{type:Number,default:0,required:!1}},emits:["fileUpload","questionDefine","voiceRecognize","submit"],setup(c,{emit:e}){const t=e,n=()=>{t("questionDefine")},i=()=>{t("fileUpload")},s=()=>{t("voiceRecognize")},o=()=>{t("submit")};return(r,u)=>(_(),$("div",Cn,[u[0]||(u[0]=k("div",{class:"dialog-input-action-left"},[k("div",null,"联网查询")],-1)),k("div",Tn,[c.enable_frequent_question?(_(),$("div",{key:0,onClick:n},"常用问题定义")):A("",!0),c.enable_file_upload?(_(),$("div",{key:1,onClick:i},"文件上传")):A("",!0),c.enable_voice_recognition?(_(),$("div",{key:2,onClick:s},"语音识别")):A("",!0),k("div",{onClick:o},"发送")])]))}},An=T(zn,[["__scopeId","data-v-26be9f9b"]]),In={class:"dialog-input"},qn={__name:"DialogInput",props:{disabled:{type:Boolean,default:!1,required:!1},enable_file_upload:{type:Boolean,default:!0,required:!1},enable_frequent_question:{type:Boolean,default:!0,required:!1},enable_voice_recognition:{type:Boolean,default:!1,required:!1},file_upload_type:{type:String,default:"*",required:!1},file_upload_limit:{type:Number,default:0,required:!1},text_placeholder:{type:String},text_limit:{type:Number,default:0,required:!1},show_text_count:{type:Boolean,default:!1,required:!1}},emits:["inputTextChange","inputFileChange","submit"],setup(c,{emit:e}){const t=c,n=S(""),i=e,s=()=>{t.disabled||i("submit")},o=()=>{},r=()=>{},u=()=>{},l=()=>{n.value=n.value.replace(/\n/,"")},a=(h,d)=>{t.disabled||(n.value=h,i("inputTextChange",n.value))},p=h=>{if(t.disabled){h.keyCode===13&&l();return}h.keyCode===13&&(h.ctrlKey||(l(),i("submit")))};return(h,d)=>{const f=Q("a-textarea");return _(),$("div",In,[k("div",null,[C(f,{placeholder:"输入文本内容","model-value":n.value,"allow-clear":"","auto-size":{minRows:1,maxRows:4},onInput:a,onKeyup:p},null,8,["model-value"])]),C(An,{disabled:c.disabled,enable_file_upload:c.enable_file_upload,enable_frequent_question:c.enable_frequent_question,enable_voice_recognition:c.enable_voice_recognition,file_upload_type:c.file_upload_type,file_upload_limit:c.file_upload_limit,onFileUpload:o,onQuestionDefine:r,onVoiceRecognize:u,onSubmit:s},null,8,["disabled","enable_file_upload","enable_frequent_question","enable_voice_recognition","file_upload_type","file_upload_limit"]),d[0]||(d[0]=k("div",null,"文件上传预览区: 当点击文件上传,选择某个文件后,此处需要展示进行预览。",-1))])}}},Ln=T(qn,[["__scopeId","data-v-0dfff787"]]),Bn={},En={class:"dialog-footer"};function Dn(c,e){return _(),$("div",En,e[0]||(e[0]=[k("div",null,"对话底部",-1)]))}const Pn=T(Bn,[["render",Dn],["__scopeId","data-v-1c6ae20a"]]),Mn={},Nn={class:"dialog-aside-right"};function jn(c,e){return _(),$("div",Nn,e[0]||(e[0]=[k("div",null,"对话右侧边栏",-1)]))}const Fn=T(Mn,[["render",jn],["__scopeId","data-v-07f31c8f"]]);function Zn(c){const e=S(0),t=S(0),{proxy:n}=Je(),i=()=>{const s=n.$refs[c];e.value=s.offsetHeight,t.value=s.offsetWidth};return ae(()=>{i(),window.addEventListener("resize",i)}),ze(()=>{window.removeEventListener("resize",i)}),{height:e,width:t}}function On(c,e,t){const n=location.host,i=Ye.get();return c==="report"?`ws://${n}/api/${c}/ws/${e}/${t}?token=${i}`:c==="chat"?`ws://${n}/api/${c}/ws/${e}/${t}?token=${i}`:c==="excel"?`ws://${n}/api/document/ws/excel`:`ws://${n}/api/chat/ws/${e}/${t}?token=${i}`}function re(c){return typeof c=="function"?c:Function.prototype}function Wn(c){let e=[];const t=re(c.onMessage),n=re(c.onClose),i=re(c.onError);S(-1);function s(a,p,h){const d=On(h,a,p),f=new WebSocket(d);return f.onopen=function(g){e.forEach(m=>{f.send(m)}),e=[]},f.onclose=function(g){n(g)},f.onerror=function(g){i(g)},f.onmessage=g=>{t(g)},f}let o=null,r=null,u=null,l=null;return{initWSConnection(a,p,h){return o=a,r=p,u=h,l===null&&(l=s(o,r,u)),l},sendWSMessage(a){console.log("发送消息",a),l===null?(console.log("websocket为空,还未创建,开始创建"),l=s(o,r,u)):console.log("websocket已创建,不用再次创建"),l.readyState===0&&(console.log("00"),e.push(a)),l.readyState===1&&(console.log("11"),l.send(a)),l.readyState===2&&(console.log("22"),console.log("web socket正在关闭")),l.readyState===3&&(console.log("33"),e.push(a),l=s(o,r,u))},getWSInstance(){return l},closeWSConnect(){l!==null&&l.close()}}}const Hn=c=>Ae.get(`/api/agent/get-chat-id/${c}`),Qn=(c,e)=>Ae.get(`/api/agent/${c}/${e}/session_log`);function Un(c){return{}}function Gn(c){const e=[];return c.forEach(t=>{const n=Un();e.push(n)}),e}function Vn(c,e){return Ie({message:c})}const Xn=c=>`<pre><code class="hljs language-python">
- ${c}</code></pre>`,Kn=c=>`<pre><code class="hljs language-sql">
- ${c}</code></pre>`;function Jn(){return{client_custom_chat_type:2,client_custom_chat_status:0,question:"",answer:""}}function Yn(c,e){const t=xe(c);console.log("收到消息::"),console.log(t);const n=xe(Ie(e)),i=t.type,s=t.message;t.reference,t.step_message;const o=t.files,r=t.message_files,u=t.download_url,l=t.file_url,a=t.file_name,p=t.image_url,h=t.excel_url,d=t.excel_name,f=t.code,g=t.sql,m={client_custom_chat_type:2,client_custom_chat_status:1,question:t.question};for(let y in n)y==="client_custom_chat_type"||y==="client_custom_chat_status"||(m[y]=n[y]);let B=0,N="";if(i==="message"){if(B=1,m.answer=s,p){const y=window.location.port?`:${window.location.port}`:"",R=`http://${window.location.hostname}${y}${p}`;m.image_url=R}if(h&&d){const y=window.location.port?`:${window.location.port}`:"",R={file_type:"excel",file_url:`http://${window.location.hostname}${y}${h}`,file_name:`${d}.xlsx`||"点击下载"};m.file=R}if(l&&a){const y=window.location.port?`:${window.location.port}`:"",R={file_type:"word",file_url:`http://${window.location.hostname}${y}${l}`,file_name:`${a}.docx`||"点击下载"};m.file=R}if(f){const y=Xn(f);m.code=y}if(g){const y=Kn(g);m.sql=y}if(u){const y=decodeURIComponent(u).split("/"),R=y[y.length-1],M={file_type:"word",file_url:u,file_name:`${R}.docx`||"点击下载"};m.file=M}}if(i==="stream"&&(B=1,e&&e.answer?m.answer=e.answer+s:m.answer=s,o)){const R=o[0].file_name.split("."),M=R[R.length-1],H={file_name:o[0].file_name,file_url:o[0].file_url};M==="xlsx"&&(H.file_type="excel"),M==="docx"&&(H.file_type="word"),m.file=H}return i==="system"&&(B=1),i==="close"&&(B=2,m.client_custom_chat_status=2,m.client_custom_chat_type=1,r&&Array.isArray(r)&&r.forEach((y,R)=>{}),s&&(m.answer=s)),i==="error"&&(B=3),{status:B,message:N,data:m}}const es={class:"conversation-chat-container"},ts={class:"conversation-chat-left"},ns={class:"conversation-chat-main",ref:"chat_main"},ss={class:"conversation-chat-content"},is={class:"conversation-chat-right"},Re=30,Ce=30,Te=100,os={__name:"ConversationChatContainer",props:{agent_id:String,session_id:String,chat_type:String},setup(c){const e=c,{width:t,height:n}=Zn("chat_main"),i=P(()=>n.value-Re-Ce-Te),s=S([]),o=S([]),r=S({});S(0);const u=S(null),l=P(()=>[].concat(s.value,o.value)),a=S(!0),p=v=>{},h=v=>{},d=S(""),f=S([]),g=S(!1),m=v=>{d.value=v},B=v=>{f.value=v},N=async()=>{if(u.value===null)try{const E=await Hn(e.agent_id);if(E.code/1===200){const F=E.data;u.value=F.chat_id}else return}catch(E){console.log(E);return}else console.log(u.value,"已创建");f.value.length;const v=Vn(d.value,f.value);a.value=!1,j(u.value,v)},y={onMessage:We,onError:He,onClose:Qe},{initWSConnection:R,sendWSMessage:M,getWSInstance:H,closeWSConnect:U}=Wn(y);function j(v,E){const F=Jn();o.value.push(F),R(e.agent_id,v,e.chat_type),M(E),d.value="",f.value=[]}function We(v){const E=v.data,F=o.value[o.value.length-1],me=Yn(E,F),ke=me.status,be=me.data;ke===1&&(o.value.pop(),o.value.push(be)),ke===2&&(o.value.pop(),o.value.push(be))}function He(v){}function Qe(v){}return ae(()=>{e.session_id&&Qn(e.agent_id,e.session_id).then(v=>{if(v.code/1===200){const E=v.data,F=Gn(E);s.value=F}}).catch(v=>{console.log(v)})}),ze(()=>{U()}),(v,E)=>(_(),$("div",es,[k("div",ts,[C(ut)]),k("div",ns,[C(ft,{class:"conversation-chat-header",style:ee({height:Re+"px"})},null,8,["style"]),k("div",ss,[a.value?(_(),L(mt,{key:0,class:"conversation-chat-area"})):A("",!0),a.value?A("",!0):(_(),L(Rn,{key:1,class:"conversation-chat-area",height:i.value,agent_id:c.agent_id,list:l.value,suggestion:r.value,onShare:p,onSubmit:h},null,8,["height","agent_id","list","suggestion"])),C(Ln,{class:"conversation-chat-input",style:ee({height:Te+"px"}),disabled:g.value,onInputTextChange:m,onInputFileChange:B,onSubmit:N},null,8,["style","disabled"])]),C(Pn,{class:"conversation-chat-footer",style:ee({height:Ce+"px"})},null,8,["style"])],512),k("div",is,[C(Fn)])]))}},rs=T(os,[["__scopeId","data-v-2fefd3d9"]]),ks={__name:"ConversationQA",setup(c){const e=et(),t=tt(),n=rt(),i=S(""),s=S(""),o=S(1),r=S(""),u=()=>{t.back()};async function l(a){if(!a)return!1;const p=n.getList();return p.length===0?!0:!!p.find(d=>d.id===a)}return ae(async()=>{const a=e.query,p=a.agent,h=a.session;if(!p){o.value=3,r.value="非法操作:参数异常";return}if(!await l(p)){o.value=3,r.value="非法操作:参数异常";return}o.value=2,r.value="success",i.value=p,s.value=h}),(a,p)=>{const h=Q("a-button"),d=Q("a-space"),f=Q("a-result");return _(),L(st,null,{default:Z(()=>[C(it,null,{default:Z(()=>[C(ot),o.value===2?(_(),L(rs,{key:0,agent_id:i.value,session_id:s.value},null,8,["agent_id","session_id"])):A("",!0),o.value===3?(_(),L(f,{key:1,status:"error",title:r.value},{extra:Z(()=>[C(d,null,{default:Z(()=>[C(h,{type:"primary",onClick:u},{default:Z(()=>p[0]||(p[0]=[nt("返回")])),_:1})]),_:1})]),_:1},8,["title"])):A("",!0)]),_:1})]),_:1})}}};export{ks as default};
|