Enhanced Markdown Editor for Standard Notes

Boost Standard Notes with a powerful, unofficial Markdown editor featuring live preview, formatting toolbar, image pasting/uploading with auto-resize, and PDF export. Unused images are auto-cleaned for efficiency.

Tính đến 21-06-2025. Xem phiên bản mới nhất.

// ==UserScript==
// @name             Enhanced Markdown Editor for Standard Notes
// @name:ja          Standard Notes用 高機能Markdownエディタ拡張
// @name:en          Enhanced Markdown Editor for Standard Notes
// @name:zh-CN       为Standard Notes增强Markdown编辑器
// @name:zh-TW       為Standard Notes強化Markdown編輯器
// @name:ko          Standard Notes용 고급 Markdown 에디터 확장
// @name:fr          Éditeur Markdown amélioré pour Standard Notes
// @name:es          Editor Markdown mejorado para Standard Notes
// @name:de          Erweiterter Markdown-Editor für Standard Notes
// @name:pt-BR       Editor Markdown avançado para Standard Notes
// @name:ru          Улучшенный редактор Markdown для Standard Notes
// @version          3.7.8
// @description      Boost Standard Notes with a powerful, unofficial Markdown editor featuring live preview, formatting toolbar, image pasting/uploading with auto-resize, and PDF export. Unused images are auto-cleaned for efficiency.
// @description:ja   Standard Notesを強化する非公式の高機能Markdownエディタ!ライブプレビュー、装飾ツールバー、画像の貼り付け・アップロード(自動リサイズ)、PDF出力に対応。未使用画像は自動でクリーンアップされます。
// @description:zh-CN 非官方增强的Markdown编辑器,为Standard Notes添加实时预览、工具栏、自动调整大小的图像粘贴/上传、PDF导出等功能,并自动清理未使用的图像。
// @description:zh-TW 非官方強化Markdown編輯器,為Standard Notes新增即時預覽、工具列、自動縮放圖片貼上/上傳、PDF匯出等功能,並自動清除未使用圖片。
// @description:ko   Standard Notes를 위한 강력한 비공식 Markdown 에디터! 실시간 미리보기, 서식 툴바, 이미지 붙여넣기/업로드(자동 리사이즈), PDF 내보내기 지원. 사용하지 않는 이미지는 자동 정리됩니다。
// @description:fr   Améliorez Standard Notes avec un éditeur Markdown puissant et non officiel : aperçu en direct, barre d’outils, collage/téléversement d’images redimensionnées automatiquement, export PDF. Nettoyage automatique des images inutilisées.
// @description:es   Mejora Standard Notes con un potente editor Markdown no oficial: vista previa en vivo, barra de herramientas, pegado/carga de imágenes con redimensionado automático y exportación a PDF. Las imágenes no usadas se eliminan automáticamente.
// @description:de   Erweitern Sie Standard Notes mit einem leistungsstarken, inoffiziellen Markdown-Editor: Live-Vorschau, Formatierungsleiste, Bild-Einfügen/-Hochladen mit automatischer Größenanpassung und PDF-Export. Nicht verwendete Bilder werden automatisch bereinigt.
// @description:pt-BR Potencialize o Standard Notes com um editor Markdown poderoso e não oficial: visualização ao vivo, barra de formatação, colagem/envio de imagens com redimensionamento automático e exportação para PDF. Imagens não utilizadas são removidas automaticamente.
// @description:ru   Улучшите Standard Notes с помощью мощного неофициального редактора Markdown: живая превью, панель форматирования, вставка/загрузка изображений с автоизменением размера и экспорт в PDF. Неиспользуемые изображения автоматически удаляются.
// @namespace        https://github.com/koyasi777/standardnotes-markdown-enhancer
// @author           koyasi777
// @match            https://app.standardnotes.com/*
// @grant            GM_addStyle
// @license          MIT
// @homepageURL      https://github.com/koyasi777/standardnotes-markdown-enhancer
// @supportURL       https://github.com/koyasi777/standardnotes-markdown-enhancer/issues
// @icon             https://app.standardnotes.com/favicon/favicon-32x32.png
// @noframes
// ==/UserScript==

