@apform-ui/core 1.15.0 → 1.15.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.
- package/dist/apform-ui.css +1 -1
- package/dist/apform-ui.js +3 -6
- package/dist/apform-ui.umd.cjs +2 -2
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/apform-ui.umd.cjs
CHANGED
|
@@ -64,12 +64,12 @@ ${C}</tr>
|
|
|
64
64
|
`}strong({tokens:C}){return`<strong>${this.parser.parseInline(C)}</strong>`}em({tokens:C}){return`<em>${this.parser.parseInline(C)}</em>`}codespan({text:C}){return`<code>${yA(C,!0)}</code>`}br(C){return"<br>"}del({tokens:C}){return`<del>${this.parser.parseInline(C)}</del>`}link({href:C,title:I,tokens:g}){let A=this.parser.parseInline(g),i=GW(C);if(i===null)return A;C=i;let l='<a href="'+C+'"';return I&&(l+=' title="'+yA(I)+'"'),l+=">"+A+"</a>",l}image({href:C,title:I,text:g,tokens:A}){A&&(g=this.parser.parseInline(A,this.parser.textRenderer));let i=GW(C);if(i===null)return yA(g);C=i;let l=`<img src="${C}" alt="${yA(g)}"`;return I&&(l+=` title="${yA(I)}"`),l+=">",l}text(C){return"tokens"in C&&C.tokens?this.parser.parseInline(C.tokens):"escaped"in C&&C.escaped?C.text:yA(C.text)}},_Z=class{strong({text:C}){return C}em({text:C}){return C}codespan({text:C}){return C}del({text:C}){return C}html({text:C}){return C}text({text:C}){return C}link({text:C}){return""+C}image({text:C}){return""+C}br(){return""}checkbox({raw:C}){return C}},cA=class aB{constructor(I){AI(this,"options");AI(this,"renderer");AI(this,"textRenderer");this.options=I||ml,this.options.renderer=this.options.renderer||new Ed,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _Z}static parse(I,g){return new aB(g).parse(I)}static parseInline(I,g){return new aB(g).parseInline(I)}parse(I){var A,i;this.renderer.parser=this;let g="";for(let l=0;l<I.length;l++){let e=I[l];if((i=(A=this.options.extensions)==null?void 0:A.renderers)!=null&&i[e.type]){let c=e,d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(c.type)){g+=d||"";continue}}let t=e;switch(t.type){case"space":{g+=this.renderer.space(t);break}case"hr":{g+=this.renderer.hr(t);break}case"heading":{g+=this.renderer.heading(t);break}case"code":{g+=this.renderer.code(t);break}case"table":{g+=this.renderer.table(t);break}case"blockquote":{g+=this.renderer.blockquote(t);break}case"list":{g+=this.renderer.list(t);break}case"checkbox":{g+=this.renderer.checkbox(t);break}case"html":{g+=this.renderer.html(t);break}case"def":{g+=this.renderer.def(t);break}case"paragraph":{g+=this.renderer.paragraph(t);break}case"text":{g+=this.renderer.text(t);break}default:{let c='Token with "'+t.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return g}parseInline(I,g=this.renderer){var i,l;this.renderer.parser=this;let A="";for(let e=0;e<I.length;e++){let t=I[e];if((l=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&l[t.type]){let d=this.options.extensions.renderers[t.type].call({parser:this},t);if(d!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(t.type)){A+=d||"";continue}}let c=t;switch(c.type){case"escape":{A+=g.text(c);break}case"html":{A+=g.html(c);break}case"link":{A+=g.link(c);break}case"image":{A+=g.image(c);break}case"checkbox":{A+=g.checkbox(c);break}case"strong":{A+=g.strong(c);break}case"em":{A+=g.em(c);break}case"codespan":{A+=g.codespan(c);break}case"br":{A+=g.br(c);break}case"del":{A+=g.del(c);break}case"text":{A+=g.text(c);break}default:{let d='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return A}},Ba=(ZZ=class{constructor(C){AI(this,"options");AI(this,"block");this.options=C||ml}preprocess(C){return C}postprocess(C){return C}processAllTokens(C){return C}emStrongMask(C){return C}provideLexer(C=this.block){return C?aA.lex:aA.lexInline}provideParser(C=this.block){return C?cA.parse:cA.parseInline}},AI(ZZ,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),AI(ZZ,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ZZ),SJ=class{constructor(...C){AI(this,"defaults",xZ());AI(this,"options",this.setOptions);AI(this,"parse",this.parseMarkdown(!0));AI(this,"parseInline",this.parseMarkdown(!1));AI(this,"Parser",cA);AI(this,"Renderer",Ed);AI(this,"TextRenderer",_Z);AI(this,"Lexer",aA);AI(this,"Tokenizer",Od);AI(this,"Hooks",Ba);this.use(...C)}walkTokens(C,I){var A,i;let g=[];for(let l of C)switch(g=g.concat(I.call(this,l)),l.type){case"table":{let e=l;for(let t of e.header)g=g.concat(this.walkTokens(t.tokens,I));for(let t of e.rows)for(let c of t)g=g.concat(this.walkTokens(c.tokens,I));break}case"list":{let e=l;g=g.concat(this.walkTokens(e.items,I));break}default:{let e=l;(i=(A=this.defaults.extensions)==null?void 0:A.childTokens)!=null&&i[e.type]?this.defaults.extensions.childTokens[e.type].forEach(t=>{let c=e[t].flat(1/0);g=g.concat(this.walkTokens(c,I))}):e.tokens&&(g=g.concat(this.walkTokens(e.tokens,I)))}}return g}use(...C){let I=this.defaults.extensions||{renderers:{},childTokens:{}};return C.forEach(g=>{let A={...g};if(A.async=this.defaults.async||A.async||!1,g.extensions&&(g.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let l=I.renderers[i.name];l?I.renderers[i.name]=function(...e){let t=i.renderer.apply(this,e);return t===!1&&(t=l.apply(this,e)),t}:I.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=I[i.level];l?l.unshift(i.tokenizer):I[i.level]=[i.tokenizer],i.start&&(i.level==="block"?I.startBlock?I.startBlock.push(i.start):I.startBlock=[i.start]:i.level==="inline"&&(I.startInline?I.startInline.push(i.start):I.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(I.childTokens[i.name]=i.childTokens)}),A.extensions=I),g.renderer){let i=this.defaults.renderer||new Ed(this.defaults);for(let l in g.renderer){if(!(l in i))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let e=l,t=g.renderer[e],c=i[e];i[e]=(...d)=>{let o=t.apply(i,d);return o===!1&&(o=c.apply(i,d)),o||""}}A.renderer=i}if(g.tokenizer){let i=this.defaults.tokenizer||new Od(this.defaults);for(let l in g.tokenizer){if(!(l in i))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let e=l,t=g.tokenizer[e],c=i[e];i[e]=(...d)=>{let o=t.apply(i,d);return o===!1&&(o=c.apply(i,d)),o}}A.tokenizer=i}if(g.hooks){let i=this.defaults.hooks||new Ba;for(let l in g.hooks){if(!(l in i))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let e=l,t=g.hooks[e],c=i[e];Ba.passThroughHooks.has(l)?i[e]=d=>{if(this.defaults.async&&Ba.passThroughHooksRespectAsync.has(l))return(async()=>{let n=await t.call(i,d);return c.call(i,n)})();let o=t.call(i,d);return c.call(i,o)}:i[e]=(...d)=>{if(this.defaults.async)return(async()=>{let n=await t.apply(i,d);return n===!1&&(n=await c.apply(i,d)),n})();let o=t.apply(i,d);return o===!1&&(o=c.apply(i,d)),o}}A.hooks=i}if(g.walkTokens){let i=this.defaults.walkTokens,l=g.walkTokens;A.walkTokens=function(e){let t=[];return t.push(l.call(this,e)),i&&(t=t.concat(i.call(this,e))),t}}this.defaults={...this.defaults,...A}}),this}setOptions(C){return this.defaults={...this.defaults,...C},this}lexer(C,I){return aA.lex(C,I??this.defaults)}parser(C,I){return cA.parse(C,I??this.defaults)}parseMarkdown(C){return(I,g)=>{let A={...g},i={...this.defaults,...A},l=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&A.async===!1)return l(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 I>"u"||I===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof I!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(I)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=C),i.async)return(async()=>{let e=i.hooks?await i.hooks.preprocess(I):I,t=await(i.hooks?await i.hooks.provideLexer(C):C?aA.lex:aA.lexInline)(e,i),c=i.hooks?await i.hooks.processAllTokens(t):t;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(C):C?cA.parse:cA.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(l);try{i.hooks&&(I=i.hooks.preprocess(I));let e=(i.hooks?i.hooks.provideLexer(C):C?aA.lex:aA.lexInline)(I,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let t=(i.hooks?i.hooks.provideParser(C):C?cA.parse:cA.parseInline)(e,i);return i.hooks&&(t=i.hooks.postprocess(t)),t}catch(e){return l(e)}}}onError(C,I){return g=>{if(g.message+=`
|
|
65
65
|
Please report this to https://github.com/markedjs/marked.`,C){let A="<p>An error occurred:</p><pre>"+yA(g.message+"",!0)+"</pre>";return I?Promise.resolve(A):A}if(I)return Promise.reject(g);throw g}}},Gl=new SJ;function II(C,I){return Gl.parse(C,I)}II.options=II.setOptions=function(C){return Gl.setOptions(C),II.defaults=Gl.defaults,iW(II.defaults),II},II.getDefaults=xZ,II.defaults=ml;function MJ(...C){return Gl.use(...C),II.defaults=Gl.defaults,iW(II.defaults),II}II.use=MJ,II.walkTokens=function(C,I){return Gl.walkTokens(C,I)},II.parseInline=Gl.parseInline,II.Parser=cA,II.parser=cA.parse,II.Renderer=Ed,II.TextRenderer=_Z,II.Lexer=aA,II.lexer=aA.lex,II.Tokenizer=Od,II.Hooks=Ba,II.parse=II,II.options,II.setOptions,II.walkTokens,II.parseInline,cA.parse,aA.lex;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function BW(C,I){(I==null||I>C.length)&&(I=C.length);for(var g=0,A=Array(I);g<I;g++)A[g]=C[g];return A}function DJ(C){if(Array.isArray(C))return C}function KJ(C,I){var g=C==null?null:typeof Symbol<"u"&&C[Symbol.iterator]||C["@@iterator"];if(g!=null){var A,i,l,e,t=[],c=!0,d=!1;try{if(l=(g=g.call(C)).next,I!==0)for(;!(c=(A=l.call(g)).done)&&(t.push(A.value),t.length!==I);c=!0);}catch(o){d=!0,i=o}finally{try{if(!c&&g.return!=null&&(e=g.return(),Object(e)!==e))return}finally{if(d)throw i}}return t}}function FJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
66
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zJ(C,I){return DJ(C)||KJ(C,I)||JJ(C,I)||FJ()}function JJ(C,I){if(C){if(typeof C=="string")return BW(C,I);var g={}.toString.call(C).slice(8,-1);return g==="Object"&&C.constructor&&(g=C.constructor.name),g==="Map"||g==="Set"?Array.from(C):g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?BW(C,I):void 0}}const WW=Object.entries,wW=Object.setPrototypeOf,vJ=Object.isFrozen,kJ=Object.getPrototypeOf,LJ=Object.getOwnPropertyDescriptor;let yI=Object.freeze,DI=Object.seal,Le=Object.create,YW=typeof Reflect<"u"&&Reflect,qZ=YW.apply,$Z=YW.construct;yI||(yI=function(I){return I}),DI||(DI=function(I){return I}),qZ||(qZ=function(I,g){for(var A=arguments.length,i=new Array(A>2?A-2:0),l=2;l<A;l++)i[l-2]=arguments[l];return I.apply(g,i)}),$Z||($Z=function(I){for(var g=arguments.length,A=new Array(g>1?g-1:0),i=1;i<g;i++)A[i-1]=arguments[i];return new I(...A)});const rl=wI(Array.prototype.forEach),TJ=wI(Array.prototype.lastIndexOf),VW=wI(Array.prototype.pop),Wa=wI(Array.prototype.push),xJ=wI(Array.prototype.splice),Te=Array.isArray,wa=wI(String.prototype.toLowerCase),gm=wI(String.prototype.toString),pW=wI(String.prototype.match),Ya=wI(String.prototype.replace),yW=wI(String.prototype.indexOf),fJ=wI(String.prototype.trim),jJ=wI(Number.prototype.toString),QJ=wI(Boolean.prototype.toString),NW=typeof BigInt>"u"?null:wI(BigInt.prototype.toString),XW=typeof Symbol>"u"?null:wI(Symbol.prototype.toString),nC=wI(Object.prototype.hasOwnProperty),Va=wI(Object.prototype.toString),fI=wI(RegExp.prototype.test),hl=UJ(TypeError);function wI(C){return function(I){I instanceof RegExp&&(I.lastIndex=0);for(var g=arguments.length,A=new Array(g>1?g-1:0),i=1;i<g;i++)A[i-1]=arguments[i];return qZ(C,I,A)}}function UJ(C){return function(){for(var I=arguments.length,g=new Array(I),A=0;A<I;A++)g[A]=arguments[A];return $Z(C,g)}}function Ug(C,I){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wa;if(wW&&wW(C,null),!Te(I))return C;let A=I.length;for(;A--;){let i=I[A];if(typeof i=="string"){const l=g(i);l!==i&&(vJ(I)||(I[A]=l),i=l)}C[i]=!0}return C}function OJ(C){for(let I=0;I<C.length;I++)nC(C,I)||(C[I]=null);return C}function WC(C){const I=Le(null);for(const A of WW(C)){var g=zJ(A,2);const i=g[0],l=g[1];nC(C,i)&&(Te(l)?I[i]=OJ(l):l&&typeof l=="object"&&l.constructor===Object?I[i]=WC(l):I[i]=l)}return I}function EJ(C){switch(typeof C){case"string":return C;case"number":return jJ(C);case"boolean":return QJ(C);case"bigint":return NW?NW(C):"0";case"symbol":return XW?XW(C):"Symbol()";case"undefined":return Va(C);case"function":case"object":{if(C===null)return Va(C);const I=C,g=dA(I,"toString");if(typeof g=="function"){const A=g(I);return typeof A=="string"?A:Va(A)}return Va(C)}default:return Va(C)}}function dA(C,I){for(;C!==null;){const A=LJ(C,I);if(A){if(A.get)return wI(A.get);if(typeof A.value=="function")return wI(A.value)}C=kJ(C)}function g(){return null}return g}function PJ(C){try{return fI(C,""),!0}catch{return!1}}const RW=yI(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Im=yI(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cm=yI(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_J=yI(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Am=yI(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),qJ=yI(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),HW=yI(["#text"]),SW=yI(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),im=yI(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),MW=yI(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Pd=yI(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$J=DI(/{{[\w\W]*|^[\w\W]*}}/g),gv=DI(/<%[\w\W]*|^[\w\W]*%>/g),Iv=DI(/\${[\w\W]*/g),Cv=DI(/^data-[\-\w.\u00B7-\uFFFF]+$/),Av=DI(/^aria-[\-\w]+$/),DW=DI(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),iv=DI(/^(?:\w+script|data):/i),lv=DI(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ev=DI(/^html$/i),tv=DI(/^[a-z][.\w]*(-[.\w]+)+$/i),KW=DI(/<[/\w!]/g),FW=DI(/<[/\w]/g),av=DI(/<\/no(script|embed|frames)/i),cv=DI(/\/>/i),wC={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},zW=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],dv=yI(Ug({},zW)),ov=(function(){const C={};return rl(zW,I=>{C[I]=DI(new RegExp("</"+I+"(?=[\\t\\n\\f\\r />])","i"))}),yI(C)})(),nv=function(){return typeof window>"u"?null:window},sv=function(I,g){if(typeof I!="object"||typeof I.createPolicy!="function")return null;let A=null;const i="data-tt-policy-suffix";g&&g.hasAttribute(i)&&(A=g.getAttribute(i));const l="dompurify"+(A?"#"+A:"");try{return I.createPolicy(l,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},JW=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},pi=function(I,g,A,i){return nC(I,g)&&Te(I[g])?Ug(i.base?WC(i.base):{},I[g],i.transform):A},lm=function(I,g,A){const i=nC(I,g)?I[g]:void 0;return i&&typeof i=="object"?WC(i):A()};function vW(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nv();const I=Cg=>vW(Cg);if(I.version="3.4.14",I.removed=[],!C||!C.document||C.document.nodeType!==wC.document||!C.Element)return I.isSupported=!1,I;let g=C.document;const A=g,i=A.currentScript;C.DocumentFragment;const l=C.HTMLTemplateElement,e=C.Node,t=C.Element,c=C.NodeFilter,d=C.NamedNodeMap;d===void 0&&(C.NamedNodeMap||C.MozNamedAttrMap),C.HTMLFormElement;const o=C.DOMParser,n=C.trustedTypes,s=t.prototype,Z=dA(s,"cloneNode"),m=dA(s,"remove"),b=dA(s,"nextSibling"),G=dA(s,"childNodes"),r=dA(s,"parentNode"),h=dA(s,"shadowRoot"),u=dA(s,"attributes"),B=e&&e.prototype?dA(e.prototype,"nodeType"):null,W=e&&e.prototype?dA(e.prototype,"nodeName"):null,w=e&&e.prototype?dA(e.prototype,"ownerDocument"):null,Y=function(K){return B?B(K):K.nodeType},p=function(K){return W?W(K):K.nodeName};if(typeof l=="function"){const Cg=g.createElement("template");Cg.content&&Cg.content.ownerDocument&&(g=Cg.content.ownerDocument)}let V,y="",N,H=!1,R=0;const D=function(){if(R>0)throw hl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},S=function(K){D(),R++;try{return V.createHTML(K)}finally{R--}},M=function(K){D(),R++;try{return V.createScriptURL(K)}finally{R--}},F=function(){return H||(N=sv(n,i),H=!0),N},z=g,k=z.implementation,f=z.createNodeIterator,Q=z.createDocumentFragment,O=z.getElementsByTagName,gg=A.importNode;let q=JW();I.isSupported=typeof WW=="function"&&typeof r=="function"&&k&&k.createHTMLDocument!==void 0;const bg=$J,jg=gv,aI=Iv,Yg=Cv,og=Av,pg=iv,lg=lv,Gg=tv;let Pg=DW,hg=null;const Qg=Ug({},[...RW,...Im,...Cm,...Am,...HW]);let yg=null;const sI=Ug({},[...SW,...im,...MW,...Pd]);let dI=Object.seal(Le(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),pI=null,_A=null;const TI=Object.seal(Le(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Hd=!0,De=!0,a9=!1,c9=!0,nl=!1,Ke=!0,Fe=!1,Eu=!1,mZ=null,bZ=null,Pu=!1,aa=!1,GZ=!1,rZ=!1,d9=!0,o9=!1;const n9="user-content-";let _u=!0,qu=!1,ca={},da=null;const s9=Ug({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Z9=null;const m9=Ug({},["audio","video","img","source","image","track"]);let b9=null;const G9=Ug({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),hZ="http://www.w3.org/1998/Math/MathML",uZ="http://www.w3.org/2000/svg",qA="http://www.w3.org/1999/xhtml";let oa=qA,$u=!1,gB=null;const Tng=Ug({},[hZ,uZ,qA],gm),r9=yI(["mi","mo","mn","ms","mtext"]);let IB=Ug({},r9);const h9=yI(["annotation-xml"]);let CB=Ug({},h9);const xng=Ug({},["title","style","font","a","script"]);let Sd=null;const fng=["application/xhtml+xml","text/html"],jng="text/html";let WI=null,na=null;const Qng=g.createElement("form"),u9=function(K){return K instanceof RegExp||K instanceof Function},AB=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(na&&na===K)return;(!K||typeof K!="object")&&(K={}),K=WC(K),Sd=fng.indexOf(K.PARSER_MEDIA_TYPE)===-1?jng:K.PARSER_MEDIA_TYPE,WI=Sd==="application/xhtml+xml"?gm:wa,hg=pi(K,"ALLOWED_TAGS",Qg,{transform:WI}),yg=pi(K,"ALLOWED_ATTR",sI,{transform:WI}),gB=pi(K,"ALLOWED_NAMESPACES",Tng,{transform:gm}),b9=pi(K,"ADD_URI_SAFE_ATTR",G9,{transform:WI,base:G9}),Z9=pi(K,"ADD_DATA_URI_TAGS",m9,{transform:WI,base:m9}),da=pi(K,"FORBID_CONTENTS",s9,{transform:WI}),pI=pi(K,"FORBID_TAGS",WC({}),{transform:WI}),_A=pi(K,"FORBID_ATTR",WC({}),{transform:WI}),ca=nC(K,"USE_PROFILES")?K.USE_PROFILES&&typeof K.USE_PROFILES=="object"?WC(K.USE_PROFILES):K.USE_PROFILES:!1,Hd=K.ALLOW_ARIA_ATTR!==!1,De=K.ALLOW_DATA_ATTR!==!1,a9=K.ALLOW_UNKNOWN_PROTOCOLS||!1,c9=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nl=K.SAFE_FOR_TEMPLATES||!1,Ke=K.SAFE_FOR_XML!==!1,Fe=K.WHOLE_DOCUMENT||!1,aa=K.RETURN_DOM||!1,GZ=K.RETURN_DOM_FRAGMENT||!1,rZ=K.RETURN_TRUSTED_TYPE||!1,Pu=K.FORCE_BODY||!1,d9=K.SANITIZE_DOM!==!1,o9=K.SANITIZE_NAMED_PROPS||!1,_u=K.KEEP_CONTENT!==!1,qu=K.IN_PLACE||!1,Pg=PJ(K.ALLOWED_URI_REGEXP)?K.ALLOWED_URI_REGEXP:DW,oa=typeof K.NAMESPACE=="string"?K.NAMESPACE:qA,IB=lm(K,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ug({},r9)),CB=lm(K,"HTML_INTEGRATION_POINTS",()=>Ug({},h9));const L=lm(K,"CUSTOM_ELEMENT_HANDLING",()=>Le(null));if(dI=Le(null),nC(L,"tagNameCheck")&&u9(L.tagNameCheck)&&(dI.tagNameCheck=L.tagNameCheck),nC(L,"attributeNameCheck")&&u9(L.attributeNameCheck)&&(dI.attributeNameCheck=L.attributeNameCheck),nC(L,"allowCustomizedBuiltInElements")&&typeof L.allowCustomizedBuiltInElements=="boolean"&&(dI.allowCustomizedBuiltInElements=L.allowCustomizedBuiltInElements),DI(dI),nl&&(De=!1),GZ&&(aa=!0),ca&&(hg=Ug({},HW),yg=Le(null),ca.html===!0&&(Ug(hg,RW),Ug(yg,SW)),ca.svg===!0&&(Ug(hg,Im),Ug(yg,im),Ug(yg,Pd)),ca.svgFilters===!0&&(Ug(hg,Cm),Ug(yg,im),Ug(yg,Pd)),ca.mathMl===!0&&(Ug(hg,Am),Ug(yg,MW),Ug(yg,Pd))),TI.tagCheck=null,TI.attributeCheck=null,nC(K,"ADD_TAGS")&&(typeof K.ADD_TAGS=="function"?TI.tagCheck=K.ADD_TAGS:Te(K.ADD_TAGS)&&(hg===Qg&&(hg=WC(hg)),Ug(hg,K.ADD_TAGS,WI))),nC(K,"ADD_ATTR")&&(typeof K.ADD_ATTR=="function"?TI.attributeCheck=K.ADD_ATTR:Te(K.ADD_ATTR)&&(yg===sI&&(yg=WC(yg)),Ug(yg,K.ADD_ATTR,WI))),nC(K,"ADD_FORBID_CONTENTS")&&Te(K.ADD_FORBID_CONTENTS)&&(da===s9&&(da=WC(da)),Ug(da,K.ADD_FORBID_CONTENTS,WI)),_u&&(hg["#text"]=!0),Fe&&Ug(hg,["html","head","body"]),hg.table&&(Ug(hg,["tbody"]),delete pI.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw hl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const U=V;V=K.TRUSTED_TYPES_POLICY;try{y=S("")}catch(dg){throw V=U,dg}}else K.TRUSTED_TYPES_POLICY===null?(V=void 0,y=""):(V===void 0&&(V=F()),V&&typeof y=="string"&&(y=S("")));yI&&yI(K),na=K},B9=Ug({},[...Im,...Cm,..._J]),W9=Ug({},[...Am,...qJ]),Ung=function(K,L,U){return L.namespaceURI===qA?K==="svg":L.namespaceURI===hZ?K==="svg"&&(U==="annotation-xml"||IB[U]):!!B9[K]},Ong=function(K,L,U){return L.namespaceURI===qA?K==="math":L.namespaceURI===uZ?K==="math"&&CB[U]:!!W9[K]},Eng=function(K,L,U){return L.namespaceURI===uZ&&!CB[U]||L.namespaceURI===hZ&&!IB[U]?!1:!W9[K]&&(xng[K]||!B9[K])},Png=function(K){let L=r(K);(!L||!L.tagName)&&(L={namespaceURI:oa,tagName:"template"});const U=wa(K.tagName),dg=wa(L.tagName);return gB[K.namespaceURI]?K.namespaceURI===uZ?Ung(U,L,dg):K.namespaceURI===hZ?Ong(U,L,dg):K.namespaceURI===qA?Eng(U,L,dg):!!(Sd==="application/xhtml+xml"&&gB[K.namespaceURI]):!1},sl=function(K){Wa(I.removed,{element:K});try{r(K).removeChild(K)}catch{if(m(K),!r(K))throw hl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},w9=function(K,L,U){try{K.removeAttributeNode(L)}catch{try{K.removeAttribute(U)}catch{}}},BZ=function(K){WZ(K);const L=G(K);if(L){const dg=[];rl(L,ug=>{Wa(dg,ug)}),rl(dg,ug=>{try{m(ug)}catch{}})}const U=u(K);if(U)for(let dg=U.length-1;dg>=0;--dg){const ug=U[dg],Mg=ug&&ug.name;typeof Mg=="string"&&w9(K,ug,Mg)}},ze=function(K,L,U){if(!U)try{U=L.getAttributeNode(K)}catch{U=null}Wa(I.removed,{attribute:U||null,from:L});try{U?L.removeAttributeNode(U):L.removeAttribute(K)}catch{try{L.removeAttribute(K)}catch{}}if(K==="is")if(aa||GZ)try{sl(L)}catch{}else try{L.setAttribute(K,"")}catch{}},_ng=function(K){const L=u(K);if(L)for(let U=L.length-1;U>=0;--U){const dg=L[U],ug=dg&&dg.name;typeof ug!="string"||yg[WI(ug)]||w9(K,dg,ug)}},WZ=function(K){const L=[K];for(;L.length>0;){const U=L.pop();Y(U)===wC.element&&_ng(U);const ug=G(U);if(ug)for(let Mg=ug.length-1;Mg>=0;--Mg)L.push(ug[Mg])}},Y9=function(K,L){return Ke?K==="patchsrc"?!0:K==="for"&&L!=="label"&&L!=="output":!1},qng=function(K){if(!Ke)return;const L=[K];for(;L.length>0;){const U=L.pop(),dg=Y(U);if(dg===wC.processingInstruction||dg===wC.comment&&fI(FW,U.data)){try{m(U)}catch{}continue}if(dg===wC.element){const Mg=U,iI=WI(p(U));try{Mg.hasAttribute&&Mg.hasAttribute("patchsrc")&&Mg.removeAttribute("patchsrc"),Mg.hasAttribute&&Mg.hasAttribute("for")&&Y9("for",iI)&&Mg.removeAttribute("for")}catch{}}const ug=G(U);if(ug)for(let Mg=ug.length-1;Mg>=0;--Mg)L.push(ug[Mg])}},V9=function(K){let L=null,U=null;if(Pu)K="<remove></remove>"+K;else{const Mg=pW(K,/^[\r\n\t ]+/);U=Mg&&Mg[0]}Sd==="application/xhtml+xml"&&oa===qA&&(K='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+K+"</body></html>");const dg=V?S(K):K;if(oa===qA)try{L=new o().parseFromString(dg,Sd)}catch{}if(!L||!L.documentElement){L=k.createDocument(oa,"template",null);try{L.documentElement.innerHTML=$u?y:dg}catch{}}const ug=L.body||L.documentElement;return K&&U&&ug.insertBefore(g.createTextNode(U),ug.childNodes[0]||null),oa===qA?O.call(L,Fe?"html":"body")[0]:Fe?L.documentElement:ug},p9=function(K){const L=w?w(K):K.ownerDocument;return f.call(L||K,K,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},wZ=function(K){return K=Ya(K,bg," "),K=Ya(K,jg," "),K=Ya(K,aI," "),K},iB=function(K){var L;K.normalize();const U=w?w(K):K.ownerDocument,dg=f.call(U||K,K,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let ug=dg.nextNode();for(;ug;)ug.data=wZ(ug.data),ug=dg.nextNode();const Mg=(L=K.querySelectorAll)===null||L===void 0?void 0:L.call(K,"template");Mg&&rl(Mg,iI=>{sa(iI.content)&&iB(iI.content)})},YZ=function(K){const L=W?W(K):null;return typeof L!="string"||WI(L)!=="form"?!1:typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||K.attributes!==u(K)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function"||K.nodeType!==B(K)||K.childNodes!==G(K)},sa=function(K){if(!B||typeof K!="object"||K===null)return!1;try{return B(K)===wC.documentFragment}catch{return!1}},Md=function(K){if(!B||typeof K!="object"||K===null)return!1;try{return typeof B(K)=="number"}catch{return!1}};function $A(Cg,K,L){Cg.length!==0&&rl(Cg,U=>{U.call(I,K,L,na)})}const $ng=function(K,L){return!!(Ke&&K.hasChildNodes()&&!Md(K.firstElementChild)&&fI(KW,K.textContent)&&fI(KW,K.innerHTML)||Ke&&K.namespaceURI===qA&&dv[L]&&(Md(K.firstElementChild)||typeof K.textContent=="string"&&fI(ov[L],K.textContent))||K.nodeType===wC.processingInstruction||Ke&&K.nodeType===wC.comment&&fI(FW,K.data))},VZ=function(K,L){if(K instanceof RegExp)return fI(K,L);if(K instanceof Function){for(var U=arguments.length,dg=new Array(U>2?U-2:0),ug=2;ug<U;ug++)dg[ug-2]=arguments[ug];return!!K(L,...dg)}return!1},gsg=function(K,L,U){if(!pI[L]&&H9(L)&&VZ(dI.tagNameCheck,L))return!1;if(_u&&!da[L]){const dg=r(K),ug=G(K);if(ug&&dg){const Mg=ug.length;for(let iI=Mg-1;iI>=0;--iI){const ZI=K===U?Z(ug[iI],!0):ug[iI];dg.insertBefore(ZI,b(K))}}}return sl(K),!0},y9=function(K,L,U,dg){return K.length===0?L:L===U||L===dg?WC(L):L},N9=function(K,L){return K===L||r(K)!==null?!1:(qu&&WZ(K),!0)},X9=function(K,L){if($A(q.beforeSanitizeElements,K,null),N9(K,L))return!0;if(YZ(K))return sl(K),!0;const U=WI(p(K));if(hg=y9(q.uponSanitizeElement,hg,Qg,mZ),$A(q.uponSanitizeElement,K,{tagName:U,allowedTags:hg}),N9(K,L))return!0;if($ng(K,U))return sl(K),!0;if(pI[U]||!(TI.tagCheck instanceof Function&&TI.tagCheck(U))&&!hg[U]){const ug=gsg(K,U,L);return ug===!1&&$A(q.afterSanitizeElements,K,null),ug}if(Y(K)===wC.element&&!Png(K)||(U==="noscript"||U==="noembed"||U==="noframes")&&fI(av,K.innerHTML))return sl(K),!0;if(nl&&K.nodeType===wC.text){const ug=wZ(K.textContent);K.textContent!==ug&&(Wa(I.removed,{element:K.cloneNode()}),K.textContent=ug)}return $A(q.afterSanitizeElements,K,null),!1},R9=function(K,L,U){if(_A[L]||Y9(L,K)||d9&&(L==="id"||L==="name")&&(U in g||U in Qng))return!1;const dg=yg[L]||TI.attributeCheck instanceof Function&&TI.attributeCheck(L,K);return De&&fI(Yg,L)||Hd&&fI(og,L)?!0:dg?b9[L]||fI(Pg,Ya(U,lg,""))||(L==="src"||L==="xlink:href"||L==="href")&&K!=="script"&&yW(U,"data:")===0&&Z9[K]||a9&&!fI(pg,Ya(U,lg,""))?!0:!U:H9(K)&&VZ(dI.tagNameCheck,K)&&VZ(dI.attributeNameCheck,L,K)||L==="is"&&dI.allowCustomizedBuiltInElements&&VZ(dI.tagNameCheck,U)},Isg=Ug({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),H9=function(K){return!Isg[wa(K)]&&fI(Gg,K)},Csg=function(K,L,U,dg){if(V&&typeof n=="object"&&typeof n.getAttributeType=="function"&&!U)switch(n.getAttributeType(K,L)){case"TrustedHTML":return S(dg);case"TrustedScriptURL":return M(dg)}return dg},Asg=function(K,L,U,dg){try{U?K.setAttributeNS(U,L,dg):K.setAttribute(L,dg),YZ(K)?sl(K):VW(I.removed)}catch{ze(L,K)}},S9=function(K){$A(q.beforeSanitizeAttributes,K,null);const L=K.attributes;if(!L||YZ(K))return;yg=y9(q.uponSanitizeAttribute,yg,sI,bZ);const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:yg,forceKeepAttr:void 0};let dg=L.length;const ug=WI(K.nodeName);for(;dg--;){const Mg=L[dg],iI=Mg.name,ZI=Mg.namespaceURI,hC=Mg.value,uC=WI(iI),eB=hC;let oC=iI==="value"?eB:fJ(eB);if(U.attrName=uC,U.attrValue=oC,U.keepAttr=!0,U.forceKeepAttr=void 0,$A(q.uponSanitizeAttribute,K,U),oC=U.attrValue,o9&&(uC==="id"||uC==="name")&&yW(oC,n9)!==0&&(ze(iI,K,Mg),oC=n9+oC),Ke&&fI(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,oC)){ze(iI,K,Mg);continue}if(uC==="attributename"&&pW(oC,"href")){ze(iI,K,Mg);continue}if(!U.forceKeepAttr){if(!U.keepAttr){ze(iI,K,Mg);continue}if(!c9&&fI(cv,oC)){ze(iI,K,Mg);continue}if(nl&&(oC=wZ(oC)),!R9(ug,uC,oC)){ze(iI,K,Mg);continue}oC=Csg(ug,uC,ZI,oC),oC!==eB&&Asg(K,iI,ZI,oC)}}$A(q.afterSanitizeAttributes,K,null)},pZ=function(K){let L=null;const U=p9(K);for($A(q.beforeSanitizeShadowDOM,K,null);L=U.nextNode();)if($A(q.uponSanitizeShadowNode,L,null),X9(L,K),S9(L),sa(L.content)&&pZ(L.content),Y(L)===wC.element){const dg=h(L);sa(dg)&&(lB(dg),pZ(dg))}$A(q.afterSanitizeShadowDOM,K,null)},lB=function(K){const L=[{node:K,shadow:null}];for(;L.length>0;){const U=L.pop();if(U.shadow){pZ(U.shadow);continue}const dg=U.node,Mg=Y(dg)===wC.element,iI=G(dg);if(iI)for(let ZI=iI.length-1;ZI>=0;--ZI)L.push({node:iI[ZI],shadow:null});if(Mg){const ZI=W?W(dg):null;if(typeof ZI=="string"&&WI(ZI)==="template"){const hC=dg.content;sa(hC)&&L.push({node:hC,shadow:null})}}if(Mg){const ZI=h(dg);sa(ZI)&&L.push({node:null,shadow:ZI},{node:ZI,shadow:null})}}};return I.sanitize=function(Cg){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,U=null,dg=null,ug=null;if($u=!Cg,$u&&(Cg="<!-->"),typeof Cg!="string"&&!Md(Cg)&&(Cg=EJ(Cg),typeof Cg!="string"))throw hl("dirty is not a string, aborting");if(!I.isSupported)return Cg;Eu?(hg=mZ,yg=bZ):AB(K),(q.uponSanitizeElement.length>0||q.uponSanitizeAttribute.length>0)&&(hg=WC(hg)),q.uponSanitizeAttribute.length>0&&(yg=WC(yg)),I.removed=[];const Mg=qu&&typeof Cg!="string"&&Md(Cg);if(Mg){qng(Cg);const hC=p(Cg);if(typeof hC=="string"){const uC=WI(hC);if(!hg[uC]||pI[uC])throw BZ(Cg),hl("root node is forbidden and cannot be sanitized in-place")}if(YZ(Cg))throw BZ(Cg),hl("root node is clobbered and cannot be sanitized in-place");try{lB(Cg)}catch(uC){throw BZ(Cg),uC}}else if(Md(Cg))L=V9("<!---->"),U=L.ownerDocument.importNode(Cg,!0),U.nodeType===wC.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?L=U:L.appendChild(U),lB(U);else{if(!aa&&!nl&&!Fe&&Cg.indexOf("<")===-1)return V&&rZ?S(Cg):Cg;if(L=V9(Cg),!L)return aa?null:rZ?y:""}L&&Pu&&sl(L.firstChild);const iI=Mg?Cg:L;try{const hC=p9(iI);for(;dg=hC.nextNode();)X9(dg,iI),S9(dg),sa(dg.content)&&pZ(dg.content)}catch(hC){throw Mg&&(BZ(Cg),rl(I.removed,uC=>{uC.element&&WZ(uC.element)})),hC}if(Mg)return rl(I.removed,hC=>{hC.element&&WZ(hC.element)}),nl&&iB(Cg),Cg;if(aa){if(nl&&iB(L),GZ)for(ug=Q.call(L.ownerDocument);L.firstChild;)ug.appendChild(L.firstChild);else ug=L;return(yg.shadowroot||yg.shadowrootmode)&&(ug=gg.call(A,ug,!0)),ug}let ZI=Fe?L.outerHTML:L.innerHTML;return Fe&&hg["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&fI(ev,L.ownerDocument.doctype.name)&&(ZI="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
|
|
67
|
-
`+ZI),nl&&(ZI=wZ(ZI)),V&&rZ?S(ZI):ZI},I.setConfig=function(){let Cg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};AB(Cg),Eu=!0,mZ=hg,bZ=yg},I.clearConfig=function(){na=null,Eu=!1,mZ=null,bZ=null,V=N,y=""},I.isValidAttribute=function(Cg,K,L){na||AB({});const U=WI(Cg),dg=WI(K);return R9(U,dg,L)},I.addHook=function(Cg,K){typeof K=="function"&&nC(q,Cg)&&Wa(q[Cg],K)},I.removeHook=function(Cg,K){if(nC(q,Cg)){if(K!==void 0){const L=TJ(q[Cg],K);return L===-1?void 0:xJ(q[Cg],L,1)[0]}return VW(q[Cg])}},I.removeHooks=function(Cg){nC(q,Cg)&&(q[Cg]=[])},I.removeAllHooks=function(){q=JW()},I}var em=vW();const _d=typeof em.sanitize=="function"?em:em.default;function Zv(C){const I=C.trim();if(!I)return!1;const g=[/^(好的|已|我|现在|以上|这就是|这是|根据|基于)/,/^(表单|流程|Schema|JSON|数据)\s*(已|已经|已生成|已创建|已更新)/,/已(生成|创建|更新|完成|应用)(好|了)?/,/以上(就是|是)/,/请(查看|确认|检查|参考)/,/希望(这|这个)/];return I.length<100&&g.some(A=>A.test(I))}function kW(C){if(!C)return[{type:"text",content:""}];const I=[],g=/```([\w:+#.-]*)\r?\n([\s\S]*?)```|```([^\n`]*?)```|<schema>([\s\S]*?)<\/schema>/g;let A=0,i,l=!1;for(;(i=g.exec(C))!==null;){const c=C.slice(A,i.index);if(c.trim()&&I.push({type:"text",content:c}),i[0].startsWith("<schema>"))I.push({type:"code",content:(i[4]||"").trim(),language:"json"}),l=!0;else if(i[1]!==void 0){const d=(i[1]||"text").trim()||"text",o=(i[2]||"").replace(/^\n/,"").replace(/\n$/,"");LW(I,d,o)}else LW(I,"text",(i[3]||"").trim());A=i.index+i[0].length}const e=C.slice(A);e.trim()&&(l&&Zv(e)||I.push({type:"text",content:e}));const t=I.filter((c,d)=>c.type!=="text"||c.content.trim()?!0:d>0&&d<I.length-1);return t.length?t:[{type:"text",content:C}]}function LW(C,I,g){if(I.startsWith("artifact:")){const A=I.slice(9);C.push({type:"artifact",content:g,language:A,artifactType:A});return}C.push({type:"code",content:g,language:I})}function qd(C){if(!C)return"";const g=II.parse(C,{breaks:!0,gfm:!0}).replace(/<table>/g,'<div class="table-scroll"><table>').replace(/<\/table>/g,"</table></div>").replace(/<img\b/gi,'<img loading="lazy" decoding="async" class="apf-md-img"');return typeof window>"u"||typeof(_d==null?void 0:_d.sanitize)!="function"?g:_d.sanitize(g,{ADD_ATTR:["class","loading","decoding","fetchpriority"]})}const mv=["onClick"],bv=["src","alt"],TW=E(a.defineComponent({__name:"ImagePreviewCard",props:{url:{},urls:{},size:{default:"default"},alt:{default:"预览图"}},setup(C){const I=C,g=a.ref(!1),A=a.ref(0),i=a.computed(()=>{var e;return(e=I.urls)!=null&&e.length?I.urls.filter(Boolean):I.url?[I.url]:[]});function l(e){A.value=e,g.value=!0}return(e,t)=>i.value.length?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["apf-image-preview",`apf-image-preview--${C.size}`])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(c,d)=>(a.openBlock(),a.createElementBlock("button",{key:`${c}-${d}`,type:"button",class:"apf-image-preview__thumb",onClick:a.withModifiers(o=>l(d),["stop"])},[a.createElementVNode("img",{src:c,alt:`${C.alt} ${d+1}`,loading:"lazy"},null,8,bv)],8,mv))),128)),g.value&&i.value.length?(a.openBlock(),a.createBlock(a.unref(BC.ElImageViewer),{key:0,"url-list":i.value,"initial-index":A.value,teleported:"",onClose:t[0]||(t[0]=c=>g.value=!1)},null,8,["url-list","initial-index"])):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-40f66176"]]),Gv=["src"],xW=E(a.defineComponent({__name:"VideoPreviewCard",props:{url:{},size:{default:"default"}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("video",{class:a.normalizeClass(["apf-video-preview",`apf-video-preview--${C.size}`]),src:C.url,controls:"",preload:"metadata",onClick:g[0]||(g[0]=a.withModifiers(()=>{},["stop"]))},null,10,Gv))}}),[["__scopeId","data-v-6dbd2c6e"]]),rv={key:0,class:"apf-text-preview apf-text-preview--compact"},hv={key:1,class:"apf-text-preview"},uv={class:"apf-text-preview__head"},Bv={class:"apf-text-preview__label"},tm=E(a.defineComponent({__name:"TextPreviewCard",props:{text:{},label:{},size:{default:"default"},maxHeight:{default:"240px"}},setup(C){const I=C,{copy:g}=Td(),A=a.computed(()=>I.text.replace(/\s+/g," ").trim().slice(0,64));async function i(){await g(I.text)}return(l,e)=>C.size==="compact"?(a.openBlock(),a.createElementBlock("div",rv,a.toDisplayString(A.value),1)):(a.openBlock(),a.createElementBlock("div",hv,[a.createElementVNode("div",uv,[a.createElementVNode("span",Bv,a.toDisplayString(C.label||"文本"),1),a.createElementVNode("button",{type:"button",class:"apf-text-preview__copy",onClick:a.withModifiers(i,["stop"])},"复制")]),a.createElementVNode("pre",{class:"apf-text-preview__body",style:a.normalizeStyle({maxHeight:C.maxHeight})},a.toDisplayString(C.text),5)]))}}),[["__scopeId","data-v-76a4ed48"]]);function ul(C){const I=(C.mimetype||"").toLowerCase(),g=(C.filename||"").toLowerCase();return I.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp)$/.test(g)}function xe(C){const I=(C.mimetype||"").toLowerCase(),g=(C.filename||"").toLowerCase();return I.includes("pdf")||g.endsWith(".pdf")}function am(C){const I=(C.mimetype||"").toLowerCase(),g=(C.filename||"").toLowerCase();return g.endsWith(".docx")||g.endsWith(".doc")||g.endsWith(".xlsx")||g.endsWith(".xls")||I.includes("word")||I.includes("sheet")||I.includes("excel")}function Wv(C){return ul(C)||xe(C)}function $d(C){const I=(C.filename||"").toLowerCase(),g=(C.mimetype||"").toLowerCase();return xe(C)?"PDF":I.endsWith(".docx")||I.endsWith(".doc")||g.includes("word")?"Word":I.endsWith(".xlsx")||I.endsWith(".xls")||g.includes("sheet")||g.includes("excel")?"Excel":I.endsWith(".csv")?"CSV":I.endsWith(".txt")||I.endsWith(".md")?"文本":I.endsWith(".json")?"JSON":"文件"}function go(C){return C==null||C<0?"":C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}const wv={class:"apf-file-chip__name"},Yv={class:"apf-file-chip__kind"},fW=E(a.defineComponent({__name:"FileChip",props:{item:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>g.item.kind==="pdf"?"PDF":g.item.kind==="office"?$d({id:g.item.id,filename:g.item.filename||g.item.label||"file",mimetype:g.item.mimetype||""}):"文件"),l=a.computed(()=>g.item.filename||g.item.label||i.value);return(e,t)=>(a.openBlock(),a.createElementBlock("button",{type:"button",class:"apf-file-chip",onClick:t[0]||(t[0]=a.withModifiers(c=>A("preview",C.item),["stop"]))},[a.createVNode(a.unref($),{name:"document",size:14}),a.createElementVNode("span",wv,a.toDisplayString(l.value),1),a.createElementVNode("span",Yv,a.toDisplayString(i.value),1)]))}}),[["__scopeId","data-v-c8f563a4"]]),Vv={class:"apf-json-card__body"},pv={class:"apf-json-card__title"},yv={class:"apf-json-card__summary"},jW=E(a.defineComponent({__name:"JsonCard",props:{title:{},data:{},content:{},type:{default:"json"}},emits:["click","openDetail"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{if(g.data!==void 0)return g.data;if(!g.content)return null;try{return JSON.parse(g.content)}catch{return null}}),l=a.computed(()=>{const c=i.value;if(c==null)return"JSON 数据";if(Array.isArray(c))return`${c.length} 个元素`;if(typeof c=="object"){const d=c;if(Array.isArray(d.nodes)){const n=Array.isArray(d.edges)?d.edges.length:0;return`${d.nodes.length} 个节点, ${n} 条连线`}const o=Object.keys(d);return`${o.length} 个字段${o.length?` (${o.slice(0,3).join(", ")}${o.length>3?"...":""})`:""}`}return String(c)}),e=a.computed(()=>g.type==="schema"?"document":g.type==="flow"?"connection":"files");function t(){A("click"),A("openDetail")}return(c,d)=>(a.openBlock(),a.createElementBlock("button",{type:"button",class:"apf-json-card",onClick:t},[a.createVNode(a.unref($),{name:e.value,size:20,class:"apf-json-card__icon"},null,8,["name"]),a.createElementVNode("div",Vv,[a.createElementVNode("strong",pv,a.toDisplayString(C.title),1),a.createElementVNode("span",yv,a.toDisplayString(l.value),1)])]))}}),[["__scopeId","data-v-059cffad"]]),QW=a.defineComponent({__name:"JsonDetailDialog",props:{modelValue:{type:Boolean},title:{},data:{},content:{},nodeType:{}},emits:["update:modelValue"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{if(g.data!=null)return g.data;if(!g.content)return null;const e=eA(g.content);return(e==null?void 0:e.data)??g.content}),l=a.computed(()=>{if(g.title)return g.title;const e=i.value;if(e&&typeof e=="object"){const t=lA(e);if(t==="script")return"漫剧剧本";if(t==="storyboard")return"视频分镜"}return"结果详情"});return(e,t)=>{const c=a.resolveComponent("el-button");return a.openBlock(),a.createBlock(a.unref(Dd),{"model-value":C.modelValue,title:l.value,width:"900px","show-fullscreen-btn":!0,"onUpdate:modelValue":t[1]||(t[1]=d=>A("update:modelValue",d))},{footer:a.withCtx(()=>[a.createVNode(c,{type:"primary",onClick:t[0]||(t[0]=d=>A("update:modelValue",!1))},{default:a.withCtx(()=>[...t[2]||(t[2]=[a.createTextVNode("关闭",-1)])]),_:1})]),default:a.withCtx(()=>[a.createVNode(a.unref(PW),{data:i.value,"node-type":C.nodeType},null,8,["data","node-type"])]),_:1},8,["model-value","title"])}}}),cm=E(a.defineComponent({__name:"CardTable",props:{loading:{type:Boolean,default:!1},padding:{default:"var(--spacing-sm, 8px)"},borderless:{type:Boolean,default:!1}},setup(C){return(I,g)=>{const A=a.resolveDirective("loading");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-card-table",{"apf-card-table--borderless":C.borderless}]),style:a.normalizeStyle({padding:C.padding})},[a.renderSlot(I.$slots,"default",{},void 0,!0)],6)),[[A,C.loading]])}}}),[["__scopeId","data-v-fbd06971"]]),Nv={class:"apf-script-table-preview__header"},Xv={class:"apf-script-table-preview__title"},Rv={class:"apf-script-table-preview__meta"},Hv={key:0},Sv={key:1},Mv={class:"apf-script-table-preview__tabs"},Dv={key:0,class:"apf-script-table-preview__info"},Kv={class:"apf-script-table-preview__info-item"},Fv={class:"apf-script-table-preview__info-item"},zv={class:"apf-script-table-preview__info-item"},Jv={class:"apf-script-table-preview__info-item"},UW=E(a.defineComponent({__name:"ScriptTablePreview",props:{content:{},data:{},showActions:{type:Boolean,default:!0}},emits:["copy"],setup(C,{emit:I}){const g=C,A=I,i=a.ref("scenes"),l=a.computed(()=>{var n;return g.data!=null&&typeof g.data=="object"?g.data:g.content?(n=eA(g.content))==null?void 0:n.data:null}),e=a.computed(()=>lA(l.value)==="script"),t=a.computed(()=>{const n=l.value;return!n||!e.value?null:{title:String(n.title??""),genre:String(n.genre??""),durationRange:String(n.durationRange??""),durationSuggestionSec:Number(n.durationSuggestionSec??0),tone:String(n.tone??""),clipDurationSec:Number(n.clipDurationSec??0),characters:Array.isArray(n.characters)?n.characters:[],scenes:Array.isArray(n.scenes)?n.scenes:[]}}),c=a.computed(()=>{var n;if((n=g.content)!=null&&n.trim()){const s=eA(g.content);return(s==null?void 0:s.jsonText)??g.content}try{return JSON.stringify(l.value??null,null,2)}catch{return""}});function d(n){return Array.isArray(n)?n.map(String).join("、"):typeof n=="string"?n:"—"}function o(){var n;c.value&&((n=navigator.clipboard)==null||n.writeText(c.value),A("copy",c.value))}return(n,s)=>{const Z=a.resolveComponent("el-table-column"),m=a.resolveComponent("el-table");return t.value?(a.openBlock(),a.createBlock(a.unref(cm),{key:0,class:"apf-script-table-preview",padding:"0"},{default:a.withCtx(()=>[a.createElementVNode("div",Nv,[a.createElementVNode("div",Xv,[s[3]||(s[3]=a.createElementVNode("span",{"aria-hidden":"true"},"📝",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.title||"漫剧剧本"),1)]),a.createElementVNode("div",Rv,[t.value.genre?(a.openBlock(),a.createElementBlock("span",Hv,"类型: "+a.toDisplayString(t.value.genre),1)):a.createCommentVNode("",!0),t.value.durationRange?(a.openBlock(),a.createElementBlock("span",Sv,"时长: "+a.toDisplayString(t.value.durationRange)+"s",1)):a.createCommentVNode("",!0),a.createElementVNode("span",null,"角色 "+a.toDisplayString(t.value.characters.length),1),a.createElementVNode("span",null,"场景 "+a.toDisplayString(t.value.scenes.length),1)]),C.showActions?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-script-table-preview__action",onClick:o}," 复制 JSON ")):a.createCommentVNode("",!0)]),a.createElementVNode("div",Mv,[a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="info"}),onClick:s[0]||(s[0]=b=>i.value="info")}," 基本信息 ",2),a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="characters"}),onClick:s[1]||(s[1]=b=>i.value="characters")}," 角色 ("+a.toDisplayString(t.value.characters.length)+") ",3),a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="scenes"}),onClick:s[2]||(s[2]=b=>i.value="scenes")}," 场景 ("+a.toDisplayString(t.value.scenes.length)+") ",3)]),i.value==="info"?(a.openBlock(),a.createElementBlock("div",Dv,[a.createElementVNode("div",Kv,[s[4]||(s[4]=a.createElementVNode("span",null,"标题",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.title||"—"),1)]),a.createElementVNode("div",Fv,[s[5]||(s[5]=a.createElementVNode("span",null,"类型",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.genre||"—"),1)]),a.createElementVNode("div",zv,[s[6]||(s[6]=a.createElementVNode("span",null,"基调",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.tone||"—"),1)]),a.createElementVNode("div",Jv,[s[7]||(s[7]=a.createElementVNode("span",null,"成片时长",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.clipDurationSec||"—")+"s",1)])])):i.value==="characters"?(a.openBlock(),a.createBlock(m,{key:1,data:t.value.characters,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无角色"},{default:a.withCtx(()=>[a.createVNode(Z,{prop:"name",label:"姓名","min-width":"100"}),a.createVNode(Z,{prop:"gender",label:"性别",width:"72"}),a.createVNode(Z,{prop:"age",label:"年龄",width:"72"}),a.createVNode(Z,{label:"外貌","min-width":"180","show-overflow-tooltip":""},{default:a.withCtx(({row:b})=>[a.createTextVNode(a.toDisplayString(b.appearance||"—"),1)]),_:1})]),_:1},8,["data"])):(a.openBlock(),a.createBlock(m,{key:2,data:t.value.scenes,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无场景"},{default:a.withCtx(()=>[a.createVNode(Z,{prop:"id",label:"场景",width:"72"}),a.createVNode(Z,{prop:"heading",label:"标题","min-width":"120","show-overflow-tooltip":""}),a.createVNode(Z,{label:"出场",width:"120","show-overflow-tooltip":""},{default:a.withCtx(({row:b})=>[a.createTextVNode(a.toDisplayString(d(b.who??b.characters)),1)]),_:1}),a.createVNode(Z,{prop:"setting",label:"场景设置","min-width":"120","show-overflow-tooltip":""}),a.createVNode(Z,{prop:"action",label:"动作","min-width":"180","show-overflow-tooltip":""}),a.createVNode(Z,{prop:"dialogue",label:"对白","min-width":"140","show-overflow-tooltip":""})]),_:1},8,["data"]))]),_:1})):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-8780c811"]]),vv={class:"apf-storyboard-table-preview__header"},kv={class:"apf-storyboard-table-preview__meta"},Lv={key:0},Tv={key:1},xv={class:"apf-storyboard-table-preview__tabs"},OW=E(a.defineComponent({__name:"StoryboardTablePreview",props:{content:{},data:{},showActions:{type:Boolean,default:!0}},emits:["copy"],setup(C,{emit:I}){const g=C,A=I,i=a.ref("shots"),l=a.computed(()=>{var s;return g.data!=null&&typeof g.data=="object"?g.data:g.content?(s=eA(g.content))==null?void 0:s.data:null}),e=a.computed(()=>lA(l.value)==="storyboard"),t=a.computed(()=>{const s=l.value;return!s||!e.value?null:{totalDurationSec:Number(s.totalDurationSec??0),clipDurationSec:Number(s.clipDurationSec??0),shots:Array.isArray(s.shots)?s.shots:[],seconds:Array.isArray(s.seconds)?s.seconds:[]}});a.watch(t,s=>{s&&s.shots.length===0&&s.seconds.length>0&&(i.value="seconds")},{immediate:!0});const c=a.computed(()=>{var s;if((s=g.content)!=null&&s.trim()){const Z=eA(g.content);return(Z==null?void 0:Z.jsonText)??g.content}try{return JSON.stringify(l.value??null,null,2)}catch{return""}});function d(s,Z){return s==null&&Z==null?"—":`${s??"?"}s - ${Z??"?"}s`}function o(s){return Array.isArray(s)?s.map(String).join("、"):typeof s=="string"?s:"—"}function n(){var s;c.value&&((s=navigator.clipboard)==null||s.writeText(c.value),A("copy",c.value))}return(s,Z)=>{const m=a.resolveComponent("el-table-column"),b=a.resolveComponent("el-table");return t.value?(a.openBlock(),a.createBlock(a.unref(cm),{key:0,class:"apf-storyboard-table-preview",padding:"0"},{default:a.withCtx(()=>[a.createElementVNode("div",vv,[Z[2]||(Z[2]=a.createElementVNode("div",{class:"apf-storyboard-table-preview__title"},[a.createElementVNode("span",{"aria-hidden":"true"},"🎬"),a.createElementVNode("strong",null,"视频分镜")],-1)),a.createElementVNode("div",kv,[t.value.totalDurationSec?(a.openBlock(),a.createElementBlock("span",Lv,"总时长 "+a.toDisplayString(t.value.totalDurationSec)+"s",1)):a.createCommentVNode("",!0),t.value.clipDurationSec?(a.openBlock(),a.createElementBlock("span",Tv,"成片 "+a.toDisplayString(t.value.clipDurationSec)+"s",1)):a.createCommentVNode("",!0),a.createElementVNode("span",null,"镜头 "+a.toDisplayString(t.value.shots.length),1),a.createElementVNode("span",null,"逐秒 "+a.toDisplayString(t.value.seconds.length),1)]),C.showActions?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-storyboard-table-preview__action",onClick:n}," 复制 JSON ")):a.createCommentVNode("",!0)]),a.createElementVNode("div",xv,[a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="shots"}),onClick:Z[0]||(Z[0]=G=>i.value="shots")}," 镜头列表 ("+a.toDisplayString(t.value.shots.length)+") ",3),a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="seconds"}),onClick:Z[1]||(Z[1]=G=>i.value="seconds")}," 逐秒表 ("+a.toDisplayString(t.value.seconds.length)+") ",3)]),i.value==="shots"?(a.openBlock(),a.createBlock(b,{key:0,data:t.value.shots,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无镜头"},{default:a.withCtx(()=>[a.createVNode(m,{prop:"id",label:"镜头",width:"72"}),a.createVNode(m,{label:"时间",width:"110"},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(d(G.startSec,G.endSec)),1)]),_:1}),a.createVNode(m,{label:"角色","min-width":"100","show-overflow-tooltip":""},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(o(G.who)),1)]),_:1}),a.createVNode(m,{prop:"does",label:"动作","min-width":"180","show-overflow-tooltip":""}),a.createVNode(m,{prop:"camera",label:"机位","min-width":"120","show-overflow-tooltip":""}),a.createVNode(m,{prop:"dialogue",label:"对白","min-width":"120","show-overflow-tooltip":""})]),_:1},8,["data"])):(a.openBlock(),a.createBlock(b,{key:1,data:t.value.seconds,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无逐秒表"},{default:a.withCtx(()=>[a.createVNode(m,{label:"秒",width:"64"},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(G.sec??G.t??"—")+"s",1)]),_:1}),a.createVNode(m,{label:"角色","min-width":"100","show-overflow-tooltip":""},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(o(G.who)),1)]),_:1}),a.createVNode(m,{prop:"does",label:"动作","min-width":"180","show-overflow-tooltip":""}),a.createVNode(m,{prop:"camera",label:"机位","min-width":"120","show-overflow-tooltip":""}),a.createVNode(m,{prop:"dialogue",label:"对白","min-width":"120","show-overflow-tooltip":""})]),_:1},8,["data"]))]),_:1})):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-779273c4"]]),dm=a.defineComponent({__name:"StructuredJsonPreview",props:{content:{},data:{},showActions:{type:Boolean,default:!0}},emits:["copy"],setup(C,{expose:I,emit:g}){const A=C,i=g,l=a.computed(()=>{if(A.data!=null){const d=lA(A.data);return d?{kind:d,data:A.data,content:A.content}:null}if(!A.content)return null;const t=eA(A.content);if(!t)return null;const c=lA(t.data);return c?{kind:c,data:t.data,content:t.jsonText}:null}),e=a.computed(()=>{var t;return((t=l.value)==null?void 0:t.kind)??null});return I({kind:e}),(t,c)=>e.value==="storyboard"&&l.value?(a.openBlock(),a.createBlock(OW,{key:0,content:l.value.content,data:l.value.data,"show-actions":C.showActions,onCopy:c[0]||(c[0]=d=>i("copy",d))},null,8,["content","data","show-actions"])):e.value==="script"&&l.value?(a.openBlock(),a.createBlock(UW,{key:1,content:l.value.content,data:l.value.data,"show-actions":C.showActions,onCopy:c[1]||(c[1]=d=>i("copy",d))},null,8,["content","data","show-actions"])):a.createCommentVNode("",!0)}}),fv={key:1,class:"apf-artifact-gallery__videos"},jv={key:2,class:"apf-artifact-gallery__structured"},Qv={key:3,class:"apf-artifact-gallery__jsons"},Uv={key:4,class:"apf-artifact-gallery__files"},Ov={key:5,class:"apf-artifact-gallery__texts"},pa=E(a.defineComponent({__name:"ArtifactGallery",props:{items:{},size:{default:"default"},max:{default:12}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1),l=a.ref(null),e=a.computed(()=>g.items.slice(0,g.max)),t=a.computed(()=>e.value.filter(G=>G.kind==="image"&&G.url).map(G=>G.url)),c=a.computed(()=>e.value.filter(G=>G.kind==="video"&&G.url)),d=a.computed(()=>e.value.filter(G=>{var r;return G.kind==="json"&&((r=G.text)==null?void 0:r.trim())&&JZ(G.text)})),o=a.computed(()=>e.value.filter(G=>{var r;return G.kind==="json"&&((r=G.text)==null?void 0:r.trim())&&!JZ(G.text)})),n=a.computed(()=>e.value.filter(G=>{var r;return G.kind==="text"&&((r=G.text)==null?void 0:r.trim())})),s=a.computed(()=>e.value.filter(G=>G.kind==="pdf"||G.kind==="office"||G.kind==="file"||G.kind==="image"&&!G.url&&G.documentId)),Z=a.computed(()=>t.value.length>0||c.value.length>0||d.value.length>0||o.value.length>0||n.value.length>0||s.value.length>0);function m(G){A("preview",G)}function b(G){l.value=G,i.value=!0}return(G,r)=>{var h,u;return Z.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["apf-artifact-gallery",`apf-artifact-gallery--${C.size}`])},[t.value.length?(a.openBlock(),a.createBlock(TW,{key:0,urls:t.value,size:C.size},null,8,["urls","size"])):a.createCommentVNode("",!0),c.value.length?(a.openBlock(),a.createElementBlock("div",fv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,B=>(a.openBlock(),a.createBlock(xW,{key:B.id,url:B.url,size:C.size},null,8,["url","size"]))),128))])):a.createCommentVNode("",!0),d.value.length?(a.openBlock(),a.createElementBlock("div",jv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.value,B=>(a.openBlock(),a.createBlock(a.unref(dm),{key:B.id,content:B.text},null,8,["content"]))),128))])):a.createCommentVNode("",!0),o.value.length?(a.openBlock(),a.createElementBlock("div",Qv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,B=>(a.openBlock(),a.createBlock(a.unref(jW),{key:B.id,title:B.label||"JSON 输出",content:B.text,onOpenDetail:W=>b(B)},null,8,["title","content","onOpenDetail"]))),128))])):a.createCommentVNode("",!0),s.value.length?(a.openBlock(),a.createElementBlock("div",Uv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,B=>(a.openBlock(),a.createBlock(fW,{key:B.id,item:B,onPreview:m},null,8,["item"]))),128))])):a.createCommentVNode("",!0),n.value.length?(a.openBlock(),a.createElementBlock("div",Ov,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,B=>(a.openBlock(),a.createBlock(tm,{key:B.id,text:B.text,label:B.label,size:C.size},null,8,["text","label","size"]))),128))])):a.createCommentVNode("",!0),a.createVNode(a.unref(QW),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=B=>i.value=B),title:((h=l.value)==null?void 0:h.label)||"JSON 详情",content:(u=l.value)==null?void 0:u.text},null,8,["modelValue","title","content"])],2)):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-02483b69"]]),Ev={class:"apf-thinking-head-main"},Pv={class:"apf-thinking-titles"},_v={class:"apf-thinking-title"},qv={key:0,class:"apf-thinking-badge"},$v={class:"apf-thinking-sub"},gk={class:"apf-thinking-head-aside"},Ik={class:"apf-thinking-status"},Ck={class:"apf-thinking-chevron","aria-hidden":"true"},Ak={key:0,class:"apf-thinking-body"},ik=["innerHTML"],EW=E(a.defineComponent({__name:"ThinkingBlock",props:{content:{},title:{default:"思考过程"},badge:{},defaultCollapsed:{type:Boolean,default:!0},statusLabel:{default:"已完成"}},setup(C){const I=C,g=a.ref(I.defaultCollapsed),A=a.computed(()=>{if(!I.content)return"";const e=I.content.replace(/<[^>]*>/g,"").trim();return e.length>100?`${e.slice(0,100)}...`:e}),i=a.computed(()=>I.content?qd(I.content):"");function l(){g.value=!g.value}return(e,t)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-thinking",{"is-expanded":!g.value}])},[a.createElementVNode("button",{type:"button",class:"apf-thinking-head",onClick:l},[a.createElementVNode("div",Ev,[t[0]||(t[0]=a.createElementVNode("span",{class:"apf-thinking-icon","aria-hidden":"true"},[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("circle",{cx:"8",cy:"8",r:"5.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),a.createElementVNode("path",{d:"M8 5v3.2L10 10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})])],-1)),a.createElementVNode("div",Pv,[a.createElementVNode("div",_v,[a.createTextVNode(a.toDisplayString(C.title)+" ",1),C.badge?(a.openBlock(),a.createElementBlock("span",qv,a.toDisplayString(C.badge),1)):a.createCommentVNode("",!0)]),a.createElementVNode("div",$v,a.toDisplayString(g.value?A.value:"已完成思考"),1)])]),a.createElementVNode("div",gk,[a.createElementVNode("span",Ik,a.toDisplayString(C.statusLabel),1),a.createElementVNode("span",Ck,a.toDisplayString(g.value?"▾":"▴"),1)])]),g.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Ak,[a.createElementVNode("div",{class:"apf-thinking-md",innerHTML:i.value},null,8,ik)]))],2))}}),[["__scopeId","data-v-ecf2c951"]]),lk={class:"apf-node-result-preview","data-testid":"node-result-preview"},ek={key:0,class:"apf-node-result-preview__block"},tk={key:1,class:"apf-node-result-preview__block"},ak={key:0,class:"apf-node-result-preview__label"},ck=["innerHTML"],dk={key:2,class:"apf-node-result-preview__block"},ok={key:3,class:"apf-node-result-preview__block"},nk={key:4,class:"apf-node-result-preview__block"},sk={key:0,class:"apf-node-result-preview__label"},Zk={key:5,class:"apf-node-result-preview__block"},mk={key:6,class:"apf-node-result-preview__block"},bk={key:7,class:"apf-node-result-preview__block"},Gk={key:0,class:"apf-node-result-preview__label"},rk={key:8,class:"apf-node-result-preview__block"},hk={key:0,class:"apf-node-result-preview__label"},uk={key:9,class:"apf-node-result-preview__block"},Bk={key:10,class:"apf-node-result-preview__block"},Wk={key:11,class:"apf-node-result-preview__block"},wk={class:"apf-node-result-preview__unresolved"},Yk=["onClick"],PW=E(a.defineComponent({__name:"NodeResultPreview",props:{blocks:{},data:{},nodeType:{},streamingText:{},streamingReasoning:{},role:{},audience:{},includeLeftoverFields:{type:Boolean},includeFallbackFieldTables:{type:Boolean},thinkingCollapsed:{type:Boolean,default:!0}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,{copy:i}=Td(),l=a.computed(()=>({nodeType:g.nodeType,streamingText:g.streamingText,streamingReasoning:g.streamingReasoning,role:g.role,audience:g.audience,includeLeftoverFields:g.includeLeftoverFields,includeFallbackFieldTables:g.includeFallbackFieldTables})),e=a.computed(()=>{var d;return(d=g.blocks)!=null&&d.length?g.blocks:TZ(g.data,l.value)});function t(d){return qd(d)}async function c(d){const o=d.copyPayload||d.message||"";o&&await i(o)}return(d,o)=>(a.openBlock(),a.createElementBlock("div",lk,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.value,(n,s)=>{var Z,m,b;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`${n.kind}-${s}`},[n.kind==="thinking"&&n.text?(a.openBlock(),a.createElementBlock("section",ek,[a.createVNode(a.unref(EW),{content:n.text,title:n.title||"思考过程","default-collapsed":C.thinkingCollapsed},null,8,["content","title","default-collapsed"])])):n.kind==="markdown"&&n.text?(a.openBlock(),a.createElementBlock("section",tk,[n.title?(a.openBlock(),a.createElementBlock("div",ak,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"apf-node-result-preview__md",innerHTML:t(n.text)},null,8,ck)])):n.kind==="text"&&n.text?(a.openBlock(),a.createElementBlock("section",dk,[a.createVNode(a.unref(tm),{text:n.text,label:n.title||"文本"},null,8,["text","label"])])):n.kind==="code"&&n.text?(a.openBlock(),a.createElementBlock("section",ok,[a.createVNode(a.unref(UB),{text:n.text,title:n.title||"代码输出",language:n.language||"text"},null,8,["text","title","language"])])):n.kind==="script"||n.kind==="storyboard"?(a.openBlock(),a.createElementBlock("section",nk,[n.title?(a.openBlock(),a.createElementBlock("div",sk,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createVNode(a.unref(dm),{content:n.text,data:n.data},null,8,["content","data"])])):n.kind==="table"&&n.table?(a.openBlock(),a.createElementBlock("section",Zk,[a.createVNode(a.unref(jB),{tables:[n.table]},null,8,["tables"])])):n.kind==="keyvalue"&&((Z=n.entries)!=null&&Z.length)?(a.openBlock(),a.createElementBlock("section",mk,[a.createVNode(a.unref(QB),{entries:n.entries,title:n.title},null,8,["entries","title"])])):n.kind==="chart"&&n.chartOption?(a.openBlock(),a.createElementBlock("section",bk,[n.title?(a.openBlock(),a.createElementBlock("div",Gk,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createVNode(a.unref(fB),{option:n.chartOption,"chart-type":n.chartType},null,8,["option","chart-type"])])):n.kind==="media"&&((m=n.artifacts)!=null&&m.length)?(a.openBlock(),a.createElementBlock("section",rk,[n.title?(a.openBlock(),a.createElementBlock("div",hk,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createVNode(a.unref(pa),{items:n.artifacts,onPreview:o[0]||(o[0]=G=>A("preview",G))},null,8,["items"])])):n.kind==="hitl"&&((b=n.hitlItems)!=null&&b.length)?(a.openBlock(),a.createElementBlock("section",uk,[a.createVNode(a.unref(OB),{items:n.hitlItems,title:n.title,message:n.text},null,8,["items","title","message"])])):n.kind==="empty"?(a.openBlock(),a.createElementBlock("section",Bk,[a.createVNode(a.unref(iA),{title:n.title||"无输出",description:"该节点没有可展示的结果"},null,8,["title"])])):n.kind==="unresolved"?(a.openBlock(),a.createElementBlock("section",Wk,[a.createElementVNode("div",wk,[a.createElementVNode("p",null,a.toDisplayString(n.message||"暂无匹配的人读预览"),1),n.copyPayload?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-node-result-preview__copy",onClick:G=>c(n)}," 复制数据 ",8,Yk)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)],64)}),128))]))}}),[["__scopeId","data-v-865ddb62"]]),Vk={key:0,class:"apf-stat-card__bar"},pk={key:1,class:"apf-stat-card__body"},yk={key:2,class:"apf-stat-card__body"},Nk={class:"apf-stat-card__label"},Xk={class:"apf-stat-card__value-row"},Rk={class:"apf-stat-card__value"},Hk={key:0,class:"apf-stat-card__unit"},Sk={key:0,class:"apf-stat-card__spark",viewBox:"0 0 80 32",preserveAspectRatio:"none","aria-hidden":"true"},Mk=["d","stroke"],Dk=E(a.defineComponent({__name:"StatCard",props:{label:{},value:{},unit:{},trend:{},sparkline:{},status:{},to:{},loading:{type:Boolean,default:!1}},emits:["click"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{const d=g.trend;if(!d||d.direction==="flat")return"var(--text-color-muted)";const o=d.positiveIsGood!==!1;return(d.direction==="up"?o:!o)?"var(--color-success)":"var(--color-danger)"}),l=a.computed(()=>{var o;const d=(o=g.trend)==null?void 0:o.direction;return d==="up"?"↑":d==="down"?"↓":"→"}),e=a.computed(()=>{const d=g.sparkline;if(!(d!=null&&d.length))return"";const o=80,n=32,s=Math.min(...d),m=Math.max(...d)-s||1;return d.map((b,G)=>{const r=G/Math.max(d.length-1,1)*o,h=n-(b-s)/m*(n-4)-2;return`${G===0?"M":"L"}${r.toFixed(1)},${h.toFixed(1)}`}).join(" ")}),t=a.computed(()=>g.status==="healthy"?"var(--color-success)":g.status==="warning"?"var(--color-warning)":g.status==="error"?"var(--color-danger)":"var(--color-primary)");function c(d){g.to||A("click",d)}return(d,o)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(C.to?"a":"div"),{class:a.normalizeClass(["apf-stat-card",[C.status?`apf-stat-card--${C.status}`:"",{"apf-stat-card--clickable":!!C.to}]]),href:C.to||void 0,role:C.to?void 0:"button",tabindex:C.to?void 0:0,onClick:c,onKeydown:o[0]||(o[0]=a.withKeys(a.withModifiers(n=>!C.to&&c(n),["prevent"]),["enter"]))},{default:a.withCtx(()=>{var n;return[C.status?(a.openBlock(),a.createElementBlock("div",Vk)):a.createCommentVNode("",!0),C.loading?(a.openBlock(),a.createElementBlock("div",pk,[...o[1]||(o[1]=[a.createElementVNode("div",{class:"apf-stat-card__skel apf-stat-card__skel--label"},null,-1),a.createElementVNode("div",{class:"apf-stat-card__skel apf-stat-card__skel--value"},null,-1),a.createElementVNode("div",{class:"apf-stat-card__skel apf-stat-card__skel--spark"},null,-1)])])):(a.openBlock(),a.createElementBlock("div",yk,[a.createElementVNode("div",Nk,a.toDisplayString(C.label),1),a.createElementVNode("div",Xk,[a.createElementVNode("span",Rk,a.toDisplayString(C.value),1),C.unit?(a.openBlock(),a.createElementBlock("span",Hk,a.toDisplayString(C.unit),1)):a.createCommentVNode("",!0),C.trend?(a.openBlock(),a.createElementBlock("span",{key:1,class:"apf-stat-card__trend",style:a.normalizeStyle({color:i.value})},[a.createTextVNode(a.toDisplayString(l.value)+" ",1),C.trend.percent!=null?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(C.trend.percent)+"%",1)],64)):a.createCommentVNode("",!0)],4)):a.createCommentVNode("",!0)]),(n=C.sparkline)!=null&&n.length?(a.openBlock(),a.createElementBlock("svg",Sk,[a.createElementVNode("path",{d:e.value,fill:"none",stroke:t.value,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Mk)])):a.createCommentVNode("",!0)]))]}),_:1},40,["class","href","role","tabindex"]))}}),[["__scopeId","data-v-3e48d232"]]),Kk=E(a.defineComponent({__name:"SeverityBadge",props:{severity:{},pulse:{type:Boolean},size:{default:"default"}},setup(C){const I=C,g=a.computed(()=>I.pulse??I.severity==="critical"),A={critical:"严重",warning:"警告",info:"信息"};return(i,l)=>(a.openBlock(),a.createElementBlock("span",{class:a.normalizeClass(["apf-severity-badge",[`apf-severity-badge--${C.severity}`,`apf-severity-badge--${C.size}`,{"apf-severity-badge--pulse":g.value}]])},[l[0]||(l[0]=a.createElementVNode("i",{class:"apf-severity-badge__dot","aria-hidden":"true"},null,-1)),a.createElementVNode("span",null,a.toDisplayString(A[C.severity]),1)],2))}}),[["__scopeId","data-v-e6c92ddb"]]),Fk=["onClick"],zk={class:"apf-service-grid__body"},Jk={class:"apf-service-grid__name"},vk={key:0,class:"apf-service-grid__metrics"},kk={key:0},Lk={key:1},Tk={key:2},xk=E(a.defineComponent({__name:"ServiceGrid",props:{services:{},columns:{},loading:{type:Boolean,default:!1}},emits:["service-click"],setup(C,{emit:I}){const g={healthy:"健康",warning:"告警",error:"故障",unknown:"未知"},A=C,i=I,l=a.computed(()=>A.columns&&A.columns>0?{gridTemplateColumns:`repeat(${A.columns}, minmax(0, 1fr))`}:{gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))"});function e(t){if(!t)return!1;const c=Date.parse(t);return Number.isFinite(c)&&Date.now()-c>300*1e3}return(t,c)=>C.loading?(a.openBlock(),a.createElementBlock("div",{key:0,class:"apf-service-grid",style:a.normalizeStyle(l.value)},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(6,d=>a.createElementVNode("div",{key:d,class:"apf-service-grid__skel"})),64))],4)):C.services.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:"apf-service-grid",style:a.normalizeStyle(l.value)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.services,d=>(a.openBlock(),a.createElementBlock("button",{key:d.id,type:"button",class:a.normalizeClass(["apf-service-grid__item",`apf-service-grid__item--${d.status}`]),onClick:o=>i("service-click",d)},[c[0]||(c[0]=a.createElementVNode("div",{class:"apf-service-grid__bar"},null,-1)),a.createElementVNode("div",zk,[a.createElementVNode("div",Jk,a.toDisplayString(d.name),1),a.createElementVNode("div",{class:a.normalizeClass(["apf-service-grid__status",`apf-service-grid__status--${d.status}`])},a.toDisplayString(g[d.status]),3),d.metrics?(a.openBlock(),a.createElementBlock("div",vk,[d.metrics.errorRate!=null?(a.openBlock(),a.createElementBlock("span",kk," err "+a.toDisplayString(d.metrics.errorRate.toFixed(1))+"% ",1)):a.createCommentVNode("",!0),d.metrics.latencyP95!=null?(a.openBlock(),a.createElementBlock("span",Lk," p95 "+a.toDisplayString(Math.round(d.metrics.latencyP95))+"ms ",1)):a.createCommentVNode("",!0),d.metrics.eventCount!=null?(a.openBlock(),a.createElementBlock("span",Tk," n "+a.toDisplayString(d.metrics.eventCount.toLocaleString()),1)):a.createCommentVNode("",!0),d.metrics.lastSeen?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass({"is-stale":e(d.metrics.lastSeen)})},a.toDisplayString(a.unref(_1)(d.metrics.lastSeen)),3)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])],10,Fk))),128))],4)):(a.openBlock(),a.createBlock(a.unref(iA),{key:1,title:"暂无服务",description:"等待上报或检查筛选条件"}))}}),[["__scopeId","data-v-7e1890bc"]]),fk={class:"apf-status-timeline"},jk={class:"apf-status-timeline__ticks"},Qk=E(a.defineComponent({__name:"StatusTimeline",props:{segments:{},range:{},height:{default:24},showTooltip:{type:Boolean,default:!0}},setup(C){const I={healthy:"健康",warning:"告警",error:"故障",unknown:"未知"},g=C,A=a.computed(()=>{if(g.range)return g.range;if(!g.segments.length){const c=new Date().toISOString();return{start:c,end:c}}return{start:g.segments[0].start,end:g.segments[g.segments.length-1].end}}),i=a.computed(()=>{const c=Date.parse(A.value.start),d=Date.parse(A.value.end);return Math.max(d-c,1)}),l=a.computed(()=>{const c=Date.parse(A.value.start);return g.segments.map(d=>{const o=Date.parse(d.start),n=Date.parse(d.end),s=(o-c)/i.value*100,Z=(n-o)/i.value*100;return{...d,left:Math.max(0,s),width:Math.max(.2,Z),durationMs:Math.max(0,n-o)}})});function e(c){const d=new Date(c),o=String(d.getMonth()+1).padStart(2,"0"),n=String(d.getDate()).padStart(2,"0"),s=String(d.getHours()).padStart(2,"0"),Z=String(d.getMinutes()).padStart(2,"0");return`${o}-${n} ${s}:${Z}`}function t(c){return`${I[c.status]} · ${e(c.start)} ~ ${e(c.end)} · ${q1(c.durationMs)}`}return(c,d)=>{const o=a.resolveComponent("el-tooltip");return a.openBlock(),a.createElementBlock("div",fk,[a.createElementVNode("div",{class:"apf-status-timeline__track",style:a.normalizeStyle({height:`${C.height}px`})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,(n,s)=>(a.openBlock(),a.createBlock(o,{key:`${n.start}-${s}`,disabled:!C.showTooltip,content:t(n),placement:"top"},{default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass(["apf-status-timeline__seg",`apf-status-timeline__seg--${n.status}`]),style:a.normalizeStyle({left:`${n.left}%`,width:`${n.width}%`})},null,6)]),_:2},1032,["disabled","content"]))),128))],4),a.createElementVNode("div",jk,[a.createElementVNode("span",null,a.toDisplayString(e(A.value.start)),1),a.createElementVNode("span",null,a.toDisplayString(e(A.value.end)),1)])])}}}),[["__scopeId","data-v-97b528a0"]]),Uk={key:0,class:"apf-log-stream__loading"},Ok=["onClick"],Ek={class:"apf-log-stream__ts"},Pk={class:"apf-log-stream__service"},_k=["innerHTML"],qk={key:0,class:"apf-log-stream__panel"},$k={class:"apf-log-stream__panel-head"},g3={key:0,class:"apf-log-stream__panel-body"},I3={key:1,class:"apf-log-stream__panel-empty"},_W=5,C3=E(a.defineComponent({__name:"LogStream",props:{logs:{},height:{},rowHeight:{default:36},highlight:{},autoScroll:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["log-click","reach-top","reach-bottom"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(null),l=a.ref(0),e=a.ref(null);let t=!0,c=null;const d=a.computed(()=>Math.ceil(g.height/g.rowHeight)+_W*2),o=a.computed(()=>Math.max(0,Math.floor(l.value/g.rowHeight)-_W)),n=a.computed(()=>Math.min(g.logs.length,o.value+d.value)),s=a.computed(()=>g.logs.slice(o.value,n.value)),Z=a.computed(()=>g.logs.length*g.rowHeight),m=a.computed(()=>o.value*g.rowHeight),b=a.computed(()=>g.logs.find(V=>V.id===e.value)??null),G=a.computed(()=>{var V;if(!((V=b.value)!=null&&V.payload))return"";try{return JSON.stringify(b.value.payload,null,2)}catch{return String(b.value.payload)}});function r(V){const y=new Date(V);if(Number.isNaN(y.getTime()))return V;const N=H=>String(H).padStart(2,"0");return`${N(y.getMonth()+1)}-${N(y.getDate())} ${N(y.getHours())}:${N(y.getMinutes())}:${N(y.getSeconds())}`}function h(V){var R;if(!((R=g.highlight)!=null&&R.trim()))return u(V);const y=g.highlight.trim(),N=u(V),H=new RegExp(`(${B(y)})`,"gi");return N.replace(H,'<mark class="apf-log-stream__mark">$1</mark>')}function u(V){return V.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function B(V){return V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W(V){if(V.scrollHeight-V.scrollTop-V.clientHeight>24){t=!0;return}t&&(t=!1,c&&clearTimeout(c),c=setTimeout(()=>{A("reach-bottom")},120))}function w(){const V=i.value;V&&(l.value=V.scrollTop,V.scrollTop<=4&&A("reach-top"),W(V))}function Y(V){e.value=e.value===V.id?null:V.id,A("log-click",V)}function p(){e.value=null}return a.watch(()=>g.logs.length,async(V,y)=>{const H=V-(y??0),R=i.value;if(!(!R||H===0)){if(H>0){if(g.autoScroll)await a.nextTick(),R.scrollTop=0,l.value=0;else{const D=R.scrollTop+H*g.rowHeight;R.scrollTop=D,l.value=D}return}await a.nextTick(),l.value=R.scrollTop}}),a.watch(e,V=>{V!=null}),a.onMounted(()=>{var V;(V=i.value)==null||V.addEventListener("scroll",w,{passive:!0})}),a.onUnmounted(()=>{var V;(V=i.value)==null||V.removeEventListener("scroll",w),c&&clearTimeout(c)}),(V,y)=>(a.openBlock(),a.createElementBlock("div",{class:"apf-log-stream-wrap",style:a.normalizeStyle({height:`${C.height}px`})},[a.createElementVNode("div",{ref_key:"scrollerRef",ref:i,class:a.normalizeClass(["apf-log-stream",{"apf-log-stream--with-panel":!!b.value}])},[C.loading?(a.openBlock(),a.createElementBlock("div",Uk,"加载中…")):C.logs.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:"apf-log-stream__phantom",style:a.normalizeStyle({height:`${Z.value}px`})},[a.createElementVNode("div",{class:"apf-log-stream__window",style:a.normalizeStyle({transform:`translateY(${m.value}px)`})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,N=>(a.openBlock(),a.createElementBlock("div",{key:N.id,class:a.normalizeClass(["apf-log-stream__row",{"is-active":e.value===N.id}]),style:a.normalizeStyle({height:`${C.rowHeight}px`}),onClick:H=>Y(N)},[a.createElementVNode("i",{class:a.normalizeClass(["apf-log-stream__bar",`apf-log-stream__bar--${N.level}`]),"aria-hidden":"true"},null,2),a.createElementVNode("span",Ek,a.toDisplayString(r(N.timestamp)),1),a.createElementVNode("span",{class:a.normalizeClass(["apf-log-stream__level",`apf-log-stream__level--${N.level}`])},a.toDisplayString(N.level),3),a.createElementVNode("span",Pk,a.toDisplayString(N.service),1),a.createElementVNode("span",{class:"apf-log-stream__msg",innerHTML:h(N.message)},null,8,_k)],14,Ok))),128))],4)],4)):(a.openBlock(),a.createBlock(a.unref(iA),{key:1,title:"暂无日志",description:"等待事件推送或调整筛选"}))],2),b.value?(a.openBlock(),a.createElementBlock("aside",qk,[a.createElementVNode("header",$k,[a.createElementVNode("span",null,"Payload · "+a.toDisplayString(b.value.service),1),a.createElementVNode("button",{type:"button",class:"apf-log-stream__panel-close",onClick:p}," 关闭 ")]),G.value?(a.openBlock(),a.createElementBlock("pre",g3,a.toDisplayString(G.value),1)):(a.openBlock(),a.createElementBlock("div",I3,"无 payload"))])):a.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-1766eb79"]]),A3={class:"apf-threshold-slider__meta"},i3={class:"apf-threshold-slider__unit"},l3={class:"apf-threshold-slider__hint"},e3={class:"apf-threshold-slider__row"},t3=E(a.defineComponent({__name:"ThresholdSlider",props:{type:{},modelValue:{},showInput:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(C,{emit:I}){const g={errorRate:{unit:"%",min:0,max:100,step:1,suggest:5},latency:{unit:"ms",min:100,max:3e4,step:100,suggest:2e3},eventCount:{unit:"次/5分钟",min:10,max:1e4,step:10,suggest:100},timeout:{unit:"分钟",min:1,max:60,step:1,suggest:3}},A=C,i=I,l=a.computed(()=>g[A.type]);function e(c){if(c==null||Number.isNaN(c))return;const d=Math.min(l.value.max,Math.max(l.value.min,c));i("update:modelValue",d)}function t(c){const d=Array.isArray(c)?c[0]:c;e(d),i("change",d)}return(c,d)=>{const o=a.resolveComponent("el-slider"),n=a.resolveComponent("el-input-number");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-threshold-slider",{"is-disabled":C.disabled}])},[a.createElementVNode("div",A3,[a.createElementVNode("span",i3,a.toDisplayString(l.value.unit),1),a.createElementVNode("span",l3,"建议 "+a.toDisplayString(l.value.suggest)+a.toDisplayString(l.value.unit),1)]),a.createElementVNode("div",e3,[a.createVNode(o,{"model-value":C.modelValue,min:l.value.min,max:l.value.max,step:l.value.step,disabled:C.disabled,class:"apf-threshold-slider__slider","onUpdate:modelValue":d[0]||(d[0]=s=>e(s)),onChange:t},null,8,["model-value","min","max","step","disabled"]),C.showInput?(a.openBlock(),a.createBlock(n,{key:0,"model-value":C.modelValue,min:l.value.min,max:l.value.max,step:l.value.step,disabled:C.disabled,"controls-position":"right",size:"small",class:"apf-threshold-slider__input","onUpdate:modelValue":e,onChange:d[1]||(d[1]=s=>s!=null&&i("change",s))},null,8,["model-value","min","max","step","disabled"])):a.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-7098971c"]]),a3=E(a.defineComponent({__name:"PageShell",props:{fill:{type:Boolean,default:!1}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([I.$style.shell,C.fill&&I.$style.shellFill])},[a.renderSlot(I.$slots,"default")],2))}}),[["__cssModules",{$style:{shell:"_shell_1qlp7_2",shellFill:"_shellFill_1qlp7_10"}}]]),c3=E(a.defineComponent({__name:"PageHeader",props:{title:{},subtitle:{}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(I.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(I.$style.titleRow)},[a.createElementVNode("div",{class:a.normalizeClass(I.$style.titleLeft)},[a.createElementVNode("h1",{class:a.normalizeClass(I.$style.title)},a.toDisplayString(C.title),3),C.subtitle?(a.openBlock(),a.createElementBlock("p",{key:0,class:a.normalizeClass(I.$style.subtitle)},a.toDisplayString(C.subtitle),3)):a.createCommentVNode("",!0),a.renderSlot(I.$slots,"default")],2),I.$slots.actions||I.$slots.extra?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(I.$style.actions)},[a.renderSlot(I.$slots,"actions"),a.renderSlot(I.$slots,"extra")],2)):a.createCommentVNode("",!0)],2)],2))}}),[["__cssModules",{$style:{header:"_header_ect8w_2",titleRow:"_titleRow_ect8w_6",titleLeft:"_titleLeft_ect8w_14",title:"_title_ect8w_6",subtitle:"_subtitle_ect8w_26",actions:"_actions_ect8w_33"}}]]),d3=["onClick"],o3=E(a.defineComponent({__name:"BreadcrumbNav",props:{items:{}},emits:["navigate"],setup(C,{emit:I}){const g=I;return(A,i)=>C.items.length>0?(a.openBlock(),a.createElementBlock("nav",{key:0,class:a.normalizeClass(A.$style.breadcrumb),"aria-label":"面包屑"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.items,(l,e)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:`${l.label}-${e}`},[e>0?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(A.$style.separator),"aria-hidden":"true"},"/",2)):a.createCommentVNode("",!0),l.to&&e<C.items.length-1?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(A.$style.link),onClick:t=>g("navigate",l.to)},a.toDisplayString(l.label),11,d3)):(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass(A.$style.current)},a.toDisplayString(l.label),3))],64))),128))],2)):a.createCommentVNode("",!0)}}),[["__cssModules",{$style:{breadcrumb:"_breadcrumb_vy5ij_2",separator:"_separator_vy5ij_11",link:"_link_vy5ij_16",current:"_current_vy5ij_30"}}]]),n3={class:"apf-filter-bar"},s3={key:0,class:"apf-filter-bar__title"},Z3={class:"apf-filter-bar__fields"},m3={class:"apf-filter-bar__actions"},b3=E(a.defineComponent({__name:"FilterBar",props:{title:{}},emits:["search","reset"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",n3,[C.title?(a.openBlock(),a.createElementBlock("div",s3,a.toDisplayString(C.title),1)):a.createCommentVNode("",!0),a.createElementVNode("div",Z3,[a.renderSlot(A.$slots,"default",{},void 0,!0)]),a.createElementVNode("div",m3,[a.renderSlot(A.$slots,"actions",{},()=>[a.createVNode(l,{type:"primary",onClick:i[0]||(i[0]=e=>g("search"))},{default:a.withCtx(()=>[...i[2]||(i[2]=[a.createTextVNode("查询",-1)])]),_:1}),a.createVNode(l,{onClick:i[1]||(i[1]=e=>g("reset"))},{default:a.withCtx(()=>[...i[3]||(i[3]=[a.createTextVNode("重置",-1)])]),_:1})],!0)])])}}}),[["__scopeId","data-v-86218301"]]),G3={class:"apf-table-row-actions"},r3=E(a.defineComponent({__name:"TableRowActions",props:{actions:{},collapseAt:{default:5},visibleCount:{default:2}},setup(C){const I=C,g=a.computed(()=>I.actions.length>=I.collapseAt),A=a.computed(()=>g.value?I.actions.slice(0,I.visibleCount):I.actions),i=a.computed(()=>g.value?I.actions.slice(I.visibleCount):[]);function l(e){var t;(t=I.actions.find(c=>c.key===e))==null||t.onClick()}return(e,t)=>{const c=a.resolveComponent("el-button"),d=a.resolveComponent("el-dropdown-item"),o=a.resolveComponent("el-dropdown-menu"),n=a.resolveComponent("el-dropdown");return a.openBlock(),a.createElementBlock("div",G3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(A.value,s=>(a.openBlock(),a.createBlock(c,{key:s.key,link:"",type:s.type??"primary",size:"small",loading:s.loading,onClick:s.onClick},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.label),1)]),_:2},1032,["type","loading","onClick"]))),128)),i.value.length?(a.openBlock(),a.createBlock(n,{key:0,trigger:"click",onCommand:l},{dropdown:a.withCtx(()=>[a.createVNode(o,null,{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,s=>(a.openBlock(),a.createBlock(d,{key:s.key,command:s.key,style:a.normalizeStyle(s.type==="danger"?{color:"var(--el-color-danger)"}:void 0)},{default:a.withCtx(()=>[s.icon?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:s.icon,size:14,style:{"margin-right":"6px"}},null,8,["name"])):a.createCommentVNode("",!0),a.createTextVNode(" "+a.toDisplayString(s.label),1)]),_:2},1032,["command","style"]))),128))]),_:1})]),default:a.withCtx(()=>[a.createVNode(c,{link:"",type:"primary",size:"small"},{default:a.withCtx(()=>[t[0]||(t[0]=a.createTextVNode(" 更多 ",-1)),a.createVNode(a.unref($),{name:"arrow-down",size:12,style:{"margin-left":"2px"}})]),_:1})]),_:1})):a.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-06e2a9ce"]]),h3={class:"apf-search-form"},u3={class:"apf-search-form__row"},B3={class:"apf-search-form__label"},W3={class:"apf-search-form__actions"},w3=E(a.defineComponent({__name:"SearchForm",props:{fields:{},modelValue:{default:()=>({})},collapsible:{type:Boolean,default:!0},defaultCollapsed:{type:Boolean,default:!1},defaultVisibleCount:{default:3}},emits:["update:modelValue","search","reset"],setup(C,{expose:I,emit:g}){const A=C,i=g,l=a.ref(A.defaultCollapsed),e=a.reactive({});function t(){var Z;for(const m of Object.keys(e))A.fields.some(b=>b.key===m)||delete e[m];for(const m of A.fields)e[m.key]=((Z=A.modelValue)==null?void 0:Z[m.key])??(m.type==="daterange"?[]:"")}a.watch(()=>[A.fields,A.modelValue],t,{immediate:!0,deep:!0});const c=a.computed(()=>A.collapsible&&A.fields.length>A.defaultVisibleCount),d=a.computed(()=>!c.value||!l.value?A.fields:A.fields.slice(0,A.defaultVisibleCount));function o(){return{...e}}function n(){const Z=o();i("update:modelValue",Z),i("search",Z)}function s(){for(const m of A.fields)e[m.key]=m.type==="daterange"?[]:"";const Z=o();i("update:modelValue",Z),i("reset")}return I({getValues:o,reset:s}),(Z,m)=>{const b=a.resolveComponent("el-input"),G=a.resolveComponent("el-option"),r=a.resolveComponent("el-select"),h=a.resolveComponent("el-date-picker"),u=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",h3,[a.createElementVNode("div",u3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.value,B=>(a.openBlock(),a.createElementBlock("div",{key:B.key,class:"apf-search-form__field"},[a.createElementVNode("label",B3,a.toDisplayString(B.label),1),B.type==="input"?(a.openBlock(),a.createBlock(b,{key:0,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,clearable:"",placeholder:B.placeholder||`请输入${B.label}`},null,8,["modelValue","onUpdate:modelValue","placeholder"])):B.type==="select"?(a.openBlock(),a.createBlock(r,{key:1,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,clearable:"",placeholder:B.placeholder||`请选择${B.label}`,style:{width:"100%"}},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(B.options||[],W=>(a.openBlock(),a.createBlock(G,{key:String(W.value),label:W.label,value:W.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):B.type==="date"?(a.openBlock(),a.createBlock(h,{key:2,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,type:"date","value-format":"YYYY-MM-DD",placeholder:B.placeholder||`请选择${B.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(a.openBlock(),a.createBlock(h,{key:3,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,type:"daterange","value-format":"YYYY-MM-DD","start-placeholder":"开始","end-placeholder":"结束",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue"]))]))),128)),a.createElementVNode("div",W3,[a.createVNode(u,{type:"primary",onClick:n},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"search",size:14,style:{"margin-right":"var(--spacing-xs, 4px)"}}),m[1]||(m[1]=a.createTextVNode(" 查询 ",-1))]),_:1}),a.createVNode(u,{onClick:s},{default:a.withCtx(()=>[...m[2]||(m[2]=[a.createTextVNode("重置",-1)])]),_:1}),c.value?(a.openBlock(),a.createBlock(u,{key:0,link:"",type:"primary",onClick:m[0]||(m[0]=B=>l.value=!l.value)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.value?"展开":"收起"),1)]),_:1})):a.createCommentVNode("",!0)])])])}}}),[["__scopeId","data-v-8a00c2b6"]]),om=E(a.defineComponent({inheritAttrs:!1,__name:"TruncatedTooltipText",props:{content:{},placement:{default:"top"},maxWidth:{default:360}},setup(C){const I=a.useAttrs();return(g,A)=>{const i=a.resolveComponent("el-tooltip");return a.openBlock(),a.createBlock(i,{content:C.content,placement:C.placement,"show-after":200,"popper-style":{maxWidth:`${C.maxWidth}px`,wordBreak:"break-word",whiteSpace:"pre-wrap"}},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(["apf-truncated-text",a.unref(I).class]),style:a.normalizeStyle(a.unref(I).style)},[a.renderSlot(g.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(C.content),1)],!0)],6)]),_:3},8,["content","placement","popper-style"])}}}),[["__scopeId","data-v-04c4f36c"]]),Y3={class:"apf-field-row__label"},V3={key:0,class:"apf-field-row__required"},qW=E(a.defineComponent({__name:"FieldRow",props:{label:{},textarea:{type:Boolean},hint:{},required:{type:Boolean}},setup(C){const I=C,g=a.computed(()=>{var A;return(A=I.hint)!=null&&A.trim()?`${I.label}
|
|
67
|
+
`+ZI),nl&&(ZI=wZ(ZI)),V&&rZ?S(ZI):ZI},I.setConfig=function(){let Cg=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};AB(Cg),Eu=!0,mZ=hg,bZ=yg},I.clearConfig=function(){na=null,Eu=!1,mZ=null,bZ=null,V=N,y=""},I.isValidAttribute=function(Cg,K,L){na||AB({});const U=WI(Cg),dg=WI(K);return R9(U,dg,L)},I.addHook=function(Cg,K){typeof K=="function"&&nC(q,Cg)&&Wa(q[Cg],K)},I.removeHook=function(Cg,K){if(nC(q,Cg)){if(K!==void 0){const L=TJ(q[Cg],K);return L===-1?void 0:xJ(q[Cg],L,1)[0]}return VW(q[Cg])}},I.removeHooks=function(Cg){nC(q,Cg)&&(q[Cg]=[])},I.removeAllHooks=function(){q=JW()},I}var em=vW();const _d=typeof em.sanitize=="function"?em:em.default;function Zv(C){const I=C.trim();if(!I)return!1;const g=[/^(好的|已|我|现在|以上|这就是|这是|根据|基于)/,/^(表单|流程|Schema|JSON|数据)\s*(已|已经|已生成|已创建|已更新)/,/已(生成|创建|更新|完成|应用)(好|了)?/,/以上(就是|是)/,/请(查看|确认|检查|参考)/,/希望(这|这个)/];return I.length<100&&g.some(A=>A.test(I))}function kW(C){if(!C)return[{type:"text",content:""}];const I=[],g=/```([\w:+#.-]*)\r?\n([\s\S]*?)```|```([^\n`]*?)```|<schema>([\s\S]*?)<\/schema>/g;let A=0,i,l=!1;for(;(i=g.exec(C))!==null;){const c=C.slice(A,i.index);if(c.trim()&&I.push({type:"text",content:c}),i[0].startsWith("<schema>"))I.push({type:"code",content:(i[4]||"").trim(),language:"json"}),l=!0;else if(i[1]!==void 0){const d=(i[1]||"text").trim()||"text",o=(i[2]||"").replace(/^\n/,"").replace(/\n$/,"");LW(I,d,o)}else LW(I,"text",(i[3]||"").trim());A=i.index+i[0].length}const e=C.slice(A);e.trim()&&(l&&Zv(e)||I.push({type:"text",content:e}));const t=I.filter((c,d)=>c.type!=="text"||c.content.trim()?!0:d>0&&d<I.length-1);return t.length?t:[{type:"text",content:C}]}function LW(C,I,g){if(I.startsWith("artifact:")){const A=I.slice(9);C.push({type:"artifact",content:g,language:A,artifactType:A});return}C.push({type:"code",content:g,language:I})}function qd(C){if(!C)return"";const g=II.parse(C,{breaks:!0,gfm:!0}).replace(/<table>/g,'<div class="table-scroll"><table>').replace(/<\/table>/g,"</table></div>").replace(/<img\b/gi,'<img loading="lazy" decoding="async" class="apf-md-img"');return typeof window>"u"||typeof(_d==null?void 0:_d.sanitize)!="function"?g:_d.sanitize(g,{ADD_ATTR:["class","loading","decoding","fetchpriority"]})}const mv=["onClick"],bv=["src","alt"],TW=E(a.defineComponent({__name:"ImagePreviewCard",props:{url:{},urls:{},size:{default:"default"},alt:{default:"预览图"}},setup(C){const I=C,g=a.ref(!1),A=a.ref(0),i=a.computed(()=>{var e;return(e=I.urls)!=null&&e.length?I.urls.filter(Boolean):I.url?[I.url]:[]});function l(e){A.value=e,g.value=!0}return(e,t)=>i.value.length?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["apf-image-preview",`apf-image-preview--${C.size}`])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(c,d)=>(a.openBlock(),a.createElementBlock("button",{key:`${c}-${d}`,type:"button",class:"apf-image-preview__thumb",onClick:a.withModifiers(o=>l(d),["stop"])},[a.createElementVNode("img",{src:c,alt:`${C.alt} ${d+1}`,loading:"lazy"},null,8,bv)],8,mv))),128)),g.value&&i.value.length?(a.openBlock(),a.createBlock(a.unref(BC.ElImageViewer),{key:0,"url-list":i.value,"initial-index":A.value,teleported:"",onClose:t[0]||(t[0]=c=>g.value=!1)},null,8,["url-list","initial-index"])):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-40f66176"]]),Gv=["src"],xW=E(a.defineComponent({__name:"VideoPreviewCard",props:{url:{},size:{default:"default"}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("video",{class:a.normalizeClass(["apf-video-preview",`apf-video-preview--${C.size}`]),src:C.url,controls:"",preload:"metadata",onClick:g[0]||(g[0]=a.withModifiers(()=>{},["stop"]))},null,10,Gv))}}),[["__scopeId","data-v-6dbd2c6e"]]),rv={key:0,class:"apf-text-preview apf-text-preview--compact"},hv={key:1,class:"apf-text-preview"},uv={class:"apf-text-preview__head"},Bv={class:"apf-text-preview__label"},tm=E(a.defineComponent({__name:"TextPreviewCard",props:{text:{},label:{},size:{default:"default"},maxHeight:{default:"240px"}},setup(C){const I=C,{copy:g}=Td(),A=a.computed(()=>I.text.replace(/\s+/g," ").trim().slice(0,64));async function i(){await g(I.text)}return(l,e)=>C.size==="compact"?(a.openBlock(),a.createElementBlock("div",rv,a.toDisplayString(A.value),1)):(a.openBlock(),a.createElementBlock("div",hv,[a.createElementVNode("div",uv,[a.createElementVNode("span",Bv,a.toDisplayString(C.label||"文本"),1),a.createElementVNode("button",{type:"button",class:"apf-text-preview__copy",onClick:a.withModifiers(i,["stop"])},"复制")]),a.createElementVNode("pre",{class:"apf-text-preview__body",style:a.normalizeStyle({maxHeight:C.maxHeight})},a.toDisplayString(C.text),5)]))}}),[["__scopeId","data-v-76a4ed48"]]);function ul(C){const I=(C.mimetype||"").toLowerCase(),g=(C.filename||"").toLowerCase();return I.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp)$/.test(g)}function xe(C){const I=(C.mimetype||"").toLowerCase(),g=(C.filename||"").toLowerCase();return I.includes("pdf")||g.endsWith(".pdf")}function am(C){const I=(C.mimetype||"").toLowerCase(),g=(C.filename||"").toLowerCase();return g.endsWith(".docx")||g.endsWith(".doc")||g.endsWith(".xlsx")||g.endsWith(".xls")||I.includes("word")||I.includes("sheet")||I.includes("excel")}function Wv(C){return ul(C)||xe(C)}function $d(C){const I=(C.filename||"").toLowerCase(),g=(C.mimetype||"").toLowerCase();return xe(C)?"PDF":I.endsWith(".docx")||I.endsWith(".doc")||g.includes("word")?"Word":I.endsWith(".xlsx")||I.endsWith(".xls")||g.includes("sheet")||g.includes("excel")?"Excel":I.endsWith(".csv")?"CSV":I.endsWith(".txt")||I.endsWith(".md")?"文本":I.endsWith(".json")?"JSON":"文件"}function go(C){return C==null||C<0?"":C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}const wv={class:"apf-file-chip__name"},Yv={class:"apf-file-chip__kind"},fW=E(a.defineComponent({__name:"FileChip",props:{item:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>g.item.kind==="pdf"?"PDF":g.item.kind==="office"?$d({id:g.item.id,filename:g.item.filename||g.item.label||"file",mimetype:g.item.mimetype||""}):"文件"),l=a.computed(()=>g.item.filename||g.item.label||i.value);return(e,t)=>(a.openBlock(),a.createElementBlock("button",{type:"button",class:"apf-file-chip",onClick:t[0]||(t[0]=a.withModifiers(c=>A("preview",C.item),["stop"]))},[a.createVNode(a.unref($),{name:"document",size:14}),a.createElementVNode("span",wv,a.toDisplayString(l.value),1),a.createElementVNode("span",Yv,a.toDisplayString(i.value),1)]))}}),[["__scopeId","data-v-c8f563a4"]]),Vv={class:"apf-json-card__body"},pv={class:"apf-json-card__title"},yv={class:"apf-json-card__summary"},jW=E(a.defineComponent({__name:"JsonCard",props:{title:{},data:{},content:{},type:{default:"json"}},emits:["click","openDetail"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{if(g.data!==void 0)return g.data;if(!g.content)return null;try{return JSON.parse(g.content)}catch{return null}}),l=a.computed(()=>{const c=i.value;if(c==null)return"JSON 数据";if(Array.isArray(c))return`${c.length} 个元素`;if(typeof c=="object"){const d=c;if(Array.isArray(d.nodes)){const n=Array.isArray(d.edges)?d.edges.length:0;return`${d.nodes.length} 个节点, ${n} 条连线`}const o=Object.keys(d);return`${o.length} 个字段${o.length?` (${o.slice(0,3).join(", ")}${o.length>3?"...":""})`:""}`}return String(c)}),e=a.computed(()=>g.type==="schema"?"document":g.type==="flow"?"connection":"files");function t(){A("click"),A("openDetail")}return(c,d)=>(a.openBlock(),a.createElementBlock("button",{type:"button",class:"apf-json-card",onClick:t},[a.createVNode(a.unref($),{name:e.value,size:20,class:"apf-json-card__icon"},null,8,["name"]),a.createElementVNode("div",Vv,[a.createElementVNode("strong",pv,a.toDisplayString(C.title),1),a.createElementVNode("span",yv,a.toDisplayString(l.value),1)])]))}}),[["__scopeId","data-v-059cffad"]]),QW=a.defineComponent({__name:"JsonDetailDialog",props:{modelValue:{type:Boolean},title:{},data:{},content:{},nodeType:{}},emits:["update:modelValue"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{if(g.data!=null)return g.data;if(!g.content)return null;const e=eA(g.content);return(e==null?void 0:e.data)??g.content}),l=a.computed(()=>{if(g.title)return g.title;const e=i.value;if(e&&typeof e=="object"){const t=lA(e);if(t==="script")return"漫剧剧本";if(t==="storyboard")return"视频分镜"}return"结果详情"});return(e,t)=>{const c=a.resolveComponent("el-button");return a.openBlock(),a.createBlock(a.unref(Dd),{"model-value":C.modelValue,title:l.value,width:"900px","show-fullscreen-btn":!0,"onUpdate:modelValue":t[1]||(t[1]=d=>A("update:modelValue",d))},{footer:a.withCtx(()=>[a.createVNode(c,{type:"primary",onClick:t[0]||(t[0]=d=>A("update:modelValue",!1))},{default:a.withCtx(()=>[...t[2]||(t[2]=[a.createTextVNode("关闭",-1)])]),_:1})]),default:a.withCtx(()=>[a.createVNode(a.unref(PW),{data:i.value,"node-type":C.nodeType},null,8,["data","node-type"])]),_:1},8,["model-value","title"])}}}),cm=E(a.defineComponent({__name:"CardTable",props:{loading:{type:Boolean,default:!1},padding:{default:"var(--spacing-sm, 8px)"},borderless:{type:Boolean,default:!1}},setup(C){return(I,g)=>{const A=a.resolveDirective("loading");return a.withDirectives((a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-card-table",{"apf-card-table--borderless":C.borderless}]),style:a.normalizeStyle({padding:C.padding})},[a.renderSlot(I.$slots,"default",{},void 0,!0)],6)),[[A,C.loading]])}}}),[["__scopeId","data-v-fbd06971"]]),Nv={class:"apf-script-table-preview__header"},Xv={class:"apf-script-table-preview__title"},Rv={class:"apf-script-table-preview__meta"},Hv={key:0},Sv={key:1},Mv={class:"apf-script-table-preview__tabs"},Dv={key:0,class:"apf-script-table-preview__info"},Kv={class:"apf-script-table-preview__info-item"},Fv={class:"apf-script-table-preview__info-item"},zv={class:"apf-script-table-preview__info-item"},Jv={class:"apf-script-table-preview__info-item"},UW=E(a.defineComponent({__name:"ScriptTablePreview",props:{content:{},data:{},showActions:{type:Boolean,default:!0}},emits:["copy"],setup(C,{emit:I}){const g=C,A=I,i=a.ref("scenes"),l=a.computed(()=>{var n;return g.data!=null&&typeof g.data=="object"?g.data:g.content?(n=eA(g.content))==null?void 0:n.data:null}),e=a.computed(()=>lA(l.value)==="script"),t=a.computed(()=>{const n=l.value;return!n||!e.value?null:{title:String(n.title??""),genre:String(n.genre??""),durationRange:String(n.durationRange??""),durationSuggestionSec:Number(n.durationSuggestionSec??0),tone:String(n.tone??""),clipDurationSec:Number(n.clipDurationSec??0),characters:Array.isArray(n.characters)?n.characters:[],scenes:Array.isArray(n.scenes)?n.scenes:[]}}),c=a.computed(()=>{var n;if((n=g.content)!=null&&n.trim()){const s=eA(g.content);return(s==null?void 0:s.jsonText)??g.content}try{return JSON.stringify(l.value??null,null,2)}catch{return""}});function d(n){return Array.isArray(n)?n.map(String).join("、"):typeof n=="string"?n:"—"}function o(){var n;c.value&&((n=navigator.clipboard)==null||n.writeText(c.value),A("copy",c.value))}return(n,s)=>{const Z=a.resolveComponent("el-table-column"),m=a.resolveComponent("el-table");return t.value?(a.openBlock(),a.createBlock(a.unref(cm),{key:0,class:"apf-script-table-preview",padding:"0"},{default:a.withCtx(()=>[a.createElementVNode("div",Nv,[a.createElementVNode("div",Xv,[s[3]||(s[3]=a.createElementVNode("span",{"aria-hidden":"true"},"📝",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.title||"漫剧剧本"),1)]),a.createElementVNode("div",Rv,[t.value.genre?(a.openBlock(),a.createElementBlock("span",Hv,"类型: "+a.toDisplayString(t.value.genre),1)):a.createCommentVNode("",!0),t.value.durationRange?(a.openBlock(),a.createElementBlock("span",Sv,"时长: "+a.toDisplayString(t.value.durationRange)+"s",1)):a.createCommentVNode("",!0),a.createElementVNode("span",null,"角色 "+a.toDisplayString(t.value.characters.length),1),a.createElementVNode("span",null,"场景 "+a.toDisplayString(t.value.scenes.length),1)]),C.showActions?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-script-table-preview__action",onClick:o}," 复制 JSON ")):a.createCommentVNode("",!0)]),a.createElementVNode("div",Mv,[a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="info"}),onClick:s[0]||(s[0]=b=>i.value="info")}," 基本信息 ",2),a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="characters"}),onClick:s[1]||(s[1]=b=>i.value="characters")}," 角色 ("+a.toDisplayString(t.value.characters.length)+") ",3),a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="scenes"}),onClick:s[2]||(s[2]=b=>i.value="scenes")}," 场景 ("+a.toDisplayString(t.value.scenes.length)+") ",3)]),i.value==="info"?(a.openBlock(),a.createElementBlock("div",Dv,[a.createElementVNode("div",Kv,[s[4]||(s[4]=a.createElementVNode("span",null,"标题",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.title||"—"),1)]),a.createElementVNode("div",Fv,[s[5]||(s[5]=a.createElementVNode("span",null,"类型",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.genre||"—"),1)]),a.createElementVNode("div",zv,[s[6]||(s[6]=a.createElementVNode("span",null,"基调",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.tone||"—"),1)]),a.createElementVNode("div",Jv,[s[7]||(s[7]=a.createElementVNode("span",null,"成片时长",-1)),a.createElementVNode("strong",null,a.toDisplayString(t.value.clipDurationSec||"—")+"s",1)])])):i.value==="characters"?(a.openBlock(),a.createBlock(m,{key:1,data:t.value.characters,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无角色"},{default:a.withCtx(()=>[a.createVNode(Z,{prop:"name",label:"姓名","min-width":"100"}),a.createVNode(Z,{prop:"gender",label:"性别",width:"72"}),a.createVNode(Z,{prop:"age",label:"年龄",width:"72"}),a.createVNode(Z,{label:"外貌","min-width":"180","show-overflow-tooltip":""},{default:a.withCtx(({row:b})=>[a.createTextVNode(a.toDisplayString(b.appearance||"—"),1)]),_:1})]),_:1},8,["data"])):(a.openBlock(),a.createBlock(m,{key:2,data:t.value.scenes,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无场景"},{default:a.withCtx(()=>[a.createVNode(Z,{prop:"id",label:"场景",width:"72"}),a.createVNode(Z,{prop:"heading",label:"标题","min-width":"120","show-overflow-tooltip":""}),a.createVNode(Z,{label:"出场",width:"120","show-overflow-tooltip":""},{default:a.withCtx(({row:b})=>[a.createTextVNode(a.toDisplayString(d(b.who??b.characters)),1)]),_:1}),a.createVNode(Z,{prop:"setting",label:"场景设置","min-width":"120","show-overflow-tooltip":""}),a.createVNode(Z,{prop:"action",label:"动作","min-width":"180","show-overflow-tooltip":""}),a.createVNode(Z,{prop:"dialogue",label:"对白","min-width":"140","show-overflow-tooltip":""})]),_:1},8,["data"]))]),_:1})):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-8780c811"]]),vv={class:"apf-storyboard-table-preview__header"},kv={class:"apf-storyboard-table-preview__meta"},Lv={key:0},Tv={key:1},xv={class:"apf-storyboard-table-preview__tabs"},OW=E(a.defineComponent({__name:"StoryboardTablePreview",props:{content:{},data:{},showActions:{type:Boolean,default:!0}},emits:["copy"],setup(C,{emit:I}){const g=C,A=I,i=a.ref("shots"),l=a.computed(()=>{var s;return g.data!=null&&typeof g.data=="object"?g.data:g.content?(s=eA(g.content))==null?void 0:s.data:null}),e=a.computed(()=>lA(l.value)==="storyboard"),t=a.computed(()=>{const s=l.value;return!s||!e.value?null:{totalDurationSec:Number(s.totalDurationSec??0),clipDurationSec:Number(s.clipDurationSec??0),shots:Array.isArray(s.shots)?s.shots:[],seconds:Array.isArray(s.seconds)?s.seconds:[]}});a.watch(t,s=>{s&&s.shots.length===0&&s.seconds.length>0&&(i.value="seconds")},{immediate:!0});const c=a.computed(()=>{var s;if((s=g.content)!=null&&s.trim()){const Z=eA(g.content);return(Z==null?void 0:Z.jsonText)??g.content}try{return JSON.stringify(l.value??null,null,2)}catch{return""}});function d(s,Z){return s==null&&Z==null?"—":`${s??"?"}s - ${Z??"?"}s`}function o(s){return Array.isArray(s)?s.map(String).join("、"):typeof s=="string"?s:"—"}function n(){var s;c.value&&((s=navigator.clipboard)==null||s.writeText(c.value),A("copy",c.value))}return(s,Z)=>{const m=a.resolveComponent("el-table-column"),b=a.resolveComponent("el-table");return t.value?(a.openBlock(),a.createBlock(a.unref(cm),{key:0,class:"apf-storyboard-table-preview",padding:"0"},{default:a.withCtx(()=>[a.createElementVNode("div",vv,[Z[2]||(Z[2]=a.createElementVNode("div",{class:"apf-storyboard-table-preview__title"},[a.createElementVNode("span",{"aria-hidden":"true"},"🎬"),a.createElementVNode("strong",null,"视频分镜")],-1)),a.createElementVNode("div",kv,[t.value.totalDurationSec?(a.openBlock(),a.createElementBlock("span",Lv,"总时长 "+a.toDisplayString(t.value.totalDurationSec)+"s",1)):a.createCommentVNode("",!0),t.value.clipDurationSec?(a.openBlock(),a.createElementBlock("span",Tv,"成片 "+a.toDisplayString(t.value.clipDurationSec)+"s",1)):a.createCommentVNode("",!0),a.createElementVNode("span",null,"镜头 "+a.toDisplayString(t.value.shots.length),1),a.createElementVNode("span",null,"逐秒 "+a.toDisplayString(t.value.seconds.length),1)]),C.showActions?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-storyboard-table-preview__action",onClick:n}," 复制 JSON ")):a.createCommentVNode("",!0)]),a.createElementVNode("div",xv,[a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="shots"}),onClick:Z[0]||(Z[0]=G=>i.value="shots")}," 镜头列表 ("+a.toDisplayString(t.value.shots.length)+") ",3),a.createElementVNode("button",{type:"button",class:a.normalizeClass({"is-active":i.value==="seconds"}),onClick:Z[1]||(Z[1]=G=>i.value="seconds")}," 逐秒表 ("+a.toDisplayString(t.value.seconds.length)+") ",3)]),i.value==="shots"?(a.openBlock(),a.createBlock(b,{key:0,data:t.value.shots,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无镜头"},{default:a.withCtx(()=>[a.createVNode(m,{prop:"id",label:"镜头",width:"72"}),a.createVNode(m,{label:"时间",width:"110"},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(d(G.startSec,G.endSec)),1)]),_:1}),a.createVNode(m,{label:"角色","min-width":"100","show-overflow-tooltip":""},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(o(G.who)),1)]),_:1}),a.createVNode(m,{prop:"does",label:"动作","min-width":"180","show-overflow-tooltip":""}),a.createVNode(m,{prop:"camera",label:"机位","min-width":"120","show-overflow-tooltip":""}),a.createVNode(m,{prop:"dialogue",label:"对白","min-width":"120","show-overflow-tooltip":""})]),_:1},8,["data"])):(a.openBlock(),a.createBlock(b,{key:1,data:t.value.seconds,size:"small",stripe:"",border:"","max-height":"360","empty-text":"暂无逐秒表"},{default:a.withCtx(()=>[a.createVNode(m,{label:"秒",width:"64"},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(G.sec??G.t??"—")+"s",1)]),_:1}),a.createVNode(m,{label:"角色","min-width":"100","show-overflow-tooltip":""},{default:a.withCtx(({row:G})=>[a.createTextVNode(a.toDisplayString(o(G.who)),1)]),_:1}),a.createVNode(m,{prop:"does",label:"动作","min-width":"180","show-overflow-tooltip":""}),a.createVNode(m,{prop:"camera",label:"机位","min-width":"120","show-overflow-tooltip":""}),a.createVNode(m,{prop:"dialogue",label:"对白","min-width":"120","show-overflow-tooltip":""})]),_:1},8,["data"]))]),_:1})):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-779273c4"]]),dm=a.defineComponent({__name:"StructuredJsonPreview",props:{content:{},data:{},showActions:{type:Boolean,default:!0}},emits:["copy"],setup(C,{expose:I,emit:g}){const A=C,i=g,l=a.computed(()=>{if(A.data!=null){const d=lA(A.data);return d?{kind:d,data:A.data,content:A.content}:null}if(!A.content)return null;const t=eA(A.content);if(!t)return null;const c=lA(t.data);return c?{kind:c,data:t.data,content:t.jsonText}:null}),e=a.computed(()=>{var t;return((t=l.value)==null?void 0:t.kind)??null});return I({kind:e}),(t,c)=>e.value==="storyboard"&&l.value?(a.openBlock(),a.createBlock(OW,{key:0,content:l.value.content,data:l.value.data,"show-actions":C.showActions,onCopy:c[0]||(c[0]=d=>i("copy",d))},null,8,["content","data","show-actions"])):e.value==="script"&&l.value?(a.openBlock(),a.createBlock(UW,{key:1,content:l.value.content,data:l.value.data,"show-actions":C.showActions,onCopy:c[1]||(c[1]=d=>i("copy",d))},null,8,["content","data","show-actions"])):a.createCommentVNode("",!0)}}),fv={key:1,class:"apf-artifact-gallery__videos"},jv={key:2,class:"apf-artifact-gallery__structured"},Qv={key:3,class:"apf-artifact-gallery__jsons"},Uv={key:4,class:"apf-artifact-gallery__files"},Ov={key:5,class:"apf-artifact-gallery__texts"},pa=E(a.defineComponent({__name:"ArtifactGallery",props:{items:{},size:{default:"default"},max:{default:12}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1),l=a.ref(null),e=a.computed(()=>g.items.slice(0,g.max)),t=a.computed(()=>e.value.filter(G=>G.kind==="image"&&G.url).map(G=>G.url)),c=a.computed(()=>e.value.filter(G=>G.kind==="video"&&G.url)),d=a.computed(()=>e.value.filter(G=>{var r;return G.kind==="json"&&((r=G.text)==null?void 0:r.trim())&&JZ(G.text)})),o=a.computed(()=>e.value.filter(G=>{var r;return G.kind==="json"&&((r=G.text)==null?void 0:r.trim())&&!JZ(G.text)})),n=a.computed(()=>e.value.filter(G=>{var r;return G.kind==="text"&&((r=G.text)==null?void 0:r.trim())})),s=a.computed(()=>e.value.filter(G=>G.kind==="pdf"||G.kind==="office"||G.kind==="file"||G.kind==="image"&&!G.url&&G.documentId)),Z=a.computed(()=>t.value.length>0||c.value.length>0||d.value.length>0||o.value.length>0||n.value.length>0||s.value.length>0);function m(G){A("preview",G)}function b(G){l.value=G,i.value=!0}return(G,r)=>{var h,u;return Z.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["apf-artifact-gallery",`apf-artifact-gallery--${C.size}`])},[t.value.length?(a.openBlock(),a.createBlock(TW,{key:0,urls:t.value,size:C.size},null,8,["urls","size"])):a.createCommentVNode("",!0),c.value.length?(a.openBlock(),a.createElementBlock("div",fv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,B=>(a.openBlock(),a.createBlock(xW,{key:B.id,url:B.url,size:C.size},null,8,["url","size"]))),128))])):a.createCommentVNode("",!0),d.value.length?(a.openBlock(),a.createElementBlock("div",jv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.value,B=>(a.openBlock(),a.createBlock(a.unref(dm),{key:B.id,content:B.text},null,8,["content"]))),128))])):a.createCommentVNode("",!0),o.value.length?(a.openBlock(),a.createElementBlock("div",Qv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,B=>(a.openBlock(),a.createBlock(a.unref(jW),{key:B.id,title:B.label||"JSON 输出",content:B.text,onOpenDetail:W=>b(B)},null,8,["title","content","onOpenDetail"]))),128))])):a.createCommentVNode("",!0),s.value.length?(a.openBlock(),a.createElementBlock("div",Uv,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,B=>(a.openBlock(),a.createBlock(fW,{key:B.id,item:B,onPreview:m},null,8,["item"]))),128))])):a.createCommentVNode("",!0),n.value.length?(a.openBlock(),a.createElementBlock("div",Ov,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,B=>(a.openBlock(),a.createBlock(tm,{key:B.id,text:B.text,label:B.label,size:C.size},null,8,["text","label","size"]))),128))])):a.createCommentVNode("",!0),a.createVNode(a.unref(QW),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=B=>i.value=B),title:((h=l.value)==null?void 0:h.label)||"JSON 详情",content:(u=l.value)==null?void 0:u.text},null,8,["modelValue","title","content"])],2)):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-02483b69"]]),Ev={class:"apf-thinking-head-main"},Pv={class:"apf-thinking-titles"},_v={class:"apf-thinking-title"},qv={key:0,class:"apf-thinking-badge"},$v={class:"apf-thinking-sub"},gk={class:"apf-thinking-head-aside"},Ik={class:"apf-thinking-status"},Ck={class:"apf-thinking-chevron","aria-hidden":"true"},Ak={key:0,class:"apf-thinking-body"},ik=["innerHTML"],EW=E(a.defineComponent({__name:"ThinkingBlock",props:{content:{},title:{default:"思考过程"},badge:{},defaultCollapsed:{type:Boolean,default:!0},statusLabel:{default:"已完成"}},setup(C){const I=C,g=a.ref(I.defaultCollapsed),A=a.computed(()=>{if(!I.content)return"";const e=I.content.replace(/<[^>]*>/g,"").trim();return e.length>100?`${e.slice(0,100)}...`:e}),i=a.computed(()=>I.content?qd(I.content):"");function l(){g.value=!g.value}return(e,t)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-thinking",{"is-expanded":!g.value}])},[a.createElementVNode("button",{type:"button",class:"apf-thinking-head",onClick:l},[a.createElementVNode("div",Ev,[t[0]||(t[0]=a.createElementVNode("span",{class:"apf-thinking-icon","aria-hidden":"true"},[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("circle",{cx:"8",cy:"8",r:"5.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),a.createElementVNode("path",{d:"M8 5v3.2L10 10",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})])],-1)),a.createElementVNode("div",Pv,[a.createElementVNode("div",_v,[a.createTextVNode(a.toDisplayString(C.title)+" ",1),C.badge?(a.openBlock(),a.createElementBlock("span",qv,a.toDisplayString(C.badge),1)):a.createCommentVNode("",!0)]),a.createElementVNode("div",$v,a.toDisplayString(g.value?A.value:"已完成思考"),1)])]),a.createElementVNode("div",gk,[a.createElementVNode("span",Ik,a.toDisplayString(C.statusLabel),1),a.createElementVNode("span",Ck,a.toDisplayString(g.value?"▾":"▴"),1)])]),g.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Ak,[a.createElementVNode("div",{class:"apf-thinking-md",innerHTML:i.value},null,8,ik)]))],2))}}),[["__scopeId","data-v-ecf2c951"]]),lk={class:"apf-node-result-preview","data-testid":"node-result-preview"},ek={key:0,class:"apf-node-result-preview__block"},tk={key:1,class:"apf-node-result-preview__block"},ak={key:0,class:"apf-node-result-preview__label"},ck=["innerHTML"],dk={key:2,class:"apf-node-result-preview__block"},ok={key:3,class:"apf-node-result-preview__block"},nk={key:4,class:"apf-node-result-preview__block"},sk={key:0,class:"apf-node-result-preview__label"},Zk={key:5,class:"apf-node-result-preview__block"},mk={key:6,class:"apf-node-result-preview__block"},bk={key:7,class:"apf-node-result-preview__block"},Gk={key:0,class:"apf-node-result-preview__label"},rk={key:8,class:"apf-node-result-preview__block"},hk={key:0,class:"apf-node-result-preview__label"},uk={key:9,class:"apf-node-result-preview__block"},Bk={key:10,class:"apf-node-result-preview__block"},Wk={key:11,class:"apf-node-result-preview__block"},wk={class:"apf-node-result-preview__unresolved"},Yk=["onClick"],PW=E(a.defineComponent({__name:"NodeResultPreview",props:{blocks:{},data:{},nodeType:{},streamingText:{},streamingReasoning:{},role:{},audience:{},includeLeftoverFields:{type:Boolean},includeFallbackFieldTables:{type:Boolean},thinkingCollapsed:{type:Boolean,default:!0}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,{copy:i}=Td(),l=a.computed(()=>({nodeType:g.nodeType,streamingText:g.streamingText,streamingReasoning:g.streamingReasoning,role:g.role,audience:g.audience,includeLeftoverFields:g.includeLeftoverFields,includeFallbackFieldTables:g.includeFallbackFieldTables})),e=a.computed(()=>g.blocks!=null?g.blocks:TZ(g.data,l.value));function t(d){return qd(d)}async function c(d){const o=d.copyPayload||d.message||"";o&&await i(o)}return(d,o)=>(a.openBlock(),a.createElementBlock("div",lk,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.value,(n,s)=>{var Z,m,b;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`${n.kind}-${s}`},[n.kind==="thinking"&&n.text?(a.openBlock(),a.createElementBlock("section",ek,[a.createVNode(a.unref(EW),{content:n.text,title:n.title||"思考过程","default-collapsed":C.thinkingCollapsed},null,8,["content","title","default-collapsed"])])):n.kind==="markdown"&&n.text?(a.openBlock(),a.createElementBlock("section",tk,[n.title?(a.openBlock(),a.createElementBlock("div",ak,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"apf-node-result-preview__md",innerHTML:t(n.text)},null,8,ck)])):n.kind==="text"&&n.text?(a.openBlock(),a.createElementBlock("section",dk,[a.createVNode(a.unref(tm),{text:n.text,label:n.title||"文本"},null,8,["text","label"])])):n.kind==="code"&&n.text?(a.openBlock(),a.createElementBlock("section",ok,[a.createVNode(a.unref(UB),{text:n.text,title:n.title||"代码输出",language:n.language||"text"},null,8,["text","title","language"])])):n.kind==="script"||n.kind==="storyboard"?(a.openBlock(),a.createElementBlock("section",nk,[n.title?(a.openBlock(),a.createElementBlock("div",sk,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createVNode(a.unref(dm),{content:n.text,data:n.data},null,8,["content","data"])])):n.kind==="table"&&n.table?(a.openBlock(),a.createElementBlock("section",Zk,[a.createVNode(a.unref(jB),{tables:[n.table]},null,8,["tables"])])):n.kind==="keyvalue"&&((Z=n.entries)!=null&&Z.length)?(a.openBlock(),a.createElementBlock("section",mk,[a.createVNode(a.unref(QB),{entries:n.entries,title:n.title},null,8,["entries","title"])])):n.kind==="chart"&&n.chartOption?(a.openBlock(),a.createElementBlock("section",bk,[n.title?(a.openBlock(),a.createElementBlock("div",Gk,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createVNode(a.unref(fB),{option:n.chartOption,"chart-type":n.chartType},null,8,["option","chart-type"])])):n.kind==="media"&&((m=n.artifacts)!=null&&m.length)?(a.openBlock(),a.createElementBlock("section",rk,[n.title?(a.openBlock(),a.createElementBlock("div",hk,a.toDisplayString(n.title),1)):a.createCommentVNode("",!0),a.createVNode(a.unref(pa),{items:n.artifacts,onPreview:o[0]||(o[0]=G=>A("preview",G))},null,8,["items"])])):n.kind==="hitl"&&((b=n.hitlItems)!=null&&b.length)?(a.openBlock(),a.createElementBlock("section",uk,[a.createVNode(a.unref(OB),{items:n.hitlItems,title:n.title,message:n.text},null,8,["items","title","message"])])):n.kind==="empty"?(a.openBlock(),a.createElementBlock("section",Bk,[a.createVNode(a.unref(iA),{title:n.title||"无输出",description:"该节点没有可展示的结果"},null,8,["title"])])):n.kind==="unresolved"?(a.openBlock(),a.createElementBlock("section",Wk,[a.createElementVNode("div",wk,[a.createElementVNode("p",null,a.toDisplayString(n.message||"暂无匹配的人读预览"),1),n.copyPayload?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-node-result-preview__copy",onClick:G=>c(n)}," 复制数据 ",8,Yk)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0)],64)}),128))]))}}),[["__scopeId","data-v-1cf600e5"]]),Vk={key:0,class:"apf-stat-card__bar"},pk={key:1,class:"apf-stat-card__body"},yk={key:2,class:"apf-stat-card__body"},Nk={class:"apf-stat-card__label"},Xk={class:"apf-stat-card__value-row"},Rk={class:"apf-stat-card__value"},Hk={key:0,class:"apf-stat-card__unit"},Sk={key:0,class:"apf-stat-card__spark",viewBox:"0 0 80 32",preserveAspectRatio:"none","aria-hidden":"true"},Mk=["d","stroke"],Dk=E(a.defineComponent({__name:"StatCard",props:{label:{},value:{},unit:{},trend:{},sparkline:{},status:{},to:{},loading:{type:Boolean,default:!1}},emits:["click"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{const d=g.trend;if(!d||d.direction==="flat")return"var(--text-color-muted)";const o=d.positiveIsGood!==!1;return(d.direction==="up"?o:!o)?"var(--color-success)":"var(--color-danger)"}),l=a.computed(()=>{var o;const d=(o=g.trend)==null?void 0:o.direction;return d==="up"?"↑":d==="down"?"↓":"→"}),e=a.computed(()=>{const d=g.sparkline;if(!(d!=null&&d.length))return"";const o=80,n=32,s=Math.min(...d),m=Math.max(...d)-s||1;return d.map((b,G)=>{const r=G/Math.max(d.length-1,1)*o,h=n-(b-s)/m*(n-4)-2;return`${G===0?"M":"L"}${r.toFixed(1)},${h.toFixed(1)}`}).join(" ")}),t=a.computed(()=>g.status==="healthy"?"var(--color-success)":g.status==="warning"?"var(--color-warning)":g.status==="error"?"var(--color-danger)":"var(--color-primary)");function c(d){g.to||A("click",d)}return(d,o)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(C.to?"a":"div"),{class:a.normalizeClass(["apf-stat-card",[C.status?`apf-stat-card--${C.status}`:"",{"apf-stat-card--clickable":!!C.to}]]),href:C.to||void 0,role:C.to?void 0:"button",tabindex:C.to?void 0:0,onClick:c,onKeydown:o[0]||(o[0]=a.withKeys(a.withModifiers(n=>!C.to&&c(n),["prevent"]),["enter"]))},{default:a.withCtx(()=>{var n;return[C.status?(a.openBlock(),a.createElementBlock("div",Vk)):a.createCommentVNode("",!0),C.loading?(a.openBlock(),a.createElementBlock("div",pk,[...o[1]||(o[1]=[a.createElementVNode("div",{class:"apf-stat-card__skel apf-stat-card__skel--label"},null,-1),a.createElementVNode("div",{class:"apf-stat-card__skel apf-stat-card__skel--value"},null,-1),a.createElementVNode("div",{class:"apf-stat-card__skel apf-stat-card__skel--spark"},null,-1)])])):(a.openBlock(),a.createElementBlock("div",yk,[a.createElementVNode("div",Nk,a.toDisplayString(C.label),1),a.createElementVNode("div",Xk,[a.createElementVNode("span",Rk,a.toDisplayString(C.value),1),C.unit?(a.openBlock(),a.createElementBlock("span",Hk,a.toDisplayString(C.unit),1)):a.createCommentVNode("",!0),C.trend?(a.openBlock(),a.createElementBlock("span",{key:1,class:"apf-stat-card__trend",style:a.normalizeStyle({color:i.value})},[a.createTextVNode(a.toDisplayString(l.value)+" ",1),C.trend.percent!=null?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(C.trend.percent)+"%",1)],64)):a.createCommentVNode("",!0)],4)):a.createCommentVNode("",!0)]),(n=C.sparkline)!=null&&n.length?(a.openBlock(),a.createElementBlock("svg",Sk,[a.createElementVNode("path",{d:e.value,fill:"none",stroke:t.value,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,Mk)])):a.createCommentVNode("",!0)]))]}),_:1},40,["class","href","role","tabindex"]))}}),[["__scopeId","data-v-3e48d232"]]),Kk=E(a.defineComponent({__name:"SeverityBadge",props:{severity:{},pulse:{type:Boolean},size:{default:"default"}},setup(C){const I=C,g=a.computed(()=>I.pulse??I.severity==="critical"),A={critical:"严重",warning:"警告",info:"信息"};return(i,l)=>(a.openBlock(),a.createElementBlock("span",{class:a.normalizeClass(["apf-severity-badge",[`apf-severity-badge--${C.severity}`,`apf-severity-badge--${C.size}`,{"apf-severity-badge--pulse":g.value}]])},[l[0]||(l[0]=a.createElementVNode("i",{class:"apf-severity-badge__dot","aria-hidden":"true"},null,-1)),a.createElementVNode("span",null,a.toDisplayString(A[C.severity]),1)],2))}}),[["__scopeId","data-v-e6c92ddb"]]),Fk=["onClick"],zk={class:"apf-service-grid__body"},Jk={class:"apf-service-grid__name"},vk={key:0,class:"apf-service-grid__metrics"},kk={key:0},Lk={key:1},Tk={key:2},xk=E(a.defineComponent({__name:"ServiceGrid",props:{services:{},columns:{},loading:{type:Boolean,default:!1}},emits:["service-click"],setup(C,{emit:I}){const g={healthy:"健康",warning:"告警",error:"故障",unknown:"未知"},A=C,i=I,l=a.computed(()=>A.columns&&A.columns>0?{gridTemplateColumns:`repeat(${A.columns}, minmax(0, 1fr))`}:{gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))"});function e(t){if(!t)return!1;const c=Date.parse(t);return Number.isFinite(c)&&Date.now()-c>300*1e3}return(t,c)=>C.loading?(a.openBlock(),a.createElementBlock("div",{key:0,class:"apf-service-grid",style:a.normalizeStyle(l.value)},[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(6,d=>a.createElementVNode("div",{key:d,class:"apf-service-grid__skel"})),64))],4)):C.services.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:"apf-service-grid",style:a.normalizeStyle(l.value)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.services,d=>(a.openBlock(),a.createElementBlock("button",{key:d.id,type:"button",class:a.normalizeClass(["apf-service-grid__item",`apf-service-grid__item--${d.status}`]),onClick:o=>i("service-click",d)},[c[0]||(c[0]=a.createElementVNode("div",{class:"apf-service-grid__bar"},null,-1)),a.createElementVNode("div",zk,[a.createElementVNode("div",Jk,a.toDisplayString(d.name),1),a.createElementVNode("div",{class:a.normalizeClass(["apf-service-grid__status",`apf-service-grid__status--${d.status}`])},a.toDisplayString(g[d.status]),3),d.metrics?(a.openBlock(),a.createElementBlock("div",vk,[d.metrics.errorRate!=null?(a.openBlock(),a.createElementBlock("span",kk," err "+a.toDisplayString(d.metrics.errorRate.toFixed(1))+"% ",1)):a.createCommentVNode("",!0),d.metrics.latencyP95!=null?(a.openBlock(),a.createElementBlock("span",Lk," p95 "+a.toDisplayString(Math.round(d.metrics.latencyP95))+"ms ",1)):a.createCommentVNode("",!0),d.metrics.eventCount!=null?(a.openBlock(),a.createElementBlock("span",Tk," n "+a.toDisplayString(d.metrics.eventCount.toLocaleString()),1)):a.createCommentVNode("",!0),d.metrics.lastSeen?(a.openBlock(),a.createElementBlock("span",{key:3,class:a.normalizeClass({"is-stale":e(d.metrics.lastSeen)})},a.toDisplayString(a.unref(_1)(d.metrics.lastSeen)),3)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])],10,Fk))),128))],4)):(a.openBlock(),a.createBlock(a.unref(iA),{key:1,title:"暂无服务",description:"等待上报或检查筛选条件"}))}}),[["__scopeId","data-v-7e1890bc"]]),fk={class:"apf-status-timeline"},jk={class:"apf-status-timeline__ticks"},Qk=E(a.defineComponent({__name:"StatusTimeline",props:{segments:{},range:{},height:{default:24},showTooltip:{type:Boolean,default:!0}},setup(C){const I={healthy:"健康",warning:"告警",error:"故障",unknown:"未知"},g=C,A=a.computed(()=>{if(g.range)return g.range;if(!g.segments.length){const c=new Date().toISOString();return{start:c,end:c}}return{start:g.segments[0].start,end:g.segments[g.segments.length-1].end}}),i=a.computed(()=>{const c=Date.parse(A.value.start),d=Date.parse(A.value.end);return Math.max(d-c,1)}),l=a.computed(()=>{const c=Date.parse(A.value.start);return g.segments.map(d=>{const o=Date.parse(d.start),n=Date.parse(d.end),s=(o-c)/i.value*100,Z=(n-o)/i.value*100;return{...d,left:Math.max(0,s),width:Math.max(.2,Z),durationMs:Math.max(0,n-o)}})});function e(c){const d=new Date(c),o=String(d.getMonth()+1).padStart(2,"0"),n=String(d.getDate()).padStart(2,"0"),s=String(d.getHours()).padStart(2,"0"),Z=String(d.getMinutes()).padStart(2,"0");return`${o}-${n} ${s}:${Z}`}function t(c){return`${I[c.status]} · ${e(c.start)} ~ ${e(c.end)} · ${q1(c.durationMs)}`}return(c,d)=>{const o=a.resolveComponent("el-tooltip");return a.openBlock(),a.createElementBlock("div",fk,[a.createElementVNode("div",{class:"apf-status-timeline__track",style:a.normalizeStyle({height:`${C.height}px`})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,(n,s)=>(a.openBlock(),a.createBlock(o,{key:`${n.start}-${s}`,disabled:!C.showTooltip,content:t(n),placement:"top"},{default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass(["apf-status-timeline__seg",`apf-status-timeline__seg--${n.status}`]),style:a.normalizeStyle({left:`${n.left}%`,width:`${n.width}%`})},null,6)]),_:2},1032,["disabled","content"]))),128))],4),a.createElementVNode("div",jk,[a.createElementVNode("span",null,a.toDisplayString(e(A.value.start)),1),a.createElementVNode("span",null,a.toDisplayString(e(A.value.end)),1)])])}}}),[["__scopeId","data-v-97b528a0"]]),Uk={key:0,class:"apf-log-stream__loading"},Ok=["onClick"],Ek={class:"apf-log-stream__ts"},Pk={class:"apf-log-stream__service"},_k=["innerHTML"],qk={key:0,class:"apf-log-stream__panel"},$k={class:"apf-log-stream__panel-head"},g3={key:0,class:"apf-log-stream__panel-body"},I3={key:1,class:"apf-log-stream__panel-empty"},_W=5,C3=E(a.defineComponent({__name:"LogStream",props:{logs:{},height:{},rowHeight:{default:36},highlight:{},autoScroll:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["log-click","reach-top","reach-bottom"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(null),l=a.ref(0),e=a.ref(null);let t=!0,c=null;const d=a.computed(()=>Math.ceil(g.height/g.rowHeight)+_W*2),o=a.computed(()=>Math.max(0,Math.floor(l.value/g.rowHeight)-_W)),n=a.computed(()=>Math.min(g.logs.length,o.value+d.value)),s=a.computed(()=>g.logs.slice(o.value,n.value)),Z=a.computed(()=>g.logs.length*g.rowHeight),m=a.computed(()=>o.value*g.rowHeight),b=a.computed(()=>g.logs.find(V=>V.id===e.value)??null),G=a.computed(()=>{var V;if(!((V=b.value)!=null&&V.payload))return"";try{return JSON.stringify(b.value.payload,null,2)}catch{return String(b.value.payload)}});function r(V){const y=new Date(V);if(Number.isNaN(y.getTime()))return V;const N=H=>String(H).padStart(2,"0");return`${N(y.getMonth()+1)}-${N(y.getDate())} ${N(y.getHours())}:${N(y.getMinutes())}:${N(y.getSeconds())}`}function h(V){var R;if(!((R=g.highlight)!=null&&R.trim()))return u(V);const y=g.highlight.trim(),N=u(V),H=new RegExp(`(${B(y)})`,"gi");return N.replace(H,'<mark class="apf-log-stream__mark">$1</mark>')}function u(V){return V.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function B(V){return V.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W(V){if(V.scrollHeight-V.scrollTop-V.clientHeight>24){t=!0;return}t&&(t=!1,c&&clearTimeout(c),c=setTimeout(()=>{A("reach-bottom")},120))}function w(){const V=i.value;V&&(l.value=V.scrollTop,V.scrollTop<=4&&A("reach-top"),W(V))}function Y(V){e.value=e.value===V.id?null:V.id,A("log-click",V)}function p(){e.value=null}return a.watch(()=>g.logs.length,async(V,y)=>{const H=V-(y??0),R=i.value;if(!(!R||H===0)){if(H>0){if(g.autoScroll)await a.nextTick(),R.scrollTop=0,l.value=0;else{const D=R.scrollTop+H*g.rowHeight;R.scrollTop=D,l.value=D}return}await a.nextTick(),l.value=R.scrollTop}}),a.watch(e,V=>{V!=null}),a.onMounted(()=>{var V;(V=i.value)==null||V.addEventListener("scroll",w,{passive:!0})}),a.onUnmounted(()=>{var V;(V=i.value)==null||V.removeEventListener("scroll",w),c&&clearTimeout(c)}),(V,y)=>(a.openBlock(),a.createElementBlock("div",{class:"apf-log-stream-wrap",style:a.normalizeStyle({height:`${C.height}px`})},[a.createElementVNode("div",{ref_key:"scrollerRef",ref:i,class:a.normalizeClass(["apf-log-stream",{"apf-log-stream--with-panel":!!b.value}])},[C.loading?(a.openBlock(),a.createElementBlock("div",Uk,"加载中…")):C.logs.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:"apf-log-stream__phantom",style:a.normalizeStyle({height:`${Z.value}px`})},[a.createElementVNode("div",{class:"apf-log-stream__window",style:a.normalizeStyle({transform:`translateY(${m.value}px)`})},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.value,N=>(a.openBlock(),a.createElementBlock("div",{key:N.id,class:a.normalizeClass(["apf-log-stream__row",{"is-active":e.value===N.id}]),style:a.normalizeStyle({height:`${C.rowHeight}px`}),onClick:H=>Y(N)},[a.createElementVNode("i",{class:a.normalizeClass(["apf-log-stream__bar",`apf-log-stream__bar--${N.level}`]),"aria-hidden":"true"},null,2),a.createElementVNode("span",Ek,a.toDisplayString(r(N.timestamp)),1),a.createElementVNode("span",{class:a.normalizeClass(["apf-log-stream__level",`apf-log-stream__level--${N.level}`])},a.toDisplayString(N.level),3),a.createElementVNode("span",Pk,a.toDisplayString(N.service),1),a.createElementVNode("span",{class:"apf-log-stream__msg",innerHTML:h(N.message)},null,8,_k)],14,Ok))),128))],4)],4)):(a.openBlock(),a.createBlock(a.unref(iA),{key:1,title:"暂无日志",description:"等待事件推送或调整筛选"}))],2),b.value?(a.openBlock(),a.createElementBlock("aside",qk,[a.createElementVNode("header",$k,[a.createElementVNode("span",null,"Payload · "+a.toDisplayString(b.value.service),1),a.createElementVNode("button",{type:"button",class:"apf-log-stream__panel-close",onClick:p}," 关闭 ")]),G.value?(a.openBlock(),a.createElementBlock("pre",g3,a.toDisplayString(G.value),1)):(a.openBlock(),a.createElementBlock("div",I3,"无 payload"))])):a.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-1766eb79"]]),A3={class:"apf-threshold-slider__meta"},i3={class:"apf-threshold-slider__unit"},l3={class:"apf-threshold-slider__hint"},e3={class:"apf-threshold-slider__row"},t3=E(a.defineComponent({__name:"ThresholdSlider",props:{type:{},modelValue:{},showInput:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(C,{emit:I}){const g={errorRate:{unit:"%",min:0,max:100,step:1,suggest:5},latency:{unit:"ms",min:100,max:3e4,step:100,suggest:2e3},eventCount:{unit:"次/5分钟",min:10,max:1e4,step:10,suggest:100},timeout:{unit:"分钟",min:1,max:60,step:1,suggest:3}},A=C,i=I,l=a.computed(()=>g[A.type]);function e(c){if(c==null||Number.isNaN(c))return;const d=Math.min(l.value.max,Math.max(l.value.min,c));i("update:modelValue",d)}function t(c){const d=Array.isArray(c)?c[0]:c;e(d),i("change",d)}return(c,d)=>{const o=a.resolveComponent("el-slider"),n=a.resolveComponent("el-input-number");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-threshold-slider",{"is-disabled":C.disabled}])},[a.createElementVNode("div",A3,[a.createElementVNode("span",i3,a.toDisplayString(l.value.unit),1),a.createElementVNode("span",l3,"建议 "+a.toDisplayString(l.value.suggest)+a.toDisplayString(l.value.unit),1)]),a.createElementVNode("div",e3,[a.createVNode(o,{"model-value":C.modelValue,min:l.value.min,max:l.value.max,step:l.value.step,disabled:C.disabled,class:"apf-threshold-slider__slider","onUpdate:modelValue":d[0]||(d[0]=s=>e(s)),onChange:t},null,8,["model-value","min","max","step","disabled"]),C.showInput?(a.openBlock(),a.createBlock(n,{key:0,"model-value":C.modelValue,min:l.value.min,max:l.value.max,step:l.value.step,disabled:C.disabled,"controls-position":"right",size:"small",class:"apf-threshold-slider__input","onUpdate:modelValue":e,onChange:d[1]||(d[1]=s=>s!=null&&i("change",s))},null,8,["model-value","min","max","step","disabled"])):a.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-7098971c"]]),a3=E(a.defineComponent({__name:"PageShell",props:{fill:{type:Boolean,default:!1}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([I.$style.shell,C.fill&&I.$style.shellFill])},[a.renderSlot(I.$slots,"default")],2))}}),[["__cssModules",{$style:{shell:"_shell_1qlp7_2",shellFill:"_shellFill_1qlp7_10"}}]]),c3=E(a.defineComponent({__name:"PageHeader",props:{title:{},subtitle:{}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("header",{class:a.normalizeClass(I.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(I.$style.titleRow)},[a.createElementVNode("div",{class:a.normalizeClass(I.$style.titleLeft)},[a.createElementVNode("h1",{class:a.normalizeClass(I.$style.title)},a.toDisplayString(C.title),3),C.subtitle?(a.openBlock(),a.createElementBlock("p",{key:0,class:a.normalizeClass(I.$style.subtitle)},a.toDisplayString(C.subtitle),3)):a.createCommentVNode("",!0),a.renderSlot(I.$slots,"default")],2),I.$slots.actions||I.$slots.extra?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(I.$style.actions)},[a.renderSlot(I.$slots,"actions"),a.renderSlot(I.$slots,"extra")],2)):a.createCommentVNode("",!0)],2)],2))}}),[["__cssModules",{$style:{header:"_header_ect8w_2",titleRow:"_titleRow_ect8w_6",titleLeft:"_titleLeft_ect8w_14",title:"_title_ect8w_6",subtitle:"_subtitle_ect8w_26",actions:"_actions_ect8w_33"}}]]),d3=["onClick"],o3=E(a.defineComponent({__name:"BreadcrumbNav",props:{items:{}},emits:["navigate"],setup(C,{emit:I}){const g=I;return(A,i)=>C.items.length>0?(a.openBlock(),a.createElementBlock("nav",{key:0,class:a.normalizeClass(A.$style.breadcrumb),"aria-label":"面包屑"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.items,(l,e)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:`${l.label}-${e}`},[e>0?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(A.$style.separator),"aria-hidden":"true"},"/",2)):a.createCommentVNode("",!0),l.to&&e<C.items.length-1?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(A.$style.link),onClick:t=>g("navigate",l.to)},a.toDisplayString(l.label),11,d3)):(a.openBlock(),a.createElementBlock("span",{key:2,class:a.normalizeClass(A.$style.current)},a.toDisplayString(l.label),3))],64))),128))],2)):a.createCommentVNode("",!0)}}),[["__cssModules",{$style:{breadcrumb:"_breadcrumb_vy5ij_2",separator:"_separator_vy5ij_11",link:"_link_vy5ij_16",current:"_current_vy5ij_30"}}]]),n3={class:"apf-filter-bar"},s3={key:0,class:"apf-filter-bar__title"},Z3={class:"apf-filter-bar__fields"},m3={class:"apf-filter-bar__actions"},b3=E(a.defineComponent({__name:"FilterBar",props:{title:{}},emits:["search","reset"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",n3,[C.title?(a.openBlock(),a.createElementBlock("div",s3,a.toDisplayString(C.title),1)):a.createCommentVNode("",!0),a.createElementVNode("div",Z3,[a.renderSlot(A.$slots,"default",{},void 0,!0)]),a.createElementVNode("div",m3,[a.renderSlot(A.$slots,"actions",{},()=>[a.createVNode(l,{type:"primary",onClick:i[0]||(i[0]=e=>g("search"))},{default:a.withCtx(()=>[...i[2]||(i[2]=[a.createTextVNode("查询",-1)])]),_:1}),a.createVNode(l,{onClick:i[1]||(i[1]=e=>g("reset"))},{default:a.withCtx(()=>[...i[3]||(i[3]=[a.createTextVNode("重置",-1)])]),_:1})],!0)])])}}}),[["__scopeId","data-v-86218301"]]),G3={class:"apf-table-row-actions"},r3=E(a.defineComponent({__name:"TableRowActions",props:{actions:{},collapseAt:{default:5},visibleCount:{default:2}},setup(C){const I=C,g=a.computed(()=>I.actions.length>=I.collapseAt),A=a.computed(()=>g.value?I.actions.slice(0,I.visibleCount):I.actions),i=a.computed(()=>g.value?I.actions.slice(I.visibleCount):[]);function l(e){var t;(t=I.actions.find(c=>c.key===e))==null||t.onClick()}return(e,t)=>{const c=a.resolveComponent("el-button"),d=a.resolveComponent("el-dropdown-item"),o=a.resolveComponent("el-dropdown-menu"),n=a.resolveComponent("el-dropdown");return a.openBlock(),a.createElementBlock("div",G3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(A.value,s=>(a.openBlock(),a.createBlock(c,{key:s.key,link:"",type:s.type??"primary",size:"small",loading:s.loading,onClick:s.onClick},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(s.label),1)]),_:2},1032,["type","loading","onClick"]))),128)),i.value.length?(a.openBlock(),a.createBlock(n,{key:0,trigger:"click",onCommand:l},{dropdown:a.withCtx(()=>[a.createVNode(o,null,{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,s=>(a.openBlock(),a.createBlock(d,{key:s.key,command:s.key,style:a.normalizeStyle(s.type==="danger"?{color:"var(--el-color-danger)"}:void 0)},{default:a.withCtx(()=>[s.icon?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:s.icon,size:14,style:{"margin-right":"6px"}},null,8,["name"])):a.createCommentVNode("",!0),a.createTextVNode(" "+a.toDisplayString(s.label),1)]),_:2},1032,["command","style"]))),128))]),_:1})]),default:a.withCtx(()=>[a.createVNode(c,{link:"",type:"primary",size:"small"},{default:a.withCtx(()=>[t[0]||(t[0]=a.createTextVNode(" 更多 ",-1)),a.createVNode(a.unref($),{name:"arrow-down",size:12,style:{"margin-left":"2px"}})]),_:1})]),_:1})):a.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-06e2a9ce"]]),h3={class:"apf-search-form"},u3={class:"apf-search-form__row"},B3={class:"apf-search-form__label"},W3={class:"apf-search-form__actions"},w3=E(a.defineComponent({__name:"SearchForm",props:{fields:{},modelValue:{default:()=>({})},collapsible:{type:Boolean,default:!0},defaultCollapsed:{type:Boolean,default:!1},defaultVisibleCount:{default:3}},emits:["update:modelValue","search","reset"],setup(C,{expose:I,emit:g}){const A=C,i=g,l=a.ref(A.defaultCollapsed),e=a.reactive({});function t(){var Z;for(const m of Object.keys(e))A.fields.some(b=>b.key===m)||delete e[m];for(const m of A.fields)e[m.key]=((Z=A.modelValue)==null?void 0:Z[m.key])??(m.type==="daterange"?[]:"")}a.watch(()=>[A.fields,A.modelValue],t,{immediate:!0,deep:!0});const c=a.computed(()=>A.collapsible&&A.fields.length>A.defaultVisibleCount),d=a.computed(()=>!c.value||!l.value?A.fields:A.fields.slice(0,A.defaultVisibleCount));function o(){return{...e}}function n(){const Z=o();i("update:modelValue",Z),i("search",Z)}function s(){for(const m of A.fields)e[m.key]=m.type==="daterange"?[]:"";const Z=o();i("update:modelValue",Z),i("reset")}return I({getValues:o,reset:s}),(Z,m)=>{const b=a.resolveComponent("el-input"),G=a.resolveComponent("el-option"),r=a.resolveComponent("el-select"),h=a.resolveComponent("el-date-picker"),u=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",h3,[a.createElementVNode("div",u3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.value,B=>(a.openBlock(),a.createElementBlock("div",{key:B.key,class:"apf-search-form__field"},[a.createElementVNode("label",B3,a.toDisplayString(B.label),1),B.type==="input"?(a.openBlock(),a.createBlock(b,{key:0,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,clearable:"",placeholder:B.placeholder||`请输入${B.label}`},null,8,["modelValue","onUpdate:modelValue","placeholder"])):B.type==="select"?(a.openBlock(),a.createBlock(r,{key:1,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,clearable:"",placeholder:B.placeholder||`请选择${B.label}`,style:{width:"100%"}},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(B.options||[],W=>(a.openBlock(),a.createBlock(G,{key:String(W.value),label:W.label,value:W.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder"])):B.type==="date"?(a.openBlock(),a.createBlock(h,{key:2,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,type:"date","value-format":"YYYY-MM-DD",placeholder:B.placeholder||`请选择${B.label}`,style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(a.openBlock(),a.createBlock(h,{key:3,modelValue:e[B.key],"onUpdate:modelValue":W=>e[B.key]=W,type:"daterange","value-format":"YYYY-MM-DD","start-placeholder":"开始","end-placeholder":"结束",style:{width:"100%"}},null,8,["modelValue","onUpdate:modelValue"]))]))),128)),a.createElementVNode("div",W3,[a.createVNode(u,{type:"primary",onClick:n},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"search",size:14,style:{"margin-right":"var(--spacing-xs, 4px)"}}),m[1]||(m[1]=a.createTextVNode(" 查询 ",-1))]),_:1}),a.createVNode(u,{onClick:s},{default:a.withCtx(()=>[...m[2]||(m[2]=[a.createTextVNode("重置",-1)])]),_:1}),c.value?(a.openBlock(),a.createBlock(u,{key:0,link:"",type:"primary",onClick:m[0]||(m[0]=B=>l.value=!l.value)},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.value?"展开":"收起"),1)]),_:1})):a.createCommentVNode("",!0)])])])}}}),[["__scopeId","data-v-8a00c2b6"]]),om=E(a.defineComponent({inheritAttrs:!1,__name:"TruncatedTooltipText",props:{content:{},placement:{default:"top"},maxWidth:{default:360}},setup(C){const I=a.useAttrs();return(g,A)=>{const i=a.resolveComponent("el-tooltip");return a.openBlock(),a.createBlock(i,{content:C.content,placement:C.placement,"show-after":200,"popper-style":{maxWidth:`${C.maxWidth}px`,wordBreak:"break-word",whiteSpace:"pre-wrap"}},{default:a.withCtx(()=>[a.createElementVNode("span",{class:a.normalizeClass(["apf-truncated-text",a.unref(I).class]),style:a.normalizeStyle(a.unref(I).style)},[a.renderSlot(g.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(C.content),1)],!0)],6)]),_:3},8,["content","placement","popper-style"])}}}),[["__scopeId","data-v-04c4f36c"]]),Y3={class:"apf-field-row__label"},V3={key:0,class:"apf-field-row__required"},qW=E(a.defineComponent({__name:"FieldRow",props:{label:{},textarea:{type:Boolean},hint:{},required:{type:Boolean}},setup(C){const I=C,g=a.computed(()=>{var A;return(A=I.hint)!=null&&A.trim()?`${I.label}
|
|
68
68
|
${I.hint.trim()}`:I.label});return(A,i)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-field-row",{"apf-field-row--textarea":C.textarea}])},[a.createElementVNode("div",Y3,[C.required?(a.openBlock(),a.createElementBlock("span",V3,"*")):a.createCommentVNode("",!0),a.createVNode(a.unref(om),{content:g.value,class:"apf-field-row__label-text"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(C.label),1)]),_:1},8,["content"])]),a.createElementVNode("div",{class:a.normalizeClass(["apf-field-row__control",{"apf-field-row__control--textarea":C.textarea}])},[a.renderSlot(A.$slots,"default",{},void 0,!0)],2)],2))}}),[["__scopeId","data-v-ec8f7681"]]),p3=["aria-label"],y3={class:"apf-hint-trigger","aria-label":"提示"},N3={class:"apf-hint-content"},X3=E(a.defineComponent({__name:"HintText",props:{content:{},width:{default:240}},setup(C){return(I,g)=>{const A=a.resolveComponent("el-tooltip"),i=a.resolveComponent("el-popover");return C.content?(a.openBlock(),a.createBlock(A,{key:0,content:C.content,placement:"top","show-after":200},{default:a.withCtx(()=>[a.createElementVNode("span",{class:"apf-hint-trigger",tabindex:"0","aria-label":C.content},[a.createVNode(a.unref($),{name:"question-filled",size:14})],8,p3)]),_:1},8,["content"])):(a.openBlock(),a.createBlock(i,{key:1,placement:"top",width:C.width,trigger:"hover","show-after":200,"popper-style":{maxWidth:"320px"}},{reference:a.withCtx(()=>[a.createElementVNode("span",y3,[a.createVNode(a.unref($),{name:"question-filled",size:14})])]),default:a.withCtx(()=>[a.createElementVNode("div",N3,[a.renderSlot(I.$slots,"default",{},void 0,!0)])]),_:3},8,["width"]))}}}),[["__scopeId","data-v-38245bc2"]]),R3={class:"apf-section-toggle"},H3={class:"apf-section-toggle__label"},S3={key:0,class:"apf-section-toggle__count"},M3={class:"apf-section-toggle__body"},$W=E(a.defineComponent({__name:"SectionToggle",props:{title:{},count:{},defaultOpen:{type:Boolean,default:!0},open:{type:Boolean}},emits:["update:open","toggle"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(g.open??g.defaultOpen);a.watch(()=>g.open,e=>{e!==void 0&&(i.value=e)}),a.watch(()=>g.defaultOpen,e=>{g.open===void 0&&(i.value=e)});function l(){const e=!i.value;i.value=e,A("update:open",e),A("toggle",e)}return(e,t)=>(a.openBlock(),a.createElementBlock("div",R3,[a.createElementVNode("button",{type:"button",class:"apf-section-toggle__header",onClick:l},[a.createVNode(a.unref($),{name:i.value?"arrow-down":"arrow-right",size:12,class:"apf-section-toggle__arrow"},null,8,["name"]),a.createElementVNode("span",H3,a.toDisplayString(C.title),1),C.count!==void 0?(a.openBlock(),a.createElementBlock("span",S3,a.toDisplayString(C.count),1)):a.createCommentVNode("",!0)]),a.withDirectives(a.createElementVNode("div",M3,[a.renderSlot(e.$slots,"default",{},void 0,!0)],512),[[a.vShow,i.value]])]))}}),[["__scopeId","data-v-47c28588"]]),D3={class:"apf-loading-dots","aria-label":"加载中",role:"status"},K3=E(a.defineComponent({__name:"LoadingDots",props:{size:{}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("span",D3,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(3,A=>a.createElementVNode("span",{key:A,class:"apf-loading-dots__dot",style:a.normalizeStyle(C.size?{width:C.size+"px",height:C.size+"px"}:void 0)},null,4)),64))]))}}),[["__scopeId","data-v-df891291"]]),lI="small",nm="apfPropertyFetchRemote",F3={class:"apf-options-list"},z3=E(a.defineComponent({__name:"OptionsListEditor",props:{value:{}},emits:["update"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>Array.isArray(g.value)?g.value.map(o=>{const n=o;return{label:String((n==null?void 0:n.label)??""),value:(n==null?void 0:n.value)??""}}):[]);function l(o){A("update",o)}function e(){l([...i.value,{label:"",value:""}])}function t(o){l(i.value.filter((n,s)=>s!==o))}function c(o,n){const s=i.value.map((Z,m)=>m===o?{...Z,label:n}:Z);l(s)}function d(o,n){const s=i.value.map((Z,m)=>m===o?{...Z,value:n}:Z);l(s)}return(o,n)=>{const s=a.resolveComponent("el-input"),Z=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",F3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(m,b)=>(a.openBlock(),a.createElementBlock("div",{key:b,class:"apf-options-list__row"},[a.createVNode(s,{"model-value":m.label,size:a.unref(lI),placeholder:"标签","onUpdate:modelValue":G=>c(b,G)},null,8,["model-value","size","onUpdate:modelValue"]),a.createVNode(s,{"model-value":String(m.value),size:a.unref(lI),placeholder:"值","onUpdate:modelValue":G=>d(b,G)},null,8,["model-value","size","onUpdate:modelValue"]),a.createVNode(Z,{type:"danger",text:"",size:a.unref(lI),onClick:G=>t(b)},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"delete",size:14})]),_:1},8,["size","onClick"])]))),128)),a.createVNode(Z,{type:"primary",plain:"",size:a.unref(lI),class:"apf-options-list__add",onClick:e},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"plus",size:14}),n[0]||(n[0]=a.createTextVNode(" 添加选项 ",-1))]),_:1},8,["size"])])}}}),[["__scopeId","data-v-212f6015"]]),J3={class:"apf-number-array"},v3={class:"apf-number-array__index"},k3=E(a.defineComponent({__name:"NumberArrayEditor",props:{value:{},min:{default:0},max:{default:100}},emits:["update"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>Array.isArray(g.value)?g.value.map(d=>Number(d)||0):[]);function l(d){A("update",d)}function e(){l([...i.value,0])}function t(d){i.value.length<=1||l(i.value.filter((o,n)=>n!==d))}function c(d,o){const n=[...i.value];n[d]=o??0,l(n)}return(d,o)=>{const n=a.resolveComponent("el-input-number"),s=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",J3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,(Z,m)=>(a.openBlock(),a.createElementBlock("div",{key:m,class:"apf-number-array__row"},[a.createElementVNode("span",v3,"#"+a.toDisplayString(m+1),1),a.createVNode(n,{"model-value":Z,size:a.unref(lI),"controls-position":"right",min:C.min,max:C.max,style:{flex:"1"},"onUpdate:modelValue":b=>c(m,b)},null,8,["model-value","size","min","max","onUpdate:modelValue"]),a.createVNode(s,{type:"danger",text:"",size:a.unref(lI),disabled:i.value.length<=1,onClick:b=>t(m)},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"delete",size:14})]),_:1},8,["size","disabled","onClick"])]))),128)),a.createVNode(s,{type:"primary",plain:"",size:a.unref(lI),class:"apf-number-array__add",onClick:e},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"plus",size:14}),o[0]||(o[0]=a.createTextVNode(" 添加 ",-1))]),_:1},8,["size"])])}}}),[["__scopeId","data-v-34ddd009"]]),L3={class:"apf-array-list"},T3=E(a.defineComponent({__name:"ArrayListEditor",props:{value:{},mode:{default:"string"}},emits:["update"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>g.mode==="label-value"),l=a.computed(()=>Array.isArray(g.value)?g.value.map(s=>String(s??"")):[]),e=a.computed(()=>Array.isArray(g.value)?g.value.map(s=>{const Z=s;return{label:String((Z==null?void 0:Z.label)??""),value:String((Z==null?void 0:Z.value)??"")}}):[]);function t(s){A("update",s)}function c(){i.value?t([...e.value,{label:"",value:""}]):t([...l.value,""])}function d(s){i.value?t(e.value.filter((Z,m)=>m!==s)):t(l.value.filter((Z,m)=>m!==s))}function o(s,Z){const m=l.value.map((b,G)=>G===s?Z:b);t(m)}function n(s,Z,m){const b=e.value.map((G,r)=>r===s?{...G,[Z]:m}:G);t(b)}return(s,Z)=>{const m=a.resolveComponent("el-input"),b=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",L3,[i.value?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(e.value,(G,r)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:"apf-array-list__row"},[a.createVNode(m,{"model-value":G.label,size:a.unref(lI),placeholder:"标签","onUpdate:modelValue":h=>n(r,"label",h)},null,8,["model-value","size","onUpdate:modelValue"]),a.createVNode(m,{"model-value":G.value,size:a.unref(lI),placeholder:"值","onUpdate:modelValue":h=>n(r,"value",h)},null,8,["model-value","size","onUpdate:modelValue"]),a.createVNode(b,{type:"danger",text:"",size:a.unref(lI),onClick:h=>d(r)},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"delete",size:14})]),_:1},8,["size","onClick"])]))),128)):(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(l.value,(G,r)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:"apf-array-list__row"},[a.createVNode(m,{"model-value":G,size:a.unref(lI),placeholder:"内容","onUpdate:modelValue":h=>o(r,h)},null,8,["model-value","size","onUpdate:modelValue"]),a.createVNode(b,{type:"danger",text:"",size:a.unref(lI),onClick:h=>d(r)},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"delete",size:14})]),_:1},8,["size","onClick"])]))),128)),a.createVNode(b,{type:"primary",plain:"",size:a.unref(lI),class:"apf-array-list__add",onClick:c},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"plus",size:14}),Z[0]||(Z[0]=a.createTextVNode(" 添加 ",-1))]),_:1},8,["size"])])}}}),[["__scopeId","data-v-60c215eb"]]),x3={key:7,class:"apf-property-field__json"},f3={key:0,class:"apf-property-field__json-error"},j3={key:8,class:"apf-property-field__colors"},Q3={class:"apf-property-field__colors-items"},U3={class:"apf-property-field__colors-actions"},gw=E(a.defineComponent({__name:"PropertyField",props:{keyName:{},label:{},type:{},value:{},desc:{},placeholder:{},options:{},remoteUrl:{},labelField:{default:"name"},valueField:{default:"id"},min:{},max:{},required:{type:Boolean},arrayMode:{default:"string"},fetchRemoteOptions:{}},emits:["update"],setup(C,{emit:I}){const g=C,A=I,i=a.inject(nm,void 0),l=a.computed(()=>g.fetchRemoteOptions??a.unref(i)),e=new Set(["text","textarea","number","switch","color","select","remote-select","json","color-array","options","number-array","array-editor"]),t=a.computed(()=>e.has(g.type)),c=a.computed(()=>g.type==="options"||g.type==="number-array"||g.type==="array-editor"||g.type==="textarea"||g.type==="json"||g.type==="color-array");function d(w){A("update",w)}const o=["#5470c6","#91cc75","#fac858","#ee6666","#73c0de"],n=a.computed(()=>Array.isArray(g.value)?g.value:o);function s(w,Y){const p=[...n.value];p[w]=Y??"#000000",A("update",p)}function Z(){A("update",[...n.value,"#000000"])}function m(w){A("update",n.value.filter((Y,p)=>p!==w))}const b=a.ref([]),G=a.ref(!1);async function r(){if(!(!g.remoteUrl||!l.value)){G.value=!0;try{b.value=await l.value(g.remoteUrl,g.labelField,g.valueField)}catch{b.value=[]}finally{G.value=!1}}}a.onMounted(()=>{g.type==="remote-select"&&r()});const h=a.ref(""),u=a.ref("");function B(w){return w==null?"":JSON.stringify(w,null,2)}a.watch(()=>g.value,w=>{g.type==="json"&&(h.value=B(w),u.value="")},{immediate:!0});function W(){const w=h.value.trim();if(!w){A("update",null),u.value="";return}try{A("update",JSON.parse(w)),u.value=""}catch{u.value="JSON 格式错误"}}return(w,Y)=>{const p=a.resolveComponent("el-input"),V=a.resolveComponent("el-input-number"),y=a.resolveComponent("el-switch"),N=a.resolveComponent("el-color-picker"),H=a.resolveComponent("el-option"),R=a.resolveComponent("el-select"),D=a.resolveComponent("el-button");return a.openBlock(),a.createBlock(a.unref(qW),{label:C.label,hint:C.desc,required:C.required,textarea:c.value},{default:a.withCtx(()=>[w.$slots.default?a.renderSlot(w.$slots,"default",{},void 0,!0,0):t.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[C.type==="text"?(a.openBlock(),a.createBlock(p,{key:0,"model-value":String(C.value??""),size:a.unref(lI),placeholder:C.placeholder,"onUpdate:modelValue":d},null,8,["model-value","size","placeholder"])):C.type==="textarea"?(a.openBlock(),a.createBlock(p,{key:1,type:"textarea",rows:3,"model-value":String(C.value??""),size:a.unref(lI),placeholder:C.placeholder,"onUpdate:modelValue":d},null,8,["model-value","size","placeholder"])):C.type==="number"?(a.openBlock(),a.createBlock(V,{key:2,"model-value":C.value??0,size:a.unref(lI),"controls-position":"right",min:C.min,max:C.max,"onUpdate:modelValue":d},null,8,["model-value","size","min","max"])):C.type==="switch"?(a.openBlock(),a.createBlock(y,{key:3,"model-value":!!(C.value??!1),"onUpdate:modelValue":d},null,8,["model-value"])):C.type==="color"?(a.openBlock(),a.createBlock(N,{key:4,"model-value":String(C.value??""),size:a.unref(lI),"show-alpha":"","onUpdate:modelValue":d},null,8,["model-value","size"])):C.type==="select"?(a.openBlock(),a.createBlock(R,{key:5,"model-value":C.value,size:a.unref(lI),style:{width:"100%"},placeholder:C.placeholder,"onUpdate:modelValue":d},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.options??[],S=>(a.openBlock(),a.createBlock(H,{key:String(S.value),label:S.label,value:S.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","size","placeholder"])):C.type==="remote-select"?(a.openBlock(),a.createBlock(R,{key:6,"model-value":C.value,loading:G.value,placeholder:C.placeholder||"请选择",size:a.unref(lI),style:{width:"100%"},filterable:"",clearable:"","onUpdate:modelValue":d},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.value,S=>(a.openBlock(),a.createBlock(H,{key:String(S.value),label:S.label,value:S.value},null,8,["label","value"]))),128))]),_:1},8,["model-value","loading","placeholder","size"])):C.type==="json"?(a.openBlock(),a.createElementBlock("div",x3,[a.createVNode(p,{modelValue:h.value,"onUpdate:modelValue":Y[0]||(Y[0]=S=>h.value=S),type:"textarea",rows:6,size:a.unref(lI),placeholder:C.placeholder||"JSON",class:a.normalizeClass([{"apf-property-field__json-input--error":!!u.value},"apf-property-field__json-input"]),onBlur:W},null,8,["modelValue","size","placeholder","class"]),u.value?(a.openBlock(),a.createElementBlock("span",f3,a.toDisplayString(u.value),1)):a.createCommentVNode("",!0)])):C.type==="color-array"?(a.openBlock(),a.createElementBlock("div",j3,[a.createElementVNode("div",Q3,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,(S,M)=>(a.openBlock(),a.createBlock(N,{key:M,"model-value":S,size:a.unref(lI),"onUpdate:modelValue":F=>s(M,F)},null,8,["model-value","size","onUpdate:modelValue"]))),128))]),a.createElementVNode("div",U3,[a.createVNode(D,{type:"primary",text:"",size:a.unref(lI),onClick:Z},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"plus",size:14})]),_:1},8,["size"]),n.value.length>1?(a.openBlock(),a.createBlock(D,{key:0,type:"danger",text:"",size:a.unref(lI),onClick:Y[1]||(Y[1]=S=>m(n.value.length-1))},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"delete",size:14})]),_:1},8,["size"])):a.createCommentVNode("",!0)])])):C.type==="options"?(a.openBlock(),a.createBlock(z3,{key:9,value:C.value,onUpdate:d},null,8,["value"])):C.type==="number-array"?(a.openBlock(),a.createBlock(k3,{key:10,value:C.value,min:C.min,max:C.max,onUpdate:d},null,8,["value","min","max"])):C.type==="array-editor"?(a.openBlock(),a.createBlock(T3,{key:11,value:C.value,mode:C.arrayMode,onUpdate:d},null,8,["value","mode"])):a.createCommentVNode("",!0)],64)):(a.openBlock(),a.createBlock(p,{key:2,"model-value":String(C.value??""),size:a.unref(lI),placeholder:C.placeholder,"onUpdate:modelValue":d},null,8,["model-value","size","placeholder"]))]),_:3},8,["label","hint","required","textarea"])}}}),[["__scopeId","data-v-978ab739"]]),O3=/^\s*([a-zA-Z_][\w.]*)\s*(===|!==|==|!=)\s*(.+?)\s*$/,E3=/^\s*([a-zA-Z_][\w.]*)\s*$/;function Iw(C,I){return I.split(".").reduce((g,A)=>{if(!(g==null||typeof g!="object"))return g[A]},C)}function P3(C){const I=C.trim();if(I.startsWith("'")&&I.endsWith("'")||I.startsWith('"')&&I.endsWith('"'))return I.slice(1,-1);if(I==="true")return!0;if(I==="false")return!1;if(I==="null")return null;if(I!=="undefined")return/^-?\d+(\.\d+)?$/.test(I)?Number(I):I}function Cw(C,I){if(C==null||!String(C).trim())return!0;const g=String(C).trim(),A=g.match(O3);if(A){const[,l,e,t]=A,c=Iw(I,l),d=P3(t);return e==="==="||e==="=="?c===d:c!==d}const i=g.match(E3);return i?!!Iw(I,i[1]):!0}function Aw(C,I){return C.filter(g=>Cw(g.visibleOn,I))}function iw(C,I){return C.map(g=>({...g,items:Aw(g.items??[],I)})).filter(g=>g.items.length>0)}const _3={key:0,class:"apf-property-panel__header"},q3={key:1,class:"apf-property-panel__subject"},$3={key:2,class:"apf-property-panel__config"},gL={key:3,class:"apf-property-panel__footer"},IL=E(a.defineComponent({__name:"PropertyPanel",props:{sections:{default:()=>[]},fetchRemoteOptions:{},emptyText:{},values:{},title:{},subjectLabel:{},subjectHint:{},nested:{type:Boolean,default:!1}},emits:["update","copy-id"],setup(C,{emit:I}){const g=C,A=I,i=a.useSlots();a.provide(nm,a.computed(()=>g.fetchRemoteOptions));const l=a.computed(()=>{const n=g.sections??[];return g.values?iw(n,g.values):n}),e=a.computed(()=>l.value.some(n=>{var s;return(((s=n.items)==null?void 0:s.length)??0)>0})),t=a.computed(()=>!e.value&&!i["before-sections"]&&!i["after-sections"]&&!i.default),c=a.computed(()=>!g.nested&&!!(g.subjectLabel||i.subject||i["subject-actions"]));function d(n,s,Z){A("update",{sectionKey:n,key:s,value:Z})}function o(n,s){return Z=>d(s.key,n.key,Z)}return(n,s)=>{const Z=a.resolveComponent("el-popover");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-property-panel",{"apf-property-panel--shell":!C.nested,"apf-property-panel--nested":C.nested}])},[!C.nested&&(C.title||n.$slots.title)?(a.openBlock(),a.createElementBlock("div",_3,[a.renderSlot(n.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(C.title),1)],!0)])):a.createCommentVNode("",!0),c.value?(a.openBlock(),a.createElementBlock("div",q3,[a.renderSlot(n.$slots,"subject",{},()=>[C.subjectLabel?(a.openBlock(),a.createBlock(a.unref(om),{key:0,content:C.subjectLabel,class:"apf-property-panel__subject-label"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(C.subjectLabel),1)]),_:1},8,["content"])):a.createCommentVNode("",!0)],!0),C.subjectHint?(a.openBlock(),a.createBlock(Z,{key:0,content:C.subjectHint,placement:"top","show-after":500,trigger:"hover"},{reference:a.withCtx(()=>[a.createVNode(a.unref($),{name:"question-filled",class:"apf-property-panel__hint-icon"})]),_:1},8,["content"])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"subject-actions",{},void 0,!0)])):a.createCommentVNode("",!0),!C.nested&&n.$slots.config?(a.openBlock(),a.createElementBlock("div",$3,[a.renderSlot(n.$slots,"config",{},void 0,!0)])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["apf-property-panel__scroll",{"apf-property-panel__scroll--fill":!C.nested}])},[a.renderSlot(n.$slots,"before-sections",{},void 0,!0),t.value?(a.openBlock(),a.createBlock(a.unref(iA),{key:0,compact:"",description:C.emptyText||"暂无配置项"},null,8,["description"])):e.value?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(l.value,m=>(a.openBlock(),a.createBlock(a.unref($W),{key:m.key,title:m.label,count:m.items.length,"default-open":m.defaultOpen!==!1},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.items,b=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:`${m.key}:${b.key}`},[n.$slots[`field-${b.type}`]?a.renderSlot(n.$slots,`field-${b.type}`,{item:b,section:m,update:o(b,m)},void 0,!0,0):(a.openBlock(),a.createBlock(a.unref(gw),{key:1,"key-name":b.key,label:b.label,type:b.type,value:b.value,desc:b.desc,placeholder:b.placeholder,options:b.options,"remote-url":b.remoteUrl,"label-field":b.labelField,"value-field":b.valueField,min:b.min,max:b.max,required:b.required,"array-mode":b.arrayMode,"fetch-remote-options":C.fetchRemoteOptions,onUpdate:G=>d(m.key,b.key,G)},null,8,["key-name","label","type","value","desc","placeholder","options","remote-url","label-field","value-field","min","max","required","array-mode","fetch-remote-options","onUpdate"]))],64))),128))]),_:2},1032,["title","count","default-open"]))),128)):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"after-sections",{},void 0,!0),a.renderSlot(n.$slots,"default",{},void 0,!0)],2),!C.nested&&n.$slots.footer?(a.openBlock(),a.createElementBlock("div",gL,[a.renderSlot(n.$slots,"footer",{},void 0,!0)])):a.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-4f1d61ee"]]),CL={class:"apf-schema-lite-preview"},AL=E(a.defineComponent({__name:"SchemaLitePreview",props:{fields:{},modelValue:{default:()=>({})},labelWidth:{default:"100px"}},emits:["update:modelValue"],setup(C,{emit:I}){const g=C,A=I,i=a.reactive({});function l(){var t;for(const c of Object.keys(i))g.fields.some(d=>d.key===c)||delete i[c];for(const c of g.fields){const d=(t=g.modelValue)==null?void 0:t[c.key];d!==void 0?i[c.key]=d:c.key in i||(i[c.key]=c.type==="switch"?!1:c.type==="number"?void 0:"")}}a.watch(()=>[g.fields,g.modelValue],l,{immediate:!0,deep:!0});function e(){A("update:modelValue",{...i})}return(t,c)=>{const d=a.resolveComponent("el-input"),o=a.resolveComponent("el-input-number"),n=a.resolveComponent("el-option"),s=a.resolveComponent("el-select"),Z=a.resolveComponent("el-switch"),m=a.resolveComponent("el-date-picker"),b=a.resolveComponent("el-form-item"),G=a.resolveComponent("el-form");return a.openBlock(),a.createElementBlock("div",CL,[a.createVNode(G,{model:i,"label-width":C.labelWidth,onChange:e},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.fields,r=>(a.openBlock(),a.createBlock(b,{key:r.key,label:r.label},{default:a.withCtx(()=>[r.type==="input"?(a.openBlock(),a.createBlock(d,{key:0,modelValue:i[r.key],"onUpdate:modelValue":h=>i[r.key]=h,placeholder:r.placeholder,disabled:r.disabled,onChange:e},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="textarea"?(a.openBlock(),a.createBlock(d,{key:1,modelValue:i[r.key],"onUpdate:modelValue":h=>i[r.key]=h,type:"textarea",rows:3,placeholder:r.placeholder,disabled:r.disabled,onChange:e},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="number"?(a.openBlock(),a.createBlock(o,{key:2,modelValue:i[r.key],"onUpdate:modelValue":h=>i[r.key]=h,disabled:r.disabled,onChange:e},null,8,["modelValue","onUpdate:modelValue","disabled"])):r.type==="select"?(a.openBlock(),a.createBlock(s,{key:3,modelValue:i[r.key],"onUpdate:modelValue":h=>i[r.key]=h,placeholder:r.placeholder||`请选择${r.label}`,disabled:r.disabled,style:{width:"100%"},onChange:e},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.options||[],h=>(a.openBlock(),a.createBlock(n,{key:String(h.value),label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","disabled"])):r.type==="switch"?(a.openBlock(),a.createBlock(Z,{key:4,modelValue:i[r.key],"onUpdate:modelValue":h=>i[r.key]=h,disabled:r.disabled,onChange:e},null,8,["modelValue","onUpdate:modelValue","disabled"])):(a.openBlock(),a.createBlock(m,{key:5,modelValue:i[r.key],"onUpdate:modelValue":h=>i[r.key]=h,type:"date","value-format":"YYYY-MM-DD",placeholder:r.placeholder||`请选择${r.label}`,disabled:r.disabled,style:{width:"100%"},onChange:e},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled"]))]),_:2},1032,["label"]))),128))]),_:1},8,["model","label-width"])])}}}),[["__scopeId","data-v-1d125a82"]]),iL={class:"apf-pdf-preview"},lL={class:"apf-pdf-preview__toolbar"},eL={class:"apf-pdf-preview__nav"},tL=["disabled"],aL=["disabled"],cL={class:"apf-pdf-preview__zoom"},dL=["disabled"],oL=["disabled"],nL=["disabled"],sL={key:0,class:"apf-pdf-preview__state"},ZL={key:1,class:"apf-pdf-preview__state apf-pdf-preview__state--error"},mL=["aria-label"],bL={key:0,class:"apf-pdf-preview__state"},GL={key:1,class:"apf-pdf-preview__state apf-pdf-preview__state--error"},rL=["src","title"],hL={key:3,class:"apf-pdf-preview__state"},lw=.5,ew=3,tw=.2,sm=E(a.defineComponent({__name:"PdfPreviewCard",props:{url:{},title:{default:"PDF 预览"},loading:{type:Boolean,default:!1},error:{default:null},minHeight:{default:"320px"},forceIframe:{type:Boolean,default:!1},httpHeaders:{}},setup(C){const I=C,g=a.ref(!1),A=a.ref(!1),i=a.ref(null),l=a.ref(1),e=a.ref(0),t=a.ref(1.2),c=a.ref(null),d=a.shallowRef(null),o=a.shallowRef(null),n=a.computed(()=>g.value&&!I.forceIframe),s=a.computed(()=>n.value?A.value:I.loading),Z=a.computed(()=>n.value?i.value:I.error);async function m(W){if(!(!o.value||!c.value)){A.value=!0,i.value=null;try{const w=await o.value.getPage(W),Y=w.getViewport({scale:t.value}),p=c.value,V=p.getContext("2d");if(!V)throw new Error("Canvas 不可用");const y=window.devicePixelRatio||1;p.width=Y.width*y,p.height=Y.height*y,p.style.width=`${Y.width}px`,p.style.height=`${Y.height}px`,V.setTransform(y,0,0,y,0,0),await w.render({canvasContext:V,viewport:Y,canvas:p}).promise,l.value=W}catch(w){i.value=w instanceof Error?w.message:"页面渲染失败"}finally{A.value=!1}}}async function b(){var W;if(!(!I.url||!d.value)){A.value=!0,i.value=null,(W=o.value)==null||W.cleanup(),o.value=null,l.value=1,t.value=1.2;try{const w={url:I.url};I.httpHeaders&&Object.keys(I.httpHeaders).length>0&&(w.httpHeaders=I.httpHeaders);const Y=await d.value.getDocument(w).promise;o.value=Y,e.value=Y.numPages,await m(1)}catch(w){i.value=w instanceof Error?w.message:"PDF 加载失败"}finally{A.value=!1}}}function G(){l.value>1&&m(l.value-1)}function r(){l.value<e.value&&m(l.value+1)}function h(){t.value>=ew||(t.value=Math.min(ew,+(t.value+tw).toFixed(1)),m(l.value))}function u(){t.value<=lw||(t.value=Math.max(lw,+(t.value-tw).toFixed(1)),m(l.value))}function B(){t.value=1.2,m(l.value)}return a.watch(()=>[I.url,I.forceIframe],async([W,w])=>{if(w||!W){g.value=!1;return}const Y=await $1();d.value=Y,g.value=!!Y,Y&&await b()},{immediate:!0}),a.onBeforeUnmount(()=>{var W;(W=o.value)==null||W.cleanup(),o.value=null}),(W,w)=>(a.openBlock(),a.createElementBlock("div",iL,[n.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",lL,[a.createElementVNode("div",eL,[a.createElementVNode("button",{type:"button",disabled:l.value<=1||s.value,onClick:G},"上一页",8,tL),a.createElementVNode("span",null,a.toDisplayString(l.value)+" / "+a.toDisplayString(e.value||"—"),1),a.createElementVNode("button",{type:"button",disabled:l.value>=e.value||s.value,onClick:r},"下一页",8,aL)]),a.createElementVNode("div",cL,[a.createElementVNode("button",{type:"button",disabled:s.value,onClick:u},"−",8,dL),a.createElementVNode("button",{type:"button",disabled:s.value,onClick:B},a.toDisplayString(Math.round(t.value*100))+"%",9,oL),a.createElementVNode("button",{type:"button",disabled:s.value,onClick:h},"+",8,nL)])]),s.value?(a.openBlock(),a.createElementBlock("div",sL,"加载中...")):Z.value?(a.openBlock(),a.createElementBlock("div",ZL,a.toDisplayString(Z.value),1)):(a.openBlock(),a.createElementBlock("div",{key:2,class:"apf-pdf-preview__canvas-wrap",style:a.normalizeStyle({minHeight:C.minHeight})},[a.createElementVNode("canvas",{ref_key:"canvasRef",ref:c,"aria-label":C.title},null,8,mL)],4))],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[s.value?(a.openBlock(),a.createElementBlock("div",bL,"加载中...")):Z.value?(a.openBlock(),a.createElementBlock("div",GL,a.toDisplayString(Z.value),1)):C.url?a.renderSlot(W.$slots,"default",{url:C.url},()=>[a.createElementVNode("iframe",{class:"apf-pdf-preview__frame",src:C.url,title:C.title,style:a.normalizeStyle({minHeight:C.minHeight})},null,12,rL)],!0,2):(a.openBlock(),a.createElementBlock("div",hL,"未提供 PDF URL"))],64))]))}}),[["__scopeId","data-v-47f45669"]]),uL={class:"apf-excel-preview"},BL={key:0,class:"apf-excel-preview__toolbar"},WL={class:"apf-excel-preview__tabs"},wL=["onClick"],YL={key:0,class:"apf-excel-preview__info"},VL={key:0},pL={key:1,class:"apf-excel-preview__state"},yL={key:2,class:"apf-excel-preview__state apf-excel-preview__state--error"},NL={key:3,class:"apf-excel-preview__table-wrap"},XL={class:"apf-excel-preview__table"},RL={class:"apf-excel-preview__row-num"},HL={key:4,class:"apf-excel-preview__state"},aw=E(a.defineComponent({__name:"ExcelPreviewCard",props:{sheetNames:{default:()=>[]},modelValue:{default:""},headers:{default:()=>[]},rows:{default:()=>[]},totalRows:{default:0},maxPreviewRows:{default:100},loading:{type:Boolean,default:!1},error:{default:null},src:{default:""},arrayBuffer:{default:null},fetchHeaders:{}},emits:["update:modelValue"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1),l=a.ref(null),e=a.ref([]),t=a.ref([]),c=a.ref([]),d=a.ref(0),o=a.ref(""),n=a.ref(!1);let s=null,Z=null;function m(p){if(!s||!Z)return;const V=s.Sheets[p];if(!V)return;const y=Z.sheet_to_json(V,{header:1,defval:""});if(d.value=y.length,!y.length){t.value=[],c.value=[];return}t.value=y[0].map(String),c.value=y.slice(1,g.maxPreviewRows+1).map(N=>N.map(H=>String(H??"")))}async function b(p){const V=await gz();if(!V){n.value=!1,l.value="未安装 xlsx,无法解析 Excel(可改用 props 传表数据)";return}i.value=!0,l.value=null;try{s=V.read(p,{type:"array"}),Z=V.utils,e.value=s.SheetNames,n.value=!0,s.SheetNames.length&&(o.value=s.SheetNames[0],A("update:modelValue",o.value),m(o.value))}catch(y){n.value=!1,l.value=y instanceof Error?y.message:"Excel 解析失败"}finally{i.value=!1}}a.watch(()=>[g.src,g.arrayBuffer],async([p,V])=>{if(V){await b(V);return}if(!p){n.value=!1;return}i.value=!0,l.value=null;try{const y={};g.fetchHeaders&&Object.keys(g.fetchHeaders).length>0&&(y.headers=g.fetchHeaders);const N=await fetch(p,y);if(!N.ok)throw new Error(`加载失败: ${N.status}`);await b(await N.arrayBuffer())}catch(y){n.value=!1,l.value=y instanceof Error?y.message:"Excel 加载失败",i.value=!1}},{immediate:!0});function G(p){A("update:modelValue",p),n.value&&(o.value=p,m(p))}const r=a.computed(()=>n.value?e.value:g.sheetNames),h=a.computed(()=>n.value?o.value:g.modelValue),u=a.computed(()=>n.value?t.value:g.headers),B=a.computed(()=>n.value?c.value:g.rows),W=a.computed(()=>n.value?d.value:g.totalRows),w=a.computed(()=>n.value||g.src||g.arrayBuffer?i.value:g.loading),Y=a.computed(()=>n.value||g.src||g.arrayBuffer?l.value:g.error);return(p,V)=>(a.openBlock(),a.createElementBlock("div",uL,[r.value.length?(a.openBlock(),a.createElementBlock("div",BL,[a.createElementVNode("div",WL,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(r.value,y=>(a.openBlock(),a.createElementBlock("button",{key:y,type:"button",class:a.normalizeClass(["apf-excel-preview__tab",{"apf-excel-preview__tab--active":h.value===y}]),onClick:N=>G(y)},a.toDisplayString(y),11,wL))),128))]),W.value>0?(a.openBlock(),a.createElementBlock("div",YL,[a.createTextVNode(a.toDisplayString(W.value)+" 行 ",1),W.value>C.maxPreviewRows?(a.openBlock(),a.createElementBlock("span",VL,"(显示前 "+a.toDisplayString(C.maxPreviewRows)+" 行)",1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),w.value?(a.openBlock(),a.createElementBlock("div",pL,"加载中...")):Y.value?(a.openBlock(),a.createElementBlock("div",yL,a.toDisplayString(Y.value),1)):u.value.length?(a.openBlock(),a.createElementBlock("div",NL,[a.createElementVNode("table",XL,[a.createElementVNode("thead",null,[a.createElementVNode("tr",null,[V[0]||(V[0]=a.createElementVNode("th",{class:"apf-excel-preview__row-num"},"#",-1)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(u.value,(y,N)=>(a.openBlock(),a.createElementBlock("th",{key:N},a.toDisplayString(y||`列${N+1}`),1))),128))])]),a.createElementVNode("tbody",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(B.value,(y,N)=>(a.openBlock(),a.createElementBlock("tr",{key:N},[a.createElementVNode("td",RL,a.toDisplayString(N+1),1),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y,(H,R)=>(a.openBlock(),a.createElementBlock("td",{key:R},a.toDisplayString(H),1))),128))]))),128))])])])):(a.openBlock(),a.createElementBlock("div",HL,"无数据"))]))}}),[["__scopeId","data-v-24aa411e"]]),SL={class:"apf-doc-preview"},ML={key:0,class:"apf-doc-preview__loading"},DL={key:1,class:"apf-doc-preview__error"},KL={key:0,class:"apf-doc-preview__meta"},FL={key:1,class:"apf-doc-preview__actions"},zL={key:2,class:"apf-doc-preview__viewer"},JL={key:3,class:"apf-doc-preview__viewer"},vL={key:4,class:"apf-doc-preview__viewer apf-doc-preview__media"},kL=["src"],LL=["src","alt"],TL={class:"apf-doc-preview__text"},cw=E(a.defineComponent({__name:"DocumentPreviewPanel",props:{filename:{},mimetype:{},size:{},chunks:{default:()=>[]},extractionMethod:{},hasOriginalFile:{type:Boolean,default:!1},pdfUrl:{},excelUrl:{},mediaUrl:{},pdfHttpHeaders:{},excelFetchHeaders:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["download","close"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{const m=(g.mimetype||"").toLowerCase(),b=g.filename.toLowerCase();return m.includes("pdf")||b.endsWith(".pdf")||!!g.pdfUrl}),l=a.computed(()=>{const m=(g.mimetype||"").toLowerCase(),b=g.filename.toLowerCase();return!!g.excelUrl||m.includes("sheet")||m.includes("excel")||b.endsWith(".xls")||b.endsWith(".xlsx")}),e=a.computed(()=>{const m=(g.mimetype||"").toLowerCase(),b=g.filename.toLowerCase();return m.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(b)}),t=a.computed(()=>{const m=(g.mimetype||"").toLowerCase(),b=g.filename.toLowerCase();return m.startsWith("video/")||/\.(mp4|webm|mov|m4v)$/i.test(b)}),c=a.computed(()=>{var b;const m=[];return g.mimetype&&m.push(g.mimetype),g.size!=null&&m.push(go(g.size)||`${g.size} bytes`),(b=g.chunks)!=null&&b.length&&m.push(`${g.chunks.length} 块`),g.extractionMethod&&m.push(g.extractionMethod),m.join(" · ")}),d=a.computed(()=>{var m;return(m=g.chunks)!=null&&m.length?g.chunks.map((b,G)=>`${b.index!=null?`[${b.index}]`:`[${G+1}]`}
|
|
69
69
|
${b.text}`).join(`
|
|
70
70
|
|
|
71
71
|
`):""}),o=a.computed(()=>!!g.pdfUrl&&i.value),n=a.computed(()=>!!g.excelUrl&&l.value&&!o.value),s=a.computed(()=>!!g.mediaUrl&&(e.value||t.value)&&!o.value&&!n.value),Z=a.computed(()=>!o.value&&!n.value&&!s.value);return(m,b)=>{const G=a.resolveComponent("el-button"),r=a.resolveComponent("el-scrollbar");return a.openBlock(),a.createElementBlock("div",SL,[C.loading?(a.openBlock(),a.createElementBlock("div",ML,"加载中...")):C.error?(a.openBlock(),a.createElementBlock("div",DL,a.toDisplayString(C.error),1)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[c.value?(a.openBlock(),a.createElementBlock("div",KL,a.toDisplayString(c.value),1)):a.createCommentVNode("",!0),C.hasOriginalFile?(a.openBlock(),a.createElementBlock("div",FL,[a.createVNode(G,{size:"small",type:"primary",plain:"",onClick:b[0]||(b[0]=h=>A("download"))},{default:a.withCtx(()=>[...b[1]||(b[1]=[a.createTextVNode(" 下载原文件 ",-1)])]),_:1})])):a.createCommentVNode("",!0),o.value?(a.openBlock(),a.createElementBlock("div",zL,[a.renderSlot(m.$slots,"pdf",{url:C.pdfUrl},()=>[a.createVNode(sm,{url:C.pdfUrl,title:C.filename,"http-headers":C.pdfHttpHeaders,"min-height":"280px"},null,8,["url","title","http-headers"])],!0)])):n.value?(a.openBlock(),a.createElementBlock("div",JL,[a.renderSlot(m.$slots,"excel",{url:C.excelUrl},()=>[a.createVNode(aw,{src:C.excelUrl,"fetch-headers":C.excelFetchHeaders},null,8,["src","fetch-headers"])],!0)])):s.value?(a.openBlock(),a.createElementBlock("div",vL,[a.renderSlot(m.$slots,"media",{url:C.mediaUrl,mimetype:C.mimetype},()=>[t.value?(a.openBlock(),a.createElementBlock("video",{key:0,class:"apf-doc-preview__video",src:C.mediaUrl,controls:"",playsinline:""},null,8,kL)):(a.openBlock(),a.createElementBlock("img",{key:1,class:"apf-doc-preview__image",src:C.mediaUrl,alt:C.filename},null,8,LL))],!0)])):Z.value?(a.openBlock(),a.createBlock(r,{key:5,class:"apf-doc-preview__scroll"},{default:a.withCtx(()=>[a.createElementVNode("pre",TL,a.toDisplayString(d.value||"暂无预览内容"),1)]),_:1})):a.createCommentVNode("",!0)],64))])}}}),[["__scopeId","data-v-0d554351"]]),xL=a.defineComponent({__name:"DocumentPreviewDrawer",props:{modelValue:{type:Boolean},filename:{default:""},mimetype:{},size:{},chunks:{default:()=>[]},extractionMethod:{},hasOriginalFile:{type:Boolean,default:!1},pdfUrl:{},excelUrl:{},mediaUrl:{},pdfHttpHeaders:{},excelFetchHeaders:{},loading:{type:Boolean,default:!1},error:{default:null},sizeDrawer:{default:"50%"}},emits:["update:modelValue","download","close"],setup(C,{emit:I}){const g=I;function A(){g("update:modelValue",!1),g("close")}return(i,l)=>{const e=a.resolveComponent("el-drawer");return a.openBlock(),a.createBlock(e,{"model-value":C.modelValue,title:C.filename||"文档预览",size:C.sizeDrawer,"append-to-body":"","onUpdate:modelValue":l[1]||(l[1]=t=>g("update:modelValue",t)),onClose:A},{default:a.withCtx(()=>[a.createVNode(cw,{filename:C.filename||"文档预览",mimetype:C.mimetype,size:C.size,chunks:C.chunks,"extraction-method":C.extractionMethod,"has-original-file":C.hasOriginalFile,"pdf-url":C.pdfUrl,"excel-url":C.excelUrl,"media-url":C.mediaUrl,"pdf-http-headers":C.pdfHttpHeaders,"excel-fetch-headers":C.excelFetchHeaders,loading:C.loading,error:C.error,onDownload:l[0]||(l[0]=t=>g("download")),onClose:A},a.createSlots({_:2},[i.$slots.pdf?{name:"pdf",fn:a.withCtx(t=>[a.renderSlot(i.$slots,"pdf",a.normalizeProps(a.guardReactiveProps(t)))]),key:"0"}:void 0,i.$slots.excel?{name:"excel",fn:a.withCtx(t=>[a.renderSlot(i.$slots,"excel",a.normalizeProps(a.guardReactiveProps(t)))]),key:"1"}:void 0,i.$slots.media?{name:"media",fn:a.withCtx(t=>[a.renderSlot(i.$slots,"media",a.normalizeProps(a.guardReactiveProps(t)))]),key:"2"}:void 0]),1032,["filename","mimetype","size","chunks","extraction-method","has-original-file","pdf-url","excel-url","media-url","pdf-http-headers","excel-fetch-headers","loading","error"])]),_:3},8,["model-value","title","size"])}}}),fL=E(a.defineComponent({__name:"NodeArtifactStrip",props:{items:{},max:{default:6}},emits:["preview"],setup(C,{emit:I}){const g=I;return(A,i)=>(a.openBlock(),a.createBlock(pa,{class:"apf-node-artifact-strip",items:C.items,size:"compact",max:C.max,onPreview:i[0]||(i[0]=l=>g("preview",l))},null,8,["items","max"]))}}),[["__scopeId","data-v-27af4171"]]),jL={key:0,class:"apf-hitl-artifact-panel"},QL={key:0,class:"apf-hitl-artifact-panel__head"},UL=E(a.defineComponent({__name:"HitlArtifactPanel",props:{items:{},title:{default:"节点产物"},max:{default:24}},emits:["preview"],setup(C,{emit:I}){const g=I;return(A,i)=>C.items.length?(a.openBlock(),a.createElementBlock("section",jL,[C.title?(a.openBlock(),a.createElementBlock("header",QL,a.toDisplayString(C.title),1)):a.createCommentVNode("",!0),a.createVNode(pa,{items:C.items,size:"default",max:C.max,onPreview:i[0]||(i[0]=l=>g("preview",l))},null,8,["items","max"])])):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-8c940624"]]),OL={class:"apf-execution-artifact-panel"},EL={class:"apf-execution-artifact-panel__head"},PL={class:"apf-execution-artifact-panel__title-row"},_L={class:"apf-execution-artifact-panel__title"},qL={key:0,class:"apf-execution-artifact-panel__count"},$L={key:0,class:"apf-execution-artifact-panel__filters",role:"tablist","aria-label":"产物类型筛选"},gT=["aria-selected","onClick"],IT={key:2,class:"apf-execution-artifact-panel__body"},CT={key:0,class:"apf-execution-artifact-panel__group-label"},AT=E(a.defineComponent({__name:"ExecutionArtifactPanel",props:{items:{default:()=>[]},groups:{},title:{default:"产物"},max:{default:48},showFilters:{type:Boolean,default:!0}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=a.ref("all"),l=["pdf","office","file"];function e(m,b){return b==="all"?!0:b==="file"?l.includes(m)||m==="image":m===b}function t(m){const b=i.value;return b==="all"?m:b==="file"?m.filter(G=>l.includes(G.kind)||G.kind==="image"&&!G.url&&!!G.documentId):b==="image"?m.filter(G=>G.kind==="image"&&(!!G.url||!!G.documentId)):m.filter(G=>e(G.kind,b))}const c=a.computed(()=>{var m;return(m=g.groups)!=null&&m.length?g.groups.flatMap(b=>b.items):g.items??[]}),d=a.computed(()=>{const m=c.value;return{all:m.length,image:m.filter(b=>b.kind==="image"&&(!!b.url||!!b.documentId)).length,video:m.filter(b=>b.kind==="video"&&b.url).length,text:m.filter(b=>{var G;return b.kind==="text"&&((G=b.text)==null?void 0:G.trim())}).length,json:m.filter(b=>{var G;return b.kind==="json"&&((G=b.text)==null?void 0:G.trim())}).length,file:m.filter(b=>l.includes(b.kind)||b.kind==="image"&&!b.url&&!!b.documentId).length}}),o=a.computed(()=>{const m=d.value;return[{value:"all",label:"全部",count:m.all},{value:"image",label:"图片",count:m.image},{value:"video",label:"视频",count:m.video},{value:"text",label:"文本",count:m.text},{value:"json",label:"JSON",count:m.json},{value:"file",label:"文件",count:m.file}].filter(b=>b.value==="all"||b.count>0)}),n=a.computed(()=>{var b;if((b=g.groups)!=null&&b.length)return g.groups.map(G=>({...G,items:t(G.items)})).filter(G=>G.items.length>0);const m=t(g.items??[]);return m.length?[{key:"_all",label:"",items:m}]:[]}),s=a.computed(()=>c.value.length>0),Z=a.computed(()=>n.value.some(m=>m.items.length>0));return(m,b)=>(a.openBlock(),a.createElementBlock("section",OL,[a.createElementVNode("header",EL,[a.createElementVNode("div",PL,[a.createElementVNode("h3",_L,a.toDisplayString(C.title),1),s.value?(a.openBlock(),a.createElementBlock("span",qL,a.toDisplayString(d.value.all)+" 项 ",1)):a.createCommentVNode("",!0)]),C.showFilters&&s.value&&o.value.length>1?(a.openBlock(),a.createElementBlock("div",$L,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,G=>(a.openBlock(),a.createElementBlock("button",{key:G.value,type:"button",role:"tab",class:a.normalizeClass(["apf-execution-artifact-panel__chip",{"is-active":i.value===G.value}]),"aria-selected":i.value===G.value,onClick:r=>i.value=G.value},[a.createTextVNode(a.toDisplayString(G.label)+" ",1),a.createElementVNode("em",null,a.toDisplayString(G.count),1)],10,gT))),128))])):a.createCommentVNode("",!0)]),s.value?Z.value?(a.openBlock(),a.createElementBlock("div",IT,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(n.value,G=>(a.openBlock(),a.createElementBlock("div",{key:G.key,class:"apf-execution-artifact-panel__group"},[G.label?(a.openBlock(),a.createElementBlock("div",CT,[a.createTextVNode(a.toDisplayString(G.label)+" ",1),a.createElementVNode("em",null,a.toDisplayString(G.items.length),1)])):a.createCommentVNode("",!0),a.renderSlot(m.$slots,"gallery",{items:G.items,group:G},()=>[a.createVNode(pa,{items:G.items,size:"default",max:C.max,onPreview:b[0]||(b[0]=r=>A("preview",r))},null,8,["items","max"])],!0)]))),128))])):(a.openBlock(),a.createBlock(iA,{key:1,compact:"",icon:"search",title:"无匹配产物",description:"换一个类型筛选试试。"})):(a.openBlock(),a.createBlock(iA,{key:0,compact:"",icon:"folder",title:"暂无产物",description:"节点落库文本、图片、视频或文件后,会汇总到这里。"}))]))}}),[["__scopeId","data-v-75fc065f"]]),iT=["innerHTML"],lT={class:"apf-artifact-head"},eT={class:"apf-artifact-badge"},tT={class:"apf-part-actions"},aT=["onClick"],cT=["onClick"],dT={class:"apf-code-block"},oT={class:"apf-code-head"},nT={class:"apf-code-lang"},sT={class:"apf-part-actions"},ZT=["onClick"],mT=["onClick"],bT={class:"apf-code-block"},dw=E(a.defineComponent({__name:"MessageParts",props:{content:{}},setup(C){const I=C,g=a.ref(null),A=a.computed(()=>kW(I.content||"").map(i));function i(n){if(!((n.language||"").toLowerCase()==="json"||n.artifactType==="json"||l(n.content)))return{...n,display:n.content,isJson:!1};try{const m=JSON.parse(n.content);return{...n,language:n.language||"json",display:JSON.stringify(m,null,2),isJson:!0}}catch{return{...n,display:n.content,isJson:!1}}}function l(n){const s=n.trim();return s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]")}function e(n){return n.type==="artifact"?n.artifactType||"artifact":n.isJson?"json":n.language&&n.language!=="text"?n.language:"code"}function t(n){var s;n&&((s=navigator.clipboard)==null||s.writeText(n))}function c(n){const s=n.isJson||n.language==="json"?"json":n.language&&n.language!=="text"?n.language.replace(/[^a-z0-9]+/gi,""):"txt",Z=new Blob([n.display],{type:"text/plain;charset=utf-8"}),m=URL.createObjectURL(Z),b=document.createElement("a");b.href=m,b.download=`result.${s||"txt"}`,b.click(),URL.revokeObjectURL(m)}const d=[];function o(){var s;for(;d.length;)(s=d.pop())==null||s();const n=g.value;n&&n.querySelectorAll(".apf-md-block img").forEach(Z=>{Z.classList.add("apf-md-img"),Z.loading="lazy",Z.decoding="async",Z.setAttribute("fetchpriority","low");const m=()=>{Z.classList.remove("apf-md-img--pending"),Z.classList.add("apf-md-img--ready")};if(Z.classList.add("apf-md-img--pending"),Z.complete&&Z.naturalWidth>0){m();return}Z.addEventListener("load",m),Z.addEventListener("error",m),d.push(()=>{Z.removeEventListener("load",m),Z.removeEventListener("error",m)})})}return a.watch(()=>I.content,async()=>{await a.nextTick(),o()},{immediate:!0}),a.onBeforeUnmount(()=>{var n;for(;d.length;)(n=d.pop())==null||n()}),(n,s)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"rootEl",ref:g,class:"apf-message-parts"},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(A.value,(Z,m)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:m},[Z.type==="text"?(a.openBlock(),a.createElementBlock("div",{key:0,class:"apf-md-block",innerHTML:a.unref(qd)(Z.content)},null,8,iT)):Z.type==="artifact"?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(["apf-artifact-card",{"apf-json":Z.isJson}])},[a.createElementVNode("div",lT,[a.createElementVNode("span",eT,"工件 · "+a.toDisplayString(e(Z)),1),a.createElementVNode("div",tT,[a.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:b=>t(Z.display)},[...s[0]||(s[0]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[a.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),a.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,aT),a.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:b=>c(Z)},[...s[1]||(s[1]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[a.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,cT)])]),a.createElementVNode("pre",dT,[a.createElementVNode("code",null,a.toDisplayString(Z.display),1)])],2)):(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(["apf-code-wrap",{"apf-json":Z.isJson}])},[a.createElementVNode("div",oT,[a.createElementVNode("span",nT,a.toDisplayString(e(Z)),1),a.createElementVNode("div",sT,[a.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:b=>t(Z.display)},[...s[2]||(s[2]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[a.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),a.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,ZT),a.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:b=>c(Z)},[...s[3]||(s[3]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[a.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,mT)])]),a.createElementVNode("pre",bT,[a.createElementVNode("code",null,a.toDisplayString(Z.display),1)])],2))],64))),128))],512))}}),[["__scopeId","data-v-08febcd6"]]),GT={key:0,class:"apf-att-list"},rT=["aria-label","onClick"],hT=["src","alt"],uT=["aria-label","onClick"],BT={class:"apf-att-badge","aria-hidden":"true"},WT={class:"apf-att-meta"},wT={key:0},ow=E(a.defineComponent({__name:"MessageAttachmentList",props:{attachments:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>g.attachments.filter(ul)),l=a.computed(()=>g.attachments.filter(t=>!ul(t)));function e(t){A("preview",t)}return(t,c)=>{var d;return(d=C.attachments)!=null&&d.length?(a.openBlock(),a.createElementBlock("div",GT,[i.value.length?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["apf-image-grid",{"apf-multi":i.value.length>1}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,o=>(a.openBlock(),a.createElementBlock("button",{key:o.id,type:"button",class:"apf-att-image","aria-label":`预览图片 ${o.filename}`,onClick:n=>e(o)},[a.createElementVNode("img",{src:o.url,alt:o.filename,loading:"lazy"},null,8,hT)],8,rT))),128))],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,o=>(a.openBlock(),a.createElementBlock("button",{key:o.id,type:"button",class:"apf-att-file","aria-label":`${a.unref(xe)(o)?"预览":a.unref(am)(o)?"查看":"打开"} ${o.filename}`,onClick:n=>e(o)},[a.createElementVNode("span",BT,a.toDisplayString(a.unref($d)(o)),1),a.createElementVNode("span",WT,[a.createElementVNode("strong",null,a.toDisplayString(o.filename),1),a.createElementVNode("small",null,[o.size?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(a.unref(go)(o.size)),1)],64)):a.createCommentVNode("",!0),a.unref(xe)(o)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(" · 点击预览")],64)):a.unref(am)(o)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[a.createTextVNode(" · 点击查看")],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:3},[a.createTextVNode(" · 点击打开")],64))]),o.excerpt?(a.openBlock(),a.createElementBlock("em",wT,a.toDisplayString(o.excerpt),1)):a.createCommentVNode("",!0)])],8,uT))),128))])):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a98f1d82"]]),YT={key:0,class:"apf-doc-list"},VT=["role","tabindex","aria-label","onClick","onKeydown"],pT={class:"apf-doc-body"},yT={class:"apf-doc-name"},NT={class:"apf-doc-summary"},XT={key:0,class:"apf-doc-meta"},RT={key:1,class:"apf-doc-hint"},nw=E(a.defineComponent({__name:"DocumentSummaryList",props:{summaries:{},attachments:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I;function i(t){var d;if(!((d=g.attachments)!=null&&d.length))return null;if(t.attachmentId){const o=g.attachments.find(n=>n.id===t.attachmentId);if(o)return o}const c=(t.filename||"").toLowerCase();return g.attachments.find(o=>(o.filename||"").toLowerCase()===c)||null}function l(t){const c=i(t);c&&A("preview",c)}function e(t){return i(t)!==null}return(t,c)=>{var d;return(d=C.summaries)!=null&&d.length?(a.openBlock(),a.createElementBlock("div",YT,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.summaries,o=>(a.openBlock(),a.createElementBlock("article",{key:o.documentId,class:a.normalizeClass(["apf-doc-card",{"apf-clickable":e(o)}]),role:e(o)?"button":void 0,tabindex:e(o)?0:void 0,"aria-label":e(o)?`预览 ${o.filename}`:void 0,onClick:n=>l(o),onKeydown:[a.withKeys(n=>l(o),["enter"]),a.withKeys(a.withModifiers(n=>l(o),["prevent"]),["space"])]},[c[0]||(c[0]=a.createElementVNode("div",{class:"apf-doc-icon","aria-hidden":"true"},[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("path",{d:"M4 2.5h5.2L12 5.3V13.5H4V2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M9.2 2.5V5.3H12",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})])],-1)),a.createElementVNode("div",pT,[a.createElementVNode("strong",yT,a.toDisplayString(o.filename),1),a.createElementVNode("p",NT,a.toDisplayString(o.summary),1),o.pageCount?(a.openBlock(),a.createElementBlock("span",XT,a.toDisplayString(o.pageCount)+" 页",1)):a.createCommentVNode("",!0),e(o)?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("span",RT,"无对应附件,请从附件列表打开"))])],42,VT))),128))])):a.createCommentVNode("",!0)}}}),[["__scopeId","data-v-f22e939c"]]),HT=["aria-label"],ST={class:"apf-preview-head"},MT={class:"apf-preview-title"},DT={class:"apf-preview-actions"},KT=["href"],FT=["src","alt"],zT={key:3,class:"apf-gallery-counter"},JT={key:1,class:"apf-preview-body apf-preview-body-pdf"},vT={key:2,class:"apf-preview-body apf-preview-body-degraded"},kT={class:"apf-degraded-content"},LT={class:"apf-degraded-badge"},TT={class:"apf-degraded-filename"},xT={key:0,class:"apf-degraded-size"},fT={class:"apf-degraded-actions"},jT=["href"],QT=.5,UT=3,sw=.25,Zw=E(a.defineComponent({__name:"AttachmentPreviewModal",props:{modelValue:{type:Boolean},attachment:{},gallery:{}},emits:["update:modelValue","update:attachment"],setup(C,{emit:I}){const g=C,A=I,i=a.computed({get:()=>g.modelValue,set:N=>A("update:modelValue",N)});function l(N){return N.url||""}const e=a.computed(()=>g.attachment?ul(g.attachment):!1),t=a.computed(()=>g.attachment?xe(g.attachment):!1),c=a.computed(()=>{var H;return((H=g.gallery)!=null&&H.length?g.gallery:g.attachment?[g.attachment]:[]).filter(ul)}),d=a.computed(()=>!c.value.length||!g.attachment?-1:c.value.findIndex(N=>{var H;return N.id===((H=g.attachment)==null?void 0:H.id)})),o=a.computed(()=>d.value>0),n=a.computed(()=>d.value>=0&&d.value<c.value.length-1),s=a.ref(1),Z=a.ref(null),m=a.ref(null),b=a.ref(null);function G(){i.value=!1}function r(){if(!o.value)return;const N=c.value[d.value-1];N&&A("update:attachment",N)}function h(){if(!n.value)return;const N=c.value[d.value+1];N&&A("update:attachment",N)}function u(){s.value=Math.min(UT,+(s.value+sw).toFixed(2))}function B(){s.value=Math.max(QT,+(s.value-sw).toFixed(2))}function W(){s.value=1}async function w(N){const H=l(N);if(H)try{const D=await(await fetch(H)).blob(),S=URL.createObjectURL(D),M=document.createElement("a");M.href=S,M.download=N.filename||"download",M.rel="noopener",document.body.appendChild(M),M.click(),M.remove(),URL.revokeObjectURL(S)}catch{const R=document.createElement("a");R.href=H,R.download=N.filename||"download",R.target="_blank",R.rel="noopener",document.body.appendChild(R),R.click(),R.remove()}}function Y(N){if(i.value){if(N.key==="Escape"){N.preventDefault(),G();return}if(N.key==="ArrowLeft"&&o.value){N.preventDefault(),r();return}if(N.key==="ArrowRight"&&n.value){N.preventDefault(),h();return}if(N.key==="+"||N.key==="="){e.value&&(N.preventDefault(),u());return}if(N.key==="-"){e.value&&(N.preventDefault(),B());return}if(N.key==="0"&&e.value){N.preventDefault(),W();return}if(N.key==="Tab"&&Z.value){const H=Z.value.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(H.length===0)return;const R=H[0],D=H[H.length-1];N.shiftKey&&document.activeElement===R?(N.preventDefault(),D.focus()):!N.shiftKey&&document.activeElement===D&&(N.preventDefault(),R.focus())}}}a.watch(i,N=>{N?(b.value=document.activeElement,requestAnimationFrame(()=>{var H;return(H=m.value)==null?void 0:H.focus()}),document.addEventListener("keydown",Y)):(document.removeEventListener("keydown",Y),s.value=1,b.value&&(b.value.focus(),b.value=null))},{immediate:!0}),a.watch(()=>{var N;return(N=g.attachment)==null?void 0:N.id},()=>{s.value=1}),a.onUnmounted(()=>document.removeEventListener("keydown",Y));function p(N){N.target===N.currentTarget&&G()}function V(N){N.stopPropagation()}function y(N){e.value&&(N.preventDefault(),N.deltaY<0?u():B())}return(N,H)=>(a.openBlock(),a.createBlock(a.Teleport,{to:"body"},[i.value&&C.attachment?(a.openBlock(),a.createElementBlock("div",{key:0,class:"apf-preview-mask",role:"dialog","aria-modal":"true","aria-label":`预览 ${C.attachment.filename}`,onClick:p},[a.createElementVNode("div",{ref_key:"panelRef",ref:Z,class:a.normalizeClass(["apf-preview-panel",{"apf-preview-image":e.value,"apf-preview-pdf":t.value,"apf-preview-degraded":!e.value&&!t.value}]),onClick:V},[a.createElementVNode("header",ST,[a.createElementVNode("strong",MT,a.toDisplayString(C.attachment.filename),1),a.createElementVNode("div",DT,[e.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"缩小",onClick:B},"−"),a.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"重置缩放",onClick:W},a.toDisplayString(Math.round(s.value*100))+"% ",1),a.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"放大",onClick:u},"+")],64)):a.createCommentVNode("",!0),l(C.attachment)?(a.openBlock(),a.createElementBlock("a",{key:1,href:l(C.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn"},a.toDisplayString(t.value?"新窗口打开":e.value?"打开原图":"打开原文件"),9,KT)):a.createCommentVNode("",!0),l(C.attachment)?(a.openBlock(),a.createElementBlock("button",{key:2,type:"button",class:"apf-preview-action-btn",onClick:H[0]||(H[0]=R=>w(C.attachment))}," 下载 ")):a.createCommentVNode("",!0),a.createElementVNode("button",{ref_key:"closeBtnRef",ref:m,type:"button",class:"apf-preview-action-btn","aria-label":"关闭预览",onClick:G}," 关闭 ",512)])]),e.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:"apf-preview-body apf-preview-body-image",onWheel:a.withModifiers(y,["prevent"])},[o.value?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-gallery-btn apf-gallery-prev","aria-label":"上一张图片",onClick:r}," ‹ ")):a.createCommentVNode("",!0),l(C.attachment)?(a.openBlock(),a.createElementBlock("img",{key:1,src:l(C.attachment),alt:C.attachment.filename,class:"apf-preview-img",style:a.normalizeStyle({transform:`scale(${s.value})`})},null,12,FT)):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createElementBlock("button",{key:2,type:"button",class:"apf-gallery-btn apf-gallery-next","aria-label":"下一张图片",onClick:h}," › ")):a.createCommentVNode("",!0),c.value.length>1?(a.openBlock(),a.createElementBlock("div",zT,a.toDisplayString(d.value+1)+" / "+a.toDisplayString(c.value.length),1)):a.createCommentVNode("",!0)],32)):t.value?(a.openBlock(),a.createElementBlock("div",JT,[l(C.attachment)?(a.openBlock(),a.createBlock(sm,{key:0,url:l(C.attachment),title:C.attachment.filename,"min-height":"70vh"},null,8,["url","title"])):a.createCommentVNode("",!0)])):(a.openBlock(),a.createElementBlock("div",vT,[a.createElementVNode("div",kT,[a.createElementVNode("span",LT,a.toDisplayString(a.unref($d)(C.attachment)),1),a.createElementVNode("strong",TT,a.toDisplayString(C.attachment.filename),1),C.attachment.size?(a.openBlock(),a.createElementBlock("p",xT,a.toDisplayString(a.unref(go)(C.attachment.size)),1)):a.createCommentVNode("",!0),H[2]||(H[2]=a.createElementVNode("p",{class:"apf-degraded-hint"},"此格式暂不支持应用内预览",-1)),a.createElementVNode("div",fT,[l(C.attachment)?(a.openBlock(),a.createElementBlock("a",{key:0,href:l(C.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn apf-preview-action-primary"}," 打开原文件 ",8,jT)):a.createCommentVNode("",!0),l(C.attachment)?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:"apf-preview-action-btn apf-preview-action-primary",onClick:H[1]||(H[1]=R=>w(C.attachment))}," 下载 ")):a.createCommentVNode("",!0)])])]))],2)],8,HT)):a.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-13cf1e3e"]]),OT={class:"apf-bubble-wrap"},ET={key:0,class:"apf-tip"},PT={key:1,class:"apf-typing"},_T={key:2,class:"apf-result-wrap"},qT={key:2,class:"apf-inline-progress"},$T={key:0,class:"apf-result-actions"},gx={key:1,class:"apf-fail-actions"},Ix={key:3,class:"apf-bubble apf-waiting-hint"},Cx={key:4,class:"apf-bubble apf-failed-hint"},Ax={key:5,class:"apf-bubble apf-cancelled-hint"},ix=["aria-expanded"],lx={key:0,class:"apf-live-dot"},ex={class:"apf-detail-collapse"},tx={class:"apf-detail-collapse-inner"},ax=["aria-expanded"],cx={class:"apf-detail-collapse"},dx={class:"apf-detail-collapse-inner"},ox={key:1,class:"apf-chip apf-chip-success"},nx={class:"apf-approval-head"},sx={key:0,class:"apf-approval-danger-tag"},Zx={class:"apf-approval-prompt"},mx={class:"apf-approval-actions"},bx=["disabled","onClick"],mw=E(a.defineComponent({__name:"MessageBubble",props:{message:{},run:{},sending:{type:Boolean},brandMark:{},sessionMessages:{}},emits:["resume","cancel","retry","open-process","preview"],setup(C,{emit:I}){const g=C,A=I,i=a.useSlots(),l=a.computed(()=>!!(i.content||i.default)),e=a.ref(!1),t=a.ref(null),c=a.computed(()=>{var z,k;const M=[...g.message.attachments||[]];if(!((z=g.sessionMessages)!=null&&z.length))return M;const F=g.sessionMessages.findIndex(f=>f.id===g.message.id);if(F<=0)return M;for(let f=F-1;f>=0;f--){const Q=g.sessionMessages[f];if(Q.role==="user"&&((k=Q.attachments)!=null&&k.length)){for(const O of Q.attachments)M.some(gg=>gg.id===O.id)||M.push(O);break}}return M}),d=a.computed(()=>c.value.filter(ul));function o(M){t.value=M,e.value=!0,A("preview",M)}const n=a.computed(()=>g.message.role==="user"),s=a.computed(()=>g.message.role==="assistant");function Z(M){return{PENDING:"排队中",RUNNING:"正在处理",WAITING_INPUT:"等待你的确认",COMPLETED:"已完成",FAILED:"处理失败",CANCELLED:"已取消"}[M]||M}function m(M){return{RUNNING:"apf-chip-running",WAITING_INPUT:"apf-chip-waiting",COMPLETED:"apf-chip-success",FAILED:"apf-chip-failed",CANCELLED:"apf-chip-cancelled"}[M]||"apf-chip-cancelled"}const b=[{action:"approve",label:"确认继续",style:"primary"},{action:"reject",label:"需要修改",style:"danger"}],G=a.computed(()=>{var F,z;if(g.message.status!=="WAITING_INPUT")return null;const M=(F=g.run)==null?void 0:F.waiting;if(M){const k=(z=M.actions)!=null&&z.length?M.actions:b;return{prompt:M.prompt||"请确认后继续。",fields:M.fields||[],actions:k,dangerous:!!M.dangerous}}return{prompt:"请确认后继续。",fields:[],actions:b,dangerous:!1}}),r=a.computed(()=>g.message.content||""),h=a.computed(()=>{var M;return!l.value&&s.value&&g.message.status==="RUNNING"&&!r.value&&!((M=g.message.attachments)!=null&&M.length)}),u=a.computed(()=>{var M,F;return l.value||!!r.value||!!((M=g.message.documentSummaries)!=null&&M.length)||!!((F=g.message.attachments)!=null&&F.length)}),B=a.computed(()=>n.value?"apf-user":g.message.status==="WAITING_INPUT"?"apf-waiting":g.message.status==="FAILED"?"apf-failed":""),W=a.ref("");function w(M){A("resume",M,W.value||void 0),W.value=""}function Y(){var F;const M=r.value||g.message.content;M&&((F=navigator.clipboard)==null||F.writeText(M))}function p(){const M=r.value||g.message.content;if(!M)return;const F=new Blob([M],{type:"text/markdown;charset=utf-8"}),z=URL.createObjectURL(F),k=document.createElement("a");k.href=z,k.download="reply.md",k.click(),URL.revokeObjectURL(z)}function V(M){return M.error?"失败":M.result!==void 0?"已完成":"处理中"}const y=a.ref(!1),N=a.ref(!1),H=a.ref(!1),R=a.computed(()=>s.value&&g.message.status==="RUNNING"&&!!g.message.thinking);a.watch(()=>{var M;return[g.message.status,!!((M=g.message.thinking)!=null&&M.trim())]},([M,F])=>{if(!F){y.value=!1,N.value=!1;return}if(M==="RUNNING"){y.value=!0,N.value=!1;return}N.value||(y.value=!1)},{immediate:!0});function D(){y.value=!y.value,N.value=!0}function S(){H.value=!H.value}return(M,F)=>{var z,k,f,Q,O;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-message",[C.message.role,C.message.status&&s.value?`apf-st-${C.message.status}`:""]])},[s.value&&C.brandMark?(a.openBlock(),a.createBlock(a.resolveDynamicComponent(C.brandMark),{key:0,variant:"ai",size:"sm"})):a.createCommentVNode("",!0),a.createElementVNode("div",OT,[s.value&&C.message.tip?(a.openBlock(),a.createElementBlock("p",ET,a.toDisplayString(C.message.tip),1)):a.createCommentVNode("",!0),h.value?(a.openBlock(),a.createElementBlock("div",PT,[...F[4]||(F[4]=[a.createElementVNode("span",{class:"apf-status-text"},"正在处理",-1),a.createElementVNode("span",{class:"apf-dots"},[a.createElementVNode("i"),a.createElementVNode("i"),a.createElementVNode("i")],-1)])])):u.value?(a.openBlock(),a.createElementBlock("div",_T,[a.createElementVNode("div",{class:a.normalizeClass(["apf-bubble apf-message-content",B.value])},[!l.value&&((z=C.message.attachments)!=null&&z.length)?(a.openBlock(),a.createBlock(ow,{key:0,attachments:C.message.attachments,onPreview:o},null,8,["attachments"])):a.createCommentVNode("",!0),a.renderSlot(M.$slots,"content",{},()=>[a.renderSlot(M.$slots,"default",{},()=>[r.value?(a.openBlock(),a.createBlock(dw,{key:0,content:r.value},null,8,["content"])):a.createCommentVNode("",!0)],!0)],!0),!l.value&&((k=C.message.documentSummaries)!=null&&k.length)?(a.openBlock(),a.createBlock(nw,{key:1,summaries:C.message.documentSummaries,attachments:c.value,onPreview:o},null,8,["summaries","attachments"])):a.createCommentVNode("",!0),!l.value&&s.value&&C.message.status==="RUNNING"&&r.value?(a.openBlock(),a.createElementBlock("p",qT,"仍在处理…")):a.createCommentVNode("",!0)],2),!l.value&&s.value&&C.message.status==="COMPLETED"?(a.openBlock(),a.createElementBlock("div",$T,[a.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:Y},[...F[5]||(F[5]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),a.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])]),a.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:p},[...F[6]||(F[6]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),C.message.thinking||(f=C.message.toolCalls)!=null&&f.length?(a.openBlock(),a.createElementBlock("button",{key:0,class:"apf-text-link",type:"button",onClick:F[0]||(F[0]=gg=>A("open-process"))},"处理信息")):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),!l.value&&s.value&&C.message.status==="FAILED"?(a.openBlock(),a.createElementBlock("div",gx,[a.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"重试",onClick:F[1]||(F[1]=gg=>A("retry"))},[...F[7]||(F[7]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("path",{d:"M3.2 8a4.8 4.8 0 0 1 8.3-3.2",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M12.8 8a4.8 4.8 0 0 1-8.3 3.2",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"}),a.createElementVNode("path",{d:"M11.2 2.6v2.6h-2.6M4.8 13.4v-2.6h2.6",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])])):a.createCommentVNode("",!0)])):!l.value&&s.value&&C.message.status==="WAITING_INPUT"&&!u.value?(a.openBlock(),a.createElementBlock("div",Ix,"请在下方确认后继续。")):!l.value&&s.value&&C.message.status==="FAILED"&&!u.value?(a.openBlock(),a.createElementBlock("div",Cx,"处理失败")):!l.value&&s.value&&C.message.status==="CANCELLED"&&!u.value?(a.openBlock(),a.createElementBlock("div",Ax,"已取消")):a.createCommentVNode("",!0),l.value?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(Zw,{key:6,modelValue:e.value,"onUpdate:modelValue":F[2]||(F[2]=gg=>e.value=gg),attachment:t.value,"onUpdate:attachment":F[3]||(F[3]=gg=>t.value=gg),gallery:d.value},null,8,["modelValue","attachment","gallery"])),!l.value&&s.value&&((Q=C.message.thinking)!=null&&Q.trim())?(a.openBlock(),a.createElementBlock("div",{key:7,class:a.normalizeClass(["apf-detail-block",{open:y.value,streaming:R.value}])},[a.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":y.value,onClick:D},[F[8]||(F[8]=a.createElementVNode("span",{class:"apf-chevron"},null,-1)),F[9]||(F[9]=a.createElementVNode("span",null,"思考过程",-1)),R.value?(a.openBlock(),a.createElementBlock("span",lx)):a.createCommentVNode("",!0)],8,ix),a.createElementVNode("div",ex,[a.createElementVNode("div",tx,[a.createElementVNode("div",{class:a.normalizeClass(["apf-detail-content",{streaming:R.value}])},a.toDisplayString(C.message.thinking),3)])])],2)):a.createCommentVNode("",!0),!l.value&&s.value&&((O=C.message.toolCalls)!=null&&O.length)?(a.openBlock(),a.createElementBlock("div",{key:8,class:a.normalizeClass(["apf-detail-block",{open:H.value}])},[a.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":H.value,onClick:S},[F[10]||(F[10]=a.createElementVNode("span",{class:"apf-chevron"},null,-1)),a.createElementVNode("span",null,"处理步骤("+a.toDisplayString(C.message.toolCalls.length)+")",1)],8,ax),a.createElementVNode("div",cx,[a.createElementVNode("div",dx,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.message.toolCalls,gg=>(a.openBlock(),a.createElementBlock("div",{key:gg.id||gg.name,class:"apf-tool-row"},[a.createElementVNode("strong",null,a.toDisplayString(gg.name),1),a.createElementVNode("span",{class:a.normalizeClass({"apf-err":!!gg.error})},a.toDisplayString(V(gg)),3)]))),128))])])],2)):a.createCommentVNode("",!0),l.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock(a.Fragment,{key:9},[s.value&&C.message.status!=="COMPLETED"&&C.message.status!=="CANCELLED"?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["apf-chip",m(C.message.status)])},[F[11]||(F[11]=a.createElementVNode("i",null,null,-1)),a.createTextVNode(a.toDisplayString(Z(C.message.status)),1)],2)):s.value&&C.message.status==="COMPLETED"?(a.openBlock(),a.createElementBlock("span",ox,[...F[12]||(F[12]=[a.createElementVNode("i",null,null,-1),a.createTextVNode("已完成",-1)])])):a.createCommentVNode("",!0)],64)),!l.value&&G.value?(a.openBlock(),a.createElementBlock("div",{key:10,class:a.normalizeClass(["apf-inline-approval",{"apf-dangerous-approval":G.value.dangerous}])},[a.createElementVNode("div",nx,[F[13]||(F[13]=a.createElementVNode("span",{class:"apf-approval-title"},"需要你的确认",-1)),G.value.dangerous?(a.openBlock(),a.createElementBlock("span",sx,"需谨慎")):a.createCommentVNode("",!0)]),a.createElementVNode("p",Zx,a.toDisplayString(G.value.prompt),1),a.createElementVNode("div",mx,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(G.value.actions,gg=>(a.openBlock(),a.createElementBlock("button",{key:gg.action,type:"button",class:a.normalizeClass(["apf-approval-btn",gg.style==="danger"?"apf-approval-btn-danger":"apf-approval-btn-primary"]),disabled:C.sending,onClick:q=>w(gg.action)},a.toDisplayString(gg.label),11,bx))),128))])],2)):a.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-43084dc4"]]),Gx={class:"apf-tip-banner"},rx={class:"apf-tip-banner__text"},hx=E(a.defineComponent({__name:"TipBanner",props:{text:{},icon:{default:"info-filled"}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("div",Gx,[a.createVNode(a.unref($),{name:C.icon,class:"apf-tip-banner__icon",size:18},null,8,["name"]),a.createElementVNode("span",rx,a.toDisplayString(C.text),1)]))}}),[["__scopeId","data-v-29445db0"]]),ux={class:"apf-starter-grid"},Bx=["onClick"],Wx={class:"apf-starter-grid__text"},Yx=E(a.defineComponent({__name:"StarterPromptGrid",props:{prompts:{}},emits:["select"],setup(C,{emit:I}){const g=I;return(A,i)=>(a.openBlock(),a.createElementBlock("div",ux,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.prompts,(l,e)=>(a.openBlock(),a.createElementBlock("button",{key:e,type:"button",class:"apf-starter-grid__card",onClick:t=>g("select",l)},[l.icon?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:l.icon,size:16,class:"apf-starter-grid__icon"},null,8,["name"])):a.createCommentVNode("",!0),a.createElementVNode("span",Wx,a.toDisplayString(l.text),1)],8,Bx))),128))]))}}),[["__scopeId","data-v-227b664d"]]),Vx={key:0,class:"apf-skeleton-line"},px=E(a.defineComponent({__name:"MessageList",props:{messages:{},loading:{type:Boolean},currentRun:{},sending:{type:Boolean},brandMark:{}},emits:["resume","cancel","retry","open-process","preview"],setup(C,{expose:I,emit:g}){const A=C,i=g,l=a.useSlots(),e=a.ref(null),t=a.computed(()=>!!l.body),c=a.computed(()=>!A.loading&&A.messages.length===0&&!!l.empty);async function d(){await a.nextTick(),e.value&&(e.value.scrollTop=e.value.scrollHeight)}a.watch(()=>A.messages.length,()=>{t.value||d()},{flush:"post"}),a.watch(()=>A.messages.map(n=>`${n.id}:${n.status}:${(n.content||"").length}`).join("|"),()=>{t.value||d()},{flush:"post"});function o(n){return!A.currentRun||!n.runtimeExecutionId?null:A.currentRun.runtimeExecutionId===n.runtimeExecutionId?A.currentRun:null}return I({scrollToBottom:d,container:e}),(n,s)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"container",ref:e,class:"apf-message-list"},[C.loading&&!C.messages.length&&!t.value?(a.openBlock(),a.createElementBlock("div",Vx,[...s[4]||(s[4]=[a.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"60%"}},null,-1),a.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"45%","margin-top":"var(--spacing-sm, 8px)"}},null,-1)])])):c.value?a.renderSlot(n.$slots,"empty",{},void 0,!0,1):a.renderSlot(n.$slots,"body",{messages:C.messages,scrollToBottom:d},()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.messages,Z=>(a.openBlock(),a.createBlock(mw,{key:Z.id,message:Z,run:o(Z),sending:!!C.sending,"brand-mark":C.brandMark,"session-messages":C.messages,onResume:s[0]||(s[0]=(m,b)=>i("resume",m,b)),onCancel:s[1]||(s[1]=m=>i("cancel")),onRetry:s[2]||(s[2]=m=>i("retry")),onOpenProcess:m=>i("open-process",Z),onPreview:s[3]||(s[3]=m=>i("preview",m))},null,8,["message","run","sending","brand-mark","session-messages","onOpenProcess"]))),128))],!0,2)],512))}}),[["__scopeId","data-v-5df6388a"]]),yx=["disabled","aria-busy","aria-label","title"],Nx={key:0,class:"apf-optimize-spin","aria-hidden":"true"},Xx={key:1,"aria-hidden":"true"},bw=E(a.defineComponent({__name:"PromptOptimizeButton",props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},tooltip:{default:"优化提示词"}},emits:["click"],setup(C,{emit:I}){const g=I;function A(i){i.defaultPrevented||g("click",i)}return(i,l)=>(a.openBlock(),a.createElementBlock("button",{type:"button",class:"apf-optimize-btn",disabled:C.disabled||C.loading,"aria-busy":C.loading,"aria-label":C.tooltip,title:C.tooltip,onClick:A},[C.loading?(a.openBlock(),a.createElementBlock("span",Nx)):(a.openBlock(),a.createElementBlock("span",Xx,"✨"))],8,yx))}}),[["__scopeId","data-v-fac63829"]]),Rx={key:0,class:"apf-pending-list"},Hx=["src"],Sx={class:"apf-pending-name"},Mx={key:1,class:"apf-pending-status"},Dx={key:2,class:"apf-pending-status apf-error"},Kx=["onClick"],Fx=["placeholder","disabled"],zx={class:"apf-composer-footer"},Jx={class:"apf-composer-tools"},vx=["disabled"],kx={class:"apf-composer-actions"},Lx=["disabled"],Tx={key:0,class:"apf-composer-meta"},xx={class:"apf-cap-row"},fx={key:0,class:"apf-cap-chip"},jx={key:1,class:"apf-cap-chip"},Qx={class:"apf-meta-right"},Ux=E(a.defineComponent({__name:"Composer",props:{disabled:{type:Boolean},placeholder:{},supportedInputs:{},hitlCapable:{type:Boolean},wsStatus:{},wsLabel:{},hideDefaultInput:{type:Boolean},hideSend:{type:Boolean},hideFileButton:{type:Boolean},hideMeta:{type:Boolean},stretch:{type:Boolean},promptOptimize:{}},emits:["send","upload","remove-attachment","ws-click","optimize-error"],setup(C,{expose:I,emit:g}){const A=C,i=g,l=a.ref(""),e=a.ref(null),t=a.ref(null),c=a.ref([]),d=a.ref(!1),o=a.ref(!1),n=a.useSlots(),s=a.computed(()=>A.supportedInputs||["text"]),Z=a.computed(()=>s.value.some(S=>S==="file"||S==="image"||S==="document")),m=a.computed(()=>!!n.input),b=a.computed(()=>!A.hideDefaultInput&&!m.value),G=a.computed(()=>!A.hideSend),r=a.computed(()=>Z.value&&!A.hideFileButton),h=a.computed(()=>!!A.promptOptimize&&!n.optimize),u=a.computed(()=>{if(A.disabled||d.value||o.value)return!1;const S=!!l.value.trim(),M=c.value.some(z=>z.status==="done"),F=c.value.some(z=>z.status==="uploading");return(S||M)&&!F}),B=a.computed(()=>!A.promptOptimize||A.disabled||d.value||o.value?!1:!!l.value.trim());async function W(S){l.value=S,await a.nextTick(),e.value&&(e.value.style.height="auto",e.value.style.height=Math.min(e.value.scrollHeight,220)+"px")}function w(S){const M=S.trim(),F=M.match(/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```$/);return(F?F[1]:M).trim()}async function Y(){if(!B.value||!A.promptOptimize)return;const S=l.value.trim();o.value=!0;try{const M=await A.promptOptimize.request(S),F=w(M||"");if(!F)throw new Error("优化结果为空");await W(F)}catch(M){i("optimize-error",M)}finally{o.value=!1}}const p=a.computed(()=>({text:l.value,setText:W,disabled:A.disabled||d.value,loading:o.value,optimize:Y}));function V(){var S;A.disabled||!Z.value||(S=t.value)==null||S.click()}function y(S){const M=S.target,F=M.files;if(F!=null&&F.length){for(const z of Array.from(F))i("upload",z);M.value=""}}function N(S){const M=c.value.find(F=>F.id===S);M!=null&&M.previewUrl&&URL.revokeObjectURL(M.previewUrl),c.value=c.value.filter(F=>F.id!==S),i("remove-attachment",S)}async function H(){if(!u.value)return;const S=l.value.trim(),M=c.value.filter(F=>F.status==="done").map(F=>F.id);i("send",S,M),l.value="",c.value.forEach(F=>{F.previewUrl&&URL.revokeObjectURL(F.previewUrl)}),c.value=[],await a.nextTick(),e.value&&(e.value.style.height="auto")}function R(S){const M=S.target;M.style.height="auto",M.style.height=Math.min(M.scrollHeight,220)+"px"}function D(S){S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),H())}return a.onBeforeUnmount(()=>{c.value.forEach(S=>{S.previewUrl&&URL.revokeObjectURL(S.previewUrl)})}),I({getText:()=>l.value,setText:W,optimize:Y}),(S,M)=>(a.openBlock(),a.createElementBlock("form",{class:a.normalizeClass(["apf-composer",{"apf-composer-stretch":C.stretch}]),onSubmit:a.withModifiers(H,["prevent"])},[a.createElementVNode("div",{class:a.normalizeClass(["apf-composer-field",{"apf-disabled":C.disabled}])},[M[3]||(M[3]=a.createElementVNode("svg",{class:"apf-stream-ring","aria-hidden":"true",focusable:"false"},[a.createElementVNode("rect",{class:"apf-stream-ring-trail apf-stream-cw",pathLength:"100"}),a.createElementVNode("rect",{class:"apf-stream-ring-path apf-stream-cw",pathLength:"100"}),a.createElementVNode("rect",{class:"apf-stream-ring-trail apf-stream-ccw",pathLength:"100"}),a.createElementVNode("rect",{class:"apf-stream-ring-path apf-stream-ccw",pathLength:"100"})],-1)),a.renderSlot(S.$slots,"pending",{},()=>[c.value.length?(a.openBlock(),a.createElementBlock("div",Rx,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,F=>(a.openBlock(),a.createElementBlock("div",{key:F.id,class:a.normalizeClass(["apf-pending-chip",F.status])},[F.previewUrl?(a.openBlock(),a.createElementBlock("img",{key:0,src:F.previewUrl,alt:"",class:"apf-pending-thumb"},null,8,Hx)):a.createCommentVNode("",!0),a.createElementVNode("span",Sx,a.toDisplayString(F.filename),1),F.status==="uploading"?(a.openBlock(),a.createElementBlock("span",Mx,"上传中")):F.status==="error"?(a.openBlock(),a.createElementBlock("span",Dx,a.toDisplayString(F.error||"失败"),1)):a.createCommentVNode("",!0),a.createElementVNode("button",{type:"button",class:"apf-pending-remove",onClick:z=>N(F.id)},"×",8,Kx)],2))),128))])):a.createCommentVNode("",!0)],!0),a.renderSlot(S.$slots,"input",{},()=>[b.value?a.withDirectives((a.openBlock(),a.createElementBlock("textarea",{key:0,ref_key:"textareaRef",ref:e,"onUpdate:modelValue":M[0]||(M[0]=F=>l.value=F),placeholder:C.placeholder||"输入消息…",disabled:C.disabled||o.value,onInput:R,onKeydown:D},null,40,Fx)),[[a.vModelText,l.value]]):a.createCommentVNode("",!0)],!0),a.createElementVNode("div",zx,[a.createElementVNode("div",Jx,[a.renderSlot(S.$slots,"tools",{},void 0,!0),a.createElementVNode("input",{ref_key:"fileInputRef",ref:t,type:"file",class:"apf-file-input",multiple:"",accept:"image/*,.pdf,.txt,.md,.csv,.json,.doc,.docx,.xls,.xlsx",onChange:y},null,544),r.value?(a.openBlock(),a.createElementBlock("button",{key:0,class:"apf-cap-btn",type:"button","aria-label":"添加文件",disabled:C.disabled||d.value||o.value,onClick:V},[...M[2]||(M[2]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("path",{d:"M9.2 2.8 4.4 7.6a2.6 2.6 0 0 0 3.7 3.7l5.2-5.2a1.8 1.8 0 0 0-2.5-2.5L5.6 8.8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,vx)):a.createCommentVNode("",!0)]),a.renderSlot(S.$slots,"actions",{canSend:u.value,send:H,optimizeProps:p.value},()=>[a.createElementVNode("div",kx,[a.renderSlot(S.$slots,"optimize",a.normalizeProps(a.guardReactiveProps(p.value)),()=>{var F;return[h.value?(a.openBlock(),a.createBlock(a.unref(bw),{key:0,disabled:!B.value,loading:o.value,tooltip:(F=C.promptOptimize)==null?void 0:F.tooltip,onClick:Y},null,8,["disabled","loading","tooltip"])):a.createCommentVNode("",!0)]},!0),G.value?(a.openBlock(),a.createElementBlock("button",{key:0,type:"submit",class:"apf-send-btn",disabled:!u.value,title:"发送"},"↗",8,Lx)):a.createCommentVNode("",!0)])],!0)])],2),C.hideMeta?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",Tx,[a.createElementVNode("div",xx,[M[4]||(M[4]=a.createElementVNode("span",{class:"apf-cap-chip"},"文本",-1)),Z.value?(a.openBlock(),a.createElementBlock("span",fx,"文件")):a.createCommentVNode("",!0),C.hitlCapable?(a.openBlock(),a.createElementBlock("span",jx,"需要确认")):a.createCommentVNode("",!0)]),a.createElementVNode("div",Qx,[C.wsStatus?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:a.normalizeClass(["apf-ws-status",C.wsStatus]),onClick:M[1]||(M[1]=F=>i("ws-click"))},[...M[5]||(M[5]=[a.createElementVNode("i",{class:"apf-ws-dot"},null,-1)])],2)):a.createCommentVNode("",!0),M[6]||(M[6]=a.createElementVNode("small",{class:"apf-hint"},"Enter 发送 · Shift+Enter 换行",-1))])]))],34))}}),[["__scopeId","data-v-a6c71974"]]),Ox={key:0,class:"apf-run-bar"},Ex={class:"apf-row"},Px={key:0,class:"apf-elapsed"},_x={key:0,class:"apf-error-text"},Gw=E(a.defineComponent({__name:"RunStatusBar",props:{run:{},sending:{type:Boolean}},emits:["cancel"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>{var c;return((c=g.run)==null?void 0:c.status)||null});function l(c){return{RUNNING:"正在处理",COMPLETED:"已完成",FAILED:"处理失败",WAITING_INPUT:"等待你的确认",CANCELLED:"已取消"}[c]||c}function e(c){return{RUNNING:"apf-running",COMPLETED:"apf-success",FAILED:"apf-failed",WAITING_INPUT:"apf-waiting",CANCELLED:"apf-cancelled"}[c]||""}function t(){if(!g.run)return"";const c=new Date(g.run.startedAt).getTime(),d=g.run.finishedAt?new Date(g.run.finishedAt).getTime():Date.now(),o=Math.round((d-c)/1e3);return o<60?o+"s":Math.floor(o/60)+"m "+o%60+"s"}return(c,d)=>C.run?(a.openBlock(),a.createElementBlock("div",Ox,[a.createElementVNode("div",Ex,[a.createElementVNode("span",{class:a.normalizeClass(["apf-chip",e(i.value||"")])},[d[1]||(d[1]=a.createElementVNode("i",null,null,-1)),a.createTextVNode(a.toDisplayString(l(i.value||"")),1)],2),i.value==="RUNNING"||i.value==="WAITING_INPUT"?(a.openBlock(),a.createElementBlock("span",Px,a.toDisplayString(t()),1)):a.createCommentVNode("",!0),i.value==="RUNNING"?(a.openBlock(),a.createElementBlock("button",{key:1,class:"apf-btn-cancel",onClick:d[0]||(d[0]=o=>A("cancel"))},"停止")):a.createCommentVNode("",!0)]),C.run.errorMessage?(a.openBlock(),a.createElementBlock("p",_x,a.toDisplayString(C.run.errorMessage),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-33963f1d"]]),qx={class:"apf-stream-banner__text"},$x=E(a.defineComponent({__name:"StreamStatusBanner",props:{status:{},message:{},retryLabel:{default:"重试"},showRetry:{type:Boolean,default:!0}},emits:["retry"],setup(C,{emit:I}){const g=I;return(A,i)=>C.status==="disconnected"||C.status==="reconnecting"||C.status==="connecting"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["apf-stream-banner",`is-${C.status}`]),role:"status"},[a.createElementVNode("span",qx,a.toDisplayString(C.message||C.status),1),C.showRetry&&C.status==="disconnected"?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-stream-banner__retry",onClick:i[0]||(i[0]=l=>g("retry"))},a.toDisplayString(C.retryLabel),1)):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-c9033191"]]),gf={class:"apf-header"},If={key:0,class:"apf-danger-tag"},Cf={class:"apf-prompt"},Af=["placeholder"],lf=["value"],ef=["placeholder"],tf={class:"apf-actions"},af=["disabled","onClick"],cf=E(a.defineComponent({__name:"ApprovalCard",props:{waiting:{},disabled:{type:Boolean}},emits:["resume"],setup(C,{emit:I}){const g=I,A=a.ref("");function i(e){return e==="danger"?"apf-btn-danger":e==="ghost"||e==="default"?"apf-btn-ghost":"apf-btn-primary"}function l(e){g("resume",e,A.value||void 0),A.value=""}return(e,t)=>C.waiting?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["apf-approval-card",{"apf-dangerous":C.waiting.dangerous}])},[a.createElementVNode("div",gf,[t[3]||(t[3]=a.createElementVNode("span",{class:"apf-title"},"需要你的操作",-1)),C.waiting.dangerous?(a.openBlock(),a.createElementBlock("span",If,"危险操作")):a.createCommentVNode("",!0)]),a.createElementVNode("p",Cf,a.toDisplayString(C.waiting.prompt),1),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.waiting.fields,c=>(a.openBlock(),a.createElementBlock("div",{key:c.key,class:"apf-field"},[a.createElementVNode("label",null,a.toDisplayString(c.label),1),c.type==="textarea"?a.withDirectives((a.openBlock(),a.createElementBlock("textarea",{key:0,"onUpdate:modelValue":t[0]||(t[0]=d=>A.value=d),placeholder:"请输入"+c.label,rows:"2"},null,8,Af)),[[a.vModelText,A.value]]):c.type==="select"&&c.options.length?a.withDirectives((a.openBlock(),a.createElementBlock("select",{key:1,"onUpdate:modelValue":t[1]||(t[1]=d=>A.value=d)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.options,d=>(a.openBlock(),a.createElementBlock("option",{key:d,value:d},a.toDisplayString(d),9,lf))),128))],512)),[[a.vModelSelect,A.value]]):a.withDirectives((a.openBlock(),a.createElementBlock("input",{key:2,"onUpdate:modelValue":t[2]||(t[2]=d=>A.value=d),placeholder:"请输入"+c.label},null,8,ef)),[[a.vModelText,A.value]])]))),128)),a.createElementVNode("div",tf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.waiting.actions,c=>(a.openBlock(),a.createElementBlock("button",{key:c.action,type:"button",class:a.normalizeClass(["apf-btn",i(c.style)]),disabled:C.disabled,onClick:d=>l(c.action)},a.toDisplayString(c.label),11,af))),128))])],2)):a.createCommentVNode("",!0)}}),[["__scopeId","data-v-d568067a"]]),df={class:"apf-session-sidebar","aria-label":"会话列表"},of={class:"apf-session-sidebar__head"},nf={class:"apf-session-sidebar__head-actions"},sf={key:0,class:"apf-session-sidebar__below-head"},Zf={class:"apf-session-sidebar__list"},mf=["onClick"],bf={class:"apf-session-sidebar__item-title"},Gf={class:"apf-session-sidebar__item-meta"},rf={key:0,class:"apf-session-sidebar__empty"},hf=E(a.defineComponent({__name:"SessionSidebar",props:{sessions:{},activeId:{},loading:{type:Boolean},title:{},hideCreate:{type:Boolean},hideDelete:{type:Boolean},emptyText:{}},emits:["select","create","delete"],setup(C,{emit:I}){const g=I;function A(i){if(!i)return"";const l=new Date(i),e=new Date,t=e.getTime()-l.getTime();if(t<864e5&&l.getDate()===e.getDate())return l.toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"});const c=new Date(e);return c.setDate(c.getDate()-1),l.getDate()===c.getDate()&&l.getMonth()===c.getMonth()&&l.getFullYear()===c.getFullYear()?"昨天":t<6e4?"刚刚":t<36e5?`${Math.floor(t/6e4)} 分钟前`:t<864e5?`${Math.floor(t/36e5)} 小时前`:l.toLocaleDateString("zh-CN",{month:"2-digit",day:"2-digit"})}return(i,l)=>{const e=a.resolveComponent("el-button"),t=a.resolveDirective("loading");return a.openBlock(),a.createElementBlock("aside",df,[a.createElementVNode("div",of,[a.createElementVNode("strong",null,a.toDisplayString(C.title||"会话"),1),a.createElementVNode("div",nf,[a.renderSlot(i.$slots,"toolbar",{},void 0,!0),C.hideCreate?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(e,{key:0,type:"primary",size:"small",onClick:l[0]||(l[0]=c=>g("create"))},{default:a.withCtx(()=>[...l[2]||(l[2]=[a.createTextVNode("新建",-1)])]),_:1}))])]),i.$slots["below-head"]?(a.openBlock(),a.createElementBlock("div",sf,[a.renderSlot(i.$slots,"below-head",{},void 0,!0)])):a.createCommentVNode("",!0),a.withDirectives((a.openBlock(),a.createElementBlock("div",Zf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.sessions,c=>(a.openBlock(),a.createElementBlock("button",{key:c.id,type:"button",class:a.normalizeClass(["apf-session-sidebar__item",{"is-active":c.id===C.activeId}]),onClick:d=>g("select",c.id)},[a.createElementVNode("span",bf,a.toDisplayString(c.title||"未命名会话"),1),a.createElementVNode("div",Gf,[a.renderSlot(i.$slots,"item-meta",{session:c},()=>[a.createElementVNode("small",null,a.toDisplayString(A(c.updatedAt||c.createdAt)),1)],!0)]),a.createElementVNode("div",{class:"apf-session-sidebar__item-actions",onClick:l[1]||(l[1]=a.withModifiers(()=>{},["stop"]))},[a.renderSlot(i.$slots,"item-actions",{session:c},()=>[C.hideDelete?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(e,{key:0,class:"apf-session-sidebar__delete",link:"",type:"danger",size:"small",onClick:d=>g("delete",c.id)},{default:a.withCtx(()=>[...l[3]||(l[3]=[a.createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"]))],!0)])],10,mf))),128)),!C.loading&&!C.sessions.length?(a.openBlock(),a.createElementBlock("div",rf,a.toDisplayString(C.emptyText||"暂无会话"),1)):a.createCommentVNode("",!0)])),[[t,C.loading]])])}}}),[["__scopeId","data-v-b00284f7"]]),uf=a.defineComponent({__name:"SessionHistoryDrawer",props:{visible:{type:Boolean},title:{default:"对话历史"},size:{default:320},direction:{default:"rtl"}},emits:["update:visible"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-drawer");return a.openBlock(),a.createBlock(l,{"model-value":C.visible,title:C.title,size:C.size,direction:C.direction,class:"apf-session-history-drawer","append-to-body":"","onUpdate:modelValue":i[0]||(i[0]=e=>g("update:visible",e))},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default")]),_:3},8,["model-value","title","size","direction"])}}}),Bf=E(a.defineComponent({__name:"VirtualMessageScroller",props:{items:{},keyField:{default:"key"},minItemSize:{default:72},sizeDependencies:{}},emits:["scroll"],setup(C,{emit:I}){const g=I;return(A,i)=>(a.openBlock(),a.createBlock(a.unref(cB.DynamicScroller),{items:C.items,"min-item-size":C.minItemSize,"key-field":C.keyField,class:"apf-virtual-message-scroller",onScroll:i[0]||(i[0]=l=>g("scroll",l))},{default:a.withCtx(({item:l,index:e,active:t})=>[a.createVNode(a.unref(cB.DynamicScrollerItem),{item:l,active:t,"data-index":e,"size-dependencies":C.sizeDependencies?C.sizeDependencies(l):void 0},{default:a.withCtx(()=>[a.renderSlot(A.$slots,"default",{item:l,index:e,active:t},void 0,!0)]),_:2},1032,["item","active","data-index","size-dependencies"])]),_:3},8,["items","min-item-size","key-field"]))}}),[["__scopeId","data-v-d9fdb738"]]),Wf={key:0,class:"apf-processing-drawer__subtitle"},wf={class:"apf-processing-drawer__body"},Yf=E(a.defineComponent({__name:"ProcessingDrawer",props:{modelValue:{type:Boolean},run:{},title:{},subtitle:{},sending:{type:Boolean}},emits:["update:modelValue","cancel"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-drawer");return a.openBlock(),a.createBlock(l,{"model-value":C.modelValue,title:C.title||"处理详情",size:"380px","append-to-body":"","onUpdate:modelValue":i[1]||(i[1]=e=>g("update:modelValue",e))},{default:a.withCtx(()=>[C.subtitle?(a.openBlock(),a.createElementBlock("p",Wf,a.toDisplayString(C.subtitle),1)):a.createCommentVNode("",!0),C.run?(a.openBlock(),a.createBlock(a.unref(Gw),{key:1,run:C.run,sending:C.sending??!1,onCancel:i[0]||(i[0]=e=>g("cancel"))},null,8,["run","sending"])):a.createCommentVNode("",!0),a.createElementVNode("div",wf,[a.renderSlot(A.$slots,"default",{},void 0,!0)])]),_:3},8,["model-value","title"])}}}),[["__scopeId","data-v-6036074a"]]),Vf={class:"apf-conversation-header"},pf={class:"apf-conversation-header__identity"},yf={class:"apf-conversation-header__copy"},Nf={class:"apf-conversation-header__meta-row"},Xf={key:0,class:"apf-conversation-header__label"},Rf={class:"apf-conversation-header__actions"},Hf={key:0,class:"apf-conversation-header__processing"},Sf=E(a.defineComponent({__name:"ConversationHeader",props:{title:{},label:{},hasMessages:{type:Boolean},processing:{type:Boolean},hideDefaultActions:{type:Boolean}},emits:["changeAssistant","toggleDetails","create"],setup(C,{emit:I}){const g=C,A=I,i=a.useSlots(),l=a.computed(()=>!g.hideDefaultActions&&!i.actions);return(e,t)=>(a.openBlock(),a.createElementBlock("header",Vf,[a.createElementVNode("div",pf,[a.renderSlot(e.$slots,"identity",{},()=>[a.createElementVNode("div",yf,[a.createElementVNode("div",Nf,[C.label?(a.openBlock(),a.createElementBlock("span",Xf,a.toDisplayString(C.label),1)):a.createCommentVNode("",!0),a.renderSlot(e.$slots,"meta",{},void 0,!0)]),a.createElementVNode("strong",null,a.toDisplayString(C.title||"选择一个智能体开始"),1)])],!0)]),a.createElementVNode("div",Rf,[C.processing?(a.openBlock(),a.createElementBlock("span",Hf,[...t[2]||(t[2]=[a.createElementVNode("i",null,null,-1),a.createElementVNode("span",null,"正在处理",-1)])])):a.createCommentVNode("",!0),a.renderSlot(e.$slots,"actions",{},()=>[l.value?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("button",{type:"button",class:"apf-conversation-header__btn",onClick:t[0]||(t[0]=c=>C.hasMessages?A("create"):A("changeAssistant"))},a.toDisplayString(C.hasMessages?"新建对话":"选择智能体"),1),C.hasMessages?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-conversation-header__btn",onClick:t[1]||(t[1]=c=>A("toggleDetails"))}," 处理详情 ")):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],!0)])]))}}),[["__scopeId","data-v-127a684e"]]),Mf=["title"],Df={key:0,class:"apf-pending-chip__spinner"},Kf=["src","alt"],Ff=["disabled"],zf={key:3,class:"apf-pending-chip__status"},Jf={key:4,class:"apf-pending-chip__status is-error"},vf=E(a.defineComponent({__name:"PendingAttachmentChip",props:{attachment:{}},emits:["preview","remove"],setup(C,{emit:I}){const g=C,A=I;function i(e){return e!=null&&e.startsWith("image/")?"picture":"document"}function l(){g.attachment.status==="done"&&A("preview",g.attachment)}return(e,t)=>{var c;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-pending-chip",{"is-error":C.attachment.status==="error","is-clickable":C.attachment.status==="done"}]),title:C.attachment.status==="error"&&C.attachment.error||C.attachment.filename},[C.attachment.status==="uploading"?(a.openBlock(),a.createElementBlock("span",Df)):C.attachment.previewUrl&&((c=C.attachment.mimetype)!=null&&c.startsWith("image/"))?(a.openBlock(),a.createElementBlock("img",{key:1,class:"apf-pending-chip__thumb",src:C.attachment.previewUrl,alt:C.attachment.filename},null,8,Kf)):(a.openBlock(),a.createBlock(a.unref($),{key:2,name:i(C.attachment.mimetype),size:14,class:"apf-pending-chip__icon"},null,8,["name"])),a.createElementVNode("button",{type:"button",class:"apf-pending-chip__name",disabled:C.attachment.status!=="done",onClick:l},a.toDisplayString(C.attachment.filename),9,Ff),C.attachment.status==="uploading"?(a.openBlock(),a.createElementBlock("span",zf,"上传中")):C.attachment.status==="error"?(a.openBlock(),a.createElementBlock("span",Jf,a.toDisplayString(C.attachment.error||"失败"),1)):a.createCommentVNode("",!0),a.createElementVNode("button",{type:"button",class:"apf-pending-chip__remove","aria-label":"移除",onClick:t[0]||(t[0]=d=>A("remove",C.attachment.id))},[a.createVNode(a.unref($),{name:"close",size:12})])],10,Mf)}}}),[["__scopeId","data-v-75e794a8"]]),kf={key:0,class:"apf-mention-panel",role:"listbox"},Lf={class:"apf-mention-panel-search"},Tf=["placeholder"],xf={class:"apf-mention-tabs"},ff=["onClick"],jf={class:"apf-mention-results"},Qf={key:0,class:"apf-mention-loading","aria-busy":"true"},Uf=["onClick","onMouseenter"],Of=["data-type"],Ef={class:"apf-mention-result-info"},Pf={class:"apf-mention-result-name"},_f={key:0,class:"apf-mention-result-meta"},qf={key:2,class:"apf-mention-empty"},$f={key:1,class:"apf-mention-chips"},gj={class:"apf-mention-chip-icon"},Ij=["onClick"],Cj=["placeholder","disabled"],Aj=E(a.defineComponent({__name:"MentionInput",props:{disabled:{type:Boolean},loading:{type:Boolean},placeholder:{default:"描述你想要生成的内容..."},tabs:{},search:{},typeBadge:{},debounceMs:{default:250},emptyText:{default:"无匹配结果"},searchPlaceholder:{default:"搜索引用..."}},emits:["send","input"],setup(C,{expose:I,emit:g}){var H;const A=C,i=g,l=a.ref(""),e=a.ref(),t=a.ref([]),c=a.ref(),d=a.ref(!1),o=a.ref(""),n=a.ref(((H=A.tabs[0])==null?void 0:H.key)??""),s=a.ref([]),Z=a.ref(!1),m=a.ref(-1),b=a.ref(-1);let G=null;a.watch(()=>A.tabs,R=>{var D;R.some(S=>S.key===n.value)||(n.value=((D=R[0])==null?void 0:D.key)??"")},{deep:!0});function r(R){return A.typeBadge?A.typeBadge(R):(R[0]||"?").toUpperCase()}function h(){const R=e.value;R&&(R.style.height="auto",R.style.height=`${Math.min(R.scrollHeight,102)}px`)}a.watch(l,()=>{a.nextTick(h)});function u(R,D){if(G&&clearTimeout(G),!R.trim()){s.value=[],Z.value=!1;return}Z.value=!0,G=setTimeout(async()=>{try{s.value=await A.search(R,D)}catch{s.value=[]}finally{Z.value=!1}},A.debounceMs)}a.watch([o,n],([R,D])=>{m.value=-1,u(R,D)});function B(){d.value=!1,o.value="",b.value=-1,m.value=-1,s.value=[]}function W(){var F;const R=l.value;i("input",R);const D=(F=e.value)==null?void 0:F.selectionStart,S=D!=null&&D>0?D:R.length,M=R.lastIndexOf("@",S-1);if(M>=0&&(M===0||R[M-1]===" "||R[M-1]===`
|
|
72
|
-
`)){const z=R.slice(M+1,S);if(!z.includes(" ")&&z.length<=30){b.value=M,o.value=z,d.value=!0;return}}B()}function w(R){if(d.value){if(R.key==="ArrowDown"){R.preventDefault(),m.value=Math.min(m.value+1,Math.max(s.value.length-1,0));return}if(R.key==="ArrowUp"){R.preventDefault(),m.value=Math.max(m.value-1,0);return}if(R.key==="Enter"&&m.value>=0&&s.value[m.value]){R.preventDefault(),Y(s.value[m.value]);return}if(R.key==="Escape"){R.preventDefault(),B();return}}R.key==="Enter"&&!R.shiftKey&&!d.value&&(R.preventDefault(),V())}function Y(R){var z;const D={id:R.id,type:R.type,label:R.name};t.value.some(k=>k.id===D.id&&k.type===D.type)||t.value.push(D);const S=l.value,M=b.value,F=((z=e.value)==null?void 0:z.selectionStart)??S.length;M>=0&&(l.value=`${S.slice(0,M)}@${R.name} ${S.slice(F)}`),B(),a.nextTick(()=>{var k;return(k=e.value)==null?void 0:k.focus()})}function p(R){t.value.splice(R,1)}function V(){const R=l.value.trim();!R&&t.value.length===0||A.disabled||(i("send",R,[...t.value]),l.value="",t.value=[])}function y(R){c.value&&!c.value.contains(R.target)&&B()}function N(){var R;(R=e.value)==null||R.focus()}return I({focus:N}),a.onMounted(()=>{document.addEventListener("mousedown",y)}),a.onBeforeUnmount(()=>{document.removeEventListener("mousedown",y),G&&clearTimeout(G)}),(R,D)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"wrapperRef",ref:c,class:"apf-mention-input"},[d.value?(a.openBlock(),a.createElementBlock("div",kf,[a.createElementVNode("div",Lf,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":D[0]||(D[0]=S=>o.value=S),class:"apf-mention-panel-input",type:"text",placeholder:C.searchPlaceholder,autocomplete:"off"},null,8,Tf),[[a.vModelText,o.value]])]),a.createElementVNode("div",xf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.tabs,S=>(a.openBlock(),a.createElementBlock("button",{key:S.key,type:"button",class:a.normalizeClass(["apf-mention-tab",{"is-active":n.value===S.key}]),onClick:M=>n.value=S.key},a.toDisplayString(S.label),11,ff))),128))]),a.createElementVNode("div",jf,[Z.value?(a.openBlock(),a.createElementBlock("div",Qf,[...D[2]||(D[2]=[a.createElementVNode("span",{class:"apf-mention-loading-dot"},null,-1),a.createElementVNode("span",{class:"apf-mention-loading-dot"},null,-1),a.createElementVNode("span",{class:"apf-mention-loading-dot"},null,-1)])])):s.value.length>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(s.value,(S,M)=>(a.openBlock(),a.createElementBlock("div",{key:`${S.type}-${S.id}`,class:a.normalizeClass(["apf-mention-result",{"is-highlighted":M===m.value}]),role:"option",onClick:F=>Y(S),onMouseenter:F=>m.value=M},[a.createElementVNode("div",{class:"apf-mention-badge","data-type":S.type},a.toDisplayString(r(S.type)),9,Of),a.createElementVNode("div",Ef,[a.createElementVNode("div",Pf,a.toDisplayString(S.name),1),S.description?(a.openBlock(),a.createElementBlock("div",_f,a.toDisplayString(S.description),1)):a.createCommentVNode("",!0)])],42,Uf))),128)):o.value.trim()?(a.openBlock(),a.createElementBlock("div",qf,a.toDisplayString(C.emptyText),1)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),t.value.length>0?(a.openBlock(),a.createElementBlock("div",$f,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.value,(S,M)=>(a.openBlock(),a.createElementBlock("div",{key:`${S.type}-${S.id}`,class:"apf-mention-chip"},[a.createElementVNode("span",gj,a.toDisplayString(r(S.type)),1),a.createElementVNode("span",null,a.toDisplayString(S.label),1),a.createElementVNode("button",{type:"button",class:"apf-mention-chip-remove","aria-label":"移除引用",onClick:F=>p(M)}," × ",8,Ij)]))),128))])):a.createCommentVNode("",!0),a.withDirectives(a.createElementVNode("textarea",{ref_key:"textareaRef",ref:e,"onUpdate:modelValue":D[1]||(D[1]=S=>l.value=S),class:"apf-mention-textarea",placeholder:C.placeholder,disabled:C.disabled||C.loading,rows:"1",onInput:W,onKeydown:w},null,40,Cj),[[a.vModelText,l.value]])],512))}}),[["__scopeId","data-v-467928f5"]]),ij={class:"apf-editable-artifact"},lj={class:"apf-editable-artifact__head"},ej={class:"apf-editable-artifact__head-left"},tj={class:"apf-editable-artifact__tag"},aj={key:0,class:"apf-editable-artifact__tag is-danger"},cj={class:"apf-editable-artifact__head-right"},dj={class:"apf-editable-artifact__body"},oj=["placeholder"],nj=["srcdoc"],sj={class:"apf-editable-artifact__footer"},Zj={class:"apf-editable-artifact__hint"},mj=E(a.defineComponent({__name:"EditableArtifactCard",props:{content:{},artifactType:{default:"code"},language:{},sendBackLabel:{default:"回传给助手"},hint:{default:"编辑后可回传给助手继续优化"}},emits:["sendback","copy"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(g.content),l=a.ref("edit");a.watch(()=>g.content,Z=>{i.value=Z});const e=a.computed(()=>g.language||g.artifactType),t=a.computed(()=>g.artifactType==="html"),c=a.computed(()=>g.artifactType==="json"),d=a.computed(()=>{if(!c.value)return null;try{return JSON.parse(i.value),!0}catch{return!1}});function o(){var Z;i.value&&((Z=navigator.clipboard)==null||Z.writeText(i.value),A("copy",i.value))}function n(){if(c.value)try{i.value=JSON.stringify(JSON.parse(i.value),null,2)}catch{}}function s(){i.value.trim()&&A("sendback",i.value,e.value)}return(Z,m)=>(a.openBlock(),a.createElementBlock("div",ij,[a.createElementVNode("div",lj,[a.createElementVNode("div",ej,[m[3]||(m[3]=a.createElementVNode("span",{class:"apf-editable-artifact__title"},"工件",-1)),a.createElementVNode("span",tj,a.toDisplayString(C.artifactType),1),c.value&&d.value===!1?(a.openBlock(),a.createElementBlock("span",aj,"JSON 无效")):a.createCommentVNode("",!0)]),a.createElementVNode("div",cj,[t.value?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:a.normalizeClass(["apf-editable-artifact__mode",{"is-active":l.value==="edit"}]),onClick:m[0]||(m[0]=b=>l.value="edit")}," 编辑 ",2)):a.createCommentVNode("",!0),t.value?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(["apf-editable-artifact__mode",{"is-active":l.value==="preview"}]),onClick:m[1]||(m[1]=b=>l.value="preview")}," 预览 ",2)):a.createCommentVNode("",!0),c.value?(a.openBlock(),a.createElementBlock("button",{key:2,type:"button",class:"apf-editable-artifact__tool",onClick:n}," 格式化 ")):a.createCommentVNode("",!0),a.createElementVNode("button",{type:"button",class:"apf-editable-artifact__tool","aria-label":"复制",onClick:o}," 复制 ")])]),a.createElementVNode("div",dj,[l.value==="edit"?a.withDirectives((a.openBlock(),a.createElementBlock("textarea",{key:0,"onUpdate:modelValue":m[2]||(m[2]=b=>i.value=b),class:"apf-editable-artifact__editor",placeholder:`可编辑 ${C.artifactType} 内容`,spellcheck:"false"},null,8,oj)),[[a.vModelText,i.value]]):(a.openBlock(),a.createElementBlock("iframe",{key:1,class:"apf-editable-artifact__preview",srcdoc:i.value,sandbox:"allow-scripts",title:"artifact preview"},null,8,nj))]),a.createElementVNode("div",sj,[a.createElementVNode("span",Zj,a.toDisplayString(C.hint),1),a.createElementVNode("button",{type:"button",class:"apf-editable-artifact__send",onClick:s},a.toDisplayString(C.sendBackLabel),1)])]))}}),[["__scopeId","data-v-60860f31"]]),bj=E(a.defineComponent({__name:"MessageActionBar",props:{content:{},feedback:{},visible:{type:Boolean},showCopy:{type:Boolean,default:!0},showRegenerate:{type:Boolean,default:!0},showFeedback:{type:Boolean,default:!0}},emits:["copy","regenerate","feedback"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1),l=a.ref(g.feedback??null);let e=null;a.watch(()=>g.feedback,d=>{l.value=d??null}),a.watch(()=>g.visible,d=>{if(d){e=setTimeout(()=>{i.value=!0},300);return}i.value=!1,e&&(clearTimeout(e),e=null)},{immediate:!0});function t(){var d;g.content&&((d=navigator.clipboard)==null||d.writeText(g.content)),A("copy")}function c(d){l.value=l.value===d?null:d,A("feedback",d)}return(d,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-msg-actions",{"is-visible":i.value}])},[C.showCopy?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-msg-actions__btn",title:"复制","aria-label":"复制",onClick:t},[...o[3]||(o[3]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),a.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])])):a.createCommentVNode("",!0),C.showRegenerate?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:"apf-msg-actions__btn",title:"重新生成","aria-label":"重新生成",onClick:o[0]||(o[0]=n=>A("regenerate"))},[...o[4]||(o[4]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("path",{d:"M3 8a5 5 0 0 1 8.5-3.5M13 3v3.5H9.5",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M13 8a5 5 0 0 1-8.5 3.5M3 13v-3.5H6.5",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):a.createCommentVNode("",!0),C.showFeedback?(a.openBlock(),a.createElementBlock("button",{key:2,type:"button",class:a.normalizeClass(["apf-msg-actions__btn",{"is-active":l.value==="positive"}]),title:"点赞","aria-label":"点赞",onClick:o[1]||(o[1]=n=>c("positive"))},[...o[5]||(o[5]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("path",{d:"M8 2.5 9.6 6l3.9.3-3 2.7.9 3.8L8 10.8 4.6 12.8l.9-3.8-3-2.7L6.4 6 8 2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})],-1)])],2)):a.createCommentVNode("",!0),C.showFeedback?(a.openBlock(),a.createElementBlock("button",{key:3,type:"button",class:a.normalizeClass(["apf-msg-actions__btn apf-msg-actions__btn--down",{"is-active":l.value==="negative"}]),title:"点踩","aria-label":"点踩",onClick:o[2]||(o[2]=n=>c("negative"))},[...o[6]||(o[6]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("path",{d:"M8 2.5 9.6 6l3.9.3-3 2.7.9 3.8L8 10.8 4.6 12.8l.9-3.8-3-2.7L6.4 6 8 2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})],-1)])],2)):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-e20bc750"]]),Gj={class:"apf-step-card__head-left"},rj={class:"apf-step-card__icon","aria-hidden":"true"},hj={key:0,viewBox:"0 0 16 16",width:"14",height:"14"},uj={key:1,viewBox:"0 0 16 16",width:"14",height:"14"},Bj={class:"apf-step-card__titles"},Wj={class:"apf-step-card__title"},wj={key:0,class:"apf-step-card__badge"},Yj={key:0,class:"apf-step-card__subtitle"},Vj={class:"apf-step-card__head-right"},pj={key:0,class:"apf-step-card__time"},yj={key:1,class:"apf-step-card__status"},Nj={class:"apf-step-card__chevron","aria-hidden":"true"},Xj={class:"apf-step-card__body"},Rj=E(a.defineComponent({__name:"CollapsibleStepCard",props:{title:{},subtitle:{},badge:{},statusLabel:{},tone:{default:"default"},timestamp:{},defaultCollapsed:{type:Boolean,default:!0},collapsed:{type:Boolean}},emits:["update:collapsed"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(g.collapsed??g.defaultCollapsed);a.watch(()=>g.collapsed,t=>{t!==void 0&&(i.value=t)});const l=()=>g.collapsed!==void 0?g.collapsed:i.value;function e(){const t=!l();g.collapsed===void 0&&(i.value=t),A("update:collapsed",t)}return(t,c)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-step-card",`is-${C.tone}`])},[a.createElementVNode("button",{type:"button",class:"apf-step-card__head",onClick:e},[a.createElementVNode("div",Gj,[a.createElementVNode("span",rj,[a.renderSlot(t.$slots,"icon",{},()=>[C.tone==="error"?(a.openBlock(),a.createElementBlock("svg",hj,[...c[0]||(c[0]=[a.createElementVNode("circle",{cx:"8",cy:"8",r:"5.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"},null,-1),a.createElementVNode("path",{d:"M8 5v3.5M8 11h.01",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"},null,-1)])])):(a.openBlock(),a.createElementBlock("svg",uj,[...c[1]||(c[1]=[a.createElementVNode("rect",{x:"3",y:"3",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.4"},null,-1),a.createElementVNode("path",{d:"M6 8h4M8 6v4",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"},null,-1)])]))],!0)]),a.createElementVNode("div",Bj,[a.createElementVNode("div",Wj,[a.createTextVNode(a.toDisplayString(C.title)+" ",1),C.badge?(a.openBlock(),a.createElementBlock("span",wj,a.toDisplayString(C.badge),1)):a.createCommentVNode("",!0)]),C.subtitle?(a.openBlock(),a.createElementBlock("div",Yj,a.toDisplayString(C.subtitle),1)):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Vj,[C.timestamp?(a.openBlock(),a.createElementBlock("span",pj,a.toDisplayString(C.timestamp),1)):a.createCommentVNode("",!0),C.statusLabel?(a.openBlock(),a.createElementBlock("span",yj,[c[2]||(c[2]=a.createElementVNode("i",{class:"apf-step-card__dot"},null,-1)),a.createTextVNode(" "+a.toDisplayString(C.statusLabel),1)])):a.createCommentVNode("",!0),a.createElementVNode("span",Nj,a.toDisplayString(l()?"▾":"▴"),1)])]),a.withDirectives(a.createElementVNode("div",Xj,[a.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[a.vShow,!l()]])],2))}}),[["__scopeId","data-v-9cc9ff88"]]),Hj={class:"apf-agent-transfer"},Sj={class:"apf-agent-transfer__row"},Mj={class:"apf-agent-transfer__pill"},Dj={class:"apf-agent-transfer__pill is-target"},Kj={key:0,class:"apf-agent-transfer__reason"},Fj=E(a.defineComponent({__name:"AgentTransferCard",props:{fromLabel:{},toLabel:{},reason:{}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("div",Hj,[a.createElementVNode("div",Sj,[a.createElementVNode("span",Mj,a.toDisplayString(C.fromLabel),1),g[0]||(g[0]=a.createElementVNode("span",{class:"apf-agent-transfer__arrow","aria-hidden":"true"},"→",-1)),a.createElementVNode("span",Dj,a.toDisplayString(C.toLabel),1)]),C.reason?(a.openBlock(),a.createElementBlock("p",Kj,a.toDisplayString(C.reason),1)):a.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ec98ad49"]]),zj={class:"apf-field-list-card__head"},Jj={class:"apf-field-list-card__head-left"},vj={class:"apf-field-list-card__title"},kj={class:"apf-field-list-card__badge"},Lj={class:"apf-field-list-card__body"},Tj={class:"apf-field-list-card__info"},xj={class:"apf-field-list-card__name"},fj={class:"apf-field-list-card__type"},jj={key:0,class:"apf-field-list-card__actions"},Qj=E(a.defineComponent({__name:"FieldListCard",props:{title:{},fields:{},badgeLabel:{},primaryAction:{},secondaryAction:{},compact:{type:Boolean,default:!1}},emits:["primary-action","secondary-action"],setup(C,{emit:I}){const g=C,A=I,i=()=>g.badgeLabel||`${g.fields.length} 个字段`;return(l,e)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-field-list-card",{"is-compact":C.compact}])},[a.createElementVNode("div",zj,[a.createElementVNode("div",Jj,[e[2]||(e[2]=a.createElementVNode("span",{class:"apf-field-list-card__icon","aria-hidden":"true"},[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("rect",{x:"2.5",y:"3",width:"11",height:"10",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.3"}),a.createElementVNode("path",{d:"M5 6.5h6M5 9.5h4",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"})])],-1)),a.createElementVNode("span",vj,a.toDisplayString(C.title),1)]),a.createElementVNode("span",kj,a.toDisplayString(i()),1)]),a.createElementVNode("div",Lj,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.fields,(t,c)=>(a.openBlock(),a.createElementBlock("div",{key:c,class:"apf-field-list-card__row"},[a.createElementVNode("div",Tj,[a.createElementVNode("div",xj,a.toDisplayString(t.name),1),a.createElementVNode("div",fj,[a.createTextVNode(a.toDisplayString(t.type),1),t.meta?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(" · "+a.toDisplayString(t.meta),1)],64)):a.createCommentVNode("",!0)])]),a.createElementVNode("span",{class:a.normalizeClass(["apf-field-list-card__flag",{"is-req":t.required}])},a.toDisplayString(t.required?"必填":"可选"),3)]))),128))]),!C.compact&&(C.primaryAction||C.secondaryAction)?(a.openBlock(),a.createElementBlock("div",jj,[C.secondaryAction?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-field-list-card__btn is-ghost",onClick:e[0]||(e[0]=t=>A("secondary-action"))},a.toDisplayString(C.secondaryAction),1)):a.createCommentVNode("",!0),C.primaryAction?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:"apf-field-list-card__btn is-primary",onClick:e[1]||(e[1]=t=>A("primary-action"))},a.toDisplayString(C.primaryAction),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-ee1ab2b6"]]),Uj={class:"apf-flow-strip__head"},Oj={class:"apf-flow-strip__head-left"},Ej={class:"apf-flow-strip__title"},Pj={class:"apf-flow-strip__badge"},_j={class:"apf-flow-strip__body"},qj={key:0,class:"apf-flow-strip__arrow","aria-hidden":"true"},$j=["data-type"],gQ={key:0,class:"apf-flow-strip__actions"},IQ=E(a.defineComponent({__name:"FlowNodeStripCard",props:{title:{},nodes:{},badgeLabel:{},primaryAction:{},secondaryAction:{},compact:{type:Boolean,default:!1}},emits:["primary-action","secondary-action"],setup(C,{emit:I}){const g=C,A=I,i=()=>g.badgeLabel||`${g.nodes.length} 个节点`;return(l,e)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-flow-strip",{"is-compact":C.compact}])},[a.createElementVNode("div",Uj,[a.createElementVNode("div",Oj,[e[2]||(e[2]=a.createStaticVNode('<span class="apf-flow-strip__icon" aria-hidden="true" data-v-1fea171e><svg viewBox="0 0 16 16" width="14" height="14" data-v-1fea171e><circle cx="4" cy="8" r="2" fill="none" stroke="currentColor" stroke-width="1.3" data-v-1fea171e></circle><circle cx="12" cy="8" r="2" fill="none" stroke="currentColor" stroke-width="1.3" data-v-1fea171e></circle><path d="M6 8h4" fill="none" stroke="currentColor" stroke-width="1.3" data-v-1fea171e></path></svg></span>',1)),a.createElementVNode("span",Ej,a.toDisplayString(C.title),1)]),a.createElementVNode("span",Pj,a.toDisplayString(i()),1)]),a.createElementVNode("div",_j,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.nodes,(t,c)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:c},[c>0?(a.openBlock(),a.createElementBlock("div",qj)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"apf-flow-strip__node","data-type":t.type},a.toDisplayString(t.label),9,$j)],64))),128))]),!C.compact&&(C.primaryAction||C.secondaryAction)?(a.openBlock(),a.createElementBlock("div",gQ,[C.secondaryAction?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-flow-strip__btn is-ghost",onClick:e[0]||(e[0]=t=>A("secondary-action"))},a.toDisplayString(C.secondaryAction),1)):a.createCommentVNode("",!0),C.primaryAction?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:"apf-flow-strip__btn is-primary",onClick:e[1]||(e[1]=t=>A("primary-action"))},a.toDisplayString(C.primaryAction),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-1fea171e"]]),CQ={class:"apf-token-usage"},AQ={class:"apf-token-usage__head"},iQ={class:"apf-token-usage__title"},lQ={class:"apf-token-usage__body"},eQ={class:"apf-token-usage__stats"},tQ={class:"apf-token-usage__stat"},aQ={class:"apf-token-usage__value"},cQ={class:"apf-token-usage__stat"},dQ={class:"apf-token-usage__value"},oQ={class:"apf-token-usage__stat is-total"},nQ={class:"apf-token-usage__value"},sQ={key:0,class:"apf-token-usage__footer"},ZQ={key:0,class:"apf-token-usage__model"},mQ={key:1,class:"apf-token-usage__cost"},bQ=E(a.defineComponent({__name:"TokenUsageCard",props:{inputTokens:{},outputTokens:{},totalTokens:{},estimatedCost:{},model:{},title:{}},setup(C){const I=C,g=a.computed(()=>I.totalTokens??I.inputTokens+I.outputTokens),A=a.computed(()=>{const l=g.value;return l>=1e6?`${(l/1e6).toFixed(2)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}),i=a.computed(()=>{const l=I.estimatedCost;return l==null?null:l<.01?"<$0.01":`$${l.toFixed(4)}`});return(l,e)=>(a.openBlock(),a.createElementBlock("div",CQ,[a.createElementVNode("div",AQ,[a.createElementVNode("span",iQ,a.toDisplayString(C.title||"Token 消耗"),1)]),a.createElementVNode("div",lQ,[a.createElementVNode("div",eQ,[a.createElementVNode("div",tQ,[e[0]||(e[0]=a.createElementVNode("span",{class:"apf-token-usage__label"},"输入",-1)),a.createElementVNode("span",aQ,a.toDisplayString(C.inputTokens.toLocaleString()),1)]),a.createElementVNode("div",cQ,[e[1]||(e[1]=a.createElementVNode("span",{class:"apf-token-usage__label"},"输出",-1)),a.createElementVNode("span",dQ,a.toDisplayString(C.outputTokens.toLocaleString()),1)]),a.createElementVNode("div",oQ,[e[2]||(e[2]=a.createElementVNode("span",{class:"apf-token-usage__label"},"总计",-1)),a.createElementVNode("span",nQ,a.toDisplayString(A.value),1)])]),i.value||C.model?(a.openBlock(),a.createElementBlock("div",sQ,[C.model?(a.openBlock(),a.createElementBlock("span",ZQ,a.toDisplayString(C.model),1)):a.createCommentVNode("",!0),i.value?(a.openBlock(),a.createElementBlock("span",mQ,a.toDisplayString(i.value),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-0aacc361"]]),GQ={class:"apf-questionnaire"},rQ={class:"apf-questionnaire__head"},hQ={class:"apf-questionnaire__title"},uQ=["data-status"],BQ={key:0,class:"apf-questionnaire__desc"},WQ={key:1,class:"apf-questionnaire__list"},wQ={class:"apf-questionnaire__q"},YQ={key:0,class:"apf-questionnaire__req"},VQ={key:0,class:"apf-questionnaire__options"},pQ=["name","value","checked","disabled","onChange"],yQ=["value","disabled","onInput"],NQ={key:2,class:"apf-questionnaire__actions"},XQ=["disabled"],RQ=E(a.defineComponent({__name:"QuestionnaireCard",props:{title:{},description:{},questions:{},answers:{default:()=>({})},status:{default:"waiting"},approveLabel:{default:"批准"},rejectLabel:{default:"拒绝"},disabled:{type:Boolean}},emits:["answer","approve","reject"],setup(C,{emit:I}){const g=C,A=I,i=()=>g.status==="approved"?"已批准":g.status==="rejected"?"已拒绝":"待审批",l=()=>g.questions.filter(c=>c.required).every(c=>!!g.answers[c.id]),e=()=>g.status==="waiting"&&!g.disabled;return(t,c)=>(a.openBlock(),a.createElementBlock("div",GQ,[a.createElementVNode("div",rQ,[a.createElementVNode("span",hQ,a.toDisplayString(C.title),1),a.createElementVNode("span",{class:"apf-questionnaire__status","data-status":C.status},a.toDisplayString(i()),9,uQ)]),C.description?(a.openBlock(),a.createElementBlock("p",BQ,a.toDisplayString(C.description),1)):a.createCommentVNode("",!0),C.questions.length?(a.openBlock(),a.createElementBlock("div",WQ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.questions,d=>{var o;return a.openBlock(),a.createElementBlock("div",{key:d.id,class:"apf-questionnaire__item"},[a.createElementVNode("div",wQ,[d.required?(a.openBlock(),a.createElementBlock("span",YQ,"*")):a.createCommentVNode("",!0),a.createTextVNode(" "+a.toDisplayString(d.question),1)]),(o=d.options)!=null&&o.length?(a.openBlock(),a.createElementBlock("div",VQ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.options,n=>(a.openBlock(),a.createElementBlock("label",{key:n,class:"apf-questionnaire__opt"},[a.createElementVNode("input",{type:"radio",name:d.id,value:n,checked:C.answers[d.id]===n,disabled:!e(),onChange:s=>A("answer",d.id,n)},null,40,pQ),a.createTextVNode(" "+a.toDisplayString(n),1)]))),128))])):(a.openBlock(),a.createElementBlock("input",{key:1,class:"apf-questionnaire__input",type:"text",value:C.answers[d.id]||"",placeholder:"请输入...",disabled:!e(),onInput:n=>A("answer",d.id,n.target.value)},null,40,yQ))])}),128))])):a.createCommentVNode("",!0),e()?(a.openBlock(),a.createElementBlock("div",NQ,[a.createElementVNode("button",{type:"button",class:"apf-questionnaire__btn is-ghost",onClick:c[0]||(c[0]=d=>A("reject"))},a.toDisplayString(C.rejectLabel),1),a.createElementVNode("button",{type:"button",class:"apf-questionnaire__btn is-primary",disabled:!l(),onClick:c[1]||(c[1]=d=>A("approve"))},a.toDisplayString(C.approveLabel),9,XQ)])):a.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-0e4beff5"]]),HQ=["onClick"],SQ=["onClick"],MQ={key:0},DQ={key:1},KQ=E(a.defineComponent({__name:"ChecklistProposalCard",props:{proposal:{},status:{},selectedIds:{},readonly:{type:Boolean}},emits:["toggle-item","toggle-all","approve","reject","modify","reset"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(new Set(g.proposal.actionItems.map(B=>B.id))),l=a.computed(()=>g.selectedIds??i.value),e=a.computed(()=>l.value.size),t=a.computed(()=>e.value===g.proposal.actionItems.length&&g.proposal.actionItems.length>0),c={high:{label:"高",color:"#F56C6C",bgColor:"#fef0f0"},medium:{label:"中",color:"#E6A23C",bgColor:"#fdf6ec"},low:{label:"低",color:"#67C23A",bgColor:"#f0f9eb"}},d={todo:{icon:"document",label:"待办"},approval:{icon:"stamp",label:"审批"},review:{icon:"view",label:"审阅"},decision:{icon:"warning",label:"决策"}},o=a.ref(null),n=a.ref({});function s(B){g.readonly||g.status==="approved"||g.status==="rejected"||(g.selectedIds?A("toggle-item",B):i.value.has(B)?i.value.delete(B):i.value.add(B))}function Z(){g.readonly||g.status==="approved"||g.status==="rejected"||(g.selectedIds?A("toggle-all"):t.value?i.value.clear():g.proposal.actionItems.forEach(B=>i.value.add(B.id)))}function m(B){o.value=B.id,n.value={...B}}function b(){o.value&&n.value&&(A("modify",o.value,n.value),o.value=null,n.value={})}function G(){o.value=null,n.value={}}function r(){A("approve",Array.from(l.value))}function h(){A("reject")}function u(){A("reset")}return(B,W)=>{var w;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([B.$style.card,C.status==="approved"&&B.$style.cardApproved,C.status==="rejected"&&B.$style.cardRejected])},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.titleRow)},[a.createVNode(a.unref($),{name:"circle-check-filled",size:16,style:{color:"#409EFF"}}),a.createElementVNode("span",{class:a.normalizeClass(B.$style.title)},"智能拟办",2),C.proposal.documentTitle?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(B.$style.docTitle)},a.toDisplayString(C.proposal.documentTitle),3)):a.createCommentVNode("",!0)],2),!C.status||C.status==="pending"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(B.$style.countBadge)},a.toDisplayString(e.value)+"/"+a.toDisplayString(C.proposal.actionItems.length)+" 项 ",3)):C.status==="approved"?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([B.$style.statusBadge,B.$style.statusApproved])},[a.createVNode(a.unref($),{name:"check",size:12}),W[7]||(W[7]=a.createTextVNode(" 已批准 ",-1))],2)):C.status==="rejected"?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([B.$style.statusBadge,B.$style.statusRejected])},[a.createVNode(a.unref($),{name:"close",size:12}),W[8]||(W[8]=a.createTextVNode(" 已拒绝 ",-1))],2)):a.createCommentVNode("",!0)],2),C.proposal.summary?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(B.$style.summary)},a.toDisplayString(C.proposal.summary),3)):a.createCommentVNode("",!0),(!C.status||C.status==="pending")&&!C.readonly?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(B.$style.selectAllRow)},[a.createElementVNode("label",{class:a.normalizeClass(B.$style.checkbox),onClick:Z},[a.createElementVNode("span",{class:a.normalizeClass([B.$style.checkboxInner,t.value&&B.$style.checked])},[t.value?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:"check",size:10})):a.createCommentVNode("",!0)],2),W[9]||(W[9]=a.createElementVNode("span",null,"全选",-1))],2)],2)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.proposal.actionItems,Y=>{var p,V,y,N,H;return a.openBlock(),a.createElementBlock("div",{key:Y.id,class:a.normalizeClass([B.$style.item,l.value.has(Y.id)&&B.$style.itemSelected,o.value===Y.id&&B.$style.itemEditing])},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemHeader),onClick:R=>s(Y.id)},[a.createElementVNode("label",{class:a.normalizeClass(B.$style.checkbox),onClick:W[0]||(W[0]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("span",{class:a.normalizeClass([B.$style.checkboxInner,l.value.has(Y.id)&&B.$style.checked])},[l.value.has(Y.id)?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:"check",size:10})):a.createCommentVNode("",!0)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemBadges)},[Y.priority?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(B.$style.priorityBadge),style:a.normalizeStyle({color:(p=c[Y.priority])==null?void 0:p.color,background:(V=c[Y.priority])==null?void 0:V.bgColor})},a.toDisplayString(((y=c[Y.priority])==null?void 0:y.label)??Y.priority),7)):a.createCommentVNode("",!0),Y.type?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(B.$style.typeBadge)},[a.createVNode(a.unref($),{name:((N=d[Y.type])==null?void 0:N.icon)??"document",size:12},null,8,["name"]),a.createTextVNode(" "+a.toDisplayString(((H=d[Y.type])==null?void 0:H.label)??Y.type),1)],2)):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemTitle)},a.toDisplayString(Y.title),3),!C.readonly&&(!C.status||C.status==="pending")?(a.openBlock(),a.createElementBlock("button",{key:0,class:a.normalizeClass(B.$style.editBtn),onClick:a.withModifiers(R=>m(Y),["stop"])},[a.createVNode(a.unref($),{name:"edit",size:12})],10,SQ)):a.createCommentVNode("",!0)],10,HQ),o.value===Y.id?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(B.$style.editForm)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[10]||(W[10]=a.createElementVNode("label",null,"标题",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":W[1]||(W[1]=R=>n.value.title=R),class:a.normalizeClass(B.$style.editInput)},null,2),[[a.vModelText,n.value.title]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[11]||(W[11]=a.createElementVNode("label",null,"描述",-1)),a.withDirectives(a.createElementVNode("textarea",{"onUpdate:modelValue":W[2]||(W[2]=R=>n.value.description=R),class:a.normalizeClass(B.$style.editTextarea),rows:"2"},null,2),[[a.vModelText,n.value.description]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRowInline)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[12]||(W[12]=a.createElementVNode("label",null,"负责人",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":W[3]||(W[3]=R=>n.value.assignee=R),class:a.normalizeClass(B.$style.editInput),placeholder:"可选"},null,2),[[a.vModelText,n.value.assignee]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[13]||(W[13]=a.createElementVNode("label",null,"截止日期",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":W[4]||(W[4]=R=>n.value.deadline=R),class:a.normalizeClass(B.$style.editInput),placeholder:"可选"},null,2),[[a.vModelText,n.value.deadline]])],2)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRowInline)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[15]||(W[15]=a.createElementVNode("label",null,"优先级",-1)),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":W[5]||(W[5]=R=>n.value.priority=R),class:a.normalizeClass(B.$style.editSelect)},[...W[14]||(W[14]=[a.createElementVNode("option",{value:"high"},"高",-1),a.createElementVNode("option",{value:"medium"},"中",-1),a.createElementVNode("option",{value:"low"},"低",-1)])],2),[[a.vModelSelect,n.value.priority]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[17]||(W[17]=a.createElementVNode("label",null,"类型",-1)),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":W[6]||(W[6]=R=>n.value.type=R),class:a.normalizeClass(B.$style.editSelect)},[...W[16]||(W[16]=[a.createElementVNode("option",{value:"todo"},"待办",-1),a.createElementVNode("option",{value:"approval"},"审批",-1),a.createElementVNode("option",{value:"review"},"审阅",-1),a.createElementVNode("option",{value:"decision"},"决策",-1)])],2),[[a.vModelSelect,n.value.type]])],2)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editActions)},[a.createElementVNode("button",{class:a.normalizeClass(B.$style.saveBtn),onClick:b},"保存",2),a.createElementVNode("button",{class:a.normalizeClass(B.$style.cancelBtn),onClick:G},"取消",2)],2)],2)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(B.$style.itemBody)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemDesc)},a.toDisplayString(Y.description),3),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemMeta)},[Y.assignee?(a.openBlock(),a.createElementBlock("span",MQ,[a.createVNode(a.unref($),{name:"user",size:12}),a.createTextVNode(" "+a.toDisplayString(Y.assignee),1)])):a.createCommentVNode("",!0),Y.deadline?(a.openBlock(),a.createElementBlock("span",DQ,[a.createVNode(a.unref($),{name:"clock",size:12}),a.createTextVNode(" "+a.toDisplayString(Y.deadline),1)])):a.createCommentVNode("",!0)],2)],2))],2)}),128))],2),(w=C.proposal.approvalChain)!=null&&w.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(B.$style.chain)},[a.createElementVNode("span",{class:a.normalizeClass(B.$style.chainLabel)},"审批链:",2),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.proposal.approvalChain,(Y,p)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:p},[a.createElementVNode("span",{class:a.normalizeClass(B.$style.chainPerson)},a.toDisplayString(Y),3),p<C.proposal.approvalChain.length-1?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(B.$style.chainArrow)},"→",2)):a.createCommentVNode("",!0)],64))),128))],2)):a.createCommentVNode("",!0),C.readonly?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(B.$style.actions)},[!C.status||C.status==="pending"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("button",{class:a.normalizeClass(B.$style.approveBtn),onClick:r},[a.createVNode(a.unref($),{name:"check",size:14}),a.createTextVNode(" 确认执行 ("+a.toDisplayString(e.value)+" 项) ",1)],2),a.createElementVNode("button",{class:a.normalizeClass(B.$style.rejectBtn),onClick:h},[a.createVNode(a.unref($),{name:"close",size:14}),W[18]||(W[18]=a.createTextVNode(" 暂不执行 ",-1))],2)],64)):(a.openBlock(),a.createElementBlock("button",{key:1,class:a.normalizeClass(B.$style.resetBtn),onClick:u},[a.createVNode(a.unref($),{name:"refresh",size:14}),W[19]||(W[19]=a.createTextVNode(" 重新审核 ",-1))],2))],2))],2)}}}),[["__cssModules",{$style:{card:"_card_yghuq_2",cardApproved:"_cardApproved_yghuq_9",cardRejected:"_cardRejected_yghuq_14",header:"_header_yghuq_20",titleRow:"_titleRow_yghuq_27",title:"_title_yghuq_27",docTitle:"_docTitle_yghuq_39",countBadge:"_countBadge_yghuq_47",statusBadge:"_statusBadge_yghuq_53",statusApproved:"_statusApproved_yghuq_63",statusRejected:"_statusRejected_yghuq_68",summary:"_summary_yghuq_74",selectAllRow:"_selectAllRow_yghuq_85",checkbox:"_checkbox_yghuq_89",checkboxInner:"_checkboxInner_yghuq_99",checked:"_checked_yghuq_110",itemList:"_itemList_yghuq_117",item:"_item_yghuq_117",itemSelected:"_itemSelected_yghuq_136",itemEditing:"_itemEditing_yghuq_141",itemHeader:"_itemHeader_yghuq_145",itemBadges:"_itemBadges_yghuq_151",priorityBadge:"_priorityBadge_yghuq_156",typeBadge:"_typeBadge_yghuq_163",itemTitle:"_itemTitle_yghuq_171",editBtn:"_editBtn_yghuq_178",itemBody:"_itemBody_yghuq_194",itemDesc:"_itemDesc_yghuq_199",itemMeta:"_itemMeta_yghuq_206",editForm:"_editForm_yghuq_220",editRow:"_editRow_yghuq_225",editInput:"_editInput_yghuq_236",editTextarea:"_editTextarea_yghuq_237",editSelect:"_editSelect_yghuq_238",editRowInline:"_editRowInline_yghuq_260",editActions:"_editActions_yghuq_270",saveBtn:"_saveBtn_yghuq_276",cancelBtn:"_cancelBtn_yghuq_277",chain:"_chain_yghuq_309",chainLabel:"_chainLabel_yghuq_321",chainPerson:"_chainPerson_yghuq_325",chainArrow:"_chainArrow_yghuq_331",actions:"_actions_yghuq_337",approveBtn:"_approveBtn_yghuq_344",rejectBtn:"_rejectBtn_yghuq_345",resetBtn:"_resetBtn_yghuq_346"}}]]),FQ=["onClick"],zQ=E(a.defineComponent({__name:"RequirementAnalysisCard",props:{analysis:{},partialAnswers:{default:()=>({})},nextQuestionId:{default:null},waitingConfirmation:{type:Boolean,default:!0}},emits:["answer","skip"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>({...g.partialAnswers})),l=a.computed(()=>({simple:"简单",medium:"中等",complex:"复杂"})[g.analysis.complexity]||g.analysis.complexity),e=a.computed(()=>{const s=g.analysis.completeness.score;return s>=80?"success":s>=60?"warning":"danger"}),t=a.computed(()=>g.analysis.confirmQuestions.filter(s=>s.required).every(s=>{var Z;return(Z=i.value[s.id])==null?void 0:Z.trim()}));function c(){A("skip")}function d(s,Z){g.waitingConfirmation&&A("answer",s,Z)}function o(s){var Z;return!!((Z=i.value[s])!=null&&Z.trim())}function n(s){return g.waitingConfirmation&&g.nextQuestionId===s}return(s,Z)=>{const m=a.resolveComponent("el-tag"),b=a.resolveComponent("el-progress");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(s.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.summary)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryHeader)},[a.createVNode(a.unref($),{name:"data-board",size:16}),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryTitle)},"需求分析结果",2)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryGrid)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"意图",2),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryValue)},a.toDisplayString(C.analysis.intent),3)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"类型",2),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryValue)},a.toDisplayString(C.analysis.type),3)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"复杂度",2),a.createVNode(m,{type:C.analysis.complexity==="complex"?"danger":C.analysis.complexity==="medium"?"warning":"success",size:"small"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.value),1)]),_:1},8,["type"])],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"完整性",2),a.createVNode(b,{percentage:C.analysis.completeness.score,color:e.value==="success"?"#67c23a":e.value==="warning"?"#e6a23c":"#f56c6c","stroke-width":8,"show-text":!1,style:{width:"80px"}},null,8,["percentage","color"]),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryValue)},a.toDisplayString(C.analysis.completeness.score)+"%",3)],2)],2),C.analysis.completeness.missing.length>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.missingSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.missingTitle)},[a.createVNode(a.unref($),{name:"warning",size:14}),Z[0]||(Z[0]=a.createElementVNode("span",null,"缺失信息",-1))],2),a.createElementVNode("ul",{class:a.normalizeClass(s.$style.missingList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.completeness.missing,(G,r)=>(a.openBlock(),a.createElementBlock("li",{key:r},a.toDisplayString(G),1))),128))],2)],2)):a.createCommentVNode("",!0),C.analysis.completeness.assumptions.length>0?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.assumptionsSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.assumptionsTitle)},[a.createVNode(a.unref($),{name:"info-filled",size:14}),Z[1]||(Z[1]=a.createElementVNode("span",null,"AI 假设",-1))],2),a.createElementVNode("ul",{class:a.normalizeClass(s.$style.assumptionsList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.completeness.assumptions,(G,r)=>(a.openBlock(),a.createElementBlock("li",{key:r},a.toDisplayString(G),1))),128))],2)],2)):a.createCommentVNode("",!0)],2),C.analysis.suggestedChain.length>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.chainSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainTitle)},[a.createVNode(a.unref($),{name:"list",size:14}),Z[2]||(Z[2]=a.createElementVNode("span",null,"执行计划",-1))],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.suggestedChain,(G,r)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:a.normalizeClass(s.$style.chainItem)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainStep)},a.toDisplayString(r+1),3),a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainContent)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainAgent)},a.toDisplayString(G.agent),3),a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainDesc)},a.toDisplayString(G.description),3)],2)],2))),128))],2)],2)):a.createCommentVNode("",!0),C.analysis.confirmQuestions.length>0?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.questionsSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.questionsTitle)},[a.createVNode(a.unref($),{name:"question-filled",size:14}),Z[3]||(Z[3]=a.createElementVNode("span",null,"请确认以下信息",-1)),C.waitingConfirmation&&!t.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(s.$style.progressHint)}," 在下方输入框逐条回复,答完必填项后自动继续 ",2)):C.waitingConfirmation&&t.value?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(s.$style.progressHint)}," 必填项已完成,发送任意内容或直接点选以继续 ",2)):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.questionsList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.confirmQuestions,G=>(a.openBlock(),a.createElementBlock("div",{key:G.id,class:a.normalizeClass([s.$style.questionItem,n(G.id)&&s.$style.questionItemActive,o(G.id)&&s.$style.questionItemDone])},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.questionText)},[o(G.id)?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:"circle-check",size:14,class:a.normalizeClass(s.$style.answeredIcon)},null,8,["class"])):a.createCommentVNode("",!0),a.createTextVNode(" "+a.toDisplayString(G.question)+" ",1),G.required?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(s.$style.required)},"*",2)):a.createCommentVNode("",!0)],2),o(G.id)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.answeredValue)},a.toDisplayString(i.value[G.id]),3)):G.options&&G.options.length>0?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.optionsList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(G.options,(r,h)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:a.normalizeClass([s.$style.optionItem,{[s.$style.optionDisabled]:!C.waitingConfirmation}]),onClick:u=>C.waitingConfirmation&&d(G.id,r)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.optionIndex)},a.toDisplayString(h+1),3),a.createElementVNode("span",{class:a.normalizeClass(s.$style.optionText)},a.toDisplayString(r),3)],10,FQ))),128))],2)):n(G.id)?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(s.$style.inputHint)}," 请在下方输入框回复 ",2)):a.createCommentVNode("",!0)],2))),128))],2)],2)):a.createCommentVNode("",!0),C.waitingConfirmation?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(s.$style.actions)},[a.createElementVNode("button",{type:"button",class:a.normalizeClass(s.$style.skipLink),onClick:c}," 跳过,直接执行 ",2)],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{card:"_card_8r8st_2",summary:"_summary_8r8st_10",summaryHeader:"_summaryHeader_8r8st_15",summaryTitle:"_summaryTitle_8r8st_24",summaryGrid:"_summaryGrid_8r8st_28",summaryItem:"_summaryItem_8r8st_34",summaryLabel:"_summaryLabel_8r8st_40",summaryValue:"_summaryValue_8r8st_46",missingSection:"_missingSection_8r8st_52",missingTitle:"_missingTitle_8r8st_59",missingList:"_missingList_8r8st_69",assumptionsSection:"_assumptionsSection_8r8st_81",assumptionsTitle:"_assumptionsTitle_8r8st_88",assumptionsList:"_assumptionsList_8r8st_98",chainSection:"_chainSection_8r8st_110",chainTitle:"_chainTitle_8r8st_115",chainList:"_chainList_8r8st_125",chainItem:"_chainItem_8r8st_131",chainStep:"_chainStep_8r8st_137",chainContent:"_chainContent_8r8st_151",chainAgent:"_chainAgent_8r8st_155",chainDesc:"_chainDesc_8r8st_161",questionsSection:"_questionsSection_8r8st_167",questionsTitle:"_questionsTitle_8r8st_171",progressHint:"_progressHint_8r8st_182",questionItemActive:"_questionItemActive_8r8st_188",questionItemDone:"_questionItemDone_8r8st_195",answeredIcon:"_answeredIcon_8r8st_199",answeredValue:"_answeredValue_8r8st_204",inputHint:"_inputHint_8r8st_210",optionDisabled:"_optionDisabled_8r8st_216",questionsList:"_questionsList_8r8st_221",questionItem:"_questionItem_8r8st_188",questionText:"_questionText_8r8st_233",required:"_required_8r8st_238",optionsList:"_optionsList_8r8st_243",optionItem:"_optionItem_8r8st_249",optionSelected:"_optionSelected_8r8st_265",optionIndex:"_optionIndex_8r8st_270",optionText:"_optionText_8r8st_289",actions:"_actions_8r8st_295",skipLink:"_skipLink_8r8st_303"}}]]),Ii={card:"_card_6xf4y_1",header:"_header_6xf4y_9",title:"_title_6xf4y_16",filename:"_filename_6xf4y_22",summary:"_summary_6xf4y_27",points:"_points_6xf4y_34",section:"_section_6xf4y_44",sectionTitle:"_sectionTitle_6xf4y_48",sectionContent:"_sectionContent_6xf4y_55"},JQ=a.defineComponent({__name:"DocumentDetailSummaryCard",props:{item:{}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(Ii).card)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).header)},[a.createVNode(a.unref($),{name:"document",size:16}),a.createElementVNode("div",null,[a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).title)},a.toDisplayString(C.item.summary.title),3),a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).filename)},a.toDisplayString(C.item.filename),3)])],2),a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).summary)},a.toDisplayString(C.item.summary.summary),3),C.item.summary.keyPoints.length?(a.openBlock(),a.createElementBlock("ul",{key:0,class:a.normalizeClass(a.unref(Ii).points)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.item.summary.keyPoints,(A,i)=>(a.openBlock(),a.createElementBlock("li",{key:i},a.toDisplayString(A),1))),128))],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.item.summary.sections,(A,i)=>(a.openBlock(),a.createElementBlock("div",{key:i,class:a.normalizeClass(a.unref(Ii).section)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).sectionTitle)},a.toDisplayString(A.heading),3),a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).sectionContent)},a.toDisplayString(A.content),3)],2))),128))],2))}}),vQ=["disabled","onClick"],kQ=E(a.defineComponent({__name:"ErrorRecoveryCard",props:{error:{},nodeName:{},nodeType:{},strategies:{}},emits:["select"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-tag");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(A.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.header)},[a.createVNode(a.unref($),{name:"warning-filled",size:14,class:a.normalizeClass(A.$style.headerIcon)},null,8,["class"]),a.createElementVNode("span",{class:a.normalizeClass(A.$style.title)},"执行错误",2)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.body)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.errorInfo)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.nodeInfo)},[a.createElementVNode("span",{class:a.normalizeClass(A.$style.nodeLabel)},"节点:",2),a.createElementVNode("span",{class:a.normalizeClass(A.$style.nodeName)},a.toDisplayString(C.nodeName),3),C.nodeType?(a.openBlock(),a.createBlock(l,{key:0,size:"small",type:"info"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(C.nodeType),1)]),_:1})):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.errorMessage)},[a.createVNode(a.unref($),{name:"circle-close-filled",size:14}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategies)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategyLabel)},"选择恢复策略:",2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategyList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.strategies,e=>(a.openBlock(),a.createElementBlock("button",{key:e.value,class:a.normalizeClass([A.$style.strategyBtn,e.disabled&&A.$style.strategyDisabled]),disabled:e.disabled,onClick:t=>g("select",e.value)},[a.createVNode(a.unref($),{name:e.icon,size:16},null,8,["name"]),a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategyInfo)},[a.createElementVNode("span",{class:a.normalizeClass(A.$style.strategyName)},a.toDisplayString(e.label),3),a.createElementVNode("span",{class:a.normalizeClass(A.$style.strategyDesc)},a.toDisplayString(e.description),3)],2)],10,vQ))),128))],2)],2)],2)],2)}}}),[["__cssModules",{$style:{card:"_card_170h5_2",header:"_header_170h5_8",headerIcon:"_headerIcon_170h5_17",title:"_title_170h5_21",body:"_body_170h5_27",errorInfo:"_errorInfo_170h5_31",nodeInfo:"_nodeInfo_170h5_35",nodeLabel:"_nodeLabel_170h5_42",nodeName:"_nodeName_170h5_47",errorMessage:"_errorMessage_170h5_53",strategies:"_strategies_170h5_65",strategyLabel:"_strategyLabel_170h5_70",strategyList:"_strategyList_170h5_76",strategyBtn:"_strategyBtn_170h5_82",strategyDisabled:"_strategyDisabled_170h5_104",strategyInfo:"_strategyInfo_170h5_108",strategyName:"_strategyName_170h5_114",strategyDesc:"_strategyDesc_170h5_120"}}]]),LQ=E(a.defineComponent({__name:"VariableDiffCard",props:{nodeName:{},changes:{}},setup(C){const I=C,g=a.computed(()=>I.changes.length>0);function A(l){return l==null?"null":typeof l=="string"?l:JSON.stringify(l,null,2)}function i(l){switch(l.type){case"add":return{icon:"plus",color:"var(--el-color-success, #67c23a)",label:"新增"};case"update":return{icon:"edit",color:"var(--el-color-primary, #409eff)",label:"更新"};case"delete":return{icon:"delete",color:"var(--el-color-danger, #f56c6c)",label:"删除"};default:return{icon:"info-filled",color:"var(--el-color-info, #909399)",label:"变更"}}}return(l,e)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(l.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerLeft)},[a.createVNode(a.unref($),{name:"data-line",size:14,class:a.normalizeClass(l.$style.headerIcon)},null,8,["class"]),a.createElementVNode("span",{class:a.normalizeClass(l.$style.title)},"变量变更",2)],2),C.nodeName?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(l.$style.nodeInfo)},a.toDisplayString(C.nodeName),3)):a.createCommentVNode("",!0)],2),g.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(l.$style.body)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.changes,(t,c)=>(a.openBlock(),a.createElementBlock("div",{key:c,class:a.normalizeClass(l.$style.change)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.changeHeader)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.changeType)},[a.createVNode(a.unref($),{name:i(t).icon,size:12,style:a.normalizeStyle({color:i(t).color})},null,8,["name","style"]),a.createElementVNode("span",{style:a.normalizeStyle({color:i(t).color})},a.toDisplayString(i(t).label),5)],2),a.createElementVNode("span",{class:a.normalizeClass(l.$style.varName)},a.toDisplayString(t.name),3)],2),t.type==="update"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(l.$style.diff)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.diffOld)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.diffLabel)},"旧值",2),a.createElementVNode("pre",{class:a.normalizeClass(l.$style.diffValue)},a.toDisplayString(A(t.oldValue)),3)],2),a.createElementVNode("div",{class:a.normalizeClass(l.$style.diffNew)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.diffLabel)},"新值",2),a.createElementVNode("pre",{class:a.normalizeClass(l.$style.diffValue)},a.toDisplayString(A(t.newValue)),3)],2)],2)):t.type==="add"?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(l.$style.singleValue)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.diffLabel)},"值",2),a.createElementVNode("pre",{class:a.normalizeClass(l.$style.diffValue)},a.toDisplayString(A(t.newValue)),3)],2)):a.createCommentVNode("",!0)],2))),128))],2)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(l.$style.empty)}," 暂无变量变更 ",2))],2))}}),[["__cssModules",{$style:{card:"_card_1byhf_2",header:"_header_1byhf_8",headerLeft:"_headerLeft_1byhf_17",headerIcon:"_headerIcon_1byhf_23",title:"_title_1byhf_27",nodeInfo:"_nodeInfo_1byhf_33",body:"_body_1byhf_38",change:"_change_1byhf_45",changeHeader:"_changeHeader_1byhf_51",changeType:"_changeType_1byhf_59",varName:"_varName_1byhf_67",diff:"_diff_1byhf_73",diffOld:"_diffOld_1byhf_78",diffNew:"_diffNew_1byhf_84",singleValue:"_singleValue_1byhf_89",diffLabel:"_diffLabel_1byhf_93",diffValue:"_diffValue_1byhf_100",empty:"_empty_1byhf_108"}}]]),TQ=E(a.defineComponent({__name:"SubWorkflowStatusCard",props:{workflowName:{},status:{},durationMs:{},error:{},nodeCount:{},completedNodes:{}},emits:["detail","retry"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1),l=a.computed(()=>{switch(g.status){case"running":return"loading";case"success":return"circle-check";case"error":return"circle-close-filled";case"waiting":return"clock";case"cancelled":return"minus";default:return"more-filled"}}),e=a.computed(()=>{switch(g.status){case"running":return"执行中";case"success":return"成功";case"error":return"失败";case"waiting":return"待确认";case"cancelled":return"已取消";default:return"等待"}}),t=a.computed(()=>{switch(g.status){case"running":return"primary";case"success":return"success";case"error":return"danger";case"waiting":return"warning";default:return"info"}}),c=a.computed(()=>{const s=g.durationMs;return s==null?"":s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`}),d=a.computed(()=>g.nodeCount??0),o=a.computed(()=>g.completedNodes??0),n=a.computed(()=>d.value===0?0:Math.round(o.value/d.value*100));return(s,Z)=>{const m=a.resolveComponent("el-tag"),b=a.resolveComponent("el-progress"),G=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(s.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.header),onClick:Z[0]||(Z[0]=r=>i.value=!i.value)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.iconWrap)},[a.createVNode(a.unref($),{name:l.value,size:16,class:a.normalizeClass(C.status==="running"&&s.$style.iconSpin)},null,8,["name","class"])],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.info)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.name)},"子工作流:"+a.toDisplayString(C.workflowName),3),a.createElementVNode("span",{class:a.normalizeClass(s.$style.meta)},[a.createVNode(m,{size:"small",type:t.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.value),1)]),_:1},8,["type"]),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(s.$style.duration)},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)],2),a.createVNode(a.unref($),{name:i.value?"arrow-up":"arrow-down",size:14,class:a.normalizeClass(s.$style.expandIcon)},null,8,["name","class"])],2),i.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.detail)},[d.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.progress)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.progressLabel)}," 节点进度:"+a.toDisplayString(o.value)+" / "+a.toDisplayString(d.value),3),a.createVNode(b,{percentage:n.value,status:C.status==="error"?"exception":void 0,"stroke-width":6},null,8,["percentage","status"])],2)):a.createCommentVNode("",!0),C.error?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.error)},[a.createVNode(a.unref($),{name:"warning-filled",size:14}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)],2)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(s.$style.actions)},[a.createVNode(G,{size:"small",onClick:Z[1]||(Z[1]=r=>A("detail"))},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"view",size:14,style:{"margin-right":"4px"}}),Z[3]||(Z[3]=a.createTextVNode(" 查看详情 ",-1))]),_:1}),C.status==="error"?(a.openBlock(),a.createBlock(G,{key:0,size:"small",type:"primary",plain:"",onClick:Z[2]||(Z[2]=r=>A("retry"))},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"refresh",size:14,style:{"margin-right":"4px"}}),Z[4]||(Z[4]=a.createTextVNode(" 重试 ",-1))]),_:1})):a.createCommentVNode("",!0)],2)],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{card:"_card_15eqh_2",header:"_header_15eqh_8",iconWrap:"_iconWrap_15eqh_21",info:"_info_15eqh_33",name:"_name_15eqh_41",meta:"_meta_15eqh_50",duration:"_duration_15eqh_56",expandIcon:"_expandIcon_15eqh_62",detail:"_detail_15eqh_67",progress:"_progress_15eqh_73",progressLabel:"_progressLabel_15eqh_77",error:"_error_15eqh_83",actions:"_actions_15eqh_95",iconSpin:"_iconSpin_15eqh_100","sub-workflow-spin":"_sub-workflow-spin_15eqh_1"}}]]),xQ={key:0},fQ=E(a.defineComponent({__name:"PptPreviewCard",props:{slides:{},metadata:{},loading:{type:Boolean},error:{},blob:{}},emits:["download"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>(g.slides??[]).slice(0,4)),l={business:"商务",tech:"科技",education:"教育",creative:"创意"},e={professional:"专业",casual:"休闲",academic:"学术"},t={title:"document",content:"notebook",chart:"data-line",comparison:"scale-to-original",summary:"document-checked"};function c(){var d;if(g.blob){const o=URL.createObjectURL(g.blob),n=document.createElement("a");n.href=o,n.download=`${((d=g.metadata)==null?void 0:d.title)??"presentation"}.pptx`,n.click(),URL.revokeObjectURL(o)}else A("download")}return(d,o)=>{var n,s,Z,m;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(d.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.titleRow)},[a.createVNode(a.unref($),{name:"data-board",size:16,style:{color:"#67C23A"}}),a.createElementVNode("span",{class:a.normalizeClass(d.$style.title)},a.toDisplayString(((n=C.metadata)==null?void 0:n.title)??"AI PPT 生成"),3)],2),C.metadata?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.metaBadges)},[a.createElementVNode("span",{class:a.normalizeClass(d.$style.badge)},a.toDisplayString(l[C.metadata.template]??C.metadata.template),3),a.createElementVNode("span",{class:a.normalizeClass(d.$style.badge)},a.toDisplayString(C.metadata.totalSlides)+" 页",3)],2)):a.createCommentVNode("",!0)],2),C.loading?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.loadingState)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.spinner)},null,2),o[0]||(o[0]=a.createElementVNode("span",null,"正在生成 PPT...",-1))],2)):C.error?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(d.$style.errorState)},[a.createVNode(a.unref($),{name:"warning",size:24}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)],2)):i.value.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(d.$style.previewGrid)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,b=>{var G;return a.openBlock(),a.createElementBlock("div",{key:b.index,class:a.normalizeClass(d.$style.slideThumb)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.slideHeader)},[a.createVNode(a.unref($),{name:t[b.type]??"document",size:12},null,8,["name"]),a.createElementVNode("span",null,a.toDisplayString(b.heading),1)],2),a.createElementVNode("div",{class:a.normalizeClass(d.$style.slideBody)},[(G=b.content)!=null&&G.length?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.slideContent)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.content.slice(0,3),(r,h)=>(a.openBlock(),a.createElementBlock("div",{key:h,class:a.normalizeClass(d.$style.slidePoint)},a.toDisplayString(r),3))),128)),b.content.length>3?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.slideMore)}," +"+a.toDisplayString(b.content.length-3)+" 更多 ",3)):a.createCommentVNode("",!0)],2)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(d.$style.slideEmpty)},"暂无内容",2))],2),a.createElementVNode("div",{class:a.normalizeClass(d.$style.slideIndex)},a.toDisplayString(b.index),3)],2)}),128)),(((s=C.slides)==null?void 0:s.length)??0)>4?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.moreSlides)},[a.createElementVNode("span",null,"+"+a.toDisplayString((((Z=C.slides)==null?void 0:Z.length)??0)-4)+" 页",1)],2)):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0),C.metadata?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(d.$style.meta)},[C.metadata.style?(a.openBlock(),a.createElementBlock("span",xQ,[a.createVNode(a.unref($),{name:"brush",size:12}),a.createTextVNode(" "+a.toDisplayString(e[C.metadata.style]??C.metadata.style),1)])):a.createCommentVNode("",!0),a.createElementVNode("span",null,[a.createVNode(a.unref($),{name:"document",size:12}),a.createTextVNode(" "+a.toDisplayString(C.metadata.totalSlides)+" 页 ",1)])],2)):a.createCommentVNode("",!0),!C.loading&&((m=C.slides)!=null&&m.length)?(a.openBlock(),a.createElementBlock("div",{key:4,class:a.normalizeClass(d.$style.actions)},[a.createElementVNode("button",{class:a.normalizeClass(d.$style.downloadBtn),onClick:c},[a.createVNode(a.unref($),{name:"download",size:14}),o[1]||(o[1]=a.createTextVNode(" 下载 PPT ",-1))],2)],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{card:"_card_z1wac_2",header:"_header_z1wac_9",titleRow:"_titleRow_z1wac_16",title:"_title_z1wac_16",metaBadges:"_metaBadges_z1wac_28",badge:"_badge_z1wac_33",loadingState:"_loadingState_z1wac_41",errorState:"_errorState_z1wac_42",spinner:"_spinner_z1wac_56",spin:"_spin_z1wac_56",previewGrid:"_previewGrid_z1wac_69",slideThumb:"_slideThumb_z1wac_76",slideHeader:"_slideHeader_z1wac_85",slideBody:"_slideBody_z1wac_97",slideContent:"_slideContent_z1wac_101",slidePoint:"_slidePoint_z1wac_107",slideMore:"_slideMore_z1wac_116",slideEmpty:"_slideEmpty_z1wac_122",slideIndex:"_slideIndex_z1wac_127",moreSlides:"_moreSlides_z1wac_136",meta:"_meta_z1wac_28",actions:"_actions_z1wac_161",downloadBtn:"_downloadBtn_z1wac_166"}}]]),jQ=E(a.defineComponent({__name:"FlowPreviewShell",props:{title:{},badge:{},primaryAction:{},secondaryAction:{},compact:{type:Boolean,default:!1},showFitButton:{type:Boolean,default:!0}},emits:["primary-action","secondary-action","fit-view"],setup(C,{emit:I}){const g=I;return(A,i)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([A.$style.card,{[A.$style.compact]:C.compact}])},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.head)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.headLeft)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.headIcon)},[a.renderSlot(A.$slots,"icon",{},()=>[a.createVNode(a.unref($),{name:"connection",size:14})])],2),a.createElementVNode("span",{class:a.normalizeClass(A.$style.title)},a.toDisplayString(C.title),3)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.headRight)},[C.badge?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(A.$style.badge)},a.toDisplayString(C.badge),3)):a.createCommentVNode("",!0),C.showFitButton?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(A.$style.fitBtn),title:"适配画布",onClick:i[0]||(i[0]=l=>g("fit-view"))},[a.createVNode(a.unref($),{name:"full-screen"})],2)):a.createCommentVNode("",!0)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.canvasWrapper)},[a.renderSlot(A.$slots,"default")],2),C.primaryAction||C.secondaryAction?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(A.$style.actions)},[C.secondaryAction?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:a.normalizeClass(A.$style.btnGhost),onClick:i[1]||(i[1]=l=>g("secondary-action"))},[a.createVNode(a.unref($),{name:"edit",size:12}),a.createTextVNode(" "+a.toDisplayString(C.secondaryAction),1)],2)):a.createCommentVNode("",!0),C.primaryAction?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(A.$style.btnPrimary),onClick:i[2]||(i[2]=l=>g("primary-action"))},[a.createVNode(a.unref($),{name:"check",size:12}),a.createTextVNode(" "+a.toDisplayString(C.primaryAction),1)],2)):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0)],2))}}),[["__cssModules",{$style:{card:"_card_h1z12_1",head:"_head_h1z12_16",headLeft:"_headLeft_h1z12_25",headRight:"_headRight_h1z12_31",headIcon:"_headIcon_h1z12_37",title:"_title_h1z12_49",badge:"_badge_h1z12_55",fitBtn:"_fitBtn_h1z12_64",canvasWrapper:"_canvasWrapper_h1z12_86","vue-flow__node":"_vue-flow__node_h1z12_92",selected:"_selected_h1z12_96","vue-flow__edge-path":"_vue-flow__edge-path_h1z12_101","vue-flow__controls":"_vue-flow__controls_h1z12_105","vue-flow__controls-button":"_vue-flow__controls-button_h1z12_111",actions:"_actions_h1z12_121",btnPrimary:"_btnPrimary_h1z12_130",btnGhost:"_btnGhost_h1z12_150",compact:"_compact_h1z12_173"}}]]),QQ={class:"apf-model3d"},UQ={class:"apf-model3d__header"},OQ={class:"apf-model3d__badge"},EQ={class:"apf-model3d__filename"},PQ={class:"apf-model3d__body"},_Q={key:0,slot:"poster",class:"apf-model3d__hint"},qQ={key:1,class:"apf-model3d__hint is-error"},$Q={key:0,class:"apf-model3d__actions"},gU=["href"],IU=E(a.defineComponent({__name:"Model3dPreviewCard",props:{url:{},filename:{},mimeType:{},poster:{}},setup(C){const I=C,g=a.ref(!1),A=a.ref(null),i=a.computed(()=>{var c,d;const t=((d=(c=I.filename)==null?void 0:c.split(".").pop())==null?void 0:d.toLowerCase())||"";return["gltf","glb"].includes(t)?"glTF":t==="obj"?"OBJ":t==="stl"?"STL":t==="fbx"?"FBX":"3D"});function l(){g.value=!0,A.value=null}function e(){A.value="加载失败"}return(t,c)=>{const d=a.resolveComponent("model-viewer");return a.openBlock(),a.createElementBlock("div",QQ,[a.createElementVNode("div",UQ,[a.createElementVNode("span",OQ,a.toDisplayString(i.value),1),a.createElementVNode("span",EQ,a.toDisplayString(C.filename||"3D 模型"),1)]),a.createElementVNode("div",PQ,[a.createVNode(d,{src:C.url,poster:C.poster,"camera-controls":"","auto-rotate":"","shadow-intensity":"1",class:"apf-model3d__viewer",onLoad:l,onError:e},{default:a.withCtx(()=>[!g.value&&!A.value?(a.openBlock(),a.createElementBlock("div",_Q,[a.createVNode(a.unref($),{name:"loading",size:24,class:"apf-model3d__spin"}),c[0]||(c[0]=a.createElementVNode("span",null,"加载 3D 模型中...",-1))])):a.createCommentVNode("",!0),A.value?(a.openBlock(),a.createElementBlock("div",qQ,[a.createVNode(a.unref($),{name:"warning-filled",size:24}),a.createElementVNode("span",null,a.toDisplayString(A.value),1)])):a.createCommentVNode("",!0)]),_:1},8,["src","poster"])]),A.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",$Q,[a.createElementVNode("a",{class:"apf-model3d__download",href:C.url,download:""},[a.createVNode(a.unref($),{name:"download",size:14}),c[1]||(c[1]=a.createTextVNode(" 下载 ",-1))],8,gU)]))])}}}),[["__scopeId","data-v-b562b8bd"]]),CU={class:"apf-image-generate"},AU={class:"apf-image-generate__header"},iU={class:"apf-image-generate__title-row"},lU={key:0,class:"apf-image-generate__model"},eU={key:0,class:"apf-image-generate__prompt"},tU={class:"apf-image-generate__image-container"},aU={key:0,class:"apf-image-generate__overlay"},cU={key:1,class:"apf-image-generate__overlay apf-image-generate__overlay--error"},dU=["src"],oU={class:"apf-image-generate__zoom-hint"},nU={key:3,class:"apf-image-generate__placeholder"},sU={key:1,class:"apf-image-generate__meta"},ZU={key:0},mU={key:1},bU={key:2},GU={key:2,class:"apf-image-generate__actions"},rU=E(a.defineComponent({__name:"ImageGenerateCard",props:{imageUrl:{},prompt:{},model:{},size:{},imageStyle:{},quality:{},loading:{type:Boolean},error:{}},emits:["download","regenerate"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1);function l(){if(!g.imageUrl)return;const o=document.createElement("a");o.href=g.imageUrl,o.download=`ai-image-${Date.now()}.png`,o.click(),A("download")}function e(){g.imageUrl&&(i.value=!0)}function t(){i.value=!1}const c={vivid:"鲜艳",natural:"自然"},d={standard:"标准",hd:"高清"};return(o,n)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",CU,[a.createElementVNode("div",AU,[a.createElementVNode("div",iU,[a.createVNode(a.unref($),{name:"picture",size:16,style:{color:"#E6A23C"}}),n[1]||(n[1]=a.createElementVNode("span",{class:"apf-image-generate__title"},"AI 图片生成",-1))]),C.model?(a.openBlock(),a.createElementBlock("div",lU,a.toDisplayString(C.model),1)):a.createCommentVNode("",!0)]),C.prompt?(a.openBlock(),a.createElementBlock("div",eU,[n[2]||(n[2]=a.createElementVNode("span",{class:"apf-image-generate__prompt-label"},"Prompt:",-1)),a.createTextVNode(a.toDisplayString(C.prompt),1)])):a.createCommentVNode("",!0),a.createElementVNode("div",tU,[C.loading?(a.openBlock(),a.createElementBlock("div",aU,[...n[3]||(n[3]=[a.createElementVNode("div",{class:"apf-image-generate__spinner"},null,-1),a.createElementVNode("span",null,"正在生成图片...",-1)])])):C.error?(a.openBlock(),a.createElementBlock("div",cU,[a.createVNode(a.unref($),{name:"warning",size:24}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)])):C.imageUrl?(a.openBlock(),a.createElementBlock("div",{key:2,class:"apf-image-generate__image-wrap",onClick:e},[a.createElementVNode("img",{src:C.imageUrl,class:"apf-image-generate__image",alt:"AI generated image"},null,8,dU),a.createElementVNode("div",oU,[a.createVNode(a.unref($),{name:"full-screen",size:16}),n[4]||(n[4]=a.createElementVNode("span",null,"点击放大",-1))])])):(a.openBlock(),a.createElementBlock("div",nU,[a.createVNode(a.unref($),{name:"picture",size:32}),n[5]||(n[5]=a.createElementVNode("span",null,"等待生成",-1))]))]),C.size||C.imageStyle||C.quality?(a.openBlock(),a.createElementBlock("div",sU,[C.size?(a.openBlock(),a.createElementBlock("span",ZU,[a.createVNode(a.unref($),{name:"full-screen",size:12}),a.createTextVNode(" "+a.toDisplayString(C.size),1)])):a.createCommentVNode("",!0),C.imageStyle?(a.openBlock(),a.createElementBlock("span",mU,[a.createVNode(a.unref($),{name:"brush",size:12}),a.createTextVNode(" "+a.toDisplayString(c[C.imageStyle]??C.imageStyle),1)])):a.createCommentVNode("",!0),C.quality?(a.openBlock(),a.createElementBlock("span",bU,[a.createVNode(a.unref($),{name:"picture",size:12}),a.createTextVNode(" "+a.toDisplayString(d[C.quality]??C.quality),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),!C.loading&&C.imageUrl?(a.openBlock(),a.createElementBlock("div",GU,[a.createElementVNode("button",{type:"button",class:"apf-image-generate__btn apf-image-generate__btn--primary",onClick:l},[a.createVNode(a.unref($),{name:"download",size:14}),n[6]||(n[6]=a.createTextVNode(" 下载图片 ",-1))]),a.createElementVNode("button",{type:"button",class:"apf-image-generate__btn",onClick:n[0]||(n[0]=s=>A("regenerate"))},[a.createVNode(a.unref($),{name:"refresh",size:14}),n[7]||(n[7]=a.createTextVNode(" 重新生成 ",-1))])])):a.createCommentVNode("",!0)]),i.value&&C.imageUrl?(a.openBlock(),a.createBlock(a.unref(BC.ElImageViewer),{key:0,"url-list":[C.imageUrl],"initial-index":0,"close-on-press-escape":!0,teleported:"",onClose:t},null,8,["url-list"])):a.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-7f771b7c"]]),hU=E(a.defineComponent({__name:"SchemaFormPreview",props:{fields:{},title:{default:"生成的表单"},compact:{type:Boolean,default:!1},labelWidth:{default:"100px"},labelPosition:{default:"right"},primaryActionLabel:{default:"确认发布"},showPrimaryAction:{type:Boolean}},emits:["click","primary-action"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>g.showPrimaryAction!==void 0?g.showPrimaryAction:!g.compact);return(l,e)=>{const t=a.resolveComponent("el-input"),c=a.resolveComponent("el-form-item"),d=a.resolveComponent("el-option"),o=a.resolveComponent("el-select"),n=a.resolveComponent("el-checkbox"),s=a.resolveComponent("el-checkbox-group"),Z=a.resolveComponent("el-radio"),m=a.resolveComponent("el-radio-group"),b=a.resolveComponent("el-switch"),G=a.resolveComponent("el-date-picker"),r=a.resolveComponent("el-time-picker"),h=a.resolveComponent("el-button"),u=a.resolveComponent("el-input-number"),B=a.resolveComponent("el-form");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([l.$style.previewCard,{[l.$style.compact]:C.compact}]),onClick:e[1]||(e[1]=W=>A("click"))},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerLeft)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerIcon)},[a.createVNode(a.unref($),{name:"grid",size:14})],2),a.createElementVNode("span",{class:a.normalizeClass(l.$style.title)},a.toDisplayString(C.title),3)],2),a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerRight)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.badge)},a.toDisplayString(C.fields.length)+" 个字段",3),a.createElementVNode("span",{class:a.normalizeClass(l.$style.viewHint)},[a.createVNode(a.unref($),{name:"view",size:12}),e[2]||(e[2]=a.createTextVNode(" 预览 ",-1))],2)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(l.$style.previewBody)},[a.createVNode(B,{"label-width":C.labelWidth,"label-position":C.labelPosition,class:a.normalizeClass(l.$style.form)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.fields,W=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:W.id},[["input","email","phone","password"].includes(W.type)?(a.openBlock(),a.createBlock(c,{key:0,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(t,{placeholder:W.placeholder,clearable:W.clearable,"show-password":W.showPassword,maxlength:W.maxlength,disabled:C.compact,size:"default"},null,8,["placeholder","clearable","show-password","maxlength","disabled"])]),_:2},1032,["label","class"])):W.type==="textarea"?(a.openBlock(),a.createBlock(c,{key:1,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(t,{type:"textarea",placeholder:W.placeholder,rows:3,disabled:C.compact},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"])):W.type==="select"?(a.openBlock(),a.createBlock(c,{key:2,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(o,{placeholder:W.placeholder,clearable:W.clearable,disabled:C.compact,style:{width:"100%"}},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(W.options??[],w=>(a.openBlock(),a.createBlock(d,{key:String(w.value),label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:2},1032,["placeholder","clearable","disabled"])]),_:2},1032,["label","class"])):W.type==="checkbox"?(a.openBlock(),a.createBlock(c,{key:3,label:W.label||void 0,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(s,{disabled:C.compact},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(W.options??[],w=>(a.openBlock(),a.createBlock(n,{key:String(w.value),label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:2},1032,["disabled"])]),_:2},1032,["label","class"])):W.type==="radio"?(a.openBlock(),a.createBlock(c,{key:4,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(m,{disabled:C.compact},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(W.options??[],w=>(a.openBlock(),a.createBlock(Z,{key:String(w.value),value:w.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(w.label),1)]),_:2},1032,["value"]))),128))]),_:2},1032,["disabled"])]),_:2},1032,["label","class"])):W.type==="switch"?(a.openBlock(),a.createBlock(c,{key:5,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(b,{disabled:C.compact},null,8,["disabled"])]),_:1},8,["label","class"])):W.type==="date-picker"||W.type==="datepicker"?(a.openBlock(),a.createBlock(c,{key:6,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(G,{placeholder:W.placeholder,disabled:C.compact,style:{width:"100%"}},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"])):W.type==="time-picker"||W.type==="timepicker"?(a.openBlock(),a.createBlock(c,{key:7,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(r,{placeholder:W.placeholder,disabled:C.compact,style:{width:"100%"}},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"])):W.type==="button"?(a.openBlock(),a.createBlock(c,{key:8,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(h,{type:W.buttonType??"default",disabled:C.compact},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(W.buttonText??W.label??"按钮"),1)]),_:2},1032,["type","disabled"])]),_:2},1032,["class"])):W.type==="number"?(a.openBlock(),a.createBlock(c,{key:9,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(u,{disabled:C.compact,style:{width:"100%"}},null,8,["disabled"])]),_:1},8,["label","class"])):(a.openBlock(),a.createBlock(c,{key:10,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(t,{placeholder:W.placeholder||W.type,disabled:C.compact},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"]))],64))),128))]),_:1},8,["label-width","label-position","class"])],2),i.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(l.$style.actions)},[a.createVNode(h,{class:a.normalizeClass(l.$style.btnPrimary),type:"primary",onClick:e[0]||(e[0]=a.withModifiers(W=>A("primary-action"),["stop"]))},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"check",size:12}),a.createTextVNode(" "+a.toDisplayString(C.primaryActionLabel),1)]),_:1},8,["class"])],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{previewCard:"_previewCard_18hnt_2",compact:"_compact_18hnt_16",header:"_header_18hnt_21",headerLeft:"_headerLeft_18hnt_30",headerIcon:"_headerIcon_18hnt_36",title:"_title_18hnt_47",headerRight:"_headerRight_18hnt_53",badge:"_badge_18hnt_59",viewHint:"_viewHint_18hnt_67",previewBody:"_previewBody_18hnt_79",form:"_form_18hnt_83",formItem:"_formItem_18hnt_87",actions:"_actions_18hnt_95",btnOutline:"_btnOutline_18hnt_105",btnPrimary:"_btnPrimary_18hnt_127"}}]]),uU=E(a.defineComponent({__name:"WorkflowRunTimeline",props:{title:{},status:{},progressText:{},steps:{},defaultCollapsed:{type:Boolean,default:!1},emptyText:{default:"等待首个节点开始…"}},setup(C){const I=C,g=a.ref(I.defaultCollapsed);a.watch(()=>I.status,c=>{c==="running"&&(g.value=!1)});const A={running:"loading",success:"circle-check",error:"circle-close-filled",waiting:"clock",skipped:"minus",pending:"more-filled"},i=a.computed(()=>{const c=I.status;return c?`status${c.charAt(0).toUpperCase()}${c.slice(1)}`:""});function l(c){return`icon${c.charAt(0).toUpperCase()}${c.slice(1)}`}function e(c){return A[c]??"more-filled"}function t(){g.value=!g.value}return(c,d)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([c.$style.block,c.$style[i.value]])},[a.createElementVNode("button",{type:"button",class:a.normalizeClass(c.$style.header),onClick:t},[a.createElementVNode("span",{class:a.normalizeClass(c.$style.headerLeft)},[a.createVNode(a.unref($),{name:g.value?"arrow-right":"arrow-down",size:12,class:a.normalizeClass(c.$style.chevron)},null,8,["name","class"]),a.createElementVNode("span",{class:a.normalizeClass(c.$style.title)},a.toDisplayString(C.title),3)],2),C.progressText?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(c.$style.progress)},a.toDisplayString(C.progressText),3)):a.createCommentVNode("",!0)],2),g.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(c.$style.timeline)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.steps,(o,n)=>(a.openBlock(),a.createElementBlock("div",{key:o.id,class:a.normalizeClass([c.$style.item,o.status==="running"&&c.$style.itemRunning,o.streaming&&c.$style.itemStreaming])},[a.createElementVNode("div",{class:a.normalizeClass(c.$style.rail)},[a.createElementVNode("span",{class:a.normalizeClass([c.$style.iconWrap,c.$style[l(o.status)]])},[a.createVNode(a.unref($),{name:e(o.status),size:14,class:a.normalizeClass(o.status==="running"?c.$style.spin:void 0)},null,8,["name","class"])],2),n<C.steps.length-1?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(c.$style.connector)},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(c.$style.body)},[a.createElementVNode("span",{class:a.normalizeClass(c.$style.nodeName)},a.toDisplayString(o.label),3),o.hint?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(c.$style.nodeHint)},a.toDisplayString(o.hint),3)):a.createCommentVNode("",!0),a.renderSlot(c.$slots,"step",{step:o})],2)],2))),128)),C.steps.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(c.$style.empty)},a.toDisplayString(C.emptyText),3))],2))],2))}}),[["__cssModules",{$style:{block:"_block_2l73c_2",statusRunning:"_statusRunning_2l73c_10",statusError:"_statusError_2l73c_14",statusWaiting:"_statusWaiting_2l73c_18",header:"_header_2l73c_22",headerLeft:"_headerLeft_2l73c_39",chevron:"_chevron_2l73c_46",title:"_title_2l73c_51",progress:"_progress_2l73c_60",timeline:"_timeline_2l73c_66",item:"_item_2l73c_70",itemRunning:"_itemRunning_2l73c_76",nodeName:"_nodeName_2l73c_76",itemStreaming:"_itemStreaming_2l73c_81",iconWrap:"_iconWrap_2l73c_81",rail:"_rail_2l73c_85",iconSuccess:"_iconSuccess_2l73c_104",iconError:"_iconError_2l73c_109",iconRunning:"_iconRunning_2l73c_114",iconWaiting:"_iconWaiting_2l73c_119",iconSkipped:"_iconSkipped_2l73c_124",spin:"_spin_2l73c_129",connector:"_connector_2l73c_138",body:"_body_2l73c_146",nodeHint:"_nodeHint_2l73c_160",empty:"_empty_2l73c_166"}}]]),BU=["tabindex","aria-label"],WU=E(a.defineComponent({__name:"SuggestionCard",props:{suggestion:{},accepted:{type:Boolean},dismissed:{type:Boolean}},emits:["accept","dismiss"],setup(C,{emit:I}){const g=C,A=I,i={action:{icon:"promotion",label:"操作",color:"#409EFF"},optimization:{icon:"magic-stick",label:"优化",color:"#E6A23C"},reference:{icon:"document",label:"参考",color:"#67C23A"}},l={high:{label:"高",color:"#F56C6C",bgColor:"#fef0f0"},medium:{label:"中",color:"#E6A23C",bgColor:"#fdf6ec"},low:{label:"低",color:"#909399",bgColor:"#f4f4f5"}},e=a.computed(()=>i[g.suggestion.type]??i.action),t=a.computed(()=>l[g.suggestion.priority]??l.medium),c=a.computed(()=>!g.accepted&&!g.dismissed);function d(){c.value&&A("accept",g.suggestion.id)}function o(){c.value&&A("dismiss",g.suggestion.id)}function n(s){c.value&&(s.key==="Enter"||s.key===" "?(s.preventDefault(),d()):s.key==="Escape"&&(s.preventDefault(),o()))}return(s,Z)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([s.$style.card,C.accepted&&s.$style.accepted,C.dismissed&&s.$style.dismissed]),tabindex:c.value?0:-1,role:"article","aria-label":`建议: ${C.suggestion.title}`,onKeydown:n},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.typeBadge),style:a.normalizeStyle({color:e.value.color})},[a.createVNode(a.unref($),{name:e.value.icon,size:14},null,8,["name"]),a.createElementVNode("span",null,a.toDisplayString(e.value.label),1)],6),a.createElementVNode("div",{class:a.normalizeClass(s.$style.priorityBadge),style:a.normalizeStyle({color:t.value.color,background:t.value.bgColor})},a.toDisplayString(t.value.label)+"优先 ",7)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.body)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.title)},a.toDisplayString(C.suggestion.title),3),a.createElementVNode("div",{class:a.normalizeClass(s.$style.description)},a.toDisplayString(C.suggestion.description),3),C.suggestion.targetName?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.target)},[a.createVNode(a.unref($),{name:"connection",size:12}),a.createElementVNode("span",null,a.toDisplayString(C.suggestion.targetName),1)],2)):a.createCommentVNode("",!0)],2),c.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.actions)},[a.createElementVNode("button",{class:a.normalizeClass(s.$style.acceptBtn),type:"button",onClick:d},[a.createVNode(a.unref($),{name:"check",size:14}),Z[0]||(Z[0]=a.createTextVNode(" 采纳 ",-1))],2),a.createElementVNode("button",{class:a.normalizeClass(s.$style.dismissBtn),type:"button",onClick:o},[a.createVNode(a.unref($),{name:"close",size:14}),Z[1]||(Z[1]=a.createTextVNode(" 忽略 ",-1))],2)],2)):a.createCommentVNode("",!0),C.accepted?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.statusBadge)},[a.createVNode(a.unref($),{name:"check",size:14}),Z[2]||(Z[2]=a.createTextVNode(" 已采纳 ",-1))],2)):a.createCommentVNode("",!0),C.dismissed?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([s.$style.statusBadge,s.$style.statusDismissed])},[a.createVNode(a.unref($),{name:"close",size:14}),Z[3]||(Z[3]=a.createTextVNode(" 已忽略 ",-1))],2)):a.createCommentVNode("",!0)],42,BU))}}),[["__cssModules",{$style:{card:"_card_69ko9_2",accepted:"_accepted_69ko9_21",dismissed:"_dismissed_69ko9_31",header:"_header_69ko9_36",typeBadge:"_typeBadge_69ko9_43",priorityBadge:"_priorityBadge_69ko9_51",body:"_body_69ko9_58",title:"_title_69ko9_62",description:"_description_69ko9_69",target:"_target_69ko9_75",actions:"_actions_69ko9_84",acceptBtn:"_acceptBtn_69ko9_91",dismissBtn:"_dismissBtn_69ko9_92",statusBadge:"_statusBadge_69ko9_132",statusDismissed:"_statusDismissed_69ko9_144"}}]]),wU=["onClick"],YU=E(a.defineComponent({__name:"ConversationSearchBar",props:{modelValue:{},searching:{type:Boolean,default:!1},panelVisible:{type:Boolean,default:!1},results:{},total:{default:0},sourceOptions:{},sourceFilter:{default:""},startDate:{default:""},endDate:{default:""},filtersExpanded:{type:Boolean,default:!1},placeholder:{default:"搜索对话..."}},emits:["update:modelValue","update:sourceFilter","update:startDate","update:endDate","update:filtersExpanded","update:panelVisible","select","clear","search"],setup(C,{emit:I}){const g=[{value:"",label:"全部来源"},{value:"editor",label:"Editor"},{value:"flow",label:"Flow"},{value:"standalone",label:"AI"}],A=C,i=I,l=a.computed(()=>A.sourceOptions??g),e=a.computed(()=>A.startDate!==""||A.endDate!==""||A.sourceFilter!=="");function t(m){const b=new Date(m),G=r=>String(r).padStart(2,"0");return`${b.getFullYear()}${G(b.getMonth()+1)}${G(b.getDate())} ${G(b.getHours())}${G(b.getMinutes())}${G(b.getSeconds())}`}function c(m){if(!m)return"AI";const b=l.value.find(G=>G.value===m);return b!=null&&b.label?b.label:m==="editor"?"Editor":m==="flow"?"Flow":"AI"}function d(m){return m==="editor"?"success":m==="flow"?"primary":"warning"}function o(){i("update:modelValue",""),i("update:startDate",""),i("update:endDate",""),i("update:sourceFilter",""),i("update:panelVisible",!1),i("clear")}function n(m){i("select",m)}function s(){i("update:filtersExpanded",!A.filtersExpanded)}function Z(m,b){const G=b??"";i(m==="start"?"update:startDate":"update:endDate",G)}return(m,b)=>{const G=a.resolveComponent("el-input"),r=a.resolveComponent("el-button"),h=a.resolveComponent("el-option"),u=a.resolveComponent("el-select"),B=a.resolveComponent("el-date-picker"),W=a.resolveComponent("el-popover"),w=a.resolveComponent("el-tag");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(m.$style.root)},[a.createElementVNode("div",{class:a.normalizeClass(m.$style.searchRow)},[a.createVNode(G,{"model-value":C.modelValue,placeholder:C.placeholder,size:"small",clearable:"","onUpdate:modelValue":b[0]||(b[0]=Y=>i("update:modelValue",Y)),onClear:o,onKeyup:b[1]||(b[1]=a.withKeys(Y=>i("search"),["enter"]))},{prefix:a.withCtx(()=>[a.createVNode(a.unref($),{name:"search",size:14})]),_:1},8,["model-value","placeholder"]),a.createVNode(W,{visible:C.filtersExpanded,placement:"bottom-end",width:220,trigger:"click","show-arrow":!1,offset:4},{reference:a.withCtx(()=>[a.createVNode(r,{size:"small",type:e.value?"primary":"default",link:!e.value,onClick:s},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"filter",size:14})]),_:1},8,["type","link"])]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass(m.$style.filterPanel)},[a.createElementVNode("div",{class:a.normalizeClass(m.$style.filterRow)},[a.createElementVNode("span",{class:a.normalizeClass(m.$style.filterLabel)},"来源",2),a.createVNode(u,{"model-value":C.sourceFilter,size:"small",placeholder:"全部",style:{flex:"1"},"onUpdate:modelValue":b[2]||(b[2]=Y=>i("update:sourceFilter",Y))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,Y=>(a.openBlock(),a.createBlock(h,{key:Y.value,label:Y.label,value:Y.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])],2),a.createElementVNode("div",{class:a.normalizeClass(m.$style.filterRow)},[a.createElementVNode("span",{class:a.normalizeClass(m.$style.filterLabel)},"时间",2),a.createVNode(B,{"model-value":C.startDate||null,type:"date",placeholder:"开始",size:"small","value-format":"YYYY-MM-DD",style:{flex:"1"},"onUpdate:modelValue":b[3]||(b[3]=Y=>Z("start",Y))},null,8,["model-value"]),a.createElementVNode("span",{class:a.normalizeClass(m.$style.filterSep)},"~",2),a.createVNode(B,{"model-value":C.endDate||null,type:"date",placeholder:"结束",size:"small","value-format":"YYYY-MM-DD",style:{flex:"1"},"onUpdate:modelValue":b[4]||(b[4]=Y=>Z("end",Y))},null,8,["model-value"])],2)],2)]),_:1},8,["visible"])],2),C.panelVisible?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(m.$style.results)},[C.searching?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(m.$style.empty)},"搜索中...",2)):C.results.length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createElementVNode("div",{class:a.normalizeClass(m.$style.resultCount)},"找到 "+a.toDisplayString(C.total)+" 条结果",3),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.results,Y=>(a.openBlock(),a.createElementBlock("div",{key:Y.id,class:a.normalizeClass(m.$style.resultItem),onClick:p=>n(Y.id)},[a.createElementVNode("span",{class:a.normalizeClass(m.$style.resultTitle)},a.toDisplayString(Y.title),3),a.createVNode(w,{type:d(Y.source),size:"small"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(c(Y.source)),1)]),_:2},1032,["type"]),Y.updatedAt?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(m.$style.resultTime)},a.toDisplayString(t(Y.updatedAt)),3)):a.createCommentVNode("",!0)],10,wU))),128))],64)):(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(m.$style.empty)},"无匹配对话",2))],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{root:"_root_x8tmk_2",searchRow:"_searchRow_x8tmk_8",filterPanel:"_filterPanel_x8tmk_16",filterRow:"_filterRow_x8tmk_22",filterLabel:"_filterLabel_x8tmk_28",filterSep:"_filterSep_x8tmk_35",results:"_results_x8tmk_40",resultCount:"_resultCount_x8tmk_46",resultItem:"_resultItem_x8tmk_53",resultTitle:"_resultTitle_x8tmk_71",resultTime:"_resultTime_x8tmk_82",empty:"_empty_x8tmk_88"}}]]),VU={class:"apf-task-chain"},pU={class:"apf-task-chain__label"},yU={class:"apf-task-chain__steps"},NU=["data-step"],XU={class:"apf-task-chain__icon"},RU={class:"apf-task-chain__agent"},HU={class:"apf-task-chain__desc"},SU={key:0,class:"apf-task-chain__arrow"},MU=E(a.defineComponent({__name:"TaskChainBar",props:{steps:{},currentIndex:{},label:{default:"任务链"}},setup(C){const I=C,g=a.ref();function A(l){switch(l){case"done":return"✓";case"running":return"●";case"skipped":return"○";case"error":return"!";default:return"○"}}function i(l){return l==="editor"?"表单":l==="flow"?"流程":l==="page"?"页面":l}return a.watch(()=>I.currentIndex,()=>{a.nextTick(()=>{const l=g.value;if(!l)return;const t=l.querySelectorAll("[data-step]")[I.currentIndex];t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}),(l,e)=>(a.openBlock(),a.createElementBlock("div",VU,[a.createElementVNode("div",pU,a.toDisplayString(C.label),1),a.createElementVNode("div",{ref_key:"scrollbarRef",ref:g,class:"apf-task-chain__scroll"},[a.createElementVNode("div",yU,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.steps,(t,c)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:c},[a.createElementVNode("div",{"data-step":c,class:a.normalizeClass(["apf-task-chain__step",[t.status?`is-${t.status}`:"is-pending",{"is-current":c===C.currentIndex}]])},[a.createElementVNode("span",XU,a.toDisplayString(A(t.status)),1),a.createElementVNode("span",RU,a.toDisplayString(i(t.agent)),1),a.createElementVNode("span",HU,a.toDisplayString(t.description),1)],10,NU),c<C.steps.length-1?(a.openBlock(),a.createElementBlock("div",SU,"→")):a.createCommentVNode("",!0)],64))),128))])],512)]))}}),[["__scopeId","data-v-31bc7b98"]]),DU={class:"apf-rag-panel"},KU={class:"apf-rag-panel__header"},FU=["value","placeholder"],zU={key:0,class:"apf-rag-panel__spinner","aria-label":"加载中"},JU={key:0,class:"apf-rag-panel__chips"},vU={class:"apf-rag-panel__chip-name"},kU=["onClick"],LU={class:"apf-rag-panel__list"},TU=["onClick"],xU={class:"apf-rag-panel__info"},fU={class:"apf-rag-panel__name"},jU={key:0,class:"apf-rag-panel__desc"},QU={key:1,class:"apf-rag-panel__tags"},UU={key:0,class:"apf-rag-panel__tag"},OU={key:1,class:"apf-rag-panel__empty"},EU={key:2,class:"apf-rag-panel__empty"},PU={class:"apf-rag-panel__footer"},_U=E(a.defineComponent({__name:"RagContextPanel",props:{results:{},selected:{},loading:{type:Boolean,default:!1},query:{default:""},placeholder:{default:"智能匹配 Schema,如:用户注册表单..."},emptyHint:{default:"未找到匹配的 Schema"},idleHint:{default:"输入自然语言描述,智能匹配已有 Schema"},footerHint:{default:"选择 Schema 注入对话上下文"},selectedFooterHint:{default:"已选 {n} 个 Schema 作为上下文"}},emits:["update:query","search","select","remove","close"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(g.query);a.watch(()=>g.query,o=>{o!==i.value&&(i.value=o)});function l(o){i.value=o,A("update:query",o),A("search",o)}function e(o){return g.selected.some(n=>n.id===o.id)}function t(o){e(o)||A("select",o)}function c(o){return o>=70?"high":o>=40?"medium":"low"}const d=a.computed(()=>g.selected.length>0?g.selectedFooterHint.replace("{n}",String(g.selected.length)):g.footerHint);return(o,n)=>(a.openBlock(),a.createElementBlock("div",DU,[a.createElementVNode("div",KU,[n[2]||(n[2]=a.createElementVNode("svg",{class:"apf-rag-panel__icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[a.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),a.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),a.createElementVNode("input",{class:"apf-rag-panel__input",value:i.value,placeholder:C.placeholder,onInput:n[0]||(n[0]=s=>l(s.target.value))},null,40,FU),C.loading?(a.openBlock(),a.createElementBlock("span",zU)):a.createCommentVNode("",!0)]),C.selected.length>0?(a.openBlock(),a.createElementBlock("div",JU,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.selected,s=>(a.openBlock(),a.createElementBlock("span",{key:s.id,class:"apf-rag-panel__chip"},[a.createElementVNode("span",vU,a.toDisplayString(s.name),1),a.createElementVNode("button",{type:"button",class:"apf-rag-panel__chip-remove",title:"移除",onClick:Z=>A("remove",s.id)}," × ",8,kU)]))),128))])):a.createCommentVNode("",!0),a.createElementVNode("div",LU,[C.results.length>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(C.results,s=>{var Z;return a.openBlock(),a.createElementBlock("button",{key:s.id,type:"button",class:a.normalizeClass(["apf-rag-panel__item",{"is-selected":e(s)}]),onClick:m=>t(s)},[a.createElementVNode("div",{class:a.normalizeClass(["apf-rag-panel__score",`is-${c(s.score)}`])},a.toDisplayString(s.score),3),a.createElementVNode("div",xU,[a.createElementVNode("div",fU,a.toDisplayString(s.name),1),s.description?(a.openBlock(),a.createElementBlock("div",jU,a.toDisplayString(s.description),1)):a.createCommentVNode("",!0),(Z=s.tags)!=null&&Z.length?(a.openBlock(),a.createElementBlock("div",QU,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.tags.slice(0,5),m=>(a.openBlock(),a.createElementBlock("span",{key:m,class:"apf-rag-panel__tag"},a.toDisplayString(m),1))),128)),s.tags.length>5?(a.openBlock(),a.createElementBlock("span",UU," +"+a.toDisplayString(s.tags.length-5),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])],10,TU)}),128)):!C.loading&&i.value.trim()?(a.openBlock(),a.createElementBlock("div",OU,[n[3]||(n[3]=a.createElementVNode("div",{class:"apf-rag-panel__empty-icon"},"⌕",-1)),a.createElementVNode("div",null,a.toDisplayString(C.emptyHint),1)])):C.loading?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",EU,[n[4]||(n[4]=a.createElementVNode("div",{class:"apf-rag-panel__empty-icon"},"✦",-1)),a.createElementVNode("div",null,a.toDisplayString(C.idleHint),1)]))]),a.createElementVNode("div",PU,[a.createElementVNode("span",null,a.toDisplayString(d.value),1),a.createElementVNode("button",{type:"button",class:"apf-rag-panel__close",onClick:n[1]||(n[1]=s=>A("close"))},"关闭")])]))}}),[["__scopeId","data-v-c6864f2d"]]),qU={class:"apf-assistant-picker"},$U={key:0,class:"apf-assistant-picker__state"},gO={key:1,class:"apf-assistant-picker__state apf-assistant-picker__state--error"},IO={key:2,class:"apf-assistant-picker__state"},CO=["onClick"],AO={class:"apf-assistant-picker__main"},iO={class:"apf-assistant-picker__icon-wrap"},lO={class:"apf-assistant-picker__info"},eO={class:"apf-assistant-picker__caps"},tO=E(a.defineComponent({__name:"AssistantPicker",props:{items:{},modelValue:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","select"],setup(C,{emit:I}){const g=C,A=I;function i(c){var o,n;const d=["文本"];return(o=c.supportedInputs)!=null&&o.includes("file")&&d.push("文件"),(n=c.supportedInputs)!=null&&n.includes("image")&&d.push("图片"),c.hitlCapable&&d.push("需要确认"),d}function l(c){return c.icon||"chat-dot-round"}function e(c){A("update:modelValue",c.id),A("select",c)}const t=a.computed(()=>!g.loading&&!g.error&&!g.items.length);return(c,d)=>(a.openBlock(),a.createElementBlock("div",qU,[C.loading?(a.openBlock(),a.createElementBlock("div",$U,[...d[0]||(d[0]=[a.createElementVNode("p",null,"正在加载智能体…",-1)])])):C.error?(a.openBlock(),a.createElementBlock("div",gO,[a.createElementVNode("p",null,a.toDisplayString(C.error),1)])):t.value?(a.openBlock(),a.createElementBlock("div",IO,[...d[1]||(d[1]=[a.createElementVNode("p",null,"暂无可用智能体",-1)])])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.items,o=>(a.openBlock(),a.createElementBlock("button",{key:o.id,type:"button",class:a.normalizeClass(["apf-assistant-picker__item",{"is-active":C.modelValue===o.id}]),onClick:n=>e(o)},[a.createElementVNode("div",AO,[a.createElementVNode("span",iO,[a.createVNode(a.unref($),{name:l(o),size:22},null,8,["name"])]),a.createElementVNode("span",lO,[a.createElementVNode("b",null,a.toDisplayString(o.name),1),a.createElementVNode("small",null,a.toDisplayString(o.description||"适合处理一类明确任务"),1),a.createElementVNode("span",eO,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i(o),n=>(a.openBlock(),a.createElementBlock("span",{key:n,class:a.normalizeClass(["apf-assistant-picker__cap",{"is-confirm":n==="需要确认"}])},a.toDisplayString(n),3))),128))])])]),a.createElementVNode("span",{class:a.normalizeClass(["apf-assistant-picker__choose",{"is-selected":C.modelValue===o.id}])},a.toDisplayString(C.modelValue===o.id?"已选择":"开始使用"),3)],10,CO))),128))]))}}),[["__scopeId","data-v-f05e69c0"]]),aO={class:"apf-model-picker"},cO=E(a.defineComponent({__name:"ModelPicker",props:{models:{},modelValue:{},loading:{type:Boolean}},emits:["update:modelValue"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-option"),e=a.resolveComponent("el-select");return a.openBlock(),a.createElementBlock("label",aO,[a.createVNode(e,{"model-value":C.modelValue||void 0,disabled:C.loading||!C.models.length,placeholder:"选择模型","onUpdate:modelValue":i[0]||(i[0]=t=>g("update:modelValue",t))},{default:a.withCtx(()=>[C.loading?(a.openBlock(),a.createBlock(l,{key:0,label:"正在加载模型…",value:"",disabled:""})):C.models.length?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(l,{key:1,label:"暂无可用模型",value:"",disabled:""})),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.models,t=>(a.openBlock(),a.createBlock(l,{key:t.id,label:`${t.name} · ${t.provider}`,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])])}}}),[["__scopeId","data-v-483ae73d"]]);function dO(C){const{containerRef:I,autoScroll:g=!0,behavior:A="smooth",offset:i=50}=C,l=a.ref(!0),e=a.ref(g);function t(){const Z=I.value;if(!Z)return!0;const{scrollTop:m,scrollHeight:b,clientHeight:G}=Z;return b-m-G<i}async function c(Z=!0){if(!Z&&!e.value)return;await a.nextTick();const m=I.value;m&&m.scrollTo({top:m.scrollHeight,behavior:A})}function d(Z){const m=I.value;m&&m.scrollTo({top:Z,behavior:A})}function o(){e.value=!0}function n(){e.value=!1}function s(){l.value=t(),l.value&&(e.value=!0)}return a.onMounted(()=>{const Z=I.value;Z&&(Z.addEventListener("scroll",s),l.value=t())}),a.onUnmounted(()=>{const Z=I.value;Z&&Z.removeEventListener("scroll",s)}),{scrollToBottom:c,scrollTo:d,isAtBottom:l,autoScrollEnabled:e,checkIfAtBottom:t,enableAutoScroll:o,disableAutoScroll:n}}const rw=Symbol("fg-toast");function oO(C){return{[rw]:C}}function nO(){const C=a.inject(rw);return{show(I,g="info",A){var i;(i=C==null?void 0:C.value)==null||i.show(I,g,A)},info(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"info",g)},success(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"success",g)},warning(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"warning",g)},error(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"error",g)}}}function sO(){async function C(A,i={}){const{title:l="确认操作",type:e="warning",confirmButtonText:t="确定",cancelButtonText:c="取消"}=i;try{return await BC.ElMessageBox.confirm(A,l,{confirmButtonText:t,cancelButtonText:c,type:e}),!0}catch{return!1}}async function I(A,i={}){return C(`此操作将永久删除${A},是否继续?`,{title:"确认删除",type:"warning",confirmButtonText:"确认删除",...i})}async function g(A,i={}){return C(A,{title:"确认操作",type:"warning",...i})}return{confirm:C,confirmDelete:I,confirmDanger:g}}function ZO(){return{success(C,I={}){BC.ElMessage({message:C,type:"success",...I})},error(C,I={}){BC.ElMessage({message:C,type:"error",...I})},warning(C,I={}){BC.ElMessage({message:C,type:"warning",...I})},info(C,I={}){BC.ElMessage({message:C,type:"info",...I})}}}function mO(C,I=300){const g=a.ref(null);function A(...i){g.value&&clearTimeout(g.value),g.value=setTimeout(()=>{C(...i),g.value=null},I)}return a.onUnmounted(()=>{g.value&&clearTimeout(g.value)}),A}function bO(C,I){var t;const g=a.ref(1),A=a.ref((I==null?void 0:I.initialPageSize)??zZ),i=a.computed(()=>{const c=C.value,d=(g.value-1)*A.value;return c.slice(d,d+A.value)}),l=a.computed(()=>C.value.length);function e(){g.value=1}return a.watch(A,()=>{g.value=1},{flush:"sync"}),a.watch(C,c=>{const d=Math.max(1,Math.ceil(c.length/A.value)||1);g.value>d&&(g.value=d)}),(t=I==null?void 0:I.resetOn)!=null&&t.length&&a.watch(I.resetOn,()=>{e()}),{currentPage:g,pageSize:A,pagedItems:i,total:l,resetPage:e}}function GO(C={}){const{timeout:I=15e3,silentError:g=!1}=C,A=a.ref(!1),i=a.ref(null),l=a.ref(!1),e=a.computed(()=>i.value!==null);let t=null,c=0;function d(){c++,c===1&&(A.value=!0,i.value=null,l.value=!1,t=setTimeout(()=>{l.value=!0},I))}function o(){c=Math.max(0,c-1),c===0&&(A.value=!1,l.value=!1,t&&(clearTimeout(t),t=null))}async function n(Z){d();try{return await Z()}catch(m){return g||(i.value=m instanceof Error?m.message:"加载失败"),null}finally{o()}}function s(){c=0,A.value=!1,i.value=null,l.value=!1,t&&(clearTimeout(t),t=null)}return{loading:A,error:i,timedOut:l,hasError:e,withLoading:n,reset:s}}const Zm=new Map;function rO(C){const{url:I,token:g,projectId:A,reconnectInterval:i=3e3,maxRetries:l=1/0}=C;let e=Zm.get(I);e||(e={ws:null,status:a.ref("closed"),refCount:0,handlers:new Map,subscribedProjects:new Set,reconnectTimer:null,pingTimer:null,pongTimer:null,retries:0,reconnectInterval:i,maxRetries:l,intentionalClose:!1,token:g},Zm.set(I,e)),e.refCount+=1,e.reconnectInterval=i,e.maxRetries=l,e.token=g;const t=[],c=e.status,d=()=>a.toValue(A);function o(){e&&(e.pingTimer&&clearInterval(e.pingTimer),e.pongTimer&&clearTimeout(e.pongTimer),e.pingTimer=null,e.pongTimer=null)}function n(){e&&(o(),e.pingTimer=setInterval(()=>{!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN||(e.ws.send(JSON.stringify({action:"ping"})),e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=setTimeout(()=>{var B;(B=e==null?void 0:e.ws)==null||B.close()},6e4))},3e4))}function s(){if(!e||e.intentionalClose)return;if(e.retries>=e.maxRetries){e.status.value="error";return}const B=Math.min(e.reconnectInterval*2**e.retries,3e4);e.retries+=1,e.reconnectTimer&&clearTimeout(e.reconnectTimer),e.reconnectTimer=setTimeout(()=>{G()},B)}function Z(B){if(!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN)return;const W={action:"subscribe",project_id:B??null},w=typeof e.token=="function"?e.token():e.token;if(w&&(W.token=w),!e.subscribedProjects.has(B??null)){if(B==null){e.ws.send(JSON.stringify(W)),e.subscribedProjects.add(null);return}e.ws.send(JSON.stringify(W)),e.subscribedProjects.add(B)}}function m(){if(!e)return;e.subscribedProjects.clear();const B=new Set;let W=!1;for(const Y of e.handlers.values())for(const p of Y){const V=p.getProjectId();V==null?W=!0:B.add(V)}const w=d();w==null?W=!0:B.add(w),W&&Z(void 0);for(const Y of B)Z(Y)}function b(B){if(!e)return;const W=e.handlers.get(B.type);if(W)for(const w of W){const Y=w.getProjectId();Y!=null&&Y!==B.project_id||w.handler(B.data)}}function G(){if(!e)return;if(e.ws&&(e.ws.readyState===WebSocket.OPEN||e.ws.readyState===WebSocket.CONNECTING)){e.ws.readyState===WebSocket.OPEN&&Z(d());return}e.intentionalClose=!1,e.status.value="connecting";const B=new WebSocket(I);e.ws=B,B.onopen=()=>{e&&(e.status.value="open",e.retries=0,n(),m())},B.onmessage=W=>{if(e)try{const w=JSON.parse(String(W.data));if(w.action==="pong"||w.type==="pong"){e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=null;return}typeof w.type=="string"&&b(w)}catch{}},B.onerror=()=>{e&&(e.status.value="error")},B.onclose=()=>{e&&(o(),e.ws=null,e.subscribedProjects.clear(),e.intentionalClose?e.status.value="closed":(e.status.value="closed",s()))}}function r(){if(e){for(const B of t)for(const W of e.handlers.values())W.delete(B);t.length=0}}function h(){var B;e&&(r(),e.refCount=Math.max(0,e.refCount-1),!(e.refCount>0)&&(e.intentionalClose=!0,e.reconnectTimer&&clearTimeout(e.reconnectTimer),o(),(B=e.ws)==null||B.close(),e.ws=null,e.status.value="closed",Zm.delete(I),e=void 0))}function u(B,W){var p;if(!e)return()=>{};let w=e.handlers.get(B);w||(w=new Set,e.handlers.set(B,w));const Y={getProjectId:d,handler:W};return w.add(Y),t.push(Y),((p=e.ws)==null?void 0:p.readyState)===WebSocket.OPEN&&Z(d()),()=>{w==null||w.delete(Y);const V=t.indexOf(Y);V>=0&&t.splice(V,1)}}return G(),a.watch(d,B=>{var W;((W=e==null?void 0:e.ws)==null?void 0:W.readyState)===WebSocket.OPEN&&Z(B)}),a.onUnmounted(()=>{h()}),{status:c,connect:G,disconnect:h,on:u}}function hO(C){if(!C)return"操作失败";if(typeof C=="string")return C;if(C instanceof Error)return C.message||"操作失败";if(typeof C=="object"){const I=C;if(I.message)return I.message;if(I.errors&&typeof I.errors=="object"){const g=[];for(const A of Object.values(I.errors))Array.isArray(A)&&g.push(...A);if(g.length>0)return g.join(";")}if(I.code)return`错误码:${I.code}`}return"操作失败"}const uO="1.15.0",BO="2.14.2",WO="2026-08-27";/*! *****************************************************************************
|
|
72
|
+
`)){const z=R.slice(M+1,S);if(!z.includes(" ")&&z.length<=30){b.value=M,o.value=z,d.value=!0;return}}B()}function w(R){if(d.value){if(R.key==="ArrowDown"){R.preventDefault(),m.value=Math.min(m.value+1,Math.max(s.value.length-1,0));return}if(R.key==="ArrowUp"){R.preventDefault(),m.value=Math.max(m.value-1,0);return}if(R.key==="Enter"&&m.value>=0&&s.value[m.value]){R.preventDefault(),Y(s.value[m.value]);return}if(R.key==="Escape"){R.preventDefault(),B();return}}R.key==="Enter"&&!R.shiftKey&&!d.value&&(R.preventDefault(),V())}function Y(R){var z;const D={id:R.id,type:R.type,label:R.name};t.value.some(k=>k.id===D.id&&k.type===D.type)||t.value.push(D);const S=l.value,M=b.value,F=((z=e.value)==null?void 0:z.selectionStart)??S.length;M>=0&&(l.value=`${S.slice(0,M)}@${R.name} ${S.slice(F)}`),B(),a.nextTick(()=>{var k;return(k=e.value)==null?void 0:k.focus()})}function p(R){t.value.splice(R,1)}function V(){const R=l.value.trim();!R&&t.value.length===0||A.disabled||(i("send",R,[...t.value]),l.value="",t.value=[])}function y(R){c.value&&!c.value.contains(R.target)&&B()}function N(){var R;(R=e.value)==null||R.focus()}return I({focus:N}),a.onMounted(()=>{document.addEventListener("mousedown",y)}),a.onBeforeUnmount(()=>{document.removeEventListener("mousedown",y),G&&clearTimeout(G)}),(R,D)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"wrapperRef",ref:c,class:"apf-mention-input"},[d.value?(a.openBlock(),a.createElementBlock("div",kf,[a.createElementVNode("div",Lf,[a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":D[0]||(D[0]=S=>o.value=S),class:"apf-mention-panel-input",type:"text",placeholder:C.searchPlaceholder,autocomplete:"off"},null,8,Tf),[[a.vModelText,o.value]])]),a.createElementVNode("div",xf,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.tabs,S=>(a.openBlock(),a.createElementBlock("button",{key:S.key,type:"button",class:a.normalizeClass(["apf-mention-tab",{"is-active":n.value===S.key}]),onClick:M=>n.value=S.key},a.toDisplayString(S.label),11,ff))),128))]),a.createElementVNode("div",jf,[Z.value?(a.openBlock(),a.createElementBlock("div",Qf,[...D[2]||(D[2]=[a.createElementVNode("span",{class:"apf-mention-loading-dot"},null,-1),a.createElementVNode("span",{class:"apf-mention-loading-dot"},null,-1),a.createElementVNode("span",{class:"apf-mention-loading-dot"},null,-1)])])):s.value.length>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(s.value,(S,M)=>(a.openBlock(),a.createElementBlock("div",{key:`${S.type}-${S.id}`,class:a.normalizeClass(["apf-mention-result",{"is-highlighted":M===m.value}]),role:"option",onClick:F=>Y(S),onMouseenter:F=>m.value=M},[a.createElementVNode("div",{class:"apf-mention-badge","data-type":S.type},a.toDisplayString(r(S.type)),9,Of),a.createElementVNode("div",Ef,[a.createElementVNode("div",Pf,a.toDisplayString(S.name),1),S.description?(a.openBlock(),a.createElementBlock("div",_f,a.toDisplayString(S.description),1)):a.createCommentVNode("",!0)])],42,Uf))),128)):o.value.trim()?(a.openBlock(),a.createElementBlock("div",qf,a.toDisplayString(C.emptyText),1)):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),t.value.length>0?(a.openBlock(),a.createElementBlock("div",$f,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.value,(S,M)=>(a.openBlock(),a.createElementBlock("div",{key:`${S.type}-${S.id}`,class:"apf-mention-chip"},[a.createElementVNode("span",gj,a.toDisplayString(r(S.type)),1),a.createElementVNode("span",null,a.toDisplayString(S.label),1),a.createElementVNode("button",{type:"button",class:"apf-mention-chip-remove","aria-label":"移除引用",onClick:F=>p(M)}," × ",8,Ij)]))),128))])):a.createCommentVNode("",!0),a.withDirectives(a.createElementVNode("textarea",{ref_key:"textareaRef",ref:e,"onUpdate:modelValue":D[1]||(D[1]=S=>l.value=S),class:"apf-mention-textarea",placeholder:C.placeholder,disabled:C.disabled||C.loading,rows:"1",onInput:W,onKeydown:w},null,40,Cj),[[a.vModelText,l.value]])],512))}}),[["__scopeId","data-v-467928f5"]]),ij={class:"apf-editable-artifact"},lj={class:"apf-editable-artifact__head"},ej={class:"apf-editable-artifact__head-left"},tj={class:"apf-editable-artifact__tag"},aj={key:0,class:"apf-editable-artifact__tag is-danger"},cj={class:"apf-editable-artifact__head-right"},dj={class:"apf-editable-artifact__body"},oj=["placeholder"],nj=["srcdoc"],sj={class:"apf-editable-artifact__footer"},Zj={class:"apf-editable-artifact__hint"},mj=E(a.defineComponent({__name:"EditableArtifactCard",props:{content:{},artifactType:{default:"code"},language:{},sendBackLabel:{default:"回传给助手"},hint:{default:"编辑后可回传给助手继续优化"}},emits:["sendback","copy"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(g.content),l=a.ref("edit");a.watch(()=>g.content,Z=>{i.value=Z});const e=a.computed(()=>g.language||g.artifactType),t=a.computed(()=>g.artifactType==="html"),c=a.computed(()=>g.artifactType==="json"),d=a.computed(()=>{if(!c.value)return null;try{return JSON.parse(i.value),!0}catch{return!1}});function o(){var Z;i.value&&((Z=navigator.clipboard)==null||Z.writeText(i.value),A("copy",i.value))}function n(){if(c.value)try{i.value=JSON.stringify(JSON.parse(i.value),null,2)}catch{}}function s(){i.value.trim()&&A("sendback",i.value,e.value)}return(Z,m)=>(a.openBlock(),a.createElementBlock("div",ij,[a.createElementVNode("div",lj,[a.createElementVNode("div",ej,[m[3]||(m[3]=a.createElementVNode("span",{class:"apf-editable-artifact__title"},"工件",-1)),a.createElementVNode("span",tj,a.toDisplayString(C.artifactType),1),c.value&&d.value===!1?(a.openBlock(),a.createElementBlock("span",aj,"JSON 无效")):a.createCommentVNode("",!0)]),a.createElementVNode("div",cj,[t.value?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:a.normalizeClass(["apf-editable-artifact__mode",{"is-active":l.value==="edit"}]),onClick:m[0]||(m[0]=b=>l.value="edit")}," 编辑 ",2)):a.createCommentVNode("",!0),t.value?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(["apf-editable-artifact__mode",{"is-active":l.value==="preview"}]),onClick:m[1]||(m[1]=b=>l.value="preview")}," 预览 ",2)):a.createCommentVNode("",!0),c.value?(a.openBlock(),a.createElementBlock("button",{key:2,type:"button",class:"apf-editable-artifact__tool",onClick:n}," 格式化 ")):a.createCommentVNode("",!0),a.createElementVNode("button",{type:"button",class:"apf-editable-artifact__tool","aria-label":"复制",onClick:o}," 复制 ")])]),a.createElementVNode("div",dj,[l.value==="edit"?a.withDirectives((a.openBlock(),a.createElementBlock("textarea",{key:0,"onUpdate:modelValue":m[2]||(m[2]=b=>i.value=b),class:"apf-editable-artifact__editor",placeholder:`可编辑 ${C.artifactType} 内容`,spellcheck:"false"},null,8,oj)),[[a.vModelText,i.value]]):(a.openBlock(),a.createElementBlock("iframe",{key:1,class:"apf-editable-artifact__preview",srcdoc:i.value,sandbox:"allow-scripts",title:"artifact preview"},null,8,nj))]),a.createElementVNode("div",sj,[a.createElementVNode("span",Zj,a.toDisplayString(C.hint),1),a.createElementVNode("button",{type:"button",class:"apf-editable-artifact__send",onClick:s},a.toDisplayString(C.sendBackLabel),1)])]))}}),[["__scopeId","data-v-60860f31"]]),bj=E(a.defineComponent({__name:"MessageActionBar",props:{content:{},feedback:{},visible:{type:Boolean},showCopy:{type:Boolean,default:!0},showRegenerate:{type:Boolean,default:!0},showFeedback:{type:Boolean,default:!0}},emits:["copy","regenerate","feedback"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1),l=a.ref(g.feedback??null);let e=null;a.watch(()=>g.feedback,d=>{l.value=d??null}),a.watch(()=>g.visible,d=>{if(d){e=setTimeout(()=>{i.value=!0},300);return}i.value=!1,e&&(clearTimeout(e),e=null)},{immediate:!0});function t(){var d;g.content&&((d=navigator.clipboard)==null||d.writeText(g.content)),A("copy")}function c(d){l.value=l.value===d?null:d,A("feedback",d)}return(d,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-msg-actions",{"is-visible":i.value}])},[C.showCopy?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-msg-actions__btn",title:"复制","aria-label":"复制",onClick:t},[...o[3]||(o[3]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),a.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])])):a.createCommentVNode("",!0),C.showRegenerate?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:"apf-msg-actions__btn",title:"重新生成","aria-label":"重新生成",onClick:o[0]||(o[0]=n=>A("regenerate"))},[...o[4]||(o[4]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("path",{d:"M3 8a5 5 0 0 1 8.5-3.5M13 3v3.5H9.5",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),a.createElementVNode("path",{d:"M13 8a5 5 0 0 1-8.5 3.5M3 13v-3.5H6.5",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):a.createCommentVNode("",!0),C.showFeedback?(a.openBlock(),a.createElementBlock("button",{key:2,type:"button",class:a.normalizeClass(["apf-msg-actions__btn",{"is-active":l.value==="positive"}]),title:"点赞","aria-label":"点赞",onClick:o[1]||(o[1]=n=>c("positive"))},[...o[5]||(o[5]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("path",{d:"M8 2.5 9.6 6l3.9.3-3 2.7.9 3.8L8 10.8 4.6 12.8l.9-3.8-3-2.7L6.4 6 8 2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})],-1)])],2)):a.createCommentVNode("",!0),C.showFeedback?(a.openBlock(),a.createElementBlock("button",{key:3,type:"button",class:a.normalizeClass(["apf-msg-actions__btn apf-msg-actions__btn--down",{"is-active":l.value==="negative"}]),title:"点踩","aria-label":"点踩",onClick:o[2]||(o[2]=n=>c("negative"))},[...o[6]||(o[6]=[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14","aria-hidden":"true"},[a.createElementVNode("path",{d:"M8 2.5 9.6 6l3.9.3-3 2.7.9 3.8L8 10.8 4.6 12.8l.9-3.8-3-2.7L6.4 6 8 2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})],-1)])],2)):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-e20bc750"]]),Gj={class:"apf-step-card__head-left"},rj={class:"apf-step-card__icon","aria-hidden":"true"},hj={key:0,viewBox:"0 0 16 16",width:"14",height:"14"},uj={key:1,viewBox:"0 0 16 16",width:"14",height:"14"},Bj={class:"apf-step-card__titles"},Wj={class:"apf-step-card__title"},wj={key:0,class:"apf-step-card__badge"},Yj={key:0,class:"apf-step-card__subtitle"},Vj={class:"apf-step-card__head-right"},pj={key:0,class:"apf-step-card__time"},yj={key:1,class:"apf-step-card__status"},Nj={class:"apf-step-card__chevron","aria-hidden":"true"},Xj={class:"apf-step-card__body"},Rj=E(a.defineComponent({__name:"CollapsibleStepCard",props:{title:{},subtitle:{},badge:{},statusLabel:{},tone:{default:"default"},timestamp:{},defaultCollapsed:{type:Boolean,default:!0},collapsed:{type:Boolean}},emits:["update:collapsed"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(g.collapsed??g.defaultCollapsed);a.watch(()=>g.collapsed,t=>{t!==void 0&&(i.value=t)});const l=()=>g.collapsed!==void 0?g.collapsed:i.value;function e(){const t=!l();g.collapsed===void 0&&(i.value=t),A("update:collapsed",t)}return(t,c)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-step-card",`is-${C.tone}`])},[a.createElementVNode("button",{type:"button",class:"apf-step-card__head",onClick:e},[a.createElementVNode("div",Gj,[a.createElementVNode("span",rj,[a.renderSlot(t.$slots,"icon",{},()=>[C.tone==="error"?(a.openBlock(),a.createElementBlock("svg",hj,[...c[0]||(c[0]=[a.createElementVNode("circle",{cx:"8",cy:"8",r:"5.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"},null,-1),a.createElementVNode("path",{d:"M8 5v3.5M8 11h.01",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"},null,-1)])])):(a.openBlock(),a.createElementBlock("svg",uj,[...c[1]||(c[1]=[a.createElementVNode("rect",{x:"3",y:"3",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.4"},null,-1),a.createElementVNode("path",{d:"M6 8h4M8 6v4",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"},null,-1)])]))],!0)]),a.createElementVNode("div",Bj,[a.createElementVNode("div",Wj,[a.createTextVNode(a.toDisplayString(C.title)+" ",1),C.badge?(a.openBlock(),a.createElementBlock("span",wj,a.toDisplayString(C.badge),1)):a.createCommentVNode("",!0)]),C.subtitle?(a.openBlock(),a.createElementBlock("div",Yj,a.toDisplayString(C.subtitle),1)):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Vj,[C.timestamp?(a.openBlock(),a.createElementBlock("span",pj,a.toDisplayString(C.timestamp),1)):a.createCommentVNode("",!0),C.statusLabel?(a.openBlock(),a.createElementBlock("span",yj,[c[2]||(c[2]=a.createElementVNode("i",{class:"apf-step-card__dot"},null,-1)),a.createTextVNode(" "+a.toDisplayString(C.statusLabel),1)])):a.createCommentVNode("",!0),a.createElementVNode("span",Nj,a.toDisplayString(l()?"▾":"▴"),1)])]),a.withDirectives(a.createElementVNode("div",Xj,[a.renderSlot(t.$slots,"default",{},void 0,!0)],512),[[a.vShow,!l()]])],2))}}),[["__scopeId","data-v-9cc9ff88"]]),Hj={class:"apf-agent-transfer"},Sj={class:"apf-agent-transfer__row"},Mj={class:"apf-agent-transfer__pill"},Dj={class:"apf-agent-transfer__pill is-target"},Kj={key:0,class:"apf-agent-transfer__reason"},Fj=E(a.defineComponent({__name:"AgentTransferCard",props:{fromLabel:{},toLabel:{},reason:{}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("div",Hj,[a.createElementVNode("div",Sj,[a.createElementVNode("span",Mj,a.toDisplayString(C.fromLabel),1),g[0]||(g[0]=a.createElementVNode("span",{class:"apf-agent-transfer__arrow","aria-hidden":"true"},"→",-1)),a.createElementVNode("span",Dj,a.toDisplayString(C.toLabel),1)]),C.reason?(a.openBlock(),a.createElementBlock("p",Kj,a.toDisplayString(C.reason),1)):a.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ec98ad49"]]),zj={class:"apf-field-list-card__head"},Jj={class:"apf-field-list-card__head-left"},vj={class:"apf-field-list-card__title"},kj={class:"apf-field-list-card__badge"},Lj={class:"apf-field-list-card__body"},Tj={class:"apf-field-list-card__info"},xj={class:"apf-field-list-card__name"},fj={class:"apf-field-list-card__type"},jj={key:0,class:"apf-field-list-card__actions"},Qj=E(a.defineComponent({__name:"FieldListCard",props:{title:{},fields:{},badgeLabel:{},primaryAction:{},secondaryAction:{},compact:{type:Boolean,default:!1}},emits:["primary-action","secondary-action"],setup(C,{emit:I}){const g=C,A=I,i=()=>g.badgeLabel||`${g.fields.length} 个字段`;return(l,e)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-field-list-card",{"is-compact":C.compact}])},[a.createElementVNode("div",zj,[a.createElementVNode("div",Jj,[e[2]||(e[2]=a.createElementVNode("span",{class:"apf-field-list-card__icon","aria-hidden":"true"},[a.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[a.createElementVNode("rect",{x:"2.5",y:"3",width:"11",height:"10",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.3"}),a.createElementVNode("path",{d:"M5 6.5h6M5 9.5h4",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"})])],-1)),a.createElementVNode("span",vj,a.toDisplayString(C.title),1)]),a.createElementVNode("span",kj,a.toDisplayString(i()),1)]),a.createElementVNode("div",Lj,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.fields,(t,c)=>(a.openBlock(),a.createElementBlock("div",{key:c,class:"apf-field-list-card__row"},[a.createElementVNode("div",Tj,[a.createElementVNode("div",xj,a.toDisplayString(t.name),1),a.createElementVNode("div",fj,[a.createTextVNode(a.toDisplayString(t.type),1),t.meta?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(" · "+a.toDisplayString(t.meta),1)],64)):a.createCommentVNode("",!0)])]),a.createElementVNode("span",{class:a.normalizeClass(["apf-field-list-card__flag",{"is-req":t.required}])},a.toDisplayString(t.required?"必填":"可选"),3)]))),128))]),!C.compact&&(C.primaryAction||C.secondaryAction)?(a.openBlock(),a.createElementBlock("div",jj,[C.secondaryAction?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-field-list-card__btn is-ghost",onClick:e[0]||(e[0]=t=>A("secondary-action"))},a.toDisplayString(C.secondaryAction),1)):a.createCommentVNode("",!0),C.primaryAction?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:"apf-field-list-card__btn is-primary",onClick:e[1]||(e[1]=t=>A("primary-action"))},a.toDisplayString(C.primaryAction),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-ee1ab2b6"]]),Uj={class:"apf-flow-strip__head"},Oj={class:"apf-flow-strip__head-left"},Ej={class:"apf-flow-strip__title"},Pj={class:"apf-flow-strip__badge"},_j={class:"apf-flow-strip__body"},qj={key:0,class:"apf-flow-strip__arrow","aria-hidden":"true"},$j=["data-type"],gQ={key:0,class:"apf-flow-strip__actions"},IQ=E(a.defineComponent({__name:"FlowNodeStripCard",props:{title:{},nodes:{},badgeLabel:{},primaryAction:{},secondaryAction:{},compact:{type:Boolean,default:!1}},emits:["primary-action","secondary-action"],setup(C,{emit:I}){const g=C,A=I,i=()=>g.badgeLabel||`${g.nodes.length} 个节点`;return(l,e)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["apf-flow-strip",{"is-compact":C.compact}])},[a.createElementVNode("div",Uj,[a.createElementVNode("div",Oj,[e[2]||(e[2]=a.createStaticVNode('<span class="apf-flow-strip__icon" aria-hidden="true" data-v-1fea171e><svg viewBox="0 0 16 16" width="14" height="14" data-v-1fea171e><circle cx="4" cy="8" r="2" fill="none" stroke="currentColor" stroke-width="1.3" data-v-1fea171e></circle><circle cx="12" cy="8" r="2" fill="none" stroke="currentColor" stroke-width="1.3" data-v-1fea171e></circle><path d="M6 8h4" fill="none" stroke="currentColor" stroke-width="1.3" data-v-1fea171e></path></svg></span>',1)),a.createElementVNode("span",Ej,a.toDisplayString(C.title),1)]),a.createElementVNode("span",Pj,a.toDisplayString(i()),1)]),a.createElementVNode("div",_j,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.nodes,(t,c)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:c},[c>0?(a.openBlock(),a.createElementBlock("div",qj)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:"apf-flow-strip__node","data-type":t.type},a.toDisplayString(t.label),9,$j)],64))),128))]),!C.compact&&(C.primaryAction||C.secondaryAction)?(a.openBlock(),a.createElementBlock("div",gQ,[C.secondaryAction?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:"apf-flow-strip__btn is-ghost",onClick:e[0]||(e[0]=t=>A("secondary-action"))},a.toDisplayString(C.secondaryAction),1)):a.createCommentVNode("",!0),C.primaryAction?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:"apf-flow-strip__btn is-primary",onClick:e[1]||(e[1]=t=>A("primary-action"))},a.toDisplayString(C.primaryAction),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-1fea171e"]]),CQ={class:"apf-token-usage"},AQ={class:"apf-token-usage__head"},iQ={class:"apf-token-usage__title"},lQ={class:"apf-token-usage__body"},eQ={class:"apf-token-usage__stats"},tQ={class:"apf-token-usage__stat"},aQ={class:"apf-token-usage__value"},cQ={class:"apf-token-usage__stat"},dQ={class:"apf-token-usage__value"},oQ={class:"apf-token-usage__stat is-total"},nQ={class:"apf-token-usage__value"},sQ={key:0,class:"apf-token-usage__footer"},ZQ={key:0,class:"apf-token-usage__model"},mQ={key:1,class:"apf-token-usage__cost"},bQ=E(a.defineComponent({__name:"TokenUsageCard",props:{inputTokens:{},outputTokens:{},totalTokens:{},estimatedCost:{},model:{},title:{}},setup(C){const I=C,g=a.computed(()=>I.totalTokens??I.inputTokens+I.outputTokens),A=a.computed(()=>{const l=g.value;return l>=1e6?`${(l/1e6).toFixed(2)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)}),i=a.computed(()=>{const l=I.estimatedCost;return l==null?null:l<.01?"<$0.01":`$${l.toFixed(4)}`});return(l,e)=>(a.openBlock(),a.createElementBlock("div",CQ,[a.createElementVNode("div",AQ,[a.createElementVNode("span",iQ,a.toDisplayString(C.title||"Token 消耗"),1)]),a.createElementVNode("div",lQ,[a.createElementVNode("div",eQ,[a.createElementVNode("div",tQ,[e[0]||(e[0]=a.createElementVNode("span",{class:"apf-token-usage__label"},"输入",-1)),a.createElementVNode("span",aQ,a.toDisplayString(C.inputTokens.toLocaleString()),1)]),a.createElementVNode("div",cQ,[e[1]||(e[1]=a.createElementVNode("span",{class:"apf-token-usage__label"},"输出",-1)),a.createElementVNode("span",dQ,a.toDisplayString(C.outputTokens.toLocaleString()),1)]),a.createElementVNode("div",oQ,[e[2]||(e[2]=a.createElementVNode("span",{class:"apf-token-usage__label"},"总计",-1)),a.createElementVNode("span",nQ,a.toDisplayString(A.value),1)])]),i.value||C.model?(a.openBlock(),a.createElementBlock("div",sQ,[C.model?(a.openBlock(),a.createElementBlock("span",ZQ,a.toDisplayString(C.model),1)):a.createCommentVNode("",!0),i.value?(a.openBlock(),a.createElementBlock("span",mQ,a.toDisplayString(i.value),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-0aacc361"]]),GQ={class:"apf-questionnaire"},rQ={class:"apf-questionnaire__head"},hQ={class:"apf-questionnaire__title"},uQ=["data-status"],BQ={key:0,class:"apf-questionnaire__desc"},WQ={key:1,class:"apf-questionnaire__list"},wQ={class:"apf-questionnaire__q"},YQ={key:0,class:"apf-questionnaire__req"},VQ={key:0,class:"apf-questionnaire__options"},pQ=["name","value","checked","disabled","onChange"],yQ=["value","disabled","onInput"],NQ={key:2,class:"apf-questionnaire__actions"},XQ=["disabled"],RQ=E(a.defineComponent({__name:"QuestionnaireCard",props:{title:{},description:{},questions:{},answers:{default:()=>({})},status:{default:"waiting"},approveLabel:{default:"批准"},rejectLabel:{default:"拒绝"},disabled:{type:Boolean}},emits:["answer","approve","reject"],setup(C,{emit:I}){const g=C,A=I,i=()=>g.status==="approved"?"已批准":g.status==="rejected"?"已拒绝":"待审批",l=()=>g.questions.filter(c=>c.required).every(c=>!!g.answers[c.id]),e=()=>g.status==="waiting"&&!g.disabled;return(t,c)=>(a.openBlock(),a.createElementBlock("div",GQ,[a.createElementVNode("div",rQ,[a.createElementVNode("span",hQ,a.toDisplayString(C.title),1),a.createElementVNode("span",{class:"apf-questionnaire__status","data-status":C.status},a.toDisplayString(i()),9,uQ)]),C.description?(a.openBlock(),a.createElementBlock("p",BQ,a.toDisplayString(C.description),1)):a.createCommentVNode("",!0),C.questions.length?(a.openBlock(),a.createElementBlock("div",WQ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.questions,d=>{var o;return a.openBlock(),a.createElementBlock("div",{key:d.id,class:"apf-questionnaire__item"},[a.createElementVNode("div",wQ,[d.required?(a.openBlock(),a.createElementBlock("span",YQ,"*")):a.createCommentVNode("",!0),a.createTextVNode(" "+a.toDisplayString(d.question),1)]),(o=d.options)!=null&&o.length?(a.openBlock(),a.createElementBlock("div",VQ,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.options,n=>(a.openBlock(),a.createElementBlock("label",{key:n,class:"apf-questionnaire__opt"},[a.createElementVNode("input",{type:"radio",name:d.id,value:n,checked:C.answers[d.id]===n,disabled:!e(),onChange:s=>A("answer",d.id,n)},null,40,pQ),a.createTextVNode(" "+a.toDisplayString(n),1)]))),128))])):(a.openBlock(),a.createElementBlock("input",{key:1,class:"apf-questionnaire__input",type:"text",value:C.answers[d.id]||"",placeholder:"请输入...",disabled:!e(),onInput:n=>A("answer",d.id,n.target.value)},null,40,yQ))])}),128))])):a.createCommentVNode("",!0),e()?(a.openBlock(),a.createElementBlock("div",NQ,[a.createElementVNode("button",{type:"button",class:"apf-questionnaire__btn is-ghost",onClick:c[0]||(c[0]=d=>A("reject"))},a.toDisplayString(C.rejectLabel),1),a.createElementVNode("button",{type:"button",class:"apf-questionnaire__btn is-primary",disabled:!l(),onClick:c[1]||(c[1]=d=>A("approve"))},a.toDisplayString(C.approveLabel),9,XQ)])):a.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-0e4beff5"]]),HQ=["onClick"],SQ=["onClick"],MQ={key:0},DQ={key:1},KQ=E(a.defineComponent({__name:"ChecklistProposalCard",props:{proposal:{},status:{},selectedIds:{},readonly:{type:Boolean}},emits:["toggle-item","toggle-all","approve","reject","modify","reset"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(new Set(g.proposal.actionItems.map(B=>B.id))),l=a.computed(()=>g.selectedIds??i.value),e=a.computed(()=>l.value.size),t=a.computed(()=>e.value===g.proposal.actionItems.length&&g.proposal.actionItems.length>0),c={high:{label:"高",color:"#F56C6C",bgColor:"#fef0f0"},medium:{label:"中",color:"#E6A23C",bgColor:"#fdf6ec"},low:{label:"低",color:"#67C23A",bgColor:"#f0f9eb"}},d={todo:{icon:"document",label:"待办"},approval:{icon:"stamp",label:"审批"},review:{icon:"view",label:"审阅"},decision:{icon:"warning",label:"决策"}},o=a.ref(null),n=a.ref({});function s(B){g.readonly||g.status==="approved"||g.status==="rejected"||(g.selectedIds?A("toggle-item",B):i.value.has(B)?i.value.delete(B):i.value.add(B))}function Z(){g.readonly||g.status==="approved"||g.status==="rejected"||(g.selectedIds?A("toggle-all"):t.value?i.value.clear():g.proposal.actionItems.forEach(B=>i.value.add(B.id)))}function m(B){o.value=B.id,n.value={...B}}function b(){o.value&&n.value&&(A("modify",o.value,n.value),o.value=null,n.value={})}function G(){o.value=null,n.value={}}function r(){A("approve",Array.from(l.value))}function h(){A("reject")}function u(){A("reset")}return(B,W)=>{var w;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([B.$style.card,C.status==="approved"&&B.$style.cardApproved,C.status==="rejected"&&B.$style.cardRejected])},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.titleRow)},[a.createVNode(a.unref($),{name:"circle-check-filled",size:16,style:{color:"#409EFF"}}),a.createElementVNode("span",{class:a.normalizeClass(B.$style.title)},"智能拟办",2),C.proposal.documentTitle?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(B.$style.docTitle)},a.toDisplayString(C.proposal.documentTitle),3)):a.createCommentVNode("",!0)],2),!C.status||C.status==="pending"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(B.$style.countBadge)},a.toDisplayString(e.value)+"/"+a.toDisplayString(C.proposal.actionItems.length)+" 项 ",3)):C.status==="approved"?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass([B.$style.statusBadge,B.$style.statusApproved])},[a.createVNode(a.unref($),{name:"check",size:12}),W[7]||(W[7]=a.createTextVNode(" 已批准 ",-1))],2)):C.status==="rejected"?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([B.$style.statusBadge,B.$style.statusRejected])},[a.createVNode(a.unref($),{name:"close",size:12}),W[8]||(W[8]=a.createTextVNode(" 已拒绝 ",-1))],2)):a.createCommentVNode("",!0)],2),C.proposal.summary?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(B.$style.summary)},a.toDisplayString(C.proposal.summary),3)):a.createCommentVNode("",!0),(!C.status||C.status==="pending")&&!C.readonly?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(B.$style.selectAllRow)},[a.createElementVNode("label",{class:a.normalizeClass(B.$style.checkbox),onClick:Z},[a.createElementVNode("span",{class:a.normalizeClass([B.$style.checkboxInner,t.value&&B.$style.checked])},[t.value?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:"check",size:10})):a.createCommentVNode("",!0)],2),W[9]||(W[9]=a.createElementVNode("span",null,"全选",-1))],2)],2)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.proposal.actionItems,Y=>{var p,V,y,N,H;return a.openBlock(),a.createElementBlock("div",{key:Y.id,class:a.normalizeClass([B.$style.item,l.value.has(Y.id)&&B.$style.itemSelected,o.value===Y.id&&B.$style.itemEditing])},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemHeader),onClick:R=>s(Y.id)},[a.createElementVNode("label",{class:a.normalizeClass(B.$style.checkbox),onClick:W[0]||(W[0]=a.withModifiers(()=>{},["stop"]))},[a.createElementVNode("span",{class:a.normalizeClass([B.$style.checkboxInner,l.value.has(Y.id)&&B.$style.checked])},[l.value.has(Y.id)?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:"check",size:10})):a.createCommentVNode("",!0)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemBadges)},[Y.priority?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(B.$style.priorityBadge),style:a.normalizeStyle({color:(p=c[Y.priority])==null?void 0:p.color,background:(V=c[Y.priority])==null?void 0:V.bgColor})},a.toDisplayString(((y=c[Y.priority])==null?void 0:y.label)??Y.priority),7)):a.createCommentVNode("",!0),Y.type?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(B.$style.typeBadge)},[a.createVNode(a.unref($),{name:((N=d[Y.type])==null?void 0:N.icon)??"document",size:12},null,8,["name"]),a.createTextVNode(" "+a.toDisplayString(((H=d[Y.type])==null?void 0:H.label)??Y.type),1)],2)):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemTitle)},a.toDisplayString(Y.title),3),!C.readonly&&(!C.status||C.status==="pending")?(a.openBlock(),a.createElementBlock("button",{key:0,class:a.normalizeClass(B.$style.editBtn),onClick:a.withModifiers(R=>m(Y),["stop"])},[a.createVNode(a.unref($),{name:"edit",size:12})],10,SQ)):a.createCommentVNode("",!0)],10,HQ),o.value===Y.id?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(B.$style.editForm)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[10]||(W[10]=a.createElementVNode("label",null,"标题",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":W[1]||(W[1]=R=>n.value.title=R),class:a.normalizeClass(B.$style.editInput)},null,2),[[a.vModelText,n.value.title]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[11]||(W[11]=a.createElementVNode("label",null,"描述",-1)),a.withDirectives(a.createElementVNode("textarea",{"onUpdate:modelValue":W[2]||(W[2]=R=>n.value.description=R),class:a.normalizeClass(B.$style.editTextarea),rows:"2"},null,2),[[a.vModelText,n.value.description]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRowInline)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[12]||(W[12]=a.createElementVNode("label",null,"负责人",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":W[3]||(W[3]=R=>n.value.assignee=R),class:a.normalizeClass(B.$style.editInput),placeholder:"可选"},null,2),[[a.vModelText,n.value.assignee]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[13]||(W[13]=a.createElementVNode("label",null,"截止日期",-1)),a.withDirectives(a.createElementVNode("input",{"onUpdate:modelValue":W[4]||(W[4]=R=>n.value.deadline=R),class:a.normalizeClass(B.$style.editInput),placeholder:"可选"},null,2),[[a.vModelText,n.value.deadline]])],2)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRowInline)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[15]||(W[15]=a.createElementVNode("label",null,"优先级",-1)),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":W[5]||(W[5]=R=>n.value.priority=R),class:a.normalizeClass(B.$style.editSelect)},[...W[14]||(W[14]=[a.createElementVNode("option",{value:"high"},"高",-1),a.createElementVNode("option",{value:"medium"},"中",-1),a.createElementVNode("option",{value:"low"},"低",-1)])],2),[[a.vModelSelect,n.value.priority]])],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editRow)},[W[17]||(W[17]=a.createElementVNode("label",null,"类型",-1)),a.withDirectives(a.createElementVNode("select",{"onUpdate:modelValue":W[6]||(W[6]=R=>n.value.type=R),class:a.normalizeClass(B.$style.editSelect)},[...W[16]||(W[16]=[a.createElementVNode("option",{value:"todo"},"待办",-1),a.createElementVNode("option",{value:"approval"},"审批",-1),a.createElementVNode("option",{value:"review"},"审阅",-1),a.createElementVNode("option",{value:"decision"},"决策",-1)])],2),[[a.vModelSelect,n.value.type]])],2)],2),a.createElementVNode("div",{class:a.normalizeClass(B.$style.editActions)},[a.createElementVNode("button",{class:a.normalizeClass(B.$style.saveBtn),onClick:b},"保存",2),a.createElementVNode("button",{class:a.normalizeClass(B.$style.cancelBtn),onClick:G},"取消",2)],2)],2)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(B.$style.itemBody)},[a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemDesc)},a.toDisplayString(Y.description),3),a.createElementVNode("div",{class:a.normalizeClass(B.$style.itemMeta)},[Y.assignee?(a.openBlock(),a.createElementBlock("span",MQ,[a.createVNode(a.unref($),{name:"user",size:12}),a.createTextVNode(" "+a.toDisplayString(Y.assignee),1)])):a.createCommentVNode("",!0),Y.deadline?(a.openBlock(),a.createElementBlock("span",DQ,[a.createVNode(a.unref($),{name:"clock",size:12}),a.createTextVNode(" "+a.toDisplayString(Y.deadline),1)])):a.createCommentVNode("",!0)],2)],2))],2)}),128))],2),(w=C.proposal.approvalChain)!=null&&w.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(B.$style.chain)},[a.createElementVNode("span",{class:a.normalizeClass(B.$style.chainLabel)},"审批链:",2),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.proposal.approvalChain,(Y,p)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:p},[a.createElementVNode("span",{class:a.normalizeClass(B.$style.chainPerson)},a.toDisplayString(Y),3),p<C.proposal.approvalChain.length-1?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(B.$style.chainArrow)},"→",2)):a.createCommentVNode("",!0)],64))),128))],2)):a.createCommentVNode("",!0),C.readonly?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(B.$style.actions)},[!C.status||C.status==="pending"?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("button",{class:a.normalizeClass(B.$style.approveBtn),onClick:r},[a.createVNode(a.unref($),{name:"check",size:14}),a.createTextVNode(" 确认执行 ("+a.toDisplayString(e.value)+" 项) ",1)],2),a.createElementVNode("button",{class:a.normalizeClass(B.$style.rejectBtn),onClick:h},[a.createVNode(a.unref($),{name:"close",size:14}),W[18]||(W[18]=a.createTextVNode(" 暂不执行 ",-1))],2)],64)):(a.openBlock(),a.createElementBlock("button",{key:1,class:a.normalizeClass(B.$style.resetBtn),onClick:u},[a.createVNode(a.unref($),{name:"refresh",size:14}),W[19]||(W[19]=a.createTextVNode(" 重新审核 ",-1))],2))],2))],2)}}}),[["__cssModules",{$style:{card:"_card_yghuq_2",cardApproved:"_cardApproved_yghuq_9",cardRejected:"_cardRejected_yghuq_14",header:"_header_yghuq_20",titleRow:"_titleRow_yghuq_27",title:"_title_yghuq_27",docTitle:"_docTitle_yghuq_39",countBadge:"_countBadge_yghuq_47",statusBadge:"_statusBadge_yghuq_53",statusApproved:"_statusApproved_yghuq_63",statusRejected:"_statusRejected_yghuq_68",summary:"_summary_yghuq_74",selectAllRow:"_selectAllRow_yghuq_85",checkbox:"_checkbox_yghuq_89",checkboxInner:"_checkboxInner_yghuq_99",checked:"_checked_yghuq_110",itemList:"_itemList_yghuq_117",item:"_item_yghuq_117",itemSelected:"_itemSelected_yghuq_136",itemEditing:"_itemEditing_yghuq_141",itemHeader:"_itemHeader_yghuq_145",itemBadges:"_itemBadges_yghuq_151",priorityBadge:"_priorityBadge_yghuq_156",typeBadge:"_typeBadge_yghuq_163",itemTitle:"_itemTitle_yghuq_171",editBtn:"_editBtn_yghuq_178",itemBody:"_itemBody_yghuq_194",itemDesc:"_itemDesc_yghuq_199",itemMeta:"_itemMeta_yghuq_206",editForm:"_editForm_yghuq_220",editRow:"_editRow_yghuq_225",editInput:"_editInput_yghuq_236",editTextarea:"_editTextarea_yghuq_237",editSelect:"_editSelect_yghuq_238",editRowInline:"_editRowInline_yghuq_260",editActions:"_editActions_yghuq_270",saveBtn:"_saveBtn_yghuq_276",cancelBtn:"_cancelBtn_yghuq_277",chain:"_chain_yghuq_309",chainLabel:"_chainLabel_yghuq_321",chainPerson:"_chainPerson_yghuq_325",chainArrow:"_chainArrow_yghuq_331",actions:"_actions_yghuq_337",approveBtn:"_approveBtn_yghuq_344",rejectBtn:"_rejectBtn_yghuq_345",resetBtn:"_resetBtn_yghuq_346"}}]]),FQ=["onClick"],zQ=E(a.defineComponent({__name:"RequirementAnalysisCard",props:{analysis:{},partialAnswers:{default:()=>({})},nextQuestionId:{default:null},waitingConfirmation:{type:Boolean,default:!0}},emits:["answer","skip"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>({...g.partialAnswers})),l=a.computed(()=>({simple:"简单",medium:"中等",complex:"复杂"})[g.analysis.complexity]||g.analysis.complexity),e=a.computed(()=>{const s=g.analysis.completeness.score;return s>=80?"success":s>=60?"warning":"danger"}),t=a.computed(()=>g.analysis.confirmQuestions.filter(s=>s.required).every(s=>{var Z;return(Z=i.value[s.id])==null?void 0:Z.trim()}));function c(){A("skip")}function d(s,Z){g.waitingConfirmation&&A("answer",s,Z)}function o(s){var Z;return!!((Z=i.value[s])!=null&&Z.trim())}function n(s){return g.waitingConfirmation&&g.nextQuestionId===s}return(s,Z)=>{const m=a.resolveComponent("el-tag"),b=a.resolveComponent("el-progress");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(s.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.summary)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryHeader)},[a.createVNode(a.unref($),{name:"data-board",size:16}),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryTitle)},"需求分析结果",2)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryGrid)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"意图",2),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryValue)},a.toDisplayString(C.analysis.intent),3)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"类型",2),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryValue)},a.toDisplayString(C.analysis.type),3)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"复杂度",2),a.createVNode(m,{type:C.analysis.complexity==="complex"?"danger":C.analysis.complexity==="medium"?"warning":"success",size:"small"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.value),1)]),_:1},8,["type"])],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.summaryItem)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryLabel)},"完整性",2),a.createVNode(b,{percentage:C.analysis.completeness.score,color:e.value==="success"?"#67c23a":e.value==="warning"?"#e6a23c":"#f56c6c","stroke-width":8,"show-text":!1,style:{width:"80px"}},null,8,["percentage","color"]),a.createElementVNode("span",{class:a.normalizeClass(s.$style.summaryValue)},a.toDisplayString(C.analysis.completeness.score)+"%",3)],2)],2),C.analysis.completeness.missing.length>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.missingSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.missingTitle)},[a.createVNode(a.unref($),{name:"warning",size:14}),Z[0]||(Z[0]=a.createElementVNode("span",null,"缺失信息",-1))],2),a.createElementVNode("ul",{class:a.normalizeClass(s.$style.missingList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.completeness.missing,(G,r)=>(a.openBlock(),a.createElementBlock("li",{key:r},a.toDisplayString(G),1))),128))],2)],2)):a.createCommentVNode("",!0),C.analysis.completeness.assumptions.length>0?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.assumptionsSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.assumptionsTitle)},[a.createVNode(a.unref($),{name:"info-filled",size:14}),Z[1]||(Z[1]=a.createElementVNode("span",null,"AI 假设",-1))],2),a.createElementVNode("ul",{class:a.normalizeClass(s.$style.assumptionsList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.completeness.assumptions,(G,r)=>(a.openBlock(),a.createElementBlock("li",{key:r},a.toDisplayString(G),1))),128))],2)],2)):a.createCommentVNode("",!0)],2),C.analysis.suggestedChain.length>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.chainSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainTitle)},[a.createVNode(a.unref($),{name:"list",size:14}),Z[2]||(Z[2]=a.createElementVNode("span",null,"执行计划",-1))],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.suggestedChain,(G,r)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:a.normalizeClass(s.$style.chainItem)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainStep)},a.toDisplayString(r+1),3),a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainContent)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainAgent)},a.toDisplayString(G.agent),3),a.createElementVNode("div",{class:a.normalizeClass(s.$style.chainDesc)},a.toDisplayString(G.description),3)],2)],2))),128))],2)],2)):a.createCommentVNode("",!0),C.analysis.confirmQuestions.length>0?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.questionsSection)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.questionsTitle)},[a.createVNode(a.unref($),{name:"question-filled",size:14}),Z[3]||(Z[3]=a.createElementVNode("span",null,"请确认以下信息",-1)),C.waitingConfirmation&&!t.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(s.$style.progressHint)}," 在下方输入框逐条回复,答完必填项后自动继续 ",2)):C.waitingConfirmation&&t.value?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(s.$style.progressHint)}," 必填项已完成,发送任意内容或直接点选以继续 ",2)):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.questionsList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.analysis.confirmQuestions,G=>(a.openBlock(),a.createElementBlock("div",{key:G.id,class:a.normalizeClass([s.$style.questionItem,n(G.id)&&s.$style.questionItemActive,o(G.id)&&s.$style.questionItemDone])},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.questionText)},[o(G.id)?(a.openBlock(),a.createBlock(a.unref($),{key:0,name:"circle-check",size:14,class:a.normalizeClass(s.$style.answeredIcon)},null,8,["class"])):a.createCommentVNode("",!0),a.createTextVNode(" "+a.toDisplayString(G.question)+" ",1),G.required?(a.openBlock(),a.createElementBlock("span",{key:1,class:a.normalizeClass(s.$style.required)},"*",2)):a.createCommentVNode("",!0)],2),o(G.id)?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.answeredValue)},a.toDisplayString(i.value[G.id]),3)):G.options&&G.options.length>0?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.optionsList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(G.options,(r,h)=>(a.openBlock(),a.createElementBlock("div",{key:r,class:a.normalizeClass([s.$style.optionItem,{[s.$style.optionDisabled]:!C.waitingConfirmation}]),onClick:u=>C.waitingConfirmation&&d(G.id,r)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.optionIndex)},a.toDisplayString(h+1),3),a.createElementVNode("span",{class:a.normalizeClass(s.$style.optionText)},a.toDisplayString(r),3)],10,FQ))),128))],2)):n(G.id)?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(s.$style.inputHint)}," 请在下方输入框回复 ",2)):a.createCommentVNode("",!0)],2))),128))],2)],2)):a.createCommentVNode("",!0),C.waitingConfirmation?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(s.$style.actions)},[a.createElementVNode("button",{type:"button",class:a.normalizeClass(s.$style.skipLink),onClick:c}," 跳过,直接执行 ",2)],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{card:"_card_8r8st_2",summary:"_summary_8r8st_10",summaryHeader:"_summaryHeader_8r8st_15",summaryTitle:"_summaryTitle_8r8st_24",summaryGrid:"_summaryGrid_8r8st_28",summaryItem:"_summaryItem_8r8st_34",summaryLabel:"_summaryLabel_8r8st_40",summaryValue:"_summaryValue_8r8st_46",missingSection:"_missingSection_8r8st_52",missingTitle:"_missingTitle_8r8st_59",missingList:"_missingList_8r8st_69",assumptionsSection:"_assumptionsSection_8r8st_81",assumptionsTitle:"_assumptionsTitle_8r8st_88",assumptionsList:"_assumptionsList_8r8st_98",chainSection:"_chainSection_8r8st_110",chainTitle:"_chainTitle_8r8st_115",chainList:"_chainList_8r8st_125",chainItem:"_chainItem_8r8st_131",chainStep:"_chainStep_8r8st_137",chainContent:"_chainContent_8r8st_151",chainAgent:"_chainAgent_8r8st_155",chainDesc:"_chainDesc_8r8st_161",questionsSection:"_questionsSection_8r8st_167",questionsTitle:"_questionsTitle_8r8st_171",progressHint:"_progressHint_8r8st_182",questionItemActive:"_questionItemActive_8r8st_188",questionItemDone:"_questionItemDone_8r8st_195",answeredIcon:"_answeredIcon_8r8st_199",answeredValue:"_answeredValue_8r8st_204",inputHint:"_inputHint_8r8st_210",optionDisabled:"_optionDisabled_8r8st_216",questionsList:"_questionsList_8r8st_221",questionItem:"_questionItem_8r8st_188",questionText:"_questionText_8r8st_233",required:"_required_8r8st_238",optionsList:"_optionsList_8r8st_243",optionItem:"_optionItem_8r8st_249",optionSelected:"_optionSelected_8r8st_265",optionIndex:"_optionIndex_8r8st_270",optionText:"_optionText_8r8st_289",actions:"_actions_8r8st_295",skipLink:"_skipLink_8r8st_303"}}]]),Ii={card:"_card_6xf4y_1",header:"_header_6xf4y_9",title:"_title_6xf4y_16",filename:"_filename_6xf4y_22",summary:"_summary_6xf4y_27",points:"_points_6xf4y_34",section:"_section_6xf4y_44",sectionTitle:"_sectionTitle_6xf4y_48",sectionContent:"_sectionContent_6xf4y_55"},JQ=a.defineComponent({__name:"DocumentDetailSummaryCard",props:{item:{}},setup(C){return(I,g)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(a.unref(Ii).card)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).header)},[a.createVNode(a.unref($),{name:"document",size:16}),a.createElementVNode("div",null,[a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).title)},a.toDisplayString(C.item.summary.title),3),a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).filename)},a.toDisplayString(C.item.filename),3)])],2),a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).summary)},a.toDisplayString(C.item.summary.summary),3),C.item.summary.keyPoints.length?(a.openBlock(),a.createElementBlock("ul",{key:0,class:a.normalizeClass(a.unref(Ii).points)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.item.summary.keyPoints,(A,i)=>(a.openBlock(),a.createElementBlock("li",{key:i},a.toDisplayString(A),1))),128))],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.item.summary.sections,(A,i)=>(a.openBlock(),a.createElementBlock("div",{key:i,class:a.normalizeClass(a.unref(Ii).section)},[a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).sectionTitle)},a.toDisplayString(A.heading),3),a.createElementVNode("div",{class:a.normalizeClass(a.unref(Ii).sectionContent)},a.toDisplayString(A.content),3)],2))),128))],2))}}),vQ=["disabled","onClick"],kQ=E(a.defineComponent({__name:"ErrorRecoveryCard",props:{error:{},nodeName:{},nodeType:{},strategies:{}},emits:["select"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-tag");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(A.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.header)},[a.createVNode(a.unref($),{name:"warning-filled",size:14,class:a.normalizeClass(A.$style.headerIcon)},null,8,["class"]),a.createElementVNode("span",{class:a.normalizeClass(A.$style.title)},"执行错误",2)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.body)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.errorInfo)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.nodeInfo)},[a.createElementVNode("span",{class:a.normalizeClass(A.$style.nodeLabel)},"节点:",2),a.createElementVNode("span",{class:a.normalizeClass(A.$style.nodeName)},a.toDisplayString(C.nodeName),3),C.nodeType?(a.openBlock(),a.createBlock(l,{key:0,size:"small",type:"info"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(C.nodeType),1)]),_:1})):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.errorMessage)},[a.createVNode(a.unref($),{name:"circle-close-filled",size:14}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategies)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategyLabel)},"选择恢复策略:",2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategyList)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.strategies,e=>(a.openBlock(),a.createElementBlock("button",{key:e.value,class:a.normalizeClass([A.$style.strategyBtn,e.disabled&&A.$style.strategyDisabled]),disabled:e.disabled,onClick:t=>g("select",e.value)},[a.createVNode(a.unref($),{name:e.icon,size:16},null,8,["name"]),a.createElementVNode("div",{class:a.normalizeClass(A.$style.strategyInfo)},[a.createElementVNode("span",{class:a.normalizeClass(A.$style.strategyName)},a.toDisplayString(e.label),3),a.createElementVNode("span",{class:a.normalizeClass(A.$style.strategyDesc)},a.toDisplayString(e.description),3)],2)],10,vQ))),128))],2)],2)],2)],2)}}}),[["__cssModules",{$style:{card:"_card_170h5_2",header:"_header_170h5_8",headerIcon:"_headerIcon_170h5_17",title:"_title_170h5_21",body:"_body_170h5_27",errorInfo:"_errorInfo_170h5_31",nodeInfo:"_nodeInfo_170h5_35",nodeLabel:"_nodeLabel_170h5_42",nodeName:"_nodeName_170h5_47",errorMessage:"_errorMessage_170h5_53",strategies:"_strategies_170h5_65",strategyLabel:"_strategyLabel_170h5_70",strategyList:"_strategyList_170h5_76",strategyBtn:"_strategyBtn_170h5_82",strategyDisabled:"_strategyDisabled_170h5_104",strategyInfo:"_strategyInfo_170h5_108",strategyName:"_strategyName_170h5_114",strategyDesc:"_strategyDesc_170h5_120"}}]]),LQ=E(a.defineComponent({__name:"VariableDiffCard",props:{nodeName:{},changes:{}},setup(C){const I=C,g=a.computed(()=>I.changes.length>0);function A(l){return l==null?"null":typeof l=="string"?l:JSON.stringify(l,null,2)}function i(l){switch(l.type){case"add":return{icon:"plus",color:"var(--el-color-success, #67c23a)",label:"新增"};case"update":return{icon:"edit",color:"var(--el-color-primary, #409eff)",label:"更新"};case"delete":return{icon:"delete",color:"var(--el-color-danger, #f56c6c)",label:"删除"};default:return{icon:"info-filled",color:"var(--el-color-info, #909399)",label:"变更"}}}return(l,e)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(l.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerLeft)},[a.createVNode(a.unref($),{name:"data-line",size:14,class:a.normalizeClass(l.$style.headerIcon)},null,8,["class"]),a.createElementVNode("span",{class:a.normalizeClass(l.$style.title)},"变量变更",2)],2),C.nodeName?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(l.$style.nodeInfo)},a.toDisplayString(C.nodeName),3)):a.createCommentVNode("",!0)],2),g.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(l.$style.body)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.changes,(t,c)=>(a.openBlock(),a.createElementBlock("div",{key:c,class:a.normalizeClass(l.$style.change)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.changeHeader)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.changeType)},[a.createVNode(a.unref($),{name:i(t).icon,size:12,style:a.normalizeStyle({color:i(t).color})},null,8,["name","style"]),a.createElementVNode("span",{style:a.normalizeStyle({color:i(t).color})},a.toDisplayString(i(t).label),5)],2),a.createElementVNode("span",{class:a.normalizeClass(l.$style.varName)},a.toDisplayString(t.name),3)],2),t.type==="update"?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(l.$style.diff)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.diffOld)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.diffLabel)},"旧值",2),a.createElementVNode("pre",{class:a.normalizeClass(l.$style.diffValue)},a.toDisplayString(A(t.oldValue)),3)],2),a.createElementVNode("div",{class:a.normalizeClass(l.$style.diffNew)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.diffLabel)},"新值",2),a.createElementVNode("pre",{class:a.normalizeClass(l.$style.diffValue)},a.toDisplayString(A(t.newValue)),3)],2)],2)):t.type==="add"?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(l.$style.singleValue)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.diffLabel)},"值",2),a.createElementVNode("pre",{class:a.normalizeClass(l.$style.diffValue)},a.toDisplayString(A(t.newValue)),3)],2)):a.createCommentVNode("",!0)],2))),128))],2)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(l.$style.empty)}," 暂无变量变更 ",2))],2))}}),[["__cssModules",{$style:{card:"_card_1byhf_2",header:"_header_1byhf_8",headerLeft:"_headerLeft_1byhf_17",headerIcon:"_headerIcon_1byhf_23",title:"_title_1byhf_27",nodeInfo:"_nodeInfo_1byhf_33",body:"_body_1byhf_38",change:"_change_1byhf_45",changeHeader:"_changeHeader_1byhf_51",changeType:"_changeType_1byhf_59",varName:"_varName_1byhf_67",diff:"_diff_1byhf_73",diffOld:"_diffOld_1byhf_78",diffNew:"_diffNew_1byhf_84",singleValue:"_singleValue_1byhf_89",diffLabel:"_diffLabel_1byhf_93",diffValue:"_diffValue_1byhf_100",empty:"_empty_1byhf_108"}}]]),TQ=E(a.defineComponent({__name:"SubWorkflowStatusCard",props:{workflowName:{},status:{},durationMs:{},error:{},nodeCount:{},completedNodes:{}},emits:["detail","retry"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1),l=a.computed(()=>{switch(g.status){case"running":return"loading";case"success":return"circle-check";case"error":return"circle-close-filled";case"waiting":return"clock";case"cancelled":return"minus";default:return"more-filled"}}),e=a.computed(()=>{switch(g.status){case"running":return"执行中";case"success":return"成功";case"error":return"失败";case"waiting":return"待确认";case"cancelled":return"已取消";default:return"等待"}}),t=a.computed(()=>{switch(g.status){case"running":return"primary";case"success":return"success";case"error":return"danger";case"waiting":return"warning";default:return"info"}}),c=a.computed(()=>{const s=g.durationMs;return s==null?"":s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`}),d=a.computed(()=>g.nodeCount??0),o=a.computed(()=>g.completedNodes??0),n=a.computed(()=>d.value===0?0:Math.round(o.value/d.value*100));return(s,Z)=>{const m=a.resolveComponent("el-tag"),b=a.resolveComponent("el-progress"),G=a.resolveComponent("el-button");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(s.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.header),onClick:Z[0]||(Z[0]=r=>i.value=!i.value)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.iconWrap)},[a.createVNode(a.unref($),{name:l.value,size:16,class:a.normalizeClass(C.status==="running"&&s.$style.iconSpin)},null,8,["name","class"])],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.info)},[a.createElementVNode("span",{class:a.normalizeClass(s.$style.name)},"子工作流:"+a.toDisplayString(C.workflowName),3),a.createElementVNode("span",{class:a.normalizeClass(s.$style.meta)},[a.createVNode(m,{size:"small",type:t.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.value),1)]),_:1},8,["type"]),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(s.$style.duration)},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)],2),a.createVNode(a.unref($),{name:i.value?"arrow-up":"arrow-down",size:14,class:a.normalizeClass(s.$style.expandIcon)},null,8,["name","class"])],2),i.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.detail)},[d.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.progress)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.progressLabel)}," 节点进度:"+a.toDisplayString(o.value)+" / "+a.toDisplayString(d.value),3),a.createVNode(b,{percentage:n.value,status:C.status==="error"?"exception":void 0,"stroke-width":6},null,8,["percentage","status"])],2)):a.createCommentVNode("",!0),C.error?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.error)},[a.createVNode(a.unref($),{name:"warning-filled",size:14}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)],2)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(s.$style.actions)},[a.createVNode(G,{size:"small",onClick:Z[1]||(Z[1]=r=>A("detail"))},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"view",size:14,style:{"margin-right":"4px"}}),Z[3]||(Z[3]=a.createTextVNode(" 查看详情 ",-1))]),_:1}),C.status==="error"?(a.openBlock(),a.createBlock(G,{key:0,size:"small",type:"primary",plain:"",onClick:Z[2]||(Z[2]=r=>A("retry"))},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"refresh",size:14,style:{"margin-right":"4px"}}),Z[4]||(Z[4]=a.createTextVNode(" 重试 ",-1))]),_:1})):a.createCommentVNode("",!0)],2)],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{card:"_card_15eqh_2",header:"_header_15eqh_8",iconWrap:"_iconWrap_15eqh_21",info:"_info_15eqh_33",name:"_name_15eqh_41",meta:"_meta_15eqh_50",duration:"_duration_15eqh_56",expandIcon:"_expandIcon_15eqh_62",detail:"_detail_15eqh_67",progress:"_progress_15eqh_73",progressLabel:"_progressLabel_15eqh_77",error:"_error_15eqh_83",actions:"_actions_15eqh_95",iconSpin:"_iconSpin_15eqh_100","sub-workflow-spin":"_sub-workflow-spin_15eqh_1"}}]]),xQ={key:0},fQ=E(a.defineComponent({__name:"PptPreviewCard",props:{slides:{},metadata:{},loading:{type:Boolean},error:{},blob:{}},emits:["download"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>(g.slides??[]).slice(0,4)),l={business:"商务",tech:"科技",education:"教育",creative:"创意"},e={professional:"专业",casual:"休闲",academic:"学术"},t={title:"document",content:"notebook",chart:"data-line",comparison:"scale-to-original",summary:"document-checked"};function c(){var d;if(g.blob){const o=URL.createObjectURL(g.blob),n=document.createElement("a");n.href=o,n.download=`${((d=g.metadata)==null?void 0:d.title)??"presentation"}.pptx`,n.click(),URL.revokeObjectURL(o)}else A("download")}return(d,o)=>{var n,s,Z,m;return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(d.$style.card)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.titleRow)},[a.createVNode(a.unref($),{name:"data-board",size:16,style:{color:"#67C23A"}}),a.createElementVNode("span",{class:a.normalizeClass(d.$style.title)},a.toDisplayString(((n=C.metadata)==null?void 0:n.title)??"AI PPT 生成"),3)],2),C.metadata?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.metaBadges)},[a.createElementVNode("span",{class:a.normalizeClass(d.$style.badge)},a.toDisplayString(l[C.metadata.template]??C.metadata.template),3),a.createElementVNode("span",{class:a.normalizeClass(d.$style.badge)},a.toDisplayString(C.metadata.totalSlides)+" 页",3)],2)):a.createCommentVNode("",!0)],2),C.loading?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.loadingState)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.spinner)},null,2),o[0]||(o[0]=a.createElementVNode("span",null,"正在生成 PPT...",-1))],2)):C.error?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(d.$style.errorState)},[a.createVNode(a.unref($),{name:"warning",size:24}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)],2)):i.value.length?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(d.$style.previewGrid)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i.value,b=>{var G;return a.openBlock(),a.createElementBlock("div",{key:b.index,class:a.normalizeClass(d.$style.slideThumb)},[a.createElementVNode("div",{class:a.normalizeClass(d.$style.slideHeader)},[a.createVNode(a.unref($),{name:t[b.type]??"document",size:12},null,8,["name"]),a.createElementVNode("span",null,a.toDisplayString(b.heading),1)],2),a.createElementVNode("div",{class:a.normalizeClass(d.$style.slideBody)},[(G=b.content)!=null&&G.length?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.slideContent)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.content.slice(0,3),(r,h)=>(a.openBlock(),a.createElementBlock("div",{key:h,class:a.normalizeClass(d.$style.slidePoint)},a.toDisplayString(r),3))),128)),b.content.length>3?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.slideMore)}," +"+a.toDisplayString(b.content.length-3)+" 更多 ",3)):a.createCommentVNode("",!0)],2)):(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(d.$style.slideEmpty)},"暂无内容",2))],2),a.createElementVNode("div",{class:a.normalizeClass(d.$style.slideIndex)},a.toDisplayString(b.index),3)],2)}),128)),(((s=C.slides)==null?void 0:s.length)??0)>4?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(d.$style.moreSlides)},[a.createElementVNode("span",null,"+"+a.toDisplayString((((Z=C.slides)==null?void 0:Z.length)??0)-4)+" 页",1)],2)):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0),C.metadata?(a.openBlock(),a.createElementBlock("div",{key:3,class:a.normalizeClass(d.$style.meta)},[C.metadata.style?(a.openBlock(),a.createElementBlock("span",xQ,[a.createVNode(a.unref($),{name:"brush",size:12}),a.createTextVNode(" "+a.toDisplayString(e[C.metadata.style]??C.metadata.style),1)])):a.createCommentVNode("",!0),a.createElementVNode("span",null,[a.createVNode(a.unref($),{name:"document",size:12}),a.createTextVNode(" "+a.toDisplayString(C.metadata.totalSlides)+" 页 ",1)])],2)):a.createCommentVNode("",!0),!C.loading&&((m=C.slides)!=null&&m.length)?(a.openBlock(),a.createElementBlock("div",{key:4,class:a.normalizeClass(d.$style.actions)},[a.createElementVNode("button",{class:a.normalizeClass(d.$style.downloadBtn),onClick:c},[a.createVNode(a.unref($),{name:"download",size:14}),o[1]||(o[1]=a.createTextVNode(" 下载 PPT ",-1))],2)],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{card:"_card_z1wac_2",header:"_header_z1wac_9",titleRow:"_titleRow_z1wac_16",title:"_title_z1wac_16",metaBadges:"_metaBadges_z1wac_28",badge:"_badge_z1wac_33",loadingState:"_loadingState_z1wac_41",errorState:"_errorState_z1wac_42",spinner:"_spinner_z1wac_56",spin:"_spin_z1wac_56",previewGrid:"_previewGrid_z1wac_69",slideThumb:"_slideThumb_z1wac_76",slideHeader:"_slideHeader_z1wac_85",slideBody:"_slideBody_z1wac_97",slideContent:"_slideContent_z1wac_101",slidePoint:"_slidePoint_z1wac_107",slideMore:"_slideMore_z1wac_116",slideEmpty:"_slideEmpty_z1wac_122",slideIndex:"_slideIndex_z1wac_127",moreSlides:"_moreSlides_z1wac_136",meta:"_meta_z1wac_28",actions:"_actions_z1wac_161",downloadBtn:"_downloadBtn_z1wac_166"}}]]),jQ=E(a.defineComponent({__name:"FlowPreviewShell",props:{title:{},badge:{},primaryAction:{},secondaryAction:{},compact:{type:Boolean,default:!1},showFitButton:{type:Boolean,default:!0}},emits:["primary-action","secondary-action","fit-view"],setup(C,{emit:I}){const g=I;return(A,i)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([A.$style.card,{[A.$style.compact]:C.compact}])},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.head)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.headLeft)},[a.createElementVNode("div",{class:a.normalizeClass(A.$style.headIcon)},[a.renderSlot(A.$slots,"icon",{},()=>[a.createVNode(a.unref($),{name:"connection",size:14})])],2),a.createElementVNode("span",{class:a.normalizeClass(A.$style.title)},a.toDisplayString(C.title),3)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.headRight)},[C.badge?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(A.$style.badge)},a.toDisplayString(C.badge),3)):a.createCommentVNode("",!0),C.showFitButton?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(A.$style.fitBtn),title:"适配画布",onClick:i[0]||(i[0]=l=>g("fit-view"))},[a.createVNode(a.unref($),{name:"full-screen"})],2)):a.createCommentVNode("",!0)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(A.$style.canvasWrapper)},[a.renderSlot(A.$slots,"default")],2),C.primaryAction||C.secondaryAction?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(A.$style.actions)},[C.secondaryAction?(a.openBlock(),a.createElementBlock("button",{key:0,type:"button",class:a.normalizeClass(A.$style.btnGhost),onClick:i[1]||(i[1]=l=>g("secondary-action"))},[a.createVNode(a.unref($),{name:"edit",size:12}),a.createTextVNode(" "+a.toDisplayString(C.secondaryAction),1)],2)):a.createCommentVNode("",!0),C.primaryAction?(a.openBlock(),a.createElementBlock("button",{key:1,type:"button",class:a.normalizeClass(A.$style.btnPrimary),onClick:i[2]||(i[2]=l=>g("primary-action"))},[a.createVNode(a.unref($),{name:"check",size:12}),a.createTextVNode(" "+a.toDisplayString(C.primaryAction),1)],2)):a.createCommentVNode("",!0)],2)):a.createCommentVNode("",!0)],2))}}),[["__cssModules",{$style:{card:"_card_h1z12_1",head:"_head_h1z12_16",headLeft:"_headLeft_h1z12_25",headRight:"_headRight_h1z12_31",headIcon:"_headIcon_h1z12_37",title:"_title_h1z12_49",badge:"_badge_h1z12_55",fitBtn:"_fitBtn_h1z12_64",canvasWrapper:"_canvasWrapper_h1z12_86","vue-flow__node":"_vue-flow__node_h1z12_92",selected:"_selected_h1z12_96","vue-flow__edge-path":"_vue-flow__edge-path_h1z12_101","vue-flow__controls":"_vue-flow__controls_h1z12_105","vue-flow__controls-button":"_vue-flow__controls-button_h1z12_111",actions:"_actions_h1z12_121",btnPrimary:"_btnPrimary_h1z12_130",btnGhost:"_btnGhost_h1z12_150",compact:"_compact_h1z12_173"}}]]),QQ={class:"apf-model3d"},UQ={class:"apf-model3d__header"},OQ={class:"apf-model3d__badge"},EQ={class:"apf-model3d__filename"},PQ={class:"apf-model3d__body"},_Q={key:0,slot:"poster",class:"apf-model3d__hint"},qQ={key:1,class:"apf-model3d__hint is-error"},$Q={key:0,class:"apf-model3d__actions"},gU=["href"],IU=E(a.defineComponent({__name:"Model3dPreviewCard",props:{url:{},filename:{},mimeType:{},poster:{}},setup(C){const I=C,g=a.ref(!1),A=a.ref(null),i=a.computed(()=>{var c,d;const t=((d=(c=I.filename)==null?void 0:c.split(".").pop())==null?void 0:d.toLowerCase())||"";return["gltf","glb"].includes(t)?"glTF":t==="obj"?"OBJ":t==="stl"?"STL":t==="fbx"?"FBX":"3D"});function l(){g.value=!0,A.value=null}function e(){A.value="加载失败"}return(t,c)=>{const d=a.resolveComponent("model-viewer");return a.openBlock(),a.createElementBlock("div",QQ,[a.createElementVNode("div",UQ,[a.createElementVNode("span",OQ,a.toDisplayString(i.value),1),a.createElementVNode("span",EQ,a.toDisplayString(C.filename||"3D 模型"),1)]),a.createElementVNode("div",PQ,[a.createVNode(d,{src:C.url,poster:C.poster,"camera-controls":"","auto-rotate":"","shadow-intensity":"1",class:"apf-model3d__viewer",onLoad:l,onError:e},{default:a.withCtx(()=>[!g.value&&!A.value?(a.openBlock(),a.createElementBlock("div",_Q,[a.createVNode(a.unref($),{name:"loading",size:24,class:"apf-model3d__spin"}),c[0]||(c[0]=a.createElementVNode("span",null,"加载 3D 模型中...",-1))])):a.createCommentVNode("",!0),A.value?(a.openBlock(),a.createElementBlock("div",qQ,[a.createVNode(a.unref($),{name:"warning-filled",size:24}),a.createElementVNode("span",null,a.toDisplayString(A.value),1)])):a.createCommentVNode("",!0)]),_:1},8,["src","poster"])]),A.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",$Q,[a.createElementVNode("a",{class:"apf-model3d__download",href:C.url,download:""},[a.createVNode(a.unref($),{name:"download",size:14}),c[1]||(c[1]=a.createTextVNode(" 下载 ",-1))],8,gU)]))])}}}),[["__scopeId","data-v-b562b8bd"]]),CU={class:"apf-image-generate"},AU={class:"apf-image-generate__header"},iU={class:"apf-image-generate__title-row"},lU={key:0,class:"apf-image-generate__model"},eU={key:0,class:"apf-image-generate__prompt"},tU={class:"apf-image-generate__image-container"},aU={key:0,class:"apf-image-generate__overlay"},cU={key:1,class:"apf-image-generate__overlay apf-image-generate__overlay--error"},dU=["src"],oU={class:"apf-image-generate__zoom-hint"},nU={key:3,class:"apf-image-generate__placeholder"},sU={key:1,class:"apf-image-generate__meta"},ZU={key:0},mU={key:1},bU={key:2},GU={key:2,class:"apf-image-generate__actions"},rU=E(a.defineComponent({__name:"ImageGenerateCard",props:{imageUrl:{},prompt:{},model:{},size:{},imageStyle:{},quality:{},loading:{type:Boolean},error:{}},emits:["download","regenerate"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(!1);function l(){if(!g.imageUrl)return;const o=document.createElement("a");o.href=g.imageUrl,o.download=`ai-image-${Date.now()}.png`,o.click(),A("download")}function e(){g.imageUrl&&(i.value=!0)}function t(){i.value=!1}const c={vivid:"鲜艳",natural:"自然"},d={standard:"标准",hd:"高清"};return(o,n)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",CU,[a.createElementVNode("div",AU,[a.createElementVNode("div",iU,[a.createVNode(a.unref($),{name:"picture",size:16,style:{color:"#E6A23C"}}),n[1]||(n[1]=a.createElementVNode("span",{class:"apf-image-generate__title"},"AI 图片生成",-1))]),C.model?(a.openBlock(),a.createElementBlock("div",lU,a.toDisplayString(C.model),1)):a.createCommentVNode("",!0)]),C.prompt?(a.openBlock(),a.createElementBlock("div",eU,[n[2]||(n[2]=a.createElementVNode("span",{class:"apf-image-generate__prompt-label"},"Prompt:",-1)),a.createTextVNode(a.toDisplayString(C.prompt),1)])):a.createCommentVNode("",!0),a.createElementVNode("div",tU,[C.loading?(a.openBlock(),a.createElementBlock("div",aU,[...n[3]||(n[3]=[a.createElementVNode("div",{class:"apf-image-generate__spinner"},null,-1),a.createElementVNode("span",null,"正在生成图片...",-1)])])):C.error?(a.openBlock(),a.createElementBlock("div",cU,[a.createVNode(a.unref($),{name:"warning",size:24}),a.createElementVNode("span",null,a.toDisplayString(C.error),1)])):C.imageUrl?(a.openBlock(),a.createElementBlock("div",{key:2,class:"apf-image-generate__image-wrap",onClick:e},[a.createElementVNode("img",{src:C.imageUrl,class:"apf-image-generate__image",alt:"AI generated image"},null,8,dU),a.createElementVNode("div",oU,[a.createVNode(a.unref($),{name:"full-screen",size:16}),n[4]||(n[4]=a.createElementVNode("span",null,"点击放大",-1))])])):(a.openBlock(),a.createElementBlock("div",nU,[a.createVNode(a.unref($),{name:"picture",size:32}),n[5]||(n[5]=a.createElementVNode("span",null,"等待生成",-1))]))]),C.size||C.imageStyle||C.quality?(a.openBlock(),a.createElementBlock("div",sU,[C.size?(a.openBlock(),a.createElementBlock("span",ZU,[a.createVNode(a.unref($),{name:"full-screen",size:12}),a.createTextVNode(" "+a.toDisplayString(C.size),1)])):a.createCommentVNode("",!0),C.imageStyle?(a.openBlock(),a.createElementBlock("span",mU,[a.createVNode(a.unref($),{name:"brush",size:12}),a.createTextVNode(" "+a.toDisplayString(c[C.imageStyle]??C.imageStyle),1)])):a.createCommentVNode("",!0),C.quality?(a.openBlock(),a.createElementBlock("span",bU,[a.createVNode(a.unref($),{name:"picture",size:12}),a.createTextVNode(" "+a.toDisplayString(d[C.quality]??C.quality),1)])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),!C.loading&&C.imageUrl?(a.openBlock(),a.createElementBlock("div",GU,[a.createElementVNode("button",{type:"button",class:"apf-image-generate__btn apf-image-generate__btn--primary",onClick:l},[a.createVNode(a.unref($),{name:"download",size:14}),n[6]||(n[6]=a.createTextVNode(" 下载图片 ",-1))]),a.createElementVNode("button",{type:"button",class:"apf-image-generate__btn",onClick:n[0]||(n[0]=s=>A("regenerate"))},[a.createVNode(a.unref($),{name:"refresh",size:14}),n[7]||(n[7]=a.createTextVNode(" 重新生成 ",-1))])])):a.createCommentVNode("",!0)]),i.value&&C.imageUrl?(a.openBlock(),a.createBlock(a.unref(BC.ElImageViewer),{key:0,"url-list":[C.imageUrl],"initial-index":0,"close-on-press-escape":!0,teleported:"",onClose:t},null,8,["url-list"])):a.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-7f771b7c"]]),hU=E(a.defineComponent({__name:"SchemaFormPreview",props:{fields:{},title:{default:"生成的表单"},compact:{type:Boolean,default:!1},labelWidth:{default:"100px"},labelPosition:{default:"right"},primaryActionLabel:{default:"确认发布"},showPrimaryAction:{type:Boolean}},emits:["click","primary-action"],setup(C,{emit:I}){const g=C,A=I,i=a.computed(()=>g.showPrimaryAction!==void 0?g.showPrimaryAction:!g.compact);return(l,e)=>{const t=a.resolveComponent("el-input"),c=a.resolveComponent("el-form-item"),d=a.resolveComponent("el-option"),o=a.resolveComponent("el-select"),n=a.resolveComponent("el-checkbox"),s=a.resolveComponent("el-checkbox-group"),Z=a.resolveComponent("el-radio"),m=a.resolveComponent("el-radio-group"),b=a.resolveComponent("el-switch"),G=a.resolveComponent("el-date-picker"),r=a.resolveComponent("el-time-picker"),h=a.resolveComponent("el-button"),u=a.resolveComponent("el-input-number"),B=a.resolveComponent("el-form");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([l.$style.previewCard,{[l.$style.compact]:C.compact}]),onClick:e[1]||(e[1]=W=>A("click"))},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerLeft)},[a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerIcon)},[a.createVNode(a.unref($),{name:"grid",size:14})],2),a.createElementVNode("span",{class:a.normalizeClass(l.$style.title)},a.toDisplayString(C.title),3)],2),a.createElementVNode("div",{class:a.normalizeClass(l.$style.headerRight)},[a.createElementVNode("span",{class:a.normalizeClass(l.$style.badge)},a.toDisplayString(C.fields.length)+" 个字段",3),a.createElementVNode("span",{class:a.normalizeClass(l.$style.viewHint)},[a.createVNode(a.unref($),{name:"view",size:12}),e[2]||(e[2]=a.createTextVNode(" 预览 ",-1))],2)],2)],2),a.createElementVNode("div",{class:a.normalizeClass(l.$style.previewBody)},[a.createVNode(B,{"label-width":C.labelWidth,"label-position":C.labelPosition,class:a.normalizeClass(l.$style.form)},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.fields,W=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:W.id},[["input","email","phone","password"].includes(W.type)?(a.openBlock(),a.createBlock(c,{key:0,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(t,{placeholder:W.placeholder,clearable:W.clearable,"show-password":W.showPassword,maxlength:W.maxlength,disabled:C.compact,size:"default"},null,8,["placeholder","clearable","show-password","maxlength","disabled"])]),_:2},1032,["label","class"])):W.type==="textarea"?(a.openBlock(),a.createBlock(c,{key:1,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(t,{type:"textarea",placeholder:W.placeholder,rows:3,disabled:C.compact},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"])):W.type==="select"?(a.openBlock(),a.createBlock(c,{key:2,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(o,{placeholder:W.placeholder,clearable:W.clearable,disabled:C.compact,style:{width:"100%"}},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(W.options??[],w=>(a.openBlock(),a.createBlock(d,{key:String(w.value),label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:2},1032,["placeholder","clearable","disabled"])]),_:2},1032,["label","class"])):W.type==="checkbox"?(a.openBlock(),a.createBlock(c,{key:3,label:W.label||void 0,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(s,{disabled:C.compact},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(W.options??[],w=>(a.openBlock(),a.createBlock(n,{key:String(w.value),label:w.label,value:w.value},null,8,["label","value"]))),128))]),_:2},1032,["disabled"])]),_:2},1032,["label","class"])):W.type==="radio"?(a.openBlock(),a.createBlock(c,{key:4,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(m,{disabled:C.compact},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(W.options??[],w=>(a.openBlock(),a.createBlock(Z,{key:String(w.value),value:w.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(w.label),1)]),_:2},1032,["value"]))),128))]),_:2},1032,["disabled"])]),_:2},1032,["label","class"])):W.type==="switch"?(a.openBlock(),a.createBlock(c,{key:5,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(b,{disabled:C.compact},null,8,["disabled"])]),_:1},8,["label","class"])):W.type==="date-picker"||W.type==="datepicker"?(a.openBlock(),a.createBlock(c,{key:6,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(G,{placeholder:W.placeholder,disabled:C.compact,style:{width:"100%"}},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"])):W.type==="time-picker"||W.type==="timepicker"?(a.openBlock(),a.createBlock(c,{key:7,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(r,{placeholder:W.placeholder,disabled:C.compact,style:{width:"100%"}},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"])):W.type==="button"?(a.openBlock(),a.createBlock(c,{key:8,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(h,{type:W.buttonType??"default",disabled:C.compact},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(W.buttonText??W.label??"按钮"),1)]),_:2},1032,["type","disabled"])]),_:2},1032,["class"])):W.type==="number"?(a.openBlock(),a.createBlock(c,{key:9,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(u,{disabled:C.compact,style:{width:"100%"}},null,8,["disabled"])]),_:1},8,["label","class"])):(a.openBlock(),a.createBlock(c,{key:10,label:W.label,class:a.normalizeClass(l.$style.formItem)},{default:a.withCtx(()=>[a.createVNode(t,{placeholder:W.placeholder||W.type,disabled:C.compact},null,8,["placeholder","disabled"])]),_:2},1032,["label","class"]))],64))),128))]),_:1},8,["label-width","label-position","class"])],2),i.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(l.$style.actions)},[a.createVNode(h,{class:a.normalizeClass(l.$style.btnPrimary),type:"primary",onClick:e[0]||(e[0]=a.withModifiers(W=>A("primary-action"),["stop"]))},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"check",size:12}),a.createTextVNode(" "+a.toDisplayString(C.primaryActionLabel),1)]),_:1},8,["class"])],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{previewCard:"_previewCard_18hnt_2",compact:"_compact_18hnt_16",header:"_header_18hnt_21",headerLeft:"_headerLeft_18hnt_30",headerIcon:"_headerIcon_18hnt_36",title:"_title_18hnt_47",headerRight:"_headerRight_18hnt_53",badge:"_badge_18hnt_59",viewHint:"_viewHint_18hnt_67",previewBody:"_previewBody_18hnt_79",form:"_form_18hnt_83",formItem:"_formItem_18hnt_87",actions:"_actions_18hnt_95",btnOutline:"_btnOutline_18hnt_105",btnPrimary:"_btnPrimary_18hnt_127"}}]]),uU=E(a.defineComponent({__name:"WorkflowRunTimeline",props:{title:{},status:{},progressText:{},steps:{},defaultCollapsed:{type:Boolean,default:!1},emptyText:{default:"等待首个节点开始…"}},setup(C){const I=C,g=a.ref(I.defaultCollapsed);a.watch(()=>I.status,c=>{c==="running"&&(g.value=!1)});const A={running:"loading",success:"circle-check",error:"circle-close-filled",waiting:"clock",skipped:"minus",pending:"more-filled"},i=a.computed(()=>{const c=I.status;return c?`status${c.charAt(0).toUpperCase()}${c.slice(1)}`:""});function l(c){return`icon${c.charAt(0).toUpperCase()}${c.slice(1)}`}function e(c){return A[c]??"more-filled"}function t(){g.value=!g.value}return(c,d)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([c.$style.block,c.$style[i.value]])},[a.createElementVNode("button",{type:"button",class:a.normalizeClass(c.$style.header),onClick:t},[a.createElementVNode("span",{class:a.normalizeClass(c.$style.headerLeft)},[a.createVNode(a.unref($),{name:g.value?"arrow-right":"arrow-down",size:12,class:a.normalizeClass(c.$style.chevron)},null,8,["name","class"]),a.createElementVNode("span",{class:a.normalizeClass(c.$style.title)},a.toDisplayString(C.title),3)],2),C.progressText?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(c.$style.progress)},a.toDisplayString(C.progressText),3)):a.createCommentVNode("",!0)],2),g.value?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(c.$style.timeline)},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.steps,(o,n)=>(a.openBlock(),a.createElementBlock("div",{key:o.id,class:a.normalizeClass([c.$style.item,o.status==="running"&&c.$style.itemRunning,o.streaming&&c.$style.itemStreaming])},[a.createElementVNode("div",{class:a.normalizeClass(c.$style.rail)},[a.createElementVNode("span",{class:a.normalizeClass([c.$style.iconWrap,c.$style[l(o.status)]])},[a.createVNode(a.unref($),{name:e(o.status),size:14,class:a.normalizeClass(o.status==="running"?c.$style.spin:void 0)},null,8,["name","class"])],2),n<C.steps.length-1?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(c.$style.connector)},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("div",{class:a.normalizeClass(c.$style.body)},[a.createElementVNode("span",{class:a.normalizeClass(c.$style.nodeName)},a.toDisplayString(o.label),3),o.hint?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(c.$style.nodeHint)},a.toDisplayString(o.hint),3)):a.createCommentVNode("",!0),a.renderSlot(c.$slots,"step",{step:o})],2)],2))),128)),C.steps.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(c.$style.empty)},a.toDisplayString(C.emptyText),3))],2))],2))}}),[["__cssModules",{$style:{block:"_block_2l73c_2",statusRunning:"_statusRunning_2l73c_10",statusError:"_statusError_2l73c_14",statusWaiting:"_statusWaiting_2l73c_18",header:"_header_2l73c_22",headerLeft:"_headerLeft_2l73c_39",chevron:"_chevron_2l73c_46",title:"_title_2l73c_51",progress:"_progress_2l73c_60",timeline:"_timeline_2l73c_66",item:"_item_2l73c_70",itemRunning:"_itemRunning_2l73c_76",nodeName:"_nodeName_2l73c_76",itemStreaming:"_itemStreaming_2l73c_81",iconWrap:"_iconWrap_2l73c_81",rail:"_rail_2l73c_85",iconSuccess:"_iconSuccess_2l73c_104",iconError:"_iconError_2l73c_109",iconRunning:"_iconRunning_2l73c_114",iconWaiting:"_iconWaiting_2l73c_119",iconSkipped:"_iconSkipped_2l73c_124",spin:"_spin_2l73c_129",connector:"_connector_2l73c_138",body:"_body_2l73c_146",nodeHint:"_nodeHint_2l73c_160",empty:"_empty_2l73c_166"}}]]),BU=["tabindex","aria-label"],WU=E(a.defineComponent({__name:"SuggestionCard",props:{suggestion:{},accepted:{type:Boolean},dismissed:{type:Boolean}},emits:["accept","dismiss"],setup(C,{emit:I}){const g=C,A=I,i={action:{icon:"promotion",label:"操作",color:"#409EFF"},optimization:{icon:"magic-stick",label:"优化",color:"#E6A23C"},reference:{icon:"document",label:"参考",color:"#67C23A"}},l={high:{label:"高",color:"#F56C6C",bgColor:"#fef0f0"},medium:{label:"中",color:"#E6A23C",bgColor:"#fdf6ec"},low:{label:"低",color:"#909399",bgColor:"#f4f4f5"}},e=a.computed(()=>i[g.suggestion.type]??i.action),t=a.computed(()=>l[g.suggestion.priority]??l.medium),c=a.computed(()=>!g.accepted&&!g.dismissed);function d(){c.value&&A("accept",g.suggestion.id)}function o(){c.value&&A("dismiss",g.suggestion.id)}function n(s){c.value&&(s.key==="Enter"||s.key===" "?(s.preventDefault(),d()):s.key==="Escape"&&(s.preventDefault(),o()))}return(s,Z)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([s.$style.card,C.accepted&&s.$style.accepted,C.dismissed&&s.$style.dismissed]),tabindex:c.value?0:-1,role:"article","aria-label":`建议: ${C.suggestion.title}`,onKeydown:n},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.header)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.typeBadge),style:a.normalizeStyle({color:e.value.color})},[a.createVNode(a.unref($),{name:e.value.icon,size:14},null,8,["name"]),a.createElementVNode("span",null,a.toDisplayString(e.value.label),1)],6),a.createElementVNode("div",{class:a.normalizeClass(s.$style.priorityBadge),style:a.normalizeStyle({color:t.value.color,background:t.value.bgColor})},a.toDisplayString(t.value.label)+"优先 ",7)],2),a.createElementVNode("div",{class:a.normalizeClass(s.$style.body)},[a.createElementVNode("div",{class:a.normalizeClass(s.$style.title)},a.toDisplayString(C.suggestion.title),3),a.createElementVNode("div",{class:a.normalizeClass(s.$style.description)},a.toDisplayString(C.suggestion.description),3),C.suggestion.targetName?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.target)},[a.createVNode(a.unref($),{name:"connection",size:12}),a.createElementVNode("span",null,a.toDisplayString(C.suggestion.targetName),1)],2)):a.createCommentVNode("",!0)],2),c.value?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(s.$style.actions)},[a.createElementVNode("button",{class:a.normalizeClass(s.$style.acceptBtn),type:"button",onClick:d},[a.createVNode(a.unref($),{name:"check",size:14}),Z[0]||(Z[0]=a.createTextVNode(" 采纳 ",-1))],2),a.createElementVNode("button",{class:a.normalizeClass(s.$style.dismissBtn),type:"button",onClick:o},[a.createVNode(a.unref($),{name:"close",size:14}),Z[1]||(Z[1]=a.createTextVNode(" 忽略 ",-1))],2)],2)):a.createCommentVNode("",!0),C.accepted?(a.openBlock(),a.createElementBlock("div",{key:1,class:a.normalizeClass(s.$style.statusBadge)},[a.createVNode(a.unref($),{name:"check",size:14}),Z[2]||(Z[2]=a.createTextVNode(" 已采纳 ",-1))],2)):a.createCommentVNode("",!0),C.dismissed?(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass([s.$style.statusBadge,s.$style.statusDismissed])},[a.createVNode(a.unref($),{name:"close",size:14}),Z[3]||(Z[3]=a.createTextVNode(" 已忽略 ",-1))],2)):a.createCommentVNode("",!0)],42,BU))}}),[["__cssModules",{$style:{card:"_card_69ko9_2",accepted:"_accepted_69ko9_21",dismissed:"_dismissed_69ko9_31",header:"_header_69ko9_36",typeBadge:"_typeBadge_69ko9_43",priorityBadge:"_priorityBadge_69ko9_51",body:"_body_69ko9_58",title:"_title_69ko9_62",description:"_description_69ko9_69",target:"_target_69ko9_75",actions:"_actions_69ko9_84",acceptBtn:"_acceptBtn_69ko9_91",dismissBtn:"_dismissBtn_69ko9_92",statusBadge:"_statusBadge_69ko9_132",statusDismissed:"_statusDismissed_69ko9_144"}}]]),wU=["onClick"],YU=E(a.defineComponent({__name:"ConversationSearchBar",props:{modelValue:{},searching:{type:Boolean,default:!1},panelVisible:{type:Boolean,default:!1},results:{},total:{default:0},sourceOptions:{},sourceFilter:{default:""},startDate:{default:""},endDate:{default:""},filtersExpanded:{type:Boolean,default:!1},placeholder:{default:"搜索对话..."}},emits:["update:modelValue","update:sourceFilter","update:startDate","update:endDate","update:filtersExpanded","update:panelVisible","select","clear","search"],setup(C,{emit:I}){const g=[{value:"",label:"全部来源"},{value:"editor",label:"Editor"},{value:"flow",label:"Flow"},{value:"standalone",label:"AI"}],A=C,i=I,l=a.computed(()=>A.sourceOptions??g),e=a.computed(()=>A.startDate!==""||A.endDate!==""||A.sourceFilter!=="");function t(m){const b=new Date(m),G=r=>String(r).padStart(2,"0");return`${b.getFullYear()}${G(b.getMonth()+1)}${G(b.getDate())} ${G(b.getHours())}${G(b.getMinutes())}${G(b.getSeconds())}`}function c(m){if(!m)return"AI";const b=l.value.find(G=>G.value===m);return b!=null&&b.label?b.label:m==="editor"?"Editor":m==="flow"?"Flow":"AI"}function d(m){return m==="editor"?"success":m==="flow"?"primary":"warning"}function o(){i("update:modelValue",""),i("update:startDate",""),i("update:endDate",""),i("update:sourceFilter",""),i("update:panelVisible",!1),i("clear")}function n(m){i("select",m)}function s(){i("update:filtersExpanded",!A.filtersExpanded)}function Z(m,b){const G=b??"";i(m==="start"?"update:startDate":"update:endDate",G)}return(m,b)=>{const G=a.resolveComponent("el-input"),r=a.resolveComponent("el-button"),h=a.resolveComponent("el-option"),u=a.resolveComponent("el-select"),B=a.resolveComponent("el-date-picker"),W=a.resolveComponent("el-popover"),w=a.resolveComponent("el-tag");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(m.$style.root)},[a.createElementVNode("div",{class:a.normalizeClass(m.$style.searchRow)},[a.createVNode(G,{"model-value":C.modelValue,placeholder:C.placeholder,size:"small",clearable:"","onUpdate:modelValue":b[0]||(b[0]=Y=>i("update:modelValue",Y)),onClear:o,onKeyup:b[1]||(b[1]=a.withKeys(Y=>i("search"),["enter"]))},{prefix:a.withCtx(()=>[a.createVNode(a.unref($),{name:"search",size:14})]),_:1},8,["model-value","placeholder"]),a.createVNode(W,{visible:C.filtersExpanded,placement:"bottom-end",width:220,trigger:"click","show-arrow":!1,offset:4},{reference:a.withCtx(()=>[a.createVNode(r,{size:"small",type:e.value?"primary":"default",link:!e.value,onClick:s},{default:a.withCtx(()=>[a.createVNode(a.unref($),{name:"filter",size:14})]),_:1},8,["type","link"])]),default:a.withCtx(()=>[a.createElementVNode("div",{class:a.normalizeClass(m.$style.filterPanel)},[a.createElementVNode("div",{class:a.normalizeClass(m.$style.filterRow)},[a.createElementVNode("span",{class:a.normalizeClass(m.$style.filterLabel)},"来源",2),a.createVNode(u,{"model-value":C.sourceFilter,size:"small",placeholder:"全部",style:{flex:"1"},"onUpdate:modelValue":b[2]||(b[2]=Y=>i("update:sourceFilter",Y))},{default:a.withCtx(()=>[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,Y=>(a.openBlock(),a.createBlock(h,{key:Y.value,label:Y.label,value:Y.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])],2),a.createElementVNode("div",{class:a.normalizeClass(m.$style.filterRow)},[a.createElementVNode("span",{class:a.normalizeClass(m.$style.filterLabel)},"时间",2),a.createVNode(B,{"model-value":C.startDate||null,type:"date",placeholder:"开始",size:"small","value-format":"YYYY-MM-DD",style:{flex:"1"},"onUpdate:modelValue":b[3]||(b[3]=Y=>Z("start",Y))},null,8,["model-value"]),a.createElementVNode("span",{class:a.normalizeClass(m.$style.filterSep)},"~",2),a.createVNode(B,{"model-value":C.endDate||null,type:"date",placeholder:"结束",size:"small","value-format":"YYYY-MM-DD",style:{flex:"1"},"onUpdate:modelValue":b[4]||(b[4]=Y=>Z("end",Y))},null,8,["model-value"])],2)],2)]),_:1},8,["visible"])],2),C.panelVisible?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(m.$style.results)},[C.searching?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(m.$style.empty)},"搜索中...",2)):C.results.length>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createElementVNode("div",{class:a.normalizeClass(m.$style.resultCount)},"找到 "+a.toDisplayString(C.total)+" 条结果",3),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.results,Y=>(a.openBlock(),a.createElementBlock("div",{key:Y.id,class:a.normalizeClass(m.$style.resultItem),onClick:p=>n(Y.id)},[a.createElementVNode("span",{class:a.normalizeClass(m.$style.resultTitle)},a.toDisplayString(Y.title),3),a.createVNode(w,{type:d(Y.source),size:"small"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(c(Y.source)),1)]),_:2},1032,["type"]),Y.updatedAt?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(m.$style.resultTime)},a.toDisplayString(t(Y.updatedAt)),3)):a.createCommentVNode("",!0)],10,wU))),128))],64)):(a.openBlock(),a.createElementBlock("div",{key:2,class:a.normalizeClass(m.$style.empty)},"无匹配对话",2))],2)):a.createCommentVNode("",!0)],2)}}}),[["__cssModules",{$style:{root:"_root_x8tmk_2",searchRow:"_searchRow_x8tmk_8",filterPanel:"_filterPanel_x8tmk_16",filterRow:"_filterRow_x8tmk_22",filterLabel:"_filterLabel_x8tmk_28",filterSep:"_filterSep_x8tmk_35",results:"_results_x8tmk_40",resultCount:"_resultCount_x8tmk_46",resultItem:"_resultItem_x8tmk_53",resultTitle:"_resultTitle_x8tmk_71",resultTime:"_resultTime_x8tmk_82",empty:"_empty_x8tmk_88"}}]]),VU={class:"apf-task-chain"},pU={class:"apf-task-chain__label"},yU={class:"apf-task-chain__steps"},NU=["data-step"],XU={class:"apf-task-chain__icon"},RU={class:"apf-task-chain__agent"},HU={class:"apf-task-chain__desc"},SU={key:0,class:"apf-task-chain__arrow"},MU=E(a.defineComponent({__name:"TaskChainBar",props:{steps:{},currentIndex:{},label:{default:"任务链"}},setup(C){const I=C,g=a.ref();function A(l){switch(l){case"done":return"✓";case"running":return"●";case"skipped":return"○";case"error":return"!";default:return"○"}}function i(l){return l==="editor"?"表单":l==="flow"?"流程":l==="page"?"页面":l}return a.watch(()=>I.currentIndex,()=>{a.nextTick(()=>{const l=g.value;if(!l)return;const t=l.querySelectorAll("[data-step]")[I.currentIndex];t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})})}),(l,e)=>(a.openBlock(),a.createElementBlock("div",VU,[a.createElementVNode("div",pU,a.toDisplayString(C.label),1),a.createElementVNode("div",{ref_key:"scrollbarRef",ref:g,class:"apf-task-chain__scroll"},[a.createElementVNode("div",yU,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.steps,(t,c)=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:c},[a.createElementVNode("div",{"data-step":c,class:a.normalizeClass(["apf-task-chain__step",[t.status?`is-${t.status}`:"is-pending",{"is-current":c===C.currentIndex}]])},[a.createElementVNode("span",XU,a.toDisplayString(A(t.status)),1),a.createElementVNode("span",RU,a.toDisplayString(i(t.agent)),1),a.createElementVNode("span",HU,a.toDisplayString(t.description),1)],10,NU),c<C.steps.length-1?(a.openBlock(),a.createElementBlock("div",SU,"→")):a.createCommentVNode("",!0)],64))),128))])],512)]))}}),[["__scopeId","data-v-31bc7b98"]]),DU={class:"apf-rag-panel"},KU={class:"apf-rag-panel__header"},FU=["value","placeholder"],zU={key:0,class:"apf-rag-panel__spinner","aria-label":"加载中"},JU={key:0,class:"apf-rag-panel__chips"},vU={class:"apf-rag-panel__chip-name"},kU=["onClick"],LU={class:"apf-rag-panel__list"},TU=["onClick"],xU={class:"apf-rag-panel__info"},fU={class:"apf-rag-panel__name"},jU={key:0,class:"apf-rag-panel__desc"},QU={key:1,class:"apf-rag-panel__tags"},UU={key:0,class:"apf-rag-panel__tag"},OU={key:1,class:"apf-rag-panel__empty"},EU={key:2,class:"apf-rag-panel__empty"},PU={class:"apf-rag-panel__footer"},_U=E(a.defineComponent({__name:"RagContextPanel",props:{results:{},selected:{},loading:{type:Boolean,default:!1},query:{default:""},placeholder:{default:"智能匹配 Schema,如:用户注册表单..."},emptyHint:{default:"未找到匹配的 Schema"},idleHint:{default:"输入自然语言描述,智能匹配已有 Schema"},footerHint:{default:"选择 Schema 注入对话上下文"},selectedFooterHint:{default:"已选 {n} 个 Schema 作为上下文"}},emits:["update:query","search","select","remove","close"],setup(C,{emit:I}){const g=C,A=I,i=a.ref(g.query);a.watch(()=>g.query,o=>{o!==i.value&&(i.value=o)});function l(o){i.value=o,A("update:query",o),A("search",o)}function e(o){return g.selected.some(n=>n.id===o.id)}function t(o){e(o)||A("select",o)}function c(o){return o>=70?"high":o>=40?"medium":"low"}const d=a.computed(()=>g.selected.length>0?g.selectedFooterHint.replace("{n}",String(g.selected.length)):g.footerHint);return(o,n)=>(a.openBlock(),a.createElementBlock("div",DU,[a.createElementVNode("div",KU,[n[2]||(n[2]=a.createElementVNode("svg",{class:"apf-rag-panel__icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[a.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),a.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),a.createElementVNode("input",{class:"apf-rag-panel__input",value:i.value,placeholder:C.placeholder,onInput:n[0]||(n[0]=s=>l(s.target.value))},null,40,FU),C.loading?(a.openBlock(),a.createElementBlock("span",zU)):a.createCommentVNode("",!0)]),C.selected.length>0?(a.openBlock(),a.createElementBlock("div",JU,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.selected,s=>(a.openBlock(),a.createElementBlock("span",{key:s.id,class:"apf-rag-panel__chip"},[a.createElementVNode("span",vU,a.toDisplayString(s.name),1),a.createElementVNode("button",{type:"button",class:"apf-rag-panel__chip-remove",title:"移除",onClick:Z=>A("remove",s.id)}," × ",8,kU)]))),128))])):a.createCommentVNode("",!0),a.createElementVNode("div",LU,[C.results.length>0?(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(C.results,s=>{var Z;return a.openBlock(),a.createElementBlock("button",{key:s.id,type:"button",class:a.normalizeClass(["apf-rag-panel__item",{"is-selected":e(s)}]),onClick:m=>t(s)},[a.createElementVNode("div",{class:a.normalizeClass(["apf-rag-panel__score",`is-${c(s.score)}`])},a.toDisplayString(s.score),3),a.createElementVNode("div",xU,[a.createElementVNode("div",fU,a.toDisplayString(s.name),1),s.description?(a.openBlock(),a.createElementBlock("div",jU,a.toDisplayString(s.description),1)):a.createCommentVNode("",!0),(Z=s.tags)!=null&&Z.length?(a.openBlock(),a.createElementBlock("div",QU,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(s.tags.slice(0,5),m=>(a.openBlock(),a.createElementBlock("span",{key:m,class:"apf-rag-panel__tag"},a.toDisplayString(m),1))),128)),s.tags.length>5?(a.openBlock(),a.createElementBlock("span",UU," +"+a.toDisplayString(s.tags.length-5),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])],10,TU)}),128)):!C.loading&&i.value.trim()?(a.openBlock(),a.createElementBlock("div",OU,[n[3]||(n[3]=a.createElementVNode("div",{class:"apf-rag-panel__empty-icon"},"⌕",-1)),a.createElementVNode("div",null,a.toDisplayString(C.emptyHint),1)])):C.loading?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",EU,[n[4]||(n[4]=a.createElementVNode("div",{class:"apf-rag-panel__empty-icon"},"✦",-1)),a.createElementVNode("div",null,a.toDisplayString(C.idleHint),1)]))]),a.createElementVNode("div",PU,[a.createElementVNode("span",null,a.toDisplayString(d.value),1),a.createElementVNode("button",{type:"button",class:"apf-rag-panel__close",onClick:n[1]||(n[1]=s=>A("close"))},"关闭")])]))}}),[["__scopeId","data-v-c6864f2d"]]),qU={class:"apf-assistant-picker"},$U={key:0,class:"apf-assistant-picker__state"},gO={key:1,class:"apf-assistant-picker__state apf-assistant-picker__state--error"},IO={key:2,class:"apf-assistant-picker__state"},CO=["onClick"],AO={class:"apf-assistant-picker__main"},iO={class:"apf-assistant-picker__icon-wrap"},lO={class:"apf-assistant-picker__info"},eO={class:"apf-assistant-picker__caps"},tO=E(a.defineComponent({__name:"AssistantPicker",props:{items:{},modelValue:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","select"],setup(C,{emit:I}){const g=C,A=I;function i(c){var o,n;const d=["文本"];return(o=c.supportedInputs)!=null&&o.includes("file")&&d.push("文件"),(n=c.supportedInputs)!=null&&n.includes("image")&&d.push("图片"),c.hitlCapable&&d.push("需要确认"),d}function l(c){return c.icon||"chat-dot-round"}function e(c){A("update:modelValue",c.id),A("select",c)}const t=a.computed(()=>!g.loading&&!g.error&&!g.items.length);return(c,d)=>(a.openBlock(),a.createElementBlock("div",qU,[C.loading?(a.openBlock(),a.createElementBlock("div",$U,[...d[0]||(d[0]=[a.createElementVNode("p",null,"正在加载智能体…",-1)])])):C.error?(a.openBlock(),a.createElementBlock("div",gO,[a.createElementVNode("p",null,a.toDisplayString(C.error),1)])):t.value?(a.openBlock(),a.createElementBlock("div",IO,[...d[1]||(d[1]=[a.createElementVNode("p",null,"暂无可用智能体",-1)])])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.items,o=>(a.openBlock(),a.createElementBlock("button",{key:o.id,type:"button",class:a.normalizeClass(["apf-assistant-picker__item",{"is-active":C.modelValue===o.id}]),onClick:n=>e(o)},[a.createElementVNode("div",AO,[a.createElementVNode("span",iO,[a.createVNode(a.unref($),{name:l(o),size:22},null,8,["name"])]),a.createElementVNode("span",lO,[a.createElementVNode("b",null,a.toDisplayString(o.name),1),a.createElementVNode("small",null,a.toDisplayString(o.description||"适合处理一类明确任务"),1),a.createElementVNode("span",eO,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(i(o),n=>(a.openBlock(),a.createElementBlock("span",{key:n,class:a.normalizeClass(["apf-assistant-picker__cap",{"is-confirm":n==="需要确认"}])},a.toDisplayString(n),3))),128))])])]),a.createElementVNode("span",{class:a.normalizeClass(["apf-assistant-picker__choose",{"is-selected":C.modelValue===o.id}])},a.toDisplayString(C.modelValue===o.id?"已选择":"开始使用"),3)],10,CO))),128))]))}}),[["__scopeId","data-v-f05e69c0"]]),aO={class:"apf-model-picker"},cO=E(a.defineComponent({__name:"ModelPicker",props:{models:{},modelValue:{},loading:{type:Boolean}},emits:["update:modelValue"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=a.resolveComponent("el-option"),e=a.resolveComponent("el-select");return a.openBlock(),a.createElementBlock("label",aO,[a.createVNode(e,{"model-value":C.modelValue||void 0,disabled:C.loading||!C.models.length,placeholder:"选择模型","onUpdate:modelValue":i[0]||(i[0]=t=>g("update:modelValue",t))},{default:a.withCtx(()=>[C.loading?(a.openBlock(),a.createBlock(l,{key:0,label:"正在加载模型…",value:"",disabled:""})):C.models.length?a.createCommentVNode("",!0):(a.openBlock(),a.createBlock(l,{key:1,label:"暂无可用模型",value:"",disabled:""})),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(C.models,t=>(a.openBlock(),a.createBlock(l,{key:t.id,label:`${t.name} · ${t.provider}`,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])])}}}),[["__scopeId","data-v-483ae73d"]]);function dO(C){const{containerRef:I,autoScroll:g=!0,behavior:A="smooth",offset:i=50}=C,l=a.ref(!0),e=a.ref(g);function t(){const Z=I.value;if(!Z)return!0;const{scrollTop:m,scrollHeight:b,clientHeight:G}=Z;return b-m-G<i}async function c(Z=!0){if(!Z&&!e.value)return;await a.nextTick();const m=I.value;m&&m.scrollTo({top:m.scrollHeight,behavior:A})}function d(Z){const m=I.value;m&&m.scrollTo({top:Z,behavior:A})}function o(){e.value=!0}function n(){e.value=!1}function s(){l.value=t(),l.value&&(e.value=!0)}return a.onMounted(()=>{const Z=I.value;Z&&(Z.addEventListener("scroll",s),l.value=t())}),a.onUnmounted(()=>{const Z=I.value;Z&&Z.removeEventListener("scroll",s)}),{scrollToBottom:c,scrollTo:d,isAtBottom:l,autoScrollEnabled:e,checkIfAtBottom:t,enableAutoScroll:o,disableAutoScroll:n}}const rw=Symbol("fg-toast");function oO(C){return{[rw]:C}}function nO(){const C=a.inject(rw);return{show(I,g="info",A){var i;(i=C==null?void 0:C.value)==null||i.show(I,g,A)},info(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"info",g)},success(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"success",g)},warning(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"warning",g)},error(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"error",g)}}}function sO(){async function C(A,i={}){const{title:l="确认操作",type:e="warning",confirmButtonText:t="确定",cancelButtonText:c="取消"}=i;try{return await BC.ElMessageBox.confirm(A,l,{confirmButtonText:t,cancelButtonText:c,type:e}),!0}catch{return!1}}async function I(A,i={}){return C(`此操作将永久删除${A},是否继续?`,{title:"确认删除",type:"warning",confirmButtonText:"确认删除",...i})}async function g(A,i={}){return C(A,{title:"确认操作",type:"warning",...i})}return{confirm:C,confirmDelete:I,confirmDanger:g}}function ZO(){return{success(C,I={}){BC.ElMessage({message:C,type:"success",...I})},error(C,I={}){BC.ElMessage({message:C,type:"error",...I})},warning(C,I={}){BC.ElMessage({message:C,type:"warning",...I})},info(C,I={}){BC.ElMessage({message:C,type:"info",...I})}}}function mO(C,I=300){const g=a.ref(null);function A(...i){g.value&&clearTimeout(g.value),g.value=setTimeout(()=>{C(...i),g.value=null},I)}return a.onUnmounted(()=>{g.value&&clearTimeout(g.value)}),A}function bO(C,I){var t;const g=a.ref(1),A=a.ref((I==null?void 0:I.initialPageSize)??zZ),i=a.computed(()=>{const c=C.value,d=(g.value-1)*A.value;return c.slice(d,d+A.value)}),l=a.computed(()=>C.value.length);function e(){g.value=1}return a.watch(A,()=>{g.value=1},{flush:"sync"}),a.watch(C,c=>{const d=Math.max(1,Math.ceil(c.length/A.value)||1);g.value>d&&(g.value=d)}),(t=I==null?void 0:I.resetOn)!=null&&t.length&&a.watch(I.resetOn,()=>{e()}),{currentPage:g,pageSize:A,pagedItems:i,total:l,resetPage:e}}function GO(C={}){const{timeout:I=15e3,silentError:g=!1}=C,A=a.ref(!1),i=a.ref(null),l=a.ref(!1),e=a.computed(()=>i.value!==null);let t=null,c=0;function d(){c++,c===1&&(A.value=!0,i.value=null,l.value=!1,t=setTimeout(()=>{l.value=!0},I))}function o(){c=Math.max(0,c-1),c===0&&(A.value=!1,l.value=!1,t&&(clearTimeout(t),t=null))}async function n(Z){d();try{return await Z()}catch(m){return g||(i.value=m instanceof Error?m.message:"加载失败"),null}finally{o()}}function s(){c=0,A.value=!1,i.value=null,l.value=!1,t&&(clearTimeout(t),t=null)}return{loading:A,error:i,timedOut:l,hasError:e,withLoading:n,reset:s}}const Zm=new Map;function rO(C){const{url:I,token:g,projectId:A,reconnectInterval:i=3e3,maxRetries:l=1/0}=C;let e=Zm.get(I);e||(e={ws:null,status:a.ref("closed"),refCount:0,handlers:new Map,subscribedProjects:new Set,reconnectTimer:null,pingTimer:null,pongTimer:null,retries:0,reconnectInterval:i,maxRetries:l,intentionalClose:!1,token:g},Zm.set(I,e)),e.refCount+=1,e.reconnectInterval=i,e.maxRetries=l,e.token=g;const t=[],c=e.status,d=()=>a.toValue(A);function o(){e&&(e.pingTimer&&clearInterval(e.pingTimer),e.pongTimer&&clearTimeout(e.pongTimer),e.pingTimer=null,e.pongTimer=null)}function n(){e&&(o(),e.pingTimer=setInterval(()=>{!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN||(e.ws.send(JSON.stringify({action:"ping"})),e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=setTimeout(()=>{var B;(B=e==null?void 0:e.ws)==null||B.close()},6e4))},3e4))}function s(){if(!e||e.intentionalClose)return;if(e.retries>=e.maxRetries){e.status.value="error";return}const B=Math.min(e.reconnectInterval*2**e.retries,3e4);e.retries+=1,e.reconnectTimer&&clearTimeout(e.reconnectTimer),e.reconnectTimer=setTimeout(()=>{G()},B)}function Z(B){if(!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN)return;const W={action:"subscribe",project_id:B??null},w=typeof e.token=="function"?e.token():e.token;if(w&&(W.token=w),!e.subscribedProjects.has(B??null)){if(B==null){e.ws.send(JSON.stringify(W)),e.subscribedProjects.add(null);return}e.ws.send(JSON.stringify(W)),e.subscribedProjects.add(B)}}function m(){if(!e)return;e.subscribedProjects.clear();const B=new Set;let W=!1;for(const Y of e.handlers.values())for(const p of Y){const V=p.getProjectId();V==null?W=!0:B.add(V)}const w=d();w==null?W=!0:B.add(w),W&&Z(void 0);for(const Y of B)Z(Y)}function b(B){if(!e)return;const W=e.handlers.get(B.type);if(W)for(const w of W){const Y=w.getProjectId();Y!=null&&Y!==B.project_id||w.handler(B.data)}}function G(){if(!e)return;if(e.ws&&(e.ws.readyState===WebSocket.OPEN||e.ws.readyState===WebSocket.CONNECTING)){e.ws.readyState===WebSocket.OPEN&&Z(d());return}e.intentionalClose=!1,e.status.value="connecting";const B=new WebSocket(I);e.ws=B,B.onopen=()=>{e&&(e.status.value="open",e.retries=0,n(),m())},B.onmessage=W=>{if(e)try{const w=JSON.parse(String(W.data));if(w.action==="pong"||w.type==="pong"){e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=null;return}typeof w.type=="string"&&b(w)}catch{}},B.onerror=()=>{e&&(e.status.value="error")},B.onclose=()=>{e&&(o(),e.ws=null,e.subscribedProjects.clear(),e.intentionalClose?e.status.value="closed":(e.status.value="closed",s()))}}function r(){if(e){for(const B of t)for(const W of e.handlers.values())W.delete(B);t.length=0}}function h(){var B;e&&(r(),e.refCount=Math.max(0,e.refCount-1),!(e.refCount>0)&&(e.intentionalClose=!0,e.reconnectTimer&&clearTimeout(e.reconnectTimer),o(),(B=e.ws)==null||B.close(),e.ws=null,e.status.value="closed",Zm.delete(I),e=void 0))}function u(B,W){var p;if(!e)return()=>{};let w=e.handlers.get(B);w||(w=new Set,e.handlers.set(B,w));const Y={getProjectId:d,handler:W};return w.add(Y),t.push(Y),((p=e.ws)==null?void 0:p.readyState)===WebSocket.OPEN&&Z(d()),()=>{w==null||w.delete(Y);const V=t.indexOf(Y);V>=0&&t.splice(V,1)}}return G(),a.watch(d,B=>{var W;((W=e==null?void 0:e.ws)==null?void 0:W.readyState)===WebSocket.OPEN&&Z(B)}),a.onUnmounted(()=>{h()}),{status:c,connect:G,disconnect:h,on:u}}function hO(C){if(!C)return"操作失败";if(typeof C=="string")return C;if(C instanceof Error)return C.message||"操作失败";if(typeof C=="object"){const I=C;if(I.message)return I.message;if(I.errors&&typeof I.errors=="object"){const g=[];for(const A of Object.values(I.errors))Array.isArray(A)&&g.push(...A);if(g.length>0)return g.join(";")}if(I.code)return`错误码:${I.code}`}return"操作失败"}const uO="1.15.1",BO="2.14.2",WO="2026-08-27";/*! *****************************************************************************
|
|
73
73
|
Copyright (c) Microsoft Corporation.
|
|
74
74
|
|
|
75
75
|
Permission to use, copy, modify, and/or distribute this software for any
|