@sy-design/svelte 1.0.23 → 1.0.24
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/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
package/dist/index.umd.js
CHANGED
|
@@ -44,5 +44,5 @@ ${e}</tr>
|
|
|
44
44
|
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const s=Ri(e);if(s===null)return n;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+=">"+n+"</a>",o}image(e,t,n){const s=Ri(e);if(s===null)return n;e=s;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return e}}class qn{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class at{constructor(e){ie(this,"options");ie(this,"renderer");ie(this,"textRenderer");this.options=e||Et,this.options.renderer=this.options.renderer||new wn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qn}static parse(e,t){return new at(t).parse(e)}static parseInline(e,t){return new at(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const o=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const l=o,r=this.options.extensions.renderers[l.type].call({parser:this},l);if(r!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){n+=r||"";continue}}switch(o.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const l=o;n+=this.renderer.heading(this.parseInline(l.tokens),l.depth,uo(this.parseInline(l.tokens,this.textRenderer)));continue}case"code":{const l=o;n+=this.renderer.code(l.text,l.lang,!!l.escaped);continue}case"table":{const l=o;let r="",c="";for(let u=0;u<l.header.length;u++)c+=this.renderer.tablecell(this.parseInline(l.header[u].tokens),{header:!0,align:l.align[u]});r+=this.renderer.tablerow(c);let f="";for(let u=0;u<l.rows.length;u++){const d=l.rows[u];c="";for(let m=0;m<d.length;m++)c+=this.renderer.tablecell(this.parseInline(d[m].tokens),{header:!1,align:l.align[m]});f+=this.renderer.tablerow(c)}n+=this.renderer.table(r,f);continue}case"blockquote":{const l=o,r=this.parse(l.tokens);n+=this.renderer.blockquote(r);continue}case"list":{const l=o,r=l.ordered,c=l.start,f=l.loose;let u="";for(let d=0;d<l.items.length;d++){const m=l.items[d],g=m.checked,p=m.task;let _="";if(m.task){const y=this.renderer.checkbox(!!g);f?m.tokens.length>0&&m.tokens[0].type==="paragraph"?(m.tokens[0].text=y+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&m.tokens[0].tokens[0].type==="text"&&(m.tokens[0].tokens[0].text=y+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:y+" "}):_+=y+" "}_+=this.parse(m.tokens,f),u+=this.renderer.listitem(_,p,!!g)}n+=this.renderer.list(u,r,c);continue}case"html":{const l=o;n+=this.renderer.html(l.text,l.block);continue}case"paragraph":{const l=o;n+=this.renderer.paragraph(this.parseInline(l.tokens));continue}case"text":{let l=o,r=l.tokens?this.parseInline(l.tokens):l.text;for(;s+1<e.length&&e[s+1].type==="text";)l=e[++s],r+=`
|
|
45
45
|
`+(l.tokens?this.parseInline(l.tokens):l.text);n+=t?this.renderer.paragraph(r):r;continue}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let s=0;s<e.length;s++){const o=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=l||"";continue}}switch(o.type){case"escape":{const l=o;n+=t.text(l.text);break}case"html":{const l=o;n+=t.html(l.text);break}case"link":{const l=o;n+=t.link(l.href,l.title,this.parseInline(l.tokens,t));break}case"image":{const l=o;n+=t.image(l.href,l.title,l.text);break}case"strong":{const l=o;n+=t.strong(this.parseInline(l.tokens,t));break}case"em":{const l=o;n+=t.em(this.parseInline(l.tokens,t));break}case"codespan":{const l=o;n+=t.codespan(l.text);break}case"br":{n+=t.br();break}case"del":{const l=o;n+=t.del(this.parseInline(l.tokens,t));break}case"text":{const l=o;n+=t.text(l.text);break}default:{const l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}}class Jt{constructor(e){ie(this,"options");this.options=e||Et}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}ie(Jt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Bo{constructor(...e){Ds(this,At);ie(this,"defaults",Fn());ie(this,"options",this.setOptions);ie(this,"parse",An(this,At,ai).call(this,rt.lex,at.parse));ie(this,"parseInline",An(this,At,ai).call(this,rt.lexInline,at.parseInline));ie(this,"Parser",at);ie(this,"Renderer",wn);ie(this,"TextRenderer",qn);ie(this,"Lexer",rt);ie(this,"Tokenizer",dn);ie(this,"Hooks",Jt);this.use(...e)}walkTokens(e,t){var s,o;let n=[];for(const l of e)switch(n=n.concat(t.call(this,l)),l.type){case"table":{const r=l;for(const c of r.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of r.rows)for(const f of c)n=n.concat(this.walkTokens(f.tokens,t));break}case"list":{const r=l;n=n.concat(this.walkTokens(r.items,t));break}default:{const r=l;(o=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&o[r.type]?this.defaults.extensions.childTokens[r.type].forEach(c=>{const f=r[c].flat(1/0);n=n.concat(this.walkTokens(f,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s=ne({},n);if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const l=t.renderers[o.name];l?t.renderers[o.name]=function(...r){let c=o.renderer.apply(this,r);return c===!1&&(c=l.apply(this,r)),c}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const l=t[o.level];l?l.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),s.extensions=t),n.renderer){const o=this.defaults.renderer||new wn(this.defaults);for(const l in n.renderer){if(!(l in o))throw new Error(`renderer '${l}' does not exist`);if(l==="options")continue;const r=l,c=n.renderer[r],f=o[r];o[r]=(...u)=>{let d=c.apply(o,u);return d===!1&&(d=f.apply(o,u)),d||""}}s.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new dn(this.defaults);for(const l in n.tokenizer){if(!(l in o))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;const r=l,c=n.tokenizer[r],f=o[r];o[r]=(...u)=>{let d=c.apply(o,u);return d===!1&&(d=f.apply(o,u)),d}}s.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new Jt;for(const l in n.hooks){if(!(l in o))throw new Error(`hook '${l}' does not exist`);if(l==="options")continue;const r=l,c=n.hooks[r],f=o[r];Jt.passThroughHooks.has(l)?o[r]=u=>{if(this.defaults.async)return Promise.resolve(c.call(o,u)).then(m=>f.call(o,m));const d=c.call(o,u);return f.call(o,d)}:o[r]=(...u)=>{let d=c.apply(o,u);return d===!1&&(d=f.apply(o,u)),d}}s.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,l=n.walkTokens;s.walkTokens=function(r){let c=[];return c.push(l.call(this,r)),o&&(c=c.concat(o.call(this,r))),c}}this.defaults=ne(ne({},this.defaults),s)}),this}setOptions(e){return this.defaults=ne(ne({},this.defaults),e),this}lexer(e,t){return rt.lex(e,t!=null?t:this.defaults)}parser(e,t){return at.parse(e,t!=null?t:this.defaults)}}At=new WeakSet,ai=function(e,t){return(n,s)=>{const o=ne({},s),l=ne(ne({},this.defaults),o);this.defaults.async===!0&&o.async===!1&&(l.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),l.async=!0);const r=An(this,At,Os).call(this,!!l.silent,!!l.async);if(typeof n=="undefined"||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.async)return Promise.resolve(l.hooks?l.hooks.preprocess(n):n).then(c=>e(c,l)).then(c=>l.hooks?l.hooks.processAllTokens(c):c).then(c=>l.walkTokens?Promise.all(this.walkTokens(c,l.walkTokens)).then(()=>c):c).then(c=>t(c,l)).then(c=>l.hooks?l.hooks.postprocess(c):c).catch(r);try{l.hooks&&(n=l.hooks.preprocess(n));let c=e(n,l);l.hooks&&(c=l.hooks.processAllTokens(c)),l.walkTokens&&this.walkTokens(c,l.walkTokens);let f=t(c,l);return l.hooks&&(f=l.hooks.postprocess(f)),f}catch(c){return r(c)}}},Os=function(e,t){return n=>{if(n.message+=`
|
|
46
46
|
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+Qe(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}};const St=new Bo;function ae(i,e){return St.parse(i,e)}ae.options=ae.setOptions=function(i){return St.setOptions(i),ae.defaults=St.defaults,Ei(ae.defaults),ae},ae.getDefaults=Fn,ae.defaults=Et,ae.use=function(...i){return St.use(...i),ae.defaults=St.defaults,Ei(ae.defaults),ae},ae.walkTokens=function(i,e){return St.walkTokens(i,e)},ae.parseInline=St.parseInline,ae.Parser=at,ae.parser=at.parse,ae.Renderer=wn,ae.TextRenderer=qn,ae.Lexer=rt,ae.lexer=rt.lex,ae.Tokenizer=dn,ae.Hooks=Jt,ae.parse=ae,ae.options,ae.setOptions,ae.use,ae.walkTokens,ae.parseInline,at.parse,rt.lex;/*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE */const{entries:Hi,setPrototypeOf:Bi,isFrozen:jo,getPrototypeOf:Uo,getOwnPropertyDescriptor:Wo}=Object;let{freeze:Ue,seal:tt,create:ji}=Object,{apply:Gn,construct:Zn}=typeof Reflect!="undefined"&&Reflect;Ue||(Ue=function(e){return e}),tt||(tt=function(e){return e}),Gn||(Gn=function(e,t){for(var n=arguments.length,s=new Array(n>2?n-2:0),o=2;o<n;o++)s[o-2]=arguments[o];return e.apply(t,s)}),Zn||(Zn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return new e(...n)});const _n=qe(Array.prototype.forEach),qo=qe(Array.prototype.lastIndexOf),Ui=qe(Array.prototype.pop),Kt=qe(Array.prototype.push),Go=qe(Array.prototype.splice),bn=qe(String.prototype.toLowerCase),Yn=qe(String.prototype.toString),Xn=qe(String.prototype.match),$t=qe(String.prototype.replace),Zo=qe(String.prototype.indexOf),Yo=qe(String.prototype.trim),st=qe(Object.prototype.hasOwnProperty),We=qe(RegExp.prototype.test),en=Xo(TypeError);function qe(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return Gn(i,e,n)}}function Xo(i){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Zn(i,t)}}function V(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:bn;Bi&&Bi(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const o=t(s);o!==s&&(jo(e)||(e[n]=o),s=o)}i[s]=!0}return i}function Vo(i){for(let e=0;e<i.length;e++)st(i,e)||(i[e]=null);return i}function pt(i){const e=ji(null);for(const[t,n]of Hi(i))st(i,t)&&(Array.isArray(n)?e[t]=Vo(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=pt(n):e[t]=n);return e}function tn(i,e){for(;i!==null;){const n=Wo(i,e);if(n){if(n.get)return qe(n.get);if(typeof n.value=="function")return qe(n.value)}i=Uo(i)}function t(){return null}return t}const Wi=Ue(["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"]),Vn=Ue(["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","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qn=Ue(["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"]),Qo=Ue(["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"]),Jn=Ue(["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"]),Jo=Ue(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qi=Ue(["#text"]),Gi=Ue(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),Kn=Ue(["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","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","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","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-rendering","textlength","type","u1","u2","unicode","values","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"]),Zi=Ue(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),kn=Ue(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ko=tt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$o=tt(/<%[\w\W]*|[\w\W]*%>/gm),el=tt(/\$\{[\w\W]*/gm),tl=tt(/^data-[\-\w.\u00B7-\uFFFF]+$/),nl=tt(/^aria-[\-\w]+$/),Yi=tt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),il=tt(/^(?:\w+script|data):/i),sl=tt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xi=tt(/^html$/i),ol=tt(/^[a-z][.\w]*(-[.\w]+)+$/i);var Vi=Object.freeze({__proto__:null,ARIA_ATTR:nl,ATTR_WHITESPACE:sl,CUSTOM_ELEMENT:ol,DATA_ATTR:tl,DOCTYPE_NAME:Xi,ERB_EXPR:$o,IS_ALLOWED_URI:Yi,IS_SCRIPT_OR_DATA:il,MUSTACHE_EXPR:Ko,TMPLIT_EXPR:el});const nn={element:1,text:3,progressingInstruction:7,comment:8,document:9},ll=function(){return typeof window=="undefined"?null:window},rl=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(n=t.getAttribute(s));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML(l){return l},createScriptURL(l){return l}})}catch(l){return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Qi=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ji(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ll();const e=F=>Ji(F);if(e.version="3.2.7",e.removed=[],!i||!i.document||i.document.nodeType!==nn.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:r,Element:c,NodeFilter:f,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:m,trustedTypes:g}=i,p=c.prototype,_=tn(p,"cloneNode"),y=tn(p,"remove"),I=tn(p,"nextSibling"),T=tn(p,"childNodes"),v=tn(p,"parentNode");if(typeof l=="function"){const F=t.createElement("template");F.content&&F.content.ownerDocument&&(t=F.content.ownerDocument)}let k,x="";const{implementation:R,createNodeIterator:E,createDocumentFragment:L,getElementsByTagName:M}=t,{importNode:Q}=n;let H=Qi();e.isSupported=typeof Hi=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:Z,TMPLIT_EXPR:oe,DATA_ATTR:le,ARIA_ATTR:J,IS_SCRIPT_OR_DATA:ce,ATTR_WHITESPACE:Ye,CUSTOM_ELEMENT:re}=Vi;let{IS_ALLOWED_URI:me}=Vi,we=null;const nt=V({},[...Wi,...Vn,...Qn,...Jn,...qi]);let de=null;const Oe=V({},[...Gi,...Kn,...Zi,...kn]);let ee=Object.seal(ji(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}})),Me=null,Ae=null,Xe=!0,Le=!0,ct=!1,q=!0,X=!1,ve=!0,Ge=!1,he=!1,Pe=!1,Je=!1,ut=!1,gt=!1,mt=!0,It=!1;const Rt="user-content-";let Ke=!0,ot=!1,ft={},$e=null;const D=V({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let K=null;const _e=V({},["audio","video","img","source","image","track"]);let Ie=null;const He=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",Be="http://www.w3.org/2000/svg",ze="http://www.w3.org/1999/xhtml";let it=ze,wt=!1,sn=null;const ei=V({},[Ce,Be,ze],Yn);let Bt=V({},["mi","mo","mn","ms","mtext"]),jt=V({},["annotation-xml"]);const ti=V({},["title","style","font","a","script"]);let xt=null;const ni=["application/xhtml+xml","text/html"],ii="text/html";let Re=null,Tt=null;const si=t.createElement("form"),vn=function(h){return h instanceof RegExp||h instanceof Function},on=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Tt&&Tt===h)){if((!h||typeof h!="object")&&(h={}),h=pt(h),xt=ni.indexOf(h.PARSER_MEDIA_TYPE)===-1?ii:h.PARSER_MEDIA_TYPE,Re=xt==="application/xhtml+xml"?Yn:bn,we=st(h,"ALLOWED_TAGS")?V({},h.ALLOWED_TAGS,Re):nt,de=st(h,"ALLOWED_ATTR")?V({},h.ALLOWED_ATTR,Re):Oe,sn=st(h,"ALLOWED_NAMESPACES")?V({},h.ALLOWED_NAMESPACES,Yn):ei,Ie=st(h,"ADD_URI_SAFE_ATTR")?V(pt(He),h.ADD_URI_SAFE_ATTR,Re):He,K=st(h,"ADD_DATA_URI_TAGS")?V(pt(_e),h.ADD_DATA_URI_TAGS,Re):_e,$e=st(h,"FORBID_CONTENTS")?V({},h.FORBID_CONTENTS,Re):D,Me=st(h,"FORBID_TAGS")?V({},h.FORBID_TAGS,Re):pt({}),Ae=st(h,"FORBID_ATTR")?V({},h.FORBID_ATTR,Re):pt({}),ft=st(h,"USE_PROFILES")?h.USE_PROFILES:!1,Xe=h.ALLOW_ARIA_ATTR!==!1,Le=h.ALLOW_DATA_ATTR!==!1,ct=h.ALLOW_UNKNOWN_PROTOCOLS||!1,q=h.ALLOW_SELF_CLOSE_IN_ATTR!==!1,X=h.SAFE_FOR_TEMPLATES||!1,ve=h.SAFE_FOR_XML!==!1,Ge=h.WHOLE_DOCUMENT||!1,Je=h.RETURN_DOM||!1,ut=h.RETURN_DOM_FRAGMENT||!1,gt=h.RETURN_TRUSTED_TYPE||!1,Pe=h.FORCE_BODY||!1,mt=h.SANITIZE_DOM!==!1,It=h.SANITIZE_NAMED_PROPS||!1,Ke=h.KEEP_CONTENT!==!1,ot=h.IN_PLACE||!1,me=h.ALLOWED_URI_REGEXP||Yi,it=h.NAMESPACE||ze,Bt=h.MATHML_TEXT_INTEGRATION_POINTS||Bt,jt=h.HTML_INTEGRATION_POINTS||jt,ee=h.CUSTOM_ELEMENT_HANDLING||{},h.CUSTOM_ELEMENT_HANDLING&&vn(h.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=h.CUSTOM_ELEMENT_HANDLING.tagNameCheck),h.CUSTOM_ELEMENT_HANDLING&&vn(h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=h.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),h.CUSTOM_ELEMENT_HANDLING&&typeof h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=h.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(Le=!1),ut&&(Je=!0),ft&&(we=V({},qi),de=[],ft.html===!0&&(V(we,Wi),V(de,Gi)),ft.svg===!0&&(V(we,Vn),V(de,Kn),V(de,kn)),ft.svgFilters===!0&&(V(we,Qn),V(de,Kn),V(de,kn)),ft.mathMl===!0&&(V(we,Jn),V(de,Zi),V(de,kn))),h.ADD_TAGS&&(we===nt&&(we=pt(we)),V(we,h.ADD_TAGS,Re)),h.ADD_ATTR&&(de===Oe&&(de=pt(de)),V(de,h.ADD_ATTR,Re)),h.ADD_URI_SAFE_ATTR&&V(Ie,h.ADD_URI_SAFE_ATTR,Re),h.FORBID_CONTENTS&&($e===D&&($e=pt($e)),V($e,h.FORBID_CONTENTS,Re)),Ke&&(we["#text"]=!0),Ge&&V(we,["html","head","body"]),we.table&&(V(we,["tbody"]),delete Me.tbody),h.TRUSTED_TYPES_POLICY){if(typeof h.TRUSTED_TYPES_POLICY.createHTML!="function")throw en('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof h.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw en('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=h.TRUSTED_TYPES_POLICY,x=k.createHTML("")}else k===void 0&&(k=rl(g,s)),k!==null&&typeof x=="string"&&(x=k.createHTML(""));Ue&&Ue(h),Tt=h}},En=V({},[...Vn,...Qn,...Qo]),Sn=V({},[...Jn,...Jo]),oi=function(h){let S=v(h);(!S||!S.tagName)&&(S={namespaceURI:it,tagName:"template"});const P=bn(h.tagName),be=bn(S.tagName);return sn[h.namespaceURI]?h.namespaceURI===Be?S.namespaceURI===ze?P==="svg":S.namespaceURI===Ce?P==="svg"&&(be==="annotation-xml"||Bt[be]):!!En[P]:h.namespaceURI===Ce?S.namespaceURI===ze?P==="math":S.namespaceURI===Be?P==="math"&&jt[be]:!!Sn[P]:h.namespaceURI===ze?S.namespaceURI===Be&&!jt[be]||S.namespaceURI===Ce&&!Bt[be]?!1:!Sn[P]&&(ti[P]||!En[P]):!!(xt==="application/xhtml+xml"&&sn[h.namespaceURI]):!1},b=function(h){Kt(e.removed,{element:h});try{v(h).removeChild(h)}catch(S){y(h)}},O=function(h,S){try{Kt(e.removed,{attribute:S.getAttributeNode(h),from:S})}catch(P){Kt(e.removed,{attribute:null,from:S})}if(S.removeAttribute(h),h==="is")if(Je||ut)try{b(S)}catch(P){}else try{S.setAttribute(h,"")}catch(P){}},$=function(h){let S=null,P=null;if(Pe)h="<remove></remove>"+h;else{const xe=Xn(h,/^[\r\n\t ]+/);P=xe&&xe[0]}xt==="application/xhtml+xml"&&it===ze&&(h='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+h+"</body></html>");const be=k?k.createHTML(h):h;if(it===ze)try{S=new m().parseFromString(be,xt)}catch(xe){}if(!S||!S.documentElement){S=R.createDocument(it,"template",null);try{S.documentElement.innerHTML=wt?x:be}catch(xe){}}const je=S.body||S.documentElement;return h&&P&&je.insertBefore(t.createTextNode(P),je.childNodes[0]||null),it===ze?M.call(S,Ge?"html":"body")[0]:Ge?S.documentElement:je},ue=function(h){return E.call(h.ownerDocument||h,h,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},ye=function(h){return h instanceof d&&(typeof h.nodeName!="string"||typeof h.textContent!="string"||typeof h.removeChild!="function"||!(h.attributes instanceof u)||typeof h.removeAttribute!="function"||typeof h.setAttribute!="function"||typeof h.namespaceURI!="string"||typeof h.insertBefore!="function"||typeof h.hasChildNodes!="function")},pe=function(h){return typeof r=="function"&&h instanceof r};function te(F,h,S){_n(F,P=>{P.call(e,h,S,Tt)})}const Mt=function(h){let S=null;if(te(H.beforeSanitizeElements,h,null),ye(h))return b(h),!0;const P=Re(h.nodeName);if(te(H.uponSanitizeElement,h,{tagName:P,allowedTags:we}),ve&&h.hasChildNodes()&&!pe(h.firstElementChild)&&We(/<[/\w!]/g,h.innerHTML)&&We(/<[/\w!]/g,h.textContent)||h.nodeType===nn.progressingInstruction||ve&&h.nodeType===nn.comment&&We(/<[/\w]/g,h.data))return b(h),!0;if(!we[P]||Me[P]){if(!Me[P]&&Rs(P)&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,P)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(P)))return!1;if(Ke&&!$e[P]){const be=v(h)||h.parentNode,je=T(h)||h.childNodes;if(je&&be){const xe=je.length;for(let Ve=xe-1;Ve>=0;--Ve){const _t=_(je[Ve],!0);_t.__removalCount=(h.__removalCount||0)+1,be.insertBefore(_t,I(h))}}}return b(h),!0}return h instanceof c&&!oi(h)||(P==="noscript"||P==="noembed"||P==="noframes")&&We(/<\/no(script|embed|frames)/i,h.innerHTML)?(b(h),!0):(X&&h.nodeType===nn.text&&(S=h.textContent,_n([z,Z,oe],be=>{S=$t(S,be," ")}),h.textContent!==S&&(Kt(e.removed,{element:h.cloneNode()}),h.textContent=S)),te(H.afterSanitizeElements,h,null),!1)},ht=function(h,S,P){if(mt&&(S==="id"||S==="name")&&(P in t||P in si))return!1;if(!(Le&&!Ae[S]&&We(le,S))){if(!(Xe&&We(J,S))){if(!de[S]||Ae[S]){if(!(Rs(h)&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,h)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(h))&&(ee.attributeNameCheck instanceof RegExp&&We(ee.attributeNameCheck,S)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(S,h))||S==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&We(ee.tagNameCheck,P)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(P))))return!1}else if(!Ie[S]){if(!We(me,$t(P,Ye,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&h!=="script"&&Zo(P,"data:")===0&&K[h])){if(!(ct&&!We(ce,$t(P,Ye,"")))){if(P)return!1}}}}}}return!0},Rs=function(h){return h!=="annotation-xml"&&Xn(h,re)},xs=function(h){te(H.beforeSanitizeAttributes,h,null);const{attributes:S}=h;if(!S||ye(h))return;const P={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:de,forceKeepAttr:void 0};let be=S.length;for(;be--;){const je=S[be],{name:xe,namespaceURI:Ve,value:_t}=je,Ut=Re(xe),li=_t;let Fe=xe==="value"?li:Yo(li);if(P.attrName=Ut,P.attrValue=Fe,P.keepAttr=!0,P.forceKeepAttr=void 0,te(H.uponSanitizeAttribute,h,P),Fe=P.attrValue,It&&(Ut==="id"||Ut==="name")&&(O(xe,h),Fe=Rt+Fe),ve&&We(/((--!?|])>)|<\/(style|title|textarea)/i,Fe)){O(xe,h);continue}if(Ut==="attributename"&&Xn(Fe,"href")){O(xe,h);continue}if(P.forceKeepAttr)continue;if(!P.keepAttr){O(xe,h);continue}if(!q&&We(/\/>/i,Fe)){O(xe,h);continue}X&&_n([z,Z,oe],Ls=>{Fe=$t(Fe,Ls," ")});const Ms=Re(h.nodeName);if(!ht(Ms,Ut,Fe)){O(xe,h);continue}if(k&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Ve)switch(g.getAttributeType(Ms,Ut)){case"TrustedHTML":{Fe=k.createHTML(Fe);break}case"TrustedScriptURL":{Fe=k.createScriptURL(Fe);break}}if(Fe!==li)try{Ve?h.setAttributeNS(Ve,xe,Fe):h.setAttribute(xe,Fe),ye(h)?b(h):Ui(e.removed)}catch(Ls){O(xe,h)}}te(H.afterSanitizeAttributes,h,null)},Hl=function F(h){let S=null;const P=ue(h);for(te(H.beforeSanitizeShadowDOM,h,null);S=P.nextNode();)te(H.uponSanitizeShadowNode,S,null),Mt(S),xs(S),S.content instanceof o&&F(S.content);te(H.afterSanitizeShadowDOM,h,null)};return e.sanitize=function(F){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,P=null,be=null,je=null;if(wt=!F,wt&&(F="<!-->"),typeof F!="string"&&!pe(F))if(typeof F.toString=="function"){if(F=F.toString(),typeof F!="string")throw en("dirty is not a string, aborting")}else throw en("toString is not a function");if(!e.isSupported)return F;if(he||on(h),e.removed=[],typeof F=="string"&&(ot=!1),ot){if(F.nodeName){const _t=Re(F.nodeName);if(!we[_t]||Me[_t])throw en("root node is forbidden and cannot be sanitized in-place")}}else if(F instanceof r)S=$("<!---->"),P=S.ownerDocument.importNode(F,!0),P.nodeType===nn.element&&P.nodeName==="BODY"||P.nodeName==="HTML"?S=P:S.appendChild(P);else{if(!Je&&!X&&!Ge&&F.indexOf("<")===-1)return k&>?k.createHTML(F):F;if(S=$(F),!S)return Je?null:gt?x:""}S&&Pe&&b(S.firstChild);const xe=ue(ot?F:S);for(;be=xe.nextNode();)Mt(be),xs(be),be.content instanceof o&&Hl(be.content);if(ot)return F;if(Je){if(ut)for(je=L.call(S.ownerDocument);S.firstChild;)je.appendChild(S.firstChild);else je=S;return(de.shadowroot||de.shadowrootmode)&&(je=Q.call(n,je,!0)),je}let Ve=Ge?S.outerHTML:S.innerHTML;return Ge&&we["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&We(Xi,S.ownerDocument.doctype.name)&&(Ve="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
|
|
47
|
-
`+Ve),X&&_n([z,Z,oe],_t=>{Ve=$t(Ve,_t," ")}),k&>?k.createHTML(Ve):Ve},e.setConfig=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};on(F),he=!0},e.clearConfig=function(){Tt=null,he=!1},e.isValidAttribute=function(F,h,S){Tt||on({});const P=Re(F),be=Re(h);return ht(P,be,S)},e.addHook=function(F,h){typeof h=="function"&&Kt(H[F],h)},e.removeHook=function(F,h){if(h!==void 0){const S=qo(H[F],h);return S===-1?void 0:Go(H[F],S,1)[0]}return Ui(H[F])},e.removeHooks=function(F){H[F]=[]},e.removeAllHooks=function(){H=Qi()},e}var Ki=Ji();function $i(i){var n;if(typeof document=="undefined")return null;const t=`; ${document.cookie}`.split(`; ${i}=`);return t.length===2&&((n=t.pop())==null?void 0:n.split(";").shift())||null}const Se=()=>{if(typeof window=="undefined")return null;const i=$i("access_token");if(i)return i;const e=$i("auth_token");if(e)return e;const t=sessionStorage.getItem("vuex");if(t)try{const n=JSON.parse(t);if(n!=null&&n.token)return n.token}catch(n){console.error("Failed to parse vuex data:",n)}return null};function es(i,e,t){const n=i.slice();return n[25]=e[t],n}function ts(i){let e,t=i[9].text+"",n;return{c(){e=A("div"),n=De(t),a(e,"class","sy-assistant-button-tooltip svelte-1g6fj9a"),N(e,"left",i[9].x+"px"),N(e,"top",i[9].y+"px"),N(e,"z-index",i[3]+3)},m(s,o){j(s,e,o),w(e,n)},p(s,o){o&512&&t!==(t=s[9].text+"")&&Ze(n,t),o&512&&N(e,"left",s[9].x+"px"),o&512&&N(e,"top",s[9].y+"px"),o&8&&N(e,"z-index",s[3]+3)},d(s){s&&B(e)}}}function al(i){let e=[],t=new Map,n,s,o=yt(i[0]);const l=c=>c[25].sessionId;for(let c=0;c<o.length;c+=1){let f=es(i,o,c),u=l(f);t.set(u,e[c]=ns(u,f))}let r=i[5]&&is();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=G(),r&&r.c(),s=zt()},m(c,f){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(c,f);j(c,n,f),r&&r.m(c,f),j(c,s,f)},p(c,f){f&8261&&(o=yt(c[0]),e=ki(e,f,l,1,c,o,t,n.parentNode,bi,ns,n,es)),c[5]?r||(r=is(),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(c){c&&(B(n),B(s));for(let f=0;f<e.length;f+=1)e[f].d(c);r&&r.d(c)}}}function cl(i){let e,t=i[4]?"未找到相关会话":i[5]?"加载中...":"暂无历史会话",n;return{c(){e=A("div"),n=De(t),a(e,"class","sy-session-empty svelte-1g6fj9a")},m(s,o){j(s,e,o),w(e,n)},p(s,o){o&48&&t!==(t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话")&&Ze(n,t)},d(s){s&&B(e)}}}function ns(i,e){let t,n,s,o,l=e[25].title+"",r,c,f,u=os(e[25].timestamp)+"",d,m,g,p,_,y,I,T,v,k,x;function R(){return e[18](e[25])}function E(...L){return e[19](e[25],...L)}return{key:i,first:null,c(){t=A("div"),n=A("button"),s=A("div"),o=A("div"),r=De(l),c=G(),f=A("div"),d=De(u),m=G(),g=A("button"),p=Y("svg"),_=Y("path"),y=Y("path"),I=Y("path"),a(o,"class","sy-session-title svelte-1g6fj9a"),a(f,"class","sy-session-time svelte-1g6fj9a"),a(s,"class","sy-session-info svelte-1g6fj9a"),a(n,"class","sy-session-select svelte-1g6fj9a"),a(_,"d","M3 6h18"),a(y,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),a(I,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),a(p,"xmlns","http://www.w3.org/2000/svg"),a(p,"width","16"),a(p,"height","16"),a(p,"viewBox","0 0 24 24"),a(p,"fill","none"),a(p,"stroke","currentColor"),a(p,"stroke-width","2"),a(p,"stroke-linecap","round"),a(p,"stroke-linejoin","round"),a(g,"class","sy-session-delete svelte-1g6fj9a"),g.disabled=T=e[6]===e[25].sessionId,a(g,"aria-label","删除会话"),a(t,"class","sy-session-item svelte-1g6fj9a"),a(t,"data-session-id",v=e[25].sessionId),C(t,"deleting",e[25].deleting),this.first=t},m(L,M){j(L,t,M),w(t,n),w(n,s),w(s,o),w(o,r),w(s,c),w(s,f),w(f,d),w(t,m),w(t,g),w(g,p),w(p,_),w(p,y),w(p,I),k||(x=[U(n,"click",R),U(g,"click",E)],k=!0)},p(L,M){e=L,M&1&&l!==(l=e[25].title+"")&&Ze(r,l),M&1&&u!==(u=os(e[25].timestamp)+"")&&Ze(d,u),M&65&&T!==(T=e[6]===e[25].sessionId)&&(g.disabled=T),M&1&&v!==(v=e[25].sessionId)&&a(t,"data-session-id",v),M&1&&C(t,"deleting",e[25].deleting)},d(L){L&&B(t),k=!1,Te(x)}}}function is(i){let e;return{c(){e=A("div"),e.innerHTML='<span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span>',a(e,"class","sy-session-loading svelte-1g6fj9a")},m(t,n){j(t,e,n)},d(t){t&&B(e)}}}function ss(i){let e,t,n,s,o,l,r,c,f;return{c(){e=A("div"),t=A("div"),t.textContent="确认删除此会话?",n=G(),s=A("div"),o=A("button"),o.textContent="取消",l=G(),r=A("button"),r.textContent="删除",a(t,"class","sy-session-confirm-content svelte-1g6fj9a"),a(o,"class","sy-session-confirm-cancel svelte-1g6fj9a"),a(r,"class","sy-session-confirm-delete svelte-1g6fj9a"),a(s,"class","sy-session-confirm-actions svelte-1g6fj9a"),a(e,"class","sy-session-confirm-popup svelte-1g6fj9a"),N(e,"left",i[8].x+"px"),N(e,"top",i[8].y+"px"),N(e,"z-index",i[3]+3)},m(u,d){j(u,e,d),w(e,t),w(e,n),w(e,s),w(s,o),w(s,l),w(s,r),c||(f=[U(o,"click",i[20]),U(r,"click",i[14])],c=!0)},p(u,d){d&256&&N(e,"left",u[8].x+"px"),d&256&&N(e,"top",u[8].y+"px"),d&8&&N(e,"z-index",u[3]+3)},d(u){u&&B(e),c=!1,Te(f)}}}function ul(i){let e,t,n,s,o,l,r,c,f,u,d,m,g,p,_,y,I,T,v,k=i[9]&&ts(i);function x(M,Q){return M[0].length===0?cl:al}let R=x(i),E=R(i),L=i[7]&&ss(i);return{c(){e=A("div"),t=A("div"),n=A("h2"),n.textContent="历史会话",s=G(),o=A("button"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',l=G(),r=A("div"),c=A("input"),f=G(),u=Y("svg"),d=Y("circle"),m=Y("line"),g=G(),k&&k.c(),p=G(),_=A("div"),E.c(),y=G(),L&&L.c(),I=zt(),a(n,"class","svelte-1g6fj9a"),a(o,"class","sy-session-close svelte-1g6fj9a"),a(o,"aria-label","关闭历史会话"),a(t,"class","sy-session-header svelte-1g6fj9a"),a(c,"type","text"),a(c,"class","sy-session-search-input svelte-1g6fj9a"),a(c,"placeholder","搜索历史会话..."),a(d,"cx","11"),a(d,"cy","11"),a(d,"r","8"),a(m,"x1","21"),a(m,"y1","21"),a(m,"x2","16.65"),a(m,"y2","16.65"),a(u,"class","sy-session-search-icon svelte-1g6fj9a"),a(u,"xmlns","http://www.w3.org/2000/svg"),a(u,"width","16"),a(u,"height","16"),a(u,"viewBox","0 0 24 24"),a(u,"fill","none"),a(u,"stroke","currentColor"),a(u,"stroke-width","2"),a(u,"stroke-linecap","round"),a(u,"stroke-linejoin","round"),a(r,"class","sy-session-search svelte-1g6fj9a"),a(_,"class","sy-session-list svelte-1g6fj9a"),a(e,"class","sy-session-history svelte-1g6fj9a"),N(e,"z-index",i[3]+2)},m(M,Q){j(M,e,Q),w(e,t),w(t,n),w(t,s),w(t,o),w(e,l),w(e,r),w(r,c),kt(c,i[4]),w(r,f),w(r,u),w(u,d),w(u,m),w(e,g),k&&k.m(e,null),w(e,p),w(e,_),E.m(_,null),j(M,y,Q),L&&L.m(M,Q),j(M,I,Q),T||(v=[U(o,"click",function(){Wt(i[1])&&i[1].apply(this,arguments)}),U(o,"mouseenter",i[16]),U(o,"mouseleave",i[12]),U(c,"input",i[17]),U(_,"scroll",i[10])],T=!0)},p(M,[Q]){i=M,Q&16&&c.value!==i[4]&&kt(c,i[4]),i[9]?k?k.p(i,Q):(k=ts(i),k.c(),k.m(e,p)):k&&(k.d(1),k=null),R===(R=x(i))&&E?E.p(i,Q):(E.d(1),E=R(i),E&&(E.c(),E.m(_,null))),Q&8&&N(e,"z-index",i[3]+2),i[7]?L?L.p(i,Q):(L=ss(i),L.c(),L.m(I.parentNode,I)):L&&(L.d(1),L=null)},i:W,o:W,d(M){M&&(B(e),B(y),B(I)),k&&k.d(),E.d(),L&&L.d(M),T=!1,Te(v)}}}const $n=10;function os(i){return new Date(i).toLocaleString()}function fl(i,e,t){let{sessions:n=[]}=e,{onClose:s}=e,{onSelect:o}=e,{zIndex:l}=e,{apiPrefix:r}=e,c=!1,f=!0,u=0,d="",m=null,g=null,p={x:0,y:0};function _(){return Ne(this,null,function*(){if(!(c||!f)){t(5,c=!0);try{const z=yield fetch(`${r}/chat/record/session/list/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({start:u,length:$n,keyword:d})});if(!z.ok)throw new Error("Failed to load sessions");const Z=yield z.json();if(Z.code===0){const oe=Z.data.sessionList.map(le=>({sessionId:le.sessionId,title:le.name,timestamp:new Date(le.createDate).getTime()}));t(0,n=[...n,...oe]),u+=$n,f=oe.length===$n}}catch(z){console.error("Failed to load sessions:",z)}finally{t(5,c=!1)}}})}function y(z){const Z=z.target,{scrollTop:oe,scrollHeight:le,clientHeight:J}=Z;le-oe-J<50&&_()}In(()=>{_()});let I=null;function T(z,Z){const le=z.currentTarget.getBoundingClientRect();t(9,I={text:Z,x:le.left+le.width/2,y:le.bottom+8})}function v(){t(9,I=null)}function k(z,Z){const le=z.currentTarget.getBoundingClientRect();t(8,p={x:le.left-16,y:le.top+le.height/2}),t(7,g=Z)}function x(z){return Ne(this,null,function*(){if(z&&!m)try{t(6,m=z),t(7,g=null);const Z=document.querySelector(`[data-session-id="${z}"]`);Z&&Z.classList.add("deleting"),yield new Promise(J=>setTimeout(J,300));const oe=yield fetch(`${r}/chat/record/session/delete`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({sessionId:z})});if(!oe.ok)throw new Error("Delete request failed");const le=yield oe.json();if(le.code===0&&le.data.respCode===0)t(0,n=n.map(J=>Ee(ne({},J),{deleting:J.sessionId===z}))),setTimeout(()=>{t(0,n=n.filter(J=>!J.deleting))},300);else throw new Error("Delete failed: "+le.message)}catch(Z){console.error("Failed to delete session:",Z);const oe=document.querySelector(`[data-session-id="${z}"]`);oe&&oe.classList.remove("deleting")}finally{t(6,m=null)}})}function R(){g&&x(g)}const E=z=>T(z,"关闭历史会话");function L(){d=this.value,t(4,d)}const M=z=>o(z.sessionId),Q=(z,Z)=>k(Z,z.sessionId),H=()=>t(7,g=null);return i.$$set=z=>{"sessions"in z&&t(0,n=z.sessions),"onClose"in z&&t(1,s=z.onClose),"onSelect"in z&&t(2,o=z.onSelect),"zIndex"in z&&t(3,l=z.zIndex),"apiPrefix"in z&&t(15,r=z.apiPrefix)},i.$$.update=()=>{i.$$.dirty&16&&d!==void 0&&(t(0,n=[]),u=0,f=!0,_())},[n,s,o,l,d,c,m,g,p,I,y,T,v,k,R,r,E,L,M,Q,H]}class ls extends Dn{constructor(e){super(),zn(this,e,fl,ul,Lt,{sessions:0,onClose:1,onSelect:2,zIndex:3,apiPrefix:15})}}function rs(i,e,t){const n=i.slice();return n[87]=e[t],n}function as(i,e,t){const n=i.slice();return n[90]=e[t],n[91]=e,n[92]=t,n}function cs(i,e,t){const n=i.slice();return n[93]=e[t],n[95]=t,n}function hl(i){let e,t=[],n=new Map,s=yt(i[13]);const o=l=>l[90].id;for(let l=0;l<s.length;l+=1){let r=as(i,s,l),c=o(r);n.set(c,t[l]=ms(c,r))}return{c(){e=A("div");for(let l=0;l<t.length;l+=1)t[l].c();a(e,"class","sy-assistant-message-list svelte-1r23oau")},m(l,r){j(l,e,r);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);i[66](e)},p(l,r){r[0]&260301225|r[1]&16353&&(s=yt(l[13]),t=ki(t,r,o,1,l,s,n,e,bi,ms,null,as))},i:W,o:W,d(l){l&&B(e);for(let r=0;r<t.length;r+=1)t[r].d();i[66](null)}}}function dl(i){let e,t;return e=new ls({props:{sessions:i[45],onClose:i[47],onSelect:i[48],zIndex:i[0],apiPrefix:i[2]}}),{c(){Cn(e.$$.fragment)},m(n,s){un(e,n,s),t=!0},p(n,s){const o={};s[0]&1&&(o.zIndex=n[0]),s[0]&4&&(o.apiPrefix=n[2]),e.$set(o)},i(n){t||(et(e.$$.fragment,n),t=!0)},o(n){dt(e.$$.fragment,n),t=!1},d(n){fn(e,n)}}}function pl(i){let e,t=Ht(i[8],'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',"100%","100%")+"";return{c(){e=A("div"),a(e,"class","sy-assistant-avatar user svelte-1r23oau"),C(e,"screen-theme",i[3]==="screen")},m(n,s){j(n,e,s),e.innerHTML=t},p(n,s){s[0]&256&&t!==(t=Ht(n[8],'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',"100%","100%")+"")&&(e.innerHTML=t),s[0]&8&&C(e,"screen-theme",n[3]==="screen")},d(n){n&&B(e)}}}function gl(i){let e,t=Ht(i[7],'<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="currentColor"><path d="M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z" fill="#6F8698"></path><path d="M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z" fill="#3677FF"></path><path d="M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z" fill="#D0D5F1"></path><path d="M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z" fill="#3677FF"></path><path d="M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z" fill="#8896A4"></path></svg>',"100%","100%")+"";return{c(){e=A("div"),a(e,"class","sy-assistant-avatar assistant svelte-1r23oau"),C(e,"screen-theme",i[3]==="screen")},m(n,s){j(n,e,s),e.innerHTML=t},p(n,s){s[0]&128&&t!==(t=Ht(n[7],'<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="currentColor"><path d="M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z" fill="#6F8698"></path><path d="M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z" fill="#3677FF"></path><path d="M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z" fill="#D0D5F1"></path><path d="M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z" fill="#3677FF"></path><path d="M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z" fill="#8896A4"></path></svg>',"100%","100%")+"")&&(e.innerHTML=t),s[0]&8&&C(e,"screen-theme",n[3]==="screen")},d(n){n&&B(e)}}}function ml(i){let e,t=i[31](i[90].content)+"";return{c(){e=A("div"),a(e,"class","markdown-content svelte-1r23oau")},m(n,s){j(n,e,s),e.innerHTML=t},p(n,s){s[0]&8192&&t!==(t=n[31](n[90].content)+"")&&(e.innerHTML=t)},d(n){n&&B(e)}}}function wl(i){let e;return{c(){e=A("span"),e.innerHTML='<span class="dot svelte-1r23oau">.</span> <span class="dot svelte-1r23oau">.</span> <span class="dot svelte-1r23oau">.</span>',a(e,"class","sy-assistant-loading svelte-1r23oau")},m(t,n){j(t,e,n)},p:W,d(t){t&&B(e)}}}function us(i){let e,t=yt(i[90].attachments),n=[];for(let s=0;s<t.length;s+=1)n[s]=ds(cs(i,t,s));return{c(){e=A("div");for(let s=0;s<n.length;s+=1)n[s].c();a(e,"class","sy-assistant-attachments svelte-1r23oau")},m(s,o){j(s,e,o);for(let l=0;l<n.length;l+=1)n[l]&&n[l].m(e,null)},p(s,o){if(o[0]&122881|o[1]&224){t=yt(s[90].attachments);let l;for(l=0;l<t.length;l+=1){const r=cs(s,t,l);n[l]?n[l].p(r,o):(n[l]=ds(r),n[l].c(),n[l].m(e,null))}for(;l<n.length;l+=1)n[l].d(1);n.length=t.length}},d(s){s&&B(e),di(n,s)}}}function fs(i){let e,t,n;function s(...o){return i[53](i[93],...o)}return{c(){e=A("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1r23oau"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',a(e,"class","sy-assistant-attachment-toggle svelte-1r23oau"),a(e,"aria-label","查看详情")},m(o,l){j(o,e,l),t||(n=[U(e,"mouseenter",s),U(e,"mouseleave",i[37])],t=!0)},p(o,l){i=o},d(o){o&&B(e),t=!1,Te(n)}}}function hs(i){let e,t=i[14].replace(/\n/g,"<br>")+"",n,s;return{c(){e=A("div"),a(e,"class","sy-assistant-tooltip svelte-1r23oau"),a(e,"role","tooltip"),N(e,"left",i[15].x+"px"),N(e,"top",i[15].y+"px"),N(e,"z-index",i[0]+3),C(e,"align-right",i[15].alignRight)},m(o,l){j(o,e,l),e.innerHTML=t,n||(s=[U(e,"mouseenter",i[55]),U(e,"mouseleave",i[56])],n=!0)},p(o,l){l[0]&16384&&t!==(t=o[14].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),l[0]&32768&&N(e,"left",o[15].x+"px"),l[0]&32768&&N(e,"top",o[15].y+"px"),l[0]&1&&N(e,"z-index",o[0]+3),l[0]&32768&&C(e,"align-right",o[15].alignRight)},d(o){o&&B(e),n=!1,Te(s)}}}function ds(i){let e,t,n,s,o,l,r,c,f,u=Tn(i[93].content_title).name+"",d,m,g,p=Tn(i[93].content_title).ext+"",_,y,I,T,v,k,x,R,E,L,M=i[93].tips&&fs(i);function Q(){return i[54](i[93])}let H=i[14]&&hs(i);return{c(){e=A("div"),t=A("div"),n=A("div"),s=Y("svg"),o=Y("path"),l=Y("polyline"),r=G(),c=A("div"),f=A("span"),d=De(u),m=G(),g=A("span"),_=De(p),I=G(),T=A("div"),M&&M.c(),v=G(),k=A("button"),k.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1r23oau"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>',x=G(),H&&H.c(),R=G(),a(o,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),a(l,"points","13 2 13 9 20 9"),a(s,"xmlns","http://www.w3.org/2000/svg"),a(s,"width","16"),a(s,"height","16"),a(s,"viewBox","0 0 24 24"),a(s,"fill","none"),a(s,"stroke","currentColor"),a(s,"stroke-width","2"),a(s,"stroke-linecap","round"),a(s,"stroke-linejoin","round"),a(f,"class","sy-assistant-filename svelte-1r23oau"),a(g,"class","sy-assistant-attachment-ext svelte-1r23oau"),a(c,"class","sy-assistant-attachment-name svelte-1r23oau"),a(c,"title",y=i[93].content_title),a(n,"class","sy-assistant-attachment-title svelte-1r23oau"),a(k,"class","sy-assistant-attachment-toggle svelte-1r23oau"),a(k,"aria-label","下载文件"),a(T,"class","sy-assistant-attachment-actions svelte-1r23oau"),a(t,"class","sy-assistant-attachment-header svelte-1r23oau"),a(e,"class","sy-assistant-attachment svelte-1r23oau")},m(z,Z){j(z,e,Z),w(e,t),w(t,n),w(n,s),w(s,o),w(s,l),w(n,r),w(n,c),w(c,f),w(f,d),w(c,m),w(c,g),w(g,_),w(t,I),w(t,T),M&&M.m(T,null),w(T,v),w(T,k),w(e,x),H&&H.m(e,null),w(e,R),E||(L=U(k,"click",Q),E=!0)},p(z,Z){i=z,Z[0]&8192&&u!==(u=Tn(i[93].content_title).name+"")&&Ze(d,u),Z[0]&8192&&p!==(p=Tn(i[93].content_title).ext+"")&&Ze(_,p),Z[0]&8192&&y!==(y=i[93].content_title)&&a(c,"title",y),i[93].tips?M?M.p(i,Z):(M=fs(i),M.c(),M.m(T,v)):M&&(M.d(1),M=null),i[14]?H?H.p(i,Z):(H=hs(i),H.c(),H.m(e,R)):H&&(H.d(1),H=null)},d(z){z&&B(e),M&&M.d(),H&&H.d(),E=!1,L()}}}function ps(i){let e,t,n,s,o,l,r,c,f,u,d;function m(R,E){return R[23][R[90].id]?bl:_l}let g=m(i),p=g(i);function _(){return i[57](i[90])}function y(...R){return i[58](i[90],...R)}function I(){return i[59](i[90])}function T(...R){return i[60](i[90],...R)}function v(...R){return i[61](i[90],...R)}function k(...R){return i[62](i[90],...R)}let x=i[26]&&i[24][i[90].id]==="dislike"&&gs(i);return{c(){e=A("div"),t=A("button"),p.c(),s=G(),o=A("button"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>',l=G(),r=A("button"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-3"></path></svg>',c=G(),x&&x.c(),f=zt(),a(t,"class","sy-assistant-action-button svelte-1r23oau"),a(t,"aria-label",n=i[23][i[90].id]?"已复制":"复制内容"),C(t,"copied",i[23][i[90].id]),a(o,"class","sy-assistant-action-button svelte-1r23oau"),a(o,"aria-label","点赞"),C(o,"active",i[24][i[90].id]==="like"),a(r,"class","sy-assistant-action-button svelte-1r23oau"),a(r,"aria-label","点踩"),C(r,"active",i[24][i[90].id]==="dislike"),a(e,"class","sy-assistant-message-actions svelte-1r23oau")},m(R,E){j(R,e,E),w(e,t),p.m(t,null),w(e,s),w(e,o),w(e,l),w(e,r),j(R,c,E),x&&x.m(R,E),j(R,f,E),u||(d=[U(t,"click",_),U(t,"mouseenter",y),U(t,"mouseleave",i[44]),U(o,"click",I),U(o,"mouseenter",T),U(o,"mouseleave",i[44]),U(r,"click",v),U(r,"mouseenter",k),U(r,"mouseleave",i[44])],u=!0)},p(R,E){i=R,g!==(g=m(i))&&(p.d(1),p=g(i),p&&(p.c(),p.m(t,null))),E[0]&8396800&&n!==(n=i[23][i[90].id]?"已复制":"复制内容")&&a(t,"aria-label",n),E[0]&8396800&&C(t,"copied",i[23][i[90].id]),E[0]&16785408&&C(o,"active",i[24][i[90].id]==="like"),E[0]&16785408&&C(r,"active",i[24][i[90].id]==="dislike"),i[26]&&i[24][i[90].id]==="dislike"?x?x.p(i,E):(x=gs(i),x.c(),x.m(f.parentNode,f)):x&&(x.d(1),x=null)},d(R){R&&(B(e),B(c),B(f)),p.d(),x&&x.d(R),u=!1,Te(d)}}}function _l(i){let e,t,n;return{c(){e=Y("svg"),t=Y("rect"),n=Y("path"),a(t,"x","9"),a(t,"y","9"),a(t,"width","13"),a(t,"height","13"),a(t,"rx","2"),a(t,"ry","2"),a(n,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(s,o){j(s,e,o),w(e,t),w(e,n)},d(s){s&&B(e)}}}function bl(i){let e,t;return{c(){e=Y("svg"),t=Y("polyline"),a(t,"points","20 6 9 17 4 12"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(n,s){j(n,e,s),w(e,t)},d(n){n&&B(e)}}}function gs(i){let e,t,n,s,o,l,r,c,f,u,d;function m(){i[63].call(s,i[90])}function g(){return i[64](i[90])}function p(){return i[65](i[90])}return{c(){e=A("div"),t=A("div"),t.textContent="反馈意见",n=G(),s=A("textarea"),o=G(),l=A("div"),r=A("button"),r.textContent="取消",c=G(),f=A("button"),f.textContent="提交",a(t,"class","sy-assistant-dislike-title svelte-1r23oau"),a(s,"class","sy-assistant-dislike-input svelte-1r23oau"),a(s,"placeholder","请输入您的反馈意见..."),a(r,"class","sy-assistant-popup-cancel svelte-1r23oau"),a(f,"class","sy-assistant-popup-submit svelte-1r23oau"),a(l,"class","sy-assistant-popup-actions svelte-1r23oau"),a(e,"class","sy-assistant-dislike-popup svelte-1r23oau"),N(e,"left",i[27].x+"px"),N(e,"top",i[27].y+"px"),N(e,"z-index",i[0]+3)},m(_,y){j(_,e,y),w(e,t),w(e,n),w(e,s),kt(s,i[25][i[90].id]),w(e,o),w(e,l),w(l,r),w(l,c),w(l,f),u||(d=[U(s,"input",m),U(r,"click",g),U(f,"click",p)],u=!0)},p(_,y){i=_,y[0]&33562624&&kt(s,i[25][i[90].id]),y[0]&134217728&&N(e,"left",i[27].x+"px"),y[0]&134217728&&N(e,"top",i[27].y+"px"),y[0]&1&&N(e,"z-index",i[0]+3)},d(_){_&&B(e),u=!1,Te(d)}}}function ms(i,e){let t,n,s,o,l,r,c,f,u=new Date(e[90].timestamp).toLocaleString()+"",d,m;function g(x,R){return x[90].type==="assistant"?gl:pl}let p=g(e),_=p(e);function y(x,R){return x[17]&&x[90].id===x[13][x[13].length-1].id&&x[90].type==="assistant"&&!x[90].content?wl:ml}let I=y(e),T=I(e),v=e[90].attachments&&us(e),k=e[90].id!=="-1"&&e[90].type==="assistant"&&!e[17]&&e[5]&&ps(e);return{key:i,first:null,c(){t=A("div"),_.c(),n=G(),s=A("div"),o=A("div"),T.c(),l=G(),v&&v.c(),r=G(),k&&k.c(),c=G(),f=A("div"),d=De(u),m=G(),a(o,"class","sy-assistant-message-content svelte-1r23oau"),C(o,"screen-theme",e[3]==="screen"),a(f,"class","sy-assistant-message-time svelte-1r23oau"),a(s,"class","sy-assistant-message-bubble svelte-1r23oau"),C(s,"screen-theme",e[3]==="screen"),a(t,"class","sy-assistant-message svelte-1r23oau"),C(t,"user",e[90].type==="user"),C(t,"screen-theme",e[3]==="screen"),this.first=t},m(x,R){j(x,t,R),_.m(t,null),w(t,n),w(t,s),w(s,o),T.m(o,null),w(o,l),v&&v.m(o,null),w(o,r),k&&k.m(o,null),w(s,c),w(s,f),w(f,d),w(t,m)},p(x,R){e=x,p===(p=g(e))&&_?_.p(e,R):(_.d(1),_=p(e),_&&(_.c(),_.m(t,n))),I===(I=y(e))&&T?T.p(e,R):(T.d(1),T=I(e),T&&(T.c(),T.m(o,l))),e[90].attachments?v?v.p(e,R):(v=us(e),v.c(),v.m(o,r)):v&&(v.d(1),v=null),e[90].id!=="-1"&&e[90].type==="assistant"&&!e[17]&&e[5]?k?k.p(e,R):(k=ps(e),k.c(),k.m(o,null)):k&&(k.d(1),k=null),R[0]&8&&C(o,"screen-theme",e[3]==="screen"),R[0]&8192&&u!==(u=new Date(e[90].timestamp).toLocaleString()+"")&&Ze(d,u),R[0]&8&&C(s,"screen-theme",e[3]==="screen"),R[0]&8192&&C(t,"user",e[90].type==="user"),R[0]&8&&C(t,"screen-theme",e[3]==="screen")},d(x){x&&B(t),_.d(),T.d(),v&&v.d(),k&&k.d()}}}function ws(i){let e,t,n,s,o,l,r,c,f,u,d,m,g,p=Ht(i[6],'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>')+"",_,y,I,T=i[5]&&_s(i);return{c(){T&&T.c(),e=G(),t=A("div"),n=A("div"),s=A("div"),o=A("textarea"),l=G(),r=A("div"),c=A("div"),f=De(i[12]),u=De("/"),d=De(i[11]),m=G(),g=A("button"),a(o,"class","sy-assistant-textarea svelte-1r23oau"),a(o,"placeholder","输入您的问题..."),a(o,"maxlength",i[11]),a(o,"rows","3"),C(o,"screen-theme",i[3]==="screen"),C(o,"auto-expand",i[9]&&i[19]),a(s,"class","sy-assistant-textarea-container svelte-1r23oau"),a(c,"class","sy-assistant-char-count svelte-1r23oau"),C(c,"over-limit",i[30]),a(g,"class","sy-assistant-send-button svelte-1r23oau"),g.disabled=_=!i[10].trim()||i[30],a(g,"aria-label","发送消息"),a(r,"class","sy-assistant-operation-area svelte-1r23oau"),a(n,"class","sy-assistant-input-container svelte-1r23oau"),C(n,"screen-theme",i[3]==="screen"),a(t,"class","sy-assistant-input-area svelte-1r23oau"),C(t,"screen-theme",i[3]==="screen")},m(v,k){T&&T.m(v,k),j(v,e,k),j(v,t,k),w(t,n),w(n,s),w(s,o),i[70](o),kt(o,i[10]),w(n,l),w(n,r),w(r,c),w(c,f),w(c,u),w(c,d),w(r,m),w(r,g),g.innerHTML=p,y||(I=[U(o,"input",i[71]),U(o,"keydown",i[72]),U(o,"focus",i[32]),U(o,"blur",i[33]),U(o,"input",i[34]),U(g,"click",i[35]),U(g,"mouseenter",i[73]),U(g,"mouseleave",i[44])],y=!0)},p(v,k){v[5]?T?T.p(v,k):(T=_s(v),T.c(),T.m(e.parentNode,e)):T&&(T.d(1),T=null),k[0]&2048&&a(o,"maxlength",v[11]),k[0]&1024&&kt(o,v[10]),k[0]&8&&C(o,"screen-theme",v[3]==="screen"),k[0]&524800&&C(o,"auto-expand",v[9]&&v[19]),k[0]&4096&&Ze(f,v[12]),k[0]&2048&&Ze(d,v[11]),k[0]&1073741824&&C(c,"over-limit",v[30]),k[0]&64&&p!==(p=Ht(v[6],'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>')+"")&&(g.innerHTML=p),k[0]&1073742848&&_!==(_=!v[10].trim()||v[30])&&(g.disabled=_),k[0]&8&&C(n,"screen-theme",v[3]==="screen"),k[0]&8&&C(t,"screen-theme",v[3]==="screen")},d(v){v&&(B(e),B(t)),T&&T.d(v),i[70](null),y=!1,Te(I)}}}function _s(i){let e,t,n,s,o,l,r,c,f,u=i[1]&&bs(i),d=!i[1]&&ys(),m=i[4]!==!1&&Ts(i);return{c(){e=A("div"),t=A("div"),u&&u.c(),n=G(),d&&d.c(),s=G(),o=A("div"),m&&m.c(),l=G(),r=A("button"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>',a(r,"class","sy-assistant-icon-button svelte-1r23oau"),a(r,"aria-label","新建会话"),a(o,"class","sy-assistant-chat-actions-btns svelte-1r23oau"),a(t,"class","sy-assistant-chat-actions svelte-1r23oau"),a(e,"class","sy-assistant-chat-footer svelte-1r23oau")},m(g,p){j(g,e,p),w(e,t),u&&u.m(t,null),w(t,n),d&&d.m(t,null),w(t,s),w(t,o),m&&m.m(o,null),w(o,l),w(o,r),c||(f=[U(r,"click",i[49]),U(r,"mouseenter",i[69]),U(r,"mouseleave",i[44])],c=!0)},p(g,p){g[1]?u?u.p(g,p):(u=bs(g),u.c(),u.m(t,n)):u&&(u.d(1),u=null),g[1]?d&&(d.d(1),d=null):d||(d=ys(),d.c(),d.m(t,s)),g[4]!==!1?m?m.p(g,p):(m=Ts(g),m.c(),m.m(o,l)):m&&(m.d(1),m=null)},d(g){g&&B(e),u&&u.d(),d&&d.d(),m&&m.d(),c=!1,Te(f)}}}function bs(i){let e,t,n,s,o=yt(i[21]),l=[];for(let r=0;r<o.length;r+=1)l[r]=ks(rs(i,o,r));return{c(){e=A("div"),t=A("select");for(let r=0;r<l.length;r+=1)l[r].c();a(t,"class","sy-assistant-select svelte-1r23oau"),i[22]===void 0&&an(()=>i[67].call(t)),a(e,"class","sy-assistant-scene-select svelte-1r23oau")},m(r,c){j(r,e,c),w(e,t);for(let f=0;f<l.length;f+=1)l[f]&&l[f].m(t,null);gi(t,i[22],!0),n||(s=U(t,"change",i[67]),n=!0)},p(r,c){if(c[0]&2097152){o=yt(r[21]);let f;for(f=0;f<o.length;f+=1){const u=rs(r,o,f);l[f]?l[f].p(u,c):(l[f]=ks(u),l[f].c(),l[f].m(t,null))}for(;f<l.length;f+=1)l[f].d(1);l.length=o.length}c[0]&6291456&&gi(t,r[22])},d(r){r&&B(e),di(l,r),n=!1,s()}}}function ks(i){let e,t=i[87].name+"",n,s,o;return{c(){e=A("option"),n=De(t),s=G(),e.__value=o=i[87].code,kt(e,e.__value)},m(l,r){j(l,e,r),w(e,n),w(e,s)},p(l,r){r[0]&2097152&&t!==(t=l[87].name+"")&&Ze(n,t),r[0]&2097152&&o!==(o=l[87].code)&&(e.__value=o,kt(e,e.__value))},d(l){l&&B(e)}}}function ys(i){let e;return{c(){e=A("div"),a(e,"class","sy-assistant-scene-select svelte-1r23oau")},m(t,n){j(t,e,n)},d(t){t&&B(e)}}}function Ts(i){let e,t,n;return{c(){e=A("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8v4l3 3"></path><circle cx="12" cy="12" r="10"></circle></svg>',a(e,"class","sy-assistant-icon-button svelte-1r23oau"),a(e,"aria-label","历史会话")},m(s,o){j(s,e,o),t||(n=[U(e,"click",i[46]),U(e,"mouseenter",i[68]),U(e,"mouseleave",i[44])],t=!0)},p:W,d(s){s&&B(e),t=!1,Te(n)}}}function vs(i){let e,t=i[28].text+"",n;return{c(){e=A("div"),n=De(t),a(e,"class","sy-assistant-button-tooltip svelte-1r23oau"),N(e,"left",i[28].x+"px"),N(e,"top",i[28].y+"px")},m(s,o){j(s,e,o),w(e,n)},p(s,o){o[0]&268435456&&t!==(t=s[28].text+"")&&Ze(n,t),o[0]&268435456&&N(e,"left",s[28].x+"px"),o[0]&268435456&&N(e,"top",s[28].y+"px")},d(s){s&&B(e)}}}function kl(i){let e,t,n,s,o,l,r;const c=[dl,hl],f=[];function u(g,p){return g[29]?0:1}t=u(i),n=f[t]=c[t](i);let d=!i[29]&&ws(i),m=i[28]&&vs(i);return{c(){e=A("div"),n.c(),s=G(),d&&d.c(),o=G(),m&&m.c(),l=zt(),a(e,"class","sy-assistant-chat-container svelte-1r23oau"),N(e,"z-index",i[0]+2)},m(g,p){j(g,e,p),f[t].m(e,null),w(e,s),d&&d.m(e,null),j(g,o,p),m&&m.m(g,p),j(g,l,p),r=!0},p(g,p){let _=t;t=u(g),t===_?f[t].p(g,p):(Mn(),dt(f[_],1,1,()=>{f[_]=null}),Ln(),n=f[t],n?n.p(g,p):(n=f[t]=c[t](g),n.c()),et(n,1),n.m(e,s)),g[29]?d&&(d.d(1),d=null):d?d.p(g,p):(d=ws(g),d.c(),d.m(e,null)),(!r||p[0]&1)&&N(e,"z-index",g[0]+2),g[28]?m?m.p(g,p):(m=vs(g),m.c(),m.m(l.parentNode,l)):m&&(m.d(1),m=null)},i(g){r||(et(n),r=!0)},o(g){dt(n),r=!1},d(g){g&&(B(e),B(o),B(l)),f[t].d(),d&&d.d(),m&&m.d(g)}}}const Es=6e4,yn=2;function yl(i){const e=i.match(/source#\[(.*)\]#source/);return e?i.replace(`source#[${e[1]}]#source`,""):i}function Ss(i){const e=i.match(/source#\[(.*)\]#source/);if(e)try{return JSON.parse(`[${e[1]}]`)}catch(t){console.error("Failed to parse attachments:",t)}return null}function Ht(i,e,t,n){if(!i)return e;if(i.startsWith("data:image")||i.startsWith("data:image/svg+xml"))return`<img src="${i}" alt="图标" style="width: ${t||"100%"}; height: ${n||"100%"};" />`;if(i.includes("<svg")){let s=i;return t&&(s=s.replace(/width="[^"]*"/,`width="${t}"`)),n&&(s=s.replace(/height="[^"]*"/,`height="${n}"`)),s}return e}function Tn(i){const e=i.split(".");if(e.length>1){const t=e.pop()||"";return{name:e.join("."),ext:t?`.${t}`:""}}return{name:i,ext:""}}function Tl(i,e,t){let n,s,o;const l=mi();let r="",c=[{sessionId:"",requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],f="",u=null,d=null,m={x:0,y:0,alignRight:!1},g=null,p=!1,_=!1,y=null,I=0,T=null;ae.setOptions({breaks:!0,gfm:!0});function v(b){try{const O=ae(b);return Ki.sanitize(O)}catch(O){console.warn("Markdown parsing failed, fallback to HTML:",O);try{const $=b.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return Ki.sanitize($)}catch($){return console.error("HTML fallback failed:",$),b}}}let k;function x(b=!1){k&&k.scrollTo({top:k.scrollHeight,behavior:b?"smooth":"auto"})}Us(()=>{x(!1)});let{zIndex:R}=e,{sessionId:E}=e,{hasScene:L}=e,{apiPrefix:M}=e,{theme:Q="default"}=e,{showHistory:H=!0}=e,{showActions:z=!0}=e,{sendIcon:Z=""}=e,{robotIcon:oe=""}=e,{userIcon:le=""}=e,{maxInputLength:J=500}=e,{autoExpandTextarea:ce=!1}=e,{maxTextareaRows:Ye=6}=e,re=!1,me;function we(){ce&&(t(19,re=!0),de())}function nt(){ce&&(t(19,re=!1),me&&t(20,me.style.height="",me))}function de(){if(!ce||!re||!me)return;t(20,me.style.height="auto",me);const b=parseInt(getComputedStyle(me).lineHeight),O=b*3,$=b*Ye,ue=Math.min(Math.max(me.scrollHeight,O),$);t(20,me.style.height=`${ue}px`,me)}function Oe(){de()}let ee=[],Me="";function Ae(){return Ne(this,null,function*(){if(L)try{const b=yield fetch(`${M}/chat/getSceneList`,{headers:{"Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`}});if(!b.ok)throw new Error("Failed to fetch scenes");const O=yield b.json();O.code===0&&(t(21,ee=O.data.sceneList||[]),ee.length>0&&t(22,Me=ee[0].code))}catch(b){console.error("Failed to fetch scenes:",b)}})}In(()=>{Ae();const b=()=>{document.hidden&&p?console.warn("Page hidden during SSE streaming. Connection may be throttled."):!document.hidden&&p&&console.log("Page visible again during SSE streaming.")};return document.addEventListener("visibilitychange",b),()=>{document.removeEventListener("visibilitychange",b)}});function Xe(){return Ne(this,null,function*(){if(!r.trim()||o)return;if(!E){console.error("No session ID available");return}const b=Date.now().toString(),O=Date.now().toString()+Math.random().toString().slice(2,8),$={sessionId:E,requestId:O,id:b,type:"user",content:r.trim(),timestamp:Date.now()};t(13,c=[...c,$]);const ue=r.trim();t(10,r=""),ce&&me&&t(20,me.style.height="",me);const ye=(Date.now()+1).toString();I=0,T={sessionId:E,requestId:O,keyword:ue,assistantMessageId:ye},f="",t(13,c=[...c,{sessionId:E,requestId:O,id:ye,type:"assistant",content:"",timestamp:Date.now()}]),yield Le(E,O,ue,ye)})}function Le(b,O,$,ue,ye=!1){return Ne(this,null,function*(){t(17,p=!0),_=!1,ye&&(console.log(`Retrying request (attempt ${I+1}/${yn})...`),f="",t(13,c=c.map(pe=>pe.id===ue?Ee(ne({},pe),{content:""}):pe))),u&&u.abort(),y&&(clearTimeout(y),y=null),u=new AbortController,y=setTimeout(()=>{p&&u&&(console.warn("SSE request timeout, aborting..."),u.abort(),I<yn&&T?(I++,setTimeout(()=>{T&&Le(T.sessionId,T.requestId,T.keyword,T.assistantMessageId,!0)},1e3)):(f=f||"请求超时,请稍后重试",t(13,c=c.map(pe=>pe.id===ue?Ee(ne({},pe),{content:f}):pe)),t(17,p=!1),T=null))},Es);try{yield so(`${M}/chat/sse`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({sessionId:b,requestId:O,keyword:$,flowId:"1",extendKeys:L?{sceneCode:Me}:void 0}),signal:u.signal,onmessage(pe){try{const te=pe.data;if(te){y&&(clearTimeout(y),y=setTimeout(()=>{p&&u&&(console.warn("SSE streaming timeout, aborting..."),u.abort(),t(17,p=!1))},Es)),_||(_=!0,l("firstResponse",{sessionId:b,requestId:O,content:te,timestamp:Date.now()}));const Mt=Ss(te);Mt?(t(13,c=c.map(ht=>ht.id===ue?Ee(ne({},ht),{attachments:Mt}):ht)),x(!0)):(f+=te,t(13,c=c.map(ht=>ht.id===ue?Ee(ne({},ht),{content:f}):ht)),x(!1))}}catch(te){console.error("Failed to process SSE message:",te)}},onerror(pe){throw f="请求异常,请重试",t(13,c=c.map(te=>te.id===ue?Ee(ne({},te),{content:f}):te)),x(!1),console.error("SSE error:",pe),u=null,t(17,p=!1),pe},onclose(){y&&(clearTimeout(y),y=null),u=null,t(17,p=!1),T=null,I=0}})}catch(pe){console.error("Failed to send message:",pe),y&&(clearTimeout(y),y=null),I<yn&&T&&!String(pe).includes("abort")?(I++,console.log(`Request failed, retrying (attempt ${I}/${yn})...`),setTimeout(()=>{T&&Le(T.sessionId,T.requestId,T.keyword,T.assistantMessageId,!0)},1e3)):(String(pe).includes("abort")||(f=f||"请求失败,请稍后重试",t(13,c=c.map(te=>te.id===ue?Ee(ne({},te),{content:f}):te))),t(17,p=!1),T=null,I=0)}})}function ct(b,O,$){const ue=$.getBoundingClientRect(),ye=k.getBoundingClientRect(),pe=ue.left<ye.width/2;t(14,d=O),t(15,m={x:ue.left,y:ue.top+ue.height/2,alignRight:pe})}function q(){t(16,g=setTimeout(()=>{t(14,d=null),t(16,g=null)},200))}Ws(()=>{u&&u.abort(),g&&clearTimeout(g),y&&clearTimeout(y)});function X(b,O){return Ne(this,null,function*(){try{const $=yield fetch(`${M}/file/downloadFile`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({fileName:b,fileUrl:O})});if(!$.ok)throw new Error("Download failed");const ue=$.headers.get("content-type")||"application/octet-stream",ye=yield $.blob(),pe=window.URL.createObjectURL(ye),te=document.createElement("a");te.href=pe,te.download=b,document.body.appendChild(te),te.click(),window.URL.revokeObjectURL(pe),document.body.removeChild(te)}catch($){console.error("Failed to download file:",$)}})}let ve={};function Ge(b,O){return Ne(this,null,function*(){try{const $=O.replace(/<br\s*\/?>/g,`
|
|
47
|
+
`+Ve),X&&_n([z,Z,oe],_t=>{Ve=$t(Ve,_t," ")}),k&>?k.createHTML(Ve):Ve},e.setConfig=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};on(F),he=!0},e.clearConfig=function(){Tt=null,he=!1},e.isValidAttribute=function(F,h,S){Tt||on({});const P=Re(F),be=Re(h);return ht(P,be,S)},e.addHook=function(F,h){typeof h=="function"&&Kt(H[F],h)},e.removeHook=function(F,h){if(h!==void 0){const S=qo(H[F],h);return S===-1?void 0:Go(H[F],S,1)[0]}return Ui(H[F])},e.removeHooks=function(F){H[F]=[]},e.removeAllHooks=function(){H=Qi()},e}var Ki=Ji();function $i(i){var n;if(typeof document=="undefined")return null;const t=`; ${document.cookie}`.split(`; ${i}=`);return t.length===2&&((n=t.pop())==null?void 0:n.split(";").shift())||null}const Se=()=>{if(typeof window=="undefined")return null;const i=$i("access_token");if(i)return i;const e=$i("auth_token");if(e)return e;const t=sessionStorage.getItem("vuex");if(t)try{const n=JSON.parse(t);if(n!=null&&n.token)return n.token}catch(n){console.error("Failed to parse vuex data:",n)}return null};function es(i,e,t){const n=i.slice();return n[25]=e[t],n}function ts(i){let e,t=i[9].text+"",n;return{c(){e=A("div"),n=De(t),a(e,"class","sy-assistant-button-tooltip svelte-1g6fj9a"),N(e,"left",i[9].x+"px"),N(e,"top",i[9].y+"px"),N(e,"z-index",i[3]+3)},m(s,o){j(s,e,o),w(e,n)},p(s,o){o&512&&t!==(t=s[9].text+"")&&Ze(n,t),o&512&&N(e,"left",s[9].x+"px"),o&512&&N(e,"top",s[9].y+"px"),o&8&&N(e,"z-index",s[3]+3)},d(s){s&&B(e)}}}function al(i){let e=[],t=new Map,n,s,o=yt(i[0]);const l=c=>c[25].sessionId;for(let c=0;c<o.length;c+=1){let f=es(i,o,c),u=l(f);t.set(u,e[c]=ns(u,f))}let r=i[5]&&is();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=G(),r&&r.c(),s=zt()},m(c,f){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(c,f);j(c,n,f),r&&r.m(c,f),j(c,s,f)},p(c,f){f&8261&&(o=yt(c[0]),e=ki(e,f,l,1,c,o,t,n.parentNode,bi,ns,n,es)),c[5]?r||(r=is(),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},d(c){c&&(B(n),B(s));for(let f=0;f<e.length;f+=1)e[f].d(c);r&&r.d(c)}}}function cl(i){let e,t=i[4]?"未找到相关会话":i[5]?"加载中...":"暂无历史会话",n;return{c(){e=A("div"),n=De(t),a(e,"class","sy-session-empty svelte-1g6fj9a")},m(s,o){j(s,e,o),w(e,n)},p(s,o){o&48&&t!==(t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话")&&Ze(n,t)},d(s){s&&B(e)}}}function ns(i,e){let t,n,s,o,l=e[25].title+"",r,c,f,u=os(e[25].timestamp)+"",d,m,g,p,_,y,I,T,v,k,x;function R(){return e[18](e[25])}function E(...L){return e[19](e[25],...L)}return{key:i,first:null,c(){t=A("div"),n=A("button"),s=A("div"),o=A("div"),r=De(l),c=G(),f=A("div"),d=De(u),m=G(),g=A("button"),p=Y("svg"),_=Y("path"),y=Y("path"),I=Y("path"),a(o,"class","sy-session-title svelte-1g6fj9a"),a(f,"class","sy-session-time svelte-1g6fj9a"),a(s,"class","sy-session-info svelte-1g6fj9a"),a(n,"class","sy-session-select svelte-1g6fj9a"),a(_,"d","M3 6h18"),a(y,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),a(I,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),a(p,"xmlns","http://www.w3.org/2000/svg"),a(p,"width","16"),a(p,"height","16"),a(p,"viewBox","0 0 24 24"),a(p,"fill","none"),a(p,"stroke","currentColor"),a(p,"stroke-width","2"),a(p,"stroke-linecap","round"),a(p,"stroke-linejoin","round"),a(g,"class","sy-session-delete svelte-1g6fj9a"),g.disabled=T=e[6]===e[25].sessionId,a(g,"aria-label","删除会话"),a(t,"class","sy-session-item svelte-1g6fj9a"),a(t,"data-session-id",v=e[25].sessionId),C(t,"deleting",e[25].deleting),this.first=t},m(L,M){j(L,t,M),w(t,n),w(n,s),w(s,o),w(o,r),w(s,c),w(s,f),w(f,d),w(t,m),w(t,g),w(g,p),w(p,_),w(p,y),w(p,I),k||(x=[U(n,"click",R),U(g,"click",E)],k=!0)},p(L,M){e=L,M&1&&l!==(l=e[25].title+"")&&Ze(r,l),M&1&&u!==(u=os(e[25].timestamp)+"")&&Ze(d,u),M&65&&T!==(T=e[6]===e[25].sessionId)&&(g.disabled=T),M&1&&v!==(v=e[25].sessionId)&&a(t,"data-session-id",v),M&1&&C(t,"deleting",e[25].deleting)},d(L){L&&B(t),k=!1,Te(x)}}}function is(i){let e;return{c(){e=A("div"),e.innerHTML='<span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span> <span class="loading-dot svelte-1g6fj9a"></span>',a(e,"class","sy-session-loading svelte-1g6fj9a")},m(t,n){j(t,e,n)},d(t){t&&B(e)}}}function ss(i){let e,t,n,s,o,l,r,c,f;return{c(){e=A("div"),t=A("div"),t.textContent="确认删除此会话?",n=G(),s=A("div"),o=A("button"),o.textContent="取消",l=G(),r=A("button"),r.textContent="删除",a(t,"class","sy-session-confirm-content svelte-1g6fj9a"),a(o,"class","sy-session-confirm-cancel svelte-1g6fj9a"),a(r,"class","sy-session-confirm-delete svelte-1g6fj9a"),a(s,"class","sy-session-confirm-actions svelte-1g6fj9a"),a(e,"class","sy-session-confirm-popup svelte-1g6fj9a"),N(e,"left",i[8].x+"px"),N(e,"top",i[8].y+"px"),N(e,"z-index",i[3]+3)},m(u,d){j(u,e,d),w(e,t),w(e,n),w(e,s),w(s,o),w(s,l),w(s,r),c||(f=[U(o,"click",i[20]),U(r,"click",i[14])],c=!0)},p(u,d){d&256&&N(e,"left",u[8].x+"px"),d&256&&N(e,"top",u[8].y+"px"),d&8&&N(e,"z-index",u[3]+3)},d(u){u&&B(e),c=!1,Te(f)}}}function ul(i){let e,t,n,s,o,l,r,c,f,u,d,m,g,p,_,y,I,T,v,k=i[9]&&ts(i);function x(M,Q){return M[0].length===0?cl:al}let R=x(i),E=R(i),L=i[7]&&ss(i);return{c(){e=A("div"),t=A("div"),n=A("h2"),n.textContent="历史会话",s=G(),o=A("button"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',l=G(),r=A("div"),c=A("input"),f=G(),u=Y("svg"),d=Y("circle"),m=Y("line"),g=G(),k&&k.c(),p=G(),_=A("div"),E.c(),y=G(),L&&L.c(),I=zt(),a(n,"class","svelte-1g6fj9a"),a(o,"class","sy-session-close svelte-1g6fj9a"),a(o,"aria-label","关闭历史会话"),a(t,"class","sy-session-header svelte-1g6fj9a"),a(c,"type","text"),a(c,"class","sy-session-search-input svelte-1g6fj9a"),a(c,"placeholder","搜索历史会话..."),a(d,"cx","11"),a(d,"cy","11"),a(d,"r","8"),a(m,"x1","21"),a(m,"y1","21"),a(m,"x2","16.65"),a(m,"y2","16.65"),a(u,"class","sy-session-search-icon svelte-1g6fj9a"),a(u,"xmlns","http://www.w3.org/2000/svg"),a(u,"width","16"),a(u,"height","16"),a(u,"viewBox","0 0 24 24"),a(u,"fill","none"),a(u,"stroke","currentColor"),a(u,"stroke-width","2"),a(u,"stroke-linecap","round"),a(u,"stroke-linejoin","round"),a(r,"class","sy-session-search svelte-1g6fj9a"),a(_,"class","sy-session-list svelte-1g6fj9a"),a(e,"class","sy-session-history svelte-1g6fj9a"),N(e,"z-index",i[3]+2)},m(M,Q){j(M,e,Q),w(e,t),w(t,n),w(t,s),w(t,o),w(e,l),w(e,r),w(r,c),kt(c,i[4]),w(r,f),w(r,u),w(u,d),w(u,m),w(e,g),k&&k.m(e,null),w(e,p),w(e,_),E.m(_,null),j(M,y,Q),L&&L.m(M,Q),j(M,I,Q),T||(v=[U(o,"click",function(){Wt(i[1])&&i[1].apply(this,arguments)}),U(o,"mouseenter",i[16]),U(o,"mouseleave",i[12]),U(c,"input",i[17]),U(_,"scroll",i[10])],T=!0)},p(M,[Q]){i=M,Q&16&&c.value!==i[4]&&kt(c,i[4]),i[9]?k?k.p(i,Q):(k=ts(i),k.c(),k.m(e,p)):k&&(k.d(1),k=null),R===(R=x(i))&&E?E.p(i,Q):(E.d(1),E=R(i),E&&(E.c(),E.m(_,null))),Q&8&&N(e,"z-index",i[3]+2),i[7]?L?L.p(i,Q):(L=ss(i),L.c(),L.m(I.parentNode,I)):L&&(L.d(1),L=null)},i:W,o:W,d(M){M&&(B(e),B(y),B(I)),k&&k.d(),E.d(),L&&L.d(M),T=!1,Te(v)}}}const $n=10;function os(i){return new Date(i).toLocaleString()}function fl(i,e,t){let{sessions:n=[]}=e,{onClose:s}=e,{onSelect:o}=e,{zIndex:l}=e,{apiPrefix:r}=e,c=!1,f=!0,u=0,d="",m=null,g=null,p={x:0,y:0};function _(){return Ne(this,null,function*(){if(!(c||!f)){t(5,c=!0);try{const z=yield fetch(`${r}/chat/record/session/list/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({start:u,length:$n,keyword:d})});if(!z.ok)throw new Error("Failed to load sessions");const Z=yield z.json();if(Z.code===0){const oe=Z.data.sessionList.map(le=>({sessionId:le.sessionId,title:le.name,timestamp:new Date(le.createDate).getTime()}));t(0,n=[...n,...oe]),u+=$n,f=oe.length===$n}}catch(z){console.error("Failed to load sessions:",z)}finally{t(5,c=!1)}}})}function y(z){const Z=z.target,{scrollTop:oe,scrollHeight:le,clientHeight:J}=Z;le-oe-J<50&&_()}In(()=>{_()});let I=null;function T(z,Z){const le=z.currentTarget.getBoundingClientRect();t(9,I={text:Z,x:le.left+le.width/2,y:le.bottom+8})}function v(){t(9,I=null)}function k(z,Z){const le=z.currentTarget.getBoundingClientRect();t(8,p={x:le.left-16,y:le.top+le.height/2}),t(7,g=Z)}function x(z){return Ne(this,null,function*(){if(z&&!m)try{t(6,m=z),t(7,g=null);const Z=document.querySelector(`[data-session-id="${z}"]`);Z&&Z.classList.add("deleting"),yield new Promise(J=>setTimeout(J,300));const oe=yield fetch(`${r}/chat/record/session/delete`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({sessionId:z})});if(!oe.ok)throw new Error("Delete request failed");const le=yield oe.json();if(le.code===0&&le.data.respCode===0)t(0,n=n.map(J=>Ee(ne({},J),{deleting:J.sessionId===z}))),setTimeout(()=>{t(0,n=n.filter(J=>!J.deleting))},300);else throw new Error("Delete failed: "+le.message)}catch(Z){console.error("Failed to delete session:",Z);const oe=document.querySelector(`[data-session-id="${z}"]`);oe&&oe.classList.remove("deleting")}finally{t(6,m=null)}})}function R(){g&&x(g)}const E=z=>T(z,"关闭历史会话");function L(){d=this.value,t(4,d)}const M=z=>o(z.sessionId),Q=(z,Z)=>k(Z,z.sessionId),H=()=>t(7,g=null);return i.$$set=z=>{"sessions"in z&&t(0,n=z.sessions),"onClose"in z&&t(1,s=z.onClose),"onSelect"in z&&t(2,o=z.onSelect),"zIndex"in z&&t(3,l=z.zIndex),"apiPrefix"in z&&t(15,r=z.apiPrefix)},i.$$.update=()=>{i.$$.dirty&16&&d!==void 0&&(t(0,n=[]),u=0,f=!0,_())},[n,s,o,l,d,c,m,g,p,I,y,T,v,k,R,r,E,L,M,Q,H]}class ls extends Dn{constructor(e){super(),zn(this,e,fl,ul,Lt,{sessions:0,onClose:1,onSelect:2,zIndex:3,apiPrefix:15})}}function rs(i,e,t){const n=i.slice();return n[87]=e[t],n}function as(i,e,t){const n=i.slice();return n[90]=e[t],n[91]=e,n[92]=t,n}function cs(i,e,t){const n=i.slice();return n[93]=e[t],n[95]=t,n}function hl(i){let e,t=[],n=new Map,s=yt(i[13]);const o=l=>l[90].id;for(let l=0;l<s.length;l+=1){let r=as(i,s,l),c=o(r);n.set(c,t[l]=ms(c,r))}return{c(){e=A("div");for(let l=0;l<t.length;l+=1)t[l].c();a(e,"class","sy-assistant-message-list svelte-1r23oau")},m(l,r){j(l,e,r);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);i[66](e)},p(l,r){r[0]&260301225|r[1]&16353&&(s=yt(l[13]),t=ki(t,r,o,1,l,s,n,e,bi,ms,null,as))},i:W,o:W,d(l){l&&B(e);for(let r=0;r<t.length;r+=1)t[r].d();i[66](null)}}}function dl(i){let e,t;return e=new ls({props:{sessions:i[45],onClose:i[47],onSelect:i[48],zIndex:i[0],apiPrefix:i[2]}}),{c(){Cn(e.$$.fragment)},m(n,s){un(e,n,s),t=!0},p(n,s){const o={};s[0]&1&&(o.zIndex=n[0]),s[0]&4&&(o.apiPrefix=n[2]),e.$set(o)},i(n){t||(et(e.$$.fragment,n),t=!0)},o(n){dt(e.$$.fragment,n),t=!1},d(n){fn(e,n)}}}function pl(i){let e,t=Ht(i[8],'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',"100%","100%")+"";return{c(){e=A("div"),a(e,"class","sy-assistant-avatar user svelte-1r23oau"),C(e,"screen-theme",i[3]==="screen")},m(n,s){j(n,e,s),e.innerHTML=t},p(n,s){s[0]&256&&t!==(t=Ht(n[8],'<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>',"100%","100%")+"")&&(e.innerHTML=t),s[0]&8&&C(e,"screen-theme",n[3]==="screen")},d(n){n&&B(e)}}}function gl(i){let e,t=Ht(i[7],'<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="currentColor"><path d="M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z" fill="#6F8698"></path><path d="M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z" fill="#3677FF"></path><path d="M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z" fill="#D0D5F1"></path><path d="M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z" fill="#3677FF"></path><path d="M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z" fill="#8896A4"></path></svg>',"100%","100%")+"";return{c(){e=A("div"),a(e,"class","sy-assistant-avatar assistant svelte-1r23oau"),C(e,"screen-theme",i[3]==="screen")},m(n,s){j(n,e,s),e.innerHTML=t},p(n,s){s[0]&128&&t!==(t=Ht(n[7],'<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="currentColor"><path d="M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z" fill="#6F8698"></path><path d="M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z" fill="#3677FF"></path><path d="M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z" fill="#D0D5F1"></path><path d="M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z" fill="#3677FF"></path><path d="M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z" fill="#FFFFFF"></path><path d="M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z" fill="#8896A4"></path></svg>',"100%","100%")+"")&&(e.innerHTML=t),s[0]&8&&C(e,"screen-theme",n[3]==="screen")},d(n){n&&B(e)}}}function ml(i){let e,t=i[31](i[90].content)+"";return{c(){e=A("div"),a(e,"class","markdown-content svelte-1r23oau")},m(n,s){j(n,e,s),e.innerHTML=t},p(n,s){s[0]&8192&&t!==(t=n[31](n[90].content)+"")&&(e.innerHTML=t)},d(n){n&&B(e)}}}function wl(i){let e;return{c(){e=A("span"),e.innerHTML='<span class="dot svelte-1r23oau">.</span> <span class="dot svelte-1r23oau">.</span> <span class="dot svelte-1r23oau">.</span>',a(e,"class","sy-assistant-loading svelte-1r23oau")},m(t,n){j(t,e,n)},p:W,d(t){t&&B(e)}}}function us(i){let e,t=yt(i[90].attachments),n=[];for(let s=0;s<t.length;s+=1)n[s]=ds(cs(i,t,s));return{c(){e=A("div");for(let s=0;s<n.length;s+=1)n[s].c();a(e,"class","sy-assistant-attachments svelte-1r23oau")},m(s,o){j(s,e,o);for(let l=0;l<n.length;l+=1)n[l]&&n[l].m(e,null)},p(s,o){if(o[0]&122881|o[1]&224){t=yt(s[90].attachments);let l;for(l=0;l<t.length;l+=1){const r=cs(s,t,l);n[l]?n[l].p(r,o):(n[l]=ds(r),n[l].c(),n[l].m(e,null))}for(;l<n.length;l+=1)n[l].d(1);n.length=t.length}},d(s){s&&B(e),di(n,s)}}}function fs(i){let e,t,n;function s(...o){return i[53](i[93],...o)}return{c(){e=A("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1r23oau"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',a(e,"class","sy-assistant-attachment-toggle svelte-1r23oau"),a(e,"aria-label","查看详情")},m(o,l){j(o,e,l),t||(n=[U(e,"mouseenter",s),U(e,"mouseleave",i[37])],t=!0)},p(o,l){i=o},d(o){o&&B(e),t=!1,Te(n)}}}function hs(i){let e,t=i[14].replace(/\n/g,"<br>")+"",n,s;return{c(){e=A("div"),a(e,"class","sy-assistant-tooltip svelte-1r23oau"),a(e,"role","tooltip"),N(e,"left",i[15].x+"px"),N(e,"top",i[15].y+"px"),N(e,"z-index",i[0]+3),C(e,"align-right",i[15].alignRight)},m(o,l){j(o,e,l),e.innerHTML=t,n||(s=[U(e,"mouseenter",i[55]),U(e,"mouseleave",i[56])],n=!0)},p(o,l){l[0]&16384&&t!==(t=o[14].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),l[0]&32768&&N(e,"left",o[15].x+"px"),l[0]&32768&&N(e,"top",o[15].y+"px"),l[0]&1&&N(e,"z-index",o[0]+3),l[0]&32768&&C(e,"align-right",o[15].alignRight)},d(o){o&&B(e),n=!1,Te(s)}}}function ds(i){let e,t,n,s,o,l,r,c,f,u=Tn(i[93].content_title).name+"",d,m,g,p=Tn(i[93].content_title).ext+"",_,y,I,T,v,k,x,R,E,L,M=i[93].tips&&fs(i);function Q(){return i[54](i[93])}let H=i[14]&&hs(i);return{c(){e=A("div"),t=A("div"),n=A("div"),s=Y("svg"),o=Y("path"),l=Y("polyline"),r=G(),c=A("div"),f=A("span"),d=De(u),m=G(),g=A("span"),_=De(p),I=G(),T=A("div"),M&&M.c(),v=G(),k=A("button"),k.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1r23oau"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg>',x=G(),H&&H.c(),R=G(),a(o,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),a(l,"points","13 2 13 9 20 9"),a(s,"xmlns","http://www.w3.org/2000/svg"),a(s,"width","16"),a(s,"height","16"),a(s,"viewBox","0 0 24 24"),a(s,"fill","none"),a(s,"stroke","currentColor"),a(s,"stroke-width","2"),a(s,"stroke-linecap","round"),a(s,"stroke-linejoin","round"),a(f,"class","sy-assistant-filename svelte-1r23oau"),a(g,"class","sy-assistant-attachment-ext svelte-1r23oau"),a(c,"class","sy-assistant-attachment-name svelte-1r23oau"),a(c,"title",y=i[93].content_title),a(n,"class","sy-assistant-attachment-title svelte-1r23oau"),a(k,"class","sy-assistant-attachment-toggle svelte-1r23oau"),a(k,"aria-label","下载文件"),a(T,"class","sy-assistant-attachment-actions svelte-1r23oau"),a(t,"class","sy-assistant-attachment-header svelte-1r23oau"),a(e,"class","sy-assistant-attachment svelte-1r23oau")},m(z,Z){j(z,e,Z),w(e,t),w(t,n),w(n,s),w(s,o),w(s,l),w(n,r),w(n,c),w(c,f),w(f,d),w(c,m),w(c,g),w(g,_),w(t,I),w(t,T),M&&M.m(T,null),w(T,v),w(T,k),w(e,x),H&&H.m(e,null),w(e,R),E||(L=U(k,"click",Q),E=!0)},p(z,Z){i=z,Z[0]&8192&&u!==(u=Tn(i[93].content_title).name+"")&&Ze(d,u),Z[0]&8192&&p!==(p=Tn(i[93].content_title).ext+"")&&Ze(_,p),Z[0]&8192&&y!==(y=i[93].content_title)&&a(c,"title",y),i[93].tips?M?M.p(i,Z):(M=fs(i),M.c(),M.m(T,v)):M&&(M.d(1),M=null),i[14]?H?H.p(i,Z):(H=hs(i),H.c(),H.m(e,R)):H&&(H.d(1),H=null)},d(z){z&&B(e),M&&M.d(),H&&H.d(),E=!1,L()}}}function ps(i){let e,t,n,s,o,l,r,c,f,u,d;function m(R,E){return R[23][R[90].id]?bl:_l}let g=m(i),p=g(i);function _(){return i[57](i[90])}function y(...R){return i[58](i[90],...R)}function I(){return i[59](i[90])}function T(...R){return i[60](i[90],...R)}function v(...R){return i[61](i[90],...R)}function k(...R){return i[62](i[90],...R)}let x=i[26]&&i[24][i[90].id]==="dislike"&&gs(i);return{c(){e=A("div"),t=A("button"),p.c(),s=G(),o=A("button"),o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>',l=G(),r=A("button"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h3a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2h-3"></path></svg>',c=G(),x&&x.c(),f=zt(),a(t,"class","sy-assistant-action-button svelte-1r23oau"),a(t,"aria-label",n=i[23][i[90].id]?"已复制":"复制内容"),C(t,"copied",i[23][i[90].id]),a(o,"class","sy-assistant-action-button svelte-1r23oau"),a(o,"aria-label","点赞"),C(o,"active",i[24][i[90].id]==="like"),a(r,"class","sy-assistant-action-button svelte-1r23oau"),a(r,"aria-label","点踩"),C(r,"active",i[24][i[90].id]==="dislike"),a(e,"class","sy-assistant-message-actions svelte-1r23oau")},m(R,E){j(R,e,E),w(e,t),p.m(t,null),w(e,s),w(e,o),w(e,l),w(e,r),j(R,c,E),x&&x.m(R,E),j(R,f,E),u||(d=[U(t,"click",_),U(t,"mouseenter",y),U(t,"mouseleave",i[44]),U(o,"click",I),U(o,"mouseenter",T),U(o,"mouseleave",i[44]),U(r,"click",v),U(r,"mouseenter",k),U(r,"mouseleave",i[44])],u=!0)},p(R,E){i=R,g!==(g=m(i))&&(p.d(1),p=g(i),p&&(p.c(),p.m(t,null))),E[0]&8396800&&n!==(n=i[23][i[90].id]?"已复制":"复制内容")&&a(t,"aria-label",n),E[0]&8396800&&C(t,"copied",i[23][i[90].id]),E[0]&16785408&&C(o,"active",i[24][i[90].id]==="like"),E[0]&16785408&&C(r,"active",i[24][i[90].id]==="dislike"),i[26]&&i[24][i[90].id]==="dislike"?x?x.p(i,E):(x=gs(i),x.c(),x.m(f.parentNode,f)):x&&(x.d(1),x=null)},d(R){R&&(B(e),B(c),B(f)),p.d(),x&&x.d(R),u=!1,Te(d)}}}function _l(i){let e,t,n;return{c(){e=Y("svg"),t=Y("rect"),n=Y("path"),a(t,"x","9"),a(t,"y","9"),a(t,"width","13"),a(t,"height","13"),a(t,"rx","2"),a(t,"ry","2"),a(n,"d","M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(s,o){j(s,e,o),w(e,t),w(e,n)},d(s){s&&B(e)}}}function bl(i){let e,t;return{c(){e=Y("svg"),t=Y("polyline"),a(t,"points","20 6 9 17 4 12"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width","14"),a(e,"height","14"),a(e,"viewBox","0 0 24 24"),a(e,"fill","none"),a(e,"stroke","currentColor"),a(e,"stroke-width","2"),a(e,"stroke-linecap","round"),a(e,"stroke-linejoin","round")},m(n,s){j(n,e,s),w(e,t)},d(n){n&&B(e)}}}function gs(i){let e,t,n,s,o,l,r,c,f,u,d;function m(){i[63].call(s,i[90])}function g(){return i[64](i[90])}function p(){return i[65](i[90])}return{c(){e=A("div"),t=A("div"),t.textContent="反馈意见",n=G(),s=A("textarea"),o=G(),l=A("div"),r=A("button"),r.textContent="取消",c=G(),f=A("button"),f.textContent="提交",a(t,"class","sy-assistant-dislike-title svelte-1r23oau"),a(s,"class","sy-assistant-dislike-input svelte-1r23oau"),a(s,"placeholder","请输入您的反馈意见..."),a(r,"class","sy-assistant-popup-cancel svelte-1r23oau"),a(f,"class","sy-assistant-popup-submit svelte-1r23oau"),a(l,"class","sy-assistant-popup-actions svelte-1r23oau"),a(e,"class","sy-assistant-dislike-popup svelte-1r23oau"),N(e,"left",i[27].x+"px"),N(e,"top",i[27].y+"px"),N(e,"z-index",i[0]+3)},m(_,y){j(_,e,y),w(e,t),w(e,n),w(e,s),kt(s,i[25][i[90].id]),w(e,o),w(e,l),w(l,r),w(l,c),w(l,f),u||(d=[U(s,"input",m),U(r,"click",g),U(f,"click",p)],u=!0)},p(_,y){i=_,y[0]&33562624&&kt(s,i[25][i[90].id]),y[0]&134217728&&N(e,"left",i[27].x+"px"),y[0]&134217728&&N(e,"top",i[27].y+"px"),y[0]&1&&N(e,"z-index",i[0]+3)},d(_){_&&B(e),u=!1,Te(d)}}}function ms(i,e){let t,n,s,o,l,r,c,f,u=new Date(e[90].timestamp).toLocaleString()+"",d,m;function g(x,R){return x[90].type==="assistant"?gl:pl}let p=g(e),_=p(e);function y(x,R){return x[17]&&x[90].id===x[13][x[13].length-1].id&&x[90].type==="assistant"&&!x[90].content?wl:ml}let I=y(e),T=I(e),v=e[90].attachments&&us(e),k=e[90].id!=="-1"&&e[90].type==="assistant"&&!e[17]&&e[5]&&ps(e);return{key:i,first:null,c(){t=A("div"),_.c(),n=G(),s=A("div"),o=A("div"),T.c(),l=G(),v&&v.c(),r=G(),k&&k.c(),c=G(),f=A("div"),d=De(u),m=G(),a(o,"class","sy-assistant-message-content svelte-1r23oau"),C(o,"screen-theme",e[3]==="screen"),a(f,"class","sy-assistant-message-time svelte-1r23oau"),a(s,"class","sy-assistant-message-bubble svelte-1r23oau"),C(s,"screen-theme",e[3]==="screen"),a(t,"class","sy-assistant-message svelte-1r23oau"),C(t,"user",e[90].type==="user"),C(t,"screen-theme",e[3]==="screen"),this.first=t},m(x,R){j(x,t,R),_.m(t,null),w(t,n),w(t,s),w(s,o),T.m(o,null),w(o,l),v&&v.m(o,null),w(o,r),k&&k.m(o,null),w(s,c),w(s,f),w(f,d),w(t,m)},p(x,R){e=x,p===(p=g(e))&&_?_.p(e,R):(_.d(1),_=p(e),_&&(_.c(),_.m(t,n))),I===(I=y(e))&&T?T.p(e,R):(T.d(1),T=I(e),T&&(T.c(),T.m(o,l))),e[90].attachments?v?v.p(e,R):(v=us(e),v.c(),v.m(o,r)):v&&(v.d(1),v=null),e[90].id!=="-1"&&e[90].type==="assistant"&&!e[17]&&e[5]?k?k.p(e,R):(k=ps(e),k.c(),k.m(o,null)):k&&(k.d(1),k=null),R[0]&8&&C(o,"screen-theme",e[3]==="screen"),R[0]&8192&&u!==(u=new Date(e[90].timestamp).toLocaleString()+"")&&Ze(d,u),R[0]&8&&C(s,"screen-theme",e[3]==="screen"),R[0]&8192&&C(t,"user",e[90].type==="user"),R[0]&8&&C(t,"screen-theme",e[3]==="screen")},d(x){x&&B(t),_.d(),T.d(),v&&v.d(),k&&k.d()}}}function ws(i){let e,t,n,s,o,l,r,c,f,u,d,m,g,p=Ht(i[6],'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>')+"",_,y,I,T=i[5]&&_s(i);return{c(){T&&T.c(),e=G(),t=A("div"),n=A("div"),s=A("div"),o=A("textarea"),l=G(),r=A("div"),c=A("div"),f=De(i[12]),u=De("/"),d=De(i[11]),m=G(),g=A("button"),a(o,"class","sy-assistant-textarea svelte-1r23oau"),a(o,"placeholder","输入您的问题..."),a(o,"maxlength",i[11]),a(o,"rows","3"),C(o,"screen-theme",i[3]==="screen"),C(o,"auto-expand",i[9]&&i[19]),a(s,"class","sy-assistant-textarea-container svelte-1r23oau"),a(c,"class","sy-assistant-char-count svelte-1r23oau"),C(c,"over-limit",i[30]),a(g,"class","sy-assistant-send-button svelte-1r23oau"),g.disabled=_=!i[10].trim()||i[30],a(g,"aria-label","发送消息"),a(r,"class","sy-assistant-operation-area svelte-1r23oau"),a(n,"class","sy-assistant-input-container svelte-1r23oau"),C(n,"screen-theme",i[3]==="screen"),a(t,"class","sy-assistant-input-area svelte-1r23oau"),C(t,"screen-theme",i[3]==="screen")},m(v,k){T&&T.m(v,k),j(v,e,k),j(v,t,k),w(t,n),w(n,s),w(s,o),i[70](o),kt(o,i[10]),w(n,l),w(n,r),w(r,c),w(c,f),w(c,u),w(c,d),w(r,m),w(r,g),g.innerHTML=p,y||(I=[U(o,"input",i[71]),U(o,"keydown",i[72]),U(o,"focus",i[32]),U(o,"blur",i[33]),U(o,"input",i[34]),U(g,"click",i[35]),U(g,"mouseenter",i[73]),U(g,"mouseleave",i[44])],y=!0)},p(v,k){v[5]?T?T.p(v,k):(T=_s(v),T.c(),T.m(e.parentNode,e)):T&&(T.d(1),T=null),k[0]&2048&&a(o,"maxlength",v[11]),k[0]&1024&&kt(o,v[10]),k[0]&8&&C(o,"screen-theme",v[3]==="screen"),k[0]&524800&&C(o,"auto-expand",v[9]&&v[19]),k[0]&4096&&Ze(f,v[12]),k[0]&2048&&Ze(d,v[11]),k[0]&1073741824&&C(c,"over-limit",v[30]),k[0]&64&&p!==(p=Ht(v[6],'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>')+"")&&(g.innerHTML=p),k[0]&1073742848&&_!==(_=!v[10].trim()||v[30])&&(g.disabled=_),k[0]&8&&C(n,"screen-theme",v[3]==="screen"),k[0]&8&&C(t,"screen-theme",v[3]==="screen")},d(v){v&&(B(e),B(t)),T&&T.d(v),i[70](null),y=!1,Te(I)}}}function _s(i){let e,t,n,s,o,l,r,c,f,u=i[1]&&bs(i),d=!i[1]&&ys(),m=i[4]!==!1&&Ts(i);return{c(){e=A("div"),t=A("div"),u&&u.c(),n=G(),d&&d.c(),s=G(),o=A("div"),m&&m.c(),l=G(),r=A("button"),r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>',a(r,"class","sy-assistant-icon-button svelte-1r23oau"),a(r,"aria-label","新建会话"),a(o,"class","sy-assistant-chat-actions-btns svelte-1r23oau"),a(t,"class","sy-assistant-chat-actions svelte-1r23oau"),a(e,"class","sy-assistant-chat-footer svelte-1r23oau")},m(g,p){j(g,e,p),w(e,t),u&&u.m(t,null),w(t,n),d&&d.m(t,null),w(t,s),w(t,o),m&&m.m(o,null),w(o,l),w(o,r),c||(f=[U(r,"click",i[49]),U(r,"mouseenter",i[69]),U(r,"mouseleave",i[44])],c=!0)},p(g,p){g[1]?u?u.p(g,p):(u=bs(g),u.c(),u.m(t,n)):u&&(u.d(1),u=null),g[1]?d&&(d.d(1),d=null):d||(d=ys(),d.c(),d.m(t,s)),g[4]!==!1?m?m.p(g,p):(m=Ts(g),m.c(),m.m(o,l)):m&&(m.d(1),m=null)},d(g){g&&B(e),u&&u.d(),d&&d.d(),m&&m.d(),c=!1,Te(f)}}}function bs(i){let e,t,n,s,o=yt(i[21]),l=[];for(let r=0;r<o.length;r+=1)l[r]=ks(rs(i,o,r));return{c(){e=A("div"),t=A("select");for(let r=0;r<l.length;r+=1)l[r].c();a(t,"class","sy-assistant-select svelte-1r23oau"),i[22]===void 0&&an(()=>i[67].call(t)),a(e,"class","sy-assistant-scene-select svelte-1r23oau")},m(r,c){j(r,e,c),w(e,t);for(let f=0;f<l.length;f+=1)l[f]&&l[f].m(t,null);gi(t,i[22],!0),n||(s=U(t,"change",i[67]),n=!0)},p(r,c){if(c[0]&2097152){o=yt(r[21]);let f;for(f=0;f<o.length;f+=1){const u=rs(r,o,f);l[f]?l[f].p(u,c):(l[f]=ks(u),l[f].c(),l[f].m(t,null))}for(;f<l.length;f+=1)l[f].d(1);l.length=o.length}c[0]&6291456&&gi(t,r[22])},d(r){r&&B(e),di(l,r),n=!1,s()}}}function ks(i){let e,t=i[87].name+"",n,s,o;return{c(){e=A("option"),n=De(t),s=G(),e.__value=o=i[87].code,kt(e,e.__value)},m(l,r){j(l,e,r),w(e,n),w(e,s)},p(l,r){r[0]&2097152&&t!==(t=l[87].name+"")&&Ze(n,t),r[0]&2097152&&o!==(o=l[87].code)&&(e.__value=o,kt(e,e.__value))},d(l){l&&B(e)}}}function ys(i){let e;return{c(){e=A("div"),a(e,"class","sy-assistant-scene-select svelte-1r23oau")},m(t,n){j(t,e,n)},d(t){t&&B(e)}}}function Ts(i){let e,t,n;return{c(){e=A("button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8v4l3 3"></path><circle cx="12" cy="12" r="10"></circle></svg>',a(e,"class","sy-assistant-icon-button svelte-1r23oau"),a(e,"aria-label","历史会话")},m(s,o){j(s,e,o),t||(n=[U(e,"click",i[46]),U(e,"mouseenter",i[68]),U(e,"mouseleave",i[44])],t=!0)},p:W,d(s){s&&B(e),t=!1,Te(n)}}}function vs(i){let e,t=i[28].text+"",n;return{c(){e=A("div"),n=De(t),a(e,"class","sy-assistant-button-tooltip svelte-1r23oau"),N(e,"left",i[28].x+"px"),N(e,"top",i[28].y+"px")},m(s,o){j(s,e,o),w(e,n)},p(s,o){o[0]&268435456&&t!==(t=s[28].text+"")&&Ze(n,t),o[0]&268435456&&N(e,"left",s[28].x+"px"),o[0]&268435456&&N(e,"top",s[28].y+"px")},d(s){s&&B(e)}}}function kl(i){let e,t,n,s,o,l,r;const c=[dl,hl],f=[];function u(g,p){return g[29]?0:1}t=u(i),n=f[t]=c[t](i);let d=!i[29]&&ws(i),m=i[28]&&vs(i);return{c(){e=A("div"),n.c(),s=G(),d&&d.c(),o=G(),m&&m.c(),l=zt(),a(e,"class","sy-assistant-chat-container svelte-1r23oau"),N(e,"z-index",i[0]+2)},m(g,p){j(g,e,p),f[t].m(e,null),w(e,s),d&&d.m(e,null),j(g,o,p),m&&m.m(g,p),j(g,l,p),r=!0},p(g,p){let _=t;t=u(g),t===_?f[t].p(g,p):(Mn(),dt(f[_],1,1,()=>{f[_]=null}),Ln(),n=f[t],n?n.p(g,p):(n=f[t]=c[t](g),n.c()),et(n,1),n.m(e,s)),g[29]?d&&(d.d(1),d=null):d?d.p(g,p):(d=ws(g),d.c(),d.m(e,null)),(!r||p[0]&1)&&N(e,"z-index",g[0]+2),g[28]?m?m.p(g,p):(m=vs(g),m.c(),m.m(l.parentNode,l)):m&&(m.d(1),m=null)},i(g){r||(et(n),r=!0)},o(g){dt(n),r=!1},d(g){g&&(B(e),B(o),B(l)),f[t].d(),d&&d.d(),m&&m.d(g)}}}const Es=6e4,yn=2;function yl(i){const e=i.match(/source#\[(.*)\]#source/);return e?i.replace(`source#[${e[1]}]#source`,""):i}function Ss(i){const e=i.match(/source#\[(.*)\]#source/);if(e)try{return JSON.parse(`[${e[1]}]`)}catch(t){console.error("Failed to parse attachments:",t)}return null}function Ht(i,e,t,n){if(!i)return e;if(i.startsWith("data:image")||i.startsWith("data:image/svg+xml"))return`<img src="${i}" alt="图标" style="width: ${t||"100%"}; height: ${n||"100%"};" />`;if(i.includes("<svg")){let s=i;return t&&(s=s.replace(/width="[^"]*"/,`width="${t}"`)),n&&(s=s.replace(/height="[^"]*"/,`height="${n}"`)),s}return e}function Tn(i){const e=i.split(".");if(e.length>1){const t=e.pop()||"";return{name:e.join("."),ext:t?`.${t}`:""}}return{name:i,ext:""}}function Tl(i,e,t){let n,s,o;const l=mi();let r="",c=[{sessionId:"",requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],f="",u=null,d=null,m={x:0,y:0,alignRight:!1},g=null,p=!1,_=!1,y=null,I=0,T=null;ae.setOptions({breaks:!0,gfm:!0});function v(b){try{const O=ae(b);return Ki.sanitize(O)}catch(O){console.warn("Markdown parsing failed, fallback to HTML:",O);try{const $=b.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return Ki.sanitize($)}catch($){return console.error("HTML fallback failed:",$),b}}}let k;function x(b=!1){k&&k.scrollTo({top:k.scrollHeight,behavior:b?"smooth":"auto"})}Us(()=>{x(!1)});let{zIndex:R}=e,{sessionId:E}=e,{hasScene:L}=e,{apiPrefix:M}=e,{theme:Q="default"}=e,{showHistory:H=!0}=e,{showActions:z=!0}=e,{sendIcon:Z=""}=e,{robotIcon:oe=""}=e,{userIcon:le=""}=e,{maxInputLength:J=500}=e,{autoExpandTextarea:ce=!1}=e,{maxTextareaRows:Ye=6}=e,re=!1,me;function we(){ce&&(t(19,re=!0),de())}function nt(){ce&&(t(19,re=!1),me&&t(20,me.style.height="",me))}function de(){if(!ce||!re||!me)return;t(20,me.style.height="auto",me);const b=parseInt(getComputedStyle(me).lineHeight),O=b*3,$=b*Ye,ue=Math.min(Math.max(me.scrollHeight,O),$);t(20,me.style.height=`${ue}px`,me)}function Oe(){de()}let ee=[],Me="";function Ae(){return Ne(this,null,function*(){if(L)try{const b=yield fetch(`${M}/chat/getSceneList`,{headers:{"Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`}});if(!b.ok)throw new Error("Failed to fetch scenes");const O=yield b.json();O.code===0&&(t(21,ee=O.data.sceneList||[]),ee.length>0&&t(22,Me=ee[0].code))}catch(b){console.error("Failed to fetch scenes:",b)}})}In(()=>{Ae();const b=()=>{document.hidden&&p?console.warn("Page hidden during SSE streaming. Connection may be throttled."):!document.hidden&&p&&console.log("Page visible again during SSE streaming.")};return document.addEventListener("visibilitychange",b),()=>{document.removeEventListener("visibilitychange",b)}});function Xe(){return Ne(this,null,function*(){if(!r.trim()||o)return;if(!E){console.error("No session ID available");return}const b=Date.now().toString(),O=Date.now().toString()+Math.random().toString().slice(2,8),$={sessionId:E,requestId:O,id:b,type:"user",content:r.trim(),timestamp:Date.now()};t(13,c=[...c,$]);const ue=r.trim();t(10,r=""),ce&&me&&t(20,me.style.height="",me);const ye=(Date.now()+1).toString();I=0,T={sessionId:E,requestId:O,keyword:ue,assistantMessageId:ye},f="",t(13,c=[...c,{sessionId:E,requestId:O,id:ye,type:"assistant",content:"",timestamp:Date.now()}]),yield Le(E,O,ue,ye,!0)})}function Le(b,O,$,ue,ye=!1){return Ne(this,null,function*(){t(17,p=!0),_=!1,ye&&(console.log(`Retrying request (attempt ${I+1}/${yn})...`),f="",t(13,c=c.map(pe=>pe.id===ue?Ee(ne({},pe),{content:""}):pe))),u&&u.abort(),y&&(clearTimeout(y),y=null),u=new AbortController,y=setTimeout(()=>{p&&u&&(console.warn("SSE request timeout, aborting..."),u.abort(),I<yn&&T?(I++,setTimeout(()=>{T&&Le(T.sessionId,T.requestId,T.keyword,T.assistantMessageId,!0)},1e3)):(f=f||"请求超时,请稍后重试",t(13,c=c.map(pe=>pe.id===ue?Ee(ne({},pe),{content:f}):pe)),t(17,p=!1),T=null))},Es);try{yield so(`${M}/chat/sse`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({sessionId:b,requestId:O,keyword:$,flowId:"1",extendKeys:L?{sceneCode:Me}:void 0}),signal:u.signal,onmessage(pe){try{const te=pe.data;if(te){y&&(clearTimeout(y),y=setTimeout(()=>{p&&u&&(console.warn("SSE streaming timeout, aborting..."),u.abort(),t(17,p=!1))},Es)),_||(_=!0,l("firstResponse",{sessionId:b,requestId:O,content:te,timestamp:Date.now()}));const Mt=Ss(te);Mt?(t(13,c=c.map(ht=>ht.id===ue?Ee(ne({},ht),{attachments:Mt}):ht)),x(!0)):(f+=te,t(13,c=c.map(ht=>ht.id===ue?Ee(ne({},ht),{content:f}):ht)),x(!1))}}catch(te){console.error("Failed to process SSE message:",te)}},onerror(pe){throw f="请求异常,请重试",t(13,c=c.map(te=>te.id===ue?Ee(ne({},te),{content:f}):te)),x(!1),console.error("SSE error:",pe),u=null,t(17,p=!1),pe},onclose(){y&&(clearTimeout(y),y=null),u=null,t(17,p=!1),T=null,I=0}})}catch(pe){console.error("Failed to send message:",pe),y&&(clearTimeout(y),y=null),I<yn&&T&&!String(pe).includes("abort")?(I++,console.log(`Request failed, retrying (attempt ${I}/${yn})...`),setTimeout(()=>{T&&Le(T.sessionId,T.requestId,T.keyword,T.assistantMessageId,!0)},1e3)):(String(pe).includes("abort")||(f=f||"请求失败,请稍后重试",t(13,c=c.map(te=>te.id===ue?Ee(ne({},te),{content:f}):te))),t(17,p=!1),T=null,I=0)}})}function ct(b,O,$){const ue=$.getBoundingClientRect(),ye=k.getBoundingClientRect(),pe=ue.left<ye.width/2;t(14,d=O),t(15,m={x:ue.left,y:ue.top+ue.height/2,alignRight:pe})}function q(){t(16,g=setTimeout(()=>{t(14,d=null),t(16,g=null)},200))}Ws(()=>{u&&u.abort(),g&&clearTimeout(g),y&&clearTimeout(y)});function X(b,O){return Ne(this,null,function*(){try{const $=yield fetch(`${M}/file/downloadFile`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({fileName:b,fileUrl:O})});if(!$.ok)throw new Error("Download failed");const ue=$.headers.get("content-type")||"application/octet-stream",ye=yield $.blob(),pe=window.URL.createObjectURL(ye),te=document.createElement("a");te.href=pe,te.download=b,document.body.appendChild(te),te.click(),window.URL.revokeObjectURL(pe),document.body.removeChild(te)}catch($){console.error("Failed to download file:",$)}})}let ve={};function Ge(b,O){return Ne(this,null,function*(){try{const $=O.replace(/<br\s*\/?>/g,`
|
|
48
48
|
`).replace(/\*\*(.*?)\*\*/g,"$1").replace(/###/g,"").trim();yield navigator.clipboard.writeText($),t(23,ve[b]=!0,ve),setTimeout(()=>{t(23,ve[b]=!1,ve),t(23,ve)},1500)}catch($){console.error("Failed to copy:",$)}})}let he={},Pe={},Je=!1;function ut(b,O){return Ne(this,null,function*(){if(he[b]===O){t(24,he[b]=null,he),t(24,he);return}if(t(24,he[b]=O,he),t(24,he),O==="like")try{if(!(yield fetch(`${M}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({sessionId:E,requestId:b,feedBackFlag:"1",feedBackContent:"点赞"})})).ok)throw new Error("Feedback failed")}catch($){console.error("Failed to send feedback:",$),t(24,he[b]=null,he),t(24,he)}else t(26,Je=!0)})}function gt(b){return Ne(this,null,function*(){var O;if((O=Pe[b])!=null&&O.trim())try{if(!(yield fetch(`${M}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({sessionId:E,requestId:b,feedBackFlag:"0",feedBackContent:Pe[b]})})).ok)throw new Error("Feedback failed");t(26,Je=!1),t(25,Pe[b]="",Pe),t(25,Pe)}catch($){console.error("Failed to send feedback:",$),t(24,he[b]=null,he),t(24,he)}})}let mt={x:0,y:0};function It(b,O){const ue=b.currentTarget.getBoundingClientRect();t(27,mt={x:ue.left-290,y:ue.top-160}),ut(O,"dislike")}let Rt=null;function Ke(b,O){const ue=b.currentTarget.getBoundingClientRect();t(28,Rt={text:O,x:ue.left+ue.width/2,y:ue.top-8})}function ot(){t(28,Rt=null)}let ft=[],$e=!1;function D(){ot(),t(29,$e=!0)}function K(){ot(),t(29,$e=!1)}function _e(b){return Ne(this,null,function*(){if(!p){t(17,p=!0);try{const O=yield fetch(`${M}/chat/record/session/detail/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`},body:JSON.stringify({sessionId:b})});if(!O.ok)throw new Error("Failed to load sessions");const $=yield O.json();if($.code===0){l("updateSessionId",{sessionId:b}),t(29,$e=!1);const ue=$.data.map((ye,pe)=>{const te=Ss(ye.answer),Mt=yl(ye.answer);return[{sessionId:ye.sessionId,requestId:ye.requestId,id:(Date.now()+2*pe).toString(),type:"user",content:ye.keyword,timestamp:new Date(ye.createDate).getTime()},{sessionId:ye.sessionId,requestId:ye.requestId,id:(Date.now()+2*pe+1).toString(),type:"assistant",content:Mt,attachments:te,timestamp:new Date(ye.createDate).getTime()}]});t(13,c=ue.flat())}}catch(O){console.error("Failed to load sessions:",O)}finally{t(17,p=!1)}}})}function Ie(){return Ne(this,null,function*(){const b=yield He();if(!b){console.error("Failed to create new session");return}l("updateSessionId",{sessionId:b}),t(13,c=[{sessionId:b,requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}]),t(10,r="")})}function He(){return Ne(this,null,function*(){try{const b=yield fetch(`${M}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`}});if(!b.ok)throw new Error("Failed to get session ID");const O=yield b.json();if(O.code===0)return O.data.sessionId;throw new Error(O.message||"Failed to get session ID")}catch(b){return console.error("Failed to get session ID:",b),null}})}const Ce=(b,O)=>ct(O,b.tips,O.currentTarget),Be=b=>X(b.content_title,b.link),ze=()=>{g&&(clearTimeout(g),t(16,g=null))},it=()=>{t(14,d=null)},wt=b=>Ge(b.id,b.content),sn=(b,O)=>Ke(O,ve[b.id]?"已复制":"复制内容"),ei=b=>ut(b.id,"like"),Bt=(b,O)=>Ke(O,he[b.id]==="like"?"取消点赞":"点赞"),jt=(b,O)=>It(O,b.id),ti=(b,O)=>Ke(O,he[b.id]==="dislike"?"取消点踩":"点踩");function xt(b){Pe[b.id]=this.value,t(25,Pe)}const ni=b=>{t(26,Je=!1),t(24,he[b.id]=null,he),t(24,he)},ii=b=>gt(b.id);function Re(b){Ot[b?"unshift":"push"](()=>{k=b,t(18,k)})}function Tt(){Me=Hs(this),t(22,Me),t(21,ee)}const si=b=>Ke(b,"历史会话"),vn=b=>Ke(b,"新建会话");function on(b){Ot[b?"unshift":"push"](()=>{me=b,t(20,me)})}function En(){r=this.value,t(10,r)}const Sn=b=>b.key==="Enter"&&!b.shiftKey&&(Xe(),b.preventDefault()),oi=b=>Ke(b,"发送消息");return i.$$set=b=>{"zIndex"in b&&t(0,R=b.zIndex),"sessionId"in b&&t(50,E=b.sessionId),"hasScene"in b&&t(1,L=b.hasScene),"apiPrefix"in b&&t(2,M=b.apiPrefix),"theme"in b&&t(3,Q=b.theme),"showHistory"in b&&t(4,H=b.showHistory),"showActions"in b&&t(5,z=b.showActions),"sendIcon"in b&&t(6,Z=b.sendIcon),"robotIcon"in b&&t(7,oe=b.robotIcon),"userIcon"in b&&t(8,le=b.userIcon),"maxInputLength"in b&&t(51,J=b.maxInputLength),"autoExpandTextarea"in b&&t(9,ce=b.autoExpandTextarea),"maxTextareaRows"in b&&t(52,Ye=b.maxTextareaRows)},i.$$.update=()=>{i.$$.dirty[1]&1048576&&t(11,n=J),i.$$.dirty[0]&1024&&t(12,s=r.length),i.$$.dirty[0]&6144&&t(30,o=s>n)},[R,L,M,Q,H,z,Z,oe,le,ce,r,n,s,c,d,m,g,p,k,re,me,ee,Me,ve,he,Pe,Je,mt,Rt,$e,o,v,we,nt,Oe,Xe,ct,q,X,Ge,ut,gt,It,Ke,ot,ft,D,K,_e,Ie,E,J,Ye,Ce,Be,ze,it,wt,sn,ei,Bt,jt,ti,xt,ni,ii,Re,Tt,si,vn,on,En,Sn,oi]}class vl extends Dn{constructor(e){super(),zn(this,e,Tl,kl,Lt,{zIndex:0,sessionId:50,hasScene:1,apiPrefix:2,theme:3,showHistory:4,showActions:5,sendIcon:6,robotIcon:7,userIcon:8,maxInputLength:51,autoExpandTextarea:9,maxTextareaRows:52},null,[-1,-1,-1,-1])}}function As(i){let e,t,n,s,o=i[3].title+"",l,r,c,f,u,d,m,g,p,_=i[2]?"退出全屏":"全屏显示",y,I,T,v,k,x,R,E,L=i[8]?"取消吸附":"吸附到边缘",M,Q,H,z,Z,oe,le,J,ce,Ye=`${i[3].height}px`,re,me,we;function nt(q,X){return q[2]?Sl:El}let de=nt(i),Oe=de(i);function ee(q,X){return q[8]?Il:Al}let Me=ee(i),Ae=Me(i);const Xe=[xl,Rl],Le=[];function ct(q,X){return q[9]?0:1}return J=ct(i),ce=Le[J]=Xe[J](i),{c(){var q,X,ve;e=A("div"),t=A("div"),n=A("div"),s=A("h3"),l=De(o),r=G(),c=A("div"),f=A("div"),u=A("button"),d=Y("svg"),Oe.c(),g=G(),p=A("span"),y=De(_),I=G(),T=A("div"),v=A("button"),k=Y("svg"),Ae.c(),R=G(),E=A("span"),M=De(L),Q=G(),H=A("div"),z=A("button"),z.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',Z=G(),oe=A("span"),oe.textContent="关闭助手",le=G(),ce.c(),a(s,"class","svelte-1h7dpbq"),a(d,"xmlns","http://www.w3.org/2000/svg"),a(d,"width","18"),a(d,"height","18"),a(d,"viewBox","0 0 24 24"),a(d,"fill","none"),a(d,"stroke","currentColor"),a(d,"stroke-width","2"),a(d,"stroke-linecap","round"),a(d,"stroke-linejoin","round"),a(u,"class","sy-assistant-action-button svelte-1h7dpbq"),a(u,"aria-label",m=i[2]?"退出全屏":"全屏显示"),C(u,"active",i[2]),a(p,"class","sy-assistant-tooltip svelte-1h7dpbq"),N(p,"z-index",((q=i[3].zIndex)!=null?q:1e3)+3),a(f,"class","sy-assistant-tooltip-wrapper svelte-1h7dpbq"),a(k,"xmlns","http://www.w3.org/2000/svg"),a(k,"width","18"),a(k,"height","18"),a(k,"viewBox","0 0 24 24"),a(k,"fill","none"),a(k,"stroke","currentColor"),a(k,"stroke-width","2"),a(k,"stroke-linecap","round"),a(k,"stroke-linejoin","round"),a(v,"class","sy-assistant-action-button svelte-1h7dpbq"),a(v,"aria-label",x=i[8]?"取消吸附":"吸附到边缘"),C(v,"active",i[8]),a(E,"class","sy-assistant-tooltip svelte-1h7dpbq"),N(E,"z-index",((X=i[3].zIndex)!=null?X:1e3)+3),a(T,"class","sy-assistant-tooltip-wrapper svelte-1h7dpbq"),a(z,"class","sy-assistant-close-button svelte-1h7dpbq"),a(z,"aria-label","关闭助手"),a(oe,"class","sy-assistant-tooltip svelte-1h7dpbq"),N(oe,"z-index",((ve=i[3].zIndex)!=null?ve:1e3)+3),a(H,"class","sy-assistant-tooltip-wrapper svelte-1h7dpbq"),a(c,"class","sy-assistant-header-actions svelte-1h7dpbq"),a(n,"class","sy-assistant-drawer-header svelte-1h7dpbq"),a(n,"role","button"),a(n,"tabindex","0"),a(n,"aria-label","拖动助手窗口"),C(n,"dragging",i[6]),C(n,"fullscreen",i[2]),C(n,"snapped",i[8]),a(t,"class","sy-assistant-drawer-content svelte-1h7dpbq"),a(e,"class","sy-assistant-drawer svelte-1h7dpbq"),C(e,"fullscreen",i[2]),C(e,"screen-theme",i[3].theme==="screen"),N(e,"height",Ye)},m(q,X){j(q,e,X),w(e,t),w(t,n),w(n,s),w(s,l),w(n,r),w(n,c),w(c,f),w(f,u),w(u,d),Oe.m(d,null),w(f,g),w(f,p),w(p,y),w(c,I),w(c,T),w(T,v),w(v,k),Ae.m(k,null),w(T,R),w(T,E),w(E,M),w(c,Q),w(c,H),w(H,z),w(H,Z),w(H,oe),w(t,le),Le[J].m(t,null),re=!0,me||(we=[U(u,"click",i[18]),U(v,"click",i[20]),U(z,"click",i[17]),U(n,"mousedown",pi(i[19]))],me=!0)},p(q,X){var Ge,he,Pe;(!re||X[0]&8)&&o!==(o=q[3].title+"")&&Ze(l,o),de!==(de=nt(q))&&(Oe.d(1),Oe=de(q),Oe&&(Oe.c(),Oe.m(d,null))),(!re||X[0]&4&&m!==(m=q[2]?"退出全屏":"全屏显示"))&&a(u,"aria-label",m),(!re||X[0]&4)&&C(u,"active",q[2]),(!re||X[0]&4)&&_!==(_=q[2]?"退出全屏":"全屏显示")&&Ze(y,_),X[0]&8&&N(p,"z-index",((Ge=q[3].zIndex)!=null?Ge:1e3)+3),Me!==(Me=ee(q))&&(Ae.d(1),Ae=Me(q),Ae&&(Ae.c(),Ae.m(k,null))),(!re||X[0]&256&&x!==(x=q[8]?"取消吸附":"吸附到边缘"))&&a(v,"aria-label",x),(!re||X[0]&256)&&C(v,"active",q[8]),(!re||X[0]&256)&&L!==(L=q[8]?"取消吸附":"吸附到边缘")&&Ze(M,L),X[0]&8&&N(E,"z-index",((he=q[3].zIndex)!=null?he:1e3)+3),X[0]&8&&N(oe,"z-index",((Pe=q[3].zIndex)!=null?Pe:1e3)+3),(!re||X[0]&64)&&C(n,"dragging",q[6]),(!re||X[0]&4)&&C(n,"fullscreen",q[2]),(!re||X[0]&256)&&C(n,"snapped",q[8]);let ve=J;J=ct(q),J===ve?Le[J].p(q,X):(Mn(),dt(Le[ve],1,1,()=>{Le[ve]=null}),Ln(),ce=Le[J],ce?ce.p(q,X):(ce=Le[J]=Xe[J](q),ce.c()),et(ce,1),ce.m(t,null)),(!re||X[0]&4)&&C(e,"fullscreen",q[2]),(!re||X[0]&8)&&C(e,"screen-theme",q[3].theme==="screen"),X[0]&8&&Ye!==(Ye=`${q[3].height}px`)&&N(e,"height",Ye)},i(q){re||(et(ce),re=!0)},o(q){dt(ce),re=!1},d(q){q&&B(e),Oe.d(),Ae.d(),Le[J].d(),me=!1,Te(we)}}}function El(i){let e;return{c(){e=Y("path"),a(e,"d","M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3")},m(t,n){j(t,e,n)},d(t){t&&B(e)}}}function Sl(i){let e;return{c(){e=Y("path"),a(e,"d","M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3")},m(t,n){j(t,e,n)},d(t){t&&B(e)}}}function Al(i){let e,t;return{c(){e=Y("rect"),t=Y("line"),a(e,"x","3"),a(e,"y","3"),a(e,"width","18"),a(e,"height","18"),a(e,"rx","2"),a(e,"ry","2"),a(t,"x1","16"),a(t,"y1","6"),a(t,"x2","16"),a(t,"y2","18")},m(n,s){j(n,e,s),j(n,t,s)},d(n){n&&(B(e),B(t))}}}function Il(i){let e,t;return{c(){e=Y("rect"),t=Y("rect"),a(e,"x","3"),a(e,"y","3"),a(e,"width","18"),a(e,"height","18"),a(e,"rx","2"),a(e,"ry","2"),a(t,"x","12"),a(t,"y","10"),a(t,"width","6"),a(t,"height","8"),a(t,"rx","1"),a(t,"ry","1")},m(n,s){j(n,e,s),j(n,t,s)},d(n){n&&(B(e),B(t))}}}function Rl(i){var n,s,o,l,r,c,f,u,d,m,g,p;let e,t;return e=new vl({props:{zIndex:(n=i[3].zIndex)!=null?n:1e3,sessionId:i[10],hasScene:(s=i[3].hasScene)!=null?s:!1,apiPrefix:(o=i[3].apiPrefix)!=null?o:"/aiops/aigc",theme:(l=i[3].theme)!=null?l:"default",showHistory:(r=i[3].showHistory)!=null?r:!0,showActions:(c=i[3].showActions)!=null?c:!0,sendIcon:(f=i[3].sendIcon)!=null?f:"",robotIcon:(u=i[3].robotIcon)!=null?u:"",userIcon:(d=i[3].userIcon)!=null?d:"",maxInputLength:(m=i[3].maxInputLength)!=null?m:500,autoExpandTextarea:(g=i[3].autoExpandTextarea)!=null?g:!1,maxTextareaRows:(p=i[3].maxTextareaRows)!=null?p:6}}),e.$on("firstResponse",i[33]),e.$on("updateSessionId",i[34]),{c(){Cn(e.$$.fragment)},m(_,y){un(e,_,y),t=!0},p(_,y){var T,v,k,x,R,E,L,M,Q,H,z,Z;const I={};y[0]&8&&(I.zIndex=(T=_[3].zIndex)!=null?T:1e3),y[0]&1024&&(I.sessionId=_[10]),y[0]&8&&(I.hasScene=(v=_[3].hasScene)!=null?v:!1),y[0]&8&&(I.apiPrefix=(k=_[3].apiPrefix)!=null?k:"/aiops/aigc"),y[0]&8&&(I.theme=(x=_[3].theme)!=null?x:"default"),y[0]&8&&(I.showHistory=(R=_[3].showHistory)!=null?R:!0),y[0]&8&&(I.showActions=(E=_[3].showActions)!=null?E:!0),y[0]&8&&(I.sendIcon=(L=_[3].sendIcon)!=null?L:""),y[0]&8&&(I.robotIcon=(M=_[3].robotIcon)!=null?M:""),y[0]&8&&(I.userIcon=(Q=_[3].userIcon)!=null?Q:""),y[0]&8&&(I.maxInputLength=(H=_[3].maxInputLength)!=null?H:500),y[0]&8&&(I.autoExpandTextarea=(z=_[3].autoExpandTextarea)!=null?z:!1),y[0]&8&&(I.maxTextareaRows=(Z=_[3].maxTextareaRows)!=null?Z:6),e.$set(I)},i(_){t||(et(e.$$.fragment,_),t=!0)},o(_){dt(e.$$.fragment,_),t=!1},d(_){fn(e,_)}}}function xl(i){var n,s;let e,t;return e=new ls({props:{sessions:i[15],onClose:i[32],onSelect:Pl,zIndex:(n=i[3].zIndex)!=null?n:1e3,apiPrefix:(s=i[3].apiPrefix)!=null?s:"/aiops/aigc"}}),{c(){Cn(e.$$.fragment)},m(o,l){un(e,o,l),t=!0},p(o,l){var c,f;const r={};l[0]&512&&(r.onClose=o[32]),l[0]&8&&(r.zIndex=(c=o[3].zIndex)!=null?c:1e3),l[0]&8&&(r.apiPrefix=(f=o[3].apiPrefix)!=null?f:"/aiops/aigc"),e.$set(r)},i(o){t||(et(e.$$.fragment,o),t=!0)},o(o){dt(e.$$.fragment,o),t=!1},d(o){fn(e,o)}}}function Ml(i){let e,t,n,s,o,l,r,c,f,u;return{c(){e=Y("svg"),t=Y("path"),n=Y("path"),s=Y("path"),o=Y("path"),l=Y("path"),r=Y("path"),c=Y("path"),a(t,"d","M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z"),a(t,"fill","#6F8698"),a(n,"d","M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z"),a(n,"fill","#3677FF"),a(s,"d","M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z"),a(s,"fill","#D0D5F1"),a(o,"d","M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z"),a(o,"fill","#3677FF"),a(l,"d","M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(l,"fill","#FFFFFF"),a(r,"d","M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(r,"fill","#FFFFFF"),a(c,"d","M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z"),a(c,"fill","#8896A4"),a(e,"class","sy-assistant-icon"),a(e,"viewBox","0 0 1024 1024"),a(e,"version","1.1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width",f=i[3].isSelf?void 0:i[3].iconWidth),a(e,"height",u=i[3].isSelf?void 0:i[3].iconHeight),a(e,"fill","currentColor"),a(e,"aria-label","助手图标")},m(d,m){j(d,e,m),w(e,t),w(e,n),w(e,s),w(e,o),w(e,l),w(e,r),w(e,c)},p(d,m){m[0]&8&&f!==(f=d[3].isSelf?void 0:d[3].iconWidth)&&a(e,"width",f),m[0]&8&&u!==(u=d[3].isSelf?void 0:d[3].iconHeight)&&a(e,"height",u)},d(d){d&&B(e)}}}function Ll(i){let e,t,n;function s(r,c){return c[0]&8&&(e=null),c[0]&8&&(t=null),e==null&&(e=!!(r[3].icon.startsWith("data:image")||r[3].icon.startsWith("data:image/svg+xml"))),e?Dl:(t==null&&(t=!!r[3].icon.includes("<svg")),t?zl:Cl)}let o=s(i,[-1,-1,-1]),l=o(i);return{c(){l.c(),n=zt()},m(r,c){l.m(r,c),j(r,n,c)},p(r,c){o===(o=s(r,c))&&l?l.p(r,c):(l.d(1),l=o(r),l&&(l.c(),l.m(n.parentNode,n)))},d(r){r&&B(n),l.d(r)}}}function Cl(i){let e,t,n,s,o,l,r,c,f,u;return{c(){e=Y("svg"),t=Y("path"),n=Y("path"),s=Y("path"),o=Y("path"),l=Y("path"),r=Y("path"),c=Y("path"),a(t,"d","M896.512 698.88H132.608c-58.88 0-107.008-48.128-107.008-107.008v-10.24c0-58.88 48.128-107.008 107.008-107.008h763.904c58.88 0 107.008 48.128 107.008 107.008v10.24c0 58.88-48.128 107.008-107.008 107.008zM496.64 201.728h35.84v117.248h-35.84z"),a(t,"fill","#6F8698"),a(n,"d","M516.608 223.744h-4.608c-37.888 0-68.096-30.72-68.096-68.096v-6.656c0-37.888 30.72-68.096 68.096-68.096h4.608c37.888 0 68.096 30.72 68.096 68.096v6.656c0.512 37.888-30.208 68.096-68.096 68.096z"),a(n,"fill","#3677FF"),a(s,"d","M573.44 944.64H450.56c-181.248 0-327.68-146.432-327.68-327.68v-4.096c0-181.248 146.432-327.68 327.68-327.68h122.88c181.248 0 327.68 146.432 327.68 327.68v4.096c0 180.224-146.432 327.68-327.68 327.68z"),a(s,"fill","#D0D5F1"),a(o,"d","M681.984 715.264H347.136c-72.704 0-131.584-58.88-131.584-131.584s58.88-131.584 131.584-131.584h334.336c72.704 0 131.584 58.88 131.584 131.584 0.512 72.704-58.368 131.584-131.072 131.584z"),a(o,"fill","#3677FF"),a(l,"d","M286.72 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(l,"fill","#FFFFFF"),a(r,"d","M608.256 583.68a78.336 70.144 90 1 0 140.288 0 78.336 70.144 90 1 0-140.288 0Z"),a(r,"fill","#FFFFFF"),a(c,"d","M443.392 799.232s2.56 58.88 68.096 58.88c58.88 0 69.632-61.952 69.632-61.952s-27.136 33.28-68.096 33.28c-42.496 0-69.632-30.208-69.632-30.208z"),a(c,"fill","#8896A4"),a(e,"class","sy-assistant-icon"),a(e,"viewBox","0 0 1024 1024"),a(e,"version","1.1"),a(e,"xmlns","http://www.w3.org/2000/svg"),a(e,"width",f=i[3].isSelf?void 0:i[3].iconWidth),a(e,"height",u=i[3].isSelf?void 0:i[3].iconHeight),a(e,"fill","currentColor"),a(e,"aria-label","助手图标")},m(d,m){j(d,e,m),w(e,t),w(e,n),w(e,s),w(e,o),w(e,l),w(e,r),w(e,c)},p(d,m){m[0]&8&&f!==(f=d[3].isSelf?void 0:d[3].iconWidth)&&a(e,"width",f),m[0]&8&&u!==(u=d[3].isSelf?void 0:d[3].iconHeight)&&a(e,"height",u)},d(d){d&&B(e)}}}function zl(i){let e,t=(i[3].isSelf?i[3].icon:i[3].icon.replace(/width="[^"]*"/,`width="${i[3].iconWidth}"`).replace(/height="[^"]*"/,`height="${i[3].iconHeight}"`))+"",n;return{c(){e=new js(!1),n=zt(),e.a=n},m(s,o){e.m(t,s,o),j(s,n,o)},p(s,o){o[0]&8&&t!==(t=(s[3].isSelf?s[3].icon:s[3].icon.replace(/width="[^"]*"/,`width="${s[3].iconWidth}"`).replace(/height="[^"]*"/,`height="${s[3].iconHeight}"`))+"")&&e.p(t)},d(s){s&&(B(n),e.d())}}}function Dl(i){let e,t,n;return{c(){e=A("img"),lt(e.src,t=i[3].icon)||a(e,"src",t),a(e,"alt","助手图标"),a(e,"style",n=i[3].isSelf?"":`width: ${i[3].iconWidth}px; height: ${i[3].iconHeight}px;`)},m(s,o){j(s,e,o)},p(s,o){o[0]&8&&!lt(e.src,t=s[3].icon)&&a(e,"src",t),o[0]&8&&n!==(n=s[3].isSelf?"":`width: ${s[3].iconWidth}px; height: ${s[3].iconHeight}px;`)&&a(e,"style",n)},d(s){s&&B(e)}}}function Ol(i){let e,t,n=`${i[13]}px`,s,o,l,r,c,f,u=i[13]>0&&As(i);function d(p,_){return p[3].icon?Ll:Ml}let m=d(i),g=m(i);return{c(){var p,_;e=A("div"),t=A("div"),u&&u.c(),s=G(),o=A("button"),g.c(),a(t,"class","sy-assistant-drawer-wrapper svelte-1h7dpbq"),C(t,"fullscreen",i[2]),N(t,"width",n),a(o,"class","sy-assistant-floating-button svelte-1h7dpbq"),a(o,"aria-label","打开助手"),a(o,"style",l=i[11]+" z-index: "+(((p=i[3].zIndex)!=null?p:1e3)+1)+"; "+i[21]()),C(o,"isSelf",i[3].isSelf),C(o,"hidden-left",i[7]==="left"),C(o,"hidden-right",i[7]==="right"),C(o,"hidden-top",i[7]==="top"),C(o,"hidden-bottom",i[7]==="bottom"),a(e,"class","sy-assistant-container sy-assistant-theme svelte-1h7dpbq"),C(e,"fullscreen",i[2]),C(e,"snapped",i[8]),C(e,"screen-theme",i[3].theme==="screen"),N(e,"position",i[3].position),N(e,"right",i[8]?0:`${i[0]}px`),N(e,"bottom",i[8]?0:`${i[1]}px`),N(e,"top",i[8]||i[2]?"0":"auto"),N(e,"left",i[2]?"0":"auto"),N(e,"z-index",(_=i[3].zIndex)!=null?_:1e3)},m(p,_){j(p,e,_),w(e,t),u&&u.m(t,null),w(e,s),w(e,o),g.m(o,null),i[35](o),i[37](e),r=!0,c||(f=[U(o,"click",i[17]),U(o,"mousedown",pi(i[36])),U(o,"mouseenter",i[22]),U(o,"mouseleave",i[23])],c=!0)},p(p,_){var y,I;p[13]>0?u?(u.p(p,_),_[0]&8192&&et(u,1)):(u=As(p),u.c(),et(u,1),u.m(t,null)):u&&(Mn(),dt(u,1,1,()=>{u=null}),Ln()),(!r||_[0]&4)&&C(t,"fullscreen",p[2]),_[0]&8192&&n!==(n=`${p[13]}px`)&&N(t,"width",n),m===(m=d(p))&&g?g.p(p,_):(g.d(1),g=m(p),g&&(g.c(),g.m(o,null))),(!r||_[0]&2056&&l!==(l=p[11]+" z-index: "+(((y=p[3].zIndex)!=null?y:1e3)+1)+"; "+p[21]()))&&a(o,"style",l),(!r||_[0]&8)&&C(o,"isSelf",p[3].isSelf),(!r||_[0]&128)&&C(o,"hidden-left",p[7]==="left"),(!r||_[0]&128)&&C(o,"hidden-right",p[7]==="right"),(!r||_[0]&128)&&C(o,"hidden-top",p[7]==="top"),(!r||_[0]&128)&&C(o,"hidden-bottom",p[7]==="bottom"),(!r||_[0]&4)&&C(e,"fullscreen",p[2]),(!r||_[0]&256)&&C(e,"snapped",p[8]),(!r||_[0]&8)&&C(e,"screen-theme",p[3].theme==="screen"),_[0]&8&&N(e,"position",p[3].position),_[0]&257&&N(e,"right",p[8]?0:`${p[0]}px`),_[0]&258&&N(e,"bottom",p[8]?0:`${p[1]}px`),_[0]&260&&N(e,"top",p[8]||p[2]?"0":"auto"),_[0]&4&&N(e,"left",p[2]?"0":"auto"),_[0]&8&&N(e,"z-index",(I=p[3].zIndex)!=null?I:1e3)},i(p){r||(et(u),r=!0)},o(p){dt(u),r=!1},d(p){p&&B(e),u&&u.d(),g.d(),i[35](null),i[37](null),c=!1,Te(f)}}}const Is=48,ke=20;function Pl(i){}function Fl(i,e,t){let n,s,o,l,r=W,c=()=>(r(),r=Ps(s,D=>t(13,l=D)),s);i.$$.on_destroy.push(()=>r());const f=mi(),u={position:"fixed",width:480,height:800,title:"智慧运维助手",initialState:"default",defaultPosition:{right:ke,bottom:ke},snappedWidth:480,drawerWidth:480,zIndex:1e3,hasScene:!1,apiPrefix:"/aiops/aigc",isSelf:!1,icon:"",iconWidth:void 0,iconHeight:void 0,theme:"default",showHistory:!0,showActions:!0,sendIcon:"",robotIcon:"",userIcon:"",hideEnabled:!1,hideDelay:5e3,maxInputLength:500,autoExpandTextarea:!1,maxTextareaRows:6};let{target:d="body"}=e,{options:m={}}=e,g,p=null,_=!1,y,I=!1,T=0,v=0,k=ke,x=20,R=k,E=x,L=!1,M=ke,Q=50,H=!1,z=!1,Z=null,oe=null,le="",J={left:"auto",right:`${ke}px`,top:"auto",bottom:"50%"},ce=!1,Ye={width:0},re=!1,me=!1,we=[],nt=null;function de(){return Ne(this,null,function*(){try{const D=yield fetch(`${n.apiPrefix}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${Se()}`,Authorization:`bearer ${Se()}`}});if(!D.ok)throw new Error("Failed to get session ID");const K=yield D.json();if(K.code===0)return t(10,nt=K.data.sessionId),nt;throw new Error(K.message||"Failed to get session ID")}catch(D){return console.error("Failed to get session ID:",D),null}})}function Oe(D,K=!1){K?t(27,L=!0):t(6,I=!0),T=D.clientX,v=D.clientY,k=K?M:R,x=K?Q:E,D.preventDefault()}function ee(D){if(!I&&!L)return;const K=T-D.clientX,_e=v-D.clientY;if(L){const Ie=k+K,He=D.clientY,Ce=mt();t(28,M=Math.max(ke,Math.min(window.innerWidth-Ce-ke,Ie)));const Be=window.innerHeight-Ce-ke,it=Math.max(ke,Math.min(Be,He));Q=(window.innerHeight-it-Ce)/window.innerHeight*100,t(31,J={left:"auto",right:`${M}px`,top:"auto",bottom:`${Q}%`}),t(30,le=""),t(7,oe=null)}else{const Ie=n.width||0,He=n.height||0,Ce=k+K;t(0,R=Math.max(ke,Math.min(window.innerWidth-Ie-ke,Ce)));const Be=x+_e;t(1,E=Math.max(ke,Math.min(window.innerHeight-He-ke,Be)))}}function Me(){const D=L;t(6,I=!1),t(27,L=!1),D&&n.hideEnabled&&!_&&!H&&Ae()}function Ae(){!n.hideEnabled||_||H||(Xe(),Z=setTimeout(()=>{ct()},n.hideDelay))}function Xe(){Z&&(clearTimeout(Z),Z=null)}function Le(){const D=window.innerWidth,K=window.innerHeight,_e=mt(),Ie=D-M-_e,He=K-Q/100*K-_e,Ce=Ie,Be=D-Ie-_e,ze=He,it=K-He-_e,wt=Math.min(Ce,Be,ze,it);return wt===Ce?{direction:"left",position:{left:`${-_e/2}px`,right:"auto",top:`${He}px`,bottom:"auto"},transform:"rotate(45deg) scale(0.8)"}:wt===Be?{direction:"right",position:{left:"auto",right:`${-_e/2}px`,top:`${He}px`,bottom:"auto"},transform:"rotate(-45deg) scale(0.8)"}:wt===ze?{direction:"top",position:{left:`${Ie}px`,right:"auto",top:`${-_e/2}px`,bottom:"auto"},transform:"rotate(180deg) scale(0.7)"}:{direction:"bottom",position:{left:`${Ie}px`,right:"auto",top:"auto",bottom:`${-_e/2}px`},transform:"scale(0.7)"}}function ct(){if(_||H)return;const D=Le();t(7,oe=D.direction),t(31,J=D.position),t(30,le=D.transform),z=!0}function q(){z&&(t(7,oe=null),t(31,J={left:"auto",right:`${M}px`,top:"auto",bottom:`${Q}%`}),t(30,le=""),z=!1)}In(()=>{typeof d=="string"?p=document.querySelector(d)||document.body:p=d||document.body;const D=_e=>ee(_e),K=()=>Me();return document.addEventListener("mousemove",D),document.addEventListener("mouseup",K),g&&p&&p.appendChild(g),y&&y.getBoundingClientRect().left,t(8,re=n.initialState==="snapped"),t(2,ce=n.initialState==="fullscreen"),n.initialState==="snapped"?(t(0,R=0),t(1,E=0),t(3,n=Ee(ne({},n),{height:typeof window!="undefined"?window.innerHeight:n.height,width:n.snappedWidth||n.width}))):n.initialState==="fullscreen"&&(t(0,R=0),t(1,E=0),t(3,n=Ee(ne({},n),{width:typeof window!="undefined"?window.innerWidth:n.width,height:typeof window!="undefined"?window.innerHeight:n.height}))),n.hideEnabled&&Ae(),()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",K),Xe(),p&&g&&p.removeChild(g)}});function X(){return Ne(this,null,function*(){_?n.hideEnabled&&Ae():(yield de(),Xe(),z&&q()),t(26,_=!_)})}function ve(){var D,K,_e,Ie,He,Ce,Be,ze;t(2,ce=!ce),ce?(Ye.width||(Ye={width:u.width,height:u.height,right:(K=(D=u.defaultPosition)==null?void 0:D.right)!=null?K:ke,bottom:(Ie=(_e=u.defaultPosition)==null?void 0:_e.bottom)!=null?Ie:ke}),re&&t(8,re=!1),t(24,m=Ee(ne({},n),{width:window.innerWidth,height:window.innerHeight,drawerWidth:window.innerWidth})),t(0,R=0),t(1,E=0)):(t(24,m=Ee(ne({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,R=(Ce=(He=u.defaultPosition)==null?void 0:He.right)!=null?Ce:ke),t(1,E=(ze=(Be=u.defaultPosition)==null?void 0:Be.bottom)!=null?ze:ke))}function Ge(D){ce||Oe(D)}function he(){var D,K,_e,Ie;ce&&(t(2,ce=!1),t(24,m=Ee(ne({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth}))),t(8,re=!re),re?(n.height,t(0,R=0),t(1,E=0),t(24,m=Ee(ne({},n),{height:window.innerHeight,width:n.snappedWidth||u.width,drawerWidth:n.snappedWidth||u.width}))):(t(24,m=Ee(ne({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,R=(K=(D=u.defaultPosition)==null?void 0:D.right)!=null?K:ke),t(1,E=(Ie=(_e=u.defaultPosition)==null?void 0:_e.bottom)!=null?Ie:ke))}function Pe(){return n.isSelf?n.iconWidth!==void 0&&n.iconHeight!==void 0?`width: ${n.iconWidth}px; height: ${n.iconHeight}px;`:"":n.iconWidth!==void 0&&n.iconHeight!==void 0?`width: ${n.iconWidth}px; height: ${n.iconHeight}px;`:"width: 48px; height: 48px;"}function Je(){t(29,H=!0),Xe(),z&&q()}function ut(){t(29,H=!1),n.hideEnabled&&!_&&Ae()}function gt(){if(n.isSelf&&y){const D=y.querySelector("img, svg");if(D){const K=D.getBoundingClientRect();if(K.width>0&&K.height>0)return{width:K.width,height:K.height}}}return n.iconWidth&&n.iconHeight?{width:n.iconWidth,height:n.iconHeight}:{width:Is,height:Is}}function mt(){const{width:D,height:K}=gt();return Math.max(D,K)}const It=()=>t(9,me=!1),Rt=D=>f("firstResponse",D.detail),Ke=D=>{t(10,nt=D.detail.sessionId)};function ot(D){Ot[D?"unshift":"push"](()=>{y=D,t(5,y)})}const ft=D=>Oe(D,!0);function $e(D){Ot[D?"unshift":"push"](()=>{g=D,t(4,g)})}return i.$$set=D=>{"target"in D&&t(25,d=D.target),"options"in D&&t(24,m=D.options)},i.$$.update=()=>{if(i.$$.dirty[0]&16777216&&t(3,n=Ee(ne(ne({},u),m),{defaultPosition:ne(ne({},u.defaultPosition),m.defaultPosition)})),i.$$.dirty[0]&67108876&&c(t(12,s=Js(_?ce?window.innerWidth:n.drawerWidth:0,{stiffness:.1,damping:.6}))),i.$$.dirty[0]&268435467&&typeof window!="undefined"){t(0,R=Math.max(ke,Math.min(window.innerWidth-(n.width||0),R))),t(1,E=Math.max(ke,Math.min(window.innerHeight-(n.height||0),E)));const D=mt();t(28,M=Math.max(ke,Math.min(window.innerWidth-D-ke,M)))}i.$$.dirty[0]&603979784&&(n.hideEnabled&&!_&&!H?Ae():Xe()),i.$$.dirty[0]&1275068416|i.$$.dirty[1]&1&&t(11,o=_?"display: none;":`position: fixed; left: ${J.left}; right: ${J.right}; top: ${J.top}; bottom: ${J.bottom}; transform: ${le}; cursor: ${L?"grabbing":"grab"};`)},[R,E,ce,n,g,y,I,oe,re,me,nt,o,s,l,f,we,Oe,X,ve,Ge,he,Pe,Je,ut,m,d,_,L,M,H,le,J,It,Rt,Ke,ot,ft,$e]}class Nl extends Dn{constructor(e){super(),zn(this,e,Fl,Ol,Lt,{target:25,options:24},null,[-1,-1,-1])}}se.SyAssistant=Nl,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})});
|