mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.Docs.git
synced 2025-11-19 21:16:31 +08:00
55 lines
92 KiB
JavaScript
55 lines
92 KiB
JavaScript
import{c as Be,r as M,h as Y,o as Ye,w as ve,E as ot,u,X as g,Y as y,Z as z,a3 as D,a4 as te,a5 as se,a6 as U,B as Xt,a7 as gt,b as Jt,a0 as X,a8 as ee,a9 as Fe,aa as en,t as tn,ab as mt,$ as $e,ac as Ce,ad as nn,j as N,m as ct,s as ln,C as rn,F as an}from"./framework-3fad1c41.js";import{a as Se,b as sn,c as on,d as cn}from"./app-829c62c3.js";var Me=new Map;function un(l){var t=Me.get(l);t&&t.destroy()}function pn(l){var t=Me.get(l);t&&t.update()}var Ue=null;typeof window>"u"?((Ue=function(l){return l}).destroy=function(l){return l},Ue.update=function(l){return l}):((Ue=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"&&!Me.has(e)){var i,r=null,a=window.getComputedStyle(e),s=(i=e.value,function(){h({testForHeightReduction:i===""||!e.value.startsWith(i),restoreTextAlign:null}),i=e.value}),c=function(m){e.removeEventListener("autosize:destroy",c),e.removeEventListener("autosize:update",o),e.removeEventListener("input",s),window.removeEventListener("resize",o),Object.keys(m).forEach(function(w){return e.style[w]=m[w]}),Me.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",Me.set(e,{destroy:c,update:o}),o()}function h(m){var w,p,A=m.restoreTextAlign,f=A===void 0?null:A,d=m.testForHeightReduction,S=d===void 0||d,R=a.overflowY;if(e.scrollHeight!==0&&(a.resize==="vertical"?e.style.resize="none":a.resize==="both"&&(e.style.resize="horizontal"),S&&(w=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 H=P[0],ie=P[1];H.style.scrollBehavior="auto",H.scrollTop=ie,H.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",f&&(e.style.textAlign=f),w&&w(),r!==p&&(e.dispatchEvent(new Event("autosize:resized",{bubbles:!0})),r=p),R!==a.overflow&&!f)){var I=a.textAlign;a.overflow==="hidden"&&(e.style.textAlign=I==="start"?"end":"start"),h({restoreTextAlign:I,testForHeightReduction:!0})}}function o(){h({testForHeightReduction:!0,restoreTextAlign:null})}}(n)}),l}).destroy=function(l){return l&&Array.prototype.forEach.call(l.length?l:[l],un),l},Ue.update=function(l){return l&&Array.prototype.forEach.call(l.length?l:[l],pn),l});var ft=Ue;function Dt(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let Le=Dt();function hn(l){Le=l}const Ot=/[&<>"']/,dn=new RegExp(Ot.source,"g"),Bt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,gn=new RegExp(Bt.source,"g"),mn={"&":"&","<":"<",">":">",'"':""","'":"'"},vt=l=>mn[l];function Q(l,t){if(t){if(Ot.test(l))return l.replace(dn,vt)}else if(Bt.test(l))return l.replace(gn,vt);return l}const fn=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Pt(l){return l.replace(fn,(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 vn=/(^|[^\[])\^/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(vn,"$1"),l=l.replace(e,i),n),getRegex:()=>new RegExp(l,t)};return n}const kn=/[^\w:]/g,wn=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function kt(l,t,n){if(l){let e;try{e=decodeURIComponent(Pt(n)).replace(kn,"").toLowerCase()}catch{return null}if(e.indexOf("javascript:")===0||e.indexOf("vbscript:")===0||e.indexOf("data:")===0)return null}t&&!wn.test(n)&&(n=$n(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const We={},yn=/^[^:]+:\/*[^/]*$/,bn=/^([^:]+:)[\s\S]*$/,xn=/^([^:]+:\/*[^/]*)[\s\S]*$/;function $n(l,t){We[" "+l]||(yn.test(l)?We[" "+l]=l+"/":We[" "+l]=Ze(l,"/",!0)),l=We[" "+l];const n=l.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:l.replace(bn,"$1")+t:t.charAt(0)==="/"?n?t:l.replace(xn,"$1")+t:l+t}const Ge={exec:function(){}};function oe(l){let t=1,n,e;for(;t<arguments.length;t++){n=arguments[t];for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&(l[e]=n[e])}return l}function wt(l,t){const n=l.replace(/\|/g,(r,a,s)=>{let c=!1,h=a;for(;--h>=0&&s[h]==="\\";)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 Ze(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 Cn(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 Nt(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 yt(l,t){if(t<1)return"";let n="";for(;t>1;)t&1&&(n+=l),t>>=1,l+=l;return n+l}function bt(l,t,n,e){const i=t.href,r=t.title?Q(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:Q(a)}}function _n(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||Le}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:Ze(e,`
|
||
`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const e=n[0],i=_n(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=Ze(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,h,o,m,w,p,A,f=n[1].trim();const d=f.length>1,S={type:"list",raw:"",ordered:d,start:d?+f.slice(0,-1):"",loose:!1,items:[]};f=d?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=d?f:"[*+-]");const R=new RegExp(`^( {0,3}${f})((?:[ ][^\\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)),m=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(m)&&(e+=m+`
|
||
`,t=t.substring(m.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)}}(?:\`\`\`|~~~)`),H=new RegExp(`^ {0,${Math.min(3,a-1)}}#`);for(;t&&(w=t.split(`
|
||
`,1)[0],m=w,this.options.pedantic&&(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(P.test(m)||H.test(m)||C.test(m)||F.test(t)));){if(m.search(/[^ ]/)>=a||!m.trim())p+=`
|
||
`+m.slice(a);else{if(c||o.search(/[^ ]/)>=4||P.test(o)||H.test(o)||F.test(o))break;p+=`
|
||
`+m}!c&&!m.trim()&&(c=!0),e+=w+`
|
||
`,t=t.substring(w.length+1),o=m.slice(a)}}S.loose||(h?S.loose=!0:/\n *\n *$/.test(e)&&(h=!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]):Q(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:wt(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]=wt(e.rows[r],e.header.length).map(h=>({text:h}));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:Q(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]):Q(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=Ze(e.slice(0,-1),"\\");if((e.length-a.length)%2===0)return}else{const a=Cn(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)),bt(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 bt(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,h=a,o=0;const m=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(m.lastIndex=0,n=n.slice(-1*t.length+a);(i=m.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]){h+=c;continue}else if((i[5]||i[6])&&a%3&&!((a+c)%3)){o+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h+o);const w=t.slice(0,a+i.index+(i[0].length-s.length)+c);if(Math.min(a,c)%2){const A=w.slice(1,-1);return{type:"em",raw:w,text:A,tokens:this.lexer.inlineTokens(A)}}const p=w.slice(2,-2);return{type:"strong",raw:w,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=Q(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=Q(this.options.mangle?n(e[1]):e[1]),r="mailto:"+i):(i=Q(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=Q(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=Q(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]):Q(e[0]):e[0]:i=Q(this.options.smartypants?n(e[0]):e[0]),{type:"text",raw:e[0],text:i}}}}const x={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:Ge,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};x._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;x._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;x.def=q(x.def).replace("label",x._label).replace("title",x._title).getRegex();x.bullet=/(?:[*+-]|\d{1,9}[.)])/;x.listItemStart=q(/^( *)(bull) */).replace("bull",x.bullet).getRegex();x.list=q(x.list).replace(/bull/g,x.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+x.def.source+")").getRegex();x._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";x._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;x.html=q(x.html,"i").replace("comment",x._comment).replace("tag",x._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();x.paragraph=q(x._paragraph).replace("hr",x.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",x._tag).getRegex();x.blockquote=q(x.blockquote).replace("paragraph",x.paragraph).getRegex();x.normal=oe({},x);x.gfm=oe({},x.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});x.gfm.table=q(x.gfm.table).replace("hr",x.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",x._tag).getRegex();x.gfm.paragraph=q(x._paragraph).replace("hr",x.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",x.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",x._tag).getRegex();x.pedantic=oe({},x.normal,{html:q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",x._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:Ge,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:q(x.normal._paragraph).replace("hr",x.hr).replace("heading",` *#{1,6} *[^
|
||
]`).replace("lheading",x.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const k={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ge,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:Ge,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};k._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";k.punctuation=q(k.punctuation).replace(/punctuation/g,k._punctuation).getRegex();k.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;k.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;k._comment=q(x._comment).replace("(?:-->|$)","-->").getRegex();k.emStrong.lDelim=q(k.emStrong.lDelim).replace(/punct/g,k._punctuation).getRegex();k.emStrong.rDelimAst=q(k.emStrong.rDelimAst,"g").replace(/punct/g,k._punctuation).getRegex();k.emStrong.rDelimUnd=q(k.emStrong.rDelimUnd,"g").replace(/punct/g,k._punctuation).getRegex();k._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;k._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;k._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])?)+(?![-_])/;k.autolink=q(k.autolink).replace("scheme",k._scheme).replace("email",k._email).getRegex();k._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;k.tag=q(k.tag).replace("comment",k._comment).replace("attribute",k._attribute).getRegex();k._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;k._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;k._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;k.link=q(k.link).replace("label",k._label).replace("href",k._href).replace("title",k._title).getRegex();k.reflink=q(k.reflink).replace("label",k._label).replace("ref",x._label).getRegex();k.nolink=q(k.nolink).replace("ref",x._label).getRegex();k.reflinkSearch=q(k.reflinkSearch,"g").replace("reflink",k.reflink).replace("nolink",k.nolink).getRegex();k.normal=oe({},k);k.pedantic=oe({},k.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",k._label).getRegex(),reflink:q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",k._label).getRegex()});k.gfm=oe({},k.normal,{escape:q(k.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.!#$%&'*+\/=?_`{\|}~-]+@)))/});k.gfm.url=q(k.gfm.url,"i").replace("email",k.gfm._extended_email).getRegex();k.breaks=oe({},k.gfm,{br:q(k.br).replace("{2,}","*").getRegex(),text:q(k.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function zn(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 xt(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 ge{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Le,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:x.normal,inline:k.normal};this.options.pedantic?(n.block=x.pedantic,n.inline=k.pedantic):this.options.gfm&&(n.block=x.gfm,this.options.breaks?n.inline=k.breaks:n.inline=k.gfm),this.tokenizer.rules=n}static get rules(){return{block:x,inline:k}}static lex(t,n){return new ge(n).lex(t)}static lexInline(t,n){return new ge(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,h)=>c+" ".repeat(h.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 h;this.options.extensions.startBlock.forEach(function(o){h=o.call({lexer:this},c),typeof h=="number"&&h>=0&&(s=Math.min(s,h))}),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,h;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)+"["+yt("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)+"["+yt("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||(h=""),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,h)){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,xt)){t=t.substring(e.raw.length),n.push(e);continue}if(!this.state.inLink&&(e=this.tokenizer.url(t,xt))){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 m=t.slice(1);let w;this.options.extensions.startInline.forEach(function(p){w=p.call({lexer:this},m),typeof w=="number"&&w>=0&&(o=Math.min(o,w))}),o<1/0&&o>=0&&(r=t.substring(0,o+1))}if(e=this.tokenizer.inlineText(r,zn)){t=t.substring(e.raw.length),e.raw.slice(-1)!=="_"&&(h=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||Le}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+Q(i)+'">'+(e?t:Q(t,!0))+`</code></pre>
|
||
`:"<pre><code>"+(e?t:Q(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=kt(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=kt(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 Ht{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 pe{constructor(t){this.options=t||Le,this.options.renderer=this.options.renderer||new pt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ht,this.slugger=new Vt}static parse(t,n){return new pe(n).parse(t)}static parseInline(t,n){return new pe(n).parseInline(t)}parse(t,n=!0){let e="",i,r,a,s,c,h,o,m,w,p,A,f,d,S,R,I,C,F,P;const H=t.length;for(i=0;i<H;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,Pt(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(m="",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(m+=this.renderer.tablerow(o),w="",s=p.rows.length,r=0;r<s;r++){for(h=p.rows[r],o="",c=h.length,a=0;a<c;a++)o+=this.renderer.tablecell(this.parseInline(h[a].tokens),{header:!1,align:p.align[a]});w+=this.renderer.tablerow(o)}e+=this.renderer.table(m,w);continue}case"blockquote":{w=this.parse(p.tokens),e+=this.renderer.blockquote(w);continue}case"list":{for(A=p.ordered,f=p.start,d=p.loose,s=p.items.length,w="",r=0;r<s;r++)R=p.items[r],I=R.checked,C=R.task,S="",R.task&&(F=this.renderer.checkbox(I),d?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,d),w+=this.renderer.listitem(S,C,I);e+=this.renderer.list(w,A,f);continue}case"html":{e+=this.renderer.html(p.text);continue}case"paragraph":{e+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(w=p.tokens?this.parseInline(p.tokens):p.text;i+1<H&&t[i+1].type==="text";)p=t[++i],w+=`
|
||
`+(p.tokens?this.parseInline(p.tokens):p.text);e+=n?this.renderer.paragraph(w):w;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}}function $(l,t,n){if(typeof l>"u"||l===null)throw new Error("marked(): input parameter is undefined or null");if(typeof l!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected");if(typeof t=="function"&&(n=t,t=null),t=oe({},$.defaults,t||{}),Nt(t),n){const i=t.highlight;let r;try{r=ge.lex(l,t)}catch(c){return n(c)}const a=function(c){let h;if(!c)try{t.walkTokens&&$.walkTokens(r,t.walkTokens),h=pe.parse(r,t)}catch(o){c=o}return t.highlight=i,c?n(c):n(null,h)};if(!i||i.length<3||(delete t.highlight,!r.length))return a();let s=0;$.walkTokens(r,function(c){c.type==="code"&&(s++,setTimeout(()=>{i(c.text,c.lang,function(h,o){if(h)return a(h);o!=null&&o!==c.text&&(c.text=o,c.escaped=!0),s--,s===0&&a()})},0))}),s===0&&a();return}function e(i){if(i.message+=`
|
||
Please report this to https://github.com/markedjs/marked.`,t.silent)return"<p>An error occurred:</p><pre>"+Q(i.message+"",!0)+"</pre>";throw i}try{const i=ge.lex(l,t);if(t.walkTokens){if(t.async)return Promise.all($.walkTokens(i,t.walkTokens)).then(()=>pe.parse(i,t)).catch(e);$.walkTokens(i,t.walkTokens)}return pe.parse(i,t)}catch(i){e(i)}}$.options=$.setOptions=function(l){return oe($.defaults,l),hn($.defaults),$};$.getDefaults=Dt;$.defaults=Le;$.use=function(...l){const t=$.defaults.extensions||{renderers:{},childTokens:{}};l.forEach(n=>{const e=oe({},n);if(e.async=$.defaults.async||e.async,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=$.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=$.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.walkTokens){const i=$.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}}$.setOptions(e)})};$.walkTokens=function(l,t){let n=[];for(const e of l)switch(n=n.concat(t.call($,e)),e.type){case"table":{for(const i of e.header)n=n.concat($.walkTokens(i.tokens,t));for(const i of e.rows)for(const r of i)n=n.concat($.walkTokens(r.tokens,t));break}case"list":{n=n.concat($.walkTokens(e.items,t));break}default:$.defaults.extensions&&$.defaults.extensions.childTokens&&$.defaults.extensions.childTokens[e.type]?$.defaults.extensions.childTokens[e.type].forEach(function(i){n=n.concat($.walkTokens(e[i],t))}):e.tokens&&(n=n.concat($.walkTokens(e.tokens,t)))}return n};$.parseInline=function(l,t){if(typeof l>"u"||l===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof l!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected");t=oe({},$.defaults,t||{}),Nt(t);try{const n=ge.lexInline(l,t);return t.walkTokens&&$.walkTokens(n,t.walkTokens),pe.parseInline(n,t)}catch(n){if(n.message+=`
|
||
Please report this to https://github.com/markedjs/marked.`,t.silent)return"<p>An error occurred:</p><pre>"+Q(n.message+"",!0)+"</pre>";throw n}};$.Parser=pe;$.parser=pe.parse;$.Renderer=pt;$.TextRenderer=Ht;$.Lexer=ge;$.lexer=ge.lex;$.Tokenizer=ut;$.Slugger=Vt;$.parse=$;$.options;$.setOptions;$.use;$.walkTokens;$.parseInline;pe.parse;ge.lex;const $t=({size:l})=>N("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:l,height:l},[N("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"}),N("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"})]),Rn=()=>N("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},N("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"})),Sn=()=>N("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},N("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"})),Ln=()=>N("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[N("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"}),N("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"})]),In=({active:l=!1})=>N("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[N("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"})]),En=()=>N("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[N("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"}),N("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"})]),An=()=>N("svg",{width:"16",height:"16",ariaHidden:"true"},N("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"})),Tn=()=>N("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},N("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"})),jn=()=>N("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},N("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"})),Un=()=>N("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},N("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"})),De=({size:l})=>N("svg",{width:l,height:l,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},N("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},N("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Mn=()=>N("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[N("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"}),N("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"})]),Ft={"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},Ct=({serverURL:l,lang:t,path:n,type:e,action:i})=>fetch(`${l}/article?lang=${t}`,{method:"POST",headers:Ft,body:JSON.stringify({path:n,type:e,action:i})}).then(r=>r.json()),Ke=({serverURL:l,lang:t,token:n,objectId:e,comment:i})=>fetch(`${l}/comment/${e}?lang=${t}`,{method:"PUT",headers:{...Ft,Authorization:`Bearer ${n}`},body:JSON.stringify(i)}).then(r=>r.json()).then(r=>st(r,"Update comment"));let _t=null;const Wt=()=>_t||(_t=Se("WALINE_LIKE",[]));let zt=null;const Dn=()=>zt??(zt=Se("WALINE_REACTION",{}));var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},qt={},Re={},Oe={},On=Qe&&Qe.__awaiter||function(l,t,n,e){return new(n||(n=Promise))(function(i,r){function a(h){try{c(e.next(h))}catch(o){r(o)}}function s(h){try{c(e.throw(h))}catch(o){r(o)}}function c(h){var o;h.done?i(h.value):(o=h.value,o instanceof n?o:new n(function(m){m(o)})).then(a,s)}c((e=e.apply(l,t||[])).next())})},Bn=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(h){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(m){o=[6,m],e=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([c,h])}}};Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.ReCaptchaInstance=void 0;var Pn=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 On(this,void 0,void 0,function(){return Bn(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}();Oe.ReCaptchaInstance=Pn,Object.defineProperty(Re,"__esModule",{value:!0}),Re.getInstance=Re.load=void 0;var fe,Nn=Oe;(function(l){l[l.NOT_LOADED=0]="NOT_LOADED",l[l.LOADING=1]="LOADING",l[l.LOADED=2]="LOADED"})(fe||(fe={}));var Rt=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()===fe.LOADED)return l.instance.getSiteKey()===t?Promise.resolve(l.instance):Promise.reject(new Error("reCAPTCHA already loaded with different site key!"));if(l.getLoadingState()===fe.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(fe.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(fe.LOADED);var a=e.doExplicitRender(grecaptcha,t,n.explicitRenderParameters?n.explicitRenderParameters:{},n.useEnterprise||!1),s=new Nn.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?fe.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 h=this.buildQueryString(i);return s.src=c+"?render=explicit"+h,new Promise(function(o,m){s.addEventListener("load",a.waitForScriptToLoad(function(){o(s)},e),!1),s.onerror=function(w){l.setLoadingState(fe.NOT_LOADED),m(w)},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=Rt.load,Re.getInstance=Rt.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=Oe;Object.defineProperty(l,"ReCaptchaInstance",{enumerable:!0,get:function(){return n.ReCaptchaInstance}})}(qt);const St={};let Lt=null;const ht=()=>Lt??(Lt=Se("WALINE_USER",{})),Hn={key:0,class:"wl-reaction"},Vn=["textContent"],Fn={class:"wl-reaction-list"},Wn=["onClick"],qn={class:"wl-reaction-img"},Zn=["src","alt"],Kn=["textContent"],Gn=["textContent"];var Qn=Be({__name:"ArticleReaction",setup(l,{expose:t}){t();const n=Dn(),e=ct("config"),i=M(-1),r=M([]),a=Y(()=>e.value.locale),s=Y(()=>e.value.reaction.length>0),c=Y(()=>{const{reaction:m,path:w}=e.value;return m.map((p,A)=>({icon:p,desc:a.value[`reaction${A}`],active:n.value[w]===A}))});let h;const o=async()=>{if(s.value){const{serverURL:m,lang:w,path:p,reaction:A}=e.value,f=new AbortController;h=f.abort.bind(f);const d=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:m,lang:w,paths:[p],type:A.map((S,R)=>`reaction${R}`),signal:f.signal});if(Array.isArray(d)||typeof d=="number")return;r.value=A.map((S,R)=>d[`reaction${R}`])}};return Ye(()=>{ve(()=>[e.value.serverURL,e.value.path],()=>{o()},{immediate:!0})}),ot(()=>h==null?void 0:h()),(m,w)=>u(c).length?(g(),y("div",Hn,[z("div",{class:"wl-reaction-title",textContent:D(u(a).reactionTitle)},null,8,Vn),z("ul",Fn,[(g(!0),y(te,null,se(u(c),({active:p,icon:A,desc:f},d)=>(g(),y("li",{key:d,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 Ct({serverURL:I,lang:C,path:F,type:`reaction${P}`,action:"desc"}),r.value[P]=Math.max(r.value[P]-1,0)),P!==R&&(await Ct({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}})(d)},[z("div",qn,[z("img",{src:A,alt:f},null,8,Zn),i.value===d?(g(),Ce(u(De),{key:0,class:"wl-reaction-loading"})):(g(),y("div",{key:1,class:"wl-reaction-votes",textContent:D(r.value[d]||0)},null,8,Kn))]),z("div",{class:"wl-reaction-text",textContent:D(f)},null,8,Gn)],10,Wn))),128))])])):U("v-if",!0)}}),Pe=(l,t)=>{const n=l.__vccOpts||l;for(const[e,i]of t)n[e]=i;return n},Yn=Pe(Qn,[["__file","ArticleReaction.vue"]]);const Xn=["data-index"],Jn=["src","title","onClick"];var ei=Pe(Be({__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 m=Math.floor((i.value.getBoundingClientRect().width+n.gap)/(n.columnWidth+n.gap));return m>0?m:1},c=async m=>{var p;if(m>=n.items.length)return;await ln();const w=Array.from(((p=i.value)==null?void 0:p.children)||[]).reduce((A,f)=>f.getBoundingClientRect().height<A.getBoundingClientRect().height?f:A);a.value[Number(w.dataset.index)].push(m),await c(m+1)},h=async(m=!1)=>{if(a.value.length===s()&&!m)return;var w;a.value=(w=s(),new Array(w).fill(null).map(()=>[]));const p=window.scrollY;await c(0),window.scrollTo({top:p})},o=m=>{r.value[m.target.src]=!0};return Ye(()=>{h(!0),e=new ResizeObserver(()=>{h()}),e.observe(i.value),ve(()=>[n.items],()=>{r.value={},h(!0)}),ve(()=>[n.columnWidth,n.gap],()=>{h()})}),Xt(()=>e.unobserve(i.value)),(m,w)=>(g(),y("div",{ref_key:"wall",ref:i,class:"wl-gallery",style:gt({gap:`${l.gap}px`})},[(g(!0),y(te,null,se(a.value,(p,A)=>(g(),y("div",{key:A,class:"wl-gallery-column","data-index":A,style:gt({gap:`${l.gap}px`})},[(g(!0),y(te,null,se(p,f=>(g(),y(te,{key:f},[r.value[l.items[f].src]?U("v-if",!0):(g(),Ce(u(De),{key:0,size:36,style:{margin:"20px auto"}})),z("img",{class:"wl-gallery-item",src:l.items[f].src,title:l.items[f].title,loading:"lazy",onLoad:o,onClick:d=>m.$emit("insert",``)},null,40,Jn)],64))),128))],12,Xn))),128))],4))}}),[["__file","ImageWall.vue"]]);const ti=["nick","mail","link"],It=l=>l.filter(t=>ti.includes(t)),Et=["//unpkg.com/@waline/emojis@1.1.0/weibo"],ni=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}),ii=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>',li=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()})}},ri=["//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"],ai=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"),At=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],Je={},si=l=>{let t=0;return l.replace(ai,(n,e,i)=>{if(i)return`<span style="color: slategray">${i}</span>`;if(e==="<")return"<";let r;Je[e]?r=Je[e]:(r=At[t],Je[e]=r);const a=`<span style="color: #${r}">${e}</span>`;return t=++t%At.length,a})},oi=["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"],Ie=l=>Object.fromEntries(l.map((t,n)=>[oi[n],t]));var et=Ie(["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?"]),qe=Ie(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません!
|
||
現在の単語番号: $2`,"匿名","うえにん","なかにん","しもおし","特にしもおし","かげ","なぬし","GIF","探す GIF","個人情報","承認済み","待っている","スパム","べたつかない","逆順","正順","人気順","どう思いますか?"]),tt=Ie(["昵称","昵称不能少于3个字符","邮箱","请填写正确的邮件地址","网址","可选","欢迎评论","来发评论吧~","提交","喜欢","取消喜欢","回复","取消回复","评论","刷新","加载更多...","预览","表情","上传图片","秒前","分钟前","小时前","天前","刚刚","正在上传","登录","退出","博主","置顶","字",`评论字数应在 $0 到 $1 字之间!
|
||
当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),Tt=Ie(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎評論","來發評論吧~","提交","喜歡","取消喜歡","回覆","取消回覆","評論","刷新","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登錄","退出","博主","置頂","字",`評論字數應在 $0 到 $1 字之間!
|
||
當前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","話癆","傳說","表情包","搜索表情包","個人資料","通過","待審核","垃圾","取消置頂","按倒序","按正序","按熱度","你認為這篇文章怎麼樣?"]),jt=Ie(["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=Ie(["Псевдоним","Никнейм не может быть меньше 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":Tt,"zh-TW":Tt,en:et,"en-US":et,"en-us":et,jp:qe,ja:qe,"jp-jp":qe,"jp-JP":qe,"pt-br":jt,"pt-BR":jt,ru:nt,"ru-ru":nt,"ru-RU":nt},ci=l=>{try{l=decodeURI(l)}catch{}return l},Zt=(l="")=>l.replace(/\/$/u,""),Kt=l=>/^(https?:)?\/\//.test(l),ui=l=>{const t=Zt(l);return Kt(t)?t:`https://${t}`},pi=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},hi=(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,h=Math.floor(c/6e4);if(h===0){const o=c%6e4;return`${Math.round(o/1e3)} ${n.seconds}`}return`${h} ${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)},di=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})},Ut=(l,t="",n="",e="")=>`${t?`${t}/`:""}${n}${l}${e?`.${e}`:""}`,gi=l=>l.type.includes("image"),Mt=l=>{const t=Array.from(l).find(gi);return t?t.getAsFile():null},mi=/\$.*?\$/,fi=/^\$(.*?)\$/,vi=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,Gt=(l="",t={})=>l.replace(/:(.+?):/g,(n,e)=>t[e]?`<img class="wl-emoji" src="${t[e]}" alt="${e}">`:n),ki=(l,{emojiMap:t,highlighter:n,texRenderer:e})=>{if($.setOptions({highlight:n||void 0,breaks:!0,smartLists:!0,smartypants:!0}),e){const i=(r=>[{name:"blockMath",level:"block",tokenizer(a){const s=vi.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(mi);return s!==-1?s:a.length},tokenizer(a){const s=fi.exec(a);if(s!==null)return{type:"html",raw:s[0],text:r(!1,s[1])}}}])(e);$.use({extensions:i})}return $.parse(Gt(l,t))},wi={class:"wl-comment"},yi={key:0,class:"wl-login-info"},bi={class:"wl-avatar"},xi=["title"],$i=["title"],Ci=["src"],_i=["title","textContent"],zi={class:"wl-panel"},Ri=["for","textContent"],Si=["id","onUpdate:modelValue","name","type"],Li=["placeholder"],Ii={class:"wl-preview"},Ei=z("hr",null,null,-1),Ai=["innerHTML"],Ti={class:"wl-footer"},ji={class:"wl-actions"},Ui={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Mi=["title"],Di=["title"],Oi=["title"],Bi=["title"],Pi={class:"wl-info"},Ni={class:"wl-text-number"},Hi={key:0},Vi=["textContent"],Fi=["textContent"],Wi=["disabled"],qi=["placeholder"],Zi={key:0,class:"wl-loading"},Ki={key:0,class:"wl-tab-wrapper"},Gi=["title","onClick"],Qi=["src","alt"],Yi={key:0,class:"wl-tabs"},Xi=["onClick"],Ji=["src","alt","title"],el=["title"];var tl=Be({__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({}),h=M(null),o=M(null),m=M(null),w=M(null),p=M(null),A=M(null),f=M(null),d=M({tabs:[],map:{}}),S=M(0),R=M(!1),I=M(!1),C=M(!1),F=M(""),P=M(0),H=Jt({loading:!0,list:[]}),ie=M(0),me=M(!1),Ne=M(""),ke=M(!1),L=M(!1),T=Y(()=>i.value.locale),O=Y(()=>{var b;return Boolean((b=s.value)==null?void 0:b.token)}),K=Y(()=>i.value.imageUploader!==!1),W=b=>{const v=h.value,E=v.selectionStart,B=v.selectionEnd||0,_=v.scrollTop;r.value=v.value.substring(0,E)+b+v.value.substring(B,v.value.length),v.focus(),v.selectionStart=E+b.length,v.selectionEnd=E+b.length,v.scrollTop=_},ne=b=>{const v=b.key;(b.ctrlKey||b.metaKey)&&v==="Enter"&&_e()},G=b=>{const v=`![${i.value.locale.uploading} ${b.name}]()`;return W(v),Promise.resolve().then(()=>i.value.imageUploader(b)).then(E=>{r.value=r.value.replace(v,`\r
|
||
`)}).catch(E=>{alert(E.message),r.value=r.value.replace(v,"")})},re=b=>{var v;if((v=b.dataTransfer)!=null&&v.items){const E=Mt(b.dataTransfer.items);E&&K.value&&(G(E),b.preventDefault())}},ce=b=>{if(b.clipboardData){const v=Mt(b.clipboardData.items);v&&K.value&&G(v)}},we=()=>{const b=o.value;b.files&&K.value&&G(b.files[0]).then(()=>{b.value=""})},_e=async()=>{var de,ae,Ve,Te,je;const{serverURL:b,lang:v,login:E,wordLimit:B,requiredMeta:_}=i.value;let V="";i.value.recaptchaV3Key&&(V=await(J=>{const le=St[J]??(St[J]=qt.load(J,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:xe=>le.then(Xe=>Xe.execute(xe))}})(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:xe}=await J.getHighEntropyValues(["platformVersion"]);return xe&&parseInt(xe.split(".")[0])>=13&&(le=le.replace("Windows NT 10.0","Windows NT 11.0")),le})(),j={comment:Ne.value,nick:a.value.nick,mail:a.value.mail,link:a.value.link,url:i.value.path,recaptchaV3:V,ua:Z};if((de=s.value)!=null&&de.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(Ve=c.value.mail)==null||Ve.focus(),alert(T.value.mailError);if(!j.comment)return void((Te=h.value)==null?void 0:Te.focus());j.nick||(j.nick=T.value.anonymous)}if(!me.value)return alert(T.value.wordHint.replace("$0",B[0].toString()).replace("$1",B[1].toString()).replace("$2",P.value.toString()));j.comment=Gt(j.comment,d.value.map),e.replyId&&e.rootId&&(j.pid=e.replyId,j.rid=e.rootId,j.at=e.replyUser),ke.value=!0;const he={serverURL:b,lang:v,token:(je=s.value)==null?void 0:je.token,comment:j};(e.edit?Ke({objectId:e.edit.objectId,...he}):(({serverURL:J,lang:le,token:xe,comment:Xe})=>{const dt={"Content-Type":"application/json"};return xe&&(dt.Authorization=`Bearer ${xe}`),fetch(`${J}/comment?lang=${le}`,{method:"POST",headers:dt,body:JSON.stringify(Xe)}).then(Yt=>Yt.json())})(he)).then(J=>{var le;if(ke.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=>{ke.value=!1,alert(J.message)})},Ee=b=>{b.preventDefault();const{lang:v,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(he=>{const de=({data:ae})=>{ae&&typeof ae=="object"&&ae.type==="userInfo"&&ae.data.token&&(j==null||j.close(),window.removeEventListener("message",de),he(ae.data))};window.addEventListener("message",de)})})({serverURL:E,lang:v}).then(B=>{s.value=B,(B.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(B)),n("log")})},Ae=()=>{s.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),n("log")},ye=b=>{b.preventDefault();const{lang:v,serverURL:E}=i.value,B=(window.innerWidth-800)/2,_=(window.innerHeight-800)/2,V=new URLSearchParams({lng:v,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},"*")},be=b=>{var v,E,B,_;(v=m.value)!=null&&v.contains(b.target)||(E=w.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)},ue=async b=>{var j;const{scrollTop:v,clientHeight:E,scrollHeight:B}=b.target,_=(E+v)/B,V=i.value.search,Z=((j=f.value)==null?void 0:j.value)||"";_<.9||H.loading||L.value||(H.loading=!0,(V.more&&H.list.length?await V.more(Z,H.list.length):await V.search(Z)).length?H.list=[...H.list,...V.more&&H.list.length?await V.more(Z,H.list.length):await V.search(Z)]:L.value=!0,H.loading=!1,setTimeout(()=>{b.target.scrollTop=v},50))},ze=sn(b=>{H.list=[],L.value=!1,ue(b)},300);ve([i,P],([b,v])=>{const{wordLimit:E}=b;E?v<E[0]&&E[0]!==0?(ie.value=E[0],me.value=!1):v>E[1]?(ie.value=E[1],me.value=!1):(ie.value=E[1],me.value=!0):(ie.value=0,me.value=!0)},{immediate:!0});const He=({data:b})=>{b&&b.type==="profile"&&(s.value={...s.value,...b.data},[localStorage,sessionStorage].filter(v=>v.getItem("WALINE_USER")).forEach(v=>v.setItem("WALINE_USER",JSON.stringify(s))))};return Ye(()=>{var b;document.body.addEventListener("click",be),window.addEventListener("message",He),(b=e.edit)!=null&&b.objectId&&(r.value=e.edit.orig),ve(I,async v=>{if(!v)return;const E=i.value.search;f.value&&(f.value.value=""),H.loading=!0,H.list=E.default?await E.default():await E.search(""),H.loading=!1}),ve(()=>r.value,v=>{const{highlighter:E,texRenderer:B}=i.value;Ne.value=v,F.value=ki(v,{emojiMap:d.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,he)=>j+(he.trim()===""?0:he.trim().split(/\s+/u).length),0))||0)+(((Z=(j=>j.match(/[\u4E00-\u9FD5]/gu))(_))==null?void 0:Z.length)||0)})(v),v?ft(h.value):ft.destroy(h.value)},{immediate:!0}),ve(()=>i.value.emoji,v=>{return(E=v,Promise.all(E.map(B=>typeof B=="string"?di(Zt(B)):Promise.resolve(B))).then(B=>{const _={tabs:[],map:{}};return B.forEach(V=>{const{name:Z,folder:j,icon:he,prefix:de,type:ae,items:Ve}=V;_.tabs.push({name:Z,icon:Ut(he,j,de,ae),items:Ve.map(Te=>{const je=`${de||""}${Te}`;return _.map[je]=Ut(Te,j,de,ae),je})})}),_})).then(B=>{d.value=B});var E},{immediate:!0})}),ot(()=>{document.body.removeEventListener("click",be),window.removeEventListener("message",He)}),(b,v)=>{var E,B;return g(),y("div",wi,[u(i).login!=="disable"&&u(O)&&!((E=l.edit)!=null&&E.objectId)?(g(),y("div",yi,[z("div",bi,[z("button",{type:"submit",class:"wl-logout-btn",title:u(T).logout,onClick:Ae},[X(u($t),{size:14})],8,xi),z("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:u(T).profile,onClick:ye},[z("img",{src:u(s).avatar,alt:"avatar"},null,8,Ci)],8,$i)]),z("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:u(T).profile,onClick:ye,textContent:D(u(s).display_name)},null,8,_i)])):U("v-if",!0),z("div",zi,[u(i).login!=="force"&&u(i).meta.length&&!u(O)?(g(),y("div",{key:0,class:ee(["wl-header",`item${u(i).meta.length}`])},[(g(!0),y(te,null,se(u(i).meta,_=>(g(),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,Ri),Fe(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,Si),[[nn,u(a)[_]]])]))),128))],2)):U("v-if",!0),Fe(z("textarea",{id:"wl-edit",ref_key:"editorRef",ref:h,"onUpdate:modelValue":v[0]||(v[0]=_=>tn(r)?r.value=_:null),class:"wl-editor",placeholder:l.replyUser?`@${l.replyUser}`:u(T).placeholder,onKeydown:ne,onDrop:re,onPaste:ce},null,40,Li),[[en,u(r)]]),Fe(z("div",Ii,[Ei,z("h4",null,D(u(T).preview)+":",1),z("div",{class:"wl-content",innerHTML:F.value},null,8,Ai)],512),[[mt,C.value]]),z("div",Ti,[z("div",ji,[z("a",Ui,[X(u(An))]),Fe(z("button",{ref_key:"emojiButtonRef",ref:m,type:"button",class:ee(["wl-action",{active:R.value}]),title:u(T).emoji,onClick:v[1]||(v[1]=_=>R.value=!R.value)},[X(u(Sn))],10,Mi),[[mt,d.value.tabs.length]]),u(i).search?(g(),y("button",{key:0,ref_key:"gifButtonRef",ref:p,type:"button",class:ee(["wl-action",{active:I.value}]),title:u(T).gif,onClick:v[2]||(v[2]=_=>I.value=!I.value)},[X(u(Mn))],10,Di)):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:we},null,544),u(K)?(g(),y("label",{key:1,for:"wl-image-upload",class:"wl-action",title:u(T).uploadImage},[X(u(Ln))],8,Oi)):U("v-if",!0),z("button",{type:"button",class:ee(["wl-action",{active:C.value}]),title:u(T).preview,onClick:v[3]||(v[3]=_=>C.value=!C.value)},[X(u(En))],10,Bi)]),z("div",Pi,[z("div",Ni,[$e(D(P.value)+" ",1),u(i).wordLimit?(g(),y("span",Hi,[$e(" / "),z("span",{class:ee({illegal:!me.value}),textContent:D(ie.value)},null,10,Vi)])):U("v-if",!0),$e(" "+D(u(T).word),1)]),u(i).login==="disable"||u(O)?U("v-if",!0):(g(),y("button",{key:0,type:"button",class:"wl-btn",onClick:Ee,textContent:D(u(T).login)},null,8,Fi)),u(i).login!=="force"||u(O)?(g(),y("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:ke.value,onClick:_e},[ke.value?(g(),Ce(u(De),{key:0,size:16})):(g(),y(te,{key:1},[$e(D(u(T).submit),1)],64))],8,Wi)):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:f,type:"text",placeholder:u(T).gifSearchPlaceholder,onInput:v[4]||(v[4]=(..._)=>u(ze)&&u(ze)(..._))},null,40,qi),X(ei,{items:H.list,"column-width":200,gap:6,onInsert:v[5]||(v[5]=_=>W(_)),onScroll:ue},null,8,["items"]),H.loading?(g(),y("div",Zi,[X(u(De),{size:30})])):U("v-if",!0)],2),z("div",{ref_key:"emojiPopupRef",ref:w,class:ee(["wl-emoji-popup",{display:R.value}])},[(g(!0),y(te,null,se(d.value.tabs,(_,V)=>(g(),y(te,{key:_.name},[V===S.value?(g(),y("div",Ki,[(g(!0),y(te,null,se(_.items,Z=>(g(),y("button",{key:Z,type:"button",title:Z,onClick:j=>W(`:${Z}:`)},[R.value?(g(),y("img",{key:0,class:"wl-emoji",src:d.value.map[Z],alt:Z,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Qi)):U("v-if",!0)],8,Gi))),128))])):U("v-if",!0)],64))),128)),d.value.tabs.length>1?(g(),y("div",Yi,[(g(!0),y(te,null,se(d.value.tabs,(_,V)=>(g(),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,Ji)],10,Xi))),128))])):U("v-if",!0)],2)])]),l.replyId||(B=l.edit)!=null&&B.objectId?(g(),y("button",{key:1,type:"button",class:"wl-close",title:u(T).cancelReply,onClick:v[6]||(v[6]=_=>b.$emit(l.replyId?"cancelReply":"cancelEdit"))},[X(u($t),{size:24})],8,el)):U("v-if",!0)])}}}),Qt=Pe(tl,[["__file","CommentBox.vue"]]);const nl=["id"],il={class:"wl-user","aria-hidden":"true"},ll=["src"],rl={class:"wl-card"},al={class:"wl-head"},sl=["href"],ol={key:1,class:"wl-nick"},cl=["textContent"],ul=["textContent"],pl=["textContent"],hl=["textContent"],dl=["textContent"],gl={class:"wl-comment-actions"},ml=["title"],fl=["textContent"],vl=["title"],kl={class:"wl-meta","aria-hidden":"true"},wl=["data-value","textContent"],yl=["data-value","textContent"],bl=["data-value","textContent"],xl=["innerHTML"],$l={key:1,class:"wl-admin-actions"},Cl={class:"wl-comment-status"},_l=["disabled","onClick","textContent"],zl={key:3,class:"wl-quote"};var Rl=Pe(Be({__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=Wt(),r=on(),a=ht(),s=Y(()=>e.value.locale),c=Y(()=>{const{link:f}=t.comment;return f?Kt(f)?f:`https://${f}`:""}),h=Y(()=>i.value.includes(t.comment.objectId)),o=Y(()=>hi(t.comment.insertedAt,r.value,s.value)),m=Y(()=>a.value.type==="administrator"),w=Y(()=>t.comment.user_id&&a.value.objectId===t.comment.user_id),p=Y(()=>{var f;return t.comment.objectId===((f=t.reply)==null?void 0:f.objectId)}),A=Y(()=>{var f;return t.comment.objectId===((f=t.edit)==null?void 0:f.objectId)});return(f,d)=>{var R;const S=rn("CommentCard",!0);return g(),y("div",{id:l.comment.objectId,class:"wl-card-item"},[z("div",il,[l.comment.avatar?(g(),y("img",{key:0,src:l.comment.avatar},null,8,ll)):U("v-if",!0),l.comment.type?(g(),Ce(u(Un),{key:1})):U("v-if",!0)]),z("div",rl,[z("div",al,[u(c)?(g(),y("a",{key:0,class:"wl-nick",href:u(c),target:"_blank",rel:"noopener noreferrer"},D(l.comment.nick),9,sl)):(g(),y("span",ol,D(l.comment.nick),1)),l.comment.type==="administrator"?(g(),y("span",{key:2,class:"wl-badge",textContent:D(u(s).admin)},null,8,cl)):U("v-if",!0),l.comment.label?(g(),y("span",{key:3,class:"wl-badge",textContent:D(l.comment.label)},null,8,ul)):U("v-if",!0),l.comment.sticky?(g(),y("span",{key:4,class:"wl-badge",textContent:D(u(s).sticky)},null,8,pl)):U("v-if",!0),l.comment.level!==void 0&&l.comment.level>=0?(g(),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,hl)):U("v-if",!0),z("span",{class:"wl-time",textContent:D(u(o))},null,8,dl),z("div",gl,[u(m)||u(w)?(g(),y("button",{key:0,type:"button",class:"wl-edit",onClick:d[0]||(d[0]=()=>f.$emit("edit",l.comment))},[X(u(jn))])):U("v-if",!0),u(m)||u(w)?(g(),y("button",{key:1,type:"button",class:"wl-delete",onClick:d[1]||(d[1]=I=>f.$emit("delete",l.comment))},[X(u(Rn))])):U("v-if",!0),z("button",{type:"button",class:"wl-like",title:u(h)?u(s).cancelLike:u(s).like,onClick:d[2]||(d[2]=I=>f.$emit("like",l.comment))},[X(u(In),{active:u(h)},null,8,["active"]),"like"in l.comment?(g(),y("span",{key:0,textContent:D(l.comment.like)},null,8,fl)):U("v-if",!0)],8,ml),z("button",{type:"button",class:ee(["wl-reply",{active:u(p)}]),title:u(p)?u(s).cancelReply:u(s).reply,onClick:d[3]||(d[3]=I=>f.$emit("reply",u(p)?null:l.comment))},[X(u(Tn))],10,vl)])]),z("div",kl,[l.comment.addr?(g(),y("span",{key:0,class:"wl-addr","data-value":l.comment.addr,textContent:D(l.comment.addr)},null,8,wl)):U("v-if",!0),l.comment.browser?(g(),y("span",{key:1,class:"wl-browser","data-value":l.comment.browser,textContent:D(l.comment.browser)},null,8,yl)):U("v-if",!0),l.comment.os?(g(),y("span",{key:2,class:"wl-os","data-value":l.comment.os,textContent:D(l.comment.os)},null,8,bl)):U("v-if",!0)]),u(A)?U("v-if",!0):(g(),y("div",{key:0,class:"wl-content",innerHTML:l.comment.comment},null,8,xl)),u(m)&&!u(A)?(g(),y("div",$l,[z("span",Cl,[(g(),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=>f.$emit("status",{status:I,comment:l.comment}),textContent:D(u(s)[I])},null,10,_l)),64))]),u(m)&&!l.comment.rid?(g(),y("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:d[4]||(d[4]=I=>f.$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)?(g(),y("div",{key:2,class:ee({"wl-reply-wrapper":u(p),"wl-edit-wrapper":u(A)})},[X(Qt,{edit:l.edit,"reply-id":(R=l.reply)==null?void 0:R.objectId,"reply-user":l.comment.nick,"root-id":l.rootId,onLog:d[5]||(d[5]=I=>f.$emit("log")),onCancelReply:d[6]||(d[6]=I=>f.$emit("reply",null)),onCancelEdit:d[7]||(d[7]=I=>f.$emit("edit",null)),onSubmit:d[8]||(d[8]=I=>f.$emit("submit",I))},null,8,["edit","reply-id","reply-user","root-id"])],2)):U("v-if",!0),l.comment.children?(g(),y("div",zl,[(g(!0),y(te,null,se(l.comment.children,I=>(g(),Ce(S,{key:I.objectId,comment:I,reply:l.reply,edit:l.edit,"root-id":l.rootId,onLog:d[9]||(d[9]=C=>f.$emit("log")),onDelete:d[10]||(d[10]=C=>f.$emit("delete",C)),onEdit:d[11]||(d[11]=C=>f.$emit("edit",C)),onLike:d[12]||(d[12]=C=>f.$emit("like",C)),onReply:d[13]||(d[13]=C=>f.$emit("reply",C)),onStatus:d[14]||(d[14]=C=>f.$emit("status",C)),onSticky:d[15]||(d[15]=C=>f.$emit("sticky",C)),onSubmit:d[16]||(d[16]=C=>f.$emit("submit",C))},null,8,["comment","reply","edit","root-id"]))),128))])):U("v-if",!0)])],8,nl)}}}),[["__file","CommentCard.vue"]]);const Sl="2.14.8",Ll={"data-waline":""},Il={class:"wl-meta-head"},El={class:"wl-count"},Al=["textContent"],Tl={class:"wl-sort"},jl=["onClick"],Ul={class:"wl-cards"},Ml={key:1,class:"wl-operation"},Dl=["textContent"],Ol={key:0,class:"wl-loading"},Bl=["textContent"],Pl={key:2,class:"wl-operation"},Nl=["textContent"],Hl={key:3,class:"wl-power"},Vl=z("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);var Fl=Be({__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=Wt(),a=M("loading"),s=M(0),c=M(1),h=M(0),o=Y(()=>(({serverURL:L,path:T=location.pathname,lang:O=typeof navigator>"u"?"en-US":navigator.language,locale:K,emoji:W=Et,meta:ne=["nick","mail","link"],requiredMeta:G=[],dark:re=!1,pageSize:ce=10,wordLimit:we,imageUploader:_e,highlighter:Ee,texRenderer:Ae,copyright:ye=!0,login:be="enable",search:ue,reaction:ze,recaptchaV3Key:He="",commentSorting:b="latest",...v})=>({serverURL:ui(L),path:ci(T),locale:{...it[O]||it["en-US"],...typeof K=="object"?K:{}},wordLimit:pi(we),meta:It(ne),requiredMeta:It(G),imageUploader:lt(_e,ni),highlighter:lt(Ee,si),texRenderer:lt(Ae,ii),lang:Object.keys(it).includes(O)?O:"en-US",dark:re,emoji:typeof W=="boolean"?W?Et:[]:W,pageSize:ce,login:be,copyright:ye,search:ue!==!1&&(typeof ue=="object"?ue:li(O)),recaptchaV3Key:He,reaction:Array.isArray(ze)?ze:ze===!0?ri:[],commentSorting:b,...v}))(t)),m=M(o.value.commentSorting),w=M([]),p=M(null),A=M(null),f=Y(()=>{return typeof(L=o.value.dark)=="string"?L==="auto"?`@media(prefers-color-scheme:dark){body${rt}}`:`${L}${rt}`:L===!0?`:root${rt}`:"";var L}),d=Y(()=>o.value.locale);let S;cn(f);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:ce,page:we,pageSize:_e,sortBy:Ee,signal:Ae,token:ye})=>{const be={};return ye&&(be.Authorization=`Bearer ${ye}`),fetch(`${G}/comment?path=${encodeURIComponent(ce)}&pageSize=${_e}&page=${we}&lang=${re}&sortBy=${Ee}`,{signal:Ae,headers:be}).then(ue=>ue.json()).then(ue=>st(ue,"Get comment data"))})({serverURL:T,lang:o.value.lang,path:O,pageSize:K,sortBy:n[m.value],page:L,signal:W.signal,token:(ne=i.value)==null?void 0:ne.token}).then(G=>{a.value="success",s.value=G.count,w.value.push(...G.data),c.value=L,h.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,w.value=[],R(1)},F=L=>{p.value=L},P=L=>{A.value=L},H=L=>{if(A.value)A.value.comment=L.comment,A.value.orig=L.orig;else if(L.rid){const T=w.value.find(({objectId:O})=>O===L.rid);if(!T)return;Array.isArray(T.children)||(T.children=[]),T.children.push(L)}else w.value.unshift(L)},ie=async({comment:L,status:T})=>{var W;if(L.status===T)return;const{serverURL:O,lang:K}=o.value;await Ke({serverURL:O,lang:K,token:(W=i.value)==null?void 0:W.token,objectId:L.objectId,comment:{status:T}}),L.status=T},me=async L=>{var K;if(L.rid)return;const{serverURL:T,lang:O}=o.value;await Ke({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},Ne=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(ce=>ce.json()).then(ce=>st(ce,"Delete comment")))({serverURL:T,lang:O,token:(K=i.value)==null?void 0:K.token,objectId:L}),w.value.some((W,ne)=>W.objectId===L?(w.value=w.value.filter((G,re)=>re!==ne),!0):W.children.some((G,re)=>G.objectId===L&&(w.value[ne].children=W.children.filter((ce,we)=>we!==re),!0)))},ke=async L=>{var ne;const{serverURL:T,lang:O}=o.value,{objectId:K}=L,W=r.value.includes(K);await Ke({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 an("config",o),Ye(()=>{ve(()=>[t.serverURL,t.path],()=>C(),{immediate:!0})}),ot(()=>S==null?void 0:S()),(L,T)=>(g(),y("div",Ll,[X(Yn),p.value?U("v-if",!0):(g(),Ce(Qt,{key:0,onLog:C,onSubmit:H})),z("div",Il,[z("div",El,[s.value?(g(),y("span",{key:0,class:"wl-num",textContent:D(s.value)},null,8,Al)):U("v-if",!0),$e(" "+D(u(d).comment),1)]),z("ul",Tl,[(g(!0),y(te,null,se(u(e),O=>(g(),y("li",{key:O,class:ee([O===m.value?"active":""]),onClick:K=>(W=>{m.value!==W&&(m.value=W,C())})(O)},D(u(d)[O]),11,jl))),128))])]),z("div",Ul,[(g(!0),y(te,null,se(w.value,O=>(g(),Ce(Rl,{key:O.objectId,"root-id":O.objectId,comment:O,reply:p.value,edit:A.value,onLog:C,onReply:F,onEdit:P,onSubmit:H,onStatus:ie,onDelete:Ne,onSticky:me,onLike:ke},null,8,["root-id","comment","reply","edit"]))),128))]),a.value==="error"?(g(),y("div",Ml,[z("button",{type:"button",class:"wl-btn",onClick:C,textContent:D(u(d).refresh)},null,8,Dl)])):(g(),y(te,{key:2},[a.value==="loading"?(g(),y("div",Ol,[X(u(De),{size:30})])):w.value.length?c.value<h.value?(g(),y("div",Pl,[z("button",{type:"button",class:"wl-btn",onClick:I,textContent:D(u(d).more)},null,8,Nl)])):U("v-if",!0):(g(),y("div",{key:1,class:"wl-empty",textContent:D(u(d).sofa)},null,8,Bl))],64)),u(o).copyright?(g(),y("div",Hl,[$e(" Powered by "),Vl,$e(" v"+D(u(Sl)),1)])):U("v-if",!0)]))}}),Zl=Pe(Fl,[["__file","WalineComment.vue"]]);export{Zl as Waline,Sl as version};
|