@blueking/ai-blueking 0.2.2 → 0.2.3
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.
|
@@ -19309,7 +19309,9 @@ const Tpe = { class: "message-content user" }, xpe = {
|
|
|
19309
19309
|
return (a = e.message) != null && a.status ? i[e.message.status] : "";
|
|
19310
19310
|
}), r = or(() => {
|
|
19311
19311
|
if (e.message.content) {
|
|
19312
|
-
const a = new jpe(
|
|
19312
|
+
const a = new jpe({
|
|
19313
|
+
html: !0
|
|
19314
|
+
}).render(e.message.content);
|
|
19313
19315
|
return hO.sanitize(a);
|
|
19314
19316
|
}
|
|
19315
19317
|
return "";
|
|
@@ -285,5 +285,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
285
285
|
`:">",i)},Ci.prototype.renderInline=function(e,t,n){for(var r,o="",i=this.rules,s=0,a=e.length;s<a;s++)r=e[s].type,typeof i[r]<"u"?o+=i[r](e,s,t,n,this):o+=this.renderToken(e,s,t);return o},Ci.prototype.renderInlineAsText=function(e,t,n){for(var r="",o=0,i=e.length;o<i;o++)e[o].type==="text"?r+=e[o].content:e[o].type==="image"?r+=this.renderInlineAsText(e[o].children,t,n):e[o].type==="softbreak"&&(r+=`
|
|
286
286
|
`);return r},Ci.prototype.render=function(e,t,n){var r,o,i,s="",a=this.rules;for(r=0,o=e.length;r<o;r++)i=e[r].type,i==="inline"?s+=this.renderInline(e[r].children,t,n):typeof a[i]<"u"?s+=a[i](e,r,t,n,this):s+=this.renderToken(e,r,t,n);return s};var X3=Ci;function wn(){this.__rules__=[],this.__cache__=null}wn.prototype.__find__=function(e){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},wn.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){t.indexOf(r)<0&&t.push(r)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||e.__cache__[n].push(r.fn))})})},wn.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},wn.prototype.before=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},wn.prototype.after=function(e,t,n,r){var o=this.__find__(e),i=r||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null},wn.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},wn.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(r){var o=this.__find__(r);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!0,n.push(r)},this),this.__cache__=null,n},wn.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)},wn.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(r){var o=this.__find__(r);if(o<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[o].enabled=!1,n.push(r)},this),this.__cache__=null,n},wn.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};var ld=wn,e5=/\r\n?|\n/g,t5=/\0/g,n5=function(t){var n;n=t.src.replace(e5,`
|
|
287
287
|
`),n=n.replace(t5,"�"),t.src=n},r5=function(t){var n;t.inlineMode?(n=new t.Token("inline","",0),n.content=t.src,n.map=[0,1],n.children=[],t.tokens.push(n)):t.md.block.parse(t.src,t.md,t.env,t.tokens)},o5=function(t){var n=t.tokens,r,o,i;for(o=0,i=n.length;o<i;o++)r=n[o],r.type==="inline"&&t.md.inline.parse(r.content,t.md,t.env,r.children)},i5=Je.arrayReplaceAt;function s5(e){return/^<a[>\s]/i.test(e)}function a5(e){return/^<\/a\s*>/i.test(e)}var c5=function(t){var n,r,o,i,s,a,c,l,u,f,p,d,h,g,w,v,N=t.tokens,j;if(t.md.options.linkify){for(r=0,o=N.length;r<o;r++)if(!(N[r].type!=="inline"||!t.md.linkify.pretest(N[r].content)))for(i=N[r].children,h=0,n=i.length-1;n>=0;n--){if(a=i[n],a.type==="link_close"){for(n--;i[n].level!==a.level&&i[n].type!=="link_open";)n--;continue}if(a.type==="html_inline"&&(s5(a.content)&&h>0&&h--,a5(a.content)&&h++),!(h>0)&&a.type==="text"&&t.md.linkify.test(a.content)){for(u=a.content,j=t.md.linkify.match(u),c=[],d=a.level,p=0,j.length>0&&j[0].index===0&&n>0&&i[n-1].type==="text_special"&&(j=j.slice(1)),l=0;l<j.length;l++)g=j[l].url,w=t.md.normalizeLink(g),t.md.validateLink(w)&&(v=j[l].text,j[l].schema?j[l].schema==="mailto:"&&!/^mailto:/i.test(v)?v=t.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):v=t.md.normalizeLinkText(v):v=t.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,""),f=j[l].index,f>p&&(s=new t.Token("text","",0),s.content=u.slice(p,f),s.level=d,c.push(s)),s=new t.Token("link_open","a",1),s.attrs=[["href",w]],s.level=d++,s.markup="linkify",s.info="auto",c.push(s),s=new t.Token("text","",0),s.content=v,s.level=d,c.push(s),s=new t.Token("link_close","a",-1),s.level=--d,s.markup="linkify",s.info="auto",c.push(s),p=j[l].lastIndex);p<u.length&&(s=new t.Token("text","",0),s.content=u.slice(p),s.level=d,c.push(s)),N[r].children=i=i5(i,n,c)}}}},yb=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,l5=/\((c|tm|r)\)/i,u5=/\((c|tm|r)\)/ig,f5={c:"©",r:"®",tm:"™"};function d5(e,t){return f5[t.toLowerCase()]}function p5(e){var t,n,r=0;for(t=e.length-1;t>=0;t--)n=e[t],n.type==="text"&&!r&&(n.content=n.content.replace(u5,d5)),n.type==="link_open"&&n.info==="auto"&&r--,n.type==="link_close"&&n.info==="auto"&&r++}function g5(e){var t,n,r=0;for(t=e.length-1;t>=0;t--)n=e[t],n.type==="text"&&!r&&yb.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&r--,n.type==="link_close"&&n.info==="auto"&&r++}var h5=function(t){var n;if(t.md.options.typographer)for(n=t.tokens.length-1;n>=0;n--)t.tokens[n].type==="inline"&&(l5.test(t.tokens[n].content)&&p5(t.tokens[n].children),yb.test(t.tokens[n].content)&&g5(t.tokens[n].children))},bb=Je.isWhiteSpace,wb=Je.isPunctChar,Cb=Je.isMdAsciiPunct,m5=/['"]/,Ib=/['"]/g,Mb="’";function vl(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function v5(e,t){var n,r,o,i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D,T;for(A=[],n=0;n<e.length;n++){for(r=e[n],c=e[n].level,N=A.length-1;N>=0&&!(A[N].level<=c);N--);if(A.length=N+1,r.type==="text"){o=r.content,s=0,a=o.length;e:for(;s<a&&(Ib.lastIndex=s,i=Ib.exec(o),!!i);){if(w=v=!0,s=i.index+1,j=i[0]==="'",u=32,i.index-1>=0)u=o.charCodeAt(i.index-1);else for(N=n-1;N>=0&&!(e[N].type==="softbreak"||e[N].type==="hardbreak");N--)if(e[N].content){u=e[N].content.charCodeAt(e[N].content.length-1);break}if(f=32,s<a)f=o.charCodeAt(s);else for(N=n+1;N<e.length&&!(e[N].type==="softbreak"||e[N].type==="hardbreak");N++)if(e[N].content){f=e[N].content.charCodeAt(0);break}if(p=Cb(u)||wb(String.fromCharCode(u)),d=Cb(f)||wb(String.fromCharCode(f)),h=bb(u),g=bb(f),g?w=!1:d&&(h||p||(w=!1)),h?v=!1:p&&(g||d||(v=!1)),f===34&&i[0]==='"'&&u>=48&&u<=57&&(v=w=!1),w&&v&&(w=p,v=d),!w&&!v){j&&(r.content=vl(r.content,i.index,Mb));continue}if(v){for(N=A.length-1;N>=0&&(l=A[N],!(A[N].level<c));N--)if(l.single===j&&A[N].level===c){l=A[N],j?(D=t.md.options.quotes[2],T=t.md.options.quotes[3]):(D=t.md.options.quotes[0],T=t.md.options.quotes[1]),r.content=vl(r.content,i.index,T),e[l.token].content=vl(e[l.token].content,l.pos,D),s+=T.length-1,l.token===n&&(s+=D.length-1),o=r.content,a=o.length,A.length=N;continue e}}w?A.push({token:n,pos:i.index,single:j,level:c}):v&&j&&(r.content=vl(r.content,i.index,Mb))}}}}var y5=function(t){var n;if(t.md.options.typographer)for(n=t.tokens.length-1;n>=0;n--)t.tokens[n].type!=="inline"||!m5.test(t.tokens[n].content)||v5(t.tokens[n].children,t)},b5=function(t){var n,r,o,i,s,a,c=t.tokens;for(n=0,r=c.length;n<r;n++)if(c[n].type==="inline"){for(o=c[n].children,s=o.length,i=0;i<s;i++)o[i].type==="text_special"&&(o[i].type="text");for(i=a=0;i<s;i++)o[i].type==="text"&&i+1<s&&o[i+1].type==="text"?o[i+1].content=o[i].content+o[i+1].content:(i!==a&&(o[a]=o[i]),a++);i!==a&&(o.length=a)}};function Ii(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ii.prototype.attrIndex=function(t){var n,r,o;if(!this.attrs)return-1;for(n=this.attrs,r=0,o=n.length;r<o;r++)if(n[r][0]===t)return r;return-1},Ii.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},Ii.prototype.attrSet=function(t,n){var r=this.attrIndex(t),o=[t,n];r<0?this.attrPush(o):this.attrs[r]=o},Ii.prototype.attrGet=function(t){var n=this.attrIndex(t),r=null;return n>=0&&(r=this.attrs[n][1]),r},Ii.prototype.attrJoin=function(t,n){var r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};var ud=Ii,w5=ud;function Lb(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}Lb.prototype.Token=w5;var C5=Lb,I5=ld,fd=[["normalize",n5],["block",r5],["inline",o5],["linkify",c5],["replacements",h5],["smartquotes",y5],["text_join",b5]];function dd(){this.ruler=new I5;for(var e=0;e<fd.length;e++)this.ruler.push(fd[e][0],fd[e][1])}dd.prototype.process=function(e){var t,n,r;for(r=this.ruler.getRules(""),t=0,n=r.length;t<n;t++)r[t](e)},dd.prototype.State=C5;var M5=dd,pd=Je.isSpace;function gd(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function xb(e){var t=[],n=0,r=e.length,o,i=!1,s=0,a="";for(o=e.charCodeAt(n);n<r;)o===124&&(i?(a+=e.substring(s,n-1),s=n):(t.push(a+e.substring(s,n)),a="",s=n+1)),i=o===92,n++,o=e.charCodeAt(n);return t.push(a+e.substring(s)),t}var L5=function(t,n,r,o){var i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D,T;if(n+2>r||(u=n+1,t.sCount[u]<t.blkIndent)||t.sCount[u]-t.blkIndent>=4||(a=t.bMarks[u]+t.tShift[u],a>=t.eMarks[u])||(D=t.src.charCodeAt(a++),D!==124&&D!==45&&D!==58)||a>=t.eMarks[u]||(T=t.src.charCodeAt(a++),T!==124&&T!==45&&T!==58&&!pd(T))||D===45&&pd(T))return!1;for(;a<t.eMarks[u];){if(i=t.src.charCodeAt(a),i!==124&&i!==45&&i!==58&&!pd(i))return!1;a++}for(s=gd(t,n+1),f=s.split("|"),h=[],c=0;c<f.length;c++){if(g=f[c].trim(),!g){if(c===0||c===f.length-1)continue;return!1}if(!/^:?-+:?$/.test(g))return!1;g.charCodeAt(g.length-1)===58?h.push(g.charCodeAt(0)===58?"center":"right"):g.charCodeAt(0)===58?h.push("left"):h.push("")}if(s=gd(t,n).trim(),s.indexOf("|")===-1||t.sCount[n]-t.blkIndent>=4||(f=xb(s),f.length&&f[0]===""&&f.shift(),f.length&&f[f.length-1]===""&&f.pop(),p=f.length,p===0||p!==h.length))return!1;if(o)return!0;for(N=t.parentType,t.parentType="table",A=t.md.block.ruler.getRules("blockquote"),d=t.push("table_open","table",1),d.map=w=[n,0],d=t.push("thead_open","thead",1),d.map=[n,n+1],d=t.push("tr_open","tr",1),d.map=[n,n+1],c=0;c<f.length;c++)d=t.push("th_open","th",1),h[c]&&(d.attrs=[["style","text-align:"+h[c]]]),d=t.push("inline","",0),d.content=f[c].trim(),d.children=[],d=t.push("th_close","th",-1);for(d=t.push("tr_close","tr",-1),d=t.push("thead_close","thead",-1),u=n+2;u<r&&!(t.sCount[u]<t.blkIndent);u++){for(j=!1,c=0,l=A.length;c<l;c++)if(A[c](t,u,r,!0)){j=!0;break}if(j||(s=gd(t,u).trim(),!s)||t.sCount[u]-t.blkIndent>=4)break;for(f=xb(s),f.length&&f[0]===""&&f.shift(),f.length&&f[f.length-1]===""&&f.pop(),u===n+2&&(d=t.push("tbody_open","tbody",1),d.map=v=[n+2,0]),d=t.push("tr_open","tr",1),d.map=[u,u+1],c=0;c<p;c++)d=t.push("td_open","td",1),h[c]&&(d.attrs=[["style","text-align:"+h[c]]]),d=t.push("inline","",0),d.content=f[c]?f[c].trim():"",d.children=[],d=t.push("td_close","td",-1);d=t.push("tr_close","tr",-1)}return v&&(d=t.push("tbody_close","tbody",-1),v[1]=u),d=t.push("table_close","table",-1),w[1]=u,t.parentType=N,t.line=u,!0},x5=function(t,n,r){var o,i,s;if(t.sCount[n]-t.blkIndent<4)return!1;for(i=o=n+1;o<r;){if(t.isEmpty(o)){o++;continue}if(t.sCount[o]-t.blkIndent>=4){o++,i=o;continue}break}return t.line=i,s=t.push("code_block","code",0),s.content=t.getLines(n,i,4+t.blkIndent,!1)+`
|
|
288
|
-
`,s.map=[n,t.line],!0},T5=function(t,n,r,o){var i,s,a,c,l,u,f,p=!1,d=t.bMarks[n]+t.tShift[n],h=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||d+3>h||(i=t.src.charCodeAt(d),i!==126&&i!==96)||(l=d,d=t.skipChars(d,i),s=d-l,s<3)||(f=t.src.slice(l,d),a=t.src.slice(d,h),i===96&&a.indexOf(String.fromCharCode(i))>=0))return!1;if(o)return!0;for(c=n;c++,!(c>=r||(d=l=t.bMarks[c]+t.tShift[c],h=t.eMarks[c],d<h&&t.sCount[c]<t.blkIndent));)if(t.src.charCodeAt(d)===i&&!(t.sCount[c]-t.blkIndent>=4)&&(d=t.skipChars(d,i),!(d-l<s)&&(d=t.skipSpaces(d),!(d<h)))){p=!0;break}return s=t.sCount[n],t.line=c+(p?1:0),u=t.push("fence","code",0),u.info=a,u.content=t.getLines(n+1,c,s,!0),u.markup=f,u.map=[n,t.line],!0},j5=Je.isSpace,k5=function(t,n,r,o){var i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D,T,$,Y,re=t.lineMax,z=t.bMarks[n]+t.tShift[n],X=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||t.src.charCodeAt(z)!==62)return!1;if(o)return!0;for(h=[],g=[],N=[],j=[],T=t.md.block.ruler.getRules("blockquote"),v=t.parentType,t.parentType="blockquote",p=n;p<r&&(Y=t.sCount[p]<t.blkIndent,z=t.bMarks[p]+t.tShift[p],X=t.eMarks[p],!(z>=X));p++){if(t.src.charCodeAt(z++)===62&&!Y){for(c=t.sCount[p]+1,t.src.charCodeAt(z)===32?(z++,c++,i=!1,A=!0):t.src.charCodeAt(z)===9?(A=!0,(t.bsCount[p]+c)%4===3?(z++,c++,i=!1):i=!0):A=!1,d=c,h.push(t.bMarks[p]),t.bMarks[p]=z;z<X&&(s=t.src.charCodeAt(z),j5(s));){s===9?d+=4-(d+t.bsCount[p]+(i?1:0))%4:d++;z++}u=z>=X,g.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(A?1:0),N.push(t.sCount[p]),t.sCount[p]=d-c,j.push(t.tShift[p]),t.tShift[p]=z-t.bMarks[p];continue}if(u)break;for(D=!1,a=0,l=T.length;a<l;a++)if(T[a](t,p,r,!0)){D=!0;break}if(D){t.lineMax=p,t.blkIndent!==0&&(h.push(t.bMarks[p]),g.push(t.bsCount[p]),j.push(t.tShift[p]),N.push(t.sCount[p]),t.sCount[p]-=t.blkIndent);break}h.push(t.bMarks[p]),g.push(t.bsCount[p]),j.push(t.tShift[p]),N.push(t.sCount[p]),t.sCount[p]=-1}for(w=t.blkIndent,t.blkIndent=0,$=t.push("blockquote_open","blockquote",1),$.markup=">",$.map=f=[n,0],t.md.block.tokenize(t,n,p),$=t.push("blockquote_close","blockquote",-1),$.markup=">",t.lineMax=re,t.parentType=v,f[1]=t.line,a=0;a<j.length;a++)t.bMarks[a+n]=h[a],t.tShift[a+n]=j[a],t.sCount[a+n]=N[a],t.bsCount[a+n]=g[a];return t.blkIndent=w,!0},N5=Je.isSpace,S5=function(t,n,r,o){var i,s,a,c,l=t.bMarks[n]+t.tShift[n],u=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||(i=t.src.charCodeAt(l++),i!==42&&i!==45&&i!==95))return!1;for(s=1;l<u;){if(a=t.src.charCodeAt(l++),a!==i&&!N5(a))return!1;a===i&&s++}return s<3?!1:(o||(t.line=n+1,c=t.push("hr","hr",0),c.map=[n,t.line],c.markup=Array(s+1).join(String.fromCharCode(i))),!0)},Tb=Je.isSpace;function jb(e,t){var n,r,o,i;return r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],n=e.src.charCodeAt(r++),n!==42&&n!==45&&n!==43||r<o&&(i=e.src.charCodeAt(r),!Tb(i))?-1:r}function kb(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=r,i=e.eMarks[t];if(o+1>=i||(n=e.src.charCodeAt(o++),n<48||n>57))return-1;for(;;){if(o>=i)return-1;if(n=e.src.charCodeAt(o++),n>=48&&n<=57){if(o-r>=10)return-1;continue}if(n===41||n===46)break;return-1}return o<i&&(n=e.src.charCodeAt(o),!Tb(n))?-1:o}function D5(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&e.tokens[n].type==="paragraph_open"&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}var O5=function(t,n,r,o){var i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D,T,$,Y,re,z,X,F,te,_,k,L=n,R=!1,Z=!0;if(t.sCount[L]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[L]-t.listIndent>=4&&t.sCount[L]<t.blkIndent)return!1;if(o&&t.parentType==="paragraph"&&t.sCount[L]>=t.blkIndent&&(R=!0),(z=kb(t,L))>=0){if(f=!0,F=t.bMarks[L]+t.tShift[L],v=Number(t.src.slice(F,z-1)),R&&v!==1)return!1}else if((z=jb(t,L))>=0)f=!1;else return!1;if(R&&t.skipSpaces(z)>=t.eMarks[L])return!1;if(o)return!0;for(w=t.src.charCodeAt(z-1),g=t.tokens.length,f?(k=t.push("ordered_list_open","ol",1),v!==1&&(k.attrs=[["start",v]])):k=t.push("bullet_list_open","ul",1),k.map=h=[L,0],k.markup=String.fromCharCode(w),X=!1,_=t.md.block.ruler.getRules("list"),D=t.parentType,t.parentType="list";L<r;){for(re=z,N=t.eMarks[L],u=j=t.sCount[L]+z-(t.bMarks[L]+t.tShift[L]);re<N;){if(i=t.src.charCodeAt(re),i===9)j+=4-(j+t.bsCount[L])%4;else if(i===32)j++;else break;re++}if(s=re,s>=N?l=1:l=j-u,l>4&&(l=1),c=u+l,k=t.push("list_item_open","li",1),k.markup=String.fromCharCode(w),k.map=p=[L,0],f&&(k.info=t.src.slice(F,z-1)),Y=t.tight,$=t.tShift[L],T=t.sCount[L],A=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=c,t.tight=!0,t.tShift[L]=s-t.bMarks[L],t.sCount[L]=j,s>=N&&t.isEmpty(L+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,L,r,!0),(!t.tight||X)&&(Z=!1),X=t.line-L>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=A,t.tShift[L]=$,t.sCount[L]=T,t.tight=Y,k=t.push("list_item_close","li",-1),k.markup=String.fromCharCode(w),L=t.line,p[1]=L,L>=r||t.sCount[L]<t.blkIndent||t.sCount[L]-t.blkIndent>=4)break;for(te=!1,a=0,d=_.length;a<d;a++)if(_[a](t,L,r,!0)){te=!0;break}if(te)break;if(f){if(z=kb(t,L),z<0)break;F=t.bMarks[L]+t.tShift[L]}else if(z=jb(t,L),z<0)break;if(w!==t.src.charCodeAt(z-1))break}return f?k=t.push("ordered_list_close","ol",-1):k=t.push("bullet_list_close","ul",-1),k.markup=String.fromCharCode(w),h[1]=L,t.line=L,t.parentType=D,Z&&D5(t,g),!0},_5=Je.normalizeReference,yl=Je.isSpace,E5=function(t,n,r,o){var i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D=0,T=t.bMarks[n]+t.tShift[n],$=t.eMarks[n],Y=n+1;if(t.sCount[n]-t.blkIndent>=4||t.src.charCodeAt(T)!==91)return!1;for(;++T<$;)if(t.src.charCodeAt(T)===93&&t.src.charCodeAt(T-1)!==92){if(T+1===$||t.src.charCodeAt(T+1)!==58)return!1;break}for(c=t.lineMax,j=t.md.block.ruler.getRules("reference"),h=t.parentType,t.parentType="reference";Y<c&&!t.isEmpty(Y);Y++)if(!(t.sCount[Y]-t.blkIndent>3)&&!(t.sCount[Y]<0)){for(N=!1,u=0,f=j.length;u<f;u++)if(j[u](t,Y,c,!0)){N=!0;break}if(N)break}for(v=t.getLines(n,Y,t.blkIndent,!1).trim(),$=v.length,T=1;T<$;T++){if(i=v.charCodeAt(T),i===91)return!1;if(i===93){d=T;break}else i===10?D++:i===92&&(T++,T<$&&v.charCodeAt(T)===10&&D++)}if(d<0||v.charCodeAt(d+1)!==58)return!1;for(T=d+2;T<$;T++)if(i=v.charCodeAt(T),i===10)D++;else if(!yl(i))break;if(g=t.md.helpers.parseLinkDestination(v,T,$),!g.ok||(l=t.md.normalizeLink(g.str),!t.md.validateLink(l)))return!1;for(T=g.pos,D+=g.lines,s=T,a=D,w=T;T<$;T++)if(i=v.charCodeAt(T),i===10)D++;else if(!yl(i))break;for(g=t.md.helpers.parseLinkTitle(v,T,$),T<$&&w!==T&&g.ok?(A=g.str,T=g.pos,D+=g.lines):(A="",T=s,D=a);T<$&&(i=v.charCodeAt(T),!!yl(i));)T++;if(T<$&&v.charCodeAt(T)!==10&&A)for(A="",T=s,D=a;T<$&&(i=v.charCodeAt(T),!!yl(i));)T++;return T<$&&v.charCodeAt(T)!==10||(p=_5(v.slice(1,d)),!p)?!1:(o||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[p]>"u"&&(t.env.references[p]={title:A,href:l}),t.parentType=h,t.line=n+D+1),!0)},P5=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],bl={},A5="[a-zA-Z_:][a-zA-Z0-9:._-]*",z5="[^\"'=<>`\\x00-\\x20]+",J5="'[^']*'",R5='"[^"]*"',Q5="(?:"+z5+"|"+J5+"|"+R5+")",F5="(?:\\s+"+A5+"(?:\\s*=\\s*"+Q5+")?)",Nb="<[A-Za-z][A-Za-z0-9\\-]*"+F5+"*\\s*\\/?>",Sb="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",G5="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",W5="<[?][\\s\\S]*?[?]>",B5="<![A-Z]+\\s+[^>]*>",Z5="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",H5=new RegExp("^(?:"+Nb+"|"+Sb+"|"+G5+"|"+W5+"|"+B5+"|"+Z5+")"),V5=new RegExp("^(?:"+Nb+"|"+Sb+")");bl.HTML_TAG_RE=H5,bl.HTML_OPEN_CLOSE_TAG_RE=V5;var U5=P5,Y5=bl.HTML_OPEN_CLOSE_TAG_RE,Mi=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+U5.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Y5.source+"\\s*$"),/^$/,!1]],$5=function(t,n,r,o){var i,s,a,c,l=t.bMarks[n]+t.tShift[n],u=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(l)!==60)return!1;for(c=t.src.slice(l,u),i=0;i<Mi.length&&!Mi[i][0].test(c);i++);if(i===Mi.length)return!1;if(o)return Mi[i][2];if(s=n+1,!Mi[i][1].test(c)){for(;s<r&&!(t.sCount[s]<t.blkIndent);s++)if(l=t.bMarks[s]+t.tShift[s],u=t.eMarks[s],c=t.src.slice(l,u),Mi[i][1].test(c)){c.length!==0&&s++;break}}return t.line=s,a=t.push("html_block","",0),a.map=[n,s],a.content=t.getLines(n,s,t.blkIndent,!0),!0},Db=Je.isSpace,q5=function(t,n,r,o){var i,s,a,c,l=t.bMarks[n]+t.tShift[n],u=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||(i=t.src.charCodeAt(l),i!==35||l>=u))return!1;for(s=1,i=t.src.charCodeAt(++l);i===35&&l<u&&s<=6;)s++,i=t.src.charCodeAt(++l);return s>6||l<u&&!Db(i)?!1:(o||(u=t.skipSpacesBack(u,l),a=t.skipCharsBack(u,35,l),a>l&&Db(t.src.charCodeAt(a-1))&&(u=a),t.line=n+1,c=t.push("heading_open","h"+String(s),1),c.markup="########".slice(0,s),c.map=[n,t.line],c=t.push("inline","",0),c.content=t.src.slice(l,u).trim(),c.map=[n,t.line],c.children=[],c=t.push("heading_close","h"+String(s),-1),c.markup="########".slice(0,s)),!0)},K5=function(t,n,r){var o,i,s,a,c,l,u,f,p,d=n+1,h,g=t.md.block.ruler.getRules("paragraph");if(t.sCount[n]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";d<r&&!t.isEmpty(d);d++)if(!(t.sCount[d]-t.blkIndent>3)){if(t.sCount[d]>=t.blkIndent&&(l=t.bMarks[d]+t.tShift[d],u=t.eMarks[d],l<u&&(p=t.src.charCodeAt(l),(p===45||p===61)&&(l=t.skipChars(l,p),l=t.skipSpaces(l),l>=u)))){f=p===61?1:2;break}if(!(t.sCount[d]<0)){for(i=!1,s=0,a=g.length;s<a;s++)if(g[s](t,d,r,!0)){i=!0;break}if(i)break}}return f?(o=t.getLines(n,d,t.blkIndent,!1).trim(),t.line=d+1,c=t.push("heading_open","h"+String(f),1),c.markup=String.fromCharCode(p),c.map=[n,t.line],c=t.push("inline","",0),c.content=o,c.map=[n,t.line-1],c.children=[],c=t.push("heading_close","h"+String(f),-1),c.markup=String.fromCharCode(p),t.parentType=h,!0):!1},X5=function(t,n,r){var o,i,s,a,c,l,u=n+1,f=t.md.block.ruler.getRules("paragraph");for(l=t.parentType,t.parentType="paragraph";u<r&&!t.isEmpty(u);u++)if(!(t.sCount[u]-t.blkIndent>3)&&!(t.sCount[u]<0)){for(i=!1,s=0,a=f.length;s<a;s++)if(f[s](t,u,r,!0)){i=!0;break}if(i)break}return o=t.getLines(n,u,t.blkIndent,!1).trim(),t.line=u,c=t.push("paragraph_open","p",1),c.map=[n,t.line],c=t.push("inline","",0),c.content=o,c.map=[n,t.line],c.children=[],c=t.push("paragraph_close","p",-1),t.parentType=l,!0},Ob=ud,wl=Je.isSpace;function Vn(e,t,n,r){var o,i,s,a,c,l,u,f;for(this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",i=this.src,f=!1,s=a=l=u=0,c=i.length;a<c;a++){if(o=i.charCodeAt(a),!f)if(wl(o)){l++,o===9?u+=4-u%4:u++;continue}else f=!0;(o===10||a===c-1)&&(o!==10&&a++,this.bMarks.push(s),this.eMarks.push(a),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),f=!1,l=0,u=0,s=a+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Vn.prototype.push=function(e,t,n){var r=new Ob(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Vn.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},Vn.prototype.skipEmptyLines=function(t){for(var n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},Vn.prototype.skipSpaces=function(t){for(var n,r=this.src.length;t<r&&(n=this.src.charCodeAt(t),!!wl(n));t++);return t},Vn.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!wl(this.src.charCodeAt(--t)))return t+1;return t},Vn.prototype.skipChars=function(t,n){for(var r=this.src.length;t<r&&this.src.charCodeAt(t)===n;t++);return t},Vn.prototype.skipCharsBack=function(t,n,r){if(t<=r)return t;for(;t>r;)if(n!==this.src.charCodeAt(--t))return t+1;return t},Vn.prototype.getLines=function(t,n,r,o){var i,s,a,c,l,u,f,p=t;if(t>=n)return"";for(u=new Array(n-t),i=0;p<n;p++,i++){for(s=0,f=c=this.bMarks[p],p+1<n||o?l=this.eMarks[p]+1:l=this.eMarks[p];c<l&&s<r;){if(a=this.src.charCodeAt(c),wl(a))a===9?s+=4-(s+this.bsCount[p])%4:s++;else if(c-f<this.tShift[p])s++;else break;c++}s>r?u[i]=new Array(s-r+1).join(" ")+this.src.slice(c,l):u[i]=this.src.slice(c,l)}return u.join("")},Vn.prototype.Token=Ob;var ez=Vn,tz=ld,Cl=[["table",L5,["paragraph","reference"]],["code",x5],["fence",T5,["paragraph","reference","blockquote","list"]],["blockquote",k5,["paragraph","reference","blockquote","list"]],["hr",S5,["paragraph","reference","blockquote","list"]],["list",O5,["paragraph","reference","blockquote"]],["reference",E5],["html_block",$5,["paragraph","reference","blockquote"]],["heading",q5,["paragraph","reference","blockquote"]],["lheading",K5],["paragraph",X5]];function Il(){this.ruler=new tz;for(var e=0;e<Cl.length;e++)this.ruler.push(Cl[e][0],Cl[e][1],{alt:(Cl[e][2]||[]).slice()})}Il.prototype.tokenize=function(e,t,n){for(var r,o,i,s=this.ruler.getRules(""),a=s.length,c=t,l=!1,u=e.md.options.maxNesting;c<n&&(e.line=c=e.skipEmptyLines(c),!(c>=n||e.sCount[c]<e.blkIndent));){if(e.level>=u){e.line=n;break}for(i=e.line,o=0;o<a;o++)if(r=s[o](e,c,n,!1),r){if(i>=e.line)throw new Error("block rule didn't increment state.line");break}if(!r)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),c=e.line,c<n&&e.isEmpty(c)&&(l=!0,c++,e.line=c)}},Il.prototype.parse=function(e,t,n,r){var o;e&&(o=new this.State(e,t,n,r),this.tokenize(o,o.line,o.lineMax))},Il.prototype.State=ez;var nz=Il;function rz(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}for(var oz=function(t,n){for(var r=t.pos;r<t.posMax&&!rz(t.src.charCodeAt(r));)r++;return r===t.pos?!1:(n||(t.pending+=t.src.slice(t.pos,r)),t.pos=r,!0)},iz=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i,sz=function(t,n){var r,o,i,s,a,c,l,u;return!t.md.options.linkify||t.linkLevel>0||(r=t.pos,o=t.posMax,r+3>o)||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47||(i=t.pending.match(iz),!i)||(s=i[1],a=t.md.linkify.matchAtStart(t.src.slice(r-s.length)),!a)||(c=a.url,c.length<=s.length)||(c=c.replace(/\*+$/,""),l=t.md.normalizeLink(c),!t.md.validateLink(l))?!1:(n||(t.pending=t.pending.slice(0,-s.length),u=t.push("link_open","a",1),u.attrs=[["href",l]],u.markup="linkify",u.info="auto",u=t.push("text","",0),u.content=t.md.normalizeLinkText(c),u=t.push("link_close","a",-1),u.markup="linkify",u.info="auto"),t.pos+=c.length-s.length,!0)},az=Je.isSpace,cz=function(t,n){var r,o,i,s=t.pos;if(t.src.charCodeAt(s)!==10)return!1;if(r=t.pending.length-1,o=t.posMax,!n)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){for(i=r-1;i>=1&&t.pending.charCodeAt(i-1)===32;)i--;t.pending=t.pending.slice(0,i),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(s++;s<o&&az(t.src.charCodeAt(s));)s++;return t.pos=s,!0},lz=Je.isSpace,hd=[],_b=0;_b<256;_b++)hd.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){hd[e.charCodeAt(0)]=1});var uz=function(t,n){var r,o,i,s,a,c=t.pos,l=t.posMax;if(t.src.charCodeAt(c)!==92||(c++,c>=l))return!1;if(r=t.src.charCodeAt(c),r===10){for(n||t.push("hardbreak","br",0),c++;c<l&&(r=t.src.charCodeAt(c),!!lz(r));)c++;return t.pos=c,!0}return s=t.src[c],r>=55296&&r<=56319&&c+1<l&&(o=t.src.charCodeAt(c+1),o>=56320&&o<=57343&&(s+=t.src[c+1],c++)),i="\\"+s,n||(a=t.push("text_special","",0),r<256&&hd[r]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"),t.pos=c+1,!0},fz=function(t,n){var r,o,i,s,a,c,l,u,f=t.pos,p=t.src.charCodeAt(f);if(p!==96)return!1;for(r=f,f++,o=t.posMax;f<o&&t.src.charCodeAt(f)===96;)f++;if(i=t.src.slice(r,f),l=i.length,t.backticksScanned&&(t.backticks[l]||0)<=r)return n||(t.pending+=i),t.pos+=l,!0;for(c=f;(a=t.src.indexOf("`",c))!==-1;){for(c=a+1;c<o&&t.src.charCodeAt(c)===96;)c++;if(u=c-a,u===l)return n||(s=t.push("code_inline","code",0),s.markup=i,s.content=t.src.slice(f,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),t.pos=c,!0;t.backticks[u]=a}return t.backticksScanned=!0,n||(t.pending+=i),t.pos+=l,!0},Ml={};Ml.tokenize=function(t,n){var r,o,i,s,a,c=t.pos,l=t.src.charCodeAt(c);if(n||l!==126||(o=t.scanDelims(t.pos,!0),s=o.length,a=String.fromCharCode(l),s<2))return!1;for(s%2&&(i=t.push("text","",0),i.content=a,s--),r=0;r<s;r+=2)i=t.push("text","",0),i.content=a+a,t.delimiters.push({marker:l,length:0,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0};function Eb(e,t){var n,r,o,i,s,a=[],c=t.length;for(n=0;n<c;n++)o=t[n],o.marker===126&&o.end!==-1&&(i=t[o.end],s=e.tokens[o.token],s.type="s_open",s.tag="s",s.nesting=1,s.markup="~~",s.content="",s=e.tokens[i.token],s.type="s_close",s.tag="s",s.nesting=-1,s.markup="~~",s.content="",e.tokens[i.token-1].type==="text"&&e.tokens[i.token-1].content==="~"&&a.push(i.token-1));for(;a.length;){for(n=a.pop(),r=n+1;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,n!==r&&(s=e.tokens[r],e.tokens[r]=e.tokens[n],e.tokens[n]=s)}}Ml.postProcess=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(Eb(t,t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&Eb(t,r[n].delimiters)};var Ll={};Ll.tokenize=function(t,n){var r,o,i,s=t.pos,a=t.src.charCodeAt(s);if(n||a!==95&&a!==42)return!1;for(o=t.scanDelims(t.pos,a===42),r=0;r<o.length;r++)i=t.push("text","",0),i.content=String.fromCharCode(a),t.delimiters.push({marker:a,length:o.length,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0};function Pb(e,t){var n,r,o,i,s,a,c=t.length;for(n=c-1;n>=0;n--)r=t[n],!(r.marker!==95&&r.marker!==42)&&r.end!==-1&&(o=t[r.end],a=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===o.token+1,s=String.fromCharCode(r.marker),i=e.tokens[r.token],i.type=a?"strong_open":"em_open",i.tag=a?"strong":"em",i.nesting=1,i.markup=a?s+s:s,i.content="",i=e.tokens[o.token],i.type=a?"strong_close":"em_close",i.tag=a?"strong":"em",i.nesting=-1,i.markup=a?s+s:s,i.content="",a&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}Ll.postProcess=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(Pb(t,t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&Pb(t,r[n].delimiters)};var dz=Je.normalizeReference,md=Je.isSpace,pz=function(t,n){var r,o,i,s,a,c,l,u,f,p="",d="",h=t.pos,g=t.posMax,w=t.pos,v=!0;if(t.src.charCodeAt(t.pos)!==91||(a=t.pos+1,s=t.md.helpers.parseLinkLabel(t,t.pos,!0),s<0))return!1;if(c=s+1,c<g&&t.src.charCodeAt(c)===40){for(v=!1,c++;c<g&&(o=t.src.charCodeAt(c),!(!md(o)&&o!==10));c++);if(c>=g)return!1;if(w=c,l=t.md.helpers.parseLinkDestination(t.src,c,t.posMax),l.ok){for(p=t.md.normalizeLink(l.str),t.md.validateLink(p)?c=l.pos:p="",w=c;c<g&&(o=t.src.charCodeAt(c),!(!md(o)&&o!==10));c++);if(l=t.md.helpers.parseLinkTitle(t.src,c,t.posMax),c<g&&w!==c&&l.ok)for(d=l.str,c=l.pos;c<g&&(o=t.src.charCodeAt(c),!(!md(o)&&o!==10));c++);}(c>=g||t.src.charCodeAt(c)!==41)&&(v=!0),c++}if(v){if(typeof t.env.references>"u")return!1;if(c<g&&t.src.charCodeAt(c)===91?(w=c+1,c=t.md.helpers.parseLinkLabel(t,c),c>=0?i=t.src.slice(w,c++):c=s+1):c=s+1,i||(i=t.src.slice(a,s)),u=t.env.references[dz(i)],!u)return t.pos=h,!1;p=u.href,d=u.title}return n||(t.pos=a,t.posMax=s,f=t.push("link_open","a",1),f.attrs=r=[["href",p]],d&&r.push(["title",d]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,f=t.push("link_close","a",-1)),t.pos=c,t.posMax=g,!0},gz=Je.normalizeReference,vd=Je.isSpace,hz=function(t,n){var r,o,i,s,a,c,l,u,f,p,d,h,g,w="",v=t.pos,N=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91||(c=t.pos+2,a=t.md.helpers.parseLinkLabel(t,t.pos+1,!1),a<0))return!1;if(l=a+1,l<N&&t.src.charCodeAt(l)===40){for(l++;l<N&&(o=t.src.charCodeAt(l),!(!vd(o)&&o!==10));l++);if(l>=N)return!1;for(g=l,f=t.md.helpers.parseLinkDestination(t.src,l,t.posMax),f.ok&&(w=t.md.normalizeLink(f.str),t.md.validateLink(w)?l=f.pos:w=""),g=l;l<N&&(o=t.src.charCodeAt(l),!(!vd(o)&&o!==10));l++);if(f=t.md.helpers.parseLinkTitle(t.src,l,t.posMax),l<N&&g!==l&&f.ok)for(p=f.str,l=f.pos;l<N&&(o=t.src.charCodeAt(l),!(!vd(o)&&o!==10));l++);else p="";if(l>=N||t.src.charCodeAt(l)!==41)return t.pos=v,!1;l++}else{if(typeof t.env.references>"u")return!1;if(l<N&&t.src.charCodeAt(l)===91?(g=l+1,l=t.md.helpers.parseLinkLabel(t,l),l>=0?s=t.src.slice(g,l++):l=a+1):l=a+1,s||(s=t.src.slice(c,a)),u=t.env.references[gz(s)],!u)return t.pos=v,!1;w=u.href,p=u.title}return n||(i=t.src.slice(c,a),t.md.inline.parse(i,t.md,t.env,h=[]),d=t.push("image","img",0),d.attrs=r=[["src",w],["alt",""]],d.children=h,d.content=i,p&&r.push(["title",p])),t.pos=l,t.posMax=N,!0},mz=/^([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])?)*)$/,vz=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,yz=function(t,n){var r,o,i,s,a,c,l=t.pos;if(t.src.charCodeAt(l)!==60)return!1;for(a=t.pos,c=t.posMax;;){if(++l>=c||(s=t.src.charCodeAt(l),s===60))return!1;if(s===62)break}return r=t.src.slice(a+1,l),vz.test(r)?(o=t.md.normalizeLink(r),t.md.validateLink(o)?(n||(i=t.push("link_open","a",1),i.attrs=[["href",o]],i.markup="autolink",i.info="auto",i=t.push("text","",0),i.content=t.md.normalizeLinkText(r),i=t.push("link_close","a",-1),i.markup="autolink",i.info="auto"),t.pos+=r.length+2,!0):!1):mz.test(r)?(o=t.md.normalizeLink("mailto:"+r),t.md.validateLink(o)?(n||(i=t.push("link_open","a",1),i.attrs=[["href",o]],i.markup="autolink",i.info="auto",i=t.push("text","",0),i.content=t.md.normalizeLinkText(r),i=t.push("link_close","a",-1),i.markup="autolink",i.info="auto"),t.pos+=r.length+2,!0):!1):!1},bz=bl.HTML_TAG_RE;function wz(e){return/^<a[>\s]/i.test(e)}function Cz(e){return/^<\/a\s*>/i.test(e)}function Iz(e){var t=e|32;return t>=97&&t<=122}var Mz=function(t,n){var r,o,i,s,a=t.pos;return!t.md.options.html||(i=t.posMax,t.src.charCodeAt(a)!==60||a+2>=i)||(r=t.src.charCodeAt(a+1),r!==33&&r!==63&&r!==47&&!Iz(r))||(o=t.src.slice(a).match(bz),!o)?!1:(n||(s=t.push("html_inline","",0),s.content=o[0],wz(s.content)&&t.linkLevel++,Cz(s.content)&&t.linkLevel--),t.pos+=o[0].length,!0)},Ab=tb,Lz=Je.has,xz=Je.isValidEntityCode,zb=Je.fromCodePoint,Tz=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,jz=/^&([a-z][a-z0-9]{1,31});/i,kz=function(t,n){var r,o,i,s,a=t.pos,c=t.posMax;if(t.src.charCodeAt(a)!==38||a+1>=c)return!1;if(r=t.src.charCodeAt(a+1),r===35){if(i=t.src.slice(a).match(Tz),i)return n||(o=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),s=t.push("text_special","",0),s.content=xz(o)?zb(o):zb(65533),s.markup=i[0],s.info="entity"),t.pos+=i[0].length,!0}else if(i=t.src.slice(a).match(jz),i&&Lz(Ab,i[1]))return n||(s=t.push("text_special","",0),s.content=Ab[i[1]],s.markup=i[0],s.info="entity"),t.pos+=i[0].length,!0;return!1};function Jb(e){var t,n,r,o,i,s,a,c,l={},u=e.length;if(u){var f=0,p=-2,d=[];for(t=0;t<u;t++)if(r=e[t],d.push(0),(e[f].marker!==r.marker||p!==r.token-1)&&(f=t),p=r.token,r.length=r.length||0,!!r.close){for(l.hasOwnProperty(r.marker)||(l[r.marker]=[-1,-1,-1,-1,-1,-1]),i=l[r.marker][(r.open?3:0)+r.length%3],n=f-d[f]-1,s=n;n>i;n-=d[n]+1)if(o=e[n],o.marker===r.marker&&o.open&&o.end<0&&(a=!1,(o.close||r.open)&&(o.length+r.length)%3===0&&(o.length%3!==0||r.length%3!==0)&&(a=!0),!a)){c=n>0&&!e[n-1].open?d[n-1]+1:0,d[t]=t-n+c,d[n]=c,r.open=!1,o.end=t,o.close=!1,s=-1,p=-2;break}s!==-1&&(l[r.marker][(r.open?3:0)+(r.length||0)%3]=s)}}}var Nz=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(Jb(t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&Jb(r[n].delimiters)},Sz=function(t){var n,r,o=0,i=t.tokens,s=t.tokens.length;for(n=r=0;n<s;n++)i[n].nesting<0&&o--,i[n].level=o,i[n].nesting>0&&o++,i[n].type==="text"&&n+1<s&&i[n+1].type==="text"?i[n+1].content=i[n].content+i[n+1].content:(n!==r&&(i[r]=i[n]),r++);n!==r&&(i.length=r)},yd=ud,Rb=Je.isWhiteSpace,Qb=Je.isPunctChar,Fb=Je.isMdAsciiPunct;function aa(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}aa.prototype.pushPending=function(){var e=new yd("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},aa.prototype.push=function(e,t,n){this.pending&&this.pushPending();var r=new yd(e,t,n),o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r},aa.prototype.scanDelims=function(e,t){var n=e,r,o,i,s,a,c,l,u,f,p=!0,d=!0,h=this.posMax,g=this.src.charCodeAt(e);for(r=e>0?this.src.charCodeAt(e-1):32;n<h&&this.src.charCodeAt(n)===g;)n++;return i=n-e,o=n<h?this.src.charCodeAt(n):32,l=Fb(r)||Qb(String.fromCharCode(r)),f=Fb(o)||Qb(String.fromCharCode(o)),c=Rb(r),u=Rb(o),u?p=!1:f&&(c||l||(p=!1)),c?d=!1:l&&(u||f||(d=!1)),t?(s=p,a=d):(s=p&&(!d||l),a=d&&(!p||f)),{can_open:s,can_close:a,length:i}},aa.prototype.Token=yd;var Dz=aa,Gb=ld,bd=[["text",oz],["linkify",sz],["newline",cz],["escape",uz],["backticks",fz],["strikethrough",Ml.tokenize],["emphasis",Ll.tokenize],["link",pz],["image",hz],["autolink",yz],["html_inline",Mz],["entity",kz]],wd=[["balance_pairs",Nz],["strikethrough",Ml.postProcess],["emphasis",Ll.postProcess],["fragments_join",Sz]];function ca(){var e;for(this.ruler=new Gb,e=0;e<bd.length;e++)this.ruler.push(bd[e][0],bd[e][1]);for(this.ruler2=new Gb,e=0;e<wd.length;e++)this.ruler2.push(wd[e][0],wd[e][1])}ca.prototype.skipToken=function(e){var t,n,r=e.pos,o=this.ruler.getRules(""),i=o.length,s=e.md.options.maxNesting,a=e.cache;if(typeof a[r]<"u"){e.pos=a[r];return}if(e.level<s){for(n=0;n<i;n++)if(e.level++,t=o[n](e,!0),e.level--,t){if(r>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;t||e.pos++,a[r]=e.pos},ca.prototype.tokenize=function(e){for(var t,n,r,o=this.ruler.getRules(""),i=o.length,s=e.posMax,a=e.md.options.maxNesting;e.pos<s;){if(r=e.pos,e.level<a){for(n=0;n<i;n++)if(t=o[n](e,!1),t){if(r>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(t){if(e.pos>=s)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},ca.prototype.parse=function(e,t,n,r){var o,i,s,a=new this.State(e,t,n,r);for(this.tokenize(a),i=this.ruler2.getRules(""),s=i.length,o=0;o<s;o++)i[o](a)},ca.prototype.State=Dz;var Oz=ca,Cd,Wb;function _z(){return Wb||(Wb=1,Cd=function(e){var t={};e=e||{},t.src_Any=ub().source,t.src_Cc=db().source,t.src_Z=hb().source,t.src_P=od.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");var n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}),Cd}function Id(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function xl(e){return Object.prototype.toString.call(e)}function Ez(e){return xl(e)==="[object String]"}function Pz(e){return xl(e)==="[object Object]"}function Az(e){return xl(e)==="[object RegExp]"}function Bb(e){return xl(e)==="[object Function]"}function zz(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var Zb={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Jz(e){return Object.keys(e||{}).reduce(function(t,n){return t||Zb.hasOwnProperty(n)},!1)}var Rz={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Qz="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Fz="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Gz(e){e.__index__=-1,e.__text_cache__=""}function Wz(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Hb(){return function(e,t){t.normalize(e)}}function Tl(e){var t=e.re=_z()(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Qz),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");var o=[];e.__compiled__={};function i(a,c){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+c)}Object.keys(e.__schemas__).forEach(function(a){var c=e.__schemas__[a];if(c!==null){var l={validate:null,link:null};if(e.__compiled__[a]=l,Pz(c)){Az(c.validate)?l.validate=Wz(c.validate):Bb(c.validate)?l.validate=c.validate:i(a,c),Bb(c.normalize)?l.normalize=c.normalize:c.normalize?i(a,c):l.normalize=Hb();return}if(Ez(c)){o.push(a);return}i(a,c)}}),o.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:Hb()};var s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(zz).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Gz(e)}function Bz(e,t){var n=e.__index__,r=e.__last_index__,o=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=o,this.text=o,this.url=o}function Md(e,t){var n=new Bz(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Ut(e,t){if(!(this instanceof Ut))return new Ut(e,t);t||Jz(e)&&(t=e,e={}),this.__opts__=Id({},Zb,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Id({},Rz,e),this.__compiled__={},this.__tlds__=Fz,this.__tlds_replaced__=!1,this.re={},Tl(this)}Ut.prototype.add=function(t,n){return this.__schemas__[t]=n,Tl(this),this},Ut.prototype.set=function(t){return this.__opts__=Id(this.__opts__,t),this},Ut.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var n,r,o,i,s,a,c,l,u;if(this.re.schema_test.test(t)){for(c=this.re.schema_search,c.lastIndex=0;(n=c.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],c.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(s=o.index+o[1].length,a=o.index+o[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0},Ut.prototype.pretest=function(t){return this.re.pretest.test(t)},Ut.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0},Ut.prototype.match=function(t){var n=0,r=[];this.__index__>=0&&this.__text_cache__===t&&(r.push(Md(this,n)),n=this.__last_index__);for(var o=n?t.slice(n):t;this.test(o);)r.push(Md(this,n)),o=o.slice(this.__last_index__),n+=this.__last_index__;return r.length?r:null},Ut.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;var n=this.re.schema_at_start.exec(t);if(!n)return null;var r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Md(this,0)):null},Ut.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,o,i){return r!==i[o-1]}).reverse(),Tl(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Tl(this),this)},Ut.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},Ut.prototype.onCompile=function(){};var Zz=Ut;const Li=2147483647,Un=36,Ld=1,la=26,Hz=38,Vz=700,Vb=72,Ub=128,Yb="-",Uz=/^xn--/,Yz=/[^\0-\x7F]/,$z=/[\x2E\u3002\uFF0E\uFF61]/g,qz={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},xd=Un-Ld,Yn=Math.floor,Td=String.fromCharCode;function Wr(e){throw new RangeError(qz[e])}function Kz(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function $b(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace($z,".");const o=e.split("."),i=Kz(o,t).join(".");return r+i}function jd(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const i=e.charCodeAt(n++);(i&64512)==56320?t.push(((o&1023)<<10)+(i&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const qb=e=>String.fromCodePoint(...e),Xz=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Un},Kb=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Xb=function(e,t,n){let r=0;for(e=n?Yn(e/Vz):e>>1,e+=Yn(e/t);e>xd*la>>1;r+=Un)e=Yn(e/xd);return Yn(r+(xd+1)*e/(e+Hz))},kd=function(e){const t=[],n=e.length;let r=0,o=Ub,i=Vb,s=e.lastIndexOf(Yb);s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&Wr("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){const c=r;for(let u=1,f=Un;;f+=Un){a>=n&&Wr("invalid-input");const p=Xz(e.charCodeAt(a++));p>=Un&&Wr("invalid-input"),p>Yn((Li-r)/u)&&Wr("overflow"),r+=p*u;const d=f<=i?Ld:f>=i+la?la:f-i;if(p<d)break;const h=Un-d;u>Yn(Li/h)&&Wr("overflow"),u*=h}const l=t.length+1;i=Xb(r-c,l,c==0),Yn(r/l)>Li-o&&Wr("overflow"),o+=Yn(r/l),r%=l,t.splice(r++,0,o)}return String.fromCodePoint(...t)},Nd=function(e){const t=[];e=jd(e);const n=e.length;let r=Ub,o=0,i=Vb;for(const c of e)c<128&&t.push(Td(c));const s=t.length;let a=s;for(s&&t.push(Yb);a<n;){let c=Li;for(const u of e)u>=r&&u<c&&(c=u);const l=a+1;c-r>Yn((Li-o)/l)&&Wr("overflow"),o+=(c-r)*l,r=c;for(const u of e)if(u<r&&++o>Li&&Wr("overflow"),u===r){let f=o;for(let p=Un;;p+=Un){const d=p<=i?Ld:p>=i+la?la:p-i;if(f<d)break;const h=f-d,g=Un-d;t.push(Td(Kb(d+h%g,0))),f=Yn(h/g)}t.push(Td(Kb(f,0))),i=Xb(o,l,a===s),o=0,++a}++o,++r}return t.join("")},ew=function(e){return $b(e,function(t){return Uz.test(t)?kd(t.slice(4).toLowerCase()):t})},tw=function(e){return $b(e,function(t){return Yz.test(t)?"xn--"+Nd(t):t})},e9=ZM(Object.freeze(Object.defineProperty({__proto__:null,decode:kd,default:{version:"2.3.1",ucs2:{decode:jd,encode:qb},decode:kd,encode:Nd,toASCII:tw,toUnicode:ew},encode:Nd,toASCII:tw,toUnicode:ew,ucs2decode:jd,ucs2encode:qb},Symbol.toStringTag,{value:"Module"})));var t9={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},n9={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},r9={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},ua=Je,o9=ml,i9=X3,s9=M5,a9=nz,c9=Oz,l9=Zz,Io=wi,nw=e9,u9={default:t9,zero:n9,commonmark:r9},f9=/^(vbscript|javascript|file|data):/,d9=/^data:image\/(gif|png|jpeg|webp);/;function p9(e){var t=e.trim().toLowerCase();return f9.test(t)?!!d9.test(t):!0}var rw=["http:","https:","mailto:"];function g9(e){var t=Io.parse(e,!0);if(t.hostname&&(!t.protocol||rw.indexOf(t.protocol)>=0))try{t.hostname=nw.toASCII(t.hostname)}catch{}return Io.encode(Io.format(t))}function h9(e){var t=Io.parse(e,!0);if(t.hostname&&(!t.protocol||rw.indexOf(t.protocol)>=0))try{t.hostname=nw.toUnicode(t.hostname)}catch{}return Io.decode(Io.format(t),Io.decode.defaultChars+"%")}function un(e,t){if(!(this instanceof un))return new un(e,t);t||ua.isString(e)||(t=e||{},e="default"),this.inline=new c9,this.block=new a9,this.core=new s9,this.renderer=new i9,this.linkify=new l9,this.validateLink=p9,this.normalizeLink=g9,this.normalizeLinkText=h9,this.utils=ua,this.helpers=ua.assign({},o9),this.options={},this.configure(e),t&&this.set(t)}un.prototype.set=function(e){return ua.assign(this.options,e),this},un.prototype.configure=function(e){var t=this,n;if(ua.isString(e)&&(n=e,e=u9[n],!e))throw new Error('Wrong `markdown-it` preset "'+n+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enableOnly(e.components[r].rules),e.components[r].rules2&&t[r].ruler2.enableOnly(e.components[r].rules2)}),this},un.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter(function(o){return n.indexOf(o)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},un.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter(function(o){return n.indexOf(o)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},un.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},un.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},un.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},un.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},un.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var m9=un,v9=m9;const y9=Ro(v9);var Sd=(e=>(e.Assistant="assistant",e.System="system",e.User="user",e))(Sd||{}),fa=(e=>(e.Error="error",e.Loading="loading",e.Success="success",e))(fa||{});const b9={class:"message-content user"},w9={key:0,class:"time-message user"},C9=["innerHTML"],I9={class:"message-photo user"},M9=["src"],L9=Se("span",{class:"message-photo ai"},[Se("i",{class:"ai-blueking-icon ai-blueking-ai"})],-1),x9={class:"message-content ai"},T9={key:0,class:"time-message ai"},j9={key:2,width:"18",height:"18",class:"loading-message","aria-hidden":"true"},k9=[Se("use",{"xlink:href":"#ai-blueking-quanquan"},null,-1)],N9={key:3,class:"message-wrap"},S9=["innerHTML"],D9=mt({__name:"render-message",props:{message:{},userPhoto:{default:Ng}},setup(e){const t=e,n=jt(()=>{var s;const i={error:"ai-blueking-icon ai-blueking-warning-circle-fill",loading:"",success:""};return(s=t.message)!=null&&s.status?i[t.message.status]:""}),r=jt(()=>{if(t.message.content){const s=new y9().render(t.message.content);return N3.sanitize(s)}return""}),o=jt(()=>{const i=cl(t.message.time),s=cl();return t.message.time?s.isSame(i,"year")?i.format("MM-DD HH:mm:ss"):i.format("YYYY-MM-DD HH:mm:ss"):""});return(i,s)=>(Fe(),et("li",{class:Yr([i.message.role,"message-main"])},[i.message.role===Qe(Sd).User?(Fe(),et(rt,{key:0},[Se("p",b9,[o.value?(Fe(),et("span",w9,qn(o.value),1)):Tn("v-if",!0),Se("span",{class:"markdown-message",innerHTML:r.value},null,8,C9)]),Se("span",I9,[Se("img",{src:i.userPhoto},null,8,M9)])],64)):(Fe(),et(rt,{key:1},[L9,Se("p",x9,[o.value?(Fe(),et("span",T9,qn(o.value),1)):Tn("v-if",!0),n.value?(Fe(),et("i",{key:1,class:Yr(n.value)},null,2)):Tn("v-if",!0),i.message.status===Qe(fa).Loading?(Fe(),et("svg",j9,k9)):Tn("v-if",!0),i.message.status===Qe(fa).Error?(Fe(),et("span",N9,qn(i.message.content),1)):(Fe(),et("span",{key:4,innerHTML:r.value,class:Yr({"markdown-message":!0,loading:i.message.status===Qe(fa).Loading})},null,10,S9))])],64))],2))}}),O9={class:"prompt-list"},_9={class:"search-group"},E9=["onClick"],P9={class:"prompt-content"},A9=bi(mt({__name:"render-send",props:{prompts:{},placeholder:{},value:{}},emits:["update:value","enter","choose-prompt"],setup(e,{emit:t}){const n=e,r=t,o=YA,i=al,s=Qt(""),a=Qt(40),c=Qt(),l=Qt(!1),u=jt(()=>{var D;return((D=n.prompts)==null?void 0:D.filter(T=>T.content.includes(s.value)))||[]}),f=jt(()=>{var D;return n.placeholder?n.placeholder:(D=n.prompts)!=null&&D.length?nt("您可以键入 “/” 查看更多Prompt"):nt("请输入")}),p=D=>{r("update:value",D)},d=()=>{var D;n.value==="/"&&((D=n.prompts)!=null&&D.length)?j():A()},h=()=>{Do(()=>{var T;const D=(T=c.value)==null?void 0:T.$el.querySelector("textarea");(D==null?void 0:D.scrollHeight)>40&&n.value?a.value=D.scrollHeight<=300?D.scrollHeight:300:a.value=40})},g=D=>{r("update:value",D.content),r("choose-prompt",D),A(),N()},w=(D,T)=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),r("enter"))},v=()=>{p("")},N=()=>{var T;const D=(T=c.value)==null?void 0:T.$el.querySelector("textarea");D==null||D.focus()},j=()=>{l.value=!0},A=()=>{l.value=!1};return Ln(()=>n.value,()=>{h(),d()}),xn(N),(D,T)=>(Fe(),no(Qe(N0),{width:"calc(100% - 118px)","ext-cls":"empty-padding",arrow:!1,"is-show":l.value,"popover-delay":0,boundary:"parent",placement:"bottom",theme:"light",trigger:"manual"},{content:Ai(()=>{var $;return[Se("div",null,[pn((Fe(),et("section",O9,[Te(Qe(z0),{class:"input-search",modelValue:s.value,"onUpdate:modelValue":T[0]||(T[0]=Y=>s.value=Y),behavior:"simplicity",clearable:""},null,8,["modelValue"]),Se("section",_9,[(Fe(!0),et(rt,null,Sp(u.value,(Y,re)=>pn((Fe(),et("span",{class:"group-prompt",key:re,onClick:z=>g(Y)},[Se("span",P9,qn(Y.content),1)],8,E9)),[[Qe(i),{content:Y.content,placement:"right",theme:"light",width:300,zIndex:9999999,extCls:"prompt-popover"}]])),128)),($=u.value)!=null&&$.length?Tn("v-if",!0):(Fe(),no(Qe(KA),{key:0,class:"exception-wrap-item exception-part",scene:"part",type:"search-empty"}))])])),[[Qe(o),A]])])]}),default:Ai(()=>[Se("section",{style:Ur({"--text-height":a.value+"px"}),class:"send-prompt-container"},[Te(Qe(z0),{ref_key:"inputRef",ref:c,class:"send-prompt",autosize:!1,clearable:!0,"model-value":D.value,"native-attributes":{autofocus:"autofocus"},placeholder:f.value,row:"1",type:"textarea",onInput:p,onKeydown:w},null,8,["model-value","placeholder"]),D.value?(Fe(),no(Qe(ef),{key:0,class:"show-clear-only-hover bk-input--clear-icon clear-icon",onClick:v})):Tn("v-if",!0)],4)]),_:1},8,["is-show"]))}}),[["__scopeId","data-v-2374c5aa"]]),z9=(e=>(Zl("data-v-fd57f18d"),e=e(),Hl(),e))(()=>Se("svg",{width:"10",height:"10",class:"ai-blueking-render-stop-icon","aria-hidden":"true"},[Se("use",{"xlink:href":"#ai-blueking-tingzhi"})],-1)),J9=bi(mt({__name:"render-stop",props:{isShow:{type:Boolean}},emits:["stop"],setup(e,{emit:t}){const n=t,r=()=>{n("stop")};return(o,i)=>o.isShow?(Fe(),et("span",{key:0,class:"ai-blueking-render-stop",onClick:r},[z9,Eo(" "+qn(Qe(nt)("终止生成")),1)])):Tn("v-if",!0)}}),[["__scopeId","data-v-fd57f18d"]]),R9={key:0,class:"time-wrapper"},Q9={class:"time-message"},F9=bi(mt({__name:"render-time",props:{message:{}},setup(e){const t=e,n=jt(()=>{var s;const r=cl(t.message.time),o=cl(),i={0:nt("日"),1:nt("一"),2:nt("二"),3:nt("三"),4:nt("四"),5:nt("五"),6:nt("六")};return!t.message.time||(s=window.showTimes)!=null&&s.some(a=>Math.abs(r.diff(a,"minute"))<10&&a!==t.message.time)?"":(window.showTimes=[...window.showTimes||[],t.message.time],o.isSame(r,"day")?r.format("HH:mm:ss"):o.subtract(1,"day").isSame(r,"week")?nt("昨天")+" "+r.format("HH:mm:ss"):o.isSame(r,"week")?nt("本周")+i[r.day()]+" "+r.format("HH:mm:ss"):o.subtract(1,"week").isSame(r,"week")?nt("上周")+i[r.day()]+" "+r.format("HH:mm:ss"):o.isSame(r,"year")?r.format("MM-DD HH:mm:ss"):r.format("YYYY-MM-DD HH:mm:ss"))});return(r,o)=>n.value?(Fe(),et("section",R9,[Se("span",Q9,qn(n.value),1)])):Tn("v-if",!0)}}),[["__scopeId","data-v-55c9a119"]]),ow=e=>(Zl("data-v-6cc6ac8a"),e=e(),Hl(),e),G9={key:0,width:"18",height:"18",class:"scroll-loading-icon","aria-hidden":"true"},W9=[ow(()=>Se("use",{"xlink:href":"#ai-blueking-loading-2"},null,-1))],B9={class:"ai-operation"},Z9={class:"ai-operation-tools"},H9={class:"ai-operation-input"},V9=ow(()=>Se("i",{class:"ai-blueking-icon ai-blueking-fasong"},null,-1)),U9=bi(mt({__name:"render-content",props:{messages:{},prompts:{},loading:{type:Boolean},background:{default:"#f5f7fa"},userPhoto:{},placeholder:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean,default:!0}},emits:["send","choose-prompt","scroll-load","stop"],setup(e,{emit:t}){const n=e,r=t,o=al,i=Qt(""),s=()=>{Do(()=>{const p=document.querySelector(".ai-blueking-messages");p.scrollTop=p.scrollHeight})},a=r3(p=>{if(n.scrollLoading||n.scrollLoadingEnd)return;p.target.scrollTop<200&&r("scroll-load")}),c=()=>{if(i.value){if(n.loading){e3({theme:"warning",message:nt("内容正在执行中,请执行完成后再发送")});return}r("send",i.value),i.value=""}},l=p=>{r("choose-prompt",p)},u=()=>{r("stop")};Ln(()=>n.messages,()=>{const p=document.querySelector(".ai-blueking-messages");(p==null?void 0:p.scrollTop)+(p==null?void 0:p.clientHeight)+100>=(p==null?void 0:p.scrollHeight)&&s()},{deep:!0});const f=()=>{window.showTimes=[]};return xn(s),rr(f),(p,d)=>(Fe(),et("section",{style:Ur({background:p.background}),class:"ai-content"},[Se("ul",{class:"ai-messages ai-blueking-messages",onScrollPassive:d[0]||(d[0]=(...h)=>Qe(a)&&Qe(a)(...h))},[p.scrollLoading?(Fe(),et("svg",G9,W9)):Tn("v-if",!0),(Fe(!0),et(rt,null,Sp(p.messages,h=>(Fe(),et(rt,{key:h.content},[Te(F9,{class:"render-message",message:h},null,8,["message"]),Te(D9,{class:"render-message",message:h,"user-photo":p.userPhoto},null,8,["message","user-photo"])],64))),128))],32),Se("section",B9,[Se("span",Z9,[Te(c3),Te(J9,{"is-show":p.loading,onStop:u},null,8,["is-show"])]),Se("section",H9,[Te(A9,{value:i.value,"onUpdate:value":d[1]||(d[1]=h=>i.value=h),placeholder:p.placeholder,prompts:p.prompts,onChoosePrompt:l,onEnter:c},null,8,["value","placeholder","prompts"]),pn((Fe(),no(Qe(FE),{class:"ai-operation-button",disabled:p.loading||!i.value,size:"large",theme:"primary",onClick:c},{default:Ai(()=>[V9,Eo(" "+qn(Qe(nt)("发送")),1)]),_:1},8,["disabled"])),[[Qe(o),{content:Qe(nt)("内容正在执行中,请执行完成后再发送"),disabled:!p.loading}]])])])],4))}}),[["__scopeId","data-v-6cc6ac8a"]]),Y9={class:"ai-modal-header-icon"},$9=bi(mt({__name:"render-modal",props:{headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)"},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0})},sizeLimit:{default:()=>({height:320,width:400})},logo:{default:"ai-blueking-icon ai-blueking-ai"},name:{},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0})}},emits:["clear","close"],setup(e,{emit:t}){const n=e,r=t,o=al,i={height:window.innerHeight,width:window.innerWidth},s={isMove:!1,type:"",clientX:0,clientY:0},a=()=>{var te,_,k,L;const F=(R,Z)=>R===void 0?Z:R;return{top:F((te=n.startPosition)==null?void 0:te.top,i.height-n.sizeLimit.height),bottom:F((_=n.startPosition)==null?void 0:_.bottom,0),left:F((k=n.startPosition)==null?void 0:k.left,0),right:F((L=n.startPosition)==null?void 0:L.right,i.width-n.sizeLimit.width)}},c=Qt(a()),l=jt(()=>c.value.top<=n.positionLimit.top&&c.value.bottom<=n.positionLimit.bottom),u=F=>{s.isMove=!0,s.type="move",s.clientX=F.clientX,s.clientY=F.clientY},f=F=>{s.isMove=!0,s.type="rightDrag",s.clientX=F.clientX},p=F=>{s.isMove=!0,s.type="leftDrag",s.clientX=F.clientX},d=F=>{s.isMove=!0,s.type="topDrag",s.clientY=F.clientY},h=F=>{s.isMove=!0,s.type="bottomDrag",s.clientY=F.clientY},g=F=>{s.isMove=!0,s.type="topLeftDrag",s.clientY=F.clientY,s.clientX=F.clientX},w=F=>{s.isMove=!0,s.type="topRightDrag",s.clientY=F.clientY,s.clientX=F.clientX},v=F=>{s.isMove=!0,s.type="bottomLeftDrag",s.clientY=F.clientY,s.clientX=F.clientX},N=F=>{s.isMove=!0,s.type="bottomRightDrag",s.clientY=F.clientY,s.clientX=F.clientX},j=()=>{s.isMove=!1},A=(F,te)=>{["move","leftDrag"].includes(s.type)&&(c.value.left+=F),["move","rightDrag"].includes(s.type)&&(c.value.right-=F),["move","topDrag"].includes(s.type)&&(c.value.top+=te),["move","bottomDrag"].includes(s.type)&&(c.value.bottom-=te),["topLeftDrag"].includes(s.type)&&(c.value.left+=F,c.value.top+=te),["topRightDrag"].includes(s.type)&&(c.value.right-=F,c.value.top+=te),["bottomLeftDrag"].includes(s.type)&&(c.value.left+=F,c.value.bottom-=te),["bottomRightDrag"].includes(s.type)&&(c.value.right-=F,c.value.bottom-=te)},D=(F,te)=>{const{top:_,bottom:k,left:L,right:R}=c.value;(i.width-L-R<n.sizeLimit.width||L<n.positionLimit.left||R<n.positionLimit.right)&&(["move","leftDrag","topLeftDrag","bottomLeftDrag"].includes(s.type)&&(c.value.left-=F),["move","rightDrag","topRightDrag","bottomRightDrag"].includes(s.type)&&(c.value.right+=F)),(i.height-_-k<n.sizeLimit.height||_<n.positionLimit.top||k<n.positionLimit.bottom)&&(["move","topDrag","topRightDrag","topLeftDrag"].includes(s.type)&&(c.value.top-=te),["move","bottomDrag","bottomLeftDrag","bottomRightDrag"].includes(s.type)&&(c.value.bottom+=te))},T=F=>{if(!s.isMove)return;F.preventDefault();const te=F.clientX-s.clientX,_=F.clientY-s.clientY;A(te,_),D(te,_),s.clientX=F.clientX,s.clientY=F.clientY},$=()=>{i.height=window.innerHeight,i.width=window.innerWidth,c.value=a()},Y=()=>{c.value.top=n.positionLimit.top,c.value.bottom=n.positionLimit.bottom},re=()=>{c.value.top=i.height-n.sizeLimit.height,c.value.bottom=n.positionLimit.bottom},z=()=>{r("clear")},X=()=>{r("close")};return Np(()=>{window.addEventListener("mousemove",T,!0),window.addEventListener("mouseup",j),window.addEventListener("resize",$)}),rr(()=>{window.removeEventListener("mousemove",T,!0),window.removeEventListener("mouseup",j),window.removeEventListener("resize",$)}),(F,te)=>(Fe(),et("section",{style:Ur({top:c.value.top+"px",bottom:c.value.bottom+"px",left:c.value.left+"px",right:c.value.right+"px"}),class:"ai-modal"},[Se("header",{style:Ur({background:F.headBackground}),class:"ai-modal-header",onMousedown:or(u,["stop"])},[Se("span",Y9,[Se("i",{class:Yr(F.logo)},null,2),Eo(" "+qn(F.name||Qe(nt)("小鲸")),1)]),Se("span",null,[l.value?pn((Fe(),et("i",{key:0,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxiajuhe",onClick:re},null,512)),[[Qe(o),{content:Qe(nt)("向下收缩"),distance:20}]]):pn((Fe(),et("i",{key:1,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxialashen-2",onClick:Y},null,512)),[[Qe(o),{content:Qe(nt)("向上扩展"),distance:20}]]),pn(Se("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-saoba",onClick:z},null,512),[[Qe(o),{content:Qe(nt)("清空聊天记录"),distance:20}]]),pn(Se("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-shanchu-2",onClick:X},null,512),[[Qe(o),{content:Qe(nt)("关闭"),distance:20}]])])],36),jC(F.$slots,"default",{},void 0),Se("span",{class:"drag-line left",onMousedown:or(p,["stop"])},null,32),Se("span",{class:"drag-line right",onMousedown:or(f,["stop"])},null,32),Se("span",{class:"drag-line top",onMousedown:or(d,["stop"])},null,32),Se("span",{class:"drag-line bottom",onMousedown:or(h,["stop"])},null,32),Se("span",{class:"drag-line top-left-corner",onMousedown:or(g,["stop"])},null,32),Se("span",{class:"drag-line top-right-corner",onMousedown:or(w,["stop"])},null,32),Se("span",{class:"drag-line bottom-left-corner",onMousedown:or(v,["stop"])},null,32),Se("span",{class:"drag-line bottom-right-corner",onMousedown:or(N,["stop"])},null,32)],4))}}),[["__scopeId","data-v-e603010f"]]),q9=mt({__name:"ai-blueking",props:{messages:{},prompts:{},loading:{type:Boolean},headBackground:{},background:{},positionLimit:{},sizeLimit:{},startPosition:{},userPhoto:{},name:{},placeholder:{},logo:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean}},emits:["clear","close","scroll-load","stop","send","choose-prompt"],setup(e,{emit:t}){const n=t,r=()=>{n("clear")},o=()=>{n("close")},i=l=>{n("send",l)},s=()=>{n("stop")},a=()=>{n("scroll-load")},c=l=>{n("choose-prompt",l)};return(l,u)=>(Fe(),no($9,{"head-background":l.headBackground,logo:l.logo,name:l.name,"position-limit":l.positionLimit,"size-limit":l.sizeLimit,"start-position":l.startPosition,onClear:r,onClose:o},{default:Ai(()=>[Te(U9,{background:l.background,loading:l.loading,messages:l.messages,placeholder:l.placeholder,prompts:l.prompts,"scroll-loading":l.scrollLoading,"scroll-loading-end":l.scrollLoadingEnd,"user-photo":l.userPhoto,onChoosePrompt:c,onScrollLoad:a,onSend:i,onStop:s},null,8,["background","loading","messages","placeholder","prompts","scroll-loading","scroll-loading-end","user-photo"])]),_:1},8,["head-background","logo","name","position-limit","size-limit","start-position"]))}});(function(){var e='<svg xmlns="http://www.w3.org/2000/svg" data-name="ai-blueking" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0;visibility:hidden"><symbol id="ai-blueking-check-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-26.3 606.3l-181-181L350 444l135.8 135.8L712 353.5l45.3 45.3-271.6 271.5z"/></symbol><symbol id="ai-blueking-close-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm158.4 561.1l-45.3 45.3L512 557.3 398.9 670.4l-45.3-45.3L466.7 512 353.6 398.9l45.3-45.3L512 466.7l113.1-113.1 45.3 45.3L557.3 512l113.1 113.1z"/></symbol><symbol id="ai-blueking-warning-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 640h-64v-64h64v64zm0-128h-64V320h64v256z"/></symbol><symbol id="ai-blueking-loading-2" viewBox="0 0 1024 1024"><path d="M195.2 195.2a64 64 0 000 90.56l44.8 45.28A64 64 0 00331.04 240l-45.28-44.8a64 64 0 00-90.56 0z" opacity=".1"/><path d="M128 576h64a64 64 0 000-128h-64a64 64 0 000 128z" opacity=".15"/><path d="M285.76 828.8l45.28-44.8A64 64 0 00240 692.96l-44.8 45.28a64 64 0 0090.56 90.56z" opacity=".3"/><path d="M576 896v-64a64 64 0 00-128 0v64a64 64 0 00128 0z" opacity=".45"/><path d="M828.8 828.8a64 64 0 000-90.56L784 692.96A64 64 0 00692.96 784l45.28 45.28a64 64 0 0090.56-.48z" opacity=".6"/><path d="M896 448h-64a64 64 0 000 128h64a64 64 0 000-128z" opacity=".75"/><path d="M738.24 195.2L692.96 240A64 64 0 00784 331.04l45.28-45.28a64 64 0 10-90.56-90.56z" opacity=".9"/><path d="M448 128v64a64 64 0 00128 0v-64a64 64 0 00-128 0z"/></g></symbol><symbol id="ai-blueking-ai" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M928 96v448l-1.211-.014C910.455 758.791 730.989 928 512 928 282.25 928 96 741.75 96 512S282.25 96 512 96h416zM488.911 320H379.544L256 672h84.05l23.292-71.909h137.215L523.342 672h87.088L488.911 320zM736 320h-79.494v352H736V320zm-303.797 66.88l47.594 148.343h-95.696l48.102-148.343z"/></symbol><symbol id="ai-blueking-fasong" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M924.55 113.365c0-.09-.088-.09-.088-.18a30.217 30.217 0 00-7.78-9.684 31.929 31.929 0 00-10.606-5.918c-.089 0-.177-.09-.266-.09-1.502-.537-3.093-.806-4.685-1.075-.442-.09-.884-.27-1.414-.27-1.503-.179-2.917-.179-4.42-.09-.618 0-1.149-.089-1.768 0-4.242.27-8.485 1.525-12.375 3.498L113.792 485.577c-7.514 3.677-13.26 10.312-15.911 18.382-.796 2.242-1.15 4.663-1.415 6.994-.795 4.753-.618 9.685.884 14.347 2.475 8.16 8.044 14.885 15.558 18.741l194.734 103.836c4.685 2.51 9.812 3.766 15.115 3.766 11.757.09 22.541-6.367 28.287-16.768 8.397-15.513 2.475-34.791-13.083-43.13l-142.316-75.86 572.358-288.014L418.93 634.516c-.265.27-.354.628-.619.897-8.662 5.739-14.32 15.423-14.32 26.542v234.123a32.598 32.598 0 009.547 22.686c6.01 6.008 14.143 9.236 22.54 9.146v.09c17.68 0 32-14.257 32-31.832V675.405l381.07-444.127-79.202 585.802-200.921-97.917c-15.823-7.712-34.828-1.255-42.872 14.526-3.712 7.622-4.243 16.41-1.503 24.48s8.575 14.615 16.177 18.202l238.754 116.48c4.42 2.151 9.193 3.227 14.144 3.227.176 0 .353-.09.53-.09.53 0 1.15.18 1.68.18 15.91.09 29.435-11.657 31.733-27.618l99.003-731.782c2.21-7.532 1.767-15.871-2.122-23.403z"/></symbol><symbol id="ai-blueking-shangxialashen-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 64L352 251.52l127.168-.672.928 223.968h.352l.832 298.656-127.168.736L513.792 960 672 772.448l-127.136.704-.928-320h-.384l-.8-202.656 127.168-.704z"/></symbol><symbol id="ai-blueking-shangxiajuhe" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 384L352 192l317.92 1.77L510.24 384zm1.44 256l158.24 192L352 830.23 511.68 640zM128 480h768v64H128z"/></symbol><symbol id="ai-blueking-shanchu-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M832 259.2L764.8 192 512 444.8 259.2 192 192 259.2 444.8 512 192 764.8l67.2 67.2L512 579.2 764.8 832l67.2-67.2L579.2 512z"/></symbol><symbol id="ai-blueking-saoba" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M566.857 64C607.253 64 640 92.654 640 128v96h256c35.346 0 64 28.654 64 64v96c0 35.346-28.654 64-64 64h-5.818v332.453l21.56 102.356c7.284 34.587-14.848 68.532-49.436 75.817a64 64 0 01-13.19 1.374H175.262c-35.346 0-64-28.654-64-64a64 64 0 011.436-13.484l21.12-97.989V448H128c-35.346 0-64-28.654-64-64v-96c0-35.346 28.654-64 64-64h256v-96c0-35.346 32.747-64 73.143-64h109.714zm259.325 384H197.818v343.346l-1.436 6.665L175.262 896H320V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h145.115l-21.559-102.356-1.374-6.524V448zM896 288H128v96h768v-96zM566.857 128H457.143v96h109.714v-96z"/></symbol><symbol id="ai-blueking-quanquan" viewBox="0 0 1024 1024"><path fill="#3A84FF" d="M512 64.129c-9.343-.661-18.345 3.338-27.005 11.998-2.666 2.667-4.831 6.165-6.495 10.495-1.664 4.33-2.496 7.498-2.496 9.503v4c0 10.004 2.997 18.003 8.991 23.997 3.328 4.01 7.327 6.847 11.999 8.511 4.671 1.664 8.34 2.496 11.006 2.496h4c68.003 0 130.993 16.83 188.97 50.49 57.978 33.66 103.807 79.49 137.489 137.488 33.681 57.999 50.511 121.16 50.49 189.483-.021 68.322-16.851 131.313-50.49 188.97-33.64 57.657-79.469 103.316-137.489 136.976-58.02 33.66-121.18 50.49-189.482 50.49-68.301 0-131.292-16.83-188.97-50.49-57.68-33.66-103.338-79.319-136.977-136.976-33.639-57.657-50.469-120.818-50.49-189.482 0-10.005-3.669-18.676-11.007-26.013-2.666-3.328-6.164-5.824-10.494-7.487-4.33-1.664-7.498-2.496-9.503-2.496h-4c-10.004 0-18.334 3.338-24.99 10.015-4.01 4.01-6.846 8.18-8.51 12.51-1.664 4.33-2.496 7.498-2.496 9.503v4c0 60.665 11.828 118.663 35.484 173.996 23.656 55.332 55.482 102.996 95.477 142.991 39.996 39.996 87.66 71.822 142.992 95.478 55.332 23.656 113.33 35.483 173.996 35.483 60.665 0 118.664-11.827 173.996-35.483 55.332-23.656 102.996-55.482 142.992-95.478 39.995-39.995 71.82-87.659 95.477-142.991 23.656-55.333 35.484-113.331 35.484-173.996 0-60.665-11.828-118.664-35.484-173.996-23.656-55.333-55.482-102.997-95.477-142.992-39.996-39.996-87.66-71.821-142.992-95.477C630.664 75.989 572.666 64.16 512 64.16v-.032z"/></symbol><symbol id="ai-blueking-xiangxia-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M176 617.6l92.8-89.6 182.4 179.2V112h121.6v595.2L755.2 528l92.8 89.6L512 944 176 617.6z" clip-rule="evenodd"/></symbol><symbol id="ai-blueking-tingzhi" viewBox="0 0 1024 1024"><path fill="#fdd" d="M256 256h512v512H256V256z"/><path fill="#ea3636" d="M128 128v768h768V128H128zm640 640H256V256h512v512z"/></symbol></svg>';document.body?document.body.insertAdjacentHTML("afterbegin",e):document.addEventListener("DOMContentLoaded",function(){document.body.insertAdjacentHTML("afterbegin",e)})})();class K9{constructor(t,n,r,o,i){To(this,"controllerMap");To(this,"handleEnd");To(this,"handleError");To(this,"handleReceiveMessage");To(this,"handleStart");To(this,"url");this.url=t,this.handleStart=n,this.handleReceiveMessage=r,this.handleEnd=o,this.handleError=i,this.controllerMap={}}stop(t){var n,r;return(r=(n=this.controllerMap[t])==null?void 0:n.abort)==null||r.call(n),this.handleEnd(t)}async stream(t,n,r){const o=new AbortController;this.controllerMap[n]=o,fetch(this.url,{method:"post",signal:o.signal,headers:{"Content-Type":"application/json",...r},mode:"cors",credentials:"include",body:JSON.stringify(t)}).then(async i=>{const s=i.body.pipeThrough(new window.TextDecoderStream).getReader();for(;;)try{const{value:a,done:c}=await s.read();if(!i.ok){this.handleError(a||i.statusText,i.status,n);break}if(c)break;a.toString().split(`
|
|
288
|
+
`,s.map=[n,t.line],!0},T5=function(t,n,r,o){var i,s,a,c,l,u,f,p=!1,d=t.bMarks[n]+t.tShift[n],h=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||d+3>h||(i=t.src.charCodeAt(d),i!==126&&i!==96)||(l=d,d=t.skipChars(d,i),s=d-l,s<3)||(f=t.src.slice(l,d),a=t.src.slice(d,h),i===96&&a.indexOf(String.fromCharCode(i))>=0))return!1;if(o)return!0;for(c=n;c++,!(c>=r||(d=l=t.bMarks[c]+t.tShift[c],h=t.eMarks[c],d<h&&t.sCount[c]<t.blkIndent));)if(t.src.charCodeAt(d)===i&&!(t.sCount[c]-t.blkIndent>=4)&&(d=t.skipChars(d,i),!(d-l<s)&&(d=t.skipSpaces(d),!(d<h)))){p=!0;break}return s=t.sCount[n],t.line=c+(p?1:0),u=t.push("fence","code",0),u.info=a,u.content=t.getLines(n+1,c,s,!0),u.markup=f,u.map=[n,t.line],!0},j5=Je.isSpace,k5=function(t,n,r,o){var i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D,T,$,Y,re=t.lineMax,z=t.bMarks[n]+t.tShift[n],X=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||t.src.charCodeAt(z)!==62)return!1;if(o)return!0;for(h=[],g=[],N=[],j=[],T=t.md.block.ruler.getRules("blockquote"),v=t.parentType,t.parentType="blockquote",p=n;p<r&&(Y=t.sCount[p]<t.blkIndent,z=t.bMarks[p]+t.tShift[p],X=t.eMarks[p],!(z>=X));p++){if(t.src.charCodeAt(z++)===62&&!Y){for(c=t.sCount[p]+1,t.src.charCodeAt(z)===32?(z++,c++,i=!1,A=!0):t.src.charCodeAt(z)===9?(A=!0,(t.bsCount[p]+c)%4===3?(z++,c++,i=!1):i=!0):A=!1,d=c,h.push(t.bMarks[p]),t.bMarks[p]=z;z<X&&(s=t.src.charCodeAt(z),j5(s));){s===9?d+=4-(d+t.bsCount[p]+(i?1:0))%4:d++;z++}u=z>=X,g.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(A?1:0),N.push(t.sCount[p]),t.sCount[p]=d-c,j.push(t.tShift[p]),t.tShift[p]=z-t.bMarks[p];continue}if(u)break;for(D=!1,a=0,l=T.length;a<l;a++)if(T[a](t,p,r,!0)){D=!0;break}if(D){t.lineMax=p,t.blkIndent!==0&&(h.push(t.bMarks[p]),g.push(t.bsCount[p]),j.push(t.tShift[p]),N.push(t.sCount[p]),t.sCount[p]-=t.blkIndent);break}h.push(t.bMarks[p]),g.push(t.bsCount[p]),j.push(t.tShift[p]),N.push(t.sCount[p]),t.sCount[p]=-1}for(w=t.blkIndent,t.blkIndent=0,$=t.push("blockquote_open","blockquote",1),$.markup=">",$.map=f=[n,0],t.md.block.tokenize(t,n,p),$=t.push("blockquote_close","blockquote",-1),$.markup=">",t.lineMax=re,t.parentType=v,f[1]=t.line,a=0;a<j.length;a++)t.bMarks[a+n]=h[a],t.tShift[a+n]=j[a],t.sCount[a+n]=N[a],t.bsCount[a+n]=g[a];return t.blkIndent=w,!0},N5=Je.isSpace,S5=function(t,n,r,o){var i,s,a,c,l=t.bMarks[n]+t.tShift[n],u=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||(i=t.src.charCodeAt(l++),i!==42&&i!==45&&i!==95))return!1;for(s=1;l<u;){if(a=t.src.charCodeAt(l++),a!==i&&!N5(a))return!1;a===i&&s++}return s<3?!1:(o||(t.line=n+1,c=t.push("hr","hr",0),c.map=[n,t.line],c.markup=Array(s+1).join(String.fromCharCode(i))),!0)},Tb=Je.isSpace;function jb(e,t){var n,r,o,i;return r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],n=e.src.charCodeAt(r++),n!==42&&n!==45&&n!==43||r<o&&(i=e.src.charCodeAt(r),!Tb(i))?-1:r}function kb(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=r,i=e.eMarks[t];if(o+1>=i||(n=e.src.charCodeAt(o++),n<48||n>57))return-1;for(;;){if(o>=i)return-1;if(n=e.src.charCodeAt(o++),n>=48&&n<=57){if(o-r>=10)return-1;continue}if(n===41||n===46)break;return-1}return o<i&&(n=e.src.charCodeAt(o),!Tb(n))?-1:o}function D5(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&e.tokens[n].type==="paragraph_open"&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}var O5=function(t,n,r,o){var i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D,T,$,Y,re,z,X,F,te,_,k,L=n,R=!1,Z=!0;if(t.sCount[L]-t.blkIndent>=4||t.listIndent>=0&&t.sCount[L]-t.listIndent>=4&&t.sCount[L]<t.blkIndent)return!1;if(o&&t.parentType==="paragraph"&&t.sCount[L]>=t.blkIndent&&(R=!0),(z=kb(t,L))>=0){if(f=!0,F=t.bMarks[L]+t.tShift[L],v=Number(t.src.slice(F,z-1)),R&&v!==1)return!1}else if((z=jb(t,L))>=0)f=!1;else return!1;if(R&&t.skipSpaces(z)>=t.eMarks[L])return!1;if(o)return!0;for(w=t.src.charCodeAt(z-1),g=t.tokens.length,f?(k=t.push("ordered_list_open","ol",1),v!==1&&(k.attrs=[["start",v]])):k=t.push("bullet_list_open","ul",1),k.map=h=[L,0],k.markup=String.fromCharCode(w),X=!1,_=t.md.block.ruler.getRules("list"),D=t.parentType,t.parentType="list";L<r;){for(re=z,N=t.eMarks[L],u=j=t.sCount[L]+z-(t.bMarks[L]+t.tShift[L]);re<N;){if(i=t.src.charCodeAt(re),i===9)j+=4-(j+t.bsCount[L])%4;else if(i===32)j++;else break;re++}if(s=re,s>=N?l=1:l=j-u,l>4&&(l=1),c=u+l,k=t.push("list_item_open","li",1),k.markup=String.fromCharCode(w),k.map=p=[L,0],f&&(k.info=t.src.slice(F,z-1)),Y=t.tight,$=t.tShift[L],T=t.sCount[L],A=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=c,t.tight=!0,t.tShift[L]=s-t.bMarks[L],t.sCount[L]=j,s>=N&&t.isEmpty(L+1)?t.line=Math.min(t.line+2,r):t.md.block.tokenize(t,L,r,!0),(!t.tight||X)&&(Z=!1),X=t.line-L>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=A,t.tShift[L]=$,t.sCount[L]=T,t.tight=Y,k=t.push("list_item_close","li",-1),k.markup=String.fromCharCode(w),L=t.line,p[1]=L,L>=r||t.sCount[L]<t.blkIndent||t.sCount[L]-t.blkIndent>=4)break;for(te=!1,a=0,d=_.length;a<d;a++)if(_[a](t,L,r,!0)){te=!0;break}if(te)break;if(f){if(z=kb(t,L),z<0)break;F=t.bMarks[L]+t.tShift[L]}else if(z=jb(t,L),z<0)break;if(w!==t.src.charCodeAt(z-1))break}return f?k=t.push("ordered_list_close","ol",-1):k=t.push("bullet_list_close","ul",-1),k.markup=String.fromCharCode(w),h[1]=L,t.line=L,t.parentType=D,Z&&D5(t,g),!0},_5=Je.normalizeReference,yl=Je.isSpace,E5=function(t,n,r,o){var i,s,a,c,l,u,f,p,d,h,g,w,v,N,j,A,D=0,T=t.bMarks[n]+t.tShift[n],$=t.eMarks[n],Y=n+1;if(t.sCount[n]-t.blkIndent>=4||t.src.charCodeAt(T)!==91)return!1;for(;++T<$;)if(t.src.charCodeAt(T)===93&&t.src.charCodeAt(T-1)!==92){if(T+1===$||t.src.charCodeAt(T+1)!==58)return!1;break}for(c=t.lineMax,j=t.md.block.ruler.getRules("reference"),h=t.parentType,t.parentType="reference";Y<c&&!t.isEmpty(Y);Y++)if(!(t.sCount[Y]-t.blkIndent>3)&&!(t.sCount[Y]<0)){for(N=!1,u=0,f=j.length;u<f;u++)if(j[u](t,Y,c,!0)){N=!0;break}if(N)break}for(v=t.getLines(n,Y,t.blkIndent,!1).trim(),$=v.length,T=1;T<$;T++){if(i=v.charCodeAt(T),i===91)return!1;if(i===93){d=T;break}else i===10?D++:i===92&&(T++,T<$&&v.charCodeAt(T)===10&&D++)}if(d<0||v.charCodeAt(d+1)!==58)return!1;for(T=d+2;T<$;T++)if(i=v.charCodeAt(T),i===10)D++;else if(!yl(i))break;if(g=t.md.helpers.parseLinkDestination(v,T,$),!g.ok||(l=t.md.normalizeLink(g.str),!t.md.validateLink(l)))return!1;for(T=g.pos,D+=g.lines,s=T,a=D,w=T;T<$;T++)if(i=v.charCodeAt(T),i===10)D++;else if(!yl(i))break;for(g=t.md.helpers.parseLinkTitle(v,T,$),T<$&&w!==T&&g.ok?(A=g.str,T=g.pos,D+=g.lines):(A="",T=s,D=a);T<$&&(i=v.charCodeAt(T),!!yl(i));)T++;if(T<$&&v.charCodeAt(T)!==10&&A)for(A="",T=s,D=a;T<$&&(i=v.charCodeAt(T),!!yl(i));)T++;return T<$&&v.charCodeAt(T)!==10||(p=_5(v.slice(1,d)),!p)?!1:(o||(typeof t.env.references>"u"&&(t.env.references={}),typeof t.env.references[p]>"u"&&(t.env.references[p]={title:A,href:l}),t.parentType=h,t.line=n+D+1),!0)},P5=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],bl={},A5="[a-zA-Z_:][a-zA-Z0-9:._-]*",z5="[^\"'=<>`\\x00-\\x20]+",J5="'[^']*'",R5='"[^"]*"',Q5="(?:"+z5+"|"+J5+"|"+R5+")",F5="(?:\\s+"+A5+"(?:\\s*=\\s*"+Q5+")?)",Nb="<[A-Za-z][A-Za-z0-9\\-]*"+F5+"*\\s*\\/?>",Sb="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",G5="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",W5="<[?][\\s\\S]*?[?]>",B5="<![A-Z]+\\s+[^>]*>",Z5="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",H5=new RegExp("^(?:"+Nb+"|"+Sb+"|"+G5+"|"+W5+"|"+B5+"|"+Z5+")"),V5=new RegExp("^(?:"+Nb+"|"+Sb+")");bl.HTML_TAG_RE=H5,bl.HTML_OPEN_CLOSE_TAG_RE=V5;var U5=P5,Y5=bl.HTML_OPEN_CLOSE_TAG_RE,Mi=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+U5.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Y5.source+"\\s*$"),/^$/,!1]],$5=function(t,n,r,o){var i,s,a,c,l=t.bMarks[n]+t.tShift[n],u=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(l)!==60)return!1;for(c=t.src.slice(l,u),i=0;i<Mi.length&&!Mi[i][0].test(c);i++);if(i===Mi.length)return!1;if(o)return Mi[i][2];if(s=n+1,!Mi[i][1].test(c)){for(;s<r&&!(t.sCount[s]<t.blkIndent);s++)if(l=t.bMarks[s]+t.tShift[s],u=t.eMarks[s],c=t.src.slice(l,u),Mi[i][1].test(c)){c.length!==0&&s++;break}}return t.line=s,a=t.push("html_block","",0),a.map=[n,s],a.content=t.getLines(n,s,t.blkIndent,!0),!0},Db=Je.isSpace,q5=function(t,n,r,o){var i,s,a,c,l=t.bMarks[n]+t.tShift[n],u=t.eMarks[n];if(t.sCount[n]-t.blkIndent>=4||(i=t.src.charCodeAt(l),i!==35||l>=u))return!1;for(s=1,i=t.src.charCodeAt(++l);i===35&&l<u&&s<=6;)s++,i=t.src.charCodeAt(++l);return s>6||l<u&&!Db(i)?!1:(o||(u=t.skipSpacesBack(u,l),a=t.skipCharsBack(u,35,l),a>l&&Db(t.src.charCodeAt(a-1))&&(u=a),t.line=n+1,c=t.push("heading_open","h"+String(s),1),c.markup="########".slice(0,s),c.map=[n,t.line],c=t.push("inline","",0),c.content=t.src.slice(l,u).trim(),c.map=[n,t.line],c.children=[],c=t.push("heading_close","h"+String(s),-1),c.markup="########".slice(0,s)),!0)},K5=function(t,n,r){var o,i,s,a,c,l,u,f,p,d=n+1,h,g=t.md.block.ruler.getRules("paragraph");if(t.sCount[n]-t.blkIndent>=4)return!1;for(h=t.parentType,t.parentType="paragraph";d<r&&!t.isEmpty(d);d++)if(!(t.sCount[d]-t.blkIndent>3)){if(t.sCount[d]>=t.blkIndent&&(l=t.bMarks[d]+t.tShift[d],u=t.eMarks[d],l<u&&(p=t.src.charCodeAt(l),(p===45||p===61)&&(l=t.skipChars(l,p),l=t.skipSpaces(l),l>=u)))){f=p===61?1:2;break}if(!(t.sCount[d]<0)){for(i=!1,s=0,a=g.length;s<a;s++)if(g[s](t,d,r,!0)){i=!0;break}if(i)break}}return f?(o=t.getLines(n,d,t.blkIndent,!1).trim(),t.line=d+1,c=t.push("heading_open","h"+String(f),1),c.markup=String.fromCharCode(p),c.map=[n,t.line],c=t.push("inline","",0),c.content=o,c.map=[n,t.line-1],c.children=[],c=t.push("heading_close","h"+String(f),-1),c.markup=String.fromCharCode(p),t.parentType=h,!0):!1},X5=function(t,n,r){var o,i,s,a,c,l,u=n+1,f=t.md.block.ruler.getRules("paragraph");for(l=t.parentType,t.parentType="paragraph";u<r&&!t.isEmpty(u);u++)if(!(t.sCount[u]-t.blkIndent>3)&&!(t.sCount[u]<0)){for(i=!1,s=0,a=f.length;s<a;s++)if(f[s](t,u,r,!0)){i=!0;break}if(i)break}return o=t.getLines(n,u,t.blkIndent,!1).trim(),t.line=u,c=t.push("paragraph_open","p",1),c.map=[n,t.line],c=t.push("inline","",0),c.content=o,c.map=[n,t.line],c.children=[],c=t.push("paragraph_close","p",-1),t.parentType=l,!0},Ob=ud,wl=Je.isSpace;function Vn(e,t,n,r){var o,i,s,a,c,l,u,f;for(this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",i=this.src,f=!1,s=a=l=u=0,c=i.length;a<c;a++){if(o=i.charCodeAt(a),!f)if(wl(o)){l++,o===9?u+=4-u%4:u++;continue}else f=!0;(o===10||a===c-1)&&(o!==10&&a++,this.bMarks.push(s),this.eMarks.push(a),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),f=!1,l=0,u=0,s=a+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Vn.prototype.push=function(e,t,n){var r=new Ob(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},Vn.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},Vn.prototype.skipEmptyLines=function(t){for(var n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},Vn.prototype.skipSpaces=function(t){for(var n,r=this.src.length;t<r&&(n=this.src.charCodeAt(t),!!wl(n));t++);return t},Vn.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!wl(this.src.charCodeAt(--t)))return t+1;return t},Vn.prototype.skipChars=function(t,n){for(var r=this.src.length;t<r&&this.src.charCodeAt(t)===n;t++);return t},Vn.prototype.skipCharsBack=function(t,n,r){if(t<=r)return t;for(;t>r;)if(n!==this.src.charCodeAt(--t))return t+1;return t},Vn.prototype.getLines=function(t,n,r,o){var i,s,a,c,l,u,f,p=t;if(t>=n)return"";for(u=new Array(n-t),i=0;p<n;p++,i++){for(s=0,f=c=this.bMarks[p],p+1<n||o?l=this.eMarks[p]+1:l=this.eMarks[p];c<l&&s<r;){if(a=this.src.charCodeAt(c),wl(a))a===9?s+=4-(s+this.bsCount[p])%4:s++;else if(c-f<this.tShift[p])s++;else break;c++}s>r?u[i]=new Array(s-r+1).join(" ")+this.src.slice(c,l):u[i]=this.src.slice(c,l)}return u.join("")},Vn.prototype.Token=Ob;var ez=Vn,tz=ld,Cl=[["table",L5,["paragraph","reference"]],["code",x5],["fence",T5,["paragraph","reference","blockquote","list"]],["blockquote",k5,["paragraph","reference","blockquote","list"]],["hr",S5,["paragraph","reference","blockquote","list"]],["list",O5,["paragraph","reference","blockquote"]],["reference",E5],["html_block",$5,["paragraph","reference","blockquote"]],["heading",q5,["paragraph","reference","blockquote"]],["lheading",K5],["paragraph",X5]];function Il(){this.ruler=new tz;for(var e=0;e<Cl.length;e++)this.ruler.push(Cl[e][0],Cl[e][1],{alt:(Cl[e][2]||[]).slice()})}Il.prototype.tokenize=function(e,t,n){for(var r,o,i,s=this.ruler.getRules(""),a=s.length,c=t,l=!1,u=e.md.options.maxNesting;c<n&&(e.line=c=e.skipEmptyLines(c),!(c>=n||e.sCount[c]<e.blkIndent));){if(e.level>=u){e.line=n;break}for(i=e.line,o=0;o<a;o++)if(r=s[o](e,c,n,!1),r){if(i>=e.line)throw new Error("block rule didn't increment state.line");break}if(!r)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),c=e.line,c<n&&e.isEmpty(c)&&(l=!0,c++,e.line=c)}},Il.prototype.parse=function(e,t,n,r){var o;e&&(o=new this.State(e,t,n,r),this.tokenize(o,o.line,o.lineMax))},Il.prototype.State=ez;var nz=Il;function rz(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}for(var oz=function(t,n){for(var r=t.pos;r<t.posMax&&!rz(t.src.charCodeAt(r));)r++;return r===t.pos?!1:(n||(t.pending+=t.src.slice(t.pos,r)),t.pos=r,!0)},iz=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i,sz=function(t,n){var r,o,i,s,a,c,l,u;return!t.md.options.linkify||t.linkLevel>0||(r=t.pos,o=t.posMax,r+3>o)||t.src.charCodeAt(r)!==58||t.src.charCodeAt(r+1)!==47||t.src.charCodeAt(r+2)!==47||(i=t.pending.match(iz),!i)||(s=i[1],a=t.md.linkify.matchAtStart(t.src.slice(r-s.length)),!a)||(c=a.url,c.length<=s.length)||(c=c.replace(/\*+$/,""),l=t.md.normalizeLink(c),!t.md.validateLink(l))?!1:(n||(t.pending=t.pending.slice(0,-s.length),u=t.push("link_open","a",1),u.attrs=[["href",l]],u.markup="linkify",u.info="auto",u=t.push("text","",0),u.content=t.md.normalizeLinkText(c),u=t.push("link_close","a",-1),u.markup="linkify",u.info="auto"),t.pos+=c.length-s.length,!0)},az=Je.isSpace,cz=function(t,n){var r,o,i,s=t.pos;if(t.src.charCodeAt(s)!==10)return!1;if(r=t.pending.length-1,o=t.posMax,!n)if(r>=0&&t.pending.charCodeAt(r)===32)if(r>=1&&t.pending.charCodeAt(r-1)===32){for(i=r-1;i>=1&&t.pending.charCodeAt(i-1)===32;)i--;t.pending=t.pending.slice(0,i),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(s++;s<o&&az(t.src.charCodeAt(s));)s++;return t.pos=s,!0},lz=Je.isSpace,hd=[],_b=0;_b<256;_b++)hd.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){hd[e.charCodeAt(0)]=1});var uz=function(t,n){var r,o,i,s,a,c=t.pos,l=t.posMax;if(t.src.charCodeAt(c)!==92||(c++,c>=l))return!1;if(r=t.src.charCodeAt(c),r===10){for(n||t.push("hardbreak","br",0),c++;c<l&&(r=t.src.charCodeAt(c),!!lz(r));)c++;return t.pos=c,!0}return s=t.src[c],r>=55296&&r<=56319&&c+1<l&&(o=t.src.charCodeAt(c+1),o>=56320&&o<=57343&&(s+=t.src[c+1],c++)),i="\\"+s,n||(a=t.push("text_special","",0),r<256&&hd[r]!==0?a.content=s:a.content=i,a.markup=i,a.info="escape"),t.pos=c+1,!0},fz=function(t,n){var r,o,i,s,a,c,l,u,f=t.pos,p=t.src.charCodeAt(f);if(p!==96)return!1;for(r=f,f++,o=t.posMax;f<o&&t.src.charCodeAt(f)===96;)f++;if(i=t.src.slice(r,f),l=i.length,t.backticksScanned&&(t.backticks[l]||0)<=r)return n||(t.pending+=i),t.pos+=l,!0;for(c=f;(a=t.src.indexOf("`",c))!==-1;){for(c=a+1;c<o&&t.src.charCodeAt(c)===96;)c++;if(u=c-a,u===l)return n||(s=t.push("code_inline","code",0),s.markup=i,s.content=t.src.slice(f,a).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),t.pos=c,!0;t.backticks[u]=a}return t.backticksScanned=!0,n||(t.pending+=i),t.pos+=l,!0},Ml={};Ml.tokenize=function(t,n){var r,o,i,s,a,c=t.pos,l=t.src.charCodeAt(c);if(n||l!==126||(o=t.scanDelims(t.pos,!0),s=o.length,a=String.fromCharCode(l),s<2))return!1;for(s%2&&(i=t.push("text","",0),i.content=a,s--),r=0;r<s;r+=2)i=t.push("text","",0),i.content=a+a,t.delimiters.push({marker:l,length:0,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0};function Eb(e,t){var n,r,o,i,s,a=[],c=t.length;for(n=0;n<c;n++)o=t[n],o.marker===126&&o.end!==-1&&(i=t[o.end],s=e.tokens[o.token],s.type="s_open",s.tag="s",s.nesting=1,s.markup="~~",s.content="",s=e.tokens[i.token],s.type="s_close",s.tag="s",s.nesting=-1,s.markup="~~",s.content="",e.tokens[i.token-1].type==="text"&&e.tokens[i.token-1].content==="~"&&a.push(i.token-1));for(;a.length;){for(n=a.pop(),r=n+1;r<e.tokens.length&&e.tokens[r].type==="s_close";)r++;r--,n!==r&&(s=e.tokens[r],e.tokens[r]=e.tokens[n],e.tokens[n]=s)}}Ml.postProcess=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(Eb(t,t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&Eb(t,r[n].delimiters)};var Ll={};Ll.tokenize=function(t,n){var r,o,i,s=t.pos,a=t.src.charCodeAt(s);if(n||a!==95&&a!==42)return!1;for(o=t.scanDelims(t.pos,a===42),r=0;r<o.length;r++)i=t.push("text","",0),i.content=String.fromCharCode(a),t.delimiters.push({marker:a,length:o.length,token:t.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return t.pos+=o.length,!0};function Pb(e,t){var n,r,o,i,s,a,c=t.length;for(n=c-1;n>=0;n--)r=t[n],!(r.marker!==95&&r.marker!==42)&&r.end!==-1&&(o=t[r.end],a=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===o.token+1,s=String.fromCharCode(r.marker),i=e.tokens[r.token],i.type=a?"strong_open":"em_open",i.tag=a?"strong":"em",i.nesting=1,i.markup=a?s+s:s,i.content="",i=e.tokens[o.token],i.type=a?"strong_close":"em_close",i.tag=a?"strong":"em",i.nesting=-1,i.markup=a?s+s:s,i.content="",a&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}Ll.postProcess=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(Pb(t,t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&Pb(t,r[n].delimiters)};var dz=Je.normalizeReference,md=Je.isSpace,pz=function(t,n){var r,o,i,s,a,c,l,u,f,p="",d="",h=t.pos,g=t.posMax,w=t.pos,v=!0;if(t.src.charCodeAt(t.pos)!==91||(a=t.pos+1,s=t.md.helpers.parseLinkLabel(t,t.pos,!0),s<0))return!1;if(c=s+1,c<g&&t.src.charCodeAt(c)===40){for(v=!1,c++;c<g&&(o=t.src.charCodeAt(c),!(!md(o)&&o!==10));c++);if(c>=g)return!1;if(w=c,l=t.md.helpers.parseLinkDestination(t.src,c,t.posMax),l.ok){for(p=t.md.normalizeLink(l.str),t.md.validateLink(p)?c=l.pos:p="",w=c;c<g&&(o=t.src.charCodeAt(c),!(!md(o)&&o!==10));c++);if(l=t.md.helpers.parseLinkTitle(t.src,c,t.posMax),c<g&&w!==c&&l.ok)for(d=l.str,c=l.pos;c<g&&(o=t.src.charCodeAt(c),!(!md(o)&&o!==10));c++);}(c>=g||t.src.charCodeAt(c)!==41)&&(v=!0),c++}if(v){if(typeof t.env.references>"u")return!1;if(c<g&&t.src.charCodeAt(c)===91?(w=c+1,c=t.md.helpers.parseLinkLabel(t,c),c>=0?i=t.src.slice(w,c++):c=s+1):c=s+1,i||(i=t.src.slice(a,s)),u=t.env.references[dz(i)],!u)return t.pos=h,!1;p=u.href,d=u.title}return n||(t.pos=a,t.posMax=s,f=t.push("link_open","a",1),f.attrs=r=[["href",p]],d&&r.push(["title",d]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,f=t.push("link_close","a",-1)),t.pos=c,t.posMax=g,!0},gz=Je.normalizeReference,vd=Je.isSpace,hz=function(t,n){var r,o,i,s,a,c,l,u,f,p,d,h,g,w="",v=t.pos,N=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91||(c=t.pos+2,a=t.md.helpers.parseLinkLabel(t,t.pos+1,!1),a<0))return!1;if(l=a+1,l<N&&t.src.charCodeAt(l)===40){for(l++;l<N&&(o=t.src.charCodeAt(l),!(!vd(o)&&o!==10));l++);if(l>=N)return!1;for(g=l,f=t.md.helpers.parseLinkDestination(t.src,l,t.posMax),f.ok&&(w=t.md.normalizeLink(f.str),t.md.validateLink(w)?l=f.pos:w=""),g=l;l<N&&(o=t.src.charCodeAt(l),!(!vd(o)&&o!==10));l++);if(f=t.md.helpers.parseLinkTitle(t.src,l,t.posMax),l<N&&g!==l&&f.ok)for(p=f.str,l=f.pos;l<N&&(o=t.src.charCodeAt(l),!(!vd(o)&&o!==10));l++);else p="";if(l>=N||t.src.charCodeAt(l)!==41)return t.pos=v,!1;l++}else{if(typeof t.env.references>"u")return!1;if(l<N&&t.src.charCodeAt(l)===91?(g=l+1,l=t.md.helpers.parseLinkLabel(t,l),l>=0?s=t.src.slice(g,l++):l=a+1):l=a+1,s||(s=t.src.slice(c,a)),u=t.env.references[gz(s)],!u)return t.pos=v,!1;w=u.href,p=u.title}return n||(i=t.src.slice(c,a),t.md.inline.parse(i,t.md,t.env,h=[]),d=t.push("image","img",0),d.attrs=r=[["src",w],["alt",""]],d.children=h,d.content=i,p&&r.push(["title",p])),t.pos=l,t.posMax=N,!0},mz=/^([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])?)*)$/,vz=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,yz=function(t,n){var r,o,i,s,a,c,l=t.pos;if(t.src.charCodeAt(l)!==60)return!1;for(a=t.pos,c=t.posMax;;){if(++l>=c||(s=t.src.charCodeAt(l),s===60))return!1;if(s===62)break}return r=t.src.slice(a+1,l),vz.test(r)?(o=t.md.normalizeLink(r),t.md.validateLink(o)?(n||(i=t.push("link_open","a",1),i.attrs=[["href",o]],i.markup="autolink",i.info="auto",i=t.push("text","",0),i.content=t.md.normalizeLinkText(r),i=t.push("link_close","a",-1),i.markup="autolink",i.info="auto"),t.pos+=r.length+2,!0):!1):mz.test(r)?(o=t.md.normalizeLink("mailto:"+r),t.md.validateLink(o)?(n||(i=t.push("link_open","a",1),i.attrs=[["href",o]],i.markup="autolink",i.info="auto",i=t.push("text","",0),i.content=t.md.normalizeLinkText(r),i=t.push("link_close","a",-1),i.markup="autolink",i.info="auto"),t.pos+=r.length+2,!0):!1):!1},bz=bl.HTML_TAG_RE;function wz(e){return/^<a[>\s]/i.test(e)}function Cz(e){return/^<\/a\s*>/i.test(e)}function Iz(e){var t=e|32;return t>=97&&t<=122}var Mz=function(t,n){var r,o,i,s,a=t.pos;return!t.md.options.html||(i=t.posMax,t.src.charCodeAt(a)!==60||a+2>=i)||(r=t.src.charCodeAt(a+1),r!==33&&r!==63&&r!==47&&!Iz(r))||(o=t.src.slice(a).match(bz),!o)?!1:(n||(s=t.push("html_inline","",0),s.content=o[0],wz(s.content)&&t.linkLevel++,Cz(s.content)&&t.linkLevel--),t.pos+=o[0].length,!0)},Ab=tb,Lz=Je.has,xz=Je.isValidEntityCode,zb=Je.fromCodePoint,Tz=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,jz=/^&([a-z][a-z0-9]{1,31});/i,kz=function(t,n){var r,o,i,s,a=t.pos,c=t.posMax;if(t.src.charCodeAt(a)!==38||a+1>=c)return!1;if(r=t.src.charCodeAt(a+1),r===35){if(i=t.src.slice(a).match(Tz),i)return n||(o=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),s=t.push("text_special","",0),s.content=xz(o)?zb(o):zb(65533),s.markup=i[0],s.info="entity"),t.pos+=i[0].length,!0}else if(i=t.src.slice(a).match(jz),i&&Lz(Ab,i[1]))return n||(s=t.push("text_special","",0),s.content=Ab[i[1]],s.markup=i[0],s.info="entity"),t.pos+=i[0].length,!0;return!1};function Jb(e){var t,n,r,o,i,s,a,c,l={},u=e.length;if(u){var f=0,p=-2,d=[];for(t=0;t<u;t++)if(r=e[t],d.push(0),(e[f].marker!==r.marker||p!==r.token-1)&&(f=t),p=r.token,r.length=r.length||0,!!r.close){for(l.hasOwnProperty(r.marker)||(l[r.marker]=[-1,-1,-1,-1,-1,-1]),i=l[r.marker][(r.open?3:0)+r.length%3],n=f-d[f]-1,s=n;n>i;n-=d[n]+1)if(o=e[n],o.marker===r.marker&&o.open&&o.end<0&&(a=!1,(o.close||r.open)&&(o.length+r.length)%3===0&&(o.length%3!==0||r.length%3!==0)&&(a=!0),!a)){c=n>0&&!e[n-1].open?d[n-1]+1:0,d[t]=t-n+c,d[n]=c,r.open=!1,o.end=t,o.close=!1,s=-1,p=-2;break}s!==-1&&(l[r.marker][(r.open?3:0)+(r.length||0)%3]=s)}}}var Nz=function(t){var n,r=t.tokens_meta,o=t.tokens_meta.length;for(Jb(t.delimiters),n=0;n<o;n++)r[n]&&r[n].delimiters&&Jb(r[n].delimiters)},Sz=function(t){var n,r,o=0,i=t.tokens,s=t.tokens.length;for(n=r=0;n<s;n++)i[n].nesting<0&&o--,i[n].level=o,i[n].nesting>0&&o++,i[n].type==="text"&&n+1<s&&i[n+1].type==="text"?i[n+1].content=i[n].content+i[n+1].content:(n!==r&&(i[r]=i[n]),r++);n!==r&&(i.length=r)},yd=ud,Rb=Je.isWhiteSpace,Qb=Je.isPunctChar,Fb=Je.isMdAsciiPunct;function aa(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}aa.prototype.pushPending=function(){var e=new yd("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},aa.prototype.push=function(e,t,n){this.pending&&this.pushPending();var r=new yd(e,t,n),o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(o),r},aa.prototype.scanDelims=function(e,t){var n=e,r,o,i,s,a,c,l,u,f,p=!0,d=!0,h=this.posMax,g=this.src.charCodeAt(e);for(r=e>0?this.src.charCodeAt(e-1):32;n<h&&this.src.charCodeAt(n)===g;)n++;return i=n-e,o=n<h?this.src.charCodeAt(n):32,l=Fb(r)||Qb(String.fromCharCode(r)),f=Fb(o)||Qb(String.fromCharCode(o)),c=Rb(r),u=Rb(o),u?p=!1:f&&(c||l||(p=!1)),c?d=!1:l&&(u||f||(d=!1)),t?(s=p,a=d):(s=p&&(!d||l),a=d&&(!p||f)),{can_open:s,can_close:a,length:i}},aa.prototype.Token=yd;var Dz=aa,Gb=ld,bd=[["text",oz],["linkify",sz],["newline",cz],["escape",uz],["backticks",fz],["strikethrough",Ml.tokenize],["emphasis",Ll.tokenize],["link",pz],["image",hz],["autolink",yz],["html_inline",Mz],["entity",kz]],wd=[["balance_pairs",Nz],["strikethrough",Ml.postProcess],["emphasis",Ll.postProcess],["fragments_join",Sz]];function ca(){var e;for(this.ruler=new Gb,e=0;e<bd.length;e++)this.ruler.push(bd[e][0],bd[e][1]);for(this.ruler2=new Gb,e=0;e<wd.length;e++)this.ruler2.push(wd[e][0],wd[e][1])}ca.prototype.skipToken=function(e){var t,n,r=e.pos,o=this.ruler.getRules(""),i=o.length,s=e.md.options.maxNesting,a=e.cache;if(typeof a[r]<"u"){e.pos=a[r];return}if(e.level<s){for(n=0;n<i;n++)if(e.level++,t=o[n](e,!0),e.level--,t){if(r>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;t||e.pos++,a[r]=e.pos},ca.prototype.tokenize=function(e){for(var t,n,r,o=this.ruler.getRules(""),i=o.length,s=e.posMax,a=e.md.options.maxNesting;e.pos<s;){if(r=e.pos,e.level<a){for(n=0;n<i;n++)if(t=o[n](e,!1),t){if(r>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(t){if(e.pos>=s)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},ca.prototype.parse=function(e,t,n,r){var o,i,s,a=new this.State(e,t,n,r);for(this.tokenize(a),i=this.ruler2.getRules(""),s=i.length,o=0;o<s;o++)i[o](a)},ca.prototype.State=Dz;var Oz=ca,Cd,Wb;function _z(){return Wb||(Wb=1,Cd=function(e){var t={};e=e||{},t.src_Any=ub().source,t.src_Cc=db().source,t.src_Z=hb().source,t.src_P=od.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");var n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}),Cd}function Id(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function xl(e){return Object.prototype.toString.call(e)}function Ez(e){return xl(e)==="[object String]"}function Pz(e){return xl(e)==="[object Object]"}function Az(e){return xl(e)==="[object RegExp]"}function Bb(e){return xl(e)==="[object Function]"}function zz(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var Zb={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Jz(e){return Object.keys(e||{}).reduce(function(t,n){return t||Zb.hasOwnProperty(n)},!1)}var Rz={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Qz="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Fz="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Gz(e){e.__index__=-1,e.__text_cache__=""}function Wz(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Hb(){return function(e,t){t.normalize(e)}}function Tl(e){var t=e.re=_z()(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Qz),n.push(t.src_xn),t.src_tlds=n.join("|");function r(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");var o=[];e.__compiled__={};function i(a,c){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+c)}Object.keys(e.__schemas__).forEach(function(a){var c=e.__schemas__[a];if(c!==null){var l={validate:null,link:null};if(e.__compiled__[a]=l,Pz(c)){Az(c.validate)?l.validate=Wz(c.validate):Bb(c.validate)?l.validate=c.validate:i(a,c),Bb(c.normalize)?l.normalize=c.normalize:c.normalize?i(a,c):l.normalize=Hb();return}if(Ez(c)){o.push(a);return}i(a,c)}}),o.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:Hb()};var s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(zz).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Gz(e)}function Bz(e,t){var n=e.__index__,r=e.__last_index__,o=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=o,this.text=o,this.url=o}function Md(e,t){var n=new Bz(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Ut(e,t){if(!(this instanceof Ut))return new Ut(e,t);t||Jz(e)&&(t=e,e={}),this.__opts__=Id({},Zb,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Id({},Rz,e),this.__compiled__={},this.__tlds__=Fz,this.__tlds_replaced__=!1,this.re={},Tl(this)}Ut.prototype.add=function(t,n){return this.__schemas__[t]=n,Tl(this),this},Ut.prototype.set=function(t){return this.__opts__=Id(this.__opts__,t),this},Ut.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var n,r,o,i,s,a,c,l,u;if(this.re.schema_test.test(t)){for(c=this.re.schema_search,c.lastIndex=0;(n=c.exec(t))!==null;)if(i=this.testSchemaAt(t,n[2],c.lastIndex),i){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=r.index+r[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(o=t.match(this.re.email_fuzzy))!==null&&(s=o.index+o[1].length,a=o.index+o[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=a))),this.__index__>=0},Ut.prototype.pretest=function(t){return this.re.pretest.test(t)},Ut.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0},Ut.prototype.match=function(t){var n=0,r=[];this.__index__>=0&&this.__text_cache__===t&&(r.push(Md(this,n)),n=this.__last_index__);for(var o=n?t.slice(n):t;this.test(o);)r.push(Md(this,n)),o=o.slice(this.__last_index__),n+=this.__last_index__;return r.length?r:null},Ut.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;var n=this.re.schema_at_start.exec(t);if(!n)return null;var r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Md(this,0)):null},Ut.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,o,i){return r!==i[o-1]}).reverse(),Tl(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Tl(this),this)},Ut.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},Ut.prototype.onCompile=function(){};var Zz=Ut;const Li=2147483647,Un=36,Ld=1,la=26,Hz=38,Vz=700,Vb=72,Ub=128,Yb="-",Uz=/^xn--/,Yz=/[^\0-\x7F]/,$z=/[\x2E\u3002\uFF0E\uFF61]/g,qz={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},xd=Un-Ld,Yn=Math.floor,Td=String.fromCharCode;function Wr(e){throw new RangeError(qz[e])}function Kz(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function $b(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace($z,".");const o=e.split("."),i=Kz(o,t).join(".");return r+i}function jd(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const i=e.charCodeAt(n++);(i&64512)==56320?t.push(((o&1023)<<10)+(i&1023)+65536):(t.push(o),n--)}else t.push(o)}return t}const qb=e=>String.fromCodePoint(...e),Xz=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Un},Kb=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Xb=function(e,t,n){let r=0;for(e=n?Yn(e/Vz):e>>1,e+=Yn(e/t);e>xd*la>>1;r+=Un)e=Yn(e/xd);return Yn(r+(xd+1)*e/(e+Hz))},kd=function(e){const t=[],n=e.length;let r=0,o=Ub,i=Vb,s=e.lastIndexOf(Yb);s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&Wr("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){const c=r;for(let u=1,f=Un;;f+=Un){a>=n&&Wr("invalid-input");const p=Xz(e.charCodeAt(a++));p>=Un&&Wr("invalid-input"),p>Yn((Li-r)/u)&&Wr("overflow"),r+=p*u;const d=f<=i?Ld:f>=i+la?la:f-i;if(p<d)break;const h=Un-d;u>Yn(Li/h)&&Wr("overflow"),u*=h}const l=t.length+1;i=Xb(r-c,l,c==0),Yn(r/l)>Li-o&&Wr("overflow"),o+=Yn(r/l),r%=l,t.splice(r++,0,o)}return String.fromCodePoint(...t)},Nd=function(e){const t=[];e=jd(e);const n=e.length;let r=Ub,o=0,i=Vb;for(const c of e)c<128&&t.push(Td(c));const s=t.length;let a=s;for(s&&t.push(Yb);a<n;){let c=Li;for(const u of e)u>=r&&u<c&&(c=u);const l=a+1;c-r>Yn((Li-o)/l)&&Wr("overflow"),o+=(c-r)*l,r=c;for(const u of e)if(u<r&&++o>Li&&Wr("overflow"),u===r){let f=o;for(let p=Un;;p+=Un){const d=p<=i?Ld:p>=i+la?la:p-i;if(f<d)break;const h=f-d,g=Un-d;t.push(Td(Kb(d+h%g,0))),f=Yn(h/g)}t.push(Td(Kb(f,0))),i=Xb(o,l,a===s),o=0,++a}++o,++r}return t.join("")},ew=function(e){return $b(e,function(t){return Uz.test(t)?kd(t.slice(4).toLowerCase()):t})},tw=function(e){return $b(e,function(t){return Yz.test(t)?"xn--"+Nd(t):t})},e9=ZM(Object.freeze(Object.defineProperty({__proto__:null,decode:kd,default:{version:"2.3.1",ucs2:{decode:jd,encode:qb},decode:kd,encode:Nd,toASCII:tw,toUnicode:ew},encode:Nd,toASCII:tw,toUnicode:ew,ucs2decode:jd,ucs2encode:qb},Symbol.toStringTag,{value:"Module"})));var t9={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},n9={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},r9={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},ua=Je,o9=ml,i9=X3,s9=M5,a9=nz,c9=Oz,l9=Zz,Io=wi,nw=e9,u9={default:t9,zero:n9,commonmark:r9},f9=/^(vbscript|javascript|file|data):/,d9=/^data:image\/(gif|png|jpeg|webp);/;function p9(e){var t=e.trim().toLowerCase();return f9.test(t)?!!d9.test(t):!0}var rw=["http:","https:","mailto:"];function g9(e){var t=Io.parse(e,!0);if(t.hostname&&(!t.protocol||rw.indexOf(t.protocol)>=0))try{t.hostname=nw.toASCII(t.hostname)}catch{}return Io.encode(Io.format(t))}function h9(e){var t=Io.parse(e,!0);if(t.hostname&&(!t.protocol||rw.indexOf(t.protocol)>=0))try{t.hostname=nw.toUnicode(t.hostname)}catch{}return Io.decode(Io.format(t),Io.decode.defaultChars+"%")}function un(e,t){if(!(this instanceof un))return new un(e,t);t||ua.isString(e)||(t=e||{},e="default"),this.inline=new c9,this.block=new a9,this.core=new s9,this.renderer=new i9,this.linkify=new l9,this.validateLink=p9,this.normalizeLink=g9,this.normalizeLinkText=h9,this.utils=ua,this.helpers=ua.assign({},o9),this.options={},this.configure(e),t&&this.set(t)}un.prototype.set=function(e){return ua.assign(this.options,e),this},un.prototype.configure=function(e){var t=this,n;if(ua.isString(e)&&(n=e,e=u9[n],!e))throw new Error('Wrong `markdown-it` preset "'+n+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&t[r].ruler.enableOnly(e.components[r].rules),e.components[r].rules2&&t[r].ruler2.enableOnly(e.components[r].rules2)}),this},un.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter(function(o){return n.indexOf(o)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},un.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){n=n.concat(this[o].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter(function(o){return n.indexOf(o)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},un.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},un.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},un.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},un.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},un.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var m9=un,v9=m9;const y9=Ro(v9);var Sd=(e=>(e.Assistant="assistant",e.System="system",e.User="user",e))(Sd||{}),fa=(e=>(e.Error="error",e.Loading="loading",e.Success="success",e))(fa||{});const b9={class:"message-content user"},w9={key:0,class:"time-message user"},C9=["innerHTML"],I9={class:"message-photo user"},M9=["src"],L9=Se("span",{class:"message-photo ai"},[Se("i",{class:"ai-blueking-icon ai-blueking-ai"})],-1),x9={class:"message-content ai"},T9={key:0,class:"time-message ai"},j9={key:2,width:"18",height:"18",class:"loading-message","aria-hidden":"true"},k9=[Se("use",{"xlink:href":"#ai-blueking-quanquan"},null,-1)],N9={key:3,class:"message-wrap"},S9=["innerHTML"],D9=mt({__name:"render-message",props:{message:{},userPhoto:{default:Ng}},setup(e){const t=e,n=jt(()=>{var s;const i={error:"ai-blueking-icon ai-blueking-warning-circle-fill",loading:"",success:""};return(s=t.message)!=null&&s.status?i[t.message.status]:""}),r=jt(()=>{if(t.message.content){const s=new y9({html:!0}).render(t.message.content);return N3.sanitize(s)}return""}),o=jt(()=>{const i=cl(t.message.time),s=cl();return t.message.time?s.isSame(i,"year")?i.format("MM-DD HH:mm:ss"):i.format("YYYY-MM-DD HH:mm:ss"):""});return(i,s)=>(Fe(),et("li",{class:Yr([i.message.role,"message-main"])},[i.message.role===Qe(Sd).User?(Fe(),et(rt,{key:0},[Se("p",b9,[o.value?(Fe(),et("span",w9,qn(o.value),1)):Tn("v-if",!0),Se("span",{class:"markdown-message",innerHTML:r.value},null,8,C9)]),Se("span",I9,[Se("img",{src:i.userPhoto},null,8,M9)])],64)):(Fe(),et(rt,{key:1},[L9,Se("p",x9,[o.value?(Fe(),et("span",T9,qn(o.value),1)):Tn("v-if",!0),n.value?(Fe(),et("i",{key:1,class:Yr(n.value)},null,2)):Tn("v-if",!0),i.message.status===Qe(fa).Loading?(Fe(),et("svg",j9,k9)):Tn("v-if",!0),i.message.status===Qe(fa).Error?(Fe(),et("span",N9,qn(i.message.content),1)):(Fe(),et("span",{key:4,innerHTML:r.value,class:Yr({"markdown-message":!0,loading:i.message.status===Qe(fa).Loading})},null,10,S9))])],64))],2))}}),O9={class:"prompt-list"},_9={class:"search-group"},E9=["onClick"],P9={class:"prompt-content"},A9=bi(mt({__name:"render-send",props:{prompts:{},placeholder:{},value:{}},emits:["update:value","enter","choose-prompt"],setup(e,{emit:t}){const n=e,r=t,o=YA,i=al,s=Qt(""),a=Qt(40),c=Qt(),l=Qt(!1),u=jt(()=>{var D;return((D=n.prompts)==null?void 0:D.filter(T=>T.content.includes(s.value)))||[]}),f=jt(()=>{var D;return n.placeholder?n.placeholder:(D=n.prompts)!=null&&D.length?nt("您可以键入 “/” 查看更多Prompt"):nt("请输入")}),p=D=>{r("update:value",D)},d=()=>{var D;n.value==="/"&&((D=n.prompts)!=null&&D.length)?j():A()},h=()=>{Do(()=>{var T;const D=(T=c.value)==null?void 0:T.$el.querySelector("textarea");(D==null?void 0:D.scrollHeight)>40&&n.value?a.value=D.scrollHeight<=300?D.scrollHeight:300:a.value=40})},g=D=>{r("update:value",D.content),r("choose-prompt",D),A(),N()},w=(D,T)=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),r("enter"))},v=()=>{p("")},N=()=>{var T;const D=(T=c.value)==null?void 0:T.$el.querySelector("textarea");D==null||D.focus()},j=()=>{l.value=!0},A=()=>{l.value=!1};return Ln(()=>n.value,()=>{h(),d()}),xn(N),(D,T)=>(Fe(),no(Qe(N0),{width:"calc(100% - 118px)","ext-cls":"empty-padding",arrow:!1,"is-show":l.value,"popover-delay":0,boundary:"parent",placement:"bottom",theme:"light",trigger:"manual"},{content:Ai(()=>{var $;return[Se("div",null,[pn((Fe(),et("section",O9,[Te(Qe(z0),{class:"input-search",modelValue:s.value,"onUpdate:modelValue":T[0]||(T[0]=Y=>s.value=Y),behavior:"simplicity",clearable:""},null,8,["modelValue"]),Se("section",_9,[(Fe(!0),et(rt,null,Sp(u.value,(Y,re)=>pn((Fe(),et("span",{class:"group-prompt",key:re,onClick:z=>g(Y)},[Se("span",P9,qn(Y.content),1)],8,E9)),[[Qe(i),{content:Y.content,placement:"right",theme:"light",width:300,zIndex:9999999,extCls:"prompt-popover"}]])),128)),($=u.value)!=null&&$.length?Tn("v-if",!0):(Fe(),no(Qe(KA),{key:0,class:"exception-wrap-item exception-part",scene:"part",type:"search-empty"}))])])),[[Qe(o),A]])])]}),default:Ai(()=>[Se("section",{style:Ur({"--text-height":a.value+"px"}),class:"send-prompt-container"},[Te(Qe(z0),{ref_key:"inputRef",ref:c,class:"send-prompt",autosize:!1,clearable:!0,"model-value":D.value,"native-attributes":{autofocus:"autofocus"},placeholder:f.value,row:"1",type:"textarea",onInput:p,onKeydown:w},null,8,["model-value","placeholder"]),D.value?(Fe(),no(Qe(ef),{key:0,class:"show-clear-only-hover bk-input--clear-icon clear-icon",onClick:v})):Tn("v-if",!0)],4)]),_:1},8,["is-show"]))}}),[["__scopeId","data-v-2374c5aa"]]),z9=(e=>(Zl("data-v-fd57f18d"),e=e(),Hl(),e))(()=>Se("svg",{width:"10",height:"10",class:"ai-blueking-render-stop-icon","aria-hidden":"true"},[Se("use",{"xlink:href":"#ai-blueking-tingzhi"})],-1)),J9=bi(mt({__name:"render-stop",props:{isShow:{type:Boolean}},emits:["stop"],setup(e,{emit:t}){const n=t,r=()=>{n("stop")};return(o,i)=>o.isShow?(Fe(),et("span",{key:0,class:"ai-blueking-render-stop",onClick:r},[z9,Eo(" "+qn(Qe(nt)("终止生成")),1)])):Tn("v-if",!0)}}),[["__scopeId","data-v-fd57f18d"]]),R9={key:0,class:"time-wrapper"},Q9={class:"time-message"},F9=bi(mt({__name:"render-time",props:{message:{}},setup(e){const t=e,n=jt(()=>{var s;const r=cl(t.message.time),o=cl(),i={0:nt("日"),1:nt("一"),2:nt("二"),3:nt("三"),4:nt("四"),5:nt("五"),6:nt("六")};return!t.message.time||(s=window.showTimes)!=null&&s.some(a=>Math.abs(r.diff(a,"minute"))<10&&a!==t.message.time)?"":(window.showTimes=[...window.showTimes||[],t.message.time],o.isSame(r,"day")?r.format("HH:mm:ss"):o.subtract(1,"day").isSame(r,"week")?nt("昨天")+" "+r.format("HH:mm:ss"):o.isSame(r,"week")?nt("本周")+i[r.day()]+" "+r.format("HH:mm:ss"):o.subtract(1,"week").isSame(r,"week")?nt("上周")+i[r.day()]+" "+r.format("HH:mm:ss"):o.isSame(r,"year")?r.format("MM-DD HH:mm:ss"):r.format("YYYY-MM-DD HH:mm:ss"))});return(r,o)=>n.value?(Fe(),et("section",R9,[Se("span",Q9,qn(n.value),1)])):Tn("v-if",!0)}}),[["__scopeId","data-v-55c9a119"]]),ow=e=>(Zl("data-v-6cc6ac8a"),e=e(),Hl(),e),G9={key:0,width:"18",height:"18",class:"scroll-loading-icon","aria-hidden":"true"},W9=[ow(()=>Se("use",{"xlink:href":"#ai-blueking-loading-2"},null,-1))],B9={class:"ai-operation"},Z9={class:"ai-operation-tools"},H9={class:"ai-operation-input"},V9=ow(()=>Se("i",{class:"ai-blueking-icon ai-blueking-fasong"},null,-1)),U9=bi(mt({__name:"render-content",props:{messages:{},prompts:{},loading:{type:Boolean},background:{default:"#f5f7fa"},userPhoto:{},placeholder:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean,default:!0}},emits:["send","choose-prompt","scroll-load","stop"],setup(e,{emit:t}){const n=e,r=t,o=al,i=Qt(""),s=()=>{Do(()=>{const p=document.querySelector(".ai-blueking-messages");p.scrollTop=p.scrollHeight})},a=r3(p=>{if(n.scrollLoading||n.scrollLoadingEnd)return;p.target.scrollTop<200&&r("scroll-load")}),c=()=>{if(i.value){if(n.loading){e3({theme:"warning",message:nt("内容正在执行中,请执行完成后再发送")});return}r("send",i.value),i.value=""}},l=p=>{r("choose-prompt",p)},u=()=>{r("stop")};Ln(()=>n.messages,()=>{const p=document.querySelector(".ai-blueking-messages");(p==null?void 0:p.scrollTop)+(p==null?void 0:p.clientHeight)+100>=(p==null?void 0:p.scrollHeight)&&s()},{deep:!0});const f=()=>{window.showTimes=[]};return xn(s),rr(f),(p,d)=>(Fe(),et("section",{style:Ur({background:p.background}),class:"ai-content"},[Se("ul",{class:"ai-messages ai-blueking-messages",onScrollPassive:d[0]||(d[0]=(...h)=>Qe(a)&&Qe(a)(...h))},[p.scrollLoading?(Fe(),et("svg",G9,W9)):Tn("v-if",!0),(Fe(!0),et(rt,null,Sp(p.messages,h=>(Fe(),et(rt,{key:h.content},[Te(F9,{class:"render-message",message:h},null,8,["message"]),Te(D9,{class:"render-message",message:h,"user-photo":p.userPhoto},null,8,["message","user-photo"])],64))),128))],32),Se("section",B9,[Se("span",Z9,[Te(c3),Te(J9,{"is-show":p.loading,onStop:u},null,8,["is-show"])]),Se("section",H9,[Te(A9,{value:i.value,"onUpdate:value":d[1]||(d[1]=h=>i.value=h),placeholder:p.placeholder,prompts:p.prompts,onChoosePrompt:l,onEnter:c},null,8,["value","placeholder","prompts"]),pn((Fe(),no(Qe(FE),{class:"ai-operation-button",disabled:p.loading||!i.value,size:"large",theme:"primary",onClick:c},{default:Ai(()=>[V9,Eo(" "+qn(Qe(nt)("发送")),1)]),_:1},8,["disabled"])),[[Qe(o),{content:Qe(nt)("内容正在执行中,请执行完成后再发送"),disabled:!p.loading}]])])])],4))}}),[["__scopeId","data-v-6cc6ac8a"]]),Y9={class:"ai-modal-header-icon"},$9=bi(mt({__name:"render-modal",props:{headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)"},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0})},sizeLimit:{default:()=>({height:320,width:400})},logo:{default:"ai-blueking-icon ai-blueking-ai"},name:{},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0})}},emits:["clear","close"],setup(e,{emit:t}){const n=e,r=t,o=al,i={height:window.innerHeight,width:window.innerWidth},s={isMove:!1,type:"",clientX:0,clientY:0},a=()=>{var te,_,k,L;const F=(R,Z)=>R===void 0?Z:R;return{top:F((te=n.startPosition)==null?void 0:te.top,i.height-n.sizeLimit.height),bottom:F((_=n.startPosition)==null?void 0:_.bottom,0),left:F((k=n.startPosition)==null?void 0:k.left,0),right:F((L=n.startPosition)==null?void 0:L.right,i.width-n.sizeLimit.width)}},c=Qt(a()),l=jt(()=>c.value.top<=n.positionLimit.top&&c.value.bottom<=n.positionLimit.bottom),u=F=>{s.isMove=!0,s.type="move",s.clientX=F.clientX,s.clientY=F.clientY},f=F=>{s.isMove=!0,s.type="rightDrag",s.clientX=F.clientX},p=F=>{s.isMove=!0,s.type="leftDrag",s.clientX=F.clientX},d=F=>{s.isMove=!0,s.type="topDrag",s.clientY=F.clientY},h=F=>{s.isMove=!0,s.type="bottomDrag",s.clientY=F.clientY},g=F=>{s.isMove=!0,s.type="topLeftDrag",s.clientY=F.clientY,s.clientX=F.clientX},w=F=>{s.isMove=!0,s.type="topRightDrag",s.clientY=F.clientY,s.clientX=F.clientX},v=F=>{s.isMove=!0,s.type="bottomLeftDrag",s.clientY=F.clientY,s.clientX=F.clientX},N=F=>{s.isMove=!0,s.type="bottomRightDrag",s.clientY=F.clientY,s.clientX=F.clientX},j=()=>{s.isMove=!1},A=(F,te)=>{["move","leftDrag"].includes(s.type)&&(c.value.left+=F),["move","rightDrag"].includes(s.type)&&(c.value.right-=F),["move","topDrag"].includes(s.type)&&(c.value.top+=te),["move","bottomDrag"].includes(s.type)&&(c.value.bottom-=te),["topLeftDrag"].includes(s.type)&&(c.value.left+=F,c.value.top+=te),["topRightDrag"].includes(s.type)&&(c.value.right-=F,c.value.top+=te),["bottomLeftDrag"].includes(s.type)&&(c.value.left+=F,c.value.bottom-=te),["bottomRightDrag"].includes(s.type)&&(c.value.right-=F,c.value.bottom-=te)},D=(F,te)=>{const{top:_,bottom:k,left:L,right:R}=c.value;(i.width-L-R<n.sizeLimit.width||L<n.positionLimit.left||R<n.positionLimit.right)&&(["move","leftDrag","topLeftDrag","bottomLeftDrag"].includes(s.type)&&(c.value.left-=F),["move","rightDrag","topRightDrag","bottomRightDrag"].includes(s.type)&&(c.value.right+=F)),(i.height-_-k<n.sizeLimit.height||_<n.positionLimit.top||k<n.positionLimit.bottom)&&(["move","topDrag","topRightDrag","topLeftDrag"].includes(s.type)&&(c.value.top-=te),["move","bottomDrag","bottomLeftDrag","bottomRightDrag"].includes(s.type)&&(c.value.bottom+=te))},T=F=>{if(!s.isMove)return;F.preventDefault();const te=F.clientX-s.clientX,_=F.clientY-s.clientY;A(te,_),D(te,_),s.clientX=F.clientX,s.clientY=F.clientY},$=()=>{i.height=window.innerHeight,i.width=window.innerWidth,c.value=a()},Y=()=>{c.value.top=n.positionLimit.top,c.value.bottom=n.positionLimit.bottom},re=()=>{c.value.top=i.height-n.sizeLimit.height,c.value.bottom=n.positionLimit.bottom},z=()=>{r("clear")},X=()=>{r("close")};return Np(()=>{window.addEventListener("mousemove",T,!0),window.addEventListener("mouseup",j),window.addEventListener("resize",$)}),rr(()=>{window.removeEventListener("mousemove",T,!0),window.removeEventListener("mouseup",j),window.removeEventListener("resize",$)}),(F,te)=>(Fe(),et("section",{style:Ur({top:c.value.top+"px",bottom:c.value.bottom+"px",left:c.value.left+"px",right:c.value.right+"px"}),class:"ai-modal"},[Se("header",{style:Ur({background:F.headBackground}),class:"ai-modal-header",onMousedown:or(u,["stop"])},[Se("span",Y9,[Se("i",{class:Yr(F.logo)},null,2),Eo(" "+qn(F.name||Qe(nt)("小鲸")),1)]),Se("span",null,[l.value?pn((Fe(),et("i",{key:0,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxiajuhe",onClick:re},null,512)),[[Qe(o),{content:Qe(nt)("向下收缩"),distance:20}]]):pn((Fe(),et("i",{key:1,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxialashen-2",onClick:Y},null,512)),[[Qe(o),{content:Qe(nt)("向上扩展"),distance:20}]]),pn(Se("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-saoba",onClick:z},null,512),[[Qe(o),{content:Qe(nt)("清空聊天记录"),distance:20}]]),pn(Se("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-shanchu-2",onClick:X},null,512),[[Qe(o),{content:Qe(nt)("关闭"),distance:20}]])])],36),jC(F.$slots,"default",{},void 0),Se("span",{class:"drag-line left",onMousedown:or(p,["stop"])},null,32),Se("span",{class:"drag-line right",onMousedown:or(f,["stop"])},null,32),Se("span",{class:"drag-line top",onMousedown:or(d,["stop"])},null,32),Se("span",{class:"drag-line bottom",onMousedown:or(h,["stop"])},null,32),Se("span",{class:"drag-line top-left-corner",onMousedown:or(g,["stop"])},null,32),Se("span",{class:"drag-line top-right-corner",onMousedown:or(w,["stop"])},null,32),Se("span",{class:"drag-line bottom-left-corner",onMousedown:or(v,["stop"])},null,32),Se("span",{class:"drag-line bottom-right-corner",onMousedown:or(N,["stop"])},null,32)],4))}}),[["__scopeId","data-v-e603010f"]]),q9=mt({__name:"ai-blueking",props:{messages:{},prompts:{},loading:{type:Boolean},headBackground:{},background:{},positionLimit:{},sizeLimit:{},startPosition:{},userPhoto:{},name:{},placeholder:{},logo:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean}},emits:["clear","close","scroll-load","stop","send","choose-prompt"],setup(e,{emit:t}){const n=t,r=()=>{n("clear")},o=()=>{n("close")},i=l=>{n("send",l)},s=()=>{n("stop")},a=()=>{n("scroll-load")},c=l=>{n("choose-prompt",l)};return(l,u)=>(Fe(),no($9,{"head-background":l.headBackground,logo:l.logo,name:l.name,"position-limit":l.positionLimit,"size-limit":l.sizeLimit,"start-position":l.startPosition,onClear:r,onClose:o},{default:Ai(()=>[Te(U9,{background:l.background,loading:l.loading,messages:l.messages,placeholder:l.placeholder,prompts:l.prompts,"scroll-loading":l.scrollLoading,"scroll-loading-end":l.scrollLoadingEnd,"user-photo":l.userPhoto,onChoosePrompt:c,onScrollLoad:a,onSend:i,onStop:s},null,8,["background","loading","messages","placeholder","prompts","scroll-loading","scroll-loading-end","user-photo"])]),_:1},8,["head-background","logo","name","position-limit","size-limit","start-position"]))}});(function(){var e='<svg xmlns="http://www.w3.org/2000/svg" data-name="ai-blueking" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0;visibility:hidden"><symbol id="ai-blueking-check-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-26.3 606.3l-181-181L350 444l135.8 135.8L712 353.5l45.3 45.3-271.6 271.5z"/></symbol><symbol id="ai-blueking-close-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm158.4 561.1l-45.3 45.3L512 557.3 398.9 670.4l-45.3-45.3L466.7 512 353.6 398.9l45.3-45.3L512 466.7l113.1-113.1 45.3 45.3L557.3 512l113.1 113.1z"/></symbol><symbol id="ai-blueking-warning-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 640h-64v-64h64v64zm0-128h-64V320h64v256z"/></symbol><symbol id="ai-blueking-loading-2" viewBox="0 0 1024 1024"><path d="M195.2 195.2a64 64 0 000 90.56l44.8 45.28A64 64 0 00331.04 240l-45.28-44.8a64 64 0 00-90.56 0z" opacity=".1"/><path d="M128 576h64a64 64 0 000-128h-64a64 64 0 000 128z" opacity=".15"/><path d="M285.76 828.8l45.28-44.8A64 64 0 00240 692.96l-44.8 45.28a64 64 0 0090.56 90.56z" opacity=".3"/><path d="M576 896v-64a64 64 0 00-128 0v64a64 64 0 00128 0z" opacity=".45"/><path d="M828.8 828.8a64 64 0 000-90.56L784 692.96A64 64 0 00692.96 784l45.28 45.28a64 64 0 0090.56-.48z" opacity=".6"/><path d="M896 448h-64a64 64 0 000 128h64a64 64 0 000-128z" opacity=".75"/><path d="M738.24 195.2L692.96 240A64 64 0 00784 331.04l45.28-45.28a64 64 0 10-90.56-90.56z" opacity=".9"/><path d="M448 128v64a64 64 0 00128 0v-64a64 64 0 00-128 0z"/></g></symbol><symbol id="ai-blueking-ai" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M928 96v448l-1.211-.014C910.455 758.791 730.989 928 512 928 282.25 928 96 741.75 96 512S282.25 96 512 96h416zM488.911 320H379.544L256 672h84.05l23.292-71.909h137.215L523.342 672h87.088L488.911 320zM736 320h-79.494v352H736V320zm-303.797 66.88l47.594 148.343h-95.696l48.102-148.343z"/></symbol><symbol id="ai-blueking-fasong" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M924.55 113.365c0-.09-.088-.09-.088-.18a30.217 30.217 0 00-7.78-9.684 31.929 31.929 0 00-10.606-5.918c-.089 0-.177-.09-.266-.09-1.502-.537-3.093-.806-4.685-1.075-.442-.09-.884-.27-1.414-.27-1.503-.179-2.917-.179-4.42-.09-.618 0-1.149-.089-1.768 0-4.242.27-8.485 1.525-12.375 3.498L113.792 485.577c-7.514 3.677-13.26 10.312-15.911 18.382-.796 2.242-1.15 4.663-1.415 6.994-.795 4.753-.618 9.685.884 14.347 2.475 8.16 8.044 14.885 15.558 18.741l194.734 103.836c4.685 2.51 9.812 3.766 15.115 3.766 11.757.09 22.541-6.367 28.287-16.768 8.397-15.513 2.475-34.791-13.083-43.13l-142.316-75.86 572.358-288.014L418.93 634.516c-.265.27-.354.628-.619.897-8.662 5.739-14.32 15.423-14.32 26.542v234.123a32.598 32.598 0 009.547 22.686c6.01 6.008 14.143 9.236 22.54 9.146v.09c17.68 0 32-14.257 32-31.832V675.405l381.07-444.127-79.202 585.802-200.921-97.917c-15.823-7.712-34.828-1.255-42.872 14.526-3.712 7.622-4.243 16.41-1.503 24.48s8.575 14.615 16.177 18.202l238.754 116.48c4.42 2.151 9.193 3.227 14.144 3.227.176 0 .353-.09.53-.09.53 0 1.15.18 1.68.18 15.91.09 29.435-11.657 31.733-27.618l99.003-731.782c2.21-7.532 1.767-15.871-2.122-23.403z"/></symbol><symbol id="ai-blueking-shangxialashen-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 64L352 251.52l127.168-.672.928 223.968h.352l.832 298.656-127.168.736L513.792 960 672 772.448l-127.136.704-.928-320h-.384l-.8-202.656 127.168-.704z"/></symbol><symbol id="ai-blueking-shangxiajuhe" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 384L352 192l317.92 1.77L510.24 384zm1.44 256l158.24 192L352 830.23 511.68 640zM128 480h768v64H128z"/></symbol><symbol id="ai-blueking-shanchu-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M832 259.2L764.8 192 512 444.8 259.2 192 192 259.2 444.8 512 192 764.8l67.2 67.2L512 579.2 764.8 832l67.2-67.2L579.2 512z"/></symbol><symbol id="ai-blueking-saoba" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M566.857 64C607.253 64 640 92.654 640 128v96h256c35.346 0 64 28.654 64 64v96c0 35.346-28.654 64-64 64h-5.818v332.453l21.56 102.356c7.284 34.587-14.848 68.532-49.436 75.817a64 64 0 01-13.19 1.374H175.262c-35.346 0-64-28.654-64-64a64 64 0 011.436-13.484l21.12-97.989V448H128c-35.346 0-64-28.654-64-64v-96c0-35.346 28.654-64 64-64h256v-96c0-35.346 32.747-64 73.143-64h109.714zm259.325 384H197.818v343.346l-1.436 6.665L175.262 896H320V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h145.115l-21.559-102.356-1.374-6.524V448zM896 288H128v96h768v-96zM566.857 128H457.143v96h109.714v-96z"/></symbol><symbol id="ai-blueking-quanquan" viewBox="0 0 1024 1024"><path fill="#3A84FF" d="M512 64.129c-9.343-.661-18.345 3.338-27.005 11.998-2.666 2.667-4.831 6.165-6.495 10.495-1.664 4.33-2.496 7.498-2.496 9.503v4c0 10.004 2.997 18.003 8.991 23.997 3.328 4.01 7.327 6.847 11.999 8.511 4.671 1.664 8.34 2.496 11.006 2.496h4c68.003 0 130.993 16.83 188.97 50.49 57.978 33.66 103.807 79.49 137.489 137.488 33.681 57.999 50.511 121.16 50.49 189.483-.021 68.322-16.851 131.313-50.49 188.97-33.64 57.657-79.469 103.316-137.489 136.976-58.02 33.66-121.18 50.49-189.482 50.49-68.301 0-131.292-16.83-188.97-50.49-57.68-33.66-103.338-79.319-136.977-136.976-33.639-57.657-50.469-120.818-50.49-189.482 0-10.005-3.669-18.676-11.007-26.013-2.666-3.328-6.164-5.824-10.494-7.487-4.33-1.664-7.498-2.496-9.503-2.496h-4c-10.004 0-18.334 3.338-24.99 10.015-4.01 4.01-6.846 8.18-8.51 12.51-1.664 4.33-2.496 7.498-2.496 9.503v4c0 60.665 11.828 118.663 35.484 173.996 23.656 55.332 55.482 102.996 95.477 142.991 39.996 39.996 87.66 71.822 142.992 95.478 55.332 23.656 113.33 35.483 173.996 35.483 60.665 0 118.664-11.827 173.996-35.483 55.332-23.656 102.996-55.482 142.992-95.478 39.995-39.995 71.82-87.659 95.477-142.991 23.656-55.333 35.484-113.331 35.484-173.996 0-60.665-11.828-118.664-35.484-173.996-23.656-55.333-55.482-102.997-95.477-142.992-39.996-39.996-87.66-71.821-142.992-95.477C630.664 75.989 572.666 64.16 512 64.16v-.032z"/></symbol><symbol id="ai-blueking-xiangxia-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M176 617.6l92.8-89.6 182.4 179.2V112h121.6v595.2L755.2 528l92.8 89.6L512 944 176 617.6z" clip-rule="evenodd"/></symbol><symbol id="ai-blueking-tingzhi" viewBox="0 0 1024 1024"><path fill="#fdd" d="M256 256h512v512H256V256z"/><path fill="#ea3636" d="M128 128v768h768V128H128zm640 640H256V256h512v512z"/></symbol></svg>';document.body?document.body.insertAdjacentHTML("afterbegin",e):document.addEventListener("DOMContentLoaded",function(){document.body.insertAdjacentHTML("afterbegin",e)})})();class K9{constructor(t,n,r,o,i){To(this,"controllerMap");To(this,"handleEnd");To(this,"handleError");To(this,"handleReceiveMessage");To(this,"handleStart");To(this,"url");this.url=t,this.handleStart=n,this.handleReceiveMessage=r,this.handleEnd=o,this.handleError=i,this.controllerMap={}}stop(t){var n,r;return(r=(n=this.controllerMap[t])==null?void 0:n.abort)==null||r.call(n),this.handleEnd(t)}async stream(t,n,r){const o=new AbortController;this.controllerMap[n]=o,fetch(this.url,{method:"post",signal:o.signal,headers:{"Content-Type":"application/json",...r},mode:"cors",credentials:"include",body:JSON.stringify(t)}).then(async i=>{const s=i.body.pipeThrough(new window.TextDecoderStream).getReader();for(;;)try{const{value:a,done:c}=await s.read();if(!i.ok){this.handleError(a||i.statusText,i.status,n);break}if(c)break;a.toString().split(`
|
|
289
289
|
`).forEach(u=>{const f=u.replace("data:","").trim();if(n3(f)){const{event:p,content:d,result:h,code:g,message:w}=JSON.parse(f);if(h===!1||i.status!==200){this.handleError(w,g,n);return}switch(p){case"text":this.handleReceiveMessage(d,n);break;case"done":this.handleEnd(n);break;case"error":this.handleError(w,g,n);break}}})}catch(a){(a==null?void 0:a.code)!==20&&this.handleError(a.message,a.code,n);break}}).catch(i=>{(i==null?void 0:i.code)!==20&&this.handleError(i.message,i.code,n)}),await this.handleStart(n)}}NO({prefix:"ai-blueking"});const X9={name:"AiBlueking",render(e){return e("div",{style:{width:"100%"}})},props:{messages:{default:()=>[],type:Array},prompts:{default:()=>[],type:Array},loading:{default:!1,type:Boolean},headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)",type:String},background:{default:"#f5f7fa",type:String},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0}),type:Object},sizeLimit:{default:()=>({height:320,width:400}),type:Object},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0}),type:Object},userPhoto:{default:Ng,type:String},logo:{default:"ai-blueking-icon ai-blueking-ai",type:String},name:{default:"",type:String},placeholder:{default:"",type:String},scrollLoading:{default:!1,type:Boolean},scrollLoadingEnd:{default:!0,type:Boolean}},data(){return{app:null,unWatchStack:[]}},watch:{messages:{handler(){setTimeout(()=>{const e=document.querySelector(".ai-blueking-messages");(e==null?void 0:e.scrollTop)+(e==null?void 0:e.clientHeight)+100>=(e==null?void 0:e.scrollHeight)&&(e.scrollTop=e.scrollHeight)},10)},deep:!0}},created(){const e=this.$emit.bind(this);let t=null;const n=this;this.app=Wa({render(){return t=this,pt(q9,{messages:JSON.parse(JSON.stringify(n.messages)),prompts:n.prompts,loading:n.loading,headBackground:n.headBackground,background:n.background,positionLimit:n.positionLimit,sizeLimit:n.sizeLimit,userPhoto:n.userPhoto,logo:n.logo,name:n.name,placeholder:n.placeholder,startPosition:n.startPosition,scrollLoading:n.scrollLoading,scrollLoadingEnd:n.scrollLoadingEnd,onClear(){e("clear",...arguments)},onClose(){e("close",...arguments)},onSend(){e("send",...arguments)},onChoosePrompt(){e("choose-prompt",...arguments)},onStop(){e("stop",...arguments)},onScrollLoad(){e("scroll-load",...arguments)},...n.$attrs})}}),this.unWatchStack=Object.keys(this.$props).map(r=>this.$watch(r,()=>{t.$forceUpdate()},{deep:!0}))},mounted(){var e;(e=this.app)==null||e.mount(this.$el)},beforeDestroy(){var e;this.unWatchStack.forEach(t=>t==null?void 0:t()),(e=this.app)==null||e.unmount()}};return qt.ChatHelper=K9,qt.MessageStatus=fa,qt.RoleType=Sd,qt.default=X9,Object.defineProperties(qt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),qt}({});
|