@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.
@@ -16,5 +16,5 @@
16
16
  `:">",o)},ve.prototype.renderInline=function(r,e,t){for(var n,s="",o=this.rules,c=0,i=r.length;c<i;c++)n=r[c].type,typeof o[n]<"u"?s+=o[n](r,c,e,t,this):s+=this.renderToken(r,c,e);return s},ve.prototype.renderInlineAsText=function(r,e,t){for(var n="",s=0,o=r.length;s<o;s++)r[s].type==="text"?n+=r[s].content:r[s].type==="image"?n+=this.renderInlineAsText(r[s].children,e,t):r[s].type==="softbreak"&&(n+=`
17
17
  `);return n},ve.prototype.render=function(r,e,t){var n,s,o,c="",i=this.rules;for(n=0,s=r.length;n<s;n++)o=r[n].type,o==="inline"?c+=this.renderInline(r[n].children,e,t):typeof i[o]<"u"?c+=i[o](r,n,e,t,this):c+=this.renderToken(r,n,e,t);return c};var ts=ve;function ce(){this.__rules__=[],this.__cache__=null}ce.prototype.__find__=function(r){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===r)return e;return-1},ce.prototype.__compile__=function(){var r=this,e=[""];r.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(n){e.indexOf(n)<0&&e.push(n)})}),r.__cache__={},e.forEach(function(t){r.__cache__[t]=[],r.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||r.__cache__[t].push(n.fn))})})},ce.prototype.at=function(r,e,t){var n=this.__find__(r),s=t||{};if(n===-1)throw new Error("Parser rule not found: "+r);this.__rules__[n].fn=e,this.__rules__[n].alt=s.alt||[],this.__cache__=null},ce.prototype.before=function(r,e,t,n){var s=this.__find__(r),o=n||{};if(s===-1)throw new Error("Parser rule not found: "+r);this.__rules__.splice(s,0,{name:e,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},ce.prototype.after=function(r,e,t,n){var s=this.__find__(r),o=n||{};if(s===-1)throw new Error("Parser rule not found: "+r);this.__rules__.splice(s+1,0,{name:e,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},ce.prototype.push=function(r,e,t){var n=t||{};this.__rules__.push({name:r,enabled:!0,fn:e,alt:n.alt||[]}),this.__cache__=null},ce.prototype.enable=function(r,e){Array.isArray(r)||(r=[r]);var t=[];return r.forEach(function(n){var s=this.__find__(n);if(s<0){if(e)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[s].enabled=!0,t.push(n)},this),this.__cache__=null,t},ce.prototype.enableOnly=function(r,e){Array.isArray(r)||(r=[r]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(r,e)},ce.prototype.disable=function(r,e){Array.isArray(r)||(r=[r]);var t=[];return r.forEach(function(n){var s=this.__find__(n);if(s<0){if(e)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[s].enabled=!1,t.push(n)},this),this.__cache__=null,t},ce.prototype.getRules=function(r){return this.__cache__===null&&this.__compile__(),this.__cache__[r]||[]};var Lt=ce,rs=/\r\n?|\n/g,ns=/\0/g,os=function(e){var t;t=e.src.replace(rs,`
18
18
  `),t=t.replace(ns,"�"),e.src=t},ss=function(e){var t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)},cs=function(e){var t=e.tokens,n,s,o;for(s=0,o=t.length;s<o;s++)n=t[s],n.type==="inline"&&e.md.inline.parse(n.content,e.md,e.env,n.children)},is=I.arrayReplaceAt;function as(r){return/^<a[>\s]/i.test(r)}function ls(r){return/^<\/a\s*>/i.test(r)}var As=function(e){var t,n,s,o,c,i,a,l,u,d,f,h,k,x,B,v,w=e.tokens,y;if(e.md.options.linkify){for(n=0,s=w.length;n<s;n++)if(!(w[n].type!=="inline"||!e.md.linkify.pretest(w[n].content)))for(o=w[n].children,k=0,t=o.length-1;t>=0;t--){if(i=o[t],i.type==="link_close"){for(t--;o[t].level!==i.level&&o[t].type!=="link_open";)t--;continue}if(i.type==="html_inline"&&(as(i.content)&&k>0&&k--,ls(i.content)&&k++),!(k>0)&&i.type==="text"&&e.md.linkify.test(i.content)){for(u=i.content,y=e.md.linkify.match(u),a=[],h=i.level,f=0,y.length>0&&y[0].index===0&&t>0&&o[t-1].type==="text_special"&&(y=y.slice(1)),l=0;l<y.length;l++)x=y[l].url,B=e.md.normalizeLink(x),e.md.validateLink(B)&&(v=y[l].text,y[l].schema?y[l].schema==="mailto:"&&!/^mailto:/i.test(v)?v=e.md.normalizeLinkText("mailto:"+v).replace(/^mailto:/,""):v=e.md.normalizeLinkText(v):v=e.md.normalizeLinkText("http://"+v).replace(/^http:\/\//,""),d=y[l].index,d>f&&(c=new e.Token("text","",0),c.content=u.slice(f,d),c.level=h,a.push(c)),c=new e.Token("link_open","a",1),c.attrs=[["href",B]],c.level=h++,c.markup="linkify",c.info="auto",a.push(c),c=new e.Token("text","",0),c.content=v,c.level=h,a.push(c),c=new e.Token("link_close","a",-1),c.level=--h,c.markup="linkify",c.info="auto",a.push(c),f=y[l].lastIndex);f<u.length&&(c=new e.Token("text","",0),c.content=u.slice(f),c.level=h,a.push(c)),w[n].children=o=is(o,t,a)}}}},Pr=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,us=/\((c|tm|r)\)/i,ps=/\((c|tm|r)\)/ig,fs={c:"©",r:"®",tm:"™"};function ds(r,e){return fs[e.toLowerCase()]}function hs(r){var e,t,n=0;for(e=r.length-1;e>=0;e--)t=r[e],t.type==="text"&&!n&&(t.content=t.content.replace(ps,ds)),t.type==="link_open"&&t.info==="auto"&&n--,t.type==="link_close"&&t.info==="auto"&&n++}function ms(r){var e,t,n=0;for(e=r.length-1;e>=0;e--)t=r[e],t.type==="text"&&!n&&Pr.test(t.content)&&(t.content=t.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–")),t.type==="link_open"&&t.info==="auto"&&n--,t.type==="link_close"&&t.info==="auto"&&n++}var gs=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(us.test(e.tokens[t].content)&&hs(e.tokens[t].children),Pr.test(e.tokens[t].content)&&ms(e.tokens[t].children))},Qr=I.isWhiteSpace,Ur=I.isPunctChar,Hr=I.isMdAsciiPunct,bs=/['"]/,Or=/['"]/g,Vr="’";function nt(r,e,t){return r.slice(0,e)+t+r.slice(e+1)}function ks(r,e){var t,n,s,o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E,m;for(L=[],t=0;t<r.length;t++){for(n=r[t],a=r[t].level,w=L.length-1;w>=0&&!(L[w].level<=a);w--);if(L.length=w+1,n.type==="text"){s=n.content,c=0,i=s.length;e:for(;c<i&&(Or.lastIndex=c,o=Or.exec(s),!!o);){if(B=v=!0,c=o.index+1,y=o[0]==="'",u=32,o.index-1>=0)u=s.charCodeAt(o.index-1);else for(w=t-1;w>=0&&!(r[w].type==="softbreak"||r[w].type==="hardbreak");w--)if(r[w].content){u=r[w].content.charCodeAt(r[w].content.length-1);break}if(d=32,c<i)d=s.charCodeAt(c);else for(w=t+1;w<r.length&&!(r[w].type==="softbreak"||r[w].type==="hardbreak");w++)if(r[w].content){d=r[w].content.charCodeAt(0);break}if(f=Hr(u)||Ur(String.fromCharCode(u)),h=Hr(d)||Ur(String.fromCharCode(d)),k=Qr(u),x=Qr(d),x?B=!1:h&&(k||f||(B=!1)),k?v=!1:f&&(x||h||(v=!1)),d===34&&o[0]==='"'&&u>=48&&u<=57&&(v=B=!1),B&&v&&(B=f,v=h),!B&&!v){y&&(n.content=nt(n.content,o.index,Vr));continue}if(v){for(w=L.length-1;w>=0&&(l=L[w],!(L[w].level<a));w--)if(l.single===y&&L[w].level===a){l=L[w],y?(E=e.md.options.quotes[2],m=e.md.options.quotes[3]):(E=e.md.options.quotes[0],m=e.md.options.quotes[1]),n.content=nt(n.content,o.index,m),r[l.token].content=nt(r[l.token].content,l.pos,E),c+=m.length-1,l.token===t&&(c+=E.length-1),s=n.content,i=s.length,L.length=w;continue e}}B?L.push({token:t,pos:o.index,single:y,level:a}):v&&y&&(n.content=nt(n.content,o.index,Vr))}}}}var ws=function(e){var t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!bs.test(e.tokens[t].content)||ks(e.tokens[t].children,e)},xs=function(e){var t,n,s,o,c,i,a=e.tokens;for(t=0,n=a.length;t<n;t++)if(a[t].type==="inline"){for(s=a[t].children,c=s.length,o=0;o<c;o++)s[o].type==="text_special"&&(s[o].type="text");for(o=i=0;o<c;o++)s[o].type==="text"&&o+1<c&&s[o+1].type==="text"?s[o+1].content=s[o].content+s[o+1].content:(o!==i&&(s[i]=s[o]),i++);o!==i&&(s.length=i)}};function _e(r,e,t){this.type=r,this.tag=e,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}_e.prototype.attrIndex=function(e){var t,n,s;if(!this.attrs)return-1;for(t=this.attrs,n=0,s=t.length;n<s;n++)if(t[n][0]===e)return n;return-1},_e.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},_e.prototype.attrSet=function(e,t){var n=this.attrIndex(e),s=[e,t];n<0?this.attrPush(s):this.attrs[n]=s},_e.prototype.attrGet=function(e){var t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},_e.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t};var Tt=_e,Es=Tt;function Gr(r,e,t){this.src=r,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}Gr.prototype.Token=Es;var ys=Gr,vs=Lt,qt=[["normalize",os],["block",ss],["inline",cs],["linkify",As],["replacements",gs],["smartquotes",ws],["text_join",xs]];function Mt(){this.ruler=new vs;for(var r=0;r<qt.length;r++)this.ruler.push(qt[r][0],qt[r][1])}Mt.prototype.process=function(r){var e,t,n;for(n=this.ruler.getRules(""),e=0,t=n.length;e<t;e++)n[e](r)},Mt.prototype.State=ys;var _s=Mt,Rt=I.isSpace;function It(r,e){var t=r.bMarks[e]+r.tShift[e],n=r.eMarks[e];return r.src.slice(t,n)}function Yr(r){var e=[],t=0,n=r.length,s,o=!1,c=0,i="";for(s=r.charCodeAt(t);t<n;)s===124&&(o?(i+=r.substring(c,t-1),c=t):(e.push(i+r.substring(c,t)),i="",c=t+1)),o=s===92,t++,s=r.charCodeAt(t);return e.push(i+r.substring(c)),e}var Cs=function(e,t,n,s){var o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E,m;if(t+2>n||(u=t+1,e.sCount[u]<e.blkIndent)||e.sCount[u]-e.blkIndent>=4||(i=e.bMarks[u]+e.tShift[u],i>=e.eMarks[u])||(E=e.src.charCodeAt(i++),E!==124&&E!==45&&E!==58)||i>=e.eMarks[u]||(m=e.src.charCodeAt(i++),m!==124&&m!==45&&m!==58&&!Rt(m))||E===45&&Rt(m))return!1;for(;i<e.eMarks[u];){if(o=e.src.charCodeAt(i),o!==124&&o!==45&&o!==58&&!Rt(o))return!1;i++}for(c=It(e,t+1),d=c.split("|"),k=[],a=0;a<d.length;a++){if(x=d[a].trim(),!x){if(a===0||a===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(x))return!1;x.charCodeAt(x.length-1)===58?k.push(x.charCodeAt(0)===58?"center":"right"):x.charCodeAt(0)===58?k.push("left"):k.push("")}if(c=It(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4||(d=Yr(c),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),f=d.length,f===0||f!==k.length))return!1;if(s)return!0;for(w=e.parentType,e.parentType="table",L=e.md.block.ruler.getRules("blockquote"),h=e.push("table_open","table",1),h.map=B=[t,0],h=e.push("thead_open","thead",1),h.map=[t,t+1],h=e.push("tr_open","tr",1),h.map=[t,t+1],a=0;a<d.length;a++)h=e.push("th_open","th",1),k[a]&&(h.attrs=[["style","text-align:"+k[a]]]),h=e.push("inline","",0),h.content=d[a].trim(),h.children=[],h=e.push("th_close","th",-1);for(h=e.push("tr_close","tr",-1),h=e.push("thead_close","thead",-1),u=t+2;u<n&&!(e.sCount[u]<e.blkIndent);u++){for(y=!1,a=0,l=L.length;a<l;a++)if(L[a](e,u,n,!0)){y=!0;break}if(y||(c=It(e,u).trim(),!c)||e.sCount[u]-e.blkIndent>=4)break;for(d=Yr(c),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),u===t+2&&(h=e.push("tbody_open","tbody",1),h.map=v=[t+2,0]),h=e.push("tr_open","tr",1),h.map=[u,u+1],a=0;a<f;a++)h=e.push("td_open","td",1),k[a]&&(h.attrs=[["style","text-align:"+k[a]]]),h=e.push("inline","",0),h.content=d[a]?d[a].trim():"",h.children=[],h=e.push("td_close","td",-1);h=e.push("tr_close","tr",-1)}return v&&(h=e.push("tbody_close","tbody",-1),v[1]=u),h=e.push("table_close","table",-1),B[1]=u,e.parentType=w,e.line=u,!0},Ds=function(e,t,n){var s,o,c;if(e.sCount[t]-e.blkIndent<4)return!1;for(o=s=t+1;s<n;){if(e.isEmpty(s)){s++;continue}if(e.sCount[s]-e.blkIndent>=4){s++,o=s;continue}break}return e.line=o,c=e.push("code_block","code",0),c.content=e.getLines(t,o,4+e.blkIndent,!1)+`
