@squirrel-cloud/ui-vue 0.4.4 → 0.4.5

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.
@@ -46,7 +46,7 @@
46
46
  `:">",c},Ce.prototype.renderInline=function(e,t,n){let o="";const r=this.rules;for(let c=0,s=e.length;c<s;c++){const i=e[c].type;typeof r[i]<"u"?o+=r[i](e,c,t,n,this):o+=this.renderToken(e,c,t)}return o},Ce.prototype.renderInlineAsText=function(e,t,n){let o="";for(let r=0,c=e.length;r<c;r++)switch(e[r].type){case"text":o+=e[r].content;break;case"image":o+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":o+=e[r].content;break;case"softbreak":case"hardbreak":o+=`
47
47
  `;break}return o},Ce.prototype.render=function(e,t,n){let o="";const r=this.rules;for(let c=0,s=e.length;c<s;c++){const i=e[c].type;i==="inline"?o+=this.renderInline(e[c].children,t,n):typeof r[i]<"u"?o+=r[i](e,c,t,n,this):o+=this.renderToken(e,c,t,n)}return o};function W(){this.__rules__=[],this.__cache__=null}W.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},W.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(o){t.indexOf(o)<0&&t.push(o)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(o){o.enabled&&(n&&o.alt.indexOf(n)<0||e.__cache__[n].push(o.fn))})})},W.prototype.at=function(e,t,n){const o=this.__find__(e),r=n||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__[o].fn=t,this.__rules__[o].alt=r.alt||[],this.__cache__=null},W.prototype.before=function(e,t,n,o){const r=this.__find__(e),c=o||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:c.alt||[]}),this.__cache__=null},W.prototype.after=function(e,t,n,o){const r=this.__find__(e),c=o||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:c.alt||[]}),this.__cache__=null},W.prototype.push=function(e,t,n){const o=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null},W.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(o){const r=this.__find__(o);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[r].enabled=!0,n.push(o)},this),this.__cache__=null,n},W.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)},W.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(o){const r=this.__find__(o);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[r].enabled=!1,n.push(o)},this),this.__cache__=null,n},W.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function bu(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}bu.prototype.Token=Y;const b0=/\r\n?|\n/g,x0=/\0/g;function g0(e){let t;t=e.src.replace(b0,`
48
48
  `),t=t.replace(x0,"�"),e.src=t}function _0(e){let 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)}function k0(e){const t=e.tokens;for(let n=0,o=t.length;n<o;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function y0(e){return/^<a[>\s]/i.test(e)}function C0(e){return/^<\/a\s*>/i.test(e)}function w0(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,o=t.length;n<o;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,c=0;for(let s=r.length-1;s>=0;s--){const i=r[s];if(i.type==="link_close"){for(s--;r[s].level!==i.level&&r[s].type!=="link_open";)s--;continue}if(i.type==="html_inline"&&(y0(i.content)&&c>0&&c--,C0(i.content)&&c++),!(c>0)&&i.type==="text"&&e.md.linkify.test(i.content)){const a=i.content;let l=e.md.linkify.match(a);const d=[];let f=i.level,m=0;l.length>0&&l[0].index===0&&s>0&&r[s-1].type==="text_special"&&(l=l.slice(1));for(let h=0;h<l.length;h++){const p=l[h].url,x=e.md.normalizeLink(p);if(!e.md.validateLink(x))continue;let _=l[h].text;l[h].schema?l[h].schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText("mailto:"+_).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText("http://"+_).replace(/^http:\/\//,"");const E=l[h].index;if(E>m){const B=new e.Token("text","",0);B.content=a.slice(m,E),B.level=f,d.push(B)}const y=new e.Token("link_open","a",1);y.attrs=[["href",x]],y.level=f++,y.markup="linkify",y.info="auto",d.push(y);const C=new e.Token("text","",0);C.content=_,C.level=f,d.push(C);const k=new e.Token("link_close","a",-1);k.level=--f,k.markup="linkify",k.info="auto",d.push(k),m=l[h].lastIndex}if(m<a.length){const h=new e.Token("text","",0);h.content=a.slice(m),h.level=f,d.push(h)}t[n].children=r=hu(r,s,d)}}}}const xu=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,E0=/\((c|tm|r)\)/i,D0=/\((c|tm|r)\)/ig,A0={c:"©",r:"®",tm:"™"};function B0(e,t){return A0[t.toLowerCase()]}function F0(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(D0,B0)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function S0(e){let t=0;for(let n=e.length-1;n>=0;n--){const o=e[n];o.type==="text"&&!t&&xu.test(o.content)&&(o.content=o.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–")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function M0(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(E0.test(e.tokens[t].content)&&F0(e.tokens[t].children),xu.test(e.tokens[t].content)&&S0(e.tokens[t].children))}const $0=/['"]/,gu=/['"]/g,_u="’";function Ue(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function q0(e,t){let n;const o=[];for(let r=0;r<e.length;r++){const c=e[r],s=e[r].level;for(n=o.length-1;n>=0&&!(o[n].level<=s);n--);if(o.length=n+1,c.type!=="text")continue;let i=c.content,a=0,l=i.length;e:for(;a<l;){gu.lastIndex=a;const d=gu.exec(i);if(!d)break;let f=!0,m=!0;a=d.index+1;const h=d[0]==="'";let p=32;if(d.index-1>=0)p=i.charCodeAt(d.index-1);else for(n=r-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){p=e[n].content.charCodeAt(e[n].content.length-1);break}let x=32;if(a<l)x=i.charCodeAt(a);else for(n=r+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){x=e[n].content.charCodeAt(0);break}const _=qe(p)||$e(String.fromCharCode(p)),E=qe(x)||$e(String.fromCharCode(x)),y=Me(p),C=Me(x);if(C?f=!1:E&&(y||_||(f=!1)),y?m=!1:_&&(C||E||(m=!1)),x===34&&d[0]==='"'&&p>=48&&p<=57&&(m=f=!1),f&&m&&(f=_,m=E),!f&&!m){h&&(c.content=Ue(c.content,d.index,_u));continue}if(m)for(n=o.length-1;n>=0;n--){let k=o[n];if(o[n].level<s)break;if(k.single===h&&o[n].level===s){k=o[n];let B,S;h?(B=t.md.options.quotes[2],S=t.md.options.quotes[3]):(B=t.md.options.quotes[0],S=t.md.options.quotes[1]),c.content=Ue(c.content,d.index,S),e[k.token].content=Ue(e[k.token].content,k.pos,B),a+=S.length-1,k.token===r&&(a+=B.length-1),i=c.content,l=i.length,o.length=n;continue e}}f?o.push({token:r,pos:d.index,single:h,level:s}):m&&h&&(c.content=Ue(c.content,d.index,_u))}}}function N0(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!$0.test(e.tokens[t].content)||q0(e.tokens[t].children,e)}function z0(e){let t,n;const o=e.tokens,r=o.length;for(let c=0;c<r;c++){if(o[c].type!=="inline")continue;const s=o[c].children,i=s.length;for(t=0;t<i;t++)s[t].type==="text_special"&&(s[t].type="text");for(t=n=0;t<i;t++)s[t].type==="text"&&t+1<i&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==n&&(s[n]=s[t]),n++);t!==n&&(s.length=n)}}const gt=[["normalize",g0],["block",_0],["inline",k0],["linkify",w0],["replacements",M0],["smartquotes",N0],["text_join",z0]];function _t(){this.ruler=new W;for(let e=0;e<gt.length;e++)this.ruler.push(gt[e][0],gt[e][1])}_t.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,o=t.length;n<o;n++)t[n](e)},_t.prototype.State=bu;function te(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,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;const r=this.src;for(let c=0,s=0,i=0,a=0,l=r.length,d=!1;s<l;s++){const f=r.charCodeAt(s);if(!d)if(O(f)){i++,f===9?a+=4-a%4:a++;continue}else d=!0;(f===10||s===l-1)&&(f!==10&&s++,this.bMarks.push(c),this.eMarks.push(s),this.tShift.push(i),this.sCount.push(a),this.bsCount.push(0),d=!1,i=0,a=0,c=s+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}te.prototype.push=function(e,t,n){const o=new Y(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o},te.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},te.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},te.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const o=this.src.charCodeAt(t);if(!O(o))break}return t},te.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!O(this.src.charCodeAt(--t)))return t+1;return t},te.prototype.skipChars=function(t,n){for(let o=this.src.length;t<o&&this.src.charCodeAt(t)===n;t++);return t},te.prototype.skipCharsBack=function(t,n,o){if(t<=o)return t;for(;t>o;)if(n!==this.src.charCodeAt(--t))return t+1;return t},te.prototype.getLines=function(t,n,o,r){if(t>=n)return"";const c=new Array(n-t);for(let s=0,i=t;i<n;i++,s++){let a=0;const l=this.bMarks[i];let d=l,f;for(i+1<n||r?f=this.eMarks[i]+1:f=this.eMarks[i];d<f&&a<o;){const m=this.src.charCodeAt(d);if(O(m))m===9?a+=4-(a+this.bsCount[i])%4:a++;else if(d-l<this.tShift[i])a++;else break;d++}a>o?c[s]=new Array(a-o+1).join(" ")+this.src.slice(d,f):c[s]=this.src.slice(d,f)}return c.join("")},te.prototype.Token=Y;const R0=65536;function kt(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function ku(e){const t=[],n=e.length;let o=0,r=e.charCodeAt(o),c=!1,s=0,i="";for(;o<n;)r===124&&(c?(i+=e.substring(s,o-1),s=o):(t.push(i+e.substring(s,o)),i="",s=o+1)),c=r===92,o++,r=e.charCodeAt(o);return t.push(i+e.substring(s)),t}function T0(e,t,n,o){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let c=e.bMarks[r]+e.tShift[r];if(c>=e.eMarks[r])return!1;const s=e.src.charCodeAt(c++);if(s!==124&&s!==45&&s!==58||c>=e.eMarks[r])return!1;const i=e.src.charCodeAt(c++);if(i!==124&&i!==45&&i!==58&&!O(i)||s===45&&O(i))return!1;for(;c<e.eMarks[r];){const k=e.src.charCodeAt(c);if(k!==124&&k!==45&&k!==58&&!O(k))return!1;c++}let a=kt(e,t+1),l=a.split("|");const d=[];for(let k=0;k<l.length;k++){const B=l[k].trim();if(!B){if(k===0||k===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(B))return!1;B.charCodeAt(B.length-1)===58?d.push(B.charCodeAt(0)===58?"center":"right"):B.charCodeAt(0)===58?d.push("left"):d.push("")}if(a=kt(e,t).trim(),a.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=ku(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const f=l.length;if(f===0||f!==d.length)return!1;if(o)return!0;const m=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),x=[t,0];p.map=x;const _=e.push("thead_open","thead",1);_.map=[t,t+1];const E=e.push("tr_open","tr",1);E.map=[t,t+1];for(let k=0;k<l.length;k++){const B=e.push("th_open","th",1);d[k]&&(B.attrs=[["style","text-align:"+d[k]]]);const S=e.push("inline","",0);S.content=l[k].trim(),S.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,C=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let k=!1;for(let S=0,R=h.length;S<R;S++)if(h[S](e,r,n,!0)){k=!0;break}if(k||(a=kt(e,r).trim(),!a)||e.sCount[r]-e.blkIndent>=4||(l=ku(a),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),C+=f-l.length,C>R0))break;if(r===t+2){const S=e.push("tbody_open","tbody",1);S.map=y=[t+2,0]}const B=e.push("tr_open","tr",1);B.map=[r,r+1];for(let S=0;S<f;S++){const R=e.push("td_open","td",1);d[S]&&(R.attrs=[["style","text-align:"+d[S]]]);const T=e.push("inline","",0);T.content=l[S]?l[S].trim():"",T.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=r),e.push("table_close","table",-1),x[1]=r,e.parentType=m,e.line=r,!0}function L0(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,r=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,r=o;continue}break}e.line=r;const c=e.push("code_block","code",0);return c.content=e.getLines(t,r,4+e.blkIndent,!1)+`
