@sy-design/svelte 1.0.13 → 1.0.14

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.umd.js CHANGED
@@ -1,37 +1,37 @@
1
- (function($,U){typeof exports=="object"&&typeof module!="undefined"?U(exports):typeof define=="function"&&define.amd?define(["exports"],U):($=typeof globalThis!="undefined"?globalThis:$||self,U($["@sy-design/svelte"]=$["@sy-design/svelte"]||{}))})(this,function($){"use strict";var Tl=Object.defineProperty,vl=Object.defineProperties;var El=Object.getOwnPropertyDescriptors;var bi=Object.getOwnPropertySymbols;var Sl=Object.prototype.hasOwnProperty,Al=Object.prototype.propertyIsEnumerable;var yi=$=>{throw TypeError($)};var Yn=($,U,ue)=>U in $?Tl($,U,{enumerable:!0,configurable:!0,writable:!0,value:ue}):$[U]=ue,le=($,U)=>{for(var ue in U||(U={}))Sl.call(U,ue)&&Yn($,ue,U[ue]);if(bi)for(var ue of bi(U))Al.call(U,ue)&&Yn($,ue,U[ue]);return $},Ae=($,U)=>vl($,El(U));var ce=($,U,ue)=>Yn($,typeof U!="symbol"?U+"":U,ue),xl=($,U,ue)=>U.has($)||yi("Cannot "+ue);var Ti=($,U,ue)=>U.has($)?yi("Cannot add the same private member more than once"):U instanceof WeakSet?U.add($):U.set($,ue);var pn=($,U,ue)=>(xl($,U,"access private method"),ue);var Re=($,U,ue)=>new Promise((Wt,_e)=>{var St=Je=>{try{At(ue.next(Je))}catch(dt){_e(dt)}},pt=Je=>{try{At(ue.throw(Je))}catch(dt){_e(dt)}},At=Je=>Je.done?Wt(Je.value):Promise.resolve(Je.value).then(St,pt);At((ue=ue.apply($,U)).next())});var ft,Zn,vi;function U(){}function ue(s){return s()}function Wt(){return Object.create(null)}function _e(s){s.forEach(ue)}function St(s){return typeof s=="function"}function pt(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}function At(s){return Object.keys(s).length===0}function Je(s,...e){if(s==null){for(const n of e)n(void 0);return U}const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const dt=typeof window!="undefined";let Xn=dt?()=>window.performance.now():()=>Date.now(),Vn=dt?s=>requestAnimationFrame(s):U;const gt=new Set;function Qn(s){gt.forEach(e=>{e.c(s)||(gt.delete(e),e.f())}),gt.size!==0&&Vn(Qn)}function Ei(s){let e;return gt.size===0&&Vn(Qn),{promise:new Promise(t=>{gt.add(e={c:s,f:t})}),abort(){gt.delete(e)}}}function g(s,e){s.appendChild(e)}function G(s,e,t){s.insertBefore(e,t||null)}function W(s){s.parentNode&&s.parentNode.removeChild(s)}function Jn(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function S(s){return document.createElement(s)}function J(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Te(s){return document.createTextNode(s)}function q(){return Te(" ")}function qt(){return Te("")}function Y(s,e,t,n){return s.addEventListener(e,t,n),()=>s.removeEventListener(e,t,n)}function Kn(s){return function(e){return e.preventDefault(),s.call(this,e)}}function a(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function Si(s){return Array.from(s.childNodes)}function Pe(s,e){e=""+e,s.data!==e&&(s.data=e)}function nt(s,e){s.value=e==null?"":e}function P(s,e,t,n){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,"")}function $n(s,e,t){for(let n=0;n<s.options.length;n+=1){const i=s.options[n];if(i.__value===e){i.selected=!0;return}}(!t||e!==void 0)&&(s.selectedIndex=-1)}function Ai(s){const e=s.querySelector(":checked");return e&&e.__value}function K(s,e,t){s.classList.toggle(e,!!t)}let xt;function It(s){xt=s}function dn(){if(!xt)throw new Error("Function called outside component initialization");return xt}function gn(s){dn().$$.on_mount.push(s)}function xi(s){dn().$$.after_update.push(s)}function Ii(s){dn().$$.on_destroy.push(s)}const mt=[],_t=[];let kt=[];const es=[],Ri=Promise.resolve();let mn=!1;function Ci(){mn||(mn=!0,Ri.then(ts))}function Gt(s){kt.push(s)}const _n=new Set;let wt=0;function ts(){if(wt!==0)return;const s=xt;do{try{for(;wt<mt.length;){const e=mt[wt];wt++,It(e),Li(e.$$)}}catch(e){throw mt.length=0,wt=0,e}for(It(null),mt.length=0,wt=0;_t.length;)_t.pop()();for(let e=0;e<kt.length;e+=1){const t=kt[e];_n.has(t)||(_n.add(t),t())}kt.length=0}while(mt.length);for(;es.length;)es.pop()();mn=!1,_n.clear(),It(s)}function Li(s){if(s.fragment!==null){s.update(),_e(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(Gt)}}function Mi(s){const e=[],t=[];kt.forEach(n=>s.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),kt=e}const Yt=new Set;let rt;function kn(){rt={r:0,c:[],p:rt}}function wn(){rt.r||_e(rt.c),rt=rt.p}function Ue(s,e){s&&s.i&&(Yt.delete(s),s.i(e))}function Ke(s,e,t,n){if(s&&s.o){if(Yt.has(s))return;Yt.add(s),rt.c.push(()=>{Yt.delete(s),n&&(t&&s.d(1),n())}),s.o(e)}else n&&n()}function st(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function ns(s,e){s.d(1),e.delete(s.key)}function ss(s,e,t,n,i,l,o,r,c,u,h,p){let d=s.length,m=l.length,_=d;const E={};for(;_--;)E[s[_].key]=_;const I=[],z=new Map,x=new Map,w=[];for(_=m;_--;){const R=p(i,l,_),L=t(R);let C=o.get(L);C?w.push(()=>C.p(R,e)):(C=u(L,R),C.c()),z.set(L,I[_]=C),L in E&&x.set(L,Math.abs(_-E[L]))}const k=new Set,b=new Set;function v(R){Ue(R,1),R.m(r,h),o.set(R.key,R),h=R.first,m--}for(;d&&m;){const R=I[m-1],L=s[d-1],C=R.key,X=L.key;R===L?(h=R.first,d--,m--):z.has(X)?!o.has(C)||k.has(C)?v(R):b.has(X)?d--:x.get(C)>x.get(X)?(b.add(C),v(R)):(k.add(X),d--):(c(L,o),d--)}for(;d--;){const R=s[d];z.has(R.key)||c(R,o)}for(;m;)v(I[m-1]);return _e(w),I}function bn(s){s&&s.c()}function Zt(s,e,t){const{fragment:n,after_update:i}=s.$$;n&&n.m(e,t),Gt(()=>{const l=s.$$.on_mount.map(ue).filter(St);s.$$.on_destroy?s.$$.on_destroy.push(...l):_e(l),s.$$.on_mount=[]}),i.forEach(Gt)}function Xt(s,e){const t=s.$$;t.fragment!==null&&(Mi(t.after_update),_e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function zi(s,e){s.$$.dirty[0]===-1&&(mt.push(s),Ci(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function yn(s,e,t,n,i,l,o=null,r=[-1]){const c=xt;It(s);const u=s.$$={fragment:null,ctx:[],props:l,update:U,not_equal:i,bound:Wt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Wt(),dirty:r,skip_bound:!1,root:e.target||c.$$.root};o&&o(u.root);let h=!1;if(u.ctx=t?t(s,e.props||{},(p,d,...m)=>{const _=m.length?m[0]:d;return u.ctx&&i(u.ctx[p],u.ctx[p]=_)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](_),h&&zi(s,p)),d}):[],u.update(),h=!0,_e(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const p=Si(e.target);u.fragment&&u.fragment.l(p),p.forEach(W)}else u.fragment&&u.fragment.c();e.intro&&Ue(s.$$.fragment),Zt(s,e.target,e.anchor),ts()}It(c)}class Tn{constructor(){ce(this,"$$");ce(this,"$$set")}$destroy(){Xt(this,1),this.$destroy=U}$on(e,t){if(!St(t))return U;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!At(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Oi="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Oi);const bt=[];function Di(s,e=U){let t;const n=new Set;function i(r){if(pt(s,r)&&(s=r,t)){const c=!bt.length;for(const u of n)u[1](),bt.push(u,s);if(c){for(let u=0;u<bt.length;u+=2)bt[u][0](bt[u+1]);bt.length=0}}}function l(r){i(r(s))}function o(r,c=U){const u=[r,c];return n.add(u),n.size===1&&(t=e(i,l)||U),r(s),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:i,update:l,subscribe:o}}function is(s){return Object.prototype.toString.call(s)==="[object Date]"}function vn(s,e,t,n){if(typeof t=="number"||is(t)){const i=n-t,l=(t-e)/(s.dt||1/60),o=s.opts.stiffness*i,r=s.opts.damping*l,c=(o-r)*s.inv_mass,u=(l+c)*s.dt;return Math.abs(u)<s.opts.precision&&Math.abs(i)<s.opts.precision?n:(s.settled=!1,is(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((i,l)=>vn(s,e[l],t[l],n[l]));if(typeof t=="object"){const i={};for(const l in t)i[l]=vn(s,e[l],t[l],n[l]);return i}else throw new Error(`Cannot spring ${typeof t} values`)}}function Ni(s,e={}){const t=Di(s),{stiffness:n=.15,damping:i=.8,precision:l=.01}=e;let o,r,c,u=s,h=s,p=1,d=0,m=!1;function _(I,z={}){h=I;const x=c={};return s==null||z.hard||E.stiffness>=1&&E.damping>=1?(m=!0,o=Xn(),u=I,t.set(s=h),Promise.resolve()):(z.soft&&(d=1/((z.soft===!0?.5:+z.soft)*60),p=0),r||(o=Xn(),m=!1,r=Ei(w=>{if(m)return m=!1,r=null,!1;p=Math.min(p+d,1);const k={inv_mass:p,opts:E,settled:!0,dt:(w-o)*60/1e3},b=vn(k,u,s,h);return o=w,u=s,t.set(s=b),k.settled&&(r=null),!k.settled})),new Promise(w=>{r.promise.then(()=>{x===c&&w()})}))}const E={set:_,update:(I,z)=>_(I(h,s),z),subscribe:t.subscribe,stiffness:n,damping:i,precision:l};return E}function Pi(s,e){return Re(this,null,function*(){const t=s.getReader();let n;for(;!(n=yield t.read()).done;)e(n.value)})}function Fi(s){let e,t,n,i=!1;return function(o){e===void 0?(e=o,t=0,n=-1):e=Bi(e,o);const r=e.length;let c=0;for(;t<r;){i&&(e[t]===10&&(c=++t),i=!1);let u=-1;for(;t<r&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:i=!0;case 10:u=t;break}if(u===-1)break;s(e.subarray(c,u),n),c=t,n=-1}c===r?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Hi(s,e,t){let n=os();const i=new TextDecoder;return function(o,r){if(o.length===0)t==null||t(n),n=os();else if(r>0){const c=i.decode(o.subarray(0,r)),u=r+(o[r+1]===32?2:1),h=i.decode(o.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
2
- `+h:h;break;case"event":n.event=h;break;case"id":s(n.id=h);break;case"retry":const p=parseInt(h,10);isNaN(p)||e(n.retry=p);break}}}}function Bi(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function os(){return{data:"",event:"",id:"",retry:void 0}}var ji=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(s);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(s,n[i])&&(t[n[i]]=s[n[i]]);return t};const En="text/event-stream",Ui=1e3,ls="last-event-id";function Wi(s,e){var{signal:t,headers:n,onopen:i,onmessage:l,onclose:o,onerror:r,openWhenHidden:c,fetch:u}=e,h=ji(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,d)=>{const m=Object.assign({},n);m.accept||(m.accept=En);let _;function E(){_.abort(),document.hidden||b()}c||document.addEventListener("visibilitychange",E);let I=Ui,z=0;function x(){document.removeEventListener("visibilitychange",E),window.clearTimeout(z),_.abort()}t==null||t.addEventListener("abort",()=>{x(),p()});const w=u!=null?u:window.fetch,k=i!=null?i:qi;function b(){return Re(this,null,function*(){var v;_=new AbortController;try{const R=yield w(s,Object.assign(Object.assign({},h),{headers:m,signal:_.signal}));yield k(R),yield Pi(R.body,Fi(Hi(L=>{L?m[ls]=L:delete m[ls]},L=>{I=L},l))),o==null||o(),x(),p()}catch(R){if(!_.signal.aborted)try{const L=(v=r==null?void 0:r(R))!==null&&v!==void 0?v:I;window.clearTimeout(z),z=window.setTimeout(b,L)}catch(L){x(),d(L)}}})}b()})}function qi(s){const e=s.headers.get("content-type");if(!(e!=null&&e.startsWith(En)))throw new Error(`Expected content-type to be ${En}, Actual: ${e}`)}function Sn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let at=Sn();function rs(s){at=s}const as=/[&<>"']/,Gi=new RegExp(as.source,"g"),cs=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Yi=new RegExp(cs.source,"g"),Zi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},us=s=>Zi[s];function Fe(s,e){if(e){if(as.test(s))return s.replace(Gi,us)}else if(cs.test(s))return s.replace(Yi,us);return s}const Xi=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Vi(s){return s.replace(Xi,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Qi=/(^|[^\[])\^/g;function se(s,e){let t=typeof s=="string"?s:s.source;e=e||"";const n={replace:(i,l)=>{let o=typeof l=="string"?l:l.source;return o=o.replace(Qi,"$1"),t=t.replace(i,o),n},getRegex:()=>new RegExp(t,e)};return n}function fs(s){try{s=encodeURI(s).replace(/%25/g,"%")}catch(e){return null}return s}const Rt={exec:()=>null};function hs(s,e){const t=s.replace(/\|/g,(l,o,r)=>{let c=!1,u=o;for(;--u>=0&&r[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function Vt(s,e,t){const n=s.length;if(n===0)return"";let i=0;for(;i<n;){const l=s.charAt(n-i-1);if(l===e&&!t)i++;else if(l!==e&&t)i++;else break}return s.slice(0,n-i)}function Ji(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return-1}function ps(s,e,t,n){const i=e.href,l=e.title?Fe(e.title):null,o=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const r={type:"link",raw:t,href:i,title:l,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,r}return{type:"image",raw:t,href:i,title:l,text:Fe(o)}}function Ki(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
3
- `).map(i=>{const l=i.match(/^\s+/);if(l===null)return i;const[o]=l;return o.length>=n.length?i.slice(n.length):i}).join(`
4
- `)}class Qt{constructor(e){ce(this,"options");ce(this,"rules");ce(this,"lexer");this.options=e||at}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Vt(n,`
5
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=Ki(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=Vt(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=Vt(t[0].replace(/^ *>[ \t]?/gm,""),`
6
- `),i=this.lexer.state.top;this.lexer.state.top=!0;const l=this.lexer.blockTokens(n);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:l,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,l={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let r="",c="",u=!1;for(;e;){let h=!1;if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let p=t[2].split(`
7
- `,1)[0].replace(/^\t+/,z=>" ".repeat(3*z.length)),d=e.split(`
8
- `,1)[0],m=0;this.options.pedantic?(m=2,c=p.trimStart()):(m=t[2].search(/[^ ]/),m=m>4?1:m,c=p.slice(m),m+=t[1].length);let _=!1;if(!p&&/^ *$/.test(d)&&(r+=d+`
9
- `,e=e.substring(d.length+1),h=!0),!h){const z=new RegExp(`^ {0,${Math.min(3,m-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),x=new RegExp(`^ {0,${Math.min(3,m-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,m-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,m-1)}}#`);for(;e;){const b=e.split(`
10
- `,1)[0];if(d=b,this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(d)||k.test(d)||z.test(d)||x.test(e))break;if(d.search(/[^ ]/)>=m||!d.trim())c+=`
11
- `+d.slice(m);else{if(_||p.search(/[^ ]/)>=4||w.test(p)||k.test(p)||x.test(p))break;c+=`
12
- `+d}!_&&!d.trim()&&(_=!0),r+=b+`
13
- `,e=e.substring(b.length+1),p=d.slice(m)}}l.loose||(u?l.loose=!0:/\n *\n *$/.test(r)&&(u=!0));let E=null,I;this.options.gfm&&(E=/^\[[ xX]\] /.exec(c),E&&(I=E[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),l.items.push({type:"list_item",raw:r,task:!!E,checked:I,loose:!1,text:c,tokens:[]}),l.raw+=r}l.items[l.items.length-1].raw=r.trimEnd(),l.items[l.items.length-1].text=c.trimEnd(),l.raw=l.raw.trimEnd();for(let h=0;h<l.items.length;h++)if(this.lexer.state.top=!1,l.items[h].tokens=this.lexer.blockTokens(l.items[h].text,[]),!l.loose){const p=l.items[h].tokens.filter(m=>m.type==="space"),d=p.length>0&&p.some(m=>/\n.*\n/.test(m.raw));l.loose=d}if(l.loose)for(let h=0;h<l.items.length;h++)l.items[h].loose=!0;return l}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:l}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=hs(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),l=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
14
- `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const r of i)/^ *-+: *$/.test(r)?o.align.push("right"):/^ *:-+: *$/.test(r)?o.align.push("center"):/^ *:-+ *$/.test(r)?o.align.push("left"):o.align.push(null);for(const r of n)o.header.push({text:r,tokens:this.lexer.inline(r)});for(const r of l)o.rows.push(hs(r,o.header.length).map(c=>({text:c,tokens:this.lexer.inline(c)})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
15
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Fe(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const o=Vt(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Ji(t[2],"()");if(o>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let i=t[2],l="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);o&&(i=o[1],l=o[3])}else l=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),ps(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(/\s+/g," "),l=t[i.toLowerCase()];if(!l){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return ps(n,l,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...i[0]].length-1;let r,c,u=o,h=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+o);(i=p.exec(t))!=null;){if(r=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!r)continue;if(c=[...r].length,i[3]||i[4]){u+=c;continue}else if((i[5]||i[6])&&o%3&&!((o+c)%3)){h+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+h);const d=[...i[0]][0].length,m=e.slice(0,o+i.index+d+c);if(Math.min(o,c)%2){const E=m.slice(1,-1);return{type:"em",raw:m,text:E,tokens:this.lexer.inlineTokens(E)}}const _=m.slice(2,-2);return{type:"strong",raw:m,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),l=/^ /.test(n)&&/ $/.test(n);return i&&l&&(n=n.substring(1,n.length-1)),n=Fe(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=Fe(t[1]),i="mailto:"+n):(n=Fe(t[1]),i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,i;let t;if(t=this.rules.inline.url.exec(e)){let l,o;if(t[2]==="@")l=Fe(t[0]),o="mailto:"+l;else{let r;do r=t[0],t[0]=(i=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?i:"";while(r!==t[0]);l=Fe(t[0]),t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:l,href:o,tokens:[{type:"text",raw:l,text:l}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=Fe(t[0]),{type:"text",raw:t[0],text:n}}}}const $i=/^(?: *(?:\n|$))+/,eo=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,to=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ct=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,no=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ds=/(?:[*+-]|\d{1,9}[.)])/,gs=se(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ds).getRegex(),An=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,so=/^[^\n]+/,xn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,io=se(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",xn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),oo=se(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ds).getRegex(),Jt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",In=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,lo=se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",In).replace("tag",Jt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ms=se(An).replace("hr",Ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),Rn={blockquote:se(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ms).getRegex(),code:eo,def:io,fences:to,heading:no,hr:Ct,html:lo,lheading:gs,list:oo,newline:$i,paragraph:ms,table:Rt,text:so},_s=se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),ro=Ae(le({},Rn),{table:_s,paragraph:se(An).replace("hr",Ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_s).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex()}),ao=Ae(le({},Rn),{html:se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",In).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:se(An).replace("hr",Ct).replace("heading",` *#{1,6} *[^
16
- ]`).replace("lheading",gs).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),ks=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,co=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ws=/^( {2,}|\\)\n(?!\s*$)/,uo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lt="\\p{P}$+<=>`^|~",fo=se(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Lt).getRegex(),ho=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,po=se(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Lt).getRegex(),go=se("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Lt).getRegex(),mo=se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Lt).getRegex(),_o=se(/\\([punct])/,"gu").replace(/punct/g,Lt).getRegex(),ko=se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wo=se(In).replace("(?:-->|$)","-->").getRegex(),bo=se("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",wo).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,yo=se(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Kt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bs=se(/^!?\[(label)\]\[(ref)\]/).replace("label",Kt).replace("ref",xn).getRegex(),ys=se(/^!?\[(ref)\](?:\[\])?/).replace("ref",xn).getRegex(),To=se("reflink|nolink(?!\\()","g").replace("reflink",bs).replace("nolink",ys).getRegex(),Cn={_backpedal:Rt,anyPunctuation:_o,autolink:ko,blockSkip:ho,br:ws,code:co,del:Rt,emStrongLDelim:po,emStrongRDelimAst:go,emStrongRDelimUnd:mo,escape:ks,link:yo,nolink:ys,punctuation:fo,reflink:bs,reflinkSearch:To,tag:bo,text:uo,url:Rt},vo=Ae(le({},Cn),{link:se(/^!?\[(label)\]\((.*?)\)/).replace("label",Kt).getRegex(),reflink:se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kt).getRegex()}),Ln=Ae(le({},Cn),{escape:se(ks).replace("])","~|])").getRegex(),url:se(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Eo=Ae(le({},Ln),{br:se(ws).replace("{2,}","*").getRegex(),text:se(Ln.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),$t={normal:Rn,gfm:ro,pedantic:ao},Mt={normal:Cn,gfm:Ln,breaks:Eo,pedantic:vo};class Ze{constructor(e){ce(this,"tokens");ce(this,"options");ce(this,"state");ce(this,"tokenizer");ce(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||at,this.options.tokenizer=this.options.tokenizer||new Qt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:$t.normal,inline:Mt.normal};this.options.pedantic?(t.block=$t.pedantic,t.inline=Mt.pedantic):this.options.gfm&&(t.block=$t.gfm,this.options.breaks?t.inline=Mt.breaks:t.inline=Mt.gfm),this.tokenizer.rules=t}static get rules(){return{block:$t,inline:Mt}}static lex(e,t){return new Ze(t).lex(e)}static lexInline(e,t){return new Ze(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
17
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(r,c,u)=>c+" ".repeat(u.length));let n,i,l,o;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
18
- `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
19
- `+n.raw,i.text+=`
20
- `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
21
- `+n.raw,i.text+=`
22
- `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(l=e,this.options.extensions&&this.options.extensions.startBlock){let r=1/0;const c=e.slice(1);let u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(r=Math.min(r,u))}),r<1/0&&r>=0&&(l=e.substring(0,r+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){i=t[t.length-1],o&&i.type==="paragraph"?(i.raw+=`
23
- `+n.raw,i.text+=`
24
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n),o=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=`
25
- `+n.raw,i.text+=`
26
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(n);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,l,o=e,r,c,u;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)h.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,r.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(n=h.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,o,u)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(l=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const p=e.slice(1);let d;this.options.extensions.startInline.forEach(m=>{d=m.call({lexer:this},p),typeof d=="number"&&d>=0&&(h=Math.min(h,d))}),h<1/0&&h>=0&&(l=e.substring(0,h+1))}if(n=this.tokenizer.inlineText(l)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),c=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class en{constructor(e){ce(this,"options");this.options=e||at}code(e,t,n){var l;const i=(l=(t||"").match(/^\S*/))==null?void 0:l[0];return e=e.replace(/\n$/,"")+`
27
- `,i?'<pre><code class="language-'+Fe(i)+'">'+(n?e:Fe(e,!0))+`</code></pre>
1
+ (function(te,U){typeof exports=="object"&&typeof module!="undefined"?U(exports):typeof define=="function"&&define.amd?define(["exports"],U):(te=typeof globalThis!="undefined"?globalThis:te||self,U(te["@sy-design/svelte"]=te["@sy-design/svelte"]||{}))})(this,function(te){"use strict";var Tl=Object.defineProperty,vl=Object.defineProperties;var El=Object.getOwnPropertyDescriptors;var bi=Object.getOwnPropertySymbols;var Sl=Object.prototype.hasOwnProperty,Al=Object.prototype.propertyIsEnumerable;var yi=te=>{throw TypeError(te)};var Yn=(te,U,ue)=>U in te?Tl(te,U,{enumerable:!0,configurable:!0,writable:!0,value:ue}):te[U]=ue,re=(te,U)=>{for(var ue in U||(U={}))Sl.call(U,ue)&&Yn(te,ue,U[ue]);if(bi)for(var ue of bi(U))Al.call(U,ue)&&Yn(te,ue,U[ue]);return te},Se=(te,U)=>vl(te,El(U));var ce=(te,U,ue)=>Yn(te,typeof U!="symbol"?U+"":U,ue),xl=(te,U,ue)=>U.has(te)||yi("Cannot "+ue);var Ti=(te,U,ue)=>U.has(te)?yi("Cannot add the same private member more than once"):U instanceof WeakSet?U.add(te):U.set(te,ue);var pn=(te,U,ue)=>(xl(te,U,"access private method"),ue);var Ie=(te,U,ue)=>new Promise((Wt,ke)=>{var St=Ke=>{try{At(ue.next(Ke))}catch(mt){ke(mt)}},dt=Ke=>{try{At(ue.throw(Ke))}catch(mt){ke(mt)}},At=Ke=>Ke.done?Wt(Ke.value):Promise.resolve(Ke.value).then(St,dt);At((ue=ue.apply(te,U)).next())});var ht,Zn,vi;function U(){}function ue(s){return s()}function Wt(){return Object.create(null)}function ke(s){s.forEach(ue)}function St(s){return typeof s=="function"}function dt(s,e){return s!=s?e==e:s!==e||s&&typeof s=="object"||typeof s=="function"}function At(s){return Object.keys(s).length===0}function Ke(s,...e){if(s==null){for(const n of e)n(void 0);return U}const t=s.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}const mt=typeof window!="undefined";let Xn=mt?()=>window.performance.now():()=>Date.now(),Vn=mt?s=>requestAnimationFrame(s):U;const gt=new Set;function Qn(s){gt.forEach(e=>{e.c(s)||(gt.delete(e),e.f())}),gt.size!==0&&Vn(Qn)}function Ei(s){let e;return gt.size===0&&Vn(Qn),{promise:new Promise(t=>{gt.add(e={c:s,f:t})}),abort(){gt.delete(e)}}}function d(s,e){s.appendChild(e)}function G(s,e,t){s.insertBefore(e,t||null)}function W(s){s.parentNode&&s.parentNode.removeChild(s)}function Jn(s,e){for(let t=0;t<s.length;t+=1)s[t]&&s[t].d(e)}function E(s){return document.createElement(s)}function K(s){return document.createElementNS("http://www.w3.org/2000/svg",s)}function Te(s){return document.createTextNode(s)}function q(){return Te(" ")}function qt(){return Te("")}function Y(s,e,t,n){return s.addEventListener(e,t,n),()=>s.removeEventListener(e,t,n)}function Kn(s){return function(e){return e.preventDefault(),s.call(this,e)}}function a(s,e,t){t==null?s.removeAttribute(e):s.getAttribute(e)!==t&&s.setAttribute(e,t)}function Si(s){return Array.from(s.childNodes)}function Ne(s,e){e=""+e,s.data!==e&&(s.data=e)}function st(s,e){s.value=e==null?"":e}function P(s,e,t,n){t==null?s.style.removeProperty(e):s.style.setProperty(e,t,"")}function $n(s,e,t){for(let n=0;n<s.options.length;n+=1){const o=s.options[n];if(o.__value===e){o.selected=!0;return}}(!t||e!==void 0)&&(s.selectedIndex=-1)}function Ai(s){const e=s.querySelector(":checked");return e&&e.__value}function $(s,e,t){s.classList.toggle(e,!!t)}let xt;function It(s){xt=s}function dn(){if(!xt)throw new Error("Function called outside component initialization");return xt}function mn(s){dn().$$.on_mount.push(s)}function xi(s){dn().$$.after_update.push(s)}function Ii(s){dn().$$.on_destroy.push(s)}const _t=[],kt=[];let wt=[];const es=[],Ri=Promise.resolve();let gn=!1;function Ci(){gn||(gn=!0,Ri.then(ts))}function Gt(s){wt.push(s)}const _n=new Set;let bt=0;function ts(){if(bt!==0)return;const s=xt;do{try{for(;bt<_t.length;){const e=_t[bt];bt++,It(e),Li(e.$$)}}catch(e){throw _t.length=0,bt=0,e}for(It(null),_t.length=0,bt=0;kt.length;)kt.pop()();for(let e=0;e<wt.length;e+=1){const t=wt[e];_n.has(t)||(_n.add(t),t())}wt.length=0}while(_t.length);for(;es.length;)es.pop()();gn=!1,_n.clear(),It(s)}function Li(s){if(s.fragment!==null){s.update(),ke(s.before_update);const e=s.dirty;s.dirty=[-1],s.fragment&&s.fragment.p(s.ctx,e),s.after_update.forEach(Gt)}}function Mi(s){const e=[],t=[];wt.forEach(n=>s.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),wt=e}const Yt=new Set;let at;function kn(){at={r:0,c:[],p:at}}function wn(){at.r||ke(at.c),at=at.p}function je(s,e){s&&s.i&&(Yt.delete(s),s.i(e))}function $e(s,e,t,n){if(s&&s.o){if(Yt.has(s))return;Yt.add(s),at.c.push(()=>{Yt.delete(s),n&&(t&&s.d(1),n())}),s.o(e)}else n&&n()}function it(s){return(s==null?void 0:s.length)!==void 0?s:Array.from(s)}function ns(s,e){s.d(1),e.delete(s.key)}function ss(s,e,t,n,o,l,i,r,c,u,h,p){let m=s.length,g=l.length,_=m;const T={};for(;_--;)T[s[_].key]=_;const R=[],L=new Map,A=new Map,w=[];for(_=g;_--;){const x=p(o,l,_),M=t(x);let z=i.get(M);z?w.push(()=>z.p(x,e)):(z=u(M,x),z.c()),L.set(M,R[_]=z),M in T&&A.set(M,Math.abs(_-T[M]))}const k=new Set,y=new Set;function v(x){je(x,1),x.m(r,h),i.set(x.key,x),h=x.first,g--}for(;m&&g;){const x=R[g-1],M=s[m-1],z=x.key,X=M.key;x===M?(h=x.first,m--,g--):L.has(X)?!i.has(z)||k.has(z)?v(x):y.has(X)?m--:A.get(z)>A.get(X)?(y.add(z),v(x)):(k.add(X),m--):(c(M,i),m--)}for(;m--;){const x=s[m];L.has(x.key)||c(x,i)}for(;g;)v(R[g-1]);return ke(w),R}function bn(s){s&&s.c()}function Zt(s,e,t){const{fragment:n,after_update:o}=s.$$;n&&n.m(e,t),Gt(()=>{const l=s.$$.on_mount.map(ue).filter(St);s.$$.on_destroy?s.$$.on_destroy.push(...l):ke(l),s.$$.on_mount=[]}),o.forEach(Gt)}function Xt(s,e){const t=s.$$;t.fragment!==null&&(Mi(t.after_update),ke(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function zi(s,e){s.$$.dirty[0]===-1&&(_t.push(s),Ci(),s.$$.dirty.fill(0)),s.$$.dirty[e/31|0]|=1<<e%31}function yn(s,e,t,n,o,l,i=null,r=[-1]){const c=xt;It(s);const u=s.$$={fragment:null,ctx:[],props:l,update:U,not_equal:o,bound:Wt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Wt(),dirty:r,skip_bound:!1,root:e.target||c.$$.root};i&&i(u.root);let h=!1;if(u.ctx=t?t(s,e.props||{},(p,m,...g)=>{const _=g.length?g[0]:m;return u.ctx&&o(u.ctx[p],u.ctx[p]=_)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](_),h&&zi(s,p)),m}):[],u.update(),h=!0,ke(u.before_update),u.fragment=n?n(u.ctx):!1,e.target){if(e.hydrate){const p=Si(e.target);u.fragment&&u.fragment.l(p),p.forEach(W)}else u.fragment&&u.fragment.c();e.intro&&je(s.$$.fragment),Zt(s,e.target,e.anchor),ts()}It(c)}class Tn{constructor(){ce(this,"$$");ce(this,"$$set")}$destroy(){Xt(this,1),this.$destroy=U}$on(e,t){if(!St(t))return U;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const o=n.indexOf(t);o!==-1&&n.splice(o,1)}}$set(e){this.$$set&&!At(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Oi="4";typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Oi);const yt=[];function Di(s,e=U){let t;const n=new Set;function o(r){if(dt(s,r)&&(s=r,t)){const c=!yt.length;for(const u of n)u[1](),yt.push(u,s);if(c){for(let u=0;u<yt.length;u+=2)yt[u][0](yt[u+1]);yt.length=0}}}function l(r){o(r(s))}function i(r,c=U){const u=[r,c];return n.add(u),n.size===1&&(t=e(o,l)||U),r(s),()=>{n.delete(u),n.size===0&&t&&(t(),t=null)}}return{set:o,update:l,subscribe:i}}function is(s){return Object.prototype.toString.call(s)==="[object Date]"}function vn(s,e,t,n){if(typeof t=="number"||is(t)){const o=n-t,l=(t-e)/(s.dt||1/60),i=s.opts.stiffness*o,r=s.opts.damping*l,c=(i-r)*s.inv_mass,u=(l+c)*s.dt;return Math.abs(u)<s.opts.precision&&Math.abs(o)<s.opts.precision?n:(s.settled=!1,is(t)?new Date(t.getTime()+u):t+u)}else{if(Array.isArray(t))return t.map((o,l)=>vn(s,e[l],t[l],n[l]));if(typeof t=="object"){const o={};for(const l in t)o[l]=vn(s,e[l],t[l],n[l]);return o}else throw new Error(`Cannot spring ${typeof t} values`)}}function Pi(s,e={}){const t=Di(s),{stiffness:n=.15,damping:o=.8,precision:l=.01}=e;let i,r,c,u=s,h=s,p=1,m=0,g=!1;function _(R,L={}){h=R;const A=c={};return s==null||L.hard||T.stiffness>=1&&T.damping>=1?(g=!0,i=Xn(),u=R,t.set(s=h),Promise.resolve()):(L.soft&&(m=1/((L.soft===!0?.5:+L.soft)*60),p=0),r||(i=Xn(),g=!1,r=Ei(w=>{if(g)return g=!1,r=null,!1;p=Math.min(p+m,1);const k={inv_mass:p,opts:T,settled:!0,dt:(w-i)*60/1e3},y=vn(k,u,s,h);return i=w,u=s,t.set(s=y),k.settled&&(r=null),!k.settled})),new Promise(w=>{r.promise.then(()=>{A===c&&w()})}))}const T={set:_,update:(R,L)=>_(R(h,s),L),subscribe:t.subscribe,stiffness:n,damping:o,precision:l};return T}function Ni(s,e){return Ie(this,null,function*(){const t=s.getReader();let n;for(;!(n=yield t.read()).done;)e(n.value)})}function Fi(s){let e,t,n,o=!1;return function(i){e===void 0?(e=i,t=0,n=-1):e=Bi(e,i);const r=e.length;let c=0;for(;t<r;){o&&(e[t]===10&&(c=++t),o=!1);let u=-1;for(;t<r&&u===-1;++t)switch(e[t]){case 58:n===-1&&(n=t-c);break;case 13:o=!0;case 10:u=t;break}if(u===-1)break;s(e.subarray(c,u),n),c=t,n=-1}c===r?e=void 0:c!==0&&(e=e.subarray(c),t-=c)}}function Hi(s,e,t){let n=os();const o=new TextDecoder;return function(i,r){if(i.length===0)t==null||t(n),n=os();else if(r>0){const c=o.decode(i.subarray(0,r)),u=r+(i[r+1]===32?2:1),h=o.decode(i.subarray(u));switch(c){case"data":n.data=n.data?n.data+`
2
+ `+h:h;break;case"event":n.event=h;break;case"id":s(n.id=h);break;case"retry":const p=parseInt(h,10);isNaN(p)||e(n.retry=p);break}}}}function Bi(s,e){const t=new Uint8Array(s.length+e.length);return t.set(s),t.set(e,s.length),t}function os(){return{data:"",event:"",id:"",retry:void 0}}var ji=function(s,e){var t={};for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&e.indexOf(n)<0&&(t[n]=s[n]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(s);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(s,n[o])&&(t[n[o]]=s[n[o]]);return t};const En="text/event-stream",Ui=1e3,ls="last-event-id";function Wi(s,e){var{signal:t,headers:n,onopen:o,onmessage:l,onclose:i,onerror:r,openWhenHidden:c,fetch:u}=e,h=ji(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((p,m)=>{const g=Object.assign({},n);g.accept||(g.accept=En);let _;function T(){_.abort(),document.hidden||y()}c||document.addEventListener("visibilitychange",T);let R=Ui,L=0;function A(){document.removeEventListener("visibilitychange",T),window.clearTimeout(L),_.abort()}t==null||t.addEventListener("abort",()=>{A(),p()});const w=u!=null?u:window.fetch,k=o!=null?o:qi;function y(){return Ie(this,null,function*(){var v;_=new AbortController;try{const x=yield w(s,Object.assign(Object.assign({},h),{headers:g,signal:_.signal}));yield k(x),yield Ni(x.body,Fi(Hi(M=>{M?g[ls]=M:delete g[ls]},M=>{R=M},l))),i==null||i(),A(),p()}catch(x){if(!_.signal.aborted)try{const M=(v=r==null?void 0:r(x))!==null&&v!==void 0?v:R;window.clearTimeout(L),L=window.setTimeout(y,M)}catch(M){A(),m(M)}}})}y()})}function qi(s){const e=s.headers.get("content-type");if(!(e!=null&&e.startsWith(En)))throw new Error(`Expected content-type to be ${En}, Actual: ${e}`)}function Sn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let ct=Sn();function rs(s){ct=s}const as=/[&<>"']/,Gi=new RegExp(as.source,"g"),cs=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Yi=new RegExp(cs.source,"g"),Zi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},us=s=>Zi[s];function Fe(s,e){if(e){if(as.test(s))return s.replace(Gi,us)}else if(cs.test(s))return s.replace(Yi,us);return s}const Xi=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Vi(s){return s.replace(Xi,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const Qi=/(^|[^\[])\^/g;function le(s,e){let t=typeof s=="string"?s:s.source;e=e||"";const n={replace:(o,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(Qi,"$1"),t=t.replace(o,i),n},getRegex:()=>new RegExp(t,e)};return n}function fs(s){try{s=encodeURI(s).replace(/%25/g,"%")}catch(e){return null}return s}const Rt={exec:()=>null};function hs(s,e){const t=s.replace(/\|/g,(l,i,r)=>{let c=!1,u=i;for(;--u>=0&&r[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function Vt(s,e,t){const n=s.length;if(n===0)return"";let o=0;for(;o<n;){const l=s.charAt(n-o-1);if(l===e&&!t)o++;else if(l!==e&&t)o++;else break}return s.slice(0,n-o)}function Ji(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===e[0])t++;else if(s[n]===e[1]&&(t--,t<0))return n;return-1}function ps(s,e,t,n){const o=e.href,l=e.title?Fe(e.title):null,i=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const r={type:"link",raw:t,href:o,title:l,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=!1,r}return{type:"image",raw:t,href:o,title:l,text:Fe(i)}}function Ki(s,e){const t=s.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
3
+ `).map(o=>{const l=o.match(/^\s+/);if(l===null)return o;const[i]=l;return i.length>=n.length?o.slice(n.length):o}).join(`
4
+ `)}class Qt{constructor(e){ce(this,"options");ce(this,"rules");ce(this,"lexer");this.options=e||ct}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Vt(n,`
5
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],o=Ki(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:o}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const o=Vt(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const n=Vt(t[0].replace(/^ *>[ \t]?/gm,""),`
6
+ `),o=this.lexer.state.top;this.lexer.state.top=!0;const l=this.lexer.blockTokens(n);return this.lexer.state.top=o,{type:"blockquote",raw:t[0],tokens:l,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const o=n.length>1,l={type:"list",raw:"",ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]};n=o?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=o?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let r="",c="",u=!1;for(;e;){let h=!1;if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let p=t[2].split(`
7
+ `,1)[0].replace(/^\t+/,L=>" ".repeat(3*L.length)),m=e.split(`
8
+ `,1)[0],g=0;this.options.pedantic?(g=2,c=p.trimStart()):(g=t[2].search(/[^ ]/),g=g>4?1:g,c=p.slice(g),g+=t[1].length);let _=!1;if(!p&&/^ *$/.test(m)&&(r+=m+`
9
+ `,e=e.substring(m.length+1),h=!0),!h){const L=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),A=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;e;){const y=e.split(`
10
+ `,1)[0];if(m=y,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(m)||k.test(m)||L.test(m)||A.test(e))break;if(m.search(/[^ ]/)>=g||!m.trim())c+=`
11
+ `+m.slice(g);else{if(_||p.search(/[^ ]/)>=4||w.test(p)||k.test(p)||A.test(p))break;c+=`
12
+ `+m}!_&&!m.trim()&&(_=!0),r+=y+`
13
+ `,e=e.substring(y.length+1),p=m.slice(g)}}l.loose||(u?l.loose=!0:/\n *\n *$/.test(r)&&(u=!0));let T=null,R;this.options.gfm&&(T=/^\[[ xX]\] /.exec(c),T&&(R=T[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),l.items.push({type:"list_item",raw:r,task:!!T,checked:R,loose:!1,text:c,tokens:[]}),l.raw+=r}l.items[l.items.length-1].raw=r.trimEnd(),l.items[l.items.length-1].text=c.trimEnd(),l.raw=l.raw.trimEnd();for(let h=0;h<l.items.length;h++)if(this.lexer.state.top=!1,l.items[h].tokens=this.lexer.blockTokens(l.items[h].text,[]),!l.loose){const p=l.items[h].tokens.filter(g=>g.type==="space"),m=p.length>0&&p.some(g=>/\n.*\n/.test(g.raw));l.loose=m}if(l.loose)for(let h=0;h<l.items.length;h++)l.items[h].loose=!0;return l}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),o=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:o,title:l}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=hs(t[1]),o=t[2].replace(/^\||\| *$/g,"").split("|"),l=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
14
+ `):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===o.length){for(const r of o)/^ *-+: *$/.test(r)?i.align.push("right"):/^ *:-+: *$/.test(r)?i.align.push("center"):/^ *:-+ *$/.test(r)?i.align.push("left"):i.align.push(null);for(const r of n)i.header.push({text:r,tokens:this.lexer.inline(r)});for(const r of l)i.rows.push(hs(r,i.header.length).map(c=>({text:c,tokens:this.lexer.inline(c)})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
15
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Fe(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const i=Vt(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=Ji(t[2],"()");if(i>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let o=t[2],l="";if(this.options.pedantic){const i=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);i&&(o=i[1],l=i[3])}else l=t[3]?t[3].slice(1,-1):"";return o=o.trim(),/^</.test(o)&&(this.options.pedantic&&!/>$/.test(n)?o=o.slice(1):o=o.slice(1,-1)),ps(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const o=(n[2]||n[1]).replace(/\s+/g," "),l=t[o.toLowerCase()];if(!l){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return ps(n,l,n[0],this.lexer)}}emStrong(e,t,n=""){let o=this.rules.inline.emStrongLDelim.exec(e);if(!o||o[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...o[0]].length-1;let r,c,u=i,h=0;const p=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+i);(o=p.exec(t))!=null;){if(r=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!r)continue;if(c=[...r].length,o[3]||o[4]){u+=c;continue}else if((o[5]||o[6])&&i%3&&!((i+c)%3)){h+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+h);const m=[...o[0]][0].length,g=e.slice(0,i+o.index+m+c);if(Math.min(i,c)%2){const T=g.slice(1,-1);return{type:"em",raw:g,text:T,tokens:this.lexer.inlineTokens(T)}}const _=g.slice(2,-2);return{type:"strong",raw:g,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const o=/[^ ]/.test(n),l=/^ /.test(n)&&/ $/.test(n);return o&&l&&(n=n.substring(1,n.length-1)),n=Fe(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,o;return t[2]==="@"?(n=Fe(t[1]),o="mailto:"+n):(n=Fe(t[1]),o=n),{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,o;let t;if(t=this.rules.inline.url.exec(e)){let l,i;if(t[2]==="@")l=Fe(t[0]),i="mailto:"+l;else{let r;do r=t[0],t[0]=(o=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?o:"";while(r!==t[0]);l=Fe(t[0]),t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:l,href:i,tokens:[{type:"text",raw:l,text:l}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=Fe(t[0]),{type:"text",raw:t[0],text:n}}}}const $i=/^(?: *(?:\n|$))+/,eo=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,to=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ct=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,no=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ds=/(?:[*+-]|\d{1,9}[.)])/,ms=le(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,ds).getRegex(),An=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,so=/^[^\n]+/,xn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,io=le(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",xn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),oo=le(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ds).getRegex(),Jt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",In=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,lo=le("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",In).replace("tag",Jt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gs=le(An).replace("hr",Ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),Rn={blockquote:le(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gs).getRegex(),code:eo,def:io,fences:to,heading:no,hr:Ct,html:lo,lheading:ms,list:oo,newline:$i,paragraph:gs,table:Rt,text:so},_s=le("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex(),ro=Se(re({},Rn),{table:_s,paragraph:le(An).replace("hr",Ct).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_s).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jt).getRegex()}),ao=Se(re({},Rn),{html:le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",In).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Rt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:le(An).replace("hr",Ct).replace("heading",` *#{1,6} *[^
16
+ ]`).replace("lheading",ms).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),ks=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,co=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ws=/^( {2,}|\\)\n(?!\s*$)/,uo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Lt="\\p{P}$+<=>`^|~",fo=le(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Lt).getRegex(),ho=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,po=le(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Lt).getRegex(),mo=le("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Lt).getRegex(),go=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Lt).getRegex(),_o=le(/\\([punct])/,"gu").replace(/punct/g,Lt).getRegex(),ko=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wo=le(In).replace("(?:-->|$)","-->").getRegex(),bo=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",wo).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,yo=le(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Kt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bs=le(/^!?\[(label)\]\[(ref)\]/).replace("label",Kt).replace("ref",xn).getRegex(),ys=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",xn).getRegex(),To=le("reflink|nolink(?!\\()","g").replace("reflink",bs).replace("nolink",ys).getRegex(),Cn={_backpedal:Rt,anyPunctuation:_o,autolink:ko,blockSkip:ho,br:ws,code:co,del:Rt,emStrongLDelim:po,emStrongRDelimAst:mo,emStrongRDelimUnd:go,escape:ks,link:yo,nolink:ys,punctuation:fo,reflink:bs,reflinkSearch:To,tag:bo,text:uo,url:Rt},vo=Se(re({},Cn),{link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",Kt).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kt).getRegex()}),Ln=Se(re({},Cn),{escape:le(ks).replace("])","~|])").getRegex(),url:le(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Eo=Se(re({},Ln),{br:le(ws).replace("{2,}","*").getRegex(),text:le(Ln.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),$t={normal:Rn,gfm:ro,pedantic:ao},Mt={normal:Cn,gfm:Ln,breaks:Eo,pedantic:vo};class Xe{constructor(e){ce(this,"tokens");ce(this,"options");ce(this,"state");ce(this,"tokenizer");ce(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ct,this.options.tokenizer=this.options.tokenizer||new Qt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:$t.normal,inline:Mt.normal};this.options.pedantic?(t.block=$t.pedantic,t.inline=Mt.pedantic):this.options.gfm&&(t.block=$t.gfm,this.options.breaks?t.inline=Mt.breaks:t.inline=Mt.gfm),this.tokenizer.rules=t}static get rules(){return{block:$t,inline:Mt}}static lex(e,t){return new Xe(t).lex(e)}static lexInline(e,t){return new Xe(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
17
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(r,c,u)=>c+" ".repeat(u.length));let n,o,l,i;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
18
+ `:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length),o=t[t.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
19
+ `+n.raw,o.text+=`
20
+ `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length),o=t[t.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
21
+ `+n.raw,o.text+=`
22
+ `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(l=e,this.options.extensions&&this.options.extensions.startBlock){let r=1/0;const c=e.slice(1);let u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(r=Math.min(r,u))}),r<1/0&&r>=0&&(l=e.substring(0,r+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){o=t[t.length-1],i&&o.type==="paragraph"?(o.raw+=`
23
+ `+n.raw,o.text+=`
24
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n),i=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length),o=t[t.length-1],o&&o.type==="text"?(o.raw+=`
25
+ `+n.raw,o.text+=`
26
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(n);continue}if(e){const r="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(r);break}else throw new Error(r)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,o,l,i=e,r,c,u;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)h.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(c||(u=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(n=h.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),o=t[t.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),o=t[t.length-1],o&&n.type==="text"&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,i,u)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(l=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const p=e.slice(1);let m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},p),typeof m=="number"&&m>=0&&(h=Math.min(h,m))}),h<1/0&&h>=0&&(l=e.substring(0,h+1))}if(n=this.tokenizer.inlineText(l)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),c=!0,o=t[t.length-1],o&&o.type==="text"?(o.raw+=n.raw,o.text+=n.text):t.push(n);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class en{constructor(e){ce(this,"options");this.options=e||ct}code(e,t,n){var l;const o=(l=(t||"").match(/^\S*/))==null?void 0:l[0];return e=e.replace(/\n$/,"")+`
27
+ `,o?'<pre><code class="language-'+Fe(o)+'">'+(n?e:Fe(e,!0))+`</code></pre>
28
28
  `:"<pre><code>"+(n?e:Fe(e,!0))+`</code></pre>
29
29
  `}blockquote(e){return`<blockquote>
30
30
  ${e}</blockquote>
31
31
  `}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>
32
32
  `}hr(){return`<hr>
33
- `}list(e,t,n){const i=t?"ol":"ul",l=t&&n!==1?' start="'+n+'"':"";return"<"+i+l+`>
34
- `+e+"</"+i+`>
33
+ `}list(e,t,n){const o=t?"ol":"ul",l=t&&n!==1?' start="'+n+'"':"";return"<"+o+l+`>
34
+ `+e+"</"+o+`>
35
35
  `}listitem(e,t,n){return`<li>${e}</li>
36
36
  `}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>
37
37
  `}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),`<table>
@@ -41,8 +41,8 @@ ${e}</blockquote>
41
41
  `}tablerow(e){return`<tr>
42
42
  ${e}</tr>
43
43
  `}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
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 i=fs(e);if(i===null)return n;e=i;let l='<a href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>",l}image(e,t,n){const i=fs(e);if(i===null)return n;e=i;let l=`<img src="${e}" alt="${n}"`;return t&&(l+=` title="${t}"`),l+=">",l}text(e){return e}}class Mn{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 Xe{constructor(e){ce(this,"options");ce(this,"renderer");ce(this,"textRenderer");this.options=e||at,this.options.renderer=this.options.renderer||new en,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Mn}static parse(e,t){return new Xe(t).parse(e)}static parseInline(e,t){return new Xe(t).parseInline(e)}parse(e,t=!0){let n="";for(let i=0;i<e.length;i++){const l=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[l.type]){const o=l,r=this.options.extensions.renderers[o.type].call({parser:this},o);if(r!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){n+=r||"";continue}}switch(l.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const o=l;n+=this.renderer.heading(this.parseInline(o.tokens),o.depth,Vi(this.parseInline(o.tokens,this.textRenderer)));continue}case"code":{const o=l;n+=this.renderer.code(o.text,o.lang,!!o.escaped);continue}case"table":{const o=l;let r="",c="";for(let h=0;h<o.header.length;h++)c+=this.renderer.tablecell(this.parseInline(o.header[h].tokens),{header:!0,align:o.align[h]});r+=this.renderer.tablerow(c);let u="";for(let h=0;h<o.rows.length;h++){const p=o.rows[h];c="";for(let d=0;d<p.length;d++)c+=this.renderer.tablecell(this.parseInline(p[d].tokens),{header:!1,align:o.align[d]});u+=this.renderer.tablerow(c)}n+=this.renderer.table(r,u);continue}case"blockquote":{const o=l,r=this.parse(o.tokens);n+=this.renderer.blockquote(r);continue}case"list":{const o=l,r=o.ordered,c=o.start,u=o.loose;let h="";for(let p=0;p<o.items.length;p++){const d=o.items[p],m=d.checked,_=d.task;let E="";if(d.task){const I=this.renderer.checkbox(!!m);u?d.tokens.length>0&&d.tokens[0].type==="paragraph"?(d.tokens[0].text=I+" "+d.tokens[0].text,d.tokens[0].tokens&&d.tokens[0].tokens.length>0&&d.tokens[0].tokens[0].type==="text"&&(d.tokens[0].tokens[0].text=I+" "+d.tokens[0].tokens[0].text)):d.tokens.unshift({type:"text",text:I+" "}):E+=I+" "}E+=this.parse(d.tokens,u),h+=this.renderer.listitem(E,_,!!m)}n+=this.renderer.list(h,r,c);continue}case"html":{const o=l;n+=this.renderer.html(o.text,o.block);continue}case"paragraph":{const o=l;n+=this.renderer.paragraph(this.parseInline(o.tokens));continue}case"text":{let o=l,r=o.tokens?this.parseInline(o.tokens):o.text;for(;i+1<e.length&&e[i+1].type==="text";)o=e[++i],r+=`
45
- `+(o.tokens?this.parseInline(o.tokens):o.text);n+=t?this.renderer.paragraph(r):r;continue}default:{const o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let i=0;i<e.length;i++){const l=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[l.type]){const o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=o||"";continue}}switch(l.type){case"escape":{const o=l;n+=t.text(o.text);break}case"html":{const o=l;n+=t.html(o.text);break}case"link":{const o=l;n+=t.link(o.href,o.title,this.parseInline(o.tokens,t));break}case"image":{const o=l;n+=t.image(o.href,o.title,o.text);break}case"strong":{const o=l;n+=t.strong(this.parseInline(o.tokens,t));break}case"em":{const o=l;n+=t.em(this.parseInline(o.tokens,t));break}case"codespan":{const o=l;n+=t.codespan(o.text);break}case"br":{n+=t.br();break}case"del":{const o=l;n+=t.del(this.parseInline(o.tokens,t));break}case"text":{const o=l;n+=t.text(o.text);break}default:{const o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}}class zt{constructor(e){ce(this,"options");this.options=e||at}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}ce(zt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class So{constructor(...e){Ti(this,ft);ce(this,"defaults",Sn());ce(this,"options",this.setOptions);ce(this,"parse",pn(this,ft,Zn).call(this,Ze.lex,Xe.parse));ce(this,"parseInline",pn(this,ft,Zn).call(this,Ze.lexInline,Xe.parseInline));ce(this,"Parser",Xe);ce(this,"Renderer",en);ce(this,"TextRenderer",Mn);ce(this,"Lexer",Ze);ce(this,"Tokenizer",Qt);ce(this,"Hooks",zt);this.use(...e)}walkTokens(e,t){var i,l;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const r=o;for(const c of r.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of r.rows)for(const u of c)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const r=o;n=n.concat(this.walkTokens(r.items,t));break}default:{const r=o;(l=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&l[r.type]?this.defaults.extensions.childTokens[r.type].forEach(c=>{const u=r[c].flat(1/0);n=n.concat(this.walkTokens(u,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i=le({},n);if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const o=t.renderers[l.name];o?t.renderers[l.name]=function(...r){let c=l.renderer.apply(this,r);return c===!1&&(c=o.apply(this,r)),c}:t.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[l.level];o?o.unshift(l.tokenizer):t[l.level]=[l.tokenizer],l.start&&(l.level==="block"?t.startBlock?t.startBlock.push(l.start):t.startBlock=[l.start]:l.level==="inline"&&(t.startInline?t.startInline.push(l.start):t.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(t.childTokens[l.name]=l.childTokens)}),i.extensions=t),n.renderer){const l=this.defaults.renderer||new en(this.defaults);for(const o in n.renderer){if(!(o in l))throw new Error(`renderer '${o}' does not exist`);if(o==="options")continue;const r=o,c=n.renderer[r],u=l[r];l[r]=(...h)=>{let p=c.apply(l,h);return p===!1&&(p=u.apply(l,h)),p||""}}i.renderer=l}if(n.tokenizer){const l=this.defaults.tokenizer||new Qt(this.defaults);for(const o in n.tokenizer){if(!(o in l))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const r=o,c=n.tokenizer[r],u=l[r];l[r]=(...h)=>{let p=c.apply(l,h);return p===!1&&(p=u.apply(l,h)),p}}i.tokenizer=l}if(n.hooks){const l=this.defaults.hooks||new zt;for(const o in n.hooks){if(!(o in l))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;const r=o,c=n.hooks[r],u=l[r];zt.passThroughHooks.has(o)?l[r]=h=>{if(this.defaults.async)return Promise.resolve(c.call(l,h)).then(d=>u.call(l,d));const p=c.call(l,h);return u.call(l,p)}:l[r]=(...h)=>{let p=c.apply(l,h);return p===!1&&(p=u.apply(l,h)),p}}i.hooks=l}if(n.walkTokens){const l=this.defaults.walkTokens,o=n.walkTokens;i.walkTokens=function(r){let c=[];return c.push(o.call(this,r)),l&&(c=c.concat(l.call(this,r))),c}}this.defaults=le(le({},this.defaults),i)}),this}setOptions(e){return this.defaults=le(le({},this.defaults),e),this}lexer(e,t){return Ze.lex(e,t!=null?t:this.defaults)}parser(e,t){return Xe.parse(e,t!=null?t:this.defaults)}}ft=new WeakSet,Zn=function(e,t){return(n,i)=>{const l=le({},i),o=le(le({},this.defaults),l);this.defaults.async===!0&&l.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const r=pn(this,ft,vi).call(this,!!o.silent,!!o.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(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(c=>e(c,o)).then(c=>o.hooks?o.hooks.processAllTokens(c):c).then(c=>o.walkTokens?Promise.all(this.walkTokens(c,o.walkTokens)).then(()=>c):c).then(c=>t(c,o)).then(c=>o.hooks?o.hooks.postprocess(c):c).catch(r);try{o.hooks&&(n=o.hooks.preprocess(n));let c=e(n,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let u=t(c,o);return o.hooks&&(u=o.hooks.postprocess(u)),u}catch(c){return r(c)}}},vi=function(e,t){return n=>{if(n.message+=`
46
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Fe(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}};const ct=new So;function ee(s,e){return ct.parse(s,e)}ee.options=ee.setOptions=function(s){return ct.setOptions(s),ee.defaults=ct.defaults,rs(ee.defaults),ee},ee.getDefaults=Sn,ee.defaults=at,ee.use=function(...s){return ct.use(...s),ee.defaults=ct.defaults,rs(ee.defaults),ee},ee.walkTokens=function(s,e){return ct.walkTokens(s,e)},ee.parseInline=ct.parseInline,ee.Parser=Xe,ee.parser=Xe.parse,ee.Renderer=en,ee.TextRenderer=Mn,ee.Lexer=Ze,ee.lexer=Ze.lex,ee.Tokenizer=Qt,ee.Hooks=zt,ee.parse=ee,ee.options,ee.setOptions,ee.use,ee.walkTokens,ee.parseInline,Xe.parse,Ze.lex;/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */const{entries:Ts,setPrototypeOf:vs,isFrozen:Ao,getPrototypeOf:xo,getOwnPropertyDescriptor:Io}=Object;let{freeze:Ce,seal:We,create:Es}=Object,{apply:zn,construct:On}=typeof Reflect!="undefined"&&Reflect;Ce||(Ce=function(e){return e}),We||(We=function(e){return e}),zn||(zn=function(e,t,n){return e.apply(t,n)}),On||(On=function(e,t){return new e(...t)});const tn=He(Array.prototype.forEach),Ss=He(Array.prototype.pop),Ot=He(Array.prototype.push),nn=He(String.prototype.toLowerCase),Dn=He(String.prototype.toString),As=He(String.prototype.match),Dt=He(String.prototype.replace),Ro=He(String.prototype.indexOf),Co=He(String.prototype.trim),Ye=He(Object.prototype.hasOwnProperty),Le=He(RegExp.prototype.test),Nt=Lo(TypeError);function He(s){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return zn(s,e,n)}}function Lo(s){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return On(s,t)}}function V(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nn;vs&&vs(s,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const l=t(i);l!==i&&(Ao(e)||(e[n]=l),i=l)}s[i]=!0}return s}function Mo(s){for(let e=0;e<s.length;e++)Ye(s,e)||(s[e]=null);return s}function ut(s){const e=Es(null);for(const[t,n]of Ts(s))Ye(s,t)&&(Array.isArray(n)?e[t]=Mo(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=ut(n):e[t]=n);return e}function Pt(s,e){for(;s!==null;){const n=Io(s,e);if(n){if(n.get)return He(n.get);if(typeof n.value=="function")return He(n.value)}s=xo(s)}function t(){return null}return t}const xs=Ce(["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","section","select","shadow","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"]),Nn=Ce(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Pn=Ce(["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"]),zo=Ce(["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"]),Fn=Ce(["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"]),Oo=Ce(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Is=Ce(["#text"]),Rs=Ce(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Hn=Ce(["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"]),Cs=Ce(["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"]),sn=Ce(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Do=We(/\{\{[\w\W]*|[\w\W]*\}\}/gm),No=We(/<%[\w\W]*|[\w\W]*%>/gm),Po=We(/\$\{[\w\W]*}/gm),Fo=We(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ho=We(/^aria-[\-\w]+$/),Ls=We(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Bo=We(/^(?:\w+script|data):/i),jo=We(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ms=We(/^html$/i),Uo=We(/^[a-z][.\w]*(-[.\w]+)+$/i);var zs=Object.freeze({__proto__:null,ARIA_ATTR:Ho,ATTR_WHITESPACE:jo,CUSTOM_ELEMENT:Uo,DATA_ATTR:Fo,DOCTYPE_NAME:Ms,ERB_EXPR:No,IS_ALLOWED_URI:Ls,IS_SCRIPT_OR_DATA:Bo,MUSTACHE_EXPR:Do,TMPLIT_EXPR:Po});const Ft={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Wo=function(){return typeof window=="undefined"?null:window},qo=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const l="dompurify"+(n?"#"+n:"");try{return e.createPolicy(l,{createHTML(o){return o},createScriptURL(o){return o}})}catch(o){return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Os=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ds(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wo();const e=H=>Ds(H);if(e.version="3.2.3",e.removed=[],!s||!s.document||s.document.nodeType!==Ft.document)return e.isSupported=!1,e;let{document:t}=s;const n=t,i=n.currentScript,{DocumentFragment:l,HTMLTemplateElement:o,Node:r,Element:c,NodeFilter:u,NamedNodeMap:h=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:p,DOMParser:d,trustedTypes:m}=s,_=c.prototype,E=Pt(_,"cloneNode"),I=Pt(_,"remove"),z=Pt(_,"nextSibling"),x=Pt(_,"childNodes"),w=Pt(_,"parentNode");if(typeof o=="function"){const H=t.createElement("template");H.content&&H.content.ownerDocument&&(t=H.content.ownerDocument)}let k,b="";const{implementation:v,createNodeIterator:R,createDocumentFragment:L,getElementsByTagName:C}=t,{importNode:X}=n;let y=Os();e.isSupported=typeof Ts=="function"&&typeof w=="function"&&v&&v.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:M,ERB_EXPR:B,TMPLIT_EXPR:j,DATA_ATTR:te,ARIA_ATTR:ke,IS_SCRIPT_OR_DATA:me,ATTR_WHITESPACE:Be,CUSTOM_ELEMENT:re}=zs;let{IS_ALLOWED_URI:qe}=zs,ie=null;const $e=V({},[...xs,...Nn,...Pn,...Fn,...Is]);let ne=null;const Me=V({},[...Rs,...Hn,...Cs,...sn]);let oe=Object.seal(Es(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}})),Oe=null,xe=null,et=!0,D=!0,ae=!1,N=!0,Z=!1,we=!0,be=!1,De=!1,je=!1,it=!1,yt=!1,Tt=!1,ln=!0,rn=!1;const Wn="user-content-";let Ht=!0,ht=!1,ot={},lt=null;const an=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 cn=null;const un=V({},["audio","video","img","source","image","track"]);let Bt=null;const T=V({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),F="http://www.w3.org/1998/Math/MathML",Q="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let he=fe,ve=!1,Ee=null;const vt=V({},[F,Q,fe],Dn);let Ge=V({},["mi","mo","mn","ms","mtext"]),fn=V({},["annotation-xml"]);const ml=V({},["title","style","font","a","script"]);let jt=null;const _l=["application/xhtml+xml","text/html"],kl="text/html";let ye=null,Et=null;const wl=t.createElement("form"),ai=function(f){return f instanceof RegExp||f instanceof Function},qn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Et&&Et===f)){if((!f||typeof f!="object")&&(f={}),f=ut(f),jt=_l.indexOf(f.PARSER_MEDIA_TYPE)===-1?kl:f.PARSER_MEDIA_TYPE,ye=jt==="application/xhtml+xml"?Dn:nn,ie=Ye(f,"ALLOWED_TAGS")?V({},f.ALLOWED_TAGS,ye):$e,ne=Ye(f,"ALLOWED_ATTR")?V({},f.ALLOWED_ATTR,ye):Me,Ee=Ye(f,"ALLOWED_NAMESPACES")?V({},f.ALLOWED_NAMESPACES,Dn):vt,Bt=Ye(f,"ADD_URI_SAFE_ATTR")?V(ut(T),f.ADD_URI_SAFE_ATTR,ye):T,cn=Ye(f,"ADD_DATA_URI_TAGS")?V(ut(un),f.ADD_DATA_URI_TAGS,ye):un,lt=Ye(f,"FORBID_CONTENTS")?V({},f.FORBID_CONTENTS,ye):an,Oe=Ye(f,"FORBID_TAGS")?V({},f.FORBID_TAGS,ye):{},xe=Ye(f,"FORBID_ATTR")?V({},f.FORBID_ATTR,ye):{},ot=Ye(f,"USE_PROFILES")?f.USE_PROFILES:!1,et=f.ALLOW_ARIA_ATTR!==!1,D=f.ALLOW_DATA_ATTR!==!1,ae=f.ALLOW_UNKNOWN_PROTOCOLS||!1,N=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=f.SAFE_FOR_TEMPLATES||!1,we=f.SAFE_FOR_XML!==!1,be=f.WHOLE_DOCUMENT||!1,it=f.RETURN_DOM||!1,yt=f.RETURN_DOM_FRAGMENT||!1,Tt=f.RETURN_TRUSTED_TYPE||!1,je=f.FORCE_BODY||!1,ln=f.SANITIZE_DOM!==!1,rn=f.SANITIZE_NAMED_PROPS||!1,Ht=f.KEEP_CONTENT!==!1,ht=f.IN_PLACE||!1,qe=f.ALLOWED_URI_REGEXP||Ls,he=f.NAMESPACE||fe,Ge=f.MATHML_TEXT_INTEGRATION_POINTS||Ge,fn=f.HTML_INTEGRATION_POINTS||fn,oe=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&ai(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(oe.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&ai(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(oe.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(D=!1),yt&&(it=!0),ot&&(ie=V({},Is),ne=[],ot.html===!0&&(V(ie,xs),V(ne,Rs)),ot.svg===!0&&(V(ie,Nn),V(ne,Hn),V(ne,sn)),ot.svgFilters===!0&&(V(ie,Pn),V(ne,Hn),V(ne,sn)),ot.mathMl===!0&&(V(ie,Fn),V(ne,Cs),V(ne,sn))),f.ADD_TAGS&&(ie===$e&&(ie=ut(ie)),V(ie,f.ADD_TAGS,ye)),f.ADD_ATTR&&(ne===Me&&(ne=ut(ne)),V(ne,f.ADD_ATTR,ye)),f.ADD_URI_SAFE_ATTR&&V(Bt,f.ADD_URI_SAFE_ATTR,ye),f.FORBID_CONTENTS&&(lt===an&&(lt=ut(lt)),V(lt,f.FORBID_CONTENTS,ye)),Ht&&(ie["#text"]=!0),be&&V(ie,["html","head","body"]),ie.table&&(V(ie,["tbody"]),delete Oe.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Nt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=f.TRUSTED_TYPES_POLICY,b=k.createHTML("")}else k===void 0&&(k=qo(m,i)),k!==null&&typeof b=="string"&&(b=k.createHTML(""));Ce&&Ce(f),Et=f}},ci=V({},[...Nn,...Pn,...zo]),ui=V({},[...Fn,...Oo]),bl=function(f){let A=w(f);(!A||!A.tagName)&&(A={namespaceURI:he,tagName:"template"});const O=nn(f.tagName),pe=nn(A.tagName);return Ee[f.namespaceURI]?f.namespaceURI===Q?A.namespaceURI===fe?O==="svg":A.namespaceURI===F?O==="svg"&&(pe==="annotation-xml"||Ge[pe]):!!ci[O]:f.namespaceURI===F?A.namespaceURI===fe?O==="math":A.namespaceURI===Q?O==="math"&&fn[pe]:!!ui[O]:f.namespaceURI===fe?A.namespaceURI===Q&&!fn[pe]||A.namespaceURI===F&&!Ge[pe]?!1:!ui[O]&&(ml[O]||!ci[O]):!!(jt==="application/xhtml+xml"&&Ee[f.namespaceURI]):!1},Ve=function(f){Ot(e.removed,{element:f});try{w(f).removeChild(f)}catch(A){I(f)}},hn=function(f,A){try{Ot(e.removed,{attribute:A.getAttributeNode(f),from:A})}catch(O){Ot(e.removed,{attribute:null,from:A})}if(A.removeAttribute(f),f==="is")if(it||yt)try{Ve(A)}catch(O){}else try{A.setAttribute(f,"")}catch(O){}},fi=function(f){let A=null,O=null;if(je)f="<remove></remove>"+f;else{const Se=As(f,/^[\r\n\t ]+/);O=Se&&Se[0]}jt==="application/xhtml+xml"&&he===fe&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const pe=k?k.createHTML(f):f;if(he===fe)try{A=new d().parseFromString(pe,jt)}catch(Se){}if(!A||!A.documentElement){A=v.createDocument(he,"template",null);try{A.documentElement.innerHTML=ve?b:pe}catch(Se){}}const Ie=A.body||A.documentElement;return f&&O&&Ie.insertBefore(t.createTextNode(O),Ie.childNodes[0]||null),he===fe?C.call(A,be?"html":"body")[0]:be?A.documentElement:Ie},hi=function(f){return R.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Gn=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof h)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},pi=function(f){return typeof r=="function"&&f instanceof r};function tt(H,f,A){tn(H,O=>{O.call(e,f,A,Et)})}const di=function(f){let A=null;if(tt(y.beforeSanitizeElements,f,null),Gn(f))return Ve(f),!0;const O=ye(f.nodeName);if(tt(y.uponSanitizeElement,f,{tagName:O,allowedTags:ie}),f.hasChildNodes()&&!pi(f.firstElementChild)&&Le(/<[/\w]/g,f.innerHTML)&&Le(/<[/\w]/g,f.textContent)||f.nodeType===Ft.progressingInstruction||we&&f.nodeType===Ft.comment&&Le(/<[/\w]/g,f.data))return Ve(f),!0;if(!ie[O]||Oe[O]){if(!Oe[O]&&mi(O)&&(oe.tagNameCheck instanceof RegExp&&Le(oe.tagNameCheck,O)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(O)))return!1;if(Ht&&!lt[O]){const pe=w(f)||f.parentNode,Ie=x(f)||f.childNodes;if(Ie&&pe){const Se=Ie.length;for(let Ne=Se-1;Ne>=0;--Ne){const Qe=E(Ie[Ne],!0);Qe.__removalCount=(f.__removalCount||0)+1,pe.insertBefore(Qe,z(f))}}}return Ve(f),!0}return f instanceof c&&!bl(f)||(O==="noscript"||O==="noembed"||O==="noframes")&&Le(/<\/no(script|embed|frames)/i,f.innerHTML)?(Ve(f),!0):(Z&&f.nodeType===Ft.text&&(A=f.textContent,tn([M,B,j],pe=>{A=Dt(A,pe," ")}),f.textContent!==A&&(Ot(e.removed,{element:f.cloneNode()}),f.textContent=A)),tt(y.afterSanitizeElements,f,null),!1)},gi=function(f,A,O){if(ln&&(A==="id"||A==="name")&&(O in t||O in wl))return!1;if(!(D&&!xe[A]&&Le(te,A))){if(!(et&&Le(ke,A))){if(!ne[A]||xe[A]){if(!(mi(f)&&(oe.tagNameCheck instanceof RegExp&&Le(oe.tagNameCheck,f)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(f))&&(oe.attributeNameCheck instanceof RegExp&&Le(oe.attributeNameCheck,A)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(A))||A==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&&Le(oe.tagNameCheck,O)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(O))))return!1}else if(!Bt[A]){if(!Le(qe,Dt(O,Be,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&f!=="script"&&Ro(O,"data:")===0&&cn[f])){if(!(ae&&!Le(me,Dt(O,Be,"")))){if(O)return!1}}}}}}return!0},mi=function(f){return f!=="annotation-xml"&&As(f,re)},_i=function(f){tt(y.beforeSanitizeAttributes,f,null);const{attributes:A}=f;if(!A||Gn(f))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ne,forceKeepAttr:void 0};let pe=A.length;for(;pe--;){const Ie=A[pe],{name:Se,namespaceURI:Ne,value:Qe}=Ie,Ut=ye(Se);let ze=Se==="value"?Qe:Co(Qe);if(O.attrName=Ut,O.attrValue=ze,O.keepAttr=!0,O.forceKeepAttr=void 0,tt(y.uponSanitizeAttribute,f,O),ze=O.attrValue,rn&&(Ut==="id"||Ut==="name")&&(hn(Se,f),ze=Wn+ze),we&&Le(/((--!?|])>)|<\/(style|title)/i,ze)){hn(Se,f);continue}if(O.forceKeepAttr||(hn(Se,f),!O.keepAttr))continue;if(!N&&Le(/\/>/i,ze)){hn(Se,f);continue}Z&&tn([M,B,j],wi=>{ze=Dt(ze,wi," ")});const ki=ye(f.nodeName);if(gi(ki,Ut,ze)){if(k&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Ne)switch(m.getAttributeType(ki,Ut)){case"TrustedHTML":{ze=k.createHTML(ze);break}case"TrustedScriptURL":{ze=k.createScriptURL(ze);break}}try{Ne?f.setAttributeNS(Ne,Se,ze):f.setAttribute(Se,ze),Gn(f)?Ve(f):Ss(e.removed)}catch(wi){}}}tt(y.afterSanitizeAttributes,f,null)},yl=function H(f){let A=null;const O=hi(f);for(tt(y.beforeSanitizeShadowDOM,f,null);A=O.nextNode();)tt(y.uponSanitizeShadowNode,A,null),di(A),_i(A),A.content instanceof l&&H(A.content);tt(y.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(H){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,O=null,pe=null,Ie=null;if(ve=!H,ve&&(H="<!-->"),typeof H!="string"&&!pi(H))if(typeof H.toString=="function"){if(H=H.toString(),typeof H!="string")throw Nt("dirty is not a string, aborting")}else throw Nt("toString is not a function");if(!e.isSupported)return H;if(De||qn(f),e.removed=[],typeof H=="string"&&(ht=!1),ht){if(H.nodeName){const Qe=ye(H.nodeName);if(!ie[Qe]||Oe[Qe])throw Nt("root node is forbidden and cannot be sanitized in-place")}}else if(H instanceof r)A=fi("<!---->"),O=A.ownerDocument.importNode(H,!0),O.nodeType===Ft.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?A=O:A.appendChild(O);else{if(!it&&!Z&&!be&&H.indexOf("<")===-1)return k&&Tt?k.createHTML(H):H;if(A=fi(H),!A)return it?null:Tt?b:""}A&&je&&Ve(A.firstChild);const Se=hi(ht?H:A);for(;pe=Se.nextNode();)di(pe),_i(pe),pe.content instanceof l&&yl(pe.content);if(ht)return H;if(it){if(yt)for(Ie=L.call(A.ownerDocument);A.firstChild;)Ie.appendChild(A.firstChild);else Ie=A;return(ne.shadowroot||ne.shadowrootmode)&&(Ie=X.call(n,Ie,!0)),Ie}let Ne=be?A.outerHTML:A.innerHTML;return be&&ie["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&Le(Ms,A.ownerDocument.doctype.name)&&(Ne="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
47
- `+Ne),Z&&tn([M,B,j],Qe=>{Ne=Dt(Ne,Qe," ")}),k&&Tt?k.createHTML(Ne):Ne},e.setConfig=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(H),De=!0},e.clearConfig=function(){Et=null,De=!1},e.isValidAttribute=function(H,f,A){Et||qn({});const O=ye(H),pe=ye(f);return gi(O,pe,A)},e.addHook=function(H,f){typeof f=="function"&&Ot(y[H],f)},e.removeHook=function(H){return Ss(y[H])},e.removeHooks=function(H){y[H]=[]},e.removeAllHooks=function(){y=Os()},e}var Ns=Ds();function Ps(s){var n;if(typeof document=="undefined")return null;const t=`; ${document.cookie}`.split(`; ${s}=`);return t.length===2&&((n=t.pop())==null?void 0:n.split(";").shift())||null}const de=()=>{if(typeof window=="undefined")return null;const s=Ps("access_token");if(s)return s;const e=Ps("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 Fs(s,e,t){const n=s.slice();return n[24]=e[t],n}function Hs(s){let e,t=s[9].text+"",n;return{c(){e=S("div"),n=Te(t),a(e,"class","sy-assistant-button-tooltip svelte-1g6fj9a"),P(e,"left",s[9].x+"px"),P(e,"top",s[9].y+"px"),P(e,"z-index",s[3]+3)},m(i,l){G(i,e,l),g(e,n)},p(i,l){l&512&&t!==(t=i[9].text+"")&&Pe(n,t),l&512&&P(e,"left",i[9].x+"px"),l&512&&P(e,"top",i[9].y+"px"),l&8&&P(e,"z-index",i[3]+3)},d(i){i&&W(e)}}}function Go(s){let e=[],t=new Map,n,i,l=st(s[0]);const o=c=>c[24].sessionId;for(let c=0;c<l.length;c+=1){let u=Fs(s,l,c),h=o(u);t.set(h,e[c]=Bs(h,u))}let r=s[5]&&js();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=q(),r&&r.c(),i=qt()},m(c,u){for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(c,u);G(c,n,u),r&&r.m(c,u),G(c,i,u)},p(c,u){u&8261&&(l=st(c[0]),e=ss(e,u,o,1,c,l,t,n.parentNode,ns,Bs,n,Fs)),c[5]?r||(r=js(),r.c(),r.m(i.parentNode,i)):r&&(r.d(1),r=null)},d(c){c&&(W(n),W(i));for(let u=0;u<e.length;u+=1)e[u].d(c);r&&r.d(c)}}}function Yo(s){let e,t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话",n;return{c(){e=S("div"),n=Te(t),a(e,"class","sy-session-empty svelte-1g6fj9a")},m(i,l){G(i,e,l),g(e,n)},p(i,l){l&48&&t!==(t=i[4]?"未找到相关会话":i[5]?"加载中...":"暂无历史会话")&&Pe(n,t)},d(i){i&&W(e)}}}function Bs(s,e){let t,n,i,l,o=e[24].title+"",r,c,u,h=Ws(e[24].timestamp)+"",p,d,m,_,E,I,z,x,w,k,b;function v(){return e[17](e[24])}function R(...L){return e[18](e[24],...L)}return{key:s,first:null,c(){t=S("div"),n=S("button"),i=S("div"),l=S("div"),r=Te(o),c=q(),u=S("div"),p=Te(h),d=q(),m=S("button"),_=J("svg"),E=J("path"),I=J("path"),z=J("path"),a(l,"class","sy-session-title svelte-1g6fj9a"),a(u,"class","sy-session-time svelte-1g6fj9a"),a(i,"class","sy-session-info svelte-1g6fj9a"),a(n,"class","sy-session-select svelte-1g6fj9a"),a(E,"d","M3 6h18"),a(I,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),a(z,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),a(_,"xmlns","http://www.w3.org/2000/svg"),a(_,"width","16"),a(_,"height","16"),a(_,"viewBox","0 0 24 24"),a(_,"fill","none"),a(_,"stroke","currentColor"),a(_,"stroke-width","2"),a(_,"stroke-linecap","round"),a(_,"stroke-linejoin","round"),a(m,"class","sy-session-delete svelte-1g6fj9a"),m.disabled=x=e[6]===e[24].sessionId,a(m,"aria-label","删除会话"),a(t,"class","sy-session-item svelte-1g6fj9a"),a(t,"data-session-id",w=e[24].sessionId),K(t,"deleting",e[24].deleting),this.first=t},m(L,C){G(L,t,C),g(t,n),g(n,i),g(i,l),g(l,r),g(i,c),g(i,u),g(u,p),g(t,d),g(t,m),g(m,_),g(_,E),g(_,I),g(_,z),k||(b=[Y(n,"click",v),Y(m,"click",R)],k=!0)},p(L,C){e=L,C&1&&o!==(o=e[24].title+"")&&Pe(r,o),C&1&&h!==(h=Ws(e[24].timestamp)+"")&&Pe(p,h),C&65&&x!==(x=e[6]===e[24].sessionId)&&(m.disabled=x),C&1&&w!==(w=e[24].sessionId)&&a(t,"data-session-id",w),C&1&&K(t,"deleting",e[24].deleting)},d(L){L&&W(t),k=!1,_e(b)}}}function js(s){let e;return{c(){e=S("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){G(t,e,n)},d(t){t&&W(e)}}}function Us(s){let e,t,n,i,l,o,r,c,u;return{c(){e=S("div"),t=S("div"),t.textContent="确认删除此会话?",n=q(),i=S("div"),l=S("button"),l.textContent="取消",o=q(),r=S("button"),r.textContent="删除",a(t,"class","sy-session-confirm-content svelte-1g6fj9a"),a(l,"class","sy-session-confirm-cancel svelte-1g6fj9a"),a(r,"class","sy-session-confirm-delete svelte-1g6fj9a"),a(i,"class","sy-session-confirm-actions svelte-1g6fj9a"),a(e,"class","sy-session-confirm-popup svelte-1g6fj9a"),P(e,"left",s[8].x+"px"),P(e,"top",s[8].y+"px"),P(e,"z-index",s[3]+3)},m(h,p){G(h,e,p),g(e,t),g(e,n),g(e,i),g(i,l),g(i,o),g(i,r),c||(u=[Y(l,"click",s[19]),Y(r,"click",s[14])],c=!0)},p(h,p){p&256&&P(e,"left",h[8].x+"px"),p&256&&P(e,"top",h[8].y+"px"),p&8&&P(e,"z-index",h[3]+3)},d(h){h&&W(e),c=!1,_e(u)}}}function Zo(s){let e,t,n,i,l,o,r,c,u,h,p,d,m,_,E,I,z,x,w,k=s[9]&&Hs(s);function b(C,X){return C[0].length===0?Yo:Go}let v=b(s),R=v(s),L=s[7]&&Us(s);return{c(){e=S("div"),t=S("div"),n=S("h2"),n.textContent="历史会话",i=q(),l=S("button"),l.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>',o=q(),r=S("div"),c=S("input"),u=q(),h=J("svg"),p=J("circle"),d=J("line"),m=q(),k&&k.c(),_=q(),E=S("div"),R.c(),I=q(),L&&L.c(),z=qt(),a(n,"class","svelte-1g6fj9a"),a(l,"class","sy-session-close svelte-1g6fj9a"),a(l,"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(p,"cx","11"),a(p,"cy","11"),a(p,"r","8"),a(d,"x1","21"),a(d,"y1","21"),a(d,"x2","16.65"),a(d,"y2","16.65"),a(h,"class","sy-session-search-icon svelte-1g6fj9a"),a(h,"xmlns","http://www.w3.org/2000/svg"),a(h,"width","16"),a(h,"height","16"),a(h,"viewBox","0 0 24 24"),a(h,"fill","none"),a(h,"stroke","currentColor"),a(h,"stroke-width","2"),a(h,"stroke-linecap","round"),a(h,"stroke-linejoin","round"),a(r,"class","sy-session-search svelte-1g6fj9a"),a(E,"class","sy-session-list svelte-1g6fj9a"),a(e,"class","sy-session-history svelte-1g6fj9a"),P(e,"z-index",s[3]+2)},m(C,X){G(C,e,X),g(e,t),g(t,n),g(t,i),g(t,l),g(e,o),g(e,r),g(r,c),nt(c,s[4]),g(r,u),g(r,h),g(h,p),g(h,d),g(e,m),k&&k.m(e,null),g(e,_),g(e,E),R.m(E,null),G(C,I,X),L&&L.m(C,X),G(C,z,X),x||(w=[Y(l,"click",function(){St(s[1])&&s[1].apply(this,arguments)}),Y(l,"mouseenter",s[15]),Y(l,"mouseleave",s[12]),Y(c,"input",s[16]),Y(E,"scroll",s[10])],x=!0)},p(C,[X]){s=C,X&16&&c.value!==s[4]&&nt(c,s[4]),s[9]?k?k.p(s,X):(k=Hs(s),k.c(),k.m(e,_)):k&&(k.d(1),k=null),v===(v=b(s))&&R?R.p(s,X):(R.d(1),R=v(s),R&&(R.c(),R.m(E,null))),X&8&&P(e,"z-index",s[3]+2),s[7]?L?L.p(s,X):(L=Us(s),L.c(),L.m(z.parentNode,z)):L&&(L.d(1),L=null)},i:U,o:U,d(C){C&&(W(e),W(I),W(z)),k&&k.d(),R.d(),L&&L.d(C),x=!1,_e(w)}}}const Bn=10;function Ws(s){return new Date(s).toLocaleString()}function Xo(s,e,t){let{sessions:n=[]}=e,{onClose:i}=e,{onSelect:l}=e,{zIndex:o}=e,r=!1,c=!0,u=0,h="",p=null,d=null,m={x:0,y:0};function _(){return Re(this,null,function*(){if(!(r||!c)){t(5,r=!0);try{const y=yield fetch("/aiops/aigc/chat/record/session/list/query",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`},body:JSON.stringify({start:u,length:Bn,keyword:h})});if(!y.ok)throw new Error("Failed to load sessions");const M=yield y.json();if(M.code===0){const B=M.data.sessionList.map(j=>({sessionId:j.sessionId,title:j.name,timestamp:new Date(j.createDate).getTime()}));t(0,n=[...n,...B]),u+=Bn,c=B.length===Bn}}catch(y){console.error("Failed to load sessions:",y)}finally{t(5,r=!1)}}})}function E(y){const M=y.target,{scrollTop:B,scrollHeight:j,clientHeight:te}=M;j-B-te<50&&_()}gn(()=>{_()});let I=null;function z(y,M){const j=y.currentTarget.getBoundingClientRect();t(9,I={text:M,x:j.left+j.width/2,y:j.bottom+8})}function x(){t(9,I=null)}function w(y,M){const j=y.currentTarget.getBoundingClientRect();t(8,m={x:j.left-16,y:j.top+j.height/2}),t(7,d=M)}function k(y){return Re(this,null,function*(){if(y&&!p)try{t(6,p=y),t(7,d=null);const M=document.querySelector(`[data-session-id="${y}"]`);M&&M.classList.add("deleting"),yield new Promise(te=>setTimeout(te,300));const B=yield fetch("/aiops/aigc/chat/record/session/delete",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`},body:JSON.stringify({sessionId:y})});if(!B.ok)throw new Error("Delete request failed");const j=yield B.json();if(j.code===0&&j.data.respCode===0)t(0,n=n.map(te=>Ae(le({},te),{deleting:te.sessionId===y}))),setTimeout(()=>{t(0,n=n.filter(te=>!te.deleting))},300);else throw new Error("Delete failed: "+j.message)}catch(M){console.error("Failed to delete session:",M);const B=document.querySelector(`[data-session-id="${y}"]`);B&&B.classList.remove("deleting")}finally{t(6,p=null)}})}function b(){d&&k(d)}const v=y=>z(y,"关闭历史会话");function R(){h=this.value,t(4,h)}const L=y=>l(y.sessionId),C=(y,M)=>w(M,y.sessionId),X=()=>t(7,d=null);return s.$$set=y=>{"sessions"in y&&t(0,n=y.sessions),"onClose"in y&&t(1,i=y.onClose),"onSelect"in y&&t(2,l=y.onSelect),"zIndex"in y&&t(3,o=y.zIndex)},s.$$.update=()=>{s.$$.dirty&16&&h!==void 0&&(t(0,n=[]),u=0,c=!0,_())},[n,i,l,o,h,r,p,d,m,I,E,z,x,w,b,v,R,L,C,X]}class qs extends Tn{constructor(e){super(),yn(this,e,Xo,Zo,pt,{sessions:0,onClose:1,onSelect:2,zIndex:3})}}function Gs(s,e,t){const n=s.slice();return n[65]=e[t],n}function Ys(s,e,t){const n=s.slice();return n[68]=e[t],n[69]=e,n[70]=t,n}function Zs(s,e,t){const n=s.slice();return n[71]=e[t],n[73]=t,n}function Vo(s){let e,t=[],n=new Map,i=st(s[4]);const l=o=>o[68].id;for(let o=0;o<i.length;o+=1){let r=Ys(s,i,o),c=l(r);n.set(c,t[o]=ei(c,r))}return{c(){e=S("div");for(let o=0;o<t.length;o+=1)t[o].c();a(e,"class","sy-assistant-message-list svelte-mogmt")},m(o,r){G(o,e,r);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);s[50](e)},p(o,r){r[0]&2144465394&&(i=st(o[4]),t=ss(t,r,l,1,o,i,n,e,ns,ei,null,Ys))},i:U,o:U,d(o){o&&W(e);for(let r=0;r<t.length;r+=1)t[r].d();s[50](null)}}}function Qo(s){let e,t;return e=new qs({props:{sessions:s[31],onClose:s[33],onSelect:s[34],zIndex:s[1]}}),{c(){bn(e.$$.fragment)},m(n,i){Zt(e,n,i),t=!0},p(n,i){const l={};i[0]&2&&(l.zIndex=n[1]),e.$set(l)},i(n){t||(Ue(e.$$.fragment,n),t=!0)},o(n){Ke(e.$$.fragment,n),t=!1},d(n){Xt(e,n)}}}function Jo(s){let e;return{c(){e=S("div"),e.innerHTML='<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"></path></svg>',a(e,"class","sy-assistant-avatar user svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function Ko(s){let e;return{c(){e=S("div"),e.innerHTML='<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>',a(e,"class","sy-assistant-avatar assistant svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function $o(s){let e,t=s[20](s[68].content)+"";return{c(){e=S("div"),a(e,"class","markdown-content svelte-mogmt")},m(n,i){G(n,e,i),e.innerHTML=t},p(n,i){i[0]&16&&t!==(t=n[20](n[68].content)+"")&&(e.innerHTML=t)},d(n){n&&W(e)}}}function el(s){let e;return{c(){e=S("span"),e.innerHTML='<span class="dot svelte-mogmt">.</span> <span class="dot svelte-mogmt">.</span> <span class="dot svelte-mogmt">.</span>',a(e,"class","sy-assistant-loading svelte-mogmt")},m(t,n){G(t,e,n)},p:U,d(t){t&&W(e)}}}function Xs(s){let e,t=st(s[68].attachments),n=[];for(let i=0;i<t.length;i+=1)n[i]=Js(Zs(s,t,i));return{c(){e=S("div");for(let i=0;i<n.length;i+=1)n[i].c();a(e,"class","sy-assistant-attachments svelte-mogmt")},m(i,l){G(i,e,l);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,l){if(l[0]&29360370){t=st(i[68].attachments);let o;for(o=0;o<t.length;o+=1){const r=Zs(i,t,o);n[o]?n[o].p(r,l):(n[o]=Js(r),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=t.length}},d(i){i&&W(e),Jn(n,i)}}}function Vs(s){let e,t,n;function i(...l){return s[37](s[71],...l)}return{c(){e=S("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-mogmt"><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-mogmt"),a(e,"aria-label","查看详情")},m(l,o){G(l,e,o),t||(n=[Y(e,"mouseenter",i),Y(e,"mouseleave",s[23])],t=!0)},p(l,o){s=l},d(l){l&&W(e),t=!1,_e(n)}}}function Qs(s){let e,t=s[5].replace(/\n/g,"<br>")+"",n,i;return{c(){e=S("div"),a(e,"class","sy-assistant-tooltip svelte-mogmt"),a(e,"role","tooltip"),P(e,"left",s[6].x+"px"),P(e,"top",s[6].y+"px"),P(e,"z-index",s[1]+3),K(e,"align-right",s[6].alignRight)},m(l,o){G(l,e,o),e.innerHTML=t,n||(i=[Y(e,"mouseenter",s[39]),Y(e,"mouseleave",s[40])],n=!0)},p(l,o){o[0]&32&&t!==(t=l[5].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),o[0]&64&&P(e,"left",l[6].x+"px"),o[0]&64&&P(e,"top",l[6].y+"px"),o[0]&2&&P(e,"z-index",l[1]+3),o[0]&64&&K(e,"align-right",l[6].alignRight)},d(l){l&&W(e),n=!1,_e(i)}}}function Js(s){let e,t,n,i,l,o,r,c,u,h=on(s[71].content_title).name+"",p,d,m,_=on(s[71].content_title).ext+"",E,I,z,x,w,k,b,v,R,L,C=s[71].tips&&Vs(s);function X(){return s[38](s[71])}let y=s[5]&&Qs(s);return{c(){e=S("div"),t=S("div"),n=S("div"),i=J("svg"),l=J("path"),o=J("polyline"),r=q(),c=S("div"),u=S("span"),p=Te(h),d=q(),m=S("span"),E=Te(_),z=q(),x=S("div"),C&&C.c(),w=q(),k=S("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-mogmt"><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>',b=q(),y&&y.c(),v=q(),a(l,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),a(o,"points","13 2 13 9 20 9"),a(i,"xmlns","http://www.w3.org/2000/svg"),a(i,"width","16"),a(i,"height","16"),a(i,"viewBox","0 0 24 24"),a(i,"fill","none"),a(i,"stroke","currentColor"),a(i,"stroke-width","2"),a(i,"stroke-linecap","round"),a(i,"stroke-linejoin","round"),a(u,"class","sy-assistant-filename svelte-mogmt"),a(m,"class","sy-assistant-attachment-ext svelte-mogmt"),a(c,"class","sy-assistant-attachment-name svelte-mogmt"),a(c,"title",I=s[71].content_title),a(n,"class","sy-assistant-attachment-title svelte-mogmt"),a(k,"class","sy-assistant-attachment-toggle svelte-mogmt"),a(k,"aria-label","下载文件"),a(x,"class","sy-assistant-attachment-actions svelte-mogmt"),a(t,"class","sy-assistant-attachment-header svelte-mogmt"),a(e,"class","sy-assistant-attachment svelte-mogmt")},m(M,B){G(M,e,B),g(e,t),g(t,n),g(n,i),g(i,l),g(i,o),g(n,r),g(n,c),g(c,u),g(u,p),g(c,d),g(c,m),g(m,E),g(t,z),g(t,x),C&&C.m(x,null),g(x,w),g(x,k),g(e,b),y&&y.m(e,null),g(e,v),R||(L=Y(k,"click",X),R=!0)},p(M,B){s=M,B[0]&16&&h!==(h=on(s[71].content_title).name+"")&&Pe(p,h),B[0]&16&&_!==(_=on(s[71].content_title).ext+"")&&Pe(E,_),B[0]&16&&I!==(I=s[71].content_title)&&a(c,"title",I),s[71].tips?C?C.p(s,B):(C=Vs(s),C.c(),C.m(x,w)):C&&(C.d(1),C=null),s[5]?y?y.p(s,B):(y=Qs(s),y.c(),y.m(e,v)):y&&(y.d(1),y=null)},d(M){M&&W(e),C&&C.d(),y&&y.d(),R=!1,L()}}}function Ks(s){let e,t,n,i,l,o,r,c,u,h,p;function d(v,R){return v[12][v[68].id]?nl:tl}let m=d(s),_=m(s);function E(){return s[41](s[68])}function I(...v){return s[42](s[68],...v)}function z(){return s[43](s[68])}function x(...v){return s[44](s[68],...v)}function w(...v){return s[45](s[68],...v)}function k(...v){return s[46](s[68],...v)}let b=s[15]&&s[13][s[68].id]==="dislike"&&$s(s);return{c(){e=S("div"),t=S("button"),_.c(),i=q(),l=S("button"),l.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>',o=q(),r=S("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=q(),b&&b.c(),u=qt(),a(t,"class","sy-assistant-action-button svelte-mogmt"),a(t,"aria-label",n=s[12][s[68].id]?"已复制":"复制内容"),K(t,"copied",s[12][s[68].id]),a(l,"class","sy-assistant-action-button svelte-mogmt"),a(l,"aria-label","点赞"),K(l,"active",s[13][s[68].id]==="like"),a(r,"class","sy-assistant-action-button svelte-mogmt"),a(r,"aria-label","点踩"),K(r,"active",s[13][s[68].id]==="dislike"),a(e,"class","sy-assistant-message-actions svelte-mogmt")},m(v,R){G(v,e,R),g(e,t),_.m(t,null),g(e,i),g(e,l),g(e,o),g(e,r),G(v,c,R),b&&b.m(v,R),G(v,u,R),h||(p=[Y(t,"click",E),Y(t,"mouseenter",I),Y(t,"mouseleave",s[30]),Y(l,"click",z),Y(l,"mouseenter",x),Y(l,"mouseleave",s[30]),Y(r,"click",w),Y(r,"mouseenter",k),Y(r,"mouseleave",s[30])],h=!0)},p(v,R){s=v,m!==(m=d(s))&&(_.d(1),_=m(s),_&&(_.c(),_.m(t,null))),R[0]&4112&&n!==(n=s[12][s[68].id]?"已复制":"复制内容")&&a(t,"aria-label",n),R[0]&4112&&K(t,"copied",s[12][s[68].id]),R[0]&8208&&K(l,"active",s[13][s[68].id]==="like"),R[0]&8208&&K(r,"active",s[13][s[68].id]==="dislike"),s[15]&&s[13][s[68].id]==="dislike"?b?b.p(s,R):(b=$s(s),b.c(),b.m(u.parentNode,u)):b&&(b.d(1),b=null)},d(v){v&&(W(e),W(c),W(u)),_.d(),b&&b.d(v),h=!1,_e(p)}}}function tl(s){let e,t,n;return{c(){e=J("svg"),t=J("rect"),n=J("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(i,l){G(i,e,l),g(e,t),g(e,n)},d(i){i&&W(e)}}}function nl(s){let e,t;return{c(){e=J("svg"),t=J("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,i){G(n,e,i),g(e,t)},d(n){n&&W(e)}}}function $s(s){let e,t,n,i,l,o,r,c,u,h,p;function d(){s[47].call(i,s[68])}function m(){return s[48](s[68])}function _(){return s[49](s[68])}return{c(){e=S("div"),t=S("div"),t.textContent="反馈意见",n=q(),i=S("textarea"),l=q(),o=S("div"),r=S("button"),r.textContent="取消",c=q(),u=S("button"),u.textContent="提交",a(t,"class","sy-assistant-dislike-title svelte-mogmt"),a(i,"class","sy-assistant-dislike-input svelte-mogmt"),a(i,"placeholder","请输入您的反馈意见..."),a(r,"class","sy-assistant-popup-cancel svelte-mogmt"),a(u,"class","sy-assistant-popup-submit svelte-mogmt"),a(o,"class","sy-assistant-popup-actions svelte-mogmt"),a(e,"class","sy-assistant-dislike-popup svelte-mogmt"),P(e,"left",s[16].x+"px"),P(e,"top",s[16].y+"px"),P(e,"z-index",s[1]+3)},m(E,I){G(E,e,I),g(e,t),g(e,n),g(e,i),nt(i,s[14][s[68].id]),g(e,l),g(e,o),g(o,r),g(o,c),g(o,u),h||(p=[Y(i,"input",d),Y(r,"click",m),Y(u,"click",_)],h=!0)},p(E,I){s=E,I[0]&16400&&nt(i,s[14][s[68].id]),I[0]&65536&&P(e,"left",s[16].x+"px"),I[0]&65536&&P(e,"top",s[16].y+"px"),I[0]&2&&P(e,"z-index",s[1]+3)},d(E){E&&W(e),h=!1,_e(p)}}}function ei(s,e){let t,n,i,l,o,r,c,u,h=new Date(e[68].timestamp).toLocaleString()+"",p,d;function m(b,v){return b[68].type==="assistant"?Ko:Jo}let _=m(e),E=_(e);function I(b,v){return b[8]&&b[68].id===b[4][b[4].length-1].id&&b[68].type==="assistant"&&!b[68].content?el:$o}let z=I(e),x=z(e),w=e[68].attachments&&Xs(e),k=e[68].id!=="-1"&&e[68].type==="assistant"&&!e[8]&&Ks(e);return{key:s,first:null,c(){t=S("div"),E.c(),n=q(),i=S("div"),l=S("div"),x.c(),o=q(),w&&w.c(),r=q(),k&&k.c(),c=q(),u=S("div"),p=Te(h),d=q(),a(l,"class","sy-assistant-message-content svelte-mogmt"),a(u,"class","sy-assistant-message-time svelte-mogmt"),a(i,"class","sy-assistant-message-bubble svelte-mogmt"),a(t,"class","sy-assistant-message svelte-mogmt"),K(t,"user",e[68].type==="user"),this.first=t},m(b,v){G(b,t,v),E.m(t,null),g(t,n),g(t,i),g(i,l),x.m(l,null),g(l,o),w&&w.m(l,null),g(l,r),k&&k.m(l,null),g(i,c),g(i,u),g(u,p),g(t,d)},p(b,v){e=b,_!==(_=m(e))&&(E.d(1),E=_(e),E&&(E.c(),E.m(t,n))),z===(z=I(e))&&x?x.p(e,v):(x.d(1),x=z(e),x&&(x.c(),x.m(l,o))),e[68].attachments?w?w.p(e,v):(w=Xs(e),w.c(),w.m(l,r)):w&&(w.d(1),w=null),e[68].id!=="-1"&&e[68].type==="assistant"&&!e[8]?k?k.p(e,v):(k=Ks(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),v[0]&16&&h!==(h=new Date(e[68].timestamp).toLocaleString()+"")&&Pe(p,h),v[0]&16&&K(t,"user",e[68].type==="user")},d(b){b&&W(t),E.d(),x.d(),w&&w.d(),k&&k.d()}}}function ti(s){let e,t,n,i,l,o,r,c,u,h,p,d,m,_,E,I,z,x,w,k,b,v,R,L,C,X,y,M=s[0]&&ni(s),B=!s[0]&&ii();return{c(){e=S("div"),t=S("div"),M&&M.c(),n=q(),B&&B.c(),i=q(),l=S("div"),o=S("button"),o.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>',r=q(),c=S("button"),c.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>',u=q(),h=S("div"),p=S("div"),d=S("div"),m=S("div"),_=S("textarea"),E=q(),I=S("div"),z=Te(s[3]),x=Te("/"),w=Te(jn),k=q(),b=S("button"),v=J("svg"),R=J("line"),L=J("polygon"),a(o,"class","sy-assistant-icon-button svelte-mogmt"),a(o,"aria-label","历史会话"),a(c,"class","sy-assistant-icon-button svelte-mogmt"),a(c,"aria-label","新建会话"),a(l,"class","sy-assistant-chat-actions-btns svelte-mogmt"),a(t,"class","sy-assistant-chat-actions svelte-mogmt"),a(e,"class","sy-assistant-chat-footer svelte-mogmt"),a(_,"class","sy-assistant-textarea svelte-mogmt"),a(_,"placeholder","输入您的问题..."),a(_,"maxlength",jn),a(_,"rows","3"),a(I,"class","sy-assistant-char-count svelte-mogmt"),K(I,"over-limit",s[19]),a(m,"class","sy-assistant-textarea-container svelte-mogmt"),a(d,"class","sy-assistant-input-wrapper svelte-mogmt"),a(R,"x1","22"),a(R,"y1","2"),a(R,"x2","11"),a(R,"y2","13"),a(L,"points","22 2 15 22 11 13 2 9 22 2"),a(v,"xmlns","http://www.w3.org/2000/svg"),a(v,"width","20"),a(v,"height","20"),a(v,"viewBox","0 0 24 24"),a(v,"fill","none"),a(v,"stroke","currentColor"),a(v,"stroke-width","2"),a(v,"stroke-linecap","round"),a(v,"stroke-linejoin","round"),a(b,"class","sy-assistant-send-button svelte-mogmt"),b.disabled=C=!s[2].trim()||s[19],a(b,"aria-label","发送消息"),a(p,"class","sy-assistant-input-container svelte-mogmt"),a(h,"class","sy-assistant-input-area svelte-mogmt")},m(j,te){G(j,e,te),g(e,t),M&&M.m(t,null),g(t,n),B&&B.m(t,null),g(t,i),g(t,l),g(l,o),g(l,r),g(l,c),G(j,u,te),G(j,h,te),g(h,p),g(p,d),g(d,m),g(m,_),nt(_,s[2]),g(m,E),g(m,I),g(I,z),g(I,x),g(I,w),g(p,k),g(p,b),g(b,v),g(v,R),g(v,L),X||(y=[Y(o,"click",s[32]),Y(o,"mouseenter",s[52]),Y(o,"mouseleave",s[30]),Y(c,"click",s[35]),Y(c,"mouseenter",s[53]),Y(c,"mouseleave",s[30]),Y(_,"input",s[54]),Y(_,"keydown",s[55]),Y(b,"click",s[21]),Y(b,"mouseenter",s[56]),Y(b,"mouseleave",s[30])],X=!0)},p(j,te){j[0]?M?M.p(j,te):(M=ni(j),M.c(),M.m(t,n)):M&&(M.d(1),M=null),j[0]?B&&(B.d(1),B=null):B||(B=ii(),B.c(),B.m(t,i)),te[0]&4&&nt(_,j[2]),te[0]&8&&Pe(z,j[3]),te[0]&524288&&K(I,"over-limit",j[19]),te[0]&524292&&C!==(C=!j[2].trim()||j[19])&&(b.disabled=C)},d(j){j&&(W(e),W(u),W(h)),M&&M.d(),B&&B.d(),X=!1,_e(y)}}}function ni(s){let e,t,n,i,l=st(s[10]),o=[];for(let r=0;r<l.length;r+=1)o[r]=si(Gs(s,l,r));return{c(){e=S("div"),t=S("select");for(let r=0;r<o.length;r+=1)o[r].c();a(t,"class","sy-assistant-select svelte-mogmt"),s[11]===void 0&&Gt(()=>s[51].call(t)),a(e,"class","sy-assistant-scene-select svelte-mogmt")},m(r,c){G(r,e,c),g(e,t);for(let u=0;u<o.length;u+=1)o[u]&&o[u].m(t,null);$n(t,s[11],!0),n||(i=Y(t,"change",s[51]),n=!0)},p(r,c){if(c[0]&1024){l=st(r[10]);let u;for(u=0;u<l.length;u+=1){const h=Gs(r,l,u);o[u]?o[u].p(h,c):(o[u]=si(h),o[u].c(),o[u].m(t,null))}for(;u<o.length;u+=1)o[u].d(1);o.length=l.length}c[0]&3072&&$n(t,r[11])},d(r){r&&W(e),Jn(o,r),n=!1,i()}}}function si(s){let e,t=s[65].name+"",n,i,l;return{c(){e=S("option"),n=Te(t),i=q(),e.__value=l=s[65].code,nt(e,e.__value)},m(o,r){G(o,e,r),g(e,n),g(e,i)},p(o,r){r[0]&1024&&t!==(t=o[65].name+"")&&Pe(n,t),r[0]&1024&&l!==(l=o[65].code)&&(e.__value=l,nt(e,e.__value))},d(o){o&&W(e)}}}function ii(s){let e;return{c(){e=S("div"),a(e,"class","sy-assistant-scene-select svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function oi(s){let e,t=s[17].text+"",n;return{c(){e=S("div"),n=Te(t),a(e,"class","sy-assistant-button-tooltip svelte-mogmt"),P(e,"left",s[17].x+"px"),P(e,"top",s[17].y+"px")},m(i,l){G(i,e,l),g(e,n)},p(i,l){l[0]&131072&&t!==(t=i[17].text+"")&&Pe(n,t),l[0]&131072&&P(e,"left",i[17].x+"px"),l[0]&131072&&P(e,"top",i[17].y+"px")},d(i){i&&W(e)}}}function sl(s){let e,t,n,i,l,o,r;const c=[Qo,Vo],u=[];function h(m,_){return m[18]?0:1}t=h(s),n=u[t]=c[t](s);let p=!s[18]&&ti(s),d=s[17]&&oi(s);return{c(){e=S("div"),n.c(),i=q(),p&&p.c(),l=q(),d&&d.c(),o=qt(),a(e,"class","sy-assistant-chat-container svelte-mogmt"),P(e,"z-index",s[1]+2)},m(m,_){G(m,e,_),u[t].m(e,null),g(e,i),p&&p.m(e,null),s[57](e),G(m,l,_),d&&d.m(m,_),G(m,o,_),r=!0},p(m,_){let E=t;t=h(m),t===E?u[t].p(m,_):(kn(),Ke(u[E],1,1,()=>{u[E]=null}),wn(),n=u[t],n?n.p(m,_):(n=u[t]=c[t](m),n.c()),Ue(n,1),n.m(e,i)),m[18]?p&&(p.d(1),p=null):p?p.p(m,_):(p=ti(m),p.c(),p.m(e,null)),(!r||_[0]&2)&&P(e,"z-index",m[1]+2),m[17]?d?d.p(m,_):(d=oi(m),d.c(),d.m(o.parentNode,o)):d&&(d.d(1),d=null)},i(m){r||(Ue(n),r=!0)},o(m){Ke(n),r=!1},d(m){m&&(W(e),W(l),W(o)),u[t].d(),p&&p.d(),s[57](null),d&&d.d(m)}}}let jn=500;function il(s){const e=s.match(/source#\[(.*)\]#source/);return e?s.replace(`source#[${e[1]}]#source`,""):s}function li(s){const e=s.match(/source#\[(.*)\]#source/);if(e)try{return JSON.parse(`[${e[1]}]`)}catch(t){console.error("Failed to parse attachments:",t)}return null}function on(s){const e=s.split(".");if(e.length>1){const t=e.pop()||"";return{name:e.join("."),ext:t?`.${t}`:""}}return{name:s,ext:""}}function ol(s,e,t){let n,i,l="",o=[{sessionId:"",requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],r="",c=null,u=null,h={x:0,y:0,alignRight:!1},p=null,d=!1;ee.setOptions({breaks:!0,gfm:!0});function m(T){try{const F=ee(T);return Ns.sanitize(F)}catch(F){console.warn("Markdown parsing failed, fallback to HTML:",F);try{const Q=T.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return Ns.sanitize(Q)}catch(Q){return console.error("HTML fallback failed:",Q),T}}}let _;function E(T=!1){_&&_.scrollTo({top:_.scrollHeight,behavior:T?"smooth":"auto"})}xi(()=>{E(!1)});let{sessionId:I}=e,z=[],x="",{hasScene:w=!1}=e;function k(){return Re(this,null,function*(){var T;if(w)try{const F=yield fetch("/aiops/aigc/chat/getSceneList",{headers:{"Auth-Token":`${de()}`,Authorization:`bearer ${de()}`}});if(!F.ok)throw new Error("Failed to fetch scenes");const Q=yield F.json();Q.status==="success"&&((T=Q.data)!=null&&T.sceneList)&&(t(10,z=Q.data.sceneList),z.length>0&&t(11,x=z[0].code))}catch(F){console.error("Failed to fetch scenes:",F)}})}gn(()=>{k()});function b(){return Re(this,null,function*(){if(!l.trim()||i)return;if(!I){console.error("No session ID available");return}const T=Date.now().toString(),F=Date.now().toString()+Math.random().toString().slice(2,8),Q={sessionId:I,requestId:F,id:T,type:"user",content:l.trim(),timestamp:Date.now()};t(4,o=[...o,Q]);const fe=l.trim();t(2,l="");const he=(Date.now()+1).toString();r="",t(4,o=[...o,{sessionId:I,requestId:F,id:he,type:"assistant",content:"",timestamp:Date.now()}]),t(8,d=!0),c&&c.abort(),c=new AbortController;try{yield Wi("/aiops/aigc/chat/sse",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`},body:JSON.stringify({sessionId:I,requestId:F,keyword:fe,flowId:"1",extendKeys:w?{sceneCode:x}:void 0}),signal:c.signal,onmessage(ve){try{const Ee=ve.data;if(Ee){const vt=li(Ee);vt?(t(4,o=o.map(Ge=>Ge.id===he?Ae(le({},Ge),{attachments:vt}):Ge)),E(!0)):(r+=Ee,t(4,o=o.map(Ge=>Ge.id===he?Ae(le({},Ge),{content:r}):Ge)),E(!1))}}catch(Ee){console.error("Failed to process SSE message:",Ee)}},onerror(ve){console.error("SSE error:",ve),c=null,t(8,d=!1)},onclose(){c=null,t(8,d=!1)}})}catch(ve){console.error("Failed to send message:",ve),t(8,d=!1)}})}function v(T,F,Q){const fe=Q.getBoundingClientRect(),he=_.getBoundingClientRect(),ve=fe.left<he.width/2;t(5,u=F),t(6,h={x:fe.left,y:fe.top+fe.height/2,alignRight:ve})}function R(){t(7,p=setTimeout(()=>{t(5,u=null),t(7,p=null)},200))}Ii(()=>{c&&c.abort(),p&&clearTimeout(p)});function L(T,F){return Re(this,null,function*(){try{const Q=yield fetch("/aiops/aigc/file/downloadFile",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`},body:JSON.stringify({fileName:T,fileUrl:F})});if(!Q.ok)throw new Error("Download failed");const fe=Q.headers.get("content-type")||"application/octet-stream",he=yield Q.blob(),ve=window.URL.createObjectURL(he),Ee=document.createElement("a");Ee.href=ve,Ee.download=T,document.body.appendChild(Ee),Ee.click(),window.URL.revokeObjectURL(ve),document.body.removeChild(Ee)}catch(Q){console.error("Failed to download file:",Q)}})}let C={};function X(T,F){return Re(this,null,function*(){try{const Q=F.replace(/<br\s*\/?>/g,`
48
- `).replace(/\*\*(.*?)\*\*/g,"$1").replace(/###/g,"").trim();yield navigator.clipboard.writeText(Q),t(12,C[T]=!0,C),setTimeout(()=>{t(12,C[T]=!1,C),t(12,C)},1500)}catch(Q){console.error("Failed to copy:",Q)}})}let y={},M={},B=!1;function j(T,F){return Re(this,null,function*(){if(y[T]===F){t(13,y[T]=null,y),t(13,y);return}if(t(13,y[T]=F,y),t(13,y),F==="like")try{if(!(yield fetch("/aiops/aigc/chat/record/feedback",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`},body:JSON.stringify({sessionId:I,requestId:T,feedBackFlag:"1",feedBackContent:"点赞"})})).ok)throw new Error("Feedback failed")}catch(Q){console.error("Failed to send feedback:",Q),t(13,y[T]=null,y),t(13,y)}else t(15,B=!0)})}function te(T){return Re(this,null,function*(){var F;if((F=M[T])!=null&&F.trim())try{if(!(yield fetch("/aiops/aigc/chat/record/feedback",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`},body:JSON.stringify({sessionId:I,requestId:T,feedBackFlag:"0",feedBackContent:M[T]})})).ok)throw new Error("Feedback failed");t(15,B=!1),t(14,M[T]="",M),t(14,M)}catch(Q){console.error("Failed to send feedback:",Q),t(13,y[T]=null,y),t(13,y)}})}let ke={x:0,y:0};function me(T,F){const fe=T.currentTarget.getBoundingClientRect();t(16,ke={x:fe.left-290,y:fe.top-160}),j(F,"dislike")}let Be=null;function re(T,F){const fe=T.currentTarget.getBoundingClientRect();t(17,Be={text:F,x:fe.left+fe.width/2,y:fe.top-8})}function qe(){t(17,Be=null)}let ie=!1,$e=[],ne=Date.now().toString();function Me(){qe(),t(18,ie=!0)}function oe(){qe(),t(18,ie=!1)}function Oe(T){return Re(this,null,function*(){if(!d){t(8,d=!0);try{const F=yield fetch("/aiops/aigc/chat/record/session/detail/query",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`},body:JSON.stringify({sessionId:T})});if(!F.ok)throw new Error("Failed to load sessions");const Q=yield F.json();if(Q.code===0){ne=T,t(18,ie=!1);const fe=Q.data.map((he,ve)=>{const Ee=li(he.answer),vt=il(he.answer);return[{sessionId:he.sessionId,requestId:he.requestId,id:(Date.now()+2*ve).toString(),type:"user",content:he.keyword,timestamp:new Date(he.createDate).getTime()},{sessionId:he.sessionId,requestId:he.requestId,id:(Date.now()+2*ve+1).toString(),type:"assistant",content:vt,attachments:Ee,timestamp:new Date(he.createDate).getTime()}]});t(4,o=fe.flat())}}catch(F){console.error("Failed to load sessions:",F)}finally{t(8,d=!1)}}})}function xe(){return Re(this,null,function*(){const T=yield et();if(!T){console.error("Failed to create new session");return}ne=T,t(4,o=[{sessionId:ne,requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}]),t(2,l="")})}function et(){return Re(this,null,function*(){try{const T=yield fetch("/aiops/aigc/chat/getSessionId",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`}});if(!T.ok)throw new Error("Failed to get session ID");const F=yield T.json();if(F.code===0)return ne=F.data.sessionId,ne;throw new Error(F.message||"Failed to get session ID")}catch(T){return console.error("Failed to get session ID:",T),null}})}let{zIndex:D}=e;const ae=(T,F)=>v(F,T.tips,F.currentTarget),N=T=>L(T.content_title,T.link),Z=()=>{p&&(clearTimeout(p),t(7,p=null))},we=()=>{t(5,u=null)},be=T=>X(T.id,T.content),De=(T,F)=>re(F,C[T.id]?"已复制":"复制内容"),je=T=>j(T.id,"like"),it=(T,F)=>re(F,y[T.id]==="like"?"取消点赞":"点赞"),yt=(T,F)=>me(F,T.id),Tt=(T,F)=>re(F,y[T.id]==="dislike"?"取消点踩":"点踩");function ln(T){M[T.id]=this.value,t(14,M)}const rn=T=>{t(15,B=!1),t(13,y[T.id]=null,y),t(13,y)},Wn=T=>te(T.id);function Ht(T){_t[T?"unshift":"push"](()=>{_=T,t(9,_)})}function ht(){x=Ai(this),t(11,x),t(10,z)}const ot=T=>re(T,"历史会话"),lt=T=>re(T,"新建会话");function an(){l=this.value,t(2,l)}const cn=T=>T.key==="Enter"&&!T.shiftKey&&(b(),T.preventDefault()),un=T=>re(T,"发送消息");function Bt(T){_t[T?"unshift":"push"](()=>{_=T,t(9,_)})}return s.$$set=T=>{"sessionId"in T&&t(36,I=T.sessionId),"hasScene"in T&&t(0,w=T.hasScene),"zIndex"in T&&t(1,D=T.zIndex)},s.$$.update=()=>{s.$$.dirty[0]&4&&t(3,n=l.length),s.$$.dirty[0]&8&&t(19,i=n>jn)},[w,D,l,n,o,u,h,p,d,_,z,x,C,y,M,B,ke,Be,ie,i,m,b,v,R,L,X,j,te,me,re,qe,$e,Me,oe,Oe,xe,I,ae,N,Z,we,be,De,je,it,yt,Tt,ln,rn,Wn,Ht,ht,ot,lt,an,cn,un,Bt]}class ll extends Tn{constructor(e){super(),yn(this,e,ol,sl,pt,{sessionId:36,hasScene:0,zIndex:1},null,[-1,-1,-1])}}function ri(s){let e,t,n,i,l=s[3].title+"",o,r,c,u,h,p,d,m,_,E=s[2]?"退出全屏":"全屏显示",I,z,x,w,k,b,v,R,L=s[7]?"取消吸附":"吸附到边缘",C,X,y,M,B,j,te,ke,me,Be=`${s[3].height}px`,re,qe,ie;function $e(N,Z){return N[2]?al:rl}let ne=$e(s),Me=ne(s);function oe(N,Z){return N[7]?ul:cl}let Oe=oe(s),xe=Oe(s);const et=[hl,fl],D=[];function ae(N,Z){return N[8]?0:1}return ke=ae(s),me=D[ke]=et[ke](s),{c(){var N,Z,we;e=S("div"),t=S("div"),n=S("div"),i=S("h3"),o=Te(l),r=q(),c=S("div"),u=S("div"),h=S("button"),p=J("svg"),Me.c(),m=q(),_=S("span"),I=Te(E),z=q(),x=S("div"),w=S("button"),k=J("svg"),xe.c(),v=q(),R=S("span"),C=Te(L),X=q(),y=S("div"),M=S("button"),M.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>',B=q(),j=S("span"),j.textContent="关闭助手",te=q(),me.c(),a(i,"class","svelte-1427avp"),a(p,"xmlns","http://www.w3.org/2000/svg"),a(p,"width","18"),a(p,"height","18"),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(h,"class","sy-assistant-action-button svelte-1427avp"),a(h,"aria-label",d=s[2]?"退出全屏":"全屏显示"),K(h,"active",s[2]),a(_,"class","sy-assistant-tooltip svelte-1427avp"),P(_,"z-index",((N=s[3].zIndex)!=null?N:1e3)+3),a(u,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),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(w,"class","sy-assistant-action-button svelte-1427avp"),a(w,"aria-label",b=s[7]?"取消吸附":"吸附到边缘"),K(w,"active",s[7]),a(R,"class","sy-assistant-tooltip svelte-1427avp"),P(R,"z-index",((Z=s[3].zIndex)!=null?Z:1e3)+3),a(x,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),a(M,"class","sy-assistant-close-button svelte-1427avp"),a(M,"aria-label","关闭助手"),a(j,"class","sy-assistant-tooltip svelte-1427avp"),P(j,"z-index",((we=s[3].zIndex)!=null?we:1e3)+3),a(y,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),a(c,"class","sy-assistant-header-actions svelte-1427avp"),a(n,"class","sy-assistant-drawer-header svelte-1427avp"),a(n,"role","button"),a(n,"tabindex","0"),a(n,"aria-label","拖动助手窗口"),K(n,"dragging",s[6]),K(n,"fullscreen",s[2]),K(n,"snapped",s[7]),a(t,"class","sy-assistant-drawer-content svelte-1427avp"),a(e,"class","sy-assistant-drawer svelte-1427avp"),K(e,"fullscreen",s[2]),P(e,"height",Be)},m(N,Z){G(N,e,Z),g(e,t),g(t,n),g(n,i),g(i,o),g(n,r),g(n,c),g(c,u),g(u,h),g(h,p),Me.m(p,null),g(u,m),g(u,_),g(_,I),g(c,z),g(c,x),g(x,w),g(w,k),xe.m(k,null),g(x,v),g(x,R),g(R,C),g(c,X),g(c,y),g(y,M),g(y,B),g(y,j),g(t,te),D[ke].m(t,null),re=!0,qe||(ie=[Y(h,"click",s[16]),Y(w,"click",s[18]),Y(M,"click",s[15]),Y(n,"mousedown",Kn(s[17]))],qe=!0)},p(N,Z){var be,De,je;(!re||Z[0]&8)&&l!==(l=N[3].title+"")&&Pe(o,l),ne!==(ne=$e(N))&&(Me.d(1),Me=ne(N),Me&&(Me.c(),Me.m(p,null))),(!re||Z[0]&4&&d!==(d=N[2]?"退出全屏":"全屏显示"))&&a(h,"aria-label",d),(!re||Z[0]&4)&&K(h,"active",N[2]),(!re||Z[0]&4)&&E!==(E=N[2]?"退出全屏":"全屏显示")&&Pe(I,E),Z[0]&8&&P(_,"z-index",((be=N[3].zIndex)!=null?be:1e3)+3),Oe!==(Oe=oe(N))&&(xe.d(1),xe=Oe(N),xe&&(xe.c(),xe.m(k,null))),(!re||Z[0]&128&&b!==(b=N[7]?"取消吸附":"吸附到边缘"))&&a(w,"aria-label",b),(!re||Z[0]&128)&&K(w,"active",N[7]),(!re||Z[0]&128)&&L!==(L=N[7]?"取消吸附":"吸附到边缘")&&Pe(C,L),Z[0]&8&&P(R,"z-index",((De=N[3].zIndex)!=null?De:1e3)+3),Z[0]&8&&P(j,"z-index",((je=N[3].zIndex)!=null?je:1e3)+3),(!re||Z[0]&64)&&K(n,"dragging",N[6]),(!re||Z[0]&4)&&K(n,"fullscreen",N[2]),(!re||Z[0]&128)&&K(n,"snapped",N[7]);let we=ke;ke=ae(N),ke===we?D[ke].p(N,Z):(kn(),Ke(D[we],1,1,()=>{D[we]=null}),wn(),me=D[ke],me?me.p(N,Z):(me=D[ke]=et[ke](N),me.c()),Ue(me,1),me.m(t,null)),(!re||Z[0]&4)&&K(e,"fullscreen",N[2]),Z[0]&8&&Be!==(Be=`${N[3].height}px`)&&P(e,"height",Be)},i(N){re||(Ue(me),re=!0)},o(N){Ke(me),re=!1},d(N){N&&W(e),Me.d(),xe.d(),D[ke].d(),qe=!1,_e(ie)}}}function rl(s){let e;return{c(){e=J("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){G(t,e,n)},d(t){t&&W(e)}}}function al(s){let e;return{c(){e=J("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){G(t,e,n)},d(t){t&&W(e)}}}function cl(s){let e,t;return{c(){e=J("rect"),t=J("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,i){G(n,e,i),G(n,t,i)},d(n){n&&(W(e),W(t))}}}function ul(s){let e,t;return{c(){e=J("rect"),t=J("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,i){G(n,e,i),G(n,t,i)},d(n){n&&(W(e),W(t))}}}function fl(s){var n;let e,t;return e=new ll({props:{zIndex:(n=s[3].zIndex)!=null?n:1e3,sessionId:s[9],hasScene:s[3].hasScene}}),{c(){bn(e.$$.fragment)},m(i,l){Zt(e,i,l),t=!0},p(i,l){var r;const o={};l[0]&8&&(o.zIndex=(r=i[3].zIndex)!=null?r:1e3),l[0]&512&&(o.sessionId=i[9]),l[0]&8&&(o.hasScene=i[3].hasScene),e.$set(o)},i(i){t||(Ue(e.$$.fragment,i),t=!0)},o(i){Ke(e.$$.fragment,i),t=!1},d(i){Xt(e,i)}}}function hl(s){var n;let e,t;return e=new qs({props:{sessions:s[13],onClose:s[26],onSelect:s[19],zIndex:(n=s[3].zIndex)!=null?n:1e3}}),{c(){bn(e.$$.fragment)},m(i,l){Zt(e,i,l),t=!0},p(i,l){var r;const o={};l[0]&256&&(o.onClose=i[26]),l[0]&8&&(o.zIndex=(r=i[3].zIndex)!=null?r:1e3),e.$set(o)},i(i){t||(Ue(e.$$.fragment,i),t=!0)},o(i){Ke(e.$$.fragment,i),t=!1},d(i){Xt(e,i)}}}function pl(s){let e,t,n=`${s[12]}px`,i,l,o,r,c,u,h,p,d,m,_,E,I,z,x=s[12]>0&&ri(s);return{c(){var w,k;e=S("div"),t=S("div"),x&&x.c(),i=q(),l=S("button"),o=J("svg"),r=J("path"),c=J("path"),u=J("path"),h=J("path"),p=J("path"),d=J("path"),m=J("path"),a(t,"class","sy-assistant-drawer-wrapper svelte-1427avp"),K(t,"fullscreen",s[2]),P(t,"width",n),a(r,"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(r,"fill","#6F8698"),a(c,"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(c,"fill","#3677FF"),a(u,"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(u,"fill","#D0D5F1"),a(h,"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(h,"fill","#3677FF"),a(p,"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(p,"fill","#FFFFFF"),a(d,"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(d,"fill","#FFFFFF"),a(m,"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(m,"fill","#8896A4"),a(o,"class","sy-assistant-icon"),a(o,"viewBox","0 0 1024 1024"),a(o,"version","1.1"),a(o,"xmlns","http://www.w3.org/2000/svg"),a(o,"width","32"),a(o,"height","32"),a(o,"fill","currentColor"),a(o,"aria-label","助手图标"),a(l,"class","sy-assistant-floating-button svelte-1427avp"),a(l,"aria-label","打开助手"),a(l,"style",_=s[10]+" z-index: "+(((w=s[3].zIndex)!=null?w:1e3)+1)+";"),a(e,"class","sy-assistant-container sy-assistant-theme svelte-1427avp"),K(e,"fullscreen",s[2]),K(e,"snapped",s[7]),P(e,"position",s[3].position),P(e,"right",s[7]?0:`${s[0]}px`),P(e,"bottom",s[7]?0:`${s[1]}px`),P(e,"top",s[7]||s[2]?"0":"auto"),P(e,"left",s[2]?"0":"auto"),P(e,"z-index",(k=s[3].zIndex)!=null?k:1e3)},m(w,k){G(w,e,k),g(e,t),x&&x.m(t,null),g(e,i),g(e,l),g(l,o),g(o,r),g(o,c),g(o,u),g(o,h),g(o,p),g(o,d),g(o,m),s[27](l),s[29](e),E=!0,I||(z=[Y(l,"click",s[15]),Y(l,"mousedown",Kn(s[28]))],I=!0)},p(w,k){var b,v;w[12]>0?x?(x.p(w,k),k[0]&4096&&Ue(x,1)):(x=ri(w),x.c(),Ue(x,1),x.m(t,null)):x&&(kn(),Ke(x,1,1,()=>{x=null}),wn()),(!E||k[0]&4)&&K(t,"fullscreen",w[2]),k[0]&4096&&n!==(n=`${w[12]}px`)&&P(t,"width",n),(!E||k[0]&1032&&_!==(_=w[10]+" z-index: "+(((b=w[3].zIndex)!=null?b:1e3)+1)+";"))&&a(l,"style",_),(!E||k[0]&4)&&K(e,"fullscreen",w[2]),(!E||k[0]&128)&&K(e,"snapped",w[7]),k[0]&8&&P(e,"position",w[3].position),k[0]&129&&P(e,"right",w[7]?0:`${w[0]}px`),k[0]&130&&P(e,"bottom",w[7]?0:`${w[1]}px`),k[0]&132&&P(e,"top",w[7]||w[2]?"0":"auto"),k[0]&4&&P(e,"left",w[2]?"0":"auto"),k[0]&8&&P(e,"z-index",(v=w[3].zIndex)!=null?v:1e3)},i(w){E||(Ue(x),E=!0)},o(w){Ke(x),E=!1},d(w){w&&W(e),x&&x.d(),s[27](null),s[29](null),I=!1,_e(z)}}}const Un=48,ge=20;function dl(s,e,t){let n,i,l,o,r=U,c=()=>(r(),r=Je(i,D=>t(12,o=D)),i);s.$$.on_destroy.push(()=>r());const u={position:"fixed",width:480,height:600,title:"智慧运维助手",initialState:"default",defaultPosition:{right:ge,bottom:ge},snappedWidth:480,drawerWidth:480,zIndex:1e3,hasScene:!1};let{target:h="body"}=e,{options:p={}}=e,d,m=null,_=!1,E,I=!1,z=0,x=0,w=ge,k=20,b=w,v=k,R=!1,L=ge,C=50,X=!1,y={width:0,height:0,right:0,bottom:0},M=!1,B=!1,j=[],te=null;function ke(){return Re(this,null,function*(){try{const D=yield fetch("/aiops/aigc/chat/getSessionId",{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${de()}`,Authorization:`bearer ${de()}`}});if(!D.ok)throw new Error("Failed to get session ID");const ae=yield D.json();if(ae.code===0)return t(9,te=ae.data.sessionId),te;throw new Error(ae.message||"Failed to get session ID")}catch(D){return console.error("Failed to get session ID:",D),null}})}function me(D,ae=!1){ae?t(23,R=!0):t(6,I=!0),z=D.clientX,x=D.clientY,w=ae?L:b,k=ae?C:v,D.preventDefault()}function Be(D){if(!I&&!R)return;const ae=z-D.clientX,N=x-D.clientY;if(R){const Z=w+ae,we=D.clientY;t(24,L=Math.max(ge,Math.min(window.innerWidth-Un-ge,Z)));const be=window.innerHeight-Un-ge,je=Math.max(ge,Math.min(be,we));t(25,C=(window.innerHeight-je-Un)/window.innerHeight*100)}else{const Z=n.width||0,we=n.height||0,be=w+ae;t(0,b=Math.max(ge,Math.min(window.innerWidth-Z-ge,be)));const De=k+N;t(1,v=Math.max(ge,Math.min(window.innerHeight-we-ge,De)))}}function re(){t(6,I=!1),t(23,R=!1)}gn(()=>{typeof h=="string"?m=document.querySelector(h)||document.body:m=h||document.body;const D=N=>Be(N),ae=()=>re();return document.addEventListener("mousemove",D),document.addEventListener("mouseup",ae),d&&m&&m.appendChild(d),E&&E.getBoundingClientRect().left,t(7,M=n.initialState==="snapped"),t(2,X=n.initialState==="fullscreen"),n.initialState==="snapped"?(t(0,b=0),t(1,v=0),t(3,n=Ae(le({},n),{height:typeof window!="undefined"?window.innerHeight:n.height,width:n.snappedWidth||n.width}))):n.initialState==="fullscreen"&&(t(0,b=0),t(1,v=0),t(3,n=Ae(le({},n),{width:typeof window!="undefined"?window.innerWidth:n.width,height:typeof window!="undefined"?window.innerHeight:n.height}))),()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",ae),m&&d&&m.removeChild(d)}});function qe(){return Re(this,null,function*(){_||(yield ke()),t(22,_=!_)})}function ie(){var D,ae,N,Z,we,be,De,je;t(2,X=!X),X?(y.width||(y={width:u.width,height:u.height,right:(ae=(D=u.defaultPosition)==null?void 0:D.right)!=null?ae:ge,bottom:(Z=(N=u.defaultPosition)==null?void 0:N.bottom)!=null?Z:ge}),M&&t(7,M=!1),t(20,p=Ae(le({},n),{width:window.innerWidth,height:window.innerHeight,drawerWidth:window.innerWidth})),t(0,b=0),t(1,v=0)):(t(20,p=Ae(le({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,b=(be=(we=u.defaultPosition)==null?void 0:we.right)!=null?be:ge),t(1,v=(je=(De=u.defaultPosition)==null?void 0:De.bottom)!=null?je:ge))}function $e(D){X||me(D)}function ne(){var D,ae,N,Z;X&&(t(2,X=!1),t(20,p=Ae(le({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth}))),t(7,M=!M),M?(n.height,t(0,b=0),t(1,v=0),t(20,p=Ae(le({},n),{height:window.innerHeight,width:n.snappedWidth||u.width,drawerWidth:n.snappedWidth||u.width}))):(t(20,p=Ae(le({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,b=(ae=(D=u.defaultPosition)==null?void 0:D.right)!=null?ae:ge),t(1,v=(Z=(N=u.defaultPosition)==null?void 0:N.bottom)!=null?Z:ge))}function Me(D){t(8,B=!1)}const oe=()=>t(8,B=!1);function Oe(D){_t[D?"unshift":"push"](()=>{E=D,t(5,E)})}const xe=D=>me(D,!0);function et(D){_t[D?"unshift":"push"](()=>{d=D,t(4,d)})}return s.$$set=D=>{"target"in D&&t(21,h=D.target),"options"in D&&t(20,p=D.options)},s.$$.update=()=>{s.$$.dirty[0]&1048576&&t(3,n=Ae(le(le({},u),p),{defaultPosition:le(le({},u.defaultPosition),p.defaultPosition)})),s.$$.dirty[0]&4194316&&c(t(11,i=Ni(_?X?window.innerWidth:n.drawerWidth:0,{stiffness:.1,damping:.6}))),s.$$.dirty[0]&11&&typeof window!="undefined"&&(t(0,b=Math.max(ge,Math.min(window.innerWidth-(n.width||0),b))),t(1,v=Math.max(ge,Math.min(window.innerHeight-(n.height||0),v)))),s.$$.dirty[0]&62914560&&t(10,l=_?"display: none;":`position: fixed; right: ${L}px; bottom: ${C}%; transform: none; cursor: ${R?"grabbing":"grab"};`)},[b,v,X,n,d,E,I,M,B,te,l,i,o,j,me,qe,ie,$e,ne,Me,p,h,_,R,L,C,oe,Oe,xe,et]}class gl extends Tn{constructor(e){super(),yn(this,e,dl,pl,pt,{target:21,options:20},null,[-1,-1])}}$.SyAssistant=gl,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
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 o=fs(e);if(o===null)return n;e=o;let l='<a href="'+e+'"';return t&&(l+=' title="'+t+'"'),l+=">"+n+"</a>",l}image(e,t,n){const o=fs(e);if(o===null)return n;e=o;let l=`<img src="${e}" alt="${n}"`;return t&&(l+=` title="${t}"`),l+=">",l}text(e){return e}}class Mn{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 Ve{constructor(e){ce(this,"options");ce(this,"renderer");ce(this,"textRenderer");this.options=e||ct,this.options.renderer=this.options.renderer||new en,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Mn}static parse(e,t){return new Ve(t).parse(e)}static parseInline(e,t){return new Ve(t).parseInline(e)}parse(e,t=!0){let n="";for(let o=0;o<e.length;o++){const l=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[l.type]){const i=l,r=this.options.extensions.renderers[i.type].call({parser:this},i);if(r!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(i.type)){n+=r||"";continue}}switch(l.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const i=l;n+=this.renderer.heading(this.parseInline(i.tokens),i.depth,Vi(this.parseInline(i.tokens,this.textRenderer)));continue}case"code":{const i=l;n+=this.renderer.code(i.text,i.lang,!!i.escaped);continue}case"table":{const i=l;let r="",c="";for(let h=0;h<i.header.length;h++)c+=this.renderer.tablecell(this.parseInline(i.header[h].tokens),{header:!0,align:i.align[h]});r+=this.renderer.tablerow(c);let u="";for(let h=0;h<i.rows.length;h++){const p=i.rows[h];c="";for(let m=0;m<p.length;m++)c+=this.renderer.tablecell(this.parseInline(p[m].tokens),{header:!1,align:i.align[m]});u+=this.renderer.tablerow(c)}n+=this.renderer.table(r,u);continue}case"blockquote":{const i=l,r=this.parse(i.tokens);n+=this.renderer.blockquote(r);continue}case"list":{const i=l,r=i.ordered,c=i.start,u=i.loose;let h="";for(let p=0;p<i.items.length;p++){const m=i.items[p],g=m.checked,_=m.task;let T="";if(m.task){const R=this.renderer.checkbox(!!g);u?m.tokens.length>0&&m.tokens[0].type==="paragraph"?(m.tokens[0].text=R+" "+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=R+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:R+" "}):T+=R+" "}T+=this.parse(m.tokens,u),h+=this.renderer.listitem(T,_,!!g)}n+=this.renderer.list(h,r,c);continue}case"html":{const i=l;n+=this.renderer.html(i.text,i.block);continue}case"paragraph":{const i=l;n+=this.renderer.paragraph(this.parseInline(i.tokens));continue}case"text":{let i=l,r=i.tokens?this.parseInline(i.tokens):i.text;for(;o+1<e.length&&e[o+1].type==="text";)i=e[++o],r+=`
45
+ `+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(r):r;continue}default:{const i='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let o=0;o<e.length;o++){const l=e[o];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[l.type]){const i=this.options.extensions.renderers[l.type].call({parser:this},l);if(i!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=i||"";continue}}switch(l.type){case"escape":{const i=l;n+=t.text(i.text);break}case"html":{const i=l;n+=t.html(i.text);break}case"link":{const i=l;n+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break}case"image":{const i=l;n+=t.image(i.href,i.title,i.text);break}case"strong":{const i=l;n+=t.strong(this.parseInline(i.tokens,t));break}case"em":{const i=l;n+=t.em(this.parseInline(i.tokens,t));break}case"codespan":{const i=l;n+=t.codespan(i.text);break}case"br":{n+=t.br();break}case"del":{const i=l;n+=t.del(this.parseInline(i.tokens,t));break}case"text":{const i=l;n+=t.text(i.text);break}default:{const i='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}}class zt{constructor(e){ce(this,"options");this.options=e||ct}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}ce(zt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class So{constructor(...e){Ti(this,ht);ce(this,"defaults",Sn());ce(this,"options",this.setOptions);ce(this,"parse",pn(this,ht,Zn).call(this,Xe.lex,Ve.parse));ce(this,"parseInline",pn(this,ht,Zn).call(this,Xe.lexInline,Ve.parseInline));ce(this,"Parser",Ve);ce(this,"Renderer",en);ce(this,"TextRenderer",Mn);ce(this,"Lexer",Xe);ce(this,"Tokenizer",Qt);ce(this,"Hooks",zt);this.use(...e)}walkTokens(e,t){var o,l;let n=[];for(const i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{const r=i;for(const c of r.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of r.rows)for(const u of c)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const r=i;n=n.concat(this.walkTokens(r.items,t));break}default:{const r=i;(l=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&l[r.type]?this.defaults.extensions.childTokens[r.type].forEach(c=>{const u=r[c].flat(1/0);n=n.concat(this.walkTokens(u,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 o=re({},n);if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const i=t.renderers[l.name];i?t.renderers[l.name]=function(...r){let c=l.renderer.apply(this,r);return c===!1&&(c=i.apply(this,r)),c}:t.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[l.level];i?i.unshift(l.tokenizer):t[l.level]=[l.tokenizer],l.start&&(l.level==="block"?t.startBlock?t.startBlock.push(l.start):t.startBlock=[l.start]:l.level==="inline"&&(t.startInline?t.startInline.push(l.start):t.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(t.childTokens[l.name]=l.childTokens)}),o.extensions=t),n.renderer){const l=this.defaults.renderer||new en(this.defaults);for(const i in n.renderer){if(!(i in l))throw new Error(`renderer '${i}' does not exist`);if(i==="options")continue;const r=i,c=n.renderer[r],u=l[r];l[r]=(...h)=>{let p=c.apply(l,h);return p===!1&&(p=u.apply(l,h)),p||""}}o.renderer=l}if(n.tokenizer){const l=this.defaults.tokenizer||new Qt(this.defaults);for(const i in n.tokenizer){if(!(i in l))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const r=i,c=n.tokenizer[r],u=l[r];l[r]=(...h)=>{let p=c.apply(l,h);return p===!1&&(p=u.apply(l,h)),p}}o.tokenizer=l}if(n.hooks){const l=this.defaults.hooks||new zt;for(const i in n.hooks){if(!(i in l))throw new Error(`hook '${i}' does not exist`);if(i==="options")continue;const r=i,c=n.hooks[r],u=l[r];zt.passThroughHooks.has(i)?l[r]=h=>{if(this.defaults.async)return Promise.resolve(c.call(l,h)).then(m=>u.call(l,m));const p=c.call(l,h);return u.call(l,p)}:l[r]=(...h)=>{let p=c.apply(l,h);return p===!1&&(p=u.apply(l,h)),p}}o.hooks=l}if(n.walkTokens){const l=this.defaults.walkTokens,i=n.walkTokens;o.walkTokens=function(r){let c=[];return c.push(i.call(this,r)),l&&(c=c.concat(l.call(this,r))),c}}this.defaults=re(re({},this.defaults),o)}),this}setOptions(e){return this.defaults=re(re({},this.defaults),e),this}lexer(e,t){return Xe.lex(e,t!=null?t:this.defaults)}parser(e,t){return Ve.parse(e,t!=null?t:this.defaults)}}ht=new WeakSet,Zn=function(e,t){return(n,o)=>{const l=re({},o),i=re(re({},this.defaults),l);this.defaults.async===!0&&l.async===!1&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const r=pn(this,ht,vi).call(this,!!i.silent,!!i.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(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(c=>e(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>t(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(r);try{i.hooks&&(n=i.hooks.preprocess(n));let c=e(n,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=t(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return r(c)}}},vi=function(e,t){return n=>{if(n.message+=`
46
+ Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+Fe(n.message+"",!0)+"</pre>";return t?Promise.resolve(o):o}if(t)return Promise.reject(n);throw n}};const ut=new So;function se(s,e){return ut.parse(s,e)}se.options=se.setOptions=function(s){return ut.setOptions(s),se.defaults=ut.defaults,rs(se.defaults),se},se.getDefaults=Sn,se.defaults=ct,se.use=function(...s){return ut.use(...s),se.defaults=ut.defaults,rs(se.defaults),se},se.walkTokens=function(s,e){return ut.walkTokens(s,e)},se.parseInline=ut.parseInline,se.Parser=Ve,se.parser=Ve.parse,se.Renderer=en,se.TextRenderer=Mn,se.Lexer=Xe,se.lexer=Xe.lex,se.Tokenizer=Qt,se.Hooks=zt,se.parse=se,se.options,se.setOptions,se.use,se.walkTokens,se.parseInline,Ve.parse,Xe.lex;/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */const{entries:Ts,setPrototypeOf:vs,isFrozen:Ao,getPrototypeOf:xo,getOwnPropertyDescriptor:Io}=Object;let{freeze:Re,seal:Ue,create:Es}=Object,{apply:zn,construct:On}=typeof Reflect!="undefined"&&Reflect;Re||(Re=function(e){return e}),Ue||(Ue=function(e){return e}),zn||(zn=function(e,t,n){return e.apply(t,n)}),On||(On=function(e,t){return new e(...t)});const tn=He(Array.prototype.forEach),Ss=He(Array.prototype.pop),Ot=He(Array.prototype.push),nn=He(String.prototype.toLowerCase),Dn=He(String.prototype.toString),As=He(String.prototype.match),Dt=He(String.prototype.replace),Ro=He(String.prototype.indexOf),Co=He(String.prototype.trim),Ye=He(Object.prototype.hasOwnProperty),Ce=He(RegExp.prototype.test),Pt=Lo(TypeError);function He(s){return function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return zn(s,e,n)}}function Lo(s){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return On(s,t)}}function J(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nn;vs&&vs(s,null);let n=e.length;for(;n--;){let o=e[n];if(typeof o=="string"){const l=t(o);l!==o&&(Ao(e)||(e[n]=l),o=l)}s[o]=!0}return s}function Mo(s){for(let e=0;e<s.length;e++)Ye(s,e)||(s[e]=null);return s}function ft(s){const e=Es(null);for(const[t,n]of Ts(s))Ye(s,t)&&(Array.isArray(n)?e[t]=Mo(n):n&&typeof n=="object"&&n.constructor===Object?e[t]=ft(n):e[t]=n);return e}function Nt(s,e){for(;s!==null;){const n=Io(s,e);if(n){if(n.get)return He(n.get);if(typeof n.value=="function")return He(n.value)}s=xo(s)}function t(){return null}return t}const xs=Re(["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","section","select","shadow","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"]),Pn=Re(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Nn=Re(["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"]),zo=Re(["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"]),Fn=Re(["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"]),Oo=Re(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Is=Re(["#text"]),Rs=Re(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Hn=Re(["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"]),Cs=Re(["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"]),sn=Re(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Do=Ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Po=Ue(/<%[\w\W]*|[\w\W]*%>/gm),No=Ue(/\$\{[\w\W]*}/gm),Fo=Ue(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ho=Ue(/^aria-[\-\w]+$/),Ls=Ue(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Bo=Ue(/^(?:\w+script|data):/i),jo=Ue(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ms=Ue(/^html$/i),Uo=Ue(/^[a-z][.\w]*(-[.\w]+)+$/i);var zs=Object.freeze({__proto__:null,ARIA_ATTR:Ho,ATTR_WHITESPACE:jo,CUSTOM_ELEMENT:Uo,DATA_ATTR:Fo,DOCTYPE_NAME:Ms,ERB_EXPR:Po,IS_ALLOWED_URI:Ls,IS_SCRIPT_OR_DATA:Bo,MUSTACHE_EXPR:Do,TMPLIT_EXPR:No});const Ft={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Wo=function(){return typeof window=="undefined"?null:window},qo=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const l="dompurify"+(n?"#"+n:"");try{return e.createPolicy(l,{createHTML(i){return i},createScriptURL(i){return i}})}catch(i){return console.warn("TrustedTypes policy "+l+" could not be created."),null}},Os=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ds(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Wo();const e=H=>Ds(H);if(e.version="3.2.3",e.removed=[],!s||!s.document||s.document.nodeType!==Ft.document)return e.isSupported=!1,e;let{document:t}=s;const n=t,o=n.currentScript,{DocumentFragment:l,HTMLTemplateElement:i,Node:r,Element:c,NodeFilter:u,NamedNodeMap:h=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:p,DOMParser:m,trustedTypes:g}=s,_=c.prototype,T=Nt(_,"cloneNode"),R=Nt(_,"remove"),L=Nt(_,"nextSibling"),A=Nt(_,"childNodes"),w=Nt(_,"parentNode");if(typeof i=="function"){const H=t.createElement("template");H.content&&H.content.ownerDocument&&(t=H.content.ownerDocument)}let k,y="";const{implementation:v,createNodeIterator:x,createDocumentFragment:M,getElementsByTagName:z}=t,{importNode:X}=n;let B=Os();e.isSupported=typeof Ts=="function"&&typeof w=="function"&&v&&v.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:I,ERB_EXPR:C,TMPLIT_EXPR:j,DATA_ATTR:Q,ARIA_ATTR:ie,IS_SCRIPT_OR_DATA:_e,ATTR_WHITESPACE:We,CUSTOM_ELEMENT:pe}=zs;let{IS_ALLOWED_URI:qe}=zs,ne=null;const Ze=J({},[...xs,...Pn,...Nn,...Fn,...Is]);let oe=null;const Le=J({},[...Rs,...Hn,...Cs,...sn]);let ee=Object.seal(Es(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}})),Oe=null,Ae=null,et=!0,N=!0,ae=!1,D=!0,Z=!1,we=!0,be=!1,De=!1,Be=!1,ot=!1,Tt=!1,vt=!1,ln=!0,rn=!1;const Wn="user-content-";let Ht=!0,pt=!1,lt={},rt=null;const an=J({},["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 cn=null;const un=J({},["audio","video","img","source","image","track"]);let Bt=null;const fn=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),b="http://www.w3.org/1998/Math/MathML",F="http://www.w3.org/2000/svg",V="http://www.w3.org/1999/xhtml";let he=V,de=!1,ve=null;const Me=J({},[b,F,V],Dn);let tt=J({},["mi","mo","mn","ms","mtext"]),Ge=J({},["annotation-xml"]);const gl=J({},["title","style","font","a","script"]);let jt=null;const _l=["application/xhtml+xml","text/html"],kl="text/html";let ye=null,Et=null;const wl=t.createElement("form"),ai=function(f){return f instanceof RegExp||f instanceof Function},qn=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Et&&Et===f)){if((!f||typeof f!="object")&&(f={}),f=ft(f),jt=_l.indexOf(f.PARSER_MEDIA_TYPE)===-1?kl:f.PARSER_MEDIA_TYPE,ye=jt==="application/xhtml+xml"?Dn:nn,ne=Ye(f,"ALLOWED_TAGS")?J({},f.ALLOWED_TAGS,ye):Ze,oe=Ye(f,"ALLOWED_ATTR")?J({},f.ALLOWED_ATTR,ye):Le,ve=Ye(f,"ALLOWED_NAMESPACES")?J({},f.ALLOWED_NAMESPACES,Dn):Me,Bt=Ye(f,"ADD_URI_SAFE_ATTR")?J(ft(fn),f.ADD_URI_SAFE_ATTR,ye):fn,cn=Ye(f,"ADD_DATA_URI_TAGS")?J(ft(un),f.ADD_DATA_URI_TAGS,ye):un,rt=Ye(f,"FORBID_CONTENTS")?J({},f.FORBID_CONTENTS,ye):an,Oe=Ye(f,"FORBID_TAGS")?J({},f.FORBID_TAGS,ye):{},Ae=Ye(f,"FORBID_ATTR")?J({},f.FORBID_ATTR,ye):{},lt=Ye(f,"USE_PROFILES")?f.USE_PROFILES:!1,et=f.ALLOW_ARIA_ATTR!==!1,N=f.ALLOW_DATA_ATTR!==!1,ae=f.ALLOW_UNKNOWN_PROTOCOLS||!1,D=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Z=f.SAFE_FOR_TEMPLATES||!1,we=f.SAFE_FOR_XML!==!1,be=f.WHOLE_DOCUMENT||!1,ot=f.RETURN_DOM||!1,Tt=f.RETURN_DOM_FRAGMENT||!1,vt=f.RETURN_TRUSTED_TYPE||!1,Be=f.FORCE_BODY||!1,ln=f.SANITIZE_DOM!==!1,rn=f.SANITIZE_NAMED_PROPS||!1,Ht=f.KEEP_CONTENT!==!1,pt=f.IN_PLACE||!1,qe=f.ALLOWED_URI_REGEXP||Ls,he=f.NAMESPACE||V,tt=f.MATHML_TEXT_INTEGRATION_POINTS||tt,Ge=f.HTML_INTEGRATION_POINTS||Ge,ee=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&ai(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ee.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&ai(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ee.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ee.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(N=!1),Tt&&(ot=!0),lt&&(ne=J({},Is),oe=[],lt.html===!0&&(J(ne,xs),J(oe,Rs)),lt.svg===!0&&(J(ne,Pn),J(oe,Hn),J(oe,sn)),lt.svgFilters===!0&&(J(ne,Nn),J(oe,Hn),J(oe,sn)),lt.mathMl===!0&&(J(ne,Fn),J(oe,Cs),J(oe,sn))),f.ADD_TAGS&&(ne===Ze&&(ne=ft(ne)),J(ne,f.ADD_TAGS,ye)),f.ADD_ATTR&&(oe===Le&&(oe=ft(oe)),J(oe,f.ADD_ATTR,ye)),f.ADD_URI_SAFE_ATTR&&J(Bt,f.ADD_URI_SAFE_ATTR,ye),f.FORBID_CONTENTS&&(rt===an&&(rt=ft(rt)),J(rt,f.FORBID_CONTENTS,ye)),Ht&&(ne["#text"]=!0),be&&J(ne,["html","head","body"]),ne.table&&(J(ne,["tbody"]),delete Oe.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Pt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=f.TRUSTED_TYPES_POLICY,y=k.createHTML("")}else k===void 0&&(k=qo(g,o)),k!==null&&typeof y=="string"&&(y=k.createHTML(""));Re&&Re(f),Et=f}},ci=J({},[...Pn,...Nn,...zo]),ui=J({},[...Fn,...Oo]),bl=function(f){let S=w(f);(!S||!S.tagName)&&(S={namespaceURI:he,tagName:"template"});const O=nn(f.tagName),fe=nn(S.tagName);return ve[f.namespaceURI]?f.namespaceURI===F?S.namespaceURI===V?O==="svg":S.namespaceURI===b?O==="svg"&&(fe==="annotation-xml"||tt[fe]):!!ci[O]:f.namespaceURI===b?S.namespaceURI===V?O==="math":S.namespaceURI===F?O==="math"&&Ge[fe]:!!ui[O]:f.namespaceURI===V?S.namespaceURI===F&&!Ge[fe]||S.namespaceURI===b&&!tt[fe]?!1:!ui[O]&&(gl[O]||!ci[O]):!!(jt==="application/xhtml+xml"&&ve[f.namespaceURI]):!1},Qe=function(f){Ot(e.removed,{element:f});try{w(f).removeChild(f)}catch(S){R(f)}},hn=function(f,S){try{Ot(e.removed,{attribute:S.getAttributeNode(f),from:S})}catch(O){Ot(e.removed,{attribute:null,from:S})}if(S.removeAttribute(f),f==="is")if(ot||Tt)try{Qe(S)}catch(O){}else try{S.setAttribute(f,"")}catch(O){}},fi=function(f){let S=null,O=null;if(Be)f="<remove></remove>"+f;else{const Ee=As(f,/^[\r\n\t ]+/);O=Ee&&Ee[0]}jt==="application/xhtml+xml"&&he===V&&(f='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+f+"</body></html>");const fe=k?k.createHTML(f):f;if(he===V)try{S=new m().parseFromString(fe,jt)}catch(Ee){}if(!S||!S.documentElement){S=v.createDocument(he,"template",null);try{S.documentElement.innerHTML=de?y:fe}catch(Ee){}}const xe=S.body||S.documentElement;return f&&O&&xe.insertBefore(t.createTextNode(O),xe.childNodes[0]||null),he===V?z.call(S,be?"html":"body")[0]:be?S.documentElement:xe},hi=function(f){return x.call(f.ownerDocument||f,f,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Gn=function(f){return f instanceof p&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof h)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},pi=function(f){return typeof r=="function"&&f instanceof r};function nt(H,f,S){tn(H,O=>{O.call(e,f,S,Et)})}const di=function(f){let S=null;if(nt(B.beforeSanitizeElements,f,null),Gn(f))return Qe(f),!0;const O=ye(f.nodeName);if(nt(B.uponSanitizeElement,f,{tagName:O,allowedTags:ne}),f.hasChildNodes()&&!pi(f.firstElementChild)&&Ce(/<[/\w]/g,f.innerHTML)&&Ce(/<[/\w]/g,f.textContent)||f.nodeType===Ft.progressingInstruction||we&&f.nodeType===Ft.comment&&Ce(/<[/\w]/g,f.data))return Qe(f),!0;if(!ne[O]||Oe[O]){if(!Oe[O]&&gi(O)&&(ee.tagNameCheck instanceof RegExp&&Ce(ee.tagNameCheck,O)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(O)))return!1;if(Ht&&!rt[O]){const fe=w(f)||f.parentNode,xe=A(f)||f.childNodes;if(xe&&fe){const Ee=xe.length;for(let Pe=Ee-1;Pe>=0;--Pe){const Je=T(xe[Pe],!0);Je.__removalCount=(f.__removalCount||0)+1,fe.insertBefore(Je,L(f))}}}return Qe(f),!0}return f instanceof c&&!bl(f)||(O==="noscript"||O==="noembed"||O==="noframes")&&Ce(/<\/no(script|embed|frames)/i,f.innerHTML)?(Qe(f),!0):(Z&&f.nodeType===Ft.text&&(S=f.textContent,tn([I,C,j],fe=>{S=Dt(S,fe," ")}),f.textContent!==S&&(Ot(e.removed,{element:f.cloneNode()}),f.textContent=S)),nt(B.afterSanitizeElements,f,null),!1)},mi=function(f,S,O){if(ln&&(S==="id"||S==="name")&&(O in t||O in wl))return!1;if(!(N&&!Ae[S]&&Ce(Q,S))){if(!(et&&Ce(ie,S))){if(!oe[S]||Ae[S]){if(!(gi(f)&&(ee.tagNameCheck instanceof RegExp&&Ce(ee.tagNameCheck,f)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(f))&&(ee.attributeNameCheck instanceof RegExp&&Ce(ee.attributeNameCheck,S)||ee.attributeNameCheck instanceof Function&&ee.attributeNameCheck(S))||S==="is"&&ee.allowCustomizedBuiltInElements&&(ee.tagNameCheck instanceof RegExp&&Ce(ee.tagNameCheck,O)||ee.tagNameCheck instanceof Function&&ee.tagNameCheck(O))))return!1}else if(!Bt[S]){if(!Ce(qe,Dt(O,We,""))){if(!((S==="src"||S==="xlink:href"||S==="href")&&f!=="script"&&Ro(O,"data:")===0&&cn[f])){if(!(ae&&!Ce(_e,Dt(O,We,"")))){if(O)return!1}}}}}}return!0},gi=function(f){return f!=="annotation-xml"&&As(f,pe)},_i=function(f){nt(B.beforeSanitizeAttributes,f,null);const{attributes:S}=f;if(!S||Gn(f))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:oe,forceKeepAttr:void 0};let fe=S.length;for(;fe--;){const xe=S[fe],{name:Ee,namespaceURI:Pe,value:Je}=xe,Ut=ye(Ee);let ze=Ee==="value"?Je:Co(Je);if(O.attrName=Ut,O.attrValue=ze,O.keepAttr=!0,O.forceKeepAttr=void 0,nt(B.uponSanitizeAttribute,f,O),ze=O.attrValue,rn&&(Ut==="id"||Ut==="name")&&(hn(Ee,f),ze=Wn+ze),we&&Ce(/((--!?|])>)|<\/(style|title)/i,ze)){hn(Ee,f);continue}if(O.forceKeepAttr||(hn(Ee,f),!O.keepAttr))continue;if(!D&&Ce(/\/>/i,ze)){hn(Ee,f);continue}Z&&tn([I,C,j],wi=>{ze=Dt(ze,wi," ")});const ki=ye(f.nodeName);if(mi(ki,Ut,ze)){if(k&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Pe)switch(g.getAttributeType(ki,Ut)){case"TrustedHTML":{ze=k.createHTML(ze);break}case"TrustedScriptURL":{ze=k.createScriptURL(ze);break}}try{Pe?f.setAttributeNS(Pe,Ee,ze):f.setAttribute(Ee,ze),Gn(f)?Qe(f):Ss(e.removed)}catch(wi){}}}nt(B.afterSanitizeAttributes,f,null)},yl=function H(f){let S=null;const O=hi(f);for(nt(B.beforeSanitizeShadowDOM,f,null);S=O.nextNode();)nt(B.uponSanitizeShadowNode,S,null),di(S),_i(S),S.content instanceof l&&H(S.content);nt(B.afterSanitizeShadowDOM,f,null)};return e.sanitize=function(H){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},S=null,O=null,fe=null,xe=null;if(de=!H,de&&(H="<!-->"),typeof H!="string"&&!pi(H))if(typeof H.toString=="function"){if(H=H.toString(),typeof H!="string")throw Pt("dirty is not a string, aborting")}else throw Pt("toString is not a function");if(!e.isSupported)return H;if(De||qn(f),e.removed=[],typeof H=="string"&&(pt=!1),pt){if(H.nodeName){const Je=ye(H.nodeName);if(!ne[Je]||Oe[Je])throw Pt("root node is forbidden and cannot be sanitized in-place")}}else if(H instanceof r)S=fi("<!---->"),O=S.ownerDocument.importNode(H,!0),O.nodeType===Ft.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?S=O:S.appendChild(O);else{if(!ot&&!Z&&!be&&H.indexOf("<")===-1)return k&&vt?k.createHTML(H):H;if(S=fi(H),!S)return ot?null:vt?y:""}S&&Be&&Qe(S.firstChild);const Ee=hi(pt?H:S);for(;fe=Ee.nextNode();)di(fe),_i(fe),fe.content instanceof l&&yl(fe.content);if(pt)return H;if(ot){if(Tt)for(xe=M.call(S.ownerDocument);S.firstChild;)xe.appendChild(S.firstChild);else xe=S;return(oe.shadowroot||oe.shadowrootmode)&&(xe=X.call(n,xe,!0)),xe}let Pe=be?S.outerHTML:S.innerHTML;return be&&ne["!doctype"]&&S.ownerDocument&&S.ownerDocument.doctype&&S.ownerDocument.doctype.name&&Ce(Ms,S.ownerDocument.doctype.name)&&(Pe="<!DOCTYPE "+S.ownerDocument.doctype.name+`>
47
+ `+Pe),Z&&tn([I,C,j],Je=>{Pe=Dt(Pe,Je," ")}),k&&vt?k.createHTML(Pe):Pe},e.setConfig=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qn(H),De=!0},e.clearConfig=function(){Et=null,De=!1},e.isValidAttribute=function(H,f,S){Et||qn({});const O=ye(H),fe=ye(f);return mi(O,fe,S)},e.addHook=function(H,f){typeof f=="function"&&Ot(B[H],f)},e.removeHook=function(H){return Ss(B[H])},e.removeHooks=function(H){B[H]=[]},e.removeAllHooks=function(){B=Os()},e}var Ps=Ds();function Ns(s){var n;if(typeof document=="undefined")return null;const t=`; ${document.cookie}`.split(`; ${s}=`);return t.length===2&&((n=t.pop())==null?void 0:n.split(";").shift())||null}const me=()=>{if(typeof window=="undefined")return null;const s=Ns("access_token");if(s)return s;const e=Ns("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 Fs(s,e,t){const n=s.slice();return n[25]=e[t],n}function Hs(s){let e,t=s[9].text+"",n;return{c(){e=E("div"),n=Te(t),a(e,"class","sy-assistant-button-tooltip svelte-1g6fj9a"),P(e,"left",s[9].x+"px"),P(e,"top",s[9].y+"px"),P(e,"z-index",s[3]+3)},m(o,l){G(o,e,l),d(e,n)},p(o,l){l&512&&t!==(t=o[9].text+"")&&Ne(n,t),l&512&&P(e,"left",o[9].x+"px"),l&512&&P(e,"top",o[9].y+"px"),l&8&&P(e,"z-index",o[3]+3)},d(o){o&&W(e)}}}function Go(s){let e=[],t=new Map,n,o,l=it(s[0]);const i=c=>c[25].sessionId;for(let c=0;c<l.length;c+=1){let u=Fs(s,l,c),h=i(u);t.set(h,e[c]=Bs(h,u))}let r=s[5]&&js();return{c(){for(let c=0;c<e.length;c+=1)e[c].c();n=q(),r&&r.c(),o=qt()},m(c,u){for(let h=0;h<e.length;h+=1)e[h]&&e[h].m(c,u);G(c,n,u),r&&r.m(c,u),G(c,o,u)},p(c,u){u&8261&&(l=it(c[0]),e=ss(e,u,i,1,c,l,t,n.parentNode,ns,Bs,n,Fs)),c[5]?r||(r=js(),r.c(),r.m(o.parentNode,o)):r&&(r.d(1),r=null)},d(c){c&&(W(n),W(o));for(let u=0;u<e.length;u+=1)e[u].d(c);r&&r.d(c)}}}function Yo(s){let e,t=s[4]?"未找到相关会话":s[5]?"加载中...":"暂无历史会话",n;return{c(){e=E("div"),n=Te(t),a(e,"class","sy-session-empty svelte-1g6fj9a")},m(o,l){G(o,e,l),d(e,n)},p(o,l){l&48&&t!==(t=o[4]?"未找到相关会话":o[5]?"加载中...":"暂无历史会话")&&Ne(n,t)},d(o){o&&W(e)}}}function Bs(s,e){let t,n,o,l,i=e[25].title+"",r,c,u,h=Ws(e[25].timestamp)+"",p,m,g,_,T,R,L,A,w,k,y;function v(){return e[18](e[25])}function x(...M){return e[19](e[25],...M)}return{key:s,first:null,c(){t=E("div"),n=E("button"),o=E("div"),l=E("div"),r=Te(i),c=q(),u=E("div"),p=Te(h),m=q(),g=E("button"),_=K("svg"),T=K("path"),R=K("path"),L=K("path"),a(l,"class","sy-session-title svelte-1g6fj9a"),a(u,"class","sy-session-time svelte-1g6fj9a"),a(o,"class","sy-session-info svelte-1g6fj9a"),a(n,"class","sy-session-select svelte-1g6fj9a"),a(T,"d","M3 6h18"),a(R,"d","M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"),a(L,"d","M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"),a(_,"xmlns","http://www.w3.org/2000/svg"),a(_,"width","16"),a(_,"height","16"),a(_,"viewBox","0 0 24 24"),a(_,"fill","none"),a(_,"stroke","currentColor"),a(_,"stroke-width","2"),a(_,"stroke-linecap","round"),a(_,"stroke-linejoin","round"),a(g,"class","sy-session-delete svelte-1g6fj9a"),g.disabled=A=e[6]===e[25].sessionId,a(g,"aria-label","删除会话"),a(t,"class","sy-session-item svelte-1g6fj9a"),a(t,"data-session-id",w=e[25].sessionId),$(t,"deleting",e[25].deleting),this.first=t},m(M,z){G(M,t,z),d(t,n),d(n,o),d(o,l),d(l,r),d(o,c),d(o,u),d(u,p),d(t,m),d(t,g),d(g,_),d(_,T),d(_,R),d(_,L),k||(y=[Y(n,"click",v),Y(g,"click",x)],k=!0)},p(M,z){e=M,z&1&&i!==(i=e[25].title+"")&&Ne(r,i),z&1&&h!==(h=Ws(e[25].timestamp)+"")&&Ne(p,h),z&65&&A!==(A=e[6]===e[25].sessionId)&&(g.disabled=A),z&1&&w!==(w=e[25].sessionId)&&a(t,"data-session-id",w),z&1&&$(t,"deleting",e[25].deleting)},d(M){M&&W(t),k=!1,ke(y)}}}function js(s){let e;return{c(){e=E("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){G(t,e,n)},d(t){t&&W(e)}}}function Us(s){let e,t,n,o,l,i,r,c,u;return{c(){e=E("div"),t=E("div"),t.textContent="确认删除此会话?",n=q(),o=E("div"),l=E("button"),l.textContent="取消",i=q(),r=E("button"),r.textContent="删除",a(t,"class","sy-session-confirm-content svelte-1g6fj9a"),a(l,"class","sy-session-confirm-cancel svelte-1g6fj9a"),a(r,"class","sy-session-confirm-delete svelte-1g6fj9a"),a(o,"class","sy-session-confirm-actions svelte-1g6fj9a"),a(e,"class","sy-session-confirm-popup svelte-1g6fj9a"),P(e,"left",s[8].x+"px"),P(e,"top",s[8].y+"px"),P(e,"z-index",s[3]+3)},m(h,p){G(h,e,p),d(e,t),d(e,n),d(e,o),d(o,l),d(o,i),d(o,r),c||(u=[Y(l,"click",s[20]),Y(r,"click",s[14])],c=!0)},p(h,p){p&256&&P(e,"left",h[8].x+"px"),p&256&&P(e,"top",h[8].y+"px"),p&8&&P(e,"z-index",h[3]+3)},d(h){h&&W(e),c=!1,ke(u)}}}function Zo(s){let e,t,n,o,l,i,r,c,u,h,p,m,g,_,T,R,L,A,w,k=s[9]&&Hs(s);function y(z,X){return z[0].length===0?Yo:Go}let v=y(s),x=v(s),M=s[7]&&Us(s);return{c(){e=E("div"),t=E("div"),n=E("h2"),n.textContent="历史会话",o=q(),l=E("button"),l.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>',i=q(),r=E("div"),c=E("input"),u=q(),h=K("svg"),p=K("circle"),m=K("line"),g=q(),k&&k.c(),_=q(),T=E("div"),x.c(),R=q(),M&&M.c(),L=qt(),a(n,"class","svelte-1g6fj9a"),a(l,"class","sy-session-close svelte-1g6fj9a"),a(l,"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(p,"cx","11"),a(p,"cy","11"),a(p,"r","8"),a(m,"x1","21"),a(m,"y1","21"),a(m,"x2","16.65"),a(m,"y2","16.65"),a(h,"class","sy-session-search-icon svelte-1g6fj9a"),a(h,"xmlns","http://www.w3.org/2000/svg"),a(h,"width","16"),a(h,"height","16"),a(h,"viewBox","0 0 24 24"),a(h,"fill","none"),a(h,"stroke","currentColor"),a(h,"stroke-width","2"),a(h,"stroke-linecap","round"),a(h,"stroke-linejoin","round"),a(r,"class","sy-session-search svelte-1g6fj9a"),a(T,"class","sy-session-list svelte-1g6fj9a"),a(e,"class","sy-session-history svelte-1g6fj9a"),P(e,"z-index",s[3]+2)},m(z,X){G(z,e,X),d(e,t),d(t,n),d(t,o),d(t,l),d(e,i),d(e,r),d(r,c),st(c,s[4]),d(r,u),d(r,h),d(h,p),d(h,m),d(e,g),k&&k.m(e,null),d(e,_),d(e,T),x.m(T,null),G(z,R,X),M&&M.m(z,X),G(z,L,X),A||(w=[Y(l,"click",function(){St(s[1])&&s[1].apply(this,arguments)}),Y(l,"mouseenter",s[16]),Y(l,"mouseleave",s[12]),Y(c,"input",s[17]),Y(T,"scroll",s[10])],A=!0)},p(z,[X]){s=z,X&16&&c.value!==s[4]&&st(c,s[4]),s[9]?k?k.p(s,X):(k=Hs(s),k.c(),k.m(e,_)):k&&(k.d(1),k=null),v===(v=y(s))&&x?x.p(s,X):(x.d(1),x=v(s),x&&(x.c(),x.m(T,null))),X&8&&P(e,"z-index",s[3]+2),s[7]?M?M.p(s,X):(M=Us(s),M.c(),M.m(L.parentNode,L)):M&&(M.d(1),M=null)},i:U,o:U,d(z){z&&(W(e),W(R),W(L)),k&&k.d(),x.d(),M&&M.d(z),A=!1,ke(w)}}}const Bn=10;function Ws(s){return new Date(s).toLocaleString()}function Xo(s,e,t){let{sessions:n=[]}=e,{onClose:o}=e,{onSelect:l}=e,{zIndex:i}=e,{apiPrefix:r}=e,c=!1,u=!0,h=0,p="",m=null,g=null,_={x:0,y:0};function T(){return Ie(this,null,function*(){if(!(c||!u)){t(5,c=!0);try{const I=yield fetch(`${r}/chat/record/session/list/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`},body:JSON.stringify({start:h,length:Bn,keyword:p})});if(!I.ok)throw new Error("Failed to load sessions");const C=yield I.json();if(C.code===0){const j=C.data.sessionList.map(Q=>({sessionId:Q.sessionId,title:Q.name,timestamp:new Date(Q.createDate).getTime()}));t(0,n=[...n,...j]),h+=Bn,u=j.length===Bn}}catch(I){console.error("Failed to load sessions:",I)}finally{t(5,c=!1)}}})}function R(I){const C=I.target,{scrollTop:j,scrollHeight:Q,clientHeight:ie}=C;Q-j-ie<50&&T()}mn(()=>{T()});let L=null;function A(I,C){const Q=I.currentTarget.getBoundingClientRect();t(9,L={text:C,x:Q.left+Q.width/2,y:Q.bottom+8})}function w(){t(9,L=null)}function k(I,C){const Q=I.currentTarget.getBoundingClientRect();t(8,_={x:Q.left-16,y:Q.top+Q.height/2}),t(7,g=C)}function y(I){return Ie(this,null,function*(){if(I&&!m)try{t(6,m=I),t(7,g=null);const C=document.querySelector(`[data-session-id="${I}"]`);C&&C.classList.add("deleting"),yield new Promise(ie=>setTimeout(ie,300));const j=yield fetch(`${r}/chat/record/session/delete`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`},body:JSON.stringify({sessionId:I})});if(!j.ok)throw new Error("Delete request failed");const Q=yield j.json();if(Q.code===0&&Q.data.respCode===0)t(0,n=n.map(ie=>Se(re({},ie),{deleting:ie.sessionId===I}))),setTimeout(()=>{t(0,n=n.filter(ie=>!ie.deleting))},300);else throw new Error("Delete failed: "+Q.message)}catch(C){console.error("Failed to delete session:",C);const j=document.querySelector(`[data-session-id="${I}"]`);j&&j.classList.remove("deleting")}finally{t(6,m=null)}})}function v(){g&&y(g)}const x=I=>A(I,"关闭历史会话");function M(){p=this.value,t(4,p)}const z=I=>l(I.sessionId),X=(I,C)=>k(C,I.sessionId),B=()=>t(7,g=null);return s.$$set=I=>{"sessions"in I&&t(0,n=I.sessions),"onClose"in I&&t(1,o=I.onClose),"onSelect"in I&&t(2,l=I.onSelect),"zIndex"in I&&t(3,i=I.zIndex),"apiPrefix"in I&&t(15,r=I.apiPrefix)},s.$$.update=()=>{s.$$.dirty&16&&p!==void 0&&(t(0,n=[]),h=0,u=!0,T())},[n,o,l,i,p,c,m,g,_,L,R,A,w,k,v,r,x,M,z,X,B]}class qs extends Tn{constructor(e){super(),yn(this,e,Xo,Zo,dt,{sessions:0,onClose:1,onSelect:2,zIndex:3,apiPrefix:15})}}function Gs(s,e,t){const n=s.slice();return n[66]=e[t],n}function Ys(s,e,t){const n=s.slice();return n[69]=e[t],n[70]=e,n[71]=t,n}function Zs(s,e,t){const n=s.slice();return n[72]=e[t],n[74]=t,n}function Vo(s){let e,t=[],n=new Map,o=it(s[5]);const l=i=>i[69].id;for(let i=0;i<o.length;i+=1){let r=Ys(s,o,i),c=l(r);n.set(c,t[i]=ei(c,r))}return{c(){e=E("div");for(let i=0;i<t.length;i+=1)t[i].c();a(e,"class","sy-assistant-message-list svelte-mogmt")},m(i,r){G(i,e,r);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);s[51](e)},p(i,r){r[0]&2141447137|r[1]&1&&(o=it(i[5]),t=ss(t,r,l,1,i,o,n,e,ns,ei,null,Ys))},i:U,o:U,d(i){i&&W(e);for(let r=0;r<t.length;r+=1)t[r].d();s[51](null)}}}function Qo(s){let e,t;return e=new qs({props:{sessions:s[32],onClose:s[34],onSelect:s[35],zIndex:s[0],apiPrefix:s[2]}}),{c(){bn(e.$$.fragment)},m(n,o){Zt(e,n,o),t=!0},p(n,o){const l={};o[0]&1&&(l.zIndex=n[0]),o[0]&4&&(l.apiPrefix=n[2]),e.$set(l)},i(n){t||(je(e.$$.fragment,n),t=!0)},o(n){$e(e.$$.fragment,n),t=!1},d(n){Xt(e,n)}}}function Jo(s){let e;return{c(){e=E("div"),e.innerHTML='<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"></path></svg>',a(e,"class","sy-assistant-avatar user svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function Ko(s){let e;return{c(){e=E("div"),e.innerHTML='<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>',a(e,"class","sy-assistant-avatar assistant svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function $o(s){let e,t=s[21](s[69].content)+"";return{c(){e=E("div"),a(e,"class","markdown-content svelte-mogmt")},m(n,o){G(n,e,o),e.innerHTML=t},p(n,o){o[0]&32&&t!==(t=n[21](n[69].content)+"")&&(e.innerHTML=t)},d(n){n&&W(e)}}}function el(s){let e;return{c(){e=E("span"),e.innerHTML='<span class="dot svelte-mogmt">.</span> <span class="dot svelte-mogmt">.</span> <span class="dot svelte-mogmt">.</span>',a(e,"class","sy-assistant-loading svelte-mogmt")},m(t,n){G(t,e,n)},p:U,d(t){t&&W(e)}}}function Xs(s){let e,t=it(s[69].attachments),n=[];for(let o=0;o<t.length;o+=1)n[o]=Js(Zs(s,t,o));return{c(){e=E("div");for(let o=0;o<n.length;o+=1)n[o].c();a(e,"class","sy-assistant-attachments svelte-mogmt")},m(o,l){G(o,e,l);for(let i=0;i<n.length;i+=1)n[i]&&n[i].m(e,null)},p(o,l){if(l[0]&58720737){t=it(o[69].attachments);let i;for(i=0;i<t.length;i+=1){const r=Zs(o,t,i);n[i]?n[i].p(r,l):(n[i]=Js(r),n[i].c(),n[i].m(e,null))}for(;i<n.length;i+=1)n[i].d(1);n.length=t.length}},d(o){o&&W(e),Jn(n,o)}}}function Vs(s){let e,t,n;function o(...l){return s[38](s[72],...l)}return{c(){e=E("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-mogmt"><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-mogmt"),a(e,"aria-label","查看详情")},m(l,i){G(l,e,i),t||(n=[Y(e,"mouseenter",o),Y(e,"mouseleave",s[24])],t=!0)},p(l,i){s=l},d(l){l&&W(e),t=!1,ke(n)}}}function Qs(s){let e,t=s[6].replace(/\n/g,"<br>")+"",n,o;return{c(){e=E("div"),a(e,"class","sy-assistant-tooltip svelte-mogmt"),a(e,"role","tooltip"),P(e,"left",s[7].x+"px"),P(e,"top",s[7].y+"px"),P(e,"z-index",s[0]+3),$(e,"align-right",s[7].alignRight)},m(l,i){G(l,e,i),e.innerHTML=t,n||(o=[Y(e,"mouseenter",s[40]),Y(e,"mouseleave",s[41])],n=!0)},p(l,i){i[0]&64&&t!==(t=l[6].replace(/\n/g,"<br>")+"")&&(e.innerHTML=t),i[0]&128&&P(e,"left",l[7].x+"px"),i[0]&128&&P(e,"top",l[7].y+"px"),i[0]&1&&P(e,"z-index",l[0]+3),i[0]&128&&$(e,"align-right",l[7].alignRight)},d(l){l&&W(e),n=!1,ke(o)}}}function Js(s){let e,t,n,o,l,i,r,c,u,h=on(s[72].content_title).name+"",p,m,g,_=on(s[72].content_title).ext+"",T,R,L,A,w,k,y,v,x,M,z=s[72].tips&&Vs(s);function X(){return s[39](s[72])}let B=s[6]&&Qs(s);return{c(){e=E("div"),t=E("div"),n=E("div"),o=K("svg"),l=K("path"),i=K("polyline"),r=q(),c=E("div"),u=E("span"),p=Te(h),m=q(),g=E("span"),T=Te(_),L=q(),A=E("div"),z&&z.c(),w=q(),k=E("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-mogmt"><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>',y=q(),B&&B.c(),v=q(),a(l,"d","M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"),a(i,"points","13 2 13 9 20 9"),a(o,"xmlns","http://www.w3.org/2000/svg"),a(o,"width","16"),a(o,"height","16"),a(o,"viewBox","0 0 24 24"),a(o,"fill","none"),a(o,"stroke","currentColor"),a(o,"stroke-width","2"),a(o,"stroke-linecap","round"),a(o,"stroke-linejoin","round"),a(u,"class","sy-assistant-filename svelte-mogmt"),a(g,"class","sy-assistant-attachment-ext svelte-mogmt"),a(c,"class","sy-assistant-attachment-name svelte-mogmt"),a(c,"title",R=s[72].content_title),a(n,"class","sy-assistant-attachment-title svelte-mogmt"),a(k,"class","sy-assistant-attachment-toggle svelte-mogmt"),a(k,"aria-label","下载文件"),a(A,"class","sy-assistant-attachment-actions svelte-mogmt"),a(t,"class","sy-assistant-attachment-header svelte-mogmt"),a(e,"class","sy-assistant-attachment svelte-mogmt")},m(I,C){G(I,e,C),d(e,t),d(t,n),d(n,o),d(o,l),d(o,i),d(n,r),d(n,c),d(c,u),d(u,p),d(c,m),d(c,g),d(g,T),d(t,L),d(t,A),z&&z.m(A,null),d(A,w),d(A,k),d(e,y),B&&B.m(e,null),d(e,v),x||(M=Y(k,"click",X),x=!0)},p(I,C){s=I,C[0]&32&&h!==(h=on(s[72].content_title).name+"")&&Ne(p,h),C[0]&32&&_!==(_=on(s[72].content_title).ext+"")&&Ne(T,_),C[0]&32&&R!==(R=s[72].content_title)&&a(c,"title",R),s[72].tips?z?z.p(s,C):(z=Vs(s),z.c(),z.m(A,w)):z&&(z.d(1),z=null),s[6]?B?B.p(s,C):(B=Qs(s),B.c(),B.m(e,v)):B&&(B.d(1),B=null)},d(I){I&&W(e),z&&z.d(),B&&B.d(),x=!1,M()}}}function Ks(s){let e,t,n,o,l,i,r,c,u,h,p;function m(v,x){return v[13][v[69].id]?nl:tl}let g=m(s),_=g(s);function T(){return s[42](s[69])}function R(...v){return s[43](s[69],...v)}function L(){return s[44](s[69])}function A(...v){return s[45](s[69],...v)}function w(...v){return s[46](s[69],...v)}function k(...v){return s[47](s[69],...v)}let y=s[16]&&s[14][s[69].id]==="dislike"&&$s(s);return{c(){e=E("div"),t=E("button"),_.c(),o=q(),l=E("button"),l.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>',i=q(),r=E("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=q(),y&&y.c(),u=qt(),a(t,"class","sy-assistant-action-button svelte-mogmt"),a(t,"aria-label",n=s[13][s[69].id]?"已复制":"复制内容"),$(t,"copied",s[13][s[69].id]),a(l,"class","sy-assistant-action-button svelte-mogmt"),a(l,"aria-label","点赞"),$(l,"active",s[14][s[69].id]==="like"),a(r,"class","sy-assistant-action-button svelte-mogmt"),a(r,"aria-label","点踩"),$(r,"active",s[14][s[69].id]==="dislike"),a(e,"class","sy-assistant-message-actions svelte-mogmt")},m(v,x){G(v,e,x),d(e,t),_.m(t,null),d(e,o),d(e,l),d(e,i),d(e,r),G(v,c,x),y&&y.m(v,x),G(v,u,x),h||(p=[Y(t,"click",T),Y(t,"mouseenter",R),Y(t,"mouseleave",s[31]),Y(l,"click",L),Y(l,"mouseenter",A),Y(l,"mouseleave",s[31]),Y(r,"click",w),Y(r,"mouseenter",k),Y(r,"mouseleave",s[31])],h=!0)},p(v,x){s=v,g!==(g=m(s))&&(_.d(1),_=g(s),_&&(_.c(),_.m(t,null))),x[0]&8224&&n!==(n=s[13][s[69].id]?"已复制":"复制内容")&&a(t,"aria-label",n),x[0]&8224&&$(t,"copied",s[13][s[69].id]),x[0]&16416&&$(l,"active",s[14][s[69].id]==="like"),x[0]&16416&&$(r,"active",s[14][s[69].id]==="dislike"),s[16]&&s[14][s[69].id]==="dislike"?y?y.p(s,x):(y=$s(s),y.c(),y.m(u.parentNode,u)):y&&(y.d(1),y=null)},d(v){v&&(W(e),W(c),W(u)),_.d(),y&&y.d(v),h=!1,ke(p)}}}function tl(s){let e,t,n;return{c(){e=K("svg"),t=K("rect"),n=K("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(o,l){G(o,e,l),d(e,t),d(e,n)},d(o){o&&W(e)}}}function nl(s){let e,t;return{c(){e=K("svg"),t=K("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,o){G(n,e,o),d(e,t)},d(n){n&&W(e)}}}function $s(s){let e,t,n,o,l,i,r,c,u,h,p;function m(){s[48].call(o,s[69])}function g(){return s[49](s[69])}function _(){return s[50](s[69])}return{c(){e=E("div"),t=E("div"),t.textContent="反馈意见",n=q(),o=E("textarea"),l=q(),i=E("div"),r=E("button"),r.textContent="取消",c=q(),u=E("button"),u.textContent="提交",a(t,"class","sy-assistant-dislike-title svelte-mogmt"),a(o,"class","sy-assistant-dislike-input svelte-mogmt"),a(o,"placeholder","请输入您的反馈意见..."),a(r,"class","sy-assistant-popup-cancel svelte-mogmt"),a(u,"class","sy-assistant-popup-submit svelte-mogmt"),a(i,"class","sy-assistant-popup-actions svelte-mogmt"),a(e,"class","sy-assistant-dislike-popup svelte-mogmt"),P(e,"left",s[17].x+"px"),P(e,"top",s[17].y+"px"),P(e,"z-index",s[0]+3)},m(T,R){G(T,e,R),d(e,t),d(e,n),d(e,o),st(o,s[15][s[69].id]),d(e,l),d(e,i),d(i,r),d(i,c),d(i,u),h||(p=[Y(o,"input",m),Y(r,"click",g),Y(u,"click",_)],h=!0)},p(T,R){s=T,R[0]&32800&&st(o,s[15][s[69].id]),R[0]&131072&&P(e,"left",s[17].x+"px"),R[0]&131072&&P(e,"top",s[17].y+"px"),R[0]&1&&P(e,"z-index",s[0]+3)},d(T){T&&W(e),h=!1,ke(p)}}}function ei(s,e){let t,n,o,l,i,r,c,u,h=new Date(e[69].timestamp).toLocaleString()+"",p,m;function g(y,v){return y[69].type==="assistant"?Ko:Jo}let _=g(e),T=_(e);function R(y,v){return y[9]&&y[69].id===y[5][y[5].length-1].id&&y[69].type==="assistant"&&!y[69].content?el:$o}let L=R(e),A=L(e),w=e[69].attachments&&Xs(e),k=e[69].id!=="-1"&&e[69].type==="assistant"&&!e[9]&&Ks(e);return{key:s,first:null,c(){t=E("div"),T.c(),n=q(),o=E("div"),l=E("div"),A.c(),i=q(),w&&w.c(),r=q(),k&&k.c(),c=q(),u=E("div"),p=Te(h),m=q(),a(l,"class","sy-assistant-message-content svelte-mogmt"),a(u,"class","sy-assistant-message-time svelte-mogmt"),a(o,"class","sy-assistant-message-bubble svelte-mogmt"),a(t,"class","sy-assistant-message svelte-mogmt"),$(t,"user",e[69].type==="user"),this.first=t},m(y,v){G(y,t,v),T.m(t,null),d(t,n),d(t,o),d(o,l),A.m(l,null),d(l,i),w&&w.m(l,null),d(l,r),k&&k.m(l,null),d(o,c),d(o,u),d(u,p),d(t,m)},p(y,v){e=y,_!==(_=g(e))&&(T.d(1),T=_(e),T&&(T.c(),T.m(t,n))),L===(L=R(e))&&A?A.p(e,v):(A.d(1),A=L(e),A&&(A.c(),A.m(l,i))),e[69].attachments?w?w.p(e,v):(w=Xs(e),w.c(),w.m(l,r)):w&&(w.d(1),w=null),e[69].id!=="-1"&&e[69].type==="assistant"&&!e[9]?k?k.p(e,v):(k=Ks(e),k.c(),k.m(l,null)):k&&(k.d(1),k=null),v[0]&32&&h!==(h=new Date(e[69].timestamp).toLocaleString()+"")&&Ne(p,h),v[0]&32&&$(t,"user",e[69].type==="user")},d(y){y&&W(t),T.d(),A.d(),w&&w.d(),k&&k.d()}}}function ti(s){let e,t,n,o,l,i,r,c,u,h,p,m,g,_,T,R,L,A,w,k,y,v,x,M,z,X,B,I=s[1]&&ni(s),C=!s[1]&&ii();return{c(){e=E("div"),t=E("div"),I&&I.c(),n=q(),C&&C.c(),o=q(),l=E("div"),i=E("button"),i.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>',r=q(),c=E("button"),c.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>',u=q(),h=E("div"),p=E("div"),m=E("div"),g=E("div"),_=E("textarea"),T=q(),R=E("div"),L=Te(s[4]),A=Te("/"),w=Te(jn),k=q(),y=E("button"),v=K("svg"),x=K("line"),M=K("polygon"),a(i,"class","sy-assistant-icon-button svelte-mogmt"),a(i,"aria-label","历史会话"),a(c,"class","sy-assistant-icon-button svelte-mogmt"),a(c,"aria-label","新建会话"),a(l,"class","sy-assistant-chat-actions-btns svelte-mogmt"),a(t,"class","sy-assistant-chat-actions svelte-mogmt"),a(e,"class","sy-assistant-chat-footer svelte-mogmt"),a(_,"class","sy-assistant-textarea svelte-mogmt"),a(_,"placeholder","输入您的问题..."),a(_,"maxlength",jn),a(_,"rows","3"),a(R,"class","sy-assistant-char-count svelte-mogmt"),$(R,"over-limit",s[20]),a(g,"class","sy-assistant-textarea-container svelte-mogmt"),a(m,"class","sy-assistant-input-wrapper svelte-mogmt"),a(x,"x1","22"),a(x,"y1","2"),a(x,"x2","11"),a(x,"y2","13"),a(M,"points","22 2 15 22 11 13 2 9 22 2"),a(v,"xmlns","http://www.w3.org/2000/svg"),a(v,"width","20"),a(v,"height","20"),a(v,"viewBox","0 0 24 24"),a(v,"fill","none"),a(v,"stroke","currentColor"),a(v,"stroke-width","2"),a(v,"stroke-linecap","round"),a(v,"stroke-linejoin","round"),a(y,"class","sy-assistant-send-button svelte-mogmt"),y.disabled=z=!s[3].trim()||s[20],a(y,"aria-label","发送消息"),a(p,"class","sy-assistant-input-container svelte-mogmt"),a(h,"class","sy-assistant-input-area svelte-mogmt")},m(j,Q){G(j,e,Q),d(e,t),I&&I.m(t,null),d(t,n),C&&C.m(t,null),d(t,o),d(t,l),d(l,i),d(l,r),d(l,c),G(j,u,Q),G(j,h,Q),d(h,p),d(p,m),d(m,g),d(g,_),st(_,s[3]),d(g,T),d(g,R),d(R,L),d(R,A),d(R,w),d(p,k),d(p,y),d(y,v),d(v,x),d(v,M),X||(B=[Y(i,"click",s[33]),Y(i,"mouseenter",s[53]),Y(i,"mouseleave",s[31]),Y(c,"click",s[36]),Y(c,"mouseenter",s[54]),Y(c,"mouseleave",s[31]),Y(_,"input",s[55]),Y(_,"keydown",s[56]),Y(y,"click",s[22]),Y(y,"mouseenter",s[57]),Y(y,"mouseleave",s[31])],X=!0)},p(j,Q){j[1]?I?I.p(j,Q):(I=ni(j),I.c(),I.m(t,n)):I&&(I.d(1),I=null),j[1]?C&&(C.d(1),C=null):C||(C=ii(),C.c(),C.m(t,o)),Q[0]&8&&st(_,j[3]),Q[0]&16&&Ne(L,j[4]),Q[0]&1048576&&$(R,"over-limit",j[20]),Q[0]&1048584&&z!==(z=!j[3].trim()||j[20])&&(y.disabled=z)},d(j){j&&(W(e),W(u),W(h)),I&&I.d(),C&&C.d(),X=!1,ke(B)}}}function ni(s){let e,t,n,o,l=it(s[11]),i=[];for(let r=0;r<l.length;r+=1)i[r]=si(Gs(s,l,r));return{c(){e=E("div"),t=E("select");for(let r=0;r<i.length;r+=1)i[r].c();a(t,"class","sy-assistant-select svelte-mogmt"),s[12]===void 0&&Gt(()=>s[52].call(t)),a(e,"class","sy-assistant-scene-select svelte-mogmt")},m(r,c){G(r,e,c),d(e,t);for(let u=0;u<i.length;u+=1)i[u]&&i[u].m(t,null);$n(t,s[12],!0),n||(o=Y(t,"change",s[52]),n=!0)},p(r,c){if(c[0]&2048){l=it(r[11]);let u;for(u=0;u<l.length;u+=1){const h=Gs(r,l,u);i[u]?i[u].p(h,c):(i[u]=si(h),i[u].c(),i[u].m(t,null))}for(;u<i.length;u+=1)i[u].d(1);i.length=l.length}c[0]&6144&&$n(t,r[12])},d(r){r&&W(e),Jn(i,r),n=!1,o()}}}function si(s){let e,t=s[66].name+"",n,o,l;return{c(){e=E("option"),n=Te(t),o=q(),e.__value=l=s[66].code,st(e,e.__value)},m(i,r){G(i,e,r),d(e,n),d(e,o)},p(i,r){r[0]&2048&&t!==(t=i[66].name+"")&&Ne(n,t),r[0]&2048&&l!==(l=i[66].code)&&(e.__value=l,st(e,e.__value))},d(i){i&&W(e)}}}function ii(s){let e;return{c(){e=E("div"),a(e,"class","sy-assistant-scene-select svelte-mogmt")},m(t,n){G(t,e,n)},d(t){t&&W(e)}}}function oi(s){let e,t=s[18].text+"",n;return{c(){e=E("div"),n=Te(t),a(e,"class","sy-assistant-button-tooltip svelte-mogmt"),P(e,"left",s[18].x+"px"),P(e,"top",s[18].y+"px")},m(o,l){G(o,e,l),d(e,n)},p(o,l){l[0]&262144&&t!==(t=o[18].text+"")&&Ne(n,t),l[0]&262144&&P(e,"left",o[18].x+"px"),l[0]&262144&&P(e,"top",o[18].y+"px")},d(o){o&&W(e)}}}function sl(s){let e,t,n,o,l,i,r;const c=[Qo,Vo],u=[];function h(g,_){return g[19]?0:1}t=h(s),n=u[t]=c[t](s);let p=!s[19]&&ti(s),m=s[18]&&oi(s);return{c(){e=E("div"),n.c(),o=q(),p&&p.c(),l=q(),m&&m.c(),i=qt(),a(e,"class","sy-assistant-chat-container svelte-mogmt"),P(e,"z-index",s[0]+2)},m(g,_){G(g,e,_),u[t].m(e,null),d(e,o),p&&p.m(e,null),s[58](e),G(g,l,_),m&&m.m(g,_),G(g,i,_),r=!0},p(g,_){let T=t;t=h(g),t===T?u[t].p(g,_):(kn(),$e(u[T],1,1,()=>{u[T]=null}),wn(),n=u[t],n?n.p(g,_):(n=u[t]=c[t](g),n.c()),je(n,1),n.m(e,o)),g[19]?p&&(p.d(1),p=null):p?p.p(g,_):(p=ti(g),p.c(),p.m(e,null)),(!r||_[0]&1)&&P(e,"z-index",g[0]+2),g[18]?m?m.p(g,_):(m=oi(g),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null)},i(g){r||(je(n),r=!0)},o(g){$e(n),r=!1},d(g){g&&(W(e),W(l),W(i)),u[t].d(),p&&p.d(),s[58](null),m&&m.d(g)}}}let jn=500;function il(s){const e=s.match(/source#\[(.*)\]#source/);return e?s.replace(`source#[${e[1]}]#source`,""):s}function li(s){const e=s.match(/source#\[(.*)\]#source/);if(e)try{return JSON.parse(`[${e[1]}]`)}catch(t){console.error("Failed to parse attachments:",t)}return null}function on(s){const e=s.split(".");if(e.length>1){const t=e.pop()||"";return{name:e.join("."),ext:t?`.${t}`:""}}return{name:s,ext:""}}function ol(s,e,t){let n,o,l="",i=[{sessionId:"",requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}],r="",c=null,u=null,h={x:0,y:0,alignRight:!1},p=null,m=!1;se.setOptions({breaks:!0,gfm:!0});function g(b){try{const F=se(b);return Ps.sanitize(F)}catch(F){console.warn("Markdown parsing failed, fallback to HTML:",F);try{const V=b.replace(/\n/g,"<br>").replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>");return Ps.sanitize(V)}catch(V){return console.error("HTML fallback failed:",V),b}}}let _;function T(b=!1){_&&_.scrollTo({top:_.scrollHeight,behavior:b?"smooth":"auto"})}xi(()=>{T(!1)});let{zIndex:R}=e,{sessionId:L}=e,{hasScene:A}=e,{apiPrefix:w}=e,k=[],y="";function v(){return Ie(this,null,function*(){var b;if(A)try{const F=yield fetch(`${w}/chat/getSceneList`,{headers:{"Auth-Token":`${me()}`,Authorization:`bearer ${me()}`}});if(!F.ok)throw new Error("Failed to fetch scenes");const V=yield F.json();V.status==="success"&&((b=V.data)!=null&&b.sceneList)&&(t(11,k=V.data.sceneList),k.length>0&&t(12,y=k[0].code))}catch(F){console.error("Failed to fetch scenes:",F)}})}mn(()=>{v()});function x(){return Ie(this,null,function*(){if(!l.trim()||o)return;if(!L){console.error("No session ID available");return}const b=Date.now().toString(),F=Date.now().toString()+Math.random().toString().slice(2,8),V={sessionId:L,requestId:F,id:b,type:"user",content:l.trim(),timestamp:Date.now()};t(5,i=[...i,V]);const he=l.trim();t(3,l="");const de=(Date.now()+1).toString();r="",t(5,i=[...i,{sessionId:L,requestId:F,id:de,type:"assistant",content:"",timestamp:Date.now()}]),t(9,m=!0),c&&c.abort(),c=new AbortController;try{yield Wi(`${w}/chat/sse`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`},body:JSON.stringify({sessionId:L,requestId:F,keyword:he,flowId:"1",extendKeys:A?{sceneCode:y}:void 0}),signal:c.signal,onmessage(ve){try{const Me=ve.data;if(Me){const tt=li(Me);tt?(t(5,i=i.map(Ge=>Ge.id===de?Se(re({},Ge),{attachments:tt}):Ge)),T(!0)):(r+=Me,t(5,i=i.map(Ge=>Ge.id===de?Se(re({},Ge),{content:r}):Ge)),T(!1))}}catch(Me){console.error("Failed to process SSE message:",Me)}},onerror(ve){console.error("SSE error:",ve),c=null,t(9,m=!1)},onclose(){c=null,t(9,m=!1)}})}catch(ve){console.error("Failed to send message:",ve),t(9,m=!1)}})}function M(b,F,V){const he=V.getBoundingClientRect(),de=_.getBoundingClientRect(),ve=he.left<de.width/2;t(6,u=F),t(7,h={x:he.left,y:he.top+he.height/2,alignRight:ve})}function z(){t(8,p=setTimeout(()=>{t(6,u=null),t(8,p=null)},200))}Ii(()=>{c&&c.abort(),p&&clearTimeout(p)});function X(b,F){return Ie(this,null,function*(){try{const V=yield fetch(`${w}/file/downloadFile`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`},body:JSON.stringify({fileName:b,fileUrl:F})});if(!V.ok)throw new Error("Download failed");const he=V.headers.get("content-type")||"application/octet-stream",de=yield V.blob(),ve=window.URL.createObjectURL(de),Me=document.createElement("a");Me.href=ve,Me.download=b,document.body.appendChild(Me),Me.click(),window.URL.revokeObjectURL(ve),document.body.removeChild(Me)}catch(V){console.error("Failed to download file:",V)}})}let B={};function I(b,F){return Ie(this,null,function*(){try{const V=F.replace(/<br\s*\/?>/g,`
48
+ `).replace(/\*\*(.*?)\*\*/g,"$1").replace(/###/g,"").trim();yield navigator.clipboard.writeText(V),t(13,B[b]=!0,B),setTimeout(()=>{t(13,B[b]=!1,B),t(13,B)},1500)}catch(V){console.error("Failed to copy:",V)}})}let C={},j={},Q=!1;function ie(b,F){return Ie(this,null,function*(){if(C[b]===F){t(14,C[b]=null,C),t(14,C);return}if(t(14,C[b]=F,C),t(14,C),F==="like")try{if(!(yield fetch(`${w}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`},body:JSON.stringify({sessionId:L,requestId:b,feedBackFlag:"1",feedBackContent:"点赞"})})).ok)throw new Error("Feedback failed")}catch(V){console.error("Failed to send feedback:",V),t(14,C[b]=null,C),t(14,C)}else t(16,Q=!0)})}function _e(b){return Ie(this,null,function*(){var F;if((F=j[b])!=null&&F.trim())try{if(!(yield fetch(`${w}/chat/record/feedback`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`},body:JSON.stringify({sessionId:L,requestId:b,feedBackFlag:"0",feedBackContent:j[b]})})).ok)throw new Error("Feedback failed");t(16,Q=!1),t(15,j[b]="",j),t(15,j)}catch(V){console.error("Failed to send feedback:",V),t(14,C[b]=null,C),t(14,C)}})}let We={x:0,y:0};function pe(b,F){const he=b.currentTarget.getBoundingClientRect();t(17,We={x:he.left-290,y:he.top-160}),ie(F,"dislike")}let qe=null;function ne(b,F){const he=b.currentTarget.getBoundingClientRect();t(18,qe={text:F,x:he.left+he.width/2,y:he.top-8})}function Ze(){t(18,qe=null)}let oe=!1,Le=[],ee=Date.now().toString();function Oe(){Ze(),t(19,oe=!0)}function Ae(){Ze(),t(19,oe=!1)}function et(b){return Ie(this,null,function*(){if(!m){t(9,m=!0);try{const F=yield fetch(`${w}/chat/record/session/detail/query`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`},body:JSON.stringify({sessionId:b})});if(!F.ok)throw new Error("Failed to load sessions");const V=yield F.json();if(V.code===0){ee=b,t(19,oe=!1);const he=V.data.map((de,ve)=>{const Me=li(de.answer),tt=il(de.answer);return[{sessionId:de.sessionId,requestId:de.requestId,id:(Date.now()+2*ve).toString(),type:"user",content:de.keyword,timestamp:new Date(de.createDate).getTime()},{sessionId:de.sessionId,requestId:de.requestId,id:(Date.now()+2*ve+1).toString(),type:"assistant",content:tt,attachments:Me,timestamp:new Date(de.createDate).getTime()}]});t(5,i=he.flat())}}catch(F){console.error("Failed to load sessions:",F)}finally{t(9,m=!1)}}})}function N(){return Ie(this,null,function*(){const b=yield ae();if(!b){console.error("Failed to create new session");return}ee=b,t(5,i=[{sessionId:ee,requestId:"",id:"-1",type:"assistant",content:"您好!我是您的AI助手,有什么可以帮您的吗?",timestamp:Date.now()}]),t(3,l="")})}function ae(){return Ie(this,null,function*(){try{const b=yield fetch(`${w}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`}});if(!b.ok)throw new Error("Failed to get session ID");const F=yield b.json();if(F.code===0)return ee=F.data.sessionId,ee;throw new Error(F.message||"Failed to get session ID")}catch(b){return console.error("Failed to get session ID:",b),null}})}const D=(b,F)=>M(F,b.tips,F.currentTarget),Z=b=>X(b.content_title,b.link),we=()=>{p&&(clearTimeout(p),t(8,p=null))},be=()=>{t(6,u=null)},De=b=>I(b.id,b.content),Be=(b,F)=>ne(F,B[b.id]?"已复制":"复制内容"),ot=b=>ie(b.id,"like"),Tt=(b,F)=>ne(F,C[b.id]==="like"?"取消点赞":"点赞"),vt=(b,F)=>pe(F,b.id),ln=(b,F)=>ne(F,C[b.id]==="dislike"?"取消点踩":"点踩");function rn(b){j[b.id]=this.value,t(15,j)}const Wn=b=>{t(16,Q=!1),t(14,C[b.id]=null,C),t(14,C)},Ht=b=>_e(b.id);function pt(b){kt[b?"unshift":"push"](()=>{_=b,t(10,_)})}function lt(){y=Ai(this),t(12,y),t(11,k)}const rt=b=>ne(b,"历史会话"),an=b=>ne(b,"新建会话");function cn(){l=this.value,t(3,l)}const un=b=>b.key==="Enter"&&!b.shiftKey&&(x(),b.preventDefault()),Bt=b=>ne(b,"发送消息");function fn(b){kt[b?"unshift":"push"](()=>{_=b,t(10,_)})}return s.$$set=b=>{"zIndex"in b&&t(0,R=b.zIndex),"sessionId"in b&&t(37,L=b.sessionId),"hasScene"in b&&t(1,A=b.hasScene),"apiPrefix"in b&&t(2,w=b.apiPrefix)},s.$$.update=()=>{s.$$.dirty[0]&8&&t(4,n=l.length),s.$$.dirty[0]&16&&t(20,o=n>jn)},[R,A,w,l,n,i,u,h,p,m,_,k,y,B,C,j,Q,We,qe,oe,o,g,x,M,z,X,I,ie,_e,pe,ne,Ze,Le,Oe,Ae,et,N,L,D,Z,we,be,De,Be,ot,Tt,vt,ln,rn,Wn,Ht,pt,lt,rt,an,cn,un,Bt,fn]}class ll extends Tn{constructor(e){super(),yn(this,e,ol,sl,dt,{zIndex:0,sessionId:37,hasScene:1,apiPrefix:2},null,[-1,-1,-1])}}function ri(s){let e,t,n,o,l=s[3].title+"",i,r,c,u,h,p,m,g,_,T=s[2]?"退出全屏":"全屏显示",R,L,A,w,k,y,v,x,M=s[7]?"取消吸附":"吸附到边缘",z,X,B,I,C,j,Q,ie,_e,We=`${s[3].height}px`,pe,qe,ne;function Ze(D,Z){return D[2]?al:rl}let oe=Ze(s),Le=oe(s);function ee(D,Z){return D[7]?ul:cl}let Oe=ee(s),Ae=Oe(s);const et=[hl,fl],N=[];function ae(D,Z){return D[8]?0:1}return ie=ae(s),_e=N[ie]=et[ie](s),{c(){var D,Z,we;e=E("div"),t=E("div"),n=E("div"),o=E("h3"),i=Te(l),r=q(),c=E("div"),u=E("div"),h=E("button"),p=K("svg"),Le.c(),g=q(),_=E("span"),R=Te(T),L=q(),A=E("div"),w=E("button"),k=K("svg"),Ae.c(),v=q(),x=E("span"),z=Te(M),X=q(),B=E("div"),I=E("button"),I.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>',C=q(),j=E("span"),j.textContent="关闭助手",Q=q(),_e.c(),a(o,"class","svelte-1427avp"),a(p,"xmlns","http://www.w3.org/2000/svg"),a(p,"width","18"),a(p,"height","18"),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(h,"class","sy-assistant-action-button svelte-1427avp"),a(h,"aria-label",m=s[2]?"退出全屏":"全屏显示"),$(h,"active",s[2]),a(_,"class","sy-assistant-tooltip svelte-1427avp"),P(_,"z-index",((D=s[3].zIndex)!=null?D:1e3)+3),a(u,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),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(w,"class","sy-assistant-action-button svelte-1427avp"),a(w,"aria-label",y=s[7]?"取消吸附":"吸附到边缘"),$(w,"active",s[7]),a(x,"class","sy-assistant-tooltip svelte-1427avp"),P(x,"z-index",((Z=s[3].zIndex)!=null?Z:1e3)+3),a(A,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),a(I,"class","sy-assistant-close-button svelte-1427avp"),a(I,"aria-label","关闭助手"),a(j,"class","sy-assistant-tooltip svelte-1427avp"),P(j,"z-index",((we=s[3].zIndex)!=null?we:1e3)+3),a(B,"class","sy-assistant-tooltip-wrapper svelte-1427avp"),a(c,"class","sy-assistant-header-actions svelte-1427avp"),a(n,"class","sy-assistant-drawer-header svelte-1427avp"),a(n,"role","button"),a(n,"tabindex","0"),a(n,"aria-label","拖动助手窗口"),$(n,"dragging",s[6]),$(n,"fullscreen",s[2]),$(n,"snapped",s[7]),a(t,"class","sy-assistant-drawer-content svelte-1427avp"),a(e,"class","sy-assistant-drawer svelte-1427avp"),$(e,"fullscreen",s[2]),P(e,"height",We)},m(D,Z){G(D,e,Z),d(e,t),d(t,n),d(n,o),d(o,i),d(n,r),d(n,c),d(c,u),d(u,h),d(h,p),Le.m(p,null),d(u,g),d(u,_),d(_,R),d(c,L),d(c,A),d(A,w),d(w,k),Ae.m(k,null),d(A,v),d(A,x),d(x,z),d(c,X),d(c,B),d(B,I),d(B,C),d(B,j),d(t,Q),N[ie].m(t,null),pe=!0,qe||(ne=[Y(h,"click",s[16]),Y(w,"click",s[18]),Y(I,"click",s[15]),Y(n,"mousedown",Kn(s[17]))],qe=!0)},p(D,Z){var be,De,Be;(!pe||Z[0]&8)&&l!==(l=D[3].title+"")&&Ne(i,l),oe!==(oe=Ze(D))&&(Le.d(1),Le=oe(D),Le&&(Le.c(),Le.m(p,null))),(!pe||Z[0]&4&&m!==(m=D[2]?"退出全屏":"全屏显示"))&&a(h,"aria-label",m),(!pe||Z[0]&4)&&$(h,"active",D[2]),(!pe||Z[0]&4)&&T!==(T=D[2]?"退出全屏":"全屏显示")&&Ne(R,T),Z[0]&8&&P(_,"z-index",((be=D[3].zIndex)!=null?be:1e3)+3),Oe!==(Oe=ee(D))&&(Ae.d(1),Ae=Oe(D),Ae&&(Ae.c(),Ae.m(k,null))),(!pe||Z[0]&128&&y!==(y=D[7]?"取消吸附":"吸附到边缘"))&&a(w,"aria-label",y),(!pe||Z[0]&128)&&$(w,"active",D[7]),(!pe||Z[0]&128)&&M!==(M=D[7]?"取消吸附":"吸附到边缘")&&Ne(z,M),Z[0]&8&&P(x,"z-index",((De=D[3].zIndex)!=null?De:1e3)+3),Z[0]&8&&P(j,"z-index",((Be=D[3].zIndex)!=null?Be:1e3)+3),(!pe||Z[0]&64)&&$(n,"dragging",D[6]),(!pe||Z[0]&4)&&$(n,"fullscreen",D[2]),(!pe||Z[0]&128)&&$(n,"snapped",D[7]);let we=ie;ie=ae(D),ie===we?N[ie].p(D,Z):(kn(),$e(N[we],1,1,()=>{N[we]=null}),wn(),_e=N[ie],_e?_e.p(D,Z):(_e=N[ie]=et[ie](D),_e.c()),je(_e,1),_e.m(t,null)),(!pe||Z[0]&4)&&$(e,"fullscreen",D[2]),Z[0]&8&&We!==(We=`${D[3].height}px`)&&P(e,"height",We)},i(D){pe||(je(_e),pe=!0)},o(D){$e(_e),pe=!1},d(D){D&&W(e),Le.d(),Ae.d(),N[ie].d(),qe=!1,ke(ne)}}}function rl(s){let e;return{c(){e=K("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){G(t,e,n)},d(t){t&&W(e)}}}function al(s){let e;return{c(){e=K("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){G(t,e,n)},d(t){t&&W(e)}}}function cl(s){let e,t;return{c(){e=K("rect"),t=K("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,o){G(n,e,o),G(n,t,o)},d(n){n&&(W(e),W(t))}}}function ul(s){let e,t;return{c(){e=K("rect"),t=K("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,o){G(n,e,o),G(n,t,o)},d(n){n&&(W(e),W(t))}}}function fl(s){var n,o,l;let e,t;return e=new ll({props:{zIndex:(n=s[3].zIndex)!=null?n:1e3,sessionId:s[9],hasScene:(o=s[3].hasScene)!=null?o:!1,apiPrefix:(l=s[3].apiPrefix)!=null?l:"/aiops/aigc"}}),{c(){bn(e.$$.fragment)},m(i,r){Zt(e,i,r),t=!0},p(i,r){var u,h,p;const c={};r[0]&8&&(c.zIndex=(u=i[3].zIndex)!=null?u:1e3),r[0]&512&&(c.sessionId=i[9]),r[0]&8&&(c.hasScene=(h=i[3].hasScene)!=null?h:!1),r[0]&8&&(c.apiPrefix=(p=i[3].apiPrefix)!=null?p:"/aiops/aigc"),e.$set(c)},i(i){t||(je(e.$$.fragment,i),t=!0)},o(i){$e(e.$$.fragment,i),t=!1},d(i){Xt(e,i)}}}function hl(s){var n,o;let e,t;return e=new qs({props:{sessions:s[13],onClose:s[26],onSelect:s[19],zIndex:(n=s[3].zIndex)!=null?n:1e3,apiPrefix:(o=s[3].apiPrefix)!=null?o:"/aiops/aigc"}}),{c(){bn(e.$$.fragment)},m(l,i){Zt(e,l,i),t=!0},p(l,i){var c,u;const r={};i[0]&256&&(r.onClose=l[26]),i[0]&8&&(r.zIndex=(c=l[3].zIndex)!=null?c:1e3),i[0]&8&&(r.apiPrefix=(u=l[3].apiPrefix)!=null?u:"/aiops/aigc"),e.$set(r)},i(l){t||(je(e.$$.fragment,l),t=!0)},o(l){$e(e.$$.fragment,l),t=!1},d(l){Xt(e,l)}}}function pl(s){let e,t,n=`${s[12]}px`,o,l,i,r,c,u,h,p,m,g,_,T,R,L,A=s[12]>0&&ri(s);return{c(){var w,k;e=E("div"),t=E("div"),A&&A.c(),o=q(),l=E("button"),i=K("svg"),r=K("path"),c=K("path"),u=K("path"),h=K("path"),p=K("path"),m=K("path"),g=K("path"),a(t,"class","sy-assistant-drawer-wrapper svelte-1427avp"),$(t,"fullscreen",s[2]),P(t,"width",n),a(r,"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(r,"fill","#6F8698"),a(c,"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(c,"fill","#3677FF"),a(u,"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(u,"fill","#D0D5F1"),a(h,"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(h,"fill","#3677FF"),a(p,"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(p,"fill","#FFFFFF"),a(m,"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(m,"fill","#FFFFFF"),a(g,"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(g,"fill","#8896A4"),a(i,"class","sy-assistant-icon"),a(i,"viewBox","0 0 1024 1024"),a(i,"version","1.1"),a(i,"xmlns","http://www.w3.org/2000/svg"),a(i,"width","32"),a(i,"height","32"),a(i,"fill","currentColor"),a(i,"aria-label","助手图标"),a(l,"class","sy-assistant-floating-button svelte-1427avp"),a(l,"aria-label","打开助手"),a(l,"style",_=s[10]+" z-index: "+(((w=s[3].zIndex)!=null?w:1e3)+1)+";"),a(e,"class","sy-assistant-container sy-assistant-theme svelte-1427avp"),$(e,"fullscreen",s[2]),$(e,"snapped",s[7]),P(e,"position",s[3].position),P(e,"right",s[7]?0:`${s[0]}px`),P(e,"bottom",s[7]?0:`${s[1]}px`),P(e,"top",s[7]||s[2]?"0":"auto"),P(e,"left",s[2]?"0":"auto"),P(e,"z-index",(k=s[3].zIndex)!=null?k:1e3)},m(w,k){G(w,e,k),d(e,t),A&&A.m(t,null),d(e,o),d(e,l),d(l,i),d(i,r),d(i,c),d(i,u),d(i,h),d(i,p),d(i,m),d(i,g),s[27](l),s[29](e),T=!0,R||(L=[Y(l,"click",s[15]),Y(l,"mousedown",Kn(s[28]))],R=!0)},p(w,k){var y,v;w[12]>0?A?(A.p(w,k),k[0]&4096&&je(A,1)):(A=ri(w),A.c(),je(A,1),A.m(t,null)):A&&(kn(),$e(A,1,1,()=>{A=null}),wn()),(!T||k[0]&4)&&$(t,"fullscreen",w[2]),k[0]&4096&&n!==(n=`${w[12]}px`)&&P(t,"width",n),(!T||k[0]&1032&&_!==(_=w[10]+" z-index: "+(((y=w[3].zIndex)!=null?y:1e3)+1)+";"))&&a(l,"style",_),(!T||k[0]&4)&&$(e,"fullscreen",w[2]),(!T||k[0]&128)&&$(e,"snapped",w[7]),k[0]&8&&P(e,"position",w[3].position),k[0]&129&&P(e,"right",w[7]?0:`${w[0]}px`),k[0]&130&&P(e,"bottom",w[7]?0:`${w[1]}px`),k[0]&132&&P(e,"top",w[7]||w[2]?"0":"auto"),k[0]&4&&P(e,"left",w[2]?"0":"auto"),k[0]&8&&P(e,"z-index",(v=w[3].zIndex)!=null?v:1e3)},i(w){T||(je(A),T=!0)},o(w){$e(A),T=!1},d(w){w&&W(e),A&&A.d(),s[27](null),s[29](null),R=!1,ke(L)}}}const Un=48,ge=20;function dl(s,e,t){let n,o,l,i,r=U,c=()=>(r(),r=Ke(o,N=>t(12,i=N)),o);s.$$.on_destroy.push(()=>r());const u={position:"fixed",width:480,height:600,title:"智慧运维助手",initialState:"default",defaultPosition:{right:ge,bottom:ge},snappedWidth:480,drawerWidth:480,zIndex:1e3,hasScene:!1,apiPrefix:"/aiops/aigc"};let{target:h="body"}=e,{options:p={}}=e,m,g=null,_=!1,T,R=!1,L=0,A=0,w=ge,k=20,y=w,v=k,x=!1,M=ge,z=50,X=!1,B={width:0,height:0,right:0,bottom:0},I=!1,C=!1,j=[],Q=null;function ie(){return Ie(this,null,function*(){try{const N=yield fetch(`${n.apiPrefix}/chat/getSessionId`,{method:"POST",headers:{"Content-Type":"application/json","Auth-Token":`${me()}`,Authorization:`bearer ${me()}`}});if(!N.ok)throw new Error("Failed to get session ID");const ae=yield N.json();if(ae.code===0)return t(9,Q=ae.data.sessionId),Q;throw new Error(ae.message||"Failed to get session ID")}catch(N){return console.error("Failed to get session ID:",N),null}})}function _e(N,ae=!1){ae?t(23,x=!0):t(6,R=!0),L=N.clientX,A=N.clientY,w=ae?M:y,k=ae?z:v,N.preventDefault()}function We(N){if(!R&&!x)return;const ae=L-N.clientX,D=A-N.clientY;if(x){const Z=w+ae,we=N.clientY;t(24,M=Math.max(ge,Math.min(window.innerWidth-Un-ge,Z)));const be=window.innerHeight-Un-ge,Be=Math.max(ge,Math.min(be,we));t(25,z=(window.innerHeight-Be-Un)/window.innerHeight*100)}else{const Z=n.width||0,we=n.height||0,be=w+ae;t(0,y=Math.max(ge,Math.min(window.innerWidth-Z-ge,be)));const De=k+D;t(1,v=Math.max(ge,Math.min(window.innerHeight-we-ge,De)))}}function pe(){t(6,R=!1),t(23,x=!1)}mn(()=>{typeof h=="string"?g=document.querySelector(h)||document.body:g=h||document.body;const N=D=>We(D),ae=()=>pe();return document.addEventListener("mousemove",N),document.addEventListener("mouseup",ae),m&&g&&g.appendChild(m),T&&T.getBoundingClientRect().left,t(7,I=n.initialState==="snapped"),t(2,X=n.initialState==="fullscreen"),n.initialState==="snapped"?(t(0,y=0),t(1,v=0),t(3,n=Se(re({},n),{height:typeof window!="undefined"?window.innerHeight:n.height,width:n.snappedWidth||n.width}))):n.initialState==="fullscreen"&&(t(0,y=0),t(1,v=0),t(3,n=Se(re({},n),{width:typeof window!="undefined"?window.innerWidth:n.width,height:typeof window!="undefined"?window.innerHeight:n.height}))),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",ae),g&&m&&g.removeChild(m)}});function qe(){return Ie(this,null,function*(){_||(yield ie()),t(22,_=!_)})}function ne(){var N,ae,D,Z,we,be,De,Be;t(2,X=!X),X?(B.width||(B={width:u.width,height:u.height,right:(ae=(N=u.defaultPosition)==null?void 0:N.right)!=null?ae:ge,bottom:(Z=(D=u.defaultPosition)==null?void 0:D.bottom)!=null?Z:ge}),I&&t(7,I=!1),t(20,p=Se(re({},n),{width:window.innerWidth,height:window.innerHeight,drawerWidth:window.innerWidth})),t(0,y=0),t(1,v=0)):(t(20,p=Se(re({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,y=(be=(we=u.defaultPosition)==null?void 0:we.right)!=null?be:ge),t(1,v=(Be=(De=u.defaultPosition)==null?void 0:De.bottom)!=null?Be:ge))}function Ze(N){X||_e(N)}function oe(){var N,ae,D,Z;X&&(t(2,X=!1),t(20,p=Se(re({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth}))),t(7,I=!I),I?(n.height,t(0,y=0),t(1,v=0),t(20,p=Se(re({},n),{height:window.innerHeight,width:n.snappedWidth||u.width,drawerWidth:n.snappedWidth||u.width}))):(t(20,p=Se(re({},n),{width:u.width,height:u.height,drawerWidth:u.drawerWidth})),t(0,y=(ae=(N=u.defaultPosition)==null?void 0:N.right)!=null?ae:ge),t(1,v=(Z=(D=u.defaultPosition)==null?void 0:D.bottom)!=null?Z:ge))}function Le(N){t(8,C=!1)}const ee=()=>t(8,C=!1);function Oe(N){kt[N?"unshift":"push"](()=>{T=N,t(5,T)})}const Ae=N=>_e(N,!0);function et(N){kt[N?"unshift":"push"](()=>{m=N,t(4,m)})}return s.$$set=N=>{"target"in N&&t(21,h=N.target),"options"in N&&t(20,p=N.options)},s.$$.update=()=>{s.$$.dirty[0]&1048576&&t(3,n=Se(re(re({},u),p),{defaultPosition:re(re({},u.defaultPosition),p.defaultPosition)})),s.$$.dirty[0]&4194316&&c(t(11,o=Pi(_?X?window.innerWidth:n.drawerWidth:0,{stiffness:.1,damping:.6}))),s.$$.dirty[0]&11&&typeof window!="undefined"&&(t(0,y=Math.max(ge,Math.min(window.innerWidth-(n.width||0),y))),t(1,v=Math.max(ge,Math.min(window.innerHeight-(n.height||0),v)))),s.$$.dirty[0]&62914560&&t(10,l=_?"display: none;":`position: fixed; right: ${M}px; bottom: ${z}%; transform: none; cursor: ${x?"grabbing":"grab"};`)},[y,v,X,n,m,T,R,I,C,Q,l,o,i,j,_e,qe,ne,Ze,oe,Le,p,h,_,x,M,z,ee,Oe,Ae,et]}class ml extends Tn{constructor(e){super(),yn(this,e,dl,pl,dt,{target:21,options:20},null,[-1,-1])}}te.SyAssistant=ml,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})});