vendor: 5,052 bytes, line 1
1function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function requirePrism(){return hasRequiredPrism||(hasRequiredPrism=1,function(e){var t=function(e){function t(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function n(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var o=i[1].length;i.index+=o,i[0]=i[0].slice(o)}return i}function r(e,i,l,a,c,u){for(var d in l)if(l.hasOwnProperty(d)&&l[d]){var g=l[d];g=Array.isArray(g)?g:[g];for(var p=0;p<g.length;++p){if(u&&u.cause==d+","+p)return;var f=g[p],m=f.inside,y=!!f.lookbehind,b=!!f.greedy,$=f.alias;if(b&&!f.pattern.global){var _=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,_+"g")}for(var C=f.pattern||f,x=a.next,S=c;x!==i.tail&&!(u&&S>=u.reach);S+=x.value.length,x=x.next){var T=x.value;if(i.length>e.length)return;if(!(T instanceof t)){var E,v=1;if(b){if(!(E=n(C,S,e,y))||E.index>=e.length)break;var w=E.index,k=E.index+E[0].length,N=S;for(N+=x.value.length;w>=N;)N+=(x=x.next).value.length;if(S=N-=x.value.length,x.value instanceof t)continue;for(var A=x;A!==i.tail&&(N<k||"string"==typeof A.value);A=A.next)v++,N+=A.value.length;v--,T=e.slice(S,N),E.index-=S}else if(!(E=n(C,0,T,y)))continue;w=E.index;var L=E[0],O=T.slice(0,w),I=T.slice(w+L.length),F=S+T.length;u&&F>u.reach&&(u.reach=F);var P=x.prev;if(O&&(P=o(i,P,O),S+=O.length),s(i,P,v),x=o(i,P,new t(d,m?h.tokenize(L,m):L,$,L)),I&&o(i,x,I),v>1){var R={cause:d+","+p,reach:F};r(e,i,l,x.prev,S,R),u&&R.reach>u.reach&&(u.reach=R.reach)}}}}}}function i(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function o(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function s(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function l(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}function a(){h.manual||h.highlightAll()}var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,u=0,d={},h={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof t?new t(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++u}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},h.util.type(t)){case"Object":if(i=h.util.objId(t),n[i])return n[i];for(var o in r={},n[i]=r,t)t.hasOwnProperty(o)&&(r[o]=e(t[o],n));return r;case"Array":return i=h.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach((function(t,i){r[i]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var t=c.exec(e.className);if(t)return t[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,t){e.className=e.className.replace(RegExp(c,"gi"),""),e.classList.add("language-"+t)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:d,plaintext:d,text:d,txt:d,extend:function(e,t){var n=h.util.clone(h.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||h.languages)[e],o={};for(var s in i)if(i.hasOwnProperty(s)){if(s==t)for(var l in n)n.hasOwnProperty(l)&&(o[l]=n[l]);n.hasOwnProperty(s)||(o[s]=i[s])}var a=r[e];return r[e]=o,h.languages.DFS(h.languages,(function(t,n){n===a&&t!=e&&(this[t]=o)})),o},DFS:function e(t,n,r,i){i=i||{};var o=h.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],r||s);var l=t[s],a=h.util.type(l);"Object"!==a||i[o(l)]?"Array"!==a||i[o(l)]||(i[o(l)]=!0,e(l,n,s,i)):(i[o(l)]=!0,e(l,n,null,i))}}},plugins:{},highlightAll:function(e,t){h.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};h.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),h.hooks.run("before-all-elements-highlight",r);for(var i,o=0;i=r.elements[o++];)h.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){function i(e){a.highlightedCode=e,h.hooks.run("before-insert",a),a.element.innerHTML=a.highlightedCode,h.hooks.run("after-highlight",a),h.hooks.run("complete",a),r&&r.call(a.element)}var o=h.util.getLanguage(t),s=h.languages[o];h.util.setLanguage(t,o);var l=t.parentElement;
vendor: 4,760 bytes, line 1
1l&&"pre"===l.nodeName.toLowerCase()&&h.util.setLanguage(l,o);var a={element:t,language:o,grammar:s,code:t.textContent};if(h.hooks.run("before-sanity-check",a),(l=a.element.parentElement)&&"pre"===l.nodeName.toLowerCase()&&!l.hasAttribute("tabindex")&&l.setAttribute("tabindex","0"),!a.code)return h.hooks.run("complete",a),void(r&&r.call(a.element));if(h.hooks.run("before-highlight",a),a.grammar)if(n&&e.Worker){var c=new Worker(h.filename);c.onmessage=function(e){i(e.data)},c.postMessage(JSON.stringify({language:a.language,code:a.code,immediateClose:!0}))}else i(h.highlight(a.code,a.grammar,a.language));else i(h.util.encode(a.code))},highlight:function(e,n,r){var i={code:e,grammar:n,language:r};if(h.hooks.run("before-tokenize",i),!i.grammar)throw new Error('The language "'+i.language+'" has no grammar.');return i.tokens=h.tokenize(i.code,i.grammar),h.hooks.run("after-tokenize",i),t.stringify(h.util.encode(i.tokens),i.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var s in n)t[s]=n[s];delete t.rest}var a=new i;return o(a,a.head,e),r(e,a,t,a.head,0),l(a)},hooks:{all:{},add:function(e,t){var n=h.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=h.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:t};if(e.Prism=h,t.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(i.classes,o):i.classes.push(o)),h.hooks.run("wrap",i);var s="";for(var l in i.attributes)s+=" "+l+'="'+(i.attributes[l]||"").replace(/"/g,""")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+s+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(h.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,o=n.immediateClose;e.postMessage(h.highlight(i,h.languages[r],r)),o&&e.close()}),!1),h):h;var g=h.util.currentScript();if(g&&(h.filename=g.src,g.hasAttribute("data-manual")&&(h.manual=!0)),!h.manual){var p=document.readyState;"loading"===p||"interactive"===p&&g&&g.defer?document.addEventListener("DOMContentLoaded",a):window.requestAnimationFrame?window.requestAnimationFrame(a):window.setTimeout(a,16)}return h}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=t),void 0!==commonjsGlobal&&(commonjsGlobal.Prism=t),t.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]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:i},t.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\
1s'">=]+(?=[\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:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.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"))}(t),t.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:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.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}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.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}
vendor: 6,849 bytes, line 1
1/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.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:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.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:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.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:t.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"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.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")),t.languages.js=t.languages.javascript,function(){function e(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(i(r.status,r.statusText)):n(o))},r.send(null)}function n(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]}}if(void 0!==t&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading\u2026",i=function(e,t){return"\u2716 Error "+e+" while fetching file: "+t},o="\u2716 Error: File does not exist or is empty",s={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},l="data-src-status",a="loading",c="loaded",u="failed",d="pre[data-src]:not(["+l+'="'+c+'"]):not(['+l+'="'+a+'"])';t.hooks.add("before-highlightall",(function(e){e.selector+=", "+d})),t.hooks.add("before-sanity-check",(function(i){var o=i.element;if(o.matches(d)){i.code="",o.setAttribute(l,a);var h=o.appendChild(document.createElement("CODE"));h.textContent=r;var g=o.getAttribute("data-src"),p=i.language;if("none"===p){var f=(/\.(\w+)$/.exec(g)||[,"none"])[1];p=s[f]||f}t.util.setLanguage(h,p),t.util.setLanguage(o,p);var m=t.plugins.autoloader;m&&m.loadLanguages(p),e(g,(function(e){o.setAttribute(l,c);var r=n(o.getAttribute("data-range"));if(r){var i=e.split(/\r\n?|\n/g),s=r[0],a=null==r[1]?i.length:r[1];s<0&&(s+=i.length),s=Math.max(0,Math.min(s-1,i.length)),a<0&&(a+=i.length),a=Math.max(0,Math.min(a,i.length)),e=i.slice(s,a).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",String(s+1))}h.textContent=e,t.highlightElement(h)}),(function(e){o.setAttribute(l,u),h.textContent=e}))}})),t.plugins.fileHighlight={highlight:function(e){for(var n,r=(e||document).querySelectorAll(d),i=0;n=r[i++];)t.highlightElement(n)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(prism)),prism.exports}function requirePrismPython(){return hasRequiredPrismPython||(hasRequiredPrismPython=1,Prism$1.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
1])+|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$1.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism$1.languages.python,Prism$1.languages.py=Prism$1.languages.python),prismPython}function requirePrismRust(){return hasRequiredPrismRust||(hasRequiredPrismRust=1,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$1)),prismRust}function requirePrismTypescript(){return hasRequiredPrismTypescript||(hasRequiredPrismTypescript=1,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$1)),prismTypescript}function requirePrismJava(){return hasRequiredPrismJava||(hasRequiredPrismJava=1,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*[(){}[\]<>=%~.:,;
vendor: 4,608 bytes, line 1
1?+\-*/&|^])|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$1)),prismJava}function requirePrismCpp(){return hasRequiredPrismCpp||(hasRequiredPrismCpp=1,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
vendor: 4,569 bytes, lines 1-2
1*\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$1)),prismCpp}function requirePrismRuby(){return hasRequiredPrismRuby||(hasRequiredPrismRuby=1,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]+/}},{ 2pattern:/(^|[^/])\/(?!\/)(?:\[[^\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$1)),prismRuby}function requirePrismPhp(){return hasRequiredPrismPhp||(hasRequiredPrismPhp=1,function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0}
vendor: 4,534 bytes, line 2
2,/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:i,punctuation:o};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},l=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;
2|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:l,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:l,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:i,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){if(/<\?/.test(t.code)){var n=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;e.languages["markup-templating"].buildPlaceholders(t,"php",n)}})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism$1)),prismPhp}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,l=[],a=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(a=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,i=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return l}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function unapply(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return apply(e,t,r)}}function unconstruct(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return construct(e,n)}}function addToSet(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:stringToLowerCase;if(setPrototypeOf&&setPrototypeOf(e,null),!arrayIsArray(t))return e;let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){const e=n(i);e!==i&&(isFrozen(t)||(t[r]=e),i=e)}e[i]=!0}return e}function cleanArray(e){for(let t=0;t<e.length;t++){objectHasOwnProperty(e,t)||(e[t]=null)}return e}function clone(e){const t=create(null);for(const r of entries(e)){var n=_slicedToArray(r,2);const i=n[0],o=n[1];objectHasOwnProperty(e,i)&&(arrayIsArray(o)?t[i]=cleanArray(o):o&&"object"==typeof o&&o.constructor===Object?t[i]=clone(o):t[i]=o)}return t}function stringifyValue(e){switch(typeof e){case"string":return e;case"number":return numberToString(e);case"boolean":return booleanToString(e);case"bigint":return bigintToString?bigintToString(e):"0";case"symbol":return symbolToString?symbolToString(e):"Symbol()";case"undefined":default:return objectToString(e);case"function":case"object":{if(null===e)return objectToString(e);const t=e,n=lookupGetter(t,"toString");if("function"==typeof n){const e=n(t);return"string"==typeof e?e:objectToString(e)}return objectToString(e)}}}function lookupGetter(e,t){function n(){return null}for(;null!==e;){const n=getOwnPropertyDescriptor(e,t);if(n){if(n.get)return unapply(n.get);if("function"==typeof n.value)return unapply(n.value)}e=getPrototypeOf(e)}return n}function isRegex(e){try{return regExpTest(e,""),!0}catch(e){return!1}}function createDOMPurify(){function e(e,t,r){0!==e.length&&arrayForEach(e,(e=>{e.call(n,t,r,Ve)}))}let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:getGlobal();const n=e=>createDOMPurify(e);if(n.version="3.4.13",n.removed=[],!t||!t.document||t.document.nodeType!==NODE_TYPE.document||!t.Element)return n.isSupported=!1,n;let r=t.document;const i=r,o=i.currentScript;t.DocumentFragment;const s=t.HTMLTemplateElement,l=t.Node,a=t.Element,c=t.NodeFilter,u=t.NamedNodeMap;void 0===u&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const d=t.DOMParser,h=t.trustedTypes,g=a.prototype,p=lookupGetter(g,"cloneNode"),f=lookupGetter(g,"remove"),m=lookupGetter(g,"nextSibling"),y=lookupGetter(g,"childNodes"),b=lookupGetter(g,"parentNode"),$=lookupGetter(g,"shadowRoot"),_=lookupGetter(g,"attributes"),C=l&&l.prototype?lookupGetter(l.prototype,"nodeType"):null,x=l&&l.prototype?lookupGetter(l.prototype,"nodeName"):null,S=l&&l.prototype?lookupGetter(l.prototype,"ownerDocument"):null;if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let T,E,v="",w=!1,k=0;const N=function(){if(k>0)throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},A=function(e){N(),k++;try{return T.createHTML(e)}finally{k--}},L=function(e){N(),k++;try{return T.createScriptURL(e)}finally{k--}},O=function(){return w||(E=_createTrustedTypesPolicy(h,o),w=!0),E},I=r,F=I.implementation,P=I.createNodeIterator,R=I.createDocumentFragment,M=I.getElementsByTagName,D=i.importNode;let B=_createHooksMap();
vendor: 12,415 bytes, line 2
2n.isSupported="function"==typeof entries&&"function"==typeof b&&F&&void 0!==F.createHTMLDocument;const H=MUSTACHE_EXPR,z=ERB_EXPR,W=TMPLIT_EXPR,U=DATA_ATTR,K=ARIA_ATTR,V=IS_SCRIPT_OR_DATA,q=ATTR_WHITESPACE$1,G=CUSTOM_ELEMENT;let j=IS_ALLOWED_URI,Z=null;const Q=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text]);let Y=null;const J=addToSet({},[...html,...svg,...mathMl,...xml]);let X=Object.seal(create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ee=null,te=null;const ne=Object.seal(create(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let re=!0,ie=!0,oe=!1,se=!0,le=!1,ae=!0,ce=!1,ue=!1,de=null,he=null,ge=!1,pe=!1,fe=!1,me=!1,ye=!0,be=!1;const $e="user-content-";let _e=!0,Ce=!1,xe={},Se=null;const Te=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ee=null;const ve=addToSet({},["audio","video","img","source","image","track"]);let we=null;const ke=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ne="http://www.w3.org/1998/Math/MathML",Ae="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml";let Oe=Le,Ie=!1,Fe=null;const Pe=addToSet({},[Ne,Ae,Le],stringToString),Re=freeze(["mi","mo","mn","ms","mtext"]);let Me=addToSet({},Re);const De=freeze(["annotation-xml"]);let Be=addToSet({},De);const He=addToSet({},["title","style","font","a","script"]);let ze=null;const We=["application/xhtml+xml","text/html"],Ue="text/html";let Ke=null,Ve=null;const qe=r.createElement("form"),Ge=function(e){return e instanceof RegExp||e instanceof Function},je=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ve&&Ve===e)return;e&&"object"==typeof e||(e={}),e=clone(e),ze=-1===We.indexOf(e.PARSER_MEDIA_TYPE)?Ue:e.PARSER_MEDIA_TYPE,Ke="application/xhtml+xml"===ze?stringToString:stringToLowerCase,Z=_resolveSetOption(e,"ALLOWED_TAGS",Q,{transform:Ke}),Y=_resolveSetOption(e,"ALLOWED_ATTR",J,{transform:Ke}),Fe=_resolveSetOption(e,"ALLOWED_NAMESPACES",Pe,{transform:stringToString}),we=_resolveSetOption(e,"ADD_URI_SAFE_ATTR",ke,{transform:Ke,base:ke}),Ee=_resolveSetOption(e,"ADD_DATA_URI_TAGS",ve,{transform:Ke,base:ve}),Se=_resolveSetOption(e,"FORBID_CONTENTS",Te,{transform:Ke}),ee=_resolveSetOption(e,"FORBID_TAGS",clone({}),{transform:Ke}),te=_resolveSetOption(e,"FORBID_ATTR",clone({}),{transform:Ke}),xe=!!objectHasOwnProperty(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?clone(e.USE_PROFILES):e.USE_PROFILES),re=!1!==e.ALLOW_ARIA_ATTR,ie=!1!==e.ALLOW_DATA_ATTR,oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,se=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,le=e.SAFE_FOR_TEMPLATES||!1,ae=!1!==e.SAFE_FOR_XML,ce=e.WHOLE_DOCUMENT||!1,pe=e.RETURN_DOM||!1,fe=e.RETURN_DOM_FRAGMENT||!1,me=e.RETURN_TRUSTED_TYPE||!1,ge=e.FORCE_BODY||!1,ye=!1!==e.SANITIZE_DOM,be=e.SANITIZE_NAMED_PROPS||!1,_e=!1!==e.KEEP_CONTENT,Ce=e.IN_PLACE||!1,j=isRegex(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:IS_ALLOWED_URI,Oe="string"==typeof e.NAMESPACE?e.NAMESPACE:Le,Me=objectHasOwnProperty(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?clone(e.MATHML_TEXT_INTEGRATION_POINTS):addToSet({},Re),Be=objectHasOwnProperty(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?clone(e.HTML_INTEGRATION_POINTS):addToSet({},De);const t=objectHasOwnProperty(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?clone(e.CUSTOM_ELEMENT_HANDLING):create(null);if(X=create(null),objectHasOwnProperty(t,"tagNameCheck")&&Ge(t.tagNameCheck)&&(X.tagNameCheck=t.tagNameCheck),objectHasOwnProperty(t,"attributeNameCheck")&&Ge(t.attributeNameCheck)&&(X.attributeNameCheck=t.attributeNameCheck),objectHasOwnProperty(t,"allowCustomizedBuiltInElements")&&"boolean"==typeof t.allowCustomizedBuiltInElements&&(X.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),seal(X),le&&(ie=!1),fe&&(pe=!0),xe&&(Z=addToSet({},text),Y=create(null),!0===xe.html&&(addToSet(Z,html$1),addToSet(Y,html)),!0===xe.svg&&(addToSet(Z,svg$1),addToSet(Y,svg),addToSet(Y,xml)),!0===xe.svgFilters&&(addToSet(Z,svgFilters),addToSet(Y,svg),addToSet(Y,xml)),!0===xe.mathMl&&(addToSet(Z,mathMl$1),addToSet(Y,mathMl),addToSet(Y,xml))),ne.tagCheck=null,ne.attributeCheck=null,objectHasOwnProperty(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?ne.tagCheck=e.ADD_TAGS:arrayIsArray(e.ADD_TAGS)&&(Z===Q&&(Z=clone(Z)),addToSet(Z,e.ADD_TAGS,Ke))),objectHasOwnProperty(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?ne.attributeCheck=e.ADD_ATTR:arrayIsArray(e.ADD_ATTR)&&(Y===J&&(Y=clone(Y)),addToSet(Y,e.ADD_ATTR,Ke))),objectHasOwnProperty(e,"ADD_URI_SAFE_ATTR")&&arrayIsArray(e.ADD_URI_SAFE_ATTR)&&addToSet(we,e.ADD_URI_SAFE_ATTR,Ke),objectHasOwnProperty(e,"FORBID_CONTENTS")&&arrayIsArray(e.FORBID_CONTENTS)&&(Se===Te&&(Se=clone(Se)),addToSet(Se,e.FORBID_CONTENTS,Ke)),objectHasOwnProperty(e,"ADD_FORBID_CONTENTS")&&arrayIsArray(e.ADD_FORBID_CONTENTS)&&(Se===Te&&(Se=clone(Se)),addToSet(Se,e.ADD_FORBID_CONTENTS,Ke)),_e&&(Z["#text"]=!0),ce&&addToSet(Z,["html","head","body"]),Z.table&&(addToSet(Z,["tbody"]),delete ee.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const t=T;T=e.TRUSTED_TYPES_POLICY;try{v=A("")}catch(e){throw T=t,e}}else null===e.TRUSTED_TYPES_POLICY?(T=void 0,v=""):(void 0===T&&(T=O()),T&&"string"==typeof v&&(v=A("")));freeze&&freeze(e),Ve=e},Ze=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),Qe=addToSet({},[...mathMl$1,...mathMlDisallowed]),Ye=function(e,t,n){return t.namespaceURI===Le?"svg"===e:t.namespaceURI===Ne?"svg"===e&&("annotation-xml"===n||Me[n]):Boolean(Ze[e])},Je=function(e,t,n){return t.namespaceURI===Le?"math"===e:t.namespaceURI===Ae?"math"===e&&Be[n]:Boolean(Qe[e])},Xe=function(e,t,n){return!(t.namespaceURI===Ae&&!Be[n])&&(!(t.namespaceURI===Ne&&!Me[n])&&(!Qe[e]&&(He[e]||!Ze[e])))},et=function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:Oe,tagName:"template"});const n=stringToLowerCase(e.tagName),r=stringToLowerCase(t.tagName);return!!Fe[e.namespaceURI]&&(e.namespaceURI===Ae?Ye(n,t,r):e.namespaceURI===Ne?Je(n,t,r):e.namespaceURI===Le?Xe(n,t,r):!("application/xhtml+xml"!==ze||!Fe[e.namespaceURI]))},tt=function(e){arrayPush(n.removed,{element:e});try{b(e).removeChild(e)}catch(t){if(f(e),!b(e))throw typeErrorCreate("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},nt=function(e){ot(e);const t=y(e);if(t){const e=[];arrayForEach(t,(t=>{arrayPush(e,t)})),arrayForEach(e,(e=>{try{f(e)}catch(e){}}))}const n=_(e);if(n)for(let t=n.length-1;t>=0;--t){const r=n[t],i=r&&r.name;if("string"==typeof i)try{e.removeAttribute(i)}catch(e){}}},rt=function(e,t){try{arrayPush(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){arrayPush(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(pe||fe)try{tt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},it=function(e){const t=_(e);if(t)for(let n=t.length-1;n>=0;--n){const r=t[n],i=r&&r.name;if("string"==typeof i&&!Y[Ke(i)])try{e.removeAttribute(i)}catch(e){}}},ot=function(e){const t=[e];for(;t.length>0;){const e=t.pop();(C?C(e):e.nodeType)===NODE_TYPE.element&&it(e);const n=y(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},st=function(e){if(!ae)return;const t=[e];for(;t.length>0;){const e=t.pop(),n=C?C(e):e.nodeType;if(n===NODE_TYPE.processingInstruction||n===NODE_TYPE.comment&®ExpTest(COMMENT_MARKUP_PROBE,e.data)){try{f(e)}catch(e){}continue}if(n===NODE_TYPE.element){const t=e,n=Ke(x?x(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute("patchsrc")&&t.removeAttribute("patchsrc"),t.hasAttribute&&t.hasAttribute("for")&&"label"!==n&&"output"!==n&&t.removeAttribute("for")}catch(e){}}const r=y(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},lt=function(e){let t=null,n=null;if(ge)e="<remove></remove>"+e;else{const t=stringMatch(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ze&&Oe===Le&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const i=T?A(e):e;if(Oe===Le)try{t=(new d).parseFromString(i,ze)}catch(e){}if(!t||!t.documentElement){t=F.createDocument(Oe,"template",null);try{t.documentElement.innerHTML=Ie?v:i}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),Oe===Le?M.call(t,ce?"html":"body")[0]:ce?t.documentElement:o},at=function(e){const t=S?S(e):e.ownerDocument;return P.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ct=function(e){return e=stringReplace(e,H," "),e=stringReplace(e,z," "),e=stringReplace(e,W," ")},ut=function(e){var t;e.normalize();const n=S?S(e):e.ownerDocument,r=P.call(n||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let i=r.nextNode();for(;i;)i.data=ct(i.data),i=r.nextNode();const o=null===(t=e.querySelectorAll)||void 0===t?void 0:t.call(e,"template");o&&arrayForEach(o,(e=>{ht(e.content)&&ut(e.content)}))},dt=function(e){const t=x?x(e):null;return"string"==typeof t&&("form"===Ke(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==_(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==C(e)||e.childNodes!==y(e)))},ht=function(e){if(!C||"object"!=typeof e||null===e)return!1;try{return C(e)===NODE_TYPE.documentFragment}catch(e){return!1}},gt=function(e){if(!C||"object"!=typeof e||null===e)return!1;try{return"number"==typeof C(e)}catch(e){return!1}},pt=function(e,t){return!!(ae&&e.hasChildNodes()&&!gt(e.firstElementChild)&®ExpTest(ELEMENT_MARKUP_PROBE,e.textContent)&®ExpTest(ELEMENT_MARKUP_PROBE,e.innerHTML))||(!(!ae||e.namespaceURI!==Le||"style"!==t||!gt(e.firstElementChild))||(e.nodeType===NODE_TYPE.processingInstruction||!(!ae||e.nodeType!==NODE_TYPE.comment||!regExpTest(COMMENT_MARKUP_PROBE,e.data))))},ft=function(e,t,n){if(!ee[t]&&_t(t)){if(X.tagNameCheck instanceof RegExp&®ExpTest(X.tagNameCheck,t))return!1;if(X.tagNameCheck instanceof Function&&X.tagNameCheck(t))return!1}if(_e&&!Se[t]){const t=b(e),r=y(e);if(r&&t){for(let i=r.length-1;i>=0;--i){const o=e===n?p(r[i],!0):r[i];t.insertBefore(o,m(e))}}}return tt(e),!0},mt=function(e,t,n,r){return 0===e.length?t:t===n||t===r?clone(t):t},yt=function(t,r){if(e(B.beforeSanitizeElements,t,null),t!==r&&null===b(t))return Ce&&ot(t),!0;if(dt(t))return tt(t),!0;const i=Ke(x?x(t):t.nodeName);if(Z=mt(B.uponSanitizeElement,Z,Q,de),e(B.uponSanitizeElement,t,{tagName:i,allowedTags:Z}),t!==r&&null===b(t))return Ce&&ot(t),!0;if(pt(t,i))return tt(t),!0;if(ee[i]||!(ne.tagCheck instanceof Function&&ne.tagCheck(i))&&!Z[i]){const n=ft(t,i,r);return!1===n&&e(B.afterSanitizeElements,t,null),n}if((C?C(t):t.nodeType)===NODE_TYPE.element&&!et(t))return tt(t),!0;if(("noscript"===i||"noembed"===i||"noframes"===i)&®ExpTest(FALLBACK_TAG_CLOSE,t.innerHTML))return tt(t),!0;if(le&&t.nodeType===NODE_TYPE.text){const e=ct(t.textContent);t.textContent!==e&&(arrayPush(n.removed,{element:t.cloneNode()}),t.textContent=e)}return e(B.afterSanitizeElements,t,null),!1},bt=function(e,t,n){if(te[t])return!1;if(ae&&"patchsrc"===t)return!1;if(ae&&"for"===t&&"label"!==e&&"output"!==e)return!1;if(ye&&("id"===t||"name"===t)&&(n in r||n in qe))return!1;const i=Y[t]||ne.attributeCheck instanceof Function&&ne.attributeCheck(t,e);if(ie&®ExpTest(U,t));else if(re&®ExpTest(K,t));else if(i)if(we[t]);else if(regExpTest(j,stringReplace(n,q,"")));
2else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==stringIndexOf(n,"data:")||!Ee[e]){if(oe&&!regExpTest(V,stringReplace(n,q,"")));else if(n)return!1}else;else if(!(_t(e)&&(X.tagNameCheck instanceof RegExp&®ExpTest(X.tagNameCheck,e)||X.tagNameCheck instanceof Function&&X.tagNameCheck(e))&&(X.attributeNameCheck instanceof RegExp&®ExpTest(X.attributeNameCheck,t)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(t,e))||"is"===t&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&®ExpTest(X.tagNameCheck,n)||X.tagNameCheck instanceof Function&&X.tagNameCheck(n))))return!1;return!0},$t=addToSet({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_t=function(e){return!$t[stringToLowerCase(e)]&®ExpTest(G,e)},Ct=function(e,t,n,r){if(T&&"object"==typeof h&&"function"==typeof h.getAttributeType&&!n)switch(h.getAttributeType(e,t)){case"TrustedHTML":return A(r);case"TrustedScriptURL":return L(r)}return r},xt=function(e,t,r,i){try{r?e.setAttributeNS(r,t,i):e.setAttribute(t,i),dt(e)?tt(e):arrayPop(n.removed)}catch(n){rt(t,e)}},St=function(t){e(B.beforeSanitizeAttributes,t,null);const n=t.attributes;if(!n||dt(t))return;Y=mt(B.uponSanitizeAttribute,Y,J,he);const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y,forceKeepAttr:void 0};let i=n.length;const o=Ke(t.nodeName);for(;i--;){const s=n[i],l=s.name,a=s.namespaceURI,c=s.value,u=Ke(l),d=c;let h="value"===l?d:stringTrim(d);r.attrName=u,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,e(B.uponSanitizeAttribute,t,r),h=r.attrValue,!be||"id"!==u&&"name"!==u||0===stringIndexOf(h,$e)||(rt(l,t),h=$e+h),ae&®ExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,h)?rt(l,t):"attributename"===u&&stringMatch(h,"href")?rt(l,t):r.forceKeepAttr||(r.keepAttr&&(se||!regExpTest(SELF_CLOSING_TAG,h))?(le&&(h=ct(h)),bt(o,u,h)?(h=Ct(o,u,a,h),h!==d&&xt(t,l,a,h)):rt(l,t)):rt(l,t))}e(B.afterSanitizeAttributes,t,null)},Tt=function(t){let n=null;const r=at(t);for(e(B.beforeSanitizeShadowDOM,t,null);n=r.nextNode();){e(B.uponSanitizeShadowNode,n,null),yt(n,t),St(n),ht(n.content)&&Tt(n.content);if((C?C(n):n.nodeType)===NODE_TYPE.element){const e=$(n);ht(e)&&(Et(e),Tt(e))}}e(B.afterSanitizeShadowDOM,t,null)},Et=function(e){const t=[{node:e,shadow:null}];for(;t.length>0;){const e=t.pop();if(e.shadow){Tt(e.shadow);continue}const n=e.node,r=(C?C(n):n.nodeType)===NODE_TYPE.element,i=y(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){const e=x?x(n):null;if("string"==typeof e&&"template"===Ke(e)){const e=n.content;ht(e)&&t.push({node:e,shadow:null})}}if(r){const e=$(n);ht(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,o=null,s=null,l=null;if(Ie=!e,Ie&&(e="<!-->"),"string"!=typeof e&&!gt(e)&&"string"!=typeof(e=stringifyValue(e)))throw typeErrorCreate("dirty is not a string, aborting");if(!n.isSupported)return e;ue?(Z=de,Y=he):je(t),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(Z=clone(Z)),B.uponSanitizeAttribute.length>0&&(Y=clone(Y)),n.removed=[];const a=Ce&&"string"!=typeof e&>(e);if(a){st(e);const t=x?x(e):e.nodeName;if("string"==typeof t){const n=Ke(t);if(!Z[n]||ee[n])throw nt(e),typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}if(dt(e))throw nt(e),typeErrorCreate("root node is clobbered and cannot be sanitized in-place");try{Et(e)}catch(t){throw nt(e),t}}else if(gt(e))r=lt("<!---->"),o=r.ownerDocument.importNode(e,!0),o.nodeType===NODE_TYPE.element&&"BODY"===o.nodeName||"HTML"===o.nodeName?r=o:r.appendChild(o),Et(o);else{if(!pe&&!le&&!ce&&-1===e.indexOf("<"))return T&&me?A(e):e;if(r=lt(e),!r)return pe?null:me?v:""}r&&ge&&tt(r.firstChild);const c=a?e:r;try{const e=at(c);for(;s=e.nextNode();)yt(s,c),St(s),ht(s.content)&&Tt(s.content)}catch(t){throw a&&(nt(e),arrayForEach(n.removed,(e=>{e.element&&ot(e.element)}))),t}if(a)return arrayForEach(n.removed,(e=>{e.element&&ot(e.element)})),le&&ut(e),e;if(pe){if(le&&ut(r),fe)for(l=R.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(Y.shadowroot||Y.shadowrootmode)&&(l=D.call(i,l,!0)),l}let u=ce?r.outerHTML:r.innerHTML;return ce&&Z["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,r.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+u),le&&(u=ct(u)),T&&me?A(u):u},n.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};je(e),ue=!0,de=Z,he=Y},n.clearConfig=function(){Ve=null,ue=!1,de=null,he=null,T=E,v=""},n.isValidAttribute=function(e,t,n){Ve||je({});const r=Ke(e),i=Ke(t);return bt(r,i,n)},n.addHook=function(e,t){"function"==typeof t&&objectHasOwnProperty(B,e)&&arrayPush(B[e],t)},n.removeHook=function(e,t){if(objectHasOwnProperty(B,e)){if(void 0!==t){const n=arrayLastIndexOf(B[e],t);return-1===n?void 0:arraySplice(B[e],n,1)[0]}return arrayPop(B[e])}},n.removeHooks=function(e){objectHasOwnProperty(B,e)&&(B[e]=[])},n.removeAllHooks=function(){B=_createHooksMap()},n}function t(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 e(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);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Y$5(e,t,n,r,i,o){let s=e.getFirstChild();for(;null!==s;){const e=s.__key;s.__parent===t&&(Wi(s)&&Y$5(s,e,n,r,i,o),n.has(e)||o.delete(e),i.push(e)),s=s.getNextSibling()}}function G$a(e){H$7=e.timeStamp}function X$6(e,t,n){const r="BR"===e.nodeName,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&void 0!==Ho(e,n)}function Q$9(e,t,n){const r=Js(Ps(n));let i=null,o=null;null!==r&&r.anchorNode===e&&(i=r.anchorOffset,o=r.focusOffset);const s=e.nodeValue;null!==s&&cs(t,s,i,o,!1)}function Z$5(e,t,n){if(Fr(e)){const t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return Ko(t)&&n.isAttached()}function tt$4(e,t,n,r){for(let i=e;i&&!cl(i);i=bs(i)){const e=Ho(i,t);if(void 0!==e){const t=Yo(e,n);if(t)return ji(t)||!Ys(i)?void 0:[i,t]}else if(i===r)return[r,ts(n)]}}function et$2(e,t,n){q$7=!0;const r=performance.now()-H$7>100;try{Ki(e,(()=>{const i=Qr()||function(e){return e.getEditorState().read((()=>{const e=Qr();return null!==e?e.clone():null}))}(e),o=new Map,s=e.getRootElement(),l=e._editorState,a=e._blockCursorElement;let c=!1,u="";for(let n=0;n<t.length;n++){const d=t[n],h=d.type,g=d.target,p=tt$4(g,e,l,s);if(!p)continue;const[f,m]=p 3;if("characterData"===h)r&&Tr(m)&&Ko(g)&&Z$5(i,g,m)&&Q$9(g,m,e);else if("childList"===h){c=!0;const t=d.addedNodes;for(let n=0;n<t.length;n++){const r=t[n],i=qo(r),o=r.parentNode;if(null!=o&&r!==a&&null===i&&!X$6(r,o,e)){if(o$1){const e=(Ys(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}o.removeChild(r)}}const n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){const r=n[i];(X$6(r,g,e)||a===r)&&(g.appendChild(r),t++)}r!==t&&o.set(f,m)}}}if(o.size>0)for(const[t,n]of o)n.reconcileObservedMutation(t,e);const d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){const n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){const n=r[t],o=n.parentNode;null==o||"BR"!==n.nodeName||X$6(n,i,e)||o.removeChild(n)}}n.takeRecords()}null!==i&&(c&&es(i),o$1&&ks(e)&&i.insertRawText(u))}))}finally{q$7=!1}}function nt$4(e){const t=e._observer;null!==t&&et$2(e,t.takeRecords(),t)}function rt$4(e){!function(e){0===H$7&&Ps(e).addEventListener("textInput",G$a,!0)}(e),e._observer=new MutationObserver(((t,n)=>{et$2(e,t,n)}))}function ot$3(e,t){return new it$2(e,t)}function st$2(e,t,n="latest"){const r=("latest"===n?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function lt$3(e,t,n){const r=st$2(e,n,"direct"),i=st$2(t,n,"direct");return n.isEqual(r,i)?null:[r,i]}function ct$2(e,t,n){let r;if(xi(),"function"==typeof n){const i=e.getLatest(),o=st$2(i,t);if(r=n(o),t.isEqual(o,r))return i}else r=n;const i=e.getWritable();return ft$2(i).updateFromKnown(t,r),i}function at$3(e){const t=new Map,n=new Set;for(let r="function"==typeof e?e:e.replace;r.prototype&&void 0!==r.prototype.getType;r=Object.getPrototypeOf(r)){const{ownNodeConfig:e}=ul(r);if(e&&e.stateConfigs)for(const r of e.stateConfigs){let e;"stateConfig"in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}function ft$2(e){const t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new ut$3(t,dt$3(t));return t.__state=n,n}function dt$3(e){return e.__state?e.__state.sharedNodeState:No(Zs(),e.getType()).sharedNodeState}function ht$3(e){if(e)for(const t in e)return e}function gt$3(e){return e}
3function _t$3(e,t,n){for(const[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);const t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function pt$3(e,t,n){const{unknownState:r}=t,i=n?n.unknownState:void 0;if(r)for(const[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0;return!1}function yt$6(e,t){const n=e.__state;return n&&n.node===e?n.getWritable(t):n}function mt$3(e,t){const n=e.__mode,r=e.__format,i=e.__style,o=t.__mode,s=t.__format,l=t.__style,a=e.__state,c=t.__state;return(null===n||n===o)&&(null===r||r===s)&&(null===i||i===l)&&(null===e.__state||a===c||function(e,t){if(e===t)return!0;const n=new Set;return!(e&&_t$3(n,e,t)||t&&_t$3(n,t,e)||e&&pt$3(n,e,t)||t&&pt$3(n,t,e))}(a,c))}function xt$3(e,t){const n=e.mergeWithSibling(t),r=vi()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Ct$2(e){let t,n,r=e;if(""!==r.__text||!r.isSimpleText()||r.isUnmergeable()){for(;null!==(t=r.getPreviousSibling())&&Tr(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(""!==t.__text){if(mt$3(t,r)){r=xt$3(t,r);break}break}t.remove()}for(;null!==(n=r.getNextSibling())&&Tr(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(""!==n.__text){if(mt$3(r,n)){r=xt$3(r,n);break}break}n.remove()}}else r.remove()}function St$3(e){return vt$3(e.anchor),vt$3(e.focus),e}function vt$3(e){for(;"element"===e.type;){const t=e.getNode(),n=e.offset;let r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),Tr(r)){e.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!Wi(r))break;e.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}function Rt$4(e,t){const n=Ot$4.get(e);if(null!==t){const n=ne$5(e);n.parentNode===t&&t.removeChild(n)}if(Mt$3.has(e)||Tt$5._keyToDOMMap.delete(e),Wi(n)){const e=hl(n,Ot$4);Bt$4(e,0,e.length-1,null)}void 0!==n&&xs(Dt$5,Nt$3,bt$3,n,"destroyed")}function Bt$4(e,t,n,r){for(let i=t;i<=n;++i){const t=e[i];void 0!==t&&Rt$4(t,r)}}function Wt$4(e,t){e.setProperty("text-align",t)}function Jt$4(e,t){const n=kt$3.theme.indent;if("string"==typeof n){const r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(0===t)return void e.style.setProperty("padding-inline-start","");const r=getComputedStyle(Tt$5._rootElement||e).getPropertyValue("--lexical-indent-base-value")||$t$3;e.style.setProperty("padding-inline-start",`calc(${t} * ${r})`)}function jt$3(e,t){const n=e.style;0===t?Wt$4(n,""):1===t?Wt$4(n,"left"):2===t?Wt$4(n,"center"):3===t?Wt$4(n,"right"):4===t?Wt$4(n,"justify"):5===t?Wt$4(n,"start"):6===t&&Wt$4(n,"end")}function Ut$4(e,t){const n=function(e){const t=e.__dir;if(null!==t)return t;if(Vi(e))return null;const n=e.getParentOrThrow();return Vi(n)&&null===n.__dir?"auto":null}(t);null!==n?e.dir=n:e.removeAttribute("dir")}function Vt$3(e,n){const r=Mt$3.get(e);void 0===r&&t(60);const i=Pt$4.$createDOM(r,Tt$5);if(function(e,t,n){const r=n._keyToDOMMap;(function(e,t,n){e[`__lexicalKey_${t._key}`]=n})(t,n,e),r.set(e,t)}(e,i,Tt$5),Tr(r)?i.setAttribute("data-lexical-text","true"):ji(r)&&i.setAttribute("data-lexical-decorator","true"),Wi(r)){const e=r.__indent,t=r.__size;if(Ut$4(i,r),0!==e&&Jt$4(i,e),0!==t){const e=t-1;Yt$3(hl(r,Mt$3),r,0,e,Pt$4.$getDOMSlot(r,i,Tt$5))}const n=r.__format;0!==n&&jt$3(i,n),r.isInline()||Ht$4(null,r,i)}else{const t=r.getTextContent();if(ji(r)){const t=r.decorate(Tt$5,kt$3);null!==t&&Qt$3(e,t),i.contentEditable="false"}Ft$3+=t}return null!==n&&n.insertChild(i),Pt$4.$decorateDOM(r,null,i,Tt$5),xs(Dt$5,Nt$3,bt$3,r,"created"),i}function Yt$3(e,t,n,r,i){const o=Ft$3;Ft$3="";let s=n;for(;s<=r;++s){Vt$3(e[s],i);const t=Mt$3.get(e[s]);null!==t&&Tr(t)?null===Lt$4&&(Lt$4=t.getFormat(),It$2=t.getStyle()):Wi(t)&&s<r&&!t.isInline()&&(Ft$3+=D$4)}i.element.__lexicalTextContent=Ft$3,Ft$3=o+Ft$3}function qt$4(e,t){if(e){const n=e.__last;if(n){const e=t.get(n);if(e)return sr(e)?"line-break":ji(e)&&e.isInline()?"decorator":null}return"empty"}return null}function Ht$4(e,t,n){const r=qt$4(e,Ot$4),i=qt$4(t,Mt$3);r!==i&&Pt$4.$getDOMSlot(t,n,Tt$5).setManagedLineBreak(i)}function Gt$3(e,n,r){var i;Lt$4=null,It$2=null,function(e,n,r){const i=Ft$3,o=e.__size,s=n.__size;Ft$3="";const l=r.element;if(1===o&&1===s){const t=e.__first,r=n.__first;if(t===r)Xt$4(t,l);else{const e=ne$5(t),n=Vt$3(r,null);try{l.replaceChild(n,e)}catch(i){if("object"==typeof i&&null!=i){const o=`${i.toString()} Parent: ${l.tagName}, new child: {tag: ${n.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${t}}.`;throw new Error(o)}throw i}Rt$4(t,null)}const o=Mt$3.get(r);Tr(o)&&null===Lt$4&&(Lt$4=o.getFormat(),It$2=o.getStyle())}else{const i=hl(e,Ot$4),a=hl(n,Mt$3);if(i.length!==o&&t(227),a.length!==s&&t(228),0===o)0!==s&&Yt$3(a,0,0,s-1,r);
3else if(0===s){if(0!==o){const e=null==r.after&&null==r.before&&null==r.element.__lexicalLineBreak;Bt$4(i,0,o-1,e?null:l),e&&(l.textContent="")}}else!function(e,t,n,r,i,o){const s=r-1,l=i-1;let a,c,u=o.getFirstChild(),d=0,h=0;for(;d<=s&&h<=l;){const e=t[d],r=n[h];if(e===r)u=Zt$3(Xt$4(r,o.element)),d++,h++;else{if(void 0===c&&(c=te$5(n,h)),void 0===a)a=te$5(t,d);else if(!a.has(e)){d++;continue}if(!c.has(e)){u=Zt$3(ne$5(e)),Rt$4(e,o.element),d++,a.delete(e);continue}if(a.has(r)){const e=Ns(Tt$5,r);e!==u&&o.withBefore(u).insertChild(e),u=Zt$3(Xt$4(r,o.element)),d++,h++}else Vt$3(r,o.withBefore(u)),h++}const i=Mt$3.get(r);null!==i&&Tr(i)?null===Lt$4&&(Lt$4=i.getFormat(),It$2=i.getStyle()):Wi(i)&&h<=l&&!i.isInline()&&(Ft$3+=D$4)}const g=d>s,p=h>l;if(g&&!p){const e=n[l+1],t=void 0===e?null:Tt$5.getElementByKey(e);Yt$3(n,0,h,l,o.withBefore(t))}else p&&!g&&Bt$4(t,d,s,o.element)}(0,i,a,o,s,r)}l.__lexicalTextContent=Ft$3,Ft$3=i+Ft$3}(e,n,Pt$4.$getDOMSlot(n,r,Tt$5)),i=n,null==Lt$4||Lt$4===i.__textFormat||zt$5||i.setTextFormat(Lt$4),function(e){null==It$2||It$2===e.__textStyle||zt$5||e.setTextStyle(It$2)}(n)}function Xt$4(e,n){const r=Ot$4.get(e);let i=Mt$3.get(e);void 0!==r&&void 0!==i||t(61);const o=Kt$3||Et$4.has(e)||wt$3.has(e),s=Ns(Tt$5,e);if(r===i&&!o){let e;if(Wi(r)){const t=s.__lexicalTextContent;"string"==typeof t?e=t:(e=r.getTextContent(),s.__lexicalTextContent=e)}else e=r.getTextContent();return Ft$3+=e,s}if(r!==i&&o&&xs(Dt$5,Nt$3,bt$3,i,"updated"),Pt$4.$updateDOM(i,r,s,Tt$5)){const r=Vt$3(e,null);return null===n&&t(62),n.replaceChild(r,s),Rt$4(e,null),r}if(Wi(r)){Wi(i)||t(334,e);const n=i.__indent;(Kt$3||n!==r.__indent)&&Jt$4(s,n);const l=i.__format;if((Kt$3||l!==r.__format)&&jt$3(s,l),o)Gt$3(r,i,s),Vi(i)||i.isInline()||Ht$4(r,i,s);else{const e=s.__lexicalTextContent;let t;"string"==typeof e?t=e:(t=r.getTextContent(),s.__lexicalTextContent=t),Ft$3+=t}if((Kt$3||i.__dir!==r.__dir)&&(Ut$4(s,i),Vi(i)&&!Kt$3))for(const e of i.getChildren())Wi(e)&&Ut$4(Ns(Tt$5,e.getKey()),e)}else{const t=i.getTextContent();if(ji(i)){const t=i.decorate(Tt$5,kt$3);null!==t&&Qt$3(e,t)}Ft$3+=t}if(!zt$5&&Vi(i)&&i.__cachedText!==Ft$3){const e=i.getWritable();e.__cachedText=Ft$3,i=e}return Pt$4.$decorateDOM(i,r,s,Tt$5),s}function Qt$3(e,t){let n=Tt$5._pendingDecorators;const r=Tt$5._decorators;if(null===n){if(r[e]===t)return;n=Xo(Tt$5)}n[e]=t}function Zt$3(e){let t=e.nextSibling;return null!==t&&t===Tt$5._blockCursorElement&&(t=t.nextSibling),t}function te$5(e,t){const n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function ee$4(e,t,n,r,i,o){Ft$3="",Kt$3=2===r,Tt$5=n,kt$3=n._config,Pt$4=n._config.dom||po,Nt$3=n._nodes,bt$3=Tt$5._listeners.mutation,wt$3=i,Et$4=o,Ot$4=e._nodeMap,Mt$3=t._nodeMap,zt$5=t._readOnly,At$3=new Map(n._keyToDOMMap);const s=new Map;return Dt$5=s,Xt$4("root",null),Tt$5=void 0,Nt$3=void 0,wt$3=void 0,Et$4=void 0,Ot$4=void 0,Mt$3=void 0,kt$3=void 0,At$3=void 0,Dt$5=void 0,Pt$4=po,s}function ne$5(e){const n=At$3.get(e);return void 0===n&&t(75,e),n}function re$5(e){return{type:e}}function pn$1(e,t,n,r,i){const o=e.anchor,s=e.focus,l=o.getNode(),a=vi(),c=Js(Ps(a)),u=null!==c?c.anchorNode:null,d=o.key,h=a.getElementByKey(d),g=n.length;return d!==s.key||!Tr(l)||(!i&&(!s$1||rn$1<r+50)||l.isDirty()&&g<2||rs(n))&&o.offset!==s.offset&&!l.isComposing()||Io(l)||l.isDirty()&&g>1||(i||!s$1)&&null!==h&&!l.isComposing()&&u!==Ro(h)||null!==c&&null!==t&&(!t.collapsed||t.startContainer!==c.anchorNode||t.startOffset!==c.anchorOffset)||!l.isComposing()&&(l.getFormat()!==e.format||l.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;const n=e.anchor.offset,r=t.getParentOrThrow(),i=Lo(t);return 0===n?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){const t=e.getPreviousSibling();return(Tr(t)||Wi(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,l)}function yn$1(e,t){return Ko(e)&&null!==e.nodeValue&&0!==t&&t!==e.nodeValue.length}function mn$1(e,n,r){const{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:l}=e;cn$1&&(cn$1=!1,yn$1(i,o)&&yn$1(s,l)&&!gn$1)||Ki(n,(()=>{if(!r)return void es(null);if(!Mo(n,i,s))return;let a=Qr();if(gn$1&&Fr(a)&&a.isCollapsed()){const e=a.anchor,t=gn$1.anchor;(e.key===t.key&&e.offset===t.offset+1||1===e.offset&&t.getNode().is(e.getNode().getPreviousSibling()))&&(a=gn$1.clone(),es(a))}if(gn$1=null,Fr(a)){const r=a.anchor,i=r.getNode();if(a.isCollapsed()){"Range"===e.type&&e.anchorNode===e.focusNode&&(a.dirty=!0);const o=Ps(n).event,s=o?o.timeStamp:performance.now(),[l,c,u,d,h]=_n$1,g=Zo(),p=!1===n.isComposing()&&""===g.getTextContent();if(s<h+200&&r.offset===u&&r.key===d)xn$1(a,l,c);else if("text"===r.type)Tr(i)||t(141),Cn$1(a,i);else if("element"===r.type&&!p){Wi(i)||t(259);const e=r.getNode();e.isEmpty()?function(e,t){xn$1(e,t.getTextFormat(),t.getTextStyle())}(a,e):xn$1(a,a.format,"")}}else{const e=r.key,t=a.focus.key,n=a.getNodes(),i=n.length,s=a.isBackward(),c=s?l:o,u=s?o:l,d=s?t:e,h=s?e:t;let g=2047,p=!1;for(let e=0;e<i;e++){const t=n[e],r=t.getTextContentSize();if(Tr(t)&&0!==r&&!(0===e&&t.__key===d&&c===r||e===i-1&&t.__key===h&&0===u)&&(p=!0,g&=t.getFormat(),0===g))break}a.format=p?g:0}}Ts(n,ie$4,void 0)}))}function xn$1(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Cn$1(e,t){xn$1(e,t.getFormat(),t.getStyle())}function Sn$1(e){if(!e.getTargetRanges)return null;const t=e.getTargetRanges();return 0===t.length?null:t[0]}function vn$1(e){const n=e.inputType,r=Sn$1(e),i=vi(),o=Qr();if("deleteContentBackward"===n){if(null===o){const e=Zr();if(!Fr(e))return!0;es(e.clone())}if(Fr(o)){const n=o.anchor.key===o.focus.key;if(s=e.timeStamp,"MediaLast"===nn$1&&s<en$1+30&&i.isComposing()&&n){if(Uo(null),en$1=0,setTimeout((()=>{Ki(i,(()=>{Uo(null)}))}),30),Fr(o)){const e=o.anchor.getNode();e.markDirty(),Tr(e)||t(142),Cn$1(o,e)}}else{Uo(null),e.preventDefault();const t=o.anchor.getNode(),r=t.getTextContent(),s=t.canInsertTextAfter(),l=0===o.anchor.offset&&o.focus.offset===r.length;let a=f&&n&&!l&&s;if(a&&o.isCollapsed()&&(a=!ji(vs(o.anchor,!0))),!a){Ts(i,fe$4,!0);const e=Qr();f&&Fr(e)&&e.isCollapsed()&&(gn$1=e,setTimeout((()=>gn$1=null)))}}return!0}}var s;if(!Fr(o))return!0;const a=e.data;null!==on$1&&ls(!1,i,on$1),o.dirty&&null===on$1||!o.isCollapsed()||Vi(o.anchor.getNode())||null===r||o.applyDOMRange(r),on$1=null;const c=o.anchor,u=o.focus,d=c.getNode(),h=u.getNode();if("insertText"===n||"insertTranspose"===n){if("\n"===a)e.preventDefault(),Ts(i,de$4,!1);else if(a===D$4)e.preventDefault(),Ts(i,he$3,void 0);else if(null==a&&e.dataTransfer){const t=e.dataTransfer.getData("text/plain");e.preventDefault(),o.insertRawText(t)}else null!=a&&pn$1(o,r,a,e.timeStamp,!0)?(e.preventDefault(),Ts(i,ge$3,a)):on$1=a;return rn$1=e.timeStamp,!0}switch(e.preventDefault(),n){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Ts(i,ge$3,e);break;case"insertFromComposition":Uo(null),Ts(i,ge$3,e);break;case"insertLineBreak":Uo(null),Ts(i,de$4,!1);break;case"insertParagraph":Uo(null),un$1&&!l?(un$1=!1,Ts(i,de$4,!1)):Ts(i,he$3,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Ts(i,_e$2,e);break;case"deleteByComposition":(function(e,t){return e!==t||Wi(e)||Wi(t)||!Lo(e)||!Lo(t)})(d,h)&&Ts(i,pe$3,e);break;case"deleteByDrag":Os(Hn),Ts(i,pe$3,e);break;case"deleteByCut":Ts(i,pe$3,e);break;case"deleteContent":Ts(i,fe$4,!1);break;case"deleteWordBackward":Ts(i,ye$2,!0);break;
3case"deleteWordForward":Ts(i,ye$2,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Ts(i,me$3,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Ts(i,me$3,!1);break;case"formatStrikeThrough":Ts(i,xe,"strikethrough");break;case"formatBold":Ts(i,xe,"bold");break;case"formatItalic":Ts(i,xe,"italic");break;case"formatUnderline":Ts(i,xe,"underline");break;case"historyUndo":Ts(i,Ce$2,void 0);break;case"historyRedo":Ts(i,Se$2,void 0)}return!0}function kn$1(e){if(Ys(e.target)&&Eo(e.target))return!0;const t=vi(),n=Qr(),r=e.data,i=Sn$1(e);if(null!=r&&Fr(n)&&pn$1(n,i,r,e.timeStamp,!1)){fn$1&&(bn$1(t,r),fn$1=!1);const i=n.anchor.getNode(),o=Js(Ps(t));if(null===o)return!0;const s=n.isBackward(),l=s?n.anchor.offset:n.focus.offset,a=s?n.focus.offset:n.anchor.offset;s$1&&!n.isCollapsed()&&Tr(i)&&null!==o.anchorNode&&i.getTextContent().slice(0,l)+r+i.getTextContent().slice(l+a)===ss(o.anchorNode)||Ts(t,ge$3,r);const c=r.length;o$1&&c>1&&"insertCompositionText"===e.inputType&&!t.isComposing()&&(n.anchor.offset-=c),f&&t.isComposing()&&(en$1=0,Uo(null))}else ls(!1,t,null!==r?r:void 0),fn$1&&(bn$1(t,r||void 0),fn$1=!1);return function(){xi();nt$4(vi())}(),!0}function Tn$1(e){const t=vi(),n=Qr();if(Fr(n)&&!t.isComposing()){const r=n.anchor,i=n.anchor.getNode();Uo(r.key),Os(Gn),(e.timeStamp<en$1+30||"element"===r.type||!n.isCollapsed()||i.getFormat()!==n.format||Tr(i)&&i.getStyle()!==n.style)&&Ts(t,ge$3,P$3)}return!0}function Nn$1(e){return bn$1(vi(),e.data),Os(Xn),!0}function bn$1(e,t){const n=e._compositionKey;if(Uo(null),null!==n&&null!=t){if(""===t){const t=Yo(n),r=Ro(e.getElementByKey(n));if(null!==r&&null!==r.nodeValue&&Tr(t)){const n=Js(Ps(e));let i=null,o=null;null!==n&&n.anchorNode===r&&(i=n.anchorOffset,o=n.focusOffset),cs(t,r.nodeValue,i,o,!0)}return}if("\n"===t[t.length-1]){const t=Qr();if(Fr(t)||Ir(t)){if(Fr(t)){const e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return void Ts(e,Oe$2,null)}}}ls(!0,e,t)}function wn$1(e){const t=vi();if(null==e.key)return!0;if(dn$1){if(_s(e))return Ki(t,(()=>{bn$1(t,hn$1)})),dn$1=!1,hn$1="",!0;dn$1=!1,hn$1=""}if(function(e){return ds(e,"ArrowRight",{shiftKey:"any"})}(e))Ts(t,ke$2,e);else if(function(e){return ds(e,"ArrowRight",hs)}(e))Ts(t,Te$2,e);else if(function(e){return ds(e,"ArrowLeft",{shiftKey:"any"})}(e))Ts(t,Ne$1,e);else if(function(e){return ds(e,"ArrowLeft",hs)}(e))Ts(t,be$1,e);else if(function(e){return ds(e,"ArrowUp",{altKey:"any",shiftKey:"any"})}(e))Ts(t,we$1,e);else if(function(e){return ds(e,"ArrowDown",{altKey:"any",shiftKey:"any"})}(e))Ts(t,Ee$3,e);else if(function(e){return ds(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})}(e))un$1=!0,Ts(t,Oe$2,e);else if(function(e){return" "===e.key}(e))Ts(t,Me$2,e);else if(function(e){return i&&ds(e,"o",{ctrlKey:!0})}(e))e.preventDefault(),un$1=!0,Ts(t,de$4,!0);else if(function(e){return ds(e,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})}(e))un$1=!1,Ts(t,Oe$2,e);else if(function(e){return ds(e,"Backspace",{shiftKey:"any"})||i&&ds(e,"h",{ctrlKey:!0})}(e))_s(e)?Ts(t,Ae$3,e):(e.preventDefault(),Ts(t,fe$4,!0));else if(function(e){return"Escape"===e.key}(e))Ts(t,De$2,e);else if(function(e){return ds(e,"Delete",{})||i&&ds(e,"d",{ctrlKey:!0})}(e))!function(e){return"Delete"===e.key}(e)?(e.preventDefault(),Ts(t,fe$4,!1)):Ts(t,Pe$2,e);else if(function(e){return ds(e,"Backspace",gs)}(e))e.preventDefault(),Ts(t,ye$2,!0);else if(function(e){return ds(e,"Delete",gs)}(e))e.preventDefault(),Ts(t,ye$2,!1);else if(function(e){return i&&ds(e,"Backspace",{metaKey:!0})}(e))e.preventDefault(),Ts(t,me$3,!0);else if(function(e){return i&&(ds(e,"Delete",{metaKey:!0})||ds(e,"k",{ctrlKey:!0}))}(e))e.preventDefault(),Ts(t,me$3,!1);else if(function(e){return ds(e,"b",hs)}(e))e.preventDefault(),Ts(t,xe,"bold");else if(function(e){return ds(e,"u",hs)}(e))e.preventDefault(),Ts(t,xe,"underline");else if(function(e){return ds(e,"i",hs)}(e))e.preventDefault(),Ts(t,xe,"italic");else if(function(e){return ds(e,"Tab",{shiftKey:"any"})}(e))Ts(t,Fe$2,e);else if(function(e){return ds(e,"z",hs)}(e))e.preventDefault(),Ts(t,Ce$2,void 0);else if(function(e){return i?ds(e,"z",{metaKey:!0,shiftKey:!0}):ds(e,"y",{ctrlKey:!0})||ds(e,"z",{ctrlKey:!0,shiftKey:!0})}(e))e.preventDefault(),Ts(t,Se$2,void 0);else{const n=t._editorState._selection;null===n||Fr(n)?ps(e)&&(e.preventDefault(),Ts(t,Ue$2,e)):function(e){return ds(e,"c",hs)}(e)?(e.preventDefault(),Ts(t,Je$2,e)):function(e){return ds(e,"x",hs)}
3(e)?(e.preventDefault(),Ts(t,je$2,e)):ps(e)&&(e.preventDefault(),Ts(t,Ue$2,e))}return function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(Qe$1,e),!0}function En$1(e){let t=e.__lexicalEventHandles;return void 0===t&&(t=[],e.__lexicalEventHandles=t),t}function Mn(e){const t=js(e.target);if(null===t)return;const n=Do(t.anchorNode);if(null===n)return;an$1&&(an$1=!1,Ki(n,(()=>{const r=Zr(),i=t.anchorNode;(Ys(i)||Ko(i))&&es(Xr(r,t,n,e))})));const r=is(n),i=r[r.length-1],o=i._key,s=On$1.get(o),l=s||i;l!==n&&mn$1(t,l,!1),mn$1(t,n,!0),n!==i?On$1.set(o,n):s&&On$1.delete(o)}function An$1(e){e._lexicalHandled=!0}function Dn(e){return!0===e._lexicalHandled}function Fn$1(e){const n=sn$1.get(e);if(void 0===n)return;const r=ln$1.get(n);if(void 0===r)return;const i=r-1;i>=0||t(164),sn$1.delete(e),ln$1.set(n,i),0===i&&n.removeEventListener("selectionchange",Mn);const o=Po(e);Ao(o)?(function(e){if(null!==e._parentEditor){const t=is(e),n=t[t.length-1]._key;On$1.get(n)===e&&On$1.delete(n)}else On$1.delete(e._key)}(o),e.__lexicalEditor=null):o&&t(198);const s=En$1(e);for(let e=0;e<s.length;e++)s[e]();e.__lexicalEventHandles=[]}function Ln(e,t,n){xi();const r=e.__key,i=e.getParent();if(null===i)return;const o=function(e){const t=Qr();if(!Fr(t)||!Wi(e))return t;const{anchor:n,focus:r}=t,i=n.getNode(),o=r.getNode();return As(i,e)&&n.set(e.__key,0,"element"),As(o,e)&&r.set(e.__key,0,"element"),t}(e);let s=!1;if(Fr(o)&&t){const t=o.anchor,n=o.focus;t.key===r&&(ni(t,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0),n.key===r&&(ni(n,e,i,e.getPreviousSibling(),e.getNextSibling()),s=!0)}else Ir(o)&&t&&e.isSelected()&&e.selectPrevious();if(Fr(o)&&t&&!s){const t=e.getIndexWithinParent();Jo(e),ti(o,i,t,-1)}else Jo(e);n||Is(i)||i.canBeEmpty()||!i.isEmpty()||Ln(i,t),t&&o&&Vi(i)&&i.isEmpty()&&i.selectEnd()}function In(e){return e}function zn(e){return e[Kn$1]||!1}function Bn(e){return e instanceof Rn$1}function Zn(e){const t={};if(!e)return t;let n="",r="",i=null,o=!1,s=!1,l=!1,a=0;for(let c=0;c<e.length;c++){const u=e[c];if(o)"*"===u&&"/"===e[c+1]&&(o=!1,c++);else if(s)l?r+=u:n+=u,s=!1;else if(null===i)if("/"!==u||"*"!==e[c+1])if('"'!==u&&"'"!==u)if("("!==u)if(")"!==u)if(l||":"!==u||0!==a){if(";"===u&&0===a){const e=n.trim(),i=r.trim();""!==e&&""!==i&&(t[e]=i),n="",r="",l=!1;continue}l?r+=u:n+=u}else l=!0;else a=Math.max(0,a-1),l?r+=u:n+=u;else a++,l?r+=u:n+=u;else i=u,l?r+=u:n+=u;else o=!0,c++;else l?r+=u:n+=u,"\\"===u?s=!0:u===i&&(i=null)}const c=n.trim(),u=r.trim();return""!==c&&""!==u&&(t[c]=u),t}function tr(e,t,n){const r=Qn.test(n)?"important":"",i=""===r?n:n.replace(Qn,"").trim();e.setProperty(t,i,r)}function er(e,t){for(const n in t){const r=t[n];null==r?e.removeProperty(n):tr(e,n,r)}}function nr(e,t,n=""){if(t===n)return;const r=Zn(n),i=Zn(t);for(const t in i)delete r[t],tr(e,t,i[t]);for(const t in r)e.removeProperty(t)}function ir(){return{node:or()}}function or(){return zs(new rr)}function sr(e){return e instanceof rr}function lr(e){return Ko(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||"")}function cr(e,t){return 16&t?"code":t&k$3?"mark":32&t?"sub":64&t?"sup":null}function ar(e,t){return 1&t?"strong":2&t?"em":"span"}function ur(e,t,n,r,i){const o=r.classList;let s=ms(i,"base");void 0!==s&&o.add(...s),s=ms(i,"underlineStrikethrough");let l=!1;const a=8&t&&4&t;void 0!==s&&(8&n&&4&n?(l=!0,a||o.add(...s)):a&&o.remove(...s));for(const e in z$7){const r=z$7[e];if(s=ms(i,e),void 0!==s)if(n&r){if(l&&("underline"===e||"strikethrough"===e)){t&r&&o.remove(...s);continue}(!(t&r)||a&&"underline"===e||"strikethrough"===e)&&o.add(...s)}else t&r&&o.remove(...s)}}function fr(e,t,n){const r=t.firstChild,i=n.isComposing(),o=e+(i?A$3:"");if(null==r)t.textContent=o;else{const e=r.nodeValue;if(e!==o)if(i||o$1){const[t,n,i]=function(e,t){const n=e.length,r=t.length;let i=0,o=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;o+i<n&&o+i<r&&e[n-o-1]===t[r-o-1];)o++;return[i,n-i-o,t.slice(i,r-o)]}(e,o);0!==n&&r.deleteData(t,n),r.insertData(t,i)}else r.nodeValue=o}}function dr(e,t,n,r,i,o){fr(i,e,t);const s=o.theme.text;void 0!==s&&ur(0,0,r,e,s)}function hr(e,t){const n=document.createElement(t);return n.appendChild(e),n}function _r(e){return{forChild:Nr(e.style),node:null}}function pr(e){const t=e,n="normal"===t.style.fontWeight;return{forChild:Nr(t.style,n?void 0:"bold"),node:null}}function mr(e){if(!Ys(e))return!1;
vendor: 7,644 bytes, line 3
3if("PRE"===e.nodeName)return!0;const t=e.style.whiteSpace;return"string"==typeof t&&t.startsWith("pre")}function xr(e){const n=e;null===e.parentElement&&t(129);let r=n.textContent||"";if(null!==function(e){let t,n=e.parentNode;const r=[e];for(;null!==n&&void 0===(t=yr.get(n))&&!mr(n);)r.push(n),n=n.parentNode;const i=void 0===t?n:t;for(let e=0;e<r.length;e++)yr.set(r[e],i);return i}(n)){const e=r.split(/(\r?\n|\t)/),t=[],n=e.length;for(let r=0;r<n;r++){const n=e[r];"\n"===n||"\r\n"===n?t.push(or()):"\t"===n?t.push(wr()):""!==n&&t.push(kr(n))}return{node:t}}if(r=r.replace(/\r/g,"").replace(/[ \t\n]+/g," "),""===r)return{node:null};if(" "===r[0]){let e=n,t=!0;for(;null!==e&&null!==(e=Cr(e,!1));){const n=e.textContent||"";if(n.length>0){/[ \t\n]$/.test(n)&&(r=r.slice(1)),t=!1;break}}t&&(r=r.slice(1))}if(" "===r[r.length-1]){let e=n,t=!0;for(;null!==e&&null!==(e=Cr(e,!0));)if((e.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){t=!1;break}t&&(r=r.slice(0,r.length-1))}return""===r?{node:null}:{node:kr(r)}}function Cr(e,t){let n=e;for(;;){let e;for(;null===(e=t?n.nextSibling:n.previousSibling);){const e=n.parentElement;if(null===e)return null;n=e}if(n=e,Ys(n)){const e=n.style.display;if(""===e&&!Gs(n)||""!==e&&!e.startsWith("inline"))return null}let r=n;for(;null!==(r=t?n.firstChild:n.lastChild);)n=r;if(Ko(n))return n;if("BR"===n.nodeName)return null}}function vr(e){const t=Sr[e.nodeName.toLowerCase()];return void 0===t?{node:null}:{forChild:Nr(e.style,t),node:null}}function kr(e=""){return zs(new gr(e))}function Tr(e){return e instanceof gr}function Nr(e,t){const n=e.fontWeight,r=e.textDecoration.split(" "),i="700"===n||"bold"===n,o=r.includes("line-through"),s="italic"===e.fontStyle,l=r.includes("underline"),a=e.verticalAlign;return e=>Tr(e)?(i&&!e.hasFormat("bold")&&e.toggleFormat("bold"),o&&!e.hasFormat("strikethrough")&&e.toggleFormat("strikethrough"),s&&!e.hasFormat("italic")&&e.toggleFormat("italic"),l&&!e.hasFormat("underline")&&e.toggleFormat("underline"),"sub"!==a||e.hasFormat("subscript")||e.toggleFormat("subscript"),"super"!==a||e.hasFormat("superscript")||e.toggleFormat("superscript"),t&&!e.hasFormat(t)&&e.toggleFormat(t),e):e}function wr(){return zs(new br)}function Er(e){return e instanceof br}function Mr(e,t,n){return new Or(e,t,n)}function Ar(e,t){let n=t.__key,r=e.offset,i="element";if(Tr(t)){i="text";const e=t.getTextContentSize();r>e&&(r=e)}else if(!Wi(t)){const e=t.getNextSibling();if(Tr(e))n=e.__key,r=0,i="text";else{const e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function Dr(e,t){if(Wi(t)){const n=t.getLastDescendant();Wi(n)||Tr(n)?Ar(e,n):Ar(e,t)}else Ar(e,t)}function Fr(e){return e instanceof Lr}function Ir(e){return e instanceof Pr}function Kr(e){const t=e.offset;if("text"===e.type)return t;const n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function zr(e){const t=e.getStartEndPoints();if(null===t)return[0,0];const[n,r]=t;return"element"===n.type&&"element"===r.type&&n.key===r.key&&n.offset===r.offset?[0,0]:[Kr(n),Kr(r)]}function Rr(e,t){for(let n=t;n;n=n.getParent()){if(Wi(n)){if(n.collapseAtStart(e))return!0;if(Is(n))break}if(n.getPreviousSibling())break}return!1}function Wr(e,t,n){const r=e,i=r.getTextContent().split(/(?=\s)/g),o=i.length;let s=0,l=0;for(let e=0;e<o;e++){const r=e===o-1;if(l=s,s+=i[e].length,t&&s===n||s>n||r){i.splice(e,1),r&&(l=void 0);break}}const a=i.join("").trim();""===a?r.remove():(r.setTextContent(a),r.select(l,l))}function $r(e,n,r,i){let o,s=n;if(Ys(e)){let l=!1;const a=e.childNodes,c=a.length,u=i._blockCursorElement;s===c&&(l=!0,s=c-1);let d=a[s],h=!1;if(d===u)d=a[s+1],h=!0;else if(null!==u){const t=u.parentNode;e===t&&n>Array.prototype.indexOf.call(t.children,u)&&s--}if(o=ns(d),Tr(o))s=Al(o,l?"next":"previous");else{let a=ns(e);if(null===a)return null;if(Wi(a)){const c=i.getElementByKey(a.getKey());null===c&&t(214);const u=tl(i).$getDOMSlot(a,c,i);[a,s]=u.resolveChildIndex(a,c,e,n),Wi(a)||t(215),l&&s>=a.getChildrenSize()&&(s=Math.max(0,a.getChildrenSize()-1));let d=a.getChildAtIndex(s);if(Wi(d)&&function(e,t,n){const r=e.getParent();return null===n||null===r||!r.canBeEmpty()||r!==n.getNode()}(d,0,r)){const e=l?d.getLastDescendant():d.getFirstDescendant();null===e?a=d:(d=e,a=Wi(d)?d:d.getParentOrThrow()),s=0}Tr(d)?(o=d,a=null,s=Al(d,l?"next":"previous")):d!==a&&l&&!h&&(Wi(a)||t(216),s=Math.min(a.getChildrenSize(),s+1))}else{const t=a.getIndexWithinParent();s=0===n&&ji(a)&&ns(e)===a?t:t+1,a=a.getParentOrThrow()}if(Wi(a))return Mr(a.__key,s,"element")}}else o=ns(e);return Tr(o)?Mr(o.__key,Al(o,s,"clamp"),"text"):null}function Jr(e,t,n){const r=e.offset,i=e.getNode();if(0===r){const r=i.getPreviousSibling(),o=i.getParent();if(t){if((n||!t)&&null===r&&Wi(o)&&o.isInline()){const t=o.getPreviousSibling();Tr(t)&&e.set(t.__key,t.getTextContent().length,"text")}}else Wi(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),"element"):Tr(r)&&e.set(r.__key,r.getTextContent().length,"text")}else if(r===i.getTextContent().length){const r=i.getNextSibling(),o=i.getParent();if(t&&Wi(r)&&r.isInline())e.set(r.__key,0,"element");else if((n||t)&&null===r&&Wi(o)&&o.isInline()&&!o.canInsertTextAfter()){const t=o.getNextSibling();Tr(t)&&e.set(t.__key,0,"text")}}}function jr(e,t){if("text"===e.type&&"text"===t.type){const n=e.isBefore(t),r=e.is(t);Jr(e,n,r),Jr(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}function Ur(e,t,n,r,i,o){if(null===e||null===n||!Mo(i,e,n))return null;const s=$r(e,t,Fr(o)?o.anchor:null,i);if(null===s)return null;const l=$r(n,r,Fr(o)?o.focus:null,i);if(null===l)return null;if("element"===s.type&&"element"===l.type){const t=ns(e),r=ns(n);if(ji(t)&&ji(r))return null}return jr(s,l),[s,l]}function Vr(e){return Wi(e)&&!e.isInline()}function Yr(e,t,n,r,i,o){const s=Si(),l=new Lr(Mr(e,t,i),Mr(n,r,o),0,"");return l.dirty=!0,s._selection=l,l}function qr(){const e=Mr("root",0,"element"),t=Mr("root",0,"element");return new Lr(e,t,0,"")}function Hr(){return new Pr(new Set)}function Gr(e,t){return Xr(null,e,t,null)}function Xr(e,t,n,r){const i=n._window;if(null===i)return null;const o=r||i.event,s=o?o.type:void 0,l="selectionchange"===s,a=!q$7&&(l||"beforeinput"===s||"compositionstart"===s||"compositionend"===s||"click"===s&&o&&3===o.detail||"drop"===s||void 0===s);let c,u,d,h;if(Fr(e)&&!a)return e.clone();if(null===t)return null;if(c=t.anchorNode,u=t.focusNode,d=t.anchorOffset,h=t.focusOffset,(l||void 0===s)&&Fr(e)&&!Mo(n,c,u))return e.clone();const g=Ur(c,d,u,h,n,e);if(null===g)return null;const[p,f]=g;let m=0,y="";if(Fr(e)){const t=e.anchor;if(p.key===t.key)m=e.format,y=e.style;else{const e=p.getNode();Tr(e)?(m=e.getFormat(),y=e.getStyle()):Wi(e)&&(m=e.getTextFormat(),y=e.getTextStyle())}}return new Lr(p,f,m,y)}function Qr(){return Si()._selection}function Zr(){return vi()._editorState._selection}function ti(e,t,n,r=1){const i=e.anchor,o=e.focus,s=i.getNode(),l=o.getNode();if(!t.is(s)&&!t.is(l))return;const a=t.__key;if(e.isCollapsed()){const t=i.offset;if(n<=t&&r>0||n<t&&r<0){const n=Math.max(0,t+r);i.set(a,n,"element"),o.set(a,n,"element"),ei(e)}}else{const s=e.isBackward(),l=s?o:i,c=l.getNode(),u=s?i:o,d=u.getNode();if(t.is(c)){const e=l.offset;(n<=e&&r>0||n<e&&r<0)&&l.set(a,Math.max(0,e+r),"element")}if(t.is(d)){const e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(a,Math.max(0,e+r),"element")}}ei(e)}function ei(e){const t=e.anchor,n=t.offset,r=e.focus,i=r.offset,o=t.getNode(),s=r.getNode();if(e.isCollapsed()){if(!Wi(o))return;const e=o.getChildrenSize(),i=n>=e,s=i?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(Tr(s)){let e=0;i&&(e=s.getTextContentSize()),t.set(s.__key,e,"text"),r.set(s.__key,e,"text")}}
3else{if(Wi(o)){const e=o.getChildrenSize(),r=n>=e,i=r?o.getChildAtIndex(e-1):o.getChildAtIndex(n);if(Tr(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,"text")}}if(Wi(s)){const e=s.getChildrenSize(),t=i>=e,n=t?s.getChildAtIndex(e-1):s.getChildAtIndex(i);if(Tr(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,"text")}}}}function ni(e,t,n,r,i){let o=null,s=0,l=null;null!==r?(o=r.__key,Tr(r)?(s=r.getTextContentSize(),l="text"):Wi(r)&&(s=r.getChildrenSize(),l="element")):null!==i&&(o=i.__key,Tr(i)?l="text":Wi(i)&&(l="element")),null!==o&&null!==l?e.set(o,s,l):(s=t.getIndexWithinParent(),-1===s&&(s=n.getChildrenSize()),e.set(n.__key,s,"element"))}function ri(e,t,n,r,i){"text"===e.type?e.set(n,e.offset+(t?0:i),"text"):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,"element")}function ii(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch(e){}}function oi(e,t,n){const r=Ns(e,t.getKey());if(Wi(t)){const i=tl(e).$getDOMSlot(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function si(e,t,n,r,i,o){const s=r.anchorNode,l=r.focusNode,a=r.anchorOffset,c=r.focusOffset,u=document.activeElement;if(i.has(Un)&&u!==o||null!==u&&Oo(u))return;if(!Fr(t))return void(null!==e&&Mo(n,s,l)&&r.removeAllRanges());const d=t.anchor,h=t.focus,g=d.getNode(),p=h.getNode(),[f,m]=oi(n,g,d.offset),[y,b]=oi(n,p,h.offset),$=t.format,_=t.style,C=t.isCollapsed();let x=f,S=y,T=!1;var E,v,w,k,N;if("text"===d.type?(x=Ro(f),T=g.getFormat()!==$||g.getStyle()!==_):Fr(e)&&"text"===e.anchor.type&&(T=!0),"text"===h.type&&(S=Ro(y)),null!==x&&null!==S&&(C&&(null===e||T||Fr(e)&&(e.format!==$||e.style!==_))&&(E=$,v=_,w=m,k=d.key,N=performance.now(),_n$1=[E,v,w,k,N]),a!==m||c!==b||s!==x||l!==S||"Range"===r.type&&C||(null!==u&&o.contains(u)||i.has(Hn)||o.focus({preventScroll:!0}),"element"===d.type))){if(ii(r,x,m,S,b), 4!o$1||!t.isCollapsed()||null===o||i.has(Hn)||null!==document.activeElement&&o.contains(document.activeElement)||o.focus({preventScroll:!0}),!i.has(Yn)&&t.isCollapsed()&&null!==o&&o===document.activeElement){const e=Fr(t)&&"element"===t.anchor.type?x.childNodes[m]||null:r.rangeCount>0?r.getRangeAt(0):null;if(null!==e){let t;if(e instanceof Text){const n=document.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=e.getBoundingClientRect();!function(e,t,n){const r=ws(n),i=Ds(r);if(null===r||null===i)return;let{top:o,bottom:s}=t,l=0,a=0,c=n;for(;null!==c;){const t=c===r.body;if(t){l=0,a=Ps(e).innerHeight;const t=i.getComputedStyle(r.documentElement),n=parseFloat(t.scrollPaddingTop),o=parseFloat(t.scrollPaddingBottom);isFinite(n)&&(l+=n),isFinite(o)&&(a-=o)}else{const e=c.getBoundingClientRect();l=e.top,a=e.bottom}let n=0;if(o<l?n=-(l-o):s>a&&(n=s-a),0!==n)if(t)i.scrollBy(0,n);else{const e=c.scrollTop;c.scrollTop+=n;const t=c.scrollTop-e;o-=t,s-=t}if(t)break;c=bs(c)}}(n,t,o)}}cn$1=!0}}function li(e){let t=Qr()||Zr();null===t&&(t=Zo().selectEnd()),t.insertNodes(e)}function ci(){const e=Qr();return null===e?"":e.getTextContent()}function ai(e){let n=e;e.isCollapsed()||n.removeText();const r=Qr();Fr(r)&&(n=r),Fr(n)||t(161);const i=n.anchor;let o=i.getNode(),s=i.offset;for(;!Qs(o);){const e=o;if([o,s]=ui(o,s),e.is(o))break}return s}function ui(e,t){const n=e.getParent();if(!n){const e=eo();return Zo().append(e),e.select(),[Zo(),0]}if(Tr(e)){const r=e.splitText(t);if(0===r.length)return[n,e.getIndexWithinParent()];const i=0===t?0:1;return[n,r[0].getIndexWithinParent()+i]}if(!Wi(e)||0===t)return[n,e.getIndexWithinParent()];const r=e.getChildAtIndex(t);if(r){const n=new Lr(Mr(e.__key,t,"element"),Mr(e.__key,t,"element"),0,""),i=e.insertNewAfter(n);i&&i.append(r,...r.getNextSiblings())}return[n,e.getIndexWithinParent()+1]}function fi(e,t,n,r,i="decorators-and-blocks"){if("move"===t&&"character"===r&&!e.isCollapsed()){const[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}const o=ql(e.focus,n?"previous":"next"),s="lineboundary"===r,l="move"===t;let a=o,c="decorators-and-blocks"===i;if(!ic(a)){for(const e of a){c=!1;const{origin:t}=e;if(!ji(t)||t.isIsolated()||(a=e,!s||!t.isInline()))break}if(c)for(const e of Rl(o).iterNodeCarets("extend"===t?"shadowRoot":"root")){if(Nl(e))e.origin.isInline()||(a=e);else{if(Wi(e.origin))continue;ji(e.origin)&&!e.origin.isInline()&&(a=e)}break}}if(a===o)return!1;if(l&&!s&&ji(a.origin)&&a.origin.isKeyboardSelectable()){const e=Hr();return e.add(a.origin.getKey()),es(e),!0}
vendor: 11,432 bytes, line 4
4return a=rc(a),l&&Hl(e.anchor,a),Hl(e.focus,a),c||!s}function mi(){return gi||null!==di&&di._readOnly}function xi(){gi&&t(13)}function Ci(){pi>99&&t(14)}function Si(){return null===di&&t(195,ki()),di}function vi(){return null===hi&&t(337,ki()),hi}function ki(){let e=0;const t=new Set,n=Co.version;if("undefined"!=typeof window)for(const r of document.querySelectorAll("[contenteditable]")){const i=Po(r);if(Ao(i))e++;else if(i){let e=String(i.constructor.version||"<0.17.1");e===n&&(e+=" (separately built, likely a bundler configuration issue)"),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(", ")}`),r}function Ti(){return hi}function Ni(e,t,n){const r=t.__type,i=No(e,r);let o=n.get(r);void 0===o&&(o=Array.from(i.transforms),n.set(r,o));const s=o.length;for(let e=0;e<s&&(o[e](t),t.isAttached());e++);}function bi(e,t){return void 0!==e&&e.__key!==t&&e.isAttached()}function wi(e,t){if(!t)return;const n=e._updateTags;let r=t;Array.isArray(t)||(r=[t]);for(const e of r)n.add(e)}function Ei(e){return Oi(e,vi()._nodes)}function Oi(e,n){const r=e.type,i=n.get(r);void 0===i&&t(17,r);const o=i.klass;e.type!==o.getType()&&t(18,o.name);const s=o.importJSON(e),l=e.children;if(Wi(s)&&Array.isArray(l))for(let e=0;e<l.length;e++){const t=Oi(l[e],n);s.append(t)}return s}function Mi(e,t,n){const r=di,i=gi,o=hi;di=t,gi=!0,hi=e;try{return n()}finally{di=r,gi=i,hi=o}}function Ai(e,t){const n=e._pendingEditorState,r=e._rootElement,i=e._headless||null===r;if(null===n)return void(e._deferred.length>0&&Fi(e,e._deferred));const o=e._editorState,s=o._selection,l=n._selection,a=0!==e._dirtyType,c=di,u=gi,d=hi,h=e._updating,g=e._observer;let p=null;if(e._pendingEditorState=null,e._editorState=n,!i&&a&&null!==g){hi=e,di=n,gi=!1,e._updating=!0;try{const t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;g.disconnect(),p=ee$4(o,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),_i)throw t;return go(e,null,r,n),rt$4(e),e._dirtyType=2,_i=!0,Ai(e,o),void(_i=!1)}finally{g.observe(r,yi),e._updating=h,di=c,gi=u,hi=d}}n._readOnly||(n._readOnly=!0);const f=e._dirtyLeaves,m=e._dirtyElements,y=e._normalizedNodes,b=e._updateTags,$=e._deferred;a&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set,e._updateTags=new Set),function(e,t){const n=e._decorators;let r=e._pendingDecorators||n;const i=t._nodeMap;let o;for(o in r)i.has(o)||(r===n&&(r=Xo(e)),delete r[o])}(e,n);const _=i?null:Js(Ps(e));if(e._editable&&null!==_&&(a||null===l||l.dirty||!l.is(s))&&null!==r&&!b.has(qn)){hi=e,di=n;try{if(null!==g&&g.disconnect(),a||null===l||l.dirty){const t=e._blockCursorElement;null!==t&&$s(t,e,r),si(s,l,e,_,b,r)}!function(e,t,n){let r=e._blockCursorElement;if(Fr(n)&&n.isCollapsed()&&"element"===n.anchor.type&&t.contains(document.activeElement)){const i=n.anchor,o=i.getNode(),s=i.offset;let l=!1,a=null;if(s===o.getChildrenSize())Ws(o.getChildAtIndex(s-1))&&(l=!0);else{const t=o.getChildAtIndex(s);if(null!==t&&Ws(t)){const n=t.getPreviousSibling();(null===n||Ws(n))&&(l=!0,a=e.getElementByKey(t.__key))}}if(l){const n=e.getElementByKey(o.__key);return null===r&&(e._blockCursorElement=r=function(e){const t=e.theme,n=document.createElement("div");n.contentEditable="false",n.setAttribute("data-lexical-cursor","true");let r=t.blockCursor;if(void 0!==r){if("string"==typeof r){const e=yc(r);r=t.blockCursor=e}void 0!==r&&n.classList.add(...r)}return n}(e._config)),t.style.caretColor="transparent",void(null===a?n.appendChild(r):n.insertBefore(r,a))}}null!==r&&$s(r,e,t)}(e,r,l)}finally{null!==g&&g.observe(r,yi),hi=d,di=c}}null!==p&&function(e,t,n,r,i){const o=Array.from(e._listeners.mutation),s=o.length;for(let e=0;e<s;e++){const[s,l]=o[e];for(const e of l){const o=t.get(e);void 0!==o&&s(o,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,p,b,f,o),Fr(l)||null===l||null!==s&&s.is(l)||e.dispatchCommand(ie$4,void 0);const C=e._pendingDecorators;null!==C&&(e._decorators=C,e._pendingDecorators=null,Di("decorator",e,!0,C)),function(e,t,n){const r=Qo(t),i=Qo(n);r!==i&&Di("textcontent",e,!0,i)}(e,t||o,n),Di("update",e,!0,{dirtyElements:m,dirtyLeaves:f,editorState:n,mutatedNodes:p,normalizedNodes:y,prevEditorState:t||o,tags:b}),Fi(e,$),function(e){const t=e._updates;if(0!==t.length){const n=t.shift();if(n){const[t,r]=n;Ii(e,t,r)}}}(e)}function Di(e,t,n,...r){const i=t._updating;t._updating=n;try{const n=t._listeners[e],i=Array.from(n);for(const[e,t]of i){t&&t();const i=e(...r);n.has(e)?n.set(e,i):i&&i()}}finally{t._updating=i}}function Pi(e,t,n,r){const i=is(e);let o;for(let e=4;e>=0;e--)for(let s=0;s<i.length;s++){const l=i[s];if(s>0&&l._updating){o=l;break}const a=l._commands.get(t);if(void 0!==a){const t=a[e];if(t.size>0){let e=!1;if(Ki(l,(()=>{for(const i of t)if(i(n,r))return void(e=!0)})),e)return e}}}return o&&o.update((()=>{Pi(o,t,n,r)})),!1}function Fi(e,t){if(e._deferred=[],0!==t.length){const n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Li(e,n){const r=e._updates;let i=n||!1;for(;0!==r.length;){const n=r.shift();if(n){const[r,o]=n,s=e._pendingEditorState;let l;void 0!==o&&(l=o.onUpdate,o.skipTransforms&&(i=!0),o.discrete&&(null===s&&t(191),s._flushSync=!0),l&&e._deferred.push(l),wi(e,o.tag)),null==s?Ii(e,r,o):r()}}return i}function Ii(e,n,r){const i=e._updateTags;let o,s=!1,l=!1;void 0!==r&&(o=r.onUpdate,wi(e,r.tag),s=r.skipTransforms||!1,l=r.discrete||!1),o&&e._deferred.push(o);const a=e._editorState;let c=e._pendingEditorState,u=!1;(null===c||c._readOnly)&&(c=e._pendingEditorState=Yi(c||a),u=!0),c._flushSync=l;const d=di,h=gi,g=hi,p=e._updating;di=c,gi=!1,e._updating=!0,hi=e;const f=e._headless||null===e.getRootElement();vo(null);try{u&&(f?null!==a._selection&&(c._selection=a._selection.clone()):c._selection=function(e,t){const n=e.getEditorState()._selection,r=Js(Ps(e));return Fr(n)||null==n?Xr(n,r,e,t):n.clone()}(e,r&&r.event||null));const i=e._compositionKey;n(),s=Li(e,s),function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(Fr(r)){const e=r.anchor,t=r.focus;let i;if("text"===e.type&&(i=e.getNode(),i.selectionTransform(n,r)),"text"===t.type){const e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(c,e),0!==e._dirtyType&&(s?function(e,t){const n=t._dirtyLeaves,r=e._nodeMap;for(const e of n){const t=r.get(e);Tr(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Ct$2(t)}}(c,e):function(e,t){const n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,o=Vo(),s=new Map;let l=n,a=l.size,c=r,u=c.size;for(;a>0||u>0;){if(a>0){t._dirtyLeaves=new Set;for(const e of l){const r=i.get(e);Tr(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Ct$2(r),void 0!==r&&bi(r,o)&&Ni(t,r,s),n.add(e)}if(l=t._dirtyLeaves,a=l.size,a>0){pi++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,c.delete("root")&&c.set("root",!0);for(const e of c){const n=e[0],l=e[1];if(r.set(n,l),!l)continue;const a=i.get(n);void 0!==a&&bi(a,o)&&Ni(t,a,s)}l=t._dirtyLeaves,a=l.size,c=t._dirtyElements,u=c.size,pi++}t._dirtyLeaves=n,t._dirtyElements=r}(c,e),Li(e),function(e,t,n,r){const i=e._nodeMap,o=t._nodeMap,s=[];for(const[e]of r){const t=o.get(e);void 0!==t&&(t.isAttached()||(Wi(t)&&Y$5(t,e,i,o,s,r),i.has(e)||r.delete(e),s.push(e)))}for(const e of s)o.delete(e);for(const e of n){const t=o.get(e);void 0===t||t.isAttached()||(i.has(e)||n.delete(e),o.delete(e))}}(a,c,e._dirtyLeaves,e._dirtyElements)),i!==e._compositionKey&&(c._flushSync=!0);const o=c._selection;if(Fr(o)){const e=c._nodeMap,n=o.anchor.key,r=o.focus.key;void 0!==e.get(n)&&void 0!==e.get(r)||t(19)}else Ir(o)&&0===o._nodes.size&&(c._selection=null)}catch(t){return t instanceof Error&&e._onError(t),e._pendingEditorState=a,e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),void Ai(e)}finally{di=d,gi=h,hi=g,e._updating=p,pi=0}const m=0!==e._dirtyType||e._deferred.length>0||function(e,t){const n=t.getEditorState()._selection,r=e._selection;if(null!==r){if(r.dirty||!r.is(n))return!0}else if(null!==n)return!0;return!1}(c,e);m?c._flushSync?(c._flushSync=!1,Ai(e)):u&&wo((()=>{Ai(e)})):(c._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null))}function Ki(e,t,n){hi===e&&void 0===n?t():Ii(e,t,n)}function Ri(e,n){const r=[];let i=n;for(;i!==e&&null!==i;i=i.parentNode){let e=0;for(let t=i.previousSibling;null!==t;t=t.previousSibling)e++;r.push(e)}return i!==e&&t(225),r.reverse()}function Wi(e){return e instanceof Bi}function $i(e,t,n){let r=e.getNode();for(;r;){const e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}function ji(e){return e instanceof Ji}function Vi(e){return e instanceof Ui}function Yi(e){return new Xi(new Map(e._nodeMap))}function qi(){return new Xi(new Map([["root",new Ui]]))}function Hi(e){const n=e.exportJSON(),r=e.constructor;if(n.type!==r.getType()&&t(130,r.name),Wi(e)){const i=n.children;Array.isArray(i)||t(59,r.name);const o=e.getChildren();for(let e=0;e<o.length;e++){const t=Hi(o[e]);i.push(t)}}return n}function Gi(e){return e instanceof Xi}function to(e){const t=eo();if(e.style&&(t.setFormat(e.style.textAlign),sl(e,t)),""===t.getFormatType()){const n=e.getAttribute("align");n&&n&&n in B$5&&t.setFormat(n)}return{node:t}}function eo(){return zs(new Zi)}function no(e){return e instanceof Zi}function go(e,t,n,r){const i=e._keyToDOMMap;i.clear(),e._editorState=qi(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,e._updateTags=new Set,e._updates=[],e._blockCursorElement=null;const o=e._observer;null!==o&&(o.disconnect(),e._observer=null),null!==t&&(t.textContent=""),null!==n&&(n.textContent="",i.set("root",n))}function _o(e){const t=new Set,n=new Set;let r=e;for(;r;){const{ownNodeConfig:e}=ul(r),i=r.transform;if(!n.has(i)){n.add(i);const e=r.transform();e&&t.add(e)}if(e){const n=e.$transform;n&&t.add(n),r=e.extends}else{const e=Object.getPrototypeOf(r);r=e.prototype instanceof Rn$1&&e!==Rn$1?e:void 0}}return t}function yo(e){const t=e||{},n=Ti(),r=t.theme||{},i=void 0===e?n:t.parentEditor||null,o=t.disableEvents||!1,s=qi(),l=t.namespace||(null!==i?i._config.namespace:os()),a=t.editorState,c=[Ui,gr,rr,br,Zi,Qi,...t.nodes||[]],{onError:u,html:d}=t,h=void 0===t.editable||t.editable;let g;if(void 0===e&&null!==n)g=n._nodes;else{g=new Map;for(let e=0;e<c.length;e++){let t=c[e],n=null,r=null;if("function"!=typeof t){const e=t;t=e.replace,n=e.with,r=e.withKlass||null}ul(t);const i=t.getType(),o=_o(t);g.set(i,{exportDOM:d&&d.export?d.export.get(t):void 0,klass:t,replace:n,replaceWithKlass:r,sharedNodeState:at$3(c[e]),transforms:o})}}const p=new Co(s,i,g,{disableEvents:o,dom:{...po,...e&&e.dom},namespace:l,theme:r},u||console.error,function(e,t){const n=new Map,r=new Set,i=e=>{Object.keys(e).forEach((t=>{let r=n.get(t);void 0===r&&(r=[],n.set(t,r)),r.push(e[t])}))};return e.forEach((e=>{const t=e.klass.importDOM;if(null==t||r.has(t))return;r.add(t);const n=t.call(e.klass);null!==n&&i(n)})),t&&i(t),n}(g,d?d.import:void 0),h,e);return void 0!==a&&(p._pendingEditorState=a,p._dirtyType=2),function(e){e.registerCommand(le$3,vn$1,ro),e.registerCommand(ce$4,kn$1,ro),e.registerCommand(ae$4,Tn$1,ro),e.registerCommand(ue$4,Nn$1,ro),e.registerCommand(ve$2,wn$1,ro)}(p),p}function mo(e,t){const n=e.get(t);e.delete(t),n&&n()}
4function xo(e,t,n){return e.set(t,n),mo.bind(null,e,t)}function vo(e){So=e}function To(){ko=1}function No(e,n){const r=bo(e,n);return void 0===r&&t(30,n),r}function bo(e,t){return e._nodes.get(t)}function Eo(e){return ji(Go(e))}function Oo(e){const t=document.activeElement;if(!Ys(t))return!1;const n=t.nodeName;return ji(Go(e))&&("INPUT"===n||"TEXTAREA"===n||"true"===t.contentEditable&&null==Po(t))}function Mo(e,t,n){const r=e.getRootElement();try{return null!==r&&r.contains(t)&&r.contains(n)&&null!==t&&!Oo(t)&&Do(t)===e}catch(e){return!1}}function Ao(e){return e instanceof Co}function Do(e){let t=e;for(;null!=t;){const e=Po(t);if(Ao(e))return e;t=bs(t)}return null}function Po(e){return e?e.__lexicalEditor:null}function Fo(e){return I$6.test(e)?"rtl":K$4.test(e)?"ltr":null}function Lo(e){return Er(e)||e.isToken()}function Io(e){return Lo(e)||e.isSegmented()}function Ko(e){return qs(e)&&3===e.nodeType}function zo(e){return qs(e)&&9===e.nodeType}function Ro(e){let t=e;for(;null!=t;){if(Ko(t))return t;t=t.firstChild}return null}function Bo(e,t,n){const r=z$7[t];if(null!==n&&(e&r)==(n&r))return e;let i=e^r;return"subscript"===t?i&=~z$7.superscript:"superscript"===t?i&=~z$7.subscript:"lowercase"===t?(i&=~z$7.uppercase,i&=~z$7.capitalize):"uppercase"===t?(i&=~z$7.lowercase,i&=~z$7.capitalize):"capitalize"===t&&(i&=~z$7.lowercase,i&=~z$7.uppercase),i}function Wo(e){return Tr(e)||sr(e)||ji(e)}function $o(e,t){const n=function(){const e=So;return So=null,e}();if(null!=(t=t||n&&n.__key))return void(e.__key=t);xi(),Ci();const r=vi(),i=Si(),o=""+ko++;i._nodeMap.set(o,e),Wi(e)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType=1,e.__key=o}function Jo(e){const t=e.getParent();if(null!==t){const n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),o=e.getNextSibling(),s=null!==o?o.__key:null,l=null!==i?i.__key:null,a=null!==i?i.getWritable():null,c=null!==o?o.getWritable():null;null===i&&(r.__first=s),null===o&&(r.__last=l),null!==a&&(a.__next=s),null!==c&&(c.__prev=l),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function jo(e){Ci(),zn(e)&&t(323,e.__key,e.__type);const n=e.getLatest(),r=n.__parent,i=Si(),o=vi(),s=i._nodeMap,l=o._dirtyElements;null!==r&&function(e,t,n){let r=e;for(;null!==r;){if(n.has(r))return;const e=t.get(r);if(void 0===e)break;n.set(r,!1),r=e.__parent}}(r,s,l);const a=n.__key;o._dirtyType=1,Wi(e)?l.set(a,!0):o._dirtyLeaves.add(a)}function Uo(e){xi();const t=vi(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,null!==n){const e=Yo(n);null!==e&&e.getWritable()}if(null!==e){const t=Yo(e);null!==t&&t.getWritable()}}}function Vo(){return mi()?null:vi()._compositionKey}function Yo(e,t){const n=(t||Si())._nodeMap.get(e);return void 0===n?null:n}function qo(e,t){const n=Ho(e,vi());return void 0!==n?Yo(n,t):null}function Ho(e,t){return e[`__lexicalKey_${t._key}`]}function Go(e,t){let n=e;for(;null!=n;){const e=qo(n,t);if(null!==e)return e;n=bs(n)}return null}function Xo(e){const t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function Qo(e){return e.read((()=>Zo().getTextContent()))}function Zo(){return ts(Si())}function ts(e){return e._nodeMap.get("root")}function es(e){xi();const t=Si();null!==e&&(e.dirty=!0,e.setCachedNodes(null)),t._selection=e}function ns(e){const t=vi(),n=function(e,t){let n=e;for(;null!=n;){const e=Ho(n,t);if(void 0!==e)return e;n=bs(n)}return null}(e,t);return null===n?e===t.getRootElement()?Yo("root"):null:Yo(n)}function rs(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function is(e){const t=[];for(let n=e;null!==n;n=n._parentEditor)t.push(n);return t}function os(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function ss(e){return Ko(e)?e.nodeValue:null}function ls(e,t,n){const r=Js(Ps(t));if(null===r)return;const i=r.anchorNode;let{anchorOffset:o,focusOffset:s}=r;if(null!==i){let t=ss(i);const r=Go(i);if(null!==t&&Tr(r)){if((t===A$3||t===P$3)&&n){const e=n.length;t=n,o=e,s=e}null!==t&&cs(r,t,o,s,e)}}}function cs(e,t,n,r,i){let o=e;if(o.isAttached()&&(i||!o.isDirty())){const s=o.isComposing();let a=t;if((s||i)&&(t.endsWith(A$3)&&(a=t.slice(0,-A$3.length)),i)){const e=P$3;let t;for(;-1!==(t=a.indexOf(e));)a=a.slice(0,t)+a.slice(t+e.length),null!==n&&n>t&&(n=Math.max(t,n-e.length)),null!==r&&r>t&&(r=Math.max(t,r-e.length))}const c=o.getTextContent();if(i||a!==c){if(""===a){if(Uo(null),a$1||l||d$1)o.remove();else{const e=vi();setTimeout((()=>{e.update((()=>{o.isAttached()&&o.remove()}))}),20)}return}const t=o.getParent(),i=Zr(),c=o.getTextContentSize(),u=Vo(),d=o.getKey();if(o.isToken()||null!==u&&d===u&&!s||Fr(i)&&(null!==t&&!t.canInsertTextBefore()&&0===i.anchor.offset||i.anchor.key===e.__key&&0===i.anchor.offset&&!o.canInsertTextBefore()&&!s||i.focus.key===e.__key&&i.focus.offset===c&&!o.canInsertTextAfter()&&!s))return void o.markDirty();const h=Qr();if(!Fr(h)||null===n||null===r)return void as(o,a,h);if(h.setTextNodeRange(o,n,o,r),o.isSegmented()){const e=kr(o.getTextContent());o.replace(e),o=e}as(o,a,h)}}}function as(e,t,n){if(e.setTextContent(t),Fr(n)){const t=e.getKey();for(const r of["anchor","focus"]){const i=n[r];"text"===i.type&&i.key===t&&(i.offset=Al(e,i.offset,"clamp"))}}}
vendor: 4,319 bytes, line 4
4function us(e,t,n){const r=t[n]||!1;return"any"===r||r===e[n]}function fs(e,t){return us(e,t,"altKey")&&us(e,t,"ctrlKey")&&us(e,t,"shiftKey")&&us(e,t,"metaKey")}function ds(e,t,n){if(!fs(e,n))return!1;if(e.key.toLowerCase()===t.toLowerCase())return!0;if(t.length>1)return!1;if(1===e.key.length&&e.key.charCodeAt(0)<=127)return!1;if(e.code.startsWith("Digit")&&/^\d$/.test(t))return e.code===`Digit${t}`;const r="Key"+t.toUpperCase();return e.code===r}function _s(e){return"Backspace"===e.key}function ps(e){return ds(e,"a",hs)}function ys(e){const t=Zo();if(Fr(e)){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),St$3(e),e}{const e=t.select(0,t.getChildrenSize());return es(St$3(e)),e}}function ms(e,t){void 0===e.__lexicalClassNameCache&&(e.__lexicalClassNameCache={});const n=e.__lexicalClassNameCache,r=n[t];if(void 0!==r)return r;const i=e[t];if("string"==typeof i){const e=yc(i);return n[t]=e,e}return i}function xs(e,n,r,i,o){if(0===r.size)return;const s=i.__type,l=i.__key,a=n.get(s);void 0===a&&t(33,s);const c=a.klass;let u=e.get(c);void 0===u&&(u=new Map,e.set(c,u));const d=u.get(l),h="destroyed"===d&&"created"===o;(void 0===d||h)&&u.set(l,h?"updated":o)}function Cs(e){const t=e.getType(),n=Si();if(n._readOnly){const e=rl(n).get(t);return e?Array.from(e.values()):[]}const r=n._nodeMap,i=[];for(const[,n]of r)n instanceof e&&n.__type===t&&n.isAttached()&&i.push(n);return i}function Ss(e,t,n){const r=e.getParent();let i=n,o=e;return null!==r&&(t&&0===n?(i=o.getIndexWithinParent(),o=r):t||n!==o.getChildrenSize()||(i=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(t?i-1:i)}function vs(e,t){const n=e.offset;if("element"===e.type)return Ss(e.getNode(),t,n);{const r=e.getNode();if(t&&0===n||!t&&n===r.getTextContentSize()){const e=t?r.getPreviousSibling():r.getNextSibling();return null===e?Ss(r.getParentOrThrow(),t,r.getIndexWithinParent()+(t?0:1)):e}}return null}function ks(e){const t=Ps(e).event,n=t&&t.inputType;return"insertFromPaste"===n||"insertFromPasteAsQuotation"===n}function Ts(e,t,n){return Pi(e,t,n,e)}function Ns(e,n){const r=e._keyToDOMMap.get(n);return void 0===r&&t(75,n),r}function bs(e){const t=e.assignedSlot||e.parentElement;return Hs(t)?t.host:t}function ws(e){return zo(e)?e:Ys(e)?e.ownerDocument:null}function Es(e){return vi()._updateTags.has(e)}function Os(e){xi(),vi()._updateTags.add(e)}function Ms(e){xi(),vi()._deferred.push(e)}function As(e,t){let n=e.getParent();for(;null!==n;){if(n.is(t))return!0;n=n.getParent()}return!1}function Ds(e){const t=ws(e);return t?t.defaultView:null}function Ps(e){const n=e._window;return null===n&&t(78),n}function Fs(e){return Wi(e)&&e.isInline()||ji(e)&&e.isInline()}function Ls(e){let t=e.getParentOrThrow();for(;null!==t;){if(Is(t))return t;t=t.getParentOrThrow()}return t}function Is(e){return Vi(e)||Wi(e)&&e.isShadowRoot()}function Ks(e,t=!1){const n=e.constructor.clone(e);return $o(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function zs(e){const n=vi(),r=e.getType(),i=bo(n,r);void 0===i&&t(200,e.constructor.name,r);const{replace:o,replaceWithKlass:s}=i;if(null!==o){const n=o(e),i=n.constructor;return null!==s?n instanceof s||t(201,s.name,s.getType(),i.name,i.getType(),e.constructor.name,r):n instanceof e.constructor&&i!==e.constructor||t(202,i.name,i.getType(),e.constructor.name,r),n.__key===e.__key&&t(203,e.constructor.name,r,i.name,i.getType()),n}return e}function Rs(e,n){!Vi(e.getParent())||Wi(n)||ji(n)||t(99)}function Bs(e){const n=Yo(e);return null===n&&t(63,e),n}function Ws(e){return(ji(e)||Wi(e)&&!e.canBeEmpty())&&!e.isInline()}function $s(e,t,n){n.style.removeProperty("caret-color"),t._blockCursorElement=null;const r=e.parentElement;null!==r&&r.removeChild(e)}function Js(e){return n?(e||window).getSelection():null}function js(e){const t=Ds(e);return t?t.getSelection():null}function Us(e,n){let r=e.getChildAtIndex(n);null==r&&(r=e),Is(e)&&t(102);const i=e=>{const n=e.getParentOrThrow(),o=Is(n),s=e!==r||o?Ks(e):e;if(o)return Wi(e)&&Wi(s)||t(133),e.insertAfter(s),[e,s,s];{const[t,r,o]=i(n),l=e.getNextSiblings();return o.append(s,...l),[t,r,s]}},[o,s]=i(r);return[o,s]}function Vs(e){return Ys(e)&&"A"===e.tagName}function Ys(e){return qs(e)&&1===e.nodeType}
4function qs(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&"number"==typeof e.nodeType}function Hs(e){return qs(e)&&11===e.nodeType}function Gs(e){const t=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return null!==e.nodeName.match(t)}function Xs(e){const t=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return null!==e.nodeName.match(t)}function Qs(e){if(ji(e)&&!e.isInline())return!0;if(!Wi(e)||Is(e))return!1;const t=e.getFirstChild(),n=null===t||sr(t)||Tr(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function Zs(){return vi()}function tl(e=Zs()){return e._config.dom||po}function rl(e){if(!e._readOnly&&e.isEmpty())return nl;e._readOnly||t(192);let n=el.get(e);return n||(n=function(e){const t=new Map;for(const[n,r]of e._nodeMap){const e=r.__type;let i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),el.set(e,n)),n}function il(e){const t=e.constructor.clone(e);return t.afterCloneFrom(e),t}function ol(e){return(t=il(e))[Kn$1]=!0,t;var t}function sl(e,t){const n=parseInt(e.style.paddingInlineStart,10)||0,r=Math.round(n/40);t.setIndent(r)}function ll(e){e.__lexicalUnmanaged=!0}function cl(e){return!0===e.__lexicalUnmanaged}function al(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)&&e[t]!==Rn$1[t]}function ul(e){const n=U$6 in e.prototype?e.prototype[U$6]():void 0,r=function(e){if(!(e===Rn$1||e.prototype instanceof Rn$1)){let n="<unknown>",r="<unknown>";try{n=e.getType()}catch(e){}try{Co.version&&(r=JSON.parse(Co.version))}catch(e){}t(290,e.name,n,r)}return e===Ji||e===Bi||e===Rn$1}(e),i=!r&&al(e,"getType")?e.getType():void 0;let o,s=i;if(n)if(i)o=n[i];else for(const[e,t]of Object.entries(n))s=e,o=t;if(!r&&s&&(al(e,"getType")||(e.getType=()=>s),al(e,"clone")||(e.clone=t=>(vo(t),new e)),al(e,"importJSON")||(e.importJSON=o&&o.$importJSON||(t=>(new e).updateFromJSON(t))),!al(e,"importDOM")&&o)){const{importDOM:t}=o;t&&(e.importDOM=()=>t)}return{ownNodeConfig:o,ownNodeType:s}}function fl(e){const t=Zs();return xi(),new(t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)).klass)}function hl(e,n){const r=[];let i=e.__first;for(;null!==i;){const e=null===n?Yo(i):n.get(i);null==e&&t(174),r.push(i),i=e.__next}return r}function ml(e){return gl[e]}function xl(e,t="root"){return yl[t](e)?null:e}function vl(e){return e instanceof Sl}function kl(e){return e instanceof _l}function Tl(e){return e instanceof Cl}function Nl(e){return e instanceof pl}function Ol(e,t){return e?new wl[t](e):null}function Ml(e,t,n){return e?new bl[t](e,Al(e,n)):null}function Al(t,n,r="error"){const i=t.getTextContentSize();let o="next"===n?i:"previous"===n?0:n;return(o<0||o>i)&&("clamp"!==r&&e(284,String(n),String(i),t.getKey()),o=o<0?0:i),o}function Dl(e,t){return new Kl(e,t)}function Pl(e,t){return Wi(e)?new El[t](e):null}function Fl(e){return e&&e.getChildCaret()||e}function Ll(e){return e&&Fl(e.getAdjacentCaret())}function zl(e){return e instanceof Kl}function Rl(e){return Wl(e,Ol(Zo(),e.direction))}function Bl(e){return Wl(e,e)}function Wl(e,n){return e.direction!==n.direction&&t(265),new Il(e,n,e.direction)}function $l(e){const{initial:t,hasNext:n,step:r,map:i}=e;let o=t;return{[Symbol.iterator](){return this},next(){if(!n(o))return{done:!0,value:void 0};const e={done:!1,value:i(o)};return o=r(o),e}}}function Jl(e,n){const r=Yl(e.origin,n.origin);switch(null===r&&t(275,e.origin.getKey(),n.origin.getKey()),r.type){case"same":{const t="text"===e.type,r="text"===n.type;return t&&r?function(e,t){return Math.sign(e-t)}(e.offset,n.offset):e.type===n.type?0:t?-1:r?1:"child"===e.type?-1:1}case"ancestor":return"child"===e.type?-1:1;case"descendant":return"child"===n.type?1:-1;case"branch":return jl(r)}}function jl(e){const{a:t,b:n}=e,r=t.__key,i=n.__key;let o=t,s=n;for(;o&&s;o=o.getNextSibling(),s=s.getNextSibling()){if(o.__key===i)return-1;
vendor: 6,652 bytes, lines 4-5
4if(s.__key===r)return 1}return null===o?1:-1}function Ul(e,t){return t.is(e)}function Vl(e){return Wi(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Yl(e,n){if(e.is(n))return{commonAncestor:e,type:"same"};const r=new Map;for(let[t,n]=Vl(e);t;n=t,t=t.getParent())r.set(t,n);for(let[i,o]=Vl(n);i;o=i,i=i.getParent()){const s=r.get(i);if(void 0!==s)return null===s?(Ul(e,i)||t(276),{commonAncestor:i,type:"ancestor"}):null===o?(Ul(n,i)||t(277),{commonAncestor:i,type:"descendant"}):((Wi(s)||Ul(e,s))&&(Wi(o)||Ul(n,o))&&i.is(s.getParent())&&i.is(o.getParent())||t(278),{a:s,b:o,commonAncestor:i,type:"branch"})}return null}function ql(e,n){const{type:r,key:i,offset:o}=e,s=Bs(e.key);return"text"===r?(Tr(s)||t(266,s.getType(),i),Ml(s,n,o)):(Wi(s)||t(267,s.getType(),i),lc(s,e.offset,n))}function Hl(e,n){const{origin:r,direction:i}=n,o="next"===i;vl(n)?e.set(r.getKey(),n.offset,"text"):Tl(n)?Tr(r)?e.set(r.getKey(),Al(r,i),"text"):e.set(r.getParentOrThrow().getKey(),r.getIndexWithinParent()+(o?1:0),"element"):(Nl(n)&&Wi(r)||t(268),e.set(r.getKey(),o?0:r.getChildrenSize(),"element"))}function Gl(e){const t=Qr(),n=Fr(t)?t:qr();return Xl(n,e),es(n),n}function Xl(e,t){Hl(e.anchor,t.anchor),Hl(e.focus,t.focus)}function Ql(e){const{anchor:t,focus:n}=e,r=ql(t,"next"),i=ql(n,"next"),o=Jl(r,i)<=0?"next":"previous";return Wl(oc(r,o),oc(i,o))}function Zl(e){const{direction:t,origin:n}=e,r=Ol(n,ml(t)).getNodeAtCaret();return r?Ol(r,t):Pl(n.getParentOrThrow(),t)}function tc(e,t="root"){const n=[e];for(let r=Nl(e)?e.getParentCaret(t):e.getSiblingCaret();null!==r;r=r.getParentCaret(t))n.push(Zl(r));return n}function ec(e){return!!e&&e.origin.isAttached()}function nc(e,n="removeEmptySlices"){if(e.isCollapsed())return e;const r="root",i="next";let o=n;const s=sc(e,i),l=tc(s.anchor,r),a=tc(s.focus.getFlipped(),r),c=new Set,u=[];for(const e of s.iterNodeCarets(r))if(Nl(e))c.add(e.origin.getKey());else if(Tl(e)){const{origin:t}=e;Wi(t)&&!c.has(t.getKey())||u.push(t)}for(const e of u)e.remove();for(const e of s.getTextSlices()){if(!e)continue;const{origin:t}=e.caret,n=t.getTextContentSize(),r=Zl(Ol(t,i)),s=t.getMode();if(Math.abs(e.distance)===n&&"removeEmptySlices"===o||"token"===s&&0!==e.distance)r.remove();else if(0!==e.distance){o="removeEmptySlices";let t=e.removeTextSlice();const n=e.caret.origin;if("segmented"===s){const e=t.origin,n=kr(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());r.replaceOrInsert(n),t=Ml(n,i,t.offset)}n.is(l[0].origin)&&(l[0]=t),n.is(a[0].origin)&&(a[0]=t.getFlipped())}}let d,h;for(const e of l)if(ec(e)){d=rc(e);break}for(const e of a)if(ec(e)){h=rc(e);break}const g=function(e,t,n){if(!e||!t)return null;const r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;const o=r.getParents().reverse();o.push(r);const s=i.getParents().reverse();s.push(i);const l=Math.min(o.length,s.length);let a;for(a=0;a<l&&o[a]===s[a];a++);const c=(e,t)=>{let n;for(let r=a;r<e.length;r++){const i=e[r];if(Is(i))return;!n&&t(i)&&(n=i)}return n},u=c(o,Qs),d=u&&c(s,(e=>n.has(e.getKey())&&Qs(e)));return u&&d?[u,d]:null}(d,h,c);if(g){const[e,t]=g;Pl(e,"previous").splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){const e=n;n=n.getParent(),e.remove(!0)}}const p=[d,h,...l,...a].find(ec);if(p)return Bl(oc(rc(p),e.direction));t(269,JSON.stringify(l.map((e=>e.origin.__key))))}function rc(e){const t=function(e){let t=e;for(;Nl(t);){const e=Ll(t);if(!Nl(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(Tr(t.origin))return vl(t)?t:Ml(t.origin,n,n);const r=t.getAdjacentCaret();return Tl(r)&&Tr(r.origin)?Ml(r.origin,n,ml(n)):t}function ic(e){return vl(e)&&e.offset!==Al(e.origin,e.direction)}function oc(e,t){return e.direction===t?e:e.getFlipped()}function sc(e,t){return e.direction===t?e:Wl(oc(e.focus,t),oc(e.anchor,t))}function lc(e,t,n){let r=Pl(e,"next");for(let e=0;e<t;e++){const e=r.getAdjacentCaret();if(null===e)break;r=e}return oc(r,n)}function cc(e,t="root"){let n=0,r=e,i=Ll(r);for(;null===i;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=Ll(r)}return i&&[i,n]}function ac(e){const{origin:n,offset:r,direction:i}=e;if(r===Al(n,i))return e.getSiblingCaret();if(r===Al(n,ml(i)))return Zl(e.getSiblingCaret());const[o]=n.splitText(r);return Tr(o)||t(281),oc(Ol(o,"next"),i)}function uc(){return!0}function fc(e,{$copyElementNode:t=Ks,$splitTextPointCaretNext:n=ac,rootMode:r="shadowRoot",$shouldSplit:i=uc,removeEmptyDestination:o=!1}={}){if(vl(e))return n(e);const s=e.getParentCaret(r);if(s){const{origin:n}=s;if(Nl(e)){const e=Zl(s);if(o&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,"first"))return e}const r=function(e){const t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!o&&n.canBeEmpty()&&i(n,"last"))&&s.insert(t(n).splice(0,0,r))}return s}function dc(e){return e}function hc(...e){return e}function gc(e,t){return[e,t]}function _c(e){return e}function pc(e,t){if(!t||e===t)return e;for(const n in t)if(e[n]!==t[n])return{...e,...t};return e}function yc(...e){const t=[] 5;for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}function mc(e,...t){const n=yc(...t);n.length>0&&e.classList.add(...n)}function xc(e,...t){const n=yc(...t);n.length>0&&e.classList.remove(...n)}function Cc(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function E$3(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 F$6(e){let t="";for(const n in e)n&&(t+=`${n}: ${e[n]};`);return t}function b$2(e){const t=Zs().getElementByKey(e.getKey());if(null===t)return null;const n=t.ownerDocument.defaultView;return null===n?null:n.getComputedStyle(t)}function z$6(e){return b$2(Vi(e)?e:e.getParentOrThrow())}function O$3(e){const t=z$6(e);return null!==t&&"rtl"===t.direction}function R$3(e,t,n="self"){const r=e.getStartEndPoints();if(t.isSelected(e)&&!Io(t)&&null!==r){const[i,o]=r,s=e.isBackward(),l=i.getNode(),a=o.getNode(),c=t.is(l),u=t.is(a);if(c||u){const[r,i]=zr(e),o=l.is(a),c=t.is(s?a:l),u=t.is(s?l:a);let d,h=0;o?(h=r>i?i:r,d=r>i?r:i):c?(h=s?i:r,d=void 0):u&&(h=0,d=s?r:i);const g=t.__text.slice(h,d);g!==t.__text&&("clone"===n&&(t=ol(t)),t.__text=g)}}return t}function A$2(e){if("text"===e.type)return e.offset===e.getNode().getTextContentSize();const t=e.getNode();return Wi(t)||E$3(177),e.offset===t.getChildrenSize()}
5function M$4(e,t){(Fr(e)?e.isCollapsed():Tr(e)||Wi(e))||E$3(280);const n=Zn(Fr(e)?e.style:Tr(e)?e.getStyle():e.getTextStyle()),r=F$6(Object.entries(t).reduce(((t,[r,i])=>("function"==typeof i?t[r]=i(n[r],e):null===i?delete t[r]:t[r]=i,t)),{...n}));Fr(e)||Tr(e)?e.setStyle(r):e.setTextStyle(r)}function $$3(e,t){if(Fr(e)&&e.isCollapsed()){M$4(e,t);const n=e.anchor.getNode();Wi(n)&&n.isEmpty()&&M$4(n,t)}D$3((e=>{M$4(e,t)}));const n=e.getNodes();if(n.length>0){const e=new Set;for(const r of n){if(!Wi(r)||!r.canBeEmpty()||0!==r.getChildrenSize())continue;const n=r.getKey();e.has(n)||(e.add(n),M$4(r,t))}}}function D$3(e){const t=Qr();if(!t)return;const n=new Map,r=e=>n.get(e.getKey())||[0,e.getTextContentSize()];if(Fr(t))for(const e of Ql(t).getTextSlices())e&&n.set(e.caret.origin.getKey(),e.getSliceIndices());const i=t.getNodes();for(const t of i){if(!Tr(t)||!t.canHaveFormat())continue;const[n,i]=r(t);i!==n&&(Io(t)||0===n&&i===t.getTextContentSize()?e(t):e(t.splitText(n,i)[0===n?0:1]))}Fr(t)&&"text"===t.anchor.type&&"text"===t.focus.type&&t.anchor.key===t.focus.key&&j$6(t)}function j$6(e){if(e.isBackward()){const{anchor:t,focus:n}=e,{key:r,offset:i,type:o}=t;t.set(n.key,n.offset,n.type),n.set(r,i,o)}}function U$5(e,t){const n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function H$6(e,t,n=U$5){if(null===e)return;const r=e.getStartEndPoints(),i=new Map;let o=null;if(r){const[e,t]=r;o=qr(),o.anchor.set(e.key,e.offset,e.type),o.focus.set(t.key,t.offset,t.type);const n=dl(e.getNode(),Qs),s=dl(t.getNode(),Qs);Wi(n)&&i.set(n.getKey(),n),Wi(s)&&i.set(s.getKey(),s)}for(const t of e.getNodes())if(Wi(t)&&Qs(t))i.set(t.getKey(),t);else if(null===r){const e=dl(t,Qs);Wi(e)&&i.set(e.getKey(),e)}for(const[e,r]of i){const i=t();n(r,i),r.replace(i,!0),o&&(e===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,o.anchor.type),e===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,o.focus.type))}o&&e.is(Qr())&&es(o)}function G$9(e){const t=J$6(e);return null!==t&&"vertical-rl"===t.writingMode}function J$6(e){const t=e.anchor.getNode();return Wi(t)?b$2(t):z$6(t)}function Q$8(e,t){let n=G$9(e)?!t:t;Z$4(e)&&(n=!n);const r=ql(e.focus,n?"previous":"next");if(ic(r))return!1;for(const e of Rl(r)){if(Nl(e))return!e.origin.isInline();if(!Wi(e.origin)){if(ji(e.origin))return!0;break}}return!1}function Y$4(e,t,n,r){e.modify(t?"extend":"move",n,r)}function Z$4(e){const t=J$6(e);return null!==t&&"rtl"===t.direction}function ee$3(e,t,n){const r=Z$4(e);let i;i=G$9(e)||r?!n:n,Y$4(e,t,i,"character")}function te$4(e,t,n){const r=Zn(e.getStyle());return null!==r&&r[t]||n}function ne$4(e,t,n=""){let r=null;const i=e.getNodes(),o=e.anchor,s=e.focus,l=e.isBackward(),a=l?s.getNode():o.getNode(),c=l?o.getNode():s.getNode(),u=l?s.offset:o.offset,d=l?o.offset:s.offset;if(Fr(e)&&e.isCollapsed()&&""!==e.style){const n=Zn(e.style);if(null!==n&&t in n)return n[t]}for(let e=0;e<i.length;e++){const o=i[e];if((0!==e||!o.is(a)||!Tr(o)||u!==o.getTextContentSize())&&(0===e||!o.is(c)||0!==d)&&Tr(o)){const e=te$4(o,t,n);if(null===r)r=e;else if(r!==e){r="";break}}}return null===r?n:r}function deepMerge(e,t){const n={...e,...t};for(const[r,i]of Object.entries(t))arePlainHashes(e[r],i)&&(n[r]=deepMerge(e[r],i));return n}function arePlainHashes(...e){return e.every((e=>e&&e.constructor==Object))}function range(e,t){return[...Array(1+t-e).keys()].map((t=>t+e))}function allowedUriRegexp(e=[]){const t=e.map((e=>String(e).toLowerCase())).filter((e=>SCHEME_NAME.test(e)&&!EXECUTABLE_SCHEME.test(e))).map((e=>e.replace(/[.+-]/g,"\\$&"))),n=[BASE_URI_SCHEMES,...t].join("|");return new RegExp(`^(?:(?:${n}):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))`,"i")}function isAttachmentTag(e){return e===Lexxy.global.get("attachmentTagName")}function attachmentUriFilterHook(e,t){if(!URI_BEARING_ATTACHMENT_ATTRIBUTES.includes(t.attrName))return;if(!t.attrValue)return;const n=String(t.attrValue);ALLOWED_URI.test(n.replace(ATTR_WHITESPACE,""))||isAttachmentTag(e?.nodeName?.toLowerCase())&&ATTACHMENT_DATA_URI.test(n)||(t.keepAttr=!1)}function trustedTypesPolicy(){return trustedTypesPolicyResolved||(resolvedTrustedTypesPolicy=createTrustedTypesPolicy(),trustedTypesPolicyResolved=!0),resolvedTrustedTypesPolicy}function createTrustedTypesPolicy(){const e=window.trustedTypes;if("function"!=typeof e?.createPolicy)return null;try{return e.createPolicy("lexxy",{createHTML:e=>e,createScriptURL:e=>e})}catch{return console.warn("TrustedTypes policy lexxy could not be created."),null}}function styleFilterHook(e,t){if("style"===t.attrName&&t.attrValue){const e={...oe$5(t.attrValue)},n={};for(const t in e)ALLOWED_STYLE_PROPERTIES.includes(t)&&(n[t]=e[t]);Object.keys(n).length?t.attrValue=F$6(n):t.keepAttr=!1}}function stimulusAttributeFilterHook(e,t){FORBIDDEN_STIMULUS_ATTRIBUTES.includes(t.attrName)&&(t.keepAttr=!1)}function buildConfig(e=null){const t={ADD_URI_SAFE_ATTR:["caption","filename",...URI_BEARING_ATTACHMENT_ATTRIBUTES],SAFE_FOR_XML:!1,FORBID_ATTR:["data-controller","data-action"]};if(e){const{uriSafeSchemes:n,...r}=allowlistFor(e);n.length&&(t.ALLOWED_URI_REGEXP=allowedUriRegexp(n)),Object.assign(t,r)}return t.TRUSTED_TYPES_POLICY=trustedTypesPolicy(),t}function allowlistFor(e){const t=Object.create(null),n=[];for(const r of e){const e=String(r.tag??r).toLowerCase(),i=(r.attributes??[]).map((e=>e.toLowerCase()));t[e]||=[],t[e].push(...i),n.push(...r.uriSafeSchemes??[])}for(const[e,n]of Object.entries(DEFAULT_TAG_ATTRIBUTES))t[e]&&t[e].push(...n);return{ALLOWED_TAGS:Object.keys(t),ALLOWED_ATTR:ALLOWED_HTML_ATTRIBUTES,ADD_ATTR:(e,n)=>t[n]?.includes(e),uriSafeSchemes:n}}function getNonce(){const e=document.head.querySelector("meta[name=csp-nonce]");return e?.content}function registerEventListener(e,t,n,r){e.addEventListener(t,n,r);const i=new WeakRef(e),o=new WeakRef(n);return function(){const e=o.deref();e&&i.deref()?.removeEventListener(t,e,r)}}function handlingDefault(e){return t=>{const n=e(t);return n&&t.preventDefault(),n}}function createElement(e,t,n=""){const r=document.createElement(e);for(const[e,n]of Object.entries(t||{}
5))"dataset"===e?Object.entries(n).forEach((([e,t])=>r.dataset[e]=t)):e in r?r[e]=n:null!=n&&r.setAttribute(e,n);return n&&(r.innerHTML=n),r}function parseHtml(e){return(new DOMParser).parseFromString(e,"text/html")}function createAttachmentFigure(e,t,n){return createElement("figure",{className:`attachment attachment--${t?"preview":"file"} attachment--${n?n.split(".").pop().toLowerCase():"unknown"}`,"data-content-type":e})}function isPreviewableImage(e){return e.startsWith("image/")&&!e.includes("svg")}function dispatch(e,t,n=null,r=!1){return e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:n,cancelable:r}))}function addBlockSpacing(e){const t="body > :not(h1, h2, h3, h4, h5, h6) + *, blockquote > :not(h1, h2, h3, h4, h5, h6) + *";for(const n of e.querySelectorAll(t)){const t=e.createElement("p");t.appendChild(e.createElement("br")),n.before(t)}}function generateDomId(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function extractPlainTextFromHtml(e=""){return parseHtml(e).body.textContent.trim()}function isActiveAndVisible(e){return e&&!e.disabled&&checkVisibility(e)}function checkVisibility(e,t){return e.checkVisibility?e.checkVisibility(t):Boolean(e.offsetParent)}function handleRollingTabIndex(e,t){const n=document.activeElement;if(e.includes(n)){new NextElementFinder(e,t.key).selectNext(n)&&t.preventDefault()}}function debounce(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>e(...r)),t)}}function debounceAsync(e,t){let n;return(...r)=>(clearTimeout(n),new Promise(((i,o)=>{n=setTimeout((async()=>{try{const t=await e(...r);i(t)}catch(e){o(e)}}),t)})))}function delay(e){return new Promise((t=>setTimeout(t,e)))}function nextFrame(){return new Promise(requestAnimationFrame)}function F$5(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 pt$2(e){return Array.from(vt$2(e))}function vt$2(e){return wt$2("next",e)}function yt$5(e,t){const n=cc(Ol(e,t));return n&&n[0]}function wt$2(e,t){const n=Zo(),r=t||n,i=Wi(r)?Pl(r,e):Ol(r,e),o=Et$3(r),s=yt$5(r,e);let l=o;return $l({hasNext:e=>null!==e,initial:i,map:e=>({depth:l,node:e.origin}),step:e=>{if(e.isSameNodeCaret(s))return null;Nl(e)&&l++;const t=cc(e);return!t||t[0].isSameNodeCaret(s)?null:(l+=t[1],t[0])}})}function Et$3(e){let t=-1;for(let n=e;null!==n;n=n.getParent())t++;return t}function At$2(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}function Nt$2(e){const t=dl(e,(e=>Wi(e)&&!e.isInline()));return Wi(t)||F$5(4,e.__key),t}function Pt$3(e){const t=Qr()||Zr();let n;if(Fr(t))n=ql(t.focus,"next");else{if(null!=t){const e=t.getNodes(),r=e[e.length-1];r&&(n=Ol(r,"next"))}n=n||Pl(Zo(),"previous").getFlipped().insert(eo())}const r=Rt$3(e,n),i=Ll(r);return Gl(Bl(Nl(i)?rc(i):r)),e.getLatest()}function Rt$3(e,t,n){let r=oc(t,"next");vl(r)&&(0===r.offset?r=Ol(r.origin,"previous").getFlipped():r.offset===r.origin.getTextContentSize()&&(r=Ol(r.origin,"next"))),r.origin.is(e)&&(Tl(r)||F$5(342,e.getKey(),e.getType()),r=Zl(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=fc(e,n))r=e;return vl(r)&&F$5(283),r.insert(e.isInline()?eo().append(e):e),oc(Ol(e.getLatest(),"next"),t.direction)}function Tt$4(e,t){const n=t();return e.replace(n),n.append(e),n}function Bt$3(e,t){return null!==e&&Object.getPrototypeOf(e).constructor.name===t.name}function _t$2(e){const t=Qr();if(!Fr(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const i=r[t],o=i.getKey();if(n.has(o))continue;const s=dl(i,(e=>Wi(e)&&!e.isInline()));if(null===s)continue;const l=s.getKey();s.canIndent()&&!n.has(l)&&(n.add(l),e(s))}return n.size>0}function $t$2(e,t){Pl(e,"next").insert(t)}function Ot$3(e,t){return Dt$4(e,t,null)}function Dt$4(e,t,n){let r=!1;for(const i of zt$4(e))t(i)?null!==n&&n(i):(r=!0,Wi(i)&&Dt$4(i,t,n||
5(e=>i.insertAfter(e))),i.remove());return r}function Ht$3(e,t){const n=[],r=Array.from(e).reverse();for(let e=r.pop();void 0!==e;e=r.pop())if(t(e))n.push(e);else if(Wi(e))for(const t of zt$4(e))r.push(t);return n}function jt$2(e){return Ut$3(Pl(e,"next"))}function zt$4(e){return Ut$3(Pl(e,"previous"))}function Ut$3(e){return $l({hasNext:Tl,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function X$5(){if(ot$2>1)return void ot$2--;let e,t=!1;for(function(){let e=it$1;for(it$1=void 0;void 0!==e;)e.S.v===e.v&&(e.S.i=e.i),e=e.o}();void 0!==et$1;){let n=et$1;for(et$1=void 0,st$1++;void 0!==n;){const r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&<$1(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(st$1=0,ot$2--,t)throw e}function Y$3(e){if(ot$2>0)return e();ct$1=++rt$3,ot$2++;try{return e()}finally{X$5()}}function nt$3(e){const t=tt$3;tt$3=void 0;try{return e()}finally{tt$3=t}}function dt$2(e){if(void 0===tt$3)return;let t=e.n;return void 0===t||t.t!==tt$3?(t={i:0,S:e,p:tt$3.s,n:void 0,t:tt$3,e:void 0,x:void 0,r:t},void 0!==tt$3.s&&(tt$3.s.n=t),tt$3.s=t,e.n=t,32&tt$3.f&&e.S(t),t):-1===t.i?(t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=tt$3.s,t.n=void 0,tt$3.s.n=t,tt$3.s=t),t):void 0}function ut$2(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function ft$1(e,t){return new ut$2(e,t)}function lt$1(e){for(let t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function ht$2(e){for(let t=e.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function gt$2(e){let t,n=e.s;for(;void 0!==n;){const e=n.p;-1===n.i?(n.S.U(n),void 0!==e&&(e.n=n.n),void 0!==n.n&&(n.n.p=e)):t=n,n.S.n=n.r,void 0!==n.r&&(n.r=void 0),n=e}e.s=t}function pt$1(e,t){ut$2.call(this,void 0),this.x=e,this.s=void 0,this.g=at$2-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function vt$1(e){const t=e.m;if(e.m=void 0,"function"==typeof t){ot$2++;const n=tt$3;tt$3=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,xt$2(e),t}finally{tt$3=n,X$5()}}}function xt$2(e){for(let t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,vt$1(e)}function yt$4(e){if(tt$3!==this)throw new Error("Out-of-order effect");gt$2(this),tt$3=e,this.f&=-2,8&this.f&&xt$2(this),X$5()}function Et$2(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=null==t?void 0:t.name}function St$2(e,t){const n=new Et$2(e,t);try{n.c()}catch(e){throw n.d(),e}const r=n.d.bind(n);return r[Symbol.dispose]=r,r}function bt$2(e,t={}){const n={};for(const r in e){const i=t[r],o=ft$1(void 0===i?e[r]:i);n[r]=o}return n}function Ct$1(e){const t=new Set,n=new Set;for(const r of Dt$3(e)){const e="function"==typeof r?r:r.replace;ul(e),t.add(e.getType()),n.add(e)}return{nodes:n,types:t}}function Dt$3(e){return("function"==typeof e.nodes?e.nodes():e.nodes)||[]}function zt$3(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 Lt$3(e,t){if(e&&t&&!Array.isArray(t)&&"object"==typeof e&&"object"==typeof t){const n=e,r=t;for(const e in r)n[e]=Lt$3(n[e],r[e]);return e}return t}function Ht$2(e){return e.id===Ut$2}function qt$3(e){return e.id===Bt$2}function Qt$2(e){return function(e){return e.id===Tt$3}(e)||zt$3(305,String(e.id),String(Tt$3)),Object.assign(e,{id:Bt$2})}function ee$2(){const e=Zo();e.isEmpty()&&e.append(eo())}function oe$4(...e){return de$3.fromExtensions(e).buildEditor()}function se$4(){}function re$4(e){throw e}function ce$3(e){return Array.isArray(e)?e:[e]}function ue$3(e,t){const n=de$3.fromEditor(e).getExtensionRep(t);return void 0===n&&zt$3(303,t.name),n.getExtensionDependency()}function fe$3(e,t){const n=de$3.maybeFromEditor(e);
5if(!n)return;const r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}function K$3(e){let t=null;if(Vs(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=$$2(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function $$2(e="",t){return zs(new F$4(e,t))}function z$5(e){return e instanceof F$4}function H$5(e="",t){return zs(new j$5(e,t))}function G$8(e){return e instanceof j$5}function q$6(e,t){if("element"===e.type){const n=e.getNode();return Wi(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 Q$6(e,t={}){let n;if(e&&"object"==typeof e){const{url:r,...i}=e;n=r,t={...i,...t}}else n=e;const{target:r,title:i}=t,o=void 0===t.rel?"noreferrer":t.rel,s=Qr();if(null===s||!Fr(s)&&!Ir(s))return;if(Ir(s)){const e=s.getNodes();if(0===e.length)return;return void e.forEach((e=>{if(null===n){const t=dl(e,(e=>!G$8(e)&&z$5(e)));t&&(t.insertBefore(e),0===t.getChildren().length&&t.remove())}else{const t=dl(e,(e=>!G$8(e)&&z$5(e)));if(t)t.setURL(n),void 0!==r&&t.setTarget(r),void 0!==o&&t.setRel(o);else{const t=$$2(n,{rel:o,target:r});e.insertBefore(t),t.append(e)}}}))}if(s.isCollapsed()&&null===n)for(const e of s.getNodes()){const t=dl(e,(e=>!G$8(e)&&z$5(e)));
5return void(null!==t&&(t.getChildren().forEach((e=>{t.insertBefore(e)})),t.remove()))}const l=s.extract();if(null===n){const e=new Set;return void l.forEach((t=>{const n=dl(t,(e=>!G$8(e)&&z$5(e)));if(null!==n){const t=n.getKey();if(e.has(t))return;!function(e,t){const n=new Set(t.filter((t=>e.isParentOf(t))).map((e=>e.getKey()))),r=e.getChildren(),i=r=>n.has(r.getKey())||Wi(r)&&t.some((t=>e.isParentOf(t)&&r.isParentOf(t))),o=r.filter(i);if(o.length===r.length)return r.forEach((t=>e.insertBefore(t))),void e.remove();const s=r.findIndex(i),l=r.findLastIndex(i),a=0===s,c=l===r.length-1;if(a)o.forEach((t=>e.insertBefore(t)));else if(c)for(let t=o.length-1;t>=0;t--)e.insertAfter(o[t]);else{for(let t=o.length-1;t>=0;t--)e.insertAfter(o[t]);const t=r.slice(l+1);if(t.length>0){const n=Ks(e);o[o.length-1].insertAfter(n),t.forEach((e=>n.append(e)))}}}(n,l),e.add(t)}}))}const a=new Set,c=e=>{a.has(e.getKey())||(a.add(e.getKey()),e.setURL(n),void 0!==r&&e.setTarget(r),void 0!==o&&e.setRel(o),void 0!==i&&e.setTitle(i))};if(1===l.length){const e=l[0],t=dl(e,z$5);if(null!==t)return c(t)}!function(e){const t=Qr();if(!Fr(t))return e();const n=St$3(t),r=n.isBackward(),i=q$6(n.anchor,r?-1:0),o=q$6(n.focus,r?0:-1);if(e(),i||o){const e=Qr();if(Fr(e)){const t=e.clone();if(i){const e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+(r?1:0),"element")}if(o){const e=o.getParent();e&&t.focus.set(e.getKey(),o.getIndexWithinParent()+(r?0:1),"element")}es(St$3(t))}}}((()=>{let e=null;for(const t of l){if(!t.isAttached())continue;const s=dl(t,z$5);if(s){c(s);continue}if(Wi(t)){if(!t.isInline())continue;if(z$5(t)){if(!(G$8(t)||null!==e&&e.getParentOrThrow().isParentOf(t))){c(t),e=t;continue}for(const e of t.getChildren())t.insertBefore(e);t.remove();continue}}const l=t.getPreviousSibling();z$5(l)&&l.is(e)?l.append(t):(e=$$2(n,{rel:o,target:r,title:i}),t.insertAfter(e),e.append(t))}}))}function X$4(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes("@")?`mailto:${e}`:V$6.test(e)?`tel:${e}`:`https://${e}`}function q$5(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 G$7(e){let t=1,n=e.getParent();for(;null!=n;){if(pe$2(n)){const e=n.getParent();if(Se$1(e)){t++,n=e.getParent();continue}q$5(40)}return t}return t}function Q$5(e){let t=e.getParent();Se$1(t)||q$5(40);let n=t;for(;null!==n;)n=n.getParent(),Se$1(n)&&(t=n);return t}function Y$2(e){let t=[];const n=e.getChildren().filter(pe$2);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();Se$1(i)?t=t.concat(Y$2(i)):t.push(r)}return t}function Z$3(e){return pe$2(e)&&Se$1(e.getFirstChild())}function ee$1(e){return fe$2().append(e)}function te$2(e,t){return pe$2(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function ne$2(e){const t=Qr();if(null!==t){let n=t.getNodes();if(Fr(t)){const r=t.getStartEndPoints();null===r&&q$5(143);const[i]=r,o=i.getNode(),s=o.getParent();if(Is(o)){const e=o.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=eo();o.append(e),n=e.select().getNodes()}}else if(te$2(o,n)){const t=Te$1(e);if(Is(s)){o.replace(t);const e=fe$2();Wi(o)&&(e.setFormat(o.getFormatType()),e.setIndent(o.getIndent())),t.append(e)}else if(pe$2(o)){const e=o.getParentOrThrow();re$3(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(Wi(i)&&i.isEmpty()&&!pe$2(i)&&!r.has(i.getKey())){ie$2(i,e);continue}let o=Wo(i)?i.getParent():pe$2(i)&&i.isEmpty()?i:null;for(;null!=o;){const t=o.getKey();if(Se$1(o)){if(!r.has(t)){const n=Te$1(e);re$3(n,o.getChildren()),o.replace(n),r.add(t)}break}{const n=o.getParent();if(Is(n)&&!r.has(t)){r.add(t),ie$2(o,e);break}o=n}}}}}function re$3(e,t){e.splice(e.getChildrenSize(),0,t)}function ie$2(e,t){if(Se$1(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=fe$2();let o;if(re$3(i,e.getChildren()),Se$1(n)&&t===n.getListType())n.append(i),Se$1(r)&&t===r.getListType()&&(re$3(n,r.getChildren()),r.remove()),o=n;else if(Se$1(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),o=r;else{const n=Te$1(t);n.append(i),e.replace(n),o=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const s=Qr();return Fr(s)&&(o.getKey()===s.anchor.key&&s.anchor.set(i.getKey(),s.anchor.offset,"element"),o.getKey()===s.focus.key&&s.focus.set(i.getKey(),s.focus.offset,"element")),e.remove(),o}function se$3(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&Z$3(n)&&Z$3(r)&&(se$3(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>
vendor: 1,685 bytes, line 5
50&&e.append(...i),t.remove()}function oe$3(){const e=Qr();if(Fr(e)){const t=new Set,n=e.getNodes(),r=e.anchor.getNode();if(te$2(r,n))t.add(Q$5(r));else for(let e=0;e<n.length;e++){const r=n[e];if(Wo(r)){const e=At$2(r,ge$2);null!=e&&t.add(Q$5(e))}}for(const n of t){let t=n;const r=Y$2(n);for(const n of r){const r=eo().setTextStyle(e.style).setTextFormat(e.format);re$3(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&Hl(e.anchor,rc(Pl(r,"next"))),n.__key===e.focus.key&&Hl(e.focus,rc(Pl(r,"next"))),n.remove()}n.remove()}}}function le$2(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())pe$2(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),Se$1(r.getFirstChild())||n++)}function ce$2(e){const t=new Set;if(Z$3(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(Z$3(r)&&Z$3(i)){const n=i.getFirstChild();if(Se$1(n)){n.append(e);const i=r.getFirstChild();Se$1(i)&&(re$3(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(Z$3(r)){const t=r.getFirstChild();if(Se$1(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(Z$3(i)){const t=i.getFirstChild();Se$1(t)&&t.append(e)}else if(Se$1(n)){const t=Ks(e),o=Ks(n);t.append(o),o.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function ae$2(e){if(Z$3(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(Se$1(n?n.getParent():void 0)&&pe$2(n)&&Se$1(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=Ks(e),i=Ks(t);
5r.append(i),e.getPreviousSiblings().forEach((e=>i.append(e)));const o=Ks(e),s=Ks(t);o.append(s),re$3(s,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(o),n.replace(e)}}}function ue$2(e=!1){const t=Qr();if(!Fr(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let r=null;if(pe$2(n)&&0===n.getChildrenSize())r=n;else if(Tr(n)){const e=n.getParent();pe$2(e)&&e.getChildren().every((e=>Tr(e)&&""===e.getTextContent().trim()))&&(r=e)}if(null===r)return!1;const i=Q$5(r),o=r.getParent();Se$1(o)||q$5(40);const s=o.getParent();let l;if(Is(s))l=eo(),i.insertAfter(l);else{if(!pe$2(s))return!1;l=Ks(s),s.insertAfter(l)}l.setTextStyle(t.style).setTextFormat(t.format).select();const a=r.getNextSiblings();if(a.length>0){const t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(o,r):1,n=Ks(o).setStart(t);if(pe$2(l)){const e=Ks(l);e.append(n),l.insertAfter(e)}else l.insertAfter(n);n.append(...a)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!pe$2(e)&&!Se$1(e))break;t=e}t.remove()}(r),!0}function he$2(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return de$2(t);if(e.classList.contains("joplin-checkbox"))for(const t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return de$2(t.children[0]);const t=e.getAttribute("aria-checked");return{node:fe$2("true"===t||"false"!==t&&void 0)}}function de$2(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:fe$2(e.hasAttribute("checked"))}}function fe$2(e){return zs(new ge$2(void 0,e))}function pe$2(e){return e instanceof ge$2}function _e$1(e,t,n){const r=[],i=[],o=t.list;if(void 0!==o){const e=o[`${n.__tag}Depth`]||[],t=G$7(n)-1,s=t%e.length,l=e[s],a=o[n.__tag];let c;const u=o.nested,d=o.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==a&&r.push(a),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==l){r.push(...yc(l));for(let t=0;t<e.length;t++)t!==s&&i.push(n.__tag+t)}if(void 0!==c){const e=yc(c);t>1?r.push(...e):i.push(...e)}}i.length>0&&xc(e,...i),r.length>0&&mc(e,...r)}function Ce$1(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(pe$2(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{Se$1(e)&&t.push(ee$1(e))}))}else t.push(ee$1(r))}return t}function ye$1(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=Te$1("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(const t of e.childNodes)if(Ys(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?Te$1("check"):Te$1("bullet")),{after:Ce$1,node:n}}function Te$1(e="number",t=1){return zs(new me$2(e,t))}function Se$1(e){return e instanceof me$2}function Ie$2(e){return Cc(e.registerCommand(Oe$1,(()=>(ne$2("number"),!0)),io),e.registerCommand(Fe$1,(e=>{const{listNodeKey:t,newStart:n}=e,r=Yo(t);return!!Se$1(r)&&("number"===r.getListType()&&(r.setStart(n),le$2(r)),!0)}),io),e.registerCommand(Ee$2,(()=>(ne$2("bullet"),!0)),io),e.registerCommand(Ae$2,(()=>(oe$3(),!0)),io),e.registerCommand(he$3,(()=>ue$2(!1)),io),e.registerNodeTransform(ge$2,(e=>{const t=e.getFirstChild();if(t){if(Tr(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=Qr();Fr(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}})),e.registerNodeTransform(gr,(e=>{const t=e.getParent();if(pe$2(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}})))}function D$1(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 A$1(e,t){const{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function E$2(e){return C$3&&C$3.editor===e?C$3:void 0}function N$2(e,t){if("cfg"in t){const{cfg:n,updater:r}=t;
5return[n,r(A$1(e,n))]}return t}function P$2(e,t){let n=t;for(const r of e){const[e,i]=N$2(n,r),o=e.key;if(n===t&&A$1(n,e)===i)continue;const s=n||T$1(t);s[o]=i,n=s}return n}function T$1(e){return Object.create(e||null)}function j$4(e,t){return[e,t]}function R$2(e){return t=>t instanceof e}function W$4(e,{nodes:t}){if("*"===t)return I$4;let n={};const r=[];for(const i of t)if("getType"in i){const t=i.getType();if(n){const r=e[t];void 0===r&&D$1(339,i.name,t),n=Object.assign(n,r.types)}r.push(R$2(i))}else n=void 0,r.push(i);return n||(1===r.length?r[0]:e=>{for(const t of r)if(t(e))return!0;return!1})}function q$4(e){return(t,n,r)=>e(t,r)}function B$4(e){return(t,n,r,i)=>e(t,n,i)}function U$4(e){return(t,n,r,i,o)=>e(t,n,r,o)}function V$5(e){return(t,n,r,i,o,s)=>e(t,n,r,i,s)}function H$4(e,t){return(n,r)=>{const i=()=>e(n,r),o=t(n);return o?o(n,i,r):i()}}function Y$1(e,t){return(n,r,i)=>{const o=()=>e(n,r,i),s=t(n);return s?s(n,r,o,i):o()}}function _$2(e,t){return(n,r,i,o)=>{const s=()=>e(n,r,i,o),l=t(n);return l?l(n,r,i,s,o):s()}}function z$4(e,t){return(n,r,i,o,s)=>{const l=()=>e(n,r,i,o,s),a=t(n);return a?a(n,r,i,o,l,s):l()}}function G$6(e,t){return(n,r,i,o)=>{e(n,r,i,o);const s=t(n);s&&s(n,r,i,o)}}function J$5(e,t,n,r,i){let o=n[t];for(const n of e[t])if("function"==typeof n[0]){const[e,t]=n;o=r(o,(n=>e(n)&&t||void 0))}else{const e=n[1],t={};for(const n in e){const i=e[n];i&&(t[n]=i.reduce(((e,t)=>r(e,(()=>t))),o))}o=r(o,(e=>{const n=t[e.getType()];return n&&i(n)}))}n[t]=o}function K$2(e,t,n,r){if(!r)return;const i=e[t];if("function"==typeof n)i.push([n,r]);else{const e=i[i.length-1];let t;e&&"types"===e[0]?t=e[1]:(t={},i.push(["types",t]));for(const e in n){const n=t[e]||[];t[e]=n,n.push(r)}}}
5function Q$4(e){return"*"===e.nodes}function X$3(e,t){const n=function(e){const t={},{nodes:n}=Ct$1(e);for(const e of n)t[e.getType()]={klass:e,types:{}};for(const e of Object.values(t))if(e){const n=e.klass.getType();for(let{klass:r}=e;Bn(r.prototype);r=Object.getPrototypeOf(r)){const{ownNodeType:e}=ul(r),i=e&&t[e];i&&(i.types[n]=!0)}}return t}(e),r={$createDOM:[],$decorateDOM:[],$exportDOM:[],$extractWithChild:[],$getDOMSlot:[],$shouldExclude:[],$shouldInclude:[],$updateDOM:[]};for(const e of function(e){const t=[],n=[],r=[];for(const i of e)if(Q$4(i))t.push(i);else if(Array.isArray(i.nodes))for(const e of i.nodes)Bn(e.prototype)?r.push(1===i.nodes.length?i:{...i,nodes:[e]}):n.push(1===i.nodes.length?i:{...i,nodes:[e]});const i=new Map,o=e=>{let t=i.get(e);if(void 0===t){t=0;for(let n=e;Bn(n.prototype);n=Object.getPrototypeOf(n))t++;i.set(e,t)}return t};return r.sort(((e,t)=>o(e.nodes[0])-o(t.nodes[0]))),[...r,...n,...t]}(t)){const t=W$4(n,e);for(const n in r)K$2(r,n,t,e[n])}return r}function Z$2(e){return e}function nt$2(e,t,n){return function(e,t,n,r){return Object.assign(ot$3(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}(F$3,e,t,n)}function rt$2(e){const t=de$3.maybeFromEditor(e);return t&&t.hasExtensionByName(L$4)?ue$3(e,tt$2).output.defaults:void 0}function lt(e){return e.constructor.name===CSSStyleRule.name}function dt$1(e,t){zo(t)&&function(e){function t(e){let t=n.get(e);if(void 0===t){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}if(null===e.querySelector("style"))return;const n=new Map;try{for(const n of Array.from(e.styleSheets)){let r;try{r=n.cssRules}catch(e){continue}for(const n of Array.from(r)){if(!lt(n))continue;let r;try{r=e.querySelectorAll(n.selectorText)}catch(e){continue}for(const e of Array.from(r)){if(!Ys(e))continue;const r=t(e);for(let t=0;t<n.style.length;t++){const i=n.style[t];r.has(i)||e.style.setProperty(i,n.style.getPropertyValue(i),n.style.getPropertyPriority(i))}}}}}catch(e){}}(t);const n=zo(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(const t of n)if(!ft.has(t.nodeName)){const n=gt$1(t,e,i,!1);if(null!==n)for(const e of n)r.push(e)}return function(e){for(const t of e)t.getParent()&&t.getNextSibling()instanceof Qi&&t.insertAfter(or());for(const t of e){const e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function at$1(e,t=null,n=Zs()){return ut$1([j$4(ot$1,!0)],n)((()=>{const r=Zo(),i=tl(n),o=e.append.bind(e);for(const e of r.getChildren())yt$3(n,e,o,t,i);return e}))}function ht$1(e,t=null){return("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)&&D$1(338),at$1(document.createElement("div"),t,e).innerHTML} 6function yt$3(e,t,n,r=null,i=tl(e)){let o=i.$shouldInclude(t,r,e);const s=i.$shouldExclude(t,r,e);let l=t;null!==r&&Tr(t)&&(l=R$3(r,t,"clone"));const a=i.$exportDOM(l,e),{element:c,after:u,append:d,$getChildNodes:h}=a;if(!c)return!1;const g=document.createDocumentFragment(),p=h?h():Wi(l)?l.getChildren():[],f=g.append.bind(g);for(const n of p){const s=yt$3(e,n,f,r,i);!o&&s&&i.$extractWithChild(t,n,r,"html",e)&&(o=!0)}if(o&&!s){if((Ys(c)||Hs(c))&&(d?d(g):c.append(g)),n(c),u){const e=u.call(l,c);e&&(Hs(c)?c.replaceChildren(e):c.replaceWith(e))}}else n(g);return o}function gt$1(e,t,n,r,i=new Map,o){const s=[];if(ft.has(e.nodeName))return s;let l=null;const a=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let i=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===i||(i.priority||0)<=(n.priority||0))&&(i=n)}return null!==i?i.conversion:null}(e,t),c=a?a(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(l=Array.isArray(t)?t[t.length-1]:t,null!==l){for(const[,e]of i)if(l=e(l,o),!l)break;l&&s.push(...Array.isArray(t)?t:[l])}null!=c.forChild&&i.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const g=(null==l||!Is(l))&&(null!=l&&Vr(l)||r);for(let e=0;e<d.length;e++)h.push(...gt$1(d[e],t,n,g,new Map(i),l));if(null!=u&&(h=u(h)),Xs(e)&&(h=mt$2(e,h,g?()=>{const e=new Qi;return n.push(e),e}:eo)),null==l)if(h.length>0)for(const e of h)s.push(e);else Xs(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&(Gs(e.nextSibling)&&Gs(e.previousSibling))}(e)&&s.push(or());else Wi(l)&&l.append(...h);return s}function mt$2(e,t,n){const r=e.style.textAlign,i=[];let o=[];for(let e=0;e<t.length;e++){const s=t[e];if(Vr(s))r&&!s.getFormat()&&s.setFormat(r),i.push(s);else if(o.push(s),e===t.length-1||e<t.length-1&&Vr(t[e+1])){const e=n();e.setFormat(r),e.append(...o),i.push(e),o=[]}}return i}function _$1(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 J$4(e,t=Qr()){return null==t&&_$1(166),Fr(t)&&t.isCollapsed()||0===t.getNodes().length?"":ht$1(e,t)}function L$3(e,t=Qr()){return null==t&&_$1(166),Fr(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(X$2(e,t))}function j$3(e,t){const n=e.getData("text/plain")||e.getData("text/uri-l
6ist");null!=n&&t.insertRawText(n)}function I$3(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return z$3(n,Y(e.nodes),t)}catch(e){console.error(e)}const i=e.getData("text/html"),o=e.getData("text/plain");if(i&&o!==i)try{return z$3(n,dt$1(n,(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(i),"text/html")),t)}catch(e){console.error(e)}const s=o||e.getData("text/uri-list");if(null!=s)if(Fr(t)){const e=s.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=Qr();if(Fr(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([wr()]):n.insertText(r)}}}else t.insertRawText(s)}function B$3(e,t){const n={editorKey:t.getKey()};e.setData(k$2,JSON.stringify(n))}function H$3(e){const t=function(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}(e.clientX,e.clientY);if(null===t)return null;const n=Go(t.node);if(null===n)return null;if(Tr(n))return Ml(n,"next",t.offset);if(Wi(n))return lc(n,t.offset,"next");const r=n.getParent();return null===r?null:lc(r,n.getIndexWithinParent()+1,"next")}function U$3(e,t,n){const r=e.dataTransfer;if(null===r)return!1;const i=function(e){const t=e.getData(k$2);if(!t)return null;let n;try{n=JSON.parse(t)}catch(e){return null}return null!==(r=n)&&"object"==typeof r&&"editorKey"in r&&"string"==typeof r.editorKey?n:null;var r}(r);if(null===i)return!1;const o=H$3(e);if(null===o)return!1;const s=fc(o);if(null===s)return!1;const l=i.editorKey===t.getKey(),a=Qr();if(l){if(!Fr(a)||a.isCollapsed())return!1;if(function(e,t){const{anchor:n,focus:r}=sc(Ql(t),"next");return Jl(n,e)<0&&Jl(e,r)<0}(o,a))return e.preventDefault(),!0;a.removeText()}if(!s.origin.isAttached())return e.preventDefault(),!0;if(n(r,Gl(Bl(s)),t),!l){const e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){const n=t.querySelectorAll('[data-lexical-editor="true"]');for(const t of Array.from(n)){const n=t.__lexicalEditor;if(n&&n.getKey()===e)return t}return null}(i.editorKey,n):null;null!==r&&r.dispatchEvent(new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,inputType:"deleteByDrag"}))}return e.preventDefault(),!0}function W$3(e,t){return U$3(e,t,I$3)}function q$3(e,t){return U$3(e,t,((e,t)=>j$3(e,t)))}function z$3(e,t,n){e.dispatchCommand(oe$6,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Fr(e)&&e.isCollapsed()){let t=null;const n=ql(e.anchor,"previous");if(n)if(vl(n))t=n.origin;else{const e=Wl(n,Pl(Zo(),"next").getFlipped());for(const n of e){if(Tr(n.origin)){t=n.origin;break}if(Wi(n.origin)&&!n.origin.isInline())break}}if(t&&Tr(t)){const n=t.getFormat(),r=t.getStyle();e.format===n&&e.style===r||(e.format=n,e.style=r,e.dirty=!0)}}}(n))}function G$5(e,t,n,r=[]){let i=null===t||n.isSelected(t);const o=Wi(n)&&n.excludeFromCopy("html");let s=n;null!==t&&Tr(s)&&(s=R$3(t,s,"clone"));const l=Wi(s)?s.getChildren():[],a=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&_$1(58,n.name),Wi(e)){const e=t.children;Array.isArray(e)||_$1(59,n.name)}return t}(s);Tr(s)&&0===s.getTextContentSize()&&(i=!1);for(let r=0;r<l.length;r++){const o=l[r],s=G$5(e,t,o,a.children);!i&&Wi(n)&&s&&n.extractWithChild(o,t,"clone")&&(i=!0)}if(i&&!o)r.push(a);else if(Array.isArray(a.children))for(let e=0;e<a.children.length;e++){const t=a.children[e];r.push(t)}return i}function X$2(e,t){const n=[],r=Zo().getChildren();for(let i=0;i<r.length;i++)G$5(e,t,r[i],n);return{namespace:e._config.namespace,nodes:n}}function Y(e){const t=[];for(let n=0;n<e.length;n++){const r=Ei(e[n]);t.push(r)}return t}async function V$4(e,t,n){if(null!==Q$3)return!1;if(null!==t)return new Promise((r=>{e.update((()=>{r(Z$1(e,t,n))}))}));const r=e.getRootElement(),i=e._window||window,o=i.document,s=Js(i);if(null===r||null===s)return!1;const l=o.createElement("span");l.style.position="fixed",l.style.top="-1000px",l.append(o.createTextNode("#")),r.append(l);const a=new Range;return a.setStart(l,0),a.setEnd(l,1),s.removeAllRanges(),s.addRange(a),new Promise((t=>{const r=e.registerCommand(Je$2,(o=>(Bt$3(o,ClipboardEvent)&&(r(),null!==Q$3&&(i.clearTimeout(Q$3),Q$3=null),t(Z$1(e,o,n))),!0)),lo);Q$3=i.setTimeout((()=>{r(),Q$3=null,t(!1)}),50),o.execCommand("copy"),l.remove()}))}function Z$1(e,t,n){if(void 0===n){const t=Js(e._window),r=Qr();if(!r||r.isCollapsed())return!1;if(!t)return!1;const i=t.anchorNode,o=t.focusNode;if(null!==i&&null!==o&&!Mo(e,i,o))return!1;n=et(r)}t.preventDefault();const r=t.clipboardData;return null!==r&&(nt$1(r,n),!0)}function et(e=Qr()){return function(e,t){const n={"text/plain":""};for(const[r,i]of Object.entries(e)){const e=ot(i,t);null!==e&&(n[r]=e)}return n}(function(){const e=Zs(),t=de$3.maybeFromEditor(e);return t&&t.hasExtensionByName(it.name)?ue$3(e,it).output:rt$1}(),e)}function nt$1(e,t){for(const[n]of tt$1)void 0===t[n]&&e.setData(n,"");for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}function ot(e,t){const n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}function s(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const i=n.data;if("string"==typeof i){let t;try{t=JSON.parse(i)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,i,o,s,l]=t;e.update((()=>{const e=Qr();if(Fr(e)){const t=e.anchor;let a=t.getNode(),c=0,u=0;if(Tr(a)&&r>=0&&i>=0&&(c=r,u=r+i,e.setTextNodeRange(a,c,a,u)),c===u&&""===o||(e.insertRawText(o),a=t.getNode()),Tr(a)){c=s,u=s+l;const t=a.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(a,c,a,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}function G$4(e,t){t.update((()=>
6{if(null!==e){const n=Bt$3(e,KeyboardEvent)?null:e.clipboardData,r=Qr();if(null!==r&&!r.isCollapsed()&&null!=n){e.preventDefault();const i=J$4(t);null!==i&&n.setData("text/html",i),n.setData("text/plain",r.getTextContent())}}}))}function H$2(e){return Cc(e.registerCommand(fe$4,(e=>{const t=Qr();return!!Fr(t)&&(t.deleteCharacter(e),!0)}),ro),e.registerCommand(ye$2,(e=>{const t=Qr();return!!Fr(t)&&(t.deleteWord(e),!0)}),ro),e.registerCommand(me$3,(e=>{const t=Qr();return!!Fr(t)&&(t.deleteLine(e),!0)}),ro),e.registerCommand(ge$3,(e=>{const t=Qr();if(!Fr(t))return!1;if("string"==typeof e)t.insertText(e);else{const n=e.dataTransfer;if(null!=n)j$3(n,t);else{const n=e.data;n&&t.insertText(n)}}return!0}),ro),e.registerCommand(pe$3,(()=>{const e=Qr();return!!Fr(e)&&(e.removeText(),!0)}),ro),e.registerCommand(de$4,(e=>{const t=Qr();return!!Fr(t)&&(t.insertLineBreak(e),!0)}),ro),e.registerCommand(he$3,(()=>{const e=Qr();return!!Fr(e)&&(e.insertLineBreak(),!0)}),ro),e.registerCommand(Ne$1,(e=>{const t=Qr();if(!Fr(t))return!1;const n=e,r=n.shiftKey;return!!Q$8(t,!0)&&(n.preventDefault(),ee$3(t,r,!0),!0)}),ro),e.registerCommand(ke$2,(e=>{const t=Qr();if(!Fr(t))return!1;const n=e,r=n.shiftKey;return!!Q$8(t,!1)&&(n.preventDefault(),ee$3(t,r,!1),!0)}),ro),e.registerCommand(Ae$3,(t=>!!Fr(Qr())&&(!V$3||"ko-KR"!==navigator.language)&&(t.preventDefault(),e.dispatchCommand(fe$4,!0))),ro),e.registerCommand(Pe$2,(t=>!!Fr(Qr())&&(t.preventDefault(),e.dispatchCommand(fe$4,!1))),ro),e.registerCommand(Oe$2,(t=>{if(!Fr(Qr()))return!1;if(null!==t){if((V$3||q$2||F$2)&&R$1)return!1;t.preventDefault()}return e.dispatchCommand(de$4,!1)}),ro),e.registerCommand(Ue$2,(()=>(ys(),!0)),ro),e.registerCommand(Je$2,(t=>!!Fr(Qr())&&(G$4(t,e),!0)),ro),e.registerCommand(je$2,(t=>!!Fr(Qr())&&(function(e,t){G$4(e,t),t.update((()=>{const e=Qr();Fr(e)&&e.removeText()}))}(t,e),!0)),ro),e.registerCommand(_e$2,(t=>!!Fr(Qr())&&(function(e,t){e.preventDefault(),t.update((()=>{const t=Qr(),n=Bt$3(e,ClipboardEvent)?e.clipboardData:null;null!=n&&Fr(t)&&j$3(n,t)}),{tag:jn})}(t,e),!0)),ro),e.registerCommand(ze$2,(t=>q$3(t,e)),ro),e.registerCommand(Be$2,(t=>{const n=Qr();return!!Fr(n)&&(n.isCollapsed()||null===t.dataTransfer||B$3(t.dataTransfer,e),!0)}),ro))}function yt$2(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}function St$1(){return zs(new At$1)}function Mt$2(e){return e instanceof At$1}function bt$1(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function Kt$2(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=Jt$2(t),null!==e.style&&(sl(e,n),n.setFormat(e.style.textAlign))),{node:n}}function kt$2(e){const t=St$1();return null!==e.style&&(t.setFormat(e.style.textAlign),sl(e,t)),{node:t}}function Jt$2(e="h1"){return zs(new It$1(e))}function Lt$2(e){return e instanceof It$1}function Wt$2(e){let t=null;if(Bt$3(e,DragEvent)?t=e.dataTransfer:Bt$3(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),i=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),i]}function Rt$2(e){return ji(Go(e))}function qt$2(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function zt$2(e){return Cc(e.registerCommand(se$5,(()=>{const e=Qr();return!!Ir(e)&&(e.clear(),!0)}),ro),e.registerCommand(fe$4,(e=>{const t=Qr();return Fr(t)?(t.deleteCharacter(e),!0):!!Ir(t)&&(t.deleteNodes(),!0)}),ro),e.registerCommand(ye$2,(e=>{const t=Qr();return!!Fr(t)&&(t.deleteWord(e),!0)}),ro),e.registerCommand(me$3,(e=>{const t=Qr();return!!Fr(t)&&(t.deleteLine(e),!0)}),ro),e.registerCommand(ge$3,(t=>{const n=Qr();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)I$3(r,n,e);else if(Fr(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),ro),e.registerCommand(pe$3,(()=>{const e=Qr();return!!Fr(e)&&(e.removeText(),!0)}),ro),e.registerCommand(xe,(e=>{const t=Qr();return!!Fr(t)&&(t.formatText(e),!0)}),ro),e.registerCommand(Re$1,(e=>{const t=Qr();if(!Fr(t)&&!Ir(t))return!1;const n=t.getNodes();for(const t of n){const n=dl(t,(e=>Wi(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),ro),e.registerCommand(de$4,(e=>{const t=Qr();return!!Fr(t)&&(t.insertLineBreak(e),!0)}),ro),e.registerCommand(he$3,(()=>{const e=Qr();return!!Fr(e)&&(e.insertParagraph(),!0)}),ro),e.registerCommand(Le$2,(()=>{const e=wr(),t=Qr();return Fr(t)&&(e.setFormat(t.format),e.setStyle(t.style)),li([e]),!0}),ro),e.registerCommand(Ie$3,(()=>_t$2((e=>{const t=e.getIndent();e.setIndent(t+1)}))),ro),e.registerCommand(Ke$2,(()=>_t$2((e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}))),ro),e.registerCommand(we$1,(e=>{const t=Qr();if(Ir(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}else if(Fr(t)){const n=vs(t.focus,!0);if(!e.shiftKey&&ji(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),ro),e.registerCommand(Ee$3,(e=>{const t=Qr();if(Ir(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}else if(Fr(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===Zo().getChildrenSize()}(t))return e.preventDefault(),!0;const n=vs(t.focus,!1);if(!e.shiftKey&&ji(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),ro),e.registerCommand(Ne$1,(e=>{const t=Qr();if(Ir(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),O$3(n[0])?n[0].selectNext(0,0):n[0].selectPrevious(),!0}if(!Fr(t))return!1;if(Q$8(t,!0)){const n=e.shiftKey;return e.preventDefault(),ee$3(t,n,!0),!0}return!1}),ro),e.registerCommand(ke$2,(e=>{const t=Qr();if(Ir(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),O$3(n[0])?n[0].selectPrevious():n[0].selectNext(0,0),!0}if(!Fr(t))return!1;const n=e.shiftKey;return!!Q$8(t,!1)&&(e.preventDefault(),ee$3(t,n,!1),!0)}),ro),e.registerCommand(Ae$3,(t=>{if(Rt$2(t.target))return!1;const n=Qr();
6if(Fr(n)){if(function(e){if(!e.isCollapsed())return!1;const{anchor:t}=e;if(0!==t.offset)return!1;const n=t.getNode();if(Vi(n))return!1;const r=Nt$2(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(Ke$2,void 0);if(wt$1&&"ko-KR"===navigator.language)return!1}else if(!Ir(n))return!1;return t.preventDefault(),e.dispatchCommand(fe$4,!0)}),ro),e.registerCommand(Pe$2,(t=>{if(Rt$2(t.target))return!1;const n=Qr();return!(!Fr(n)&&!Ir(n))&&(t.preventDefault(),e.dispatchCommand(fe$4,!1))}),ro),e.registerCommand(Oe$2,(t=>{const n=Qr();if(!Fr(n))return!1;if(qt$2(n),null!==t){if((wt$1||Et$1||Ot$2)&&Nt$1)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(de$4,!1)}return e.dispatchCommand(he$3,void 0)}),ro),e.registerCommand(De$2,(()=>!!Fr(Qr())&&(e.blur(),!0)),ro),e.registerCommand(ze$2,(t=>{const[,n]=Wt$2(t);if(n.length>0){const r=yt$2(t.clientX,t.clientY);if(null!==r){const{offset:t,node:i}=r,o=Go(i);if(null!==o){const e=qr();if(Tr(o))e.anchor.set(o.getKey(),t,"text"),e.focus.set(o.getKey(),t,"text");else{const t=o.getParentOrThrow().getKey(),n=o.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}es(St$3(e))}e.dispatchCommand(Pt$2,n)}return t.preventDefault(),!0}return W$3(t,e)}),ro),e.registerCommand(Be$2,(t=>{const[n]=Wt$2(t),r=Qr();return!(n&&!Fr(r)||(Fr(r)&&!r.isCollapsed()&&null!==t.dataTransfer&&(nt$1(t.dataTransfer,et(r)),B$3(t.dataTransfer,e)),0))}),ro),e.registerCommand(We$2,(e=>{const[t]=Wt$2(e),n=Qr();if(t&&!Fr(n))return!1;const r=yt$2(e.clientX,e.clientY);if(null!==r){ji(Go(r.node))&&e.preventDefault()}return!0}),ro),e.registerCommand(Ue$2,(()=>(ys(),!0)),ro),e.registerCommand(Je$2,(t=>(V$4(e,Bt$3(t,ClipboardEvent)?t:null),!0)),ro),e.registerCommand(je$2,(t=>(async function(e,t){await V$4(t,Bt$3(e,ClipboardEvent)?e:null),t.update((()=>{const e=Qr();Fr(e)?e.removeText():Ir(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),ro),e.registerCommand(_e$2,(t=>{const[,n,r]=Wt$2(t);return n.length>0&&!r?(e.dispatchCommand(Pt$2,n),!0):(!qs(t.target)||!Oo(t.target))&&(null!==Qr()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=Qr(),r=Bt$3(e,InputEvent)||Bt$3(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&I$3(r,n,t)}),{tag:jn})}(t,e),!0))}),ro),e.registerCommand(Me$2,(()=>{const e=Qr();return Fr(e)&&qt$2(e),!1}),ro),e.registerCommand(Fe$2,(()=>{const e=Qr();return Fr(e)&&qt$2(e),!1}),ro))}function bytesToHumanSize(e){if(0===e)return"0 B";const t=["B","KB","MB","GB","TB","PB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(2)} ${t[n]}`}function extractFileName(e){return e.split("/").pop()}function parseAttachmentContent(e){try{return JSON.parse(e)}catch{return e}}function mimeTypeToExtension(e){if(!e)return null;return e.split("/")[1]}function $isCustomActionTextAttachmentNode(e){return e instanceof CustomActionTextAttachmentNode}function dasherize(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function isAutolinkableURL(e){return/^(?:[a-z0-9]+:\/\/|www\.)[^\s]+$/i.test(e)}function normalizeFilteredText(e){return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function filterMatchPosition(e,t){const n=normalizeFilteredText(e),r=normalizeFilteredText(t);if(!r)return 0;const i=n.match(new RegExp(`(?<![\\p{L}\\p{N}])${escapeForRegExp(r)}`,"u"));return i?i.index:-1}function upcaseFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}function escapeForRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function parseBoolean(e){return"string"==typeof e?"true"===e:Boolean(e)}function C$2(e,t,n,r,i){if(null===e||0===n.size&&0===r.size&&!i)return 0;const o=t._selection,s=e._selection;if(i)return 1;if(!(Fr(o)&&Fr(s)&&s.isCollapsed()&&o.isCollapsed()))return 0;const l=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||Vi(n)||i.push(n)}return i}(t,n,r);if(0===l.length)return 0;if(l.length>
61){const n=t._nodeMap,r=n.get(o.anchor.key),i=n.get(s.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&Tr(r)&&1===r.__text.length&&1===o.anchor.offset?2:0}const a=l[0],c=e._nodeMap.get(a.__key);if(!Tr(c)||!Tr(a)||c.__mode!==a.__mode)return 0;const u=c.__text,d=a.__text;if(u===d)return 0;const h=o.anchor,g=s.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 b$1(e,t,n){let r=n(),i=0,o=r,s=0,l=null;return(a,c,u,d,h,g)=>{const p=n();if(g.has(Gn)&&(o=r,s=i,l=a),g.has(Wn$1))return i=0,r=p,2;g.has(Xn)&&l&&(r=o,i=s,a=l);const f=C$2(a,c,d,h,e.isComposing()),m=(()=>{const n=null===u||u.editor===e,o=g.has($n$1);if(!o&&n&&g.has(Jn))return 0;if(1===f)return 2;if(null===a)return 1;const s=c._selection;if(!(d.size>0||h.size>0))return null!==s?0:2;const l="number"==typeof t?t:t.peek();return!1===o&&0!==f&&f===i&&p<r+l&&n||1===d.size&&function(e,t,n){const r=t._nodeMap.get(e),i=n._nodeMap.get(e),o=t._selection,s=n._selection;return!(Fr(o)&&Fr(s)&&"element"===o.anchor.type&&"element"===o.focus.type&&"text"===s.anchor.type&&"text"===s.focus.type||!Tr(r)||!Tr(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>i.exportJSON())))}(Array.from(d)[0],a,c)?0:1})();return r=p,i=f,m}}function w$2(e){e.undoStack=[],e.redoStack=[],e.current=null}function E$1(e,t,n,r=Date.now){const i=b$1(e,n,r);return Cc(e.registerCommand(Ce$2,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const i=t.current,o=r.pop();null!==i&&(n.push(i),e.dispatchCommand(qe$2,!0)),0===r.length&&e.dispatchCommand(He$2,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:Wn$1})}}(e,t),!0)),ro),e.registerCommand(Se$2,(()=>(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(He$2,!0));const o=n.pop();0===n.length&&e.dispatchCommand(qe$2,!1),t.current=o||null,o&&o.editor.setEditorState(o.editorState,{tag:Wn$1})}}(e,t),!0)),ro),e.registerCommand(Ve$2,(()=>(w$2(t),!1)),ro),e.registerCommand(Ye$1,(()=>(w$2(t),e.dispatchCommand(qe$2,!1),e.dispatchCommand(He$2,!1),!0)),ro),e.registerUpdateListener((({editorState:n,prevEditorState:r,dirtyLeaves:o,dirtyElements:s,tags:l})=>{const a=t.current,c=t.redoStack,u=t.undoStack,d=null===a?null:a.editorState;if(null!==a&&n===d)return;const h=i(r,n,a,o,s,l);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(qe$2,!1)),null!==a&&(u.push({...a}),e.dispatchCommand(He$2,!0));else if(2===h)return;t.current={editor:e,editorState:n}})))}function M$2(){return{current:null,redoStack:[],undoStack:[]}}function $containsRangeSelection(e,t=Qr()){if(Fr(t)){const{commonAncestor:n}=Yl(t.focus.getNode(),t.anchor.getNode());return dl(n,(t=>t.is(e)))}return!1}function $createNodeSelectionWith(...e){const t=Hr();return e.forEach((e=>t.add(e.getKey()))),t}function $isShadowRoot(e){return Wi(e)&&Is(e)&&!Vi(e)}function $isSafeForRoot(e){return(Wi(e)||ji(e))&&!e.isParentRequired()}function $makeSafeForRoot(e){return $isSafeForRoot(e)?e:e.getParent()?Tt$4(e,(()=>e.createParentElementNode())):e.createParentElementNode().append(e)}function getListType(e){const t=At$2(e,me$2);return t?.getListType()??null}function isEditorFocused(e){const t=e.getRootElement();return null!==t&&t.contains(document.activeElement)}function $isAtNodeEdge(e,t=null){return null===t?$isAtNodeEdge(e,!0)||$isAtNodeEdge(e,!1):t?$isAtNodeStart(e):A$2(e)}function $isAtNodeStart(e){return 0===e.offset}function extendTextNodeConversion(e,...t){return extendConversion(gr,e,((e,n)=>({...e,forChild:(r,i)=>{const o=e?.forChild??(e=>e);let s=o(r,i);if(Tr(s))return s=t.reduce(((e,t)=>t(e,n)??e),s),s}})))}function extendConversion(e,t,n=e=>e){return r=>{const i=e.importDOM()?.[t]?.(r);if(!i)return null;const o=i.conversion(r);return o?n(o,r)??o:o}}function $isCursorOnLastLine(e){const t=e.anchor.getNode(),n=Wi(t)?t:t.getParentOrThrow(),r=n.getChildren();if(0===r.length)return!0;const i=r[r.length-1];if(t===n.getLatest()&&e.anchor.offset===r.length)return!0;
6if(t===i)return!0;const o=r.findLastIndex((e=>sr(e)));if(-1===o)return!0;return r.indexOf(t)>o}function $isBlankNode(e){if(""!==e.getTextContent().trim())return!1;const t=e.getChildren?.();return!t||0===t.length||t.every((e=>!!sr(e)||$isBlankNode(e)))}function $trimTrailingBlankNodes(e){for(const t of zt$4(e)){if(!$isBlankNode(t))break;t.remove()}}function $isListItemStructurallyEmpty(e){const t=e.getChildren();for(const e of t){if(ji(e))return!1;if(!sr(e))if(Tr(e)){if(""!==e.getTextContent().trim())return!1}else if(Wi(e)&&""!==e.getTextContent().trim())return!1}return!0}function $textBeforeOffset(e,t){function n(o){if(!i){if(o===e)return r.push(o.getTextContent().slice(0,t)),void(i=!0);if(Wi(o)){const e=o.getChildren();for(let t=0;t<e.length;t++){if(n(e[t]),i)return;const o=e[t];Wi(o)&&!o.isInline()&&t<e.length-1&&r.push("\n\n")}}else r.push(o.getTextContent())}}const r=[];let i=!1;return n(Zo()),r.join("")}function isAttachmentSpacerTextNode(e,t,n,r){return Tr(e)&&" "===e.getTextContent()&&n===r-1&&t instanceof CustomActionTextAttachmentNode}function $splitSelectedParagraphsAtInnerLineBreaks(e){const t=new Set;for(const n of e.getNodes()){const e=n.getTopLevelElement();e&&t.add(e)}for(const e of t){if(!no(e))continue;const t=e.getChildren();if(!t.some(sr))continue;const n=[[]];for(const e of t)sr(e)?(n.push([]),e.remove()):n[n.length-1].push(e);for(const t of n){if(0===t.length)continue;const n=eo();t.forEach((e=>n.append(e))),e.insertBefore(n)}n.some((e=>e.length>0))&&e.remove()}}function $expandSelectionToLineBreaksAndSplitAtEdges(e,t=e=>e.getTopLevelElement()){j$6(e),$shrinkSelectionPastBlockEdges(e);const n=ql(e.focus,"next"),r=ql(e.anchor,"previous"),i=e.isCollapsed(),o=$getCaretAtLineBreakBoundary(n,i);let s=$getCaretAtLineBreakBoundary(r,i);o?.origin.is(s?.origin)&&(s=null);const l=o&&$splitAroundLineBreak(o),a=s&&$splitAroundLineBreak(s),c=a?.getNextSibling()??t(e.anchor.getNode()),u=l?.getPreviousSibling()??t(e.focus.getNode());c&&u&&Gl(Wl(rc(Pl(c,"next")),oc(rc(Pl(u,"previous")),"next")))}function $shrinkSelectionPastBlockEdges(e){if(e.isCollapsed())return;const t=e.anchor.getNode().getTopLevelElement(),n=e.focus.getNode().getTopLevelElement();if(t&&n&&!t.is(n)){if($isAtBlockEnd(e.anchor,t)){const n=$nearestElementSibling(t,"next");n&&e.anchor.set(n.getKey(),0,"element")}if($isAtBlockStart(e.focus,n)){const t=$nearestElementSibling(n,"previous");t&&e.focus.set(t.getKey(),t.getChildrenSize(),"element")}j$6(e)}}function $nearestElementSibling(e,t){let n=e;do{n="next"===t?n.getNextSibling():n.getPreviousSibling()}while(n&&!Wi(n));return n}function $isAtBlockEnd(e,t){return $isAtBlockBoundary(ql(e,"next"),t)}function $isAtBlockStart(e,t){return $isAtBlockBoundary(ql(e,"previous"),t)}function $isAtBlockBoundary(e,t){if(vl(e)&&ic(e))return!1;let n=rc(e);for(;n&&t.isParentOf(n.origin);){if(n.getNodeAtCaret())return!1;n=n.getParentCaret()}return!0}function $getCaretAtLineBreakBoundary(e,t=!1){const n=e.origin.getTopLevelElement();if(!n||!no(n))return null;const r=(t?null:$inwardEdgeLineBreak(e,n))??$outwardLineBreak(e,n);return r?Ol(r,e.direction):null}function $inwardEdgeLineBreak(e,t){let n;if(Nl(e)&&e.origin.is(t)||vl(e)&&ic(e.getFlipped()))n=null;else if(Tl(e)&&e.getParentAtCaret().is(t))n=e;else{const r=$paragraphChildCaretAtInwardEdge(e,t);n=r?Zl(r):null}return n&&sr(n.origin)?$candidateUnlessShadowed(n):null}function $candidateUnlessShadowed(e){return sr(e.getNodeAtCaret())?null:e.origin}function $outwardLineBreak(e,t){const n=$outwardWalkStartCaret(e,t);if(!n)return null;for(const{origin:e}of n){if(!e.getParent().is(t))break;if(sr(e))return e}return null}function $outwardWalkStartCaret(e,t){return e.getParentAtCaret().is(t)?e:$paragraphChildCaretContaining(e,t)}function $paragraphChildCaretContaining(e,t){let n=e.getSiblingCaret();for(;n&&!n.origin.getParent()?.is(t);)n=n.getParentCaret();return n?.origin.getParent()?.is(t)?n:null}function $paragraphChildCaretAtInwardEdge(e,t){let n=e.getSiblingCaret();for(;n&&!n.origin.getParent()?.is(t);){if(n.getNodeAtCaret())return null;n=n.getParentCaret()}return n?.origin.getParent()?.is(t)?n:null}function $splitAroundLineBreak(e){let t=null;if(null===e.getNodeAtCaret())e.origin.remove();else{const n=e.origin;fc(oc(Zl(e),"next")),t=n.getTopLevelElement(),n.remove()}return t}function $isPointOnBlockContainer(e){if("element"!==e.type)return!1;const t=e.getNode().getFirstChild();return(Wi(t)||ji(t))&&!t.isInline()}function $hasPointOnBlockContainer(e){return Fr(e)&&[e.anchor,e.focus].some($isPointOnBlockContainer)}function $normalizeBlockContainerSelection(e=Qr()){return!!$hasPointOnBlockContainer(e)&&(St$3(e),!0)}function $consecutiveSiblingGroups(e){const t=[...e].sort(((e,t)=>e.getIndexWithinParent()-t.getIndexWithinParent())),n=[];for(const e of t){const t=n.at(-1),r=t?.at(-1);r&&r.getParent().is(e.getParent())&&r.getNextSibling()?.is(e)?t.push(e):n.push([e])}return n}function $cloneNodeWithPatch(e,t){const n=il(e);return Object.assign(n,t),n}function $cloneNodeAdoptingKeys(e,t){const n=il(e);return n.__key=t.__key,n.__parent=t.__parent,n.__prev=t.__prev,n.__next=t.__next,n}function safeCloneEditorState(e){const t=e.clone();return t._nodeMap=new Map(e._nodeMap),t}function $createActionTextAttachmentNode(...e){return new ActionTextAttachmentNode(...e)}function $isActionTextAttachmentNode(e){return e instanceof ActionTextAttachmentNode}function filterDisallowedAttachmentNodes(e,t){return e.filter((e=>!isDisallowedAttachment(e,t))).map((e=>(Ht$3([e],(e=>
6isDisallowedAttachment(e,t))).forEach((e=>e.remove())),e)))}function isDisallowedAttachment(e,t){return(e instanceof CustomActionTextAttachmentNode||e instanceof ActionTextAttachmentNode)&&!t.permitsAttachmentContentType(e.contentType)}function $convertInlineImageDataURIs(e,t){const n=e.map((e=>isInlineImageDataURIAttachment(e)?$tryCreateUploadFromDataURI(e,t):e)).filter((e=>null!==e));for(const e of n)for(const n of Ht$3([e],isInlineImageDataURIAttachment)){const e=$tryCreateUploadFromDataURI(n,t);e?n.replace(e):n.remove()}return n}function isInlineImageDataURIAttachment(e){return e instanceof ActionTextAttachmentNode&&/^data:image\/[^,]*;base64,/i.test(e.src??"")}function $tryCreateUploadFromDataURI(e,t){const n=dataURIToFile(e.src);return n&&t.acceptsFile(n)?t.contents.$createUploadNode(n):null}function dataURIToFile(e){try{const[t,n]=e.split(","),r=t.match(/^data:(image\/[A-Za-z0-9][A-Za-z0-9!#$&\-^_.+]*)/)?.[1];if(r){const e=Uint8Array.from(atob(n),(e=>e.charCodeAt(0))),t=mimeTypeToExtension(r)??"png";return new File([e],`pasted-image-${Date.now()}.${t}`,{type:r})}return null}catch{return null}}function C$1(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 N$1(e,t){let n=e;for(let r=Ol(e,t);r&&(X$1(r.origin)||Er(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function O(e){return N$1(e,"previous")}function A(e){return N$1(e,"next")}function H$1(e){const t=O(e),n=A(e);let r=t;for(;null!==r;){if(X$1(r)){const e=Fo(r.getTextContent());if(null!==e)return e}if(r===n)break;r=r.getNextSibling()}const i=t.getParent();if(Wi(i)){const e=i.getDirection();if("ltr"===e||"rtl"===e)return e}return null}function L$2(e,t){let n=null,r=null,i=e,o=t,s=e.getTextContent();for(;;){if(0===o){if(i=i.getPreviousSibling(),null===i)break;if(X$1(i)||Er(i)||sr(i)||C$1(167),sr(i)){n={node:i,offset:1};break}o=Math.max(0,i.getTextContentSize()-1),s=i.getTextContent()}else o--;const e=s[o];X$1(i)&&" "!==e&&(r={node:i,offset:o})}if(null!==r)return r;let l=null;if(t<e.getTextContentSize())X$1(e)&&(l=e.getTextContent()[t]);else{const t=e.getNextSibling();X$1(t)&&(l=t.getTextContent()[0])}if(null!==l&&" "!==l)return n;{const r=function(e,t){let n=e,r=t,i=e.getTextContent(),o=e.getTextContentSize();for(;;){if(!X$1(n)||r===o){if(n=n.getNextSibling(),null===n||sr(n))return null;X$1(n)&&(r=0,i=n.getTextContent(),o=n.getTextContentSize())}if(X$1(n)){if(" "!==i[r])return{node:n,offset:r};r++}}}(e,t);return null!==r?r:n}}function F$1(e){const t=A(e);return sr(t)&&C$1(168),t}function M$1(e,t){for(const n of e.childNodes){if(Ys(n)&&n.tagName===t)return!0;M$1(n,t)}return!1}function I$1(e,t){return fl(z$1).setLanguage(e).setTheme(t)}function W$1(e){return e instanceof z$1}function j$1(e){return{node:I$1(e.getAttribute(k$1))}}function R(e){const t=e,n=$$1(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if($$1(t))return!0;t=t.parentElement}return!1}(t)?{node:n?I$1():null}:{node:null}}function B$1(){return{node:I$1()}}function U$2(){return{node:null}}function $$1(e){return null!==e.style.fontFamily.match("monospace")}function q$1(e){return e.classList.contains("js-file-line-container")}function G$3(e){const{anchor:t}=e;if(e.isCollapsed()&&"element"===t.type){const e=t.getNode();if(W$1(e)){const n=e.getChildrenSize();if(n>=2&&t.offset===n){const t=e.getLastChild();if(sr(t)&&sr(t.getPreviousSibling())){const t=eo();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}function Q$2(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function V$2(e="",t){return zs(new K$1(e,t))}function X$1(e){return e instanceof K$1}function J$2(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(), 7Error(`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 V$1(e){return G$2[e]||e}function te$1(e){const t=function(e){const t=/^diff-([\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&U$1.languages.hasOwnProperty(n)}catch(e){return!1}}async function ne$1(){}function re$2(e){return"string"==typeof e?e:Array.isArray(e)?e.map(re$2).join(""):re$2(e.content)}function oe$2(e,t){const n=/^diff-([\w-]+)/i.exec(t),r=e.getTextContent();let i=U$1.tokenize(r,U$1.languages[n?"diff":t]);return n&&(i=function(e,t){const n=t,r=U$1.languages[n],i={tokens:e},o=U$1.languages.diff.PREFIXES;for(const e of i.tokens){if("string"==typeof e||!(e.type in o)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const i=()=>(n++,new U$1.Token("prefix",o[t],t.replace(/^(\w+).*/,"$1"))),s=e.content.filter((e=>"string"==typeof e||"prefix"!==e.type)),l=e.content.length-s.length,a=U$1.tokenize(re$2(s),r);a.unshift(i());const c=/\r\n|\n/g,u=e=>{const t=[];c.lastIndex=0;let r,o=0;for(;n<l&&(r=c.exec(e));){const n=r.index+r[0].length;t.push(e.slice(o,n)),o=n,t.push(i())}if(0!==t.length)return o<e.length&&t.push(e.slice(o)),t},d=e=>{for(let t=0;t<e.length&&n<l;t++){const n=e[t];if("string"==typeof n){const r=u(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if("string"==typeof n.content){const e=u(n.content);e&&(n.content=e)}else Array.isArray(n.content)?d(n.content):d([n.content])}};d(a),n<l&&a.push(i()),e.content=a}return i.tokens}(i,n[1])),se$2(i)}function se$2(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(or()):"\t"===i?n.push(wr()):i.length>0&&n.push(V$2(i,t))}}else{const{content:e,alias:t}=r;"string"==typeof e?n.push(...se$2([e],"prefix"===r.type&&"string"==typeof t?t:r.type)):Array.isArray(e)&&n.push(...se$2(e,"unchanged"===r.type?void 0:r.type))}return n}function ce$1(e,t,n,r){const i=r.getParent();W$1(i)?ae$1(e,t,n,i):X$1(r)&&r.replace(kr(r.__text))}function le$1(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 o="1",s=1;for(let e=0;e<i;e++)sr(r[e])&&(o+="\n"+ ++s);n.setAttribute("data-gutter",o)}function ae$1(e,t,n,r){const{nodesCurrentlyHighlighting:i}=n,o=r.getKey();void 0===r.getLanguage()&&r.setLanguage(t.defaultLanguage);if(!te$1(r.getLanguage()||t.defaultLanguage))return r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1),void ne$1();r.getIsSyntaxHighlightSupported()||r.setIsSyntaxHighlightSupported(!0),i.has(o)||
7(i.add(o),n.didTransform||(n.didTransform=!0,Ms((()=>{n.didTransform=!1,i.clear()}))),function(e,t){const n=Yo(e);if(!W$1(n)||!n.isAttached())return;const r=Qr();if(!Fr(r))return void t();const i=r.anchor,o=i.offset,s="element"===i.type&&sr(n.getChildAtIndex(i.offset-1));let l=0;if(!s){const e=i.getNode();l=o+e.getPreviousSiblings().reduce(((e,t)=>e+t.getTextContentSize()),0)}t()&&(s?i.getNode().select(o,o):n.getChildren().some((e=>{const t=Tr(e);if(t||sr(e)){const n=e.getTextContentSize();if(t&&n>=l)return e.select(l,l),!0;l-=n}return!1})))}(o,(()=>{const e=Yo(o);if(!W$1(e)||!e.isAttached())return!1;const n=e.getLanguage()||t.defaultLanguage,i=t.$tokenize(e,n),s=function(e,t){let n=0;for(;n<e.length&&fe$1(e[n],t[n]);)n++;const r=e.length,i=t.length,o=Math.min(r,i)-n;let s=0;for(;s<o;)if(s++,!fe$1(e[r-s],t[i-s])){s--;break}const l=r-s;return{from:n,nodesForReplacement:t.slice(n,i-s),to:l}}(e.getChildren(),i),{from:l,to:a,nodesForReplacement:c}=s;return!(l===a&&!c.length||(r.splice(l,a-l,c),0))})))}function fe$1(e,t){return X$1(e)&&X$1(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||Er(e)&&Er(t)||sr(e)&&sr(t)}function ue$1(e){if(!Fr(e))return!1;const t=e.anchor.getNode(),n=W$1(t)?t:t.getParent(),r=e.focus.getNode(),i=W$1(r)?r:r.getParent();return W$1(n)&&n.is(i)}function ge$1(e){const t=e.getNodes(),n=[];if(1===t.length&&W$1(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){const i=t[e];X$1(i)||Er(i)||sr(i)||J$2(169),sr(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){const t=e.isBackward()?e.anchor:e.focus,i=Mr(r[0].getKey(),0,"text");t.is(i)||n.push(r)}return n}function pe$1(e){const t=Qr();if(!Fr(t)||!ue$1(t))return!1;const n=ge$1(t),r=n.length;if(0===r&&t.isCollapsed())return e===Ie$3&&t.insertNodes([wr()]),!0;if(0===r&&e===Ie$3&&"\n"===t.getTextContent()){const e=wr(),n=or(),r=t.isBackward()?"previous":"next";return t.insertNodes([e,n]),Gl(sc(Wl(Ml(e,"next",0),rc(Ol(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=O(n)),e===Ie$3){const e=wr();if(n.insertBefore(e),0===i){const r=t.isBackward()?"focus":"anchor",i=Mr(n.getKey(),0,"text");t[r].is(i)&&t[r].set(e.getKey(),0,"text")}}else Er(n)&&n.remove()}}return!0}function de$1(e,t){const n=Qr();if(!Fr(n))return!1;const{anchor:r,focus:i}=n,o=r.offset,s=i.offset,l=r.getNode(),a=i.getNode(),c=e===we$1;if(!ue$1(n)||!X$1(l)&&!Er(l)||!X$1(a)&&!Er(a))return!1;if(!t.altKey){if(n.isCollapsed()){const e=l.getParentOrThrow();if(c&&0===o&&null===l.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!c&&o===l.getTextContentSize()&&null===l.getNextSibling()&&null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}return!1}let u,d;if(l.isBefore(a)?(u=O(l),d=A(a)):(u=O(a),d=A(l)),null==u||null==d)return!1;const h=u.getNodesBetween(d);for(let e=0;e<h.length;e++){const t=h[e];if(!X$1(t)&&!Er(t)&&!sr(t))return!1}t.preventDefault(),t.stopPropagation();const g=c?u.getPreviousSibling():d.getNextSibling();if(!sr(g))return!0;const p=c?g.getPreviousSibling():g.getNextSibling();if(null==p)return!0;const f=X$1(p)||Er(p)||sr(p)?c?O(p):A(p):null;let m=null!=f?f:p;return g.remove(),h.forEach((e=>e.remove())),e===we$1?(h.forEach((e=>m.insertBefore(e))),m.insertBefore(g)):(m.insertAfter(g),m=g,h.forEach((e=>{m.insertAfter(e),m=e}))),n.setTextNodeRange(l,o,a,s),!0}function me$1(e,t){const n=Qr();if(!Fr(n))return!1;const{anchor:r,focus:i}=n,o=r.getNode(),s=i.getNode(),l=e===be$1;if(!ue$1(n)||!X$1(o)&&!Er(o)||!X$1(s)&&!Er(s))return!1;const a=s;if("rtl"===H$1(a)?!l:l){const e=L$2(a,i.offset);if(null!==e){const{node:t,offset:r}=e;sr(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else a.getParentOrThrow().selectStart()}else F$1(a).select();return t.preventDefault(),t.stopPropagation(),!0}function he$1(e,t){if(!e.hasNodes([z$1,K$1]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");null==t&&(t=ie$1);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(z$1,(t=>{e.getEditorState().read((()=>{for(const[n,r]of t)if("destroyed"!==r){const t=Yo(n);null!==t&&le$1(t,e)}}))}),{skipInitialization:!1}));const r={didTransform:!1,nodesCurrentlyHighlighting:new Set};return n.push(e.registerNodeTransform(z$1,ae$1.bind(null,e,t,r)),e.registerNodeTransform(gr,ce$1.bind(null,e,t,r)),e.registerNodeTransform(K$1,ce$1.bind(null,e,t,r)),e.registerCommand(Fe$2,(t=>{const n=function(e){const t=Qr();if(!Fr(t)||!ue$1(t))return null;const n=e?Ke$2:Ie$3,r=e?Ke$2:Le$2,i=t.anchor,o=t.focus;if(i.is(o))return r;const s=ge$1(t);if(1!==s.length)return n;const l=s[0];let a,c;0===l.length&&J$2(285),t.isBackward()?(a=o,c=i):(a=i,c=o);const u=O(l[0]),d=A(l[0]),h=Mr(u.getKey(),0,"text"),g=Mr(d.getKey(),d.getTextContentSize(),"text");return a.isBefore(h)||g.isBefore(c)?n:h.isBefore(a)||c.isBefore(g)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)}),io),e.registerCommand(Le$2,(()=>
7!!ue$1(Qr())&&(li([wr()]),!0)),io),e.registerCommand(Ie$3,(()=>pe$1(Ie$3)),io),e.registerCommand(Ke$2,(()=>pe$1(Ke$2)),io),e.registerCommand(we$1,(e=>{const t=Qr();if(!Fr(t)||!ue$1(t))return!1;const n=Zo().getFirstDescendant(),{anchor:r}=t,i=r.getNode();return(!n||!i||n.getKey()!==i.getKey())&&de$1(we$1,e)}),io),e.registerCommand(Ee$3,(e=>{const t=Qr();if(!Fr(t)||!ue$1(t))return!1;const n=Zo().getLastDescendant(),{anchor:r}=t,i=r.getNode();return(!n||!i||n.getKey()!==i.getKey())&&de$1(Ee$3,e)}),io),e.registerCommand(be$1,(e=>me$1(be$1,e)),io),e.registerCommand(Te$2,(e=>me$1(Te$2,e)),io)),Cc(...n)}function G$1(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}function H(e){const t=G$1(e,(e=>e.type));return{element:t.element||[],multilineElement:t["multiline-element"]||[],textFormat:t["text-format"]||[],textMatch:t["text-match"]||[]}}function Z(e){return e.replace(/\\([!-/:-@[-`{-~])/g,"$1").replace(/&#(\d+);/g,((e,t)=>String.fromCodePoint(Number(t))))}function at(e){return Tr(e)&&!e.hasFormat("code")}function ht(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 ee(e,t,n,r,i){if(!Is(e.getParent())||e.getFirstChild()!==t)return!1;const o=t.getTextContent();if(!i&&" "!==o[n-1])return!1;for(const{regExpStart:s,replace:l,regExpEnd:a}of r){if(a&&!("optional"in a)||a&&"optional"in a&&!a.optional)continue;const r=o.match(s);if(r){const o=i||r[0].endsWith(" ")?n:n-1;if(r[0].length!==o)continue;const s=t.getNextSiblings(),[a,c]=t.splitText(n);if(!1!==l(e,c?[c,...s]:s,r,null,null,!1))return a.remove(),!0}}return!1}function ne(e,t){let n=0;const r=e.getTextContent();for(let e=0;e<t;e++)"`"===r[e]&&n++;return n%2!=0}function oe$1(e,t,n){const r=n.length;for(let i=t;i>=r;i--){const t=i-r;if(re$1(e,t,n,0,r)&&" "!==e[t+r])return t}return-1}function re$1(e,t,n,r,i){for(let o=0;o<i;o++)if(e[t+o]!==n[r+o])return!1;return!0}function se$1(e,t=te){const n=H(t),r=G$1(n.textFormat,(({tag:e})=>e[e.length-1])),i=G$1(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)||ht(173,n.getType())}}const o=(e,t,o)=>!!(function(e,t,n,r){if(!Is(e.getParent())||e.getFirstChild()!==t)return!1;const i=t.getTextContent();if(" "!==i[n-1])return!1;for(const{regExp:o,replace:s}of r){const r=i.match(o);if(r&&r[0].length===(r[0].endsWith(" ")?n:n-1)){const i=t.getNextSiblings(),[o,l]=t.splitText(n);if(!1!==s(e,l?[l,...i]:i,r,!1))return o.remove(),!0}}return!1}(e,t,o,n.element)||ee(e,t,o,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,o=i+n[0].length;let s;return 0===i?[s]=e.splitText(o):[,s]=e.splitText(i,o),s.selectNext(0,0),t.replace(s,n),!0}return!1}(t,o,i)||function(e,t,n){const r=e.getTextContent(),i=t-1,o=r[i],s=n[o];if(!s)return!1;for(const t of s){const{tag:n}=t,s=n.length,l=i-s+1;if(s>1&&!re$1(r,l,n,0,s))continue;if(" "===r[l-1])continue;const a=r[i+1];if(!1===t.intraword&&a&&!J$1.test(a))continue;const c=e;let u=c,d=oe$1(r,l,n),h=u;for(;d<0&&(h=h.getPreviousSibling())&&!sr(h);)if(Tr(h)){if(h.hasFormat("code"))continue;const e=h.getTextContent();u=h,d=oe$1(e,e.length,n)}if(d<0)continue;if(u===c&&d+s===l)continue;const g=u.getTextContent();if(d>0&&g[d-1]===o)continue;const p=g[d-1];if(!1===t.intraword&&p&&!J$1.test(p))continue;if(!t.format.includes("code")&&ne(u,d))continue;const f=c.getTextContent(),m=f.slice(0,l)+f.slice(i+1);c.setTextContent(m);const y=u===c?m:g;u.setTextContent(y.slice(0,d)+y.slice(d+s));const b=Qr(),$=qr();es($);const _=i-s*(u===c?2:1)+1;$.anchor.set(u.__key,d,"text"),$.focus.set(c.__key,_,"text");for(const e of t.format)$.hasFormat(e)||$.formatText(e);$.anchor.set($.focus.key,$.focus.offset,$.focus.type);for(const e of t.format)$.hasFormat(e)&&$.toggleFormat(e);return Fr(b)&&($.format=b.format),!0}return!1}(t,o,r));return Cc(e.registerUpdateListener((({tags:t,dirtyLeaves:n,editorState:r,prevEditorState:i})=>{if(t.has(Un)||t.has(Wn$1))return;if(e.isComposing())return;const s=r.read(Qr),l=i.read(Qr);if(!Fr(l)||!Fr(s)||!s.isCollapsed()||s.is(l))return;const a=s.anchor.key,c=s.anchor.offset,u=r._nodeMap.get(a);!Tr(u)||!n.has(a)||1!==c&&c>l.anchor.offset+1||e.update((()=>
7{if(!at(u))return;const e=u.getParent();null===e||W$1(e)||o(e,u,s.anchor.offset)&&Os($n$1)}))})),e.registerCommand(Oe$2,(e=>{if(null!==e&&e.shiftKey)return!1;const t=Qr();if(!Fr(t)||!t.isCollapsed())return!1;const r=t.anchor.offset,i=t.anchor.getNode();if(!Tr(i)||!at(i))return!1;const o=i.getParent();return null!==o&&!W$1(o)&&(r===i.getTextContent().length&&!!ee(o,i,r,n.multilineElement,!0)&&(null!==e&&e.preventDefault(),!0))}),io))}function registerMarkdownLeadingTagHandler(e,t){const n=t.filter((e=>"text-format"===e.type)).sort(((e,t)=>t.tag.length-e.tag.length));return e.registerUpdateListener((({tags:t,dirtyLeaves:r,editorState:i,prevEditorState:o})=>{if(t.has("historic")||t.has("collaboration"))return;if(e.isComposing())return;const s=i.read(Qr),l=o.read(Qr);if(!Fr(l)||!Fr(s)||!s.isCollapsed())return;const a=s.anchor.key,c=s.anchor.offset;if(!r.has(a))return;const u=i.read((()=>Yo(a)));if(!Tr(u))return;if(c<=(l.anchor.key===a?l.anchor.offset:0))return;const d=i.read((()=>u.getTextContent()));for(const t of n){const n=t.tag,r=n.length,i=c-r;if(i<0)continue;if(d.slice(i,c)!==n)continue;const o=n[0];if(i>0&&d[i-1]===o)continue;if(!1===t.intraword&&i>0){const e=d[i-1];if(e&&!PUNCTUATION_OR_SPACE.test(e))continue}const s=c,l=d.indexOf(n,s);if(l<0)continue;if(d[l+r]===o)continue;if(l>0&&d[l-1]===o)continue;const u=l;if(!(u<=c)&&(" "!==d[c]&&" "!==d[u-1])){if(!1===t.intraword){const e=d[l+r];if(e&&!PUNCTUATION_OR_SPACE.test(e))continue}e.update((()=>{const e=Yo(a);if(!e||!Tr(e))return;const n=e.getParent();null===n||W$1(n)||$applyFormatFromLeadingTag(e,i,t)}));break}}}))}function $applyFormatFromLeadingTag(e,t,n){const r=n.tag,i=r.length,o=e.getTextContent(),s=t+i,l=o.indexOf(r,s);if(l<0)return;const a=o.slice(s,l);if(0===a.length)return;const c=o.slice(0,t),u=o.slice(l+i);e.setTextContent(c+a+u);const d=qr();es(d),d.anchor.set(e.getKey(),t,"text"),d.focus.set(e.getKey(),t+a.length,"text");for(const e of n.format)d.hasFormat(e)||d.formatText(e);d.anchor.set(d.focus.key,d.focus.offset,d.focus.type);for(const e of n.format)d.hasFormat(e)&&d.toggleFormat(e)}function ke$1(e){return"middle"===e||"bottom"===e}function Me$1(e){const t=e,n=e.nodeName.toLowerCase();let r;Ke$1.test(t.style.width)&&(r=parseFloat(t.style.width));let i=Ae$1.NO_STATUS;if("th"===n){const e=t.getAttribute("scope");if("col"===e)i=Ae$1.COLUMN;else if("row"===e)i=Ae$1.ROW;else{const e=t.parentElement,n=Ys(e)&&"tr"===e.nodeName.toLowerCase()&&Ys(e.parentElement)&&("thead"===e.parentElement.nodeName.toLowerCase()||0===e.rowIndex),r=0===t.cellIndex;n&&(i|=Ae$1.ROW),r&&(i|=Ae$1.COLUMN),i===Ae$1.NO_STATUS&&(i=Ae$1.ROW)}}const o=$e$1(i,t.colSpan,r);o.__rowSpan=t.rowSpan;const s=t.style.backgroundColor;""!==s&&(o.__backgroundColor=s);const l=t.style.verticalAlign;ke$1(l)&&(o.__verticalAlign=l);const a=t.style,c=(a&&a.textDecoration||"").split(" "),u="700"===a.fontWeight||"bold"===a.fontWeight,d=c.includes("line-through"),h="italic"===a.fontStyle,g=c.includes("underline"),p=a.color;return{after:e=>{const t=[];let n=null;const r=()=>{if(n){const e=n.getFirstChild();sr(e)&&1===n.getChildrenSize()&&e.remove()}};for(const i of e)if(Fs(i)||Tr(i)||sr(i)){if(Tr(i)&&(u&&i.toggleFormat("bold"),d&&i.toggleFormat("strikethrough"),h&&i.toggleFormat("italic"),g&&i.toggleFormat("underline"),p)){const e=i.getStyle();e.includes("color:")||i.setStyle(e+`color: ${p};`)}n?n.append(i):(n=eo().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),0===t.length&&t.push(eo()),t},node:o}}function $e$1(e=Ae$1.NO_STATUS,t=1,n){return zs(new Ee$1(e,t,n))}function We$1(e){return e instanceof Ee$1}function Le$1(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 Be$1(e){const t=e;let n;return Ke$1.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>Ht$3(e,We$1),node:Pe$1(n)}}function Pe$1(e){return zs(new He$1(e))}function De$1(e){return e instanceof He$1}function Xe$1(e,t,n=!0){const r=Fn();for(let i=0;i<e;i++){const e=Pe$1();for(let r=0;r<t;r++){let t=Ae$1.NO_STATUS;"object"==typeof n?(0===i&&n.rows&&(t|=Ae$1.ROW),0===r&&n.columns&&(t|=Ae$1.COLUMN)):n&&(0===i&&(t|=Ae$1.ROW),0===r&&(t|=Ae$1.COLUMN));const o=$e$1(t),s=eo();s.append(kr()),o.append(s),e.append(o)}r.append(e)}return r}function Ye(e){const t=dl(e,(e=>We$1(e)));return We$1(t)?t:null}function qe$1(e){const t=dl(e,(e=>De$1(e)));if(De$1(t))return t;throw new Error("Expected table cell to be inside of table row.")}function je$1(e){const t=dl(e,(e=>Rn(e)));if(Rn(t))return t;throw new Error("Expected table cell to be inside of table.")}function Ve$1(e){const t=qe$1(e);return je$1(t).getChildren().findIndex((e=>e.is(t)))}function Ge$1(e){return qe$1(e).getChildren().findIndex((t=>t.is(e)))}function nt(e=!0){const t=Qr();Fr(t)||Ot(t)||Le$1(188);const n=t.anchor.getNode(),r=t.focus.getNode(),[i]=yt(n),[o,,s]=yt(r),[,l,a]=wt(s,o,i),{startRow:c}=a,{startRow:u}=l;return e?rt(c+i.__rowSpan>u+o.__rowSpan?i:o,!0):rt(u<c?o:i,!1)}function rt(e,t=!0){const[,,n]=yt(e),[r,i]=wt(n,e,e),o=r[0].length,{startRow:s}=i;let l=null;if(t){const t=s+e.__rowSpan-1,i=r[t],a=Pe$1();for(let e=0;e<o;e++){const{cell:n,startRow:r}=i[e];if(r+n.__rowSpan-1<=t){const t=i[e].cell.__headerState,n=tt(t,Ae$1.COLUMN);a.append($e$1(n).append(eo()))}else n.setRowSpan(n.__rowSpan+1)}const c=n.getChildAtIndex(t);De$1(c)||Le$1(256),c.insertAfter(a),l=a}else{const e=s,t=r[e],i=Pe$1();for(let n=0;n<o;n++){const{cell:r,startRow:o}=t[n];if(o===e){const e=t[n].cell.__headerState,r=tt(e,Ae$1.COLUMN);i.append($e$1(r).append(eo()))}else r.setRowSpan(r.__rowSpan+1)}const a=n.getChildAtIndex(e);De$1(a)||Le$1(257),a.insertBefore(i),l=i}return l}function st(e=!0){const t=Qr();Fr(t)||Ot(t)||Le$1(188);const n=t.anchor.getNode(),r=t.focus.getNode(),[i]=yt(n),[o,,s]=yt(r),[,l,a]=wt(s,o,i),{startColumn:c}
7=a,{startColumn:u}=l;return e?ct(c+i.__colSpan>u+o.__colSpan?i:o,!0):ct(u<c?o:i,!1)}function ct(e,t=!0,n=!0){function r(e=Ae$1.NO_STATUS){const t=$e$1(e).append(eo());return null===d&&(d=t),t}const[,,i]=yt(e),[o,s]=wt(i,e,e),l=o.length,{startColumn:a}=s,c=t?a+e.__colSpan-1:a-1,u=i.getFirstChild();De$1(u)||Le$1(120);let d=null,h=u;e:for(let e=0;e<l;e++){if(0!==e){const e=h.getNextSibling();De$1(e)||Le$1(121),h=e}const t=o[e],n=t[c<0?0:c].cell.__headerState,i=tt(n,Ae$1.ROW);if(c<0){mt(h,r(i));continue}const{cell:s,startColumn:l,startRow:a}=t[c];if(l+s.__colSpan-1<=c){let n=s,o=a,l=c;for(;o!==e&&n.__rowSpan>1;){if(l-=s.__colSpan,!(l>=0)){h.append(r(i));continue e}{const{cell:e,startRow:r}=t[l];n=e,o=r}}n.insertAfter(r(i))}else s.setColSpan(s.__colSpan+1)}null!==d&&n&>(d);const g=i.getColWidths();if(g){const e=[...g],t=c<0?0:c,n=e[t];e.splice(t,0,n),i.setColWidths(e)}return d}function ut(){const e=Qr();Fr(e)||Ot(e)||Le$1(188);const[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=yt(t),[o]=yt(n),[s,l,a]=wt(i,r,o),{startRow:c}=l,{startRow:u}=a,d=u+o.__rowSpan-1;if(s.length===d-c+1)return void i.remove();const h=s[0].length,g=s[d+1],p=i.getChildAtIndex(d+1);for(let e=d;e>=c;e--){for(let t=h-1;t>=0;t--){const{cell:n,startRow:r,startColumn:i}=s[e][t];if(i===t){if(r<c||r+n.__rowSpan-1>d){const e=Math.max(r,c),t=Math.min(n.__rowSpan+r-1,d),i=e<=t?t-e+1:0;n.setRowSpan(n.__rowSpan-i)}if(r>=c&&r+n.__rowSpan-1>d&&e===d){null===p&&Le$1(122);let r=null;for(let n=0;n<t;n++){const t=g[n],i=t.cell;t.startRow===e+1&&(r=i),i.__colSpan>1&&(n+=i.__colSpan-1)}null===r?mt(p,n):r.insertAfter(n)}}}const t=i.getChildAtIndex(e);De$1(t)||Le$1(206,String(e)),t.remove()}if(void 0!==g){const{cell:e}=g[0];gt(e)}else{const e=s[c-1],{cell:t}=e[0];gt(t)}}function dt(){const e=Qr();Fr(e)||Ot(e)||Le$1(188);const t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=yt(t),[o]=yt(n),[s,l,a]=wt(i,r,o),{startColumn:c}=l,{startRow:u,startColumn:d}=a,h=Math.min(c,d),g=Math.max(c+r.__colSpan-1,d+o.__colSpan-1),p=g-h+1;if(s[0].length===g-h+1)return i.selectPrevious(),void i.remove();const f=s.length;for(let e=0;e<f;e++)for(let t=h;t<=g;t++){const{cell:n,startColumn:r}=s[e][t];if(r<h){if(t===h){const e=h-r;n.setColSpan(n.__colSpan-Math.min(p,n.__colSpan-e))}}else if(r+n.__colSpan-1>g){if(t===g){const e=g-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}const m=s[u],y=c>d?m[c+r.__colSpan]:m[d+o.__colSpan];if(void 0!==y){const{cell:e}=y;gt(e)}else{const e=d<c?m[d-1]:m[c-1],{cell:t}=e;gt(t)}const b=i.getColWidths();if(b){const e=[...b];e.splice(h,p),i.setColWidths(e)}}function gt(e){const t=e.getFirstDescendant();null==t?e.selectStart():t.getParentOrThrow().selectStart()}function mt(e,t){const n=e.getFirstChild();null!==n?n.insertBefore(t):e.append(t)}function pt(e){if(0===e.length)return null;const t=je$1(e[0]),[n]=bt(t,null,null);let r=1/0,i=-1/0,o=1/0,s=-1/0;const l=new Set;for(const t of n)for(const n of t){if(!n||!n.cell)continue;const t=n.cell.getKey();if(!l.has(t)&&e.some((e=>
vendor: 4,540 bytes, line 7
7e.is(n.cell)))){l.add(t);const e=n.startRow,a=n.startColumn,c=n.cell.__rowSpan||1,u=n.cell.__colSpan||1;r=Math.min(r,e),i=Math.max(i,e+c-1),o=Math.min(o,a),s=Math.max(s,a+u-1)}}if(r===1/0||o===1/0)return null;const a=i-r+1,c=s-o+1,u=n[r][o];if(!u.cell)return null;const d=u.cell;d.setColSpan(c),d.setRowSpan(a);const h=new Set([d.getKey()]);for(let e=r;e<=i;e++)for(let t=o;t<=s;t++){const r=n[e][t];if(!r.cell)continue;const i=r.cell,o=i.getKey();h.has(o)||(h.add(o),Ct(i)||d.append(...i.getChildren()),i.remove())}return 0===d.getChildrenSize()&&d.append(eo()),d}function Ct(e){if(1!==e.getChildrenSize())return!1;const t=e.getFirstChildOrThrow();return!(!no(t)||!t.isEmpty())}function St(e){const[t,n,r]=yt(e),i=t.__colSpan,o=t.__rowSpan;if(1===i&&1===o)return;const[s,l]=wt(r,t,t),{startColumn:a,startRow:c}=l,u=t.__headerState&Ae$1.COLUMN,d=Array.from({length:i},((e,t)=>{let n=u;for(let e=0;0!==n&&e<s.length;e++)n&=s[e][t+a].cell.__headerState;return n})),h=t.__headerState&Ae$1.ROW,g=Array.from({length:o},((e,t)=>{let n=h;for(let e=0;0!==n&&e<s[0].length;e++)n&=s[t+c][e].cell.__headerState;return n}));if(i>1){for(let e=1;e<i;e++)t.insertAfter($e$1(d[e]|g[0]).append(eo()));t.setColSpan(1)}if(o>1){let e;for(let t=1;t<o;t++){const r=c+t,o=s[r];e=(e||n).getNextSibling(),De$1(e)||Le$1(125);let l=null;for(let e=0;e<a;e++){const t=o[e],n=t.cell;t.startRow===r&&(l=n),n.__colSpan>1&&(e+=n.__colSpan-1)}if(null===l)for(let n=i-1;n>=0;n--)mt(e,$e$1(d[n]|g[t]).append(eo()));else for(let e=i-1;e>=0;e--)l.insertAfter($e$1(d[e]|g[t]).append(eo()))}t.setRowSpan(1)}}function wt(e,t,n){const[r,i,o]=bt(e,t,n);return null===i&&Le$1(207),null===o&&Le$1(208),[r,i,o]}function bt(e,t,n){function r(e){let t=i[e];return void 0===t&&(i[e]=t=[]),t}const i=[];let o=null,s=null;const l=e.getChildren();for(let e=0;e<l.length;e++){const i=l[e];De$1(i)||Le$1(209);const a=r(e);for(let c=i.getFirstChild(),u=0;null!=c;c=c.getNextSibling()){for(We$1(c)||Le$1(147);void 0!==a[u];)u++;const i={cell:c,startColumn:u,startRow:e},{__rowSpan:d,__colSpan:h}=c;for(let t=0;t<d&&!(e+t>=l.length);t++){const n=r(e+t);for(let e=0;e<h;e++)n[u+e]=i}null!==t&&null===o&&t.is(c)&&(o=i),null!==n&&null===s&&n.is(c)&&(s=i)}}return[i,o,s]}function yt(e){let t;if(e instanceof Ee$1)t=e;else if("__type"in e){const n=dl(e,We$1);We$1(n)||Le$1(148),t=n}else{const n=dl(e.getNode(),We$1);We$1(n)||Le$1(148),t=n}const n=t.getParent();De$1(n)||Le$1(149);const r=n.getParent();return Rn(r)||Le$1(210),[t,n,r]}function Nt(e,t,n){let r,i=Math.min(t.startColumn,n.startColumn),o=Math.min(t.startRow,n.startRow),s=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),l=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let t=0;t<e.length;t++)for(let n=0;n<e[0].length;n++){const a=e[t][n];if(!a)continue;const c=a.startColumn+a.cell.__colSpan-1,u=a.startRow+a.cell.__rowSpan-1,d=a.startColumn<=s&&c>=i,h=a.startRow<=l&&u>=o;if(d&&h){const e=Math.min(i,a.startColumn),t=Math.max(s,c),n=Math.min(o,a.startRow),d=Math.max(l,u);e===i&&t===s&&n===o&&d===l||(i=e,s=t,o=n,l=d,r=!0)}}}while(r);return{maxColumn:s,maxRow:l,minColumn:i,minRow:o}}function Tt(e){const[t,,n]=yt(e),r=n.getChildren(),i=r.length,o=r[0].getChildren().length,s=new Array(i);for(let e=0;e<i;e++)s[e]=new Array(o);for(let e=0;e<i;e++){const n=r[e].getChildren();let i=0;for(let r=0;r<n.length;r++){for(;s[e][i];)i++;const o=n[r],l=o.__rowSpan||1,a=o.__colSpan||1;for(let t=0;t<l;t++)for(let n=0;n<a;n++)s[e+t][i+n]=o;if(t===o)return{colSpan:a,columnIndex:i,rowIndex:e,rowSpan:l};i+=a}}return null}function Ft(e){const[[t,n,r,i],[o,s,l,a]]=["anchor","focus"].map((t=>{const n=e[t].getNode(),r=dl(n,We$1);We$1(r)||Le$1(238,t,n.getKey(),n.getType());const i=r.getParent();De$1(i)||Le$1(239,t);const o=i.getParent();return Rn(o)||Le$1(240,t),[n,r,i,o]}));return i.is(a)||Le$1(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:i,focusCell:s,focusNode:o,focusRow:l,focusTable:a}}function Ot(e){return e instanceof Rt}function Kt(){const e=Mr("root",0,"element"),t=Mr("root",0,"element");return new Rt("root",e,t)}function At(e,t,n){e.getKey(),t.getKey(),n.getKey();const r=Qr(),i=Ot(r)?r.clone():Kt();return i.set(e.getKey(),t.getKey(),n.getKey()),i}function Et(e,t){const n=[[e]];for(let e=n.at(-1);void 0!==e&&n.length>0;e=n.at(-1)){const r=e.pop();void 0===r?n.pop():!1!==t(r)&&Wi(r)&&n.push(r.getChildren())}}function kt(e,t=Zs()){const n=Yo(e);Rn(n)||Le$1(231,e);const r=Lt(n,t.getElementByKey(e));return null===r&&Le$1(232,e),{tableElement:r,tableNode:n}}
7function zt(e){return Ys(e)&&"TABLE"===e.nodeName}function Lt(e,t){if(!t)return t;const n=zt(t)?t:t.querySelector("table");return zt(n)||Le$1(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function Ht(e){return e._window}function Bt(e,t){for(let n=t,r=null;null!==n;n=n.getParent()){if(e.is(n))return r;We$1(n)&&(r=n)}return null}function Ut(e,t){const n=e.getRootElement(),r=e._window;if(!n||!r)return()=>{};const i=r=>{const i=r.target;if(0!==r.button||!qs(i)||!n.contains(i))return;const o=function(e){const t=jt(e);if(null===t)return null;let n=t.elem;for(;null!=n;){if("TABLE"===n.nodeName&&Wt in n&&n[Wt])return{cellElement:t,tableElement:n,tableObserver:n[Wt]};n=n.parentNode}return null}(i);e.update((()=>{if(Ot(Qr())){for(const[e]of t.observers.values())e.$clearHighlight(!1);es(null),e.dispatchCommand(ie$4,void 0)}if(!o)return;const{tableObserver:n,tableElement:i,cellElement:s}=o;!function(e,t,n,r,i,o){const s=e._window;if(!s)return;const l=t=>{if(i.isSelecting)return;i.isSelecting=!0,null!==t&&null===i.anchorCell&&e.update((()=>{i.$setAnchorCellForSelection(t)}));const n=()=>{i.isSelecting=!1,s.removeEventListener("pointerup",n),s.removeEventListener("pointermove",l)},l=t=>{if(!(e=>!(1&~e.buttons))(t)&&i.isSelecting)return i.isSelecting=!1,s.removeEventListener("pointerup",n),void s.removeEventListener("pointermove",l);if(!qs(t.target))return;let a=null;const c=!(Je$1||r.contains(t.target));if(c)a=Vt(r,t.target);else for(const e of document.elementsFromPoint(t.clientX,t.clientY))if(a=Vt(r,e),a)break;if(a){const t=a;null===i.anchorCell&&e.update((()=>{i.$setAnchorCellForSelection(t)})),null!==i.focusCell&&a.elem===i.focusCell.elem||(o.setNextFocus({focusCell:a,override:c,tableKey:i.tableNodeKey}),e.dispatchCommand(ie$4,void 0))}};s.addEventListener("pointerup",n,i.listenerOptions),s.addEventListener("pointermove",l,i.listenerOptions)};i.pointerType=t.pointerType;const a=Bs(i.tableNodeKey),c=Zr();if(Je$1&&t.shiftKey&&ln(c,a)&&(Fr(c)||Ot(c))){const e=c.anchor.getNode(),r=Bt(a,c.anchor.getNode());r?(i.$setAnchorCellForSelection(Cn(i,r)),i.$setFocusCellForSelection(n),gn(t)):(a.isBefore(e)?a.selectStart():a.selectEnd()).anchor.set(c.anchor.key,c.anchor.offset,c.anchor.type)}else"touch"!==t.pointerType&&i.$setAnchorCellForSelection(n);l(n)}(e,r,s,i,n,t)}))};return r.addEventListener("pointerdown",i),()=>{r.removeEventListener("pointerdown",i)}}function Jt(e,t,n,r,i){const o=n.getRootElement(),s=Ht(n);null!==o&&null!==s||Le$1(246);const l=new $t(n,e.getKey()),a=Lt(e,t);!function(e,t){null!==qt(e)&&Le$1(205),e[Wt]=t}(a,l),l.listenersToRemove.add((()=>function(e,t){qt(e)===t&&delete e[Wt]}(a,l)));const c=e=>{e.detail>=3&&qs(e.target)&&null!==jt(e.target)&&e.preventDefault()};a.addEventListener("mousedown",c,l.listenerOptions),l.listenersToRemove.add((()=>{a.removeEventListener("mousedown",c)}));for(const[t,r]of Pt)l.listenersToRemove.add(n.registerCommand(t,(t=>fn(n,t,r,e,l,i)),so));l.listenersToRemove.add(n.registerCommand(De$2,(t=>{const n=Qr();if(Ot(n)){const r=Bt(e,n.focus.getNode());if(null!==r)return gn(t),r.selectEnd(),!0}return!1}),so));const u=t=>()=>{const n=Qr();if(!ln(n,e))return!1;if(Ot(n))return l.$clearText(),!0;if(Fr(n)){if(!We$1(Bt(e,n.anchor.getNode())))return!1;const r=n.anchor.getNode(),i=n.focus.getNode(),o=e.isParentOf(r),s=e.isParentOf(i);if(o&&!s||s&&!o)return l.$clearText(),!0;const a=dl(n.anchor.getNode(),(e=>Wi(e))),c=a&&dl(a,(e=>Wi(e)&&We$1(e.getParent())));if(!Wi(c)||!Wi(a))return!1;if(t===me$3&&null===c.getPreviousSibling())return!0}return!1};for(const e of Dt)l.listenersToRemove.add(n.registerCommand(e,u(e),so));const d=t=>{const n=Qr();if(!Ot(n)&&!Fr(n))return!1;const r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){const t=r?"anchor":"focus",i=r?"focus":"anchor",{key:o,offset:s,type:l}=n[i];return e[n[t].isBefore(n[i])?"selectPrevious":"selectNext"]()[i].set(o,s,l),!1}return!!ln(n,e)&&!!Ot(n)&&(t&&(t.preventDefault(),t.stopPropagation()),l.$clearText(),!0)};for(const e of It)l.listenersToRemove.add(n.registerCommand(e,d,so));return l.listenersToRemove.add(n.registerCommand(je$2,(e=>{const t=Qr();if(t){if(!Ot(t)&&!Fr(t))return!1;V$4(n,Bt$3(e,ClipboardEvent)?e:null,et(t));const r=d(e);return Fr(t)?(t.removeText(),!0):r}return!1}
7),so)),l.listenersToRemove.add(n.registerCommand(xe,(t=>{const n=Qr();if(!ln(n,e))return!1;if(Ot(n))return l.$formatCells(t),!0;if(Fr(n)){const e=dl(n.anchor.getNode(),(e=>We$1(e)));if(!We$1(e))return!1}return!1}),so)),l.listenersToRemove.add(n.registerCommand(Re$1,(t=>{const n=Qr();if(!Ot(n)||!ln(n,e))return!1;const r=n.anchor.getNode(),i=n.focus.getNode();if(!We$1(r)||!We$1(i))return!1;if(function(e,t){if(Ot(e)){const n=e.anchor.getNode(),r=e.focus.getNode();if(t&&n&&r){const[e]=wt(t,n,r);return n.getKey()===e[0][0].cell.getKey()&&r.getKey()===e[e.length-1].at(-1).cell.getKey()}}return!1}(n,e))return e.setFormat(t),!0;const[o,s,l]=wt(e,r,i),a=Math.max(s.startRow+s.cell.__rowSpan-1,l.startRow+l.cell.__rowSpan-1),c=Math.max(s.startColumn+s.cell.__colSpan-1,l.startColumn+l.cell.__colSpan-1),u=Math.min(s.startRow,l.startRow),d=Math.min(s.startColumn,l.startColumn),h=new Set;for(let e=u;e<=a;e++)for(let n=d;n<=c;n++){const r=o[e][n].cell;if(h.has(r))continue;h.add(r),r.setFormat(t);const i=r.getChildren();for(let e=0;e<i.length;e++){const n=i[e];Wi(n)&&!n.isInline()&&n.setFormat(t)}}return!0}
7),so)),l.listenersToRemove.add(n.registerCommand(ge$3,(t=>{const r=Qr();if(!ln(r,e))return!1;if(Ot(r))return l.$clearHighlight(),!1;if(Fr(r)){const i=dl(r.anchor.getNode(),(e=>We$1(e)));if(!We$1(i))return!1;if("string"==typeof t){const i=pn(n,r,e);if(i)return mn(i,e,[kr(t)]),!0}}return!1}),so)),r&&l.listenersToRemove.add(n.registerCommand(Fe$2,(t=>{const n=Qr();if(!Fr(n)||!n.isCollapsed()||!ln(n,e))return!1;const r=un(n.anchor.getNode());return!(null===r||!e.is(hn(r))||(gn(t),function(e,t){const n="next"===t?"getNextSibling":"getPreviousSibling",r="next"===t?"getFirstChild":"getLastChild",i=e[n]();if(Wi(i))return i.selectEnd();const o=dl(e,De$1);null===o&&Le$1(247);for(let e=o[n]();De$1(e);e=e[n]()){const t=e[r]();if(Wi(t))return t.selectEnd()}const s=dl(o,Rn);null===s&&Le$1(248),"next"===t?s.selectNext():s.selectPrevious()}(r,t.shiftKey?"previous":"next"),0))}),so)),l.listenersToRemove.add(n.registerCommand(Ge$2,(()=>e.isSelected()),so)),l.listenersToRemove.add(n.registerCommand(he$3,(()=>{const t=Qr();if(!Fr(t)||!t.isCollapsed()||!ln(t,e))return!1;const r=pn(n,t,e);return!!r&&(mn(r,e),!0)}),so)),l}function Xt(e,t){const n=Qr(),r=Zr(),i=e.getAndClearNextFocus();if(null!==i){const{tableKey:t,focusCell:r}=i,o=e.observers.get(t);o||Le$1(335,t);const[s]=o;if(Ot(n)&&n.tableKey===s.tableNodeKey)return(r.x!==s.focusX||r.y!==s.focusY)&&(s.$setFocusCellForSelection(r),!0) 8;if(null!==s.anchorCell&&null!==s.anchorCellNodeKey&&r.elem!==s.anchorCell.elem&&null!==s.tableSelection)return s.$setFocusCellForSelection(r,!0),!0}const o=e.getAndClearShouldCheckSelectionForTable();if(o&&Fr(r)&&Fr(n)&&n.isCollapsed()){const e=Bs(o),t=n.anchor.getNode(),r=e.getFirstChild(),i=un(t);if(null!==i&&De$1(r)){const t=r.getFirstChild();if(We$1(t)&&e.is(dl(i,(n=>n.is(e)||n.is(t)))))return t.selectStart(),!0}}Ot(n)&&function(e,t){const n=Ht(e),r=Zr();if(!t.is(r))return;const i=Bs(t.tableKey),o=Js(n);if(o&&o.anchorNode&&o.focusNode){const n=Go(o.focusNode),r=n&&!i.isParentOf(n),s=Go(o.anchorNode),l=s&&i.isParentOf(s);if(r&&l&&o.rangeCount>0){const n=Gr(o,e);n&&(n.anchor.set(i.getKey(),t.isBackward()?i.getChildrenSize():0,"element"),o.removeAllRanges(),es(n))}}}(t,n),Fr(n)&&function(e,t){const n=Zr(),{anchor:r,focus:i}=e,o=r.getNode(),s=i.getNode(),l=un(o),a=un(s),c=l?hn(l):null,u=a?hn(a):null,d=e.isBackward(),h=l&&a&&c&&u&&c.is(u),g=u&&(!c||c.isParentOf(u)),p=c&&(!u||u.isParentOf(c));if(g){const t=e.clone(),[n]=wt(u,a,a),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.focus.set(d?r.getKey():i.getKey(),d?0:i.getChildrenSize(),"element"),es(t)}else if(p){const t=e.clone(),[n]=wt(c,l,l),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.anchor.set(d?i.getKey():r.getKey(),d?i.getChildrenSize():0,"element"),es(t)}else if(h){const r=t.observers.get(c.getKey());r||Le$1(335,c.getKey());const[i]=r;if(l.is(a)||(i.$setAnchorCellForSelection(Cn(i,l)),i.$setFocusCellForSelection(Cn(i,a),!0)),"touch"===i.pointerType&&i.isSelecting&&e.isCollapsed()&&Fr(n)&&n.isCollapsed()){const e=un(n.anchor.getNode());e&&!e.is(a)&&(i.$setAnchorCellForSelection(Cn(i,e)),i.$setFocusCellForSelection(Cn(i,a),!0),i.pointerType=null)}}}(n,e);const s=Array.from(e.observers.entries()).map((([e,[t]])=>({tableNode:Bs(e),tableObserver:t})));for(const{tableNode:e,tableObserver:n}of s)Yt(t,e,n);return!1}function Yt(e,t,n){const r=Qr(),i=Zr();r&&!r.is(i)&&(Ot(r)||Ot(i))&&n.tableSelection&&!n.tableSelection.is(i)&&(Ot(r)&&r.tableKey===n.tableNodeKey?n.$updateTableTableSelection(r):!Ot(r)&&Ot(i)&&i.tableKey===n.tableNodeKey&&n.$updateTableTableSelection(null)),n.hasHijackedSelectionStyles&&!t.isSelected()?function(e,t){t.$enableHighlightStyle(),Zt(t.table,(t=>{const n=t.elem;t.highlighted=!1,an(e,t),n.getAttribute("style")||n.removeAttribute("style")}))}(e,n):!n.hasHijackedSelectionStyles&&t.isSelected()&&function(e,t){t.$disableHighlightStyle(),Zt(t.table,(t=>{t.highlighted=!0,cn(e,t)}))}(e,n)}function qt(e){return e[Wt]||null}function jt(e){let t=e;for(;null!=t;){const e=t.nodeName;if("TD"===e||"TH"===e){const e=t._cell;return void 0===e?null:e}t=t.parentNode}return null}function Vt(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;null!=r;r=r.parentNode){if(r===e)return n;const t=r.nodeName;"TD"!==t&&"TH"!==t||(n=r._cell||null)}return null}function Gt(e,t){const n=[],r={columns:0,domRows:n,rows:0};let i=Lt(e,t).querySelector("tr"),o=0,s=0;for(n.length=0;null!=i;){const e=i.nodeName;
vendor: 5,331 bytes, line 8
8if("TD"===e||"TH"===e){const e={elem:i,hasBackgroundColor:""!==i.style.backgroundColor,highlighted:!1,x:o,y:s};i._cell=e;let t=n[s];void 0===t&&(t=n[s]=[]),t[o]=e}else{const e=i.firstChild;if(null!=e){i=e;continue}}const t=i.nextSibling;if(null!=t){o++,i=t;continue}const r=i.parentNode;if(null!=r){const e=r.nextSibling;if(null==e)break;s++,o=0,i=e}}return r.columns=o+1,r.rows=s+1,r}function Qt(e,t,n){const r=new Set(n?n.getNodes():[]);Zt(t,((t,n)=>{const i=t.elem;r.has(n)?(t.highlighted=!0,cn(e,t)):(t.highlighted=!1,an(e,t),i.getAttribute("style")||i.removeAttribute("style"))}))}function Zt(e,t){const{domRows:n}=e;for(let e=0;e<n.length;e++){const r=n[e];if(r)for(let n=0;n<r.length;n++){const i=r[n];if(!i)continue;const o=Go(i.elem);null!==o&&t(i,o,{x:n,y:e})}}}function tn(e,t){let n,r;if(t.startColumn===e.minColumn)n="minColumn";else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n="maxColumn"}if(t.startRow===e.minRow)r="minRow";else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r="maxRow"}return[n,r]}function nn([e,t]){return["minColumn"===e?"maxColumn":"minColumn","minRow"===t?"maxRow":"minRow"]}function on(e,t,[n,r]){const i=t[r],o=e[i];void 0===o&&Le$1(250,r,String(i));const s=t[n],l=o[s];return void 0===l&&Le$1(250,n,String(s)),l}function rn(e,t,n,r,i){const o=Nt(t,n,r),s=function(e,t){const{minColumn:n,maxColumn:r,minRow:i,maxRow:o}=t;let s=1,l=1,a=1,c=1;const u=e[i],d=e[o];for(let e=n;e<=r;e++)s=Math.max(s,u[e].cell.__rowSpan),c=Math.max(c,d[e].cell.__rowSpan);for(let t=i;t<=o;t++)l=Math.max(l,e[t][n].cell.__colSpan),a=Math.max(a,e[t][r].cell.__colSpan);return{bottomSpan:c,leftSpan:l,rightSpan:a,topSpan:s}}(t,o),{topSpan:l,leftSpan:a,bottomSpan:c,rightSpan:u}=s,d=function(e,t){const n=tn(e,t);return null===n&&Le$1(249,t.cell.getKey()),n}(o,n),[h,g]=nn(d);let p=o[h],f=o[g];"forward"===i?p+="maxColumn"===h?1:a:"backward"===i?p-="minColumn"===h?1:u:"down"===i?f+="maxRow"===g?1:l:"up"===i&&(f-="minRow"===g?1:c);const m=t[f];if(void 0===m)return!1;const y=m[p];if(void 0===y)return!1;const[b,$]=function(e,t,n){const r=Nt(e,t,n),i=tn(r,t);if(i)return[on(e,r,i),on(e,r,nn(i))];const o=tn(r,n);if(o)return[on(e,r,nn(o)),on(e,r,o)];const s=["minColumn","minRow"];return[on(e,r,s),on(e,r,nn(s))]}(t,n,y),_=Cn(e,b.cell),C=Cn(e,$.cell);return e.$setAnchorCellForSelection(_),e.$setFocusCellForSelection(C,!0),!0}function ln(e,t){if(Fr(e)||Ot(e)){const n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function sn(e,t){t?e.selectStart():e.selectEnd()}function cn(e,t){const n=t.elem,r=e._config.theme;We$1(Go(n))||Le$1(131),mc(n,r.tableCellSelected)}function an(e,t){const n=t.elem;We$1(Go(n))||Le$1(131);xc(n,e._config.theme.tableCellSelected)}function un(e){const t=dl(e,We$1);return We$1(t)?t:null}function hn(e){const t=dl(e,Rn);return Rn(t)?t:null}function dn(e,t,n,r,i,o,s){const l=ql(n.focus,i?"previous":"next");if(ic(l))return!1;let a=l;for(const e of Rl(l).iterNodeCarets("shadowRoot")){if(!Tl(e)||!Wi(e.origin))return!1;a=e}const c=a.getParentAtCaret();if(!We$1(c))return!1;const u=c,d=function(e){for(const t of Rl(e).iterNodeCarets("root")){const{origin:n}=t;if(We$1(n)){if(Nl(t))return Pl(n,e.direction)}else if(!De$1(n))break}return null}(Ol(u,a.direction)),h=dl(u,Rn);if(!h||!h.is(o))return!1;const g=e.getElementByKey(u.getKey()),p=jt(g);if(!g||!p)return!1;const f=xn(e,h);if(s.table=f,d)if("extend"===r){const t=jt(e.getElementByKey(d.origin.getKey()));if(!t)return!1;s.$setAnchorCellForSelection(p),s.$setFocusCellForSelection(t,!0)}else{const e=rc(d);Hl(n.anchor,e),Hl(n.focus,e)}else if("extend"===r)s.$setAnchorCellForSelection(p),s.$setFocusCellForSelection(p,!0);else{const e=function(e){const t=Ll(e);return Nl(t)?rc(t):e}(Ol(h,l.direction));Hl(n.anchor,e),Hl(n.focus,e)}return gn(t),!0}function fn(e,t,n,r,i,o){if(("up"===n||"down"===n)&&function(e){const t=e.getRootElement();return!!t&&(t.hasAttribute("aria-controls")&&"typeahead-menu"===t.getAttribute("aria-controls"))}(e))return!1;const s=Qr();if(!ln(s,r)){if(Fr(s)){if("backward"===n){if(s.focus.offset>0)return!1;const e=function(e){for(let t=e,n=e;null!==n;t=n,n=n.getParent())if(Wi(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(s.focus.getNode());if(!e)return!1;const n=e.getPreviousSibling();return!!Rn(n)&&(gn(t),t.shiftKey?s.focus.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent(),"element"):n.selectEnd(),!0)}if(t.shiftKey&&("up"===n||"down"===n)){const e=s.focus.getNode();if(!s.isCollapsed()&&("up"===n&&!s.isBackward()||"down"===n&&s.isBackward())){let i=dl(e,(e=>Rn(e)));if(We$1(i)&&(i=dl(i,Rn)),i!==r)return!1;if(!i)return!1;const o="down"===n?i.getNextSibling():i.getPreviousSibling();if(!o)return!1;let l=0;"up"===n&&Wi(o)&&(l=o.getChildrenSize());let a=o;if("up"===n&&Wi(o)){a=o.getLastChild()||o,l=Tr(a)?a.getTextContentSize():0}const c=s.clone();return c.focus.set(a.getKey(),l,Tr(a)?"text":"element"),es(c),gn(t),!0}if(Is(e)){const e="up"===n?s.getNodes()[s.getNodes().length-1]:s.getNodes()[0];if(e&&null!==Bt(r,e)){const e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;const[n]=yt(e),[o]=yt(t),s=r.getCordsFromCellNode(n,i.table),l=r.getCordsFromCellNode(o,i.table),a=r.getDOMCellFromCordsOrThrow(s.x,s.y,i.table),c=r.getDOMCellFromCordsOrThrow(l.x,l.y,i.table);
8return i.$setAnchorCellForSelection(a),i.$setFocusCellForSelection(c,!0),!0}return!1}{let r=dl(e,(e=>Wi(e)&&!e.isInline()));if(We$1(r)&&(r=dl(r,Rn)),!r)return!1;const o="down"===n?r.getNextSibling():r.getPreviousSibling();if(Rn(o)&&i.tableNodeKey===o.getKey()){const e=o.getFirstDescendant(),r=o.getLastDescendant();if(!e||!r)return!1;const[i]=yt(e),[l]=yt(r),a=s.clone();return a.focus.set(("up"===n?i:l).getKey(),"up"===n?0:l.getChildrenSize(),"element"),gn(t),es(a),!0}}}}return"down"===n&&yn(e)&&o.setShouldCheckSelectionForTable(r.getKey()),!1}if(Fr(s)){if("backward"===n||"forward"===n)return dn(e,t,s,t.shiftKey?"extend":"move","backward"===n,r,i);if(s.isCollapsed()){const{anchor:l,focus:a}=s,c=dl(l.getNode(),We$1),u=dl(a.getNode(),We$1);if(!We$1(c)||!c.is(u))return!1;const d=hn(c);if(d!==r&&null!=d){const r=Lt(d,e.getElementByKey(d.getKey()));if(null!=r)return i.table=Gt(d,r),fn(e,t,n,d,i,o)}const h=e.getElementByKey(c.__key),g=e.getElementByKey(l.key);if(null==g||null==h)return!1;let p;if("element"===l.type)p=g.getBoundingClientRect();else{const t=Js(Ht(e));if(null===t||0===t.rangeCount)return!1;p=t.getRangeAt(0).getBoundingClientRect()}const f="up"===n?c.getFirstChild():c.getLastChild();if(null==f)return!1;const m=e.getElementByKey(f.__key);if(null==m)return!1;const y=m.getBoundingClientRect();if("up"===n?y.top>p.top-p.height:p.bottom+p.height>y.bottom){gn(t);const e=r.getCordsFromCellNode(c,i.table);if(!t.shiftKey)return en(i,r,e.x,e.y,n);{const t=r.getDOMCellFromCordsOrThrow(e.x,e.y,i.table);i.$setAnchorCellForSelection(t),i.$setFocusCellForSelection(t,!0)}return!0}}}else if(Ot(s)){const{anchor:o,focus:l}=s,a=dl(o.getNode(),We$1),c=dl(l.getNode(),We$1),[u]=s.getNodes();Rn(u)||Le$1(251);const d=Lt(u,e.getElementByKey(u.getKey()));if(!We$1(a)||!We$1(c)||!Rn(u)||null==d)return!1;i.$updateTableTableSelection(s);const h=Gt(u,d),g=r.getCordsFromCellNode(a,h),p=r.getDOMCellFromCordsOrThrow(g.x,g.y,h);if(i.$setAnchorCellForSelection(p),gn(t),t.shiftKey){const[e,t,o]=wt(r,a,c);return rn(i,e,t,o,n)}return c.selectEnd(),!0}return!1}function gn(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function mn(e,t,n){const r=eo();"first"===e?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function pn(e,t,n){const r=n.getParent();if(!r)return;const i=Js(Ht(e));if(!i)return;const o=i.anchorNode,s=e.getElementByKey(r.getKey()),l=Lt(n,e.getElementByKey(n.getKey()));if(!o||!s||!l||!s.contains(o)||l.contains(o))return;const a=dl(t.anchor.getNode(),(e=>We$1(e)));if(!a)return;const c=dl(a,(e=>Rn(e)));if(!Rn(c)||!c.is(n))return;const[u,d]=wt(n,a,a),h=u[0][0],g=u[u.length-1][u[0].length-1],{startRow:p,startColumn:f}=d,m=p===h.startRow&&f===h.startColumn,y=p===g.startRow&&f===g.startColumn;return m?"first":y?"last":void 0}function Cn(e,t){const{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function _n(e,t,n){return Bt(e,Go(t,n))}function Sn(e,t,n){const r=e.querySelector("colgroup");if(!r)return;const i=[];for(let e=0;e<t;e++){const t=document.createElement("col"),r=n&&n[e];r&&(t.style.width=`${r}px`),i.push(t)}r.replaceChildren(...i)}function wn(e,t,n){if(!t.theme.tableAlignment)return;const r=[],i=[];for(const e of["center","right"]){const o=t.theme.tableAlignment[e];o&&(e===n?i:r).push(o)}xc(e,...r),mc(e,...i)}function yn(e=Zs()){return bn.has(e)}function Nn(e){bn.add(e)}function xn(e,t){const n=e.getElementByKey(t.getKey());return null===n&&Le$1(230),Gt(t,n)}function Tn(e){const t=Fn();e.hasAttribute("data-lexical-row-striping")&&t.setRowStriping(!0),e.hasAttribute("data-lexical-frozen-column")&&t.setFrozenColumns(1),e.hasAttribute("data-lexical-frozen-row")&&t.setFrozenRows(1);const n=e.querySelector(":scope > colgroup");if(n){let e=[];for(const t of n.querySelectorAll(":scope > col")){let n=t.style.width||"";if(!Ke$1.test(n)&&(n=t.getAttribute("width")||"",!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return{after:e=>Ht$3(e,De$1),node:t}}function Fn(){return zs(new vn)}function Rn(e){return e instanceof vn}function On(e){De$1(e.getParent())?e.isEmpty()&&e.append(eo()):e.remove()}function Kn(e){Rn(e.getParent())?Ot$3(e,We$1):e.remove()}function An(e){Ot$3(e,De$1);const[t]=bt(e,null,null),n=t.reduce(((e,t)=>Math.max(e,t.length)),0),r=e.getChildren();for(let e=0;e<t.length;++e){const i=r[e];if(!i)continue;De$1(i)||Le$1(254,i.constructor.name,i.getType());const o=t[e].reduce(((e,t)=>t?1+e:e),0);if(o!==n)for(let e=o;e<n;++e){const e=$e$1();e.append(eo()),i.append(e)}}const i=e.getColWidths(),o=e.getColumnCount();if(i&&i.length!==o){let t;if(o<i.length)t=i.slice(0,o);else if(i.length>0){const e=i[i.length-1];t=[...i,...Array(o-i.length).fill(e)]}e.setColWidths(t)}}function En(e){if(e.detail<3||!qs(e.target))return!1;const t=Go(e.target);if(null===t)return!1;const n=dl(t,(e=>Wi(e)&&!e.isInline()));return null!==n&&(!!We$1(n.getParent())&&(n.select(0),!0))}function kn(){const e=Qr();if(!Fr(e))return!1;const t=hn(e.anchor.getNode());if(null===t)return!1;const n=Zo();if(!n.is(t.getParent())||1!==n.getChildrenSize())return!1;const[r]=bt(t,null,null);if(0===r.length||0===r[0].length)return!1;const i=r[0][0];if(!i||!i.cell)return!1;const o=r[r.length-1],s=o[o.length-1];if(!s||!s.cell)return!1;return es(At(t,i.cell,s.cell)),!0}function $n(e,t=!0){const n=new Mt,r=(r,i,o)=>{const s=Lt(r,o),l=Jt(r,s,e,t,n);n.observers.set(i,[l,s])};return Cc(Ut(e,n),e.registerCommand(ie$4,(()=>Xt(n,e)),so),e.registerMutationListener(vn,(t=>{e.getEditorState().read((()=>{for(const[e,i]of t){const t=n.observers.get(e);if("created"===i||"updated"===i){const{tableNode:i,tableElement:o}=kt(e);void 0===t?r(i,e,o):o!==t[1]&&(t[0].removeListeners(),n.observers.delete(e),r(i,e,o))}else"destroyed"===i&&void 0!==t&&(t[0].removeListeners(),n.observers.delete(e))}}),{editor:e})}),{skipInitialization:!1}),(()=>{for(const[,[e]]of n.observers)e.removeListeners()}))}function Wn(e){e.hasNodes([vn])||Le$1(255);const{hasNestedTables:t=ft$1(!1)}={};return Cc(e.registerCommand(ze$1,(e=>function({rows:e,columns:t,includeHeaders:n},r){const i=Qr()||Zr();if(!i||!Fr(i))return!1;if(!r&&hn(i.anchor.getNode()))return!1;const o=Xe$1(Number(e),Number(t),n);Pt$3(o);const s=o.getFirstDescendant();return Tr(s)&&s.select(),!0}(e,t.peek())),ro),e.registerCommand(oe$6,((n,r)=>e===r&&function(e,t){const{nodes:n,selection:r}=e;if(!n.some((e=>Rn(e)||pt$2(e).some((e=>Rn(e.node))))))return!1;const i=Ot(r),o=Fr(r);return!!(o&&null!==dl(r.anchor.getNode(),(e=>We$1(e)))&&null!==dl(r.focus.getNode(),(e=>We$1(e)))||i)&&(1===n.length&&Rn(n[0])?function(e,t){const n=t.getStartEndPoints(),r=Ot(t);if(null===n)return!1;const[i,o]=n,[s,l,a]=yt(i),c=dl(o.getNode(),(e=>We$1(e)));if(!(We$1(s)&&We$1(c)&&De$1(l)&&Rn(a)))return!1;const[u,d,h]=wt(a,s,c),[g]=bt(e,null,null),p=u.length,f=p>0?u[0].length:0;let m=d.startRow,y=d.startColumn,b=g.length,$=b>0?g[0].length:0;if(r){const e=Nt(u,d,h),t=e.maxRow-e.minRow+1,n=e.maxColumn-e.minColumn+1;m=e.minRow,y=e.minColumn,b=Math.min(b,t),$=Math.min($,n)}let _=!1;const C=Math.min(p,m+b)-1,x=Math.min(f,y+$)-1,S=new Set;for(let e=m;e<=C;e++)for(let t=y;t<=x;t++){const n=u[e][t];S.has(n.cell.getKey())||1===n.cell.__rowSpan&&1===n.cell.__colSpan||(St(n.cell),S.add(n.cell.getKey()),_=!0)}let[T]=bt(a.getWritable(),null,null);const E=b-p+m;for(let e=0;e<E;e++)rt(T[p-1][0].cell);const v=$-f+y;for(let e=0;e<v;e++)ct(T[0][f-1].cell,!0,!1);[T]=bt(a.getWritable(),null,null);for(let e=m;e<m+b;e++)for(let t=y;t<y+$;t++){const n=e-m,r=t-y,i=g[n][r];if(i.startRow!==n||i.startColumn!==r)continue;const o=i.cell;if(1!==o.__rowSpan||1!==o.__colSpan){const n=[],r=Math.min(e+o.__rowSpan,m+b)-1,i=Math.min(t+o.__colSpan,y+$)-1;for(let o=e;o<=r;o++)for(let e=t;e<=i;e++){const t=T[o][e];n.push(t.cell)}pt(n),_=!0}const{cell:s}
8=T[e][t],l=o.getBackgroundColor();null!=l&&s.setBackgroundColor(l);const a=s.getChildren();o.getChildren().forEach((e=>{Tr(e)?(eo().append(e),s.append(e)):s.append(e)})),a.forEach((e=>e.remove()))}if(r&&_){const[e]=bt(a.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}(n[0],r):!(o&&t.peek()&&!function(e){return!(!Ot(e)||e.focus.getNode().is(e.anchor.getNode()))||!(!Fr(e)||!We$1(e.anchor.getNode())||e.anchor.getNode().is(e.focus.getNode()))}(r)))}(n,t)),ro),e.registerCommand(Ue$2,kn,io),e.registerCommand(se$5,En,ro),e.registerNodeTransform(vn,An),e.registerNodeTransform(He$1,Kn),e.registerNodeTransform(Ee$1,On))}function segmentTextByRanges(e,t,n){const r=[];let i=0;for(const o of n){const n=Math.max(o.start-t,i),s=Math.min(o.end-t,e.length);n<s&&(n>i&&r.push({start:i,end:n,range:null}),r.push({start:n,end:s,range:o}),i=s)}return i<e.length&&r.push({start:i,end:e.length,range:null}),r}function styleResolverRoot(){return resolverRoot&&resolverRoot.isConnected||(resolverRoot=document.createElement("div"),resolverRoot.setAttribute("aria-hidden","true"),resolverRoot.setAttribute("data-lexxy-style-resolver",""),resolverRoot.style.cssText="contain: strict; position: fixed; top: 0; left: 0; visibility: hidden; pointer-events: none; width: 0; height: 0;",document.body.appendChild(resolverRoot)),resolverRoot}function isSelectionHighlighted(e){return!!Fr(e)&&(e.isCollapsed()?hasHighlightStyles(e.style):e.hasFormat("highlight"))}function getHighlightStyles(e){if(!Fr(e))return null;let t=oe$5(e.style);if(!t.color&&!t["background-color"]){const n=e.anchor.getNode();Tr(n)&&(t=oe$5(n.getStyle()))}const n=t.color||null,r=t["background-color"]||null;return n||r?{color:n,backgroundColor:r}:null}function hasHighlightStyles(e){const t="string"==typeof e?oe$5(e):e;return!(!t.color&&!t["background-color"])}function applyCanonicalizers(e,t=[]){return t.reduce(((e,t)=>t.applyCanonicalization(e)),e)}function computeStyleValues(e,t){const n=document.createDocumentFragment(),r=t.map((t=>{const r=createElement("span",{style:`display: none; ${e}: ${t};`});return n.appendChild(r),r}));styleResolverRoot().appendChild(n);const i=r.map((t=>window.getComputedStyle(t).getPropertyValue(e)));return r.forEach((e=>e.remove())),i}function $applyHighlightStyle(e,t){const n={color:t.style?.color,"background-color":t.style?.backgroundColor};Es(jn)&&$setPastedStyles(e);const r=F$6(n);if(r.length)return e.setStyle(e.getStyle()+r)}function $markConversion(){return{conversion:extendTextNodeConversion("mark",$applyHighlightStyle),priority:1}}function $registerPreConversion(e){if(!e._htmlConversions)return;let t=e._htmlConversions.get("pre");t||(t=[],e._htmlConversions.set("pre",t)),t.push($preConversionWithHighlightsFactory(e))}function $preConversionWithHighlightsFactory(e){return function(t){const n=extractHighlightRanges(t);return 0===n.length?null:{conversion:t=>{const r=I$1(t.getAttribute("data-language"));return $getPendingHighlights(e).set(r.getKey(),n),{node:r}},priority:2}}}function extractHighlightRanges(e){function t(e){if(e.nodeType===Node.TEXT_NODE)i+=e.textContent.length;else if(e.nodeType===Node.ELEMENT_NODE){if("BR"===e.tagName)return void(i+=1);const r="MARK"===e.tagName,o=i;for(const n of e.childNodes)t(n);if(r){const t=extractHighlightStyleFromElement(e);t&&n.push({start:o,end:i,style:t})}}}const n=[],r=e.querySelector("code")||e;let i=0;for(const e of r.childNodes)t(e);return n}function $getPendingHighlights(e){let t=pendingCodeHighlights.get(e);return t||(t=new Map,pendingCodeHighlights.set(e,t)),t}function extractHighlightStyleFromElement(e){const t={};e.style?.color&&(t.color=e.style.color),e.style?.backgroundColor&&(t["background-color"]=e.style.backgroundColor);const n=F$6(t);return n.length>0?n:null}function $takeHighlightRanges(e,t){const n=$getPendingHighlights(e),r=t.getKey();if(n.has(r)){const e=n.get(r);return n.delete(r),e}return t.getChildren().some(X$1)?$extractHighlightRangesFromCodeNode(t):[]}function $applyHighlightRangesToTokens(e,t){if(0===t.length)return e;const n=[];let r=0;for(const i of e)X$1(i)?n.push(...$splitTokenAtHighlightBoundaries(i,r,t)):n.push(i),r+=i.getTextContentSize();return n}function $splitTokenAtHighlightBoundaries(e,t,n){const r=e.getTextContent(),i=segmentTextByRanges(r,t,n);if(1===i.length){const[t]=i;return t.range&&$applyHighlightStyleToToken(e,t.range.style),[e]}return i.map((t=>{const n=V$2(r.slice(t.start,t.end),e.getHighlightType());return t.range&&$applyHighlightStyleToToken(n,t.range.style),n}))}function $applyHighlightStyleToToken(e,t){e.setStyle(t),$setCodeHighlightFormat(e,!0)}function $buildChildRanges(e){function t(e){for(const i of e.getChildren())if(Wi(i))t(i);else if(X$1(i)||Tr(i)){const e=i.getTextContent();n.push({node:i,start:r,end:r+e.length}),r+=e.length}else r+=1}const n=[];let r=0;return t(e),n}function $extractHighlightRangesFromCodeNode(e){const t=[],n=$buildChildRanges(e);for(const{node:e,start:r,end:i}of n){const n=e.getStyle();n&&hasHighlightStyles(n)&&t.push({start:r,end:i,style:n})}return t}function buildCanonicalizers(e){return[new StyleCanonicalizer("color",[...e.buttons.color,...e.permit.color]),new StyleCanonicalizer("background-color",[...e.buttons["background-color"],...e.permit["background-color"]])]}function $toggleSelectionStyles(e,t){const n=Qr();if(!Fr(n))return;const r={};for(const e in t){const i=ne$4(n,e);r[e]=toggleOrReplace(i,t[e])}$selectionIsInCodeBlock(n)?$patchCodeHighlightStyles(e,n,r):$$3(n,r)}function $selectionIsInCodeBlock(e){return e.getNodes().some((e=>X$1(e)||Tr(e)?W$1(e.getParent()):W$1(e)))}
8function $patchCodeHighlightStyles(e,t,n){const r=t.getNodes().filter((e=>(X$1(e)||Tr(e))&&W$1(e.getParent()))).map((e=>({key:e.getKey(),startOffset:$getNodeSelectionOffsets(e,t)[0],endOffset:$getNodeSelectionOffsets(e,t)[1],textSize:e.getTextContentSize()})));e.update((()=>{for(const{key:e,startOffset:t,endOffset:i,textSize:o}of r){const r=Yo(e);if(!r)continue;if(W$1(r.getParent())&&t!==i)if(0===t&&i===o)$applyStylePatchToNode(r,n);else{$applyStylePatchToNode(r.splitText(t,i)[0===t?0:1],n)}}}),{skipTransforms:!0,discrete:!0})}function $getNodeSelectionOffsets(e,t){const n=e.getKey(),r=n===t.anchor.key,i=n===t.focus.key;let o=0,s=e.getTextContentSize();return!1===t.isBackward()?(r&&(o=t.anchor.offset),i&&(s=t.focus.offset)):(i&&(o=t.focus.offset),r&&(s=t.anchor.offset)),[o,s]}function $applyStylePatchToNode(e,t){const n={...oe$5(e.getStyle())};for(const[e,r]of Object.entries(t))null===r?delete n[e]:n[e]=r;const r=F$6(n);e.setStyle(r);const i=hasHighlightStyles(r);i!==e.hasFormat("highlight")&&$setCodeHighlightFormat(e,i)}function $setCodeHighlightFormat(e,t){const n=e.getWritable(),r=128;t?n.__format|=r:n.__format&=~r}function toggleOrReplace(e,t){return e===t?null:t}function $syncHighlightWithStyle(e){hasHighlightStyles(e.getStyle())!==e.hasFormat("highlight")&&e.toggleFormat("highlight")}function $syncHighlightWithCodeHighlightNode(e){if(!W$1(e.getParent()))return;const t=hasHighlightStyles(e.getStyle());t!==e.hasFormat("highlight")&&$setCodeHighlightFormat(e,t)}function $canonicalizePastedStyles(e,t=[]){if($hasPastedStyles(e)){$setPastedStyles(e,!1);const n=applyCanonicalizers(e.getStyle(),t);e.setStyle(n);const r=Qr();e.isSelected(r)&&(r.setStyle(e.getStyle()),r.setFormat(e.getFormat()))}}function $setPastedStyles(e,t=!0){ct$2(e,hasPastedStylesState,t)}function $hasPastedStyles(e){return st$2(e,hasPastedStylesState)}function capitalize(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $createImageGalleryNode(){return new ImageGalleryNode}function $isImageGalleryNode(e){return e instanceof ImageGalleryNode}function $findOrCreateGalleryForImage(e){if(!ImageGalleryNode.canCollapseWith(e))return null;return At$2(e,ImageGalleryNode)??Tt$4(e,$createImageGalleryNode)}async function loadFileIntoImage(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)}))}function $createActionTextAttachmentUploadNode(...e){return new ActionTextAttachmentUploadNode(...e)}function L(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function G(e){T=e}function h(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(m.caret,"$1"),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function w(e,t){if(t){if(m.escapeTest.test(e))return e.replace(m.escapeReplace,ge)}else if(m.escapeTestNoEncode.test(e))return e.replace(m.escapeReplaceNoEncode,ge);return e}function J(e){try{e=encodeURI(e).replace(m.percentDecode,"%")}catch{return null}return e}function V(e,t){let n=e.replace(m.findPipe,((e,t,n)=>{let r=!1,i=t;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})),r=n.split(m.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(m.slashPipe,"|");return r}function z(e,t){let n=e.length;if(0===n)return"";let r=0;for(;r<n;){if(e.charAt(n-r-1)!==t)break;r++}return e.slice(0,n-r)}function fe(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}function me(e,t,n,r,i){let o=t.href,s=t.title||null,l=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:o,title:s,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function Ve(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")}function k(e,t){return _.parse(e,t)}function parsePastedMarkdown(e){return pasteMarked.parse(e)}function renderPastedHtmlToken(e){return e.text.replace(HTML_TAG_LEXEME,((e,t,n)=>isSupportedHtmlElement(n)?e:escapeHtml(e)))}function escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function isSupportedHtmlElement(e){const t=e.toLowerCase();return!(document.createElement(t)instanceof HTMLUnknownElement||t.includes("-"))}function $bareUrlFromSingleLink(e){if(1!==e.length)return null;const t=e[0];if(z$5(t))return $bareUrlFromLink(t);
8if(no(t)){const e=t.getChildren();if(1===e.length&&z$5(e[0]))return $bareUrlFromLink(e[0])}return null}function $bareUrlFromLink(e){const t=e.getURL();return t&&e.getTextContent()===t?t:null}function $getCodeLink(e){return st$2(e,codeLinkState)}function $setCodeLink(e,t){ct$2(e,codeLinkState,t)}function $extractLinkRangesFromCodeNode(e){function t(e){for(const i of e.getChildren())if(z$5(i)){const e=i.getTextContent().length;appendRange(n,{start:r,end:r+e,link:linkAttributesFrom(i)}),r+=e}else if(Wi(i))t(i);else{const e=i.getTextContent().length;if(Tr(i)){const t=$getCodeLink(i);t&&appendRange(n,{start:r,end:r+e,link:t})}r+=e}}const n=[];let r=0;return t(e),n}function $applyLinkRangesToTokens(e,t){if(0===t.length)return e;const n=[];let r=0;for(const i of e)X$1(i)?n.push(...$splitTokenAtLinkBoundaries(i,r,t)):n.push(i),r+=i.getTextContentSize();return n}function $splitTokenAtLinkBoundaries(e,t,n){const r=e.getTextContent(),i=segmentTextByRanges(r,t,n);if(1===i.length){const[t]=i;return t.range&&$setCodeLink(e,t.range.link),[e]}return i.map((t=>{const n=$cloneTokenSlice(e,r.slice(t.start,t.end));return t.range&&$setCodeLink(n,t.range.link),n}))}function $cloneTokenSlice(e,t){const n=V$2(t,e.getHighlightType());return n.setStyle(e.getStyle()),n.getWritable().__format=e.getFormat(),n}
8function appendRange(e,t){const n=e[e.length-1];n&&n.end===t.start&&sameLink(n.link,t.link)?n.end=t.end:e.push(t)}function sameLink(e,t){return e.url===t.url&&e.target===t.target&&e.rel===t.rel&&e.title===t.title}function linkAttributesFrom(e){const t={url:e.getURL()};return e.getTarget()&&(t.target=e.getTarget()),e.getRel()&&(t.rel=e.getRel()),e.getTitle()&&(t.title=e.getTitle()),t}function exportCodeHighlightNodeDOM(e,t){const n=exportTextNodeDOM(e,t),r=$getCodeLink(t);return r?{element:wrapWithAnchor(n.element,r)}:n}function wrapWithAnchor(e,t){const n=document.createElement("a");return n.setAttribute("href",t.url),t.target&&n.setAttribute("target",t.target),t.rel&&n.setAttribute("rel",t.rel),t.title&&n.setAttribute("title",t.title),n.appendChild(e),n}function exportTextNodeDOM(e,t){const n=t.createDOM(e._config,e);n.style.whiteSpace="pre-wrap",t.hasFormat("lowercase")?n.style.textTransform="lowercase":t.hasFormat("uppercase")?n.style.textTransform="uppercase":t.hasFormat("capitalize")&&(n.style.textTransform="capitalize");let r=n;return t.hasFormat("bold")&&!containsTag(n,"strong")&&(r=wrapWith(r,"b")),t.hasFormat("italic")&&!containsTag(n,"em")&&(r=wrapWith(r,"i")),t.hasFormat("strikethrough")&&(r=wrapWith(r,"s")),t.hasFormat("underline")&&(r=wrapWith(r,"u")),{element:unwrapSpans(r)}}function containsTag(e,t){const n=t.toUpperCase();return e.tagName===n||null!==e.querySelector(t)}function wrapWith(e,t){const n=document.createElement(t);return n.appendChild(e),n}function unwrapSpans(e){if("SPAN"===e.tagName)return e.firstChild;for(const t of e.querySelectorAll("span"))t.replaceWith(...t.childNodes);return e}function $isProvisionalParagraphNode(e){return e instanceof ProvisionalParagraphNode}function $isSelectableElement(e,t){return Wi(e)&&("next"===t?e.canInsertTextBefore():e.canInsertTextAfter())}function $insertRequiredProvisionalParagraphs(e){const t=$nodeBeforeRootSelection(e),n=e.getFirstChild();ProvisionalParagraphNode.neededBetween(null,n)&&$t$2(e,new ProvisionalParagraphNode);for(const n of jt$2(e)){const e=n.getNextSibling();ProvisionalParagraphNode.neededBetween(n,e)&&(n.insertAfter(new ProvisionalParagraphNode),n.is(t)&&n.selectNext())}}function $nodeBeforeRootSelection(e){const t=Qr();return Is(t?.anchor?.getNode())?e.getChildAtIndex(t.anchor.offset-1):null}function $removeUnneededProvisionalParagraphs(e){for(const t of $getAllProvisionalParagraphs(e))t.removeUnlessRequired()}function $markAllProvisionalParagraphsDirty(){Os(Jn);for(const e of $getAllProvisionalParagraphs())e.markDirty()}function $getAllProvisionalParagraphs(e=Zo()){return Ht$3(e.getChildren(),$isProvisionalParagraphNode)}function buildMarkupPreservingTokenizer(e){return{defaultLanguage:r.defaultLanguage,tokenize:(e,t)=>
8r.tokenize(e,t),$tokenize(t,n){const i=$extractLinkRangesFromCodeNode(t),o=$takeHighlightRanges(e,t);return $applyLinkRangesToTokens($applyHighlightRangesToTokens(r.$tokenize(t,n),o),i)}}}function onlyStyledElements(e,t){return""!==e.style.color||""!==e.style.backgroundColor?t:null}function $applyStrikethrough(e){return e.hasFormat("strikethrough")||e.toggleFormat("strikethrough"),e}function onlyPreLanguageElements(e,t){return e.hasAttribute(TRIX_LANGUAGE_ATTR)?t:null}function $applyLanguage(e,t){const n=a(t.getAttribute(TRIX_LANGUAGE_ATTR));e.node.setLanguage(n)}function $extractAttachmentFromParagraph(e){const t=e.getParent();if(no(t))if(1===t.getChildrenSize())t.replace(e);else{const n=e.getIndexWithinParent(),[r,i]=Us(t,n);r.insertAfter(e);for(const e of[r,i])e.isEmpty()&&e.remove()}}function $collapseIntoGallery(e){const t=Qr()?.anchor;return!!t&&(!!$collapseAtGalleryEdge(t,e)||!!e&&($collapseAroundEmptyParagraph(t)||$moveSelectionBeforeGallery(t)))}function $collapseAroundEmptyParagraph(e){const t=e.getNode();if(!t)return!1;const n=no(t)&&t.isEmpty(),r=$findOrCreateGalleryForImage(t.getPreviousSibling()),i=r?.getChildrenSize();return!(!n||!r?.collapseWith(t.getNextSibling()))&&(r.select(i,i),t.remove(),!0)}function $collapseAtGalleryEdge(e,t){const n=e.getNode();if(!$isImageGalleryNode(n))return!1;const r=$isAtNodeEdge(e,t),i=t?n.getPreviousSibling():n.getNextSibling();if(r&&n.collapseWith(i,t)){const e=t?1:n.getChildrenSize()-1;return n.select(e,e),!0}return!1}function $moveSelectionBeforeGallery(e){const t=e.getNode().getPreviousSibling();return!!($isImageGalleryNode(e.getNode())&&$isAtNodeEdge(e,!0)&&t)&&(!ji(t)&&(t.isEmpty()?t.remove():t.selectEnd(),!0))}function $escapeFromBlockquote(){return $escapeBeforeBlockquoteStart()||$escapeFromBlankBlockquoteParagraph()}function $escapeBeforeBlockquoteStart(){const e=Qr();if(!Fr(e)||!e.isCollapsed()||0!==e.anchor.offset)return!1;const t=At$2(e.anchor.getNode(),Zi);if(t&&!$isBlankNode(t)&&!t.getPreviousSibling()){const e=t.getParent();if(Mt$2(e))return e.insertBefore(eo()),!0}return!1}function $escapeFromBlankBlockquoteParagraph(){ 9const e=At$2(Qr().anchor.getNode(),Zi);if(!e||!$isBlankNode(e))return!1;const t=e.getParent();if(Mt$2(t)){return e.getNextSiblings().filter((e=>!$isBlankNode(e))).length>0?$splitQuoteNode(t,e):(t.insertAfter(e),e.selectStart()),!0}return!1}function $splitQuoteNode(e,t){const n=Us(e,t.getIndexWithinParent());n[0].insertAfter(t),n.forEach($trimTrailingBlankNodes),t.selectEnd()}function $handleArrowDownInCodeBlock(e){const t=Qr();if(!Fr(t)||!t.isCollapsed())return!1;const n=EarlyEscapeCodeNode.$fromSelection(t);if(!n)return!1;if($isCursorOnLastLine(t)&&!n.getNextSibling()){e?.preventDefault();const t=eo();return n.insertAfter(t),t.selectEnd(),!0}return!1}function $ensureQuoteHasParagraphChild(e){e.isEmpty()&&(e.append(eo()),$containsRangeSelection(e)&&e.getFirstChild().select())}function $openLink(e){const t=Go(e),n=dl(t,z$5);if(n){const e=n.sanitizeUrl(n.getURL());return window.open(e,"_blank","noopener,noreferrer"),!0}return!1}function caretRect(e,t){const n=document.createRange();n.setStart(e,t),n.collapse(!0);const r=n.getBoundingClientRect();return r.height>0?r:null}function caretFromPoint(e,t){if(document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:n.offset}}else if(document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:n.startOffset}}return null}function $replaceLineSeparatorWithLineBreak(e){const t=e.getTextContent().match(LINE_SEPARATORS);if(t){let n;0===t.index?[n]=e.splitText(t[0].length):[,n]=e.splitText(t.index,t.index+t[0].length),n.replace(or())}}function $getReadableTextContent(e){if(e instanceof CustomActionTextAttachmentNode)return e.getReadableTextContent();if(Wi(e)){let t="";const n=e.getChildren();for(let e=0;e<n.length;e++){const r=n[e];isAttachmentSpacerTextNode(r,n[e-1],e,n.length)||(t+=$getReadableTextContent(r),Wi(r)&&e!==n.length-1&&!r.isInline()&&(t+="\n\n"))}return t}return e.getTextContent()}function defineElements(){const e={"lexxy-toolbar":LexicalToolbarElement,"lexxy-toolbar-dropdown":ToolbarDropdown,"lexxy-heading-dropdown":HeadingDropdown,"lexxy-highlight-dropdown":HighlightDropdown,"lexxy-link-dropdown":LinkDropdown,"lexxy-editor":LexicalEditorElement,"lexxy-prompt":LexicalPromptElement,"lexxy-code-language-picker":CodeLanguagePicker,"lexxy-node-delete-button":NodeDeleteButton,"lexxy-table-tools":TableTools};Object.entries(e).forEach((([e,t])=>{customElements.define(e,t)}))}function highlightCode(e=document){e.querySelectorAll("pre[data-language]:not([data-highlighted])").forEach((e=>{highlightElement(e)}))}function highlightElement(e){if("true"===e.dataset.highlighted)return;const t=e.getAttribute("data-language"),n=Prism$1.languages?.[t];if(!n)return;const{code:r,highlights:i,links:o}=extractCodeAndMarkup(e),s=Prism$1.highlight(r,n,t);e.innerHTML=s,i.length>0&&applyHighlightRanges(e,i),o.length>0&&applyLinkRanges(e,o),e.dataset.highlighted="true"}function extractCodeAndMarkup(e){function t(e){if(e.nodeType===Node.TEXT_NODE)o+=e.textContent;else if(e.nodeType===Node.ELEMENT_NODE)if("BR"===e.tagName)o+="\n";else if("MARK"===e.tagName){const n=o.length;for(const n of e.childNodes)t(n);const i=extractStyle(e);i&&r.push({start:n,end:o.length,style:i})}else if("A"===e.tagName&&e.getAttribute("href")){const n=o.length;for(const n of e.childNodes)t(n);i.push({start:n,end:o.length,attributes:linkAttributes(e)})}else for(const n of e.childNodes)t(n)}const n=e.querySelector("code")||e,r=[],i=[];let o="";for(const e of n.childNodes)t(e);return{code:o,highlights:r,links:i}}function linkAttributes(e){const t={href:e.getAttribute("href")};for(const n of["target","rel","title"])e.getAttribute(n)&&(t[n]=e.getAttribute(n));return t}function extractStyle(e){const t=[];return e.style?.color&&t.push(`color: ${e.style.color};`),e.style?.backgroundColor&&t.push(`background-color: ${e.style.backgroundColor};`),t.length>0?t.join(" "):null}function applyHighlightRanges(e,t){for(const{start:n,end:r,style:i}of t)wrapRange(e,n,r,(()=>{const e=document.createElement("mark");return e.setAttribute("style",i),e}))}function applyLinkRanges(e,t){for(const{start:n,end:r,attributes:i}of t)wrapRange(e,n,r,(()=>{const e=document.createElement("a");for(const[t,n]of Object.entries(i))e.setAttribute(t,n);return e}))}function wrapRange(e,t,n,r){const i=collectTextNodes(e);for(let e=i.length-1;e>=0;e--){const{node:o,start:s,end:l}=i[e],a=Math.max(t,s),c=Math.min(n,l);if(a>=c)continue;const u=a-s,d=c-s,h=o.textContent,g=o.parentNode,p=r();p.textContent=h.slice(u,d),d<h.length&&g.insertBefore(document.createTextNode(h.slice(d)),o.nextSibling),g.insertBefore(p,o.nextSibling),u>0?o.textContent=h.slice(0,u):g.removeChild(o)}}function collectTextNodes(e){const t=[];let n=0;const r=document.createTreeWalker(e,4);let i;for(;i=r.nextNode();){const e=i.textContent.length;t.push({node:i,start:n,end:n+e}),n+=e}return t}var hasRequiredPrism,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},prism={exports:{}},prismExports=requirePrism(),Prism$1=getDefaultExportFromCjs(prismExports);Prism$1.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}
9],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:/[{}[\];(),.:]/},function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism$1),Prism$1.languages.javascript=Prism$1.languages.extend("clike",{"class-name":[Prism$1.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$1.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism$1.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$1.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$1.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism$1.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism$1.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)])|\([^()]
vendor: 4,426 bytes, line 9
9*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism$1.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism$1.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$1.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$1.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$1.languages.markup&&(Prism$1.languages.markup.tag.addInlined("script","javascript"),Prism$1.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$1.languages.js=Prism$1.languages.javascript,Prism$1.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$1.languages.markup.tag.inside["attr-value"].inside.entity=Prism$1.languages.markup.entity,Prism$1.languages.markup.doctype.inside["internal-subset"].inside=Prism$1.languages.markup,Prism$1.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism$1.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism$1.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$1.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$1.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism$1.languages.markup.tag,"addAttribute",{value:function(e,t){Prism$1.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$1.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism$1.languages.html=Prism$1.languages.markup,Prism$1.languages.mathml=Prism$1.languages.markup,Prism$1.languages.svg=Prism$1.languages.markup,Prism$1.languages.xml=Prism$1.languages.extend("markup",{}),Prism$1.languages.ssml=Prism$1.languages.xml,Prism$1.languages.atom=Prism$1.languages.xml,Prism$1.languages.rss=Prism$1.languages.xml,function(e){function t(e){return e=e.replace(/<inner>/g,(function(){return r})),RegExp(/((?:^|[^\\])(?:\\{2}
vendor: 7,406 bytes, line 9
9)*)/.source+"(?:"+e+")")}function n(e){var t=e.replace(l,"");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)),c(n);var r=a[t];return r||e})),t}var r=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source,i=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return i})),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("^"+o+s+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+s+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(i),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(i),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:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<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:t(/!?\[(?:(?!\])<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){function t(e){if(e&&"string"!=typeof e)for(var n=0,r=e.length;n<r;n++){var i=e[n];if("code"===i.type){var o=i.content[1],s=i.content[3];if(o&&s&&"code-language"===o.type&&"code-block"===s.type&&"string"==typeof o.content){var l=o.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),a="language-"+(l=(/[a-z][\w-]*/i.exec(l)||[""])[0].toLowerCase());s.alias?"string"==typeof s.alias?s.alias=[s.alias,a]:s.alias.push(a):s.alias=[a]}}else t(i.content)}}"markdown"!==e.language&&"md"!==e.language||t(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var r="",i=0,o=t.classes.length;i<o;i++){var s=t.classes[i],l=/language-(.+)/.exec(s);if(l){r=l[1];break}}var a=e.languages[r];if(a)t.content=e.highlight(n(t.content),a,r);else if(r&&"none"!==r&&e.plugins.autoloader){var c="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=c,e.plugins.autoloader.loadLanguages(r,(function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[r],r))}))}}}));var l=RegExp(e.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism$1),Prism$1.languages.c=Prism$1.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$1.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism$1.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$1.languages.c.string],char:Prism$1.languages.c.char,comment:Prism$1.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$1.languages.c}}}}),Prism$1.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$1.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)])|\((?:[^()]|\([^()]
vendor: 12,464 bytes, lines 9-10
9*\))*\))+(?=\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$1),Prism$1.languages.objectivec=Prism$1.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$1.languages.objectivec["class-name"],Prism$1.languages.objc=Prism$1.languages.objectivec,Prism$1.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(){var e=Prism$1.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:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}}();var hasRequiredPrismPython,prismPython={};requirePrismPython();var hasRequiredPrismRust,prismRust={};requirePrismRust(),Prism$1.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$1.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism$1.languages.swift}));var hasRequiredPrismTypescript,prismTypescript={};requirePrismTypescript();var hasRequiredPrismJava,prismJava={};requirePrismJava();var hasRequiredPrismCpp,prismCpp={};requirePrismCpp(),function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,i,o){if(n.language===r){var s=n.tokenStack=[];n.code=n.code.replace(i,(function(e){if("function"==typeof o&&!o(e))return e;for(var i,l=s.length;-1!==n.code.indexOf(i=t(r,l));)++l;return s[l]=e,i})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){function i(l){for(var a=0;a<l.length&&!(o>=s.length);a++){var c=l[a];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=s[o],d=n.tokenStack[u],h="string"==typeof c?c:c.content,g=t(r,u),p=h.indexOf(g);if(p>-1){++o;var f=h.substring(0,p),m=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=h.substring(p+g.length),b=[] 10;f&&b.push.apply(b,i([f])),b.push(m),y&&b.push.apply(b,i([y])),"string"==typeof c?l.splice.apply(l,[a,1].concat(b)):c.content=b}}else c.content&&i(c.content)}return l}if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,s=Object.keys(n.tokenStack);i(n.tokens)}}}})}(Prism$1);var hasRequiredPrismRuby,prismRuby={};requirePrismRuby();var hasRequiredPrismPhp,prismPhp={};requirePrismPhp(),Prism$1.languages.go=Prism$1.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism$1.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism$1.languages.go["class-name"],
vendor: 5,806 bytes, line 10
10function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var
10i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,s=0;s<i.length;s++)o[i[s]]=e.languages.bash[i[s]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash}(Prism$1),Prism$1.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism$1.languages.webmanifest=Prism$1.languages.json,function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(Prism$1),window.Prism||={},window.Prism.manual=!0;const entries=Object.entries,setPrototypeOf=Object.setPrototypeOf,isFrozen=Object.isFrozen,getPrototypeOf=Object.getPrototypeOf,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;let freeze=Object.freeze,seal=Object.seal,create=Object.create,_ref="undefined"!=typeof Reflect&&Reflect,apply=_ref.apply,construct=_ref.construct;freeze||(freeze=function(e){return e}),seal||(seal=function(e){return e}),apply||(apply=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),construct||(construct=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),arrayIsArray=Array.isArray,stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unappl
10y(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),numberToString=unapply(Number.prototype.toString),booleanToString=unapply(Boolean.prototype.toString),bigintToString="undefined"==typeof BigInt?null:unapply(BigInt.prototype.toString),symbolToString="undefined"==typeof Symbol?null:unapply(Symbol.prototype.toString),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),objectToString=unapply(Object.prototype.toString),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError),html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
10spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/{{[\w\W]*|^[\w\W]*}}/g),ERB_EXPR=seal(/<%[\w\W]*|^[\w\W]*%>/g),TMPLIT_EXPR=seal(/\${[\w\W]*/g),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE$1=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i),ELEMENT_MARKUP_PROBE=seal(/<[/\w!]/g),COMMENT_MARKUP_PROBE=seal(/<[/\w]/g),FALLBACK_TAG_CLOSE=seal(/<\/no(script|embed|frames)/i),SELF_CLOSING_TAG=seal(/\/>/i),NODE_TYPE={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},getGlobal=function(){return"undefined"==typeof window?null:window},_createTrustedTypesPolicy=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;
10const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},_createHooksMap=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},_resolveSetOption=function(e,t,n,r){return objectHasOwnProperty(e,t)&&arrayIsArray(e[t])?addToSet(r.base?clone(r.base):{},e[t],r.transform):n};var purify=createDOMPurify();const n="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,r$1=n&&"documentMode"in document?document.documentMode:null,i=n&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),o$1=n&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),s$1=!(!n||!("InputEvent"in window)||r$1)&&"getTargetRanges"in new window.InputEvent("input"),l=n&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,c=n&&/Android/.test(navigator.userAgent),a$1=n&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!c,u=n&&/^(?=.*Chrome).*/i.test(navigator.userAgent),f=n&&c&&u,d$1=n&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&i&&!u,h$1=0,g=1,_$3=2,p=1,y$1=2,m$1=4,x$1=8,C$4=16,S$1=32,v$1=64,k$3=128,T$2=2047,N$3=1,b$3=2,w$3=3,E$4=4,O$4=5,M$5=6,A$3=a$1||l||d$1?"\xa0":"\u200b",D$4="\n\n",P$3=o$1?"\xa0":A$3,F$7="\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc",L$5="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff",I$6=new RegExp("^[^"+L$5+"]*["+F$7+"]"),K$4=new RegExp("^[^"+F$7+"]*["+L$5+"]"),z$7={bold:1,capitalize:1024,code:16,highlight:k$3,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},R$4={directionless:1,unmergeable:2},B$5={center:2,end:6,justify:4,left:1,right:3,start:5},W$5={[b$3]:"center",[M$5]:"end",[E$4]:"justify",[N$3]:"left",[w$3]:"right",[O$4]:"start"},$$4={normal:0,segmented:2,token:1},J$7={[h$1]:"normal",[_$3]:"segmented",[g]:"token"},j$7="$",U$6="$config";let kt$3,Tt$5,Nt$3,bt$3,wt$3,Et$4,Ot$4,Mt$3,At$3,Dt$5,Pt$4,V$7=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){const e=Array.from(this._front).reverse();for(const t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},q$7=!1,H$7=0,it$2=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||gt$3).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0),this.resetOnCopyNode=t.resetOnCopyNode||!1}},ut$3=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n,r=new Map,i){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;const{sharedConfigMap:o}=this.sharedNodeState,s=void 0!==i?i:function(e,t,n){let r=n.size;if(t)for(const i in t){const t=e.get(i);t&&n.has(t)||r++}return r}(o,n,r);this.size=s}getValue(e){const t=this.knownState.get(e);if(void 0!==t)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const t=this.unknownState[e.key];void 0!==t&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(const n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return ht$3(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;const{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(const[i,o]of Object.entries(n)){const n=e.get(i);n?t.has(n)||t.set(n,n.parse(o)):(r=r||{},r[i]=o)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(const e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){const n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);const{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=ht$3(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){const n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}},Ft$3="",Lt$4=null,It$2=null,Kt$3=!1,zt$5=!1;const $t$3="40px",ie$4=re$5("SELECTION_CHANGE_COMMAND"),oe$6=re$5("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),se$5=re$5("CLICK_COMMAND"),le$3=re$5("BEFORE_INPUT_COMMAND"),ce$4=re$5("INPUT_COMMAND"),ae$4=re$5("COMPOSITION_START_COMMAND"),ue$4=re$5("COMPOSITION_END_COMMAND"),fe$4=re$5("DELETE_CHARACTER_COMMAND"),de$4=re$5("INSERT_LINE_BREAK_COMMAND"),he$3=re$5("INSERT_PARAGRAPH_COMMAND"),ge$3=re$5("CONTROLLED_TEXT_INSERTION_COMMAND"),_e$2=re$5("PASTE_COMMAND"),pe$3=re$5("REMOVE_TEXT_COMMAND"),ye$2=re$5("DELETE_WORD_COMMAND"),me$3=re$5("DELETE_LINE_COMMAND"),xe=re$5("FORMAT_TEXT_COMMAND"),Ce$2=re$5("UNDO_COMMAND"),Se$2=re$5("REDO_COMMAND"),ve$2=re$5("KEYDOWN_COMMAND"),ke$2=re$5("KEY_ARROW_RIGHT_COMMAND"),Te$2=re$5("MOVE_TO_END"),Ne$1=re$5("KEY_ARROW_LEFT_COMMAND"),be$1=re$5("MOVE_TO_START"),we$1=re$5("KEY_ARROW_UP_COMMAND"),Ee$3=re$5("KEY_ARROW_DOWN_COMMAND"),Oe$2=re$5("KEY_ENTER_COMMAND"),Me$2=re$5("KEY_SPACE_COMMAND"),Ae$3=re$5("KEY_BACKSPACE_COMMAND"),De$2=re$5("KEY_ESCAPE_COMMAND"),Pe$2=re$5("KEY_DELETE_COMMAND"),Fe$2=re$5("KEY_TAB_COMMAND"),Le$2=re$5("INSERT_TAB_COMMAND"),Ie$3=re$5("INDENT_CONTENT_COMMAND"),Ke$2=re$5("OUTDENT_CONTENT_COMMAND"),ze$2=re$5("DROP_COMMAND"),Re$1=re$5("FORMAT_ELEMENT_COMMAND"),Be$2=re$5("DRAGSTART_COMMAND"),We$2=re$5("DRAGOVER_COMMAND"),$e$2=re$5("DRAGEND_COMMAND"),Je$2=re$5("COPY_COMMAND"),je$2=re$5("CUT_COMMAND"),Ue$2=re$5("SELECT_ALL_COMMAND"),Ve$2=re$5("CLEAR_EDITOR_COMMAND"),Ye$1=re$5("CLEAR_HISTORY_COMMAND"),qe$2=re$5("CAN_REDO_COMMAND"),He$2=re$5("CAN_UNDO_COMMAND"),Ge$2=re$5("FOCUS_COMMAND"),Xe$2=re$5("BLUR_COMMAND"),Qe$1=re$5("KEY_MODIFIER_COMMAND"),Ze$1=Object.freeze({}),tn$1=[["keydown",function(e,t){en$1=e.timeStamp,nn$1=e.key,t.isComposing()||Ts(t,ve$2,e)}],["pointerdown",function(e,t){const n=e.target,r=e.pointerType;qs(n)&&"touch"!==r&&"pen"!==r&&0===e.button&&Ki(t,(()=>{Eo(n)||(an$1=!0)}))}],["compositionstart",function(e,t){Ts(t,ae$4,e)}],["compositionend",function(e,t){o$1?fn$1=!0:l||!a$1&&!d$1?Ts(t,ue$4,e):(dn$1=!0,hn$1=e.data)}],["input",function(e,t){e.stopPropagation(),Ki(t,(()=>{t.dispatchCommand(ce$4,e)}),{event:e}),on$1=null}],["click",function(e,t){Ki(t,(()=>{const n=Qr(),r=Js(Ps(t)),i=Zr();if(r)if(Fr(n)){const t=n.anchor,o=t.getNode();if("element"===t.type&&0===t.offset&&n.isCollapsed()&&!Vi(o)&&1===Zo().getChildrenSize()&&o.getTopLevelElementOrThrow().isEmpty()&&null!==i&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(3===e.detail&&!n.isCollapsed()&&o!==n.focus.getNode()){const e=dl(o,(e=>Wi(e)&&!e.isInline()));Wi(e)&&e.select(0)}}else if("touch"===e.pointerType||"pen"===e.pointerType){const n=r.anchorNode;(Ys(n)||Ko(n))&&es(Xr(i,r,t,e))}Ts(t,se$5,e)}))}],["cut",Ze$1],["copy",Ze$1],["dragstart",Ze$1],["dragover",Ze$1],["dragend",Ze$1],["paste",Ze$1],["focus",Ze$1],["blur",Ze$1],["drop",Ze$1]];s$1&&tn$1.push(["beforeinput",(e,t)=>function(e,t){const n=e.inputType;"deleteCompositionText"===n||o$1&&ks(t)||"insertCompositionText"!==n&&Ts(t,le$3,e)}(e,t)]);let en$1=0,nn$1=null,rn$1=0,on$1=null;const sn$1=new WeakMap,ln$1=new WeakMap;let cn$1=!1,an$1=!1,un$1=!1,fn$1=!1,dn$1=!1,hn$1="",gn$1=null,_n$1=[0,"",0,"root",0];const On$1=new Map,Kn$1=Symbol.for("ephemeral");let Rn$1=class{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=ul(this);return void 0===e&&t(64,this.name),e}static clone(e){t(65,this.name)}$config(){return{}}config(e,t){const n=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:n,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&(this.__state=this.__state.getWritable(this).resetOnCopyNode())}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),$o(this,e)}getType(){return this.__type}isInline(){t(137,this.constructor.name)}isAttached(){let e=this.__key;for(;null!==e;){if("root"===e)return!0;const t=Yo(e);if(null===t)break;e=t.__parent}return!1}isSelected(e){const t=e||Qr();if(null==t)return!1;const n=t.getNodes().some((e=>e.__key===this.__key));if(Tr(this))return n;if(Fr(t)&&"element"===t.anchor.type&&"element"===t.focus.type){if(t.isCollapsed())return!1;const e=this.getParent();if(ji(this)&&this.isInline()&&e){const n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(null===e)return-1;let t=e.getFirstChild(),n=0;for(;null!==t;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return null===e?null:Yo(e)}getParentOrThrow(){const e=this.getParent();return null===e&&t(66,this.__key),e}getTopLevelElement(){let e=this;for(;null!==e;){const n=e.getParent();if(Is(n))return Wi(e)||e===this&&ji(e)||t(194),e;e=n}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return null===e&&t(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;null!==t;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return null===e?null:Yo(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(null===t)return e;let n=t.getFirstChild();for(;null!==n&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return null===e?null:Yo(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=Wi(this)?this:this.getParent(),n=Wi(e)?e:e.getParent(),r=t&&n?Yl(t,n):null;return r?r.commonAncestor:null}is(e){return null!=e&&this.__key===e.__key}isBefore(e){const n=Yl(this,e);return null!==n&&("descendant"===n.type||("branch"===n.type?-1===jl(n):("same"!==n.type&&"ancestor"!==n.type&&t(279),!1)))}isParentOf(e){const t=Yl(this,e);return null!==t&&"ancestor"===t.type}getNodesBetween(e){const n=this.isBefore(e),r=[],i=new Set;let o=this;for(;null!==o;){const s=o.__key;if(i.has(s)||(i.add(s),r.push(o)),o===e)break;const l=Wi(o)?n?o.getFirstChild():o.getLastChild():null;if(null!==l){o=l;continue}const a=n?o.getNextSibling():o.getPreviousSibling();if(null!==a){o=a;continue}const c=o.getParentOrThrow();if(i.has(c.__key)||r.push(c),c===e)break;let u=null,d=c;
10do{if(null===d&&t(68),u=n?d.getNextSibling():d.getPreviousSibling(),d=d.getParent(),null===d)break;null!==u||i.has(d.__key)||r.push(d)}while(null===u);o=u}return n||r.reverse(),r}isDirty(){const e=vi()._dirtyLeaves;return null!==e&&e.has(this.__key)}getLatest(){if(zn(this))return this;const e=Yo(this.__key);return null===e&&t(113),e}getWritable(){if(zn(this))return this;xi();const e=Si(),t=vi(),n=e._nodeMap,r=this.__key,i=this.getLatest(),o=t._cloneNotNeeded,s=Qr();if(null!==s&&s.setCachedNodes(null),o.has(r))return jo(i),i;const l=il(i);return o.add(r),jo(l),n.set(r,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,n){t(70)}updateDOM(e,n,r){t(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){t(18,this.name)}updateFromJSON(e){return function(e,t){const n=e.getWritable(),r=t.$;let i=r;for(const e of dt$3(n).flatKeys)e in t&&(void 0!==i&&i!==r||(i={...r}),i[e]=t[e]);return(n.__state||i)&&ft$2(e).updateFromJSON(i),n}(this,e)}static transform(){return null}remove(e){Ln(this,!0,e)}replace(e,n){xi();let r=Qr();null!==r&&(r=r.clone()),Rs(this,e);const i=this.getLatest(),o=this.__key,s=e.__key,l=e.getWritable(),a=this.getParentOrThrow().getWritable(),c=a.__size;Jo(l);const u=i.getPreviousSibling(),d=i.getNextSibling(),h=i.__prev,g=i.__next,p=i.__parent;if(Ln(i,!1,!0),null===u?a.__first=s:u.getWritable().__next=s,l.__prev=h,null===d?a.__last=s:d.getWritable().__prev=s,l.__next=g,l.__parent=p, 11a.__size=c,n&&(Wi(this)&&Wi(l)||t(139),this.getChildren().forEac
11h((e=>{l.append(e)}))),Fr(r)){es(r);const e=r.anchor,t=r.focus;e.key===o&&Dr(e,l),t.key===o&&Dr(t,l)}return Vo()===o&&Uo(s),l}insertAfter(e,t=!0){xi(),Rs(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.getParent(),o=Qr();let s=!1,l=!1;if(null!==i){const t=e.getIndexWithinParent();if(Jo(r),Fr(o)){const e=i.__key,n=o.anchor,r=o.focus;s="element"===n.type&&n.key===e&&n.offset===t+1,l="element"===r.type&&r.key===e&&r.offset===t+1}}const a=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),u=r.__key,d=n.__next;if(null===a?c.__last=u:a.getWritable().__prev=u,c.__size++,n.__next=u,r.__next=d,r.__prev=n.__key,r.__parent=n.__parent,t&&Fr(o)){const e=this.getIndexWithinParent();ti(o,c,e+1);const t=c.__key;s&&o.anchor.set(t,e+2,"element"),l&&o.focus.set(t,e+2,"element")}return e}insertBefore(e,t=!0){xi(),Rs(this,e);const n=this.getWritable(),r=e.getWritable(),i=r.__key;Jo(r);const o=this.getPreviousSibling(),s=this.getParentOrThrow().getWritable(),l=n.__prev,a=this.getIndexWithinParent();null===o?s.__first=i:o.getWritable().__next=i,s.__size++,n.__prev=i,r.__prev=l,r.__next=n.__key,r.__parent=n.__parent;const c=Qr();return t&&Fr(c)&&ti(c,this.getParentOrThrow(),a),e}isParentRequired(){return!1}createParentElementNode(){return eo()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){xi();const n=this.getPreviousSibling(),r=this.getParentOrThrow();if(null===n)return r.select(0,0);if(Wi(n))return n.select();if(!Tr(n)){const e=n.getIndexWithinParent()+1;return r.select(e,e)}return n.select(e,t)}selectNext(e,t){xi();const n=this.getNextSibling(),r=this.getParentOrThrow();if(null===n)return r.select();if(Wi(n))return n.select(0,0);if(!Tr(n)){const e=n.getIndexWithinParent();return r.select(e,e)}return n.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};const Wn$1="historic",$n$1="history-push",Jn="history-merge",jn="paste",Un="collaboration",Vn="skip-collab",Yn="skip-scroll-into-view",qn="skip-dom-selection",Hn="skip-selection-focus",Gn="composition-start",Xn="composition-end",Qn=/\s*!important\s*$/i;class rr extends Rn$1{static getType(){return"linebreak"}static clone(e){return new rr(e.__key)}constructor(e){super(e)}getTextContent(){return"\n"}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>function(e){const t=e.parentElement;if(null!==t&&Xs(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&lr(n)){const n=t.lastChild;if(n===e||n.previousSibling===e&&lr(n))return!0}}return!1}(e)||function(e){const t=e.parentElement;if(null!==t&&Xs(t)){const n=t.firstChild;if(n===e||n.nextSibling===e&&lr(n))return!1;const r=t.lastChild;if(r===e||r.previousSibling===e&&lr(r))return!0}return!1}(e)?null:{conversion:ir,priority:0}}}static importJSON(e){return or().updateFromJSON(e)}}class gr extends Rn$1{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new gr(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return J$7[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return 1===this.getLatest().__mode}isComposing(){return this.__key===Vo()}isSegmented(){return 2===this.getLatest().__mode}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=z$7[e];return!!(this.getFormat()&t)}isSimpleText(){return"text"===this.__type&&0===this.__mode}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Bo(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const n=this.__format,r=cr(0,n),i=ar(0,n),o=null===r?i:r,s=document.createElement(o);let l=s;
11this.hasFormat("code")&&s.setAttribute("spellcheck","false"),null!==r&&(l=document.createElement(i),s.appendChild(l)),dr(l,this,0,n,this.__text,e);const a=this.__style;return""!==a&&nr(s.style,a),s}updateDOM(e,n,r){const i=this.__text,o=e.__format,s=this.__format,l=cr(0,o),a=cr(0,s),c=ar(0,o),u=ar(0,s);if((null===l?c:l)!==(null===a?u:a))return!0;if(l===a&&c!==u){const e=n.firstChild;null==e&&t(48);const o=document.createElement(u);return dr(o,this,0,s,i,r),n.replaceChild(o,e),!1}let d=n;null!==a&&null!==l&&(d=n.firstChild,null==d&&t(49)),fr(i,d,this);const h=r.theme.text;void 0!==h&&o!==s&&ur(0,o,s,d,h);const g=e.__style,p=this.__style;return g!==p&&nr(n.style,p,g),!1}static importDOM(){return{"#text":()=>({conversion:xr,priority:0}),b:()=>({conversion:pr,priority:0}),code:()=>({conversion:vr,priority:0}),em:()=>({conversion:vr,priority:0}),i:()=>({conversion:vr,priority:0}),mark:()=>({conversion:vr,priority:0}),s:()=>({conversion:vr,priority:0}),span:()=>({conversion:_r,priority:0}),strong:()=>({conversion:vr,priority:0}),sub:()=>({conversion:vr,priority:0}),sup:()=>({conversion:vr,priority:0}),u:()=>({conversion:vr,priority:0})}}static importJSON(e){return kr().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}
vendor: 5,662 bytes, line 11
11exportDOM(e){let{element:n}=super.exportDOM(e);return Ys(n)||t(132),n.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?n.style.textTransform="lowercase":this.hasFormat("uppercase")?n.style.textTransform="uppercase":this.hasFormat("capitalize")&&(n.style.textTransform="capitalize"),this.hasFormat("bold")&&(n=hr(n,"b")),this.hasFormat("italic")&&(n=hr(n,"i")),this.hasFormat("strikethrough")&&(n=hr(n,"s")),this.hasFormat("underline")&&(n=hr(n,"u")),{element:n}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format="string"==typeof e?z$7[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail="string"==typeof e?R$4[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=Bo(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=$$4[e];if(this.__mode===t)return this;const n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){xi();let n=e,r=t;const i=Qr(),o=this.getTextContent(),s=this.__key;if("string"==typeof o){const e=o.length;void 0===n&&(n=e),void 0===r&&(r=e)}else n=0,r=0;if(!Fr(i))return Yr(s,n,s,r,"text","text");{const e=Vo();e!==i.anchor.key&&e!==i.focus.key||Uo(s),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){const i=this.getWritable(),o=i.__text,s=n.length;let l=e;l<0&&(l=s+l,l<0&&(l=0));const a=Qr();if(r&&Fr(a)){const t=e+s;a.setTextNodeRange(i,t,i,t)}const c=o.slice(0,l)+n+o.slice(l+t);return i.__text=c,i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){xi();const t=this.getLatest(),n=t.getTextContent();if(""===n)return[];const r=t.__key,i=Vo(),o=n.length;e.sort(((e,t)=>e-t)),e.push(o);const s=[],l=e.length;for(let t=0,r=0;t<o&&r<=l;r++){const i=e[r];i>t&&(s.push(n.slice(t,i)),t=i)}const a=s.length;if(1===a)return[t];const c=s[0],u=t.getParent();let d;const h=t.getFormat(),g=t.getStyle(),p=t.__detail;let f=!1,m=null,y=null;const b=Qr();if(Fr(b)){const[e,t]=b.isBackward()?[b.focus,b.anchor]:[b.anchor,b.focus];"text"===e.type&&e.key===r&&(m=e),"text"===t.type&&t.key===r&&(y=t)}t.isSegmented()?(d=kr(c),d.__format=h,d.__style=g,d.__detail=p,d.__state=yt$6(t,d),f=!0):d=t.setTextContent(c);const $=[d];for(let e=1;e<a;e++){const n=kr(s[e]);n.__format=h,n.__style=g,n.__detail=p,n.__state=yt$6(t,n);const o=n.__key;i===r&&Uo(o),$.push(n)}const _=m?m.offset:null,C=y?y.offset:null;let x=0;for(const e of $){if(!m&&!y)break;const t=x+e.getTextContentSize();if(null!==m&&null!==_&&_<=t&&_>=x&&(m.set(e.getKey(),_-x,"text"),_<t&&(m=null)),null!==y&&null!==C&&C<=t&&C>=x){y.set(e.getKey(),C-x,"text");break}x=t}if(null!==u){!function(e){const t=e.getPreviousSibling(),n=e.getNextSibling();null!==t&&jo(t),null!==n&&jo(n)}(this);const e=u.getWritable(),t=this.getIndexWithinParent();f?(e.splice(t,0,$),this.remove()):e.splice(t,1,$),Fr(b)&&ti(b,u,t,a-1)}return $}mergeWithSibling(e){const n=e===this.getPreviousSibling();n||e===this.getNextSibling()||t(50);const r=this.__key,i=e.__key,o=this.__text,s=o.length;Vo()===i&&Uo(r);const l=Qr();if(Fr(l)){const t=l.anchor,o=l.focus;null!==t&&t.key===i&&ri(t,n,r,e,s),null!==o&&o.key===i&&ri(o,n,r,e,s)}const a=e.__text,c=n?a+o:o+a;this.setTextContent(c);const u=this.getWritable();return e.remove(),u}isTextEntity(){return!1}}const yr=new WeakMap,Sr={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};class br extends gr{static getType(){return"tab"}static clone(e){return new br(e.__key)}constructor(e){super("\t",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),n=ms(e.theme,"tab");return void 0!==n&&t.classList.add(...n),t}static importJSON(e){return wr().updateFromJSON(e)}setTextContent(t){return"\t"!==t&&""!==t&&e(126),super.setTextContent("\t")}spliceText(e,n,r,i){return""===r&&0===n||"\t"===r&&1===n||t(286),this}setDetail(e){return 2!==e&&t(127),this}setMode(e){return"normal"!==e&&t(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}class Or{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:Jl(rc(ql(this,"next")),rc(ql(e,"next")))<0}getNode(){const e=Yo(this.key);return null===e&&t(20),e}set(e,t,n,r){const i=this._selection,o=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,mi()||(Vo()===o&&Uo(e),null!==i&&(i.setCachedNodes(null),i.dirty=!0)))}}class Pr{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Ir(e))return!1;const t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every((e=>n.has(e)))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}
11clone(){return new Pr(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),n=t.length,r=t[n-1];let i;if(Tr(r))i=r.select();else{const e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=this._nodes,n=[];for(const e of t){const t=Yo(e);null!==t&&n.push(t)}return mi()||(this._cachedNodes=n),n}getTextContent(){const e=this.getNodes();let t="";for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((Qr()||Zr())===this&&e[0]){const t=Ol(e[0],"next");Gl(Wl(t,t))}for(const t of e)t.remove()}}class Lr{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Fr(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(null!==e)return e;const t=function(e){const t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);const i=new Set,o=new Set;for(const n of e)if(Nl(n)){const{origin:e}=n;0===t.length?i.add(e):(o.add(e),t.push(e))}else{const{origin:e}=n;Wi(e)&&o.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),Tl(e.focus)&&Wi(e.focus.origin)&&null===e.focus.getNodeAtCaret())for(let n=Pl(e.focus.origin,"previous");Nl(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Ll(n))i.delete(n.origin),t.pop();for(;t.length>1;){const e=t[t.length-1];if(!Wi(e)||o.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(0===t.length&&e.isCollapsed()){const n=rc(e.anchor),r=rc(e.anchor.getFlipped()),i=e=>vl(e)?e.origin:e.getNodeAtCaret(),o=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(o)}return t}(sc(Ql(this),"next"));return mi()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){this.anchor.set(e.__key,t,"text"),this.focus.set(n.__key,r,"text")}getTextContent(){const e=this.getNodes();if(0===e.length)return"";const t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,o=r.isBefore(i),[s,l]=zr(this);let a="",c=!0;for(let u=0;u<e.length;u++){const d=e[u];if(Wi(d)&&!d.isInline())c||(a+="\n"),c=!d.isEmpty();else if(c=!1,Tr(d)){let e=d.getTextContent();d===t?d===n?"element"===r.type&&"element"===i.type&&i.offset!==r.offset||(e=s<l?e.slice(s,l):e.slice(l,s)):e=o?e.slice(s):e.slice(l):d===n&&(e=o?e.slice(0,l):e.slice(0,s)),a+=e}else!ji(d)&&!sr(d)||d===n&&this.isCollapsed()||(a+=d.getTextContent())}return a}applyDOMRange(e){const t=vi(),n=t.getEditorState()._selection,r=Ur(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(null===r)return;const[i,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(o.key,o.offset,o.type,!0),St$3(this)}clone(){const e=this.anchor,t=this.focus;return new Lr(Mr(e.key,e.offset,e.type),Mr(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=Bo(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=z$7[e];return!!(this.format&t)}insertRawText(e){const t=e.split(/(\r?\n|\t)/),n=[],r=t.length;for(let e=0;e<r;e++){const r=t[e];"\n"===r||"\r\n"===r?n.push(or()):"\t"===r?n.push(wr()):n.push(kr(r))}this.insertNodes(n)}insertText(e){const n=this.anchor,r=this.focus,i=this.format,o=this.style;let s=n,l=r;!this.isCollapsed()&&r.isBefore(n)&&(s=r,l=n),"element"===s.type&&function(e,t,n,r){const i=e.getNode(),o=i.getChildAtIndex(e.offset),s=kr();if(s.setFormat(n),s.setStyle(r),no(o))o.splice(0,0,[s]);else{const e=Vi(i)?eo().append(s):s;null===o?i.append(e):o.insertBefore(e)}e.is(t)&&t.set(s.__key,0,"text"),e.set(s.__key,0,"text")}(s,l,i,o),"element"===l.type&&Hl(l,rc(ql(l,"next")));const a=s.offset;let c=l.offset;const u=this.getNodes(),d=u.length;let h=u[0];Tr(h)||t(26);const g=h.getTextContent().length,p=h.getParentOrThrow();let f=u[d-1];if(1===d&&"element"===l.type&&(c=g,l.set(s.key,c,"text")),this.isCollapsed()&&a===g&&(Io(h)||!h.canInsertTextAfter()||!p.canInsertTextAfter()&&null===h.getNextSibling())){let t=h.getNextSibling();if(Tr(t)&&t.canInsertTextBefore()&&!Io(t)||(t=kr(),t.setFormat(i),t.setStyle(o),p.canInsertTextAfter()?h.insertAfter(t):p.insertAfter(t)),t.select(0,0),h=t,""!==e)return void this.insertText(e)}else if(this.isCollapsed()&&0===a&&(Io(h)||!h.canInsertTextBefore()||!p.canInsertTextBefore()&&null===h.getPreviousSibling())){let t=h.getPreviousSibling();if(Tr(t)&&!Io(t)||(t=kr(),t.setFormat(i),p.canInsertTextBefore()?h.insertBefore(t):p.insertBefore(t)),t.select(),h=t,""!==e)return void this.insertText(e)}else if(h.isSegmented()&&a!==g){const e=kr(h.getTextContent());e.setFormat(i),h.replace(e),h=e}else if(!this.isCollapsed()&&""!==e){const t=f.getParent();if(!p.canInsertTextBefore()||!p.canInsertTextAfter()||Wi(t)&&(!t.canInsertTextBefore()||!t.canInsertTextAfter()))return this.insertText(""),jr(this.anchor,this.focus),void this.insertText(e)}if(1===d){if(Lo(h)){const t=kr(e);return t.select(),void h.replace(t)}const t=h.getFormat(),n=h.getStyle();if(a!==c||t===i&&n===o){if(Er(h)){const t=kr(e);return t.setFormat(i),t.setStyle(o),t.select(),void h.replace(t)}}else{if(""!==h.getTextContent()){const t=kr(e);
11if(t.setFormat(i),t.setStyle(o),t.select(),0===a)h.insertBefore(t,!1);else{const[e]=h.splitText(a);e.insertAfter(t,!1)}return void(t.isComposing()&&"text"===this.anchor.type&&(this.anchor.offset-=e.length))}h.setFormat(i),h.setStyle(o)}const r=c-a;h=h.spliceText(a,r,e,!0),""===h.getTextContent()?h.remove():"text"===this.anchor.type&&(this.format=t,this.style=n,h.isComposing()&&(this.anchor.offset-=e.length))}else{const t=new Set([...h.getParentKeys(),...f.getParentKeys()]),n=Wi(h)?h:h.getParentOrThrow();let r=Wi(f)?f:f.getParentOrThrow(),i=f;if(!n.is(r)&&r.isInline())do{i=r,r=r.getParentOrThrow()}while(r.isInline());if("text"===l.type&&(0!==c||""===f.getTextContent())||"element"===l.type&&f.getIndexWithinParent()<c)if(Tr(f)&&!Lo(f)&&c!==f.getTextContentSize()){if(f.isSegmented()){const e=kr(f.getTextContent());f.replace(e),f=e}Vi(l.getNode())||"text"!==l.type||(f=f.spliceText(0,c,"")),t.add(f.__key)}else{const e=f.getParentOrThrow();e.canBeEmpty()||1!==e.getChildrenSize()?f.remove():e.remove()}else t.add(f.__key);const o=r.getChildren(),s=new Set(u),p=n.is(r),m=n.isInline()&&null===h.getNextSibling()?n:h;for(let e=o.length-1;e>=0;e--){const t=o[e];if(t.is(h)||Wi(t)&&t.isParentOf(h))break;t.isAttached()&&(!s.has(t)||t.is(i)?p||m.insertAfter(t,!1):t.remove())}if(!p){let e=r,n=null;for(;null!==e;){const r=e.getChildren(),i=r.length;(0===i||r[i-1].is(n))&&(t.delete(e.__key),n=e),e=e.getParent()}}if(Lo(h))if(a===g)h.select();else{const t=kr(e);t.select(),h.replace(t)}else h=h.spliceText(a,g-a,e,!0),""===h.getTextContent()?h.remove():"text"===this.anchor.type&&(this.format=h.getFormat(),this.style=h.getStyle(),h.isComposing()&&(this.anchor.offset-=e.length));for(let e=1;e<d;e++){const n=u[e],r=n.__key;t.has(r)||n.remove()}}}removeText(){const e=Qr()===this;Xl(this,nc(Ql(this))),e&&Qr()!==this&&es(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Uo(null);const n=this.getNodes(),r=[];for(const e of n)Tr(e)&&r.push(e);const i=t=>{n.forEach((n=>{if(Wi(n)){const r=n.getFormatFlags(e,t);n.setTextFormat(r)}}))},o=r.length;if(0===o)return this.toggleFormat(e),Uo(null),void i(t);const s=this.anchor,l=this.focus,a=this.isBackward(),c=a?l:s,u=a?s:l;let d=0,h=r[0],g="element"===c.type?0:c.offset;if("text"===c.type&&g===h.getTextContentSize()&&(d=1,h=r[1],g=0),null==h)return;const p=h.getFormatFlags(e,t);i(p);const f=o-1;let m=r[f];const y="text"===u.type?u.offset:m.getTextContentSize();if(h.is(m)){if(g===y)return;if(Io(h)||0===g&&y===h.getTextContentSize())h.setFormat(p);else{const e=h.splitText(g,y),t=0===g?e[0]:e[1];t.setFormat(p),"text"===c.type&&c.set(t.__key,0,"text"),"text"===u.type&&u.set(t.__key,y-g,"text")}return void(this.format=p)}0===g||Io(h)||([,h]=h.splitText(g),g=0),h.setFormat(p);const b=m.getFormatFlags(e,p);y>0&&(y===m.getTextContentSize()||Io(m)||([m]=m.splitText(y)),m.setFormat(b));for(let t=d+1;t<f;t++){const n=r[t],i=n.getFormatFlags(e,b);n.setFormat(i)}"text"===c.type&&c.set(h.__key,g,"text"),"text"===u.type&&u.set(m.__key,y,"text"),this.format=p|b}insertNodes(e){if(0===e.length)return;if(this.isCollapsed()||this.removeText(),"root"===this.anchor.key){this.insertParagraph();const n=Qr();return Fr(n)||t(134),n.insertNodes(e)}const n=(this.isBackward()?this.focus:this.anchor).getNode(),r=dl(n,Qs),i=e[e.length-1];if(Wi(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const t=ai(this);r.splice(t,0,e),i.selectEnd()}return}if(!e.some((e=>(Wi(e)||ji(e))&&!e.isInline()))){Wi(r)||t(211,n.constructor.name,n.getType());const o=ai(this);return r.splice(o,0,e),void i.selectEnd()}const o=function(e){const t=eo();let n=null;for(let r=0;r<e.length;r++){const i=e[r],o=sr(i);if(o||ji(i)&&i.isInline()||Wi(i)&&i.isInline()||Tr(i)||i.isParentRequired()){if(null===n&&(n=i.createParentElementNode(),t.append(n),o))continue;null!==n&&n.append(i)}else t.append(i),n=null}return t}(e),s=o.getLastDescendant(),l=o.getChildren(),a=Wi(r)&&r.isEmpty()?null:this.insertParagraph(),c=l[l.length-1];let u=l[0];var d;Wi(d=u)&&Qs(d)&&!d.isEmpty()&&Wi(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(Wi(r)||t(211,n.constructor.name,n.getType()),r.append(...u.getChildren()),u=l[1]),u&&(null===r&&t(212,n.constructor.name,n.getType()),function(e,n){const r=n.getParentOrThrow().getLastChild();let i=n;const o=[n];for(;i!==r;
11)i.getNextSibling()||t(140),i=i.getNextSibling(),o.push(i);let s=e;for(const e of o)s=s.insertAfter(e)}(r,u));const h=dl(s,Qs);a&&Wi(h)&&(a.canMergeWhenEmpty()||Qs(c))&&(h.append(...a.getChildren()),a.remove()),Wi(r)&&r.isEmpty()&&r.remove(),s.selectEnd();const g=Wi(r)?r.getLastChild():null;sr(g)&&h!==r&&g.remove()}insertParagraph(){if("root"===this.anchor.key){const e=eo();return Zo().splice(this.anchor.offset,0,[e]),e.select(),e}const e=ai(this),n=dl(this.anchor.getNode(),Qs);Wi(n)||t(213);const r=n.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],o=n.insertNewAfter(this,!1);return o?(o.append(...i),o.selectStart(),o):null}insertLineBreak(e){const t=or();if(this.insertNodes([t]),e){const e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){const e=[...this.getNodes()],t=e.length;let n=e[0],r=e[t-1];const[i,o]=zr(this),s=this.isBackward(),[l,a]=s?[this.focus,this.anchor]:[this.anchor,this.focus],[c,u]=s?[o,i]:[i,o];if(0===t)return[];if(1===t){if(Tr(n)&&!this.isCollapsed()){const e=n.splitText(c,u),t=0===c?e[0]:e[1];return t?(l.set(t.getKey(),0,"text"),a.set(t.getKey(),t.getTextContentSize(),"text"),[t]):[]}return[n]}if(Tr(n)&&(c===n.getTextContentSize()?e.shift():0!==c&&([,n]=n.splitText(c),e[0]=n,l.set(n.getKey(),0,"text"))),Tr(r)){const t=r.getTextContent().length;0===u?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,a.set(r.getKey(),r.getTextContentSize(),"text"))}return e}modify(e,t,n){if(fi(this,e,t,n))return;const r="move"===e,i=vi(),o=Js(Ps(i));if(!o)return;const s=i._blockCursorElement,l=i._rootElement,a=this.focus.getNode();if(null===l||null===s||!Wi(a)||a.isInline()||a.canBeEmpty()||$s(s,i,l),this.dirty){let e=Ns(i,this.anchor.key),t=Ns(i,this.focus.key);"text"===this.anchor.type&&(e=Ro(e)),"text"===this.focus.type&&(t=Ro(t)),e&&t&&ii(o,e,this.anchor.offset,t,this.focus.offset)}if(function(e,t,n,r){e.modify(t,n,r)}(o,e,t?"backward":"forward",n),o.rangeCount>0){const e=o.getRangeAt(0),n=this.anchor.getNode(),i=Vi(n)?n:Ls(n);if(this.applyDOMRange(e),this.dirty=!0,!r){const n=this.getNodes(),r=[];let s=!1;for(let e=0;e<n.length;e++){const t=n[e];As(t,i)?r.push(t):s=!0}if(s&&r.length>0)if(t){const e=r[0];Wi(e)?e.selectStart():e.getParentOrThrow().selectStart()}else{const e=r[r.length-1];Wi(e)?e.selectEnd():e.getParentOrThrow().selectEnd()}o.anchorNode===e.startContainer&&o.anchorOffset===e.startOffset||function(e){const t=e.focus,n=e.anchor,r=n.key,i=n.offset,o=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,o,!0)}(this)}}"lineboundary"===n&&fi(this,e,t,n,"decorators")}forwardDeletion(e,t,n){if(!n&&("element"===e.type&&Wi(t)&&e.offset===t.getChildrenSize()||"text"===e.type&&e.offset===t.getTextContentSize())){const e=t.getParent(),n=t.getNextSibling()||(null===e?null:e.getNextSibling());if(Wi(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let n=t.getNode();if(this.forwardDeletion(t,n,e))return;const r=Rl(ql(t,e?"previous":"next"));if(r.getTextSlices().every((e=>null===e||0===e.distance))){let e={type:"initial"};for(const t of r.iterNodeCarets("shadowRoot"))if(Nl(t))if(t.origin.isInline());else{if(t.origin.isShadowRoot()){if("merge-block"===e.type)break;if(Wi(r.anchor.origin)&&r.anchor.origin.isEmpty()){const e=rc(t);Xl(this,Wl(e,e)),r.anchor.origin.remove()}return}"merge-next-block"!==e.type&&"merge-block"!==e.type||(e={block:e.block,caret:t,type:"merge-block"})}else{if("merge-block"===e.type)break;if(Tl(t)){if(Wi(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(r.anchor.origin))break}else e={block:t.origin,type:"merge-next-block"};continue}if(ji(t.origin)){if(t.origin.isIsolated());else if("merge-next-block"===e.type&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&Wi(r.anchor.origin)&&r.anchor.origin.isEmpty()){r.anchor.origin.remove();const e=Hr();e.add(t.origin.getKey()),es(e)}else t.origin.remove();return}break}}if("merge-block"===e.type){const{caret:t,block:n}=e;return Xl(this,Wl(!t.origin.isEmpty()&&n.isEmpty()?Zl(Ol(n,t.direction)):r.anchor,t)),this.removeText()}}const i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&0===t.offset&&Rr(this,t.getNode()))return}else{const r="text"===i.type?i.getNode():null;if(n="text"===t.type?t.getNode():null,null!==r&&r.isSegmented()){const t=i.offset,o=r.getTextContentSize();if(r.is(n)||e&&t!==o||!e&&0!==t)return void Wr(r,e,t)}else if(null!==n&&n.isSegmented()){const i=t.offset,o=n.getTextContentSize();if(n.is(r)||e&&0!==i||!e&&i!==o)return void Wr(n,e,i)}!function(e,t){const n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&"text"===n.type&&"text"===r.type){const e=n.offset,o=r.offset,s=e<o,l=s?e:o,a=s?o:e,c=a-1;l!==c&&function(e){return!(rs(e)||Br(e))}(i.getTextContent().slice(l,a))&&(t?r.set(r.key,c,r.type):n.set(n.key,c,n.type))}}(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&"element"===this.anchor.type&&0===this.anchor.offset){const e=this.anchor.getNode();e.isEmpty()&&Vi(e.getParent())&&null===e.getPreviousSibling()&&Rr(this,e)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}
11deleteWord(e){if(this.isCollapsed()){const t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;this.modify("extend",e,"word")}this.isCollapsed()?this.deleteCharacter(e):this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}const Br=(()=>{try{const e=new RegExp("\\p{Emoji}","u"),t=e.test.bind(e);if(t("\u2764\ufe0f")&&t("#\ufe0f\u20e3")&&t("\ud83d\udc4d"))return t}catch(e){}return()=>!1})();let di=null,hi=null,gi=!1,_i=!1,pi=0;const yi={characterData:!0,childList:!0,subtree:!0};class zi{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(e){return new zi(this.element,e,this.after)}withAfter(e){return new zi(this.element,this.before,e)}withElement(e){return this.element===e?this:new zi(e,this.before,this.after)}insertChild(e){const n=this.before||this.getManagedLineBreak();return null!==n&&n.parentElement!==this.element&&t(222),this.element.insertBefore(e,n),this}removeChild(e){return e.parentElement!==this.element&&t(223),this.element.removeChild(e),this}replaceChild(e,n){return n.parentElement!==this.element&&t(224),this.element.replaceChild(e,n),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(null===e)this.removeManagedLineBreak();else{const t="decorator"===e&&(d$1||l||a$1);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,n="IMG"===e.nodeName?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===("IMG"===t.nodeName))return;this.removeManagedLineBreak()}const n=this.element,r=this.before,i=document.createElement("br");if(n.insertBefore(i,r),e){const e=document.createElement("img");e.setAttribute("data-lexical-linebreak","true"),e.style.setProperty("display","inline","important"),e.style.setProperty("border","0px","important"),e.style.setProperty("margin","0px","important"),e.alt="",n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=0;for(let t=this.after;null!==t;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,n,r){if(n===this.element){const t=this.getFirstChildOffset();return[e,Math.min(t+e.getChildrenSize(),Math.max(t,r))]}const i=Ri(t,n);i.push(r);const o=Ri(t,this.element);let s=e.getIndexWithinParent();for(let e=0;e<o.length;e++){const t=i[e],n=o[e];if(void 0===t||t<n)break;if(t>n){s+=1;break}}return[e.getParentOrThrow(),s]}}class Bi extends Rn$1{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return W$5[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;null!==t;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return 0===this.getChildrenSize()}isDirty(){const e=vi()._dirtyElements;return null!==e&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return null!==t&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;null!==t;){if(Tr(t)&&e.push(t),Wi(t)){const n=t.getAllTextNodes();e.push(...n)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;Wi(e);){const t=e.getFirstChild();if(null===t)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;Wi(e);){const t=e.getLastChild();if(null===t)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),n=t.length;if(e>=n){const e=t[n-1];return Wi(e)&&e.getLastDescendant()||e||null}const r=t[e];return Wi(r)&&r.getFirstDescendant()||r||null}getFirstChild(){const e=this.getLatest().__first;return null===e?null:Yo(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return null===e&&t(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return null===e?null:Yo(e)}getLastChildOrThrow(){const e=this.getLastChild();return null===e&&t(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;null!==n&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;null!==n&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e="";const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContent(),Wi(i)&&r!==n-1&&!i.isInline()&&(e+=D$4)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){const i=t[r];e+=i.getTextContentSize(),Wi(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(""!==e){const t=B$5[e];return!!(this.getFormat()&t)}return!1}hasTextFormat(e){const t=z$7[e];return!!(this.getTextFormat()&t)}getFormatFlags(e,t){return Bo(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){xi();const n=Qr();let r=e,i=t;const o=this.getChildrenSize();if(!this.canBeEmpty())if(0===e&&0===t){const e=this.getFirstChild();if(Tr(e)||Wi(e))return e.select(0,0)}else if(!(void 0!==e&&e!==o||void 0!==t&&t!==o)){const e=this.getLastChild();if(Tr(e)||Wi(e))return e.select()}void 0===r&&(r=o),void 0===i&&(i=o);const s=this.__key;
11return Fr(n)?(n.anchor.set(s,r,"element"),n.focus.set(s,i,"element"),n.dirty=!0,n):Yr(s,r,s,i,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach((e=>e.remove())),e}append(...e){ 12return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=""!==e&&B$5[e]||0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,n,r){zn(this)&&t(324,this.__key,this.__type);const i=this.getChildrenSize(),o=this.getWritable();e+n<=i||t(226,String(e),String(n),String(i));const s=o.__key,l=[],a=[],c=this.getChildAtIndex(e+n);let u=null,d=i-n+r.length;if(0!==e)if(e===i)u=this.getLastChild();else{const t=this.getChildAtIndex(e);null!==t&&(u=t.getPreviousSibling())}if(n>0){let e=null===u?this.getFirstChild():u.getNextSibling();for(let r=0;r<n;r++){null===e&&t(100);const n=e.getNextSibling(),r=e.__key;Jo(e.getWritable()),a.push(r),e=n}}let h=u;for(const e of r){null!==h&&e.is(h)&&(u=h=h.getPreviousSibling());const n=e.getWritable();n.__parent===s&&d--,Jo(n);const r=e.__key;if(null===h)o.__first=r,n.__prev=null;else{const e=h.getWritable();e.__next=r,n.__prev=e.__key}e.__key===s&&t(76),n.__parent=s,l.push(r),h=e}if(e+n===i)null!==h&&(h.getWritable().__next=null,o.__last=h.__key);else if(null!==c){const e=c.getWritable();if(null!==h){const t=h.getWritable();e.__prev=h.__key,t.__next=c.__key}else e.__prev=null}if(o.__size=d,a.length){const e=Qr();if(Fr(e)){const t=new Set(a),n=new Set(l),{anchor:r,focus:i}=e;$i(r,t,n)&&ni(r,r.getNode(),this,u,c),$i(i,t,n)&&ni(i,i.getNode(),this,u,c),0!==d||this.canBeEmpty()||Is(this)||this.remove()}}return o}getDOMSlot(e){return new zi(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ys(t)){const e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+"px");const n=this.getDirection();n&&(t.dir=n)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),n=this.getTextStyle();return 0===t&&""===n||Is(this)||this.getChildren().some(Tr)||(0!==t&&(e.textFormat=t),""!==n&&(e.textStyle=n)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const n=tl(t).$getDOMSlot(this,e,t);let r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){const i=t.getElementByKey(e.getKey());null!==i&&(null==r?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}}class Ji extends Rn$1{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}class Ui extends Bi{__cachedText;static getType(){return"root"}static clone(){return new Ui}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){t(51)}getTextContent(){const e=this.__cachedText;return!mi()&&0!==vi()._dirtyType||null===e?super.getTextContent():e}remove(){t(52)}replace(e){t(53)}insertBefore(e){t(54)}insertAfter(e){t(55)}updateDOM(e,t){return!1}splice(e,n,r){for(const e of r)Wi(e)||ji(e)||t(282);return super.splice(e,n,r)}static importJSON(e){return Zo().updateFromJSON(e)}collapseAtStart(){return!0}}class Xi{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return 1===this._nodeMap.size&&null===this._selection}read(e,t){return Mi(t&&t.editor||null,this,e)}clone(e){const t=new Xi(this._nodeMap,void 0===e?this._selection:e);return t._readOnly=!0,t}toJSON(){return Mi(null,this,(()=>({root:Hi(Zo())})))}}class Qi extends Bi{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class Zi extends Bi{static getType(){return"paragraph"}static clone(e){return new Zi(e.__key)}createDOM(e){const t=document.createElement("p"),n=ms(e.theme,"paragraph");return void 0!==n&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}static importDOM(){return{p:()=>({conversion:to,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ys(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}static importJSON(e){return eo().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(void 0===e.textFormat||void 0===e.textStyle){const t=this.getChildren().find(Tr);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const n=eo();n.setTextFormat(e.format),n.setTextStyle(e.style);const r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){const e=this.getChildren();if(0===e.length||Tr(e[0])&&""===e[0].getTextContent().trim()){if(null!==this.getNextSibling())return this.selectNext(),this.remove(),!0;if(null!==this.getPreviousSibling())return this.selectPrevious(),this.remove(),!0}return!1}}const ro=0,io=1,oo=2,so=3,lo=4,co=-8,ao=-7,uo=-6,fo=-5,ho=-4,po={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:()=>{},$exportDOM:(e,t)=>{const n=bo(t,e.getType());return n&&void 0!==n.exportDOM?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r)=>
12Wi(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,n)=>(Wi(e)||t(336,e.getKey(),e.getType()),e.getDOMSlot(n)),$shouldExclude:e=>Wi(e)&&e.excludeFromCopy("html"),$shouldInclude:(e,t)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};class Co{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,n,r,i,o,s,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=os(),this._onError=i,this._htmlConversions=o,this._editable=s,this._headless=null!==t&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return null!=this._compositionKey}registerUpdateListener(e){return xo(this._listeners.update,e)}registerEditableListener(e){return xo(this._listeners.editable,e)}registerDecoratorListener(e){return xo(this._listeners.decorator,e)}registerTextContentListener(e){return xo(this._listeners.textcontent,e)}registerRootListener(e){const t=this._listeners.root;return Cc(xo(t,e,e(this._rootElement,null)||void 0),(()=>function(e,t,n){const r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement])))}registerCommand(e,n,r){void 0===r&&t(35);const i=this._commands;i.has(e)||i.set(e,[new V$7,new V$7,new V$7,new V$7,new V$7]);const o=i.get(e);void 0===o&&t(36,String(e));const s=function(e){return 7&e}(r),l=o[s];return s!==r?l.addFront(n):l.addBack(n),()=>{l.delete(n),o.every((e=>0===e.size))&&i.delete(e)}}registerMutationListener(e,t,n){const r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation;let o=i.get(t);void 0===o&&(o=new Set,i.set(t,o)),o.add(r);const s=n&&n.skipInitialization;return void 0!==s&&s||this.initializeMutationListener(t,r),()=>{o.delete(r),0===o.size&&i.delete(t)}}getRegisteredNode(e){const n=this._nodes.get(e.getType());return void 0===n&&t(37,e.name),n}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const n=this._editorState,r=rl(n).get(t.getType());if(!r)return;const i=new Map;for(const e of r.keys())i.set(e,"created");i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){const n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(null!=i){const e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){const n=rl(e.getEditorState()),r=[];for(const e of t){const t=n.get(e);t&&r.push(t)}0!==r.length&&e.update((()=>{for(const e of r)for(const t of e.keys()){const e=Yo(t);e&&e.markDirty()}}),null===e._pendingEditorState?{tag:Jn}:void 0)}(this,r.map((e=>e.klass.getType()))),()=>{r.forEach((e=>e.transforms.delete(t)))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return Ts(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const n=ms(this._config.theme,"root"),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,go(this,t,e,r),null!==t&&(this._config.disableEvents||Fn$1(t),null!=n&&t.classList.remove(...n)),null!==e){const t=Ds(e),r=e.style;r.userSelect="text",r.whiteSpace="pre-wrap",r.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=t,this._dirtyType=2,rt$4(this),this._updateTags.add(Jn),Ai(this),this._config.disableEvents||function(e,t){const n=e.ownerDocument;sn$1.set(e,n);
12const r=ln$1.get(n)??0;r<1&&n.addEventListener("selectionchange",Mn),ln$1.set(n,r+1),e.__lexicalEditor=t;const i=En$1(e);for(let n=0;n<tn$1.length;n++){const[r,o]=tn$1[n],s="function"==typeof o?e=>{Dn(e)||(An$1(e),(t.isEditable()||"click"===r)&&o(e,t))}:e=>{if(Dn(e))return;An$1(e);const n=t.isEditable();switch(r){case"cut":return n&&Ts(t,je$2,e);case"copy":return Ts(t,Je$2,e);case"paste":return n&&Ts(t,_e$2,e);case"dragstart":return n&&Ts(t,Be$2,e);case"dragover":return n&&Ts(t,We$2,e);case"dragend":return n&&Ts(t,$e$2,e);case"focus":return n&&Ts(t,Ge$2,e);case"blur":return n&&Ts(t,Xe$2,e);case"drop":return n&&Ts(t,ze$2,e)}};e.addEventListener(r,s),i.push((()=>{e.removeEventListener(r,s)}))}}(e,this),null!=n&&e.classList.add(...n)}else this._window=null,this._updateTags.add(Jn),Ai(this);Di("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,n){e.isEmpty()&&t(38);let r=e;r._readOnly&&(r=Yi(e),r._selection=e._selection?e._selection.clone():null),nt$4(this);const i=this._pendingEditorState,o=this._updateTags,s=void 0!==n?n.tag:null;null===i||i.isEmpty()||(null!=s&&o.add(s),Ai(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,null!=s&&o.add(s),this._updating||Ai(this)}parseEditorState(e,t){return function(e,t,n){const r=qi(),i=di,o=gi,s=hi,l=t._dirtyElements,a=t._dirtyLeaves,c=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Set,t._dirtyType=0,di=r,gi=!1,hi=t,vo(null);try{const i=t._nodes;Oi(e.root,i),n&&n(),r._readOnly=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=l,t._dirtyLeaves=a,t._cloneNotNeeded=c,t._dirtyType=u,di=i,gi=o,hi=s}return r}("string"==typeof e?JSON.parse(e):e,this,t)}read(e){return Ai(this),this.getEditorState().read(e,{editor:this})}update(e,t){!function(e,t,n){e._updating?e._updates.push([t,n]):Ii(e,t,n)}(this,e,t)}focus(e,t={}){const n=this._rootElement;null!==n&&(n.setAttribute("autocapitalize","off"),Ki(this,(()=>{const r=Qr(),i=Zo();null!==r?r.dirty||es(r.clone()):0!==i.getChildrenSize()&&("rootStart"===t.defaultSelection?i.selectStart():i.selectEnd()),Os("focus"),Ms((()=>{n.removeAttribute("autocapitalize"),e&&e()}))})),null===this._pendingEditorState&&n.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;null!==e&&e.blur();const t=Js(this._window);null!==t&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Di("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}Co.version="0.44.0+prod.esm";let So=null,ko=1;const wo="function"==typeof queueMicrotask?queueMicrotask:e=>{Promise.resolve().then(e)},hs={ctrlKey:!i,metaKey:i},gs={altKey:i,ctrlKey:!i},el=new WeakMap,nl=new Map,dl=(e,t)=>{let n=e;for(;null!=n&&!Vi(n);){if(t(n))return n;n=n.getParent()}return null},gl={next:"previous",previous:"next"};class _l{origin;constructor(e){this.origin=e}
vendor: 9,061 bytes, line 12
12[Symbol.iterator](){return $l({hasNext:Tl,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Ol(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Ol(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(null===n?this.insert(e):n.replace(e,t)),this}splice(e,n,r="next"){const i=r===this.direction?n:Array.from(n).reverse();let o=this;const s=this.getParentAtCaret(),l=new Map;for(let t=o.getAdjacentCaret();null!==t&&l.size<e;t=t.getAdjacentCaret()){const e=t.origin.getWritable();l.set(e.getKey(),e)}for(const e of i){if(l.size>0){const n=o.getNodeAtCaret();if(n)if(l.delete(n.getKey()),l.delete(e.getKey()),n.is(e)||o.origin.is(e));else{const t=e.getParent();t&&t.is(s)&&e.remove(),n.replace(e)}else null===n&&t(263,Array.from(l).join(" "))}else o.insert(e);o=Ol(e,this.direction)}for(const e of l.values())e.remove();return this}}class pl extends _l{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Pl(e,this.direction)}getParentCaret(e="root"){return Ol(xl(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=ml(this.direction);return Ol(this.getNodeAtCaret(),e)||Pl(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof pl&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const yl={root:Vi,shadowRoot:Is};class Cl extends _l{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Ol(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return Wi(this.origin)?Pl(this.origin,this.direction):null}getParentCaret(e="root"){return Ol(xl(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=ml(this.direction);return Ol(this.getNodeAtCaret(),e)||Pl(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof Cl&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof Cl||e instanceof Sl)&&this.direction===e.direction&&this.origin.is(e.origin)}}class Sl extends _l{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Ml(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Ol(xl(this.getParentAtCaret(),e),this.direction)}getFlipped(){return Ml(this.origin,ml(this.direction),this.offset)}isSamePointCaret(e){return e instanceof Sl&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof Cl||e instanceof Sl)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Ol(this.origin,this.direction)}}const bl={next:class extends Sl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Sl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},wl={next:class extends Cl{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends Cl{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},El={next:class extends pl{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends pl{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};class Il{type="node-caret-range";direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new Il(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=e=>{const t=this[e].getLatest();return vl(t)?function(e,t){const{direction:n,origin:r}=e;return Dl(e,Al(r,"focus"===t?ml(n):n)-e.offset)}(t,e):null},t=e("anchor"),n=e("focus");if(t&&n){const{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[Dl(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e="root"){const t=vl(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=vl(n),i=t=>t.isSameNodeCaret(n)?null:Ll(t)||t.getParentCaret(e);return $l({hasNext:e=>null!==e&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Kl{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return Ml(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}}var Lexical_prod=Object.freeze({__proto__:null,$addUpdateTag:Os,$applyNodeReplacement:zs,$caretFromPoint:ql,$caretRangeFromSelection:Ql,$cloneWithProperties:il,$cloneWithPropertiesEphemeral:ol,$comparePointCaretNext:Jl,$copyNode:Ks,$create:fl,$createChildrenArray:hl,$createLineBreakNode:or,$createNodeSelection:Hr,$createParagraphNode:eo,$createPoint:Mr,$createRangeSelection:qr,$createRangeSelectionFromDom:Gr,$createTabNode:wr,$createTextNode:kr,$extendCaretToRange:Rl,$findMatchingParent:dl,$getAdjacentChildCaret:Ll,$getAdjacentNode:vs,$getAdjacentSiblingOrParentSiblingCaret:cc,$getCaretInDirection:oc,$getCaretRange:Wl,$getCaretRangeInDirection:sc,$getCharacterOffsets:zr,$getChildCaret:Pl,$getChildCaretAtIndex:lc,$getChildCaretOrSelf:Fl,$getCollapsedCaretRange:Bl,$getCommonAncestor:Yl,$getCommonAncestorResultBranchOrder:jl,$getEditor:Zs,$getEditorDOMRenderConfig:tl,$getNearestNodeFromDOMNode:Go,$getNearestRootOrShadowRoot:Ls,$getNodeByKey:Yo,$getNodeByKeyOrThrow:Bs,$getNodeFromDOMNode:qo,$getPreviousSelection:Zr,$getRoot:Zo,$getSelection:Qr,$getSiblingCaret:Ol,$getState:st$2,$getStateChange:lt$3,$getTextContent:ci,$getTextNodeOffset:Al,$getTextPointCaret:Ml,$getTextPointCaretSlice:Dl,$getWritableNodeState:ft$2,$hasAncestor:As,$hasUpdateTag:Es,$insertNodes:li,$isBlockElementNode:Vr,$isChildCaret:Nl,$isDecoratorNode:ji,$isEditorState:Gi,$isElementNode:Wi,$isExtendableTextPointCaret:ic,$isInlineElementOrDecoratorNode:Fs,$isLeafNode:Wo,$isLexicalNode:Bn,$isLineBreakNode:sr,$isNodeCaret:kl,$isNodeSelection:Ir,$isParagraphNode:no,$isRangeSelection:Fr,$isRootNode:Vi,$isRootOrShadowRoot:Is,$isSiblingCaret:Tl,$isTabNode:Er,$isTextNode:Tr,$isTextPointCaret:vl,$isTextPointCaretSlice:zl,$isTokenOrSegmented:Io,$isTokenOrTab:Lo,$nodesOfType:Cs,$normalizeCaret:rc,$normalizeSelection__EXPERIMENTAL:St$3,$onUpdate:Ms,$parseSerializedNode:Ei,$removeTextFromCaretRange:nc,$rewindSiblingCaret:Zl,$selectAll:ys,$setCompositionKey:Uo,$setPointFromCaret:Hl,$setSelection:es,$setSelectionFromCaretRange:Gl,$setState:ct$2,$splitAtPointCaretNext:fc,$splitNode:Us,$updateRangeSelectionFromCaretRange:Xl,ArtificialNode__DO_NOT_USE:Qi,BEFORE_INPUT_COMMAND:le$3,BLUR_COMMAND:Xe$2,CAN_REDO_COMMAND:qe$2,CAN_UNDO_COMMAND:He$2,CLEAR_EDITOR_COMMAND:Ve$2,CLEAR_HISTORY_COMMAND:Ye$1,CLICK_COMMAND:se$5,COLLABORATION_TAG:Un,COMMAND_PRIORITY_BEFORE_CRITICAL:ho,COMMAND_PRIORITY_BEFORE_EDITOR:co,COMMAND_PRIORITY_BEFORE_HIGH:fo,COMMAND_PRIORITY_BEFORE_LOW:ao,COMMAND_PRIORITY_BEFORE_NORMAL:uo,COMMAND_PRIORITY_CRITICAL:lo,COMMAND_PRIORITY_EDITOR:ro,COMMAND_PRIORITY_HIGH:so,COMMAND_PRIORITY_LOW:io,COMMAND_PRIORITY_NORMAL:oo,COMPOSITION_END_COMMAND:ue$4,COMPOSITION_END_TAG:Xn,COMPOSITION_START_COMMAND:ae$4,COMPOSITION_START_TAG:Gn,CONTROLLED_TEXT_INSERTION_COMMAND:ge$3,COPY_COMMAND:Je$2,CUT_COMMAND:je$2,DEFAULT_EDITOR_DOM_CONFIG:po,DELETE_CHARACTER_COMMAND:fe$4,DELETE_LINE_COMMAND:me$3,DELETE_WORD_COMMAND:ye$2,DRAGEND_COMMAND:$e$2,DRAGOVER_COMMAND:We$2,DRAGSTART_COMMAND:Be$2,DROP_COMMAND:ze$2,DecoratorNode:Ji,ElementNode:Bi,FOCUS_COMMAND:Ge$2,FORMAT_ELEMENT_COMMAND:Re$1,FORMAT_TEXT_COMMAND:xe,HISTORIC_TAG:Wn$1,HISTORY_MERGE_TAG:Jn,HISTORY_PUSH_TAG:$n$1,INDENT_CONTENT_COMMAND:Ie$3,INPUT_COMMAND:ce$4,INSERT_LINE_BREAK_COMMAND:de$4,INSERT_PARAGRAPH_COMMAND:he$3,INSERT_TAB_COMMAND:Le$2,INTERNAL_$isBlock:Qs,IS_ALL_FORMATTING:T$2,IS_BOLD:p,IS_CODE:C$4,IS_HIGHLIGHT:k$3,IS_ITALIC:y$1,IS_STRIKETHROUGH:m$1,IS_SUBSCRIPT:S$1,IS_SUPERSCRIPT:v$1,IS_UNDERLINE:x$1,KEY_ARROW_DOWN_COMMAND:Ee$3,KEY_ARROW_LEFT_COMMAND:Ne$1,KEY_ARROW_RIGHT_COMMAND:ke$2,KEY_ARROW_UP_COMMAND:we$1,KEY_BACKSPACE_COMMAND:Ae$3,KEY_DELETE_COMMAND:Pe$2,KEY_DOWN_COMMAND:ve$2,KEY_ENTER_COMMAND:Oe$2,
12KEY_ESCAPE_COMMAND:De$2,KEY_MODIFIER_COMMAND:Qe$1,KEY_SPACE_COMMAND:Me$2,KEY_TAB_COMMAND:Fe$2,LineBreakNode:rr,MOVE_TO_END:Te$2,MOVE_TO_START:be$1,NODE_STATE_KEY:j$7,OUTDENT_CONTENT_COMMAND:Ke$2,PASTE_COMMAND:_e$2,PASTE_TAG:jn,ParagraphNode:Zi,REDO_COMMAND:Se$2,REMOVE_TEXT_COMMAND:pe$3,RootNode:Ui,SELECTION_CHANGE_COMMAND:ie$4,SELECTION_INSERT_CLIPBOARD_NODES_COMMAND:oe$6,SELECT_ALL_COMMAND:Ue$2,SKIP_COLLAB_TAG:Vn,SKIP_DOM_SELECTION_TAG:qn,SKIP_SCROLL_INTO_VIEW_TAG:Yn,SKIP_SELECTION_FOCUS_TAG:Hn,TEXT_TYPE_TO_FORMAT:z$7,TabNode:br,TextNode:gr,UNDO_COMMAND:Ce$2,addClassNamesToElement:mc,buildImportMap:In,configExtension:hc,createCommand:re$5,createEditor:yo,createSharedNodeState:at$3,createState:ot$3,declarePeerDependency:gc,defineExtension:dc,flipDirection:ml,getDOMOwnerDocument:ws,getDOMSelection:Js,getDOMSelectionFromTarget:js,getDOMTextNode:Ro,getEditorPropertyFromDOMNode:Po,getNearestEditorFromDOMNode:Do,getRegisteredNode:bo,getRegisteredNodeOrThrow:No,getStaticNodeConfig:ul,getStyleObjectFromCSS:Zn,getTextDirection:Fo,getTransformSetFromKlass:_o,isBlockDomNode:Xs,isCurrentlyReadOnlyMode:mi,isDOMDocumentNode:zo,isDOMNode:qs,isDOMTextNode:Ko,isDOMUnmanaged:cl,isDocumentFragment:Hs,isExactShortcutMatch:ds,isHTMLAnchorElement:Vs,isHTMLElement:Ys,isInlineDomNode:Gs,isLexicalEditor:Ao,isModifierMatch:fs,isSelectionCapturedInDecoratorInput:Oo,isSelectionWithinEditor:Mo,makeStepwiseIterator:$l,mergeRegister:Cc,normalizeClassNames:yc,removeClassNamesFromElement:xc,removeFromParent:Jo,resetRandomKey:To,safeCast:_c,setDOMStyleFromCSS:nr,setDOMStyleObject:er,setDOMUnmanaged:ll,setNodeIndentFromDOM:sl,shallowMergeConfig:pc,toggleTextFormatType:Bo});const oe$5=Zn;class Configuration{#e={};constructor(...e){this.merge(...e)}merge(...e){return this.#e=e.reduce(deepMerge,this.#e)}get(e){return e.split(".").reduce(((e,t)=>e[t]),this.#e)}}const global$1=new Configuration({attachmentTagName:"action-text-attachment",attachmentContentTypeNamespace:"actiontext",authenticatedUploads:!1,extensions:[]}),presets=new Configuration({default:{attachments:!0,markdown:!0,multiLine:!0,permittedAttachmentTypes:null,richText:!0,toolbar:{upload:"both"},headings:["h2","h3","h4"],highlight:{buttons:{color:range(1,9).map((e=>`var(--highlight-${e})`)),"background-color":range(1,9).map((e=>`var(--highlight-bg-${e})`))},permit:{color:[],"background-color":[]}}}});var Lexxy={global:global$1,presets:presets,configure({global:e,...t}){e&&global$1.merge(e),presets.merge(t)}};const URI_BEARING_ATTACHMENT_ATTRIBUTES=["url"],BASE_URI_SCHEMES="(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix",SCHEME_NAME=/^[a-z][a-z0-9+.-]*$/,EXECUTABLE_SCHEME=/^(?:\w+script|data)$/i,ALLOWED_URI=allowedUriRegexp(),ATTR_WHITESPACE=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,ATTACHMENT_DATA_URI=/^data:/i;let trustedTypesPolicyResolved=!1,resolvedTrustedTypesPolicy=null;const DOMPurify=purify(window),ALLOWED_HTML_ATTRIBUTES=["alt","class","contenteditable","href","src","style","title"],DEFAULT_TAG_ATTRIBUTES={img:["width","height"]},ALLOWED_STYLE_PROPERTIES=["color","background-color"];DOMPurify.addHook("uponSanitizeAttribute",styleFilterHook),DOMPurify.addHook("uponSanitizeAttribute",attachmentUriFilterHook);const FORBIDDEN_STIMULUS_ATTRIBUTES=["data-controller","data-action"];DOMPurify.addHook("uponSanitizeAttribute",stimulusAttributeFilterHook),DOMPurify.addHook("uponSanitizeElement",((e,t)=>{"strong"!==t.tagName&&"em"!==t.tagName||e.removeAttribute("class")}));class ListenerBin{#t=[];track(...e){this.#t.push(...e)}dispose(){for(;this.#t.length;){this.#t.pop()()}}}class NextElementFinder{constructor(e,t){this.elements=e,this.key=t}selectNext(e){const t=this.#n(e);if(t){const e=this.elements.filter((e=>e!==t));return this.#r(e),this.#i(t),!0}return!1}#n(e){switch(this.key){case"ArrowRight":case"ArrowDown":return this.#o(e);case"ArrowLeft":case"ArrowUp":return this.#s(e);case"Home":return this.#l();case"End":return this.#a()}}#l(e=this.elements){return e.find(isActiveAndVisible)}#a(e=this.elements){return e.findLast(isActiveAndVisible)}#o(e){const t=this.elements.slice(this.#c(e)+1);return this.#l(t)}#s(e){const t=this.elements.slice(0,this.#c(e));return this.#a(t)}#c(e){return this.elements.indexOf(e)}#i(e){isActiveAndVisible(e)&&(e.tabIndex=0,e.focus())}#r(e){e.forEach((e=>e.tabIndex=-1))}}var ToolbarIcons={bold:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M9.05273 1.88232C10.6866 1.88237 12.0033 2.20353 12.9529 2.89673L13.1272 3.0293C13.974 3.70864 14.4008 4.63245 14.4009 5.76562C14.4008 6.49354 14.2316 7.15281 13.8845 7.73145C13.6683 8.09188 13.3997 8.40162 13.0818 8.66016C13.5902 8.92606 14.0196 9.28599 14.3635 9.74121C14.8586 10.3834 15.0945 11.1743 15.0945 12.0879C15.0944 13.3698 14.5922 14.3931 13.5879 15.1106L13.5857 15.1128C12.5967 15.805 11.196 16.125 9.43799 16.125H3.10547V1.88232L9.05273 1.88232ZM6.36108 13.4084H9.28418C10.224 13.4084
1210.8634 13.2491 11.2581 12.9851C11.6259 12.7389 11.8198 12.3768 11.8198 11.8367C11.8197 11.2968 11.6259 10.9351 11.2581 10.689C10.8634 10.425 10.2241 10.2649 9.28418 10.2649H6.36108V13.4084ZM6.36108 7.56812H8.78247C9.5163 7.56809 10.0547 7.45371 10.429 7.25757L10.5791 7.16895C10.9438 6.92178 11.1255 6.57934 11.1255 6.09302C11.1254 5.59017 10.9414 5.25227 10.5835 5.02002L10.5784 5.01636L10.5732 5.01343C10.1994 4.75387 9.61878 4.59818 8.78247 4.59814H6.36108V7.56812Z"/>\n </svg>',italic:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M14.1379 3.91187L14.1086 4.06421H11.4668L9.49805 13.9431H12.0981L11.7473 15.7852L11.7188 15.9375H4.16675L4.51758 14.0955L4.54614 13.9431H7.18799L9.17505 4.06421H6.55664L6.90747 2.22217L6.93677 2.06982H14.4888L14.1379 3.91187Z"/>\n </svg>',strikethrough:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M14.3723 11.8015C14.3771 11.8858 14.3811 11.9756 14.3811 12.0681C14.3811 12.811 14.1777 13.4959 13.7725 14.1174L13.7717 14.1189C13.3624 14.7329 12.7463 15.2162 11.9377 15.5742L11.9348 15.5757C11.1214 15.9223 10.1306 16.092 8.96997 16.092C7.9356 16.092 6.93308 15.9348 5.96338 15.6204L5.96045 15.6189C5.00593 15.292 4.24112 14.8699 3.67676 14.3459L3.57568 14.2522L3.63501 14.1277L4.45605 12.397L4.64282 12.5654C5.13492 13.0083 5.76733 13.3759 6.54492 13.6648C7.33475 13.9406 8.14322 14.0786 8.96997 14.0786C10.0731 14.0786 10.8638 13.8932 11.3708 13.5513C11.8757 13.1982 12.1172 12.7464 12.1172 12.1838C12.1172 12.0662 12.1049 11.9556 12.0828 11.8513L12.0344 11.625H14.3621L14.3723 11.8015Z"/>\n <path d="M9.2981 1.91602C10.111 1.91604 10.9109 2.02122 11.6975 2.23096C12.4855 2.44111 13.1683 2.74431 13.7417 3.14429L13.8655 3.23071L13.8083 3.36987L13.1726 4.91235L13.0869 5.1189L12.8987 4.99878C12.3487 4.64881 11.761 4.38633 11.1365 4.21143L11.1328 4.20996C10.585 4.04564 10.0484 3.95419 9.52295 3.93384L9.2981 3.92944C8.22329 3.92944 7.44693 4.12611 6.94043 4.49121C6.44619 4.85665 6.20874 5.31616 6.20874 5.88135L6.21533 6.03296C6.24495 6.37662 6.37751 6.65526 6.61011 6.87964L6.72144 6.97632C6.98746 7.19529 7.30625 7.37584 7.68018 7.51538L8.05151 7.63184C8.45325 7.75061 8.94669 7.87679 9.53247 8.01123L9.53467 8.01196C10.1213 8.15305 10.6426 8.29569 11.0991 8.4375H15C15.5178 8.4375 15.9375 8.85723 15.9375 9.375C15.9375 9.89277 15.5178 10.3125 15 10.3125H3C2.48223 10.3125 2.0625 9.89277 2.0625 9.375C2.0625 8.85723 2.48223 8.4375 3 8.4375H4.93726C4.83783 8.34526 4.74036 8.24896 4.64795 8.146L4.64502 8.14233C4.1721 7.58596 3.94482 6.85113 3.94482 5.95825C3.94483 5.20441 4.14059 4.51965 4.53369 3.90967L4.53516 3.90747C4.94397 3.29427 5.55262 2.81114 6.34863 2.45288C7.15081 2.0919 8.13683 1.91602 9.2981 1.91602Z"/>\n </svg>',underline:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 14C14.5523 14 15 14.4477 15 15C15 15.5523 14.5523 16 14 16H4C3.44772 16 3 15.5523 3 15C3 14.4477 3.44772 14 4 14H14Z"/>\n <path d="M12.625 1.59375C13.25 1.59375 13.625 1.97656 13.625 2.64062V9.02344C13.625 11.4844 11.8516 13.1875 8.99219 13.1875C6.14062 13.1875 4.35938 11.4844 4.35938 9.02344V2.64062C4.35938 1.97656 4.74219 1.59375 5.36719 1.59375C6 1.59375 6.375 1.97656 6.375 2.64062V8.84375C6.375 10.3828 7.32031 11.4297 8.99219 11.4297C10.6641 11.4297 11.6172 10.3828 11.6172 8.84375V2.64062C11.6172 1.97656 11.9922 1.59375 12.625 1.59375Z"/>\n </svg>',heading:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.5 2C12.0523 2 12.5 2.44772 12.5 3V3.5C12.5 4.05228 12.0523 4.5 11.5 4.5H8V15C8 15.5523 7.55228 16 7 16H6.5C5.94772 16 5.5 15.5523 5.5 15V4.5H2C1.44772 4.5 1 4.05228 1 3.5V3C1 2.44772 1.44772 2 2 2H11.5ZM16 7C16.5523 7 17 7.44772 17 8V8.5C17 9.05228 16.5523 9.5 16 9.5H15V15C15 15.5523 14.5523 16 14 16H13.5C12.9477 16 12.5 15.5523 12.5 15V9.5H11.5C10.9477 9.5 10.5 9.05228 10.5 8.5V8C10.5 7.44772 10.9477 7 11.5 7H16Z"/>\n </svg>',h1:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM13.8418 4.125H14.8271C15.543 4.125 16.0449 4.56934 16.0449 5.23828V12.7207C16.0449 13.4111 15.6348 13.8486 14.9854 13.8486C14.336 13.8486 13.9395 13.418 13.9395 12.7207V6.11133H13.8887L12.9541 6.74219C12.7354 6.88574 12.5303 6.95312 12.3047 6.95312C11.7646 6.95312 11.3955 6.58398 11.3955 6.06445C11.3955 5.69531 11.5801 5.42578 11.9766 5.15625L13.4023 4.32031C13.5459 4.23633 13.6826 4.17578 13.8418 4.125Z"/>\n </svg>', 13h2:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM13.6445 4.19824C15.5244 4.19824 16.8984 5.34668 16.8984 6.91211C16.8984 7.8759 16.4335 8.7237 15.292 9.84473L13.3438 11.8135V11.9092H16.1875C16.8232 11.9092 17.2197 12.251 17.2197 12.8115C17.2196 13.3651 16.83 13.7002 16.187
135 13.7002H11.5117C10.8487 13.7002 10.4112 13.3241 10.4111 12.75C10.4111 12.3399 10.6368 11.9843 11.3203 11.3145L13.6855 8.88086C14.4169 8.13583 14.7245 7.64349 14.7246 7.12402C14.7246 6.4541 14.2393 6.00293 13.5215 6.00293C12.9404 6.00293 12.5166 6.29688 12.2158 6.90527C11.9151 7.37002 11.6552 7.54785 11.2588 7.54785C10.7188 7.54785 10.3429 7.17861 10.3428 6.65918C10.3428 5.3877 11.7783 4.19824 13.6445 4.19824Z"/>\n </svg>',h3:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M13.5967 4.19824C15.5928 4.19824 16.9873 5.23047 16.9873 6.7002C16.9872 7.705 16.2421 8.60059 15.2988 8.7168V8.86719C16.4199 8.94923 17.2607 9.89942 17.2607 11.0889C17.2606 12.7362 15.7362 13.9053 13.583 13.9053C11.6827 13.9053 10.1925 12.873 10.1924 11.7041C10.1924 11.1846 10.5547 10.8154 11.0537 10.8154C11.3818 10.8154 11.6553 10.9727 11.9629 11.3555C12.3799 11.9159 12.92 12.2031 13.583 12.2031C14.4853 12.2031 15.0731 11.7313 15.0732 11C15.0732 10.2754 14.4785 9.7832 13.5898 9.7832H13.0361C12.5645 9.7832 12.2159 9.4208 12.2158 8.92188C12.2158 8.44336 12.5576 8.07422 13.0361 8.07422H13.5693C14.3075 8.07422 14.8544 7.60928 14.8545 6.97363C14.8545 6.33789 14.3213 5.90039 13.5557 5.90039C12.9678 5.90039 12.5029 6.16016 12.0859 6.71387C11.8399 7.03508 11.5527 7.17871 11.1973 7.17871C10.671 7.17871 10.295 6.82314 10.2949 6.31738C10.2949 5.18945 11.751 4.19824 13.5967 4.19824ZM8.0332 4.30078C8.75781 4.30078 9.16797 4.74512 9.16797 5.51758V12.5518C9.1679 13.3241 8.75776 13.7686 8.0332 13.7686C7.30865 13.7686 6.90534 13.3309 6.90527 12.5518V9.87207H3.48047V12.5518C3.4804 13.3241 3.07026 13.7686 2.3457 13.7686C1.62115 13.7686 1.21784 13.3309 1.21777 12.5518V5.51758C1.21777 4.73828 1.62109 4.30078 2.3457 4.30078C3.07031 4.30078 3.48047 4.74512 3.48047 5.51758V8.07422H6.90527V5.51758C6.90527 4.73828 7.30859 4.30078 8.0332 4.30078Z"/>\n </svg>',h4:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M14.6357 4.22559C15.7432 4.22559 16.4336 4.80664 16.4336 5.73633V10.3164H16.7275C17.2881 10.3164 17.6436 10.6787 17.6436 11.2256C17.6435 11.7655 17.3017 12.1006 16.7275 12.1006H16.4336V12.6611C16.4335 13.3515 16.0234 13.7891 15.374 13.7891C14.7247 13.7891 14.3282 13.3583 14.3281 12.6611V12.1006H11.04C10.2335 12.1006 9.76863 11.6766 9.76855 10.918C9.76855 10.5762 9.85064 10.3026 10.1104 9.74219C10.7666 8.42289 11.5733 7.0146 12.5713 5.54492C13.2549 4.56738 13.7812 4.22559 14.6357 4.22559ZM7.88965 4.30078C8.61426 4.30078 9.02441 4.74512 9.02441 5.51758V12.5518C9.02435 13.3241 8.6142 13.7686 7.88965 13.7686C7.1651 13.7686 6.76178 13.3309 6.76172 12.5518V9.87207H3.33691V12.5518C3.33685 13.3241 2.9267 13.7686 2.20215 13.7686C1.4776 13.7686 1.07428 13.3309 1.07422 12.5518V5.51758C1.07422 4.73828 1.47754 4.30078 2.20215 4.30078C2.92676 4.30078 3.33691 4.74512 3.33691 5.51758V8.07422H6.76172V5.51758C6.76172 4.73828 7.16504 4.30078 7.88965 4.30078ZM14.2188 6.07812C13.6035 7.02841 12.2158 9.48929 11.7988 10.2686V10.3164H14.3281V6.07812H14.2188Z"/>\n </svg>',h5:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM16.1191 4.30078C16.6934 4.30078 17.0762 4.63672 17.0762 5.16602C17.0762 5.69531 16.6934 6.03125 16.1191 6.03125H13.3457L12.9219 8.25586H13.0176C13.248 8.03711 13.6855 7.84375 14.2871 7.84375C15.9277 7.84375 17.1445 9.07422 17.1445 10.7832C17.1445 12.5605 15.8184 13.9053 13.7695 13.9053C11.9512 13.9053 10.6934 12.9277 10.5566 11.7178C10.5566 11.2021 10.9121 10.8193 11.4277 10.8193C11.8379 10.8193 12.1328 11.0244 12.3516 11.4893C12.625 12.0361 13.1133 12.2549 13.7285 12.2549C14.5488 12.2549 15.1367 11.6533 15.1367 10.7695C15.1367 9.92188 14.5625 9.31348 13.7559 9.31348C13.1953 9.31348 12.7578 9.56055 12.4629 10.0254C12.2168 10.3887 11.9355 10.5527 11.5527 10.5527C10.9648 10.5527 10.5684 10.1699 10.5684 9.55469C10.5684 9.42773 10.582 9.30762 10.6094 9.17383L11.2383 5.55273C11.3516 4.88379 11.7207 4.30078 12.6797 4.30078H16.1191Z"/>\n </svg>',h6:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM13.6719 13.9258C15.5518 13.9258 17.1445 12.37306 17.1445 10.35451V10.05763C17.1445 8.10744 16.6016 6.59574 15.5928 5.58694C14.8613 4.85544 13.8975 4.42384 12.7285 4.25294C12.4199 4.21194 12.1592 4.19824 11.8643 4.19824C11.2627 4.19824 10.8389 4.59474 10.8389 5.14164C10.8389 5.65724 11.2354 6.02054 11.7783 6.04784C12.1758 6.06834 12.4844 6.10944 12.7656 6.19144C13.5176 6.42384 14.0742 6.95314 14.3965 7.75974L14.4922 8.00584H14.3828C14.0605 7.56834 13.4863 7.25974 12.6523 7.25974C11.1406 7.25974 10.0674 8.42384 10.0674 10.
1302345V10.27736C10.0674 12.2549 11.4668 13.9258 13.6719 13.9258ZM13.5215 12.24123C12.6797 12.24123 12.0918 11.48244 12.0918 10.4131V10.1592C12.0918 9.26174 12.6523 8.71291 13.5352 8.71291C14.3965 8.71291 14.9844 9.27638 14.9844 10.1592V10.4131C14.9844 11.48244 14.3828 12.24123 13.5215 12.24123Z"/>\n </svg>',paragraph:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M9 12C9.55228 12 10 12.4477 10 13C10 13.5523 9.55228 14 9 14H3C2.44772 14 2 13.5523 2 13C2 12.4477 2.44772 12 3 12H9ZM15 8C15.5523 8 16 8.44772 16 9C16 9.55228 15.5523 10 15 10H3C2.44772 10 2 9.55228 2 9C2 8.44772 2.44772 8 3 8H15ZM15 4C15.5523 4 16 4.44772 16 5C16 5.55228 15.5523 6 15 6H3C2.44772 6 2 5.55228 2 5C2 4.44772 2.44772 4 3 4H15Z"/>\n </svg>',clearFormatting:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M10.0607 2.07533C10.8417 1.29432 12.1078 1.2943 12.8888 2.07533L16.424 5.61049C17.205 6.39154 17.205 7.65854 16.424 8.43959L9.44937 15.4142C9.07435 15.7891 8.5656 16.0001 8.03531 16.0001H5.0148C4.55074 16.0001 4.10309 15.8385 3.74722 15.547L3.60074 15.4142L1.57534 13.3888C0.79431 12.6078 0.794336 11.3417 1.57534 10.5607L10.0607 2.07533ZM2.98941 11.9747L5.0148 14.0001H8.03531L9.71792 12.3165L6.18179 8.78139L2.98941 11.9747Z"/>\n </svg>',highlight:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M16.4564 14.4272C17.1356 15.5592 16.3204 17.0002 15.0003 17.0004C13.68 17.0004 12.864 15.5593 13.5433 14.4272L15.0003 12.0004L16.4564 14.4272ZM5.1214 1.70746C5.51192 1.31693 6.14494 1.31693 6.53546 1.70746L9.7171 4.8891L13.2532 8.42426C14.2295 9.40056 14.2295 10.9841 13.2532 11.9604L9.7171 15.4955C8.74078 16.4718 7.15822 16.4718 6.18195 15.4955L2.64679 11.9604C1.67048 10.9841 1.67048 9.40057 2.64679 8.42426L6.18195 4.8891C6.30299 4.76805 6.43323 4.66177 6.57062 4.57074L5.1214 3.12152C4.73091 2.73104 4.73099 2.09799 5.1214 1.70746ZM8.30304 6.30316C8.10776 6.10815 7.79119 6.10799 7.59601 6.30316L4.06085 9.83929L3.9964 9.91742C3.88661 10.0838 3.88645 10.3019 3.9964 10.4682L4.02277 10.5004H11.8763C12.0312 10.3043 12.02 10.0205 11.8392 9.83929L8.30304 6.30316Z"/>\n </svg>',link:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.8885 7.23091L13.9479 6.17155C14.5337 5.58576 14.5337 4.63602 13.9479 4.05023C13.3621 3.46444 12.4124 3.46444 11.8266 4.05023L8.29235 7.58446C7.9263 7.95051 7.90312 8.52994 8.2233 8.92271L8.36141 9.07463C8.68158 9.4674 8.65841 10.0468 8.29235 10.4129C7.90183 10.8034 7.26866 10.8034 6.87814 10.4129C5.70657 9.24131 5.70657 7.34182 6.87814 6.17025L10.4124 2.63602C11.7792 1.26918 13.9953 1.26918 15.3621 2.63602C16.729 4.00285 16.729 6.21893 15.3621 7.58576L14.3028 8.64512C13.9122 9.03564 13.2791 9.03564 12.8885 8.64512C12.498 8.2546 12.498 7.62143 12.8885 7.23091Z"/>\n <path d="M5.11038 10.7664L4.04843 11.8284C3.46264 12.4142 3.46264 13.3639 4.04842 13.9497C4.63421 14.5355 5.58396 14.5355 6.16975 13.9497L9.70657 10.4129C10.0726 10.0468 10.0958 9.46741 9.77563 9.07464L9.63752 8.92272C9.31734 8.52995 9.34052 7.95052 9.70657 7.58446C10.0971 7.19394 10.7303 7.19394 11.1208 7.58446C12.2924 8.75604 12.2924 10.6555 11.1208 11.8271L7.58396 15.3639C6.21712 16.7308 4.00105 16.7308 2.63421 15.3639C1.26738 13.9971 1.26738 11.781 2.63421 10.4142L3.69617 9.35223C4.08669 8.96171 4.71986 8.96171 5.11038 9.35223C5.5009 9.74275 5.5009 10.3759 5.11038 10.7664Z"/>\n </svg>',quote:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M4.96387 4.23438C6.8769 4.23438 8.42767 5.78522 8.42773 7.69824C8.42773 8.32925 8.25769 8.92015 7.96289 9.42969L7.96387 9.43066L5.11816 14.3584C4.77659 14.95 4.02038 15.153 3.42871 14.8115C2.83701 14.4699 2.63397 13.7128 2.97559 13.1211L4.16113 11.0674C2.63532 10.7052 1.5 9.33485 1.5 7.69824C1.50006 5.78524 3.05086 4.2344 4.96387 4.23438ZM13.0361 4.23438C14.9491 4.23449 16.4999 5.7853 16.5 7.69824C16.5 8.32921 16.3299 8.92017 16.0352 9.42969L16.0361 9.43066L13.1904 14.3584C12.8488 14.9501 12.0917 15.1531 11.5 14.8115C10.9085 14.4698 10.7063 13.7127 11.0479 13.1211L12.2324 11.0674C10.7069 10.7049 9.57227 9.33461 9.57227 7.69824C9.57233 5.78522 11.1231 4.23438 13.0361 4.23438Z"/>\n </svg>',code:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M6.29289 3.79295C6.68342 3.40243 7.31643 3.40243 7.70696 3.79295C8.09748 4.18348 8.09748 4.81649 7.70696 5.20702L3.91399 8.99999L7.70696 12.793C8.09748 13.1835 8.09748 13.8165 7.70696 14.207C7.31643 14.597
135 6.68342 14.5975 6.29289 14.207L1.79289 9.70702C1.40237 9.31649 1.40237 8.68348 1.79289 8.29295L6.29289 3.79295Z"/>\n <path d="M11.707 3.79295C11.3164 3.40243 10.6834 3.40243 10.2929 3.79295C9.90237 4.18348 9.90237 4.81649 10.2929 5.20702L14.0859 8.99999L10.2929 12.793C9.90237 13.1835 9.90237 13.8165 10.2929 14.207C10.6834 14.5975 11.3164 14.5975 11.707 14.207L16.207 9.70702C16.5975 9.31649 16.5975 8.68348 16.207 8.29295L11.707 3.79295Z"/>\n </svg>',ul:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M3 12.5C3.82843 12.5 4.5 13.1716 4.5 14C4.5 14.8284 3.82843 15.5 3 15.5C2.17157 15.5 1.5 14.8284 1.5 14C1.5 13.1716 2.17157 12.5 3 12.5ZM15.5 13C16.0523 13 16.5 13.4477 16.5 14C16.5 14.5523 16.0523 15 15.5 15H7C6.44772 15 6 14.5523 6 14C6 13.4477 6.44772 13 7 13H15.5ZM3 7.5C3.82843 7.5 4.5 8.17157 4.5 9C4.5 9.82843 3.82843 10.5 3 10.5C2.17157 10.5 1.5 9.82843 1.5 9C1.5 8.17157 2.17157 7.5 3 7.5ZM15.5 8C16.0523 8 16.5 8.44772 16.5 9C16.5 9.55228 16.0523 10 15.5 10H7C6.44772 10 6 9.55228 6 9C6 8.44772 6.44772 8 7 8H15.5ZM3 2.5C3.82843 2.5 4.5 3.17157 4.5 4C4.5 4.82843 3.82843 5.5 3 5.5C2.17157 5.5 1.5 4.82843 1.5 4C1.5 3.17157 2.17157 2.5 3 2.5ZM15.5 3C16.0523 3 16.5 3.44772 16.5 4C16.5 4.55228 16.0523 5 15.5 5H7C6.44772 5 6 4.55228 6 4C6 3.44772 6.44772 3 7 3H15.5Z"/>\n </svg>',ol:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.5 13C16.0523 13 16.5 13.4477 16.5 14C16.5 14.5523 16.0523 15 15.5 15H7C6.44772 15 6 14.5523 6 14C6 13.4477 6.44772 13 7 13H15.5ZM15.5 8C16.0523 8 16.5 8.44772 16.5 9C16.5 9.55228 16.0523 10 15.5 10H7C6.44772 10 6 9.55228 6 9C6 8.44772 6.44772 8 7 8H15.5ZM15.5 3C16.0523 3 16.5 3.44772 16.5 4C16.5 4.55228 16.0523 5 15.5 5H7C6.44772 5 6 4.55228 6 4C6 3.44772 6.44772 3 7 3H15.5Z"/>\n <path d="M2.98657 16.0967C2.68042 16.0967 2.41187 16.0465 2.18091 15.9463C1.95174 15.846 1.77002 15.7046 1.63574 15.522C1.50146 15.3376 1.42448 15.1227 1.40479 14.8774L1.4021 14.8452H2.34204L2.34741 14.8748C2.35815 14.9589 2.39038 15.035 2.44409 15.103C2.49959 15.1711 2.5721 15.2248 2.66162 15.2642C2.75293 15.3035 2.86035 15.3232 2.98389 15.3232C3.10563 15.3232 3.21037 15.3027 3.2981 15.2615C3.38761 15.2185 3.45654 15.1603 3.50488 15.0869C3.55322 15.0135 3.57739 14.9294 3.57739 14.8345V14.8291C3.57739 14.6715 3.51921 14.5516 3.40283 14.4692C3.28646 14.3869 3.12085 14.3457 2.90601 14.3457H2.48706V13.677H2.90063C3.02775 13.677 3.13607 13.6582 3.22559 13.6206C3.31689 13.583 3.38672 13.5302 3.43506 13.4622C3.48519 13.3941 3.51025 13.3153 3.51025 13.2258V13.2205C3.51025 13.1256 3.48877 13.0441 3.4458 12.9761C3.40462 12.9062 3.34375 12.8534 3.26318 12.8176C3.18441 12.78 3.08952 12.7612 2.97852 12.7612C2.86572 12.7612 2.76636 12.7809 2.68042 12.8203C2.59627 12.8579 2.52913 12.9125 2.479 12.9841C2.43066 13.054 2.40112 13.1363 2.39038 13.2312L2.3877 13.2581H1.49341L1.49609 13.2205C1.514 12.977 1.58561 12.7666 1.71094 12.5894C1.83805 12.4103 2.00903 12.2725 2.22388 12.1758C2.44051 12.0773 2.69206 12.0281 2.97852 12.0281C3.27393 12.0281 3.52995 12.0728 3.74658 12.1624C3.96322 12.2501 4.13062 12.3727 4.24878 12.5303C4.36694 12.6878 4.42603 12.8722 4.42603 13.0835V13.0889C4.42603 13.2518 4.38932 13.3941 4.31592 13.5159C4.2443 13.6358 4.14762 13.7343 4.02588 13.8113C3.90592 13.8883 3.77254 13.942 3.62573 13.9724V13.9912C3.91756 14.0199 4.14941 14.1121 4.32129 14.2678C4.49316 14.4236 4.5791 14.6295 4.5791 14.8855V14.8909C4.5791 15.1344 4.51375 15.3474 4.38306 15.53C4.25236 15.7109 4.06795 15.8505 3.82983 15.949C3.59172 16.0474 3.31063 16.0967 2.98657 16.0967Z"/>\n <path d="M1.54443 11V10.342L2.76099 9.20874C2.95076 9.03507 3.09757 8.89274 3.20142 8.78174C3.30705 8.66895 3.37956 8.57316 3.41895 8.49438C3.46012 8.41382 3.48071 8.33415 3.48071 8.25537V8.24463C3.48071 8.14795 3.46012 8.0638 3.41895 7.99219C3.37777 7.92057 3.31779 7.86507 3.23901 7.82568C3.16024 7.7863 3.06714 7.7666 2.95972 7.7666C2.84692 7.7666 2.74756 7.78988 2.66162 7.83643C2.57747 7.88298 2.51123 7.94743 2.46289 8.02979C2.41455 8.11035 2.39038 8.20345 2.39038 8.30908V8.33057L1.48804 8.32788V8.31177C1.48804 8.05396 1.5507 7.82837 1.67603 7.63501C1.80314 7.44165 1.97949 7.29126 2.20508 7.18384C2.43245 7.07463 2.69653 7.02002 2.99731 7.02002C3.28556 7.02002 3.53711 7.06836 3.75195 7.16504C3.96859 7.25993 4.13688 7.39331 4.25684 7.56519C4.37858 7.73706 4.43945 7.93758 4.43945 8.16675V8.18018C4.43945 8.3252 4.40902 8.46932 4.34814 8.61255C4.28727 8.75578 4.18701 8.90885 4.04736 9.07178C3.90771 9.23291 3.71883 9.41642 3.48071 9.62231L2.58374 10.4092L2.85498 9.98486V10.4092L2.58374 10.2319H4.49048V11H1.54443Z"/>\n <path d="M2.84155 6V3.01367H2.79053L1.85596 3.64478V2.79614L2.84155 2.12476H3.82715V6H2.84155Z"/>\n </svg>',image:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M14 2C15.6569 2 17 3.34315 17 5V13C17 14.6569 15.6569
1316 14 16H4C2.34315 16 1 14.6569 1 13V5C1 3.34315 2.34315 2 4 2H14ZM3.06348 13.3496C3.2053 13.7294 3.57078 14 4 14H13.5859L11 11.4141L9.70703 12.707C9.31651 13.0976 8.68349 13.0976 8.29297 12.707C7.90244 12.3165 7.90244 11.6835 8.29297 11.293L8.58594 11L7 9.41406L3.06348 13.3496ZM4 4C3.44772 4 3 4.44772 3 5V10.5859L6.29297 7.29297L6.36914 7.22461C6.76191 6.90427 7.34092 6.92686 7.70703 7.29297L10 9.58594L10.293 9.29297L10.3691 9.22461C10.7619 8.90427 11.3409 8.92686 11.707 9.29297L15 12.5859V5C15 4.44772 14.5523 4 14 4H4ZM12.5 5C13.3284 5 14 5.67157 14 6.5C14 7.32843 13.3284 8 12.5 8C11.6716 8 11 7.32843 11 6.5C11 5.67157 11.6716 5 12.5 5Z"/>\n </svg>',attachment:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M13 13.5V6C13 4.067 11.433 2.5 9.5 2.5C7.567 2.5 6 4.067 6 6V13.5C6 14.6046 6.89543 15.5 8 15.5H8.23047C9.20759 15.5 10 14.7076 10 13.7305V7C10 6.72386 9.77614 6.5 9.5 6.5C9.22386 6.5 9 6.72386 9 7V12.5C9 13.0523 8.55228 13.5 8 13.5C7.44772 13.5 7 13.0523 7 12.5V7C7 5.61929 8.11929 4.5 9.5 4.5C10.8807 4.5 12 5.61929 12 7V13.7305C12 15.8122 10.3122 17.5 8.23047 17.5H8C5.79086 17.5 4 15.7091 4 13.5V6C4 2.96243 6.46243 0.5 9.5 0.5C12.5376 0.5 15 2.96243 15 6V13.5C15 14.0523 14.5523 14.5 14 14.5C13.4477 14.5 13 14.0523 13 13.5Z"/>\n </svg>',table:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M15 1C16.1046 1 17 1.89543 17 3V15C17 16.1046 16.1046 17 15 17H3C1.89543 17 1 16.1046 1 15V3C1 1.89543 1.89543 1 3 1H15ZM3 15H8V10H3V15ZM10 10V15H15V10H10ZM10 8H15V3H10V8ZM3 8H8V3H3V8Z"/>\n </svg>',hr:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.75 12C13.1642 12 13.5 12.3358 13.5 12.75V14.25C13.5 14.6642 13.1642 15 12.75 15H5.25C4.83579 15 4.5 14.6642 4.5 14.25V12.75C4.5 12.3358 4.83579 12 5.25 12H12.75ZM15.4863 8C16.0461 8 16.5 8.44771 16.5 9C16.5 9.55229 16.0461 10 15.4863 10H2.51367C1.95392 10 1.5 9.55229 1.5 9C1.5 8.44771 1.95392 8 2.51367 8H15.4863ZM12.75 3C13.1642 3 13.5 3.33579 13.5 3.75V5.25C13.5 5.66421 13.1642 6 12.75 6H5.25C4.83579 6 4.5 5.66421 4.5 5.25V3.75C4.5 3.33579 4.83579 3 5.25 3H12.75Z"/>\n </svg>',undo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M8.36612 5.36612C8.85427 4.87796 9.64554 4.87796 10.1337 5.36612C10.6218 5.85428 10.6218 6.64557 10.1337 7.13369L7.26748 9.9999H15.2499C18.1494 9.99996 20.4999 12.3504 20.4999 15.2499V19.2499C20.4999 19.9402 19.9402 20.4999 19.2499 20.4999C18.5596 20.4999 18 19.9402 17.9999 19.2499V15.2499C17.9999 13.7312 16.7686 12.5 15.2499 12.4999H7.26748L10.1337 15.3661C10.6218 15.8543 10.6218 16.6456 10.1337 17.1337C9.64557 17.6218 8.85428 17.6218 8.36612 17.1337L3.36612 12.1337C2.87796 11.6455 2.87796 10.8543 3.36612 10.3661L8.36612 5.36612Z"/>\n </svg>',redo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M15.6338 5.1163C15.1456 4.62814 14.3543 4.62814 13.8662 5.1163C13.3781 5.60446 13.3781 6.39575 13.8662 6.88388L16.7324 9.75009H8.74997C5.85052 9.75014 3.49997 12.1006 3.49997 15.0001V19.0001C3.50002 19.6904 4.05969 20.25 4.74997 20.2501C5.4403 20.2501 5.99992 19.6904 5.99997 19.0001V15.0001C5.99997 13.4813 7.23123 12.2501 8.74997 12.2501H16.7324L13.8662 15.1163C13.3781 15.6045 13.3781 16.3958 13.8662 16.8839C14.3543 17.372 15.1456 17.3719 15.6338 16.8839L20.6338 11.8839C21.1219 11.3957 21.1219 10.6045 20.6338 10.1163L15.6338 5.1163Z" />\n </svg>',overflow:'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M3 6.75C4.24264 6.75 5.25 7.75736 5.25 9C5.25 10.2426 4.24264 11.25 3 11.25C1.75736 11.25 0.75 10.2426 0.75 9C0.75 7.75736 1.75736 6.75 3 6.75ZM9 6.75C10.2426 6.75 11.25 7.75736 11.25 9C11.25 10.2426 10.2426 11.25 9 11.25C7.75736 11.25 6.75 10.2426 6.75 9C6.75 7.75736 7.75736 6.75 9 6.75ZM15 6.75C16.2426 6.75 17.25 7.75736 17.25 9C17.25 10.2426 16.2426 11.25 15 11.25C13.7574 11.25 12.75 10.2426 12.75 9C12.75 7.75736 13.7574 6.75 15 6.75Z"/>\n </svg>'};class LexicalToolbarElement extends HTMLElement{static observedAttributes=["connected"];#t=new ListenerBin;#u=null;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="toolbar",this.#d()}connectedCallback(){this.requestOverflowRefresh(),this.setAttribute("role","toolbar"),this.#h()}disconnectedCallback(){this.dispose()}dispose(){this.#t.dispose(),cancelAnimationFrame(this.#u),this.editorElement=null,this.editor=null,this.selection=null,this.#u=null,this.#d()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#g()))}configure(e){if("object"==typeof e&&null!==e)for(const[t,n]of Object.entries(e))this.setAttribute(`data-${t}`,n)}setEditor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.#p(),this.#f(),this.#m(),this.#y(),this.#b(),this.requestOverflowRefresh(),this.#$(),this.resolveEditorPromise(e),this.toggleAttribute("connected",!0)}async getEditorElement(){return this.editorElement||await this.editorPromise}requestOverflowRefresh(){null==this.#u&&(this.#u=requestAnimationFrame((()=>{this.#_(),this.#u=null})))}closeDropdowns({except:e}={}
13){this.#C.forEach((t=>{t!==e&&t.close({focusEditor:!1})}))}#g(){this.disconnectedCallback(),this.connectedCallback()}async#d(){this.editorPromise=new Promise((e=>{this.resolveEditorPromise=e})),this.editorElement=await this.editorPromise}#h(){const e=new ResizeObserver((()=>this.requestOverflowRefresh()));e.observe(this),this.#t.track((()=>e.disconnect()))}#p(){this.#t.track(registerEventListener(this,"click",this.#x))}#x=e=>{this.#S(e,"[data-command]",this.#T.bind(this))};#S(e,t,n){const r=e.target.closest(t);r&&n(e,r)}#T(e,{dataset:{command:t,payload:n}}){const r=e instanceof PointerEvent&&-1===e.pointerId;this.editor.update((()=>{this.editor.dispatchCommand(t,n)}),{tag:r?qn:void 0}),r||this.editor.focus()}#f(){this.#t.track(registerEventListener(this.editorElement,"keydown",this.#E))}#E=e=>{this.querySelectorAll("[data-hotkey]").forEach((t=>{t.dataset.hotkey.toLowerCase().split(/\s+/).includes(this.#v(e))&&(e.preventDefault(),e.stopPropagation(),t.click())}))};#v(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("+")}#$(){this.#t.track(registerEventListener(this.editorElement,"lexxy:focus",this.#w),registerEventListener(this.editorElement,"lexxy:blur",this.#k),registerEventListener(this,"keydown",this.#N))}#w=()=>{const e=this.#A.find(isActiveAndVisible);e&&(e.tabIndex=0)};#k=()=>{this.#m()};#N=e=>{handleRollingTabIndex(this.#A,e)};#m(){this.#A.forEach((e=>{e.tabIndex=-1}))}#y(){this.#t.track(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{this.#L(),this.closeDropdowns()}))})))}#b(){this.#t.track(this.editor.registerCommand(He$2,(e=>{this.#O("undo",!e)}),io),this.editor.registerCommand(qe$2,(e=>{this.#O("redo",!e)}),io))}#L(){const e=Qr();if(!Fr(e))return;if(!e.anchor.getNode().getParent())return;const{isBold:t,isItalic:n,isStrikethrough:r,isUnderline:i,isHighlight:o,isInLink:s,isInQuote:l,isInHeading:a,headingTag:c,isInCode:u,isInList:d,listType:h,isInTable:g}=this.selection.getFormat();this.#I("bold",t),this.#I("italic",n),this.#I("strikethrough",r),this.#I("underline",i),this.#I("format",a),this.#I("paragraph",!a),this.querySelector("lexxy-heading-dropdown")?.updateActiveHeading(c),this.#I("lists",d),this.#I("unordered-list",d&&"bullet"===h),this.#I("ordered-list",d&&"number"===h),this.#I("highlight",o),this.#I("link",s),this.#I("quote",l),this.#I("code",u),this.#I("table",g)}#I(e,t){const n=this.querySelector(`[name="${e}"]`);if(n){const e=t.toString();n.getAttribute("aria-pressed")!==e&&n.setAttribute("aria-pressed",e)}}#O(e,t){const n=this.querySelector(`[name="${e}"]`);if(n){n.disabled!==t&&(n.disabled=t);const e=t.toString();n.getAttribute("aria-disabled")!==e&&n.setAttribute("aria-disabled",e)}}#_(){this.#F(),this.#P(),this.#R(),this.#M();const e=this.#D.children.length>0;this.toggleAttribute("overflowing",e),this.#B(),this.#H(e)}#P(){const e=Array.from(this.#D.children);e.sort(((e,t)=>this.#z(t)-this.#z(e)));
13for(const t of e){const e=this.querySelector(`[data-position="${this.#z(t)+1}"]`)??this.#W;t.removeAttribute("role"),this.insertBefore(t,e)}}#H(e=!0){this.#D.toggleAttribute("disabled",!e),this.#W.style.display=e?"block":"none"}#F(){this.#H(!1)}#z(e){return parseInt(e.dataset.position??"999")}#R(){this.#U.forEach(((e,t)=>{e.dataset.position=t}))}#M(){const e=this.#K();if(e>0){this.#H();const t=this.#V(),n=t+this.#W.offsetWidth;this.#q(e+n,{gap:t})}}#K(){return this.scrollWidth-this.clientWidth}#q(e,{gap:t}){const n=this.#G,r=[];let i=0;for(;i<e&&n.length;){const e=n.pop();r.push(e),e.role="menuitem",i+=e.offsetWidth+t}this.#D.append(...r.reverse())}#B(){this.#W.setAttribute("nonce",getNonce())}#V(){return parseFloat(window.getComputedStyle(this).columnGap)||0}get#C(){return this.querySelectorAll(":scope .lexxy-editor__toolbar-dropdown")}get#W(){return this.querySelector(".lexxy-editor__toolbar-overflow")}get#D(){return this.#W?.querySelector(":scope > [data-dropdown-panel]")}get#G(){return Array.from(this.querySelectorAll(":scope > button:not([data-prevent-overflow])"))}get#A(){return Array.from(this.querySelectorAll(":scope button"))}get#U(){return Array.from(this.querySelectorAll(":scope > *:not(.lexxy-editor__toolbar-overflow)"))}static get defaultTemplate(){const e=generateDomId("lexxy-link-url");return`\n <button class="lexxy-editor__toolbar-button" type="button" name="image" data-command="uploadImage" data-prevent-overflow="true" title="Add images and video">\n ${ToolbarIcons.image}\n </button>\n\n <button class="lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end" type="button" name="file" data-command="uploadFile" title="Upload files">\n ${ToolbarIcons.attachment}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="bold" data-command="bold" title="Bold">\n ${ToolbarIcons.bold}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="italic" data-command="italic" title="Italic">\n ${ToolbarIcons.italic}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="strikethrough" data-command="strikethrough" title="Strikethrough">\n ${ToolbarIcons.strikethrough}\n </button>\n\n <button class="lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end" type="button" name="underline" data-command="underline" title="Underline">\n ${ToolbarIcons.underline}\n </button>\n\n <lexxy-toolbar-dropdown class="lexxy-editor__toolbar-dropdown">\n <button data-dropdown-trigger class="lexxy-editor__toolbar-button lexxy-editor__toolbar-button--chevron" type="button" name="format" title="Text formatting" aria-haspopup="menu" aria-expanded="false">\n ${ToolbarIcons.heading}\n </button>\n <div data-dropdown-panel role="menu" class="lexxy-editor__toolbar-dropdown-list" hidden>\n <button type="button" name="paragraph" data-command="setFormatParagraph" title="Paragraph" role="menuitem">\n ${ToolbarIcons.paragraph} <span>Normal</span>\n </button>\n <lexxy-heading-dropdown>\n <div class="lexxy-heading-options"></div>\n </lexxy-heading-dropdown>\n <div class="lexxy-editor__toolbar-separator" role="separator"></div>\n <button type="button" name="clear-formatting" data-command="clearFormatting" title="Clear formatting" role="menuitem">\n ${ToolbarIcons.clearFormatting} <span>Clear formatting</span>\n </button>\n </div>\n </lexxy-toolbar-dropdown>\n\n <lexxy-highlight-dropdown class="lexxy-editor__toolbar-dropdown lexxy-editor__toolbar-dropdown--highlight">\n <button data-dropdown-trigger class="lexxy-editor__toolbar-button lexxy-editor__toolbar-button--chevron" type="button" name="highlight" title="Color highlight" aria-haspopup="menu" aria-expanded="false">\n ${ToolbarIcons.highlight}\n </button>\n <div data-dropdown-panel role="menu" hidden>\n <div class="lexxy-highlight-colors"></div>\n <button data-command="removeHighlight" type="button" class="lexxy-editor__toolbar-button lexxy-editor__toolbar-dropdown-reset" role="menuitem">
13Remove all coloring</button>\n </div>\n </lexxy-highlight-dropdown>\n\n <lexxy-link-dropdown class="lexxy-editor__toolbar-dropdown lexxy-editor__toolbar-dropdown--link">\n <button data-dropdown-trigger class="lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end" type="button" name="link" title="Link" data-hotkey="cmd+k ctrl+k" aria-haspopup="dialog" aria-expanded="false">\n ${ToolbarIcons.link}\n </button>\n <div data-dropdown-panel role="dialog" aria-label="Link" hidden>\n <input type="url" placeholder="Enter a URL\u2026" class="input" id="${e}">\n <div class="lexxy-editor__toolbar-dropdown-actions">\n <button type="button" class="lexxy-editor__toolbar-button" value="link">Link</button>\n <button type="button" class="lexxy-editor__toolbar-button" value="unlink">Unlink</button>\n </div>\n </div>\n </lexxy-link-dropdown>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="quote" data-command="insertQuoteBlock" title="Quote">\n ${ToolbarIcons.quote}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="code" data-command="insertCodeBlock" title="Code">\n ${ToolbarIcons.code}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="unordered-list" data-command="insertUnorderedList" title="Bullet list">\n ${ToolbarIcons.ul}\n </button>\n <button class="lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end" type="button" name="ordered-list" data-command="insertOrderedList" title="Numbered list">\n ${ToolbarIcons.ol}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="table" data-command="insertTable" title="Insert a table">\n ${ToolbarIcons.table}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="divider" data-command="insertHorizontalDivider" title="Insert a divider">\n ${ToolbarIcons.hr}\n </button>\n\n <button class="lexxy-editor__toolbar-button lexxy-editor__toolbar-button--push-right" type="button" name="undo" data-command="undo" title="Undo" disabled aria-disabled="true">\n ${ToolbarIcons.undo}\n </button>\n\n <button class="lexxy-editor__toolbar-button" type="button" name="redo" data-command="redo" title="Redo" disabled aria-disabled="true">\n ${ToolbarIcons.redo}\n </button>\n\n <lexxy-toolbar-dropdown class="lexxy-editor__toolbar-dropdown lexxy-editor__toolbar-button--push-right lexxy-editor__toolbar-overflow">\n <button data-dropdown-trigger class="lexxy-editor__toolbar-button" type="button" aria-haspopup="menu" aria-expanded="false" aria-label="Show more toolbar buttons">\n ${ToolbarIcons.overflow}\n </button>\n <div data-dropdown-panel role="menu" class="lexxy-editor__toolbar-overflow-menu" aria-label="More toolbar buttons" hidden></div>\n </lexxy-toolbar-dropdown>\n `}}class ToolbarDropdown extends HTMLElement{#t=new ListenerBin;connectedCallback(){this.#j((()=>{this.#Z(),this.editorReady()}))}disconnectedCallback(){this.#t.dispose()}editorReady(){}onOpen(){}onClose(){}get trigger(){return this.querySelector(":scope > [data-dropdown-trigger]")}get panel(){return this.querySelector(":scope > [data-dropdown-panel]")}get toolbar(){return this.closest("lexxy-toolbar")}get editorElement(){return this.toolbar?.editorElement}get editor(){return this.toolbar?.editor}get isOpen(){return!1===this.panel.hidden}get isClosed(){return!this.isOpen}track(...e){this.#t.track(...e)}open(){this.isOpen||(this.trigger.setAttribute("aria-expanded","true"),this.panel.hidden=!1,this.onOpen(),this.#Q())}close({focusEditor:e=!0}={}){e&&this.editor?.focus(),this.isClosed||(this.trigger.setAttribute("aria-expanded","false"),this.panel.hidden=!0,this.onClose())}#Z(){this.#t.track(registerEventListener(this,"keydown",this.#Y),registerEventListener(this.trigger,"click",this.#J))}#J=()=>{this.isOpen?this.close({focusEditor:!1}):(this.toolbar?.closeDropdowns({except:this}),this.open())};async#j(e){this.toolbar&&(await this.toolbar.getEditorElement(),this.isConnected&&this.toolbar&&e())}#Y=e=>{"Escape"===e.key&&(e.stopPropagation(),this.close())};
13async#Q(){this.#X[0]?.focus(),await this.#m()}async#m(){await nextFrame(),this.#A.forEach(((e,t)=>{e.setAttribute("tabindex",0===t?0:"-1")}))}get#X(){return Array.from(this.panel.querySelectorAll("button, input"))}get#A(){return Array.from(this.panel.querySelectorAll("button"))}}const HEADING_BUTTON_SELECTOR="button.lexxy-heading-button",HEADING_PRESETS=[{label:"Large Heading",name:"heading-large",command:"setFormatHeadingLarge"},{label:"Medium Heading",name:"heading-medium", 14command:"setFormatHeadingMedium"},{label:"Small Heading",name:"heading-small",command:"setFormatHeadingSmall"}];class HeadingDropdown extends HTMLElement{static labelFor(e,t){if(t<HEADING_PRESETS.length)return HEADING_PRESETS[t].label;{const t=e.match(/^h(\d+)$/)?.[1];return t?`Heading ${t}`:e.toUpperCase()}}static nameFor(e,t){if(t<HEADING_PRESETS.length)return HEADING_PRESETS[t].name;{const t=e.match(/^h(\d+)$/)?.[1];return t?`heading-${t}`:`heading-${e}`}}static commandFor(e){return e<HEADING_PRESETS.length?HEADING_PRESETS[e].command:"applyHeadingFormat"}#t=new ListenerBin;connectedCallback(){this.style.display="contents",this.#j((()=>{this.#ee.style.display="contents",this.#te(),this.#ne(),this.#re()}))}disconnectedCallback(){this.#t.dispose()}updateActiveHeading(e){this.#ie.forEach((t=>{const n=(t.dataset.heading===e).toString();t.getAttribute("aria-pressed")!==n&&t.setAttribute("aria-pressed",n)}))}get#oe(){return this.closest("lexxy-toolbar")}get#se(){return this.#oe?.editorElement}get#le(){return this.#oe?.editor}async#j(e){const t=this.#oe;t&&(await t.getEditorElement(),this.isConnected&&this.#oe&&e())}#te(){this.#ee.innerHTML="",this.#ae.forEach(((e,t)=>{this.#ee.appendChild(this.#ce(e,t))}))}#ce(e,t){const n=HeadingDropdown.labelFor(e,t),r=HeadingDropdown.nameFor(e,t),i=ToolbarIcons[e]||"",o=document.createElement("button");return o.type="button",o.dataset.heading=e,o.dataset.command=HeadingDropdown.commandFor(t),o.classList.add("lexxy-heading-button"),o.name=r,o.title=n,o.setAttribute("role","menuitem"),o.innerHTML=`${i} <span>${n}</span>`,o}#ne(){this.#ie.forEach((e=>{this.#t.track(registerEventListener(e,"click",(t=>{this.#le&&(t.preventDefault(),this.#le.dispatchCommand(e.dataset.command,e.dataset.heading),this.#le.focus())})))}))}#re(){const{headingTag:e}=this.#le.read((()=>this.#se.selection.getFormat()));this.updateActiveHeading(e??null)}get#ae(){return this.#se.config.get("headings")}get#ee(){return this.querySelector(".lexxy-heading-options")}get#ie(){return Array.from(this.querySelectorAll(HEADING_BUTTON_SELECTOR))}}const APPLY_HIGHLIGHT_SELECTOR="button.lexxy-highlight-button",REMOVE_HIGHLIGHT_SELECTOR="[data-command='removeHighlight']",NO_STYLE=Symbol("no_style");class HighlightDropdown extends ToolbarDropdown{editorReady(){this.#te(),this.#ne()}onOpen(){this.editor.getEditorState().read((()=>{this.#ue(Qr())}))}#ne(){this.#de.forEach((e=>{this.track(registerEventListener(e,"click",this.#he))}))}#te(){this.#ee.innerHTML="";const e=this.editorElement.config.get("highlight.buttons");this.#ge("color",e.color),this.#ge("background-color",e["background-color"]);const t=Math.max(e.color.length,e["background-color"].length);this.panel.style.setProperty("--max-colors",t)}#ge(e,t){t.forEach(((t,n)=>{this.#ee.appendChild(this.#ce(e,t,n))}))}#ce(e,t,n){return createElement("button",{type:"button",dataset:{value:t,style:e},style:`${e}: ${t}`,class:"lexxy-editor__toolbar-button lexxy-highlight-button",name:`${e}-${n}`,role:"menuitem"})}#he=e=>{e.preventDefault();const t=e.target.closest(APPLY_HIGHLIGHT_SELECTOR);if(!t)return;const{style:n,value:r}=t.dataset;this.editor.dispatchCommand("toggleHighlight",{[n]:r}),this.close()};#ue(e){if(!Fr(e))return;const t=ne$4(e,"color",NO_STYLE),n=ne$4(e,"background-color",NO_STYLE);this.#de.forEach((e=>{const r=(e.dataset.value===t||e.dataset.value===n).toString();e.getAttribute("aria-pressed")!==r&&e.setAttribute("aria-pressed",r)}));const r=t!==NO_STYLE||n!==NO_STYLE;this.panel.querySelector(REMOVE_HIGHLIGHT_SELECTOR).disabled=!r}get#ee(){return this.panel.querySelector(".lexxy-highlight-colors")}get#de(){return Array.from(this.panel.querySelectorAll(APPLY_HIGHLIGHT_SELECTOR))}}const I$5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,O$2=I$5&&"documentMode"in document?document.documentMode:null,D$2=I$5&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);I$5&&"InputEvent"in window&&!O$2&&new window.InputEvent("input");const lt$2=D$2,Q$7=Symbol.for("preact-signals");let tt$3,et$1,it$1,ot$2=0,st$1=0,rt$3=0,ct$1=0,at$2=0;ut$2.prototype.brand=Q$7,ut$2.prototype.h=function(){return!0},ut$2.prototype.S=function(e){const t=this.t;t!==e&&void 0===e.e&&(e.x=t,this.t=e,void 0!==t?t.e=e:nt$3((()=>{var e;null==(e=this.W)||e.call(this)})))},ut$2.prototype.U=function(e){if(void 0!==this.t){const t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n,void 0===n&&nt$3((()=>{var e;null==(e=this.Z)||e.call(this)})))}},ut$2.prototype.subscribe=function(e){return St$2((()=>
14{const t=this.value,n=tt$3;tt$3=void 0;try{e(t)}finally{tt$3=n}}),{name:"sub"})},ut$2.prototype.valueOf=function(){return this.value},ut$2.prototype.toString=function(){return this.value+""},ut$2.prototype.toJSON=function(){return this.value},ut$2.prototype.peek=function(){const e=tt$3;tt$3=void 0;try{return this.value}finally{tt$3=e}},Object.defineProperty(ut$2.prototype,"value",{get(){const e=dt$2(this);return void 0!==e&&(e.i=this.i),this.v},set(e){if(e!==this.v){if(st$1>100)throw new Error("Cycle detected");!function(e){0!==ot$2&&0===st$1&&e.l!==ct$1&&(e.l=ct$1,it$1={S:e,v:e.v,i:e.i,o:it$1})}(this),this.v=e,this.i++,at$2++,ot$2++;try{for(let e=this.t;void 0!==e;e=e.x)e.t.N()}finally{X$5()}}}}),pt$1.prototype=new ut$2,pt$1.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===at$2)return!0;if(this.g=at$2,this.f|=1,this.i>0&&!lt$1(this))return this.f&=-2,!0;const e=tt$3;try{ht$2(this),tt$3=this;const e=this.x();(16&this.f||this.v!==e||0===this.i)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return tt$3=e,gt$2(this),this.f&=-2,!0},pt$1.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(let e=this.s;void 0!==e;e=e.n)e.S.S(e)}ut$2.prototype.S.call(this,e)},pt$1.prototype.U=function(e){if(void 0!==this.t&&(ut$2.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(let e=this.s;void 0!==e;e=e.n)e.S.U(e)}},pt$1.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let e=this.t;void 0!==e;e=e.x)e.t.N()}}
14,Object.defineProperty(pt$1.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const e=dt$2(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Et$2.prototype.c=function(){const e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const e=this.x();"function"==typeof e&&(this.m=e)}finally{e()}},Et$2.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,vt$1(this),ht$2(this),ot$2++;const e=tt$3;return tt$3=this,yt$4.bind(this,e)},Et$2.prototype.N=function(){2&this.f||(this.f|=2,this.u=et$1,et$1=this)},Et$2.prototype.d=function(){this.f|=8,1&this.f||xt$2(this)},Et$2.prototype.dispose=function(){this.d()},ot$3("format",{parse:e=>"number"==typeof e?e:0});const Ut$2=0,Tt$3=1,Bt$2=2,Wt$3=3,Gt$2=4,Vt$2=5,Zt$2=6,Jt$3=7,Xt$3=new Set;let Yt$2=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Ut$2}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):pc;for(const n of this.configs)e=t(e,n);return e}init(e){const t=this.state;qt$3(t)||zt$3(306,String(t.id));const n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:Wt$3,registerState:n})}(t,this.mergeConfigs(),n);let o;this.state=i,this.extension.init&&(o=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:Gt$2,initResult:t,registerState:n})}(i,o,r)}build(e){const t=this.state;let n;t.id!==Gt$2&&zt$3(307,String(t.id),String(Vt$2)),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));const r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:Vt$2,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;const n=this.state;n.id!==Vt$2&&zt$3(308,String(n.id),String(Vt$2));const r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:Zt$2})}(n),()=>{const e=this.state;e.id!==Jt$3&&zt$3(309,String(n.id),String(Jt$3)),this.state=function(e){return Object.assign(e,{id:Vt$2})}(e),r&&r()}}afterRegistration(e){const t=this.state;let n;return t.id!==Zt$2&&zt$3(310,String(t.id),String(Zt$2)),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:Jt$3})}(t),n}getSignal(){return void 0===this._signal&&zt$3(311),this._signal}getInitResult(){void 0===this.extension.init&&zt$3(312,this.extension.name);const e=this.state;return function(e){return e.id>=Gt$2}(e)||zt$3(313,String(e.id),String(Gt$2)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return function(e){return e.id>=Wt$3}(e)||zt$3(314,String(e.id),String(Wt$3)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&zt$3(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return void 0===t&&zt$3(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return function(e){return e.id>=Jt$3}(e)||zt$3(316,String(e.id),String(Jt$3)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Xt$3}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map((([e])=>e))),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(e){return e.id>=Vt$2})(e)||zt$3(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const te$3={tag:Jn},ne$3=dc({config:_c({setOptions:te$3,updateOptions:te$3}),init:({$initialEditorState:e=ee$2})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:r}=i;if(Gi(r))e.setEditorState(r,n);else if("function"==typeof r)e.update((()=>{r(e)}),t);else if(r&&("string"==typeof r||"object"==typeof r)){const t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[Ui,gr,rr,br,Zi]}),ie$3=Symbol.for("@lexical/extension/LexicalBuilder"),ae$3="0.44.0+prod.esm";let de$3=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=ae$3,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(t){const n=[ce$3(ne$3)];for(const e of t)n.push(ce$3(e));return new e(n)}static maybeFromEditor(t){const n=t[ie$3];
14return n&&(n.PACKAGE_VERSION!==ae$3&&zt$3(292,n.PACKAGE_VERSION,ae$3),n instanceof e||zt$3(293)),n}static fromEditor(t){const n=e.maybeFromEditor(t);return void 0===n&&zt$3(294),n}constructEditor(){const{$initialEditorState:e,onError:t,...n}=this.buildCreateEditorArgs(),r=Object.assign(yo({...n,...t?{onError:e=>{t(e,r)}}:{}}),{[ie$3]:this});for(const e of this.sortedExtensionReps())e.build(r);return r}buildEditor(){function e(){try{t()}finally{t=se$4}}let t=se$4;const n=Object.assign(this.constructEditor(),{dispose:e,[Symbol.dispose]:e});return t=Cc(this.registerEditor(n),(()=>n.setRootElement(null))),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&zt$3(295,e.name),t}addEdge(e,t,n){const r=this.outgoingConfigEdges.get(e);r?r.set(t,n):this.outgoingConfigEdges.set(e,new Map([[t,n]]));const i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){void 0!==this._sortedExtensionReps&&zt$3(296);const t=ce$3(e),[n]=t;"string"!=typeof n.name&&zt$3(297,typeof n.name);let r=this.extensionNameMap.get(n.name);if(void 0!==r&&r.extension!==n&&zt$3(298,n.name),!r){r=new Yt$2(this,n),this.extensionNameMap.set(n.name,r);const e=this.conflicts.get(n.name);"string"==typeof e&&zt$3(299,n.name,e);for(const e of n.conflictsWith||[])this.extensionNameMap.has(e)&&zt$3(299,n.name,e),this.conflicts.set(e,n.name);for(const e of n.dependencies||[]){const t=ce$3(e);this.addEdge(n.name,t[0].name,t.slice(1)),this.addExtension(t)}for(const[e,t]of n.peerDependencies||[])this.addEdge(n.name,e,t?[t]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(n,r)=>{let i=n.state;if(qt$3(i))return;const o=n.extension.name;var s;Ht$2(i)||zt$3(300,o,r||"[unknown]"),Ht$2(s=i)||zt$3(304,String(s.id),String(Ut$2)),i=Object.assign(s,{id:Tt$3}),n.state=i;const l=this.outgoingConfigEdges.get(o);if(l)for(const e of l.keys()){const n=this.extensionNameMap.get(e);n&&t(n,o)}i=Qt$2(i),n.state=i,e.push(n)};for(const e of this.extensionNameMap.values())Ht$2(e.state)&&t(e);for(const t of e)for(const[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){const t=this.extensionNameMap.get(e);if(t)for(const e of n)t.configs.add(e)}for(const[e,...t]of this.roots)if(t.length>0){const n=this.extensionNameMap.get(e.name);void 0===n&&zt$3(301,e.name);for(const e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(const n of t){const t=n.register(e,i);t&&r.push(t)}for(const n of t){const t=n.afterRegistration(e);t&&r.push(t)}return Cc(...r)}buildCreateEditorArgs(){const e={},t=new Set,n=new Map,r=new Map,i={},o={},s=this.sortedExtensionReps();for(const l of s){const{extension:s}=l;if(void 0!==s.onError&&(e.onError=s.onError),void 0!==s.disableEvents&&(e.disableEvents=s.disableEvents),void 0!==s.parentEditor&&(e.parentEditor=s.parentEditor),void 0!==s.editable&&(e.editable=s.editable),void 0!==s.namespace&&(e.namespace=s.namespace),void 0!==s.$initialEditorState&&(e.$initialEditorState=s.$initialEditorState),s.nodes)for(const e of Dt$3(s)){if("function"!=typeof e){const t=n.get(e.replace);t&&zt$3(302,s.name,e.replace.name,t.extension.name),n.set(e.replace,l)}t.add(e)}if(s.html){if(s.html.export)for(const[e,t]of s.html.export.entries())r.set(e,t);s.html.import&&Object.assign(i,s.html.import)}s.theme&&Lt$3(o,s.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const l=Object.keys(i).length>0,a=r.size>0;(l||a)&&(e.html={},l&&(e.html.import=i),a&&(e.html.export=r));for(const t of s)t.init(e);return e.onError||(e.onError=re$4),e}};const M$3=new Set(["http:","https:","mailto:","sms:","tel:"]);let F$4=class e extends Bi{__url;__target;__rel;__title;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:o=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=o}afterCloneFrom(e){super.afterCloneFrom(e),this.__url=e.__url,this.__rel=e.__rel,this.__target=e.__target,this.__title=e.__title}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),mc(t,e.theme.link),t}updateLinkDOM(e,t,n){if(Vs(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:()=>({conversion:K$3,priority:1})}}static importJSON(e){return $$2().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=X$4(e);try{const t=new URL(X$4(e));if(!M$3.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=Ks(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Fr(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://")}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.__url===e.__url&&this.__target===e.__target&&this.__rel===e.__rel&&this.__title===e.__title}},j$5=class e extends F$4{__isUnlinked;constructor(e="",t={},n){super(e,t,n),this.__isUnlinked=void 0!==t.isUnlinked&&null!==t.isUnlinked&&t.isUnlinked}afterCloneFrom(e){super.afterCloneFrom(e),this.__isUnlinked=e.__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)}shouldMergeAdjacentLink(e){return!1}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 H$5().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=H$5(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}};const V$6=/^\+?[0-9\s()-]{5,}$/;class LinkDropdown extends ToolbarDropdown{editorReady(){this.input=this.panel.querySelector("input"),this.track(registerEventListener(this.input,"keydown",this.#pe),registerEventListener(this.linkButton,"click",this.#fe),registerEventListener(this.unlinkButton,"click",this.#me))}onOpen(){this.input.value=this.#ye,this.input.required=!0}onClose(){this.input.required=!1}get linkButton(){return this.panel.querySelector("[value='link']")}get unlinkButton(){return this.panel.querySelector("[value='unlink']")}#pe=e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),this.#fe(e))};#fe=()=>{this.input.checkValidity()?(this.editor.dispatchCommand("link",this.input.value),this.close()):this.input.reportValidity()};#me=()=>{this.editor.dispatchCommand("unlink"),this.close()};get#ye(){return this.editor.getEditorState().read((()=>{const e=this.editorElement.selection.nearestNodeOfType(F$4);return e?.getURL()??""}))}}let ge$2=class extends Bi{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const t=e.getParent();if(Se$1(t))"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(t){const n=e.createParentElementNode();Se$1(n)||q$5(340);const r=[e];for(const t of["previous","next"]){r.reverse();for(const{origin:n}
14of Ol(e,t)){if(!pe$2(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),Is(t)||(Rt$3(n,Zl(Ol(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:Bi,importDOM:In({li:()=>({conversion:he$2,priority:0})})})}constructor(e=1,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t,n){const r=t.getParent();!Se$1(r)||"check"!==r.getListType()||Se$1(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}(t,this,e),t.value=this.__value,function(e,t,n){const r=[],i=[],o=t.list,s=o?o.listitem:void 0;let l;if(o&&o.nested&&(l=o.nested.listitem),void 0!==s&&r.push(...yc(s)),o){const e=n.getParent(),t=Se$1(e)&&"check"===e.getListType(),s=n.getChecked();t&&!s||i.push(o.listitemUnchecked),t&&s||i.push(o.listitemChecked),t&&r.push(s?o.listitemChecked:o.listitemUnchecked)}if(void 0!==l){const e=yc(l);n.getChildren().some((e=>Se$1(e)))?r.push(...e):i.push(...e)}i.length>0&&xc(e,...i),r.length>0&&mc(e,...r)}(t,n.theme,this);const r=e?e.__style:"",i=this.__style;r!==i&&nr(t.style,i,r),function(e,t,n){const r=t.__textStyle,i=n?n.__textStyle:"";if(null!==n&&i===r)return;const o=Zn(r);for(const t in o)e.style.setProperty(`--listitem-marker-${t}`,o[t]);if(""!==i)for(const t in Zn(i))t in o||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);const r=this.getDirection();return r&&(t.dir=r),Z$3(this)?{after(e){if(Ys(e)){const t=e.previousElementSibling;if(Ys(t)&&"LI"===t.nodeName){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(Wi(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(pe$2(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!Se$1(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=Ks(n);let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}
14return t&&(Wi(e)||q$5(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(Se$1(n)||q$5(39),pe$2(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=Ks(n);r.forEach((e=>i.append(e))),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&Z$3(t)&&Z$3(n)&&(se$3(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const n=Ks(this);return this.insertAfter(n,t),n}collapseAtStart(e){const t=eo();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=pe$2(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,o=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(o,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(o,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return Se$1(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;pe$2(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&q$5(117),(e=Math.floor(e))>=0||q$5(199);let t=this.getIndent();for(;t!==e;)t<e?(ce$2(this),t++):(ae$2(this),t--);return this}canInsertAfter(e){return pe$2(e)}canReplaceWith(e){return pe$2(e)}canMergeWith(e){return pe$2(e)||no(e)}extractWithChild(e,t){if(!Fr(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Te$1("bullet")}canMergeWhenEmpty(){return!0}},me$2=class extends Bi{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();Se$1(t)&&e.getListType()===t.getListType()&&se$3(e,t)}(e),le$2(e)},extends:Bi,importDOM:In({ol:()=>({conversion:ye$1,priority:0}),ul:()=>({conversion:ye$1,priority:0})})})}constructor(e="number",t=1,n){super(n);const r=ve$1[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,_e$1(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(_e$1(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Ys(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){const r=n.find(pe$2)??this.getChildren().find(pe$2),i=r?()=>Ks(r):fe$2;let o=n;for(let e=0;e<n.length;e++){const t=n[e];pe$2(t)||(o===n&&(o=[...n]),o[e]=i().append(!Wi(t)||Se$1(t)||t.isInline()?t:kr(t.getTextContent())))}return super.splice(e,t,o)}extractWithChild(e){return pe$2(e)}};const ve$1={ol:"number",ul:"bullet"},Fe$1=re$5("UPDATE_LIST_START_COMMAND"),Ee$2=re$5("INSERT_UNORDERED_LIST_COMMAND"),Oe$1=re$5("INSERT_ORDERED_LIST_COMMAND"),Ae$2=re$5("REMOVE_LIST_COMMAND");let C$3;const L$4="@lexical/html/DOM",F$3=Symbol.for("@lexical/html/DOMExportContext"),I$4=()=>!0,tt$2=dc({build:(e,t)=>({defaults:P$2(t.contextDefaults,void 0)}),config:{contextDefaults:[],overrides:[]},html:{export:new Map([[Ui,()=>{const e=document.createElement("div");return e.role="textbox",{element:e}}]])},init(e,t){e.dom=function(e,{overrides:t}){const n=X$3(e,t),r={...po,...e.dom};return J$5(n,"$createDOM",r,H$4,q$4),J$5(n,"$exportDOM",r,H$4,q$4),J$5(n,"$extractWithChild",r,z$4,V$5),J$5(n,"$getDOMSlot",r,Y$1,B$4),J$5(n,"$shouldExclude",r,Y$1,B$4),J$5(n,"$shouldInclude",r,Y$1,B$4),J$5(n,"$updateDOM",r,_$2,U$4),J$5(n,"$decorateDOM",r,G$6,Z$2),r}(e,t)},mergeConfig(e,t){const n=pc(e,t);for(const r of["overrides","contextDefaults"])t[r]&&(n[r]=[...e[r],...t[r]]);return n},name:L$4});nt$2("root",Boolean);const ot$1=nt$2("isExport",Boolean),ut$1=function(e,t=()=>{}){return(n,r=Zs())=>i=>{const o=E$2(r),s=o&&o[e],l=P$2(n,s||t(r));return l&&l!==s?function(e,t,n,r=Zs()){const i=C$3,o=E$2(r);try{return C$3={...o,editor:r,[e]:t},n()}finally{C$3=i}}(e,l,i,r):i()}}(F$3,rt$2),ft=new Set(["STYLE","SCRIPT"]),k$2="application/x-lexical-drag";let Q$3=null;const tt$1=[["text/html",J$4],["application/x-lexical-editor",L$3]],rt$1={"application/x-lexical-editor":[(e,t)=>e?L$3(Zs(),e):t()],"text/html":[(e,t)=>e?J$4(Zs(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]},it=dc({build:(e,t)=>t.$exportMimeType,config:_c({$exportMimeType:rt$1}),mergeConfig(e,t){const n=pc(e,t);if(t.$exportMimeType){const r={...e.$exportMimeType};for(const[e,n]of Object.entries(t.$exportMimeType))r[e]=[...r[e],...n];n.$exportMimeType=r}return n},name:"@lexical/clipboard/GetClipboardData"}),d=dc({build:(e,t)=>bt$2(t),config:_c({disabled:"undefined"==typeof window}),name:"@lexical/dragon",register:(e,t,n)=>St$2((()=>n.getOutput().disabled.value?void 0:s(e)))}),W$2="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,B$2=W$2&&"documentMode"in document?document.documentMode:null,I$2=W$2&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),R$1=!(!W$2||!("InputEvent"in window)||B$2)&&"getTargetRanges"in new window.InputEvent("input"),V$3=W$2&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,j$2=W$2&&/Android/.test(navigator.userAgent),q$2=W$2&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!j$2,z$2=W$2&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F$2=W$2&&/AppleWeb
14Kit\/[\d.]+/.test(navigator.userAgent)&&I$2&&!z$2,xt$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Dt$2=xt$1&&"documentMode"in document?document.documentMode:null,_t$1=xt$1&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Nt$1=!(!xt$1||!("InputEvent"in window)||Dt$2)&&"getTargetRanges"in new window.InputEvent("input"),wt$1=xt$1&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Tt$2=xt$1&&/Android/.test(navigator.userAgent),Et$1=xt$1&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent)&&!Tt$2,Ft$2=xt$1&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Ot$2=xt$1&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&_t$1&&!Ft$2,Pt$2=re$5("DRAG_DROP_PASTE_FILE");let At$1=class e extends Bi{static getType(){return"quote"}static clone(t){return new e(t.__key)}createDOM(e){const t=document.createElement("blockquote");return mc(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:()=>({conversion:kt$2,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ys(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return St$1().updateFromJSON(e)}insertNewAfter(e,t){const n=eo(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=eo();
14return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}},It$1=class e extends Bi{__tag;static getType(){return"heading"}static clone(t){return new e(t.__tag,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__tag=e.__tag}constructor(e="h1",t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){const t=this.getWritable();return t.__tag=e,t}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){mc(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:()=>({conversion:Kt$2,priority:0}),h2:()=>({conversion:Kt$2,priority:0}),h3:()=>({conversion:Kt$2,priority:0}),h4:()=>({conversion:Kt$2,priority:0}),h5:()=>({conversion:Kt$2,priority:0}),h6:()=>({conversion:Kt$2,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&bt$1(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>bt$1(e)?{conversion:()=>({node:Jt$2("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ys(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();e&&(t.style.textAlign=e);const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Jt$2(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){ 15const n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?eo():Jt$2(this.getTag()),o=this.getDirection();if(i.setDirection(o),this.insertAfter(i,t),0===n&&!this.isEmpty()&&e){const e=eo();e.select(),this.replace(e,!0)}return i}collapseAtStart(){const e=this.isEmpty()?eo():Jt$2(this.getTag());
15return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}};const Xt$2=dc({conflictsWith:["@lexical/plain-text"],dependencies:[d],name:"@lexical/rich-text",nodes:()=>[It$1,At$1],register:zt$2});class EditorSanitizer{static#be=new WeakMap;static#$e;static#_e(){return this.#$e||=new EditorSanitizer}static register(e,t=[]){const n=new EditorSanitizer(this.#Ce(e,t));return this.#be.set(e,n),n}static for(e){return this.#be.get(e)??this.#_e()}static#Ce(e,t){return this.#xe(e).concat(t)}static#xe(e){return Array.from(e._htmlConversions.keys()).filter((e=>!e.startsWith("#")))}#Se;constructor(e=null){this.#Se=buildConfig(e)}sanitize(e,{safeForXml:t=!1}={}){return t?DOMPurify.sanitize(e,{...this.#Se,SAFE_FOR_XML:!0}):DOMPurify.sanitize(e,this.#Se)}}class CustomActionTextAttachmentNode extends Ji{static getType(){return"custom_action_text_attachment"}static clone(e){return new CustomActionTextAttachmentNode({...e},e.__key)}static importJSON(e){return new CustomActionTextAttachmentNode({...e})}static importDOM(){return{[this.TAG_NAME]:e=>e.getAttribute("content")?{conversion:e=>{const t=[],n=e.previousSibling;n&&n.nodeType===Node.TEXT_NODE&&/\s$/.test(n.textContent)&&t.push(kr(" "));const r=parseAttachmentContent(e.getAttribute("content"));t.push(new CustomActionTextAttachmentNode({sgid:e.getAttribute("sgid"),innerHtml:r,plainText:e.textContent.trim()||extractPlainTextFromHtml(r),contentType:e.getAttribute("content-type")}));const i=e.nextSibling;return i&&i.nodeType===Node.TEXT_NODE&&/^\s/.test(i.textContent)&&t.push(kr(" ")),{node:t}},priority:2}:null}}static get TAG_NAME(){return Lexxy.global.get("attachmentTagName")}constructor({sgid:e,contentType:t,innerHtml:n,plainText:r}={},i){super(i);const o=Lexxy.global.get("attachmentContentTypeNamespace");this.sgid=e,this.contentType=t||`application/vnd.${o}.unknown`,this.innerHtml=n,this.plainText=r??extractPlainTextFromHtml(n)}createDOM(e,t){const n=createElement(CustomActionTextAttachmentNode.TAG_NAME,{"content-type":this.contentType,"data-lexxy-decorator":!0,draggable:!0});n.dataset.lexicalNodeKey=this.__key,n.insertAdjacentHTML("beforeend",EditorSanitizer.for(t).sanitize(this.innerHtml,{safeForXml:!0}));const r=createElement("lexxy-node-delete-button");return n.appendChild(r),n}updateDOM(){return!1}getTextContent(){return"\ufeff"}getReadableTextContent(){return this.plainText||`[${this.contentType}]`}isInline(){return!0}exportDOM(){return{element:createElement(CustomActionTextAttachmentNode.TAG_NAME,{sgid:this.sgid,content:this.innerHtml,"content-type":this.contentType})}}exportJSON(){return{type:"custom_action_text_attachment",version:1,sgid:this.sgid,contentType:this.contentType,innerHtml:this.innerHtml,plainText:this.plainText}}decorate(){return null}}const O$1=dc({build:(e,{delay:t,createInitialHistoryState:n,disabled:r,now:i})=>bt$2({delay:t,disabled:r,historyState:n(e),now:i}),config:_c({createInitialHistoryState:M$2,delay:300,disabled:"undefined"==typeof window,now:Date.now}),name:"@lexical/history/History",register:(e,t,n)=>{const r=n.getOutput();return St$2((()=>r.disabled.value?void 0:E$1(e,r.historyState.value,r.delay,(()=>r.now.peek()()))))}});dc({build:(e,{disabled:t,parentEditor:n})=>bt$2({disabled:t,parentEditor:n||e._parentEditor}),config:_c({disabled:!1,parentEditor:null}),dependencies:[hc(O$1,{disabled:!0})],name:"@lexical/history/SharedHistory",register:(e,t,n)=>St$2((()=>{const{disabled:e,parentEditor:t}=n.getOutput();if(!e.value){const{output:e}=n.getDependency(O$1),r=function(e){return e?fe$3(e,O$1.name):null}(t.value);if(!r)return;const i=r.output;Y$3((()=>{e.delay.value=i.delay.value,e.historyState.value=i.historyState.value,e.now.value=i.now.value,e.disabled.value=i.disabled.value}))}}))});class LexxyExtension{#se;constructor(e){this.#se=e}get editorElement(){return this.#se}get editorConfig(){return this.#se.config}get enabled(){return!0}get lexicalExtension(){return null}get allowedElements(){return[]}defineExtension(...e){return dc(...e)}initializeToolbar(e){}setEditorValidity(e,t){this.editorElement.setElementValidity(this,e,t)}dispose(){}}const REWRITE_HISTORY_COMMAND=re$5("REWRITE_HISTORY_COMMAND");class RewritableHistoryExtension extends LexxyExtension{#Te=null;get lexicalExtension(){return dc({name:"lexxy/rewritable-history",dependencies:[O$1],register:(e,t,n)=>{const r=n.getDependency(O$1).output;return this.#Te=r.historyState.value,e.registerCommand(REWRITE_HISTORY_COMMAND,(e=>this.#Ee(e)),ro)}})}get historyState(){return this.#Te}get#ve(){const e=Array.from(this.#Te.undoStack);return this.#Te.current&&e.push(this.#Te.current),e.concat(this.#Te.redoStack)}#Ee(e){return this.#we(e),this.#ke(e),!0}#we(e){Zs().update((()=>{for(const[t,{patch:n,replace:r}]of Object.entries(e)){const e=Yo(t);e&&(n&&Object.assign(e.getWritable(),n),r&&e.replace(r))}}),{discrete:!0,tag:this.#Ne()})}#ke(e){const t=Object.keys(e);for(const n of this.#ve){if(!this.#Ae(n,t))continue;const r=n.editorState=safeCloneEditorState(n.editorState);for(const[t,{patch:n,replace:i}]of Object.entries(e)){const e=r._nodeMap.get(t);e&&(n?this.#Le(r,e,n):i&&this.#Oe(r,e,i))}}}#Ae(e,t){return t.some((t=>e.editorState._nodeMap.has(t)))}#Ne(){const e=[Jn,Yn];return isEditorFocused(this.editorElement.editor)||e.push(qn),e}#Le(e,t,n){e._nodeMap.set(t.__key,$cloneNodeWithPatch(t,n))}#Oe(e,t,n){e._nodeMap.set(t.__key,$cloneNodeAdoptingKeys(n,t))}}const INITIAL_PREVIEW_POLL_DELAY_MS=3e3,MAX_PREVIEW_POLL_DELAY_MS=12e4,MAX_PREVIEW_POLL_ATTEMPTS=20;class ActionTextAttachmentNode extends Ji{static getType(){return"action_text_attachment"}static clone(e){return new ActionTextAttachmentNode({...e},e.__key)}static importJSON(e){return new ActionTextAttachmentNode({...e})}static importDOM(){return{[this.TAG_NAME]:()=>({conversion:e=>({node:new ActionTextAttachmentNode({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:()=>({conversion:e=>{const t=extractFileName(e.getAttribute("src")??"");return{node:new ActionTextAttachmentNode({src:e.getAttribute("src"),fileName:t,caption:e.getAttribute("alt")||"",contentType:"image/*",width:e.getAttribute("width"),height:e.getAttribute("height")})}},priority:1}),video:()=>({conversion:e=>{const t=e.getAttribute("src")||e.querySelector("source")?.src,n=t?.split("/")?.pop(),r=e.querySelector("source")?.getAttribute("content-type")||"video/*";return{node:new ActionTextAttachmentNode({src:t,fileName:n,contentType:r})}},priority:1})}}static get TAG_NAME(){return Lexxy.global.get("attachmentTagName")}constructor({sgid:e,src:t,previewSrc:n,previewable:r,previewStatusUrl:i,pendingPreview:o,altText:s,caption:l,contentType:a,fileName:c,fileSize:u,width:d,height:h,uploadError:g}={},p){super(p),this.sgid=e,this.src=t,this.previewSrc=n,this.previewable=parseBoolean(r),this.previewStatusUrl=i,this.pendingPreview=o,this.altText=s||"",this.caption=l||"",this.contentType=a||"",this.fileName=c||"",this.fileSize=u,this.width=d,this.height=h,this.uploadError=g,this.editor=Zs()}createDOM(){if(this.uploadError)return this.createDOMForError();if(this.pendingPreview)return this.#Ie();const e=this.createAttachmentFigure();return this.isPreviewableAttachment?(e.appendChild(this.#Fe()),e.appendChild(this.#Pe())):this.isVideo?(e.appendChild(this.#Re()),e.appendChild(this.#Pe())):(e.appendChild(this.#Re()),e.appendChild(this.#Me())),e}updateDOM(e,t){if(this.uploadError!==e.uploadError)return!0;const n=t.querySelector("figcaption textarea");return n&&this.caption&&(n.value=this.caption),!1}getTextContent(){return`[${this.caption||this.fileName}]\n\n`}isInline(){return this.isAttached()&&!this.getParent().is(Ls(this))}exportDOM(){return{element:createElement(ActionTextAttachmentNode.TAG_NAME,{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,previewStatusUrl:this.previewStatusUrl,pendingPreview:this.pendingPreview,altText:this.altText,caption:this.caption,contentType:this.contentType,fileName:this.fileName,fileSize:this.fileSize,width:this.width,height:this.height}}decorate(){return null}createDOMForError(){const e=this.createAttachmentFigure();return e.classList.add("attachment--error"),e.appendChild(createElement("div",{innerText:`Error uploading ${this.fileName||"file"}`})),e}createAttachmentFigure(e=this.isPreviewableAttachment){const t=createAttachmentFigure(this.contentType,e,this.fileName);t.draggable=!0,t.dataset.lexicalNodeKey=this.__key;const n=createElement("lexxy-node-delete-button");return t.appendChild(n),t}get isPreviewableAttachment(){return this.isPreviewableImage||this.previewable}get isPreviewableImage(){return isPreviewableImage(this.contentType)}get isVideo(){return this.contentType.startsWith("video/")}#Ie(){const e=this.createAttachmentFigure(!1);return e.appendChild(this.#Re()),e.appendChild(this.#Me()),this.#De(e),e}patchAndRewriteHistory(e){this.editor.dispatchCommand(REWRITE_HISTORY_COMMAND,{[this.getKey()]:{patch:e}})}replaceAndRewriteHistory(e){this.editor.dispatchCommand(REWRITE_HISTORY_COMMAND,{[this.getKey()]:{replace:e}})}#Fe(e={}){const t=createElement("img",{src:this.previewSrc||this.src,draggable:!1,alt:this.altText,...this.#Be,...e});this.previewable&&!this.isPreviewableImage&&(t.onerror=()=>this.#He(t)),this.previewSrc&&this.#ze(t);const n=createElement("div",{className:"attachment__container"});return n.appendChild(t),n}#ze(e){const t=this.previewSrc,n=new Image;n.onload=()=>this.#We(e,t),n.onerror=()=>this.#Ue(t),n.src=this.src}#We(e,t){e.src=this.src,this.patchAndRewriteHistory({previewSrc:null}),this.#Ke(t)}#Ue(e){this.patchAndRewriteHistory({previewSrc:null,uploadError:!0}),this.#Ke(e)}#Ke(e){e?.startsWith("blob:")&&URL.revokeObjectURL(e)}#He(e){const t=e.closest("figure.attachment");t&&this.#Ve(t,"attachment--preview","attachment--file",(()=>{t.appendChild(this.#Re()),t.appendChild(this.#Me())}))}#De(e){this.previewStatusUrl?this.#qe(e):this.#Ge(e)}#qe(e){let t=0;const n=async()=>
15{if(this.editor.read((()=>this.isAttached())))try{const t=await fetch(this.previewStatusUrl,{credentials:"include",redirect:"manual"});if(!this.editor.read((()=>this.isAttached())))return;t.ok?r():this.#je(e,this.src)}catch{r()}},r=()=>{if(t++,t<MAX_PREVIEW_POLL_ATTEMPTS&&this.editor.read((()=>this.isAttached()))){const e=Math.min(2e3*Math.pow(1.5,t),MAX_PREVIEW_POLL_DELAY_MS);setTimeout(n,e)}};setTimeout(n,INITIAL_PREVIEW_POLL_DELAY_MS)}#Ge(e){const t=new Image;t.onload=()=>{this.editor.read((()=>this.isAttached()))&&this.#je(e,this.src)},t.onerror=()=>{this.editor.read((()=>this.isAttached()))&&this.patchAndRewriteHistory({pendingPreview:!1})},t.src=this.src}#je(e,t){this.#Ve(e,"attachment--file","attachment--preview",(()=>{const n=createElement("img",{src:t,draggable:!1,alt:this.altText});n.onerror=()=>this.#He(n);const r=createElement("div",{className:"attachment__container"});r.appendChild(n),e.appendChild(r),e.appendChild(this.#Pe())})),this.patchAndRewriteHistory({pendingPreview:!1})}#Ve(e,t,n,r){e.className=e.className.replace(t,n);for(const t of[...e.querySelectorAll(".attachment__container, .attachment__icon, figcaption")])t.remove();r()}get#Be(){return this.width&&this.height?{width:this.width,height:this.height}:{}}#Re(){return createElement("span",{className:"attachment__icon",textContent:`${this.fileName?this.fileName.split(".").pop().toLowerCase():"unknown"}`})}#Me(){const e=createElement("figcaption",{className:"attachment__caption"}),t=createElement("strong",{className:"attachment__name",textContent:this.caption||this.fileName});if(e.appendChild(t),this.fileSize){const t=createElement("span",{className:"attachment__size",textContent:bytesToHumanSize(this.fileSize)});e.appendChild(t)}return e}#Pe(){const e=createElement("figcaption",{className:"attachment__caption"}),t=createElement("textarea",{value:this.caption,placeholder:this.fileName,rows:"1"});return t.addEventListener("focusin",(()=>t.placeholder="Add caption...")),t.addEventListener("blur",(e=>this.#Ze(e))),t.addEventListener("keydown",(e=>this.#Qe(e))),t.addEventListener("copy",(e=>e.stopPropagation())),t.addEventListener("cut",(e=>e.stopPropagation())),t.addEventListener("paste",(e=>e.stopPropagation())),e.appendChild(t),e}#Ze(e){this.#Ye(e.target)}#Ye(e){e.placeholder=this.fileName,this.editor.update((()=>{this.getWritable().caption=e.value}))}#Qe(e){"Enter"===e.key&&(e.preventDefault(),e.target.blur(),this.editor.update((()=>{this.selectNext(0,0)}),{tag:Jn})),e.stopPropagation()}}const J$3="javascript",k$1="data-language",w$1="data-highlight-language",P$1="data-theme";let z$1=class e extends Bi{__language;__theme;__isSyntaxHighlightSupported;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=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");mc(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(k$1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(w$1,n));const r=this.getTheme();r&&t.setAttribute(P$1,r);const i=this.getStyle();return i&&nr(t.style,i),t}updateDOM(e,t,n){const r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(k$1,r):i&&t.removeAttribute(k$1);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?o&&r?r!==i&&t.setAttribute(w$1,r):t.removeAttribute(w$1):o&&r&&t.setAttribute(w$1,r);const s=this.__theme,l=e.__theme;s?s!==l&&t.setAttribute(P$1,s):l&&t.removeAttribute(P$1);const a=this.__style,c=e.__style;return a!==c&&nr(t.style,a,c),!1}exportDOM(e){const t=document.createElement("pre");mc(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();n&&(t.setAttribute(k$1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(w$1,n));const r=this.getTheme();r&&t.setAttribute(P$1,r);const i=this.getStyle();return i&&nr(t.style,i),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||M$1(e,"BR"))?{conversion:j$1,priority:1}:null,div:()=>({conversion:R,priority:1}),pre:()=>({conversion:j$1,priority:0}),table:e=>q$1(e)?{conversion:B$1,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&q$1(n)?{conversion:U$2,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&q$1(t)?{conversion:U$2,priority:3}:null}}}static importJSON(e){return I$1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){if(!fe$3(Zs(),"@lexical/code")){const t=G$3(e);
15if(t)return t}const{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(Tr(i)){let e=O(i);const t=[];for(;;)if(Er(e))t.push(wr()),e=e.getNextSibling();else{if(!X$1(e))break;{let n=0;const r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&" "===r[n];)n++;if(0!==n&&t.push(V$2(" ".repeat(n))),n!==i)break;e=e.getNextSibling()}}const r=i.splitText(n.offset)[0],o=0===n.offset?0:1,s=r.getIndexWithinParent()+o,l=i.getParentOrThrow(),a=[or(),...t];l.splice(s,0,a);const c=t[t.length-1];c?c.select():0===n.offset?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(W$1(i)){const{offset:t}=e.anchor;i.splice(t,0,[or()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=eo();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}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}},K$1=class e extends gr{__highlightType;constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(t){return new e(t.__text,t.__highlightType||void 0,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__highlightType=e.__highlightType}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 mc(t,Q$2(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),i=Q$2(n.theme,e.__highlightType),o=Q$2(n.theme,this.__highlightType);return i!==o&&(i&&xc(t,i),o&&mc(t,o)),r}static importJSON(e){return V$2().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 I$1()}};!function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],i=[];/^\w+$/.test(n)||i.push(/\w+/.exec(n)[0]),"diff"===n&&i.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(Prism);const U$1=globalThis.Prism||window.Prism,Q$1={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"},G$2={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"},ie$1={$tokenize(e,t){return oe$2(e,t||this.defaultLanguage)},defaultLanguage:J$3,tokenize(e,t){return U$1.tokenize(e,U$1.languages[t||""]||U$1.languages[this.defaultLanguage])}},o=Q$1,a=V$1,r=ie$1,L$1=he$1,J$1=/[!-/:-@[-`{-~\s]/,xt=/^(\s*)(\d{1,})\.\s/,mt$1=/^(\s*)[-*+]\s/,Tt$1=/^(#{1,6})\s/,$t$1=/^>\s/,vt=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,yt$1=/^[ \t]*`{3,}$/,Ft$1=ot$3("mdListMarker",{parse:e=>"string"==typeof e&&/^[-*+]$/.test(e)?e:"-",resetOnCopyNode:!0}),Lt$1=ot$3("mdCodeFence",{parse:e=>"string"==typeof e&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),kt$1=e=>(t,n,r,i)=>{const o=e(r);o.append(...n),t.replace(o),i||o.select(0,0)},Rt$1=e=>(t,n,r,i)=>{const o=t.getPreviousSibling(),s=t.getNextSibling(),l=fe$2("check"===e?"x"===r[3]:void 0),a=r[0].trim()[0],c="bullet"!==e&&"check"!==e||a!==Ft$1.parse(a)?void 0:a;
15if(Se$1(s)&&s.getListType()===e){c&&ct$2(s,Ft$1,c);const e=s.getFirstChild();null!==e?e.insertBefore(l):s.append(l),t.remove()}else if(Se$1(o)&&o.getListType()===e)c&&ct$2(o,Ft$1,c),o.append(l),t.remove();else{const n=Te$1(e,"number"===e?Number(r[2]):void 0);c&&ct$2(n,Ft$1,c),n.append(l),t.replace(n)}l.append(...n),i||l.select(0,0);const u=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]);u&&l.setIndent(u)},Mt$1=(e,t,n)=>{const r=[],i=e.getChildren();let o=0;for(const s of i)if(pe$2(s)){if(1===s.getChildrenSize()){const e=s.getFirstChild();if(Se$1(e)){r.push(Mt$1(e,t,n+1));continue}}const i=" ".repeat(4*n),l=e.getListType(),a=st$2(e,Ft$1),c="number"===l?`${e.getStart()+o}. `:"check"===l?`${a} [${s.getChecked()?"x":" "}] `:a+" ";let u=t(s);"number"!==l&&(u=u.replace(/^(\s{0,3}\d+)(\.\s)/,"$1\\$2")),r.push(i+c+u),o++}return r.join("\n")},_t={dependencies:[It$1],export:(e,t)=>{if(!Lt$2(e))return null;const n=Number(e.getTag().slice(1));return"#".repeat(n)+" "+t(e)},regExp:Tt$1,replace:kt$1((e=>Jt$2("h"+e[1].length))),type:"element"},Bt$1={dependencies:[At$1],export:(e,t)=>{if(!Mt$2(e))return null;const n=t(e).split("\n"),r=[];for(const e of n)r.push("> "+e);return r.join("\n")},regExp:$t$1,replace:(e,t,n,r)=>{if(r){const n=e.getPreviousSibling();if(Mt$2(n))return n.splice(n.getChildrenSize(),0,[or(),...t]),void e.remove()}const i=St$1();i.append(...t),e.replace(i),r||i.select(0,0)},type:"element"}
15,Ot$1={dependencies:[z$1],export:e=>{if(!W$1(e))return null;const t=e.getTextContent();let n=st$2(e,Lt$1);if(t.indexOf(n)>-1){const e=t.match(/`{3,}/g);if(e){const t=Math.max(...e.map((e=>e.length)));n="`".repeat(t+1)}}return n+(e.getLanguage()||"")+(t?"\n"+t:"")+"\n"+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{const i=r[1],o=i.trim().length,s=e[n],l=r.index+i.length,a=s.slice(l),c=new RegExp(`\`{${o},}$`);if(c.test(a)){const e=a.match(c),i=a.slice(0,a.lastIndexOf(e[0])),o=[...r];return o[2]="",Ot$1.replace(t,null,o,e,[i],!0),[!0,n]}const u=new RegExp(`^[ \\t]*\`{${o},}$`);for(let i=n+1;i<e.length;i++){const o=e[i];if(u.test(o)){const l=o.match(u),a=e.slice(n+1,i),c=s.slice(r[0].length);return c.length>0&&a.unshift(c),Ot$1.replace(t,null,r,l,a,!0),[!0,i]}}const d=e.slice(n+1),h=s.slice(r[0].length);return h.length>0&&d.unshift(h),Ot$1.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:yt$1},regExpStart:vt,replace:(e,t,n,r,i,o)=>{let s,l;const a=n[1]?n[1].trim():"```",c=n[2]||void 0;if(!t&&i){if(1===i.length)r?(s=I$1(c),l=i[0]):(s=I$1(c),l=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{for(s=I$1(c),i.length>0&&(0===i[0].trim().length?i.shift():i[0].startsWith(" ")&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();l=i.join("\n")}ct$2(s,Lt$1,a);const t=kr(l);s.append(t),e.append(s)}else t&&kt$1((e=>I$1(e?e[2]:void 0)))(e,t,n,o)},type:"multiline-element"},jt$1={dependencies:[me$2,ge$2],export:(e,t)=>Se$1(e)?Mt$1(e,t,0):null,regExp:mt$1,replace:Rt$1("bullet"),type:"element"},Pt$1={dependencies:[me$2,ge$2],export:(e,t)=>Se$1(e)?Mt$1(e,t,0):null,regExp:xt,replace:Rt$1("number"),type:"element"},zt$1={format:["code"],tag:"`",type:"text-format"},Ut$1={format:["highlight"],tag:"==",type:"text-format"},Wt$1={format:["bold","italic"],tag:"***",type:"text-format"},Dt$1={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},Kt$1={format:["bold"],tag:"**",type:"text-format"},qt$1={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Gt$1={format:["strikethrough"],tag:"~~",type:"text-format"},Ht$1={format:["italic"],tag:"*",type:"text-format"},Jt$1={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Qt$1={dependencies:[F$4],export:(e,t)=>{if(!z$5(e)||G$8(e))return null;const n=t(e);let r=e.getTitle();return null!=r&&(r=r.replace(/([\\"])/g,"\\$1")),r?`[${n}](${e.getURL()} "${r}")`:`[${n}](${e.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(e,t)=>{if(dl(e,z$5))return;const[,n,r,i]=t,o=$$2(null!=r?Z(r):void 0,{title:null!=i?Z(i):void 0}),s=n.split("[").length-1,l=n.split("]").length-1;let a=n,c="";if(s<l)return;if(s>l){const e=n.split("[");c="["+e[0],a=e.slice(1).join("[")}const u=kr(a);return u.setFormat(e.getFormat()),o.append(u),e.replace(o),c&&o.insertBefore(kr(c)),u},trigger:")",type:"text-match"},Vt$1=[_t,Bt$1,jt$1,Pt$1],Xt$1=[Ot$1],Yt$1=[zt$1,Wt$1,Dt$1,Kt$1,qt$1,Ut$1,Ht$1,Jt$1,Gt$1],Zt$1=[Qt$1],te=[...Vt$1,...Xt$1,...Yt$1,...Zt$1];class HorizontalDividerNode extends Ji{static getType(){return"horizontal_divider"}static clone(e){return new HorizontalDividerNode(e.__key)}static importJSON(e){return new HorizontalDividerNode}static importDOM(){return{hr:()=>({conversion:()=>({node:new HorizontalDividerNode}),priority:1})}}constructor(e){super(e)}createDOM(){const e=createElement("figure",{className:"horizontal-divider"}),t=createElement("hr");e.appendChild(t);const n=createElement("lexxy-node-delete-button");return e.appendChild(n),e}updateDOM(){return!0}getTextContent(){return"\u2504\n\n"}isInline(){return!1}exportDOM(){return{element:createElement("hr")}}exportJSON(){return{type:"horizontal_divider",version:1}}decorate(){return null}}const HORIZONTAL_DIVIDER={dependencies:[HorizontalDividerNode],export:e=>e instanceof HorizontalDividerNode?"---":null,regExpStart:/^-{3,}\s?$/,replace:(e,t,n,r,i,o)=>{const s=new HorizontalDividerNode;if(e.replace(s),!o){const e=eo();s.insertAfter(e),e.select()}},type:"multiline-element"},PUNCTUATION_OR_SPACE=/[^\w]/;var theme={text:{bold:"lexxy-content__bold",italic:"lexxy-content__italic",strikethrough:"lexxy-content__strikethrough",underline:"lexxy-content__underline",highlight:"lexxy-content__highlight"},tableCellHeader:"lexxy-content__table-cell--header",tableCellSelected:"lexxy-content__table-cell--selected",tableSelection:"lexxy-content__table--selection",tableScrollableWrapper:"lexxy-content__table-wrapper",tableCellHighlight:"lexxy-content__table-cell--highlight",tableCellFocus:"lexxy-content__table-cell--focus",list:{nested:{listitem:"lexxy-nested-listitem"}},codeHighlight:{addition:"code-token__selector",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__comment",decorator:"code-token__function",deleted:"code-token__operator",deletion:"code-token__operator",directive:"code-token__attr","directive-hash":"code-token__property",doctype:"code-token__comment",entity:"code-token__operator",function:"code-token__function",hexcode:"code-token__property",important:"code-token__function",inserted:"code-token__selector",italic:"code-token__comment",keyword:"code-token__attr",line:"code-token__selector",namespace:"code-token__variable",number:"code-token__property",macro:"code-token__function",operator:"code-token__operator",parameter:"code-token__variable",prolog:"co
15de-token__comment",property:"code-token__property",punctuation:"code-token__punctuation","raw-string":"code-token__operator",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","type-definition":"code-token__function",url:"code-token__operator",variable:"code-token__variable"}};class UploadRequests{#Je=new Map;track(e,t){this.#Je.set(e,t)}forget(e){this.#Je.delete(e)}abort(e){const t=this.#Je.get(e);t&&(this.#Je.delete(e),t.abort())}clear(){this.#Je.clear()}}const Ke$1=/^(\d+(?:\.\d+)?)px$/,Ae$1={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};let Ee$1=class e extends Bi{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;static getType(){return"tablecell"}static clone(t){return new e(t.__headerState,t.__colSpan,t.__width,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__rowSpan=e.__rowSpan,this.__backgroundColor=e.__backgroundColor,this.__verticalAlign=e.__verticalAlign,this.__colSpan=e.__colSpan,this.__headerState=e.__headerState,this.__width=e.__width}static importDOM(){return{td:()=>({conversion:Me$1,priority:0}),th:()=>({conversion:Me$1,priority:0})}}static importJSON(e){return $e$1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan||1).setRowSpan(e.rowSpan||1).setWidth(e.width||void 0).setBackgroundColor(e.backgroundColor||null).setVerticalAlign(e.verticalAlign||void 0)}constructor(e=Ae$1.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){const t=document.createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),null!==this.__backgroundColor&&(t.style.backgroundColor=this.__backgroundColor),ke$1(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),mc(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){const t=super.exportDOM(e);if(Ys(t.element)){const e=t.element;e.setAttribute("data-temporary-table-cell-lexical-key",this.getKey()),e.style.border="1px solid black",this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||"top",e.style.textAlign="start",null===this.__backgroundColor&&this.hasHeader()&&(e.style.backgroundColor="#f2f3f5")}return t}exportJSON(){return{...super.exportJSON(),...ke$1(this.__verticalAlign)&&{verticalAlign:this.__verticalAlign},backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,width:this.getWidth()}}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){const t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){const t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(e,t=Ae$1.BOTH){const n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){const t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){const t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){const t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){const t=this.getWritable();return(t.__headerState&e)===e?t.__headerState-=e:t.__headerState+=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==Ae$1.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};const ze$1=re$5("INSERT_TABLE_COMMAND");let He$1=class e extends Bi{__height;static getType(){return"tablerow"}static clone(t){return new e(t.__height,t.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__height=e.__height}static importDOM(){return{tr:()=>({conversion:Be$1,priority:0})}}static importJSON(e){return Pe$1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHeight(e.height)}constructor(e,t){super(t),this.__height=e}exportJSON(){const e=this.getHeight();return{...super.exportJSON(),...void 0===e?void 0:{height:e}}}createDOM(e){const t=document.createElement("tr");return this.__height&&(t.style.height=`${this.__height}px`),mc(t,e.theme.tableRow),t}extractWithChild(e,t,n){return"html"===n}isShadowRoot(){return!0}setHeight(e){const t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};const Ie$1="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ue$1=Ie$1&&"documentMode"in document?document.documentMode:null,Je$1=Ie$1&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);Ie$1&&"InputEvent"in window&&!Ue$1&&new window.InputEvent("input");const tt=(e,t)=>e===Ae$1.BOTH||e===t?t:Ae$1.NO_STATUS;class Rt{tableKey;anchor;focus;_cachedNodes;dirty 16;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if("root"===this.tableKey||"root"===this.anchor.key||"element"!==this.anchor.type||"root"===this.focus.key||"element"!==this.focus.type)return!1;const e=Yo(this.tableKey),t=Yo(this.anchor.key),n=Yo(this.focus.key);return null!==e&&null!==t&&null!==n}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return Ot(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new Rt(this.tableKey,Mr(this.anchor.key,this.anchor.offset,this.anchor.type),Mr(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){}insertText(){}hasFormat(e){let t=0;
16this.getNodes().filter(We$1).forEach((e=>{const n=e.getFirstChild();no(n)&&(t|=n.getTextFormat())}));const n=z$7[e];return!!(t&n)}insertNodes(e){const t=this.focus.getNode();Wi(t)||Le$1(151),St$3(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){const{anchorCell:e,focusCell:t}=Ft(this),n=Tt(e);null===n&&Le$1(153);const r=Tt(t);null===r&&Le$1(155);const i=Math.min(n.columnIndex,r.columnIndex),o=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),s=Math.min(n.rowIndex,r.rowIndex),l=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(i,o),fromY:Math.min(s,l),toX:Math.max(i,o),toY:Math.max(s,l)}}getNodes(){if(!this.isValid())return[];const e=this._cachedNodes;if(null!==e)return e;const{anchorTable:t,anchorCell:n,focusCell:r}=Ft(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){const e=i.getParent();null==e&&Le$1(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{const e=t.getParent();null==e&&Le$1(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}const[o,s,l]=wt(t,n,r),{minColumn:a,maxColumn:c,minRow:u,maxRow:d}=Nt(o,s,l),h=new Map([[t.getKey(),t]]);let g=null;for(let e=u;e<=d;e++)for(let t=a;t<=c;t++){const{cell:n}=o[e][t],r=n.getParent();De$1(r)||Le$1(160),r!==g&&(h.set(r.getKey(),r),g=r),h.has(n.getKey())||Et(n,(e=>{h.set(e.getKey(),e)}))}const p=Array.from(h.values());return mi()||(this._cachedNodes=p),p}getTextContent(){const e=this.getNodes().filter((e=>We$1(e)));let t="";for(let n=0;n<e.length;n++){const r=e[n],i=r.__parent,o=(e[n+1]||{}).__parent;t+=r.getTextContent()+(o!==i?"\n":"\t")}return t}}class Mt{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){const{nextFocus:e}=this;return null!==e&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){const{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}}class $t{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort("removeListeners"),Array.from(this.listenersToRemove).forEach((e=>e())),this.listenersToRemove.clear()}$lookup(){return kt(this.tableNodeKey,this.editor)}trackTable(){const e=new MutationObserver((e=>{this.editor.getEditorState().read((()=>{let t=!1;for(let n=0;n<e.length;n++){const r=e[n].target.nodeName;if("TABLE"===r||"TBODY"===r||"THEAD"===r||"TR"===r){t=!0;break}}if(!t)return;const{tableNode:n,tableElement:r}=this.$lookup();this.table=Gt(n,r)}),{editor:this.editor})}));this.editor.getEditorState().read((()=>{const{tableNode:t,tableElement:n}=this.$lookup();this.table=Gt(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})}),{editor:this.editor})}$clearHighlight(e=!0){const t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();const{tableNode:n,tableElement:r}=this.$lookup();Qt(t,Gt(n,r),null),e&&null!==Qr()&&(es(null),t.dispatchCommand(ie$4,void 0))}$enableHighlightStyle(){const e=this.editor,{tableElement:t}=this.$lookup();xc(t,e._config.theme.tableSelection),t.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){const{tableElement:e}=this.$lookup();mc(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(null!==e){e.tableKey!==this.tableNodeKey&&Le$1(233,e.tableKey,this.tableNodeKey);const t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),Qt(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(null!==this.anchorCell&&null!==this.focusCell){const e=Js(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){const n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,o=e.y;if(this.focusCell=e,this.isHighlightingCells||(t||this.anchorX!==i||this.anchorY!==o||null!=this.tableSelection&&null!=this.anchorCellNodeKey)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),-1!==this.focusX&&-1!==this.focusY&&i===this.focusX&&o===this.focusY)return!1;if(this.focusX=i,this.focusY=o,this.isHighlightingCells){const s=_n(r,e.elem);if(null!=this.tableSelection&&null!=this.anchorCellNodeKey){let e=s;if(null===e&&t&&(e=r.getCellNodeFromCords(i,o,this.table)),null!==e){const t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=At(r,t,e),es(this.tableSelection),n.dispatchCommand(ie$4,void 0),Qt(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){return this.anchorCellNodeKey?Yo(this.anchorCellNodeKey):null}$getAnchorTableCellOrThrow(){const e=this.$getAnchorTableCell();return null===e&&Le$1(234),e}$getFocusTableCell(){return this.focusCellNodeKey?Yo(this.focusCellNodeKey):null}$getFocusTableCellOrThrow(){const e=this.$getFocusTableCell();return null===e&&Le$1(235),e}
vendor: 1,282 bytes, line 16
16$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;const{tableNode:t}=this.$lookup(),n=_n(t,e.elem);if(null!==n){const e=n.getKey();null!=this.tableSelection?(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)):this.tableSelection=At(t,n,n),this.anchorCellNodeKey=e}}$formatCells(e){const t=Qr();Ot(t)||Le$1(236);const n=qr(),r=n.anchor,i=n.focus,o=t.getNodes().filter(We$1);o.length>0||Le$1(237);const s=o[0].getFirstChild(),l=no(s)?s.getFormatFlags(e,null):null;o.forEach((t=>{r.set(t.getKey(),0,"element"),i.set(t.getKey(),t.getChildrenSize(),"element"),n.formatText(e,l)})),es(t),this.editor.dispatchCommand(ie$4,void 0)}$clearText(){const{editor:e}=this,t=Yo(this.tableNodeKey);if(!Rn(t))throw new Error("Expected TableNode.");const n=Qr();Ot(n)||Le$1(253);const r=n.getNodes().filter(We$1),i=t.getFirstChild(),o=t.getLastChild();if(r.length>0&&null!==i&&null!==o&&De$1(i)&&De$1(o)&&r[0]===i.getFirstChild()&&r[r.length-1]===o.getLastChild()){t.selectPrevious();const n=t.getParent();return t.remove(),void(Vi(n)&&n.isEmpty()&&e.dispatchCommand(he$3,void 0))}r.forEach((e=>{if(Wi(e)){const t=eo(),n=kr();
16t.append(n),e.append(t),e.getChildren().forEach((e=>{e!==t&&e.remove()}))}})),Qt(e,this.table,null),es(null),e.dispatchCommand(ie$4,void 0)}}const Wt="__lexicalTableSelection",Pt=[[Ee$3,"down"],[we$1,"up"],[Ne$1,"backward"],[ke$2,"forward"]],Dt=[ye$2,me$3,fe$4],It=[Ae$3,Pe$2],en=(e,t,n,r,i)=>{const o="forward"===i;switch(i){case"backward":case"forward":return n!==(o?e.table.columns-1:0)?sn(t.getCellNodeFromCordsOrThrow(n+(o?1:-1),r,e.table),o):r!==(o?e.table.rows-1:0)?sn(t.getCellNodeFromCordsOrThrow(o?0:e.table.columns-1,r+(o?1:-1),e.table),o):o?t.selectNext():t.selectPrevious(),!0;case"up":return 0!==r?sn(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1):t.selectPrevious(),!0;case"down":return r!==e.table.rows-1?sn(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0):t.selectNext(),!0;default:return!1}},bn=new WeakSet;class vn extends Bi{__rowStriping;__frozenColumnCount;__frozenRowCount;__colWidths;static getType(){return"table"}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){const t=this.getWritable();return t.__colWidths=e,t}static clone(e){return new vn(e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__colWidths=e.__colWidths,this.__rowStriping=e.__rowStriping,this.__frozenColumnCount=e.__frozenColumnCount,this.__frozenRowCount=e.__frozenRowCount}static importDOM(){return{table:()=>({conversion:Tn,priority:1})}}static importJSON(e){return Fn().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setRowStriping(e.rowStriping||!1).setFrozenColumns(e.frozenColumnCount||0).setFrozenRows(e.frozenRowCount||0).setColWidths(e.colWidths)}constructor(e){super(e),this.__rowStriping=!1,this.__frozenColumnCount=0,this.__frozenRowCount=0,this.__colWidths=void 0}exportJSON(){return{...super.exportJSON(),colWidths:this.getColWidths(),frozenColumnCount:this.__frozenColumnCount?this.__frozenColumnCount:void 0,frozenRowCount:this.__frozenRowCount?this.__frozenRowCount:void 0,rowStriping:this.__rowStriping?this.__rowStriping:void 0}}extractWithChild(e,t,n){return"html"===n}getDOMSlot(e){const t=zt(e)?e:e.querySelector("table");return zt(t)||Le$1(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup"))}createDOM(e,t){const n=document.createElement("table");this.__style&&nr(n.style,this.__style);const r=document.createElement("colgroup");if(n.appendChild(r),ll(r),mc(n,e.theme.table),this.updateTableElement(null,n,e),yn(t)){const t=document.createElement("div"),r=e.theme.tableScrollableWrapper;return r?mc(t,r):t.style.overflowX="auto",t.appendChild(n),this.updateTableWrapper(null,t,n,e),t}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(mc(e,n.theme.tableFrozenColumn),t.setAttribute("data-lexical-frozen-column","true")):(xc(e,n.theme.tableFrozenColumn),t.removeAttribute("data-lexical-frozen-column"))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(mc(e,n.theme.tableFrozenRow),t.setAttribute("data-lexical-frozen-row","true")):(xc(e,n.theme.tableFrozenRow),t.removeAttribute("data-lexical-frozen-row"))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:"")&&nr(t.style,this.__style,e?e.__style:""),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(mc(e,t.theme.tableRowStriping),e.setAttribute("data-lexical-row-striping","true")):(xc(e,t.theme.tableRowStriping),e.removeAttribute("data-lexical-row-striping"))}(t,n,this.__rowStriping);const r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||Sn(t,this.getColumnCount(),this.getColWidths()),wn(t,n,this.getFormatType())}updateDOM(e,t,n){const r=Lt(this,t);return t===r===yn()||(Ys(i=t)&&"DIV"===i.nodeName&&this.updateTableWrapper(e,t,r,n),this.updateTableElement(e,r,n),!1);var i}scaleDOMColWidths(e,t){const n=this.getColWidths();n&&Sn(Lt(this,e),this.getColumnCount(),n.map((e=>e*t)))}exportDOM(e){const t=super.exportDOM(e),{element:n}=t;return{after:n=>{if(t.after&&(n=t.after(n)),!zt(n)&&Ys(n)&&(n=n.querySelector("table")),!zt(n))return null;wn(n,e._config,this.getFormatType());const[r]=bt(this,null,null),i=new Map;for(const e of r)for(const t of e){const e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}const o=new Set;for(const e of n.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")){const t=e.getAttribute("data-temporary-table-cell-lexical-key");if(t){const n=i.get(t);if(e.removeAttribute("data-temporary-table-cell-lexical-key"),n){i.delete(t);for(let e=0;e<n.colSpan;e++)o.add(e+n.startColumn)}}}const s=n.querySelector(":scope > colgroup");if(s){const e=Array.from(n.querySelectorAll(":scope > colgroup > col")).filter(((e,t)=>o.has(t)));s.replaceChildren(...e)}const l=n.querySelectorAll(":scope > tr");if(l.length>0){const e=document.createElement("tbody");for(const t of l)e.appendChild(t);n.append(e)}return n},element:!zt(n)&&Ys(n)?n.querySelector("table"):n}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){const{rows:n,domRows:r}=t;for(let t=0;t<n;t++){const n=r[t];if(null!=n)for(let r=0;r<n.length;r++){const i=n[r];if(null==i)continue;const{elem:o}=i,s=_n(this,o);if(null!==s&&e.is(s))return{x:r,y:t}}}throw new Error("Cell not found in table.")}getDOMCellFromCords(e,t,n){const{domRows:r}=n,i=r[t];if(null==i)return null;const o=i[e<i.length?e:i.length-1];return null==o?null:o}getDOMCellFromCordsOrThrow(e,t,n){const r=this.getDOMCellFromCords(e,t,n);if(!r)throw new Error("Cell not found at cords.");return r}getCellNodeFromCords(e,t,n){const r=this.getDOMCellFromCords(e,t,n);if(null==r)return null;const i=Go(r.elem);return We$1(i)?i:null}getCellNodeFromCordsOrThrow(e,t,n){const r=this.getCellNodeFromCords(e,t,n);if(!r)throw new Error("Node at cords not TableCellNode.");return r}getRowStriping(){return Boolean(this.getLatest().__rowStriping)}setRowStriping(e){const t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){const t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){const t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){const e=this.getFirstChild();if(!e)return 0;let t=0;
16return e.getChildren().forEach((e=>{We$1(e)&&(t+=e.getColSpan())})),t}}let resolverRoot=null;class StyleCanonicalizer{constructor(e,t=[]){this._property=e,this._allowedValues=t,this._canonicalValues=this.#Xe}applyCanonicalization(e){const t={...oe$5(e)};return t[this._property]=this.getCanonicalAllowedValue(t[this._property]),t[this._property]||delete t[this._property],F$6(t)}getCanonicalAllowedValue(e){return this._canonicalValues[e]||=this.#et(e)}get#Xe(){return this._allowedValues.reduce(((e,t)=>({...e,[t]:t})),{})}#et(e){let t=this.#tt.indexOf(e);return-1===t&&(t=this.#tt.indexOf(computeStyleValues(this._property,[e])[0])),-1===t?null:this._allowedValues[t]}get#tt(){return this._computedAllowedValues||=computeStyleValues(this._property,this._allowedValues)}}const TOGGLE_HIGHLIGHT_COMMAND=re$5(),REMOVE_HIGHLIGHT_COMMAND=re$5(),BLANK_STYLES={color:null,"background-color":null},hasPastedStylesState=ot$3("hasPastedStyles",{parse:e=>e||!1}),pendingCodeHighlights=new WeakMap;class HighlightExtension extends LexxyExtension{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return[dc({dependencies:[Xt$2],name:"lexxy/highlight",config:{color:{buttons:[],permit:[]},"background-color":{buttons:[],permit:[]}},html:{import:{mark:$markConversion}},register(e,t){const n=buildCanonicalizers(t);return $registerPreConversion(e),Cc(e.registerCommand(TOGGLE_HIGHLIGHT_COMMAND,(t=>$toggleSelectionStyles(e,t)),oo),e.registerCommand(REMOVE_HIGHLIGHT_COMMAND,(()=>$toggleSelectionStyles(e,BLANK_STYLES)),oo),e.registerNodeTransform(gr,$syncHighlightWithStyle),e.registerNodeTransform(K$1,$syncHighlightWithCodeHighlightNode),e.registerNodeTransform(gr,(e=>$canonicalizePastedStyles(e,n))))}}),this.editorConfig.get("highlight")]}}const COMMANDS=["bold","italic","strikethrough","underline","link","unlink","toggleHighlight","removeHighlight","setFormatHeadingLarge","setFormatHeadingMedium","setFormatHeadingSmall","setFormatParagraph","applyHeadingFormat","clearFormatting","insertUnorderedList","insertOrderedList","insertQuoteBlock","insertCodeBlock","setCodeLanguage","insertHorizontalDivider","uploadImage","uploadFile","insertTable","undo","redo"];class CommandDispatcher{#nt=null;#t=new ListenerBin;static configureFor(e){return new CommandDispatcher(e)}constructor(e){this.editorElement=e,this.editor=e.editor,this.selection=e.selection,this.contents=e.contents,this.#rt(),this.#it(),this.#ot()}dispatchBold(){this.editor.dispatchCommand(xe,"bold")}dispatchItalic(){this.editor.dispatchCommand(xe,"italic")}dispatchStrikethrough(){this.editor.dispatchCommand(xe,"strikethrough")}dispatchUnderline(){this.editor.dispatchCommand(xe,"underline")}dispatchToggleHighlight(e){this.editor.dispatchCommand(TOGGLE_HIGHLIGHT_COMMAND,e)}dispatchRemoveHighlight(){this.editor.dispatchCommand(REMOVE_HIGHLIGHT_COMMAND)}dispatchLink(e){this.editor.update((()=>{const t=Qr();if(!Fr(t))return;const n=t.anchor.getNode();if(t.isCollapsed()&&!At$2(n,F$4)){const n=H$5(e),r=kr(e);n.append(r),t.insertNodes([n])}else Q$6(e)}))}dispatchUnlink(){this.editor.update((()=>{this.editorElement.adapter.unlinkFrozenNode?.()||Q$6(null)}))}dispatchInsertUnorderedList(){const e=Qr();if(!Fr(e))return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"bullet"===getListType(t)?this.contents.applyParagraphFormat():this.contents.applyUnorderedListFormat()}dispatchInsertOrderedList(){const e=Qr();if(!Fr(e))return;const t=e.anchor.getNode();this.selection.isInsideList&&t&&"number"===getListType(t)?this.contents.applyParagraphFormat():this.contents.applyOrderedListFormat()}dispatchInsertQuoteBlock(){this.contents.toggleBlockquote()}dispatchInsertCodeBlock(){this.selection.hasSelectedWordsInSingleLine?this.#st():this.contents.toggleCodeBlock()}#st(){const e=Qr();if(Fr(e)){if(!e.isCollapsed()){const t=e.getNodes().filter(Tr);!t.every((e=>e.hasFormat("code")))&&this.#lt(e,t)}this.editor.dispatchCommand(xe,"code")}}#lt(e,t){const n=e.isBackward(),r=n?e.focus:e.anchor,i=n?e.anchor:e.focus;for(let e=0;e<t.length;e++){const n=t[e];if(0===n.getFormat())continue;const o=0===e,s=e===t.length-1,l=o&&"text"===r.type?r.offset:0,a=s&&"text"===i.type?i.offset:n.getTextContentSize();if(0===l&&a===n.getTextContentSize())n.setFormat(0);else{const e=n.splitText(l,a),t=0===l?e[0]:e[1];t.setFormat(0),o&&"text"===r.type&&r.set(t.getKey(),0,"text"),s&&"text"===i.type&&i.set(t.getKey(),a-l,"text")}}}dispatchSetCodeLanguage(e){this.editor.update((()=>
16{if(!this.selection.isInsideCodeBlock)return;const t=this.selection.nearestNodeOfType(z$1);t&&t.setLanguage(e)}))}dispatchInsertHorizontalDivider(){Pt$3(new HorizontalDividerNode)}dispatchSetFormatHeadingLarge(){this.#at(0)}dispatchSetFormatHeadingMedium(){this.#at(1)}dispatchSetFormatHeadingSmall(){this.#at(2)}dispatchSetFormatParagraph(){this.contents.applyParagraphFormat()}dispatchApplyHeadingFormat(e){this.contents.applyHeadingFormat(e)}dispatchClearFormatting(){this.contents.clearFormatting()}dispatchUploadImage(){this.#ct("image/*,video/*")}dispatchUploadFile(){this.#ct()}#ct(e=null){const t={type:"file",multiple:!0,style:"display: none;",onchange:({target:{files:e}})=>{this.contents.uploadFiles(e,{selectLast:!0})}};e&&(t.accept=e);const n=createElement("input",t);this.editorElement.appendChild(n),n.click(),setTimeout((()=>n.remove()),1e3)}dispatchInsertTable(){this.editor.dispatchCommand(ze$1,{rows:3,columns:3,includeHeaders:!0})}dispatchUndo(){this.editor.dispatchCommand(Ce$2,void 0)}dispatchRedo(){this.editor.dispatchCommand(Se$2,void 0)}dispose(){this.#t.dispose()}#at(e){const t=this.editorElement.config.get("headings")[e];t&&this.contents.applyHeadingFormat(t)}#rt(){for(const e of COMMANDS){const t=`dispatch${capitalize(e)}`;this.#ut(e,0,this[t].bind(this))}}#ut(e,t,n){this.#t.track(this.editor.registerCommand(e,n,t))}#it(){this.#ut(ke$2,oo,this.#dt.bind(this)),this.#ut(Fe$2,oo,this.#ht.bind(this)),this.#ut(de$4,so,this.#gt.bind(this)),this.#ut(he$3,so,this.#gt.bind(this))}#gt(){return $normalizeBlockContainerSelection(),!1}#dt(e){const t=Qr();if(!Fr(t)||!t.isCollapsed())return!1;if(this.selection.isInsideCodeBlock||!t.hasFormat("code"))return!1;const n=t.anchor.getNode();return!(!Tr(n)||t.anchor.offset!==n.getTextContentSize())&&(null===n.getNextSibling()&&(e.preventDefault(),t.toggleFormat("code"),!0))}#ot(){this.editorElement.supportsAttachments&&(this.dragCounter=0,this.#t.track(this.editor.registerRootListener((e=>{if(e){const t=[registerEventListener(e,"dragover",this.#pt.bind(this)),registerEventListener(e,"drop",this.#ft.bind(this)),registerEventListener(e,"dragenter",this.#mt.bind(this)),registerEventListener(e,"dragleave",this.#yt.bind(this))];return()=>t.forEach((e=>e()))}}))))}#mt(e){this.#bt(e)||(this.dragCounter++,1===this.dragCounter&&(this.#$t(),this.editor.getRootElement().classList.add("lexxy-editor--drag-over")))}#yt(e){this.#bt(e)||(this.dragCounter--,0===this.dragCounter&&(this.#nt=null,this.editor.getRootElement().classList.remove("lexxy-editor--drag-over")))}#pt(e){this.#bt(e)||e.preventDefault()}#ft(e){if(this.#bt(e))return;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);n.length&&(this.#_t(),this.contents.uploadFiles(n,{selectLast:!0}),this.editor.focus())}#$t(){this.editor.getEditorState().read((()=>{this.#nt=Qr()?.clone()}))}#_t(){this.#nt&&(this.editor.update((()=>{es(this.#nt)})),this.#nt=null)}#bt(e){return e.dataTransfer?.types.some((e=>e.startsWith("application/x-lexxy-")))}#ht(e){return this.selection.isInsideList?this.#Ct(e):!!this.selection.isInsideCodeBlock&&this.#xt()}#Ct(e){if(e.shiftKey&&!this.selection.isIndentedList)return!1;e.preventDefault();const t=e.shiftKey?Ke$2:Ie$3;return this.editor.dispatchCommand(t)}#xt(){const e=Qr();return Fr(e)&&e.isCollapsed()}}class Selection{#t=new ListenerBin;constructor(e){this.editorElement=e,this.editorContentElement=e.editorContentElement,this.editor=this.editorElement.editor,this.previouslySelectedKeys=new Set,this.#St(),this.#Tt(),this.#Et(),this.#vt()}get hasNodeSelection(){return this.editor.getEditorState().read((()=>{const e=Qr();return null!==e&&Ir(e)}))}get cursorPosition(){let e=null;return this.editor.getEditorState().read((()=>{const t=this.#wt();if(!t)return;const n=this.#kt(t);this.#Nt(n)||(e=this.#At(n,t))})),e}placeCursorAtTheEnd(){this.editor.update((()=>{const e=Zo(),t=e.getLastDescendant();t&&Tr(t)?t.selectEnd():e.selectEnd()}))}selectedNodeWithOffset(){const e=Qr();if(!e)return{node:null,offset:0};if(Fr(e))return{node:e.anchor.getNode(),offset:e.anchor.offset};if(Ir(e)){const[t]=e.getNodes();return{node:t,offset:0}}return{node:null,offset:0}}getFormat(){const e=Qr();if(!Fr(e))return{};const t=e.anchor.getNode();if(!t.getParent())return{};const n=t.getTopLevelElementOrThrow(),r=getListType(t),i=this.#Lt(t);return{isBold:e.hasFormat("bold"),isItalic:e.hasFormat("italic"),isStrikethrough:e.hasFormat("strikethrough"),isUnderline:e.hasFormat("underline"),isHighlight:isSelectionHighlighted(e),isInLink:null!==At$2(t,F$4),isInQuote:Mt$2(n),isInHeading:null!==i,isInCode:this.#Ot(e,t),headingTag:i?.getTag()??null,isInList:null!==r,listType:r,isInTable:null!==Ye(t)}}nearestNodeOfType(e){const t=Qr()?.anchor?.getNode();return At$2(t,e)}get hasSelectedWordsInSingleLine(){const e=Qr();if(!Fr(e))return!1;if(e.isCollapsed())return!1;const t=e.anchor.getNode(),n=e.focus.getNode();if(t.getTopLevelElement()!==n.getTopLevelElement())return!1;const r=t.getTopLevelElement();if(!r)return!1;const i=Wi(t)?t:t.getParent();if(i!==(Wi(n)?n:n.getParent())&&i!==r)return!1;const o=e.getNodes();for(const e of o)if(sr(e))return!1;return!0}get isInsideList(){return this.nearestNodeOfType(ge$2)}get isInsideBlockQuote(){return this.nearestNodeOfType(At$1)}get isIndentedList(){const e=this.nearestNodeOfType(me$2);return e&&G$7(e)>1}get isInsideCodeBlock(){return null!==this.nearestNodeOfType(z$1)}get isTableCellSelected(){const e=Qr(),{anchor:t,focus:n}=e;return!(!Fr(e)||t.key!==n.key)&&null!==this.nearestNodeOfType(Ee$1)}get isOnPreviewableImage(){return null!=this.previewableImageNode}get previewableImageNode(){const e=Qr()?.getNodes().at(0);return $isActionTextAttachmentNode(e)&&e.isPreviewableImage?e:null}get isAtNodeStart(){const{anchorNode:e,offset:t}=this.#It();return e&&0===t}get nodeAfterCursor(){const{anchorNode:e,offset:t}=this.#It();return e?Tr(e)?this.#Ft(e,t):Wi(e)?this.#Pt(e,t):this.#Rt(e):null}get topLevelNodeAfterCursor(){const{anchorNode:e,offset:t}=this.#It();if(!e)return null;if(Tr(e)){if(t===e.getTextContentSize())return this.#Mt(e);if(this.#Dt(e)){const t=e.getTopLevelElement();return t?t.getNextSibling():null}return null}return Wi(e)?this.#Pt(e,t):this.#Rt(e)}
16get nodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#It();return e?Tr(e)?this.#Bt(e,t):Wi(e)?this.#Ht(e,t):this.#zt(e):null}get topLevelNodeBeforeCursor(){const{anchorNode:e,offset:t}=this.#It();if(!e)return null;if(Tr(e)){if(0===t)return this.#Wt(e);if(this.#Ut(e)){const t=e.getTopLevelElement();return t?t.getPreviousSibling():null}return null}return Wi(e)?this.#Ht(e,t):this.#zt(e)}dispose(){this.editorElement=null,this.editorContentElement=null,this.editor=null,this.previouslySelectedKeys=null,this.#t.dispose()}#Ot(e,t){return null!==At$2(t,z$1)||!!e.hasFormat("code")&&(Tr(t)&&t.hasFormat("code"))}#vt(){this.#t.track(this.editor.registerUpdateListener((({editorState:e,tags:t})=>{if(t.has("history-merge")||t.has("skip-dom-selection"))return;let n=!1;e.read((()=>{const e=Qr();if(!Fr(e)||!e.isCollapsed())return;if(!e.hasFormat("code"))return;const t=e.anchor.getNode();this.#Ot(e,t)||(n=!0)})),n&&setTimeout((()=>{this.editor.update((()=>{const e=Qr();if(!Fr(e)||!e.hasFormat("code"))return;const t=e.anchor.getNode();this.#Ot(e,t)||e.toggleFormat("code")}))}),0)})))}get#Kt(){if(this.currentlySelectedKeys)return this.currentlySelectedKeys;this.currentlySelectedKeys=new Set;const e=Qr();if(e&&Ir(e))for(const t of e.getNodes())this.currentlySelectedKeys.add(t.getKey());return this.currentlySelectedKeys}#Tt(){this.#t.track(this.editor.registerCommand(Ne$1,handlingDefault(this.#Vt.bind(this)),io),this.editor.registerCommand(ke$2,handlingDefault(this.#qt.bind(this)),io),this.editor.registerCommand(we$1,handlingDefault(this.#Gt.bind(this)),io),this.editor.registerCommand(Ee$3,handlingDefault(this.#jt.bind(this)),io),this.editor.registerCommand(fe$4,this.#Zt.bind(this),io),this.editor.registerCommand(ie$4,(()=>{this.#Qt()}),io),this.editor.registerCommand(ie$4,(()=>(this.#Yt(),!1)),lo))}#Yt(){this.#Jt&&Os(qn)}get#Jt(){const e=this.editor.getRootElement(),t=e?.ownerDocument.activeElement;return t&&!e.contains(t)&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)}#St(){this.#t.track(this.editor.registerCommand(se$5,(({target:e})=>{if(!qs(e))return!1;const t=Go(e);return ji(t)&&this.#Xt(t)}),io)),this.#t.track(this.editor.registerRootListener((e=>{if(e)return registerEventListener(e,"lexxy:internal:move-to-next-line",(()=>this.#en()))})))}#Et(){this.#t.track(this.editor.registerRootListener((e=>{if(e){const t=e=>this.#tn(e);return e.addEventListener("keydown",t,!0),()=>e.removeEventListener("keydown",t,!0)}})))}#tn(e){if("ArrowUp"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.previousElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.previousElementSibling;n||e.preventDefault()}}if("ArrowDown"===e.key){const t=this.editor.getRootElement().querySelector("[data-lexical-cursor]");if(t){let n=t.nextElementSibling;for(;n&&n.hasAttribute("data-lexical-cursor");)n=n.nextElementSibling;n||e.preventDefault()}}}
16#Qt(){this.#nn(),this.#rn(),this.previouslySelectedKeys=this.#Kt,this.currentlySelectedKeys=null}#nn(){for(const e of this.previouslySelectedKeys)if(!this.#Kt.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.remove("node--selected")}}#rn(){for(const e of this.#Kt)if(!this.previouslySelectedKeys.has(e)){const t=this.editor.getElementByKey(e);t&&t.classList.add("node--selected")}}#Vt(e){return e.shiftKey?this.#in((e=>(this.#on(e,"forward").modify("extend",!0,"character"),!0))):this.#in((e=>e.selectPrevious()))||this.#Xt(this.nodeBeforeCursor)}#qt(e){return e.shiftKey?this.#in((e=>(this.#on(e,"forward").modify("extend",!1,"character"),!0))):this.#in((e=>e.selectNext(0,0)))||this.#Xt(this.nodeAfterCursor)}#Gt(){return this.#in((e=>e.getTopLevelElement().selectPrevious()))||this.#Xt(this.topLevelNodeBeforeCursor)}#jt(){return this.#in((e=>e.getTopLevelElement().selectNext(0,0)))||this.#Xt(this.topLevelNodeAfterCursor)}#in(e){const t=this.hasNodeSelection?Qr():null,n=Ir(t)?t.getNodes()[0]:void 0;return!!n&&e(n)}#on(e,t="forward"){if(ji(e)){const[n,r]="forward"===t?[0,1]:[1,0],i=e.getIndexWithinParent();return e.getParent().select(i+n,i+r)}}async#en(){this.editor.update((()=>{const e=this.#sn();e&&this.#ln(e)}))}#sn(){const e=Qr();return e?Ir(e)?this.#an(e):Fr(e)?this.#cn(e):null:null}#an(e){const t=e.getNodes();return t.length>0?t[0].getTopLevelElement():null}#cn(e){return e.anchor.getNode().getTopLevelElement()}#Lt(e){const t=e.getTopLevelElementOrThrow();let n=Lt$2(t)?t:null;if(!n){let t=e.getParent();for(;t;){if(Lt$2(t)){n=t;break}t=t.getParent()}}return n}#ln(e){const t=e.getNextSibling();t?t.selectStart():this.#un()}#un(){const e=Zo(),t=eo();e.append(t),t.selectStart()}#Xt(e){if(ji(e)){Os(Jn);const t=$createNodeSelectionWith(e);return es(t),t}return!1}#Zt(e){if(e&&this.#dn())return!0;const t=e?this.nodeBeforeCursor:this.nodeAfterCursor;if(!ji(t))return!1;if(this.#hn(t))return!0;this.#gn();const n=this.#Xt(t);return Boolean(n)}#dn(){const e=Qr();if(!Fr(e)||!e.isCollapsed())return!1;const t=At$2(e.anchor.getNode(),ge$2);if(!t)return!1;if(!$isListItemStructurallyEmpty(t))return!1;const n=t.getNextSibling();if(!n)return!1;const r=t.getPreviousSibling(),i=At$2(t,me$2);if(!i)return!1;if(r)r.selectEnd(),t.remove();else if(Mt$2(i.getParent()))n.selectStart(),t.remove();else{const e=eo();i.insertBefore(e),t.remove(),e.selectStart()}return!0}#hn(e){const t=Qr()?.anchor?.getNode(),n=t&&At$2(t,ge$2);if(!n)return!1;if(n.isParentOf(e))return!1;const r=At$2(n,me$2);if(!r)return!1;const i=eo();
16return n.getChildren().forEach((e=>i.append(e))),1===r.getChildrenSize()?(r.insertBefore(i),r.remove()):(r.insertBefore(i),n.remove()),i.selectStart(),!0}#gn(e=Qr()?.anchor){const t=e?.getNode();Wi(t)&&t?.isEmpty()&&t.remove()}#wt(){const e=Qr();if(!e||!e.isCollapsed())return null;const t=window.getSelection();return t&&0!==t.rangeCount?t.getRangeAt(0):null}#kt(e){let t=e.getBoundingClientRect();if(this.#Nt(t)){const n=this.#pn(e);t=n.getBoundingClientRect(),this.#fn(n),n.remove()}return t}#Nt(e){return 0===e.width&&0===e.height||0===e.top&&0===e.left}#pn(e){const t=this.#mn();return e.insertNode(t),t}#mn(){const e=document.createElement("span");return e.textContent="\u200b",e.style.display="inline-block",e.style.width="1px",e.style.height="1em",e.style.lineHeight="normal",e.setAttribute("nonce",getNonce()),e}#fn(e){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.setStartAfter(e),n.collapse(!0),t.addRange(n)}#At(e,t){const n=this.editor.getRootElement().getBoundingClientRect(),r=e.left-n.left;let i=e.top-n.top;const o=this.#yn(t);return isNaN(o)||(i+=o),{x:r,y:i,fontSize:o}}#yn(e){const t=window.getSelection().anchorNode,n=this.#bn(t);if(n instanceof HTMLElement){const e=window.getComputedStyle(n);return parseFloat(e.fontSize)}return 0}#bn(e){return e?.nodeType===Node.TEXT_NODE?e.parentElement:e}#It(){const e=Qr();if(!Fr(e)||!e.isCollapsed())return{anchorNode:null,offset:0};const{anchor:t}=e;return{anchorNode:t.getNode(),offset:t.offset}}#Ft(e,t){return t===e.getTextContentSize()?this.#Mt(e):null}#Mt(e){const t=e.getNextSibling();if(ji(t))return t;if(null!=t)return null;const n=e.getParent();return n?n.getNextSibling():null}#Pt(e,t){return t<e.getChildrenSize()?e.getChildAtIndex(t):this.#Rt(e)} 17#Bt(e,t){return 0===t?this.#Wt(e):null}#Wt(e){const t=e.getPreviousSibling();if(ji(t))return t;if(null!=t)return null;const n=e.getParent();return n?n.getPreviousSibling():null}#Ht(e,t){return t>0?e.getChildAtIndex(t-1):this.#zt(e)}#Rt(e){let t=e;for(;t&&null==t.getNextSibling();)t=t.getParent();return t?t.getNextSibling():null}#zt(e){let t=e;for(;t&&null==t.getPreviousSibling();)t=t.getParent();return t?t.getPreviousSibling():null}#Ut(e){return this.#$n(e,"first")}#Dt(e){return this.#$n(e,"last")}#$n(e,t){const n=e.getTopLevelElement();if(!n)return!1;const r=this.editor.getElementByKey(n.getKey());if(!r)return!1;const i=window.getSelection();if(!i?.rangeCount)return!1;const o=this.#kt(i.getRangeAt(0));if(!o||this.#Nt(o))return!1;const s=this.#_n(r,t);if(!s||this.#Nt(s))return!1;const l=s.height>0?.5*s.height:5;return Math.abs(o.top-s.top)<l}#_n(e,t){const n=document.createTreeWalker(e,4);let r;if("first"===t)r=n.nextNode();else for(;n.nextNode();)r=n.currentNode;if(!r||0===r.length)return null;const i=document.createRange();return"first"===t?(i.setStart(r,0),i.setEnd(r,1)):(i.setStart(r,r.length-1),i.setEnd(r,r.length)),i.getBoundingClientRect()}}class EditorConfiguration{#se;#Se;constructor(e){this.#se=e,this.#Se=new Configuration(Lexxy.presets.get("default"),Lexxy.presets.get(e.preset),this.#Cn)}get(e){return this.#Se.get(e)}get#Cn(){const e={};for(const t of this.#xn){const n=dasherize(t);this.#se.hasAttribute(n)&&(e[t]=this.#Sn(n))}return e}get#xn(){return Object.keys(Lexxy.presets.get("default"))}#Sn(e){const t=this.#se.getAttribute(e);try{return JSON.parse(t)}catch{return t}}}class ImageGalleryNode extends Bi{$config(){return this.config("image_gallery",{extends:Bi})}static transform(){return e=>{e.unwrapEmptyNode()||e.replaceWithSingularChild()||e.splitAroundInvalidChild()}}static importDOM(){return{div:e=>this.#Tn(e)?{conversion:()=>({node:$createImageGalleryNode()}),priority:2}:null}}static canCollapseWith(e){return $isImageGalleryNode(e)||this.isValidChild(e)}static isValidChild(e){return $isActionTextAttachmentNode(e)&&e.isPreviewableImage}static#Tn(e){const t=e.querySelectorAll(`:scope > :is(${this.#En.join()})`);return""===e.textContent.trim()&&t.length>0&&e.children.length===t.length}static get#En(){return Object.keys(ActionTextAttachmentNode.importDOM())}createDOM(){const e=document.createElement("div");return e.className=this.#vn,e}updateDOM(e,t){return t.className=this.#vn,!1}canBeEmpty(){return!0}collapseAtStart(e){return!0}insertNewAfter(e,t){if(e.anchor.getNode().is(this)&&e.anchor.offset==this.getChildrenSize()-1){const e=eo();return this.insertAfter(e,!1),e.insertAfter(this.getLastChild(),!1),e.selectEnd(),null}const n=$createImageGalleryNode();return this.insertAfter(n,t),n}getImageAttachments(){return this.getChildren().filter($isActionTextAttachmentNode)}exportDOM(){const e=document.createElement("div");return e.className=this.#vn,{element:e}}collapseWith(e,t){return!!ImageGalleryNode.canCollapseWith(e)&&(t?$t$2(this,e):this.append(e),Ot$3(this,ImageGalleryNode.isValidChild),!0)}unwrapEmptyNode(){if(this.isEmpty()){const e=eo();return this.replace(e)}}replaceWithSingularChild(){if(this.#wn){const e=this.getFirstChild();return this.replace($makeSafeForRoot(e))}}splitAroundInvalidChild(){for(const e of jt$2(this)){if(ImageGalleryNode.isValidChild(e))continue;const t=$makeSafeForRoot(e),[n,r]=this.splitAtIndex(t.getIndexWithinParent());n.insertAfter(t),t.selectEnd(),r.isEmpty()&&r.remove();break}}splitAtIndex(e){return Us(this,e)}get#wn(){return 1===this.getChildrenSize()}get#vn(){return`attachment-gallery attachment-gallery--${this.getChildrenSize()}`}}class Uploader{#kn;static for(e,t,n={}){return new(GalleryUploader.handle(e,t)?GalleryUploader:Uploader)(e,t,n)}constructor(e,t,n={}){this.#kn=t,this.options=n,this.editorElement=e,this.contents=e.contents,this.selection=e.selection}get files(){return Array.from(this.#kn)}$uploadFiles(){this.$createUploadNodes(),this.$insertUploadNodes()}$createUploadNodes(){this.nodes=this.files.map((e=>this.#Nn(e)))}#Nn(e){return this.options.pending?this.contents.$createPendingUploadNode(e):this.contents.$createUploadNode(e)}$insertUploadNodes(){this.contents.insertAtCursor(...this.nodes)}}class GalleryUploader extends Uploader{#An;static handle(e,t){return this.isMultipleImageUpload(t)||this.gallerySelection(e.selection)}static isMultipleImageUpload(e){let t=0;for(const n of e)if(isPreviewableImage(n.type)&&t++,t>1)return!0;return!1}static gallerySelection(e){return e.isOnPreviewableImage||this.selectionIsAfterGalleryEdge(e)}static selectionIsAfterGalleryEdge(e){return e.isAtNodeStart&&ImageGalleryNode.canCollapseWith(e.nodeBeforeCursor)}$insertUploadNodes(){this.#Ln(),this.#On(),this.#In()}#Ln(){this.selection.isOnPreviewableImage?this.#An=$findOrCreateGalleryForImage(this.selection.previewableImageNode):this.#Fn?this.#An=$findOrCreateGalleryForImage(this.selection.nodeBeforeCursor):(this.#An=$createImageGalleryNode(),this.contents.insertAtCursor(this.#An))}get#Fn(){return this.constructor.selectionIsAfterGalleryEdge(this.selection)}get#Pn(){const{node:e}=this.selection.selectedNodeWithOffset();return e}get#Rn(){if(this.#Fn)return this.#An.getChildrenSize();const e=Qr()?.anchor,t=e?.getNode().is(this.#An);if(t)return e.offset;const n=this.#Pn,r=this.#An.isParentOf(n)&&n.getIndexWithinParent();return!1!==r?r+1:0}get#Mn(){return this.nodes.filter((e=>ImageGalleryNode.isValidChild(e)))}get#Dn(){return this.nodes.filter((e=>!ImageGalleryNode.isValidChild(e)))}#On(){this.#An.splice(this.#Rn,0,this.#Mn)}#In(){let e=this.#An;for(const t of this.#Dn)e.insertAfter(t),e=t}}class ActionTextAttachmentUploadNode extends ActionTextAttachmentNode{static getType(){return"action_text_attachment_upload"}static clone(e){return new ActionTextAttachmentUploadNode({...e},e.__key)}static importJSON(e){return new ActionTextAttachmentUploadNode({...e})}static importDOM(){return null}constructor(e={},t){const{file:n,uploadUrl:r,blobUrlTemplate:i,progress:o,width:s,height:l,uploadError:a,fileName:c,contentType:u}=e;super({...e,contentType:n?.type??u},t),this.file=n??null,this.fileName=n?.name??c,this.uploadUrl=r,this.blobUrlTemplate=i,this.progress=o??null,this.width=s,this.height=l,this.uploadError=a}createDOM(){if(this.uploadError)return this.createDOMForError();this.#Bn();const e=this.isPreviewableAttachment&&null!=this.uploadUrl&&null!=this.file,t=this.createAttachmentFigure(e);
17if(e){const e=t.appendChild(this.#Fe());loadFileIntoImage(this.file,e).then((e=>this.#Hn(e)))}else t.appendChild(this.#Re());return t.appendChild(this.#zn()),t.appendChild(this.#Wn()),t}updateDOM(e,t){if(this.uploadError!==e.uploadError)return!0;if(e.progress!==this.progress){t.querySelector("progress").value=this.progress??0}return!1}exportDOM(){return{element:null}}exportJSON(){return{...super.exportJSON(),type:"action_text_attachment_upload",version:1,fileName:this.fileName,contentType:this.contentType,uploadUrl:this.uploadUrl,blobUrlTemplate:this.blobUrlTemplate,progress:this.progress,width:this.width,height:this.height,uploadError:this.uploadError}}get#Un(){return null!==this.progress}#Fe(){return createElement("img")}#Re(){return createElement("span",{className:"attachment__icon",textContent:this.#Kn()})}#Kn(){return(this.fileName||"").split(".").pop().toLowerCase()}#zn(){const e=createElement("figcaption",{className:"attachment__caption"}),t=createElement("span",{className:"attachment__name",textContent:this.caption||this.fileName||""});if(e.appendChild(t),this.file){const t=createElement("span",{className:"attachment__size",textContent:bytesToHumanSize(this.file.size)});e.appendChild(t)}return e}#Wn(){return createElement("progress",{value:this.progress??0,max:100})}#Hn({width:e,height:t}){this.#Vn||this.patchAndRewriteHistory({width:e,height:t})}get#Vn(){return Boolean(this.width&&this.height)}async#Bn(){if(this.#Un)return;if(!this.uploadUrl)return;if(!this.file)return;this.#qn();const{DirectUpload:e}=await import("@rails/activestorage"),t=new e(this.file,this.uploadUrl,this);t.delegate=this.#Gn(),this.#jn("lexxy:upload-start",{file:this.file}),t.create(((e,t)=>{this.#Zn(),e?(this.#jn("lexxy:upload-end",{file:this.file,error:e}),this.#Qn(e)):(this.#jn("lexxy:upload-end",{file:this.file,error:null}),this.editor.update((()=>{this.$showUploadedAttachment(t)})))}))}#Gn(){const e=Lexxy.global.get("authenticatedUploads");return{directUploadWillCreateBlobWithXHR:t=>{e&&(t.withCredentials=!0)},directUploadWillStoreFileWithXHR:t=>{e&&(t.withCredentials=!0),this.#Yn(t);const n=e=>this.#Jn(e,t);t.upload.addEventListener("progress",n)}}}#Zn(){this.#se?.uploadRequests.forget(this.getKey())}#Yn(e){this.#se?.uploadRequests.track(this.getKey(),e)}get#se(){return this.editor.getRootElement()?.closest("lexxy-editor")}#qn(){this.#Xn(1)}#Jn(e,t){const n=Math.round(e.loaded/e.total*100);try{this.#Xn(n),this.#jn("lexxy:upload-progress",{file:this.file,progress:n})}catch{t.abort()}}#Xn(e){this.patchAndRewriteHistory({progress:e})}#Qn(e){console.warn(`Upload error for ${this.file?.name??"file"}: ${e}`),this.patchAndRewriteHistory({uploadError:!0})}$showUploadedAttachment(e){const t=this.isPreviewableImage&&this.file?URL.createObjectURL(this.file):null,n=this.#er(e,t);return this.replaceAndRewriteHistory(n),n.getKey()}#er(e,t){return new AttachmentNodeConversion(this,e,t).toAttachmentNode()}#jn(e,t){const n=this.editor.getElementByKey(this.getKey());n&&dispatch(n,e,t)}}class AttachmentNodeConversion{constructor(e,t,n){this.uploadNode=e,this.blob=t,this.previewSrc=n}toAttachmentNode(){return new ActionTextAttachmentNode({...this.uploadNode,...this.#tr,src:this.#nr,previewSrc:this.previewSrc,pendingPreview:this.blob.previewable&&!this.uploadNode.isPreviewableImage})}get#tr(){const{blob:e}=this;return{sgid:e.attachable_sgid,altText:e.filename,contentType:e.content_type,fileName:e.filename,fileSize:e.byte_size,previewable:e.previewable,previewStatusUrl:e.preview_status_url}}get#nr(){return this.blob.previewable?this.blob.url:this.#rr}get#rr(){return this.uploadNode.blobUrlTemplate.replace(":signed_id",this.blob.signed_id).replace(":filename",encodeURIComponent(this.blob.filename))}}class BaseNodeInserter{constructor(e){this.selection=e}}class CodeNodeInserter extends BaseNodeInserter{static handles(e){return At$2(e.anchor?.getNode(),z$1)}insertNodes(e){this.selection.isCollapsed()||this.selection.removeText(),j$6(this.selection);const t=this.selection.focus.getNode(),n=At$2(t,z$1),r=lc(n,(t.is(n)?0:t.getIndexWithinParent())+1,"previous"),i=new Set(e.filter((e=>e.isAttached()))),o=[];for(const t of e){if(i.has(t)){if(!t.isAttached())continue}else if(!this.#ir(t)){o.push(t);continue}r.getNodeAtCaret()&&Wi(t)&&r.insert(or()),r.insert(this.#or(t))}const s=this.#sr(n,o)??r.getNodeAtCaret();s?.selectEnd()}#ir(e){return Tr(e)||sr(e)}#sr(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return t.at(-1)}#or(e){return sr(e)?e:(e.remove(),kr(e.getTextContent()))}}class ShadowRootNodeInserter extends BaseNodeInserter{static handles(e){return $isShadowRoot(e?.anchor?.getNode())}insertNodes(e){const t=this.selection.anchor.getNode(),n=eo();t.append(n),n.selectStart().insertNodes(e)}}class NodeSelectionNodeInserter extends BaseNodeInserter{static handles(e){return Ir(e)&&e.getNodes().length>0}insertNodes(e){let t=this.selection.getNodes().at(-1);for(const n of e){const e=this.#lr(t)?$makeSafeForRoot(n):n;t=t.insertAfter(e)}}#lr(e){return e.is(e.getTopLevelElement())}}class ListItemNodeInserter extends BaseNodeInserter{static handles(e){return Fr(e)&&At$2(e.anchor.getNode(),ge$2)}insertNodes(e){e.some((e=>this.#ar(e)))?this.#cr(e):this.selection.insertNodes(e)}#cr(e){this.selection.isCollapsed()||this.selection.removeText();const t=this.selection.anchor.getNode(),n=this.#ur(t);if(!n)return void this.selection.insertNodes(e);const r=this.#dr(t,n),[i,o]=Us(n,this.#hr(r));r&&$isBlankNode(r)&&r.remove();let s=i??o;for(const t of e)s.insertAfter(t),s=t;this.#gr(i),this.#gr(o),e.at(-1).selectNext()}#hr(e){if(!e)return this.selection.anchor.offset;const t=$isBlankNode(e)?e.getPreviousSibling():e;return t?t.getIndexWithinParent()+1:0}#ur(e){return[e,...e.getParents()].reverse().find(Se$1)}#dr(e,t){return[e,...e.getParents()].find((e=>pe$2(e)&&e.getParent()?.is(t)))}#gr(e){Se$1(e)&&e.isEmpty()&&e.remove()}#ar(e){return ji(e)&&!e.isInline()}}class BlockContainerNodeInserter extends BaseNodeInserter{static handles(e){return $hasPointOnBlockContainer(e)}insertNodes(e){St$3(this.selection),this.selection.insertNodes(e)}}
17const INSERTERS=[CodeNodeInserter,ShadowRootNodeInserter,NodeSelectionNodeInserter,ListItemNodeInserter,BlockContainerNodeInserter];BaseNodeInserter.for=e=>{const t=INSERTERS.find((t=>t.handles(e)));return t?new t(e):e};class OfficeFormatter{constructor(e){this.doc=e}format(){for(const e of this.#pr())this.#fr(e)}#pr(){const e=[],t=new Set;for(const n of this.doc.querySelectorAll("p[style*='mso-list']")){if(t.has(n)||null===this.#mr(n))continue;const r=[];let i=n;for(;i;)r.push(i),t.add(i),i=this.#yr(i);e.push(r)}return e}#yr(e){let t=e.nextSibling;for(;t&&this.#br(t);)t=t.nextSibling;return t&&t.nodeType===Node.ELEMENT_NODE&&null!==this.#mr(t)?t:null}#br(e){return e.nodeType===Node.COMMENT_NODE||e.nodeType===Node.TEXT_NODE&&""===e.textContent.trim()}#fr(e){const t=e.map((e=>this.#mr(e))),n=Math.min(...t),r=[],i=[];e.forEach(((e,o)=>{const s=t[o]-n+1,l=this.#$r(e);for(;i.length>s;)i.pop();for(i.length===s&&i[s-1].tagName!==l.toUpperCase()&&i.pop();i.length<s;){const e=this.doc.createElement(l);0===i.length?r.push(e):this.#_r(i[i.length-1]).appendChild(e),i.push(e)}i[i.length-1].appendChild(this.#Cr(e))})),e[0].replaceWith(...r);for(const t of e.slice(1))t.remove()}#_r(e){return e.lastElementChild||e.appendChild(this.doc.createElement("li")),e.lastElementChild}#$r(e){const t=e.querySelector("[style*='mso-list:Ignore']"),n=t?.textContent||"";return/\d/.test(n)||/^\(?[A-Za-z]+[.)]/.test(n)?"ol":"ul"}#Cr(e){for(const t of e.querySelectorAll("[style*='mso-list:Ignore']"))t.remove();const t=this.doc.createElement("li");return t.append(...e.childNodes),t}#mr(e){const t=/mso-list:[^;"']*\blevel(\d+)/.exec(e.getAttribute("style")||"");return t?parseInt(t[1],10):null}}const PRESERVABLE_STYLES={p:["margin-top","margin-bottom"]};class PastedContentFormatter{constructor(e){this.doc=e}format(){return this.#xr(),this.#Sr(),this.#Tr(),this.#Er(),new OfficeFormatter(this.doc).format(),this.#vr(),this.#wr(),this.#kr(),this.#Nr(),this.doc}#xr(){const e=this.#Ar();if(0!==e.length)for(const[t,n]of Object.entries(PRESERVABLE_STYLES))for(const r of this.doc.querySelectorAll(t))this.#Lr(r,n,e)}#Sr(){for(const e of this.doc.querySelectorAll("style"))e.remove()}#Tr(){for(const e of this.doc.querySelectorAll("a")){const t=e.getAttribute("href")||"";""!==t&&"#"!==t||e.replaceWith(...e.childNodes)}}#Er(){for(const e of this.doc.querySelectorAll("td, th"))e.style.removeProperty("background-color"),e.style.removeProperty("background"),e.style.removeProperty("color")}#vr(){for(const e of this.doc.querySelectorAll("ol, ul")){let t=this.#Or(e);for(;t;)t.replaceWith(...t.childNodes),t=this.#Or(e)}}#Or(e){for(const t of e.children)if("LI"!==t.tagName&&!this.#Ir(t)&&this.#Fr(t))return t;return null}#wr(){for(const e of this.doc.querySelectorAll("ol, ul"))for(const t of Array.from(e.children)){if("OL"!==t.tagName&&"UL"!==t.tagName)continue;const e=t.previousElementSibling;e&&"LI"===e.tagName&&e.appendChild(t)}}#kr(){for(const e of this.doc.querySelectorAll("ol, ul")){let t=this.#Pr(e);for(;t;)this.#Fr(t)?t.replaceWith(...t.childNodes):t.remove(),t=this.#Pr(e)}}#Ar(){const e=Array.from(this.doc.querySelectorAll("style"),(e=>e.textContent)).join("\n");if(""===e.trim())return[];const t=new CSSStyleSheet;t.replaceSync(e);const n=[];for(const e of t.cssRules)e instanceof CSSStyleRule&&n.push(e);return n}#Lr(e,t,n){for(const r of t)if(""===e.style.getPropertyValue(r)){const t=this.#Rr(n,e,r);t&&this.#Mr(e,r,t)}}#Rr(e,t,n){const r=new Set;for(const i of e){const e=i.style.getPropertyValue(n);""!==e&&t.matches(i.selectorText)&&r.add(e)}return 1===r.size?r.values().next().value:null}#Mr(e,t,n){const r=e.getAttribute("style"),i=`${t}:${n}`;null===r||""===r.trim()?e.setAttribute("style",i):e.setAttribute("style",`${r.replace(/;\s*$/,"")};${i}`)}#Pr(e){for(const t of e.childNodes)if(t.nodeType!==Node.ELEMENT_NODE||"LI"!==t.tagName)return t;return null}#Ir(e){return e.nodeType===Node.ELEMENT_NODE&&("OL"===e.tagName||"UL"===e.tagName)}#Fr(e){return e.nodeType===Node.ELEMENT_NODE&&null!==e.querySelector("li")}#Nr(){for(const e of this.doc.querySelectorAll("img[data-emoji]")){const t=e.dataset.emoji;t===e.alt&&e.replaceWith(t)}}}class Contents{constructor(e){this.editorElement=e,this.editor=e.editor}dispose(){this.editorElement=null,this.editor=null}get selection(){return this.editorElement.selection}insertHtml(e,{tag:t}={}){this.insertDOM(parseHtml(e),{tag:t})}insertDOM(e,{tag:t}={}){this.editor.update((()=>{Es(jn)&&this.#Dr(e);const t=this.editorElement.$generateNodesFromDOM(e);Es(jn)&&this.#Br(t)||this.#Hr(t)||this.insertAtCursor(...t)}),{tag:t})}insertText(e,{tag:t}={}){this.editor.update((()=>{const t=eo();
17e.split(/\r\n|\r|\n/).forEach(((e,n)=>{n>0&&t.append(or()),t.append(kr(e))})),this.insertAtCursor(t)}),{tag:t})}insertAtCursor(...e){const t=this.#zr();BaseNodeInserter.for(t).insertNodes(e)}applyParagraphFormat(){const e=Qr();Fr(e)&&($expandSelectionToLineBreaksAndSplitAtEdges(e,(e=>Nt$2(e))),H$6(e,(()=>eo())))}applyHeadingFormat(e){const t=Qr();Fr(t)&&($expandSelectionToLineBreaksAndSplitAtEdges(t),H$6(t,(()=>Jt$2(e))))}applyUnorderedListFormat(){this.#Wr("bullet",Ee$2)}applyOrderedListFormat(){this.#Wr("number",Oe$1)}clearFormatting(){const e=Qr();Fr(e)&&(D$3((e=>{e.setFormat(0),e.setStyle("")})),Q$6(null),this.#Ur(e).filter(Mt$2).forEach((e=>this.#Kr(e))),H$6(e,(()=>eo())))}toggleCodeBlock(){const e=Qr();if(!Fr(e))return;if(this.#Vr(I$1("plain")))return;const t=this.#qr(e);if(t.every(W$1))t.forEach((e=>this.#Gr(e)));else{$expandSelectionToLineBreaksAndSplitAtEdges(e);const t=this.#jr(this.#qr(e));if(0===t.length)return;const n=I$1("plain");t.at(-1).insertAfter(n),n.selectEnd(),this.insertAtCursor(...t)}}toggleBlockquote(){const e=Qr();if(!Fr(e))return;if(this.#Vr(St$1()))return;const t=this.#Ur(e);if(t.length>0&&t.every(Mt$2))t.forEach((e=>this.#Kr(e)));else{t.filter(Mt$2).forEach((e=>this.#Kr(e))),$expandSelectionToLineBreaksAndSplitAtEdges(e);const n=this.#Ur(e);if(0===n.length)return;const r=St$1();n[0].insertBefore(r),n.forEach((e=>r.append(e)))}}hasSelectedText(){let e=!1;return this.editor.read((()=>{const t=Qr();e=Fr(t)&&!t.isCollapsed()})),e}createLink(e){let t=null;return this.editor.update((()=>{const n=kr(e),r=$$2(e);r.append(n);const i=Qr();Fr(i)&&(BaseNodeInserter.for(i).insertNodes([r]),t=r.getKey())})),t}createLinkWithSelectedText(e){this.hasSelectedText()&&this.editor.update((()=>{Q$6(null),Q$6(e)}))}textBackUntil(e){let t="";return this.editor.getEditorState().read((()=>{const n=Qr();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Tr(i))return;const o=i.getTextContent(),s=r.offset,l=o.slice(0,s).lastIndexOf(e);-1!==l&&(t=o.slice(l+e.length,this.#Zr(o,s)))})),t}#Zr(e,t){for(let n=t;n<e.length;n++)if(this.#Qr(e,n))return n;return e.length}#Qr(e,t){const n=e[t];return!!/\s/.test(n)||!!/\p{P}/u.test(n)&&!(this.#Yr(e[t-1])&&this.#Yr(e[t+1]))}#Yr(e){return null!=e&&/[\p{L}\p{N}]/u.test(e)}containsTextBackUntil(e){let t=!1;return this.editor.getEditorState().read((()=>{const n=Qr();if(!n||!n.isCollapsed())return;const r=n.anchor,i=r.getNode();if(!Tr(i))return;const o=i.getTextContent(),s=r.offset,l=o.slice(0,s);t=l.includes(e)})),t}replaceTextBackUntil(e,t){t=Array.isArray(t)?t:[t];const{anchorNode:n,offset:r}=this.#Jr();if(!n)return;const i=this.#Xr(n,r,e);-1!==i&&this.#ei(n,i,e,t)}uploadFiles(e,{selectLast:t}={}){if(!this.editorElement)return;if(!this.editorElement.supportsAttachments)return void console.warn("This editor does not supports attachments (it's configured with [attachments=false])");const n=Array.from(e).filter((e=>this.editorElement.acceptsFile(e)));this.editor.update((()=>{const e=Uploader.for(this.editorElement,n);if(e.$uploadFiles(),t&&e.nodes?.length){e.nodes.at(-1).selectEnd(),this.#ti()}}))}$createUploadNode(e){return $createActionTextAttachmentUploadNode({file:e,uploadUrl:this.editorElement.directUploadUrl,blobUrlTemplate:this.editorElement.blobUrlTemplate,contentType:e.type})}$createPendingUploadNode(e){return $createActionTextAttachmentUploadNode({file:e,uploadUrl:null,blobUrlTemplate:this.editorElement.blobUrlTemplate,contentType:e.type})}insertPendingAttachment(e){if(!this.editorElement.supportsAttachments)return null;let t=null;return this.editor.update((()=>{const n=this.$createPendingUploadNode(e);this.insertAtCursor(n),t=n.getKey()})),t?this.#ni(t):null}insertPendingAttachments(e){const t=Array.from(e);if(!this.editorElement.supportsAttachments||0===t.length)return[];let n=[];return this.editor.update((()=>{const e=Uploader.for(this.editorElement,t,{pending:!0});e.$uploadFiles(),n=(e.nodes??[]).map((e=>e.getKey()))})),n.map((e=>this.#ni(e)))}#ni(e){const t=this.editor;let n=e;return{setAttributes(e){t.update((()=>{const t=Yo(n);if(!(t instanceof ActionTextAttachmentUploadNode))return;const r=t.$showUploadedAttachment(e);r&&(n=r)}),{tag:Jn})},setUploadProgress(e){t.update((()=>{const t=Yo(n);t instanceof ActionTextAttachmentUploadNode&&(t.getWritable().progress=e)}),{tag:Jn})},remove(){t.update((()=>{const e=Yo(n);e&&e.remove()}))}}}replaceNodeWithHTML(e,t,n={}){this.editor.update((()=>{const r=Yo(e);if(!r)return;const i=Qr();let o=!1;if(Fr(i)){const e=i.getNodes();o=e.includes(r)||e.some((e=>e.getParent()===r)),o&&es(null)}const s=n.attachment?this.#ri(t,n.attachment):this.#ii(t);r.replace(s),o&&s.selectEnd()}))}insertHTMLBelowNode(e,t,n={}){this.editor.update((()=>{const r=Yo(e);if(!r)return;const i=r.getTopLevelElement()||r,o=n.attachment?this.#ri(t,n.attachment):this.#ii(t);
17i.insertAfter(o)}))}#zr(){const e=Qr();return Ir(e)&&0===e.getNodes().length?Zo().selectEnd():e??Zo().selectEnd()}#Dr(e){new PastedContentFormatter(e).format()}#Br(e){return this.editor.dispatchCommand(oe$6,{nodes:e,selection:Qr()})}#Vr(e){const t=Qr();if(!Fr(t))return!1;const n=t.anchor.getNode();return!!Is(n)&&(n.append(e),e.selectEnd(),!0)}#Gr(e){const t=e.getChildren(),n=[[]];for(const e of t)sr(e)?n.push([]):n[n.length-1].push(e.getTextContent());for(const t of n){const n=eo(),r=t.join("");r&&n.append(kr(r)),e.insertBefore(n)}e.remove()}#Wr(e,t){this.selection.isInsideBlockQuote?this.#oi(e):(this.#si(),this.editor.dispatchCommand(t))}#oi(e){for(const t of $consecutiveSiblingGroups(this.#li()))this.#ai(t,e)}#li(){const e=Qr();if(!Fr(e))return[];return this.#jr(this.#qr(e)).filter((e=>Mt$2(e.getParent())))}#ai(e,t){const n=Te$1(t);e[0].insertBefore(n);for(const t of e){const e=fe$2();Se$1(t)?e.append(...t.getChildren().flatMap((e=>e.getChildren()))):e.append(...t.getChildren()),n.append(e),t.remove()}}#si(){if(this.selection.isInsideList)return;const e=Qr();Fr(e)&&($expandSelectionToLineBreaksAndSplitAtEdges(e),$splitSelectedParagraphsAtInnerLineBreaks(e))}#qr(e){const t=new Set;for(const n of e.getNodes())t.add(Nt$2(n));return Array.from(t)}#Ur(e){const t=new Set;for(const n of e.getNodes()){const e=n.getTopLevelElement();e&&t.add(e)}return Array.from(t)}#jr(e){return e.filter((t=>e.every((e=>e===t||!t.getParents().includes(e)))))}#Hr(e){if(e.every($isActionTextAttachmentNode)){const t=Uploader.for(this.editorElement,[]);return t.nodes=e,t.$insertUploadNodes(),!0}}#Kr(e){const t=e.getChildren();0==t.length?e.insertBefore(eo()):t.forEach((t=>{if(Tr(t)&&""!==t.getTextContent().trim()){const n=eo();n.append(t),e.insertBefore(n)}else sr(t)||e.insertBefore(t)})),e.remove()}#Jr(){const e=Qr();if(!e||!e.isCollapsed())return{anchorNode:null,offset:0};const t=e.anchor,n=t.getNode();return Tr(n)?{anchorNode:n,offset:t.offset}:{anchorNode:null,offset:0}}#Xr(e,t,n){return 0===t?-1:e.getTextContent().lastIndexOf(n,t-1)}#ei(e,t,n,r){const i=e.getTextContent(),o=i.slice(0,t),s=i.slice(t+n.length),l=this.#ci(e,o),a=this.#ci(e,s||" ");e.replace(l);this.#ui(l,r).insertAfter(a),this.#di(a.getParentOrThrow());const c=s?0:1;a.select(c,c)}#ci(e,t){return kr(t).setFormat(e.getFormat()).setDetail(e.getDetail()).setMode(e.getMode()).setStyle(e.getStyle())}#ui(e,t){let n=e;for(const e of t)n.insertAfter(e),n=e;return n}#di(e){if(no(e)&&this.editorElement.supportsMultiLine){const t=e.getChildren(),n=t[t.length-1],r=t[t.length-2];Tr(n)&&""===n.getTextContent()&&r&&!Tr(r)&&e.append(or())}}#ri(e,t={}){const n="object"==typeof t?t:{},r=n.contentType||"text/html";return this.editorElement.permitsAttachmentContentType(r)?new CustomActionTextAttachmentNode({sgid:n.sgid||null,contentType:r,innerHtml:e}):this.#ii(e)}#ii(e){return this.editorElement.$generateNodesFromDOM(parseHtml(e))[0]||eo()}#ti(){const e=Qr();if(!Fr(e))return;const t=e.anchor.getNode();if(!$isShadowRoot(t))return;const n=eo();t.append(n),n.selectStart()}}var T=L(),I={exec:()=>null},m={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")},be=/^(?:[ \t]*(?:\n|$))+/,Re=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Te=/^ {0,3}(`{3,}
vendor: 4,378 bytes, line 17
17(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Oe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,F=/(?:[*+-]|\d{1,9}[.)])/,ie=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=h(ie).replace(/bull/g,F).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(),we=h(ie).replace(/bull/g,F).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(),j=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ye=/^[^\n]+/,Q=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Pe=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Q).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Se=h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,F).getRegex(),v="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",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$e=h("^ {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",U).replace("tag",v).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ae=h(j).replace("hr",E).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",v).getRegex(),_e=h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ae).getRegex(),K={blockquote:_e,code:Re,def:Pe,fences:Te,heading:Oe,hr:E,html:$e,lheading:oe,list:Se,newline:be,paragraph:ae,table:I,text:ye},re=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).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",v).getRegex(),Le={...K,lheading:we,table:re,paragraph:h(j).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).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",v).getRegex()},Me={...K,html:h("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",U).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:I,lheading:/^(.+?)\n {0,3}
vendor: 5,897 bytes, lines 17-18
17(=+|-+) *(?:\n+|$)/,paragraph:h(j).replace("hr",E).replace("heading"," *#{1,6} *[^\n]").replace("lheading",oe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex() 18},ze=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ae=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,le=/^( {2,}|\\)\n(?!\s*$)/,Ie=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,D=/[\p{P}\p{S}]/u,W=/[\s\p{P}\p{S}]/u,ue=/[^\s\p{P}\p{S}]/u,Ee=h(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,W).getRegex(),pe=/(?!~)[\p{P}\p{S}]/u,Ce=/(?!~)[\s\p{P}\p{S}]/u,Be=/(?:[^\s\p{P}\p{S}]|~)/u,qe=h(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ce=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ve=h(ce,"u").replace(/punct/g,D).getRegex(),De=h(ce,"u").replace(/punct/g,pe).getRegex(),he="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",He=h(he,"gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,D).getRegex(),Ze=h(he,"gu").replace(/notPunctSpace/g,Be).replace(/punctSpace/g,Ce).replace(/punct/g,pe).getRegex(),Ge=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,D).getRegex(),Ne=h(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),Fe=h(/^<(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(),je=h(U).replace("(?:-->|$)","-->").getRegex(),Qe=h("^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",je).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ue=h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),de=h(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",Q).getRegex(),ke=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",Q).getRegex(),Ke=h("reflink|nolink(?!\\()","g").replace("reflink",de).replace("nolink",ke).getRegex(),se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:I,anyPunctuation:Ne,autolink:Fe,blockSkip:qe,br:le,code:Ae,del:I,emStrongLDelim:ve,emStrongRDelimAst:He,emStrongRDelimUnd:Ge,escape:ze,link:Ue,nolink:ke,punctuation:Ee,reflink:de,reflinkSearch:Ke,tag:Qe,text:Ie,url:I},We={...X,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},N={...X,emStrongRDelimAst:Ze,emStrongLDelim:De,url:h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",se).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:h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",se).getRegex()},Xe={...N,br:h(le).replace("{2,}","*").getRegex(),text:h(N.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},C={normal:K,gfm:Le,pedantic:Me},M={normal:X,gfm:N,breaks:Xe,pedantic:We},Je={"&":"&","<":"<",">":">",'"':""","'":"'"},ge=e=>Je[e],y=class{options;rules;lexer;constructor(e){this.options=e||T}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:z(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Ve(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=z(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:z(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=z(t[0],"\n").split("\n"),n="",r="",i=[];for(;e.length>0;){let t,o=!1,s=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))s.push(e[t]),o=!0;else{if(o)break;s.push(e[t])}e=e.slice(t);let l=s.join("\n"),a=l.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${l}`:l,r=r?`${r}\n${a}`:a;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,i,!0),this.lexer.state.top=c,
vendor: 25,802 bytes, line 18
180===e.length)break;let u=i.at(-1);if("code"===u?.type)break;if("blockquote"===u?.type){let t=u,o=t.raw+"\n"+e.join("\n"),s=this.blockquote(o);i[i.length-1]=s,n=n.substring(0,n.length-t.raw.length)+s.raw,r=r.substring(0,r.length-t.text.length)+s.text;break}if("list"!==u?.type);else{let t=u,o=t.raw+"\n"+e.join("\n"),s=this.list(o);i[i.length-1]=s,n=n.substring(0,n.length-u.raw.length)+s.raw,r=r.substring(0,r.length-t.raw.length)+s.raw,e=o.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 o=this.rules.other.listItemRegex(n),s=!1;for(;e;){let n=!1,r="",l="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let a=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=!a.trim(),d=0;if(this.options.pedantic?(d=2,l=a.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,l=a.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),o=this.rules.other.headingBeginRegex(d),s=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)||o.test(c)||s.test(c)||t.test(c)||n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=d||!c.trim())l+="\n"+h.slice(d);else{if(u||a.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||i.test(a)||o.test(a)||n.test(a))break;l+="\n"+c}!u&&!c.trim()&&(u=!0),r+=g+"\n",e=e.substring(g.length+1),a=h.slice(d)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(s=!0));let h,g=null;this.options.gfm&&(g=this.rules.other.listIsTask.exec(l),g&&(h="[ ] "!==g[0],l=l.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!g,checked:h,loose:!1,text:l,tokens:[]}),i.raw+=r}let l=i.items.at(-1);if(!l)return;l.raw=l.raw.trimEnd(),l.text=l.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=V(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?o.align.push("right"):this.rules.other.tableAlignCenter.test(e)?o.align.push("center"):this.rules.other.tableAlignLeft.test(e)?o.align.push("left"):o.align.push(null);for(let e=0;e<n.length;e++)o.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:o.align[e]});for(let e of i)o.rows.push(V(e,o.header.length).map(((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:o.align[t]}))));return o}}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=z(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=fe(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)),me(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 me(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,o=[...r[0]].length-1,s=o,l=0,a="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+o);null!=(r=a.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]){s+=i;continue}if((r[5]||r[6])&&o%3&&!((o+i)%3)){l+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+l);let t=[...r[0]][0].length,a=e.slice(0,o+r.index+t+i);if(Math.min(o,i)%2){let e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}let c=a.slice(2,-2);return{type:"strong",raw:a,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}}}},x=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new y,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:m,block:C.normal,inline:M.normal};this.options.pedantic?(t.block=C.pedantic,t.inline=M.pedantic):this.options.gfm&&(t.block=C.gfm,this.options.breaks?t.inline=M.breaks:t.inline=M.gfm),this.tokenizer.rules=t}static get rules(){return{block:C,inline:M}}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(m.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(m.tabCharGlobal," ").replace(m.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 o=t.at(-1);n&&"paragraph"===o?.type?(o.raw+=(o.raw.endsWith("\n")?"":"\n")+r.raw,o.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.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,o="";for(;e;){let r;if(i||(o=""),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,o)){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 s=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&&(s=e.substring(0,n+1))}if(r=this.tokenizer.inlineText(s)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(o=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}},P=class{options;parser;constructor(e){this.options=e||T}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").match(m.notSpaceStart)?.[0],i=e.replace(m.endingNewline,"")+"\n";return r?'<pre><code class="language-'+w(r)+'">'+(n?i:w(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:w(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+" "+w(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>${w(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=J(e);if(null===i)return r;let o='<a href="'+(e=i)+'"';return t&&(o+=' title="'+w(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(null===i)return w(n);let o=`<img src="${e=i}" alt="${n}"`;return t&&(o+=` title="${w(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:w(e.text)}},$=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""}},b=class e{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $}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 o=i;switch(o.type){case"space":n+=this.renderer.space(o);continue;case"hr":n+=this.renderer.hr(o);continue;case"heading":n+=this.renderer.heading(o);continue;case"code":n+=this.renderer.code(o);continue;case"table":n+=this.renderer.table(o);continue;case"blockquote":n+=this.renderer.blockquote(o);continue;case"list":n+=this.renderer.list(o);continue;case"html":n+=this.renderer.html(o);continue;case"def":n+=this.renderer.def(o);continue;case"paragraph":n+=this.renderer.paragraph(o);continue;case"text":{let i=o,s=this.renderer.text(i);for(;r+1<e.length&&"text"===e[r+1].type;)i=e[++r],s+="\n"+this.renderer.text(i);n+=t?this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s,escaped:!0}]}):s;continue}default:{let e='Token with "'+o.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 o=i;switch(o.type){case"escape":case"text":n+=t.text(o);break;case"html":n+=t.html(o);break;case"link":n+=t.link(o);break;case"image":n+=t.image(o);break;case"strong":n+=t.strong(o);break;case"em":n+=t.em(o);break;case"codespan":n+=t.codespan(o);break;case"br":n+=t.br(o);break;case"del":n+=t.del(o);break;default:{let e='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},S=class{options;block;constructor(e){this.options=e||T}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?x.lex:x.lexInline}provideParser(){return this.block?b.parse:b.parseInline}},B=class{defaults=L();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=b;Renderer=P;TextRenderer=$;Lexer=x;Tokenizer=y;Hooks=S;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 P(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],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new y(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],o=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return!1===n&&(n=o.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new S;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],o=t[r];S.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&S.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return o.call(t,n)})();let r=i.call(t,e);return o.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return!1===n&&(n=await o.apply(t,e)),n})();let n=i.apply(t,e);return!1===n&&(n=o.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 x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?x.lex:x.lexInline)(n,i),o=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(o,i.walkTokens));let s=await(i.hooks?await i.hooks.provideParser():e?b.parse:b.parseInline)(o,i);return i.hooks?await i.hooks.postprocess(s):s})().catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?x.lex:x.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?b.parse:b.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return o(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>"+w(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},_=new B;k.options=k.setOptions=function(e){return _.setOptions(e),k.defaults=_.defaults,G(k.defaults),k},k.getDefaults=L,k.defaults=T,k.use=function(...e){return _.use(...e),k.defaults=_.defaults,G(k.defaults),k},k.walkTokens=function(e,t){return _.walkTokens(e,t)},k.parseInline=_.parseInline,k.Parser=b,k.parser=b.parse,k.Renderer=P,k.TextRenderer=$,k.Lexer=x,k.lexer=x.lex,k.Tokenizer=y,k.Hooks=S,k.parse=k,k.options,k.setOptions,k.use,k.walkTokens,k.parseInline,b.parse,x.lex;const pasteMarked=new B({breaks:!0,renderer:{html:renderPastedHtmlToken}}).use({tokenizer:{code:()=>{}}}),HTML_TAG_LEXEME=/<(\/?)([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^'">])*)>/g;class Clipboard{#t=new ListenerBin;constructor(e){this.editorElement=e,this.editor=e.editor,this.contents=e.contents,this.#hi()}dispose(){this.editorElement=null,this.editor=null,this.contents=null,this.#t.dispose()}paste(e){const t=e.clipboardData;if(!t)return!1;if(this.#gi())return this.#pi(t),e.preventDefault(),!0;if(this.#fi(t))return this.#mi(t),e.preventDefault(),!0;const n=this.#yi(t);return n&&e.preventDefault(),n}#hi(){this.#t.track(this.editor.registerCommand(_e$2,this.paste.bind(this),oo),this.editor.registerCommand(oe$6,(e=>this.#bi(e)),oo))}
18#bi({nodes:e,selection:t}){const n=$bareUrlFromSingleLink(e);if(n&&Fr(t))return this.#$i(t,n),!0}#fi(e){return this.#_i(e)||this.#Ci(e)}#_i(e){const t=Array.from(e.types);return 1===t.length&&"text/plain"===t[0]}#Ci(e){if(this.#xi(e))return!1;const t=Array.from(e.types);if(t.includes("text/uri-list"))return t.every((e=>"text/plain"===e||"text/uri-list"===e));if(e.files.length)return!1;const n=e.getData("text/plain").trim();if(!isAutolinkableURL(n))return!1;const r=e.getData("text/html");return!r||this.#Si(r,n)}#Si(e,t){const n=parseHtml(e);if(n.body.textContent.trim()!==t)return!1;const r=n.body.querySelectorAll("a");return 0===r.length||1===r.length&&r[0].getAttribute("href")===t}#gi(){let e=!1;return this.editor.getEditorState().read((()=>{const t=Qr();if(!Fr(t))return;let n=t.anchor.getNode();for(;n;){if(W$1(n))return void(e=!0);n=n.getParent()}})),e}#pi(e){const t=e.getData("text/plain");t&&this.editor.update((()=>{const e=Qr();Fr(e)&&e.insertRawText(t)}),{tag:jn})}#mi(e){this.#Ti(e).getAsString((t=>{const n=t.trim();isAutolinkableURL(n)?this.#Ei(n):this.editorElement.supportsMarkdown?this.#vi(t):this.#wi(e)}))}#Ti(e){const t=Array.from(e.items);return t.find((e=>"text/plain"===e.type))||t.find((e=>"text/uri-list"===e.type))}#Ei(e){ 19if(this.contents.hasSelectedText())this.contents.createLinkWithSelectedText(e);else{const t=this.contents.createLink(e);this.#ki(t,{url:e})}}#$i(e,t){if(!Fr(e))return;if(!e.isCollapsed())return Q$6(null),void Q$6(t);const n=$$2(t).append(kr(t));BaseNodeInserter.for(e).insertNodes([n]),Ms((()=>this.#ki(n.getKey(),{url:t})))}#ki(e,t){const n={replaceLinkWith:(t,n)=>this.contents.replaceNodeWithHTML(e,t,n),insertBelowLink:(t,n)=>this.contents.insertHTMLBelowNode(e,t,n)};dispatch(this.editorElement,"lexxy:insert-link",{...t,...n})}#vi(e){const t=parseHtml(parsePastedMarkdown(e));if(this.#Ni(t))this.contents.insertText(e,{tag:jn});else{const n=Object.freeze({markdown:e,document:t,addBlockSpacing:()=>addBlockSpacing(t)});dispatch(this.editorElement,"lexxy:insert-markdown",n),this.contents.insertDOM(t,{tag:jn})}}#Ni(e){const t=Array.from(e.body.children);if(1!==t.length)return!1;const n=t[0];return"P"===n.nodeName&&Array.from(n.childNodes).every((e=>e.nodeType===Node.TEXT_NODE||"BR"===e.nodeName))}#wi(e){this.editor.update((()=>{const t=Qr();I$3(e,t,this.editor)}),{tag:jn})}#yi(e){if(!this.editorElement.supportsAttachments)return!1;const t=e.getData("text/html"),n=e.files;return n.length&&this.#Ai(t)?(this.#Li(n),!0):t&&!this.#xi(e)?(this.contents.insertHtml(t,{tag:jn}),!0):!!n.length&&(this.#Li(n),!0)}#xi(e){return Array.from(e.types).includes("application/x-lexical-editor")}#Ai(e){if(!e)return!1;const t=parseHtml(e),n=Array.from(t.body.children);return 1===n.length&&"IMG"===n[0].tagName}#Li(e){this.#Oi((()=>{e.length&&this.contents.uploadFiles(e,{selectLast:!0})}))}async#Oi(e){const t=window.scrollY,n=window.scrollX;e(),await nextFrame(),window.scrollTo(n,t),this.editor.focus()}}class Extensions{constructor(e){this.lexxyElement=e,this.enabledExtensions=this.#Ii()}get lexicalExtensions(){return this.enabledExtensions.map((e=>e.lexicalExtension)).filter(Boolean)}initializeToolbars(){const e=this.#Fi;e&&(this.#Pi(e),this.#Ri(e),e.requestOverflowRefresh())}dispose(){for(;this.enabledExtensions.length;)this.enabledExtensions.pop().dispose()}#Pi(e){e.querySelectorAll("[data-lexxy-extension]").forEach((e=>e.remove()))}#Ri(e){this.enabledExtensions.forEach((t=>{const n=new Set(e.children);t.initializeToolbar(e);for(const t of e.children)n.has(t)||t.setAttribute("data-lexxy-extension","")}))}get allowedElements(){return this.enabledExtensions.flatMap((e=>e.allowedElements))}get#Fi(){return this.lexxyElement.toolbar}get#Mi(){return this.lexxyElement.baseExtensions}get#Di(){return Lexxy.global.get("extensions")}#Ii(){return this.#Mi.concat(this.#Di).map((e=>new e(this.lexxyElement))).filter((e=>e.enabled))}}class BrowserAdapter{frozenLinkKey=null;dispatchAttributesChange(e,t,n,r){}dispatchEditorInitialized(e){}freeze(){}thaw(){}unlinkFrozenNode(){return!1}}const codeLinkState=ot$3("codeLink",{parse:e=>e&&"string"==typeof e.url?e:null});class ProvisionalParagraphNode extends Zi{$config(){return this.config("provisonal_paragraph",{extends:Zi,importDOM:()=>null,$transform:e=>{e.concretizeIfEdited(e),e.removeUnlessRequired(e)}})}static neededBetween(e,t){return!$isSelectableElement(e,"next")&&!$isSelectableElement(t,"previous")}createDOM(e){const t=super.createDOM(e),n=this.isSelected(Qr());return t.classList.add("provisional-paragraph"),t.classList.toggle("hidden",!n),t}updateDOM(e,t){const n=this.isSelected(Qr());return t.classList.toggle("hidden",!n),!1}getTextContent(){return""}exportDOM(){return{element:null}}isSelected(e=null){const t=e||Qr();if(!t)return!1;if(t.getNodes().some((e=>e.is(this)||this.isParentOf(e))))return!0;
19if(Fr(t)&&t.isCollapsed()){const{anchor:e}=t,n=this.getParent();if(n&&e.getNode().is(n)&&"element"===e.type){const t=this.getIndexWithinParent();return e.offset===t||e.offset===t+1}}return!1}removeUnlessRequired(e=this.getLatest()){e.required||e.remove()}concretizeIfEdited(e=this.getLatest()){e.getTextContentSize()>0&&e.replace(eo(),!0)}get required(){return this.isDirectRootChild&&ProvisionalParagraphNode.neededBetween(...this.immediateSiblings)}get isDirectRootChild(){return Is(this.getParent())}get immediateSiblings(){return[this.getPreviousSibling(),this.getNextSibling()]}}class ProvisionalParagraphExtension extends LexxyExtension{get lexicalExtension(){return dc({name:"lexxy/provisional-paragraph",nodes:[ProvisionalParagraphNode],register:e=>Cc(e.registerNodeTransform(Ui,$insertRequiredProvisionalParagraphs),e.registerNodeTransform(Ui,$removeUnneededProvisionalParagraphs),e.registerCommand(ie$4,$markAllProvisionalParagraphsDirty,so))})}}class CodeHighlightingExtension extends LexxyExtension{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return dc({name:"lexxy/code-highlighting",register:e=>L$1(e,buildMarkupPreservingTokenizer(e))})}}const TRIX_LANGUAGE_ATTR="language";class TrixContentExtension extends LexxyExtension{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return dc({name:"lexxy/trix-content",html:{import:{em:e=>onlyStyledElements(e,{conversion:extendTextNodeConversion("i",$applyHighlightStyle),priority:1}),span:e=>onlyStyledElements(e,{conversion:extendTextNodeConversion("mark",$applyHighlightStyle),priority:1}),strong:e=>onlyStyledElements(e,{conversion:extendTextNodeConversion("b",$applyHighlightStyle),priority:1}),del:()=>({conversion:extendTextNodeConversion("s",$applyStrikethrough,$applyHighlightStyle),priority:1}),pre:e=>onlyPreLanguageElements(e,{conversion:extendConversion(z$1,"pre",$applyLanguage),priority:1})}}})}}class WrappedTableNode extends vn{$config(){return this.config("wrapped_table_node",{extends:vn})}static importDOM(){return super.importDOM()}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}exportDOM(e){const t=super.exportDOM(e);return{...t,after:e=>{if(t.after){return createElement("figure",{className:"lexxy-content__table-wrapper"},(e=t.after(e)).cloneNode(!0).outerHTML)}return e}}}}class TablesExtension extends LexxyExtension{get enabled(){return this.editorElement.supportsRichText}get allowedElements(){return["figure","tbody"]}get lexicalExtension(){return dc({name:"lexxy/tables",nodes:[WrappedTableNode,{replace:vn,with:()=>new WrappedTableNode,withKlass:WrappedTableNode},Ee$1,He$1],register:e=>(Nn(e),Cc(Wn(e),e.registerRootListener((t=>{if(t)return $n(e,!0)})),e.registerNodeTransform(Ee$1,(e=>{""!==e.getBackgroundColor()&&e.setBackgroundColor("")})),e.registerNodeTransform(Ee$1,(e=>{const t=e.getHeaderStyles();if(t!==Ae$1.ROW)return;const n=e.getParent(),r=n?.getParent();if(!r)return;const i=r.getChildren(),o=n.getChildren().indexOf(e),s=n.getChildren().every((e=>e.getHeaderStyles()!==Ae$1.NO_STATUS)),l=i.every((e=>{const t=e.getChildren()[o];return t&&t.getHeaderStyles()!==Ae$1.NO_STATUS}));let a=Ae$1.NO_STATUS;s&&(a|=Ae$1.ROW),l&&(a|=Ae$1.COLUMN),a!==t&&e.setHeaderStyles(a,Ae$1.BOTH)})),e.registerCommand("insertTableRowAfter",(()=>{nt(!0)}),oo),e.registerCommand("insertTableRowBefore",(()=>{nt(!1)}),oo),e.registerCommand("insertTableColumnAfter",(()=>{st(!0)}),oo),e.registerCommand("insertTableColumnBefore",(()=>{st(!1)}),oo),e.registerCommand("deleteTableRow",(()=>{ut()}),oo),e.registerCommand("deleteTableColumn",(()=>{dt()}),oo),e.registerCommand("deleteTable",(()=>{const e=Qr();if(!Fr(e))return!1;hn(e.anchor.getNode())?.remove()}),oo)))})}}const MIME_TYPE$1="application/x-lexxy-node-key";class AttachmentDragAndDrop{#le;#Bi=null;#Hi=null;#zi=null;#t=new ListenerBin;constructor(e){this.#le=e,this.#t.track(e.registerCommand(Be$2,(e=>this.#Wi(e)),so),e.registerCommand(ze$2,(e=>this.#ft(e)),so)),this.#t.track(e.registerRootListener(((e,t)=>{t&&(t.removeEventListener("dragover",this.#Ui),t.removeEventListener("dragend",this.#Ki)),e&&(e.addEventListener("dragover",this.#Ui),e.addEventListener("dragend",this.#Ki))})))}destroy(){this.#Vi(),this.#t.dispose()}#Wi(e){if(e.target.closest?.("textarea"))return!1;
19const t=e.target.closest?.("figure.attachment[data-lexical-node-key]");return!!t&&(this.#Bi=t.dataset.lexicalNodeKey,e.dataTransfer.setData(MIME_TYPE$1,this.#Bi),e.dataTransfer.effectAllowed="move",this.#zi=requestAnimationFrame((()=>{this.#zi=null,t.classList.add("lexxy-dragging")})),!0)}#Ui=e=>{this.#Bi&&(e.preventDefault(),e.dataTransfer.dropEffect="move",this.#Hi||(this.#Hi=requestAnimationFrame((()=>{this.#Hi=null,this.#qi(e)}))))};#ft(e){if(!this.#Bi)return!1;e.preventDefault();const t=this.#Gi(e),n=this.#Bi;return this.#Vi(),t&&this.#ji(n,t),!0}#Ki=()=>{this.#Vi()};#qi(e){this.#Zi();const t=this.#Gi(e);t&&("gallery"===t.type||"gallery-reorder"===t.type?t.element.classList.add(`lexxy-drop-target--gallery-${t.position}`):"list-item"===t.type?t.element.classList.add(`lexxy-drop-target--list-${t.position}`):t.element.classList.add(`lexxy-drop-target--block-${t.position}`))}#Gi(e){const t=document.elementFromPoint(e.clientX,e.clientY);if(!t)return null;const n=this.#le.getRootElement();if(!n||!n.contains(t))return null;const r=t.closest("figure.attachment--preview[data-lexical-node-key]");if(r&&r.dataset.lexicalNodeKey!==this.#Bi){const t=r.closest(".attachment-gallery");if(t){const i=n.querySelector(`[data-lexical-node-key="${this.#Bi}"]`);if(i&&t.contains(i)){const t=this.#Qi(r,e.clientX);return{type:"gallery-reorder",element:r,nodeKey:r.dataset.lexicalNodeKey,position:t}}}const i=this.#Qi(r,e.clientX);return{type:"gallery",element:r,nodeKey:r.dataset.lexicalNodeKey,position:i}}if(r&&r.closest(".attachment-gallery"))return null;const i=t.closest(".attachment-gallery");if(i){let n=t.closest("figure.attachment[data-lexical-node-key]");if(n||(n=this.#Yi(i,e.clientX)),n&&n.dataset.lexicalNodeKey!==this.#Bi){const t=this.#Qi(n,e.clientX);return{type:"gallery-reorder",element:n,nodeKey:n.dataset.lexicalNodeKey,position:t}}if(n)return null}const o=t.closest("li");if(o&&n.contains(o)){return{type:"list-item",element:o,position:this.#Ji(o,e.clientY)}}const s=this.#Xi(t,n,e.clientY);if(!s)return null;const l=this.#Ji(s,e.clientY);return"before"===l&&s.previousElementSibling?{type:"block",element:s.previousElementSibling,position:"after"}:{type:"block",element:s,position:l}}#Xi(e,t,n){let r=e;for(;r&&r!==t;){if(r.parentElement===t)return r;r=r.parentElement}let i=null,o=1/0;for(const e of t.children){const t=e.getBoundingClientRect(),r=Math.min(Math.abs(n-t.top),Math.abs(n-t.bottom));r<o&&(o=r,i=e)}return i}#Ji(e,t){const n=e.getBoundingClientRect();return t<n.top+n.height/2?"before":"after"}#Qi(e,t){const n=e.getBoundingClientRect();return t<n.left+n.width/2?"before":"after"}#Yi(e,t){const n=e.querySelectorAll("figure.attachment[data-lexical-node-key]");let r=null,i=1/0;for(const e of n){const n=e.getBoundingClientRect(),o=n.left+n.width/2,s=Math.abs(t-o);s<i&&(i=s,r=e)}return r}static#eo=["lexxy-drop-target--gallery-before","lexxy-drop-target--gallery-after","lexxy-drop-target--list-before","lexxy-drop-target--list-after","lexxy-drop-target--block-before","lexxy-drop-target--block-after"];#Zi(){const e=this.#le.getRootElement();if(e)for(const t of e.querySelectorAll("[class*='lexxy-drop-target--']"))t.classList.remove(...AttachmentDragAndDrop.#eo)}#ji(e,t){const n=Yo(e);n&&$isActionTextAttachmentNode(n)&&("gallery"===t.type?this.#to(n,t.nodeKey,t.position):"gallery-reorder"===t.type?this.#no(n,t.nodeKey,t.position):"list-item"===t.type?this.#ro(n,t):this.#io(n,t),es(null))}#to(e,t,n){const r=Yo(t);if(!r||!$isActionTextAttachmentNode(r))return;if(e.is(r))return;e.remove();$findOrCreateGalleryForImage(r)&&("before"===n?r.insertBefore(e):r.insertAfter(e))}#no(e,t,n){const r=Yo(t);r&&!e.is(r)&&(e.remove(),"before"===n?r.insertBefore(e):r.insertAfter(e))}#ro(e,t){const n=Go(t.element);if(!n||!pe$2(n))return;const r=n.getParent();if(!r||!Se$1(r))return;const i=r.getChildren(),o=i.indexOf(n);if(-1===o)return;const s="before"===t.position?o:o+1;if(e.remove(),0===s)r.insertBefore(e);else if(s>=i.length)r.insertAfter(e);else{const[,t]=Us(r,s);t.insertBefore(e)}}#io(e,t){const n=Go(t.element);if(!n)return;const r=n.getTopLevelElement?.()||n;e.is(r)||(e.remove(),"before"===t.position?r.insertBefore(e):r.insertAfter(e))}#Vi(){if(this.#Zi(),this.#Bi){const e=this.#le.getRootElement();
19if(e){const t=e.querySelector(`[data-lexical-node-key="${this.#Bi}"]`);t?.classList.remove("lexxy-dragging")}}this.#Bi=null,this.#Hi&&(cancelAnimationFrame(this.#Hi),this.#Hi=null),this.#zi&&(cancelAnimationFrame(this.#zi),this.#zi=null)}}const ATTACHMENT_ATTRIBUTES=["alt","caption","content","content-type","data-direct-upload-id","data-sgid","filename","filesize","height","presentation","previewable","sgid","url","width"],UPLOADS_BUSY_MESSAGE="Please wait for all files to upload";class AttachmentsExtension extends LexxyExtension{#oo=0;get enabled(){return this.editorElement.supportsAttachments}get allowedElements(){return[{tag:ActionTextAttachmentNode.TAG_NAME,attributes:ATTACHMENT_ATTRIBUTES}]}get lexicalExtension(){return dc({name:"lexxy/action-text-attachments",nodes:[ActionTextAttachmentNode,ActionTextAttachmentUploadNode,ImageGalleryNode],register:e=>{const t=new AttachmentDragAndDrop(e);return Cc(e.registerNodeTransform(ActionTextAttachmentNode,$extractAttachmentFromParagraph),e.registerCommand(fe$4,$collapseIntoGallery,oo),e.registerMutationListener(ActionTextAttachmentUploadNode,this.#so.bind(this)),(()=>t.destroy()))}})}#so(e){const t=this.#oo;for(const[t,n]of e)"created"===n?this.#oo++:"destroyed"===n&&(this.#oo--,this.editorElement.uploadRequests.abort(t));this.#oo!==t&&this.#lo()}#lo(){this.#oo?this.setEditorValidity({customError:!0},UPLOADS_BUSY_MESSAGE):this.setEditorValidity({})}}class EarlyEscapeCodeNode extends z$1{$config(){return this.config("early_escape_code",{extends:z$1})}static $fromSelection(e){const t=e.anchor.getNode();return At$2(t,EarlyEscapeCodeNode)||(t instanceof EarlyEscapeCodeNode?t:null)}insertNewAfter(e,t){return Es(jn)||!e.isCollapsed()?super.insertNewAfter(e,t):this.#ao(e)?this.#co():this.#uo(e)?this.#do(e,t):this.#ho(e)?this.#go():super.insertNewAfter(e,t)}#ao(e){const{anchor:t}=e;if(!$isAtNodeStart(t))return!1;const n=t.getNode();return this.is(n)||this.getFirstChild()?.is(n)}#ho(e){if(!$isCursorOnLastLine(e))return!1;const t=this.getTextContent();return""===t||t.endsWith("\n")}#uo(e){if(!$isCursorOnLastLine(e))return!1;const t=this.getTextContent(),n=t.lastIndexOf("\n"),r=-1===n?t:t.slice(n+1);return r.length>0&&""===r.trim()}#co(){return this.insertBefore(eo()),null}#do(e,t){return super.insertNewAfter(e,t),this.getLastChild().remove(),null}#go(){$trimTrailingBlankNodes(this);const e=eo();return this.insertAfter(e),e}}class EarlyEscapeListItemNode extends ge$2{$config(){return this.config("early_escape_listitem",{extends:ge$2})}insertNewAfter(e,t){return this.#po(e)?this.#fo():super.insertNewAfter(e,t)}get#mo(){return Boolean(At$2(this,At$1))}#po(e){if(this.#yo()||!this.#mo)return!1;if($isBlankNode(this))return!0;{const t=At$2(e.anchor.getNode(),Zi);return t&&$isBlankNode(t)&&pe$2(t.getParent())}}#yo(){return Es(jn)}#fo(){const e=this.getParent();if(!e||!Se$1(e))return;const t=e.getParent();if(t&&Mt$2(t)){if(this.getNextSiblings().some((e=>pe$2(e)&&!$isBlankNode(e))))return this.#bo()}const n=eo();return e.insertAfter(n),this.remove(),n}#bo(){const e=Us(this.getParent(),this.getIndexWithinParent());this.remove();const t=eo();return e[0].insertAfter(t),e.forEach($trimTrailingBlankNodes),t}}class FormatEscapeExtension extends LexxyExtension{get enabled(){return this.editorElement.supportsRichText}get allowedElements(){return[{tag:"ol",attributes:["start"]},{tag:"li",attributes:["value"]}]}get lexicalExtension(){return dc({name:"lexxy/format-escape",nodes:[EarlyEscapeCodeNode,{replace:z$1,with:e=>new EarlyEscapeCodeNode(e.getLanguage()),withKlass:EarlyEscapeCodeNode},EarlyEscapeListItemNode,{replace:ge$2,with:()=>new EarlyEscapeListItemNode,withKlass:EarlyEscapeListItemNode}],register:e=>Cc(e.registerCommand(he$3,(()=>$escapeFromBlockquote()),so),e.registerCommand(Ee$3,(e=>$handleArrowDownInCodeBlock(e)),oo),e.registerNodeTransform(At$1,$ensureQuoteHasParagraphChild))})}}class LinkOpenerExtension extends LexxyExtension{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return dc({name:"lexxy/link-opener",register:e=>Cc(e.registerCommand(se$5,this.#$o.bind(this),oo),registerEventListener(this.editorElement.editorContentElement,"auxclick",this.#_o.bind(this)),registerEventListener(window,"keydown",this.#Co.bind(this)),registerEventListener(window,"keyup",this.#Co.bind(this)),registerEventListener(window,"focu
19s",this.#xo.bind(this)))})}#$o(e){return!!this.#So(e)&&$openLink(e.target)}#_o(e){1===e.button&&this.editorElement.editor.read((()=>$openLink(e.target)))}#Co(e){this.#To(e)}async#xo(){await delay(200),this.editorElement.addEventListener("mousemove",this.#To.bind(this),{once:!0})}#To(e){this.editorElement.toggleAttribute("data-links-openable",this.#So(e))}#So(e){return lt$2?e.metaKey:e.ctrlKey}}class PreventLexicalTripleClickExtension extends LexxyExtension{get lexicalExtension(){return dc({name:"lexxy/prevent-lexical-triple-click",register:e=>e.registerRootListener((e=>{if(e)return registerEventListener(e,"click",this.#Eo.bind(this),{capture:!0})}))})}#Eo(e){3===e.detail&&e.stopPropagation()}}const MIME_TYPE="application/x-lexxy-custom-attachment-key";class CustomAttachmentDragAndDrop{#le;#Bi=null;#zi=null;#vo=null;#wo=null;#t=new ListenerBin;constructor(e){this.#le=e,this.#t.track(e.registerCommand(Be$2,(e=>this.#Wi(e)),so),e.registerCommand(ze$2,(e=>this.#ft(e)),so)),this.#t.track(e.registerRootListener(((e,t)=>{t&&(t.removeEventListener("dragover",this.#Ui),t.removeEventListener("dragend",this.#Ki)),e&&(e.addEventListener("dragover",this.#Ui),e.addEventListener("dragend",this.#Ki))})))}destroy(){this.#Vi(),this.#wo?.remove(),this.#wo=null,this.#t.dispose()}#Wi(e){const t=this.#ko(e.target);return!!t&&(this.#Bi=t.dataset.lexicalNodeKey,e.dataTransfer.setData(MIME_TYPE,this.#Bi),e.dataTransfer.effectAllowed="move",this.#zi=requestAnimationFrame((()=>{this.#zi=null,t.classList.add("lexxy-dragging")})),!0)}#Ui=e=>{this.#Bi&&(e.preventDefault(),e.dataTransfer.dropEffect="move",this.#vo||(this.#vo=requestAnimationFrame((()=>{this.#vo=null,this.#No(e)}))))};#Ki=()=>{this.#Vi()};#ft(e){if(!this.#Bi)return!1;e.preventDefault();const t=this.#Ao(e),n=this.#Bi;return this.#Vi(),t&&this.#Lo(n,t),!0}#Ao(e){const t=this.#le.getRootElement();if(!t)return null;const n=caretFromPoint(e.clientX,e.clientY);if(!n||!t.contains(n.node))return null;if(n.node===t)return this.#Oo(t,e.clientY);const r=this.#Io(n.node);return r?this.#Fo(r,e.clientX):n}#Oo(e,t){let n=null,r=1/0;for(const i of e.children){const e=i.getBoundingClientRect(),o=Math.min(Math.abs(t-e.top),Math.abs(t-e.bottom));o<r&&(r=o,n=i)}if(!n)return null;return t<n.getBoundingClientRect().top?{node:n,offset:0}:{node:n,offset:n.childNodes.length}}#Io(e){const t=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;return t?.closest("[data-lexxy-decorator][data-lexical-node-key]")}#Fo(e,t){const n=e.getBoundingClientRect(),r=t>n.left+n.width/2?"after":"before";return{decoratorKey:e.dataset.lexicalNodeKey,placement:r}}#Lo(e,t){this.#le.update((()=>{const n=Yo(e);$isCustomActionTextAttachmentNode(n)&&(t.decoratorKey?this.#Po(n,t):this.#Ro(n,t))}))}#Po(e,{decoratorKey:t,placement:n}){const r=Yo(t);r&&r!==e&&(e.remove(),"after"===n?r.insertAfter(e):r.insertBefore(e))}#Ro(e,t){const n=Gr({anchorNode:t.node,anchorOffset:t.offset,focusNode:t.node,focusOffset:t.offset},this.#le);n&&(es(n),e.remove(),n.insertNodes([e]))}#No(e){this.#Mo();const t=this.#Ao(e);t&&this.#Do(this.#Bo(t))}#Bo(e){if(e.decoratorKey)return this.#Ho(e);const{node:t,offset:n}=e,r=caretRect(t,n);if(r)return r;const i=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if(!i)return null;const o=i.getBoundingClientRect();return{left:o.left,top:o.top,height:o.height}}#Ho({decoratorKey:e,placement:t}){const n=this.#le.getRootElement()?.querySelector(`[data-lexical-node-key="${e}"]`);if(!n)return null;const r=n.getBoundingClientRect();return{left:"after"===t?r.right:r.left,top:r.top,height:r.height}}#Do(e){if(!e)return;const t=this.#zo();t.style.blockSize=`${e.height}px`,t.style.insetInlineStart=`${e.left}px`,t.style.insetBlockStart=`${e.top}px`}#zo(){return this.#wo||=createElement("div",{className:"lexxy-drop-caret"}),this.#se().appendChild(this.#wo),this.#wo.style.display="block",this.#wo}#se(){return this.#le.getRootElement().closest("lexxy-editor")}#Mo(){this.#wo&&(this.#wo.style.display="none")}#ko(e){return e?.closest?.("[data-lexxy-decorator][data-lexical-node-key]")}#Vi(){if(this.#Bi){const e=this.#le.getRootElement(),t=e?.querySelector(`[data-lexical-node
19-key="${this.#Bi}"]`);t?.classList.remove("lexxy-dragging")}this.#Mo(),this.#Bi=null,this.#zi&&(cancelAnimationFrame(this.#zi),this.#zi=null),this.#vo&&(cancelAnimationFrame(this.#vo),this.#vo=null)}}class CustomAttachmentDragAndDropExtension extends LexxyExtension{get enabled(){return this.editorElement.supportsRichText}get lexicalExtension(){return dc({name:"lexxy/custom-attachment-drag-and-drop",register:e=>{const t=new CustomAttachmentDragAndDrop(e);return()=>t.destroy()}})}}const LINE_SEPARATORS=/\r\n|[\n\r\u2028\u2029]/;class LineSeparatorsExtension extends LexxyExtension{get lexicalExtension(){return this.defineExtension({name:"lexxy/line-separators",register:e=>e.registerNodeTransform(gr,$replaceLineSeparatorWithLineBreak)})}}class LexicalEditorElement extends HTMLElement{static formAssociated=!0;static debug=!1;static commands=["bold","italic","strikethrough"];static observedAttributes=["autocapitalize","connected","required"];#Wo="";#Uo=null;#Ko=!1;#Vo=!1;#t=new ListenerBin;#qo=[];#Te={undo:!1,redo:!1};#Go=new Map;#jo=document.createElement("textarea");#Zo;constructor(){super(),this.internals=this.attachInternals(),this.internals.role="presentation"}get uploadRequests(){return this.#Zo}connectedCallback(){this.id||=generateDomId("lexxy-editor"),this.config=new EditorConfiguration(this),this.extensions=new Extensions(this),this.#qo.push(this.extensions),this.editor=this.#Qo(),this.#qo.push(this.editor),this.#qo.push(this.#t),this.contents=new Contents(this),this.#qo.push(this.contents),this.selection=new Selection(this),this.#qo.push(this.selection),this.clipboard=new Clipboard(this),this.#qo.push(this.clipboard),this.adapter=new BrowserAdapter,this.#Zo=new UploadRequests;const e=CommandDispatcher.configureFor(this);this.#qo.push(e),this.#Yo(),this.toggleAttribute("connected",!0),requestAnimationFrame((()=>{this.#Jo(),this.#Xo(),this.#es()}))}disconnectedCallback(){this.#Ko=!1,this.#Vo=!1,this.#Uo=null,this.valueBeforeDisconnect=this.value,this.#ts(),this.#ns()}attributeChangedCallback(e,t,n){"function"==typeof this[`${e}ChangedCallback`]&&this[`${e}ChangedCallback`](t,n)}autocapitalizeChangedCallback(){this.editorContentElement&&this.#rs(this.editorContentElement,"autocapitalize")}connectedChangedCallback(e,t){this.isConnected&&null!=e&&e!==t&&requestAnimationFrame((()=>this.#g()))}requiredChangedCallback(){this.isConnected&&this.#is()}formResetCallback(){this.value=this.#Wo,this.editor.dispatchCommand(Ye$1,void 0)}toString(){return this.cachedStringValue??=this.editor?.read((()=>$getReadableTextContent(Zo())))}get form(){return this.internals.form}get name(){return this.getAttribute("name")}get required(){return this.hasAttribute("required")}get validity(){return this.internals.validity}checkValidity(){return this.internals.checkValidity()}reportValidity(){return this.internals.reportValidity()}setElementValidity(e,t,n){this.#Go.set(e,{flags:t,message:n}),this.#is()}get toolbarElement(){return this.#os?(this.toolbar??=this.#ss(),this.toolbar):null}get baseExtensions(){return[ProvisionalParagraphExtension,CodeHighlightingExtension,HighlightExtension,TrixContentExtension,TablesExtension,RewritableHistoryExtension,AttachmentsExtension,FormatEscapeExtension,LinkOpenerExtension,PreventLexicalTripleClickExtension,CustomAttachmentDragAndDropExtension,LineSeparatorsExtension]}get directUploadUrl(){return this.dataset.directUploadUrl}get blobUrlTemplate(){return this.dataset.blobUrlTemplate}get permittedAttachmentTypes(){const e=this.config.get("permittedAttachmentTypes");if(null==e)return null;{const t=Array.isArray(e)?e:String(e).split(/\s+/);return Object.freeze(t.filter((e=>e&&"false"!==e)))}}permitsAttachmentContentType(e){if(this.supportsAttachments){const t=this.permittedAttachmentTypes;return null===t||t.includes(e)}return!1}acceptsFile(e){return dispatch(this,"lexxy:file-accept",{file:e},!0)}$generateNodesFromDOM(e,{editor:t=this.editor}={}){let n=dt$1(t,e);return Es(jn)&&(n=$convertInlineImageDataURIs(n,this)),filterDisallowedAttachmentNodes(n,this)}get isEmpty(){return["<p><br></p>","<p></p>",""].includes(this.value.trim())}get isBlank(){return this.isEmpty||null!==this.toString().match(/^\s*$/g)}get hasOpenPrompt(){return null!==this.querySelector(".lexxy-prompt-menu.lexxy-prompt-menu--visible")}get preset(){return this.getAttribute("preset")||"default"}get supportsAttachments(){return this.config.get("attachments")}get supportsMarkdown(){return this.supportsRichText&&this.config.get("markdown")}get supportsMultiLine(){return this.config.get("multiLine")&&!this.isSingleLineMode}get supportsRichText(){return this.config.get("richText")}registerAdapter(e){this.adapter=e,this.editor&&(this.#ls(),this.#as())}freezeSelection(){this.adapter.freeze()}thawSelection(){this.adapter.thaw()}dispatchAttributesChange(){this.#as()}dispatchEditorInitialized(){this.#ls()}get isSingleLineMode(){return this.hasAttribute("single-line")}get contentTabIndex(){return parseInt(this.editorContentElement?.getAttribute("tabindex")??"0")}focus(){this.#cs||this.editor.focus((()=>this.#us()))}get#cs(){return!!this.editor&&isEditorFocused(this.editor)}get value(){return this.cachedValue??=this.#ds()}set value(e){const t=this.#cs;this.editor.update((()=>{t?Ms((()=>this.editor.focus())):Os(qn),this.#hs(e),this.#gs()}),{discrete:!0})}get canUndo(){return this.#Te.undo}get canRedo(){return this.#Te.redo}#ds(){return this.editor?.read((()=>this.sanitizer.sanitize(ht$1(this.editor,null))))??null}#ps(e,{editor:t=this.editor}={}){e||(e="<p></p>");return this.$generateNodesFromDOM(parseHtml(`${e}`),{editor:t}).filter(this.#fs).map(this.#ms)}#fs(e){return!sr(e)&&(!Tr(e)||""!==e.getTextContent().trim())}#ms(e){if(!Tr(e))return e;const t=eo();return t.append(e),t}#Yo(){this.#ys(),this.#pe(),this.#bs(),this.#$s(),this.#_s(),this.#Cs(),this.#xs(),this.#Ss(),this.#Ts(this.value,{suppressEvent:!0}),this.#Es()}#_s(){this.#t.track(registerEventListener(this,"lexxy:file-accept",(e=>{this.permitsAttachmentContentType(e.detail.file.type)||e.preventDefault()})))}#Qo(){this.editorContentElement||=this.#vs(),this.appendChild(this.editorContentElement);return oe$4({name:"lexxy/core",namespace:"Lexxy",theme:theme,nodes:this.#ws,html:{export:new Map([[gr,exportTextNodeDOM],[K$1,exportCodeHighlightNodeDOM]])},$initialEditorState:e=>{this.#ks(e),this.#Ns(e)}},...this.extensions.lexicalExtensions)}#Jo(){this.editor.setEditable(!1),this.editor.setRootElement(this.editorContentElement),this.editor.setEditable(!0)}get#ws(){const e=[CustomActionTextAttachmentNode];return this.supportsRichText&&e.push(At$1,It$1,me$2,ge$2,z$1,K$1,F$4,j$5,HorizontalDividerNode),e}#vs(){const e=createElement("div",{id:`${this.id}-content`,classList:"lexxy-editor__content",contenteditable:!0,role:"textbox","aria-multiline":!0,"aria-label":this.#As,placeholder:this.getAttribute("placeholder")});return this.#Ls.forEach((t=>e.setAttribute(t.name,t.value))),this.#rs(e,"autocapitalize"),this.#rs(e,"tabindex",{defaultValue:0,removeSource:!0}),e}#rs(e,t,{defaultValue:n=null,removeSource:r=!1}={}){this.hasAttribute(t)?e.setAttribute(t,this.getAttribute(t)):null!==n?e.setAttribute(t,n):e.removeAttribute(t),r&&this.removeAttribute(t)}get#As(){return Array.from(this.internals.labels).map((e=>e.textContent)).join(" ")}get#Ls(){return Array.from(this.attributes).filter((e=>e.name.startsWith("aria-")))}#Ts(e,{suppressEvent:t=!1}={}){const n=e!==this.#Uo;this.internals.setFormValue(e),this.#Uo=e,n&&!t&&dispatch(this,"lexxy:change")}#Ns(e){const t=this.valueBeforeDisconnect||this.getAttribute("value")||"<p><br></p>";this.#Wo=t,this.#hs(t,{editor:e})}#hs(e,{editor:t=this.editor}={}){Zo().clear().selectEnd().insertNodes(this.#ps(e,{editor:t}))}#Ss(){this.#t.track(registerEventListener(document,"turbo:before-cache",this.#Os))}#Os=()=>{this.closest("[data-turbo-permanent]")||this.#ns()};#Es(){this.#t.track(this.editor.registerUpdateListener((({editorState:e})=>{this.#ts(),this.#Ts(this.value),this.#gs(),this.#is(),this.#as()})))}async#is(){await nextFrame(),this.isConnected&&this.#Is()}#Is(){this.#Fs();const{validity:e,message:t}=this.#Ps();this.internals.setValidity(e,t,this.editorContentElement)}#Fs(){this.#jo.required=this.required&&this.isBlank;const e=this.#jo.validity,t=this.#jo.validationMessage;this.#Go.set(this,{flags:e,message:t})}#Ps(){const e={},t=[];for(const{flags:n,message:r}of this.#Go.values())if(!0!==n.valid)for(const i in n)n[i]&&(e[i]=!0,t.push(r));return{validity:e,message:t.join("\n")}}#ts(){this.cachedValue=null,this.cachedStringValue=null}#ys(){const e=[];
19if(this.supportsRichText){if(e.push(zt$2(this.editor),Ie$2(this.editor)),this.#Rs(),this.#Ms(),this.supportsMarkdown){const t=[...te,HORIZONTAL_DIVIDER];e.push(se$1(this.editor,t),registerMarkdownLeadingTagHandler(this.editor,t))}}else e.push(H$2(this.editor));this.#t.track(...e)}#Rs(){let e=this.querySelector("lexxy-table-tools");e??=createElement("lexxy-table-tools"),this.append(e),this.#qo.push(e)}#Ms(){let e=this.querySelector("lexxy-code-language-picker");e??=createElement("lexxy-code-language-picker"),this.append(e),this.#qo.push(e)}#pe(){this.#t.track(this.editor.registerCommand(Oe$2,(e=>(e.ctrlKey||e.metaKey||!this.supportsMultiLine)&&(e.preventDefault(),!0)),oo))}#bs(){this.#t.track(registerEventListener(this,"focusin",this.#Ds),registerEventListener(this,"focusout",this.#Bs))}#Ds(e){this.#Hs(e.target)&&!this.currentlyFocused&&(this.#as(),dispatch(this,"lexxy:focus"),this.currentlyFocused=!0)}#Bs(e){this.#Hs(e.relatedTarget)||(dispatch(this,"lexxy:blur"),this.currentlyFocused=!1)}#Hs(e){return this.contains(e)||this.toolbarElement?.contains(e)}#us(){this.isEmpty&&this.selection.placeCursorAtTheEnd()}#Xo(){document.querySelector(":focus")||this.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===this&&this.focus()}#$s(){this.#t.track(this.editor.registerCommand(He$2,(e=>{this.#Te.undo=e}),oo),this.editor.registerCommand(qe$2,(e=>{this.#Te.redo=e}),oo))}#Cs(){}#xs(){this.#os&&(this.toolbarElement.setEditor(this),"function"==typeof this.toolbarElement.dispose&&this.#qo.push(this.toolbarElement),this.extensions.initializeToolbars())}#ss(){const e=this.config.get("toolbar");return"string"==typeof e?document.getElementById(e):this.querySelector("lexxy-toolbar")??this.#zs()}get#os(){return this.supportsRichText&&!!this.config.get("toolbar")}#zs(){const e=createElement("lexxy-toolbar");return e.innerHTML=LexicalToolbarElement.defaultTemplate,e.setAttribute("data-attachments",this.supportsAttachments),e.configure(this.config.get("toolbar")),this.prepend(e),e}#gs(){this.classList.toggle("lexxy-editor--empty",this.isEmpty)}#ks(e){this.sanitizer=EditorSanitizer.register(e,this.extensions.allowedElements)}#as(){let e=null,t=null,n=null,r=null;this.editor.getEditorState().read((()=>{const i=Qr();if(!Fr(i))return;const o=this.selection.getFormat();if(0===Object.keys(o).length)return;const s=At$2(i.anchor.getNode(),F$4);e={bold:{active:o.isBold,enabled:!0},italic:{active:o.isItalic,enabled:!0},strikethrough:{active:o.isStrikethrough,enabled:!0},code:{active:o.isInCode,enabled:!0},highlight:{active:o.isHighlight,enabled:!0},link:{active:o.isInLink,enabled:!0},quote:{active:o.isInQuote,enabled:!0},heading:{active:o.isInHeading,enabled:!0},"unordered-list":{active:o.isInList&&"bullet"===o.listType,enabled:!0},"ordered-list":{active:o.isInList&&"number"===o.listType,enabled:!0},undo:{active:!1,enabled:this.canUndo},redo:{active:!1,enabled:this.canRedo}},t=s?s.getURL():null,n=o.isHighlight?getHighlightStyles(i):null,r=o.headingTag??null})),e&&this.adapter.dispatchAttributesChange(e,t,n,r)}#ls(){this.adapter&&(this.#Vo=!0,this.adapter.dispatchEditorInitialized({highlightColors:this.#Ws,headingFormats:this.#Us}))}#es(){this.isConnected&&this.adapter&&(this.#Ko||(this.#Ko=!0,dispatch(this,"lexxy:initialize")),this.#Vo||this.#ls())}get#Ws(){const e=this.config.get("highlight.buttons");if(!e)return null;return{colors:this.#Ks("color",e.color||[]),backgroundColors:this.#Ks("background-color",e["background-color"]||[])}}get#Us(){if(!this.supportsRichText)return[];return[{label:"Normal",command:"setFormatParagraph",tag:null 20},...this.config.get("headings").map(((e,t)=>({label:HeadingDropdown.labelFor(e,t),command:HeadingDropdown.commandFor(t),tag:e})))]}#Ks(e,t){const n=document.createElement("span");n.style.display="none";const r=t.map((t=>{const r=document.createElement("span");return r.style.setProperty(e,t),n.appendChild(r),{element:r,name:t}}));styleResolverRoot().appendChild(n);const i=r.map((({element:t,name:n})=>({name:n,value:window.getComputedStyle(t).getPropertyValue(e)})));return n.remove(),i}#ns(){this.#Vs(),this.#qs(),this.#Zo?.clear(),this.editorContentElement?.remove(),this.editorContentElement=null,this.toolbar=null}#Vs(){for(;this.#qo.length;)this.#qo.pop().dispose()}#g(){this.disconnectedCallback(),this.valueBeforeDisconnect=null,this.connectedCallback()}#qs(){this.#Go=new Map}}class BaseSource{async buildListItems(e=""){return Promise.resolve([])}promptItemFor(e){return null}buildListItemElementFor(e){const t=e.querySelector("template[type='menu']").content.cloneNode(!0),n=createElement("li",{role:"option",id:generateDomId("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=parseHtml(await t.text()).querySelectorAll("lexxy-prompt-item");return Promise.resolve(Array.from(n))}catch(e){return Promise.reject(e)}}}const MAX_RENDERED_SUGGESTIONS$1=100;
20class LocalFilterSource extends BaseSource{async buildListItems(e=""){const t=await this.fetchPromptItems();return this.#Gs(t,e)}async fetchPromptItems(e){return Promise.resolve([])}promptItemFor(e){return this.promptItemByListItem.get(e)}#Gs(e,t){if(this.promptItemByListItem=new WeakMap,!t)return this.#js(e);const n=[];for(const r of e){const e=filterMatchPosition(r.getAttribute("search"),t);e>=0&&n.push({promptItem:r,position:e})}n.sort(((e,t)=>e.position-t.position));const r=[];for(const{promptItem:e}of n){if(r.length>=MAX_RENDERED_SUGGESTIONS$1)break;const t=this.buildListItemElementFor(e);this.promptItemByListItem.set(t,e),r.push(t)}return r}#js(e){const t=[];for(const n of e){if(t.length>=MAX_RENDERED_SUGGESTIONS$1)break;const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}class InlinePromptSource extends LocalFilterSource{constructor(e){super(),this.inlinePromptItemElements=Array.from(e)}async fetchPromptItems(){return Promise.resolve(this.inlinePromptItemElements)}}class DeferredPromptSource extends LocalFilterSource{constructor(e){super(),this.url=e,this.fetchPromptItems()}async fetchPromptItems(){return this.promptItems??=await this.loadPromptItemsFromUrl(this.url),Promise.resolve(this.promptItems)}}const DEBOUNCE_INTERVAL=200,MAX_RENDERED_SUGGESTIONS=100;class RemoteFilterSource extends BaseSource{constructor(e){super(),this.baseURL=e,this.loadAndFilterListItems=debounceAsync(this.fetchFilteredListItems.bind(this),DEBOUNCE_INTERVAL)}async buildListItems(e=""){return await this.loadAndFilterListItems(e)}promptItemFor(e){return this.promptItemByListItem.get(e)}async fetchFilteredListItems(e){const t=await this.loadPromptItemsFromUrl(this.#Zs(e));return this.#Gs(t)}#Zs(e){const t=new URL(this.baseURL,window.location.origin);return t.searchParams.append("filter",e),t.toString()}#Gs(e){const t=[];this.promptItemByListItem=new WeakMap;for(const n of e){if(t.length>=MAX_RENDERED_SUGGESTIONS)break;const e=this.buildListItemElementFor(n);this.promptItemByListItem.set(e,n),t.push(e)}return t}}const NOTHING_FOUND_DEFAULT_MESSAGE="Nothing found",FILTER_DEBOUNCE_INTERVAL=50,DEFAULT_ONLY_AT_PATTERN="^|[ \\n]";class LexicalPromptElement extends HTMLElement{#Qs=new ListenerBin;#Ys=new ListenerBin;#Js=debounce((()=>this.#Xs()),FILTER_DEBOUNCE_INTERVAL);constructor(){super(),this.showPopoverId=0}static observedAttributes=["connected"];connectedCallback(){this.source=this.#el(),this.#tl(),this.#nl(),this.toggleAttribute("connected",!0)}disconnectedCallback(){this.#Ys.dispose(),this.#Qs.dispose(),this.source=null,this.#rl()}attributeChangedCallback(e,t,n){"connected"===e&&this.isConnected&&null!=t&&t!==n&&requestAnimationFrame((()=>this.#g()))}get name(){return this.getAttribute("name")}get trigger(){return this.getAttribute("trigger")}get supportsSpaceInSearches(){return this.hasAttribute("supports-space-in-searches")}get onlyAt(){return this.getAttribute("only-at")}get verticalDirection(){return this.getAttribute("vertical-direction")}get open(){return this.popoverElement?.classList?.contains("lexxy-prompt-menu--visible")}get closed(){return!this.open}get#il(){return!this.supportsSpaceInSearches}#el(){const e=this.getAttribute("src");return e?this.hasAttribute("remote-filtering")?new RemoteFilterSource(e):new DeferredPromptSource(e):new InlinePromptSource(this.querySelectorAll("lexxy-prompt-item"))}#tl(){this.#ol&&this.#Ys.track(this.#le.registerUpdateListener((({editorState:e})=>{e.read((()=>{if(this.#sl.isInsideCodeBlock)return;const{node:e,offset:t}=this.#sl.selectedNodeWithOffset();if(e&&Tr(e)){const n=e.getTextContent(),r=this.trigger.length;if(t>=r){if(n.slice(t-r,t)===this.trigger){const n=$textBeforeOffset(e,t-r);this.#ll.test(n)&&(this.#Ys.dispose(),this.#al())}}}}))})))}get#ll(){return new RegExp(`(?:${this.onlyAt??DEFAULT_ONLY_AT_PATTERN})$`)}get#ol(){if(this.hasAttribute("insert-editable-text"))return!0;const e=this.#se;if(e.supportsAttachments){const t=Array.from(this.querySelectorAll("template[type='editor']")),n=t.length?t.map((e=>e.getAttribute("content-type")||this.#cl)):[this.#cl];return n.some((t=>e.permitsAttachmentContentType(t)))}return!1}#ul(){this.#Ys.track(this.#le.registerUpdateListener((({editorState:e})=>{this.closed||e.read((()=>
20{if(this.#sl.isInsideCodeBlock)return void this.#dl();const{node:e,offset:t}=this.#sl.selectedNodeWithOffset();e&&(this.#hl(e,t)?this.popoverElement.hasAttribute("data-anchored")||this.#gl():this.#dl())}))})))}#hl(e,t){if(!Tr(e)||0===t)return!1;const n=e.getTextContent().slice(0,t),r=n.lastIndexOf(this.trigger);if(-1===r)return!1;const i=n.slice(r+this.trigger.length);return!(this.supportsSpaceInSearches?/\n/:/[ \n]/).test(i)}get#le(){return this.#se.editor}get#se(){return this.closest("lexxy-editor")}get#sl(){return this.#se.selection}async#al(){const e=++this.showPopoverId;this.popoverElement??=await this.#pl(),this.showPopoverId===e&&(this.#fl(),await this.#Xs(),this.showPopoverId===e&&(this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!0),this.#ml(),this.#Ys.track(registerEventListener(this.#se,"keydown",this.#yl),registerEventListener(this.#se,"lexxy:change",this.#Js)),this.#bl(),this.#ul()))}#bl(){this.#Ys.track(this.#le.registerCommand(Oe$2,this.#$l.bind(this),lo),this.#le.registerCommand(Fe$2,this.#$l.bind(this),lo)),this.#il&&(this.#Ys.track(this.#le.registerCommand(Me$2,this.#$l.bind(this),lo)),this.#Ys.track(this.#le.registerCommand(ce$4,this.#_l.bind(this),lo))),this.#Ys.track(this.#le.registerCommand(we$1,this.#Cl.bind(this),lo),this.#le.registerCommand(Ee$3,this.#xl.bind(this),lo))}#Cl(e){return this.#Sl(),e.preventDefault(),!0}#xl(e){return this.#Tl(),e.preventDefault(),!0}#ml(){const e=this.#El[0];e&&this.#vl(e)}get#El(){return Array.from(this.popoverElement.querySelectorAll(".lexxy-prompt-menu__item"))}#vl(e,{scrollIntoView:t=!1}={}){this.#wl(),e.toggleAttribute("aria-selected",!0),t&&e.scrollIntoView({block:"nearest",container:"nearest",behavior:"smooth"}),this.#kl("aria-controls",this.popoverElement.id),this.#kl("aria-activedescendant",e.id),this.#kl("aria-haspopup","listbox")}#wl(){this.#El.forEach((e=>{e.toggleAttribute("aria-selected",!1)}))}#Nl(){this.#wl(),this.#Al.removeAttribute("aria-controls"),this.#Al.removeAttribute("aria-activedescendant"),this.#Al.removeAttribute("aria-haspopup")}#kl(e,t){this.#Al.getAttribute(e)!==t&&this.#Al.setAttribute(e,t)}#gl(){const e=this.#sl.cursorPosition;if(!e)return;const{x:t,y:n,fontSize:r}=e,i=this.#se.getBoundingClientRect(),o=this.#Al.getBoundingClientRect(),s=o.top-i.top;this.popoverElement.hasAttribute("data-anchored")||(this.#Ll(t),this.#Ol(n+s),this.popoverElement.toggleAttribute("data-anchored",!0));const l=this.popoverElement.getBoundingClientRect();l.right>i.right&&this.popoverElement.toggleAttribute("data-clipped-at-right",!0);const a="top"===this.verticalDirection,c="bottom"===this.verticalDirection,u=l.bottom>window.innerHeight;c||!a&&!u||(this.#Ol(o.height-n+r),this.popoverElement.toggleAttribute("data-clipped-at-bottom",!0))}#Ll(e){this.popoverElement.style.setProperty("--lexxy-prompt-offset-x",`${e}px`)}#Ol(e){this.popoverElement.style.setProperty("--lexxy-prompt-offset-y",`${e}px`)}#fl(){this.popoverElement.removeAttribute("data-clipped-at-bottom"),this.popoverElement.removeAttribute("data-clipped-at-right"),this.popoverElement.removeAttribute("data-anchored")}async#dl(){this.showPopoverId++,this.#Nl(),this.popoverElement.classList.toggle("lexxy-prompt-menu--visible",!1),this.#Ys.dispose(),await nextFrame(),this.#tl()}#nl(){this.#Qs.track(registerEventListener(document,"turbo:before-cache",(()=>this.#rl())))}#rl(){this.#Ys.dispose(),this.popoverElement?.remove(),this.popoverElement=null}#Xs=async()=>{if(this.initialPrompt)this.initialPrompt=!1;else if(this.#Il.containsTextBackUntil(this.trigger)){if(await this.#Fl(),!this.#Il.containsTextBackUntil(this.trigger))return void this.#dl();await nextFrame(),this.#gl()}else this.#dl()};async#Fl(){const e=this.showPopoverId,t=this.#Il.textBackUntil(this.trigger),n=await this.source.buildListItems(t);this.showPopoverId===e&&this.#Il.containsTextBackUntil(this.trigger)&&(this.popoverElement.innerHTML="",n.length>0?this.#Pl(n):this.#Rl(),this.#ml())}#Pl(e){this.popoverElement.classList.remove("lexxy-prompt-menu--empty"),this.popoverElement.append(...e)}#Rl(){this.popoverElement.classList.add("lexxy-prompt-menu--empty");const e=createElement("li",{textContent:this.#Ml});e.classList.add("lexxy-prompt-menu__item--empty"),this.popoverElement.append(e)}get#Ml(){return this.getAttribute("empty-results")||NOTHING_FOUND_DEFAULT_MESSAGE}#yl=e=>{"Escape"===e.key?(this.#dl(),this.#se.focus(),e.stopPropagation()):","===e.key&&(e.preventDefault(),e.stopPropagation(),this.#Dl(),this.#le.update((()=>{const e=Qr();Fr(e)&&e.insertText(",")})))};#_l(e){if("insertText"===e.inputType&&" "===e.data)return this.#$l(e)}#Tl(){const e=this.#Bl+1;e<this.#El.length&&this.#vl(this.#El[e],{scrollIntoView:!0})}#Sl(){const e=this.#Bl-1;e>=0&&this.#vl(this.#El[e],{scrollIntoView:!0})}get#Bl(){return this.#El.findIndex((e=>e.hasAttribute("aria-selected")))}get#Hl(){return this.#El[this.#Bl]}#$l(e){return e.preventDefault(),e.stopPropagation(),this.#Dl(),!0}#Dl(){this.#zl(),this.#dl(),this.#se.focus()}#zl(){const e=this.source.promptItemFor(this.#Hl);if(!e)return;const t=Array.from(e.querySelectorAll("template[type='editor']")),n=`${this.trigger}${this.#Il.textBackUntil(this.trigger)}`;this.hasAttribute("insert-editable-text")?this.#Wl(t,n):this.#Ul(t,n,e.getAttribute("sgid"))}#Wl(e,t){this.#le.update((()=>{const n=e.flatMap((e=>this.#Kl(e)));this.#Il.replaceTextBackUntil(t,n)}
20))}#Kl(e){return this.#se.$generateNodesFromDOM(parseHtml(`${e.innerHTML}`))}#Ul(e,t,n=null){this.#le.update((()=>{const r=this.#Vl(e,n).flatMap((e=>[e,this.#ql()])).slice(0,-1);this.#Il.replaceTextBackUntil(t,r)}))}#Vl(e,t=null){return e.filter((e=>this.#se.permitsAttachmentContentType(e.getAttribute("content-type")||this.#cl))).map((e=>this.#Gl(e.innerHTML,e.getAttribute("content-type")||this.#cl,e.getAttribute("sgid")||t)))}#ql(){return kr(" ")}get#cl(){return`application/vnd.${Lexxy.global.get("attachmentContentTypeNamespace")}.${this.name}`}#Gl(e,t,n){return new CustomActionTextAttachmentNode({sgid:n,contentType:t,innerHtml:e})}get#Il(){return this.#se.contents}get#Al(){return this.#se.editorContentElement}async#pl(){const e=createElement("ul",{role:"listbox",id:generateDomId("prompt-popover")});return e.classList.add("lexxy-prompt-menu"),e.style.position="absolute",e.setAttribute("nonce",getNonce()),e.append(...await this.source.buildListItems()),this.#Qs.track(registerEventListener(e,"click",this.#jl)),this.#se.appendChild(e),e}#jl=e=>{const t=e.target.closest(".lexxy-prompt-menu__item");t&&(this.#vl(t),this.#Dl())};#g(){this.disconnectedCallback(),this.connectedCallback()}}class CodeLanguagePicker extends HTMLElement{#Zl=null;#t=new ListenerBin;connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.classList.add("lexxy-floating-controls"),this.#Zl=new AbortController,this.#t.track((()=>this.#Zl?.abort())),this.#Ql(),this.#Yl(),this.#Jl()}disconnectedCallback(){this.dispose()}dispose(){this.#t.dispose()}#Ql(){this.languagePickerElement=this.#Xl()??this.#ea();const e=this.#Zl.signal;this.#t.track(registerEventListener(this.languagePickerElement,"change",(()=>{this.#ta(this.languagePickerElement.value)}),{signal:e})),this.#t.track(registerEventListener(this.languagePickerElement,"mousedown",(e=>{this.#na(e)}),{signal:e})),this.languagePickerElement.setAttribute("nonce",getNonce()),this.appendChild(this.languagePickerElement)}#Xl(){return this.querySelector("select")}#ea(){const e=createElement("select",{className:"lexxy-code-language-picker","aria-label":"Pick a language\u2026",name:"lexxy-code-language"});for(const[t,n]of Object.entries(this.#ra)){const r=document.createElement("option");r.value=t,r.textContent=n,e.appendChild(r)}return e}get#ra(){const e={...o};e.ruby||="Ruby",e.php||="PHP",e.go||="Go",e.bash||="Bash",e.json||="JSON",e.diff||="Diff",e.kotlin||="Kotlin",delete e.plain;const t=Object.entries(e).sort(((e,t)=>e[1].localeCompare(t[1])));return{plain:"Plain text",...Object.fromEntries(t)}}#na(e){!dispatch(this.editorElement,"lexxy:code-language-picker-open",{languages:this.#ia,currentLanguage:this.languagePickerElement.value},!0)&&e.preventDefault()}get#ia(){return Object.entries(this.#ra).map((([e,t])=>({key:e,name:t})))}#ta(e){this.editor.update((()=>{const t=this.#oa();t&&t.setLanguage(e)}))}#Jl(){this.#t.track(this.editor.registerUpdateListener((({editorState:e})=>{e.read((()=>{const e=this.#oa();e?this.#sa(e):this.#Yl()}))})))}#oa(){return this.editorElement.selection.nearestNodeOfType(z$1)}#sa(e){const t=e.getLanguage();this.#la(t),this.#aa(),this.#ca(e)}#la(e){if(this.languagePickerElement&&e){const t=a(e);this.languagePickerElement.value=t}}#ca(e){const t=this.editor.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.editorElement.getBoundingClientRect(),i=n.top-r.top,o=r.right-n.right;this.style.top=`${i}px`,this.style.right=`${o}px`}#aa(){this.hidden=!1}#Yl(){this.hidden=!0}}const DELETE_ICON='<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.2041 1.01074C12.2128 1.113 13 1.96435 13 3V4H15L15.1025 4.00488C15.6067 4.05621 16 4.48232 16 5C16 5.55228 15.5523 6 15 6H14.8457L14.1416 15.1533C14.0614 16.1953 13.1925 17 12.1475 17H5.85254L5.6582 16.9902C4.76514 16.9041 4.03607 16.2296 3.88184 15.3457L3.8584 15.1533L3.1543 6H3C2.44772 6 2 5.55228 2 5C2 4.44772 2.44772 4 3 4H5V3C5 1.89543 5.89543 1 7 1H11L11.2041 1.01074ZM5.85254 15H12.1475L12.8398 6H5.16016L5.85254 15ZM7 4H11V3H7V4Z"/>\n</svg>';class NodeDeleteButton extends HTMLElement{connectedCallback(){this.editorElement=this.closest("lexxy-editor"),this.editor=this.editorElement.editor,this.classList.add("lexxy-floating-control
20s"),this.querySelector(".lexxy-node-delete")||this.#ua()}disconnectedCallback(){this.editor=null,this.editorElement=null}#ua(){const e=createElement("div",{className:"lexxy-floating-controls__group"});this.deleteButton=createElement("button",{className:"lexxy-node-delete",type:"button","aria-label":"Remove"}),this.deleteButton.tabIndex=-1,this.deleteButton.innerHTML=DELETE_ICON,this.handleDeleteClick=()=>this.#da(),this.deleteButton.addEventListener("click",this.handleDeleteClick),e.appendChild(this.deleteButton),this.appendChild(e)}#da(){this.editor.update((()=>{const e=Go(this);e?.remove()}))}}class TableController{#t=new ListenerBin;constructor(e){this.editor=e.editor,this.contents=e.contents,this.selection=e.selection,this.currentTableNodeKey=null,this.currentCellKey=null,this.#ha()}destroy(){this.currentTableNodeKey=null,this.currentCellKey=null,this.#t.dispose()}get currentCell(){return this.currentCellKey?this.editor.getEditorState().read((()=>{const e=Yo(this.currentCellKey);return e instanceof Ee$1?e:null})):null}get currentTableNode(){return this.currentTableNodeKey?this.editor.getEditorState().read((()=>{const e=Yo(this.currentTableNodeKey);return e instanceof vn?e:null})):null}get currentRowCells(){const e=this.currentRowIndex,t=this.tableRows;return t?this.editor.getEditorState().read((()=>t[e]?.getChildren()??null))??null:null}get currentRowIndex(){const e=this.currentCell;return e?this.editor.getEditorState().read((()=>Ve$1(e)))??0:0}get currentColumnCells(){const e=this.currentColumnIndex,t=this.tableRows;return t?this.editor.getEditorState().read((()=>t.map((t=>t.getChildAtIndex(e)))))??null:null}get currentColumnIndex(){const e=this.currentCell;return e?this.editor.getEditorState().read((()=>Ge$1(e)))??0:0}get tableRows(){return this.editor.getEditorState().read((()=>this.currentTableNode?.getChildren()))??null}updateSelectedTable(){let e=null,t=null;return this.editor.getEditorState().read((()=>{const n=Qr();if(!n||!this.selection.isTableCellSelected)return;const r=n.getNodes()[0];e=un(r),t=hn(r)})),this.currentCellKey=e?.getKey()??null,this.currentTableNodeKey=t?.getKey()??null,t}executeTableCommand(e,t=null){"delete"!==e.action||"table"!==e.childType?"toggle"!==e.action?this.#ga(e,t):this.#pa(e):this.#fa()}#ga(e,t=null){this.#ma(),this.editor.dispatchCommand(this.#ya(e)),this.#ba(e,t)}#pa(e){const t=e.childType;let n=null,r=null;"row"===t?(n=this.currentRowCells,r=Ae$1.ROW):"column"===t&&(n=this.currentColumnCells,r=Ae$1.COLUMN),n&&0!==n.length&&this.editor.update((()=>{const e=Ye(n[0]);if(!e)return;const t=e.getHeaderStyles()^r;n.forEach((e=>{this.#$a(e,t,r)}))}))}#fa(){this.#ma(),this.editor.dispatchCommand("deleteTable")}#ma(){this.editor.update((()=>{const e=Qr();if(!e)return;const t=e.getNodes()[0];un(t)?.selectEnd()}))}#ya(e){const{action:t,childType:n,direction:r}=e;return`${t}Table${upcaseFirst(n)}${"insert"==t?upcaseFirst(r):""}`}#$a(e,t,n){const r=Ye(e);r?.setHeaderStyles(t,n)}async#_a(e,t){if(await nextFrame(),!this.currentTableNode)return;const n=this.tableRows;
20if(!n)return;const r=n[e];r&&this.editor.update((()=>{const e=Ye(r.getChildAtIndex(t));e?.selectEnd()}))}#ba(e,t=null){const{childType:n,direction:r}=e;let i=this.currentRowIndex,o=null!==t?t:this.currentColumnIndex;const s="delete"===e.action?-1:0,l="after"===r?1:s;"row"===n?i+=l:"column"===n&&(o+=l),this.#_a(i,o)}#Ca(){const e=this.tableRows;if(!e)return;const t=e.at(this.currentRowIndex+1);t&&this.editor.update((()=>{t.getChildAtIndex(this.currentColumnIndex)?.selectEnd()}))}#xa(){const e=this.currentCell;e&&this.editor.update((()=>{e.selectPrevious()}))}#Sa(){this.executeTableCommand({action:"insert",childType:"row",direction:"after"},0)}#Ta(){this.executeTableCommand({action:"delete",childType:"row"},-1)}#Ea(){const e=this.currentTableNode;this.executeTableCommand({action:"delete",childType:"row"}),this.editor.update((()=>{const t=e?.getNextSibling();if(no(t))t.selectStart();else{const e=eo();this.currentTableNode.insertAfter(e),e.selectStart()}}))}#va(){if(!this.currentTableNode)return!1;const e=this.currentCell;return!!e&&""===e.getTextContent().trim()}#wa(){if(!this.currentTableNode)return!1;const e=this.tableRows;return!!e&&e.length===this.currentRowIndex+1}#ka(){if(!this.currentTableNode)return!1;const e=this.currentRowCells;return!!e&&e.every((e=>""===e.getTextContent().trim()))}#Na(){if(!this.currentTableNode)return!1;const e=this.currentRowCells;return!!e&&0===e.indexOf(this.currentCell)}#ha(){this.#t.track(this.editor.registerCommand(Ae$3,(e=>this.#Aa(e)),so),this.editor.registerCommand(Oe$2,(e=>this.#La(e)),so))}#Aa(e){return!!this.currentTableNode&&(this.#ka()&&this.#Na()?(e.preventDefault(),this.#Ta(),!0):!(!this.#va()||this.#Na())&&(e.preventDefault(),this.#xa(),!0))}#La(e){return!(e.ctrlKey||e.metaKey||e.shiftKey||!this.currentTableNode)&&(!this.selection.isInsideList&&!this.selection.isInsideCodeBlock&&(e.preventDefault(),this.#wa()&&this.#ka()?this.#Ea():this.#wa()?this.#Sa():this.#Ca(),!0))}}var TableIcons={"insert-row-before":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M7.86804e-07 15C8.29055e-07 15.8284 0.671574 16.5 1.5 16.5H15L15.1533 16.4922C15.8593 16.4205 16.4205 15.8593 16.4922 15.1533L16.5 15V4.5L16.4922 4.34668C16.4154 3.59028 15.7767 3 15 3H13.5L13.5 4.5H15V9H1.5L1.5 4.5L3 4.5V3H1.5C0.671574 3 1.20956e-06 3.67157 1.24577e-06 4.5L7.86804e-07 15ZM15 10.5V15H1.5L1.5 10.5H15Z"/>\n <path d="M4.5 4.5H7.5V7.5H9V4.5H12L12 3L9 3V6.55671e-08L7.5 0V3L4.5 3V4.5Z"/>\n </svg>',"insert-row-after":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M7.86804e-07 13.5C7.50592e-07 14.3284 0.671574 15 1.5 15H3V13.5H1.5L1.5 9L15 9V13.5H13.5V15H15C15.7767 15 16.4154 14.4097 16.4922 13.6533L16.5 13.5V3L16.4922 2.84668C16.4205 2.14069 15.8593 1.57949 15.1533 1.50781L15 1.5L1.5 1.5C0.671574 1.5 1.28803e-06 2.17157 1.24577e-06 3L7.86804e-07 13.5ZM15 3V7.5L1.5 7.5L1.5 3L15 3Z"/>\n <path d="M7.5 15V18H9V15H12V13.5H9V10.5H7.5V13.5H4.5V15H7.5Z"/>\n </svg>',"delete-row":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M16.4922 12.1533C16.4154 12.9097 15.7767 13.5 15 13.5L12 13.5V12H15V6L1.5 6L1.5 12H4.5V13.5H1.5C0.723337 13.5 0.0846104 12.9097 0.00781328 12.1533L7.86804e-07 12L1.04907e-06 6C1.17362e-06 5.22334 0.590278 4.58461 1.34668 4.50781L1.5 4.5L15 4.5C15.8284 4.5 16.5 5.17157 16.5 6V12L16.4922 12.1533Z"/>\n <path d="M10.3711 15.9316L8.25 13.8096L6.12793 15.9316L5.06738 14.8711L7.18945 12.75L5.06738 10.6289L6.12793 9.56836L8.25 11.6895L10.3711 9.56836L11.4316 10.6289L9.31055 12.75L11.4316 14.8711L10.3711 15.9316Z"/>\n </svg>',"toggle-row":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M0.00781328 13.6533C0.0846108 14.4097 0.723337 15 1.5 15L15 15L15.1533 14.9922C15.8593 14.9205 16.4205 14.3593 16.4922 13.6533L16.5 13.5V4.5L16.4922 4.34668C16.4205 3.64069 15.8593 3.07949 15.1533 3.00781L15 3L1.5 3C0.671574 3 1.24863e-06 3.67157 1.18021e-06 4.5L7.86804e-07 13.5L0.00781328 13.6533ZM15 9V13.5L1.5 13.5L1.5 9L15 9Z"/>\n </svg>',"insert-column-before":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 0C3.67157 0 3 0.671573 3 1.5V3H4.5V1.5H9V15H4.5V13.5H3V15C3 15.7767 3.59028 16.4154 4.34668 16.4922L4.5 16.5H15L15.1533 16.4922C15.8593 16.4205 16.4205 15.8593 16.4922 15.1533L16.5 15V1.5C16.5 0.671573 15.8284 6.03989e-09
2015 0H4.5ZM15 15H10.5V1.5H15V15Z"/>\n <path d="M3 7.5H0V9H3V12H4.5V9H7.5V7.5H4.5V4.5H3V7.5Z"/>\n </svg>',"insert-column-after":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 0C14.3284 0 15 0.671573 15 1.5V3H13.5V1.5H9V15H13.5V13.5H15V15C15 15.7767 14.4097 16.4154 13.6533 16.4922L13.5 16.5H3L2.84668 16.4922C2.14069 16.4205 1.57949 15.8593 1.50781 15.1533L1.5 15V1.5C1.5 0.671573 2.17157 6.03989e-09 3 0H13.5ZM3 15H7.5V1.5H3V15Z"/>\n <path d="M15 7.5H18V9H15V12H13.5V9H10.5V7.5H13.5V4.5H15V7.5Z"/>\n </svg>',"delete-column":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M12.1533 0.0078125C12.9097 0.0846097 13.5 0.723336 13.5 1.5V4.5H12V1.5H6V15H12V12H13.5V15C13.5 15.7767 12.9097 16.4154 12.1533 16.4922L12 16.5H6C5.22334 16.5 4.58461 15.9097 4.50781 15.1533L4.5 15V1.5C4.5 0.671573 5.17157 2.41596e-08 6 0H12L12.1533 0.0078125Z"/>\n <path d="M15.9316 6.12891L13.8105 8.24902L15.9326 10.3711L14.8711 11.4316L12.75 9.31055L10.6289 11.4316L9.56738 10.3711L11.6885 8.24902L9.56836 6.12891L10.6289 5.06836L12.75 7.18848L14.8711 5.06836L15.9316 6.12891Z"/>\n </svg>',"toggle-column":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M13.6533 17.9922C14.4097 17.9154 15 17.2767 15 16.5L15 3L14.9922 2.84668C14.9205 2.14069 14.3593 1.57949 13.6533 1.50781L13.5 1.5L4.5 1.5L4.34668 1.50781C3.59028 1.58461 3 2.22334 3 3L3 16.5C3 17.2767 3.59028 17.9154 4.34668 17.9922L4.5 18L13.5 18L13.6533 17.9922ZM9 3L13.5 3L13.5 16.5L9 16.5L9 3Z"/>\n </svg>',"delete-table":'<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">\n <path d="M11.2041 1.01074C12.2128 1.113 13 1.96435 13 3V4H15L15.1025 4.00488C15.6067 4.05621 16 4.48232 16 5C16 5.55228 15.5523 6 15 6H14.8457L14.1416 15.1533C14.0614 16.1953 13.1925 17 12.1475 17H5.85254L5.6582 16.9902C4.76514 16.9041 4.03607 16.2296 3.88184 15.3457L3.8584 15.1533L3.1543 6H3C2.44772 6 2 5.55228 2 5C2 4.44772 2.44772 4 3 4H5V3C5 1.89543 5.89543 1 7 1H11L11.2041 1.01074ZM5.85254 15H12.1475L12.8398 6H5.16016L5.85254 15ZM7 4H11V3H7V4Z"/>\n </svg>'};class TableTools extends HTMLElement{#t=new ListenerBin;connectedCallback(){this.tableController=new TableController(this.#se),this.classList.add("lexxy-floating-controls"),this.role="toolbar",this.#te(),this.#Yl(),this.#Oa(),this.#Ia()}disconnectedCallback(){this.dispose()}dispose(){this.#t.dispose(),this.tableController?.destroy(),this.tableController=null}get#le(){return this.#se.editor}get#se(){return this.closest("lexxy-editor")}get#Fa(){return Array.from(this.querySelectorAll("button, details > summary"))}#te(){this.innerHTML="",this.appendChild(this.#Pa()),this.appendChild(this.#Ra()),this.appendChild(this.#Ma()),this.#t.track(registerEventListener(this,"keydown",this.#Da))}#Ba(e,t,n){const r=createElement("div",{className:`lexxy-floating-controls__group lexxy-table-control lexxy-table-control--${e}`}),i=this.#ce(`Add ${e}`,{action:"insert",childType:e,direction:"after"},"+"),o=this.#ce(`Remove ${e}`,{action:"delete",childType:e},"\u2212"),s=createElement("details",{className:"lexxy-table-control__more-menu"});s.setAttribute("name","lexxy-dropdown"),s.tabIndex=-1;const l=createElement("summary",{},`_ ${e}s`);return t(l),s.appendChild(l),s.appendChild(n),r.appendChild(o),r.appendChild(s),r.appendChild(i),r}#Pa(){return this.#Ba("row",(e=>{this.rowCount=e}),this.#Ha("row"))}#Ra(){return this.#Ba("column",(e=>{this.columnCount=e}),this.#Ha("column"))}#Ha(e){const t=createElement("div",{className:"lexxy-floating-controls__group lexxy-table-control__more-menu-details"}),n=this.#ce(`Add ${e} before`,{action:"insert",childType:e,direction:"before"}),r=this.#ce(`Add ${e} after`,{action:"insert",childType:e,direction:"after"}),i=this.#ce(`Toggle ${e} style`,{action:"toggle",childType:e}),o=this.#ce(`Remove ${e}`,{action:"delete",childType:e});return t.appendChild(n),t.appendChild(r),t.appendChild(i),t.appendChild(o),t}#Ma(){const e=createElement("div",{className:"lexxy-table-control lexxy-floating-control
20s__group"}),t=this.#ce("Delete this table?",{action:"delete",childType:"table"});return t.classList.add("lexxy-table-control__button--delete-table"),e.appendChild(t),this.deleteContainer=e,e}#ce(e,t={},n=this.#za(t)){const r=createElement("button",{className:"lexxy-table-control__button","aria-label":e,type:"button"});return r.tabIndex=-1,r.innerHTML=`${n} <span>${e}</span>`,r.dataset.action=t.action,r.dataset.childType=t.childType,r.dataset.direction=t.direction,r.addEventListener("click",(()=>this.#Wa(t))),r.addEventListener("mouseover",(()=>this.#Ua())),r.addEventListener("focus",(()=>this.#Ua())),r.addEventListener("mouseout",(()=>this.#Ua())),r}#Ia(){this.#t.track(this.#le.registerCommand(ve$2,this.#Ka,so))}#Ka=e=>!(!this.#Va||!e.altKey||"F10"!==e.key)&&(e.preventDefault(),this.#Fa[0]?.focus({focusVisible:!0}),!0);get#Va(){return null!=this.tableController?.currentTableNodeKey}#Da=e=>{"Escape"===e.key?this.#qa():handleRollingTabIndex(this.#Fa,e)};#qa(){const e=this.tableController.currentCell;e&&(this.#le.update((()=>{e.select(),this.#le.focus()})),this.#Ga())}async#Ua(){await nextFrame(),this.#ja();const e=this.querySelector("button:hover, button:focus");if(!e)return;const t={action:e.dataset.action,childType:e.dataset.childType,direction:e.dataset.direction};let n=null;switch(t.childType){case"row":n=this.tableController.currentRowCells;break;case"column":n=this.tableController.currentColumnCells;break;case"table":n=this.tableController.tableRows}n&&n.forEach((e=>{const n=this.#le.getElementByKey(e.getKey());n&&(n.classList.toggle(theme.tableCellHighlight,!0),Object.assign(n.dataset,t))}))}#Oa(){this.#t.track(this.#le.registerUpdateListener((()=>{this.#le.getRootElement()&&this.tableController.updateSelectedTable()?this.#aa():this.#Yl()})))}#Wa(e){this.tableController.executeTableCommand(e),this.#Ga()}#aa(){this.#Za(),this.style.display="flex",this.#Qa(),this.#Ya(),this.#Ua()}#Yl(){this.style.display="none",this.#ja()}#Ga(){this.#Za(),this.#Qa(),this.#Ya(),this.#Ua()}#Ya(){this.querySelector("details[open]")?.removeAttribute("open")}#Za(){const e=this.tableController.currentTableNode;if(!e)return;const t=this.#le.getElementByKey(e.getKey());if(!t)return;const n=t.getBoundingClientRect(),r=this.#se.getBoundingClientRect(),i=n.top-r.top,o=(n.left+n.right)/2-r.left;this.style.top=`${i}px`,this.style.left=`${o}px`}#Qa(){const e=this.tableController.currentTableNode;if(!e)return;const t=xn(this.#le,e);if(!t)return;const n=t.rows,r=t.columns;this.rowCount.textContent=`${n} row${1===n?"":"s"}`,this.columnCount.textContent=`${r} column${1===r?"":"s"}`}#Ja(){const e=this.tableController.currentCell;if(!e)return;const t=this.#le.getElementByKey(e.getKey());t&&t.classList.add(theme.tableCellFocus)}#ja(){this.#se.querySelectorAll(`.${theme.tableCellFocus}`)?.forEach((e=>{e.classList.remove(theme.tableCellFocus)})),this.#se.querySelectorAll(`.${theme.tableCellHighlight}`)?.forEach((e=>{e.classList.remove(theme.tableCellHighlight),e.removeAttribute("data-action"),e.removeAttribute("data-child-type"),e.removeAttribute("data-direction")})),this.#Ja()}#za(e){const{action:t,childType:n}=e,r=[t,n,"insert"==t?e.direction:null].filter(Boolean).join("-");return TableIcons[r]}}class NativeAdapter{frozenLinkKey=null;constructor(e){this.editorElement=e,this.editorContentElement=e.editorContentElement}dispatchAttributesChange(e,t,n,r){dispatch(this.editorElement,"lexxy:attributes-change",{attributes:e,link:t?{href:t}:null,highlight:n,headingTag:r})}dispatchEditorInitialized(e){dispatch(this.editorElement,"lexxy:editor-initialized",e)}freeze(){let e=null;this.editorElement.editor?.getEditorState().read((()=>{const t=Qr();if(!Fr(t))return;const n=At$2(t.anchor.getNode(),F$4);n&&(e=n.getKey())})),this.frozenLinkKey=e,this.editorContentElement.contentEditable="false"}thaw(){this.editorContentElement.contentEditable="true"}unlinkFrozenNode(){const e=this.frozenLinkKey;if(!e)return!1;const t=Yo(e);if(!z$5(t))return this.frozenLinkKey=null,!1;const n=t.getChildren();for(const e of n)t.insertBefore(e);t.remove();const r=this.#Xa(n),i=this.#ec(n);if(r&&i){const e=Qr();Fr(e)&&(e.anchor.set(r.getKey(),0,"text"),e.focus.set(i.getKey(),i.getTextContent().length,"text"))}return this.frozenLinkKey=null,!0}#Xa(e){for(const t of e){if(Tr(t))return t;if(Wi(t)){const e=this.#Xa(t.getChildren());if(e)return e}}return null}#ec(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(Tr(n))return n;if(Wi(n)){const e=this.#ec(n.getChildren());if(e)return e}}return null}}const configure=Lexxy.configure;setTimeout(defineElements,0);export{$createActionTextAttachmentNode,$createActionTextAttachmentUploadNode,$isActionTextAttachmentNode,$isCustomActionTextAttachmentNode,ActionTextAttachmentNode,ActionTextAttachmentUploadNode,CustomActionTextAttachmentNode,EditorSanitizer,LexxyExtension as Extension,HorizontalDividerNode,Lexical_prod as Lexical,NativeAdapter,REWRITE_HISTORY_COMMAND,configure,highlightCode,highlightElement};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.