lexxy 0.1.9.beta → 0.1.10.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +78 -3
- data/app/assets/javascript/lexxy.js +197 -99
- data/app/assets/javascript/lexxy.js.br +0 -0
- data/app/assets/javascript/lexxy.js.gz +0 -0
- data/app/assets/javascript/lexxy.min.js +1 -1
- data/app/assets/javascript/lexxy.min.js.br +0 -0
- data/app/assets/javascript/lexxy.min.js.gz +0 -0
- data/lib/lexxy/version.rb +1 -1
- metadata +2 -2
@@ -7,4 +7,4 @@ import{DirectUpload as e}from"@rails/activestorage";
|
|
7
7
|
* @author Lea Verou <https://lea.verou.me>
|
8
8
|
* @namespace
|
9
9
|
* @public
|
10
|
-
*/function ec(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}"undefined"!=typeof module&&module.exports&&(module.exports=Ql),"undefined"!=typeof global&&(global.Prism=Ql),Ql.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Ql.languages.markup.tag.inside["attr-value"].inside.entity=Ql.languages.markup.entity,Ql.languages.markup.doctype.inside["internal-subset"].inside=Ql.languages.markup,Ql.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Ql.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Ql.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Ql.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Ql.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Ql.languages.markup.tag,"addAttribute",{value:function(e,t){Ql.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Ql.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Ql.languages.html=Ql.languages.markup,Ql.languages.mathml=Ql.languages.markup,Ql.languages.svg=Ql.languages.markup,Ql.languages.xml=Ql.languages.extend("markup",{}),Ql.languages.ssml=Ql.languages.xml,Ql.languages.atom=Ql.languages.xml,Ql.languages.rss=Ql.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Ql),Ql.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Ql.languages.javascript=Ql.languages.extend("clike",{"class-name":[Ql.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Ql.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Ql.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Ql.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Ql.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Ql.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Ql.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Ql.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Ql.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Ql.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Ql.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Ql.languages.markup&&(Ql.languages.markup.tag.addInlined("script","javascript"),Ql.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Ql.languages.js=Ql.languages.javascript,function(){if(void 0!==Ql&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+t+'="'+r+'"]):not(['+t+'="'+n+'"])';Ql.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),Ql.hooks.add("before-sanity-check",(function(s){var o=s.element;if(o.matches(i)){s.code="",o.setAttribute(t,n);var a=o.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=o.getAttribute("data-src"),c=s.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}Ql.util.setLanguage(a,c),Ql.util.setLanguage(o,c);var d=Ql.plugins.autoloader;d&&d.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(l,(function(e){o.setAttribute(t,r);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var i=e.split(/\r\n?|\n/g),s=n[0],l=null==n[1]?i.length:n[1];s<0&&(s+=i.length),s=Math.max(0,Math.min(s-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),e=i.slice(s,l).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(s+1))}a.textContent=e,Ql.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),Ql.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)Ql.highlightElement(t)}};var s=!1;Ql.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),Ql.plugins.fileHighlight.highlight.apply(this,arguments)}}}(),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(function(e){var t=e.replace(o,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e})),t}(t.content),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift})),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism);const tc=globalThis.Prism||window.Prism,nc=e=>{try{return!!e&&tc.languages.hasOwnProperty(e)}catch(e){return!1}};function rc(e,t){for(const n of e.childNodes){if(bo(n)&&n.tagName===t)return!0;rc(n,t)}return!1}const ic="data-language",sc="data-highlight-language";let oc=class e extends $i{static getType(){return"code"}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=nc(e)}createDOM(e){const t=document.createElement("code");Ra(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(ic,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sc,n)),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;return r?r!==i&&(t.setAttribute(ic,r),this.__isSyntaxHighlightSupported&&t.setAttribute(sc,r)):i&&(t.removeAttribute(ic),e.__isSyntaxHighlightSupported&&t.removeAttribute(sc)),!1}exportDOM(e){const t=document.createElement("pre");Ra(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(ic,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sc,n)),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||rc(e,"BR"))?{conversion:cc,priority:1}:null,div:()=>({conversion:uc,priority:1}),pre:()=>({conversion:cc,priority:0}),table:e=>pc(e)?{conversion:dc,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&pc(n)?{conversion:hc,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&pc(t)?{conversion:hc,priority:3}:null}}}static importJSON(e){return ac().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=ss();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Pr(o)){let e=Sc(o);const t=[];for(;;)if(Rr(e))t.push(Ir()),e=e.getNextSibling();else{if(!xc(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(bc(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=o.splitText(i.offset)[0],r=0===i.offset?0:1,s=n.getIndexWithinParent()+r,a=o.getParentOrThrow(),l=[hr(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(lc(o)){const{offset:t}=e.anchor;o.splice(t,0,[hr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=ss();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t.__isSyntaxHighlightSupported=nc(e),t}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}};function ac(e){return go(new oc(e))}function lc(e){return e instanceof oc}function cc(e){return{node:ac(e.getAttribute(ic))}}function uc(e){const t=e,n=gc(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(gc(t))return!0;t=t.parentElement}return!1}(t)?{node:n?ac():null}:{node:null}}function dc(){return{node:ac()}}function hc(){return{node:null}}function gc(e){return null!==e.style.fontFamily.match("monospace")}function pc(e){return e.classList.contains("js-file-line-container")}const fc={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},mc={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};class yc extends kr{constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new yc(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return Ra(t,_c(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=_c(n.theme,e.__highlightType),s=_c(n.theme,this.__highlightType);return i!==s&&(i&&Ma(t,i),s&&Ra(t,s)),r}static importJSON(e){return bc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return ac()}}function _c(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function bc(e="",t){return go(new yc(e,t))}function xc(e){return e instanceof yc}function kc(e,t){let n=e;for(let r=Jo(e,t);r&&(xc(r.origin)||Rr(r.origin));r=Da(r))n=r.origin;return n}function Sc(e){return kc(e,"previous")}function vc(e){return kc(e,"next")}const wc={defaultLanguage:"javascript",tokenize(e,t){return tc.tokenize(e,tc.languages[t||""]||tc.languages[this.defaultLanguage])}};function Tc(e,t,n){const r=e.getParent();lc(r)?Nc(r,t,n):xc(e)&&e.replace(Lr(e.__text))}function Cc(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let s="1",o=1;for(let e=0;e<i;e++)gr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const Ec=new Set;function Nc(e,t,n){const r=e.getKey();Ec.has(r)||(Ec.add(r),void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage),t.update((()=>{!function(e,t){const n=Ns(e);if(!lc(n)||!n.isAttached())return;const r=ii();if(!Ur(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&gr(n.getChildAtIndex(i.offset-1));let a=0;if(!o){const e=i.getNode();a=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(o?i.getNode().select(s,s):n.getChildren().some((e=>{const t=Pr(e);if(t||gr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Ns(r);if(!lc(t)||!t.isAttached())return!1;const i=t.getTextContent(),s=Ac(n.tokenize(i,t.getLanguage()||n.defaultLanguage)),o=function(e,t){let n=0;for(;n<e.length&&Lc(e[n],t[n]);)n++;const r=e.length,i=t.length,s=Math.min(r,i)-n;let o=0;for(;o<s;)if(o++,!Lc(e[r-o],t[i-o])){o--;break}const a=r-o;return{from:n,nodesForReplacement:t.slice(n,i-o),to:a}}(t.getChildren(),s),{from:a,to:l,nodesForReplacement:c}=o;return!(a===l&&!c.length||(e.splice(a,l-a,c),0))}))}),{onUpdate:()=>{Ec.delete(r)},skipTransforms:!0}))}function Ac(e,t){const n=[];for(const r of e)if("string"==typeof r){const e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){const i=e[r];"\n"===i||"\r\n"===i?n.push(hr()):"\t"===i?n.push(Ir()):i.length>0&&n.push(bc(i,t))}}else{const{content:e}=r;"string"==typeof e?n.push(...Ac([e],r.type)):Array.isArray(e)&&n.push(...Ac(e,r.type))}return n}function Lc(e,t){return xc(e)&&xc(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Rr(e)&&Rr(t)||gr(e)&&gr(t)}function Pc(e){if(!Ur(e))return!1;const t=e.anchor.getNode(),n=lc(t)?t:t.getParent(),r=e.focus.getNode(),i=lc(r)?r:r.getParent();return lc(n)&&n.is(i)}function Fc(e){const t=e.getNodes(),n=[];if(1===t.length&&lc(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];xc(i)||Rr(i)||gr(i)||ec(169),gr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=Dr(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Oc(e){const t=ii();if(!Ur(t)||!Pc(t))return!1;const n=Fc(t),r=n.length;if(0===r&&t.isCollapsed())return e===yn&&t.insertNodes([Ir()]),!0;if(0===r&&e===yn&&"\n"===t.getTextContent()){const e=Ir(),n=hr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),da(ka(na(Go(e,"next",0),_a(Jo(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=Sc(n)),e===yn){const e=Ir();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=Dr(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Rr(n)&&n.remove()}}return!0}function Ic(e,t){const n=ii();if(!Ur(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===ln;if(!Pc(n)||!xc(a)&&!Rr(a)||!xc(l)&&!Rr(l))return!1;if(!t.altKey){if(n.isCollapsed()){const e=a.getParentOrThrow();if(c&&0===s&&null===a.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!c&&s===a.getTextContentSize()&&null===a.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(a.isBefore(l)?(u=Sc(a),d=vc(l)):(u=Sc(l),d=vc(a)),null==u||null==d)return!1;const h=u.getNodesBetween(d);for(let e=0;e<h.length;e++){const t=h[e];if(!xc(t)&&!Rr(t)&&!gr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!gr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=xc(p)||Rr(p)||gr(p)?c?Sc(p):vc(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===ln?(h.forEach((e=>m.insertBefore(e))),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach((e=>{m.insertAfter(e),m=e}))),n.setTextNodeRange(a,s,l,o),!0}function Rc(e,t){const n=ii();if(!Ur(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===an;if(!Pc(n)||!xc(s)&&!Rr(s)||!xc(o)&&!Rr(o))return!1;if(a){const e=function(e,t){let n=null,r=null,i=e,s=t,o=e.getTextContent();for(;;){if(0===s){if(i=i.getPreviousSibling(),null===i)break;if(xc(i)||Rr(i)||gr(i)||ec(167),gr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];xc(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())xc(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();xc(t)&&(a=t.getTextContent()[0])}if(null!==a&&" "!==a)return n;{const r=function(e,t){let n=e,r=t,i=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!xc(n)||r===s){if(n=n.getNextSibling(),null===n||gr(n))return null;xc(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(xc(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(o,i.offset);if(null!==e){const{node:t,offset:r}=e;gr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else o.getParentOrThrow().selectStart()}else(function(e){const t=vc(e);return gr(t)&&ec(168),t})(o).select();return t.preventDefault(),t.stopPropagation(),!0}const Mc=new Set(["http:","https:","mailto:","sms:","tel:"]);let Dc=class e extends $i{static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:s=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),Ra(t,e.theme.link),t}updateLinkDOM(e,t,n){if(_o(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:zc,priority:1})}}static importJSON(e){return Bc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Gc(e);try{const t=new URL(Gc(e));if(!Mc.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Bc(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Ur(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function zc(e){let t=null;if(_o(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Bc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Bc(e="",t){return go(new Dc(e,t))}function $c(e){return e instanceof Dc}let Uc=class e extends Dc{constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Wc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(Ui(n)){const e=Wc(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}};function Wc(e="",t){return go(new Uc(e,t))}function Kc(e){return e instanceof Uc}function Hc(e,t){if("element"===e.type){const n=e.getNode();return Ui(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function jc(e,t={}){const{target:n,title:r}=t,i=void 0===t.rel?"noreferrer":t.rel,s=ii();if(null===s||!Ur(s)&&!Kr(s))return;if(Kr(s)){const t=s.getNodes();if(0===t.length)return;return void t.forEach((t=>{if(null===e){const e=$a(t,(e=>!Kc(e)&&$c(e)));e&&(e.insertBefore(t),0===e.getChildren().length&&e.remove())}else{const r=$a(t,(e=>!Kc(e)&&$c(e)));if(r)r.setURL(e),void 0!==n&&r.setTarget(n),void 0!==i&&r.setRel(i);else{const r=Bc(e,{rel:i,target:n});t.insertBefore(r),r.append(t)}}}))}const o=s.extract();if(null===e)return void o.forEach((e=>{const t=$a(e,(e=>!Kc(e)&&$c(e)));if(t){const e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));const a=new Set,l=t=>{a.has(t.getKey())||(a.add(t.getKey()),t.setURL(e),void 0!==n&&t.setTarget(n),void 0!==i&&t.setRel(i),void 0!==r&&t.setTitle(r))};if(1===o.length){const e=qc(o[0],$c);if(null!==e)return l(e)}!function(e){const t=ii();if(!Ur(t))return e();const n=it(t),r=n.isBackward(),i=Hc(n.anchor,r?-1:0),s=Hc(n.focus,r?0:-1);if(e(),i||s){const e=ii();if(Ur(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(s){const e=s.getParent();e&&t.focus.set(e.getKey(),s.getIndexWithinParent()+(r?0:1),"element")}Ms(it(t))}}}((()=>{let t=null;for(const s of o){if(!s.isAttached())continue;const o=qc(s,$c);if(o){l(o);continue}if(Ui(s)){if(!s.isInline())continue;if($c(s)){if(!(Kc(s)||null!==t&&t.getParentOrThrow().isParentOf(s))){l(s),t=s;continue}for(const e of s.getChildren())s.insertBefore(e);s.remove();continue}}const a=s.getPreviousSibling();$c(a)&&a.is(t)?a.append(s):(t=Bc(e,{rel:i,target:n,title:r}),s.insertAfter(t),t.append(s))}}))}function qc(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Jc=/^\+?[0-9\s()-]{5,}$/;function Gc(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Jc.test(e)?`tel:${e}`:`https://${e}`}function Vc(e){let t=e;for(;null!==t;){if(sl(t))return t;t=t.getParent()}return null}function Zc(e){let t=e;for(;t;){if(hl(t))return t.getListType();t=t.getParent()}return null}class Yc extends HTMLElement{constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){this.#e(),window.addEventListener("resize",this.#e)}disconnectedCallback(){window.removeEventListener("resize",this.#e)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#t(),this.#n(),this.#r(),this.#i()}#t(){this.addEventListener("click",this.#s.bind(this))}#s({target:e}){this.#o(e,"[data-command]",this.#a.bind(this)),this.#o(e,"[data-dialog-target]",this.#l.bind(this))}#o(e,t,n){const r=e.closest(t);r&&n(r)}#a(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#l(e){const t=document.getElementById(e.dataset.dialogTarget).parentNode;t.open?t.close():t.show()}#n(){this.editorElement.addEventListener("keydown",(e=>{this.querySelectorAll("[data-hotkey]").forEach((t=>{t.dataset.hotkey.toLowerCase().split(/\s+/).includes(this.#c(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))}))}#c(e){const t=e.key.toLowerCase();return[...[e.ctrlKey?"ctrl":null,e.metaKey?"cmd":null,e.altKey?"alt":null,e.shiftKey?"shift":null].filter(Boolean),t].join("+")}#r(){const e=parseInt(this.editorElement.editorContentElement.getAttribute("tabindex")??"0");this.#u.forEach(((t,n)=>{t.setAttribute("tabindex",`${e+n+1}`)}))}#i(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#d()}))}))}#d(){const e=ii();if(!Ur(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=lc(n)||e.hasFormat("code"),o=this.#h(t),a=Zc(t),l=Ul(n),c=Jl(n),u=this.#g(t);this.#p("bold",r),this.#p("italic",i),this.#p("code",s),this.#p("unordered-list",o&&"bullet"===a),this.#p("ordered-list",o&&"number"===a),this.#p("quote",l),this.#p("heading",c),this.#p("link",u)}#f(e){return e.getNodes().some((e=>{if(xc(e))return!0;if(Pr(e)){const t=e.getParent();if(t&&xc(t))return!0}return!1}))}#h(e){let t=e;for(;t;){if(hl(t)||sl(t))return!0;t=t.getParent()}return!1}#g(e){let t=e;for(;t;){if($c(t))return!0;t=t.getParent()}return!1}#p(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#m(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#y(),this.#_(),this.#b.style.display=this.#x.children.length?"block":"none",this.#b.setAttribute("nonce",Sa())};get#b(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#x(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}#y(){for(;this.#x.children.length>0;)this.insertBefore(this.#x.children[0],this.#b)}#_(){const e=this.#u.reverse();let t=!1;for(const n of e){if(!this.#m()){t&&this.#x.appendChild(n);break}this.#x.appendChild(n),t=!0}}get#u(){return Array.from(this.querySelectorAll(":scope > button"))}static get defaultTemplate(){return'\n <button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 22V2h8.183c1.764 0 3.174.435 4.228 1.304 1.055.87 1.582 2.076 1.582 3.62 0 .8-.148 1.503-.445 2.109a3.94 3.94 0 01-1.194 1.465 4.866 4.866 0 01-1.726.806v.176c.786.078 1.51.312 2.172.703a4.293 4.293 0 011.596 1.627c.403.693.604 1.543.604 2.549 0 1.192-.292 2.207-.877 3.048-.585.84-1.39 1.484-2.416 1.934-1.026.44-2.206.659-3.538.659H5zM8.854 4.974v5.348h2.56c.873 0 1.582-.107 2.129-.322.556-.215.963-.523 1.222-.923.269-.41.403-.904.403-1.48 0-.82-.254-1.46-.762-1.92-.499-.468-1.204-.703-2.115-.703H8.854zm0 8.103v5.949h2.877c1.534 0 2.636-.245 3.307-.733.671-.498 1.007-1.221 1.007-2.168 0-.635-.134-1.178-.403-1.627-.268-.459-.666-.81-1.193-1.055-.518-.244-1.156-.366-1.913-.366H8.854z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.1 4h-1.5l-3.2 16h1.5l-.4 2h-7l.4-2h1.5l3.2-16h-1.5l.4-2h7l-.4 2z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="link" title="Link" data-dialog-target="link-dialog" data-hotkey="cmd+k ctrl+k">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.111 9.546a1.5 1.5 0 012.121 0 5.5 5.5 0 010 7.778l-2.828 2.828a5.5 5.5 0 01-7.778 0 5.498 5.498 0 010-7.777l2.828-2.83a1.5 1.5 0 01.355-.262 6.52 6.52 0 00.351 3.799l-1.413 1.414a2.499 2.499 0 000 3.535 2.499 2.499 0 003.535 0l2.83-2.828a2.5 2.5 0 000-3.536 1.5 1.5 0 010-2.121z"/><path d="M12.111 3.89a5.5 5.5 0 117.778 7.777l-2.828 2.829a1.496 1.496 0 01-.355.262 6.522 6.522 0 00-.351-3.8l1.413-1.412a2.5 2.5 0 10-3.536-3.535l-2.828 2.828a2.5 2.5 0 000 3.536 1.5 1.5 0 01-2.122 2.12 5.5 5.5 0 010-7.777l2.83-2.829z"/></svg>\n </button>\n\n <lexxy-link-dialog class="lexxy-link-dialog">\n <dialog id="link-dialog" closedby="any">\n <form method="dialog">\n <input type="url" placeholder="Enter a URL…" class="input" required>\n <div class="lexxy-dialog-actions">\n <button type="submit" class="btn" value="link">Link</button>\n <button type="button" class="btn" value="unlink">Unlink</button>\n </div>\n </form>\n </dialog>\n </lexxy-link-dialog>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 5C8.985 5 11 7.09 11 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.022.746a.563.563 0 01-.52-.36.602.602 0 01.067-.57l.055-.066.009-.009.041-.048a4.25 4.25 0 00.168-.21c.143-.188.336-.47.53-.84a6.743 6.743 0 00.75-2.605C3.705 13.994 2 12.038 2 9.667 2 7.089 4.015 5 6.5 5zM17.5 5C19.985 5 22 7.09 22 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.023.746a.563.563 0 01-.52-.36.602.602 0 01.068-.57l.055-.066.009-.009.041-.048c.039-.045.097-.115.168-.21a6.16 6.16 0 00.53-.84 6.745 6.745 0 00.75-2.605C14.705 13.994 13 12.038 13 9.667 13 7.089 15.015 5 17.5 5z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="heading" data-command="rotateHeadingFormat" title="Heading">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M15.322 5.315H9.64V22H5.684V5.315H0v-3.31h15.322v3.31z"/><path d="M23.957 11.79H19.92V22h-3.402V11.79H12.48V9.137h11.477v2.653z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="code" data-command="insertCodeBlock" title="Code">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.121 6l-6 6 6 6-2.12 2.121-7.061-7.06a1.5 1.5 0 010-2.121L8 3.879 10.121 6zM23.06 10.94a1.5 1.5 0 010 2.12L16 20.121 13.88 18l6-6-6-6L16 3.879l7.06 7.06z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 5a2 2 0 11-4 0 2 2 0 014 0zM5 12a2 2 0 11-4 0 2 2 0 014 0zM5 19a2 2 0 11-4 0 2 2 0 014 0zM7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM4.438 8H3.39V3.684H3.34c-.133.093-.267.188-.402.285l-.407.289a129.5 129.5 0 00-.402.285v-.969l.633-.453c.21-.15.42-.302.629-.453h1.046V8zM2.672 11.258h-1v-.051c0-.206.036-.405.11-.598.075-.195.188-.37.34-.527.15-.156.339-.281.566-.375.229-.094.498-.14.808-.14.367 0 .688.065.961.195s.484.308.633.535c.15.224.226.478.226.762 0 .244-.046.463-.14.656-.091.19-.209.368-.352.535-.14.164-.289.332-.445.504L3.168 14.09v.05h2.238V15H1.723v-.656l1.949-2.102c.096-.101.19-.207.281-.316.091-.112.167-.232.227-.36a.953.953 0 00.09-.41.712.712 0 00-.387-.648.845.845 0 00-.41-.098.81.81 0 00-.43.11.75.75 0 00-.277.293.824.824 0 00-.094.386V11.258zM2.852 19.66v-.812h.562a.917.917 0 00.43-.098.742.742 0 00.293-.266.673.673 0 00.101-.379.654.654 0 00-.234-.523.87.87 0 00-.59-.2.987.987 0 00-.336.055.837.837 0 00-.258.149.712.712 0 00-.172.215.66.66 0 00-.066.25h-.98c.007-.209.053-.403.136-.582.084-.18.203-.336.36-.469.156-.135.346-.24.57-.316.227-.076.486-.115.777-.118a2.33 2.33 0 01.965.176c.271.12.48.285.63.496.15.209.227.448.23.719a1.11 1.11 0 01-.16.637 1.28 1.28 0 01-.825.586v.054c.162.016.33.07.504.164.177.094.328.232.453.415.125.18.189.411.192.695a1.37 1.37 0 01-.157.676c-.104.197-.25.365-.437.503-.188.136-.404.24-.649.313-.242.07-.5.105-.777.105-.401 0-.743-.067-1.027-.203a1.608 1.608 0 01-.649-.547 1.46 1.46 0 01-.238-.75h.969c.01.128.057.243.14.344a.885.885 0 00.332.238c.141.058.3.088.477.09.195 0 .366-.034.512-.101a.798.798 0 00.336-.29.744.744 0 00.117-.425.74.74 0 00-.446-.695 1.082 1.082 0 00-.496-.106h-.59z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="upload" data-command="uploadAttachments" title="Upload file">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 8a2 2 0 110 4 2 2 0 010-4z""/><path d="M22 2a1 1 0 011 1v18a1 1 0 01-1 1H2a1 1 0 01-1-1V3a1 1 0 011-1h20zM3 18.714L9 11l5.25 6.75L17 15l4 4V4H3v14.714z"/></svg>\n </button>\n\n <details class="lexxy-editor__toolbar-overflow">\n <summary class="lexxy-editor__toolbar-button" aria-label="Show more toolbar buttons">•••</summary>\n <div class="lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons"></div>\n </details>\n '}}function Xc(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}customElements.define("lexxy-toolbar",Yc);const Qc=/[!-/:-@[-`{-~\s]/;function eu(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function tu(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(nu(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function nu(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}function ru(e,t=gu){const n=function(e){const t=Xc(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}(t),r=Xc(n.textFormat,(({tag:e})=>e[e.length-1])),i=Xc(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||eu(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!ho(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExp:s,replace:o}of r){const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,!1))return s.remove(),!0}}return!1})(e,t,s,n.element)||function(e,t,n,r){if(!ho(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExpStart:s,replace:o,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,null,null,!1))return s.remove(),!0}}return!1}(e,t,s,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){if(!t.replace||!t.regExp)continue;const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,s=i+n[0].length;let o;return 0===i?[o]=e.splitText(s):[,o]=e.splitText(i,s),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,s,i)||function(e,t,n){const r=e.getTextContent(),i=t-1,s=r[i],o=n[s];if(!o)return!1;for(const t of o){const{tag:n}=t,o=n.length,a=i-o+1;if(o>1&&!nu(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!Qc.test(l))continue;const c=e;let u=c,d=tu(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!gr(h);)if(Pr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=tu(e,e.length,n)}if(d<0)continue;if(u===c&&d+o===a)continue;const g=u.getTextContent();if(d>0&&g[d-1]===s)continue;const p=g[d-1];if(!1===t.intraword&&p&&!Qc.test(p))continue;const f=c.getTextContent(),m=f.slice(0,a)+f.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+o));const _=ii(),b=ti();Ms(b);const x=i-o*(u===c?2:1)+1;b.anchor.set(u.__key,d,"text"),b.focus.set(c.__key,x,"text");for(const e of t.format)b.hasFormat(e)||b.formatText(e);b.anchor.set(b.focus.key,b.focus.offset,b.focus.type);for(const e of t.format)b.hasFormat(e)&&b.toggleFormat(e);return Ur(_)&&(b.format=_.format),!0}}(t,s,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Qi)||t.has(Yi))return;if(e.isComposing())return;const o=r.read(ii),a=i.read(ii);if(!Ur(a)||!Ur(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Pr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!function(e){return Pr(e)&&!e.hasFormat("code")}(u))return;const e=u.getParent();null===e||lc(e)||s(e,u,o.anchor.offset)}))}))}const iu=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},su=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=il("check"===e?"x"===r[3]:void 0);if(hl(o)&&o.getListType()===e){const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(hl(s)&&s.getListType()===e)s.append(a),t.remove();else{const n=dl(e,"number"===e?Number(r[2]):void 0);n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const l=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);l&&a.setIndent(l)},ou=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(sl(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(hl(e)){r.push(ou(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l="number"===a?`${e.getStart()+s}. `:"check"===a?`- [${o.getChecked()?"x":" "}] `:"- ";r.push(i+l+t(o)),s++}return r.join("\n")},au={dependencies:[Wl],export:(e,t)=>{if(!Jl(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:iu((e=>ql("h"+e[1].length))),type:"element"},lu={dependencies:[Bl],export:(e,t)=>{if(!Ul(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Ul(n))return n.splice(n.getChildrenSize(),0,[hr(),...t]),void e.remove()}const i=$l();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},cu={dependencies:[oc],export:e=>{if(!lc(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:/[ \t]*```$/},regExpStart:/^[ \t]*```(\w+)?/,replace:(e,t,n,r,i,s)=>{let o,a;if(!t&&i){if(1===i.length)r?(o=ac(),a=n[1]+i[0]):(o=ac(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=ac(n[1]),0===i[0].trim().length)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}const t=Lr(a);o.append(t),e.append(o)}else t&&iu((e=>ac(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},uu={dependencies:[ol,tl],export:(e,t)=>hl(e)?ou(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:su("bullet"),type:"element"},du={dependencies:[ol,tl],export:(e,t)=>hl(e)?ou(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:su("number"),type:"element"},hu={dependencies:[Dc],export:(e,t,n)=>{if(!$c(e)||Kc(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,s=Bc(r,{title:i}),o=Lr(n);return o.setFormat(e.getFormat()),s.append(o),e.replace(s),o},trigger:")",type:"text-match"},gu=[...[au,lu,uu,du],...[cu],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[hu]];function pu(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const s=t._selection,o=e._selection;if(i)return 1;if(!(Ur(s)&&Ur(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||qi(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(s.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Pr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Pr(c)||!Pr(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=s.anchor,g=o.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,f=g.offset,m=d.length-u.length;return 1===m&&f===p-1?2:-1===m&&f===p+1?3:-1===m&&f===p?4:0}function fu(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(Yi))return r=0,n=u,2;const d=pu(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Xi))return 0;if(null===i)return 1;const p=s._selection;return a.size>0||l.size>0?!1===g&&0!==d&&d===r&&u<n+t&&h||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),s=t._selection,o=n._selection;return!(Ur(s)&&Ur(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Pr(r)||!Pr(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(a)[0],i,s)?0:1:null!==p?0:2})();return n=u,r=d,h}}function mu(e){e.undoStack=[],e.redoStack=[],e.current=null}var yu={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",underline:"lexxy-content__underline"},codeHighlight:{atrule:"code-token__attr",attr:"code-token__attr","attr-name":"code-token__attr","attr-value":"code-token__selector",boolean:"code-token__property",bold:"code-token__variable",builtin:"code-token__selector",cdata:"code-token__comment",char:"code-token__selector",class:"code-token__function","class-name":"code-token__function",color:"code-token__property",comment:"code-token__comment",constant:"code-token__property",coord:"code-token__property",decorator:"code-token__function",deleted:"code-token__property",doctype:"code-token__comment",entity:"code-token__operator",function:"code-token__function",hexcode:"code-token__property",important:"code-token__variable",inserted:"code-token__selector",italic:"code-token__comment",keyword:"code-token__attr",namespace:"code-token__variable",number:"code-token__property",operator:"code-token__operator",parameter:"code-token__variable",prolog:"code-token__comment",property:"code-token__property",punctuation:"code-token__punctuation",regex:"code-token__variable",script:"code-token__function",selector:"code-token__selector",string:"code-token__selector",style:"code-token__function",symbol:"code-token__property",tag:"code-token__property",title:"code-token__function",url:"code-token__operator",variable:"code-token__variable"}};function _u(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)} ${["B","KB","MB","GB","TB","PB"][t]}`}const bu=["img","video","audio","iframe","embed","object","picture","source","canvas","svg","math","form","input","textarea","select","button","code","blockquote"].join(","),xu=["a","action-text-attachment","b","blockquote","br","code","em","figcaption","figure","h1","h2","h3","h4","h5","h6","i","img","li","ol","p","pre","q","strong","ul"],ku=["alt","caption","class","content","content-type","contenteditable","data-direct-upload-id","data-sgid","filename","filesize","height","href","presentation","previewable","sgid","src","title","url","width"];function Su(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t||{}))e in n?n[e]=r:null!=r&&n.setAttribute(e,r);return n}function vu(e){return(new DOMParser).parseFromString(e,"text/html")}function wu(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function Tu(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Cu(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}class Eu extends Ki{static getType(){return"action_text_attachment"}static clone(e){return new Eu({...e},e.__key)}static importJSON(e){return new Eu({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Eu({sgid:e.getAttribute("sgid"),src:e.getAttribute("url"),previewable:e.getAttribute("previewable"),altText:e.getAttribute("alt"),caption:e.getAttribute("caption"),contentType:e.getAttribute("content-type"),fileName:e.getAttribute("filename"),fileSize:e.getAttribute("filesize"),width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),img:e=>({conversion:()=>({node:new Eu({src:e.getAttribute("src"),contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1})}}constructor({sgid:e,src:t,previewable:n,altText:r,caption:i,contentType:s,fileName:o,fileSize:a,width:l,height:c},u){super(u),this.sgid=e,this.src=t,this.previewable=n,this.altText=r||"",this.caption=i||"",this.contentType=s||"",this.fileName=o,this.fileSize=a,this.width=l,this.height=c}createDOM(){const e=this.createAttachmentFigure();return e.addEventListener("click",(t=>{this.#k(e)})),this.isPreviewableAttachment?(e.appendChild(this.#S()),e.appendChild(this.#v())):(e.appendChild(this.#w()),e.appendChild(this.#T())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Su("action-text-attachment",{sgid:this.sgid,previewable:this.previewable||null,url:this.src,alt:this.altText,caption:this.caption,"content-type":this.contentType,filename:this.fileName,filesize:this.fileSize,width:this.width,height:this.height,presentation:"gallery"})}}exportJSON(){return{type:"action_text_attachment",version:1,sgid:this.sgid,src:this.src,previewable:this.previewable,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createAttachmentFigure(){return e=this.contentType,t=this.isPreviewableAttachment,n=this.fileName,Su("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#C(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#C||this.previewable}#S(){return Su("img",{src:this.src,alt:this.altText,...this.#E})}get#E(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#w(){return Su("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#T(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("strong",{className:"attachment__name",textContent:this.caption||this.fileName}),n=Su("span",{className:"attachment__size",textContent:_u(this.fileSize)});return e.appendChild(t),e.appendChild(n),e}#k(e){wu(e,"lexxy:internal:select-node",{key:this.getKey()})}#v(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("input",{type:"text",class:"input",value:this.caption,placeholder:this.fileName});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#N.bind(this)),t.addEventListener("keydown",this.#A.bind(this)),e.appendChild(t),e}#L(e){}#N(e){const t=e.target;t.placeholder=this.fileName,this.#P(t)}#P(e){wu(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#A(e){"Enter"===e.key&&(this.#P(e.target),wu(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Nu extends Eu{static getType(){return"action_text_attachment_upload"}static clone(e){return new Nu({...e},e.__key)}constructor({file:e,uploadUrl:t,blobUrlTemplate:n,editor:r,progress:i},s){super({contentType:e.type},s),this.file=e,this.uploadUrl=t,this.blobUrlTemplate=n,this.src=null,this.editor=r,this.progress=i||0}createDOM(){const e=this.createAttachmentFigure();this.isPreviewableAttachment?e.appendChild(this.#S()):e.appendChild(this.#w()),e.appendChild(this.#F());const t=Su("progress",{value:this.progress,max:100});return e.appendChild(t),this.#O(e).then((()=>this.#I(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}#S(){return Su("img")}#w(){return Su("span",{className:"attachment__icon",textContent:this.#R()})}#R(){return this.file.name.split(".").pop().toLowerCase()}#F(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("span",{className:"attachment__name",textContent:this.file.name||""}),n=Su("span",{className:"attachment__size",textContent:_u(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#O(e){const t=e.querySelector("img");return t?async function(e,t){return new Promise((n=>{const r=new FileReader;t.addEventListener("load",(()=>{n(t)})),r.onload=e=>{t.src=e.target.result||null},r.readAsDataURL(e)}))}(this.file,t):Promise.resolve()}#I(t,n){const r=new e(this.file,this.uploadUrl,this);r.delegate={directUploadWillStoreFileWithXHR:e=>{e.upload.addEventListener("progress",(e=>{this.editor.update((()=>{t.value=Math.round(e.loaded/e.total*100)}))}))}},r.create(((e,t)=>{e?this.#M(n):this.#D(t,n).then((()=>{this.#z(n,t)}))}))}#M(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(Su("div",{innerText:`Error uploading ${this.file?.name??"image"}`}))}async#z(e,t){this.editor.update((()=>{const n=e.querySelector("img"),r=this.blobUrlTemplate.replace(":signed_id",t.signed_id).replace(":filename",encodeURIComponent(t.filename)),i=Ns(this.getKey());i&&i.replace(new Eu({sgid:t.attachable_sgid,src:t.previewable?t.url:r,altText:t.filename,contentType:t.content_type,fileName:t.filename,fileSize:t.byte_size,width:n?.naturalWidth,previewable:t.previewable,height:n?.naturalHeight}))}),{tag:Xi})}async#D(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#S();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}const Au=["bold","rotateHeadingFormat","italic","link","unlink","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","uploadAttachments"];class Lu{static configureFor(e){new Lu(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.#B(),this.#$()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(Qt,"bold")}dispatchItalic(){this.editor.dispatchCommand(Qt,"italic")}dispatchLink(e){this.#U(e)}dispatchUnlink(){this.#U(null)}dispatchInsertUnorderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"bullet"===Zc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(gl,void 0)}dispatchInsertOrderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"number"===Zc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(pl,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedLines((e=>Ul(e)),(()=>$l()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(Qt,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>lc(e)),(()=>new oc("plain")))}))}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Jl(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>ql(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=Su("input",{type:"file",multiple:!0,onchange:({target:e})=>{const t=Array.from(e.files);if(t.length)for(const e of t)this.contents.uploadFile(e)}});document.body.appendChild(e),e.click(),setTimeout((()=>e.remove()),1e3)}#B(){for(const t of Au){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#W(t,0,this[n].bind(this))}var e;this.#W(Vt,1,this.dispatchPaste.bind(this))}#W(e,t,n){this.editor.registerCommand(e,n,t)}#U(e){this.editor.update((()=>{jc(null===e?null:e)}))}#$(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#K.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#H.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#j.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#q.bind(this)))}#j(e){this.dragCounter++,1===this.dragCounter&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#q(e){this.dragCounter--,0===this.dragCounter&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#K(e){e.preventDefault()}#H(e){e.preventDefault(),this.dragCounter=0,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over");const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);if(n.length){for(const e of n)this.contents.uploadFile(e);this.editor.focus()}}}function Pu(){return new Promise(requestAnimationFrame)}class Fu{constructor(e){this.editorElement=e,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#J(),this.#G()}clear(){this.current=null}set current(e){Kr(e)?(this._current=ii(),this.#V()):this.editor.update((()=>{this.#V(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#Z();if(!t)return;const n=this.#Y(t);n&&(e=this.#X(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{Is().selectEnd()}))}get hasSelectedWordsInSingleLine(){const e=ii();if(!Ur(e))return!1;if(e.isCollapsed())return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.getTopLevelElement()!==n.getTopLevelElement())return!1;if(!t.getTopLevelElement())return!1;const r=e.getNodes();for(const e of r)if(gr(e))return!1;return!0}get isInsideList(){const e=ii();if(!Ur(e))return!1;return null!==Vc(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Pr(e)?this.#ee(e,t):Ui(e)?this.#te(e,t):this.#ne(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Pr(e)?this.#re(e,t):Ui(e)?this.#ie(e,t):this.#se(e):null}get#oe(){return this.editorElement.contents}get#ae(){if(this._currentlySelectedKeys)return this._currentlySelectedKeys;if(this._currentlySelectedKeys=new Set,this.current)for(const e of this.current.getNodes())this._currentlySelectedKeys.add(e.getKey());return this._currentlySelectedKeys}#G(){this.editor.registerCommand(on,this.#le.bind(this),1),this.editor.registerCommand(ln,this.#le.bind(this),1),this.editor.registerCommand(rn,this.#ce.bind(this),1),this.editor.registerCommand(cn,this.#ce.bind(this),1),this.editor.registerCommand(pn,this.#ue.bind(this),1),this.editor.registerCommand(hn,this.#de.bind(this),1),this.editor.registerCommand(Wt,(()=>{this.current=ii()}),1)}#J(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Pu();const{key:t}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e){const t=ni();t.add(e.getKey()),Ms(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#he()}))}#V(){this.#ge(),this.#pe(),this.previouslySelectedKeys=this.#ae,this._currentlySelectedKeys=null}#ge(){for(const e of this.previouslySelectedKeys)if(!this.#ae.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#pe(){for(const e of this.#ae)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#le(){this.current?await this.#fe((e=>e.selectPrevious())):this.#me(this.nodeBeforeCursor)}async#ce(){this.current?await this.#fe((e=>e.selectNext(0,0))):this.#me(this.nodeAfterCursor)}async#fe(e){await Pu(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#he(){this.editor.update((()=>{const e=this.#ye();e&&this.#_e(e)}))}#ye(){const e=ii();return e?Kr(e)?this.#be(e):Ur(e)?this.#xe(e):null:null}#be(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#xe(e){return e.anchor.getNode().getTopLevelElement()}#_e(e){const t=e.getNextSibling();t?t.selectStart():this.#ke()}#ke(){const e=Is(),t=ss();e.append(t),t.selectStart()}#me(e){e&&e instanceof Ki&&this.editor.update((()=>{const t=ni();t.add(e.getKey()),Ms(t)}))}#ue(){const e=this.nodeAfterCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#de(){const e=this.nodeBeforeCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#Z(){const e=ii();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#Y(e){let t=e.getBoundingClientRect();if(this.#Se(t)){const n=this.#ve(e);t=n.getBoundingClientRect(),this.#we(n),n.remove()}return t}#Se(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#ve(e){const t=this.#Te();return e.insertNode(t),t}#Te(){const e=document.createElement("span");return e.textContent="",e.style.display="inline-block",e.style.width="1px",e.style.height="1em",e.style.lineHeight="normal",e.setAttribute("nonce",Sa()),e}#we(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#X(e,t){const n=this.editor.getRootElement().getBoundingClientRect();let r=e.left-n.left,i=e.top-n.top;const s=this.#Ce(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#Ce(e){const t=window.getSelection().anchorNode,n=this.#Ee(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#Ee(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#Q(){const e=ii();if(!Ur(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#ee(e,t){return t===e.getTextContentSize()?this.#Ne(e):null}#Ne(e){if(e.getNextSibling()instanceof Ki)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#te(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#ne(e)}#re(e,t){return 0===t?this.#Ae(e):null}#Ae(e){if(e.getPreviousSibling()instanceof Ki)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#ie(e,t){return t>0?e.getChildAtIndex(t-1):this.#se(e)}#ne(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#se(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class Ou{constructor(e){this.editorElement=e,this.editor=e.editor}insertHtml(e){this.editor.update((()=>{const t=ii();if(!Ur(t))return;const n=yl(this.editor,vu(e));t.insertNodes(n)}))}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=ii();if(!Ur(t))return;t.extract().forEach((t=>{if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e();r.append(...n.getChildren()),n.replace(r)}))}))}toggleNodeWrappingAllSelectedLines(e,t){this.editor.update((()=>{const n=ii();if(!Ur(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.insertNodeWrappingAllSelectedLines(t)}))}insertNodeWrappingAllSelectedLines(e){this.editor.update((()=>{const t=ii();Ur(t)&&(t.isCollapsed()?this.#Le(t,e):this.#Pe(t,e))}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=ss();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=ii();e=Ur(t)&&!t.isCollapsed()})),e}hasSelectedWords(){let e=!1;return this.editor.update((()=>{const t=ii();Ur(t)&&(e=!t.isCollapsed()&&t.anchor.getNode().getTopLevelElement()===t.focus.getNode().getTopLevelElement())})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const{listItems:t,parentLists:n}=this.#Fe(e);if(t.size>0){const e=this.#Oe(t);this.#Ie(n),this.#Re(e)}}))}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{jc(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Pr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o),l=a.lastIndexOf(e);-1!==l&&(t=a.slice(l+e.length))})),t}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read((()=>{const n=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Pr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o);t=a.includes(e)})),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t],this.editor.update((()=>{const{anchorNode:n,offset:r}=this.#Me();if(!n)return;const i=this.#De(n,r,e);-1!==i&&this.#ze(n,r,i,t)}))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#Be(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=ii(),i=r?.anchor.getNode(),s=i?.getTopLevelElement(),o=new Nu({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});s&&os(s)&&0===s.getChildrenSize()?s.replace(o):s&&Ui(s)?s.insertAfter(o):di([o])}),{tag:Xi})}deleteSelectedNodes(){this.editor.update((()=>{if(Kr(this.#$e.current)){let e=!1;if(this.#$e.current.getNodes().forEach((t=>{const n=t.getParent();t.remove(),"root"===n.getType()&&0===n.getChildrenSize()&&n.append(ss()),e=!0})),e)return this.#$e.clear(),this.editor.focus(),!0}}))}get#$e(){return this.editorElement.selection}#Le(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else di([t()])}#Pe(e,t){const n=this.#Ue(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#We(n);if(0===r.size)return;const s=this.#Ke(t,r);this.#He(e,s),this.#je(i)}#Ue(e){const t=e.extract().map((e=>this.#qe(e))).filter(Boolean);return Ms(null),t}#qe(e){return os(e)?e:Pr(e)&&e.getParent()&&os(e.getParent())?e.getParent():null}#We(e){const t=new Set,n=new Set;return e.forEach((e=>{const r=e.getTextContent();r&&r.split("\n").forEach((e=>{e.trim()&&t.add(e)})),n.add(e)})),{lineSet:t,nodesToDelete:n}}#Ke(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Lr(e)),t<r.length-1&&n.append(hr())})),n}#He(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#je(e){e.forEach((e=>e.remove()))}#Fe(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=Vc(e);if(t){n.add(t);const e=t.getParent();e&&hl(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#Oe(e){const t=[];for(const n of e){const e=this.#Je(n);e&&t.push(e)}return t}#Je(e){const t=e.getParent();if(!t||!hl(t))return null;const n=ss(),r=this.#Ge(e,n);return e.insertAfter(n),this.#Ve(n,r),e.remove(),n}#Ge(e,t){const n=[];return e.getChildren().forEach((e=>{hl(e)?n.push(e):t.append(e)})),n}#Ve(e,t){t.forEach((t=>{e.insertAfter(t)}))}#Ie(e){for(const t of e)hl(t)&&0===t.getChildrenSize()&&t.remove()}#Re(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#Ze(t,n)}#Ze(e,t){e.selectStart();const n=ii();n&&Ur(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#Me(){const e=ii();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Pr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#De(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#ze(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Lr(s),l=Lr(o||" ");e.replace(a);this.#Ye(a,r).insertAfter(l),this.#Xe(l.getParentOrThrow()),l.select(0,0)}#Ye(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#Xe(e){if(os(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Pr(n)&&""===n.getTextContent()&&r&&!Pr(r)&&e.append(hr())}}#Be(e){return Tu(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Iu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ru={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Mu(e){Ru=e}var Du={exec:()=>null};function zu(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(Bu.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Bu={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},$u=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Uu=/(?:[*+-]|\d{1,9}[.)])/,Wu=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ku=zu(Wu).replace(/bull/g,Uu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Hu=zu(Wu).replace(/bull/g,Uu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ju=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ju=zu(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",qu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gu=zu(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Uu).getRegex(),Vu="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",Zu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yu=zu("^ {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[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Zu).replace("tag",Vu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xu=zu(ju).replace("hr",$u).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",Vu).getRegex(),Qu={blockquote:zu(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xu).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Ju,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:$u,html:Yu,lheading:Ku,list:Gu,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Xu,table:Du,text:/^[^\n]+/},ed=zu("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\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",Vu).getRegex(),td={...Qu,lheading:Hu,table:ed,paragraph:zu(ju).replace("hr",$u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ed).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",Vu).getRegex()},nd={...Qu,html:zu("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Zu).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:Du,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:zu(ju).replace("hr",$u).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ku).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rd=/^( {2,}|\\)\n(?!\s*$)/,id=/[\p{P}\p{S}]/u,sd=/[\s\p{P}\p{S}]/u,od=/[^\s\p{P}\p{S}]/u,ad=zu(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sd).getRegex(),ld=/(?!~)[\p{P}\p{S}]/u,cd=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ud=zu(cd,"u").replace(/punct/g,id).getRegex(),dd=zu(cd,"u").replace(/punct/g,ld).getRegex(),hd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",gd=zu(hd,"gu").replace(/notPunctSpace/g,od).replace(/punctSpace/g,sd).replace(/punct/g,id).getRegex(),pd=zu(hd,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ld).getRegex(),fd=zu("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,od).replace(/punctSpace/g,sd).replace(/punct/g,id).getRegex(),md=zu(/\\(punct)/,"gu").replace(/punct/g,id).getRegex(),yd=zu(/^<(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(),_d=zu(Zu).replace("(?:--\x3e|$)","--\x3e").getRegex(),bd=zu("^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",_d).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),xd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,kd=zu(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",xd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Sd=zu(/^!?\[(label)\]\[(ref)\]/).replace("label",xd).replace("ref",qu).getRegex(),vd=zu(/^!?\[(ref)\](?:\[\])?/).replace("ref",qu).getRegex(),wd={_backpedal:Du,anyPunctuation:md,autolink:yd,blockSkip:/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,br:rd,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Du,emStrongLDelim:ud,emStrongRDelimAst:gd,emStrongRDelimUnd:fd,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:kd,nolink:vd,punctuation:ad,reflink:Sd,reflinkSearch:zu("reflink|nolink(?!\\()","g").replace("reflink",Sd).replace("nolink",vd).getRegex(),tag:bd,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Du},Td={...wd,link:zu(/^!?\[(label)\]\((.*?)\)/).replace("label",xd).getRegex(),reflink:zu(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xd).getRegex()},Cd={...wd,emStrongRDelimAst:pd,emStrongLDelim:dd,url:zu(/^((?: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\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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ed={...Cd,br:zu(rd).replace("{2,}","*").getRegex(),text:zu(Cd.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Nd={normal:Qu,gfm:td,pedantic:nd},Ad={normal:wd,gfm:Cd,breaks:Ed,pedantic:Td},Ld={"&":"&","<":"<",">":">",'"':""","'":"'"},Pd=e=>Ld[e];function Fd(e,t){if(t){if(Bu.escapeTest.test(e))return e.replace(Bu.escapeReplace,Pd)}else if(Bu.escapeTestNoEncode.test(e))return e.replace(Bu.escapeReplaceNoEncode,Pd);return e}function Od(e){try{e=encodeURI(e).replace(Bu.percentDecode,"%")}catch{return null}return e}function Id(e,t){let n=e.replace(Bu.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(Bu.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Bu.slashPipe,"|");return r}function Rd(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function Md(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var Dd=class{options;rules;lexer;constructor(e){this.options=e||Ru}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Rd(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Rd(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Rd(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Rd(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.blockquote(s);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==u?.type);else{let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=s.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let h,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),i.test(c)||s.test(c)||o.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(l)||s.test(l)||n.test(l))break;a+="\n"+c}!u&&!c.trim()&&(u=!0),r+=g+"\n",e=e.substring(g.length+1),l=h.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(a),g&&(h="[ ] "!==g[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!g,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Id(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Id(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Rd(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Md(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Md(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=0,l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&s%3&&!((s+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...r[0]][0].length,l=e.slice(0,s+r.index+t+i);if(Math.min(s,i)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},zd=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ru,this.options.tokenizer=this.options.tokenizer||new Dd,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Bu,block:Nd.normal,inline:Ad.normal};this.options.pedantic?(t.block=Nd.pedantic,t.inline=Ad.pedantic):this.options.gfm&&(t.block=Nd.gfm,this.options.breaks?t.inline=Ad.breaks:t.inline=Ad.gfm),this.tokenizer.rules=t}static get rules(){return{block:Nd,inline:Ad}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Bu.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Bu.tabCharGlobal," ").replace(Bu.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,s)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Bd=class{options;parser;constructor(e){this.options=e||Ru}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(Bu.notSpaceStart)?.[0],i=e.replace(Bu.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Fd(r)+'">'+(n?i:Fd(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Fd(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+Fd(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Fd(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Od(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Fd(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Od(e);if(null===i)return Fd(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Fd(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Fd(e.text)}},$d=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ud=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ru,this.options.renderer=this.options.renderer||new Bd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $d}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){n+=t||"";continue}}let s=i;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":{let i=s,o=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Wd=class{options;block;constructor(e){this.options=e||Ru}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?zd.lex:zd.lexInline}provideParser(){return this.block?Ud.parse:Ud.parseInline}},Kd=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(!0);parseInline=this.parseMarkdown(!1);Parser=Ud;Renderer=Bd;TextRenderer=$d;Lexer=zd;Tokenizer=Dd;Hooks=Wd;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Bd(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Dd(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Wd;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];Wd.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Wd.passThroughHooksRespectAsync.has(n))return Promise.resolve(i.call(t,e)).then((e=>s.call(t,e)));let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return zd.lex(e,t??this.defaults)}parser(e,t){return Ud.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?zd.lex:zd.lexInline,a=i.hooks?i.hooks.provideParser():e?Ud.parse:Ud.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then((e=>o(e,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>a(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=a(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Fd(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Hd(e,t){return Kd.parse(e,t)}function jd(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}Hd.options=Hd.setOptions=function(e){return Kd.setOptions(e),Hd.defaults=Kd.defaults,Mu(Hd.defaults),Hd},Hd.getDefaults=Iu,Hd.defaults=Ru,Hd.use=function(...e){return Kd.use(...e),Hd.defaults=Kd.defaults,Mu(Hd.defaults),Hd},Hd.walkTokens=function(e,t){return Kd.walkTokens(e,t)},Hd.parseInline=Kd.parseInline,Hd.Parser=Ud,Hd.parser=Ud.parse,Hd.Renderer=Bd,Hd.TextRenderer=$d,Hd.Lexer=zd,Hd.lexer=zd.lex,Hd.Tokenizer=Dd,Hd.Hooks=Wd,Hd.parse=Hd,Hd.options,Hd.setOptions,Hd.use,Hd.walkTokens,Hd.parseInline,Ud.parse,zd.lex;class qd{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#Qe(t)?(this.#et(t),e.preventDefault(),!0):void this.#tt(t))}#Qe(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#et(e){e.items[0].getAsString((e=>{(function(e){try{return new URL(e),!0}catch(e){return!1}})(e)&&this.contents.hasSelectedText()?this.contents.createLinkWithSelectedText(e):this.#nt(e)}))}#nt(e){const t=Hd(e);this.contents.insertHtml(t)}#tt(e){this.editorElement.supportsAttachments&&this.#rt((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#rt(e){const t=window.scrollY,n=window.scrollX;e(),await Pu(),window.scrollTo(n,t),this.editor.focus()}}class Jd extends Ki{static getType(){return"custom_action_text_attachment"}static clone(e){return new Jd({...e},e.__key)}static importJSON(e){return new Jd({...e})}static importDOM(){return{"action-text-attachment":e=>{const t=e.getAttribute("content");return e.getAttribute("content")?{conversion:()=>{const n=[],r=e.previousSibling;return r&&r.nodeType===Node.TEXT_NODE&&/\s$/.test(r.textContent)&&n.push(Lr(" ")),n.push(new Jd({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Lr(" ")),{node:n}},priority:2}:null}}}constructor({sgid:e,contentType:t,innerHtml:n},r){super(r),this.sgid=e,this.contentType=t||"application/vnd.actiontext.unknown",this.innerHtml=n}createDOM(){const e=Su("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{wu(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:Su("action-text-attachment",{sgid:this.sgid,content:JSON.stringify(this.innerHtml),"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml}}decorate(){return null}}class Gd extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic",""];static observedAttributes=["connected"];#it="";constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Cu("lexxy-editor"),this.editor=this.#st(),this.contents=new Ou(this),this.selection=new Fu(this),this.clipboard=new qd(this),Lu.configureFor(this),this.#ot(),requestAnimationFrame((()=>Tu(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#at()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#lt()))}formResetCallback(){this.value=this.#it,this.editor.dispatchCommand(Nn,void 0)}get form(){return this.internals.form}get toolbarElement(){return this.#ct?(this.toolbar=this.toolbar||this.#ut(),this.toolbar):null}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get isSingleLineMode(){return this.hasAttribute("single-line")}get supportsAttachments(){return"false"!==this.getAttribute("attachments")}focus(){this.editor.focus()}get value(){return this.cachedValue||this.editor?.getEditorState().read((()=>{this.cachedValue=function(e){return se.sanitize(e,{ALLOWED_TAGS:xu,ALLOWED_ATTR:ku,SAFE_FOR_XML:!1})}(_l(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{ao(ts);const t=Is();t.clear(),t.append(...this.#dt(e)),t.select(),this.#ht(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#dt(e){e||(e="<p></p>");return yl(this.editor,vu(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof Ki&&!t.isInline())return t}return e}))}#ot(){this.#gt(),this.#pt(),this.#ft(),this.#mt(),this.#yt(),this.#_t(),this.#bt(),this.#xt()}#st(){this.editorContentElement=this.editorContentElement||this.#kt();const e=ls({namespace:"LexicalEditor",onError(e){throw e},theme:yu,nodes:this.#St});return e.setRootElement(this.editorContentElement),e}get#St(){const e=[Bl,Wl,ol,tl,oc,yc,Dc,Uc,Jd];return this.supportsAttachments&&e.push(Eu,Nu),e}#kt(){const e=Su("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#vt,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#wt.forEach((t=>e.setAttribute(t.name,t.value))),this.appendChild(e),this.getAttribute("tabindex")?(e.setAttribute("tabindex",this.getAttribute("tabindex")),this.removeAttribute("tabindex")):e.setAttribute("tabindex",0),e}get#vt(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#wt(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#Tt(e){const t=void 0!==this.#Tt&&this.#Tt!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,t&&Tu(this,"lexxy:change")}get#Tt(){return this._internalFormValue}#bt(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#it=e}#xt(){document.addEventListener("turbo:before-cache",this.#Ct)}#Ct=e=>{this.#at()};#gt(){this.#Et(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#Tt=this.value,this.#ht()})))}#Et(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#Nt(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#pt(){Xl(this.editor),function(e,t,n){const r=fu(e,n),i=Ia(e.registerCommand(en,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,s=r.pop();null!==i&&(n.push(i),e.dispatchCommand(An,!0)),0===r.length&&e.dispatchCommand(Ln,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Yi})}}(e,t),!0)),0),e.registerCommand(tn,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(Ln,!0));const s=n.pop();0===n.length&&e.dispatchCommand(An,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Yi})}}(e,t),!0)),0),e.registerCommand(En,(()=>(mu(t),!1)),0),e.registerCommand(Nn,(()=>(mu(t),e.dispatchCommand(An,!1),e.dispatchCommand(Ln,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:o,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,s,o,a);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(An,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Ln,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}(this.editor,{current:null,redoStack:[],undoStack:[]},20),ml(this.editor),this.#At(),ru(this.editor,gu)}#At(){!function(e,t){if(!e.hasNodes([oc,yc]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=wc);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(oc,(t=>{e.update((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Ns(n);null!==t&&Cc(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(oc,(n=>Nc(n,e,t))),e.registerNodeTransform(kr,(n=>Tc(n,e,t))),e.registerNodeTransform(yc,(n=>Tc(n,e,t))),e.registerCommand(fn,(t=>{const n=function(e){const t=ii();if(!Ur(t)||!Pc(t))return null;const n=e?_n:yn,r=e?_n:mn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Fc(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&ec(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=Sc(a[0]),d=vc(a[0]),h=Dr(u.getKey(),0,"text"),g=Dr(d.getKey(),d.getTextContentSize(),"text");return l.isBefore(h)||g.isBefore(c)?n:h.isBefore(l)||c.isBefore(g)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),1),e.registerCommand(mn,(()=>!!Pc(ii())&&(di([Ir()]),!0)),1),e.registerCommand(yn,(e=>Oc(yn)),1),e.registerCommand(_n,(e=>Oc(_n)),1),e.registerCommand(ln,(e=>{const t=ii();if(!Ur(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Pc(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&lc(r.getParentOrThrow())?(e.preventDefault(),!0):Ic(ln,e))}),1),e.registerCommand(cn,(e=>{const t=ii();if(!Ur(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Pc(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&lc(r.getParentOrThrow())?(e.preventDefault(),!0):Ic(cn,e))}),1),e.registerCommand(an,(e=>Rc(an,e)),1),e.registerCommand(sn,(e=>Rc(sn,e)),1)),Ia(...n)}(this.editor),this.append(Su("lexxy-code-language-picker"))}#ft(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e instanceof Eu){const t=e.getWritable();Object.assign(t,n)}}))}))}#mt(){this.editor.registerCommand(un,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#yt(){Gd.debug&&this.#Et(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#_t(){this.#ct&&this.toolbarElement.setEditor(this)}#ut(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#Lt()}get#ct(){return"false"!==this.getAttribute("toolbar")}#Lt(){const e=Su("lexxy-toolbar");return e.innerHTML=Yc.defaultTemplate,this.prepend(e),e}#ht(){this.classList.toggle("lexxy-editor--empty",this.#Pt)}get#Pt(){return!this.editorContentElement.textContent.trim()&&!this.editorContentElement.querySelector(bu)}#at(){this.#Nt(),this.editorContentElement&&(this.editorContentElement.remove(),this.editorContentElement=null),this.contents=null,this.editor=null,this.toolbar&&(this.getAttribute("toolbar")||this.toolbar.remove(),this.toolbar=null),this.selection=null,document.removeEventListener("turbo:before-cache",this.#Ct)}#lt(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-editor",Gd);class Vd extends HTMLElement{connectedCallback(){this.dialog=this.querySelector("dialog"),this.input=this.querySelector("input"),this.addEventListener("submit",this.#Ft.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#Ot.bind(this)),this.addEventListener("keydown",this.#It.bind(this))}show(e){this.input.value=this.#Rt,this.dialog.show()}close(){this.dialog.close()}#Ft(e){const t=e.submitter?.value;this.#Mt.dispatchCommand(t,this.input.value)}#Ot(e){this.#Mt.dispatchCommand("unlink"),this.close()}#It(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}get#Rt(){let e="";return this.#Mt.getEditorState().read((()=>{const t=ii();if(!Ur(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if($c(n)){e=n.getURL();break}n=n.getParent()}})),e}get#Mt(){return this.closest("lexxy-toolbar").editor}}customElements.define("lexxy-link-dialog",Vd);class Zd{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=Su("li",{role:"option",id:Cu("prompt-item"),tabindex:"0"});return n.classList.add("lexxy-prompt-menu__item"),n.appendChild(t),n}async loadPromptItemsFromUrl(e){try{const t=await fetch(e),n=vu(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class Yd extends Zd{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Dt(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Dt(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return jd(e).includes(jd(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class Xd extends Yd{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class Qd extends Yd{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class eh extends Zd{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=function(e,t){let n;return(...r)=>(clearTimeout(n),new Promise(((i,s)=>{n=setTimeout((async()=>{try{const t=await e(...r);i(t)}catch(e){s(e)}}),t)})))}(this.fetchFilteredListItems.bind(this),200)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){const t=await this.loadPromptItemsFromUrl(this.#zt(e));return this.#Dt(t)}#zt(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Dt(e){const t=[];this.promptItemByListItem=new WeakMap;for(const n of e){const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}class th extends HTMLElement{constructor(){super(),this.keyListeners=[]}connectedCallback(){this.source=this.#Bt(),this.#$t()}disconnectedCallback(){this.source=null,this.popoverElement=null}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get#Ut(){return!this.supportsSpaceInSearches}#Bt(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new eh(e):new Qd(e):new Xd(this.querySelectorAll("lexxy-prompt-item"))}#$t(){const e=this.#Mt.registerUpdateListener((()=>{this.#Mt.read((()=>{const t=ii();if(!t)return;let n;if(Ur(t)?n=t.anchor.getNode():Kr(t)&&([n]=t.getNodes()),n&&Pr(n)){[...n.getTextContent().trim()].pop()===this.trigger&&(e(),this.#Wt())}}))}))}get#Mt(){return this.#Kt.editor}get#Kt(){return this.closest("lexxy-editor")}get#$e(){return this.#Kt.selection}async#Wt(){this.popoverElement??=await this.#Ht(),await this.#jt(),this.#qt(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#Jt(),this.#Kt.addEventListener("keydown",this.#Gt),this.#Kt.addEventListener("lexxy:change",this.#jt),this.#Vt()}#Vt(){this.keyListeners.push(this.#Mt.registerCommand(un,this.#Zt.bind(this),3)),this.keyListeners.push(this.#Mt.registerCommand(fn,this.#Zt.bind(this),3)),this.#Ut&&this.keyListeners.push(this.#Mt.registerCommand(dn,this.#Zt.bind(this),3))}#Jt(){const e=this.#Yt[0];e&&this.#Xt(e)}get#Yt(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#Xt(e){this.#Qt(),e.toggleAttribute("aria-selected",!0),e.focus(),this.#Kt.focus(),this.#en.setAttribute("aria-controls",this.popoverElement.id),this.#en.setAttribute("aria-activedescendant",e.id),this.#en.setAttribute("aria-haspopup","listbox")}#Qt(){this.#Yt.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#en.removeAttribute("aria-controls"),this.#en.removeAttribute("aria-activedescendant"),this.#en.removeAttribute("aria-haspopup")}#qt(){const{x:e,y:t,fontSize:n}=this.#$e.cursorPosition,r=this.#Kt.getBoundingClientRect(),i=this.#en.getBoundingClientRect().top-r.top;this.popoverElement.style.left=`${e}px`,this.popoverElement.style.top=`${t+i}px`,this.popoverElement.style.bottom="auto";this.popoverElement.getBoundingClientRect().bottom>window.innerHeight&&(this.popoverElement.style.bottom=`${t-i+n}px`,this.popoverElement.style.top="auto")}async#tn(){this.#Qt(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#Kt.removeEventListener("lexxy:change",this.#jt),this.#Kt.removeEventListener("keydown",this.#Gt),this.#nn(),await Pu(),this.#$t()}#nn(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#jt=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#rn.containsTextBackUntil(this.trigger)?await this.#in():this.#tn()};async#in(){const e=this.#rn.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#sn(t):this.#on(),this.#Jt()}#sn(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#on(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=Su("li",{innerHTML:this.#an});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#an(){return this.getAttribute("empty-results")||"Nothing found"}#Gt=e=>{"Escape"===e.key?(this.#tn(),this.#Kt.focus(),e.stopPropagation()):"ArrowDown"===e.key?(this.#ln(),e.preventDefault(),e.stopPropagation()):"ArrowUp"===e.key&&(this.#cn(),e.preventDefault(),e.stopPropagation())};#ln(){const e=this.#un+1;e<this.#Yt.length&&this.#Xt(this.#Yt[e])}#cn(){const e=this.#un-1;e>=0&&this.#Xt(this.#Yt[e])}get#un(){return this.#Yt.findIndex((e=>e.hasAttribute("aria-selected")))}get#dn(){return this.#Yt[this.#un]}#Zt(e){return" "!==e.key&&e.preventDefault(),e.stopPropagation(),this.#hn(),!0}#hn(){this.#gn(),this.#tn(),this.#Kt.focus()}#gn(){const e=this.source.promptItemFor(this.#dn);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#rn.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#pn(t,n):this.#fn(e,t,n)}#pn(e,t){this.#Mt.update((()=>{const n=yl(this.#Mt,vu(`${e.innerHTML}`));this.#rn.replaceTextBackUntil(t,n)}))}#fn(e,t,n){this.#Mt.update((()=>{const r=new Jd({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#rn.replaceTextBackUntil(n,r)}))}get#rn(){return this.#Kt.contents}get#en(){return this.#Kt.editorContentElement}async#Ht(){const e=Su("ul",{role:"listbox",id:Cu("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",Sa()),e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#mn),this.#Kt.appendChild(e),e}#mn=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#Xt(t),this.#hn())}}customElements.define("lexxy-prompt",th);class nh extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#yn(),this.#_n()}#yn(){this.languagePickerElement=this.#bn(),this.languagePickerElement.addEventListener("change",(()=>{this.#xn(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.languagePickerElement.setAttribute("nonce",Sa()),this.editorElement.appendChild(this.languagePickerElement)}#bn(){const e=Su("select",{hidden:!0,className:"lexxy-code-language-picker","aria-label":"Pick a language…",name:"lexxy-code-language"});for(const[t,n]of Object.entries(this.#kn)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#kn(){const e={...fc};e.ruby||(e.ruby="Ruby");const t=Object.entries(e).sort((([,e],[,t])=>e.localeCompare(t))),n=t.findIndex((([e])=>"plain"===e)),r=t.splice(n,1)[0];return Object.fromEntries([r,...t])}#xn(e){this.editor.update((()=>{const t=this.#Sn();t&&t.setLanguage(e)}))}#_n(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#Sn();e?this.#vn(e):this.#wn()}))}))}#Sn(){const e=ii();if(!Ur(e))return null;const t=e.anchor.getNode(),n=t.getParent();return lc(t)?t:lc(n)?n:null}#vn(e){const t=e.getLanguage();this.#Tn(t),this.#Cn(),this.#En(e)}#Tn(e){if(this.languagePickerElement&&e){const t=function(e){return mc[e]||e}(e);this.languagePickerElement.value=t}}#En(e){const t=this.editor.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.editorElement.getBoundingClientRect(),i=n.top-r.top;this.languagePickerElement.style.top=`${i}px`}#Cn(){this.languagePickerElement.hidden=!1}#wn(){this.languagePickerElement.hidden=!0}}function rh(){document.querySelectorAll("pre[data-language]").forEach((e=>{!function(e){const t=e.getAttribute("data-language");let n=e.innerHTML.replace(/<br\s*\/?>/gi,"\n");const r=Prism.languages[t];if(!r)return;n=(new DOMParser).parseFromString(n,"text/html").body.textContent||"";const i=Prism.highlight(n,r,t),s=Su("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",nh),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),window.Prism=window.Prism||{},Prism.manual=!0;export{rh as highlightAll};
|
10
|
+
*/function ec(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}"undefined"!=typeof module&&module.exports&&(module.exports=Ql),"undefined"!=typeof global&&(global.Prism=Ql),Ql.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Ql.languages.markup.tag.inside["attr-value"].inside.entity=Ql.languages.markup.entity,Ql.languages.markup.doctype.inside["internal-subset"].inside=Ql.languages.markup,Ql.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Ql.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Ql.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Ql.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Ql.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Ql.languages.markup.tag,"addAttribute",{value:function(e,t){Ql.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Ql.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Ql.languages.html=Ql.languages.markup,Ql.languages.mathml=Ql.languages.markup,Ql.languages.svg=Ql.languages.markup,Ql.languages.xml=Ql.languages.extend("markup",{}),Ql.languages.ssml=Ql.languages.xml,Ql.languages.atom=Ql.languages.xml,Ql.languages.rss=Ql.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Ql),Ql.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Ql.languages.javascript=Ql.languages.extend("clike",{"class-name":[Ql.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Ql.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Ql.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Ql.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Ql.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Ql.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Ql.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Ql.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Ql.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Ql.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Ql.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Ql.languages.markup&&(Ql.languages.markup.tag.addInlined("script","javascript"),Ql.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Ql.languages.js=Ql.languages.javascript,function(){if(void 0!==Ql&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},t="data-src-status",n="loading",r="loaded",i="pre[data-src]:not(["+t+'="'+r+'"]):not(['+t+'="'+n+'"])';Ql.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),Ql.hooks.add("before-sanity-check",(function(s){var o=s.element;if(o.matches(i)){s.code="",o.setAttribute(t,n);var a=o.appendChild(document.createElement("CODE"));a.textContent="Loading…";var l=o.getAttribute("data-src"),c=s.language;if("none"===c){var u=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=e[u]||u}Ql.util.setLanguage(a,c),Ql.util.setLanguage(o,c);var d=Ql.plugins.autoloader;d&&d.loadLanguages(c),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n("✖ Error "+r.status+" while fetching file: "+r.statusText):n("✖ Error: File does not exist or is empty"))},r.send(null)}(l,(function(e){o.setAttribute(t,r);var n=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],i=t[3];return r?i?[n,Number(i)]:[n,void 0]:[n,n]}}(o.getAttribute("data-range"));if(n){var i=e.split(/\r\n?|\n/g),s=n[0],l=null==n[1]?i.length:n[1];s<0&&(s+=i.length),s=Math.max(0,Math.min(s-1,i.length)),l<0&&(l+=i.length),l=Math.max(0,Math.min(l,i.length)),e=i.slice(s,l).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(s+1))}a.textContent=e,Ql.highlightElement(a)}),(function(e){o.setAttribute(t,"failed"),a.textContent=e}))}})),Ql.plugins.fileHighlight={highlight:function(e){for(var t,n=(e||document).querySelectorAll(i),r=0;t=n[r++];)Ql.highlightElement(t)}};var s=!1;Ql.fileHighlight=function(){s||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),s=!0),Ql.plugins.fileHighlight.highlight.apply(this,arguments)}}}(),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var i=t[n];if("code"===i.type){var s=i.content[1],o=i.content[3];if(s&&o&&"code-language"===s.type&&"code-block"===o.type&&"string"==typeof s.content){var a=s.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(a=(/[a-z][\w-]*/i.exec(a)||[""])[0].toLowerCase());o.alias?"string"==typeof o.alias?o.alias=[o.alias,l]:o.alias.push(l):o.alias=[l]}}else e(i.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,i=t.classes.length;r<i;r++){var s=t.classes[r],c=/language-(.+)/.exec(s);if(c){n=c[1];break}}var u=e.languages[n];if(u)t.content=e.highlight(function(e){var t=e.replace(o,"");return t=t.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=a[t];return r||e})),t}(t.content),u,n);else if(n&&"none"!==n&&e.plugins.autoloader){var d="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=d,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(d);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var o=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism),Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift})),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism),function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism),function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism);const tc=globalThis.Prism||window.Prism,nc=e=>{try{return!!e&&tc.languages.hasOwnProperty(e)}catch(e){return!1}};function rc(e,t){for(const n of e.childNodes){if(bo(n)&&n.tagName===t)return!0;rc(n,t)}return!1}const ic="data-language",sc="data-highlight-language";let oc=class e extends $i{static getType(){return"code"}static clone(t){return new e(t.__language,t.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=nc(e)}createDOM(e){const t=document.createElement("code");Ra(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(ic,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sc,n)),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;return r?r!==i&&(t.setAttribute(ic,r),this.__isSyntaxHighlightSupported&&t.setAttribute(sc,r)):i&&(t.removeAttribute(ic),e.__isSyntaxHighlightSupported&&t.removeAttribute(sc)),!1}exportDOM(e){const t=document.createElement("pre");Ra(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(ic,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sc,n)),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||rc(e,"BR"))?{conversion:cc,priority:1}:null,div:()=>({conversion:uc,priority:1}),pre:()=>({conversion:cc,priority:0}),table:e=>pc(e)?{conversion:dc,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&pc(n)?{conversion:hc,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&pc(t)?{conversion:hc,priority:3}:null}}}static importJSON(e){return ac().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=ss();return this.insertAfter(e,t),e}const{anchor:i,focus:s}=e,o=(i.isBefore(s)?i:s).getNode();if(Pr(o)){let e=Sc(o);const t=[];for(;;)if(Rr(e))t.push(Ir()),e=e.getNextSibling();else{if(!xc(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(bc(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const n=o.splitText(i.offset)[0],r=0===i.offset?0:1,s=n.getIndexWithinParent()+r,a=o.getParentOrThrow(),l=[hr(),...t];a.splice(s,0,l);const c=t[t.length-1];c?c.select():0===i.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(lc(o)){const{offset:t}=e.anchor;o.splice(t,0,[hr()]),o.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=ss();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t.__isSyntaxHighlightSupported=nc(e),t}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}};function ac(e){return go(new oc(e))}function lc(e){return e instanceof oc}function cc(e){return{node:ac(e.getAttribute(ic))}}function uc(e){const t=e,n=gc(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(gc(t))return!0;t=t.parentElement}return!1}(t)?{node:n?ac():null}:{node:null}}function dc(){return{node:ac()}}function hc(){return{node:null}}function gc(e){return null!==e.style.fontFamily.match("monospace")}function pc(e){return e.classList.contains("js-file-line-container")}const fc={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",powershell:"PowerShell",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},mc={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};class yc extends kr{constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new yc(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return Ra(t,_c(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=_c(n.theme,e.__highlightType),s=_c(n.theme,this.__highlightType);return i!==s&&(i&&Ma(t,i),s&&Ra(t,s)),r}static importJSON(e){return bc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return ac()}}function _c(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function bc(e="",t){return go(new yc(e,t))}function xc(e){return e instanceof yc}function kc(e,t){let n=e;for(let r=Jo(e,t);r&&(xc(r.origin)||Rr(r.origin));r=Da(r))n=r.origin;return n}function Sc(e){return kc(e,"previous")}function vc(e){return kc(e,"next")}const wc={defaultLanguage:"javascript",tokenize(e,t){return tc.tokenize(e,tc.languages[t||""]||tc.languages[this.defaultLanguage])}};function Tc(e,t,n){const r=e.getParent();lc(r)?Nc(r,t,n):xc(e)&&e.replace(Lr(e.__text))}function Cc(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let s="1",o=1;for(let e=0;e<i;e++)gr(r[e])&&(s+="\n"+ ++o);n.setAttribute("data-gutter",s)}const Ec=new Set;function Nc(e,t,n){const r=e.getKey();Ec.has(r)||(Ec.add(r),void 0===e.getLanguage()&&e.setLanguage(n.defaultLanguage),t.update((()=>{!function(e,t){const n=Ns(e);if(!lc(n)||!n.isAttached())return;const r=ii();if(!Ur(r))return void t();const i=r.anchor,s=i.offset,o="element"===i.type&&gr(n.getChildAtIndex(i.offset-1));let a=0;if(!o){const e=i.getNode();a=s+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(o?i.getNode().select(s,s):n.getChildren().some((e=>{const t=Pr(e);if(t||gr(e)){const n=e.getTextContentSize();if(t&&n>=a)return e.select(a,a),!0;a-=n}return!1})))}(r,(()=>{const t=Ns(r);if(!lc(t)||!t.isAttached())return!1;const i=t.getTextContent(),s=Ac(n.tokenize(i,t.getLanguage()||n.defaultLanguage)),o=function(e,t){let n=0;for(;n<e.length&&Lc(e[n],t[n]);)n++;const r=e.length,i=t.length,s=Math.min(r,i)-n;let o=0;for(;o<s;)if(o++,!Lc(e[r-o],t[i-o])){o--;break}const a=r-o;return{from:n,nodesForReplacement:t.slice(n,i-o),to:a}}(t.getChildren(),s),{from:a,to:l,nodesForReplacement:c}=o;return!(a===l&&!c.length||(e.splice(a,l-a,c),0))}))}),{onUpdate:()=>{Ec.delete(r)},skipTransforms:!0}))}function Ac(e,t){const n=[];for(const r of e)if("string"==typeof r){const e=r.split(/(\n|\t)/),i=e.length;for(let r=0;r<i;r++){const i=e[r];"\n"===i||"\r\n"===i?n.push(hr()):"\t"===i?n.push(Ir()):i.length>0&&n.push(bc(i,t))}}else{const{content:e}=r;"string"==typeof e?n.push(...Ac([e],r.type)):Array.isArray(e)&&n.push(...Ac(e,r.type))}return n}function Lc(e,t){return xc(e)&&xc(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Rr(e)&&Rr(t)||gr(e)&&gr(t)}function Pc(e){if(!Ur(e))return!1;const t=e.anchor.getNode(),n=lc(t)?t:t.getParent(),r=e.focus.getNode(),i=lc(r)?r:r.getParent();return lc(n)&&n.is(i)}function Fc(e){const t=e.getNodes(),n=[];if(1===t.length&&lc(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];xc(i)||Rr(i)||gr(i)||ec(169),gr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=Dr(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function Oc(e){const t=ii();if(!Ur(t)||!Pc(t))return!1;const n=Fc(t),r=n.length;if(0===r&&t.isCollapsed())return e===yn&&t.insertNodes([Ir()]),!0;if(0===r&&e===yn&&"\n"===t.getTextContent()){const e=Ir(),n=hr(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),da(ka(na(Go(e,"next",0),_a(Jo(n,"next"))),r)),!0}for(let i=0;i<r;i++){const r=n[i];if(r.length>0){let n=r[0];if(0===i&&(n=Sc(n)),e===yn){const e=Ir();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=Dr(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Rr(n)&&n.remove()}}return!0}function Ic(e,t){const n=ii();if(!Ur(n))return!1;const{anchor:r,focus:i}=n,s=r.offset,o=i.offset,a=r.getNode(),l=i.getNode(),c=e===ln;if(!Pc(n)||!xc(a)&&!Rr(a)||!xc(l)&&!Rr(l))return!1;if(!t.altKey){if(n.isCollapsed()){const e=a.getParentOrThrow();if(c&&0===s&&null===a.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!c&&s===a.getTextContentSize()&&null===a.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(a.isBefore(l)?(u=Sc(a),d=vc(l)):(u=Sc(l),d=vc(a)),null==u||null==d)return!1;const h=u.getNodesBetween(d);for(let e=0;e<h.length;e++){const t=h[e];if(!xc(t)&&!Rr(t)&&!gr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!gr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=xc(p)||Rr(p)||gr(p)?c?Sc(p):vc(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===ln?(h.forEach((e=>m.insertBefore(e))),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach((e=>{m.insertAfter(e),m=e}))),n.setTextNodeRange(a,s,l,o),!0}function Rc(e,t){const n=ii();if(!Ur(n))return!1;const{anchor:r,focus:i}=n,s=r.getNode(),o=i.getNode(),a=e===an;if(!Pc(n)||!xc(s)&&!Rr(s)||!xc(o)&&!Rr(o))return!1;if(a){const e=function(e,t){let n=null,r=null,i=e,s=t,o=e.getTextContent();for(;;){if(0===s){if(i=i.getPreviousSibling(),null===i)break;if(xc(i)||Rr(i)||gr(i)||ec(167),gr(i)){n={node:i,offset:1};break}s=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else s--;const e=o[s];xc(i)&&" "!==e&&(r={node:i,offset:s})}if(null!==r)return r;let a=null;if(t<e.getTextContentSize())xc(e)&&(a=e.getTextContent()[t]);else{const t=e.getNextSibling();xc(t)&&(a=t.getTextContent()[0])}if(null!==a&&" "!==a)return n;{const r=function(e,t){let n=e,r=t,i=e.getTextContent(),s=e.getTextContentSize();for(;;){if(!xc(n)||r===s){if(n=n.getNextSibling(),null===n||gr(n))return null;xc(n)&&(r=0,i=n.getTextContent(),s=n.getTextContentSize())}if(xc(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}(o,i.offset);if(null!==e){const{node:t,offset:r}=e;gr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else o.getParentOrThrow().selectStart()}else(function(e){const t=vc(e);return gr(t)&&ec(168),t})(o).select();return t.preventDefault(),t.stopPropagation(),!0}const Mc=new Set(["http:","https:","mailto:","sms:","tel:"]);let Dc=class e extends $i{static getType(){return"link"}static clone(t){return new e(t.__url,{rel:t.__rel,target:t.__target,title:t.__title},t.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:i=null,title:s=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=s}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),Ra(t,e.theme.link),t}updateLinkDOM(e,t,n){if(_o(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const n of["target","rel","title"]){const r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}static importDOM(){return{a:e=>({conversion:zc,priority:1})}}static importJSON(e){return Bc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Gc(e);try{const t=new URL(Gc(e));if(!Mc.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=Bc(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Ur(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}};function zc(e){let t=null;if(_o(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=Bc(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function Bc(e="",t){return go(new Dc(e,t))}function $c(e){return e instanceof Dc}let Uc=class e extends Dc{constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}static getType(){return"autolink"}static clone(t){return new e(t.__url,{isUnlinked:t.__isUnlinked,rel:t.__rel,target:t.__target,title:t.__title},t.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Wc().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const n=this.getParentOrThrow().insertNewAfter(e,t);if(Ui(n)){const e=Wc(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return n.append(e),e}return null}};function Wc(e="",t){return go(new Uc(e,t))}function Kc(e){return e instanceof Uc}function Hc(e,t){if("element"===e.type){const n=e.getNode();return Ui(n)||function(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(252),n.getChildren()[e.offset+t]||null}return null}function jc(e,t={}){const{target:n,title:r}=t,i=void 0===t.rel?"noreferrer":t.rel,s=ii();if(null===s||!Ur(s)&&!Kr(s))return;if(Kr(s)){const t=s.getNodes();if(0===t.length)return;return void t.forEach((t=>{if(null===e){const e=$a(t,(e=>!Kc(e)&&$c(e)));e&&(e.insertBefore(t),0===e.getChildren().length&&e.remove())}else{const r=$a(t,(e=>!Kc(e)&&$c(e)));if(r)r.setURL(e),void 0!==n&&r.setTarget(n),void 0!==i&&r.setRel(i);else{const r=Bc(e,{rel:i,target:n});t.insertBefore(r),r.append(t)}}}))}const o=s.extract();if(null===e)return void o.forEach((e=>{const t=$a(e,(e=>!Kc(e)&&$c(e)));if(t){const e=t.getChildren();for(let n=0;n<e.length;n++)t.insertBefore(e[n]);t.remove()}}));const a=new Set,l=t=>{a.has(t.getKey())||(a.add(t.getKey()),t.setURL(e),void 0!==n&&t.setTarget(n),void 0!==i&&t.setRel(i),void 0!==r&&t.setTitle(r))};if(1===o.length){const e=qc(o[0],$c);if(null!==e)return l(e)}!function(e){const t=ii();if(!Ur(t))return e();const n=it(t),r=n.isBackward(),i=Hc(n.anchor,r?-1:0),s=Hc(n.focus,r?0:-1);if(e(),i||s){const e=ii();if(Ur(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(s){const e=s.getParent();e&&t.focus.set(e.getKey(),s.getIndexWithinParent()+(r?0:1),"element")}Ms(it(t))}}}((()=>{let t=null;for(const s of o){if(!s.isAttached())continue;const o=qc(s,$c);if(o){l(o);continue}if(Ui(s)){if(!s.isInline())continue;if($c(s)){if(!(Kc(s)||null!==t&&t.getParentOrThrow().isParentOf(s))){l(s),t=s;continue}for(const e of s.getChildren())s.insertBefore(e);s.remove();continue}}const a=s.getPreviousSibling();$c(a)&&a.is(t)?a.append(s):(t=Bc(e,{rel:i,target:n,title:r}),s.insertAfter(t),t.append(s))}}))}function qc(e,t){let n=e;for(;null!==n&&null!==n.getParent()&&!t(n);)n=n.getParentOrThrow();return t(n)?n:null}const Jc=/^\+?[0-9\s()-]{5,}$/;function Gc(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:Jc.test(e)?`tel:${e}`:`https://${e}`}function Vc(e){let t=e;for(;null!==t;){if(sl(t))return t;t=t.getParent()}return null}function Zc(e){let t=e;for(;t;){if(hl(t))return t.getListType();t=t.getParent()}return null}class Yc extends HTMLElement{constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar"}connectedCallback(){this.#e(),window.addEventListener("resize",this.#e)}disconnectedCallback(){window.removeEventListener("resize",this.#e)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.#t(),this.#n(),this.#r(),this.#i()}#t(){this.addEventListener("click",this.#s.bind(this))}#s({target:e}){this.#o(e,"[data-command]",this.#a.bind(this)),this.#o(e,"[data-dialog-target]",this.#l.bind(this))}#o(e,t,n){const r=e.closest(t);r&&n(r)}#a(e){const{command:t,payload:n}=e.dataset;this.editor.dispatchCommand(t,n)}#l(e){const t=document.getElementById(e.dataset.dialogTarget).parentNode;t.open?t.close():t.show()}#n(){this.editorElement.addEventListener("keydown",(e=>{this.querySelectorAll("[data-hotkey]").forEach((t=>{t.dataset.hotkey.toLowerCase().split(/\s+/).includes(this.#c(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))}))}#c(e){const t=e.key.toLowerCase();return[...[e.ctrlKey?"ctrl":null,e.metaKey?"cmd":null,e.altKey?"alt":null,e.shiftKey?"shift":null].filter(Boolean),t].join("+")}#r(){const e=parseInt(this.editorElement.editorContentElement.getAttribute("tabindex")??"0");this.#u.forEach(((t,n)=>{t.setAttribute("tabindex",`${e+n+1}`)}))}#i(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{this.#d()}))}))}#d(){const e=ii();if(!Ur(e))return;const t=e.anchor.getNode();if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e.hasFormat("bold"),i=e.hasFormat("italic"),s=lc(n)||e.hasFormat("code"),o=this.#h(t),a=Zc(t),l=Ul(n),c=Jl(n),u=this.#g(t);this.#p("bold",r),this.#p("italic",i),this.#p("code",s),this.#p("unordered-list",o&&"bullet"===a),this.#p("ordered-list",o&&"number"===a),this.#p("quote",l),this.#p("heading",c),this.#p("link",u)}#f(e){return e.getNodes().some((e=>{if(xc(e))return!0;if(Pr(e)){const t=e.getParent();if(t&&xc(t))return!0}return!1}))}#h(e){let t=e;for(;t;){if(hl(t)||sl(t))return!0;t=t.getParent()}return!1}#g(e){let t=e;for(;t;){if($c(t))return!0;t=t.getParent()}return!1}#p(e,t){const n=this.querySelector(`[name="${e}"]`);n&&n.setAttribute("aria-pressed",t.toString())}#m(){return this.scrollWidth>this.clientWidth}#e=()=>{this.#y(),this.#_(),this.#b.style.display=this.#x.children.length?"block":"none",this.#b.setAttribute("nonce",Sa())};get#b(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#x(){return this.querySelector(".lexxy-editor__toolbar-overflow-menu")}#y(){for(;this.#x.children.length>0;)this.insertBefore(this.#x.children[0],this.#b)}#_(){const e=this.#u.reverse();let t=!1;for(const n of e){if(!this.#m()){t&&this.#x.appendChild(n);break}this.#x.appendChild(n),t=!0}}get#u(){return Array.from(this.querySelectorAll(":scope > button"))}static get defaultTemplate(){return'\n <button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 22V2h8.183c1.764 0 3.174.435 4.228 1.304 1.055.87 1.582 2.076 1.582 3.62 0 .8-.148 1.503-.445 2.109a3.94 3.94 0 01-1.194 1.465 4.866 4.866 0 01-1.726.806v.176c.786.078 1.51.312 2.172.703a4.293 4.293 0 011.596 1.627c.403.693.604 1.543.604 2.549 0 1.192-.292 2.207-.877 3.048-.585.84-1.39 1.484-2.416 1.934-1.026.44-2.206.659-3.538.659H5zM8.854 4.974v5.348h2.56c.873 0 1.582-.107 2.129-.322.556-.215.963-.523 1.222-.923.269-.41.403-.904.403-1.48 0-.82-.254-1.46-.762-1.92-.499-.468-1.204-.703-2.115-.703H8.854zm0 8.103v5.949h2.877c1.534 0 2.636-.245 3.307-.733.671-.498 1.007-1.221 1.007-2.168 0-.635-.134-1.178-.403-1.627-.268-.459-.666-.81-1.193-1.055-.518-.244-1.156-.366-1.913-.366H8.854z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M17.1 4h-1.5l-3.2 16h1.5l-.4 2h-7l.4-2h1.5l3.2-16h-1.5l.4-2h7l-.4 2z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="link" title="Link" data-dialog-target="link-dialog" data-hotkey="cmd+k ctrl+k">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.111 9.546a1.5 1.5 0 012.121 0 5.5 5.5 0 010 7.778l-2.828 2.828a5.5 5.5 0 01-7.778 0 5.498 5.498 0 010-7.777l2.828-2.83a1.5 1.5 0 01.355-.262 6.52 6.52 0 00.351 3.799l-1.413 1.414a2.499 2.499 0 000 3.535 2.499 2.499 0 003.535 0l2.83-2.828a2.5 2.5 0 000-3.536 1.5 1.5 0 010-2.121z"/><path d="M12.111 3.89a5.5 5.5 0 117.778 7.777l-2.828 2.829a1.496 1.496 0 01-.355.262 6.522 6.522 0 00-.351-3.8l1.413-1.412a2.5 2.5 0 10-3.536-3.535l-2.828 2.828a2.5 2.5 0 000 3.536 1.5 1.5 0 01-2.122 2.12 5.5 5.5 0 010-7.777l2.83-2.829z"/></svg>\n </button>\n\n <lexxy-link-dialog class="lexxy-link-dialog">\n <dialog id="link-dialog" closedby="any">\n <form method="dialog">\n <input type="url" placeholder="Enter a URL…" class="input" required>\n <div class="lexxy-dialog-actions">\n <button type="submit" class="btn" value="link">Link</button>\n <button type="button" class="btn" value="unlink">Unlink</button>\n </div>\n </form>\n </dialog>\n </lexxy-link-dialog>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.5 5C8.985 5 11 7.09 11 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.022.746a.563.563 0 01-.52-.36.602.602 0 01.067-.57l.055-.066.009-.009.041-.048a4.25 4.25 0 00.168-.21c.143-.188.336-.47.53-.84a6.743 6.743 0 00.75-2.605C3.705 13.994 2 12.038 2 9.667 2 7.089 4.015 5 6.5 5zM17.5 5C19.985 5 22 7.09 22 9.667c0 2.694-.962 5.005-2.187 6.644-.613.82-1.3 1.481-1.978 1.943-.668.454-1.375.746-2.023.746a.563.563 0 01-.52-.36.602.602 0 01.068-.57l.055-.066.009-.009.041-.048c.039-.045.097-.115.168-.21a6.16 6.16 0 00.53-.84 6.745 6.745 0 00.75-2.605C14.705 13.994 13 12.038 13 9.667 13 7.089 15.015 5 17.5 5z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="heading" data-command="rotateHeadingFormat" title="Heading">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M15.322 5.315H9.64V22H5.684V5.315H0v-3.31h15.322v3.31z"/><path d="M23.957 11.79H19.92V22h-3.402V11.79H12.48V9.137h11.477v2.653z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="code" data-command="insertCodeBlock" title="Code">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10.121 6l-6 6 6 6-2.12 2.121-7.061-7.06a1.5 1.5 0 010-2.121L8 3.879 10.121 6zM23.06 10.94a1.5 1.5 0 010 2.12L16 20.121 13.88 18l6-6-6-6L16 3.879l7.06 7.06z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 5a2 2 0 11-4 0 2 2 0 014 0zM5 12a2 2 0 11-4 0 2 2 0 014 0zM5 19a2 2 0 11-4 0 2 2 0 014 0zM7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 5.25C7 4.56 7.56 4 8.25 4h13.5a1.25 1.25 0 110 2.5H8.25C7.56 6.5 7 5.94 7 5.25zM7 12.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM7 19.25c0-.69.56-1.25 1.25-1.25h13.5a1.25 1.25 0 110 2.5H8.25c-.69 0-1.25-.56-1.25-1.25zM4.438 8H3.39V3.684H3.34c-.133.093-.267.188-.402.285l-.407.289a129.5 129.5 0 00-.402.285v-.969l.633-.453c.21-.15.42-.302.629-.453h1.046V8zM2.672 11.258h-1v-.051c0-.206.036-.405.11-.598.075-.195.188-.37.34-.527.15-.156.339-.281.566-.375.229-.094.498-.14.808-.14.367 0 .688.065.961.195s.484.308.633.535c.15.224.226.478.226.762 0 .244-.046.463-.14.656-.091.19-.209.368-.352.535-.14.164-.289.332-.445.504L3.168 14.09v.05h2.238V15H1.723v-.656l1.949-2.102c.096-.101.19-.207.281-.316.091-.112.167-.232.227-.36a.953.953 0 00.09-.41.712.712 0 00-.387-.648.845.845 0 00-.41-.098.81.81 0 00-.43.11.75.75 0 00-.277.293.824.824 0 00-.094.386V11.258zM2.852 19.66v-.812h.562a.917.917 0 00.43-.098.742.742 0 00.293-.266.673.673 0 00.101-.379.654.654 0 00-.234-.523.87.87 0 00-.59-.2.987.987 0 00-.336.055.837.837 0 00-.258.149.712.712 0 00-.172.215.66.66 0 00-.066.25h-.98c.007-.209.053-.403.136-.582.084-.18.203-.336.36-.469.156-.135.346-.24.57-.316.227-.076.486-.115.777-.118a2.33 2.33 0 01.965.176c.271.12.48.285.63.496.15.209.227.448.23.719a1.11 1.11 0 01-.16.637 1.28 1.28 0 01-.825.586v.054c.162.016.33.07.504.164.177.094.328.232.453.415.125.18.189.411.192.695a1.37 1.37 0 01-.157.676c-.104.197-.25.365-.437.503-.188.136-.404.24-.649.313-.242.07-.5.105-.777.105-.401 0-.743-.067-1.027-.203a1.608 1.608 0 01-.649-.547 1.46 1.46 0 01-.238-.75h.969c.01.128.057.243.14.344a.885.885 0 00.332.238c.141.058.3.088.477.09.195 0 .366-.034.512-.101a.798.798 0 00.336-.29.744.744 0 00.117-.425.74.74 0 00-.446-.695 1.082 1.082 0 00-.496-.106h-.59z"/></svg>\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="upload" data-command="uploadAttachments" title="Upload file">\n <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M16 8a2 2 0 110 4 2 2 0 010-4z""/><path d="M22 2a1 1 0 011 1v18a1 1 0 01-1 1H2a1 1 0 01-1-1V3a1 1 0 011-1h20zM3 18.714L9 11l5.25 6.75L17 15l4 4V4H3v14.714z"/></svg>\n </button>\n\n <details class="lexxy-editor__toolbar-overflow">\n <summary class="lexxy-editor__toolbar-button" aria-label="Show more toolbar buttons">•••</summary>\n <div class="lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons"></div>\n </details>\n '}}function Xc(e,t){const n={};for(const r of e){const e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}customElements.define("lexxy-toolbar",Yc);const Qc=/[!-/:-@[-`{-~\s]/;function eu(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function tu(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(nu(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function nu(e,t,n,r,i){for(let s=0;s<i;s++)if(e[t+s]!==n[r+s])return!1;return!0}function ru(e,t=gu){const n=function(e){const t=Xc(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}(t),r=Xc(n.textFormat,(({tag:e})=>e[e.length-1])),i=Xc(n.textMatch,(({trigger:e})=>e));for(const n of t){const t=n.type;if("element"===t||"text-match"===t||"multiline-element"===t){const t=n.dependencies;for(const n of t)e.hasNode(n)||eu(173,n.getType())}}const s=(e,t,s)=>{(function(e,t,n,r){if(!ho(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExp:s,replace:o}of r){const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,!1))return s.remove(),!0}}return!1})(e,t,s,n.element)||function(e,t,n,r){if(!ho(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExpStart:s,replace:o,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;const r=i.match(s);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[s,a]=t.splitText(n);if(!1!==o(e,a?[a,...i]:i,r,null,null,!1))return s.remove(),!0}}return!1}(e,t,s,n.multilineElement)||function(e,t,n){let r=e.getTextContent();const i=n[r[t-1]];if(null==i)return!1;t<r.length&&(r=r.slice(0,t));for(const t of i){if(!t.replace||!t.regExp)continue;const n=r.match(t.regExp);if(null===n)continue;const i=n.index||0,s=i+n[0].length;let o;return 0===i?[o]=e.splitText(s):[,o]=e.splitText(i,s),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,s,i)||function(e,t,n){const r=e.getTextContent(),i=t-1,s=r[i],o=n[s];if(!o)return!1;for(const t of o){const{tag:n}=t,o=n.length,a=i-o+1;if(o>1&&!nu(r,a,n,0,o))continue;if(" "===r[a-1])continue;const l=r[i+1];if(!1===t.intraword&&l&&!Qc.test(l))continue;const c=e;let u=c,d=tu(r,a,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!gr(h);)if(Pr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=tu(e,e.length,n)}if(d<0)continue;if(u===c&&d+o===a)continue;const g=u.getTextContent();if(d>0&&g[d-1]===s)continue;const p=g[d-1];if(!1===t.intraword&&p&&!Qc.test(p))continue;const f=c.getTextContent(),m=f.slice(0,a)+f.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+o));const _=ii(),b=ti();Ms(b);const x=i-o*(u===c?2:1)+1;b.anchor.set(u.__key,d,"text"),b.focus.set(c.__key,x,"text");for(const e of t.format)b.hasFormat(e)||b.formatText(e);b.anchor.set(b.focus.key,b.focus.offset,b.focus.type);for(const e of t.format)b.hasFormat(e)&&b.toggleFormat(e);return Ur(_)&&(b.format=_.format),!0}}(t,s,r)};return e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Qi)||t.has(Yi))return;if(e.isComposing())return;const o=r.read(ii),a=i.read(ii);if(!Ur(a)||!Ur(o)||!o.isCollapsed()||o.is(a))return;const l=o.anchor.key,c=o.anchor.offset,u=r._nodeMap.get(l);!Pr(u)||!n.has(l)||1!==c&&c>a.anchor.offset+1||e.update((()=>{if(!function(e){return Pr(e)&&!e.hasFormat("code")}(u))return;const e=u.getParent();null===e||lc(e)||s(e,u,o.anchor.offset)}))}))}const iu=e=>(t,n,r,i)=>{const s=e(r);s.append(...n),t.replace(s),i||s.select(0,0)},su=e=>(t,n,r,i)=>{const s=t.getPreviousSibling(),o=t.getNextSibling(),a=il("check"===e?"x"===r[3]:void 0);if(hl(o)&&o.getListType()===e){const e=o.getFirstChild();null!==e?e.insertBefore(a):o.append(a),t.remove()}else if(hl(s)&&s.getListType()===e)s.append(a),t.remove();else{const n=dl(e,"number"===e?Number(r[2]):void 0);n.append(a),t.replace(n)}a.append(...n),i||a.select(0,0);const l=function(e){const t=e.match(/\t/g),n=e.match(/ /g);let r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]);l&&a.setIndent(l)},ou=(e,t,n)=>{const r=[],i=e.getChildren();let s=0;for(const o of i)if(sl(o)){if(1===o.getChildrenSize()){const e=o.getFirstChild();if(hl(e)){r.push(ou(e,t,n+1));continue}}const i=" ".repeat(4*n),a=e.getListType(),l="number"===a?`${e.getStart()+s}. `:"check"===a?`- [${o.getChecked()?"x":" "}] `:"- ";r.push(i+l+t(o)),s++}return r.join("\n")},au={dependencies:[Wl],export:(e,t)=>{if(!Jl(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:/^(#{1,6})\s/,replace:iu((e=>ql("h"+e[1].length))),type:"element"},lu={dependencies:[Bl],export:(e,t)=>{if(!Ul(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:/^>\s/,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Ul(n))return n.splice(n.getChildrenSize(),0,[hr(),...t]),void e.remove()}const i=$l();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"},cu={dependencies:[oc],export:e=>{if(!lc(e))return null;const t=e.getTextContent();return"```"+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n```"},regExpEnd:{optional:!0,regExp:/[ \t]*```$/},regExpStart:/^[ \t]*```(\w+)?/,replace:(e,t,n,r,i,s)=>{let o,a;if(!t&&i){if(1===i.length)r?(o=ac(),a=n[1]+i[0]):(o=ac(n[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=ac(n[1]),0===i[0].trim().length)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join("\n")}const t=Lr(a);o.append(t),e.append(o)}else t&&iu((e=>ac(e?e[1]:void 0)))(e,t,n,s)},type:"multiline-element"},uu={dependencies:[ol,tl],export:(e,t)=>hl(e)?ou(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:su("bullet"),type:"element"},du={dependencies:[ol,tl],export:(e,t)=>hl(e)?ou(e,t,0):null,regExp:/^(\s*)(\d{1,})\.\s/,replace:su("number"),type:"element"},hu={dependencies:[Dc],export:(e,t,n)=>{if(!$c(e)||Kc(e))return null;const r=e.getTitle(),i=t(e);return r?`[${i}](${e.getURL()} "${r}")`:`[${i}](${e.getURL()})`},importRegExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{const[,n,r,i]=t,s=Bc(r,{title:i}),o=Lr(n);return o.setFormat(e.getFormat()),s.append(o),e.replace(s),o},trigger:")",type:"text-match"},gu=[...[au,lu,uu,du],...[cu],...[{format:["code"],tag:"`",type:"text-format"},{format:["bold","italic"],tag:"***",type:"text-format"},{format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},{format:["bold"],tag:"**",type:"text-format"},{format:["bold"],intraword:!1,tag:"__",type:"text-format"},{format:["highlight"],tag:"==",type:"text-format"},{format:["italic"],tag:"*",type:"text-format"},{format:["italic"],intraword:!1,tag:"_",type:"text-format"},{format:["strikethrough"],tag:"~~",type:"text-format"}],...[hu]];function pu(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const s=t._selection,o=e._selection;if(i)return 1;if(!(Ur(s)&&Ur(o)&&o.isCollapsed()&&s.isCollapsed()))return 0;const a=function(e,t,n){const r=e._nodeMap,i=[];for(const e of t){const t=r.get(e);void 0!==t&&i.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||qi(n)||i.push(n)}return i}(t,n,r);if(0===a.length)return 0;if(a.length>1){const n=t._nodeMap,r=n.get(s.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Pr(r)&&1===r.__text.length&&1===s.anchor.offset?2:0}const l=a[0],c=e._nodeMap.get(l.__key);if(!Pr(c)||!Pr(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=s.anchor,g=o.anchor;if(h.key!==g.key||"text"!==h.type)return 0;const p=h.offset,f=g.offset,m=d.length-u.length;return 1===m&&f===p-1?2:-1===m&&f===p+1?3:-1===m&&f===p?4:0}function fu(e,t){let n=Date.now(),r=0;return(i,s,o,a,l,c)=>{const u=Date.now();if(c.has(Yi))return r=0,n=u,2;const d=pu(i,s,a,l,e.isComposing()),h=(()=>{const h=null===o||o.editor===e,g=c.has("history-push");if(!g&&h&&c.has(Xi))return 0;if(null===i)return 1;const p=s._selection;return a.size>0||l.size>0?!1===g&&0!==d&&d===r&&u<n+t&&h||1===a.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),s=t._selection,o=n._selection;return!(Ur(s)&&Ur(o)&&"element"===s.anchor.type&&"element"===s.focus.type&&"text"===o.anchor.type&&"text"===o.focus.type||!Pr(r)||!Pr(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(a)[0],i,s)?0:1:null!==p?0:2})();return n=u,r=d,h}}function mu(e){e.undoStack=[],e.redoStack=[],e.current=null}var yu={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",underline:"lexxy-content__underline"},codeHighlight:{atrule:"code-token__attr",attr:"code-token__attr","attr-name":"code-token__attr","attr-value":"code-token__selector",boolean:"code-token__property",bold:"code-token__variable",builtin:"code-token__selector",cdata:"code-token__comment",char:"code-token__selector",class:"code-token__function","class-name":"code-token__function",color:"code-token__property",comment:"code-token__comment",constant:"code-token__property",coord:"code-token__property",decorator:"code-token__function",deleted:"code-token__property",doctype:"code-token__comment",entity:"code-token__operator",function:"code-token__function",hexcode:"code-token__property",important:"code-token__variable",inserted:"code-token__selector",italic:"code-token__comment",keyword:"code-token__attr",namespace:"code-token__variable",number:"code-token__property",operator:"code-token__operator",parameter:"code-token__variable",prolog:"code-token__comment",property:"code-token__property",punctuation:"code-token__punctuation",regex:"code-token__variable",script:"code-token__function",selector:"code-token__selector",string:"code-token__selector",style:"code-token__function",symbol:"code-token__property",tag:"code-token__property",title:"code-token__function",url:"code-token__operator",variable:"code-token__variable"}};function _u(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(2)} ${["B","KB","MB","GB","TB","PB"][t]}`}const bu=["img","video","audio","iframe","embed","object","picture","source","canvas","svg","math","form","input","textarea","select","button","code","blockquote"].join(","),xu=["a","action-text-attachment","b","blockquote","br","code","em","figcaption","figure","h1","h2","h3","h4","h5","h6","i","img","li","ol","p","pre","q","strong","ul"],ku=["alt","caption","class","content","content-type","contenteditable","data-direct-upload-id","data-sgid","filename","filesize","height","href","presentation","previewable","sgid","src","title","url","width"];function Su(e,t){const n=document.createElement(e);for(const[e,r]of Object.entries(t||{}))e in n?n[e]=r:null!=r&&n.setAttribute(e,r);return n}function vu(e){return(new DOMParser).parseFromString(e,"text/html")}function wu(e,t,n){const r=new CustomEvent(t,{detail:n,bubbles:!0});e.dispatchEvent(r)}function Tu(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function Cu(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}class Eu extends Ki{static getType(){return"action_text_attachment"}static clone(e){return new Eu({...e},e.__key)}static importJSON(e){return new Eu({...e})}static importDOM(){return{"action-text-attachment":e=>({conversion:()=>({node:new Eu({sgid:e.getAttribute("sgid"),src:e.getAttribute("url"),previewable:e.getAttribute("previewable"),altText:e.getAttribute("alt"),caption:e.getAttribute("caption"),contentType:e.getAttribute("content-type"),fileName:e.getAttribute("filename"),fileSize:e.getAttribute("filesize"),width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1}),img:e=>({conversion:()=>({node:new Eu({src:e.getAttribute("src"),contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}),priority:1})}}constructor({sgid:e,src:t,previewable:n,altText:r,caption:i,contentType:s,fileName:o,fileSize:a,width:l,height:c},u){super(u),this.sgid=e,this.src=t,this.previewable=n,this.altText=r||"",this.caption=i||"",this.contentType=s||"",this.fileName=o,this.fileSize=a,this.width=l,this.height=c}createDOM(){const e=this.createAttachmentFigure();return e.addEventListener("click",(t=>{this.#k(e)})),this.isPreviewableAttachment?(e.appendChild(this.#S()),e.appendChild(this.#v())):(e.appendChild(this.#w()),e.appendChild(this.#T())),e}updateDOM(){return!0}isInline(){return!1}exportDOM(){return{element:Su("action-text-attachment",{sgid:this.sgid,previewable:this.previewable||null,url:this.src,alt:this.altText,caption:this.caption,"content-type":this.contentType,filename:this.fileName,filesize:this.fileSize,width:this.width,height:this.height,presentation:"gallery"})}}exportJSON(){return{type:"action_text_attachment",version:1,sgid:this.sgid,src:this.src,previewable:this.previewable,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createAttachmentFigure(){return e=this.contentType,t=this.isPreviewableAttachment,n=this.fileName,Su("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e});var e,t,n}get#C(){return(e=this.contentType).startsWith("image/")&&!e.includes("svg");var e}get isPreviewableAttachment(){return this.#C||this.previewable}#S(){return Su("img",{src:this.src,alt:this.altText,...this.#E})}get#E(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#w(){return Su("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#T(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("strong",{className:"attachment__name",textContent:this.caption||this.fileName}),n=Su("span",{className:"attachment__size",textContent:_u(this.fileSize)});return e.appendChild(t),e.appendChild(n),e}#k(e){wu(e,"lexxy:internal:select-node",{key:this.getKey()})}#v(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("input",{type:"text",class:"input",value:this.caption,placeholder:this.fileName});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",this.#N.bind(this)),t.addEventListener("keydown",this.#A.bind(this)),e.appendChild(t),e}#L(e){}#N(e){const t=e.target;t.placeholder=this.fileName,this.#P(t)}#P(e){wu(e,"lexxy:internal:invalidate-node",{key:this.getKey(),values:{caption:e.value}})}#A(e){"Enter"===e.key&&(this.#P(e.target),wu(e.target,"lexxy:internal:move-to-next-line"),e.preventDefault()),e.stopPropagation()}}class Nu extends Eu{static getType(){return"action_text_attachment_upload"}static clone(e){return new Nu({...e},e.__key)}constructor({file:e,uploadUrl:t,blobUrlTemplate:n,editor:r,progress:i},s){super({contentType:e.type},s),this.file=e,this.uploadUrl=t,this.blobUrlTemplate=n,this.src=null,this.editor=r,this.progress=i||0}createDOM(){const e=this.createAttachmentFigure();this.isPreviewableAttachment?e.appendChild(this.#S()):e.appendChild(this.#w()),e.appendChild(this.#F());const t=Su("progress",{value:this.progress,max:100});return e.appendChild(t),this.#O(e).then((()=>this.#I(t,e))),e}exportDOM(){const e=document.createElement("img");return this.src&&(e.src=this.src),{element:e}}#S(){return Su("img")}#w(){return Su("span",{className:"attachment__icon",textContent:this.#R()})}#R(){return this.file.name.split(".").pop().toLowerCase()}#F(){const e=Su("figcaption",{className:"attachment__caption"}),t=Su("span",{className:"attachment__name",textContent:this.file.name||""}),n=Su("span",{className:"attachment__size",textContent:_u(this.file.size)});return e.appendChild(t),e.appendChild(n),e}#O(e){const t=e.querySelector("img");return t?async function(e,t){return new Promise((n=>{const r=new FileReader;t.addEventListener("load",(()=>{n(t)})),r.onload=e=>{t.src=e.target.result||null},r.readAsDataURL(e)}))}(this.file,t):Promise.resolve()}#I(t,n){const r=new e(this.file,this.uploadUrl,this);r.delegate={directUploadWillStoreFileWithXHR:e=>{e.upload.addEventListener("progress",(e=>{this.editor.update((()=>{t.value=Math.round(e.loaded/e.total*100)}))}))}},r.create(((e,t)=>{e?this.#M(n):this.#D(t,n).then((()=>{this.#z(n,t)}))}))}#M(e){e.innerHTML="",e.classList.add("attachment--error"),e.appendChild(Su("div",{innerText:`Error uploading ${this.file?.name??"image"}`}))}async#z(e,t){this.editor.update((()=>{const n=e.querySelector("img"),r=this.blobUrlTemplate.replace(":signed_id",t.signed_id).replace(":filename",encodeURIComponent(t.filename)),i=Ns(this.getKey());i&&i.replace(new Eu({sgid:t.attachable_sgid,src:t.previewable?t.url:r,altText:t.filename,contentType:t.content_type,fileName:t.filename,fileSize:t.byte_size,width:n?.naturalWidth,previewable:t.previewable,height:n?.naturalHeight}))}),{tag:Xi})}async#D(e,t){return e.previewable?new Promise((n=>{this.editor.update((()=>{const r=this.#S();r.addEventListener("load",(()=>{n()})),r.src=e.url,t.insertBefore(r,t.firstChild)}))})):Promise.resolve()}}const Au=["bold","rotateHeadingFormat","italic","link","unlink","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","uploadAttachments"];class Lu{static configureFor(e){new Lu(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.clipboard=e.clipboard,this.#B(),this.#$()}dispatchPaste(e){return this.clipboard.paste(e)}dispatchBold(){this.editor.dispatchCommand(Qt,"bold")}dispatchItalic(){this.editor.dispatchCommand(Qt,"italic")}dispatchLink(e){this.#U(e)}dispatchUnlink(){this.#U(null)}dispatchInsertUnorderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"bullet"===Zc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(gl,void 0)}dispatchInsertOrderedList(){const e=ii().anchor.getNode();this.selection.isInsideList&&e&&"number"===Zc(e)?this.contents.unwrapSelectedListItems():this.editor.dispatchCommand(pl,void 0)}dispatchInsertQuoteBlock(){this.contents.toggleNodeWrappingAllSelectedLines((e=>Ul(e)),(()=>$l()))}dispatchInsertCodeBlock(){this.editor.update((()=>{this.selection.hasSelectedWordsInSingleLine?this.editor.dispatchCommand(Qt,"code"):this.contents.toggleNodeWrappingAllSelectedLines((e=>lc(e)),(()=>new oc("plain")))}))}dispatchRotateHeadingFormat(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow();let n="h2";if(Jl(t)){const e=t.getTag();n="h2"===e?"h3":"h3"===e?"h4":"h4"===e?null:"h2"}n?this.contents.insertNodeWrappingEachSelectedLine((()=>ql(n))):this.contents.removeFormattingFromSelectedLines()}))}dispatchUploadAttachments(){const e=Su("input",{type:"file",multiple:!0,onchange:({target:e})=>{const t=Array.from(e.files);if(t.length)for(const e of t)this.contents.uploadFile(e)}});document.body.appendChild(e),e.click(),setTimeout((()=>e.remove()),1e3)}#B(){for(const t of Au){const n=`dispatch${e=t,e.charAt(0).toUpperCase()+e.slice(1)}`;this.#W(t,0,this[n].bind(this))}var e;this.#W(Vt,1,this.dispatchPaste.bind(this))}#W(e,t,n){this.editor.registerCommand(e,n,t)}#U(e){this.editor.update((()=>{jc(null===e?null:e)}))}#$(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.editor.getRootElement().addEventListener("dragover",this.#K.bind(this)),this.editor.getRootElement().addEventListener("drop",this.#H.bind(this)),this.editor.getRootElement().addEventListener("dragenter",this.#j.bind(this)),this.editor.getRootElement().addEventListener("dragleave",this.#q.bind(this)))}#j(e){this.dragCounter++,1===this.dragCounter&&this.editor.getRootElement().classList.add("lexxy-editor--drag-over")}#q(e){this.dragCounter--,0===this.dragCounter&&this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")}#K(e){e.preventDefault()}#H(e){e.preventDefault(),this.dragCounter=0,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over");const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);if(n.length){for(const e of n)this.contents.uploadFile(e);this.editor.focus()}}}function Pu(){return new Promise(requestAnimationFrame)}class Fu{constructor(e){this.editorElement=e,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#J(),this.#G()}clear(){this.current=null}set current(e){Kr(e)?(this._current=ii(),this.#V()):this.editor.update((()=>{this.#V(),this._current=null}))}get current(){return this._current}get cursorPosition(){let e={x:0,y:0};return this.editor.getEditorState().read((()=>{const t=this.#Z();if(!t)return;const n=this.#Y(t);n&&(e=this.#X(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{Is().selectEnd()}))}get hasSelectedWordsInSingleLine(){const e=ii();if(!Ur(e))return!1;if(e.isCollapsed())return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.getTopLevelElement()!==n.getTopLevelElement())return!1;if(!t.getTopLevelElement())return!1;const r=e.getNodes();for(const e of r)if(gr(e))return!1;return!0}get isInsideList(){const e=ii();if(!Ur(e))return!1;return null!==Vc(e.anchor.getNode())}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Pr(e)?this.#ee(e,t):Ui(e)?this.#te(e,t):this.#ne(e):null}get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#Q();return e?Pr(e)?this.#re(e,t):Ui(e)?this.#ie(e,t):this.#se(e):null}get#oe(){return this.editorElement.contents}get#ae(){if(this._currentlySelectedKeys)return this._currentlySelectedKeys;if(this._currentlySelectedKeys=new Set,this.current)for(const e of this.current.getNodes())this._currentlySelectedKeys.add(e.getKey());return this._currentlySelectedKeys}#G(){this.editor.registerCommand(on,this.#le.bind(this),1),this.editor.registerCommand(ln,this.#le.bind(this),1),this.editor.registerCommand(rn,this.#ce.bind(this),1),this.editor.registerCommand(cn,this.#ce.bind(this),1),this.editor.registerCommand(pn,this.#ue.bind(this),1),this.editor.registerCommand(hn,this.#de.bind(this),1),this.editor.registerCommand(Wt,(()=>{this.current=ii()}),1)}#J(){this.editor.getRootElement().addEventListener("lexxy:internal:select-node",(async e=>{await Pu();const{key:t}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e){const t=ni();t.add(e.getKey()),Ms(t)}this.editor.focus()}))})),this.editor.getRootElement().addEventListener("lexxy:internal:move-to-next-line",(e=>{this.#he()}))}#V(){this.#ge(),this.#pe(),this.previouslySelectedKeys=this.#ae,this._currentlySelectedKeys=null}#ge(){for(const e of this.previouslySelectedKeys)if(!this.#ae.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#pe(){for(const e of this.#ae)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}async#le(){this.current?await this.#fe((e=>e.selectPrevious())):this.#me(this.nodeBeforeCursor)}async#ce(){this.current?await this.#fe((e=>e.selectNext(0,0))):this.#me(this.nodeAfterCursor)}async#fe(e){await Pu(),this.current&&this.editor.update((()=>{this.clear(),e(this.current.getNodes()[0]),this.editor.focus()}))}async#he(){this.editor.update((()=>{const e=this.#ye();e&&this.#_e(e)}))}#ye(){const e=ii();return e?Kr(e)?this.#be(e):Ur(e)?this.#xe(e):null:null}#be(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#xe(e){return e.anchor.getNode().getTopLevelElement()}#_e(e){const t=e.getNextSibling();t?t.selectStart():this.#ke()}#ke(){const e=Is(),t=ss();e.append(t),t.selectStart()}#me(e){e&&e instanceof Ki&&this.editor.update((()=>{const t=ni();t.add(e.getKey()),Ms(t)}))}#ue(){const e=this.nodeAfterCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#de(){const e=this.nodeBeforeCursor;return e instanceof Ki?this.#me(e):this.#oe.deleteSelectedNodes(),!0}#Z(){const e=ii();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#Y(e){let t=e.getBoundingClientRect();if(this.#Se(t)){const n=this.#ve(e);t=n.getBoundingClientRect(),this.#we(n),n.remove()}return t}#Se(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#ve(e){const t=this.#Te();return e.insertNode(t),t}#Te(){const e=document.createElement("span");return e.textContent="",e.style.display="inline-block",e.style.width="1px",e.style.height="1em",e.style.lineHeight="normal",e.setAttribute("nonce",Sa()),e}#we(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#X(e,t){const n=this.editor.getRootElement().getBoundingClientRect();let r=e.left-n.left,i=e.top-n.top;const s=this.#Ce(t);return isNaN(s)||(i+=s),{x:r,y:i,fontSize:s}}#Ce(e){const t=window.getSelection().anchorNode,n=this.#Ee(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#Ee(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#Q(){const e=ii();if(!Ur(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#ee(e,t){return t===e.getTextContentSize()?this.#Ne(e):null}#Ne(e){if(e.getNextSibling()instanceof Ki)return e.getNextSibling();const t=e.getParent();return t?t.getNextSibling():null}#te(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#ne(e)}#re(e,t){return 0===t?this.#Ae(e):null}#Ae(e){if(e.getPreviousSibling()instanceof Ki)return e.getPreviousSibling();return e.getParent().getPreviousSibling()}#ie(e,t){return t>0?e.getChildAtIndex(t-1):this.#se(e)}#ne(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#se(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}}class Ou extends Ki{static getType(){return"custom_action_text_attachment"}static clone(e){return new Ou({...e},e.__key)}static importJSON(e){return new Ou({...e})}static importDOM(){return{"action-text-attachment":e=>{const t=e.getAttribute("content");return e.getAttribute("content")?{conversion:()=>{const n=[],r=e.previousSibling;return r&&r.nodeType===Node.TEXT_NODE&&/\s$/.test(r.textContent)&&n.push(Lr(" ")),n.push(new Ou({sgid:e.getAttribute("sgid"),innerHtml:JSON.parse(t),contentType:e.getAttribute("content-type")})),n.push(Lr(" ")),{node:n}},priority:2}:null}}}constructor({sgid:e,contentType:t,innerHtml:n},r){super(r),this.sgid=e,this.contentType=t||"application/vnd.actiontext.unknown",this.innerHtml=n}createDOM(){const e=Su("action-text-attachment",{"content-type":this.contentType,"data-lexxy-decorator":!0});return e.addEventListener("click",(t=>{wu(e,"lexxy:internal:select-node",{key:this.getKey()})})),e.insertAdjacentHTML("beforeend",this.innerHtml),e}updateDOM(){return!0}isInline(){return!0}exportDOM(){return{element:Su("action-text-attachment",{sgid:this.sgid,content:JSON.stringify(this.innerHtml),"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml}}decorate(){return null}}class Iu{constructor(e){this.editorElement=e,this.editor=e.editor}insertHtml(e){this.editor.update((()=>{const t=ii();if(!Ur(t))return;const n=yl(this.editor,vu(e));t.insertNodes(n)}))}insertNodeWrappingEachSelectedLine(e){this.editor.update((()=>{const t=ii();if(!Ur(t))return;t.extract().forEach((t=>{if(!t.getParent())return;const n=t.getTopLevelElementOrThrow(),r=e();r.append(...n.getChildren()),n.replace(r)}))}))}toggleNodeWrappingAllSelectedLines(e,t){this.editor.update((()=>{const n=ii();if(!Ur(n))return;const r=n.anchor.getNode().getTopLevelElementOrThrow();e(r)?this.removeFormattingFromSelectedLines():this.insertNodeWrappingAllSelectedLines(t)}))}insertNodeWrappingAllSelectedLines(e){this.editor.update((()=>{const t=ii();Ur(t)&&(t.isCollapsed()?this.#Le(t,e):this.#Pe(t,e))}))}removeFormattingFromSelectedLines(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const t=e.anchor.getNode().getTopLevelElementOrThrow(),n=ss();n.append(...t.getChildren()),t.replace(n)}))}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=ii();e=Ur(t)&&!t.isCollapsed()})),e}hasSelectedWords(){let e=!1;return this.editor.update((()=>{const t=ii();Ur(t)&&(e=!t.isCollapsed()&&t.anchor.getNode().getTopLevelElement()===t.focus.getNode().getTopLevelElement())})),e}unwrapSelectedListItems(){this.editor.update((()=>{const e=ii();if(!Ur(e))return;const{listItems:t,parentLists:n}=this.#Fe(e);if(t.size>0){const e=this.#Oe(t);this.#Ie(n),this.#Re(e)}}))}createLink(e){let t=null;return this.editor.update((()=>{const n=Lr(e),r=Bc(e);r.append(n);const i=ii();Ur(i)&&(i.insertNodes([r]),t=r.getKey())})),t}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{jc(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Pr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o),l=a.lastIndexOf(e);-1!==l&&(t=a.slice(l+e.length))})),t}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read((()=>{const n=ii();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Pr(i))return;const s=i.getTextContent(),o=r.offset,a=s.slice(0,o);t=a.includes(e)})),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t],this.editor.update((()=>{const{anchorNode:n,offset:r}=this.#Me();if(!n)return;const i=this.#De(n,r,e);-1!==i&&this.#ze(n,r,i,t)}))}uploadFile(e){if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");if(!this.#Be(e))return;const t=this.editorElement.directUploadUrl,n=this.editorElement.blobUrlTemplate;this.editor.update((()=>{const r=ii(),i=r?.anchor.getNode(),s=i?.getTopLevelElement(),o=new Nu({file:e,uploadUrl:t,blobUrlTemplate:n,editor:this.editor});s&&os(s)&&0===s.getChildrenSize()?s.replace(o):s&&Ui(s)?s.insertAfter(o):di([o])}),{tag:Xi})}deleteSelectedNodes(){this.editor.update((()=>{if(Kr(this.#$e.current)){let e=!1;if(this.#$e.current.getNodes().forEach((t=>{const n=t.getParent();t.remove(),"root"===n.getType()&&0===n.getChildrenSize()&&n.append(ss()),e=!0})),e)return this.#$e.clear(),this.editor.focus(),!0}}))}replaceNodeWithHTML(e,t,n={}){this.editor.update((()=>{const r=Ns(e);if(!r)return;const i=ii();let s=!1;if(Ur(i)){const e=i.getNodes();s=e.includes(r)||e.some((e=>e.getParent()===r)),s&&Ms(null)}const o=n.attachment?this.#Ue(t,n.attachment):this.#We(t);r.replace(o),s&&o.selectEnd()}))}insertHTMLBelowNode(e,t,n={}){this.editor.update((()=>{const r=Ns(e);if(!r)return;let i=r;try{i=r.getTopLevelElementOrThrow()}catch{}const s=n.attachment?this.#Ue(t,n.attachment):this.#We(t);i.insertAfter(s)}))}get#$e(){return this.editorElement.selection}#Le(e,t){const n=e.anchor.getNode().getTopLevelElementOrThrow();if(n.getTextContent()){const e=t();e.append(...n.getChildren()),n.replace(e)}else di([t()])}#Pe(e,t){const n=this.#Ke(e);if(0===n.length)return;const{lineSet:r,nodesToDelete:i}=this.#He(n);if(0===r.size)return;const s=this.#je(t,r);this.#qe(e,s),this.#Je(i)}#Ke(e){const t=e.extract().map((e=>this.#Ge(e))).filter(Boolean);return Ms(null),t}#Ge(e){return os(e)?e:Pr(e)&&e.getParent()&&os(e.getParent())?e.getParent():null}#He(e){const t=new Set,n=new Set;return e.forEach((e=>{const r=e.getTextContent();r&&r.split("\n").forEach((e=>{e.trim()&&t.add(e)})),n.add(e)})),{lineSet:t,nodesToDelete:n}}#je(e,t){const n=e(),r=Array.from(t);return r.forEach(((e,t)=>{n.append(Lr(e)),t<r.length-1&&n.append(hr())})),n}#qe(e,t){const n=e.anchor.getNode().getParent();n&&n.replace(t)}#Je(e){e.forEach((e=>e.remove()))}#Fe(e){const t=e.getNodes(),n=new Set,r=new Set;for(const e of t){const t=Vc(e);if(t){n.add(t);const e=t.getParent();e&&hl(e)&&r.add(e)}}return{listItems:n,parentLists:r}}#Oe(e){const t=[];for(const n of e){const e=this.#Ve(n);e&&t.push(e)}return t}#Ve(e){const t=e.getParent();if(!t||!hl(t))return null;const n=ss(),r=this.#Ze(e,n);return e.insertAfter(n),this.#Ye(n,r),e.remove(),n}#Ze(e,t){const n=[];return e.getChildren().forEach((e=>{hl(e)?n.push(e):t.append(e)})),n}#Ye(e,t){t.forEach((t=>{e.insertAfter(t)}))}#Ie(e){for(const t of e)hl(t)&&0===t.getChildrenSize()&&t.remove()}#Re(e){if(0===e.length)return;const t=e[0],n=e[e.length-1];1===e.length?t.selectEnd():this.#Xe(t,n)}#Xe(e,t){e.selectStart();const n=ii();n&&Ur(n)&&(n.anchor.set(e.getKey(),0,"element"),n.focus.set(t.getKey(),t.getChildrenSize(),"element"))}#Me(){const e=ii();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Pr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#De(e,t,n){return e.getTextContent().slice(0,t).lastIndexOf(n)}#ze(e,t,n,r){const i=e.getTextContent(),s=i.slice(0,n),o=i.slice(t),a=Lr(s),l=Lr(o||" ");e.replace(a);this.#Qe(a,r).insertAfter(l),this.#et(l.getParentOrThrow()),l.select(0,0)}#Qe(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#et(e){if(os(e)&&!this.editorElement.isSingleLineMode){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Pr(n)&&""===n.getTextContent()&&r&&!Pr(r)&&e.append(hr())}}#Ue(e,t={}){return new Ou({sgid:("object"==typeof t?t:{}).sgid||null,contentType:"text/html",innerHtml:e})}#We(e){return yl(this.editor,vu(e))[0]||ss()}#Be(e){return Tu(this.editorElement,"lexxy:file-accept",{file:e},!0)}}function Ru(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Mu={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Du(e){Mu=e}var zu={exec:()=>null};function Bu(e,t=""){let n="string"==typeof e?e:e.source,r={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace($u.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var $u={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Uu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wu=/(?:[*+-]|\d{1,9}[.)])/,Ku=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hu=Bu(Ku).replace(/bull/g,Wu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ju=Bu(Ku).replace(/bull/g,Wu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ju=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Gu=Bu(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ju).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vu=Bu(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Wu).getRegex(),Zu="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",Yu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Xu=Bu("^ {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[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Yu).replace("tag",Zu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Qu=Bu(qu).replace("hr",Uu).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",Zu).getRegex(),ed={blockquote:Bu(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Qu).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Gu,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Uu,html:Xu,lheading:Hu,list:Vu,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Qu,table:zu,text:/^[^\n]+/},td=Bu("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Uu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\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",Zu).getRegex(),nd={...ed,lheading:ju,table:td,paragraph:Bu(qu).replace("hr",Uu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",td).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",Zu).getRegex()},rd={...ed,html:Bu("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Yu).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:zu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Bu(qu).replace("hr",Uu).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Hu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},id=/^( {2,}|\\)\n(?!\s*$)/,sd=/[\p{P}\p{S}]/u,od=/[\s\p{P}\p{S}]/u,ad=/[^\s\p{P}\p{S}]/u,ld=Bu(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,od).getRegex(),cd=/(?!~)[\p{P}\p{S}]/u,ud=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,dd=Bu(ud,"u").replace(/punct/g,sd).getRegex(),hd=Bu(ud,"u").replace(/punct/g,cd).getRegex(),gd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",pd=Bu(gd,"gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,od).replace(/punct/g,sd).getRegex(),fd=Bu(gd,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,cd).getRegex(),md=Bu("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ad).replace(/punctSpace/g,od).replace(/punct/g,sd).getRegex(),yd=Bu(/\\(punct)/,"gu").replace(/punct/g,sd).getRegex(),_d=Bu(/^<(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(),bd=Bu(Yu).replace("(?:--\x3e|$)","--\x3e").getRegex(),xd=Bu("^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",bd).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),kd=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,Sd=Bu(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",kd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),vd=Bu(/^!?\[(label)\]\[(ref)\]/).replace("label",kd).replace("ref",Ju).getRegex(),wd=Bu(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ju).getRegex(),Td={_backpedal:zu,anyPunctuation:yd,autolink:_d,blockSkip:/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,br:id,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:zu,emStrongLDelim:dd,emStrongRDelimAst:pd,emStrongRDelimUnd:md,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Sd,nolink:wd,punctuation:ld,reflink:vd,reflinkSearch:Bu("reflink|nolink(?!\\()","g").replace("reflink",vd).replace("nolink",wd).getRegex(),tag:xd,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:zu},Cd={...Td,link:Bu(/^!?\[(label)\]\((.*?)\)/).replace("label",kd).getRegex(),reflink:Bu(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",kd).getRegex()},Ed={...Td,emStrongRDelimAst:fd,emStrongLDelim:hd,url:Bu(/^((?: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\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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Nd={...Ed,br:Bu(id).replace("{2,}","*").getRegex(),text:Bu(Ed.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ad={normal:ed,gfm:nd,pedantic:rd},Ld={normal:Td,gfm:Ed,breaks:Nd,pedantic:Cd},Pd={"&":"&","<":"<",">":">",'"':""","'":"'"},Fd=e=>Pd[e];function Od(e,t){if(t){if($u.escapeTest.test(e))return e.replace($u.escapeReplace,Fd)}else if($u.escapeTestNoEncode.test(e))return e.replace($u.escapeReplaceNoEncode,Fd);return e}function Id(e){try{e=encodeURI(e).replace($u.percentDecode,"%")}catch{return null}return e}function Rd(e,t){let n=e.replace($u.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split($u.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace($u.slashPipe,"|");return r}function Md(e,t,n){let r=e.length;if(0===r)return"";let i=0;for(;i<r;){if(e.charAt(r-i-1)!==t)break;i++}return e.slice(0,r-i)}function Dd(e,t,n,r,i){let s=t.href,o=t.title||null,a=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var zd=class{options;rules;lexer;constructor(e){this.options=e||Mu}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Md(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(null===r)return t;let i=r[1];return t.split("\n").map((e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e})).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Md(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Md(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Md(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,s=!1,o=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))o.push(e[t]),s=!0;else{if(s)break;o.push(e[t])}e=e.slice(t);let a=o.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=c,0===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,s=t.raw+"\n"+e.join("\n"),o=this.blockquote(s);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if("list"!==u?.type);else{let t=u,s=t.raw+"\n"+e.join("\n"),o=this.list(s);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=s.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r="",a="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!l.trim(),d=0;if(this.options.pedantic?(d=2,a=l.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,a=l.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),s=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let h,g=e.split("\n",1)[0];if(c=g,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),i.test(c)||s.test(c)||o.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())a+="\n"+h.slice(d);else{if(u||l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(l)||s.test(l)||n.test(l))break;a+="\n"+c}!u&&!c.trim()&&(u=!0),r+=g+"\n",e=e.substring(g.length+1),l=h.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let h,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(a),g&&(h="[ ] "!==g[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!g,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}let a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>this.rules.other.anyLine.test(e.raw)));i.loose=n}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Rd(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<n.length;e++)s.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(Rd(e,s.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]}))));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Md(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Dd(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Dd(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){let n,i,s=[...r[0]].length-1,o=s,a=0,l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=l.exec(t));){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(i=[...n].length,r[3]||r[4]){o+=i;continue}if((r[5]||r[6])&&s%3&&!((s+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let t=[...r[0]][0].length,l=e.slice(0,s+r.index+t+i);if(Math.min(s,i)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Bd=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Mu,this.options.tokenizer=this.options.tokenizer||new zd,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:$u,block:Ad.normal,inline:Ld.normal};this.options.pedantic?(t.block=Ad.pedantic,t.inline=Ld.pedantic):this.options.gfm&&(t.block=Ad.gfm,this.options.breaks?t.inline=Ld.breaks:t.inline=Ld.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ad,inline:Ld}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace($u.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace($u.tabCharGlobal," ").replace($u.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t,n=1/0,r=e.slice(1);this.options.extensions.startBlock.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(i=e.substring(0,n+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let s=t.at(-1);n&&"paragraph"===s?.type?(s.raw+=(s.raw.endsWith("\n")?"":"\n")+r.raw,s.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let i=!1,s="";for(;e;){let r;if(i||(s=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0))))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,s)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t,n=1/0,r=e.slice(1);this.options.extensions.startInline.forEach((e=>{t=e.call({lexer:this},r),"number"==typeof t&&t>=0&&(n=Math.min(n,t))})),n<1/0&&n>=0&&(o=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(s=r.raw.slice(-1)),i=!0;let n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},$d=class{options;parser;constructor(e){this.options=e||Mu}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match($u.notSpaceStart)?.[0],i=e.replace($u.endingNewline,"")+"\n";return r?'<pre><code class="language-'+Od(r)+'">'+(n?i:Od(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:Od(i,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,r="";for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?"ol":"ul";return"<"+i+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(e){let t="";if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+Od(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n="";for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Od(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Id(e);if(null===i)return r;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+Od(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Id(e);if(null===i)return Od(n);let s=`<img src="${e=i}" alt="${n}"`;return t&&(s+=` title="${Od(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Od(e.text)}},Ud=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Wd=class e{options;renderer;textRenderer;constructor(e){this.options=e||Mu,this.options.renderer=this.options.renderer||new $d,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ud}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){n+=t||"";continue}}let s=i;switch(s.type){case"space":n+=this.renderer.space(s);continue;case"hr":n+=this.renderer.hr(s);continue;case"heading":n+=this.renderer.heading(s);continue;case"code":n+=this.renderer.code(s);continue;case"table":n+=this.renderer.table(s);continue;case"blockquote":n+=this.renderer.blockquote(s);continue;case"list":n+=this.renderer.list(s);continue;case"html":n+=this.renderer.html(s);continue;case"def":n+=this.renderer.def(s);continue;case"paragraph":n+=this.renderer.paragraph(s);continue;case"text":{let i=s,o=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],o+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):o;continue}default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=e||"";continue}}let s=i;switch(s.type){case"escape":case"text":n+=t.text(s);break;case"html":n+=t.html(s);break;case"link":n+=t.link(s);break;case"image":n+=t.image(s);break;case"strong":n+=t.strong(s);break;case"em":n+=t.em(s);break;case"codespan":n+=t.codespan(s);break;case"br":n+=t.br(s);break;case"del":n+=t.del(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Kd=class{options;block;constructor(e){this.options=e||Mu}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Bd.lex:Bd.lexInline}provideParser(){return this.block?Wd.parse:Wd.parseInline}},Hd=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(!0);parseInline=this.parseMarkdown(!1);Parser=Wd;Renderer=$d;TextRenderer=Ud;Lexer=Bd;Tokenizer=zd;Hooks=Kd;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach((r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){let t=this.defaults.renderer||new $d(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let r=n,i=e.renderer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new zd(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let r=n,i=e.tokenizer[r],s=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Kd;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let r=n,i=e.hooks[r],s=t[r];Kd.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Kd.passThroughHooksRespectAsync.has(n))return Promise.resolve(i.call(t,e)).then((e=>s.call(t,e)));let r=i.call(t,e);return s.call(t,r)}:t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=s.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Bd.lex(e,t??this.defaults)}parser(e,t){return Wd.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?Bd.lex:Bd.lexInline,a=i.hooks?i.hooks.provideParser():e?Wd.parse:Wd.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then((e=>o(e,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>a(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=a(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return s(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+Od(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function jd(e,t){return Hd.parse(e,t)}function qd(e){try{return new URL(e),!0}catch(e){return!1}}function Jd(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}jd.options=jd.setOptions=function(e){return Hd.setOptions(e),jd.defaults=Hd.defaults,Du(jd.defaults),jd},jd.getDefaults=Ru,jd.defaults=Mu,jd.use=function(...e){return Hd.use(...e),jd.defaults=Hd.defaults,Du(jd.defaults),jd},jd.walkTokens=function(e,t){return Hd.walkTokens(e,t)},jd.parseInline=Hd.parseInline,jd.Parser=Wd,jd.parser=Wd.parse,jd.Renderer=$d,jd.TextRenderer=Ud,jd.Lexer=Bd,jd.lexer=Bd.lex,jd.Tokenizer=zd,jd.Hooks=Kd,jd.parse=jd,jd.options,jd.setOptions,jd.use,jd.walkTokens,jd.parseInline,Wd.parse,Bd.lex;class Gd{constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents}paste(e){const t=e.clipboardData;return!!t&&(this.#tt(t)?(this.#nt(t),e.preventDefault(),!0):void this.#rt(t))}#tt(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#nt(e){e.items[0].getAsString((e=>{if(qd(e)&&this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(e);else if(qd(e)){const t=this.contents.createLink(e);this.#it(t,{url:e})}else this.#st(e)}))}#it(e,t){const n={replaceLinkWith:(t,n)=>this.contents.replaceNodeWithHTML(e,t,n),insertBelowLink:(t,n)=>this.contents.insertHTMLBelowNode(e,t,n)};Tu(this.editorElement,"lexxy:insert-link",{...t,...n})}#st(e){const t=jd(e);this.contents.insertHtml(t)}#rt(e){this.editorElement.supportsAttachments&&this.#ot((()=>{for(const t of e.items){const e=t.getAsFile();e&&this.contents.uploadFile(e)}}))}async#ot(e){const t=window.scrollY,n=window.scrollX;e(),await Pu(),window.scrollTo(n,t),this.editor.focus()}}class Vd extends HTMLElement{static formAssociated=!0;static debug=!0;static commands=["bold","italic",""];static observedAttributes=["connected"];#at="";constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}connectedCallback(){this.id??=Cu("lexxy-editor"),this.editor=this.#lt(),this.contents=new Iu(this),this.selection=new Fu(this),this.clipboard=new Gd(this),Lu.configureFor(this),this.#ct(),requestAnimationFrame((()=>Tu(this,"lexxy:initialize"))),this.toggleAttribute("connected",!0),this.valueBeforeDisconnect=null}disconnectedCallback(){this.valueBeforeDisconnect=this.value,this.#ut()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#dt()))}formResetCallback(){this.value=this.#at,this.editor.dispatchCommand(Nn,void 0)}get form(){return this.internals.form}get toolbarElement(){return this.#ht?(this.toolbar=this.toolbar||this.#gt(),this.toolbar):null}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get isSingleLineMode(){return this.hasAttribute("single-line")}get supportsAttachments(){return"false"!==this.getAttribute("attachments")}focus(){this.editor.focus()}get value(){return this.cachedValue||this.editor?.getEditorState().read((()=>{this.cachedValue=function(e){return se.sanitize(e,{ALLOWED_TAGS:xu,ALLOWED_ATTR:ku,SAFE_FOR_XML:!1})}(_l(this.editor,null))})),this.cachedValue}set value(e){this.editor.update((()=>{ao(ts);const t=Is();t.clear(),t.append(...this.#pt(e)),t.select(),this.#ft(),requestAnimationFrame((()=>this.editor?.update((()=>{}))))}))}#pt(e){e||(e="<p></p>");return yl(this.editor,vu(`<div>${e}</div>`)).map((e=>{if("paragraph"===e.getType()&&1===e.getChildrenSize()){const t=e.getFirstChild();if(t instanceof Ki&&!t.isInline())return t}return e}))}#ct(){this.#mt(),this.#yt(),this.#_t(),this.#bt(),this.#xt(),this.#kt(),this.#St(),this.#vt()}#lt(){this.editorContentElement=this.editorContentElement||this.#wt();const e=ls({namespace:"LexicalEditor",onError(e){throw e},theme:yu,nodes:this.#Tt});return e.setRootElement(this.editorContentElement),e}get#Tt(){const e=[Bl,Wl,ol,tl,oc,yc,Dc,Uc,Ou];return this.supportsAttachments&&e.push(Eu,Nu),e}#wt(){const e=Su("div",{classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#Ct,placeholder:this.getAttribute("placeholder")});return e.id=`${this.id}-content`,this.#Et.forEach((t=>e.setAttribute(t.name,t.value))),this.appendChild(e),this.getAttribute("tabindex")?(e.setAttribute("tabindex",this.getAttribute("tabindex")),this.removeAttribute("tabindex")):e.setAttribute("tabindex",0),e}get#Ct(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#Et(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}set#Nt(e){const t=void 0!==this.#Nt&&this.#Nt!==this.value;this.internals.setFormValue(e),this._internalFormValue=e,t&&Tu(this,"lexxy:change")}get#Nt(){return this._internalFormValue}#St(){const e=this.valueBeforeDisconnect||this.getAttribute("value")||"<p></p>";this.value=this.#at=e}#vt(){document.addEventListener("turbo:before-cache",this.#At)}#At=e=>{this.#ut()};#mt(){this.#Lt(this.editor.registerUpdateListener((({editorState:e})=>{this.cachedValue=null,this.#Nt=this.value,this.#ft(),this.#Pt()})))}#Lt(e){this.unregisterHandlers=this.unregisterHandlers||[],this.unregisterHandlers.push(e)}#Ft(){this.unregisterHandlers?.forEach((e=>{e()})),this.unregisterHandlers=null}#yt(){Xl(this.editor),function(e,t,n){const r=fu(e,n),i=Ia(e.registerCommand(en,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,s=r.pop();null!==i&&(n.push(i),e.dispatchCommand(An,!0)),0===r.length&&e.dispatchCommand(Ln,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Yi})}}(e,t),!0)),0),e.registerCommand(tn,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const i=t.current;null!==i&&(r.push(i),e.dispatchCommand(Ln,!0));const s=n.pop();0===n.length&&e.dispatchCommand(An,!1),t.current=s||null,s&&s.editor.setEditorState(s.editorState,{tag:Yi})}}(e,t),!0)),0),e.registerCommand(En,(()=>(mu(t),!1)),0),e.registerCommand(Nn,(()=>(mu(t),e.dispatchCommand(An,!1),e.dispatchCommand(Ln,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:i,dirtyLeaves:s,dirtyElements:o,tags:a})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(i,n,l,s,o,a);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(An,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(Ln,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}(this.editor,{current:null,redoStack:[],undoStack:[]},20),ml(this.editor),this.#Ot(),ru(this.editor,gu)}#Ot(){!function(e,t){if(!e.hasNodes([oc,yc]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=wc);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(oc,(t=>{e.update((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Ns(n);null!==t&&Cc(t,e)}}))}),{skipInitialization:!1})),n.push(e.registerNodeTransform(oc,(n=>Nc(n,e,t))),e.registerNodeTransform(kr,(n=>Tc(n,e,t))),e.registerNodeTransform(yc,(n=>Tc(n,e,t))),e.registerCommand(fn,(t=>{const n=function(e){const t=ii();if(!Ur(t)||!Pc(t))return null;const n=e?_n:yn,r=e?_n:mn,i=t.anchor,s=t.focus;if(i.is(s))return r;const o=Fc(t);if(1!==o.length)return n;const a=o[0];let l,c;0===a.length&&ec(285),t.isBackward()?(l=s,c=i):(l=i,c=s);const u=Sc(a[0]),d=vc(a[0]),h=Dr(u.getKey(),0,"text"),g=Dr(d.getKey(),d.getTextContentSize(),"text");return l.isBefore(h)||g.isBefore(c)?n:h.isBefore(l)||c.isBefore(g)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),1),e.registerCommand(mn,(()=>!!Pc(ii())&&(di([Ir()]),!0)),1),e.registerCommand(yn,(e=>Oc(yn)),1),e.registerCommand(_n,(e=>Oc(_n)),1),e.registerCommand(ln,(e=>{const t=ii();if(!Ur(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Pc(t)&&(t.isCollapsed()&&0===n.offset&&null===r.getPreviousSibling()&&lc(r.getParentOrThrow())?(e.preventDefault(),!0):Ic(ln,e))}),1),e.registerCommand(cn,(e=>{const t=ii();if(!Ur(t))return!1;const{anchor:n}=t,r=n.getNode();return!!Pc(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&null===r.getNextSibling()&&lc(r.getParentOrThrow())?(e.preventDefault(),!0):Ic(cn,e))}),1),e.registerCommand(an,(e=>Rc(an,e)),1),e.registerCommand(sn,(e=>Rc(sn,e)),1)),Ia(...n)}(this.editor),this.append(Su("lexxy-code-language-picker"))}#_t(){this.editor.getRootElement().addEventListener("lexxy:internal:invalidate-node",(e=>{const{key:t,values:n}=e.detail;this.editor.update((()=>{const e=Ns(t);if(e instanceof Eu){const t=e.getWritable();Object.assign(t,n)}}))}))}#bt(){this.editor.registerCommand(un,(e=>(e.ctrlKey||e.metaKey||!!this.isSingleLineMode)&&(e.preventDefault(),!0)),2)}#xt(){Vd.debug&&this.#Lt(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{console.debug("HTML: ",this.value)}))})))}#kt(){this.#ht&&this.toolbarElement.setEditor(this)}#gt(){const e=this.getAttribute("toolbar");return e?document.getElementById(e):this.#It()}get#ht(){return"false"!==this.getAttribute("toolbar")}#It(){const e=Su("lexxy-toolbar");return e.innerHTML=Yc.defaultTemplate,this.prepend(e),e}#ft(){this.classList.toggle("lexxy-editor--empty",this.#Rt)}get#Rt(){return!this.editorContentElement.textContent.trim()&&!this.editorContentElement.querySelector(bu)}#Pt(){this.hasAttribute("required")&&this.#Rt?this.internals.setValidity({valueMissing:!0},"Please fill out this field.",this.editorContentElement):this.internals.setValidity({})}#ut(){this.#Ft(),this.editorContentElement&&(this.editorContentElement.remove(),this.editorContentElement=null),this.contents=null,this.editor=null,this.toolbar&&(this.getAttribute("toolbar")||this.toolbar.remove(),this.toolbar=null),this.selection=null,document.removeEventListener("turbo:before-cache",this.#At)}#dt(){this.disconnectedCallback(),this.connectedCallback()}}customElements.define("lexxy-editor",Vd);class Zd extends HTMLElement{connectedCallback(){this.dialog=this.querySelector("dialog"),this.input=this.querySelector("input"),this.addEventListener("submit",this.#Mt.bind(this)),this.querySelector("[value='unlink']").addEventListener("click",this.#Dt.bind(this)),this.addEventListener("keydown",this.#zt.bind(this))}show(e){this.input.value=this.#Bt,this.dialog.show()}close(){this.dialog.close()}#Mt(e){const t=e.submitter?.value;this.#$t.dispatchCommand(t,this.input.value)}#Dt(e){this.#$t.dispatchCommand("unlink"),this.close()}#zt(e){"Escape"===e.key&&(e.stopPropagation(),this.close())}get#Bt(){let e="";return this.#$t.getEditorState().read((()=>{const t=ii();if(!Ur(t))return;let n=t.getNodes()[0];for(;n&&n.getParent();){if($c(n)){e=n.getURL();break}n=n.getParent()}})),e}get#$t(){return this.closest("lexxy-toolbar").editor}}customElements.define("lexxy-link-dialog",Zd);class Yd{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=Su("li",{role:"option",id:Cu("prompt-item"),tabindex:"0"});return n.classList.add("lexxy-prompt-menu__item"),n.appendChild(t),n}async loadPromptItemsFromUrl(e){try{const t=await fetch(e),n=vu(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}class Xd extends Yd{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Ut(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Ut(e,t){const n=[];return this.promptItemByListItem=new WeakMap,e.forEach((e=>{const r=e.getAttribute("search");if(!t||function(e,t){return Jd(e).includes(Jd(t))}(r,t)){const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),n.push(t)}})),n}}class Qd extends Xd{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class eh extends Xd{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}class th extends Yd{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=function(e,t){let n;return(...r)=>(clearTimeout(n),new Promise(((i,s)=>{n=setTimeout((async()=>{try{const t=await e(...r);i(t)}catch(e){s(e)}}),t)})))}(this.fetchFilteredListItems.bind(this),200)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){const t=await this.loadPromptItemsFromUrl(this.#Wt(e));return this.#Ut(t)}#Wt(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Ut(e){const t=[];this.promptItemByListItem=new WeakMap;for(const n of e){const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}class nh extends HTMLElement{constructor(){super(),this.keyListeners=[]}connectedCallback(){this.source=this.#Kt(),this.#Ht()}disconnectedCallback(){this.source=null,this.popoverElement=null}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get#jt(){return!this.supportsSpaceInSearches}#Kt(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new th(e):new eh(e):new Qd(this.querySelectorAll("lexxy-prompt-item"))}#Ht(){const e=this.#$t.registerUpdateListener((()=>{this.#$t.read((()=>{const t=ii();if(!t)return;let n;if(Ur(t)?n=t.anchor.getNode():Kr(t)&&([n]=t.getNodes()),n&&Pr(n)){[...n.getTextContent().trim()].pop()===this.trigger&&(e(),this.#qt())}}))}))}get#$t(){return this.#Jt.editor}get#Jt(){return this.closest("lexxy-editor")}get#$e(){return this.#Jt.selection}async#qt(){this.popoverElement??=await this.#Gt(),await this.#Vt(),this.#Zt(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#Yt(),this.#Jt.addEventListener("keydown",this.#Xt),this.#Jt.addEventListener("lexxy:change",this.#Vt),this.#Qt()}#Qt(){this.keyListeners.push(this.#$t.registerCommand(un,this.#en.bind(this),3)),this.keyListeners.push(this.#$t.registerCommand(fn,this.#en.bind(this),3)),this.#jt&&this.keyListeners.push(this.#$t.registerCommand(dn,this.#en.bind(this),3))}#Yt(){const e=this.#tn[0];e&&this.#nn(e)}get#tn(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#nn(e){this.#rn(),e.toggleAttribute("aria-selected",!0),e.focus(),this.#Jt.focus(),this.#in.setAttribute("aria-controls",this.popoverElement.id),this.#in.setAttribute("aria-activedescendant",e.id),this.#in.setAttribute("aria-haspopup","listbox")}#rn(){this.#tn.forEach((e=>{e.toggleAttribute("aria-selected",!1)})),this.#in.removeAttribute("aria-controls"),this.#in.removeAttribute("aria-activedescendant"),this.#in.removeAttribute("aria-haspopup")}#Zt(){const{x:e,y:t,fontSize:n}=this.#$e.cursorPosition,r=this.#Jt.getBoundingClientRect(),i=this.#in.getBoundingClientRect().top-r.top;this.popoverElement.style.left=`${e}px`,this.popoverElement.style.top=`${t+i}px`,this.popoverElement.style.bottom="auto";this.popoverElement.getBoundingClientRect().bottom>window.innerHeight&&(this.popoverElement.style.bottom=`${t-i+n}px`,this.popoverElement.style.top="auto")}async#sn(){this.#rn(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#Jt.removeEventListener("lexxy:change",this.#Vt),this.#Jt.removeEventListener("keydown",this.#Xt),this.#on(),await Pu(),this.#Ht()}#on(){this.keyListeners.forEach((e=>e())),this.keyListeners=[]}#Vt=async()=>{this.initialPrompt?this.initialPrompt=!1:this.#an.containsTextBackUntil(this.trigger)?await this.#ln():this.#sn()};async#ln(){const e=this.#an.textBackUntil(this.trigger),t=await this.source.buildListItems(e);this.popoverElement.innerHTML="",t.length>0?this.#cn(t):this.#un(),this.#Yt()}#cn(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#un(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=Su("li",{innerHTML:this.#dn});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#dn(){return this.getAttribute("empty-results")||"Nothing found"}#Xt=e=>{"Escape"===e.key?(this.#sn(),this.#Jt.focus(),e.stopPropagation()):"ArrowDown"===e.key?(this.#hn(),e.preventDefault(),e.stopPropagation()):"ArrowUp"===e.key&&(this.#gn(),e.preventDefault(),e.stopPropagation())};#hn(){const e=this.#pn+1;e<this.#tn.length&&this.#nn(this.#tn[e])}#gn(){const e=this.#pn-1;e>=0&&this.#nn(this.#tn[e])}get#pn(){return this.#tn.findIndex((e=>e.hasAttribute("aria-selected")))}get#fn(){return this.#tn[this.#pn]}#en(e){return" "!==e.key&&e.preventDefault(),e.stopPropagation(),this.#mn(),!0}#mn(){this.#yn(),this.#sn(),this.#Jt.focus()}#yn(){const e=this.source.promptItemFor(this.#fn);if(!e)return;const t=e.querySelector("template[type='editor']"),n=`${this.trigger}${this.#an.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#_n(t,n):this.#bn(e,t,n)}#_n(e,t){this.#$t.update((()=>{const n=yl(this.#$t,vu(`${e.innerHTML}`));this.#an.replaceTextBackUntil(t,n)}))}#bn(e,t,n){this.#$t.update((()=>{const r=new Ou({sgid:e.getAttribute("sgid"),contentType:`application/vnd.actiontext.${this.name}`,innerHtml:t.innerHTML});this.#an.replaceTextBackUntil(n,r)}))}get#an(){return this.#Jt.contents}get#in(){return this.#Jt.editorContentElement}async#Gt(){const e=Su("ul",{role:"listbox",id:Cu("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",Sa()),e.append(...await this.source.buildListItems()),e.addEventListener("click",this.#xn),this.#Jt.appendChild(e),e}#xn=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#nn(t),this.#mn())}}customElements.define("lexxy-prompt",nh);class rh extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.#kn(),this.#Sn()}#kn(){this.languagePickerElement=this.#vn(),this.languagePickerElement.addEventListener("change",(()=>{this.#wn(this.languagePickerElement.value)})),this.languagePickerElement.style.position="absolute",this.languagePickerElement.setAttribute("nonce",Sa()),this.editorElement.appendChild(this.languagePickerElement)}#vn(){const e=Su("select",{hidden:!0,className:"lexxy-code-language-picker","aria-label":"Pick a language…",name:"lexxy-code-language"});for(const[t,n]of Object.entries(this.#Tn)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#Tn(){const e={...fc};e.ruby||(e.ruby="Ruby");const t=Object.entries(e).sort((([,e],[,t])=>e.localeCompare(t))),n=t.findIndex((([e])=>"plain"===e)),r=t.splice(n,1)[0];return Object.fromEntries([r,...t])}#wn(e){this.editor.update((()=>{const t=this.#Cn();t&&t.setLanguage(e)}))}#Sn(){this.editor.registerUpdateListener((()=>{this.editor.getEditorState().read((()=>{const e=this.#Cn();e?this.#En(e):this.#Nn()}))}))}#Cn(){const e=ii();if(!Ur(e))return null;const t=e.anchor.getNode(),n=t.getParent();return lc(t)?t:lc(n)?n:null}#En(e){const t=e.getLanguage();this.#An(t),this.#Ln(),this.#Pn(e)}#An(e){if(this.languagePickerElement&&e){const t=function(e){return mc[e]||e}(e);this.languagePickerElement.value=t}}#Pn(e){const t=this.editor.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.editorElement.getBoundingClientRect(),i=n.top-r.top;this.languagePickerElement.style.top=`${i}px`}#Ln(){this.languagePickerElement.hidden=!1}#Nn(){this.languagePickerElement.hidden=!0}}function ih(){document.querySelectorAll("pre[data-language]").forEach((e=>{!function(e){const t=e.getAttribute("data-language");let n=e.innerHTML.replace(/<br\s*\/?>/gi,"\n");const r=Prism.languages[t];if(!r)return;n=(new DOMParser).parseFromString(n,"text/html").body.textContent||"";const i=Prism.highlight(n,r,t),s=Su("code",{"data-language":t,innerHTML:i});e.replaceWith(s)}(e)}))}customElements.define("lexxy-code-language-picker",rh),function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var n="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+n+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism),window.Prism=window.Prism||{},Prism.manual=!0;export{ih as highlightAll};
|