@apform-ui/core 1.4.0 → 1.4.2

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.js CHANGED
@@ -7162,7 +7162,7 @@ const qp = {
7162
7162
  popover: 1060,
7163
7163
  tooltip: 1070,
7164
7164
  toast: 1080
7165
- }, sf = "1.4.0", of = "2.14.2", rf = "2026-08-27";
7165
+ }, sf = "1.4.2", of = "2.14.2", rf = "2026-08-27";
7166
7166
  export {
7167
7167
  Kh as APP_ICON_NAMES,
7168
7168
  tf as AVATAR_SIZE,
@@ -68,4 +68,4 @@ ${t}</tr>
68
68
  `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${fe(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:n,tokens:a}){let o=this.parser.parseInline(a),l=_a(t);if(l===null)return o;t=l;let r='<a href="'+t+'"';return n&&(r+=' title="'+fe(n)+'"'),r+=">"+o+"</a>",r}image({href:t,title:n,text:a,tokens:o}){o&&(a=this.parser.parseInline(o,this.parser.textRenderer));let l=_a(t);if(l===null)return fe(a);t=l;let r=`<img src="${t}" alt="${fe(a)}"`;return n&&(r+=` title="${fe(n)}"`),r+=">",r}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:fe(t.text)}},tn=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ce=class Bn{constructor(n){P(this,"options");P(this,"renderer");P(this,"textRenderer");this.options=n||xe,this.options.renderer=this.options.renderer||new bt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tn}static parse(n,a){return new Bn(a).parse(n)}static parseInline(n,a){return new Bn(a).parseInline(n)}parse(n){var o,l;this.renderer.parser=this;let a="";for(let r=0;r<n.length;r++){let i=n[r];if((l=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&l[i.type]){let s=i,d=this.options.extensions.renderers[s.type].call({parser:this},s);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(s.type)){a+=d||"";continue}}let c=i;switch(c.type){case"space":{a+=this.renderer.space(c);break}case"hr":{a+=this.renderer.hr(c);break}case"heading":{a+=this.renderer.heading(c);break}case"code":{a+=this.renderer.code(c);break}case"table":{a+=this.renderer.table(c);break}case"blockquote":{a+=this.renderer.blockquote(c);break}case"list":{a+=this.renderer.list(c);break}case"checkbox":{a+=this.renderer.checkbox(c);break}case"html":{a+=this.renderer.html(c);break}case"def":{a+=this.renderer.def(c);break}case"paragraph":{a+=this.renderer.paragraph(c);break}case"text":{a+=this.renderer.text(c);break}default:{let s='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return a}parseInline(n,a=this.renderer){var l,r;this.renderer.parser=this;let o="";for(let i=0;i<n.length;i++){let c=n[i];if((r=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&r[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(c.type)){o+=d||"";continue}}let s=c;switch(s.type){case"escape":{o+=a.text(s);break}case"html":{o+=a.html(s);break}case"link":{o+=a.link(s);break}case"image":{o+=a.image(s);break}case"checkbox":{o+=a.checkbox(s);break}case"strong":{o+=a.strong(s);break}case"em":{o+=a.em(s);break}case"codespan":{o+=a.codespan(s);break}case"br":{o+=a.br(s);break}case"del":{o+=a.del(s);break}case"text":{o+=a.text(s);break}default:{let d='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return o}},Xe=(Ct=class{constructor(t){P(this,"options");P(this,"block");this.options=t||xe}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ie.lex:ie.lexInline}provideParser(t=this.block){return t?ce.parse:ce.parseInline}},P(Ct,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),P(Ct,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ct),oc=class{constructor(...t){P(this,"defaults",Yt());P(this,"options",this.setOptions);P(this,"parse",this.parseMarkdown(!0));P(this,"parseInline",this.parseMarkdown(!1));P(this,"Parser",ce);P(this,"Renderer",bt);P(this,"TextRenderer",tn);P(this,"Lexer",ie);P(this,"Tokenizer",yt);P(this,"Hooks",Xe);this.use(...t)}walkTokens(t,n){var o,l;let a=[];for(let r of t)switch(a=a.concat(n.call(this,r)),r.type){case"table":{let i=r;for(let c of i.header)a=a.concat(this.walkTokens(c.tokens,n));for(let c of i.rows)for(let s of c)a=a.concat(this.walkTokens(s.tokens,n));break}case"list":{let i=r;a=a.concat(this.walkTokens(i.items,n));break}default:{let i=r;(l=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&l[i.type]?this.defaults.extensions.childTokens[i.type].forEach(c=>{let s=i[c].flat(1/0);a=a.concat(this.walkTokens(s,n))}):i.tokens&&(a=a.concat(this.walkTokens(i.tokens,n)))}}return a}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(a=>{let o={...a};if(o.async=this.defaults.async||o.async||!1,a.extensions&&(a.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let r=n.renderers[l.name];r?n.renderers[l.name]=function(...i){let c=l.renderer.apply(this,i);return c===!1&&(c=r.apply(this,i)),c}:n.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=n[l.level];r?r.unshift(l.tokenizer):n[l.level]=[l.tokenizer],l.start&&(l.level==="block"?n.startBlock?n.startBlock.push(l.start):n.startBlock=[l.start]:l.level==="inline"&&(n.startInline?n.startInline.push(l.start):n.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(n.childTokens[l.name]=l.childTokens)}),o.extensions=n),a.renderer){let l=this.defaults.renderer||new bt(this.defaults);for(let r in a.renderer){if(!(r in l))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let i=r,c=a.renderer[i],s=l[i];l[i]=(...d)=>{let f=c.apply(l,d);return f===!1&&(f=s.apply(l,d)),f||""}}o.renderer=l}if(a.tokenizer){let l=this.defaults.tokenizer||new yt(this.defaults);for(let r in a.tokenizer){if(!(r in l))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let i=r,c=a.tokenizer[i],s=l[i];l[i]=(...d)=>{let f=c.apply(l,d);return f===!1&&(f=s.apply(l,d)),f}}o.tokenizer=l}if(a.hooks){let l=this.defaults.hooks||new Xe;for(let r in a.hooks){if(!(r in l))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let i=r,c=a.hooks[i],s=l[i];Xe.passThroughHooks.has(r)?l[i]=d=>{if(this.defaults.async&&Xe.passThroughHooksRespectAsync.has(r))return(async()=>{let u=await c.call(l,d);return s.call(l,u)})();let f=c.call(l,d);return s.call(l,f)}:l[i]=(...d)=>{if(this.defaults.async)return(async()=>{let u=await c.apply(l,d);return u===!1&&(u=await s.apply(l,d)),u})();let f=c.apply(l,d);return f===!1&&(f=s.apply(l,d)),f}}o.hooks=l}if(a.walkTokens){let l=this.defaults.walkTokens,r=a.walkTokens;o.walkTokens=function(i){let c=[];return c.push(r.call(this,i)),l&&(c=c.concat(l.call(this,i))),c}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return ie.lex(t,n??this.defaults)}parser(t,n){return ce.parse(t,n??this.defaults)}parseMarkdown(t){return(n,a)=>{let o={...a},l={...this.defaults,...o},r=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&o.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let i=l.hooks?await l.hooks.preprocess(n):n,c=await(l.hooks?await l.hooks.provideLexer(t):t?ie.lex:ie.lexInline)(i,l),s=l.hooks?await l.hooks.processAllTokens(c):c;l.walkTokens&&await Promise.all(this.walkTokens(s,l.walkTokens));let d=await(l.hooks?await l.hooks.provideParser(t):t?ce.parse:ce.parseInline)(s,l);return l.hooks?await l.hooks.postprocess(d):d})().catch(r);try{l.hooks&&(n=l.hooks.preprocess(n));let i=(l.hooks?l.hooks.provideLexer(t):t?ie.lex:ie.lexInline)(n,l);l.hooks&&(i=l.hooks.processAllTokens(i)),l.walkTokens&&this.walkTokens(i,l.walkTokens);let c=(l.hooks?l.hooks.provideParser(t):t?ce.parse:ce.parseInline)(i,l);return l.hooks&&(c=l.hooks.postprocess(c)),c}catch(i){return r(i)}}}onError(t,n){return a=>{if(a.message+=`
69
69
  Please report this to https://github.com/markedjs/marked.`,t){let o="<p>An error occurred:</p><pre>"+fe(a.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(a);throw a}}},Te=new oc;function D(t,n){return Te.parse(t,n)}D.options=D.setOptions=function(t){return Te.setOptions(t),D.defaults=Te.defaults,sa(D.defaults),D},D.getDefaults=Yt,D.defaults=xe;function lc(...t){return Te.use(...t),D.defaults=Te.defaults,sa(D.defaults),D}D.use=lc,D.walkTokens=function(t,n){return Te.walkTokens(t,n)},D.parseInline=Te.parseInline,D.Parser=ce,D.parser=ce.parse,D.Renderer=bt,D.TextRenderer=tn,D.Lexer=ie,D.lexer=ie.lex,D.Tokenizer=yt,D.Hooks=Xe,D.parse=D,D.options,D.setOptions,D.walkTokens,D.parseInline,ce.parse,ie.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 xa(t,n){(n==null||n>t.length)&&(n=t.length);for(var a=0,o=Array(n);a<n;a++)o[a]=t[a];return o}function rc(t){if(Array.isArray(t))return t}function sc(t,n){var a=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(a!=null){var o,l,r,i,c=[],s=!0,d=!1;try{if(r=(a=a.call(t)).next,n!==0)for(;!(s=(o=r.call(a)).done)&&(c.push(o.value),c.length!==n);s=!0);}catch(f){d=!0,l=f}finally{try{if(!s&&a.return!=null&&(i=a.return(),Object(i)!==i))return}finally{if(d)throw l}}return c}}function ic(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
70
70
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cc(t,n){return rc(t)||sc(t,n)||dc(t,n)||ic()}function dc(t,n){if(t){if(typeof t=="string")return xa(t,n);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?xa(t,n):void 0}}const $a=Object.entries,Ta=Object.setPrototypeOf,pc=Object.isFrozen,fc=Object.getPrototypeOf,hc=Object.getOwnPropertyDescriptor;let Y=Object.freeze,Z=Object.seal,Re=Object.create,Sa=typeof Reflect<"u"&&Reflect,nn=Sa.apply,an=Sa.construct;Y||(Y=function(n){return n}),Z||(Z=function(n){return n}),nn||(nn=function(n,a){for(var o=arguments.length,l=new Array(o>2?o-2:0),r=2;r<o;r++)l[r-2]=arguments[r];return n.apply(a,l)}),an||(an=function(n){for(var a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];return new n(...o)});const Se=W(Array.prototype.forEach),mc=W(Array.prototype.lastIndexOf),Va=W(Array.prototype.pop),Je=W(Array.prototype.push),uc=W(Array.prototype.splice),De=Array.isArray,ve=W(String.prototype.toLowerCase),on=W(String.prototype.toString),Ba=W(String.prototype.match),et=W(String.prototype.replace),Na=W(String.prototype.indexOf),gc=W(String.prototype.trim),kc=W(Number.prototype.toString),yc=W(Boolean.prototype.toString),Aa=typeof BigInt>"u"?null:W(BigInt.prototype.toString),za=typeof Symbol>"u"?null:W(Symbol.prototype.toString),v=W(Object.prototype.hasOwnProperty),tt=W(Object.prototype.toString),X=W(RegExp.prototype.test),Ve=bc(TypeError);function W(t){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];return nn(t,n,o)}}function bc(t){return function(){for(var n=arguments.length,a=new Array(n),o=0;o<n;o++)a[o]=arguments[o];return an(t,a)}}function R(t,n){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ve;if(Ta&&Ta(t,null),!De(n))return t;let o=n.length;for(;o--;){let l=n[o];if(typeof l=="string"){const r=a(l);r!==l&&(pc(n)||(n[o]=r),l=r)}t[l]=!0}return t}function _c(t){for(let n=0;n<t.length;n++)v(t,n)||(t[n]=null);return t}function ae(t){const n=Re(null);for(const o of $a(t)){var a=cc(o,2);const l=a[0],r=a[1];v(t,l)&&(De(r)?n[l]=_c(r):r&&typeof r=="object"&&r.constructor===Object?n[l]=ae(r):n[l]=r)}return n}function wc(t){switch(typeof t){case"string":return t;case"number":return kc(t);case"boolean":return yc(t);case"bigint":return Aa?Aa(t):"0";case"symbol":return za?za(t):"Symbol()";case"undefined":return tt(t);case"function":case"object":{if(t===null)return tt(t);const n=t,a=de(n,"toString");if(typeof a=="function"){const o=a(n);return typeof o=="string"?o:tt(o)}return tt(t)}default:return tt(t)}}function de(t,n){for(;t!==null;){const o=hc(t,n);if(o){if(o.get)return W(o.get);if(typeof o.value=="function")return W(o.value)}t=fc(t)}function a(){return null}return a}function Cc(t){try{return X(t,""),!0}catch{return!1}}const Ma=Y(["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"]),ln=Y(["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"]),rn=Y(["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"]),Ec=Y(["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"]),sn=Y(["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"]),xc=Y(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),La=Y(["#text"]),Ia=Y(["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"]),cn=Y(["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"]),Ra=Y(["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"]),_t=Y(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$c=Z(/{{[\w\W]*|^[\w\W]*}}/g),Tc=Z(/<%[\w\W]*|^[\w\W]*%>/g),Sc=Z(/\${[\w\W]*/g),Vc=Z(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bc=Z(/^aria-[\-\w]+$/),Da=Z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Nc=Z(/^(?:\w+script|data):/i),Ac=Z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zc=Z(/^html$/i),Mc=Z(/^[a-z][.\w]*(-[.\w]+)+$/i),Pa=Z(/<[/\w!]/g),Oa=Z(/<[/\w]/g),Lc=Z(/<\/no(script|embed|frames)/i),Ic=Z(/\/>/i),oe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ha=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Rc=Y(R({},Ha)),Dc=(function(){const t={};return Se(Ha,n=>{t[n]=Z(new RegExp("</"+n+"(?=[\\t\\n\\f\\r />])","i"))}),Y(t)})(),Pc=function(){return typeof window>"u"?null:window},Oc=function(n,a){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let o=null;const l="data-tt-policy-suffix";a&&a.hasAttribute(l)&&(o=a.getAttribute(l));const r="dompurify"+(o?"#"+o:"");try{return n.createPolicy(r,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Fa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},be=function(n,a,o,l){return v(n,a)&&De(n[a])?R(l.base?ae(l.base):{},n[a],l.transform):o},dn=function(n,a,o){const l=v(n,a)?n[a]:void 0;return l&&typeof l=="object"?ae(l):o()};function Ua(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pc();const n=b=>Ua(b);if(n.version="3.4.14",n.removed=[],!t||!t.document||t.document.nodeType!==oe.document||!t.Element)return n.isSupported=!1,n;let a=t.document;const o=a,l=o.currentScript;t.DocumentFragment;const r=t.HTMLTemplateElement,i=t.Node,c=t.Element,s=t.NodeFilter,d=t.NamedNodeMap;d===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const f=t.DOMParser,u=t.trustedTypes,h=c.prototype,x=de(h,"cloneNode"),g=de(h,"remove"),A=de(h,"nextSibling"),$=de(h,"childNodes"),T=de(h,"parentNode"),E=de(h,"shadowRoot"),S=de(h,"attributes"),_=i&&i.prototype?de(i.prototype,"nodeType"):null,w=i&&i.prototype?de(i.prototype,"nodeName"):null,B=i&&i.prototype?de(i.prototype,"ownerDocument"):null,j=function(p){return _?_(p):p.nodeType},ee=function(p){return w?w(p):p.nodeName};if(typeof r=="function"){const b=a.createElement("template");b.content&&b.content.ownerDocument&&(a=b.content.ownerDocument)}let z,N="",re,pe=!1,_e=0;const nt=function(){if(_e>0)throw Ve('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.')},ke=function(p){nt(),_e++;try{return z.createHTML(p)}finally{_e--}},K=function(p){nt(),_e++;try{return z.createScriptURL(p)}finally{_e--}},Ja=function(){return pe||(re=Oc(u,l),pe=!0),re},Et=a,fn=Et.implementation,va=Et.createNodeIterator,Ad=Et.createDocumentFragment,zd=Et.getElementsByTagName,Md=o.importNode;let H=Fa();n.isSupported=typeof $a=="function"&&typeof T=="function"&&fn&&fn.createHTMLDocument!==void 0;const Ld=$c,Id=Tc,Rd=Sc,Dd=Vc,Pd=Bc,Od=Nc,eo=Ac,Hd=Mc;let to=Da,F=null;const hn=R({},[...Ma,...ln,...rn,...sn,...La]);let U=null;const mn=R({},[...Ia,...cn,...Ra,..._t]);let he=Object.seal(Re(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}})),at=null,no=null;const we=Object.seal(Re(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ao=!0,un=!0,oo=!1,lo=!0,Ce=!1,Be=!0,Ne=!1,gn=!1,xt=null,$t=null,kn=!1,Pe=!1,Tt=!1,St=!1,ro=!0,so=!1;const io="user-content-";let yn=!0,bn=!1,Oe={},He=null;const co=R({},["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 po=null;const fo=R({},["audio","video","img","source","image","track"]);let ho=null;const mo=R({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vt="http://www.w3.org/1998/Math/MathML",Bt="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let Fe=me,_n=!1,wn=null;const Fd=R({},[Vt,Bt,me],on),uo=Y(["mi","mo","mn","ms","mtext"]);let Cn=R({},uo);const go=Y(["annotation-xml"]);let En=R({},go);const Ud=R({},["title","style","font","a","script"]);let ot=null;const jd=["application/xhtml+xml","text/html"],qd="text/html";let G=null,Ue=null;const Gd=a.createElement("form"),ko=function(p){return p instanceof RegExp||p instanceof Function},xn=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ue&&Ue===p)return;(!p||typeof p!="object")&&(p={}),p=ae(p),ot=jd.indexOf(p.PARSER_MEDIA_TYPE)===-1?qd:p.PARSER_MEDIA_TYPE,G=ot==="application/xhtml+xml"?on:ve,F=be(p,"ALLOWED_TAGS",hn,{transform:G}),U=be(p,"ALLOWED_ATTR",mn,{transform:G}),wn=be(p,"ALLOWED_NAMESPACES",Fd,{transform:on}),ho=be(p,"ADD_URI_SAFE_ATTR",mo,{transform:G,base:mo}),po=be(p,"ADD_DATA_URI_TAGS",fo,{transform:G,base:fo}),He=be(p,"FORBID_CONTENTS",co,{transform:G}),at=be(p,"FORBID_TAGS",ae({}),{transform:G}),no=be(p,"FORBID_ATTR",ae({}),{transform:G}),Oe=v(p,"USE_PROFILES")?p.USE_PROFILES&&typeof p.USE_PROFILES=="object"?ae(p.USE_PROFILES):p.USE_PROFILES:!1,ao=p.ALLOW_ARIA_ATTR!==!1,un=p.ALLOW_DATA_ATTR!==!1,oo=p.ALLOW_UNKNOWN_PROTOCOLS||!1,lo=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=p.SAFE_FOR_TEMPLATES||!1,Be=p.SAFE_FOR_XML!==!1,Ne=p.WHOLE_DOCUMENT||!1,Pe=p.RETURN_DOM||!1,Tt=p.RETURN_DOM_FRAGMENT||!1,St=p.RETURN_TRUSTED_TYPE||!1,kn=p.FORCE_BODY||!1,ro=p.SANITIZE_DOM!==!1,so=p.SANITIZE_NAMED_PROPS||!1,yn=p.KEEP_CONTENT!==!1,bn=p.IN_PLACE||!1,to=Cc(p.ALLOWED_URI_REGEXP)?p.ALLOWED_URI_REGEXP:Da,Fe=typeof p.NAMESPACE=="string"?p.NAMESPACE:me,Cn=dn(p,"MATHML_TEXT_INTEGRATION_POINTS",()=>R({},uo)),En=dn(p,"HTML_INTEGRATION_POINTS",()=>R({},go));const m=dn(p,"CUSTOM_ELEMENT_HANDLING",()=>Re(null));if(he=Re(null),v(m,"tagNameCheck")&&ko(m.tagNameCheck)&&(he.tagNameCheck=m.tagNameCheck),v(m,"attributeNameCheck")&&ko(m.attributeNameCheck)&&(he.attributeNameCheck=m.attributeNameCheck),v(m,"allowCustomizedBuiltInElements")&&typeof m.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=m.allowCustomizedBuiltInElements),Z(he),Ce&&(un=!1),Tt&&(Pe=!0),Oe&&(F=R({},La),U=Re(null),Oe.html===!0&&(R(F,Ma),R(U,Ia)),Oe.svg===!0&&(R(F,ln),R(U,cn),R(U,_t)),Oe.svgFilters===!0&&(R(F,rn),R(U,cn),R(U,_t)),Oe.mathMl===!0&&(R(F,sn),R(U,Ra),R(U,_t))),we.tagCheck=null,we.attributeCheck=null,v(p,"ADD_TAGS")&&(typeof p.ADD_TAGS=="function"?we.tagCheck=p.ADD_TAGS:De(p.ADD_TAGS)&&(F===hn&&(F=ae(F)),R(F,p.ADD_TAGS,G))),v(p,"ADD_ATTR")&&(typeof p.ADD_ATTR=="function"?we.attributeCheck=p.ADD_ATTR:De(p.ADD_ATTR)&&(U===mn&&(U=ae(U)),R(U,p.ADD_ATTR,G))),v(p,"ADD_FORBID_CONTENTS")&&De(p.ADD_FORBID_CONTENTS)&&(He===co&&(He=ae(He)),R(He,p.ADD_FORBID_CONTENTS,G)),yn&&(F["#text"]=!0),Ne&&R(F,["html","head","body"]),F.table&&(R(F,["tbody"]),delete at.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ve('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const k=z;z=p.TRUSTED_TYPES_POLICY;try{N=ke("")}catch(C){throw z=k,C}}else p.TRUSTED_TYPES_POLICY===null?(z=void 0,N=""):(z===void 0&&(z=Ja()),z&&typeof N=="string"&&(N=ke("")));Y&&Y(p),Ue=p},yo=R({},[...ln,...rn,...Ec]),bo=R({},[...sn,...xc]),Wd=function(p,m,k){return m.namespaceURI===me?p==="svg":m.namespaceURI===Vt?p==="svg"&&(k==="annotation-xml"||Cn[k]):!!yo[p]},Yd=function(p,m,k){return m.namespaceURI===me?p==="math":m.namespaceURI===Bt?p==="math"&&En[k]:!!bo[p]},Zd=function(p,m,k){return m.namespaceURI===Bt&&!En[k]||m.namespaceURI===Vt&&!Cn[k]?!1:!bo[p]&&(Ud[p]||!yo[p])},Kd=function(p){let m=T(p);(!m||!m.tagName)&&(m={namespaceURI:Fe,tagName:"template"});const k=ve(p.tagName),C=ve(m.tagName);return wn[p.namespaceURI]?p.namespaceURI===Bt?Wd(k,m,C):p.namespaceURI===Vt?Yd(k,m,C):p.namespaceURI===me?Zd(k,m,C):!!(ot==="application/xhtml+xml"&&wn[p.namespaceURI]):!1},Ee=function(p){Je(n.removed,{element:p});try{T(p).removeChild(p)}catch{if(g(p),!T(p))throw Ve("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},_o=function(p,m,k){try{p.removeAttributeNode(m)}catch{try{p.removeAttribute(k)}catch{}}},Nt=function(p){At(p);const m=$(p);if(m){const C=[];Se(m,V=>{Je(C,V)}),Se(C,V=>{try{g(V)}catch{}})}const k=S(p);if(k)for(let C=k.length-1;C>=0;--C){const V=k[C],M=V&&V.name;typeof M=="string"&&_o(p,V,M)}},Ae=function(p,m,k){if(!k)try{k=m.getAttributeNode(p)}catch{k=null}Je(n.removed,{attribute:k||null,from:m});try{k?m.removeAttributeNode(k):m.removeAttribute(p)}catch{try{m.removeAttribute(p)}catch{}}if(p==="is")if(Pe||Tt)try{Ee(m)}catch{}else try{m.setAttribute(p,"")}catch{}},Qd=function(p){const m=S(p);if(m)for(let k=m.length-1;k>=0;--k){const C=m[k],V=C&&C.name;typeof V!="string"||U[G(V)]||_o(p,C,V)}},At=function(p){const m=[p];for(;m.length>0;){const k=m.pop();j(k)===oe.element&&Qd(k);const V=$(k);if(V)for(let M=V.length-1;M>=0;--M)m.push(V[M])}},wo=function(p,m){return Be?p==="patchsrc"?!0:p==="for"&&m!=="label"&&m!=="output":!1},Xd=function(p){if(!Be)return;const m=[p];for(;m.length>0;){const k=m.pop(),C=j(k);if(C===oe.processingInstruction||C===oe.comment&&X(Oa,k.data)){try{g(k)}catch{}continue}if(C===oe.element){const M=k,O=G(ee(k));try{M.hasAttribute&&M.hasAttribute("patchsrc")&&M.removeAttribute("patchsrc"),M.hasAttribute&&M.hasAttribute("for")&&wo("for",O)&&M.removeAttribute("for")}catch{}}const V=$(k);if(V)for(let M=V.length-1;M>=0;--M)m.push(V[M])}},Co=function(p){let m=null,k=null;if(kn)p="<remove></remove>"+p;else{const M=Ba(p,/^[\r\n\t ]+/);k=M&&M[0]}ot==="application/xhtml+xml"&&Fe===me&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const C=z?ke(p):p;if(Fe===me)try{m=new f().parseFromString(C,ot)}catch{}if(!m||!m.documentElement){m=fn.createDocument(Fe,"template",null);try{m.documentElement.innerHTML=_n?N:C}catch{}}const V=m.body||m.documentElement;return p&&k&&V.insertBefore(a.createTextNode(k),V.childNodes[0]||null),Fe===me?zd.call(m,Ne?"html":"body")[0]:Ne?m.documentElement:V},Eo=function(p){const m=B?B(p):p.ownerDocument;return va.call(m||p,p,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT|s.SHOW_PROCESSING_INSTRUCTION|s.SHOW_CDATA_SECTION,null)},zt=function(p){return p=et(p,Ld," "),p=et(p,Id," "),p=et(p,Rd," "),p},$n=function(p){var m;p.normalize();const k=B?B(p):p.ownerDocument,C=va.call(k||p,p,s.SHOW_TEXT|s.SHOW_COMMENT|s.SHOW_CDATA_SECTION|s.SHOW_PROCESSING_INSTRUCTION,null);let V=C.nextNode();for(;V;)V.data=zt(V.data),V=C.nextNode();const M=(m=p.querySelectorAll)===null||m===void 0?void 0:m.call(p,"template");M&&Se(M,O=>{je(O.content)&&$n(O.content)})},Mt=function(p){const m=w?w(p):null;return typeof m!="string"||G(m)!=="form"?!1:typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||p.attributes!==S(p)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function"||p.nodeType!==_(p)||p.childNodes!==$(p)},je=function(p){if(!_||typeof p!="object"||p===null)return!1;try{return _(p)===oe.documentFragment}catch{return!1}},lt=function(p){if(!_||typeof p!="object"||p===null)return!1;try{return typeof _(p)=="number"}catch{return!1}};function ue(b,p,m){b.length!==0&&Se(b,k=>{k.call(n,p,m,Ue)})}const Jd=function(p,m){return!!(Be&&p.hasChildNodes()&&!lt(p.firstElementChild)&&X(Pa,p.textContent)&&X(Pa,p.innerHTML)||Be&&p.namespaceURI===me&&Rc[m]&&(lt(p.firstElementChild)||typeof p.textContent=="string"&&X(Dc[m],p.textContent))||p.nodeType===oe.processingInstruction||Be&&p.nodeType===oe.comment&&X(Oa,p.data))},Lt=function(p,m){if(p instanceof RegExp)return X(p,m);if(p instanceof Function){for(var k=arguments.length,C=new Array(k>2?k-2:0),V=2;V<k;V++)C[V-2]=arguments[V];return!!p(m,...C)}return!1},vd=function(p,m,k){if(!at[m]&&Vo(m)&&Lt(he.tagNameCheck,m))return!1;if(yn&&!He[m]){const C=T(p),V=$(p);if(V&&C){const M=V.length;for(let O=M-1;O>=0;--O){const q=p===k?x(V[O],!0):V[O];C.insertBefore(q,A(p))}}}return Ee(p),!0},xo=function(p,m,k,C){return p.length===0?m:m===k||m===C?ae(m):m},$o=function(p,m){return p===m||T(p)!==null?!1:(bn&&At(p),!0)},To=function(p,m){if(ue(H.beforeSanitizeElements,p,null),$o(p,m))return!0;if(Mt(p))return Ee(p),!0;const k=G(ee(p));if(F=xo(H.uponSanitizeElement,F,hn,xt),ue(H.uponSanitizeElement,p,{tagName:k,allowedTags:F}),$o(p,m))return!0;if(Jd(p,k))return Ee(p),!0;if(at[k]||!(we.tagCheck instanceof Function&&we.tagCheck(k))&&!F[k]){const V=vd(p,k,m);return V===!1&&ue(H.afterSanitizeElements,p,null),V}if(j(p)===oe.element&&!Kd(p)||(k==="noscript"||k==="noembed"||k==="noframes")&&X(Lc,p.innerHTML))return Ee(p),!0;if(Ce&&p.nodeType===oe.text){const V=zt(p.textContent);p.textContent!==V&&(Je(n.removed,{element:p.cloneNode()}),p.textContent=V)}return ue(H.afterSanitizeElements,p,null),!1},So=function(p,m,k){if(no[m]||wo(m,p)||ro&&(m==="id"||m==="name")&&(k in a||k in Gd))return!1;const C=U[m]||we.attributeCheck instanceof Function&&we.attributeCheck(m,p);return un&&X(Dd,m)||ao&&X(Pd,m)?!0:C?ho[m]||X(to,et(k,eo,""))||(m==="src"||m==="xlink:href"||m==="href")&&p!=="script"&&Na(k,"data:")===0&&po[p]||oo&&!X(Od,et(k,eo,""))?!0:!k:Vo(p)&&Lt(he.tagNameCheck,p)&&Lt(he.attributeNameCheck,m,p)||m==="is"&&he.allowCustomizedBuiltInElements&&Lt(he.tagNameCheck,k)},e1=R({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Vo=function(p){return!e1[ve(p)]&&X(Hd,p)},t1=function(p,m,k,C){if(z&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!k)switch(u.getAttributeType(p,m)){case"TrustedHTML":return ke(C);case"TrustedScriptURL":return K(C)}return C},n1=function(p,m,k,C){try{k?p.setAttributeNS(k,m,C):p.setAttribute(m,C),Mt(p)?Ee(p):Va(n.removed)}catch{Ae(m,p)}},Bo=function(p){ue(H.beforeSanitizeAttributes,p,null);const m=p.attributes;if(!m||Mt(p))return;U=xo(H.uponSanitizeAttribute,U,mn,$t);const k={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U,forceKeepAttr:void 0};let C=m.length;const V=G(p.nodeName);for(;C--;){const M=m[C],O=M.name,q=M.namespaceURI,te=M.value,ne=G(O),Sn=te;let J=O==="value"?Sn:gc(Sn);if(k.attrName=ne,k.attrValue=J,k.keepAttr=!0,k.forceKeepAttr=void 0,ue(H.uponSanitizeAttribute,p,k),J=k.attrValue,so&&(ne==="id"||ne==="name")&&Na(J,io)!==0&&(Ae(O,p,M),J=io+J),Be&&X(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,J)){Ae(O,p,M);continue}if(ne==="attributename"&&Ba(J,"href")){Ae(O,p,M);continue}if(!k.forceKeepAttr){if(!k.keepAttr){Ae(O,p,M);continue}if(!lo&&X(Ic,J)){Ae(O,p,M);continue}if(Ce&&(J=zt(J)),!So(V,ne,J)){Ae(O,p,M);continue}J=t1(V,ne,q,J),J!==Sn&&n1(p,O,q,J)}}ue(H.afterSanitizeAttributes,p,null)},It=function(p){let m=null;const k=Eo(p);for(ue(H.beforeSanitizeShadowDOM,p,null);m=k.nextNode();)if(ue(H.uponSanitizeShadowNode,m,null),To(m,p),Bo(m),je(m.content)&&It(m.content),j(m)===oe.element){const C=E(m);je(C)&&(Tn(C),It(C))}ue(H.afterSanitizeShadowDOM,p,null)},Tn=function(p){const m=[{node:p,shadow:null}];for(;m.length>0;){const k=m.pop();if(k.shadow){It(k.shadow);continue}const C=k.node,M=j(C)===oe.element,O=$(C);if(O)for(let q=O.length-1;q>=0;--q)m.push({node:O[q],shadow:null});if(M){const q=w?w(C):null;if(typeof q=="string"&&G(q)==="template"){const te=C.content;je(te)&&m.push({node:te,shadow:null})}}if(M){const q=E(C);je(q)&&m.push({node:null,shadow:q},{node:q,shadow:null})}}};return n.sanitize=function(b){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=null,k=null,C=null,V=null;if(_n=!b,_n&&(b="<!-->"),typeof b!="string"&&!lt(b)&&(b=wc(b),typeof b!="string"))throw Ve("dirty is not a string, aborting");if(!n.isSupported)return b;gn?(F=xt,U=$t):xn(p),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(F=ae(F)),H.uponSanitizeAttribute.length>0&&(U=ae(U)),n.removed=[];const M=bn&&typeof b!="string"&&lt(b);if(M){Xd(b);const te=ee(b);if(typeof te=="string"){const ne=G(te);if(!F[ne]||at[ne])throw Nt(b),Ve("root node is forbidden and cannot be sanitized in-place")}if(Mt(b))throw Nt(b),Ve("root node is clobbered and cannot be sanitized in-place");try{Tn(b)}catch(ne){throw Nt(b),ne}}else if(lt(b))m=Co("<!---->"),k=m.ownerDocument.importNode(b,!0),k.nodeType===oe.element&&k.nodeName==="BODY"||k.nodeName==="HTML"?m=k:m.appendChild(k),Tn(k);else{if(!Pe&&!Ce&&!Ne&&b.indexOf("<")===-1)return z&&St?ke(b):b;if(m=Co(b),!m)return Pe?null:St?N:""}m&&kn&&Ee(m.firstChild);const O=M?b:m;try{const te=Eo(O);for(;C=te.nextNode();)To(C,O),Bo(C),je(C.content)&&It(C.content)}catch(te){throw M&&(Nt(b),Se(n.removed,ne=>{ne.element&&At(ne.element)})),te}if(M)return Se(n.removed,te=>{te.element&&At(te.element)}),Ce&&$n(b),b;if(Pe){if(Ce&&$n(m),Tt)for(V=Ad.call(m.ownerDocument);m.firstChild;)V.appendChild(m.firstChild);else V=m;return(U.shadowroot||U.shadowrootmode)&&(V=Md.call(o,V,!0)),V}let q=Ne?m.outerHTML:m.innerHTML;return Ne&&F["!doctype"]&&m.ownerDocument&&m.ownerDocument.doctype&&m.ownerDocument.doctype.name&&X(zc,m.ownerDocument.doctype.name)&&(q="<!DOCTYPE "+m.ownerDocument.doctype.name+`>
71
- `+q),Ce&&(q=zt(q)),z&&St?ke(q):q},n.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xn(b),gn=!0,xt=F,$t=U},n.clearConfig=function(){Ue=null,gn=!1,xt=null,$t=null,z=re,N=""},n.isValidAttribute=function(b,p,m){Ue||xn({});const k=G(b),C=G(p);return So(k,C,m)},n.addHook=function(b,p){typeof p=="function"&&v(H,b)&&Je(H[b],p)},n.removeHook=function(b,p){if(v(H,b)){if(p!==void 0){const m=mc(H[b],p);return m===-1?void 0:uc(H[b],m,1)[0]}return Va(H[b])}},n.removeHooks=function(b){v(H,b)&&(H[b]=[])},n.removeAllHooks=function(){H=Fa()},n}var pn=Ua();const wt=typeof pn.sanitize=="function"?pn:pn.default;function Hc(t){const n=t.trim();if(!n)return!1;const a=[/^(好的|已|我|现在|以上|这就是|这是|根据|基于)/,/^(表单|流程|Schema|JSON|数据)\s*(已|已经|已生成|已创建|已更新)/,/已(生成|创建|更新|完成|应用)(好|了)?/,/以上(就是|是)/,/请(查看|确认|检查|参考)/,/希望(这|这个)/];return n.length<100&&a.some(o=>o.test(n))}function ja(t){if(!t)return[{type:"text",content:""}];const n=[],a=/```([\w:+#.-]*)\r?\n([\s\S]*?)```|```([^\n`]*?)```|<schema>([\s\S]*?)<\/schema>/g;let o=0,l,r=!1;for(;(l=a.exec(t))!==null;){const s=t.slice(o,l.index);if(s.trim()&&n.push({type:"text",content:s}),l[0].startsWith("<schema>"))n.push({type:"code",content:(l[4]||"").trim(),language:"json"}),r=!0;else if(l[1]!==void 0){const d=(l[1]||"text").trim()||"text",f=(l[2]||"").replace(/^\n/,"").replace(/\n$/,"");qa(n,d,f)}else qa(n,"text",(l[3]||"").trim());o=l.index+l[0].length}const i=t.slice(o);i.trim()&&(r&&Hc(i)||n.push({type:"text",content:i}));const c=n.filter((s,d)=>s.type!=="text"||s.content.trim()?!0:d>0&&d<n.length-1);return c.length?c:[{type:"text",content:t}]}function qa(t,n,a){if(n.startsWith("artifact:")){const o=n.slice(9);t.push({type:"artifact",content:a,language:o,artifactType:o});return}t.push({type:"code",content:a,language:n})}function Ga(t){if(!t)return"";const a=D.parse(t,{breaks:!0,gfm:!0}).replace(/<table>/g,'<div class="table-scroll"><table>').replace(/<\/table>/g,"</table></div>");return typeof window>"u"||typeof(wt==null?void 0:wt.sanitize)!="function"?a:wt.sanitize(a,{ADD_ATTR:["class"]})}const Fc={class:"apf-message-parts"},Uc=["innerHTML"],jc={class:"apf-artifact-head"},qc={class:"apf-artifact-badge"},Gc={class:"apf-part-actions"},Wc=["onClick"],Yc=["onClick"],Zc={class:"apf-code-block"},Kc={class:"apf-code-head"},Qc={class:"apf-code-lang"},Xc={class:"apf-part-actions"},Jc=["onClick"],vc=["onClick"],e2={class:"apf-code-block"},Wa=L(e.defineComponent({__name:"MessageParts",props:{content:{}},setup(t){const n=t,a=e.computed(()=>ja(n.content||"").map(o));function o(s){if(!((s.language||"").toLowerCase()==="json"||s.artifactType==="json"||l(s.content)))return{...s,display:s.content,isJson:!1};try{const u=JSON.parse(s.content);return{...s,language:s.language||"json",display:JSON.stringify(u,null,2),isJson:!0}}catch{return{...s,display:s.content,isJson:!1}}}function l(s){const d=s.trim();return d.startsWith("{")&&d.endsWith("}")||d.startsWith("[")&&d.endsWith("]")}function r(s){return s.type==="artifact"?s.artifactType||"artifact":s.isJson?"json":s.language&&s.language!=="text"?s.language:"code"}function i(s){var d;s&&((d=navigator.clipboard)==null||d.writeText(s))}function c(s){const d=s.isJson||s.language==="json"?"json":s.language&&s.language!=="text"?s.language.replace(/[^a-z0-9]+/gi,""):"txt",f=new Blob([s.display],{type:"text/plain;charset=utf-8"}),u=URL.createObjectURL(f),h=document.createElement("a");h.href=u,h.download=`result.${d||"txt"}`,h.click(),URL.revokeObjectURL(u)}return(s,d)=>(e.openBlock(),e.createElementBlock("div",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(f,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:u},[f.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"apf-md-block",innerHTML:e.unref(Ga)(f.content)},null,8,Uc)):f.type==="artifact"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["apf-artifact-card",{"apf-json":f.isJson}])},[e.createElementVNode("div",jc,[e.createElementVNode("span",qc,"工件 · "+e.toDisplayString(r(f)),1),e.createElementVNode("div",Gc,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:h=>i(f.display)},[...d[0]||(d[0]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),e.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,Wc),e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:h=>c(f)},[...d[1]||(d[1]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.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,Yc)])]),e.createElementVNode("pre",Zc,[e.createElementVNode("code",null,e.toDisplayString(f.display),1)])],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["apf-code-wrap",{"apf-json":f.isJson}])},[e.createElementVNode("div",Kc,[e.createElementVNode("span",Qc,e.toDisplayString(r(f)),1),e.createElementVNode("div",Xc,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:h=>i(f.display)},[...d[2]||(d[2]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),e.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,Jc),e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:h=>c(f)},[...d[3]||(d[3]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.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,vc)])]),e.createElementVNode("pre",e2,[e.createElementVNode("code",null,e.toDisplayString(f.display),1)])],2))],64))),128))]))}}),[["__scopeId","data-v-ed1039e3"]]),t2={key:0,class:"apf-att-list"},n2=["onClick"],a2=["src","alt"],o2=["onClick"],l2={class:"apf-att-badge"},r2={class:"apf-att-meta"},Ya=L(e.defineComponent({__name:"MessageAttachmentList",props:{attachments:{}},emits:["preview"],setup(t,{emit:n}){const a=t,o=n,l=e.computed(()=>a.attachments.filter(Me)),r=e.computed(()=>a.attachments.filter(i=>!Me(i)));return(i,c)=>{var s;return(s=t.attachments)!=null&&s.length?(e.openBlock(),e.createElementBlock("div",t2,[l.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["apf-image-grid",{"apf-multi":l.value.length>1}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,d=>(e.openBlock(),e.createElementBlock("button",{key:d.id,type:"button",class:"apf-att-image",onClick:f=>o("preview",d)},[e.createElementVNode("img",{src:d.url,alt:d.filename,loading:"lazy"},null,8,a2)],8,n2))),128))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,d=>(e.openBlock(),e.createElementBlock("button",{key:d.id,type:"button",class:"apf-att-file",onClick:f=>o("preview",d)},[e.createElementVNode("span",l2,e.toDisplayString(e.unref(Wt)(d)),1),e.createElementVNode("span",r2,[e.createElementVNode("strong",null,e.toDisplayString(d.filename),1),e.createElementVNode("small",null,[d.size?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(mt)(d.size)),1)],64)):e.createCommentVNode("",!0),e.unref(Ye)(d)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(" · 点击预览")],64)):e.unref(la)(d)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(" · 点击查看")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(" · 点击打开")],64))])])],8,o2))),128))])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-d851b768"]]),s2={key:0,class:"apf-doc-list"},i2=["role","tabindex","onClick","onKeydown"],c2={class:"apf-doc-body"},d2={class:"apf-doc-name"},p2={class:"apf-doc-summary"},f2={key:0,class:"apf-doc-meta"},Za=L(e.defineComponent({__name:"DocumentSummaryList",props:{summaries:{},attachments:{}},emits:["preview"],setup(t,{emit:n}){const a=t,o=n;function l(c){var d;if(!((d=a.attachments)!=null&&d.length))return null;const s=(c.filename||"").toLowerCase();return a.attachments.find(f=>(f.filename||"").toLowerCase()===s)||null}function r(c){const s=l(c);s&&o("preview",s)}function i(c){return l(c)!==null}return(c,s)=>{var d;return(d=t.summaries)!=null&&d.length?(e.openBlock(),e.createElementBlock("div",s2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.summaries,f=>(e.openBlock(),e.createElementBlock("article",{key:f.documentId,class:e.normalizeClass(["apf-doc-card",{"apf-clickable":i(f)}]),role:i(f)?"button":void 0,tabindex:i(f)?0:void 0,onClick:u=>r(f),onKeydown:[e.withKeys(u=>r(f),["enter"]),e.withKeys(e.withModifiers(u=>r(f),["prevent"]),["space"])]},[s[0]||(s[0]=e.createElementVNode("div",{class:"apf-doc-icon"},[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.createElementVNode("path",{d:"M4 2.5h5.2L12 5.3V13.5H4V2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M9.2 2.5V5.3H12",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})])],-1)),e.createElementVNode("div",c2,[e.createElementVNode("strong",d2,e.toDisplayString(f.filename),1),e.createElementVNode("p",p2,e.toDisplayString(f.summary),1),f.pageCount?(e.openBlock(),e.createElementBlock("span",f2,e.toDisplayString(f.pageCount)+" 页",1)):e.createCommentVNode("",!0)])],42,i2))),128))])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a5548a3c"]]),h2={class:"apf-bubble-wrap"},m2={key:0,class:"apf-tip"},u2={key:1,class:"apf-typing"},g2={key:2,class:"apf-result-wrap"},k2={key:3,class:"apf-inline-progress"},y2={key:0,class:"apf-result-actions"},b2={key:1,class:"apf-fail-actions"},_2={key:3,class:"apf-bubble apf-waiting-hint"},w2={key:4,class:"apf-bubble apf-failed-hint"},C2={key:5,class:"apf-bubble apf-cancelled-hint"},E2=["aria-expanded"],x2={key:0,class:"apf-live-dot"},$2={class:"apf-detail-collapse"},T2={class:"apf-detail-collapse-inner"},S2=["aria-expanded"],V2={class:"apf-detail-collapse"},B2={class:"apf-detail-collapse-inner"},N2={key:9,class:"apf-chip apf-chip-success"},A2={class:"apf-approval-head"},z2={key:0,class:"apf-approval-danger-tag"},M2={class:"apf-approval-prompt"},L2={class:"apf-approval-actions"},I2=["disabled","onClick"],Ka=L(e.defineComponent({__name:"MessageBubble",props:{message:{},run:{},sending:{type:Boolean},brandMark:{}},emits:["resume","cancel","retry","open-process","preview"],setup(t,{emit:n}){const a=t,o=n,l=e.computed(()=>a.message.role==="user"),r=e.computed(()=>a.message.role==="assistant");function i(z){return{PENDING:"排队中",RUNNING:"正在处理",WAITING_INPUT:"等待你的确认",COMPLETED:"已完成",FAILED:"处理失败",CANCELLED:"已取消"}[z]||z}function c(z){return{RUNNING:"apf-chip-running",WAITING_INPUT:"apf-chip-waiting",COMPLETED:"apf-chip-success",FAILED:"apf-chip-failed",CANCELLED:"apf-chip-cancelled"}[z]||"apf-chip-cancelled"}const s=[{action:"approve",label:"确认继续",style:"primary"},{action:"reject",label:"需要修改",style:"danger"}],d=e.computed(()=>{var N,re;if(a.message.status!=="WAITING_INPUT")return null;const z=(N=a.run)==null?void 0:N.waiting;if(z){const pe=(re=z.actions)!=null&&re.length?z.actions:s;return{prompt:z.prompt||"请确认后继续。",fields:z.fields||[],actions:pe,dangerous:!!z.dangerous}}return{prompt:"请确认后继续。",fields:[],actions:s,dangerous:!1}}),f=e.computed(()=>a.message.content||""),u=e.computed(()=>{var z;return r.value&&a.message.status==="RUNNING"&&!f.value&&!((z=a.message.attachments)!=null&&z.length)}),h=e.computed(()=>{var z,N;return!!f.value||!!((z=a.message.documentSummaries)!=null&&z.length)||!!((N=a.message.attachments)!=null&&N.length)}),x=e.computed(()=>l.value?"apf-user":a.message.status==="WAITING_INPUT"?"apf-waiting":a.message.status==="FAILED"?"apf-failed":""),g=e.ref("");function A(z){o("resume",z,g.value||void 0),g.value=""}function $(){var N;const z=f.value||a.message.content;z&&((N=navigator.clipboard)==null||N.writeText(z))}function T(){const z=f.value||a.message.content;if(!z)return;const N=new Blob([z],{type:"text/markdown;charset=utf-8"}),re=URL.createObjectURL(N),pe=document.createElement("a");pe.href=re,pe.download="reply.md",pe.click(),URL.revokeObjectURL(re)}function E(z){return z.error?"失败":z.result!==void 0?"已完成":"处理中"}const S=e.ref(!1),_=e.ref(!1),w=e.ref(!1),B=e.computed(()=>r.value&&a.message.status==="RUNNING"&&!!a.message.thinking);e.watch(()=>{var z;return[a.message.status,!!((z=a.message.thinking)!=null&&z.trim())]},([z,N])=>{if(!N){S.value=!1,_.value=!1;return}if(z==="RUNNING"){S.value=!0,_.value=!1;return}_.value||(S.value=!1)},{immediate:!0});function j(){S.value=!S.value,_.value=!0}function ee(){w.value=!w.value}return(z,N)=>{var re,pe,_e,nt,ke;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["apf-message",[t.message.role,t.message.status&&r.value?`apf-st-${t.message.status}`:""]])},[r.value&&t.brandMark?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.brandMark),{key:0,variant:"ai",size:"sm"})):e.createCommentVNode("",!0),e.createElementVNode("div",h2,[r.value&&t.message.tip?(e.openBlock(),e.createElementBlock("p",m2,e.toDisplayString(t.message.tip),1)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",u2,[...N[4]||(N[4]=[e.createElementVNode("span",{class:"apf-status-text"},"正在处理",-1),e.createElementVNode("span",{class:"apf-dots"},[e.createElementVNode("i"),e.createElementVNode("i"),e.createElementVNode("i")],-1)])])):h.value?(e.openBlock(),e.createElementBlock("div",g2,[e.createElementVNode("div",{class:e.normalizeClass(["apf-bubble apf-message-content",x.value])},[(re=t.message.attachments)!=null&&re.length?(e.openBlock(),e.createBlock(Ya,{key:0,attachments:t.message.attachments,onPreview:N[0]||(N[0]=K=>o("preview",K))},null,8,["attachments"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(Wa,{key:1,content:f.value},null,8,["content"])):e.createCommentVNode("",!0),(pe=t.message.documentSummaries)!=null&&pe.length?(e.openBlock(),e.createBlock(Za,{key:2,summaries:t.message.documentSummaries,onPreview:N[1]||(N[1]=K=>o("preview",K))},null,8,["summaries"])):e.createCommentVNode("",!0),r.value&&t.message.status==="RUNNING"&&f.value?(e.openBlock(),e.createElementBlock("p",k2,"仍在处理…")):e.createCommentVNode("",!0)],2),r.value&&t.message.status==="COMPLETED"?(e.openBlock(),e.createElementBlock("div",y2,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:$},[...N[5]||(N[5]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),e.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])]),e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:T},[...N[6]||(N[6]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.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)])]),t.message.thinking||(_e=t.message.toolCalls)!=null&&_e.length?(e.openBlock(),e.createElementBlock("button",{key:0,class:"apf-text-link",type:"button",onClick:N[2]||(N[2]=K=>o("open-process"))},"处理信息")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value&&t.message.status==="FAILED"?(e.openBlock(),e.createElementBlock("div",b2,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"重试",onClick:N[3]||(N[3]=K=>o("retry"))},[...N[7]||(N[7]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.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"}),e.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"}),e.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)])])])):e.createCommentVNode("",!0)])):r.value&&t.message.status==="WAITING_INPUT"&&!h.value?(e.openBlock(),e.createElementBlock("div",_2,"请在下方确认后继续。")):r.value&&t.message.status==="FAILED"&&!h.value?(e.openBlock(),e.createElementBlock("div",w2,"处理失败")):r.value&&t.message.status==="CANCELLED"&&!h.value?(e.openBlock(),e.createElementBlock("div",C2,"已取消")):e.createCommentVNode("",!0),r.value&&((nt=t.message.thinking)!=null&&nt.trim())?(e.openBlock(),e.createElementBlock("div",{key:6,class:e.normalizeClass(["apf-detail-block",{open:S.value,streaming:B.value}])},[e.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":S.value,onClick:j},[N[8]||(N[8]=e.createElementVNode("span",{class:"apf-chevron"},null,-1)),N[9]||(N[9]=e.createElementVNode("span",null,"思考过程",-1)),B.value?(e.openBlock(),e.createElementBlock("span",x2)):e.createCommentVNode("",!0)],8,E2),e.createElementVNode("div",$2,[e.createElementVNode("div",T2,[e.createElementVNode("div",{class:e.normalizeClass(["apf-detail-content",{streaming:B.value}])},e.toDisplayString(t.message.thinking),3)])])],2)):e.createCommentVNode("",!0),r.value&&((ke=t.message.toolCalls)!=null&&ke.length)?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(["apf-detail-block",{open:w.value}])},[e.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":w.value,onClick:ee},[N[10]||(N[10]=e.createElementVNode("span",{class:"apf-chevron"},null,-1)),e.createElementVNode("span",null,"处理步骤("+e.toDisplayString(t.message.toolCalls.length)+")",1)],8,S2),e.createElementVNode("div",V2,[e.createElementVNode("div",B2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.message.toolCalls,K=>(e.openBlock(),e.createElementBlock("div",{key:K.id||K.name,class:"apf-tool-row"},[e.createElementVNode("strong",null,e.toDisplayString(K.name),1),e.createElementVNode("span",{class:e.normalizeClass({"apf-err":!!K.error})},e.toDisplayString(E(K)),3)]))),128))])])],2)):e.createCommentVNode("",!0),r.value&&t.message.status!=="COMPLETED"&&t.message.status!=="CANCELLED"?(e.openBlock(),e.createElementBlock("span",{key:8,class:e.normalizeClass(["apf-chip",c(t.message.status)])},[N[11]||(N[11]=e.createElementVNode("i",null,null,-1)),e.createTextVNode(e.toDisplayString(i(t.message.status)),1)],2)):r.value&&t.message.status==="COMPLETED"?(e.openBlock(),e.createElementBlock("span",N2,[...N[12]||(N[12]=[e.createElementVNode("i",null,null,-1),e.createTextVNode("已完成",-1)])])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("div",{key:10,class:e.normalizeClass(["apf-inline-approval",{"apf-dangerous-approval":d.value.dangerous}])},[e.createElementVNode("div",A2,[N[13]||(N[13]=e.createElementVNode("span",{class:"apf-approval-title"},"需要你的确认",-1)),d.value.dangerous?(e.openBlock(),e.createElementBlock("span",z2,"需谨慎")):e.createCommentVNode("",!0)]),e.createElementVNode("p",M2,e.toDisplayString(d.value.prompt),1),e.createElementVNode("div",L2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.actions,K=>(e.openBlock(),e.createElementBlock("button",{key:K.action,type:"button",class:e.normalizeClass(["apf-approval-btn",K.style==="danger"?"apf-approval-btn-danger":"apf-approval-btn-primary"]),disabled:t.sending,onClick:Ja=>A(K.action)},e.toDisplayString(K.label),11,I2))),128))])],2)):e.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-a82d00ca"]]),R2={key:0,class:"apf-skeleton-line"},D2=L(e.defineComponent({__name:"MessageList",props:{messages:{},loading:{type:Boolean},currentRun:{},sending:{type:Boolean},brandMark:{}},emits:["resume","cancel","retry","open-process","preview"],setup(t,{emit:n}){const a=t,o=n,l=e.ref(null);e.watch(()=>a.messages.length,async()=>{await e.nextTick(),l.value&&(l.value.scrollTop=l.value.scrollHeight)},{flush:"post"}),e.watch(()=>a.messages.map(i=>`${i.id}:${i.status}:${(i.content||"").length}`).join("|"),async()=>{await e.nextTick(),l.value&&(l.value.scrollTop=l.value.scrollHeight)},{flush:"post"});function r(i){return!a.currentRun||!i.runtimeExecutionId?null:a.currentRun.runtimeExecutionId===i.runtimeExecutionId?a.currentRun:null}return(i,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"container",ref:l,class:"apf-message-list"},[t.loading&&!t.messages.length?(e.openBlock(),e.createElementBlock("div",R2,[...c[4]||(c[4]=[e.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"60%"}},null,-1),e.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"45%","margin-top":"var(--spacing-sm, 8px)"}},null,-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messages,s=>(e.openBlock(),e.createBlock(Ka,{key:s.id,message:s,run:r(s),sending:!!t.sending,"brand-mark":t.brandMark,onResume:c[0]||(c[0]=(d,f)=>o("resume",d,f)),onCancel:c[1]||(c[1]=d=>o("cancel")),onRetry:c[2]||(c[2]=d=>o("retry")),onOpenProcess:d=>o("open-process",s),onPreview:c[3]||(c[3]=d=>o("preview",d))},null,8,["message","run","sending","brand-mark","onOpenProcess"]))),128))],512))}}),[["__scopeId","data-v-2dbe38cf"]]),P2={key:0,class:"apf-pending-list"},O2=["src"],H2={class:"apf-pending-name"},F2={key:1,class:"apf-pending-status"},U2={key:2,class:"apf-pending-status apf-error"},j2=["onClick"],q2=["placeholder","disabled"],G2={class:"apf-composer-footer"},W2={class:"apf-composer-tools"},Y2=["disabled"],Z2=["disabled"],K2={class:"apf-composer-meta"},Q2={class:"apf-cap-row"},X2={key:0,class:"apf-cap-chip"},J2={key:1,class:"apf-cap-chip"},v2={class:"apf-meta-right"},e0=L(e.defineComponent({__name:"Composer",props:{disabled:{type:Boolean},placeholder:{},supportedInputs:{},hitlCapable:{type:Boolean},wsStatus:{},wsLabel:{}},emits:["send","upload","remove-attachment","ws-click"],setup(t,{emit:n}){const a=t,o=n,l=e.ref(""),r=e.ref(null),i=e.ref(null),c=e.ref([]),s=e.ref(!1),d=e.computed(()=>a.supportedInputs||["text"]),f=e.computed(()=>d.value.some(E=>E==="file"||E==="image"||E==="document")),u=e.computed(()=>{if(a.disabled||s.value)return!1;const E=!!l.value.trim(),S=c.value.some(w=>w.status==="done"),_=c.value.some(w=>w.status==="uploading");return(E||S)&&!_});function h(){var E;a.disabled||!f.value||(E=i.value)==null||E.click()}function x(E){const S=E.target,_=S.files;if(_!=null&&_.length){for(const w of Array.from(_))o("upload",w);S.value=""}}function g(E){const S=c.value.find(_=>_.id===E);S!=null&&S.previewUrl&&URL.revokeObjectURL(S.previewUrl),c.value=c.value.filter(_=>_.id!==E),o("remove-attachment",E)}async function A(){if(!u.value)return;const E=l.value.trim(),S=c.value.filter(_=>_.status==="done").map(_=>_.id);o("send",E,S),l.value="",c.value.forEach(_=>{_.previewUrl&&URL.revokeObjectURL(_.previewUrl)}),c.value=[],await e.nextTick(),r.value&&(r.value.style.height="auto")}function $(E){const S=E.target;S.style.height="auto",S.style.height=Math.min(S.scrollHeight,220)+"px"}function T(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),A())}return e.onBeforeUnmount(()=>{c.value.forEach(E=>{E.previewUrl&&URL.revokeObjectURL(E.previewUrl)})}),(E,S)=>(e.openBlock(),e.createElementBlock("form",{class:"apf-composer",onSubmit:e.withModifiers(A,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["apf-composer-field",{"apf-disabled":t.disabled}])},[c.value.length?(e.openBlock(),e.createElementBlock("div",P2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,_=>(e.openBlock(),e.createElementBlock("div",{key:_.id,class:e.normalizeClass(["apf-pending-chip",_.status])},[_.previewUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:_.previewUrl,alt:"",class:"apf-pending-thumb"},null,8,O2)):e.createCommentVNode("",!0),e.createElementVNode("span",H2,e.toDisplayString(_.filename),1),_.status==="uploading"?(e.openBlock(),e.createElementBlock("span",F2,"上传中")):_.status==="error"?(e.openBlock(),e.createElementBlock("span",U2,e.toDisplayString(_.error||"失败"),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"apf-pending-remove",onClick:w=>g(_.id)},"×",8,j2)],2))),128))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("textarea",{ref_key:"textareaRef",ref:r,"onUpdate:modelValue":S[0]||(S[0]=_=>l.value=_),placeholder:t.placeholder||"输入消息…",disabled:t.disabled,onInput:$,onKeydown:T},null,40,q2),[[e.vModelText,l.value]]),e.createElementVNode("div",G2,[e.createElementVNode("div",W2,[e.renderSlot(E.$slots,"tools",{},void 0,!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:i,type:"file",class:"apf-file-input",multiple:"",accept:"image/*,.pdf,.txt,.md,.csv,.json,.doc,.docx,.xls,.xlsx",onChange:x},null,544),f.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"apf-cap-btn",type:"button","aria-label":"添加文件",disabled:t.disabled||s.value,onClick:h},[...S[2]||(S[2]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.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,Y2)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"submit",class:"apf-send-btn",disabled:!u.value,title:"发送"},"↗",8,Z2)])],2),e.createElementVNode("div",K2,[e.createElementVNode("div",Q2,[S[3]||(S[3]=e.createElementVNode("span",{class:"apf-cap-chip"},"文本",-1)),f.value?(e.openBlock(),e.createElementBlock("span",X2,"文件")):e.createCommentVNode("",!0),t.hitlCapable?(e.openBlock(),e.createElementBlock("span",J2,"需要确认")):e.createCommentVNode("",!0)]),e.createElementVNode("div",v2,[t.wsStatus?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["apf-ws-status",t.wsStatus]),onClick:S[1]||(S[1]=_=>o("ws-click"))},[...S[4]||(S[4]=[e.createElementVNode("i",{class:"apf-ws-dot"},null,-1)])],2)):e.createCommentVNode("",!0),S[5]||(S[5]=e.createElementVNode("small",{class:"apf-hint"},"Enter 发送 · Shift+Enter 换行",-1))])])],32))}}),[["__scopeId","data-v-45ece43f"]]),t0={key:0,class:"apf-run-bar"},n0={class:"apf-row"},a0={key:0,class:"apf-elapsed"},o0={key:0,class:"apf-error-text"},Qa=L(e.defineComponent({__name:"RunStatusBar",props:{run:{},sending:{type:Boolean}},emits:["cancel"],setup(t,{emit:n}){const a=t,o=n,l=e.computed(()=>{var s;return((s=a.run)==null?void 0:s.status)||null});function r(s){return{RUNNING:"正在处理",COMPLETED:"已完成",FAILED:"处理失败",WAITING_INPUT:"等待你的确认",CANCELLED:"已取消"}[s]||s}function i(s){return{RUNNING:"apf-running",COMPLETED:"apf-success",FAILED:"apf-failed",WAITING_INPUT:"apf-waiting",CANCELLED:"apf-cancelled"}[s]||""}function c(){if(!a.run)return"";const s=new Date(a.run.startedAt).getTime(),d=a.run.finishedAt?new Date(a.run.finishedAt).getTime():Date.now(),f=Math.round((d-s)/1e3);return f<60?f+"s":Math.floor(f/60)+"m "+f%60+"s"}return(s,d)=>t.run?(e.openBlock(),e.createElementBlock("div",t0,[e.createElementVNode("div",n0,[e.createElementVNode("span",{class:e.normalizeClass(["apf-chip",i(l.value||"")])},[d[1]||(d[1]=e.createElementVNode("i",null,null,-1)),e.createTextVNode(e.toDisplayString(r(l.value||"")),1)],2),l.value==="RUNNING"||l.value==="WAITING_INPUT"?(e.openBlock(),e.createElementBlock("span",a0,e.toDisplayString(c()),1)):e.createCommentVNode("",!0),l.value==="RUNNING"?(e.openBlock(),e.createElementBlock("button",{key:1,class:"apf-btn-cancel",onClick:d[0]||(d[0]=f=>o("cancel"))},"停止")):e.createCommentVNode("",!0)]),t.run.errorMessage?(e.openBlock(),e.createElementBlock("p",o0,e.toDisplayString(t.run.errorMessage),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33963f1d"]]),l0={class:"apf-header"},r0={key:0,class:"apf-danger-tag"},s0={class:"apf-prompt"},i0=["placeholder"],c0=["value"],d0=["placeholder"],p0={class:"apf-actions"},f0=["disabled","onClick"],h0=L(e.defineComponent({__name:"ApprovalCard",props:{waiting:{},disabled:{type:Boolean}},emits:["resume"],setup(t,{emit:n}){const a=n,o=e.ref("");function l(r){a("resume",r,o.value||void 0),o.value=""}return(r,i)=>t.waiting?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["apf-approval-card",{"apf-dangerous":t.waiting.dangerous}])},[e.createElementVNode("div",l0,[i[3]||(i[3]=e.createElementVNode("span",{class:"apf-title"},"需要你的操作",-1)),t.waiting.dangerous?(e.openBlock(),e.createElementBlock("span",r0,"危险操作")):e.createCommentVNode("",!0)]),e.createElementVNode("p",s0,e.toDisplayString(t.waiting.prompt),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.waiting.fields,c=>(e.openBlock(),e.createElementBlock("div",{key:c.key,class:"apf-field"},[e.createElementVNode("label",null,e.toDisplayString(c.label),1),c.type==="textarea"?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":i[0]||(i[0]=s=>o.value=s),placeholder:"请输入"+c.label,rows:"2"},null,8,i0)),[[e.vModelText,o.value]]):c.type==="select"&&c.options.length?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:1,"onUpdate:modelValue":i[1]||(i[1]=s=>o.value=s)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options,s=>(e.openBlock(),e.createElementBlock("option",{key:s,value:s},e.toDisplayString(s),9,c0))),128))],512)),[[e.vModelSelect,o.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":i[2]||(i[2]=s=>o.value=s),placeholder:"请输入"+c.label},null,8,d0)),[[e.vModelText,o.value]])]))),128)),e.createElementVNode("div",p0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.waiting.actions,c=>(e.openBlock(),e.createElementBlock("button",{key:c.action,class:e.normalizeClass(["apf-btn",c.style==="danger"?"apf-btn-danger":"apf-btn-primary"]),disabled:t.disabled,onClick:s=>l(c.action)},e.toDisplayString(c.label),11,f0))),128))])],2)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-eef9b412"]]),m0=["aria-label"],u0={class:"apf-preview-head"},g0={class:"apf-preview-title"},k0={class:"apf-preview-actions"},y0=["href"],b0={key:0,class:"apf-preview-body apf-preview-body-image"},_0=["src","alt"],w0={key:3,class:"apf-gallery-counter"},C0={key:1,class:"apf-preview-body apf-preview-body-pdf"},E0=["src","title"],x0={key:2,class:"apf-preview-body apf-preview-body-degraded"},$0={class:"apf-degraded-content"},T0={class:"apf-degraded-badge"},S0={class:"apf-degraded-filename"},V0={key:0,class:"apf-degraded-size"},B0=["href"],N0=L(e.defineComponent({__name:"AttachmentPreviewModal",props:{modelValue:{type:Boolean},attachment:{},gallery:{}},emits:["update:modelValue","update:attachment"],setup(t,{emit:n}){const a=t,o=n,l=e.computed({get:()=>a.modelValue,set:w=>o("update:modelValue",w)});function r(w){return w.url||""}const i=e.computed(()=>a.attachment?Me(a.attachment):!1),c=e.computed(()=>a.attachment?Ye(a.attachment):!1),s=e.computed(()=>{var B;return((B=a.gallery)!=null&&B.length?a.gallery:a.attachment?[a.attachment]:[]).filter(Me)}),d=e.computed(()=>!s.value.length||!a.attachment?-1:s.value.findIndex(w=>{var B;return w.id===((B=a.attachment)==null?void 0:B.id)})),f=e.computed(()=>d.value>0),u=e.computed(()=>d.value>=0&&d.value<s.value.length-1),h=e.ref(null),x=e.ref(null),g=e.ref(null);function A(){l.value=!1}function $(){if(!f.value)return;const w=s.value[d.value-1];w&&o("update:attachment",w)}function T(){if(!u.value)return;const w=s.value[d.value+1];w&&o("update:attachment",w)}function E(w){if(l.value){if(w.key==="Escape"){w.preventDefault(),A();return}if(w.key==="ArrowLeft"&&f.value){w.preventDefault(),$();return}if(w.key==="ArrowRight"&&u.value){w.preventDefault(),T();return}if(w.key==="Tab"&&h.value){const B=h.value.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(B.length===0)return;const j=B[0],ee=B[B.length-1];w.shiftKey&&document.activeElement===j?(w.preventDefault(),ee.focus()):!w.shiftKey&&document.activeElement===ee&&(w.preventDefault(),j.focus())}}}e.watch(l,w=>{w?(g.value=document.activeElement,requestAnimationFrame(()=>{var B;return(B=x.value)==null?void 0:B.focus()}),document.addEventListener("keydown",E)):(document.removeEventListener("keydown",E),g.value&&(g.value.focus(),g.value=null))}),e.onUnmounted(()=>document.removeEventListener("keydown",E));function S(w){w.target===w.currentTarget&&A()}function _(w){w.stopPropagation()}return(w,B)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value&&t.attachment?(e.openBlock(),e.createElementBlock("div",{key:0,class:"apf-preview-mask",role:"dialog","aria-modal":"true","aria-label":`预览 ${t.attachment.filename}`,onClick:S},[e.createElementVNode("div",{ref_key:"panelRef",ref:h,class:e.normalizeClass(["apf-preview-panel",{"apf-preview-image":i.value,"apf-preview-pdf":c.value,"apf-preview-degraded":!i.value&&!c.value}]),onClick:_},[e.createElementVNode("header",u0,[e.createElementVNode("strong",g0,e.toDisplayString(t.attachment.filename),1),e.createElementVNode("div",k0,[r(t.attachment)?(e.openBlock(),e.createElementBlock("a",{key:0,href:r(t.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn"},e.toDisplayString(c.value?"新窗口打开":i.value?"打开原图":"打开/下载"),9,y0)):e.createCommentVNode("",!0),e.createElementVNode("button",{ref_key:"closeBtnRef",ref:x,type:"button",class:"apf-preview-action-btn","aria-label":"关闭预览",onClick:A}," 关闭 ",512)])]),i.value?(e.openBlock(),e.createElementBlock("div",b0,[f.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"apf-gallery-btn apf-gallery-prev","aria-label":"上一张图片",onClick:$}," ‹ ")):e.createCommentVNode("",!0),r(t.attachment)?(e.openBlock(),e.createElementBlock("img",{key:1,src:r(t.attachment),alt:t.attachment.filename,class:"apf-preview-img"},null,8,_0)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"apf-gallery-btn apf-gallery-next","aria-label":"下一张图片",onClick:T}," › ")):e.createCommentVNode("",!0),s.value.length>1?(e.openBlock(),e.createElementBlock("div",w0,e.toDisplayString(d.value+1)+" / "+e.toDisplayString(s.value.length),1)):e.createCommentVNode("",!0)])):c.value?(e.openBlock(),e.createElementBlock("div",C0,[r(t.attachment)?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:r(t.attachment),title:t.attachment.filename,class:"apf-pdf-frame"},null,8,E0)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",x0,[e.createElementVNode("div",$0,[e.createElementVNode("span",T0,e.toDisplayString(e.unref(Wt)(t.attachment)),1),e.createElementVNode("strong",S0,e.toDisplayString(t.attachment.filename),1),t.attachment.size?(e.openBlock(),e.createElementBlock("p",V0,e.toDisplayString(e.unref(mt)(t.attachment.size)),1)):e.createCommentVNode("",!0),B[0]||(B[0]=e.createElementVNode("p",{class:"apf-degraded-hint"},"此格式暂不支持应用内预览",-1)),r(t.attachment)?(e.openBlock(),e.createElementBlock("a",{key:1,href:r(t.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn apf-preview-action-primary"}," 打开/下载 ",8,B0)):e.createCommentVNode("",!0)])]))],2)],8,m0)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-40702673"]]),A0={class:"apf-session-sidebar","aria-label":"会话列表"},z0={class:"apf-session-sidebar__head"},M0={class:"apf-session-sidebar__list"},L0=["onClick"],I0={class:"apf-session-sidebar__item-title"},R0={key:0,class:"apf-session-sidebar__empty"},D0=L(e.defineComponent({__name:"SessionSidebar",props:{sessions:{},activeId:{},loading:{type:Boolean},title:{}},emits:["select","create","delete"],setup(t,{emit:n}){const a=n;function o(l){if(!l)return"";const r=new Date(l),i=(Date.now()-r.getTime())/1e3;return i<60?"刚刚":i<3600?`${Math.floor(i/60)} 分钟前`:i<86400?`${Math.floor(i/3600)} 小时前`:r.toLocaleDateString("zh-CN")}return(l,r)=>{const i=e.resolveComponent("el-button"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("aside",A0,[e.createElementVNode("div",z0,[e.createElementVNode("strong",null,e.toDisplayString(t.title||"会话"),1),e.createVNode(i,{type:"primary",size:"small",onClick:r[0]||(r[0]=s=>a("create"))},{default:e.withCtx(()=>[...r[1]||(r[1]=[e.createTextVNode("新建",-1)])]),_:1})]),e.withDirectives((e.openBlock(),e.createElementBlock("div",M0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.sessions,s=>(e.openBlock(),e.createElementBlock("button",{key:s.id,type:"button",class:e.normalizeClass(["apf-session-sidebar__item",{"is-active":s.id===t.activeId}]),onClick:d=>a("select",s.id)},[e.createElementVNode("span",I0,e.toDisplayString(s.title||"未命名会话"),1),e.createElementVNode("small",null,e.toDisplayString(o(s.updatedAt||s.createdAt)),1),e.createVNode(i,{class:"apf-session-sidebar__delete",link:"",type:"danger",size:"small",onClick:e.withModifiers(d=>a("delete",s.id),["stop"])},{default:e.withCtx(()=>[...r[2]||(r[2]=[e.createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])],10,L0))),128)),!t.loading&&!t.sessions.length?(e.openBlock(),e.createElementBlock("div",R0,"暂无会话")):e.createCommentVNode("",!0)])),[[c,t.loading]])])}}}),[["__scopeId","data-v-8f9bd29d"]]),P0={key:0,class:"apf-processing-drawer__subtitle"},O0={class:"apf-processing-drawer__body"},H0=L(e.defineComponent({__name:"ProcessingDrawer",props:{modelValue:{type:Boolean},run:{},title:{},subtitle:{},sending:{type:Boolean}},emits:["update:modelValue","cancel"],setup(t,{emit:n}){const a=n;return(o,l)=>{const r=e.resolveComponent("el-drawer");return e.openBlock(),e.createBlock(r,{"model-value":t.modelValue,title:t.title||"处理详情",size:"380px","append-to-body":"","onUpdate:modelValue":l[1]||(l[1]=i=>a("update:modelValue",i))},{default:e.withCtx(()=>[t.subtitle?(e.openBlock(),e.createElementBlock("p",P0,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0),t.run?(e.openBlock(),e.createBlock(e.unref(Qa),{key:1,run:t.run,sending:t.sending??!1,onCancel:l[0]||(l[0]=i=>a("cancel"))},null,8,["run","sending"])):e.createCommentVNode("",!0),e.createElementVNode("div",O0,[e.renderSlot(o.$slots,"default",{},void 0,!0)])]),_:3},8,["model-value","title"])}}}),[["__scopeId","data-v-6036074a"]]),F0={class:"apf-conversation-header"},U0={class:"apf-conversation-header__identity"},j0={class:"apf-conversation-header__copy"},q0={class:"apf-conversation-header__label"},G0={class:"apf-conversation-header__actions"},W0={key:0,class:"apf-conversation-header__processing"},Y0=L(e.defineComponent({__name:"ConversationHeader",props:{title:{},label:{},hasMessages:{type:Boolean},processing:{type:Boolean}},emits:["changeAssistant","toggleDetails","create"],setup(t,{emit:n}){const a=n;return(o,l)=>(e.openBlock(),e.createElementBlock("header",F0,[e.createElementVNode("div",U0,[e.createElementVNode("div",j0,[e.createElementVNode("span",q0,e.toDisplayString(t.label||"正在使用"),1),e.createElementVNode("strong",null,e.toDisplayString(t.title||"选择一个智能体开始"),1)])]),e.createElementVNode("div",G0,[t.processing?(e.openBlock(),e.createElementBlock("span",W0,[...l[2]||(l[2]=[e.createElementVNode("i",null,null,-1),e.createElementVNode("span",null,"正在处理",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"apf-conversation-header__btn",onClick:l[0]||(l[0]=r=>a(t.hasMessages?"create":"changeAssistant"))},e.toDisplayString(t.hasMessages?"新建对话":"选择智能体"),1),t.hasMessages?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"apf-conversation-header__btn",onClick:l[1]||(l[1]=r=>a("toggleDetails"))}," 处理详情 ")):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-47648485"]]),Z0={class:"apf-assistant-picker"},K0={key:0,class:"apf-assistant-picker__state"},Q0={key:1,class:"apf-assistant-picker__state apf-assistant-picker__state--error"},X0={key:2,class:"apf-assistant-picker__state"},J0=["onClick"],v0={class:"apf-assistant-picker__main"},ed={class:"apf-assistant-picker__icon-wrap"},td={class:"apf-assistant-picker__info"},nd={class:"apf-assistant-picker__caps"},ad=L(e.defineComponent({__name:"AssistantPicker",props:{items:{},modelValue:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","select"],setup(t,{emit:n}){const a=t,o=n;function l(s){var f,u;const d=["文本"];return(f=s.supportedInputs)!=null&&f.includes("file")&&d.push("文件"),(u=s.supportedInputs)!=null&&u.includes("image")&&d.push("图片"),s.hitlCapable&&d.push("需要确认"),d}function r(s){return s.icon||"chat-dot-round"}function i(s){o("update:modelValue",s.id),o("select",s)}const c=e.computed(()=>!a.loading&&!a.error&&!a.items.length);return(s,d)=>(e.openBlock(),e.createElementBlock("div",Z0,[t.loading?(e.openBlock(),e.createElementBlock("div",K0,[...d[0]||(d[0]=[e.createElementVNode("p",null,"正在加载智能体…",-1)])])):t.error?(e.openBlock(),e.createElementBlock("div",Q0,[e.createElementVNode("p",null,e.toDisplayString(t.error),1)])):c.value?(e.openBlock(),e.createElementBlock("div",X0,[...d[1]||(d[1]=[e.createElementVNode("p",null,"暂无可用智能体",-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,f=>(e.openBlock(),e.createElementBlock("button",{key:f.id,type:"button",class:e.normalizeClass(["apf-assistant-picker__item",{"is-active":t.modelValue===f.id}]),onClick:u=>i(f)},[e.createElementVNode("div",v0,[e.createElementVNode("span",ed,[e.createVNode(e.unref(le),{name:r(f),size:22},null,8,["name"])]),e.createElementVNode("span",td,[e.createElementVNode("b",null,e.toDisplayString(f.name),1),e.createElementVNode("small",null,e.toDisplayString(f.description||"适合处理一类明确任务"),1),e.createElementVNode("span",nd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l(f),u=>(e.openBlock(),e.createElementBlock("span",{key:u,class:e.normalizeClass(["apf-assistant-picker__cap",{"is-confirm":u==="需要确认"}])},e.toDisplayString(u),3))),128))])])]),e.createElementVNode("span",{class:e.normalizeClass(["apf-assistant-picker__choose",{"is-selected":t.modelValue===f.id}])},e.toDisplayString(t.modelValue===f.id?"已选择":"开始使用"),3)],10,J0))),128))]))}}),[["__scopeId","data-v-f05e69c0"]]),od={class:"apf-model-picker"},ld=L(e.defineComponent({__name:"ModelPicker",props:{models:{},modelValue:{},loading:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:n}){const a=n;return(o,l)=>{const r=e.resolveComponent("el-option"),i=e.resolveComponent("el-select");return e.openBlock(),e.createElementBlock("label",od,[e.createVNode(i,{"model-value":t.modelValue||void 0,disabled:t.loading||!t.models.length,placeholder:"选择模型","onUpdate:modelValue":l[0]||(l[0]=c=>a("update:modelValue",c))},{default:e.withCtx(()=>[t.loading?(e.openBlock(),e.createBlock(r,{key:0,label:"正在加载模型…",value:"",disabled:""})):t.models.length?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r,{key:1,label:"暂无可用模型",value:"",disabled:""})),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.models,c=>(e.openBlock(),e.createBlock(r,{key:c.id,label:`${c.name} · ${c.provider}`,value:c.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])])}}}),[["__scopeId","data-v-483ae73d"]]),Xa=Symbol("fg-toast");function rd(t){return{[Xa]:t}}function sd(){const t=e.inject(Xa);return{show(n,a="info",o){var l;(l=t==null?void 0:t.value)==null||l.show(n,a,o)},info(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"info",a)},success(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"success",a)},warning(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"warning",a)},error(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"error",a)}}}function id(){async function t(o,l={}){const{title:r="确认操作",type:i="warning",confirmButtonText:c="确定",cancelButtonText:s="取消"}=l;try{return await se.ElMessageBox.confirm(o,r,{confirmButtonText:c,cancelButtonText:s,type:i}),!0}catch{return!1}}async function n(o,l={}){return t(`此操作将永久删除${o},是否继续?`,{title:"确认删除",type:"danger",confirmButtonText:"确认删除",...l})}async function a(o,l={}){return t(o,{title:"确认操作",type:"danger",...l})}return{confirm:t,confirmDelete:n,confirmDanger:a}}function cd(){return{success(t,n={}){se.ElMessage({message:t,type:"success",...n})},error(t,n={}){se.ElMessage({message:t,type:"error",...n})},warning(t,n={}){se.ElMessage({message:t,type:"warning",...n})},info(t,n={}){se.ElMessage({message:t,type:"info",...n})}}}function dd(t,n=300){const a=e.ref(null);function o(...l){a.value&&clearTimeout(a.value),a.value=setTimeout(()=>{t(...l),a.value=null},n)}return e.onUnmounted(()=>{a.value&&clearTimeout(a.value)}),o}function pd(t,n){var c;const a=e.ref(1),o=e.ref((n==null?void 0:n.initialPageSize)??Gt),l=e.computed(()=>{const s=t.value,d=(a.value-1)*o.value;return s.slice(d,d+o.value)}),r=e.computed(()=>t.value.length);function i(){a.value=1}return e.watch(o,()=>{a.value=1},{flush:"sync"}),e.watch(t,s=>{const d=Math.max(1,Math.ceil(s.length/o.value)||1);a.value>d&&(a.value=d)}),(c=n==null?void 0:n.resetOn)!=null&&c.length&&e.watch(n.resetOn,()=>{i()}),{currentPage:a,pageSize:o,pagedItems:l,total:r,resetPage:i}}function fd(t={}){const{timeout:n=15e3,silentError:a=!1}=t,o=e.ref(!1),l=e.ref(null),r=e.ref(!1),i=e.computed(()=>l.value!==null);let c=null,s=0;function d(){s++,s===1&&(o.value=!0,l.value=null,r.value=!1,c=setTimeout(()=>{r.value=!0},n))}function f(){s=Math.max(0,s-1),s===0&&(o.value=!1,r.value=!1,c&&(clearTimeout(c),c=null))}async function u(x){d();try{return await x()}catch(g){return a||(l.value=g instanceof Error?g.message:"加载失败"),null}finally{f()}}function h(){s=0,o.value=!1,l.value=null,r.value=!1,c&&(clearTimeout(c),c=null)}return{loading:o,error:l,timedOut:r,hasError:i,withLoading:u,reset:h}}function hd(t){if(!t)return"操作失败";if(typeof t=="string")return t;if(t instanceof Error)return t.message||"操作失败";if(typeof t=="object"){const n=t;if(n.message)return n.message;if(n.errors&&typeof n.errors=="object"){const a=[];for(const o of Object.values(n.errors))Array.isArray(o)&&a.push(...o);if(a.length>0)return a.join(";")}if(n.code)return`错误码:${n.code}`}return"操作失败"}const md={primary:"#0060A2",primaryHover:"#4581E9",primaryLight:"#4581E9",primaryLighter:"#EEF5FF",primaryDark:"#0060A2",success:"#26A036",warning:"#F09700",danger:"#E50113",info:"#4581E9"},ud={title:"#303133",primary:"#333333",regular:"#606266",secondary:"#666666",muted:"#909399",placeholder:"#969FA8",disabled:"#C0C4CC",inverse:"#FFFFFF"},gd={10:"10px",11:"11px",12:"12px",13:"13px",14:"14px",15:"15px",16:"16px",18:"18px",20:"20px",22:"22px",24:"24px",28:"28px"},kd={xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px","2xl":"48px","3xl":"64px",10:"10px",12:"12px",20:"20px"},yd={xs:"24px",sm:"28px",md:"32px",lg:"40px",xl:"44px"},bd={header:"56px",conversationHeader:"68px",dialogFooter:"60px",toolbar:"48px",tabs:"40px",listRow:"48px"},_d={xs:"12px",sm:"14px",md:"16px",lg:"20px",xl:"24px"},wd={paddingX:"24px",paddingY:"24px",headerPaddingTop:"28px",sidebarWidth:"240px",sidebarWidthCollapsed:"64px"},Cd={sm:"2px",md:"4px",6:"6px",8:"8px",lg:"10px",xl:"12px",full:"999px"},Ed={fieldWidth:"220px",labelWidth:"96px",fieldGap:"6px"},xd={sm:"24px",md:"32px",lg:"40px",xl:"48px"},$d={sm:"0 1px 2px rgba(0, 0, 0, 0.05)",md:"0 4px 12px rgba(0, 0, 0, 0.08)",lg:"0 8px 24px rgba(0, 0, 0, 0.12)"},Td={fast:"0.15s",normal:"0.25s",slow:"0.35s"},Sd={dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070,toast:1080},Vd="1.4.0",Bd="2.14.2",Nd="2026-08-27";y.APP_ICON_NAMES=Wr,y.AVATAR_SIZE=xd,y.AppDialog=rt,y.AppIcon=le,y.AppPagination=Zr,y.ApprovalCard=h0,y.AssistantPicker=ad,y.AttachmentPreviewModal=N0,y.BORDER_RADIUS=Cd,y.COLORS=md,y.CONTROL_HEIGHT=yd,y.CardGridSkeleton=ls,y.CardTable=Cs,y.Composer=e0,y.ConfirmDialog=Kr,y.ContentPanel=gs,y.ConversationHeader=Y0,y.DEFAULT_PAGE_SIZE=Gt,y.DURATION=Td,y.DocumentPreviewDrawer=ii,y.DocumentPreviewPanel=ra,y.DocumentSummaryList=Za,y.EP_FORK_BASE=Bd,y.EP_FORK_DATE=Nd,y.EmptyState=ts,y.ErrorBoundary=ns,y.FONT_SIZE=gd,y.FORM=Ed,y.FieldRow=zs,y.FilterBar=ws,y.FilterTabs=Jr,y.FormDialog=Qr,y.HintText=Is,y.ICON_MAP=ht,y.ICON_SIZE=_d,y.JsonCard=Ws,y.JsonDetailDialog=Zs,y.LAYOUT_HEIGHT=bd,y.LoadingDots=Us,y.MessageAttachmentList=Ya,y.MessageBubble=Ka,y.MessageList=D2,y.MessageParts=Wa,y.ModelPicker=ld,y.PAGE=wd,y.PAGE_SIZE_OPTIONS=na,y.PAGINATION_LAYOUT=aa,y.PageHeader=ps,y.PageShell=ds,y.ProcessingDrawer=H0,y.RunStatusBar=Qa,y.SCHEMA_UI_VERSION=Vd,y.SHADOWS=$d,y.SPACING=kd,y.SchemaLitePreview=Qs,y.SearchForm=Bs,y.SectionToggle=Hs,y.SessionSidebar=D0,y.Skeleton=os,y.StatusTag=as,y.TEXT_COLORS=ud,y.TableRowActions=xs,y.Toast=es,y.TruncatedTooltipText=oa,y.UserAvatar=cs,y.Z_INDEX=Sd,y.fileKind=Wt,y.formatSize=mt,y.isImage=Me,y.isOffice=la,y.isPdf=Ye,y.isPreviewable=Xs,y.isRegisteredAppIcon=Yr,y.provideToast=rd,y.renderMarkdown=Ga,y.resolveApiErrorMessage=hd,y.splitTextAndCodeBlocks=ja,y.useClientPagination=pd,y.useConfirm=id,y.useDataLoading=fd,y.useDebounceFn=dd,y.useMessage=cd,y.useToast=sd,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
71
+ `+q),Ce&&(q=zt(q)),z&&St?ke(q):q},n.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xn(b),gn=!0,xt=F,$t=U},n.clearConfig=function(){Ue=null,gn=!1,xt=null,$t=null,z=re,N=""},n.isValidAttribute=function(b,p,m){Ue||xn({});const k=G(b),C=G(p);return So(k,C,m)},n.addHook=function(b,p){typeof p=="function"&&v(H,b)&&Je(H[b],p)},n.removeHook=function(b,p){if(v(H,b)){if(p!==void 0){const m=mc(H[b],p);return m===-1?void 0:uc(H[b],m,1)[0]}return Va(H[b])}},n.removeHooks=function(b){v(H,b)&&(H[b]=[])},n.removeAllHooks=function(){H=Fa()},n}var pn=Ua();const wt=typeof pn.sanitize=="function"?pn:pn.default;function Hc(t){const n=t.trim();if(!n)return!1;const a=[/^(好的|已|我|现在|以上|这就是|这是|根据|基于)/,/^(表单|流程|Schema|JSON|数据)\s*(已|已经|已生成|已创建|已更新)/,/已(生成|创建|更新|完成|应用)(好|了)?/,/以上(就是|是)/,/请(查看|确认|检查|参考)/,/希望(这|这个)/];return n.length<100&&a.some(o=>o.test(n))}function ja(t){if(!t)return[{type:"text",content:""}];const n=[],a=/```([\w:+#.-]*)\r?\n([\s\S]*?)```|```([^\n`]*?)```|<schema>([\s\S]*?)<\/schema>/g;let o=0,l,r=!1;for(;(l=a.exec(t))!==null;){const s=t.slice(o,l.index);if(s.trim()&&n.push({type:"text",content:s}),l[0].startsWith("<schema>"))n.push({type:"code",content:(l[4]||"").trim(),language:"json"}),r=!0;else if(l[1]!==void 0){const d=(l[1]||"text").trim()||"text",f=(l[2]||"").replace(/^\n/,"").replace(/\n$/,"");qa(n,d,f)}else qa(n,"text",(l[3]||"").trim());o=l.index+l[0].length}const i=t.slice(o);i.trim()&&(r&&Hc(i)||n.push({type:"text",content:i}));const c=n.filter((s,d)=>s.type!=="text"||s.content.trim()?!0:d>0&&d<n.length-1);return c.length?c:[{type:"text",content:t}]}function qa(t,n,a){if(n.startsWith("artifact:")){const o=n.slice(9);t.push({type:"artifact",content:a,language:o,artifactType:o});return}t.push({type:"code",content:a,language:n})}function Ga(t){if(!t)return"";const a=D.parse(t,{breaks:!0,gfm:!0}).replace(/<table>/g,'<div class="table-scroll"><table>').replace(/<\/table>/g,"</table></div>");return typeof window>"u"||typeof(wt==null?void 0:wt.sanitize)!="function"?a:wt.sanitize(a,{ADD_ATTR:["class"]})}const Fc={class:"apf-message-parts"},Uc=["innerHTML"],jc={class:"apf-artifact-head"},qc={class:"apf-artifact-badge"},Gc={class:"apf-part-actions"},Wc=["onClick"],Yc=["onClick"],Zc={class:"apf-code-block"},Kc={class:"apf-code-head"},Qc={class:"apf-code-lang"},Xc={class:"apf-part-actions"},Jc=["onClick"],vc=["onClick"],e2={class:"apf-code-block"},Wa=L(e.defineComponent({__name:"MessageParts",props:{content:{}},setup(t){const n=t,a=e.computed(()=>ja(n.content||"").map(o));function o(s){if(!((s.language||"").toLowerCase()==="json"||s.artifactType==="json"||l(s.content)))return{...s,display:s.content,isJson:!1};try{const u=JSON.parse(s.content);return{...s,language:s.language||"json",display:JSON.stringify(u,null,2),isJson:!0}}catch{return{...s,display:s.content,isJson:!1}}}function l(s){const d=s.trim();return d.startsWith("{")&&d.endsWith("}")||d.startsWith("[")&&d.endsWith("]")}function r(s){return s.type==="artifact"?s.artifactType||"artifact":s.isJson?"json":s.language&&s.language!=="text"?s.language:"code"}function i(s){var d;s&&((d=navigator.clipboard)==null||d.writeText(s))}function c(s){const d=s.isJson||s.language==="json"?"json":s.language&&s.language!=="text"?s.language.replace(/[^a-z0-9]+/gi,""):"txt",f=new Blob([s.display],{type:"text/plain;charset=utf-8"}),u=URL.createObjectURL(f),h=document.createElement("a");h.href=u,h.download=`result.${d||"txt"}`,h.click(),URL.revokeObjectURL(u)}return(s,d)=>(e.openBlock(),e.createElementBlock("div",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(f,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:u},[f.type==="text"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"apf-md-block",innerHTML:e.unref(Ga)(f.content)},null,8,Uc)):f.type==="artifact"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["apf-artifact-card",{"apf-json":f.isJson}])},[e.createElementVNode("div",jc,[e.createElementVNode("span",qc,"工件 · "+e.toDisplayString(r(f)),1),e.createElementVNode("div",Gc,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:h=>i(f.display)},[...d[0]||(d[0]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),e.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,Wc),e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:h=>c(f)},[...d[1]||(d[1]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.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,Yc)])]),e.createElementVNode("pre",Zc,[e.createElementVNode("code",null,e.toDisplayString(f.display),1)])],2)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["apf-code-wrap",{"apf-json":f.isJson}])},[e.createElementVNode("div",Kc,[e.createElementVNode("span",Qc,e.toDisplayString(r(f)),1),e.createElementVNode("div",Xc,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:h=>i(f.display)},[...d[2]||(d[2]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),e.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,Jc),e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:h=>c(f)},[...d[3]||(d[3]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[e.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,vc)])]),e.createElementVNode("pre",e2,[e.createElementVNode("code",null,e.toDisplayString(f.display),1)])],2))],64))),128))]))}}),[["__scopeId","data-v-ed1039e3"]]),t2={key:0,class:"apf-att-list"},n2=["onClick"],a2=["src","alt"],o2=["onClick"],l2={class:"apf-att-badge"},r2={class:"apf-att-meta"},Ya=L(e.defineComponent({__name:"MessageAttachmentList",props:{attachments:{}},emits:["preview"],setup(t,{emit:n}){const a=t,o=n,l=e.computed(()=>a.attachments.filter(Me)),r=e.computed(()=>a.attachments.filter(i=>!Me(i)));return(i,c)=>{var s;return(s=t.attachments)!=null&&s.length?(e.openBlock(),e.createElementBlock("div",t2,[l.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["apf-image-grid",{"apf-multi":l.value.length>1}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,d=>(e.openBlock(),e.createElementBlock("button",{key:d.id,type:"button",class:"apf-att-image",onClick:f=>o("preview",d)},[e.createElementVNode("img",{src:d.url,alt:d.filename,loading:"lazy"},null,8,a2)],8,n2))),128))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,d=>(e.openBlock(),e.createElementBlock("button",{key:d.id,type:"button",class:"apf-att-file",onClick:f=>o("preview",d)},[e.createElementVNode("span",l2,e.toDisplayString(e.unref(Wt)(d)),1),e.createElementVNode("span",r2,[e.createElementVNode("strong",null,e.toDisplayString(d.filename),1),e.createElementVNode("small",null,[d.size?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(mt)(d.size)),1)],64)):e.createCommentVNode("",!0),e.unref(Ye)(d)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(" · 点击预览")],64)):e.unref(la)(d)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(" · 点击查看")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(" · 点击打开")],64))])])],8,o2))),128))])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-d851b768"]]),s2={key:0,class:"apf-doc-list"},i2=["role","tabindex","onClick","onKeydown"],c2={class:"apf-doc-body"},d2={class:"apf-doc-name"},p2={class:"apf-doc-summary"},f2={key:0,class:"apf-doc-meta"},Za=L(e.defineComponent({__name:"DocumentSummaryList",props:{summaries:{},attachments:{}},emits:["preview"],setup(t,{emit:n}){const a=t,o=n;function l(c){var d;if(!((d=a.attachments)!=null&&d.length))return null;const s=(c.filename||"").toLowerCase();return a.attachments.find(f=>(f.filename||"").toLowerCase()===s)||null}function r(c){const s=l(c);s&&o("preview",s)}function i(c){return l(c)!==null}return(c,s)=>{var d;return(d=t.summaries)!=null&&d.length?(e.openBlock(),e.createElementBlock("div",s2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.summaries,f=>(e.openBlock(),e.createElementBlock("article",{key:f.documentId,class:e.normalizeClass(["apf-doc-card",{"apf-clickable":i(f)}]),role:i(f)?"button":void 0,tabindex:i(f)?0:void 0,onClick:u=>r(f),onKeydown:[e.withKeys(u=>r(f),["enter"]),e.withKeys(e.withModifiers(u=>r(f),["prevent"]),["space"])]},[s[0]||(s[0]=e.createElementVNode("div",{class:"apf-doc-icon"},[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.createElementVNode("path",{d:"M4 2.5h5.2L12 5.3V13.5H4V2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M9.2 2.5V5.3H12",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})])],-1)),e.createElementVNode("div",c2,[e.createElementVNode("strong",d2,e.toDisplayString(f.filename),1),e.createElementVNode("p",p2,e.toDisplayString(f.summary),1),f.pageCount?(e.openBlock(),e.createElementBlock("span",f2,e.toDisplayString(f.pageCount)+" 页",1)):e.createCommentVNode("",!0)])],42,i2))),128))])):e.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a5548a3c"]]),h2={class:"apf-bubble-wrap"},m2={key:0,class:"apf-tip"},u2={key:1,class:"apf-typing"},g2={key:2,class:"apf-result-wrap"},k2={key:3,class:"apf-inline-progress"},y2={key:0,class:"apf-result-actions"},b2={key:1,class:"apf-fail-actions"},_2={key:3,class:"apf-bubble apf-waiting-hint"},w2={key:4,class:"apf-bubble apf-failed-hint"},C2={key:5,class:"apf-bubble apf-cancelled-hint"},E2=["aria-expanded"],x2={key:0,class:"apf-live-dot"},$2={class:"apf-detail-collapse"},T2={class:"apf-detail-collapse-inner"},S2=["aria-expanded"],V2={class:"apf-detail-collapse"},B2={class:"apf-detail-collapse-inner"},N2={key:9,class:"apf-chip apf-chip-success"},A2={class:"apf-approval-head"},z2={key:0,class:"apf-approval-danger-tag"},M2={class:"apf-approval-prompt"},L2={class:"apf-approval-actions"},I2=["disabled","onClick"],Ka=L(e.defineComponent({__name:"MessageBubble",props:{message:{},run:{},sending:{type:Boolean},brandMark:{}},emits:["resume","cancel","retry","open-process","preview"],setup(t,{emit:n}){const a=t,o=n,l=e.computed(()=>a.message.role==="user"),r=e.computed(()=>a.message.role==="assistant");function i(z){return{PENDING:"排队中",RUNNING:"正在处理",WAITING_INPUT:"等待你的确认",COMPLETED:"已完成",FAILED:"处理失败",CANCELLED:"已取消"}[z]||z}function c(z){return{RUNNING:"apf-chip-running",WAITING_INPUT:"apf-chip-waiting",COMPLETED:"apf-chip-success",FAILED:"apf-chip-failed",CANCELLED:"apf-chip-cancelled"}[z]||"apf-chip-cancelled"}const s=[{action:"approve",label:"确认继续",style:"primary"},{action:"reject",label:"需要修改",style:"danger"}],d=e.computed(()=>{var N,re;if(a.message.status!=="WAITING_INPUT")return null;const z=(N=a.run)==null?void 0:N.waiting;if(z){const pe=(re=z.actions)!=null&&re.length?z.actions:s;return{prompt:z.prompt||"请确认后继续。",fields:z.fields||[],actions:pe,dangerous:!!z.dangerous}}return{prompt:"请确认后继续。",fields:[],actions:s,dangerous:!1}}),f=e.computed(()=>a.message.content||""),u=e.computed(()=>{var z;return r.value&&a.message.status==="RUNNING"&&!f.value&&!((z=a.message.attachments)!=null&&z.length)}),h=e.computed(()=>{var z,N;return!!f.value||!!((z=a.message.documentSummaries)!=null&&z.length)||!!((N=a.message.attachments)!=null&&N.length)}),x=e.computed(()=>l.value?"apf-user":a.message.status==="WAITING_INPUT"?"apf-waiting":a.message.status==="FAILED"?"apf-failed":""),g=e.ref("");function A(z){o("resume",z,g.value||void 0),g.value=""}function $(){var N;const z=f.value||a.message.content;z&&((N=navigator.clipboard)==null||N.writeText(z))}function T(){const z=f.value||a.message.content;if(!z)return;const N=new Blob([z],{type:"text/markdown;charset=utf-8"}),re=URL.createObjectURL(N),pe=document.createElement("a");pe.href=re,pe.download="reply.md",pe.click(),URL.revokeObjectURL(re)}function E(z){return z.error?"失败":z.result!==void 0?"已完成":"处理中"}const S=e.ref(!1),_=e.ref(!1),w=e.ref(!1),B=e.computed(()=>r.value&&a.message.status==="RUNNING"&&!!a.message.thinking);e.watch(()=>{var z;return[a.message.status,!!((z=a.message.thinking)!=null&&z.trim())]},([z,N])=>{if(!N){S.value=!1,_.value=!1;return}if(z==="RUNNING"){S.value=!0,_.value=!1;return}_.value||(S.value=!1)},{immediate:!0});function j(){S.value=!S.value,_.value=!0}function ee(){w.value=!w.value}return(z,N)=>{var re,pe,_e,nt,ke;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["apf-message",[t.message.role,t.message.status&&r.value?`apf-st-${t.message.status}`:""]])},[r.value&&t.brandMark?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.brandMark),{key:0,variant:"ai",size:"sm"})):e.createCommentVNode("",!0),e.createElementVNode("div",h2,[r.value&&t.message.tip?(e.openBlock(),e.createElementBlock("p",m2,e.toDisplayString(t.message.tip),1)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",u2,[...N[4]||(N[4]=[e.createElementVNode("span",{class:"apf-status-text"},"正在处理",-1),e.createElementVNode("span",{class:"apf-dots"},[e.createElementVNode("i"),e.createElementVNode("i"),e.createElementVNode("i")],-1)])])):h.value?(e.openBlock(),e.createElementBlock("div",g2,[e.createElementVNode("div",{class:e.normalizeClass(["apf-bubble apf-message-content",x.value])},[(re=t.message.attachments)!=null&&re.length?(e.openBlock(),e.createBlock(Ya,{key:0,attachments:t.message.attachments,onPreview:N[0]||(N[0]=K=>o("preview",K))},null,8,["attachments"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(Wa,{key:1,content:f.value},null,8,["content"])):e.createCommentVNode("",!0),(pe=t.message.documentSummaries)!=null&&pe.length?(e.openBlock(),e.createBlock(Za,{key:2,summaries:t.message.documentSummaries,onPreview:N[1]||(N[1]=K=>o("preview",K))},null,8,["summaries"])):e.createCommentVNode("",!0),r.value&&t.message.status==="RUNNING"&&f.value?(e.openBlock(),e.createElementBlock("p",k2,"仍在处理…")):e.createCommentVNode("",!0)],2),r.value&&t.message.status==="COMPLETED"?(e.openBlock(),e.createElementBlock("div",y2,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:$},[...N[5]||(N[5]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),e.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])]),e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:T},[...N[6]||(N[6]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.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)])]),t.message.thinking||(_e=t.message.toolCalls)!=null&&_e.length?(e.openBlock(),e.createElementBlock("button",{key:0,class:"apf-text-link",type:"button",onClick:N[2]||(N[2]=K=>o("open-process"))},"处理信息")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r.value&&t.message.status==="FAILED"?(e.openBlock(),e.createElementBlock("div",b2,[e.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"重试",onClick:N[3]||(N[3]=K=>o("retry"))},[...N[7]||(N[7]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.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"}),e.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"}),e.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)])])])):e.createCommentVNode("",!0)])):r.value&&t.message.status==="WAITING_INPUT"&&!h.value?(e.openBlock(),e.createElementBlock("div",_2,"请在下方确认后继续。")):r.value&&t.message.status==="FAILED"&&!h.value?(e.openBlock(),e.createElementBlock("div",w2,"处理失败")):r.value&&t.message.status==="CANCELLED"&&!h.value?(e.openBlock(),e.createElementBlock("div",C2,"已取消")):e.createCommentVNode("",!0),r.value&&((nt=t.message.thinking)!=null&&nt.trim())?(e.openBlock(),e.createElementBlock("div",{key:6,class:e.normalizeClass(["apf-detail-block",{open:S.value,streaming:B.value}])},[e.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":S.value,onClick:j},[N[8]||(N[8]=e.createElementVNode("span",{class:"apf-chevron"},null,-1)),N[9]||(N[9]=e.createElementVNode("span",null,"思考过程",-1)),B.value?(e.openBlock(),e.createElementBlock("span",x2)):e.createCommentVNode("",!0)],8,E2),e.createElementVNode("div",$2,[e.createElementVNode("div",T2,[e.createElementVNode("div",{class:e.normalizeClass(["apf-detail-content",{streaming:B.value}])},e.toDisplayString(t.message.thinking),3)])])],2)):e.createCommentVNode("",!0),r.value&&((ke=t.message.toolCalls)!=null&&ke.length)?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(["apf-detail-block",{open:w.value}])},[e.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":w.value,onClick:ee},[N[10]||(N[10]=e.createElementVNode("span",{class:"apf-chevron"},null,-1)),e.createElementVNode("span",null,"处理步骤("+e.toDisplayString(t.message.toolCalls.length)+")",1)],8,S2),e.createElementVNode("div",V2,[e.createElementVNode("div",B2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.message.toolCalls,K=>(e.openBlock(),e.createElementBlock("div",{key:K.id||K.name,class:"apf-tool-row"},[e.createElementVNode("strong",null,e.toDisplayString(K.name),1),e.createElementVNode("span",{class:e.normalizeClass({"apf-err":!!K.error})},e.toDisplayString(E(K)),3)]))),128))])])],2)):e.createCommentVNode("",!0),r.value&&t.message.status!=="COMPLETED"&&t.message.status!=="CANCELLED"?(e.openBlock(),e.createElementBlock("span",{key:8,class:e.normalizeClass(["apf-chip",c(t.message.status)])},[N[11]||(N[11]=e.createElementVNode("i",null,null,-1)),e.createTextVNode(e.toDisplayString(i(t.message.status)),1)],2)):r.value&&t.message.status==="COMPLETED"?(e.openBlock(),e.createElementBlock("span",N2,[...N[12]||(N[12]=[e.createElementVNode("i",null,null,-1),e.createTextVNode("已完成",-1)])])):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("div",{key:10,class:e.normalizeClass(["apf-inline-approval",{"apf-dangerous-approval":d.value.dangerous}])},[e.createElementVNode("div",A2,[N[13]||(N[13]=e.createElementVNode("span",{class:"apf-approval-title"},"需要你的确认",-1)),d.value.dangerous?(e.openBlock(),e.createElementBlock("span",z2,"需谨慎")):e.createCommentVNode("",!0)]),e.createElementVNode("p",M2,e.toDisplayString(d.value.prompt),1),e.createElementVNode("div",L2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value.actions,K=>(e.openBlock(),e.createElementBlock("button",{key:K.action,type:"button",class:e.normalizeClass(["apf-approval-btn",K.style==="danger"?"apf-approval-btn-danger":"apf-approval-btn-primary"]),disabled:t.sending,onClick:Ja=>A(K.action)},e.toDisplayString(K.label),11,I2))),128))])],2)):e.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-a82d00ca"]]),R2={key:0,class:"apf-skeleton-line"},D2=L(e.defineComponent({__name:"MessageList",props:{messages:{},loading:{type:Boolean},currentRun:{},sending:{type:Boolean},brandMark:{}},emits:["resume","cancel","retry","open-process","preview"],setup(t,{emit:n}){const a=t,o=n,l=e.ref(null);e.watch(()=>a.messages.length,async()=>{await e.nextTick(),l.value&&(l.value.scrollTop=l.value.scrollHeight)},{flush:"post"}),e.watch(()=>a.messages.map(i=>`${i.id}:${i.status}:${(i.content||"").length}`).join("|"),async()=>{await e.nextTick(),l.value&&(l.value.scrollTop=l.value.scrollHeight)},{flush:"post"});function r(i){return!a.currentRun||!i.runtimeExecutionId?null:a.currentRun.runtimeExecutionId===i.runtimeExecutionId?a.currentRun:null}return(i,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"container",ref:l,class:"apf-message-list"},[t.loading&&!t.messages.length?(e.openBlock(),e.createElementBlock("div",R2,[...c[4]||(c[4]=[e.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"60%"}},null,-1),e.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"45%","margin-top":"var(--spacing-sm, 8px)"}},null,-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.messages,s=>(e.openBlock(),e.createBlock(Ka,{key:s.id,message:s,run:r(s),sending:!!t.sending,"brand-mark":t.brandMark,onResume:c[0]||(c[0]=(d,f)=>o("resume",d,f)),onCancel:c[1]||(c[1]=d=>o("cancel")),onRetry:c[2]||(c[2]=d=>o("retry")),onOpenProcess:d=>o("open-process",s),onPreview:c[3]||(c[3]=d=>o("preview",d))},null,8,["message","run","sending","brand-mark","onOpenProcess"]))),128))],512))}}),[["__scopeId","data-v-2dbe38cf"]]),P2={key:0,class:"apf-pending-list"},O2=["src"],H2={class:"apf-pending-name"},F2={key:1,class:"apf-pending-status"},U2={key:2,class:"apf-pending-status apf-error"},j2=["onClick"],q2=["placeholder","disabled"],G2={class:"apf-composer-footer"},W2={class:"apf-composer-tools"},Y2=["disabled"],Z2=["disabled"],K2={class:"apf-composer-meta"},Q2={class:"apf-cap-row"},X2={key:0,class:"apf-cap-chip"},J2={key:1,class:"apf-cap-chip"},v2={class:"apf-meta-right"},e0=L(e.defineComponent({__name:"Composer",props:{disabled:{type:Boolean},placeholder:{},supportedInputs:{},hitlCapable:{type:Boolean},wsStatus:{},wsLabel:{}},emits:["send","upload","remove-attachment","ws-click"],setup(t,{emit:n}){const a=t,o=n,l=e.ref(""),r=e.ref(null),i=e.ref(null),c=e.ref([]),s=e.ref(!1),d=e.computed(()=>a.supportedInputs||["text"]),f=e.computed(()=>d.value.some(E=>E==="file"||E==="image"||E==="document")),u=e.computed(()=>{if(a.disabled||s.value)return!1;const E=!!l.value.trim(),S=c.value.some(w=>w.status==="done"),_=c.value.some(w=>w.status==="uploading");return(E||S)&&!_});function h(){var E;a.disabled||!f.value||(E=i.value)==null||E.click()}function x(E){const S=E.target,_=S.files;if(_!=null&&_.length){for(const w of Array.from(_))o("upload",w);S.value=""}}function g(E){const S=c.value.find(_=>_.id===E);S!=null&&S.previewUrl&&URL.revokeObjectURL(S.previewUrl),c.value=c.value.filter(_=>_.id!==E),o("remove-attachment",E)}async function A(){if(!u.value)return;const E=l.value.trim(),S=c.value.filter(_=>_.status==="done").map(_=>_.id);o("send",E,S),l.value="",c.value.forEach(_=>{_.previewUrl&&URL.revokeObjectURL(_.previewUrl)}),c.value=[],await e.nextTick(),r.value&&(r.value.style.height="auto")}function $(E){const S=E.target;S.style.height="auto",S.style.height=Math.min(S.scrollHeight,220)+"px"}function T(E){E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),A())}return e.onBeforeUnmount(()=>{c.value.forEach(E=>{E.previewUrl&&URL.revokeObjectURL(E.previewUrl)})}),(E,S)=>(e.openBlock(),e.createElementBlock("form",{class:"apf-composer",onSubmit:e.withModifiers(A,["prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["apf-composer-field",{"apf-disabled":t.disabled}])},[c.value.length?(e.openBlock(),e.createElementBlock("div",P2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,_=>(e.openBlock(),e.createElementBlock("div",{key:_.id,class:e.normalizeClass(["apf-pending-chip",_.status])},[_.previewUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:_.previewUrl,alt:"",class:"apf-pending-thumb"},null,8,O2)):e.createCommentVNode("",!0),e.createElementVNode("span",H2,e.toDisplayString(_.filename),1),_.status==="uploading"?(e.openBlock(),e.createElementBlock("span",F2,"上传中")):_.status==="error"?(e.openBlock(),e.createElementBlock("span",U2,e.toDisplayString(_.error||"失败"),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"apf-pending-remove",onClick:w=>g(_.id)},"×",8,j2)],2))),128))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("textarea",{ref_key:"textareaRef",ref:r,"onUpdate:modelValue":S[0]||(S[0]=_=>l.value=_),placeholder:t.placeholder||"输入消息…",disabled:t.disabled,onInput:$,onKeydown:T},null,40,q2),[[e.vModelText,l.value]]),e.createElementVNode("div",G2,[e.createElementVNode("div",W2,[e.renderSlot(E.$slots,"tools",{},void 0,!0),e.createElementVNode("input",{ref_key:"fileInputRef",ref:i,type:"file",class:"apf-file-input",multiple:"",accept:"image/*,.pdf,.txt,.md,.csv,.json,.doc,.docx,.xls,.xlsx",onChange:x},null,544),f.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"apf-cap-btn",type:"button","aria-label":"添加文件",disabled:t.disabled||s.value,onClick:h},[...S[2]||(S[2]=[e.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[e.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,Y2)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{type:"submit",class:"apf-send-btn",disabled:!u.value,title:"发送"},"↗",8,Z2)])],2),e.createElementVNode("div",K2,[e.createElementVNode("div",Q2,[S[3]||(S[3]=e.createElementVNode("span",{class:"apf-cap-chip"},"文本",-1)),f.value?(e.openBlock(),e.createElementBlock("span",X2,"文件")):e.createCommentVNode("",!0),t.hitlCapable?(e.openBlock(),e.createElementBlock("span",J2,"需要确认")):e.createCommentVNode("",!0)]),e.createElementVNode("div",v2,[t.wsStatus?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["apf-ws-status",t.wsStatus]),onClick:S[1]||(S[1]=_=>o("ws-click"))},[...S[4]||(S[4]=[e.createElementVNode("i",{class:"apf-ws-dot"},null,-1)])],2)):e.createCommentVNode("",!0),S[5]||(S[5]=e.createElementVNode("small",{class:"apf-hint"},"Enter 发送 · Shift+Enter 换行",-1))])])],32))}}),[["__scopeId","data-v-45ece43f"]]),t0={key:0,class:"apf-run-bar"},n0={class:"apf-row"},a0={key:0,class:"apf-elapsed"},o0={key:0,class:"apf-error-text"},Qa=L(e.defineComponent({__name:"RunStatusBar",props:{run:{},sending:{type:Boolean}},emits:["cancel"],setup(t,{emit:n}){const a=t,o=n,l=e.computed(()=>{var s;return((s=a.run)==null?void 0:s.status)||null});function r(s){return{RUNNING:"正在处理",COMPLETED:"已完成",FAILED:"处理失败",WAITING_INPUT:"等待你的确认",CANCELLED:"已取消"}[s]||s}function i(s){return{RUNNING:"apf-running",COMPLETED:"apf-success",FAILED:"apf-failed",WAITING_INPUT:"apf-waiting",CANCELLED:"apf-cancelled"}[s]||""}function c(){if(!a.run)return"";const s=new Date(a.run.startedAt).getTime(),d=a.run.finishedAt?new Date(a.run.finishedAt).getTime():Date.now(),f=Math.round((d-s)/1e3);return f<60?f+"s":Math.floor(f/60)+"m "+f%60+"s"}return(s,d)=>t.run?(e.openBlock(),e.createElementBlock("div",t0,[e.createElementVNode("div",n0,[e.createElementVNode("span",{class:e.normalizeClass(["apf-chip",i(l.value||"")])},[d[1]||(d[1]=e.createElementVNode("i",null,null,-1)),e.createTextVNode(e.toDisplayString(r(l.value||"")),1)],2),l.value==="RUNNING"||l.value==="WAITING_INPUT"?(e.openBlock(),e.createElementBlock("span",a0,e.toDisplayString(c()),1)):e.createCommentVNode("",!0),l.value==="RUNNING"?(e.openBlock(),e.createElementBlock("button",{key:1,class:"apf-btn-cancel",onClick:d[0]||(d[0]=f=>o("cancel"))},"停止")):e.createCommentVNode("",!0)]),t.run.errorMessage?(e.openBlock(),e.createElementBlock("p",o0,e.toDisplayString(t.run.errorMessage),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-33963f1d"]]),l0={class:"apf-header"},r0={key:0,class:"apf-danger-tag"},s0={class:"apf-prompt"},i0=["placeholder"],c0=["value"],d0=["placeholder"],p0={class:"apf-actions"},f0=["disabled","onClick"],h0=L(e.defineComponent({__name:"ApprovalCard",props:{waiting:{},disabled:{type:Boolean}},emits:["resume"],setup(t,{emit:n}){const a=n,o=e.ref("");function l(r){a("resume",r,o.value||void 0),o.value=""}return(r,i)=>t.waiting?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["apf-approval-card",{"apf-dangerous":t.waiting.dangerous}])},[e.createElementVNode("div",l0,[i[3]||(i[3]=e.createElementVNode("span",{class:"apf-title"},"需要你的操作",-1)),t.waiting.dangerous?(e.openBlock(),e.createElementBlock("span",r0,"危险操作")):e.createCommentVNode("",!0)]),e.createElementVNode("p",s0,e.toDisplayString(t.waiting.prompt),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.waiting.fields,c=>(e.openBlock(),e.createElementBlock("div",{key:c.key,class:"apf-field"},[e.createElementVNode("label",null,e.toDisplayString(c.label),1),c.type==="textarea"?e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:0,"onUpdate:modelValue":i[0]||(i[0]=s=>o.value=s),placeholder:"请输入"+c.label,rows:"2"},null,8,i0)),[[e.vModelText,o.value]]):c.type==="select"&&c.options.length?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:1,"onUpdate:modelValue":i[1]||(i[1]=s=>o.value=s)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options,s=>(e.openBlock(),e.createElementBlock("option",{key:s,value:s},e.toDisplayString(s),9,c0))),128))],512)),[[e.vModelSelect,o.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,"onUpdate:modelValue":i[2]||(i[2]=s=>o.value=s),placeholder:"请输入"+c.label},null,8,d0)),[[e.vModelText,o.value]])]))),128)),e.createElementVNode("div",p0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.waiting.actions,c=>(e.openBlock(),e.createElementBlock("button",{key:c.action,class:e.normalizeClass(["apf-btn",c.style==="danger"?"apf-btn-danger":"apf-btn-primary"]),disabled:t.disabled,onClick:s=>l(c.action)},e.toDisplayString(c.label),11,f0))),128))])],2)):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-eef9b412"]]),m0=["aria-label"],u0={class:"apf-preview-head"},g0={class:"apf-preview-title"},k0={class:"apf-preview-actions"},y0=["href"],b0={key:0,class:"apf-preview-body apf-preview-body-image"},_0=["src","alt"],w0={key:3,class:"apf-gallery-counter"},C0={key:1,class:"apf-preview-body apf-preview-body-pdf"},E0=["src","title"],x0={key:2,class:"apf-preview-body apf-preview-body-degraded"},$0={class:"apf-degraded-content"},T0={class:"apf-degraded-badge"},S0={class:"apf-degraded-filename"},V0={key:0,class:"apf-degraded-size"},B0=["href"],N0=L(e.defineComponent({__name:"AttachmentPreviewModal",props:{modelValue:{type:Boolean},attachment:{},gallery:{}},emits:["update:modelValue","update:attachment"],setup(t,{emit:n}){const a=t,o=n,l=e.computed({get:()=>a.modelValue,set:w=>o("update:modelValue",w)});function r(w){return w.url||""}const i=e.computed(()=>a.attachment?Me(a.attachment):!1),c=e.computed(()=>a.attachment?Ye(a.attachment):!1),s=e.computed(()=>{var B;return((B=a.gallery)!=null&&B.length?a.gallery:a.attachment?[a.attachment]:[]).filter(Me)}),d=e.computed(()=>!s.value.length||!a.attachment?-1:s.value.findIndex(w=>{var B;return w.id===((B=a.attachment)==null?void 0:B.id)})),f=e.computed(()=>d.value>0),u=e.computed(()=>d.value>=0&&d.value<s.value.length-1),h=e.ref(null),x=e.ref(null),g=e.ref(null);function A(){l.value=!1}function $(){if(!f.value)return;const w=s.value[d.value-1];w&&o("update:attachment",w)}function T(){if(!u.value)return;const w=s.value[d.value+1];w&&o("update:attachment",w)}function E(w){if(l.value){if(w.key==="Escape"){w.preventDefault(),A();return}if(w.key==="ArrowLeft"&&f.value){w.preventDefault(),$();return}if(w.key==="ArrowRight"&&u.value){w.preventDefault(),T();return}if(w.key==="Tab"&&h.value){const B=h.value.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(B.length===0)return;const j=B[0],ee=B[B.length-1];w.shiftKey&&document.activeElement===j?(w.preventDefault(),ee.focus()):!w.shiftKey&&document.activeElement===ee&&(w.preventDefault(),j.focus())}}}e.watch(l,w=>{w?(g.value=document.activeElement,requestAnimationFrame(()=>{var B;return(B=x.value)==null?void 0:B.focus()}),document.addEventListener("keydown",E)):(document.removeEventListener("keydown",E),g.value&&(g.value.focus(),g.value=null))}),e.onUnmounted(()=>document.removeEventListener("keydown",E));function S(w){w.target===w.currentTarget&&A()}function _(w){w.stopPropagation()}return(w,B)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value&&t.attachment?(e.openBlock(),e.createElementBlock("div",{key:0,class:"apf-preview-mask",role:"dialog","aria-modal":"true","aria-label":`预览 ${t.attachment.filename}`,onClick:S},[e.createElementVNode("div",{ref_key:"panelRef",ref:h,class:e.normalizeClass(["apf-preview-panel",{"apf-preview-image":i.value,"apf-preview-pdf":c.value,"apf-preview-degraded":!i.value&&!c.value}]),onClick:_},[e.createElementVNode("header",u0,[e.createElementVNode("strong",g0,e.toDisplayString(t.attachment.filename),1),e.createElementVNode("div",k0,[r(t.attachment)?(e.openBlock(),e.createElementBlock("a",{key:0,href:r(t.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn"},e.toDisplayString(c.value?"新窗口打开":i.value?"打开原图":"打开/下载"),9,y0)):e.createCommentVNode("",!0),e.createElementVNode("button",{ref_key:"closeBtnRef",ref:x,type:"button",class:"apf-preview-action-btn","aria-label":"关闭预览",onClick:A}," 关闭 ",512)])]),i.value?(e.openBlock(),e.createElementBlock("div",b0,[f.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"apf-gallery-btn apf-gallery-prev","aria-label":"上一张图片",onClick:$}," ‹ ")):e.createCommentVNode("",!0),r(t.attachment)?(e.openBlock(),e.createElementBlock("img",{key:1,src:r(t.attachment),alt:t.attachment.filename,class:"apf-preview-img"},null,8,_0)):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"apf-gallery-btn apf-gallery-next","aria-label":"下一张图片",onClick:T}," › ")):e.createCommentVNode("",!0),s.value.length>1?(e.openBlock(),e.createElementBlock("div",w0,e.toDisplayString(d.value+1)+" / "+e.toDisplayString(s.value.length),1)):e.createCommentVNode("",!0)])):c.value?(e.openBlock(),e.createElementBlock("div",C0,[r(t.attachment)?(e.openBlock(),e.createElementBlock("iframe",{key:0,src:r(t.attachment),title:t.attachment.filename,class:"apf-pdf-frame"},null,8,E0)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",x0,[e.createElementVNode("div",$0,[e.createElementVNode("span",T0,e.toDisplayString(e.unref(Wt)(t.attachment)),1),e.createElementVNode("strong",S0,e.toDisplayString(t.attachment.filename),1),t.attachment.size?(e.openBlock(),e.createElementBlock("p",V0,e.toDisplayString(e.unref(mt)(t.attachment.size)),1)):e.createCommentVNode("",!0),B[0]||(B[0]=e.createElementVNode("p",{class:"apf-degraded-hint"},"此格式暂不支持应用内预览",-1)),r(t.attachment)?(e.openBlock(),e.createElementBlock("a",{key:1,href:r(t.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn apf-preview-action-primary"}," 打开/下载 ",8,B0)):e.createCommentVNode("",!0)])]))],2)],8,m0)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-40702673"]]),A0={class:"apf-session-sidebar","aria-label":"会话列表"},z0={class:"apf-session-sidebar__head"},M0={class:"apf-session-sidebar__list"},L0=["onClick"],I0={class:"apf-session-sidebar__item-title"},R0={key:0,class:"apf-session-sidebar__empty"},D0=L(e.defineComponent({__name:"SessionSidebar",props:{sessions:{},activeId:{},loading:{type:Boolean},title:{}},emits:["select","create","delete"],setup(t,{emit:n}){const a=n;function o(l){if(!l)return"";const r=new Date(l),i=(Date.now()-r.getTime())/1e3;return i<60?"刚刚":i<3600?`${Math.floor(i/60)} 分钟前`:i<86400?`${Math.floor(i/3600)} 小时前`:r.toLocaleDateString("zh-CN")}return(l,r)=>{const i=e.resolveComponent("el-button"),c=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("aside",A0,[e.createElementVNode("div",z0,[e.createElementVNode("strong",null,e.toDisplayString(t.title||"会话"),1),e.createVNode(i,{type:"primary",size:"small",onClick:r[0]||(r[0]=s=>a("create"))},{default:e.withCtx(()=>[...r[1]||(r[1]=[e.createTextVNode("新建",-1)])]),_:1})]),e.withDirectives((e.openBlock(),e.createElementBlock("div",M0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.sessions,s=>(e.openBlock(),e.createElementBlock("button",{key:s.id,type:"button",class:e.normalizeClass(["apf-session-sidebar__item",{"is-active":s.id===t.activeId}]),onClick:d=>a("select",s.id)},[e.createElementVNode("span",I0,e.toDisplayString(s.title||"未命名会话"),1),e.createElementVNode("small",null,e.toDisplayString(o(s.updatedAt||s.createdAt)),1),e.createVNode(i,{class:"apf-session-sidebar__delete",link:"",type:"danger",size:"small",onClick:e.withModifiers(d=>a("delete",s.id),["stop"])},{default:e.withCtx(()=>[...r[2]||(r[2]=[e.createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])],10,L0))),128)),!t.loading&&!t.sessions.length?(e.openBlock(),e.createElementBlock("div",R0,"暂无会话")):e.createCommentVNode("",!0)])),[[c,t.loading]])])}}}),[["__scopeId","data-v-8f9bd29d"]]),P0={key:0,class:"apf-processing-drawer__subtitle"},O0={class:"apf-processing-drawer__body"},H0=L(e.defineComponent({__name:"ProcessingDrawer",props:{modelValue:{type:Boolean},run:{},title:{},subtitle:{},sending:{type:Boolean}},emits:["update:modelValue","cancel"],setup(t,{emit:n}){const a=n;return(o,l)=>{const r=e.resolveComponent("el-drawer");return e.openBlock(),e.createBlock(r,{"model-value":t.modelValue,title:t.title||"处理详情",size:"380px","append-to-body":"","onUpdate:modelValue":l[1]||(l[1]=i=>a("update:modelValue",i))},{default:e.withCtx(()=>[t.subtitle?(e.openBlock(),e.createElementBlock("p",P0,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0),t.run?(e.openBlock(),e.createBlock(e.unref(Qa),{key:1,run:t.run,sending:t.sending??!1,onCancel:l[0]||(l[0]=i=>a("cancel"))},null,8,["run","sending"])):e.createCommentVNode("",!0),e.createElementVNode("div",O0,[e.renderSlot(o.$slots,"default",{},void 0,!0)])]),_:3},8,["model-value","title"])}}}),[["__scopeId","data-v-6036074a"]]),F0={class:"apf-conversation-header"},U0={class:"apf-conversation-header__identity"},j0={class:"apf-conversation-header__copy"},q0={class:"apf-conversation-header__label"},G0={class:"apf-conversation-header__actions"},W0={key:0,class:"apf-conversation-header__processing"},Y0=L(e.defineComponent({__name:"ConversationHeader",props:{title:{},label:{},hasMessages:{type:Boolean},processing:{type:Boolean}},emits:["changeAssistant","toggleDetails","create"],setup(t,{emit:n}){const a=n;return(o,l)=>(e.openBlock(),e.createElementBlock("header",F0,[e.createElementVNode("div",U0,[e.createElementVNode("div",j0,[e.createElementVNode("span",q0,e.toDisplayString(t.label||"正在使用"),1),e.createElementVNode("strong",null,e.toDisplayString(t.title||"选择一个智能体开始"),1)])]),e.createElementVNode("div",G0,[t.processing?(e.openBlock(),e.createElementBlock("span",W0,[...l[2]||(l[2]=[e.createElementVNode("i",null,null,-1),e.createElementVNode("span",null,"正在处理",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"apf-conversation-header__btn",onClick:l[0]||(l[0]=r=>a(t.hasMessages?"create":"changeAssistant"))},e.toDisplayString(t.hasMessages?"新建对话":"选择智能体"),1),t.hasMessages?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"apf-conversation-header__btn",onClick:l[1]||(l[1]=r=>a("toggleDetails"))}," 处理详情 ")):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-47648485"]]),Z0={class:"apf-assistant-picker"},K0={key:0,class:"apf-assistant-picker__state"},Q0={key:1,class:"apf-assistant-picker__state apf-assistant-picker__state--error"},X0={key:2,class:"apf-assistant-picker__state"},J0=["onClick"],v0={class:"apf-assistant-picker__main"},ed={class:"apf-assistant-picker__icon-wrap"},td={class:"apf-assistant-picker__info"},nd={class:"apf-assistant-picker__caps"},ad=L(e.defineComponent({__name:"AssistantPicker",props:{items:{},modelValue:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","select"],setup(t,{emit:n}){const a=t,o=n;function l(s){var f,u;const d=["文本"];return(f=s.supportedInputs)!=null&&f.includes("file")&&d.push("文件"),(u=s.supportedInputs)!=null&&u.includes("image")&&d.push("图片"),s.hitlCapable&&d.push("需要确认"),d}function r(s){return s.icon||"chat-dot-round"}function i(s){o("update:modelValue",s.id),o("select",s)}const c=e.computed(()=>!a.loading&&!a.error&&!a.items.length);return(s,d)=>(e.openBlock(),e.createElementBlock("div",Z0,[t.loading?(e.openBlock(),e.createElementBlock("div",K0,[...d[0]||(d[0]=[e.createElementVNode("p",null,"正在加载智能体…",-1)])])):t.error?(e.openBlock(),e.createElementBlock("div",Q0,[e.createElementVNode("p",null,e.toDisplayString(t.error),1)])):c.value?(e.openBlock(),e.createElementBlock("div",X0,[...d[1]||(d[1]=[e.createElementVNode("p",null,"暂无可用智能体",-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,f=>(e.openBlock(),e.createElementBlock("button",{key:f.id,type:"button",class:e.normalizeClass(["apf-assistant-picker__item",{"is-active":t.modelValue===f.id}]),onClick:u=>i(f)},[e.createElementVNode("div",v0,[e.createElementVNode("span",ed,[e.createVNode(e.unref(le),{name:r(f),size:22},null,8,["name"])]),e.createElementVNode("span",td,[e.createElementVNode("b",null,e.toDisplayString(f.name),1),e.createElementVNode("small",null,e.toDisplayString(f.description||"适合处理一类明确任务"),1),e.createElementVNode("span",nd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l(f),u=>(e.openBlock(),e.createElementBlock("span",{key:u,class:e.normalizeClass(["apf-assistant-picker__cap",{"is-confirm":u==="需要确认"}])},e.toDisplayString(u),3))),128))])])]),e.createElementVNode("span",{class:e.normalizeClass(["apf-assistant-picker__choose",{"is-selected":t.modelValue===f.id}])},e.toDisplayString(t.modelValue===f.id?"已选择":"开始使用"),3)],10,J0))),128))]))}}),[["__scopeId","data-v-f05e69c0"]]),od={class:"apf-model-picker"},ld=L(e.defineComponent({__name:"ModelPicker",props:{models:{},modelValue:{},loading:{type:Boolean}},emits:["update:modelValue"],setup(t,{emit:n}){const a=n;return(o,l)=>{const r=e.resolveComponent("el-option"),i=e.resolveComponent("el-select");return e.openBlock(),e.createElementBlock("label",od,[e.createVNode(i,{"model-value":t.modelValue||void 0,disabled:t.loading||!t.models.length,placeholder:"选择模型","onUpdate:modelValue":l[0]||(l[0]=c=>a("update:modelValue",c))},{default:e.withCtx(()=>[t.loading?(e.openBlock(),e.createBlock(r,{key:0,label:"正在加载模型…",value:"",disabled:""})):t.models.length?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(r,{key:1,label:"暂无可用模型",value:"",disabled:""})),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.models,c=>(e.openBlock(),e.createBlock(r,{key:c.id,label:`${c.name} · ${c.provider}`,value:c.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])])}}}),[["__scopeId","data-v-483ae73d"]]),Xa=Symbol("fg-toast");function rd(t){return{[Xa]:t}}function sd(){const t=e.inject(Xa);return{show(n,a="info",o){var l;(l=t==null?void 0:t.value)==null||l.show(n,a,o)},info(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"info",a)},success(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"success",a)},warning(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"warning",a)},error(n,a){var o;(o=t==null?void 0:t.value)==null||o.show(n,"error",a)}}}function id(){async function t(o,l={}){const{title:r="确认操作",type:i="warning",confirmButtonText:c="确定",cancelButtonText:s="取消"}=l;try{return await se.ElMessageBox.confirm(o,r,{confirmButtonText:c,cancelButtonText:s,type:i}),!0}catch{return!1}}async function n(o,l={}){return t(`此操作将永久删除${o},是否继续?`,{title:"确认删除",type:"danger",confirmButtonText:"确认删除",...l})}async function a(o,l={}){return t(o,{title:"确认操作",type:"danger",...l})}return{confirm:t,confirmDelete:n,confirmDanger:a}}function cd(){return{success(t,n={}){se.ElMessage({message:t,type:"success",...n})},error(t,n={}){se.ElMessage({message:t,type:"error",...n})},warning(t,n={}){se.ElMessage({message:t,type:"warning",...n})},info(t,n={}){se.ElMessage({message:t,type:"info",...n})}}}function dd(t,n=300){const a=e.ref(null);function o(...l){a.value&&clearTimeout(a.value),a.value=setTimeout(()=>{t(...l),a.value=null},n)}return e.onUnmounted(()=>{a.value&&clearTimeout(a.value)}),o}function pd(t,n){var c;const a=e.ref(1),o=e.ref((n==null?void 0:n.initialPageSize)??Gt),l=e.computed(()=>{const s=t.value,d=(a.value-1)*o.value;return s.slice(d,d+o.value)}),r=e.computed(()=>t.value.length);function i(){a.value=1}return e.watch(o,()=>{a.value=1},{flush:"sync"}),e.watch(t,s=>{const d=Math.max(1,Math.ceil(s.length/o.value)||1);a.value>d&&(a.value=d)}),(c=n==null?void 0:n.resetOn)!=null&&c.length&&e.watch(n.resetOn,()=>{i()}),{currentPage:a,pageSize:o,pagedItems:l,total:r,resetPage:i}}function fd(t={}){const{timeout:n=15e3,silentError:a=!1}=t,o=e.ref(!1),l=e.ref(null),r=e.ref(!1),i=e.computed(()=>l.value!==null);let c=null,s=0;function d(){s++,s===1&&(o.value=!0,l.value=null,r.value=!1,c=setTimeout(()=>{r.value=!0},n))}function f(){s=Math.max(0,s-1),s===0&&(o.value=!1,r.value=!1,c&&(clearTimeout(c),c=null))}async function u(x){d();try{return await x()}catch(g){return a||(l.value=g instanceof Error?g.message:"加载失败"),null}finally{f()}}function h(){s=0,o.value=!1,l.value=null,r.value=!1,c&&(clearTimeout(c),c=null)}return{loading:o,error:l,timedOut:r,hasError:i,withLoading:u,reset:h}}function hd(t){if(!t)return"操作失败";if(typeof t=="string")return t;if(t instanceof Error)return t.message||"操作失败";if(typeof t=="object"){const n=t;if(n.message)return n.message;if(n.errors&&typeof n.errors=="object"){const a=[];for(const o of Object.values(n.errors))Array.isArray(o)&&a.push(...o);if(a.length>0)return a.join(";")}if(n.code)return`错误码:${n.code}`}return"操作失败"}const md={primary:"#0060A2",primaryHover:"#4581E9",primaryLight:"#4581E9",primaryLighter:"#EEF5FF",primaryDark:"#0060A2",success:"#26A036",warning:"#F09700",danger:"#E50113",info:"#4581E9"},ud={title:"#303133",primary:"#333333",regular:"#606266",secondary:"#666666",muted:"#909399",placeholder:"#969FA8",disabled:"#C0C4CC",inverse:"#FFFFFF"},gd={10:"10px",11:"11px",12:"12px",13:"13px",14:"14px",15:"15px",16:"16px",18:"18px",20:"20px",22:"22px",24:"24px",28:"28px"},kd={xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px","2xl":"48px","3xl":"64px",10:"10px",12:"12px",20:"20px"},yd={xs:"24px",sm:"28px",md:"32px",lg:"40px",xl:"44px"},bd={header:"56px",conversationHeader:"68px",dialogFooter:"60px",toolbar:"48px",tabs:"40px",listRow:"48px"},_d={xs:"12px",sm:"14px",md:"16px",lg:"20px",xl:"24px"},wd={paddingX:"24px",paddingY:"24px",headerPaddingTop:"28px",sidebarWidth:"240px",sidebarWidthCollapsed:"64px"},Cd={sm:"2px",md:"4px",6:"6px",8:"8px",lg:"10px",xl:"12px",full:"999px"},Ed={fieldWidth:"220px",labelWidth:"96px",fieldGap:"6px"},xd={sm:"24px",md:"32px",lg:"40px",xl:"48px"},$d={sm:"0 1px 2px rgba(0, 0, 0, 0.05)",md:"0 4px 12px rgba(0, 0, 0, 0.08)",lg:"0 8px 24px rgba(0, 0, 0, 0.12)"},Td={fast:"0.15s",normal:"0.25s",slow:"0.35s"},Sd={dropdown:1e3,sticky:1020,fixed:1030,modalBackdrop:1040,modal:1050,popover:1060,tooltip:1070,toast:1080},Vd="1.4.2",Bd="2.14.2",Nd="2026-08-27";y.APP_ICON_NAMES=Wr,y.AVATAR_SIZE=xd,y.AppDialog=rt,y.AppIcon=le,y.AppPagination=Zr,y.ApprovalCard=h0,y.AssistantPicker=ad,y.AttachmentPreviewModal=N0,y.BORDER_RADIUS=Cd,y.COLORS=md,y.CONTROL_HEIGHT=yd,y.CardGridSkeleton=ls,y.CardTable=Cs,y.Composer=e0,y.ConfirmDialog=Kr,y.ContentPanel=gs,y.ConversationHeader=Y0,y.DEFAULT_PAGE_SIZE=Gt,y.DURATION=Td,y.DocumentPreviewDrawer=ii,y.DocumentPreviewPanel=ra,y.DocumentSummaryList=Za,y.EP_FORK_BASE=Bd,y.EP_FORK_DATE=Nd,y.EmptyState=ts,y.ErrorBoundary=ns,y.FONT_SIZE=gd,y.FORM=Ed,y.FieldRow=zs,y.FilterBar=ws,y.FilterTabs=Jr,y.FormDialog=Qr,y.HintText=Is,y.ICON_MAP=ht,y.ICON_SIZE=_d,y.JsonCard=Ws,y.JsonDetailDialog=Zs,y.LAYOUT_HEIGHT=bd,y.LoadingDots=Us,y.MessageAttachmentList=Ya,y.MessageBubble=Ka,y.MessageList=D2,y.MessageParts=Wa,y.ModelPicker=ld,y.PAGE=wd,y.PAGE_SIZE_OPTIONS=na,y.PAGINATION_LAYOUT=aa,y.PageHeader=ps,y.PageShell=ds,y.ProcessingDrawer=H0,y.RunStatusBar=Qa,y.SCHEMA_UI_VERSION=Vd,y.SHADOWS=$d,y.SPACING=kd,y.SchemaLitePreview=Qs,y.SearchForm=Bs,y.SectionToggle=Hs,y.SessionSidebar=D0,y.Skeleton=os,y.StatusTag=as,y.TEXT_COLORS=ud,y.TableRowActions=xs,y.Toast=es,y.TruncatedTooltipText=oa,y.UserAvatar=cs,y.Z_INDEX=Sd,y.fileKind=Wt,y.formatSize=mt,y.isImage=Me,y.isOffice=la,y.isPdf=Ye,y.isPreviewable=Xs,y.isRegisteredAppIcon=Yr,y.provideToast=rd,y.renderMarkdown=Ga,y.resolveApiErrorMessage=hd,y.splitTextAndCodeBlocks=ja,y.useClientPagination=pd,y.useConfirm=id,y.useDataLoading=fd,y.useDebounceFn=dd,y.useMessage=cd,y.useToast=sd,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
package/dist/index.d.ts CHANGED
@@ -72,6 +72,6 @@ export { renderMarkdown, splitTextAndCodeBlocks } from './utils/textParser';
72
72
  export type { TextPart } from './utils/textParser';
73
73
  export { isImage, isPdf, isOffice, isPreviewable, fileKind, formatSize } from './utils/attachmentKind';
74
74
  export { COLORS, TEXT_COLORS, SPACING, BORDER_RADIUS, SHADOWS, DURATION, Z_INDEX, FONT_SIZE, CONTROL_HEIGHT, LAYOUT_HEIGHT, ICON_SIZE, PAGE, FORM, AVATAR_SIZE, } from './tokens';
75
- export declare const SCHEMA_UI_VERSION = "1.4.0";
75
+ export declare const SCHEMA_UI_VERSION = "1.4.2";
76
76
  export declare const EP_FORK_BASE = "2.14.2";
77
77
  export declare const EP_FORK_DATE = "2026-08-27";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apform-ui/core",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "type": "module",
5
5
  "author": "yangdongnan",
6
6
  "license": "MIT",
@@ -37,6 +37,7 @@
37
37
  "./design-tokens.css": "./src/tokens/design-tokens.css",
38
38
  "./style.css": "./dist/apform-ui.css",
39
39
  "./styles/element-override.css": "./styles/element-override.css",
40
+ "./styles/fg-theme.css": "./styles/fg-theme.css",
40
41
  "./theme/*": "./src/theme/*",
41
42
  "./styles/*": "./styles/*"
42
43
  },
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Fg / FormGrid 主题覆盖 — 将 `.fg` 运行时默认值绑到平台设计令牌
3
+ *
4
+ * 用法(editor / Schema 预览宿主):
5
+ * import '@apform-ui/core/design-tokens.css'
6
+ * import '@apform-ui/core/styles/fg-theme.css'
7
+ *
8
+ * 说明:
9
+ * - 画布内单控件高度仍可由 useWidgetControlSize 通过 --el-component-size 覆盖
10
+ * - 此处只提供未指定尺寸时的默认阶梯,并统一 Fg 色板到 --color-primary 等
11
+ */
12
+
13
+ .fg {
14
+ /* 色板 → 平台令牌(覆盖旧 TDesign #0052d9) */
15
+ --fg-color-primary: var(--color-primary);
16
+ --fg-color-warning: var(--color-warning);
17
+ --fg-color-danger: var(--color-danger);
18
+ --fg-color-success: var(--color-success);
19
+
20
+ --fg-text-primary: var(--text-color-primary);
21
+ --fg-text-secondary: var(--text-color-secondary);
22
+ --fg-text-hint: var(--text-color-muted);
23
+
24
+ --fg-border-general: var(--border-color-light);
25
+ --fg-border-input: var(--border-color-light);
26
+ --fg-border-focus: var(--color-primary);
27
+ --fg-border-active: var(--color-primary);
28
+ --fg-border-error: var(--color-danger);
29
+ --fg-bg-disabled: var(--bg-color-gray);
30
+ --fg-bg-menu-hover: var(--bg-color-hover);
31
+
32
+ /* 字号 / 行高 */
33
+ --fg-font-family: var(--font-family-base);
34
+ --fg-font-size-title-lg: var(--font-size-22);
35
+ --fg-font-size-title: var(--font-size-18);
36
+ --fg-font-size-body: var(--font-size-16);
37
+ --fg-font-size-caption: var(--font-size-14);
38
+ --fg-line-height: var(--line-height-normal);
39
+
40
+ /* 控件高度阶梯 */
41
+ --fg-btn-height-primary: var(--control-height-md);
42
+ --fg-btn-height-card: var(--control-height-lg);
43
+ --fg-input-height: var(--list-row-height);
44
+ --fg-nav-menu-height: var(--control-height-xl);
45
+ --fg-btn-radius: var(--border-radius-sm);
46
+ --fg-input-radius: var(--border-radius-sm);
47
+ --fg-nav-icon-size: var(--icon-size-lg);
48
+
49
+ color: var(--fg-text-primary);
50
+ font-family: var(--fg-font-family);
51
+ font-size: var(--fg-font-size-body);
52
+ line-height: var(--fg-line-height);
53
+ }