Files
Snap.Hutao.Docs/assets/component-ab02f52e.js

54 lines
92 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Jt=Object.defineProperty;var en=(l,t,n)=>t in l?Jt(l,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[t]=n;var gt=(l,t,n)=>(en(l,typeof t!="symbol"?t+"":t,n),n);import{c as Oe,r as M,h as Q,o as Ye,w as ge,E as ot,u,X as m,Y as y,Z as z,a3 as D,a4 as te,a5 as se,a6 as U,B as tn,a7 as ft,b as nn,a0 as X,a8 as ee,a9 as Ve,aa as ln,t as rn,ab as mt,$ as xe,ac as $e,ad as an,j as H,m as ct,s as sn,C as on,F as cn}from"./framework-caa722f8.js";import{u as Se,a as un,b as pn,c as hn}from"./app-07f63dc9.js";var Ue=new Map;function dn(l){var t=Ue.get(l);t&&t.destroy()}function gn(l){var t=Ue.get(l);t&&t.update()}var je=null;typeof window>"u"?((je=function(l){return l}).destroy=function(l){return l},je.update=function(l){return l}):((je=function(l,t){return l&&Array.prototype.forEach.call(l.length?l:[l],function(n){return function(e){if(e&&e.nodeName&&e.nodeName==="TEXTAREA"&&!Ue.has(e)){var i,r=null,a=window.getComputedStyle(e),s=(i=e.value,function(){d({testForHeightReduction:i===""||!e.value.startsWith(i),restoreTextAlign:null}),i=e.value}),c=function(h){e.removeEventListener("autosize:destroy",c),e.removeEventListener("autosize:update",o),e.removeEventListener("input",s),window.removeEventListener("resize",o),Object.keys(h).forEach(function(g){return e.style[g]=h[g]}),Ue.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,textAlign:e.style.textAlign,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",c),e.addEventListener("autosize:update",o),e.addEventListener("input",s),window.addEventListener("resize",o),e.style.overflowX="hidden",e.style.wordWrap="break-word",Ue.set(e,{destroy:c,update:o}),o()}function d(h){var g,p,A=h.restoreTextAlign,v=A===void 0?null:A,f=h.testForHeightReduction,S=f===void 0||f,R=a.overflowY;if(e.scrollHeight!==0&&(a.resize==="vertical"?e.style.resize="none":a.resize==="both"&&(e.style.resize="horizontal"),S&&(g=function(C){for(var F=[];C&&C.parentNode&&C.parentNode instanceof Element;)C.parentNode.scrollTop&&F.push([C.parentNode,C.parentNode.scrollTop]),C=C.parentNode;return function(){return F.forEach(function(P){var N=P[0],ie=P[1];N.style.scrollBehavior="auto",N.scrollTop=ie,N.style.scrollBehavior=null})}}(e),e.style.height=""),p=a.boxSizing==="content-box"?e.scrollHeight-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):e.scrollHeight+parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),a.maxHeight!=="none"&&p>parseFloat(a.maxHeight)?(a.overflowY==="hidden"&&(e.style.overflow="scroll"),p=parseFloat(a.maxHeight)):a.overflowY!=="hidden"&&(e.style.overflow="hidden"),e.style.height=p+"px",v&&(e.style.textAlign=v),g&&g(),r!==p&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),r=p),R!==a.overflow&&!v)){var I=a.textAlign;a.overflow==="hidden"&&(e.style.textAlign=I==="start"?"end":"start"),d({restoreTextAlign:I,testForHeightReduction:!0})}}function o(){d({testForHeightReduction:!0,restoreTextAlign:null})}}(n)}),l}).destroy=function(l){return l&&Array.prototype.forEach.call(l.length?l:[l],dn),l},je.update=function(l){return l&&Array.prototype.forEach.call(l.length?l:[l],gn),l});var vt=je;function Ot(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Ce=Ot();function fn(l){Ce=l}const Bt=/[&<>"']/,mn=new RegExp(Bt.source,"g"),Pt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,vn=new RegExp(Pt.source,"g"),kn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},kt=l=>kn[l];function Y(l,t){if(t){if(Bt.test(l))return l.replace(mn,kt)}else if(Pt.test(l))return l.replace(vn,kt);return l}const wn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Ht(l){return l.replace(wn,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const yn=/(^|[^\[])\^/g;function q(l,t){l=typeof l=="string"?l:l.source,t=t||"";const n={replace:(e,i)=>(i=i.source||i,i=i.replace(yn,"$1"),l=l.replace(e,i),n),getRegex:()=>new RegExp(l,t)};return n}const bn=/[^\w:]/g,xn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function wt(l,t,n){if(l){let e;try{e=decodeURIComponent(Ht(n)).replace(bn,"").toLowerCase()}catch{return null}if(e.indexOf("javascript:")===0||e.indexOf("vbscript:")===0||e.indexOf("data:")===0)return null}t&&!xn.test(n)&&(n=zn(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Fe={},$n=/^[^:]+:\/*[^/]*$/,Cn=/^([^:]+:)[\s\S]*$/,_n=/^([^:]+:\/*[^/]*)[\s\S]*$/;function zn(l,t){Fe[" "+l]||($n.test(l)?Fe[" "+l]=l+"/":Fe[" "+l]=qe(l,"/",!0)),l=Fe[" "+l];const n=l.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:l.replace(Cn,"$1")+t:t.charAt(0)==="/"?n?t:l.replace(_n,"$1")+t:l+t}const Ke={exec:function(){}};function yt(l,t){const n=l.replace(/\|/g,(r,a,s)=>{let c=!1,d=a;for(;--d>=0&&s[d]==="\\";)c=!c;return c?"|":" |"}),e=n.split(/ \|/);let i=0;if(e[0].trim()||e.shift(),e.length>0&&!e[e.length-1].trim()&&e.pop(),e.length>t)e.splice(t);else for(;e.length<t;)e.push("");for(;i<e.length;i++)e[i]=e[i].trim().replace(/\\\|/g,"|");return e}function qe(l,t,n){const e=l.length;if(e===0)return"";let i=0;for(;i<e;){const r=l.charAt(e-i-1);if(r===t&&!n)i++;else if(r!==t&&n)i++;else break}return l.slice(0,e-i)}function Rn(l,t){if(l.indexOf(t[1])===-1)return-1;const n=l.length;let e=0,i=0;for(;i<n;i++)if(l[i]==="\\")i++;else if(l[i]===t[0])e++;else if(l[i]===t[1]&&(e--,e<0))return i;return-1}function Sn(l){l&&l.sanitize&&!l.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function bt(l,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=l),t>>=1,l+=l;return n+l}function xt(l,t,n,e){const i=t.href,r=t.title?Y(t.title):null,a=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){e.state.inLink=!0;const s={type:"link",raw:n,href:i,title:r,text:a,tokens:e.inlineTokens(a)};return e.state.inLink=!1,s}return{type:"image",raw:n,href:i,title:r,text:Y(a)}}function Ln(l,t){const n=l.match(/^(\s+)(?:```)/);if(n===null)return t;const e=n[1];return t.split(`
`).map(i=>{const r=i.match(/^\s+/);if(r===null)return i;const[a]=r;return a.length>=e.length?i.slice(e.length):i}).join(`
`)}class ut{constructor(t){this.options=t||Ce}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const e=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?e:qe(e,`
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const e=n[0],i=Ln(e,n[3]||"");return{type:"code",raw:e,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let e=n[2].trim();if(/#$/.test(e)){const i=qe(e,"#");(this.options.pedantic||!i||/ $/.test(i))&&(e=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const e=n[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const r=this.lexer.blockTokens(e);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:r,text:e}}}list(t){let n=this.rules.block.list.exec(t);if(n){let e,i,r,a,s,c,d,o,h,g,p,A,v=n[1].trim();const f=v.length>1,S={type:"list",raw:"",ordered:f,start:f?+v.slice(0,-1):"",loose:!1,items:[]};v=f?`\\d{1,9}\\${v.slice(-1)}`:`\\${v}`,this.options.pedantic&&(v=f?v:"[*+-]");const R=new RegExp(`^( {0,3}${v})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(A=!1,!(!(n=R.exec(t))||this.rules.block.hr.test(t)));){if(e=n[0],t=t.substring(e.length),o=n[2].split(`
`,1)[0].replace(/^\t+/,C=>" ".repeat(3*C.length)),h=t.split(`
`,1)[0],this.options.pedantic?(a=2,p=o.trimLeft()):(a=n[2].search(/[^ ]/),a=a>4?1:a,p=o.slice(a),a+=n[1].length),c=!1,!o&&/^ *$/.test(h)&&(e+=h+`
`,t=t.substring(h.length+1),A=!0),!A){const C=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),F=new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),P=new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),N=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;t&&(g=t.split(`
`,1)[0],h=g,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(P.test(h)||N.test(h)||C.test(h)||F.test(t)));){if(h.search(/[^ ]/)>=a||!h.trim())p+=`
`+h.slice(a);else{if(c||o.search(/[^ ]/)>=4||P.test(o)||N.test(o)||F.test(o))break;p+=`
`+h}!c&&!h.trim()&&(c=!0),e+=g+`
`,t=t.substring(g.length+1),o=h.slice(a)}}S.loose||(d?S.loose=!0:/\n *\n *$/.test(e)&&(d=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(p),i&&(r=i[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),S.items.push({type:"list_item",raw:e,task:!!i,checked:r,loose:!1,text:p}),S.raw+=e}S.items[S.items.length-1].raw=e.trimRight(),S.items[S.items.length-1].text=p.trimRight(),S.raw=S.raw.trimRight();const I=S.items.length;for(s=0;s<I;s++)if(this.lexer.state.top=!1,S.items[s].tokens=this.lexer.blockTokens(S.items[s].text,[]),!S.loose){const C=S.items[s].tokens.filter(P=>P.type==="space"),F=C.length>0&&C.some(P=>/\n.*\n/.test(P.raw));S.loose=F}if(S.loose)for(s=0;s<I;s++)S.items[s].loose=!0;return S}}html(t){const n=this.rules.block.html.exec(t);if(n){const e={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(n[0]):Y(n[0]);e.type="paragraph",e.text=i,e.tokens=this.lexer.inline(i)}return e}}def(t){const n=this.rules.block.def.exec(t);if(n){const e=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",r=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:e,raw:n[0],href:i,title:r}}}table(t){const n=this.rules.block.table.exec(t);if(n){const e={type:"table",header:yt(n[1]).map(i=>({text:i})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(e.header.length===e.align.length){e.raw=n[0];let i=e.align.length,r,a,s,c;for(r=0;r<i;r++)/^ *-+: *$/.test(e.align[r])?e.align[r]="right":/^ *:-+: *$/.test(e.align[r])?e.align[r]="center":/^ *:-+ *$/.test(e.align[r])?e.align[r]="left":e.align[r]=null;for(i=e.rows.length,r=0;r<i;r++)e.rows[r]=yt(e.rows[r],e.header.length).map(d=>({text:d}));for(i=e.header.length,a=0;a<i;a++)e.header[a].tokens=this.lexer.inline(e.header[a].text);for(i=e.rows.length,a=0;a<i;a++)for(c=e.rows[a],s=0;s<c.length;s++)c[s].tokens=this.lexer.inline(c[s].text);return e}}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const e=n[1].charAt(n[1].length-1)===`
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:e,tokens:this.lexer.inline(e)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:Y(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Y(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const e=n[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const a=qe(e.slice(0,-1),"\\");if((e.length-a.length)%2===0)return}else{const a=Rn(n[2],"()");if(a>-1){const c=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,c).trim(),n[3]=""}}let i=n[2],r="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);a&&(i=a[1],r=a[3])}else r=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(e)?i=i.slice(1):i=i.slice(1,-1)),xt(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:r&&r.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let e;if((e=this.rules.inline.reflink.exec(t))||(e=this.rules.inline.nolink.exec(t))){let i=(e[2]||e[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){const r=e[0].charAt(0);return{type:"text",raw:r,text:r}}return xt(e,i,e[0],this.lexer)}}emStrong(t,n,e=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&e.match(/[\p{L}\p{N}]/u))return;const r=i[1]||i[2]||"";if(!r||r&&(e===""||this.rules.inline.punctuation.exec(e))){const a=i[0].length-1;let s,c,d=a,o=0;const h=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,n=n.slice(-1*t.length+a);(i=h.exec(n))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(c=s.length,i[3]||i[4]){d+=c;continue}else if((i[5]||i[6])&&a%3&&!((a+c)%3)){o+=c;continue}if(d-=c,d>0)continue;c=Math.min(c,c+d+o);const g=t.slice(0,a+i.index+(i[0].length-s.length)+c);if(Math.min(a,c)%2){const A=g.slice(1,-1);return{type:"em",raw:g,text:A,tokens:this.lexer.inlineTokens(A)}}const p=g.slice(2,-2);return{type:"strong",raw:g,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let e=n[2].replace(/\n/g," ");const i=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return i&&r&&(e=e.substring(1,e.length-1)),e=Y(e,!0),{type:"codespan",raw:n[0],text:e}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const e=this.rules.inline.autolink.exec(t);if(e){let i,r;return e[2]==="@"?(i=Y(this.options.mangle?n(e[1]):e[1]),r="mailto:"+i):(i=Y(e[1]),r=i),{type:"link",raw:e[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}url(t,n){let e;if(e=this.rules.inline.url.exec(t)){let i,r;if(e[2]==="@")i=Y(this.options.mangle?n(e[0]):e[0]),r="mailto:"+i;else{let a;do a=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])[0];while(a!==e[0]);i=Y(e[0]),e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(t,n){const e=this.rules.inline.text.exec(t);if(e){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):Y(e[0]):e[0]:i=Y(this.options.smartypants?n(e[0]):e[0]),{type:"text",raw:e[0],text:i}}}}const $={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Ke,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};$._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;$._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;$.def=q($.def).replace("label",$._label).replace("title",$._title).getRegex();$.bullet=/(?:[*+-]|\d{1,9}[.)])/;$.listItemStart=q(/^( *)(bull) */).replace("bull",$.bullet).getRegex();$.list=q($.list).replace(/bull/g,$.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+$.def.source+")").getRegex();$._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";$._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;$.html=q($.html,"i").replace("comment",$._comment).replace("tag",$._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();$.paragraph=q($._paragraph).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex();$.blockquote=q($.blockquote).replace("paragraph",$.paragraph).getRegex();$.normal={...$};$.gfm={...$.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};$.gfm.table=q($.gfm.table).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex();$.gfm.paragraph=q($._paragraph).replace("hr",$.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",$.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$._tag).getRegex();$.pedantic={...$.normal,html:q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ke,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q($.normal._paragraph).replace("hr",$.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",$.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const w={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ke,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ke,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};w._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";w.punctuation=q(w.punctuation).replace(/punctuation/g,w._punctuation).getRegex();w.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;w.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;w._comment=q($._comment).replace("(?:-->|$)","-->").getRegex();w.emStrong.lDelim=q(w.emStrong.lDelim).replace(/punct/g,w._punctuation).getRegex();w.emStrong.rDelimAst=q(w.emStrong.rDelimAst,"g").replace(/punct/g,w._punctuation).getRegex();w.emStrong.rDelimUnd=q(w.emStrong.rDelimUnd,"g").replace(/punct/g,w._punctuation).getRegex();w._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;w._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;w._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;w.autolink=q(w.autolink).replace("scheme",w._scheme).replace("email",w._email).getRegex();w._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;w.tag=q(w.tag).replace("comment",w._comment).replace("attribute",w._attribute).getRegex();w._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;w._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;w._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;w.link=q(w.link).replace("label",w._label).replace("href",w._href).replace("title",w._title).getRegex();w.reflink=q(w.reflink).replace("label",w._label).replace("ref",$._label).getRegex();w.nolink=q(w.nolink).replace("ref",$._label).getRegex();w.reflinkSearch=q(w.reflinkSearch,"g").replace("reflink",w.reflink).replace("nolink",w.nolink).getRegex();w.normal={...w};w.pedantic={...w.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:q(/^!?\[(label)\]\((.*?)\)/).replace("label",w._label).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w._label).getRegex()};w.gfm={...w.normal,escape:q(w.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};w.gfm.url=q(w.gfm.url,"i").replace("email",w.gfm._extended_email).getRegex();w.breaks={...w.gfm,br:q(w.br).replace("{2,}","*").getRegex(),text:q(w.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function In(l){return l.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function $t(l){let t="",n,e;const i=l.length;for(n=0;n<i;n++)e=l.charCodeAt(n),Math.random()>.5&&(e="x"+e.toString(16)),t+="&#"+e+";";return t}class fe{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ce,this.options.tokenizer=this.options.tokenizer||new ut,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:$.normal,inline:w.normal};this.options.pedantic?(n.block=$.pedantic,n.inline=w.pedantic):this.options.gfm&&(n.block=$.gfm,this.options.breaks?n.inline=w.breaks:n.inline=w.gfm),this.tokenizer.rules=n}static get rules(){return{block:$,inline:w}}static lex(t,n){return new fe(n).lex(t)}static lexInline(t,n){return new fe(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(s,c,d)=>c+" ".repeat(d.length));let e,i,r,a;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(e=s.call({lexer:this},t,n))?(t=t.substring(e.raw.length),n.push(e),!0):!1))){if(e=this.tokenizer.space(t)){t=t.substring(e.raw.length),e.raw.length===1&&n.length>0?n[n.length-1].raw+=`
`:n.push(e);continue}if(e=this.tokenizer.code(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+e.raw,i.text+=`
`+e.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(e);continue}if(e=this.tokenizer.fences(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.heading(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.hr(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.blockquote(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.list(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.html(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.def(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+e.raw,i.text+=`
`+e.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[e.tag]||(this.tokens.links[e.tag]={href:e.href,title:e.title});continue}if(e=this.tokenizer.table(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.lheading(t)){t=t.substring(e.raw.length),n.push(e);continue}if(r=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const c=t.slice(1);let d;this.options.extensions.startBlock.forEach(function(o){d=o.call({lexer:this},c),typeof d=="number"&&d>=0&&(s=Math.min(s,d))}),s<1/0&&s>=0&&(r=t.substring(0,s+1))}if(this.state.top&&(e=this.tokenizer.paragraph(r))){i=n[n.length-1],a&&i.type==="paragraph"?(i.raw+=`
`+e.raw,i.text+=`
`+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(e),a=r.length!==t.length,t=t.substring(e.raw.length);continue}if(e=this.tokenizer.text(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
`+e.raw,i.text+=`
`+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(e);continue}if(t){const s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let e,i,r,a=t,s,c,d;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+bt("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,s.index)+"["+bt("a",s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.escapedEmSt.exec(a))!=null;)a=a.slice(0,s.index+s[0].length-2)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;t;)if(c||(d=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(o=>(e=o.call({lexer:this},t,n))?(t=t.substring(e.raw.length),n.push(e),!0):!1))){if(e=this.tokenizer.escape(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.tag(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&e.type==="text"&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):n.push(e);continue}if(e=this.tokenizer.link(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(e.raw.length),i=n[n.length-1],i&&e.type==="text"&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):n.push(e);continue}if(e=this.tokenizer.emStrong(t,a,d)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.codespan(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.br(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.del(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.autolink(t,$t)){t=t.substring(e.raw.length),n.push(e);continue}if(!this.state.inLink&&(e=this.tokenizer.url(t,$t))){t=t.substring(e.raw.length),n.push(e);continue}if(r=t,this.options.extensions&&this.options.extensions.startInline){let o=1/0;const h=t.slice(1);let g;this.options.extensions.startInline.forEach(function(p){g=p.call({lexer:this},h),typeof g=="number"&&g>=0&&(o=Math.min(o,g))}),o<1/0&&o>=0&&(r=t.substring(0,o+1))}if(e=this.tokenizer.inlineText(r,In)){t=t.substring(e.raw.length),e.raw.slice(-1)!=="_"&&(d=e.raw.slice(-1)),c=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):n.push(e);continue}if(t){const o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return n}}class pt{constructor(t){this.options=t||Ce}code(t,n,e){const i=(n||"").match(/\S*/)[0];if(this.options.highlight){const r=this.options.highlight(t,i);r!=null&&r!==t&&(e=!0,t=r)}return t=t.replace(/\n$/,"")+`
`,i?'<pre><code class="'+this.options.langPrefix+Y(i)+'">'+(e?t:Y(t,!0))+`</code></pre>
`:"<pre><code>"+(e?t:Y(t,!0))+`</code></pre>
`}blockquote(t){return`<blockquote>
${t}</blockquote>
`}html(t){return t}heading(t,n,e,i){if(this.options.headerIds){const r=this.options.headerPrefix+i.slug(e);return`<h${n} id="${r}">${t}</h${n}>
`}return`<h${n}>${t}</h${n}>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(t,n,e){const i=n?"ol":"ul",r=n&&e!==1?' start="'+e+'"':"";return"<"+i+r+`>
`+t+"</"+i+`>
`}listitem(t){return`<li>${t}</li>
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(t){return`<p>${t}</p>
`}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+n+`</table>
`}tablerow(t){return`<tr>
${t}</tr>
`}tablecell(t,n){const e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+t+`</${e}>
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return`<del>${t}</del>`}link(t,n,e){if(t=wt(this.options.sanitize,this.options.baseUrl,t),t===null)return e;let i='<a href="'+t+'"';return n&&(i+=' title="'+n+'"'),i+=">"+e+"</a>",i}image(t,n,e){if(t=wt(this.options.sanitize,this.options.baseUrl,t),t===null)return e;let i=`<img src="${t}" alt="${e}"`;return n&&(i+=` title="${n}"`),i+=this.options.xhtml?"/>":">",i}text(t){return t}}class Nt{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,e){return""+e}image(t,n,e){return""+e}br(){return""}}class Vt{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let e=t,i=0;if(this.seen.hasOwnProperty(e)){i=this.seen[t];do i++,e=t+"-"+i;while(this.seen.hasOwnProperty(e))}return n||(this.seen[t]=i,this.seen[e]=0),e}slug(t,n={}){const e=this.serialize(t);return this.getNextSafeSlug(e,n.dryrun)}}class me{constructor(t){this.options=t||Ce,this.options.renderer=this.options.renderer||new pt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Nt,this.slugger=new Vt}static parse(t,n){return new me(n).parse(t)}static parseInline(t,n){return new me(n).parseInline(t)}parse(t,n=!0){let e="",i,r,a,s,c,d,o,h,g,p,A,v,f,S,R,I,C,F,P;const N=t.length;for(i=0;i<N;i++){if(p=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(P=this.options.extensions.renderers[p.type].call({parser:this},p),P!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type))){e+=P||"";continue}switch(p.type){case"space":continue;case"hr":{e+=this.renderer.hr();continue}case"heading":{e+=this.renderer.heading(this.parseInline(p.tokens),p.depth,Ht(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue}case"code":{e+=this.renderer.code(p.text,p.lang,p.escaped);continue}case"table":{for(h="",o="",s=p.header.length,r=0;r<s;r++)o+=this.renderer.tablecell(this.parseInline(p.header[r].tokens),{header:!0,align:p.align[r]});for(h+=this.renderer.tablerow(o),g="",s=p.rows.length,r=0;r<s;r++){for(d=p.rows[r],o="",c=d.length,a=0;a<c;a++)o+=this.renderer.tablecell(this.parseInline(d[a].tokens),{header:!1,align:p.align[a]});g+=this.renderer.tablerow(o)}e+=this.renderer.table(h,g);continue}case"blockquote":{g=this.parse(p.tokens),e+=this.renderer.blockquote(g);continue}case"list":{for(A=p.ordered,v=p.start,f=p.loose,s=p.items.length,g="",r=0;r<s;r++)R=p.items[r],I=R.checked,C=R.task,S="",R.task&&(F=this.renderer.checkbox(I),f?R.tokens.length>0&&R.tokens[0].type==="paragraph"?(R.tokens[0].text=F+" "+R.tokens[0].text,R.tokens[0].tokens&&R.tokens[0].tokens.length>0&&R.tokens[0].tokens[0].type==="text"&&(R.tokens[0].tokens[0].text=F+" "+R.tokens[0].tokens[0].text)):R.tokens.unshift({type:"text",text:F}):S+=F),S+=this.parse(R.tokens,f),g+=this.renderer.listitem(S,C,I);e+=this.renderer.list(g,A,v);continue}case"html":{e+=this.renderer.html(p.text);continue}case"paragraph":{e+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(g=p.tokens?this.parseInline(p.tokens):p.text;i+1<N&&t[i+1].type==="text";)p=t[++i],g+=`
`+(p.tokens?this.parseInline(p.tokens):p.text);e+=n?this.renderer.paragraph(g):g;continue}default:{const ie='Token with "'+p.type+'" type was not found.';if(this.options.silent){console.error(ie);return}else throw new Error(ie)}}}return e}parseInline(t,n){n=n||this.renderer;let e="",i,r,a;const s=t.length;for(i=0;i<s;i++){if(r=t[i],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]&&(a=this.options.extensions.renderers[r.type].call({parser:this},r),a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type))){e+=a||"";continue}switch(r.type){case"escape":{e+=n.text(r.text);break}case"html":{e+=n.html(r.text);break}case"link":{e+=n.link(r.href,r.title,this.parseInline(r.tokens,n));break}case"image":{e+=n.image(r.href,r.title,r.text);break}case"strong":{e+=n.strong(this.parseInline(r.tokens,n));break}case"em":{e+=n.em(this.parseInline(r.tokens,n));break}case"codespan":{e+=n.codespan(r.text);break}case"br":{e+=n.br();break}case"del":{e+=n.del(this.parseInline(r.tokens,n));break}case"text":{e+=n.text(r.text);break}default:{const c='Token with "'+r.type+'" type was not found.';if(this.options.silent){console.error(c);return}else throw new Error(c)}}}return e}}class Ge{constructor(t){this.options=t||Ce}preprocess(t){return t}postprocess(t){return t}}gt(Ge,"passThroughHooks",new Set(["preprocess","postprocess"]));function En(l,t,n){return e=>{if(e.message+=`
Please report this to https://github.com/markedjs/marked.`,l){const i="<p>An error occurred:</p><pre>"+Y(e.message+"",!0)+"</pre>";if(t)return Promise.resolve(i);if(n){n(null,i);return}return i}if(t)return Promise.reject(e);if(n){n(e);return}throw e}}function Ft(l,t){return(n,e,i)=>{typeof e=="function"&&(i=e,e=null);const r={...e};e={...x.defaults,...r};const a=En(e.silent,e.async,i);if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(Sn(e),e.hooks&&(e.hooks.options=e),i){const s=e.highlight;let c;try{e.hooks&&(n=e.hooks.preprocess(n)),c=l(n,e)}catch(h){return a(h)}const d=function(h){let g;if(!h)try{e.walkTokens&&x.walkTokens(c,e.walkTokens),g=t(c,e),e.hooks&&(g=e.hooks.postprocess(g))}catch(p){h=p}return e.highlight=s,h?a(h):i(null,g)};if(!s||s.length<3||(delete e.highlight,!c.length))return d();let o=0;x.walkTokens(c,function(h){h.type==="code"&&(o++,setTimeout(()=>{s(h.text,h.lang,function(g,p){if(g)return d(g);p!=null&&p!==h.text&&(h.text=p,h.escaped=!0),o--,o===0&&d()})},0))}),o===0&&d();return}if(e.async)return Promise.resolve(e.hooks?e.hooks.preprocess(n):n).then(s=>l(s,e)).then(s=>e.walkTokens?Promise.all(x.walkTokens(s,e.walkTokens)).then(()=>s):s).then(s=>t(s,e)).then(s=>e.hooks?e.hooks.postprocess(s):s).catch(a);try{e.hooks&&(n=e.hooks.preprocess(n));const s=l(n,e);e.walkTokens&&x.walkTokens(s,e.walkTokens);let c=t(s,e);return e.hooks&&(c=e.hooks.postprocess(c)),c}catch(s){return a(s)}}}function x(l,t,n){return Ft(fe.lex,me.parse)(l,t,n)}x.options=x.setOptions=function(l){return x.defaults={...x.defaults,...l},fn(x.defaults),x};x.getDefaults=Ot;x.defaults=Ce;x.use=function(...l){const t=x.defaults.extensions||{renderers:{},childTokens:{}};l.forEach(n=>{const e={...n};if(e.async=x.defaults.async||e.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const r=t.renderers[i.name];r?t.renderers[i.name]=function(...a){let s=i.renderer.apply(this,a);return s===!1&&(s=r.apply(this,a)),s}:t.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[i.level]?t[i.level].unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),e.extensions=t),n.renderer){const i=x.defaults.renderer||new pt;for(const r in n.renderer){const a=i[r];i[r]=(...s)=>{let c=n.renderer[r].apply(i,s);return c===!1&&(c=a.apply(i,s)),c}}e.renderer=i}if(n.tokenizer){const i=x.defaults.tokenizer||new ut;for(const r in n.tokenizer){const a=i[r];i[r]=(...s)=>{let c=n.tokenizer[r].apply(i,s);return c===!1&&(c=a.apply(i,s)),c}}e.tokenizer=i}if(n.hooks){const i=x.defaults.hooks||new Ge;for(const r in n.hooks){const a=i[r];Ge.passThroughHooks.has(r)?i[r]=s=>{if(x.defaults.async)return Promise.resolve(n.hooks[r].call(i,s)).then(d=>a.call(i,d));const c=n.hooks[r].call(i,s);return a.call(i,c)}:i[r]=(...s)=>{let c=n.hooks[r].apply(i,s);return c===!1&&(c=a.apply(i,s)),c}}e.hooks=i}if(n.walkTokens){const i=x.defaults.walkTokens;e.walkTokens=function(r){let a=[];return a.push(n.walkTokens.call(this,r)),i&&(a=a.concat(i.call(this,r))),a}}x.setOptions(e)})};x.walkTokens=function(l,t){let n=[];for(const e of l)switch(n=n.concat(t.call(x,e)),e.type){case"table":{for(const i of e.header)n=n.concat(x.walkTokens(i.tokens,t));for(const i of e.rows)for(const r of i)n=n.concat(x.walkTokens(r.tokens,t));break}case"list":{n=n.concat(x.walkTokens(e.items,t));break}default:x.defaults.extensions&&x.defaults.extensions.childTokens&&x.defaults.extensions.childTokens[e.type]?x.defaults.extensions.childTokens[e.type].forEach(function(i){n=n.concat(x.walkTokens(e[i],t))}):e.tokens&&(n=n.concat(x.walkTokens(e.tokens,t)))}return n};x.parseInline=Ft(fe.lexInline,me.parseInline);x.Parser=me;x.parser=me.parse;x.Renderer=pt;x.TextRenderer=Nt;x.Lexer=fe;x.lexer=fe.lex;x.Tokenizer=ut;x.Slugger=Vt;x.Hooks=Ge;x.parse=x;x.options;x.setOptions;x.use;x.walkTokens;x.parseInline;me.parse;fe.lex;const Ct=({size:l})=>H("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:l,height:l},[H("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),H("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),An=()=>H("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},H("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),Tn=()=>H("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},H("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),jn=()=>H("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[H("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),H("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Un=({active:l=!1})=>H("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[H("path",{d:"M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z"+(l?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"),fill:l?"red":"currentColor"})]),Mn=()=>H("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[H("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),H("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Dn=()=>H("svg",{width:"16",height:"16",ariaHidden:"true"},H("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),On=()=>H("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},H("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Bn=()=>H("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},H("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Pn=()=>H("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},H("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),Me=({size:l})=>H("svg",{width:l,height:l,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},H("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},H("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Hn=()=>H("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[H("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),H("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),Wt={"Content-Type":"application/json"},st=(l,t="")=>{if(typeof l=="object"&&l.errno)throw new TypeError(`${t} failed with ${l.errno}: ${l.errmsg}`);return l},_t=({serverURL:l,lang:t,path:n,type:e,action:i})=>fetch(`${l}/article?lang=${t}`,{method:"POST",headers:Wt,body:JSON.stringify({path:n,type:e,action:i})}).then(r=>r.json()),Ze=({serverURL:l,lang:t,token:n,objectId:e,comment:i})=>fetch(`${l}/comment/${e}?lang=${t}`,{method:"PUT",headers:{...Wt,Authorization:`Bearer ${n}`},body:JSON.stringify(i)}).then(r=>r.json()).then(r=>st(r,"Update comment"));let zt=null;const qt=()=>zt||(zt=Se("WALINE_LIKE",[]));let Rt=null;const Nn=()=>Rt??(Rt=Se("WALINE_REACTION",{}));var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zt={},Re={},De={},Vn=Qe&&Qe.__awaiter||function(l,t,n,e){return new(n||(n=Promise))(function(i,r){function a(d){try{c(e.next(d))}catch(o){r(o)}}function s(d){try{c(e.throw(d))}catch(o){r(o)}}function c(d){var o;d.done?i(d.value):(o=d.value,o instanceof n?o:new n(function(h){h(o)})).then(a,s)}c((e=e.apply(l,t||[])).next())})},Fn=Qe&&Qe.__generator||function(l,t){var n,e,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function s(c){return function(d){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,e&&(i=2&o[0]?e.return:o[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,o[1])).done)return i;switch(e=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,e=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(i=a.trys,!((i=i.length>0&&i[i.length-1])||o[0]!==6&&o[0]!==2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(l,a)}catch(h){o=[6,h],e=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([c,d])}}};Object.defineProperty(De,"__esModule",{value:!0}),De.ReCaptchaInstance=void 0;var Wn=function(){function l(t,n,e){this.siteKey=t,this.recaptchaID=n,this.recaptcha=e,this.styleContainer=null}return l.prototype.execute=function(t){return Vn(this,void 0,void 0,function(){return Fn(this,function(n){return[2,this.recaptcha.enterprise?this.recaptcha.enterprise.execute(this.recaptchaID,{action:t}):this.recaptcha.execute(this.recaptchaID,{action:t})]})})},l.prototype.getSiteKey=function(){return this.siteKey},l.prototype.hideBadge=function(){this.styleContainer===null&&(this.styleContainer=document.createElement("style"),this.styleContainer.innerHTML=".grecaptcha-badge{visibility:hidden !important;}",document.head.appendChild(this.styleContainer))},l.prototype.showBadge=function(){this.styleContainer!==null&&(document.head.removeChild(this.styleContainer),this.styleContainer=null)},l}();De.ReCaptchaInstance=Wn,Object.defineProperty(Re,"__esModule",{value:!0}),Re.getInstance=Re.load=void 0;var de,qn=De;(function(l){l[l.NOT_LOADED=0]="NOT_LOADED",l[l.LOADING=1]="LOADING",l[l.LOADED=2]="LOADED"})(de||(de={}));var St=function(){function l(){}return l.load=function(t,n){if(n===void 0&&(n={}),typeof document>"u")return Promise.reject(new Error("This is a library for the browser!"));if(l.getLoadingState()===de.LOADED)return l.instance.getSiteKey()===t?Promise.resolve(l.instance):Promise.reject(new Error("reCAPTCHA already loaded with different site key!"));if(l.getLoadingState()===de.LOADING)return t!==l.instanceSiteKey?Promise.reject(new Error("reCAPTCHA already loaded with different site key!")):new Promise(function(i,r){l.successfulLoadingConsumers.push(function(a){return i(a)}),l.errorLoadingRunnable.push(function(a){return r(a)})});l.instanceSiteKey=t,l.setLoadingState(de.LOADING);var e=new l;return new Promise(function(i,r){e.loadScript(t,n.useRecaptchaNet||!1,n.useEnterprise||!1,n.renderParameters?n.renderParameters:{},n.customUrl).then(function(){l.setLoadingState(de.LOADED);var a=e.doExplicitRender(grecaptcha,t,n.explicitRenderParameters?n.explicitRenderParameters:{},n.useEnterprise||!1),s=new qn.ReCaptchaInstance(t,a,grecaptcha);l.successfulLoadingConsumers.forEach(function(c){return c(s)}),l.successfulLoadingConsumers=[],n.autoHideBadge&&s.hideBadge(),l.instance=s,i(s)}).catch(function(a){l.errorLoadingRunnable.forEach(function(s){return s(a)}),l.errorLoadingRunnable=[],r(a)})})},l.getInstance=function(){return l.instance},l.setLoadingState=function(t){l.loadingState=t},l.getLoadingState=function(){return l.loadingState===null?de.NOT_LOADED:l.loadingState},l.prototype.loadScript=function(t,n,e,i,r){var a=this;n===void 0&&(n=!1),e===void 0&&(e=!1),i===void 0&&(i={}),r===void 0&&(r="");var s=document.createElement("script");s.setAttribute("recaptcha-v3-script","");var c="https://www.google.com/recaptcha/api.js";n&&(c=e?"https://recaptcha.net/recaptcha/enterprise.js":"https://recaptcha.net/recaptcha/api.js"),e&&(c="https://www.google.com/recaptcha/enterprise.js"),r&&(c=r),i.render&&(i.render=void 0);var d=this.buildQueryString(i);return s.src=c+"?render=explicit"+d,new Promise(function(o,h){s.addEventListener("load",a.waitForScriptToLoad(function(){o(s)},e),!1),s.onerror=function(g){l.setLoadingState(de.NOT_LOADED),h(g)},document.head.appendChild(s)})},l.prototype.buildQueryString=function(t){return Object.keys(t).length<1?"":"&"+Object.keys(t).filter(function(n){return!!t[n]}).map(function(n){return n+"="+t[n]}).join("&")},l.prototype.waitForScriptToLoad=function(t,n){var e=this;return function(){window.grecaptcha===void 0?setTimeout(function(){e.waitForScriptToLoad(t,n)},l.SCRIPT_LOAD_DELAY):n?window.grecaptcha.enterprise.ready(function(){t()}):window.grecaptcha.ready(function(){t()})}},l.prototype.doExplicitRender=function(t,n,e,i){var r={sitekey:n,badge:e.badge,size:e.size,tabindex:e.tabindex};return e.container?i?t.enterprise.render(e.container,r):t.render(e.container,r):i?t.enterprise.render(r):t.render(r)},l.loadingState=null,l.instance=null,l.instanceSiteKey=null,l.successfulLoadingConsumers=[],l.errorLoadingRunnable=[],l.SCRIPT_LOAD_DELAY=25,l}();Re.load=St.load,Re.getInstance=St.getInstance,function(l){Object.defineProperty(l,"__esModule",{value:!0}),l.ReCaptchaInstance=l.getInstance=l.load=void 0;var t=Re;Object.defineProperty(l,"load",{enumerable:!0,get:function(){return t.load}}),Object.defineProperty(l,"getInstance",{enumerable:!0,get:function(){return t.getInstance}});var n=De;Object.defineProperty(l,"ReCaptchaInstance",{enumerable:!0,get:function(){return n.ReCaptchaInstance}})}(Zt);const Lt={};let It=null;const ht=()=>It??(It=Se("WALINE_USER",{})),Zn={key:0,class:"wl-reaction"},Kn=["textContent"],Gn={class:"wl-reaction-list"},Qn=["onClick"],Yn={class:"wl-reaction-img"},Xn=["src","alt"],Jn=["textContent"],ei=["textContent"];var ti=Oe({__name:"ArticleReaction",setup(l,{expose:t}){t();const n=Nn(),e=ct("config"),i=M(-1),r=M([]),a=Q(()=>e.value.locale),s=Q(()=>e.value.reaction.length>0),c=Q(()=>{const{reaction:h,path:g}=e.value;return h.map((p,A)=>({icon:p,desc:a.value[`reaction${A}`],active:n.value[g]===A}))});let d;const o=async()=>{if(s.value){const{serverURL:h,lang:g,path:p,reaction:A}=e.value,v=new AbortController;d=v.abort.bind(v);const f=await(({serverURL:S,lang:R,paths:I,type:C,signal:F})=>fetch(`${S}/article?path=${encodeURIComponent(I.join(","))}&type=${encodeURIComponent(C.join(","))}&lang=${R}`,{signal:F}).then(P=>P.json()))({serverURL:h,lang:g,paths:[p],type:A.map((S,R)=>`reaction${R}`),signal:v.signal});if(Array.isArray(f)||typeof f=="number")return;r.value=A.map((S,R)=>f[`reaction${R}`])}};return Ye(()=>{ge(()=>[e.value.serverURL,e.value.path],()=>{o()},{immediate:!0})}),ot(()=>d==null?void 0:d()),(h,g)=>u(c).length?(m(),y("div",Zn,[z("div",{class:"wl-reaction-title",textContent:D(u(a).reactionTitle)},null,8,Kn),z("ul",Gn,[(m(!0),y(te,null,se(u(c),({active:p,icon:A,desc:v},f)=>(m(),y("li",{key:f,class:ee(["wl-reaction-item",{active:p}]),onClick:S=>(async R=>{if(i.value===-1){const{serverURL:I,lang:C,path:F}=e.value,P=n.value[F];i.value=R,P!==void 0&&(await _t({serverURL:I,lang:C,path:F,type:`reaction${P}`,action:"desc"}),r.value[P]=Math.max(r.value[P]-1,0)),P!==R&&(await _t({serverURL:I,lang:C,path:F,type:`reaction${R}`}),r.value[R]=(r.value[R]||0)+1),P===R?delete n.value[F]:n.value[F]=R,i.value=-1}})(f)},[z("div",Yn,[z("img",{src:A,alt:v},null,8,Xn),i.value===f?(m(),$e(u(Me),{key:0,class:"wl-reaction-loading"})):(m(),y("div",{key:1,class:"wl-reaction-votes",textContent:D(r.value[f]||0)},null,8,Jn))]),z("div",{class:"wl-reaction-text",textContent:D(v)},null,8,ei)],10,Qn))),128))])])):U("v-if",!0)}}),Be=(l,t)=>{const n=l.__vccOpts||l;for(const[e,i]of t)n[e]=i;return n},ni=Be(ti,[["__file","ArticleReaction.vue"]]);const ii=["data-index"],li=["src","title","onClick"];var ri=Be(Oe({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(l,{expose:t}){const n=l;t();let e=null;const i=M(null),r=M({}),a=M([]),s=()=>{const h=Math.floor((i.value.getBoundingClientRect().width+n.gap)/(n.columnWidth+n.gap));return h>0?h:1},c=async h=>{var p;if(h>=n.items.length)return;await sn();const g=Array.from(((p=i.value)==null?void 0:p.children)||[]).reduce((A,v)=>v.getBoundingClientRect().height<A.getBoundingClientRect().height?v:A);a.value[Number(g.dataset.index)].push(h),await c(h+1)},d=async(h=!1)=>{if(a.value.length===s()&&!h)return;var g;a.value=(g=s(),new Array(g).fill(null).map(()=>[]));const p=window.scrollY;await c(0),window.scrollTo({top:p})},o=h=>{r.value[h.target.src]=!0};return Ye(()=>{d(!0),e=new ResizeObserver(()=>{d()}),e.observe(i.value),ge(()=>[n.items],()=>{r.value={},d(!0)}),ge(()=>[n.columnWidth,n.gap],()=>{d()})}),tn(()=>e.unobserve(i.value)),(h,g)=>(m(),y("div",{ref_key:"wall",ref:i,class:"wl-gallery",style:ft({gap:`${l.gap}px`})},[(m(!0),y(te,null,se(a.value,(p,A)=>(m(),y("div",{key:A,class:"wl-gallery-column","data-index":A,style:ft({gap:`${l.gap}px`})},[(m(!0),y(te,null,se(p,v=>(m(),y(te,{key:v},[r.value[l.items[v].src]?U("v-if",!0):(m(),$e(u(Me),{key:0,size:36,style:{margin:"20px auto"}})),z("img",{class:"wl-gallery-item",src:l.items[v].src,title:l.items[v].title,loading:"lazy",onLoad:o,onClick:f=>h.$emit("insert",`![](${l.items[v].src})`)},null,40,li)],64))),128))],12,ii))),128))],4))}}),[["__file","ImageWall.vue"]]);const ai=["nick","mail","link"],Et=l=>l.filter(t=>ai.includes(t)),At=["//unpkg.com/@waline/emojis@1.1.0/weibo"],si=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],oi=l=>new Promise((t,n)=>{if(l.size>128e3)return n(new Error("File too large! File size limit 128KB"));const e=new FileReader;e.readAsDataURL(l),e.onload=()=>{var i;return t(((i=e.result)==null?void 0:i.toString())||"")},e.onerror=n}),ci=l=>l===!0?'<p class="wl-tex">Tex is not available in preview</p>':'<span class="wl-tex">Tex is not available in preview</span>',ui=l=>{const t=async(n,e={})=>fetch(`https://api.giphy.com/v1/gifs/${n}?${new URLSearchParams({lang:l,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...e}).toString()}`).then(i=>i.json()).then(({data:i})=>i.map(r=>({title:r.title,src:r.images.downsized_medium.url})));return{search:n=>t("search",{q:n,offset:"0"}),default:()=>t("trending",{}),more:(n,e=0)=>t("search",{q:n,offset:e.toString()})}},pi=new RegExp(`(${/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source}|${/</.source})|((?:${/(?:^|\s)\/\/(.+?)$/gm.source})|(?:${/\/\*([\S\s]*?)\*\//gm.source}))`,"gmi"),Tt=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Je={},hi=l=>{let t=0;return l.replace(pi,(n,e,i)=>{if(i)return`<span style="color: slategray">${i}</span>`;if(e==="<")return"&lt;";let r;Je[e]?r=Je[e]:(r=Tt[t],Je[e]=r);const a=`<span style="color: #${r}">${e}</span>`;return t=++t%Tt.length,a})},di=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],Le=l=>Object.fromEntries(l.map((t,n)=>[di[n],t]));var et=Le(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),We=Le(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません!
現在の単語番号: $2`,"匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),tt=Le(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 $1 字之间
当前字数$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),jt=Le(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字",`評論字數應在 $0 $1 字之間
當前字數$2`,"匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度","你認為這篇文章怎麼樣?"]),Ut=Le(["Apelido","Apelido não pode ser menor que 3 bytes.","E-Mail","Por favor, confirme seu endereço de e-mail.","Website","Opcional","Comente aqui...","Nenhum comentário, ainda.","Enviar","Like","Cancel like","Responder","Cancelar resposta","Comentários","Refrescar","Carregar Mais...","Visualizar","Emoji","Enviar Imagem","segundos atrás","minutos atrás","horas atrás","dias atrás","agora mesmo","Enviando","Entrar","Sair","Admin","Sticky","Palavras",`Favor enviar comentário com $0 a $1 palavras!
Número de palavras atuais: $2`,"Anônimo","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Pesquisar GIF","informação pessoal","Aprovado","Espera","Spam","Unsticky","Mais velho","Mais recentes","Mais quente","O que você acha?"]),nt=Le(["Псевдоним","Никнейм не может быть меньше 3 байт.","Эл. адрес","Пожалуйста, подтвердите адрес вашей электронной почты.","Веб-сайт","Необязательный","Комментарий здесь...","Пока нет комментариев.","Отправить","Like","Cancel like","Отвечать","Отменить ответ","Комментарии","Обновить","Загрузи больше...","Превью","эмодзи","Загрузить изображение","секунд назад","несколько минут назад","несколько часов назад","дней назад","прямо сейчас","Загрузка","Авторизоваться","Выход из системы","Админ","Липкий","Слова",`Пожалуйста, введите комментарии от $0 до $1 слов!
Номер текущего слова: $2`,"Анонимный","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Поиск GIF","Персональные данные","Одобренный","Ожидающий","Спам","Нелипкий","самый старый","последний","самый горячий","Что вы думаете?"]);const it={zh:tt,"zh-cn":tt,"zh-CN":tt,"zh-tw":jt,"zh-TW":jt,en:et,"en-US":et,"en-us":et,jp:We,ja:We,"jp-jp":We,"jp-JP":We,"pt-br":Ut,"pt-BR":Ut,ru:nt,"ru-ru":nt,"ru-RU":nt},gi=l=>{try{l=decodeURI(l)}catch{}return l},Kt=(l="")=>l.replace(/\/$/u,""),Gt=l=>/^(https?:)?\/\//.test(l),fi=l=>{const t=Kt(l);return Gt(t)?t:`https://${t}`},mi=l=>Array.isArray(l)?l:!!l&&[0,l],lt=(l,t)=>typeof l=="function"?l:l!==!1&&t,rt="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bgcolor:#1e1e1e;--waline-bgcolor-light:#272727;--waline-bgcolor-hover: #444;--waline-border-color:#333;--waline-disable-bgcolor:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bgcolor:#272727;--waline-info-color:#666}",at=(l,t)=>{let n=l.toString();for(;n.length<t;)n="0"+n;return n},vi=(l,t,n)=>{if(!l)return"";const e=typeof l=="string"?new Date(l.indexOf(" ")!==-1?l.replace(/-/g,"/"):l):l,i=t.getTime()-e.getTime(),r=Math.floor(i/864e5);if(r===0){const a=i%864e5,s=Math.floor(a/36e5);if(s===0){const c=a%36e5,d=Math.floor(c/6e4);if(d===0){const o=c%6e4;return`${Math.round(o/1e3)} ${n.seconds}`}return`${d} ${n.minutes}`}return`${s} ${n.hours}`}return r<0?n.now:r<8?`${r} ${n.days}`:(a=>{const s=at(a.getDate(),2),c=at(a.getMonth()+1,2);return`${at(a.getFullYear(),2)}-${c}-${s}`})(e)},ki=l=>{const t=Se("WALINE_EMOJI",{}),n=Boolean(/@[0-9]+\.[0-9]+\.[0-9]+/.test(l));if(n){const e=t.value[l];if(e)return Promise.resolve(e)}return fetch(`${l}/info.json`).then(e=>e.json()).then(e=>{const i={folder:l,...e};return n&&(t.value[l]=i),i})},Mt=(l,t="",n="",e="")=>`${t?`${t}/`:""}${n}${l}${e?`.${e}`:""}`,wi=l=>l.type.includes("image"),Dt=l=>{const t=Array.from(l).find(wi);return t?t.getAsFile():null},yi=/\$.*?\$/,bi=/^\$(.*?)\$/,xi=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Qt=(l="",t={})=>l.replace(/:(.+?):/g,(n,e)=>t[e]?`<img class="wl-emoji" src="${t[e]}" alt="${e}">`:n),$i=(l,{emojiMap:t,highlighter:n,texRenderer:e})=>{if(x.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),e){const i=(r=>[{name:"blockMath",level:"block",tokenizer(a){const s=xi.exec(a);if(s!==null)return{type:"html",raw:s[0],text:r(!0,s[1])}}},{name:"inlineMath",level:"inline",start(a){const s=a.search(yi);return s!==-1?s:a.length},tokenizer(a){const s=bi.exec(a);if(s!==null)return{type:"html",raw:s[0],text:r(!1,s[1])}}}])(e);x.use({extensions:i})}return x.parse(Qt(l,t))},Ci={class:"wl-comment"},_i={key:0,class:"wl-login-info"},zi={class:"wl-avatar"},Ri=["title"],Si=["title"],Li=["src"],Ii=["title","textContent"],Ei={class:"wl-panel"},Ai=["for","textContent"],Ti=["id","onUpdate:modelValue","name","type"],ji=["placeholder"],Ui={class:"wl-preview"},Mi=z("hr",null,null,-1),Di=["innerHTML"],Oi={class:"wl-footer"},Bi={class:"wl-actions"},Pi={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Hi=["title"],Ni=["title"],Vi=["title"],Fi=["title"],Wi={class:"wl-info"},qi={class:"wl-text-number"},Zi={key:0},Ki=["textContent"],Gi=["textContent"],Qi=["disabled"],Yi=["placeholder"],Xi={key:0,class:"wl-loading"},Ji={key:0,class:"wl-tab-wrapper"},el=["title","onClick"],tl=["src","alt"],nl={key:0,class:"wl-tabs"},il=["onClick"],ll=["src","alt","title"],rl=["title"];var al=Oe({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(l,{expose:t,emit:n}){const e=l;t();const i=ct("config"),r=Se("WALINE_COMMENT_BOX_EDITOR",""),a=Se("WALINE_USER_META",{nick:"",mail:"",link:""}),s=ht(),c=M({}),d=M(null),o=M(null),h=M(null),g=M(null),p=M(null),A=M(null),v=M(null),f=M({tabs:[],map:{}}),S=M(0),R=M(!1),I=M(!1),C=M(!1),F=M(""),P=M(0),N=nn({loading:!0,list:[]}),ie=M(0),he=M(!1),Pe=M(""),ve=M(!1),L=M(!1),T=Q(()=>i.value.locale),O=Q(()=>{var b;return Boolean((b=s.value)==null?void 0:b.token)}),K=Q(()=>i.value.imageUploader!==!1),W=b=>{const k=d.value,E=k.selectionStart,B=k.selectionEnd||0,_=k.scrollTop;r.value=k.value.substring(0,E)+b+k.value.substring(B,k.value.length),k.focus(),k.selectionStart=E+b.length,k.selectionEnd=E+b.length,k.scrollTop=_},ne=b=>{const k=b.key;(b.ctrlKey||b.metaKey)&&k==="Enter"&&_e()},G=b=>{const k=`![${i.value.locale.uploading} ${b.name}]()`;return W(k),Promise.resolve().then(()=>i.value.imageUploader(b)).then(E=>{r.value=r.value.replace(k,`\r
![${b.name}](${E})`)}).catch(E=>{alert(E.message),r.value=r.value.replace(k,"")})},re=b=>{var k;if((k=b.dataTransfer)!=null&&k.items){const E=Dt(b.dataTransfer.items);E&&K.value&&(G(E),b.preventDefault())}},oe=b=>{if(b.clipboardData){const k=Dt(b.clipboardData.items);k&&K.value&&G(k)}},ke=()=>{const b=o.value;b.files&&K.value&&G(b.files[0]).then(()=>{b.value=""})},_e=async()=>{var pe,ae,Ne,Ae,Te;const{serverURL:b,lang:k,login:E,wordLimit:B,requiredMeta:_}=i.value;let V="";i.value.recaptchaV3Key&&(V=await(J=>{const le=Lt[J]??(Lt[J]=Zt.load(J,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:be=>le.then(Xe=>Xe.execute(be))}})(i.value.recaptchaV3Key).execute("social"));const Z=await(async()=>{if(!navigator)return"";const{userAgentData:J}=navigator;let le=navigator.userAgent;if(!J||J.platform!=="Windows")return le;const{platformVersion:be}=await J.getHighEntropyValues(["platformVersion"]);return be&&parseInt(be.split(".")[0])>=13&&(le=le.replace("Windows NT 10.0","Windows NT 11.0")),le})(),j={comment:Pe.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,url:i.value.path,recaptchaV3:V,ua:Z};if((pe=s.value)!=null&&pe.token)j.nick=s.value.display_name,j.mail=s.value.email,j.link=s.value.url;else{if(E==="force")return;if(_.indexOf("nick")>-1&&!j.nick)return(ae=c.value.nick)==null||ae.focus(),alert(T.value.nickError);if(_.indexOf("mail")>-1&&!j.mail||j.mail&&!/^\w(?:[\w._-]*\w)?@(?:\w(?:[\w-]*\w)?\.)*\w+$/.exec(j.mail))return(Ne=c.value.mail)==null||Ne.focus(),alert(T.value.mailError);j.nick||(j.nick=T.value.anonymous)}if(!j.comment)return void((Ae=d.value)==null?void 0:Ae.focus());if(!he.value)return alert(T.value.wordHint.replace("$0",B[0].toString()).replace("$1",B[1].toString()).replace("$2",P.value.toString()));j.comment=Qt(j.comment,f.value.map),e.replyId&&e.rootId&&(j.pid=e.replyId,j.rid=e.rootId,j.at=e.replyUser),ve.value=!0;const ue={serverURL:b,lang:k,token:(Te=s.value)==null?void 0:Te.token,comment:j};(e.edit?Ze({objectId:e.edit.objectId,...ue}):(({serverURL:J,lang:le,token:be,comment:Xe})=>{const dt={"Content-Type":"application/json"};return be&&(dt.Authorization=`Bearer ${be}`),fetch(`${J}/comment?lang=${le}`,{method:"POST",headers:dt,body:JSON.stringify(Xe)}).then(Xt=>Xt.json())})(ue)).then(J=>{var le;if(ve.value=!1,J.errmsg)return alert(J.errmsg);n("submit",J.data),r.value="",F.value="",e.replyId&&n("cancelReply"),(le=e.edit)!=null&&le.objectId&&n("cancelEdit")}).catch(J=>{ve.value=!1,alert(J.message)})},Ie=b=>{b.preventDefault();const{lang:k,serverURL:E}=i.value;(({lang:B,serverURL:_})=>{const V=(window.innerWidth-450)/2,Z=(window.innerHeight-450)/2,j=window.open(`${_}/ui/login?lng=${encodeURIComponent(B)}`,"_blank",`width=450,height=450,left=${V},top=${Z},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);return j==null||j.postMessage({type:"TOKEN",data:null},"*"),new Promise(ue=>{const pe=({data:ae})=>{ae&&typeof ae=="object"&&ae.type==="userInfo"&&ae.data.token&&(j==null||j.close(),window.removeEventListener("message",pe),ue(ae.data))};window.addEventListener("message",pe)})})({serverURL:E,lang:k}).then(B=>{s.value=B,(B.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(B)),n("log")})},Ee=()=>{s.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),n("log")},we=b=>{b.preventDefault();const{lang:k,serverURL:E}=i.value,B=(window.innerWidth-800)/2,_=(window.innerHeight-800)/2,V=new URLSearchParams({lng:k,token:s.value.token}),Z=window.open(`${E}/ui/profile?${V.toString()}`,"_blank",`width=800,height=800,left=${B},top=${_},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);Z==null||Z.postMessage({type:"TOKEN",data:s.value.token},"*")},ye=b=>{var k,E,B,_;(k=h.value)!=null&&k.contains(b.target)||(E=g.value)!=null&&E.contains(b.target)||(R.value=!1),(B=p.value)!=null&&B.contains(b.target)||(_=A.value)!=null&&_.contains(b.target)||(I.value=!1)},ce=async b=>{var j;const{scrollTop:k,clientHeight:E,scrollHeight:B}=b.target,_=(E+k)/B,V=i.value.search,Z=((j=v.value)==null?void 0:j.value)||"";_<.9||N.loading||L.value||(N.loading=!0,(V.more&&N.list.length?await V.more(Z,N.list.length):await V.search(Z)).length?N.list=[...N.list,...V.more&&N.list.length?await V.more(Z,N.list.length):await V.search(Z)]:L.value=!0,N.loading=!1,setTimeout(()=>{b.target.scrollTop=k},50))},ze=un(b=>{N.list=[],L.value=!1,ce(b)},300);ge([i,P],([b,k])=>{const{wordLimit:E}=b;E?k<E[0]&&E[0]!==0?(ie.value=E[0],he.value=!1):k>E[1]?(ie.value=E[1],he.value=!1):(ie.value=E[1],he.value=!0):(ie.value=0,he.value=!0)},{immediate:!0});const He=({data:b})=>{b&&b.type==="profile"&&(s.value={...s.value,...b.data},[localStorage,sessionStorage].filter(k=>k.getItem("WALINE_USER")).forEach(k=>k.setItem("WALINE_USER",JSON.stringify(s))))};return Ye(()=>{var b;document.body.addEventListener("click",ye),window.addEventListener("message",He),(b=e.edit)!=null&&b.objectId&&(r.value=e.edit.orig),ge(I,async k=>{if(!k)return;const E=i.value.search;v.value&&(v.value.value=""),N.loading=!0,N.list=E.default?await E.default():await E.search(""),N.loading=!1}),ge(()=>r.value,k=>{const{highlighter:E,texRenderer:B}=i.value;Pe.value=k,F.value=$i(k,{emojiMap:f.value.map,highlighter:E,texRenderer:B}),P.value=(_=>{var V,Z;return(((V=(j=>j.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu))(_))==null?void 0:V.reduce((j,ue)=>j+(ue.trim()===""?0:ue.trim().split(/\s+/u).length),0))||0)+(((Z=(j=>j.match(/[\u4E00-\u9FD5]/gu))(_))==null?void 0:Z.length)||0)})(k),k?vt(d.value):vt.destroy(d.value)},{immediate:!0}),ge(()=>i.value.emoji,k=>{return(E=k,Promise.all(E.map(B=>typeof B=="string"?ki(Kt(B)):Promise.resolve(B))).then(B=>{const _={tabs:[],map:{}};return B.forEach(V=>{const{name:Z,folder:j,icon:ue,prefix:pe,type:ae,items:Ne}=V;_.tabs.push({name:Z,icon:Mt(ue,j,pe,ae),items:Ne.map(Ae=>{const Te=`${pe||""}${Ae}`;return _.map[Te]=Mt(Ae,j,pe,ae),Te})})}),_})).then(B=>{f.value=B});var E},{immediate:!0})}),ot(()=>{document.body.removeEventListener("click",ye),window.removeEventListener("message",He)}),(b,k)=>{var E,B;return m(),y("div",Ci,[u(i).login!=="disable"&&u(O)&&!((E=l.edit)!=null&&E.objectId)?(m(),y("div",_i,[z("div",zi,[z("button",{type:"submit",class:"wl-logout-btn",title:u(T).logout,onClick:Ee},[X(u(Ct),{size:14})],8,Ri),z("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:u(T).profile,onClick:we},[z("img",{src:u(s).avatar,alt:"avatar"},null,8,Li)],8,Si)]),z("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:u(T).profile,onClick:we,textContent:D(u(s).display_name)},null,8,Ii)])):U("v-if",!0),z("div",Ei,[u(i).login!=="force"&&u(i).meta.length&&!u(O)?(m(),y("div",{key:0,class:ee(["wl-header",`item${u(i).meta.length}`])},[(m(!0),y(te,null,se(u(i).meta,_=>(m(),y("div",{key:_,class:"wl-header-item"},[z("label",{for:`wl-${_}`,textContent:D(u(T)[_]+(u(i).requiredMeta.includes(_)||!u(i).requiredMeta.length?"":`(${u(T).optional})`))},null,8,Ai),Ve(z("input",{id:`wl-${_}`,ref_for:!0,ref:V=>{V&&(c.value[_]=V)},"onUpdate:modelValue":V=>u(a)[_]=V,class:ee(["wl-input",`wl-${_}`]),name:_,type:_==="mail"?"email":"text"},null,10,Ti),[[an,u(a)[_]]])]))),128))],2)):U("v-if",!0),Ve(z("textarea",{id:"wl-edit",ref_key:"editorRef",ref:d,"onUpdate:modelValue":k[0]||(k[0]=_=>rn(r)?r.value=_:null),class:"wl-editor",placeholder:l.replyUser?`@${l.replyUser}`:u(T).placeholder,onKeydown:ne,onDrop:re,onPaste:oe},null,40,ji),[[ln,u(r)]]),Ve(z("div",Ui,[Mi,z("h4",null,D(u(T).preview)+":",1),z("div",{class:"wl-content",innerHTML:F.value},null,8,Di)],512),[[mt,C.value]]),z("div",Oi,[z("div",Bi,[z("a",Pi,[X(u(Dn))]),Ve(z("button",{ref_key:"emojiButtonRef",ref:h,type:"button",class:ee(["wl-action",{active:R.value}]),title:u(T).emoji,onClick:k[1]||(k[1]=_=>R.value=!R.value)},[X(u(Tn))],10,Hi),[[mt,f.value.tabs.length]]),u(i).search?(m(),y("button",{key:0,ref_key:"gifButtonRef",ref:p,type:"button",class:ee(["wl-action",{active:I.value}]),title:u(T).gif,onClick:k[2]||(k[2]=_=>I.value=!I.value)},[X(u(Hn))],10,Ni)):U("v-if",!0),z("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:o,class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:ke},null,544),u(K)?(m(),y("label",{key:1,for:"wl-image-upload",class:"wl-action",title:u(T).uploadImage},[X(u(jn))],8,Vi)):U("v-if",!0),z("button",{type:"button",class:ee(["wl-action",{active:C.value}]),title:u(T).preview,onClick:k[3]||(k[3]=_=>C.value=!C.value)},[X(u(Mn))],10,Fi)]),z("div",Wi,[z("div",qi,[xe(D(P.value)+" ",1),u(i).wordLimit?(m(),y("span",Zi,[xe("  /  "),z("span",{class:ee({illegal:!he.value}),textContent:D(ie.value)},null,10,Ki)])):U("v-if",!0),xe("  "+D(u(T).word),1)]),u(i).login==="disable"||u(O)?U("v-if",!0):(m(),y("button",{key:0,type:"button",class:"wl-btn",onClick:Ie,textContent:D(u(T).login)},null,8,Gi)),u(i).login!=="force"||u(O)?(m(),y("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:ve.value,onClick:_e},[ve.value?(m(),$e(u(Me),{key:0,size:16})):(m(),y(te,{key:1},[xe(D(u(T).submit),1)],64))],8,Qi)):U("v-if",!0)]),z("div",{ref_key:"gifPopupRef",ref:A,class:ee(["wl-gif-popup",{display:I.value}])},[z("input",{ref_key:"gifSearchInputRef",ref:v,type:"text",placeholder:u(T).gifSearchPlaceholder,onInput:k[4]||(k[4]=(..._)=>u(ze)&&u(ze)(..._))},null,40,Yi),X(ri,{items:N.list,"column-width":200,gap:6,onInsert:k[5]||(k[5]=_=>W(_)),onScroll:ce},null,8,["items"]),N.loading?(m(),y("div",Xi,[X(u(Me),{size:30})])):U("v-if",!0)],2),z("div",{ref_key:"emojiPopupRef",ref:g,class:ee(["wl-emoji-popup",{display:R.value}])},[(m(!0),y(te,null,se(f.value.tabs,(_,V)=>(m(),y(te,{key:_.name},[V===S.value?(m(),y("div",Ji,[(m(!0),y(te,null,se(_.items,Z=>(m(),y("button",{key:Z,type:"button",title:Z,onClick:j=>W(`:${Z}:`)},[R.value?(m(),y("img",{key:0,class:"wl-emoji",src:f.value.map[Z],alt:Z,loading:"lazy",referrerPolicy:"no-referrer"},null,8,tl)):U("v-if",!0)],8,el))),128))])):U("v-if",!0)],64))),128)),f.value.tabs.length>1?(m(),y("div",nl,[(m(!0),y(te,null,se(f.value.tabs,(_,V)=>(m(),y("button",{key:_.name,type:"button",class:ee(["wl-tab",{active:S.value===V}]),onClick:Z=>S.value=V},[z("img",{class:"wl-emoji",src:_.icon,alt:_.name,title:_.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,ll)],10,il))),128))])):U("v-if",!0)],2)])]),l.replyId||(B=l.edit)!=null&&B.objectId?(m(),y("button",{key:1,type:"button",class:"wl-close",title:u(T).cancelReply,onClick:k[6]||(k[6]=_=>b.$emit(l.replyId?"cancelReply":"cancelEdit"))},[X(u(Ct),{size:24})],8,rl)):U("v-if",!0)])}}}),Yt=Be(al,[["__file","CommentBox.vue"]]);const sl=["id"],ol={class:"wl-user","aria-hidden":"true"},cl=["src"],ul={class:"wl-card"},pl={class:"wl-head"},hl=["href"],dl={key:1,class:"wl-nick"},gl=["textContent"],fl=["textContent"],ml=["textContent"],vl=["textContent"],kl=["textContent"],wl={class:"wl-comment-actions"},yl=["title"],bl=["textContent"],xl=["title"],$l={class:"wl-meta","aria-hidden":"true"},Cl=["data-value","textContent"],_l=["data-value","textContent"],zl=["data-value","textContent"],Rl=["innerHTML"],Sl={key:1,class:"wl-admin-actions"},Ll={class:"wl-comment-status"},Il=["disabled","onClick","textContent"],El={key:3,class:"wl-quote"};var Al=Be(Oe({__name:"CommentCard",props:{comment:null,edit:{default:null},rootId:null,reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(l){const t=l,n=["approved","waiting","spam"],e=ct("config"),i=qt(),r=pn(),a=ht(),s=Q(()=>e.value.locale),c=Q(()=>{const{link:v}=t.comment;return v?Gt(v)?v:`https://${v}`:""}),d=Q(()=>i.value.includes(t.comment.objectId)),o=Q(()=>vi(t.comment.insertedAt,r.value,s.value)),h=Q(()=>a.value.type==="administrator"),g=Q(()=>t.comment.user_id&&a.value.objectId===t.comment.user_id),p=Q(()=>{var v;return t.comment.objectId===((v=t.reply)==null?void 0:v.objectId)}),A=Q(()=>{var v;return t.comment.objectId===((v=t.edit)==null?void 0:v.objectId)});return(v,f)=>{var R;const S=on("CommentCard",!0);return m(),y("div",{id:l.comment.objectId,class:"wl-card-item"},[z("div",ol,[l.comment.avatar?(m(),y("img",{key:0,src:l.comment.avatar},null,8,cl)):U("v-if",!0),l.comment.type?(m(),$e(u(Pn),{key:1})):U("v-if",!0)]),z("div",ul,[z("div",pl,[u(c)?(m(),y("a",{key:0,class:"wl-nick",href:u(c),target:"_blank",rel:"noopener noreferrer"},D(l.comment.nick),9,hl)):(m(),y("span",dl,D(l.comment.nick),1)),l.comment.type==="administrator"?(m(),y("span",{key:2,class:"wl-badge",textContent:D(u(s).admin)},null,8,gl)):U("v-if",!0),l.comment.label?(m(),y("span",{key:3,class:"wl-badge",textContent:D(l.comment.label)},null,8,fl)):U("v-if",!0),l.comment.sticky?(m(),y("span",{key:4,class:"wl-badge",textContent:D(u(s).sticky)},null,8,ml)):U("v-if",!0),l.comment.level!==void 0&&l.comment.level>=0?(m(),y("span",{key:5,class:ee(`wl-badge level${l.comment.level}`),textContent:D(u(s)[`level${l.comment.level}`]||`Level ${l.comment.level}`)},null,10,vl)):U("v-if",!0),z("span",{class:"wl-time",textContent:D(u(o))},null,8,kl),z("div",wl,[u(h)||u(g)?(m(),y("button",{key:0,type:"button",class:"wl-edit",onClick:f[0]||(f[0]=()=>v.$emit("edit",l.comment))},[X(u(Bn))])):U("v-if",!0),u(h)||u(g)?(m(),y("button",{key:1,type:"button",class:"wl-delete",onClick:f[1]||(f[1]=I=>v.$emit("delete",l.comment))},[X(u(An))])):U("v-if",!0),z("button",{type:"button",class:"wl-like",title:u(d)?u(s).cancelLike:u(s).like,onClick:f[2]||(f[2]=I=>v.$emit("like",l.comment))},[X(u(Un),{active:u(d)},null,8,["active"]),"like"in l.comment?(m(),y("span",{key:0,textContent:D(l.comment.like)},null,8,bl)):U("v-if",!0)],8,yl),z("button",{type:"button",class:ee(["wl-reply",{active:u(p)}]),title:u(p)?u(s).cancelReply:u(s).reply,onClick:f[3]||(f[3]=I=>v.$emit("reply",u(p)?null:l.comment))},[X(u(On))],10,xl)])]),z("div",$l,[l.comment.addr?(m(),y("span",{key:0,class:"wl-addr","data-value":l.comment.addr,textContent:D(l.comment.addr)},null,8,Cl)):U("v-if",!0),l.comment.browser?(m(),y("span",{key:1,class:"wl-browser","data-value":l.comment.browser,textContent:D(l.comment.browser)},null,8,_l)):U("v-if",!0),l.comment.os?(m(),y("span",{key:2,class:"wl-os","data-value":l.comment.os,textContent:D(l.comment.os)},null,8,zl)):U("v-if",!0)]),u(A)?U("v-if",!0):(m(),y("div",{key:0,class:"wl-content",innerHTML:l.comment.comment},null,8,Rl)),u(h)&&!u(A)?(m(),y("div",Sl,[z("span",Ll,[(m(),y(te,null,se(n,I=>z("button",{key:I,type:"submit",class:ee(`wl-btn wl-${I}`),disabled:l.comment.status===I,onClick:C=>v.$emit("status",{status:I,comment:l.comment}),textContent:D(u(s)[I])},null,10,Il)),64))]),u(h)&&!l.comment.rid?(m(),y("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:f[4]||(f[4]=I=>v.$emit("sticky",l.comment))},D(l.comment.sticky?u(s).unsticky:u(s).sticky),1)):U("v-if",!0)])):U("v-if",!0),u(p)||u(A)?(m(),y("div",{key:2,class:ee({"wl-reply-wrapper":u(p),"wl-edit-wrapper":u(A)})},[X(Yt,{edit:l.edit,"reply-id":(R=l.reply)==null?void 0:R.objectId,"reply-user":l.comment.nick,"root-id":l.rootId,onLog:f[5]||(f[5]=I=>v.$emit("log")),onCancelReply:f[6]||(f[6]=I=>v.$emit("reply",null)),onCancelEdit:f[7]||(f[7]=I=>v.$emit("edit",null)),onSubmit:f[8]||(f[8]=I=>v.$emit("submit",I))},null,8,["edit","reply-id","reply-user","root-id"])],2)):U("v-if",!0),l.comment.children?(m(),y("div",El,[(m(!0),y(te,null,se(l.comment.children,I=>(m(),$e(S,{key:I.objectId,comment:I,reply:l.reply,edit:l.edit,"root-id":l.rootId,onLog:f[9]||(f[9]=C=>v.$emit("log")),onDelete:f[10]||(f[10]=C=>v.$emit("delete",C)),onEdit:f[11]||(f[11]=C=>v.$emit("edit",C)),onLike:f[12]||(f[12]=C=>v.$emit("like",C)),onReply:f[13]||(f[13]=C=>v.$emit("reply",C)),onStatus:f[14]||(f[14]=C=>v.$emit("status",C)),onSticky:f[15]||(f[15]=C=>v.$emit("sticky",C)),onSubmit:f[16]||(f[16]=C=>v.$emit("submit",C))},null,8,["comment","reply","edit","root-id"]))),128))])):U("v-if",!0)])],8,sl)}}}),[["__file","CommentCard.vue"]]);const Tl="2.14.9",jl={"data-waline":""},Ul={class:"wl-meta-head"},Ml={class:"wl-count"},Dl=["textContent"],Ol={class:"wl-sort"},Bl=["onClick"],Pl={class:"wl-cards"},Hl={key:1,class:"wl-operation"},Nl=["textContent"],Vl={key:0,class:"wl-loading"},Fl=["textContent"],Wl={key:2,class:"wl-operation"},ql=["textContent"],Zl={key:3,class:"wl-power"},Kl=z("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);var Gl=Oe({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","reaction"],setup(l){const t=l,n={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},e=Object.keys(n),i=ht(),r=qt(),a=M("loading"),s=M(0),c=M(1),d=M(0),o=Q(()=>(({serverURL:L,path:T=location.pathname,lang:O=typeof navigator>"u"?"en-US":navigator.language,locale:K,emoji:W=At,meta:ne=["nick","mail","link"],requiredMeta:G=[],dark:re=!1,pageSize:oe=10,wordLimit:ke,imageUploader:_e,highlighter:Ie,texRenderer:Ee,copyright:we=!0,login:ye="enable",search:ce,reaction:ze,recaptchaV3Key:He="",commentSorting:b="latest",...k})=>({serverURL:fi(L),path:gi(T),locale:{...it[O]||it["en-US"],...typeof K=="object"?K:{}},wordLimit:mi(ke),meta:Et(ne),requiredMeta:Et(G),imageUploader:lt(_e,oi),highlighter:lt(Ie,hi),texRenderer:lt(Ee,ci),lang:Object.keys(it).includes(O)?O:"en-US",dark:re,emoji:typeof W=="boolean"?W?At:[]:W,pageSize:oe,login:ye,copyright:we,search:ce!==!1&&(typeof ce=="object"?ce:ui(O)),recaptchaV3Key:He,reaction:Array.isArray(ze)?ze:ze===!0?si:[],commentSorting:b,...k}))(t)),h=M(o.value.commentSorting),g=M([]),p=M(null),A=M(null),v=Q(()=>{return typeof(L=o.value.dark)=="string"?L==="auto"?`@media(prefers-color-scheme:dark){body${rt}}`:`${L}${rt}`:L===!0?`:root${rt}`:"";var L}),f=Q(()=>o.value.locale);let S;hn(v);const R=L=>{var ne;const{serverURL:T,path:O,pageSize:K}=o.value,W=new AbortController;a.value="loading",S==null||S(),(({serverURL:G,lang:re,path:oe,page:ke,pageSize:_e,sortBy:Ie,signal:Ee,token:we})=>{const ye={};return we&&(ye.Authorization=`Bearer ${we}`),fetch(`${G}/comment?path=${encodeURIComponent(oe)}&pageSize=${_e}&page=${ke}&lang=${re}&sortBy=${Ie}`,{signal:Ee,headers:ye}).then(ce=>ce.json()).then(ce=>st(ce,"Get comment data"))})({serverURL:T,lang:o.value.lang,path:O,pageSize:K,sortBy:n[h.value],page:L,signal:W.signal,token:(ne=i.value)==null?void 0:ne.token}).then(G=>{a.value="success",s.value=G.count,g.value.push(...G.data),c.value=L,d.value=G.totalPages}).catch(G=>{G.name!=="AbortError"&&(console.error(G.message),a.value="error")}),S=W.abort.bind(W)},I=()=>R(c.value+1),C=()=>{s.value=0,g.value=[],R(1)},F=L=>{p.value=L},P=L=>{A.value=L},N=L=>{if(A.value)A.value.comment=L.comment,A.value.orig=L.orig;else if(L.rid){const T=g.value.find(({objectId:O})=>O===L.rid);if(!T)return;Array.isArray(T.children)||(T.children=[]),T.children.push(L)}else g.value.unshift(L)},ie=async({comment:L,status:T})=>{var W;if(L.status===T)return;const{serverURL:O,lang:K}=o.value;await Ze({serverURL:O,lang:K,token:(W=i.value)==null?void 0:W.token,objectId:L.objectId,comment:{status:T}}),L.status=T},he=async L=>{var K;if(L.rid)return;const{serverURL:T,lang:O}=o.value;await Ze({serverURL:T,lang:O,token:(K=i.value)==null?void 0:K.token,objectId:L.objectId,comment:{sticky:L.sticky?0:1}}),L.sticky=!L.sticky},Pe=async({objectId:L})=>{var K;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:T,lang:O}=o.value;await(({serverURL:W,lang:ne,token:G,objectId:re})=>fetch(`${W}/comment/${re}?lang=${ne}`,{method:"DELETE",headers:{Authorization:`Bearer ${G}`}}).then(oe=>oe.json()).then(oe=>st(oe,"Delete comment")))({serverURL:T,lang:O,token:(K=i.value)==null?void 0:K.token,objectId:L}),g.value.some((W,ne)=>W.objectId===L?(g.value=g.value.filter((G,re)=>re!==ne),!0):W.children.some((G,re)=>G.objectId===L&&(g.value[ne].children=W.children.filter((oe,ke)=>ke!==re),!0)))},ve=async L=>{var ne;const{serverURL:T,lang:O}=o.value,{objectId:K}=L,W=r.value.includes(K);await Ze({serverURL:T,lang:O,objectId:K,token:(ne=i.value)==null?void 0:ne.token,comment:{like:!W}}),W?r.value=r.value.filter(G=>G!==K):(r.value=[...r.value,K],r.value.length>50&&(r.value=r.value.slice(-50))),L.like=(L.like||0)+(W?-1:1)};return cn("config",o),Ye(()=>{ge(()=>[t.serverURL,t.path],()=>C(),{immediate:!0})}),ot(()=>S==null?void 0:S()),(L,T)=>(m(),y("div",jl,[X(ni),p.value?U("v-if",!0):(m(),$e(Yt,{key:0,onLog:C,onSubmit:N})),z("div",Ul,[z("div",Ml,[s.value?(m(),y("span",{key:0,class:"wl-num",textContent:D(s.value)},null,8,Dl)):U("v-if",!0),xe(" "+D(u(f).comment),1)]),z("ul",Ol,[(m(!0),y(te,null,se(u(e),O=>(m(),y("li",{key:O,class:ee([O===h.value?"active":""]),onClick:K=>(W=>{h.value!==W&&(h.value=W,C())})(O)},D(u(f)[O]),11,Bl))),128))])]),z("div",Pl,[(m(!0),y(te,null,se(g.value,O=>(m(),$e(Al,{key:O.objectId,"root-id":O.objectId,comment:O,reply:p.value,edit:A.value,onLog:C,onReply:F,onEdit:P,onSubmit:N,onStatus:ie,onDelete:Pe,onSticky:he,onLike:ve},null,8,["root-id","comment","reply","edit"]))),128))]),a.value==="error"?(m(),y("div",Hl,[z("button",{type:"button",class:"wl-btn",onClick:C,textContent:D(u(f).refresh)},null,8,Nl)])):(m(),y(te,{key:2},[a.value==="loading"?(m(),y("div",Vl,[X(u(Me),{size:30})])):g.value.length?c.value<d.value?(m(),y("div",Wl,[z("button",{type:"button",class:"wl-btn",onClick:I,textContent:D(u(f).more)},null,8,ql)])):U("v-if",!0):(m(),y("div",{key:1,class:"wl-empty",textContent:D(u(f).sofa)},null,8,Fl))],64)),u(o).copyright?(m(),y("div",Zl,[xe(" Powered by "),Kl,xe(" v"+D(u(Tl)),1)])):U("v-if",!0)]))}}),Jl=Be(Gl,[["__file","WalineComment.vue"]]);export{Jl as Waline,Tl as version};