49
- `,c.map=[t,e.line],!0}function V0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>c)return!1;const s=e.src.charCodeAt(r);if(s!==126&&s!==96)return!1;let i=r;r=e.skipChars(r,s);let a=r-i;if(a<3)return!1;const l=e.src.slice(i,r),d=e.src.slice(r,c);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(o)return!0;let f=t,m=!1;for(;f++,!(f>=n||(r=i=e.bMarks[f]+e.tShift[f],c=e.eMarks[f],r<c&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(r)===s&&!(e.sCount[f]-e.blkIndent>=4)&&(r=e.skipChars(r,s),!(r-i<a)&&(r=e.skipSpaces(r),!(r<c)))){m=!0;break}a=e.sCount[t],e.line=f+(m?1:0);const h=e.push("fence","code",0);return h.info=d,h.content=e.getLines(t+1,f,a,!0),h.markup=l,h.map=[t,e.line],!0}function I0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(o)return!0;const i=[],a=[],l=[],d=[],f=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=t;p<n;p++){const C=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],c=e.eMarks[p],r>=c)break;if(e.src.charCodeAt(r++)===62&&!C){let B=e.sCount[p]+1,S,R;e.src.charCodeAt(r)===32?(r++,B++,R=!1,S=!0):e.src.charCodeAt(r)===9?(S=!0,(e.bsCount[p]+B)%4===3?(r++,B++,R=!1):R=!0):S=!1;let T=B;for(i.push(e.bMarks[p]),e.bMarks[p]=r;r<c;){const D=e.src.charCodeAt(r);if(O(D))D===9?T+=4-(T+e.bsCount[p]+(R?1:0))%4:T++;else break;r++}h=r>=c,a.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(S?1:0),l.push(e.sCount[p]),e.sCount[p]=T-B,d.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(h)break;let k=!1;for(let B=0,S=f.length;B<S;B++)if(f[B](e,p,n,!0)){k=!0;break}if(k){e.lineMax=p,e.blkIndent!==0&&(i.push(e.bMarks[p]),a.push(e.bsCount[p]),d.push(e.tShift[p]),l.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}i.push(e.bMarks[p]),a.push(e.bsCount[p]),d.push(e.tShift[p]),l.push(e.sCount[p]),e.sCount[p]=-1}const x=e.blkIndent;e.blkIndent=0;const _=e.push("blockquote_open","blockquote",1);_.markup=">";const E=[t,0];_.map=E,e.md.block.tokenize(e,t,p);const y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=s,e.parentType=m,E[1]=e.line;for(let C=0;C<d.length;C++)e.bMarks[C+t]=i[C],e.tShift[C+t]=d[C],e.sCount[C+t]=l[C],e.bsCount[C+t]=a[C];return e.blkIndent=x,!0}function v0(e,t,n,o){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let c=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(c++);if(s!==42&&s!==45&&s!==95)return!1;let i=1;for(;c<r;){const l=e.src.charCodeAt(c++);if(l!==s&&!O(l))return!1;l===s&&i++}if(i<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=Array(i+1).join(String.fromCharCode(s)),!0}function yu(e,t){const n=e.eMarks[t];let o=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(o++);if(r!==42&&r!==45&&r!==43)return-1;if(o<n){const c=e.src.charCodeAt(o);if(!O(c))return-1}return o}function Cu(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];let r=n;if(r+1>=o)return-1;let c=e.src.charCodeAt(r++);if(c<48||c>57)return-1;for(;;){if(r>=o)return-1;if(c=e.src.charCodeAt(r++),c>=48&&c<=57){if(r-n>=10)return-1;continue}if(c===41||c===46)break;return-1}return r<o&&(c=e.src.charCodeAt(r),!O(c))?-1:r}function O0(e,t){const n=e.level+2;for(let o=t+2,r=e.tokens.length-2;o<r;o++)e.tokens[o].level===n&&e.tokens[o].type==="paragraph_open"&&(e.tokens[o+2].hidden=!0,e.tokens[o].hidden=!0,o+=2)}function P0(e,t,n,o){let r,c,s,i,a=t,l=!0;if(e.sCount[a]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]<e.blkIndent)return!1;let d=!1;o&&e.parentType==="paragraph"&&e.sCount[a]>=e.blkIndent&&(d=!0);let f,m,h;if((h=Cu(e,a))>=0){if(f=!0,s=e.bMarks[a]+e.tShift[a],m=Number(e.src.slice(s,h-1)),d&&m!==1)return!1}else if((h=yu(e,a))>=0)f=!1;else return!1;if(d&&e.skipSpaces(h)>=e.eMarks[a])return!1;if(o)return!0;const p=e.src.charCodeAt(h-1),x=e.tokens.length;f?(i=e.push("ordered_list_open","ol",1),m!==1&&(i.attrs=[["start",m]])):i=e.push("bullet_list_open","ul",1);const _=[a,0];i.map=_,i.markup=String.fromCharCode(p);let E=!1;const y=e.md.block.ruler.getRules("list"),C=e.parentType;for(e.parentType="list";a<n;){c=h,r=e.eMarks[a];const k=e.sCount[a]+h-(e.bMarks[a]+e.tShift[a]);let B=k;for(;c<r;){const L=e.src.charCodeAt(c);if(L===9)B+=4-(B+e.bsCount[a])%4;else if(L===32)B++;else break;c++}const S=c;let R;S>=r?R=1:R=B-k,R>4&&(R=1);const T=k+R;i=e.push("list_item_open","li",1),i.markup=String.fromCharCode(p);const D=[a,0];i.map=D,f&&(i.info=e.src.slice(s,h-1));const g=e.tight,b=e.tShift[a],A=e.sCount[a],w=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=T,e.tight=!0,e.tShift[a]=S-e.bMarks[a],e.sCount[a]=B,S>=r&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,a,n,!0),(!e.tight||E)&&(l=!1),E=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=w,e.tShift[a]=b,e.sCount[a]=A,e.tight=g,i=e.push("list_item_close","li",-1),i.markup=String.fromCharCode(p),a=e.line,D[1]=a,a>=n||e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)break;let M=!1;for(let L=0,V=y.length;L<V;L++)if(y[L](e,a,n,!0)){M=!0;break}if(M)break;if(f){if(h=Cu(e,a),h<0)break;s=e.bMarks[a]+e.tShift[a]}else if(h=yu(e,a),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return f?i=e.push("ordered_list_close","ol",-1):i=e.push("bullet_list_close","ul",-1),i.markup=String.fromCharCode(p),_[1]=a,e.line=a,e.parentType=C,l&&O0(e,x),!0}function Z0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function i(y){const C=e.lineMax;if(y>=C||e.isEmpty(y))return null;let k=!1;if(e.sCount[y]-e.blkIndent>3&&(k=!0),e.sCount[y]<0&&(k=!0),!k){const R=e.md.block.ruler.getRules("reference"),T=e.parentType;e.parentType="reference";let D=!1;for(let g=0,b=R.length;g<b;g++)if(R[g](e,y,C,!0)){D=!0;break}if(e.parentType=T,D)return null}const B=e.bMarks[y]+e.tShift[y],S=e.eMarks[y];return e.src.slice(B,S+1)}let a=e.src.slice(r,c+1);c=a.length;let l=-1;for(r=1;r<c;r++){const y=a.charCodeAt(r);if(y===91)return!1;if(y===93){l=r;break}else if(y===10){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}else if(y===92&&(r++,r<c&&a.charCodeAt(r)===10)){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}}if(l<0||a.charCodeAt(l+1)!==58)return!1;for(r=l+2;r<c;r++){const y=a.charCodeAt(r);if(y===10){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}else if(!O(y))break}const d=e.md.helpers.parseLinkDestination(a,r,c);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;r=d.pos;const m=r,h=s,p=r;for(;r<c;r++){const y=a.charCodeAt(r);if(y===10){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}else if(!O(y))break}let x=e.md.helpers.parseLinkTitle(a,r,c);for(;x.can_continue;){const y=i(s);if(y===null)break;a+=y,r=c,c=a.length,s++,x=e.md.helpers.parseLinkTitle(a,r,c,x)}let _;for(r<c&&p!==r&&x.ok?(_=x.str,r=x.pos):(_="",r=m,s=h);r<c;){const y=a.charCodeAt(r);if(!O(y))break;r++}if(r<c&&a.charCodeAt(r)!==10&&_)for(_="",r=m,s=h;r<c;){const y=a.charCodeAt(r);if(!O(y))break;r++}if(r<c&&a.charCodeAt(r)!==10)return!1;const E=Ze(a.slice(1,l));return E?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[E]>"u"&&(e.env.references[E]={title:_,href:f}),e.line=s),!0):!1}const U0=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],j0="[a-zA-Z_:][a-zA-Z0-9:._-]*",H0="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",wu="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+j0+"(?:\\s*=\\s*"+H0+")?)")+"*\\s*\\/?>",Eu="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",W0="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",G0="<[?][\\s\\S]*?[?]>",X0="<![A-Za-z][^>]*>",Y0="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",K0=new RegExp("^(?:"+wu+"|"+Eu+"|"+W0+"|"+G0+"|"+X0+"|"+Y0+")"),J0=new RegExp("^(?:"+wu+"|"+Eu+")"),we=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+U0.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(J0.source+"\\s*$"),/^$/,!1]];function Q0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let s=e.src.slice(r,c),i=0;for(;i<we.length&&!we[i][0].test(s);i++);if(i===we.length)return!1;if(o)return we[i][2];let a=t+1;if(!we[i][1].test(s)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(r=e.bMarks[a]+e.tShift[a],c=e.eMarks[a],s=e.src.slice(r,c),we[i][1].test(s)){s.length!==0&&a++;break}}e.line=a;const l=e.push("html_block","",0);return l.map=[t,a],l.content=e.getLines(t,a,e.blkIndent,!0),!0}function ec(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(r);if(s!==35||r>=c)return!1;let i=1;for(s=e.src.charCodeAt(++r);s===35&&r<c&&i<=6;)i++,s=e.src.charCodeAt(++r);if(i>6||r<c&&!O(s))return!1;if(o)return!0;c=e.skipSpacesBack(c,r);const a=e.skipCharsBack(c,35,r);a>r&&O(e.src.charCodeAt(a-1))&&(c=a),e.line=t+1;const l=e.push("heading_open","h"+String(i),1);l.markup="########".slice(0,i),l.map=[t,e.line];const d=e.push("inline","",0);d.content=e.src.slice(r,c).trim(),d.map=[t,e.line],d.children=[];const f=e.push("heading_close","h"+String(i),-1);return f.markup="########".slice(0,i),!0}function tc(e,t,n){const o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let c=0,s,i=t+1;for(;i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3)continue;if(e.sCount[i]>=e.blkIndent){let h=e.bMarks[i]+e.tShift[i];const p=e.eMarks[i];if(h<p&&(s=e.src.charCodeAt(h),(s===45||s===61)&&(h=e.skipChars(h,s),h=e.skipSpaces(h),h>=p))){c=s===61?1:2;break}}if(e.sCount[i]<0)continue;let m=!1;for(let h=0,p=o.length;h<p;h++)if(o[h](e,i,n,!0)){m=!0;break}if(m)break}if(!c)return!1;const a=e.getLines(t,i,e.blkIndent,!1).trim();e.line=i+1;const l=e.push("heading_open","h"+String(c),1);l.markup=String.fromCharCode(s),l.map=[t,e.line];const d=e.push("inline","",0);d.content=a,d.map=[t,e.line-1],d.children=[];const f=e.push("heading_close","h"+String(c),-1);return f.markup=String.fromCharCode(s),e.parentType=r,!0}function uc(e,t,n){const o=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let c=t+1;for(e.parentType="paragraph";c<n&&!e.isEmpty(c);c++){if(e.sCount[c]-e.blkIndent>3||e.sCount[c]<0)continue;let l=!1;for(let d=0,f=o.length;d<f;d++)if(o[d](e,c,n,!0)){l=!0;break}if(l)break}const s=e.getLines(t,c,e.blkIndent,!1).trim();e.line=c;const i=e.push("paragraph_open","p",1);i.map=[t,e.line];const a=e.push("inline","",0);return a.content=s,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const je=[["table",T0,["paragraph","reference"]],["code",L0],["fence",V0,["paragraph","reference","blockquote","list"]],["blockquote",I0,["paragraph","reference","blockquote","list"]],["hr",v0,["paragraph","reference","blockquote","list"]],["list",P0,["paragraph","reference","blockquote"]],["reference",Z0],["html_block",Q0,["paragraph","reference","blockquote"]],["heading",ec,["paragraph","reference","blockquote"]],["lheading",tc],["paragraph",uc]];function He(){this.ruler=new W;for(let e=0;e<je.length;e++)this.ruler.push(je[e][0],je[e][1],{alt:(je[e][2]||[]).slice()})}He.prototype.tokenize=function(e,t,n){const o=this.ruler.getRules(""),r=o.length,c=e.md.options.maxNesting;let s=t,i=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=c){e.line=n;break}const a=e.line;let l=!1;for(let d=0;d<r;d++)if(l=o[d](e,s,n,!1),l){if(a>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!i,e.isEmpty(e.line-1)&&(i=!0),s=e.line,s<n&&e.isEmpty(s)&&(i=!0,s++,e.line=s)}},He.prototype.parse=function(e,t,n,o){if(!e)return;const r=new this.State(e,t,n,o);this.tokenize(r,r.line,r.lineMax)},He.prototype.State=te;function Ne(e,t,n,o){this.src=e,this.env=n,this.md=t,this.tokens=o,this.tokens_meta=Array(o.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}Ne.prototype.pushPending=function(){const e=new Y("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Ne.prototype.push=function(e,t,n){this.pending&&this.pushPending();const o=new Y(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(r),o},Ne.prototype.scanDelims=function(e,t){const n=this.posMax,o=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let c=e;for(;c<n&&this.src.charCodeAt(c)===o;)c++;const s=c-e,i=c<n?this.src.charCodeAt(c):32,a=qe(r)||$e(String.fromCharCode(r)),l=qe(i)||$e(String.fromCharCode(i)),d=Me(r),f=Me(i),m=!f&&(!l||d||a),h=!d&&(!a||f||l);return{can_open:m&&(t||!h||a),can_close:h&&(t||!m||l),length:s}},Ne.prototype.Token=Y;function nc(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function oc(e,t){let n=e.pos;for(;n<e.posMax&&!nc(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const rc=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function cc(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(rc);if(!r)return!1;const c=r[1],s=e.md.linkify.matchAtStart(e.src.slice(n-c.length));if(!s)return!1;let i=s.url;if(i.length<=c.length)return!1;i=i.replace(/\*+$/,"");const a=e.md.normalizeLink(i);if(!e.md.validateLink(a))return!1;if(!t){e.pending=e.pending.slice(0,-c.length);const l=e.push("link_open","a",1);l.attrs=[["href",a]],l.markup="linkify",l.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(i);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=i.length-c.length,!0}function sc(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,r=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let c=o-1;for(;c>=1&&e.pending.charCodeAt(c-1)===32;)c--;e.pending=e.pending.slice(0,c),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(n++;n<r&&O(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const yt=[];for(let e=0;e<256;e++)yt.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){yt[e.charCodeAt(0)]=1});function ic(e,t){let n=e.pos;const o=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=o))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(r=e.src.charCodeAt(n),!!O(r));)n++;return e.pos=n,!0}let c=e.src[n];if(r>=55296&&r<=56319&&n+1<o){const i=e.src.charCodeAt(n+1);i>=56320&&i<=57343&&(c+=e.src[n+1],n++)}const s="\\"+c;if(!t){const i=e.push("text_special","",0);r<256&&yt[r]!==0?i.content=c:i.content=s,i.markup=s,i.info="escape"}return e.pos=n+1,!0}function ac(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const c=e.posMax;for(;n<c&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(r,n),i=s.length;if(e.backticksScanned&&(e.backticks[i]||0)<=r)return t||(e.pending+=s),e.pos+=i,!0;let a=n,l;for(;(l=e.src.indexOf("`",a))!==-1;){for(a=l+1;a<c&&e.src.charCodeAt(a)===96;)a++;const d=a-l;if(d===i){if(!t){const f=e.push("code_inline","code",0);f.markup=s,f.content=e.src.slice(n,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[d]=l}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=i,!0}function lc(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const r=e.scanDelims(e.pos,!0);let c=r.length;const s=String.fromCharCode(o);if(c<2)return!1;let i;c%2&&(i=e.push("text","",0),i.content=s,c--);for(let a=0;a<c;a+=2)i=e.push("text","",0),i.content=s+s,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function Du(e,t){let n;const o=[],r=t.length;for(let c=0;c<r;c++){const s=t[c];if(s.marker!==126||s.end===-1)continue;const i=t[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[i.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[i.token-1].type==="text"&&e.tokens[i.token-1].content==="~"&&o.push(i.token-1)}for(;o.length;){const c=o.pop();let s=c+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,c!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[c],e.tokens[c]=n)}}function dc(e){const t=e.tokens_meta,n=e.tokens_meta.length;Du(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Du(e,t[o].delimiters)}const Au={tokenize:lc,postProcess:dc};function fc(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const r=e.scanDelims(e.pos,o===42);for(let c=0;c<r.length;c++){const s=e.push("text","",0);s.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function Bu(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const r=t[o];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const c=t[r.end],s=o>0&&t[o-1].end===r.end+1&&t[o-1].marker===r.marker&&t[o-1].token===r.token-1&&t[r.end+1].token===c.token+1,i=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?i+i:i,a.content="";const l=e.tokens[c.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?i+i:i,l.content="",s&&(e.tokens[t[o-1].token].content="",e.tokens[t[r.end+1].token].content="",o--)}}function pc(e){const t=e.tokens_meta,n=e.tokens_meta.length;Bu(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Bu(e,t[o].delimiters)}const Fu={tokenize:fc,postProcess:pc};function hc(e,t){let n,o,r,c,s="",i="",a=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const d=e.pos,f=e.posMax,m=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<f&&e.src.charCodeAt(p)===40){for(l=!1,p++;p<f&&(n=e.src.charCodeAt(p),!(!O(n)&&n!==10));p++);if(p>=f)return!1;if(a=p,r=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),r.ok){for(s=e.md.normalizeLink(r.str),e.md.validateLink(s)?p=r.pos:s="",a=p;p<f&&(n=e.src.charCodeAt(p),!(!O(n)&&n!==10));p++);if(r=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<f&&a!==p&&r.ok)for(i=r.str,p=r.pos;p<f&&(n=e.src.charCodeAt(p),!(!O(n)&&n!==10));p++);}(p>=f||e.src.charCodeAt(p)!==41)&&(l=!0),p++}if(l){if(typeof e.env.references>"u")return!1;if(p<f&&e.src.charCodeAt(p)===91?(a=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(m,h)),c=e.env.references[Ze(o)],!c)return e.pos=d,!1;s=c.href,i=c.title}if(!t){e.pos=m,e.posMax=h;const x=e.push("link_open","a",1),_=[["href",s]];x.attrs=_,i&&_.push(["title",i]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=f,!0}function mc(e,t){let n,o,r,c,s,i,a,l,d="";const f=e.pos,m=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(c=p+1,c<m&&e.src.charCodeAt(c)===40){for(c++;c<m&&(n=e.src.charCodeAt(c),!(!O(n)&&n!==10));c++);if(c>=m)return!1;for(l=c,i=e.md.helpers.parseLinkDestination(e.src,c,e.posMax),i.ok&&(d=e.md.normalizeLink(i.str),e.md.validateLink(d)?c=i.pos:d=""),l=c;c<m&&(n=e.src.charCodeAt(c),!(!O(n)&&n!==10));c++);if(i=e.md.helpers.parseLinkTitle(e.src,c,e.posMax),c<m&&l!==c&&i.ok)for(a=i.str,c=i.pos;c<m&&(n=e.src.charCodeAt(c),!(!O(n)&&n!==10));c++);else a="";if(c>=m||e.src.charCodeAt(c)!==41)return e.pos=f,!1;c++}else{if(typeof e.env.references>"u")return!1;if(c<m&&e.src.charCodeAt(c)===91?(l=c+1,c=e.md.helpers.parseLinkLabel(e,c),c>=0?r=e.src.slice(l,c++):c=p+1):c=p+1,r||(r=e.src.slice(h,p)),s=e.env.references[Ze(r)],!s)return e.pos=f,!1;d=s.href,a=s.title}if(!t){o=e.src.slice(h,p);const x=[];e.md.inline.parse(o,e.md,e.env,x);const _=e.push("image","img",0),E=[["src",d],["alt",""]];_.attrs=E,_.children=x,_.content=o,a&&E.push(["title",a])}return e.pos=c,e.posMax=m,!0}const 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])?)*)$/,xc=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function gc(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const o=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const c=e.src.slice(o+1,n);if(xc.test(c)){const s=e.md.normalizeLink(c);if(!e.md.validateLink(s))return!1;if(!t){const i=e.push("link_open","a",1);i.attrs=[["href",s]],i.markup="autolink",i.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(c);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=c.length+2,!0}if(bc.test(c)){const s=e.md.normalizeLink("mailto:"+c);if(!e.md.validateLink(s))return!1;if(!t){const i=e.push("link_open","a",1);i.attrs=[["href",s]],i.markup="autolink",i.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(c);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=c.length+2,!0}return!1}function _c(e){return/^<a[>\s]/i.test(e)}function kc(e){return/^<\/a\s*>/i.test(e)}function yc(e){const t=e|32;return t>=97&&t<=122}function Cc(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==60||o+2>=n)return!1;const r=e.src.charCodeAt(o+1);if(r!==33&&r!==63&&r!==47&&!yc(r))return!1;const c=e.src.slice(o).match(K0);if(!c)return!1;if(!t){const s=e.push("html_inline","",0);s.content=c[0],_c(s.content)&&e.linkLevel++,kc(s.content)&&e.linkLevel--}return e.pos+=c[0].length,!0}const wc=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ec=/^&([a-z][a-z0-9]{1,31});/i;function Dc(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const c=e.src.slice(n).match(wc);if(c){if(!t){const s=c[1][0].toLowerCase()==="x"?parseInt(c[1].slice(1),16):parseInt(c[1],10),i=e.push("text_special","",0);i.content=xt(s)?Pe(s):Pe(65533),i.markup=c[0],i.info="entity"}return e.pos+=c[0].length,!0}}else{const c=e.src.slice(n).match(Ec);if(c){const s=pu(c[0]);if(s!==c[0]){if(!t){const i=e.push("text_special","",0);i.content=s,i.markup=c[0],i.info="entity"}return e.pos+=c[0].length,!0}}}return!1}function Su(e){const t={},n=e.length;if(!n)return;let o=0,r=-2;const c=[];for(let s=0;s<n;s++){const i=e[s];if(c.push(0),(e[o].marker!==i.marker||r!==i.token-1)&&(o=s),r=i.token,i.length=i.length||0,!i.close)continue;t.hasOwnProperty(i.marker)||(t[i.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[i.marker][(i.open?3:0)+i.length%3];let l=o-c[o]-1,d=l;for(;l>a;l-=c[l]+1){const f=e[l];if(f.marker===i.marker&&f.open&&f.end<0){let m=!1;if((f.close||i.open)&&(f.length+i.length)%3===0&&(f.length%3!==0||i.length%3!==0)&&(m=!0),!m){const h=l>0&&!e[l-1].open?c[l-1]+1:0;c[s]=s-l+h,c[l]=h,i.open=!1,f.end=s,f.close=!1,d=-1,r=-2;break}}}d!==-1&&(t[i.marker][(i.open?3:0)+(i.length||0)%3]=d)}}function Ac(e){const t=e.tokens_meta,n=e.tokens_meta.length;Su(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Su(t[o].delimiters)}function Bc(e){let t,n,o=0;const r=e.tokens,c=e.tokens.length;for(t=n=0;t<c;t++)r[t].nesting<0&&o--,r[t].level=o,r[t].nesting>0&&o++,r[t].type==="text"&&t+1<c&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const Ct=[["text",oc],["linkify",cc],["newline",sc],["escape",ic],["backticks",ac],["strikethrough",Au.tokenize],["emphasis",Fu.tokenize],["link",hc],["image",mc],["autolink",gc],["html_inline",Cc],["entity",Dc]],wt=[["balance_pairs",Ac],["strikethrough",Au.postProcess],["emphasis",Fu.postProcess],["fragments_join",Bc]];function ze(){this.ruler=new W;for(let e=0;e<Ct.length;e++)this.ruler.push(Ct[e][0],Ct[e][1]);this.ruler2=new W;for(let e=0;e<wt.length;e++)this.ruler2.push(wt[e][0],wt[e][1])}ze.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),o=n.length,r=e.md.options.maxNesting,c=e.cache;if(typeof c[t]<"u"){e.pos=c[t];return}let s=!1;if(e.level<r){for(let i=0;i<o;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,c[t]=e.pos},ze.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,o=e.posMax,r=e.md.options.maxNesting;for(;e.pos<o;){const c=e.pos;let s=!1;if(e.level<r){for(let i=0;i<n;i++)if(s=t[i](e,!1),s){if(c>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},ze.prototype.parse=function(e,t,n,o){const r=new this.State(e,t,n,o);this.tokenize(r);const c=this.ruler2.getRules(""),s=c.length;for(let i=0;i<s;i++)c[i](r)},ze.prototype.State=Ne;function Fc(e){const t={};e=e||{},t.src_Any=iu.source,t.src_Cc=au.source,t.src_Z=du.source,t.src_P=pt.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Et(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(o){e[o]=n[o]})}),e}function We(e){return Object.prototype.toString.call(e)}function Sc(e){return We(e)==="[object String]"}function Mc(e){return We(e)==="[object Object]"}function $c(e){return We(e)==="[object RegExp]"}function Mu(e){return We(e)==="[object Function]"}function qc(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const $u={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Nc(e){return Object.keys(e||{}).reduce(function(t,n){return t||$u.hasOwnProperty(n)},!1)}const zc={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},Rc="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]",Tc="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Lc(e){e.__index__=-1,e.__text_cache__=""}function Vc(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function qu(){return function(e,t){t.normalize(e)}}function Ge(e){const t=e.re=Fc(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Rc),n.push(t.src_xn),t.src_tlds=n.join("|");function o(i){return i.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function c(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(e.__schemas__).forEach(function(i){const a=e.__schemas__[i];if(a===null)return;const l={validate:null,link:null};if(e.__compiled__[i]=l,Mc(a)){$c(a.validate)?l.validate=Vc(a.validate):Mu(a.validate)?l.validate=a.validate:c(i,a),Mu(a.normalize)?l.normalize=a.normalize:a.normalize?c(i,a):l.normalize=qu();return}if(Sc(a)){r.push(i);return}c(i,a)}),r.forEach(function(i){e.__compiled__[e.__schemas__[i]]&&(e.__compiled__[i].validate=e.__compiled__[e.__schemas__[i]].validate,e.__compiled__[i].normalize=e.__compiled__[e.__schemas__[i]].normalize)}),e.__compiled__[""]={validate:null,normalize:qu()};const s=Object.keys(e.__compiled__).filter(function(i){return i.length>0&&e.__compiled__[i]}).map(qc).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Lc(e)}function Ic(e,t){const n=e.__index__,o=e.__last_index__,r=e.__text_cache__.slice(n,o);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=o+t,this.raw=r,this.text=r,this.url=r}function Dt(e,t){const n=new Ic(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function G(e,t){if(!(this instanceof G))return new G(e,t);t||Nc(e)&&(t=e,e={}),this.__opts__=Et({},$u,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Et({},zc,e),this.__compiled__={},this.__tlds__=Tc,this.__tlds_replaced__=!1,this.re={},Ge(this)}G.prototype.add=function(t,n){return this.__schemas__[t]=n,Ge(this),this},G.prototype.set=function(t){return this.__opts__=Et(this.__opts__,t),this},G.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,o,r,c,s,i,a,l,d;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(c=this.testSchemaAt(t,n[2],a.lastIndex),c){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+c;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(o=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=o.index+o[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=o.index+o[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(d=t.indexOf("@"),d>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(s=r.index+r[1].length,i=r.index+r[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=i))),this.__index__>=0},G.prototype.pretest=function(t){return this.re.pretest.test(t)},G.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0},G.prototype.match=function(t){const n=[];let o=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Dt(this,o)),o=this.__last_index__);let r=o?t.slice(o):t;for(;this.test(r);)n.push(Dt(this,o)),r=r.slice(this.__last_index__),o+=this.__last_index__;return n.length?n:null},G.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);return o?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o,Dt(this,0)):null},G.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,r,c){return o!==c[r-1]}).reverse(),Ge(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Ge(this),this)},G.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},G.prototype.onCompile=function(){};const Ee=2147483647,ue=36,At=1,Re=26,vc=38,Oc=700,Nu=72,zu=128,Ru="-",Pc=/^xn--/,Zc=/[^\0-\x7F]/,Uc=/[\x2E\u3002\uFF0E\uFF61]/g,jc={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Bt=ue-At,ne=Math.floor,Ft=String.fromCharCode;function de(e){throw new RangeError(jc[e])}function Hc(e,t){const n=[];let o=e.length;for(;o--;)n[o]=t(e[o]);return n}function Tu(e,t){const n=e.split("@");let o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace(Uc,".");const r=e.split("."),c=Hc(r,t).join(".");return o+c}function Lu(e){const t=[];let n=0;const o=e.length;for(;n<o;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<o){const c=e.charCodeAt(n++);(c&64512)==56320?t.push(((r&1023)<<10)+(c&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const Wc=e=>String.fromCodePoint(...e),Gc=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:ue},Vu=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Iu=function(e,t,n){let o=0;for(e=n?ne(e/Oc):e>>1,e+=ne(e/t);e>Bt*Re>>1;o+=ue)e=ne(e/Bt);return ne(o+(Bt+1)*e/(e+vc))},vu=function(e){const t=[],n=e.length;let o=0,r=zu,c=Nu,s=e.lastIndexOf(Ru);s<0&&(s=0);for(let i=0;i<s;++i)e.charCodeAt(i)>=128&&de("not-basic"),t.push(e.charCodeAt(i));for(let i=s>0?s+1:0;i<n;){const a=o;for(let d=1,f=ue;;f+=ue){i>=n&&de("invalid-input");const m=Gc(e.charCodeAt(i++));m>=ue&&de("invalid-input"),m>ne((Ee-o)/d)&&de("overflow"),o+=m*d;const h=f<=c?At:f>=c+Re?Re:f-c;if(m<h)break;const p=ue-h;d>ne(Ee/p)&&de("overflow"),d*=p}const l=t.length+1;c=Iu(o-a,l,a==0),ne(o/l)>Ee-r&&de("overflow"),r+=ne(o/l),o%=l,t.splice(o++,0,r)}return String.fromCodePoint(...t)},Ou=function(e){const t=[];e=Lu(e);const n=e.length;let o=zu,r=0,c=Nu;for(const a of e)a<128&&t.push(Ft(a));const s=t.length;let i=s;for(s&&t.push(Ru);i<n;){let a=Ee;for(const d of e)d>=o&&d<a&&(a=d);const l=i+1;a-o>ne((Ee-r)/l)&&de("overflow"),r+=(a-o)*l,o=a;for(const d of e)if(d<o&&++r>Ee&&de("overflow"),d===o){let f=r;for(let m=ue;;m+=ue){const h=m<=c?At:m>=c+Re?Re:m-c;if(f<h)break;const p=f-h,x=ue-h;t.push(Ft(Vu(h+p%x,0))),f=ne(p/x)}t.push(Ft(Vu(f,0))),c=Iu(r,l,i===s),r=0,++i}++r,++o}return t.join("")},Pu={version:"2.3.1",ucs2:{decode:Lu,encode:Wc},decode:vu,encode:Ou,toASCII:function(e){return Tu(e,function(t){return Zc.test(t)?"xn--"+Ou(t):t})},toUnicode:function(e){return Tu(e,function(t){return Pc.test(t)?vu(t.slice(4).toLowerCase()):t})}},Xc={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{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"]}}},commonmark:{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"]}}}},Yc=/^(vbscript|javascript|file|data):/,Kc=/^data:image\/(gif|png|jpeg|webp);/;function Jc(e){const t=e.trim().toLowerCase();return Yc.test(t)?Kc.test(t):!0}const Zu=["http:","https:","mailto:"];function Qc(e){const t=ft(e,!0);if(t.hostname&&(!t.protocol||Zu.indexOf(t.protocol)>=0))try{t.hostname=Pu.toASCII(t.hostname)}catch{}return Se(dt(t))}function es(e){const t=ft(e,!0);if(t.hostname&&(!t.protocol||Zu.indexOf(t.protocol)>=0))try{t.hostname=Pu.toUnicode(t.hostname)}catch{}return ke(dt(t),ke.defaultChars+"%")}function K(e,t){if(!(this instanceof K))return new K(e,t);t||bt(e)||(t=e||{},e="default"),this.inline=new ze,this.block=new He,this.core=new _t,this.renderer=new Ce,this.linkify=new G,this.validateLink=Jc,this.normalizeLink=Qc,this.normalizeLinkText=es,this.utils=d0,this.helpers=Oe({},m0),this.options={},this.configure(e),t&&this.set(t)}K.prototype.set=function(e){return Oe(this.options,e),this},K.prototype.configure=function(e){const t=this;if(bt(e)){const n=e;if(e=Xc[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},K.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const o=e.filter(function(r){return n.indexOf(r)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},K.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const o=e.filter(function(r){return n.indexOf(r)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},K.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},K.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},K.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},K.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},K.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let Uu=1;function ts(){function e(r,c){const s=new K({html:!0,typographer:!0});return s.use(Dr),c&&c.forEach(i=>s.use(i)),s.parse(r,"")}function t(r,c){const s=o(r,c)??[];return u.h("article",{class:"sq-article"},n(s))}function n(r){if(!r)return;const c=r.map(s=>{if(typeof s=="string")return s;{const i=n(s.children);return u.h(s.tag,s.attrs,typeof s.tag!="string"?{default:()=>i}:i)}});return c.length>1?c:c[0]}function o(r,c){const s=[],i={children:[]};let a=i;return r.forEach(l=>{var _,E,y,C,k,B,S,R,T,D,g;const{type:d,children:f,content:m,attrs:h,tag:p,hidden:x}=l;switch(d){case"heading_open":case"paragraph_open":case"bullet_list_open":case"ordered_list_open":case"list_item_open":case"table_open":case"thead_open":case"tbody_open":case"tr_open":case"th_open":case"td_open":case"blockquote_open":case"strong_open":case"em_open":case"s_open":case"link_open":{if(x)break;const b={tag:(c==null?void 0:c[p])??p,children:[],attrs:h?Object.fromEntries(h):{}};if(d==="link_open"){const A=l.attrGet("href")??"",w=document.location.origin;A!=null&&A.startsWith("http")&&!A.includes(w)&&(b.attrs.target="_blank",b.attrs.rel="noopener noreferrer",b.attrs.dataOuter="",(_=b.children)==null||_.push({tag:Po}))}if(d==="table_open"){const A={tag:"div",children:[],attrs:{class:"sq-article-table"}};(E=a.children)==null||E.push(A),s.push(a),a=A}(y=a.children)==null||y.push(b),s.push(a),a=b;break}case"heading_close":case"paragraph_close":case"bullet_list_close":case"ordered_list_close":case"list_item_close":case"table_close":case"thead_close":case"tbody_close":case"tr_close":case"th_close":case"td_close":case"blockquote_close":case"strong_close":case"em_close":case"s_close":case"link_close":{if(x)break;a=s.pop();break}case"code_inline":{(C=a.children)==null||C.push({tag:(c==null?void 0:c[p])??p,children:[m],attrs:h?Object.fromEntries(h):{}});break}case"inline":{if(f){const b=o(f,c);(k=a.children)==null||k.push(...b??[])}else(B=a.children)==null||B.push(m);break}case"text":{(S=a.children)==null||S.push(m);break}case"image":{(R=a.children)==null||R.push({tag:(c==null?void 0:c[p])??p,children:[],attrs:h?Object.fromEntries(h):{}});break}case"hr":{(T=a.children)==null||T.push({tag:(c==null?void 0:c[p])??p});break}case"input":{const b=h?Object.fromEntries(h):{},A=b.type??"text",w=`${p}-${A}`,M={tag:(c==null?void 0:c[w])??p,children:[],attrs:b};A==="checkbox"&&(M.attrs.value=`task-list-${Uu}`,Uu++),(D=a.children)==null||D.push(M);break}case"html_inline":{if(m.startsWith("</"))a=s.pop();else{const b=m.replace("<","").replace(">",""),A={tag:(c==null?void 0:c[b])??b,children:[]};(g=a.children)==null||g.push(A),s.push(a),a=A}break}}}),i.children}return{md2tokens:e,tokens2vueh:t}}function us(){function e(t,n=100){let o;return function(...r){o||(o=setTimeout(()=>{t.apply(this,r),o=void 0},n))}}return{throttle:e}}const{md2tokens:ns,tokens2vueh:os}=ts(),ju=u.defineComponent({name:"sq-article",props:{text:{type:String,required:!0},md:{type:Boolean,default:!0},customNodeMap:{type:Object},plugins:{type:Object}},setup(e){const t=u.computed(()=>({hr:he,blur:Hu,img:Xu,"input-checkbox":Mt,...e.customNodeMap}));return()=>{if(!e.md)return u.h("article",{class:"sq-article",innerHTML:e.text});const n=ns(e.text,e.plugins);return os(n,t.value)}}}),rs=["src","alt"],cs=["textContent"],ss=u.defineComponent({name:"sq-avatar",__name:"avatar",props:{img:{},alt:{},randomColor:{type:Boolean,default:!0},round:{type:Boolean,default:!0},size:{default:"md"}},setup(e){const t=e,n=u.ref(!0),o=u.computed(()=>{const i=[];return t.size!=="md"&&i.push(`sq-avatar--${t.size}`),t.round&&i.push("is-round"),i}),r=u.computed(()=>{if(!t.randomColor)return;const{getRandomColor:i}=wr();return{"--avatar-bg-color":i()}}),c=u.computed(()=>t.alt.charAt(0).toUpperCase());function s(){n.value=!1}return(i,a)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["sq-avatar",o.value]),style:u.normalizeStyle(r.value)},[t.img&&n.value?(u.openBlock(),u.createElementBlock("img",{key:0,src:t.img,alt:t.alt,onError:s},null,40,rs)):(u.openBlock(),u.createElementBlock("span",{key:1,textContent:u.toDisplayString(c.value)},null,8,cs))],6))}}),is={class:"sq-backtop"},as=u.defineComponent({name:"sq-backtop",__name:"backtop",props:{progress:{type:Boolean,default:!0},icon:{default:vn},transition:{default:"sq-rotate-in-left"},visibilityHeight:{default:100},target:{default:"#app"},progressProps:{}},setup(e){const{throttle:t}=us(),n=t(a),o=new ResizeObserver(l),r=e,c=u.ref(100),s=u.ref(0),i=u.computed(()=>s.value>r.visibilityHeight);u.onMounted(()=>{var m;l(),n(),window.addEventListener("scroll",n);const f=document.querySelector(r.target)??document.body;o.observe(f),(m=window.visualViewport)==null||m.addEventListener("resize",l)}),u.onBeforeUnmount(()=>{var f;window.removeEventListener("scroll",n),o.disconnect(),(f=window.visualViewport)==null||f.removeEventListener("resize",l)});function a(){s.value=window.scrollY}function l(){const f=(document.scrollingElement??document.body).scrollHeight,m=window.innerHeight;c.value=f-m}function d(){window.scrollTo({top:0,behavior:"smooth"})}return(f,m)=>(u.openBlock(),u.createBlock(u.Transition,{name:r.transition},{default:u.withCtx(()=>{var h,p,x;return[u.withDirectives(u.createElementVNode("div",is,[u.createElementVNode("div",{class:"sq-backtop-wrap",onClick:d},[r.progress?(u.openBlock(),u.createBlock(u.unref(yn),{key:0,variant:"circle",label:!1,value:s.value,max:c.value,type:(h=r.progressProps)==null?void 0:h.type,stroke:(p=r.progressProps)==null?void 0:p.stroke,color:(x=r.progressProps)==null?void 0:x.color},null,8,["value","max","type","stroke","color"])):u.createCommentVNode("",!0),u.renderSlot(f.$slots,"default",{},()=>[(u.openBlock(),u.createBlock(u.resolveDynamicComponent(r.icon)))])])],512),[[u.vShow,i.value]])]}),_:3},8,["name"]))}}),ls=["textContent"],ds=u.defineComponent({name:"sq-badge",__name:"badge",props:{type:{default:"error"},color:{},showZero:{type:Boolean},max:{default:99},count:{default:0},text:{},dot:{type:Boolean}},setup(e){const t=u.useSlots(),n=e,o=u.computed(()=>{const i=[];return n.dot&&i.push("is-dot"),i.push(`is-${n.type}`),i}),r=u.computed(()=>t.default?"sup":"div"),c=u.computed(()=>!n.dot&&n.text||n.showZero?!0:n.count>0),s=u.computed(()=>n.dot?"":n.text?n.text:n.max&&n.count>n.max?`${n.max}+`:`${n.count}`);return(i,a)=>(u.openBlock(),u.createBlock(u.Transition,{name:"sq-zoom"},{default:u.withCtx(()=>[u.unref(t).default||c.value?(u.openBlock(),u.createElementBlock("span",{key:0,class:u.normalizeClass(["sq-badge",o.value]),style:u.normalizeStyle({"--badge-color":n.color})},[u.renderSlot(i.$slots,"default"),(u.openBlock(),u.createBlock(u.resolveDynamicComponent(r.value),{class:"sq-badge-label"},{default:u.withCtx(()=>[u.createVNode(u.Transition,{name:u.unref(t).default?"sq-zoom":""},{default:u.withCtx(()=>[c.value?(u.openBlock(),u.createElementBlock("span",{key:0,class:"sq-badge-label-inner",textContent:u.toDisplayString(s.value)},null,8,ls)):u.createCommentVNode("",!0)]),_:1},8,["name"])]),_:1}))],6)):u.createCommentVNode("",!0)]),_:3}))}}),Hu=u.defineComponent({name:"sq-blur",__name:"blur",setup(e){return(t,n)=>(u.openBlock(),u.createBlock(u.unref(se),{class:"sq-blur"},{default:u.withCtx(()=>[u.renderSlot(t.$slots,"default")]),_:3}))}});function fs(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(St,void 0),r=u.computed(()=>u.unref(o)?void 0:e.text),c=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.size,e.size,(d=u.unref(n))==null?void 0:d.size,"md")}),s=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.type,e.type)}),i=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.round,e.round,(d=u.unref(n))==null?void 0:d.round)}),a=u.computed(()=>{var l,d,f;return t((l=u.unref(n))==null?void 0:l.disabled,(d=u.unref(n))==null?void 0:d.readonly,(f=u.unref(o))==null?void 0:f.disabled,e.disabled)});return{btnTextType:r,btnSize:c,btnType:s,btnRound:i,btnDisabled:a}}function ps(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject($t,void 0),r=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.size,e.size,(d=u.unref(n))==null?void 0:d.size,"md")}),c=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.form,e.form)}),s=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.name,e.name)}),i=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.variant,e.variant)}),a=u.computed(()=>{var l,d,f;return t((l=u.unref(n))==null?void 0:l.disabled,(d=u.unref(n))==null?void 0:d.readonly,(f=u.unref(o))==null?void 0:f.disabled,e.disabled)});return{checkboxSize:r,checkboxForm:c,checkboxName:s,checkboxVariant:i,checkboxDisabled:a,groupContext:o}}function hs(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(Xe,void 0),r=u.computed(()=>{var a;return t(e.size,(a=u.unref(n))==null?void 0:a.size,"md")}),c=u.computed(()=>{var a;return t(e.round,(a=u.unref(n))==null?void 0:a.round)}),s=u.computed(()=>{var a;return t((a=u.unref(n))==null?void 0:a.disabled,e.disabled)}),i=u.computed(()=>{var a;return t((a=u.unref(n))==null?void 0:a.readonly,e.readonly)});return{inputSize:r,inputRound:c,inputDisabled:s,inputReadonly:i,id:o}}function ms(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(Pt,void 0),r=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.size,e.size,(d=u.unref(n))==null?void 0:d.size,"md")}),c=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.form,e.form)}),s=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.name,e.name)}),i=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.variant,e.variant)}),a=u.computed(()=>{var l,d,f;return t((l=u.unref(n))==null?void 0:l.disabled,(d=u.unref(n))==null?void 0:d.readonly,(f=u.unref(o))==null?void 0:f.disabled,e.disabled)});return{radioSize:r,radioForm:c,radioName:s,radioVariant:i,radioDisabled:a,groupContext:o}}function bs(e){const{getOption:t}=_e(),n=u.inject(Zt,void 0);return{segmentedDisabled:u.computed(()=>{var r;return t((r=u.unref(n))==null?void 0:r.disabled,e.disabled)}),parentContext:n}}function xs(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(Xe,void 0),r=u.computed(()=>{var s;return t(e.size,(s=u.unref(n))==null?void 0:s.size,"md")}),c=u.computed(()=>{var s,i;return t((s=u.unref(n))==null?void 0:s.disabled,(i=u.unref(n))==null?void 0:i.readonly,e.disabled)});return{switchSize:r,switchDisabled:c,id:o}}const gs=["disabled","form","type"],P=u.defineComponent({name:"sq-button",__name:"button",props:{type:{},round:{type:Boolean,default:void 0},text:{type:Boolean},icon:{},loading:{type:Boolean},form:{},bg:{type:Boolean},nativeType:{default:"button"},disabled:{type:Boolean,default:void 0},size:{}},emits:["click"],setup(e,{emit:t}){const n=t,o=e,{btnTextType:r,btnSize:c,btnType:s,btnRound:i,btnDisabled:a}=fs(o),l=u.computed(()=>{const m=[],h=u.unref(c),p=u.unref(s),x=u.unref(i),_=u.unref(r);return h!=="md"&&m.push(`sq-button--${h}`),p&&m.push(`is-${p}`),x&&m.push("is-round"),_&&m.push("is-text"),_&&o.bg&&m.push("has-bg"),m}),d=u.computed(()=>o.loading?Ve:o.icon),f=u.computed(()=>o.loading||u.unref(a));return(m,h)=>(u.openBlock(),u.createElementBlock("button",{class:u.normalizeClass(["sq-button",l.value]),disabled:f.value,form:o.form,type:o.nativeType,onClick:h[0]||(h[0]=p=>n("click",p))},[u.createVNode(u.unref(se),{size:u.unref(c)==="lg"?"md":u.unref(c)},{default:u.withCtx(()=>[d.value?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(d.value),{key:0})):u.createCommentVNode("",!0),u.renderSlot(m.$slots,"default")]),_:3},8,["size"])],10,gs))}}),_s={class:"sq-button-group"},ks=u.defineComponent({name:"sq-button-group",__name:"button-group",props:{size:{},type:{},round:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0}},setup(e){const t=e;return u.provide(St,u.ref({size:u.toRef(t,"size"),type:u.toRef(t,"type"),round:u.toRef(t,"round"),disabled:u.toRef(t,"disabled")})),(n,o)=>(u.openBlock(),u.createElementBlock("div",_s,[u.renderSlot(n.$slots,"default")]))}}),St=Symbol("button-group-context-keys"),ys={class:"sq-card"},Cs={key:0,class:"sq-card-header"},ws=["textContent"],Es={key:1,class:"sq-card-footer"},Ds=u.defineComponent({name:"sq-card",__name:"card",props:{title:{},decorative:{type:Boolean,default:!1}},setup(e){const t=u.useSlots(),n=e;return(o,r)=>(u.openBlock(),u.createElementBlock("section",ys,[n.title||u.unref(t).title?(u.openBlock(),u.createElementBlock("div",Cs,[u.createElementVNode("h2",{class:u.normalizeClass({"has-decorative":n.decorative}),textContent:u.toDisplayString(n.title)},null,10,ws),u.renderSlot(o.$slots,"title")])):u.createCommentVNode("",!0),u.renderSlot(o.$slots,"default"),u.unref(t).footer?(u.openBlock(),u.createElementBlock("div",Es,[u.renderSlot(o.$slots,"footer")])):u.createCommentVNode("",!0)]))}}),As=["autofocus","name","form","value","disabled"],Bs=["textContent"],Mt=u.defineComponent({name:"sq-checkbox",__name:"checkbox",props:u.mergeModels({form:{},name:{},disabled:{type:Boolean,default:void 0},size:{},indeterminate:{type:Boolean},variant:{},autofocus:{type:Boolean},label:{},value:{}},{checked:{type:Boolean,default:!1},checkedModifiers:{}}),emits:u.mergeModels(["change"],["update:checked"]),setup(e,{emit:t}){const n=t,o=e,{checkboxSize:r,checkboxDisabled:c,checkboxForm:s,checkboxName:i,checkboxVariant:a,groupContext:l}=ps(o),d=u.useModel(e,"checked"),f=u.computed(()=>{const h=[],p=u.unref(r),x=u.unref(c),_=u.unref(a);return p!=="md"&&h.push(`sq-selection--${p}`),m.value&&h.push("is-checked"),x&&h.push("is-disabled"),_&&h.push(`is-${_}`),h}),m=u.computed(()=>l?u.unref(l).list.includes(o.value):d.value);return u.watch(m,h=>{if(d.value!==h){d.value=h;return}}),u.watch(d,h=>{m.value!==h&&l&&l.value.toggleItem(o.value)}),u.onMounted(()=>{d.value=m.value}),(h,p)=>(u.openBlock(),u.createElementBlock("label",{class:u.normalizeClass(["sq-selection sq-checkbox",f.value])},[u.withDirectives(u.createElementVNode("input",{type:"checkbox",autofocus:o.autofocus,name:u.unref(i),form:u.unref(s),value:o.value,disabled:u.unref(c),"onUpdate:modelValue":p[0]||(p[0]=x=>d.value=x),onChange:p[1]||(p[1]=x=>n("change",d.value))},null,40,As),[[u.vModelCheckbox,d.value]]),u.unref(a)!=="solid"?(u.openBlock(),u.createElementBlock("span",{key:0,class:u.normalizeClass(["sq-checkbox-box",{"is-indeterminate":o.indeterminate&&!m.value}])},[m.value?(u.openBlock(),u.createBlock(u.unref(Un),{key:0,class:"sq-checkbox-inner"})):u.createCommentVNode("",!0)],2)):u.createCommentVNode("",!0),o.label?(u.openBlock(),u.createElementBlock("span",{key:1,class:"sq-selection-label",textContent:u.toDisplayString(o.label)},null,8,Bs)):u.createCommentVNode("",!0)],2))}}),Fs={class:"sq-checkbox-group sq-selection-group"},Wu=u.defineComponent({name:"sq-checkbox-group",__name:"checkbox-group",props:{items:{default:()=>[]},value:{},form:{},name:{},disabled:{type:Boolean,default:void 0},size:{},variant:{}},emits:["change","update:value"],setup(e,{emit:t}){const{nextId:n}=Ie(),o=t,r=e,c=u.ref(r.value??[]),s=u.computed(()=>r.name??`sq-checkbox-${n()}`);u.provide($t,u.ref({form:u.toRef(r,"form"),name:s,disabled:u.toRef(r,"disabled"),size:u.toRef(r,"size"),variant:u.toRef(r,"variant"),list:c,toggleItem:i})),u.watch(()=>r.value,a=>{const l=a||[],d=[...new Set([...l,c.value])];d.length===l.length&&d.length===c.value.length||(c.value=l)});function i(a){c.value.includes(a)?c.value=c.value.filter(l=>l!==a):c.value.push(a),o("change",u.toRaw(c.value)),o("update:value",u.toRaw(c.value))}return(a,l)=>(u.openBlock(),u.createElementBlock("div",Fs,[u.renderSlot(a.$slots,"default",{},()=>[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(r.items,(d,f)=>(u.openBlock(),u.createBlock(u.unref(Mt),{key:f,label:d.toString(),value:d},null,8,["label","value"]))),128))])]))}}),$t=Symbol("checkbox-group-context-keys"),Gu=u.defineComponent({name:"sq-mask",inheritAttrs:!1,__name:"mask",props:u.mergeModels({keyboard:{type:Boolean,default:!0},maskCloseable:{type:Boolean},onClose:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(e){const{nextZIndex:t}=lt();let n;const o=e,r=u.ref(0),c=u.ref(!1),s=u.useModel(e,"visible");c.value=s.value,u.watch(s,d=>{const f=document.scrollingElement;d?(n=f.style.overflow,f.style.overflow="hidden",r.value=t(),c.value=!0,document.addEventListener("keydown",i)):(f.style.overflow=n,document.removeEventListener("keydown",i))}),u.onBeforeUnmount(()=>{document.removeEventListener("keydown",i)});function i(d){d.key==="Escape"&&o.keyboard&&l()}function a(){o.maskCloseable&&l()}function l(){if(typeof o.onClose!="function"){s.value=!1;return}const d=o.onClose();d instanceof Promise?d.then(f=>{f&&(s.value=!1)}).catch(()=>{}):d&&(s.value=!1)}return(d,f)=>(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[u.createVNode(u.Transition,{name:"sq-fade"},{default:u.withCtx(()=>[c.value?u.withDirectives((u.openBlock(),u.createElementBlock("div",u.mergeProps({key:0,class:"sq-mask",style:{zIndex:r.value}},d.$attrs,{onClick:a}),[u.renderSlot(d.$slots,"default")],16)),[[u.vShow,s.value]]):u.createCommentVNode("",!0)]),_:3})]))}}),Ss={key:0,class:"sq-dialog-header"},Ms=["textContent"],$s={class:"sq-dialog-body"},qs={key:1,class:"sq-dialog-footer"},Ns=u.defineComponent({name:"sq-dialog",__name:"dialog",props:u.mergeModels({type:{},title:{},okText:{default:"确认"},cancelText:{default:"取消"},footer:{type:Boolean,default:!0},closeable:{type:Boolean},onOk:{},keyboard:{type:Boolean,default:void 0},maskCloseable:{type:Boolean,default:void 0},onClose:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(e){const t=u.useSlots(),n=e,o=u.ref(!1),r=u.ref(!1),c=u.useModel(e,"visible"),s=u.computed(()=>!!n.title||!!t.header),i=u.computed(()=>{const m=[];return n.type&&m.push(`is-${n.type}`),s.value&&m.push("has-header"),m}),a=u.computed(()=>n.type?at[n.type]:void 0);function l(m){if(o.value)return!1;if(typeof m!="function")return!0;const h=m();return h instanceof Promise?(o.value=!0,h.finally(()=>{o.value=!1})):h}async function d(){if(o.value)return;r.value=!1,await l(n.onClose)&&(c.value=!1)}async function f(){r.value=!0,await l(n.onOk)&&(c.value=!1)}return(m,h)=>(u.openBlock(),u.createBlock(u.unref(Gu),{visible:c.value,"onUpdate:visible":h[0]||(h[0]=p=>c.value=p),onClose:h[1]||(h[1]=()=>l(n.onClose))},{default:u.withCtx(()=>[u.createElementVNode("div",{class:u.normalizeClass(["sq-dialog",i.value])},[s.value?(u.openBlock(),u.createElementBlock("div",Ss,[a.value?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(a.value),{key:0,class:"sq-dialog-header-icon"})):u.createCommentVNode("",!0),u.renderSlot(m.$slots,"header",{},()=>[u.createElementVNode("span",{class:"sq-dialog-header-title",textContent:u.toDisplayString(n.title)},null,8,Ms)]),u.createVNode(u.unref(it),{class:"sq-dialog-close",onClick:d})])):u.createCommentVNode("",!0),u.createElementVNode("div",$s,[u.renderSlot(m.$slots,"default")]),n.footer?(u.openBlock(),u.createElementBlock("div",qs,[u.renderSlot(m.$slots,"footer",{},()=>[u.createVNode(u.unref(P),{text:"",bg:"",disabled:o.value,onClick:d},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(n.cancelText),1)]),_:1},8,["disabled"]),u.createVNode(u.unref(P),{type:n.type??"primary",disabled:o.value,loading:o.value&&r.value,onClick:f},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(n.okText),1)]),_:1},8,["type","disabled","loading"])])])):u.createCommentVNode("",!0)],2)]),_:3},8,["visible"]))}}),he=u.defineComponent({name:"sq-divider",__name:"divider",props:{direction:{default:"horizontal"},variant:{default:"solid"},orientation:{default:"left"},ellipsis:{type:[Boolean,Number]},size:{}},setup(e){const t=u.useSlots(),n=e,o=u.computed(()=>{const r=[];return["none","solid","dotted","dashed"].includes(n.variant)&&r.push("is-thin"),t.default&&n.direction!=="vertical"&&r.push(`text-${n.orientation}`),r.push(`sq-divider--${n.direction}`),r});return(r,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["sq-divider",o.value]),style:u.normalizeStyle({"--divider-line-type":n.variant})},[u.unref(t).default&&n.direction!=="vertical"?(u.openBlock(),u.createBlock(u.unref(se),{key:0,ellipsis:n.ellipsis,size:n.size},{default:u.withCtx(()=>[u.renderSlot(r.$slots,"default")]),_:3},8,["ellipsis","size"])):u.createCommentVNode("",!0)],6))}}),zs=u.defineComponent({name:"sq-editor-bold",__name:"editor-bold",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{expose:t,emit:n}){const o=n,r=e;function c(){if(r.disabled)return;const s=[...r.rows],i=s[r.selectedRow],a=i.substring(0,r.selectInfo.startOfRow),l=i.substring(r.selectInfo.endOfRow);let d=r.selectedVal??"";if(d.match(/\*\*\*.*?\*\*\*/)){d=d.replaceAll("***","*"),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-4);return}if(d.match(/\*\*.*?\*\*/)){d=d.replaceAll("**",""),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-4);return}d=`**${d}**`,s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,4)}return t({setBold:c}),(s,i)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"加粗 ( Ctrl + B )",disabled:r.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Tn),disabled:r.disabled,onClick:c},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Rs=u.defineComponent({name:"sq-editor-italic",__name:"editor-italic",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{expose:t,emit:n}){const o=n,r=e;function c(){if(r.disabled)return;const s=[...r.rows],i=s[r.selectedRow],a=i.substring(0,r.selectInfo.startOfRow),l=i.substring(r.selectInfo.endOfRow);let d=r.selectedVal??"";if(d.match(/\*\*\*.*?\*\*\*/)){d=d.replaceAll("***","**"),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-2);return}const m=d.match(/\*\*.*?\*\*/),p=((m==null?void 0:m[0])??"").replaceAll("**","").match(/\*.*?\*/);if(m&&!p){d=`*${d}*`,s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,2);return}else if(p){d=d.replaceAll("**","[B]").replaceAll("*","").replaceAll("[B]","**"),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-2);return}if(d.match(/\*.*?\*/)){d=d.replaceAll("*",""),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-2);return}d=`*${d}*`,s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,2)}return t({setItalic:c}),(s,i)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"斜体 ( Ctrl + I )",disabled:r.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Vo),disabled:r.disabled,onClick:c},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Ts=u.defineComponent({name:"sq-editor-underline",__name:"editor-underline",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{expose:t,emit:n}){const o=n,r=e;function c(){var p;if(r.disabled)return;const s=[...r.rows],i=s[r.selectedRow],a=i.substring(0,r.selectInfo.startOfRow),l=i.substring(r.selectInfo.endOfRow),d=/<u\b.*?>/;let f=r.selectedVal??"";const m=((p=f.match(d))==null?void 0:p[0])??"";if(f.match(/<u\b.*?>.*?<\/u>/)){f=f.replace(m,"").replace("</u>","");const x=m.length+4;s[r.selectedRow]=`${a}${f}${l}`,o("updateText",s,0,-x);return}f=`<u>${f}</u>`,s[r.selectedRow]=`${a}${f}${l}`,o("updateText",s,0,7)}return t({setUnderline:c}),(s,i)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"下划线 ( Ctrl + U )",disabled:r.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(sr),disabled:r.disabled,onClick:c},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Ls=u.defineComponent({name:"sq-editor-strikethrough",__name:"editor-strikethrough",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){if(o.disabled)return;const c=[...o.rows],s=c[o.selectedRow],i=s.substring(0,o.selectInfo.startOfRow),a=s.substring(o.selectInfo.endOfRow);let l=o.selectedVal??"";if(l.match(/\~\~.*?\~\~/)){l=l.replaceAll("~~",""),c[o.selectedRow]=`${i}${l}${a}`,n("updateText",c,0,-4);return}l=`~~${l}~~`,c[o.selectedRow]=`${i}${l}${a}`,n("updateText",c,0,4)}return(c,s)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"删除线",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(nr),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Vs=u.defineComponent({name:"sq-editor-blur",__name:"editor-blur",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){var h;if(o.disabled)return;const c=[...o.rows],s=c[o.selectedRow],i=s.substring(0,o.selectInfo.startOfRow),a=s.substring(o.selectInfo.endOfRow),l=/<blur\b.*?>/;let d=o.selectedVal??"";const f=((h=d.match(l))==null?void 0:h[0])??"";if(d.match(/<blur\b.*?>.*?<\/blur>/)){d=d.replace(f,"").replace("</blur>","");const p=f.length+7;c[o.selectedRow]=`${i}${d}${a}`,n("updateText",c,0,-p);return}d=`<blur>${d}</blur>`,c[o.selectedRow]=`${i}${d}${a}`,n("updateText",c,0,13)}return(c,s)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"模糊块",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Gt),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Is=u.defineComponent({name:"sq-editor-ul",__name:"editor-ul",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){const a=o.selectedRow,l=[...o.rows],d=l[a];if(c(d)){l[a]=d.replace("- ",""),n("updateText",l,-2,-2);return}if(s(d)){const f=i(d),m=2-f.length;l[a]=d.replace(f,"- "),n("updateText",l,m,m);return}l[a]=`- ${d}`,n("updateText",l,2,2)}function c(a){return a.replace(" ","").startsWith("- ")}function s(a){return/^\d+\.\s+/.test(a.replace(" ",""))}function i(a){return a.replace(" ","").match(/^\d+\.\s/)[0]}return(a,l)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"无序列表",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Yo),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),vs=u.defineComponent({name:"sq-editor-ol",__name:"editor-ol",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){const a=o.selectedRow,l=[...o.rows],d=l[a],f=a>0?l[a-1]:"";let m=1;if(c(d)){f&&s(f)&&(m=parseInt(i(f))+1);const x=`${m}. `,_=x.length-2;l[a]=d.replace("- ",x),n("updateText",l,_,_);return}if(s(d)){const x=i(d),_=-x.length;l[a]=d.replace(x,""),n("updateText",l,_,_);return}f&&s(f)&&(m=parseInt(i(f))+1);const h=`${m}. `,p=h.length;l[a]=`${h}${d}`,n("updateText",l,p,p)}function c(a){return a.replace(" ","").startsWith("- ")}function s(a){return/^\d+\.\s+/.test(a.replace(" ",""))}function i(a){return a.replace(" ","").match(/^\d+\.\s/)[0]}return(a,l)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"有序列表",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Ho),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Os={class:"sq-editor-body"},Ps={class:"sq-editor-toolbar"},Zs={class:"sq-editor-control"},Us=u.defineComponent({name:"sq-editor",__name:"editor",props:u.mergeModels({round:{type:Boolean},disabled:{type:Boolean},placeholder:{},maxlength:{},minlength:{},size:{},beforePreview:{}},{value:{default:""},valueModifiers:{}}),emits:["update:value"],setup(e){const t=[{text:"编辑",value:"edit"},{text:"预览",value:"preview"}];let n;const o=e,r=u.ref("edit"),c=u.ref([]),s=u.ref(!1),i=u.ref(""),a=u.ref(),l=u.ref({}),d=u.shallowRef(null),f=u.shallowRef(null),m=u.shallowRef(null),h=u.shallowRef(null),p=u.useModel(e,"value"),x=u.computed(()=>{const A=[];return o.size!=="md"&&A.push(`sq-editor--${o.size}`),o.round&&A.push("is-round"),A}),_=u.computed(()=>i.value.length&&!i.value.includes(`
49
+ `,c.map=[t,e.line],!0}function V0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>c)return!1;const s=e.src.charCodeAt(r);if(s!==126&&s!==96)return!1;let i=r;r=e.skipChars(r,s);let a=r-i;if(a<3)return!1;const l=e.src.slice(i,r),d=e.src.slice(r,c);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(o)return!0;let f=t,m=!1;for(;f++,!(f>=n||(r=i=e.bMarks[f]+e.tShift[f],c=e.eMarks[f],r<c&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(r)===s&&!(e.sCount[f]-e.blkIndent>=4)&&(r=e.skipChars(r,s),!(r-i<a)&&(r=e.skipSpaces(r),!(r<c)))){m=!0;break}a=e.sCount[t],e.line=f+(m?1:0);const h=e.push("fence","code",0);return h.info=d,h.content=e.getLines(t+1,f,a,!0),h.markup=l,h.map=[t,e.line],!0}function I0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];const s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(o)return!0;const i=[],a=[],l=[],d=[],f=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=t;p<n;p++){const C=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],c=e.eMarks[p],r>=c)break;if(e.src.charCodeAt(r++)===62&&!C){let B=e.sCount[p]+1,S,R;e.src.charCodeAt(r)===32?(r++,B++,R=!1,S=!0):e.src.charCodeAt(r)===9?(S=!0,(e.bsCount[p]+B)%4===3?(r++,B++,R=!1):R=!0):S=!1;let T=B;for(i.push(e.bMarks[p]),e.bMarks[p]=r;r<c;){const D=e.src.charCodeAt(r);if(O(D))D===9?T+=4-(T+e.bsCount[p]+(R?1:0))%4:T++;else break;r++}h=r>=c,a.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(S?1:0),l.push(e.sCount[p]),e.sCount[p]=T-B,d.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(h)break;let k=!1;for(let B=0,S=f.length;B<S;B++)if(f[B](e,p,n,!0)){k=!0;break}if(k){e.lineMax=p,e.blkIndent!==0&&(i.push(e.bMarks[p]),a.push(e.bsCount[p]),d.push(e.tShift[p]),l.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}i.push(e.bMarks[p]),a.push(e.bsCount[p]),d.push(e.tShift[p]),l.push(e.sCount[p]),e.sCount[p]=-1}const x=e.blkIndent;e.blkIndent=0;const _=e.push("blockquote_open","blockquote",1);_.markup=">";const E=[t,0];_.map=E,e.md.block.tokenize(e,t,p);const y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=s,e.parentType=m,E[1]=e.line;for(let C=0;C<d.length;C++)e.bMarks[C+t]=i[C],e.tShift[C+t]=d[C],e.sCount[C+t]=l[C],e.bsCount[C+t]=a[C];return e.blkIndent=x,!0}function v0(e,t,n,o){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let c=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(c++);if(s!==42&&s!==45&&s!==95)return!1;let i=1;for(;c<r;){const l=e.src.charCodeAt(c++);if(l!==s&&!O(l))return!1;l===s&&i++}if(i<3)return!1;if(o)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=Array(i+1).join(String.fromCharCode(s)),!0}function yu(e,t){const n=e.eMarks[t];let o=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(o++);if(r!==42&&r!==45&&r!==43)return-1;if(o<n){const c=e.src.charCodeAt(o);if(!O(c))return-1}return o}function Cu(e,t){const n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];let r=n;if(r+1>=o)return-1;let c=e.src.charCodeAt(r++);if(c<48||c>57)return-1;for(;;){if(r>=o)return-1;if(c=e.src.charCodeAt(r++),c>=48&&c<=57){if(r-n>=10)return-1;continue}if(c===41||c===46)break;return-1}return r<o&&(c=e.src.charCodeAt(r),!O(c))?-1:r}function O0(e,t){const n=e.level+2;for(let o=t+2,r=e.tokens.length-2;o<r;o++)e.tokens[o].level===n&&e.tokens[o].type==="paragraph_open"&&(e.tokens[o+2].hidden=!0,e.tokens[o].hidden=!0,o+=2)}function P0(e,t,n,o){let r,c,s,i,a=t,l=!0;if(e.sCount[a]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]<e.blkIndent)return!1;let d=!1;o&&e.parentType==="paragraph"&&e.sCount[a]>=e.blkIndent&&(d=!0);let f,m,h;if((h=Cu(e,a))>=0){if(f=!0,s=e.bMarks[a]+e.tShift[a],m=Number(e.src.slice(s,h-1)),d&&m!==1)return!1}else if((h=yu(e,a))>=0)f=!1;else return!1;if(d&&e.skipSpaces(h)>=e.eMarks[a])return!1;if(o)return!0;const p=e.src.charCodeAt(h-1),x=e.tokens.length;f?(i=e.push("ordered_list_open","ol",1),m!==1&&(i.attrs=[["start",m]])):i=e.push("bullet_list_open","ul",1);const _=[a,0];i.map=_,i.markup=String.fromCharCode(p);let E=!1;const y=e.md.block.ruler.getRules("list"),C=e.parentType;for(e.parentType="list";a<n;){c=h,r=e.eMarks[a];const k=e.sCount[a]+h-(e.bMarks[a]+e.tShift[a]);let B=k;for(;c<r;){const L=e.src.charCodeAt(c);if(L===9)B+=4-(B+e.bsCount[a])%4;else if(L===32)B++;else break;c++}const S=c;let R;S>=r?R=1:R=B-k,R>4&&(R=1);const T=k+R;i=e.push("list_item_open","li",1),i.markup=String.fromCharCode(p);const D=[a,0];i.map=D,f&&(i.info=e.src.slice(s,h-1));const g=e.tight,b=e.tShift[a],A=e.sCount[a],w=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=T,e.tight=!0,e.tShift[a]=S-e.bMarks[a],e.sCount[a]=B,S>=r&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,a,n,!0),(!e.tight||E)&&(l=!1),E=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=w,e.tShift[a]=b,e.sCount[a]=A,e.tight=g,i=e.push("list_item_close","li",-1),i.markup=String.fromCharCode(p),a=e.line,D[1]=a,a>=n||e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)break;let M=!1;for(let L=0,V=y.length;L<V;L++)if(y[L](e,a,n,!0)){M=!0;break}if(M)break;if(f){if(h=Cu(e,a),h<0)break;s=e.bMarks[a]+e.tShift[a]}else if(h=yu(e,a),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return f?i=e.push("ordered_list_close","ol",-1):i=e.push("bullet_list_close","ul",-1),i.markup=String.fromCharCode(p),_[1]=a,e.line=a,e.parentType=C,l&&O0(e,x),!0}function Z0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function i(y){const C=e.lineMax;if(y>=C||e.isEmpty(y))return null;let k=!1;if(e.sCount[y]-e.blkIndent>3&&(k=!0),e.sCount[y]<0&&(k=!0),!k){const R=e.md.block.ruler.getRules("reference"),T=e.parentType;e.parentType="reference";let D=!1;for(let g=0,b=R.length;g<b;g++)if(R[g](e,y,C,!0)){D=!0;break}if(e.parentType=T,D)return null}const B=e.bMarks[y]+e.tShift[y],S=e.eMarks[y];return e.src.slice(B,S+1)}let a=e.src.slice(r,c+1);c=a.length;let l=-1;for(r=1;r<c;r++){const y=a.charCodeAt(r);if(y===91)return!1;if(y===93){l=r;break}else if(y===10){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}else if(y===92&&(r++,r<c&&a.charCodeAt(r)===10)){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}}if(l<0||a.charCodeAt(l+1)!==58)return!1;for(r=l+2;r<c;r++){const y=a.charCodeAt(r);if(y===10){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}else if(!O(y))break}const d=e.md.helpers.parseLinkDestination(a,r,c);if(!d.ok)return!1;const f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;r=d.pos;const m=r,h=s,p=r;for(;r<c;r++){const y=a.charCodeAt(r);if(y===10){const C=i(s);C!==null&&(a+=C,c=a.length,s++)}else if(!O(y))break}let x=e.md.helpers.parseLinkTitle(a,r,c);for(;x.can_continue;){const y=i(s);if(y===null)break;a+=y,r=c,c=a.length,s++,x=e.md.helpers.parseLinkTitle(a,r,c,x)}let _;for(r<c&&p!==r&&x.ok?(_=x.str,r=x.pos):(_="",r=m,s=h);r<c;){const y=a.charCodeAt(r);if(!O(y))break;r++}if(r<c&&a.charCodeAt(r)!==10&&_)for(_="",r=m,s=h;r<c;){const y=a.charCodeAt(r);if(!O(y))break;r++}if(r<c&&a.charCodeAt(r)!==10)return!1;const E=Ze(a.slice(1,l));return E?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[E]>"u"&&(e.env.references[E]={title:_,href:f}),e.line=s),!0):!1}const U0=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],j0="[a-zA-Z_:][a-zA-Z0-9:._-]*",H0="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",wu="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+j0+"(?:\\s*=\\s*"+H0+")?)")+"*\\s*\\/?>",Eu="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",W0="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",G0="<[?][\\s\\S]*?[?]>",X0="<![A-Za-z][^>]*>",Y0="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",K0=new RegExp("^(?:"+wu+"|"+Eu+"|"+W0+"|"+G0+"|"+X0+"|"+Y0+")"),J0=new RegExp("^(?:"+wu+"|"+Eu+")"),we=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+U0.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(J0.source+"\\s*$"),/^$/,!1]];function Q0(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let s=e.src.slice(r,c),i=0;for(;i<we.length&&!we[i][0].test(s);i++);if(i===we.length)return!1;if(o)return we[i][2];let a=t+1;if(!we[i][1].test(s)){for(;a<n&&!(e.sCount[a]<e.blkIndent);a++)if(r=e.bMarks[a]+e.tShift[a],c=e.eMarks[a],s=e.src.slice(r,c),we[i][1].test(s)){s.length!==0&&a++;break}}e.line=a;const l=e.push("html_block","",0);return l.map=[t,a],l.content=e.getLines(t,a,e.blkIndent,!0),!0}function ec(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(r);if(s!==35||r>=c)return!1;let i=1;for(s=e.src.charCodeAt(++r);s===35&&r<c&&i<=6;)i++,s=e.src.charCodeAt(++r);if(i>6||r<c&&!O(s))return!1;if(o)return!0;c=e.skipSpacesBack(c,r);const a=e.skipCharsBack(c,35,r);a>r&&O(e.src.charCodeAt(a-1))&&(c=a),e.line=t+1;const l=e.push("heading_open","h"+String(i),1);l.markup="########".slice(0,i),l.map=[t,e.line];const d=e.push("inline","",0);d.content=e.src.slice(r,c).trim(),d.map=[t,e.line],d.children=[];const f=e.push("heading_close","h"+String(i),-1);return f.markup="########".slice(0,i),!0}function tc(e,t,n){const o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let c=0,s,i=t+1;for(;i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3)continue;if(e.sCount[i]>=e.blkIndent){let h=e.bMarks[i]+e.tShift[i];const p=e.eMarks[i];if(h<p&&(s=e.src.charCodeAt(h),(s===45||s===61)&&(h=e.skipChars(h,s),h=e.skipSpaces(h),h>=p))){c=s===61?1:2;break}}if(e.sCount[i]<0)continue;let m=!1;for(let h=0,p=o.length;h<p;h++)if(o[h](e,i,n,!0)){m=!0;break}if(m)break}if(!c)return!1;const a=e.getLines(t,i,e.blkIndent,!1).trim();e.line=i+1;const l=e.push("heading_open","h"+String(c),1);l.markup=String.fromCharCode(s),l.map=[t,e.line];const d=e.push("inline","",0);d.content=a,d.map=[t,e.line-1],d.children=[];const f=e.push("heading_close","h"+String(c),-1);return f.markup=String.fromCharCode(s),e.parentType=r,!0}function uc(e,t,n){const o=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let c=t+1;for(e.parentType="paragraph";c<n&&!e.isEmpty(c);c++){if(e.sCount[c]-e.blkIndent>3||e.sCount[c]<0)continue;let l=!1;for(let d=0,f=o.length;d<f;d++)if(o[d](e,c,n,!0)){l=!0;break}if(l)break}const s=e.getLines(t,c,e.blkIndent,!1).trim();e.line=c;const i=e.push("paragraph_open","p",1);i.map=[t,e.line];const a=e.push("inline","",0);return a.content=s,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const je=[["table",T0,["paragraph","reference"]],["code",L0],["fence",V0,["paragraph","reference","blockquote","list"]],["blockquote",I0,["paragraph","reference","blockquote","list"]],["hr",v0,["paragraph","reference","blockquote","list"]],["list",P0,["paragraph","reference","blockquote"]],["reference",Z0],["html_block",Q0,["paragraph","reference","blockquote"]],["heading",ec,["paragraph","reference","blockquote"]],["lheading",tc],["paragraph",uc]];function He(){this.ruler=new W;for(let e=0;e<je.length;e++)this.ruler.push(je[e][0],je[e][1],{alt:(je[e][2]||[]).slice()})}He.prototype.tokenize=function(e,t,n){const o=this.ruler.getRules(""),r=o.length,c=e.md.options.maxNesting;let s=t,i=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=c){e.line=n;break}const a=e.line;let l=!1;for(let d=0;d<r;d++)if(l=o[d](e,s,n,!1),l){if(a>=e.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");e.tight=!i,e.isEmpty(e.line-1)&&(i=!0),s=e.line,s<n&&e.isEmpty(s)&&(i=!0,s++,e.line=s)}},He.prototype.parse=function(e,t,n,o){if(!e)return;const r=new this.State(e,t,n,o);this.tokenize(r,r.line,r.lineMax)},He.prototype.State=te;function Ne(e,t,n,o){this.src=e,this.env=n,this.md=t,this.tokens=o,this.tokens_meta=Array(o.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}Ne.prototype.pushPending=function(){const e=new Y("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Ne.prototype.push=function(e,t,n){this.pending&&this.pushPending();const o=new Y(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(r),o},Ne.prototype.scanDelims=function(e,t){const n=this.posMax,o=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let c=e;for(;c<n&&this.src.charCodeAt(c)===o;)c++;const s=c-e,i=c<n?this.src.charCodeAt(c):32,a=qe(r)||$e(String.fromCharCode(r)),l=qe(i)||$e(String.fromCharCode(i)),d=Me(r),f=Me(i),m=!f&&(!l||d||a),h=!d&&(!a||f||l);return{can_open:m&&(t||!h||a),can_close:h&&(t||!m||l),length:s}},Ne.prototype.Token=Y;function nc(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function oc(e,t){let n=e.pos;for(;n<e.posMax&&!nc(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const rc=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function cc(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(rc);if(!r)return!1;const c=r[1],s=e.md.linkify.matchAtStart(e.src.slice(n-c.length));if(!s)return!1;let i=s.url;if(i.length<=c.length)return!1;i=i.replace(/\*+$/,"");const a=e.md.normalizeLink(i);if(!e.md.validateLink(a))return!1;if(!t){e.pending=e.pending.slice(0,-c.length);const l=e.push("link_open","a",1);l.attrs=[["href",a]],l.markup="linkify",l.info="auto";const d=e.push("text","",0);d.content=e.md.normalizeLinkText(i);const f=e.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return e.pos+=i.length-c.length,!0}function sc(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const o=e.pending.length-1,r=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let c=o-1;for(;c>=1&&e.pending.charCodeAt(c-1)===32;)c--;e.pending=e.pending.slice(0,c),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(n++;n<r&&O(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const yt=[];for(let e=0;e<256;e++)yt.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){yt[e.charCodeAt(0)]=1});function ic(e,t){let n=e.pos;const o=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=o))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(r=e.src.charCodeAt(n),!!O(r));)n++;return e.pos=n,!0}let c=e.src[n];if(r>=55296&&r<=56319&&n+1<o){const i=e.src.charCodeAt(n+1);i>=56320&&i<=57343&&(c+=e.src[n+1],n++)}const s="\\"+c;if(!t){const i=e.push("text_special","",0);r<256&&yt[r]!==0?i.content=c:i.content=s,i.markup=s,i.info="escape"}return e.pos=n+1,!0}function ac(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const c=e.posMax;for(;n<c&&e.src.charCodeAt(n)===96;)n++;const s=e.src.slice(r,n),i=s.length;if(e.backticksScanned&&(e.backticks[i]||0)<=r)return t||(e.pending+=s),e.pos+=i,!0;let a=n,l;for(;(l=e.src.indexOf("`",a))!==-1;){for(a=l+1;a<c&&e.src.charCodeAt(a)===96;)a++;const d=a-l;if(d===i){if(!t){const f=e.push("code_inline","code",0);f.markup=s,f.content=e.src.slice(n,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[d]=l}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=i,!0}function lc(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;const r=e.scanDelims(e.pos,!0);let c=r.length;const s=String.fromCharCode(o);if(c<2)return!1;let i;c%2&&(i=e.push("text","",0),i.content=s,c--);for(let a=0;a<c;a+=2)i=e.push("text","",0),i.content=s+s,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function Du(e,t){let n;const o=[],r=t.length;for(let c=0;c<r;c++){const s=t[c];if(s.marker!==126||s.end===-1)continue;const i=t[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[i.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[i.token-1].type==="text"&&e.tokens[i.token-1].content==="~"&&o.push(i.token-1)}for(;o.length;){const c=o.pop();let s=c+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,c!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[c],e.tokens[c]=n)}}function dc(e){const t=e.tokens_meta,n=e.tokens_meta.length;Du(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Du(e,t[o].delimiters)}const Au={tokenize:lc,postProcess:dc};function fc(e,t){const n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;const r=e.scanDelims(e.pos,o===42);for(let c=0;c<r.length;c++){const s=e.push("text","",0);s.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function Bu(e,t){const n=t.length;for(let o=n-1;o>=0;o--){const r=t[o];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const c=t[r.end],s=o>0&&t[o-1].end===r.end+1&&t[o-1].marker===r.marker&&t[o-1].token===r.token-1&&t[r.end+1].token===c.token+1,i=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?i+i:i,a.content="";const l=e.tokens[c.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?i+i:i,l.content="",s&&(e.tokens[t[o-1].token].content="",e.tokens[t[r.end+1].token].content="",o--)}}function pc(e){const t=e.tokens_meta,n=e.tokens_meta.length;Bu(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Bu(e,t[o].delimiters)}const Fu={tokenize:fc,postProcess:pc};function hc(e,t){let n,o,r,c,s="",i="",a=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const d=e.pos,f=e.posMax,m=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<f&&e.src.charCodeAt(p)===40){for(l=!1,p++;p<f&&(n=e.src.charCodeAt(p),!(!O(n)&&n!==10));p++);if(p>=f)return!1;if(a=p,r=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),r.ok){for(s=e.md.normalizeLink(r.str),e.md.validateLink(s)?p=r.pos:s="",a=p;p<f&&(n=e.src.charCodeAt(p),!(!O(n)&&n!==10));p++);if(r=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<f&&a!==p&&r.ok)for(i=r.str,p=r.pos;p<f&&(n=e.src.charCodeAt(p),!(!O(n)&&n!==10));p++);}(p>=f||e.src.charCodeAt(p)!==41)&&(l=!0),p++}if(l){if(typeof e.env.references>"u")return!1;if(p<f&&e.src.charCodeAt(p)===91?(a=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?o=e.src.slice(a,p++):p=h+1):p=h+1,o||(o=e.src.slice(m,h)),c=e.env.references[Ze(o)],!c)return e.pos=d,!1;s=c.href,i=c.title}if(!t){e.pos=m,e.posMax=h;const x=e.push("link_open","a",1),_=[["href",s]];x.attrs=_,i&&_.push(["title",i]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=f,!0}function mc(e,t){let n,o,r,c,s,i,a,l,d="";const f=e.pos,m=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(c=p+1,c<m&&e.src.charCodeAt(c)===40){for(c++;c<m&&(n=e.src.charCodeAt(c),!(!O(n)&&n!==10));c++);if(c>=m)return!1;for(l=c,i=e.md.helpers.parseLinkDestination(e.src,c,e.posMax),i.ok&&(d=e.md.normalizeLink(i.str),e.md.validateLink(d)?c=i.pos:d=""),l=c;c<m&&(n=e.src.charCodeAt(c),!(!O(n)&&n!==10));c++);if(i=e.md.helpers.parseLinkTitle(e.src,c,e.posMax),c<m&&l!==c&&i.ok)for(a=i.str,c=i.pos;c<m&&(n=e.src.charCodeAt(c),!(!O(n)&&n!==10));c++);else a="";if(c>=m||e.src.charCodeAt(c)!==41)return e.pos=f,!1;c++}else{if(typeof e.env.references>"u")return!1;if(c<m&&e.src.charCodeAt(c)===91?(l=c+1,c=e.md.helpers.parseLinkLabel(e,c),c>=0?r=e.src.slice(l,c++):c=p+1):c=p+1,r||(r=e.src.slice(h,p)),s=e.env.references[Ze(r)],!s)return e.pos=f,!1;d=s.href,a=s.title}if(!t){o=e.src.slice(h,p);const x=[];e.md.inline.parse(o,e.md,e.env,x);const _=e.push("image","img",0),E=[["src",d],["alt",""]];_.attrs=E,_.children=x,_.content=o,a&&E.push(["title",a])}return e.pos=c,e.posMax=m,!0}const 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])?)*)$/,xc=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function gc(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const o=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const c=e.src.slice(o+1,n);if(xc.test(c)){const s=e.md.normalizeLink(c);if(!e.md.validateLink(s))return!1;if(!t){const i=e.push("link_open","a",1);i.attrs=[["href",s]],i.markup="autolink",i.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(c);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=c.length+2,!0}if(bc.test(c)){const s=e.md.normalizeLink("mailto:"+c);if(!e.md.validateLink(s))return!1;if(!t){const i=e.push("link_open","a",1);i.attrs=[["href",s]],i.markup="autolink",i.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(c);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=c.length+2,!0}return!1}function _c(e){return/^<a[>\s]/i.test(e)}function kc(e){return/^<\/a\s*>/i.test(e)}function yc(e){const t=e|32;return t>=97&&t<=122}function Cc(e,t){if(!e.md.options.html)return!1;const n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==60||o+2>=n)return!1;const r=e.src.charCodeAt(o+1);if(r!==33&&r!==63&&r!==47&&!yc(r))return!1;const c=e.src.slice(o).match(K0);if(!c)return!1;if(!t){const s=e.push("html_inline","",0);s.content=c[0],_c(s.content)&&e.linkLevel++,kc(s.content)&&e.linkLevel--}return e.pos+=c[0].length,!0}const wc=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ec=/^&([a-z][a-z0-9]{1,31});/i;function Dc(e,t){const n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){const c=e.src.slice(n).match(wc);if(c){if(!t){const s=c[1][0].toLowerCase()==="x"?parseInt(c[1].slice(1),16):parseInt(c[1],10),i=e.push("text_special","",0);i.content=xt(s)?Pe(s):Pe(65533),i.markup=c[0],i.info="entity"}return e.pos+=c[0].length,!0}}else{const c=e.src.slice(n).match(Ec);if(c){const s=pu(c[0]);if(s!==c[0]){if(!t){const i=e.push("text_special","",0);i.content=s,i.markup=c[0],i.info="entity"}return e.pos+=c[0].length,!0}}}return!1}function Su(e){const t={},n=e.length;if(!n)return;let o=0,r=-2;const c=[];for(let s=0;s<n;s++){const i=e[s];if(c.push(0),(e[o].marker!==i.marker||r!==i.token-1)&&(o=s),r=i.token,i.length=i.length||0,!i.close)continue;t.hasOwnProperty(i.marker)||(t[i.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[i.marker][(i.open?3:0)+i.length%3];let l=o-c[o]-1,d=l;for(;l>a;l-=c[l]+1){const f=e[l];if(f.marker===i.marker&&f.open&&f.end<0){let m=!1;if((f.close||i.open)&&(f.length+i.length)%3===0&&(f.length%3!==0||i.length%3!==0)&&(m=!0),!m){const h=l>0&&!e[l-1].open?c[l-1]+1:0;c[s]=s-l+h,c[l]=h,i.open=!1,f.end=s,f.close=!1,d=-1,r=-2;break}}}d!==-1&&(t[i.marker][(i.open?3:0)+(i.length||0)%3]=d)}}function Ac(e){const t=e.tokens_meta,n=e.tokens_meta.length;Su(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&Su(t[o].delimiters)}function Bc(e){let t,n,o=0;const r=e.tokens,c=e.tokens.length;for(t=n=0;t<c;t++)r[t].nesting<0&&o--,r[t].level=o,r[t].nesting>0&&o++,r[t].type==="text"&&t+1<c&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const Ct=[["text",oc],["linkify",cc],["newline",sc],["escape",ic],["backticks",ac],["strikethrough",Au.tokenize],["emphasis",Fu.tokenize],["link",hc],["image",mc],["autolink",gc],["html_inline",Cc],["entity",Dc]],wt=[["balance_pairs",Ac],["strikethrough",Au.postProcess],["emphasis",Fu.postProcess],["fragments_join",Bc]];function ze(){this.ruler=new W;for(let e=0;e<Ct.length;e++)this.ruler.push(Ct[e][0],Ct[e][1]);this.ruler2=new W;for(let e=0;e<wt.length;e++)this.ruler2.push(wt[e][0],wt[e][1])}ze.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),o=n.length,r=e.md.options.maxNesting,c=e.cache;if(typeof c[t]<"u"){e.pos=c[t];return}let s=!1;if(e.level<r){for(let i=0;i<o;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,c[t]=e.pos},ze.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,o=e.posMax,r=e.md.options.maxNesting;for(;e.pos<o;){const c=e.pos;let s=!1;if(e.level<r){for(let i=0;i<n;i++)if(s=t[i](e,!1),s){if(c>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},ze.prototype.parse=function(e,t,n,o){const r=new this.State(e,t,n,o);this.tokenize(r);const c=this.ruler2.getRules(""),s=c.length;for(let i=0;i<s;i++)c[i](r)},ze.prototype.State=Ne;function Fc(e){const t={};e=e||{},t.src_Any=iu.source,t.src_Cc=au.source,t.src_Z=du.source,t.src_P=pt.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Et(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(o){e[o]=n[o]})}),e}function We(e){return Object.prototype.toString.call(e)}function Sc(e){return We(e)==="[object String]"}function Mc(e){return We(e)==="[object Object]"}function $c(e){return We(e)==="[object RegExp]"}function Mu(e){return We(e)==="[object Function]"}function qc(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const $u={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Nc(e){return Object.keys(e||{}).reduce(function(t,n){return t||$u.hasOwnProperty(n)},!1)}const zc={"http:":{validate:function(e,t,n){const o=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},Rc="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]",Tc="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Lc(e){e.__index__=-1,e.__text_cache__=""}function Vc(e){return function(t,n){const o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function qu(){return function(e,t){t.normalize(e)}}function Ge(e){const t=e.re=Fc(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Rc),n.push(t.src_xn),t.src_tlds=n.join("|");function o(i){return i.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function c(i,a){throw new Error('(LinkifyIt) Invalid schema "'+i+'": '+a)}Object.keys(e.__schemas__).forEach(function(i){const a=e.__schemas__[i];if(a===null)return;const l={validate:null,link:null};if(e.__compiled__[i]=l,Mc(a)){$c(a.validate)?l.validate=Vc(a.validate):Mu(a.validate)?l.validate=a.validate:c(i,a),Mu(a.normalize)?l.normalize=a.normalize:a.normalize?c(i,a):l.normalize=qu();return}if(Sc(a)){r.push(i);return}c(i,a)}),r.forEach(function(i){e.__compiled__[e.__schemas__[i]]&&(e.__compiled__[i].validate=e.__compiled__[e.__schemas__[i]].validate,e.__compiled__[i].normalize=e.__compiled__[e.__schemas__[i]].normalize)}),e.__compiled__[""]={validate:null,normalize:qu()};const s=Object.keys(e.__compiled__).filter(function(i){return i.length>0&&e.__compiled__[i]}).map(qc).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+s+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Lc(e)}function Ic(e,t){const n=e.__index__,o=e.__last_index__,r=e.__text_cache__.slice(n,o);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=o+t,this.raw=r,this.text=r,this.url=r}function Dt(e,t){const n=new Ic(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function G(e,t){if(!(this instanceof G))return new G(e,t);t||Nc(e)&&(t=e,e={}),this.__opts__=Et({},$u,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Et({},zc,e),this.__compiled__={},this.__tlds__=Tc,this.__tlds_replaced__=!1,this.re={},Ge(this)}G.prototype.add=function(t,n){return this.__schemas__[t]=n,Ge(this),this},G.prototype.set=function(t){return this.__opts__=Et(this.__opts__,t),this},G.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,o,r,c,s,i,a,l,d;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(n=a.exec(t))!==null;)if(c=this.testSchemaAt(t,n[2],a.lastIndex),c){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+c;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=t.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(o=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(s=o.index+o[1].length,(this.__index__<0||s<this.__index__)&&(this.__schema__="",this.__index__=s,this.__last_index__=o.index+o[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(d=t.indexOf("@"),d>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(s=r.index+r[1].length,i=r.index+r[0].length,(this.__index__<0||s<this.__index__||s===this.__index__&&i>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=s,this.__last_index__=i))),this.__index__>=0},G.prototype.pretest=function(t){return this.re.pretest.test(t)},G.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0},G.prototype.match=function(t){const n=[];let o=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Dt(this,o)),o=this.__last_index__);let r=o?t.slice(o):t;for(;this.test(r);)n.push(Dt(this,o)),r=r.slice(this.__last_index__),o+=this.__last_index__;return n.length?n:null},G.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const o=this.testSchemaAt(t,n[2],n[0].length);return o?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o,Dt(this,0)):null},G.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,r,c){return o!==c[r-1]}).reverse(),Ge(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Ge(this),this)},G.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},G.prototype.onCompile=function(){};const Ee=2147483647,ue=36,At=1,Re=26,vc=38,Oc=700,Nu=72,zu=128,Ru="-",Pc=/^xn--/,Zc=/[^\0-\x7F]/,Uc=/[\x2E\u3002\uFF0E\uFF61]/g,jc={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Bt=ue-At,ne=Math.floor,Ft=String.fromCharCode;function de(e){throw new RangeError(jc[e])}function Hc(e,t){const n=[];let o=e.length;for(;o--;)n[o]=t(e[o]);return n}function Tu(e,t){const n=e.split("@");let o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace(Uc,".");const r=e.split("."),c=Hc(r,t).join(".");return o+c}function Lu(e){const t=[];let n=0;const o=e.length;for(;n<o;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<o){const c=e.charCodeAt(n++);(c&64512)==56320?t.push(((r&1023)<<10)+(c&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const Wc=e=>String.fromCodePoint(...e),Gc=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:ue},Vu=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Iu=function(e,t,n){let o=0;for(e=n?ne(e/Oc):e>>1,e+=ne(e/t);e>Bt*Re>>1;o+=ue)e=ne(e/Bt);return ne(o+(Bt+1)*e/(e+vc))},vu=function(e){const t=[],n=e.length;let o=0,r=zu,c=Nu,s=e.lastIndexOf(Ru);s<0&&(s=0);for(let i=0;i<s;++i)e.charCodeAt(i)>=128&&de("not-basic"),t.push(e.charCodeAt(i));for(let i=s>0?s+1:0;i<n;){const a=o;for(let d=1,f=ue;;f+=ue){i>=n&&de("invalid-input");const m=Gc(e.charCodeAt(i++));m>=ue&&de("invalid-input"),m>ne((Ee-o)/d)&&de("overflow"),o+=m*d;const h=f<=c?At:f>=c+Re?Re:f-c;if(m<h)break;const p=ue-h;d>ne(Ee/p)&&de("overflow"),d*=p}const l=t.length+1;c=Iu(o-a,l,a==0),ne(o/l)>Ee-r&&de("overflow"),r+=ne(o/l),o%=l,t.splice(o++,0,r)}return String.fromCodePoint(...t)},Ou=function(e){const t=[];e=Lu(e);const n=e.length;let o=zu,r=0,c=Nu;for(const a of e)a<128&&t.push(Ft(a));const s=t.length;let i=s;for(s&&t.push(Ru);i<n;){let a=Ee;for(const d of e)d>=o&&d<a&&(a=d);const l=i+1;a-o>ne((Ee-r)/l)&&de("overflow"),r+=(a-o)*l,o=a;for(const d of e)if(d<o&&++r>Ee&&de("overflow"),d===o){let f=r;for(let m=ue;;m+=ue){const h=m<=c?At:m>=c+Re?Re:m-c;if(f<h)break;const p=f-h,x=ue-h;t.push(Ft(Vu(h+p%x,0))),f=ne(p/x)}t.push(Ft(Vu(f,0))),c=Iu(r,l,i===s),r=0,++i}++r,++o}return t.join("")},Pu={version:"2.3.1",ucs2:{decode:Lu,encode:Wc},decode:vu,encode:Ou,toASCII:function(e){return Tu(e,function(t){return Zc.test(t)?"xn--"+Ou(t):t})},toUnicode:function(e){return Tu(e,function(t){return Pc.test(t)?vu(t.slice(4).toLowerCase()):t})}},Xc={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{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"]}}},commonmark:{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"]}}}},Yc=/^(vbscript|javascript|file|data):/,Kc=/^data:image\/(gif|png|jpeg|webp);/;function Jc(e){const t=e.trim().toLowerCase();return Yc.test(t)?Kc.test(t):!0}const Zu=["http:","https:","mailto:"];function Qc(e){const t=ft(e,!0);if(t.hostname&&(!t.protocol||Zu.indexOf(t.protocol)>=0))try{t.hostname=Pu.toASCII(t.hostname)}catch{}return Se(dt(t))}function es(e){const t=ft(e,!0);if(t.hostname&&(!t.protocol||Zu.indexOf(t.protocol)>=0))try{t.hostname=Pu.toUnicode(t.hostname)}catch{}return ke(dt(t),ke.defaultChars+"%")}function K(e,t){if(!(this instanceof K))return new K(e,t);t||bt(e)||(t=e||{},e="default"),this.inline=new ze,this.block=new He,this.core=new _t,this.renderer=new Ce,this.linkify=new G,this.validateLink=Jc,this.normalizeLink=Qc,this.normalizeLinkText=es,this.utils=d0,this.helpers=Oe({},m0),this.options={},this.configure(e),t&&this.set(t)}K.prototype.set=function(e){return Oe(this.options,e),this},K.prototype.configure=function(e){const t=this;if(bt(e)){const n=e;if(e=Xc[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},K.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const o=e.filter(function(r){return n.indexOf(r)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this},K.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const o=e.filter(function(r){return n.indexOf(r)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this},K.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},K.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},K.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},K.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},K.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};let Uu=1;function ts(){function e(r,c){const s=new K({html:!0,typographer:!0});return s.use(Dr),c&&c.forEach(i=>s.use(i)),s.parse(r,"")}function t(r,c){const s=o(r,c)??[];return u.h("article",{class:"sq-article"},n(s))}function n(r){if(!r)return;const c=r.map(s=>{if(typeof s=="string")return s;{const i=n(s.children);return u.h(s.tag,s.attrs,typeof s.tag!="string"?{default:()=>i}:i)}});return c.length>1?c:c[0]}function o(r,c){const s=[],i={children:[]};let a=i;return r.forEach(l=>{var _,E,y,C,k,B,S,R,T,D,g;const{type:d,children:f,content:m,attrs:h,tag:p,hidden:x}=l;switch(d){case"heading_open":case"paragraph_open":case"bullet_list_open":case"ordered_list_open":case"list_item_open":case"table_open":case"thead_open":case"tbody_open":case"tr_open":case"th_open":case"td_open":case"blockquote_open":case"strong_open":case"em_open":case"s_open":case"link_open":{if(x)break;const b={tag:(c==null?void 0:c[p])??p,children:[],attrs:h?Object.fromEntries(h):{}};if(d==="link_open"){const A=l.attrGet("href")??"",w=document.location.origin;A!=null&&A.startsWith("http")&&!A.includes(w)&&(b.attrs.target="_blank",b.attrs.rel="noopener noreferrer",b.attrs.dataOuter="",(_=b.children)==null||_.push({tag:Po}))}if(d==="table_open"){const A={tag:"div",children:[],attrs:{class:"sq-article-table"}};(E=a.children)==null||E.push(A),s.push(a),a=A}(y=a.children)==null||y.push(b),s.push(a),a=b;break}case"heading_close":case"paragraph_close":case"bullet_list_close":case"ordered_list_close":case"list_item_close":case"table_close":case"thead_close":case"tbody_close":case"tr_close":case"th_close":case"td_close":case"blockquote_close":case"strong_close":case"em_close":case"s_close":case"link_close":{if(x)break;a=s.pop();break}case"code_inline":{(C=a.children)==null||C.push({tag:(c==null?void 0:c[p])??p,children:[m],attrs:h?Object.fromEntries(h):{}});break}case"inline":{if(f){const b=o(f,c);(k=a.children)==null||k.push(...b??[])}else(B=a.children)==null||B.push(m);break}case"text":{(S=a.children)==null||S.push(m);break}case"image":{(R=a.children)==null||R.push({tag:(c==null?void 0:c[p])??p,children:[],attrs:h?Object.fromEntries(h):{}});break}case"hr":{(T=a.children)==null||T.push({tag:(c==null?void 0:c[p])??p});break}case"input":{const b=h?Object.fromEntries(h):{},A=b.type??"text",w=`${p}-${A}`,M={tag:(c==null?void 0:c[w])??p,children:[],attrs:b};A==="checkbox"&&(M.attrs.value=`task-list-${Uu}`,Uu++),(D=a.children)==null||D.push(M);break}case"html_inline":{if(m.startsWith("</"))a=s.pop();else{const b=m.replace("<","").replace(">",""),A={tag:(c==null?void 0:c[b])??b,children:[]};(g=a.children)==null||g.push(A),s.push(a),a=A}break}}}),i.children}return{md2tokens:e,tokens2vueh:t}}function us(){function e(t,n=100){let o;return function(...r){o||(o=setTimeout(()=>{t.apply(this,r),o=void 0},n))}}return{throttle:e}}const{md2tokens:ns,tokens2vueh:os}=ts(),ju=u.defineComponent({name:"sq-article",props:{text:{type:String,required:!0},md:{type:Boolean,default:!0},customNodeMap:{type:Object},plugins:{type:Object}},setup(e){const t=u.computed(()=>({hr:he,blur:Hu,img:Xu,"input-checkbox":Mt,...e.customNodeMap}));return()=>{if(!e.md)return u.h("article",{class:"sq-article",innerHTML:e.text});const n=ns(e.text,e.plugins);return os(n,t.value)}}}),rs=["src","alt"],cs=["textContent"],ss=u.defineComponent({name:"sq-avatar",__name:"avatar",props:{img:{},alt:{},randomColor:{type:Boolean,default:!0},round:{type:Boolean,default:!0},size:{default:"md"}},setup(e){const t=e,n=u.ref(!0),o=u.computed(()=>{const i=[];return t.size!=="md"&&i.push(`sq-avatar--${t.size}`),t.round&&i.push("is-round"),i}),r=u.computed(()=>{if(!t.randomColor)return;const{getRandomColor:i}=wr();return{"--avatar-bg-color":i()}}),c=u.computed(()=>t.alt.charAt(0).toUpperCase());function s(){n.value=!1}return(i,a)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["sq-avatar",o.value]),style:u.normalizeStyle(r.value)},[t.img&&n.value?(u.openBlock(),u.createElementBlock("img",{key:0,src:t.img,alt:t.alt,onError:s},null,40,rs)):(u.openBlock(),u.createElementBlock("span",{key:1,textContent:u.toDisplayString(c.value)},null,8,cs))],6))}}),is={class:"sq-backtop"},as=u.defineComponent({name:"sq-backtop",__name:"backtop",props:{progress:{type:Boolean,default:!0},icon:{default:vn},transition:{default:"sq-rotate-in-left"},visibilityHeight:{default:100},target:{default:"#app"},progressProps:{}},setup(e){const{throttle:t}=us(),n=t(a),o=new ResizeObserver(l),r=e,c=u.ref(100),s=u.ref(0),i=u.computed(()=>s.value>r.visibilityHeight);u.onMounted(()=>{var m;l(),n(),window.addEventListener("scroll",n);const f=document.querySelector(r.target)??document.body;o.observe(f),(m=window.visualViewport)==null||m.addEventListener("resize",l)}),u.onBeforeUnmount(()=>{var f;window.removeEventListener("scroll",n),o.disconnect(),(f=window.visualViewport)==null||f.removeEventListener("resize",l)});function a(){s.value=window.scrollY}function l(){const f=(document.scrollingElement??document.body).scrollHeight,m=window.innerHeight;c.value=f-m}function d(){window.scrollTo({top:0,behavior:"smooth"})}return(f,m)=>(u.openBlock(),u.createBlock(u.Transition,{name:r.transition},{default:u.withCtx(()=>{var h,p,x;return[u.withDirectives(u.createElementVNode("div",is,[u.createElementVNode("div",{class:"sq-backtop-wrap",onClick:d},[r.progress?(u.openBlock(),u.createBlock(u.unref(yn),{key:0,variant:"circle",label:!1,value:s.value,max:c.value,type:(h=r.progressProps)==null?void 0:h.type,stroke:(p=r.progressProps)==null?void 0:p.stroke,color:(x=r.progressProps)==null?void 0:x.color},null,8,["value","max","type","stroke","color"])):u.createCommentVNode("",!0),u.renderSlot(f.$slots,"default",{},()=>[(u.openBlock(),u.createBlock(u.resolveDynamicComponent(r.icon)))])])],512),[[u.vShow,i.value]])]}),_:3},8,["name"]))}}),ls=["textContent"],ds=u.defineComponent({name:"sq-badge",__name:"badge",props:{type:{default:"error"},color:{},showZero:{type:Boolean},max:{default:99},count:{default:0},text:{},dot:{type:Boolean}},setup(e){const t=u.useSlots(),n=e,o=u.computed(()=>{const i=[];return n.dot&&i.push("is-dot"),i.push(`is-${n.type}`),i}),r=u.computed(()=>t.default?"sup":"div"),c=u.computed(()=>!n.dot&&n.text||n.showZero?!0:n.count>0),s=u.computed(()=>n.dot?"":n.text?n.text:n.max&&n.count>n.max?`${n.max}+`:`${n.count}`);return(i,a)=>(u.openBlock(),u.createBlock(u.Transition,{name:"sq-zoom"},{default:u.withCtx(()=>[u.unref(t).default||c.value?(u.openBlock(),u.createElementBlock("span",{key:0,class:u.normalizeClass(["sq-badge",o.value]),style:u.normalizeStyle({"--badge-color":n.color})},[u.renderSlot(i.$slots,"default"),(u.openBlock(),u.createBlock(u.resolveDynamicComponent(r.value),{class:"sq-badge-label"},{default:u.withCtx(()=>[u.createVNode(u.Transition,{name:u.unref(t).default?"sq-zoom":""},{default:u.withCtx(()=>[c.value?(u.openBlock(),u.createElementBlock("span",{key:0,class:"sq-badge-label-inner",textContent:u.toDisplayString(s.value)},null,8,ls)):u.createCommentVNode("",!0)]),_:1},8,["name"])]),_:1}))],6)):u.createCommentVNode("",!0)]),_:3}))}}),Hu=u.defineComponent({name:"sq-blur",__name:"blur",setup(e){return(t,n)=>(u.openBlock(),u.createBlock(u.unref(se),{class:"sq-blur"},{default:u.withCtx(()=>[u.renderSlot(t.$slots,"default")]),_:3}))}});function fs(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(St,void 0),r=u.computed(()=>u.unref(o)?void 0:e.text),c=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.size,e.size,(d=u.unref(n))==null?void 0:d.size,"md")}),s=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.type,e.type)}),i=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.round,e.round,(d=u.unref(n))==null?void 0:d.round)}),a=u.computed(()=>{var l,d,f;return t((l=u.unref(n))==null?void 0:l.disabled,(d=u.unref(n))==null?void 0:d.readonly,(f=u.unref(o))==null?void 0:f.disabled,e.disabled)});return{btnTextType:r,btnSize:c,btnType:s,btnRound:i,btnDisabled:a}}function ps(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject($t,void 0),r=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.size,e.size,(d=u.unref(n))==null?void 0:d.size,"md")}),c=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.form,e.form)}),s=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.name,e.name)}),i=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.variant,e.variant)}),a=u.computed(()=>{var l,d,f;return t((l=u.unref(n))==null?void 0:l.disabled,(d=u.unref(n))==null?void 0:d.readonly,(f=u.unref(o))==null?void 0:f.disabled,e.disabled)});return{checkboxSize:r,checkboxForm:c,checkboxName:s,checkboxVariant:i,checkboxDisabled:a,groupContext:o}}function hs(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(Xe,void 0),r=u.computed(()=>{var a;return t(e.size,(a=u.unref(n))==null?void 0:a.size,"md")}),c=u.computed(()=>{var a;return t(e.round,(a=u.unref(n))==null?void 0:a.round)}),s=u.computed(()=>{var a;return t((a=u.unref(n))==null?void 0:a.disabled,e.disabled)}),i=u.computed(()=>{var a;return t((a=u.unref(n))==null?void 0:a.readonly,e.readonly)});return{inputSize:r,inputRound:c,inputDisabled:s,inputReadonly:i,id:o}}function ms(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(Pt,void 0),r=u.computed(()=>{var l,d;return t((l=u.unref(o))==null?void 0:l.size,e.size,(d=u.unref(n))==null?void 0:d.size,"md")}),c=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.form,e.form)}),s=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.name,e.name)}),i=u.computed(()=>{var l;return t((l=u.unref(o))==null?void 0:l.variant,e.variant)}),a=u.computed(()=>{var l,d,f;return t((l=u.unref(n))==null?void 0:l.disabled,(d=u.unref(n))==null?void 0:d.readonly,(f=u.unref(o))==null?void 0:f.disabled,e.disabled)});return{radioSize:r,radioForm:c,radioName:s,radioVariant:i,radioDisabled:a,groupContext:o}}function bs(e){const{getOption:t}=_e(),n=u.inject(Zt,void 0);return{segmentedDisabled:u.computed(()=>{var r;return t((r=u.unref(n))==null?void 0:r.disabled,e.disabled)}),parentContext:n}}function xs(e){const{getOption:t}=_e(),n=u.inject(me,void 0),o=u.inject(Xe,void 0),r=u.computed(()=>{var s;return t(e.size,(s=u.unref(n))==null?void 0:s.size,"md")}),c=u.computed(()=>{var s,i;return t((s=u.unref(n))==null?void 0:s.disabled,(i=u.unref(n))==null?void 0:i.readonly,e.disabled)});return{switchSize:r,switchDisabled:c,id:o}}const gs=["disabled","form","type"],P=u.defineComponent({name:"sq-button",__name:"button",props:{type:{},round:{type:Boolean,default:void 0},text:{type:Boolean},icon:{},loading:{type:Boolean},form:{},bg:{type:Boolean},nativeType:{default:"button"},disabled:{type:Boolean,default:void 0},size:{}},emits:["click"],setup(e,{emit:t}){const n=t,o=e,{btnTextType:r,btnSize:c,btnType:s,btnRound:i,btnDisabled:a}=fs(o),l=u.computed(()=>{const m=[],h=u.unref(c),p=u.unref(s),x=u.unref(i),_=u.unref(r);return h!=="md"&&m.push(`sq-button--${h}`),p&&m.push(`is-${p}`),x&&m.push("is-round"),_&&m.push("is-text"),_&&o.bg&&m.push("has-bg"),m}),d=u.computed(()=>o.loading?Ve:o.icon),f=u.computed(()=>o.loading||u.unref(a));return(m,h)=>(u.openBlock(),u.createElementBlock("button",{class:u.normalizeClass(["sq-button",l.value]),disabled:f.value,form:o.form,type:o.nativeType,onClick:h[0]||(h[0]=p=>n("click",p))},[u.createVNode(u.unref(se),{size:u.unref(c)==="lg"?"md":u.unref(c)},{default:u.withCtx(()=>[d.value?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(d.value),{key:0})):u.createCommentVNode("",!0),u.renderSlot(m.$slots,"default")]),_:3},8,["size"])],10,gs))}}),_s={class:"sq-button-group"},ks=u.defineComponent({name:"sq-button-group",__name:"button-group",props:{size:{},type:{},round:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0}},setup(e){const t=e;return u.provide(St,u.ref({size:u.toRef(t,"size"),type:u.toRef(t,"type"),round:u.toRef(t,"round"),disabled:u.toRef(t,"disabled")})),(n,o)=>(u.openBlock(),u.createElementBlock("div",_s,[u.renderSlot(n.$slots,"default")]))}}),St=Symbol("button-group-context-keys"),ys={class:"sq-card"},Cs={key:0,class:"sq-card-header"},ws=["textContent"],Es={key:1,class:"sq-card-footer"},Ds=u.defineComponent({name:"sq-card",__name:"card",props:{title:{},decorative:{type:Boolean,default:!1}},setup(e){const t=u.useSlots(),n=e;return(o,r)=>(u.openBlock(),u.createElementBlock("section",ys,[n.title||u.unref(t).title?(u.openBlock(),u.createElementBlock("div",Cs,[u.createElementVNode("h2",{class:u.normalizeClass({"has-decorative":n.decorative}),textContent:u.toDisplayString(n.title)},null,10,ws),u.renderSlot(o.$slots,"title")])):u.createCommentVNode("",!0),u.renderSlot(o.$slots,"default"),u.unref(t).footer?(u.openBlock(),u.createElementBlock("div",Es,[u.renderSlot(o.$slots,"footer")])):u.createCommentVNode("",!0)]))}}),As=["autofocus","name","form","value","disabled"],Bs=["textContent"],Mt=u.defineComponent({name:"sq-checkbox",__name:"checkbox",props:u.mergeModels({form:{},name:{},disabled:{type:Boolean,default:void 0},size:{},indeterminate:{type:Boolean},variant:{},autofocus:{type:Boolean},label:{},value:{}},{checked:{type:Boolean,default:!1},checkedModifiers:{}}),emits:u.mergeModels(["change"],["update:checked"]),setup(e,{emit:t}){const n=t,o=e,{checkboxSize:r,checkboxDisabled:c,checkboxForm:s,checkboxName:i,checkboxVariant:a,groupContext:l}=ps(o),d=u.useModel(e,"checked"),f=u.computed(()=>{const h=[],p=u.unref(r),x=u.unref(c),_=u.unref(a);return p!=="md"&&h.push(`sq-selection--${p}`),m.value&&h.push("is-checked"),x&&h.push("is-disabled"),_&&h.push(`is-${_}`),h}),m=u.computed(()=>l?u.unref(l).list.includes(o.value):d.value);return u.watch(m,h=>{if(d.value!==h){d.value=h;return}}),u.watch(d,h=>{m.value!==h&&l&&l.value.toggleItem(o.value)}),u.onMounted(()=>{d.value=m.value}),(h,p)=>(u.openBlock(),u.createElementBlock("label",{class:u.normalizeClass(["sq-selection sq-checkbox",f.value])},[u.withDirectives(u.createElementVNode("input",{type:"checkbox",autofocus:o.autofocus,name:u.unref(i),form:u.unref(s),value:o.value,disabled:u.unref(c),"onUpdate:modelValue":p[0]||(p[0]=x=>d.value=x),onChange:p[1]||(p[1]=x=>n("change",d.value))},null,40,As),[[u.vModelCheckbox,d.value]]),u.unref(a)!=="solid"?(u.openBlock(),u.createElementBlock("span",{key:0,class:u.normalizeClass(["sq-checkbox-box",{"is-indeterminate":o.indeterminate&&!m.value}])},[m.value?(u.openBlock(),u.createBlock(u.unref(Un),{key:0,class:"sq-checkbox-inner"})):u.createCommentVNode("",!0)],2)):u.createCommentVNode("",!0),o.label?(u.openBlock(),u.createElementBlock("span",{key:1,class:"sq-selection-label",textContent:u.toDisplayString(o.label)},null,8,Bs)):u.createCommentVNode("",!0)],2))}}),Fs={class:"sq-checkbox-group sq-selection-group"},Wu=u.defineComponent({name:"sq-checkbox-group",__name:"checkbox-group",props:{items:{default:()=>[]},value:{},form:{},name:{},disabled:{type:Boolean,default:void 0},size:{},variant:{}},emits:["change","update:value"],setup(e,{emit:t}){const{nextId:n}=Ie(),o=t,r=e,c=u.ref(r.value??[]),s=u.computed(()=>r.name??`sq-checkbox-${n()}`);u.provide($t,u.ref({form:u.toRef(r,"form"),name:s,disabled:u.toRef(r,"disabled"),size:u.toRef(r,"size"),variant:u.toRef(r,"variant"),list:c,toggleItem:i})),u.watch(()=>r.value,a=>{const l=a||[],d=[...new Set([...l,c.value])];d.length===l.length&&d.length===c.value.length||(c.value=l)});function i(a){c.value.includes(a)?c.value=c.value.filter(l=>l!==a):c.value.push(a),o("change",u.toRaw(c.value)),o("update:value",u.toRaw(c.value))}return(a,l)=>(u.openBlock(),u.createElementBlock("div",Fs,[u.renderSlot(a.$slots,"default",{},()=>[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(r.items,(d,f)=>(u.openBlock(),u.createBlock(u.unref(Mt),{key:f,label:d.toString(),value:d},null,8,["label","value"]))),128))])]))}}),$t=Symbol("checkbox-group-context-keys"),Gu=u.defineComponent({name:"sq-mask",inheritAttrs:!1,__name:"mask",props:u.mergeModels({keyboard:{type:Boolean,default:!0},maskCloseable:{type:Boolean},onClose:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(e){const{nextZIndex:t}=lt();let n;const o=e,r=u.ref(0),c=u.ref(!1),s=u.useModel(e,"visible");c.value=s.value,u.watch(s,d=>{const f=document.scrollingElement;d?(n=f.style.overflow,f.style.overflow="hidden",r.value=t(),c.value=!0,document.addEventListener("keydown",i)):(f.style.overflow=n,document.removeEventListener("keydown",i))}),u.onBeforeUnmount(()=>{document.removeEventListener("keydown",i)});function i(d){d.key==="Escape"&&o.keyboard&&l()}function a(){o.maskCloseable&&l()}function l(){if(typeof o.onClose!="function"){s.value=!1;return}const d=o.onClose();d instanceof Promise?d.then(f=>{f&&(s.value=!1)}).catch(()=>{}):d&&(s.value=!1)}return(d,f)=>(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[u.createVNode(u.Transition,{name:"sq-fade"},{default:u.withCtx(()=>[c.value?u.withDirectives((u.openBlock(),u.createElementBlock("div",u.mergeProps({key:0,class:"sq-mask",style:{zIndex:r.value}},d.$attrs,{onClick:a}),[u.renderSlot(d.$slots,"default")],16)),[[u.vShow,s.value]]):u.createCommentVNode("",!0)]),_:3})]))}}),Ss={key:0,class:"sq-dialog-header"},Ms=["textContent"],$s={class:"sq-dialog-body"},qs={key:1,class:"sq-dialog-footer"},Ns=u.defineComponent({name:"sq-dialog",inheritAttrs:!1,__name:"dialog",props:u.mergeModels({type:{},title:{},okText:{default:"确认"},cancelText:{default:"取消"},footer:{type:Boolean,default:!0},closeable:{type:Boolean},onOk:{},keyboard:{type:Boolean,default:void 0},maskCloseable:{type:Boolean,default:void 0},onClose:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(e){const t=u.useSlots(),n=e,o=u.ref(!1),r=u.ref(!1),c=u.useModel(e,"visible"),s=u.computed(()=>!!n.title||!!t.header),i=u.computed(()=>{const m=[];return n.type&&m.push(`is-${n.type}`),s.value&&m.push("has-header"),m}),a=u.computed(()=>n.type?at[n.type]:void 0);function l(m){if(o.value)return!1;if(typeof m!="function")return!0;const h=m();return h instanceof Promise?(o.value=!0,h.finally(()=>{o.value=!1})):h}async function d(){if(o.value)return;r.value=!1,await l(n.onClose)&&(c.value=!1)}async function f(){r.value=!0,await l(n.onOk)&&(c.value=!1)}return(m,h)=>(u.openBlock(),u.createBlock(u.unref(Gu),{visible:c.value,"onUpdate:visible":h[0]||(h[0]=p=>c.value=p),onClose:h[1]||(h[1]=()=>l(n.onClose))},{default:u.withCtx(()=>[u.createElementVNode("div",u.mergeProps({class:"sq-dialog"},m.$attrs,{class:i.value}),[s.value?(u.openBlock(),u.createElementBlock("div",Ss,[a.value?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(a.value),{key:0,class:"sq-dialog-header-icon"})):u.createCommentVNode("",!0),u.renderSlot(m.$slots,"header",{},()=>[u.createElementVNode("span",{class:"sq-dialog-header-title",textContent:u.toDisplayString(n.title)},null,8,Ms)]),u.createVNode(u.unref(it),{class:"sq-dialog-close",onClick:d})])):u.createCommentVNode("",!0),u.createElementVNode("div",$s,[u.renderSlot(m.$slots,"default")]),n.footer?(u.openBlock(),u.createElementBlock("div",qs,[u.renderSlot(m.$slots,"footer",{},()=>[u.createVNode(u.unref(P),{text:"",bg:"",disabled:o.value,onClick:d},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(n.cancelText),1)]),_:1},8,["disabled"]),u.createVNode(u.unref(P),{type:n.type??"primary",disabled:o.value,loading:o.value&&r.value,onClick:f},{default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(n.okText),1)]),_:1},8,["type","disabled","loading"])])])):u.createCommentVNode("",!0)],16)]),_:3},8,["visible"]))}}),he=u.defineComponent({name:"sq-divider",__name:"divider",props:{direction:{default:"horizontal"},variant:{default:"solid"},orientation:{default:"left"},ellipsis:{type:[Boolean,Number]},size:{}},setup(e){const t=u.useSlots(),n=e,o=u.computed(()=>{const r=[];return["none","solid","dotted","dashed"].includes(n.variant)&&r.push("is-thin"),t.default&&n.direction!=="vertical"&&r.push(`text-${n.orientation}`),r.push(`sq-divider--${n.direction}`),r});return(r,c)=>(u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["sq-divider",o.value]),style:u.normalizeStyle({"--divider-line-type":n.variant})},[u.unref(t).default&&n.direction!=="vertical"?(u.openBlock(),u.createBlock(u.unref(se),{key:0,ellipsis:n.ellipsis,size:n.size},{default:u.withCtx(()=>[u.renderSlot(r.$slots,"default")]),_:3},8,["ellipsis","size"])):u.createCommentVNode("",!0)],6))}}),zs=u.defineComponent({name:"sq-editor-bold",__name:"editor-bold",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{expose:t,emit:n}){const o=n,r=e;function c(){if(r.disabled)return;const s=[...r.rows],i=s[r.selectedRow],a=i.substring(0,r.selectInfo.startOfRow),l=i.substring(r.selectInfo.endOfRow);let d=r.selectedVal??"";if(d.match(/\*\*\*.*?\*\*\*/)){d=d.replaceAll("***","*"),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-4);return}if(d.match(/\*\*.*?\*\*/)){d=d.replaceAll("**",""),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-4);return}d=`**${d}**`,s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,4)}return t({setBold:c}),(s,i)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"加粗 ( Ctrl + B )",disabled:r.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Tn),disabled:r.disabled,onClick:c},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Rs=u.defineComponent({name:"sq-editor-italic",__name:"editor-italic",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{expose:t,emit:n}){const o=n,r=e;function c(){if(r.disabled)return;const s=[...r.rows],i=s[r.selectedRow],a=i.substring(0,r.selectInfo.startOfRow),l=i.substring(r.selectInfo.endOfRow);let d=r.selectedVal??"";if(d.match(/\*\*\*.*?\*\*\*/)){d=d.replaceAll("***","**"),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-2);return}const m=d.match(/\*\*.*?\*\*/),p=((m==null?void 0:m[0])??"").replaceAll("**","").match(/\*.*?\*/);if(m&&!p){d=`*${d}*`,s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,2);return}else if(p){d=d.replaceAll("**","[B]").replaceAll("*","").replaceAll("[B]","**"),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-2);return}if(d.match(/\*.*?\*/)){d=d.replaceAll("*",""),s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,-2);return}d=`*${d}*`,s[r.selectedRow]=`${a}${d}${l}`,o("updateText",s,0,2)}return t({setItalic:c}),(s,i)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"斜体 ( Ctrl + I )",disabled:r.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Vo),disabled:r.disabled,onClick:c},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Ts=u.defineComponent({name:"sq-editor-underline",__name:"editor-underline",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{expose:t,emit:n}){const o=n,r=e;function c(){var p;if(r.disabled)return;const s=[...r.rows],i=s[r.selectedRow],a=i.substring(0,r.selectInfo.startOfRow),l=i.substring(r.selectInfo.endOfRow),d=/<u\b.*?>/;let f=r.selectedVal??"";const m=((p=f.match(d))==null?void 0:p[0])??"";if(f.match(/<u\b.*?>.*?<\/u>/)){f=f.replace(m,"").replace("</u>","");const x=m.length+4;s[r.selectedRow]=`${a}${f}${l}`,o("updateText",s,0,-x);return}f=`<u>${f}</u>`,s[r.selectedRow]=`${a}${f}${l}`,o("updateText",s,0,7)}return t({setUnderline:c}),(s,i)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"下划线 ( Ctrl + U )",disabled:r.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(sr),disabled:r.disabled,onClick:c},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Ls=u.defineComponent({name:"sq-editor-strikethrough",__name:"editor-strikethrough",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){if(o.disabled)return;const c=[...o.rows],s=c[o.selectedRow],i=s.substring(0,o.selectInfo.startOfRow),a=s.substring(o.selectInfo.endOfRow);let l=o.selectedVal??"";if(l.match(/\~\~.*?\~\~/)){l=l.replaceAll("~~",""),c[o.selectedRow]=`${i}${l}${a}`,n("updateText",c,0,-4);return}l=`~~${l}~~`,c[o.selectedRow]=`${i}${l}${a}`,n("updateText",c,0,4)}return(c,s)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"删除线",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(nr),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Vs=u.defineComponent({name:"sq-editor-blur",__name:"editor-blur",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){var h;if(o.disabled)return;const c=[...o.rows],s=c[o.selectedRow],i=s.substring(0,o.selectInfo.startOfRow),a=s.substring(o.selectInfo.endOfRow),l=/<blur\b.*?>/;let d=o.selectedVal??"";const f=((h=d.match(l))==null?void 0:h[0])??"";if(d.match(/<blur\b.*?>.*?<\/blur>/)){d=d.replace(f,"").replace("</blur>","");const p=f.length+7;c[o.selectedRow]=`${i}${d}${a}`,n("updateText",c,0,-p);return}d=`<blur>${d}</blur>`,c[o.selectedRow]=`${i}${d}${a}`,n("updateText",c,0,13)}return(c,s)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"模糊块",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Gt),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Is=u.defineComponent({name:"sq-editor-ul",__name:"editor-ul",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){const a=o.selectedRow,l=[...o.rows],d=l[a];if(c(d)){l[a]=d.replace("- ",""),n("updateText",l,-2,-2);return}if(s(d)){const f=i(d),m=2-f.length;l[a]=d.replace(f,"- "),n("updateText",l,m,m);return}l[a]=`- ${d}`,n("updateText",l,2,2)}function c(a){return a.replace(" ","").startsWith("- ")}function s(a){return/^\d+\.\s+/.test(a.replace(" ",""))}function i(a){return a.replace(" ","").match(/^\d+\.\s/)[0]}return(a,l)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"无序列表",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Yo),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),vs=u.defineComponent({name:"sq-editor-ol",__name:"editor-ol",props:{disabled:{type:Boolean},rows:{default:()=>[]},selectedVal:{},selectedRow:{},selectInfo:{default:()=>({})}},emits:["updateText"],setup(e,{emit:t}){const n=t,o=e;function r(){const a=o.selectedRow,l=[...o.rows],d=l[a],f=a>0?l[a-1]:"";let m=1;if(c(d)){f&&s(f)&&(m=parseInt(i(f))+1);const x=`${m}. `,_=x.length-2;l[a]=d.replace("- ",x),n("updateText",l,_,_);return}if(s(d)){const x=i(d),_=-x.length;l[a]=d.replace(x,""),n("updateText",l,_,_);return}f&&s(f)&&(m=parseInt(i(f))+1);const h=`${m}. `,p=h.length;l[a]=`${h}${d}`,n("updateText",l,p,p)}function c(a){return a.replace(" ","").startsWith("- ")}function s(a){return/^\d+\.\s+/.test(a.replace(" ",""))}function i(a){return a.replace(" ","").match(/^\d+\.\s/)[0]}return(a,l)=>(u.openBlock(),u.createBlock(u.unref(H),{tip:"有序列表",disabled:o.disabled},{default:u.withCtx(()=>[u.createVNode(u.unref(P),{text:"",icon:u.unref(Ho),disabled:o.disabled,onClick:r},null,8,["icon","disabled"])]),_:1},8,["disabled"]))}}),Os={class:"sq-editor-body"},Ps={class:"sq-editor-toolbar"},Zs={class:"sq-editor-control"},Us=u.defineComponent({name:"sq-editor",__name:"editor",props:u.mergeModels({round:{type:Boolean},disabled:{type:Boolean},placeholder:{},maxlength:{},minlength:{},size:{},beforePreview:{}},{value:{default:""},valueModifiers:{}}),emits:["update:value"],setup(e){const t=[{text:"编辑",value:"edit"},{text:"预览",value:"preview"}];let n;const o=e,r=u.ref("edit"),c=u.ref([]),s=u.ref(!1),i=u.ref(""),a=u.ref(),l=u.ref({}),d=u.shallowRef(null),f=u.shallowRef(null),m=u.shallowRef(null),h=u.shallowRef(null),p=u.useModel(e,"value"),x=u.computed(()=>{const A=[];return o.size!=="md"&&A.push(`sq-editor--${o.size}`),o.round&&A.push("is-round"),A}),_=u.computed(()=>i.value.length&&!i.value.includes(`
50
50
  `)&&i.value!==" "&&!o.disabled),E=u.computed(()=>a.value!==void 0&&!i.value.length&&!o.disabled),y=u.computed(()=>typeof o.beforePreview=="function"?o.beforePreview(p.value):p.value);u.onMounted(()=>{document.addEventListener("selectionchange",B),document.addEventListener("click",S)}),u.onBeforeUnmount(()=>{document.removeEventListener("selectionchange",B),document.removeEventListener("click",S)});function C(A){A==="edit"&&u.nextTick(()=>{var w;(w=d.value)==null||w.focus()})}function k(A){var L,V,z;const w=c.value[a.value],M=(w==null?void 0:w.replace(" ",""))??"";if(A.key==="Tab"){A.preventDefault();const $=w.substring(0,l.value.startOfRow),F=w.substring(l.value.endOfRow);c.value[a.value]=`${$} ${F}`,b(c.value,1,1);return}if(A.ctrlKey)switch(A.key.toUpperCase()){case"B":(L=f.value)==null||L.setBold();return;case"I":(V=m.value)==null||V.setItalic();return;case"U":A.preventDefault(),(z=h.value)==null||z.setUnderline();return}if(A.key==="Enter"){if(D(w)){A.preventDefault();const $=w.substring(0,w.indexOf("- "));if(M!=="- "){const N=3+$.length;c.value[a.value]=`${w}
