58 lines
52 KiB
JavaScript
58 lines
52 KiB
JavaScript
import{r as G,o as ae,a as f,c as w,b as l,d as g,e as A,f as L,t as O,_ as ne,g as Ce,n as E,h as Ge,i as Oe,G as oe,j as z,w as _,T as ce,F as ue,k as he,l as F,m as Ae,u as I,p as Ze,v as je,q as We,D as pe,s as Ue,W as Qe,x as Fe,y as P,z as Ve,S as Ye}from"./index-Bsy8tbGW.js";import{L as S}from"./localeText-CoKvgn8T.js";import{d as Xe}from"./dayjs.min-fPdQmr57.js";import{M as Je}from"./message-HYNxjFjL.js";const Ke={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},et={class:"container d-flex h-100 w-100"},tt={class:"m-auto modal-dialog-centered dashboardModal"},nt={class:"card rounded-3 shadow flex-grow-1"},st={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},it={class:"mb-0"},rt={class:"card-body px-4 pb-4 d-flex flex-column gap-2"},ot={class:"card text-decoration-none",target:"_blank",role:"button",href:"https://discord.gg/72TwzjeuWm"},lt={class:"card-body d-flex gap-4 align-items-center"},at={class:"d-flex align-items-center"},ct={class:"badge rounded-pill text-bg-primary ms-2"},ut={key:0,class:"spinner-border spinner-border-sm",style:{width:"0.7rem",height:"0.7rem"}},ht={key:1},pt={class:"text-muted"},dt={class:"card text-decoration-none",href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank"},gt={class:"card-body d-flex gap-4 align-items-center"},ft={class:"mb-0"},mt={class:"text-muted"},bt={__name:"helpModal",setup(a){const e=G(!0),t=G(void 0);return ae(()=>{e.value=!0,fetch("https://discord.com/api/guilds/1276818723637956628/widget.json").then(n=>n.json()).then(n=>{t.value=n,e.value=!1}).catch(()=>{e.value=!1})}),(n,s)=>(f(),w("div",Ke,[l("div",et,[l("div",tt,[l("div",nt,[l("div",st,[l("h4",it,[g(S,{t:"Help"})]),l("button",{type:"button",class:"btn-close ms-auto",onClick:s[0]||(s[0]=r=>n.$emit("close"))})]),l("div",rt,[l("a",ot,[l("div",lt,[s[3]||(s[3]=l("h1",{class:"mb-0"},[l("i",{class:"bi bi-discord"})],-1)),l("div",null,[l("div",at,[s[2]||(s[2]=l("h5",{class:"mb-0"}," Discord Server ",-1)),l("span",ct,[e.value?(f(),w("span",ut)):A("",!0),t.value!==void 0&&!e.value?(f(),w("span",ht,[s[1]||(s[1]=l("i",{class:"bi bi-person-fill me-2"},null,-1)),L(O(t.value.presence_count)+" Online ",1)])):A("",!0)])]),l("small",pt,[g(S,{t:"Join our Discord server for quick help or chat about WGDashboard!"})])])])]),l("a",dt,[l("div",gt,[s[4]||(s[4]=l("h1",{class:"mb-0"},[l("i",{class:"bi bi-hash"})],-1)),l("div",null,[l("h5",ft,[g(S,{t:"Official Documentation"})]),l("small",mt,[g(S,{t:"Official documentation contains User Guides and more..."})])])])])])])])])]))}};function de(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let q=de();function ze(a){q=a}const Q={exec:()=>null};function m(a,e=""){let t=typeof a=="string"?a:a.source;const n={replace:(s,r)=>{let i=typeof r=="string"?r:r.source;return i=i.replace($.caret,"$1"),t=t.replace(s,i),n},getRegex:()=>new RegExp(t,e)};return n}const $={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}#`),htmlBeginRegex:a=>new RegExp(`^ {0,${Math.min(3,a-1)}}<(?:[a-z].*>|!--)`,"i")},kt=/^(?:[ \t]*(?:\n|$))+/,xt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,wt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,V=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ge=/(?:[*+-]|\d{1,9}[.)])/,Le=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Me=m(Le).replace(/bull/g,ge).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),_t=m(Le).replace(/bull/g,ge).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),fe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,vt=/^[^\n]+/,me=/(?!\s*\])(?:\\.|[^\[\]\\])+/,$t=m(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),St=m(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ge).getRegex(),se="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",be=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Tt=m("^ {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|$))","i").replace("comment",be).replace("tag",se).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Be=m(fe).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").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",se).getRegex(),Rt=m(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Be).getRegex(),ke={blockquote:Rt,code:xt,def:$t,fences:wt,heading:yt,hr:V,html:Tt,lheading:Me,list:St,newline:kt,paragraph:Be,table:Q,text:vt},_e=m("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",se).getRegex(),Ct={...ke,lheading:_t,table:_e,paragraph:m(fe).replace("hr",V).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_e).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",se).getRegex()},At={...ke,html:m(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be).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:Q,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:m(fe).replace("hr",V).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",Me).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Lt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ie=/^( {2,}|\\)\n(?!\s*$)/,Mt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ie=/[\p{P}\p{S}]/u,xe=/[\s\p{P}\p{S}]/u,Pe=/[^\s\p{P}\p{S}]/u,Bt=m(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xe).getRegex(),Ee=/(?!~)[\p{P}\p{S}]/u,It=/(?!~)[\s\p{P}\p{S}]/u,Pt=/(?:[^\s\p{P}\p{S}]|~)/u,Et=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,De=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Dt=m(De,"u").replace(/punct/g,ie).getRegex(),qt=m(De,"u").replace(/punct/g,Ee).getRegex(),qe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ht=m(qe,"gu").replace(/notPunctSpace/g,Pe).replace(/punctSpace/g,xe).replace(/punct/g,ie).getRegex(),Nt=m(qe,"gu").replace(/notPunctSpace/g,Pt).replace(/punctSpace/g,It).replace(/punct/g,Ee).getRegex(),Gt=m("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Pe).replace(/punctSpace/g,xe).replace(/punct/g,ie).getRegex(),Ot=m(/\\(punct)/,"gu").replace(/punct/g,ie).getRegex(),Zt=m(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),jt=m(be).replace("(?:-->|$)","-->").getRegex(),Wt=m("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",jt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),K=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ut=m(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",K).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),He=m(/^!?\[(label)\]\[(ref)\]/).replace("label",K).replace("ref",me).getRegex(),Ne=m(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),Qt=m("reflink|nolink(?!\\()","g").replace("reflink",He).replace("nolink",Ne).getRegex(),we={_backpedal:Q,anyPunctuation:Ot,autolink:Zt,blockSkip:Et,br:Ie,code:Lt,del:Q,emStrongLDelim:Dt,emStrongRDelimAst:Ht,emStrongRDelimUnd:Gt,escape:zt,link:Ut,nolink:Ne,punctuation:Bt,reflink:He,reflinkSearch:Qt,tag:Wt,text:Mt,url:Q},Ft={...we,link:m(/^!?\[(label)\]\((.*?)\)/).replace("label",K).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K).getRegex()},le={...we,emStrongRDelimAst:Nt,emStrongLDelim:qt,url:m(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Vt={...le,br:m(Ie).replace("{2,}","*").getRegex(),text:m(le.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:ke,gfm:Ct,pedantic:At},W={normal:we,gfm:le,breaks:Vt,pedantic:Ft},Yt={"&":"&","<":"<",">":">",'"':""","'":"'"},ve=a=>Yt[a];function C(a,e){if(e){if($.escapeTest.test(a))return a.replace($.escapeReplace,ve)}else if($.escapeTestNoEncode.test(a))return a.replace($.escapeReplaceNoEncode,ve);return a}function $e(a){try{a=encodeURI(a).replace($.percentDecode,"%")}catch{return null}return a}function Se(a,e){const t=a.replace($.findPipe,(r,i,o)=>{let c=!1,u=i;for(;--u>=0&&o[u]==="\\";)c=!c;return c?"|":" |"}),n=t.split($.splitPipe);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace($.slashPipe,"|");return n}function U(a,e,t){const n=a.length;if(n===0)return"";let s=0;for(;s<n&&a.charAt(n-s-1)===e;)s++;return a.slice(0,n-s)}function Xt(a,e){if(a.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<a.length;n++)if(a[n]==="\\")n++;else if(a[n]===e[0])t++;else if(a[n]===e[1]&&(t--,t<0))return n;return-1}function Te(a,e,t,n,s){const r=e.href,i=e.title||null,o=a[1].replace(s.other.outputLinkReplace,"$1");if(a[0].charAt(0)!=="!"){n.state.inLink=!0;const c={type:"link",raw:t,href:r,title:i,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,c}return{type:"image",raw:t,href:r,title:i,text:o}}function Jt(a,e,t){const n=a.match(t.other.indentCodeCompensation);if(n===null)return e;const s=n[1];return e.split(`
|
|
`).map(r=>{const i=r.match(t.other.beginningSpace);if(i===null)return r;const[o]=i;return o.length>=s.length?r.slice(s.length):r}).join(`
|
|
`)}class ee{options;rules;lexer;constructor(e){this.options=e||q}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:U(n,`
|
|
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=Jt(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const s=U(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:U(t[0],`
|
|
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=U(t[0],`
|
|
`).split(`
|
|
`),s="",r="";const i=[];for(;n.length>0;){let o=!1;const c=[];let u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))c.push(n[u]),o=!0;else if(!o)c.push(n[u]);else break;n=n.slice(u);const h=c.join(`
|
|
`),p=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
${h}`:h,r=r?`${r}
|
|
${p}`:p;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=k,n.length===0)break;const d=i.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){const y=d,x=y.raw+`
|
|
`+n.join(`
|
|
`),v=this.blockquote(x);i[i.length-1]=v,s=s.substring(0,s.length-y.raw.length)+v.raw,r=r.substring(0,r.length-y.text.length)+v.text;break}else if(d?.type==="list"){const y=d,x=y.raw+`
|
|
`+n.join(`
|
|
`),v=this.list(x);i[i.length-1]=v,s=s.substring(0,s.length-d.raw.length)+v.raw,r=r.substring(0,r.length-y.raw.length)+v.raw,n=x.substring(i.at(-1).raw.length).split(`
|
|
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let o=!1;for(;e;){let u=!1,h="",p="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;h=t[0],e=e.substring(h.length);let k=t[2].split(`
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,Z=>" ".repeat(3*Z.length)),d=e.split(`
|
|
`,1)[0],y=!k.trim(),x=0;if(this.options.pedantic?(x=2,p=k.trimStart()):y?x=t[1].length+1:(x=t[2].search(this.rules.other.nonSpaceChar),x=x>4?1:x,p=k.slice(x),x+=t[1].length),y&&this.rules.other.blankLine.test(d)&&(h+=d+`
|
|
`,e=e.substring(d.length+1),u=!0),!u){const Z=this.rules.other.nextBulletRegex(x),N=this.rules.other.hrRegex(x),M=this.rules.other.fencesBeginRegex(x),B=this.rules.other.headingBeginRegex(x),Y=this.rules.other.htmlBeginRegex(x);for(;e;){const re=e.split(`
|
|
`,1)[0];let j;if(d=re,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),j=d):j=d.replace(this.rules.other.tabCharGlobal," "),M.test(d)||B.test(d)||Y.test(d)||Z.test(d)||N.test(d))break;if(j.search(this.rules.other.nonSpaceChar)>=x||!d.trim())p+=`
|
|
`+j.slice(x);else{if(y||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(k)||B.test(k)||N.test(k))break;p+=`
|
|
`+d}!y&&!d.trim()&&(y=!0),h+=re+`
|
|
`,e=e.substring(re.length+1),k=j.slice(x)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0));let v=null,H;this.options.gfm&&(v=this.rules.other.listIsTask.exec(p),v&&(H=v[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:h,task:!!v,checked:H,loose:!1,text:p,tokens:[]}),r.raw+=h}const c=r.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){const h=r.items[u].tokens.filter(k=>k.type==="space"),p=h.length>0&&h.some(k=>this.rules.other.anyLine.test(k.raw));r.loose=p}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Se(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
`):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const o of s)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<n.length;o++)i.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:i.align[o]});for(const o of r)i.rows.push(Se(o,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
|
|
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=U(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=Xt(t[2],"()");if(i>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],r="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Te(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[s.toLowerCase()];if(!r){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return Te(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...s[0]].length-1;let o,c,u=i,h=0;const p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+i);(s=p.exec(t))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(c=[...o].length,s[3]||s[4]){u+=c;continue}else if((s[5]||s[6])&&i%3&&!((i+c)%3)){h+=c;continue}if(u-=c,u>0)continue;c=Math.min(c,c+u+h);const k=[...s[0]][0].length,d=e.slice(0,i+s.index+k+c);if(Math.min(i,c)%2){const x=d.slice(1,-1);return{type:"em",raw:d,text:x,tokens:this.lexer.inlineTokens(x)}}const y=d.slice(2,-2);return{type:"strong",raw:d,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,s;if(t[2]==="@")n=t[0],s="mailto:"+n;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(r!==t[0]);n=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class T{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||q,this.options.tokenizer=this.options.tokenizer||new ee,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 t={other:$,block:X.normal,inline:W.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=W.breaks:t.inline=W.gfm),this.tokenizer.rules=t}static get rules(){return{block:X,inline:W}}static lex(e,t){return new T(t).lex(e)}static lexInline(e,t){return new T(t).inlineTokens(e)}lex(e){e=e.replace($.carriageReturn,`
|
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace($.tabCharGlobal," ").replace($.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(i=>(s=i.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);const i=t.at(-1);s.raw.length===1&&i!==void 0?i.raw+=`
|
|
`:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);const i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.text,this.inlineQueue.at(-1).src=i.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);const i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let r=e;if(this.options.extensions?.startBlock){let i=1/0;const o=e.slice(1);let c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},o),typeof c=="number"&&c>=0&&(i=Math.min(i,c))}),i<1/0&&i>=0&&(r=e.substring(0,i+1))}if(this.state.top&&(s=this.tokenizer.paragraph(r))){const i=t.at(-1);n&&i?.type==="paragraph"?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(s),n=r.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);const i=t.at(-1);i?.type==="text"?(i.raw+=`
|
|
`+s.raw,i.text+=`
|
|
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(s);continue}if(e){const i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,s=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,s.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let r=!1,i="";for(;e;){r||(i=""),r=!1;let o;if(this.options.extensions?.inline?.some(u=>(o=u.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);const u=t.at(-1);o.type==="text"&&u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0;const h=e.slice(1);let p;this.options.extensions.startInline.forEach(k=>{p=k.call({lexer:this},h),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(i=o.raw.slice(-1)),r=!0;const u=t.at(-1);u?.type==="text"?(u.raw+=o.raw,u.text+=o.text):t.push(o);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}}class te{options;parser;constructor(e){this.options=e||q}space(e){return""}code({text:e,lang:t,escaped:n}){const s=(t||"").match($.notSpaceStart)?.[0],r=e.replace($.endingNewline,"")+`
|
|
`;return s?'<pre><code class="language-'+C(s)+'">'+(n?r:C(r,!0))+`</code></pre>
|
|
`:"<pre><code>"+(n?r:C(r,!0))+`</code></pre>
|
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
${this.parser.parse(e)}</blockquote>
|
|
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
`}hr(e){return`<hr>
|
|
`}list(e){const t=e.ordered,n=e.start;let s="";for(let o=0;o<e.items.length;o++){const c=e.items[o];s+=this.listitem(c)}const r=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
|
|
`+s+"</"+r+`>
|
|
`}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+C(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
`}table(e){let t="",n="";for(let r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});let s="";for(let r=0;r<e.rows.length;r++){const i=e.rows[r];n="";for(let o=0;o<i.length;o++)n+=this.tablecell(i[o]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
<thead>
|
|
`+t+`</thead>
|
|
`+s+`</table>
|
|
`}tablerow({text:e}){return`<tr>
|
|
${e}</tr>
|
|
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${C(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),r=$e(e);if(r===null)return s;e=r;let i='<a href="'+e+'"';return t&&(i+=' title="'+C(t)+'"'),i+=">"+s+"</a>",i}image({href:e,title:t,text:n}){const s=$e(e);if(s===null)return C(n);e=s;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${C(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:C(e.text)}}class ye{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class R{options;renderer;textRenderer;constructor(e){this.options=e||q,this.options.renderer=this.options.renderer||new te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ye}static parse(e,t){return new R(t).parse(e)}static parseInline(e,t){return new R(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions?.renderers?.[r.type]){const o=r,c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){n+=c||"";continue}}const i=r;switch(i.type){case"space":{n+=this.renderer.space(i);continue}case"hr":{n+=this.renderer.hr(i);continue}case"heading":{n+=this.renderer.heading(i);continue}case"code":{n+=this.renderer.code(i);continue}case"table":{n+=this.renderer.table(i);continue}case"blockquote":{n+=this.renderer.blockquote(i);continue}case"list":{n+=this.renderer.list(i);continue}case"html":{n+=this.renderer.html(i);continue}case"paragraph":{n+=this.renderer.paragraph(i);continue}case"text":{let o=i,c=this.renderer.text(o);for(;s+1<e.length&&e[s+1].type==="text";)o=e[++s],c+=`
|
|
`+this.renderer.text(o);t?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,t=this.renderer){let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions?.renderers?.[r.type]){const o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=o||"";continue}}const i=r;switch(i.type){case"escape":{n+=t.text(i);break}case"html":{n+=t.html(i);break}case"link":{n+=t.link(i);break}case"image":{n+=t.image(i);break}case"strong":{n+=t.strong(i);break}case"em":{n+=t.em(i);break}case"codespan":{n+=t.codespan(i);break}case"br":{n+=t.br(i);break}case"del":{n+=t.del(i);break}case"text":{n+=t.text(i);break}default:{const o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}}class J{options;block;constructor(e){this.options=e||q}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?T.lex:T.lexInline}provideParser(){return this.block?R.parse:R.parseInline}}class Kt{defaults=de();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=R;Renderer=te;TextRenderer=ye;Lexer=T;Tokenizer=ee;Hooks=J;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{const r=s;for(const i of r.header)n=n.concat(this.walkTokens(i.tokens,t));for(const i of r.rows)for(const o of i)n=n.concat(this.walkTokens(o.tokens,t));break}case"list":{const r=s;n=n.concat(this.walkTokens(r.items,t));break}default:{const r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{const o=r[i].flat(1/0);n=n.concat(this.walkTokens(o,t))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const i=t.renderers[r.name];i?t.renderers[r.name]=function(...o){let c=r.renderer.apply(this,o);return c===!1&&(c=i.apply(this,o)),c}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[r.level];i?i.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){const r=this.defaults.renderer||new te(this.defaults);for(const i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const o=i,c=n.renderer[o],u=r[o];r[o]=(...h)=>{let p=c.apply(r,h);return p===!1&&(p=u.apply(r,h)),p||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new ee(this.defaults);for(const i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const o=i,c=n.tokenizer[o],u=r[o];r[o]=(...h)=>{let p=c.apply(r,h);return p===!1&&(p=u.apply(r,h)),p}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new J;for(const i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const o=i,c=n.hooks[o],u=r[o];J.passThroughHooks.has(i)?r[o]=h=>{if(this.defaults.async)return Promise.resolve(c.call(r,h)).then(k=>u.call(r,k));const p=c.call(r,h);return u.call(r,p)}:r[o]=(...h)=>{let p=c.apply(r,h);return p===!1&&(p=u.apply(r,h)),p}}s.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(o){let c=[];return c.push(i.call(this,o)),r&&(c=c.concat(r.call(this,o))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return T.lex(e,t??this.defaults)}parser(e,t){return R.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const r={...s},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const c=i.hooks?i.hooks.provideLexer():e?T.lex:T.lexInline,u=i.hooks?i.hooks.provideParser():e?R.parse:R.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(h=>c(h,i)).then(h=>i.hooks?i.hooks.processAllTokens(h):h).then(h=>i.walkTokens?Promise.all(this.walkTokens(h,i.walkTokens)).then(()=>h):h).then(h=>u(h,i)).then(h=>i.hooks?i.hooks.postprocess(h):h).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));let h=c(n,i);i.hooks&&(h=i.hooks.processAllTokens(h)),i.walkTokens&&this.walkTokens(h,i.walkTokens);let p=u(h,i);return i.hooks&&(p=i.hooks.postprocess(p)),p}catch(h){return o(h)}}}onError(e,t){return n=>{if(n.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+C(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}}const D=new Kt;function b(a,e){return D.parse(a,e)}b.options=b.setOptions=function(a){return D.setOptions(a),b.defaults=D.defaults,ze(b.defaults),b};b.getDefaults=de;b.defaults=q;b.use=function(...a){return D.use(...a),b.defaults=D.defaults,ze(b.defaults),b};b.walkTokens=function(a,e){return D.walkTokens(a,e)};b.parseInline=D.parseInline;b.Parser=R;b.parser=R.parse;b.Renderer=te;b.TextRenderer=ye;b.Lexer=T;b.lexer=T.lex;b.Tokenizer=ee;b.Hooks=J;b.parse=b;b.options;b.setOptions;b.use;b.walkTokens;b.parseInline;R.parse;T.lex;const en={key:0,class:"p-2 rounded-5 text-bg-secondary",style:{"line-height":"1"}},tn={__name:"agentMessage",props:{message:{content:String,id:String,role:String,time:String},ind:Number},setup(a){const e=a;return ae(()=>{document.querySelector(".agentChatroomBody").scrollTop=document.querySelector(".agentChatroomBody").scrollHeight}),Ce(()=>b.parse(e.message.content)),(t,n)=>(f(),w("div",{class:E({"d-flex flex-row align-items-end gap-2":a.message.role==="assistant","mt-auto":a.ind===0})},[a.message.role==="assistant"?(f(),w("div",en,n[0]||(n[0]=[l("i",{class:"bi bi-robot"},null,-1)]))):A("",!0),l("div",{class:E(["d-flex text-body agentMessage",{"ms-auto":a.message.role==="user"}])},[l("div",{class:E(["px-3 py-2 rounded-3 shadow-sm",[a.message.role==="user"?"text-bg-primary ms-auto align-items-end":"text-bg-secondary align-items-start"]])},O(a.message.content),3)],2)],2))}},nn=ne(tn,[["__scopeId","data-v-8635cf47"]]),sn={class:"flex-grow-1 d-flex flex-column"},rn={class:"agentChatroomBody p-3 pb-5 d-flex flex-column gap-3 flex-grow-1",key:"body"},on={class:"d-flex text-white align-items-center p-3 gap-3 rounded-bottom-3 mt-auto",key:"input",style:{"box-shadow":"1px -1rem 3rem 0 rgba(0, 0, 0, 0.175) !important"}},ln=["placeholder","disabled"],an={key:0,class:"bi bi-send-fill"},cn={key:1,class:"spinner-border spinner-border-sm"},Re="https://wgdashboard-bot-middleware-5xqq9.ondigitalocean.app",un={__name:"agentContainer",setup(a){const e=G(""),t=G(!1),n=Ge({}),s=G(!1),r=G(!1),i=()=>{document.querySelector(".agentChatroomBody").scrollTop=document.querySelector(".agentChatroomBody").scrollHeight},o=(p,k)=>{let d=We().toString();return n[d]={id:d,role:p,content:k,time:Xe().format("YYYY-MM-DD HH:mm:ss")},d},c=Ce(()=>Object.values(n).filter(p=>p.content)),u=()=>{if(e.value){o("user",e.value),e.value="",t.value=!0;let p=o("assistant","");fetch(`${Re}/api/completion`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:c.value})}).then(k=>{if(k.ok){const y=k.body.getReader(),x=new TextDecoder,v=()=>{y.read().then(({value:H,done:Z})=>{if(Z){t.value=!1;return}let N=x.decode(H,{stream:!0}).trim();N=N.split(`
|
|
`),N.forEach(M=>{if(M){M=M.replace(/^data:\s*/,"");let B=JSON.parse(M);if(B.status)B.data!=="[DONE]"&&B.data.choices.forEach(Y=>{Y.delta.content&&(n[p].content+=Y.delta.content,i())});else throw new Error(B.message)}}),v()}).catch(H=>{console.log(H),t.value=!1,n[p].content="Sorry, the bot is not responding."})};v()}else throw t.value=!1,new Error("Invalid response")}).catch(()=>{t.value=!1,n[p].content="Sorry, the bot is not responding."})}},h=async()=>{r.value=!0,await fetch(`${Re}/api/health`,{signal:AbortSignal.timeout(3e3)}).then(p=>p.json()).then(p=>{s.value=p.status==="ok",r.value=!1}).catch(()=>{r.value=!1,s.value=!1})};return Oe(()=>{o("assistant",oe("Hi! How can I help you today?"))}),ae(async()=>{await h()}),(p,k)=>(f(),w("div",sn,[l("div",{class:E(["p-1 text-center shadow",{"text-bg-secondary":r.value,"text-bg-success":!r.value&&s.value}])},[l("small",null,[r.value?(f(),z(S,{key:0,t:"Connecting..."})):(f(),z(S,{key:1,t:s.value?"Connected":"Not Connected"},null,8,["t"]))])],2),g(F,{name:"agent-message"},{default:_(()=>[s.value&&!r.value?(f(),w("div",rn,[g(ce,{name:"agent-message"},{default:_(()=>[(f(!0),w(ue,null,he(c.value,(d,y)=>(f(),z(nn,{message:d,key:d.id,ind:y},null,8,["message","ind"]))),128))]),_:1})])):A("",!0)]),_:1}),g(F,{name:"agent-message"},{default:_(()=>[s.value&&!r.value?(f(),w("div",on,[Ae(l("input",{type:"text",class:"form-control rounded-3 bg-transparent border-0",placeholder:I(oe)("What do you want to ask?"),onKeyup:Ze(u,["enter"]),"onUpdate:modelValue":k[0]||(k[0]=d=>e.value=d),disabled:t.value},null,40,ln),[[je,e.value]]),l("a",{role:"button",class:"agentChatroomSendButton text-body",onClick:u},[t.value?(f(),w("span",cn)):(f(),w("i",an))])])):A("",!0)]),_:1})]))}},hn={key:"header",class:"shadow"},pn={class:"p-3 d-flex gap-2 flex-column"},dn={class:"d-flex text-body"},gn={class:"d-flex flex-column align-items-start gap-1"},fn={class:"mb-0"},mn={class:"mb-0"},bn={class:"list-group"},kn={href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank",class:"list-group-item list-group-item-action d-flex align-items-center"},xn={target:"_blank",role:"button",href:"https://discord.gg/72TwzjeuWm",class:"list-group-item list-group-item-action d-flex align-items-center"},wn={class:"d-flex flex-column p-3 gap-2"},yn={class:"d-flex w-100"},_n={class:"mb-0"},vn={class:"form-check form-switch ms-auto mb-0"},$n={class:"form-check-label fw-bold",for:"enableHelpAgent"},Sn={key:0,class:"text-muted"},Tn={__name:"agentModal",emits:["close"],setup(a,{emit:e}){const t=e,n=pe();return(s,r)=>(f(),w("div",{class:E(["agentContainer m-2 rounded-3 d-flex flex-column text-body",{enabled:I(n).HelpAgent.Enable}])},[g(ce,{name:"agent-message"},{default:_(()=>[l("div",hn,[l("div",pn,[l("div",dn,[l("div",gn,[l("h5",fn,[g(S,{t:"Help"})])]),l("a",{role:"button",class:"ms-auto text-body",onClick:r[0]||(r[0]=i=>t("close"))},r[2]||(r[2]=[l("h5",{class:"mb-0"},[l("i",{class:"bi bi-x-lg"})],-1)]))]),l("p",mn,[g(S,{t:"You can visit our: "})]),l("div",bn,[l("a",kn,[r[3]||(r[3]=l("i",{class:"bi bi-book-fill"},null,-1)),g(S,{class:"ms-auto",t:"Official Documentation"})]),l("a",xn,[r[4]||(r[4]=l("i",{class:"bi bi-discord"},null,-1)),g(S,{class:"ms-auto",t:"Discord Server"})])])]),l("div",wn,[l("div",yn,[l("h5",_n,[g(S,{t:"WGDashboard Help Bot"})]),l("div",vn,[Ae(l("input",{class:"form-check-input","onUpdate:modelValue":r[1]||(r[1]=i=>I(n).HelpAgent.Enable=i),type:"checkbox",role:"switch",id:"enableHelpAgent"},null,512),[[Ue,I(n).HelpAgent.Enable]]),l("label",$n,[g(S,{t:I(n).HelpAgent.Enable?"Enabled":"Disabled"},null,8,["t"])])])]),I(n).HelpAgent.Enable?A("",!0):(f(),w("small",Sn,r[5]||(r[5]=[L(" By using this service, you're agreed to send your messages to a Large Language Model (LLM) hosted on DigitalOcean. Your messages will not store on the server in any type of form, you can verify it on "),l("a",{href:"https://github.com/donaldzou/WGDashboard-Bot-Middleware",target:"_blank"},"here",-1),L(". For more information, please contact me through GitHub or email. ")])))])]),I(n).HelpAgent.Enable?(f(),z(un,{key:"agentContainer"})):A("",!0)]),_:1})],2))}},Rn=ne(Tn,[["__scopeId","data-v-8e5620c6"]]),Cn={name:"navbar",components:{HelpModal:bt,LocaleText:S,AgentModal:Rn},setup(){const a=Qe(),e=pe();return{wireguardConfigurationsStore:a,dashboardConfigurationStore:e}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:"",openHelpModal:!1,openAgentModal:!1}},computed:{getActiveCrossServer(){if(this.dashboardConfigurationStore.ActiveServerConfiguration)return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.ServerList[this.dashboardConfigurationStore.ActiveServerConfiguration].host)}},mounted(){Fe("/api/getDashboardUpdate",{},a=>{a.status?(a.data&&(this.updateAvailable=!0,this.updateUrl=a.data),this.updateMessage=a.message):(this.updateMessage=oe("Failed to check available update"),console.log(`Failed to get update: ${a.message}`))})}},An=["data-bs-theme"],zn={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},Ln={class:"sidebar-sticky"},Mn={class:"text-white text-center m-0 py-3 mb-2 btn-brand"},Bn={key:0,class:"ms-auto"},In={class:"nav flex-column px-2 gap-1"},Pn={class:"nav-item"},En={class:"nav-item"},Dn={class:"nav-item"},qn={class:"sidebar-heading px-3 mt-3 mb-1 text-muted text-center"},Hn={class:"nav flex-column px-2 gap-1"},Nn={class:"nav-item"},Gn={class:"sidebar-heading px-3 mt-3 mb-1 text-muted text-center"},On={class:"nav flex-column px-2 gap-1"},Zn={class:"nav-item"},jn={class:"nav-item"},Wn={class:"nav-item"},Un={class:"nav flex-column px-2 mb-3"},Qn={class:"nav-item"},Fn={class:"nav-item",style:{"font-size":"0.8rem"}},Vn=["href"],Yn={class:"nav-link text-muted rounded-3"},Xn={key:1,class:"nav-link text-muted rounded-3"};function Jn(a,e,t,n,s,r){const i=P("LocaleText"),o=P("RouterLink"),c=P("HelpModal"),u=P("AgentModal");return f(),w("div",{class:E(["col-md-3 col-lg-2 d-md-block p-2 navbar-container",{active:this.dashboardConfigurationStore.ShowNavBar}]),"data-bs-theme":n.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[l("nav",zn,[l("div",Ln,[l("div",Mn,[e[5]||(e[5]=l("h5",{class:"mb-0"}," WGDashboard ",-1)),r.getActiveCrossServer!==void 0?(f(),w("small",Bn,[e[4]||(e[4]=l("i",{class:"bi bi-hdd-rack-fill me-2"},null,-1)),L(O(r.getActiveCrossServer.host),1)])):A("",!0)]),l("ul",In,[l("li",Pn,[g(o,{class:"nav-link rounded-3",to:"/","exact-active-class":"active"},{default:_(()=>[e[6]||(e[6]=l("i",{class:"bi bi-house me-2"},null,-1)),g(i,{t:"Home"})]),_:1})]),l("li",En,[g(o,{class:"nav-link rounded-3",to:"/settings","exact-active-class":"active"},{default:_(()=>[e[7]||(e[7]=l("i",{class:"bi bi-gear me-2"},null,-1)),g(i,{t:"Settings"})]),_:1})]),l("li",Dn,[l("a",{class:"nav-link rounded-3",role:"button",onClick:e[0]||(e[0]=h=>s.openAgentModal=!0)},[e[8]||(e[8]=l("i",{class:"bi bi-question-circle me-2"},null,-1)),g(i,{t:"Help"})])])]),e[11]||(e[11]=l("hr",{class:"text-body my-2"},null,-1)),l("h6",qn,[g(i,{t:"WireGuard Configurations"})]),l("ul",Hn,[(f(!0),w(ue,null,he(this.wireguardConfigurationsStore.Configurations,h=>(f(),w("li",Nn,[g(o,{to:"/configuration/"+h.Name+"/peers",class:"nav-link nav-conf-link rounded-3","active-class":"active"},{default:_(()=>[l("span",{class:E(["dot me-2",{active:h.Status}])},null,2),L(" "+O(h.Name),1)]),_:2},1032,["to"])]))),256))]),e[12]||(e[12]=l("hr",{class:"text-body my-2"},null,-1)),l("h6",Gn,[g(i,{t:"Tools"})]),l("ul",On,[l("li",Zn,[g(o,{to:"/system_status",class:"nav-link rounded-3","active-class":"active"},{default:_(()=>[g(i,{t:"System Status"})]),_:1})]),l("li",jn,[g(o,{to:"/ping",class:"nav-link rounded-3","active-class":"active"},{default:_(()=>[g(i,{t:"Ping"})]),_:1})]),l("li",Wn,[g(o,{to:"/traceroute",class:"nav-link rounded-3","active-class":"active"},{default:_(()=>[g(i,{t:"Traceroute"})]),_:1})])]),e[13]||(e[13]=l("hr",{class:"text-body my-2"},null,-1)),l("ul",Un,[l("li",Qn,[l("a",{class:"nav-link text-danger rounded-3",onClick:e[1]||(e[1]=h=>this.dashboardConfigurationStore.signOut()),role:"button",style:{"font-weight":"bold"}},[e[9]||(e[9]=l("i",{class:"bi bi-box-arrow-left me-2"},null,-1)),g(i,{t:"Sign Out"})])]),l("li",Fn,[this.updateAvailable?(f(),w("a",{key:0,href:this.updateUrl,class:"text-decoration-none rounded-3",target:"_blank"},[l("small",Yn,[g(i,{t:this.updateMessage},null,8,["t"]),e[10]||(e[10]=L(" (")),g(i,{t:"Current Version:"}),L(" "+O(n.dashboardConfigurationStore.Configuration.Server.version)+") ",1)])],8,Vn)):(f(),w("small",Xn,[g(i,{t:this.updateMessage},null,8,["t"]),L(" ("+O(n.dashboardConfigurationStore.Configuration.Server.version)+") ",1)]))])])])]),g(F,{name:"zoom"},{default:_(()=>[this.openHelpModal?(f(),z(c,{key:0,onClose:e[2]||(e[2]=h=>{s.openHelpModal=!1})})):A("",!0)]),_:1}),g(F,{name:"slideIn"},{default:_(()=>[this.openAgentModal?(f(),z(u,{key:0,onClose:e[3]||(e[3]=h=>s.openAgentModal=!1)})):A("",!0)]),_:1})],10,An)}const Kn=ne(Cn,[["render",Jn],["__scopeId","data-v-58e71749"]]),es={name:"index",components:{Message:Je,Navbar:Kn},async setup(){return{dashboardConfigurationStore:pe()}},computed:{getMessages(){return this.dashboardConfigurationStore.Messages.filter(a=>a.show)}}},ts=["data-bs-theme"],ns={class:"row h-100"},ss={class:"col-md-9 col-lg-10 overflow-y-scroll mb-0 pt-2"},is={class:"messageCentre text-body position-absolute d-flex"};function rs(a,e,t,n,s,r){const i=P("Navbar"),o=P("RouterView"),c=P("Message");return f(),w("div",{class:"container-fluid flex-grow-1 main","data-bs-theme":this.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[l("div",ns,[g(i),l("main",ss,[(f(),z(Ye,null,{default:_(()=>[g(o,null,{default:_(({Component:u})=>[g(F,{name:"fade2",mode:"out-in",appear:""},{default:_(()=>[(f(),z(Ve(u)))]),_:2},1024)]),_:1})]),_:1})),l("div",is,[g(ce,{name:"message",tag:"div",class:"position-relative flex-sm-grow-0 flex-grow-1 d-flex align-items-end ms-sm-auto flex-column gap-2"},{default:_(()=>[(f(!0),w(ue,null,he(r.getMessages.slice().reverse(),u=>(f(),z(c,{message:u,key:u.id},null,8,["message"]))),128))]),_:1})])])])],8,ts)}const us=ne(es,[["render",rs],["__scopeId","data-v-0c6a5068"]]);export{us as default};
|