19
- `,c.map=[t,e.line],!0},Bs=function(e,t,n,s){var o,c,i,a,l,u,d,f=!1,h=e.bMarks[t]+e.tShift[t],k=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||h+3>k||(o=e.src.charCodeAt(h),o!==126&&o!==96)||(l=h,h=e.skipChars(h,o),c=h-l,c<3)||(d=e.src.slice(l,h),i=e.src.slice(h,k),o===96&&i.indexOf(String.fromCharCode(o))>=0))return!1;if(s)return!0;for(a=t;a++,!(a>=n||(h=l=e.bMarks[a]+e.tShift[a],k=e.eMarks[a],h<k&&e.sCount[a]<e.blkIndent));)if(e.src.charCodeAt(h)===o&&!(e.sCount[a]-e.blkIndent>=4)&&(h=e.skipChars(h,o),!(h-l<c)&&(h=e.skipSpaces(h),!(h<k)))){f=!0;break}return c=e.sCount[t],e.line=a+(f?1:0),u=e.push("fence","code",0),u.info=i,u.content=e.getLines(t+1,a,c,!0),u.markup=d,u.map=[t,e.line],!0},Ss=I.isSpace,Ls=function(e,t,n,s){var o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E,m,R,N,K=e.lineMax,T=e.bMarks[t]+e.tShift[t],j=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(T)!==62)return!1;if(s)return!0;for(k=[],x=[],w=[],y=[],m=e.md.block.ruler.getRules("blockquote"),v=e.parentType,e.parentType="blockquote",f=t;f<n&&(N=e.sCount[f]<e.blkIndent,T=e.bMarks[f]+e.tShift[f],j=e.eMarks[f],!(T>=j));f++){if(e.src.charCodeAt(T++)===62&&!N){for(a=e.sCount[f]+1,e.src.charCodeAt(T)===32?(T++,a++,o=!1,L=!0):e.src.charCodeAt(T)===9?(L=!0,(e.bsCount[f]+a)%4===3?(T++,a++,o=!1):o=!0):L=!1,h=a,k.push(e.bMarks[f]),e.bMarks[f]=T;T<j&&(c=e.src.charCodeAt(T),Ss(c));){c===9?h+=4-(h+e.bsCount[f]+(o?1:0))%4:h++;T++}u=T>=j,x.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(L?1:0),w.push(e.sCount[f]),e.sCount[f]=h-a,y.push(e.tShift[f]),e.tShift[f]=T-e.bMarks[f];continue}if(u)break;for(E=!1,i=0,l=m.length;i<l;i++)if(m[i](e,f,n,!0)){E=!0;break}if(E){e.lineMax=f,e.blkIndent!==0&&(k.push(e.bMarks[f]),x.push(e.bsCount[f]),y.push(e.tShift[f]),w.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}k.push(e.bMarks[f]),x.push(e.bsCount[f]),y.push(e.tShift[f]),w.push(e.sCount[f]),e.sCount[f]=-1}for(B=e.blkIndent,e.blkIndent=0,R=e.push("blockquote_open","blockquote",1),R.markup=">",R.map=d=[t,0],e.md.block.tokenize(e,t,f),R=e.push("blockquote_close","blockquote",-1),R.markup=">",e.lineMax=K,e.parentType=v,d[1]=e.line,i=0;i<y.length;i++)e.bMarks[i+t]=k[i],e.tShift[i+t]=y[i],e.sCount[i+t]=w[i],e.bsCount[i+t]=x[i];return e.blkIndent=B,!0},Ts=I.isSpace,qs=function(e,t,n,s){var o,c,i,a,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(o=e.src.charCodeAt(l++),o!==42&&o!==45&&o!==95))return!1;for(c=1;l<u;){if(i=e.src.charCodeAt(l++),i!==o&&!Ts(i))return!1;i===o&&c++}return c<3?!1:(s||(e.line=t+1,a=e.push("hr","hr",0),a.map=[t,e.line],a.markup=Array(c+1).join(String.fromCharCode(o))),!0)},Zr=I.isSpace;function jr(r,e){var t,n,s,o;return n=r.bMarks[e]+r.tShift[e],s=r.eMarks[e],t=r.src.charCodeAt(n++),t!==42&&t!==45&&t!==43||n<s&&(o=r.src.charCodeAt(n),!Zr(o))?-1:n}function Jr(r,e){var t,n=r.bMarks[e]+r.tShift[e],s=n,o=r.eMarks[e];if(s+1>=o||(t=r.src.charCodeAt(s++),t<48||t>57))return-1;for(;;){if(s>=o)return-1;if(t=r.src.charCodeAt(s++),t>=48&&t<=57){if(s-n>=10)return-1;continue}if(t===41||t===46)break;return-1}return s<o&&(t=r.src.charCodeAt(s),!Zr(t))?-1:s}function Ms(r,e){var t,n,s=r.level+2;for(t=e+2,n=r.tokens.length-2;t<n;t++)r.tokens[t].level===s&&r.tokens[t].type==="paragraph_open"&&(r.tokens[t+2].hidden=!0,r.tokens[t].hidden=!0,t+=2)}var Rs=function(e,t,n,s){var o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E,m,R,N,K,T,j,D,F,b,q,_=t,Y=!1,Be=!0;if(e.sCount[_]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[_]-e.listIndent>=4&&e.sCount[_]<e.blkIndent)return!1;if(s&&e.parentType==="paragraph"&&e.sCount[_]>=e.blkIndent&&(Y=!0),(T=Jr(e,_))>=0){if(d=!0,D=e.bMarks[_]+e.tShift[_],v=Number(e.src.slice(D,T-1)),Y&&v!==1)return!1}else if((T=jr(e,_))>=0)d=!1;else return!1;if(Y&&e.skipSpaces(T)>=e.eMarks[_])return!1;if(s)return!0;for(B=e.src.charCodeAt(T-1),x=e.tokens.length,d?(q=e.push("ordered_list_open","ol",1),v!==1&&(q.attrs=[["start",v]])):q=e.push("bullet_list_open","ul",1),q.map=k=[_,0],q.markup=String.fromCharCode(B),j=!1,b=e.md.block.ruler.getRules("list"),E=e.parentType,e.parentType="list";_<n;){for(K=T,w=e.eMarks[_],u=y=e.sCount[_]+T-(e.bMarks[_]+e.tShift[_]);K<w;){if(o=e.src.charCodeAt(K),o===9)y+=4-(y+e.bsCount[_])%4;else if(o===32)y++;else break;K++}if(c=K,c>=w?l=1:l=y-u,l>4&&(l=1),a=u+l,q=e.push("list_item_open","li",1),q.markup=String.fromCharCode(B),q.map=f=[_,0],d&&(q.info=e.src.slice(D,T-1)),N=e.tight,R=e.tShift[_],m=e.sCount[_],L=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=a,e.tight=!0,e.tShift[_]=c-e.bMarks[_],e.sCount[_]=y,c>=w&&e.isEmpty(_+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,_,n,!0),(!e.tight||j)&&(Be=!1),j=e.line-_>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=L,e.tShift[_]=R,e.sCount[_]=m,e.tight=N,q=e.push("list_item_close","li",-1),q.markup=String.fromCharCode(B),_=e.line,f[1]=_,_>=n||e.sCount[_]<e.blkIndent||e.sCount[_]-e.blkIndent>=4)break;for(F=!1,i=0,h=b.length;i<h;i++)if(b[i](e,_,n,!0)){F=!0;break}if(F)break;if(d){if(T=Jr(e,_),T<0)break;D=e.bMarks[_]+e.tShift[_]}else if(T=jr(e,_),T<0)break;if(B!==e.src.charCodeAt(T-1))break}return d?q=e.push("ordered_list_close","ol",-1):q=e.push("bullet_list_close","ul",-1),q.markup=String.fromCharCode(B),k[1]=_,e.line=_,e.parentType=E,Be&&Ms(e,x),!0},Is=I.normalizeReference,ot=I.isSpace,Ns=function(e,t,n,s){var o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E=0,m=e.bMarks[t]+e.tShift[t],R=e.eMarks[t],N=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(m)!==91)return!1;for(;++m<R;)if(e.src.charCodeAt(m)===93&&e.src.charCodeAt(m-1)!==92){if(m+1===R||e.src.charCodeAt(m+1)!==58)return!1;break}for(a=e.lineMax,y=e.md.block.ruler.getRules("reference"),k=e.parentType,e.parentType="reference";N<a&&!e.isEmpty(N);N++)if(!(e.sCount[N]-e.blkIndent>3)&&!(e.sCount[N]<0)){for(w=!1,u=0,d=y.length;u<d;u++)if(y[u](e,N,a,!0)){w=!0;break}if(w)break}for(v=e.getLines(t,N,e.blkIndent,!1).trim(),R=v.length,m=1;m<R;m++){if(o=v.charCodeAt(m),o===91)return!1;if(o===93){h=m;break}else o===10?E++:o===92&&(m++,m<R&&v.charCodeAt(m)===10&&E++)}if(h<0||v.charCodeAt(h+1)!==58)return!1;for(m=h+2;m<R;m++)if(o=v.charCodeAt(m),o===10)E++;else if(!ot(o))break;if(x=e.md.helpers.parseLinkDestination(v,m,R),!x.ok||(l=e.md.normalizeLink(x.str),!e.md.validateLink(l)))return!1;for(m=x.pos,E+=x.lines,c=m,i=E,B=m;m<R;m++)if(o=v.charCodeAt(m),o===10)E++;else if(!ot(o))break;for(x=e.md.helpers.parseLinkTitle(v,m,R),m<R&&B!==m&&x.ok?(L=x.str,m=x.pos,E+=x.lines):(L="",m=c,E=i);m<R&&(o=v.charCodeAt(m),!!ot(o));)m++;if(m<R&&v.charCodeAt(m)!==10&&L)for(L="",m=c,E=i;m<R&&(o=v.charCodeAt(m),!!ot(o));)m++;return m<R&&v.charCodeAt(m)!==10||(f=Is(v.slice(1,h)),!f)?!1:(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[f]>"u"&&(e.env.references[f]={title:L,href:l}),e.parentType=k,e.line=t+E+1),!0)},Fs=["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"],st={},zs="[a-zA-Z_:][a-zA-Z0-9:._-]*",Ps="[^\"'=<>`\\x00-\\x20]+",Qs="'[^']*'",Us='"[^"]*"',Hs="(?:"+Ps+"|"+Qs+"|"+Us+")",Os="(?:\\s+"+zs+"(?:\\s*=\\s*"+Hs+")?)",Wr="<[A-Za-z][A-Za-z0-9\\-]*"+Os+"*\\s*\\/?>",Xr="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Vs="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",Gs="<[?][\\s\\S]*?[?]>",Ys="<![A-Z]+\\s+[^>]*>",Zs="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",js=new RegExp("^(?:"+Wr+"|"+Xr+"|"+Vs+"|"+Gs+"|"+Ys+"|"+Zs+")"),Js=new RegExp("^(?:"+Wr+"|"+Xr+")");st.HTML_TAG_RE=js,st.HTML_OPEN_CLOSE_TAG_RE=Js;var Ws=Fs,Xs=st.HTML_OPEN_CLOSE_TAG_RE,Ce=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Ws.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Xs.source+"\\s*$"),/^$/,!1]],Ks=function(e,t,n,s){var o,c,i,a,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(l)!==60)return!1;for(a=e.src.slice(l,u),o=0;o<Ce.length&&!Ce[o][0].test(a);o++);if(o===Ce.length)return!1;if(s)return Ce[o][2];if(c=t+1,!Ce[o][1].test(a)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(l=e.bMarks[c]+e.tShift[c],u=e.eMarks[c],a=e.src.slice(l,u),Ce[o][1].test(a)){a.length!==0&&c++;break}}return e.line=c,i=e.push("html_block","",0),i.map=[t,c],i.content=e.getLines(t,c,e.blkIndent,!0),!0},Kr=I.isSpace,$s=function(e,t,n,s){var o,c,i,a,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(o=e.src.charCodeAt(l),o!==35||l>=u))return!1;for(c=1,o=e.src.charCodeAt(++l);o===35&&l<u&&c<=6;)c++,o=e.src.charCodeAt(++l);return c>6||l<u&&!Kr(o)?!1:(s||(u=e.skipSpacesBack(u,l),i=e.skipCharsBack(u,35,l),i>l&&Kr(e.src.charCodeAt(i-1))&&(u=i),e.line=t+1,a=e.push("heading_open","h"+String(c),1),a.markup="########".slice(0,c),a.map=[t,e.line],a=e.push("inline","",0),a.content=e.src.slice(l,u).trim(),a.map=[t,e.line],a.children=[],a=e.push("heading_close","h"+String(c),-1),a.markup="########".slice(0,c)),!0)},ec=function(e,t,n){var s,o,c,i,a,l,u,d,f,h=t+1,k,x=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(k=e.parentType,e.parentType="paragraph";h<n&&!e.isEmpty(h);h++)if(!(e.sCount[h]-e.blkIndent>3)){if(e.sCount[h]>=e.blkIndent&&(l=e.bMarks[h]+e.tShift[h],u=e.eMarks[h],l<u&&(f=e.src.charCodeAt(l),(f===45||f===61)&&(l=e.skipChars(l,f),l=e.skipSpaces(l),l>=u)))){d=f===61?1:2;break}if(!(e.sCount[h]<0)){for(o=!1,c=0,i=x.length;c<i;c++)if(x[c](e,h,n,!0)){o=!0;break}if(o)break}}return d?(s=e.getLines(t,h,e.blkIndent,!1).trim(),e.line=h+1,a=e.push("heading_open","h"+String(d),1),a.markup=String.fromCharCode(f),a.map=[t,e.line],a=e.push("inline","",0),a.content=s,a.map=[t,e.line-1],a.children=[],a=e.push("heading_close","h"+String(d),-1),a.markup=String.fromCharCode(f),e.parentType=k,!0):!1},tc=function(e,t,n){var s,o,c,i,a,l,u=t+1,d=e.md.block.ruler.getRules("paragraph");for(l=e.parentType,e.parentType="paragraph";u<n&&!e.isEmpty(u);u++)if(!(e.sCount[u]-e.blkIndent>3)&&!(e.sCount[u]<0)){for(o=!1,c=0,i=d.length;c<i;c++)if(d[c](e,u,n,!0)){o=!0;break}if(o)break}return s=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,a=e.push("paragraph_open","p",1),a.map=[t,e.line],a=e.push("inline","",0),a.content=s,a.map=[t,e.line],a.children=[],a=e.push("paragraph_close","p",-1),e.parentType=l,!0},$r=Tt,ct=I.isSpace;function ae(r,e,t,n){var s,o,c,i,a,l,u,d;for(this.src=r,this.md=e,this.env=t,this.tokens=n,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="",o=this.src,d=!1,c=i=l=u=0,a=o.length;i<a;i++){if(s=o.charCodeAt(i),!d)if(ct(s)){l++,s===9?u+=4-u%4:u++;continue}else d=!0;(s===10||i===a-1)&&(s!==10&&i++,this.bMarks.push(c),this.eMarks.push(i),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),d=!1,l=0,u=0,c=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ae.prototype.push=function(r,e,t){var n=new $r(r,e,t);return n.block=!0,t<0&&this.level--,n.level=this.level,t>0&&this.level++,this.tokens.push(n),n},ae.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},ae.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},ae.prototype.skipSpaces=function(e){for(var t,n=this.src.length;e<n&&(t=this.src.charCodeAt(e),!!ct(t));e++);return e},ae.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!ct(this.src.charCodeAt(--e)))return e+1;return e},ae.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},ae.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},ae.prototype.getLines=function(e,t,n,s){var o,c,i,a,l,u,d,f=e;if(e>=t)return"";for(u=new Array(t-e),o=0;f<t;f++,o++){for(c=0,d=a=this.bMarks[f],f+1<t||s?l=this.eMarks[f]+1:l=this.eMarks[f];a<l&&c<n;){if(i=this.src.charCodeAt(a),ct(i))i===9?c+=4-(c+this.bsCount[f])%4:c++;else if(a-d<this.tShift[f])c++;else break;a++}c>n?u[o]=new Array(c-n+1).join(" ")+this.src.slice(a,l):u[o]=this.src.slice(a,l)}return u.join("")},ae.prototype.Token=$r;var rc=ae,nc=Lt,it=[["table",Cs,["paragraph","reference"]],["code",Ds],["fence",Bs,["paragraph","reference","blockquote","list"]],["blockquote",Ls,["paragraph","reference","blockquote","list"]],["hr",qs,["paragraph","reference","blockquote","list"]],["list",Rs,["paragraph","reference","blockquote"]],["reference",Ns],["html_block",Ks,["paragraph","reference","blockquote"]],["heading",$s,["paragraph","reference","blockquote"]],["lheading",ec],["paragraph",tc]];function at(){this.ruler=new nc;for(var r=0;r<it.length;r++)this.ruler.push(it[r][0],it[r][1],{alt:(it[r][2]||[]).slice()})}at.prototype.tokenize=function(r,e,t){for(var n,s,o,c=this.ruler.getRules(""),i=c.length,a=e,l=!1,u=r.md.options.maxNesting;a<t&&(r.line=a=r.skipEmptyLines(a),!(a>=t||r.sCount[a]<r.blkIndent));){if(r.level>=u){r.line=t;break}for(o=r.line,s=0;s<i;s++)if(n=c[s](r,a,t,!1),n){if(o>=r.line)throw new Error("block rule didn't increment state.line");break}if(!n)throw new Error("none of the block rules matched");r.tight=!l,r.isEmpty(r.line-1)&&(l=!0),a=r.line,a<t&&r.isEmpty(a)&&(l=!0,a++,r.line=a)}},at.prototype.parse=function(r,e,t,n){var s;r&&(s=new this.State(r,e,t,n),this.tokenize(s,s.line,s.lineMax))},at.prototype.State=rc;var oc=at;function sc(r){switch(r){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 cc=function(e,t){for(var n=e.pos;n<e.posMax&&!sc(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)},ic=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i,ac=function(e,t){var n,s,o,c,i,a,l,u;return!e.md.options.linkify||e.linkLevel>0||(n=e.pos,s=e.posMax,n+3>s)||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47||(o=e.pending.match(ic),!o)||(c=o[1],i=e.md.linkify.matchAtStart(e.src.slice(n-c.length)),!i)||(a=i.url,a.length<=c.length)||(a=a.replace(/\*+$/,""),l=e.md.normalizeLink(a),!e.md.validateLink(l))?!1:(t||(e.pending=e.pending.slice(0,-c.length),u=e.push("link_open","a",1),u.attrs=[["href",l]],u.markup="linkify",u.info="auto",u=e.push("text","",0),u.content=e.md.normalizeLinkText(a),u=e.push("link_close","a",-1),u.markup="linkify",u.info="auto"),e.pos+=a.length-c.length,!0)},lc=I.isSpace,Ac=function(e,t){var n,s,o,c=e.pos;if(e.src.charCodeAt(c)!==10)return!1;if(n=e.pending.length-1,s=e.posMax,!t)if(n>=0&&e.pending.charCodeAt(n)===32)if(n>=1&&e.pending.charCodeAt(n-1)===32){for(o=n-1;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(c++;c<s&&lc(e.src.charCodeAt(c));)c++;return e.pos=c,!0},uc=I.isSpace,Nt=[],en=0;en<256;en++)Nt.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(r){Nt[r.charCodeAt(0)]=1});var pc=function(e,t){var n,s,o,c,i,a=e.pos,l=e.posMax;if(e.src.charCodeAt(a)!==92||(a++,a>=l))return!1;if(n=e.src.charCodeAt(a),n===10){for(t||e.push("hardbreak","br",0),a++;a<l&&(n=e.src.charCodeAt(a),!!uc(n));)a++;return e.pos=a,!0}return c=e.src[a],n>=55296&&n<=56319&&a+1<l&&(s=e.src.charCodeAt(a+1),s>=56320&&s<=57343&&(c+=e.src[a+1],a++)),o="\\"+c,t||(i=e.push("text_special","",0),n<256&&Nt[n]!==0?i.content=c:i.content=o,i.markup=o,i.info="escape"),e.pos=a+1,!0},fc=function(e,t){var n,s,o,c,i,a,l,u,d=e.pos,f=e.src.charCodeAt(d);if(f!==96)return!1;for(n=d,d++,s=e.posMax;d<s&&e.src.charCodeAt(d)===96;)d++;if(o=e.src.slice(n,d),l=o.length,e.backticksScanned&&(e.backticks[l]||0)<=n)return t||(e.pending+=o),e.pos+=l,!0;for(a=d;(i=e.src.indexOf("`",a))!==-1;){for(a=i+1;a<s&&e.src.charCodeAt(a)===96;)a++;if(u=a-i,u===l)return t||(c=e.push("code_inline","code",0),c.markup=o,c.content=e.src.slice(d,i).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=a,!0;e.backticks[u]=i}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=l,!0},lt={};lt.tokenize=function(e,t){var n,s,o,c,i,a=e.pos,l=e.src.charCodeAt(a);if(t||l!==126||(s=e.scanDelims(e.pos,!0),c=s.length,i=String.fromCharCode(l),c<2))return!1;for(c%2&&(o=e.push("text","",0),o.content=i,c--),n=0;n<c;n+=2)o=e.push("text","",0),o.content=i+i,e.delimiters.push({marker:l,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0};function tn(r,e){var t,n,s,o,c,i=[],a=e.length;for(t=0;t<a;t++)s=e[t],s.marker===126&&s.end!==-1&&(o=e[s.end],c=r.tokens[s.token],c.type="s_open",c.tag="s",c.nesting=1,c.markup="~~",c.content="",c=r.tokens[o.token],c.type="s_close",c.tag="s",c.nesting=-1,c.markup="~~",c.content="",r.tokens[o.token-1].type==="text"&&r.tokens[o.token-1].content==="~"&&i.push(o.token-1));for(;i.length;){for(t=i.pop(),n=t+1;n<r.tokens.length&&r.tokens[n].type==="s_close";)n++;n--,t!==n&&(c=r.tokens[n],r.tokens[n]=r.tokens[t],r.tokens[t]=c)}}lt.postProcess=function(e){var t,n=e.tokens_meta,s=e.tokens_meta.length;for(tn(e,e.delimiters),t=0;t<s;t++)n[t]&&n[t].delimiters&&tn(e,n[t].delimiters)};var At={};At.tokenize=function(e,t){var n,s,o,c=e.pos,i=e.src.charCodeAt(c);if(t||i!==95&&i!==42)return!1;for(s=e.scanDelims(e.pos,i===42),n=0;n<s.length;n++)o=e.push("text","",0),o.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0};function rn(r,e){var t,n,s,o,c,i,a=e.length;for(t=a-1;t>=0;t--)n=e[t],!(n.marker!==95&&n.marker!==42)&&n.end!==-1&&(s=e[n.end],i=t>0&&e[t-1].end===n.end+1&&e[t-1].marker===n.marker&&e[t-1].token===n.token-1&&e[n.end+1].token===s.token+1,c=String.fromCharCode(n.marker),o=r.tokens[n.token],o.type=i?"strong_open":"em_open",o.tag=i?"strong":"em",o.nesting=1,o.markup=i?c+c:c,o.content="",o=r.tokens[s.token],o.type=i?"strong_close":"em_close",o.tag=i?"strong":"em",o.nesting=-1,o.markup=i?c+c:c,o.content="",i&&(r.tokens[e[t-1].token].content="",r.tokens[e[n.end+1].token].content="",t--))}At.postProcess=function(e){var t,n=e.tokens_meta,s=e.tokens_meta.length;for(rn(e,e.delimiters),t=0;t<s;t++)n[t]&&n[t].delimiters&&rn(e,n[t].delimiters)};var dc=I.normalizeReference,Ft=I.isSpace,hc=function(e,t){var n,s,o,c,i,a,l,u,d,f="",h="",k=e.pos,x=e.posMax,B=e.pos,v=!0;if(e.src.charCodeAt(e.pos)!==91||(i=e.pos+1,c=e.md.helpers.parseLinkLabel(e,e.pos,!0),c<0))return!1;if(a=c+1,a<x&&e.src.charCodeAt(a)===40){for(v=!1,a++;a<x&&(s=e.src.charCodeAt(a),!(!Ft(s)&&s!==10));a++);if(a>=x)return!1;if(B=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok){for(f=e.md.normalizeLink(l.str),e.md.validateLink(f)?a=l.pos:f="",B=a;a<x&&(s=e.src.charCodeAt(a),!(!Ft(s)&&s!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<x&&B!==a&&l.ok)for(h=l.str,a=l.pos;a<x&&(s=e.src.charCodeAt(a),!(!Ft(s)&&s!==10));a++);}(a>=x||e.src.charCodeAt(a)!==41)&&(v=!0),a++}if(v){if(typeof e.env.references>"u")return!1;if(a<x&&e.src.charCodeAt(a)===91?(B=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?o=e.src.slice(B,a++):a=c+1):a=c+1,o||(o=e.src.slice(i,c)),u=e.env.references[dc(o)],!u)return e.pos=k,!1;f=u.href,h=u.title}return t||(e.pos=i,e.posMax=c,d=e.push("link_open","a",1),d.attrs=n=[["href",f]],h&&n.push(["title",h]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,d=e.push("link_close","a",-1)),e.pos=a,e.posMax=x,!0},mc=I.normalizeReference,zt=I.isSpace,gc=function(e,t){var n,s,o,c,i,a,l,u,d,f,h,k,x,B="",v=e.pos,w=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91||(a=e.pos+2,i=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),i<0))return!1;if(l=i+1,l<w&&e.src.charCodeAt(l)===40){for(l++;l<w&&(s=e.src.charCodeAt(l),!(!zt(s)&&s!==10));l++);if(l>=w)return!1;for(x=l,d=e.md.helpers.parseLinkDestination(e.src,l,e.posMax),d.ok&&(B=e.md.normalizeLink(d.str),e.md.validateLink(B)?l=d.pos:B=""),x=l;l<w&&(s=e.src.charCodeAt(l),!(!zt(s)&&s!==10));l++);if(d=e.md.helpers.parseLinkTitle(e.src,l,e.posMax),l<w&&x!==l&&d.ok)for(f=d.str,l=d.pos;l<w&&(s=e.src.charCodeAt(l),!(!zt(s)&&s!==10));l++);else f="";if(l>=w||e.src.charCodeAt(l)!==41)return e.pos=v,!1;l++}else{if(typeof e.env.references>"u")return!1;if(l<w&&e.src.charCodeAt(l)===91?(x=l+1,l=e.md.helpers.parseLinkLabel(e,l),l>=0?c=e.src.slice(x,l++):l=i+1):l=i+1,c||(c=e.src.slice(a,i)),u=e.env.references[mc(c)],!u)return e.pos=v,!1;B=u.href,f=u.title}return t||(o=e.src.slice(a,i),e.md.inline.parse(o,e.md,e.env,k=[]),h=e.push("image","img",0),h.attrs=n=[["src",B],["alt",""]],h.children=k,h.content=o,f&&n.push(["title",f])),e.pos=l,e.posMax=w,!0},bc=/^([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])?)*)$/,kc=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,wc=function(e,t){var n,s,o,c,i,a,l=e.pos;if(e.src.charCodeAt(l)!==60)return!1;for(i=e.pos,a=e.posMax;;){if(++l>=a||(c=e.src.charCodeAt(l),c===60))return!1;if(c===62)break}return n=e.src.slice(i+1,l),kc.test(n)?(s=e.md.normalizeLink(n),e.md.validateLink(s)?(t||(o=e.push("link_open","a",1),o.attrs=[["href",s]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(n),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=n.length+2,!0):!1):bc.test(n)?(s=e.md.normalizeLink("mailto:"+n),e.md.validateLink(s)?(t||(o=e.push("link_open","a",1),o.attrs=[["href",s]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(n),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=n.length+2,!0):!1):!1},xc=st.HTML_TAG_RE;function Ec(r){return/^<a[>\s]/i.test(r)}function yc(r){return/^<\/a\s*>/i.test(r)}function vc(r){var e=r|32;return e>=97&&e<=122}var _c=function(e,t){var n,s,o,c,i=e.pos;return!e.md.options.html||(o=e.posMax,e.src.charCodeAt(i)!==60||i+2>=o)||(n=e.src.charCodeAt(i+1),n!==33&&n!==63&&n!==47&&!vc(n))||(s=e.src.slice(i).match(xc),!s)?!1:(t||(c=e.push("html_inline","",0),c.content=s[0],Ec(c.content)&&e.linkLevel++,yc(c.content)&&e.linkLevel--),e.pos+=s[0].length,!0)},nn=Er,Cc=I.has,Dc=I.isValidEntityCode,on=I.fromCodePoint,Bc=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Sc=/^&([a-z][a-z0-9]{1,31});/i,Lc=function(e,t){var n,s,o,c,i=e.pos,a=e.posMax;if(e.src.charCodeAt(i)!==38||i+1>=a)return!1;if(n=e.src.charCodeAt(i+1),n===35){if(o=e.src.slice(i).match(Bc),o)return t||(s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),c=e.push("text_special","",0),c.content=Dc(s)?on(s):on(65533),c.markup=o[0],c.info="entity"),e.pos+=o[0].length,!0}else if(o=e.src.slice(i).match(Sc),o&&Cc(nn,o[1]))return t||(c=e.push("text_special","",0),c.content=nn[o[1]],c.markup=o[0],c.info="entity"),e.pos+=o[0].length,!0;return!1};function sn(r){var e,t,n,s,o,c,i,a,l={},u=r.length;if(u){var d=0,f=-2,h=[];for(e=0;e<u;e++)if(n=r[e],h.push(0),(r[d].marker!==n.marker||f!==n.token-1)&&(d=e),f=n.token,n.length=n.length||0,!!n.close){for(l.hasOwnProperty(n.marker)||(l[n.marker]=[-1,-1,-1,-1,-1,-1]),o=l[n.marker][(n.open?3:0)+n.length%3],t=d-h[d]-1,c=t;t>o;t-=h[t]+1)if(s=r[t],s.marker===n.marker&&s.open&&s.end<0&&(i=!1,(s.close||n.open)&&(s.length+n.length)%3===0&&(s.length%3!==0||n.length%3!==0)&&(i=!0),!i)){a=t>0&&!r[t-1].open?h[t-1]+1:0,h[e]=e-t+a,h[t]=a,n.open=!1,s.end=e,s.close=!1,c=-1,f=-2;break}c!==-1&&(l[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}}var Tc=function(e){var t,n=e.tokens_meta,s=e.tokens_meta.length;for(sn(e.delimiters),t=0;t<s;t++)n[t]&&n[t].delimiters&&sn(n[t].delimiters)},qc=function(e){var t,n,s=0,o=e.tokens,c=e.tokens.length;for(t=n=0;t<c;t++)o[t].nesting<0&&s--,o[t].level=s,o[t].nesting>0&&s++,o[t].type==="text"&&t+1<c&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)},Pt=Tt,cn=I.isWhiteSpace,an=I.isPunctChar,ln=I.isMdAsciiPunct;function Pe(r,e,t,n){this.src=r,this.env=t,this.md=e,this.tokens=n,this.tokens_meta=Array(n.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}Pe.prototype.pushPending=function(){var r=new Pt("text","",0);return r.content=this.pending,r.level=this.pendingLevel,this.tokens.push(r),this.pending="",r},Pe.prototype.push=function(r,e,t){this.pending&&this.pushPending();var n=new Pt(r,e,t),s=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(s),n},Pe.prototype.scanDelims=function(r,e){var t=r,n,s,o,c,i,a,l,u,d,f=!0,h=!0,k=this.posMax,x=this.src.charCodeAt(r);for(n=r>0?this.src.charCodeAt(r-1):32;t<k&&this.src.charCodeAt(t)===x;)t++;return o=t-r,s=t<k?this.src.charCodeAt(t):32,l=ln(n)||an(String.fromCharCode(n)),d=ln(s)||an(String.fromCharCode(s)),a=cn(n),u=cn(s),u?f=!1:d&&(a||l||(f=!1)),a?h=!1:l&&(u||d||(h=!1)),e?(c=f,i=h):(c=f&&(!h||l),i=h&&(!f||d)),{can_open:c,can_close:i,length:o}},Pe.prototype.Token=Pt;var Mc=Pe,An=Lt,Qt=[["text",cc],["linkify",ac],["newline",Ac],["escape",pc],["backticks",fc],["strikethrough",lt.tokenize],["emphasis",At.tokenize],["link",hc],["image",gc],["autolink",wc],["html_inline",_c],["entity",Lc]],Ut=[["balance_pairs",Tc],["strikethrough",lt.postProcess],["emphasis",At.postProcess],["fragments_join",qc]];function Qe(){var r;for(this.ruler=new An,r=0;r<Qt.length;r++)this.ruler.push(Qt[r][0],Qt[r][1]);for(this.ruler2=new An,r=0;r<Ut.length;r++)this.ruler2.push(Ut[r][0],Ut[r][1])}Qe.prototype.skipToken=function(r){var e,t,n=r.pos,s=this.ruler.getRules(""),o=s.length,c=r.md.options.maxNesting,i=r.cache;if(typeof i[n]<"u"){r.pos=i[n];return}if(r.level<c){for(t=0;t<o;t++)if(r.level++,e=s[t](r,!0),r.level--,e){if(n>=r.pos)throw new Error("inline rule didn't increment state.pos");break}}else r.pos=r.posMax;e||r.pos++,i[n]=r.pos},Qe.prototype.tokenize=function(r){for(var e,t,n,s=this.ruler.getRules(""),o=s.length,c=r.posMax,i=r.md.options.maxNesting;r.pos<c;){if(n=r.pos,r.level<i){for(t=0;t<o;t++)if(e=s[t](r,!1),e){if(n>=r.pos)throw new Error("inline rule didn't increment state.pos");break}}if(e){if(r.pos>=c)break;continue}r.pending+=r.src[r.pos++]}r.pending&&r.pushPending()},Qe.prototype.parse=function(r,e,t,n){var s,o,c,i=new this.State(r,e,t,n);for(this.tokenize(i),o=this.ruler2.getRules(""),c=o.length,s=0;s<c;s++)o[s](i)},Qe.prototype.State=Mc;var Rc=Qe,Ht,un;function Ic(){return un||(un=1,Ht=function(r){var e={};r=r||{},e.src_Any=Tr().source,e.src_Cc=Mr().source,e.src_Z=Nr().source,e.src_P=_t.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var t="[><|]";return e.src_pseudo_letter="(?:(?!"+t+"|"+e.src_ZPCc+")"+e.src_Any+")",e.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]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+t+"|"+e.src_ZPCc+")(?!"+(r["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(r["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),Ht}function Ot(r){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(t){t&&Object.keys(t).forEach(function(n){r[n]=t[n]})}),r}function ut(r){return Object.prototype.toString.call(r)}function Nc(r){return ut(r)==="[object String]"}function Fc(r){return ut(r)==="[object Object]"}function zc(r){return ut(r)==="[object RegExp]"}function pn(r){return ut(r)==="[object Function]"}function Pc(r){return r.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var fn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Qc(r){return Object.keys(r||{}).reduce(function(e,t){return e||fn.hasOwnProperty(t)},!1)}var Uc={"http:":{validate:function(r,e,t){var n=r.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(n)?n.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(r,e,t){var n=r.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(n)?e>=3&&r[e-3]===":"||e>=3&&r[e-3]==="/"?0:n.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(r,e,t){var n=r.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(n)?n.match(t.re.mailto)[0].length:0}}},Hc="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]",Oc="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Vc(r){r.__index__=-1,r.__text_cache__=""}function Gc(r){return function(e,t){var n=e.slice(t);return r.test(n)?n.match(r)[0].length:0}}function dn(){return function(r,e){e.normalize(r)}}function pt(r){var e=r.re=Ic()(r.__opts__),t=r.__tlds__.slice();r.onCompile(),r.__tlds_replaced__||t.push(Hc),t.push(e.src_xn),e.src_tlds=t.join("|");function n(i){return i.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");var s=[];r.__compiled__={};function o(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(r.__schemas__).forEach(function(i){var a=r.__schemas__[i];if(a!==null){var l={validate:null,link:null};if(r.__compiled__[i]=l,Fc(a)){zc(a.validate)?l.validate=Gc(a.validate):pn(a.validate)?l.validate=a.validate:o(i,a),pn(a.normalize)?l.normalize=a.normalize:a.normalize?o(i,a):l.normalize=dn();return}if(Nc(a)){s.push(i);return}o(i,a)}}),s.forEach(function(i){r.__compiled__[r.__schemas__[i]]&&(r.__compiled__[i].validate=r.__compiled__[r.__schemas__[i]].validate,r.__compiled__[i].normalize=r.__compiled__[r.__schemas__[i]].normalize)}),r.__compiled__[""]={validate:null,normalize:dn()};var c=Object.keys(r.__compiled__).filter(function(i){return i.length>0&&r.__compiled__[i]}).map(Pc).join("|");r.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),r.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),r.re.schema_at_start=RegExp("^"+r.re.schema_search.source,"i"),r.re.pretest=RegExp("("+r.re.schema_test.source+")|("+r.re.host_fuzzy_test.source+")|@","i"),Vc(r)}function Yc(r,e){var t=r.__index__,n=r.__last_index__,s=r.__text_cache__.slice(t,n);this.schema=r.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=n+e,this.raw=s,this.text=s,this.url=s}function Vt(r,e){var t=new Yc(r,e);return r.__compiled__[t.schema].normalize(t,r),t}function re(r,e){if(!(this instanceof re))return new re(r,e);e||Qc(r)&&(e=r,r={}),this.__opts__=Ot({},fn,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Ot({},Uc,r),this.__compiled__={},this.__tlds__=Oc,this.__tlds_replaced__=!1,this.re={},pt(this)}re.prototype.add=function(e,t){return this.__schemas__[e]=t,pt(this),this},re.prototype.set=function(e){return this.__opts__=Ot(this.__opts__,e),this},re.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,s,o,c,i,a,l,u;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(t=a.exec(e))!==null;)if(o=this.testSchemaAt(e,t[2],a.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=n.index+n[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=e.indexOf("@"),u>=0&&(s=e.match(this.re.email_fuzzy))!==null&&(c=s.index+s[1].length,i=s.index+s[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=i))),this.__index__>=0},re.prototype.pretest=function(e){return this.re.pretest.test(e)},re.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},re.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(Vt(this,t)),t=this.__last_index__);for(var s=t?e.slice(t):e;this.test(s);)n.push(Vt(this,t)),s=s.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},re.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;var t=this.re.schema_at_start.exec(e);if(!t)return null;var n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,Vt(this,0)):null},re.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(n,s,o){return n!==o[s-1]}).reverse(),pt(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,pt(this),this)},re.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)},re.prototype.onCompile=function(){};var Zc=re;const De=2147483647,le=36,Gt=1,Ue=26,jc=38,Jc=700,hn=72,mn=128,gn="-",Wc=/^xn--/,Xc=/[^\0-\x7F]/,Kc=/[\x2E\u3002\uFF0E\uFF61]/g,$c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Yt=le-Gt,Ae=Math.floor,Zt=String.fromCharCode;function he(r){throw new RangeError($c[r])}function ei(r,e){const t=[];let n=r.length;for(;n--;)t[n]=e(r[n]);return t}function bn(r,e){const t=r.split("@");let n="";t.length>1&&(n=t[0]+"@",r=t[1]),r=r.replace(Kc,".");const s=r.split("."),o=ei(s,e).join(".");return n+o}function jt(r){const e=[];let t=0;const n=r.length;for(;t<n;){const s=r.charCodeAt(t++);if(s>=55296&&s<=56319&&t<n){const o=r.charCodeAt(t++);(o&64512)==56320?e.push(((s&1023)<<10)+(o&1023)+65536):(e.push(s),t--)}else e.push(s)}return e}const kn=r=>String.fromCodePoint(...r),ti=function(r){return r>=48&&r<58?26+(r-48):r>=65&&r<91?r-65:r>=97&&r<123?r-97:le},wn=function(r,e){return r+22+75*(r<26)-((e!=0)<<5)},xn=function(r,e,t){let n=0;for(r=t?Ae(r/Jc):r>>1,r+=Ae(r/e);r>Yt*Ue>>1;n+=le)r=Ae(r/Yt);return Ae(n+(Yt+1)*r/(r+jc))},Jt=function(r){const e=[],t=r.length;let n=0,s=mn,o=hn,c=r.lastIndexOf(gn);c<0&&(c=0);for(let i=0;i<c;++i)r.charCodeAt(i)>=128&&he("not-basic"),e.push(r.charCodeAt(i));for(let i=c>0?c+1:0;i<t;){const a=n;for(let u=1,d=le;;d+=le){i>=t&&he("invalid-input");const f=ti(r.charCodeAt(i++));f>=le&&he("invalid-input"),f>Ae((De-n)/u)&&he("overflow"),n+=f*u;const h=d<=o?Gt:d>=o+Ue?Ue:d-o;if(f<h)break;const k=le-h;u>Ae(De/k)&&he("overflow"),u*=k}const l=e.length+1;o=xn(n-a,l,a==0),Ae(n/l)>De-s&&he("overflow"),s+=Ae(n/l),n%=l,e.splice(n++,0,s)}return String.fromCodePoint(...e)},Wt=function(r){const e=[];r=jt(r);const t=r.length;let n=mn,s=0,o=hn;for(const a of r)a<128&&e.push(Zt(a));const c=e.length;let i=c;for(c&&e.push(gn);i<t;){let a=De;for(const u of r)u>=n&&u<a&&(a=u);const l=i+1;a-n>Ae((De-s)/l)&&he("overflow"),s+=(a-n)*l,n=a;for(const u of r)if(u<n&&++s>De&&he("overflow"),u===n){let d=s;for(let f=le;;f+=le){const h=f<=o?Gt:f>=o+Ue?Ue:f-o;if(d<h)break;const k=d-h,x=le-h;e.push(Zt(wn(h+k%x,0))),d=Ae(k/x)}e.push(Zt(wn(d,0))),o=xn(s,l,i===c),s=0,++i}++s,++n}return e.join("")},En=function(r){return bn(r,function(e){return Wc.test(e)?Jt(e.slice(4).toLowerCase()):e})},yn=function(r){return bn(r,function(e){return Xc.test(e)?"xn--"+Wt(e):e})},ri=To(Object.freeze(Object.defineProperty({__proto__:null,decode:Jt,default:{version:"2.3.1",ucs2:{decode:jt,encode:kn},decode:Jt,encode:Wt,toASCII:yn,toUnicode:En},encode:Wt,toASCII:yn,toUnicode:En,ucs2decode:jt,ucs2encode:kn},Symbol.toStringTag,{value:"Module"})));var ni={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},oi={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"]}}},si={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"]}}},He=I,ci=rt,ii=ts,ai=_s,li=oc,Ai=Rc,ui=Zc,ke=ye,vn=ri,pi={default:ni,zero:oi,commonmark:si},fi=/^(vbscript|javascript|file|data):/,di=/^data:image\/(gif|png|jpeg|webp);/;function hi(r){var e=r.trim().toLowerCase();return fi.test(e)?!!di.test(e):!0}var _n=["http:","https:","mailto:"];function mi(r){var e=ke.parse(r,!0);if(e.hostname&&(!e.protocol||_n.indexOf(e.protocol)>=0))try{e.hostname=vn.toASCII(e.hostname)}catch{}return ke.encode(ke.format(e))}function gi(r){var e=ke.parse(r,!0);if(e.hostname&&(!e.protocol||_n.indexOf(e.protocol)>=0))try{e.hostname=vn.toUnicode(e.hostname)}catch{}return ke.decode(ke.format(e),ke.decode.defaultChars+"%")}function oe(r,e){if(!(this instanceof oe))return new oe(r,e);e||He.isString(r)||(e=r||{},r="default"),this.inline=new Ai,this.block=new li,this.core=new ai,this.renderer=new ii,this.linkify=new ui,this.validateLink=hi,this.normalizeLink=mi,this.normalizeLinkText=gi,this.utils=He,this.helpers=He.assign({},ci),this.options={},this.configure(r),e&&this.set(e)}oe.prototype.set=function(r){return He.assign(this.options,r),this},oe.prototype.configure=function(r){var e=this,t;if(He.isString(r)&&(t=r,r=pi[t],!r))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!r)throw new Error("Wrong `markdown-it` preset, can't be empty");return r.options&&e.set(r.options),r.components&&Object.keys(r.components).forEach(function(n){r.components[n].rules&&e[n].ruler.enableOnly(r.components[n].rules),r.components[n].rules2&&e[n].ruler2.enableOnly(r.components[n].rules2)}),this},oe.prototype.enable=function(r,e){var t=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(s){t=t.concat(this[s].ruler.enable(r,!0))},this),t=t.concat(this.inline.ruler2.enable(r,!0));var n=r.filter(function(s){return t.indexOf(s)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},oe.prototype.disable=function(r,e){var t=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(s){t=t.concat(this[s].ruler.disable(r,!0))},this),t=t.concat(this.inline.ruler2.disable(r,!0));var n=r.filter(function(s){return t.indexOf(s)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},oe.prototype.use=function(r){var e=[this].concat(Array.prototype.slice.call(arguments,1));return r.apply(r,e),this},oe.prototype.parse=function(r,e){if(typeof r!="string")throw new Error("Input data should be a String");var t=new this.core.State(r,this,e);return this.core.process(t),t.tokens},oe.prototype.render=function(r,e){return e=e||{},this.renderer.render(this.parse(r,e),this.options,e)},oe.prototype.parseInline=function(r,e){var t=new this.core.State(r,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens},oe.prototype.renderInline=function(r,e){return e=e||{},this.renderer.render(this.parseInline(r,e),this.options,e)};var bi=oe,ki=bi;const wi=Lo(ki),xi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAAXNSR0IArs4c6QAAH3tJREFUeF69nAd4VFXax39nStqkNxJC6KGDghQFXIosogGkCKKuFYVFFBVQXEEN69pFF5VFFGRFUelSFUQjCFIUkN5LIIH0hGSSSabd7zln5sIkhBRwv8MzzwBz7yn/8/b3PUfwP2iaphkAgxDC6du9pmmxQFugKdACaAU0BkKBEO9HvlLs/RQBZ4AjwDHgFHBQCJFdqV8T4BZCuP/s5Yg/s0NN02R/Ehw5WU32rWmaBGMI0ANoDTQHzNc4rg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CNTBtH0pgTKbeo6CrfBoBkXvbJWO5h6+INRT90w9d3nbi+5PPcqVX+V/3lNh7ZSUjTDwTZLxJKRI11zT2q3Ia5+uUlFkDTMgQJnuYuMI9nkpOUphzQqMYK45jEEhZs9Al4TygQwmcHlAHkaQRg0JZQPpZ5i69e/KftJsnO9pjH0vL8rTTs3cDnKPDVYyhsxsTPzZNaLU/vG/fj/ernJ5QWnGFJSICUlxT3viBbiNjNaiKqvx6lw4YksMTEKTNKz0MugBTjt4HZ6QnxGI5Rb7Zw7kkl8UiyW8ABl9+iay1bspDCrSLovWni9YM0cYNQc5erUknwkU9N4y+Bg3uhWolhuppxzSkrdb35RFFx7Yqv6yRTPfWWkCOFemKZF2NyMQav6gqVLLKhJpvEpElfRGE+QTAplSTnfz9rEps+30Sm5PcNfulNRlTy8IenLYBRuowmj9F1dDmlJqOOkxxHMCzTwyf2NRIGa1/RrB0Zf7XUDpMDxAUn+e/YJLdZkoL/wXNHVr05XdGlgNKOt+2ATqfO2SGGsjZg+UGKhaS6lqmXBhV7bUq7BRiHEN043G8Y191z+Vnk+10MEfwpAPqaAWAKGET6XvH2WpjXVnAzRDPRAq8Ulb7IAwQS2i+WkHUgnoVUcIdEW3J779DyXvAkOCzdbhYlvH210+ZK3ymNfDzB/KgVVnojawZ8xpPSpeE2gpCw/E21x01TTaIGglabRRIhLVwTKq75kKzYYKTYHUORwcMZdzhEhOIaBU3YnB3VK0cdNSdVM9MYt2fzPAMW3j/8Dx+VMHl8zFNkAAAAASUVORK5CYII=";var Xt=(r=>(r.Assistant="assistant",r.System="system",r.User="user",r))(Xt||{}),Oe=(r=>(r.Error="error",r.Loading="loading",r.Success="success",r))(Oe||{});const Ei={class:"message-content user"},yi={key:0,class:"time-message user"},vi=["innerHTML"],_i={class:"message-photo user"},Ci=["src"],Di=A.createElementVNode("span",{class:"message-photo ai"},[A.createElementVNode("i",{class:"ai-blueking-icon ai-blueking-ai"})],-1),Bi={class:"message-content ai"},Si={key:0,class:"time-message ai"},Li={key:2,width:"18",height:"18",class:"loading-message","aria-hidden":"true"},Ti=[A.createElementVNode("use",{"xlink:href":"#ai-blueking-quanquan"},null,-1)],qi={key:3,class:"message-wrap"},Mi=["innerHTML"],Ri=A.defineComponent({__name:"render-message",props:{message:{},userPhoto:{default:xi}},setup(r){const e=r,t=A.computed(()=>{var c;const o={error:"ai-blueking-icon ai-blueking-warning-circle-fill",loading:"",success:""};return(c=e.message)!=null&&c.status?o[e.message.status]:""}),n=A.computed(()=>{if(e.message.content){const c=new wi().render(e.message.content);return So.sanitize(c)}return""}),s=A.computed(()=>{const o=je(e.message.time),c=je();return e.message.time?c.isSame(o,"year")?o.format("MM-DD HH:mm:ss"):o.format("YYYY-MM-DD HH:mm:ss"):""});return(o,c)=>(A.openBlock(),A.createElementBlock("li",{class:A.normalizeClass([o.message.role,"message-main"])},[o.message.role===A.unref(Xt).User?(A.openBlock(),A.createElementBlock(A.Fragment,{key:0},[A.createElementVNode("p",Ei,[s.value?(A.openBlock(),A.createElementBlock("span",yi,A.toDisplayString(s.value),1)):A.createCommentVNode("v-if",!0),A.createElementVNode("span",{class:"markdown-message",innerHTML:n.value},null,8,vi)]),A.createElementVNode("span",_i,[A.createElementVNode("img",{src:o.userPhoto},null,8,Ci)])],64)):(A.openBlock(),A.createElementBlock(A.Fragment,{key:1},[Di,A.createElementVNode("p",Bi,[s.value?(A.openBlock(),A.createElementBlock("span",Si,A.toDisplayString(s.value),1)):A.createCommentVNode("v-if",!0),t.value?(A.openBlock(),A.createElementBlock("i",{key:1,class:A.normalizeClass(t.value)},null,2)):A.createCommentVNode("v-if",!0),o.message.status===A.unref(Oe).Loading?(A.openBlock(),A.createElementBlock("svg",Li,Ti)):A.createCommentVNode("v-if",!0),o.message.status===A.unref(Oe).Error?(A.openBlock(),A.createElementBlock("span",qi,A.toDisplayString(o.message.content),1)):(A.openBlock(),A.createElementBlock("span",{key:4,innerHTML:n.value,class:A.normalizeClass({"markdown-message":!0,loading:o.message.status===A.unref(Oe).Loading})},null,10,Mi))])],64))],2))}}),Ii={class:"prompt-list"},Ni={class:"search-group"},Fi=["onClick"],zi={class:"prompt-content"},Pi=Ee(A.defineComponent({__name:"render-send",props:{prompts:{},placeholder:{},value:{}},emits:["update:value","enter","choose-prompt"],setup(r,{emit:e}){const t=r,n=e,s=P.clickoutside,o=P.bkTooltips,c=A.ref(""),i=A.ref(40),a=A.ref(),l=A.ref(!1),u=A.computed(()=>{var E;return((E=t.prompts)==null?void 0:E.filter(m=>m.content.includes(c.value)))||[]}),d=A.computed(()=>{var E;return t.placeholder?t.placeholder:(E=t.prompts)!=null&&E.length?Q("您可以键入 “/” 查看更多Prompt"):Q("请输入")}),f=E=>{n("update:value",E)},h=()=>{var E;t.value==="/"&&((E=t.prompts)!=null&&E.length)?y():L()},k=()=>{A.nextTick(()=>{var m;const E=(m=a.value)==null?void 0:m.$el.querySelector("textarea");(E==null?void 0:E.scrollHeight)>40&&t.value?i.value=E.scrollHeight<=300?E.scrollHeight:300:i.value=40})},x=E=>{n("update:value",E.content),n("choose-prompt",E),L(),w()},B=(E,m)=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),n("enter"))},v=()=>{f("")},w=()=>{var m;const E=(m=a.value)==null?void 0:m.$el.querySelector("textarea");E==null||E.focus()},y=()=>{l.value=!0},L=()=>{l.value=!1};return A.watch(()=>t.value,()=>{k(),h()}),A.onMounted(w),(E,m)=>(A.openBlock(),A.createBlock(A.unref(P.Popover),{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:A.withCtx(()=>{var R;return[A.createElementVNode("div",null,[A.withDirectives((A.openBlock(),A.createElementBlock("section",Ii,[A.createVNode(A.unref(P.Input),{class:"input-search",modelValue:c.value,"onUpdate:modelValue":m[0]||(m[0]=N=>c.value=N),behavior:"simplicity",clearable:""},null,8,["modelValue"]),A.createElementVNode("section",Ni,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(u.value,(N,K)=>A.withDirectives((A.openBlock(),A.createElementBlock("span",{class:"group-prompt",key:K,onClick:T=>x(N)},[A.createElementVNode("span",zi,A.toDisplayString(N.content),1)],8,Fi)),[[A.unref(o),{content:N.content,placement:"right",theme:"light",width:300,zIndex:9999999,extCls:"prompt-popover"}]])),128)),(R=u.value)!=null&&R.length?A.createCommentVNode("v-if",!0):(A.openBlock(),A.createBlock(A.unref(P.Exception),{key:0,class:"exception-wrap-item exception-part",scene:"part",type:"search-empty"}))])])),[[A.unref(s),L]])])]}),default:A.withCtx(()=>[A.createElementVNode("section",{style:A.normalizeStyle({"--text-height":i.value+"px"}),class:"send-prompt-container"},[A.createVNode(A.unref(P.Input),{ref_key:"inputRef",ref:a,class:"send-prompt",autosize:!1,clearable:!0,"model-value":E.value,"native-attributes":{autofocus:"autofocus"},placeholder:d.value,row:"1",type:"textarea",onInput:f,onKeydown:B},null,8,["model-value","placeholder"]),E.value?(A.openBlock(),A.createBlock(A.unref(eo.Close),{key:0,class:"show-clear-only-hover bk-input--clear-icon clear-icon",onClick:v})):A.createCommentVNode("v-if",!0)],4)]),_:1},8,["is-show"]))}}),[["__scopeId","data-v-2374c5aa"]]),Qi=(r=>(A.pushScopeId("data-v-fd57f18d"),r=r(),A.popScopeId(),r))(()=>A.createElementVNode("svg",{width:"10",height:"10",class:"ai-blueking-render-stop-icon","aria-hidden":"true"},[A.createElementVNode("use",{"xlink:href":"#ai-blueking-tingzhi"})],-1)),Ui=Ee(A.defineComponent({__name:"render-stop",props:{isShow:{type:Boolean}},emits:["stop"],setup(r,{emit:e}){const t=e,n=()=>{t("stop")};return(s,o)=>s.isShow?(A.openBlock(),A.createElementBlock("span",{key:0,class:"ai-blueking-render-stop",onClick:n},[Qi,A.createTextVNode(" "+A.toDisplayString(A.unref(Q)("终止生成")),1)])):A.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-fd57f18d"]]),Hi={key:0,class:"time-wrapper"},Oi={class:"time-message"},Vi=Ee(A.defineComponent({__name:"render-time",props:{message:{}},setup(r){const e=r,t=A.computed(()=>{var c;const n=je(e.message.time),s=je(),o={0:Q("日"),1:Q("一"),2:Q("二"),3:Q("三"),4:Q("四"),5:Q("五"),6:Q("六")};return!e.message.time||(c=window.showTimes)!=null&&c.some(i=>Math.abs(n.diff(i,"minute"))<10&&i!==e.message.time)?"":(window.showTimes=[...window.showTimes||[],e.message.time],s.isSame(n,"day")?n.format("HH:mm:ss"):s.subtract(1,"day").isSame(n,"week")?Q("昨天")+" "+n.format("HH:mm:ss"):s.isSame(n,"week")?Q("本周")+o[n.day()]+" "+n.format("HH:mm:ss"):s.subtract(1,"week").isSame(n,"week")?Q("上周")+o[n.day()]+" "+n.format("HH:mm:ss"):s.isSame(n,"year")?n.format("MM-DD HH:mm:ss"):n.format("YYYY-MM-DD HH:mm:ss"))});return(n,s)=>t.value?(A.openBlock(),A.createElementBlock("section",Hi,[A.createElementVNode("span",Oi,A.toDisplayString(t.value),1)])):A.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-55c9a119"]]),Cn=r=>(A.pushScopeId("data-v-6cc6ac8a"),r=r(),A.popScopeId(),r),Gi={key:0,width:"18",height:"18",class:"scroll-loading-icon","aria-hidden":"true"},Yi=[Cn(()=>A.createElementVNode("use",{"xlink:href":"#ai-blueking-loading-2"},null,-1))],Zi={class:"ai-operation"},ji={class:"ai-operation-tools"},Ji={class:"ai-operation-input"},Wi=Cn(()=>A.createElementVNode("i",{class:"ai-blueking-icon ai-blueking-fasong"},null,-1)),Xi=Ee(A.defineComponent({__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(r,{emit:e}){const t=r,n=e,s=P.bkTooltips,o=A.ref(""),c=()=>{A.nextTick(()=>{const f=document.querySelector(".ai-blueking-messages");f.scrollTop=f.scrollHeight})},i=no(f=>{if(t.scrollLoading||t.scrollLoadingEnd)return;f.target.scrollTop<200&&n("scroll-load")}),a=()=>{if(o.value){if(t.loading){P.Message({theme:"warning",message:Q("内容正在执行中,请执行完成后再发送")});return}n("send",o.value),o.value=""}},l=f=>{n("choose-prompt",f)},u=()=>{n("stop")};A.watch(()=>t.messages,()=>{const f=document.querySelector(".ai-blueking-messages");(f==null?void 0:f.scrollTop)+(f==null?void 0:f.clientHeight)+100>=(f==null?void 0:f.scrollHeight)&&c()},{deep:!0});const d=()=>{window.showTimes=[]};return A.onMounted(c),A.onBeforeUnmount(d),(f,h)=>(A.openBlock(),A.createElementBlock("section",{style:A.normalizeStyle({background:f.background}),class:"ai-content"},[A.createElementVNode("ul",{class:"ai-messages ai-blueking-messages",onScrollPassive:h[0]||(h[0]=(...k)=>A.unref(i)&&A.unref(i)(...k))},[f.scrollLoading?(A.openBlock(),A.createElementBlock("svg",Gi,Yi)):A.createCommentVNode("v-if",!0),(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(f.messages,k=>(A.openBlock(),A.createElementBlock(A.Fragment,{key:k.content},[A.createVNode(Vi,{class:"render-message",message:k},null,8,["message"]),A.createVNode(Ri,{class:"render-message",message:k,"user-photo":f.userPhoto},null,8,["message","user-photo"])],64))),128))],32),A.createElementVNode("section",Zi,[A.createElementVNode("span",ji,[A.createVNode(ao),A.createVNode(Ui,{"is-show":f.loading,onStop:u},null,8,["is-show"])]),A.createElementVNode("section",Ji,[A.createVNode(Pi,{value:o.value,"onUpdate:value":h[1]||(h[1]=k=>o.value=k),placeholder:f.placeholder,prompts:f.prompts,onChoosePrompt:l,onEnter:a},null,8,["value","placeholder","prompts"]),A.withDirectives((A.openBlock(),A.createBlock(A.unref(P.Button),{class:"ai-operation-button",disabled:f.loading||!o.value,size:"large",theme:"primary",onClick:a},{default:A.withCtx(()=>[Wi,A.createTextVNode(" "+A.toDisplayString(A.unref(Q)("发送")),1)]),_:1},8,["disabled"])),[[A.unref(s),{content:A.unref(Q)("内容正在执行中,请执行完成后再发送"),disabled:!f.loading}]])])])],4))}}),[["__scopeId","data-v-6cc6ac8a"]]),Ki={class:"ai-modal-header-icon"},$i=Ee(A.defineComponent({__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(r,{emit:e}){const t=r,n=e,s=P.bkTooltips,o={height:window.innerHeight,width:window.innerWidth},c={isMove:!1,type:"",clientX:0,clientY:0},i=()=>{var F,b,q,_;const D=(Y,Be)=>Y===void 0?Be:Y;return{top:D((F=t.startPosition)==null?void 0:F.top,o.height-t.sizeLimit.height),bottom:D((b=t.startPosition)==null?void 0:b.bottom,0),left:D((q=t.startPosition)==null?void 0:q.left,0),right:D((_=t.startPosition)==null?void 0:_.right,o.width-t.sizeLimit.width)}},a=A.ref(i()),l=A.computed(()=>a.value.top<=t.positionLimit.top&&a.value.bottom<=t.positionLimit.bottom),u=D=>{c.isMove=!0,c.type="move",c.clientX=D.clientX,c.clientY=D.clientY},d=D=>{c.isMove=!0,c.type="rightDrag",c.clientX=D.clientX},f=D=>{c.isMove=!0,c.type="leftDrag",c.clientX=D.clientX},h=D=>{c.isMove=!0,c.type="topDrag",c.clientY=D.clientY},k=D=>{c.isMove=!0,c.type="bottomDrag",c.clientY=D.clientY},x=D=>{c.isMove=!0,c.type="topLeftDrag",c.clientY=D.clientY,c.clientX=D.clientX},B=D=>{c.isMove=!0,c.type="topRightDrag",c.clientY=D.clientY,c.clientX=D.clientX},v=D=>{c.isMove=!0,c.type="bottomLeftDrag",c.clientY=D.clientY,c.clientX=D.clientX},w=D=>{c.isMove=!0,c.type="bottomRightDrag",c.clientY=D.clientY,c.clientX=D.clientX},y=()=>{c.isMove=!1},L=(D,F)=>{["move","leftDrag"].includes(c.type)&&(a.value.left+=D),["move","rightDrag"].includes(c.type)&&(a.value.right-=D),["move","topDrag"].includes(c.type)&&(a.value.top+=F),["move","bottomDrag"].includes(c.type)&&(a.value.bottom-=F),["topLeftDrag"].includes(c.type)&&(a.value.left+=D,a.value.top+=F),["topRightDrag"].includes(c.type)&&(a.value.right-=D,a.value.top+=F),["bottomLeftDrag"].includes(c.type)&&(a.value.left+=D,a.value.bottom-=F),["bottomRightDrag"].includes(c.type)&&(a.value.right-=D,a.value.bottom-=F)},E=(D,F)=>{const{top:b,bottom:q,left:_,right:Y}=a.value;(o.width-_-Y<t.sizeLimit.width||_<t.positionLimit.left||Y<t.positionLimit.right)&&(["move","leftDrag","topLeftDrag","bottomLeftDrag"].includes(c.type)&&(a.value.left-=D),["move","rightDrag","topRightDrag","bottomRightDrag"].includes(c.type)&&(a.value.right+=D)),(o.height-b-q<t.sizeLimit.height||b<t.positionLimit.top||q<t.positionLimit.bottom)&&(["move","topDrag","topRightDrag","topLeftDrag"].includes(c.type)&&(a.value.top-=F),["move","bottomDrag","bottomLeftDrag","bottomRightDrag"].includes(c.type)&&(a.value.bottom+=F))},m=D=>{if(!c.isMove)return;D.preventDefault();const F=D.clientX-c.clientX,b=D.clientY-c.clientY;L(F,b),E(F,b),c.clientX=D.clientX,c.clientY=D.clientY},R=()=>{o.height=window.innerHeight,o.width=window.innerWidth,a.value=i()},N=()=>{a.value.top=t.positionLimit.top,a.value.bottom=t.positionLimit.bottom},K=()=>{a.value.top=o.height-t.sizeLimit.height,a.value.bottom=t.positionLimit.bottom},T=()=>{n("clear")},j=()=>{n("close")};return A.onBeforeMount(()=>{window.addEventListener("mousemove",m,!0),window.addEventListener("mouseup",y),window.addEventListener("resize",R)}),A.onBeforeUnmount(()=>{window.removeEventListener("mousemove",m,!0),window.removeEventListener("mouseup",y),window.removeEventListener("resize",R)}),(D,F)=>(A.openBlock(),A.createElementBlock("section",{style:A.normalizeStyle({top:a.value.top+"px",bottom:a.value.bottom+"px",left:a.value.left+"px",right:a.value.right+"px"}),class:"ai-modal"},[A.createElementVNode("header",{style:A.normalizeStyle({background:D.headBackground}),class:"ai-modal-header",onMousedown:A.withModifiers(u,["stop"])},[A.createElementVNode("span",Ki,[A.createElementVNode("i",{class:A.normalizeClass(D.logo)},null,2),A.createTextVNode(" "+A.toDisplayString(D.name||A.unref(Q)("小鲸")),1)]),A.createElementVNode("span",null,[l.value?A.withDirectives((A.openBlock(),A.createElementBlock("i",{key:0,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxiajuhe",onClick:K},null,512)),[[A.unref(s),{content:A.unref(Q)("向下收缩"),distance:20}]]):A.withDirectives((A.openBlock(),A.createElementBlock("i",{key:1,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxialashen-2",onClick:N},null,512)),[[A.unref(s),{content:A.unref(Q)("向上扩展"),distance:20}]]),A.withDirectives(A.createElementVNode("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-saoba",onClick:T},null,512),[[A.unref(s),{content:A.unref(Q)("清空聊天记录"),distance:20}]]),A.withDirectives(A.createElementVNode("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-shanchu-2",onClick:j},null,512),[[A.unref(s),{content:A.unref(Q)("关闭"),distance:20}]])])],36),A.renderSlot(D.$slots,"default",{},void 0,!0),A.createElementVNode("span",{class:"drag-line left",onMousedown:A.withModifiers(f,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line right",onMousedown:A.withModifiers(d,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line top",onMousedown:A.withModifiers(h,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line bottom",onMousedown:A.withModifiers(k,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line top-left-corner",onMousedown:A.withModifiers(x,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line top-right-corner",onMousedown:A.withModifiers(B,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line bottom-left-corner",onMousedown:A.withModifiers(v,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line bottom-right-corner",onMousedown:A.withModifiers(w,["stop"])},null,32)],4))}}),[["__scopeId","data-v-e603010f"]]),ea=A.defineComponent({__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(r,{emit:e}){const t=e,n=()=>{t("clear")},s=()=>{t("close")},o=l=>{t("send",l)},c=()=>{t("stop")},i=()=>{t("scroll-load")},a=l=>{t("choose-prompt",l)};return(l,u)=>(A.openBlock(),A.createBlock($i,{"head-background":l.headBackground,logo:l.logo,name:l.name,"position-limit":l.positionLimit,"size-limit":l.sizeLimit,"start-position":l.startPosition,onClear:n,onClose:s},{default:A.withCtx(()=>[A.createVNode(Xi,{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:a,onScrollLoad:i,onSend:o,onStop:c},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 r='<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",r):document.addEventListener("DOMContentLoaded",function(){document.body.insertAdjacentHTML("afterbegin",r)})})();class ta{constructor(e,t,n,s,o){xe(this,"controllerMap");xe(this,"handleEnd");xe(this,"handleError");xe(this,"handleReceiveMessage");xe(this,"handleStart");xe(this,"url");this.url=e,this.handleStart=t,this.handleReceiveMessage=n,this.handleEnd=s,this.handleError=o,this.controllerMap={}}stop(e){var t,n;return(n=(t=this.controllerMap[e])==null?void 0:t.abort)==null||n.call(t),this.handleEnd(e)}async stream(e,t,n){const s=new AbortController;this.controllerMap[t]=s,fetch(this.url,{method:"post",signal:s.signal,headers:{"Content-Type":"application/json",...n},mode:"cors",credentials:"include",body:JSON.stringify(e)}).then(async o=>{const c=o.body.pipeThrough(new window.TextDecoderStream).getReader();for(;;)try{const{value:i,done:a}=await c.read();if(!o.ok){this.handleError(i||o.statusText,o.status,t);break}if(a)break;i.toString().split(`
19
+ `,c.map=[t,e.line],!0},Bs=function(e,t,n,s){var o,c,i,a,l,u,d,f=!1,h=e.bMarks[t]+e.tShift[t],k=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||h+3>k||(o=e.src.charCodeAt(h),o!==126&&o!==96)||(l=h,h=e.skipChars(h,o),c=h-l,c<3)||(d=e.src.slice(l,h),i=e.src.slice(h,k),o===96&&i.indexOf(String.fromCharCode(o))>=0))return!1;if(s)return!0;for(a=t;a++,!(a>=n||(h=l=e.bMarks[a]+e.tShift[a],k=e.eMarks[a],h<k&&e.sCount[a]<e.blkIndent));)if(e.src.charCodeAt(h)===o&&!(e.sCount[a]-e.blkIndent>=4)&&(h=e.skipChars(h,o),!(h-l<c)&&(h=e.skipSpaces(h),!(h<k)))){f=!0;break}return c=e.sCount[t],e.line=a+(f?1:0),u=e.push("fence","code",0),u.info=i,u.content=e.getLines(t+1,a,c,!0),u.markup=d,u.map=[t,e.line],!0},Ss=I.isSpace,Ls=function(e,t,n,s){var o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E,m,R,N,K=e.lineMax,T=e.bMarks[t]+e.tShift[t],j=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(T)!==62)return!1;if(s)return!0;for(k=[],x=[],w=[],y=[],m=e.md.block.ruler.getRules("blockquote"),v=e.parentType,e.parentType="blockquote",f=t;f<n&&(N=e.sCount[f]<e.blkIndent,T=e.bMarks[f]+e.tShift[f],j=e.eMarks[f],!(T>=j));f++){if(e.src.charCodeAt(T++)===62&&!N){for(a=e.sCount[f]+1,e.src.charCodeAt(T)===32?(T++,a++,o=!1,L=!0):e.src.charCodeAt(T)===9?(L=!0,(e.bsCount[f]+a)%4===3?(T++,a++,o=!1):o=!0):L=!1,h=a,k.push(e.bMarks[f]),e.bMarks[f]=T;T<j&&(c=e.src.charCodeAt(T),Ss(c));){c===9?h+=4-(h+e.bsCount[f]+(o?1:0))%4:h++;T++}u=T>=j,x.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(L?1:0),w.push(e.sCount[f]),e.sCount[f]=h-a,y.push(e.tShift[f]),e.tShift[f]=T-e.bMarks[f];continue}if(u)break;for(E=!1,i=0,l=m.length;i<l;i++)if(m[i](e,f,n,!0)){E=!0;break}if(E){e.lineMax=f,e.blkIndent!==0&&(k.push(e.bMarks[f]),x.push(e.bsCount[f]),y.push(e.tShift[f]),w.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}k.push(e.bMarks[f]),x.push(e.bsCount[f]),y.push(e.tShift[f]),w.push(e.sCount[f]),e.sCount[f]=-1}for(B=e.blkIndent,e.blkIndent=0,R=e.push("blockquote_open","blockquote",1),R.markup=">",R.map=d=[t,0],e.md.block.tokenize(e,t,f),R=e.push("blockquote_close","blockquote",-1),R.markup=">",e.lineMax=K,e.parentType=v,d[1]=e.line,i=0;i<y.length;i++)e.bMarks[i+t]=k[i],e.tShift[i+t]=y[i],e.sCount[i+t]=w[i],e.bsCount[i+t]=x[i];return e.blkIndent=B,!0},Ts=I.isSpace,qs=function(e,t,n,s){var o,c,i,a,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(o=e.src.charCodeAt(l++),o!==42&&o!==45&&o!==95))return!1;for(c=1;l<u;){if(i=e.src.charCodeAt(l++),i!==o&&!Ts(i))return!1;i===o&&c++}return c<3?!1:(s||(e.line=t+1,a=e.push("hr","hr",0),a.map=[t,e.line],a.markup=Array(c+1).join(String.fromCharCode(o))),!0)},Zr=I.isSpace;function jr(r,e){var t,n,s,o;return n=r.bMarks[e]+r.tShift[e],s=r.eMarks[e],t=r.src.charCodeAt(n++),t!==42&&t!==45&&t!==43||n<s&&(o=r.src.charCodeAt(n),!Zr(o))?-1:n}function Jr(r,e){var t,n=r.bMarks[e]+r.tShift[e],s=n,o=r.eMarks[e];if(s+1>=o||(t=r.src.charCodeAt(s++),t<48||t>57))return-1;for(;;){if(s>=o)return-1;if(t=r.src.charCodeAt(s++),t>=48&&t<=57){if(s-n>=10)return-1;continue}if(t===41||t===46)break;return-1}return s<o&&(t=r.src.charCodeAt(s),!Zr(t))?-1:s}function Ms(r,e){var t,n,s=r.level+2;for(t=e+2,n=r.tokens.length-2;t<n;t++)r.tokens[t].level===s&&r.tokens[t].type==="paragraph_open"&&(r.tokens[t+2].hidden=!0,r.tokens[t].hidden=!0,t+=2)}var Rs=function(e,t,n,s){var o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E,m,R,N,K,T,j,D,F,b,q,_=t,Y=!1,Be=!0;if(e.sCount[_]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[_]-e.listIndent>=4&&e.sCount[_]<e.blkIndent)return!1;if(s&&e.parentType==="paragraph"&&e.sCount[_]>=e.blkIndent&&(Y=!0),(T=Jr(e,_))>=0){if(d=!0,D=e.bMarks[_]+e.tShift[_],v=Number(e.src.slice(D,T-1)),Y&&v!==1)return!1}else if((T=jr(e,_))>=0)d=!1;else return!1;if(Y&&e.skipSpaces(T)>=e.eMarks[_])return!1;if(s)return!0;for(B=e.src.charCodeAt(T-1),x=e.tokens.length,d?(q=e.push("ordered_list_open","ol",1),v!==1&&(q.attrs=[["start",v]])):q=e.push("bullet_list_open","ul",1),q.map=k=[_,0],q.markup=String.fromCharCode(B),j=!1,b=e.md.block.ruler.getRules("list"),E=e.parentType,e.parentType="list";_<n;){for(K=T,w=e.eMarks[_],u=y=e.sCount[_]+T-(e.bMarks[_]+e.tShift[_]);K<w;){if(o=e.src.charCodeAt(K),o===9)y+=4-(y+e.bsCount[_])%4;else if(o===32)y++;else break;K++}if(c=K,c>=w?l=1:l=y-u,l>4&&(l=1),a=u+l,q=e.push("list_item_open","li",1),q.markup=String.fromCharCode(B),q.map=f=[_,0],d&&(q.info=e.src.slice(D,T-1)),N=e.tight,R=e.tShift[_],m=e.sCount[_],L=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=a,e.tight=!0,e.tShift[_]=c-e.bMarks[_],e.sCount[_]=y,c>=w&&e.isEmpty(_+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,_,n,!0),(!e.tight||j)&&(Be=!1),j=e.line-_>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=L,e.tShift[_]=R,e.sCount[_]=m,e.tight=N,q=e.push("list_item_close","li",-1),q.markup=String.fromCharCode(B),_=e.line,f[1]=_,_>=n||e.sCount[_]<e.blkIndent||e.sCount[_]-e.blkIndent>=4)break;for(F=!1,i=0,h=b.length;i<h;i++)if(b[i](e,_,n,!0)){F=!0;break}if(F)break;if(d){if(T=Jr(e,_),T<0)break;D=e.bMarks[_]+e.tShift[_]}else if(T=jr(e,_),T<0)break;if(B!==e.src.charCodeAt(T-1))break}return d?q=e.push("ordered_list_close","ol",-1):q=e.push("bullet_list_close","ul",-1),q.markup=String.fromCharCode(B),k[1]=_,e.line=_,e.parentType=E,Be&&Ms(e,x),!0},Is=I.normalizeReference,ot=I.isSpace,Ns=function(e,t,n,s){var o,c,i,a,l,u,d,f,h,k,x,B,v,w,y,L,E=0,m=e.bMarks[t]+e.tShift[t],R=e.eMarks[t],N=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(m)!==91)return!1;for(;++m<R;)if(e.src.charCodeAt(m)===93&&e.src.charCodeAt(m-1)!==92){if(m+1===R||e.src.charCodeAt(m+1)!==58)return!1;break}for(a=e.lineMax,y=e.md.block.ruler.getRules("reference"),k=e.parentType,e.parentType="reference";N<a&&!e.isEmpty(N);N++)if(!(e.sCount[N]-e.blkIndent>3)&&!(e.sCount[N]<0)){for(w=!1,u=0,d=y.length;u<d;u++)if(y[u](e,N,a,!0)){w=!0;break}if(w)break}for(v=e.getLines(t,N,e.blkIndent,!1).trim(),R=v.length,m=1;m<R;m++){if(o=v.charCodeAt(m),o===91)return!1;if(o===93){h=m;break}else o===10?E++:o===92&&(m++,m<R&&v.charCodeAt(m)===10&&E++)}if(h<0||v.charCodeAt(h+1)!==58)return!1;for(m=h+2;m<R;m++)if(o=v.charCodeAt(m),o===10)E++;else if(!ot(o))break;if(x=e.md.helpers.parseLinkDestination(v,m,R),!x.ok||(l=e.md.normalizeLink(x.str),!e.md.validateLink(l)))return!1;for(m=x.pos,E+=x.lines,c=m,i=E,B=m;m<R;m++)if(o=v.charCodeAt(m),o===10)E++;else if(!ot(o))break;for(x=e.md.helpers.parseLinkTitle(v,m,R),m<R&&B!==m&&x.ok?(L=x.str,m=x.pos,E+=x.lines):(L="",m=c,E=i);m<R&&(o=v.charCodeAt(m),!!ot(o));)m++;if(m<R&&v.charCodeAt(m)!==10&&L)for(L="",m=c,E=i;m<R&&(o=v.charCodeAt(m),!!ot(o));)m++;return m<R&&v.charCodeAt(m)!==10||(f=Is(v.slice(1,h)),!f)?!1:(s||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[f]>"u"&&(e.env.references[f]={title:L,href:l}),e.parentType=k,e.line=t+E+1),!0)},Fs=["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"],st={},zs="[a-zA-Z_:][a-zA-Z0-9:._-]*",Ps="[^\"'=<>`\\x00-\\x20]+",Qs="'[^']*'",Us='"[^"]*"',Hs="(?:"+Ps+"|"+Qs+"|"+Us+")",Os="(?:\\s+"+zs+"(?:\\s*=\\s*"+Hs+")?)",Wr="<[A-Za-z][A-Za-z0-9\\-]*"+Os+"*\\s*\\/?>",Xr="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Vs="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",Gs="<[?][\\s\\S]*?[?]>",Ys="<![A-Z]+\\s+[^>]*>",Zs="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",js=new RegExp("^(?:"+Wr+"|"+Xr+"|"+Vs+"|"+Gs+"|"+Ys+"|"+Zs+")"),Js=new RegExp("^(?:"+Wr+"|"+Xr+")");st.HTML_TAG_RE=js,st.HTML_OPEN_CLOSE_TAG_RE=Js;var Ws=Fs,Xs=st.HTML_OPEN_CLOSE_TAG_RE,Ce=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Ws.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Xs.source+"\\s*$"),/^$/,!1]],Ks=function(e,t,n,s){var o,c,i,a,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(l)!==60)return!1;for(a=e.src.slice(l,u),o=0;o<Ce.length&&!Ce[o][0].test(a);o++);if(o===Ce.length)return!1;if(s)return Ce[o][2];if(c=t+1,!Ce[o][1].test(a)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(l=e.bMarks[c]+e.tShift[c],u=e.eMarks[c],a=e.src.slice(l,u),Ce[o][1].test(a)){a.length!==0&&c++;break}}return e.line=c,i=e.push("html_block","",0),i.map=[t,c],i.content=e.getLines(t,c,e.blkIndent,!0),!0},Kr=I.isSpace,$s=function(e,t,n,s){var o,c,i,a,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||(o=e.src.charCodeAt(l),o!==35||l>=u))return!1;for(c=1,o=e.src.charCodeAt(++l);o===35&&l<u&&c<=6;)c++,o=e.src.charCodeAt(++l);return c>6||l<u&&!Kr(o)?!1:(s||(u=e.skipSpacesBack(u,l),i=e.skipCharsBack(u,35,l),i>l&&Kr(e.src.charCodeAt(i-1))&&(u=i),e.line=t+1,a=e.push("heading_open","h"+String(c),1),a.markup="########".slice(0,c),a.map=[t,e.line],a=e.push("inline","",0),a.content=e.src.slice(l,u).trim(),a.map=[t,e.line],a.children=[],a=e.push("heading_close","h"+String(c),-1),a.markup="########".slice(0,c)),!0)},ec=function(e,t,n){var s,o,c,i,a,l,u,d,f,h=t+1,k,x=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;for(k=e.parentType,e.parentType="paragraph";h<n&&!e.isEmpty(h);h++)if(!(e.sCount[h]-e.blkIndent>3)){if(e.sCount[h]>=e.blkIndent&&(l=e.bMarks[h]+e.tShift[h],u=e.eMarks[h],l<u&&(f=e.src.charCodeAt(l),(f===45||f===61)&&(l=e.skipChars(l,f),l=e.skipSpaces(l),l>=u)))){d=f===61?1:2;break}if(!(e.sCount[h]<0)){for(o=!1,c=0,i=x.length;c<i;c++)if(x[c](e,h,n,!0)){o=!0;break}if(o)break}}return d?(s=e.getLines(t,h,e.blkIndent,!1).trim(),e.line=h+1,a=e.push("heading_open","h"+String(d),1),a.markup=String.fromCharCode(f),a.map=[t,e.line],a=e.push("inline","",0),a.content=s,a.map=[t,e.line-1],a.children=[],a=e.push("heading_close","h"+String(d),-1),a.markup=String.fromCharCode(f),e.parentType=k,!0):!1},tc=function(e,t,n){var s,o,c,i,a,l,u=t+1,d=e.md.block.ruler.getRules("paragraph");for(l=e.parentType,e.parentType="paragraph";u<n&&!e.isEmpty(u);u++)if(!(e.sCount[u]-e.blkIndent>3)&&!(e.sCount[u]<0)){for(o=!1,c=0,i=d.length;c<i;c++)if(d[c](e,u,n,!0)){o=!0;break}if(o)break}return s=e.getLines(t,u,e.blkIndent,!1).trim(),e.line=u,a=e.push("paragraph_open","p",1),a.map=[t,e.line],a=e.push("inline","",0),a.content=s,a.map=[t,e.line],a.children=[],a=e.push("paragraph_close","p",-1),e.parentType=l,!0},$r=Tt,ct=I.isSpace;function ae(r,e,t,n){var s,o,c,i,a,l,u,d;for(this.src=r,this.md=e,this.env=t,this.tokens=n,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="",o=this.src,d=!1,c=i=l=u=0,a=o.length;i<a;i++){if(s=o.charCodeAt(i),!d)if(ct(s)){l++,s===9?u+=4-u%4:u++;continue}else d=!0;(s===10||i===a-1)&&(s!==10&&i++,this.bMarks.push(c),this.eMarks.push(i),this.tShift.push(l),this.sCount.push(u),this.bsCount.push(0),d=!1,l=0,u=0,c=i+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}ae.prototype.push=function(r,e,t){var n=new $r(r,e,t);return n.block=!0,t<0&&this.level--,n.level=this.level,t>0&&this.level++,this.tokens.push(n),n},ae.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},ae.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},ae.prototype.skipSpaces=function(e){for(var t,n=this.src.length;e<n&&(t=this.src.charCodeAt(e),!!ct(t));e++);return e},ae.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!ct(this.src.charCodeAt(--e)))return e+1;return e},ae.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},ae.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},ae.prototype.getLines=function(e,t,n,s){var o,c,i,a,l,u,d,f=e;if(e>=t)return"";for(u=new Array(t-e),o=0;f<t;f++,o++){for(c=0,d=a=this.bMarks[f],f+1<t||s?l=this.eMarks[f]+1:l=this.eMarks[f];a<l&&c<n;){if(i=this.src.charCodeAt(a),ct(i))i===9?c+=4-(c+this.bsCount[f])%4:c++;else if(a-d<this.tShift[f])c++;else break;a++}c>n?u[o]=new Array(c-n+1).join(" ")+this.src.slice(a,l):u[o]=this.src.slice(a,l)}return u.join("")},ae.prototype.Token=$r;var rc=ae,nc=Lt,it=[["table",Cs,["paragraph","reference"]],["code",Ds],["fence",Bs,["paragraph","reference","blockquote","list"]],["blockquote",Ls,["paragraph","reference","blockquote","list"]],["hr",qs,["paragraph","reference","blockquote","list"]],["list",Rs,["paragraph","reference","blockquote"]],["reference",Ns],["html_block",Ks,["paragraph","reference","blockquote"]],["heading",$s,["paragraph","reference","blockquote"]],["lheading",ec],["paragraph",tc]];function at(){this.ruler=new nc;for(var r=0;r<it.length;r++)this.ruler.push(it[r][0],it[r][1],{alt:(it[r][2]||[]).slice()})}at.prototype.tokenize=function(r,e,t){for(var n,s,o,c=this.ruler.getRules(""),i=c.length,a=e,l=!1,u=r.md.options.maxNesting;a<t&&(r.line=a=r.skipEmptyLines(a),!(a>=t||r.sCount[a]<r.blkIndent));){if(r.level>=u){r.line=t;break}for(o=r.line,s=0;s<i;s++)if(n=c[s](r,a,t,!1),n){if(o>=r.line)throw new Error("block rule didn't increment state.line");break}if(!n)throw new Error("none of the block rules matched");r.tight=!l,r.isEmpty(r.line-1)&&(l=!0),a=r.line,a<t&&r.isEmpty(a)&&(l=!0,a++,r.line=a)}},at.prototype.parse=function(r,e,t,n){var s;r&&(s=new this.State(r,e,t,n),this.tokenize(s,s.line,s.lineMax))},at.prototype.State=rc;var oc=at;function sc(r){switch(r){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 cc=function(e,t){for(var n=e.pos;n<e.posMax&&!sc(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)},ic=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i,ac=function(e,t){var n,s,o,c,i,a,l,u;return!e.md.options.linkify||e.linkLevel>0||(n=e.pos,s=e.posMax,n+3>s)||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47||(o=e.pending.match(ic),!o)||(c=o[1],i=e.md.linkify.matchAtStart(e.src.slice(n-c.length)),!i)||(a=i.url,a.length<=c.length)||(a=a.replace(/\*+$/,""),l=e.md.normalizeLink(a),!e.md.validateLink(l))?!1:(t||(e.pending=e.pending.slice(0,-c.length),u=e.push("link_open","a",1),u.attrs=[["href",l]],u.markup="linkify",u.info="auto",u=e.push("text","",0),u.content=e.md.normalizeLinkText(a),u=e.push("link_close","a",-1),u.markup="linkify",u.info="auto"),e.pos+=a.length-c.length,!0)},lc=I.isSpace,Ac=function(e,t){var n,s,o,c=e.pos;if(e.src.charCodeAt(c)!==10)return!1;if(n=e.pending.length-1,s=e.posMax,!t)if(n>=0&&e.pending.charCodeAt(n)===32)if(n>=1&&e.pending.charCodeAt(n-1)===32){for(o=n-1;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(c++;c<s&&lc(e.src.charCodeAt(c));)c++;return e.pos=c,!0},uc=I.isSpace,Nt=[],en=0;en<256;en++)Nt.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(r){Nt[r.charCodeAt(0)]=1});var pc=function(e,t){var n,s,o,c,i,a=e.pos,l=e.posMax;if(e.src.charCodeAt(a)!==92||(a++,a>=l))return!1;if(n=e.src.charCodeAt(a),n===10){for(t||e.push("hardbreak","br",0),a++;a<l&&(n=e.src.charCodeAt(a),!!uc(n));)a++;return e.pos=a,!0}return c=e.src[a],n>=55296&&n<=56319&&a+1<l&&(s=e.src.charCodeAt(a+1),s>=56320&&s<=57343&&(c+=e.src[a+1],a++)),o="\\"+c,t||(i=e.push("text_special","",0),n<256&&Nt[n]!==0?i.content=c:i.content=o,i.markup=o,i.info="escape"),e.pos=a+1,!0},fc=function(e,t){var n,s,o,c,i,a,l,u,d=e.pos,f=e.src.charCodeAt(d);if(f!==96)return!1;for(n=d,d++,s=e.posMax;d<s&&e.src.charCodeAt(d)===96;)d++;if(o=e.src.slice(n,d),l=o.length,e.backticksScanned&&(e.backticks[l]||0)<=n)return t||(e.pending+=o),e.pos+=l,!0;for(a=d;(i=e.src.indexOf("`",a))!==-1;){for(a=i+1;a<s&&e.src.charCodeAt(a)===96;)a++;if(u=a-i,u===l)return t||(c=e.push("code_inline","code",0),c.markup=o,c.content=e.src.slice(d,i).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),e.pos=a,!0;e.backticks[u]=i}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=l,!0},lt={};lt.tokenize=function(e,t){var n,s,o,c,i,a=e.pos,l=e.src.charCodeAt(a);if(t||l!==126||(s=e.scanDelims(e.pos,!0),c=s.length,i=String.fromCharCode(l),c<2))return!1;for(c%2&&(o=e.push("text","",0),o.content=i,c--),n=0;n<c;n+=2)o=e.push("text","",0),o.content=i+i,e.delimiters.push({marker:l,length:0,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0};function tn(r,e){var t,n,s,o,c,i=[],a=e.length;for(t=0;t<a;t++)s=e[t],s.marker===126&&s.end!==-1&&(o=e[s.end],c=r.tokens[s.token],c.type="s_open",c.tag="s",c.nesting=1,c.markup="~~",c.content="",c=r.tokens[o.token],c.type="s_close",c.tag="s",c.nesting=-1,c.markup="~~",c.content="",r.tokens[o.token-1].type==="text"&&r.tokens[o.token-1].content==="~"&&i.push(o.token-1));for(;i.length;){for(t=i.pop(),n=t+1;n<r.tokens.length&&r.tokens[n].type==="s_close";)n++;n--,t!==n&&(c=r.tokens[n],r.tokens[n]=r.tokens[t],r.tokens[t]=c)}}lt.postProcess=function(e){var t,n=e.tokens_meta,s=e.tokens_meta.length;for(tn(e,e.delimiters),t=0;t<s;t++)n[t]&&n[t].delimiters&&tn(e,n[t].delimiters)};var At={};At.tokenize=function(e,t){var n,s,o,c=e.pos,i=e.src.charCodeAt(c);if(t||i!==95&&i!==42)return!1;for(s=e.scanDelims(e.pos,i===42),n=0;n<s.length;n++)o=e.push("text","",0),o.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:s.length,token:e.tokens.length-1,end:-1,open:s.can_open,close:s.can_close});return e.pos+=s.length,!0};function rn(r,e){var t,n,s,o,c,i,a=e.length;for(t=a-1;t>=0;t--)n=e[t],!(n.marker!==95&&n.marker!==42)&&n.end!==-1&&(s=e[n.end],i=t>0&&e[t-1].end===n.end+1&&e[t-1].marker===n.marker&&e[t-1].token===n.token-1&&e[n.end+1].token===s.token+1,c=String.fromCharCode(n.marker),o=r.tokens[n.token],o.type=i?"strong_open":"em_open",o.tag=i?"strong":"em",o.nesting=1,o.markup=i?c+c:c,o.content="",o=r.tokens[s.token],o.type=i?"strong_close":"em_close",o.tag=i?"strong":"em",o.nesting=-1,o.markup=i?c+c:c,o.content="",i&&(r.tokens[e[t-1].token].content="",r.tokens[e[n.end+1].token].content="",t--))}At.postProcess=function(e){var t,n=e.tokens_meta,s=e.tokens_meta.length;for(rn(e,e.delimiters),t=0;t<s;t++)n[t]&&n[t].delimiters&&rn(e,n[t].delimiters)};var dc=I.normalizeReference,Ft=I.isSpace,hc=function(e,t){var n,s,o,c,i,a,l,u,d,f="",h="",k=e.pos,x=e.posMax,B=e.pos,v=!0;if(e.src.charCodeAt(e.pos)!==91||(i=e.pos+1,c=e.md.helpers.parseLinkLabel(e,e.pos,!0),c<0))return!1;if(a=c+1,a<x&&e.src.charCodeAt(a)===40){for(v=!1,a++;a<x&&(s=e.src.charCodeAt(a),!(!Ft(s)&&s!==10));a++);if(a>=x)return!1;if(B=a,l=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),l.ok){for(f=e.md.normalizeLink(l.str),e.md.validateLink(f)?a=l.pos:f="",B=a;a<x&&(s=e.src.charCodeAt(a),!(!Ft(s)&&s!==10));a++);if(l=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<x&&B!==a&&l.ok)for(h=l.str,a=l.pos;a<x&&(s=e.src.charCodeAt(a),!(!Ft(s)&&s!==10));a++);}(a>=x||e.src.charCodeAt(a)!==41)&&(v=!0),a++}if(v){if(typeof e.env.references>"u")return!1;if(a<x&&e.src.charCodeAt(a)===91?(B=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?o=e.src.slice(B,a++):a=c+1):a=c+1,o||(o=e.src.slice(i,c)),u=e.env.references[dc(o)],!u)return e.pos=k,!1;f=u.href,h=u.title}return t||(e.pos=i,e.posMax=c,d=e.push("link_open","a",1),d.attrs=n=[["href",f]],h&&n.push(["title",h]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,d=e.push("link_close","a",-1)),e.pos=a,e.posMax=x,!0},mc=I.normalizeReference,zt=I.isSpace,gc=function(e,t){var n,s,o,c,i,a,l,u,d,f,h,k,x,B="",v=e.pos,w=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91||(a=e.pos+2,i=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),i<0))return!1;if(l=i+1,l<w&&e.src.charCodeAt(l)===40){for(l++;l<w&&(s=e.src.charCodeAt(l),!(!zt(s)&&s!==10));l++);if(l>=w)return!1;for(x=l,d=e.md.helpers.parseLinkDestination(e.src,l,e.posMax),d.ok&&(B=e.md.normalizeLink(d.str),e.md.validateLink(B)?l=d.pos:B=""),x=l;l<w&&(s=e.src.charCodeAt(l),!(!zt(s)&&s!==10));l++);if(d=e.md.helpers.parseLinkTitle(e.src,l,e.posMax),l<w&&x!==l&&d.ok)for(f=d.str,l=d.pos;l<w&&(s=e.src.charCodeAt(l),!(!zt(s)&&s!==10));l++);else f="";if(l>=w||e.src.charCodeAt(l)!==41)return e.pos=v,!1;l++}else{if(typeof e.env.references>"u")return!1;if(l<w&&e.src.charCodeAt(l)===91?(x=l+1,l=e.md.helpers.parseLinkLabel(e,l),l>=0?c=e.src.slice(x,l++):l=i+1):l=i+1,c||(c=e.src.slice(a,i)),u=e.env.references[mc(c)],!u)return e.pos=v,!1;B=u.href,f=u.title}return t||(o=e.src.slice(a,i),e.md.inline.parse(o,e.md,e.env,k=[]),h=e.push("image","img",0),h.attrs=n=[["src",B],["alt",""]],h.children=k,h.content=o,f&&n.push(["title",f])),e.pos=l,e.posMax=w,!0},bc=/^([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])?)*)$/,kc=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,wc=function(e,t){var n,s,o,c,i,a,l=e.pos;if(e.src.charCodeAt(l)!==60)return!1;for(i=e.pos,a=e.posMax;;){if(++l>=a||(c=e.src.charCodeAt(l),c===60))return!1;if(c===62)break}return n=e.src.slice(i+1,l),kc.test(n)?(s=e.md.normalizeLink(n),e.md.validateLink(s)?(t||(o=e.push("link_open","a",1),o.attrs=[["href",s]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(n),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=n.length+2,!0):!1):bc.test(n)?(s=e.md.normalizeLink("mailto:"+n),e.md.validateLink(s)?(t||(o=e.push("link_open","a",1),o.attrs=[["href",s]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(n),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=n.length+2,!0):!1):!1},xc=st.HTML_TAG_RE;function Ec(r){return/^<a[>\s]/i.test(r)}function yc(r){return/^<\/a\s*>/i.test(r)}function vc(r){var e=r|32;return e>=97&&e<=122}var _c=function(e,t){var n,s,o,c,i=e.pos;return!e.md.options.html||(o=e.posMax,e.src.charCodeAt(i)!==60||i+2>=o)||(n=e.src.charCodeAt(i+1),n!==33&&n!==63&&n!==47&&!vc(n))||(s=e.src.slice(i).match(xc),!s)?!1:(t||(c=e.push("html_inline","",0),c.content=s[0],Ec(c.content)&&e.linkLevel++,yc(c.content)&&e.linkLevel--),e.pos+=s[0].length,!0)},nn=Er,Cc=I.has,Dc=I.isValidEntityCode,on=I.fromCodePoint,Bc=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Sc=/^&([a-z][a-z0-9]{1,31});/i,Lc=function(e,t){var n,s,o,c,i=e.pos,a=e.posMax;if(e.src.charCodeAt(i)!==38||i+1>=a)return!1;if(n=e.src.charCodeAt(i+1),n===35){if(o=e.src.slice(i).match(Bc),o)return t||(s=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),c=e.push("text_special","",0),c.content=Dc(s)?on(s):on(65533),c.markup=o[0],c.info="entity"),e.pos+=o[0].length,!0}else if(o=e.src.slice(i).match(Sc),o&&Cc(nn,o[1]))return t||(c=e.push("text_special","",0),c.content=nn[o[1]],c.markup=o[0],c.info="entity"),e.pos+=o[0].length,!0;return!1};function sn(r){var e,t,n,s,o,c,i,a,l={},u=r.length;if(u){var d=0,f=-2,h=[];for(e=0;e<u;e++)if(n=r[e],h.push(0),(r[d].marker!==n.marker||f!==n.token-1)&&(d=e),f=n.token,n.length=n.length||0,!!n.close){for(l.hasOwnProperty(n.marker)||(l[n.marker]=[-1,-1,-1,-1,-1,-1]),o=l[n.marker][(n.open?3:0)+n.length%3],t=d-h[d]-1,c=t;t>o;t-=h[t]+1)if(s=r[t],s.marker===n.marker&&s.open&&s.end<0&&(i=!1,(s.close||n.open)&&(s.length+n.length)%3===0&&(s.length%3!==0||n.length%3!==0)&&(i=!0),!i)){a=t>0&&!r[t-1].open?h[t-1]+1:0,h[e]=e-t+a,h[t]=a,n.open=!1,s.end=e,s.close=!1,c=-1,f=-2;break}c!==-1&&(l[n.marker][(n.open?3:0)+(n.length||0)%3]=c)}}}var Tc=function(e){var t,n=e.tokens_meta,s=e.tokens_meta.length;for(sn(e.delimiters),t=0;t<s;t++)n[t]&&n[t].delimiters&&sn(n[t].delimiters)},qc=function(e){var t,n,s=0,o=e.tokens,c=e.tokens.length;for(t=n=0;t<c;t++)o[t].nesting<0&&s--,o[t].level=s,o[t].nesting>0&&s++,o[t].type==="text"&&t+1<c&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)},Pt=Tt,cn=I.isWhiteSpace,an=I.isPunctChar,ln=I.isMdAsciiPunct;function Pe(r,e,t,n){this.src=r,this.env=t,this.md=e,this.tokens=n,this.tokens_meta=Array(n.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}Pe.prototype.pushPending=function(){var r=new Pt("text","",0);return r.content=this.pending,r.level=this.pendingLevel,this.tokens.push(r),this.pending="",r},Pe.prototype.push=function(r,e,t){this.pending&&this.pushPending();var n=new Pt(r,e,t),s=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],s={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(s),n},Pe.prototype.scanDelims=function(r,e){var t=r,n,s,o,c,i,a,l,u,d,f=!0,h=!0,k=this.posMax,x=this.src.charCodeAt(r);for(n=r>0?this.src.charCodeAt(r-1):32;t<k&&this.src.charCodeAt(t)===x;)t++;return o=t-r,s=t<k?this.src.charCodeAt(t):32,l=ln(n)||an(String.fromCharCode(n)),d=ln(s)||an(String.fromCharCode(s)),a=cn(n),u=cn(s),u?f=!1:d&&(a||l||(f=!1)),a?h=!1:l&&(u||d||(h=!1)),e?(c=f,i=h):(c=f&&(!h||l),i=h&&(!f||d)),{can_open:c,can_close:i,length:o}},Pe.prototype.Token=Pt;var Mc=Pe,An=Lt,Qt=[["text",cc],["linkify",ac],["newline",Ac],["escape",pc],["backticks",fc],["strikethrough",lt.tokenize],["emphasis",At.tokenize],["link",hc],["image",gc],["autolink",wc],["html_inline",_c],["entity",Lc]],Ut=[["balance_pairs",Tc],["strikethrough",lt.postProcess],["emphasis",At.postProcess],["fragments_join",qc]];function Qe(){var r;for(this.ruler=new An,r=0;r<Qt.length;r++)this.ruler.push(Qt[r][0],Qt[r][1]);for(this.ruler2=new An,r=0;r<Ut.length;r++)this.ruler2.push(Ut[r][0],Ut[r][1])}Qe.prototype.skipToken=function(r){var e,t,n=r.pos,s=this.ruler.getRules(""),o=s.length,c=r.md.options.maxNesting,i=r.cache;if(typeof i[n]<"u"){r.pos=i[n];return}if(r.level<c){for(t=0;t<o;t++)if(r.level++,e=s[t](r,!0),r.level--,e){if(n>=r.pos)throw new Error("inline rule didn't increment state.pos");break}}else r.pos=r.posMax;e||r.pos++,i[n]=r.pos},Qe.prototype.tokenize=function(r){for(var e,t,n,s=this.ruler.getRules(""),o=s.length,c=r.posMax,i=r.md.options.maxNesting;r.pos<c;){if(n=r.pos,r.level<i){for(t=0;t<o;t++)if(e=s[t](r,!1),e){if(n>=r.pos)throw new Error("inline rule didn't increment state.pos");break}}if(e){if(r.pos>=c)break;continue}r.pending+=r.src[r.pos++]}r.pending&&r.pushPending()},Qe.prototype.parse=function(r,e,t,n){var s,o,c,i=new this.State(r,e,t,n);for(this.tokenize(i),o=this.ruler2.getRules(""),c=o.length,s=0;s<c;s++)o[s](i)},Qe.prototype.State=Mc;var Rc=Qe,Ht,un;function Ic(){return un||(un=1,Ht=function(r){var e={};r=r||{},e.src_Any=Tr().source,e.src_Cc=Mr().source,e.src_Z=Nr().source,e.src_P=_t.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");var t="[><|]";return e.src_pseudo_letter="(?:(?!"+t+"|"+e.src_ZPCc+")"+e.src_Any+")",e.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]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+t+"|"+e.src_ZPCc+")(?!"+(r["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(r["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}),Ht}function Ot(r){var e=Array.prototype.slice.call(arguments,1);return e.forEach(function(t){t&&Object.keys(t).forEach(function(n){r[n]=t[n]})}),r}function ut(r){return Object.prototype.toString.call(r)}function Nc(r){return ut(r)==="[object String]"}function Fc(r){return ut(r)==="[object Object]"}function zc(r){return ut(r)==="[object RegExp]"}function pn(r){return ut(r)==="[object Function]"}function Pc(r){return r.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var fn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Qc(r){return Object.keys(r||{}).reduce(function(e,t){return e||fn.hasOwnProperty(t)},!1)}var Uc={"http:":{validate:function(r,e,t){var n=r.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(n)?n.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(r,e,t){var n=r.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(n)?e>=3&&r[e-3]===":"||e>=3&&r[e-3]==="/"?0:n.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(r,e,t){var n=r.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(n)?n.match(t.re.mailto)[0].length:0}}},Hc="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]",Oc="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Vc(r){r.__index__=-1,r.__text_cache__=""}function Gc(r){return function(e,t){var n=e.slice(t);return r.test(n)?n.match(r)[0].length:0}}function dn(){return function(r,e){e.normalize(r)}}function pt(r){var e=r.re=Ic()(r.__opts__),t=r.__tlds__.slice();r.onCompile(),r.__tlds_replaced__||t.push(Hc),t.push(e.src_xn),e.src_tlds=t.join("|");function n(i){return i.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");var s=[];r.__compiled__={};function o(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(r.__schemas__).forEach(function(i){var a=r.__schemas__[i];if(a!==null){var l={validate:null,link:null};if(r.__compiled__[i]=l,Fc(a)){zc(a.validate)?l.validate=Gc(a.validate):pn(a.validate)?l.validate=a.validate:o(i,a),pn(a.normalize)?l.normalize=a.normalize:a.normalize?o(i,a):l.normalize=dn();return}if(Nc(a)){s.push(i);return}o(i,a)}}),s.forEach(function(i){r.__compiled__[r.__schemas__[i]]&&(r.__compiled__[i].validate=r.__compiled__[r.__schemas__[i]].validate,r.__compiled__[i].normalize=r.__compiled__[r.__schemas__[i]].normalize)}),r.__compiled__[""]={validate:null,normalize:dn()};var c=Object.keys(r.__compiled__).filter(function(i){return i.length>0&&r.__compiled__[i]}).map(Pc).join("|");r.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","i"),r.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+c+")","ig"),r.re.schema_at_start=RegExp("^"+r.re.schema_search.source,"i"),r.re.pretest=RegExp("("+r.re.schema_test.source+")|("+r.re.host_fuzzy_test.source+")|@","i"),Vc(r)}function Yc(r,e){var t=r.__index__,n=r.__last_index__,s=r.__text_cache__.slice(t,n);this.schema=r.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=n+e,this.raw=s,this.text=s,this.url=s}function Vt(r,e){var t=new Yc(r,e);return r.__compiled__[t.schema].normalize(t,r),t}function re(r,e){if(!(this instanceof re))return new re(r,e);e||Qc(r)&&(e=r,r={}),this.__opts__=Ot({},fn,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Ot({},Uc,r),this.__compiled__={},this.__tlds__=Oc,this.__tlds_replaced__=!1,this.re={},pt(this)}re.prototype.add=function(e,t){return this.__schemas__[e]=t,pt(this),this},re.prototype.set=function(e){return this.__opts__=Ot(this.__opts__,e),this},re.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,s,o,c,i,a,l,u;if(this.re.schema_test.test(e)){for(a=this.re.schema_search,a.lastIndex=0;(t=a.exec(e))!==null;)if(o=this.testSchemaAt(e,t[2],a.lastIndex),o){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(n=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(c=n.index+n[1].length,(this.__index__<0||c<this.__index__)&&(this.__schema__="",this.__index__=c,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=e.indexOf("@"),u>=0&&(s=e.match(this.re.email_fuzzy))!==null&&(c=s.index+s[1].length,i=s.index+s[0].length,(this.__index__<0||c<this.__index__||c===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=c,this.__last_index__=i))),this.__index__>=0},re.prototype.pretest=function(e){return this.re.pretest.test(e)},re.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},re.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(Vt(this,t)),t=this.__last_index__);for(var s=t?e.slice(t):e;this.test(s);)n.push(Vt(this,t)),s=s.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},re.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;var t=this.re.schema_at_start.exec(e);if(!t)return null;var n=this.testSchemaAt(e,t[2],t[0].length);return n?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+n,Vt(this,0)):null},re.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(n,s,o){return n!==o[s-1]}).reverse(),pt(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,pt(this),this)},re.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)},re.prototype.onCompile=function(){};var Zc=re;const De=2147483647,le=36,Gt=1,Ue=26,jc=38,Jc=700,hn=72,mn=128,gn="-",Wc=/^xn--/,Xc=/[^\0-\x7F]/,Kc=/[\x2E\u3002\uFF0E\uFF61]/g,$c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Yt=le-Gt,Ae=Math.floor,Zt=String.fromCharCode;function he(r){throw new RangeError($c[r])}function ei(r,e){const t=[];let n=r.length;for(;n--;)t[n]=e(r[n]);return t}function bn(r,e){const t=r.split("@");let n="";t.length>1&&(n=t[0]+"@",r=t[1]),r=r.replace(Kc,".");const s=r.split("."),o=ei(s,e).join(".");return n+o}function jt(r){const e=[];let t=0;const n=r.length;for(;t<n;){const s=r.charCodeAt(t++);if(s>=55296&&s<=56319&&t<n){const o=r.charCodeAt(t++);(o&64512)==56320?e.push(((s&1023)<<10)+(o&1023)+65536):(e.push(s),t--)}else e.push(s)}return e}const kn=r=>String.fromCodePoint(...r),ti=function(r){return r>=48&&r<58?26+(r-48):r>=65&&r<91?r-65:r>=97&&r<123?r-97:le},wn=function(r,e){return r+22+75*(r<26)-((e!=0)<<5)},xn=function(r,e,t){let n=0;for(r=t?Ae(r/Jc):r>>1,r+=Ae(r/e);r>Yt*Ue>>1;n+=le)r=Ae(r/Yt);return Ae(n+(Yt+1)*r/(r+jc))},Jt=function(r){const e=[],t=r.length;let n=0,s=mn,o=hn,c=r.lastIndexOf(gn);c<0&&(c=0);for(let i=0;i<c;++i)r.charCodeAt(i)>=128&&he("not-basic"),e.push(r.charCodeAt(i));for(let i=c>0?c+1:0;i<t;){const a=n;for(let u=1,d=le;;d+=le){i>=t&&he("invalid-input");const f=ti(r.charCodeAt(i++));f>=le&&he("invalid-input"),f>Ae((De-n)/u)&&he("overflow"),n+=f*u;const h=d<=o?Gt:d>=o+Ue?Ue:d-o;if(f<h)break;const k=le-h;u>Ae(De/k)&&he("overflow"),u*=k}const l=e.length+1;o=xn(n-a,l,a==0),Ae(n/l)>De-s&&he("overflow"),s+=Ae(n/l),n%=l,e.splice(n++,0,s)}return String.fromCodePoint(...e)},Wt=function(r){const e=[];r=jt(r);const t=r.length;let n=mn,s=0,o=hn;for(const a of r)a<128&&e.push(Zt(a));const c=e.length;let i=c;for(c&&e.push(gn);i<t;){let a=De;for(const u of r)u>=n&&u<a&&(a=u);const l=i+1;a-n>Ae((De-s)/l)&&he("overflow"),s+=(a-n)*l,n=a;for(const u of r)if(u<n&&++s>De&&he("overflow"),u===n){let d=s;for(let f=le;;f+=le){const h=f<=o?Gt:f>=o+Ue?Ue:f-o;if(d<h)break;const k=d-h,x=le-h;e.push(Zt(wn(h+k%x,0))),d=Ae(k/x)}e.push(Zt(wn(d,0))),o=xn(s,l,i===c),s=0,++i}++s,++n}return e.join("")},En=function(r){return bn(r,function(e){return Wc.test(e)?Jt(e.slice(4).toLowerCase()):e})},yn=function(r){return bn(r,function(e){return Xc.test(e)?"xn--"+Wt(e):e})},ri=To(Object.freeze(Object.defineProperty({__proto__:null,decode:Jt,default:{version:"2.3.1",ucs2:{decode:jt,encode:kn},decode:Jt,encode:Wt,toASCII:yn,toUnicode:En},encode:Wt,toASCII:yn,toUnicode:En,ucs2decode:jt,ucs2encode:kn},Symbol.toStringTag,{value:"Module"})));var ni={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},oi={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"]}}},si={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"]}}},He=I,ci=rt,ii=ts,ai=_s,li=oc,Ai=Rc,ui=Zc,ke=ye,vn=ri,pi={default:ni,zero:oi,commonmark:si},fi=/^(vbscript|javascript|file|data):/,di=/^data:image\/(gif|png|jpeg|webp);/;function hi(r){var e=r.trim().toLowerCase();return fi.test(e)?!!di.test(e):!0}var _n=["http:","https:","mailto:"];function mi(r){var e=ke.parse(r,!0);if(e.hostname&&(!e.protocol||_n.indexOf(e.protocol)>=0))try{e.hostname=vn.toASCII(e.hostname)}catch{}return ke.encode(ke.format(e))}function gi(r){var e=ke.parse(r,!0);if(e.hostname&&(!e.protocol||_n.indexOf(e.protocol)>=0))try{e.hostname=vn.toUnicode(e.hostname)}catch{}return ke.decode(ke.format(e),ke.decode.defaultChars+"%")}function oe(r,e){if(!(this instanceof oe))return new oe(r,e);e||He.isString(r)||(e=r||{},r="default"),this.inline=new Ai,this.block=new li,this.core=new ai,this.renderer=new ii,this.linkify=new ui,this.validateLink=hi,this.normalizeLink=mi,this.normalizeLinkText=gi,this.utils=He,this.helpers=He.assign({},ci),this.options={},this.configure(r),e&&this.set(e)}oe.prototype.set=function(r){return He.assign(this.options,r),this},oe.prototype.configure=function(r){var e=this,t;if(He.isString(r)&&(t=r,r=pi[t],!r))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!r)throw new Error("Wrong `markdown-it` preset, can't be empty");return r.options&&e.set(r.options),r.components&&Object.keys(r.components).forEach(function(n){r.components[n].rules&&e[n].ruler.enableOnly(r.components[n].rules),r.components[n].rules2&&e[n].ruler2.enableOnly(r.components[n].rules2)}),this},oe.prototype.enable=function(r,e){var t=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(s){t=t.concat(this[s].ruler.enable(r,!0))},this),t=t.concat(this.inline.ruler2.enable(r,!0));var n=r.filter(function(s){return t.indexOf(s)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this},oe.prototype.disable=function(r,e){var t=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(s){t=t.concat(this[s].ruler.disable(r,!0))},this),t=t.concat(this.inline.ruler2.disable(r,!0));var n=r.filter(function(s){return t.indexOf(s)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this},oe.prototype.use=function(r){var e=[this].concat(Array.prototype.slice.call(arguments,1));return r.apply(r,e),this},oe.prototype.parse=function(r,e){if(typeof r!="string")throw new Error("Input data should be a String");var t=new this.core.State(r,this,e);return this.core.process(t),t.tokens},oe.prototype.render=function(r,e){return e=e||{},this.renderer.render(this.parse(r,e),this.options,e)},oe.prototype.parseInline=function(r,e){var t=new this.core.State(r,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens},oe.prototype.renderInline=function(r,e){return e=e||{},this.renderer.render(this.parseInline(r,e),this.options,e)};var bi=oe,ki=bi;const wi=Lo(ki),xi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA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MW3j/8Dx+VMHl8zFNkAAAAASUVORK5CYII=";var Xt=(r=>(r.Assistant="assistant",r.System="system",r.User="user",r))(Xt||{}),Oe=(r=>(r.Error="error",r.Loading="loading",r.Success="success",r))(Oe||{});const Ei={class:"message-content user"},yi={key:0,class:"time-message user"},vi=["innerHTML"],_i={class:"message-photo user"},Ci=["src"],Di=A.createElementVNode("span",{class:"message-photo ai"},[A.createElementVNode("i",{class:"ai-blueking-icon ai-blueking-ai"})],-1),Bi={class:"message-content ai"},Si={key:0,class:"time-message ai"},Li={key:2,width:"18",height:"18",class:"loading-message","aria-hidden":"true"},Ti=[A.createElementVNode("use",{"xlink:href":"#ai-blueking-quanquan"},null,-1)],qi={key:3,class:"message-wrap"},Mi=["innerHTML"],Ri=A.defineComponent({__name:"render-message",props:{message:{},userPhoto:{default:xi}},setup(r){const e=r,t=A.computed(()=>{var c;const o={error:"ai-blueking-icon ai-blueking-warning-circle-fill",loading:"",success:""};return(c=e.message)!=null&&c.status?o[e.message.status]:""}),n=A.computed(()=>{if(e.message.content){const c=new wi({html:!0}).render(e.message.content);return So.sanitize(c)}return""}),s=A.computed(()=>{const o=je(e.message.time),c=je();return e.message.time?c.isSame(o,"year")?o.format("MM-DD HH:mm:ss"):o.format("YYYY-MM-DD HH:mm:ss"):""});return(o,c)=>(A.openBlock(),A.createElementBlock("li",{class:A.normalizeClass([o.message.role,"message-main"])},[o.message.role===A.unref(Xt).User?(A.openBlock(),A.createElementBlock(A.Fragment,{key:0},[A.createElementVNode("p",Ei,[s.value?(A.openBlock(),A.createElementBlock("span",yi,A.toDisplayString(s.value),1)):A.createCommentVNode("v-if",!0),A.createElementVNode("span",{class:"markdown-message",innerHTML:n.value},null,8,vi)]),A.createElementVNode("span",_i,[A.createElementVNode("img",{src:o.userPhoto},null,8,Ci)])],64)):(A.openBlock(),A.createElementBlock(A.Fragment,{key:1},[Di,A.createElementVNode("p",Bi,[s.value?(A.openBlock(),A.createElementBlock("span",Si,A.toDisplayString(s.value),1)):A.createCommentVNode("v-if",!0),t.value?(A.openBlock(),A.createElementBlock("i",{key:1,class:A.normalizeClass(t.value)},null,2)):A.createCommentVNode("v-if",!0),o.message.status===A.unref(Oe).Loading?(A.openBlock(),A.createElementBlock("svg",Li,Ti)):A.createCommentVNode("v-if",!0),o.message.status===A.unref(Oe).Error?(A.openBlock(),A.createElementBlock("span",qi,A.toDisplayString(o.message.content),1)):(A.openBlock(),A.createElementBlock("span",{key:4,innerHTML:n.value,class:A.normalizeClass({"markdown-message":!0,loading:o.message.status===A.unref(Oe).Loading})},null,10,Mi))])],64))],2))}}),Ii={class:"prompt-list"},Ni={class:"search-group"},Fi=["onClick"],zi={class:"prompt-content"},Pi=Ee(A.defineComponent({__name:"render-send",props:{prompts:{},placeholder:{},value:{}},emits:["update:value","enter","choose-prompt"],setup(r,{emit:e}){const t=r,n=e,s=P.clickoutside,o=P.bkTooltips,c=A.ref(""),i=A.ref(40),a=A.ref(),l=A.ref(!1),u=A.computed(()=>{var E;return((E=t.prompts)==null?void 0:E.filter(m=>m.content.includes(c.value)))||[]}),d=A.computed(()=>{var E;return t.placeholder?t.placeholder:(E=t.prompts)!=null&&E.length?Q("您可以键入 “/” 查看更多Prompt"):Q("请输入")}),f=E=>{n("update:value",E)},h=()=>{var E;t.value==="/"&&((E=t.prompts)!=null&&E.length)?y():L()},k=()=>{A.nextTick(()=>{var m;const E=(m=a.value)==null?void 0:m.$el.querySelector("textarea");(E==null?void 0:E.scrollHeight)>40&&t.value?i.value=E.scrollHeight<=300?E.scrollHeight:300:i.value=40})},x=E=>{n("update:value",E.content),n("choose-prompt",E),L(),w()},B=(E,m)=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),n("enter"))},v=()=>{f("")},w=()=>{var m;const E=(m=a.value)==null?void 0:m.$el.querySelector("textarea");E==null||E.focus()},y=()=>{l.value=!0},L=()=>{l.value=!1};return A.watch(()=>t.value,()=>{k(),h()}),A.onMounted(w),(E,m)=>(A.openBlock(),A.createBlock(A.unref(P.Popover),{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:A.withCtx(()=>{var R;return[A.createElementVNode("div",null,[A.withDirectives((A.openBlock(),A.createElementBlock("section",Ii,[A.createVNode(A.unref(P.Input),{class:"input-search",modelValue:c.value,"onUpdate:modelValue":m[0]||(m[0]=N=>c.value=N),behavior:"simplicity",clearable:""},null,8,["modelValue"]),A.createElementVNode("section",Ni,[(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(u.value,(N,K)=>A.withDirectives((A.openBlock(),A.createElementBlock("span",{class:"group-prompt",key:K,onClick:T=>x(N)},[A.createElementVNode("span",zi,A.toDisplayString(N.content),1)],8,Fi)),[[A.unref(o),{content:N.content,placement:"right",theme:"light",width:300,zIndex:9999999,extCls:"prompt-popover"}]])),128)),(R=u.value)!=null&&R.length?A.createCommentVNode("v-if",!0):(A.openBlock(),A.createBlock(A.unref(P.Exception),{key:0,class:"exception-wrap-item exception-part",scene:"part",type:"search-empty"}))])])),[[A.unref(s),L]])])]}),default:A.withCtx(()=>[A.createElementVNode("section",{style:A.normalizeStyle({"--text-height":i.value+"px"}),class:"send-prompt-container"},[A.createVNode(A.unref(P.Input),{ref_key:"inputRef",ref:a,class:"send-prompt",autosize:!1,clearable:!0,"model-value":E.value,"native-attributes":{autofocus:"autofocus"},placeholder:d.value,row:"1",type:"textarea",onInput:f,onKeydown:B},null,8,["model-value","placeholder"]),E.value?(A.openBlock(),A.createBlock(A.unref(eo.Close),{key:0,class:"show-clear-only-hover bk-input--clear-icon clear-icon",onClick:v})):A.createCommentVNode("v-if",!0)],4)]),_:1},8,["is-show"]))}}),[["__scopeId","data-v-2374c5aa"]]),Qi=(r=>(A.pushScopeId("data-v-fd57f18d"),r=r(),A.popScopeId(),r))(()=>A.createElementVNode("svg",{width:"10",height:"10",class:"ai-blueking-render-stop-icon","aria-hidden":"true"},[A.createElementVNode("use",{"xlink:href":"#ai-blueking-tingzhi"})],-1)),Ui=Ee(A.defineComponent({__name:"render-stop",props:{isShow:{type:Boolean}},emits:["stop"],setup(r,{emit:e}){const t=e,n=()=>{t("stop")};return(s,o)=>s.isShow?(A.openBlock(),A.createElementBlock("span",{key:0,class:"ai-blueking-render-stop",onClick:n},[Qi,A.createTextVNode(" "+A.toDisplayString(A.unref(Q)("终止生成")),1)])):A.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-fd57f18d"]]),Hi={key:0,class:"time-wrapper"},Oi={class:"time-message"},Vi=Ee(A.defineComponent({__name:"render-time",props:{message:{}},setup(r){const e=r,t=A.computed(()=>{var c;const n=je(e.message.time),s=je(),o={0:Q("日"),1:Q("一"),2:Q("二"),3:Q("三"),4:Q("四"),5:Q("五"),6:Q("六")};return!e.message.time||(c=window.showTimes)!=null&&c.some(i=>Math.abs(n.diff(i,"minute"))<10&&i!==e.message.time)?"":(window.showTimes=[...window.showTimes||[],e.message.time],s.isSame(n,"day")?n.format("HH:mm:ss"):s.subtract(1,"day").isSame(n,"week")?Q("昨天")+" "+n.format("HH:mm:ss"):s.isSame(n,"week")?Q("本周")+o[n.day()]+" "+n.format("HH:mm:ss"):s.subtract(1,"week").isSame(n,"week")?Q("上周")+o[n.day()]+" "+n.format("HH:mm:ss"):s.isSame(n,"year")?n.format("MM-DD HH:mm:ss"):n.format("YYYY-MM-DD HH:mm:ss"))});return(n,s)=>t.value?(A.openBlock(),A.createElementBlock("section",Hi,[A.createElementVNode("span",Oi,A.toDisplayString(t.value),1)])):A.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-55c9a119"]]),Cn=r=>(A.pushScopeId("data-v-6cc6ac8a"),r=r(),A.popScopeId(),r),Gi={key:0,width:"18",height:"18",class:"scroll-loading-icon","aria-hidden":"true"},Yi=[Cn(()=>A.createElementVNode("use",{"xlink:href":"#ai-blueking-loading-2"},null,-1))],Zi={class:"ai-operation"},ji={class:"ai-operation-tools"},Ji={class:"ai-operation-input"},Wi=Cn(()=>A.createElementVNode("i",{class:"ai-blueking-icon ai-blueking-fasong"},null,-1)),Xi=Ee(A.defineComponent({__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(r,{emit:e}){const t=r,n=e,s=P.bkTooltips,o=A.ref(""),c=()=>{A.nextTick(()=>{const f=document.querySelector(".ai-blueking-messages");f.scrollTop=f.scrollHeight})},i=no(f=>{if(t.scrollLoading||t.scrollLoadingEnd)return;f.target.scrollTop<200&&n("scroll-load")}),a=()=>{if(o.value){if(t.loading){P.Message({theme:"warning",message:Q("内容正在执行中,请执行完成后再发送")});return}n("send",o.value),o.value=""}},l=f=>{n("choose-prompt",f)},u=()=>{n("stop")};A.watch(()=>t.messages,()=>{const f=document.querySelector(".ai-blueking-messages");(f==null?void 0:f.scrollTop)+(f==null?void 0:f.clientHeight)+100>=(f==null?void 0:f.scrollHeight)&&c()},{deep:!0});const d=()=>{window.showTimes=[]};return A.onMounted(c),A.onBeforeUnmount(d),(f,h)=>(A.openBlock(),A.createElementBlock("section",{style:A.normalizeStyle({background:f.background}),class:"ai-content"},[A.createElementVNode("ul",{class:"ai-messages ai-blueking-messages",onScrollPassive:h[0]||(h[0]=(...k)=>A.unref(i)&&A.unref(i)(...k))},[f.scrollLoading?(A.openBlock(),A.createElementBlock("svg",Gi,Yi)):A.createCommentVNode("v-if",!0),(A.openBlock(!0),A.createElementBlock(A.Fragment,null,A.renderList(f.messages,k=>(A.openBlock(),A.createElementBlock(A.Fragment,{key:k.content},[A.createVNode(Vi,{class:"render-message",message:k},null,8,["message"]),A.createVNode(Ri,{class:"render-message",message:k,"user-photo":f.userPhoto},null,8,["message","user-photo"])],64))),128))],32),A.createElementVNode("section",Zi,[A.createElementVNode("span",ji,[A.createVNode(ao),A.createVNode(Ui,{"is-show":f.loading,onStop:u},null,8,["is-show"])]),A.createElementVNode("section",Ji,[A.createVNode(Pi,{value:o.value,"onUpdate:value":h[1]||(h[1]=k=>o.value=k),placeholder:f.placeholder,prompts:f.prompts,onChoosePrompt:l,onEnter:a},null,8,["value","placeholder","prompts"]),A.withDirectives((A.openBlock(),A.createBlock(A.unref(P.Button),{class:"ai-operation-button",disabled:f.loading||!o.value,size:"large",theme:"primary",onClick:a},{default:A.withCtx(()=>[Wi,A.createTextVNode(" "+A.toDisplayString(A.unref(Q)("发送")),1)]),_:1},8,["disabled"])),[[A.unref(s),{content:A.unref(Q)("内容正在执行中,请执行完成后再发送"),disabled:!f.loading}]])])])],4))}}),[["__scopeId","data-v-6cc6ac8a"]]),Ki={class:"ai-modal-header-icon"},$i=Ee(A.defineComponent({__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(r,{emit:e}){const t=r,n=e,s=P.bkTooltips,o={height:window.innerHeight,width:window.innerWidth},c={isMove:!1,type:"",clientX:0,clientY:0},i=()=>{var F,b,q,_;const D=(Y,Be)=>Y===void 0?Be:Y;return{top:D((F=t.startPosition)==null?void 0:F.top,o.height-t.sizeLimit.height),bottom:D((b=t.startPosition)==null?void 0:b.bottom,0),left:D((q=t.startPosition)==null?void 0:q.left,0),right:D((_=t.startPosition)==null?void 0:_.right,o.width-t.sizeLimit.width)}},a=A.ref(i()),l=A.computed(()=>a.value.top<=t.positionLimit.top&&a.value.bottom<=t.positionLimit.bottom),u=D=>{c.isMove=!0,c.type="move",c.clientX=D.clientX,c.clientY=D.clientY},d=D=>{c.isMove=!0,c.type="rightDrag",c.clientX=D.clientX},f=D=>{c.isMove=!0,c.type="leftDrag",c.clientX=D.clientX},h=D=>{c.isMove=!0,c.type="topDrag",c.clientY=D.clientY},k=D=>{c.isMove=!0,c.type="bottomDrag",c.clientY=D.clientY},x=D=>{c.isMove=!0,c.type="topLeftDrag",c.clientY=D.clientY,c.clientX=D.clientX},B=D=>{c.isMove=!0,c.type="topRightDrag",c.clientY=D.clientY,c.clientX=D.clientX},v=D=>{c.isMove=!0,c.type="bottomLeftDrag",c.clientY=D.clientY,c.clientX=D.clientX},w=D=>{c.isMove=!0,c.type="bottomRightDrag",c.clientY=D.clientY,c.clientX=D.clientX},y=()=>{c.isMove=!1},L=(D,F)=>{["move","leftDrag"].includes(c.type)&&(a.value.left+=D),["move","rightDrag"].includes(c.type)&&(a.value.right-=D),["move","topDrag"].includes(c.type)&&(a.value.top+=F),["move","bottomDrag"].includes(c.type)&&(a.value.bottom-=F),["topLeftDrag"].includes(c.type)&&(a.value.left+=D,a.value.top+=F),["topRightDrag"].includes(c.type)&&(a.value.right-=D,a.value.top+=F),["bottomLeftDrag"].includes(c.type)&&(a.value.left+=D,a.value.bottom-=F),["bottomRightDrag"].includes(c.type)&&(a.value.right-=D,a.value.bottom-=F)},E=(D,F)=>{const{top:b,bottom:q,left:_,right:Y}=a.value;(o.width-_-Y<t.sizeLimit.width||_<t.positionLimit.left||Y<t.positionLimit.right)&&(["move","leftDrag","topLeftDrag","bottomLeftDrag"].includes(c.type)&&(a.value.left-=D),["move","rightDrag","topRightDrag","bottomRightDrag"].includes(c.type)&&(a.value.right+=D)),(o.height-b-q<t.sizeLimit.height||b<t.positionLimit.top||q<t.positionLimit.bottom)&&(["move","topDrag","topRightDrag","topLeftDrag"].includes(c.type)&&(a.value.top-=F),["move","bottomDrag","bottomLeftDrag","bottomRightDrag"].includes(c.type)&&(a.value.bottom+=F))},m=D=>{if(!c.isMove)return;D.preventDefault();const F=D.clientX-c.clientX,b=D.clientY-c.clientY;L(F,b),E(F,b),c.clientX=D.clientX,c.clientY=D.clientY},R=()=>{o.height=window.innerHeight,o.width=window.innerWidth,a.value=i()},N=()=>{a.value.top=t.positionLimit.top,a.value.bottom=t.positionLimit.bottom},K=()=>{a.value.top=o.height-t.sizeLimit.height,a.value.bottom=t.positionLimit.bottom},T=()=>{n("clear")},j=()=>{n("close")};return A.onBeforeMount(()=>{window.addEventListener("mousemove",m,!0),window.addEventListener("mouseup",y),window.addEventListener("resize",R)}),A.onBeforeUnmount(()=>{window.removeEventListener("mousemove",m,!0),window.removeEventListener("mouseup",y),window.removeEventListener("resize",R)}),(D,F)=>(A.openBlock(),A.createElementBlock("section",{style:A.normalizeStyle({top:a.value.top+"px",bottom:a.value.bottom+"px",left:a.value.left+"px",right:a.value.right+"px"}),class:"ai-modal"},[A.createElementVNode("header",{style:A.normalizeStyle({background:D.headBackground}),class:"ai-modal-header",onMousedown:A.withModifiers(u,["stop"])},[A.createElementVNode("span",Ki,[A.createElementVNode("i",{class:A.normalizeClass(D.logo)},null,2),A.createTextVNode(" "+A.toDisplayString(D.name||A.unref(Q)("小鲸")),1)]),A.createElementVNode("span",null,[l.value?A.withDirectives((A.openBlock(),A.createElementBlock("i",{key:0,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxiajuhe",onClick:K},null,512)),[[A.unref(s),{content:A.unref(Q)("向下收缩"),distance:20}]]):A.withDirectives((A.openBlock(),A.createElementBlock("i",{key:1,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxialashen-2",onClick:N},null,512)),[[A.unref(s),{content:A.unref(Q)("向上扩展"),distance:20}]]),A.withDirectives(A.createElementVNode("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-saoba",onClick:T},null,512),[[A.unref(s),{content:A.unref(Q)("清空聊天记录"),distance:20}]]),A.withDirectives(A.createElementVNode("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-shanchu-2",onClick:j},null,512),[[A.unref(s),{content:A.unref(Q)("关闭"),distance:20}]])])],36),A.renderSlot(D.$slots,"default",{},void 0,!0),A.createElementVNode("span",{class:"drag-line left",onMousedown:A.withModifiers(f,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line right",onMousedown:A.withModifiers(d,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line top",onMousedown:A.withModifiers(h,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line bottom",onMousedown:A.withModifiers(k,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line top-left-corner",onMousedown:A.withModifiers(x,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line top-right-corner",onMousedown:A.withModifiers(B,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line bottom-left-corner",onMousedown:A.withModifiers(v,["stop"])},null,32),A.createElementVNode("span",{class:"drag-line bottom-right-corner",onMousedown:A.withModifiers(w,["stop"])},null,32)],4))}}),[["__scopeId","data-v-e603010f"]]),ea=A.defineComponent({__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(r,{emit:e}){const t=e,n=()=>{t("clear")},s=()=>{t("close")},o=l=>{t("send",l)},c=()=>{t("stop")},i=()=>{t("scroll-load")},a=l=>{t("choose-prompt",l)};return(l,u)=>(A.openBlock(),A.createBlock($i,{"head-background":l.headBackground,logo:l.logo,name:l.name,"position-limit":l.positionLimit,"size-limit":l.sizeLimit,"start-position":l.startPosition,onClear:n,onClose:s},{default:A.withCtx(()=>[A.createVNode(Xi,{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:a,onScrollLoad:i,onSend:o,onStop:c},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 r='<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",r):document.addEventListener("DOMContentLoaded",function(){document.body.insertAdjacentHTML("afterbegin",r)})})();class ta{constructor(e,t,n,s,o){xe(this,"controllerMap");xe(this,"handleEnd");xe(this,"handleError");xe(this,"handleReceiveMessage");xe(this,"handleStart");xe(this,"url");this.url=e,this.handleStart=t,this.handleReceiveMessage=n,this.handleEnd=s,this.handleError=o,this.controllerMap={}}stop(e){var t,n;return(n=(t=this.controllerMap[e])==null?void 0:t.abort)==null||n.call(t),this.handleEnd(e)}async stream(e,t,n){const s=new AbortController;this.controllerMap[t]=s,fetch(this.url,{method:"post",signal:s.signal,headers:{"Content-Type":"application/json",...n},mode:"cors",credentials:"include",body:JSON.stringify(e)}).then(async o=>{const c=o.body.pipeThrough(new window.TextDecoderStream).getReader();for(;;)try{const{value:i,done:a}=await c.read();if(!o.ok){this.handleError(i||o.statusText,o.status,t);break}if(a)break;i.toString().split(`
20
20
  `).forEach(u=>{const d=u.replace("data:","").trim();if(ro(d)){const{event:f,content:h,result:k,code:x,message:B}=JSON.parse(d);if(k===!1||o.status!==200){this.handleError(B,x,t);return}switch(f){case"text":this.handleReceiveMessage(h,t);break;case"done":this.handleEnd(t);break;case"error":this.handleError(B,x,t);break}}})}catch(i){(i==null?void 0:i.code)!==20&&this.handleError(i.message,i.code,t);break}}).catch(o=>{(o==null?void 0:o.code)!==20&&this.handleError(o.message,o.code,t)}),await this.handleStart(t)}}P.provideGlobalConfig({prefix:"bk"}),H.ChatHelper=ta,H.MessageStatus=Oe,H.RoleType=Xt,H.default=ea,Object.defineProperties(H,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/ai-blueking",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "AI 小鲸",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",