!function(){"use strict";function _getDefaults(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let _defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function changeDefaults(newDefaults){_defaults=newDefaults}const escapeTest=/[&<>"']/,escapeReplace=new RegExp(escapeTest.source,"g"),escapeTestNoEncode=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode=new RegExp(escapeTestNoEncode.source,"g"),escapeReplacements={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},getEscapeReplacement=ch=>escapeReplacements[ch];function escape$1(html,encode){if(encode){if(escapeTest.test(html))return html.replace(escapeReplace,getEscapeReplacement)}else if(escapeTestNoEncode.test(html))return html.replace(escapeReplaceNoEncode,getEscapeReplacement);return html}const unescapeTest=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function unescape(html){return html.replace(unescapeTest,(_,n)=>"colon"===(n=n.toLowerCase())?":":"#"===n.charAt(0)?"x"===n.charAt(1)?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):"")}const caret=/(^|[^\[])\^/g;function edit(regex,opt){let source="string"==typeof regex?regex:regex.source;opt=opt||"";const obj={replace:(name,val)=>{let valSource="string"==typeof val?val:val.source;return valSource=valSource.replace(caret,"$1"),source=source.replace(name,valSource),obj},getRegex:()=>new RegExp(source,opt)};return obj}function cleanUrl(href){try{href=encodeURI(href).replace(/%25/g,"%")}catch(e){return null}return href}const noopTest={exec:()=>null};function splitCells(tableRow,count){const cells=tableRow.replace(/\|/g,(match,offset,str)=>{let escaped=!1,curr=offset;for(;--curr>=0&&"\\"===str[curr];)escaped=!escaped;return escaped?"|":" |"}).split(/ \|/);let i=0;if(cells[0].trim()||cells.shift(),cells.length>0&&!cells[cells.length-1].trim()&&cells.pop(),count)if(cells.length>count)cells.splice(count);else for(;cells.length<count;)cells.push("");for(;i<cells.length;i++)cells[i]=cells[i].trim().replace(/\\\|/g,"|");return cells}function rtrim(str,c,invert){const l=str.length;if(0===l)return"";let suffLen=0;for(;suffLen<l;){if(str.charAt(l-suffLen-1)!==c)break;suffLen++}return str.slice(0,l-suffLen)}function outputLink(cap,link,raw,lexer){const href=link.href,title=link.title?escape$1(link.title):null,text=cap[1].replace(/\\([\[\]])/g,"$1");if("!"!==cap[0].charAt(0)){lexer.state.inLink=!0;const token={type:"link",raw:raw,href:href,title:title,text:text,tokens:lexer.inlineTokens(text)};return lexer.state.inLink=!1,token}return{type:"image",raw:raw,href:href,title:title,text:escape$1(text)}}class _Tokenizer{options;rules;lexer;constructor(options){this.options=options||_defaults}space(src){const cap=this.rules.block.newline.exec(src);if(cap&&cap[0].length>0)return{type:"space",raw:cap[0]}}code(src){const cap=this.rules.block.code.exec(src);if(cap){const text=cap[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:cap[0],codeBlockStyle:"indented",text:this.options.pedantic?text:rtrim(text,"\n")}}}fences(src){const cap=this.rules.block.fences.exec(src);if(cap){const raw=cap[0],text=function(raw,text){const matchIndentToCode=raw.match(/^(\s+)(?:```)/);if(null===matchIndentToCode)return text;const indentToCode=matchIndentToCode[1];return text.split("\n").map(node=>{const matchIndentInNode=node.match(/^\s+/);if(null===matchIndentInNode)return node;const[indentInNode]=matchIndentInNode;return indentInNode.length>=indentToCode.length?node.slice(indentToCode.length):node}).join("\n")}(raw,cap[3]||"");return{type:"code",raw:raw,lang:cap[2]?cap[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):cap[2],text:text}}}heading(src){const cap=this.rules.block.heading.exec(src);if(cap){let text=cap[2].trim();if(/#$/.test(text)){const trimmed=rtrim(text,"#");this.options.pedantic?text=trimmed.trim():trimmed&&!/ $/.test(trimmed)||(text=trimmed.trim())}return{type:"heading",raw:cap[0],depth:cap[1].length,text:text,tokens:this.lexer.inline(text)}}}hr(src){const cap=this.rules.block.hr.exec(src);if(cap)return{type:"hr",raw:cap[0]}}blockquote(src){const cap=this.rules.block.blockquote.exec(src);if(cap){let text=cap[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n    $1");text=rtrim(text.replace(/^ *>[ \t]?/gm,""),"\n");const top=this.lexer.state.top;this.lexer.state.top=!0;const tokens=this.lexer.blockTokens(text);return this.lexer.state.top=top,{type:"blockquote",raw:cap[0],tokens:tokens,text:text}}}list(src){let cap=this.rules.block.list.exec(src);if(cap){let bull=cap[1].trim();const isordered=bull.length>1,list={type:"list",raw:"",ordered:isordered,start:isordered?+bull.slice(0,-1):"",loose:!1,items:[]};bull=isordered?`\\d{1,9}\\${bull.slice(-1)}`:`\\${bull}`,this.options.pedantic&&(bull=isordered?bull:"[*+-]");const itemRegex=new RegExp(`^( {0,3}${bull})((?:[\t ][^\\n]*)?(?:\\n|$))`);let raw="",itemContents="",endsWithBlankLine=!1;for(;src;){let endEarly=!1;if(!(cap=itemRegex.exec(src)))break;if(this.rules.block.hr.test(src))break;raw=cap[0],src=src.substring(raw.length);let line=cap[2].split("\n",1)[0].replace(/^\t+/,t=>" ".repeat(3*t.length)),nextLine=src.split("\n",1)[0],indent=0;this.options.pedantic?(indent=2,itemContents=line.trimStart()):(indent=cap[2].search(/[^ ]/),indent=indent>4?1:indent,itemContents=line.slice(indent),indent+=cap[1].length);let blankLine=!1;if(!line&&/^ *$/.test(nextLine)&&(raw+=nextLine+"\n",src=src.substring(nextLine.length+1),endEarly=!0),!endEarly){const nextBulletRegex=new RegExp(`^ {0,${Math.min(3,indent-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex=new RegExp(`^ {0,${Math.min(3,indent-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex=new RegExp(`^ {0,${Math.min(3,indent-1)}}(?:\`\`\`|~~~)`),headingBeginRegex=new RegExp(`^ {0,${Math.min(3,indent-1)}}#`);for(;src;){const rawLine=src.split("\n",1)[0];if(nextLine=rawLine,this.options.pedantic&&(nextLine=nextLine.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),fencesBeginRegex.test(nextLine))break;if(headingBeginRegex.test(nextLine))break;if(nextBulletRegex.test(nextLine))break;if(hrRegex.test(src))break;if(nextLine.search(/[^ ]/)>=indent||!nextLine.trim())itemContents+="\n"+nextLine.slice(indent);else{if(blankLine)break;if(line.search(/[^ ]/)>=4)break;if(fencesBeginRegex.test(line))break;if(headingBeginRegex.test(line))break;if(hrRegex.test(line))break;itemContents+="\n"+nextLine}blankLine||nextLine.trim()||(blankLine=!0),raw+=rawLine+"\n",src=src.substring(rawLine.length+1),line=nextLine.slice(indent)}}list.loose||(endsWithBlankLine?list.loose=!0:/\n *\n *$/.test(raw)&&(endsWithBlankLine=!0));let ischecked,istask=null;this.options.gfm&&(istask=/^\[[ xX]\] /.exec(itemContents),istask&&(ischecked="[ ] "!==istask[0],itemContents=itemContents.replace(/^\[[ xX]\] +/,""))),list.items.push({type:"list_item",raw:raw,task:!!istask,checked:ischecked,loose:!1,text:itemContents,tokens:[]}),list.raw+=raw}list.items[list.items.length-1].raw=raw.trimEnd(),list.items[list.items.length-1].text=itemContents.trimEnd(),list.raw=list.raw.trimEnd();for(let i=0;i<list.items.length;i++)if(this.lexer.state.top=!1,list.items[i].tokens=this.lexer.blockTokens(list.items[i].text,[]),!list.loose){const spacers=list.items[i].tokens.filter(t=>"space"===t.type),hasMultipleLineBreaks=spacers.length>0&&spacers.some(t=>/\n.*\n/.test(t.raw));list.loose=hasMultipleLineBreaks}if(list.loose)for(let i=0;i<list.items.length;i++)list.items[i].loose=!0;return list}}html(src){const cap=this.rules.block.html.exec(src);if(cap){return{type:"html",block:!0,raw:cap[0],pre:"pre"===cap[1]||"script"===cap[1]||"style"===cap[1],text:cap[0]}}}def(src){const cap=this.rules.block.def.exec(src);if(cap){const tag=cap[1].toLowerCase().replace(/\s+/g," "),href=cap[2]?cap[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",title=cap[3]?cap[3].substring(1,cap[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):cap[3];return{type:"def",tag:tag,raw:cap[0],href:href,title:title}}}table(src){const cap=this.rules.block.table.exec(src);if(!cap)return;if(!/[:|]/.test(cap[2]))return;const headers=splitCells(cap[1]),aligns=cap[2].replace(/^\||\| *$/g,"").split("|"),rows=cap[3]&&cap[3].trim()?cap[3].replace(/\n[ \t]*$/,"").split("\n"):[],item={type:"table",raw:cap[0],header:[],align:[],rows:[]};if(headers.length===aligns.length){for(const align of aligns)/^ *-+: *$/.test(align)?item.align.push("right"):/^ *:-+: *$/.test(align)?item.align.push("center"):/^ *:-+ *$/.test(align)?item.align.push("left"):item.align.push(null);for(const header of headers)item.header.push({text:header,tokens:this.lexer.inline(header)});for(const row of rows)item.rows.push(splitCells(row,item.header.length).map(cell=>({text:cell,tokens:this.lexer.inline(cell)})));return item}}lheading(src){const cap=this.rules.block.lheading.exec(src);if(cap)return{type:"heading",raw:cap[0],depth:"="===cap[2].charAt(0)?1:2,text:cap[1],tokens:this.lexer.inline(cap[1])}}paragraph(src){const cap=this.rules.block.paragraph.exec(src);if(cap){const text="\n"===cap[1].charAt(cap[1].length-1)?cap[1].slice(0,-1):cap[1];return{type:"paragraph",raw:cap[0],text:text,tokens:this.lexer.inline(text)}}}text(src){const cap=this.rules.block.text.exec(src);if(cap)return{type:"text",raw:cap[0],text:cap[0],tokens:this.lexer.inline(cap[0])}}escape(src){const cap=this.rules.inline.escape.exec(src);if(cap)return{type:"escape",raw:cap[0],text:escape$1(cap[1])}}tag(src){const cap=this.rules.inline.tag.exec(src);if(cap)return!this.lexer.state.inLink&&/^<a /i.test(cap[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(cap[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:cap[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:cap[0]}}link(src){const cap=this.rules.inline.link.exec(src);if(cap){const trimmedUrl=cap[2].trim();if(!this.options.pedantic&&/^</.test(trimmedUrl)){if(!/>$/.test(trimmedUrl))return;const rtrimSlash=rtrim(trimmedUrl.slice(0,-1),"\\");if((trimmedUrl.length-rtrimSlash.length)%2==0)return}else{const lastParenIndex=function(str,b){if(-1===str.indexOf(b[1]))return-1;let level=0;for(let i=0;i<str.length;i++)if("\\"===str[i])i++;else if(str[i]===b[0])level++;else if(str[i]===b[1]&&(level--,level<0))return i;return-1}(cap[2],"()");if(lastParenIndex>-1){const linkLen=(0===cap[0].indexOf("!")?5:4)+cap[1].length+lastParenIndex;cap[2]=cap[2].substring(0,lastParenIndex),cap[0]=cap[0].substring(0,linkLen).trim(),cap[3]=""}}let href=cap[2],title="";if(this.options.pedantic){const link=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href);link&&(href=link[1],title=link[3])}else title=cap[3]?cap[3].slice(1,-1):"";return href=href.trim(),/^</.test(href)&&(href=this.options.pedantic&&!/>$/.test(trimmedUrl)?href.slice(1):href.slice(1,-1)),outputLink(cap,{href:href?href.replace(this.rules.inline.anyPunctuation,"$1"):href,title:title?title.replace(this.rules.inline.anyPunctuation,"$1"):title},cap[0],this.lexer)}}reflink(src,links){let cap;if((cap=this.rules.inline.reflink.exec(src))||(cap=this.rules.inline.nolink.exec(src))){const link=links[(cap[2]||cap[1]).replace(/\s+/g," ").toLowerCase()];if(!link){const text=cap[0].charAt(0);return{type:"text",raw:text,text:text}}return outputLink(cap,link,cap[0],this.lexer)}}emStrong(src,maskedSrc,prevChar=""){let match=this.rules.inline.emStrongLDelim.exec(src);if(!match)return;if(match[3]&&prevChar.match(/[\p{L}\p{N}]/u))return;if(!(match[1]||match[2]||"")||!prevChar||this.rules.inline.punctuation.exec(prevChar)){const lLength=[...match[0]].length-1;let rDelim,rLength,delimTotal=lLength,midDelimTotal=0;const endReg="*"===match[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(endReg.lastIndex=0,maskedSrc=maskedSrc.slice(-1*src.length+lLength);null!=(match=endReg.exec(maskedSrc));){if(rDelim=match[1]||match[2]||match[3]||match[4]||match[5]||match[6],!rDelim)continue;if(rLength=[...rDelim].length,match[3]||match[4]){delimTotal+=rLength;continue}if((match[5]||match[6])&&lLength%3&&!((lLength+rLength)%3)){midDelimTotal+=rLength;continue}if(delimTotal-=rLength,delimTotal>0)continue;rLength=Math.min(rLength,rLength+delimTotal+midDelimTotal);const lastCharLength=[...match[0]][0].length,raw=src.slice(0,lLength+match.index+lastCharLength+rLength);if(Math.min(lLength,rLength)%2){const text=raw.slice(1,-1);return{type:"em",raw:raw,text:text,tokens:this.lexer.inlineTokens(text)}}const text=raw.slice(2,-2);return{type:"strong",raw:raw,text:text,tokens:this.lexer.inlineTokens(text)}}}}codespan(src){const cap=this.rules.inline.code.exec(src);if(cap){let text=cap[2].replace(/\n/g," ");const hasNonSpaceChars=/[^ ]/.test(text),hasSpaceCharsOnBothEnds=/^ /.test(text)&&/ $/.test(text);return hasNonSpaceChars&&hasSpaceCharsOnBothEnds&&(text=text.substring(1,text.length-1)),text=escape$1(text,!0),{type:"codespan",raw:cap[0],text:text}}}br(src){const cap=this.rules.inline.br.exec(src);if(cap)return{type:"br",raw:cap[0]}}del(src){const cap=this.rules.inline.del.exec(src);if(cap)return{type:"del",raw:cap[0],text:cap[2],tokens:this.lexer.inlineTokens(cap[2])}}autolink(src){const cap=this.rules.inline.autolink.exec(src);if(cap){let text,href;return"@"===cap[2]?(text=escape$1(cap[1]),href="mailto:"+text):(text=escape$1(cap[1]),href=text),{type:"link",raw:cap[0],text:text,href:href,tokens:[{type:"text",raw:text,text:text}]}}}url(src){let cap;if(cap=this.rules.inline.url.exec(src)){let text,href;if("@"===cap[2])text=escape$1(cap[0]),href="mailto:"+text;else{let prevCapZero;do{prevCapZero=cap[0],cap[0]=this.rules.inline._backpedal.exec(cap[0])?.[0]??""}while(prevCapZero!==cap[0]);text=escape$1(cap[0]),href="www."===cap[1]?"http://"+cap[0]:cap[0]}return{type:"link",raw:cap[0],text:text,href:href,tokens:[{type:"text",raw:text,text:text}]}}}inlineText(src){const cap=this.rules.inline.text.exec(src);if(cap){let text;return text=this.lexer.state.inRawBlock?cap[0]:escape$1(cap[0]),{type:"text",raw:cap[0],text:text}}}}const hr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,bullet=/(?:[*+-]|\d{1,9}[.)])/,lheading=edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,bullet).replace(/blockCode/g,/ {4}/).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/).getRegex(),_paragraph=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_blockLabel=/(?!\s*\])(?:\\.|[^\[\]\\])+/,def=edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",_blockLabel).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),list=edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bullet).getRegex(),_tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_comment=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,html$2=edit("^ {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",_comment).replace("tag",_tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),paragraph=edit(_paragraph).replace("hr",hr).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",_tag).getRegex(),blockNormal={blockquote:edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",paragraph).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:def,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:hr,html:html$2,lheading:lheading,list:list,newline:/^(?: *(?:\n|$))+/,paragraph:paragraph,table:noopTest,text:/^[^\n]+/},gfmTable=edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex(),blockGfm={...blockNormal,table:gfmTable,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gfmTable).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag).getRegex()},blockPedantic={...blockNormal,html:edit("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",_comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit(_paragraph).replace("hr",hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",lheading).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},escape$2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,br=/^( {2,}|\\)\n(?!\s*$)/,punctuation=edit(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,"\\p{P}\\p{S}").getRegex(),emStrongLDelim=edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),emStrongRDelimAst=edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),emStrongRDelimUnd=edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),anyPunctuation=edit(/\\([punct])/,"gu").replace(/punct/g,"\\p{P}\\p{S}").getRegex(),autolink=edit(/^<(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(),_inlineComment=edit(_comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),tag=edit("^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",_inlineComment).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_inlineLabel=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,link=edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",_inlineLabel).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),reflink=edit(/^!?\[(label)\]\[(ref)\]/).replace("label",_inlineLabel).replace("ref",_blockLabel).getRegex(),nolink=edit(/^!?\[(ref)\](?:\[\])?/).replace("ref",_blockLabel).getRegex(),inlineNormal={_backpedal:noopTest,anyPunctuation:anyPunctuation,autolink:autolink,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:br,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:noopTest,emStrongLDelim:emStrongLDelim,emStrongRDelimAst:emStrongRDelimAst,emStrongRDelimUnd:emStrongRDelimUnd,escape:escape$2,link:link,nolink:nolink,punctuation:punctuation,reflink:reflink,reflinkSearch:edit("reflink|nolink(?!\\()","g").replace("reflink",reflink).replace("nolink",nolink).getRegex(),tag:tag,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:noopTest},inlinePedantic={...inlineNormal,link:edit(/^!?\[(label)\]\((.*?)\)/).replace("label",_inlineLabel).getRegex(),reflink:edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_inlineLabel).getRegex()},inlineGfm={...inlineNormal,escape:edit(escape$2).replace("])","~|])").getRegex(),url:edit(/^((?: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\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.!#$%&'*+\/=?_`{\|}~-]+@)))/},inlineBreaks={...inlineGfm,br:edit(br).replace("{2,}","*").getRegex(),text:edit(inlineGfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},block={normal:blockNormal,gfm:blockGfm,pedantic:blockPedantic},inline={normal:inlineNormal,gfm:inlineGfm,breaks:inlineBreaks,pedantic:inlinePedantic};class _Lexer{tokens;options;state;tokenizer;inlineQueue;constructor(options){this.tokens=[],this.tokens.links=Object.create(null),this.options=options||_defaults,this.options.tokenizer=this.options.tokenizer||new _Tokenizer,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 rules={block:block.normal,inline:inline.normal};this.options.pedantic?(rules.block=block.pedantic,rules.inline=inline.pedantic):this.options.gfm&&(rules.block=block.gfm,this.options.breaks?rules.inline=inline.breaks:rules.inline=inline.gfm),this.tokenizer.rules=rules}static get rules(){return{block:block,inline:inline}}static lex(src,options){return new _Lexer(options).lex(src)}static lexInline(src,options){return new _Lexer(options).inlineTokens(src)}lex(src){src=src.replace(/\r\n|\r/g,"\n"),this.blockTokens(src,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const next=this.inlineQueue[i];this.inlineTokens(next.src,next.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(src,tokens=[]){let token,lastToken,cutSrc,lastParagraphClipped;for(src=this.options.pedantic?src.replace(/\t/g,"    ").replace(/^ +$/gm,""):src.replace(/^( *)(\t+)/gm,(_,leading,tabs)=>leading+"    ".repeat(tabs.length));src;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(extTokenizer=>!!(token=extTokenizer.call({lexer:this},src,tokens))&&(src=src.substring(token.raw.length),tokens.push(token),!0))))if(token=this.tokenizer.space(src))src=src.substring(token.raw.length),1===token.raw.length&&tokens.length>0?tokens[tokens.length-1].raw+="\n":tokens.push(token);else if(token=this.tokenizer.code(src))src=src.substring(token.raw.length),lastToken=tokens[tokens.length-1],!lastToken||"paragraph"!==lastToken.type&&"text"!==lastToken.type?tokens.push(token):(lastToken.raw+="\n"+token.raw,lastToken.text+="\n"+token.text,this.inlineQueue[this.inlineQueue.length-1].src=lastToken.text);else if(token=this.tokenizer.fences(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.heading(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.hr(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.blockquote(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.list(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.html(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.def(src))src=src.substring(token.raw.length),lastToken=tokens[tokens.length-1],!lastToken||"paragraph"!==lastToken.type&&"text"!==lastToken.type?this.tokens.links[token.tag]||(this.tokens.links[token.tag]={href:token.href,title:token.title}):(lastToken.raw+="\n"+token.raw,lastToken.text+="\n"+token.raw,this.inlineQueue[this.inlineQueue.length-1].src=lastToken.text);else if(token=this.tokenizer.table(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.lheading(src))src=src.substring(token.raw.length),tokens.push(token);else{if(cutSrc=src,this.options.extensions&&this.options.extensions.startBlock){let startIndex=1/0;const tempSrc=src.slice(1);let tempStart;this.options.extensions.startBlock.forEach(getStartIndex=>{tempStart=getStartIndex.call({lexer:this},tempSrc),"number"==typeof tempStart&&tempStart>=0&&(startIndex=Math.min(startIndex,tempStart))}),startIndex<1/0&&startIndex>=0&&(cutSrc=src.substring(0,startIndex+1))}if(this.state.top&&(token=this.tokenizer.paragraph(cutSrc)))lastToken=tokens[tokens.length-1],lastParagraphClipped&&"paragraph"===lastToken.type?(lastToken.raw+="\n"+token.raw,lastToken.text+="\n"+token.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=lastToken.text):tokens.push(token),lastParagraphClipped=cutSrc.length!==src.length,src=src.substring(token.raw.length);else if(token=this.tokenizer.text(src))src=src.substring(token.raw.length),lastToken=tokens[tokens.length-1],lastToken&&"text"===lastToken.type?(lastToken.raw+="\n"+token.raw,lastToken.text+="\n"+token.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=lastToken.text):tokens.push(token);else if(src){const errMsg="Infinite loop on byte: "+src.charCodeAt(0);if(this.options.silent){console.error(errMsg);break}throw new Error(errMsg)}}return this.state.top=!0,tokens}inline(src,tokens=[]){return this.inlineQueue.push({src:src,tokens:tokens}),tokens}inlineTokens(src,tokens=[]){let token,lastToken,cutSrc,match,keepPrevChar,prevChar,maskedSrc=src;if(this.tokens.links){const links=Object.keys(this.tokens.links);if(links.length>0)for(;null!=(match=this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc));)links.includes(match[0].slice(match[0].lastIndexOf("[")+1,-1))&&(maskedSrc=maskedSrc.slice(0,match.index)+"["+"a".repeat(match[0].length-2)+"]"+maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(match=this.tokenizer.rules.inline.blockSkip.exec(maskedSrc));)maskedSrc=maskedSrc.slice(0,match.index)+"["+"a".repeat(match[0].length-2)+"]"+maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(match=this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc));)maskedSrc=maskedSrc.slice(0,match.index)+"++"+maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;src;)if(keepPrevChar||(prevChar=""),keepPrevChar=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(extTokenizer=>!!(token=extTokenizer.call({lexer:this},src,tokens))&&(src=src.substring(token.raw.length),tokens.push(token),!0))))if(token=this.tokenizer.escape(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.tag(src))src=src.substring(token.raw.length),lastToken=tokens[tokens.length-1],lastToken&&"text"===token.type&&"text"===lastToken.type?(lastToken.raw+=token.raw,lastToken.text+=token.text):tokens.push(token);else if(token=this.tokenizer.link(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.reflink(src,this.tokens.links))src=src.substring(token.raw.length),lastToken=tokens[tokens.length-1],lastToken&&"text"===token.type&&"text"===lastToken.type?(lastToken.raw+=token.raw,lastToken.text+=token.text):tokens.push(token);else if(token=this.tokenizer.emStrong(src,maskedSrc,prevChar))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.codespan(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.br(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.del(src))src=src.substring(token.raw.length),tokens.push(token);else if(token=this.tokenizer.autolink(src))src=src.substring(token.raw.length),tokens.push(token);else if(this.state.inLink||!(token=this.tokenizer.url(src))){if(cutSrc=src,this.options.extensions&&this.options.extensions.startInline){let startIndex=1/0;const tempSrc=src.slice(1);let tempStart;this.options.extensions.startInline.forEach(getStartIndex=>{tempStart=getStartIndex.call({lexer:this},tempSrc),"number"==typeof tempStart&&tempStart>=0&&(startIndex=Math.min(startIndex,tempStart))}),startIndex<1/0&&startIndex>=0&&(cutSrc=src.substring(0,startIndex+1))}if(token=this.tokenizer.inlineText(cutSrc))src=src.substring(token.raw.length),"_"!==token.raw.slice(-1)&&(prevChar=token.raw.slice(-1)),keepPrevChar=!0,lastToken=tokens[tokens.length-1],lastToken&&"text"===lastToken.type?(lastToken.raw+=token.raw,lastToken.text+=token.text):tokens.push(token);else if(src){const errMsg="Infinite loop on byte: "+src.charCodeAt(0);if(this.options.silent){console.error(errMsg);break}throw new Error(errMsg)}}else src=src.substring(token.raw.length),tokens.push(token);return tokens}}class _Renderer{options;constructor(options){this.options=options||_defaults}code(code,infostring,escaped){const lang=(infostring||"").match(/^\S*/)?.[0];return code=code.replace(/\n$/,"")+"\n",lang?'<pre><code class="language-'+escape$1(lang)+'">'+(escaped?code:escape$1(code,!0))+"</code></pre>\n":"<pre><code>"+(escaped?code:escape$1(code,!0))+"</code></pre>\n"}blockquote(quote){return`<blockquote>\n${quote}</blockquote>\n`}html(html,block){return html}heading(text,level,raw){return`<h${level}>${text}</h${level}>\n`}hr(){return"<hr>\n"}list(body,ordered,start){const type=ordered?"ol":"ul";return"<"+type+(ordered&&1!==start?' start="'+start+'"':"")+">\n"+body+"</"+type+">\n"}listitem(text,task,checked){return`<li>${text}</li>\n`}checkbox(checked){return"<input "+(checked?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(text){return`<p>${text}</p>\n`}table(header,body){return body&&(body=`<tbody>${body}</tbody>`),"<table>\n<thead>\n"+header+"</thead>\n"+body+"</table>\n"}tablerow(content){return`<tr>\n${content}</tr>\n`}tablecell(content,flags){const type=flags.header?"th":"td";return(flags.align?`<${type} align="${flags.align}">`:`<${type}>`)+content+`</${type}>\n`}strong(text){return`<strong>${text}</strong>`}em(text){return`<em>${text}</em>`}codespan(text){return`<code>${text}</code>`}br(){return"<br>"}del(text){return`<del>${text}</del>`}link(href,title,text){const cleanHref=cleanUrl(href);if(null===cleanHref)return text;let out='<a href="'+(href=cleanHref)+'"';return title&&(out+=' title="'+title+'"'),out+=">"+text+"</a>",out}image(href,title,text){const cleanHref=cleanUrl(href);if(null===cleanHref)return text;let out=`<img src="${href=cleanHref}" alt="${text}"`;return title&&(out+=` title="${title}"`),out+=">",out}text(text){return text}}class _TextRenderer{strong(text){return text}em(text){return text}codespan(text){return text}del(text){return text}html(text){return text}text(text){return text}link(href,title,text){return""+text}image(href,title,text){return""+text}br(){return""}}class _Parser{options;renderer;textRenderer;constructor(options){this.options=options||_defaults,this.options.renderer=this.options.renderer||new _Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _TextRenderer}static parse(tokens,options){return new _Parser(options).parse(tokens)}static parseInline(tokens,options){return new _Parser(options).parseInline(tokens)}parse(tokens,top=!0){let out="";for(let i=0;i<tokens.length;i++){const token=tokens[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[token.type]){const genericToken=token,ret=this.options.extensions.renderers[genericToken.type].call({parser:this},genericToken);if(!1!==ret||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(genericToken.type)){out+=ret||"";continue}}switch(token.type){case"space":continue;case"hr":out+=this.renderer.hr();continue;case"heading":{const headingToken=token;out+=this.renderer.heading(this.parseInline(headingToken.tokens),headingToken.depth,unescape(this.parseInline(headingToken.tokens,this.textRenderer)));continue}case"code":{const codeToken=token;out+=this.renderer.code(codeToken.text,codeToken.lang,!!codeToken.escaped);continue}case"table":{const tableToken=token;let header="",cell="";for(let j=0;j<tableToken.header.length;j++)cell+=this.renderer.tablecell(this.parseInline(tableToken.header[j].tokens),{header:!0,align:tableToken.align[j]});header+=this.renderer.tablerow(cell);let body="";for(let j=0;j<tableToken.rows.length;j++){const row=tableToken.rows[j];cell="";for(let k=0;k<row.length;k++)cell+=this.renderer.tablecell(this.parseInline(row[k].tokens),{header:!1,align:tableToken.align[k]});body+=this.renderer.tablerow(cell)}out+=this.renderer.table(header,body);continue}case"blockquote":{const blockquoteToken=token,body=this.parse(blockquoteToken.tokens);out+=this.renderer.blockquote(body);continue}case"list":{const listToken=token,ordered=listToken.ordered,start=listToken.start,loose=listToken.loose;let body="";for(let j=0;j<listToken.items.length;j++){const item=listToken.items[j],checked=item.checked,task=item.task;let itemBody="";if(item.task){const checkbox=this.renderer.checkbox(!!checked);loose?item.tokens.length>0&&"paragraph"===item.tokens[0].type?(item.tokens[0].text=checkbox+" "+item.tokens[0].text,item.tokens[0].tokens&&item.tokens[0].tokens.length>0&&"text"===item.tokens[0].tokens[0].type&&(item.tokens[0].tokens[0].text=checkbox+" "+item.tokens[0].tokens[0].text)):item.tokens.unshift({type:"text",text:checkbox+" "}):itemBody+=checkbox+" "}itemBody+=this.parse(item.tokens,loose),body+=this.renderer.listitem(itemBody,task,!!checked)}out+=this.renderer.list(body,ordered,start);continue}case"html":{const htmlToken=token;out+=this.renderer.html(htmlToken.text,htmlToken.block);continue}case"paragraph":{const paragraphToken=token;out+=this.renderer.paragraph(this.parseInline(paragraphToken.tokens));continue}case"text":{let textToken=token,body=textToken.tokens?this.parseInline(textToken.tokens):textToken.text;for(;i+1<tokens.length&&"text"===tokens[i+1].type;)textToken=tokens[++i],body+="\n"+(textToken.tokens?this.parseInline(textToken.tokens):textToken.text);out+=top?this.renderer.paragraph(body):body;continue}default:{const errMsg='Token with "'+token.type+'" type was not found.';if(this.options.silent)return console.error(errMsg),"";throw new Error(errMsg)}}}return out}parseInline(tokens,renderer){renderer=renderer||this.renderer;let out="";for(let i=0;i<tokens.length;i++){const token=tokens[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[token.type]){const ret=this.options.extensions.renderers[token.type].call({parser:this},token);if(!1!==ret||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(token.type)){out+=ret||"";continue}}switch(token.type){case"escape":{const escapeToken=token;out+=renderer.text(escapeToken.text);break}case"html":{const tagToken=token;out+=renderer.html(tagToken.text);break}case"link":{const linkToken=token;out+=renderer.link(linkToken.href,linkToken.title,this.parseInline(linkToken.tokens,renderer));break}case"image":{const imageToken=token;out+=renderer.image(imageToken.href,imageToken.title,imageToken.text);break}case"strong":{const strongToken=token;out+=renderer.strong(this.parseInline(strongToken.tokens,renderer));break}case"em":{const emToken=token;out+=renderer.em(this.parseInline(emToken.tokens,renderer));break}case"codespan":{const codespanToken=token;out+=renderer.codespan(codespanToken.text);break}case"br":out+=renderer.br();break;case"del":{const delToken=token;out+=renderer.del(this.parseInline(delToken.tokens,renderer));break}case"text":{const textToken=token;out+=renderer.text(textToken.text);break}default:{const errMsg='Token with "'+token.type+'" type was not found.';if(this.options.silent)return console.error(errMsg),"";throw new Error(errMsg)}}}return out}}class _Hooks{options;constructor(options){this.options=options||_defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(markdown){return markdown}postprocess(html){return html}processAllTokens(tokens){return tokens}}const markedInstance=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.#parseMarkdown(_Lexer.lex,_Parser.parse);parseInline=this.#parseMarkdown(_Lexer.lexInline,_Parser.parseInline);Parser=_Parser;Renderer=_Renderer;TextRenderer=_TextRenderer;Lexer=_Lexer;Tokenizer=_Tokenizer;Hooks=_Hooks;constructor(...args){this.use(...args)}walkTokens(tokens,callback){let values=[];for(const token of tokens)switch(values=values.concat(callback.call(this,token)),token.type){case"table":{const tableToken=token;for(const cell of tableToken.header)values=values.concat(this.walkTokens(cell.tokens,callback));for(const row of tableToken.rows)for(const cell of row)values=values.concat(this.walkTokens(cell.tokens,callback));break}case"list":{const listToken=token;values=values.concat(this.walkTokens(listToken.items,callback));break}default:{const genericToken=token;this.defaults.extensions?.childTokens?.[genericToken.type]?this.defaults.extensions.childTokens[genericToken.type].forEach(childTokens=>{const tokens=genericToken[childTokens].flat(1/0);values=values.concat(this.walkTokens(tokens,callback))}):genericToken.tokens&&(values=values.concat(this.walkTokens(genericToken.tokens,callback)))}}return values}use(...args){const extensions=this.defaults.extensions||{renderers:{},childTokens:{}};return args.forEach(pack=>{const opts={...pack};if(opts.async=this.defaults.async||opts.async||!1,pack.extensions&&(pack.extensions.forEach(ext=>{if(!ext.name)throw new Error("extension name required");if("renderer"in ext){const prevRenderer=extensions.renderers[ext.name];extensions.renderers[ext.name]=prevRenderer?function(...args){let ret=ext.renderer.apply(this,args);return!1===ret&&(ret=prevRenderer.apply(this,args)),ret}:ext.renderer}if("tokenizer"in ext){if(!ext.level||"block"!==ext.level&&"inline"!==ext.level)throw new Error("extension level must be 'block' or 'inline'");const extLevel=extensions[ext.level];extLevel?extLevel.unshift(ext.tokenizer):extensions[ext.level]=[ext.tokenizer],ext.start&&("block"===ext.level?extensions.startBlock?extensions.startBlock.push(ext.start):extensions.startBlock=[ext.start]:"inline"===ext.level&&(extensions.startInline?extensions.startInline.push(ext.start):extensions.startInline=[ext.start]))}"childTokens"in ext&&ext.childTokens&&(extensions.childTokens[ext.name]=ext.childTokens)}),opts.extensions=extensions),pack.renderer){const renderer=this.defaults.renderer||new _Renderer(this.defaults);for(const prop in pack.renderer){if(!(prop in renderer))throw new Error(`renderer '${prop}' does not exist`);if("options"===prop)continue;const rendererProp=prop,rendererFunc=pack.renderer[rendererProp],prevRenderer=renderer[rendererProp];renderer[rendererProp]=(...args)=>{let ret=rendererFunc.apply(renderer,args);return!1===ret&&(ret=prevRenderer.apply(renderer,args)),ret||""}}opts.renderer=renderer}if(pack.tokenizer){const tokenizer=this.defaults.tokenizer||new _Tokenizer(this.defaults);for(const prop in pack.tokenizer){if(!(prop in tokenizer))throw new Error(`tokenizer '${prop}' does not exist`);if(["options","rules","lexer"].includes(prop))continue;const tokenizerProp=prop,tokenizerFunc=pack.tokenizer[tokenizerProp],prevTokenizer=tokenizer[tokenizerProp];tokenizer[tokenizerProp]=(...args)=>{let ret=tokenizerFunc.apply(tokenizer,args);return!1===ret&&(ret=prevTokenizer.apply(tokenizer,args)),ret}}opts.tokenizer=tokenizer}if(pack.hooks){const hooks=this.defaults.hooks||new _Hooks;for(const prop in pack.hooks){if(!(prop in hooks))throw new Error(`hook '${prop}' does not exist`);if("options"===prop)continue;const hooksProp=prop,hooksFunc=pack.hooks[hooksProp],prevHook=hooks[hooksProp];_Hooks.passThroughHooks.has(prop)?hooks[hooksProp]=arg=>{if(this.defaults.async)return Promise.resolve(hooksFunc.call(hooks,arg)).then(ret=>prevHook.call(hooks,ret));const ret=hooksFunc.call(hooks,arg);return prevHook.call(hooks,ret)}:hooks[hooksProp]=(...args)=>{let ret=hooksFunc.apply(hooks,args);return!1===ret&&(ret=prevHook.apply(hooks,args)),ret}}opts.hooks=hooks}if(pack.walkTokens){const walkTokens=this.defaults.walkTokens,packWalktokens=pack.walkTokens;opts.walkTokens=function(token){let values=[];return values.push(packWalktokens.call(this,token)),walkTokens&&(values=values.concat(walkTokens.call(this,token))),values}}this.defaults={...this.defaults,...opts}}),this}setOptions(opt){return this.defaults={...this.defaults,...opt},this}lexer(src,options){return _Lexer.lex(src,options??this.defaults)}parser(tokens,options){return _Parser.parse(tokens,options??this.defaults)}#parseMarkdown(lexer,parser){return(src,options)=>{const origOpt={...options},opt={...this.defaults,...origOpt};!0===this.defaults.async&&!1===origOpt.async&&(opt.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),opt.async=!0);const throwError=this.#onError(!!opt.silent,!!opt.async);if(null==src)return throwError(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof src)return throwError(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(src)+", string expected"));if(opt.hooks&&(opt.hooks.options=opt),opt.async)return Promise.resolve(opt.hooks?opt.hooks.preprocess(src):src).then(src=>lexer(src,opt)).then(tokens=>opt.hooks?opt.hooks.processAllTokens(tokens):tokens).then(tokens=>opt.walkTokens?Promise.all(this.walkTokens(tokens,opt.walkTokens)).then(()=>tokens):tokens).then(tokens=>parser(tokens,opt)).then(html=>opt.hooks?opt.hooks.postprocess(html):html).catch(throwError);try{opt.hooks&&(src=opt.hooks.preprocess(src));let tokens=lexer(src,opt);opt.hooks&&(tokens=opt.hooks.processAllTokens(tokens)),opt.walkTokens&&this.walkTokens(tokens,opt.walkTokens);let html=parser(tokens,opt);return opt.hooks&&(html=opt.hooks.postprocess(html)),html}catch(e){return throwError(e)}}}#onError(silent,async){return e=>{if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",silent){const msg="<p>An error occurred:</p><pre>"+escape$1(e.message+"",!0)+"</pre>";return async?Promise.resolve(msg):msg}if(async)return Promise.reject(e);throw e}}};function marked(src,opt){return markedInstance.parse(src,opt)}marked.options=marked.setOptions=function(options){return markedInstance.setOptions(options),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...args){return markedInstance.use(...args),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(tokens,callback){return markedInstance.walkTokens(tokens,callback)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;const{entries:entries,setPrototypeOf:setPrototypeOf,isFrozen:isFrozen,getPrototypeOf:getPrototypeOf,getOwnPropertyDescriptor:getOwnPropertyDescriptor}=Object;let{freeze:freeze,seal:seal,create:create}=Object,{apply:apply,construct:construct}="undefined"!=typeof Reflect&&Reflect;freeze||(freeze=function(x){return x}),seal||(seal=function(x){return x}),apply||(apply=function(fun,thisValue,args){return fun.apply(thisValue,args)}),construct||(construct=function(Func,args){return new Func(...args)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=(func=TypeError,function(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];return construct(func,args)});var func;function unapply(func){return function(thisArg){thisArg instanceof RegExp&&(thisArg.lastIndex=0);for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)args[_key-1]=arguments[_key];return apply(func,thisArg,args)}}function addToSet(set,array){let transformCaseFunc=arguments.length>2&&void 0!==arguments[2]?arguments[2]:stringToLowerCase;setPrototypeOf&&setPrototypeOf(set,null);let l=array.length;for(;l--;){let element=array[l];if("string"==typeof element){const lcElement=transformCaseFunc(element);lcElement!==element&&(isFrozen(array)||(array[l]=lcElement),element=lcElement)}set[element]=!0}return set}function cleanArray(array){for(let index=0;index<array.length;index++){objectHasOwnProperty(array,index)||(array[index]=null)}return array}function clone(object){const newObject=create(null);for(const[property,value]of entries(object)){objectHasOwnProperty(object,property)&&(Array.isArray(value)?newObject[property]=cleanArray(value):value&&"object"==typeof value&&value.constructor===Object?newObject[property]=clone(value):newObject[property]=value)}return newObject}function lookupGetter(object,prop){for(;null!==object;){const desc=getOwnPropertyDescriptor(object,prop);if(desc){if(desc.get)return unapply(desc.get);if("function"==typeof desc.value)return unapply(desc.value)}object=getPrototypeOf(object)}return function(){return null}}const html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml$1=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\$\{[\w\W]*/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var EXPRESSIONS=Object.freeze({__proto__:null,ARIA_ATTR:ARIA_ATTR,ATTR_WHITESPACE:ATTR_WHITESPACE,CUSTOM_ELEMENT:CUSTOM_ELEMENT,DATA_ATTR:DATA_ATTR,DOCTYPE_NAME:DOCTYPE_NAME,ERB_EXPR:ERB_EXPR,IS_ALLOWED_URI:IS_ALLOWED_URI,IS_SCRIPT_OR_DATA:IS_SCRIPT_OR_DATA,MUSTACHE_EXPR:MUSTACHE_EXPR,TMPLIT_EXPR:TMPLIT_EXPR});const NODE_TYPE_element=1,NODE_TYPE_text=3,NODE_TYPE_progressingInstruction=7,NODE_TYPE_comment=8,NODE_TYPE_document=9,getGlobal=function(){return"undefined"==typeof window?null:window};var purify=function createDOMPurify(){let window=arguments.length>0&&void 0!==arguments[0]?arguments[0]:getGlobal();const DOMPurify=root=>createDOMPurify(root);if(DOMPurify.version="3.2.6",DOMPurify.removed=[],!window||!window.document||window.document.nodeType!==NODE_TYPE_document||!window.Element)return DOMPurify.isSupported=!1,DOMPurify;let{document:document}=window;const originalDocument=document,currentScript=originalDocument.currentScript,{DocumentFragment:DocumentFragment,HTMLTemplateElement:HTMLTemplateElement,Node:Node,Element:Element,NodeFilter:NodeFilter,NamedNodeMap:NamedNodeMap=window.NamedNodeMap||window.MozNamedAttrMap,HTMLFormElement:HTMLFormElement,DOMParser:DOMParser,trustedTypes:trustedTypes}=window,ElementPrototype=Element.prototype,cloneNode=lookupGetter(ElementPrototype,"cloneNode"),remove=lookupGetter(ElementPrototype,"remove"),getNextSibling=lookupGetter(ElementPrototype,"nextSibling"),getChildNodes=lookupGetter(ElementPrototype,"childNodes"),getParentNode=lookupGetter(ElementPrototype,"parentNode");if("function"==typeof HTMLTemplateElement){const template=document.createElement("template");template.content&&template.content.ownerDocument&&(document=template.content.ownerDocument)}let trustedTypesPolicy,emptyHTML="";const{implementation:implementation,createNodeIterator:createNodeIterator,createDocumentFragment:createDocumentFragment,getElementsByTagName:getElementsByTagName}=document,{importNode:importNode}=originalDocument;let hooks={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};DOMPurify.isSupported="function"==typeof entries&&"function"==typeof getParentNode&&implementation&&void 0!==implementation.createHTMLDocument;const{MUSTACHE_EXPR:MUSTACHE_EXPR,ERB_EXPR:ERB_EXPR,TMPLIT_EXPR:TMPLIT_EXPR,DATA_ATTR:DATA_ATTR,ARIA_ATTR:ARIA_ATTR,IS_SCRIPT_OR_DATA:IS_SCRIPT_OR_DATA,ATTR_WHITESPACE:ATTR_WHITESPACE,CUSTOM_ELEMENT:CUSTOM_ELEMENT}=EXPRESSIONS;let{IS_ALLOWED_URI:IS_ALLOWED_URI$1}=EXPRESSIONS,ALLOWED_TAGS=null;const DEFAULT_ALLOWED_TAGS=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text]);let ALLOWED_ATTR=null;const DEFAULT_ALLOWED_ATTR=addToSet({},[...html,...svg,...mathMl,...xml$1]);let CUSTOM_ELEMENT_HANDLING=Object.seal(create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),FORBID_TAGS=null,FORBID_ATTR=null,ALLOW_ARIA_ATTR=!0,ALLOW_DATA_ATTR=!0,ALLOW_UNKNOWN_PROTOCOLS=!1,ALLOW_SELF_CLOSE_IN_ATTR=!0,SAFE_FOR_TEMPLATES=!1,SAFE_FOR_XML=!0,WHOLE_DOCUMENT=!1,SET_CONFIG=!1,FORCE_BODY=!1,RETURN_DOM=!1,RETURN_DOM_FRAGMENT=!1,RETURN_TRUSTED_TYPE=!1,SANITIZE_DOM=!0,SANITIZE_NAMED_PROPS=!1,KEEP_CONTENT=!0,IN_PLACE=!1,USE_PROFILES={},FORBID_CONTENTS=null;const DEFAULT_FORBID_CONTENTS=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let DATA_URI_TAGS=null;const DEFAULT_DATA_URI_TAGS=addToSet({},["audio","video","img","source","image","track"]);let URI_SAFE_ATTRIBUTES=null;const DEFAULT_URI_SAFE_ATTRIBUTES=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),MATHML_NAMESPACE="http://www.w3.org/1998/Math/MathML",SVG_NAMESPACE="http://www.w3.org/2000/svg",HTML_NAMESPACE="http://www.w3.org/1999/xhtml";let NAMESPACE=HTML_NAMESPACE,IS_EMPTY_INPUT=!1,ALLOWED_NAMESPACES=null;const DEFAULT_ALLOWED_NAMESPACES=addToSet({},[MATHML_NAMESPACE,SVG_NAMESPACE,HTML_NAMESPACE],stringToString);let MATHML_TEXT_INTEGRATION_POINTS=addToSet({},["mi","mo","mn","ms","mtext"]),HTML_INTEGRATION_POINTS=addToSet({},["annotation-xml"]);const COMMON_SVG_AND_HTML_ELEMENTS=addToSet({},["title","style","font","a","script"]);let PARSER_MEDIA_TYPE=null;const SUPPORTED_PARSER_MEDIA_TYPES=["application/xhtml+xml","text/html"];let transformCaseFunc=null,CONFIG=null;const formElement=document.createElement("form"),isRegexOrFunction=function(testValue){return testValue instanceof RegExp||testValue instanceof Function},_parseConfig=function(){let cfg=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!CONFIG||CONFIG!==cfg){if(cfg&&"object"==typeof cfg||(cfg={}),cfg=clone(cfg),PARSER_MEDIA_TYPE=-1===SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE)?"text/html":cfg.PARSER_MEDIA_TYPE,transformCaseFunc="application/xhtml+xml"===PARSER_MEDIA_TYPE?stringToString:stringToLowerCase,ALLOWED_TAGS=objectHasOwnProperty(cfg,"ALLOWED_TAGS")?addToSet({},cfg.ALLOWED_TAGS,transformCaseFunc):DEFAULT_ALLOWED_TAGS,ALLOWED_ATTR=objectHasOwnProperty(cfg,"ALLOWED_ATTR")?addToSet({},cfg.ALLOWED_ATTR,transformCaseFunc):DEFAULT_ALLOWED_ATTR,ALLOWED_NAMESPACES=objectHasOwnProperty(cfg,"ALLOWED_NAMESPACES")?addToSet({},cfg.ALLOWED_NAMESPACES,stringToString):DEFAULT_ALLOWED_NAMESPACES,URI_SAFE_ATTRIBUTES=objectHasOwnProperty(cfg,"ADD_URI_SAFE_ATTR")?addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),cfg.ADD_URI_SAFE_ATTR,transformCaseFunc):DEFAULT_URI_SAFE_ATTRIBUTES,DATA_URI_TAGS=objectHasOwnProperty(cfg,"ADD_DATA_URI_TAGS")?addToSet(clone(DEFAULT_DATA_URI_TAGS),cfg.ADD_DATA_URI_TAGS,transformCaseFunc):DEFAULT_DATA_URI_TAGS,FORBID_CONTENTS=objectHasOwnProperty(cfg,"FORBID_CONTENTS")?addToSet({},cfg.FORBID_CONTENTS,transformCaseFunc):DEFAULT_FORBID_CONTENTS,FORBID_TAGS=objectHasOwnProperty(cfg,"FORBID_TAGS")?addToSet({},cfg.FORBID_TAGS,transformCaseFunc):clone({}),FORBID_ATTR=objectHasOwnProperty(cfg,"FORBID_ATTR")?addToSet({},cfg.FORBID_ATTR,transformCaseFunc):clone({}),USE_PROFILES=!!objectHasOwnProperty(cfg,"USE_PROFILES")&&cfg.USE_PROFILES,ALLOW_ARIA_ATTR=!1!==cfg.ALLOW_ARIA_ATTR,ALLOW_DATA_ATTR=!1!==cfg.ALLOW_DATA_ATTR,ALLOW_UNKNOWN_PROTOCOLS=cfg.ALLOW_UNKNOWN_PROTOCOLS||!1,ALLOW_SELF_CLOSE_IN_ATTR=!1!==cfg.ALLOW_SELF_CLOSE_IN_ATTR,SAFE_FOR_TEMPLATES=cfg.SAFE_FOR_TEMPLATES||!1,SAFE_FOR_XML=!1!==cfg.SAFE_FOR_XML,WHOLE_DOCUMENT=cfg.WHOLE_DOCUMENT||!1,RETURN_DOM=cfg.RETURN_DOM||!1,RETURN_DOM_FRAGMENT=cfg.RETURN_DOM_FRAGMENT||!1,RETURN_TRUSTED_TYPE=cfg.RETURN_TRUSTED_TYPE||!1,FORCE_BODY=cfg.FORCE_BODY||!1,SANITIZE_DOM=!1!==cfg.SANITIZE_DOM,SANITIZE_NAMED_PROPS=cfg.SANITIZE_NAMED_PROPS||!1,KEEP_CONTENT=!1!==cfg.KEEP_CONTENT,IN_PLACE=cfg.IN_PLACE||!1,IS_ALLOWED_URI$1=cfg.ALLOWED_URI_REGEXP||IS_ALLOWED_URI,NAMESPACE=cfg.NAMESPACE||HTML_NAMESPACE,MATHML_TEXT_INTEGRATION_POINTS=cfg.MATHML_TEXT_INTEGRATION_POINTS||MATHML_TEXT_INTEGRATION_POINTS,HTML_INTEGRATION_POINTS=cfg.HTML_INTEGRATION_POINTS||HTML_INTEGRATION_POINTS,CUSTOM_ELEMENT_HANDLING=cfg.CUSTOM_ELEMENT_HANDLING||{},cfg.CUSTOM_ELEMENT_HANDLING&&isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck=cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck),cfg.CUSTOM_ELEMENT_HANDLING&&isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(CUSTOM_ELEMENT_HANDLING.attributeNameCheck=cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),cfg.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),SAFE_FOR_TEMPLATES&&(ALLOW_DATA_ATTR=!1),RETURN_DOM_FRAGMENT&&(RETURN_DOM=!0),USE_PROFILES&&(ALLOWED_TAGS=addToSet({},text),ALLOWED_ATTR=[],!0===USE_PROFILES.html&&(addToSet(ALLOWED_TAGS,html$1),addToSet(ALLOWED_ATTR,html)),!0===USE_PROFILES.svg&&(addToSet(ALLOWED_TAGS,svg$1),addToSet(ALLOWED_ATTR,svg),addToSet(ALLOWED_ATTR,xml$1)),!0===USE_PROFILES.svgFilters&&(addToSet(ALLOWED_TAGS,svgFilters),addToSet(ALLOWED_ATTR,svg),addToSet(ALLOWED_ATTR,xml$1)),!0===USE_PROFILES.mathMl&&(addToSet(ALLOWED_TAGS,mathMl$1),addToSet(ALLOWED_ATTR,mathMl),addToSet(ALLOWED_ATTR,xml$1))),cfg.ADD_TAGS&&(ALLOWED_TAGS===DEFAULT_ALLOWED_TAGS&&(ALLOWED_TAGS=clone(ALLOWED_TAGS)),addToSet(ALLOWED_TAGS,cfg.ADD_TAGS,transformCaseFunc)),cfg.ADD_ATTR&&(ALLOWED_ATTR===DEFAULT_ALLOWED_ATTR&&(ALLOWED_ATTR=clone(ALLOWED_ATTR)),addToSet(ALLOWED_ATTR,cfg.ADD_ATTR,transformCaseFunc)),cfg.ADD_URI_SAFE_ATTR&&addToSet(URI_SAFE_ATTRIBUTES,cfg.ADD_URI_SAFE_ATTR,transformCaseFunc),cfg.FORBID_CONTENTS&&(FORBID_CONTENTS===DEFAULT_FORBID_CONTENTS&&(FORBID_CONTENTS=clone(FORBID_CONTENTS)),addToSet(FORBID_CONTENTS,cfg.FORBID_CONTENTS,transformCaseFunc)),KEEP_CONTENT&&(ALLOWED_TAGS["#text"]=!0),WHOLE_DOCUMENT&&addToSet(ALLOWED_TAGS,["html","head","body"]),ALLOWED_TAGS.table&&(addToSet(ALLOWED_TAGS,["tbody"]),delete FORBID_TAGS.tbody),cfg.TRUSTED_TYPES_POLICY){if("function"!=typeof cfg.TRUSTED_TYPES_POLICY.createHTML)throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL)throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');trustedTypesPolicy=cfg.TRUSTED_TYPES_POLICY,emptyHTML=trustedTypesPolicy.createHTML("")}else void 0===trustedTypesPolicy&&(trustedTypesPolicy=function(trustedTypes,purifyHostElement){if("object"!=typeof trustedTypes||"function"!=typeof trustedTypes.createPolicy)return null;let suffix=null;purifyHostElement&&purifyHostElement.hasAttribute("data-tt-policy-suffix")&&(suffix=purifyHostElement.getAttribute("data-tt-policy-suffix"));const policyName="dompurify"+(suffix?"#"+suffix:"");try{return trustedTypes.createPolicy(policyName,{createHTML:html=>html,createScriptURL:scriptUrl=>scriptUrl})}catch(_){return console.warn("TrustedTypes policy "+policyName+" could not be created."),null}}(trustedTypes,currentScript)),null!==trustedTypesPolicy&&"string"==typeof emptyHTML&&(emptyHTML=trustedTypesPolicy.createHTML(""));freeze&&freeze(cfg),CONFIG=cfg}},ALL_SVG_TAGS=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),ALL_MATHML_TAGS=addToSet({},[...mathMl$1,...mathMlDisallowed]),_forceRemove=function(node){arrayPush(DOMPurify.removed,{element:node});try{getParentNode(node).removeChild(node)}catch(_){remove(node)}},_removeAttribute=function(name,element){try{arrayPush(DOMPurify.removed,{attribute:element.getAttributeNode(name),from:element})}catch(_){arrayPush(DOMPurify.removed,{attribute:null,from:element})}if(element.removeAttribute(name),"is"===name)if(RETURN_DOM||RETURN_DOM_FRAGMENT)try{_forceRemove(element)}catch(_){}else try{element.setAttribute(name,"")}catch(_){}},_initDocument=function(dirty){let doc=null,leadingWhitespace=null;if(FORCE_BODY)dirty="<remove></remove>"+dirty;else{const matches=stringMatch(dirty,/^[\r\n\t ]+/);leadingWhitespace=matches&&matches[0]}"application/xhtml+xml"===PARSER_MEDIA_TYPE&&NAMESPACE===HTML_NAMESPACE&&(dirty='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+dirty+"</body></html>");const dirtyPayload=trustedTypesPolicy?trustedTypesPolicy.createHTML(dirty):dirty;if(NAMESPACE===HTML_NAMESPACE)try{doc=(new DOMParser).parseFromString(dirtyPayload,PARSER_MEDIA_TYPE)}catch(_){}if(!doc||!doc.documentElement){doc=implementation.createDocument(NAMESPACE,"template",null);try{doc.documentElement.innerHTML=IS_EMPTY_INPUT?emptyHTML:dirtyPayload}catch(_){}}const body=doc.body||doc.documentElement;return dirty&&leadingWhitespace&&body.insertBefore(document.createTextNode(leadingWhitespace),body.childNodes[0]||null),NAMESPACE===HTML_NAMESPACE?getElementsByTagName.call(doc,WHOLE_DOCUMENT?"html":"body")[0]:WHOLE_DOCUMENT?doc.documentElement:body},_createNodeIterator=function(root){return createNodeIterator.call(root.ownerDocument||root,root,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_PROCESSING_INSTRUCTION|NodeFilter.SHOW_CDATA_SECTION,null)},_isClobbered=function(element){return element instanceof HTMLFormElement&&("string"!=typeof element.nodeName||"string"!=typeof element.textContent||"function"!=typeof element.removeChild||!(element.attributes instanceof NamedNodeMap)||"function"!=typeof element.removeAttribute||"function"!=typeof element.setAttribute||"string"!=typeof element.namespaceURI||"function"!=typeof element.insertBefore||"function"!=typeof element.hasChildNodes)},_isNode=function(value){return"function"==typeof Node&&value instanceof Node};function _executeHooks(hooks,currentNode,data){arrayForEach(hooks,hook=>{hook.call(DOMPurify,currentNode,data,CONFIG)})}const _sanitizeElements=function(currentNode){let content=null;if(_executeHooks(hooks.beforeSanitizeElements,currentNode,null),_isClobbered(currentNode))return _forceRemove(currentNode),!0;const tagName=transformCaseFunc(currentNode.nodeName);if(_executeHooks(hooks.uponSanitizeElement,currentNode,{tagName:tagName,allowedTags:ALLOWED_TAGS}),SAFE_FOR_XML&&currentNode.hasChildNodes()&&!_isNode(currentNode.firstElementChild)&&regExpTest(/<[/\w!]/g,currentNode.innerHTML)&&regExpTest(/<[/\w!]/g,currentNode.textContent))return _forceRemove(currentNode),!0;if(currentNode.nodeType===NODE_TYPE_progressingInstruction)return _forceRemove(currentNode),!0;if(SAFE_FOR_XML&&currentNode.nodeType===NODE_TYPE_comment&&regExpTest(/<[/\w]/g,currentNode.data))return _forceRemove(currentNode),!0;if(!ALLOWED_TAGS[tagName]||FORBID_TAGS[tagName]){if(!FORBID_TAGS[tagName]&&_isBasicCustomElement(tagName)){if(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,tagName))return!1;if(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName))return!1}if(KEEP_CONTENT&&!FORBID_CONTENTS[tagName]){const parentNode=getParentNode(currentNode)||currentNode.parentNode,childNodes=getChildNodes(currentNode)||currentNode.childNodes;if(childNodes&&parentNode){for(let i=childNodes.length-1;i>=0;--i){const childClone=cloneNode(childNodes[i],!0);childClone.__removalCount=(currentNode.__removalCount||0)+1,parentNode.insertBefore(childClone,getNextSibling(currentNode))}}}return _forceRemove(currentNode),!0}return currentNode instanceof Element&&!function(element){let parent=getParentNode(element);parent&&parent.tagName||(parent={namespaceURI:NAMESPACE,tagName:"template"});const tagName=stringToLowerCase(element.tagName),parentTagName=stringToLowerCase(parent.tagName);return!!ALLOWED_NAMESPACES[element.namespaceURI]&&(element.namespaceURI===SVG_NAMESPACE?parent.namespaceURI===HTML_NAMESPACE?"svg"===tagName:parent.namespaceURI===MATHML_NAMESPACE?"svg"===tagName&&("annotation-xml"===parentTagName||MATHML_TEXT_INTEGRATION_POINTS[parentTagName]):Boolean(ALL_SVG_TAGS[tagName]):element.namespaceURI===MATHML_NAMESPACE?parent.namespaceURI===HTML_NAMESPACE?"math"===tagName:parent.namespaceURI===SVG_NAMESPACE?"math"===tagName&&HTML_INTEGRATION_POINTS[parentTagName]:Boolean(ALL_MATHML_TAGS[tagName]):element.namespaceURI===HTML_NAMESPACE?!(parent.namespaceURI===SVG_NAMESPACE&&!HTML_INTEGRATION_POINTS[parentTagName])&&!(parent.namespaceURI===MATHML_NAMESPACE&&!MATHML_TEXT_INTEGRATION_POINTS[parentTagName])&&!ALL_MATHML_TAGS[tagName]&&(COMMON_SVG_AND_HTML_ELEMENTS[tagName]||!ALL_SVG_TAGS[tagName]):!("application/xhtml+xml"!==PARSER_MEDIA_TYPE||!ALLOWED_NAMESPACES[element.namespaceURI]))}(currentNode)?(_forceRemove(currentNode),!0):"noscript"!==tagName&&"noembed"!==tagName&&"noframes"!==tagName||!regExpTest(/<\/no(script|embed|frames)/i,currentNode.innerHTML)?(SAFE_FOR_TEMPLATES&&currentNode.nodeType===NODE_TYPE_text&&(content=currentNode.textContent,arrayForEach([MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR],expr=>{content=stringReplace(content,expr," ")}),currentNode.textContent!==content&&(arrayPush(DOMPurify.removed,{element:currentNode.cloneNode()}),currentNode.textContent=content)),_executeHooks(hooks.afterSanitizeElements,currentNode,null),!1):(_forceRemove(currentNode),!0)},_isValidAttribute=function(lcTag,lcName,value){if(SANITIZE_DOM&&("id"===lcName||"name"===lcName)&&(value in document||value in formElement))return!1;if(ALLOW_DATA_ATTR&&!FORBID_ATTR[lcName]&&regExpTest(DATA_ATTR,lcName));else if(ALLOW_ARIA_ATTR&&regExpTest(ARIA_ATTR,lcName));else if(!ALLOWED_ATTR[lcName]||FORBID_ATTR[lcName]){if(!(_isBasicCustomElement(lcTag)&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,lcTag)||CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag))&&(CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck,lcName)||CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName))||"is"===lcName&&CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp&&regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck,value)||CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function&&CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))))return!1}else if(URI_SAFE_ATTRIBUTES[lcName]);else if(regExpTest(IS_ALLOWED_URI$1,stringReplace(value,ATTR_WHITESPACE,"")));else if("src"!==lcName&&"xlink:href"!==lcName&&"href"!==lcName||"script"===lcTag||0!==stringIndexOf(value,"data:")||!DATA_URI_TAGS[lcTag]){if(ALLOW_UNKNOWN_PROTOCOLS&&!regExpTest(IS_SCRIPT_OR_DATA,stringReplace(value,ATTR_WHITESPACE,"")));else if(value)return!1}else;return!0},_isBasicCustomElement=function(tagName){return"annotation-xml"!==tagName&&stringMatch(tagName,CUSTOM_ELEMENT)},_sanitizeAttributes=function(currentNode){_executeHooks(hooks.beforeSanitizeAttributes,currentNode,null);const{attributes:attributes}=currentNode;if(!attributes||_isClobbered(currentNode))return;const hookEvent={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ALLOWED_ATTR,forceKeepAttr:void 0};let l=attributes.length;for(;l--;){const attr=attributes[l],{name:name,namespaceURI:namespaceURI,value:attrValue}=attr,lcName=transformCaseFunc(name),initValue=attrValue;let value="value"===name?initValue:stringTrim(initValue);if(hookEvent.attrName=lcName,hookEvent.attrValue=value,hookEvent.keepAttr=!0,hookEvent.forceKeepAttr=void 0,_executeHooks(hooks.uponSanitizeAttribute,currentNode,hookEvent),value=hookEvent.attrValue,!SANITIZE_NAMED_PROPS||"id"!==lcName&&"name"!==lcName||(_removeAttribute(name,currentNode),value="user-content-"+value),SAFE_FOR_XML&&regExpTest(/((--!?|])>)|<\/(style|title)/i,value)){_removeAttribute(name,currentNode);continue}if(hookEvent.forceKeepAttr)continue;if(!hookEvent.keepAttr){_removeAttribute(name,currentNode);continue}if(!ALLOW_SELF_CLOSE_IN_ATTR&&regExpTest(/\/>/i,value)){_removeAttribute(name,currentNode);continue}SAFE_FOR_TEMPLATES&&arrayForEach([MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR],expr=>{value=stringReplace(value,expr," ")});const lcTag=transformCaseFunc(currentNode.nodeName);if(_isValidAttribute(lcTag,lcName,value)){if(trustedTypesPolicy&&"object"==typeof trustedTypes&&"function"==typeof trustedTypes.getAttributeType)if(namespaceURI);else switch(trustedTypes.getAttributeType(lcTag,lcName)){case"TrustedHTML":value=trustedTypesPolicy.createHTML(value);break;case"TrustedScriptURL":value=trustedTypesPolicy.createScriptURL(value)}if(value!==initValue)try{namespaceURI?currentNode.setAttributeNS(namespaceURI,name,value):currentNode.setAttribute(name,value),_isClobbered(currentNode)?_forceRemove(currentNode):arrayPop(DOMPurify.removed)}catch(_){_removeAttribute(name,currentNode)}}else _removeAttribute(name,currentNode)}_executeHooks(hooks.afterSanitizeAttributes,currentNode,null)},_sanitizeShadowDOM=function _sanitizeShadowDOM(fragment){let shadowNode=null;const shadowIterator=_createNodeIterator(fragment);for(_executeHooks(hooks.beforeSanitizeShadowDOM,fragment,null);shadowNode=shadowIterator.nextNode();)_executeHooks(hooks.uponSanitizeShadowNode,shadowNode,null),_sanitizeElements(shadowNode),_sanitizeAttributes(shadowNode),shadowNode.content instanceof DocumentFragment&&_sanitizeShadowDOM(shadowNode.content);_executeHooks(hooks.afterSanitizeShadowDOM,fragment,null)};return DOMPurify.sanitize=function(dirty){let cfg=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},body=null,importedNode=null,currentNode=null,returnNode=null;if(IS_EMPTY_INPUT=!dirty,IS_EMPTY_INPUT&&(dirty="\x3c!--\x3e"),"string"!=typeof dirty&&!_isNode(dirty)){if("function"!=typeof dirty.toString)throw typeErrorCreate("toString is not a function");if("string"!=typeof(dirty=dirty.toString()))throw typeErrorCreate("dirty is not a string, aborting")}if(!DOMPurify.isSupported)return dirty;if(SET_CONFIG||_parseConfig(cfg),DOMPurify.removed=[],"string"==typeof dirty&&(IN_PLACE=!1),IN_PLACE){if(dirty.nodeName){const tagName=transformCaseFunc(dirty.nodeName);if(!ALLOWED_TAGS[tagName]||FORBID_TAGS[tagName])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(dirty instanceof Node)body=_initDocument("\x3c!----\x3e"),importedNode=body.ownerDocument.importNode(dirty,!0),importedNode.nodeType===NODE_TYPE_element&&"BODY"===importedNode.nodeName||"HTML"===importedNode.nodeName?body=importedNode:body.appendChild(importedNode);else{if(!RETURN_DOM&&!SAFE_FOR_TEMPLATES&&!WHOLE_DOCUMENT&&-1===dirty.indexOf("<"))return trustedTypesPolicy&&RETURN_TRUSTED_TYPE?trustedTypesPolicy.createHTML(dirty):dirty;if(body=_initDocument(dirty),!body)return RETURN_DOM?null:RETURN_TRUSTED_TYPE?emptyHTML:""}body&&FORCE_BODY&&_forceRemove(body.firstChild);const nodeIterator=_createNodeIterator(IN_PLACE?dirty:body);for(;currentNode=nodeIterator.nextNode();)_sanitizeElements(currentNode),_sanitizeAttributes(currentNode),currentNode.content instanceof DocumentFragment&&_sanitizeShadowDOM(currentNode.content);if(IN_PLACE)return dirty;if(RETURN_DOM){if(RETURN_DOM_FRAGMENT)for(returnNode=createDocumentFragment.call(body.ownerDocument);body.firstChild;)returnNode.appendChild(body.firstChild);else returnNode=body;return(ALLOWED_ATTR.shadowroot||ALLOWED_ATTR.shadowrootmode)&&(returnNode=importNode.call(originalDocument,returnNode,!0)),returnNode}let serializedHTML=WHOLE_DOCUMENT?body.outerHTML:body.innerHTML;return WHOLE_DOCUMENT&&ALLOWED_TAGS["!doctype"]&&body.ownerDocument&&body.ownerDocument.doctype&&body.ownerDocument.doctype.name&&regExpTest(DOCTYPE_NAME,body.ownerDocument.doctype.name)&&(serializedHTML="<!DOCTYPE "+body.ownerDocument.doctype.name+">\n"+serializedHTML),SAFE_FOR_TEMPLATES&&arrayForEach([MUSTACHE_EXPR,ERB_EXPR,TMPLIT_EXPR],expr=>{serializedHTML=stringReplace(serializedHTML,expr," ")}),trustedTypesPolicy&&RETURN_TRUSTED_TYPE?trustedTypesPolicy.createHTML(serializedHTML):serializedHTML},DOMPurify.setConfig=function(){_parseConfig(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),SET_CONFIG=!0},DOMPurify.clearConfig=function(){CONFIG=null,SET_CONFIG=!1},DOMPurify.isValidAttribute=function(tag,attr,value){CONFIG||_parseConfig({});const lcTag=transformCaseFunc(tag),lcName=transformCaseFunc(attr);return _isValidAttribute(lcTag,lcName,value)},DOMPurify.addHook=function(entryPoint,hookFunction){"function"==typeof hookFunction&&arrayPush(hooks[entryPoint],hookFunction)},DOMPurify.removeHook=function(entryPoint,hookFunction){if(void 0!==hookFunction){const index=arrayLastIndexOf(hooks[entryPoint],hookFunction);return-1===index?void 0:arraySplice(hooks[entryPoint],index,1)[0]}return arrayPop(hooks[entryPoint])},DOMPurify.removeHooks=function(entryPoint){hooks[entryPoint]=[]},DOMPurify.removeAllHooks=function(){hooks={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},DOMPurify}();function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}function deepFreeze(obj){return obj instanceof Map?obj.clear=obj.delete=obj.set=function(){throw new Error("map is read-only")}:obj instanceof Set&&(obj.add=obj.clear=obj.delete=function(){throw new Error("set is read-only")}),Object.freeze(obj),Object.getOwnPropertyNames(obj).forEach(name=>{const prop=obj[name],type=typeof prop;"object"!==type&&"function"!==type||Object.isFrozen(prop)||deepFreeze(prop)}),obj}class Response{constructor(mode){void 0===mode.data&&(mode.data={}),this.data=mode.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function escapeHTML(value){return value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function inherit$1(original,...objects){const result=Object.create(null);for(const key in original)result[key]=original[key];return objects.forEach(function(obj){for(const key in obj)result[key]=obj[key]}),result}const emitsWrappingTags=node=>!!node.scope;class HTMLRenderer{constructor(parseTree,options){this.buffer="",this.classPrefix=options.classPrefix,parseTree.walk(this)}addText(text){this.buffer+=escapeHTML(text)}openNode(node){if(!emitsWrappingTags(node))return;const className=((name,{prefix:prefix})=>{if(name.startsWith("language:"))return name.replace("language:","language-");if(name.includes(".")){const pieces=name.split(".");return[`${prefix}${pieces.shift()}`,...pieces.map((x,i)=>`${x}${"_".repeat(i+1)}`)].join(" ")}return`${prefix}${name}`})(node.scope,{prefix:this.classPrefix});this.span(className)}closeNode(node){emitsWrappingTags(node)&&(this.buffer+="</span>")}value(){return this.buffer}span(className){this.buffer+=`<span class="${className}">`}}const newNode=(opts={})=>{const result={children:[]};return Object.assign(result,opts),result};class TokenTree{constructor(){this.rootNode=newNode(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(node){this.top.children.push(node)}openNode(scope){const node=newNode({scope:scope});this.add(node),this.stack.push(node)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(builder){return this.constructor._walk(builder,this.rootNode)}static _walk(builder,node){return"string"==typeof node?builder.addText(node):node.children&&(builder.openNode(node),node.children.forEach(child=>this._walk(builder,child)),builder.closeNode(node)),builder}static _collapse(node){"string"!=typeof node&&node.children&&(node.children.every(el=>"string"==typeof el)?node.children=[node.children.join("")]:node.children.forEach(child=>{TokenTree._collapse(child)}))}}class TokenTreeEmitter extends TokenTree{constructor(options){super(),this.options=options}addText(text){""!==text&&this.add(text)}startScope(scope){this.openNode(scope)}endScope(){this.closeNode()}__addSublanguage(emitter,name){const node=emitter.root;name&&(node.scope=`language:${name}`),this.add(node)}toHTML(){return new HTMLRenderer(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function source(re){return re?"string"==typeof re?re:re.source:null}function lookahead(re){return concat("(?=",re,")")}function anyNumberOfTimes(re){return concat("(?:",re,")*")}function optional(re){return concat("(?:",re,")?")}function concat(...args){return args.map(x=>source(x)).join("")}function either(...args){const opts=function(args){const opts=args[args.length-1];return"object"==typeof opts&&opts.constructor===Object?(args.splice(args.length-1,1),opts):{}}(args);return"("+(opts.capture?"":"?:")+args.map(x=>source(x)).join("|")+")"}function countMatchGroups(re){return new RegExp(re.toString()+"|").exec("").length-1}const BACKREF_RE=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _rewriteBackreferences(regexps,{joinWith:joinWith}){let numCaptures=0;return regexps.map(regex=>{numCaptures+=1;const offset=numCaptures;let re=source(regex),out="";for(;re.length>0;){const match=BACKREF_RE.exec(re);if(!match){out+=re;break}out+=re.substring(0,match.index),re=re.substring(match.index+match[0].length),"\\"===match[0][0]&&match[1]?out+="\\"+String(Number(match[1])+offset):(out+=match[0],"("===match[0]&&numCaptures++)}return out}).map(re=>`(${re})`).join(joinWith)}const C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},APOS_STRING_MODE={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[BACKSLASH_ESCAPE]},QUOTE_STRING_MODE={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[BACKSLASH_ESCAPE]},COMMENT=function(begin,end,modeOptions={}){const mode=inherit$1({scope:"comment",begin:begin,end:end,contains:[]},modeOptions);mode.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ENGLISH_WORD=either("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return mode.contains.push({begin:concat(/[ ]+/,"(",ENGLISH_WORD,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),mode},C_LINE_COMMENT_MODE=COMMENT("//","$"),C_BLOCK_COMMENT_MODE=COMMENT("/\\*","\\*/"),HASH_COMMENT_MODE=COMMENT("#","$"),NUMBER_MODE={scope:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE={scope:"number",begin:C_NUMBER_RE,relevance:0},BINARY_NUMBER_MODE={scope:"number",begin:"\\b(0b[01]+)",relevance:0},REGEXP_MODE={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[BACKSLASH_ESCAPE]}]},TITLE_MODE={scope:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE={scope:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var MODES$1=Object.freeze({__proto__:null,APOS_STRING_MODE:APOS_STRING_MODE,BACKSLASH_ESCAPE:BACKSLASH_ESCAPE,BINARY_NUMBER_MODE:BINARY_NUMBER_MODE,BINARY_NUMBER_RE:"\\b(0b[01]+)",COMMENT:COMMENT,C_BLOCK_COMMENT_MODE:C_BLOCK_COMMENT_MODE,C_LINE_COMMENT_MODE:C_LINE_COMMENT_MODE,C_NUMBER_MODE:C_NUMBER_MODE,C_NUMBER_RE:C_NUMBER_RE,END_SAME_AS_BEGIN:function(mode){return Object.assign(mode,{"on:begin":(m,resp)=>{resp.data._beginMatch=m[1]},"on:end":(m,resp)=>{resp.data._beginMatch!==m[1]&&resp.ignoreMatch()}})},HASH_COMMENT_MODE:HASH_COMMENT_MODE,IDENT_RE:"[a-zA-Z]\\w*",MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:METHOD_GUARD,NUMBER_MODE:NUMBER_MODE,NUMBER_RE:"\\b\\d+(\\.\\d+)?",PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:QUOTE_STRING_MODE,REGEXP_MODE:REGEXP_MODE,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(opts={})=>{const beginShebang=/^#![ ]*\//;return opts.binary&&(opts.begin=concat(beginShebang,/.*\b/,opts.binary,/\b.*/)),inherit$1({scope:"meta",begin:beginShebang,end:/$/,relevance:0,"on:begin":(m,resp)=>{0!==m.index&&resp.ignoreMatch()}},opts)},TITLE_MODE:TITLE_MODE,UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",UNDERSCORE_TITLE_MODE:UNDERSCORE_TITLE_MODE});function skipIfHasPrecedingDot(match,response){"."===match.input[match.index-1]&&response.ignoreMatch()}function scopeClassName(mode,_parent){void 0!==mode.className&&(mode.scope=mode.className,delete mode.className)}function beginKeywords(mode,parent){parent&&mode.beginKeywords&&(mode.begin="\\b("+mode.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",mode.__beforeBegin=skipIfHasPrecedingDot,mode.keywords=mode.keywords||mode.beginKeywords,delete mode.beginKeywords,void 0===mode.relevance&&(mode.relevance=0))}function compileIllegal(mode,_parent){Array.isArray(mode.illegal)&&(mode.illegal=either(...mode.illegal))}function compileMatch(mode,_parent){if(mode.match){if(mode.begin||mode.end)throw new Error("begin & end are not supported with match");mode.begin=mode.match,delete mode.match}}function compileRelevance(mode,_parent){void 0===mode.relevance&&(mode.relevance=1)}const beforeMatchExt=(mode,parent)=>{if(!mode.beforeMatch)return;if(mode.starts)throw new Error("beforeMatch cannot be used with starts");const originalMode=Object.assign({},mode);Object.keys(mode).forEach(key=>{delete mode[key]}),mode.keywords=originalMode.keywords,mode.begin=concat(originalMode.beforeMatch,lookahead(originalMode.begin)),mode.starts={relevance:0,contains:[Object.assign(originalMode,{endsParent:!0})]},mode.relevance=0,delete originalMode.beforeMatch},COMMON_KEYWORDS=["of","and","for","in","not","or","if","then","parent","list","value"];function compileKeywords(rawKeywords,caseInsensitive,scopeName="keyword"){const compiledKeywords=Object.create(null);return"string"==typeof rawKeywords?compileList(scopeName,rawKeywords.split(" ")):Array.isArray(rawKeywords)?compileList(scopeName,rawKeywords):Object.keys(rawKeywords).forEach(function(scopeName){Object.assign(compiledKeywords,compileKeywords(rawKeywords[scopeName],caseInsensitive,scopeName))}),compiledKeywords;function compileList(scopeName,keywordList){caseInsensitive&&(keywordList=keywordList.map(x=>x.toLowerCase())),keywordList.forEach(function(keyword){const pair=keyword.split("|");compiledKeywords[pair[0]]=[scopeName,scoreForKeyword(pair[0],pair[1])]})}}function scoreForKeyword(keyword,providedScore){return providedScore?Number(providedScore):function(keyword){return COMMON_KEYWORDS.includes(keyword.toLowerCase())}(keyword)?0:1}const seenDeprecations={},error=message=>{console.error(message)},warn=(message,...args)=>{console.log(`WARN: ${message}`,...args)},deprecated=(version,message)=>{seenDeprecations[`${version}/${message}`]||(console.log(`Deprecated as of ${version}. ${message}`),seenDeprecations[`${version}/${message}`]=!0)},MultiClassError=new Error;function remapScopeNames(mode,regexes,{key:key}){let offset=0;const scopeNames=mode[key],emit={},positions={};for(let i=1;i<=regexes.length;i++)positions[i+offset]=scopeNames[i],emit[i+offset]=!0,offset+=countMatchGroups(regexes[i-1]);mode[key]=positions,mode[key]._emit=emit,mode[key]._multi=!0}function MultiClass(mode){!function(mode){mode.scope&&"object"==typeof mode.scope&&null!==mode.scope&&(mode.beginScope=mode.scope,delete mode.scope)}(mode),"string"==typeof mode.beginScope&&(mode.beginScope={_wrap:mode.beginScope}),"string"==typeof mode.endScope&&(mode.endScope={_wrap:mode.endScope}),function(mode){if(Array.isArray(mode.begin)){if(mode.skip||mode.excludeBegin||mode.returnBegin)throw error("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),MultiClassError;if("object"!=typeof mode.beginScope||null===mode.beginScope)throw error("beginScope must be object"),MultiClassError;remapScopeNames(mode,mode.begin,{key:"beginScope"}),mode.begin=_rewriteBackreferences(mode.begin,{joinWith:""})}}(mode),function(mode){if(Array.isArray(mode.end)){if(mode.skip||mode.excludeEnd||mode.returnEnd)throw error("skip, excludeEnd, returnEnd not compatible with endScope: {}"),MultiClassError;if("object"!=typeof mode.endScope||null===mode.endScope)throw error("endScope must be object"),MultiClassError;remapScopeNames(mode,mode.end,{key:"endScope"}),mode.end=_rewriteBackreferences(mode.end,{joinWith:""})}}(mode)}function compileLanguage(language){function langRe(value,global){return new RegExp(source(value),"m"+(language.case_insensitive?"i":"")+(language.unicodeRegex?"u":"")+(global?"g":""))}class MultiRegex{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(re,opts){opts.position=this.position++,this.matchIndexes[this.matchAt]=opts,this.regexes.push([opts,re]),this.matchAt+=countMatchGroups(re)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const terminators=this.regexes.map(el=>el[1]);this.matcherRe=langRe(_rewriteBackreferences(terminators,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const match=this.matcherRe.exec(s);if(!match)return null;const i=match.findIndex((el,i)=>i>0&&void 0!==el),matchData=this.matchIndexes[i];return match.splice(0,i),Object.assign(match,matchData)}}class ResumableMultiRegex{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(index){if(this.multiRegexes[index])return this.multiRegexes[index];const matcher=new MultiRegex;return this.rules.slice(index).forEach(([re,opts])=>matcher.addRule(re,opts)),matcher.compile(),this.multiRegexes[index]=matcher,matcher}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(re,opts){this.rules.push([re,opts]),"begin"===opts.type&&this.count++}exec(s){const m=this.getMatcher(this.regexIndex);m.lastIndex=this.lastIndex;let result=m.exec(s);if(this.resumingScanAtSamePosition())if(result&&result.index===this.lastIndex);else{const m2=this.getMatcher(0);m2.lastIndex=this.lastIndex+1,result=m2.exec(s)}return result&&(this.regexIndex+=result.position+1,this.regexIndex===this.count&&this.considerAll()),result}}if(language.compilerExtensions||(language.compilerExtensions=[]),language.contains&&language.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");return language.classNameAliases=inherit$1(language.classNameAliases||{}),function compileMode(mode,parent){const cmode=mode;if(mode.isCompiled)return cmode;[scopeClassName,compileMatch,MultiClass,beforeMatchExt].forEach(ext=>ext(mode,parent)),language.compilerExtensions.forEach(ext=>ext(mode,parent)),mode.__beforeBegin=null,[beginKeywords,compileIllegal,compileRelevance].forEach(ext=>ext(mode,parent)),mode.isCompiled=!0;let keywordPattern=null;return"object"==typeof mode.keywords&&mode.keywords.$pattern&&(mode.keywords=Object.assign({},mode.keywords),keywordPattern=mode.keywords.$pattern,delete mode.keywords.$pattern),keywordPattern=keywordPattern||/\w+/,mode.keywords&&(mode.keywords=compileKeywords(mode.keywords,language.case_insensitive)),cmode.keywordPatternRe=langRe(keywordPattern,!0),parent&&(mode.begin||(mode.begin=/\B|\b/),cmode.beginRe=langRe(cmode.begin),mode.end||mode.endsWithParent||(mode.end=/\B|\b/),mode.end&&(cmode.endRe=langRe(cmode.end)),cmode.terminatorEnd=source(cmode.end)||"",mode.endsWithParent&&parent.terminatorEnd&&(cmode.terminatorEnd+=(mode.end?"|":"")+parent.terminatorEnd)),mode.illegal&&(cmode.illegalRe=langRe(mode.illegal)),mode.contains||(mode.contains=[]),mode.contains=[].concat(...mode.contains.map(function(c){return function(mode){mode.variants&&!mode.cachedVariants&&(mode.cachedVariants=mode.variants.map(function(variant){return inherit$1(mode,{variants:null},variant)}));if(mode.cachedVariants)return mode.cachedVariants;if(dependencyOnParent(mode))return inherit$1(mode,{starts:mode.starts?inherit$1(mode.starts):null});if(Object.isFrozen(mode))return inherit$1(mode);return mode}("self"===c?mode:c)})),mode.contains.forEach(function(c){compileMode(c,cmode)}),mode.starts&&compileMode(mode.starts,parent),cmode.matcher=function(mode){const mm=new ResumableMultiRegex;return mode.contains.forEach(term=>mm.addRule(term.begin,{rule:term,type:"begin"})),mode.terminatorEnd&&mm.addRule(mode.terminatorEnd,{type:"end"}),mode.illegal&&mm.addRule(mode.illegal,{type:"illegal"}),mm}(cmode),cmode}(language)}function dependencyOnParent(mode){return!!mode&&(mode.endsWithParent||dependencyOnParent(mode.starts))}class HTMLInjectionError extends Error{constructor(reason,html){super(reason),this.name="HTMLInjectionError",this.html=html}}const escape=escapeHTML,inherit=inherit$1,NO_MATCH=Symbol("nomatch"),HLJS=function(hljs){const languages=Object.create(null),aliases=Object.create(null),plugins=[];let SAFE_MODE=!0;const LANGUAGE_NOT_FOUND="Could not find the language '{}', did you forget to load/include a language module?",PLAINTEXT_LANGUAGE={disableAutodetect:!0,name:"Plain text",contains:[]};let options={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:TokenTreeEmitter};function shouldNotHighlight(languageName){return options.noHighlightRe.test(languageName)}function highlight(codeOrLanguageName,optionsOrCode,ignoreIllegals){let code="",languageName="";"object"==typeof optionsOrCode?(code=codeOrLanguageName,ignoreIllegals=optionsOrCode.ignoreIllegals,languageName=optionsOrCode.language):(deprecated("10.7.0","highlight(lang, code, ...args) has been deprecated."),deprecated("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),languageName=codeOrLanguageName,code=optionsOrCode),void 0===ignoreIllegals&&(ignoreIllegals=!0);const context={code:code,language:languageName};fire("before:highlight",context);const result=context.result?context.result:_highlight(context.language,context.code,ignoreIllegals);return result.code=context.code,fire("after:highlight",result),result}function _highlight(languageName,codeToHighlight,ignoreIllegals,continuation){const keywordHits=Object.create(null);function keywordData(mode,matchText){return mode.keywords[matchText]}function processKeywords(){if(!top.keywords)return void emitter.addText(modeBuffer);let lastIndex=0;top.keywordPatternRe.lastIndex=0;let match=top.keywordPatternRe.exec(modeBuffer),buf="";for(;match;){buf+=modeBuffer.substring(lastIndex,match.index);const word=language.case_insensitive?match[0].toLowerCase():match[0],data=keywordData(top,word);if(data){const[kind,keywordRelevance]=data;if(emitter.addText(buf),buf="",keywordHits[word]=(keywordHits[word]||0)+1,keywordHits[word]<=7&&(relevance+=keywordRelevance),kind.startsWith("_"))buf+=match[0];else{const cssClass=language.classNameAliases[kind]||kind;emitKeyword(match[0],cssClass)}}else buf+=match[0];lastIndex=top.keywordPatternRe.lastIndex,match=top.keywordPatternRe.exec(modeBuffer)}buf+=modeBuffer.substring(lastIndex),emitter.addText(buf)}function processBuffer(){null!=top.subLanguage?function(){if(""===modeBuffer)return;let result=null;if("string"==typeof top.subLanguage){if(!languages[top.subLanguage])return void emitter.addText(modeBuffer);result=_highlight(top.subLanguage,modeBuffer,!0,continuations[top.subLanguage]),continuations[top.subLanguage]=result._top}else result=highlightAuto(modeBuffer,top.subLanguage.length?top.subLanguage:null);top.relevance>0&&(relevance+=result.relevance),emitter.__addSublanguage(result._emitter,result.language)}():processKeywords(),modeBuffer=""}function emitKeyword(keyword,scope){""!==keyword&&(emitter.startScope(scope),emitter.addText(keyword),emitter.endScope())}function emitMultiClass(scope,match){let i=1;const max=match.length-1;for(;i<=max;){if(!scope._emit[i]){i++;continue}const klass=language.classNameAliases[scope[i]]||scope[i],text=match[i];klass?emitKeyword(text,klass):(modeBuffer=text,processKeywords(),modeBuffer=""),i++}}function startNewMode(mode,match){return mode.scope&&"string"==typeof mode.scope&&emitter.openNode(language.classNameAliases[mode.scope]||mode.scope),mode.beginScope&&(mode.beginScope._wrap?(emitKeyword(modeBuffer,language.classNameAliases[mode.beginScope._wrap]||mode.beginScope._wrap),modeBuffer=""):mode.beginScope._multi&&(emitMultiClass(mode.beginScope,match),modeBuffer="")),top=Object.create(mode,{parent:{value:top}}),top}function endOfMode(mode,match,matchPlusRemainder){let matched=function(re,lexeme){const match=re&&re.exec(lexeme);return match&&0===match.index}(mode.endRe,matchPlusRemainder);if(matched){if(mode["on:end"]){const resp=new Response(mode);mode["on:end"](match,resp),resp.isMatchIgnored&&(matched=!1)}if(matched){for(;mode.endsParent&&mode.parent;)mode=mode.parent;return mode}}if(mode.endsWithParent)return endOfMode(mode.parent,match,matchPlusRemainder)}function doIgnore(lexeme){return 0===top.matcher.regexIndex?(modeBuffer+=lexeme[0],1):(resumeScanAtSamePosition=!0,0)}function doEndMatch(match){const lexeme=match[0],matchPlusRemainder=codeToHighlight.substring(match.index),endMode=endOfMode(top,match,matchPlusRemainder);if(!endMode)return NO_MATCH;const origin=top;top.endScope&&top.endScope._wrap?(processBuffer(),emitKeyword(lexeme,top.endScope._wrap)):top.endScope&&top.endScope._multi?(processBuffer(),emitMultiClass(top.endScope,match)):origin.skip?modeBuffer+=lexeme:(origin.returnEnd||origin.excludeEnd||(modeBuffer+=lexeme),processBuffer(),origin.excludeEnd&&(modeBuffer=lexeme));do{top.scope&&emitter.closeNode(),top.skip||top.subLanguage||(relevance+=top.relevance),top=top.parent}while(top!==endMode.parent);return endMode.starts&&startNewMode(endMode.starts,match),origin.returnEnd?0:lexeme.length}let lastMatch={};function processLexeme(textBeforeMatch,match){const lexeme=match&&match[0];if(modeBuffer+=textBeforeMatch,null==lexeme)return processBuffer(),0;if("begin"===lastMatch.type&&"end"===match.type&&lastMatch.index===match.index&&""===lexeme){if(modeBuffer+=codeToHighlight.slice(match.index,match.index+1),!SAFE_MODE){const err=new Error(`0 width match regex (${languageName})`);throw err.languageName=languageName,err.badRule=lastMatch.rule,err}return 1}if(lastMatch=match,"begin"===match.type)return function(match){const lexeme=match[0],newMode=match.rule,resp=new Response(newMode),beforeCallbacks=[newMode.__beforeBegin,newMode["on:begin"]];for(const cb of beforeCallbacks)if(cb&&(cb(match,resp),resp.isMatchIgnored))return doIgnore(lexeme);return newMode.skip?modeBuffer+=lexeme:(newMode.excludeBegin&&(modeBuffer+=lexeme),processBuffer(),newMode.returnBegin||newMode.excludeBegin||(modeBuffer=lexeme)),startNewMode(newMode,match),newMode.returnBegin?0:lexeme.length}(match);if("illegal"===match.type&&!ignoreIllegals){const err=new Error('Illegal lexeme "'+lexeme+'" for mode "'+(top.scope||"<unnamed>")+'"');throw err.mode=top,err}if("end"===match.type){const processed=doEndMatch(match);if(processed!==NO_MATCH)return processed}if("illegal"===match.type&&""===lexeme)return modeBuffer+="\n",1;if(iterations>1e5&&iterations>3*match.index){throw new Error("potential infinite loop, way more iterations than matches")}return modeBuffer+=lexeme,lexeme.length}const language=getLanguage(languageName);if(!language)throw error(LANGUAGE_NOT_FOUND.replace("{}",languageName)),new Error('Unknown language: "'+languageName+'"');const md=compileLanguage(language);let result="",top=continuation||md;const continuations={},emitter=new options.__emitter(options);!function(){const list=[];for(let current=top;current!==language;current=current.parent)current.scope&&list.unshift(current.scope);list.forEach(item=>emitter.openNode(item))}();let modeBuffer="",relevance=0,index=0,iterations=0,resumeScanAtSamePosition=!1;try{if(language.__emitTokens)language.__emitTokens(codeToHighlight,emitter);else{for(top.matcher.considerAll();;){iterations++,resumeScanAtSamePosition?resumeScanAtSamePosition=!1:top.matcher.considerAll(),top.matcher.lastIndex=index;const match=top.matcher.exec(codeToHighlight);if(!match)break;const processedCount=processLexeme(codeToHighlight.substring(index,match.index),match);index=match.index+processedCount}processLexeme(codeToHighlight.substring(index))}return emitter.finalize(),result=emitter.toHTML(),{language:languageName,value:result,relevance:relevance,illegal:!1,_emitter:emitter,_top:top}}catch(err){if(err.message&&err.message.includes("Illegal"))return{language:languageName,value:escape(codeToHighlight),illegal:!0,relevance:0,_illegalBy:{message:err.message,index:index,context:codeToHighlight.slice(index-100,index+100),mode:err.mode,resultSoFar:result},_emitter:emitter};if(SAFE_MODE)return{language:languageName,value:escape(codeToHighlight),illegal:!1,relevance:0,errorRaised:err,_emitter:emitter,_top:top};throw err}}function highlightAuto(code,languageSubset){languageSubset=languageSubset||options.languages||Object.keys(languages);const plaintext=function(code){const result={value:escape(code),illegal:!1,relevance:0,_top:PLAINTEXT_LANGUAGE,_emitter:new options.__emitter(options)};return result._emitter.addText(code),result}(code),results=languageSubset.filter(getLanguage).filter(autoDetection).map(name=>_highlight(name,code,!1));results.unshift(plaintext);const sorted=results.sort((a,b)=>{if(a.relevance!==b.relevance)return b.relevance-a.relevance;if(a.language&&b.language){if(getLanguage(a.language).supersetOf===b.language)return 1;if(getLanguage(b.language).supersetOf===a.language)return-1}return 0}),[best,secondBest]=sorted,result=best;return result.secondBest=secondBest,result}function highlightElement(element){let node=null;const language=function(block){let classes=block.className+" ";classes+=block.parentNode?block.parentNode.className:"";const match=options.languageDetectRe.exec(classes);if(match){const language=getLanguage(match[1]);return language||(warn(LANGUAGE_NOT_FOUND.replace("{}",match[1])),warn("Falling back to no-highlight mode for this block.",block)),language?match[1]:"no-highlight"}return classes.split(/\s+/).find(_class=>shouldNotHighlight(_class)||getLanguage(_class))}(element);if(shouldNotHighlight(language))return;if(fire("before:highlightElement",{el:element,language:language}),element.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",element);if(element.children.length>0&&(options.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(element)),options.throwUnescapedHTML)){throw new HTMLInjectionError("One of your code blocks includes unescaped HTML.",element.innerHTML)}node=element;const text=node.textContent,result=language?highlight(text,{language:language,ignoreIllegals:!0}):highlightAuto(text);element.innerHTML=result.value,element.dataset.highlighted="yes",function(element,currentLang,resultLang){const language=currentLang&&aliases[currentLang]||resultLang;element.classList.add("hljs"),element.classList.add(`language-${language}`)}(element,language,result.language),element.result={language:result.language,re:result.relevance,relevance:result.relevance},result.secondBest&&(element.secondBest={language:result.secondBest.language,relevance:result.secondBest.relevance}),fire("after:highlightElement",{el:element,result:result,text:text})}let wantsHighlight=!1;function highlightAll(){if("loading"===document.readyState)return wantsHighlight||window.addEventListener("DOMContentLoaded",function(){highlightAll()},!1),void(wantsHighlight=!0);document.querySelectorAll(options.cssSelector).forEach(highlightElement)}function getLanguage(name){return name=(name||"").toLowerCase(),languages[name]||languages[aliases[name]]}function registerAliases(aliasList,{languageName:languageName}){"string"==typeof aliasList&&(aliasList=[aliasList]),aliasList.forEach(alias=>{aliases[alias.toLowerCase()]=languageName})}function autoDetection(name){const lang=getLanguage(name);return lang&&!lang.disableAutodetect}function fire(event,args){const cb=event;plugins.forEach(function(plugin){plugin[cb]&&plugin[cb](args)})}Object.assign(hljs,{highlight:highlight,highlightAuto:highlightAuto,highlightAll:highlightAll,highlightElement:highlightElement,highlightBlock:function(el){return deprecated("10.7.0","highlightBlock will be removed entirely in v12.0"),deprecated("10.7.0","Please use highlightElement now."),highlightElement(el)},configure:function(userOptions){options=inherit(options,userOptions)},initHighlighting:()=>{highlightAll(),deprecated("10.6.0","initHighlighting() deprecated.  Use highlightAll() now.")},initHighlightingOnLoad:function(){highlightAll(),deprecated("10.6.0","initHighlightingOnLoad() deprecated.  Use highlightAll() now.")},registerLanguage:function(languageName,languageDefinition){let lang=null;try{lang=languageDefinition(hljs)}catch(error$1){if(error("Language definition for '{}' could not be registered.".replace("{}",languageName)),!SAFE_MODE)throw error$1;error(error$1),lang=PLAINTEXT_LANGUAGE}lang.name||(lang.name=languageName),languages[languageName]=lang,lang.rawDefinition=languageDefinition.bind(null,hljs),lang.aliases&&registerAliases(lang.aliases,{languageName:languageName})},unregisterLanguage:function(languageName){delete languages[languageName];for(const alias of Object.keys(aliases))aliases[alias]===languageName&&delete aliases[alias]},listLanguages:function(){return Object.keys(languages)},getLanguage:getLanguage,registerAliases:registerAliases,autoDetection:autoDetection,inherit:inherit,addPlugin:function(plugin){!function(plugin){plugin["before:highlightBlock"]&&!plugin["before:highlightElement"]&&(plugin["before:highlightElement"]=data=>{plugin["before:highlightBlock"](Object.assign({block:data.el},data))}),plugin["after:highlightBlock"]&&!plugin["after:highlightElement"]&&(plugin["after:highlightElement"]=data=>{plugin["after:highlightBlock"](Object.assign({block:data.el},data))})}(plugin),plugins.push(plugin)},removePlugin:function(plugin){const index=plugins.indexOf(plugin);-1!==index&&plugins.splice(index,1)}}),hljs.debugMode=function(){SAFE_MODE=!1},hljs.safeMode=function(){SAFE_MODE=!0},hljs.versionString="11.11.1",hljs.regex={concat:concat,lookahead:lookahead,either:either,optional:optional,anyNumberOfTimes:anyNumberOfTimes};for(const key in MODES$1)"object"==typeof MODES$1[key]&&deepFreeze(MODES$1[key]);return Object.assign(hljs,MODES$1),hljs},highlight=HLJS({});highlight.newInstance=()=>HLJS({});var core=highlight;highlight.HighlightJS=highlight,highlight.default=highlight;var HighlightJS=getDefaultExportFromCjs(core);const KEYWORDS$1=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],LITERALS$1=["true","false","null","undefined","NaN","Infinity"],TYPES$1=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ERROR_TYPES$1=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],BUILT_IN_GLOBALS$1=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],BUILT_IN_VARIABLES$1=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],BUILT_INS$1=[].concat(BUILT_IN_GLOBALS$1,TYPES$1,ERROR_TYPES$1);function javascript$1(hljs){const regex=hljs.regex,IDENT_RE$1$1="[A-Za-z$_][0-9A-Za-z$_]*",FRAGMENT_begin="<>",FRAGMENT_end="</>",XML_TAG={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(match,response)=>{const afterMatchIndex=match[0].length+match.index,nextChar=match.input[afterMatchIndex];if("<"===nextChar||","===nextChar)return void response.ignoreMatch();let m;">"===nextChar&&(((match,{after:after})=>{const tag="</"+match[0].slice(1);return-1!==match.input.indexOf(tag,after)})(match,{after:afterMatchIndex})||response.ignoreMatch());const afterMatch=match.input.substring(afterMatchIndex);((m=afterMatch.match(/^\s*=/))||(m=afterMatch.match(/^\s+extends\s+/))&&0===m.index)&&response.ignoreMatch()}},KEYWORDS$1$1={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:KEYWORDS$1,literal:LITERALS$1,built_in:BUILT_INS$1,"variable.language":BUILT_IN_VARIABLES$1},frac="\\.([0-9](_?[0-9])*)",NUMBER={className:"number",variants:[{begin:`(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((${frac})|\\.)?|(${frac}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{begin:`\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((${frac})\\b|\\.)?|(${frac})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},SUBST={className:"subst",begin:"\\$\\{",end:"\\}",keywords:KEYWORDS$1$1,contains:[]},HTML_TEMPLATE={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[hljs.BACKSLASH_ESCAPE,SUBST],subLanguage:"xml"}},CSS_TEMPLATE={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[hljs.BACKSLASH_ESCAPE,SUBST],subLanguage:"css"}},GRAPHQL_TEMPLATE={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[hljs.BACKSLASH_ESCAPE,SUBST],subLanguage:"graphql"}},TEMPLATE_STRING={className:"string",begin:"`",end:"`",contains:[hljs.BACKSLASH_ESCAPE,SUBST]},COMMENT={className:"comment",variants:[hljs.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:IDENT_RE$1$1+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),hljs.C_BLOCK_COMMENT_MODE,hljs.C_LINE_COMMENT_MODE]},SUBST_INTERNALS=[hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,HTML_TEMPLATE,CSS_TEMPLATE,GRAPHQL_TEMPLATE,TEMPLATE_STRING,{match:/\$\d+/},NUMBER];SUBST.contains=SUBST_INTERNALS.concat({begin:/\{/,end:/\}/,keywords:KEYWORDS$1$1,contains:["self"].concat(SUBST_INTERNALS)});const SUBST_AND_COMMENTS=[].concat(COMMENT,SUBST.contains),PARAMS_CONTAINS=SUBST_AND_COMMENTS.concat([{begin:/(\s*)\(/,end:/\)/,keywords:KEYWORDS$1$1,contains:["self"].concat(SUBST_AND_COMMENTS)}]),PARAMS={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:KEYWORDS$1$1,contains:PARAMS_CONTAINS},CLASS_OR_EXTENDS={variants:[{match:[/class/,/\s+/,IDENT_RE$1$1,/\s+/,/extends/,/\s+/,regex.concat(IDENT_RE$1$1,"(",regex.concat(/\./,IDENT_RE$1$1),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,IDENT_RE$1$1],scope:{1:"keyword",3:"title.class"}}]},CLASS_REFERENCE={relevance:0,match:regex.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...TYPES$1,...ERROR_TYPES$1]}},FUNCTION_DEFINITION={variants:[{match:[/function/,/\s+/,IDENT_RE$1$1,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[PARAMS],illegal:/%/};const FUNCTION_CALL={match:regex.concat(/\b/,function(list){return regex.concat("(?!",list.join("|"),")")}([...BUILT_IN_GLOBALS$1,"super","import"].map(x=>`${x}\\s*\\(`)),IDENT_RE$1$1,regex.lookahead(/\s*\(/)),className:"title.function",relevance:0},PROPERTY_ACCESS={begin:regex.concat(/\./,regex.lookahead(regex.concat(IDENT_RE$1$1,/(?![0-9A-Za-z$_(])/))),end:IDENT_RE$1$1,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},GETTER_OR_SETTER={match:[/get|set/,/\s+/,IDENT_RE$1$1,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},PARAMS]},FUNC_LEAD_IN_RE="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+hljs.UNDERSCORE_IDENT_RE+")\\s*=>",FUNCTION_VARIABLE={match:[/const|var|let/,/\s+/,IDENT_RE$1$1,/\s*/,/=\s*/,/(async\s*)?/,regex.lookahead(FUNC_LEAD_IN_RE)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[PARAMS]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:KEYWORDS$1$1,exports:{PARAMS_CONTAINS:PARAMS_CONTAINS,CLASS_REFERENCE:CLASS_REFERENCE},illegal:/#(?![$_A-z])/,contains:[hljs.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,HTML_TEMPLATE,CSS_TEMPLATE,GRAPHQL_TEMPLATE,TEMPLATE_STRING,COMMENT,{match:/\$\d+/},NUMBER,CLASS_REFERENCE,{scope:"attr",match:IDENT_RE$1$1+regex.lookahead(":"),relevance:0},FUNCTION_VARIABLE,{begin:"("+hljs.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[COMMENT,hljs.REGEXP_MODE,{className:"function",begin:FUNC_LEAD_IN_RE,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:hljs.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:KEYWORDS$1$1,contains:PARAMS_CONTAINS}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:FRAGMENT_begin,end:FRAGMENT_end},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:XML_TAG.begin,"on:begin":XML_TAG.isTrulyOpeningTag,end:XML_TAG.end}],subLanguage:"xml",contains:[{begin:XML_TAG.begin,end:XML_TAG.end,skip:!0,contains:["self"]}]}]},FUNCTION_DEFINITION,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+hljs.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[PARAMS,hljs.inherit(hljs.TITLE_MODE,{begin:IDENT_RE$1$1,className:"title.function"})]},{match:/\.\.\./,relevance:0},PROPERTY_ACCESS,{match:"\\$"+IDENT_RE$1$1,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[PARAMS]},FUNCTION_CALL,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},CLASS_OR_EXTENDS,GETTER_OR_SETTER,{match:/\$[(.]/}]}}function xml(hljs){const regex=hljs.regex,TAG_NAME_RE=regex.concat(/[\p{L}_]/u,regex.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),XML_ENTITIES={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},XML_META_KEYWORDS={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},XML_META_PAR_KEYWORDS=hljs.inherit(XML_META_KEYWORDS,{begin:/\(/,end:/\)/}),APOS_META_STRING_MODE=hljs.inherit(hljs.APOS_STRING_MODE,{className:"string"}),QUOTE_META_STRING_MODE=hljs.inherit(hljs.QUOTE_STRING_MODE,{className:"string"}),TAG_INTERNALS={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[XML_ENTITIES]},{begin:/'/,end:/'/,contains:[XML_ENTITIES]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[XML_META_KEYWORDS,QUOTE_META_STRING_MODE,APOS_META_STRING_MODE,XML_META_PAR_KEYWORDS,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[XML_META_KEYWORDS,XML_META_PAR_KEYWORDS,QUOTE_META_STRING_MODE,APOS_META_STRING_MODE]}]}]},hljs.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},XML_ENTITIES,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[QUOTE_META_STRING_MODE]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[TAG_INTERNALS],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[TAG_INTERNALS],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:regex.concat(/</,regex.lookahead(regex.concat(TAG_NAME_RE,regex.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:TAG_NAME_RE,relevance:0,starts:TAG_INTERNALS}]},{className:"tag",begin:regex.concat(/<\//,regex.lookahead(regex.concat(TAG_NAME_RE,/>/))),contains:[{className:"name",begin:TAG_NAME_RE,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const TAGS=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],MEDIA_FEATURES=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),PSEUDO_CLASSES=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),PSEUDO_ELEMENTS=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ATTRIBUTES=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function python(hljs){const regex=hljs.regex,IDENT_RE=/[\p{XID_Start}_]\p{XID_Continue}*/u,RESERVED_WORDS=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],KEYWORDS={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:RESERVED_WORDS,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},PROMPT={className:"meta",begin:/^(>>>|\.\.\.) /},SUBST={className:"subst",begin:/\{/,end:/\}/,keywords:KEYWORDS,illegal:/#/},LITERAL_BRACKET={begin:/\{\{/,relevance:0},STRING={className:"string",contains:[hljs.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT,LITERAL_BRACKET,SUBST]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[hljs.BACKSLASH_ESCAPE,PROMPT,LITERAL_BRACKET,SUBST]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[hljs.BACKSLASH_ESCAPE,LITERAL_BRACKET,SUBST]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[hljs.BACKSLASH_ESCAPE,LITERAL_BRACKET,SUBST]},hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE]},digitpart="[0-9](_?[0-9])*",pointfloat=`(\\b(${digitpart}))?\\.(${digitpart})|\\b(${digitpart})\\.`,lookahead=`\\b|${RESERVED_WORDS.join("|")}`,NUMBER={className:"number",relevance:0,variants:[{begin:`(\\b(${digitpart})|(${pointfloat}))[eE][+-]?(${digitpart})[jJ]?(?=${lookahead})`},{begin:`(${pointfloat})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${lookahead})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${lookahead})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${lookahead})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${lookahead})`},{begin:`\\b(${digitpart})[jJ](?=${lookahead})`}]},COMMENT_TYPE={className:"comment",begin:regex.lookahead(/# type:/),end:/$/,keywords:KEYWORDS,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},PARAMS={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:KEYWORDS,contains:["self",PROMPT,NUMBER,STRING,hljs.HASH_COMMENT_MODE]}]};return SUBST.contains=[STRING,NUMBER,PROMPT],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:KEYWORDS,illegal:/(<\/|\?)|=>/,contains:[PROMPT,NUMBER,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},STRING,COMMENT_TYPE,hljs.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,IDENT_RE],scope:{1:"keyword",3:"title.function"},contains:[PARAMS]},{variants:[{match:[/\bclass/,/\s+/,IDENT_RE,/\s*/,/\(\s*/,IDENT_RE,/\s*\)/]},{match:[/\bclass/,/\s+/,IDENT_RE]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[NUMBER,PARAMS,STRING]}]}}const IDENT_RE="[A-Za-z$_][0-9A-Za-z$_]*",KEYWORDS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],LITERALS=["true","false","null","undefined","NaN","Infinity"],TYPES=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ERROR_TYPES=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],BUILT_IN_GLOBALS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],BUILT_IN_VARIABLES=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],BUILT_INS=[].concat(BUILT_IN_GLOBALS,TYPES,ERROR_TYPES);function javascript(hljs){const regex=hljs.regex,IDENT_RE$1=IDENT_RE,FRAGMENT_begin="<>",FRAGMENT_end="</>",XML_TAG={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(match,response)=>{const afterMatchIndex=match[0].length+match.index,nextChar=match.input[afterMatchIndex];if("<"===nextChar||","===nextChar)return void response.ignoreMatch();let m;">"===nextChar&&(((match,{after:after})=>{const tag="</"+match[0].slice(1);return-1!==match.input.indexOf(tag,after)})(match,{after:afterMatchIndex})||response.ignoreMatch());const afterMatch=match.input.substring(afterMatchIndex);((m=afterMatch.match(/^\s*=/))||(m=afterMatch.match(/^\s+extends\s+/))&&0===m.index)&&response.ignoreMatch()}},KEYWORDS$1={$pattern:IDENT_RE,keyword:KEYWORDS,literal:LITERALS,built_in:BUILT_INS,"variable.language":BUILT_IN_VARIABLES},frac="\\.([0-9](_?[0-9])*)",NUMBER={className:"number",variants:[{begin:`(\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)((${frac})|\\.)?|(${frac}))[eE][+-]?([0-9](_?[0-9])*)\\b`},{begin:`\\b(0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*)\\b((${frac})\\b|\\.)?|(${frac})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},SUBST={className:"subst",begin:"\\$\\{",end:"\\}",keywords:KEYWORDS$1,contains:[]},HTML_TEMPLATE={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[hljs.BACKSLASH_ESCAPE,SUBST],subLanguage:"xml"}},CSS_TEMPLATE={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[hljs.BACKSLASH_ESCAPE,SUBST],subLanguage:"css"}},GRAPHQL_TEMPLATE={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[hljs.BACKSLASH_ESCAPE,SUBST],subLanguage:"graphql"}},TEMPLATE_STRING={className:"string",begin:"`",end:"`",contains:[hljs.BACKSLASH_ESCAPE,SUBST]},COMMENT={className:"comment",variants:[hljs.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:IDENT_RE$1+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),hljs.C_BLOCK_COMMENT_MODE,hljs.C_LINE_COMMENT_MODE]},SUBST_INTERNALS=[hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,HTML_TEMPLATE,CSS_TEMPLATE,GRAPHQL_TEMPLATE,TEMPLATE_STRING,{match:/\$\d+/},NUMBER];SUBST.contains=SUBST_INTERNALS.concat({begin:/\{/,end:/\}/,keywords:KEYWORDS$1,contains:["self"].concat(SUBST_INTERNALS)});const SUBST_AND_COMMENTS=[].concat(COMMENT,SUBST.contains),PARAMS_CONTAINS=SUBST_AND_COMMENTS.concat([{begin:/(\s*)\(/,end:/\)/,keywords:KEYWORDS$1,contains:["self"].concat(SUBST_AND_COMMENTS)}]),PARAMS={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:KEYWORDS$1,contains:PARAMS_CONTAINS},CLASS_OR_EXTENDS={variants:[{match:[/class/,/\s+/,IDENT_RE$1,/\s+/,/extends/,/\s+/,regex.concat(IDENT_RE$1,"(",regex.concat(/\./,IDENT_RE$1),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,IDENT_RE$1],scope:{1:"keyword",3:"title.class"}}]},CLASS_REFERENCE={relevance:0,match:regex.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...TYPES,...ERROR_TYPES]}},FUNCTION_DEFINITION={variants:[{match:[/function/,/\s+/,IDENT_RE$1,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[PARAMS],illegal:/%/};const FUNCTION_CALL={match:regex.concat(/\b/,function(list){return regex.concat("(?!",list.join("|"),")")}([...BUILT_IN_GLOBALS,"super","import"].map(x=>`${x}\\s*\\(`)),IDENT_RE$1,regex.lookahead(/\s*\(/)),className:"title.function",relevance:0},PROPERTY_ACCESS={begin:regex.concat(/\./,regex.lookahead(regex.concat(IDENT_RE$1,/(?![0-9A-Za-z$_(])/))),end:IDENT_RE$1,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},GETTER_OR_SETTER={match:[/get|set/,/\s+/,IDENT_RE$1,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},PARAMS]},FUNC_LEAD_IN_RE="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+hljs.UNDERSCORE_IDENT_RE+")\\s*=>",FUNCTION_VARIABLE={match:[/const|var|let/,/\s+/,IDENT_RE$1,/\s*/,/=\s*/,/(async\s*)?/,regex.lookahead(FUNC_LEAD_IN_RE)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[PARAMS]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:KEYWORDS$1,exports:{PARAMS_CONTAINS:PARAMS_CONTAINS,CLASS_REFERENCE:CLASS_REFERENCE},illegal:/#(?![$_A-z])/,contains:[hljs.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,HTML_TEMPLATE,CSS_TEMPLATE,GRAPHQL_TEMPLATE,TEMPLATE_STRING,COMMENT,{match:/\$\d+/},NUMBER,CLASS_REFERENCE,{scope:"attr",match:IDENT_RE$1+regex.lookahead(":"),relevance:0},FUNCTION_VARIABLE,{begin:"("+hljs.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[COMMENT,hljs.REGEXP_MODE,{className:"function",begin:FUNC_LEAD_IN_RE,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:hljs.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:KEYWORDS$1,contains:PARAMS_CONTAINS}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:FRAGMENT_begin,end:FRAGMENT_end},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:XML_TAG.begin,"on:begin":XML_TAG.isTrulyOpeningTag,end:XML_TAG.end}],subLanguage:"xml",contains:[{begin:XML_TAG.begin,end:XML_TAG.end,skip:!0,contains:["self"]}]}]},FUNCTION_DEFINITION,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+hljs.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[PARAMS,hljs.inherit(hljs.TITLE_MODE,{begin:IDENT_RE$1,className:"title.function"})]},{match:/\.\.\./,relevance:0},PROPERTY_ACCESS,{match:"\\$"+IDENT_RE$1,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[PARAMS]},FUNCTION_CALL,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},CLASS_OR_EXTENDS,GETTER_OR_SETTER,{match:/\$[(.]/}]}}function typescript(hljs){const regex=hljs.regex,tsLanguage=javascript(hljs),IDENT_RE$1=IDENT_RE,TYPES=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],NAMESPACE={begin:[/namespace/,/\s+/,hljs.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},INTERFACE={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:TYPES},contains:[tsLanguage.exports.CLASS_REFERENCE]},KEYWORDS$1={$pattern:IDENT_RE,keyword:KEYWORDS.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:LITERALS,built_in:BUILT_INS.concat(TYPES),"variable.language":BUILT_IN_VARIABLES},DECORATOR={className:"meta",begin:"@"+IDENT_RE$1},swapMode=(mode,label,replacement)=>{const indx=mode.contains.findIndex(m=>m.label===label);if(-1===indx)throw new Error("can not find mode to replace");mode.contains.splice(indx,1,replacement)};Object.assign(tsLanguage.keywords,KEYWORDS$1),tsLanguage.exports.PARAMS_CONTAINS.push(DECORATOR);const ATTRIBUTE_HIGHLIGHT=tsLanguage.contains.find(c=>"attr"===c.scope),OPTIONAL_KEY_OR_ARGUMENT=Object.assign({},ATTRIBUTE_HIGHLIGHT,{match:regex.concat(IDENT_RE$1,regex.lookahead(/\s*\?:/))});tsLanguage.exports.PARAMS_CONTAINS.push([tsLanguage.exports.CLASS_REFERENCE,ATTRIBUTE_HIGHLIGHT,OPTIONAL_KEY_OR_ARGUMENT]),tsLanguage.contains=tsLanguage.contains.concat([DECORATOR,NAMESPACE,INTERFACE,OPTIONAL_KEY_OR_ARGUMENT]),swapMode(tsLanguage,"shebang",hljs.SHEBANG()),swapMode(tsLanguage,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/});return tsLanguage.contains.find(m=>"func.def"===m.label).relevance=0,Object.assign(tsLanguage,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),tsLanguage}var frac="\\.([0-9](_*[0-9])*)",hexDigits="[0-9a-fA-F](_*[0-9a-fA-F])*",NUMERIC={className:"number",variants:[{begin:`(\\b([0-9](_*[0-9])*)((${frac})|\\.)?|(${frac}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:`\\b([0-9](_*[0-9])*)((${frac})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${frac})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:`\\b0[xX]((${hexDigits})\\.?|(${hexDigits})?\\.(${hexDigits}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${hexDigits})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function recurRegex(re,substitution,depth){return-1===depth?"":re.replace(substitution,_=>recurRegex(re,substitution,depth-1))}function csharp(hljs){const KEYWORDS={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},TITLE_MODE=hljs.inherit(hljs.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),NUMBERS={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},VERBATIM_STRING={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},VERBATIM_STRING_NO_LF=hljs.inherit(VERBATIM_STRING,{illegal:/\n/}),SUBST={className:"subst",begin:/\{/,end:/\}/,keywords:KEYWORDS},SUBST_NO_LF=hljs.inherit(SUBST,{illegal:/\n/}),INTERPOLATED_STRING={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},hljs.BACKSLASH_ESCAPE,SUBST_NO_LF]},INTERPOLATED_VERBATIM_STRING={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},SUBST]},INTERPOLATED_VERBATIM_STRING_NO_LF=hljs.inherit(INTERPOLATED_VERBATIM_STRING,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},SUBST_NO_LF]});SUBST.contains=[INTERPOLATED_VERBATIM_STRING,INTERPOLATED_STRING,VERBATIM_STRING,hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,NUMBERS,hljs.C_BLOCK_COMMENT_MODE],SUBST_NO_LF.contains=[INTERPOLATED_VERBATIM_STRING_NO_LF,INTERPOLATED_STRING,VERBATIM_STRING_NO_LF,hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,NUMBERS,hljs.inherit(hljs.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const STRING={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},INTERPOLATED_VERBATIM_STRING,INTERPOLATED_STRING,VERBATIM_STRING,hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE]},GENERIC_MODIFIER={begin:"<",end:">",contains:[{beginKeywords:"in out"},TITLE_MODE]},TYPE_IDENT_RE=hljs.IDENT_RE+"(<"+hljs.IDENT_RE+"(\\s*,\\s*"+hljs.IDENT_RE+")*>)?(\\[\\])?",AT_IDENTIFIER={begin:"@"+hljs.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:KEYWORDS,illegal:/::/,contains:[hljs.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},STRING,NUMBERS,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},TITLE_MODE,GENERIC_MODIFIER,hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[TITLE_MODE,hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[TITLE_MODE,GENERIC_MODIFIER,hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+TYPE_IDENT_RE+"\\s+)+"+hljs.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:KEYWORDS,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:hljs.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[hljs.TITLE_MODE,GENERIC_MODIFIER],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:KEYWORDS,relevance:0,contains:[STRING,NUMBERS,hljs.C_BLOCK_COMMENT_MODE]},hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE]},AT_IDENTIFIER]}}function markdown(hljs){const INLINE_HTML={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},LINK={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:hljs.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},BOLD={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},ITALIC={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},BOLD_WITHOUT_ITALIC=hljs.inherit(BOLD,{contains:[]}),ITALIC_WITHOUT_BOLD=hljs.inherit(ITALIC,{contains:[]});BOLD.contains.push(ITALIC_WITHOUT_BOLD),ITALIC.contains.push(BOLD_WITHOUT_ITALIC);let CONTAINABLE=[INLINE_HTML,LINK];[BOLD,ITALIC,BOLD_WITHOUT_ITALIC,ITALIC_WITHOUT_BOLD].forEach(m=>{m.contains=m.contains.concat(CONTAINABLE)}),CONTAINABLE=CONTAINABLE.concat(BOLD,ITALIC);return{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:CONTAINABLE},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:CONTAINABLE}]}]},INLINE_HTML,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},BOLD,ITALIC,{className:"quote",begin:"^>\\s+",contains:CONTAINABLE,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},LINK,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function shell(hljs){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}HighlightJS.registerLanguage("javascript",javascript$1),HighlightJS.registerLanguage("js",javascript$1),HighlightJS.registerLanguage("xml",xml),HighlightJS.registerLanguage("html",xml),HighlightJS.registerLanguage("css",function(hljs){const regex=hljs.regex,modes=(hljs=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:hljs.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:hljs.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}))(hljs),STRINGS=[hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[modes.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},modes.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},modes.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+PSEUDO_CLASSES.join("|")+")"},{begin:":(:)?("+PSEUDO_ELEMENTS.join("|")+")"}]},modes.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ATTRIBUTES.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[modes.BLOCK_COMMENT,modes.HEXCOLOR,modes.IMPORTANT,modes.CSS_NUMBER_MODE,...STRINGS,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...STRINGS,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},modes.FUNCTION_DISPATCH]},{begin:regex.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:MEDIA_FEATURES.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...STRINGS,modes.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+TAGS.join("|")+")\\b"}]}}),HighlightJS.registerLanguage("json",function(hljs){const LITERALS=["true","false","null"],LITERALS_MODE={scope:"literal",beginKeywords:LITERALS.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:LITERALS},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},hljs.QUOTE_STRING_MODE,LITERALS_MODE,hljs.C_NUMBER_MODE,hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}),HighlightJS.registerLanguage("bash",function(hljs){const regex=hljs.regex,VAR={},BRACED_VAR={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[VAR]}]};Object.assign(VAR,{className:"variable",variants:[{begin:regex.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},BRACED_VAR]});const SUBST={className:"subst",begin:/\$\(/,end:/\)/,contains:[hljs.BACKSLASH_ESCAPE]},COMMENT=hljs.inherit(hljs.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),HERE_DOC={begin:/<<-?\s*(?=\w+)/,starts:{contains:[hljs.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},QUOTE_STRING={className:"string",begin:/"/,end:/"/,contains:[hljs.BACKSLASH_ESCAPE,VAR,SUBST]};SUBST.contains.push(QUOTE_STRING);const ARITHMETIC={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},hljs.NUMBER_MODE,VAR]},KNOWN_SHEBANG=hljs.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),FUNCTION={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[hljs.inherit(hljs.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[KNOWN_SHEBANG,hljs.SHEBANG(),FUNCTION,ARITHMETIC,COMMENT,HERE_DOC,{match:/(\/[a-z._-]+)+/},QUOTE_STRING,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},VAR]}}),HighlightJS.registerLanguage("python",python),HighlightJS.registerLanguage("py",python),HighlightJS.registerLanguage("typescript",typescript),HighlightJS.registerLanguage("ts",typescript),HighlightJS.registerLanguage("java",function(hljs){const regex=hljs.regex,JAVA_IDENT_RE="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",GENERIC_IDENT_RE=JAVA_IDENT_RE+recurRegex("(?:<"+JAVA_IDENT_RE+"~~~(?:\\s*,\\s*"+JAVA_IDENT_RE+"~~~)*>)?",/~~~/g,2),KEYWORDS={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},ANNOTATION={className:"meta",begin:"@"+JAVA_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},PARAMS={className:"params",begin:/\(/,end:/\)/,keywords:KEYWORDS,relevance:0,contains:[hljs.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:KEYWORDS,illegal:/<\/|#/,contains:[hljs.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[hljs.BACKSLASH_ESCAPE]},hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,JAVA_IDENT_RE],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[regex.concat(/(?!else)/,JAVA_IDENT_RE),/\s+/,JAVA_IDENT_RE,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,JAVA_IDENT_RE],className:{1:"keyword",3:"title.class"},contains:[PARAMS,hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+GENERIC_IDENT_RE+"\\s+)",hljs.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:KEYWORDS,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:KEYWORDS,relevance:0,contains:[ANNOTATION,hljs.APOS_STRING_MODE,hljs.QUOTE_STRING_MODE,NUMERIC,hljs.C_BLOCK_COMMENT_MODE]},hljs.C_LINE_COMMENT_MODE,hljs.C_BLOCK_COMMENT_MODE]},NUMERIC,ANNOTATION]}}),HighlightJS.registerLanguage("csharp",csharp),HighlightJS.registerLanguage("cs",csharp),HighlightJS.registerLanguage("php",function(hljs){const regex=hljs.regex,NOT_PERL_ETC=/(?![A-Za-z0-9])(?![$])/,IDENT_RE=regex.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,NOT_PERL_ETC),PASCAL_CASE_CLASS_NAME_RE=regex.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,NOT_PERL_ETC),UPCASE_NAME_RE=regex.concat(/[A-Z]+/,NOT_PERL_ETC),VARIABLE={scope:"variable",match:"\\$+"+IDENT_RE},SUBST={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},SINGLE_QUOTED=hljs.inherit(hljs.APOS_STRING_MODE,{illegal:null}),STRING={scope:"string",variants:[hljs.inherit(hljs.QUOTE_STRING_MODE,{illegal:null,contains:hljs.QUOTE_STRING_MODE.contains.concat(SUBST)}),SINGLE_QUOTED,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:hljs.QUOTE_STRING_MODE.contains.concat(SUBST),"on:begin":(m,resp)=>{resp.data._beginMatch=m[1]||m[2]},"on:end":(m,resp)=>{resp.data._beginMatch!==m[1]&&resp.ignoreMatch()}},hljs.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},NUMBER={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},LITERALS=["false","null","true"],KWS=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],BUILT_INS=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],KEYWORDS={keyword:KWS,literal:(items=>{const result=[];return items.forEach(item=>{result.push(item),item.toLowerCase()===item?result.push(item.toUpperCase()):result.push(item.toLowerCase())}),result})(LITERALS),built_in:BUILT_INS},normalizeKeywords=items=>items.map(item=>item.replace(/\|\d+$/,"")),CONSTRUCTOR_CALL={variants:[{match:[/new/,regex.concat("[ \t\n]","+"),regex.concat("(?!",normalizeKeywords(BUILT_INS).join("\\b|"),"\\b)"),PASCAL_CASE_CLASS_NAME_RE],scope:{1:"keyword",4:"title.class"}}]},CONSTANT_REFERENCE=regex.concat(IDENT_RE,"\\b(?!\\()"),LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON={variants:[{match:[regex.concat(/::/,regex.lookahead(/(?!class\b)/)),CONSTANT_REFERENCE],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[PASCAL_CASE_CLASS_NAME_RE,regex.concat(/::/,regex.lookahead(/(?!class\b)/)),CONSTANT_REFERENCE],scope:{1:"title.class",3:"variable.constant"}},{match:[PASCAL_CASE_CLASS_NAME_RE,regex.concat("::",regex.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[PASCAL_CASE_CLASS_NAME_RE,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},NAMED_ARGUMENT={scope:"attr",match:regex.concat(IDENT_RE,regex.lookahead(":"),regex.lookahead(/(?!::)/))},PARAMS_MODE={relevance:0,begin:/\(/,end:/\)/,keywords:KEYWORDS,contains:[NAMED_ARGUMENT,VARIABLE,LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON,hljs.C_BLOCK_COMMENT_MODE,STRING,NUMBER,CONSTRUCTOR_CALL]},FUNCTION_INVOKE={relevance:0,match:[/\b/,regex.concat("(?!fn\\b|function\\b|",normalizeKeywords(KWS).join("\\b|"),"|",normalizeKeywords(BUILT_INS).join("\\b|"),"\\b)"),IDENT_RE,regex.concat("[ \t\n]","*"),regex.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[PARAMS_MODE]};PARAMS_MODE.contains.push(FUNCTION_INVOKE);const ATTRIBUTE_CONTAINS=[NAMED_ARGUMENT,LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON,hljs.C_BLOCK_COMMENT_MODE,STRING,NUMBER,CONSTRUCTOR_CALL],ATTRIBUTES={begin:regex.concat(/#\[\s*\\?/,regex.either(PASCAL_CASE_CLASS_NAME_RE,UPCASE_NAME_RE)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:LITERALS,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:LITERALS,keyword:["new","array"]},contains:["self",...ATTRIBUTE_CONTAINS]},...ATTRIBUTE_CONTAINS,{scope:"meta",variants:[{match:PASCAL_CASE_CLASS_NAME_RE},{match:UPCASE_NAME_RE}]}]};return{case_insensitive:!1,keywords:KEYWORDS,contains:[ATTRIBUTES,hljs.HASH_COMMENT_MODE,hljs.COMMENT("//","$"),hljs.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:hljs.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},VARIABLE,FUNCTION_INVOKE,LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON,{match:[/const/,/\s/,IDENT_RE],scope:{1:"keyword",3:"variable.constant"}},CONSTRUCTOR_CALL,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},hljs.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:KEYWORDS,contains:["self",ATTRIBUTES,VARIABLE,LEFT_AND_RIGHT_SIDE_OF_DOUBLE_COLON,hljs.C_BLOCK_COMMENT_MODE,STRING,NUMBER]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},hljs.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[hljs.inherit(hljs.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},hljs.UNDERSCORE_TITLE_MODE]},STRING,NUMBER]}}),HighlightJS.registerLanguage("sql",function(hljs){const regex=hljs.regex,COMMENT_MODE=hljs.COMMENT("--","$"),RESERVED_FUNCTIONS=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],FUNCTIONS=RESERVED_FUNCTIONS,KEYWORDS=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(keyword=>!RESERVED_FUNCTIONS.includes(keyword)),FUNCTION_CALL={match:regex.concat(/\b/,regex.either(...FUNCTIONS),/\s*\(/),relevance:0,keywords:{built_in:FUNCTIONS}};function kws_to_regex(list){return regex.concat(/\b/,regex.either(...list.map(kw=>kw.replace(/\s+/,"\\s+"))),/\b/)}const MULTI_WORD_KEYWORDS={scope:"keyword",match:kws_to_regex(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(list,{exceptions:exceptions,when:when}={}){const qualifyFn=when;return exceptions=exceptions||[],list.map(item=>item.match(/\|\d+$/)||exceptions.includes(item)?item:qualifyFn(item)?`${item}|0`:item)}(KEYWORDS,{when:x=>x.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:kws_to_regex(["double precision","large object","with timezone","without timezone"])},MULTI_WORD_KEYWORDS,FUNCTION_CALL,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},hljs.C_NUMBER_MODE,hljs.C_BLOCK_COMMENT_MODE,COMMENT_MODE,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}),HighlightJS.registerLanguage("markdown",markdown),HighlightJS.registerLanguage("md",markdown),HighlightJS.registerLanguage("shell",shell),HighlightJS.registerLanguage("sh",shell);const I18N={en:{editor:"Editor",split:"Split",preview:"Preview",toggleToolbar:"Toggle Toolbar",exportPDF:"Print / Export as PDF",paragraph:"Paragraph",heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",inlineCode:"Inline Code",quote:"Quote",list:"Bulleted List",numberedList:"Numbered List",checklist:"Checklist",codeBlock:"Code Block",link:"Link",insertTable:"Insert/Edit Table",horizontalRule:"Horizontal Rule",image:"Image",linkPrompt:"Enter the link URL:",boldPlaceholder:"bold text",italicPlaceholder:"italic text",strikethroughPlaceholder:"strikethrough",codePlaceholder:"code",quotePlaceholder:"quote",listItemPlaceholder:"item",taskPlaceholder:"task",linkTextPlaceholder:"link text",copy:"Copy",copied:"Copied!",copyError:"Error",copyAriaLabel:"Copy code to clipboard",previewErrorTitle:"An error occurred while updating the preview:",printPDF:"PDF",pastedImageAltText:"Pasted Image at",insertImage:"Insert Image",fromURL:"From URL",uploadFile:"Upload File",imageURL:"Image URL",altText:"Alt Text (optional)",chooseFile:"Choose a file...",insert:"Insert",close:"Close",processing:"Processing...",errorImageProcessing:"Failed to process image.",tableEditor:"Interactive Table Editor",addRow:"Add Row",addCol:"Add Column",deleteRow:"Delete Row",deleteCol:"Delete Column",alignLeft:"Align Left",alignCenter:"Align Center",alignRight:"Align Right"},ja:{editor:"エディタ",split:"分割",preview:"プレビュー",toggleToolbar:"ツールバー表示切替",exportPDF:"PDFとして印刷/エクスポート",paragraph:"段落",heading1:"見出し 1",heading2:"見出し 2",heading3:"見出し 3",heading4:"見出し 4",bold:"太字",italic:"斜体",strikethrough:"打ち消し線",inlineCode:"インラインコード",quote:"引用",list:"リスト",numberedList:"番号付きリスト",checklist:"チェックリスト",codeBlock:"コードブロック",link:"リンク",insertTable:"テーブルを挿入/編集",horizontalRule:"水平線",image:"画像",linkPrompt:"リンク先のURLを入力してください:",boldPlaceholder:"太字",italicPlaceholder:"斜体",strikethroughPlaceholder:"打ち消し",codePlaceholder:"code",quotePlaceholder:"引用文",listItemPlaceholder:"項目",taskPlaceholder:"タスク",linkTextPlaceholder:"リンクテキスト",copy:"コピー",copied:"コピーしました!",copyError:"エラー",copyAriaLabel:"クリップボードにコードをコピー",previewErrorTitle:"プレビューの更新中にエラーが発生しました:",printPDF:"PDF",pastedImageAltText:"貼り付けられた画像",insertImage:"画像を挿入",fromURL:"URLから",uploadFile:"ファイルをアップロード",imageURL:"画像のURL",altText:"代替テキスト(任意)",chooseFile:"ファイルを選択...",insert:"挿入",close:"閉じる",processing:"処理中...",errorImageProcessing:"画像の処理に失敗しました。",tableEditor:"インタラクティブ テーブルエディタ",addRow:"行を追加",addCol:"列を追加",deleteRow:"この行を削除",deleteCol:"この列を削除",alignLeft:"左揃え",alignCenter:"中央揃え",alignRight:"右揃え"}},lang=navigator.language.startsWith("ja")?"ja":"en",T=I18N[lang]||I18N.en;function debounce(func,wait){let timeout;return function(...args){clearTimeout(timeout),timeout=setTimeout(()=>{clearTimeout(timeout),func(...args)},wait)}}function applyMarkdown(textarea,prefix,suffix="",placeholder=""){const start=textarea.selectionStart,end=textarea.selectionEnd;let selectedText=textarea.value.substring(start,end);const textBefore=textarea.value.substring(start-prefix.length,start),textAfter=textarea.value.substring(end,end+suffix.length);if(textBefore===prefix&&textAfter===suffix)textarea.setRangeText(selectedText,start-prefix.length,end+suffix.length,"select");else if(selectedText.startsWith(prefix)&&selectedText.endsWith(suffix)){const unwrappedText=selectedText.slice(prefix.length,-suffix.length||void 0);textarea.setRangeText(unwrappedText,start,end,"select")}else selectedText?textarea.setRangeText(prefix+selectedText+suffix,start,end,"select"):(textarea.setRangeText(prefix+placeholder+suffix,start,end,"end"),placeholder&&(textarea.selectionStart=start+prefix.length,textarea.selectionEnd=start+prefix.length+placeholder.length));textarea.focus(),textarea.dispatchEvent(new Event("input",{bubbles:!0}))}function setupMarkdownEditor(originalTextarea){if(originalTextarea.dataset.markdownReady)return;originalTextarea.dataset.markdownReady="true",marked.setOptions({gfm:!0,breaks:!0,smartLists:!0,langPrefix:"language-"});const editorWrapper=originalTextarea.parentElement;editorWrapper.style.display="none",editorWrapper.style.height="100%";const container=document.createElement("div");container.className="markdown-editor-container";const markdownTextarea=document.createElement("textarea");markdownTextarea.className=originalTextarea.className+" custom-markdown-textarea",markdownTextarea.spellcheck=!1;const dataTextarea=document.createElement("textarea");dataTextarea.style.display="none";const combineContent=()=>{const main=markdownTextarea.value,defs=dataTextarea.value;return defs.trim()?`${main.trim()}\n\n${defs.trim()}`:main.trim()},splitAndSetContent=text=>{const lines=text.split("\n");let firstDefLineIndex=-1;for(let i=lines.length-1;i>=0;i--){const line=lines[i].trim();if(line.startsWith("[image-ref-"))firstDefLineIndex=i;else if(""!==line&&-1!==firstDefLineIndex)break}if(-1!==firstDefLineIndex){const mainContent=lines.slice(0,firstDefLineIndex).join("\n").trimEnd(),dataDefinitions=lines.slice(firstDefLineIndex).join("\n");markdownTextarea.value=mainContent,dataTextarea.value=dataDefinitions}else markdownTextarea.value=text,dataTextarea.value=""},resizeAndEncodeImage=file=>new Promise((resolve,reject)=>{if(!file.type.startsWith("image/"))return reject(new Error("File is not an image."));const reader=new FileReader;reader.onload=event=>{const img=new Image;img.onload=()=>{let{width:width,height:height}=img;(width>1280||height>1280)&&(width>height?(height=Math.round(height*(1280/width)),width=1280):(width=Math.round(width*(1280/height)),height=1280));const canvas=document.createElement("canvas");canvas.width=width,canvas.height=height;const ctx=canvas.getContext("2d");ctx.fillStyle="#FFFFFF",ctx.fillRect(0,0,width,height),ctx.drawImage(img,0,0,width,height);const dataUrl=canvas.toDataURL("image/jpeg",.8);resolve(dataUrl)},img.onerror=err=>reject(new Error("Failed to load image.")),img.src=event.target.result},reader.onerror=err=>reject(new Error("Failed to read file.")),reader.readAsDataURL(file)}),insertImageAsReference=(base64data,altText)=>{const timestamp=new Date,finalAltText=altText||`${T.pastedImageAltText} ${timestamp.toLocaleString(lang)}`,refId=`image-ref-${timestamp.getTime()}`;applyMarkdown(markdownTextarea,`![${finalAltText}][${refId}]`);const markdownImageDef=`[${refId}]: ${base64data}`;dataTextarea.value=(dataTextarea.value.trim()?dataTextarea.value.trim()+"\n":"")+markdownImageDef,dataTextarea.dispatchEvent(new Event("input",{bubbles:!0}))},modeBar=document.createElement("div");modeBar.className="mode-toggle-bar";const editorButton=document.createElement("button");editorButton.className="mode-toggle-button",editorButton.textContent=T.editor;const splitButton=document.createElement("button");splitButton.className="mode-toggle-button",splitButton.textContent=T.split;const previewButton=document.createElement("button");previewButton.className="mode-toggle-button",previewButton.textContent=T.preview;const toolbarToggleButton=document.createElement("button");toolbarToggleButton.className="mode-toggle-button toolbar-toggle-button",toolbarToggleButton.title=T.toggleToolbar,toolbarToggleButton.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"></path></svg>';const printButton=document.createElement("button");printButton.className="mode-toggle-button pdf-export-button",printButton.textContent=T.printPDF,printButton.title=T.exportPDF;const toolbar=document.createElement("div");toolbar.className="markdown-toolbar";const previewPane=document.createElement("div");previewPane.className="markdown-preview",markdownTextarea.addEventListener("paste",async event=>{const clipboardData=event.clipboardData,imageItem=Array.from(clipboardData.items).find(item=>item.type.startsWith("image/"));if(imageItem){const file=imageItem.getAsFile();if(file){event.preventDefault();try{const resizedBase64=await resizeAndEncodeImage(file);insertImageAsReference(resizedBase64,null)}catch(error){console.error("Image processing failed:",error)}}return}const text=clipboardData.getData("text/plain");if(text.includes("\t")&&text.includes("\n")){event.preventDefault();const tableMd=(text=>{const rows=text.trim().split("\n").map(row=>row.split("\t")),colCount=Math.max(...rows.map(row=>row.length));let markdown=`| ${rows[0].map(h=>h||" ").join(" | ")} |\n`;markdown+=`|${" :--- |".repeat(colCount)}\n`;for(let i=1;i<rows.length;i++)markdown+=`| ${rows[i].map(c=>c||" ").join(" | ")} |\n`;return markdown})(text);document.execCommand("insertText",!1,tableMd)}});const toolbarButtons=[{type:"select",name:"heading",options:[{value:"p",text:T.paragraph},{value:"h1",text:T.heading1},{value:"h2",text:T.heading2},{value:"h3",text:T.heading3},{value:"h4",text:T.heading4}],action:prefix=>{const start=markdownTextarea.selectionStart;let lineStart=markdownTextarea.value.lastIndexOf("\n",start-1)+1,lineEnd=markdownTextarea.value.indexOf("\n",start);-1===lineEnd&&(lineEnd=markdownTextarea.value.length);const cleanedLine=markdownTextarea.value.substring(lineStart,lineEnd).replace(/^\s*#+\s*/,""),newText=prefix?`${prefix} ${cleanedLine}`:cleanedLine;markdownTextarea.setRangeText(newText,lineStart,lineEnd,"end"),markdownTextarea.dispatchEvent(new Event("input",{bubbles:!0})),markdownTextarea.focus()}},{type:"button",name:"B",title:T.bold,action:()=>applyMarkdown(markdownTextarea,"**","**",T.boldPlaceholder)},{type:"button",name:"I",title:T.italic,action:()=>applyMarkdown(markdownTextarea,"*","*",T.italicPlaceholder)},{type:"button",name:"S",title:T.strikethrough,action:()=>applyMarkdown(markdownTextarea,"~~","~~",T.strikethroughPlaceholder)},{type:"button",name:"`",title:T.inlineCode,action:()=>applyMarkdown(markdownTextarea,"`","`",T.codePlaceholder)},{type:"button",name:"“ ”",title:T.quote,action:()=>applyMarkdown(markdownTextarea,"> ","",T.quotePlaceholder)},{type:"button",name:"•",title:T.list,action:()=>applyMarkdown(markdownTextarea,"- ","",T.listItemPlaceholder)},{type:"button",name:"1.",title:T.numberedList,action:()=>applyMarkdown(markdownTextarea,"1. ","",T.listItemPlaceholder)},{type:"button",name:"☑",title:T.checklist,action:()=>applyMarkdown(markdownTextarea,"- [ ] ","",T.taskPlaceholder)},{type:"button",name:"</>",title:T.codeBlock,action:()=>applyMarkdown(markdownTextarea,"```\n","\n```",T.codePlaceholder)},{type:"icon-button",name:"Image",title:T.image,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"></path></svg>',action:()=>{(onInsertCallback=>{const modalOverlay=document.createElement("div");modalOverlay.className="sn-modal-overlay",modalOverlay.innerHTML=`\n            <div class="sn-modal-content sn-modal-content-image">\n                <div class="sn-modal-header">\n                    <h3>${T.insertImage}</h3>\n                    <button class="sn-modal-close" title="${T.close}">&times;</button>\n                </div>\n                <div class="sn-modal-body">\n                    <div class="sn-modal-tabs">\n                        <div class="sn-modal-tab active" data-tab="url">${T.fromURL}</div>\n                        <div class="sn-modal-tab" data-tab="upload">${T.uploadFile}</div>\n                    </div>\n                    <div class="sn-modal-tab-content active" data-tab-content="url">\n                        <div class="sn-modal-form-group">\n                            <label for="sn-image-url">${T.imageURL}</label>\n                            <input type="text" id="sn-image-url" class="sn-modal-input" placeholder="https://example.com/image.jpg">\n                        </div>\n                    </div>\n                    <div class="sn-modal-tab-content" data-tab-content="upload">\n                            <div class="sn-modal-form-group">\n                                <label class="sn-modal-file-wrapper">\n                                    <span class="sn-modal-file-label">${T.chooseFile}</span>\n                                    <input type="file" class="sn-modal-file-input" accept="image/*">\n                                </label>\n                                <div class="sn-modal-processing-indicator"></div>\n                            </div>\n                    </div>\n                        <div class="sn-modal-form-group">\n                        <label for="sn-image-alt">${T.altText}</label>\n                        <input type="text" id="sn-image-alt" class="sn-modal-input" placeholder="A description of the image">\n                    </div>\n                </div>\n                <div class="sn-modal-footer">\n                    <button class="sn-modal-insert-btn">${T.insert}</button>\n                </div>\n            </div>`,document.body.appendChild(modalOverlay);const content=modalOverlay.querySelector(".sn-modal-content"),urlInput=modalOverlay.querySelector("#sn-image-url"),altInput=modalOverlay.querySelector("#sn-image-alt"),fileInput=modalOverlay.querySelector(".sn-modal-file-input"),fileLabel=modalOverlay.querySelector(".sn-modal-file-label"),processingIndicator=modalOverlay.querySelector(".sn-modal-processing-indicator"),insertBtn=modalOverlay.querySelector(".sn-modal-insert-btn"),closeModal=()=>document.body.contains(modalOverlay)&&document.body.removeChild(modalOverlay);let base64data=null,currentTab="url";modalOverlay.querySelectorAll(".sn-modal-tab").forEach(tab=>{tab.onclick=()=>{currentTab=tab.dataset.tab,modalOverlay.querySelectorAll(".sn-modal-tab").forEach(t=>t.classList.remove("active")),modalOverlay.querySelectorAll(".sn-modal-tab-content").forEach(c=>c.classList.remove("active")),tab.classList.add("active"),modalOverlay.querySelector(`.sn-modal-tab-content[data-tab-content="${currentTab}"]`).classList.add("active"),base64data=null,fileInput.value="",fileLabel.textContent=T.chooseFile,processingIndicator.innerHTML=""}}),fileInput.onchange=async e=>{const file=e.target.files[0];if(file){fileLabel.textContent=file.name,processingIndicator.innerHTML=`<span>${T.processing}</span>`,insertBtn.disabled=!0;try{base64data=await resizeAndEncodeImage(file),processingIndicator.innerHTML="";const imgPreview=document.createElement("img");imgPreview.src=base64data,imgPreview.className="sn-modal-image-preview",processingIndicator.appendChild(imgPreview)}catch(error){console.error(error),processingIndicator.innerHTML=`<span>${T.errorImageProcessing}</span>`,base64data=null}finally{insertBtn.disabled=!1}}},insertBtn.onclick=()=>{const altText=altInput.value.trim();if("url"===currentTab){const url=urlInput.value.trim();url&&(onInsertCallback(url,altText,!1),closeModal())}else base64data&&(onInsertCallback(base64data,altText,!0),closeModal())},modalOverlay.querySelector(".sn-modal-close").onclick=closeModal,content.onclick=e=>e.stopPropagation(),modalOverlay.onclick=closeModal,urlInput.focus()})((data,altText,isReference)=>{if(isReference)insertImageAsReference(data,altText);else{applyMarkdown(markdownTextarea,`![${altText}](${data})`)}})}},{type:"icon-button",name:"Link",title:T.link,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg>',action:()=>{const url=prompt(T.linkPrompt,"https://");url&&applyMarkdown(markdownTextarea,"[",`](${url})`,T.linkTextPlaceholder)}},{type:"icon-button",name:T.insertTable,title:T.insertTable,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8 10H4V6h4v4zm6 0h-4V6h4v4zm6 0h-4V6h4v4zM8 14H4v4h4v-4zm6 0h-4v4h4v-4zm6 0h-4v4h4v-4z"></path></svg>',action:()=>{const start=markdownTextarea.selectionStart,end=markdownTextarea.selectionEnd,existingTableData=(text=>{if(!text||"string"!=typeof text||!text.includes("|"))return null;const lines=text.trim().split("\n").map(l=>l.trim()).filter(l=>l.includes("|"));if(lines.length<2)return null;const headerLine=lines[0],separatorLine=lines[1],dataLines=lines.slice(2),parseRow=rowString=>{const trimmed=rowString.trim();return(trimmed.startsWith("|")&&trimmed.endsWith("|")?trimmed.slice(1,-1):trimmed).split("|").map(cell=>cell.trim())},separatorParts=parseRow(separatorLine);if(!separatorParts.every(part=>/^:?-+:?$/.test(part)))return null;const header=parseRow(headerLine),numCols=header.length;if(separatorParts.length!==numCols)return null;const alignments=separatorParts.map(part=>{const left=part.startsWith(":"),right=part.endsWith(":");return left&&right?"center":right?"right":"left"});return{rows:[header,...dataLines.map(line=>{const rowData=parseRow(line);for(;rowData.length<numCols;)rowData.push("");return rowData.slice(0,numCols)})],alignments:alignments}})(markdownTextarea.value.substring(start,end));((initialData,onInsertCallback)=>{let tableData;tableData=initialData&&initialData.rows.length>0?JSON.parse(JSON.stringify(initialData)):{rows:[["",""],["",""]],alignments:["left","left"]};const modalOverlay=document.createElement("div");modalOverlay.className="sn-modal-overlay";const render=()=>{const colCount=tableData.rows[0]?.length||0,rowCount=tableData.rows.length;let tableHtml='<table class="sn-table-editor"><thead><tr><th class="control-cell"></th>';for(let c=0;c<colCount;c++){let alignIcon;switch(tableData.alignments[c]){case"center":alignIcon="⇌";break;case"right":alignIcon="→";break;default:alignIcon="←"}tableHtml+=`<th data-col="${c}"><div class="col-header" title="${T.alignLeft}/${T.alignCenter}/${T.alignRight}"><span class="align-icon">${alignIcon}</span></div><div class="delete-btn delete-col-btn" title="${T.deleteCol}">🗑️</div></th>`}tableHtml+=`<th class="control-cell"><div class="add-btn add-col-btn" title="${T.addCol}">+</div></th></tr></thead><tbody>`;for(let r=0;r<rowCount;r++){tableHtml+=`<tr data-row="${r}"><td class="control-cell"><div class="delete-btn delete-row-btn" title="${T.deleteRow}">🗑️</div></td>`;for(let c=0;c<colCount;c++){const placeholder=0===r?"Header":"Cell";tableHtml+=`<td><input class="cell-input" type="text" value="${(tableData.rows[r][c]||"").replace(/"/g,"&quot;")}" placeholder="${placeholder}" data-row="${r}" data-col="${c}"></td>`}tableHtml+='<td class="control-cell"></td></tr>'}tableHtml+=`<tr><td class="control-cell"></td><td colspan="${colCount}" class="control-cell"><div class="add-btn add-row-btn" title="${T.addRow}">+</div></td><td class="control-cell"></td></tr></tbody></table>`,modalOverlay.innerHTML=`<div class="sn-modal-content sn-modal-content-table"><div class="sn-modal-header"><h3>${T.tableEditor}</h3><button class="sn-modal-close" title="${T.close}">&times;</button></div><div class="sn-modal-body"><div class="sn-table-editor-container"><div class="sn-table-scroll-container">${tableHtml}</div></div></div><div class="sn-modal-footer"><button class="sn-modal-insert-btn">${T.insert}</button></div></div>`,attachEventListeners()},attachEventListeners=()=>{const content=modalOverlay.querySelector(".sn-modal-content"),closeModal=()=>document.body.contains(modalOverlay)&&document.body.removeChild(modalOverlay);modalOverlay.querySelector(".sn-modal-close").onclick=closeModal,content.onclick=e=>e.stopPropagation(),modalOverlay.onclick=closeModal,modalOverlay.querySelector(".sn-modal-insert-btn").onclick=()=>{let markdown="";if((tableData.rows[0]?.length||0)>0&&tableData.rows.some(row=>row.some(cell=>""!==cell.trim()))){markdown+="| "+tableData.rows[0].map(c=>c.trim()||" ").join(" | ")+" |\n",markdown+="|"+tableData.alignments.map(a=>"center"===a?" :---: ":"right"===a?" ---: ":" :--- ").join("|")+"|\n";for(let i=1;i<tableData.rows.length;i++)markdown+="| "+tableData.rows[i].map(c=>c.trim()||" ").join(" | ")+" |\n"}onInsertCallback(markdown),closeModal()},modalOverlay.querySelector(".add-row-btn").onclick=()=>{0===tableData.rows.length?(tableData.rows.push([""]),tableData.alignments=["left"]):tableData.rows.push(new Array(tableData.rows[0]?.length||1).fill("")),render()},modalOverlay.querySelector(".add-col-btn").onclick=()=>{0===tableData.rows.length?(tableData.rows.push([""]),tableData.alignments=["left"]):(tableData.rows.forEach(row=>row.push("")),tableData.alignments.push("left")),render()},modalOverlay.querySelectorAll(".delete-row-btn").forEach(btn=>{btn.onclick=e=>{const row=parseInt(e.target.closest("tr").dataset.row,10);tableData.rows.length>1&&(tableData.rows.splice(row,1),render())}}),modalOverlay.querySelectorAll(".delete-col-btn").forEach(btn=>{btn.onclick=e=>{const col=parseInt(e.target.closest("th").dataset.col,10);tableData.rows[0].length>1&&(tableData.rows.forEach(row=>row.splice(col,1)),tableData.alignments.splice(col,1),render())}}),modalOverlay.querySelectorAll(".col-header").forEach(header=>{header.onclick=e=>{const col=parseInt(e.currentTarget.closest("th").dataset.col,10),aligns=["left","center","right"];tableData.alignments[col]=aligns[(aligns.indexOf(tableData.alignments[col])+1)%aligns.length],render()}}),modalOverlay.querySelectorAll(".cell-input").forEach(input=>{input.oninput=e=>{const{row:row,col:col}=e.target.dataset;tableData.rows[row][col]=e.target.value},input.onkeydown=e=>{const{row:row,col:col}=e.target.dataset,r=parseInt(row,10),c=parseInt(col,10);let nextCell=null;"Enter"===e.key||"ArrowDown"===e.key?nextCell=modalOverlay.querySelector(`.cell-input[data-row="${r+1}"][data-col="${c}"]`):"ArrowUp"===e.key?nextCell=modalOverlay.querySelector(`.cell-input[data-row="${r-1}"][data-col="${c}"]`):"Tab"===e.key&&!e.shiftKey||"ArrowRight"===e.key?nextCell=modalOverlay.querySelector(`.cell-input[data-row="${r}"][data-col="${c+1}"]`)||modalOverlay.querySelector(`.cell-input[data-row="${r+1}"][data-col="0"]`):("Tab"===e.key&&e.shiftKey||"ArrowLeft"===e.key)&&(nextCell=modalOverlay.querySelector(`.cell-input[data-row="${r}"][data-col="${c-1}"]`)||modalOverlay.querySelector(`.cell-input[data-row="${r-1}"][data-col="${(tableData.rows[0]?.length||1)-1}"]`)),nextCell&&(e.preventDefault(),nextCell.focus())}})};document.body.appendChild(modalOverlay),render(),modalOverlay.querySelector(".cell-input")?.focus()})(existingTableData,markdown=>{markdownTextarea.setRangeText(markdown,start,end,"select"),markdownTextarea.focus(),markdownTextarea.dispatchEvent(new Event("input",{bubbles:!0}))})}},{type:"button",name:"―",title:T.horizontalRule,action:()=>applyMarkdown(markdownTextarea,"\n---\n")}];toolbarButtons.forEach(item=>{if("select"===item.type){const select=document.createElement("select");select.className="toolbar-select heading-select",item.options.forEach(opt=>{const option=document.createElement("option");option.value=opt.value,option.textContent=opt.text,select.appendChild(option)}),select.onchange=e=>{let prefix="";switch(e.target.value){case"h1":prefix="#";break;case"h2":prefix="##";break;case"h3":prefix="###";break;case"h4":prefix="####"}item.action(prefix),updateHeadingSelector()},toolbar.appendChild(select)}else{const button=document.createElement("button");button.className="toolbar-button",button.title=item.title,button.onclick=item.action,"icon-button"===item.type?(button.classList.add("icon-button"),button.innerHTML=item.icon):button.textContent=item.name,toolbar.appendChild(button)}});const headingSelect=toolbar.querySelector(".heading-select"),updateHeadingSelector=()=>{if(!headingSelect)return;const pos=markdownTextarea.selectionStart,text=markdownTextarea.value,lineStart=text.lastIndexOf("\n",pos-1)+1;let lineEnd=text.indexOf("\n",lineStart);-1===lineEnd&&(lineEnd=text.length);const line=text.substring(lineStart,lineEnd);let headingLevel="p";line.startsWith("#### ")?headingLevel="h4":line.startsWith("### ")?headingLevel="h3":line.startsWith("## ")?headingLevel="h2":line.startsWith("# ")&&(headingLevel="h1"),headingSelect.value!==headingLevel&&(headingSelect.value=headingLevel)},debouncedUpdateHeadingSelector=debounce(updateHeadingSelector,150);markdownTextarea.addEventListener("keyup",debouncedUpdateHeadingSelector),markdownTextarea.addEventListener("click",debouncedUpdateHeadingSelector),markdownTextarea.addEventListener("focus",debouncedUpdateHeadingSelector);const contentWrapper=document.createElement("div");contentWrapper.className="editor-preview-wrapper",contentWrapper.append(markdownTextarea,previewPane),modeBar.append(editorButton,splitButton,previewButton,toolbarToggleButton,printButton),container.append(modeBar,toolbar,contentWrapper,dataTextarea),editorWrapper.after(container);const updatePreview=()=>{try{const fullContent=combineContent(),dirtyHtml=marked.parse(fullContent),sanitizedHtml=purify.sanitize(dirtyHtml,{USE_PROFILES:{html:!0},ADD_ATTR:["class","type","disabled","checked","data-task-index"],ADD_TAGS:["span","input"]});previewPane.innerHTML=sanitizedHtml,previewPane.querySelectorAll("pre code").forEach(HighlightJS.highlightElement),previewPane.querySelectorAll("pre").forEach(preEl=>{if(preEl.querySelector(".copy-code-button"))return;const codeEl=preEl.querySelector("code");if(!codeEl)return;const copyButton=document.createElement("button");copyButton.className="copy-code-button",copyButton.textContent=T.copy,copyButton.setAttribute("aria-label",T.copyAriaLabel),preEl.appendChild(copyButton),copyButton.addEventListener("click",e=>{e.stopPropagation(),navigator.clipboard.writeText(codeEl.innerText).then(()=>{copyButton.textContent=T.copied,copyButton.classList.add("copied"),setTimeout(()=>{copyButton.textContent=T.copy,copyButton.classList.remove("copied")},2e3)}).catch(err=>{console.error("Failed to copy code block.",err),copyButton.textContent=T.copyError,setTimeout(()=>{copyButton.textContent=T.copy},2e3)})})});previewPane.querySelectorAll(".task-list-item-checkbox").forEach((checkbox,index)=>{checkbox.checked&&checkbox.closest(".task-list-item")?.classList.add("completed");const newCheckbox=checkbox.cloneNode(!0);checkbox.parentNode.replaceChild(newCheckbox,checkbox),newCheckbox.addEventListener("click",()=>handlePreviewChecklistToggle(index))})}catch(e){console.error("Error updating preview:",e),previewPane.innerHTML=`<div style="padding: 1rem; color: #d73a49; background-color: #f8d7da; border: 1px solid #f5c6cb; border-radius: .25rem;"><strong>${T.previewErrorTitle}</strong><br><pre style="white-space: pre-wrap; word-break: break-all; margin-top: 0.5rem;">${e.stack}</pre></div>`}},handlePreviewChecklistToggle=toggledIndex=>{const text=markdownTextarea.value,regex=/-\s\[[ x]\]/g;let match,currentIndex=0,newText=text;for(;null!==(match=regex.exec(text));){if(currentIndex===toggledIndex){const original=match[0],replacement=original.includes("[ ]")?"- [x]":"- [ ]",pos=match.index;newText=text.substring(0,pos)+replacement+text.substring(pos+original.length);break}currentIndex++}if(markdownTextarea.value!==newText){const cursorPos=markdownTextarea.selectionStart;markdownTextarea.value=newText,markdownTextarea.selectionStart=markdownTextarea.selectionEnd=cursorPos,markdownTextarea.dispatchEvent(new Event("input",{bubbles:!0}))}};let mouseDownTime=0,mouseDownPos={x:0,y:0};markdownTextarea.addEventListener("mousedown",e=>{mouseDownTime=Date.now(),mouseDownPos={x:e.clientX,y:e.clientY}});markdownTextarea.addEventListener("click",e=>{const textarea=e.target,mouseUpTime=Date.now(),distance=Math.sqrt(Math.pow(e.clientX-mouseDownPos.x,2)+Math.pow(e.clientY-mouseDownPos.y,2));if(mouseUpTime-mouseDownTime>250||distance>5||textarea.selectionStart!==textarea.selectionEnd)return;const pos=textarea.selectionStart,text=textarea.value,lineStart=text.lastIndexOf("\n",pos-1)+1,lineEnd=text.indexOf("\n",pos),effectiveLineEnd=-1===lineEnd?text.length:lineEnd,line=text.substring(lineStart,effectiveLineEnd),match=line.match(/^(\s*)(-|\*|\d+\.)\s\[( |x)\]/);if(match&&pos-lineStart<=match[0].length){e.preventDefault();const replacement=line.includes("[ ]")?"[x]":"[ ]",newLine=line.replace(/\[( |x)\]/,replacement);markdownTextarea.value=text.substring(0,lineStart)+newLine+text.substring(effectiveLineEnd),textarea.selectionStart=textarea.selectionEnd=pos,markdownTextarea.dispatchEvent(new Event("input",{bubbles:!0}))}});markdownTextarea.addEventListener("keydown",e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||(e=>{const textarea=e.target,pos=textarea.selectionStart,text=textarea.value,lineStart=text.lastIndexOf("\n",pos-1)+1,match=text.substring(lineStart,pos).match(/^(\s*)((?:-|\*|\d+\.)\s(?:\[[ x]\]\s)?)(\s*.*)/);if(match){if(!match[3].trim())return e.preventDefault(),textarea.setRangeText("",lineStart,pos,"end"),void textarea.dispatchEvent(new Event("input",{bubbles:!0}));e.preventDefault();const indent=match[1];let listMarker=match[2];const numberedMatch=listMarker.match(/^(\d+)\.\s/);numberedMatch?listMarker=`${parseInt(numberedMatch[1],10)+1}. `:listMarker.includes("[x]")&&(listMarker=listMarker.replace("[x]","[ ]")),textarea.setRangeText(`\n${indent}${listMarker}`,pos,pos,"end"),textarea.dispatchEvent(new Event("input",{bubbles:!0}))}})(e)});const cleanupOrphanedImageRefs=debounce(()=>{const contentValue=markdownTextarea.value;let dataValue=dataTextarea.value;const originalDataValue=dataValue,usedRefs=new Set,referenceRegex=/!\[.*?\]\[(image-ref-\d+)\]/g;let match;for(;null!==(match=referenceRegex.exec(contentValue));)usedRefs.add(match[1]);const cleanedDataValue=dataValue.split("\n").filter(line=>{const defMatch=line.match(/^\[(image-ref-\d+)\]:/);return defMatch&&usedRefs.has(defMatch[1])}).join("\n");cleanedDataValue!==originalDataValue&&(dataTextarea.value=cleanedDataValue,dataTextarea.dispatchEvent(new Event("input",{bubbles:!0})))},1500),handleInput=()=>{originalTextarea.value=combineContent(),document.hidden||originalTextarea.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),(container.classList.contains("mode-split")||container.classList.contains("mode-preview"))&&debounce(updatePreview,250)(),cleanupOrphanedImageRefs()};markdownTextarea.addEventListener("input",handleInput),dataTextarea.addEventListener("input",handleInput);new MutationObserver(()=>{originalTextarea.value!==combineContent()&&document.activeElement!==markdownTextarea&&(splitAndSetContent(originalTextarea.value),(container.classList.contains("mode-split")||container.classList.contains("mode-preview"))&&updatePreview())}).observe(originalTextarea,{attributes:!0,childList:!0,subtree:!0,characterData:!0});const modeButtons={editor:editorButton,split:splitButton,preview:previewButton},switchMode=mode=>{container.classList.remove("mode-editor","mode-split","mode-preview"),container.classList.add(`mode-${mode}`),Object.values(modeButtons).forEach(btn=>btn.classList.remove("active")),modeButtons[mode].classList.add("active"),localStorage.setItem("snMarkdownEditorMode",mode),"preview"!==mode&&"split"!==mode||updatePreview(),"preview"!==mode&&markdownTextarea.focus(),updateHeadingSelector()};editorButton.addEventListener("click",()=>switchMode("editor")),splitButton.addEventListener("click",()=>switchMode("split")),previewButton.addEventListener("click",()=>switchMode("preview"));const toggleToolbar=visible=>{container.classList.toggle("toolbar-hidden",!visible),toolbarToggleButton.classList.toggle("active",visible),localStorage.setItem("snMarkdownToolbarVisible",visible)};toolbarToggleButton.addEventListener("click",()=>{const isVisible=container.classList.contains("toolbar-hidden");toggleToolbar(isVisible)});printButton.addEventListener("click",()=>{const printContainer=document.createElement("div");if(printContainer.className="print-container",container.classList.contains("mode-editor")){const pre=document.createElement("pre");pre.className="raw-text-print",pre.textContent=markdownTextarea.value,printContainer.appendChild(pre)}else{updatePreview();const previewClone=previewPane.cloneNode(!0);printContainer.appendChild(previewClone)}document.body.appendChild(printContainer),window.print(),document.body.removeChild(printContainer)}),splitAndSetContent(originalTextarea.value);const initialToolbarVisible="false"!==localStorage.getItem("snMarkdownToolbarVisible");toggleToolbar(initialToolbarVisible);const savedMode=localStorage.getItem("snMarkdownEditorMode");switchMode(savedMode||"split"),console.log("Markdown Editor for Standard Notes (v3.7.8) has been initialized.")}function initiateEditorSetup(editor,attempts=0){editor.value||attempts>5?setupMarkdownEditor(editor):attempts<40?setTimeout(()=>initiateEditorSetup(editor,attempts+1),50):(console.warn("エディタのコンテンツ読み込みがタイムアウトしました。空の状態でセットアップを強制実行します。"),setupMarkdownEditor(editor))}GM_addStyle("\n    /* General Styles */\n    .markdown-editor-container { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--sn-stylekit-border-color, #e0e0e0); border-radius: 4px; }\n    .mode-toggle-bar { flex-shrink: 0; padding: 4px 10px; background-color: var(--sn-stylekit-editor-background-color, #f9f9f9); border-bottom: 1px solid var(--sn-stylekit-border-color, #e0e0e0); display: flex; align-items: center; gap: 5px; }\n    .mode-toggle-button { padding: 5px 12px; border: 1px solid var(--sn-stylekit-border-color, #ccc); border-radius: 6px; cursor: pointer; background-color: var(--sn-stylekit-background-color, #fff); color: var(--sn-stylekit-foreground-color, #333); font-size: 13px; }\n    .mode-toggle-button.active { background-color: var(--sn-stylekit-primary-color, #346df1); color: var(--sn-stylekit-primary-contrast-color, #fff); border-color: var(--sn-stylekit-primary-color, #346df1); }\n    .toolbar-toggle-button { margin-left: auto; padding: 5px 8px; font-size: 13px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; }\n    .toolbar-toggle-button.active { background-color: var(--sn-stylekit-secondary-background-color, #f0f0f0); }\n    .pdf-export-button { padding: 4px 10px; font-size: 12px; }\n    .markdown-toolbar { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; padding: 8px 10px; gap: 8px; background-color: var(--sn-stylekit-editor-background-color, #f9f9f9); border-bottom: 1px solid var(--sn-stylekit-border-color, #e0e0e0); transition: display 0.2s; }\n    .toolbar-button, .toolbar-select { padding: 4px 8px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; background-color: var(--sn-stylekit-background-color, #fff); color: var(--sn-stylekit-foreground-color, #555); font-size: 14px; transition: all 0.2s; }\n    .toolbar-button:hover, .toolbar-select:hover { background-color: var(--sn-stylekit-secondary-background-color, #f0f0f0); border-color: var(--sn-stylekit-border-color, #ccc); }\n    .toolbar-button { font-weight: bold; }\n    .toolbar-button.icon-button { font-weight: normal; padding: 5px; width: 30px; height: 30px; display: inline-flex; justify-content: center; align-items: center; }\n    .toolbar-button.icon-button svg { width: 18px; height: 18px; fill: currentColor; }\n    .toolbar-select { font-weight: bold; -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 20px; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22%23555%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%208l5%205%205-5z%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right 0px center; }\n    .markdown-editor-container.toolbar-hidden .markdown-toolbar { display: none; }\n    .editor-preview-wrapper { display: flex; flex-grow: 1; overflow: hidden; background-color: var(--sn-stylekit-editor-background-color, #fff); }\n    .custom-markdown-textarea, .markdown-preview { height: 100%; overflow-y: auto; flex-grow: 1; flex-shrink: 1; }\n    .custom-markdown-textarea { border: none !important; outline: none !important; resize: none !important; box-shadow: none !important; padding: 16px !important; margin: 0 !important; width: 100% !important; background-color: transparent !important; color: var(--sn-stylekit-foreground-color, #333) !important; font-family: var(--sn-stylekit-font-editor, sans-serif) !important; line-height: var(--sn-stylekit-line-height-editor, 1.7) !important; }\n    .markdown-preview { padding: 16px; line-height: 1.7; font-size: 1.05rem; color: var(--sn-stylekit-foreground-color, #333); }\n    .markdown-editor-container.mode-editor .markdown-preview { display: none; }\n    .markdown-editor-container.mode-preview .markdown-toolbar, .markdown-editor-container.mode-preview .custom-markdown-textarea { display: none; }\n    .markdown-editor-container.mode-preview .markdown-preview { display: block; }\n    .markdown-editor-container.mode-split .custom-markdown-textarea, .markdown-editor-container.mode-split .markdown-preview { display: block !important; flex-basis: 50%; width: 50%; }\n    .markdown-editor-container.mode-split .markdown-preview { border-left: 1px solid var(--sn-stylekit-border-color, #e0e0e0); }\n    /* Markdown Content Styles */\n    .markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 { margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; border-bottom: 1px solid var(--sn-stylekit-border-color, #eee); padding-bottom: .3em; } .markdown-preview h1 { font-size: 2em; } .markdown-preview h2 { font-size: 1.5em; } .markdown-preview h3 { font-size: 1.25em; }\n    .markdown-preview p { margin-bottom: 16px; } .markdown-preview ul, .markdown-preview ol { padding-left: 2em; margin-bottom: 16px; } .markdown-preview blockquote { padding: 0 1em; color: var(--sn-stylekit-secondary-foreground-color, #6a737d); border-left: .25em solid var(--sn-stylekit-border-color, #dfe2e5); margin: 0 0 16px 0; } .markdown-preview code { padding: .2em .4em; margin: 0; font-size: 85%; background-color: var(--sn-stylekit-secondary-background-color, #f0f0f0); border-radius: 3px; font-family: var(--sn-stylekit-font-code, monospace); } .markdown-preview pre { position: relative; padding: 16px; overflow: auto; font-size: 85%; line-height: 1.45; background-color: var(--sn-stylekit-secondary-background-color, #f0f0f0); border-radius: 6px; word-wrap: normal; margin-bottom: 16px; } .markdown-preview pre code { background-color: transparent; padding: 0; margin: 0; } .markdown-preview img { max-width: 100%; height: auto; border-radius: 6px; } .markdown-preview table { border-collapse: collapse; width: 100%; margin-bottom: 16px; display: block; overflow: auto; } .markdown-preview th, .markdown-preview td { border: 1px solid var(--sn-stylekit-border-color, #dfe2e5); padding: 6px 13px; } .markdown-preview tr:nth-child(2n) { background-color: var(--sn-stylekit-secondary-background-color, #f6f8fa); } .markdown-preview hr { height: .25em; padding: 0; margin: 24px 0; background-color: var(--sn-stylekit-border-color, #dfe2e5); border: 0; }\n    .markdown-preview li.task-list-item { list-style-type: none; } .markdown-preview .task-list-item-checkbox { margin: 0 .2em .25em -1.6em; vertical-align: middle; cursor: pointer; }\n    .markdown-preview li.task-list-item.completed { color: var(--sn-stylekit-secondary-foreground-color, #6a737d); }\n    .markdown-preview li.task-list-item.completed, .markdown-preview li.task-list-item.completed a { text-decoration: line-through; }\n    .copy-code-button { position: absolute; top: 10px; right: 10px; padding: 5px 8px; font-size: 12px; border: 1px solid var(--sn-stylekit-border-color, #ccc); border-radius: 4px; background-color: var(--sn-stylekit-background-color, #fff); color: var(--sn-stylekit-secondary-foreground-color, #555); cursor: pointer; opacity: 0; transition: opacity 0.2s, background-color 0.2s, color 0.2s; z-index: 1; } .markdown-preview pre:hover .copy-code-button { opacity: 1; } .copy-code-button:hover { background-color: var(--sn-stylekit-secondary-background-color, #f0f0f0); } .copy-code-button.copied { background-color: var(--sn-stylekit-primary-color, #346df1); color: var(--sn-stylekit-primary-contrast-color, #fff); border-color: var(--sn-stylekit-primary-color, #346df1); }\n    .markdown-preview pre code.hljs { display: block; overflow-x: auto; padding: 0; color: var(--sn-stylekit-foreground-color, #333); background: transparent; } .hljs-comment, .hljs-quote { color: var(--sn-stylekit-secondary-foreground-color, #6a737d); font-style: italic; } .hljs-keyword, .hljs-selector-tag, .hljs-subst, .hljs-deletion, .hljs-meta, .hljs-selector-class { color: #d73a49; } .hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-tag .hljs-attr { color: var(--sn-stylekit-primary-color, #005cc5); } .hljs-string, .hljs-doctag { color: #032f62; } .hljs-title, .hljs-section, .hljs-selector-id, .hljs-type, .hljs-symbol, .hljs-bullet, .hljs-link { color: #6f42c1; } .hljs-addition { color: #22863a; } .hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: bold; }\n    @media (prefers-color-scheme: dark) { .markdown-preview pre code.hljs .hljs-keyword, .markdown-preview pre code.hljs .hljs-selector-tag, .markdown-preview pre code.hljs .hljs-subst, .markdown-preview pre code.hljs .hljs-deletion, .markdown-preview pre code.hljs .hljs-meta, .markdown-preview pre code.hljs .hljs-selector-class { color: #ff7b72; } .markdown-preview pre code.hljs .hljs-string, .markdown-preview pre code.hljs .hljs-doctag { color: #a5d6ff; } .markdown-preview pre code.hljs .hljs-title, .markdown-preview pre code.hljs .hljs-section, .markdown-preview pre code.hljs .hljs-selector-id, .markdown-preview pre code.hljs .hljs-type, .markdown-preview pre code.hljs .hljs-symbol, .markdown-preview pre code.hljs .hljs-bullet, .markdown-preview pre code.hljs .hljs-link { color: #d2a8ff; } .markdown-preview pre code.hljs .hljs-addition { color: #7ee787; } }\n    /* Print Styles */\n    @media print { body > *:not(.print-container) { display: none !important; } .print-container, .print-container > * { display: block !important; width: 100% !important; height: auto !important; overflow: visible !important; } html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; } .markdown-preview { padding: 2cm !important; border: none !important; box-shadow: none !important; color: #000 !important; background-color: #fff !important; font-size: 12pt !important; line-height: 1.5 !important; } .markdown-preview h1, .markdown-preview h2, .markdown-preview h3, .markdown-preview h4, .markdown-preview h5, .markdown-preview h6 { color: #000 !important; border-bottom-color: #ccc !important; } .markdown-preview pre, .markdown-preview code { background-color: #f0f0f0 !important; color: #000 !important; border: 1px solid #ccc !important; } .markdown-preview pre code.hljs { color: #000 !important; } .markdown-preview blockquote { color: #333 !important; border-left-color: #ccc !important; } .markdown-preview tr:nth-child(2n) { background-color: #f6f8fa !important; } .markdown-preview th, .markdown-preview td { border-color: #ccc !important; } .copy-code-button { display: none !important; } .raw-text-print { margin: 0 !important; padding: 2cm !important; white-space: pre-wrap !important; word-wrap: break-word !important; font-family: 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace; font-size: 10pt !important; color: #000 !important; background: #fff !important; } pre, blockquote, table, img, h1, h2, h3, h4 { page-break-inside: avoid; } h1, h2, h3 { page-break-after: avoid; } }\n    /* --- Modal Styles --- */\n    .sn-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); z-index: 9999; display: flex; align-items: center; justify-content: center; }\n    .sn-modal-content { background-color: var(--sn-stylekit-background-color, #fff); color: var(--sn-stylekit-foreground-color, #333); padding: 20px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); display: flex; flex-direction: column; max-height: 90vh; }\n    .sn-modal-content-image { max-width: 500px; width: 90%; }\n    .sn-modal-content-table { width: -moz-fit-content; width: fit-content; min-width: 360px; max-width: 90vw; }\n    .sn-modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--sn-stylekit-border-color, #eee); padding-bottom: 10px; margin-bottom: 15px; flex-shrink: 0; }\n    .sn-modal-header h3 { margin: 0; font-size: 18px; }\n    .sn-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--sn-stylekit-secondary-foreground-color, #888); padding: 0 8px; }\n    .sn-modal-body { flex-grow: 1; overflow-y: auto; position: relative; }\n    .sn-modal-footer { text-align: right; margin-top: 15px; border-top: 1px solid var(--sn-stylekit-border-color, #eee); padding-top: 15px; flex-shrink: 0; }\n    .sn-modal-insert-btn { padding: 8px 16px; border-radius: 5px; border: none; background-color: var(--sn-stylekit-primary-color, #346df1); color: var(--sn-stylekit-primary-contrast-color, #fff); cursor: pointer; }\n    .sn-modal-insert-btn:disabled { background-color: var(--sn-stylekit-secondary-background-color, #f0f0f0); color: var(--sn-stylekit-secondary-foreground-color, #a0a0a0); cursor: not-allowed; }\n    /* --- Image Inserter Modal --- */\n    .sn-modal-tabs { display: flex; border-bottom: 1px solid var(--sn-stylekit-border-color, #eee); margin-bottom: 15px; }\n    .sn-modal-tab { padding: 10px 15px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }\n    .sn-modal-tab.active { border-bottom-color: var(--sn-stylekit-primary-color, #346df1); font-weight: bold; }\n    .sn-modal-tab-content { display: none; padding: 5px 0; }\n    .sn-modal-tab-content.active { display: block; }\n    .sn-modal-form-group { margin-bottom: 15px; }\n    .sn-modal-form-group label { display: block; margin-bottom: 5px; font-weight: 500; }\n    .sn-modal-input { width: 100%; padding: 8px; border: 1px solid var(--sn-stylekit-border-color, #ccc); border-radius: 4px; box-sizing: border-box; background-color: var(--sn-stylekit-background-color, #fff); color: var(--sn-stylekit-foreground-color, #333); }\n    .sn-modal-file-wrapper { position: relative; }\n    .sn-modal-file-label { display: block; padding: 12px; border: 2px dashed var(--sn-stylekit-border-color, #ccc); border-radius: 4px; text-align: center; cursor: pointer; transition: border-color 0.2s; }\n    .sn-modal-file-label:hover { border-color: var(--sn-stylekit-primary-color, #346df1); }\n    .sn-modal-file-input[type=\"file\"] { display: none; }\n    .sn-modal-processing-indicator { margin-top: 10px; font-style: italic; color: var(--sn-stylekit-secondary-foreground-color, #888); text-align: center; }\n    .sn-modal-image-preview { max-height: 150px; max-width: 100%; border: 1px solid var(--sn-stylekit-border-color, #ccc); border-radius: 4px; margin-top: 10px; }\n    /* --- Interactive Table Editor Styles --- */\n    .sn-modal-content-table .sn-modal-body { overflow: hidden; }\n    .sn-table-editor-container { position: relative; height: 100%; display: flex; flex-direction: column; }\n    .sn-table-scroll-container { overflow: auto; flex-grow: 1; padding: 40px 0 0 40px; }\n    .sn-table-editor { border-collapse: collapse; }\n    .sn-table-editor th, .sn-table-editor td { border: 1px solid var(--sn-stylekit-border-color, #ccc); padding: 2px; position: relative; }\n    .sn-table-editor .cell-input { width: 100%; height: 100%; border: none; outline: none; padding: 8px; background: transparent; color: var(--sn-stylekit-foreground-color, #333); font-size: 14px; box-sizing: border-box; min-height: 38px; }\n    .sn-table-editor .cell-input::placeholder { color: var(--sn-stylekit-secondary-foreground-color, #a0a0a0); opacity: 1; }\n    .sn-table-editor .cell-input:focus { background-color: var(--sn-stylekit-secondary-background-color, #f0f0f0); }\n    .sn-table-editor th { background-color: var(--sn-stylekit-secondary-background-color, #f6f8fa); }\n    .col-header { cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 4px; }\n    .col-header:hover { background-color: var(--sn-stylekit-border-color, #e0e0e0); }\n    .align-icon { font-size: 10px; font-weight: bold; }\n    .delete-btn { position: absolute; cursor: pointer; background: #fff; border: 1px solid #ccc; border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; color: #d73a49; font-size: 14px; line-height: 1; opacity: 0.2; transition: opacity 0.2s; z-index: 5; }\n    .delete-btn:hover { opacity: 1; background-color: #d73a49; color: white; border-color: #d73a49; }\n    .delete-col-btn { top: -30px; left: 50%; transform: translateX(-50%); }\n    .delete-row-btn { left: -30px; top: 50%; transform: translateY(-50%); }\n    .sn-table-editor tr:hover .delete-row-btn { opacity: 1; }\n    .sn-table-editor th:hover .delete-col-btn { opacity: 1; }\n    .add-btn { position: relative; cursor: pointer; background: var(--sn-stylekit-primary-color, #346df1); color: white; border: 1px solid white; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; line-height: 1; z-index: 10; }\n    .control-cell { border: none !important; background: transparent !important; text-align: center; vertical-align: middle; padding: 4px !important; }\n    .sn-table-editor thead .control-cell { position: -webkit-sticky; position: sticky; left: 0; background-color: var(--sn-stylekit-editor-background-color, #f9f9f9) !important; }\n    .sn-table-editor thead .control-cell:last-child { right: 0; left: auto; }\n"),document.addEventListener("sn:title:enter",function(e){console.log("イベント 'sn:title:enter' を受信。カスタムエディタにフォーカスします。");const customEditorTextarea=document.querySelector(".custom-markdown-textarea");if(customEditorTextarea){customEditorTextarea.focus();const len=customEditorTextarea.value.length;customEditorTextarea.setSelectionRange(len,len)}});new MutationObserver(()=>{const editor=document.querySelector("#note-text-editor"),customEditor=document.querySelector(".markdown-editor-container");if(editor&&!editor.dataset.markdownReady)customEditor&&customEditor.remove(),initiateEditorSetup(editor);else if(!editor&&customEditor){customEditor.remove();const hiddenWrapper=document.querySelector('#editor-content[style*="display: none"]');hiddenWrapper&&(hiddenWrapper.style.display="")}}).observe(document.body,{childList:!0,subtree:!0})}();