51
51
  ${$}- `,R(A.target),b(c.value,N,N);return}const F=2+$.length;c.value[a.value]=w.substring(F),b(c.value,-F,-F);return}if(g(w)){A.preventDefault();const $=M.match(/^\d+\.\s/)[0],N=`${parseInt($)+1}. `,v=w.substring(0,w.indexOf($));if(M!==$){const st=N.length+v.length+1;c.value[a.value]=`${w}
52
52
  ${v}${N}`,R(A.target),b(c.value,st,st);return}const j=$.length+v.length;c.value[a.value]=w.substring(j),b(c.value,-j,-j);return}}}function B(A){var M;const w=window.getSelection();(w==null?void 0:w.focusNode)===((M=d.value)==null?void 0:M.$el)&&(n=A.target,!((n==null?void 0:n.selectionStart)===void 0||(n==null?void 0:n.selectionEnd)===void 0)&&(l.value.start=(n==null?void 0:n.selectionStart)??0,l.value.end=(n==null?void 0:n.selectionEnd)??0,i.value=p.value.substring(l.value.start,l.value.end),T()))}function S(){i.value="",a.value=void 0}function R(A){const w=A.selectionStart,L=p.value.substring(0,w??0).split(`
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@squirrel-cloud/ui-vue",
3
3
  "description": "松鼠的坚果屋前端VUE框架",
4
4
  "license": "GPL-3.0",
5
- "version": "0.4.4",
5
+ "version": "0.4.5",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "files": [